PageSourceSearch

https://www.ambetterhealth.com/etc.clientlibs/centene/clientlibs/c…-99d215e7c72c9185bedb9fde6ba96bc5-lc.min.js

js ambetterhealth.com collected 2026-09-24 09:54:19 UTC 1,288,585 bytes, 30,885 lines download raw bytes

1(function(CQ){CQ.WCM=CQ.WCM||{};CQ.WCM.Image=CQ.WCM.Image||function(){var self={};var CONST={MAP_SELECTOR:".cq-wcm-foundation-image-map"};self.handleResize=function(){var elements=document.querySelectorAll(CONST.MAP_SELECTOR);Array.prototype.forEach.call(elements,function(el){if(!el.getAttribute("usemap"))return;var imgSrc=el.getAttribute("src"),onLoadImg=document.createElement("img");onLoadImg.addEventListener("load",function(){var imgWidth=el.getAttribute("width")||el.naturalWidth,imgHeight=el.getAttribute("height")||
2el.naturalHeight;if(!imgWidth||!imgHeight){var tempImage=new Image;tempImage.src=imgSrc;if(!imgWidth)imgWidth=tempImage.width;if(!imgHeight)imgHeight=tempImage.height}var relWidth=el.offsetWidth/100,relHeight=el.offsetHeight/100,map=el.getAttribute("usemap");map=map.replace("#","");var maps=document.querySelectorAll('map[name\x3d"'+map+'"]');Array.prototype.forEach.call(maps,function(mapEl){var areas=mapEl.querySelectorAll("area");Array.prototype.forEach.call(areas,function(areaEl){if(!areaEl.dataset.coords)areaEl.dataset.coords=
3areaEl.getAttribute("coords");var coords=areaEl.dataset.coords.split(","),relCoords=new Array(coords.length);for(var i=0;i<coords.length;++i)if(i%2==0)relCoords[i]=parseInt(coords[i]/imgWidth*100*relWidth);else relCoords[i]=parseInt(coords[i]/imgHeight*100*relHeight);areaEl.setAttribute("coords",relCoords.toString())})})});onLoadImg.setAttribute("src",imgSrc)})};return self}();var addEventListener=window.addEventListener||window.attachEvent,MutationObserver=window.MutationObserver||window.WebKitMutationObserver||
4window.MozMutationObserver,mutationConfig={attributes:true},observer=new MutationObserver(function(mutations){mutations.forEach(function(){CQ.WCM.Image.handleResize()})});addEventListener("resize",CQ.WCM.Image.handleResize);observer.observe(document,mutationConfig);CQ.WCM.Image.handleResize()})(CQ);
5(function($){$.fn.rwdImageMaps=function(){var $img=this;var rwdImageMap=function(){$img.each(function(){if(typeof $(this).attr("usemap")=="undefined")return;var that=this,$that=$(that);$("\x3cimg /\x3e").on("load",function(){var attrW="width",attrH="height",w=$that.attr(attrW),h=$that.attr(attrH);if(!w||!h){var temp=new Image;temp.src=$that.attr("src");if(!w)w=temp.width;if(!h)h=temp.height}var wPercent=$that.width()/100,hPercent=$that.height()/100,map=$that.attr("usemap").replace("#",""),c="coords";
6$('map[name\x3d"'+map+'"]').find("area").each(function(){var $this=$(this);if(!$this.data(c))$this.data(c,$this.attr(c));var coords=$this.data(c).split(","),coordsPercent=new Array(coords.length);for(var i=0;i<coordsPercent.length;++i)if(i%2===0)coordsPercent[i]=parseInt(coords[i]/w*100*wPercent);else coordsPercent[i]=parseInt(coords[i]/h*100*hPercent);$this.attr(c,coordsPercent.toString())})}).attr("src",$that.attr("src"))})};$(window).resize(rwdImageMap).trigger("resize");return this}})(jQuery);
7(function(document,$){var MutationObserver=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,mutationConfig={attributes:true},observer=new MutationObserver(function(mutations){mutations.forEach(function(){bindPlugin()})});$(function(){bindPlugin();observer.observe(document.documentElement,mutationConfig)});function bindPlugin(){$("div[id^\x3d'cq-image-jsp-']").each(function(i,el){$("img[usemap]",el).rwdImageMaps()})}})(document,$CQ);
8(function($){$(function(){function errorLog(error,message){try{if($.cq.isAuthor()||window.location.hash=="#debug"){if(typeof console!="undefined"&&typeof console.log!="undefined"){console.log(error);console.log(message)}alert(error.name+":\n"+error.message+".\n"+message+".")}}catch(e){}}try{var removeHash=function(context){try{if(window.location.hash.length>0&&$(window.location.hash,context).length>0)window.location=(window.location+"").replace(window.location.hash,"")}catch(e){errorLog(e,"Could not remove hash")}};
9var fadingSpeed=$.browser.msie?0:250;try{$(".cq-carousel").each(function(){var carousel=$(this);var playDelay=+$("var[title\x3d'play-delay']",this).text();if(!playDelay)playDelay=6E3;var slidingSpeed=+$("var[title\x3d'transition-time']",this).text();if(!slidingSpeed)slidingSpeed=1E3;var banners=$(".cq-carousel-banners",this);var switcher=$(".cq-carousel-banner-switch",this);var links=switcher.find("a");var items=$(".cq-carousel-banner-item",this);var width=items.outerWidth();var itemActive=items.filter(":first");
10var itemPrevious=null;var interval=null;var i=0;var ctlPrev=$("a.cq-carousel-control-prev",this);
10ctlPrev.click(function(){if(ctlPrev.is(".cq-carousel-active"))$(links[(i+links.length-1)%links.length]).click();return false});var ctlNext=$("a.cq-carousel-control-next",this);ctlNext.click(function(){if(ctlNext.is(".cq-carousel-active"))$(links[(i+1)%links.length]).click();return false});if(links.length>1)ctlNext.addClass("cq-carousel-active");function play(){stop();if(playDelay>0)interval=setInterval(function(){$(links[(i+
111)%links.length]).click()},playDelay)}function stop(){if(interval!==null){clearInterval(interval);interval=null}}if(fadingSpeed||$.browser.version>6)itemActive.css("left",0);else itemActive.show();links.click(function(){var link=$(this);var itemNew=items.filter(link.attr("href"));var j=itemNew.prevAll().length;var direction=j>i||interval!==null?1:-1;if(!link.is(".cq-carousel-active")){links.removeClass("cq-carousel-active");link.addClass("cq-carousel-active");if(itemActive.is(":animated")){itemActive.stop(true,
12true);itemPrevious.stop(true,true)}if(fadingSpeed){itemNew.css({"left":direction*width}).animate({"left":0,"opacity":1},slidingSpeed);itemActive.animate({"left":-direction*width,"opacity":0},slidingSpeed)}else if($.browser.version>6){itemNew.css({"left":direction*width,opacity:1}).animate({"left":0},slidingSpeed);itemActive.animate({"left":-direction*width},slidingSpeed)}else{itemNew.fadeIn();itemActive.fadeOut()}itemPrevious=itemActive;itemActive=itemNew;i=j;if(i>0)ctlPrev.addClass("cq-carousel-active");
13else ctlPrev.removeClass("cq-carousel-active");if(i<links.length-1)ctlNext.addClass("cq-carousel-active");else ctlNext.removeClass("cq-carousel-active")}return false}).each(function(){var link=$(this);link.attr("title",link.text())}).filter(":first").addClass("cq-carousel-active");play();carousel.hover(function(){stop();ctlPrev.fadeIn();ctlNext.fadeIn()},function(){play();ctlPrev.fadeOut();ctlNext.fadeOut()});removeHash(this)})}catch(e){errorLog(e,"Could not initialize the banners")}}catch(e$0){errorLog(e$0,
14"Init failed")}})})($CQ||$);
15/*
16 matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
17(function($){var $event=$.event,$special,resizeTimeout;$special=$event.special.debouncedresize={setup:function(){$(this).on("resize",$special.handler)},teardown:function(){$(this).off("resize",$special.handler)},handler:function(event,execAsap){var context=this,args=arguments,dispatch=function(){event.type="debouncedresize";$event.dispatch.apply(context,args)};if(resizeTimeout)clearTimeout(resizeTimeout);execAsap?dispatch():resizeTimeout=setTimeout(dispatch,$special.threshold)},threshold:150}})($CQ);
18window.matchMedia=window.matchMedia||function(doc,undefined){var bool,docElem=doc.documentElement,refNode=docElem.firstElementChild||docElem.firstChild,fakeBody=doc.createElement("body"),div=doc.createElement("div");div.id="mq-test-1";div.style.cssText="position:absolute;top:-100em";fakeBody.style.background="none";fakeBody.appendChild(div);return function(q){div.innerHTML='\x26shy;\x3cstyle media\x3d"'+q+'"\x3e #mq-test-1 { width: 42px; }\x3c/style\x3e';docElem.insertBefore(fakeBody,refNode);bool=
19div.offsetWidth===42;docElem.removeChild(fakeBody);return{matches:bool,media:q}}}(document);
20(function($,w){w.picturefill=function(context){var undefined;if(context===undefined)context=$("body");$("div[data-picture]",context).each(function(){var currentPicture=this;var matches=[];$("div[data-media]",currentPicture).each(function(){var media=$(this).attr("data-media");if(!media||w.matchMedia&&w.matchMedia(media).matches)matches.push(this)});var $picImg=$("img",currentPicture).first();if(matches.length){if($picImg.size()===0){var $currentPicture=$(currentPicture);$picImg=$("\x3cimg /\x3e").attr("alt",
21$currentPicture.attr("data-alt")).appendTo($currentPicture)}$picImg.attr("src",matches.pop().getAttribute("data-src"))}else $picImg.remove()})};$(function(){w.picturefill()});$(w).on("debouncedresize",function(){w.picturefill()})})($CQ,this);
22function cq5forms_isArray(obj){if(Array.isArray)return Array.isArray(obj);else return Object.prototype.toString.call(obj)==="[object Array]"}function cq5forms_isNodeList(obj){var prototypeName=Object.prototype.toString.call(obj);return typeof obj==="object"&&/^\[object (HTMLCollection|NodeList|RadioNodeList)\]$/.test(prototypeName)&&typeof obj.length==="number"&&(obj.length===0||typeof obj[0]==="object"&&obj[0].nodeType>0)}
23function cq5forms_showMsg(fid,field,msg,index){var f=document.forms[fid].elements[field];alert(msg);if(cq5forms_isNodeList(f))f=Array.prototype.slice.call(f);if(cq5forms_isArray(f)){if(!index)index=0;f[index].focus()}else f.focus()}
24function cq5forms_isEmpty(obj){if(obj===undefined)return false;var empty=true;if(cq5forms_isNodeList(obj))obj=Array.prototype.slice.call(obj);if(cq5forms_isArray(obj))for(i=0;i<obj.length;i++)if(obj[i].type=="radio"||obj[i].type=="checkbox"){if(obj[i].checked)empty=false}else if(obj[i].localName=="option"){if(obj[i].selected)empty=false}else{if(obj[i].value.length>0)empty=false}else if(obj.type=="radio"||obj.type=="checkbox"){if(obj.checked)empty=false}else if(obj.value.length>0)empty=false;return empty}
25function cq5forms_regcheck(obj,pattern){var result=false;var t=pattern.exec(obj);if(t){var len=obj.length;var pattlen=t[0].length;result=pattlen==len}return result}function cq5forms_multiResourceChange(evt,name,force){if(!force){if(!evt)evt=window.event;if(evt.keyCode<48&&evt.keyCode!=8&&evt.keyCode!=46)return}try{document.getElementById(name).checked=true}catch(e){}};
26(function(CQ){CQ.WCM=CQ.WCM||{};CQ.WCM.Image=CQ.WCM.Image||function(){var self={};var CONST={MAP_SELECTOR:".cq-wcm-foundation-image-map"};self.handleResize=function(){var elements=document.querySelectorAll(CONST.MAP_SELECTOR);Array.prototype.forEach.call(elements,function(el){if(!el.getAttribute("usemap"))return;var imgSrc=el.getAttribute("src"),onLoadImg=document.createElement("img");onLoadImg.addEventListener("load",function(){var imgWidth=el.getAttribute("width")||el.naturalWidth,imgHeight=el.getAttribute("height")||
27el.naturalHeight;if(!imgWidth||!imgHeight){var tempImage=new Image;tempImage.src=imgSrc;if(!imgWidth)imgWidth=tempImage.width;if(!imgHeight)imgHeight=tempImage.height}var relWidth=el.offsetWidth/100,relHeight=el.offsetHeight/100,map=el.getAttribute("usemap");map=map.replace("#","");var maps=document.querySelectorAll('map[name\x3d"'+map+'"]');Array.prototype.forEach.call(maps,function(mapEl){var areas=mapEl.querySelectorAll("area");Array.prototype.forEach.call(areas,function(areaEl){if(!areaEl.dataset.coords)areaEl.dataset.coords=
28areaEl.getAttribute("coords");var coords=areaEl.dataset.coords.split(","),relCoords=new Array(coords.length);for(var i=0;i<coords.length;++i)if(i%2==0)relCoords[i]=parseInt(coords[i]/imgWidth*100*relWidth);else relCoords[i]=parseInt(coords[i]/imgHeight*100*relHeight);areaEl.setAttribute("coords",relCoords.toString())})})});onLoadImg.setAttribute("src",imgSrc)})};return self}();var addEventListener=window.addEventListener||window.attachEvent,MutationObserver=window.MutationObserver||window.WebKitMutationObserver||
29window.MozMutationObserver,mutationConfig={attributes:true},observer=new MutationObserver(function(mutations){mutations.forEach(function(){CQ.WCM.Image.handleResize()})});addEventListener("resize",CQ.WCM.Image.handleResize);observer.observe(document,mutationConfig);CQ.WCM.Image.handleResize()})(CQ);
30(function($){$.fn.rwdImageMaps=function(){var $img=this;var rwdImageMap=function(){$img.each(function(){if(typeof $(this).attr("usemap")=="undefined")return;var that=this,$that=$(that);$("\x3cimg /\x3e").on("load",function(){var attrW="width",attrH="height",w=$that.attr(attrW),h=$that.attr(attrH);if(!w||!h){var temp=new Image;temp.src=$that.attr("src");if(!w)w=temp.width;if(!h)h=temp.height}var wPercent=$that.width()/100,hPercent=$that.height()/100,map=$that.attr("usemap").replace("#",""),c="coords";
31$('map[name\x3d"'+map+'"]').find("area").each(function(){var $this=$(this);if(!$this.data(c))$this.data(c,$this.attr(c));var coords=$this.data(c).split(","),coordsPercent=new Array(coords.length);for(var i=0;i<coordsPercent.length;++i)if(i%2===0)coordsPercent[i]=parseInt(coords[i]/w*100*wPercent);else coordsPercent[i]=parseInt(coords[i]/h*100*hPercent);$this.attr(c,coordsPercent.toString())})}).attr("src",$that.attr("src"))})};$(window).resize(rwdImageMap).trigger("resize");return this}})(jQuery);
32(function(document,$){var MutationObserver=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,mutationConfig={attributes:true},observer=new MutationObserver(function(mutations){mutations.forEach(function(){bindPlugin()})});$(function(){bindPlugin();observer.observe(document.documentElement,mutationConfig)});function bindPlugin(){$("div[id^\x3d'cq-image-jsp-']").each(function(i,el){$("img[usemap]",el).rwdImageMaps()})}})(document,$CQ);
33(function($){$(function(){function errorLog(error,message){try{if($.cq.isAuthor()||window.location.hash=="#debug"){if(typeof console!="undefined"&&typeof console.log!="undefined"){console.log(error);console.log(message)}alert(error.name+":\n"+error.message+".\n"+message+".")}}catch(e){}}try{var removeHash=function(context){try{if(window.location.hash.length>0&&$(window.location.hash,context).length>0)window.location=(window.location+"").replace(window.location.hash,"")}catch(e){errorLog(e,"Could not remove hash")}};
34var fadingSpeed=$.browser.msie?0:250;try{$(".cq-carousel").each(function(){var carousel=$(this);var playDelay=+$("var[title\x3d'play-delay']",this).text();if(!playDelay)playDelay=6E3;var slidingSpeed=+$("var[title\x3d'transition-time']",this).text();if(!slidingSpeed)slidingSpeed=1E3;var banners=$(".cq-carousel-banners",this);var switcher=$(".cq-carousel-banner-switch",this);var links=switcher.find("a");var items=$(".cq-carousel-banner-item",this);var width=items.outerWidth();var itemActive=items.filter(":first");
35var itemPrevious=null;var interval=null;var i=0;var ctlPrev=$("a.cq-carousel-control-prev",this);
35ctlPrev.click(function(){if(ctlPrev.is(".cq-carousel-active"))$(links[(i+links.length-1)%links.length]).click();return false});var ctlNext=$("a.cq-carousel-control-next",this);ctlNext.click(function(){if(ctlNext.is(".cq-carousel-active"))$(links[(i+1)%links.length]).click();return false});if(links.length>1)ctlNext.addClass("cq-carousel-active");function play(){stop();if(playDelay>0)interval=setInterval(function(){$(links[(i+
361)%links.length]).click()},playDelay)}function stop(){if(interval!==null){clearInterval(interval);interval=null}}if(fadingSpeed||$.browser.version>6)itemActive.css("left",0);else itemActive.show();links.click(function(){var link=$(this);var itemNew=items.filter(link.attr("href"));var j=itemNew.prevAll().length;var direction=j>i||interval!==null?1:-1;if(!link.is(".cq-carousel-active")){links.removeClass("cq-carousel-active");link.addClass("cq-carousel-active");if(itemActive.is(":animated")){itemActive.stop(true,
37true);itemPrevious.stop(true,true)}if(fadingSpeed){itemNew.css({"left":direction*width}).animate({"left":0,"opacity":1},slidingSpeed);itemActive.animate({"left":-direction*width,"opacity":0},slidingSpeed)}else if($.browser.version>6){itemNew.css({"left":direction*width,opacity:1}).animate({"left":0},slidingSpeed);itemActive.animate({"left":-direction*width},slidingSpeed)}else{itemNew.fadeIn();itemActive.fadeOut()}itemPrevious=itemActive;itemActive=itemNew;i=j;if(i>0)ctlPrev.addClass("cq-carousel-active");
38else ctlPrev.removeClass("cq-carousel-active");if(i<links.length-1)ctlNext.addClass("cq-carousel-active");else ctlNext.removeClass("cq-carousel-active")}return false}).each(function(){var link=$(this);link.attr("title",link.text())}).filter(":first").addClass("cq-carousel-active");play();carousel.hover(function(){stop();ctlPrev.fadeIn();ctlNext.fadeIn()},function(){play();ctlPrev.fadeOut();ctlNext.fadeOut()});removeHash(this)})}catch(e){errorLog(e,"Could not initialize the banners")}}catch(e$0){errorLog(e$0,
39"Init failed")}})})($CQ||$);
40(function($){var $event=$.event,$special,resizeTimeout;$special=$event.special.debouncedresize={setup:function(){$(this).on("resize",$special.handler)},teardown:function(){$(this).off("resize",$special.handler)},handler:function(event,execAsap){var context=this,args=arguments,dispatch=function(){event.type="debouncedresize";$event.dispatch.apply(context,args)};if(resizeTimeout)clearTimeout(resizeTimeout);execAsap?dispatch():resizeTimeout=setTimeout(dispatch,$special.threshold)},threshold:150}})($CQ);
41window.matchMedia=window.matchMedia||function(doc,undefined){var bool,docElem=doc.documentElement,refNode=docElem.firstElementChild||docElem.firstChild,fakeBody=doc.createElement("body"),div=doc.createElement("div");div.id="mq-test-1";div.style.cssText="position:absolute;top:-100em";fakeBody.style.background="none";fakeBody.appendChild(div);return function(q){div.innerHTML='\x26shy;\x3cstyle media\x3d"'+q+'"\x3e #mq-test-1 { width: 42px; }\x3c/style\x3e';docElem.insertBefore(fakeBody,refNode);bool=
42div.offsetWidth===42;docElem.removeChild(fakeBody);return{matches:bool,media:q}}}(document);
43(function($,w){w.picturefill=function(context){var undefined;if(context===undefined)context=$("body");$("div[data-picture]",context).each(function(){var currentPicture=this;var matches=[];$("div[data-media]",currentPicture).each(function(){var media=$(this).attr("data-media");if(!media||w.matchMedia&&w.matchMedia(media).matches)matches.push(this)});var $picImg=$("img",currentPicture).first();if(matches.length){if($picImg.size()===0){var $currentPicture=$(currentPicture);$picImg=$("\x3cimg /\x3e").attr("alt",
44$currentPicture.attr("data-alt")).appendTo($currentPicture)}$picImg.attr("src",matches.pop().getAttribute("data-src"))}else $picImg.remove()})};$(function(){w.picturefill()});$(w).on("debouncedresize",function(){w.picturefill()})})($CQ,this);function cq5forms_isArray(obj){if(Array.isArray)return Array.isArray(obj);else return Object.prototype.toString.call(obj)==="[object Array]"}
45function cq5forms_isNodeList(obj){var prototypeName=Object.prototype.toString.call(obj);return typeof obj==="object"&&/^\[object (HTMLCollection|NodeList|RadioNodeList)\]$/.test(prototypeName)&&typeof obj.length==="number"&&(obj.length===0||typeof obj[0]==="object"&&obj[0].nodeType>0)}
46function cq5forms_showMsg(fid,field,msg,index){var f=document.forms[fid].elements[field];alert(msg);if(cq5forms_isNodeList(f))f=Array.prototype.slice.call(f);if(cq5forms_isArray(f)){if(!index)index=0;f[index].focus()}else f.focus()}
47function cq5forms_isEmpty(obj){if(obj===undefined)return false;var empty=true;if(cq5forms_isNodeList(obj))obj=Array.prototype.slice.call(obj);if(cq5forms_isArray(obj))for(i=0;i<obj.length;i++)if(obj[i].type=="radio"||obj[i].type=="checkbox"){if(obj[i].checked)empty=false}else if(obj[i].localName=="option"){if(obj[i].selected)empty=false}else{if(obj[i].value.length>0)empty=false}else if(obj.type=="radio"||obj.type=="checkbox"){if(obj.checked)empty=false}else if(obj.value.length>0)empty=false;return empty}
48function cq5forms_regcheck(obj,pattern){var result=false;var t=pattern.exec(obj);if(t){var len=obj.length;var pattlen=t[0].length;result=pattlen==len}return result}function cq5forms_multiResourceChange(evt,name,force){if(!force){if(!evt)evt=window.event;if(evt.keyCode<48&&evt.keyCode!=8&&evt.keyCode!=46)return}try{document.getElementById(name).checked=true}catch(e){}};
49/*! jQuery UI - v1.13.2 - 2022-07-14
50* http://jqueryui.com
51* Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-patch.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js
52* Copyright jQuery Foundation and other contributors; Licensed MIT */
53
54( function( factory ) {
55	"use strict";
56	
57	if ( typeof define === "function" && define.amd ) {
58
59		// AMD. Register as an anonymous module.
60		define( [ "jquery" ], factory );
61	} else {
62
63		// Browser globals
64		factory( jQuery );
65	}
66} )( function( $ ) {
67"use strict";
68
69$.ui = $.ui || {};
70
71var version = $.ui.version = "1.13.2";
72
73
74/*!
75 * jQuery UI Widget 1.13.2
76 * http://jqueryui.com
77 *
78 * Copyright jQuery Foundation and other contributors
79 * Released under the MIT license.
80 * http://jquery.org/license
81 */
82
83//>>label: Widget
84//>>group: Core
85//>>description: Provides a factory for creating stateful widgets with a common API.
86//>>docs: http://api.jqueryui.com/jQuery.widget/
87//>>demos: http
vendor: 8,114 bytes, lines 87-378
87://jqueryui.com/widget/
88
89
90var widgetUuid = 0;
91var widgetHasOwnProperty = Array.prototype.hasOwnProperty;
92var widgetSlice = Array.prototype.slice;
93
94$.cleanData = ( function( orig ) {
95	return function( elems ) {
96		var events, elem, i;
97		for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) {
98
99			// Only trigger remove when necessary to save time
100			events = $._data( elem, "events" );
101			if ( events && events.remove ) {
102				$( elem ).triggerHandler( "remove" );
103			}
104		}
105		orig( elems );
106	};
107} )( $.cleanData );
108
109$.widget = function( name, base, prototype ) {
110	var existingConstructor, constructor, basePrototype;
111
112	// ProxiedPrototype allows the provided prototype to remain unmodified
113	// so that it can be used as a mixin for multiple widgets (#8876)
114	var proxiedPrototype = {};
115
116	var namespace = name.split( "." )[ 0 ];
117	name = name.split( "." )[ 1 ];
118	var fullName = namespace + "-" + name;
119
120	if ( !prototype ) {
121		prototype = base;
122		base = $.Widget;
123	}
124
125	if ( Array.isArray( prototype ) ) {
126		prototype = $.extend.apply( null, [ {} ].concat( prototype ) );
127	}
128
129	// Create selector for plugin
130	$.expr.pseudos[ fullName.toLowerCase() ] = function( elem ) {
131		return !!$.data( elem, fullName );
132	};
133
134	$[ namespace ] = $[ namespace ] || {};
135	existingConstructor = $[ namespace ][ name ];
136	constructor = $[ namespace ][ name ] = function( options, element ) {
137
138		// Allow instantiation without "new" keyword
139		if ( !this || !this._createWidget ) {
140			return new constructor( options, element );
141		}
142
143		// Allow instantiation without initializing for simple inheritance
144		// must use "new" keyword (the code above always passes args)
145		if ( arguments.length ) {
146			this._createWidget( options, element );
147		}
148	};
149
150	// Extend with the existing constructor to carry over any static properties
151	$.extend( constructor, existingConstructor, {
152		version: prototype.version,
153
154		// Copy the object used to create the prototype in case we need to
155		// redefine the widget later
156		_proto: $.extend( {}, prototype ),
157
158		// Track widgets that inherit from this widget in case this widget is
159		// redefined after a widget inherits from it
160		_childConstructors: []
161	} );
162
163	basePrototype = new base();
164
165	// We need to make the options hash a property directly on the new instance
166	// otherwise we'll modify the options hash on the prototype that we're
167	// inheriting from
168	basePrototype.options = $.widget.extend( {}, basePrototype.options );
169	$.each( prototype, function( prop, value ) {
170		if ( typeof value !== "function" ) {
171			proxiedPrototype[ prop ] = value;
172			return;
173		}
174		proxiedPrototype[ prop ] = ( function() {
175			function _super() {
176				return base.prototype[ prop ].apply( this, arguments );
177			}
178
179			function _superApply( args ) {
180				return base.prototype[ prop ].apply( this, args );
181			}
182
183			return function() {
184				var __super = this._super;
185				var __superApply = this._superApply;
186				var returnValue;
187
188				this._super = _super;
189				this._superApply = _superApply;
190
191				returnValue = value.apply( this, arguments );
192
193				this._super = __super;
194				this._superApply = __superApply;
195
196				return returnValue;
197			};
198		} )();
199	} );
200	constructor.prototype = $.widget.extend( basePrototype, {
201
202		// TODO: remove support for widgetEventPrefix
203		// always use the name + a colon as the prefix, e.g., draggable:start
204		// don't prefix for widgets that aren't DOM-based
205		widgetEventPrefix: existingConstructor ? ( basePrototype.widgetEventPrefix || name ) : name
206	}, proxiedPrototype, {
207		constructor: constructor,
208		namespace: namespace,
209		widgetName: name,
210		widgetFullName: fullName
211	} );
212
213	// If this widget is being redefined then we need to find all widgets that
214	// are inheriting from it and redefine all of them so that they inherit from
215	// the new version of this widget. We're essentially trying to replace one
216	// level in the prototype chain.
217	if ( existingConstructor ) {
218		$.each( existingConstructor._childConstructors, function( i, child ) {
219			var childPrototype = child.prototype;
220
221			// Redefine the child widget using the same prototype that was
222			// originally used, but inherit from the new version of the base
223			$.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor,
224				child._proto );
225		} );
226
227		// Remove the list of existing child constructors from the old constructor
228		// so the old child constructors can be garbage collected
229		delete existingConstructor._childConstructors;
230	} else {
231		base._childConstructors.push( constructor );
232	}
233
234	$.widget.bridge( name, constructor );
235
236	return constructor;
237};
238
239$.widget.extend = function( target ) {
240	var input = widgetSlice.call( arguments, 1 );
241	var inputIndex = 0;
242	var inputLength = input.length;
243	var key;
244	var value;
245
246	for ( ; inputIndex < inputLength; inputIndex++ ) {
247		for ( key in input[ inputIndex ] ) {
248			value = input[ inputIndex ][ key ];
249			if ( widgetHasOwnProperty.call( input[ inputIndex ], key ) && value !== undefined ) {
250
251				// Clone objects
252				if ( $.isPlainObject( value ) ) {
253					target[ key ] = $.isPlainObject( target[ key ] ) ?
254						$.widget.extend( {}, target[ key ], value ) :
255
256						// Don't extend strings, arrays, etc. with objects
257						$.widget.extend( {}, value );
258
259				// Copy everything else by reference
260				} else {
261					target[ key ] = value;
262				}
263			}
264		}
265	}
266	return target;
267};
268
269$.widget.bridge = function( name, object ) {
270	var fullName = object.prototype.widgetFullName || name;
271	$.fn[ name ] = function( options ) {
272		var isMethodCall = typeof options === "string";
273		var args = widgetSlice.call( arguments, 1 );
274		var returnValue = this;
275
276		if ( isMethodCall ) {
277
278			// If this is an empty collection, we need to have the instance method
279			// return undefined instead of the jQuery instance
280			if ( !this.length && options === "instance" ) {
281				returnValue = undefined;
282			} else {
283				this.each( function() {
284					var methodValue;
285					var instance = $.data( this, fullName );
286
287					if ( options === "instance" ) {
288						returnValue = instance;
289						return false;
290					}
291
292					if ( !instance ) {
293						return $.error( "cannot call methods on " + name +
294							" prior to initialization; " +
295							"attempted to call method '" + options + "'" );
296					}
297
298					if ( typeof instance[ options ] !== "function" ||
299						options.charAt( 0 ) === "_" ) {
300						return $.error( "no such method '" + options + "' for " + name +
301							" widget instance" );
302					}
303
304					methodValue = instance[ options ].apply( instance, args );
305
306					if ( methodValue !== instance && methodValue !== undefined ) {
307						returnValue = methodValue && methodValue.jquery ?
308							returnValue.pushStack( methodValue.get() ) :
309							methodValue;
310						return false;
311					}
312				} );
313			}
314		} else {
315
316			// Allow multiple hashes to be passed on init
317			if ( args.length ) {
318				options = $.widget.extend.apply( null, [ options ].concat( args ) );
319			}
320
321			this.each( function() {
322				var instance = $.data( this, fullName );
323				if ( instance ) {
324					instance.option( options || {} );
325					if ( instance._init ) {
326						instance._init();
327					}
328				} else {
329					$.data( this, fullName, new object( options, this ) );
330				}
331			} );
332		}
333
334		return returnValue;
335	};
336};
337
338$.Widget = function( /* options, element */ ) {};
339$.Widget._childConstructors = [];
340
341$.Widget.prototype = {
342	widgetName: "widget",
343	widgetEventPrefix: "",
344	defaultElement: "<div>",
345
346	options: {
347		classes: {},
348		disabled: false,
349
350		// Callbacks
351		create: null
352	},
353
354	_createWidget: function( options, element ) {
355		element = $( element || this.defaultElement || this )[ 0 ];
356		this.element = $( element );
357		this.uuid = widgetUuid++;
358		this.eventNamespace = "." + this.widgetName + this.uuid;
359
360		this.bindings = $();
361		this.hoverable = $();
362		this.focusable = $();
363		this.classesElementLookup = {};
364
365		if ( element !== this ) {
366			$.data( element, this.widgetFullName, this );
367			this._on( true, this.element, {
368				remove: function( event ) {
369					if ( event.target === element ) {
370						this.destroy();
371					}
372				}
373			} );
374			this.document = $( element.style ?
375
376				// Element within the document
377				element.ownerDocument :
378
vendor: 11,561 bytes, lines 379-817
379				// Element is window or document
380				element.document || element );
381			this.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow );
382		}
383
384		this.options = $.widget.extend( {},
385			this.options,
386			this._getCreateOptions(),
387			options );
388
389		this._create();
390
391		if ( this.options.disabled ) {
392			this._setOptionDisabled( this.options.disabled );
393		}
394
395		this._trigger( "create", null, this._getCreateEventData() );
396		this._init();
397	},
398
399	_getCreateOptions: function() {
400		return {};
401	},
402
403	_getCreateEventData: $.noop,
404
405	_create: $.noop,
406
407	_init: $.noop,
408
409	destroy: function() {
410		var that = this;
411
412		this._destroy();
413		$.each( this.classesElementLookup, function( key, value ) {
414			that._removeClass( value, key );
415		} );
416
417		// We can probably remove the unbind calls in 2.0
418		// all event bindings should go through this._on()
419		this.element
420			.off( this.eventNamespace )
421			.removeData( this.widgetFullName );
422		this.widget()
423			.off( this.eventNamespace )
424			.removeAttr( "aria-disabled" );
425
426		// Clean up events and states
427		this.bindings.off( this.eventNamespace );
428	},
429
430	_destroy: $.noop,
431
432	widget: function() {
433		return this.element;
434	},
435
436	option: function( key, value ) {
437		var options = key;
438		var parts;
439		var curOption;
440		var i;
441
442		if ( arguments.length === 0 ) {
443
444			// Don't return a reference to the internal hash
445			return $.widget.extend( {}, this.options );
446		}
447
448		if ( typeof key === "string" ) {
449
450			// Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
451			options = {};
452			parts = key.split( "." );
453			key = parts.shift();
454			if ( parts.length ) {
455				curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
456				for ( i = 0; i < parts.length - 1; i++ ) {
457					curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
458					curOption = curOption[ parts[ i ] ];
459				}
460				key = parts.pop();
461				if ( arguments.length === 1 ) {
462					return curOption[ key ] === undefined ? null : curOption[ key ];
463				}
464				curOption[ key ] = value;
465			} else {
466				if ( arguments.length === 1 ) {
467					return this.options[ key ] === undefined ? null : this.options[ key ];
468				}
469				options[ key ] = value;
470			}
471		}
472
473		this._setOptions( options );
474
475		return this;
476	},
477
478	_setOptions: function( options ) {
479		var key;
480
481		for ( key in options ) {
482			this._setOption( key, options[ key ] );
483		}
484
485		return this;
486	},
487
488	_setOption: function( key, value ) {
489		if ( key === "classes" ) {
490			this._setOptionClasses( value );
491		}
492
493		this.options[ key ] = value;
494
495		if ( key === "disabled" ) {
496			this._setOptionDisabled( value );
497		}
498
499		return this;
500	},
501
502	_setOptionClasses: function( value ) {
503		var classKey, elements, currentElements;
504
505		for ( classKey in value ) {
506			currentElements = this.classesElementLookup[ classKey ];
507			if ( value[ classKey ] === this.options.classes[ classKey ] ||
508					!currentElements ||
509					!currentElements.length ) {
510				continue;
511			}
512
513			// We are doing this to create a new jQuery object because the _removeClass() call
514			// on the next line is going to destroy the reference to the current elements being
515			// tracked. We need to save a copy of this collection so that we can add the new classes
516			// below.
517			elements = $( currentElements.get() );
518			this._removeClass( currentElements, classKey );
519
520			// We don't use _addClass() here, because that uses this.options.classes
521			// for generating the string of classes. We want to use the value passed in from
522			// _setOption(), this is the new value of the classes option which was passed to
523			// _setOption(). We pass this value directly to _classes().
524			elements.addClass( this._classes( {
525				element: elements,
526				keys: classKey,
527				classes: value,
528				add: true
529			} ) );
530		}
531	},
532
533	_setOptionDisabled: function( value ) {
534		this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null, !!value );
535
536		// If the widget is becoming disabled, then nothing is interactive
537		if ( value ) {
538			this._removeClass( this.hoverable, null, "ui-state-hover" );
539			this._removeClass( this.focusable, null, "ui-state-focus" );
540		}
541	},
542
543	enable: function() {
544		return this._setOptions( { disabled: false } );
545	},
546
547	disable: function() {
548		return this._setOptions( { disabled: true } );
549	},
550
551	_classes: function( options ) {
552		var full = [];
553		var that = this;
554
555		options = $.extend( {
556			element: this.element,
557			classes: this.options.classes || {}
558		}, options );
559
560		function bindRemoveEvent() {
561			var nodesToBind = [];
562
563			options.element.each( function( _, element ) {
564				var isTracked = $.map( that.classesElementLookup, function( elements ) {
565					return elements;
566				} )
567					.some( function( elements ) {
568						return elements.is( element );
569					} );
570
571				if ( !isTracked ) {
572					nodesToBind.push( element );
573				}
574			} );
575
576			that._on( $( nodesToBind ), {
577				remove: "_untrackClassesElement"
578			} );
579		}
580
581		function processClassString( classes, checkOption ) {
582			var current, i;
583			for ( i = 0; i < classes.length; i++ ) {
584				current = that.classesElementLookup[ classes[ i ] ] || $();
585				if ( options.add ) {
586					bindRemoveEvent();
587					current = $( $.uniqueSort( current.get().concat( options.element.get() ) ) );
588				} else {
589					current = $( current.not( options.element ).get() );
590				}
591				that.classesElementLookup[ classes[ i ] ] = current;
592				full.push( classes[ i ] );
593				if ( checkOption && options.classes[ classes[ i ] ] ) {
594					full.push( options.classes[ classes[ i ] ] );
595				}
596			}
597		}
598
599		if ( options.keys ) {
600			processClassString( options.keys.match( /\S+/g ) || [], true );
601		}
602		if ( options.extra ) {
603			processClassString( options.extra.match( /\S+/g ) || [] );
604		}
605
606		return full.join( " " );
607	},
608
609	_untrackClassesElement: function( event ) {
610		var that = this;
611		$.each( that.classesElementLookup, function( key, value ) {
612			if ( $.inArray( event.target, value ) !== -1 ) {
613				that.classesElementLookup[ key ] = $( value.not( event.target ).get() );
614			}
615		} );
616
617		this._off( $( event.target ) );
618	},
619
620	_removeClass: function( element, keys, extra ) {
621		return this._toggleClass( element, keys, extra, false );
622	},
623
624	_addClass: function( element, keys, extra ) {
625		return this._toggleClass( element, keys, extra, true );
626	},
627
628	_toggleClass: function( element, keys, extra, add ) {
629		add = ( typeof add === "boolean" ) ? add : extra;
630		var shift = ( typeof element === "string" || element === null ),
631			options = {
632				extra: shift ? keys : extra,
633				keys: shift ? element : keys,
634				element: shift ? this.element : element,
635				add: add
636			};
637		options.element.toggleClass( this._classes( options ), add );
638		return this;
639	},
640
641	_on: function( suppressDisabledCheck, element, handlers ) {
642		var delegateElement;
643		var instance = this;
644
645		// No suppressDisabledCheck flag, shuffle arguments
646		if ( typeof suppressDisabledCheck !== "boolean" ) {
647			handlers = element;
648			element = suppressDisabledCheck;
649			suppressDisabledCheck = false;
650		}
651
652		// No element argument, shuffle and use this.element
653		if ( !handlers ) {
654			handlers = element;
655			element = this.element;
656			delegateElement = this.widget();
657		} else {
658			element = delegateElement = $( element );
659			this.bindings = this.bindings.add( element );
660		}
661
662		$.each( handlers, function( event, handler ) {
663			function handlerProxy() {
664
665				// Allow widgets to customize the disabled handling
666				// - disabled as an array instead of boolean
667				// - disabled class as method for disabling individual parts
668				if ( !suppressDisabledCheck &&
669						( instance.options.disabled === true ||
670						$( this ).hasClass( "ui-state-disabled" ) ) ) {
671					return;
672				}
673				return ( typeof handler === "string" ? instance[ handler ] : handler )
674					.apply( instance, arguments );
675			}
676
677			// Copy the guid so direct unbinding works
678			if ( typeof handler !== "string" ) {
679				handlerProxy.guid = handler.guid =
680					handler.guid || handlerProxy.guid || $.guid++;
681			}
682
683			var match = event.match( /^([\w:-]*)\s*(.*)$/ );
684			var eventName = match[ 1 ] + instance.eventNamespace;
685			var selector = match[ 2 ];
686
687			if ( selector ) {
688				delegateElement.on( eventName, selector, handlerProxy );
689			} else {
690				element.on( eventName, handlerProxy );
691			}
692		} );
693	},
694
695	_off: function( element, eventName ) {
696		eventName = ( eventName || "" ).split( " " ).join( this.eventNamespace + " " ) +
697			this.eventNamespace;
698		element.off( eventName );
699
700		// Clear the stack to avoid memory leaks (#10056)
701		this.bindings = $( this.bindings.not( element ).get() );
702		this.focusable = $( this.focusable.not( element ).get() );
703		this.hoverable = $( this.hoverable.not( element ).get() );
704	},
705
706	_delay: function( handler, delay ) {
707		function handlerProxy() {
708			return ( typeof handler === "string" ? instance[ handler ] : handler )
709				.apply( instance, arguments );
710		}
711		var instance = this;
712		return setTimeout( handlerProxy, delay || 0 );
713	},
714
715	_hoverable: function( element ) {
716		this.hoverable = this.hoverable.add( element );
717		this._on( element, {
718			mouseenter: function( event ) {
719				this._addClass( $( event.currentTarget ), null, "ui-state-hover" );
720			},
721			mouseleave: function( event ) {
722				this._removeClass( $( event.currentTarget ), null, "ui-state-hover" );
723			}
724		} );
725	},
726
727	_focusable: function( element ) {
728		this.focusable = this.focusable.add( element );
729		this._on( element, {
730			focusin: function( event ) {
731				this._addClass( $( event.currentTarget ), null, "ui-state-focus" );
732			},
733			focusout: function( event ) {
734				this._removeClass( $( event.currentTarget ), null, "ui-state-focus" );
735			}
736		} );
737	},
738
739	_trigger: function( type, event, data ) {
740		var prop, orig;
741		var callback = this.options[ type ];
742
743		data = data || {};
744		event = $.Event( event );
745		event.type = ( type === this.widgetEventPrefix ?
746			type :
747			this.widgetEventPrefix + type ).toLowerCase();
748
749		// The original event may come from any element
750		// so we need to reset the target on the new event
751		event.target = this.element[ 0 ];
752
753		// Copy original event properties over to the new event
754		orig = event.originalEvent;
755		if ( orig ) {
756			for ( prop in orig ) {
757				if ( !( prop in event ) ) {
758					event[ prop ] = orig[ prop ];
759				}
760			}
761		}
762
763		this.element.trigger( event, data );
764		return !( typeof callback === "function" &&
765			callback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false ||
766			event.isDefaultPrevented() );
767	}
768};
769
770$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
771	$.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
772		if ( typeof options === "string" ) {
773			options = { effect: options };
774		}
775
776		var hasOptions;
777		var effectName = !options ?
778			method :
779			options === true || typeof options === "number" ?
780				defaultEffect :
781				options.effect || defaultEffect;
782
783		options = options || {};
784		if ( typeof options === "number" ) {
785			options = { duration: options };
786		} else if ( options === true ) {
787			options = {};
788		}
789
790		hasOptions = !$.isEmptyObject( options );
791		options.complete = callback;
792
793		if ( options.delay ) {
794			element.delay( options.delay );
795		}
796
797		if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
798			element[ method ]( options );
799		} else if ( effectName !== method && element[ effectName ] ) {
800			element[ effectName ]( options.duration, options.easing, callback );
801		} else {
802			element.queue( function( next ) {
803				$( this )[ method ]();
804				if ( callback ) {
805					callback.call( element[ 0 ] );
806				}
807				next();
808			} );
809		}
810	};
811} );
812
813var widget = $.widget;
814
815
816/*!
817 * jQuery UI Position 1.1
vendor: 1,610 bytes, lines 817-890
8173.2
818 * http://jqueryui.com
819 *
820 * Copyright jQuery Foundation and other contributors
821 * Released under the MIT license.
822 * http://jquery.org/license
823 *
824 * http://api.jqueryui.com/position/
825 */
826
827//>>label: Position
828//>>group: Core
829//>>description: Positions elements relative to other elements.
830//>>docs: http://api.jqueryui.com/position/
831//>>demos: http://jqueryui.com/position/
832
833
834( function() {
835var cachedScrollbarWidth,
836	max = Math.max,
837	abs = Math.abs,
838	rhorizontal = /left|center|right/,
839	rvertical = /top|center|bottom/,
840	roffset = /[\+\-]\d+(\.[\d]+)?%?/,
841	rposition = /^\w+/,
842	rpercent = /%$/,
843	_position = $.fn.position;
844
845function getOffsets( offsets, width, height ) {
846	return [
847		parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
848		parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
849	];
850}
851
852function parseCss( element, property ) {
853	return parseInt( $.css( element, property ), 10 ) || 0;
854}
855
856function isWindow( obj ) {
857	return obj != null && obj === obj.window;
858}
859
860function getDimensions( elem ) {
861	var raw = elem[ 0 ];
862	if ( raw.nodeType === 9 ) {
863		return {
864			width: elem.width(),
865			height: elem.height(),
866			offset: { top: 0, left: 0 }
867		};
868	}
869	if ( isWindow( raw ) ) {
870		return {
871			width: elem.width(),
872			height: elem.height(),
873			offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
874		};
875	}
876	if ( raw.preventDefault ) {
877		return {
878			width: 0,
879			height: 0,
880			offset: { top: raw.pageY, left: raw.pageX }
881		};
882	}
883	return {
884		width: elem.outerWidth(),
885		height: elem.outerHeight(),
886		offset: elem.offset()
887	};
888}
889
890$.position =
vendor: 13,231 bytes, lines 890-1314
890 {
891	scrollbarWidth: function() {
892		if ( cachedScrollbarWidth !== undefined ) {
893			return cachedScrollbarWidth;
894		}
895		var w1, w2,
896			div = $( "<div style=" +
897				"'display:block;position:absolute;width:200px;height:200px;overflow:hidden;'>" +
898				"<div style='height:300px;width:auto;'></div></div>" ),
899			innerDiv = div.children()[ 0 ];
900
901		$( "body" ).append( div );
902		w1 = innerDiv.offsetWidth;
903		div.css( "overflow", "scroll" );
904
905		w2 = innerDiv.offsetWidth;
906
907		if ( w1 === w2 ) {
908			w2 = div[ 0 ].clientWidth;
909		}
910
911		div.remove();
912
913		return ( cachedScrollbarWidth = w1 - w2 );
914	},
915	getScrollInfo: function( within ) {
916		var overflowX = within.isWindow || within.isDocument ? "" :
917				within.element.css( "overflow-x" ),
918			overflowY = within.isWindow || within.isDocument ? "" :
919				within.element.css( "overflow-y" ),
920			hasOverflowX = overflowX === "scroll" ||
921				( overflowX === "auto" && within.width < within.element[ 0 ].scrollWidth ),
922			hasOverflowY = overflowY === "scroll" ||
923				( overflowY === "auto" && within.height < within.element[ 0 ].scrollHeight );
924		return {
925			width: hasOverflowY ? $.position.scrollbarWidth() : 0,
926			height: hasOverflowX ? $.position.scrollbarWidth() : 0
927		};
928	},
929	getWithinInfo: function( element ) {
930		var withinElement = $( element || window ),
931			isElemWindow = isWindow( withinElement[ 0 ] ),
932			isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9,
933			hasOffset = !isElemWindow && !isDocument;
934		return {
935			element: withinElement,
936			isWindow: isElemWindow,
937			isDocument: isDocument,
938			offset: hasOffset ? $( element ).offset() : { left: 0, top: 0 },
939			scrollLeft: withinElement.scrollLeft(),
940			scrollTop: withinElement.scrollTop(),
941			width: withinElement.outerWidth(),
942			height: withinElement.outerHeight()
943		};
944	}
945};
946
947$.fn.position = function( options ) {
948	if ( !options || !options.of ) {
949		return _position.apply( this, arguments );
950	}
951
952	// Make a copy, we don't want to modify arguments
953	options = $.extend( {}, options );
954
955	var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
956
957		// Make sure string options are treated as CSS selectors
958		target = typeof options.of === "string" ?
959			$( document ).find( options.of ) :
960			$( options.of ),
961
962		within = $.position.getWithinInfo( options.within ),
963		scrollInfo = $.position.getScrollInfo( within ),
964		collision = ( options.collision || "flip" ).split( " " ),
965		offsets = {};
966
967	dimensions = getDimensions( target );
968	if ( target[ 0 ].preventDefault ) {
969
970		// Force left top to allow flipping
971		options.at = "left top";
972	}
973	targetWidth = dimensions.width;
974	targetHeight = dimensions.height;
975	targetOffset = dimensions.offset;
976
977	// Clone to reuse original targetOffset later
978	basePosition = $.extend( {}, targetOffset );
979
980	// Force my and at to have valid horizontal and vertical positions
981	// if a value is missing or invalid, it will be converted to center
982	$.each( [ "my", "at" ], function() {
983		var pos = ( options[ this ] || "" ).split( " " ),
984			horizontalOffset,
985			verticalOffset;
986
987		if ( pos.length === 1 ) {
988			pos = rhorizontal.test( pos[ 0 ] ) ?
989				pos.concat( [ "center" ] ) :
990				rvertical.test( pos[ 0 ] ) ?
991					[ "center" ].concat( pos ) :
992					[ "center", "center" ];
993		}
994		pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
995		pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
996
997		// Calculate offsets
998		horizontalOffset = roffset.exec( pos[ 0 ] );
999		verticalOffset = roffset.exec( pos[ 1 ] );
1000		offsets[ this ] = [
1001			horizontalOffset ? horizontalOffset[ 0 ] : 0,
1002			verticalOffset ? verticalOffset[ 0 ] : 0
1003		];
1004
1005		// Reduce to just the positions without the offsets
1006		options[ this ] = [
1007			rposition.exec( pos[ 0 ] )[ 0 ],
1008			rposition.exec( pos[ 1 ] )[ 0 ]
1009		];
1010	} );
1011
1012	// Normalize collision option
1013	if ( collision.length === 1 ) {
1014		collision[ 1 ] = collision[ 0 ];
1015	}
1016
1017	if ( options.at[ 0 ] === "right" ) {
1018		basePosition.left += targetWidth;
1019	} else if ( options.at[ 0 ] === "center" ) {
1020		basePosition.left += targetWidth / 2;
1021	}
1022
1023	if ( options.at[ 1 ] === "bottom" ) {
1024		basePosition.top += targetHeight;
1025	} else if ( options.at[ 1 ] === "center" ) {
1026		basePosition.top += targetHeight / 2;
1027	}
1028
1029	atOffset = getOffsets( offsets.at, targetWidth, targetHeight );
1030	basePosition.left += atOffset[ 0 ];
1031	basePosition.top += atOffset[ 1 ];
1032
1033	return this.each( function() {
1034		var collisionPosition, using,
1035			elem = $( this ),
1036			elemWidth = elem.outerWidth(),
1037			elemHeight = elem.outerHeight(),
1038			marginLeft = parseCss( this, "marginLeft" ),
1039			marginTop = parseCss( this, "marginTop" ),
1040			collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) +
1041				scrollInfo.width,
1042			collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) +
1043				scrollInfo.height,
1044			position = $.extend( {}, basePosition ),
1045			myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );
1046
1047		if ( options.my[ 0 ] === "right" ) {
1048			position.left -= elemWidth;
1049		} else if ( options.my[ 0 ] === "center" ) {
1050			position.left -= elemWidth / 2;
1051		}
1052
1053		if ( options.my[ 1 ] === "bottom" ) {
1054			position.top -= elemHeight;
1055		} else if ( options.my[ 1 ] === "center" ) {
1056			position.top -= elemHeight / 2;
1057		}
1058
1059		position.left += myOffset[ 0 ];
1060		position.top += myOffset[ 1 ];
1061
1062		collisionPosition = {
1063			marginLeft: marginLeft,
1064			marginTop: marginTop
1065		};
1066
1067		$.each( [ "left", "top" ], function( i, dir ) {
1068			if ( $.ui.position[ collision[ i ] ] ) {
1069				$.ui.position[ collision[ i ] ][ dir ]( position, {
1070					targetWidth: targetWidth,
1071					targetHeight: targetHeight,
1072					elemWidth: elemWidth,
1073					elemHeight: elemHeight,
1074					collisionPosition: collisionPosition,
1075					collisionWidth: collisionWidth,
1076					collisionHeight: collisionHeight,
1077					offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],
1078					my: options.my,
1079					at: options.at,
1080					within: within,
1081					elem: elem
1082				} );
1083			}
1084		} );
1085
1086		if ( options.using ) {
1087
1088			// Adds feedback as second argument to using callback, if present
1089			using = function( props ) {
1090				var left = targetOffset.left - position.left,
1091					right = left + targetWidth - elemWidth,
1092					top = targetOffset.top - position.top,
1093					bottom = top + targetHeight - elemHeight,
1094					feedback = {
1095						target: {
1096							element: target,
1097							left: targetOffset.left,
1098							top: targetOffset.top,
1099							width: targetWidth,
1100							height: targetHeight
1101						},
1102						element: {
1103							element: elem,
1104							left: position.left,
1105							top: position.top,
1106							width: elemWidth,
1107							height: elemHeight
1108						},
1109						horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
1110						vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
1111					};
1112				if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {
1113					feedback.horizontal = "center";
1114				}
1115				if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {
1116					feedback.vertical = "middle";
1117				}
1118				if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {
1119					feedback.important = "horizontal";
1120				} else {
1121					feedback.important = "vertical";
1122				}
1123				options.using.call( this, props, feedback );
1124			};
1125		}
1126
1127		elem.offset( $.extend( position, { using: using } ) );
1128	} );
1129};
1130
1131$.ui.position = {
1132	fit: {
1133		left: function( position, data ) {
1134			var within = data.within,
1135				withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
1136				outerWidth = within.width,
1137				collisionPosLeft = position.left - data.collisionPosition.marginLeft,
1138				overLeft = withinOffset - collisionPosLeft,
1139				overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
1140				newOverRight;
1141
1142			// Element is wider than within
1143			if ( data.collisionWidth > outerWidth ) {
1144
1145				// Element is initially over the left side of within
1146				if ( overLeft > 0 && overRight <= 0 ) {
1147					newOverRight = position.left + overLeft + data.collisionWidth - outerWidth -
1148						withinOffset;
1149					position.left += overLeft - newOverRight;
1150
1151				// Element is initially over right side of within
1152				} else if ( overRight > 0 && overLeft <= 0 ) {
1153					position.left = withinOffset;
1154
1155				// Element is initially over both left and right sides of within
1156				} else {
1157					if ( overLeft > overRight ) {
1158						position.left = withinOffset + outerWidth - data.collisionWidth;
1159					} else {
1160						position.left = withinOffset;
1161					}
1162				}
1163
1164			// Too far left -> align with left edge
1165			} else if ( overLeft > 0 ) {
1166				position.left += overLeft;
1167
1168			// Too far right -> align with right edge
1169			} else if ( overRight > 0 ) {
1170				position.left -= overRight;
1171
1172			// Adjust based on position and margin
1173			} else {
1174				position.left = max( position.left - collisionPosLeft, position.left );
1175			}
1176		},
1177		top: function( position, data ) {
1178			var within = data.within,
1179				withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
1180				outerHeight = data.within.height,
1181				collisionPosTop = position.top - data.collisionPosition.marginTop,
1182				overTop = withinOffset - collisionPosTop,
1183				overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
1184				newOverBottom;
1185
1186			// Element is taller than within
1187			if ( data.collisionHeight > outerHeight ) {
1188
1189				// Element is initially over the top of within
1190				if ( overTop > 0 && overBottom <= 0 ) {
1191					newOverBottom = position.top + overTop + data.collisionHeight - outerHeight -
1192						withinOffset;
1193					position.top += overTop - newOverBottom;
1194
1195				// Element is initially over bottom of within
1196				} else if ( overBottom > 0 && overTop <= 0 ) {
1197					position.top = withinOffset;
1198
1199				// Element is initially over both top and bottom of within
1200				} else {
1201					if ( overTop > overBottom ) {
1202						position.top = withinOffset + outerHeight - data.collisionHeight;
1203					} else {
1204						position.top = withinOffset;
1205					}
1206				}
1207
1208			// Too far up -> align with top
1209			} else if ( overTop > 0 ) {
1210				position.top += overTop;
1211
1212			// Too far down -> align with bottom edge
1213			} else if ( overBottom > 0 ) {
1214				position.top -= overBottom;
1215
1216			// Adjust based on position and margin
1217			} else {
1218				position.top = max( position.top - collisionPosTop, position.top );
1219			}
1220		}
1221	},
1222	flip: {
1223		left: function( position, data ) {
1224			var within = data.within,
1225				withinOffset = within.offset.left + within.scrollLeft,
1226				outerWidth = within.width,
1227				offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
1228				collisionPosLeft = position.left - data.collisionPosition.marginLeft,
1229				overLeft = collisionPosLeft - offsetLeft,
1230				overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
1231				myOffset = data.my[ 0 ] === "left" ?
1232					-data.elemWidth :
1233					data.my[ 0 ] === "right" ?
1234						data.elemWidth :
1235						0,
1236				atOffset = data.at[ 0 ] === "left" ?
1237					data.targetWidth :
1238					data.at[ 0 ] === "right" ?
1239						-data.targetWidth :
1240						0,
1241				offset = -2 * data.offset[ 0 ],
1242				newOverRight,
1243				newOverLeft;
1244
1245			if ( overLeft < 0 ) {
1246				newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth -
1247					outerWidth - withinOffset;
1248				if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
1249					position.left += myOffset + atOffset + offset;
1250				}
1251			} else if ( overRight > 0 ) {
1252				newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset +
1253					atOffset + offset - offsetLeft;
1254				if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
1255					position.left += myOffset + atOffset + offset;
1256				}
1257			}
1258		},
1259		top: function( position, data ) {
1260			var within = data.within,
1261				withinOffset = within.offset.top + within.scrollTop,
1262				outerHeight = within.height,
1263				offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
1264				collisionPosTop = position.top - data.collisionPosition.marginTop,
1265				overTop = collisionPosTop - offsetTop,
1266				overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
1267				top = data.my[ 1 ] === "top",
1268				myOffset = top ?
1269					-data.elemHeight :
1270					data.my[ 1 ] === "bottom" ?
1271						data.elemHeight :
1272						0,
1273				atOffset = data.at[ 1 ] === "top" ?
1274					data.targetHeight :
1275					data.at[ 1 ] === "bottom" ?
1276						-data.targetHeight :
1277						0,
1278				offset = -2 * data.offset[ 1 ],
1279				newOverTop,
1280				newOverBottom;
1281			if ( overTop < 0 ) {
1282				newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight -
1283					outerHeight - withinOffset;
1284				if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) {
1285					position.top += myOffset + atOffset + offset;
1286				}
1287			} else if ( overBottom > 0 ) {
1288				newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset +
1289					offset - offsetTop;
1290				if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) {
1291					position.top += myOffset + atOffset + offset;
1292				}
1293			}
1294		}
1295	},
1296	flipfit: {
1297		left: function() {
1298			$.ui.position.flip.left.apply( this, arguments );
1299			$.ui.position.fit.left.apply( this, arguments );
1300		},
1301		top: function() {
1302			$.ui.position.flip.top.apply( this, arguments );
1303			$.ui.position.fit.top.apply( this, arguments );
1304		}
1305	}
1306};
1307
1308} )();
1309
1310var position = $.ui.position;
1311
1312
1313/*!
1314 * jQuery UI 
1314:data 1.13.2
1315 * http://jqueryui.com
1316 *
1317 * Copyright jQuery Foundation and other contributors
1318 * Released under the MIT license.
1319 * http://jquery.org/license
1320 */
1321
1322//>>label: :data Selector
vendor: 1,696 bytes, lines 1323-1391
1323//>>group: Core
1324//>>description: Selects elements which have data stored under the specified key.
1325//>>docs: http://api.jqueryui.com/data-selector/
1326
1327
1328var data = $.extend( $.expr.pseudos, {
1329	data: $.expr.createPseudo ?
1330		$.expr.createPseudo( function( dataName ) {
1331			return function( elem ) {
1332				return !!$.data( elem, dataName );
1333			};
1334		} ) :
1335
1336		// Support: jQuery <1.8
1337		function( elem, i, match ) {
1338			return !!$.data( elem, match[ 3 ] );
1339		}
1340} );
1341
1342/*!
1343 * jQuery UI Disable Selection 1.13.2
1344 * http://jqueryui.com
1345 *
1346 * Copyright jQuery Foundation and other contributors
1347 * Released under the MIT license.
1348 * http://jquery.org/license
1349 */
1350
1351//>>label: disableSelection
1352//>>group: Core
1353//>>description: Disable selection of text content within the set of matched elements.
1354//>>docs: http://api.jqueryui.com/disableSelection/
1355
1356// This file is deprecated
1357
1358var disableSelection = $.fn.extend( {
1359	disableSelection: ( function() {
1360		var eventType = "onselectstart" in document.createElement( "div" ) ?
1361			"selectstart" :
1362			"mousedown";
1363
1364		return function() {
1365			return this.on( eventType + ".ui-disableSelection", function( event ) {
1366				event.preventDefault();
1367			} );
1368		};
1369	} )(),
1370
1371	enableSelection: function() {
1372		return this.off( ".ui-disableSelection" );
1373	}
1374} );
1375
1376
1377
1378// Create a local jQuery because jQuery Color relies on it and the
1379// global may not exist with AMD and a custom build (#10199).
1380// This module is a noop if used as a regular AMD module.
1381// eslint-disable-next-line no-unused-vars
1382var jQuery = $;
1383
1384
1385/*!
1386 * jQuery Color Animations v2.2.0
1387 * https://github.com/jquery/jquery-color
1388 *
1389 * Copyright OpenJS Foundation and other contributors
1390 * Released under the MIT license.
1391 * http
vendor: 16,926 bytes, lines 1391-2098
1391://jquery.org/license
1392 *
1393 * Date: Sun May 10 09:02:36 2020 +0200
1394 */
1395
1396
1397
1398	var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor " +
1399		"borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
1400
1401	class2type = {},
1402	toString = class2type.toString,
1403
1404	// plusequals test for += 100 -= 100
1405	rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
1406
1407	// a set of RE's that can match strings and generate color tuples.
1408	stringParsers = [ {
1409			re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
1410			parse: function( execResult ) {
1411				return [
1412					execResult[ 1 ],
1413					execResult[ 2 ],
1414					execResult[ 3 ],
1415					execResult[ 4 ]
1416				];
1417			}
1418		}, {
1419			re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
1420			parse: function( execResult ) {
1421				return [
1422					execResult[ 1 ] * 2.55,
1423					execResult[ 2 ] * 2.55,
1424					execResult[ 3 ] * 2.55,
1425					execResult[ 4 ]
1426				];
1427			}
1428		}, {
1429
1430			// this regex ignores A-F because it's compared against an already lowercased string
1431			re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/,
1432			parse: function( execResult ) {
1433				return [
1434					parseInt( execResult[ 1 ], 16 ),
1435					parseInt( execResult[ 2 ], 16 ),
1436					parseInt( execResult[ 3 ], 16 ),
1437					execResult[ 4 ] ?
1438						( parseInt( execResult[ 4 ], 16 ) / 255 ).toFixed( 2 ) :
1439						1
1440				];
1441			}
1442		}, {
1443
1444			// this regex ignores A-F because it's compared against an already lowercased string
1445			re: /#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/,
1446			parse: function( execResult ) {
1447				return [
1448					parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ),
1449					parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ),
1450					parseInt( execResult[ 3 ] + execResult[ 3 ], 16 ),
1451					execResult[ 4 ] ?
1452						( parseInt( execResult[ 4 ] + execResult[ 4 ], 16 ) / 255 )
1453							.toFixed( 2 ) :
1454						1
1455				];
1456			}
1457		}, {
1458			re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
1459			space: "hsla",
1460			parse: function( execResult ) {
1461				return [
1462					execResult[ 1 ],
1463					execResult[ 2 ] / 100,
1464					execResult[ 3 ] / 100,
1465					execResult[ 4 ]
1466				];
1467			}
1468		} ],
1469
1470	// jQuery.Color( )
1471	color = jQuery.Color = function( color, green, blue, alpha ) {
1472		return new jQuery.Color.fn.parse( color, green, blue, alpha );
1473	},
1474	spaces = {
1475		rgba: {
1476			props: {
1477				red: {
1478					idx: 0,
1479					type: "byte"
1480				},
1481				green: {
1482					idx: 1,
1483					type: "byte"
1484				},
1485				blue: {
1486					idx: 2,
1487					type: "byte"
1488				}
1489			}
1490		},
1491
1492		hsla: {
1493			props: {
1494				hue: {
1495					idx: 0,
1496					type: "degrees"
1497				},
1498				saturation: {
1499					idx: 1,
1500					type: "percent"
1501				},
1502				lightness: {
1503					idx: 2,
1504					type: "percent"
1505				}
1506			}
1507		}
1508	},
1509	propTypes = {
1510		"byte": {
1511			floor: true,
1512			max: 255
1513		},
1514		"percent": {
1515			max: 1
1516		},
1517		"degrees": {
1518			mod: 360,
1519			floor: true
1520		}
1521	},
1522	support = color.support = {},
1523
1524	// element for support tests
1525	supportElem = jQuery( "<p>" )[ 0 ],
1526
1527	// colors = jQuery.Color.names
1528	colors,
1529
1530	// local aliases of functions called often
1531	each = jQuery.each;
1532
1533// determine rgba support immediately
1534supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";
1535support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1;
1536
1537// define cache name and alpha properties
1538// for rgba and hsla spaces
1539each( spaces, function( spaceName, space ) {
1540	space.cache = "_" + spaceName;
1541	space.props.alpha = {
1542		idx: 3,
1543		type: "percent",
1544		def: 1
1545	};
1546} );
1547
1548// Populate the class2type map
1549jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
1550	function( _i, name ) {
1551		class2type[ "[object " + name + "]" ] = name.toLowerCase();
1552	} );
1553
1554function getType( obj ) {
1555	if ( obj == null ) {
1556		return obj + "";
1557	}
1558
1559	return typeof obj === "object" ?
1560		class2type[ toString.call( obj ) ] || "object" :
1561		typeof obj;
1562}
1563
1564function clamp( value, prop, allowEmpty ) {
1565	var type = propTypes[ prop.type ] || {};
1566
1567	if ( value == null ) {
1568		return ( allowEmpty || !prop.def ) ? null : prop.def;
1569	}
1570
1571	// ~~ is an short way of doing floor for positive numbers
1572	value = type.floor ? ~~value : parseFloat( value );
1573
1574	// IE will pass in empty strings as value for alpha,
1575	// which will hit this case
1576	if ( isNaN( value ) ) {
1577		return prop.def;
1578	}
1579
1580	if ( type.mod ) {
1581
1582		// we add mod before modding to make sure that negatives values
1583		// get converted properly: -10 -> 350
1584		return ( value + type.mod ) % type.mod;
1585	}
1586
1587	// for now all property types without mod have min and max
1588	return Math.min( type.max, Math.max( 0, value ) );
1589}
1590
1591function stringParse( string ) {
1592	var inst = color(),
1593		rgba = inst._rgba = [];
1594
1595	string = string.toLowerCase();
1596
1597	each( stringParsers, function( _i, parser ) {
1598		var parsed,
1599			match = parser.re.exec( string ),
1600			values = match && parser.parse( match ),
1601			spaceName = parser.space || "rgba";
1602
1603		if ( values ) {
1604			parsed = inst[ spaceName ]( values );
1605
1606			// if this was an rgba parse the assignment might happen twice
1607			// oh well....
1608			inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ];
1609			rgba = inst._rgba = parsed._rgba;
1610
1611			// exit each( stringParsers ) here because we matched
1612			return false;
1613		}
1614	} );
1615
1616	// Found a stringParser that handled it
1617	if ( rgba.length ) {
1618
1619		// if this came from a parsed string, force "transparent" when alpha is 0
1620		// chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)
1621		if ( rgba.join() === "0,0,0,0" ) {
1622			jQuery.extend( rgba, colors.transparent );
1623		}
1624		return inst;
1625	}
1626
1627	// named colors
1628	return colors[ string ];
1629}
1630
1631color.fn = jQuery.extend( color.prototype, {
1632	parse: function( red, green, blue, alpha ) {
1633		if ( red === undefined ) {
1634			this._rgba = [ null, null, null, null ];
1635			return this;
1636		}
1637		if ( red.jquery || red.nodeType ) {
1638			red = jQuery( red ).css( green );
1639			green = undefined;
1640		}
1641
1642		var inst = this,
1643			type = getType( red ),
1644			rgba = this._rgba = [];
1645
1646		// more than 1 argument specified - assume ( red, green, blue, alpha )
1647		if ( green !== undefined ) {
1648			red = [ red, green, blue, alpha ];
1649			type = "array";
1650		}
1651
1652		if ( type === "string" ) {
1653			return this.parse( stringParse( red ) || colors._default );
1654		}
1655
1656		if ( type === "array" ) {
1657			each( spaces.rgba.props, function( _key, prop ) {
1658				rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );
1659			} );
1660			return this;
1661		}
1662
1663		if ( type === "object" ) {
1664			if ( red instanceof color ) {
1665				each( spaces, function( _spaceName, space ) {
1666					if ( red[ space.cache ] ) {
1667						inst[ space.cache ] = red[ space.cache ].slice();
1668					}
1669				} );
1670			} else {
1671				each( spaces, function( _spaceName, space ) {
1672					var cache = space.cache;
1673					each( space.props, function( key, prop ) {
1674
1675						// if the cache doesn't exist, and we know how to convert
1676						if ( !inst[ cache ] && space.to ) {
1677
1678							// if the value was null, we don't need to copy it
1679							// if the key was alpha, we don't need to copy it either
1680							if ( key === "alpha" || red[ key ] == null ) {
1681								return;
1682							}
1683							inst[ cache ] = space.to( inst._rgba );
1684						}
1685
1686						// this is the only case where we allow nulls for ALL properties.
1687						// call clamp with alwaysAllowEmpty
1688						inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true );
1689					} );
1690
1691					// everything defined but alpha?
1692					if ( inst[ cache ] && jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) {
1693
1694						// use the default of 1
1695						if ( inst[ cache ][ 3 ] == null ) {
1696							inst[ cache ][ 3 ] = 1;
1697						}
1698
1699						if ( space.from ) {
1700							inst._rgba = space.from( inst[ cache ] );
1701						}
1702					}
1703				} );
1704			}
1705			return this;
1706		}
1707	},
1708	is: function( compare ) {
1709		var is = color( compare ),
1710			same = true,
1711			inst = this;
1712
1713		each( spaces, function( _, space ) {
1714			var localCache,
1715				isCache = is[ space.cache ];
1716			if ( isCache ) {
1717				localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || [];
1718				each( space.props, function( _, prop ) {
1719					if ( isCache[ prop.idx ] != null ) {
1720						same = ( isCache[ prop.idx ] === localCache[ prop.idx ] );
1721						return same;
1722					}
1723				} );
1724			}
1725			return same;
1726		} );
1727		return same;
1728	},
1729	_space: function() {
1730		var used = [],
1731			inst = this;
1732		each( spaces, function( spaceName, space ) {
1733			if ( inst[ space.cache ] ) {
1734				used.push( spaceName );
1735			}
1736		} );
1737		return used.pop();
1738	},
1739	transition: function( other, distance ) {
1740		var end = color( other ),
1741			spaceName = end._space(),
1742			space = spaces[ spaceName ],
1743			startColor = this.alpha() === 0 ? color( "transparent" ) : this,
1744			start = startColor[ space.cache ] || space.to( startColor._rgba ),
1745			result = start.slice();
1746
1747		end = end[ space.cache ];
1748		each( space.props, function( _key, prop ) {
1749			var index = prop.idx,
1750				startValue = start[ index ],
1751				endValue = end[ index ],
1752				type = propTypes[ prop.type ] || {};
1753
1754			// if null, don't override start value
1755			if ( endValue === null ) {
1756				return;
1757			}
1758
1759			// if null - use end
1760			if ( startValue === null ) {
1761				result[ index ] = endValue;
1762			} else {
1763				if ( type.mod ) {
1764					if ( endValue - startValue > type.mod / 2 ) {
1765						startValue += type.mod;
1766					} else if ( startValue - endValue > type.mod / 2 ) {
1767						startValue -= type.mod;
1768					}
1769				}
1770				result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop );
1771			}
1772		} );
1773		return this[ spaceName ]( result );
1774	},
1775	blend: function( opaque ) {
1776
1777		// if we are already opaque - return ourself
1778		if ( this._rgba[ 3 ] === 1 ) {
1779			return this;
1780		}
1781
1782		var rgb = this._rgba.slice(),
1783			a = rgb.pop(),
1784			blend = color( opaque )._rgba;
1785
1786		return color( jQuery.map( rgb, function( v, i ) {
1787			return ( 1 - a ) * blend[ i ] + a * v;
1788		} ) );
1789	},
1790	toRgbaString: function() {
1791		var prefix = "rgba(",
1792			rgba = jQuery.map( this._rgba, function( v, i ) {
1793				if ( v != null ) {
1794					return v;
1795				}
1796				return i > 2 ? 1 : 0;
1797			} );
1798
1799		if ( rgba[ 3 ] === 1 ) {
1800			rgba.pop();
1801			prefix = "rgb(";
1802		}
1803
1804		return prefix + rgba.join() + ")";
1805	},
1806	toHslaString: function() {
1807		var prefix = "hsla(",
1808			hsla = jQuery.map( this.hsla(), function( v, i ) {
1809				if ( v == null ) {
1810					v = i > 2 ? 1 : 0;
1811				}
1812
1813				// catch 1 and 2
1814				if ( i && i < 3 ) {
1815					v = Math.round( v * 100 ) + "%";
1816				}
1817				return v;
1818			} );
1819
1820		if ( hsla[ 3 ] === 1 ) {
1821			hsla.pop();
1822			prefix = "hsl(";
1823		}
1824		return prefix + hsla.join() + ")";
1825	},
1826	toHexString: function( includeAlpha ) {
1827		var rgba = this._rgba.slice(),
1828			alpha = rgba.pop();
1829
1830		if ( includeAlpha ) {
1831			rgba.push( ~~( alpha * 255 ) );
1832		}
1833
1834		return "#" + jQuery.map( rgba, function( v ) {
1835
1836			// default to 0 when nulls exist
1837			v = ( v || 0 ).toString( 16 );
1838			return v.length === 1 ? "0" + v : v;
1839		} ).join( "" );
1840	},
1841	toString: function() {
1842		return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString();
1843	}
1844} );
1845color.fn.parse.prototype = color.fn;
1846
1847// hsla conversions adapted from:
1848// https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021
1849
1850function hue2rgb( p, q, h ) {
1851	h = ( h + 1 ) % 1;
1852	if ( h * 6 < 1 ) {
1853		return p + ( q - p ) * h * 6;
1854	}
1855	if ( h * 2 < 1 ) {
1856		return q;
1857	}
1858	if ( h * 3 < 2 ) {
1859		return p + ( q - p ) * ( ( 2 / 3 ) - h ) * 6;
1860	}
1861	return p;
1862}
1863
1864spaces.hsla.to = function( rgba ) {
1865	if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
1866		return [ null, null, null, rgba[ 3 ] ];
1867	}
1868	var r = rgba[ 0 ] / 255,
1869		g = rgba[ 1 ] / 255,
1870		b = rgba[ 2 ] / 255,
1871		a = rgba[ 3 ],
1872		max = Math.max( r, g, b ),
1873		min = Math.min( r, g, b ),
1874		diff = max - min,
1875		add = max + min,
1876		l = add * 0.5,
1877		h, s;
1878
1879	if ( min === max ) {
1880		h = 0;
1881	} else if ( r === max ) {
1882		h = ( 60 * ( g - b ) / diff ) + 360;
1883	} else if ( g === max ) {
1884		h = ( 60 * ( b - r ) / diff ) + 120;
1885	} else {
1886		h = ( 60 * ( r - g ) / diff ) + 240;
1887	}
1888
1889	// chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
1890	// otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)
1891	if ( diff === 0 ) {
1892		s = 0;
1893	} else if ( l <= 0.5 ) {
1894		s = diff / add;
1895	} else {
1896		s = diff / ( 2 - add );
1897	}
1898	return [ Math.round( h ) % 360, s, l, a == null ? 1 : a ];
1899};
1900
1901spaces.hsla.from = function( hsla ) {
1902	if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) {
1903		return [ null, null, null, hsla[ 3 ] ];
1904	}
1905	var h = hsla[ 0 ] / 360,
1906		s = hsla[ 1 ],
1907		l = hsla[ 2 ],
1908		a = hsla[ 3 ],
1909		q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s,
1910		p = 2 * l - q;
1911
1912	return [
1913		Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ),
1914		Math.round( hue2rgb( p, q, h ) * 255 ),
1915		Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ),
1916		a
1917	];
1918};
1919
1920
1921each( spaces, function( spaceName, space ) {
1922	var props = space.props,
1923		cache = space.cache,
1924		to = space.to,
1925		from = space.from;
1926
1927	// makes rgba() and hsla()
1928	color.fn[ spaceName ] = function( value ) {
1929
1930		// generate a cache for this space if it doesn't exist
1931		if ( to && !this[ cache ] ) {
1932			this[ cache ] = to( this._rgba );
1933		}
1934		if ( value === undefined ) {
1935			return this[ cache ].slice();
1936		}
1937
1938		var ret,
1939			type = getType( value ),
1940			arr = ( type === "array" || type === "object" ) ? value : arguments,
1941			local = this[ cache ].slice();
1942
1943		each( props, function( key, prop ) {
1944			var val = arr[ type === "object" ? key : prop.idx ];
1945			if ( val == null ) {
1946				val = local[ prop.idx ];
1947			}
1948			local[ prop.idx ] = clamp( val, prop );
1949		} );
1950
1951		if ( from ) {
1952			ret = color( from( local ) );
1953			ret[ cache ] = local;
1954			return ret;
1955		} else {
1956			return color( local );
1957		}
1958	};
1959
1960	// makes red() green() blue() alpha() hue() saturation() lightness()
1961	each( props, function( key, prop ) {
1962
1963		// alpha is included in more than one space
1964		if ( color.fn[ key ] ) {
1965			return;
1966		}
1967		color.fn[ key ] = function( value ) {
1968			var local, cur, match, fn,
1969				vtype = getType( value );
1970
1971			if ( key === "alpha" ) {
1972				fn = this._hsla ? "hsla" : "rgba";
1973			} else {
1974				fn = spaceName;
1975			}
1976			local = this[ fn ]();
1977			cur = local[ prop.idx ];
1978
1979			if ( vtype === "undefined" ) {
1980				return cur;
1981			}
1982
1983			if ( vtype === "function" ) {
1984				value = value.call( this, cur );
1985				vtype = getType( value );
1986			}
1987			if ( value == null && prop.empty ) {
1988				return this;
1989			}
1990			if ( vtype === "string" ) {
1991				match = rplusequals.exec( value );
1992				if ( match ) {
1993					value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 );
1994				}
1995			}
1996			local[ prop.idx ] = value;
1997			return this[ fn ]( local );
1998		};
1999	} );
2000} );
2001
2002// add cssHook and .fx.step function for each named hook.
2003// accept a space separated string of properties
2004color.hook = function( hook ) {
2005	var hooks = hook.split( " " );
2006	each( hooks, function( _i, hook ) {
2007		jQuery.cssHooks[ hook ] = {
2008			set: function( elem, value ) {
2009				var parsed, curElem,
2010					backgroundColor = "";
2011
2012				if ( value !== "transparent" && ( getType( value ) !== "string" || ( parsed = stringParse( value ) ) ) ) {
2013					value = color( parsed || value );
2014					if ( !support.rgba && value._rgba[ 3 ] !== 1 ) {
2015						curElem = hook === "backgroundColor" ? elem.parentNode : elem;
2016						while (
2017							( backgroundColor === "" || backgroundColor === "transparent" ) &&
2018							curElem && curElem.style
2019						) {
2020							try {
2021								backgroundColor = jQuery.css( curElem, "backgroundColor" );
2022								curElem = curElem.parentNode;
2023							} catch ( e ) {
2024							}
2025						}
2026
2027						value = value.blend( backgroundColor && backgroundColor !== "transparent" ?
2028							backgroundColor :
2029							"_default" );
2030					}
2031
2032					value = value.toRgbaString();
2033				}
2034				try {
2035					elem.style[ hook ] = value;
2036				} catch ( e ) {
2037
2038					// wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit'
2039				}
2040			}
2041		};
2042		jQuery.fx.step[ hook ] = function( fx ) {
2043			if ( !fx.colorInit ) {
2044				fx.start = color( fx.elem, hook );
2045				fx.end = color( fx.end );
2046				fx.colorInit = true;
2047			}
2048			jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) );
2049		};
2050	} );
2051
2052};
2053
2054color.hook( stepHooks );
2055
2056jQuery.cssHooks.borderColor = {
2057	expand: function( value ) {
2058		var expanded = {};
2059
2060		each( [ "Top", "Right", "Bottom", "Left" ], function( _i, part ) {
2061			expanded[ "border" + part + "Color" ] = value;
2062		} );
2063		return expanded;
2064	}
2065};
2066
2067// Basic color names only.
2068// Usage of any of the other color names requires adding yourself or including
2069// jquery.color.svg-names.js.
2070colors = jQuery.Color.names = {
2071
2072	// 4.1. Basic color keywords
2073	aqua: "#00ffff",
2074	black: "#000000",
2075	blue: "#0000ff",
2076	fuchsia: "#ff00ff",
2077	gray: "#808080",
2078	green: "#008000",
2079	lime: "#00ff00",
2080	maroon: "#800000",
2081	navy: "#000080",
2082	olive: "#808000",
2083	purple: "#800080",
2084	red: "#ff0000",
2085	silver: "#c0c0c0",
2086	teal: "#008080",
2087	white: "#ffffff",
2088	yellow: "#ffff00",
2089
2090	// 4.2.3. "transparent" color keyword
2091	transparent: [ null, null, null, 0 ],
2092
2093	_default: "#ffffff"
2094};
2095
2096
2097/*!
2098 * jQuery UI Effects 1.13.
20982
2099 * http://jqueryui.com
2100 *
2101 * Copyright jQuery Foundation and other contributors
2102 * Released under the MIT license.
2103 * http://jquery.org/license
2104 */
2105
2106//>>label: Effects Core
2107//>>group: Effects
2108/* eslint-disable max-len */
2109//>>description: Extends the internal jQuery effects. Includes morphing and easing. Required by all other effects.
2110/* eslint-enable max-len */
2111//>>docs: http://api.jqueryui.com/category/effects-core/
2112//>>demos: http
vendor: 9,484 bytes, lines 2112-2482
2112://jqueryui.com/effect/
2113
2114
2115var dataSpace = "ui-effects-",
2116	dataSpaceStyle = "ui-effects-style",
2117	dataSpaceAnimated = "ui-effects-animated";
2118
2119$.effects = {
2120	effect: {}
2121};
2122
2123/******************************************************************************/
2124/****************************** CLASS ANIMATIONS ******************************/
2125/******************************************************************************/
2126( function() {
2127
2128var classAnimationActions = [ "add", "remove", "toggle" ],
2129	shorthandStyles = {
2130		border: 1,
2131		borderBottom: 1,
2132		borderColor: 1,
2133		borderLeft: 1,
2134		borderRight: 1,
2135		borderTop: 1,
2136		borderWidth: 1,
2137		margin: 1,
2138		padding: 1
2139	};
2140
2141$.each(
2142	[ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ],
2143	function( _, prop ) {
2144		$.fx.step[ prop ] = function( fx ) {
2145			if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {
2146				jQuery.style( fx.elem, prop, fx.end );
2147				fx.setAttr = true;
2148			}
2149		};
2150	}
2151);
2152
2153function camelCase( string ) {
2154	return string.replace( /-([\da-z])/gi, function( all, letter ) {
2155		return letter.toUpperCase();
2156	} );
2157}
2158
2159function getElementStyles( elem ) {
2160	var key, len,
2161		style = elem.ownerDocument.defaultView ?
2162			elem.ownerDocument.defaultView.getComputedStyle( elem, null ) :
2163			elem.currentStyle,
2164		styles = {};
2165
2166	if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
2167		len = style.length;
2168		while ( len-- ) {
2169			key = style[ len ];
2170			if ( typeof style[ key ] === "string" ) {
2171				styles[ camelCase( key ) ] = style[ key ];
2172			}
2173		}
2174
2175	// Support: Opera, IE <9
2176	} else {
2177		for ( key in style ) {
2178			if ( typeof style[ key ] === "string" ) {
2179				styles[ key ] = style[ key ];
2180			}
2181		}
2182	}
2183
2184	return styles;
2185}
2186
2187function styleDifference( oldStyle, newStyle ) {
2188	var diff = {},
2189		name, value;
2190
2191	for ( name in newStyle ) {
2192		value = newStyle[ name ];
2193		if ( oldStyle[ name ] !== value ) {
2194			if ( !shorthandStyles[ name ] ) {
2195				if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) {
2196					diff[ name ] = value;
2197				}
2198			}
2199		}
2200	}
2201
2202	return diff;
2203}
2204
2205// Support: jQuery <1.8
2206if ( !$.fn.addBack ) {
2207	$.fn.addBack = function( selector ) {
2208		return this.add( selector == null ?
2209			this.prevObject : this.prevObject.filter( selector )
2210		);
2211	};
2212}
2213
2214$.effects.animateClass = function( value, duration, easing, callback ) {
2215	var o = $.speed( duration, easing, callback );
2216
2217	return this.queue( function() {
2218		var animated = $( this ),
2219			baseClass = animated.attr( "class" ) || "",
2220			applyClassChange,
2221			allAnimations = o.children ? animated.find( "*" ).addBack() : animated;
2222
2223		// Map the animated objects to store the original styles.
2224		allAnimations = allAnimations.map( function() {
2225			var el = $( this );
2226			return {
2227				el: el,
2228				start: getElementStyles( this )
2229			};
2230		} );
2231
2232		// Apply class change
2233		applyClassChange = function() {
2234			$.each( classAnimationActions, function( i, action ) {
2235				if ( value[ action ] ) {
2236					animated[ action + "Class" ]( value[ action ] );
2237				}
2238			} );
2239		};
2240		applyClassChange();
2241
2242		// Map all animated objects again - calculate new styles and diff
2243		allAnimations = allAnimations.map( function() {
2244			this.end = getElementStyles( this.el[ 0 ] );
2245			this.diff = styleDifference( this.start, this.end );
2246			return this;
2247		} );
2248
2249		// Apply original class
2250		animated.attr( "class", baseClass );
2251
2252		// Map all animated objects again - this time collecting a promise
2253		allAnimations = allAnimations.map( function() {
2254			var styleInfo = this,
2255				dfd = $.Deferred(),
2256				opts = $.extend( {}, o, {
2257					queue: false,
2258					complete: function() {
2259						dfd.resolve( styleInfo );
2260					}
2261				} );
2262
2263			this.el.animate( this.diff, opts );
2264			return dfd.promise();
2265		} );
2266
2267		// Once all animations have completed:
2268		$.when.apply( $, allAnimations.get() ).done( function() {
2269
2270			// Set the final class
2271			applyClassChange();
2272
2273			// For each animated element,
2274			// clear all css properties that were animated
2275			$.each( arguments, function() {
2276				var el = this.el;
2277				$.each( this.diff, function( key ) {
2278					el.css( key, "" );
2279				} );
2280			} );
2281
2282			// This is guarnteed to be there if you use jQuery.speed()
2283			// it also handles dequeuing the next anim...
2284			o.complete.call( animated[ 0 ] );
2285		} );
2286	} );
2287};
2288
2289$.fn.extend( {
2290	addClass: ( function( orig ) {
2291		return function( classNames, speed, easing, callback ) {
2292			return speed ?
2293				$.effects.animateClass.call( this,
2294					{ add: classNames }, speed, easing, callback ) :
2295				orig.apply( this, arguments );
2296		};
2297	} )( $.fn.addClass ),
2298
2299	removeClass: ( function( orig ) {
2300		return function( classNames, speed, easing, callback ) {
2301			return arguments.length > 1 ?
2302				$.effects.animateClass.call( this,
2303					{ remove: classNames }, speed, easing, callback ) :
2304				orig.apply( this, arguments );
2305		};
2306	} )( $.fn.removeClass ),
2307
2308	toggleClass: ( function( orig ) {
2309		return function( classNames, force, speed, easing, callback ) {
2310			if ( typeof force === "boolean" || force === undefined ) {
2311				if ( !speed ) {
2312
2313					// Without speed parameter
2314					return orig.apply( this, arguments );
2315				} else {
2316					return $.effects.animateClass.call( this,
2317						( force ? { add: classNames } : { remove: classNames } ),
2318						speed, easing, callback );
2319				}
2320			} else {
2321
2322				// Without force parameter
2323				return $.effects.animateClass.call( this,
2324					{ toggle: classNames }, force, speed, easing );
2325			}
2326		};
2327	} )( $.fn.toggleClass ),
2328
2329	switchClass: function( remove, add, speed, easing, callback ) {
2330		return $.effects.animateClass.call( this, {
2331			add: add,
2332			remove: remove
2333		}, speed, easing, callback );
2334	}
2335} );
2336
2337} )();
2338
2339/******************************************************************************/
2340/*********************************** EFFECTS **********************************/
2341/******************************************************************************/
2342
2343( function() {
2344
2345if ( $.expr && $.expr.pseudos && $.expr.pseudos.animated ) {
2346	$.expr.pseudos.animated = ( function( orig ) {
2347		return function( elem ) {
2348			return !!$( elem ).data( dataSpaceAnimated ) || orig( elem );
2349		};
2350	} )( $.expr.pseudos.animated );
2351}
2352
2353if ( $.uiBackCompat !== false ) {
2354	$.extend( $.effects, {
2355
2356		// Saves a set of properties in a data storage
2357		save: function( element, set ) {
2358			var i = 0, length = set.length;
2359			for ( ; i < length; i++ ) {
2360				if ( set[ i ] !== null ) {
2361					element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
2362				}
2363			}
2364		},
2365
2366		// Restores a set of previously saved properties from a data storage
2367		restore: function( element, set ) {
2368			var val, i = 0, length = set.length;
2369			for ( ; i < length; i++ ) {
2370				if ( set[ i ] !== null ) {
2371					val = element.data( dataSpace + set[ i ] );
2372					element.css( set[ i ], val );
2373				}
2374			}
2375		},
2376
2377		setMode: function( el, mode ) {
2378			if ( mode === "toggle" ) {
2379				mode = el.is( ":hidden" ) ? "show" : "hide";
2380			}
2381			return mode;
2382		},
2383
2384		// Wraps the element around a wrapper that copies position properties
2385		createWrapper: function( element ) {
2386
2387			// If the element is already wrapped, return it
2388			if ( element.parent().is( ".ui-effects-wrapper" ) ) {
2389				return element.parent();
2390			}
2391
2392			// Wrap the element
2393			var props = {
2394					width: element.outerWidth( true ),
2395					height: element.outerHeight( true ),
2396					"float": element.css( "float" )
2397				},
2398				wrapper = $( "<div></div>" )
2399					.addClass( "ui-effects-wrapper" )
2400					.css( {
2401						fontSize: "100%",
2402						background: "transparent",
2403						border: "none",
2404						margin: 0,
2405						padding: 0
2406					} ),
2407
2408				// Store the size in case width/height are defined in % - Fixes #5245
2409				size = {
2410					width: element.width(),
2411					height: element.height()
2412				},
2413				active = document.activeElement;
2414
2415			// Support: Firefox
2416			// Firefox incorrectly exposes anonymous content
2417			// https://bugzilla.mozilla.org/show_bug.cgi?id=561664
2418			try {
2419				// eslint-disable-next-line no-unused-expressions
2420				active.id;
2421			} catch ( e ) {
2422				active = document.body;
2423			}
2424
2425			element.wrap( wrapper );
2426
2427			// Fixes #7595 - Elements lose focus when wrapped.
2428			if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
2429				$( active ).trigger( "focus" );
2430			}
2431
2432			// Hotfix for jQuery 1.4 since some change in wrap() seems to actually
2433			// lose the reference to the wrapped element
2434			wrapper = element.parent();
2435
2436			// Transfer positioning properties to the wrapper
2437			if ( element.css( "position" ) === "static" ) {
2438				wrapper.css( { position: "relative" } );
2439				element.css( { position: "relative" } );
2440			} else {
2441				$.extend( props, {
2442					position: element.css( "position" ),
2443					zIndex: element.css( "z-index" )
2444				} );
2445				$.each( [ "top", "left", "bottom", "right" ], function( i, pos ) {
2446					props[ pos ] = element.css( pos );
2447					if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
2448						props[ pos ] = "auto";
2449					}
2450				} );
2451				element.css( {
2452					position: "relative",
2453					top: 0,
2454					left: 0,
2455					right: "auto",
2456					bottom: "auto"
2457				} );
2458			}
2459			element.css( size );
2460
2461			return wrapper.css( props ).show();
2462		},
2463
2464		removeWrapper: function( element ) {
2465			var active = document.activeElement;
2466
2467			if ( element.parent().is( ".ui-effects-wrapper" ) ) {
2468				element.parent().replaceWith( element );
2469
2470				// Fixes #7595 - Elements lose focus when wrapped.
2471				if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
2472					$( active ).trigger( "focus" );
2473				}
2474			}
2475
2476			return element;
2477		}
2478	} );
2479}
2480
2481$.extend( $.effects, {
2482	version: "1.13.
vendor: 2,055 bytes, lines 2482-2577
24822",
2483
2484	define: function( name, mode, effect ) {
2485		if ( !effect ) {
2486			effect = mode;
2487			mode = "effect";
2488		}
2489
2490		$.effects.effect[ name ] = effect;
2491		$.effects.effect[ name ].mode = mode;
2492
2493		return effect;
2494	},
2495
2496	scaledDimensions: function( element, percent, direction ) {
2497		if ( percent === 0 ) {
2498			return {
2499				height: 0,
2500				width: 0,
2501				outerHeight: 0,
2502				outerWidth: 0
2503			};
2504		}
2505
2506		var x = direction !== "horizontal" ? ( ( percent || 100 ) / 100 ) : 1,
2507			y = direction !== "vertical" ? ( ( percent || 100 ) / 100 ) : 1;
2508
2509		return {
2510			height: element.height() * y,
2511			width: element.width() * x,
2512			outerHeight: element.outerHeight() * y,
2513			outerWidth: element.outerWidth() * x
2514		};
2515
2516	},
2517
2518	clipToBox: function( animation ) {
2519		return {
2520			width: animation.clip.right - animation.clip.left,
2521			height: animation.clip.bottom - animation.clip.top,
2522			left: animation.clip.left,
2523			top: animation.clip.top
2524		};
2525	},
2526
2527	// Injects recently queued functions to be first in line (after "inprogress")
2528	unshift: function( element, queueLength, count ) {
2529		var queue = element.queue();
2530
2531		if ( queueLength > 1 ) {
2532			queue.splice.apply( queue,
2533				[ 1, 0 ].concat( queue.splice( queueLength, count ) ) );
2534		}
2535		element.dequeue();
2536	},
2537
2538	saveStyle: function( element ) {
2539		element.data( dataSpaceStyle, element[ 0 ].style.cssText );
2540	},
2541
2542	restoreStyle: function( element ) {
2543		element[ 0 ].style.cssText = element.data( dataSpaceStyle ) || "";
2544		element.removeData( dataSpaceStyle );
2545	},
2546
2547	mode: function( element, mode ) {
2548		var hidden = element.is( ":hidden" );
2549
2550		if ( mode === "toggle" ) {
2551			mode = hidden ? "show" : "hide";
2552		}
2553		if ( hidden ? mode === "hide" : mode === "show" ) {
2554			mode = "none";
2555		}
2556		return mode;
2557	},
2558
2559	// Translates a [top,left] array into a baseline value
2560	getBaseline: function( origin, original ) {
2561		var y, x;
2562
2563		switch ( origin[ 0 ] ) {
2564		case "top":
2565			y = 0;
2566			break;
2567		case "middle":
2568			y = 0.5;
2569			break;
2570		case "bottom":
2571			y = 1;
2572			break;
2573		default:
2574			y = origin[ 0 ] / original.height;
2575		}
2576
2577		switch ( origin[ 1 ] ) {
2578		case "left":
2579			x = 0;
2580			break;
2581		case "center":
2582			x = 0.5;
2583			break;
2584		case "right":
2585			x = 1;
2586			break;
2587		default:
2588			x = origin[ 1 ] / original.width;
2589		}
2590
2591		return {
2592			x: x,
2593			y: y
2594		};
2595	},
2596
2597	// Creates a placeholder element so that the original element can be made absolute
2598	createPlaceholder: function( element ) {
2599		var placeholder,
2600			cssPosition = element.css( "position" ),
2601			position = element.position();
2602
2603		// Lock in margins first to account for form elements, which
2604		// will change margin if you explicitly set height
2605		// see: http
vendor: 10,558 bytes, lines 2605-2999
2605://jsfiddle.net/JZSMt/3/ https://bugs.webkit.org/show_bug.cgi?id=107380
2606		// Support: Safari
2607		element.css( {
2608			marginTop: element.css( "marginTop" ),
2609			marginBottom: element.css( "marginBottom" ),
2610			marginLeft: element.css( "marginLeft" ),
2611			marginRight: element.css( "marginRight" )
2612		} )
2613		.outerWidth( element.outerWidth() )
2614		.outerHeight( element.outerHeight() );
2615
2616		if ( /^(static|relative)/.test( cssPosition ) ) {
2617			cssPosition = "absolute";
2618
2619			placeholder = $( "<" + element[ 0 ].nodeName + ">" ).insertAfter( element ).css( {
2620
2621				// Convert inline to inline block to account for inline elements
2622				// that turn to inline block based on content (like img)
2623				display: /^(inline|ruby)/.test( element.css( "display" ) ) ?
2624					"inline-block" :
2625					"block",
2626				visibility: "hidden",
2627
2628				// Margins need to be set to account for margin collapse
2629				marginTop: element.css( "marginTop" ),
2630				marginBottom: element.css( "marginBottom" ),
2631				marginLeft: element.css( "marginLeft" ),
2632				marginRight: element.css( "marginRight" ),
2633				"float": element.css( "float" )
2634			} )
2635			.outerWidth( element.outerWidth() )
2636			.outerHeight( element.outerHeight() )
2637			.addClass( "ui-effects-placeholder" );
2638
2639			element.data( dataSpace + "placeholder", placeholder );
2640		}
2641
2642		element.css( {
2643			position: cssPosition,
2644			left: position.left,
2645			top: position.top
2646		} );
2647
2648		return placeholder;
2649	},
2650
2651	removePlaceholder: function( element ) {
2652		var dataKey = dataSpace + "placeholder",
2653				placeholder = element.data( dataKey );
2654
2655		if ( placeholder ) {
2656			placeholder.remove();
2657			element.removeData( dataKey );
2658		}
2659	},
2660
2661	// Removes a placeholder if it exists and restores
2662	// properties that were modified during placeholder creation
2663	cleanUp: function( element ) {
2664		$.effects.restoreStyle( element );
2665		$.effects.removePlaceholder( element );
2666	},
2667
2668	setTransition: function( element, list, factor, value ) {
2669		value = value || {};
2670		$.each( list, function( i, x ) {
2671			var unit = element.cssUnit( x );
2672			if ( unit[ 0 ] > 0 ) {
2673				value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
2674			}
2675		} );
2676		return value;
2677	}
2678} );
2679
2680// Return an effect options object for the given parameters:
2681function _normalizeArguments( effect, options, speed, callback ) {
2682
2683	// Allow passing all options as the first parameter
2684	if ( $.isPlainObject( effect ) ) {
2685		options = effect;
2686		effect = effect.effect;
2687	}
2688
2689	// Convert to an object
2690	effect = { effect: effect };
2691
2692	// Catch (effect, null, ...)
2693	if ( options == null ) {
2694		options = {};
2695	}
2696
2697	// Catch (effect, callback)
2698	if ( typeof options === "function" ) {
2699		callback = options;
2700		speed = null;
2701		options = {};
2702	}
2703
2704	// Catch (effect, speed, ?)
2705	if ( typeof options === "number" || $.fx.speeds[ options ] ) {
2706		callback = speed;
2707		speed = options;
2708		options = {};
2709	}
2710
2711	// Catch (effect, options, callback)
2712	if ( typeof speed === "function" ) {
2713		callback = speed;
2714		speed = null;
2715	}
2716
2717	// Add options to effect
2718	if ( options ) {
2719		$.extend( effect, options );
2720	}
2721
2722	speed = speed || options.duration;
2723	effect.duration = $.fx.off ? 0 :
2724		typeof speed === "number" ? speed :
2725		speed in $.fx.speeds ? $.fx.speeds[ speed ] :
2726		$.fx.speeds._default;
2727
2728	effect.complete = callback || options.complete;
2729
2730	return effect;
2731}
2732
2733function standardAnimationOption( option ) {
2734
2735	// Valid standard speeds (nothing, number, named speed)
2736	if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) {
2737		return true;
2738	}
2739
2740	// Invalid strings - treat as "normal" speed
2741	if ( typeof option === "string" && !$.effects.effect[ option ] ) {
2742		return true;
2743	}
2744
2745	// Complete callback
2746	if ( typeof option === "function" ) {
2747		return true;
2748	}
2749
2750	// Options hash (but not naming an effect)
2751	if ( typeof option === "object" && !option.effect ) {
2752		return true;
2753	}
2754
2755	// Didn't match any standard API
2756	return false;
2757}
2758
2759$.fn.extend( {
2760	effect: function( /* effect, options, speed, callback */ ) {
2761		var args = _normalizeArguments.apply( this, arguments ),
2762			effectMethod = $.effects.effect[ args.effect ],
2763			defaultMode = effectMethod.mode,
2764			queue = args.queue,
2765			queueName = queue || "fx",
2766			complete = args.complete,
2767			mode = args.mode,
2768			modes = [],
2769			prefilter = function( next ) {
2770				var el = $( this ),
2771					normalizedMode = $.effects.mode( el, mode ) || defaultMode;
2772
2773				// Sentinel for duck-punching the :animated pseudo-selector
2774				el.data( dataSpaceAnimated, true );
2775
2776				// Save effect mode for later use,
2777				// we can't just call $.effects.mode again later,
2778				// as the .show() below destroys the initial state
2779				modes.push( normalizedMode );
2780
2781				// See $.uiBackCompat inside of run() for removal of defaultMode in 1.14
2782				if ( defaultMode && ( normalizedMode === "show" ||
2783						( normalizedMode === defaultMode && normalizedMode === "hide" ) ) ) {
2784					el.show();
2785				}
2786
2787				if ( !defaultMode || normalizedMode !== "none" ) {
2788					$.effects.saveStyle( el );
2789				}
2790
2791				if ( typeof next === "function" ) {
2792					next();
2793				}
2794			};
2795
2796		if ( $.fx.off || !effectMethod ) {
2797
2798			// Delegate to the original method (e.g., .show()) if possible
2799			if ( mode ) {
2800				return this[ mode ]( args.duration, complete );
2801			} else {
2802				return this.each( function() {
2803					if ( complete ) {
2804						complete.call( this );
2805					}
2806				} );
2807			}
2808		}
2809
2810		function run( next ) {
2811			var elem = $( this );
2812
2813			function cleanup() {
2814				elem.removeData( dataSpaceAnimated );
2815
2816				$.effects.cleanUp( elem );
2817
2818				if ( args.mode === "hide" ) {
2819					elem.hide();
2820				}
2821
2822				done();
2823			}
2824
2825			function done() {
2826				if ( typeof complete === "function" ) {
2827					complete.call( elem[ 0 ] );
2828				}
2829
2830				if ( typeof next === "function" ) {
2831					next();
2832				}
2833			}
2834
2835			// Override mode option on a per element basis,
2836			// as toggle can be either show or hide depending on element state
2837			args.mode = modes.shift();
2838
2839			if ( $.uiBackCompat !== false && !defaultMode ) {
2840				if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
2841
2842					// Call the core method to track "olddisplay" properly
2843					elem[ mode ]();
2844					done();
2845				} else {
2846					effectMethod.call( elem[ 0 ], args, done );
2847				}
2848			} else {
2849				if ( args.mode === "none" ) {
2850
2851					// Call the core method to track "olddisplay" properly
2852					elem[ mode ]();
2853					done();
2854				} else {
2855					effectMethod.call( elem[ 0 ], args, cleanup );
2856				}
2857			}
2858		}
2859
2860		// Run prefilter on all elements first to ensure that
2861		// any showing or hiding happens before placeholder creation,
2862		// which ensures that any layout changes are correctly captured.
2863		return queue === false ?
2864			this.each( prefilter ).each( run ) :
2865			this.queue( queueName, prefilter ).queue( queueName, run );
2866	},
2867
2868	show: ( function( orig ) {
2869		return function( option ) {
2870			if ( standardAnimationOption( option ) ) {
2871				return orig.apply( this, arguments );
2872			} else {
2873				var args = _normalizeArguments.apply( this, arguments );
2874				args.mode = "show";
2875				return this.effect.call( this, args );
2876			}
2877		};
2878	} )( $.fn.show ),
2879
2880	hide: ( function( orig ) {
2881		return function( option ) {
2882			if ( standardAnimationOption( option ) ) {
2883				return orig.apply( this, arguments );
2884			} else {
2885				var args = _normalizeArguments.apply( this, arguments );
2886				args.mode = "hide";
2887				return this.effect.call( this, args );
2888			}
2889		};
2890	} )( $.fn.hide ),
2891
2892	toggle: ( function( orig ) {
2893		return function( option ) {
2894			if ( standardAnimationOption( option ) || typeof option === "boolean" ) {
2895				return orig.apply( this, arguments );
2896			} else {
2897				var args = _normalizeArguments.apply( this, arguments );
2898				args.mode = "toggle";
2899				return this.effect.call( this, args );
2900			}
2901		};
2902	} )( $.fn.toggle ),
2903
2904	cssUnit: function( key ) {
2905		var style = this.css( key ),
2906			val = [];
2907
2908		$.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
2909			if ( style.indexOf( unit ) > 0 ) {
2910				val = [ parseFloat( style ), unit ];
2911			}
2912		} );
2913		return val;
2914	},
2915
2916	cssClip: function( clipObj ) {
2917		if ( clipObj ) {
2918			return this.css( "clip", "rect(" + clipObj.top + "px " + clipObj.right + "px " +
2919				clipObj.bottom + "px " + clipObj.left + "px)" );
2920		}
2921		return parseClip( this.css( "clip" ), this );
2922	},
2923
2924	transfer: function( options, done ) {
2925		var element = $( this ),
2926			target = $( options.to ),
2927			targetFixed = target.css( "position" ) === "fixed",
2928			body = $( "body" ),
2929			fixTop = targetFixed ? body.scrollTop() : 0,
2930			fixLeft = targetFixed ? body.scrollLeft() : 0,
2931			endPosition = target.offset(),
2932			animation = {
2933				top: endPosition.top - fixTop,
2934				left: endPosition.left - fixLeft,
2935				height: target.innerHeight(),
2936				width: target.innerWidth()
2937			},
2938			startPosition = element.offset(),
2939			transfer = $( "<div class='ui-effects-transfer'></div>" );
2940
2941		transfer
2942			.appendTo( "body" )
2943			.addClass( options.className )
2944			.css( {
2945				top: startPosition.top - fixTop,
2946				left: startPosition.left - fixLeft,
2947				height: element.innerHeight(),
2948				width: element.innerWidth(),
2949				position: targetFixed ? "fixed" : "absolute"
2950			} )
2951			.animate( animation, options.duration, options.easing, function() {
2952				transfer.remove();
2953				if ( typeof done === "function" ) {
2954					done();
2955				}
2956			} );
2957	}
2958} );
2959
2960function parseClip( str, element ) {
2961		var outerWidth = element.outerWidth(),
2962			outerHeight = element.outerHeight(),
2963			clipRegex = /^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,
2964			values = clipRegex.exec( str ) || [ "", 0, outerWidth, outerHeight, 0 ];
2965
2966		return {
2967			top: parseFloat( values[ 1 ] ) || 0,
2968			right: values[ 2 ] === "auto" ? outerWidth : parseFloat( values[ 2 ] ),
2969			bottom: values[ 3 ] === "auto" ? outerHeight : parseFloat( values[ 3 ] ),
2970			left: parseFloat( values[ 4 ] ) || 0
2971		};
2972}
2973
2974$.fx.step.clip = function( fx ) {
2975	if ( !fx.clipInit ) {
2976		fx.start = $( fx.elem ).cssClip();
2977		if ( typeof fx.end === "string" ) {
2978			fx.end = parseClip( fx.end, fx.elem );
2979		}
2980		fx.clipInit = true;
2981	}
2982
2983	$( fx.elem ).cssClip( {
2984		top: fx.pos * ( fx.end.top - fx.start.top ) + fx.start.top,
2985		right: fx.pos * ( fx.end.right - fx.start.right ) + fx.start.right,
2986		bottom: fx.pos * ( fx.end.bottom - fx.start.bottom ) + fx.start.bottom,
2987		left: fx.pos * ( fx.end.left - fx.start.left ) + fx.start.left
2988	} );
2989};
2990
2991} )();
2992
2993/******************************************************************************/
2994/*********************************** EASING ***********************************/
2995/******************************************************************************/
2996
2997( function() {
2998
2999// Based on easing equations from Robert Penner (http://
vendor: 24,998 bytes, lines 2999-3954
2999www.robertpenner.com/easing)
3000
3001var baseEasings = {};
3002
3003$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
3004	baseEasings[ name ] = function( p ) {
3005		return Math.pow( p, i + 2 );
3006	};
3007} );
3008
3009$.extend( baseEasings, {
3010	Sine: function( p ) {
3011		return 1 - Math.cos( p * Math.PI / 2 );
3012	},
3013	Circ: function( p ) {
3014		return 1 - Math.sqrt( 1 - p * p );
3015	},
3016	Elastic: function( p ) {
3017		return p === 0 || p === 1 ? p :
3018			-Math.pow( 2, 8 * ( p - 1 ) ) * Math.sin( ( ( p - 1 ) * 80 - 7.5 ) * Math.PI / 15 );
3019	},
3020	Back: function( p ) {
3021		return p * p * ( 3 * p - 2 );
3022	},
3023	Bounce: function( p ) {
3024		var pow2,
3025			bounce = 4;
3026
3027		while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
3028		return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
3029	}
3030} );
3031
3032$.each( baseEasings, function( name, easeIn ) {
3033	$.easing[ "easeIn" + name ] = easeIn;
3034	$.easing[ "easeOut" + name ] = function( p ) {
3035		return 1 - easeIn( 1 - p );
3036	};
3037	$.easing[ "easeInOut" + name ] = function( p ) {
3038		return p < 0.5 ?
3039			easeIn( p * 2 ) / 2 :
3040			1 - easeIn( p * -2 + 2 ) / 2;
3041	};
3042} );
3043
3044} )();
3045
3046var effect = $.effects;
3047
3048
3049/*!
3050 * jQuery UI Effects Blind 1.13.2
3051 * http://jqueryui.com
3052 *
3053 * Copyright jQuery Foundation and other contributors
3054 * Released under the MIT license.
3055 * http://jquery.org/license
3056 */
3057
3058//>>label: Blind Effect
3059//>>group: Effects
3060//>>description: Blinds the element.
3061//>>docs: http://api.jqueryui.com/blind-effect/
3062//>>demos: http://jqueryui.com/effect/
3063
3064
3065var effectsEffectBlind = $.effects.define( "blind", "hide", function( options, done ) {
3066	var map = {
3067			up: [ "bottom", "top" ],
3068			vertical: [ "bottom", "top" ],
3069			down: [ "top", "bottom" ],
3070			left: [ "right", "left" ],
3071			horizontal: [ "right", "left" ],
3072			right: [ "left", "right" ]
3073		},
3074		element = $( this ),
3075		direction = options.direction || "up",
3076		start = element.cssClip(),
3077		animate = { clip: $.extend( {}, start ) },
3078		placeholder = $.effects.createPlaceholder( element );
3079
3080	animate.clip[ map[ direction ][ 0 ] ] = animate.clip[ map[ direction ][ 1 ] ];
3081
3082	if ( options.mode === "show" ) {
3083		element.cssClip( animate.clip );
3084		if ( placeholder ) {
3085			placeholder.css( $.effects.clipToBox( animate ) );
3086		}
3087
3088		animate.clip = start;
3089	}
3090
3091	if ( placeholder ) {
3092		placeholder.animate( $.effects.clipToBox( animate ), options.duration, options.easing );
3093	}
3094
3095	element.animate( animate, {
3096		queue: false,
3097		duration: options.duration,
3098		easing: options.easing,
3099		complete: done
3100	} );
3101} );
3102
3103
3104/*!
3105 * jQuery UI Effects Bounce 1.13.2
3106 * http://jqueryui.com
3107 *
3108 * Copyright jQuery Foundation and other contributors
3109 * Released under the MIT license.
3110 * http://jquery.org/license
3111 */
3112
3113//>>label: Bounce Effect
3114//>>group: Effects
3115//>>description: Bounces an element horizontally or vertically n times.
3116//>>docs: http://api.jqueryui.com/bounce-effect/
3117//>>demos: http://jqueryui.com/effect/
3118
3119
3120var effectsEffectBounce = $.effects.define( "bounce", function( options, done ) {
3121	var upAnim, downAnim, refValue,
3122		element = $( this ),
3123
3124		// Defaults:
3125		mode = options.mode,
3126		hide = mode === "hide",
3127		show = mode === "show",
3128		direction = options.direction || "up",
3129		distance = options.distance,
3130		times = options.times || 5,
3131
3132		// Number of internal animations
3133		anims = times * 2 + ( show || hide ? 1 : 0 ),
3134		speed = options.duration / anims,
3135		easing = options.easing,
3136
3137		// Utility:
3138		ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
3139		motion = ( direction === "up" || direction === "left" ),
3140		i = 0,
3141
3142		queuelen = element.queue().length;
3143
3144	$.effects.createPlaceholder( element );
3145
3146	refValue = element.css( ref );
3147
3148	// Default distance for the BIGGEST bounce is the outer Distance / 3
3149	if ( !distance ) {
3150		distance = element[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3;
3151	}
3152
3153	if ( show ) {
3154		downAnim = { opacity: 1 };
3155		downAnim[ ref ] = refValue;
3156
3157		// If we are showing, force opacity 0 and set the initial position
3158		// then do the "first" animation
3159		element
3160			.css( "opacity", 0 )
3161			.css( ref, motion ? -distance * 2 : distance * 2 )
3162			.animate( downAnim, speed, easing );
3163	}
3164
3165	// Start at the smallest distance if we are hiding
3166	if ( hide ) {
3167		distance = distance / Math.pow( 2, times - 1 );
3168	}
3169
3170	downAnim = {};
3171	downAnim[ ref ] = refValue;
3172
3173	// Bounces up/down/left/right then back to 0 -- times * 2 animations happen here
3174	for ( ; i < times; i++ ) {
3175		upAnim = {};
3176		upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
3177
3178		element
3179			.animate( upAnim, speed, easing )
3180			.animate( downAnim, speed, easing );
3181
3182		distance = hide ? distance * 2 : distance / 2;
3183	}
3184
3185	// Last Bounce when Hiding
3186	if ( hide ) {
3187		upAnim = { opacity: 0 };
3188		upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
3189
3190		element.animate( upAnim, speed, easing );
3191	}
3192
3193	element.queue( done );
3194
3195	$.effects.unshift( element, queuelen, anims + 1 );
3196} );
3197
3198
3199/*!
3200 * jQuery UI Effects Clip 1.13.2
3201 * http://jqueryui.com
3202 *
3203 * Copyright jQuery Foundation and other contributors
3204 * Released under the MIT license.
3205 * http://jquery.org/license
3206 */
3207
3208//>>label: Clip Effect
3209//>>group: Effects
3210//>>description: Clips the element on and off like an old TV.
3211//>>docs: http://api.jqueryui.com/clip-effect/
3212//>>demos: http://jqueryui.com/effect/
3213
3214
3215var effectsEffectClip = $.effects.define( "clip", "hide", function( options, done ) {
3216	var start,
3217		animate = {},
3218		element = $( this ),
3219		direction = options.direction || "vertical",
3220		both = direction === "both",
3221		horizontal = both || direction === "horizontal",
3222		vertical = both || direction === "vertical";
3223
3224	start = element.cssClip();
3225	animate.clip = {
3226		top: vertical ? ( start.bottom - start.top ) / 2 : start.top,
3227		right: horizontal ? ( start.right - start.left ) / 2 : start.right,
3228		bottom: vertical ? ( start.bottom - start.top ) / 2 : start.bottom,
3229		left: horizontal ? ( start.right - start.left ) / 2 : start.left
3230	};
3231
3232	$.effects.createPlaceholder( element );
3233
3234	if ( options.mode === "show" ) {
3235		element.cssClip( animate.clip );
3236		animate.clip = start;
3237	}
3238
3239	element.animate( animate, {
3240		queue: false,
3241		duration: options.duration,
3242		easing: options.easing,
3243		complete: done
3244	} );
3245
3246} );
3247
3248
3249/*!
3250 * jQuery UI Effects Drop 1.13.2
3251 * http://jqueryui.com
3252 *
3253 * Copyright jQuery Foundation and other contributors
3254 * Released under the MIT license.
3255 * http://jquery.org/license
3256 */
3257
3258//>>label: Drop Effect
3259//>>group: Effects
3260//>>description: Moves an element in one direction and hides it at the same time.
3261//>>docs: http://api.jqueryui.com/drop-effect/
3262//>>demos: http://jqueryui.com/effect/
3263
3264
3265var effectsEffectDrop = $.effects.define( "drop", "hide", function( options, done ) {
3266
3267	var distance,
3268		element = $( this ),
3269		mode = options.mode,
3270		show = mode === "show",
3271		direction = options.direction || "left",
3272		ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
3273		motion = ( direction === "up" || direction === "left" ) ? "-=" : "+=",
3274		oppositeMotion = ( motion === "+=" ) ? "-=" : "+=",
3275		animation = {
3276			opacity: 0
3277		};
3278
3279	$.effects.createPlaceholder( element );
3280
3281	distance = options.distance ||
3282		element[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ) / 2;
3283
3284	animation[ ref ] = motion + distance;
3285
3286	if ( show ) {
3287		element.css( animation );
3288
3289		animation[ ref ] = oppositeMotion + distance;
3290		animation.opacity = 1;
3291	}
3292
3293	// Animate
3294	element.animate( animation, {
3295		queue: false,
3296		duration: options.duration,
3297		easing: options.easing,
3298		complete: done
3299	} );
3300} );
3301
3302
3303/*!
3304 * jQuery UI Effects Explode 1.13.2
3305 * http://jqueryui.com
3306 *
3307 * Copyright jQuery Foundation and other contributors
3308 * Released under the MIT license.
3309 * http://jquery.org/license
3310 */
3311
3312//>>label: Explode Effect
3313//>>group: Effects
3314/* eslint-disable max-len */
3315//>>description: Explodes an element in all directions into n pieces. Implodes an element to its original wholeness.
3316/* eslint-enable max-len */
3317//>>docs: http://api.jqueryui.com/explode-effect/
3318//>>demos: http://jqueryui.com/effect/
3319
3320
3321var effectsEffectExplode = $.effects.define( "explode", "hide", function( options, done ) {
3322
3323	var i, j, left, top, mx, my,
3324		rows = options.pieces ? Math.round( Math.sqrt( options.pieces ) ) : 3,
3325		cells = rows,
3326		element = $( this ),
3327		mode = options.mode,
3328		show = mode === "show",
3329
3330		// Show and then visibility:hidden the element before calculating offset
3331		offset = element.show().css( "visibility", "hidden" ).offset(),
3332
3333		// Width and height of a piece
3334		width = Math.ceil( element.outerWidth() / cells ),
3335		height = Math.ceil( element.outerHeight() / rows ),
3336		pieces = [];
3337
3338	// Children animate complete:
3339	function childComplete() {
3340		pieces.push( this );
3341		if ( pieces.length === rows * cells ) {
3342			animComplete();
3343		}
3344	}
3345
3346	// Clone the element for each row and cell.
3347	for ( i = 0; i < rows; i++ ) { // ===>
3348		top = offset.top + i * height;
3349		my = i - ( rows - 1 ) / 2;
3350
3351		for ( j = 0; j < cells; j++ ) { // |||
3352			left = offset.left + j * width;
3353			mx = j - ( cells - 1 ) / 2;
3354
3355			// Create a clone of the now hidden main element that will be absolute positioned
3356			// within a wrapper div off the -left and -top equal to size of our pieces
3357			element
3358				.clone()
3359				.appendTo( "body" )
3360				.wrap( "<div></div>" )
3361				.css( {
3362					position: "absolute",
3363					visibility: "visible",
3364					left: -j * width,
3365					top: -i * height
3366				} )
3367
3368				// Select the wrapper - make it overflow: hidden and absolute positioned based on
3369				// where the original was located +left and +top equal to the size of pieces
3370				.parent()
3371					.addClass( "ui-effects-explode" )
3372					.css( {
3373						position: "absolute",
3374						overflow: "hidden",
3375						width: width,
3376						height: height,
3377						left: left + ( show ? mx * width : 0 ),
3378						top: top + ( show ? my * height : 0 ),
3379						opacity: show ? 0 : 1
3380					} )
3381					.animate( {
3382						left: left + ( show ? 0 : mx * width ),
3383						top: top + ( show ? 0 : my * height ),
3384						opacity: show ? 1 : 0
3385					}, options.duration || 500, options.easing, childComplete );
3386		}
3387	}
3388
3389	function animComplete() {
3390		element.css( {
3391			visibility: "visible"
3392		} );
3393		$( pieces ).remove();
3394		done();
3395	}
3396} );
3397
3398
3399/*!
3400 * jQuery UI Effects Fade 1.13.2
3401 * http://jqueryui.com
3402 *
3403 * Copyright jQuery Foundation and other contributors
3404 * Released under the MIT license.
3405 * http://jquery.org/license
3406 */
3407
3408//>>label: Fade Effect
3409//>>group: Effects
3410//>>description: Fades the element.
3411//>>docs: http://api.jqueryui.com/fade-effect/
3412//>>demos: http://jqueryui.com/effect/
3413
3414
3415var effectsEffectFade = $.effects.define( "fade", "toggle", function( options, done ) {
3416	var show = options.mode === "show";
3417
3418	$( this )
3419		.css( "opacity", show ? 0 : 1 )
3420		.animate( {
3421			opacity: show ? 1 : 0
3422		}, {
3423			queue: false,
3424			duration: options.duration,
3425			easing: options.easing,
3426			complete: done
3427		} );
3428} );
3429
3430
3431/*!
3432 * jQuery UI Effects Fold 1.13.2
3433 * http://jqueryui.com
3434 *
3435 * Copyright jQuery Foundation and other contributors
3436 * Released under the MIT license.
3437 * http://jquery.org/license
3438 */
3439
3440//>>label: Fold Effect
3441//>>group: Effects
3442//>>description: Folds an element first horizontally and then vertically.
3443//>>docs: http://api.jqueryui.com/fold-effect/
3444//>>demos: http://jqueryui.com/effect/
3445
3446
3447var effectsEffectFold = $.effects.define( "fold", "hide", function( options, done ) {
3448
3449	// Create element
3450	var element = $( this ),
3451		mode = options.mode,
3452		show = mode === "show",
3453		hide = mode === "hide",
3454		size = options.size || 15,
3455		percent = /([0-9]+)%/.exec( size ),
3456		horizFirst = !!options.horizFirst,
3457		ref = horizFirst ? [ "right", "bottom" ] : [ "bottom", "right" ],
3458		duration = options.duration / 2,
3459
3460		placeholder = $.effects.createPlaceholder( element ),
3461
3462		start = element.cssClip(),
3463		animation1 = { clip: $.extend( {}, start ) },
3464		animation2 = { clip: $.extend( {}, start ) },
3465
3466		distance = [ start[ ref[ 0 ] ], start[ ref[ 1 ] ] ],
3467
3468		queuelen = element.queue().length;
3469
3470	if ( percent ) {
3471		size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ];
3472	}
3473	animation1.clip[ ref[ 0 ] ] = size;
3474	animation2.clip[ ref[ 0 ] ] = size;
3475	animation2.clip[ ref[ 1 ] ] = 0;
3476
3477	if ( show ) {
3478		element.cssClip( animation2.clip );
3479		if ( placeholder ) {
3480			placeholder.css( $.effects.clipToBox( animation2 ) );
3481		}
3482
3483		animation2.clip = start;
3484	}
3485
3486	// Animate
3487	element
3488		.queue( function( next ) {
3489			if ( placeholder ) {
3490				placeholder
3491					.animate( $.effects.clipToBox( animation1 ), duration, options.easing )
3492					.animate( $.effects.clipToBox( animation2 ), duration, options.easing );
3493			}
3494
3495			next();
3496		} )
3497		.animate( animation1, duration, options.easing )
3498		.animate( animation2, duration, options.easing )
3499		.queue( done );
3500
3501	$.effects.unshift( element, queuelen, 4 );
3502} );
3503
3504
3505/*!
3506 * jQuery UI Effects Highlight 1.13.2
3507 * http://jqueryui.com
3508 *
3509 * Copyright jQuery Foundation and other contributors
3510 * Released under the MIT license.
3511 * http://jquery.org/license
3512 */
3513
3514//>>label: Highlight Effect
3515//>>group: Effects
3516//>>description: Highlights the background of an element in a defined color for a custom duration.
3517//>>docs: http://api.jqueryui.com/highlight-effect/
3518//>>demos: http://jqueryui.com/effect/
3519
3520
3521var effectsEffectHighlight = $.effects.define( "highlight", "show", function( options, done ) {
3522	var element = $( this ),
3523		animation = {
3524			backgroundColor: element.css( "backgroundColor" )
3525		};
3526
3527	if ( options.mode === "hide" ) {
3528		animation.opacity = 0;
3529	}
3530
3531	$.effects.saveStyle( element );
3532
3533	element
3534		.css( {
3535			backgroundImage: "none",
3536			backgroundColor: options.color || "#ffff99"
3537		} )
3538		.animate( animation, {
3539			queue: false,
3540			duration: options.duration,
3541			easing: options.easing,
3542			complete: done
3543		} );
3544} );
3545
3546
3547/*!
3548 * jQuery UI Effects Size 1.13.2
3549 * http://jqueryui.com
3550 *
3551 * Copyright jQuery Foundation and other contributors
3552 * Released under the MIT license.
3553 * http://jquery.org/license
3554 */
3555
3556//>>label: Size Effect
3557//>>group: Effects
3558//>>description: Resize an element to a specified width and height.
3559//>>docs: http://api.jqueryui.com/size-effect/
3560//>>demos: http://jqueryui.com/effect/
3561
3562
3563var effectsEffectSize = $.effects.define( "size", function( options, done ) {
3564
3565	// Create element
3566	var baseline, factor, temp,
3567		element = $( this ),
3568
3569		// Copy for children
3570		cProps = [ "fontSize" ],
3571		vProps = [ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ],
3572		hProps = [ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ],
3573
3574		// Set options
3575		mode = options.mode,
3576		restore = mode !== "effect",
3577		scale = options.scale || "both",
3578		origin = options.origin || [ "middle", "center" ],
3579		position = element.css( "position" ),
3580		pos = element.position(),
3581		original = $.effects.scaledDimensions( element ),
3582		from = options.from || original,
3583		to = options.to || $.effects.scaledDimensions( element, 0 );
3584
3585	$.effects.createPlaceholder( element );
3586
3587	if ( mode === "show" ) {
3588		temp = from;
3589		from = to;
3590		to = temp;
3591	}
3592
3593	// Set scaling factor
3594	factor = {
3595		from: {
3596			y: from.height / original.height,
3597			x: from.width / original.width
3598		},
3599		to: {
3600			y: to.height / original.height,
3601			x: to.width / original.width
3602		}
3603	};
3604
3605	// Scale the css box
3606	if ( scale === "box" || scale === "both" ) {
3607
3608		// Vertical props scaling
3609		if ( factor.from.y !== factor.to.y ) {
3610			from = $.effects.setTransition( element, vProps, factor.from.y, from );
3611			to = $.effects.setTransition( element, vProps, factor.to.y, to );
3612		}
3613
3614		// Horizontal props scaling
3615		if ( factor.from.x !== factor.to.x ) {
3616			from = $.effects.setTransition( element, hProps, factor.from.x, from );
3617			to = $.effects.setTransition( element, hProps, factor.to.x, to );
3618		}
3619	}
3620
3621	// Scale the content
3622	if ( scale === "content" || scale === "both" ) {
3623
3624		// Vertical props scaling
3625		if ( factor.from.y !== factor.to.y ) {
3626			from = $.effects.setTransition( element, cProps, factor.from.y, from );
3627			to = $.effects.setTransition( element, cProps, factor.to.y, to );
3628		}
3629	}
3630
3631	// Adjust the position properties based on the provided origin points
3632	if ( origin ) {
3633		baseline = $.effects.getBaseline( origin, original );
3634		from.top = ( original.outerHeight - from.outerHeight ) * baseline.y + pos.top;
3635		from.left = ( original.outerWidth - from.outerWidth ) * baseline.x + pos.left;
3636		to.top = ( original.outerHeight - to.outerHeight ) * baseline.y + pos.top;
3637		to.left = ( original.outerWidth - to.outerWidth ) * baseline.x + pos.left;
3638	}
3639	delete from.outerHeight;
3640	delete from.outerWidth;
3641	element.css( from );
3642
3643	// Animate the children if desired
3644	if ( scale === "content" || scale === "both" ) {
3645
3646		vProps = vProps.concat( [ "marginTop", "marginBottom" ] ).concat( cProps );
3647		hProps = hProps.concat( [ "marginLeft", "marginRight" ] );
3648
3649		// Only animate children with width attributes specified
3650		// TODO: is this right? should we include anything with css width specified as well
3651		element.find( "*[width]" ).each( function() {
3652			var child = $( this ),
3653				childOriginal = $.effects.scaledDimensions( child ),
3654				childFrom = {
3655					height: childOriginal.height * factor.from.y,
3656					width: childOriginal.width * factor.from.x,
3657					outerHeight: childOriginal.outerHeight * factor.from.y,
3658					outerWidth: childOriginal.outerWidth * factor.from.x
3659				},
3660				childTo = {
3661					height: childOriginal.height * factor.to.y,
3662					width: childOriginal.width * factor.to.x,
3663					outerHeight: childOriginal.height * factor.to.y,
3664					outerWidth: childOriginal.width * factor.to.x
3665				};
3666
3667			// Vertical props scaling
3668			if ( factor.from.y !== factor.to.y ) {
3669				childFrom = $.effects.setTransition( child, vProps, factor.from.y, childFrom );
3670				childTo = $.effects.setTransition( child, vProps, factor.to.y, childTo );
3671			}
3672
3673			// Horizontal props scaling
3674			if ( factor.from.x !== factor.to.x ) {
3675				childFrom = $.effects.setTransition( child, hProps, factor.from.x, childFrom );
3676				childTo = $.effects.setTransition( child, hProps, factor.to.x, childTo );
3677			}
3678
3679			if ( restore ) {
3680				$.effects.saveStyle( child );
3681			}
3682
3683			// Animate children
3684			child.css( childFrom );
3685			child.animate( childTo, options.duration, options.easing, function() {
3686
3687				// Restore children
3688				if ( restore ) {
3689					$.effects.restoreStyle( child );
3690				}
3691			} );
3692		} );
3693	}
3694
3695	// Animate
3696	element.animate( to, {
3697		queue: false,
3698		duration: options.duration,
3699		easing: options.easing,
3700		complete: function() {
3701
3702			var offset = element.offset();
3703
3704			if ( to.opacity === 0 ) {
3705				element.css( "opacity", from.opacity );
3706			}
3707
3708			if ( !restore ) {
3709				element
3710					.css( "position", position === "static" ? "relative" : position )
3711					.offset( offset );
3712
3713				// Need to save style here so that automatic style restoration
3714				// doesn't restore to the original styles from before the animation.
3715				$.effects.saveStyle( element );
3716			}
3717
3718			done();
3719		}
3720	} );
3721
3722} );
3723
3724
3725/*!
3726 * jQuery UI Effects Scale 1.13.2
3727 * http://jqueryui.com
3728 *
3729 * Copyright jQuery Foundation and other contributors
3730 * Released under the MIT license.
3731 * http://jquery.org/license
3732 */
3733
3734//>>label: Scale Effect
3735//>>group: Effects
3736//>>description: Grows or shrinks an element and its content.
3737//>>docs: http://api.jqueryui.com/scale-effect/
3738//>>demos: http://jqueryui.com/effect/
3739
3740
3741var effectsEffectScale = $.effects.define( "scale", function( options, done ) {
3742
3743	// Create element
3744	var el = $( this ),
3745		mode = options.mode,
3746		percent = parseInt( options.percent, 10 ) ||
3747			( parseInt( options.percent, 10 ) === 0 ? 0 : ( mode !== "effect" ? 0 : 100 ) ),
3748
3749		newOptions = $.extend( true, {
3750			from: $.effects.scaledDimensions( el ),
3751			to: $.effects.scaledDimensions( el, percent, options.direction || "both" ),
3752			origin: options.origin || [ "middle", "center" ]
3753		}, options );
3754
3755	// Fade option to support puff
3756	if ( options.fade ) {
3757		newOptions.from.opacity = 1;
3758		newOptions.to.opacity = 0;
3759	}
3760
3761	$.effects.effect.size.call( this, newOptions, done );
3762} );
3763
3764
3765/*!
3766 * jQuery UI Effects Puff 1.13.2
3767 * http://jqueryui.com
3768 *
3769 * Copyright jQuery Foundation and other contributors
3770 * Released under the MIT license.
3771 * http://jquery.org/license
3772 */
3773
3774//>>label: Puff Effect
3775//>>group: Effects
3776//>>description: Creates a puff effect by scaling the element up and hiding it at the same time.
3777//>>docs: http://api.jqueryui.com/puff-effect/
3778//>>demos: http://jqueryui.com/effect/
3779
3780
3781var effectsEffectPuff = $.effects.define( "puff", "hide", function( options, done ) {
3782	var newOptions = $.extend( true, {}, options, {
3783		fade: true,
3784		percent: parseInt( options.percent, 10 ) || 150
3785	} );
3786
3787	$.effects.effect.scale.call( this, newOptions, done );
3788} );
3789
3790
3791/*!
3792 * jQuery UI Effects Pulsate 1.13.2
3793 * http://jqueryui.com
3794 *
3795 * Copyright jQuery Foundation and other contributors
3796 * Released under the MIT license.
3797 * http://jquery.org/license
3798 */
3799
3800//>>label: Pulsate Effect
3801//>>group: Effects
3802//>>description: Pulsates an element n times by changing the opacity to zero and back.
3803//>>docs: http://api.jqueryui.com/pulsate-effect/
3804//>>demos: http://jqueryui.com/effect/
3805
3806
3807var effectsEffectPulsate = $.effects.define( "pulsate", "show", function( options, done ) {
3808	var element = $( this ),
3809		mode = options.mode,
3810		show = mode === "show",
3811		hide = mode === "hide",
3812		showhide = show || hide,
3813
3814		// Showing or hiding leaves off the "last" animation
3815		anims = ( ( options.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ),
3816		duration = options.duration / anims,
3817		animateTo = 0,
3818		i = 1,
3819		queuelen = element.queue().length;
3820
3821	if ( show || !element.is( ":visible" ) ) {
3822		element.css( "opacity", 0 ).show();
3823		animateTo = 1;
3824	}
3825
3826	// Anims - 1 opacity "toggles"
3827	for ( ; i < anims; i++ ) {
3828		element.animate( { opacity: animateTo }, duration, options.easing );
3829		animateTo = 1 - animateTo;
3830	}
3831
3832	element.animate( { opacity: animateTo }, duration, options.easing );
3833
3834	element.queue( done );
3835
3836	$.effects.unshift( element, queuelen, anims + 1 );
3837} );
3838
3839
3840/*!
3841 * jQuery UI Effects Shake 1.13.2
3842 * http://jqueryui.com
3843 *
3844 * Copyright jQuery Foundation and other contributors
3845 * Released under the MIT license.
3846 * http://jquery.org/license
3847 */
3848
3849//>>label: Shake Effect
3850//>>group: Effects
3851//>>description: Shakes an element horizontally or vertically n times.
3852//>>docs: http://api.jqueryui.com/shake-effect/
3853//>>demos: http://jqueryui.com/effect/
3854
3855
3856var effectsEffectShake = $.effects.define( "shake", function( options, done ) {
3857
3858	var i = 1,
3859		element = $( this ),
3860		direction = options.direction || "left",
3861		distance = options.distance || 20,
3862		times = options.times || 3,
3863		anims = times * 2 + 1,
3864		speed = Math.round( options.duration / anims ),
3865		ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
3866		positiveMotion = ( direction === "up" || direction === "left" ),
3867		animation = {},
3868		animation1 = {},
3869		animation2 = {},
3870
3871		queuelen = element.queue().length;
3872
3873	$.effects.createPlaceholder( element );
3874
3875	// Animation
3876	animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance;
3877	animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2;
3878	animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2;
3879
3880	// Animate
3881	element.animate( animation, speed, options.easing );
3882
3883	// Shakes
3884	for ( ; i < times; i++ ) {
3885		element
3886			.animate( animation1, speed, options.easing )
3887			.animate( animation2, speed, options.easing );
3888	}
3889
3890	element
3891		.animate( animation1, speed, options.easing )
3892		.animate( animation, speed / 2, options.easing )
3893		.queue( done );
3894
3895	$.effects.unshift( element, queuelen, anims + 1 );
3896} );
3897
3898
3899/*!
3900 * jQuery UI Effects Slide 1.13.2
3901 * http://jqueryui.com
3902 *
3903 * Copyright jQuery Foundation and other contributors
3904 * Released under the MIT license.
3905 * http://jquery.org/license
3906 */
3907
3908//>>label: Slide Effect
3909//>>group: Effects
3910//>>description: Slides an element in and out of the viewport.
3911//>>docs: http://api.jqueryui.com/slide-effect/
3912//>>demos: http://jqueryui.com/effect/
3913
3914
3915var effectsEffectSlide = $.effects.define( "slide", "show", function( options, done ) {
3916	var startClip, startRef,
3917		element = $( this ),
3918		map = {
3919			up: [ "bottom", "top" ],
3920			down: [ "top", "bottom" ],
3921			left: [ "right", "left" ],
3922			right: [ "left", "right" ]
3923		},
3924		mode = options.mode,
3925		direction = options.direction || "left",
3926		ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
3927		positiveMotion = ( direction === "up" || direction === "left" ),
3928		distance = options.distance ||
3929			element[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ),
3930		animation = {};
3931
3932	$.effects.createPlaceholder( element );
3933
3934	startClip = element.cssClip();
3935	startRef = element.position()[ ref ];
3936
3937	// Define hide animation
3938	animation[ ref ] = ( positiveMotion ? -1 : 1 ) * distance + startRef;
3939	animation.clip = element.cssClip();
3940	animation.clip[ map[ direction ][ 1 ] ] = animation.clip[ map[ direction ][ 0 ] ];
3941
3942	// Reverse the animation if we're showing
3943	if ( mode === "show" ) {
3944		element.cssClip( animation.clip );
3945		element.css( ref, animation[ ref ] );
3946		animation.clip = startClip;
3947		animation[ ref ] = startRef;
3948	}
3949
3950	// Actually animate
3951	element.animate( animation, {
3952		queue: false,
3953		duration: options.duration,
3954		easing: options.easing,
vendor: 9,661 bytes, lines 3955-4337
3955		complete: done
3956	} );
3957} );
3958
3959
3960/*!
3961 * jQuery UI Effects Transfer 1.13.2
3962 * http://jqueryui.com
3963 *
3964 * Copyright jQuery Foundation and other contributors
3965 * Released under the MIT license.
3966 * http://jquery.org/license
3967 */
3968
3969//>>label: Transfer Effect
3970//>>group: Effects
3971//>>description: Displays a transfer effect from one element to another.
3972//>>docs: http://api.jqueryui.com/transfer-effect/
3973//>>demos: http://jqueryui.com/effect/
3974
3975
3976var effect;
3977if ( $.uiBackCompat !== false ) {
3978	effect = $.effects.define( "transfer", function( options, done ) {
3979		$( this ).transfer( options, done );
3980	} );
3981}
3982var effectsEffectTransfer = effect;
3983
3984
3985/*!
3986 * jQuery UI Focusable 1.13.2
3987 * http://jqueryui.com
3988 *
3989 * Copyright jQuery Foundation and other contributors
3990 * Released under the MIT license.
3991 * http://jquery.org/license
3992 */
3993
3994//>>label: :focusable Selector
3995//>>group: Core
3996//>>description: Selects elements which can be focused.
3997//>>docs: http://api.jqueryui.com/focusable-selector/
3998
3999
4000// Selectors
4001$.ui.focusable = function( element, hasTabindex ) {
4002	var map, mapName, img, focusableIfVisible, fieldset,
4003		nodeName = element.nodeName.toLowerCase();
4004
4005	if ( "area" === nodeName ) {
4006		map = element.parentNode;
4007		mapName = map.name;
4008		if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
4009			return false;
4010		}
4011		img = $( "img[usemap='#" + mapName + "']" );
4012		return img.length > 0 && img.is( ":visible" );
4013	}
4014
4015	if ( /^(input|select|textarea|button|object)$/.test( nodeName ) ) {
4016		focusableIfVisible = !element.disabled;
4017
4018		if ( focusableIfVisible ) {
4019
4020			// Form controls within a disabled fieldset are disabled.
4021			// However, controls within the fieldset's legend do not get disabled.
4022			// Since controls generally aren't placed inside legends, we skip
4023			// this portion of the check.
4024			fieldset = $( element ).closest( "fieldset" )[ 0 ];
4025			if ( fieldset ) {
4026				focusableIfVisible = !fieldset.disabled;
4027			}
4028		}
4029	} else if ( "a" === nodeName ) {
4030		focusableIfVisible = element.href || hasTabindex;
4031	} else {
4032		focusableIfVisible = hasTabindex;
4033	}
4034
4035	return focusableIfVisible && $( element ).is( ":visible" ) && visible( $( element ) );
4036};
4037
4038// Support: IE 8 only
4039// IE 8 doesn't resolve inherit to visible/hidden for computed values
4040function visible( element ) {
4041	var visibility = element.css( "visibility" );
4042	while ( visibility === "inherit" ) {
4043		element = element.parent();
4044		visibility = element.css( "visibility" );
4045	}
4046	return visibility === "visible";
4047}
4048
4049$.extend( $.expr.pseudos, {
4050	focusable: function( element ) {
4051		return $.ui.focusable( element, $.attr( element, "tabindex" ) != null );
4052	}
4053} );
4054
4055var focusable = $.ui.focusable;
4056
4057
4058
4059// Support: IE8 Only
4060// IE8 does not support the form attribute and when it is supplied. It overwrites the form prop
4061// with a string, so we need to find the proper form.
4062var form = $.fn._form = function() {
4063	return typeof this[ 0 ].form === "string" ? this.closest( "form" ) : $( this[ 0 ].form );
4064};
4065
4066
4067/*!
4068 * jQuery UI Form Reset Mixin 1.13.2
4069 * http://jqueryui.com
4070 *
4071 * Copyright jQuery Foundation and other contributors
4072 * Released under the MIT license.
4073 * http://jquery.org/license
4074 */
4075
4076//>>label: Form Reset Mixin
4077//>>group: Core
4078//>>description: Refresh input widgets when their form is reset
4079//>>docs: http://api.jqueryui.com/form-reset-mixin/
4080
4081
4082var formResetMixin = $.ui.formResetMixin = {
4083	_formResetHandler: function() {
4084		var form = $( this );
4085
4086		// Wait for the form reset to actually happen before refreshing
4087		setTimeout( function() {
4088			var instances = form.data( "ui-form-reset-instances" );
4089			$.each( instances, function() {
4090				this.refresh();
4091			} );
4092		} );
4093	},
4094
4095	_bindFormResetHandler: function() {
4096		this.form = this.element._form();
4097		if ( !this.form.length ) {
4098			return;
4099		}
4100
4101		var instances = this.form.data( "ui-form-reset-instances" ) || [];
4102		if ( !instances.length ) {
4103
4104			// We don't use _on() here because we use a single event handler per form
4105			this.form.on( "reset.ui-form-reset", this._formResetHandler );
4106		}
4107		instances.push( this );
4108		this.form.data( "ui-form-reset-instances", instances );
4109	},
4110
4111	_unbindFormResetHandler: function() {
4112		if ( !this.form.length ) {
4113			return;
4114		}
4115
4116		var instances = this.form.data( "ui-form-reset-instances" );
4117		instances.splice( $.inArray( this, instances ), 1 );
4118		if ( instances.length ) {
4119			this.form.data( "ui-form-reset-instances", instances );
4120		} else {
4121			this.form
4122				.removeData( "ui-form-reset-instances" )
4123				.off( "reset.ui-form-reset" );
4124		}
4125	}
4126};
4127
4128
4129/*!
4130 * jQuery UI Support for jQuery core 1.8.x and newer 1.13.2
4131 * http://jqueryui.com
4132 *
4133 * Copyright jQuery Foundation and other contributors
4134 * Released under the MIT license.
4135 * http://jquery.org/license
4136 *
4137 */
4138
4139//>>label: jQuery 1.8+ Support
4140//>>group: Core
4141//>>description: Support version 1.8.x and newer of jQuery core
4142
4143
4144// Support: jQuery 1.9.x or older
4145// $.expr[ ":" ] is deprecated.
4146if ( !$.expr.pseudos ) {
4147	$.expr.pseudos = $.expr[ ":" ];
4148}
4149
4150// Support: jQuery 1.11.x or older
4151// $.unique has been renamed to $.uniqueSort
4152if ( !$.uniqueSort ) {
4153	$.uniqueSort = $.unique;
4154}
4155
4156// Support: jQuery 2.2.x or older.
4157// This method has been defined in jQuery 3.0.0.
4158// Code from https://github.com/jquery/jquery/blob/e539bac79e666bba95bba86d690b4e609dca2286/src/selector/escapeSelector.js
4159if ( !$.escapeSelector ) {
4160
4161	// CSS string/identifier serialization
4162	// https://drafts.csswg.org/cssom/#common-serializing-idioms
4163	var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
4164
4165	var fcssescape = function( ch, asCodePoint ) {
4166		if ( asCodePoint ) {
4167
4168			// U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
4169			if ( ch === "\0" ) {
4170				return "\uFFFD";
4171			}
4172
4173			// Control characters and (dependent upon position) numbers get escaped as code points
4174			return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
4175		}
4176
4177		// Other potentially-special ASCII characters get backslash-escaped
4178		return "\\" + ch;
4179	};
4180
4181	$.escapeSelector = function( sel ) {
4182		return ( sel + "" ).replace( rcssescape, fcssescape );
4183	};
4184}
4185
4186// Support: jQuery 3.4.x or older
4187// These methods have been defined in jQuery 3.5.0.
4188if ( !$.fn.even || !$.fn.odd ) {
4189	$.fn.extend( {
4190		even: function() {
4191			return this.filter( function( i ) {
4192				return i % 2 === 0;
4193			} );
4194		},
4195		odd: function() {
4196			return this.filter( function( i ) {
4197				return i % 2 === 1;
4198			} );
4199		}
4200	} );
4201}
4202
4203;
4204/*!
4205 * jQuery UI Keycode 1.13.2
4206 * http://jqueryui.com
4207 *
4208 * Copyright jQuery Foundation and other contributors
4209 * Released under the MIT license.
4210 * http://jquery.org/license
4211 */
4212
4213//>>label: Keycode
4214//>>group: Core
4215//>>description: Provide keycodes as keynames
4216//>>docs: http://api.jqueryui.com/jQuery.ui.keyCode/
4217
4218
4219var keycode = $.ui.keyCode = {
4220	BACKSPACE: 8,
4221	COMMA: 188,
4222	DELETE: 46,
4223	DOWN: 40,
4224	END: 35,
4225	ENTER: 13,
4226	ESCAPE: 27,
4227	HOME: 36,
4228	LEFT: 37,
4229	PAGE_DOWN: 34,
4230	PAGE_UP: 33,
4231	PERIOD: 190,
4232	RIGHT: 39,
4233	SPACE: 32,
4234	TAB: 9,
4235	UP: 38
4236};
4237
4238
4239/*!
4240 * jQuery UI Labels 1.13.2
4241 * http://jqueryui.com
4242 *
4243 * Copyright jQuery Foundation and other contributors
4244 * Released under the MIT license.
4245 * http://jquery.org/license
4246 */
4247
4248//>>label: labels
4249//>>group: Core
4250//>>description: Find all the labels associated with a given input
4251//>>docs: http://api.jqueryui.com/labels/
4252
4253
4254var labels = $.fn.labels = function() {
4255	var ancestor, selector, id, labels, ancestors;
4256
4257	if ( !this.length ) {
4258		return this.pushStack( [] );
4259	}
4260
4261	// Check control.labels first
4262	if ( this[ 0 ].labels && this[ 0 ].labels.length ) {
4263		return this.pushStack( this[ 0 ].labels );
4264	}
4265
4266	// Support: IE <= 11, FF <= 37, Android <= 2.3 only
4267	// Above browsers do not support control.labels. Everything below is to support them
4268	// as well as document fragments. control.labels does not work on document fragments
4269	labels = this.eq( 0 ).parents( "label" );
4270
4271	// Look for the label based on the id
4272	id = this.attr( "id" );
4273	if ( id ) {
4274
4275		// We don't search against the document in case the element
4276		// is disconnected from the DOM
4277		ancestor = this.eq( 0 ).parents().last();
4278
4279		// Get a full set of top level ancestors
4280		ancestors = ancestor.add( ancestor.length ? ancestor.siblings() : this.siblings() );
4281
4282		// Create a selector for the label based on the id
4283		selector = "label[for='" + $.escapeSelector( id ) + "']";
4284
4285		labels = labels.add( ancestors.find( selector ).addBack( selector ) );
4286
4287	}
4288
4289	// Return whatever we have found for labels
4290	return this.pushStack( labels );
4291};
4292
4293
4294/*!
4295 * jQuery UI Scroll Parent 1.13.2
4296 * http://jqueryui.com
4297 *
4298 * Copyright jQuery Foundation and other contributors
4299 * Released under the MIT license.
4300 * http://jquery.org/license
4301 */
4302
4303//>>label: scrollParent
4304//>>group: Core
4305//>>description: Get the closest ancestor element that is scrollable.
4306//>>docs: http://api.jqueryui.com/scrollParent/
4307
4308
4309var scrollParent = $.fn.scrollParent = function( includeHidden ) {
4310	var position = this.css( "position" ),
4311		excludeStaticParent = position === "absolute",
4312		overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
4313		scrollParent = this.parents().filter( function() {
4314			var parent = $( this );
4315			if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
4316				return false;
4317			}
4318			return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) +
4319				parent.css( "overflow-x" ) );
4320		} ).eq( 0 );
4321
4322	return position === "fixed" || !scrollParent.length ?
4323		$( this[ 0 ].ownerDocument || document ) :
4324		scrollParent;
4325};
4326
4327
4328/*!
4329 * jQuery UI Tabbable 1.13.2
4330 * http://jqueryui.com
4331 *
4332 * Copyright jQuery Foundation and other contributors
4333 * Released under the MIT license.
4334 * http://jquery.org/license
4335 */
4336
4337//>>label: :tabbable Selector
vendor: 1,775 bytes, lines 4338-4412
4338//>>group: Core
4339//>>description: Selects elements which can be tabbed to.
4340//>>docs: http://api.jqueryui.com/tabbable-selector/
4341
4342
4343var tabbable = $.extend( $.expr.pseudos, {
4344	tabbable: function( element ) {
4345		var tabIndex = $.attr( element, "tabindex" ),
4346			hasTabindex = tabIndex != null;
4347		return ( !hasTabindex || tabIndex >= 0 ) && $.ui.focusable( element, hasTabindex );
4348	}
4349} );
4350
4351
4352/*!
4353 * jQuery UI Unique ID 1.13.2
4354 * http://jqueryui.com
4355 *
4356 * Copyright jQuery Foundation and other contributors
4357 * Released under the MIT license.
4358 * http://jquery.org/license
4359 */
4360
4361//>>label: uniqueId
4362//>>group: Core
4363//>>description: Functions to generate and remove uniqueId's
4364//>>docs: http://api.jqueryui.com/uniqueId/
4365
4366
4367var uniqueId = $.fn.extend( {
4368	uniqueId: ( function() {
4369		var uuid = 0;
4370
4371		return function() {
4372			return this.each( function() {
4373				if ( !this.id ) {
4374					this.id = "ui-id-" + ( ++uuid );
4375				}
4376			} );
4377		};
4378	} )(),
4379
4380	removeUniqueId: function() {
4381		return this.each( function() {
4382			if ( /^ui-id-\d+$/.test( this.id ) ) {
4383				$( this ).removeAttr( "id" );
4384			}
4385		} );
4386	}
4387} );
4388
4389
4390/*!
4391 * jQuery UI Accordion 1.13.2
4392 * http://jqueryui.com
4393 *
4394 * Copyright jQuery Foundation and other contributors
4395 * Released under the MIT license.
4396 * http://jquery.org/license
4397 */
4398
4399//>>label: Accordion
4400//>>group: Widgets
4401/* eslint-disable max-len */
4402//>>description: Displays collapsible content panels for presenting information in a limited amount of space.
4403/* eslint-enable max-len */
4404//>>docs: http://api.jqueryui.com/accordion/
4405//>>demos: http://jqueryui.com/accordion/
4406//>>css.structure: ../../themes/base/core.css
4407//>>css.structure: ../../themes/base/accordion.css
4408//>>css.theme: ../../themes/base/theme.css
4409
4410
4411var widgetsAccordion = $.widget( "ui.accordion", {
4412	version: "1.13.2
vendor: 15,900 bytes, lines 4412-5023
4412",
4413	options: {
4414		active: 0,
4415		animate: {},
4416		classes: {
4417			"ui-accordion-header": "ui-corner-top",
4418			"ui-accordion-header-collapsed": "ui-corner-all",
4419			"ui-accordion-content": "ui-corner-bottom"
4420		},
4421		collapsible: false,
4422		event: "click",
4423		header: function( elem ) {
4424			return elem.find( "> li > :first-child" ).add( elem.find( "> :not(li)" ).even() );
4425		},
4426		heightStyle: "auto",
4427		icons: {
4428			activeHeader: "ui-icon-triangle-1-s",
4429			header: "ui-icon-triangle-1-e"
4430		},
4431
4432		// Callbacks
4433		activate: null,
4434		beforeActivate: null
4435	},
4436
4437	hideProps: {
4438		borderTopWidth: "hide",
4439		borderBottomWidth: "hide",
4440		paddingTop: "hide",
4441		paddingBottom: "hide",
4442		height: "hide"
4443	},
4444
4445	showProps: {
4446		borderTopWidth: "show",
4447		borderBottomWidth: "show",
4448		paddingTop: "show",
4449		paddingBottom: "show",
4450		height: "show"
4451	},
4452
4453	_create: function() {
4454		var options = this.options;
4455
4456		this.prevShow = this.prevHide = $();
4457		this._addClass( "ui-accordion", "ui-widget ui-helper-reset" );
4458		this.element.attr( "role", "tablist" );
4459
4460		// Don't allow collapsible: false and active: false / null
4461		if ( !options.collapsible && ( options.active === false || options.active == null ) ) {
4462			options.active = 0;
4463		}
4464
4465		this._processPanels();
4466
4467		// handle negative values
4468		if ( options.active < 0 ) {
4469			options.active += this.headers.length;
4470		}
4471		this._refresh();
4472	},
4473
4474	_getCreateEventData: function() {
4475		return {
4476			header: this.active,
4477			panel: !this.active.length ? $() : this.active.next()
4478		};
4479	},
4480
4481	_createIcons: function() {
4482		var icon, children,
4483			icons = this.options.icons;
4484
4485		if ( icons ) {
4486			icon = $( "<span>" );
4487			this._addClass( icon, "ui-accordion-header-icon", "ui-icon " + icons.header );
4488			icon.prependTo( this.headers );
4489			children = this.active.children( ".ui-accordion-header-icon" );
4490			this._removeClass( children, icons.header )
4491				._addClass( children, null, icons.activeHeader )
4492				._addClass( this.headers, "ui-accordion-icons" );
4493		}
4494	},
4495
4496	_destroyIcons: function() {
4497		this._removeClass( this.headers, "ui-accordion-icons" );
4498		this.headers.children( ".ui-accordion-header-icon" ).remove();
4499	},
4500
4501	_destroy: function() {
4502		var contents;
4503
4504		// Clean up main element
4505		this.element.removeAttr( "role" );
4506
4507		// Clean up headers
4508		this.headers
4509			.removeAttr( "role aria-expanded aria-selected aria-controls tabIndex" )
4510			.removeUniqueId();
4511
4512		this._destroyIcons();
4513
4514		// Clean up content panels
4515		contents = this.headers.next()
4516			.css( "display", "" )
4517			.removeAttr( "role aria-hidden aria-labelledby" )
4518			.removeUniqueId();
4519
4520		if ( this.options.heightStyle !== "content" ) {
4521			contents.css( "height", "" );
4522		}
4523	},
4524
4525	_setOption: function( key, value ) {
4526		if ( key === "active" ) {
4527
4528			// _activate() will handle invalid values and update this.options
4529			this._activate( value );
4530			return;
4531		}
4532
4533		if ( key === "event" ) {
4534			if ( this.options.event ) {
4535				this._off( this.headers, this.options.event );
4536			}
4537			this._setupEvents( value );
4538		}
4539
4540		this._super( key, value );
4541
4542		// Setting collapsible: false while collapsed; open first panel
4543		if ( key === "collapsible" && !value && this.options.active === false ) {
4544			this._activate( 0 );
4545		}
4546
4547		if ( key === "icons" ) {
4548			this._destroyIcons();
4549			if ( value ) {
4550				this._createIcons();
4551			}
4552		}
4553	},
4554
4555	_setOptionDisabled: function( value ) {
4556		this._super( value );
4557
4558		this.element.attr( "aria-disabled", value );
4559
4560		// Support: IE8 Only
4561		// #5332 / #6059 - opacity doesn't cascade to positioned elements in IE
4562		// so we need to add the disabled class to the headers and panels
4563		this._toggleClass( null, "ui-state-disabled", !!value );
4564		this._toggleClass( this.headers.add( this.headers.next() ), null, "ui-state-disabled",
4565			!!value );
4566	},
4567
4568	_keydown: function( event ) {
4569		if ( event.altKey || event.ctrlKey ) {
4570			return;
4571		}
4572
4573		var keyCode = $.ui.keyCode,
4574			length = this.headers.length,
4575			currentIndex = this.headers.index( event.target ),
4576			toFocus = false;
4577
4578		switch ( event.keyCode ) {
4579		case keyCode.RIGHT:
4580		case keyCode.DOWN:
4581			toFocus = this.headers[ ( currentIndex + 1 ) % length ];
4582			break;
4583		case keyCode.LEFT:
4584		case keyCode.UP:
4585			toFocus = this.headers[ ( currentIndex - 1 + length ) % length ];
4586			break;
4587		case keyCode.SPACE:
4588		case keyCode.ENTER:
4589			this._eventHandler( event );
4590			break;
4591		case keyCode.HOME:
4592			toFocus = this.headers[ 0 ];
4593			break;
4594		case keyCode.END:
4595			toFocus = this.headers[ length - 1 ];
4596			break;
4597		}
4598
4599		if ( toFocus ) {
4600			$( event.target ).attr( "tabIndex", -1 );
4601			$( toFocus ).attr( "tabIndex", 0 );
4602			$( toFocus ).trigger( "focus" );
4603			event.preventDefault();
4604		}
4605	},
4606
4607	_panelKeyDown: function( event ) {
4608		if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) {
4609			$( event.currentTarget ).prev().trigger( "focus" );
4610		}
4611	},
4612
4613	refresh: function() {
4614		var options = this.options;
4615		this._processPanels();
4616
4617		// Was collapsed or no panel
4618		if ( ( options.active === false && options.collapsible === true ) ||
4619				!this.headers.length ) {
4620			options.active = false;
4621			this.active = $();
4622
4623		// active false only when collapsible is true
4624		} else if ( options.active === false ) {
4625			this._activate( 0 );
4626
4627		// was active, but active panel is gone
4628		} else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
4629
4630			// all remaining panel are disabled
4631			if ( this.headers.length === this.headers.find( ".ui-state-disabled" ).length ) {
4632				options.active = false;
4633				this.active = $();
4634
4635			// activate previous panel
4636			} else {
4637				this._activate( Math.max( 0, options.active - 1 ) );
4638			}
4639
4640		// was active, active panel still exists
4641		} else {
4642
4643			// make sure active index is correct
4644			options.active = this.headers.index( this.active );
4645		}
4646
4647		this._destroyIcons();
4648
4649		this._refresh();
4650	},
4651
4652	_processPanels: function() {
4653		var prevHeaders = this.headers,
4654			prevPanels = this.panels;
4655
4656		if ( typeof this.options.header === "function" ) {
4657			this.headers = this.options.header( this.element );
4658		} else {
4659			this.headers = this.element.find( this.options.header );
4660		}
4661		this._addClass( this.headers, "ui-accordion-header ui-accordion-header-collapsed",
4662			"ui-state-default" );
4663
4664		this.panels = this.headers.next().filter( ":not(.ui-accordion-content-active)" ).hide();
4665		this._addClass( this.panels, "ui-accordion-content", "ui-helper-reset ui-widget-content" );
4666
4667		// Avoid memory leaks (#10056)
4668		if ( prevPanels ) {
4669			this._off( prevHeaders.not( this.headers ) );
4670			this._off( prevPanels.not( this.panels ) );
4671		}
4672	},
4673
4674	_refresh: function() {
4675		var maxHeight,
4676			options = this.options,
4677			heightStyle = options.heightStyle,
4678			parent = this.element.parent();
4679
4680		this.active = this._findActive( options.active );
4681		this._addClass( this.active, "ui-accordion-header-active", "ui-state-active" )
4682			._removeClass( this.active, "ui-accordion-header-collapsed" );
4683		this._addClass( this.active.next(), "ui-accordion-content-active" );
4684		this.active.next().show();
4685
4686		this.headers
4687			.attr( "role", "tab" )
4688			.each( function() {
4689				var header = $( this ),
4690					headerId = header.uniqueId().attr( "id" ),
4691					panel = header.next(),
4692					panelId = panel.uniqueId().attr( "id" );
4693				header.attr( "aria-controls", panelId );
4694				panel.attr( "aria-labelledby", headerId );
4695			} )
4696			.next()
4697				.attr( "role", "tabpanel" );
4698
4699		this.headers
4700			.not( this.active )
4701				.attr( {
4702					"aria-selected": "false",
4703					"aria-expanded": "false",
4704					tabIndex: -1
4705				} )
4706				.next()
4707					.attr( {
4708						"aria-hidden": "true"
4709					} )
4710					.hide();
4711
4712		// Make sure at least one header is in the tab order
4713		if ( !this.active.length ) {
4714			this.headers.eq( 0 ).attr( "tabIndex", 0 );
4715		} else {
4716			this.active.attr( {
4717				"aria-selected": "true",
4718				"aria-expanded": "true",
4719				tabIndex: 0
4720			} )
4721				.next()
4722					.attr( {
4723						"aria-hidden": "false"
4724					} );
4725		}
4726
4727		this._createIcons();
4728
4729		this._setupEvents( options.event );
4730
4731		if ( heightStyle === "fill" ) {
4732			maxHeight = parent.height();
4733			this.element.siblings( ":visible" ).each( function() {
4734				var elem = $( this ),
4735					position = elem.css( "position" );
4736
4737				if ( position === "absolute" || position === "fixed" ) {
4738					return;
4739				}
4740				maxHeight -= elem.outerHeight( true );
4741			} );
4742
4743			this.headers.each( function() {
4744				maxHeight -= $( this ).outerHeight( true );
4745			} );
4746
4747			this.headers.next()
4748				.each( function() {
4749					$( this ).height( Math.max( 0, maxHeight -
4750						$( this ).innerHeight() + $( this ).height() ) );
4751				} )
4752				.css( "overflow", "auto" );
4753		} else if ( heightStyle === "auto" ) {
4754			maxHeight = 0;
4755			this.headers.next()
4756				.each( function() {
4757					var isVisible = $( this ).is( ":visible" );
4758					if ( !isVisible ) {
4759						$( this ).show();
4760					}
4761					maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() );
4762					if ( !isVisible ) {
4763						$( this ).hide();
4764					}
4765				} )
4766				.height( maxHeight );
4767		}
4768	},
4769
4770	_activate: function( index ) {
4771		var active = this._findActive( index )[ 0 ];
4772
4773		// Trying to activate the already active panel
4774		if ( active === this.active[ 0 ] ) {
4775			return;
4776		}
4777
4778		// Trying to collapse, simulate a click on the currently active header
4779		active = active || this.active[ 0 ];
4780
4781		this._eventHandler( {
4782			target: active,
4783			currentTarget: active,
4784			preventDefault: $.noop
4785		} );
4786	},
4787
4788	_findActive: function( selector ) {
4789		return typeof selector === "number" ? this.headers.eq( selector ) : $();
4790	},
4791
4792	_setupEvents: function( event ) {
4793		var events = {
4794			keydown: "_keydown"
4795		};
4796		if ( event ) {
4797			$.each( event.split( " " ), function( index, eventName ) {
4798				events[ eventName ] = "_eventHandler";
4799			} );
4800		}
4801
4802		this._off( this.headers.add( this.headers.next() ) );
4803		this._on( this.headers, events );
4804		this._on( this.headers.next(), { keydown: "_panelKeyDown" } );
4805		this._hoverable( this.headers );
4806		this._focusable( this.headers );
4807	},
4808
4809	_eventHandler: function( event ) {
4810		var activeChildren, clickedChildren,
4811			options = this.options,
4812			active = this.active,
4813			clicked = $( event.currentTarget ),
4814			clickedIsActive = clicked[ 0 ] === active[ 0 ],
4815			collapsing = clickedIsActive && options.collapsible,
4816			toShow = collapsing ? $() : clicked.next(),
4817			toHide = active.next(),
4818			eventData = {
4819				oldHeader: active,
4820				oldPanel: toHide,
4821				newHeader: collapsing ? $() : clicked,
4822				newPanel: toShow
4823			};
4824
4825		event.preventDefault();
4826
4827		if (
4828
4829				// click on active header, but not collapsible
4830				( clickedIsActive && !options.collapsible ) ||
4831
4832				// allow canceling activation
4833				( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
4834			return;
4835		}
4836
4837		options.active = collapsing ? false : this.headers.index( clicked );
4838
4839		// When the call to ._toggle() comes after the class changes
4840		// it causes a very odd bug in IE 8 (see #6720)
4841		this.active = clickedIsActive ? $() : clicked;
4842		this._toggle( eventData );
4843
4844		// Switch classes
4845		// corner classes on the previously active header stay after the animation
4846		this._removeClass( active, "ui-accordion-header-active", "ui-state-active" );
4847		if ( options.icons ) {
4848			activeChildren = active.children( ".ui-accordion-header-icon" );
4849			this._removeClass( activeChildren, null, options.icons.activeHeader )
4850				._addClass( activeChildren, null, options.icons.header );
4851		}
4852
4853		if ( !clickedIsActive ) {
4854			this._removeClass( clicked, "ui-accordion-header-collapsed" )
4855				._addClass( clicked, "ui-accordion-header-active", "ui-state-active" );
4856			if ( options.icons ) {
4857				clickedChildren = clicked.children( ".ui-accordion-header-icon" );
4858				this._removeClass( clickedChildren, null, options.icons.header )
4859					._addClass( clickedChildren, null, options.icons.activeHeader );
4860			}
4861
4862			this._addClass( clicked.next(), "ui-accordion-content-active" );
4863		}
4864	},
4865
4866	_toggle: function( data ) {
4867		var toShow = data.newPanel,
4868			toHide = this.prevShow.length ? this.prevShow : data.oldPanel;
4869
4870		// Handle activating a panel during the animation for another activation
4871		this.prevShow.add( this.prevHide ).stop( true, true );
4872		this.prevShow = toShow;
4873		this.prevHide = toHide;
4874
4875		if ( this.options.animate ) {
4876			this._animate( toShow, toHide, data );
4877		} else {
4878			toHide.hide();
4879			toShow.show();
4880			this._toggleComplete( data );
4881		}
4882
4883		toHide.attr( {
4884			"aria-hidden": "true"
4885		} );
4886		toHide.prev().attr( {
4887			"aria-selected": "false",
4888			"aria-expanded": "false"
4889		} );
4890
4891		// if we're switching panels, remove the old header from the tab order
4892		// if we're opening from collapsed state, remove the previous header from the tab order
4893		// if we're collapsing, then keep the collapsing header in the tab order
4894		if ( toShow.length && toHide.length ) {
4895			toHide.prev().attr( {
4896				"tabIndex": -1,
4897				"aria-expanded": "false"
4898			} );
4899		} else if ( toShow.length ) {
4900			this.headers.filter( function() {
4901				return parseInt( $( this ).attr( "tabIndex" ), 10 ) === 0;
4902			} )
4903				.attr( "tabIndex", -1 );
4904		}
4905
4906		toShow
4907			.attr( "aria-hidden", "false" )
4908			.prev()
4909				.attr( {
4910					"aria-selected": "true",
4911					"aria-expanded": "true",
4912					tabIndex: 0
4913				} );
4914	},
4915
4916	_animate: function( toShow, toHide, data ) {
4917		var total, easing, duration,
4918			that = this,
4919			adjust = 0,
4920			boxSizing = toShow.css( "box-sizing" ),
4921			down = toShow.length &&
4922				( !toHide.length || ( toShow.index() < toHide.index() ) ),
4923			animate = this.options.animate || {},
4924			options = down && animate.down || animate,
4925			complete = function() {
4926				that._toggleComplete( data );
4927			};
4928
4929		if ( typeof options === "number" ) {
4930			duration = options;
4931		}
4932		if ( typeof options === "string" ) {
4933			easing = options;
4934		}
4935
4936		// fall back from options to animation in case of partial down settings
4937		easing = easing || options.easing || animate.easing;
4938		duration = duration || options.duration || animate.duration;
4939
4940		if ( !toHide.length ) {
4941			return toShow.animate( this.showProps, duration, easing, complete );
4942		}
4943		if ( !toShow.length ) {
4944			return toHide.animate( this.hideProps, duration, easing, complete );
4945		}
4946
4947		total = toShow.show().outerHeight();
4948		toHide.animate( this.hideProps, {
4949			duration: duration,
4950			easing: easing,
4951			step: function( now, fx ) {
4952				fx.now = Math.round( now );
4953			}
4954		} );
4955		toShow
4956			.hide()
4957			.animate( this.showProps, {
4958				duration: duration,
4959				easing: easing,
4960				complete: complete,
4961				step: function( now, fx ) {
4962					fx.now = Math.round( now );
4963					if ( fx.prop !== "height" ) {
4964						if ( boxSizing === "content-box" ) {
4965							adjust += fx.now;
4966						}
4967					} else if ( that.options.heightStyle !== "content" ) {
4968						fx.now = Math.round( total - toHide.outerHeight() - adjust );
4969						adjust = 0;
4970					}
4971				}
4972			} );
4973	},
4974
4975	_toggleComplete: function( data ) {
4976		var toHide = data.oldPanel,
4977			prev = toHide.prev();
4978
4979		this._removeClass( toHide, "ui-accordion-content-active" );
4980		this._removeClass( prev, "ui-accordion-header-active" )
4981			._addClass( prev, "ui-accordion-header-collapsed" );
4982
4983		// Work around for rendering bug in IE (#5421)
4984		if ( toHide.length ) {
4985			toHide.parent()[ 0 ].className = toHide.parent()[ 0 ].className;
4986		}
4987		this._trigger( "activate", null, data );
4988	}
4989} );
4990
4991
4992
4993var safeActiveElement = $.ui.safeActiveElement = function( document ) {
4994	var activeElement;
4995
4996	// Support: IE 9 only
4997	// IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
4998	try {
4999		activeElement = document.activeElement;
5000	} catch ( error ) {
5001		activeElement = document.body;
5002	}
5003
5004	// Support: IE 9 - 11 only
5005	// IE may return null instead of an element
5006	// Interestingly, this only seems to occur when NOT in an iframe
5007	if ( !activeElement ) {
5008		activeElement = document.body;
5009	}
5010
5011	// Support: IE 11 only
5012	// IE11 returns a seemingly empty object in some cases when accessing
5013	// document.activeElement from an <iframe>
5014	if ( !activeElement.nodeName ) {
5015		activeElement = document.body;
5016	}
5017
5018	return activeElement;
5019};
5020
5021
5022/*!
5023 * jQuery UI Menu 1.13.
50232
5024 * http://jqueryui.com
5025 *
5026 * Copyright jQuery Foundation and other contributors
5027 * Released under the MIT license.
5028 * http://jquery.org/license
5029 */
5030
5031//>>label: Menu
5032//>>group: Widgets
5033//>>description: Creates nestable menus.
5034//>>docs: http://api.jqueryui.com/menu/
5035//>>demos: http://jqueryui.com/menu/
5036//>>css.structure: ../../themes/base/core.css
5037//>>css.structure: ../../themes/base/menu.css
5038//>>css.theme: ../../themes/base/theme.css
5039
5040
5041var widgetsMenu = $.widget( "ui.menu", {
5042	version: "1.13.2
vendor: 18,088 bytes, lines 5042-5714
5042",
5043	defaultElement: "<ul>",
5044	delay: 300,
5045	options: {
5046		icons: {
5047			submenu: "ui-icon-caret-1-e"
5048		},
5049		items: "> *",
5050		menus: "ul",
5051		position: {
5052			my: "left top",
5053			at: "right top"
5054		},
5055		role: "menu",
5056
5057		// Callbacks
5058		blur: null,
5059		focus: null,
5060		select: null
5061	},
5062
5063	_create: function() {
5064		this.activeMenu = this.element;
5065
5066		// Flag used to prevent firing of the click handler
5067		// as the event bubbles up through nested menus
5068		this.mouseHandled = false;
5069		this.lastMousePosition = { x: null, y: null };
5070		this.element
5071			.uniqueId()
5072			.attr( {
5073				role: this.options.role,
5074				tabIndex: 0
5075			} );
5076
5077		this._addClass( "ui-menu", "ui-widget ui-widget-content" );
5078		this._on( {
5079
5080			// Prevent focus from sticking to links inside menu after clicking
5081			// them (focus should always stay on UL during navigation).
5082			"mousedown .ui-menu-item": function( event ) {
5083				event.preventDefault();
5084
5085				this._activateItem( event );
5086			},
5087			"click .ui-menu-item": function( event ) {
5088				var target = $( event.target );
5089				var active = $( $.ui.safeActiveElement( this.document[ 0 ] ) );
5090				if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
5091					this.select( event );
5092
5093					// Only set the mouseHandled flag if the event will bubble, see #9469.
5094					if ( !event.isPropagationStopped() ) {
5095						this.mouseHandled = true;
5096					}
5097
5098					// Open submenu on click
5099					if ( target.has( ".ui-menu" ).length ) {
5100						this.expand( event );
5101					} else if ( !this.element.is( ":focus" ) &&
5102							active.closest( ".ui-menu" ).length ) {
5103
5104						// Redirect focus to the menu
5105						this.element.trigger( "focus", [ true ] );
5106
5107						// If the active item is on the top level, let it stay active.
5108						// Otherwise, blur the active item since it is no longer visible.
5109						if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) {
5110							clearTimeout( this.timer );
5111						}
5112					}
5113				}
5114			},
5115			"mouseenter .ui-menu-item": "_activateItem",
5116			"mousemove .ui-menu-item": "_activateItem",
5117			mouseleave: "collapseAll",
5118			"mouseleave .ui-menu": "collapseAll",
5119			focus: function( event, keepActiveItem ) {
5120
5121				// If there's already an active item, keep it active
5122				// If not, activate the first item
5123				var item = this.active || this._menuItems().first();
5124
5125				if ( !keepActiveItem ) {
5126					this.focus( event, item );
5127				}
5128			},
5129			blur: function( event ) {
5130				this._delay( function() {
5131					var notContained = !$.contains(
5132						this.element[ 0 ],
5133						$.ui.safeActiveElement( this.document[ 0 ] )
5134					);
5135					if ( notContained ) {
5136						this.collapseAll( event );
5137					}
5138				} );
5139			},
5140			keydown: "_keydown"
5141		} );
5142
5143		this.refresh();
5144
5145		// Clicks outside of a menu collapse any open menus
5146		this._on( this.document, {
5147			click: function( event ) {
5148				if ( this._closeOnDocumentClick( event ) ) {
5149					this.collapseAll( event, true );
5150				}
5151
5152				// Reset the mouseHandled flag
5153				this.mouseHandled = false;
5154			}
5155		} );
5156	},
5157
5158	_activateItem: function( event ) {
5159
5160		// Ignore mouse events while typeahead is active, see #10458.
5161		// Prevents focusing the wrong item when typeahead causes a scroll while the mouse
5162		// is over an item in the menu
5163		if ( this.previousFilter ) {
5164			return;
5165		}
5166
5167		// If the mouse didn't actually move, but the page was scrolled, ignore the event (#9356)
5168		if ( event.clientX === this.lastMousePosition.x &&
5169				event.clientY === this.lastMousePosition.y ) {
5170			return;
5171		}
5172
5173		this.lastMousePosition = {
5174			x: event.clientX,
5175			y: event.clientY
5176		};
5177
5178		var actualTarget = $( event.target ).closest( ".ui-menu-item" ),
5179			target = $( event.currentTarget );
5180
5181		// Ignore bubbled events on parent items, see #11641
5182		if ( actualTarget[ 0 ] !== target[ 0 ] ) {
5183			return;
5184		}
5185
5186		// If the item is already active, there's nothing to do
5187		if ( target.is( ".ui-state-active" ) ) {
5188			return;
5189		}
5190
5191		// Remove ui-state-active class from siblings of the newly focused menu item
5192		// to avoid a jump caused by adjacent elements both having a class with a border
5193		this._removeClass( target.siblings().children( ".ui-state-active" ),
5194			null, "ui-state-active" );
5195		this.focus( event, target );
5196	},
5197
5198	_destroy: function() {
5199		var items = this.element.find( ".ui-menu-item" )
5200				.removeAttr( "role aria-disabled" ),
5201			submenus = items.children( ".ui-menu-item-wrapper" )
5202				.removeUniqueId()
5203				.removeAttr( "tabIndex role aria-haspopup" );
5204
5205		// Destroy (sub)menus
5206		this.element
5207			.removeAttr( "aria-activedescendant" )
5208			.find( ".ui-menu" ).addBack()
5209				.removeAttr( "role aria-labelledby aria-expanded aria-hidden aria-disabled " +
5210					"tabIndex" )
5211				.removeUniqueId()
5212				.show();
5213
5214		submenus.children().each( function() {
5215			var elem = $( this );
5216			if ( elem.data( "ui-menu-submenu-caret" ) ) {
5217				elem.remove();
5218			}
5219		} );
5220	},
5221
5222	_keydown: function( event ) {
5223		var match, prev, character, skip,
5224			preventDefault = true;
5225
5226		switch ( event.keyCode ) {
5227		case $.ui.keyCode.PAGE_UP:
5228			this.previousPage( event );
5229			break;
5230		case $.ui.keyCode.PAGE_DOWN:
5231			this.nextPage( event );
5232			break;
5233		case $.ui.keyCode.HOME:
5234			this._move( "first", "first", event );
5235			break;
5236		case $.ui.keyCode.END:
5237			this._move( "last", "last", event );
5238			break;
5239		case $.ui.keyCode.UP:
5240			this.previous( event );
5241			break;
5242		case $.ui.keyCode.DOWN:
5243			this.next( event );
5244			break;
5245		case $.ui.keyCode.LEFT:
5246			this.collapse( event );
5247			break;
5248		case $.ui.keyCode.RIGHT:
5249			if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
5250				this.expand( event );
5251			}
5252			break;
5253		case $.ui.keyCode.ENTER:
5254		case $.ui.keyCode.SPACE:
5255			this._activate( event );
5256			break;
5257		case $.ui.keyCode.ESCAPE:
5258			this.collapse( event );
5259			break;
5260		default:
5261			preventDefault = false;
5262			prev = this.previousFilter || "";
5263			skip = false;
5264
5265			// Support number pad values
5266			character = event.keyCode >= 96 && event.keyCode <= 105 ?
5267				( event.keyCode - 96 ).toString() : String.fromCharCode( event.keyCode );
5268
5269			clearTimeout( this.filterTimer );
5270
5271			if ( character === prev ) {
5272				skip = true;
5273			} else {
5274				character = prev + character;
5275			}
5276
5277			match = this._filterMenuItems( character );
5278			match = skip && match.index( this.active.next() ) !== -1 ?
5279				this.active.nextAll( ".ui-menu-item" ) :
5280				match;
5281
5282			// If no matches on the current filter, reset to the last character pressed
5283			// to move down the menu to the first item that starts with that character
5284			if ( !match.length ) {
5285				character = String.fromCharCode( event.keyCode );
5286				match = this._filterMenuItems( character );
5287			}
5288
5289			if ( match.length ) {
5290				this.focus( event, match );
5291				this.previousFilter = character;
5292				this.filterTimer = this._delay( function() {
5293					delete this.previousFilter;
5294				}, 1000 );
5295			} else {
5296				delete this.previousFilter;
5297			}
5298		}
5299
5300		if ( preventDefault ) {
5301			event.preventDefault();
5302		}
5303	},
5304
5305	_activate: function( event ) {
5306		if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
5307			if ( this.active.children( "[aria-haspopup='true']" ).length ) {
5308				this.expand( event );
5309			} else {
5310				this.select( event );
5311			}
5312		}
5313	},
5314
5315	refresh: function() {
5316		var menus, items, newSubmenus, newItems, newWrappers,
5317			that = this,
5318			icon = this.options.icons.submenu,
5319			submenus = this.element.find( this.options.menus );
5320
5321		this._toggleClass( "ui-menu-icons", null, !!this.element.find( ".ui-icon" ).length );
5322
5323		// Initialize nested menus
5324		newSubmenus = submenus.filter( ":not(.ui-menu)" )
5325			.hide()
5326			.attr( {
5327				role: this.options.role,
5328				"aria-hidden": "true",
5329				"aria-expanded": "false"
5330			} )
5331			.each( function() {
5332				var menu = $( this ),
5333					item = menu.prev(),
5334					submenuCaret = $( "<span>" ).data( "ui-menu-submenu-caret", true );
5335
5336				that._addClass( submenuCaret, "ui-menu-icon", "ui-icon " + icon );
5337				item
5338					.attr( "aria-haspopup", "true" )
5339					.prepend( submenuCaret );
5340				menu.attr( "aria-labelledby", item.attr( "id" ) );
5341			} );
5342
5343		this._addClass( newSubmenus, "ui-menu", "ui-widget ui-widget-content ui-front" );
5344
5345		menus = submenus.add( this.element );
5346		items = menus.find( this.options.items );
5347
5348		// Initialize menu-items containing spaces and/or dashes only as dividers
5349		items.not( ".ui-menu-item" ).each( function() {
5350			var item = $( this );
5351			if ( that._isDivider( item ) ) {
5352				that._addClass( item, "ui-menu-divider", "ui-widget-content" );
5353			}
5354		} );
5355
5356		// Don't refresh list items that are already adapted
5357		newItems = items.not( ".ui-menu-item, .ui-menu-divider" );
5358		newWrappers = newItems.children()
5359			.not( ".ui-menu" )
5360				.uniqueId()
5361				.attr( {
5362					tabIndex: -1,
5363					role: this._itemRole()
5364				} );
5365		this._addClass( newItems, "ui-menu-item" )
5366			._addClass( newWrappers, "ui-menu-item-wrapper" );
5367
5368		// Add aria-disabled attribute to any disabled menu item
5369		items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
5370
5371		// If the active item has been removed, blur the menu
5372		if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
5373			this.blur();
5374		}
5375	},
5376
5377	_itemRole: function() {
5378		return {
5379			menu: "menuitem",
5380			listbox: "option"
5381		}[ this.options.role ];
5382	},
5383
5384	_setOption: function( key, value ) {
5385		if ( key === "icons" ) {
5386			var icons = this.element.find( ".ui-menu-icon" );
5387			this._removeClass( icons, null, this.options.icons.submenu )
5388				._addClass( icons, null, value.submenu );
5389		}
5390		this._super( key, value );
5391	},
5392
5393	_setOptionDisabled: function( value ) {
5394		this._super( value );
5395
5396		this.element.attr( "aria-disabled", String( value ) );
5397		this._toggleClass( null, "ui-state-disabled", !!value );
5398	},
5399
5400	focus: function( event, item ) {
5401		var nested, focused, activeParent;
5402		this.blur( event, event && event.type === "focus" );
5403
5404		this._scrollIntoView( item );
5405
5406		this.active = item.first();
5407
5408		focused = this.active.children( ".ui-menu-item-wrapper" );
5409		this._addClass( focused, null, "ui-state-active" );
5410
5411		// Only update aria-activedescendant if there's a role
5412		// otherwise we assume focus is managed elsewhere
5413		if ( this.options.role ) {
5414			this.element.attr( "aria-activedescendant", focused.attr( "id" ) );
5415		}
5416
5417		// Highlight active parent menu item, if any
5418		activeParent = this.active
5419			.parent()
5420				.closest( ".ui-menu-item" )
5421					.children( ".ui-menu-item-wrapper" );
5422		this._addClass( activeParent, null, "ui-state-active" );
5423
5424		if ( event && event.type === "keydown" ) {
5425			this._close();
5426		} else {
5427			this.timer = this._delay( function() {
5428				this._close();
5429			}, this.delay );
5430		}
5431
5432		nested = item.children( ".ui-menu" );
5433		if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {
5434			this._startOpening( nested );
5435		}
5436		this.activeMenu = item.parent();
5437
5438		this._trigger( "focus", event, { item: item } );
5439	},
5440
5441	_scrollIntoView: function( item ) {
5442		var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
5443		if ( this._hasScroll() ) {
5444			borderTop = parseFloat( $.css( this.activeMenu[ 0 ], "borderTopWidth" ) ) || 0;
5445			paddingTop = parseFloat( $.css( this.activeMenu[ 0 ], "paddingTop" ) ) || 0;
5446			offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
5447			scroll = this.activeMenu.scrollTop();
5448			elementHeight = this.activeMenu.height();
5449			itemHeight = item.outerHeight();
5450
5451			if ( offset < 0 ) {
5452				this.activeMenu.scrollTop( scroll + offset );
5453			} else if ( offset + itemHeight > elementHeight ) {
5454				this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );
5455			}
5456		}
5457	},
5458
5459	blur: function( event, fromFocus ) {
5460		if ( !fromFocus ) {
5461			clearTimeout( this.timer );
5462		}
5463
5464		if ( !this.active ) {
5465			return;
5466		}
5467
5468		this._removeClass( this.active.children( ".ui-menu-item-wrapper" ),
5469			null, "ui-state-active" );
5470
5471		this._trigger( "blur", event, { item: this.active } );
5472		this.active = null;
5473	},
5474
5475	_startOpening: function( submenu ) {
5476		clearTimeout( this.timer );
5477
5478		// Don't open if already open fixes a Firefox bug that caused a .5 pixel
5479		// shift in the submenu position when mousing over the caret icon
5480		if ( submenu.attr( "aria-hidden" ) !== "true" ) {
5481			return;
5482		}
5483
5484		this.timer = this._delay( function() {
5485			this._close();
5486			this._open( submenu );
5487		}, this.delay );
5488	},
5489
5490	_open: function( submenu ) {
5491		var position = $.extend( {
5492			of: this.active
5493		}, this.options.position );
5494
5495		clearTimeout( this.timer );
5496		this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )
5497			.hide()
5498			.attr( "aria-hidden", "true" );
5499
5500		submenu
5501			.show()
5502			.removeAttr( "aria-hidden" )
5503			.attr( "aria-expanded", "true" )
5504			.position( position );
5505	},
5506
5507	collapseAll: function( event, all ) {
5508		clearTimeout( this.timer );
5509		this.timer = this._delay( function() {
5510
5511			// If we were passed an event, look for the submenu that contains the event
5512			var currentMenu = all ? this.element :
5513				$( event && event.target ).closest( this.element.find( ".ui-menu" ) );
5514
5515			// If we found no valid submenu ancestor, use the main menu to close all
5516			// sub menus anyway
5517			if ( !currentMenu.length ) {
5518				currentMenu = this.element;
5519			}
5520
5521			this._close( currentMenu );
5522
5523			this.blur( event );
5524
5525			// Work around active item staying active after menu is blurred
5526			this._removeClass( currentMenu.find( ".ui-state-active" ), null, "ui-state-active" );
5527
5528			this.activeMenu = currentMenu;
5529		}, all ? 0 : this.delay );
5530	},
5531
5532	// With no arguments, closes the currently active menu - if nothing is active
5533	// it closes all menus.  If passed an argument, it will search for menus BELOW
5534	_close: function( startMenu ) {
5535		if ( !startMenu ) {
5536			startMenu = this.active ? this.active.parent() : this.element;
5537		}
5538
5539		startMenu.find( ".ui-menu" )
5540			.hide()
5541			.attr( "aria-hidden", "true" )
5542			.attr( "aria-expanded", "false" );
5543	},
5544
5545	_closeOnDocumentClick: function( event ) {
5546		return !$( event.target ).closest( ".ui-menu" ).length;
5547	},
5548
5549	_isDivider: function( item ) {
5550
5551		// Match hyphen, em dash, en dash
5552		return !/[^\-\u2014\u2013\s]/.test( item.text() );
5553	},
5554
5555	collapse: function( event ) {
5556		var newItem = this.active &&
5557			this.active.parent().closest( ".ui-menu-item", this.element );
5558		if ( newItem && newItem.length ) {
5559			this._close();
5560			this.focus( event, newItem );
5561		}
5562	},
5563
5564	expand: function( event ) {
5565		var newItem = this.active && this._menuItems( this.active.children( ".ui-menu" ) ).first();
5566
5567		if ( newItem && newItem.length ) {
5568			this._open( newItem.parent() );
5569
5570			// Delay so Firefox will not hide activedescendant change in expanding submenu from AT
5571			this._delay( function() {
5572				this.focus( event, newItem );
5573			} );
5574		}
5575	},
5576
5577	next: function( event ) {
5578		this._move( "next", "first", event );
5579	},
5580
5581	previous: function( event ) {
5582		this._move( "prev", "last", event );
5583	},
5584
5585	isFirstItem: function() {
5586		return this.active && !this.active.prevAll( ".ui-menu-item" ).length;
5587	},
5588
5589	isLastItem: function() {
5590		return this.active && !this.active.nextAll( ".ui-menu-item" ).length;
5591	},
5592
5593	_menuItems: function( menu ) {
5594		return ( menu || this.element )
5595			.find( this.options.items )
5596			.filter( ".ui-menu-item" );
5597	},
5598
5599	_move: function( direction, filter, event ) {
5600		var next;
5601		if ( this.active ) {
5602			if ( direction === "first" || direction === "last" ) {
5603				next = this.active
5604					[ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" )
5605					.last();
5606			} else {
5607				next = this.active
5608					[ direction + "All" ]( ".ui-menu-item" )
5609					.first();
5610			}
5611		}
5612		if ( !next || !next.length || !this.active ) {
5613			next = this._menuItems( this.activeMenu )[ filter ]();
5614		}
5615
5616		this.focus( event, next );
5617	},
5618
5619	nextPage: function( event ) {
5620		var item, base, height;
5621
5622		if ( !this.active ) {
5623			this.next( event );
5624			return;
5625		}
5626		if ( this.isLastItem() ) {
5627			return;
5628		}
5629		if ( this._hasScroll() ) {
5630			base = this.active.offset().top;
5631			height = this.element.innerHeight();
5632
5633			// jQuery 3.2 doesn't include scrollbars in innerHeight, add it back.
5634			if ( $.fn.jquery.indexOf( "3.2." ) === 0 ) {
5635				height += this.element[ 0 ].offsetHeight - this.element.outerHeight();
5636			}
5637
5638			this.active.nextAll( ".ui-menu-item" ).each( function() {
5639				item = $( this );
5640				return item.offset().top - base - height < 0;
5641			} );
5642
5643			this.focus( event, item );
5644		} else {
5645			this.focus( event, this._menuItems( this.activeMenu )
5646				[ !this.active ? "first" : "last" ]() );
5647		}
5648	},
5649
5650	previousPage: function( event ) {
5651		var item, base, height;
5652		if ( !this.active ) {
5653			this.next( event );
5654			return;
5655		}
5656		if ( this.isFirstItem() ) {
5657			return;
5658		}
5659		if ( this._hasScroll() ) {
5660			base = this.active.offset().top;
5661			height = this.element.innerHeight();
5662
5663			// jQuery 3.2 doesn't include scrollbars in innerHeight, add it back.
5664			if ( $.fn.jquery.indexOf( "3.2." ) === 0 ) {
5665				height += this.element[ 0 ].offsetHeight - this.element.outerHeight();
5666			}
5667
5668			this.active.prevAll( ".ui-menu-item" ).each( function() {
5669				item = $( this );
5670				return item.offset().top - base + height > 0;
5671			} );
5672
5673			this.focus( event, item );
5674		} else {
5675			this.focus( event, this._menuItems( this.activeMenu ).first() );
5676		}
5677	},
5678
5679	_hasScroll: function() {
5680		return this.element.outerHeight() < this.element.prop( "scrollHeight" );
5681	},
5682
5683	select: function( event ) {
5684
5685		// TODO: It should never be possible to not have an active item at this
5686		// point, but the tests don't trigger mouseenter before click.
5687		this.active = this.active || $( event.target ).closest( ".ui-menu-item" );
5688		var ui = { item: this.active };
5689		if ( !this.active.has( ".ui-menu" ).length ) {
5690			this.collapseAll( event, true );
5691		}
5692		this._trigger( "select", event, ui );
5693	},
5694
5695	_filterMenuItems: function( character ) {
5696		var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ),
5697			regex = new RegExp( "^" + escapedCharacter, "i" );
5698
5699		return this.activeMenu
5700			.find( this.options.items )
5701
5702				// Only match on items, not dividers or other content (#10571)
5703				.filter( ".ui-menu-item" )
5704					.filter( function() {
5705						return regex.test(
5706							String.prototype.trim.call(
5707								$( this ).children( ".ui-menu-item-wrapper" ).text() ) );
5708					} );
5709	}
5710} );
5711
5712
5713/*!
5714 * jQuery UI Autocomplete 1.13.
57142
5715 * http://jqueryui.com
5716 *
5717 * Copyright jQuery Foundation and other contributors
5718 * Released under the MIT license.
5719 * http://jquery.org/license
5720 */
5721
5722//>>label: Autocomplete
5723//>>group: Widgets
5724//>>description: Lists suggested words as the user is typing.
5725//>>docs: http://api.jqueryui.com/autocomplete/
5726//>>demos: http://jqueryui.com/autocomplete/
5727//>>css.structure: ../../themes/base/core.css
5728//>>css.structure: ../../themes/base/autocomplete.css
5729//>>css.theme: ../../themes/base/theme.css
5730
5731
5732$.widget( "ui.autocomplete", {
5733	version: "1.13.2
vendor: 16,621 bytes, lines 5733-6370
5733",
5734	defaultElement: "<input>",
5735	options: {
5736		appendTo: null,
5737		autoFocus: false,
5738		delay: 300,
5739		minLength: 1,
5740		position: {
5741			my: "left top",
5742			at: "left bottom",
5743			collision: "none"
5744		},
5745		source: null,
5746
5747		// Callbacks
5748		change: null,
5749		close: null,
5750		focus: null,
5751		open: null,
5752		response: null,
5753		search: null,
5754		select: null
5755	},
5756
5757	requestIndex: 0,
5758	pending: 0,
5759	liveRegionTimer: null,
5760
5761	_create: function() {
5762
5763		// Some browsers only repeat keydown events, not keypress events,
5764		// so we use the suppressKeyPress flag to determine if we've already
5765		// handled the keydown event. #7269
5766		// Unfortunately the code for & in keypress is the same as the up arrow,
5767		// so we use the suppressKeyPressRepeat flag to avoid handling keypress
5768		// events when we know the keydown event was used to modify the
5769		// search term. #7799
5770		var suppressKeyPress, suppressKeyPressRepeat, suppressInput,
5771			nodeName = this.element[ 0 ].nodeName.toLowerCase(),
5772			isTextarea = nodeName === "textarea",
5773			isInput = nodeName === "input";
5774
5775		// Textareas are always multi-line
5776		// Inputs are always single-line, even if inside a contentEditable element
5777		// IE also treats inputs as contentEditable
5778		// All other element types are determined by whether or not they're contentEditable
5779		this.isMultiLine = isTextarea || !isInput && this._isContentEditable( this.element );
5780
5781		this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
5782		this.isNewMenu = true;
5783
5784		this._addClass( "ui-autocomplete-input" );
5785		this.element.attr( "autocomplete", "off" );
5786
5787		this._on( this.element, {
5788			keydown: function( event ) {
5789				if ( this.element.prop( "readOnly" ) ) {
5790					suppressKeyPress = true;
5791					suppressInput = true;
5792					suppressKeyPressRepeat = true;
5793					return;
5794				}
5795
5796				suppressKeyPress = false;
5797				suppressInput = false;
5798				suppressKeyPressRepeat = false;
5799				var keyCode = $.ui.keyCode;
5800				switch ( event.keyCode ) {
5801				case keyCode.PAGE_UP:
5802					suppressKeyPress = true;
5803					this._move( "previousPage", event );
5804					break;
5805				case keyCode.PAGE_DOWN:
5806					suppressKeyPress = true;
5807					this._move( "nextPage", event );
5808					break;
5809				case keyCode.UP:
5810					suppressKeyPress = true;
5811					this._keyEvent( "previous", event );
5812					break;
5813				case keyCode.DOWN:
5814					suppressKeyPress = true;
5815					this._keyEvent( "next", event );
5816					break;
5817				case keyCode.ENTER:
5818
5819					// when menu is open and has focus
5820					if ( this.menu.active ) {
5821
5822						// #6055 - Opera still allows the keypress to occur
5823						// which causes forms to submit
5824						suppressKeyPress = true;
5825						event.preventDefault();
5826						this.menu.select( event );
5827					}
5828					break;
5829				case keyCode.TAB:
5830					if ( this.menu.active ) {
5831						this.menu.select( event );
5832					}
5833					break;
5834				case keyCode.ESCAPE:
5835					if ( this.menu.element.is( ":visible" ) ) {
5836						if ( !this.isMultiLine ) {
5837							this._value( this.term );
5838						}
5839						this.close( event );
5840
5841						// Different browsers have different default behavior for escape
5842						// Single press can mean undo or clear
5843						// Double press in IE means clear the whole form
5844						event.preventDefault();
5845					}
5846					break;
5847				default:
5848					suppressKeyPressRepeat = true;
5849
5850					// search timeout should be triggered before the input value is changed
5851					this._searchTimeout( event );
5852					break;
5853				}
5854			},
5855			keypress: function( event ) {
5856				if ( suppressKeyPress ) {
5857					suppressKeyPress = false;
5858					if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
5859						event.preventDefault();
5860					}
5861					return;
5862				}
5863				if ( suppressKeyPressRepeat ) {
5864					return;
5865				}
5866
5867				// Replicate some key handlers to allow them to repeat in Firefox and Opera
5868				var keyCode = $.ui.keyCode;
5869				switch ( event.keyCode ) {
5870				case keyCode.PAGE_UP:
5871					this._move( "previousPage", event );
5872					break;
5873				case keyCode.PAGE_DOWN:
5874					this._move( "nextPage", event );
5875					break;
5876				case keyCode.UP:
5877					this._keyEvent( "previous", event );
5878					break;
5879				case keyCode.DOWN:
5880					this._keyEvent( "next", event );
5881					break;
5882				}
5883			},
5884			input: function( event ) {
5885				if ( suppressInput ) {
5886					suppressInput = false;
5887					event.preventDefault();
5888					return;
5889				}
5890				this._searchTimeout( event );
5891			},
5892			focus: function() {
5893				this.selectedItem = null;
5894				this.previous = this._value();
5895			},
5896			blur: function( event ) {
5897				clearTimeout( this.searching );
5898				this.close( event );
5899				this._change( event );
5900			}
5901		} );
5902
5903		this._initSource();
5904		this.menu = $( "<ul>" )
5905			.appendTo( this._appendTo() )
5906			.menu( {
5907
5908				// disable ARIA support, the live region takes care of that
5909				role: null
5910			} )
5911			.hide()
5912
5913			// Support: IE 11 only, Edge <= 14
5914			// For other browsers, we preventDefault() on the mousedown event
5915			// to keep the dropdown from taking focus from the input. This doesn't
5916			// work for IE/Edge, causing problems with selection and scrolling (#9638)
5917			// Happily, IE and Edge support an "unselectable" attribute that
5918			// prevents an element from receiving focus, exactly what we want here.
5919			.attr( {
5920				"unselectable": "on"
5921			} )
5922			.menu( "instance" );
5923
5924		this._addClass( this.menu.element, "ui-autocomplete", "ui-front" );
5925		this._on( this.menu.element, {
5926			mousedown: function( event ) {
5927
5928				// Prevent moving focus out of the text field
5929				event.preventDefault();
5930			},
5931			menufocus: function( event, ui ) {
5932				var label, item;
5933
5934				// support: Firefox
5935				// Prevent accidental activation of menu items in Firefox (#7024 #9118)
5936				if ( this.isNewMenu ) {
5937					this.isNewMenu = false;
5938					if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {
5939						this.menu.blur();
5940
5941						this.document.one( "mousemove", function() {
5942							$( event.target ).trigger( event.originalEvent );
5943						} );
5944
5945						return;
5946					}
5947				}
5948
5949				item = ui.item.data( "ui-autocomplete-item" );
5950				if ( false !== this._trigger( "focus", event, { item: item } ) ) {
5951
5952					// use value to match what will end up in the input, if it was a key event
5953					if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {
5954						this._value( item.value );
5955					}
5956				}
5957
5958				// Announce the value in the liveRegion
5959				label = ui.item.attr( "aria-label" ) || item.value;
5960				if ( label && String.prototype.trim.call( label ).length ) {
5961					clearTimeout( this.liveRegionTimer );
5962					this.liveRegionTimer = this._delay( function() {
5963						this.liveRegion.html( $( "<div>" ).text( label ) );
5964					}, 100 );
5965				}
5966			},
5967			menuselect: function( event, ui ) {
5968				var item = ui.item.data( "ui-autocomplete-item" ),
5969					previous = this.previous;
5970
5971				// Only trigger when focus was lost (click on menu)
5972				if ( this.element[ 0 ] !== $.ui.safeActiveElement( this.document[ 0 ] ) ) {
5973					this.element.trigger( "focus" );
5974					this.previous = previous;
5975
5976					// #6109 - IE triggers two focus events and the second
5977					// is asynchronous, so we need to reset the previous
5978					// term synchronously and asynchronously :-(
5979					this._delay( function() {
5980						this.previous = previous;
5981						this.selectedItem = item;
5982					} );
5983				}
5984
5985				if ( false !== this._trigger( "select", event, { item: item } ) ) {
5986					this._value( item.value );
5987				}
5988
5989				// reset the term after the select event
5990				// this allows custom select handling to work properly
5991				this.term = this._value();
5992
5993				this.close( event );
5994				this.selectedItem = item;
5995			}
5996		} );
5997
5998		this.liveRegion = $( "<div>", {
5999			role: "status",
6000			"aria-live": "assertive",
6001			"aria-relevant": "additions"
6002		} )
6003			.appendTo( this.document[ 0 ].body );
6004
6005		this._addClass( this.liveRegion, null, "ui-helper-hidden-accessible" );
6006
6007		// Turning off autocomplete prevents the browser from remembering the
6008		// value when navigating through history, so we re-enable autocomplete
6009		// if the page is unloaded before the widget is destroyed. #7790
6010		this._on( this.window, {
6011			beforeunload: function() {
6012				this.element.removeAttr( "autocomplete" );
6013			}
6014		} );
6015	},
6016
6017	_destroy: function() {
6018		clearTimeout( this.searching );
6019		this.element.removeAttr( "autocomplete" );
6020		this.menu.element.remove();
6021		this.liveRegion.remove();
6022	},
6023
6024	_setOption: function( key, value ) {
6025		this._super( key, value );
6026		if ( key === "source" ) {
6027			this._initSource();
6028		}
6029		if ( key === "appendTo" ) {
6030			this.menu.element.appendTo( this._appendTo() );
6031		}
6032		if ( key === "disabled" && value && this.xhr ) {
6033			this.xhr.abort();
6034		}
6035	},
6036
6037	_isEventTargetInWidget: function( event ) {
6038		var menuElement = this.menu.element[ 0 ];
6039
6040		return event.target === this.element[ 0 ] ||
6041			event.target === menuElement ||
6042			$.contains( menuElement, event.target );
6043	},
6044
6045	_closeOnClickOutside: function( event ) {
6046		if ( !this._isEventTargetInWidget( event ) ) {
6047			this.close();
6048		}
6049	},
6050
6051	_appendTo: function() {
6052		var element = this.options.appendTo;
6053
6054		if ( element ) {
6055			element = element.jquery || element.nodeType ?
6056				$( element ) :
6057				this.document.find( element ).eq( 0 );
6058		}
6059
6060		if ( !element || !element[ 0 ] ) {
6061			element = this.element.closest( ".ui-front, dialog" );
6062		}
6063
6064		if ( !element.length ) {
6065			element = this.document[ 0 ].body;
6066		}
6067
6068		return element;
6069	},
6070
6071	_initSource: function() {
6072		var array, url,
6073			that = this;
6074		if ( Array.isArray( this.options.source ) ) {
6075			array = this.options.source;
6076			this.source = function( request, response ) {
6077				response( $.ui.autocomplete.filter( array, request.term ) );
6078			};
6079		} else if ( typeof this.options.source === "string" ) {
6080			url = this.options.source;
6081			this.source = function( request, response ) {
6082				if ( that.xhr ) {
6083					that.xhr.abort();
6084				}
6085				that.xhr = $.ajax( {
6086					url: url,
6087					data: request,
6088					dataType: "json",
6089					success: function( data ) {
6090						response( data );
6091					},
6092					error: function() {
6093						response( [] );
6094					}
6095				} );
6096			};
6097		} else {
6098			this.source = this.options.source;
6099		}
6100	},
6101
6102	_searchTimeout: function( event ) {
6103		clearTimeout( this.searching );
6104		this.searching = this._delay( function() {
6105
6106			// Search if the value has changed, or if the user retypes the same value (see #7434)
6107			var equalValues = this.term === this._value(),
6108				menuVisible = this.menu.element.is( ":visible" ),
6109				modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
6110
6111			if ( !equalValues || ( equalValues && !menuVisible && !modifierKey ) ) {
6112				this.selectedItem = null;
6113				this.search( null, event );
6114			}
6115		}, this.options.delay );
6116	},
6117
6118	search: function( value, event ) {
6119		value = value != null ? value : this._value();
6120
6121		// Always save the actual value, not the one passed as an argument
6122		this.term = this._value();
6123
6124		if ( value.length < this.options.minLength ) {
6125			return this.close( event );
6126		}
6127
6128		if ( this._trigger( "search", event ) === false ) {
6129			return;
6130		}
6131
6132		return this._search( value );
6133	},
6134
6135	_search: function( value ) {
6136		this.pending++;
6137		this._addClass( "ui-autocomplete-loading" );
6138		this.cancelSearch = false;
6139
6140		this.source( { term: value }, this._response() );
6141	},
6142
6143	_response: function() {
6144		var index = ++this.requestIndex;
6145
6146		return function( content ) {
6147			if ( index === this.requestIndex ) {
6148				this.__response( content );
6149			}
6150
6151			this.pending--;
6152			if ( !this.pending ) {
6153				this._removeClass( "ui-autocomplete-loading" );
6154			}
6155		}.bind( this );
6156	},
6157
6158	__response: function( content ) {
6159		if ( content ) {
6160			content = this._normalize( content );
6161		}
6162		this._trigger( "response", null, { content: content } );
6163		if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {
6164			this._suggest( content );
6165			this._trigger( "open" );
6166		} else {
6167
6168			// use ._close() instead of .close() so we don't cancel future searches
6169			this._close();
6170		}
6171	},
6172
6173	close: function( event ) {
6174		this.cancelSearch = true;
6175		this._close( event );
6176	},
6177
6178	_close: function( event ) {
6179
6180		// Remove the handler that closes the menu on outside clicks
6181		this._off( this.document, "mousedown" );
6182
6183		if ( this.menu.element.is( ":visible" ) ) {
6184			this.menu.element.hide();
6185			this.menu.blur();
6186			this.isNewMenu = true;
6187			this._trigger( "close", event );
6188		}
6189	},
6190
6191	_change: function( event ) {
6192		if ( this.previous !== this._value() ) {
6193			this._trigger( "change", event, { item: this.selectedItem } );
6194		}
6195	},
6196
6197	_normalize: function( items ) {
6198
6199		// assume all items have the right format when the first item is complete
6200		if ( items.length && items[ 0 ].label && items[ 0 ].value ) {
6201			return items;
6202		}
6203		return $.map( items, function( item ) {
6204			if ( typeof item === "string" ) {
6205				return {
6206					label: item,
6207					value: item
6208				};
6209			}
6210			return $.extend( {}, item, {
6211				label: item.label || item.value,
6212				value: item.value || item.label
6213			} );
6214		} );
6215	},
6216
6217	_suggest: function( items ) {
6218		var ul = this.menu.element.empty();
6219		this._renderMenu( ul, items );
6220		this.isNewMenu = true;
6221		this.menu.refresh();
6222
6223		// Size and position menu
6224		ul.show();
6225		this._resizeMenu();
6226		ul.position( $.extend( {
6227			of: this.element
6228		}, this.options.position ) );
6229
6230		if ( this.options.autoFocus ) {
6231			this.menu.next();
6232		}
6233
6234		// Listen for interactions outside of the widget (#6642)
6235		this._on( this.document, {
6236			mousedown: "_closeOnClickOutside"
6237		} );
6238	},
6239
6240	_resizeMenu: function() {
6241		var ul = this.menu.element;
6242		ul.outerWidth( Math.max(
6243
6244			// Firefox wraps long text (possibly a rounding bug)
6245			// so we add 1px to avoid the wrapping (#7513)
6246			ul.width( "" ).outerWidth() + 1,
6247			this.element.outerWidth()
6248		) );
6249	},
6250
6251	_renderMenu: function( ul, items ) {
6252		var that = this;
6253		$.each( items, function( index, item ) {
6254			that._renderItemData( ul, item );
6255		} );
6256	},
6257
6258	_renderItemData: function( ul, item ) {
6259		return this._renderItem( ul, item ).data( "ui-autocomplete-item", item );
6260	},
6261
6262	_renderItem: function( ul, item ) {
6263		return $( "<li>" )
6264			.append( $( "<div>" ).text( item.label ) )
6265			.appendTo( ul );
6266	},
6267
6268	_move: function( direction, event ) {
6269		if ( !this.menu.element.is( ":visible" ) ) {
6270			this.search( null, event );
6271			return;
6272		}
6273		if ( this.menu.isFirstItem() && /^previous/.test( direction ) ||
6274				this.menu.isLastItem() && /^next/.test( direction ) ) {
6275
6276			if ( !this.isMultiLine ) {
6277				this._value( this.term );
6278			}
6279
6280			this.menu.blur();
6281			return;
6282		}
6283		this.menu[ direction ]( event );
6284	},
6285
6286	widget: function() {
6287		return this.menu.element;
6288	},
6289
6290	_value: function() {
6291		return this.valueMethod.apply( this.element, arguments );
6292	},
6293
6294	_keyEvent: function( keyEvent, event ) {
6295		if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
6296			this._move( keyEvent, event );
6297
6298			// Prevents moving cursor to beginning/end of the text field in some browsers
6299			event.preventDefault();
6300		}
6301	},
6302
6303	// Support: Chrome <=50
6304	// We should be able to just use this.element.prop( "isContentEditable" )
6305	// but hidden elements always report false in Chrome.
6306	// https://code.google.com/p/chromium/issues/detail?id=313082
6307	_isContentEditable: function( element ) {
6308		if ( !element.length ) {
6309			return false;
6310		}
6311
6312		var editable = element.prop( "contentEditable" );
6313
6314		if ( editable === "inherit" ) {
6315			return this._isContentEditable( element.parent() );
6316		}
6317
6318		return editable === "true";
6319	}
6320} );
6321
6322$.extend( $.ui.autocomplete, {
6323	escapeRegex: function( value ) {
6324		return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
6325	},
6326	filter: function( array, term ) {
6327		var matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), "i" );
6328		return $.grep( array, function( value ) {
6329			return matcher.test( value.label || value.value || value );
6330		} );
6331	}
6332} );
6333
6334// Live region extension, adding a `messages` option
6335// NOTE: This is an experimental API. We are still investigating
6336// a full solution for string manipulation and internationalization.
6337$.widget( "ui.autocomplete", $.ui.autocomplete, {
6338	options: {
6339		messages: {
6340			noResults: "No search results.",
6341			results: function( amount ) {
6342				return amount + ( amount > 1 ? " results are" : " result is" ) +
6343					" available, use up and down arrow keys to navigate.";
6344			}
6345		}
6346	},
6347
6348	__response: function( content ) {
6349		var message;
6350		this._superApply( arguments );
6351		if ( this.options.disabled || this.cancelSearch ) {
6352			return;
6353		}
6354		if ( content && content.length ) {
6355			message = this.options.messages.results( content.length );
6356		} else {
6357			message = this.options.messages.noResults;
6358		}
6359		clearTimeout( this.liveRegionTimer );
6360		this.liveRegionTimer = this._delay( function() {
6361			this.liveRegion.html( $( "<div>" ).text( message ) );
6362		}, 100 );
6363	}
6364} );
6365
6366var widgetsAutocomplete = $.ui.autocomplete;
6367
6368
6369/*!
6370 * jQuery UI Controlgroup 1.13.
63702
6371 * http://jqueryui.com
6372 *
6373 * Copyright jQuery Foundation and other contributors
6374 * Released under the MIT license.
6375 * http://jquery.org/license
6376 */
6377
6378//>>label: Controlgroup
6379//>>group: Widgets
6380//>>description: Visually groups form control widgets
6381//>>docs: http://api.jqueryui.com/controlgroup/
6382//>>demos: http://jqueryui.com/controlgroup/
6383//>>css.structure: ../../themes/base/core.css
6384//>>css.structure: ../../themes/base/controlgroup.css
6385//>>css.theme: ../../themes/base/theme.css
6386
6387
6388var controlgroupCornerRegex = /ui-corner-([a-z]){2,6}/g;
6389
6390var widgetsControlgroup = $.widget( "ui.controlgroup", {
6391	version: "1.13.2
vendor: 7,736 bytes, lines 6391-6655
6391",
6392	defaultElement: "<div>",
6393	options: {
6394		direction: "horizontal",
6395		disabled: null,
6396		onlyVisible: true,
6397		items: {
6398			"button": "input[type=button], input[type=submit], input[type=reset], button, a",
6399			"controlgroupLabel": ".ui-controlgroup-label",
6400			"checkboxradio": "input[type='checkbox'], input[type='radio']",
6401			"selectmenu": "select",
6402			"spinner": ".ui-spinner-input"
6403		}
6404	},
6405
6406	_create: function() {
6407		this._enhance();
6408	},
6409
6410	// To support the enhanced option in jQuery Mobile, we isolate DOM manipulation
6411	_enhance: function() {
6412		this.element.attr( "role", "toolbar" );
6413		this.refresh();
6414	},
6415
6416	_destroy: function() {
6417		this._callChildMethod( "destroy" );
6418		this.childWidgets.removeData( "ui-controlgroup-data" );
6419		this.element.removeAttr( "role" );
6420		if ( this.options.items.controlgroupLabel ) {
6421			this.element
6422				.find( this.options.items.controlgroupLabel )
6423				.find( ".ui-controlgroup-label-contents" )
6424				.contents().unwrap();
6425		}
6426	},
6427
6428	_initWidgets: function() {
6429		var that = this,
6430			childWidgets = [];
6431
6432		// First we iterate over each of the items options
6433		$.each( this.options.items, function( widget, selector ) {
6434			var labels;
6435			var options = {};
6436
6437			// Make sure the widget has a selector set
6438			if ( !selector ) {
6439				return;
6440			}
6441
6442			if ( widget === "controlgroupLabel" ) {
6443				labels = that.element.find( selector );
6444				labels.each( function() {
6445					var element = $( this );
6446
6447					if ( element.children( ".ui-controlgroup-label-contents" ).length ) {
6448						return;
6449					}
6450					element.contents()
6451						.wrapAll( "<span class='ui-controlgroup-label-contents'></span>" );
6452				} );
6453				that._addClass( labels, null, "ui-widget ui-widget-content ui-state-default" );
6454				childWidgets = childWidgets.concat( labels.get() );
6455				return;
6456			}
6457
6458			// Make sure the widget actually exists
6459			if ( !$.fn[ widget ] ) {
6460				return;
6461			}
6462
6463			// We assume everything is in the middle to start because we can't determine
6464			// first / last elements until all enhancments are done.
6465			if ( that[ "_" + widget + "Options" ] ) {
6466				options = that[ "_" + widget + "Options" ]( "middle" );
6467			} else {
6468				options = { classes: {} };
6469			}
6470
6471			// Find instances of this widget inside controlgroup and init them
6472			that.element
6473				.find( selector )
6474				.each( function() {
6475					var element = $( this );
6476					var instance = element[ widget ]( "instance" );
6477
6478					// We need to clone the default options for this type of widget to avoid
6479					// polluting the variable options which has a wider scope than a single widget.
6480					var instanceOptions = $.widget.extend( {}, options );
6481
6482					// If the button is the child of a spinner ignore it
6483					// TODO: Find a more generic solution
6484					if ( widget === "button" && element.parent( ".ui-spinner" ).length ) {
6485						return;
6486					}
6487
6488					// Create the widget if it doesn't exist
6489					if ( !instance ) {
6490						instance = element[ widget ]()[ widget ]( "instance" );
6491					}
6492					if ( instance ) {
6493						instanceOptions.classes =
6494							that._resolveClassesValues( instanceOptions.classes, instance );
6495					}
6496					element[ widget ]( instanceOptions );
6497
6498					// Store an instance of the controlgroup to be able to reference
6499					// from the outermost element for changing options and refresh
6500					var widgetElement = element[ widget ]( "widget" );
6501					$.data( widgetElement[ 0 ], "ui-controlgroup-data",
6502						instance ? instance : element[ widget ]( "instance" ) );
6503
6504					childWidgets.push( widgetElement[ 0 ] );
6505				} );
6506		} );
6507
6508		this.childWidgets = $( $.uniqueSort( childWidgets ) );
6509		this._addClass( this.childWidgets, "ui-controlgroup-item" );
6510	},
6511
6512	_callChildMethod: function( method ) {
6513		this.childWidgets.each( function() {
6514			var element = $( this ),
6515				data = element.data( "ui-controlgroup-data" );
6516			if ( data && data[ method ] ) {
6517				data[ method ]();
6518			}
6519		} );
6520	},
6521
6522	_updateCornerClass: function( element, position ) {
6523		var remove = "ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all";
6524		var add = this._buildSimpleOptions( position, "label" ).classes.label;
6525
6526		this._removeClass( element, null, remove );
6527		this._addClass( element, null, add );
6528	},
6529
6530	_buildSimpleOptions: function( position, key ) {
6531		var direction = this.options.direction === "vertical";
6532		var result = {
6533			classes: {}
6534		};
6535		result.classes[ key ] = {
6536			"middle": "",
6537			"first": "ui-corner-" + ( direction ? "top" : "left" ),
6538			"last": "ui-corner-" + ( direction ? "bottom" : "right" ),
6539			"only": "ui-corner-all"
6540		}[ position ];
6541
6542		return result;
6543	},
6544
6545	_spinnerOptions: function( position ) {
6546		var options = this._buildSimpleOptions( position, "ui-spinner" );
6547
6548		options.classes[ "ui-spinner-up" ] = "";
6549		options.classes[ "ui-spinner-down" ] = "";
6550
6551		return options;
6552	},
6553
6554	_buttonOptions: function( position ) {
6555		return this._buildSimpleOptions( position, "ui-button" );
6556	},
6557
6558	_checkboxradioOptions: function( position ) {
6559		return this._buildSimpleOptions( position, "ui-checkboxradio-label" );
6560	},
6561
6562	_selectmenuOptions: function( position ) {
6563		var direction = this.options.direction === "vertical";
6564		return {
6565			width: direction ? "auto" : false,
6566			classes: {
6567				middle: {
6568					"ui-selectmenu-button-open": "",
6569					"ui-selectmenu-button-closed": ""
6570				},
6571				first: {
6572					"ui-selectmenu-button-open": "ui-corner-" + ( direction ? "top" : "tl" ),
6573					"ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "top" : "left" )
6574				},
6575				last: {
6576					"ui-selectmenu-button-open": direction ? "" : "ui-corner-tr",
6577					"ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "bottom" : "right" )
6578				},
6579				only: {
6580					"ui-selectmenu-button-open": "ui-corner-top",
6581					"ui-selectmenu-button-closed": "ui-corner-all"
6582				}
6583
6584			}[ position ]
6585		};
6586	},
6587
6588	_resolveClassesValues: function( classes, instance ) {
6589		var result = {};
6590		$.each( classes, function( key ) {
6591			var current = instance.options.classes[ key ] || "";
6592			current = String.prototype.trim.call( current.replace( controlgroupCornerRegex, "" ) );
6593			result[ key ] = ( current + " " + classes[ key ] ).replace( /\s+/g, " " );
6594		} );
6595		return result;
6596	},
6597
6598	_setOption: function( key, value ) {
6599		if ( key === "direction" ) {
6600			this._removeClass( "ui-controlgroup-" + this.options.direction );
6601		}
6602
6603		this._super( key, value );
6604		if ( key === "disabled" ) {
6605			this._callChildMethod( value ? "disable" : "enable" );
6606			return;
6607		}
6608
6609		this.refresh();
6610	},
6611
6612	refresh: function() {
6613		var children,
6614			that = this;
6615
6616		this._addClass( "ui-controlgroup ui-controlgroup-" + this.options.direction );
6617
6618		if ( this.options.direction === "horizontal" ) {
6619			this._addClass( null, "ui-helper-clearfix" );
6620		}
6621		this._initWidgets();
6622
6623		children = this.childWidgets;
6624
6625		// We filter here because we need to track all childWidgets not just the visible ones
6626		if ( this.options.onlyVisible ) {
6627			children = children.filter( ":visible" );
6628		}
6629
6630		if ( children.length ) {
6631
6632			// We do this last because we need to make sure all enhancment is done
6633			// before determining first and last
6634			$.each( [ "first", "last" ], function( index, value ) {
6635				var instance = children[ value ]().data( "ui-controlgroup-data" );
6636
6637				if ( instance && that[ "_" + instance.widgetName + "Options" ] ) {
6638					var options = that[ "_" + instance.widgetName + "Options" ](
6639						children.length === 1 ? "only" : value
6640					);
6641					options.classes = that._resolveClassesValues( options.classes, instance );
6642					instance.element[ instance.widgetName ]( options );
6643				} else {
6644					that._updateCornerClass( children[ value ](), value );
6645				}
6646			} );
6647
6648			// Finally call the refresh method on each of the child widgets.
6649			this._callChildMethod( "refresh" );
6650		}
6651	}
6652} );
6653
6654/*!
6655 * jQuery UI Checkboxradio 1.13.
vendor: 5,067 bytes, lines 6655-6838
66552
6656 * http://jqueryui.com
6657 *
6658 * Copyright jQuery Foundation and other contributors
6659 * Released under the MIT license.
6660 * http://jquery.org/license
6661 */
6662
6663//>>label: Checkboxradio
6664//>>group: Widgets
6665//>>description: Enhances a form with multiple themeable checkboxes or radio buttons.
6666//>>docs: http://api.jqueryui.com/checkboxradio/
6667//>>demos: http://jqueryui.com/checkboxradio/
6668//>>css.structure: ../../themes/base/core.css
6669//>>css.structure: ../../themes/base/button.css
6670//>>css.structure: ../../themes/base/checkboxradio.css
6671//>>css.theme: ../../themes/base/theme.css
6672
6673
6674$.widget( "ui.checkboxradio", [ $.ui.formResetMixin, {
6675	version: "1.13.2",
6676	options: {
6677		disabled: null,
6678		label: null,
6679		icon: true,
6680		classes: {
6681			"ui-checkboxradio-label": "ui-corner-all",
6682			"ui-checkboxradio-icon": "ui-corner-all"
6683		}
6684	},
6685
6686	_getCreateOptions: function() {
6687		var disabled, labels, labelContents;
6688		var options = this._super() || {};
6689
6690		// We read the type here, because it makes more sense to throw a element type error first,
6691		// rather then the error for lack of a label. Often if its the wrong type, it
6692		// won't have a label (e.g. calling on a div, btn, etc)
6693		this._readType();
6694
6695		labels = this.element.labels();
6696
6697		// If there are multiple labels, use the last one
6698		this.label = $( labels[ labels.length - 1 ] );
6699		if ( !this.label.length ) {
6700			$.error( "No label found for checkboxradio widget" );
6701		}
6702
6703		this.originalLabel = "";
6704
6705		// We need to get the label text but this may also need to make sure it does not contain the
6706		// input itself.
6707		// The label contents could be text, html, or a mix. We wrap all elements
6708		// and read the wrapper's `innerHTML` to get a string representation of
6709		// the label, without the input as part of it.
6710		labelContents = this.label.contents().not( this.element[ 0 ] );
6711
6712		if ( labelContents.length ) {
6713			this.originalLabel += labelContents
6714				.clone()
6715				.wrapAll( "<div></div>" )
6716				.parent()
6717				.html();
6718		}
6719
6720		// Set the label option if we found label text
6721		if ( this.originalLabel ) {
6722			options.label = this.originalLabel;
6723		}
6724
6725		disabled = this.element[ 0 ].disabled;
6726		if ( disabled != null ) {
6727			options.disabled = disabled;
6728		}
6729		return options;
6730	},
6731
6732	_create: function() {
6733		var checked = this.element[ 0 ].checked;
6734
6735		this._bindFormResetHandler();
6736
6737		if ( this.options.disabled == null ) {
6738			this.options.disabled = this.element[ 0 ].disabled;
6739		}
6740
6741		this._setOption( "disabled", this.options.disabled );
6742		this._addClass( "ui-checkboxradio", "ui-helper-hidden-accessible" );
6743		this._addClass( this.label, "ui-checkboxradio-label", "ui-button ui-widget" );
6744
6745		if ( this.type === "radio" ) {
6746			this._addClass( this.label, "ui-checkboxradio-radio-label" );
6747		}
6748
6749		if ( this.options.label && this.options.label !== this.originalLabel ) {
6750			this._updateLabel();
6751		} else if ( this.originalLabel ) {
6752			this.options.label = this.originalLabel;
6753		}
6754
6755		this._enhance();
6756
6757		if ( checked ) {
6758			this._addClass( this.label, "ui-checkboxradio-checked", "ui-state-active" );
6759		}
6760
6761		this._on( {
6762			change: "_toggleClasses",
6763			focus: function() {
6764				this._addClass( this.label, null, "ui-state-focus ui-visual-focus" );
6765			},
6766			blur: function() {
6767				this._removeClass( this.label, null, "ui-state-focus ui-visual-focus" );
6768			}
6769		} );
6770	},
6771
6772	_readType: function() {
6773		var nodeName = this.element[ 0 ].nodeName.toLowerCase();
6774		this.type = this.element[ 0 ].type;
6775		if ( nodeName !== "input" || !/radio|checkbox/.test( this.type ) ) {
6776			$.error( "Can't create checkboxradio on element.nodeName=" + nodeName +
6777				" and element.type=" + this.type );
6778		}
6779	},
6780
6781	// Support jQuery Mobile enhanced option
6782	_enhance: function() {
6783		this._updateIcon( this.element[ 0 ].checked );
6784	},
6785
6786	widget: function() {
6787		return this.label;
6788	},
6789
6790	_getRadioGroup: function() {
6791		var group;
6792		var name = this.element[ 0 ].name;
6793		var nameSelector = "input[name='" + $.escapeSelector( name ) + "']";
6794
6795		if ( !name ) {
6796			return $( [] );
6797		}
6798
6799		if ( this.form.length ) {
6800			group = $( this.form[ 0 ].elements ).filter( nameSelector );
6801		} else {
6802
6803			// Not inside a form, check all inputs that also are not inside a form
6804			group = $( nameSelector ).filter( function() {
6805				return $( this )._form().length === 0;
6806			} );
6807		}
6808
6809		return group.not( this.element );
6810	},
6811
6812	_toggleClasses: function() {
6813		var checked = this.element[ 0 ].checked;
6814		this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked );
6815
6816		if ( this.options.icon && this.type === "checkbox" ) {
6817			this._toggleClass( this.icon, null, "ui-icon-check ui-state-checked", checked )
6818				._toggleClass( this.icon, null, "ui-icon-blank", !checked );
6819		}
6820
6821		if ( this.type === "radio" ) {
6822			this._getRadioGroup()
6823				.each( function() {
6824					var instance = $( this ).checkboxradio( "instance" );
6825
6826					if ( instance ) {
6827						instance._removeClass( instance.label,
6828							"ui-checkboxradio-checked", "ui-state-active" );
6829					}
6830				} );
6831		}
6832	},
6833
6834	_destroy: function() {
6835		this._unbindFormResetHandler();
6836
6837		if ( this.icon ) {
6838			this.icon.remove();
vendor: 2,708 bytes, lines 6839-6945
6839			this.iconSpace.remove();
6840		}
6841	},
6842
6843	_setOption: function( key, value ) {
6844
6845		// We don't allow the value to be set to nothing
6846		if ( key === "label" && !value ) {
6847			return;
6848		}
6849
6850		this._super( key, value );
6851
6852		if ( key === "disabled" ) {
6853			this._toggleClass( this.label, null, "ui-state-disabled", value );
6854			this.element[ 0 ].disabled = value;
6855
6856			// Don't refresh when setting disabled
6857			return;
6858		}
6859		this.refresh();
6860	},
6861
6862	_updateIcon: function( checked ) {
6863		var toAdd = "ui-icon ui-icon-background ";
6864
6865		if ( this.options.icon ) {
6866			if ( !this.icon ) {
6867				this.icon = $( "<span>" );
6868				this.iconSpace = $( "<span> </span>" );
6869				this._addClass( this.iconSpace, "ui-checkboxradio-icon-space" );
6870			}
6871
6872			if ( this.type === "checkbox" ) {
6873				toAdd += checked ? "ui-icon-check ui-state-checked" : "ui-icon-blank";
6874				this._removeClass( this.icon, null, checked ? "ui-icon-blank" : "ui-icon-check" );
6875			} else {
6876				toAdd += "ui-icon-blank";
6877			}
6878			this._addClass( this.icon, "ui-checkboxradio-icon", toAdd );
6879			if ( !checked ) {
6880				this._removeClass( this.icon, null, "ui-icon-check ui-state-checked" );
6881			}
6882			this.icon.prependTo( this.label ).after( this.iconSpace );
6883		} else if ( this.icon !== undefined ) {
6884			this.icon.remove();
6885			this.iconSpace.remove();
6886			delete this.icon;
6887		}
6888	},
6889
6890	_updateLabel: function() {
6891
6892		// Remove the contents of the label ( minus the icon, icon space, and input )
6893		var contents = this.label.contents().not( this.element[ 0 ] );
6894		if ( this.icon ) {
6895			contents = contents.not( this.icon[ 0 ] );
6896		}
6897		if ( this.iconSpace ) {
6898			contents = contents.not( this.iconSpace[ 0 ] );
6899		}
6900		contents.remove();
6901
6902		this.label.append( this.options.label );
6903	},
6904
6905	refresh: function() {
6906		var checked = this.element[ 0 ].checked,
6907			isDisabled = this.element[ 0 ].disabled;
6908
6909		this._updateIcon( checked );
6910		this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked );
6911		if ( this.options.label !== null ) {
6912			this._updateLabel();
6913		}
6914
6915		if ( isDisabled !== this.options.disabled ) {
6916			this._setOptions( { "disabled": isDisabled } );
6917		}
6918	}
6919
6920} ] );
6921
6922var widgetsCheckboxradio = $.ui.checkboxradio;
6923
6924
6925/*!
6926 * jQuery UI Button 1.13.2
6927 * http://jqueryui.com
6928 *
6929 * Copyright jQuery Foundation and other contributors
6930 * Released under the MIT license.
6931 * http://jquery.org/license
6932 */
6933
6934//>>label: Button
6935//>>group: Widgets
6936//>>description: Enhances a form with themeable buttons.
6937//>>docs: http://api.jqueryui.com/button/
6938//>>demos: http://jqueryui.com/button/
6939//>>css.structure: ../../themes/base/core.css
6940//>>css.structure: ../../themes/base/button.css
6941//>>css.theme: ../../themes/base/theme.css
6942
6943
6944$.widget( "ui.button", {
6945	version: "1.13.2
vendor: 10,836 bytes, lines 6945-7352
6945",
6946	defaultElement: "<button>",
6947	options: {
6948		classes: {
6949			"ui-button": "ui-corner-all"
6950		},
6951		disabled: null,
6952		icon: null,
6953		iconPosition: "beginning",
6954		label: null,
6955		showLabel: true
6956	},
6957
6958	_getCreateOptions: function() {
6959		var disabled,
6960
6961			// This is to support cases like in jQuery Mobile where the base widget does have
6962			// an implementation of _getCreateOptions
6963			options = this._super() || {};
6964
6965		this.isInput = this.element.is( "input" );
6966
6967		disabled = this.element[ 0 ].disabled;
6968		if ( disabled != null ) {
6969			options.disabled = disabled;
6970		}
6971
6972		this.originalLabel = this.isInput ? this.element.val() : this.element.html();
6973		if ( this.originalLabel ) {
6974			options.label = this.originalLabel;
6975		}
6976
6977		return options;
6978	},
6979
6980	_create: function() {
6981		if ( !this.option.showLabel & !this.options.icon ) {
6982			this.options.showLabel = true;
6983		}
6984
6985		// We have to check the option again here even though we did in _getCreateOptions,
6986		// because null may have been passed on init which would override what was set in
6987		// _getCreateOptions
6988		if ( this.options.disabled == null ) {
6989			this.options.disabled = this.element[ 0 ].disabled || false;
6990		}
6991
6992		this.hasTitle = !!this.element.attr( "title" );
6993
6994		// Check to see if the label needs to be set or if its already correct
6995		if ( this.options.label && this.options.label !== this.originalLabel ) {
6996			if ( this.isInput ) {
6997				this.element.val( this.options.label );
6998			} else {
6999				this.element.html( this.options.label );
7000			}
7001		}
7002		this._addClass( "ui-button", "ui-widget" );
7003		this._setOption( "disabled", this.options.disabled );
7004		this._enhance();
7005
7006		if ( this.element.is( "a" ) ) {
7007			this._on( {
7008				"keyup": function( event ) {
7009					if ( event.keyCode === $.ui.keyCode.SPACE ) {
7010						event.preventDefault();
7011
7012						// Support: PhantomJS <= 1.9, IE 8 Only
7013						// If a native click is available use it so we actually cause navigation
7014						// otherwise just trigger a click event
7015						if ( this.element[ 0 ].click ) {
7016							this.element[ 0 ].click();
7017						} else {
7018							this.element.trigger( "click" );
7019						}
7020					}
7021				}
7022			} );
7023		}
7024	},
7025
7026	_enhance: function() {
7027		if ( !this.element.is( "button" ) ) {
7028			this.element.attr( "role", "button" );
7029		}
7030
7031		if ( this.options.icon ) {
7032			this._updateIcon( "icon", this.options.icon );
7033			this._updateTooltip();
7034		}
7035	},
7036
7037	_updateTooltip: function() {
7038		this.title = this.element.attr( "title" );
7039
7040		if ( !this.options.showLabel && !this.title ) {
7041			this.element.attr( "title", this.options.label );
7042		}
7043	},
7044
7045	_updateIcon: function( option, value ) {
7046		var icon = option !== "iconPosition",
7047			position = icon ? this.options.iconPosition : value,
7048			displayBlock = position === "top" || position === "bottom";
7049
7050		// Create icon
7051		if ( !this.icon ) {
7052			this.icon = $( "<span>" );
7053
7054			this._addClass( this.icon, "ui-button-icon", "ui-icon" );
7055
7056			if ( !this.options.showLabel ) {
7057				this._addClass( "ui-button-icon-only" );
7058			}
7059		} else if ( icon ) {
7060
7061			// If we are updating the icon remove the old icon class
7062			this._removeClass( this.icon, null, this.options.icon );
7063		}
7064
7065		// If we are updating the icon add the new icon class
7066		if ( icon ) {
7067			this._addClass( this.icon, null, value );
7068		}
7069
7070		this._attachIcon( position );
7071
7072		// If the icon is on top or bottom we need to add the ui-widget-icon-block class and remove
7073		// the iconSpace if there is one.
7074		if ( displayBlock ) {
7075			this._addClass( this.icon, null, "ui-widget-icon-block" );
7076			if ( this.iconSpace ) {
7077				this.iconSpace.remove();
7078			}
7079		} else {
7080
7081			// Position is beginning or end so remove the ui-widget-icon-block class and add the
7082			// space if it does not exist
7083			if ( !this.iconSpace ) {
7084				this.iconSpace = $( "<span> </span>" );
7085				this._addClass( this.iconSpace, "ui-button-icon-space" );
7086			}
7087			this._removeClass( this.icon, null, "ui-wiget-icon-block" );
7088			this._attachIconSpace( position );
7089		}
7090	},
7091
7092	_destroy: function() {
7093		this.element.removeAttr( "role" );
7094
7095		if ( this.icon ) {
7096			this.icon.remove();
7097		}
7098		if ( this.iconSpace ) {
7099			this.iconSpace.remove();
7100		}
7101		if ( !this.hasTitle ) {
7102			this.element.removeAttr( "title" );
7103		}
7104	},
7105
7106	_attachIconSpace: function( iconPosition ) {
7107		this.icon[ /^(?:end|bottom)/.test( iconPosition ) ? "before" : "after" ]( this.iconSpace );
7108	},
7109
7110	_attachIcon: function( iconPosition ) {
7111		this.element[ /^(?:end|bottom)/.test( iconPosition ) ? "append" : "prepend" ]( this.icon );
7112	},
7113
7114	_setOptions: function( options ) {
7115		var newShowLabel = options.showLabel === undefined ?
7116				this.options.showLabel :
7117				options.showLabel,
7118			newIcon = options.icon === undefined ? this.options.icon : options.icon;
7119
7120		if ( !newShowLabel && !newIcon ) {
7121			options.showLabel = true;
7122		}
7123		this._super( options );
7124	},
7125
7126	_setOption: function( key, value ) {
7127		if ( key === "icon" ) {
7128			if ( value ) {
7129				this._updateIcon( key, value );
7130			} else if ( this.icon ) {
7131				this.icon.remove();
7132				if ( this.iconSpace ) {
7133					this.iconSpace.remove();
7134				}
7135			}
7136		}
7137
7138		if ( key === "iconPosition" ) {
7139			this._updateIcon( key, value );
7140		}
7141
7142		// Make sure we can't end up with a button that has neither text nor icon
7143		if ( key === "showLabel" ) {
7144				this._toggleClass( "ui-button-icon-only", null, !value );
7145				this._updateTooltip();
7146		}
7147
7148		if ( key === "label" ) {
7149			if ( this.isInput ) {
7150				this.element.val( value );
7151			} else {
7152
7153				// If there is an icon, append it, else nothing then append the value
7154				// this avoids removal of the icon when setting label text
7155				this.element.html( value );
7156				if ( this.icon ) {
7157					this._attachIcon( this.options.iconPosition );
7158					this._attachIconSpace( this.options.iconPosition );
7159				}
7160			}
7161		}
7162
7163		this._super( key, value );
7164
7165		if ( key === "disabled" ) {
7166			this._toggleClass( null, "ui-state-disabled", value );
7167			this.element[ 0 ].disabled = value;
7168			if ( value ) {
7169				this.element.trigger( "blur" );
7170			}
7171		}
7172	},
7173
7174	refresh: function() {
7175
7176		// Make sure to only check disabled if its an element that supports this otherwise
7177		// check for the disabled class to determine state
7178		var isDisabled = this.element.is( "input, button" ) ?
7179			this.element[ 0 ].disabled : this.element.hasClass( "ui-button-disabled" );
7180
7181		if ( isDisabled !== this.options.disabled ) {
7182			this._setOptions( { disabled: isDisabled } );
7183		}
7184
7185		this._updateTooltip();
7186	}
7187} );
7188
7189// DEPRECATED
7190if ( $.uiBackCompat !== false ) {
7191
7192	// Text and Icons options
7193	$.widget( "ui.button", $.ui.button, {
7194		options: {
7195			text: true,
7196			icons: {
7197				primary: null,
7198				secondary: null
7199			}
7200		},
7201
7202		_create: function() {
7203			if ( this.options.showLabel && !this.options.text ) {
7204				this.options.showLabel = this.options.text;
7205			}
7206			if ( !this.options.showLabel && this.options.text ) {
7207				this.options.text = this.options.showLabel;
7208			}
7209			if ( !this.options.icon && ( this.options.icons.primary ||
7210					this.options.icons.secondary ) ) {
7211				if ( this.options.icons.primary ) {
7212					this.options.icon = this.options.icons.primary;
7213				} else {
7214					this.options.icon = this.options.icons.secondary;
7215					this.options.iconPosition = "end";
7216				}
7217			} else if ( this.options.icon ) {
7218				this.options.icons.primary = this.options.icon;
7219			}
7220			this._super();
7221		},
7222
7223		_setOption: function( key, value ) {
7224			if ( key === "text" ) {
7225				this._super( "showLabel", value );
7226				return;
7227			}
7228			if ( key === "showLabel" ) {
7229				this.options.text = value;
7230			}
7231			if ( key === "icon" ) {
7232				this.options.icons.primary = value;
7233			}
7234			if ( key === "icons" ) {
7235				if ( value.primary ) {
7236					this._super( "icon", value.primary );
7237					this._super( "iconPosition", "beginning" );
7238				} else if ( value.secondary ) {
7239					this._super( "icon", value.secondary );
7240					this._super( "iconPosition", "end" );
7241				}
7242			}
7243			this._superApply( arguments );
7244		}
7245	} );
7246
7247	$.fn.button = ( function( orig ) {
7248		return function( options ) {
7249			var isMethodCall = typeof options === "string";
7250			var args = Array.prototype.slice.call( arguments, 1 );
7251			var returnValue = this;
7252
7253			if ( isMethodCall ) {
7254
7255				// If this is an empty collection, we need to have the instance method
7256				// return undefined instead of the jQuery instance
7257				if ( !this.length && options === "instance" ) {
7258					returnValue = undefined;
7259				} else {
7260					this.each( function() {
7261						var methodValue;
7262						var type = $( this ).attr( "type" );
7263						var name = type !== "checkbox" && type !== "radio" ?
7264							"button" :
7265							"checkboxradio";
7266						var instance = $.data( this, "ui-" + name );
7267
7268						if ( options === "instance" ) {
7269							returnValue = instance;
7270							return false;
7271						}
7272
7273						if ( !instance ) {
7274							return $.error( "cannot call methods on button" +
7275								" prior to initialization; " +
7276								"attempted to call method '" + options + "'" );
7277						}
7278
7279						if ( typeof instance[ options ] !== "function" ||
7280							options.charAt( 0 ) === "_" ) {
7281							return $.error( "no such method '" + options + "' for button" +
7282								" widget instance" );
7283						}
7284
7285						methodValue = instance[ options ].apply( instance, args );
7286
7287						if ( methodValue !== instance && methodValue !== undefined ) {
7288							returnValue = methodValue && methodValue.jquery ?
7289								returnValue.pushStack( methodValue.get() ) :
7290								methodValue;
7291							return false;
7292						}
7293					} );
7294				}
7295			} else {
7296
7297				// Allow multiple hashes to be passed on init
7298				if ( args.length ) {
7299					options = $.widget.extend.apply( null, [ options ].concat( args ) );
7300				}
7301
7302				this.each( function() {
7303					var type = $( this ).attr( "type" );
7304					var name = type !== "checkbox" && type !== "radio" ? "button" : "checkboxradio";
7305					var instance = $.data( this, "ui-" + name );
7306
7307					if ( instance ) {
7308						instance.option( options || {} );
7309						if ( instance._init ) {
7310							instance._init();
7311						}
7312					} else {
7313						if ( name === "button" ) {
7314							orig.call( $( this ), options );
7315							return;
7316						}
7317
7318						$( this ).checkboxradio( $.extend( { icon: false }, options ) );
7319					}
7320				} );
7321			}
7322
7323			return returnValue;
7324		};
7325	} )( $.fn.button );
7326
7327	$.fn.buttonset = function() {
7328		if ( !$.ui.controlgroup ) {
7329			$.error( "Controlgroup widget missing" );
7330		}
7331		if ( arguments[ 0 ] === "option" && arguments[ 1 ] === "items" && arguments[ 2 ] ) {
7332			return this.controlgroup.apply( this,
7333				[ arguments[ 0 ], "items.button", arguments[ 2 ] ] );
7334		}
7335		if ( arguments[ 0 ] === "option" && arguments[ 1 ] === "items" ) {
7336			return this.controlgroup.apply( this, [ arguments[ 0 ], "items.button" ] );
7337		}
7338		if ( typeof arguments[ 0 ] === "object" && arguments[ 0 ].items ) {
7339			arguments[ 0 ].items = {
7340				button: arguments[ 0 ].items
7341			};
7342		}
7343		return this.controlgroup.apply( this, arguments );
7344	};
7345}
7346
7347var widgetsButton = $.ui.button;
7348
7349
7350/* eslint-disable max-len, camelcase */
7351/*!
7352 * jQuery UI Datepicker 1.13.
73522
7353 * http://jqueryui.com
7354 *
7355 * Copyright jQuery Foundation and other contributors
7356 * Released under the MIT license.
7357 * http://jquery.org/license
7358 */
7359
7360//>>label: Datepicker
7361//>>group: Widgets
7362//>>description: Displays a calendar from an input or inline for selecting dates.
7363//>>docs: http://api.jqueryui.com/datepicker/
7364//>>demos: http://jqueryui.com/datepicker/
7365//>>css.structure: ../../themes/base/core.css
7366//>>css.structure: ../../themes/base/datepicker.css
7367//>>css.theme: ../../themes/base/theme.css
7368
7369
7370$.extend( $.ui, { datepicker: { version: "1.13.2
vendor: 81,557 bytes, lines 7370-9567
7370" } } );
7371
7372var datepicker_instActive;
7373
7374function datepicker_getZindex( elem ) {
7375	var position, value;
7376	while ( elem.length && elem[ 0 ] !== document ) {
7377
7378		// Ignore z-index if position is set to a value where z-index is ignored by the browser
7379		// This makes behavior of this function consistent across browsers
7380		// WebKit always returns auto if the element is positioned
7381		position = elem.css( "position" );
7382		if ( position === "absolute" || position === "relative" || position === "fixed" ) {
7383
7384			// IE returns 0 when zIndex is not specified
7385			// other browsers return a string
7386			// we ignore the case of nested elements with an explicit value of 0
7387			// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
7388			value = parseInt( elem.css( "zIndex" ), 10 );
7389			if ( !isNaN( value ) && value !== 0 ) {
7390				return value;
7391			}
7392		}
7393		elem = elem.parent();
7394	}
7395
7396	return 0;
7397}
7398
7399/* Date picker manager.
7400   Use the singleton instance of this class, $.datepicker, to interact with the date picker.
7401   Settings for (groups of) date pickers are maintained in an instance object,
7402   allowing multiple different settings on the same page. */
7403
7404function Datepicker() {
7405	this._curInst = null; // The current instance in use
7406	this._keyEvent = false; // If the last event was a key event
7407	this._disabledInputs = []; // List of date picker inputs that have been disabled
7408	this._datepickerShowing = false; // True if the popup picker is showing , false if not
7409	this._inDialog = false; // True if showing within a "dialog", false if not
7410	this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division
7411	this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class
7412	this._appendClass = "ui-datepicker-append"; // The name of the append marker class
7413	this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class
7414	this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class
7415	this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class
7416	this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class
7417	this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class
7418	this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class
7419	this.regional = []; // Available regional settings, indexed by language code
7420	this.regional[ "" ] = { // Default regional settings
7421		closeText: "Done", // Display text for close link
7422		prevText: "Prev", // Display text for previous month link
7423		nextText: "Next", // Display text for next month link
7424		currentText: "Today", // Display text for current month link
7425		monthNames: [ "January", "February", "March", "April", "May", "June",
7426			"July", "August", "September", "October", "November", "December" ], // Names of months for drop-down and formatting
7427		monthNamesShort: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], // For formatting
7428		dayNames: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], // For formatting
7429		dayNamesShort: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], // For formatting
7430		dayNamesMin: [ "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" ], // Column headings for days starting at Sunday
7431		weekHeader: "Wk", // Column header for week of the year
7432		dateFormat: "mm/dd/yy", // See format options on parseDate
7433		firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
7434		isRTL: false, // True if right-to-left language, false if left-to-right
7435		showMonthAfterYear: false, // True if the year select precedes month, false for month then year
7436		yearSuffix: "", // Additional text to append to the year in the month headers,
7437		selectMonthLabel: "Select month", // Invisible label for month selector
7438		selectYearLabel: "Select year" // Invisible label for year selector
7439	};
7440	this._defaults = { // Global defaults for all the date picker instances
7441		showOn: "focus", // "focus" for popup on focus,
7442			// "button" for trigger button, or "both" for either
7443		showAnim: "fadeIn", // Name of jQuery animation for popup
7444		showOptions: {}, // Options for enhanced animations
7445		defaultDate: null, // Used when field is blank: actual date,
7446			// +/-number for offset from today, null for today
7447		appendText: "", // Display text following the input box, e.g. showing the format
7448		buttonText: "...", // Text for trigger button
7449		buttonImage: "", // URL for trigger button image
7450		buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
7451		hideIfNoPrevNext: false, // True to hide next/previous month links
7452			// if not applicable, false to just disable them
7453		navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
7454		gotoCurrent: false, // True if today link goes back to current selection instead
7455		changeMonth: false, // True if month can be selected directly, false if only prev/next
7456		changeYear: false, // True if year can be selected directly, false if only prev/next
7457		yearRange: "c-10:c+10", // Range of years to display in drop-down,
7458			// either relative to today's year (-nn:+nn), relative to currently displayed year
7459			// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
7460		showOtherMonths: false, // True to show dates in other months, false to leave blank
7461		selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
7462		showWeek: false, // True to show week of the year, false to not show it
7463		calculateWeek: this.iso8601Week, // How to calculate the week of the year,
7464			// takes a Date and returns the number of the week for it
7465		shortYearCutoff: "+10", // Short year values < this are in the current century,
7466			// > this are in the previous century,
7467			// string value starting with "+" for current year + value
7468		minDate: null, // The earliest selectable date, or null for no limit
7469		maxDate: null, // The latest selectable date, or null for no limit
7470		duration: "fast", // Duration of display/closure
7471		beforeShowDay: null, // Function that takes a date and returns an array with
7472			// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "",
7473			// [2] = cell title (optional), e.g. $.datepicker.noWeekends
7474		beforeShow: null, // Function that takes an input field and
7475			// returns a set of custom settings for the date picker
7476		onSelect: null, // Define a callback function when a date is selected
7477		onChangeMonthYear: null, // Define a callback function when the month or year is changed
7478		onClose: null, // Define a callback function when the datepicker is closed
7479		onUpdateDatepicker: null, // Define a callback function when the datepicker is updated
7480		numberOfMonths: 1, // Number of months to show at a time
7481		showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
7482		stepMonths: 1, // Number of months to step back/forward
7483		stepBigMonths: 12, // Number of months to step back/forward for the big links
7484		altField: "", // Selector for an alternate field to store selected dates into
7485		altFormat: "", // The date format to use for the alternate field
7486		constrainInput: true, // The input is constrained by the current date format
7487		showButtonPanel: false, // True to show button panel, false to not show it
7488		autoSize: false, // True to size the input for the date format, false to leave as is
7489		disabled: false // The initial disabled state
7490	};
7491	$.extend( this._defaults, this.regional[ "" ] );
7492	this.regional.en = $.extend( true, {}, this.regional[ "" ] );
7493	this.regional[ "en-US" ] = $.extend( true, {}, this.regional.en );
7494	this.dpDiv = datepicker_bindHover( $( "<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>" ) );
7495}
7496
7497$.extend( Datepicker.prototype, {
7498
7499	/* Class name added to elements to indicate already configured with a date picker. */
7500	markerClassName: "hasDatepicker",
7501
7502	//Keep track of the maximum number of rows displayed (see #7043)
7503	maxRows: 4,
7504
7505	// TODO rename to "widget" when switching to widget factory
7506	_widgetDatepicker: function() {
7507		return this.dpDiv;
7508	},
7509
7510	/* Override the default settings for all instances of the date picker.
7511	 * @param  settings  object - the new settings to use as defaults (anonymous object)
7512	 * @return the manager object
7513	 */
7514	setDefaults: function( settings ) {
7515		datepicker_extendRemove( this._defaults, settings || {} );
7516		return this;
7517	},
7518
7519	/* Attach the date picker to a jQuery selection.
7520	 * @param  target	element - the target input field or division or span
7521	 * @param  settings  object - the new settings to use for this date picker instance (anonymous)
7522	 */
7523	_attachDatepicker: function( target, settings ) {
7524		var nodeName, inline, inst;
7525		nodeName = target.nodeName.toLowerCase();
7526		inline = ( nodeName === "div" || nodeName === "span" );
7527		if ( !target.id ) {
7528			this.uuid += 1;
7529			target.id = "dp" + this.uuid;
7530		}
7531		inst = this._newInst( $( target ), inline );
7532		inst.settings = $.extend( {}, settings || {} );
7533		if ( nodeName === "input" ) {
7534			this._connectDatepicker( target, inst );
7535		} else if ( inline ) {
7536			this._inlineDatepicker( target, inst );
7537		}
7538	},
7539
7540	/* Create a new instance object. */
7541	_newInst: function( target, inline ) {
7542		var id = target[ 0 ].id.replace( /([^A-Za-z0-9_\-])/g, "\\\\$1" ); // escape jQuery meta chars
7543		return { id: id, input: target, // associated target
7544			selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
7545			drawMonth: 0, drawYear: 0, // month being drawn
7546			inline: inline, // is datepicker inline or not
7547			dpDiv: ( !inline ? this.dpDiv : // presentation div
7548			datepicker_bindHover( $( "<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>" ) ) ) };
7549	},
7550
7551	/* Attach the date picker to an input field. */
7552	_connectDatepicker: function( target, inst ) {
7553		var input = $( target );
7554		inst.append = $( [] );
7555		inst.trigger = $( [] );
7556		if ( input.hasClass( this.markerClassName ) ) {
7557			return;
7558		}
7559		this._attachments( input, inst );
7560		input.addClass( this.markerClassName ).on( "keydown", this._doKeyDown ).
7561			on( "keypress", this._doKeyPress ).on( "keyup", this._doKeyUp );
7562		this._autoSize( inst );
7563		$.data( target, "datepicker", inst );
7564
7565		//If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
7566		if ( inst.settings.disabled ) {
7567			this._disableDatepicker( target );
7568		}
7569	},
7570
7571	/* Make attachments based on settings. */
7572	_attachments: function( input, inst ) {
7573		var showOn, buttonText, buttonImage,
7574			appendText = this._get( inst, "appendText" ),
7575			isRTL = this._get( inst, "isRTL" );
7576
7577		if ( inst.append ) {
7578			inst.append.remove();
7579		}
7580		if ( appendText ) {
7581			inst.append = $( "<span>" )
7582				.addClass( this._appendClass )
7583				.text( appendText );
7584			input[ isRTL ? "before" : "after" ]( inst.append );
7585		}
7586
7587		input.off( "focus", this._showDatepicker );
7588
7589		if ( inst.trigger ) {
7590			inst.trigger.remove();
7591		}
7592
7593		showOn = this._get( inst, "showOn" );
7594		if ( showOn === "focus" || showOn === "both" ) { // pop-up date picker when in the marked field
7595			input.on( "focus", this._showDatepicker );
7596		}
7597		if ( showOn === "button" || showOn === "both" ) { // pop-up date picker when button clicked
7598			buttonText = this._get( inst, "buttonText" );
7599			buttonImage = this._get( inst, "buttonImage" );
7600
7601			if ( this._get( inst, "buttonImageOnly" ) ) {
7602				inst.trigger = $( "<img>" )
7603					.addClass( this._triggerClass )
7604					.attr( {
7605						src: buttonImage,
7606						alt: buttonText,
7607						title: buttonText
7608					} );
7609			} else {
7610				inst.trigger = $( "<button type='button'>" )
7611					.addClass( this._triggerClass );
7612				if ( buttonImage ) {
7613					inst.trigger.html(
7614						$( "<img>" )
7615							.attr( {
7616								src: buttonImage,
7617								alt: buttonText,
7618								title: buttonText
7619							} )
7620					);
7621				} else {
7622					inst.trigger.text( buttonText );
7623				}
7624			}
7625
7626			input[ isRTL ? "before" : "after" ]( inst.trigger );
7627			inst.trigger.on( "click", function() {
7628				if ( $.datepicker._datepickerShowing && $.datepicker._lastInput === input[ 0 ] ) {
7629					$.datepicker._hideDatepicker();
7630				} else if ( $.datepicker._datepickerShowing && $.datepicker._lastInput !== input[ 0 ] ) {
7631					$.datepicker._hideDatepicker();
7632					$.datepicker._showDatepicker( input[ 0 ] );
7633				} else {
7634					$.datepicker._showDatepicker( input[ 0 ] );
7635				}
7636				return false;
7637			} );
7638		}
7639	},
7640
7641	/* Apply the maximum length for the date format. */
7642	_autoSize: function( inst ) {
7643		if ( this._get( inst, "autoSize" ) && !inst.inline ) {
7644			var findMax, max, maxI, i,
7645				date = new Date( 2009, 12 - 1, 20 ), // Ensure double digits
7646				dateFormat = this._get( inst, "dateFormat" );
7647
7648			if ( dateFormat.match( /[DM]/ ) ) {
7649				findMax = function( names ) {
7650					max = 0;
7651					maxI = 0;
7652					for ( i = 0; i < names.length; i++ ) {
7653						if ( names[ i ].length > max ) {
7654							max = names[ i ].length;
7655							maxI = i;
7656						}
7657					}
7658					return maxI;
7659				};
7660				date.setMonth( findMax( this._get( inst, ( dateFormat.match( /MM/ ) ?
7661					"monthNames" : "monthNamesShort" ) ) ) );
7662				date.setDate( findMax( this._get( inst, ( dateFormat.match( /DD/ ) ?
7663					"dayNames" : "dayNamesShort" ) ) ) + 20 - date.getDay() );
7664			}
7665			inst.input.attr( "size", this._formatDate( inst, date ).length );
7666		}
7667	},
7668
7669	/* Attach an inline date picker to a div. */
7670	_inlineDatepicker: function( target, inst ) {
7671		var divSpan = $( target );
7672		if ( divSpan.hasClass( this.markerClassName ) ) {
7673			return;
7674		}
7675		divSpan.addClass( this.markerClassName ).append( inst.dpDiv );
7676		$.data( target, "datepicker", inst );
7677		this._setDate( inst, this._getDefaultDate( inst ), true );
7678		this._updateDatepicker( inst );
7679		this._updateAlternate( inst );
7680
7681		//If disabled option is true, disable the datepicker before showing it (see ticket #5665)
7682		if ( inst.settings.disabled ) {
7683			this._disableDatepicker( target );
7684		}
7685
7686		// Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
7687		// http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
7688		inst.dpDiv.css( "display", "block" );
7689	},
7690
7691	/* Pop-up the date picker in a "dialog" box.
7692	 * @param  input element - ignored
7693	 * @param  date	string or Date - the initial date to display
7694	 * @param  onSelect  function - the function to call when a date is selected
7695	 * @param  settings  object - update the dialog date picker instance's settings (anonymous object)
7696	 * @param  pos int[2] - coordinates for the dialog's position within the screen or
7697	 *					event - with x/y coordinates or
7698	 *					leave empty for default (screen centre)
7699	 * @return the manager object
7700	 */
7701	_dialogDatepicker: function( input, date, onSelect, settings, pos ) {
7702		var id, browserWidth, browserHeight, scrollX, scrollY,
7703			inst = this._dialogInst; // internal instance
7704
7705		if ( !inst ) {
7706			this.uuid += 1;
7707			id = "dp" + this.uuid;
7708			this._dialogInput = $( "<input type='text' id='" + id +
7709				"' style='position: absolute; top: -100px; width: 0px;'/>" );
7710			this._dialogInput.on( "keydown", this._doKeyDown );
7711			$( "body" ).append( this._dialogInput );
7712			inst = this._dialogInst = this._newInst( this._dialogInput, false );
7713			inst.settings = {};
7714			$.data( this._dialogInput[ 0 ], "datepicker", inst );
7715		}
7716		datepicker_extendRemove( inst.settings, settings || {} );
7717		date = ( date && date.constructor === Date ? this._formatDate( inst, date ) : date );
7718		this._dialogInput.val( date );
7719
7720		this._pos = ( pos ? ( pos.length ? pos : [ pos.pageX, pos.pageY ] ) : null );
7721		if ( !this._pos ) {
7722			browserWidth = document.documentElement.clientWidth;
7723			browserHeight = document.documentElement.clientHeight;
7724			scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
7725			scrollY = document.documentElement.scrollTop || document.body.scrollTop;
7726			this._pos = // should use actual width/height below
7727				[ ( browserWidth / 2 ) - 100 + scrollX, ( browserHeight / 2 ) - 150 + scrollY ];
7728		}
7729
7730		// Move input on screen for focus, but hidden behind dialog
7731		this._dialogInput.css( "left", ( this._pos[ 0 ] + 20 ) + "px" ).css( "top", this._pos[ 1 ] + "px" );
7732		inst.settings.onSelect = onSelect;
7733		this._inDialog = true;
7734		this.dpDiv.addClass( this._dialogClass );
7735		this._showDatepicker( this._dialogInput[ 0 ] );
7736		if ( $.blockUI ) {
7737			$.blockUI( this.dpDiv );
7738		}
7739		$.data( this._dialogInput[ 0 ], "datepicker", inst );
7740		return this;
7741	},
7742
7743	/* Detach a datepicker from its control.
7744	 * @param  target	element - the target input field or division or span
7745	 */
7746	_destroyDatepicker: function( target ) {
7747		var nodeName,
7748			$target = $( target ),
7749			inst = $.data( target, "datepicker" );
7750
7751		if ( !$target.hasClass( this.markerClassName ) ) {
7752			return;
7753		}
7754
7755		nodeName = target.nodeName.toLowerCase();
7756		$.removeData( target, "datepicker" );
7757		if ( nodeName === "input" ) {
7758			inst.append.remove();
7759			inst.trigger.remove();
7760			$target.removeClass( this.markerClassName ).
7761				off( "focus", this._showDatepicker ).
7762				off( "keydown", this._doKeyDown ).
7763				off( "keypress", this._doKeyPress ).
7764				off( "keyup", this._doKeyUp );
7765		} else if ( nodeName === "div" || nodeName === "span" ) {
7766			$target.removeClass( this.markerClassName ).empty();
7767		}
7768
7769		if ( datepicker_instActive === inst ) {
7770			datepicker_instActive = null;
7771			this._curInst = null;
7772		}
7773	},
7774
7775	/* Enable the date picker to a jQuery selection.
7776	 * @param  target	element - the target input field or division or span
7777	 */
7778	_enableDatepicker: function( target ) {
7779		var nodeName, inline,
7780			$target = $( target ),
7781			inst = $.data( target, "datepicker" );
7782
7783		if ( !$target.hasClass( this.markerClassName ) ) {
7784			return;
7785		}
7786
7787		nodeName = target.nodeName.toLowerCase();
7788		if ( nodeName === "input" ) {
7789			target.disabled = false;
7790			inst.trigger.filter( "button" ).
7791				each( function() {
7792					this.disabled = false;
7793				} ).end().
7794				filter( "img" ).css( { opacity: "1.0", cursor: "" } );
7795		} else if ( nodeName === "div" || nodeName === "span" ) {
7796			inline = $target.children( "." + this._inlineClass );
7797			inline.children().removeClass( "ui-state-disabled" );
7798			inline.find( "select.ui-datepicker-month, select.ui-datepicker-year" ).
7799				prop( "disabled", false );
7800		}
7801		this._disabledInputs = $.map( this._disabledInputs,
7802
7803			// Delete entry
7804			function( value ) {
7805				return ( value === target ? null : value );
7806			} );
7807	},
7808
7809	/* Disable the date picker to a jQuery selection.
7810	 * @param  target	element - the target input field or division or span
7811	 */
7812	_disableDatepicker: function( target ) {
7813		var nodeName, inline,
7814			$target = $( target ),
7815			inst = $.data( target, "datepicker" );
7816
7817		if ( !$target.hasClass( this.markerClassName ) ) {
7818			return;
7819		}
7820
7821		nodeName = target.nodeName.toLowerCase();
7822		if ( nodeName === "input" ) {
7823			target.disabled = true;
7824			inst.trigger.filter( "button" ).
7825				each( function() {
7826					this.disabled = true;
7827				} ).end().
7828				filter( "img" ).css( { opacity: "0.5", cursor: "default" } );
7829		} else if ( nodeName === "div" || nodeName === "span" ) {
7830			inline = $target.children( "." + this._inlineClass );
7831			inline.children().addClass( "ui-state-disabled" );
7832			inline.find( "select.ui-datepicker-month, select.ui-datepicker-year" ).
7833				prop( "disabled", true );
7834		}
7835		this._disabledInputs = $.map( this._disabledInputs,
7836
7837			// Delete entry
7838			function( value ) {
7839				return ( value === target ? null : value );
7840			} );
7841		this._disabledInputs[ this._disabledInputs.length ] = target;
7842	},
7843
7844	/* Is the first field in a jQuery collection disabled as a datepicker?
7845	 * @param  target	element - the target input field or division or span
7846	 * @return boolean - true if disabled, false if enabled
7847	 */
7848	_isDisabledDatepicker: function( target ) {
7849		if ( !target ) {
7850			return false;
7851		}
7852		for ( var i = 0; i < this._disabledInputs.length; i++ ) {
7853			if ( this._disabledInputs[ i ] === target ) {
7854				return true;
7855			}
7856		}
7857		return false;
7858	},
7859
7860	/* Retrieve the instance data for the target control.
7861	 * @param  target  element - the target input field or division or span
7862	 * @return  object - the associated instance data
7863	 * @throws  error if a jQuery problem getting data
7864	 */
7865	_getInst: function( target ) {
7866		try {
7867			return $.data( target, "datepicker" );
7868		} catch ( err ) {
7869			throw "Missing instance data for this datepicker";
7870		}
7871	},
7872
7873	/* Update or retrieve the settings for a date picker attached to an input field or division.
7874	 * @param  target  element - the target input field or division or span
7875	 * @param  name	object - the new settings to update or
7876	 *				string - the name of the setting to change or retrieve,
7877	 *				when retrieving also "all" for all instance settings or
7878	 *				"defaults" for all global defaults
7879	 * @param  value   any - the new value for the setting
7880	 *				(omit if above is an object or to retrieve a value)
7881	 */
7882	_optionDatepicker: function( target, name, value ) {
7883		var settings, date, minDate, maxDate,
7884			inst = this._getInst( target );
7885
7886		if ( arguments.length === 2 && typeof name === "string" ) {
7887			return ( name === "defaults" ? $.extend( {}, $.datepicker._defaults ) :
7888				( inst ? ( name === "all" ? $.extend( {}, inst.settings ) :
7889				this._get( inst, name ) ) : null ) );
7890		}
7891
7892		settings = name || {};
7893		if ( typeof name === "string" ) {
7894			settings = {};
7895			settings[ name ] = value;
7896		}
7897
7898		if ( inst ) {
7899			if ( this._curInst === inst ) {
7900				this._hideDatepicker();
7901			}
7902
7903			date = this._getDateDatepicker( target, true );
7904			minDate = this._getMinMaxDate( inst, "min" );
7905			maxDate = this._getMinMaxDate( inst, "max" );
7906			datepicker_extendRemove( inst.settings, settings );
7907
7908			// reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
7909			if ( minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined ) {
7910				inst.settings.minDate = this._formatDate( inst, minDate );
7911			}
7912			if ( maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined ) {
7913				inst.settings.maxDate = this._formatDate( inst, maxDate );
7914			}
7915			if ( "disabled" in settings ) {
7916				if ( settings.disabled ) {
7917					this._disableDatepicker( target );
7918				} else {
7919					this._enableDatepicker( target );
7920				}
7921			}
7922			this._attachments( $( target ), inst );
7923			this._autoSize( inst );
7924			this._setDate( inst, date );
7925			this._updateAlternate( inst );
7926			this._updateDatepicker( inst );
7927		}
7928	},
7929
7930	// Change method deprecated
7931	_changeDatepicker: function( target, name, value ) {
7932		this._optionDatepicker( target, name, value );
7933	},
7934
7935	/* Redraw the date picker attached to an input field or division.
7936	 * @param  target  element - the target input field or division or span
7937	 */
7938	_refreshDatepicker: function( target ) {
7939		var inst = this._getInst( target );
7940		if ( inst ) {
7941			this._updateDatepicker( inst );
7942		}
7943	},
7944
7945	/* Set the dates for a jQuery selection.
7946	 * @param  target element - the target input field or division or span
7947	 * @param  date	Date - the new date
7948	 */
7949	_setDateDatepicker: function( target, date ) {
7950		var inst = this._getInst( target );
7951		if ( inst ) {
7952			this._setDate( inst, date );
7953			this._updateDatepicker( inst );
7954			this._updateAlternate( inst );
7955		}
7956	},
7957
7958	/* Get the date(s) for the first entry in a jQuery selection.
7959	 * @param  target element - the target input field or division or span
7960	 * @param  noDefault boolean - true if no default date is to be used
7961	 * @return Date - the current date
7962	 */
7963	_getDateDatepicker: function( target, noDefault ) {
7964		var inst = this._getInst( target );
7965		if ( inst && !inst.inline ) {
7966			this._setDateFromField( inst, noDefault );
7967		}
7968		return ( inst ? this._getDate( inst ) : null );
7969	},
7970
7971	/* Handle keystrokes. */
7972	_doKeyDown: function( event ) {
7973		var onSelect, dateStr, sel,
7974			inst = $.datepicker._getInst( event.target ),
7975			handled = true,
7976			isRTL = inst.dpDiv.is( ".ui-datepicker-rtl" );
7977
7978		inst._keyEvent = true;
7979		if ( $.datepicker._datepickerShowing ) {
7980			switch ( event.keyCode ) {
7981				case 9: $.datepicker._hideDatepicker();
7982						handled = false;
7983						break; // hide on tab out
7984				case 13: sel = $( "td." + $.datepicker._dayOverClass + ":not(." +
7985									$.datepicker._currentClass + ")", inst.dpDiv );
7986						if ( sel[ 0 ] ) {
7987							$.datepicker._selectDay( event.target, inst.selectedMonth, inst.selectedYear, sel[ 0 ] );
7988						}
7989
7990						onSelect = $.datepicker._get( inst, "onSelect" );
7991						if ( onSelect ) {
7992							dateStr = $.datepicker._formatDate( inst );
7993
7994							// Trigger custom callback
7995							onSelect.apply( ( inst.input ? inst.input[ 0 ] : null ), [ dateStr, inst ] );
7996						} else {
7997							$.datepicker._hideDatepicker();
7998						}
7999
8000						return false; // don't submit the form
8001				case 27: $.datepicker._hideDatepicker();
8002						break; // hide on escape
8003				case 33: $.datepicker._adjustDate( event.target, ( event.ctrlKey ?
8004							-$.datepicker._get( inst, "stepBigMonths" ) :
8005							-$.datepicker._get( inst, "stepMonths" ) ), "M" );
8006						break; // previous month/year on page up/+ ctrl
8007				case 34: $.datepicker._adjustDate( event.target, ( event.ctrlKey ?
8008							+$.datepicker._get( inst, "stepBigMonths" ) :
8009							+$.datepicker._get( inst, "stepMonths" ) ), "M" );
8010						break; // next month/year on page down/+ ctrl
8011				case 35: if ( event.ctrlKey || event.metaKey ) {
8012							$.datepicker._clearDate( event.target );
8013						}
8014						handled = event.ctrlKey || event.metaKey;
8015						break; // clear on ctrl or command +end
8016				case 36: if ( event.ctrlKey || event.metaKey ) {
8017							$.datepicker._gotoToday( event.target );
8018						}
8019						handled = event.ctrlKey || event.metaKey;
8020						break; // current on ctrl or command +home
8021				case 37: if ( event.ctrlKey || event.metaKey ) {
8022							$.datepicker._adjustDate( event.target, ( isRTL ? +1 : -1 ), "D" );
8023						}
8024						handled = event.ctrlKey || event.metaKey;
8025
8026						// -1 day on ctrl or command +left
8027						if ( event.originalEvent.altKey ) {
8028							$.datepicker._adjustDate( event.target, ( event.ctrlKey ?
8029								-$.datepicker._get( inst, "stepBigMonths" ) :
8030								-$.datepicker._get( inst, "stepMonths" ) ), "M" );
8031						}
8032
8033						// next month/year on alt +left on Mac
8034						break;
8035				case 38: if ( event.ctrlKey || event.metaKey ) {
8036							$.datepicker._adjustDate( event.target, -7, "D" );
8037						}
8038						handled = event.ctrlKey || event.metaKey;
8039						break; // -1 week on ctrl or command +up
8040				case 39: if ( event.ctrlKey || event.metaKey ) {
8041							$.datepicker._adjustDate( event.target, ( isRTL ? -1 : +1 ), "D" );
8042						}
8043						handled = event.ctrlKey || event.metaKey;
8044
8045						// +1 day on ctrl or command +right
8046						if ( event.originalEvent.altKey ) {
8047							$.datepicker._adjustDate( event.target, ( event.ctrlKey ?
8048								+$.datepicker._get( inst, "stepBigMonths" ) :
8049								+$.datepicker._get( inst, "stepMonths" ) ), "M" );
8050						}
8051
8052						// next month/year on alt +right
8053						break;
8054				case 40: if ( event.ctrlKey || event.metaKey ) {
8055							$.datepicker._adjustDate( event.target, +7, "D" );
8056						}
8057						handled = event.ctrlKey || event.metaKey;
8058						break; // +1 week on ctrl or command +down
8059				default: handled = false;
8060			}
8061		} else if ( event.keyCode === 36 && event.ctrlKey ) { // display the date picker on ctrl+home
8062			$.datepicker._showDatepicker( this );
8063		} else {
8064			handled = false;
8065		}
8066
8067		if ( handled ) {
8068			event.preventDefault();
8069			event.stopPropagation();
8070		}
8071	},
8072
8073	/* Filter entered characters - based on date format. */
8074	_doKeyPress: function( event ) {
8075		var chars, chr,
8076			inst = $.datepicker._getInst( event.target );
8077
8078		if ( $.datepicker._get( inst, "constrainInput" ) ) {
8079			chars = $.datepicker._possibleChars( $.datepicker._get( inst, "dateFormat" ) );
8080			chr = String.fromCharCode( event.charCode == null ? event.keyCode : event.charCode );
8081			return event.ctrlKey || event.metaKey || ( chr < " " || !chars || chars.indexOf( chr ) > -1 );
8082		}
8083	},
8084
8085	/* Synchronise manual entry and field/alternate field. */
8086	_doKeyUp: function( event ) {
8087		var date,
8088			inst = $.datepicker._getInst( event.target );
8089
8090		if ( inst.input.val() !== inst.lastVal ) {
8091			try {
8092				date = $.datepicker.parseDate( $.datepicker._get( inst, "dateFormat" ),
8093					( inst.input ? inst.input.val() : null ),
8094					$.datepicker._getFormatConfig( inst ) );
8095
8096				if ( date ) { // only if valid
8097					$.datepicker._setDateFromField( inst );
8098					$.datepicker._updateAlternate( inst );
8099					$.datepicker._updateDatepicker( inst );
8100				}
8101			} catch ( err ) {
8102			}
8103		}
8104		return true;
8105	},
8106
8107	/* Pop-up the date picker for a given input field.
8108	 * If false returned from beforeShow event handler do not show.
8109	 * @param  input  element - the input field attached to the date picker or
8110	 *					event - if triggered by focus
8111	 */
8112	_showDatepicker: function( input ) {
8113		input = input.target || input;
8114		if ( input.nodeName.toLowerCase() !== "input" ) { // find from button/image trigger
8115			input = $( "input", input.parentNode )[ 0 ];
8116		}
8117
8118		if ( $.datepicker._isDisabledDatepicker( input ) || $.datepicker._lastInput === input ) { // already here
8119			return;
8120		}
8121
8122		var inst, beforeShow, beforeShowSettings, isFixed,
8123			offset, showAnim, duration;
8124
8125		inst = $.datepicker._getInst( input );
8126		if ( $.datepicker._curInst && $.datepicker._curInst !== inst ) {
8127			$.datepicker._curInst.dpDiv.stop( true, true );
8128			if ( inst && $.datepicker._datepickerShowing ) {
8129				$.datepicker._hideDatepicker( $.datepicker._curInst.input[ 0 ] );
8130			}
8131		}
8132
8133		beforeShow = $.datepicker._get( inst, "beforeShow" );
8134		beforeShowSettings = beforeShow ? beforeShow.apply( input, [ input, inst ] ) : {};
8135		if ( beforeShowSettings === false ) {
8136			return;
8137		}
8138		datepicker_extendRemove( inst.settings, beforeShowSettings );
8139
8140		inst.lastVal = null;
8141		$.datepicker._lastInput = input;
8142		$.datepicker._setDateFromField( inst );
8143
8144		if ( $.datepicker._inDialog ) { // hide cursor
8145			input.value = "";
8146		}
8147		if ( !$.datepicker._pos ) { // position below input
8148			$.datepicker._pos = $.datepicker._findPos( input );
8149			$.datepicker._pos[ 1 ] += input.offsetHeight; // add the height
8150		}
8151
8152		isFixed = false;
8153		$( input ).parents().each( function() {
8154			isFixed |= $( this ).css( "position" ) === "fixed";
8155			return !isFixed;
8156		} );
8157
8158		offset = { left: $.datepicker._pos[ 0 ], top: $.datepicker._pos[ 1 ] };
8159		$.datepicker._pos = null;
8160
8161		//to avoid flashes on Firefox
8162		inst.dpDiv.empty();
8163
8164		// determine sizing offscreen
8165		inst.dpDiv.css( { position: "absolute", display: "block", top: "-1000px" } );
8166		$.datepicker._updateDatepicker( inst );
8167
8168		// fix width for dynamic number of date pickers
8169		// and adjust position before showing
8170		offset = $.datepicker._checkOffset( inst, offset, isFixed );
8171		inst.dpDiv.css( { position: ( $.datepicker._inDialog && $.blockUI ?
8172			"static" : ( isFixed ? "fixed" : "absolute" ) ), display: "none",
8173			left: offset.left + "px", top: offset.top + "px" } );
8174
8175		if ( !inst.inline ) {
8176			showAnim = $.datepicker._get( inst, "showAnim" );
8177			duration = $.datepicker._get( inst, "duration" );
8178			inst.dpDiv.css( "z-index", datepicker_getZindex( $( input ) ) + 1 );
8179			$.datepicker._datepickerShowing = true;
8180
8181			if ( $.effects && $.effects.effect[ showAnim ] ) {
8182				inst.dpDiv.show( showAnim, $.datepicker._get( inst, "showOptions" ), duration );
8183			} else {
8184				inst.dpDiv[ showAnim || "show" ]( showAnim ? duration : null );
8185			}
8186
8187			if ( $.datepicker._shouldFocusInput( inst ) ) {
8188				inst.input.trigger( "focus" );
8189			}
8190
8191			$.datepicker._curInst = inst;
8192		}
8193	},
8194
8195	/* Generate the date picker content. */
8196	_updateDatepicker: function( inst ) {
8197		this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
8198		datepicker_instActive = inst; // for delegate hover events
8199		inst.dpDiv.empty().append( this._generateHTML( inst ) );
8200		this._attachHandlers( inst );
8201
8202		var origyearshtml,
8203			numMonths = this._getNumberOfMonths( inst ),
8204			cols = numMonths[ 1 ],
8205			width = 17,
8206			activeCell = inst.dpDiv.find( "." + this._dayOverClass + " a" ),
8207			onUpdateDatepicker = $.datepicker._get( inst, "onUpdateDatepicker" );
8208
8209		if ( activeCell.length > 0 ) {
8210			datepicker_handleMouseover.apply( activeCell.get( 0 ) );
8211		}
8212
8213		inst.dpDiv.removeClass( "ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4" ).width( "" );
8214		if ( cols > 1 ) {
8215			inst.dpDiv.addClass( "ui-datepicker-multi-" + cols ).css( "width", ( width * cols ) + "em" );
8216		}
8217		inst.dpDiv[ ( numMonths[ 0 ] !== 1 || numMonths[ 1 ] !== 1 ? "add" : "remove" ) +
8218			"Class" ]( "ui-datepicker-multi" );
8219		inst.dpDiv[ ( this._get( inst, "isRTL" ) ? "add" : "remove" ) +
8220			"Class" ]( "ui-datepicker-rtl" );
8221
8222		if ( inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) {
8223			inst.input.trigger( "focus" );
8224		}
8225
8226		// Deffered render of the years select (to avoid flashes on Firefox)
8227		if ( inst.yearshtml ) {
8228			origyearshtml = inst.yearshtml;
8229			setTimeout( function() {
8230
8231				//assure that inst.yearshtml didn't change.
8232				if ( origyearshtml === inst.yearshtml && inst.yearshtml ) {
8233					inst.dpDiv.find( "select.ui-datepicker-year" ).first().replaceWith( inst.yearshtml );
8234				}
8235				origyearshtml = inst.yearshtml = null;
8236			}, 0 );
8237		}
8238
8239		if ( onUpdateDatepicker ) {
8240			onUpdateDatepicker.apply( ( inst.input ? inst.input[ 0 ] : null ), [ inst ] );
8241		}
8242	},
8243
8244	// #6694 - don't focus the input if it's already focused
8245	// this breaks the change event in IE
8246	// Support: IE and jQuery <1.9
8247	_shouldFocusInput: function( inst ) {
8248		return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" );
8249	},
8250
8251	/* Check positioning to remain on screen. */
8252	_checkOffset: function( inst, offset, isFixed ) {
8253		var dpWidth = inst.dpDiv.outerWidth(),
8254			dpHeight = inst.dpDiv.outerHeight(),
8255			inputWidth = inst.input ? inst.input.outerWidth() : 0,
8256			inputHeight = inst.input ? inst.input.outerHeight() : 0,
8257			viewWidth = document.documentElement.clientWidth + ( isFixed ? 0 : $( document ).scrollLeft() ),
8258			viewHeight = document.documentElement.clientHeight + ( isFixed ? 0 : $( document ).scrollTop() );
8259
8260		offset.left -= ( this._get( inst, "isRTL" ) ? ( dpWidth - inputWidth ) : 0 );
8261		offset.left -= ( isFixed && offset.left === inst.input.offset().left ) ? $( document ).scrollLeft() : 0;
8262		offset.top -= ( isFixed && offset.top === ( inst.input.offset().top + inputHeight ) ) ? $( document ).scrollTop() : 0;
8263
8264		// Now check if datepicker is showing outside window viewport - move to a better place if so.
8265		offset.left -= Math.min( offset.left, ( offset.left + dpWidth > viewWidth && viewWidth > dpWidth ) ?
8266			Math.abs( offset.left + dpWidth - viewWidth ) : 0 );
8267		offset.top -= Math.min( offset.top, ( offset.top + dpHeight > viewHeight && viewHeight > dpHeight ) ?
8268			Math.abs( dpHeight + inputHeight ) : 0 );
8269
8270		return offset;
8271	},
8272
8273	/* Find an object's position on the screen. */
8274	_findPos: function( obj ) {
8275		var position,
8276			inst = this._getInst( obj ),
8277			isRTL = this._get( inst, "isRTL" );
8278
8279		while ( obj && ( obj.type === "hidden" || obj.nodeType !== 1 || $.expr.pseudos.hidden( obj ) ) ) {
8280			obj = obj[ isRTL ? "previousSibling" : "nextSibling" ];
8281		}
8282
8283		position = $( obj ).offset();
8284		return [ position.left, position.top ];
8285	},
8286
8287	/* Hide the date picker from view.
8288	 * @param  input  element - the input field attached to the date picker
8289	 */
8290	_hideDatepicker: function( input ) {
8291		var showAnim, duration, postProcess, onClose,
8292			inst = this._curInst;
8293
8294		if ( !inst || ( input && inst !== $.data( input, "datepicker" ) ) ) {
8295			return;
8296		}
8297
8298		if ( this._datepickerShowing ) {
8299			showAnim = this._get( inst, "showAnim" );
8300			duration = this._get( inst, "duration" );
8301			postProcess = function() {
8302				$.datepicker._tidyDialog( inst );
8303			};
8304
8305			// DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed
8306			if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) {
8307				inst.dpDiv.hide( showAnim, $.datepicker._get( inst, "showOptions" ), duration, postProcess );
8308			} else {
8309				inst.dpDiv[ ( showAnim === "slideDown" ? "slideUp" :
8310					( showAnim === "fadeIn" ? "fadeOut" : "hide" ) ) ]( ( showAnim ? duration : null ), postProcess );
8311			}
8312
8313			if ( !showAnim ) {
8314				postProcess();
8315			}
8316			this._datepickerShowing = false;
8317
8318			onClose = this._get( inst, "onClose" );
8319			if ( onClose ) {
8320				onClose.apply( ( inst.input ? inst.input[ 0 ] : null ), [ ( inst.input ? inst.input.val() : "" ), inst ] );
8321			}
8322
8323			this._lastInput = null;
8324			if ( this._inDialog ) {
8325				this._dialogInput.css( { position: "absolute", left: "0", top: "-100px" } );
8326				if ( $.blockUI ) {
8327					$.unblockUI();
8328					$( "body" ).append( this.dpDiv );
8329				}
8330			}
8331			this._inDialog = false;
8332		}
8333	},
8334
8335	/* Tidy up after a dialog display. */
8336	_tidyDialog: function( inst ) {
8337		inst.dpDiv.removeClass( this._dialogClass ).off( ".ui-datepicker-calendar" );
8338	},
8339
8340	/* Close date picker if clicked elsewhere. */
8341	_checkExternalClick: function( event ) {
8342		if ( !$.datepicker._curInst ) {
8343			return;
8344		}
8345
8346		var $target = $( event.target ),
8347			inst = $.datepicker._getInst( $target[ 0 ] );
8348
8349		if ( ( ( $target[ 0 ].id !== $.datepicker._mainDivId &&
8350				$target.parents( "#" + $.datepicker._mainDivId ).length === 0 &&
8351				!$target.hasClass( $.datepicker.markerClassName ) &&
8352				!$target.closest( "." + $.datepicker._triggerClass ).length &&
8353				$.datepicker._datepickerShowing && !( $.datepicker._inDialog && $.blockUI ) ) ) ||
8354			( $target.hasClass( $.datepicker.markerClassName ) && $.datepicker._curInst !== inst ) ) {
8355				$.datepicker._hideDatepicker();
8356		}
8357	},
8358
8359	/* Adjust one of the date sub-fields. */
8360	_adjustDate: function( id, offset, period ) {
8361		var target = $( id ),
8362			inst = this._getInst( target[ 0 ] );
8363
8364		if ( this._isDisabledDatepicker( target[ 0 ] ) ) {
8365			return;
8366		}
8367		this._adjustInstDate( inst, offset, period );
8368		this._updateDatepicker( inst );
8369	},
8370
8371	/* Action for current link. */
8372	_gotoToday: function( id ) {
8373		var date,
8374			target = $( id ),
8375			inst = this._getInst( target[ 0 ] );
8376
8377		if ( this._get( inst, "gotoCurrent" ) && inst.currentDay ) {
8378			inst.selectedDay = inst.currentDay;
8379			inst.drawMonth = inst.selectedMonth = inst.currentMonth;
8380			inst.drawYear = inst.selectedYear = inst.currentYear;
8381		} else {
8382			date = new Date();
8383			inst.selectedDay = date.getDate();
8384			inst.drawMonth = inst.selectedMonth = date.getMonth();
8385			inst.drawYear = inst.selectedYear = date.getFullYear();
8386		}
8387		this._notifyChange( inst );
8388		this._adjustDate( target );
8389	},
8390
8391	/* Action for selecting a new month/year. */
8392	_selectMonthYear: function( id, select, period ) {
8393		var target = $( id ),
8394			inst = this._getInst( target[ 0 ] );
8395
8396		inst[ "selected" + ( period === "M" ? "Month" : "Year" ) ] =
8397		inst[ "draw" + ( period === "M" ? "Month" : "Year" ) ] =
8398			parseInt( select.options[ select.selectedIndex ].value, 10 );
8399
8400		this._notifyChange( inst );
8401		this._adjustDate( target );
8402	},
8403
8404	/* Action for selecting a day. */
8405	_selectDay: function( id, month, year, td ) {
8406		var inst,
8407			target = $( id );
8408
8409		if ( $( td ).hasClass( this._unselectableClass ) || this._isDisabledDatepicker( target[ 0 ] ) ) {
8410			return;
8411		}
8412
8413		inst = this._getInst( target[ 0 ] );
8414		inst.selectedDay = inst.currentDay = parseInt( $( "a", td ).attr( "data-date" ) );
8415		inst.selectedMonth = inst.currentMonth = month;
8416		inst.selectedYear = inst.currentYear = year;
8417		this._selectDate( id, this._formatDate( inst,
8418			inst.currentDay, inst.currentMonth, inst.currentYear ) );
8419	},
8420
8421	/* Erase the input field and hide the date picker. */
8422	_clearDate: function( id ) {
8423		var target = $( id );
8424		this._selectDate( target, "" );
8425	},
8426
8427	/* Update the input field with the selected date. */
8428	_selectDate: function( id, dateStr ) {
8429		var onSelect,
8430			target = $( id ),
8431			inst = this._getInst( target[ 0 ] );
8432
8433		dateStr = ( dateStr != null ? dateStr : this._formatDate( inst ) );
8434		if ( inst.input ) {
8435			inst.input.val( dateStr );
8436		}
8437		this._updateAlternate( inst );
8438
8439		onSelect = this._get( inst, "onSelect" );
8440		if ( onSelect ) {
8441			onSelect.apply( ( inst.input ? inst.input[ 0 ] : null ), [ dateStr, inst ] );  // trigger custom callback
8442		} else if ( inst.input ) {
8443			inst.input.trigger( "change" ); // fire the change event
8444		}
8445
8446		if ( inst.inline ) {
8447			this._updateDatepicker( inst );
8448		} else {
8449			this._hideDatepicker();
8450			this._lastInput = inst.input[ 0 ];
8451			if ( typeof( inst.input[ 0 ] ) !== "object" ) {
8452				inst.input.trigger( "focus" ); // restore focus
8453			}
8454			this._lastInput = null;
8455		}
8456	},
8457
8458	/* Update any alternate field to synchronise with the main field. */
8459	_updateAlternate: function( inst ) {
8460		var altFormat, date, dateStr,
8461			altField = this._get( inst, "altField" );
8462
8463		if ( altField ) { // update alternate field too
8464			altFormat = this._get( inst, "altFormat" ) || this._get( inst, "dateFormat" );
8465			date = this._getDate( inst );
8466			dateStr = this.formatDate( altFormat, date, this._getFormatConfig( inst ) );
8467			$( document ).find( altField ).val( dateStr );
8468		}
8469	},
8470
8471	/* Set as beforeShowDay function to prevent selection of weekends.
8472	 * @param  date  Date - the date to customise
8473	 * @return [boolean, string] - is this date selectable?, what is its CSS class?
8474	 */
8475	noWeekends: function( date ) {
8476		var day = date.getDay();
8477		return [ ( day > 0 && day < 6 ), "" ];
8478	},
8479
8480	/* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
8481	 * @param  date  Date - the date to get the week for
8482	 * @return  number - the number of the week within the year that contains this date
8483	 */
8484	iso8601Week: function( date ) {
8485		var time,
8486			checkDate = new Date( date.getTime() );
8487
8488		// Find Thursday of this week starting on Monday
8489		checkDate.setDate( checkDate.getDate() + 4 - ( checkDate.getDay() || 7 ) );
8490
8491		time = checkDate.getTime();
8492		checkDate.setMonth( 0 ); // Compare with Jan 1
8493		checkDate.setDate( 1 );
8494		return Math.floor( Math.round( ( time - checkDate ) / 86400000 ) / 7 ) + 1;
8495	},
8496
8497	/* Parse a string value into a date object.
8498	 * See formatDate below for the possible formats.
8499	 *
8500	 * @param  format string - the expected format of the date
8501	 * @param  value string - the date in the above format
8502	 * @param  settings Object - attributes include:
8503	 *					shortYearCutoff  number - the cutoff year for determining the century (optional)
8504	 *					dayNamesShort	string[7] - abbreviated names of the days from Sunday (optional)
8505	 *					dayNames		string[7] - names of the days from Sunday (optional)
8506	 *					monthNamesShort string[12] - abbreviated names of the months (optional)
8507	 *					monthNames		string[12] - names of the months (optional)
8508	 * @return  Date - the extracted date value or null if value is blank
8509	 */
8510	parseDate: function( format, value, settings ) {
8511		if ( format == null || value == null ) {
8512			throw "Invalid arguments";
8513		}
8514
8515		value = ( typeof value === "object" ? value.toString() : value + "" );
8516		if ( value === "" ) {
8517			return null;
8518		}
8519
8520		var iFormat, dim, extra,
8521			iValue = 0,
8522			shortYearCutoffTemp = ( settings ? settings.shortYearCutoff : null ) || this._defaults.shortYearCutoff,
8523			shortYearCutoff = ( typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp :
8524				new Date().getFullYear() % 100 + parseInt( shortYearCutoffTemp, 10 ) ),
8525			dayNamesShort = ( settings ? settings.dayNamesShort : null ) || this._defaults.dayNamesShort,
8526			dayNames = ( settings ? settings.dayNames : null ) || this._defaults.dayNames,
8527			monthNamesShort = ( settings ? settings.monthNamesShort : null ) || this._defaults.monthNamesShort,
8528			monthNames = ( settings ? settings.monthNames : null ) || this._defaults.monthNames,
8529			year = -1,
8530			month = -1,
8531			day = -1,
8532			doy = -1,
8533			literal = false,
8534			date,
8535
8536			// Check whether a format character is doubled
8537			lookAhead = function( match ) {
8538				var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );
8539				if ( matches ) {
8540					iFormat++;
8541				}
8542				return matches;
8543			},
8544
8545			// Extract a number from the string value
8546			getNumber = function( match ) {
8547				var isDoubled = lookAhead( match ),
8548					size = ( match === "@" ? 14 : ( match === "!" ? 20 :
8549					( match === "y" && isDoubled ? 4 : ( match === "o" ? 3 : 2 ) ) ) ),
8550					minSize = ( match === "y" ? size : 1 ),
8551					digits = new RegExp( "^\\d{" + minSize + "," + size + "}" ),
8552					num = value.substring( iValue ).match( digits );
8553				if ( !num ) {
8554					throw "Missing number at position " + iValue;
8555				}
8556				iValue += num[ 0 ].length;
8557				return parseInt( num[ 0 ], 10 );
8558			},
8559
8560			// Extract a name from the string value and convert to an index
8561			getName = function( match, shortNames, longNames ) {
8562				var index = -1,
8563					names = $.map( lookAhead( match ) ? longNames : shortNames, function( v, k ) {
8564						return [ [ k, v ] ];
8565					} ).sort( function( a, b ) {
8566						return -( a[ 1 ].length - b[ 1 ].length );
8567					} );
8568
8569				$.each( names, function( i, pair ) {
8570					var name = pair[ 1 ];
8571					if ( value.substr( iValue, name.length ).toLowerCase() === name.toLowerCase() ) {
8572						index = pair[ 0 ];
8573						iValue += name.length;
8574						return false;
8575					}
8576				} );
8577				if ( index !== -1 ) {
8578					return index + 1;
8579				} else {
8580					throw "Unknown name at position " + iValue;
8581				}
8582			},
8583
8584			// Confirm that a literal character matches the string value
8585			checkLiteral = function() {
8586				if ( value.charAt( iValue ) !== format.charAt( iFormat ) ) {
8587					throw "Unexpected literal at position " + iValue;
8588				}
8589				iValue++;
8590			};
8591
8592		for ( iFormat = 0; iFormat < format.length; iFormat++ ) {
8593			if ( literal ) {
8594				if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) {
8595					literal = false;
8596				} else {
8597					checkLiteral();
8598				}
8599			} else {
8600				switch ( format.charAt( iFormat ) ) {
8601					case "d":
8602						day = getNumber( "d" );
8603						break;
8604					case "D":
8605						getName( "D", dayNamesShort, dayNames );
8606						break;
8607					case "o":
8608						doy = getNumber( "o" );
8609						break;
8610					case "m":
8611						month = getNumber( "m" );
8612						break;
8613					case "M":
8614						month = getName( "M", monthNamesShort, monthNames );
8615						break;
8616					case "y":
8617						year = getNumber( "y" );
8618						break;
8619					case "@":
8620						date = new Date( getNumber( "@" ) );
8621						year = date.getFullYear();
8622						month = date.getMonth() + 1;
8623						day = date.getDate();
8624						break;
8625					case "!":
8626						date = new Date( ( getNumber( "!" ) - this._ticksTo1970 ) / 10000 );
8627						year = date.getFullYear();
8628						month = date.getMonth() + 1;
8629						day = date.getDate();
8630						break;
8631					case "'":
8632						if ( lookAhead( "'" ) ) {
8633							checkLiteral();
8634						} else {
8635							literal = true;
8636						}
8637						break;
8638					default:
8639						checkLiteral();
8640				}
8641			}
8642		}
8643
8644		if ( iValue < value.length ) {
8645			extra = value.substr( iValue );
8646			if ( !/^\s+/.test( extra ) ) {
8647				throw "Extra/unparsed characters found in date: " + extra;
8648			}
8649		}
8650
8651		if ( year === -1 ) {
8652			year = new Date().getFullYear();
8653		} else if ( year < 100 ) {
8654			year += new Date().getFullYear() - new Date().getFullYear() % 100 +
8655				( year <= shortYearCutoff ? 0 : -100 );
8656		}
8657
8658		if ( doy > -1 ) {
8659			month = 1;
8660			day = doy;
8661			do {
8662				dim = this._getDaysInMonth( year, month - 1 );
8663				if ( day <= dim ) {
8664					break;
8665				}
8666				month++;
8667				day -= dim;
8668			} while ( true );
8669		}
8670
8671		date = this._daylightSavingAdjust( new Date( year, month - 1, day ) );
8672		if ( date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day ) {
8673			throw "Invalid date"; // E.g. 31/02/00
8674		}
8675		return date;
8676	},
8677
8678	/* Standard date formats. */
8679	ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601)
8680	COOKIE: "D, dd M yy",
8681	ISO_8601: "yy-mm-dd",
8682	RFC_822: "D, d M y",
8683	RFC_850: "DD, dd-M-y",
8684	RFC_1036: "D, d M y",
8685	RFC_1123: "D, d M yy",
8686	RFC_2822: "D, d M yy",
8687	RSS: "D, d M y", // RFC 822
8688	TICKS: "!",
8689	TIMESTAMP: "@",
8690	W3C: "yy-mm-dd", // ISO 8601
8691
8692	_ticksTo1970: ( ( ( 1970 - 1 ) * 365 + Math.floor( 1970 / 4 ) - Math.floor( 1970 / 100 ) +
8693		Math.floor( 1970 / 400 ) ) * 24 * 60 * 60 * 10000000 ),
8694
8695	/* Format a date object into a string value.
8696	 * The format can be combinations of the following:
8697	 * d  - day of month (no leading zero)
8698	 * dd - day of month (two digit)
8699	 * o  - day of year (no leading zeros)
8700	 * oo - day of year (three digit)
8701	 * D  - day name short
8702	 * DD - day name long
8703	 * m  - month of year (no leading zero)
8704	 * mm - month of year (two digit)
8705	 * M  - month name short
8706	 * MM - month name long
8707	 * y  - year (two digit)
8708	 * yy - year (four digit)
8709	 * @ - Unix timestamp (ms since 01/01/1970)
8710	 * ! - Windows ticks (100ns since 01/01/0001)
8711	 * "..." - literal text
8712	 * '' - single quote
8713	 *
8714	 * @param  format string - the desired format of the date
8715	 * @param  date Date - the date value to format
8716	 * @param  settings Object - attributes include:
8717	 *					dayNamesShort	string[7] - abbreviated names of the days from Sunday (optional)
8718	 *					dayNames		string[7] - names of the days from Sunday (optional)
8719	 *					monthNamesShort string[12] - abbreviated names of the months (optional)
8720	 *					monthNames		string[12] - names of the months (optional)
8721	 * @return  string - the date in the above format
8722	 */
8723	formatDate: function( format, date, settings ) {
8724		if ( !date ) {
8725			return "";
8726		}
8727
8728		var iFormat,
8729			dayNamesShort = ( settings ? settings.dayNamesShort : null ) || this._defaults.dayNamesShort,
8730			dayNames = ( settings ? settings.dayNames : null ) || this._defaults.dayNames,
8731			monthNamesShort = ( settings ? settings.monthNamesShort : null ) || this._defaults.monthNamesShort,
8732			monthNames = ( settings ? settings.monthNames : null ) || this._defaults.monthNames,
8733
8734			// Check whether a format character is doubled
8735			lookAhead = function( match ) {
8736				var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );
8737				if ( matches ) {
8738					iFormat++;
8739				}
8740				return matches;
8741			},
8742
8743			// Format a number, with leading zero if necessary
8744			formatNumber = function( match, value, len ) {
8745				var num = "" + value;
8746				if ( lookAhead( match ) ) {
8747					while ( num.length < len ) {
8748						num = "0" + num;
8749					}
8750				}
8751				return num;
8752			},
8753
8754			// Format a name, short or long as requested
8755			formatName = function( match, value, shortNames, longNames ) {
8756				return ( lookAhead( match ) ? longNames[ value ] : shortNames[ value ] );
8757			},
8758			output = "",
8759			literal = false;
8760
8761		if ( date ) {
8762			for ( iFormat = 0; iFormat < format.length; iFormat++ ) {
8763				if ( literal ) {
8764					if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) {
8765						literal = false;
8766					} else {
8767						output += format.charAt( iFormat );
8768					}
8769				} else {
8770					switch ( format.charAt( iFormat ) ) {
8771						case "d":
8772							output += formatNumber( "d", date.getDate(), 2 );
8773							break;
8774						case "D":
8775							output += formatName( "D", date.getDay(), dayNamesShort, dayNames );
8776							break;
8777						case "o":
8778							output += formatNumber( "o",
8779								Math.round( ( new Date( date.getFullYear(), date.getMonth(), date.getDate() ).getTime() - new Date( date.getFullYear(), 0, 0 ).getTime() ) / 86400000 ), 3 );
8780							break;
8781						case "m":
8782							output += formatNumber( "m", date.getMonth() + 1, 2 );
8783							break;
8784						case "M":
8785							output += formatName( "M", date.getMonth(), monthNamesShort, monthNames );
8786							break;
8787						case "y":
8788							output += ( lookAhead( "y" ) ? date.getFullYear() :
8789								( date.getFullYear() % 100 < 10 ? "0" : "" ) + date.getFullYear() % 100 );
8790							break;
8791						case "@":
8792							output += date.getTime();
8793							break;
8794						case "!":
8795							output += date.getTime() * 10000 + this._ticksTo1970;
8796							break;
8797						case "'":
8798							if ( lookAhead( "'" ) ) {
8799								output += "'";
8800							} else {
8801								literal = true;
8802							}
8803							break;
8804						default:
8805							output += format.charAt( iFormat );
8806					}
8807				}
8808			}
8809		}
8810		return output;
8811	},
8812
8813	/* Extract all possible characters from the date format. */
8814	_possibleChars: function( format ) {
8815		var iFormat,
8816			chars = "",
8817			literal = false,
8818
8819			// Check whether a format character is doubled
8820			lookAhead = function( match ) {
8821				var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );
8822				if ( matches ) {
8823					iFormat++;
8824				}
8825				return matches;
8826			};
8827
8828		for ( iFormat = 0; iFormat < format.length; iFormat++ ) {
8829			if ( literal ) {
8830				if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) {
8831					literal = false;
8832				} else {
8833					chars += format.charAt( iFormat );
8834				}
8835			} else {
8836				switch ( format.charAt( iFormat ) ) {
8837					case "d": case "m": case "y": case "@":
8838						chars += "0123456789";
8839						break;
8840					case "D": case "M":
8841						return null; // Accept anything
8842					case "'":
8843						if ( lookAhead( "'" ) ) {
8844							chars += "'";
8845						} else {
8846							literal = true;
8847						}
8848						break;
8849					default:
8850						chars += format.charAt( iFormat );
8851				}
8852			}
8853		}
8854		return chars;
8855	},
8856
8857	/* Get a setting value, defaulting if necessary. */
8858	_get: function( inst, name ) {
8859		return inst.settings[ name ] !== undefined ?
8860			inst.settings[ name ] : this._defaults[ name ];
8861	},
8862
8863	/* Parse existing date and initialise date picker. */
8864	_setDateFromField: function( inst, noDefault ) {
8865		if ( inst.input.val() === inst.lastVal ) {
8866			return;
8867		}
8868
8869		var dateFormat = this._get( inst, "dateFormat" ),
8870			dates = inst.lastVal = inst.input ? inst.input.val() : null,
8871			defaultDate = this._getDefaultDate( inst ),
8872			date = defaultDate,
8873			settings = this._getFormatConfig( inst );
8874
8875		try {
8876			date = this.parseDate( dateFormat, dates, settings ) || defaultDate;
8877		} catch ( event ) {
8878			dates = ( noDefault ? "" : dates );
8879		}
8880		inst.selectedDay = date.getDate();
8881		inst.drawMonth = inst.selectedMonth = date.getMonth();
8882		inst.drawYear = inst.selectedYear = date.getFullYear();
8883		inst.currentDay = ( dates ? date.getDate() : 0 );
8884		inst.currentMonth = ( dates ? date.getMonth() : 0 );
8885		inst.currentYear = ( dates ? date.getFullYear() : 0 );
8886		this._adjustInstDate( inst );
8887	},
8888
8889	/* Retrieve the default date shown on opening. */
8890	_getDefaultDate: function( inst ) {
8891		return this._restrictMinMax( inst,
8892			this._determineDate( inst, this._get( inst, "defaultDate" ), new Date() ) );
8893	},
8894
8895	/* A date may be specified as an exact value or a relative one. */
8896	_determineDate: function( inst, date, defaultDate ) {
8897		var offsetNumeric = function( offset ) {
8898				var date = new Date();
8899				date.setDate( date.getDate() + offset );
8900				return date;
8901			},
8902			offsetString = function( offset ) {
8903				try {
8904					return $.datepicker.parseDate( $.datepicker._get( inst, "dateFormat" ),
8905						offset, $.datepicker._getFormatConfig( inst ) );
8906				} catch ( e ) {
8907
8908					// Ignore
8909				}
8910
8911				var date = ( offset.toLowerCase().match( /^c/ ) ?
8912					$.datepicker._getDate( inst ) : null ) || new Date(),
8913					year = date.getFullYear(),
8914					month = date.getMonth(),
8915					day = date.getDate(),
8916					pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
8917					matches = pattern.exec( offset );
8918
8919				while ( matches ) {
8920					switch ( matches[ 2 ] || "d" ) {
8921						case "d" : case "D" :
8922							day += parseInt( matches[ 1 ], 10 ); break;
8923						case "w" : case "W" :
8924							day += parseInt( matches[ 1 ], 10 ) * 7; break;
8925						case "m" : case "M" :
8926							month += parseInt( matches[ 1 ], 10 );
8927							day = Math.min( day, $.datepicker._getDaysInMonth( year, month ) );
8928							break;
8929						case "y": case "Y" :
8930							year += parseInt( matches[ 1 ], 10 );
8931							day = Math.min( day, $.datepicker._getDaysInMonth( year, month ) );
8932							break;
8933					}
8934					matches = pattern.exec( offset );
8935				}
8936				return new Date( year, month, day );
8937			},
8938			newDate = ( date == null || date === "" ? defaultDate : ( typeof date === "string" ? offsetString( date ) :
8939				( typeof date === "number" ? ( isNaN( date ) ? defaultDate : offsetNumeric( date ) ) : new Date( date.getTime() ) ) ) );
8940
8941		newDate = ( newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate );
8942		if ( newDate ) {
8943			newDate.setHours( 0 );
8944			newDate.setMinutes( 0 );
8945			newDate.setSeconds( 0 );
8946			newDate.setMilliseconds( 0 );
8947		}
8948		return this._daylightSavingAdjust( newDate );
8949	},
8950
8951	/* Handle switch to/from daylight saving.
8952	 * Hours may be non-zero on daylight saving cut-over:
8953	 * > 12 when midnight changeover, but then cannot generate
8954	 * midnight datetime, so jump to 1AM, otherwise reset.
8955	 * @param  date  (Date) the date to check
8956	 * @return  (Date) the corrected date
8957	 */
8958	_daylightSavingAdjust: function( date ) {
8959		if ( !date ) {
8960			return null;
8961		}
8962		date.setHours( date.getHours() > 12 ? date.getHours() + 2 : 0 );
8963		return date;
8964	},
8965
8966	/* Set the date(s) directly. */
8967	_setDate: function( inst, date, noChange ) {
8968		var clear = !date,
8969			origMonth = inst.selectedMonth,
8970			origYear = inst.selectedYear,
8971			newDate = this._restrictMinMax( inst, this._determineDate( inst, date, new Date() ) );
8972
8973		inst.selectedDay = inst.currentDay = newDate.getDate();
8974		inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
8975		inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
8976		if ( ( origMonth !== inst.selectedMonth || origYear !== inst.selectedYear ) && !noChange ) {
8977			this._notifyChange( inst );
8978		}
8979		this._adjustInstDate( inst );
8980		if ( inst.input ) {
8981			inst.input.val( clear ? "" : this._formatDate( inst ) );
8982		}
8983	},
8984
8985	/* Retrieve the date(s) directly. */
8986	_getDate: function( inst ) {
8987		var startDate = ( !inst.currentYear || ( inst.input && inst.input.val() === "" ) ? null :
8988			this._daylightSavingAdjust( new Date(
8989			inst.currentYear, inst.currentMonth, inst.currentDay ) ) );
8990			return startDate;
8991	},
8992
8993	/* Attach the onxxx handlers.  These are declared statically so
8994	 * they work with static code transformers like Caja.
8995	 */
8996	_attachHandlers: function( inst ) {
8997		var stepMonths = this._get( inst, "stepMonths" ),
8998			id = "#" + inst.id.replace( /\\\\/g, "\\" );
8999		inst.dpDiv.find( "[data-handler]" ).map( function() {
9000			var handler = {
9001				prev: function() {
9002					$.datepicker._adjustDate( id, -stepMonths, "M" );
9003				},
9004				next: function() {
9005					$.datepicker._adjustDate( id, +stepMonths, "M" );
9006				},
9007				hide: function() {
9008					$.datepicker._hideDatepicker();
9009				},
9010				today: function() {
9011					$.datepicker._gotoToday( id );
9012				},
9013				selectDay: function() {
9014					$.datepicker._selectDay( id, +this.getAttribute( "data-month" ), +this.getAttribute( "data-year" ), this );
9015					return false;
9016				},
9017				selectMonth: function() {
9018					$.datepicker._selectMonthYear( id, this, "M" );
9019					return false;
9020				},
9021				selectYear: function() {
9022					$.datepicker._selectMonthYear( id, this, "Y" );
9023					return false;
9024				}
9025			};
9026			$( this ).on( this.getAttribute( "data-event" ), handler[ this.getAttribute( "data-handler" ) ] );
9027		} );
9028	},
9029
9030	/* Generate the HTML for the current state of the date picker. */
9031	_generateHTML: function( inst ) {
9032		var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
9033			controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
9034			monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
9035			selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
9036			cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows,
9037			printDate, dRow, tbody, daySettings, otherMonth, unselectable,
9038			tempDate = new Date(),
9039			today = this._daylightSavingAdjust(
9040				new Date( tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate() ) ), // clear time
9041			isRTL = this._get( inst, "isRTL" ),
9042			showButtonPanel = this._get( inst, "showButtonPanel" ),
9043			hideIfNoPrevNext = this._get( inst, "hideIfNoPrevNext" ),
9044			navigationAsDateFormat = this._get( inst, "navigationAsDateFormat" ),
9045			numMonths = this._getNumberOfMonths( inst ),
9046			showCurrentAtPos = this._get( inst, "showCurrentAtPos" ),
9047			stepMonths = this._get( inst, "stepMonths" ),
9048			isMultiMonth = ( numMonths[ 0 ] !== 1 || numMonths[ 1 ] !== 1 ),
9049			currentDate = this._daylightSavingAdjust( ( !inst.currentDay ? new Date( 9999, 9, 9 ) :
9050				new Date( inst.currentYear, inst.currentMonth, inst.currentDay ) ) ),
9051			minDate = this._getMinMaxDate( inst, "min" ),
9052			maxDate = this._getMinMaxDate( inst, "max" ),
9053			drawMonth = inst.drawMonth - showCurrentAtPos,
9054			drawYear = inst.drawYear;
9055
9056		if ( drawMonth < 0 ) {
9057			drawMonth += 12;
9058			drawYear--;
9059		}
9060		if ( maxDate ) {
9061			maxDraw = this._daylightSavingAdjust( new Date( maxDate.getFullYear(),
9062				maxDate.getMonth() - ( numMonths[ 0 ] * numMonths[ 1 ] ) + 1, maxDate.getDate() ) );
9063			maxDraw = ( minDate && maxDraw < minDate ? minDate : maxDraw );
9064			while ( this._daylightSavingAdjust( new Date( drawYear, drawMonth, 1 ) ) > maxDraw ) {
9065				drawMonth--;
9066				if ( drawMonth < 0 ) {
9067					drawMonth = 11;
9068					drawYear--;
9069				}
9070			}
9071		}
9072		inst.drawMonth = drawMonth;
9073		inst.drawYear = drawYear;
9074
9075		prevText = this._get( inst, "prevText" );
9076		prevText = ( !navigationAsDateFormat ? prevText : this.formatDate( prevText,
9077			this._daylightSavingAdjust( new Date( drawYear, drawMonth - stepMonths, 1 ) ),
9078			this._getFormatConfig( inst ) ) );
9079
9080		if ( this._canAdjustMonth( inst, -1, drawYear, drawMonth ) ) {
9081			prev = $( "<a>" )
9082				.attr( {
9083					"class": "ui-datepicker-prev ui-corner-all",
9084					"data-handler": "prev",
9085					"data-event": "click",
9086					title: prevText
9087				} )
9088				.append(
9089					$( "<span>" )
9090						.addClass( "ui-icon ui-icon-circle-triangle-" +
9091							( isRTL ? "e" : "w" ) )
9092						.text( prevText )
9093				)[ 0 ].outerHTML;
9094		} else if ( hideIfNoPrevNext ) {
9095			prev = "";
9096		} else {
9097			prev = $( "<a>" )
9098				.attr( {
9099					"class": "ui-datepicker-prev ui-corner-all ui-state-disabled",
9100					title: prevText
9101				} )
9102				.append(
9103					$( "<span>" )
9104						.addClass( "ui-icon ui-icon-circle-triangle-" +
9105							( isRTL ? "e" : "w" ) )
9106						.text( prevText )
9107				)[ 0 ].outerHTML;
9108		}
9109
9110		nextText = this._get( inst, "nextText" );
9111		nextText = ( !navigationAsDateFormat ? nextText : this.formatDate( nextText,
9112			this._daylightSavingAdjust( new Date( drawYear, drawMonth + stepMonths, 1 ) ),
9113			this._getFormatConfig( inst ) ) );
9114
9115		if ( this._canAdjustMonth( inst, +1, drawYear, drawMonth ) ) {
9116			next = $( "<a>" )
9117				.attr( {
9118					"class": "ui-datepicker-next ui-corner-all",
9119					"data-handler": "next",
9120					"data-event": "click",
9121					title: nextText
9122				} )
9123				.append(
9124					$( "<span>" )
9125						.addClass( "ui-icon ui-icon-circle-triangle-" +
9126							( isRTL ? "w" : "e" ) )
9127						.text( nextText )
9128				)[ 0 ].outerHTML;
9129		} else if ( hideIfNoPrevNext ) {
9130			next = "";
9131		} else {
9132			next = $( "<a>" )
9133				.attr( {
9134					"class": "ui-datepicker-next ui-corner-all ui-state-disabled",
9135					title: nextText
9136				} )
9137				.append(
9138					$( "<span>" )
9139						.attr( "class", "ui-icon ui-icon-circle-triangle-" +
9140							( isRTL ? "w" : "e" ) )
9141						.text( nextText )
9142				)[ 0 ].outerHTML;
9143		}
9144
9145		currentText = this._get( inst, "currentText" );
9146		gotoDate = ( this._get( inst, "gotoCurrent" ) && inst.currentDay ? currentDate : today );
9147		currentText = ( !navigationAsDateFormat ? currentText :
9148			this.formatDate( currentText, gotoDate, this._getFormatConfig( inst ) ) );
9149
9150		controls = "";
9151		if ( !inst.inline ) {
9152			controls = $( "<button>" )
9153				.attr( {
9154					type: "button",
9155					"class": "ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all",
9156					"data-handler": "hide",
9157					"data-event": "click"
9158				} )
9159				.text( this._get( inst, "closeText" ) )[ 0 ].outerHTML;
9160		}
9161
9162		buttonPanel = "";
9163		if ( showButtonPanel ) {
9164			buttonPanel = $( "<div class='ui-datepicker-buttonpane ui-widget-content'>" )
9165				.append( isRTL ? controls : "" )
9166				.append( this._isInRange( inst, gotoDate ) ?
9167					$( "<button>" )
9168						.attr( {
9169							type: "button",
9170							"class": "ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all",
9171							"data-handler": "today",
9172							"data-event": "click"
9173						} )
9174						.text( currentText ) :
9175					"" )
9176				.append( isRTL ? "" : controls )[ 0 ].outerHTML;
9177		}
9178
9179		firstDay = parseInt( this._get( inst, "firstDay" ), 10 );
9180		firstDay = ( isNaN( firstDay ) ? 0 : firstDay );
9181
9182		showWeek = this._get( inst, "showWeek" );
9183		dayNames = this._get( inst, "dayNames" );
9184		dayNamesMin = this._get( inst, "dayNamesMin" );
9185		monthNames = this._get( inst, "monthNames" );
9186		monthNamesShort = this._get( inst, "monthNamesShort" );
9187		beforeShowDay = this._get( inst, "beforeShowDay" );
9188		showOtherMonths = this._get( inst, "showOtherMonths" );
9189		selectOtherMonths = this._get( inst, "selectOtherMonths" );
9190		defaultDate = this._getDefaultDate( inst );
9191		html = "";
9192
9193		for ( row = 0; row < numMonths[ 0 ]; row++ ) {
9194			group = "";
9195			this.maxRows = 4;
9196			for ( col = 0; col < numMonths[ 1 ]; col++ ) {
9197				selectedDate = this._daylightSavingAdjust( new Date( drawYear, drawMonth, inst.selectedDay ) );
9198				cornerClass = " ui-corner-all";
9199				calender = "";
9200				if ( isMultiMonth ) {
9201					calender += "<div class='ui-datepicker-group";
9202					if ( numMonths[ 1 ] > 1 ) {
9203						switch ( col ) {
9204							case 0: calender += " ui-datepicker-group-first";
9205								cornerClass = " ui-corner-" + ( isRTL ? "right" : "left" ); break;
9206							case numMonths[ 1 ] - 1: calender += " ui-datepicker-group-last";
9207								cornerClass = " ui-corner-" + ( isRTL ? "left" : "right" ); break;
9208							default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break;
9209						}
9210					}
9211					calender += "'>";
9212				}
9213				calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" +
9214					( /all|left/.test( cornerClass ) && row === 0 ? ( isRTL ? next : prev ) : "" ) +
9215					( /all|right/.test( cornerClass ) && row === 0 ? ( isRTL ? prev : next ) : "" ) +
9216					this._generateMonthYearHeader( inst, drawMonth, drawYear, minDate, maxDate,
9217					row > 0 || col > 0, monthNames, monthNamesShort ) + // draw month headers
9218					"</div><table class='ui-datepicker-calendar'><thead>" +
9219					"<tr>";
9220				thead = ( showWeek ? "<th class='ui-datepicker-week-col'>" + this._get( inst, "weekHeader" ) + "</th>" : "" );
9221				for ( dow = 0; dow < 7; dow++ ) { // days of the week
9222					day = ( dow + firstDay ) % 7;
9223					thead += "<th scope='col'" + ( ( dow + firstDay + 6 ) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "" ) + ">" +
9224						"<span title='" + dayNames[ day ] + "'>" + dayNamesMin[ day ] + "</span></th>";
9225				}
9226				calender += thead + "</tr></thead><tbody>";
9227				daysInMonth = this._getDaysInMonth( drawYear, drawMonth );
9228				if ( drawYear === inst.selectedYear && drawMonth === inst.selectedMonth ) {
9229					inst.selectedDay = Math.min( inst.selectedDay, daysInMonth );
9230				}
9231				leadDays = ( this._getFirstDayOfMonth( drawYear, drawMonth ) - firstDay + 7 ) % 7;
9232				curRows = Math.ceil( ( leadDays + daysInMonth ) / 7 ); // calculate the number of rows to generate
9233				numRows = ( isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows ); //If multiple months, use the higher number of rows (see #7043)
9234				this.maxRows = numRows;
9235				printDate = this._daylightSavingAdjust( new Date( drawYear, drawMonth, 1 - leadDays ) );
9236				for ( dRow = 0; dRow < numRows; dRow++ ) { // create date picker rows
9237					calender += "<tr>";
9238					tbody = ( !showWeek ? "" : "<td class='ui-datepicker-week-col'>" +
9239						this._get( inst, "calculateWeek" )( printDate ) + "</td>" );
9240					for ( dow = 0; dow < 7; dow++ ) { // create date picker days
9241						daySettings = ( beforeShowDay ?
9242							beforeShowDay.apply( ( inst.input ? inst.input[ 0 ] : null ), [ printDate ] ) : [ true, "" ] );
9243						otherMonth = ( printDate.getMonth() !== drawMonth );
9244						unselectable = ( otherMonth && !selectOtherMonths ) || !daySettings[ 0 ] ||
9245							( minDate && printDate < minDate ) || ( maxDate && printDate > maxDate );
9246						tbody += "<td class='" +
9247							( ( dow + firstDay + 6 ) % 7 >= 5 ? " ui-datepicker-week-end" : "" ) + // highlight weekends
9248							( otherMonth ? " ui-datepicker-other-month" : "" ) + // highlight days from other months
9249							( ( printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent ) || // user pressed key
9250							( defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime() ) ?
9251
9252							// or defaultDate is current printedDate and defaultDate is selectedDate
9253							" " + this._dayOverClass : "" ) + // highlight selected day
9254							( unselectable ? " " + this._unselectableClass + " ui-state-disabled" : "" ) +  // highlight unselectable days
9255							( otherMonth && !showOtherMonths ? "" : " " + daySettings[ 1 ] + // highlight custom dates
9256							( printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "" ) + // highlight selected day
9257							( printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "" ) ) + "'" + // highlight today (if different)
9258							( ( !otherMonth || showOtherMonths ) && daySettings[ 2 ] ? " title='" + daySettings[ 2 ].replace( /'/g, "&#39;" ) + "'" : "" ) + // cell title
9259							( unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'" ) + ">" + // actions
9260							( otherMonth && !showOtherMonths ? "&#xa0;" : // display for other months
9261							( unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" +
9262							( printDate.getTime() === today.getTime() ? " ui-state-highlight" : "" ) +
9263							( printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "" ) + // highlight selected day
9264							( otherMonth ? " ui-priority-secondary" : "" ) + // distinguish dates from other months
9265							"' href='#' aria-current='" + ( printDate.getTime() === currentDate.getTime() ? "true" : "false" ) + // mark date as selected for screen reader
9266							"' data-date='" + printDate.getDate() + // store date as data
9267							"'>" + printDate.getDate() + "</a>" ) ) + "</td>"; // display selectable date
9268						printDate.setDate( printDate.getDate() + 1 );
9269						printDate = this._daylightSavingAdjust( printDate );
9270					}
9271					calender += tbody + "</tr>";
9272				}
9273				drawMonth++;
9274				if ( drawMonth > 11 ) {
9275					drawMonth = 0;
9276					drawYear++;
9277				}
9278				calender += "</tbody></table>" + ( isMultiMonth ? "</div>" +
9279							( ( numMonths[ 0 ] > 0 && col === numMonths[ 1 ] - 1 ) ? "<div class='ui-datepicker-row-break'></div>" : "" ) : "" );
9280				group += calender;
9281			}
9282			html += group;
9283		}
9284		html += buttonPanel;
9285		inst._keyEvent = false;
9286		return html;
9287	},
9288
9289	/* Generate the month and year header. */
9290	_generateMonthYearHeader: function( inst, drawMonth, drawYear, minDate, maxDate,
9291			secondary, monthNames, monthNamesShort ) {
9292
9293		var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
9294			changeMonth = this._get( inst, "changeMonth" ),
9295			changeYear = this._get( inst, "changeYear" ),
9296			showMonthAfterYear = this._get( inst, "showMonthAfterYear" ),
9297			selectMonthLabel = this._get( inst, "selectMonthLabel" ),
9298			selectYearLabel = this._get( inst, "selectYearLabel" ),
9299			html = "<div class='ui-datepicker-title'>",
9300			monthHtml = "";
9301
9302		// Month selection
9303		if ( secondary || !changeMonth ) {
9304			monthHtml += "<span class='ui-datepicker-month'>" + monthNames[ drawMonth ] + "</span>";
9305		} else {
9306			inMinYear = ( minDate && minDate.getFullYear() === drawYear );
9307			inMaxYear = ( maxDate && maxDate.getFullYear() === drawYear );
9308			monthHtml += "<select class='ui-datepicker-month' aria-label='" + selectMonthLabel + "' data-handler='selectMonth' data-event='change'>";
9309			for ( month = 0; month < 12; month++ ) {
9310				if ( ( !inMinYear || month >= minDate.getMonth() ) && ( !inMaxYear || month <= maxDate.getMonth() ) ) {
9311					monthHtml += "<option value='" + month + "'" +
9312						( month === drawMonth ? " selected='selected'" : "" ) +
9313						">" + monthNamesShort[ month ] + "</option>";
9314				}
9315			}
9316			monthHtml += "</select>";
9317		}
9318
9319		if ( !showMonthAfterYear ) {
9320			html += monthHtml + ( secondary || !( changeMonth && changeYear ) ? "&#xa0;" : "" );
9321		}
9322
9323		// Year selection
9324		if ( !inst.yearshtml ) {
9325			inst.yearshtml = "";
9326			if ( secondary || !changeYear ) {
9327				html += "<span class='ui-datepicker-year'>" + drawYear + "</span>";
9328			} else {
9329
9330				// determine range of years to display
9331				years = this._get( inst, "yearRange" ).split( ":" );
9332				thisYear = new Date().getFullYear();
9333				determineYear = function( value ) {
9334					var year = ( value.match( /c[+\-].*/ ) ? drawYear + parseInt( value.substring( 1 ), 10 ) :
9335						( value.match( /[+\-].*/ ) ? thisYear + parseInt( value, 10 ) :
9336						parseInt( value, 10 ) ) );
9337					return ( isNaN( year ) ? thisYear : year );
9338				};
9339				year = determineYear( years[ 0 ] );
9340				endYear = Math.max( year, determineYear( years[ 1 ] || "" ) );
9341				year = ( minDate ? Math.max( year, minDate.getFullYear() ) : year );
9342				endYear = ( maxDate ? Math.min( endYear, maxDate.getFullYear() ) : endYear );
9343				inst.yearshtml += "<select class='ui-datepicker-year' aria-label='" + selectYearLabel + "' data-handler='selectYear' data-event='change'>";
9344				for ( ; year <= endYear; year++ ) {
9345					inst.yearshtml += "<option value='" + year + "'" +
9346						( year === drawYear ? " selected='selected'" : "" ) +
9347						">" + year + "</option>";
9348				}
9349				inst.yearshtml += "</select>";
9350
9351				html += inst.yearshtml;
9352				inst.yearshtml = null;
9353			}
9354		}
9355
9356		html += this._get( inst, "yearSuffix" );
9357		if ( showMonthAfterYear ) {
9358			html += ( secondary || !( changeMonth && changeYear ) ? "&#xa0;" : "" ) + monthHtml;
9359		}
9360		html += "</div>"; // Close datepicker_header
9361		return html;
9362	},
9363
9364	/* Adjust one of the date sub-fields. */
9365	_adjustInstDate: function( inst, offset, period ) {
9366		var year = inst.selectedYear + ( period === "Y" ? offset : 0 ),
9367			month = inst.selectedMonth + ( period === "M" ? offset : 0 ),
9368			day = Math.min( inst.selectedDay, this._getDaysInMonth( year, month ) ) + ( period === "D" ? offset : 0 ),
9369			date = this._restrictMinMax( inst, this._daylightSavingAdjust( new Date( year, month, day ) ) );
9370
9371		inst.selectedDay = date.getDate();
9372		inst.drawMonth = inst.selectedMonth = date.getMonth();
9373		inst.drawYear = inst.selectedYear = date.getFullYear();
9374		if ( period === "M" || period === "Y" ) {
9375			this._notifyChange( inst );
9376		}
9377	},
9378
9379	/* Ensure a date is within any min/max bounds. */
9380	_restrictMinMax: function( inst, date ) {
9381		var minDate = this._getMinMaxDate( inst, "min" ),
9382			maxDate = this._getMinMaxDate( inst, "max" ),
9383			newDate = ( minDate && date < minDate ? minDate : date );
9384		return ( maxDate && newDate > maxDate ? maxDate : newDate );
9385	},
9386
9387	/* Notify change of month/year. */
9388	_notifyChange: function( inst ) {
9389		var onChange = this._get( inst, "onChangeMonthYear" );
9390		if ( onChange ) {
9391			onChange.apply( ( inst.input ? inst.input[ 0 ] : null ),
9392				[ inst.selectedYear, inst.selectedMonth + 1, inst ] );
9393		}
9394	},
9395
9396	/* Determine the number of months to show. */
9397	_getNumberOfMonths: function( inst ) {
9398		var numMonths = this._get( inst, "numberOfMonths" );
9399		return ( numMonths == null ? [ 1, 1 ] : ( typeof numMonths === "number" ? [ 1, numMonths ] : numMonths ) );
9400	},
9401
9402	/* Determine the current maximum date - ensure no time components are set. */
9403	_getMinMaxDate: function( inst, minMax ) {
9404		return this._determineDate( inst, this._get( inst, minMax + "Date" ), null );
9405	},
9406
9407	/* Find the number of days in a given month. */
9408	_getDaysInMonth: function( year, month ) {
9409		return 32 - this._daylightSavingAdjust( new Date( year, month, 32 ) ).getDate();
9410	},
9411
9412	/* Find the day of the week of the first of a month. */
9413	_getFirstDayOfMonth: function( year, month ) {
9414		return new Date( year, month, 1 ).getDay();
9415	},
9416
9417	/* Determines if we should allow a "next/prev" month display change. */
9418	_canAdjustMonth: function( inst, offset, curYear, curMonth ) {
9419		var numMonths = this._getNumberOfMonths( inst ),
9420			date = this._daylightSavingAdjust( new Date( curYear,
9421			curMonth + ( offset < 0 ? offset : numMonths[ 0 ] * numMonths[ 1 ] ), 1 ) );
9422
9423		if ( offset < 0 ) {
9424			date.setDate( this._getDaysInMonth( date.getFullYear(), date.getMonth() ) );
9425		}
9426		return this._isInRange( inst, date );
9427	},
9428
9429	/* Is the given date in the accepted range? */
9430	_isInRange: function( inst, date ) {
9431		var yearSplit, currentYear,
9432			minDate = this._getMinMaxDate( inst, "min" ),
9433			maxDate = this._getMinMaxDate( inst, "max" ),
9434			minYear = null,
9435			maxYear = null,
9436			years = this._get( inst, "yearRange" );
9437			if ( years ) {
9438				yearSplit = years.split( ":" );
9439				currentYear = new Date().getFullYear();
9440				minYear = parseInt( yearSplit[ 0 ], 10 );
9441				maxYear = parseInt( yearSplit[ 1 ], 10 );
9442				if ( yearSplit[ 0 ].match( /[+\-].*/ ) ) {
9443					minYear += currentYear;
9444				}
9445				if ( yearSplit[ 1 ].match( /[+\-].*/ ) ) {
9446					maxYear += currentYear;
9447				}
9448			}
9449
9450		return ( ( !minDate || date.getTime() >= minDate.getTime() ) &&
9451			( !maxDate || date.getTime() <= maxDate.getTime() ) &&
9452			( !minYear || date.getFullYear() >= minYear ) &&
9453			( !maxYear || date.getFullYear() <= maxYear ) );
9454	},
9455
9456	/* Provide the configuration settings for formatting/parsing. */
9457	_getFormatConfig: function( inst ) {
9458		var shortYearCutoff = this._get( inst, "shortYearCutoff" );
9459		shortYearCutoff = ( typeof shortYearCutoff !== "string" ? shortYearCutoff :
9460			new Date().getFullYear() % 100 + parseInt( shortYearCutoff, 10 ) );
9461		return { shortYearCutoff: shortYearCutoff,
9462			dayNamesShort: this._get( inst, "dayNamesShort" ), dayNames: this._get( inst, "dayNames" ),
9463			monthNamesShort: this._get( inst, "monthNamesShort" ), monthNames: this._get( inst, "monthNames" ) };
9464	},
9465
9466	/* Format the given date for display. */
9467	_formatDate: function( inst, day, month, year ) {
9468		if ( !day ) {
9469			inst.currentDay = inst.selectedDay;
9470			inst.currentMonth = inst.selectedMonth;
9471			inst.currentYear = inst.selectedYear;
9472		}
9473		var date = ( day ? ( typeof day === "object" ? day :
9474			this._daylightSavingAdjust( new Date( year, month, day ) ) ) :
9475			this._daylightSavingAdjust( new Date( inst.currentYear, inst.currentMonth, inst.currentDay ) ) );
9476		return this.formatDate( this._get( inst, "dateFormat" ), date, this._getFormatConfig( inst ) );
9477	}
9478} );
9479
9480/*
9481 * Bind hover events for datepicker elements.
9482 * Done via delegate so the binding only occurs once in the lifetime of the parent div.
9483 * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
9484 */
9485function datepicker_bindHover( dpDiv ) {
9486	var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
9487	return dpDiv.on( "mouseout", selector, function() {
9488			$( this ).removeClass( "ui-state-hover" );
9489			if ( this.className.indexOf( "ui-datepicker-prev" ) !== -1 ) {
9490				$( this ).removeClass( "ui-datepicker-prev-hover" );
9491			}
9492			if ( this.className.indexOf( "ui-datepicker-next" ) !== -1 ) {
9493				$( this ).removeClass( "ui-datepicker-next-hover" );
9494			}
9495		} )
9496		.on( "mouseover", selector, datepicker_handleMouseover );
9497}
9498
9499function datepicker_handleMouseover() {
9500	if ( !$.datepicker._isDisabledDatepicker( datepicker_instActive.inline ? datepicker_instActive.dpDiv.parent()[ 0 ] : datepicker_instActive.input[ 0 ] ) ) {
9501		$( this ).parents( ".ui-datepicker-calendar" ).find( "a" ).removeClass( "ui-state-hover" );
9502		$( this ).addClass( "ui-state-hover" );
9503		if ( this.className.indexOf( "ui-datepicker-prev" ) !== -1 ) {
9504			$( this ).addClass( "ui-datepicker-prev-hover" );
9505		}
9506		if ( this.className.indexOf( "ui-datepicker-next" ) !== -1 ) {
9507			$( this ).addClass( "ui-datepicker-next-hover" );
9508		}
9509	}
9510}
9511
9512/* jQuery extend now ignores nulls! */
9513function datepicker_extendRemove( target, props ) {
9514	$.extend( target, props );
9515	for ( var name in props ) {
9516		if ( props[ name ] == null ) {
9517			target[ name ] = props[ name ];
9518		}
9519	}
9520	return target;
9521}
9522
9523/* Invoke the datepicker functionality.
9524   @param  options  string - a command, optionally followed by additional parameters or
9525					Object - settings for attaching new datepicker functionality
9526   @return  jQuery object */
9527$.fn.datepicker = function( options ) {
9528
9529	/* Verify an empty collection wasn't passed - Fixes #6976 */
9530	if ( !this.length ) {
9531		return this;
9532	}
9533
9534	/* Initialise the date picker. */
9535	if ( !$.datepicker.initialized ) {
9536		$( document ).on( "mousedown", $.datepicker._checkExternalClick );
9537		$.datepicker.initialized = true;
9538	}
9539
9540	/* Append datepicker main container to body if not exist. */
9541	if ( $( "#" + $.datepicker._mainDivId ).length === 0 ) {
9542		$( "body" ).append( $.datepicker.dpDiv );
9543	}
9544
9545	var otherArgs = Array.prototype.slice.call( arguments, 1 );
9546	if ( typeof options === "string" && ( options === "isDisabled" || options === "getDate" || options === "widget" ) ) {
9547		return $.datepicker[ "_" + options + "Datepicker" ].
9548			apply( $.datepicker, [ this[ 0 ] ].concat( otherArgs ) );
9549	}
9550	if ( options === "option" && arguments.length === 2 && typeof arguments[ 1 ] === "string" ) {
9551		return $.datepicker[ "_" + options + "Datepicker" ].
9552			apply( $.datepicker, [ this[ 0 ] ].concat( otherArgs ) );
9553	}
9554	return this.each( function() {
9555		if ( typeof options === "string" ) {
9556			$.datepicker[ "_" + options + "Datepicker" ]
9557				.apply( $.datepicker, [ this ].concat( otherArgs ) );
9558		} else {
9559			$.datepicker._attachDatepicker( this, options );
9560		}
9561	} );
9562};
9563
9564$.datepicker = new Datepicker(); // singleton instance
9565$.datepicker.initialized = false;
9566$.datepicker.uuid = new Date().getTime();
9567$.datepicker.version = "1.13.
vendor: 7,558 bytes, lines 9567-9856
95672";
9568
9569var widgetsDatepicker = $.datepicker;
9570
9571
9572
9573// This file is deprecated
9574var ie = $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
9575
9576/*!
9577 * jQuery UI Mouse 1.13.2
9578 * http://jqueryui.com
9579 *
9580 * Copyright jQuery Foundation and other contributors
9581 * Released under the MIT license.
9582 * http://jquery.org/license
9583 */
9584
9585//>>label: Mouse
9586//>>group: Widgets
9587//>>description: Abstracts mouse-based interactions to assist in creating certain widgets.
9588//>>docs: http://api.jqueryui.com/mouse/
9589
9590
9591var mouseHandled = false;
9592$( document ).on( "mouseup", function() {
9593	mouseHandled = false;
9594} );
9595
9596var widgetsMouse = $.widget( "ui.mouse", {
9597	version: "1.13.2",
9598	options: {
9599		cancel: "input, textarea, button, select, option",
9600		distance: 1,
9601		delay: 0
9602	},
9603	_mouseInit: function() {
9604		var that = this;
9605
9606		this.element
9607			.on( "mousedown." + this.widgetName, function( event ) {
9608				return that._mouseDown( event );
9609			} )
9610			.on( "click." + this.widgetName, function( event ) {
9611				if ( true === $.data( event.target, that.widgetName + ".preventClickEvent" ) ) {
9612					$.removeData( event.target, that.widgetName + ".preventClickEvent" );
9613					event.stopImmediatePropagation();
9614					return false;
9615				}
9616			} );
9617
9618		this.started = false;
9619	},
9620
9621	// TODO: make sure destroying one instance of mouse doesn't mess with
9622	// other instances of mouse
9623	_mouseDestroy: function() {
9624		this.element.off( "." + this.widgetName );
9625		if ( this._mouseMoveDelegate ) {
9626			this.document
9627				.off( "mousemove." + this.widgetName, this._mouseMoveDelegate )
9628				.off( "mouseup." + this.widgetName, this._mouseUpDelegate );
9629		}
9630	},
9631
9632	_mouseDown: function( event ) {
9633
9634		// don't let more than one widget handle mouseStart
9635		if ( mouseHandled ) {
9636			return;
9637		}
9638
9639		this._mouseMoved = false;
9640
9641		// We may have missed mouseup (out of window)
9642		if ( this._mouseStarted ) {
9643			this._mouseUp( event );
9644		}
9645
9646		this._mouseDownEvent = event;
9647
9648		var that = this,
9649			btnIsLeft = ( event.which === 1 ),
9650
9651			// event.target.nodeName works around a bug in IE 8 with
9652			// disabled inputs (#7620)
9653			elIsCancel = ( typeof this.options.cancel === "string" && event.target.nodeName ?
9654				$( event.target ).closest( this.options.cancel ).length : false );
9655		if ( !btnIsLeft || elIsCancel || !this._mouseCapture( event ) ) {
9656			return true;
9657		}
9658
9659		this.mouseDelayMet = !this.options.delay;
9660		if ( !this.mouseDelayMet ) {
9661			this._mouseDelayTimer = setTimeout( function() {
9662				that.mouseDelayMet = true;
9663			}, this.options.delay );
9664		}
9665
9666		if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) {
9667			this._mouseStarted = ( this._mouseStart( event ) !== false );
9668			if ( !this._mouseStarted ) {
9669				event.preventDefault();
9670				return true;
9671			}
9672		}
9673
9674		// Click event may never have fired (Gecko & Opera)
9675		if ( true === $.data( event.target, this.widgetName + ".preventClickEvent" ) ) {
9676			$.removeData( event.target, this.widgetName + ".preventClickEvent" );
9677		}
9678
9679		// These delegates are required to keep context
9680		this._mouseMoveDelegate = function( event ) {
9681			return that._mouseMove( event );
9682		};
9683		this._mouseUpDelegate = function( event ) {
9684			return that._mouseUp( event );
9685		};
9686
9687		this.document
9688			.on( "mousemove." + this.widgetName, this._mouseMoveDelegate )
9689			.on( "mouseup." + this.widgetName, this._mouseUpDelegate );
9690
9691		event.preventDefault();
9692
9693		mouseHandled = true;
9694		return true;
9695	},
9696
9697	_mouseMove: function( event ) {
9698
9699		// Only check for mouseups outside the document if you've moved inside the document
9700		// at least once. This prevents the firing of mouseup in the case of IE<9, which will
9701		// fire a mousemove event if content is placed under the cursor. See #7778
9702		// Support: IE <9
9703		if ( this._mouseMoved ) {
9704
9705			// IE mouseup check - mouseup happened when mouse was out of window
9706			if ( $.ui.ie && ( !document.documentMode || document.documentMode < 9 ) &&
9707					!event.button ) {
9708				return this._mouseUp( event );
9709
9710			// Iframe mouseup check - mouseup occurred in another document
9711			} else if ( !event.which ) {
9712
9713				// Support: Safari <=8 - 9
9714				// Safari sets which to 0 if you press any of the following keys
9715				// during a drag (#14461)
9716				if ( event.originalEvent.altKey || event.originalEvent.ctrlKey ||
9717						event.originalEvent.metaKey || event.originalEvent.shiftKey ) {
9718					this.ignoreMissingWhich = true;
9719				} else if ( !this.ignoreMissingWhich ) {
9720					return this._mouseUp( event );
9721				}
9722			}
9723		}
9724
9725		if ( event.which || event.button ) {
9726			this._mouseMoved = true;
9727		}
9728
9729		if ( this._mouseStarted ) {
9730			this._mouseDrag( event );
9731			return event.preventDefault();
9732		}
9733
9734		if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) {
9735			this._mouseStarted =
9736				( this._mouseStart( this._mouseDownEvent, event ) !== false );
9737			if ( this._mouseStarted ) {
9738				this._mouseDrag( event );
9739			} else {
9740				this._mouseUp( event );
9741			}
9742		}
9743
9744		return !this._mouseStarted;
9745	},
9746
9747	_mouseUp: function( event ) {
9748		this.document
9749			.off( "mousemove." + this.widgetName, this._mouseMoveDelegate )
9750			.off( "mouseup." + this.widgetName, this._mouseUpDelegate );
9751
9752		if ( this._mouseStarted ) {
9753			this._mouseStarted = false;
9754
9755			if ( event.target === this._mouseDownEvent.target ) {
9756				$.data( event.target, this.widgetName + ".preventClickEvent", true );
9757			}
9758
9759			this._mouseStop( event );
9760		}
9761
9762		if ( this._mouseDelayTimer ) {
9763			clearTimeout( this._mouseDelayTimer );
9764			delete this._mouseDelayTimer;
9765		}
9766
9767		this.ignoreMissingWhich = false;
9768		mouseHandled = false;
9769		event.preventDefault();
9770	},
9771
9772	_mouseDistanceMet: function( event ) {
9773		return ( Math.max(
9774				Math.abs( this._mouseDownEvent.pageX - event.pageX ),
9775				Math.abs( this._mouseDownEvent.pageY - event.pageY )
9776			) >= this.options.distance
9777		);
9778	},
9779
9780	_mouseDelayMet: function( /* event */ ) {
9781		return this.mouseDelayMet;
9782	},
9783
9784	// These are placeholder methods, to be overriden by extending plugin
9785	_mouseStart: function( /* event */ ) {},
9786	_mouseDrag: function( /* event */ ) {},
9787	_mouseStop: function( /* event */ ) {},
9788	_mouseCapture: function( /* event */ ) {
9789		return true;
9790	}
9791} );
9792
9793
9794
9795// $.ui.plugin is deprecated. Use $.widget() extensions instead.
9796var plugin = $.ui.plugin = {
9797	add: function( module, option, set ) {
9798		var i,
9799			proto = $.ui[ module ].prototype;
9800		for ( i in set ) {
9801			proto.plugins[ i ] = proto.plugins[ i ] || [];
9802			proto.plugins[ i ].push( [ option, set[ i ] ] );
9803		}
9804	},
9805	call: function( instance, name, args, allowDisconnected ) {
9806		var i,
9807			set = instance.plugins[ name ];
9808
9809		if ( !set ) {
9810			return;
9811		}
9812
9813		if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode ||
9814				instance.element[ 0 ].parentNode.nodeType === 11 ) ) {
9815			return;
9816		}
9817
9818		for ( i = 0; i < set.length; i++ ) {
9819			if ( instance.options[ set[ i ][ 0 ] ] ) {
9820				set[ i ][ 1 ].apply( instance.element, args );
9821			}
9822		}
9823	}
9824};
9825
9826
9827
9828var safeBlur = $.ui.safeBlur = function( element ) {
9829
9830	// Support: IE9 - 10 only
9831	// If the <body> is blurred, IE will switch windows, see #9420
9832	if ( element && element.nodeName.toLowerCase() !== "body" ) {
9833		$( element ).trigger( "blur" );
9834	}
9835};
9836
9837
9838/*!
9839 * jQuery UI Draggable 1.13.2
9840 * http://jqueryui.com
9841 *
9842 * Copyright jQuery Foundation and other contributors
9843 * Released under the MIT license.
9844 * http://jquery.org/license
9845 */
9846
9847//>>label: Draggable
9848//>>group: Interactions
9849//>>description: Enables dragging functionality for any element.
9850//>>docs: http://api.jqueryui.com/draggable/
9851//>>demos: http://jqueryui.com/draggable/
9852//>>css.structure: ../../themes/base/draggable.css
9853
9854
9855$.widget( "ui.draggable", $.ui.mouse, {
9856	version: "1.13.2
vendor: 8,684 bytes, lines 9856-10202
9856",
9857	widgetEventPrefix: "drag",
9858	options: {
9859		addClasses: true,
9860		appendTo: "parent",
9861		axis: false,
9862		connectToSortable: false,
9863		containment: false,
9864		cursor: "auto",
9865		cursorAt: false,
9866		grid: false,
9867		handle: false,
9868		helper: "original",
9869		iframeFix: false,
9870		opacity: false,
9871		refreshPositions: false,
9872		revert: false,
9873		revertDuration: 500,
9874		scope: "default",
9875		scroll: true,
9876		scrollSensitivity: 20,
9877		scrollSpeed: 20,
9878		snap: false,
9879		snapMode: "both",
9880		snapTolerance: 20,
9881		stack: false,
9882		zIndex: false,
9883
9884		// Callbacks
9885		drag: null,
9886		start: null,
9887		stop: null
9888	},
9889	_create: function() {
9890
9891		if ( this.options.helper === "original" ) {
9892			this._setPositionRelative();
9893		}
9894		if ( this.options.addClasses ) {
9895			this._addClass( "ui-draggable" );
9896		}
9897		this._setHandleClassName();
9898
9899		this._mouseInit();
9900	},
9901
9902	_setOption: function( key, value ) {
9903		this._super( key, value );
9904		if ( key === "handle" ) {
9905			this._removeHandleClassName();
9906			this._setHandleClassName();
9907		}
9908	},
9909
9910	_destroy: function() {
9911		if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) {
9912			this.destroyOnClear = true;
9913			return;
9914		}
9915		this._removeHandleClassName();
9916		this._mouseDestroy();
9917	},
9918
9919	_mouseCapture: function( event ) {
9920		var o = this.options;
9921
9922		// Among others, prevent a drag on a resizable-handle
9923		if ( this.helper || o.disabled ||
9924				$( event.target ).closest( ".ui-resizable-handle" ).length > 0 ) {
9925			return false;
9926		}
9927
9928		//Quit if we're not on a valid handle
9929		this.handle = this._getHandle( event );
9930		if ( !this.handle ) {
9931			return false;
9932		}
9933
9934		this._blurActiveElement( event );
9935
9936		this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix );
9937
9938		return true;
9939
9940	},
9941
9942	_blockFrames: function( selector ) {
9943		this.iframeBlocks = this.document.find( selector ).map( function() {
9944			var iframe = $( this );
9945
9946			return $( "<div>" )
9947				.css( "position", "absolute" )
9948				.appendTo( iframe.parent() )
9949				.outerWidth( iframe.outerWidth() )
9950				.outerHeight( iframe.outerHeight() )
9951				.offset( iframe.offset() )[ 0 ];
9952		} );
9953	},
9954
9955	_unblockFrames: function() {
9956		if ( this.iframeBlocks ) {
9957			this.iframeBlocks.remove();
9958			delete this.iframeBlocks;
9959		}
9960	},
9961
9962	_blurActiveElement: function( event ) {
9963		var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ),
9964			target = $( event.target );
9965
9966		// Don't blur if the event occurred on an element that is within
9967		// the currently focused element
9968		// See #10527, #12472
9969		if ( target.closest( activeElement ).length ) {
9970			return;
9971		}
9972
9973		// Blur any element that currently has focus, see #4261
9974		$.ui.safeBlur( activeElement );
9975	},
9976
9977	_mouseStart: function( event ) {
9978
9979		var o = this.options;
9980
9981		//Create and append the visible helper
9982		this.helper = this._createHelper( event );
9983
9984		this._addClass( this.helper, "ui-draggable-dragging" );
9985
9986		//Cache the helper size
9987		this._cacheHelperProportions();
9988
9989		//If ddmanager is used for droppables, set the global draggable
9990		if ( $.ui.ddmanager ) {
9991			$.ui.ddmanager.current = this;
9992		}
9993
9994		/*
9995		 * - Position generation -
9996		 * This block generates everything position related - it's the core of draggables.
9997		 */
9998
9999		//Cache the margins of the original element
10000		this._cacheMargins();
10001
10002		//Store the helper's css position
10003		this.cssPosition = this.helper.css( "position" );
10004		this.scrollParent = this.helper.scrollParent( true );
10005		this.offsetParent = this.helper.offsetParent();
10006		this.hasFixedAncestor = this.helper.parents().filter( function() {
10007				return $( this ).css( "position" ) === "fixed";
10008			} ).length > 0;
10009
10010		//The element's absolute position on the page minus margins
10011		this.positionAbs = this.element.offset();
10012		this._refreshOffsets( event );
10013
10014		//Generate the original position
10015		this.originalPosition = this.position = this._generatePosition( event, false );
10016		this.originalPageX = event.pageX;
10017		this.originalPageY = event.pageY;
10018
10019		//Adjust the mouse offset relative to the helper if "cursorAt" is supplied
10020		if ( o.cursorAt ) {
10021			this._adjustOffsetFromHelper( o.cursorAt );
10022		}
10023
10024		//Set a containment if given in the options
10025		this._setContainment();
10026
10027		//Trigger event + callbacks
10028		if ( this._trigger( "start", event ) === false ) {
10029			this._clear();
10030			return false;
10031		}
10032
10033		//Recache the helper size
10034		this._cacheHelperProportions();
10035
10036		//Prepare the droppable offsets
10037		if ( $.ui.ddmanager && !o.dropBehaviour ) {
10038			$.ui.ddmanager.prepareOffsets( this, event );
10039		}
10040
10041		// Execute the drag once - this causes the helper not to be visible before getting its
10042		// correct position
10043		this._mouseDrag( event, true );
10044
10045		// If the ddmanager is used for droppables, inform the manager that dragging has started
10046		// (see #5003)
10047		if ( $.ui.ddmanager ) {
10048			$.ui.ddmanager.dragStart( this, event );
10049		}
10050
10051		return true;
10052	},
10053
10054	_refreshOffsets: function( event ) {
10055		this.offset = {
10056			top: this.positionAbs.top - this.margins.top,
10057			left: this.positionAbs.left - this.margins.left,
10058			scroll: false,
10059			parent: this._getParentOffset(),
10060			relative: this._getRelativeOffset()
10061		};
10062
10063		this.offset.click = {
10064			left: event.pageX - this.offset.left,
10065			top: event.pageY - this.offset.top
10066		};
10067	},
10068
10069	_mouseDrag: function( event, noPropagation ) {
10070
10071		// reset any necessary cached properties (see #5009)
10072		if ( this.hasFixedAncestor ) {
10073			this.offset.parent = this._getParentOffset();
10074		}
10075
10076		//Compute the helpers position
10077		this.position = this._generatePosition( event, true );
10078		this.positionAbs = this._convertPositionTo( "absolute" );
10079
10080		//Call plugins and callbacks and use the resulting position if something is returned
10081		if ( !noPropagation ) {
10082			var ui = this._uiHash();
10083			if ( this._trigger( "drag", event, ui ) === false ) {
10084				this._mouseUp( new $.Event( "mouseup", event ) );
10085				return false;
10086			}
10087			this.position = ui.position;
10088		}
10089
10090		this.helper[ 0 ].style.left = this.position.left + "px";
10091		this.helper[ 0 ].style.top = this.position.top + "px";
10092
10093		if ( $.ui.ddmanager ) {
10094			$.ui.ddmanager.drag( this, event );
10095		}
10096
10097		return false;
10098	},
10099
10100	_mouseStop: function( event ) {
10101
10102		//If we are using droppables, inform the manager about the drop
10103		var that = this,
10104			dropped = false;
10105		if ( $.ui.ddmanager && !this.options.dropBehaviour ) {
10106			dropped = $.ui.ddmanager.drop( this, event );
10107		}
10108
10109		//if a drop comes from outside (a sortable)
10110		if ( this.dropped ) {
10111			dropped = this.dropped;
10112			this.dropped = false;
10113		}
10114
10115		if ( ( this.options.revert === "invalid" && !dropped ) ||
10116				( this.options.revert === "valid" && dropped ) ||
10117				this.options.revert === true || ( typeof this.options.revert === "function" &&
10118				this.options.revert.call( this.element, dropped ) )
10119		) {
10120			$( this.helper ).animate(
10121				this.originalPosition,
10122				parseInt( this.options.revertDuration, 10 ),
10123				function() {
10124					if ( that._trigger( "stop", event ) !== false ) {
10125						that._clear();
10126					}
10127				}
10128			);
10129		} else {
10130			if ( this._trigger( "stop", event ) !== false ) {
10131				this._clear();
10132			}
10133		}
10134
10135		return false;
10136	},
10137
10138	_mouseUp: function( event ) {
10139		this._unblockFrames();
10140
10141		// If the ddmanager is used for droppables, inform the manager that dragging has stopped
10142		// (see #5003)
10143		if ( $.ui.ddmanager ) {
10144			$.ui.ddmanager.dragStop( this, event );
10145		}
10146
10147		// Only need to focus if the event occurred on the draggable itself, see #10527
10148		if ( this.handleElement.is( event.target ) ) {
10149
10150			// The interaction is over; whether or not the click resulted in a drag,
10151			// focus the element
10152			this.element.trigger( "focus" );
10153		}
10154
10155		return $.ui.mouse.prototype._mouseUp.call( this, event );
10156	},
10157
10158	cancel: function() {
10159
10160		if ( this.helper.is( ".ui-draggable-dragging" ) ) {
10161			this._mouseUp( new $.Event( "mouseup", { target: this.element[ 0 ] } ) );
10162		} else {
10163			this._clear();
10164		}
10165
10166		return this;
10167
10168	},
10169
10170	_getHandle: function( event ) {
10171		return this.options.handle ?
10172			!!$( event.target ).closest( this.element.find( this.options.handle ) ).length :
10173			true;
10174	},
10175
10176	_setHandleClassName: function() {
10177		this.handleElement = this.options.handle ?
10178			this.element.find( this.options.handle ) : this.element;
10179		this._addClass( this.handleElement, "ui-draggable-handle" );
10180	},
10181
10182	_removeHandleClassName: function() {
10183		this._removeClass( this.handleElement, "ui-draggable-handle" );
10184	},
10185
10186	_createHelper: function( event ) {
10187
10188		var o = this.options,
10189			helperIsFunction = typeof o.helper === "function",
10190			helper = helperIsFunction ?
10191				$( o.helper.apply( this.element[ 0 ], [ event ] ) ) :
10192				( o.helper === "clone" ?
10193					this.element.clone().removeAttr( "id" ) :
10194					this.element );
10195
10196		if ( !helper.parents( "body" ).length ) {
10197			helper.appendTo( ( o.appendTo === "parent" ?
10198				this.element[ 0 ].parentNode :
10199				o.appendTo ) );
10200		}
10201
10202		// 
10202Http
vendor: 25,991 bytes, lines 10202-11074
10202://bugs.jqueryui.com/ticket/9446
10203		// a helper function can return the original element
10204		// which wouldn't have been set to relative in _create
10205		if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) {
10206			this._setPositionRelative();
10207		}
10208
10209		if ( helper[ 0 ] !== this.element[ 0 ] &&
10210				!( /(fixed|absolute)/ ).test( helper.css( "position" ) ) ) {
10211			helper.css( "position", "absolute" );
10212		}
10213
10214		return helper;
10215
10216	},
10217
10218	_setPositionRelative: function() {
10219		if ( !( /^(?:r|a|f)/ ).test( this.element.css( "position" ) ) ) {
10220			this.element[ 0 ].style.position = "relative";
10221		}
10222	},
10223
10224	_adjustOffsetFromHelper: function( obj ) {
10225		if ( typeof obj === "string" ) {
10226			obj = obj.split( " " );
10227		}
10228		if ( Array.isArray( obj ) ) {
10229			obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 };
10230		}
10231		if ( "left" in obj ) {
10232			this.offset.click.left = obj.left + this.margins.left;
10233		}
10234		if ( "right" in obj ) {
10235			this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
10236		}
10237		if ( "top" in obj ) {
10238			this.offset.click.top = obj.top + this.margins.top;
10239		}
10240		if ( "bottom" in obj ) {
10241			this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
10242		}
10243	},
10244
10245	_isRootNode: function( element ) {
10246		return ( /(html|body)/i ).test( element.tagName ) || element === this.document[ 0 ];
10247	},
10248
10249	_getParentOffset: function() {
10250
10251		//Get the offsetParent and cache its position
10252		var po = this.offsetParent.offset(),
10253			document = this.document[ 0 ];
10254
10255		// This is a special case where we need to modify a offset calculated on start, since the
10256		// following happened:
10257		// 1. The position of the helper is absolute, so it's position is calculated based on the
10258		// next positioned parent
10259		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't
10260		// the document, which means that the scroll is included in the initial calculation of the
10261		// offset of the parent, and never recalculated upon drag
10262		if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== document &&
10263				$.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) {
10264			po.left += this.scrollParent.scrollLeft();
10265			po.top += this.scrollParent.scrollTop();
10266		}
10267
10268		if ( this._isRootNode( this.offsetParent[ 0 ] ) ) {
10269			po = { top: 0, left: 0 };
10270		}
10271
10272		return {
10273			top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ),
10274			left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 )
10275		};
10276
10277	},
10278
10279	_getRelativeOffset: function() {
10280		if ( this.cssPosition !== "relative" ) {
10281			return { top: 0, left: 0 };
10282		}
10283
10284		var p = this.element.position(),
10285			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
10286
10287		return {
10288			top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) +
10289				( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ),
10290			left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) +
10291				( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 )
10292		};
10293
10294	},
10295
10296	_cacheMargins: function() {
10297		this.margins = {
10298			left: ( parseInt( this.element.css( "marginLeft" ), 10 ) || 0 ),
10299			top: ( parseInt( this.element.css( "marginTop" ), 10 ) || 0 ),
10300			right: ( parseInt( this.element.css( "marginRight" ), 10 ) || 0 ),
10301			bottom: ( parseInt( this.element.css( "marginBottom" ), 10 ) || 0 )
10302		};
10303	},
10304
10305	_cacheHelperProportions: function() {
10306		this.helperProportions = {
10307			width: this.helper.outerWidth(),
10308			height: this.helper.outerHeight()
10309		};
10310	},
10311
10312	_setContainment: function() {
10313
10314		var isUserScrollable, c, ce,
10315			o = this.options,
10316			document = this.document[ 0 ];
10317
10318		this.relativeContainer = null;
10319
10320		if ( !o.containment ) {
10321			this.containment = null;
10322			return;
10323		}
10324
10325		if ( o.containment === "window" ) {
10326			this.containment = [
10327				$( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
10328				$( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top,
10329				$( window ).scrollLeft() + $( window ).width() -
10330					this.helperProportions.width - this.margins.left,
10331				$( window ).scrollTop() +
10332					( $( window ).height() || document.body.parentNode.scrollHeight ) -
10333					this.helperProportions.height - this.margins.top
10334			];
10335			return;
10336		}
10337
10338		if ( o.containment === "document" ) {
10339			this.containment = [
10340				0,
10341				0,
10342				$( document ).width() - this.helperProportions.width - this.margins.left,
10343				( $( document ).height() || document.body.parentNode.scrollHeight ) -
10344					this.helperProportions.height - this.margins.top
10345			];
10346			return;
10347		}
10348
10349		if ( o.containment.constructor === Array ) {
10350			this.containment = o.containment;
10351			return;
10352		}
10353
10354		if ( o.containment === "parent" ) {
10355			o.containment = this.helper[ 0 ].parentNode;
10356		}
10357
10358		c = $( o.containment );
10359		ce = c[ 0 ];
10360
10361		if ( !ce ) {
10362			return;
10363		}
10364
10365		isUserScrollable = /(scroll|auto)/.test( c.css( "overflow" ) );
10366
10367		this.containment = [
10368			( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) +
10369				( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ),
10370			( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) +
10371				( parseInt( c.css( "paddingTop" ), 10 ) || 0 ),
10372			( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
10373				( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) -
10374				( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) -
10375				this.helperProportions.width -
10376				this.margins.left -
10377				this.margins.right,
10378			( isUserScrollable ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
10379				( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) -
10380				( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) -
10381				this.helperProportions.height -
10382				this.margins.top -
10383				this.margins.bottom
10384		];
10385		this.relativeContainer = c;
10386	},
10387
10388	_convertPositionTo: function( d, pos ) {
10389
10390		if ( !pos ) {
10391			pos = this.position;
10392		}
10393
10394		var mod = d === "absolute" ? 1 : -1,
10395			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
10396
10397		return {
10398			top: (
10399
10400				// The absolute mouse position
10401				pos.top	+
10402
10403				// Only for relative positioned nodes: Relative offset from element to offset parent
10404				this.offset.relative.top * mod +
10405
10406				// The offsetParent's offset without borders (offset + border)
10407				this.offset.parent.top * mod -
10408				( ( this.cssPosition === "fixed" ?
10409					-this.offset.scroll.top :
10410					( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod )
10411			),
10412			left: (
10413
10414				// The absolute mouse position
10415				pos.left +
10416
10417				// Only for relative positioned nodes: Relative offset from element to offset parent
10418				this.offset.relative.left * mod +
10419
10420				// The offsetParent's offset without borders (offset + border)
10421				this.offset.parent.left * mod	-
10422				( ( this.cssPosition === "fixed" ?
10423					-this.offset.scroll.left :
10424					( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod )
10425			)
10426		};
10427
10428	},
10429
10430	_generatePosition: function( event, constrainPosition ) {
10431
10432		var containment, co, top, left,
10433			o = this.options,
10434			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ),
10435			pageX = event.pageX,
10436			pageY = event.pageY;
10437
10438		// Cache the scroll
10439		if ( !scrollIsRootNode || !this.offset.scroll ) {
10440			this.offset.scroll = {
10441				top: this.scrollParent.scrollTop(),
10442				left: this.scrollParent.scrollLeft()
10443			};
10444		}
10445
10446		/*
10447		 * - Position constraining -
10448		 * Constrain the position to a mix of grid, containment.
10449		 */
10450
10451		// If we are not dragging yet, we won't check for options
10452		if ( constrainPosition ) {
10453			if ( this.containment ) {
10454				if ( this.relativeContainer ) {
10455					co = this.relativeContainer.offset();
10456					containment = [
10457						this.containment[ 0 ] + co.left,
10458						this.containment[ 1 ] + co.top,
10459						this.containment[ 2 ] + co.left,
10460						this.containment[ 3 ] + co.top
10461					];
10462				} else {
10463					containment = this.containment;
10464				}
10465
10466				if ( event.pageX - this.offset.click.left < containment[ 0 ] ) {
10467					pageX = containment[ 0 ] + this.offset.click.left;
10468				}
10469				if ( event.pageY - this.offset.click.top < containment[ 1 ] ) {
10470					pageY = containment[ 1 ] + this.offset.click.top;
10471				}
10472				if ( event.pageX - this.offset.click.left > containment[ 2 ] ) {
10473					pageX = containment[ 2 ] + this.offset.click.left;
10474				}
10475				if ( event.pageY - this.offset.click.top > containment[ 3 ] ) {
10476					pageY = containment[ 3 ] + this.offset.click.top;
10477				}
10478			}
10479
10480			if ( o.grid ) {
10481
10482				//Check for grid elements set to 0 to prevent divide by 0 error causing invalid
10483				// argument errors in IE (see ticket #6950)
10484				top = o.grid[ 1 ] ? this.originalPageY + Math.round( ( pageY -
10485					this.originalPageY ) / o.grid[ 1 ] ) * o.grid[ 1 ] : this.originalPageY;
10486				pageY = containment ? ( ( top - this.offset.click.top >= containment[ 1 ] ||
10487					top - this.offset.click.top > containment[ 3 ] ) ?
10488						top :
10489						( ( top - this.offset.click.top >= containment[ 1 ] ) ?
10490							top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) : top;
10491
10492				left = o.grid[ 0 ] ? this.originalPageX +
10493					Math.round( ( pageX - this.originalPageX ) / o.grid[ 0 ] ) * o.grid[ 0 ] :
10494					this.originalPageX;
10495				pageX = containment ? ( ( left - this.offset.click.left >= containment[ 0 ] ||
10496					left - this.offset.click.left > containment[ 2 ] ) ?
10497						left :
10498						( ( left - this.offset.click.left >= containment[ 0 ] ) ?
10499							left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) : left;
10500			}
10501
10502			if ( o.axis === "y" ) {
10503				pageX = this.originalPageX;
10504			}
10505
10506			if ( o.axis === "x" ) {
10507				pageY = this.originalPageY;
10508			}
10509		}
10510
10511		return {
10512			top: (
10513
10514				// The absolute mouse position
10515				pageY -
10516
10517				// Click offset (relative to the element)
10518				this.offset.click.top -
10519
10520				// Only for relative positioned nodes: Relative offset from element to offset parent
10521				this.offset.relative.top -
10522
10523				// The offsetParent's offset without borders (offset + border)
10524				this.offset.parent.top +
10525				( this.cssPosition === "fixed" ?
10526					-this.offset.scroll.top :
10527					( scrollIsRootNode ? 0 : this.offset.scroll.top ) )
10528			),
10529			left: (
10530
10531				// The absolute mouse position
10532				pageX -
10533
10534				// Click offset (relative to the element)
10535				this.offset.click.left -
10536
10537				// Only for relative positioned nodes: Relative offset from element to offset parent
10538				this.offset.relative.left -
10539
10540				// The offsetParent's offset without borders (offset + border)
10541				this.offset.parent.left +
10542				( this.cssPosition === "fixed" ?
10543					-this.offset.scroll.left :
10544					( scrollIsRootNode ? 0 : this.offset.scroll.left ) )
10545			)
10546		};
10547
10548	},
10549
10550	_clear: function() {
10551		this._removeClass( this.helper, "ui-draggable-dragging" );
10552		if ( this.helper[ 0 ] !== this.element[ 0 ] && !this.cancelHelperRemoval ) {
10553			this.helper.remove();
10554		}
10555		this.helper = null;
10556		this.cancelHelperRemoval = false;
10557		if ( this.destroyOnClear ) {
10558			this.destroy();
10559		}
10560	},
10561
10562	// From now on bulk stuff - mainly helpers
10563
10564	_trigger: function( type, event, ui ) {
10565		ui = ui || this._uiHash();
10566		$.ui.plugin.call( this, type, [ event, ui, this ], true );
10567
10568		// Absolute position and offset (see #6884 ) have to be recalculated after plugins
10569		if ( /^(drag|start|stop)/.test( type ) ) {
10570			this.positionAbs = this._convertPositionTo( "absolute" );
10571			ui.offset = this.positionAbs;
10572		}
10573		return $.Widget.prototype._trigger.call( this, type, event, ui );
10574	},
10575
10576	plugins: {},
10577
10578	_uiHash: function() {
10579		return {
10580			helper: this.helper,
10581			position: this.position,
10582			originalPosition: this.originalPosition,
10583			offset: this.positionAbs
10584		};
10585	}
10586
10587} );
10588
10589$.ui.plugin.add( "draggable", "connectToSortable", {
10590	start: function( event, ui, draggable ) {
10591		var uiSortable = $.extend( {}, ui, {
10592			item: draggable.element
10593		} );
10594
10595		draggable.sortables = [];
10596		$( draggable.options.connectToSortable ).each( function() {
10597			var sortable = $( this ).sortable( "instance" );
10598
10599			if ( sortable && !sortable.options.disabled ) {
10600				draggable.sortables.push( sortable );
10601
10602				// RefreshPositions is called at drag start to refresh the containerCache
10603				// which is used in drag. This ensures it's initialized and synchronized
10604				// with any changes that might have happened on the page since initialization.
10605				sortable.refreshPositions();
10606				sortable._trigger( "activate", event, uiSortable );
10607			}
10608		} );
10609	},
10610	stop: function( event, ui, draggable ) {
10611		var uiSortable = $.extend( {}, ui, {
10612			item: draggable.element
10613		} );
10614
10615		draggable.cancelHelperRemoval = false;
10616
10617		$.each( draggable.sortables, function() {
10618			var sortable = this;
10619
10620			if ( sortable.isOver ) {
10621				sortable.isOver = 0;
10622
10623				// Allow this sortable to handle removing the helper
10624				draggable.cancelHelperRemoval = true;
10625				sortable.cancelHelperRemoval = false;
10626
10627				// Use _storedCSS To restore properties in the sortable,
10628				// as this also handles revert (#9675) since the draggable
10629				// may have modified them in unexpected ways (#8809)
10630				sortable._storedCSS = {
10631					position: sortable.placeholder.css( "position" ),
10632					top: sortable.placeholder.css( "top" ),
10633					left: sortable.placeholder.css( "left" )
10634				};
10635
10636				sortable._mouseStop( event );
10637
10638				// Once drag has ended, the sortable should return to using
10639				// its original helper, not the shared helper from draggable
10640				sortable.options.helper = sortable.options._helper;
10641			} else {
10642
10643				// Prevent this Sortable from removing the helper.
10644				// However, don't set the draggable to remove the helper
10645				// either as another connected Sortable may yet handle the removal.
10646				sortable.cancelHelperRemoval = true;
10647
10648				sortable._trigger( "deactivate", event, uiSortable );
10649			}
10650		} );
10651	},
10652	drag: function( event, ui, draggable ) {
10653		$.each( draggable.sortables, function() {
10654			var innermostIntersecting = false,
10655				sortable = this;
10656
10657			// Copy over variables that sortable's _intersectsWith uses
10658			sortable.positionAbs = draggable.positionAbs;
10659			sortable.helperProportions = draggable.helperProportions;
10660			sortable.offset.click = draggable.offset.click;
10661
10662			if ( sortable._intersectsWith( sortable.containerCache ) ) {
10663				innermostIntersecting = true;
10664
10665				$.each( draggable.sortables, function() {
10666
10667					// Copy over variables that sortable's _intersectsWith uses
10668					this.positionAbs = draggable.positionAbs;
10669					this.helperProportions = draggable.helperProportions;
10670					this.offset.click = draggable.offset.click;
10671
10672					if ( this !== sortable &&
10673							this._intersectsWith( this.containerCache ) &&
10674							$.contains( sortable.element[ 0 ], this.element[ 0 ] ) ) {
10675						innermostIntersecting = false;
10676					}
10677
10678					return innermostIntersecting;
10679				} );
10680			}
10681
10682			if ( innermostIntersecting ) {
10683
10684				// If it intersects, we use a little isOver variable and set it once,
10685				// so that the move-in stuff gets fired only once.
10686				if ( !sortable.isOver ) {
10687					sortable.isOver = 1;
10688
10689					// Store draggable's parent in case we need to reappend to it later.
10690					draggable._parent = ui.helper.parent();
10691
10692					sortable.currentItem = ui.helper
10693						.appendTo( sortable.element )
10694						.data( "ui-sortable-item", true );
10695
10696					// Store helper option to later restore it
10697					sortable.options._helper = sortable.options.helper;
10698
10699					sortable.options.helper = function() {
10700						return ui.helper[ 0 ];
10701					};
10702
10703					// Fire the start events of the sortable with our passed browser event,
10704					// and our own helper (so it doesn't create a new one)
10705					event.target = sortable.currentItem[ 0 ];
10706					sortable._mouseCapture( event, true );
10707					sortable._mouseStart( event, true, true );
10708
10709					// Because the browser event is way off the new appended portlet,
10710					// modify necessary variables to reflect the changes
10711					sortable.offset.click.top = draggable.offset.click.top;
10712					sortable.offset.click.left = draggable.offset.click.left;
10713					sortable.offset.parent.left -= draggable.offset.parent.left -
10714						sortable.offset.parent.left;
10715					sortable.offset.parent.top -= draggable.offset.parent.top -
10716						sortable.offset.parent.top;
10717
10718					draggable._trigger( "toSortable", event );
10719
10720					// Inform draggable that the helper is in a valid drop zone,
10721					// used solely in the revert option to handle "valid/invalid".
10722					draggable.dropped = sortable.element;
10723
10724					// Need to refreshPositions of all sortables in the case that
10725					// adding to one sortable changes the location of the other sortables (#9675)
10726					$.each( draggable.sortables, function() {
10727						this.refreshPositions();
10728					} );
10729
10730					// Hack so receive/update callbacks work (mostly)
10731					draggable.currentItem = draggable.element;
10732					sortable.fromOutside = draggable;
10733				}
10734
10735				if ( sortable.currentItem ) {
10736					sortable._mouseDrag( event );
10737
10738					// Copy the sortable's position because the draggable's can potentially reflect
10739					// a relative position, while sortable is always absolute, which the dragged
10740					// element has now become. (#8809)
10741					ui.position = sortable.position;
10742				}
10743			} else {
10744
10745				// If it doesn't intersect with the sortable, and it intersected before,
10746				// we fake the drag stop of the sortable, but make sure it doesn't remove
10747				// the helper by using cancelHelperRemoval.
10748				if ( sortable.isOver ) {
10749
10750					sortable.isOver = 0;
10751					sortable.cancelHelperRemoval = true;
10752
10753					// Calling sortable's mouseStop would trigger a revert,
10754					// so revert must be temporarily false until after mouseStop is called.
10755					sortable.options._revert = sortable.options.revert;
10756					sortable.options.revert = false;
10757
10758					sortable._trigger( "out", event, sortable._uiHash( sortable ) );
10759					sortable._mouseStop( event, true );
10760
10761					// Restore sortable behaviors that were modfied
10762					// when the draggable entered the sortable area (#9481)
10763					sortable.options.revert = sortable.options._revert;
10764					sortable.options.helper = sortable.options._helper;
10765
10766					if ( sortable.placeholder ) {
10767						sortable.placeholder.remove();
10768					}
10769
10770					// Restore and recalculate the draggable's offset considering the sortable
10771					// may have modified them in unexpected ways. (#8809, #10669)
10772					ui.helper.appendTo( draggable._parent );
10773					draggable._refreshOffsets( event );
10774					ui.position = draggable._generatePosition( event, true );
10775
10776					draggable._trigger( "fromSortable", event );
10777
10778					// Inform draggable that the helper is no longer in a valid drop zone
10779					draggable.dropped = false;
10780
10781					// Need to refreshPositions of all sortables just in case removing
10782					// from one sortable changes the location of other sortables (#9675)
10783					$.each( draggable.sortables, function() {
10784						this.refreshPositions();
10785					} );
10786				}
10787			}
10788		} );
10789	}
10790} );
10791
10792$.ui.plugin.add( "draggable", "cursor", {
10793	start: function( event, ui, instance ) {
10794		var t = $( "body" ),
10795			o = instance.options;
10796
10797		if ( t.css( "cursor" ) ) {
10798			o._cursor = t.css( "cursor" );
10799		}
10800		t.css( "cursor", o.cursor );
10801	},
10802	stop: function( event, ui, instance ) {
10803		var o = instance.options;
10804		if ( o._cursor ) {
10805			$( "body" ).css( "cursor", o._cursor );
10806		}
10807	}
10808} );
10809
10810$.ui.plugin.add( "draggable", "opacity", {
10811	start: function( event, ui, instance ) {
10812		var t = $( ui.helper ),
10813			o = instance.options;
10814		if ( t.css( "opacity" ) ) {
10815			o._opacity = t.css( "opacity" );
10816		}
10817		t.css( "opacity", o.opacity );
10818	},
10819	stop: function( event, ui, instance ) {
10820		var o = instance.options;
10821		if ( o._opacity ) {
10822			$( ui.helper ).css( "opacity", o._opacity );
10823		}
10824	}
10825} );
10826
10827$.ui.plugin.add( "draggable", "scroll", {
10828	start: function( event, ui, i ) {
10829		if ( !i.scrollParentNotHidden ) {
10830			i.scrollParentNotHidden = i.helper.scrollParent( false );
10831		}
10832
10833		if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] &&
10834				i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) {
10835			i.overflowOffset = i.scrollParentNotHidden.offset();
10836		}
10837	},
10838	drag: function( event, ui, i  ) {
10839
10840		var o = i.options,
10841			scrolled = false,
10842			scrollParent = i.scrollParentNotHidden[ 0 ],
10843			document = i.document[ 0 ];
10844
10845		if ( scrollParent !== document && scrollParent.tagName !== "HTML" ) {
10846			if ( !o.axis || o.axis !== "x" ) {
10847				if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY <
10848						o.scrollSensitivity ) {
10849					scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed;
10850				} else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) {
10851					scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed;
10852				}
10853			}
10854
10855			if ( !o.axis || o.axis !== "y" ) {
10856				if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX <
10857						o.scrollSensitivity ) {
10858					scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed;
10859				} else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) {
10860					scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed;
10861				}
10862			}
10863
10864		} else {
10865
10866			if ( !o.axis || o.axis !== "x" ) {
10867				if ( event.pageY - $( document ).scrollTop() < o.scrollSensitivity ) {
10868					scrolled = $( document ).scrollTop( $( document ).scrollTop() - o.scrollSpeed );
10869				} else if ( $( window ).height() - ( event.pageY - $( document ).scrollTop() ) <
10870						o.scrollSensitivity ) {
10871					scrolled = $( document ).scrollTop( $( document ).scrollTop() + o.scrollSpeed );
10872				}
10873			}
10874
10875			if ( !o.axis || o.axis !== "y" ) {
10876				if ( event.pageX - $( document ).scrollLeft() < o.scrollSensitivity ) {
10877					scrolled = $( document ).scrollLeft(
10878						$( document ).scrollLeft() - o.scrollSpeed
10879					);
10880				} else if ( $( window ).width() - ( event.pageX - $( document ).scrollLeft() ) <
10881						o.scrollSensitivity ) {
10882					scrolled = $( document ).scrollLeft(
10883						$( document ).scrollLeft() + o.scrollSpeed
10884					);
10885				}
10886			}
10887
10888		}
10889
10890		if ( scrolled !== false && $.ui.ddmanager && !o.dropBehaviour ) {
10891			$.ui.ddmanager.prepareOffsets( i, event );
10892		}
10893
10894	}
10895} );
10896
10897$.ui.plugin.add( "draggable", "snap", {
10898	start: function( event, ui, i ) {
10899
10900		var o = i.options;
10901
10902		i.snapElements = [];
10903
10904		$( o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap )
10905			.each( function() {
10906				var $t = $( this ),
10907					$o = $t.offset();
10908				if ( this !== i.element[ 0 ] ) {
10909					i.snapElements.push( {
10910						item: this,
10911						width: $t.outerWidth(), height: $t.outerHeight(),
10912						top: $o.top, left: $o.left
10913					} );
10914				}
10915			} );
10916
10917	},
10918	drag: function( event, ui, inst ) {
10919
10920		var ts, bs, ls, rs, l, r, t, b, i, first,
10921			o = inst.options,
10922			d = o.snapTolerance,
10923			x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
10924			y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
10925
10926		for ( i = inst.snapElements.length - 1; i >= 0; i-- ) {
10927
10928			l = inst.snapElements[ i ].left - inst.margins.left;
10929			r = l + inst.snapElements[ i ].width;
10930			t = inst.snapElements[ i ].top - inst.margins.top;
10931			b = t + inst.snapElements[ i ].height;
10932
10933			if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d ||
10934					!$.contains( inst.snapElements[ i ].item.ownerDocument,
10935					inst.snapElements[ i ].item ) ) {
10936				if ( inst.snapElements[ i ].snapping ) {
10937					if ( inst.options.snap.release ) {
10938						inst.options.snap.release.call(
10939							inst.element,
10940							event,
10941							$.extend( inst._uiHash(), { snapItem: inst.snapElements[ i ].item } )
10942						);
10943					}
10944				}
10945				inst.snapElements[ i ].snapping = false;
10946				continue;
10947			}
10948
10949			if ( o.snapMode !== "inner" ) {
10950				ts = Math.abs( t - y2 ) <= d;
10951				bs = Math.abs( b - y1 ) <= d;
10952				ls = Math.abs( l - x2 ) <= d;
10953				rs = Math.abs( r - x1 ) <= d;
10954				if ( ts ) {
10955					ui.position.top = inst._convertPositionTo( "relative", {
10956						top: t - inst.helperProportions.height,
10957						left: 0
10958					} ).top;
10959				}
10960				if ( bs ) {
10961					ui.position.top = inst._convertPositionTo( "relative", {
10962						top: b,
10963						left: 0
10964					} ).top;
10965				}
10966				if ( ls ) {
10967					ui.position.left = inst._convertPositionTo( "relative", {
10968						top: 0,
10969						left: l - inst.helperProportions.width
10970					} ).left;
10971				}
10972				if ( rs ) {
10973					ui.position.left = inst._convertPositionTo( "relative", {
10974						top: 0,
10975						left: r
10976					} ).left;
10977				}
10978			}
10979
10980			first = ( ts || bs || ls || rs );
10981
10982			if ( o.snapMode !== "outer" ) {
10983				ts = Math.abs( t - y1 ) <= d;
10984				bs = Math.abs( b - y2 ) <= d;
10985				ls = Math.abs( l - x1 ) <= d;
10986				rs = Math.abs( r - x2 ) <= d;
10987				if ( ts ) {
10988					ui.position.top = inst._convertPositionTo( "relative", {
10989						top: t,
10990						left: 0
10991					} ).top;
10992				}
10993				if ( bs ) {
10994					ui.position.top = inst._convertPositionTo( "relative", {
10995						top: b - inst.helperProportions.height,
10996						left: 0
10997					} ).top;
10998				}
10999				if ( ls ) {
11000					ui.position.left = inst._convertPositionTo( "relative", {
11001						top: 0,
11002						left: l
11003					} ).left;
11004				}
11005				if ( rs ) {
11006					ui.position.left = inst._convertPositionTo( "relative", {
11007						top: 0,
11008						left: r - inst.helperProportions.width
11009					} ).left;
11010				}
11011			}
11012
11013			if ( !inst.snapElements[ i ].snapping && ( ts || bs || ls || rs || first ) ) {
11014				if ( inst.options.snap.snap ) {
11015					inst.options.snap.snap.call(
11016						inst.element,
11017						event,
11018						$.extend( inst._uiHash(), {
11019							snapItem: inst.snapElements[ i ].item
11020						} ) );
11021				}
11022			}
11023			inst.snapElements[ i ].snapping = ( ts || bs || ls || rs || first );
11024
11025		}
11026
11027	}
11028} );
11029
11030$.ui.plugin.add( "draggable", "stack", {
11031	start: function( event, ui, instance ) {
11032		var min,
11033			o = instance.options,
11034			group = $.makeArray( $( o.stack ) ).sort( function( a, b ) {
11035				return ( parseInt( $( a ).css( "zIndex" ), 10 ) || 0 ) -
11036					( parseInt( $( b ).css( "zIndex" ), 10 ) || 0 );
11037			} );
11038
11039		if ( !group.length ) {
11040			return;
11041		}
11042
11043		min = parseInt( $( group[ 0 ] ).css( "zIndex" ), 10 ) || 0;
11044		$( group ).each( function( i ) {
11045			$( this ).css( "zIndex", min + i );
11046		} );
11047		this.css( "zIndex", ( min + group.length ) );
11048	}
11049} );
11050
11051$.ui.plugin.add( "draggable", "zIndex", {
11052	start: function( event, ui, instance ) {
11053		var t = $( ui.helper ),
11054			o = instance.options;
11055
11056		if ( t.css( "zIndex" ) ) {
11057			o._zIndex = t.css( "zIndex" );
11058		}
11059		t.css( "zIndex", o.zIndex );
11060	},
11061	stop: function( event, ui, instance ) {
11062		var o = instance.options;
11063
11064		if ( o._zIndex ) {
11065			$( ui.helper ).css( "zIndex", o._zIndex );
11066		}
11067	}
11068} );
11069
11070var widgetsDraggable = $.ui.draggable;
11071
11072
11073/*!
11074 * jQuery UI Resizable 1.13.
110742
11075 * http://jqueryui.com
11076 *
11077 * Copyright jQuery Foundation and other contributors
11078 * Released under the MIT license.
11079 * http://jquery.org/license
11080 */
11081
11082//>>label: Resizable
11083//>>group: Interactions
11084//>>description: Enables resize functionality for any element.
11085//>>docs: http://api.jqueryui.com/resizable/
11086//>>demos: http://jqueryui.com/resizable/
11087//>>css.structure: ../../themes/base/core.css
11088//>>css.structure: ../../themes/base/resizable.css
11089//>>css.theme: ../../themes/base/theme.css
11090
11091
11092$.widget( "ui.resizable", $.ui.mouse, {
11093	version: "1.13.2
vendor: 11,739 bytes, lines 11093-11586
11093",
11094	widgetEventPrefix: "resize",
11095	options: {
11096		alsoResize: false,
11097		animate: false,
11098		animateDuration: "slow",
11099		animateEasing: "swing",
11100		aspectRatio: false,
11101		autoHide: false,
11102		classes: {
11103			"ui-resizable-se": "ui-icon ui-icon-gripsmall-diagonal-se"
11104		},
11105		containment: false,
11106		ghost: false,
11107		grid: false,
11108		handles: "e,s,se",
11109		helper: false,
11110		maxHeight: null,
11111		maxWidth: null,
11112		minHeight: 10,
11113		minWidth: 10,
11114
11115		// See #7960
11116		zIndex: 90,
11117
11118		// Callbacks
11119		resize: null,
11120		start: null,
11121		stop: null
11122	},
11123
11124	_num: function( value ) {
11125		return parseFloat( value ) || 0;
11126	},
11127
11128	_isNumber: function( value ) {
11129		return !isNaN( parseFloat( value ) );
11130	},
11131
11132	_hasScroll: function( el, a ) {
11133
11134		if ( $( el ).css( "overflow" ) === "hidden" ) {
11135			return false;
11136		}
11137
11138		var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
11139			has = false;
11140
11141		if ( el[ scroll ] > 0 ) {
11142			return true;
11143		}
11144
11145		// TODO: determine which cases actually cause this to happen
11146		// if the element doesn't have the scroll set, see if it's possible to
11147		// set the scroll
11148		try {
11149			el[ scroll ] = 1;
11150			has = ( el[ scroll ] > 0 );
11151			el[ scroll ] = 0;
11152		} catch ( e ) {
11153
11154			// `el` might be a string, then setting `scroll` will throw
11155			// an error in strict mode; ignore it.
11156		}
11157		return has;
11158	},
11159
11160	_create: function() {
11161
11162		var margins,
11163			o = this.options,
11164			that = this;
11165		this._addClass( "ui-resizable" );
11166
11167		$.extend( this, {
11168			_aspectRatio: !!( o.aspectRatio ),
11169			aspectRatio: o.aspectRatio,
11170			originalElement: this.element,
11171			_proportionallyResizeElements: [],
11172			_helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
11173		} );
11174
11175		// Wrap the element if it cannot hold child nodes
11176		if ( this.element[ 0 ].nodeName.match( /^(canvas|textarea|input|select|button|img)$/i ) ) {
11177
11178			this.element.wrap(
11179				$( "<div class='ui-wrapper'></div>" ).css( {
11180					overflow: "hidden",
11181					position: this.element.css( "position" ),
11182					width: this.element.outerWidth(),
11183					height: this.element.outerHeight(),
11184					top: this.element.css( "top" ),
11185					left: this.element.css( "left" )
11186				} )
11187			);
11188
11189			this.element = this.element.parent().data(
11190				"ui-resizable", this.element.resizable( "instance" )
11191			);
11192
11193			this.elementIsWrapper = true;
11194
11195			margins = {
11196				marginTop: this.originalElement.css( "marginTop" ),
11197				marginRight: this.originalElement.css( "marginRight" ),
11198				marginBottom: this.originalElement.css( "marginBottom" ),
11199				marginLeft: this.originalElement.css( "marginLeft" )
11200			};
11201
11202			this.element.css( margins );
11203			this.originalElement.css( "margin", 0 );
11204
11205			// support: Safari
11206			// Prevent Safari textarea resize
11207			this.originalResizeStyle = this.originalElement.css( "resize" );
11208			this.originalElement.css( "resize", "none" );
11209
11210			this._proportionallyResizeElements.push( this.originalElement.css( {
11211				position: "static",
11212				zoom: 1,
11213				display: "block"
11214			} ) );
11215
11216			// Support: IE9
11217			// avoid IE jump (hard set the margin)
11218			this.originalElement.css( margins );
11219
11220			this._proportionallyResize();
11221		}
11222
11223		this._setupHandles();
11224
11225		if ( o.autoHide ) {
11226			$( this.element )
11227				.on( "mouseenter", function() {
11228					if ( o.disabled ) {
11229						return;
11230					}
11231					that._removeClass( "ui-resizable-autohide" );
11232					that._handles.show();
11233				} )
11234				.on( "mouseleave", function() {
11235					if ( o.disabled ) {
11236						return;
11237					}
11238					if ( !that.resizing ) {
11239						that._addClass( "ui-resizable-autohide" );
11240						that._handles.hide();
11241					}
11242				} );
11243		}
11244
11245		this._mouseInit();
11246	},
11247
11248	_destroy: function() {
11249
11250		this._mouseDestroy();
11251		this._addedHandles.remove();
11252
11253		var wrapper,
11254			_destroy = function( exp ) {
11255				$( exp )
11256					.removeData( "resizable" )
11257					.removeData( "ui-resizable" )
11258					.off( ".resizable" );
11259			};
11260
11261		// TODO: Unwrap at same DOM position
11262		if ( this.elementIsWrapper ) {
11263			_destroy( this.element );
11264			wrapper = this.element;
11265			this.originalElement.css( {
11266				position: wrapper.css( "position" ),
11267				width: wrapper.outerWidth(),
11268				height: wrapper.outerHeight(),
11269				top: wrapper.css( "top" ),
11270				left: wrapper.css( "left" )
11271			} ).insertAfter( wrapper );
11272			wrapper.remove();
11273		}
11274
11275		this.originalElement.css( "resize", this.originalResizeStyle );
11276		_destroy( this.originalElement );
11277
11278		return this;
11279	},
11280
11281	_setOption: function( key, value ) {
11282		this._super( key, value );
11283
11284		switch ( key ) {
11285		case "handles":
11286			this._removeHandles();
11287			this._setupHandles();
11288			break;
11289		case "aspectRatio":
11290			this._aspectRatio = !!value;
11291			break;
11292		default:
11293			break;
11294		}
11295	},
11296
11297	_setupHandles: function() {
11298		var o = this.options, handle, i, n, hname, axis, that = this;
11299		this.handles = o.handles ||
11300			( !$( ".ui-resizable-handle", this.element ).length ?
11301				"e,s,se" : {
11302					n: ".ui-resizable-n",
11303					e: ".ui-resizable-e",
11304					s: ".ui-resizable-s",
11305					w: ".ui-resizable-w",
11306					se: ".ui-resizable-se",
11307					sw: ".ui-resizable-sw",
11308					ne: ".ui-resizable-ne",
11309					nw: ".ui-resizable-nw"
11310				} );
11311
11312		this._handles = $();
11313		this._addedHandles = $();
11314		if ( this.handles.constructor === String ) {
11315
11316			if ( this.handles === "all" ) {
11317				this.handles = "n,e,s,w,se,sw,ne,nw";
11318			}
11319
11320			n = this.handles.split( "," );
11321			this.handles = {};
11322
11323			for ( i = 0; i < n.length; i++ ) {
11324
11325				handle = String.prototype.trim.call( n[ i ] );
11326				hname = "ui-resizable-" + handle;
11327				axis = $( "<div>" );
11328				this._addClass( axis, "ui-resizable-handle " + hname );
11329
11330				axis.css( { zIndex: o.zIndex } );
11331
11332				this.handles[ handle ] = ".ui-resizable-" + handle;
11333				if ( !this.element.children( this.handles[ handle ] ).length ) {
11334					this.element.append( axis );
11335					this._addedHandles = this._addedHandles.add( axis );
11336				}
11337			}
11338
11339		}
11340
11341		this._renderAxis = function( target ) {
11342
11343			var i, axis, padPos, padWrapper;
11344
11345			target = target || this.element;
11346
11347			for ( i in this.handles ) {
11348
11349				if ( this.handles[ i ].constructor === String ) {
11350					this.handles[ i ] = this.element.children( this.handles[ i ] ).first().show();
11351				} else if ( this.handles[ i ].jquery || this.handles[ i ].nodeType ) {
11352					this.handles[ i ] = $( this.handles[ i ] );
11353					this._on( this.handles[ i ], { "mousedown": that._mouseDown } );
11354				}
11355
11356				if ( this.elementIsWrapper &&
11357						this.originalElement[ 0 ]
11358							.nodeName
11359							.match( /^(textarea|input|select|button)$/i ) ) {
11360					axis = $( this.handles[ i ], this.element );
11361
11362					padWrapper = /sw|ne|nw|se|n|s/.test( i ) ?
11363						axis.outerHeight() :
11364						axis.outerWidth();
11365
11366					padPos = [ "padding",
11367						/ne|nw|n/.test( i ) ? "Top" :
11368						/se|sw|s/.test( i ) ? "Bottom" :
11369						/^e$/.test( i ) ? "Right" : "Left" ].join( "" );
11370
11371					target.css( padPos, padWrapper );
11372
11373					this._proportionallyResize();
11374				}
11375
11376				this._handles = this._handles.add( this.handles[ i ] );
11377			}
11378		};
11379
11380		// TODO: make renderAxis a prototype function
11381		this._renderAxis( this.element );
11382
11383		this._handles = this._handles.add( this.element.find( ".ui-resizable-handle" ) );
11384		this._handles.disableSelection();
11385
11386		this._handles.on( "mouseover", function() {
11387			if ( !that.resizing ) {
11388				if ( this.className ) {
11389					axis = this.className.match( /ui-resizable-(se|sw|ne|nw|n|e|s|w)/i );
11390				}
11391				that.axis = axis && axis[ 1 ] ? axis[ 1 ] : "se";
11392			}
11393		} );
11394
11395		if ( o.autoHide ) {
11396			this._handles.hide();
11397			this._addClass( "ui-resizable-autohide" );
11398		}
11399	},
11400
11401	_removeHandles: function() {
11402		this._addedHandles.remove();
11403	},
11404
11405	_mouseCapture: function( event ) {
11406		var i, handle,
11407			capture = false;
11408
11409		for ( i in this.handles ) {
11410			handle = $( this.handles[ i ] )[ 0 ];
11411			if ( handle === event.target || $.contains( handle, event.target ) ) {
11412				capture = true;
11413			}
11414		}
11415
11416		return !this.options.disabled && capture;
11417	},
11418
11419	_mouseStart: function( event ) {
11420
11421		var curleft, curtop, cursor,
11422			o = this.options,
11423			el = this.element;
11424
11425		this.resizing = true;
11426
11427		this._renderProxy();
11428
11429		curleft = this._num( this.helper.css( "left" ) );
11430		curtop = this._num( this.helper.css( "top" ) );
11431
11432		if ( o.containment ) {
11433			curleft += $( o.containment ).scrollLeft() || 0;
11434			curtop += $( o.containment ).scrollTop() || 0;
11435		}
11436
11437		this.offset = this.helper.offset();
11438		this.position = { left: curleft, top: curtop };
11439
11440		this.size = this._helper ? {
11441				width: this.helper.width(),
11442				height: this.helper.height()
11443			} : {
11444				width: el.width(),
11445				height: el.height()
11446			};
11447
11448		this.originalSize = this._helper ? {
11449				width: el.outerWidth(),
11450				height: el.outerHeight()
11451			} : {
11452				width: el.width(),
11453				height: el.height()
11454			};
11455
11456		this.sizeDiff = {
11457			width: el.outerWidth() - el.width(),
11458			height: el.outerHeight() - el.height()
11459		};
11460
11461		this.originalPosition = { left: curleft, top: curtop };
11462		this.originalMousePosition = { left: event.pageX, top: event.pageY };
11463
11464		this.aspectRatio = ( typeof o.aspectRatio === "number" ) ?
11465			o.aspectRatio :
11466			( ( this.originalSize.width / this.originalSize.height ) || 1 );
11467
11468		cursor = $( ".ui-resizable-" + this.axis ).css( "cursor" );
11469		$( "body" ).css( "cursor", cursor === "auto" ? this.axis + "-resize" : cursor );
11470
11471		this._addClass( "ui-resizable-resizing" );
11472		this._propagate( "start", event );
11473		return true;
11474	},
11475
11476	_mouseDrag: function( event ) {
11477
11478		var data, props,
11479			smp = this.originalMousePosition,
11480			a = this.axis,
11481			dx = ( event.pageX - smp.left ) || 0,
11482			dy = ( event.pageY - smp.top ) || 0,
11483			trigger = this._change[ a ];
11484
11485		this._updatePrevProperties();
11486
11487		if ( !trigger ) {
11488			return false;
11489		}
11490
11491		data = trigger.apply( this, [ event, dx, dy ] );
11492
11493		this._updateVirtualBoundaries( event.shiftKey );
11494		if ( this._aspectRatio || event.shiftKey ) {
11495			data = this._updateRatio( data, event );
11496		}
11497
11498		data = this._respectSize( data, event );
11499
11500		this._updateCache( data );
11501
11502		this._propagate( "resize", event );
11503
11504		props = this._applyChanges();
11505
11506		if ( !this._helper && this._proportionallyResizeElements.length ) {
11507			this._proportionallyResize();
11508		}
11509
11510		if ( !$.isEmptyObject( props ) ) {
11511			this._updatePrevProperties();
11512			this._trigger( "resize", event, this.ui() );
11513			this._applyChanges();
11514		}
11515
11516		return false;
11517	},
11518
11519	_mouseStop: function( event ) {
11520
11521		this.resizing = false;
11522		var pr, ista, soffseth, soffsetw, s, left, top,
11523			o = this.options, that = this;
11524
11525		if ( this._helper ) {
11526
11527			pr = this._proportionallyResizeElements;
11528			ista = pr.length && ( /textarea/i ).test( pr[ 0 ].nodeName );
11529			soffseth = ista && this._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height;
11530			soffsetw = ista ? 0 : that.sizeDiff.width;
11531
11532			s = {
11533				width: ( that.helper.width()  - soffsetw ),
11534				height: ( that.helper.height() - soffseth )
11535			};
11536			left = ( parseFloat( that.element.css( "left" ) ) +
11537				( that.position.left - that.originalPosition.left ) ) || null;
11538			top = ( parseFloat( that.element.css( "top" ) ) +
11539				( that.position.top - that.originalPosition.top ) ) || null;
11540
11541			if ( !o.animate ) {
11542				this.element.css( $.extend( s, { top: top, left: left } ) );
11543			}
11544
11545			that.helper.height( that.size.height );
11546			that.helper.width( that.size.width );
11547
11548			if ( this._helper && !o.animate ) {
11549				this._proportionallyResize();
11550			}
11551		}
11552
11553		$( "body" ).css( "cursor", "auto" );
11554
11555		this._removeClass( "ui-resizable-resizing" );
11556
11557		this._propagate( "stop", event );
11558
11559		if ( this._helper ) {
11560			this.helper.remove();
11561		}
11562
11563		return false;
11564
11565	},
11566
11567	_updatePrevProperties: function() {
11568		this.prevPosition = {
11569			top: this.position.top,
11570			left: this.position.left
11571		};
11572		this.prevSize = {
11573			width: this.size.width,
11574			height: this.size.height
11575		};
11576	},
11577
11578	_applyChanges: function() {
11579		var props = {};
11580
11581		if ( this.position.top !== this.prevPosition.top ) {
11582			props.top = this.position.top + "px";
11583		}
11584		if ( this.position.left !== this.prevPosition.left ) {
11585			props.left = this.position.left + "px";
11586		}
vendor: 15,404 bytes, lines 11587-12179
11587		if ( this.size.width !== this.prevSize.width ) {
11588			props.width = this.size.width + "px";
11589		}
11590		if ( this.size.height !== this.prevSize.height ) {
11591			props.height = this.size.height + "px";
11592		}
11593
11594		this.helper.css( props );
11595
11596		return props;
11597	},
11598
11599	_updateVirtualBoundaries: function( forceAspectRatio ) {
11600		var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
11601			o = this.options;
11602
11603		b = {
11604			minWidth: this._isNumber( o.minWidth ) ? o.minWidth : 0,
11605			maxWidth: this._isNumber( o.maxWidth ) ? o.maxWidth : Infinity,
11606			minHeight: this._isNumber( o.minHeight ) ? o.minHeight : 0,
11607			maxHeight: this._isNumber( o.maxHeight ) ? o.maxHeight : Infinity
11608		};
11609
11610		if ( this._aspectRatio || forceAspectRatio ) {
11611			pMinWidth = b.minHeight * this.aspectRatio;
11612			pMinHeight = b.minWidth / this.aspectRatio;
11613			pMaxWidth = b.maxHeight * this.aspectRatio;
11614			pMaxHeight = b.maxWidth / this.aspectRatio;
11615
11616			if ( pMinWidth > b.minWidth ) {
11617				b.minWidth = pMinWidth;
11618			}
11619			if ( pMinHeight > b.minHeight ) {
11620				b.minHeight = pMinHeight;
11621			}
11622			if ( pMaxWidth < b.maxWidth ) {
11623				b.maxWidth = pMaxWidth;
11624			}
11625			if ( pMaxHeight < b.maxHeight ) {
11626				b.maxHeight = pMaxHeight;
11627			}
11628		}
11629		this._vBoundaries = b;
11630	},
11631
11632	_updateCache: function( data ) {
11633		this.offset = this.helper.offset();
11634		if ( this._isNumber( data.left ) ) {
11635			this.position.left = data.left;
11636		}
11637		if ( this._isNumber( data.top ) ) {
11638			this.position.top = data.top;
11639		}
11640		if ( this._isNumber( data.height ) ) {
11641			this.size.height = data.height;
11642		}
11643		if ( this._isNumber( data.width ) ) {
11644			this.size.width = data.width;
11645		}
11646	},
11647
11648	_updateRatio: function( data ) {
11649
11650		var cpos = this.position,
11651			csize = this.size,
11652			a = this.axis;
11653
11654		if ( this._isNumber( data.height ) ) {
11655			data.width = ( data.height * this.aspectRatio );
11656		} else if ( this._isNumber( data.width ) ) {
11657			data.height = ( data.width / this.aspectRatio );
11658		}
11659
11660		if ( a === "sw" ) {
11661			data.left = cpos.left + ( csize.width - data.width );
11662			data.top = null;
11663		}
11664		if ( a === "nw" ) {
11665			data.top = cpos.top + ( csize.height - data.height );
11666			data.left = cpos.left + ( csize.width - data.width );
11667		}
11668
11669		return data;
11670	},
11671
11672	_respectSize: function( data ) {
11673
11674		var o = this._vBoundaries,
11675			a = this.axis,
11676			ismaxw = this._isNumber( data.width ) && o.maxWidth && ( o.maxWidth < data.width ),
11677			ismaxh = this._isNumber( data.height ) && o.maxHeight && ( o.maxHeight < data.height ),
11678			isminw = this._isNumber( data.width ) && o.minWidth && ( o.minWidth > data.width ),
11679			isminh = this._isNumber( data.height ) && o.minHeight && ( o.minHeight > data.height ),
11680			dw = this.originalPosition.left + this.originalSize.width,
11681			dh = this.originalPosition.top + this.originalSize.height,
11682			cw = /sw|nw|w/.test( a ), ch = /nw|ne|n/.test( a );
11683		if ( isminw ) {
11684			data.width = o.minWidth;
11685		}
11686		if ( isminh ) {
11687			data.height = o.minHeight;
11688		}
11689		if ( ismaxw ) {
11690			data.width = o.maxWidth;
11691		}
11692		if ( ismaxh ) {
11693			data.height = o.maxHeight;
11694		}
11695
11696		if ( isminw && cw ) {
11697			data.left = dw - o.minWidth;
11698		}
11699		if ( ismaxw && cw ) {
11700			data.left = dw - o.maxWidth;
11701		}
11702		if ( isminh && ch ) {
11703			data.top = dh - o.minHeight;
11704		}
11705		if ( ismaxh && ch ) {
11706			data.top = dh - o.maxHeight;
11707		}
11708
11709		// Fixing jump error on top/left - bug #2330
11710		if ( !data.width && !data.height && !data.left && data.top ) {
11711			data.top = null;
11712		} else if ( !data.width && !data.height && !data.top && data.left ) {
11713			data.left = null;
11714		}
11715
11716		return data;
11717	},
11718
11719	_getPaddingPlusBorderDimensions: function( element ) {
11720		var i = 0,
11721			widths = [],
11722			borders = [
11723				element.css( "borderTopWidth" ),
11724				element.css( "borderRightWidth" ),
11725				element.css( "borderBottomWidth" ),
11726				element.css( "borderLeftWidth" )
11727			],
11728			paddings = [
11729				element.css( "paddingTop" ),
11730				element.css( "paddingRight" ),
11731				element.css( "paddingBottom" ),
11732				element.css( "paddingLeft" )
11733			];
11734
11735		for ( ; i < 4; i++ ) {
11736			widths[ i ] = ( parseFloat( borders[ i ] ) || 0 );
11737			widths[ i ] += ( parseFloat( paddings[ i ] ) || 0 );
11738		}
11739
11740		return {
11741			height: widths[ 0 ] + widths[ 2 ],
11742			width: widths[ 1 ] + widths[ 3 ]
11743		};
11744	},
11745
11746	_proportionallyResize: function() {
11747
11748		if ( !this._proportionallyResizeElements.length ) {
11749			return;
11750		}
11751
11752		var prel,
11753			i = 0,
11754			element = this.helper || this.element;
11755
11756		for ( ; i < this._proportionallyResizeElements.length; i++ ) {
11757
11758			prel = this._proportionallyResizeElements[ i ];
11759
11760			// TODO: Seems like a bug to cache this.outerDimensions
11761			// considering that we are in a loop.
11762			if ( !this.outerDimensions ) {
11763				this.outerDimensions = this._getPaddingPlusBorderDimensions( prel );
11764			}
11765
11766			prel.css( {
11767				height: ( element.height() - this.outerDimensions.height ) || 0,
11768				width: ( element.width() - this.outerDimensions.width ) || 0
11769			} );
11770
11771		}
11772
11773	},
11774
11775	_renderProxy: function() {
11776
11777		var el = this.element, o = this.options;
11778		this.elementOffset = el.offset();
11779
11780		if ( this._helper ) {
11781
11782			this.helper = this.helper || $( "<div></div>" ).css( { overflow: "hidden" } );
11783
11784			this._addClass( this.helper, this._helper );
11785			this.helper.css( {
11786				width: this.element.outerWidth(),
11787				height: this.element.outerHeight(),
11788				position: "absolute",
11789				left: this.elementOffset.left + "px",
11790				top: this.elementOffset.top + "px",
11791				zIndex: ++o.zIndex //TODO: Don't modify option
11792			} );
11793
11794			this.helper
11795				.appendTo( "body" )
11796				.disableSelection();
11797
11798		} else {
11799			this.helper = this.element;
11800		}
11801
11802	},
11803
11804	_change: {
11805		e: function( event, dx ) {
11806			return { width: this.originalSize.width + dx };
11807		},
11808		w: function( event, dx ) {
11809			var cs = this.originalSize, sp = this.originalPosition;
11810			return { left: sp.left + dx, width: cs.width - dx };
11811		},
11812		n: function( event, dx, dy ) {
11813			var cs = this.originalSize, sp = this.originalPosition;
11814			return { top: sp.top + dy, height: cs.height - dy };
11815		},
11816		s: function( event, dx, dy ) {
11817			return { height: this.originalSize.height + dy };
11818		},
11819		se: function( event, dx, dy ) {
11820			return $.extend( this._change.s.apply( this, arguments ),
11821				this._change.e.apply( this, [ event, dx, dy ] ) );
11822		},
11823		sw: function( event, dx, dy ) {
11824			return $.extend( this._change.s.apply( this, arguments ),
11825				this._change.w.apply( this, [ event, dx, dy ] ) );
11826		},
11827		ne: function( event, dx, dy ) {
11828			return $.extend( this._change.n.apply( this, arguments ),
11829				this._change.e.apply( this, [ event, dx, dy ] ) );
11830		},
11831		nw: function( event, dx, dy ) {
11832			return $.extend( this._change.n.apply( this, arguments ),
11833				this._change.w.apply( this, [ event, dx, dy ] ) );
11834		}
11835	},
11836
11837	_propagate: function( n, event ) {
11838		$.ui.plugin.call( this, n, [ event, this.ui() ] );
11839		if ( n !== "resize" ) {
11840			this._trigger( n, event, this.ui() );
11841		}
11842	},
11843
11844	plugins: {},
11845
11846	ui: function() {
11847		return {
11848			originalElement: this.originalElement,
11849			element: this.element,
11850			helper: this.helper,
11851			position: this.position,
11852			size: this.size,
11853			originalSize: this.originalSize,
11854			originalPosition: this.originalPosition
11855		};
11856	}
11857
11858} );
11859
11860/*
11861 * Resizable Extensions
11862 */
11863
11864$.ui.plugin.add( "resizable", "animate", {
11865
11866	stop: function( event ) {
11867		var that = $( this ).resizable( "instance" ),
11868			o = that.options,
11869			pr = that._proportionallyResizeElements,
11870			ista = pr.length && ( /textarea/i ).test( pr[ 0 ].nodeName ),
11871			soffseth = ista && that._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height,
11872			soffsetw = ista ? 0 : that.sizeDiff.width,
11873			style = {
11874				width: ( that.size.width - soffsetw ),
11875				height: ( that.size.height - soffseth )
11876			},
11877			left = ( parseFloat( that.element.css( "left" ) ) +
11878				( that.position.left - that.originalPosition.left ) ) || null,
11879			top = ( parseFloat( that.element.css( "top" ) ) +
11880				( that.position.top - that.originalPosition.top ) ) || null;
11881
11882		that.element.animate(
11883			$.extend( style, top && left ? { top: top, left: left } : {} ), {
11884				duration: o.animateDuration,
11885				easing: o.animateEasing,
11886				step: function() {
11887
11888					var data = {
11889						width: parseFloat( that.element.css( "width" ) ),
11890						height: parseFloat( that.element.css( "height" ) ),
11891						top: parseFloat( that.element.css( "top" ) ),
11892						left: parseFloat( that.element.css( "left" ) )
11893					};
11894
11895					if ( pr && pr.length ) {
11896						$( pr[ 0 ] ).css( { width: data.width, height: data.height } );
11897					}
11898
11899					// Propagating resize, and updating values for each animation step
11900					that._updateCache( data );
11901					that._propagate( "resize", event );
11902
11903				}
11904			}
11905		);
11906	}
11907
11908} );
11909
11910$.ui.plugin.add( "resizable", "containment", {
11911
11912	start: function() {
11913		var element, p, co, ch, cw, width, height,
11914			that = $( this ).resizable( "instance" ),
11915			o = that.options,
11916			el = that.element,
11917			oc = o.containment,
11918			ce = ( oc instanceof $ ) ?
11919				oc.get( 0 ) :
11920				( /parent/.test( oc ) ) ? el.parent().get( 0 ) : oc;
11921
11922		if ( !ce ) {
11923			return;
11924		}
11925
11926		that.containerElement = $( ce );
11927
11928		if ( /document/.test( oc ) || oc === document ) {
11929			that.containerOffset = {
11930				left: 0,
11931				top: 0
11932			};
11933			that.containerPosition = {
11934				left: 0,
11935				top: 0
11936			};
11937
11938			that.parentData = {
11939				element: $( document ),
11940				left: 0,
11941				top: 0,
11942				width: $( document ).width(),
11943				height: $( document ).height() || document.body.parentNode.scrollHeight
11944			};
11945		} else {
11946			element = $( ce );
11947			p = [];
11948			$( [ "Top", "Right", "Left", "Bottom" ] ).each( function( i, name ) {
11949				p[ i ] = that._num( element.css( "padding" + name ) );
11950			} );
11951
11952			that.containerOffset = element.offset();
11953			that.containerPosition = element.position();
11954			that.containerSize = {
11955				height: ( element.innerHeight() - p[ 3 ] ),
11956				width: ( element.innerWidth() - p[ 1 ] )
11957			};
11958
11959			co = that.containerOffset;
11960			ch = that.containerSize.height;
11961			cw = that.containerSize.width;
11962			width = ( that._hasScroll( ce, "left" ) ? ce.scrollWidth : cw );
11963			height = ( that._hasScroll( ce ) ? ce.scrollHeight : ch );
11964
11965			that.parentData = {
11966				element: ce,
11967				left: co.left,
11968				top: co.top,
11969				width: width,
11970				height: height
11971			};
11972		}
11973	},
11974
11975	resize: function( event ) {
11976		var woset, hoset, isParent, isOffsetRelative,
11977			that = $( this ).resizable( "instance" ),
11978			o = that.options,
11979			co = that.containerOffset,
11980			cp = that.position,
11981			pRatio = that._aspectRatio || event.shiftKey,
11982			cop = {
11983				top: 0,
11984				left: 0
11985			},
11986			ce = that.containerElement,
11987			continueResize = true;
11988
11989		if ( ce[ 0 ] !== document && ( /static/ ).test( ce.css( "position" ) ) ) {
11990			cop = co;
11991		}
11992
11993		if ( cp.left < ( that._helper ? co.left : 0 ) ) {
11994			that.size.width = that.size.width +
11995				( that._helper ?
11996					( that.position.left - co.left ) :
11997					( that.position.left - cop.left ) );
11998
11999			if ( pRatio ) {
12000				that.size.height = that.size.width / that.aspectRatio;
12001				continueResize = false;
12002			}
12003			that.position.left = o.helper ? co.left : 0;
12004		}
12005
12006		if ( cp.top < ( that._helper ? co.top : 0 ) ) {
12007			that.size.height = that.size.height +
12008				( that._helper ?
12009					( that.position.top - co.top ) :
12010					that.position.top );
12011
12012			if ( pRatio ) {
12013				that.size.width = that.size.height * that.aspectRatio;
12014				continueResize = false;
12015			}
12016			that.position.top = that._helper ? co.top : 0;
12017		}
12018
12019		isParent = that.containerElement.get( 0 ) === that.element.parent().get( 0 );
12020		isOffsetRelative = /relative|absolute/.test( that.containerElement.css( "position" ) );
12021
12022		if ( isParent && isOffsetRelative ) {
12023			that.offset.left = that.parentData.left + that.position.left;
12024			that.offset.top = that.parentData.top + that.position.top;
12025		} else {
12026			that.offset.left = that.element.offset().left;
12027			that.offset.top = that.element.offset().top;
12028		}
12029
12030		woset = Math.abs( that.sizeDiff.width +
12031			( that._helper ?
12032				that.offset.left - cop.left :
12033				( that.offset.left - co.left ) ) );
12034
12035		hoset = Math.abs( that.sizeDiff.height +
12036			( that._helper ?
12037				that.offset.top - cop.top :
12038				( that.offset.top - co.top ) ) );
12039
12040		if ( woset + that.size.width >= that.parentData.width ) {
12041			that.size.width = that.parentData.width - woset;
12042			if ( pRatio ) {
12043				that.size.height = that.size.width / that.aspectRatio;
12044				continueResize = false;
12045			}
12046		}
12047
12048		if ( hoset + that.size.height >= that.parentData.height ) {
12049			that.size.height = that.parentData.height - hoset;
12050			if ( pRatio ) {
12051				that.size.width = that.size.height * that.aspectRatio;
12052				continueResize = false;
12053			}
12054		}
12055
12056		if ( !continueResize ) {
12057			that.position.left = that.prevPosition.left;
12058			that.position.top = that.prevPosition.top;
12059			that.size.width = that.prevSize.width;
12060			that.size.height = that.prevSize.height;
12061		}
12062	},
12063
12064	stop: function() {
12065		var that = $( this ).resizable( "instance" ),
12066			o = that.options,
12067			co = that.containerOffset,
12068			cop = that.containerPosition,
12069			ce = that.containerElement,
12070			helper = $( that.helper ),
12071			ho = helper.offset(),
12072			w = helper.outerWidth() - that.sizeDiff.width,
12073			h = helper.outerHeight() - that.sizeDiff.height;
12074
12075		if ( that._helper && !o.animate && ( /relative/ ).test( ce.css( "position" ) ) ) {
12076			$( this ).css( {
12077				left: ho.left - cop.left - co.left,
12078				width: w,
12079				height: h
12080			} );
12081		}
12082
12083		if ( that._helper && !o.animate && ( /static/ ).test( ce.css( "position" ) ) ) {
12084			$( this ).css( {
12085				left: ho.left - cop.left - co.left,
12086				width: w,
12087				height: h
12088			} );
12089		}
12090	}
12091} );
12092
12093$.ui.plugin.add( "resizable", "alsoResize", {
12094
12095	start: function() {
12096		var that = $( this ).resizable( "instance" ),
12097			o = that.options;
12098
12099		$( o.alsoResize ).each( function() {
12100			var el = $( this );
12101			el.data( "ui-resizable-alsoresize", {
12102				width: parseFloat( el.width() ), height: parseFloat( el.height() ),
12103				left: parseFloat( el.css( "left" ) ), top: parseFloat( el.css( "top" ) )
12104			} );
12105		} );
12106	},
12107
12108	resize: function( event, ui ) {
12109		var that = $( this ).resizable( "instance" ),
12110			o = that.options,
12111			os = that.originalSize,
12112			op = that.originalPosition,
12113			delta = {
12114				height: ( that.size.height - os.height ) || 0,
12115				width: ( that.size.width - os.width ) || 0,
12116				top: ( that.position.top - op.top ) || 0,
12117				left: ( that.position.left - op.left ) || 0
12118			};
12119
12120			$( o.alsoResize ).each( function() {
12121				var el = $( this ), start = $( this ).data( "ui-resizable-alsoresize" ), style = {},
12122					css = el.parents( ui.originalElement[ 0 ] ).length ?
12123							[ "width", "height" ] :
12124							[ "width", "height", "top", "left" ];
12125
12126				$.each( css, function( i, prop ) {
12127					var sum = ( start[ prop ] || 0 ) + ( delta[ prop ] || 0 );
12128					if ( sum && sum >= 0 ) {
12129						style[ prop ] = sum || null;
12130					}
12131				} );
12132
12133				el.css( style );
12134			} );
12135	},
12136
12137	stop: function() {
12138		$( this ).removeData( "ui-resizable-alsoresize" );
12139	}
12140} );
12141
12142$.ui.plugin.add( "resizable", "ghost", {
12143
12144	start: function() {
12145
12146		var that = $( this ).resizable( "instance" ), cs = that.size;
12147
12148		that.ghost = that.originalElement.clone();
12149		that.ghost.css( {
12150			opacity: 0.25,
12151			display: "block",
12152			position: "relative",
12153			height: cs.height,
12154			width: cs.width,
12155			margin: 0,
12156			left: 0,
12157			top: 0
12158		} );
12159
12160		that._addClass( that.ghost, "ui-resizable-ghost" );
12161
12162		// DEPRECATED
12163		// TODO: remove after 1.12
12164		if ( $.uiBackCompat !== false && typeof that.options.ghost === "string" ) {
12165
12166			// Ghost option
12167			that.ghost.addClass( this.options.ghost );
12168		}
12169
12170		that.ghost.appendTo( that.helper );
12171
12172	},
12173
12174	resize: function() {
12175		var that = $( this ).resizable( "instance" );
12176		if ( that.ghost ) {
12177			that.ghost.css( {
12178				position: "relative",
12179				height: that.size.height,
vendor: 2,863 bytes, lines 12180-12291
12180				width: that.size.width
12181			} );
12182		}
12183	},
12184
12185	stop: function() {
12186		var that = $( this ).resizable( "instance" );
12187		if ( that.ghost && that.helper ) {
12188			that.helper.get( 0 ).removeChild( that.ghost.get( 0 ) );
12189		}
12190	}
12191
12192} );
12193
12194$.ui.plugin.add( "resizable", "grid", {
12195
12196	resize: function() {
12197		var outerDimensions,
12198			that = $( this ).resizable( "instance" ),
12199			o = that.options,
12200			cs = that.size,
12201			os = that.originalSize,
12202			op = that.originalPosition,
12203			a = that.axis,
12204			grid = typeof o.grid === "number" ? [ o.grid, o.grid ] : o.grid,
12205			gridX = ( grid[ 0 ] || 1 ),
12206			gridY = ( grid[ 1 ] || 1 ),
12207			ox = Math.round( ( cs.width - os.width ) / gridX ) * gridX,
12208			oy = Math.round( ( cs.height - os.height ) / gridY ) * gridY,
12209			newWidth = os.width + ox,
12210			newHeight = os.height + oy,
12211			isMaxWidth = o.maxWidth && ( o.maxWidth < newWidth ),
12212			isMaxHeight = o.maxHeight && ( o.maxHeight < newHeight ),
12213			isMinWidth = o.minWidth && ( o.minWidth > newWidth ),
12214			isMinHeight = o.minHeight && ( o.minHeight > newHeight );
12215
12216		o.grid = grid;
12217
12218		if ( isMinWidth ) {
12219			newWidth += gridX;
12220		}
12221		if ( isMinHeight ) {
12222			newHeight += gridY;
12223		}
12224		if ( isMaxWidth ) {
12225			newWidth -= gridX;
12226		}
12227		if ( isMaxHeight ) {
12228			newHeight -= gridY;
12229		}
12230
12231		if ( /^(se|s|e)$/.test( a ) ) {
12232			that.size.width = newWidth;
12233			that.size.height = newHeight;
12234		} else if ( /^(ne)$/.test( a ) ) {
12235			that.size.width = newWidth;
12236			that.size.height = newHeight;
12237			that.position.top = op.top - oy;
12238		} else if ( /^(sw)$/.test( a ) ) {
12239			that.size.width = newWidth;
12240			that.size.height = newHeight;
12241			that.position.left = op.left - ox;
12242		} else {
12243			if ( newHeight - gridY <= 0 || newWidth - gridX <= 0 ) {
12244				outerDimensions = that._getPaddingPlusBorderDimensions( this );
12245			}
12246
12247			if ( newHeight - gridY > 0 ) {
12248				that.size.height = newHeight;
12249				that.position.top = op.top - oy;
12250			} else {
12251				newHeight = gridY - outerDimensions.height;
12252				that.size.height = newHeight;
12253				that.position.top = op.top + os.height - newHeight;
12254			}
12255			if ( newWidth - gridX > 0 ) {
12256				that.size.width = newWidth;
12257				that.position.left = op.left - ox;
12258			} else {
12259				newWidth = gridX - outerDimensions.width;
12260				that.size.width = newWidth;
12261				that.position.left = op.left + os.width - newWidth;
12262			}
12263		}
12264	}
12265
12266} );
12267
12268var widgetsResizable = $.ui.resizable;
12269
12270
12271/*!
12272 * jQuery UI Dialog 1.13.2
12273 * http://jqueryui.com
12274 *
12275 * Copyright jQuery Foundation and other contributors
12276 * Released under the MIT license.
12277 * http://jquery.org/license
12278 */
12279
12280//>>label: Dialog
12281//>>group: Widgets
12282//>>description: Displays customizable dialog windows.
12283//>>docs: http://api.jqueryui.com/dialog/
12284//>>demos: http://jqueryui.com/dialog/
12285//>>css.structure: ../../themes/base/core.css
12286//>>css.structure: ../../themes/base/dialog.css
12287//>>css.theme: ../../themes/base/theme.css
12288
12289
12290$.widget( "ui.dialog", {
12291	version: "1.13.2
vendor: 20,928 bytes, lines 12291-13125
12291",
12292	options: {
12293		appendTo: "body",
12294		autoOpen: true,
12295		buttons: [],
12296		classes: {
12297			"ui-dialog": "ui-corner-all",
12298			"ui-dialog-titlebar": "ui-corner-all"
12299		},
12300		closeOnEscape: true,
12301		closeText: "Close",
12302		draggable: true,
12303		hide: null,
12304		height: "auto",
12305		maxHeight: null,
12306		maxWidth: null,
12307		minHeight: 150,
12308		minWidth: 150,
12309		modal: false,
12310		position: {
12311			my: "center",
12312			at: "center",
12313			of: window,
12314			collision: "fit",
12315
12316			// Ensure the titlebar is always visible
12317			using: function( pos ) {
12318				var topOffset = $( this ).css( pos ).offset().top;
12319				if ( topOffset < 0 ) {
12320					$( this ).css( "top", pos.top - topOffset );
12321				}
12322			}
12323		},
12324		resizable: true,
12325		show: null,
12326		title: null,
12327		width: 300,
12328
12329		// Callbacks
12330		beforeClose: null,
12331		close: null,
12332		drag: null,
12333		dragStart: null,
12334		dragStop: null,
12335		focus: null,
12336		open: null,
12337		resize: null,
12338		resizeStart: null,
12339		resizeStop: null
12340	},
12341
12342	sizeRelatedOptions: {
12343		buttons: true,
12344		height: true,
12345		maxHeight: true,
12346		maxWidth: true,
12347		minHeight: true,
12348		minWidth: true,
12349		width: true
12350	},
12351
12352	resizableRelatedOptions: {
12353		maxHeight: true,
12354		maxWidth: true,
12355		minHeight: true,
12356		minWidth: true
12357	},
12358
12359	_create: function() {
12360		this.originalCss = {
12361			display: this.element[ 0 ].style.display,
12362			width: this.element[ 0 ].style.width,
12363			minHeight: this.element[ 0 ].style.minHeight,
12364			maxHeight: this.element[ 0 ].style.maxHeight,
12365			height: this.element[ 0 ].style.height
12366		};
12367		this.originalPosition = {
12368			parent: this.element.parent(),
12369			index: this.element.parent().children().index( this.element )
12370		};
12371		this.originalTitle = this.element.attr( "title" );
12372		if ( this.options.title == null && this.originalTitle != null ) {
12373			this.options.title = this.originalTitle;
12374		}
12375
12376		// Dialogs can't be disabled
12377		if ( this.options.disabled ) {
12378			this.options.disabled = false;
12379		}
12380
12381		this._createWrapper();
12382
12383		this.element
12384			.show()
12385			.removeAttr( "title" )
12386			.appendTo( this.uiDialog );
12387
12388		this._addClass( "ui-dialog-content", "ui-widget-content" );
12389
12390		this._createTitlebar();
12391		this._createButtonPane();
12392
12393		if ( this.options.draggable && $.fn.draggable ) {
12394			this._makeDraggable();
12395		}
12396		if ( this.options.resizable && $.fn.resizable ) {
12397			this._makeResizable();
12398		}
12399
12400		this._isOpen = false;
12401
12402		this._trackFocus();
12403	},
12404
12405	_init: function() {
12406		if ( this.options.autoOpen ) {
12407			this.open();
12408		}
12409	},
12410
12411	_appendTo: function() {
12412		var element = this.options.appendTo;
12413		if ( element && ( element.jquery || element.nodeType ) ) {
12414			return $( element );
12415		}
12416		return this.document.find( element || "body" ).eq( 0 );
12417	},
12418
12419	_destroy: function() {
12420		var next,
12421			originalPosition = this.originalPosition;
12422
12423		this._untrackInstance();
12424		this._destroyOverlay();
12425
12426		this.element
12427			.removeUniqueId()
12428			.css( this.originalCss )
12429
12430			// Without detaching first, the following becomes really slow
12431			.detach();
12432
12433		this.uiDialog.remove();
12434
12435		if ( this.originalTitle ) {
12436			this.element.attr( "title", this.originalTitle );
12437		}
12438
12439		next = originalPosition.parent.children().eq( originalPosition.index );
12440
12441		// Don't try to place the dialog next to itself (#8613)
12442		if ( next.length && next[ 0 ] !== this.element[ 0 ] ) {
12443			next.before( this.element );
12444		} else {
12445			originalPosition.parent.append( this.element );
12446		}
12447	},
12448
12449	widget: function() {
12450		return this.uiDialog;
12451	},
12452
12453	disable: $.noop,
12454	enable: $.noop,
12455
12456	close: function( event ) {
12457		var that = this;
12458
12459		if ( !this._isOpen || this._trigger( "beforeClose", event ) === false ) {
12460			return;
12461		}
12462
12463		this._isOpen = false;
12464		this._focusedElement = null;
12465		this._destroyOverlay();
12466		this._untrackInstance();
12467
12468		if ( !this.opener.filter( ":focusable" ).trigger( "focus" ).length ) {
12469
12470			// Hiding a focused element doesn't trigger blur in WebKit
12471			// so in case we have nothing to focus on, explicitly blur the active element
12472			// https://bugs.webkit.org/show_bug.cgi?id=47182
12473			$.ui.safeBlur( $.ui.safeActiveElement( this.document[ 0 ] ) );
12474		}
12475
12476		this._hide( this.uiDialog, this.options.hide, function() {
12477			that._trigger( "close", event );
12478		} );
12479	},
12480
12481	isOpen: function() {
12482		return this._isOpen;
12483	},
12484
12485	moveToTop: function() {
12486		this._moveToTop();
12487	},
12488
12489	_moveToTop: function( event, silent ) {
12490		var moved = false,
12491			zIndices = this.uiDialog.siblings( ".ui-front:visible" ).map( function() {
12492				return +$( this ).css( "z-index" );
12493			} ).get(),
12494			zIndexMax = Math.max.apply( null, zIndices );
12495
12496		if ( zIndexMax >= +this.uiDialog.css( "z-index" ) ) {
12497			this.uiDialog.css( "z-index", zIndexMax + 1 );
12498			moved = true;
12499		}
12500
12501		if ( moved && !silent ) {
12502			this._trigger( "focus", event );
12503		}
12504		return moved;
12505	},
12506
12507	open: function() {
12508		var that = this;
12509		if ( this._isOpen ) {
12510			if ( this._moveToTop() ) {
12511				this._focusTabbable();
12512			}
12513			return;
12514		}
12515
12516		this._isOpen = true;
12517		this.opener = $( $.ui.safeActiveElement( this.document[ 0 ] ) );
12518
12519		this._size();
12520		this._position();
12521		this._createOverlay();
12522		this._moveToTop( null, true );
12523
12524		// Ensure the overlay is moved to the top with the dialog, but only when
12525		// opening. The overlay shouldn't move after the dialog is open so that
12526		// modeless dialogs opened after the modal dialog stack properly.
12527		if ( this.overlay ) {
12528			this.overlay.css( "z-index", this.uiDialog.css( "z-index" ) - 1 );
12529		}
12530
12531		this._show( this.uiDialog, this.options.show, function() {
12532			that._focusTabbable();
12533			that._trigger( "focus" );
12534		} );
12535
12536		// Track the dialog immediately upon opening in case a focus event
12537		// somehow occurs outside of the dialog before an element inside the
12538		// dialog is focused (#10152)
12539		this._makeFocusTarget();
12540
12541		this._trigger( "open" );
12542	},
12543
12544	_focusTabbable: function() {
12545
12546		// Set focus to the first match:
12547		// 1. An element that was focused previously
12548		// 2. First element inside the dialog matching [autofocus]
12549		// 3. Tabbable element inside the content element
12550		// 4. Tabbable element inside the buttonpane
12551		// 5. The close button
12552		// 6. The dialog itself
12553		var hasFocus = this._focusedElement;
12554		if ( !hasFocus ) {
12555			hasFocus = this.element.find( "[autofocus]" );
12556		}
12557		if ( !hasFocus.length ) {
12558			hasFocus = this.element.find( ":tabbable" );
12559		}
12560		if ( !hasFocus.length ) {
12561			hasFocus = this.uiDialogButtonPane.find( ":tabbable" );
12562		}
12563		if ( !hasFocus.length ) {
12564			hasFocus = this.uiDialogTitlebarClose.filter( ":tabbable" );
12565		}
12566		if ( !hasFocus.length ) {
12567			hasFocus = this.uiDialog;
12568		}
12569		hasFocus.eq( 0 ).trigger( "focus" );
12570	},
12571
12572	_restoreTabbableFocus: function() {
12573		var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ),
12574			isActive = this.uiDialog[ 0 ] === activeElement ||
12575				$.contains( this.uiDialog[ 0 ], activeElement );
12576		if ( !isActive ) {
12577			this._focusTabbable();
12578		}
12579	},
12580
12581	_keepFocus: function( event ) {
12582		event.preventDefault();
12583		this._restoreTabbableFocus();
12584
12585		// support: IE
12586		// IE <= 8 doesn't prevent moving focus even with event.preventDefault()
12587		// so we check again later
12588		this._delay( this._restoreTabbableFocus );
12589	},
12590
12591	_createWrapper: function() {
12592		this.uiDialog = $( "<div>" )
12593			.hide()
12594			.attr( {
12595
12596				// Setting tabIndex makes the div focusable
12597				tabIndex: -1,
12598				role: "dialog"
12599			} )
12600			.appendTo( this._appendTo() );
12601
12602		this._addClass( this.uiDialog, "ui-dialog", "ui-widget ui-widget-content ui-front" );
12603		this._on( this.uiDialog, {
12604			keydown: function( event ) {
12605				if ( this.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
12606						event.keyCode === $.ui.keyCode.ESCAPE ) {
12607					event.preventDefault();
12608					this.close( event );
12609					return;
12610				}
12611
12612				// Prevent tabbing out of dialogs
12613				if ( event.keyCode !== $.ui.keyCode.TAB || event.isDefaultPrevented() ) {
12614					return;
12615				}
12616				var tabbables = this.uiDialog.find( ":tabbable" ),
12617					first = tabbables.first(),
12618					last = tabbables.last();
12619
12620				if ( ( event.target === last[ 0 ] || event.target === this.uiDialog[ 0 ] ) &&
12621						!event.shiftKey ) {
12622					this._delay( function() {
12623						first.trigger( "focus" );
12624					} );
12625					event.preventDefault();
12626				} else if ( ( event.target === first[ 0 ] ||
12627						event.target === this.uiDialog[ 0 ] ) && event.shiftKey ) {
12628					this._delay( function() {
12629						last.trigger( "focus" );
12630					} );
12631					event.preventDefault();
12632				}
12633			},
12634			mousedown: function( event ) {
12635				if ( this._moveToTop( event ) ) {
12636					this._focusTabbable();
12637				}
12638			}
12639		} );
12640
12641		// We assume that any existing aria-describedby attribute means
12642		// that the dialog content is marked up properly
12643		// otherwise we brute force the content as the description
12644		if ( !this.element.find( "[aria-describedby]" ).length ) {
12645			this.uiDialog.attr( {
12646				"aria-describedby": this.element.uniqueId().attr( "id" )
12647			} );
12648		}
12649	},
12650
12651	_createTitlebar: function() {
12652		var uiDialogTitle;
12653
12654		this.uiDialogTitlebar = $( "<div>" );
12655		this._addClass( this.uiDialogTitlebar,
12656			"ui-dialog-titlebar", "ui-widget-header ui-helper-clearfix" );
12657		this._on( this.uiDialogTitlebar, {
12658			mousedown: function( event ) {
12659
12660				// Don't prevent click on close button (#8838)
12661				// Focusing a dialog that is partially scrolled out of view
12662				// causes the browser to scroll it into view, preventing the click event
12663				if ( !$( event.target ).closest( ".ui-dialog-titlebar-close" ) ) {
12664
12665					// Dialog isn't getting focus when dragging (#8063)
12666					this.uiDialog.trigger( "focus" );
12667				}
12668			}
12669		} );
12670
12671		// Support: IE
12672		// Use type="button" to prevent enter keypresses in textboxes from closing the
12673		// dialog in IE (#9312)
12674		this.uiDialogTitlebarClose = $( "<button type='button'></button>" )
12675			.button( {
12676				label: $( "<a>" ).text( this.options.closeText ).html(),
12677				icon: "ui-icon-closethick",
12678				showLabel: false
12679			} )
12680			.appendTo( this.uiDialogTitlebar );
12681
12682		this._addClass( this.uiDialogTitlebarClose, "ui-dialog-titlebar-close" );
12683		this._on( this.uiDialogTitlebarClose, {
12684			click: function( event ) {
12685				event.preventDefault();
12686				this.close( event );
12687			}
12688		} );
12689
12690		uiDialogTitle = $( "<span>" ).uniqueId().prependTo( this.uiDialogTitlebar );
12691		this._addClass( uiDialogTitle, "ui-dialog-title" );
12692		this._title( uiDialogTitle );
12693
12694		this.uiDialogTitlebar.prependTo( this.uiDialog );
12695
12696		this.uiDialog.attr( {
12697			"aria-labelledby": uiDialogTitle.attr( "id" )
12698		} );
12699	},
12700
12701	_title: function( title ) {
12702		if ( this.options.title ) {
12703			title.text( this.options.title );
12704		} else {
12705			title.html( "&#160;" );
12706		}
12707	},
12708
12709	_createButtonPane: function() {
12710		this.uiDialogButtonPane = $( "<div>" );
12711		this._addClass( this.uiDialogButtonPane, "ui-dialog-buttonpane",
12712			"ui-widget-content ui-helper-clearfix" );
12713
12714		this.uiButtonSet = $( "<div>" )
12715			.appendTo( this.uiDialogButtonPane );
12716		this._addClass( this.uiButtonSet, "ui-dialog-buttonset" );
12717
12718		this._createButtons();
12719	},
12720
12721	_createButtons: function() {
12722		var that = this,
12723			buttons = this.options.buttons;
12724
12725		// If we already have a button pane, remove it
12726		this.uiDialogButtonPane.remove();
12727		this.uiButtonSet.empty();
12728
12729		if ( $.isEmptyObject( buttons ) || ( Array.isArray( buttons ) && !buttons.length ) ) {
12730			this._removeClass( this.uiDialog, "ui-dialog-buttons" );
12731			return;
12732		}
12733
12734		$.each( buttons, function( name, props ) {
12735			var click, buttonOptions;
12736			props = typeof props === "function" ?
12737				{ click: props, text: name } :
12738				props;
12739
12740			// Default to a non-submitting button
12741			props = $.extend( { type: "button" }, props );
12742
12743			// Change the context for the click callback to be the main element
12744			click = props.click;
12745			buttonOptions = {
12746				icon: props.icon,
12747				iconPosition: props.iconPosition,
12748				showLabel: props.showLabel,
12749
12750				// Deprecated options
12751				icons: props.icons,
12752				text: props.text
12753			};
12754
12755			delete props.click;
12756			delete props.icon;
12757			delete props.iconPosition;
12758			delete props.showLabel;
12759
12760			// Deprecated options
12761			delete props.icons;
12762			if ( typeof props.text === "boolean" ) {
12763				delete props.text;
12764			}
12765
12766			$( "<button></button>", props )
12767				.button( buttonOptions )
12768				.appendTo( that.uiButtonSet )
12769				.on( "click", function() {
12770					click.apply( that.element[ 0 ], arguments );
12771				} );
12772		} );
12773		this._addClass( this.uiDialog, "ui-dialog-buttons" );
12774		this.uiDialogButtonPane.appendTo( this.uiDialog );
12775	},
12776
12777	_makeDraggable: function() {
12778		var that = this,
12779			options = this.options;
12780
12781		function filteredUi( ui ) {
12782			return {
12783				position: ui.position,
12784				offset: ui.offset
12785			};
12786		}
12787
12788		this.uiDialog.draggable( {
12789			cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
12790			handle: ".ui-dialog-titlebar",
12791			containment: "document",
12792			start: function( event, ui ) {
12793				that._addClass( $( this ), "ui-dialog-dragging" );
12794				that._blockFrames();
12795				that._trigger( "dragStart", event, filteredUi( ui ) );
12796			},
12797			drag: function( event, ui ) {
12798				that._trigger( "drag", event, filteredUi( ui ) );
12799			},
12800			stop: function( event, ui ) {
12801				var left = ui.offset.left - that.document.scrollLeft(),
12802					top = ui.offset.top - that.document.scrollTop();
12803
12804				options.position = {
12805					my: "left top",
12806					at: "left" + ( left >= 0 ? "+" : "" ) + left + " " +
12807						"top" + ( top >= 0 ? "+" : "" ) + top,
12808					of: that.window
12809				};
12810				that._removeClass( $( this ), "ui-dialog-dragging" );
12811				that._unblockFrames();
12812				that._trigger( "dragStop", event, filteredUi( ui ) );
12813			}
12814		} );
12815	},
12816
12817	_makeResizable: function() {
12818		var that = this,
12819			options = this.options,
12820			handles = options.resizable,
12821
12822			// .ui-resizable has position: relative defined in the stylesheet
12823			// but dialogs have to use absolute or fixed positioning
12824			position = this.uiDialog.css( "position" ),
12825			resizeHandles = typeof handles === "string" ?
12826				handles :
12827				"n,e,s,w,se,sw,ne,nw";
12828
12829		function filteredUi( ui ) {
12830			return {
12831				originalPosition: ui.originalPosition,
12832				originalSize: ui.originalSize,
12833				position: ui.position,
12834				size: ui.size
12835			};
12836		}
12837
12838		this.uiDialog.resizable( {
12839			cancel: ".ui-dialog-content",
12840			containment: "document",
12841			alsoResize: this.element,
12842			maxWidth: options.maxWidth,
12843			maxHeight: options.maxHeight,
12844			minWidth: options.minWidth,
12845			minHeight: this._minHeight(),
12846			handles: resizeHandles,
12847			start: function( event, ui ) {
12848				that._addClass( $( this ), "ui-dialog-resizing" );
12849				that._blockFrames();
12850				that._trigger( "resizeStart", event, filteredUi( ui ) );
12851			},
12852			resize: function( event, ui ) {
12853				that._trigger( "resize", event, filteredUi( ui ) );
12854			},
12855			stop: function( event, ui ) {
12856				var offset = that.uiDialog.offset(),
12857					left = offset.left - that.document.scrollLeft(),
12858					top = offset.top - that.document.scrollTop();
12859
12860				options.height = that.uiDialog.height();
12861				options.width = that.uiDialog.width();
12862				options.position = {
12863					my: "left top",
12864					at: "left" + ( left >= 0 ? "+" : "" ) + left + " " +
12865						"top" + ( top >= 0 ? "+" : "" ) + top,
12866					of: that.window
12867				};
12868				that._removeClass( $( this ), "ui-dialog-resizing" );
12869				that._unblockFrames();
12870				that._trigger( "resizeStop", event, filteredUi( ui ) );
12871			}
12872		} )
12873			.css( "position", position );
12874	},
12875
12876	_trackFocus: function() {
12877		this._on( this.widget(), {
12878			focusin: function( event ) {
12879				this._makeFocusTarget();
12880				this._focusedElement = $( event.target );
12881			}
12882		} );
12883	},
12884
12885	_makeFocusTarget: function() {
12886		this._untrackInstance();
12887		this._trackingInstances().unshift( this );
12888	},
12889
12890	_untrackInstance: function() {
12891		var instances = this._trackingInstances(),
12892			exists = $.inArray( this, instances );
12893		if ( exists !== -1 ) {
12894			instances.splice( exists, 1 );
12895		}
12896	},
12897
12898	_trackingInstances: function() {
12899		var instances = this.document.data( "ui-dialog-instances" );
12900		if ( !instances ) {
12901			instances = [];
12902			this.document.data( "ui-dialog-instances", instances );
12903		}
12904		return instances;
12905	},
12906
12907	_minHeight: function() {
12908		var options = this.options;
12909
12910		return options.height === "auto" ?
12911			options.minHeight :
12912			Math.min( options.minHeight, options.height );
12913	},
12914
12915	_position: function() {
12916
12917		// Need to show the dialog to get the actual offset in the position plugin
12918		var isVisible = this.uiDialog.is( ":visible" );
12919		if ( !isVisible ) {
12920			this.uiDialog.show();
12921		}
12922		this.uiDialog.position( this.options.position );
12923		if ( !isVisible ) {
12924			this.uiDialog.hide();
12925		}
12926	},
12927
12928	_setOptions: function( options ) {
12929		var that = this,
12930			resize = false,
12931			resizableOptions = {};
12932
12933		$.each( options, function( key, value ) {
12934			that._setOption( key, value );
12935
12936			if ( key in that.sizeRelatedOptions ) {
12937				resize = true;
12938			}
12939			if ( key in that.resizableRelatedOptions ) {
12940				resizableOptions[ key ] = value;
12941			}
12942		} );
12943
12944		if ( resize ) {
12945			this._size();
12946			this._position();
12947		}
12948		if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
12949			this.uiDialog.resizable( "option", resizableOptions );
12950		}
12951	},
12952
12953	_setOption: function( key, value ) {
12954		var isDraggable, isResizable,
12955			uiDialog = this.uiDialog;
12956
12957		if ( key === "disabled" ) {
12958			return;
12959		}
12960
12961		this._super( key, value );
12962
12963		if ( key === "appendTo" ) {
12964			this.uiDialog.appendTo( this._appendTo() );
12965		}
12966
12967		if ( key === "buttons" ) {
12968			this._createButtons();
12969		}
12970
12971		if ( key === "closeText" ) {
12972			this.uiDialogTitlebarClose.button( {
12973
12974				// Ensure that we always pass a string
12975				label: $( "<a>" ).text( "" + this.options.closeText ).html()
12976			} );
12977		}
12978
12979		if ( key === "draggable" ) {
12980			isDraggable = uiDialog.is( ":data(ui-draggable)" );
12981			if ( isDraggable && !value ) {
12982				uiDialog.draggable( "destroy" );
12983			}
12984
12985			if ( !isDraggable && value ) {
12986				this._makeDraggable();
12987			}
12988		}
12989
12990		if ( key === "position" ) {
12991			this._position();
12992		}
12993
12994		if ( key === "resizable" ) {
12995
12996			// currently resizable, becoming non-resizable
12997			isResizable = uiDialog.is( ":data(ui-resizable)" );
12998			if ( isResizable && !value ) {
12999				uiDialog.resizable( "destroy" );
13000			}
13001
13002			// Currently resizable, changing handles
13003			if ( isResizable && typeof value === "string" ) {
13004				uiDialog.resizable( "option", "handles", value );
13005			}
13006
13007			// Currently non-resizable, becoming resizable
13008			if ( !isResizable && value !== false ) {
13009				this._makeResizable();
13010			}
13011		}
13012
13013		if ( key === "title" ) {
13014			this._title( this.uiDialogTitlebar.find( ".ui-dialog-title" ) );
13015		}
13016	},
13017
13018	_size: function() {
13019
13020		// If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
13021		// divs will both have width and height set, so we need to reset them
13022		var nonContentHeight, minContentHeight, maxContentHeight,
13023			options = this.options;
13024
13025		// Reset content sizing
13026		this.element.show().css( {
13027			width: "auto",
13028			minHeight: 0,
13029			maxHeight: "none",
13030			height: 0
13031		} );
13032
13033		if ( options.minWidth > options.width ) {
13034			options.width = options.minWidth;
13035		}
13036
13037		// Reset wrapper sizing
13038		// determine the height of all the non-content elements
13039		nonContentHeight = this.uiDialog.css( {
13040			height: "auto",
13041			width: options.width
13042		} )
13043			.outerHeight();
13044		minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
13045		maxContentHeight = typeof options.maxHeight === "number" ?
13046			Math.max( 0, options.maxHeight - nonContentHeight ) :
13047			"none";
13048
13049		if ( options.height === "auto" ) {
13050			this.element.css( {
13051				minHeight: minContentHeight,
13052				maxHeight: maxContentHeight,
13053				height: "auto"
13054			} );
13055		} else {
13056			this.element.height( Math.max( 0, options.height - nonContentHeight ) );
13057		}
13058
13059		if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
13060			this.uiDialog.resizable( "option", "minHeight", this._minHeight() );
13061		}
13062	},
13063
13064	_blockFrames: function() {
13065		this.iframeBlocks = this.document.find( "iframe" ).map( function() {
13066			var iframe = $( this );
13067
13068			return $( "<div>" )
13069				.css( {
13070					position: "absolute",
13071					width: iframe.outerWidth(),
13072					height: iframe.outerHeight()
13073				} )
13074				.appendTo( iframe.parent() )
13075				.offset( iframe.offset() )[ 0 ];
13076		} );
13077	},
13078
13079	_unblockFrames: function() {
13080		if ( this.iframeBlocks ) {
13081			this.iframeBlocks.remove();
13082			delete this.iframeBlocks;
13083		}
13084	},
13085
13086	_allowInteraction: function( event ) {
13087		if ( $( event.target ).closest( ".ui-dialog" ).length ) {
13088			return true;
13089		}
13090
13091		// TODO: Remove hack when datepicker implements
13092		// the .ui-front logic (#8989)
13093		return !!$( event.target ).closest( ".ui-datepicker" ).length;
13094	},
13095
13096	_createOverlay: function() {
13097		if ( !this.options.modal ) {
13098			return;
13099		}
13100
13101		var jqMinor = $.fn.jquery.substring( 0, 4 );
13102
13103		// We use a delay in case the overlay is created from an
13104		// event that we're going to be cancelling (#2804)
13105		var isOpening = true;
13106		this._delay( function() {
13107			isOpening = false;
13108		} );
13109
13110		if ( !this.document.data( "ui-dialog-overlays" ) ) {
13111
13112			// Prevent use of anchors and inputs
13113			// This doesn't use `_on()` because it is a shared event handler
13114			// across all open modal dialogs.
13115			this.document.on( "focusin.ui-dialog", function( event ) {
13116				if ( isOpening ) {
13117					return;
13118				}
13119
13120				var instance = this._trackingInstances()[ 0 ];
13121				if ( !instance._allowInteraction( event ) ) {
13122					event.preventDefault();
13123					instance._focusTabbable();
13124
13125					// Support: jQuery >=3.4 <3.
vendor: 2,204 bytes, lines 13125-13213
131256 only
13126					// Focus re-triggering in jQuery 3.4/3.5 makes the original element
13127					// have its focus event propagated last, breaking the re-targeting.
13128					// Trigger focus in a delay in addition if needed to avoid the issue
13129					// See https://github.com/jquery/jquery/issues/4382
13130					if ( jqMinor === "3.4." || jqMinor === "3.5." ) {
13131						instance._delay( instance._restoreTabbableFocus );
13132					}
13133				}
13134			}.bind( this ) );
13135		}
13136
13137		this.overlay = $( "<div>" )
13138			.appendTo( this._appendTo() );
13139
13140		this._addClass( this.overlay, null, "ui-widget-overlay ui-front" );
13141		this._on( this.overlay, {
13142			mousedown: "_keepFocus"
13143		} );
13144		this.document.data( "ui-dialog-overlays",
13145			( this.document.data( "ui-dialog-overlays" ) || 0 ) + 1 );
13146	},
13147
13148	_destroyOverlay: function() {
13149		if ( !this.options.modal ) {
13150			return;
13151		}
13152
13153		if ( this.overlay ) {
13154			var overlays = this.document.data( "ui-dialog-overlays" ) - 1;
13155
13156			if ( !overlays ) {
13157				this.document.off( "focusin.ui-dialog" );
13158				this.document.removeData( "ui-dialog-overlays" );
13159			} else {
13160				this.document.data( "ui-dialog-overlays", overlays );
13161			}
13162
13163			this.overlay.remove();
13164			this.overlay = null;
13165		}
13166	}
13167} );
13168
13169// DEPRECATED
13170// TODO: switch return back to widget declaration at top of file when this is removed
13171if ( $.uiBackCompat !== false ) {
13172
13173	// Backcompat for dialogClass option
13174	$.widget( "ui.dialog", $.ui.dialog, {
13175		options: {
13176			dialogClass: ""
13177		},
13178		_createWrapper: function() {
13179			this._super();
13180			this.uiDialog.addClass( this.options.dialogClass );
13181		},
13182		_setOption: function( key, value ) {
13183			if ( key === "dialogClass" ) {
13184				this.uiDialog
13185					.removeClass( this.options.dialogClass )
13186					.addClass( value );
13187			}
13188			this._superApply( arguments );
13189		}
13190	} );
13191}
13192
13193var widgetsDialog = $.ui.dialog;
13194
13195
13196/*!
13197 * jQuery UI Droppable 1.13.2
13198 * http://jqueryui.com
13199 *
13200 * Copyright jQuery Foundation and other contributors
13201 * Released under the MIT license.
13202 * http://jquery.org/license
13203 */
13204
13205//>>label: Droppable
13206//>>group: Interactions
13207//>>description: Enables drop targets for draggable elements.
13208//>>docs: http://api.jqueryui.com/droppable/
13209//>>demos: http://jqueryui.com/droppable/
13210
13211
13212$.widget( "ui.droppable", {
13213	version: "1.13.2
vendor: 12,184 bytes, lines 13213-13680
13213",
13214	widgetEventPrefix: "drop",
13215	options: {
13216		accept: "*",
13217		addClasses: true,
13218		greedy: false,
13219		scope: "default",
13220		tolerance: "intersect",
13221
13222		// Callbacks
13223		activate: null,
13224		deactivate: null,
13225		drop: null,
13226		out: null,
13227		over: null
13228	},
13229	_create: function() {
13230
13231		var proportions,
13232			o = this.options,
13233			accept = o.accept;
13234
13235		this.isover = false;
13236		this.isout = true;
13237
13238		this.accept = typeof accept === "function" ? accept : function( d ) {
13239			return d.is( accept );
13240		};
13241
13242		this.proportions = function( /* valueToWrite */ ) {
13243			if ( arguments.length ) {
13244
13245				// Store the droppable's proportions
13246				proportions = arguments[ 0 ];
13247			} else {
13248
13249				// Retrieve or derive the droppable's proportions
13250				return proportions ?
13251					proportions :
13252					proportions = {
13253						width: this.element[ 0 ].offsetWidth,
13254						height: this.element[ 0 ].offsetHeight
13255					};
13256			}
13257		};
13258
13259		this._addToManager( o.scope );
13260
13261		if ( o.addClasses ) {
13262			this._addClass( "ui-droppable" );
13263		}
13264
13265	},
13266
13267	_addToManager: function( scope ) {
13268
13269		// Add the reference and positions to the manager
13270		$.ui.ddmanager.droppables[ scope ] = $.ui.ddmanager.droppables[ scope ] || [];
13271		$.ui.ddmanager.droppables[ scope ].push( this );
13272	},
13273
13274	_splice: function( drop ) {
13275		var i = 0;
13276		for ( ; i < drop.length; i++ ) {
13277			if ( drop[ i ] === this ) {
13278				drop.splice( i, 1 );
13279			}
13280		}
13281	},
13282
13283	_destroy: function() {
13284		var drop = $.ui.ddmanager.droppables[ this.options.scope ];
13285
13286		this._splice( drop );
13287	},
13288
13289	_setOption: function( key, value ) {
13290
13291		if ( key === "accept" ) {
13292			this.accept = typeof value === "function" ? value : function( d ) {
13293				return d.is( value );
13294			};
13295		} else if ( key === "scope" ) {
13296			var drop = $.ui.ddmanager.droppables[ this.options.scope ];
13297
13298			this._splice( drop );
13299			this._addToManager( value );
13300		}
13301
13302		this._super( key, value );
13303	},
13304
13305	_activate: function( event ) {
13306		var draggable = $.ui.ddmanager.current;
13307
13308		this._addActiveClass();
13309		if ( draggable ) {
13310			this._trigger( "activate", event, this.ui( draggable ) );
13311		}
13312	},
13313
13314	_deactivate: function( event ) {
13315		var draggable = $.ui.ddmanager.current;
13316
13317		this._removeActiveClass();
13318		if ( draggable ) {
13319			this._trigger( "deactivate", event, this.ui( draggable ) );
13320		}
13321	},
13322
13323	_over: function( event ) {
13324
13325		var draggable = $.ui.ddmanager.current;
13326
13327		// Bail if draggable and droppable are same element
13328		if ( !draggable || ( draggable.currentItem ||
13329				draggable.element )[ 0 ] === this.element[ 0 ] ) {
13330			return;
13331		}
13332
13333		if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem ||
13334				draggable.element ) ) ) {
13335			this._addHoverClass();
13336			this._trigger( "over", event, this.ui( draggable ) );
13337		}
13338
13339	},
13340
13341	_out: function( event ) {
13342
13343		var draggable = $.ui.ddmanager.current;
13344
13345		// Bail if draggable and droppable are same element
13346		if ( !draggable || ( draggable.currentItem ||
13347				draggable.element )[ 0 ] === this.element[ 0 ] ) {
13348			return;
13349		}
13350
13351		if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem ||
13352				draggable.element ) ) ) {
13353			this._removeHoverClass();
13354			this._trigger( "out", event, this.ui( draggable ) );
13355		}
13356
13357	},
13358
13359	_drop: function( event, custom ) {
13360
13361		var draggable = custom || $.ui.ddmanager.current,
13362			childrenIntersection = false;
13363
13364		// Bail if draggable and droppable are same element
13365		if ( !draggable || ( draggable.currentItem ||
13366				draggable.element )[ 0 ] === this.element[ 0 ] ) {
13367			return false;
13368		}
13369
13370		this.element
13371			.find( ":data(ui-droppable)" )
13372			.not( ".ui-draggable-dragging" )
13373			.each( function() {
13374				var inst = $( this ).droppable( "instance" );
13375				if (
13376					inst.options.greedy &&
13377					!inst.options.disabled &&
13378					inst.options.scope === draggable.options.scope &&
13379					inst.accept.call(
13380						inst.element[ 0 ], ( draggable.currentItem || draggable.element )
13381					) &&
13382					$.ui.intersect(
13383						draggable,
13384						$.extend( inst, { offset: inst.element.offset() } ),
13385						inst.options.tolerance, event
13386					)
13387				) {
13388					childrenIntersection = true;
13389					return false;
13390				}
13391			} );
13392		if ( childrenIntersection ) {
13393			return false;
13394		}
13395
13396		if ( this.accept.call( this.element[ 0 ],
13397				( draggable.currentItem || draggable.element ) ) ) {
13398			this._removeActiveClass();
13399			this._removeHoverClass();
13400
13401			this._trigger( "drop", event, this.ui( draggable ) );
13402			return this.element;
13403		}
13404
13405		return false;
13406
13407	},
13408
13409	ui: function( c ) {
13410		return {
13411			draggable: ( c.currentItem || c.element ),
13412			helper: c.helper,
13413			position: c.position,
13414			offset: c.positionAbs
13415		};
13416	},
13417
13418	// Extension points just to make backcompat sane and avoid duplicating logic
13419	// TODO: Remove in 1.14 along with call to it below
13420	_addHoverClass: function() {
13421		this._addClass( "ui-droppable-hover" );
13422	},
13423
13424	_removeHoverClass: function() {
13425		this._removeClass( "ui-droppable-hover" );
13426	},
13427
13428	_addActiveClass: function() {
13429		this._addClass( "ui-droppable-active" );
13430	},
13431
13432	_removeActiveClass: function() {
13433		this._removeClass( "ui-droppable-active" );
13434	}
13435} );
13436
13437$.ui.intersect = ( function() {
13438	function isOverAxis( x, reference, size ) {
13439		return ( x >= reference ) && ( x < ( reference + size ) );
13440	}
13441
13442	return function( draggable, droppable, toleranceMode, event ) {
13443
13444		if ( !droppable.offset ) {
13445			return false;
13446		}
13447
13448		var x1 = ( draggable.positionAbs ||
13449				draggable.position.absolute ).left + draggable.margins.left,
13450			y1 = ( draggable.positionAbs ||
13451				draggable.position.absolute ).top + draggable.margins.top,
13452			x2 = x1 + draggable.helperProportions.width,
13453			y2 = y1 + draggable.helperProportions.height,
13454			l = droppable.offset.left,
13455			t = droppable.offset.top,
13456			r = l + droppable.proportions().width,
13457			b = t + droppable.proportions().height;
13458
13459		switch ( toleranceMode ) {
13460		case "fit":
13461			return ( l <= x1 && x2 <= r && t <= y1 && y2 <= b );
13462		case "intersect":
13463			return ( l < x1 + ( draggable.helperProportions.width / 2 ) && // Right Half
13464				x2 - ( draggable.helperProportions.width / 2 ) < r && // Left Half
13465				t < y1 + ( draggable.helperProportions.height / 2 ) && // Bottom Half
13466				y2 - ( draggable.helperProportions.height / 2 ) < b ); // Top Half
13467		case "pointer":
13468			return isOverAxis( event.pageY, t, droppable.proportions().height ) &&
13469				isOverAxis( event.pageX, l, droppable.proportions().width );
13470		case "touch":
13471			return (
13472				( y1 >= t && y1 <= b ) || // Top edge touching
13473				( y2 >= t && y2 <= b ) || // Bottom edge touching
13474				( y1 < t && y2 > b ) // Surrounded vertically
13475			) && (
13476				( x1 >= l && x1 <= r ) || // Left edge touching
13477				( x2 >= l && x2 <= r ) || // Right edge touching
13478				( x1 < l && x2 > r ) // Surrounded horizontally
13479			);
13480		default:
13481			return false;
13482		}
13483	};
13484} )();
13485
13486/*
13487	This manager tracks offsets of draggables and droppables
13488*/
13489$.ui.ddmanager = {
13490	current: null,
13491	droppables: { "default": [] },
13492	prepareOffsets: function( t, event ) {
13493
13494		var i, j,
13495			m = $.ui.ddmanager.droppables[ t.options.scope ] || [],
13496			type = event ? event.type : null, // workaround for #2317
13497			list = ( t.currentItem || t.element ).find( ":data(ui-droppable)" ).addBack();
13498
13499		droppablesLoop: for ( i = 0; i < m.length; i++ ) {
13500
13501			// No disabled and non-accepted
13502			if ( m[ i ].options.disabled || ( t && !m[ i ].accept.call( m[ i ].element[ 0 ],
13503					( t.currentItem || t.element ) ) ) ) {
13504				continue;
13505			}
13506
13507			// Filter out elements in the current dragged item
13508			for ( j = 0; j < list.length; j++ ) {
13509				if ( list[ j ] === m[ i ].element[ 0 ] ) {
13510					m[ i ].proportions().height = 0;
13511					continue droppablesLoop;
13512				}
13513			}
13514
13515			m[ i ].visible = m[ i ].element.css( "display" ) !== "none";
13516			if ( !m[ i ].visible ) {
13517				continue;
13518			}
13519
13520			// Activate the droppable if used directly from draggables
13521			if ( type === "mousedown" ) {
13522				m[ i ]._activate.call( m[ i ], event );
13523			}
13524
13525			m[ i ].offset = m[ i ].element.offset();
13526			m[ i ].proportions( {
13527				width: m[ i ].element[ 0 ].offsetWidth,
13528				height: m[ i ].element[ 0 ].offsetHeight
13529			} );
13530
13531		}
13532
13533	},
13534	drop: function( draggable, event ) {
13535
13536		var dropped = false;
13537
13538		// Create a copy of the droppables in case the list changes during the drop (#9116)
13539		$.each( ( $.ui.ddmanager.droppables[ draggable.options.scope ] || [] ).slice(), function() {
13540
13541			if ( !this.options ) {
13542				return;
13543			}
13544			if ( !this.options.disabled && this.visible &&
13545					$.ui.intersect( draggable, this, this.options.tolerance, event ) ) {
13546				dropped = this._drop.call( this, event ) || dropped;
13547			}
13548
13549			if ( !this.options.disabled && this.visible && this.accept.call( this.element[ 0 ],
13550					( draggable.currentItem || draggable.element ) ) ) {
13551				this.isout = true;
13552				this.isover = false;
13553				this._deactivate.call( this, event );
13554			}
13555
13556		} );
13557		return dropped;
13558
13559	},
13560	dragStart: function( draggable, event ) {
13561
13562		// Listen for scrolling so that if the dragging causes scrolling the position of the
13563		// droppables can be recalculated (see #5003)
13564		draggable.element.parentsUntil( "body" ).on( "scroll.droppable", function() {
13565			if ( !draggable.options.refreshPositions ) {
13566				$.ui.ddmanager.prepareOffsets( draggable, event );
13567			}
13568		} );
13569	},
13570	drag: function( draggable, event ) {
13571
13572		// If you have a highly dynamic page, you might try this option. It renders positions
13573		// every time you move the mouse.
13574		if ( draggable.options.refreshPositions ) {
13575			$.ui.ddmanager.prepareOffsets( draggable, event );
13576		}
13577
13578		// Run through all droppables and check their positions based on specific tolerance options
13579		$.each( $.ui.ddmanager.droppables[ draggable.options.scope ] || [], function() {
13580
13581			if ( this.options.disabled || this.greedyChild || !this.visible ) {
13582				return;
13583			}
13584
13585			var parentInstance, scope, parent,
13586				intersects = $.ui.intersect( draggable, this, this.options.tolerance, event ),
13587				c = !intersects && this.isover ?
13588					"isout" :
13589					( intersects && !this.isover ? "isover" : null );
13590			if ( !c ) {
13591				return;
13592			}
13593
13594			if ( this.options.greedy ) {
13595
13596				// find droppable parents with same scope
13597				scope = this.options.scope;
13598				parent = this.element.parents( ":data(ui-droppable)" ).filter( function() {
13599					return $( this ).droppable( "instance" ).options.scope === scope;
13600				} );
13601
13602				if ( parent.length ) {
13603					parentInstance = $( parent[ 0 ] ).droppable( "instance" );
13604					parentInstance.greedyChild = ( c === "isover" );
13605				}
13606			}
13607
13608			// We just moved into a greedy child
13609			if ( parentInstance && c === "isover" ) {
13610				parentInstance.isover = false;
13611				parentInstance.isout = true;
13612				parentInstance._out.call( parentInstance, event );
13613			}
13614
13615			this[ c ] = true;
13616			this[ c === "isout" ? "isover" : "isout" ] = false;
13617			this[ c === "isover" ? "_over" : "_out" ].call( this, event );
13618
13619			// We just moved out of a greedy child
13620			if ( parentInstance && c === "isout" ) {
13621				parentInstance.isout = false;
13622				parentInstance.isover = true;
13623				parentInstance._over.call( parentInstance, event );
13624			}
13625		} );
13626
13627	},
13628	dragStop: function( draggable, event ) {
13629		draggable.element.parentsUntil( "body" ).off( "scroll.droppable" );
13630
13631		// Call prepareOffsets one final time since IE does not fire return scroll events when
13632		// overflow was caused by drag (see #5003)
13633		if ( !draggable.options.refreshPositions ) {
13634			$.ui.ddmanager.prepareOffsets( draggable, event );
13635		}
13636	}
13637};
13638
13639// DEPRECATED
13640// TODO: switch return back to widget declaration at top of file when this is removed
13641if ( $.uiBackCompat !== false ) {
13642
13643	// Backcompat for activeClass and hoverClass options
13644	$.widget( "ui.droppable", $.ui.droppable, {
13645		options: {
13646			hoverClass: false,
13647			activeClass: false
13648		},
13649		_addActiveClass: function() {
13650			this._super();
13651			if ( this.options.activeClass ) {
13652				this.element.addClass( this.options.activeClass );
13653			}
13654		},
13655		_removeActiveClass: function() {
13656			this._super();
13657			if ( this.options.activeClass ) {
13658				this.element.removeClass( this.options.activeClass );
13659			}
13660		},
13661		_addHoverClass: function() {
13662			this._super();
13663			if ( this.options.hoverClass ) {
13664				this.element.addClass( this.options.hoverClass );
13665			}
13666		},
13667		_removeHoverClass: function() {
13668			this._super();
13669			if ( this.options.hoverClass ) {
13670				this.element.removeClass( this.options.hoverClass );
13671			}
13672		}
13673	} );
13674}
13675
13676var widgetsDroppable = $.ui.droppable;
13677
13678
13679/*!
13680 * jQuery UI Progressbar 1.13.
136802
13681 * http://jqueryui.com
13682 *
13683 * Copyright jQuery Foundation and other contributors
13684 * Released under the MIT license.
13685 * http://jquery.org/license
13686 */
13687
13688//>>label: Progressbar
13689//>>group: Widgets
13690/* eslint-disable max-len */
13691//>>
vendor: 4,217 bytes, lines 13691-13860
13691description: Displays a status indicator for loading state, standard percentage, and other progress indicators.
13692/* eslint-enable max-len */
13693//>>docs: http://api.jqueryui.com/progressbar/
13694//>>demos: http://jqueryui.com/progressbar/
13695//>>css.structure: ../../themes/base/core.css
13696//>>css.structure: ../../themes/base/progressbar.css
13697//>>css.theme: ../../themes/base/theme.css
13698
13699
13700var widgetsProgressbar = $.widget( "ui.progressbar", {
13701	version: "1.13.2",
13702	options: {
13703		classes: {
13704			"ui-progressbar": "ui-corner-all",
13705			"ui-progressbar-value": "ui-corner-left",
13706			"ui-progressbar-complete": "ui-corner-right"
13707		},
13708		max: 100,
13709		value: 0,
13710
13711		change: null,
13712		complete: null
13713	},
13714
13715	min: 0,
13716
13717	_create: function() {
13718
13719		// Constrain initial value
13720		this.oldValue = this.options.value = this._constrainedValue();
13721
13722		this.element.attr( {
13723
13724			// Only set static values; aria-valuenow and aria-valuemax are
13725			// set inside _refreshValue()
13726			role: "progressbar",
13727			"aria-valuemin": this.min
13728		} );
13729		this._addClass( "ui-progressbar", "ui-widget ui-widget-content" );
13730
13731		this.valueDiv = $( "<div>" ).appendTo( this.element );
13732		this._addClass( this.valueDiv, "ui-progressbar-value", "ui-widget-header" );
13733		this._refreshValue();
13734	},
13735
13736	_destroy: function() {
13737		this.element.removeAttr( "role aria-valuemin aria-valuemax aria-valuenow" );
13738
13739		this.valueDiv.remove();
13740	},
13741
13742	value: function( newValue ) {
13743		if ( newValue === undefined ) {
13744			return this.options.value;
13745		}
13746
13747		this.options.value = this._constrainedValue( newValue );
13748		this._refreshValue();
13749	},
13750
13751	_constrainedValue: function( newValue ) {
13752		if ( newValue === undefined ) {
13753			newValue = this.options.value;
13754		}
13755
13756		this.indeterminate = newValue === false;
13757
13758		// Sanitize value
13759		if ( typeof newValue !== "number" ) {
13760			newValue = 0;
13761		}
13762
13763		return this.indeterminate ? false :
13764			Math.min( this.options.max, Math.max( this.min, newValue ) );
13765	},
13766
13767	_setOptions: function( options ) {
13768
13769		// Ensure "value" option is set after other values (like max)
13770		var value = options.value;
13771		delete options.value;
13772
13773		this._super( options );
13774
13775		this.options.value = this._constrainedValue( value );
13776		this._refreshValue();
13777	},
13778
13779	_setOption: function( key, value ) {
13780		if ( key === "max" ) {
13781
13782			// Don't allow a max less than min
13783			value = Math.max( this.min, value );
13784		}
13785		this._super( key, value );
13786	},
13787
13788	_setOptionDisabled: function( value ) {
13789		this._super( value );
13790
13791		this.element.attr( "aria-disabled", value );
13792		this._toggleClass( null, "ui-state-disabled", !!value );
13793	},
13794
13795	_percentage: function() {
13796		return this.indeterminate ?
13797			100 :
13798			100 * ( this.options.value - this.min ) / ( this.options.max - this.min );
13799	},
13800
13801	_refreshValue: function() {
13802		var value = this.options.value,
13803			percentage = this._percentage();
13804
13805		this.valueDiv
13806			.toggle( this.indeterminate || value > this.min )
13807			.width( percentage.toFixed( 0 ) + "%" );
13808
13809		this
13810			._toggleClass( this.valueDiv, "ui-progressbar-complete", null,
13811				value === this.options.max )
13812			._toggleClass( "ui-progressbar-indeterminate", null, this.indeterminate );
13813
13814		if ( this.indeterminate ) {
13815			this.element.removeAttr( "aria-valuenow" );
13816			if ( !this.overlayDiv ) {
13817				this.overlayDiv = $( "<div>" ).appendTo( this.valueDiv );
13818				this._addClass( this.overlayDiv, "ui-progressbar-overlay" );
13819			}
13820		} else {
13821			this.element.attr( {
13822				"aria-valuemax": this.options.max,
13823				"aria-valuenow": value
13824			} );
13825			if ( this.overlayDiv ) {
13826				this.overlayDiv.remove();
13827				this.overlayDiv = null;
13828			}
13829		}
13830
13831		if ( this.oldValue !== value ) {
13832			this.oldValue = value;
13833			this._trigger( "change" );
13834		}
13835		if ( value === this.options.max ) {
13836			this._trigger( "complete" );
13837		}
13838	}
13839} );
13840
13841
13842/*!
13843 * jQuery UI Selectable 1.13.2
13844 * http://jqueryui.com
13845 *
13846 * Copyright jQuery Foundation and other contributors
13847 * Released under the MIT license.
13848 * http://jquery.org/license
13849 */
13850
13851//>>label: Selectable
13852//>>group: Interactions
13853//>>description: Allows groups of elements to be selected with the mouse.
13854//>>docs: http://api.jqueryui.com/selectable/
13855//>>demos: http://jqueryui.com/selectable/
13856//>>css.structure: ../../themes/base/selectable.css
13857
13858
13859var widgetsSelectable = $.widget( "ui.selectable", $.ui.mouse, {
13860	version: "1.13.2
vendor: 7,327 bytes, lines 13860-14141
13860",
13861	options: {
13862		appendTo: "body",
13863		autoRefresh: true,
13864		distance: 0,
13865		filter: "*",
13866		tolerance: "touch",
13867
13868		// Callbacks
13869		selected: null,
13870		selecting: null,
13871		start: null,
13872		stop: null,
13873		unselected: null,
13874		unselecting: null
13875	},
13876	_create: function() {
13877		var that = this;
13878
13879		this._addClass( "ui-selectable" );
13880
13881		this.dragged = false;
13882
13883		// Cache selectee children based on filter
13884		this.refresh = function() {
13885			that.elementPos = $( that.element[ 0 ] ).offset();
13886			that.selectees = $( that.options.filter, that.element[ 0 ] );
13887			that._addClass( that.selectees, "ui-selectee" );
13888			that.selectees.each( function() {
13889				var $this = $( this ),
13890					selecteeOffset = $this.offset(),
13891					pos = {
13892						left: selecteeOffset.left - that.elementPos.left,
13893						top: selecteeOffset.top - that.elementPos.top
13894					};
13895				$.data( this, "selectable-item", {
13896					element: this,
13897					$element: $this,
13898					left: pos.left,
13899					top: pos.top,
13900					right: pos.left + $this.outerWidth(),
13901					bottom: pos.top + $this.outerHeight(),
13902					startselected: false,
13903					selected: $this.hasClass( "ui-selected" ),
13904					selecting: $this.hasClass( "ui-selecting" ),
13905					unselecting: $this.hasClass( "ui-unselecting" )
13906				} );
13907			} );
13908		};
13909		this.refresh();
13910
13911		this._mouseInit();
13912
13913		this.helper = $( "<div>" );
13914		this._addClass( this.helper, "ui-selectable-helper" );
13915	},
13916
13917	_destroy: function() {
13918		this.selectees.removeData( "selectable-item" );
13919		this._mouseDestroy();
13920	},
13921
13922	_mouseStart: function( event ) {
13923		var that = this,
13924			options = this.options;
13925
13926		this.opos = [ event.pageX, event.pageY ];
13927		this.elementPos = $( this.element[ 0 ] ).offset();
13928
13929		if ( this.options.disabled ) {
13930			return;
13931		}
13932
13933		this.selectees = $( options.filter, this.element[ 0 ] );
13934
13935		this._trigger( "start", event );
13936
13937		$( options.appendTo ).append( this.helper );
13938
13939		// position helper (lasso)
13940		this.helper.css( {
13941			"left": event.pageX,
13942			"top": event.pageY,
13943			"width": 0,
13944			"height": 0
13945		} );
13946
13947		if ( options.autoRefresh ) {
13948			this.refresh();
13949		}
13950
13951		this.selectees.filter( ".ui-selected" ).each( function() {
13952			var selectee = $.data( this, "selectable-item" );
13953			selectee.startselected = true;
13954			if ( !event.metaKey && !event.ctrlKey ) {
13955				that._removeClass( selectee.$element, "ui-selected" );
13956				selectee.selected = false;
13957				that._addClass( selectee.$element, "ui-unselecting" );
13958				selectee.unselecting = true;
13959
13960				// selectable UNSELECTING callback
13961				that._trigger( "unselecting", event, {
13962					unselecting: selectee.element
13963				} );
13964			}
13965		} );
13966
13967		$( event.target ).parents().addBack().each( function() {
13968			var doSelect,
13969				selectee = $.data( this, "selectable-item" );
13970			if ( selectee ) {
13971				doSelect = ( !event.metaKey && !event.ctrlKey ) ||
13972					!selectee.$element.hasClass( "ui-selected" );
13973				that._removeClass( selectee.$element, doSelect ? "ui-unselecting" : "ui-selected" )
13974					._addClass( selectee.$element, doSelect ? "ui-selecting" : "ui-unselecting" );
13975				selectee.unselecting = !doSelect;
13976				selectee.selecting = doSelect;
13977				selectee.selected = doSelect;
13978
13979				// selectable (UN)SELECTING callback
13980				if ( doSelect ) {
13981					that._trigger( "selecting", event, {
13982						selecting: selectee.element
13983					} );
13984				} else {
13985					that._trigger( "unselecting", event, {
13986						unselecting: selectee.element
13987					} );
13988				}
13989				return false;
13990			}
13991		} );
13992
13993	},
13994
13995	_mouseDrag: function( event ) {
13996
13997		this.dragged = true;
13998
13999		if ( this.options.disabled ) {
14000			return;
14001		}
14002
14003		var tmp,
14004			that = this,
14005			options = this.options,
14006			x1 = this.opos[ 0 ],
14007			y1 = this.opos[ 1 ],
14008			x2 = event.pageX,
14009			y2 = event.pageY;
14010
14011		if ( x1 > x2 ) {
14012			tmp = x2; x2 = x1; x1 = tmp;
14013		}
14014		if ( y1 > y2 ) {
14015			tmp = y2; y2 = y1; y1 = tmp;
14016		}
14017		this.helper.css( { left: x1, top: y1, width: x2 - x1, height: y2 - y1 } );
14018
14019		this.selectees.each( function() {
14020			var selectee = $.data( this, "selectable-item" ),
14021				hit = false,
14022				offset = {};
14023
14024			//prevent helper from being selected if appendTo: selectable
14025			if ( !selectee || selectee.element === that.element[ 0 ] ) {
14026				return;
14027			}
14028
14029			offset.left   = selectee.left   + that.elementPos.left;
14030			offset.right  = selectee.right  + that.elementPos.left;
14031			offset.top    = selectee.top    + that.elementPos.top;
14032			offset.bottom = selectee.bottom + that.elementPos.top;
14033
14034			if ( options.tolerance === "touch" ) {
14035				hit = ( !( offset.left > x2 || offset.right < x1 || offset.top > y2 ||
14036                    offset.bottom < y1 ) );
14037			} else if ( options.tolerance === "fit" ) {
14038				hit = ( offset.left > x1 && offset.right < x2 && offset.top > y1 &&
14039                    offset.bottom < y2 );
14040			}
14041
14042			if ( hit ) {
14043
14044				// SELECT
14045				if ( selectee.selected ) {
14046					that._removeClass( selectee.$element, "ui-selected" );
14047					selectee.selected = false;
14048				}
14049				if ( selectee.unselecting ) {
14050					that._removeClass( selectee.$element, "ui-unselecting" );
14051					selectee.unselecting = false;
14052				}
14053				if ( !selectee.selecting ) {
14054					that._addClass( selectee.$element, "ui-selecting" );
14055					selectee.selecting = true;
14056
14057					// selectable SELECTING callback
14058					that._trigger( "selecting", event, {
14059						selecting: selectee.element
14060					} );
14061				}
14062			} else {
14063
14064				// UNSELECT
14065				if ( selectee.selecting ) {
14066					if ( ( event.metaKey || event.ctrlKey ) && selectee.startselected ) {
14067						that._removeClass( selectee.$element, "ui-selecting" );
14068						selectee.selecting = false;
14069						that._addClass( selectee.$element, "ui-selected" );
14070						selectee.selected = true;
14071					} else {
14072						that._removeClass( selectee.$element, "ui-selecting" );
14073						selectee.selecting = false;
14074						if ( selectee.startselected ) {
14075							that._addClass( selectee.$element, "ui-unselecting" );
14076							selectee.unselecting = true;
14077						}
14078
14079						// selectable UNSELECTING callback
14080						that._trigger( "unselecting", event, {
14081							unselecting: selectee.element
14082						} );
14083					}
14084				}
14085				if ( selectee.selected ) {
14086					if ( !event.metaKey && !event.ctrlKey && !selectee.startselected ) {
14087						that._removeClass( selectee.$element, "ui-selected" );
14088						selectee.selected = false;
14089
14090						that._addClass( selectee.$element, "ui-unselecting" );
14091						selectee.unselecting = true;
14092
14093						// selectable UNSELECTING callback
14094						that._trigger( "unselecting", event, {
14095							unselecting: selectee.element
14096						} );
14097					}
14098				}
14099			}
14100		} );
14101
14102		return false;
14103	},
14104
14105	_mouseStop: function( event ) {
14106		var that = this;
14107
14108		this.dragged = false;
14109
14110		$( ".ui-unselecting", this.element[ 0 ] ).each( function() {
14111			var selectee = $.data( this, "selectable-item" );
14112			that._removeClass( selectee.$element, "ui-unselecting" );
14113			selectee.unselecting = false;
14114			selectee.startselected = false;
14115			that._trigger( "unselected", event, {
14116				unselected: selectee.element
14117			} );
14118		} );
14119		$( ".ui-selecting", this.element[ 0 ] ).each( function() {
14120			var selectee = $.data( this, "selectable-item" );
14121			that._removeClass( selectee.$element, "ui-selecting" )
14122				._addClass( selectee.$element, "ui-selected" );
14123			selectee.selecting = false;
14124			selectee.selected = true;
14125			selectee.startselected = true;
14126			that._trigger( "selected", event, {
14127				selected: selectee.element
14128			} );
14129		} );
14130		this._trigger( "stop", event );
14131
14132		this.helper.remove();
14133
14134		return false;
14135	}
14136
14137} );
14138
14139
14140/*!
14141 * jQuery UI Selectmenu 1.13.
vendor: 8,061 bytes, lines 14141-14472
141412
14142 * http://jqueryui.com
14143 *
14144 * Copyright jQuery Foundation and other contributors
14145 * Released under the MIT license.
14146 * http://jquery.org/license
14147 */
14148
14149//>>label: Selectmenu
14150//>>group: Widgets
14151/* eslint-disable max-len */
14152//>>description: Duplicates and extends the functionality of a native HTML select element, allowing it to be customizable in behavior and appearance far beyond the limitations of a native select.
14153/* eslint-enable max-len */
14154//>>docs: http://api.jqueryui.com/selectmenu/
14155//>>demos: http://jqueryui.com/selectmenu/
14156//>>css.structure: ../../themes/base/core.css
14157//>>css.structure: ../../themes/base/selectmenu.css, ../../themes/base/button.css
14158//>>css.theme: ../../themes/base/theme.css
14159
14160
14161var widgetsSelectmenu = $.widget( "ui.selectmenu", [ $.ui.formResetMixin, {
14162	version: "1.13.2",
14163	defaultElement: "<select>",
14164	options: {
14165		appendTo: null,
14166		classes: {
14167			"ui-selectmenu-button-open": "ui-corner-top",
14168			"ui-selectmenu-button-closed": "ui-corner-all"
14169		},
14170		disabled: null,
14171		icons: {
14172			button: "ui-icon-triangle-1-s"
14173		},
14174		position: {
14175			my: "left top",
14176			at: "left bottom",
14177			collision: "none"
14178		},
14179		width: false,
14180
14181		// Callbacks
14182		change: null,
14183		close: null,
14184		focus: null,
14185		open: null,
14186		select: null
14187	},
14188
14189	_create: function() {
14190		var selectmenuId = this.element.uniqueId().attr( "id" );
14191		this.ids = {
14192			element: selectmenuId,
14193			button: selectmenuId + "-button",
14194			menu: selectmenuId + "-menu"
14195		};
14196
14197		this._drawButton();
14198		this._drawMenu();
14199		this._bindFormResetHandler();
14200
14201		this._rendered = false;
14202		this.menuItems = $();
14203	},
14204
14205	_drawButton: function() {
14206		var icon,
14207			that = this,
14208			item = this._parseOption(
14209				this.element.find( "option:selected" ),
14210				this.element[ 0 ].selectedIndex
14211			);
14212
14213		// Associate existing label with the new button
14214		this.labels = this.element.labels().attr( "for", this.ids.button );
14215		this._on( this.labels, {
14216			click: function( event ) {
14217				this.button.trigger( "focus" );
14218				event.preventDefault();
14219			}
14220		} );
14221
14222		// Hide original select element
14223		this.element.hide();
14224
14225		// Create button
14226		this.button = $( "<span>", {
14227			tabindex: this.options.disabled ? -1 : 0,
14228			id: this.ids.button,
14229			role: "combobox",
14230			"aria-expanded": "false",
14231			"aria-autocomplete": "list",
14232			"aria-owns": this.ids.menu,
14233			"aria-haspopup": "true",
14234			title: this.element.attr( "title" )
14235		} )
14236			.insertAfter( this.element );
14237
14238		this._addClass( this.button, "ui-selectmenu-button ui-selectmenu-button-closed",
14239			"ui-button ui-widget" );
14240
14241		icon = $( "<span>" ).appendTo( this.button );
14242		this._addClass( icon, "ui-selectmenu-icon", "ui-icon " + this.options.icons.button );
14243		this.buttonItem = this._renderButtonItem( item )
14244			.appendTo( this.button );
14245
14246		if ( this.options.width !== false ) {
14247			this._resizeButton();
14248		}
14249
14250		this._on( this.button, this._buttonEvents );
14251		this.button.one( "focusin", function() {
14252
14253			// Delay rendering the menu items until the button receives focus.
14254			// The menu may have already been rendered via a programmatic open.
14255			if ( !that._rendered ) {
14256				that._refreshMenu();
14257			}
14258		} );
14259	},
14260
14261	_drawMenu: function() {
14262		var that = this;
14263
14264		// Create menu
14265		this.menu = $( "<ul>", {
14266			"aria-hidden": "true",
14267			"aria-labelledby": this.ids.button,
14268			id: this.ids.menu
14269		} );
14270
14271		// Wrap menu
14272		this.menuWrap = $( "<div>" ).append( this.menu );
14273		this._addClass( this.menuWrap, "ui-selectmenu-menu", "ui-front" );
14274		this.menuWrap.appendTo( this._appendTo() );
14275
14276		// Initialize menu widget
14277		this.menuInstance = this.menu
14278			.menu( {
14279				classes: {
14280					"ui-menu": "ui-corner-bottom"
14281				},
14282				role: "listbox",
14283				select: function( event, ui ) {
14284					event.preventDefault();
14285
14286					// Support: IE8
14287					// If the item was selected via a click, the text selection
14288					// will be destroyed in IE
14289					that._setSelection();
14290
14291					that._select( ui.item.data( "ui-selectmenu-item" ), event );
14292				},
14293				focus: function( event, ui ) {
14294					var item = ui.item.data( "ui-selectmenu-item" );
14295
14296					// Prevent inital focus from firing and check if its a newly focused item
14297					if ( that.focusIndex != null && item.index !== that.focusIndex ) {
14298						that._trigger( "focus", event, { item: item } );
14299						if ( !that.isOpen ) {
14300							that._select( item, event );
14301						}
14302					}
14303					that.focusIndex = item.index;
14304
14305					that.button.attr( "aria-activedescendant",
14306						that.menuItems.eq( item.index ).attr( "id" ) );
14307				}
14308			} )
14309			.menu( "instance" );
14310
14311		// Don't close the menu on mouseleave
14312		this.menuInstance._off( this.menu, "mouseleave" );
14313
14314		// Cancel the menu's collapseAll on document click
14315		this.menuInstance._closeOnDocumentClick = function() {
14316			return false;
14317		};
14318
14319		// Selects often contain empty items, but never contain dividers
14320		this.menuInstance._isDivider = function() {
14321			return false;
14322		};
14323	},
14324
14325	refresh: function() {
14326		this._refreshMenu();
14327		this.buttonItem.replaceWith(
14328			this.buttonItem = this._renderButtonItem(
14329
14330				// Fall back to an empty object in case there are no options
14331				this._getSelectedItem().data( "ui-selectmenu-item" ) || {}
14332			)
14333		);
14334		if ( this.options.width === null ) {
14335			this._resizeButton();
14336		}
14337	},
14338
14339	_refreshMenu: function() {
14340		var item,
14341			options = this.element.find( "option" );
14342
14343		this.menu.empty();
14344
14345		this._parseOptions( options );
14346		this._renderMenu( this.menu, this.items );
14347
14348		this.menuInstance.refresh();
14349		this.menuItems = this.menu.find( "li" )
14350			.not( ".ui-selectmenu-optgroup" )
14351				.find( ".ui-menu-item-wrapper" );
14352
14353		this._rendered = true;
14354
14355		if ( !options.length ) {
14356			return;
14357		}
14358
14359		item = this._getSelectedItem();
14360
14361		// Update the menu to have the correct item focused
14362		this.menuInstance.focus( null, item );
14363		this._setAria( item.data( "ui-selectmenu-item" ) );
14364
14365		// Set disabled state
14366		this._setOption( "disabled", this.element.prop( "disabled" ) );
14367	},
14368
14369	open: function( event ) {
14370		if ( this.options.disabled ) {
14371			return;
14372		}
14373
14374		// If this is the first time the menu is being opened, render the items
14375		if ( !this._rendered ) {
14376			this._refreshMenu();
14377		} else {
14378
14379			// Menu clears focus on close, reset focus to selected item
14380			this._removeClass( this.menu.find( ".ui-state-active" ), null, "ui-state-active" );
14381			this.menuInstance.focus( null, this._getSelectedItem() );
14382		}
14383
14384		// If there are no options, don't open the menu
14385		if ( !this.menuItems.length ) {
14386			return;
14387		}
14388
14389		this.isOpen = true;
14390		this._toggleAttr();
14391		this._resizeMenu();
14392		this._position();
14393
14394		this._on( this.document, this._documentClick );
14395
14396		this._trigger( "open", event );
14397	},
14398
14399	_position: function() {
14400		this.menuWrap.position( $.extend( { of: this.button }, this.options.position ) );
14401	},
14402
14403	close: function( event ) {
14404		if ( !this.isOpen ) {
14405			return;
14406		}
14407
14408		this.isOpen = false;
14409		this._toggleAttr();
14410
14411		this.range = null;
14412		this._off( this.document );
14413
14414		this._trigger( "close", event );
14415	},
14416
14417	widget: function() {
14418		return this.button;
14419	},
14420
14421	menuWidget: function() {
14422		return this.menu;
14423	},
14424
14425	_renderButtonItem: function( item ) {
14426		var buttonItem = $( "<span>" );
14427
14428		this._setText( buttonItem, item.label );
14429		this._addClass( buttonItem, "ui-selectmenu-text" );
14430
14431		return buttonItem;
14432	},
14433
14434	_renderMenu: function( ul, items ) {
14435		var that = this,
14436			currentOptgroup = "";
14437
14438		$.each( items, function( index, item ) {
14439			var li;
14440
14441			if ( item.optgroup !== currentOptgroup ) {
14442				li = $( "<li>", {
14443					text: item.optgroup
14444				} );
14445				that._addClass( li, "ui-selectmenu-optgroup", "ui-menu-divider" +
14446					( item.element.parent( "optgroup" ).prop( "disabled" ) ?
14447						" ui-state-disabled" :
14448						"" ) );
14449
14450				li.appendTo( ul );
14451
14452				currentOptgroup = item.optgroup;
14453			}
14454
14455			that._renderItemData( ul, item );
14456		} );
14457	},
14458
14459	_renderItemData: function( ul, item ) {
14460		return this._renderItem( ul, item ).data( "ui-selectmenu-item", item );
14461	},
14462
14463	_renderItem: function( ul, item ) {
14464		var li = $( "<li>" ),
14465			wrapper = $( "<div>", {
14466				title: item.element.attr( "title" )
14467			} );
14468
14469		if ( item.disabled ) {
14470			this._addClass( li, null, "ui-state-disabled" );
14471		}
14472		this._setText( wrapper, item.label );
vendor: 7,096 bytes, lines 14472-14776
14472
14473
14474		return li.append( wrapper ).appendTo( ul );
14475	},
14476
14477	_setText: function( element, value ) {
14478		if ( value ) {
14479			element.text( value );
14480		} else {
14481			element.html( "&#160;" );
14482		}
14483	},
14484
14485	_move: function( direction, event ) {
14486		var item, next,
14487			filter = ".ui-menu-item";
14488
14489		if ( this.isOpen ) {
14490			item = this.menuItems.eq( this.focusIndex ).parent( "li" );
14491		} else {
14492			item = this.menuItems.eq( this.element[ 0 ].selectedIndex ).parent( "li" );
14493			filter += ":not(.ui-state-disabled)";
14494		}
14495
14496		if ( direction === "first" || direction === "last" ) {
14497			next = item[ direction === "first" ? "prevAll" : "nextAll" ]( filter ).eq( -1 );
14498		} else {
14499			next = item[ direction + "All" ]( filter ).eq( 0 );
14500		}
14501
14502		if ( next.length ) {
14503			this.menuInstance.focus( event, next );
14504		}
14505	},
14506
14507	_getSelectedItem: function() {
14508		return this.menuItems.eq( this.element[ 0 ].selectedIndex ).parent( "li" );
14509	},
14510
14511	_toggle: function( event ) {
14512		this[ this.isOpen ? "close" : "open" ]( event );
14513	},
14514
14515	_setSelection: function() {
14516		var selection;
14517
14518		if ( !this.range ) {
14519			return;
14520		}
14521
14522		if ( window.getSelection ) {
14523			selection = window.getSelection();
14524			selection.removeAllRanges();
14525			selection.addRange( this.range );
14526
14527		// Support: IE8
14528		} else {
14529			this.range.select();
14530		}
14531
14532		// Support: IE
14533		// Setting the text selection kills the button focus in IE, but
14534		// restoring the focus doesn't kill the selection.
14535		this.button.trigger( "focus" );
14536	},
14537
14538	_documentClick: {
14539		mousedown: function( event ) {
14540			if ( !this.isOpen ) {
14541				return;
14542			}
14543
14544			if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" +
14545				$.escapeSelector( this.ids.button ) ).length ) {
14546				this.close( event );
14547			}
14548		}
14549	},
14550
14551	_buttonEvents: {
14552
14553		// Prevent text selection from being reset when interacting with the selectmenu (#10144)
14554		mousedown: function() {
14555			var selection;
14556
14557			if ( window.getSelection ) {
14558				selection = window.getSelection();
14559				if ( selection.rangeCount ) {
14560					this.range = selection.getRangeAt( 0 );
14561				}
14562
14563			// Support: IE8
14564			} else {
14565				this.range = document.selection.createRange();
14566			}
14567		},
14568
14569		click: function( event ) {
14570			this._setSelection();
14571			this._toggle( event );
14572		},
14573
14574		keydown: function( event ) {
14575			var preventDefault = true;
14576			switch ( event.keyCode ) {
14577			case $.ui.keyCode.TAB:
14578			case $.ui.keyCode.ESCAPE:
14579				this.close( event );
14580				preventDefault = false;
14581				break;
14582			case $.ui.keyCode.ENTER:
14583				if ( this.isOpen ) {
14584					this._selectFocusedItem( event );
14585				}
14586				break;
14587			case $.ui.keyCode.UP:
14588				if ( event.altKey ) {
14589					this._toggle( event );
14590				} else {
14591					this._move( "prev", event );
14592				}
14593				break;
14594			case $.ui.keyCode.DOWN:
14595				if ( event.altKey ) {
14596					this._toggle( event );
14597				} else {
14598					this._move( "next", event );
14599				}
14600				break;
14601			case $.ui.keyCode.SPACE:
14602				if ( this.isOpen ) {
14603					this._selectFocusedItem( event );
14604				} else {
14605					this._toggle( event );
14606				}
14607				break;
14608			case $.ui.keyCode.LEFT:
14609				this._move( "prev", event );
14610				break;
14611			case $.ui.keyCode.RIGHT:
14612				this._move( "next", event );
14613				break;
14614			case $.ui.keyCode.HOME:
14615			case $.ui.keyCode.PAGE_UP:
14616				this._move( "first", event );
14617				break;
14618			case $.ui.keyCode.END:
14619			case $.ui.keyCode.PAGE_DOWN:
14620				this._move( "last", event );
14621				break;
14622			default:
14623				this.menu.trigger( event );
14624				preventDefault = false;
14625			}
14626
14627			if ( preventDefault ) {
14628				event.preventDefault();
14629			}
14630		}
14631	},
14632
14633	_selectFocusedItem: function( event ) {
14634		var item = this.menuItems.eq( this.focusIndex ).parent( "li" );
14635		if ( !item.hasClass( "ui-state-disabled" ) ) {
14636			this._select( item.data( "ui-selectmenu-item" ), event );
14637		}
14638	},
14639
14640	_select: function( item, event ) {
14641		var oldIndex = this.element[ 0 ].selectedIndex;
14642
14643		// Change native select element
14644		this.element[ 0 ].selectedIndex = item.index;
14645		this.buttonItem.replaceWith( this.buttonItem = this._renderButtonItem( item ) );
14646		this._setAria( item );
14647		this._trigger( "select", event, { item: item } );
14648
14649		if ( item.index !== oldIndex ) {
14650			this._trigger( "change", event, { item: item } );
14651		}
14652
14653		this.close( event );
14654	},
14655
14656	_setAria: function( item ) {
14657		var id = this.menuItems.eq( item.index ).attr( "id" );
14658
14659		this.button.attr( {
14660			"aria-labelledby": id,
14661			"aria-activedescendant": id
14662		} );
14663		this.menu.attr( "aria-activedescendant", id );
14664	},
14665
14666	_setOption: function( key, value ) {
14667		if ( key === "icons" ) {
14668			var icon = this.button.find( "span.ui-icon" );
14669			this._removeClass( icon, null, this.options.icons.button )
14670				._addClass( icon, null, value.button );
14671		}
14672
14673		this._super( key, value );
14674
14675		if ( key === "appendTo" ) {
14676			this.menuWrap.appendTo( this._appendTo() );
14677		}
14678
14679		if ( key === "width" ) {
14680			this._resizeButton();
14681		}
14682	},
14683
14684	_setOptionDisabled: function( value ) {
14685		this._super( value );
14686
14687		this.menuInstance.option( "disabled", value );
14688		this.button.attr( "aria-disabled", value );
14689		this._toggleClass( this.button, null, "ui-state-disabled", value );
14690
14691		this.element.prop( "disabled", value );
14692		if ( value ) {
14693			this.button.attr( "tabindex", -1 );
14694			this.close();
14695		} else {
14696			this.button.attr( "tabindex", 0 );
14697		}
14698	},
14699
14700	_appendTo: function() {
14701		var element = this.options.appendTo;
14702
14703		if ( element ) {
14704			element = element.jquery || element.nodeType ?
14705				$( element ) :
14706				this.document.find( element ).eq( 0 );
14707		}
14708
14709		if ( !element || !element[ 0 ] ) {
14710			element = this.element.closest( ".ui-front, dialog" );
14711		}
14712
14713		if ( !element.length ) {
14714			element = this.document[ 0 ].body;
14715		}
14716
14717		return element;
14718	},
14719
14720	_toggleAttr: function() {
14721		this.button.attr( "aria-expanded", this.isOpen );
14722
14723		// We can't use two _toggleClass() calls here, because we need to make sure
14724		// we always remove classes first and add them second, otherwise if both classes have the
14725		// same theme class, it will be removed after we add it.
14726		this._removeClass( this.button, "ui-selectmenu-button-" +
14727			( this.isOpen ? "closed" : "open" ) )
14728			._addClass( this.button, "ui-selectmenu-button-" +
14729				( this.isOpen ? "open" : "closed" ) )
14730			._toggleClass( this.menuWrap, "ui-selectmenu-open", null, this.isOpen );
14731
14732		this.menu.attr( "aria-hidden", !this.isOpen );
14733	},
14734
14735	_resizeButton: function() {
14736		var width = this.options.width;
14737
14738		// For `width: false`, just remove inline style and stop
14739		if ( width === false ) {
14740			this.button.css( "width", "" );
14741			return;
14742		}
14743
14744		// For `width: null`, match the width of the original element
14745		if ( width === null ) {
14746			width = this.element.show().outerWidth();
14747			this.element.hide();
14748		}
14749
14750		this.button.outerWidth( width );
14751	},
14752
14753	_resizeMenu: function() {
14754		this.menu.outerWidth( Math.max(
14755			this.button.outerWidth(),
14756
14757			// Support: IE10
14758			// IE10 wraps long text (possibly a rounding bug)
14759			// so we add 1px to avoid the wrapping
14760			this.menu.width( "" ).outerWidth() + 1
14761		) );
14762	},
14763
14764	_getCreateOptions: function() {
14765		var options = this._super();
14766
14767		options.disabled = this.element.prop( "disabled" );
14768
14769		return options;
14770	},
14771
14772	_parseOptions: function( options ) {
14773		var that = this,
14774			data = [];
14775		options.each( function( index, item ) {
14776			
vendor: 3,668 bytes, lines 14776-14926
14776if ( item.hidden ) {
14777				return;
14778			}
14779
14780			data.push( that._parseOption( $( item ), index ) );
14781		} );
14782		this.items = data;
14783	},
14784
14785	_parseOption: function( option, index ) {
14786		var optgroup = option.parent( "optgroup" );
14787
14788		return {
14789			element: option,
14790			index: index,
14791			value: option.val(),
14792			label: option.text(),
14793			optgroup: optgroup.attr( "label" ) || "",
14794			disabled: optgroup.prop( "disabled" ) || option.prop( "disabled" )
14795		};
14796	},
14797
14798	_destroy: function() {
14799		this._unbindFormResetHandler();
14800		this.menuWrap.remove();
14801		this.button.remove();
14802		this.element.show();
14803		this.element.removeUniqueId();
14804		this.labels.attr( "for", this.ids.element );
14805	}
14806} ] );
14807
14808
14809/*!
14810 * jQuery UI Slider 1.13.2
14811 * http://jqueryui.com
14812 *
14813 * Copyright jQuery Foundation and other contributors
14814 * Released under the MIT license.
14815 * http://jquery.org/license
14816 */
14817
14818//>>label: Slider
14819//>>group: Widgets
14820//>>description: Displays a flexible slider with ranges and accessibility via keyboard.
14821//>>docs: http://api.jqueryui.com/slider/
14822//>>demos: http://jqueryui.com/slider/
14823//>>css.structure: ../../themes/base/core.css
14824//>>css.structure: ../../themes/base/slider.css
14825//>>css.theme: ../../themes/base/theme.css
14826
14827
14828var widgetsSlider = $.widget( "ui.slider", $.ui.mouse, {
14829	version: "1.13.2",
14830	widgetEventPrefix: "slide",
14831
14832	options: {
14833		animate: false,
14834		classes: {
14835			"ui-slider": "ui-corner-all",
14836			"ui-slider-handle": "ui-corner-all",
14837
14838			// Note: ui-widget-header isn't the most fittingly semantic framework class for this
14839			// element, but worked best visually with a variety of themes
14840			"ui-slider-range": "ui-corner-all ui-widget-header"
14841		},
14842		distance: 0,
14843		max: 100,
14844		min: 0,
14845		orientation: "horizontal",
14846		range: false,
14847		step: 1,
14848		value: 0,
14849		values: null,
14850
14851		// Callbacks
14852		change: null,
14853		slide: null,
14854		start: null,
14855		stop: null
14856	},
14857
14858	// Number of pages in a slider
14859	// (how many times can you page up/down to go through the whole range)
14860	numPages: 5,
14861
14862	_create: function() {
14863		this._keySliding = false;
14864		this._mouseSliding = false;
14865		this._animateOff = true;
14866		this._handleIndex = null;
14867		this._detectOrientation();
14868		this._mouseInit();
14869		this._calculateNewMax();
14870
14871		this._addClass( "ui-slider ui-slider-" + this.orientation,
14872			"ui-widget ui-widget-content" );
14873
14874		this._refresh();
14875
14876		this._animateOff = false;
14877	},
14878
14879	_refresh: function() {
14880		this._createRange();
14881		this._createHandles();
14882		this._setupEvents();
14883		this._refreshValue();
14884	},
14885
14886	_createHandles: function() {
14887		var i, handleCount,
14888			options = this.options,
14889			existingHandles = this.element.find( ".ui-slider-handle" ),
14890			handle = "<span tabindex='0'></span>",
14891			handles = [];
14892
14893		handleCount = ( options.values && options.values.length ) || 1;
14894
14895		if ( existingHandles.length > handleCount ) {
14896			existingHandles.slice( handleCount ).remove();
14897			existingHandles = existingHandles.slice( 0, handleCount );
14898		}
14899
14900		for ( i = existingHandles.length; i < handleCount; i++ ) {
14901			handles.push( handle );
14902		}
14903
14904		this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) );
14905
14906		this._addClass( this.handles, "ui-slider-handle", "ui-state-default" );
14907
14908		this.handle = this.handles.eq( 0 );
14909
14910		this.handles.each( function( i ) {
14911			$( this )
14912				.data( "ui-slider-handle-index", i )
14913				.attr( "tabIndex", 0 );
14914		} );
14915	},
14916
14917	_createRange: function() {
14918		var options = this.options;
14919
14920		if ( options.range ) {
14921			if ( options.range === true ) {
14922				if ( !options.values ) {
14923					options.values = [ this._valueMin(), this._valueMin() ];
14924				} else if ( options.values.length && options.values.length !== 2 ) {
14925					options.values = [ options.values[ 0 ], options.values[ 0 ] ];
14926				} else if ( Array
vendor: 6,343 bytes, lines 14926-15172
14926.isArray( options.values ) ) {
14927					options.values = options.values.slice( 0 );
14928				}
14929			}
14930
14931			if ( !this.range || !this.range.length ) {
14932				this.range = $( "<div>" )
14933					.appendTo( this.element );
14934
14935				this._addClass( this.range, "ui-slider-range" );
14936			} else {
14937				this._removeClass( this.range, "ui-slider-range-min ui-slider-range-max" );
14938
14939				// Handle range switching from true to min/max
14940				this.range.css( {
14941					"left": "",
14942					"bottom": ""
14943				} );
14944			}
14945			if ( options.range === "min" || options.range === "max" ) {
14946				this._addClass( this.range, "ui-slider-range-" + options.range );
14947			}
14948		} else {
14949			if ( this.range ) {
14950				this.range.remove();
14951			}
14952			this.range = null;
14953		}
14954	},
14955
14956	_setupEvents: function() {
14957		this._off( this.handles );
14958		this._on( this.handles, this._handleEvents );
14959		this._hoverable( this.handles );
14960		this._focusable( this.handles );
14961	},
14962
14963	_destroy: function() {
14964		this.handles.remove();
14965		if ( this.range ) {
14966			this.range.remove();
14967		}
14968
14969		this._mouseDestroy();
14970	},
14971
14972	_mouseCapture: function( event ) {
14973		var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle,
14974			that = this,
14975			o = this.options;
14976
14977		if ( o.disabled ) {
14978			return false;
14979		}
14980
14981		this.elementSize = {
14982			width: this.element.outerWidth(),
14983			height: this.element.outerHeight()
14984		};
14985		this.elementOffset = this.element.offset();
14986
14987		position = { x: event.pageX, y: event.pageY };
14988		normValue = this._normValueFromMouse( position );
14989		distance = this._valueMax() - this._valueMin() + 1;
14990		this.handles.each( function( i ) {
14991			var thisDistance = Math.abs( normValue - that.values( i ) );
14992			if ( ( distance > thisDistance ) ||
14993				( distance === thisDistance &&
14994					( i === that._lastChangedValue || that.values( i ) === o.min ) ) ) {
14995				distance = thisDistance;
14996				closestHandle = $( this );
14997				index = i;
14998			}
14999		} );
15000
15001		allowed = this._start( event, index );
15002		if ( allowed === false ) {
15003			return false;
15004		}
15005		this._mouseSliding = true;
15006
15007		this._handleIndex = index;
15008
15009		this._addClass( closestHandle, null, "ui-state-active" );
15010		closestHandle.trigger( "focus" );
15011
15012		offset = closestHandle.offset();
15013		mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" );
15014		this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
15015			left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
15016			top: event.pageY - offset.top -
15017				( closestHandle.height() / 2 ) -
15018				( parseInt( closestHandle.css( "borderTopWidth" ), 10 ) || 0 ) -
15019				( parseInt( closestHandle.css( "borderBottomWidth" ), 10 ) || 0 ) +
15020				( parseInt( closestHandle.css( "marginTop" ), 10 ) || 0 )
15021		};
15022
15023		if ( !this.handles.hasClass( "ui-state-hover" ) ) {
15024			this._slide( event, index, normValue );
15025		}
15026		this._animateOff = true;
15027		return true;
15028	},
15029
15030	_mouseStart: function() {
15031		return true;
15032	},
15033
15034	_mouseDrag: function( event ) {
15035		var position = { x: event.pageX, y: event.pageY },
15036			normValue = this._normValueFromMouse( position );
15037
15038		this._slide( event, this._handleIndex, normValue );
15039
15040		return false;
15041	},
15042
15043	_mouseStop: function( event ) {
15044		this._removeClass( this.handles, null, "ui-state-active" );
15045		this._mouseSliding = false;
15046
15047		this._stop( event, this._handleIndex );
15048		this._change( event, this._handleIndex );
15049
15050		this._handleIndex = null;
15051		this._clickOffset = null;
15052		this._animateOff = false;
15053
15054		return false;
15055	},
15056
15057	_detectOrientation: function() {
15058		this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal";
15059	},
15060
15061	_normValueFromMouse: function( position ) {
15062		var pixelTotal,
15063			pixelMouse,
15064			percentMouse,
15065			valueTotal,
15066			valueMouse;
15067
15068		if ( this.orientation === "horizontal" ) {
15069			pixelTotal = this.elementSize.width;
15070			pixelMouse = position.x - this.elementOffset.left -
15071				( this._clickOffset ? this._clickOffset.left : 0 );
15072		} else {
15073			pixelTotal = this.elementSize.height;
15074			pixelMouse = position.y - this.elementOffset.top -
15075				( this._clickOffset ? this._clickOffset.top : 0 );
15076		}
15077
15078		percentMouse = ( pixelMouse / pixelTotal );
15079		if ( percentMouse > 1 ) {
15080			percentMouse = 1;
15081		}
15082		if ( percentMouse < 0 ) {
15083			percentMouse = 0;
15084		}
15085		if ( this.orientation === "vertical" ) {
15086			percentMouse = 1 - percentMouse;
15087		}
15088
15089		valueTotal = this._valueMax() - this._valueMin();
15090		valueMouse = this._valueMin() + percentMouse * valueTotal;
15091
15092		return this._trimAlignValue( valueMouse );
15093	},
15094
15095	_uiHash: function( index, value, values ) {
15096		var uiHash = {
15097			handle: this.handles[ index ],
15098			handleIndex: index,
15099			value: value !== undefined ? value : this.value()
15100		};
15101
15102		if ( this._hasMultipleValues() ) {
15103			uiHash.value = value !== undefined ? value : this.values( index );
15104			uiHash.values = values || this.values();
15105		}
15106
15107		return uiHash;
15108	},
15109
15110	_hasMultipleValues: function() {
15111		return this.options.values && this.options.values.length;
15112	},
15113
15114	_start: function( event, index ) {
15115		return this._trigger( "start", event, this._uiHash( index ) );
15116	},
15117
15118	_slide: function( event, index, newVal ) {
15119		var allowed, otherVal,
15120			currentValue = this.value(),
15121			newValues = this.values();
15122
15123		if ( this._hasMultipleValues() ) {
15124			otherVal = this.values( index ? 0 : 1 );
15125			currentValue = this.values( index );
15126
15127			if ( this.options.values.length === 2 && this.options.range === true ) {
15128				newVal =  index === 0 ? Math.min( otherVal, newVal ) : Math.max( otherVal, newVal );
15129			}
15130
15131			newValues[ index ] = newVal;
15132		}
15133
15134		if ( newVal === currentValue ) {
15135			return;
15136		}
15137
15138		allowed = this._trigger( "slide", event, this._uiHash( index, newVal, newValues ) );
15139
15140		// A slide can be canceled by returning false from the slide callback
15141		if ( allowed === false ) {
15142			return;
15143		}
15144
15145		if ( this._hasMultipleValues() ) {
15146			this.values( index, newVal );
15147		} else {
15148			this.value( newVal );
15149		}
15150	},
15151
15152	_stop: function( event, index ) {
15153		this._trigger( "stop", event, this._uiHash( index ) );
15154	},
15155
15156	_change: function( event, index ) {
15157		if ( !this._keySliding && !this._mouseSliding ) {
15158
15159			//store the last changed value index for reference when handles overlap
15160			this._lastChangedValue = index;
15161			this._trigger( "change", event, this._uiHash( index ) );
15162		}
15163	},
15164
15165	value: function( newValue ) {
15166		if ( arguments.length ) {
15167			this.options.value = this._trimAlignValue( newValue );
15168			this._refreshValue();
15169			this._change( null, 0 );
15170			return;
15171		}
15172
vendor: 4,358 bytes, lines 15173-15345
15173		return this._value();
15174	},
15175
15176	values: function( index, newValue ) {
15177		var vals,
15178			newValues,
15179			i;
15180
15181		if ( arguments.length > 1 ) {
15182			this.options.values[ index ] = this._trimAlignValue( newValue );
15183			this._refreshValue();
15184			this._change( null, index );
15185			return;
15186		}
15187
15188		if ( arguments.length ) {
15189			if ( Array.isArray( arguments[ 0 ] ) ) {
15190				vals = this.options.values;
15191				newValues = arguments[ 0 ];
15192				for ( i = 0; i < vals.length; i += 1 ) {
15193					vals[ i ] = this._trimAlignValue( newValues[ i ] );
15194					this._change( null, i );
15195				}
15196				this._refreshValue();
15197			} else {
15198				if ( this._hasMultipleValues() ) {
15199					return this._values( index );
15200				} else {
15201					return this.value();
15202				}
15203			}
15204		} else {
15205			return this._values();
15206		}
15207	},
15208
15209	_setOption: function( key, value ) {
15210		var i,
15211			valsLength = 0;
15212
15213		if ( key === "range" && this.options.range === true ) {
15214			if ( value === "min" ) {
15215				this.options.value = this._values( 0 );
15216				this.options.values = null;
15217			} else if ( value === "max" ) {
15218				this.options.value = this._values( this.options.values.length - 1 );
15219				this.options.values = null;
15220			}
15221		}
15222
15223		if ( Array.isArray( this.options.values ) ) {
15224			valsLength = this.options.values.length;
15225		}
15226
15227		this._super( key, value );
15228
15229		switch ( key ) {
15230			case "orientation":
15231				this._detectOrientation();
15232				this._removeClass( "ui-slider-horizontal ui-slider-vertical" )
15233					._addClass( "ui-slider-" + this.orientation );
15234				this._refreshValue();
15235				if ( this.options.range ) {
15236					this._refreshRange( value );
15237				}
15238
15239				// Reset positioning from previous orientation
15240				this.handles.css( value === "horizontal" ? "bottom" : "left", "" );
15241				break;
15242			case "value":
15243				this._animateOff = true;
15244				this._refreshValue();
15245				this._change( null, 0 );
15246				this._animateOff = false;
15247				break;
15248			case "values":
15249				this._animateOff = true;
15250				this._refreshValue();
15251
15252				// Start from the last handle to prevent unreachable handles (#9046)
15253				for ( i = valsLength - 1; i >= 0; i-- ) {
15254					this._change( null, i );
15255				}
15256				this._animateOff = false;
15257				break;
15258			case "step":
15259			case "min":
15260			case "max":
15261				this._animateOff = true;
15262				this._calculateNewMax();
15263				this._refreshValue();
15264				this._animateOff = false;
15265				break;
15266			case "range":
15267				this._animateOff = true;
15268				this._refresh();
15269				this._animateOff = false;
15270				break;
15271		}
15272	},
15273
15274	_setOptionDisabled: function( value ) {
15275		this._super( value );
15276
15277		this._toggleClass( null, "ui-state-disabled", !!value );
15278	},
15279
15280	//internal value getter
15281	// _value() returns value trimmed by min and max, aligned by step
15282	_value: function() {
15283		var val = this.options.value;
15284		val = this._trimAlignValue( val );
15285
15286		return val;
15287	},
15288
15289	//internal values getter
15290	// _values() returns array of values trimmed by min and max, aligned by step
15291	// _values( index ) returns single value trimmed by min and max, aligned by step
15292	_values: function( index ) {
15293		var val,
15294			vals,
15295			i;
15296
15297		if ( arguments.length ) {
15298			val = this.options.values[ index ];
15299			val = this._trimAlignValue( val );
15300
15301			return val;
15302		} else if ( this._hasMultipleValues() ) {
15303
15304			// .slice() creates a copy of the array
15305			// this copy gets trimmed by min and max and then returned
15306			vals = this.options.values.slice();
15307			for ( i = 0; i < vals.length; i += 1 ) {
15308				vals[ i ] = this._trimAlignValue( vals[ i ] );
15309			}
15310
15311			return vals;
15312		} else {
15313			return [];
15314		}
15315	},
15316
15317	// Returns the step-aligned value that val is closest to, between (inclusive) min and max
15318	_trimAlignValue: function( val ) {
15319		if ( val <= this._valueMin() ) {
15320			return this._valueMin();
15321		}
15322		if ( val >= this._valueMax() ) {
15323			return this._valueMax();
15324		}
15325		var step = ( this.options.step > 0 ) ? this.options.step : 1,
15326			valModStep = ( val - this._valueMin() ) % step,
15327			alignValue = val - valModStep;
15328
15329		if ( Math.abs( valModStep ) * 2 >= step ) {
15330			alignValue += ( valModStep > 0 ) ? step : ( -step );
15331		}
15332
15333		// Since JavaScript has problems with large floats, round
15334		// the final value to 5 digits after the decimal point (see #4124)
15335		return parseFloat( alignValue.toFixed( 5 ) );
15336	},
15337
15338	_calculateNewMax: function() {
15339		var max = this.options.max,
15340			min = this._valueMin(),
15341			step = this.options.step,
15342			aboveMin = Math.round( ( max - min ) / step ) * step;
15343		max = aboveMin + min;
15344		if ( max > this.options.max ) {
15345
vendor: 5,565 bytes, lines 15346-15543
15346			//If max is not divisible by step, rounding off may increase its value
15347			max -= step;
15348		}
15349		this.max = parseFloat( max.toFixed( this._precision() ) );
15350	},
15351
15352	_precision: function() {
15353		var precision = this._precisionOf( this.options.step );
15354		if ( this.options.min !== null ) {
15355			precision = Math.max( precision, this._precisionOf( this.options.min ) );
15356		}
15357		return precision;
15358	},
15359
15360	_precisionOf: function( num ) {
15361		var str = num.toString(),
15362			decimal = str.indexOf( "." );
15363		return decimal === -1 ? 0 : str.length - decimal - 1;
15364	},
15365
15366	_valueMin: function() {
15367		return this.options.min;
15368	},
15369
15370	_valueMax: function() {
15371		return this.max;
15372	},
15373
15374	_refreshRange: function( orientation ) {
15375		if ( orientation === "vertical" ) {
15376			this.range.css( { "width": "", "left": "" } );
15377		}
15378		if ( orientation === "horizontal" ) {
15379			this.range.css( { "height": "", "bottom": "" } );
15380		}
15381	},
15382
15383	_refreshValue: function() {
15384		var lastValPercent, valPercent, value, valueMin, valueMax,
15385			oRange = this.options.range,
15386			o = this.options,
15387			that = this,
15388			animate = ( !this._animateOff ) ? o.animate : false,
15389			_set = {};
15390
15391		if ( this._hasMultipleValues() ) {
15392			this.handles.each( function( i ) {
15393				valPercent = ( that.values( i ) - that._valueMin() ) / ( that._valueMax() -
15394					that._valueMin() ) * 100;
15395				_set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
15396				$( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
15397				if ( that.options.range === true ) {
15398					if ( that.orientation === "horizontal" ) {
15399						if ( i === 0 ) {
15400							that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
15401								left: valPercent + "%"
15402							}, o.animate );
15403						}
15404						if ( i === 1 ) {
15405							that.range[ animate ? "animate" : "css" ]( {
15406								width: ( valPercent - lastValPercent ) + "%"
15407							}, {
15408								queue: false,
15409								duration: o.animate
15410							} );
15411						}
15412					} else {
15413						if ( i === 0 ) {
15414							that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
15415								bottom: ( valPercent ) + "%"
15416							}, o.animate );
15417						}
15418						if ( i === 1 ) {
15419							that.range[ animate ? "animate" : "css" ]( {
15420								height: ( valPercent - lastValPercent ) + "%"
15421							}, {
15422								queue: false,
15423								duration: o.animate
15424							} );
15425						}
15426					}
15427				}
15428				lastValPercent = valPercent;
15429			} );
15430		} else {
15431			value = this.value();
15432			valueMin = this._valueMin();
15433			valueMax = this._valueMax();
15434			valPercent = ( valueMax !== valueMin ) ?
15435					( value - valueMin ) / ( valueMax - valueMin ) * 100 :
15436					0;
15437			_set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
15438			this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
15439
15440			if ( oRange === "min" && this.orientation === "horizontal" ) {
15441				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
15442					width: valPercent + "%"
15443				}, o.animate );
15444			}
15445			if ( oRange === "max" && this.orientation === "horizontal" ) {
15446				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
15447					width: ( 100 - valPercent ) + "%"
15448				}, o.animate );
15449			}
15450			if ( oRange === "min" && this.orientation === "vertical" ) {
15451				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
15452					height: valPercent + "%"
15453				}, o.animate );
15454			}
15455			if ( oRange === "max" && this.orientation === "vertical" ) {
15456				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
15457					height: ( 100 - valPercent ) + "%"
15458				}, o.animate );
15459			}
15460		}
15461	},
15462
15463	_handleEvents: {
15464		keydown: function( event ) {
15465			var allowed, curVal, newVal, step,
15466				index = $( event.target ).data( "ui-slider-handle-index" );
15467
15468			switch ( event.keyCode ) {
15469				case $.ui.keyCode.HOME:
15470				case $.ui.keyCode.END:
15471				case $.ui.keyCode.PAGE_UP:
15472				case $.ui.keyCode.PAGE_DOWN:
15473				case $.ui.keyCode.UP:
15474				case $.ui.keyCode.RIGHT:
15475				case $.ui.keyCode.DOWN:
15476				case $.ui.keyCode.LEFT:
15477					event.preventDefault();
15478					if ( !this._keySliding ) {
15479						this._keySliding = true;
15480						this._addClass( $( event.target ), null, "ui-state-active" );
15481						allowed = this._start( event, index );
15482						if ( allowed === false ) {
15483							return;
15484						}
15485					}
15486					break;
15487			}
15488
15489			step = this.options.step;
15490			if ( this._hasMultipleValues() ) {
15491				curVal = newVal = this.values( index );
15492			} else {
15493				curVal = newVal = this.value();
15494			}
15495
15496			switch ( event.keyCode ) {
15497				case $.ui.keyCode.HOME:
15498					newVal = this._valueMin();
15499					break;
15500				case $.ui.keyCode.END:
15501					newVal = this._valueMax();
15502					break;
15503				case $.ui.keyCode.PAGE_UP:
15504					newVal = this._trimAlignValue(
15505						curVal + ( ( this._valueMax() - this._valueMin() ) / this.numPages )
15506					);
15507					break;
15508				case $.ui.keyCode.PAGE_DOWN:
15509					newVal = this._trimAlignValue(
15510						curVal - ( ( this._valueMax() - this._valueMin() ) / this.numPages ) );
15511					break;
15512				case $.ui.keyCode.UP:
15513				case $.ui.keyCode.RIGHT:
15514					if ( curVal === this._valueMax() ) {
15515						return;
15516					}
15517					newVal = this._trimAlignValue( curVal + step );
15518					break;
15519				case $.ui.keyCode.DOWN:
15520				case $.ui.keyCode.LEFT:
15521					if ( curVal === this._valueMin() ) {
15522						return;
15523					}
15524					newVal = this._trimAlignValue( curVal - step );
15525					break;
15526			}
15527
15528			this._slide( event, index, newVal );
15529		},
15530		keyup: function( event ) {
15531			var index = $( event.target ).data( "ui-slider-handle-index" );
15532
15533			if ( this._keySliding ) {
15534				this._keySliding = false;
15535				this._stop( event, index );
15536				this._change( event, index );
15537				this._removeClass( $( event.target ), null, "ui-state-active" );
15538			}
15539		}
15540	}
15541} );
15542
15543
15544/*!
15545 * jQuery UI Sortable 1.13.2
15546 * http://jqueryui.com
15547 *
15548 * Copyright jQuery Foundation and other contributors
15549 * Released under the MIT license.
15550 * http://jquery.org/license
15551 */
15552
15553//>>label: Sortable
15554//>>group: Interactions
15555//>>description: Enables items in a list to be sorted using the mouse.
15556//>>docs: http://api.jqueryui.com/sortable/
15557//>>demos: http://jqueryui.com/sortable/
15558//>>css.structure: ../../themes/base/sortable.css
15559
15560
15561var widgetsSortable = $.widget( "ui.sortable", $.ui.mouse, {
15562	version: "1.13.2
vendor: 46,802 bytes, lines 15562-17138
15562",
15563	widgetEventPrefix: "sort",
15564	ready: false,
15565	options: {
15566		appendTo: "parent",
15567		axis: false,
15568		connectWith: false,
15569		containment: false,
15570		cursor: "auto",
15571		cursorAt: false,
15572		dropOnEmpty: true,
15573		forcePlaceholderSize: false,
15574		forceHelperSize: false,
15575		grid: false,
15576		handle: false,
15577		helper: "original",
15578		items: "> *",
15579		opacity: false,
15580		placeholder: false,
15581		revert: false,
15582		scroll: true,
15583		scrollSensitivity: 20,
15584		scrollSpeed: 20,
15585		scope: "default",
15586		tolerance: "intersect",
15587		zIndex: 1000,
15588
15589		// Callbacks
15590		activate: null,
15591		beforeStop: null,
15592		change: null,
15593		deactivate: null,
15594		out: null,
15595		over: null,
15596		receive: null,
15597		remove: null,
15598		sort: null,
15599		start: null,
15600		stop: null,
15601		update: null
15602	},
15603
15604	_isOverAxis: function( x, reference, size ) {
15605		return ( x >= reference ) && ( x < ( reference + size ) );
15606	},
15607
15608	_isFloating: function( item ) {
15609		return ( /left|right/ ).test( item.css( "float" ) ) ||
15610			( /inline|table-cell/ ).test( item.css( "display" ) );
15611	},
15612
15613	_create: function() {
15614		this.containerCache = {};
15615		this._addClass( "ui-sortable" );
15616
15617		//Get the items
15618		this.refresh();
15619
15620		//Let's determine the parent's offset
15621		this.offset = this.element.offset();
15622
15623		//Initialize mouse events for interaction
15624		this._mouseInit();
15625
15626		this._setHandleClassName();
15627
15628		//We're ready to go
15629		this.ready = true;
15630
15631	},
15632
15633	_setOption: function( key, value ) {
15634		this._super( key, value );
15635
15636		if ( key === "handle" ) {
15637			this._setHandleClassName();
15638		}
15639	},
15640
15641	_setHandleClassName: function() {
15642		var that = this;
15643		this._removeClass( this.element.find( ".ui-sortable-handle" ), "ui-sortable-handle" );
15644		$.each( this.items, function() {
15645			that._addClass(
15646				this.instance.options.handle ?
15647					this.item.find( this.instance.options.handle ) :
15648					this.item,
15649				"ui-sortable-handle"
15650			);
15651		} );
15652	},
15653
15654	_destroy: function() {
15655		this._mouseDestroy();
15656
15657		for ( var i = this.items.length - 1; i >= 0; i-- ) {
15658			this.items[ i ].item.removeData( this.widgetName + "-item" );
15659		}
15660
15661		return this;
15662	},
15663
15664	_mouseCapture: function( event, overrideHandle ) {
15665		var currentItem = null,
15666			validHandle = false,
15667			that = this;
15668
15669		if ( this.reverting ) {
15670			return false;
15671		}
15672
15673		if ( this.options.disabled || this.options.type === "static" ) {
15674			return false;
15675		}
15676
15677		//We have to refresh the items data once first
15678		this._refreshItems( event );
15679
15680		//Find out if the clicked node (or one of its parents) is a actual item in this.items
15681		$( event.target ).parents().each( function() {
15682			if ( $.data( this, that.widgetName + "-item" ) === that ) {
15683				currentItem = $( this );
15684				return false;
15685			}
15686		} );
15687		if ( $.data( event.target, that.widgetName + "-item" ) === that ) {
15688			currentItem = $( event.target );
15689		}
15690
15691		if ( !currentItem ) {
15692			return false;
15693		}
15694		if ( this.options.handle && !overrideHandle ) {
15695			$( this.options.handle, currentItem ).find( "*" ).addBack().each( function() {
15696				if ( this === event.target ) {
15697					validHandle = true;
15698				}
15699			} );
15700			if ( !validHandle ) {
15701				return false;
15702			}
15703		}
15704
15705		this.currentItem = currentItem;
15706		this._removeCurrentsFromItems();
15707		return true;
15708
15709	},
15710
15711	_mouseStart: function( event, overrideHandle, noActivation ) {
15712
15713		var i, body,
15714			o = this.options;
15715
15716		this.currentContainer = this;
15717
15718		//We only need to call refreshPositions, because the refreshItems call has been moved to
15719		// mouseCapture
15720		this.refreshPositions();
15721
15722		//Prepare the dragged items parent
15723		this.appendTo = $( o.appendTo !== "parent" ?
15724				o.appendTo :
15725				this.currentItem.parent() );
15726
15727		//Create and append the visible helper
15728		this.helper = this._createHelper( event );
15729
15730		//Cache the helper size
15731		this._cacheHelperProportions();
15732
15733		/*
15734		 * - Position generation -
15735		 * This block generates everything position related - it's the core of draggables.
15736		 */
15737
15738		//Cache the margins of the original element
15739		this._cacheMargins();
15740
15741		//The element's absolute position on the page minus margins
15742		this.offset = this.currentItem.offset();
15743		this.offset = {
15744			top: this.offset.top - this.margins.top,
15745			left: this.offset.left - this.margins.left
15746		};
15747
15748		$.extend( this.offset, {
15749			click: { //Where the click happened, relative to the element
15750				left: event.pageX - this.offset.left,
15751				top: event.pageY - this.offset.top
15752			},
15753
15754			// This is a relative to absolute position minus the actual position calculation -
15755			// only used for relative positioned helper
15756			relative: this._getRelativeOffset()
15757		} );
15758
15759		// After we get the helper offset, but before we get the parent offset we can
15760		// change the helper's position to absolute
15761		// TODO: Still need to figure out a way to make relative sorting possible
15762		this.helper.css( "position", "absolute" );
15763		this.cssPosition = this.helper.css( "position" );
15764
15765		//Adjust the mouse offset relative to the helper if "cursorAt" is supplied
15766		if ( o.cursorAt ) {
15767			this._adjustOffsetFromHelper( o.cursorAt );
15768		}
15769
15770		//Cache the former DOM position
15771		this.domPosition = {
15772			prev: this.currentItem.prev()[ 0 ],
15773			parent: this.currentItem.parent()[ 0 ]
15774		};
15775
15776		// If the helper is not the original, hide the original so it's not playing any role during
15777		// the drag, won't cause anything bad this way
15778		if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
15779			this.currentItem.hide();
15780		}
15781
15782		//Create the placeholder
15783		this._createPlaceholder();
15784
15785		//Get the next scrolling parent
15786		this.scrollParent = this.placeholder.scrollParent();
15787
15788		$.extend( this.offset, {
15789			parent: this._getParentOffset()
15790		} );
15791
15792		//Set a containment if given in the options
15793		if ( o.containment ) {
15794			this._setContainment();
15795		}
15796
15797		if ( o.cursor && o.cursor !== "auto" ) { // cursor option
15798			body = this.document.find( "body" );
15799
15800			// Support: IE
15801			this.storedCursor = body.css( "cursor" );
15802			body.css( "cursor", o.cursor );
15803
15804			this.storedStylesheet =
15805				$( "<style>*{ cursor: " + o.cursor + " !important; }</style>" ).appendTo( body );
15806		}
15807
15808		// We need to make sure to grab the zIndex before setting the
15809		// opacity, because setting the opacity to anything lower than 1
15810		// causes the zIndex to change from "auto" to 0.
15811		if ( o.zIndex ) { // zIndex option
15812			if ( this.helper.css( "zIndex" ) ) {
15813				this._storedZIndex = this.helper.css( "zIndex" );
15814			}
15815			this.helper.css( "zIndex", o.zIndex );
15816		}
15817
15818		if ( o.opacity ) { // opacity option
15819			if ( this.helper.css( "opacity" ) ) {
15820				this._storedOpacity = this.helper.css( "opacity" );
15821			}
15822			this.helper.css( "opacity", o.opacity );
15823		}
15824
15825		//Prepare scrolling
15826		if ( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
15827				this.scrollParent[ 0 ].tagName !== "HTML" ) {
15828			this.overflowOffset = this.scrollParent.offset();
15829		}
15830
15831		//Call callbacks
15832		this._trigger( "start", event, this._uiHash() );
15833
15834		//Recache the helper size
15835		if ( !this._preserveHelperProportions ) {
15836			this._cacheHelperProportions();
15837		}
15838
15839		//Post "activate" events to possible containers
15840		if ( !noActivation ) {
15841			for ( i = this.containers.length - 1; i >= 0; i-- ) {
15842				this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) );
15843			}
15844		}
15845
15846		//Prepare possible droppables
15847		if ( $.ui.ddmanager ) {
15848			$.ui.ddmanager.current = this;
15849		}
15850
15851		if ( $.ui.ddmanager && !o.dropBehaviour ) {
15852			$.ui.ddmanager.prepareOffsets( this, event );
15853		}
15854
15855		this.dragging = true;
15856
15857		this._addClass( this.helper, "ui-sortable-helper" );
15858
15859		//Move the helper, if needed
15860		if ( !this.helper.parent().is( this.appendTo ) ) {
15861			this.helper.detach().appendTo( this.appendTo );
15862
15863			//Update position
15864			this.offset.parent = this._getParentOffset();
15865		}
15866
15867		//Generate the original position
15868		this.position = this.originalPosition = this._generatePosition( event );
15869		this.originalPageX = event.pageX;
15870		this.originalPageY = event.pageY;
15871		this.lastPositionAbs = this.positionAbs = this._convertPositionTo( "absolute" );
15872
15873		this._mouseDrag( event );
15874
15875		return true;
15876
15877	},
15878
15879	_scroll: function( event ) {
15880		var o = this.options,
15881			scrolled = false;
15882
15883		if ( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
15884				this.scrollParent[ 0 ].tagName !== "HTML" ) {
15885
15886			if ( ( this.overflowOffset.top + this.scrollParent[ 0 ].offsetHeight ) -
15887					event.pageY < o.scrollSensitivity ) {
15888				this.scrollParent[ 0 ].scrollTop =
15889					scrolled = this.scrollParent[ 0 ].scrollTop + o.scrollSpeed;
15890			} else if ( event.pageY - this.overflowOffset.top < o.scrollSensitivity ) {
15891				this.scrollParent[ 0 ].scrollTop =
15892					scrolled = this.scrollParent[ 0 ].scrollTop - o.scrollSpeed;
15893			}
15894
15895			if ( ( this.overflowOffset.left + this.scrollParent[ 0 ].offsetWidth ) -
15896					event.pageX < o.scrollSensitivity ) {
15897				this.scrollParent[ 0 ].scrollLeft = scrolled =
15898					this.scrollParent[ 0 ].scrollLeft + o.scrollSpeed;
15899			} else if ( event.pageX - this.overflowOffset.left < o.scrollSensitivity ) {
15900				this.scrollParent[ 0 ].scrollLeft = scrolled =
15901					this.scrollParent[ 0 ].scrollLeft - o.scrollSpeed;
15902			}
15903
15904		} else {
15905
15906			if ( event.pageY - this.document.scrollTop() < o.scrollSensitivity ) {
15907				scrolled = this.document.scrollTop( this.document.scrollTop() - o.scrollSpeed );
15908			} else if ( this.window.height() - ( event.pageY - this.document.scrollTop() ) <
15909					o.scrollSensitivity ) {
15910				scrolled = this.document.scrollTop( this.document.scrollTop() + o.scrollSpeed );
15911			}
15912
15913			if ( event.pageX - this.document.scrollLeft() < o.scrollSensitivity ) {
15914				scrolled = this.document.scrollLeft(
15915					this.document.scrollLeft() - o.scrollSpeed
15916				);
15917			} else if ( this.window.width() - ( event.pageX - this.document.scrollLeft() ) <
15918					o.scrollSensitivity ) {
15919				scrolled = this.document.scrollLeft(
15920					this.document.scrollLeft() + o.scrollSpeed
15921				);
15922			}
15923
15924		}
15925
15926		return scrolled;
15927	},
15928
15929	_mouseDrag: function( event ) {
15930		var i, item, itemElement, intersection,
15931			o = this.options;
15932
15933		//Compute the helpers position
15934		this.position = this._generatePosition( event );
15935		this.positionAbs = this._convertPositionTo( "absolute" );
15936
15937		//Set the helper position
15938		if ( !this.options.axis || this.options.axis !== "y" ) {
15939			this.helper[ 0 ].style.left = this.position.left + "px";
15940		}
15941		if ( !this.options.axis || this.options.axis !== "x" ) {
15942			this.helper[ 0 ].style.top = this.position.top + "px";
15943		}
15944
15945		//Do scrolling
15946		if ( o.scroll ) {
15947			if ( this._scroll( event ) !== false ) {
15948
15949				//Update item positions used in position checks
15950				this._refreshItemPositions( true );
15951
15952				if ( $.ui.ddmanager && !o.dropBehaviour ) {
15953					$.ui.ddmanager.prepareOffsets( this, event );
15954				}
15955			}
15956		}
15957
15958		this.dragDirection = {
15959			vertical: this._getDragVerticalDirection(),
15960			horizontal: this._getDragHorizontalDirection()
15961		};
15962
15963		//Rearrange
15964		for ( i = this.items.length - 1; i >= 0; i-- ) {
15965
15966			//Cache variables and intersection, continue if no intersection
15967			item = this.items[ i ];
15968			itemElement = item.item[ 0 ];
15969			intersection = this._intersectsWithPointer( item );
15970			if ( !intersection ) {
15971				continue;
15972			}
15973
15974			// Only put the placeholder inside the current Container, skip all
15975			// items from other containers. This works because when moving
15976			// an item from one container to another the
15977			// currentContainer is switched before the placeholder is moved.
15978			//
15979			// Without this, moving items in "sub-sortables" can cause
15980			// the placeholder to jitter between the outer and inner container.
15981			if ( item.instance !== this.currentContainer ) {
15982				continue;
15983			}
15984
15985			// Cannot intersect with itself
15986			// no useless actions that have been done before
15987			// no action if the item moved is the parent of the item checked
15988			if ( itemElement !== this.currentItem[ 0 ] &&
15989				this.placeholder[ intersection === 1 ?
15990				"next" : "prev" ]()[ 0 ] !== itemElement &&
15991				!$.contains( this.placeholder[ 0 ], itemElement ) &&
15992				( this.options.type === "semi-dynamic" ?
15993					!$.contains( this.element[ 0 ], itemElement ) :
15994					true
15995				)
15996			) {
15997
15998				this.direction = intersection === 1 ? "down" : "up";
15999
16000				if ( this.options.tolerance === "pointer" ||
16001						this._intersectsWithSides( item ) ) {
16002					this._rearrange( event, item );
16003				} else {
16004					break;
16005				}
16006
16007				this._trigger( "change", event, this._uiHash() );
16008				break;
16009			}
16010		}
16011
16012		//Post events to containers
16013		this._contactContainers( event );
16014
16015		//Interconnect with droppables
16016		if ( $.ui.ddmanager ) {
16017			$.ui.ddmanager.drag( this, event );
16018		}
16019
16020		//Call callbacks
16021		this._trigger( "sort", event, this._uiHash() );
16022
16023		this.lastPositionAbs = this.positionAbs;
16024		return false;
16025
16026	},
16027
16028	_mouseStop: function( event, noPropagation ) {
16029
16030		if ( !event ) {
16031			return;
16032		}
16033
16034		//If we are using droppables, inform the manager about the drop
16035		if ( $.ui.ddmanager && !this.options.dropBehaviour ) {
16036			$.ui.ddmanager.drop( this, event );
16037		}
16038
16039		if ( this.options.revert ) {
16040			var that = this,
16041				cur = this.placeholder.offset(),
16042				axis = this.options.axis,
16043				animation = {};
16044
16045			if ( !axis || axis === "x" ) {
16046				animation.left = cur.left - this.offset.parent.left - this.margins.left +
16047					( this.offsetParent[ 0 ] === this.document[ 0 ].body ?
16048						0 :
16049						this.offsetParent[ 0 ].scrollLeft
16050					);
16051			}
16052			if ( !axis || axis === "y" ) {
16053				animation.top = cur.top - this.offset.parent.top - this.margins.top +
16054					( this.offsetParent[ 0 ] === this.document[ 0 ].body ?
16055						0 :
16056						this.offsetParent[ 0 ].scrollTop
16057					);
16058			}
16059			this.reverting = true;
16060			$( this.helper ).animate(
16061				animation,
16062				parseInt( this.options.revert, 10 ) || 500,
16063				function() {
16064					that._clear( event );
16065				}
16066			);
16067		} else {
16068			this._clear( event, noPropagation );
16069		}
16070
16071		return false;
16072
16073	},
16074
16075	cancel: function() {
16076
16077		if ( this.dragging ) {
16078
16079			this._mouseUp( new $.Event( "mouseup", { target: null } ) );
16080
16081			if ( this.options.helper === "original" ) {
16082				this.currentItem.css( this._storedCSS );
16083				this._removeClass( this.currentItem, "ui-sortable-helper" );
16084			} else {
16085				this.currentItem.show();
16086			}
16087
16088			//Post deactivating events to containers
16089			for ( var i = this.containers.length - 1; i >= 0; i-- ) {
16090				this.containers[ i ]._trigger( "deactivate", null, this._uiHash( this ) );
16091				if ( this.containers[ i ].containerCache.over ) {
16092					this.containers[ i ]._trigger( "out", null, this._uiHash( this ) );
16093					this.containers[ i ].containerCache.over = 0;
16094				}
16095			}
16096
16097		}
16098
16099		if ( this.placeholder ) {
16100
16101			//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,
16102			// it unbinds ALL events from the original node!
16103			if ( this.placeholder[ 0 ].parentNode ) {
16104				this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] );
16105			}
16106			if ( this.options.helper !== "original" && this.helper &&
16107					this.helper[ 0 ].parentNode ) {
16108				this.helper.remove();
16109			}
16110
16111			$.extend( this, {
16112				helper: null,
16113				dragging: false,
16114				reverting: false,
16115				_noFinalSort: null
16116			} );
16117
16118			if ( this.domPosition.prev ) {
16119				$( this.domPosition.prev ).after( this.currentItem );
16120			} else {
16121				$( this.domPosition.parent ).prepend( this.currentItem );
16122			}
16123		}
16124
16125		return this;
16126
16127	},
16128
16129	serialize: function( o ) {
16130
16131		var items = this._getItemsAsjQuery( o && o.connected ),
16132			str = [];
16133		o = o || {};
16134
16135		$( items ).each( function() {
16136			var res = ( $( o.item || this ).attr( o.attribute || "id" ) || "" )
16137				.match( o.expression || ( /(.+)[\-=_](.+)/ ) );
16138			if ( res ) {
16139				str.push(
16140					( o.key || res[ 1 ] + "[]" ) +
16141					"=" + ( o.key && o.expression ? res[ 1 ] : res[ 2 ] ) );
16142			}
16143		} );
16144
16145		if ( !str.length && o.key ) {
16146			str.push( o.key + "=" );
16147		}
16148
16149		return str.join( "&" );
16150
16151	},
16152
16153	toArray: function( o ) {
16154
16155		var items = this._getItemsAsjQuery( o && o.connected ),
16156			ret = [];
16157
16158		o = o || {};
16159
16160		items.each( function() {
16161			ret.push( $( o.item || this ).attr( o.attribute || "id" ) || "" );
16162		} );
16163		return ret;
16164
16165	},
16166
16167	/* Be careful with the following core functions */
16168	_intersectsWith: function( item ) {
16169
16170		var x1 = this.positionAbs.left,
16171			x2 = x1 + this.helperProportions.width,
16172			y1 = this.positionAbs.top,
16173			y2 = y1 + this.helperProportions.height,
16174			l = item.left,
16175			r = l + item.width,
16176			t = item.top,
16177			b = t + item.height,
16178			dyClick = this.offset.click.top,
16179			dxClick = this.offset.click.left,
16180			isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t &&
16181				( y1 + dyClick ) < b ),
16182			isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l &&
16183				( x1 + dxClick ) < r ),
16184			isOverElement = isOverElementHeight && isOverElementWidth;
16185
16186		if ( this.options.tolerance === "pointer" ||
16187			this.options.forcePointerForContainers ||
16188			( this.options.tolerance !== "pointer" &&
16189				this.helperProportions[ this.floating ? "width" : "height" ] >
16190				item[ this.floating ? "width" : "height" ] )
16191		) {
16192			return isOverElement;
16193		} else {
16194
16195			return ( l < x1 + ( this.helperProportions.width / 2 ) && // Right Half
16196				x2 - ( this.helperProportions.width / 2 ) < r && // Left Half
16197				t < y1 + ( this.helperProportions.height / 2 ) && // Bottom Half
16198				y2 - ( this.helperProportions.height / 2 ) < b ); // Top Half
16199
16200		}
16201	},
16202
16203	_intersectsWithPointer: function( item ) {
16204		var verticalDirection, horizontalDirection,
16205			isOverElementHeight = ( this.options.axis === "x" ) ||
16206				this._isOverAxis(
16207					this.positionAbs.top + this.offset.click.top, item.top, item.height ),
16208			isOverElementWidth = ( this.options.axis === "y" ) ||
16209				this._isOverAxis(
16210					this.positionAbs.left + this.offset.click.left, item.left, item.width ),
16211			isOverElement = isOverElementHeight && isOverElementWidth;
16212
16213		if ( !isOverElement ) {
16214			return false;
16215		}
16216
16217		verticalDirection = this.dragDirection.vertical;
16218		horizontalDirection = this.dragDirection.horizontal;
16219
16220		return this.floating ?
16221			( ( horizontalDirection === "right" || verticalDirection === "down" ) ? 2 : 1 ) :
16222			( verticalDirection && ( verticalDirection === "down" ? 2 : 1 ) );
16223
16224	},
16225
16226	_intersectsWithSides: function( item ) {
16227
16228		var isOverBottomHalf = this._isOverAxis( this.positionAbs.top +
16229				this.offset.click.top, item.top + ( item.height / 2 ), item.height ),
16230			isOverRightHalf = this._isOverAxis( this.positionAbs.left +
16231				this.offset.click.left, item.left + ( item.width / 2 ), item.width ),
16232			verticalDirection = this.dragDirection.vertical,
16233			horizontalDirection = this.dragDirection.horizontal;
16234
16235		if ( this.floating && horizontalDirection ) {
16236			return ( ( horizontalDirection === "right" && isOverRightHalf ) ||
16237				( horizontalDirection === "left" && !isOverRightHalf ) );
16238		} else {
16239			return verticalDirection && ( ( verticalDirection === "down" && isOverBottomHalf ) ||
16240				( verticalDirection === "up" && !isOverBottomHalf ) );
16241		}
16242
16243	},
16244
16245	_getDragVerticalDirection: function() {
16246		var delta = this.positionAbs.top - this.lastPositionAbs.top;
16247		return delta !== 0 && ( delta > 0 ? "down" : "up" );
16248	},
16249
16250	_getDragHorizontalDirection: function() {
16251		var delta = this.positionAbs.left - this.lastPositionAbs.left;
16252		return delta !== 0 && ( delta > 0 ? "right" : "left" );
16253	},
16254
16255	refresh: function( event ) {
16256		this._refreshItems( event );
16257		this._setHandleClassName();
16258		this.refreshPositions();
16259		return this;
16260	},
16261
16262	_connectWith: function() {
16263		var options = this.options;
16264		return options.connectWith.constructor === String ?
16265			[ options.connectWith ] :
16266			options.connectWith;
16267	},
16268
16269	_getItemsAsjQuery: function( connected ) {
16270
16271		var i, j, cur, inst,
16272			items = [],
16273			queries = [],
16274			connectWith = this._connectWith();
16275
16276		if ( connectWith && connected ) {
16277			for ( i = connectWith.length - 1; i >= 0; i-- ) {
16278				cur = $( connectWith[ i ], this.document[ 0 ] );
16279				for ( j = cur.length - 1; j >= 0; j-- ) {
16280					inst = $.data( cur[ j ], this.widgetFullName );
16281					if ( inst && inst !== this && !inst.options.disabled ) {
16282						queries.push( [ typeof inst.options.items === "function" ?
16283							inst.options.items.call( inst.element ) :
16284							$( inst.options.items, inst.element )
16285								.not( ".ui-sortable-helper" )
16286								.not( ".ui-sortable-placeholder" ), inst ] );
16287					}
16288				}
16289			}
16290		}
16291
16292		queries.push( [ typeof this.options.items === "function" ?
16293			this.options.items
16294				.call( this.element, null, { options: this.options, item: this.currentItem } ) :
16295			$( this.options.items, this.element )
16296				.not( ".ui-sortable-helper" )
16297				.not( ".ui-sortable-placeholder" ), this ] );
16298
16299		function addItems() {
16300			items.push( this );
16301		}
16302		for ( i = queries.length - 1; i >= 0; i-- ) {
16303			queries[ i ][ 0 ].each( addItems );
16304		}
16305
16306		return $( items );
16307
16308	},
16309
16310	_removeCurrentsFromItems: function() {
16311
16312		var list = this.currentItem.find( ":data(" + this.widgetName + "-item)" );
16313
16314		this.items = $.grep( this.items, function( item ) {
16315			for ( var j = 0; j < list.length; j++ ) {
16316				if ( list[ j ] === item.item[ 0 ] ) {
16317					return false;
16318				}
16319			}
16320			return true;
16321		} );
16322
16323	},
16324
16325	_refreshItems: function( event ) {
16326
16327		this.items = [];
16328		this.containers = [ this ];
16329
16330		var i, j, cur, inst, targetData, _queries, item, queriesLength,
16331			items = this.items,
16332			queries = [ [ typeof this.options.items === "function" ?
16333				this.options.items.call( this.element[ 0 ], event, { item: this.currentItem } ) :
16334				$( this.options.items, this.element ), this ] ],
16335			connectWith = this._connectWith();
16336
16337		//Shouldn't be run the first time through due to massive slow-down
16338		if ( connectWith && this.ready ) {
16339			for ( i = connectWith.length - 1; i >= 0; i-- ) {
16340				cur = $( connectWith[ i ], this.document[ 0 ] );
16341				for ( j = cur.length - 1; j >= 0; j-- ) {
16342					inst = $.data( cur[ j ], this.widgetFullName );
16343					if ( inst && inst !== this && !inst.options.disabled ) {
16344						queries.push( [ typeof inst.options.items === "function" ?
16345							inst.options.items
16346								.call( inst.element[ 0 ], event, { item: this.currentItem } ) :
16347							$( inst.options.items, inst.element ), inst ] );
16348						this.containers.push( inst );
16349					}
16350				}
16351			}
16352		}
16353
16354		for ( i = queries.length - 1; i >= 0; i-- ) {
16355			targetData = queries[ i ][ 1 ];
16356			_queries = queries[ i ][ 0 ];
16357
16358			for ( j = 0, queriesLength = _queries.length; j < queriesLength; j++ ) {
16359				item = $( _queries[ j ] );
16360
16361				// Data for target checking (mouse manager)
16362				item.data( this.widgetName + "-item", targetData );
16363
16364				items.push( {
16365					item: item,
16366					instance: targetData,
16367					width: 0, height: 0,
16368					left: 0, top: 0
16369				} );
16370			}
16371		}
16372
16373	},
16374
16375	_refreshItemPositions: function( fast ) {
16376		var i, item, t, p;
16377
16378		for ( i = this.items.length - 1; i >= 0; i-- ) {
16379			item = this.items[ i ];
16380
16381			//We ignore calculating positions of all connected containers when we're not over them
16382			if ( this.currentContainer && item.instance !== this.currentContainer &&
16383					item.item[ 0 ] !== this.currentItem[ 0 ] ) {
16384				continue;
16385			}
16386
16387			t = this.options.toleranceElement ?
16388				$( this.options.toleranceElement, item.item ) :
16389				item.item;
16390
16391			if ( !fast ) {
16392				item.width = t.outerWidth();
16393				item.height = t.outerHeight();
16394			}
16395
16396			p = t.offset();
16397			item.left = p.left;
16398			item.top = p.top;
16399		}
16400	},
16401
16402	refreshPositions: function( fast ) {
16403
16404		// Determine whether items are being displayed horizontally
16405		this.floating = this.items.length ?
16406			this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) :
16407			false;
16408
16409		// This has to be redone because due to the item being moved out/into the offsetParent,
16410		// the offsetParent's position will change
16411		if ( this.offsetParent && this.helper ) {
16412			this.offset.parent = this._getParentOffset();
16413		}
16414
16415		this._refreshItemPositions( fast );
16416
16417		var i, p;
16418
16419		if ( this.options.custom && this.options.custom.refreshContainers ) {
16420			this.options.custom.refreshContainers.call( this );
16421		} else {
16422			for ( i = this.containers.length - 1; i >= 0; i-- ) {
16423				p = this.containers[ i ].element.offset();
16424				this.containers[ i ].containerCache.left = p.left;
16425				this.containers[ i ].containerCache.top = p.top;
16426				this.containers[ i ].containerCache.width =
16427					this.containers[ i ].element.outerWidth();
16428				this.containers[ i ].containerCache.height =
16429					this.containers[ i ].element.outerHeight();
16430			}
16431		}
16432
16433		return this;
16434	},
16435
16436	_createPlaceholder: function( that ) {
16437		that = that || this;
16438		var className, nodeName,
16439			o = that.options;
16440
16441		if ( !o.placeholder || o.placeholder.constructor === String ) {
16442			className = o.placeholder;
16443			nodeName = that.currentItem[ 0 ].nodeName.toLowerCase();
16444			o.placeholder = {
16445				element: function() {
16446
16447					var element = $( "<" + nodeName + ">", that.document[ 0 ] );
16448
16449					that._addClass( element, "ui-sortable-placeholder",
16450							className || that.currentItem[ 0 ].className )
16451						._removeClass( element, "ui-sortable-helper" );
16452
16453					if ( nodeName === "tbody" ) {
16454						that._createTrPlaceholder(
16455							that.currentItem.find( "tr" ).eq( 0 ),
16456							$( "<tr>", that.document[ 0 ] ).appendTo( element )
16457						);
16458					} else if ( nodeName === "tr" ) {
16459						that._createTrPlaceholder( that.currentItem, element );
16460					} else if ( nodeName === "img" ) {
16461						element.attr( "src", that.currentItem.attr( "src" ) );
16462					}
16463
16464					if ( !className ) {
16465						element.css( "visibility", "hidden" );
16466					}
16467
16468					return element;
16469				},
16470				update: function( container, p ) {
16471
16472					// 1. If a className is set as 'placeholder option, we don't force sizes -
16473					// the class is responsible for that
16474					// 2. The option 'forcePlaceholderSize can be enabled to force it even if a
16475					// class name is specified
16476					if ( className && !o.forcePlaceholderSize ) {
16477						return;
16478					}
16479
16480					// If the element doesn't have a actual height or width by itself (without
16481					// styles coming from a stylesheet), it receives the inline height and width
16482					// from the dragged item. Or, if it's a tbody or tr, it's going to have a height
16483					// anyway since we're populating them with <td>s above, but they're unlikely to
16484					// be the correct height on their own if the row heights are dynamic, so we'll
16485					// always assign the height of the dragged item given forcePlaceholderSize
16486					// is true.
16487					if ( !p.height() || ( o.forcePlaceholderSize &&
16488							( nodeName === "tbody" || nodeName === "tr" ) ) ) {
16489						p.height(
16490							that.currentItem.innerHeight() -
16491							parseInt( that.currentItem.css( "paddingTop" ) || 0, 10 ) -
16492							parseInt( that.currentItem.css( "paddingBottom" ) || 0, 10 ) );
16493					}
16494					if ( !p.width() ) {
16495						p.width(
16496							that.currentItem.innerWidth() -
16497							parseInt( that.currentItem.css( "paddingLeft" ) || 0, 10 ) -
16498							parseInt( that.currentItem.css( "paddingRight" ) || 0, 10 ) );
16499					}
16500				}
16501			};
16502		}
16503
16504		//Create the placeholder
16505		that.placeholder = $( o.placeholder.element.call( that.element, that.currentItem ) );
16506
16507		//Append it after the actual current item
16508		that.currentItem.after( that.placeholder );
16509
16510		//Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
16511		o.placeholder.update( that, that.placeholder );
16512
16513	},
16514
16515	_createTrPlaceholder: function( sourceTr, targetTr ) {
16516		var that = this;
16517
16518		sourceTr.children().each( function() {
16519			$( "<td>&#160;</td>", that.document[ 0 ] )
16520				.attr( "colspan", $( this ).attr( "colspan" ) || 1 )
16521				.appendTo( targetTr );
16522		} );
16523	},
16524
16525	_contactContainers: function( event ) {
16526		var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom,
16527			floating, axis,
16528			innermostContainer = null,
16529			innermostIndex = null;
16530
16531		// Get innermost container that intersects with item
16532		for ( i = this.containers.length - 1; i >= 0; i-- ) {
16533
16534			// Never consider a container that's located within the item itself
16535			if ( $.contains( this.currentItem[ 0 ], this.containers[ i ].element[ 0 ] ) ) {
16536				continue;
16537			}
16538
16539			if ( this._intersectsWith( this.containers[ i ].containerCache ) ) {
16540
16541				// If we've already found a container and it's more "inner" than this, then continue
16542				if ( innermostContainer &&
16543						$.contains(
16544							this.containers[ i ].element[ 0 ],
16545							innermostContainer.element[ 0 ] ) ) {
16546					continue;
16547				}
16548
16549				innermostContainer = this.containers[ i ];
16550				innermostIndex = i;
16551
16552			} else {
16553
16554				// container doesn't intersect. trigger "out" event if necessary
16555				if ( this.containers[ i ].containerCache.over ) {
16556					this.containers[ i ]._trigger( "out", event, this._uiHash( this ) );
16557					this.containers[ i ].containerCache.over = 0;
16558				}
16559			}
16560
16561		}
16562
16563		// If no intersecting containers found, return
16564		if ( !innermostContainer ) {
16565			return;
16566		}
16567
16568		// Move the item into the container if it's not there already
16569		if ( this.containers.length === 1 ) {
16570			if ( !this.containers[ innermostIndex ].containerCache.over ) {
16571				this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) );
16572				this.containers[ innermostIndex ].containerCache.over = 1;
16573			}
16574		} else {
16575
16576			// When entering a new container, we will find the item with the least distance and
16577			// append our item near it
16578			dist = 10000;
16579			itemWithLeastDistance = null;
16580			floating = innermostContainer.floating || this._isFloating( this.currentItem );
16581			posProperty = floating ? "left" : "top";
16582			sizeProperty = floating ? "width" : "height";
16583			axis = floating ? "pageX" : "pageY";
16584
16585			for ( j = this.items.length - 1; j >= 0; j-- ) {
16586				if ( !$.contains(
16587						this.containers[ innermostIndex ].element[ 0 ], this.items[ j ].item[ 0 ] )
16588				) {
16589					continue;
16590				}
16591				if ( this.items[ j ].item[ 0 ] === this.currentItem[ 0 ] ) {
16592					continue;
16593				}
16594
16595				cur = this.items[ j ].item.offset()[ posProperty ];
16596				nearBottom = false;
16597				if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) {
16598					nearBottom = true;
16599				}
16600
16601				if ( Math.abs( event[ axis ] - cur ) < dist ) {
16602					dist = Math.abs( event[ axis ] - cur );
16603					itemWithLeastDistance = this.items[ j ];
16604					this.direction = nearBottom ? "up" : "down";
16605				}
16606			}
16607
16608			//Check if dropOnEmpty is enabled
16609			if ( !itemWithLeastDistance && !this.options.dropOnEmpty ) {
16610				return;
16611			}
16612
16613			if ( this.currentContainer === this.containers[ innermostIndex ] ) {
16614				if ( !this.currentContainer.containerCache.over ) {
16615					this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() );
16616					this.currentContainer.containerCache.over = 1;
16617				}
16618				return;
16619			}
16620
16621			if ( itemWithLeastDistance ) {
16622				this._rearrange( event, itemWithLeastDistance, null, true );
16623			} else {
16624				this._rearrange( event, null, this.containers[ innermostIndex ].element, true );
16625			}
16626			this._trigger( "change", event, this._uiHash() );
16627			this.containers[ innermostIndex ]._trigger( "change", event, this._uiHash( this ) );
16628			this.currentContainer = this.containers[ innermostIndex ];
16629
16630			//Update the placeholder
16631			this.options.placeholder.update( this.currentContainer, this.placeholder );
16632
16633			//Update scrollParent
16634			this.scrollParent = this.placeholder.scrollParent();
16635
16636			//Update overflowOffset
16637			if ( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
16638					this.scrollParent[ 0 ].tagName !== "HTML" ) {
16639				this.overflowOffset = this.scrollParent.offset();
16640			}
16641
16642			this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) );
16643			this.containers[ innermostIndex ].containerCache.over = 1;
16644		}
16645
16646	},
16647
16648	_createHelper: function( event ) {
16649
16650		var o = this.options,
16651			helper = typeof o.helper === "function" ?
16652				$( o.helper.apply( this.element[ 0 ], [ event, this.currentItem ] ) ) :
16653				( o.helper === "clone" ? this.currentItem.clone() : this.currentItem );
16654
16655		//Add the helper to the DOM if that didn't happen already
16656		if ( !helper.parents( "body" ).length ) {
16657			this.appendTo[ 0 ].appendChild( helper[ 0 ] );
16658		}
16659
16660		if ( helper[ 0 ] === this.currentItem[ 0 ] ) {
16661			this._storedCSS = {
16662				width: this.currentItem[ 0 ].style.width,
16663				height: this.currentItem[ 0 ].style.height,
16664				position: this.currentItem.css( "position" ),
16665				top: this.currentItem.css( "top" ),
16666				left: this.currentItem.css( "left" )
16667			};
16668		}
16669
16670		if ( !helper[ 0 ].style.width || o.forceHelperSize ) {
16671			helper.width( this.currentItem.width() );
16672		}
16673		if ( !helper[ 0 ].style.height || o.forceHelperSize ) {
16674			helper.height( this.currentItem.height() );
16675		}
16676
16677		return helper;
16678
16679	},
16680
16681	_adjustOffsetFromHelper: function( obj ) {
16682		if ( typeof obj === "string" ) {
16683			obj = obj.split( " " );
16684		}
16685		if ( Array.isArray( obj ) ) {
16686			obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 };
16687		}
16688		if ( "left" in obj ) {
16689			this.offset.click.left = obj.left + this.margins.left;
16690		}
16691		if ( "right" in obj ) {
16692			this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
16693		}
16694		if ( "top" in obj ) {
16695			this.offset.click.top = obj.top + this.margins.top;
16696		}
16697		if ( "bottom" in obj ) {
16698			this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
16699		}
16700	},
16701
16702	_getParentOffset: function() {
16703
16704		//Get the offsetParent and cache its position
16705		this.offsetParent = this.helper.offsetParent();
16706		var po = this.offsetParent.offset();
16707
16708		// This is a special case where we need to modify a offset calculated on start, since the
16709		// following happened:
16710		// 1. The position of the helper is absolute, so it's position is calculated based on the
16711		// next positioned parent
16712		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't
16713		// the document, which means that the scroll is included in the initial calculation of the
16714		// offset of the parent, and never recalculated upon drag
16715		if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== this.document[ 0 ] &&
16716				$.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) {
16717			po.left += this.scrollParent.scrollLeft();
16718			po.top += this.scrollParent.scrollTop();
16719		}
16720
16721		// This needs to be actually done for all browsers, since pageX/pageY includes this
16722		// information with an ugly IE fix
16723		if ( this.offsetParent[ 0 ] === this.document[ 0 ].body ||
16724				( this.offsetParent[ 0 ].tagName &&
16725				this.offsetParent[ 0 ].tagName.toLowerCase() === "html" && $.ui.ie ) ) {
16726			po = { top: 0, left: 0 };
16727		}
16728
16729		return {
16730			top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ),
16731			left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 )
16732		};
16733
16734	},
16735
16736	_getRelativeOffset: function() {
16737
16738		if ( this.cssPosition === "relative" ) {
16739			var p = this.currentItem.position();
16740			return {
16741				top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) +
16742					this.scrollParent.scrollTop(),
16743				left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) +
16744					this.scrollParent.scrollLeft()
16745			};
16746		} else {
16747			return { top: 0, left: 0 };
16748		}
16749
16750	},
16751
16752	_cacheMargins: function() {
16753		this.margins = {
16754			left: ( parseInt( this.currentItem.css( "marginLeft" ), 10 ) || 0 ),
16755			top: ( parseInt( this.currentItem.css( "marginTop" ), 10 ) || 0 )
16756		};
16757	},
16758
16759	_cacheHelperProportions: function() {
16760		this.helperProportions = {
16761			width: this.helper.outerWidth(),
16762			height: this.helper.outerHeight()
16763		};
16764	},
16765
16766	_setContainment: function() {
16767
16768		var ce, co, over,
16769			o = this.options;
16770		if ( o.containment === "parent" ) {
16771			o.containment = this.helper[ 0 ].parentNode;
16772		}
16773		if ( o.containment === "document" || o.containment === "window" ) {
16774			this.containment = [
16775				0 - this.offset.relative.left - this.offset.parent.left,
16776				0 - this.offset.relative.top - this.offset.parent.top,
16777				o.containment === "document" ?
16778					this.document.width() :
16779					this.window.width() - this.helperProportions.width - this.margins.left,
16780				( o.containment === "document" ?
16781					( this.document.height() || document.body.parentNode.scrollHeight ) :
16782					this.window.height() || this.document[ 0 ].body.parentNode.scrollHeight
16783				) - this.helperProportions.height - this.margins.top
16784			];
16785		}
16786
16787		if ( !( /^(document|window|parent)$/ ).test( o.containment ) ) {
16788			ce = $( o.containment )[ 0 ];
16789			co = $( o.containment ).offset();
16790			over = ( $( ce ).css( "overflow" ) !== "hidden" );
16791
16792			this.containment = [
16793				co.left + ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) +
16794					( parseInt( $( ce ).css( "paddingLeft" ), 10 ) || 0 ) - this.margins.left,
16795				co.top + ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) +
16796					( parseInt( $( ce ).css( "paddingTop" ), 10 ) || 0 ) - this.margins.top,
16797				co.left + ( over ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
16798					( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) -
16799					( parseInt( $( ce ).css( "paddingRight" ), 10 ) || 0 ) -
16800					this.helperProportions.width - this.margins.left,
16801				co.top + ( over ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
16802					( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) -
16803					( parseInt( $( ce ).css( "paddingBottom" ), 10 ) || 0 ) -
16804					this.helperProportions.height - this.margins.top
16805			];
16806		}
16807
16808	},
16809
16810	_convertPositionTo: function( d, pos ) {
16811
16812		if ( !pos ) {
16813			pos = this.position;
16814		}
16815		var mod = d === "absolute" ? 1 : -1,
16816			scroll = this.cssPosition === "absolute" &&
16817				!( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
16818				$.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ?
16819					this.offsetParent :
16820					this.scrollParent,
16821			scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName );
16822
16823		return {
16824			top: (
16825
16826				// The absolute mouse position
16827				pos.top	+
16828
16829				// Only for relative positioned nodes: Relative offset from element to offset parent
16830				this.offset.relative.top * mod +
16831
16832				// The offsetParent's offset without borders (offset + border)
16833				this.offset.parent.top * mod -
16834				( ( this.cssPosition === "fixed" ?
16835					-this.scrollParent.scrollTop() :
16836					( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod )
16837			),
16838			left: (
16839
16840				// The absolute mouse position
16841				pos.left +
16842
16843				// Only for relative positioned nodes: Relative offset from element to offset parent
16844				this.offset.relative.left * mod +
16845
16846				// The offsetParent's offset without borders (offset + border)
16847				this.offset.parent.left * mod	-
16848				( ( this.cssPosition === "fixed" ?
16849					-this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 :
16850					scroll.scrollLeft() ) * mod )
16851			)
16852		};
16853
16854	},
16855
16856	_generatePosition: function( event ) {
16857
16858		var top, left,
16859			o = this.options,
16860			pageX = event.pageX,
16861			pageY = event.pageY,
16862			scroll = this.cssPosition === "absolute" &&
16863				!( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
16864				$.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ?
16865					this.offsetParent :
16866					this.scrollParent,
16867				scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName );
16868
16869		// This is another very weird special case that only happens for relative elements:
16870		// 1. If the css position is relative
16871		// 2. and the scroll parent is the document or similar to the offset parent
16872		// we have to refresh the relative offset during the scroll so there are no jumps
16873		if ( this.cssPosition === "relative" && !( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
16874				this.scrollParent[ 0 ] !== this.offsetParent[ 0 ] ) ) {
16875			this.offset.relative = this._getRelativeOffset();
16876		}
16877
16878		/*
16879		 * - Position constraining -
16880		 * Constrain the position to a mix of grid, containment.
16881		 */
16882
16883		if ( this.originalPosition ) { //If we are not dragging yet, we won't check for options
16884
16885			if ( this.containment ) {
16886				if ( event.pageX - this.offset.click.left < this.containment[ 0 ] ) {
16887					pageX = this.containment[ 0 ] + this.offset.click.left;
16888				}
16889				if ( event.pageY - this.offset.click.top < this.containment[ 1 ] ) {
16890					pageY = this.containment[ 1 ] + this.offset.click.top;
16891				}
16892				if ( event.pageX - this.offset.click.left > this.containment[ 2 ] ) {
16893					pageX = this.containment[ 2 ] + this.offset.click.left;
16894				}
16895				if ( event.pageY - this.offset.click.top > this.containment[ 3 ] ) {
16896					pageY = this.containment[ 3 ] + this.offset.click.top;
16897				}
16898			}
16899
16900			if ( o.grid ) {
16901				top = this.originalPageY + Math.round( ( pageY - this.originalPageY ) /
16902					o.grid[ 1 ] ) * o.grid[ 1 ];
16903				pageY = this.containment ?
16904					( ( top - this.offset.click.top >= this.containment[ 1 ] &&
16905						top - this.offset.click.top <= this.containment[ 3 ] ) ?
16906							top :
16907							( ( top - this.offset.click.top >= this.containment[ 1 ] ) ?
16908								top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) :
16909								top;
16910
16911				left = this.originalPageX + Math.round( ( pageX - this.originalPageX ) /
16912					o.grid[ 0 ] ) * o.grid[ 0 ];
16913				pageX = this.containment ?
16914					( ( left - this.offset.click.left >= this.containment[ 0 ] &&
16915						left - this.offset.click.left <= this.containment[ 2 ] ) ?
16916							left :
16917							( ( left - this.offset.click.left >= this.containment[ 0 ] ) ?
16918								left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) :
16919								left;
16920			}
16921
16922		}
16923
16924		return {
16925			top: (
16926
16927				// The absolute mouse position
16928				pageY -
16929
16930				// Click offset (relative to the element)
16931				this.offset.click.top -
16932
16933				// Only for relative positioned nodes: Relative offset from element to offset parent
16934				this.offset.relative.top -
16935
16936				// The offsetParent's offset without borders (offset + border)
16937				this.offset.parent.top +
16938				( ( this.cssPosition === "fixed" ?
16939					-this.scrollParent.scrollTop() :
16940					( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) )
16941			),
16942			left: (
16943
16944				// The absolute mouse position
16945				pageX -
16946
16947				// Click offset (relative to the element)
16948				this.offset.click.left -
16949
16950				// Only for relative positioned nodes: Relative offset from element to offset parent
16951				this.offset.relative.left -
16952
16953				// The offsetParent's offset without borders (offset + border)
16954				this.offset.parent.left +
16955				( ( this.cssPosition === "fixed" ?
16956					-this.scrollParent.scrollLeft() :
16957					scrollIsRootNode ? 0 : scroll.scrollLeft() ) )
16958			)
16959		};
16960
16961	},
16962
16963	_rearrange: function( event, i, a, hardRefresh ) {
16964
16965		if ( a ) {
16966			a[ 0 ].appendChild( this.placeholder[ 0 ] );
16967		} else {
16968			i.item[ 0 ].parentNode.insertBefore( this.placeholder[ 0 ],
16969				( this.direction === "down" ? i.item[ 0 ] : i.item[ 0 ].nextSibling ) );
16970		}
16971
16972		//Various things done here to improve the performance:
16973		// 1. we create a setTimeout, that calls refreshPositions
16974		// 2. on the instance, we have a counter variable, that get's higher after every append
16975		// 3. on the local scope, we copy the counter variable, and check in the timeout,
16976		// if it's still the same
16977		// 4. this lets only the last addition to the timeout stack through
16978		this.counter = this.counter ? ++this.counter : 1;
16979		var counter = this.counter;
16980
16981		this._delay( function() {
16982			if ( counter === this.counter ) {
16983
16984				//Precompute after each DOM insertion, NOT on mousemove
16985				this.refreshPositions( !hardRefresh );
16986			}
16987		} );
16988
16989	},
16990
16991	_clear: function( event, noPropagation ) {
16992
16993		this.reverting = false;
16994
16995		// We delay all events that have to be triggered to after the point where the placeholder
16996		// has been removed and everything else normalized again
16997		var i,
16998			delayedTriggers = [];
16999
17000		// We first have to update the dom position of the actual currentItem
17001		// Note: don't do it if the current item is already removed (by a user), or it gets
17002		// reappended (see #4088)
17003		if ( !this._noFinalSort && this.currentItem.parent().length ) {
17004			this.placeholder.before( this.currentItem );
17005		}
17006		this._noFinalSort = null;
17007
17008		if ( this.helper[ 0 ] === this.currentItem[ 0 ] ) {
17009			for ( i in this._storedCSS ) {
17010				if ( this._storedCSS[ i ] === "auto" || this._storedCSS[ i ] === "static" ) {
17011					this._storedCSS[ i ] = "";
17012				}
17013			}
17014			this.currentItem.css( this._storedCSS );
17015			this._removeClass( this.currentItem, "ui-sortable-helper" );
17016		} else {
17017			this.currentItem.show();
17018		}
17019
17020		if ( this.fromOutside && !noPropagation ) {
17021			delayedTriggers.push( function( event ) {
17022				this._trigger( "receive", event, this._uiHash( this.fromOutside ) );
17023			} );
17024		}
17025		if ( ( this.fromOutside ||
17026				this.domPosition.prev !==
17027				this.currentItem.prev().not( ".ui-sortable-helper" )[ 0 ] ||
17028				this.domPosition.parent !== this.currentItem.parent()[ 0 ] ) && !noPropagation ) {
17029
17030			// Trigger update callback if the DOM position has changed
17031			delayedTriggers.push( function( event ) {
17032				this._trigger( "update", event, this._uiHash() );
17033			} );
17034		}
17035
17036		// Check if the items Container has Changed and trigger appropriate
17037		// events.
17038		if ( this !== this.currentContainer ) {
17039			if ( !noPropagation ) {
17040				delayedTriggers.push( function( event ) {
17041					this._trigger( "remove", event, this._uiHash() );
17042				} );
17043				delayedTriggers.push( ( function( c ) {
17044					return function( event ) {
17045						c._trigger( "receive", event, this._uiHash( this ) );
17046					};
17047				} ).call( this, this.currentContainer ) );
17048				delayedTriggers.push( ( function( c ) {
17049					return function( event ) {
17050						c._trigger( "update", event, this._uiHash( this ) );
17051					};
17052				} ).call( this, this.currentContainer ) );
17053			}
17054		}
17055
17056		//Post events to containers
17057		function delayEvent( type, instance, container ) {
17058			return function( event ) {
17059				container._trigger( type, event, instance._uiHash( instance ) );
17060			};
17061		}
17062		for ( i = this.containers.length - 1; i >= 0; i-- ) {
17063			if ( !noPropagation ) {
17064				delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) );
17065			}
17066			if ( this.containers[ i ].containerCache.over ) {
17067				delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) );
17068				this.containers[ i ].containerCache.over = 0;
17069			}
17070		}
17071
17072		//Do what was originally in plugins
17073		if ( this.storedCursor ) {
17074			this.document.find( "body" ).css( "cursor", this.storedCursor );
17075			this.storedStylesheet.remove();
17076		}
17077		if ( this._storedOpacity ) {
17078			this.helper.css( "opacity", this._storedOpacity );
17079		}
17080		if ( this._storedZIndex ) {
17081			this.helper.css( "zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex );
17082		}
17083
17084		this.dragging = false;
17085
17086		if ( !noPropagation ) {
17087			this._trigger( "beforeStop", event, this._uiHash() );
17088		}
17089
17090		//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,
17091		// it unbinds ALL events from the original node!
17092		this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] );
17093
17094		if ( !this.cancelHelperRemoval ) {
17095			if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
17096				this.helper.remove();
17097			}
17098			this.helper = null;
17099		}
17100
17101		if ( !noPropagation ) {
17102			for ( i = 0; i < delayedTriggers.length; i++ ) {
17103
17104				// Trigger all delayed events
17105				delayedTriggers[ i ].call( this, event );
17106			}
17107			this._trigger( "stop", event, this._uiHash() );
17108		}
17109
17110		this.fromOutside = false;
17111		return !this.cancelHelperRemoval;
17112
17113	},
17114
17115	_trigger: function() {
17116		if ( $.Widget.prototype._trigger.apply( this, arguments ) === false ) {
17117			this.cancel();
17118		}
17119	},
17120
17121	_uiHash: function( _inst ) {
17122		var inst = _inst || this;
17123		return {
17124			helper: inst.helper,
17125			placeholder: inst.placeholder || $( [] ),
17126			position: inst.position,
17127			originalPosition: inst.originalPosition,
17128			offset: inst.positionAbs,
17129			item: inst.currentItem,
17130			sender: _inst ? _inst.element : null
17131		};
17132	}
17133
17134} );
17135
17136
17137/*!
17138 * jQuery UI Spinner 1.13.
171382
17139 * http://jqueryui.com
17140 *
17141 * Copyright jQuery Foundation and other contributors
17142 * Released under the MIT license.
17143 * http://jquery.org/license
17144 */
17145
17146//>>label: Spinner
17147//>>group: Widgets
17148//>>description: Displays buttons to easily input numbers via the keyboard or mouse.
17149//>>docs: http://api.jqueryui.com/spinner/
17150//>>demos: http://jqueryui.com/spinner/
17151//>>css.structure: ../../themes/base/core.css
17152//>>css.structure: ../../themes/base/spinner.css
17153//>>css.theme: ../../themes/base/theme.css
17154
17155
17156function spinnerModifier( fn ) {
17157	return function() {
17158		var previous = this.element.val();
17159		fn.apply( this, arguments );
17160		this._refresh();
17161		if ( previous !== this.element.val() ) {
17162			this._trigger( "change" );
17163		}
17164	};
17165}
17166
17167$.widget( "ui.spinner", {
17168	version: "1.13.2
vendor: 13,310 bytes, lines 17168-17699
17168",
17169	defaultElement: "<input>",
17170	widgetEventPrefix: "spin",
17171	options: {
17172		classes: {
17173			"ui-spinner": "ui-corner-all",
17174			"ui-spinner-down": "ui-corner-br",
17175			"ui-spinner-up": "ui-corner-tr"
17176		},
17177		culture: null,
17178		icons: {
17179			down: "ui-icon-triangle-1-s",
17180			up: "ui-icon-triangle-1-n"
17181		},
17182		incremental: true,
17183		max: null,
17184		min: null,
17185		numberFormat: null,
17186		page: 10,
17187		step: 1,
17188
17189		change: null,
17190		spin: null,
17191		start: null,
17192		stop: null
17193	},
17194
17195	_create: function() {
17196
17197		// handle string values that need to be parsed
17198		this._setOption( "max", this.options.max );
17199		this._setOption( "min", this.options.min );
17200		this._setOption( "step", this.options.step );
17201
17202		// Only format if there is a value, prevents the field from being marked
17203		// as invalid in Firefox, see #9573.
17204		if ( this.value() !== "" ) {
17205
17206			// Format the value, but don't constrain.
17207			this._value( this.element.val(), true );
17208		}
17209
17210		this._draw();
17211		this._on( this._events );
17212		this._refresh();
17213
17214		// Turning off autocomplete prevents the browser from remembering the
17215		// value when navigating through history, so we re-enable autocomplete
17216		// if the page is unloaded before the widget is destroyed. #7790
17217		this._on( this.window, {
17218			beforeunload: function() {
17219				this.element.removeAttr( "autocomplete" );
17220			}
17221		} );
17222	},
17223
17224	_getCreateOptions: function() {
17225		var options = this._super();
17226		var element = this.element;
17227
17228		$.each( [ "min", "max", "step" ], function( i, option ) {
17229			var value = element.attr( option );
17230			if ( value != null && value.length ) {
17231				options[ option ] = value;
17232			}
17233		} );
17234
17235		return options;
17236	},
17237
17238	_events: {
17239		keydown: function( event ) {
17240			if ( this._start( event ) && this._keydown( event ) ) {
17241				event.preventDefault();
17242			}
17243		},
17244		keyup: "_stop",
17245		focus: function() {
17246			this.previous = this.element.val();
17247		},
17248		blur: function( event ) {
17249			if ( this.cancelBlur ) {
17250				delete this.cancelBlur;
17251				return;
17252			}
17253
17254			this._stop();
17255			this._refresh();
17256			if ( this.previous !== this.element.val() ) {
17257				this._trigger( "change", event );
17258			}
17259		},
17260		mousewheel: function( event, delta ) {
17261			var activeElement = $.ui.safeActiveElement( this.document[ 0 ] );
17262			var isActive = this.element[ 0 ] === activeElement;
17263
17264			if ( !isActive || !delta ) {
17265				return;
17266			}
17267
17268			if ( !this.spinning && !this._start( event ) ) {
17269				return false;
17270			}
17271
17272			this._spin( ( delta > 0 ? 1 : -1 ) * this.options.step, event );
17273			clearTimeout( this.mousewheelTimer );
17274			this.mousewheelTimer = this._delay( function() {
17275				if ( this.spinning ) {
17276					this._stop( event );
17277				}
17278			}, 100 );
17279			event.preventDefault();
17280		},
17281		"mousedown .ui-spinner-button": function( event ) {
17282			var previous;
17283
17284			// We never want the buttons to have focus; whenever the user is
17285			// interacting with the spinner, the focus should be on the input.
17286			// If the input is focused then this.previous is properly set from
17287			// when the input first received focus. If the input is not focused
17288			// then we need to set this.previous based on the value before spinning.
17289			previous = this.element[ 0 ] === $.ui.safeActiveElement( this.document[ 0 ] ) ?
17290				this.previous : this.element.val();
17291			function checkFocus() {
17292				var isActive = this.element[ 0 ] === $.ui.safeActiveElement( this.document[ 0 ] );
17293				if ( !isActive ) {
17294					this.element.trigger( "focus" );
17295					this.previous = previous;
17296
17297					// support: IE
17298					// IE sets focus asynchronously, so we need to check if focus
17299					// moved off of the input because the user clicked on the button.
17300					this._delay( function() {
17301						this.previous = previous;
17302					} );
17303				}
17304			}
17305
17306			// Ensure focus is on (or stays on) the text field
17307			event.preventDefault();
17308			checkFocus.call( this );
17309
17310			// Support: IE
17311			// IE doesn't prevent moving focus even with event.preventDefault()
17312			// so we set a flag to know when we should ignore the blur event
17313			// and check (again) if focus moved off of the input.
17314			this.cancelBlur = true;
17315			this._delay( function() {
17316				delete this.cancelBlur;
17317				checkFocus.call( this );
17318			} );
17319
17320			if ( this._start( event ) === false ) {
17321				return;
17322			}
17323
17324			this._repeat( null, $( event.currentTarget )
17325				.hasClass( "ui-spinner-up" ) ? 1 : -1, event );
17326		},
17327		"mouseup .ui-spinner-button": "_stop",
17328		"mouseenter .ui-spinner-button": function( event ) {
17329
17330			// button will add ui-state-active if mouse was down while mouseleave and kept down
17331			if ( !$( event.currentTarget ).hasClass( "ui-state-active" ) ) {
17332				return;
17333			}
17334
17335			if ( this._start( event ) === false ) {
17336				return false;
17337			}
17338			this._repeat( null, $( event.currentTarget )
17339				.hasClass( "ui-spinner-up" ) ? 1 : -1, event );
17340		},
17341
17342		// TODO: do we really want to consider this a stop?
17343		// shouldn't we just stop the repeater and wait until mouseup before
17344		// we trigger the stop event?
17345		"mouseleave .ui-spinner-button": "_stop"
17346	},
17347
17348	// Support mobile enhanced option and make backcompat more sane
17349	_enhance: function() {
17350		this.uiSpinner = this.element
17351			.attr( "autocomplete", "off" )
17352			.wrap( "<span>" )
17353			.parent()
17354
17355				// Add buttons
17356				.append(
17357					"<a></a><a></a>"
17358				);
17359	},
17360
17361	_draw: function() {
17362		this._enhance();
17363
17364		this._addClass( this.uiSpinner, "ui-spinner", "ui-widget ui-widget-content" );
17365		this._addClass( "ui-spinner-input" );
17366
17367		this.element.attr( "role", "spinbutton" );
17368
17369		// Button bindings
17370		this.buttons = this.uiSpinner.children( "a" )
17371			.attr( "tabIndex", -1 )
17372			.attr( "aria-hidden", true )
17373			.button( {
17374				classes: {
17375					"ui-button": ""
17376				}
17377			} );
17378
17379		// TODO: Right now button does not support classes this is already updated in button PR
17380		this._removeClass( this.buttons, "ui-corner-all" );
17381
17382		this._addClass( this.buttons.first(), "ui-spinner-button ui-spinner-up" );
17383		this._addClass( this.buttons.last(), "ui-spinner-button ui-spinner-down" );
17384		this.buttons.first().button( {
17385			"icon": this.options.icons.up,
17386			"showLabel": false
17387		} );
17388		this.buttons.last().button( {
17389			"icon": this.options.icons.down,
17390			"showLabel": false
17391		} );
17392
17393		// IE 6 doesn't understand height: 50% for the buttons
17394		// unless the wrapper has an explicit height
17395		if ( this.buttons.height() > Math.ceil( this.uiSpinner.height() * 0.5 ) &&
17396				this.uiSpinner.height() > 0 ) {
17397			this.uiSpinner.height( this.uiSpinner.height() );
17398		}
17399	},
17400
17401	_keydown: function( event ) {
17402		var options = this.options,
17403			keyCode = $.ui.keyCode;
17404
17405		switch ( event.keyCode ) {
17406		case keyCode.UP:
17407			this._repeat( null, 1, event );
17408			return true;
17409		case keyCode.DOWN:
17410			this._repeat( null, -1, event );
17411			return true;
17412		case keyCode.PAGE_UP:
17413			this._repeat( null, options.page, event );
17414			return true;
17415		case keyCode.PAGE_DOWN:
17416			this._repeat( null, -options.page, event );
17417			return true;
17418		}
17419
17420		return false;
17421	},
17422
17423	_start: function( event ) {
17424		if ( !this.spinning && this._trigger( "start", event ) === false ) {
17425			return false;
17426		}
17427
17428		if ( !this.counter ) {
17429			this.counter = 1;
17430		}
17431		this.spinning = true;
17432		return true;
17433	},
17434
17435	_repeat: function( i, steps, event ) {
17436		i = i || 500;
17437
17438		clearTimeout( this.timer );
17439		this.timer = this._delay( function() {
17440			this._repeat( 40, steps, event );
17441		}, i );
17442
17443		this._spin( steps * this.options.step, event );
17444	},
17445
17446	_spin: function( step, event ) {
17447		var value = this.value() || 0;
17448
17449		if ( !this.counter ) {
17450			this.counter = 1;
17451		}
17452
17453		value = this._adjustValue( value + step * this._increment( this.counter ) );
17454
17455		if ( !this.spinning || this._trigger( "spin", event, { value: value } ) !== false ) {
17456			this._value( value );
17457			this.counter++;
17458		}
17459	},
17460
17461	_increment: function( i ) {
17462		var incremental = this.options.incremental;
17463
17464		if ( incremental ) {
17465			return typeof incremental === "function" ?
17466				incremental( i ) :
17467				Math.floor( i * i * i / 50000 - i * i / 500 + 17 * i / 200 + 1 );
17468		}
17469
17470		return 1;
17471	},
17472
17473	_precision: function() {
17474		var precision = this._precisionOf( this.options.step );
17475		if ( this.options.min !== null ) {
17476			precision = Math.max( precision, this._precisionOf( this.options.min ) );
17477		}
17478		return precision;
17479	},
17480
17481	_precisionOf: function( num ) {
17482		var str = num.toString(),
17483			decimal = str.indexOf( "." );
17484		return decimal === -1 ? 0 : str.length - decimal - 1;
17485	},
17486
17487	_adjustValue: function( value ) {
17488		var base, aboveMin,
17489			options = this.options;
17490
17491		// Make sure we're at a valid step
17492		// - find out where we are relative to the base (min or 0)
17493		base = options.min !== null ? options.min : 0;
17494		aboveMin = value - base;
17495
17496		// - round to the nearest step
17497		aboveMin = Math.round( aboveMin / options.step ) * options.step;
17498
17499		// - rounding is based on 0, so adjust back to our base
17500		value = base + aboveMin;
17501
17502		// Fix precision from bad JS floating point math
17503		value = parseFloat( value.toFixed( this._precision() ) );
17504
17505		// Clamp the value
17506		if ( options.max !== null && value > options.max ) {
17507			return options.max;
17508		}
17509		if ( options.min !== null && value < options.min ) {
17510			return options.min;
17511		}
17512
17513		return value;
17514	},
17515
17516	_stop: function( event ) {
17517		if ( !this.spinning ) {
17518			return;
17519		}
17520
17521		clearTimeout( this.timer );
17522		clearTimeout( this.mousewheelTimer );
17523		this.counter = 0;
17524		this.spinning = false;
17525		this._trigger( "stop", event );
17526	},
17527
17528	_setOption: function( key, value ) {
17529		var prevValue, first, last;
17530
17531		if ( key === "culture" || key === "numberFormat" ) {
17532			prevValue = this._parse( this.element.val() );
17533			this.options[ key ] = value;
17534			this.element.val( this._format( prevValue ) );
17535			return;
17536		}
17537
17538		if ( key === "max" || key === "min" || key === "step" ) {
17539			if ( typeof value === "string" ) {
17540				value = this._parse( value );
17541			}
17542		}
17543		if ( key === "icons" ) {
17544			first = this.buttons.first().find( ".ui-icon" );
17545			this._removeClass( first, null, this.options.icons.up );
17546			this._addClass( first, null, value.up );
17547			last = this.buttons.last().find( ".ui-icon" );
17548			this._removeClass( last, null, this.options.icons.down );
17549			this._addClass( last, null, value.down );
17550		}
17551
17552		this._super( key, value );
17553	},
17554
17555	_setOptionDisabled: function( value ) {
17556		this._super( value );
17557
17558		this._toggleClass( this.uiSpinner, null, "ui-state-disabled", !!value );
17559		this.element.prop( "disabled", !!value );
17560		this.buttons.button( value ? "disable" : "enable" );
17561	},
17562
17563	_setOptions: spinnerModifier( function( options ) {
17564		this._super( options );
17565	} ),
17566
17567	_parse: function( val ) {
17568		if ( typeof val === "string" && val !== "" ) {
17569			val = window.Globalize && this.options.numberFormat ?
17570				Globalize.parseFloat( val, 10, this.options.culture ) : +val;
17571		}
17572		return val === "" || isNaN( val ) ? null : val;
17573	},
17574
17575	_format: function( value ) {
17576		if ( value === "" ) {
17577			return "";
17578		}
17579		return window.Globalize && this.options.numberFormat ?
17580			Globalize.format( value, this.options.numberFormat, this.options.culture ) :
17581			value;
17582	},
17583
17584	_refresh: function() {
17585		this.element.attr( {
17586			"aria-valuemin": this.options.min,
17587			"aria-valuemax": this.options.max,
17588
17589			// TODO: what should we do with values that can't be parsed?
17590			"aria-valuenow": this._parse( this.element.val() )
17591		} );
17592	},
17593
17594	isValid: function() {
17595		var value = this.value();
17596
17597		// Null is invalid
17598		if ( value === null ) {
17599			return false;
17600		}
17601
17602		// If value gets adjusted, it's invalid
17603		return value === this._adjustValue( value );
17604	},
17605
17606	// Update the value without triggering change
17607	_value: function( value, allowAny ) {
17608		var parsed;
17609		if ( value !== "" ) {
17610			parsed = this._parse( value );
17611			if ( parsed !== null ) {
17612				if ( !allowAny ) {
17613					parsed = this._adjustValue( parsed );
17614				}
17615				value = this._format( parsed );
17616			}
17617		}
17618		this.element.val( value );
17619		this._refresh();
17620	},
17621
17622	_destroy: function() {
17623		this.element
17624			.prop( "disabled", false )
17625			.removeAttr( "autocomplete role aria-valuemin aria-valuemax aria-valuenow" );
17626
17627		this.uiSpinner.replaceWith( this.element );
17628	},
17629
17630	stepUp: spinnerModifier( function( steps ) {
17631		this._stepUp( steps );
17632	} ),
17633	_stepUp: function( steps ) {
17634		if ( this._start() ) {
17635			this._spin( ( steps || 1 ) * this.options.step );
17636			this._stop();
17637		}
17638	},
17639
17640	stepDown: spinnerModifier( function( steps ) {
17641		this._stepDown( steps );
17642	} ),
17643	_stepDown: function( steps ) {
17644		if ( this._start() ) {
17645			this._spin( ( steps || 1 ) * -this.options.step );
17646			this._stop();
17647		}
17648	},
17649
17650	pageUp: spinnerModifier( function( pages ) {
17651		this._stepUp( ( pages || 1 ) * this.options.page );
17652	} ),
17653
17654	pageDown: spinnerModifier( function( pages ) {
17655		this._stepDown( ( pages || 1 ) * this.options.page );
17656	} ),
17657
17658	value: function( newVal ) {
17659		if ( !arguments.length ) {
17660			return this._parse( this.element.val() );
17661		}
17662		spinnerModifier( this._value ).call( this, newVal );
17663	},
17664
17665	widget: function() {
17666		return this.uiSpinner;
17667	}
17668} );
17669
17670// DEPRECATED
17671// TODO: switch return back to widget declaration at top of file when this is removed
17672if ( $.uiBackCompat !== false ) {
17673
17674	// Backcompat for spinner html extension points
17675	$.widget( "ui.spinner", $.ui.spinner, {
17676		_enhance: function() {
17677			this.uiSpinner = this.element
17678				.attr( "autocomplete", "off" )
17679				.wrap( this._uiSpinnerHtml() )
17680				.parent()
17681
17682					// Add buttons
17683					.append( this._buttonHtml() );
17684		},
17685		_uiSpinnerHtml: function() {
17686			return "<span>";
17687		},
17688
17689		_buttonHtml: function() {
17690			return "<a></a><a></a>";
17691		}
17692	} );
17693}
17694
17695var widgetsSpinner = $.ui.spinner;
17696
17697
17698/*!
17699 * jQuery UI Tabs 1.13.
176992
17700 * http://jqueryui.com
17701 *
17702 * Copyright jQuery Foundation and other contributors
17703 * Released under the MIT license.
17704 * http://jquery.org/license
17705 */
17706
17707//>>label: Tabs
17708//>>group: Widgets
17709//>>description: Transforms a set of container elements into a tab structure.
17710//>>docs: http://api.jqueryui.com/tabs/
17711//>>demos: http://jqueryui.com/tabs/
17712//>>css.structure: ../../themes/base/core.css
17713//>>css.structure: ../../themes/base/tabs.css
17714//>>css.theme: ../../themes/base/theme.css
17715
17716
17717$.widget( "ui.tabs", {
17718	version: "1.13.2
vendor: 21,408 bytes, lines 17718-18547
17718",
17719	delay: 300,
17720	options: {
17721		active: null,
17722		classes: {
17723			"ui-tabs": "ui-corner-all",
17724			"ui-tabs-nav": "ui-corner-all",
17725			"ui-tabs-panel": "ui-corner-bottom",
17726			"ui-tabs-tab": "ui-corner-top"
17727		},
17728		collapsible: false,
17729		event: "click",
17730		heightStyle: "content",
17731		hide: null,
17732		show: null,
17733
17734		// Callbacks
17735		activate: null,
17736		beforeActivate: null,
17737		beforeLoad: null,
17738		load: null
17739	},
17740
17741	_isLocal: ( function() {
17742		var rhash = /#.*$/;
17743
17744		return function( anchor ) {
17745			var anchorUrl, locationUrl;
17746
17747			anchorUrl = anchor.href.replace( rhash, "" );
17748			locationUrl = location.href.replace( rhash, "" );
17749
17750			// Decoding may throw an error if the URL isn't UTF-8 (#9518)
17751			try {
17752				anchorUrl = decodeURIComponent( anchorUrl );
17753			} catch ( error ) {}
17754			try {
17755				locationUrl = decodeURIComponent( locationUrl );
17756			} catch ( error ) {}
17757
17758			return anchor.hash.length > 1 && anchorUrl === locationUrl;
17759		};
17760	} )(),
17761
17762	_create: function() {
17763		var that = this,
17764			options = this.options;
17765
17766		this.running = false;
17767
17768		this._addClass( "ui-tabs", "ui-widget ui-widget-content" );
17769		this._toggleClass( "ui-tabs-collapsible", null, options.collapsible );
17770
17771		this._processTabs();
17772		options.active = this._initialActive();
17773
17774		// Take disabling tabs via class attribute from HTML
17775		// into account and update option properly.
17776		if ( Array.isArray( options.disabled ) ) {
17777			options.disabled = $.uniqueSort( options.disabled.concat(
17778				$.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) {
17779					return that.tabs.index( li );
17780				} )
17781			) ).sort();
17782		}
17783
17784		// Check for length avoids error when initializing empty list
17785		if ( this.options.active !== false && this.anchors.length ) {
17786			this.active = this._findActive( options.active );
17787		} else {
17788			this.active = $();
17789		}
17790
17791		this._refresh();
17792
17793		if ( this.active.length ) {
17794			this.load( options.active );
17795		}
17796	},
17797
17798	_initialActive: function() {
17799		var active = this.options.active,
17800			collapsible = this.options.collapsible,
17801			locationHash = location.hash.substring( 1 );
17802
17803		if ( active === null ) {
17804
17805			// check the fragment identifier in the URL
17806			if ( locationHash ) {
17807				this.tabs.each( function( i, tab ) {
17808					if ( $( tab ).attr( "aria-controls" ) === locationHash ) {
17809						active = i;
17810						return false;
17811					}
17812				} );
17813			}
17814
17815			// Check for a tab marked active via a class
17816			if ( active === null ) {
17817				active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) );
17818			}
17819
17820			// No active tab, set to false
17821			if ( active === null || active === -1 ) {
17822				active = this.tabs.length ? 0 : false;
17823			}
17824		}
17825
17826		// Handle numbers: negative, out of range
17827		if ( active !== false ) {
17828			active = this.tabs.index( this.tabs.eq( active ) );
17829			if ( active === -1 ) {
17830				active = collapsible ? false : 0;
17831			}
17832		}
17833
17834		// Don't allow collapsible: false and active: false
17835		if ( !collapsible && active === false && this.anchors.length ) {
17836			active = 0;
17837		}
17838
17839		return active;
17840	},
17841
17842	_getCreateEventData: function() {
17843		return {
17844			tab: this.active,
17845			panel: !this.active.length ? $() : this._getPanelForTab( this.active )
17846		};
17847	},
17848
17849	_tabKeydown: function( event ) {
17850		var focusedTab = $( $.ui.safeActiveElement( this.document[ 0 ] ) ).closest( "li" ),
17851			selectedIndex = this.tabs.index( focusedTab ),
17852			goingForward = true;
17853
17854		if ( this._handlePageNav( event ) ) {
17855			return;
17856		}
17857
17858		switch ( event.keyCode ) {
17859		case $.ui.keyCode.RIGHT:
17860		case $.ui.keyCode.DOWN:
17861			selectedIndex++;
17862			break;
17863		case $.ui.keyCode.UP:
17864		case $.ui.keyCode.LEFT:
17865			goingForward = false;
17866			selectedIndex--;
17867			break;
17868		case $.ui.keyCode.END:
17869			selectedIndex = this.anchors.length - 1;
17870			break;
17871		case $.ui.keyCode.HOME:
17872			selectedIndex = 0;
17873			break;
17874		case $.ui.keyCode.SPACE:
17875
17876			// Activate only, no collapsing
17877			event.preventDefault();
17878			clearTimeout( this.activating );
17879			this._activate( selectedIndex );
17880			return;
17881		case $.ui.keyCode.ENTER:
17882
17883			// Toggle (cancel delayed activation, allow collapsing)
17884			event.preventDefault();
17885			clearTimeout( this.activating );
17886
17887			// Determine if we should collapse or activate
17888			this._activate( selectedIndex === this.options.active ? false : selectedIndex );
17889			return;
17890		default:
17891			return;
17892		}
17893
17894		// Focus the appropriate tab, based on which key was pressed
17895		event.preventDefault();
17896		clearTimeout( this.activating );
17897		selectedIndex = this._focusNextTab( selectedIndex, goingForward );
17898
17899		// Navigating with control/command key will prevent automatic activation
17900		if ( !event.ctrlKey && !event.metaKey ) {
17901
17902			// Update aria-selected immediately so that AT think the tab is already selected.
17903			// Otherwise AT may confuse the user by stating that they need to activate the tab,
17904			// but the tab will already be activated by the time the announcement finishes.
17905			focusedTab.attr( "aria-selected", "false" );
17906			this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" );
17907
17908			this.activating = this._delay( function() {
17909				this.option( "active", selectedIndex );
17910			}, this.delay );
17911		}
17912	},
17913
17914	_panelKeydown: function( event ) {
17915		if ( this._handlePageNav( event ) ) {
17916			return;
17917		}
17918
17919		// Ctrl+up moves focus to the current tab
17920		if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) {
17921			event.preventDefault();
17922			this.active.trigger( "focus" );
17923		}
17924	},
17925
17926	// Alt+page up/down moves focus to the previous/next tab (and activates)
17927	_handlePageNav: function( event ) {
17928		if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) {
17929			this._activate( this._focusNextTab( this.options.active - 1, false ) );
17930			return true;
17931		}
17932		if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) {
17933			this._activate( this._focusNextTab( this.options.active + 1, true ) );
17934			return true;
17935		}
17936	},
17937
17938	_findNextTab: function( index, goingForward ) {
17939		var lastTabIndex = this.tabs.length - 1;
17940
17941		function constrain() {
17942			if ( index > lastTabIndex ) {
17943				index = 0;
17944			}
17945			if ( index < 0 ) {
17946				index = lastTabIndex;
17947			}
17948			return index;
17949		}
17950
17951		while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) {
17952			index = goingForward ? index + 1 : index - 1;
17953		}
17954
17955		return index;
17956	},
17957
17958	_focusNextTab: function( index, goingForward ) {
17959		index = this._findNextTab( index, goingForward );
17960		this.tabs.eq( index ).trigger( "focus" );
17961		return index;
17962	},
17963
17964	_setOption: function( key, value ) {
17965		if ( key === "active" ) {
17966
17967			// _activate() will handle invalid values and update this.options
17968			this._activate( value );
17969			return;
17970		}
17971
17972		this._super( key, value );
17973
17974		if ( key === "collapsible" ) {
17975			this._toggleClass( "ui-tabs-collapsible", null, value );
17976
17977			// Setting collapsible: false while collapsed; open first panel
17978			if ( !value && this.options.active === false ) {
17979				this._activate( 0 );
17980			}
17981		}
17982
17983		if ( key === "event" ) {
17984			this._setupEvents( value );
17985		}
17986
17987		if ( key === "heightStyle" ) {
17988			this._setupHeightStyle( value );
17989		}
17990	},
17991
17992	_sanitizeSelector: function( hash ) {
17993		return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : "";
17994	},
17995
17996	refresh: function() {
17997		var options = this.options,
17998			lis = this.tablist.children( ":has(a[href])" );
17999
18000		// Get disabled tabs from class attribute from HTML
18001		// this will get converted to a boolean if needed in _refresh()
18002		options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) {
18003			return lis.index( tab );
18004		} );
18005
18006		this._processTabs();
18007
18008		// Was collapsed or no tabs
18009		if ( options.active === false || !this.anchors.length ) {
18010			options.active = false;
18011			this.active = $();
18012
18013		// was active, but active tab is gone
18014		} else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) {
18015
18016			// all remaining tabs are disabled
18017			if ( this.tabs.length === options.disabled.length ) {
18018				options.active = false;
18019				this.active = $();
18020
18021			// activate previous tab
18022			} else {
18023				this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) );
18024			}
18025
18026		// was active, active tab still exists
18027		} else {
18028
18029			// make sure active index is correct
18030			options.active = this.tabs.index( this.active );
18031		}
18032
18033		this._refresh();
18034	},
18035
18036	_refresh: function() {
18037		this._setOptionDisabled( this.options.disabled );
18038		this._setupEvents( this.options.event );
18039		this._setupHeightStyle( this.options.heightStyle );
18040
18041		this.tabs.not( this.active ).attr( {
18042			"aria-selected": "false",
18043			"aria-expanded": "false",
18044			tabIndex: -1
18045		} );
18046		this.panels.not( this._getPanelForTab( this.active ) )
18047			.hide()
18048			.attr( {
18049				"aria-hidden": "true"
18050			} );
18051
18052		// Make sure one tab is in the tab order
18053		if ( !this.active.length ) {
18054			this.tabs.eq( 0 ).attr( "tabIndex", 0 );
18055		} else {
18056			this.active
18057				.attr( {
18058					"aria-selected": "true",
18059					"aria-expanded": "true",
18060					tabIndex: 0
18061				} );
18062			this._addClass( this.active, "ui-tabs-active", "ui-state-active" );
18063			this._getPanelForTab( this.active )
18064				.show()
18065				.attr( {
18066					"aria-hidden": "false"
18067				} );
18068		}
18069	},
18070
18071	_processTabs: function() {
18072		var that = this,
18073			prevTabs = this.tabs,
18074			prevAnchors = this.anchors,
18075			prevPanels = this.panels;
18076
18077		this.tablist = this._getList().attr( "role", "tablist" );
18078		this._addClass( this.tablist, "ui-tabs-nav",
18079			"ui-helper-reset ui-helper-clearfix ui-widget-header" );
18080
18081		// Prevent users from focusing disabled tabs via click
18082		this.tablist
18083			.on( "mousedown" + this.eventNamespace, "> li", function( event ) {
18084				if ( $( this ).is( ".ui-state-disabled" ) ) {
18085					event.preventDefault();
18086				}
18087			} )
18088
18089			// Support: IE <9
18090			// Preventing the default action in mousedown doesn't prevent IE
18091			// from focusing the element, so if the anchor gets focused, blur.
18092			// We don't have to worry about focusing the previously focused
18093			// element since clicking on a non-focusable element should focus
18094			// the body anyway.
18095			.on( "focus" + this.eventNamespace, ".ui-tabs-anchor", function() {
18096				if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) {
18097					this.blur();
18098				}
18099			} );
18100
18101		this.tabs = this.tablist.find( "> li:has(a[href])" )
18102			.attr( {
18103				role: "tab",
18104				tabIndex: -1
18105			} );
18106		this._addClass( this.tabs, "ui-tabs-tab", "ui-state-default" );
18107
18108		this.anchors = this.tabs.map( function() {
18109			return $( "a", this )[ 0 ];
18110		} )
18111			.attr( {
18112				tabIndex: -1
18113			} );
18114		this._addClass( this.anchors, "ui-tabs-anchor" );
18115
18116		this.panels = $();
18117
18118		this.anchors.each( function( i, anchor ) {
18119			var selector, panel, panelId,
18120				anchorId = $( anchor ).uniqueId().attr( "id" ),
18121				tab = $( anchor ).closest( "li" ),
18122				originalAriaControls = tab.attr( "aria-controls" );
18123
18124			// Inline tab
18125			if ( that._isLocal( anchor ) ) {
18126				selector = anchor.hash;
18127				panelId = selector.substring( 1 );
18128				panel = that.element.find( that._sanitizeSelector( selector ) );
18129
18130			// remote tab
18131			} else {
18132
18133				// If the tab doesn't already have aria-controls,
18134				// generate an id by using a throw-away element
18135				panelId = tab.attr( "aria-controls" ) || $( {} ).uniqueId()[ 0 ].id;
18136				selector = "#" + panelId;
18137				panel = that.element.find( selector );
18138				if ( !panel.length ) {
18139					panel = that._createPanel( panelId );
18140					panel.insertAfter( that.panels[ i - 1 ] || that.tablist );
18141				}
18142				panel.attr( "aria-live", "polite" );
18143			}
18144
18145			if ( panel.length ) {
18146				that.panels = that.panels.add( panel );
18147			}
18148			if ( originalAriaControls ) {
18149				tab.data( "ui-tabs-aria-controls", originalAriaControls );
18150			}
18151			tab.attr( {
18152				"aria-controls": panelId,
18153				"aria-labelledby": anchorId
18154			} );
18155			panel.attr( "aria-labelledby", anchorId );
18156		} );
18157
18158		this.panels.attr( "role", "tabpanel" );
18159		this._addClass( this.panels, "ui-tabs-panel", "ui-widget-content" );
18160
18161		// Avoid memory leaks (#10056)
18162		if ( prevTabs ) {
18163			this._off( prevTabs.not( this.tabs ) );
18164			this._off( prevAnchors.not( this.anchors ) );
18165			this._off( prevPanels.not( this.panels ) );
18166		}
18167	},
18168
18169	// Allow overriding how to find the list for rare usage scenarios (#7715)
18170	_getList: function() {
18171		return this.tablist || this.element.find( "ol, ul" ).eq( 0 );
18172	},
18173
18174	_createPanel: function( id ) {
18175		return $( "<div>" )
18176			.attr( "id", id )
18177			.data( "ui-tabs-destroy", true );
18178	},
18179
18180	_setOptionDisabled: function( disabled ) {
18181		var currentItem, li, i;
18182
18183		if ( Array.isArray( disabled ) ) {
18184			if ( !disabled.length ) {
18185				disabled = false;
18186			} else if ( disabled.length === this.anchors.length ) {
18187				disabled = true;
18188			}
18189		}
18190
18191		// Disable tabs
18192		for ( i = 0; ( li = this.tabs[ i ] ); i++ ) {
18193			currentItem = $( li );
18194			if ( disabled === true || $.inArray( i, disabled ) !== -1 ) {
18195				currentItem.attr( "aria-disabled", "true" );
18196				this._addClass( currentItem, null, "ui-state-disabled" );
18197			} else {
18198				currentItem.removeAttr( "aria-disabled" );
18199				this._removeClass( currentItem, null, "ui-state-disabled" );
18200			}
18201		}
18202
18203		this.options.disabled = disabled;
18204
18205		this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null,
18206			disabled === true );
18207	},
18208
18209	_setupEvents: function( event ) {
18210		var events = {};
18211		if ( event ) {
18212			$.each( event.split( " " ), function( index, eventName ) {
18213				events[ eventName ] = "_eventHandler";
18214			} );
18215		}
18216
18217		this._off( this.anchors.add( this.tabs ).add( this.panels ) );
18218
18219		// Always prevent the default action, even when disabled
18220		this._on( true, this.anchors, {
18221			click: function( event ) {
18222				event.preventDefault();
18223			}
18224		} );
18225		this._on( this.anchors, events );
18226		this._on( this.tabs, { keydown: "_tabKeydown" } );
18227		this._on( this.panels, { keydown: "_panelKeydown" } );
18228
18229		this._focusable( this.tabs );
18230		this._hoverable( this.tabs );
18231	},
18232
18233	_setupHeightStyle: function( heightStyle ) {
18234		var maxHeight,
18235			parent = this.element.parent();
18236
18237		if ( heightStyle === "fill" ) {
18238			maxHeight = parent.height();
18239			maxHeight -= this.element.outerHeight() - this.element.height();
18240
18241			this.element.siblings( ":visible" ).each( function() {
18242				var elem = $( this ),
18243					position = elem.css( "position" );
18244
18245				if ( position === "absolute" || position === "fixed" ) {
18246					return;
18247				}
18248				maxHeight -= elem.outerHeight( true );
18249			} );
18250
18251			this.element.children().not( this.panels ).each( function() {
18252				maxHeight -= $( this ).outerHeight( true );
18253			} );
18254
18255			this.panels.each( function() {
18256				$( this ).height( Math.max( 0, maxHeight -
18257					$( this ).innerHeight() + $( this ).height() ) );
18258			} )
18259				.css( "overflow", "auto" );
18260		} else if ( heightStyle === "auto" ) {
18261			maxHeight = 0;
18262			this.panels.each( function() {
18263				maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() );
18264			} ).height( maxHeight );
18265		}
18266	},
18267
18268	_eventHandler: function( event ) {
18269		var options = this.options,
18270			active = this.active,
18271			anchor = $( event.currentTarget ),
18272			tab = anchor.closest( "li" ),
18273			clickedIsActive = tab[ 0 ] === active[ 0 ],
18274			collapsing = clickedIsActive && options.collapsible,
18275			toShow = collapsing ? $() : this._getPanelForTab( tab ),
18276			toHide = !active.length ? $() : this._getPanelForTab( active ),
18277			eventData = {
18278				oldTab: active,
18279				oldPanel: toHide,
18280				newTab: collapsing ? $() : tab,
18281				newPanel: toShow
18282			};
18283
18284		event.preventDefault();
18285
18286		if ( tab.hasClass( "ui-state-disabled" ) ||
18287
18288				// tab is already loading
18289				tab.hasClass( "ui-tabs-loading" ) ||
18290
18291				// can't switch durning an animation
18292				this.running ||
18293
18294				// click on active header, but not collapsible
18295				( clickedIsActive && !options.collapsible ) ||
18296
18297				// allow canceling activation
18298				( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
18299			return;
18300		}
18301
18302		options.active = collapsing ? false : this.tabs.index( tab );
18303
18304		this.active = clickedIsActive ? $() : tab;
18305		if ( this.xhr ) {
18306			this.xhr.abort();
18307		}
18308
18309		if ( !toHide.length && !toShow.length ) {
18310			$.error( "jQuery UI Tabs: Mismatching fragment identifier." );
18311		}
18312
18313		if ( toShow.length ) {
18314			this.load( this.tabs.index( tab ), event );
18315		}
18316		this._toggle( event, eventData );
18317	},
18318
18319	// Handles show/hide for selecting tabs
18320	_toggle: function( event, eventData ) {
18321		var that = this,
18322			toShow = eventData.newPanel,
18323			toHide = eventData.oldPanel;
18324
18325		this.running = true;
18326
18327		function complete() {
18328			that.running = false;
18329			that._trigger( "activate", event, eventData );
18330		}
18331
18332		function show() {
18333			that._addClass( eventData.newTab.closest( "li" ), "ui-tabs-active", "ui-state-active" );
18334
18335			if ( toShow.length && that.options.show ) {
18336				that._show( toShow, that.options.show, complete );
18337			} else {
18338				toShow.show();
18339				complete();
18340			}
18341		}
18342
18343		// Start out by hiding, then showing, then completing
18344		if ( toHide.length && this.options.hide ) {
18345			this._hide( toHide, this.options.hide, function() {
18346				that._removeClass( eventData.oldTab.closest( "li" ),
18347					"ui-tabs-active", "ui-state-active" );
18348				show();
18349			} );
18350		} else {
18351			this._removeClass( eventData.oldTab.closest( "li" ),
18352				"ui-tabs-active", "ui-state-active" );
18353			toHide.hide();
18354			show();
18355		}
18356
18357		toHide.attr( "aria-hidden", "true" );
18358		eventData.oldTab.attr( {
18359			"aria-selected": "false",
18360			"aria-expanded": "false"
18361		} );
18362
18363		// If we're switching tabs, remove the old tab from the tab order.
18364		// If we're opening from collapsed state, remove the previous tab from the tab order.
18365		// If we're collapsing, then keep the collapsing tab in the tab order.
18366		if ( toShow.length && toHide.length ) {
18367			eventData.oldTab.attr( "tabIndex", -1 );
18368		} else if ( toShow.length ) {
18369			this.tabs.filter( function() {
18370				return $( this ).attr( "tabIndex" ) === 0;
18371			} )
18372				.attr( "tabIndex", -1 );
18373		}
18374
18375		toShow.attr( "aria-hidden", "false" );
18376		eventData.newTab.attr( {
18377			"aria-selected": "true",
18378			"aria-expanded": "true",
18379			tabIndex: 0
18380		} );
18381	},
18382
18383	_activate: function( index ) {
18384		var anchor,
18385			active = this._findActive( index );
18386
18387		// Trying to activate the already active panel
18388		if ( active[ 0 ] === this.active[ 0 ] ) {
18389			return;
18390		}
18391
18392		// Trying to collapse, simulate a click on the current active header
18393		if ( !active.length ) {
18394			active = this.active;
18395		}
18396
18397		anchor = active.find( ".ui-tabs-anchor" )[ 0 ];
18398		this._eventHandler( {
18399			target: anchor,
18400			currentTarget: anchor,
18401			preventDefault: $.noop
18402		} );
18403	},
18404
18405	_findActive: function( index ) {
18406		return index === false ? $() : this.tabs.eq( index );
18407	},
18408
18409	_getIndex: function( index ) {
18410
18411		// meta-function to give users option to provide a href string instead of a numerical index.
18412		if ( typeof index === "string" ) {
18413			index = this.anchors.index( this.anchors.filter( "[href$='" +
18414				$.escapeSelector( index ) + "']" ) );
18415		}
18416
18417		return index;
18418	},
18419
18420	_destroy: function() {
18421		if ( this.xhr ) {
18422			this.xhr.abort();
18423		}
18424
18425		this.tablist
18426			.removeAttr( "role" )
18427			.off( this.eventNamespace );
18428
18429		this.anchors
18430			.removeAttr( "role tabIndex" )
18431			.removeUniqueId();
18432
18433		this.tabs.add( this.panels ).each( function() {
18434			if ( $.data( this, "ui-tabs-destroy" ) ) {
18435				$( this ).remove();
18436			} else {
18437				$( this ).removeAttr( "role tabIndex " +
18438					"aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded" );
18439			}
18440		} );
18441
18442		this.tabs.each( function() {
18443			var li = $( this ),
18444				prev = li.data( "ui-tabs-aria-controls" );
18445			if ( prev ) {
18446				li
18447					.attr( "aria-controls", prev )
18448					.removeData( "ui-tabs-aria-controls" );
18449			} else {
18450				li.removeAttr( "aria-controls" );
18451			}
18452		} );
18453
18454		this.panels.show();
18455
18456		if ( this.options.heightStyle !== "content" ) {
18457			this.panels.css( "height", "" );
18458		}
18459	},
18460
18461	enable: function( index ) {
18462		var disabled = this.options.disabled;
18463		if ( disabled === false ) {
18464			return;
18465		}
18466
18467		if ( index === undefined ) {
18468			disabled = false;
18469		} else {
18470			index = this._getIndex( index );
18471			if ( Array.isArray( disabled ) ) {
18472				disabled = $.map( disabled, function( num ) {
18473					return num !== index ? num : null;
18474				} );
18475			} else {
18476				disabled = $.map( this.tabs, function( li, num ) {
18477					return num !== index ? num : null;
18478				} );
18479			}
18480		}
18481		this._setOptionDisabled( disabled );
18482	},
18483
18484	disable: function( index ) {
18485		var disabled = this.options.disabled;
18486		if ( disabled === true ) {
18487			return;
18488		}
18489
18490		if ( index === undefined ) {
18491			disabled = true;
18492		} else {
18493			index = this._getIndex( index );
18494			if ( $.inArray( index, disabled ) !== -1 ) {
18495				return;
18496			}
18497			if ( Array.isArray( disabled ) ) {
18498				disabled = $.merge( [ index ], disabled ).sort();
18499			} else {
18500				disabled = [ index ];
18501			}
18502		}
18503		this._setOptionDisabled( disabled );
18504	},
18505
18506	load: function( index, event ) {
18507		index = this._getIndex( index );
18508		var that = this,
18509			tab = this.tabs.eq( index ),
18510			anchor = tab.find( ".ui-tabs-anchor" ),
18511			panel = this._getPanelForTab( tab ),
18512			eventData = {
18513				tab: tab,
18514				panel: panel
18515			},
18516			complete = function( jqXHR, status ) {
18517				if ( status === "abort" ) {
18518					that.panels.stop( false, true );
18519				}
18520
18521				that._removeClass( tab, "ui-tabs-loading" );
18522				panel.removeAttr( "aria-busy" );
18523
18524				if ( jqXHR === that.xhr ) {
18525					delete that.xhr;
18526				}
18527			};
18528
18529		// Not remote
18530		if ( this._isLocal( anchor[ 0 ] ) ) {
18531			return;
18532		}
18533
18534		this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) );
18535
18536		// Support: jQuery <1.8
18537		// jQuery <1.8 returns false if the request is canceled in beforeSend,
18538		// but as of 1.8, $.ajax() always returns a jqXHR object.
18539		if ( this.xhr && this.xhr.statusText !== "canceled" ) {
18540			this._addClass( tab, "ui-tabs-loading" );
18541			panel.attr( "aria-busy", "true" );
18542
18543			this.xhr
18544				.done( function( response, status, jqXHR ) {
18545
18546					// support: jQuery <1.8
18547					// http
18547://bugs.jquery.com/ticket/11778
18548					setTimeout( function() {
18549						panel.html( response );
18550						that._trigger( "load", event, eventData );
18551
18552						complete( jqXHR, status );
18553					}, 1 );
18554				} )
18555				.fail( function( jqXHR, status ) {
18556
18557					// support: jQuery <1.8
18558					// http://bugs.jquery.com/ticket/11778
18559					setTimeout( function() {
18560						complete( jqXHR, status );
18561					}, 1 );
18562				} );
18563		}
18564	},
18565
18566	_ajaxSettings: function( anchor, event, eventData ) {
18567		var that = this;
18568		return {
18569
vendor: 1,423 bytes, lines 18570-18622
18570			// Support: IE <11 only
18571			// Strip any hash that exists to prevent errors with the Ajax request
18572			url: anchor.attr( "href" ).replace( /#.*$/, "" ),
18573			beforeSend: function( jqXHR, settings ) {
18574				return that._trigger( "beforeLoad", event,
18575					$.extend( { jqXHR: jqXHR, ajaxSettings: settings }, eventData ) );
18576			}
18577		};
18578	},
18579
18580	_getPanelForTab: function( tab ) {
18581		var id = $( tab ).attr( "aria-controls" );
18582		return this.element.find( this._sanitizeSelector( "#" + id ) );
18583	}
18584} );
18585
18586// DEPRECATED
18587// TODO: Switch return back to widget declaration at top of file when this is removed
18588if ( $.uiBackCompat !== false ) {
18589
18590	// Backcompat for ui-tab class (now ui-tabs-tab)
18591	$.widget( "ui.tabs", $.ui.tabs, {
18592		_processTabs: function() {
18593			this._superApply( arguments );
18594			this._addClass( this.tabs, "ui-tab" );
18595		}
18596	} );
18597}
18598
18599var widgetsTabs = $.ui.tabs;
18600
18601
18602/*!
18603 * jQuery UI Tooltip 1.13.2
18604 * http://jqueryui.com
18605 *
18606 * Copyright jQuery Foundation and other contributors
18607 * Released under the MIT license.
18608 * http://jquery.org/license
18609 */
18610
18611//>>label: Tooltip
18612//>>group: Widgets
18613//>>description: Shows additional information for any element on hover or focus.
18614//>>docs: http://api.jqueryui.com/tooltip/
18615//>>demos: http://jqueryui.com/tooltip/
18616//>>css.structure: ../../themes/base/core.css
18617//>>css.structure: ../../themes/base/tooltip.css
18618//>>css.theme: ../../themes/base/theme.css
18619
18620
18621$.widget( "ui.tooltip", {
18622	version: "1.13.2
vendor: 13,567 bytes, lines 18622-19110
18622",
18623	options: {
18624		classes: {
18625			"ui-tooltip": "ui-corner-all ui-widget-shadow"
18626		},
18627		content: function() {
18628			var title = $( this ).attr( "title" );
18629
18630			// Escape title, since we're going from an attribute to raw HTML
18631			return $( "<a>" ).text( title ).html();
18632		},
18633		hide: true,
18634
18635		// Disabled elements have inconsistent behavior across browsers (#8661)
18636		items: "[title]:not([disabled])",
18637		position: {
18638			my: "left top+15",
18639			at: "left bottom",
18640			collision: "flipfit flip"
18641		},
18642		show: true,
18643		track: false,
18644
18645		// Callbacks
18646		close: null,
18647		open: null
18648	},
18649
18650	_addDescribedBy: function( elem, id ) {
18651		var describedby = ( elem.attr( "aria-describedby" ) || "" ).split( /\s+/ );
18652		describedby.push( id );
18653		elem
18654			.data( "ui-tooltip-id", id )
18655			.attr( "aria-describedby", String.prototype.trim.call( describedby.join( " " ) ) );
18656	},
18657
18658	_removeDescribedBy: function( elem ) {
18659		var id = elem.data( "ui-tooltip-id" ),
18660			describedby = ( elem.attr( "aria-describedby" ) || "" ).split( /\s+/ ),
18661			index = $.inArray( id, describedby );
18662
18663		if ( index !== -1 ) {
18664			describedby.splice( index, 1 );
18665		}
18666
18667		elem.removeData( "ui-tooltip-id" );
18668		describedby = String.prototype.trim.call( describedby.join( " " ) );
18669		if ( describedby ) {
18670			elem.attr( "aria-describedby", describedby );
18671		} else {
18672			elem.removeAttr( "aria-describedby" );
18673		}
18674	},
18675
18676	_create: function() {
18677		this._on( {
18678			mouseover: "open",
18679			focusin: "open"
18680		} );
18681
18682		// IDs of generated tooltips, needed for destroy
18683		this.tooltips = {};
18684
18685		// IDs of parent tooltips where we removed the title attribute
18686		this.parents = {};
18687
18688		// Append the aria-live region so tooltips announce correctly
18689		this.liveRegion = $( "<div>" )
18690			.attr( {
18691				role: "log",
18692				"aria-live": "assertive",
18693				"aria-relevant": "additions"
18694			} )
18695			.appendTo( this.document[ 0 ].body );
18696		this._addClass( this.liveRegion, null, "ui-helper-hidden-accessible" );
18697
18698		this.disabledTitles = $( [] );
18699	},
18700
18701	_setOption: function( key, value ) {
18702		var that = this;
18703
18704		this._super( key, value );
18705
18706		if ( key === "content" ) {
18707			$.each( this.tooltips, function( id, tooltipData ) {
18708				that._updateContent( tooltipData.element );
18709			} );
18710		}
18711	},
18712
18713	_setOptionDisabled: function( value ) {
18714		this[ value ? "_disable" : "_enable" ]();
18715	},
18716
18717	_disable: function() {
18718		var that = this;
18719
18720		// Close open tooltips
18721		$.each( this.tooltips, function( id, tooltipData ) {
18722			var event = $.Event( "blur" );
18723			event.target = event.currentTarget = tooltipData.element[ 0 ];
18724			that.close( event, true );
18725		} );
18726
18727		// Remove title attributes to prevent native tooltips
18728		this.disabledTitles = this.disabledTitles.add(
18729			this.element.find( this.options.items ).addBack()
18730				.filter( function() {
18731					var element = $( this );
18732					if ( element.is( "[title]" ) ) {
18733						return element
18734							.data( "ui-tooltip-title", element.attr( "title" ) )
18735							.removeAttr( "title" );
18736					}
18737				} )
18738		);
18739	},
18740
18741	_enable: function() {
18742
18743		// restore title attributes
18744		this.disabledTitles.each( function() {
18745			var element = $( this );
18746			if ( element.data( "ui-tooltip-title" ) ) {
18747				element.attr( "title", element.data( "ui-tooltip-title" ) );
18748			}
18749		} );
18750		this.disabledTitles = $( [] );
18751	},
18752
18753	open: function( event ) {
18754		var that = this,
18755			target = $( event ? event.target : this.element )
18756
18757				// we need closest here due to mouseover bubbling,
18758				// but always pointing at the same event target
18759				.closest( this.options.items );
18760
18761		// No element to show a tooltip for or the tooltip is already open
18762		if ( !target.length || target.data( "ui-tooltip-id" ) ) {
18763			return;
18764		}
18765
18766		if ( target.attr( "title" ) ) {
18767			target.data( "ui-tooltip-title", target.attr( "title" ) );
18768		}
18769
18770		target.data( "ui-tooltip-open", true );
18771
18772		// Kill parent tooltips, custom or native, for hover
18773		if ( event && event.type === "mouseover" ) {
18774			target.parents().each( function() {
18775				var parent = $( this ),
18776					blurEvent;
18777				if ( parent.data( "ui-tooltip-open" ) ) {
18778					blurEvent = $.Event( "blur" );
18779					blurEvent.target = blurEvent.currentTarget = this;
18780					that.close( blurEvent, true );
18781				}
18782				if ( parent.attr( "title" ) ) {
18783					parent.uniqueId();
18784					that.parents[ this.id ] = {
18785						element: this,
18786						title: parent.attr( "title" )
18787					};
18788					parent.attr( "title", "" );
18789				}
18790			} );
18791		}
18792
18793		this._registerCloseHandlers( event, target );
18794		this._updateContent( target, event );
18795	},
18796
18797	_updateContent: function( target, event ) {
18798		var content,
18799			contentOption = this.options.content,
18800			that = this,
18801			eventType = event ? event.type : null;
18802
18803		if ( typeof contentOption === "string" || contentOption.nodeType ||
18804				contentOption.jquery ) {
18805			return this._open( event, target, contentOption );
18806		}
18807
18808		content = contentOption.call( target[ 0 ], function( response ) {
18809
18810			// IE may instantly serve a cached response for ajax requests
18811			// delay this call to _open so the other call to _open runs first
18812			that._delay( function() {
18813
18814				// Ignore async response if tooltip was closed already
18815				if ( !target.data( "ui-tooltip-open" ) ) {
18816					return;
18817				}
18818
18819				// JQuery creates a special event for focusin when it doesn't
18820				// exist natively. To improve performance, the native event
18821				// object is reused and the type is changed. Therefore, we can't
18822				// rely on the type being correct after the event finished
18823				// bubbling, so we set it back to the previous value. (#8740)
18824				if ( event ) {
18825					event.type = eventType;
18826				}
18827				this._open( event, target, response );
18828			} );
18829		} );
18830		if ( content ) {
18831			this._open( event, target, content );
18832		}
18833	},
18834
18835	_open: function( event, target, content ) {
18836		var tooltipData, tooltip, delayedShow, a11yContent,
18837			positionOption = $.extend( {}, this.options.position );
18838
18839		if ( !content ) {
18840			return;
18841		}
18842
18843		// Content can be updated multiple times. If the tooltip already
18844		// exists, then just update the content and bail.
18845		tooltipData = this._find( target );
18846		if ( tooltipData ) {
18847			tooltipData.tooltip.find( ".ui-tooltip-content" ).html( content );
18848			return;
18849		}
18850
18851		// If we have a title, clear it to prevent the native tooltip
18852		// we have to check first to avoid defining a title if none exists
18853		// (we don't want to cause an element to start matching [title])
18854		//
18855		// We use removeAttr only for key events, to allow IE to export the correct
18856		// accessible attributes. For mouse events, set to empty string to avoid
18857		// native tooltip showing up (happens only when removing inside mouseover).
18858		if ( target.is( "[title]" ) ) {
18859			if ( event && event.type === "mouseover" ) {
18860				target.attr( "title", "" );
18861			} else {
18862				target.removeAttr( "title" );
18863			}
18864		}
18865
18866		tooltipData = this._tooltip( target );
18867		tooltip = tooltipData.tooltip;
18868		this._addDescribedBy( target, tooltip.attr( "id" ) );
18869		tooltip.find( ".ui-tooltip-content" ).html( content );
18870
18871		// Support: Voiceover on OS X, JAWS on IE <= 9
18872		// JAWS announces deletions even when aria-relevant="additions"
18873		// Voiceover will sometimes re-read the entire log region's contents from the beginning
18874		this.liveRegion.children().hide();
18875		a11yContent = $( "<div>" ).html( tooltip.find( ".ui-tooltip-content" ).html() );
18876		a11yContent.removeAttr( "name" ).find( "[name]" ).removeAttr( "name" );
18877		a11yContent.removeAttr( "id" ).find( "[id]" ).removeAttr( "id" );
18878		a11yContent.appendTo( this.liveRegion );
18879
18880		function position( event ) {
18881			positionOption.of = event;
18882			if ( tooltip.is( ":hidden" ) ) {
18883				return;
18884			}
18885			tooltip.position( positionOption );
18886		}
18887		if ( this.options.track && event && /^mouse/.test( event.type ) ) {
18888			this._on( this.document, {
18889				mousemove: position
18890			} );
18891
18892			// trigger once to override element-relative positioning
18893			position( event );
18894		} else {
18895			tooltip.position( $.extend( {
18896				of: target
18897			}, this.options.position ) );
18898		}
18899
18900		tooltip.hide();
18901
18902		this._show( tooltip, this.options.show );
18903
18904		// Handle tracking tooltips that are shown with a delay (#8644). As soon
18905		// as the tooltip is visible, position the tooltip using the most recent
18906		// event.
18907		// Adds the check to add the timers only when both delay and track options are set (#14682)
18908		if ( this.options.track && this.options.show && this.options.show.delay ) {
18909			delayedShow = this.delayedShow = setInterval( function() {
18910				if ( tooltip.is( ":visible" ) ) {
18911					position( positionOption.of );
18912					clearInterval( delayedShow );
18913				}
18914			}, 13 );
18915		}
18916
18917		this._trigger( "open", event, { tooltip: tooltip } );
18918	},
18919
18920	_registerCloseHandlers: function( event, target ) {
18921		var events = {
18922			keyup: function( event ) {
18923				if ( event.keyCode === $.ui.keyCode.ESCAPE ) {
18924					var fakeEvent = $.Event( event );
18925					fakeEvent.currentTarget = target[ 0 ];
18926					this.close( fakeEvent, true );
18927				}
18928			}
18929		};
18930
18931		// Only bind remove handler for delegated targets. Non-delegated
18932		// tooltips will handle this in destroy.
18933		if ( target[ 0 ] !== this.element[ 0 ] ) {
18934			events.remove = function() {
18935				var targetElement = this._find( target );
18936				if ( targetElement ) {
18937					this._removeTooltip( targetElement.tooltip );
18938				}
18939			};
18940		}
18941
18942		if ( !event || event.type === "mouseover" ) {
18943			events.mouseleave = "close";
18944		}
18945		if ( !event || event.type === "focusin" ) {
18946			events.focusout = "close";
18947		}
18948		this._on( true, target, events );
18949	},
18950
18951	close: function( event ) {
18952		var tooltip,
18953			that = this,
18954			target = $( event ? event.currentTarget : this.element ),
18955			tooltipData = this._find( target );
18956
18957		// The tooltip may already be closed
18958		if ( !tooltipData ) {
18959
18960			// We set ui-tooltip-open immediately upon open (in open()), but only set the
18961			// additional data once there's actually content to show (in _open()). So even if the
18962			// tooltip doesn't have full data, we always remove ui-tooltip-open in case we're in
18963			// the period between open() and _open().
18964			target.removeData( "ui-tooltip-open" );
18965			return;
18966		}
18967
18968		tooltip = tooltipData.tooltip;
18969
18970		// Disabling closes the tooltip, so we need to track when we're closing
18971		// to avoid an infinite loop in case the tooltip becomes disabled on close
18972		if ( tooltipData.closing ) {
18973			return;
18974		}
18975
18976		// Clear the interval for delayed tracking tooltips
18977		clearInterval( this.delayedShow );
18978
18979		// Only set title if we had one before (see comment in _open())
18980		// If the title attribute has changed since open(), don't restore
18981		if ( target.data( "ui-tooltip-title" ) && !target.attr( "title" ) ) {
18982			target.attr( "title", target.data( "ui-tooltip-title" ) );
18983		}
18984
18985		this._removeDescribedBy( target );
18986
18987		tooltipData.hiding = true;
18988		tooltip.stop( true );
18989		this._hide( tooltip, this.options.hide, function() {
18990			that._removeTooltip( $( this ) );
18991		} );
18992
18993		target.removeData( "ui-tooltip-open" );
18994		this._off( target, "mouseleave focusout keyup" );
18995
18996		// Remove 'remove' binding only on delegated targets
18997		if ( target[ 0 ] !== this.element[ 0 ] ) {
18998			this._off( target, "remove" );
18999		}
19000		this._off( this.document, "mousemove" );
19001
19002		if ( event && event.type === "mouseleave" ) {
19003			$.each( this.parents, function( id, parent ) {
19004				$( parent.element ).attr( "title", parent.title );
19005				delete that.parents[ id ];
19006			} );
19007		}
19008
19009		tooltipData.closing = true;
19010		this._trigger( "close", event, { tooltip: tooltip } );
19011		if ( !tooltipData.hiding ) {
19012			tooltipData.closing = false;
19013		}
19014	},
19015
19016	_tooltip: function( element ) {
19017		var tooltip = $( "<div>" ).attr( "role", "tooltip" ),
19018			content = $( "<div>" ).appendTo( tooltip ),
19019			id = tooltip.uniqueId().attr( "id" );
19020
19021		this._addClass( content, "ui-tooltip-content" );
19022		this._addClass( tooltip, "ui-tooltip", "ui-widget ui-widget-content" );
19023
19024		tooltip.appendTo( this._appendTo( element ) );
19025
19026		return this.tooltips[ id ] = {
19027			element: element,
19028			tooltip: tooltip
19029		};
19030	},
19031
19032	_find: function( target ) {
19033		var id = target.data( "ui-tooltip-id" );
19034		return id ? this.tooltips[ id ] : null;
19035	},
19036
19037	_removeTooltip: function( tooltip ) {
19038
19039		// Clear the interval for delayed tracking tooltips
19040		clearInterval( this.delayedShow );
19041
19042		tooltip.remove();
19043		delete this.tooltips[ tooltip.attr( "id" ) ];
19044	},
19045
19046	_appendTo: function( target ) {
19047		var element = target.closest( ".ui-front, dialog" );
19048
19049		if ( !element.length ) {
19050			element = this.document[ 0 ].body;
19051		}
19052
19053		return element;
19054	},
19055
19056	_destroy: function() {
19057		var that = this;
19058
19059		// Close open tooltips
19060		$.each( this.tooltips, function( id, tooltipData ) {
19061
19062			// Delegate to close method to handle common cleanup
19063			var event = $.Event( "blur" ),
19064				element = tooltipData.element;
19065			event.target = event.currentTarget = element[ 0 ];
19066			that.close( event, true );
19067
19068			// Remove immediately; destroying an open tooltip doesn't use the
19069			// hide animation
19070			$( "#" + id ).remove();
19071
19072			// Restore the title
19073			if ( element.data( "ui-tooltip-title" ) ) {
19074
19075				// If the title attribute has changed since open(), don't restore
19076				if ( !element.attr( "title" ) ) {
19077					element.attr( "title", element.data( "ui-tooltip-title" ) );
19078				}
19079				element.removeData( "ui-tooltip-title" );
19080			}
19081		} );
19082		this.liveRegion.remove();
19083	}
19084} );
19085
19086// DEPRECATED
19087// TODO: Switch return back to widget declaration at top of file when this is removed
19088if ( $.uiBackCompat !== false ) {
19089
19090	// Backcompat for tooltipClass option
19091	$.widget( "ui.tooltip", $.ui.tooltip, {
19092		options: {
19093			tooltipClass: null
19094		},
19095		_tooltip: function() {
19096			var tooltipData = this._superApply( arguments );
19097			if ( this.options.tooltipClass ) {
19098				tooltipData.tooltip.addClass( this.options.tooltipClass );
19099			}
19100			return tooltipData;
19101		}
19102	} );
19103}
19104
19105var widgetsTooltip = $.ui.tooltip;
19106
19107
19108
19109
19110} );
19110
19111// Copyright (c) 2009 Daniel Wachsstock
19112// MIT license:
19113// Permission is hereby granted, free of charge, to any person
19114// obtaining a copy of this software and associated documentation
19115// files (the "Software"), to deal in the Software without
19116// restriction, including without limitation the rights to use,
19117// copy, modify, merge, publish, distribute, sublicense, and/or sell
19118// copies of the Software, and to permit persons to whom the
19119// Software is furnished to do so, subject to the following
19120// conditions:
19121
19122// The above copyright notice and this permission notice shall be
19123// included in all copies or substantial portions of the Software.
19124
19125// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19126// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19127// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19128// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19129// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19130// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19131// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
19132// OTHER DEALINGS IN THE SOFTWARE.
19133(function($){
19134// create the master widget
19135    $.widget("ui.widget",{
19136        // Aspect Oriented Programming tools from Justin Palmer's article
19137        'yield': null,
19138        returnValues: { },
19139        before: function(method, f) {
19140            var original = this[method];
19141            this[method] = function() {
19142                f.apply(this, arguments);
19143                return original.apply(this, arguments);
19144            };
19145        },
19146        after: function(method, f) {
19147            var original = this[method];
19148            this[method] = function() {
19149                this.returnValues[method] = original.apply(this, arguments);
19150                return f.apply(this, arguments);
19151            }
19152        },
19153        around: function(method, f) {
19154            var original = this[method];
19155            this[method] = function() {
19156                var tmp = this["yield"];
19157                this["yield"] = original;
19158                var ret = f.apply(this, arguments);
19159                this["yield"] = tmp;
19160                return ret;
19161            }
19162        }
19163    });
19164
19165// from http://groups.google.com/group/comp.lang.javascript/msg/e04726a66face2a2 and
19166// http://webreflection.blogspot.com/2008/10/big-douglas-begetobject-revisited.html
19167    var object = (function(F){
19168        return (function(o){
19169            F.prototype = o;
19170            return new F();
19171        });
19172    })(function (){});
19173
19174// create a widget subclass
19175    var OVERRIDE = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/;
19176    $.ui.widget.subclass = function subclass(name){
19177        $.widget(name); // Slightly inefficient to create a widget only to discard its prototype, but it's not too bad
19178        name = name.split('.');
19179        var widget = $[name[0]][name[1]], superclass = this, superproto = superclass.prototype;
19180
19181
19182        var proto = arguments[0] = widget.prototype = object(superproto); // inherit from the superclass
19183        $.extend.apply(null, arguments); // and add other add-in methods to the prototype
19184        widget.subclass = subclass;
19185
19186        // Subtle point: we want to call superclass init and destroy if they exist
19187        // (otherwise the user of this function would have to keep track of all that)
19188        for (key in proto) if (proto.hasOwnProperty(key)) switch (key){
19189            case '_create':
19190                var create = proto._create;
19191                proto._create = function(){
19192                    superproto._create.apply(this);
19193                    create.apply(this);
19194                };
19195                break;
19196            case '_init':
19197                var init = proto._init;
19198                proto._init = function(){
19199                    superproto._init.apply(this);
19200                    init.apply(this);
19201                };
19202                break;
19203            case 'destroy':
19204                var destroy = proto.destroy;
19205                proto.destroy = function(){
19206                    destroy.apply(this);
19207                    superproto.destroy.apply(this);
19208                };
19209                break;
19210            case 'options':
19211                var options = proto.options;
19212                proto.options = $.extend ({}, superproto.options, options);
19213                break;
19214            default:
19215                if ($.isFunction(proto[key]) && $.isFunction(superproto[key]) && OVERRIDE.test(proto[key])){
19216                    proto[key] = (function(name, fn){
19217                        return function() {
19218                            var tmp = this._super;
19219                            this._super = superproto[name];
19220                            try { var ret = fn.apply(this, arguments); }
19221                            finally { this._super = tmp; }
19222                            return ret;
19223                        };
19224                    })(key, proto[key]);
19225                }
19226                break;
19227        }
19228    };
19229})(jQuery);
19230
19231
19232(function(jQuery,$){(function(jQuery,undefined){var oldManip=jQuery.fn.domManip,tmplItmAtt="_tmplitem",htmlExpr=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{! /,newTmplItems={},wrappedItems={},appendToTmplItems,topTmplItem={key:0,data:{}},itemKey=0,cloneIndex=0,stack=[];function newTmplItem(options,parentItem,fn,data){var newItem={data:data||(parentItem?parentItem.data:{}),_wrap:parentItem?parentItem._wrap:null,tmpl:null,parent:parentItem||null,nodes:[],calls:tiCalls,nest:tiNest,wrap:tiWrap,html:tiHtml,update:tiUpdate};
19233if(options)jQuery.extend(newItem,options,{nodes:[],parent:parentItem});if(fn){newItem.tmpl=fn;
19233newItem._ctnt=newItem._ctnt||newItem.tmpl(jQuery,newItem);newItem.key=++itemKey;(stack.length?wrappedItems:newTmplItems)[itemKey]=newItem}return newItem}jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var ret=[],insert=jQuery(selector),elems,i,l,tmplItems,parent=this.length===
192341&&this[0].parentNode;appendToTmplItems=newTmplItems||{};if(parent&&parent.nodeType===11&&parent.childNodes.length===1&&insert.length===1){insert[original](this[0]);ret=this}else{for(i=0,l=insert.length;i<l;i++){cloneIndex=i;elems=(i>0?this.clone(true):this).get();jQuery.fn[original].apply(jQuery(insert[i]),elems);ret=ret.concat(elems)}cloneIndex=0;ret=this.pushStack(ret,name,insert.selector)}tmplItems=appendToTmplItems;appendToTmplItems=null;jQuery.tmpl.complete(tmplItems);return ret}});jQuery.fn.extend({tmpl:function(data,
19235options,parentItem){return jQuery.tmpl(this[0],data,options,parentItem)},tmplItem:function(){return jQuery.tmplItem(this[0])},template:function(name){return jQuery.template(name,this[0])},domManip:function(args,table,callback,options){if(args[0]&&args[0].nodeType){var dmArgs=jQuery.makeArray(arguments),argsLength=args.length,i=0,tmplItem;while(i<argsLength&&!(tmplItem=jQuery.data(args[i++],"tmplItem")));if(argsLength>1)dmArgs[0]=[jQuery.makeArray(args)];if(tmplItem&&cloneIndex)dmArgs[2]=function(fragClone){jQuery.tmpl.afterManip(this,
19236fragClone,callback)};oldManip.apply(this,dmArgs)}else oldManip.apply(this,arguments);cloneIndex=0;if(!appendToTmplItems)jQuery.tmpl.complete(newTmplItems);return this}});jQuery.extend({tmpl:function(tmpl,data,options,parentItem){var ret,topLevel=!parentItem;if(topLevel){parentItem=topTmplItem;tmpl=jQuery.template[tmpl]||jQuery.template(null,tmpl);wrappedItems={}}else if(!tmpl){tmpl=parentItem.tmpl;newTmplItems[parentItem.key]=parentItem;parentItem.nodes=[];if(parentItem.wrapped)updateWrapped(parentItem,
19237parentItem.wrapped);return jQuery(build(parentItem,null,parentItem.tmpl(jQuery,parentItem)))}if(!tmpl)return[];if(typeof data==="function")data=data.call(parentItem||{});if(options&&options.wrapped)updateWrapped(options,options.wrapped);ret=jQuery.isArray(data)?jQuery.map(data,function(dataItem){return dataItem?newTmplItem(options,parentItem,tmpl,dataItem):null}):[newTmplItem(options,parentItem,tmpl,data)];return topLevel?jQuery(build(parentItem,null,ret)):ret},tmplItem:function(elem){var tmplItem;
19238if(elem instanceof jQuery)elem=elem[0];while(elem&&elem.nodeType===1&&!(tmplItem=jQuery.data(elem,"tmplItem"))&&(elem=elem.parentNode));return tmplItem||topTmplItem},template:function(name,tmpl){if(tmpl){if(typeof tmpl==="string")tmpl=buildTmplFn(tmpl);else if(tmpl instanceof jQuery)tmpl=tmpl[0]||{};if(tmpl.nodeType)tmpl=jQuery.data(tmpl,"tmpl")||jQuery.data(tmpl,"tmpl",buildTmplFn(tmpl.innerHTML));return typeof name==="string"?jQuery.template[name]=tmpl:tmpl}return name?typeof name!=="string"?jQuery.template(null,
19239name):jQuery.template[name]||jQuery.template(null,htmlExpr.test(name)?name:jQuery(name)):null},encode:function(text){return(""+text).split("\x3c").join("\x26lt;").split("\x3e").join("\x26gt;").split('"').join("\x26#34;").split("'").join("\x26#39;")}});jQuery.extend(jQuery.tmpl,{tag:{"tmpl":{_default:{$2:"null"},open:"if($notnull_1){_\x3d_.concat($item.nest($1,$2));}"},"wrap":{_default:{$2:"null"},open:"$item.calls(_,$1,$2);_\x3d[];",close:"call\x3d$item.calls();_\x3dcall._.concat($item.wrap(call,_));"},
19240"each":{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},"if":{open:"if(($notnull_1) \x26\x26 $1a){",close:"}"},"else":{_default:{$1:"true"},open:"}else if(($notnull_1) \x26\x26 $1a){"},"html":{open:"if($notnull_1){_.push($1a);}"},"\x3d":{_default:{$1:"$data"},open:"if($notnull_1){_.push($.encode($1a));}"},"!":{open:""}},complete:function(items){newTmplItems={}},afterManip:function afterManip(elem,fragClone,callback){var content=fragClone.nodeType===
1924111?jQuery.makeArray(fragClone.childNodes):fragClone.nodeType===1?[fragClone]:[];callback.call(elem,fragClone);
19241storeTmplItems(content);cloneIndex++}});function build(tmplItem,nested,content){var frag,ret=content?jQuery.map(content,function(item){return typeof item==="string"?tmplItem.key?item.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+tmplItmAtt+'\x3d"'+tmplItem.key+'" $2'):item:build(item,tmplItem,item._ctnt)}):tmplItem;if(nested)return ret;ret=ret.join("");ret.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,
19242function(all,before,middle,after){frag=jQuery(middle).get();storeTmplItems(frag);if(before)frag=unencode(before).concat(frag);if(after)frag=frag.concat(unencode(after))});return frag?frag:unencode(ret)}function unencode(text){var el=document.createElement("div");el.innerHTML=text;return jQuery.makeArray(el.childNodes)}function buildTmplFn(markup){return new Function("jQuery","$item","var $\x3djQuery,call,_\x3d[],$data\x3d$item.data;"+"with($data){_.push('"+jQuery.trim(markup).replace(/([\\'])/g,"\\$1").replace(/[\r\t\n]/g,
19243" ").replace(/\$\{([^\}]*)\}/g,"{{\x3d $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,function(all,slash,type,fnargs,target,parens,args){var tag=jQuery.tmpl.tag[type],def,expr,exprAutoFnDetect;if(!tag)throw"Template command not found: "+type;def=tag._default||[];if(parens&&!/\w$/.test(target)){target+=parens;parens=""}if(target){target=unescape(target);args=args?","+unescape(args)+")":parens?")":"";expr=parens?target.indexOf(".")>
19244-1?target+parens:"("+target+").call($item"+args:target;exprAutoFnDetect=parens?expr:"(typeof("+target+")\x3d\x3d\x3d'function'?("+target+").call($item):("+target+"))"}else exprAutoFnDetect=expr=def.$1||"null";fnargs=unescape(fnargs);return"');"+tag[slash?"close":"open"].split("$notnull_1").join(target?"typeof("+target+")!\x3d\x3d'undefined' \x26\x26 ("+target+")!\x3dnull":"true").split("$1a").join(exprAutoFnDetect).split("$1").join(expr).split("$2").join(fnargs?fnargs.replace(/\s*([^\(]+)\s*(\((.*?)\))?/g,
19245function(all,name,parens,params){params=params?","+params+")":parens?")":"";return params?"("+name+").call($item"+params:all}):def.$2||"")+"_.push('"})+"');}return _;")}function updateWrapped(options,wrapped){options._wrap=build(options,true,jQuery.isArray(wrapped)?wrapped:[htmlExpr.test(wrapped)?wrapped:jQuery(wrapped).html()]).join("")}function unescape(args){return args?args.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null}function outerHtml(elem){var div=document.createElement("div");div.appendChild(elem.cloneNode(true));
19246return div.innerHTML}function storeTmplItems(content){var keySuffix="_"+cloneIndex,elem,elems,newClonedItems={},i,l,m;for(i=0,l=content.length;i<l;i++){if((elem=content[i]).nodeType!==1)continue;elems=elem.getElementsByTagName("*");for(m=elems.length-1;m>=0;m--)processItemKey(elems[m]);processItemKey(elem)}function processItemKey(el){var pntKey,pntNode=el,pntItem,tmplItem,key;if(key=el.getAttribute(tmplItmAtt)){while(pntNode.parentNode&&(pntNode=pntNode.parentNode).nodeType===1&&!(pntKey=pntNode.getAttribute(tmplItmAtt)));
19247if(pntKey!==key){pntNode=pntNode.parentNode?pntNode.nodeType===11?0:pntNode.getAttribute(tmplItmAtt)||0:0;if(!(tmplItem=newTmplItems[key])){tmplItem=wrappedItems[key];tmplItem=newTmplItem(tmplItem,newTmplItems[pntNode]||wrappedItems[pntNode],null,true);tmplItem.key=++itemKey;newTmplItems[itemKey]=tmplItem}if(cloneIndex)cloneTmplItem(key)}el.removeAttribute(tmplItmAtt)}else if(cloneIndex&&(tmplItem=jQuery.data(el,"tmplItem"))){cloneTmplItem(tmplItem.key);newTmplItems[tmplItem.key]=tmplItem;pntNode=
19248jQuery.data(el.parentNode,"tmplItem");pntNode=pntNode?pntNode.key:0}if(tmplItem){pntItem=tmplItem;while(pntItem&&pntItem.key!=pntNode){pntItem.nodes.push(el);pntItem=pntItem.parent}delete tmplItem._ctnt;delete tmplItem._wrap;jQuery.data(el,"tmplItem",tmplItem)}function cloneTmplItem(key){key=key+keySuffix;tmplItem=newClonedItems[key]=newClonedItems[key]||newTmplItem(tmplItem,newTmplItems[tmplItem.parent.key+keySuffix]||tmplItem.parent,null,true)}}}function tiCalls(content,tmpl,data,options){if(!content)return stack.pop();
19249stack.push({_:content,tmpl:tmpl,item:this,data:data,options:options})}function tiNest(tmpl,data,options){return jQuery.tmpl(jQuery.template(tmpl),data,options,this)}function tiWrap(call,wrapped){var options=call.options||{};options.wrapped=wrapped;return jQuery.tmpl(jQuery.template(call.tmpl),call.data,options,call.item)}function tiHtml(filter,textOnly){var wrapped=this._wrap;return jQuery.map(jQuery(jQuery.isArray(wrapped)?wrapped.join(""):wrapped).filter(filter||"*"),function(e){return textOnly?
19250e.innerText||e.textContent:e.outerHTML||outerHtml(e)}
19250)}function tiUpdate(){var coll=this.nodes;jQuery.tmpl(null,null,null,this).insertBefore(coll[0]);jQuery(coll).remove()}})(jQuery)})(window.$CQ||window.$||function(){throw new Error("jQuery is not defined");}(),window.$CQ||window.$);
19251$(document).ready(function () {  
19252    $('.cmp-form, .page-content form').hide();
19253    $("#loadingMessageElement").remove();
19254    $( ".cmp-form" ).each(function( index ) {
19255       $(".cmp-form .form_row.show-hide").each(function(){
19256           var doShowHide = $(this).attr("data-doshowhide");
19257           if(doShowHide == "true"){
19258              var action = $(this).find('input[name="rule"]').attr("data-action");
19259               var logicCondition = $(this).find('input[name="rule"]').attr("data-compositecondition");
19260               var targetField = $(this).find('input[name="rule"]').attr("data-targetfield");
19261               initialshowhide(action,targetField);
19262				 let conditionList = [];
19263               $(this).find('input[name^="condition-"]').each(function(){
19264                   var conditionfieldName = $(this).attr("data-conditionfield");
19265                   var condition = $(this).attr("data-condition");
19266                   var conditionValue = $(this).attr("data-conditionvalue");
19267                   let conditionObject = new Object();
19268					conditionObject.fieldName = conditionfieldName;
19269					conditionObject.condition = condition;
19270					conditionObject.conditionValue = conditionValue;
19271					conditionObject.check = false;
19272                    conditionList.push(conditionObject); 
19273                    skipMandatoryHiddenFields(targetField);
19274
19275                   $( '*[name="'+conditionfieldName+'"]:not(:radio):not(:checkbox):not(select):not(select.multiselect option)' ).focusout(function() {
19276                        var value = ($(this).parent().parent().css('display') == 'none')? '':$( this ).val();
19277                        var rule = "";
19278                        if(value !==null){
19279                            for(let i=0;i<=conditionList.length-1;i++){
19280                                if(conditionList[i].fieldName == conditionfieldName){
19281                                        rule = switchBlock(conditionList[i].condition, value, conditionList[i].conditionValue);
19282                                        conditionList[i].check = rule;
19283                                }
19284                            }
19285                            showhide(conditionList,action,logicCondition,targetField);
19286                        }      
19287                        skipMandatoryHiddenFields(targetField);
19288                    });                     
19289                    
19290                    // on change event :: radio
19291                    $( 'input[type="radio"][name="'+conditionfieldName+'"]' ).on("change", function(e) {
19292                        if($(this).prop("checked")){                             
19293                            var value = ($(this).parent().parent().css('display') == 'none')? '':$( this ).val();
19294                            var rule = "";
19295                            
19296                            if(value !==null){
19297                                for(let i=0;i<=conditionList.length-1;i++){
19298                                    if(conditionList[i].fieldName == conditionfieldName){
19299                                            rule = switchBlock(conditionList[i].condition, value, conditionList[i].conditionValue);
19300                                            conditionList[i].check = rule;
19301                                    }
19302                                }
19303                                showhide(conditionList,action,logicCondition,targetField);
19304                            }
19305                        }
19306                       skipMandatoryHiddenFields(targetField);
19307                    });
19308
19309                    // on change event :: select
19310                    $( 'select[name="'+conditionfieldName+'"]' ).on("change", function(e) {                       
19311                        // 1. changed 'prop' to 'attr' for the select dropdown to render the field on select of the value instead of click outside.
19312                        if(!($(this).hasClass('multiselect'))){
19313                        var value = '';
19314                        if($(this).attr("selected", "selected")){                             
19315                            value = ($(this).parent().parent().css('display') == 'none')? '':$( this ).val();
19316                             var rule = "";                             
19317                             if(value !==null){
19318                                 for(let i=0;i<=conditionList.length-1;i++){
19319                                     if(conditionList[i].fieldName == conditionfieldName){
19320                                             rule = switchBlock(conditionList[i].condition, value, conditionList[i].conditionValue);
19321                                             conditionList[i].check = rule;
19322                                     }
19323                                 }
19324                                 showhide(conditionList,action,logicCondition,targetField);
19325                             }
19326                         }
19327                         }else{
19328                         	var value =[];
19329                         	var rule = "";
19330                         	if($(this).parent().parent().css('display') == 'none'){
19331                         		value = [];
19332                         	}
19333                         	else{
19334                         			value = $(this).val();
19335                         	}
19336                         	if(value !==null){
19337                         		for(let i=0;i<=conditionList.length-1;i++){
19338                         			if(conditionList[i].fieldName == conditionfieldName){
19339                         				rule = value.includes(conditionList[i].conditionValue);
19340                         				conditionList[i].check = rule;
19341                         			}
19342                         		}
19343                         		showhide(conditionList,action,logicCondition,targetField);
19344                            }
19345                         }
19346                        skipMandatoryHiddenFields(targetField);
19347                     });
19348
19349                    //on change event :: checkbox
19350                    $( 'input[type="checkbox"][name="'+conditionfieldName+'"]' ).on("change", function(e) {
19351                        var value = [];
19352                        var rule = "";
19353                        if($(this).parent().parent().css('display') == 'none'){         
19354                            value = [];                          
19355                         }
19356                         else{
19357                            $('input[type="checkbox"][name="'+conditionfieldName+'"]:checkbox:checked').each(function(i){                            
19358                                value[i] = $(this).val();
19359                            });
19360                         }  
19361                        
19362                        if(value !==null){
19363                            for(let i=0;i<=conditionList.length-1;i++){
19364                                if(conditionList[i].fieldName == conditionfieldName){
19365                                    rule = value.includes(conditionList[i].conditionValue);
19366                                    conditionList[i].check = rule;
19367                                }
19368                            }
19369                            showhide(conditionList,action,logicCondition,targetField);
19370                        }
19371                       skipMandatoryHiddenFields(targetField);
19372                    });                   
19373
19374                    //start of on page loads show the associated fields -------------------------------------------//
19375                    //radio : show/hide the fields
19376                    $( 'input[type="radio"][name="'+conditionfieldName+'"]' ).each( function(e) {                                              
19377                        var value = '';
19378                        if($(this).prop("checked")){
19379                            value = ($(this).parent().parent().css('display') == 'none')? '':$( this ).val();
19380                            var rule = "";                            
19381                            if(value !==null){
19382                                for(let i=0;i<=conditionList.length-1;i++){
19383                                    if(conditionList[i].fieldName == conditionfieldName){
19384                                            rule = switchBlock(conditionList[i].condition, value, conditionList[i].conditionValue);
19385                                            conditionList[i].check = rule;
19386                                    }
19387                                }
19388                                showhide(conditionList,action,logicCondition,targetField);
19389                            }
19390
19391                        }
19392                        skipMandatoryHiddenFields(targetField);
19393                    });
19394                    
19395                    //dropdown
19396                    $( 'select[name="'+conditionfieldName+'"]' ).each( function(e) {
19397                    if(!($(this).hasClass('multiselect'))){
19398                        if($(this).attr("selected", "selected")){
19399                            var value = ($(this).parent().parent().css('display') == 'none')? '':$( this ).val();
19400                            var rule = "";
19401                            if(value == conditionValue){
19402                                for(let i=0;i<=conditionList.length-1;i++){
19403                                    if(conditionList[i].fieldName == conditionfieldName){
19404                                            rule = switchBlock(conditionList[i].condition, value, conditionList[i].conditionValue);
19405                                            conditionList[i].check = rule;
19406                                    }
19407                                }
19408                                showhide(conditionList,action,logicCondition,targetField);
19409                            }
19410                        }
19411                        }else{
19412                        	var value =[];
19413                        	var rule = "";
19414                        	if($(this).parent().parent().css('display') == 'none'){
19415                        		value = [];
19416                        	}
19417                        	else{
19418                        			value = $(this).val();
19419                        	}
19420                        	if(value !==null){
19421                        		for(let i=0;i<=conditionList.length-1;i++){
19422                        			if(conditionList[i].fieldName == conditionfieldName){
19423                        				rule = value.includes(conditionList[i].conditionValue);
19424                        				conditionList[i].check = rule;
19425                        			}
19426                        		}
19427                        		showhide(conditionList,action,logicCondition,targetField);
19428                        	}
19429                        }
19430                       skipMandatoryHiddenFields(targetField);
19431                    });
19432                    //end of on page loads show the associated fields -------------------------------------------//
19433               });
19434
19435           }
19436       });
19437   });
19438
19439   function showhide(conditionListGroup,action,logicCondition,targetField, conditionfieldName){
19440       var answer = conditionListGroup[0].check;
19441       if(logicCondition =="all"){
19442            for(let i=0;i<conditionListGroup.length;i++){
19443                answer = (answer&conditionListGroup[i].check);
19444            }
19445       }else{
19446        for(let i=0;i<conditionListGroup.length;i++){
19447            answer = (answer | conditionListGroup[i].check);
19448        }
19449       }
19450       if(answer == true){
19451           if(action == "show"){
19452               $( '*[name="'+targetField+'"]' ).parent().parent().show();
19453               if($('*[name="'+targetField+'"]').prop("checked") || $('*[name="'+targetField+'"]').attr("selected") || $('*[name="'+targetField+'"]').attr("multiple")){
19454                    $( '*[name="'+targetField+'"]' ).trigger("change");
19455                }
19456                $( '*[name="'+targetField+'"]' ).trigger("focusout");
19457           }else{
19458               $( '*[name="'+targetField+'"]' ).parent().parent().hide();
19459               if($('*[name="'+targetField+'"]').prop("checked") || $('*[name="'+targetField+'"]').attr("selected") || $('*[name="'+targetField+'"]').attr("multiple")){
19460                 $( '*[name="'+targetField+'"]' ).trigger("change");               	  
19461                }
19462                $( '*[name="'+targetField+'"]' ).trigger("focusout");
19463           }
19464       }else{
19465           if(action == "show"){
19466               $( '*[name="'+targetField+'"]' ).parent().parent().hide();
19467               if($('*[name="'+targetField+'"]').prop("checked") || $('*[name="'+targetField+'"]').attr("selected") || $('*[name="'+targetField+'"]').attr("multiple")){
19468                   $( '*[name="'+targetField+'"]' ).trigger("change");               	  
19469               }
19470               $( '*[name="'+targetField+'"]' ).trigger("focusout");
19471           }else{
19472               $( '*[name="'+targetField+'"]' ).parent().parent().show();
19473               if($('*[name="'+targetField+'"]').prop("checked") || $('*[name="'+targetField+'"]').attr("selected") || $('*[name="'+targetField+'"]').attr("multiple")){
19474                   $( '*[name="'+targetField+'"]' ).trigger("change");
19475               	   
19476               }
19477               $( '*[name="'+targetField+'"]' ).trigger("focusout");
19478           }
19479       }
19480
19481   }
19482   function initialshowhide(action,targetField){
19483       if(action == "show"){
19484           $( '*[name="'+targetField+'"]' ).parent().parent().hide();
19485       }else{
19486           $( '*[name="'+targetField+'"]' ).parent().parent().show();
19487       }
19488   }
19489
19490   function switchBlock(condition, value, conditionValue){
19491       let rule = false;
19492       switch (condition) {
19493           case "isEqualTo":
19494               rule = (value == conditionValue)?true:false;
19495               break;
19496           case "isNotEqualTo":
19497               rule = (value!=conditionValue)?true:false;
19498               break;
19499           case "isLessThan":
19500               rule = (value<conditionValue)?true:false;
19501               break;
19502           case "isLessThanOrEqual":
19503               rule = (value<=conditionValue)?true:false;
19504               break;
19505           case "isGreaterThan":
19506               rule = (value>conditionValue)?true:false;
19507               break;
19508           case "isGreaterThanOrEqual":
19509               rule = (value>=conditionValue)?true:false;
19510               break;
19511           case "startsWith":
19512               rule = (value.startsWith(conditionValue))?true:false;
19513               break;
19514           case "endsWith":
19515               rule = test(value, conditionValue, 'endsWith');
19516               break;
19517           case "contains":
19518               rule = test(value, conditionValue, 'contains');
19519               break;
19520       }
19521       return rule;
19522   }
19523   let test = (value, conditionValue, caseName) => {
19524       if(caseName === 'endsWith'){
19525           return value.endsWith(conditionValue);
19526       }else{
19527           return value.includes(conditionValue);
19528       }
19529   }
19530});
19531
19532function skipMandatoryHiddenFields(targetField){  
19533    $( '*[name="'+targetField+'"]' ).each(function(){       
19534        if($(this).parent().parent().css('display') !== 'block'){
19535            $(this).prop('required', false);       
19536            $(this).parent().parent().removeClass('has-error');
19537            $(this).parent().parent().parent().removeClass('has-error');
19538            $(this).parent().parent().parent().parent().removeClass('has-error');
19539            $(this).parents().find('.validation-box').remove();            
19540        }else{
19541            $(this).prop('required', true);     
19542            $('input[name="'+targetField+'"][type="hidden"]').prop('required', false);  
19543            if($(this).parent().parent().find('.required-asterisk').text() !== '*'){
19544                $(this).prop('required', false);
19545            }
19546        }        
19547    });
19548
19549    $('input[name="'+targetField+'"][type="radio"]').each(function(){
19550        if($(this).parent().parent().css('display') == 'none'){
19551            $(this).prop('required', false);
19552            $(this).removeClass("required");
19553        }else{
19554            $(this).prop('required', true);
19555            $(this).addClass("required");
19556        }
19557    });
19558
19559    $('input[name="'+targetField+'"][type="checkbox"]').each(function(){
19560        if($(this).parent().parent().css('display') == 'none'){
19561            $(this).removeClass("required");
19562        }else{
19563            $(this).prop('required', false);
19564            // $(this).addClass("required");
19565            $(this).removeAttr('required');
19566
19567            if($(this).parent().parent().find('.required-asterisk').text() === '*'){
19568                $(this).addClass("required");
19569            }
19570        }
19571    });
19572
19573    $('select[name="'+targetField+'"]').each(function(){
19574        if($(this).attr("multiple")){
19575            if($(this).parent().css('display') !== 'block'){
19576                $(this).prop('required', false);
19577                $(this).removeClass("required"); 
19578            }else{
19579                $(this).prop('required', true);
19580            }
19581        } else{
19582            if($(this).parent().parent().css('display') !== 'block'){
19583                $(this).prop('required', false);
19584            }else{
19585                if($(this).parent().parent().find('.required-asterisk').text() !== '*'){
19586                    $(this).prop('required', false);
19587                } else {
19588                    $(this).prop('required', true);
19589                }
19590            }
19591        }       
19592    });
19593}
19594
19595var fetchForm = () => {
19596    let forms = $("form");
19597    let loadingMessaage = 'The form fields are loading, please wait.';
19598    let loadingMessageElement = `<p id='loadingMessageElement' style='font-size: 15px;padding: 10px 10px;'>`;
19599    loadingMessageElement += `<span class='fa fa-spinner fa-spin' style='margin-right:10px;'></span>`;
19600    loadingMessageElement += `<span aria-live='polite'>${loadingMessaage}</span></p>`;
19601
19602    $(forms).each(function(){
19603       $(this).attr("name") ? $(this).addClass("cmp-form") : '';      
19604    });
19605    $('.cmp-form', $(this).attr("name")).hide();
19606    $('.cmp-form:eq(0)').after(loadingMessageElement);
19607}
19608
19609var renderForm = () =>{
19610    $('.cmp-form, .page-content form').show();
19611    $(".cmp-form", $(this).attr("name")).show();
19612    $("#loadingMessageElement").hide();
19613}
19614
19615$(document).ready(function() {
19616    $("#loadingMessageElement").each(function(){
19617        $('[id="'+ this.id +'"]:gt(0)').remove();
19618    });
19619
19620    $('.cmp-form').each(function(){
19621        $(this).parent().addClass('form-container-width-fluid'); 
19622        $(this).parent().parent().addClass('form-container-width-fluid'); 
19623     });
19624});
19625
19626$(function(){
19627    fetchForm();
19628});
19629
19630$(window).load(function(){
19631    $("#loadingMessageElement").each(function(){
19632        $('[id="'+ this.id +'"]:gt(0)').remove();
19633    });
19634    renderForm();
19635})
19636$('document').ready(function () {
19637    applyExternalLinkIndicator();
19638
19639    $('a').on('click', function (event) {
19640        $anchor = $(this);
19641        if (cncleavingalert) {
19642            if (typeof showLeavingAlert == 'function') {
19643                event.preventDefault();
19644                showLeavingAlert($anchor);
19645            }
19646        } else if (adobeanalytics || googleanalytics) {
19647            //console.log("A or G");
19648            if (runAnalytics($anchor)) {
19649                if (typeof commonLinkClick == 'function') {
19650                    event.preventDefault();
19651                    commonLinkClick($anchor, googleanalytics, adobeanalytics);
19652                    return;
19653                }
19654            } else {
19655                return;
19656            }
19657        } else {
19658            return;
19659        }
19660    });
19661});
19662
19663function runAnalytics(obj) {
19664    var $href = obj.attr('href');
19665    var lc = $href.toLowerCase();
19666    if (lc.indexOf('.pdf') > -1 || lc.indexOf('.xls') > -1 || lc.indexOf('.zip') > -1 || lc.indexOf('.doc') > -1 || lc.indexOf('.docx') > -1 || lc.indexOf('.xps') > -1 || lc.indexOf('.pptx') > -1 || lc.indexOf('.xlsx') > -1 || lc.indexOf('.csv') > -1 || lc.indexOf('.txt') > -1 || lc.indexOf('.json') > -1 || lc.indexOf('tel:') > -1 || lc.indexOf('findadoc') > -1 || lc.indexOf('https://providersearch.') > -1 || lc.indexOf('find-a-provider.html') > -1 || obj.attr('data-event-action')) {
19667        return true;
19668    } else {
19669        return false;
19670    }
19671}
19672
19673function commonLinkClick(obj, googleAnalytics, adobeAnalytics) {
19674    //console.log("commonLinkClick");
19675    var $href = obj.attr('href');
19676    var lc = $href.toLowerCase();
19677    var $target = obj.attr('target') == "_blank" ? 0 : 1;
19678    if (adobeAnalytics) {
19679        if (lc.indexOf('.pdf') > -1 || lc.indexOf('.xls') > -1 || lc.indexOf('.zip') > -1 || lc.indexOf('.doc') > -1 || lc.indexOf('.docx') > -1 || lc.indexOf('.xps') > -1 || lc.indexOf('.pptx') > -1 || lc.indexOf('.xlsx') > -1 || lc.indexOf('.csv') > -1 || lc.indexOf('.txt') > -1 || lc.indexOf('.json') > -1) {
19680            if (typeof trackFile == 'function') {
19681                trackFile(obj);
19682            }
19683        }
19684        if (lc.indexOf('tel:') > -1) {
19685            if (typeof trackCall == 'function') {
19686                trackCall(obj);
19687            }
19688        }
19689        if (lc.indexOf('findadoc') > -1 || lc.indexOf('https://providersearch.') > -1 || lc.indexOf('find-a-provider.html') > -1) {
19690            if (typeof trackFAP == 'function') {
19691                trackFAP(obj);
19692            }
19693        }
19694        if (obj.attr('data-event-action')) {
19695            if (typeof trackWithDataAttr == 'function') {
19696                trackWithDataAttr(obj);
19697            }
19698        }
19699    }
19700    if (googleAnalytics && lc.indexOf('.pdf') > -1) {
19701        var fn = lc.lastIndexOf('/');
19702        var file = lc.substr(fn + 1);
19703        if (typeof ga == 'function') {
19704            ga('send', 'event', 'Download', 'PDF', file);
19705        }
19706    }
19707    $target == 1 ? setTimeout(function () { window.location.href = $href; }, 500) : window.open($href);
19708    return;
19709}
19710// removed external link  related content component :card
19711function applyExternalLinkIndicator() {
19712    const excludedClassNames = ['socialWrap', 'footer-socmed','quick-links-item', 'featured-image', 'image-link-tiles', 'control-wrapper', 'event', 'homepagecallout', 'nav-item', 'card'];
19713    const emailLink = "mailto:";
19714    const telLink = "tel:";
19715    let externalLinkText = "External Link";
19716
19717    let htmlLang = $("html").attr("lang");
19718
19719    if(htmlLang === 'es') {
19720        externalLinkText = "Sitio Externo"
19721    }
19722
19723    // Get protocol and domain
19724    let domain = window.location.protocol + '//' + window.location.host;
19725
19726    $(document.links).each(function (index) {
19727        let el = document.links[index];
19728        const href = el.href;
19729        //Skip javascript:void(0)
19730        if (href === "javascript:void(0)") {
19731            return;
19732        }
19733        // If href contains current domain, do NOT apply external link icon and title, if it does, apply external link icon, title, and rel
19734        if(!(document.links[index].href).includes(domain) && !((document.links[index].href).includes(emailLink) || (document.links[index].href).includes(telLink))) {
19735            (document.links[index]).setAttribute("rel", "noopener noreferrer");
19736
19737            let ambetterExternalLink = true;
19738            let domainCheck = location.hostname;
19739            if (domainCheck.includes('ambetterhealth.com')){
19740                let currentLink = document.links[index].href;
19741                if(isInternalAmbetter(currentLink)){
19742                    if(isExternalAmbetter(currentLink)){
19743                        ambetterExternalLink = true;
19744                    } else {
19745                        ambetterExternalLink = false;
19746                    }
19747                }
19748            }
19749
19750            // TODO: Excluding 'ambettersocial', 'socialintegration', 'quicklinks', 'imagewithtext', 'imagelinktiles', centene.com 'mainnavigation', centene.com 'pressreleases', 'homepagecallout', 'mobiletopnavigation' and 'relatedcontent' components should be TEMPORARY! 
19751            // Appearence should not come before A11Y, but we do not have business approval to add external link icons to mentioned components and new tab text to all external links that open in a new tab.
19752            if(!excludedClassNames.some(excludedClassName => el.parentElement.classList.contains(excludedClassName)) && ambetterExternalLink) {
19753                let iTag = document.createElement("i");
19754                iTag.setAttribute("class", "link-external fa fa-external-link");
19755                iTag.setAttribute("title", externalLinkText);
19756                iTag.setAttribute("aria-hidden", "true");
19757
19758                let spanTag = document.createElement("span");
19759                spanTag.setAttribute("class", "sr-only");
19760
19761                let screenReaderText = document.createTextNode(externalLinkText);
19762                spanTag.appendChild(screenReaderText);
19763
19764                document.links[index].appendChild(iTag);
19765                document.links[index].appendChild(spanTag);
19766            }
19767        }
19768    });
19769}
19770
19771function isExternalAmbetter(linkHref) {
19772    let isExternal = false;
19773    let externalList = 
19774    ['ambetter.payment', 
19775    'providersearch.ambetterhealth', 
19776    'enroll.ambetterhealth', 
19777    'guide.ambetterhealth.com', 
19778    'member.ambetterhealth.com',
19779    'provider.ambetterhealth.com',
19780    'broker.ambetterhealth.com'];
19781
19782    externalList.forEach((externalCompare) => {
19783        if (linkHref.includes(externalCompare)){
19784            isExternal = true;
19785        }
19786    });
19787    return isExternal;
19788}
19789
19790function isInternalAmbetter(linkHref) {
19791    let isInternal = false;
19792    let internalList = 
19793    ['ambetterhealth.com',
19794    'ambetterof',
19795    'ambetter.',
19796    'ambetter-es.',
19797    'ambettermeridian.com',
19798    'ambetterhealthofdelaware.com',
19799    'ambetterhealthofiowa.com',
19800    'ifp.healthnetcalifornia.com',
19801    'ifp-es.healthnetcalifornia.com'];
19802    
19803    internalList.forEach((internalCompare) => {
19804        if (linkHref.includes(internalCompare)){
19805            isInternal = true;
19806        }
19807    });
19808    return isInternal;
19809}
19810
19811$('document').ready(function () {
19812    $('img:not([alt])').attr('alt', '');
19813});
19814
19815/*!
19816 * Less - Leaner CSS v2.7.2
19817 * http://lesscss.org
19818 *
19819 * Copyright (c) 2009-2017, Alexis Sellier <[email protected]>
19820 * Licensed under the Apache-2.0 License.
19821 *
19822 */
19823
19824 /** * @license Apache-2.0
19825 */
19826
19827!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.less=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){var d=a("./utils").addDataAttr,e=a("./browser");b.exports=function(a,b){d(b,e.currentScript(a)),void 0===b.isFileProtocol&&(b.isFileProtocol=/^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(a.location.protocol)),b.async=b.async||!1,b.fileAsync=b.fileAsync||!1,b.poll=b.poll||(b.isFileProtocol?1e3:1500),b.env=b.env||("127.0.0.1"==a.location.hostname||"0.0.0.0"==a.location.hostname||"localhost"==a.location.hostname||a.location.port&&a.location.port.length>0||b.isFileProtocol?"development":"production");var c=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(a.location.hash);c&&(b.dumpLineNumbers=c[1]),void 0===b.useFileCache&&(b.useFileCache=!0),void 0===b.onReady&&(b.onReady=!0)}},{"./browser":3,"./utils":10}],2:[function(a,b,c){function d(a){a.filename&&console.warn(a),e.async||h.removeChild(i)}a("promise/polyfill.js");var e=window.less||{};a("./add-default-options")(window,e);var f=b.exports=a("./index")(window,e);window.less=f;var g,h,i;e.onReady&&(/!watch/.test(window.location.hash)&&f.watch(),e.async||(g="body { display: none !important }",h=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style"),i.type="text/css",i.styleSheet?i.styleSheet.cssText=g:i.appendChild(document.createTextNode(g)),h.appendChild(i)),f.registerStylesheetsImmediately(),f.pageLoadFinished=f.refresh("development"===f.env).then(d,d))},{"./add-default-options":1,"./index":8,"promise/polyfill.js":97}],3:[function(a,b,c){var d=a("./utils");b.exports={createCSS:function(a,b,c){var e=c.href||"",f="less:"+(c.title||d.extractId(e)),g=a.getElementById(f),h=!1,i=a.createElement("style");i.setAttribute("type","text/css"),c.media&&i.setAttribute("media",c.media),i.id=f,i.styleSheet||(i.appendChild(a.createTextNode(b)),h=null!==g&&g.childNodes.length>0&&i.childNodes.length>0&&g.firstChild.nodeValue===i.firstChild.nodeValue);var j=a.getElementsByTagName("head")[0];if(null===g||h===!1){var k=c&&c.nextSibling||null;k?k.parentNode.insertBefore(i,k):j.appendChild(i)}if(g&&h===!1&&g.parentNode.removeChild(g),i.styleSheet)try{i.styleSheet.cssText=b}catch(l){throw new Error("Couldn't reassign styleSheet.cssText.")}},currentScript:function(a){var b=a.document;return b.currentScript||function(){var a=b.getElementsByTagName("script");return a[a.length-1]}()}}},{"./utils":10}],4:[function(a,b,c){b.exports=function(a,b,c){var d=null;if("development"!==b.env)try{d="undefined"==typeof a.localStorage?null:a.localStorage}catch(e){}return{setCSS:function(a,b,e,f){if(d){c.info("saving "+a+" to cache.");try{d.setItem(a,f),d.setItem(a+":timestamp",b),e&&d.setItem(a+":vars",JSON.stringify(e))}catch(g){c.error('failed to save "'+a+'" to local storage for caching.')}}},getCSS:function(a,b,c){var e=d&&d.getItem(a),f=d&&d.getItem(a+":timestamp"),g=d&&d.getItem(a+":vars");if(c=c||{},f&&b.lastModified&&new Date(b.lastModified).valueOf()===new Date(f).valueOf()&&(!c&&!g||JSON.stringify(c)===g))return e}}}},{}],5:[function(a,b,c){var d=a("./utils"),e=a("./browser");b.exports=function(a,b,c){function f(b,f){var g,h,i="less-error-message:"+d.extractId(f||""),j='<li><label>{line}</label><pre class="{class}">{content}</pre></li>',k=a.document.createElement("div"),l=[],m=b.filename||f,n=m.match(/([^\/]+(\?.*)?)$/)[1];k.id=i,k.className="less-error-message",h="<h3>"+(b.type||"Syntax")+"Error: "+(b.message||"There is an error in your .less file")+'</h3><p>in <a href="'+m+'">'+n+"</a> ";var o=function(a,b,c){void 0!==a.extract[b]&&l.push(j.replace(/\{line\}
19827/,(parseInt(a.line,10)||0)+(b-1)).replace(/\{class\}/,c).replace(/\{content\}/,a.extract[b]))};b.extract&&(o(b,0,""),o(b,1,"line"),o(b,2,""),h+="on line "+b.line+", column "+(b.column+1)+":</p><ul>"+l.join("")+"</ul>"),b.stack&&(b.extract||c.logLevel>=4)&&(h+="<br/>Stack Trace</br />"+b.stack.split("\n").slice(1).join("<br/>")),k.innerHTML=h,e.createCSS(a.document,[".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #dd6666;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.line {","color: #ff0000;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),k.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e
1982700","padding: 15px","margin-bottom: 15px"].join(";"),"development"===c.env&&(g=setInterval(function(){var b=a.document,c=b.body;c&&(b.getElementById(i)?c.replaceChild(k,b.getElementById(i)):c.insertBefore(k,c.firstChild),clearInterval(g))},10))}function g(b){var c=a.document.getElementById("less-error-message:"+d.extractId(b));c&&c.parentNode.removeChild(c)}function h(a){}function i(a){c.errorReporting&&"html"!==c.errorReporting?"console"===c.errorReporting?h(a):"function"==typeof c.errorReporting&&c.errorReporting("remove",a):g(a)}function j(a,d){var e="{line} {content}",f=a.filename||d,g=[],h=(a.type||"Syntax")+"Error: "+(a.message||"There is an error in your .less file")+" in "+f+" ",i=function(a,b,c){void 0!==a.extract[b]&&g.push(e.replace(/\{line\}/,(parseInt(a.line,10)||0)+(b-1)).replace(/\{class\}/,c).replace(/\{content\}/,a.extract[b]))};a.extract&&(i(a,0,""),i(a,1,"line"),i(a,2,""),h+="on line "+a.line+", column "+(a.column+1)+":\n"+g.join("\n")),a.stack&&(a.extract||c.logLevel>=4)&&(h+="\nStack Trace\n"+a.stack),b.logger.error(h)}function k(a,b){c.errorReporting&&"html"!==c.errorReporting?"console"===c.errorReporting?j(a,b):"function"==typeof c.errorReporting&&c.errorReporting("add",a,b):f(a,b)}return{add:k,remove:i}}},{"./browser":3,"./utils":10}],6:[function(a,b,c){b.exports=function(b,c){function d(){if(window.XMLHttpRequest&&!("file:"===window.location.protocol&&"ActiveXObject"in window))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){return c.error("browser doesn't support AJAX."),null}}var e=a("../less/environment/abstract-file-manager.js"),f={},g=function(){};return g.prototype=new e,g.prototype.alwaysMakePathsAbsolute=function(){return!0},g.prototype.join=function(a,b){return a?this.extractUrlParts(b,a).path:b},g.prototype.doXHR=function(a,e,f,g){function h(b,c,d){b.status>=200&&b.status<300?c(b.responseText,b.getResponseHeader("Last-Modified")):"function"==typeof d&&d(b.status,a)}var i=d(),j=!b.isFileProtocol||b.fileAsync;"function"==typeof i.overrideMimeType&&i.overrideMimeType("text/css"),c.debug("XHR: Getting '"+a+"'"),i.open("GET",a,j),i.setRequestHeader("Accept",e||"text/x-less, text/css; q=0.9, */*; q=0.5"),i.send(null),b.isFileProtocol&&!b.fileAsync?0===i.status||i.status>=200&&i.status<300?f(i.responseText):g(i.status,a):j?i.onreadystatechange=function(){4==i.readyState&&h(i,f,g)}:h(i,f,g)},g.prototype.supports=function(a,b,c,d){return!0},g.prototype.clearFileCache=function(){f={}},g.prototype.loadFile=function(a,b,c,d,e){b&&!this.isPathAbsolute(a)&&(a=b+a),c=c||{};var g=this.extractUrlParts(a,window.location.href),h=g.url;if(c.useFileCache&&f[h])try{var i=f[h];e(null,{contents:i,filename:h,webInfo:{lastModified:new Date}})}catch(j){e({filename:h,message:"Error loading file "+h+" error was "+j.message})}else this.doXHR(h,c.mime,function(a,b){f[h]=a,e(null,{contents:a,filename:h,webInfo:{lastModified:b}})},function(a,b){e({type:"File",message:"'"+b+"' wasn't found ("+a+")",href:h})})},g}},{"../less/environment/abstract-file-manager.js":15}],7:[function(a,b,c){b.exports=function(){function b(){throw{type:"Runtime",message:"Image size functions are not supported in browser version of less"}}var c=a("./../less/functions/function-registry"),d={"image-size":function(a){return b(this,a),-1},"image-width":function(a){return b(this,a),-1},"image-height":function(a){return b(this,a),-1}};c.addMultiple(d)}},{"./../less/functions/function-registry":22}],8:[function(a,b,c){var d=a("./utils").addDataAttr,e=a("./browser");b.exports=function(b,c){function f(a){return c.postProcessor&&"function"==typeof c.postProcessor&&(a=c.postProcessor.call(a,a)||a),a}function g(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function h(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){var d=c.concat(Array.prototype.slice.call(arguments,0));return a.apply(b,d)}}function i(a){for(var b,d=m.getElementsByTagName("style"),e=0;e<d.length;e++)if(b=d[e],b.type.match(t)){var f=g(c);f.modifyVars=a;var i=b.innerHTML||"";f.filename=m.location.href.replace(/#.*$/,""),n.render(i,f,h(function(a,b,c){b?r.add(b,"inline"):(a.type="text/css",a.styleSheet?a.styleSheet.cssText=c.css:a.innerHTML=c.css)},null,b))}}function j(a,b,e,h,i){function j(c){var d=c.contents,g=c.filename,i=c.webInfo,j={currentDirectory:q.getPath(g),filename:g,rootFilename:g,relativeUrls:k.relativeUrls};if(j.entryPath=j.currentDirectory,j.rootpath=k.rootpath||j.currentDirectory,i){i.remaining=h;var l=s.getCSS(g,i,k.modifyVars);if(!e&&l)return i.local=!0,void b(null,l,d,a,i,g)}r.remove(g),k.rootFileInfo=j,n.render(d,k,function(c,e){c?(c.href=g,b(c)):(e.css=f(e.css),s.setCSS(a.href,i.lastModified,k.modifyVars,e.css),b(null,e.css,d,a,i,g))})}var k=g(c);d(k,a),k.mime=a.type,i&&(k.modifyVars=i),q.loadFile(a.href,null,k,o,function(a,c){return a?void b(a):void j(c)})}function k(a,b,c){for(var d=0;d<n.sheets.length;d++)j(n.sheets[d],a,b,n.sheets.length-(d+1),c)}function l(){"development"===n.env&&(n.watchTimer=setInterval(function(){n.watchMode&&(q.clearFileCache(),k(function(a,c,d,f,g){a?r.add(a,a.href||f.href):c&&e.createCSS(b.document,c,f)}))},c.poll))}var m=b.document,n=a("../less")();n.options=c;var o=n.environment,p=a("./file-manager")(c,n.logger),q=new p;o.addFileManager(q),n.FileManager=p,a("./log-listener")(n,c);var r=a("./error-reporting")(b,n,c),s=n.cache=c.cache||a("./cache")(b,c,n.logger);a("./image-size")(n.environment),c.functions&&n.functions.functionRegistry.addMultiple(c.functions);var t=/^text\/(x-)?less$/;return n.watch=function(){return n.watchMode||(n.env="development",l()),this.watchMode=!0,!0},n.unwatch=function(){return clearInterval(n.watchTimer),this.watchMode=!1,!1},n.registerStylesheetsImmediately=function(){var a=m.getElementsByTagName("link");n.sheets=[];for(var b=0;b<a.length;b++)("stylesheet/less"===a[b].rel||a[b].rel.match(/stylesheet/)&&a[b].type.match(t))&&n.sheets.push(a[b])},n.registerStylesheets=function(){return new Promise(function(a,b){n.registerStylesheetsImmediately(),a()})},n.modifyVars=function(a){return n.refresh(!0,a,!1)},n.refresh=function(a,c,d){return(a||d)&&d!==!1&&q.clearFileCache(),new Promise(function(d,f){var g,h,j,l;g=h=new Date,l=n.sheets.length,0===l?(h=new Date,j=h-g,n.logger.info("Less has finished and no sheets were loaded."),d({startTime:g,endTime:h,totalMilliseconds:j,sheets:n.sheets.length})):k(function(a,c,i,k,m){return a?(r.add(a,a.href||k.href),void f(a)):(n.logger.info(m.local?"Loading "+k.href+" from cache.":"Ren
19827dered "+k.href+" successfully."),e.createCSS(b.document,c,k),n.logger.info("CSS for "+k.href+" generated in "+(new Date-h)+"ms"),l--,0===l&&(j=new Date-g,n.logger.info("Less has finished. CSS generated in "+j+"ms"),d({startTime:g,endTime:h,totalMilliseconds:j,sheets:n.sheets.length})),void(h=new Date))},a,c),i(c)})},n.refreshStyles=i,n}},{"../less":31,"./browser":3,"./cache":4,"./error-reporting":5,"./file-manager":6,"./image-size":7,"./log-listener":9,"./utils":10}],9:[function(a,b,c){b.exports=function(a,b){var c=4,d=3,e=2,f=1;b.logLevel="undefined"!=typeof b.logLevel?b.logLevel:"development"===b.env?d:f,b.loggers||(b.loggers=[{debug:function(a){b.logLevel>=c&&console.log(a)},info:function(a){b.logLevel>=d&&console.log(a)},warn:function(a){b.logLevel>=e&&console.warn(a)},error:function(a){b.logLevel>=f&&console.error(a)}}]);for(var g=0;g<b.loggers.length;g++)a.logger.addListener(b.loggers[g])}},{}],10:[function(a,b,c){b.exports={extractId:function(a){return a.replace(/^[a-z-]+:\/+?[^\/]+/,"").replace(/[\?\&]livereload=\w+/,"").replace(/^\//,"").replace(/\.[a-zA-Z]+$/,"").replace(/[^\.\w-]+/g,"-").replace(/\./g,":")},addDataAttr:function(a,b){for(var c in b.dataset)if(b.dataset.hasOwnProperty(c))if("env"===c||"dumpLineNumbers"===c||"rootpath"===c||"errorReporting"===c)a[c]=b.dataset[c];else try{a[c]=JSON.parse(b.dataset[c])}catch(d){}}}},{}],11:[function(a,b,c){var d={};b.exports=d;var e=function(a,b,c){if(a)for(var d=0;d<c.length;d++)a.hasOwnProperty(c[d])&&(b[c[d]]=a[c[d]])},f=["paths","relativeUrls","rootpath","strictImports","insecure","dumpLineNumbers","compress","syncImport","chunkInput","mime","useFileCache","processImports","pluginManager"];d.Parse=function(a){e(a,this,f),"string"==typeof this.paths&&(this.paths=[this.paths])};var g=["paths","compress","ieCompat","strictMath","strictUnits","sourceMap","importMultiple","urlArgs","javascriptEnabled","pluginManager","importantScope"];d.Eval=function(a,b){e(a,this,g),"string"==typeof this.paths&&(this.paths=[this.paths]),this.frames=b||[],this.importantScope=this.importantScope||[]},d.Eval.prototype.inParenthesis=function(){this.parensStack||(this.parensStack=[]),this.parensStack.push(!0)},d.Eval.prototype.outOfParenthesis=function(){this.parensStack.pop()},d.Eval.prototype.isMathOn=function(){return!this.strictMath||this.parensStack&&this.parensStack.length},d.Eval.prototype.isPathRelative=function(a){return!/^(?:[a-z-]+:|\/|#)/i.test(a)},d.Eval.prototype.normalizePath=function(a){var b,c=a.split("/").reverse();for(a=[];0!==c.length;)switch(b=c.pop()){case".":break;case"..":0===a.length||".."===a[a.length-1]?a.push(b):a.pop();break;default:a.push(b)}return a.join("/")}},{}],12:[function(a,b,c){b.exports={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",s
19827almon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}},{}],13:[function(a,b,c){b.exports={colors:a("./colors"),unitConversions:a("./unit-conversions")}},{"./colors":12,"./unit-conversions":14}],14:[function(a,b,c){b.exports={length:{m:1,cm:.01,mm:.001,"in":.0254,px:.0254/96,pt:.0254/72,pc:.0254/72*12},duration:{s:1,ms:.001},angle:{rad:1/(2*Math.PI),deg:1/360,grad:.0025,turn:1}}},{}],15:[function(a,b,c){var d=function(){};d.prototype.getPath=function(a){var b=a.lastIndexOf("?");return b>0&&(a=a.slice(0,b)),b=a.lastIndexOf("/"),b<0&&(b=a.lastIndexOf("\\")),b<0?"":a.slice(0,b+1)},d.prototype.tryAppendExtension=function(a,b){return/(\.[a-z]*$)|([\?;].*)$/.test(a)?a:a+b},d.prototype.tryAppendLessExtension=function(a){return this.tryAppendExtension(a,".less")},d.prototype.supportsSync=function(){return!1},d.prototype.alwaysMakePathsAbsolute=function(){return!1},d.prototype.isPathAbsolute=function(a){return/^(?:[a-z-]+:|\/|\\|#)/i.test(a)},d.prototype.join=function(a,b){return a?a+b:b},d.prototype.pathDiff=function(a,b){var c,d,e,f,g=this.extractUrlParts(a),h=this.extractUrlParts(b),i="";if(g.hostPart!==h.hostPart)return"";for(d=Math.max(h.directories.length,g.directories.length),c=0;c<d&&h.directories[c]===g.directories[c];c++);for(f=h.directories.slice(c),e=g.directories.slice(c),c=0;c<f.length-1;c++)i+="../";for(c=0;c<e.length-1;c++)i+=e[c]+"/";return i},d.prototype.extractUrlParts=function(a,b){var c,d,e=/^((?:[a-z-]+:)?\/{2}(?:[^\/\?#]*\/)|([\/\\]))?((?:[^\/\\\?#]*[\/\\])*)([^\/\\\?#]*)([#\?].*)?$/i,f=a.match(e),g={},h=[];if(!f)throw new Error("Could not parse sheet href - '"+a+"'");if(b&&(!f[1]||f[2])){if(d=b.match(e),!d)throw new Error("Could not parse page url - '"+b+"'");f[1]=f[1]||d[1]||"",f[2]||(f[3]=d[3]+f[3])}if(f[3]){for(h=f[3].replace(/\\/g,"/").split("/"),c=0;c<h.length;c++)"."===h[c]&&(h.splice(c,1),c-=1);for(c=0;c<h.length;c++)".."===h[c]&&c>0&&(h.splice(c-1,2),c-=2)}return g.hostPart=f[1],g.directories=h,g.path=(f[1]||"")+h.join("/"),g.fileUrl=g.path+(f[4]||""),g.url=g.fileUrl+(f[5]||""),g},b.exports=d},{}],16:[function(a,b,c){var d=a("../logger"),e=function(a,b){this.fileManagers=b||[],a=a||{};for(var c=["encodeBase64","mimeLookup","charsetLookup","getSourceMapGenerator"],d=[],e=d.concat(c),f=0;f<e.length;f++){var g=e[f],h=a[g];h?this[g]=h.bind(a):f<d.length&&this.warn("missing required function in environment - "+g)}};e.prototype.getFileManager=function(a,b,c,e,f){a||d.warn("getFileManager called with no filename.. Please report this issue. continuing."),null==b&&d.warn("getFileManager called with null directory.. Please report this issue. continuing.");var g=this.fileManagers;c.pluginManager&&(g=[].concat(g).concat(c.pluginManager.getFileManagers()));for(var h=g.length-1;h>=0;h--){var i=g[h];if(i[f?"supportsSync":"supports"](a,b,c,e))return i}return null},e.prototype.addFileManager=function(a){this.fileManagers.push(a)},e.prototype.clearFileManagers=function(){this.fileManagers=[]},b.exports=e},{"../logger":33}],17:[function(a,b,c){function d(a,b,c){var d,f,g,h,i=b.alpha,j=c.alpha,k=[];g=j+i*(1-j);for(var l=0;l<3;l++)d=b.rgb[l]/255,f=c.rgb[l]/255,h=a(d,f),g&&(h=(j*f+i*(d-j*(d+f-h)))/g),k[l]=255*h;return new e(k,g)}var e=a("../tree/color"),f=a("./function-registry"),g={multiply:function(a,b){return a*b},screen:function(a,b){return a+b-a*b},overlay:function(a,b){return a*=2,a<=1?g.multiply(a,b):g.screen(a-1,b)},softlight:function(a,b){var c=1,d=a;return b>.5&&(d=1,c=a>.25?Math.sqrt(a):((16*a-12)*a+4)*a),a-(1-2*b)*d*(c-a)},hardlight:function(a,b){return g.overlay(b,a)},difference:function(a,b){return Math.abs(a-b)},exclusion:function(a,b){return a+b-2*a*b},average:function(a,b){return(a+b)/2},negation:function(a,b){return 1-Math.abs(a+b-1)}};for(var h in g)g.hasOwnProperty(h)&&(d[h]=d.bind(null,g[h]));f.addMultiple(d)},{"../tree/color":50,"./function-registry":22}],18:[function(a,b,c){function d(a){return Math.min(1,Math.max(0,a))}function e(a){return h.hsla(a.h,a.s,a.l,a.a)}function f(a){if(a instanceof i)return parseFloat(a.unit.is("%")?a.value/100:a.value);if("number"==typeof a)return a;throw{type:"Argument",message:"color functions take numbers as parameters"}}function g(a,b){return a instanceof i&&a.unit.is("%")?parseFloat(a.value*b/100):f(a)}var h,i=a("../tree/dimension"),j=a("../tree/color"),k=a("../tree/quoted"),l=a("../tree/anonymous"),m=a("./function-registry");
19827h={rgb:function(a,b,c){return h.rgba(a,b,c,1)},rgba:function(a,b,c,d){var e=[a,b,c].map(function(a){return g(a,255)});return d=f(d),new j(e,d)},hsl:function(a,b,c){return h.hsla(a,b,c,1)},hsla:function(a,b,c,e){function g(a){return a=a<0?a+1:a>1?a-1:a,6*a<1?i+(j-i)*a*6:2*a<1?j:3*a<2?i+(j-i)*(2/3-a)*6:i}var i,j;return a=f(a)%360/360,b=d(f(b)),c=d(f(c)),e=d(f(e)),j=c<=.5?c*(b+1):c+b-c*b,i=2*c-j,h.rgba(255*g(a+1/3),255*g(a),255*g(a-1/3),e)},hsv:function(a,b,c){return h.hsva(a,b,c,1)},hsva:function(a,b,c,d){a=f(a)%360/360*360,b=f(b),c=f(c),d=f(d);var e,g;e=Math.floor(a/60%6),g=a/60-e;var i=[c,c*(1-b),c*(1-g*b),c*(1-(1-g)*b)],j=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]];return h.rgba(255*i[j[e][0]],255*i[j[e][1]],255*i[j[e][2]],d)},hue:function(a){return new i(a.toHSL().h)},saturation:function(a){return new i(100*a.toHSL().s,"%")},lightness:function(a){return new i(100*a.toHSL().l,"%")},hsvhue:function(a){return new i(a.toHSV().h)},hsvsaturation:function(a){return new i(100*a.toHSV().s,"%")},hsvvalue:function(a){return new i(100*a.toHSV().v,"%")},red:function(a){return new i(a.rgb[0])},green:function(a){return new i(a.rgb[1])},blue:function(a){return new i(a.rgb[2])},alpha:function(a){return new i(a.toHSL().a)},luma:function(a){return new i(a.luma()*a.alpha*100,"%")},luminance:function(a){var b=.2126*a.rgb[0]/255+.7152*a.rgb[1]/255+.0722*a.rgb[2]/255;return new i(b*a.alpha*100,"%")},saturate:function(a,b,c){if(!a.rgb)return null;var f=a.toHSL();return f.s+="undefined"!=typeof c&&"relative"===c.value?f.s*b.value/100:b.value/100,f.s=d(f.s),e(f)},desaturate:function(a,b,c){var f=a.toHSL();return f.s-="undefined"!=typeof c&&"relative"===c.value?f.s*b.value/100:b.value/100,f.s=d(f.s),e(f)},lighten:function(a,b,c){var f=a.toHSL();return f.l+="undefined"!=typeof c&&"relative"===c.value?f.l*b.value/100:b.value/100,f.l=d(f.l),e(f)},darken:function(a,b,c){var f=a.toHSL();return f.l-="undefined"!=typeof c&&"relative"===c.value?f.l*b.value/100:b.value/100,f.l=d(f.l),e(f)},fadein:function(a,b,c){var f=a.toHSL();return f.a+="undefined"!=typeof c&&"relative"===c.value?f.a*b.value/100:b.value/100,f.a=d(f.a),e(f)},fadeout:function(a,b,c){var f=a.toHSL();return f.a-="undefined"!=typeof c&&"relative"===c.value?f.a*b.value/100:b.value/100,f.a=d(f.a),e(f)},fade:function(a,b){var c=a.toHSL();return c.a=b.value/100,c.a=d(c.a),e(c)},spin:function(a,b){var c=a.toHSL(),d=(c.h+b.value)%360;return c.h=d<0?360+d:d,e(c)},mix:function(a,b,c){a.toHSL&&b.toHSL||(console.log(b.type),console.dir(b)),c||(c=new i(50));var d=c.value/100,e=2*d-1,f=a.toHSL().a-b.toHSL().a,g=((e*f==-1?e:(e+f)/(1+e*f))+1)/2,h=1-g,k=[a.rgb[0]*g+b.rgb[0]*h,a.rgb[1]*g+b.rgb[1]*h,a.rgb[2]*g+b.rgb[2]*h],l=a.alpha*d+b.alpha*(1-d);return new j(k,l)},greyscale:function(a){return h.desaturate(a,new i(100))},contrast:function(a,b,c,d){if(!a.rgb)return null;if("undefined"==typeof c&&(c=h.rgba(255,255,255,1)),"undefined"==typeof b&&(b=h.rgba(0,0,0,1)),b.luma()>c.luma()){var e=c;c=b,b=e}return d="undefined"==typeof d?.43:f(d),a.luma()<d?c:b},argb:function(a){return new l(a.toARGB())},color:function(a){if(a instanceof k&&/^#([a-f0-9]{6}|[a-f0-9]{3})$/i.test(a.value))return new j(a.value.slice(1));if(a instanceof j||(a=j.fromKeyword(a.value)))return a.value=void 0,a;throw{type:"Argument",message:"argument must be a color keyword or 3/6 digit hex e.g. #FFF"}},tint:function(a,b){return h.mix(h.rgb(255,255,255),a,b)},shade:function(a,b){return h.mix(h.rgb(0,0,0),a,b)}},m.addMultiple(h)},{"../tree/anonymous":46,"../tree/color":50,"../tree/dimension":56,"../tree/quoted":73,"./function-registry":22}],19:[function(a,b,c){b.exports=function(b){var c=a("../tree/quoted"),d=a("../tree/url"),e=a("./function-registry"),f=function(a,b){return new d(b,a.index,a.currentFileInfo).eval(a.context)},g=a("../logger");e.add("data-uri",function(a,e){e||(e=a,a=null);var h=a&&a.value,i=e.value,j=this.currentFileInfo,k=j.relativeUrls?j.currentDirectory:j.entryPath,l=i.indexOf("#"),m="";l!==-1&&(m=i.slice(l),i=i.slice(0,l));var n=b.getFileManager(i,k,this.context,b,!0);if(!n)return f(this,e);var o=!1;if(a)o=/;base64$/.test(h);else{if(h=b.mimeLookup(i),"image/svg+xml"===h)o=!1;else{var p=b.charsetLookup(h);o=["US-ASCII","UTF-8"].indexOf(p)<0}
19827o&&(h+=";base64")}var q=n.loadFileSync(i,k,this.context,b);if(!q.contents)return g.warn("Skipped data-uri embedding of "+i+" because file not found"),f(this,e||a);var r=q.contents;if(o&&!b.encodeBase64)return f(this,e);r=o?b.encodeBase64(r):encodeURIComponent(r);var s="data:"+h+","+r+m,t=32768;return s.length>=t&&this.context.ieCompat!==!1?(g.warn("Skipped data-uri embedding of "+i+" because its size ("+s.length+" characters) exceeds IE8-safe "+t+" characters!"),f(this,e||a)):new d(new c('"'+s+'"',s,(!1),this.index,this.currentFileInfo),this.index,this.currentFileInfo)})}},{"../logger":33,"../tree/quoted":73,"../tree/url":80,"./function-registry":22}],20:[function(a,b,c){var d=a("../tree/keyword"),e=a("./function-registry"),f={eval:function(){var a=this.value_,b=this.error_;if(b)throw b;if(null!=a)return a?d.True:d.False},value:function(a){this.value_=a},error:function(a){this.error_=a},reset:function(){this.value_=this.error_=null}};e.add("default",f.eval.bind(f)),b.exports=f},{"../tree/keyword":65,"./function-registry":22}],21:[function(a,b,c){var d=a("../tree/expression"),e=function(a,b,c,d){this.name=a.toLowerCase(),this.index=c,this.context=b,this.currentFileInfo=d,this.func=b.frames[0].functionRegistry.get(this.name)};e.prototype.isValid=function(){return Boolean(this.func)},e.prototype.call=function(a){return Array.isArray(a)&&(a=a.filter(function(a){return"Comment"!==a.type}).map(function(a){if("Expression"===a.type){var b=a.value.filter(function(a){return"Comment"!==a.type});return 1===b.length?b[0]:new d(b)}return a})),this.func.apply(this,a)},b.exports=e},{"../tree/expression":59}],22:[function(a,b,c){function d(a){return{_data:{},add:function(a,b){a=a.toLowerCase(),this._data.hasOwnProperty(a),this._data[a]=b},addMultiple:function(a){Object.keys(a).forEach(function(b){this.add(b,a[b])}.bind(this))},get:function(b){return this._data[b]||a&&a.get(b)},inherit:function(){return d(this)}}}b.exports=d(null)},{}],23:[function(a,b,c){b.exports=function(b){var c={functionRegistry:a("./function-registry"),functionCaller:a("./function-caller")};return a("./default"),a("./color"),a("./color-blending"),a("./data-uri")(b),a("./math"),a("./number"),a("./string"),a("./svg")(b),a("./types"),c}},{"./color":18,"./color-blending":17,"./data-uri":19,"./default":20,"./function-caller":21,"./function-registry":22,"./math":25,"./number":26,"./string":27,"./svg":28,"./types":29}],24:[function(a,b,c){var d=a("../tree/dimension"),e=function(){};e._math=function(a,b,c){if(!(c instanceof d))throw{type:"Argument",message:"argument must be a number"};return null==b?b=c.unit:c=c.unify(),new d(a(parseFloat(c.value)),b)},b.exports=e},{"../tree/dimension":56}],25:[function(a,b,c){var d=a("./function-registry"),e=a("./math-helper.js"),f={ceil:null,floor:null,sqrt:null,abs:null,tan:"",sin:"",cos:"",atan:"rad",asin:"rad",acos:"rad"};for(var g in f)f.hasOwnProperty(g)&&(f[g]=e._math.bind(null,Math[g],f[g]));f.round=function(a,b){var c="undefined"==typeof b?0:b.value;return e._math(function(a){return a.toFixed(c)},null,a)},d.addMultiple(f)},{"./function-registry":22,"./math-helper.js":24}],26:[function(a,b,c){var d=a("../tree/dimension"),e=a("../tree/anonymous"),f=a("./function-registry"),g=a("./math-helper.js"),h=function(a,b){switch(b=Array.prototype.slice.call(b),b.length){case 0:throw{type:"Argument",message:"one or more arguments required"}}var c,f,g,h,i,j,k,l,m=[],n={};for(c=0;c<b.length;c++)if(g=b[c],g instanceof d)if(h=""===g.unit.toString()&&void 0!==l?new d(g.value,l).unify():g.unify(),j=""===h.unit.toString()&&void 0!==k?k:h.unit.toString(),k=""!==j&&void 0===k||""!==j&&""===m[0].unify().unit.toString()?j:k,l=""!==j&&void 0===l?g.unit.toString():l,f=void 0!==n[""]&&""!==j&&j===k?n[""]:n[j],void 0!==f)i=""===m[f].unit.toString()&&void 0!==l?new d(m[f].value,l).unify():m[f].unify(),(a&&h.value<i.value||!a&&h.value>i.value)&&(m[f]=g);else{if(void 0!==k&&j!==k)throw{type:"Argument",message:"incompatible types"};n[j]=m.length,m.push(g)}else Array.isArray(b[c].value)&&Array.prototype.push.apply(b,Array.prototype.slice.call(b[c].value));return 1==m.length?m[0]:(b=m.map(function(a){return a.toCSS(this.context)}).join(this.context.compress?",":", "),new e((a?"min":"max")+"("+b+")"))};f.addMultiple({min:function(){return h(!0,arguments)},max:function(){return h(!1,arguments)},convert:function(a,b){return a.convertTo(b.value)},pi:function(){return new d(Math.PI)},mod:function(a,b){return new d(a.value%b.value,a.unit)},pow:function(a,b){if("number"==typeof a&&"number"==typeof b)a=new d(a),b=new d(b);else if(!(a instanceof d&&b instanceof d))throw{type:"Argument",message:"arguments must be numbers"};return new d(Math.pow(a.value,b.value),a.unit)},percentage:function(a){var b=g._math(function(a){return 100*a},"%",a);return b}})},{"../tree/anonymous":46,"../tree/dimension":56,"./function-registry":22,"./math-helper.js":24}],27:[function(a,b,c){var d=a("../tree/quoted"),e=a("../tree/anonymous"),f=a("../tree/javascript"),g=a("./function-registry");g.addMultiple({e:function(a){return new e(a instanceof f?a.evaluated:a.value)},escape:function(a){return new e(encodeURI(a.value).replace(/=/g,"%3D").replace(/:/g,"%3A").replace(/#/g,"%23").replace(/;/g,"%3B").replace(/\(/g,"%28").replace(/\)/g,"%29"))},replace:function(a,b,c,e){var f=a.value;return c="Quoted"===c.type?c.value:c.toCSS(),f=f.replace(new RegExp(b.value,e?e.value:""),c),new d(a.quote||"",f,a.escaped)},"%":function(a){for(var b=Array.prototype.slice.call(arguments,1
19827),c=a.value,e=0;e<b.length;e++)c=c.replace(/%[sda]/i,function(a){var c="Quoted"===b[e].type&&a.match(/s/i)?b[e].value:b[e].toCSS();return a.match(/[A-Z]$/)?encodeURIComponent(c):c});return c=c.replace(/%%/g,"%"),new d(a.quote||"",c,a.escaped)}})},{"../tree/anonymous":46,"../tree/javascript":63,
19828"../tree/quoted":73,"./function-registry":22}],28:[function(a,b,c){b.exports=function(b){var c=a("../tree/dimension"),d=a("../tree/color"),e=a("../tree/expression"),f=a("../tree/quoted"),g=a("../tree/url"),h=a("./function-registry");h.add("svg-gradient",function(a){function b(){throw{type:"Argument",message:"svg-gradient expects direction, start_color [start_position], [color position,]..., end_color [end_position] or direction, color list"}}var h,i,j,k,l,m,n,o,p="linear",q='x="0" y="0" width="1" height="1"',r={compress:!1},s=a.toCSS(r);switch(2==arguments.length?(arguments[1].value.length<2&&b(),h=arguments[1].value):arguments.length<3?b():h=Array.prototype.slice.call(arguments,1),s){case"to bottom":i='x1="0%" y1="0%" x2="0%" y2="100%"';break;case"to right":i='x1="0%" y1="0%" x2="100%" y2="0%"';break;case"to bottom right":i='x1="0%" y1="0%" x2="100%" y2="100%"';break;case"to top right":i='x1="0%" y1="100%" x2="100%" y2="0%"';break;case"ellipse":case"ellipse at center":p="radial",i='cx="50%" cy="50%" r="75%"',q='x="-50" y="-50" width="101" height="101"';break;default:throw{type:"Argument",message:"svg-gradient direction must be 'to bottom', 'to right', 'to bottom right', 'to top right' or 'ellipse at center'"}}for(j='<?xml version="1.0" ?><svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none"><'+p+'Gradient id="gradient" gradientUnits="userSpaceOnUse" '+i+">",k=0;k<h.length;k+=1)h[k]instanceof e?(l=h[k].value[0],m=h[k].value[1]):(l=h[k],m=void 0),l instanceof d&&((0===k||k+1===h.length)&&void 0===m||m instanceof c)||b(),n=m?m.toCSS(r):0===k?"0%":"100%",o=l.alpha,j+='<stop offset="'+n+'" stop-color="'+l.toRGB()+'"'+(o<1?' stop-opacity="'+o+'"':"")+"/>";return j+="</"+p+"Gradient><rect "+q+' fill="url(#gradient)" /></svg>',j=encodeURIComponent(j),j="data:image/svg+xml,"+j,new g(new f("'"+j+"'",j,(!1),this.index,this.currentFileInfo),this.index,this.currentFileInfo)})}},{"../tree/color":50,"../tree/dimension":56,"../tree/expression":59,"../tree/quoted":73,"../tree/url":80,"./function-registry":22}],29:[function(a,b,c){var d=a("../tree/keyword"),e=a("../tree/detached-ruleset"),f=a("../tree/dimension"),g=a("../tree/color"),h=a("../tree/quoted"),i=a("../tree/anonymous"),j=a("../tree/url"),k=a("../tree/operation"),l=a("./function-registry"),m=function(a,b){return a instanceof b?d.True:d.False},n=function(a,b){if(void 0===b)throw{type:"Argument",message:"missing the required second argument to isunit."};if(b="string"==typeof b.value?b.value:b,"string"!=typeof b)throw{type:"Argument",message:"Second argument to isunit should be a unit or a string."};return a instanceof f&&a.unit.is(b)?d.True:d.False},o=function(a){var b=Array.isArray(a.value)?a.value:Array(a);return b};l.addMultiple({isruleset:function(a){return m(a,e)},iscolor:function(a){return m(a,g)},isnumber:function(a){return m(a,f)},isstring:function(a){return m(a,h)},iskeyword:function(a){return m(a,d)},isurl:function(a){return m(a,j)},ispixel:function(a){return n(a,"px")},ispercentage:function(a){return n(a,"%")},isem:function(a){return n(a,"em")},isunit:n,unit:function(a,b){if(!(a instanceof f))throw{type:"Argument",message:"the first argument to unit must be a number"+(a instanceof k?". Have you forgotten parenthesis?":"")};return b=b?b instanceof d?b.value:b.toCSS():"",new f(a.value,b)},"get-unit":function(a){return new i(a.unit)},extract:function(a,b){return b=b.value-1,o(a)[b]},length:function(a){return new f(o(a).length)}})},{"../tree/anonymous":46,"../tree/color":50,"../tree/detached-ruleset":55,"../tree/dimension":56,"../tree/keyword":65,"../tree/operation":71,"../tree/quoted":73,"../tree/url":80,"./function-registry":22}],30:[function(a,b,c){var d=a("./contexts"),e=a("./parser/parser"),f=a("./plugins/function-importer");b.exports=function(a){var b=function(a,b){this.rootFilename=b.filename,this.paths=a.paths||[],this.contents={},this.contentsIgnoredChars={},this.mime=a.mime,this.error=null,this.context=a,this.queue=[],this.files={}};return b.prototype.push=function(b,c,g,h,i){var j=this;this.queue.push(b);var k=function(a,c,d){j.queue.splice(j.queue.indexOf(b),1);var e=d===j.rootFilename;h.optional&&a?i(null,{rules:[]},!1,null):(j.files[d]=c,a&&!j.error&&(j.error=a),i(a,c,e,d))},l={relativeUrls:this.context.relativeUrls,entryPath:g.entryPath,rootpath:g.rootpath,rootFilename:g.rootFilename},m=a.getFileManager(b,g.currentDirectory,this.context,a);if(!m)return void k({message:"Could not find a file-manager for "+b});c&&(b=m.tryAppendExtension(b,h.plugin?".js":".less"));var n=function(a){var b=a.filename,c=a.contents.replace(/^\uFEFF/,"");l.currentDirectory=m.getPath(b),l.relativeUrls&&(l.rootpath=m.join(j.context.rootpath||"",m.pathDiff(l.currentDirectory,l.entryPath)),!m.isPathAbsolute(l.rootpath)&&m.alwaysMakePathsAbsolute()&&(l.rootpath=m.join(l.entryPath,l.rootpath))),l.filename=b;var i=new d.Parse(j.context);i.processImports=!1,j.contents[b]=c,(g.reference||h.reference)&&(l.reference=!0),h.plugin?new f(i,l).eval(c,function(a,c){k(a,c,b)}):h.inline?k(null,c,b):new e(i,j,l).parse(c,function(a,c){k(a,c,b)})},o=m.loadFile(b,g.currentDirectory,this.context,a,function(a,b){a?k(a):n(b)});o&&o.then(n,k)},b}},{"./contexts":11,"./parser/parser":38,"./plugins/function-importer":40}],31:[function(a,b,c){b.exports=function(b,c){var d,e,f,g,h,i={version:[2,7,2],data:a("./data"),tree:a("./tree"),Environment:h=a("./environment/environment"),AbstractFileManager:a("./environment/abstract-file-manager"),environment:b=new h(b,c),visitors:a("./visitors"),Parser:a("./parser/parser"),functions:a("./functions")(b),contexts:a("./contexts"),SourceMapOutput:d=a("./source-map-output")(b),SourceMapBuilder:e=a("./source-map-builder")(d,b),ParseTree:f=a("./parse-tree")(e),ImportManager:g=a("./import-manager")(b),render:a("./render")(b,f,g),parse:a("./parse")(b,f,g),LessError:a("./less-error"),transformTree:a("./transform-tree"),utils:a("./utils"),PluginManager:a("./plugin-manager"),logger:a("./logger")};return i}},{"./contexts":11,"./data":13,"./environment/abstract-file-manager"
19828:15,"./environment/environment":16,"./functions":23,"./import-manager":30,"./less-error":32,"./logger":33,"./parse":35,"./parse-tree":34,"./parser/parser":38,"./plugin-manager":39,"./render":41,"./source-map-builder":42,"./source-map-output":43,"./transform-tree":44,"./tree":62,"./utils":83,"./visitors":87}],32:[function(a,b,c){var d=a("./utils"),e=b.exports=function(a,b,c){Error.call(this);var e=a.filename||c;if(b&&e){var f=b.contents[e],g=d.getLocation(a.index,f),h=g.line,i=g.column,j=a.call&&d.getLocation(a.call,f).line,k=f.split("\n");this.type=a.type||"Syntax",this.filename=e,this.index=a.index,this.line="number"==typeof h?h+1:null,this.callLine=j+1,this.callExtract=k[j],this.column=i,this.extract=[k[h-1],k[h],k[h+1]]}this.message=a.message,this.stack=a.stack};if("undefined"==typeof Object.create){var f=function(){};f.prototype=Error.prototype,e.prototype=new f}else e.prototype=Object.create(Error.prototype);e.prototype.constructor=e},{"./utils":83}],33:[function(a,b,c){b.exports={error:function(a){this._fireEvent("error",a)},warn:function(a){this._fireEvent("warn",a)},info:function(a){this._fireEvent("info",a)},debug:function(a){this._fireEvent("debug",a)},addListener:function(a){this._listeners.push(a)},removeListener:function(a){for(var b=0;b<this._listeners.length;b++)if(this._listeners[b]===a)return void this._listeners.splice(b,1)},_fireEvent:function(a,b){for(var c=0;c<this._listeners.length;c++){var d=this._listeners[c][a];d&&d(b)}},_listeners:[]}},{}],34:[function(a,b,c){var d=a("./less-error"),e=a("./transform-tree"),f=a("./logger");b.exports=function(a){var b=function(a,b){this.root=a,this.imports=b};return b.prototype.toCSS=function(b){var c,g,h={};try{c=e(this.root,b)}catch(i){throw new d(i,this.imports)}try{var j=Boolean(b.compress);j&&f.warn("The compress option has been deprecated. We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.");var k={compress:j,dumpLineNumbers:b.dumpLineNumbers,strictUnits:Boolean(b.strictUnits),numPrecision:8};b.sourceMap?(g=new a(b.sourceMap),h.css=g.toCSS(c,k,this.imports)):h.css=c.toCSS(k)}catch(i){throw new d(i,this.imports)}if(b.pluginManager)for(var l=b.pluginManager.getPostProcessors(),m=0;m<l.length;m++)h.css=l[m].process(h.css,{sourceMap:g,options:b,imports:this.imports});b.sourceMap&&(h.map=g.getExternalSourceMap()),h.imports=[];for(var n in this.imports.files)this.imports.files.hasOwnProperty(n)&&n!==this.imports.rootFilename&&h.imports.push(n);return h},b}},{"./less-error":32,"./logger":33,"./transform-tree":44}],35:[function(a,b,c){var d,e=a("./contexts"),f=a("./parser/parser"),g=a("./plugin-manager");b.exports=function(b,c,h){var i=function(b,c,j){if(c=c||{},"function"==typeof c&&(j=c,c={}),!j){d||(d="undefined"==typeof Promise?a("promise"):Promise);var k=this;return new d(function(a,d){i.call(k,b,c,function(b,c){b?d(b):a(c)})})}var l,m,n=new g(this);if(n.addPlugins(c.plugins),c.pluginManager=n,l=new e.Parse(c),c.rootFileInfo)m=c.rootFileInfo;else{var o=c.filename||"input",p=o.replace(/[^\/\\]*$/,"");m={filename:o,relativeUrls:l.relativeUrls,rootpath:l.rootpath||"",currentDirectory:p,entryPath:p,rootFilename:o},m.rootpath&&"/"!==m.rootpath.slice(-1)&&(m.rootpath+="/")}var q=new h(l,m);new f(l,q,m).parse(b,function(a,b){return a?j(a):void j(null,b,q,c)},c)};return i}},{"./contexts":11,"./parser/parser":38,"./plugin-manager":39,promise:void 0}],36:[function(a,b,c){b.exports=function(a,b){function c(b){var c=h-q;c<512&&!b||!c||(p.push(a.slice(q,h+1)),q=h+1)}var d,e,f,g,h,i,j,k,l,m=a.length,n=0,o=0,p=[],q=0;for(h=0;h<m;h++)if(j=a.charCodeAt(h),!(j>=97&&j<=122||j<34))switch(j){case 40:o++,e=h;continue;case 41:if(--o<0)return b("missing opening `(`",h);continue;case 59:o||c();continue;case 123:n++,d=h;continue;case 125:if(--n<0)return b("missing opening `{`",h);n||o||c();continue;case 92:if(h<m-1){h++;continue}return b("unescaped `\\`",h);case 34:case 39:case 96:for(l=0,i=h,h+=1;h<m;h++)if(k=a.charCodeAt(h),!(k>96)){if(k==j){l=1;break}if(92==k){if(h==m-1)return b("unescaped `\\`",h);h++}}if(l)continue;return b("unmatched `"+String.fromCharCode(j)+"`",i);case 47:if(o||h==m-1)continue;
19828if(k=a.charCodeAt(h+1),47==k)for(h+=2;h<m&&(k=a.charCodeAt(h),!(k<=13)||10!=k&&13!=k);h++);else if(42==k){for(f=i=h,h+=2;h<m-1&&(k=a.charCodeAt(h),125==k&&(g=h),42!=k||47!=a.charCodeAt(h+1));h++);if(h==m-1)return b("missing closing `*/`",i);h++}continue;case 42:if(h<m-1&&47==a.charCodeAt(h+1))return b("unmatched `/*`",h);continue}return 0!==n?f>d&&g>f?b("missing closing `}` or `*/`",d):b("missing closing `}`",d):0!==o?b("missing closing `)`",e):(c(!0),p)}},{}],37:[function(a,b,c){var d=a("./chunker");b.exports=function(){function a(d){for(var e,f,j,p=k.i,q=c,s=k.i-i,t=k.i+h.length-s,u=k.i+=d,v=b;k.i<t;k.i++){if(e=v.charCodeAt(k.i),k.autoCommentAbsorb&&e===r){if(f=v.charAt(k.i+1),"/"===f){j={index:k.i,isLineComment:!0};var w=v.indexOf("\n",k.i+2);w<0&&(w=t),k.i=w,j.text=v.substr(j.index,k.i-j.index),k.commentStore.push(j);continue}if("*"===f){var x=v.indexOf("*/",k.i+2);if(x>=0){j={index:k.i,text:v.substr(k.i,x+2-k.i),isLineComment:!1},k.i+=j.text.length-1,k.commentStore.push(j);continue}}break}if(e!==l&&e!==n&&e!==m&&e!==o)break}if(h=h.slice(d+k.i-u+s),i=k.i,!h.length){if(c<g.length-1)return h=g[++c],a(0),!0;k.finished=!0}return p!==k.i||q!==c}var b,c,e,f,g,h,i,j=[],k={},l=32,m=9,n=10,o=13,p=43,q=44,r=47,s=57;return k.save=function(){i=k.i,j.push({current:h,i:k.i,j:c})},k.restore=function(a){(k.i>e||k.i===e&&a&&!f)&&(e=k.i,f=a);var b=j.pop();h=b.current,i=k.i=b.i,c=b.j},k.forget=function(){j.pop()},k.isWhitespace=function(a){var c=k.i+(a||0),d=b.charCodeAt(c);return d===l||d===o||d===m||d===n},k.$re=function(b){k.i>i&&(h=h.slice(k.i-i),i=k.i);var c=b.exec(h);return c?(a(c[0].length),"string"==typeof c?c:1===c.length?c[0]:c):null},k.$char=function(c){return b.charAt(k.i)!==c?null:(a(1),c)},k.$str=function(c){for(var d=c.length,e=0;e<d;e++)if(b.charAt(k.i+e)!==c.charAt(e))return null;return a(d),c},k.$quoted=function(){var c=b.charAt(k.i);if("'"===c||'"'===c){for(var d=b.length,e=k.i,f=1;f+e<d;f++){var g=b.charAt(f+e);switch(g){case"\\":f++;continue;case"\r":case"\n":break;case c:var h=b.substr(e,f+1);return a(f+1),h}}return null}},k.autoCommentAbsorb=!0,k.commentStore=[],k.finished=!1,k.peek=function(a){if("string"==typeof a){for(var c=0;c<a.length;c++)if(b.charAt(k.i+c)!==a.charAt(c))return!1;return!0}return a.test(h)},k.peekChar=function(a){return b.charAt(k.i)===a},k.currentChar=function(){return b.charAt(k.i)},k.getInput=function(){return b},k.peekNotNumeric=function(){var a=b.charCodeAt(k.i);return a>s||a<p||a===r||a===q},k.start=function(f,j,l){b=f,k.i=c=i=e=0,g=j?d(f,l):[f],h=g[0],a(0)},k.end=function(){var a,c=k.i>=b.length;return k.i<e&&(a=f,k.i=e),{isFinished:c,furthest:k.i,furthestPossibleErrorMessage:a,furthestReachedEnd:k.i>=b.length-1,furthestChar:b[k.i]}},k}},{"./chunker":36}],38:[function(a,b,c){var d=a("../less-error"),e=a("../tree"),f=a("../visitors"),g=a("./parser-input"),h=a("../utils"),i=function j(a,b,c){function i(a,e){throw new d({index:o.i,filename:c.filename,type:e||"Syntax",message:a},b)}function k(a,b,c){var d=a instanceof Function?a.call(n):o.$re(a);return d?d:void i(b||("string"==typeof a?"expected '"+a+"' got '"+o.currentChar()+"'":"unexpected token"))}function l(a,b){return o.$char(a)?a:void i(b||"expected '"+a+"' got '"+o.currentChar()+"'")}function m(a){var b=c.filename;return{lineNumber:h.getLocation(a,o.getInput()).line+1,fileName:b}}var n,o=g();return{parse:function(g,h,i){var k,l,m,n,p=null,q="";if(l=i&&i.globalVars?j.serializeVars(i.globalVars)+"\n":"",m=i&&i.modifyVars?"\n"+j.serializeVars(i.modifyVars):"",a.pluginManager)for(var r=a.pluginManager.getPreProcessors(),s=0;s<r.length;s++)g=r[s].process(g,{context:a,imports:b,fileInfo:c});(l||i&&i.banner)&&(q=(i&&i.banner?i.banner:"")+l,n=b.contentsIgnoredChars,n[c.filename]=n[c.filename]||0,n[c.filename]+=q.length),g=g.replace(/\r\n?/g,"\n"),g=q+g.replace(/^\uFEFF/,"")+m,b.contents[c.filename]=g;try{o.start(g,a.chunkInput,function(a,e){throw new d({index:e,type:"Parse",message:a,filename:c.filename},b)}),k=new e.Ruleset(null,this.parsers.primary()),k.root=!0,k.firstRoot=!0}catch(t){return h(new d(t,b,c.filename))}var u=o.end();if(!u.isFinished){var v=u.furthestPossibleErrorMessage;v||(v="Unrecognised input","}"===u.furthestChar?v+=". Possibly missing opening '{'":")"===u.furthestChar?v+=". Possibly missing opening '('":u.furthestReachedEnd&&(v+=". Possibly missing something")),p=new d({type:"Parse",message:v,index:u.furthest,filename:c.filename},b)}var w=function(a){return a=p||a||b.error,a?(a instanceof d||(a=new d(a,b,c.filename)),h(a)):h(null,k)};return a.processImports===!1?w():void new f.ImportVisitor(b,w).run(k)},parsers:n={primary:function(){for(var a,b=this.mixin,c=[];;){for(;;){if(a=this.comment(),!a)break;c.push(a)}if(o.finished)break;if(o.peek("}"))break;if(a=this.extendRule())c=c.concat(a);else if(a=b.definition()||this.rule()||this.ruleset()||b.call()||this.rulesetCall()||this.entities.call()||this.directive())c.push(a);else{for(var d=!1;o.$char(";");)d=!0;if(!d)break}}return c},comment:function(){if(o.commentStore.length){var a=o.commentStore.shift();return new e.Comment(a.text,a.isLineComment,a.index,c)}},entities:{quoted:function(){var a,b=o.i,d=!1;return o.save(),o.$char("~")&&(d=!0),(a=o.$quoted())?(o.forget(),new e.Quoted(a.charAt(0),a.substr(1,a.length-2),d,b,c)):void o.restore(
19828)},keyword:function(){var a=o.$char("%")||o.$re(/^[_A-Za-z-][_A-Za-z0-9-]*/);if(a)return e.Color.fromKeyword(a)||new e.Keyword(a)},call:function(){var a,b,d,f,g=o.i;if(!o.peek(/^url\(/i))return o.save(),(a=o.$re(/^([\w-]+|%|progid:[\w\.]+)\(/))?(a=a[1],b=a.toLowerCase(),"alpha"===b&&(f=n.alpha())?(o.forget(),f):(d=this.arguments(),o.$char(")")?(o.forget(),new e.Call(a,d,g,c)):void o.restore("Could not parse call arguments or missing ')'"))):void o.forget()},arguments:function(){var a,b,c,d=[],f=[],g=[];for(o.save();;){if(c=n.detachedRuleset()||this.assignment()||n.expression(),!c)break;b=c,c.value&&1==c.value.length&&(b=c.value[0]),b&&g.push(b),f.push(b),o.$char(",")||(o.$char(";")||a)&&(a=!0,g.length>1&&(b=new e.Value(g)),d.push(b),g=[])}return o.forget(),a?d:f},literal:function(){return this.dimension()||this.color()||this.quoted()||this.unicodeDescriptor()},assignment:function(){var a,b;return o.save(),(a=o.$re(/^\w+(?=\s?=)/i))&&o.$char("=")&&(b=n.entity())?(o.forget(),new e.Assignment(a,b)):void o.restore()},url:function(){var a,b=o.i;return o.autoCommentAbsorb=!1,o.$str("url(")?(a=this.quoted()||this.variable()||o.$re(/^(?:(?:\\[\(\)'"])|[^\(\)'"])+/)||"",o.autoCommentAbsorb=!0,l(")"),new e.URL(null!=a.value||a instanceof e.Variable?a:new e.Anonymous(a),b,c)):void(o.autoCommentAbsorb=!0)},variable:function(){var a,b=o.i;if("@"===o.currentChar()&&(a=o.$re(/^@@?[\w-]+/)))return new e.Variable(a,b,c)},variableCurly:function(){var a,b=o.i;if("@"===o.currentChar()&&(a=o.$re(/^@\{([\w-]+)\}/)))return new e.Variable("@"+a[1],b,c)},color:function(){var a;if("#"===o.currentChar()&&(a=o.$re(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/))){var b=a.input.match(/^#([\w]+).*/);return b=b[1],b.match(/^[A-Fa-f0-9]+$/)||i("Invalid HEX color code"),new e.Color(a[1],(void 0),"#"+b)}},colorKeyword:function(){o.save();var a=o.autoCommentAbsorb;o.autoCommentAbsorb=!1;var b=o.$re(/^[_A-Za-z-][_A-Za-z0-9-]+/);if(o.autoCommentAbsorb=a,!b)return void o.forget();
19828o.restore();var c=e.Color.fromKeyword(b);return c?(o.$str(b),c):void 0},dimension:function(){if(!o.peekNotNumeric()){var a=o.$re(/^([+-]?\d*\.?\d+)(%|[a-z_]+)?/i);return a?new e.Dimension(a[1],a[2]):void 0}},unicodeDescriptor:function(){var a;if(a=o.$re(/^U\+[0-9a-fA-F?]+(\-[0-9a-fA-F?]+)?/))return new e.UnicodeDescriptor(a[0])},javascript:function(){var a,b=o.i;o.save();var d=o.$char("~"),f=o.$char("`");return f?(a=o.$re(/^[^`]*`/))?(o.forget(),new e.JavaScript(a.substr(0,a.length-1),Boolean(d),b,c)):void o.restore("invalid javascript definition"):void o.restore()}},variable:function(){var a;if("@"===o.currentChar()&&(a=o.$re(/^(@[\w-]+)\s*:/)))return a[1]},rulesetCall:function(){var a;if("@"===o.currentChar()&&(a=o.$re(/^(@[\w-]+)\(\s*\)\s*;/)))return new e.RulesetCall(a[1])},extend:function(a){var b,d,f,g,h,j=o.i;if(o.$str(a?"&:extend(":":extend(")){do{for(f=null,b=null;!(f=o.$re(/^(all)(?=\s*(\)|,))/))&&(d=this.element());)b?b.push(d):b=[d];f=f&&f[1],b||i("Missing target selector for :extend()."),h=new e.Extend(new e.Selector(b),f,j,c),g?g.push(h):g=[h]}while(o.$char(","));return k(/^\)/),a&&k(/^;/),g}},extendRule:function(){return this.extend(!0)},mixin:{call:function(){var a,b,d,f,g,h,i=o.currentChar(),j=!1,k=o.i;if("."===i||"#"===i){for(o.save();;){if(a=o.i,f=o.$re(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/),!f)break;d=new e.Element(g,f,a,c),b?b.push(d):b=[d],g=o.$char(">")}return b&&(o.$char("(")&&(h=this.args(!0).args,l(")")),n.important()&&(j=!0),n.end())?(o.forget(),new e.mixin.Call(b,h,k,c,j)):void o.restore(
19828)}},args:function(a){var b,c,d,f,g,h,j,k=n.entities,l={args:null,variadic:!1},m=[],p=[],q=[];for(o.save();;){if(a)h=n.detachedRuleset()||n.expression();else{if(o.commentStore.length=0,o.$str("...")){l.variadic=!0,o.$char(";")&&!b&&(b=!0),(b?p:q).push({variadic:!0});break}h=k.variable()||k.literal()||k.keyword()}if(!h)break;f=null,h.throwAwayComments&&h.throwAwayComments(),g=h;var r=null;if(a?h.value&&1==h.value.length&&(r=h.value[0]):r=h,r&&r instanceof e.Variable)if(o.$char(":")){if(m.length>0&&(b&&i("Cannot mix ; and , as delimiter types"),c=!0),g=n.detachedRuleset()||n.expression(),!g){if(!a)return o.restore(),l.args=[],l;i("could not understand value for named argument")}f=d=r.name}else if(o.$str("...")){if(!a){l.variadic=!0,o.$char(";")&&!b&&(b=!0),(b?p:q).push({name:h.name,variadic:!0});break}j=!0}else a||(d=f=r.name,g=null);g&&m.push(g),q.push({name:f,value:g,expand:j}),o.$char(",")||(o.$char(";")||b)&&(c&&i("Cannot mix ; and , as delimiter types"),b=!0,m.length>1&&(g=new e.Value(m)),p.push({name:d,value:g,expand:j}),d=null,m=[],c=!1)}return o.forget(),l.args=b?p:q,l},definition:function(){var a,b,c,d,f=[],g=!1;if(!("."!==o.currentChar()&&"#"!==o.currentChar()||o.peek(/^[^{]*\}/)))if(o.save(),b=o.$re(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){a=b[1];var h=this.args(!1);if(f=h.args,g=h.variadic,!o.$char(")"))return void o.restore("Missing closing ')'");if(o.commentStore.length=0,o.$str("when")&&(d=k(n.conditions,"expected condition")),c=n.block())return o.forget(),new e.mixin.Definition(a,f,c,d,g);o.restore()}else o.forget()}},entity:function(){var a=this.entities;return this.comment()||a.literal()||a.variable()||a.url()||a.call()||a.keyword()||a.javascript()},end:function(){return o.$char(";")||o.peek("}")},alpha:function(){var a;if(o.$re(/^opacity=/i))return a=o.$re(/^\d+/),a||(a=k(this.entities.variable,"Could not parse alpha")),l(")"),new e.Alpha(a)},element:function(){var a,b,d,f=o.i;if(b=this.combinator(),a=o.$re(/^(?:\d+\.\d+|\d+)%/)||o.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||o.$char("*")||o.$char("&")||this.attribute()||o.$re(/^\([^&()@]+\)/)||o.$re(/^[\.#:](?=@)/)||this.entities.variableCurly(),a||(o.save(),o.$char("(")?(d=this.selector())&&o.$char(")")?(a=new e.Paren(d),o.forget()):o.restore("Missing closing ')'"):o.forget()),a)return new e.Element(b,a,f,c)},combinator:function(){var a=o.currentChar();if("/"===a){o.save();var b=o.$re(/^\/[a-z]+\//i);if(b)return o.forget(),new e.Combinator(b);o.restore()}if(">"===a||"+"===a||"~"===a||"|"===a||"^"===a){for(o.i++,"^"===a&&"^"===o.currentChar()&&(a="^^",o.i++);o.isWhitespace();)o.i++;return new e.Combinator(a)}return new e.Combinator(o.isWhitespace(-1)?" ":null)},lessSelector:function(){return this.selector(!0)},selector:function(a){for(var b,d,f,g,h,j,l,m=o.i;(a&&(d=this.extend())||a&&(j=o.$str("when"))||(g=this.element()))&&(j?l=k(this.conditions,"expected condition"):l?i("CSS guard can only be used at the end of selector"):d?h=h?h.concat(d):d:(h&&i("Extend can only be used at the end of selector"),f=o.currentChar(),b?b.push(g):b=[g],g=null),"{"!==f&&"}"!==f&&";"!==f&&","!==f&&")"!==f););return b?new e.Selector(b,h,l,m,c):void(h&&i("Extend must be used to extend a selector, it cannot be used on its own"))},attribute:function(){if(o.$char("[")){var a,b,c,d=this.entities;return(a=d.variableCurly())||(a=k(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/)),c=o.$re(/^[|~*$^]?=/),c&&(b=d.quoted()||o.$re(/^[0-9]+%/)||o.$re(/^[\w-]+/)||d.variableCurly()),l("]"),new e.Attribute(a,c,b)}},block:function(){var a;if(o.$char("{")&&(a=this.primary())&&o.$char("}"))return a},blockRuleset:function(){var a=this.block();return a&&(a=new e.Ruleset(null,a)),a},detachedRuleset:function(){var a=this.blockRuleset();if(a)return new e.DetachedRuleset(a)},ruleset:function(){var b,c,d,f;for(o.save(),a.dumpLineNumbers&&(f=m(o.i));;){if(c=this.lessSelector(),!c)break;if(b?b.push(c):b=[c],o.commentStore.length=0,c.condition&&b.length>1&&i("Guards are only currently allowed on a single selector."),!o.$char(","))break;c.condition&&i("Guards are only currently allowed on a single selector."),o.commentStore.length=0}if(b&&(d=this.block())){o.forget();var g=new e.Ruleset(b,d,a.strictImports);return a.dumpLineNumbers&&(g.debugInfo=f),g}
19828o.restore()},rule:function(b){var d,f,g,h,i,j=o.i,k=o.currentChar();if("."!==k&&"#"!==k&&"&"!==k&&":"!==k)if(o.save(),d=this.variable()||this.ruleProperty()){if(i="string"==typeof d,i&&(f=this.detachedRuleset()),o.commentStore.length=0,!f){h=!i&&d.length>1&&d.pop().value;var l=!b&&(a.compress||i);if(l&&(f=this.value()),!f&&(f=this.anonymousValue()))return o.forget(),new e.Rule(d,f,(!1),h,j,c);l||f||(f=this.value()),g=this.important()}if(f&&this.end())return o.forget(),new e.Rule(d,f,g,h,j,c);if(o.restore(),f&&!b)return this.rule(!0)}else o.forget()},anonymousValue:function(){var a=o.$re(/^([^@+\/'"*`(;{}-]*);/);if(a)return new e.Anonymous(a[1])},"import":function(){var a,b,d=o.i,f=o.$re(/^@import?\s+/);if(f){var g=(f?this.importOptions():null)||{};if(a=this.entities.quoted()||this.entities.url())return b=this.mediaFeatures(),o.$char(";")||(o.i=d,i("missing semi-colon or unrecognised media features on import")),b=b&&new e.Value(b),new e.Import(a,b,g,d,c);o.i=d,i("malformed import statement")}},importOptions:function(){var a,b,c,d={};if(!o.$char("("))return null;do if(a=this.importOption()){switch(b=a,c=!0,b){case"css":b="less",c=!1;break;case"once":b="multiple",c=!1}if(d[b]=c,!o.$char(","))break}while(a);return l(")"),d},importOption:function(){var a=o.$re(/^(less|css|multiple|once|inline|reference|optional)/);if(a)return a[1]},mediaFeature:function(){var a,b,d=this.entities,f=[];o.save();do a=d.keyword()||d.variable(),a?f.push(a):o.$char("(")&&(b=this.property(),a=this.value(),o.$char(")")?b&&a?f.push(new e.Paren(new e.Rule(b,a,null,null,o.i,c,(!0)))):a?f.push(new e.Paren(a)
19828):i("badly formed media feature definition"):i("Missing closing ')'","Parse"));while(a);if(o.forget(),f.length>0)return new e.Expression(f)},mediaFeatures:function(){var a,b=this.entities,c=[];do if(a=this.mediaFeature()){if(c.push(a),!o.$char(","))break}else if(a=b.variable(),a&&(c.push(a),!o.$char(",")))break;while(a);return c.length>0?c:null},media:function(){var b,d,f,g,h=o.i;return a.dumpLineNumbers&&(g=m(h)),o.save(),o.$str("@media")?(b=this.mediaFeatures(),d=this.block(),d||i("media definitions require block statements after any features"),o.forget(),f=new e.Media(d,b,h,c),a.dumpLineNumbers&&(f.debugInfo=g),f):void o.restore()},plugin:function(){var a,b=o.i,d=o.$re(/^@plugin?\s+/);if(d){var f={plugin:!0};if(a=this.entities.quoted()||this.entities.url())return o.$char(";")||(o.i=b,i("missing semi-colon on plugin")),new e.Import(a,null,f,b,c);o.i=b,i("malformed plugin statement")}},directive:function(){var b,d,f,g,h,j,k,l=o.i,n=!0,p=!0;if("@"===o.currentChar()){if(d=this["import"]()||this.plugin()||this.media())return d;if(o.save(),b=o.$re(/^@[a-z-]+/)){switch(g=b,"-"==b.charAt(1)&&b.indexOf("-",2)>0&&(g="@"+b.slice(b.indexOf("-",2)+1)),g){case"@charset":h=!0,n=!1;break;case"@namespace":j=!0,n=!1;break;case"@keyframes":case"@counter-style":h=!0;break;case"@document":case"@supports":k=!0,p=!1;break;default:k=!0}return o.commentStore.length=0,h?(d=this.entity(),d||i("expected "+b+" identifier")):j?(d=this.expression(),d||i("expected "+b+" expression")):k&&(d=(o.$re(/^[^{;]+/)||"").trim(),n="{"==o.currentChar(),d&&(d=new e.Anonymous(d))),n&&(f=this.blockRuleset()),f||!n&&d&&o.$char(";")?(o.forget(),new e.Directive(b,d,f,l,c,a.dumpLineNumbers?m(l):null,p)):void o.restore("directive options not recognised")}}},value:function(){var a,b=[];do if(a=this.expression(),a&&(b.push(a),!o.$char(",")))break;while(a);if(b.length>0)return new e.Value(b)},important:function(){if("!"===o.currentChar())return o.$re(/^! *important/)},sub:function(){var a,b;return o.save(),o.$char("(")?(a=this.addition(),a&&o.$char(")")?(o.forget(),b=new e.Expression([a]),b.parens=!0,b):void o.restore("Expected ')'")):void o.restore(
19828)},multiplication:function(){var a,b,c,d,f;if(a=this.operand()){for(f=o.isWhitespace(-1);;){if(o.peek(/^\/[*\/]/))break;if(o.save(),c=o.$char("/")||o.$char("*"),!c){o.forget();break}if(b=this.operand(),!b){o.restore();break}o.forget(),a.parensInOp=!0,b.parensInOp=!0,d=new e.Operation(c,[d||a,b],f),f=o.isWhitespace(-1)}return d||a}},addition:function(){var a,b,c,d,f;if(a=this.multiplication()){for(f=o.isWhitespace(-1);;){if(c=o.$re(/^[-+]\s+/)||!f&&(o.$char("+")||o.$char("-")),!c)break;if(b=this.multiplication(),!b)break;a.parensInOp=!0,b.parensInOp=!0,d=new e.Operation(c,[d||a,b],f),f=o.isWhitespace(-1)}return d||a}},conditions:function(){var a,b,c,d=o.i;if(a=this.condition()){for(;;){if(!o.peek(/^,\s*(not\s*)?\(/)||!o.$char(","))break;if(b=this.condition(),!b)break;c=new e.Condition("or",c||a,b,d)}return c||a}},condition:function(){function a(){return o.$str("or")}var b,c,d;if(b=this.conditionAnd(this)){if(c=a()){if(d=this.condition(),!d)return;b=new e.Condition(c,b,d)}return b}},conditionAnd:function(){function a(a){return a.negatedCondition()||a.parenthesisCondition()}function b(){return o.$str("and")}var c,d,f;if(c=a(this)){if(d=b()){if(f=this.conditionAnd(),!f)return;c=new e.Condition(d,c,f)}return c}},negatedCondition:function(){if(o.$str("not")){var a=this.parenthesisCondition();return a&&(a.negate=!a.negate),a}},parenthesisCondition:function(){function a(a){var b;return o.save(),(b=a.condition())&&o.$char(")")?(o.forget(),b):void o.restore(
19828)}var b;return o.save(),o.$str("(")?(b=a(this))?(o.forget(),b):(b=this.atomicCondition())?o.$char(")")?(o.forget(),b):void o.restore("expected ')' got '"+o.currentChar()+"'"):void o.restore():void o.restore()},atomicCondition:function(){var a,b,c,d,f=this.entities,g=o.i;if(a=this.addition()||f.keyword()||f.quoted())return o.$char(">")?d=o.$char("=")?">=":">":o.$char("<")?d=o.$char("=")?"<=":"<":o.$char("=")&&(d=o.$char(">")?"=>":o.$char("<")?"=<":"="),d?(b=this.addition()||f.keyword()||f.quoted(),b?c=new e.Condition(d,a,b,g,(!1)):i("expected expression")):c=new e.Condition("=",a,new e.Keyword("true"),g,(!1)),c},operand:function(){var a,b=this.entities;o.peek(/^-[@\(]/)&&(a=o.$char("-"));var c=this.sub()||b.dimension()||b.color()||b.variable()||b.call()||b.colorKeyword();return a&&(c.parensInOp=!0,c=new e.Negative(c)),c},expression:function(){var a,b,c=[];do a=this.comment(),a?c.push(a):(a=this.addition()||this.entity(),a&&(c.push(a),o.peek(/^\/[\/*]/)||(b=o.$char("/"),b&&c.push(new e.Anonymous(b)))));while(a);if(c.length>0)return new e.Expression(c)},property:function(){var a=o.$re(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/);if(a)return a[1]},ruleProperty:function(){function a(a){var b=o.i,c=o.$re(a);if(c)return g.push(b),f.push(c[1])}var b,d,f=[],g=[];o.save();var h=o.$re(/^([_a-zA-Z0-9-]+)\s*:/);if(h)return f=[new e.Keyword(h[1])],o.forget(),f;for(a(/^(\*?)/);;)if(!a(/^((?:[\w-]+)|(?:@\{[\w-]+\}))/))break;if(f.length>1&&a(/^((?:\+_|\+)?)\s*:/)){for(o.forget(),""===f[0]&&(f.shift(),g.shift()),d=0;d<f.length;d++)b=f[d],f[d]="@"!==b.charAt(0)?new e.Keyword(b):new e.Variable("@"+b.slice(2,-1),g[d],c);return f}o.restore()}}}};i.serializeVars=function(a){var b="";for(var c in a)if(Object.hasOwnProperty.call(a,c)){var d=a[c];b+=("@"===c[0]?"":"@")+c+": "+d+(";"===String(d).slice(-1)?"":";")}return b},b.exports=i},{"../less-error":32,"../tree":62,"../utils":83,"../visitors":87,"./parser-input":37}],39:[function(a,b,c){var d=function(a){this.less=a,this.visitors=[],this.preProcessors=[],this.postProcessors=[],this.installedPlugins=[],this.fileManagers=[]};d.prototype.addPlugins=function(a){if(a)for(var b=0;b<a.length;b++)this.addPlugin(a[b])},d.prototype.addPlugin=function(a){this.installedPlugins.push(a),a.install(this.less,this)},d.prototype.addVisitor=function(a){this.visitors.push(a)},d.prototype.addPreProcessor=function(a,b){var c;for(c=0;c<this.preProcessors.length&&!(this.preProcessors[c].priority>=b);c++);this.preProcessors.splice(c,0,{preProcessor:a,priority:b})},d.prototype.addPostProcessor=function(a,b){var c;for(c=0;c<this.postProcessors.length&&!(this.postProcessors[c].priority>=b);c++);this.postProcessors.splice(c,0,{postProcessor:a,priority:b})},d.prototype.addFileManager=function(a){this.fileManagers.push(a)},d.prototype.getPreProcessors=function(){for(var a=[],b=0;b<this.preProcessors.length;b++)a.push(this.preProcessors[b].preProcessor);return a},d.prototype.getPostProcessors=function(){for(var a=[],b=0;b<this.postProcessors.length;b++)a.push(this.postProcessors[b].postProcessor);return a},d.prototype.getVisitors=function(){return this.visitors},d.prototype.getFileManagers=function(){return this.fileManagers},b.exports=d},{}],40:[function(a,b,c){var d=a("../less-error"),e=a("../tree"),f=b.exports=function(a,b){this.fileInfo=b};f.prototype.eval=function(a,b){var c,f,g={};f={add:function(a,b){g[a]=b},addMultiple:function(a){Object.keys(a).forEach(function(b){g[b]=a[b]})}};try{c=new Function("functions","tree","fileInfo",a),
19829c(f,e,this.fileInfo)}catch(h){b(new d({message:"Plugin evaluation error: '"+h.name+": "+h.message.replace(/["]/g,"'")+"'",filename:this.fileInfo.filename}),null)}b(null,{functions:g})}},{"../less-error":32,"../tree":62}],41:[function(a,b,c){var d;b.exports=function(b,c,e){var f=function(b,e,g){if("function"==typeof e&&(g=e,e={}),!g){d||(d="undefined"==typeof Promise?a("promise"):Promise);var h=this;return new d(function(a,c){f.call(h,b,e,function(b,d){b?c(b):a(d)})})}this.parse(b,e,function(a,b,d,e){if(a)return g(a);var f;try{var h=new c(b,d);f=h.toCSS(e)}catch(a){return g(a)}g(null,f)})};return f}},{promise:void 0}],42:[function(a,b,c){b.exports=function(a,b){var c=function(a){this.options=a};return c.prototype.toCSS=function(b,c,d){var e=new a({contentsIgnoredCharsMap:d.contentsIgnoredChars,rootNode:b,contentsMap:d.contents,sourceMapFilename:this.options.sourceMapFilename,sourceMapURL:this.options.sourceMapURL,outputFilename:this.options.sourceMapOutputFilename,sourceMapBasepath:this.options.sourceMapBasepath,sourceMapRootpath:this.options.sourceMapRootpath,outputSourceFiles:this.options.outputSourceFiles,sourceMapGenerator:this.options.sourceMapGenerator,sourceMapFileInline:this.options.sourceMapFileInline}),f=e.toCSS(c);return this.sourceMap=e.sourceMap,this.sourceMapURL=e.sourceMapURL,this.options.sourceMapInputFilename&&(this.sourceMapInputFilename=e.normalizeFilename(this.options.sourceMapInputFilename)),f+this.getCSSAppendage()},c.prototype.getCSSAppendage=function(){var a=this.sourceMapURL;if(this.options.sourceMapFileInline){if(void 0===this.sourceMap)return"";a="data:application/json;base64,"+b.encodeBase64(this.sourceMap)}return a?"/*# sourceMappingURL="+a+" */":""},c.prototype.getExternalSourceMap=function(){return this.sourceMap},c.prototype.setExternalSourceMap=function(a){this.sourceMap=a},c.prototype.isInline=function(){return this.options.sourceMapFileInline},c.prototype.getSourceMapURL=function(){return this.sourceMapURL},c.prototype.getOutputFilename=function(){return this.options.sourceMapOutputFilename},c.prototype.getInputFilename=function(){return this.sourceMapInputFilename},c}},{}],43:[function(a,b,c){b.exports=function(a){var b=function(b){this._css=[],this._rootNode=b.rootNode,this._contentsMap=b.contentsMap,this._contentsIgnoredCharsMap=b.contentsIgnoredCharsMap,b.sourceMapFilename&&(this._sourceMapFilename=b.sourceMapFilename.replace(/\\/g,"/")),this._outputFilename=b.outputFilename,this.sourceMapURL=b.sourceMapURL,b.sourceMapBasepath&&(this._sourceMapBasepath=b.sourceMapBasepath.replace(/\\/g,"/")),b.sourceMapRootpath?(this._sourceMapRootpath=b.sourceMapRootpath.replace(/\\/g,"/"),"/"!==this._sourceMapRootpath.charAt(this._sourceMapRootpath.length-1)&&(this._sourceMapRootpath+="/")):this._sourceMapRootpath="",this._outputSourceFiles=b.outputSourceFiles,this._sourceMapGeneratorConstructor=a.getSourceMapGenerator(),this._lineNumber=0,this._column=0};return b.prototype.normalizeFilename=function(a){return a=a.replace(/\\/g,"/"),this._sourceMapBasepath&&0===a.indexOf(this._sourceMapBasepath)&&(a=a.substring(this._sourceMapBasepath.length),"\\"!==a.charAt(0)&&"/"!==a.charAt(0)||(a=a.substring(1))),(this._sourceMapRootpath||"")+a},b.prototype.add=function(a,b,c,d){if(a){var e,f,g,h,i;if(b){var j=this._contentsMap[b.filename];this._contentsIgnoredCharsMap[b.filename]&&(c-=this._contentsIgnoredCharsMap[b.filename],c<0&&(c=0),j=j.slice(this._contentsIgnoredCharsMap[b.filename])),j=j.substring(0,c),f=j.split("\n"),h=f[f.length-1]}if(e=a.split("\n"),g=e[e.length-1],b)if(d)for(i=0;i<e.length;i++)this._sourceMapGenerator.addMapping({generated:{line:this._lineNumber+i+1,column:0===i?this._column:0},original:{line:f.length+i,column:0===i?h.length:0},source:this.normalizeFilename(b.filename)});else this._sourceMapGenerator.addMapping({generated:{line:this._lineNumber+1,column:this._column},original:{line:f.length,column:h.length},source:this.normalizeFilename(b.filename)});1===e.length?this._column+=g.length:(this._lineNumber+=e.length-1,this._column=g.length),this._css.push(a)}},b.prototype.isEmpty=function(){return 0===this._css.length}
19829,b.prototype.toCSS=function(a){if(this._sourceMapGenerator=new this._sourceMapGeneratorConstructor({file:this._outputFilename,sourceRoot:null}),this._outputSourceFiles)for(var b in this._contentsMap)if(this._contentsMap.hasOwnProperty(b)){var c=this._contentsMap[b];this._contentsIgnoredCharsMap[b]&&(c=c.slice(this._contentsIgnoredCharsMap[b])),this._sourceMapGenerator.setSourceContent(this.normalizeFilename(b),c)}if(this._rootNode.genCSS(a,this),this._css.length>0){var d,e=JSON.stringify(this._sourceMapGenerator.toJSON());this.sourceMapURL?d=this.sourceMapURL:this._sourceMapFilename&&(d=this._sourceMapFilename),this.sourceMapURL=d,this.sourceMap=e}return this._css.join("")},b}},{}],44:[function(a,b,c){var d=a("./contexts"),e=a("./visitors"),f=a("./tree");b.exports=function(a,b){b=b||{};var c,g=b.variables,h=new d.Eval(b);"object"!=typeof g||Array.isArray(g)||(g=Object.keys(g).map(function(a){var b=g[a];return b instanceof f.Value||(b instanceof f.Expression||(b=new f.Expression([b])),b=new f.Value([b])),new f.Rule("@"+a,b,(!1),null,0)}),h.frames=[new f.Ruleset(null,g)]);var i,j=[],k=[new e.JoinSelectorVisitor,new e.MarkVisibleSelectorsVisitor((!0)),new e.ExtendVisitor,new e.ToCSSVisitor({compress:Boolean(b.compress)})];if(b.pluginManager){var l=b.pluginManager.getVisitors();for(i=0;i<l.length;i++){var m=l[i];m.isPreEvalVisitor?j.push(m):m.isPreVisitor?k.splice(0,0,m):k.push(m)}}for(i=0;i<j.length;i++)j[i].run(a);for(c=a.eval(h),i=0;i<k.length;i++)k[i].run(c);return c}},{"./contexts":11,"./tree":62,"./visitors":87}],45:[function(a,b,c){var d=a("./node"),e=function(a){this.value=a};e.prototype=new d,e.prototype.type="Alpha",e.prototype.accept=function(a){this.value=a.visit(this.value)},e.prototype.eval=function(a){return this.value.eval?new e(this.value.eval(a)):this},e.prototype.genCSS=function(a,b){b.add("alpha(opacity="),this.value.genCSS?this.value.genCSS(a,b):b.add(this.value),b.add(")")},b.exports=e},{"./node":70}],46:[function(a,b,c){var d=a("./node"),e=function(a,b,c,d,e,f){this.value=a,this.index=b,this.mapLines=d,this.currentFileInfo=c,this.rulesetLike="undefined"!=typeof e&&e,this.allowRoot=!0,this.copyVisibilityInfo(f)};e.prototype=new d,e.prototype.type="Anonymous",e.prototype.eval=function(){return new e(this.value,this.index,this.currentFileInfo,this.mapLines,this.rulesetLike,this.visibilityInfo())},e.prototype.compare=function(a){return a.toCSS&&this.toCSS()===a.toCSS()?0:void 0},e.prototype.isRulesetLike=function(){return this.rulesetLike},e.prototype.genCSS=function(a,b){b.add(this.value,this.currentFileInfo,this.index,this.mapLines)},b.exports=e},{"./node":70}],47:[function(a,b,c){var d=a("./node"),e=function(a,b){this.key=a,this.value=b};e.prototype=new d,e.prototype.type="Assignment",e.prototype.accept=function(a){this.value=a.visit(this.value)},e.prototype.eval=function(a){return this.value.eval?new e(this.key,this.value.eval(a)):this},e.prototype.genCSS=function(a,b){b.add(this.key+"="),this.value.genCSS?this.value.genCSS(a,b):b.add(this.value)},b.exports=e},{"./node":70}],48:[function(a,b,c){var d=a("./node"),e=function(a,b,c){this.key=a,this.op=b,this.value=c};e.prototype=new d,e.prototype.type="Attribute",e.prototype.eval=function(a){return new e(this.key.eval?this.key.eval(a):this.key,this.op,this.value&&this.value.eval?this.value.eval(a):this.value)},e.prototype.genCSS=function(a,b){b.add(this.toCSS(a))},e.prototype.toCSS=function(a){var b=this.key.toCSS?this.key.toCSS(a):this.key;return this.op&&(b+=this.op,b+=this.value.toCSS?this.value.toCSS(a):this.value),"["+b+"]"},b.exports=e},{"./node":70}],49:[function(a,b,c){var d=a("./node"),e=a("../functions/function-caller"),f=function(a,b,c,d){this.name=a,this.args=b,this.index=c,this.currentFileInfo=d};f.prototype=new d,f.prototype.type="Call",f.prototype.accept=function(a){this.args&&(this.args=a.visitArray(this.args))},f.prototype.eval=function(a){var b,c=this.args.map(function(b){return b.eval(a)}),d=new e(this.name,a,this.index,this.currentFileInfo);if(d.isValid()){try{b=d.call(c)}catch(g){throw{type:g.type||"Runtime",message:"error evaluating function `"+this.name+"`"+(g.message?": "+g.message:""),index:this.index,filename:this.currentFileInfo.filename}}if(null!=b)return b.index=this.index,b.currentFileInfo=this.currentFileInfo,b}return new f(this.name,c,this.index,this.currentFileInfo)},f.prototype.genCSS=function(a,b){b.add(this.name+"(",this.currentFileInfo,this.index);for(var c=0;c<this.args.length;c++)this.args[c].genCSS(a,b),c+1<this.args.length&&b.add(", ");b.add(")")},b.exports=f},{"../functions/function-caller":21,"./node":70}],50:[function(a,b,c){function d(a,b){return Math.min(Math.max(a,0),b)}function e(a){return"#"+a.map(function(a){return a=d(Math.round(a),255),(a<16?"0":"")+a.toString(16)}).join("")}var f=a("./node"),g=a("../data/colors"),h=function(a,b,c){this.rgb=Array.isArray(a)?a:6==a.length?a.match(/.{2}/g).map(function(a){return parseInt(a,16)}):a.split("").map(function(a){return parseInt(a+a,16)}),this.alpha="number"==typeof b?b:1,"undefined"!=typeof c&&(this.value=c)};h.prototype=new f,h.prototype.type="Color",h.prototype.luma=function(){var a=this.rgb[0]/255,b=this.rgb[1]/255,c=this.rgb[2]/255;return a=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),b=b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4),c=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4),.2126*a+.7152*b+.0722*c},h.prototype.genCSS=function(a,b){b.add(this.toCSS(a))},h.prototype.toCSS=function(a,b){var c,e,f=a&&a.compress&&!b;if(this.value)return this.value;if(e=this.fround(a,this.alpha),e<1)return"rgba("+this.rgb.map(function(a){return d(Math.round(a),255)}).concat(d(e,1)).join(","+(f?"":" "))+")";if(c=this.toRGB(),f){var g=c.split("");g[1]===g[2]&&g[3]===g[4]&&g[5]===g[6]&&(c="#"+g[1]+g[3]+g[5])}return c},h.prototype.operate=function(a,b,c){for(var d=[],e=this.alpha*(1-c.alpha)+c.alpha,f=0;f<3;f++)d[f]=this._operate(a,b,this.rgb[f],c.rgb[f]);return new h(d,e)},h.prototype.toRGB=function(){return e(this.rgb)},h.prototype.toHSL=function(){var a,b,c=this.rgb[0]/255,d=this.rgb[1]/255,e=this.rgb[2]/255,f=this.alpha,g=Math.max(c,d,e),h=Math.min(c,d,e),i=(g+h)/2,j=g-h;if(g===h)a=b=0;else{switch(b=i>.5?j/(2-g-h):j/(g+h),g){case c:a=(d-e)/j+(d<e?6:0);break;case d:a=(e-c)/j+2;break;case e:a=(c-d)/j+4}a/=6}return{h:360*a,s:b,l:i,a:f}},h.prototype.toHSV=function(){var a,b,c=this.rgb[0]/255,d=this.rgb[1]/255,e=this.rgb[2]/255,f=this.alpha,g=Math.max(c,d,e),h=Math.min(c,d,e),i=g,j=g-h;if(b=0===g?0:j/g,g===h)a=0;else{switch(g){case c:a=(d-e)/j+(d<e?6:0);break;case d:a=(e-c)/j+2;break;case e:a=(c-d)/j+4}a/=6}return{h:360*a,s:b,v:i,a:f}},h.prototype.toARGB=function(){return e([255*this.alpha].concat(this.rgb))},h.prototype.compare=function(a){return a.rgb&&a.rgb[0]===this.rgb[0]&&a.rgb[1]===this.rgb[1]&&a.rgb[2]===this.rgb[2]&&a.alpha===this.alpha?0:void 0},h.fromKeyword=function(a){var b,c=a.toLowerCase();if(g.hasOwnProperty(c)?b=new h(g[c].slice(1)):"transparent"===c&&(b=new h([0,0,0],0)),b)return b.value=a,b},b.exports=h},{"../data/colors":12,"./node":70}],51:[function(a,b,c){var d=a("./node"),e=function(a){" "===a?(this.value=" ",this.emptyOrWhitespace=!0):(this.value=a?a.trim():"",this.emptyOrWhitespace=""===this.value)};e.prototype=new d,e.prototype.type="Combinator";
19829var f={"":!0," ":!0,"|":!0};e.prototype.genCSS=function(a,b){var c=a.compress||f[this.value]?"":" ";b.add(c+this.value+c)},b.exports=e},{"./node":70}],52:[function(a,b,c){var d=a("./node"),e=a("./debug-info"),f=function(a,b,c,d){this.value=a,this.isLineComment=b,this.index=c,this.currentFileInfo=d,this.allowRoot=!0};f.prototype=new d,f.prototype.type="Comment",f.prototype.genCSS=function(a,b){this.debugInfo&&b.add(e(a,this),this.currentFileInfo,this.index),b.add(this.value)},f.prototype.isSilent=function(a){var b=a.compress&&"!"!==this.value[2];return this.isLineComment||b},b.exports=f},{"./debug-info":54,"./node":70}],53:[function(a,b,c){var d=a("./node"),e=function(a,b,c,d,e){this.op=a.trim(),this.lvalue=b,this.rvalue=c,this.index=d,this.negate=e};e.prototype=new d,e.prototype.type="Condition",e.prototype.accept=function(a){this.lvalue=a.visit(this.lvalue),this.rvalue=a.visit(this.rvalue)},e.prototype.eval=function(a){var b=function(a,b,c){switch(a){case"and":return b&&c;case"or":return b||c;default:switch(d.compare(b,c)){case-1:return"<"===a||"=<"===a||"<="===a;case 0:return"="===a||">="===a||"=<"===a||"<="===a;case 1:return">"===a||">="===a;default:return!1}}}(this.op,this.lvalue.eval(a),this.rvalue.eval(a));return this.negate?!b:b},b.exports=e},{"./node":70}],54:[function(a,b,c){var d=function(a,b,c){var e="";if(a.dumpLineNumbers&&!a.compress)switch(a.dumpLineNumbers){case"comments":e=d.asComment(b);break;case"mediaquery":e=d.asMediaQuery(b);break;case"all":e=d.asComment(b)+(c||"")+d.asMediaQuery(b)}return e};d.asComment=function(a){return"/* line "+a.debugInfo.lineNumber+", "+a.debugInfo.fileName+" */\n"},d.asMediaQuery=function(a){var b=a.debugInfo.fileName;return/^[a-z]+:\/\//i.test(b)||(b="file://"+b),"@media -sass-debug-info{filename{font-family:"+b.replace(/([.:\/\\])/g,function(a){return"\\"==a&&(a="/"),"\\"+a})+"}line{font-family:\\00003"+a.debugInfo.lineNumber+"}}\n"},b.exports=d},{}],55:[function(a,b,c){var d=a("./node"),e=a("../contexts"),f=function(a,b){this.ruleset=a,this.frames=b};f.prototype=new d,f.prototype.type="DetachedRuleset",f.prototype.evalFirst=!0,f.prototype.accept=function(a){this.ruleset=a.visit(this.ruleset)},f.prototype.eval=function(a){var b=this.frames||a.frames.slice(0);return new f(this.ruleset,b)},f.prototype.callEval=function(a){return this.ruleset.eval(this.frames?new e.Eval(a,this.frames.concat(a.frames)):a)},b.exports=f},{"../contexts":11,"./node":70}],56:[function(a,b,c){var d=a("./node"),e=a("../data/unit-conversions"),f=a("./unit"),g=a("./color"),h=function(a,b){this.value=parseFloat(a),this.unit=b&&b instanceof f?b:new f(b?[b]:void 0)};h.prototype=new d,h.prototype.type="Dimension",h.prototype.accept=function(a){this.unit=a.visit(this.unit)},h.prototype.eval=function(a){return this},h.prototype.toColor=function(){return new g([this.value,this.value,this.value])},h.prototype.genCSS=function(a,b){if(a&&a.strictUnits&&!this.unit.isSingular())throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: "+this.unit.toString());var c=this.fround(a,this.value),d=String(c);if(0!==c&&c<1e-6&&c>-1e-6&&(d=c.toFixed(20).replace(/0+$/,"")),a&&a.compress){if(0===c&&this.unit.isLength())return void b.add(d);c>0&&c<1&&(d=d.substr(1))}b.add(d),this.unit.genCSS(a,b)},h.prototype.operate=function(a,b,c){var d=this._operate(a,b,this.value,c.value),e=this.unit.clone();if("+"===b||"-"===b)if(0===e.numerator.length&&0===e.denominator.length)e=c.unit.clone(),this.unit.backupUnit&&(e.backupUnit=this.unit.backupUnit);else if(0===c.unit.numerator.length&&0===e.denominator.length);else{if(c=c.convertTo(this.unit.usedUnits()),a.strictUnits&&c.unit.toString()!==e.toString())throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '"+e.toString()+"' and '"+c.unit.toString()+"'.");d=this._operate(a,b,this.value,c.value)}else"*"===b?(e.numerator=e.numerator.concat(c.unit.numerator).sort(),e.denominator=e.denominator.concat(c.unit.denominator).sort(),e.cancel()):"/"===b&&(e.numerator=e.numerator.concat(c.unit.denominator).sort(),e.denominator=e.denominator.concat(c.unit.numerator).sort(),e.cancel());return new h(d,e)},h.prototype.compare=function(a){var b,c;
19829if(a instanceof h){if(this.unit.isEmpty()||a.unit.isEmpty())b=this,c=a;else if(b=this.unify(),c=a.unify(),0!==b.unit.compare(c.unit))return;return d.numericCompare(b.value,c.value)}},h.prototype.unify=function(){return this.convertTo({length:"px",duration:"s",angle:"rad"})},h.prototype.convertTo=function(a){var b,c,d,f,g,i=this.value,j=this.unit.clone(),k={};if("string"==typeof a){for(b in e)e[b].hasOwnProperty(a)&&(k={},k[b]=a);a=k}g=function(a,b){return d.hasOwnProperty(a)?(b?i/=d[a]/d[f]:i*=d[a]/d[f],f):a};for(c in a)a.hasOwnProperty(c)&&(f=a[c],d=e[c],j.map(g));return j.cancel(),new h(i,j)},b.exports=h},{"../data/unit-conversions":14,"./color":50,"./node":70,"./unit":79}],57:[function(a,b,c){var d=a("./node"),e=a("./selector"),f=a("./ruleset"),g=function(a,b,c,d,f,g,h,i){var j;if(this.name=a,this.value=b,c)for(Array.isArray(c)?this.rules=c:(this.rules=[c],this.rules[0].selectors=new e([],null,null,this.index,f).createEmptySelectors()),j=0;j<this.rules.length;j++)this.rules[j].allowImports=!0;this.index=d,this.currentFileInfo=f,this.debugInfo=g,this.isRooted=h||!1,this.copyVisibilityInfo(i),this.allowRoot=!0};g.prototype=new d,g.prototype.type="Directive",g.prototype.accept=function(a){var b=this.value,c=this.rules;c&&(this.rules=a.visitArray(c)),b&&(this.value=a.visit(b))},g.prototype.isRulesetLike=function(){return this.rules||!this.isCharset()},g.prototype.isCharset=function(){return"@charset"===this.name},g.prototype.genCSS=function(a,b){var c=this.value,d=this.rules;b.add(this.name,this.currentFileInfo,this.index),c&&(b.add(" "),c.genCSS(a,b)),d?this.outputRuleset(a,b,d):b.add(";")},g.prototype.eval=function(a){var b,c,d=this.value,e=this.rules;return b=a.mediaPath,c=a.mediaBlocks,a.mediaPath=[],a.mediaBlocks=[],d&&(d=d.eval(a)),e&&(e=[e[0].eval(a)],e[0].root=!0),a.mediaPath=b,a.mediaBlocks=c,new g(this.name,d,e,this.index,this.currentFileInfo,this.debugInfo,this.isRooted,this.visibilityInfo())},g.prototype.variable=function(a){if(this.rules)return f.prototype.variable.call(this.rules[0],a)},g.prototype.find=function(){if(this.rules)return f.prototype.find.apply(this.rules[0],arguments)},g.prototype.rulesets=function(){if(this.rules)return f.prototype.rulesets.apply(this.rules[0])},g.prototype.outputRuleset=function(a,b,c){var d,e=c.length;if(a.tabLevel=(0|a.tabLevel)+1,a.compress){for(b.add("{"),d=0;d<e;d++)c[d].genCSS(a,b);return b.add("}"),void a.tabLevel--}var f="\n"+Array(a.tabLevel).join("  "),g=f+"  ";if(e){for(b.add(" {"+g),c[0].genCSS(a,b),d=1;d<e;d++)b.add(g),c[d].genCSS(a,b);b.add(f+"}")}else b.add(" {"+f+"}");a.tabLevel--},b.exports=g},{"./node":70,"./ruleset":76,"./selector":77}],58:[function(a,b,c){var d=a("./node"),e=a("./paren"),f=a("./combinator"),g=function(a,b,c,d,e){this.combinator=a instanceof f?a:new f(a),this.value="string"==typeof b?b.trim():b?b:"",this.index=c,this.currentFileInfo=d,this.copyVisibilityInfo(e)};g.prototype=new d,g.prototype.type="Element",g.prototype.accept=function(a){var b=this.value;this.combinator=a.visit(this.combinator),"object"==typeof b&&(this.value=a.visit(b))},g.prototype.eval=function(a){return new g(this.combinator,this.value.eval?this.value.eval(a):this.value,this.index,this.currentFileInfo,this.visibilityInfo())},g.prototype.clone=function(){return new g(this.combinator,this.value,this.index,this.currentFileInfo,this.visibilityInfo())},g.prototype.genCSS=function(a,b){b.add(this.toCSS(a),this.currentFileInfo,this.index)},g.prototype.toCSS=function(a){a=a||{};var b=this.value,c=a.firstSelector;return b instanceof e&&(a.firstSelector=!0),b=b.toCSS?b.toCSS(a):b,a.firstSelector=c,""===b&&"&"===this.combinator.value.charAt(0)?"":this.combinator.toCSS(a)+b},b.exports=g},{"./combinator":51,"./node":70,"./paren":72}],59:[function(a,b,c){var d=a("./node"),e=a("./paren"),f=a("./comment"),g=function(a){if(this.value=a,!a)throw new Error("Expression requires an array parameter")};g.prototype=new d,g.prototype.type="Expression",g.prototype.accept=function(a){this.value=a.visitArray(this.value)},g.prototype.eval=function(a){var b,c=this.parens&&!this.parensInOp,d=!1;return c&&a.inParenthesis(),this.value.length>1?b=new g(this.value.map(function(b){return b.eval(a)})):1===this.value.length?(this.value[0].parens&&!this.value[0].parensInOp&&(d=!0),b=this.value[0].eval(a)):b=this,c&&a.outOfParenthesis(),this.parens&&this.parensInOp&&!a.isMathOn()&&!d&&(b=new e(b)),b},g.prototype.genCSS=function(a,b){for(var c=0;c<this.value.length;c++)this.value[c].genCSS(a,b),c+1<this.value.length&&b.add(" ")},g.prototype.throwAwayComments=function(){this.value=this.value.filter(function(a){return!(a instanceof f)})}
19829,b.exports=g},{"./comment":52,"./node":70,"./paren":72}],60:[function(a,b,c){var d=a("./node"),e=a("./selector"),f=function g(a,b,c,d,e){switch(this.selector=a,this.option=b,this.index=c,this.object_id=g.next_id++,this.parent_ids=[this.object_id],this.currentFileInfo=d||{},this.copyVisibilityInfo(e),this.allowRoot=!0,b){case"all":this.allowBefore=!0,this.allowAfter=!0;break;default:this.allowBefore=!1,this.allowAfter=!1}};f.next_id=0,f.prototype=new d,f.prototype.type="Extend",f.prototype.accept=function(a){this.selector=a.visit(this.selector)},f.prototype.eval=function(a){return new f(this.selector.eval(a),this.option,this.index,this.currentFileInfo,this.visibilityInfo())},f.prototype.clone=function(a){return new f(this.selector,this.option,this.index,this.currentFileInfo,this.visibilityInfo())},f.prototype.findSelfSelectors=function(a){var b,c,d=[];for(b=0;b<a.length;b++)c=a[b].elements,b>0&&c.length&&""===c[0].combinator.value&&(c[0].combinator.value=" "),d=d.concat(a[b].elements);this.selfSelectors=[new e(d)],this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo())},b.exports=f},{"./node":70,"./selector":77}],61:[function(a,b,c){var d=a("./node"),e=a("./media"),f=a("./url"),g=a("./quoted"),h=a("./ruleset"),i=a("./anonymous"),j=function(a,b,c,d,e,f){if(this.options=c,this.index=d,this.path=a,this.features=b,this.currentFileInfo=e,this.allowRoot=!0,void 0!==this.options.less||this.options.inline)this.css=!this.options.less||this.options.inline;else{var g=this.getPath();g&&/[#\.\&\?\/]css([\?;].*)?$/.test(g)&&(this.css=!0)}this.copyVisibilityInfo(f)};j.prototype=new d,j.prototype.type="Import",j.prototype.accept=function(a){this.features&&(this.features=a.visit(this.features)),this.path=a.visit(this.path),this.options.plugin||this.options.inline||!this.root||(this.root=a.visit(this.root))},j.prototype.genCSS=function(a,b){this.css&&void 0===this.path.currentFileInfo.reference&&(b.add("@import ",this.currentFileInfo,this.index),this.path.genCSS(a,b),this.features&&(b.add(" "),this.features.genCSS(a,b)),b.add(";"))},j.prototype.getPath=function(){return this.path instanceof f?this.path.value.value:this.path.value},j.prototype.isVariableImport=function(){var a=this.path;return a instanceof f&&(a=a.value),!(a instanceof g)||a.containsVariables()},j.prototype.evalForImport=function(a){var b=this.path;return b instanceof f&&(b=b.value),new j(b.eval(a),this.features,this.options,this.index,this.currentFileInfo,this.visibilityInfo())},j.prototype.evalPath=function(a){var b=this.path.eval(a),c=this.currentFileInfo&&this.currentFileInfo.rootpath;if(!(b instanceof f)){if(c){var d=b.value;d&&a.isPathRelative(d)&&(b.value=c+d)}b.value=a.normalizePath(b.value)}return b},j.prototype.eval=function(a){var b=this.doEval(a);return(this.options.reference||this.blocksVisibility())&&(b.length||0===b.length?b.forEach(function(a){a.addVisibilityBlock()}):b.addVisibilityBlock()),b},j.prototype.doEval=function(a){var b,c,d=this.features&&this.features.eval(a);if(this.options.plugin)return c=a.frames[0]&&a.frames[0].functionRegistry,c&&this.root&&this.root.functions&&c.addMultiple(this.root.functions),[];if(this.skip&&("function"==typeof this.skip&&(this.skip=this.skip()),this.skip))return[];if(this.options.inline){var f=new i(this.root,0,{filename:this.importedFilename,reference:this.path.currentFileInfo&&this.path.currentFileInfo.reference},(!0),(!0));return this.features?new e([f],this.features.value):[f]}if(this.css){var g=new j(this.evalPath(a),d,this.options,this.index);if(!g.css&&this.error)throw this.error;return g}return b=new h(null,this.root.rules.slice(0)),b.evalImports(a),this.features?new e(b.rules,this.features.value):b.rules},b.exports=j},{"./anonymous":46,"./media":66,"./node":70,"./quoted":73,"./ruleset":76,"./url":80}],62:[function(a,b,c){var d={};d.Node=a("./node"),d.Alpha=a("./alpha"),d.Color=a("./color"),d.Directive=a("./directive"),d.DetachedRuleset=a("./detached-ruleset"),d.Operation=a("./operation"),d.Dimension=a("./dimension"),d.Unit=a("./unit"),d.Keyword=a("./keyword"),d.Variable=a("./variable"),d.Ruleset=a("./ruleset"),d.Element=a("./element"),d.Attribute=a("./attribute"),d.Combinator=a("./combinator"),d.Selector=a("./selector"),d.Quoted=a("./quoted"),d.Expression=a("./expression"),d.Rule=a("./rule"),d.Call=a("./call"),d.URL=a("./url"),d.Import=a("./import"),d.mixin={Call:a("./mixin-call"),Definition:a("./mixin-definition")},d.Comment=a("./comment"),d.Anonymous=a("./anonymous"),d.Value=a("./value"),d.JavaScript=a("./javascript"),d.Assignment=a("./assignment"),d.Condition=a("./condition"),d.Paren=a("./paren"),d.Media=a("./media"),d.UnicodeDe
19829scriptor=a("./unicode-descriptor"),d.Negative=a("./negative"),d.Extend=a("./extend"),d.RulesetCall=a("./ruleset-call"),b.exports=d},{"./alpha":45,"./anonymous":46,"./assignment":47,"./attribute":48,"./call":49,"./color":50,"./combinator":51,"./comment":52,"./condition":53,"./detached-ruleset":55,"./dimension":56,"./directive":57,"./element":58,"./expression":59,"./extend":60,"./import":61,"./javascript":63,"./keyword":65,"./media":66,"./mixin-call":67,"./mixin-definition":68,"./negative":69,"./node":70,"./operation":71,"./paren":72,"./quoted":73,"./rule":74,"./ruleset":76,"./ruleset-call":75,"./selector":77,"./unicode-descriptor":78,"./unit":79,"./url":80,"./value":81,"./variable":82}],63:[function(a,b,c){var d=a("./js-eval-node"),e=a("./dimension"),f=a("./quoted"),g=a("./anonymous"),h=function(a,b,c,d){this.escaped=b,this.expression=a,this.index=c,this.currentFileInfo=d};h.prototype=new d,h.prototype.type="JavaScript",h.prototype.eval=function(a){var b=this.evaluateJavaScript(this.expression,a);return"number"==typeof b?new e(b):"string"==typeof b?new f('"'+b+'"',b,this.escaped,this.index):new g(Array.isArray(b)?b.join(", "):b)},b.exports=h},{"./anonymous":46,"./dimension":56,"./js-eval-node":64,"./quoted":73}],64:[function(a,b,c){var d=a("./node"),e=a("./variable"),f=function(){};f.prototype=new d,f.prototype.evaluateJavaScript=function(a,b){var c,d=this,f={};if(void 0!==b.javascriptEnabled&&!b.javascriptEnabled)throw{message:"You are using JavaScript, which has been disabled.",filename:this.currentFileInfo.filename,index:this.index};a=a.replace(/@\{([\w-]+)\}/g,function(a,c){return d.jsify(new e("@"+c,d.index,d.currentFileInfo).eval(b))});try{a=new Function("return ("+a+")")}catch(g){throw{message:"JavaScript evaluation error: "+g.message+" from `"+a+"`",filename:this.currentFileInfo.filename,index:this.index}}var h=b.frames[0].variables();for(var i in h)h.hasOwnProperty(i)&&(f[i.slice(1)]={value:h[i].value,toJS:function(){return this.value.eval(b).toCSS()}});try{c=a.call(f)}catch(g){throw{message:"JavaScript evaluation error: '"+g.name+": "+g.message.replace(/["]/g,"'")+"'",filename:this.currentFileInfo.filename,index:this.index}}return c},f.prototype.jsify=function(a){return Array.isArray(a.value)&&a.value.length>1?"["+a.value.map(function(a){return a.toCSS()}).join(", ")+"]":a.toCSS()},b.exports=f},{"./node":70,"./variable":82}],65:[function(a,b,c){var d=a("./node"),e=function(a){this.value=a};e.prototype=new d,e.prototype.type="Keyword",e.prototype.genCSS=function(a,b){if("%"===this.value)throw{type:"Syntax",message:"Invalid % without number"};b.add(this.value)},e.True=new e("true"),e.False=new e("false"),b.exports=e},{"./node":70}],66:[function(a,b,c){var d=a("./ruleset"),e=a("./value"),f=a("./selector"),g=a("./anonymous"),h=a("./expression"),i=a("./directive"),j=function(a,b,c,g,h){this.index=c,this.currentFileInfo=g;var i=new f([],null,null,this.index,this.currentFileInfo).createEmptySelectors();this.features=new e(b),this.rules=[new d(i,a)],this.rules[0].allowImports=!0,this.copyVisibilityInfo(h),this.allowRoot=!0};j.prototype=new i,j.prototype.type="Media",j.prototype.isRulesetLike=!0,j.prototype.accept=function(a){this.features&&(this.features=a.visit(this.features)),this.rules&&(this.rules=a.visitArray(this.rules))},j.prototype.genCSS=function(a,b){b.add("@media ",this.currentFileInfo,this.index),this.features.genCSS(a,b),this.outputRuleset(a,b,this.rules)},j.prototype.eval=function(a){a.mediaBlocks||(a.mediaBlocks=[],a.mediaPath=[]);var b=new j(null,[],this.index,this.currentFileInfo,this.visibilityInfo());this.debugInfo&&(this.rules[0].debugInfo=this.debugInfo,b.debugInfo=this.debugInfo);var c=!1;a.strictMath||(c=!0,a.strictMath=!0);try{b.features=this.features.eval(a)}finally{c&&(a.strictMath=!1)}return a.mediaPath.push(b),a.mediaBlocks.push(b),this.rules[0].functionRegistry=a.frames[0].functionRegistry.inherit(),a.frames.unshift(this.rules[0]),b.rules=[this.rules[0].eval(a)],a.frames.shift(),a.mediaPath.pop(),0===a.mediaPath.length?b.evalTop(a):b.evalNested(a)},j.prototype.evalTop=function(a){var b=this;if(a.mediaBlocks.length>1){var c=new f([],null,null,this.index,this.currentFileInfo).createEmptySelectors();b=new d(c,a.mediaBlocks),b.multiMedia=!0,b.copyVisibilityInfo(this.visibilityInfo())}return delete a.mediaBlocks,delete a.mediaPath,b},j.prototype.evalNested=function(a){var b,c,f=a.mediaPath.concat([this]);for(b=0;b<f.length;b++)c=f[b].features instanceof e?f[b].features.value:f[b].features,f[b]=Array.isArray(c)?c:[c];return this.features=new e(this.permute(f).map(function(a){for(a=a.map(function(a){return a.toCSS?a:new g(a)}),b=a.length-1;b>0;b--)a.splice(b,0,new g("and"));return new h(a)})),new d([],[])}
19829,j.prototype.permute=function(a){if(0===a.length)return[];if(1===a.length)return a[0];for(var b=[],c=this.permute(a.slice(1)),d=0;d<c.length;d++)for(var e=0;e<a[0].length;e++)b.push([a[0][e]].concat(c[d]));return b},j.prototype.bubbleSelectors=function(a){a&&(this.rules=[new d(a.slice(0),[this.rules[0]])])},b.exports=j},{"./anonymous":46,"./directive":57,"./expression":59,"./ruleset":76,"./selector":77,"./value":81}],67:[function(a,b,c){var d=a("./node"),e=a("./selector"),f=a("./mixin-definition"),g=a("../functions/default"),h=function(a,b,c,d,f){this.selector=new e(a),this.arguments=b||[],this.index=c,this.currentFileInfo=d,this.important=f,this.allowRoot=!0};h.prototype=new d,h.prototype.type="MixinCall",h.prototype.accept=function(a){this.selector&&(this.selector=a.visit(this.selector)),this.arguments.length&&(this.arguments=a.visitArray(this.arguments))},h.prototype.eval=function(a){function b(b,c){var d,e,f;for(d=0;d<2;d++){for(x[d]=!0,g.value(d),e=0;e<c.length&&x[d];e++)f=c[e],f.matchCondition&&(x[d]=x[d]&&f.matchCondition(null,a));b.matchCondition&&(x[d]=x[d]&&b.matchCondition(t,a))}return x[0]||x[1]?x[0]!=x[1]?x[1]?A:B:z:y}var c,d,e,h,i,j,k,l,m,n,o,p,q,r,s,t=[],u=[],v=!1,w=[],x=[],y=-1,z=0,A=1,B=2;for(j=0;j<this.arguments.length;j++)if(h=this.arguments[j],i=h.value.eval(a),h.expand&&Array.isArray(i.value))for(i=i.value,k=0;k<i.length;k++)t.push({value:i[k]});else t.push({name:h.name,value:i});for(s=function(b){return b.matchArgs(null,a)},j=0;j<a.frames.length;j++)if((c=a.frames[j].find(this.selector,null,s)).length>0){for(n=!0,k=0;k<c.length;k++){for(d=c[k].rule,e=c[k].path,m=!1,l=0;l<a.frames.length;l++)if(!(d instanceof f)&&d===(a.frames[l].originalRuleset||a.frames[l])){m=!0;break}m||d.matchArgs(t,a)&&(o={mixin:d,group:b(d,e)},o.group!==y&&w.push(o),v=!0)}for(g.reset(),q=[0,0,0],k=0;k<w.length;k++)q[w[k].group]++;if(q[z]>0)p=B;else if(p=A,q[A]+q[B]>1)throw{type:"Runtime",message:"Ambiguous use of `default()` found when matching for `"+this.format(t)+"`",index:this.index,filename:this.currentFileInfo.filename};for(k=0;k<w.length;k++)if(o=w[k].group,o===z||o===p)try{d=w[k].mixin,d instanceof f||(r=d.originalRuleset||d,d=new f("",[],d.rules,null,(!1),null,r.visibilityInfo()),d.originalRuleset=r);var C=d.evalCall(a,t,this.important).rules;this._setVisibilityToReplacement(C),Array.prototype.push.apply(u,C)}catch(D){throw{message:D.message,index:this.index,filename:this.currentFileInfo.filename,
19830stack:D.stack}}if(v)return u}throw n?{type:"Runtime",message:"No matching definition was found for `"+this.format(t)+"`",index:this.index,filename:this.currentFileInfo.filename}:{type:"Name",message:this.selector.toCSS().trim()+" is undefined",index:this.index,filename:this.currentFileInfo.filename}},h.prototype._setVisibilityToReplacement=function(a){var b,c;if(this.blocksVisibility())for(b=0;b<a.length;b++)c=a[b],c.addVisibilityBlock()},h.prototype.format=function(a){return this.selector.toCSS().trim()+"("+(a?a.map(function(a){var b="";return a.name&&(b+=a.name+":"),b+=a.value.toCSS?a.value.toCSS():"???"}).join(", "):"")+")"},b.exports=h},{"../functions/default":20,"./mixin-definition":68,"./node":70,"./selector":77}],68:[function(a,b,c){var d=a("./selector"),e=a("./element"),f=a("./ruleset"),g=a("./rule"),h=a("./expression"),i=a("../contexts"),j=function(a,b,c,f,g,h,i){this.name=a,this.selectors=[new d([new e(null,a,this.index,this.currentFileInfo)])],this.params=b,this.condition=f,this.variadic=g,this.arity=b.length,this.rules=c,this._lookups={};var j=[];this.required=b.reduce(function(a,b){return!b.name||b.name&&!b.value?a+1:(j.push(b.name),a)},0),this.optionalParameters=j,this.frames=h,this.copyVisibilityInfo(i),this.allowRoot=!0};j.prototype=new f,j.prototype.type="MixinDefinition",j.prototype.evalFirst=!0,j.prototype.accept=function(a){this.params&&this.params.length&&(this.params=a.visitArray(this.params)),this.rules=a.visitArray(this.rules),this.condition&&(this.condition=a.visit(this.condition))},j.prototype.evalParams=function(a,b,c,d){var e,j,k,l,m,n,o,p,q=new f(null,null),r=this.params.slice(0),s=0;if(b.frames&&b.frames[0]&&b.frames[0].functionRegistry&&(q.functionRegistry=b.frames[0].functionRegistry.inherit()),b=new i.Eval(b,[q].concat(b.frames)),c)for(c=c.slice(0),s=c.length,k=0;k<s;k++)if(j=c[k],n=j&&j.name){for(o=!1,l=0;l<r.length;
19830l++)if(!d[l]&&n===r[l].name){d[l]=j.value.eval(a),q.prependRule(new g(n,j.value.eval(a))),o=!0;break}if(o){c.splice(k,1),k--;continue}throw{type:"Runtime",message:"Named argument for "+this.name+" "+c[k].name+" not found"}}for(p=0,k=0;k<r.length;k++)if(!d[k]){if(j=c&&c[p],n=r[k].name)if(r[k].variadic){for(e=[],l=p;l<s;l++)e.push(c[l].value.eval(a));q.prependRule(new g(n,new h(e).eval(a)))}else{if(m=j&&j.value)m=m.eval(a);else{if(!r[k].value)throw{type:"Runtime",message:"wrong number of arguments for "+this.name+" ("+s+" for "+this.arity+")"};m=r[k].value.eval(b),q.resetCache()}q.prependRule(new g(n,m)),d[k]=m}if(r[k].variadic&&c)for(l=p;l<s;l++)d[l]=c[l].value.eval(a);p++}return q},j.prototype.makeImportant=function(){var a=this.rules?this.rules.map(function(a){return a.makeImportant?a.makeImportant(!0):a}):this.rules,b=new j(this.name,this.params,a,this.condition,this.variadic,this.frames);return b},j.prototype.eval=function(a){return new j(this.name,this.params,this.rules,this.condition,this.variadic,this.frames||a.frames.slice(0))},j.prototype.evalCall=function(a,b,c){var d,e,j=[],k=this.frames?this.frames.concat(a.frames):a.frames,l=this.evalParams(a,new i.Eval(a,k),b,j);return l.prependRule(new g("@arguments",new h(j).eval(a))),d=this.rules.slice(0),e=new f(null,d),e.originalRuleset=this,e=e.eval(new i.Eval(a,[this,l].concat(k))),c&&(e=e.makeImportant()),e},j.prototype.matchCondition=function(a,b){return!(this.condition&&!this.condition.eval(new i.Eval(b,[this.evalParams(b,new i.Eval(b,this.frames?this.frames.concat(b.frames):b.frames),a,[])].concat(this.frames||[]).concat(b.frames))))},j.prototype.matchArgs=function(a,b){var c,d=a&&a.length||0,e=this.optionalParameters,f=a?a.reduce(function(a,b){return e.indexOf(b.name)<0?a+1:a},0):0;if(this.variadic){if(f<this.required-1)return!1}else{if(f<this.required)return!1;if(d>this.params.length)return!1}c=Math.min(f,this.arity);for(var g=0;g<c;g++)if(!this.params[g].name&&!this.params[g].variadic&&a[g].value.eval(b).toCSS()!=this.params[g].value.eval(b).toCSS())return!1;return!0},b.exports=j},{"../contexts":11,"./element":58,"./expression":59,"./rule":74,"./ruleset":76,"./selector":77}],69:[function(a,b,c){var d=a("./node"),e=a("./operation"),f=a("./dimension"),g=function(a){this.value=a};g.prototype=new d,g.prototype.type="Negative",g.prototype.genCSS=function(a,b){b.add("-"),this.value.genCSS(a,b)},g.prototype.eval=function(a){return a.isMathOn()?new e("*",[new f((-1)),this.value]).eval(a):new g(this.value.eval(a))},b.exports=g},{"./dimension":56,"./node":70,"./operation":71}],70:[function(a,b,c){var d=function(){};d.prototype.toCSS=function(a){var b=[];return this.genCSS(a,{add:function(a,c,d){b.push(a)},isEmpty:function(){return 0===b.length}}),b.join("")},d.prototype.genCSS=function(a,b){b.add(this.value)},d.prototype.accept=function(a){this.value=a.visit(this.value)},d.prototype.eval=function(){return this},d.prototype._operate=function(a,b,c,d){switch(b){case"+":return c+d;case"-":return c-d;case"*":return c*d;case"/":return c/d}},d.prototype.fround=function(a,b){var c=a&&a.numPrecision;return null==c?b:Number((b+2e-16).toFixed(c))},d.compare=function(a,b){if(a.compare&&"Quoted"!==b.type&&"Anonymous"!==b.type)return a.compare(b);if(b.compare)return-b.compare(a);if(a.type===b.type){if(a=a.value,b=b.value,!Array.isArray(a))return a===b?0:void 0;if(a.length===b.length){for(var c=0;c<a.length;c++)if(0!==d.compare(a[c],b[c]))return;return 0}}},d.numericCompare=function(a,b){return a<b?-1:a===b?0:a>b?1:void 0},d.prototype.blocksVisibility=function(){return null==this.visibilityBlocks&&(this.visibilityBlocks=0),0!==this.visibilityBlocks},d.prototype.addVisibilityBlock=function(){null==this.visibilityBlocks&&(this.visibilityBlocks=0),this.visibilityBlocks=this.visibilityBlocks+1},d.prototype.removeVisibilityBlock=function(){null==this.visibilityBlocks&&(this.visibilityBlocks=0),this.visibilityBlocks=this.visibilityBlocks-1},d.prototype.ensureVisibility=function(){this.nodeVisible=!0},d.prototype.ensureInvisibility=function(){this.nodeVisible=!1},d.prototype.isVisible=function(){return this.nodeVisible},d.prototype.visibilityInfo=function(){return{visibilityBlocks:this.visibilityBlocks,nodeVisible:this.nodeVisible}},d.prototype.copyVisibilityInfo=function(a){a&&(this.visibilityBlocks=a.visibilityBlocks,this.nodeVisible=a.nodeVisible)},b.exports=d},{}],71:[function(a,b,c){var d=a("./node"),e=a("./color"),f=a("./dimension"),g=function(a,b,c){this.op=a.trim(),this.operands=b,this.isSpaced=c};g.prototype=new d,g.prototype.type="Operation",g.prototype.accept=function(a){this.operands=a.visit(this.operands)},g.prototype.eval=function(a){var b=this.operands[0].eval(a),c=this.operands[1].eval(a);if(a.isMathOn()){if(b instanceof f&&c instanceof e&&(b=b.toColor()),c instanceof f&&b instanceof e&&(c=c.toColor()),!b.operate)throw{type:"Operation",message:"Operation on an invali
19830d type"};return b.operate(a,this.op,c)}return new g(this.op,[b,c],this.isSpaced)},g.prototype.genCSS=function(a,b){this.operands[0].genCSS(a,b),this.isSpaced&&b.add(" "),b.add(this.op),this.isSpaced&&b.add(" "),this.operands[1].genCSS(a,b)},b.exports=g},{"./color":50,"./dimension":56,"./node":70}],72:[function(a,b,c){var d=a("./node"),e=function(a){this.value=a};e.prototype=new d,e.prototype.type="Paren",e.prototype.genCSS=function(a,b){b.add("("),this.value.genCSS(a,b),b.add(")")},e.prototype.eval=function(a){return new e(this.value.eval(a))},b.exports=e},{"./node":70}],73:[function(a,b,c){var d=a("./node"),e=a("./js-eval-node"),f=a("./variable"),g=function(a,b,c,d,e){this.escaped=null==c||c,this.value=b||"",this.quote=a.charAt(0),this.index=d,this.currentFileInfo=e};g.prototype=new e,g.prototype.type="Quoted",g.prototype.genCSS=function(a,b){this.escaped||b.add(this.quote,this.currentFileInfo,this.index),b.add(this.value),this.escaped||b.add(this.quote)},g.prototype.containsVariables=function(){return this.value.match(/(`([^`]+)`)|@\{([\w-]+)\}/)},g.prototype.eval=function(a){function b(a,b,c){var d=a;do a=d,d=a.replace(b,c);while(a!==d);return d}var c=this,d=this.value,e=function(b,d){return String(c.evaluateJavaScript(d,a))},h=function(b,d){var e=new f("@"+d,c.index,c.currentFileInfo).eval(a,!0);return e instanceof g?e.value:e.toCSS()};return d=b(d,/`([^`]+)`/g,e),d=b(d,/@\{([\w-]+)\}/g,h),new g(this.quote+d+this.quote,d,this.escaped,this.index,this.currentFileInfo)},g.prototype.compare=function(a){return"Quoted"!==a.type||this.escaped||a.escaped?a.toCSS&&this.toCSS()===a.toCSS()?0:void 0:d.numericCompare(this.value,a.value)},b.exports=g},{"./js-eval-node":64,"./node":70,"./variable":82}],74:[function(a,b,c){function d(a,b){var c,d="",e=b.length,f={add:function(a){d+=a}};for(c=0;c<e;c++)b[c].eval(a).genCSS(a,f);return d}var e=a("./node"),f=a("./value"),g=a("./keyword"),h=function(a,b,c,d,g,h,i,j){this.name=a,this.value=b instanceof e?b:new f([b]),this.important=c?" "+c.trim():"",this.merge=d,this.index=g,this.currentFileInfo=h,this.inline=i||!1,this.variable=void 0!==j?j:a.charAt&&"@"===a.charAt(0),this.allowRoot=!0};h.prototype=new e,h.prototype.type="Rule",h.prototype.genCSS=function(a,b){b.add(this.name+(a.compress?":":": "),this.currentFileInfo,this.index);try{this.value.genCSS(a,b)}catch(c){throw c.index=this.index,c.filename=this.currentFileInfo.filename,c}b.add(this.important+(this.inline||a.lastRule&&a.compress?"":";"),this.currentFileInfo,this.index)},h.prototype.eval=function(a){var b,c=!1,e=this.name,f=this.variable;"string"!=typeof e&&(e=1===e.length&&e[0]instanceof g?e[0].value:d(a,e),f=!1),"font"!==e||a.strictMath||(c=!0,a.strictMath=!0);try{if(a.importantScope.push({}),b=this.value.eval(a),!this.variable&&"DetachedRuleset"===b.type)throw{message:"Rulesets cannot be evaluated on a property.",index:this.index,filename:this.currentFileInfo.filename};var i=this.important,j=a.importantScope.pop();return!i&&j.important&&(i=j.important),new h(e,b,i,this.merge,this.index,this.currentFileInfo,this.inline,f)}catch(k){throw"number"!=typeof k.index&&(k.index=this.index,k.filename=this.currentFileInfo.filename),k}finally{c&&(a.strictMath=!1)}},h.prototype.makeImportant=function(){return new h(this.name,this.value,"!important",this.merge,this.index,this.currentFileInfo,this.inline)},b.exports=h},{"./keyword":65,"./node":70,"./value":81}],75:[function(a,b,c){var d=a("./node"),e=a("./variable"),f=function(a){this.variable=a,this.allowRoot=!0};f.prototype=new d,f.prototype.type="RulesetCall",f.prototype.eval=function(a){var b=new e(this.variable).eval(a);return b.callEval(a)},b.exports=f},{"./node":70,"./variable":82}],76:[function(a,b,c){var d=a("./node"),e=a("./rule"),f=a("./selector"),g=a("./element"),h=a("./paren"),i=a("../contexts"),j=a("../functions/function-registry"),k=a("../functions/default"),l=a("./debug-info"),m=function(a,b,c,d){this.selectors=a,this.rules=b,this._lookups={},this.strictImports=c,this.copyVisibilityInfo(d),this.allowRoot=!0};m.prototype=new d,m.prototype.type="Ruleset",m.prototype.isRuleset=!0,m.prototype.isRulesetLike=!0,m.prototype.accept=function(a){this.paths?this.paths=a.visitArray(this.paths,!0):this.selectors&&(this.selectors=a.visitArray(this.selectors)),this.rules&&this.rules.length&&(this.rules=a.visitArray(this.rules))},m.prototype.eval=function(a){var b,c,d,f,g=this.selectors,h=!1;if(g&&(c=g.length)){for(b=[],k.error({type:"Syntax",message:"it is currently only allowed in parametric mixin guards,"}),f=0;f<c;
19830f++)d=g[f].eval(a),b.push(d),d.evaldCondition&&(h=!0);k.reset()}else h=!0;var i,l,n=this.rules?this.rules.slice(0):null,o=new m(b,n,this.strictImports,this.visibilityInfo());o.originalRuleset=this,o.root=this.root,o.firstRoot=this.firstRoot,o.allowImports=this.allowImports,this.debugInfo&&(o.debugInfo=this.debugInfo),h||(n.length=0),o.functionRegistry=function(a){for(var b,c=0,d=a.length;c!==d;++c)if(b=a[c].functionRegistry)return b;return j}(a.frames).inherit();var p=a.frames;p.unshift(o);var q=a.selectors;q||(a.selectors=q=[]),q.unshift(this.selectors),(o.root||o.allowImports||!o.strictImports)&&o.evalImports(a);var r=o.rules,s=r?r.length:0;for(f=0;f<s;f++)r[f].evalFirst&&(r[f]=r[f].eval(a));var t=a.mediaBlocks&&a.mediaBlocks.length||0;for(f=0;f<s;f++)"MixinCall"===r[f].type?(n=r[f].eval(a).filter(function(a){return!(a instanceof e&&a.variable)||!o.variable(a.name)}),r.splice.apply(r,[f,1].concat(n)),s+=n.length-1,f+=n.length-1,o.resetCache()):"RulesetCall"===r[f].type&&(n=r[f].eval(a).rules.filter(function(a){return!(a instanceof e&&a.variable)}),r.splice.apply(r,[f,1].concat(n)),s+=n.length-1,f+=n.length-1,o.resetCache());for(f=0;f<r.length;f++)i=r[f],i.evalFirst||(r[f]=i=i.eval?i.eval(a):i);for(f=0;f<r.length;f++)if(i=r[f],i instanceof m&&i.selectors&&1===i.selectors.length&&i.selectors[0].isJustParentSelector()){r.splice(f--,1);for(var u=0;u<i.rules.length;u++)l=i.rules[u],l.copyVisibilityInfo(i.visibilityInfo()),l instanceof e&&l.variable||r.splice(++f,0,l)}if(p.shift(),q.shift(),a.mediaBlocks)for(f=t;f<a.mediaBlocks.length;f++)a.mediaBlocks[f].bubbleSelectors(b);return o},m.prototype.evalImports=function(a){var b,c,d=this.rules;if(d)for(b=0;b<d.length;b++)"Import"===d[b].type&&(c=d[b].eval(a),c&&(c.length||0===c.length)?(d.splice.apply(d,[b,1].concat(c)),b+=c.length-1):d.splice(b,1,c),this.resetCache())},m.prototype.makeImportant=function(){var a=new m(this.selectors,this.rules.map(function(a){return a.makeImportant?a.makeImportant():a}),this.strictImports,this.visibilityInfo());return a},m.prototype.matchArgs=function(a){return!a||0===a.length},m.prototype.matchCondition=function(a,b){var c=this.selectors[this.selectors.length-1];return!!c.evaldCondition&&!(c.condition&&!c.condition.eval(new i.Eval(b,b.frames)))},m.prototype.resetCache=function(){this._rulesets=null,this._variables=null,this._lookups={}},m.prototype.variables=function(){return this._variables||(this._variables=this.rules?this.rules.reduce(function(a,b){if(b instanceof e&&b.variable===!0&&(a[b.name]=b),"Import"===b.type&&b.root&&b.root.variables){var c=b.root.variables();for(var d in c)c.hasOwnProperty(d)&&(a[d]=c[d])}return a},{}):{}),this._variables},m.prototype.variable=function(a){return this.variables()[a]},m.prototype.rulesets=function(){if(!this.rules)return[];var a,b,c=[],d=this.rules,e=d.length;for(a=0;a<e;a++)b=d[a],b.isRuleset&&c.push(b);return c},m.prototype.prependRule=function(a){var b=this.rules;b?b.unshift(a):this.rules=[a]},m.prototype.find=function(a,b,c){b=b||this;var d,e,g=[],h=a.toCSS();return h in this._lookups?this._lookups[h]:(this.rulesets().forEach(function(h){if(h!==b)for(var i=0;i<h.selectors.length;i++)if(d=a.match(h.selectors[i])){if(a.elements.length>d){if(!c||c(h)){e=h.find(new f(a.elements.slice(d)),b,c);for(var j=0;j<e.length;++j)e[j].path.push(h);Array.prototype.push.apply(g,e)}}else g.push({rule:h,path:[]});break}}),this._lookups[h]=g,g)},m.prototype.genCSS=function(a,b){function c(a){return"boolean"==typeof a.isRulesetLike?a.isRulesetLike:"function"==typeof a.isRulesetLike&&a.isRulesetLike()}var d,e,f,g,h,i=[],j=[];a.tabLevel=a.tabLevel||0,this.root||a.tabLevel++;var k,m=a.compress?"":Array(a.tabLevel+1).join("  "),n=a.compress?"":Array(a.tabLevel).join("  "),o=0,p=0;for(d=0;d<this.rules.length;d++)g=this.rules[d],"Comment"===g.type?(p===d&&p++,j.push(g)):g.isCharset&&g.isCharset()?(j.splice(o,0,g),o++,p++):"Import"===g.type?(j.splice(p,0,g),p++):j.push(g);if(j=i.concat(j),!this.root){f=l(a,this,n),f&&(b.add(f),b.add(n));var q,r=this.paths,s=r.length;for(k=a.compress?",":",\n"+n,d=0;d<s;d++)if(h=r[d],q=h.length)for(d>0&&b.add(k),a.firstSelector=!0,h[0].genCSS(a,b),a.firstSelector=!1,e=1;e<q;e++)h[e].genCSS(a,b);b.add((a.compress?"{":" {\n")+m)}for(d=0;d<j.length;d++){g=j[d],d+1===j.length&&(a.lastRule=!0);var t=a.lastRule;c(g)&&(a.lastRule=!1),g.genCSS?g.genCSS(a,b):g.value&&b.add(g.value.toString()),a.lastRule=t,a.lastRule?a.lastRule=!1:b.add(a.compress?"":"\n"+m)}this.root||(b.add(a.compress?"}":"\n"+n+"}"),a.tabLevel--),b.isEmpty()||a.compress||!this.firstRoot||b.add("\n")},m.prototype.joinSelectors=function(a,b,c){for(var d=0;d<c.length;d++)this.joinSelector(a,b,c[d])},m.prototype.joinSelector=function(a,b,c){function d(a,b){var c,d;if(0===a.length)c=new h(a[0]);else{var e=[];for(d=0;d<a.length;
19830d++)e.push(new g(null,a[d],b.index,b.currentFileInfo));c=new h(new f(e))}return c}function e(a,b){var c,d;return c=new g(null,a,b.index,b.currentFileInfo),d=new f([c])}function i(a,b,c,d){var e,f,h;if(e=[],a.length>0?(e=a.slice(0),f=e.pop(),h=d.createDerived(f.elements.slice(0))):h=d.createDerived([]),b.length>0){var i=c.combinator,j=b[0].elements[0];i.emptyOrWhitespace&&!j.combinator.emptyOrWhitespace&&(i=j.combinator),h.elements.push(new g(i,j.value,c.index,c.currentFileInfo)),h.elements=h.elements.concat(b[0].elements.slice(1))}if(0!==h.elements.length&&e.push(h),b.length>1){var k=b.slice(1);k=k.map(function(a){return a.createDerived(a.elements,[])}),e=e.concat(k)}return e}function j(a,b,c,d,e){var f;for(f=0;f<a.length;f++){var g=i(a[f],b,c,d);e.push(g)}return e}function k(a,b){var c,d;if(0!==a.length){if(0===b.length)return void b.push([new f(a)]);for(c=0;c<b.length;c++)d=b[c],d.length>0?d[d.length-1]=d[d.length-1].createDerived(d[d.length-1].elements.concat(a)):d.push(new f(a))}}function l(a,b,c){function f(a){var b;return"Paren"!==a.value.type?null:(b=a.value.value,"Selector"!==b.type?null:b)}var h,m,n,o,p,q,r,s,t,u,v=!1;for(o=[],p=[[]],h=0;h<c.elements.length;h++)if(s=c.elements[h],"&"!==s.value){var w=f(s);if(null!=w){k(o,p);var x,y=[],z=[];for(x=l(y,b,w),v=v||x,n=0;n<y.length;n++){var A=e(d(y[n],s),s);j(p,[A],s,c,z)}p=z,o=[]}else o.push(s)}else{for(v=!0,q=[],k(o,p),m=0;m<p.length;m++)if(r=p[m],0===b.length)r.length>0&&r[0].elements.push(new g(s.combinator,"",s.index,s.currentFileInfo)),q.push(r);else for(n=0;n<b.length;n++){var B=i(r,b[n],s,c);q.push(B)}p=q,o=[]}for(k(o,p),h=0;h<p.length;h++)t=p[h].length,t>0&&(a.push(p[h]),u=p[h][t-1],p[h][t-1]=u.createDerived(u.elements,c.extendList));return v}function m(a,b){var c=b.createDerived(b.elements,b.extendList,b.evaldCondition);return c.copyVisibilityInfo(a),c}var n,o,p;if(o=[],p=l(o,b,c),!p)if(b.length>0)for(o=[],n=0;n<b.length;n++){var q=b[n].map(m.bind(this,c.visibilityInfo()));q.push(c),o.push(q)}else o=[[c]];for(n=0;n<o.length;n++)a.push(o[n])},b.exports=m},{"../contexts":11,"../functions/default":20,"../functions/function-registry":22,"./debug-info":54,"./element":58,"./node":70,"./paren":72,"./rule":74,"./selector":77}],77:[function(a,b,c){var d=a("./node"),e=a("./element"),f=function(a,b,c,d,e,f){this.elements=a,this.extendList=b,this.condition=c,this.currentFileInfo=e||{},c||(this.evaldCondition=!0),this.copyVisibilityInfo(f)};f.prototype=new d,f.prototype.type="Selector",f.prototype.accept=function(a){this.elements&&(this.elements=a.visitArray(this.elements)),this.extendList&&(this.extendList=a.visitArray(this.extendList)),this.condition&&(this.condition=a.visit(this.condition))},f.prototype.createDerived=function(a,b,c){var d=this.visibilityInfo();c=null!=c?c:this.evaldCondition;var e=new f(a,b||this.extendList,null,this.index,this.currentFileInfo,d);return e.evaldCondition=c,e.mediaEmpty=this.mediaEmpty,e},f.prototype.createEmptySelectors=function(){var a=new e("","&",this.index,this.currentFileInfo),b=[new f([a],null,null,this.index,this.currentFileInfo)];return b[0].mediaEmpty=!0,b},f.prototype.match=function(a){var b,c,d=this.elements,e=d.length;if(a.CacheElements(),b=a._elements.length,0===b||e<b)return 0;for(c=0;c<b;c++)if(d[c].value!==a._elements[c])return 0;return b},f.prototype.CacheElements=function(){if(!this._elements){var a=this.elements.map(function(a){return a.combinator.value+(a.value.value||a.value)}).join("").match(/[,&#\*\.\w-]([\w-]|(\\.))*/g);a?"&"===a[0]&&a.shift():a=[],this._elements=a}},f.prototype.isJustParentSelector=function(){return!this.mediaEmpty&&1===this.elements.length&&"&"===this.elements[0].value&&(" "===this.elements[0].combinator.value||""===this.elements[0].combinator.value)},f.prototype.eval=function(a){var b=this.condition&&this.condition.eval(a),c=this.elements,d=this.extendList;return c=c&&c.map(function(b){return b.eval(a)}),d=d&&d.map(function(b){return b.eval(a)}),this.createDerived(c,d,b)},f.prototype.genCSS=function(a,b){var c,d;if(a&&a.firstSelector||""!==this.elements[0].combinator.value||b.add(" ",this.currentFileInfo,this.index),!this._css)for(c=0;c<this.elements.length;c++)d=this.elements[c],d.genCSS(a,b)},f.prototype.getIsOutput=function(){return this.evaldCondition},b.exports=f},{"./element":58,"./node":70}],78:[function(a,b,c){var d=a("./node"),e=function(a){this.value=a};
19830e.prototype=new d,e.prototype.type="UnicodeDescriptor",b.exports=e},{"./node":70}],79:[function(a,b,c){var d=a("./node"),e=a("../data/unit-conversions"),f=function(a,b,c){this.numerator=a?a.slice(0).sort():[],this.denominator=b?b.slice(0).sort():[],c?this.backupUnit=c:a&&a.length&&(this.backupUnit=a[0])};f.prototype=new d,f.prototype.type="Unit",f.prototype.clone=function(){return new f(this.numerator.slice(0),this.denominator.slice(0),this.backupUnit)},f.prototype.genCSS=function(a,b){var c=a&&a.strictUnits;1===this.numerator.length?b.add(this.numerator[0]):!c&&this.backupUnit?b.add(this.backupUnit):!c&&this.denominator.length&&b.add(this.denominator[0])},f.prototype.toString=function(){var a,b=this.numerator.join("*");for(a=0;a<this.denominator.length;a++)b+="/"+this.denominator[a];return b},f.prototype.compare=function(a){return this.is(a.toString())?0:void 0},f.prototype.is=function(a){return this.toString().toUpperCase()===a.toUpperCase()},f.prototype.isLength=function(){return Boolean(this.toCSS().match(/px|em|%|in|cm|mm|pc|pt|ex/))},f.prototype.isEmpty=function(){return 0===this.numerator.length&&0===this.denominator.length},f.prototype.isSingular=function(){return this.numerator.length<=1&&0===this.denominator.length},f.prototype.map=function(a){var b;for(b=0;b<this.numerator.length;b++)this.numerator[b]=a(this.numerator[b],!1);for(b=0;b<this.denominator.length;b++)this.denominator[b]=a(this.denominator[b],!0)},f.prototype.usedUnits=function(){var a,b,c,d={};b=function(b){return a.hasOwnProperty(b)&&!d[c]&&(d[c]=b),b};for(c in e)e.hasOwnProperty(c)&&(a=e[c],this.map(b));return d},f.prototype.cancel=function(){var a,b,c={};for(b=0;b<this.numerator.length;b++)a=this.numerator[b],c[a]=(c[a]||0)+1;for(b=0;b<this.denominator.length;b++)a=this.denominator[b],c[a]=(c[a]||0)-1;this.numerator=[],this.denominator=[];for(a in c)if(c.hasOwnProperty(a)){var d=c[a];if(d>0)for(b=0;b<d;b++)this.numerator.push(a);else if(d<0)for(b=0;b<-d;b++)this.denominator.push(a)}this.numerator.sort(),this.denominator.sort()},b.exports=f},{"../data/unit-conversions":14,"./node":70}],80:[function(a,b,c){var d=a("./node"),e=function(a,b,c,d){this.value=a,this.currentFileInfo=c,this.index=b,this.isEvald=d};e.prototype=new d,e.prototype.type="Url",e.prototype.accept=function(a){this.value=a.visit(this.value)},e.prototype.genCSS=function(a,b){b.add("url("),this.value.genCSS(a,b),b.add(")")},e.prototype.eval=function(a){var b,c=this.value.eval(a);if(!this.isEvald&&(b=this.currentFileInfo&&this.currentFileInfo.rootpath,b&&"string"==typeof c.value&&a.isPathRelative(c.value)&&(c.quote||(b=b.replace(/[\(\)'"\s]/g,function(a){return"\\"+a})),c.value=b+c.value),c.value=a.normalizePath(c.value),a.urlArgs&&!c.value.match(/^\s*data:/))){var d=c.value.indexOf("?")===-1?"?":"&",f=d+a.urlArgs;c.value.indexOf("#")!==-1?c.value=c.value.replace("#",f+"#"):c.value+=f}return new e(c,this.index,this.currentFileInfo,(!0))},b.exports=e},{"./node":70}],81:[function(a,b,c){var d=a("./node"),e=function(a){if(this.value=a,!a)throw new Error("Value requires an array argument")};e.prototype=new d,e.prototype.type="Value",e.prototype.accept=function(a){this.value&&(this.value=a.visitArray(this.value))},e.prototype.eval=function(a){return 1===this.value.length?this.value[0].eval(a):new e(this.value.map(function(b){return b.eval(a)}))},e.prototype.genCSS=function(a,b){var c;for(c=0;c<this.value.length;c++)this.value[c].genCSS(a,b),c+1<this.value.length&&b.add(a&&a.compress?",":", ")},b.exports=e},{"./node":70}],82:[function(a,b,c){var d=a("./node"),e=function(a,b,c){this.name=a,this.index=b,this.currentFileInfo=c||{}};e.prototype=new d,e.prototype.type="Variable",e.prototype.eval=function(a){var b,c=this.name;if(0===c.indexOf("@@")&&(c="@"+new e(c.slice(1),this.index,this.currentFileInfo).eval(a).value),this.evaluating)throw{type:"Name",message:"Recursive variable definition for "+c,filename:this.currentFileInfo.filename,index:this.index};if(this.evaluating=!0,b=this.find(a.frames,function(b){var d=b.variable(c);if(d){if(d.important){var e=a.importantScope[a.importantScope.length-1];e.important=d.important}return d.value.eval(a)}}))return this.evaluating=!1,b;throw{type:"Name",message:"variable "+c+" is undefined",filename:this.currentFileInfo.filename,index:this.index}},e.prototype.find=function(a,b){for(var c,d=0;d<a.length;d++)if(c=b.call(a,a[d]))return c;return null},b.exports=e},{"./node":70}],83:[function(a,b,c){b.exports={getLocation:function(a,b){for(var c=a+1,d=null,e=-1;--c>=0&&"\n"!==b.charAt(c);)e++;return"number"==typeof a&&(d=(b.slice(0,a).match(/\n/g)||"").length),{line:d,column:e}}}},{}],84:[function(a,b,c){var d=a("../tree"),e=a("./visitor"),f=a("../logger"),g=function(){this._visitor=new e(this),this.contexts=[],this.allExtendsStack=[[]]};g.prototype={run:function(a){return a=this._visitor.visit(a),a.allExtends=this.allExtendsStack[0],a},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1}
19830,visitRuleset:function(a,b){if(!a.root){var c,e,f,g,h=[],i=a.rules,j=i?i.length:0;for(c=0;c<j;c++)a.rules[c]instanceof d.Extend&&(h.push(i[c]),a.extendOnEveryPath=!0);var k=a.paths;for(c=0;c<k.length;c++){var l=k[c],m=l[l.length-1],n=m.extendList;for(g=n?n.slice(0).concat(h):h,g&&(g=g.map(function(a){return a.clone()})),e=0;e<g.length;e++)this.foundExtends=!0,f=g[e],f.findSelfSelectors(l),f.ruleset=a,0===e&&(f.firstExtendOnThisSelectorPath=!0),this.allExtendsStack[this.allExtendsStack.length-1].push(f)}this.contexts.push(a.selectors)}},visitRulesetOut:function(a){a.root||(this.contexts.length=this.contexts.length-1)},visitMedia:function(a,b){a.allExtends=[],this.allExtendsStack.push(a.allExtends)},visitMediaOut:function(a){this.allExtendsStack.length=this.allExtendsStack.length-1},visitDirective:function(a,b){a.allExtends=[],this.allExtendsStack.push(a.allExtends)},visitDirectiveOut:function(a){this.allExtendsStack.length=this.allExtendsStack.length-1}};var h=function(){this._visitor=new e(this)};h.prototype={run:function(a){var b=new g;if(this.extendIndices={},b.run(a),!b.foundExtends)return a;a.allExtends=a.allExtends.concat(this.doExtendChaining(a.allExtends,a.allExtends)),this.allExtendsStack=[a.allExtends];var c=this._visitor.visit(a);return this.checkExtendsForNonMatched(a.allExtends),c},checkExtendsForNonMatched:function(a){var b=this.extendIndices;a.filter(function(a){return!a.hasFoundMatches&&1==a.parent_ids.length}).forEach(function(a){var c="_unknown_";try{c=a.selector.toCSS({})}catch(d){}b[a.index+" "+c]||(b[a.index+" "+c]=!0,f.warn("extend '"+c+"' has no matches"))})},doExtendChaining:function(a,b,c){var e,f,g,h,i,j,k,l,m=[],n=this;for(c=c||0,e=0;e<a.length;e++)for(f=0;f<b.length;f++)j=a[e],k=b[f],j.parent_ids.indexOf(k.object_id)>=0||(i=[k.selfSelectors[0]],g=n.findMatch(j,i),g.length&&(j.hasFoundMatches=!0,j.selfSelectors.forEach(function(a){var b=k.visibilityInfo();h=n.extendSelector(g,i,a,j.isVisible()),l=new d.Extend(k.selector,k.option,0,k.currentFileInfo,b),l.selfSelectors=h,h[h.length-1].extendList=[l],m.push(l),l.ruleset=k.ruleset,l.parent_ids=l.parent_ids.concat(k.parent_ids,j.parent_ids),k.firstExtendOnThisSelectorPath&&(l.firstExtendOnThisSelectorPath=!0,k.ruleset.paths.push(h))})));if(m.length){if(this.extendChainCount++,c>100){var o="{unable to calculate}",p="{unable to calculate}";try{o=m[0].selfSelectors[0].toCSS(),p=m[0].selector.toCSS()}catch(q){}throw{message:"extend circular reference detected. One of the circular extends is currently:"+o+":extend("+p+")"}}return m.concat(n.doExtendChaining(m,b,c+1))}return m},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitSelector:function(a,b){b.visitDeeper=!1},visitRuleset:function(a,b){if(!a.root){var c,d,e,f,g=this.allExtendsStack[this.allExtendsStack.length-1],h=[],i=this;for(e=0;e<g.length;e++)for(d=0;d<a.paths.length;d++)if(f=a.paths[d],!a.extendOnEveryPath){var j=f[f.length-1].extendList;j&&j.length||(c=this.findMatch(g[e],f),c.length&&(g[e].hasFoundMatches=!0,g[e].selfSelectors.forEach(function(a){var b;b=i.extendSelector(c,f,a,g[e].isVisible()),h.push(b)})))}a.paths=a.paths.concat(h)}},findMatch:function(a,b){var c,d,e,f,g,h,i,j=this,k=a.selector.elements,l=[],m=[];for(c=0;c<b.length;c++)for(d=b[c],e=0;e<d.elements.length;e++)for(f=d.elements[e],(a.allowBefore||0===c&&0===e)&&l.push({pathIndex:c,index:e,matched:0,initialCombinator:f.combinator}),h=0;h<l.length;h++)i=l[h],g=f.combinator.value,""===g&&0===e&&(g=" "),!j.isElementValuesEqual(k[i.matched].value,f.value)||i.matched>0&&k[i.matched].combinator.value!==g?i=null:i.matched++,i&&(i.finished=i.matched===k.length,i.finished&&!a.allowAfter&&(e+1<d.elements.length||c+1<b.length)&&(i=null)),i?i.finished&&(i.length=k.length,i.endPathIndex=c,i.endPathElementIndex=e+1,l.length=0,m.push(i)):(l.splice(h,1),h--);return m},isElementValuesEqual:function(a,b){if("string"==typeof a||"string"==typeof b)return a===b;if(a instanceof d.Attribute)return a.op===b.op&&a.key===b.key&&(a.value&&b.value?(a=a.value.value||a.value,b=b.value.value||b.value,a===b):!a.value&&!b.value);if(a=a.value,b=b.value,a instanceof d.Selector){if(!(b instanceof d.Selector)||a.elements.length!==b.elements.length)return!1;for(var c=0;c<a.elements.length;c++){if(a.elements[c].combinator.value!==b.elements[c].combinator.value&&(0!==c||(a.elements[c].combinator.value||" ")!==(b.elements[c].combinator.value||" ")))return!1;if(!this.isElementValuesEqual(a.elements[c].value,b.elements[c].value))return!1}return!0}return!1},extendSelector:function(a,b,c,e){var f,g,h,i,j,k=0,l=0,m=[];for(f=0;f<a.length;f++)i=a[f],g=b[i.pathIndex],h=new d.Element(i.initialCombinator,c.elements[0].value,c.elements[0].index,c.elements[0].currentFileInfo),i.pathIndex>k&&l>0&&(m[m.length-1].elements=m[m.length-1].elements.concat(b[k].elements.slice(l)),l=0,k++),j=g.elements.slice(l,i.index).concat([h]).concat(c.elements.slice(1)),k===i.pathIndex&&f>0?m[m.length-1].elements=m[m.length-1].elements.concat(j):(m=m.concat(b.slice(k,i.pathIndex)),m.push(new d.Selector(j))),k=i.endPathIndex,l=i.endPathElementIndex,l>=b[k].elements.length&&(l=0,k++);return k<b.length&&l>0&&(m[m.length-1].elements=m[m.length-1].elements.concat(b[k].elements.slice(l)),k++),m=m.concat(b.slice(k,b.length)),m=m.map(function(a){var b=a.createDerived(a.elements);return e?b.ensureVisibility():b.ensureInvisibility(),b})},visitMedia:function(a,b){var c=a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);c=c.concat(this.doExtendChaining(c,a.allExtends)),this.allExtendsStack.push(c)},visitMediaOut:function(a){var b=this.allExtendsStack.length-1;this.allExtendsStack.length=b},visitDirective:function(a,b){var c=a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);c=c.concat(this.doExtendChaining(c,a.allExtends)),this.allExtendsStack.push(c)},visitDirectiveOut:function(a){var b=this.allExtendsStack.length-1;this.allExtendsStack.length=b}},b.exports=h},{"../logger":33,"../tree":62,"./visitor":91}],85:[function(a,b,c){function d(a){this.imports=[],this.variableImports=[],this._onSequencerEmpty=a,this._currentDepth=0}d.prototype.addImport=function(a){var b=this,c={callback:a,args:null,isReady:!1};return this.imports.push(c),function(){c.args=Array.prototype.slice.call(arguments,0),c.isReady=!0,b.tryRun()}},d.prototype.addVariableImport=function(a){this.variableImports.push(a)},d.prototype.tryRun=function(){this._currentDepth++;try{for(;;){for(;this.imports.length>0;){var a=this.imports[0];if(!a.isReady)return;
19831this.imports=this.imports.slice(1),a.callback.apply(null,a.args)}if(0===this.variableImports.length)break;var b=this.variableImports[0];this.variableImports=this.variableImports.slice(1),b()}}finally{this._currentDepth--}0===this._currentDepth&&this._onSequencerEmpty&&this._onSequencerEmpty()}
19831,b.exports=d},{}],86:[function(a,b,c){var d=a("../contexts"),e=a("./visitor"),f=a("./import-sequencer"),g=function(a,b){this._visitor=new e(this),this._importer=a,this._finish=b,this.context=new d.Eval,this.importCount=0,this.onceFileDetectionMap={},this.recursionDetector={},this._sequencer=new f(this._onSequencerEmpty.bind(this))};g.prototype={isReplacing:!1,run:function(a){try{this._visitor.visit(a)}catch(b){this.error=b}this.isFinished=!0,this._sequencer.tryRun()},_onSequencerEmpty:function(){this.isFinished&&this._finish(this.error)},visitImport:function(a,b){var c=a.options.inline;if(!a.css||c){var e=new d.Eval(this.context,this.context.frames.slice(0)),f=e.frames[0];this.importCount++,a.isVariableImport()?this._sequencer.addVariableImport(this.processImportNode.bind(this,a,e,f)):this.processImportNode(a,e,f)}b.visitDeeper=!1},processImportNode:function(a,b,c){var d,e=a.options.inline;try{d=a.evalForImport(b)}catch(f){f.filename||(f.index=a.index,f.filename=a.currentFileInfo.filename),a.css=!0,a.error=f}if(!d||d.css&&!e)this.importCount--,this.isFinished&&this._sequencer.tryRun();else{d.options.multiple&&(b.importMultiple=!0);for(var g=void 0===d.css,h=0;h<c.rules.length;h++)if(c.rules[h]===a){c.rules[h]=d;break}var i=this.onImported.bind(this,d,b),j=this._sequencer.addImport(i);this._importer.push(d.getPath(),g,d.currentFileInfo,d.options,j)}},onImported:function(a,b,c,d,e,f){c&&(c.filename||(c.index=a.index,c.filename=a.currentFileInfo.filename),this.error=c);var g=this,h=a.options.inline,i=a.options.plugin,j=a.options.optional,k=e||f in g.recursionDetector;if(b.importMultiple||(a.skip=!!k||function(){return f in g.onceFileDetectionMap||(g.onceFileDetectionMap[f]=!0,!1)}),!f&&j&&(a.skip=!0),d&&(a.root=d,a.importedFilename=f,!h&&!i&&(b.importMultiple||!k))){g.recursionDetector[f]=!0;var l=this.context;this.context=b;try{this._visitor.visit(d)}catch(c){this.error=c}this.context=l}g.importCount--,g.isFinished&&g._sequencer.tryRun()},visitRule:function(a,b){"DetachedRuleset"===a.value.type?this.context.frames.unshift(a):b.visitDeeper=!1},visitRuleOut:function(a){"DetachedRuleset"===a.value.type&&this.context.frames.shift()},visitDirective:function(a,b){this.context.frames.unshift(a)},visitDirectiveOut:function(a){this.context.frames.shift()},visitMixinDefinition:function(a,b){this.context.frames.unshift(a)},visitMixinDefinitionOut:function(a){this.context.frames.shift()},visitRuleset:function(a,b){this.context.frames.unshift(a)},visitRulesetOut:function(a){this.context.frames.shift()},visitMedia:function(a,b){this.context.frames.unshift(a.rules[0])},visitMediaOut:function(a){this.context.frames.shift()}},b.exports=g},{"../contexts":11,"./import-sequencer":85,"./visitor":91}],87:[function(a,b,c){var d={Visitor:a("./visitor"),ImportVisitor:a("./import-visitor"),MarkVisibleSelectorsVisitor:a("./set-tree-visibility-visitor"),ExtendVisitor:a("./extend-visitor"),JoinSelectorVisitor:a("./join-selector-visitor"),ToCSSVisitor:a("./to-css-visitor")};b.exports=d},{"./extend-visitor":84,"./import-visitor":86,"./join-selector-visitor":88,"./set-tree-visibility-visitor":89,"./to-css-visitor":90,"./visitor":91}],88:[function(a,b,c){var d=a("./visitor"),e=function(){this.contexts=[[]],this._visitor=new d(this)};e.prototype={run:function(a){return this._visitor.visit(a)},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitRuleset:function(a,b){var c,d=this.contexts[this.contexts.length-1],e=[];this.contexts.push(e),a.root||(c=a.selectors,c&&(c=c.filter(function(a){return a.getIsOutput()}),a.selectors=c.length?c:c=null,c&&a.joinSelectors(e,d,c)),c||(a.rules=null),a.paths=e)},visitRulesetOut:function(a){this.contexts.length=this.contexts.length-1},visitMedia:function(a,b){var c=this.contexts[this.contexts.length-1];a.rules[0].root=0===c.length||c[0].multiMedia},visitDirective:function(a,b){var c=this.contexts[this.contexts.length-1];a.rules&&a.rules.length&&(a.rules[0].root=a.isRooted||0===c.length||null)}},b.exports=e},{"./visitor":91}],89:[function(a,b,c){var d=function(a){this.visible=a};d.prototype.run=function(a){this.visit(a)}
19831,d.prototype.visitArray=function(a){if(!a)return a;var b,c=a.length;for(b=0;b<c;b++)this.visit(a[b]);return a},d.prototype.visit=function(a){return a?a.constructor===Array?this.visitArray(a):!a.blocksVisibility||a.blocksVisibility()?a:(this.visible?a.ensureVisibility():a.ensureInvisibility(),a.accept(this),a):a},b.exports=d},{}],90:[function(a,b,c){var d=a("../tree"),e=a("./visitor"),f=function(a){this._visitor=new e(this),this._context=a};f.prototype={containsSilentNonBlockedChild:function(a){var b;if(null==a)return!1;for(var c=0;c<a.length;c++)if(b=a[c],b.isSilent&&b.isSilent(this._context)&&!b.blocksVisibility())return!0;return!1},keepOnlyVisibleChilds:function(a){null!=a&&null!=a.rules&&(a.rules=a.rules.filter(function(a){return a.isVisible()}))},isEmpty:function(a){return null==a||null==a.rules||0===a.rules.length},hasVisibleSelector:function(a){return null!=a&&null!=a.paths&&a.paths.length>0},resolveVisibility:function(a,b){if(!a.blocksVisibility()){if(this.isEmpty(a)&&!this.containsSilentNonBlockedChild(b))return;return a}var c=a.rules[0];if(this.keepOnlyVisibleChilds(c),!this.isEmpty(c))return a.ensureVisibility(),a.removeVisibilityBlock(),a}
19831,isVisibleRuleset:function(a){return!!a.firstRoot||!this.isEmpty(a)&&!(!a.root&&!this.hasVisibleSelector(a))}};var g=function(a){this._visitor=new e(this),this._context=a,this.utils=new f(a)};g.prototype={isReplacing:!0,run:function(a){return this._visitor.visit(a)},visitRule:function(a,b){if(!a.blocksVisibility()&&!a.variable)return a},visitMixinDefinition:function(a,b){a.frames=[]},visitExtend:function(a,b){},visitComment:function(a,b){if(!a.blocksVisibility()&&!a.isSilent(this._context))return a},visitMedia:function(a,b){var c=a.rules[0].rules;return a.accept(this._visitor),b.visitDeeper=!1,this.utils.resolveVisibility(a,c)},visitImport:function(a,b){if(!a.blocksVisibility())return a},visitDirective:function(a,b){return a.rules&&a.rules.length?this.visitDirectiveWithBody(a,b):this.visitDirectiveWithoutBody(a,b)},visitDirectiveWithBody:function(a,b){function c(a){var b=a.rules;return 1===b.length&&(!b[0].paths||0===b[0].paths.length)}function d(a){var b=a.rules;return c(a)?b[0].rules:b}var e=d(a);return a.accept(this._visitor),b.visitDeeper=!1,this.utils.isEmpty(a)||this._mergeRules(a.rules[0].rules),this.utils.resolveVisibility(a,e)},visitDirectiveWithoutBody:function(a,b){if(!a.blocksVisibility()){if("@charset"===a.name){if(this.charset){if(a.debugInfo){var c=new d.Comment("/* "+a.toCSS(this._context).replace(/\n/g,"")+" */\n");return c.debugInfo=a.debugInfo,this._visitor.visit(c)}return}this.charset=!0}return a}},checkValidNodes:function(a,b){if(a)for(var c=0;c<a.length;c++){var e=a[c];if(b&&e instanceof d.Rule&&!e.variable)throw{message:"Properties must be inside selector blocks. They cannot be in the root",index:e.index,filename:e.currentFileInfo&&e.currentFileInfo.filename};if(e instanceof d.Call)throw{message:"Function '"+e.name+"' is undefined",index:e.index,filename:e.currentFileInfo&&e.currentFileInfo.filename};if(e.type&&!e.allowRoot)throw{message:e.type+" node returned by a function is not valid here",index:e.index,filename:e.currentFileInfo&&e.currentFileInfo.filename}}},visitRuleset:function(a,b){var c,d=[];if(this.checkValidNodes(a.rules,a.firstRoot),a.root)a.accept(this._visitor),b.visitDeeper=!1;else{this._compileRulesetPaths(a);for(var e=a.rules,f=e?e.length:0,g=0;g<f;)c=e[g],c&&c.rules?(d.push(this._visitor.visit(c)),e.splice(g,1),f--):g++;f>0?a.accept(this._visitor):a.rules=null,b.visitDeeper=!1}return a.rules&&(this._mergeRules(a.rules),this._removeDuplicateRules(a.rules)),this.utils.isVisibleRuleset(a)&&(a.ensureVisibility(),d.splice(0,0,a)),1===d.length?d[0]:d},_compileRulesetPaths:function(a){a.paths&&(a.paths=a.paths.filter(function(a){var b;for(" "===a[0].elements[0].combinator.value&&(a[0].elements[0].combinator=new d.Combinator("")),b=0;b<a.length;b++)if(a[b].isVisible()&&a[b].getIsOutput())return!0;return!1}))},_removeDuplicateRules:function(a){if(a){var b,c,e,f={};for(e=a.length-1;e>=0;e--)if(c=a[e],c instanceof d.Rule)if(f[c.name]){b=f[c.name],b instanceof d.Rule&&(b=f[c.name]=[f[c.name].toCSS(this._context)]);var g=c.toCSS(this._context);b.indexOf(g)!==-1?a.splice(e,1):b.push(g)}else f[c.name]=c}},_mergeRules:function(a){if(a){for(var b,c,e,f={},g=0;g<a.length;g++)c=a[g],c instanceof d.Rule&&c.merge&&(e=[c.name,c.important?"!":""].join(","),f[e]?a.splice(g--,1):f[e]=[],f[e].push(c));Object.keys(f).map(function(a){function e(a){return new d.Expression(a.map(function(a){return a.value}))}function g(a){return new d.Value(a.map(function(a){return a}))}if(b=f[a],b.length>1){c=b[0];var h=[],i=[];b.map(function(a){"+"===a.merge&&(i.length>0&&h.push(e(i)),i=[]),i.push(a)}),h.push(e(i)),c.value=g(h)}})}},visitAnonymous:function(a,b){if(!a.blocksVisibility())return a.accept(this._visitor),a}},b.exports=g},{"../tree":62,"./visitor":91}],91:[function(a,b,c){function d(a){return a}function e(a,b){var c,d;for(c in a)if(a.hasOwnProperty(c))switch(d=a[c],typeof d){case"function":d.prototype&&d.prototype.type&&(d.prototype.typeIndex=b++);break;case"object":b=e(d,b)}return b}var f=a("../tree"),g={visitDeeper:!0},h=!1,i=function(a){this._implementation=a,this._visitFnCache=[],h||(e(f,1),h=!0)};
19831i.prototype={visit:function(a){if(!a)return a;var b=a.typeIndex;if(!b)return a;var c,e=this._visitFnCache,f=this._implementation,h=b<<1,i=1|h,j=e[h],k=e[i],l=g;if(l.visitDeeper=!0,j||(c="visit"+a.type,j=f[c]||d,k=f[c+"Out"]||d,e[h]=j,e[i]=k),j!==d){var m=j.call(f,a,l);f.isReplacing&&(a=m)}return l.visitDeeper&&a&&a.accept&&a.accept(this),k!=d&&k.call(f,a),a},visitArray:function(a,b){if(!a)return a;var c,d=a.length;if(b||!this._implementation.isReplacing){for(c=0;c<d;c++)this.visit(a[c]);return a}var e=[];for(c=0;c<d;c++){var f=this.visit(a[c]);void 0!==f&&(f.splice?f.length&&this.flatten(f,e):e.push(f))}return e},flatten:function(a,b){b||(b=[]);var c,d,e,f,g,h;for(d=0,c=a.length;d<c;d++)if(e=a[d],void 0!==e)if(e.splice)for(g=0,f=e.length;g<f;g++)h=e[g],void 0!==h&&(h.splice?h.length&&this.flatten(h,b):b.push(h));else b.push(e);return b}},b.exports=i},{"../tree":62}],92:[function(a,b,c){"use strict";function d(){if(i.length)throw i.shift()}function e(a){var b;b=h.length?h.pop():new f,b.task=a,g(b)}function f(){this.task=null}var g=a("./raw"),h=[],i=[],j=g.makeRequestCallFromTimer(d);b.exports=e,f.prototype.call=function(){try{this.task.call()}catch(a){e.onerror?e.onerror(a):(i.push(a),j())}finally{this.task=null,h[h.length]=this}}},{"./raw":93}],93:[function(a,b,c){(function(a){"use strict";function c(a){h.length||(g(),i=!0),h[h.length]=a}function d(){for(;j<h.length;){var a=j;if(j+=1,h[a].call(),j>k){for(var b=0,c=h.length-j;b<c;b++)h[b]=h[b+j];h.length-=j,j=0}}h.length=0,j=0,i=!1}function e(a){var b=1,c=new l(a),d=document.createTextNode("");return c.observe(d,{characterData:!0}),function(){b=-b,d.data=b}}function f(a){return function(){function b(){clearTimeout(c),clearInterval(d),a()}var c=setTimeout(b,0),d=setInterval(b,50)}}b.exports=c;var g,h=[],i=!1,j=0,k=1024,l=a.MutationObserver||a.WebKitMutationObserver;g="function"==typeof l?e(d):f(d),c.requestFlush=g,c.makeRequestCallFromTimer=f}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],94:[function(a,b,c){"use strict";function d(){}function e(a){try{return a.then}catch(b){return r=b,s}}function f(a,b){try{return a(b)}catch(c){return r=c,s}}function g(a,b,c){try{a(b,c)}catch(d){return r=d,s}}function h(a){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof a)throw new TypeError("not a function");this._45=0,this._81=0,this._65=null,this._54=null,a!==d&&p(a,this)}function i(a,b,c){return new a.constructor(function(e,f){var g=new h(d);g.then(e,f),j(a,new o(b,c,g))})}function j(a,b){for(;3===a._81;)a=a._65;return h._10&&h._10(a),0===a._81?0===a._45?(a._45=1,void(a._54=b)):1===a._45?(a._45=2,void(a._54=[a._54,b])):void a._54.push(b):void k(a,b)}function k(a,b){q(function(){var c=1===a._81?b.onFulfilled:b.onRejected;if(null===c)return void(1===a._81?l(b.promise,a._65):m(b.promise,a._65));var d=f(c,a._65);d===s?m(b.promise,r):l(b.promise,d)})}function l(a,b){if(b===a)return m(a,new TypeError("A promise cannot be resolved with itself."));if(b&&("object"==typeof b||"function"==typeof b)){var c=e(b);if(c===s)return m(a,r);if(c===a.then&&b instanceof h)return a._81=3,a._65=b,void n(a);if("function"==typeof c)return void p(c.bind(b),a)}a._81=1,a._65=b,n(a)}function m(a,b){a._81=2,a._65=b,h._97&&h._97(a,b),n(a)}function n(a){if(1===a._45&&(j(a,a._54),a._54=null),2===a._45){for(var b=0;b<a._54.length;b++)j(a,a._54[b]);a._54=null}}function o(a,b,c){this.onFulfilled="function"==typeof a?a:null,this.onRejected="function"==typeof b?b:null,this.promise=c}function p(a,b){var c=!1,d=g(a,function(a){c||(c=!0,l(b,a))},function(a){c||(c=!0,m(b,a))});c||d!==s||(c=!0,m(b,r))}var q=a("asap/raw"),r=null,s={};b.exports=h,h._10=null,h._97=null,h._61=d,h.prototype.then=function(a,b){if(this.constructor!==h)return i(this,a,b);var c=new h(d);return j(this,new o(a,b,c)),c}},{"asap/raw":93}],95:[function(a,b,c){"use strict";function d(a){var b=new e(e._61);return b._81=1,b._65=a,b}var e=a("./core.js");b.exports=e;var f=d(!0),g=d(!1),h=d(null),i=d(void 0),j=d(0),k=d("");
19831e.resolve=function(a){if(a instanceof e)return a;if(null===a)return h;if(void 0===a)return i;if(a===!0)return f;if(a===!1)return g;if(0===a)return j;if(""===a)return k;if("object"==typeof a||"function"==typeof a)try{var b=a.then;if("function"==typeof b)return new e(b.bind(a))}catch(c){return new e(function(a,b){b(c)})}return d(a)},e.all=function(a){var b=Array.prototype.slice.call(a);return new e(function(a,c){function d(g,h){if(h&&("object"==typeof h||"function"==typeof h)){if(h instanceof e&&h.then===e.prototype.then){for(;3===h._81;)h=h._65;return 1===h._81?d(g,h._65):(2===h._81&&c(h._65),void h.then(function(a){d(g,a)},c))}var i=h.then;if("function"==typeof i){var j=new e(i.bind(h));return void j.then(function(a){d(g,a)},c)}}b[g]=h,0===--f&&a(b)}if(0===b.length)return a([]);for(var f=b.length,g=0;g<b.length;g++)d(g,b[g])})},e.reject=function(a){return new e(function(b,c){c(a)})},e.race=function(a){return new e(function(b,c){a.forEach(function(a){e.resolve(a).then(b,c)})})},e.prototype["catch"]=function(a){return this.then(null,a)}},{"./core.js":94}],96:[function(a,b,c){"function"!=typeof Promise.prototype.done&&(Promise.prototype.done=function(a,b){var c=arguments.length?this.then.apply(this,arguments):this;c.then(null,function(a){setTimeout(function(){throw a},0)})})},{}],97:[function(a,b,c){a("asap");"undefined"==typeof Promise&&(Promise=a("./lib/core.js"),a("./lib/es6-extensions.js")),a("./polyfill-done.js")},{"./lib/core.js":94,"./lib/es6-extensions.js":95,"./polyfill-done.js":96,asap:92}]},{},[2])(2)});
19832/*
19833    jQuery Masked Input Plugin
19834    Copyright (c) 2007 - 2015 Josh Bush (digitalbush.com)
19835    Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license)
19836    Version: 1.4.1
19837*/
19838!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b,c=navigator.userAgent,d=/iphone/i.test(c),e=/chrome/i.test(c),f=/android/i.test(c);a.mask={definitions:{9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},autoclear:!0,dataName:"rawMaskFn",placeholder:"_"},a.fn.extend({caret:function(a,b){var c;if(0!==this.length&&!this.is(":hidden"))return"number"==typeof a?(b="number"==typeof b?b:a,this.each(function(){this.setSelectionRange?this.setSelectionRange(a,b):this.createTextRange&&(c=this.createTextRange(),c.collapse(!0),c.moveEnd("character",b),c.moveStart("character",a),c.select())})):(this[0].setSelectionRange?(a=this[0].selectionStart,b=this[0].selectionEnd):document.selection&&document.selection.createRange&&(c=document.selection.createRange(),a=0-c.duplicate().moveStart("character",-1e5),b=a+c.text.length),{begin:a,end:b})},unmask:function(){return this.trigger("unmask")},mask:function(c,g){var h,i,j,k,l,m,n,o;if(!c&&this.length>0){h=a(this[0]);var p=h.data(a.mask.dataName);return p?p():void 0}return g=a.extend({autoclear:a.mask.autoclear,placeholder:a.mask.placeholder,completed:null},g),i=a.mask.definitions,j=[],k=n=c.length,l=null,a.each(c.split(""),function(a,b){"?"==b?(n--,k=a):i[b]?(j.push(new RegExp(i[b])),null===l&&(l=j.length-1),k>a&&(m=j.length-1)):j.push(null)}),this.trigger("unmask").each(function(){function h(){if(g.completed){for(var a=l;m>=a;a++)if(j[a]&&C[a]===p(a))return;g.completed.call(B)}}function p(a){return g.placeholder.charAt(a<g.placeholder.length?a:0)}function q(a){for(;++a<n&&!j[a];);return a}function r(a){for(;--a>=0&&!j[a];);return a}function s(a,b){var c,d;if(!(0>a)){for(c=a,d=q(b);n>c;c++)if(j[c]){if(!(n>d&&j[c].test(C[d])))break;C[c]=C[d],C[d]=p(d),d=q(d)}z(),B.caret(Math.max(l,a))}}function t(a){var b,c,d,e;for(b=a,c=p(a);n>b;b++)if(j[b]){if(d=q(b),e=C[b],C[b]=c,!(n>d&&j[d].test(e)))break;c=e}}function u(){var a=B.val(),b=B.caret();if(o&&o.length&&o.length>a.length){for(A(!0);b.begin>0&&!j[b.begin-1];)b.begin--;if(0===b.begin)for(;b.begin<l&&!j[b.begin];)b.begin++;B.caret(b.begin,b.begin)}else{for(A(!0);b.begin<n&&!j[b.begin];)b.begin++;B.caret(b.begin,b.begin)}h()}function v(){A(),B.val()!=E&&B.change()}function w(a){if(!B.prop("readonly")){var b,c,e,f=a.which||a.keyCode;o=B.val(),8===f||46===f||d&&127===f?(b=B.caret(),c=b.begin,e=b.end,e-c===0&&(c=46!==f?r(c):e=q(c-1),e=46===f?q(e):e),y(c,e),s(c,e-1),a.preventDefault()):13===f?v.call(this,a):27===f&&(B.val(E),B.caret(0,A()),a.preventDefault())}}function x(b){if(!B.prop("readonly")){var c,d,e,g=b.which||b.keyCode,i=B.caret();if(!(b.ctrlKey||b.altKey||b.metaKey||32>g)&&g&&13!==g){if(i.end-i.begin!==0&&(y(i.begin,i.end),s(i.begin,i.end-1)),c=q(i.begin-1),n>c&&(d=String.fromCharCode(g),j[c].test(d))){if(t(c),C[c]=d,z(),e=q(c),f){var k=function(){a.proxy(a.fn.caret,B,e)()};setTimeout(k,0)}else B.caret(e);i.begin<=m&&h()}b.preventDefault()}}}function y(a,b){var c;for(c=a;b>c&&n>c;c++)j[c]&&(C[c]=p(c))}function z(){B.val(C.join(""))}function A(a){var b,c,d,e=B.val(),f=-1;for(b=0,d=0;n>b;b++)if(j[b]){for(C[b]=p(b);d++<e.length;)if(c=e.charAt(d-1),j[b].test(c)){C[b]=c,f=b;break}if(d>e.length){y(b+1,n);break}}else C[b]===e.charAt(d)&&d++,k>b&&(f=b);return a?z():k>f+1?g.autoclear||C.join("")===D?(B.val()&&B.val(""),y(0,n)):z():(z(),B.val(B.val().substring(0,f+1))),k?b:l}var B=a(this),C=a.map(c.split(""),function(a,b){return"?"!=a?i[a]?p(b):a:void 0}),D=C.join(""),E=B.val();B.data(a.mask.dataName,function(){return a.map(C,function(a,b){return j[b]&&a!=p(b)?a:null}).join("")}),B.one("unmask",function(){B.off(".mask").removeData(a.mask.dataName)}).on("focus.mask",function(){if(!B.prop("readonly")){clearTimeout(b);var a;E=B.val(),a=A(),b=setTimeout(function(){B.get(0)===document.activeElement&&(z(),a==c.replace("?","").length?B.caret(0,a):B.caret(a))},10)}}).on("blur.mask",v).on("keydown.mask",w).on("keypress.mask",x).on("input.mask paste.mask",function(){B.prop("readonly")||setTimeout(function(){var a=A(!0);B.caret(a),h()},0)}),e&&f&&B.off("input.mask").on("input.mask",u),A()})}})});
19839
19840// ┌─────────────────────────────────────────────────────────────────────┐ \\
19841// │ Raphaël 2.0 - JavaScript Vector Library                             │ \\
19842// ├─────────────────────────────────────────────────────────────────────┤ \\
19843// │ Copyright (c) 2008-2011 Dmitry Baranovskiy (http://raphaeljs.com)   │ \\
19844// │ Copyright (c) 2008-2011 Sencha Labs (http://sencha.com)             │ \\
19845// │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\
19846// └─────────────────────────────────────────────────────────────────────┘ \\
19847
19848// ┌──────────────────────────────────────────────────────────────────────────────────────┐ \\
19849// │ Eve 0.3.0 - JavaScript Events Library                                                │ \\
19850// ├──────────────────────────────────────────────────────────────────────────────────────┤ \\
19851// │ Copyright (c) 2008-2011 Dmitry Baranovskiy (http://dmitry.baranovskiy.
19851com/)          │ \\
19852// │ Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license. │ \\
19853// └──────────────────────────────────────────────────────────────────────────────────────┘ \\
19854
19855(function (glob) {
19856    var version = "0.3.0",
19857        has = "hasOwnProperty",
19858        separator = /[\.\/]/,
19859        wildcard = "*",
19860        fun = function () { },
19861        numsort = function (a, b) {
19862            return a - b;
19863        },
19864        current_event,
19865        stop,
19866        events = { n: {} },
19867
19868        eve = function (name, scope) {
19869            var e = events,
19870                args = Array.prototype.slice.call(arguments, 2),
19871                listeners = eve.listeners(name),
19872                z = 0,
19873                f = false,
19874                l,
19875                indexed = [],
19876                queue = {},
19877                out = [],
19878                errors = [];
19879            current_event = name;
19880            stop = 0;
19881            for (var i = 0, ii = listeners.length; i < ii; i++) if ("zIndex" in listeners[i]) {
19882                indexed.push(listeners[i].zIndex);
19883                if (listeners[i].zIndex < 0) {
19884                    queue[listeners[i].zIndex] = listeners[i];
19885                }
19886            }
19887            indexed.sort(numsort);
19888            while (indexed[z] < 0) {
19889                l = queue[indexed[z++]];
19890                out.push(l.apply(scope, args));
19891                if (stop) {
19892                    return out;
19893                }
19894            }
19895            for (i = 0; i < ii; i++) {
19896                l = listeners[i];
19897                if ("zIndex" in l) {
19898                    if (l.zIndex == indexed[z]) {
19899                        out.push(l.apply(scope, args));
19900                        if (stop) {
19901                            return out;
19902                        }
19903                        do {
19904                            z++;
19905                            l = queue[indexed[z]];
19906                            l && out.push(l.apply(scope, args));
19907                            if (stop) {
19908                                return out;
19909                            }
19910                        } while (l)
19911                    } else {
19912                        queue[l.zIndex] = l;
19913                    }
19914                } else {
19915                    out.push(l.apply(scope, args));
19916                    if (stop) {
19917                        return out;
19918                    }
19919                }
19920            }
19921            return out.length ? out : null;
19922        };
19923
19924    eve.listeners = function (name) {
19925        var names = name.split(separator),
19926            e = events,
19927            item,
19928            items,
19929            k,
19930            i,
19931            ii,
19932            j,
19933            jj,
19934            nes,
19935            es = [e],
19936            out = [];
19937        for (i = 0, ii = names.length; i < ii; i++) {
19938            nes = [];
19939            for (j = 0, jj = es.length; j < jj; j++) {
19940                e = es[j].n;
19941                items = [e[names[i]], e[wildcard]];
19942                k = 2;
19943                while (k--) {
19944                    item = items[k];
19945                    if (item) {
19946                        nes.push(item);
19947                        out = out.concat(item.f || []);
19948                    }
19949                }
19950            }
19951            es = nes;
19952        }
19953        return out;
19954    };
19955
19956
19957    eve.on = function (name, f) {
19958        var names = name.split(separator),
19959            e = events;
19960        for (var i = 0, ii = names.length; i < ii; i++) {
19961            e = e.n;
19962            !e[names[i]] && (e[names[i]] = { n: {} });
19963            e = e[names[i]];
19964        }
19965        e.f = e.f || [];
19966        for (i = 0, ii = e.f.length; i < ii; i++) if (e.f[i] == f) {
19967            return fun;
19968        }
19969        e.f.push(f);
19970        return function (zIndex) {
19971            if (+zIndex == +zIndex) {
19972                f.zIndex = +zIndex;
19973            }
19974        };
19975    };
19976
19977    eve.stop = function () {
19978        stop = 1;
19979    };
19980
19981    eve.nt = function (subname) {
19982        if (subname) {
19983            return new RegExp("(?:\\.|\\/|^)" + subname + "(?:\\.|\\/|$)").test(current_event);
19984        }
19985        return current_event;
19986    };
19987
19988    eve.unbind = function (name, f) {
19989        var names = name.split(separator),
19990            e,
19991            key,
19992            splice,
19993            cur = [events];
19994        for (var i = 0, ii = names.length; i < ii; i++) {
19995            for (var j = 0; j < cur.length; j += splice.length - 2) {
19996                splice = [j, 1];
19997                e = cur[j].n;
19998                if (names[i] != wildcard) {
19999                    if (e[names[i]]) {
20000                        splice.push(e[names[i]]);
20001                    }
20002                } else {
20003                    for (key in e) if (e[has](key)) {
20004                        splice.push(e[key]);
20005                    }
20006                }
20007                cur.splice.apply(cur, splice);
20008            }
20009        }
20010        for (i = 0, ii = cur.length; i < ii; i++) {
20011            e = cur[i];
20012            while (e.n) {
20013                if (f) {
20014                    if (e.f) {
20015                        for (i = 0, ii = e.f.length; i < ii; i++) if (e.f[i] == f) {
20016                            e.f.splice(i, 1);
20017                            break;
20018                        }
20019                        !e.f.length && delete e.f;
20020                    }
20021                    for (key in e.n) if (e.n[has](key) && e.n[key].f) {
20022                        var funcs = e.n[key].f;
20023                        for (i = 0, ii = funcs.length; i < ii; i++) if (funcs[i] == f) {
20024                            funcs.splice(i, 1);
20025                            break;
20026                        }
20027                        !funcs.length && delete e.n[key].f;
20028                    }
20029                } else {
20030                    delete e.f;
20031                    for (key in e.n) if (e.n[has](key) && e.n[key].f) {
20032                        delete e.n[key].f;
20033                    }
20034                }
20035                e = e.n;
20036            }
20037        }
20038    };
20039
20040    eve.version = version;
20041    eve.toString = function () {
20042        return "You are running Eve " + version;
20043    };
20044    (typeof module != "undefined" && module.exports) ? (module.exports = eve) : (glob.eve = eve);
20045})(this);
20046
20047// ┌─────────────────────────────────────────────────────────────────────┐ \\
20048// │ "Raphaël 2.0" - JavaScript Vector Library                           │ \\
20049// ├─────────────────────────────────────────────────────────────────────┤ \\
20050// │ Copyright (c) 2008-2011 Dmitry Baranovskiy (http://raphaeljs.com)   │ \\
20051// │ Copyright (c) 2008-2011 Sencha Labs (http://sencha.com)             │ \\
20052// │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\
20053// └─────────────────────────────────────────────────────────────────────┘ \\
20054(function () {
20055
20056    function R(first) {
20057        if (R.is(first, "function")) {
20058            return loaded ? first() : eve.on("DOMload", first);
20059        } else if (R.is(first, array)) {
20060            var a = first,
20061                cnv = R._engine.create[apply](R, a.splice(0, 3 + R.is(a[0], nu))),
20062                res = cnv.set(),
20063                i = 0,
20064                ii = a.length,
20065                j;
20066            for (; i < ii; i++) {
20067                j = a[i] || {};
20068                elements[has](j.type) && res.push(cnv[j.type]().attr(j));
20069            }
20070            return res;
20071        } else {
20072            var args = Array.prototype.slice.call(arguments, 0);
20073            if (R.is(args[args.length - 1], "function")) {
20074                var f = args.pop();
20075                return loaded ? f.call(R._engine.create[apply](R, args)) : eve.on("DOMload", function () {
20076                    f.call(R._engine.create[apply](R, args));
20077                });
20078            } else {
20079                return R._engine.create[apply](R, arguments);
20080            }
20081        }
20082    }
20083    R.version = "2.0.0";
20084    R.eve = eve;
20085    var loaded,
20086        separator = /[, ]+/,
20087        elements = { circle: 1, rect: 1, path: 1, ellipse: 1, text: 1, image: 1 },
20088        formatrg = /\{(\d+)\}/g,
20089        proto = "prototype",
20090        has = "hasOwnProperty",
20091        g = {
20092            doc: document,
20093            win: window
20094        },
20095        oldRaphael = {
20096            was: Object.prototype[has].call(g.win, "Raphael"),
20097            is: g.win.Raphael
20098        },
20099        Paper = function () {
20100
20101            this.customAttributes = {};
20102        },
20103        paperproto,
20104        appendChild = "appendChild",
20105        apply = "apply",
20106        concat = "concat",
20107        supportsTouch = "createTouch" in g.doc,
20108        E = "",
20109        S = " ",
20110        Str = String,
20111        split = "split",
20112        events = "click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel".split(S),
20113        touchMap = {
20114            mousedown: "touchstart",
20115            mousemove: "touchmove",
20116            mouseup: "touchend"
20117        },
20118        lowerCase = Str.prototype.toLowerCase,
20119        math = Math,
20120        mmax = math.max,
20121        mmin = math.min,
20122        abs = math.abs,
20123        pow = math.pow,
20124        PI = math.PI,
20125        nu = "number",
20126        string = "string",
20127        array = "array",
20128        toString = "toString",
20129        fillString = "fill",
20130        objectToString = Object.prototype.toString,
20131        paper = {},
20132        push = "push",
20133        ISURL = R._ISURL = /^url\(['"]?([^\)]+?)['"]?\)$/i,
20134        colourRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,
20135        isnan = { "NaN": 1, "Infinity": 1, "-Infinity": 1 },
20136        bezierrg = /^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,
20137        round = math.round,
20138        setAttribute = "setAttribute",
20139        toFloat = parseFloat,
20140        toInt = parseInt,
20141        upperCase = Str.prototype.toUpperCase,
20142        availableAttrs = R._availableAttrs = {
20143            "arrow-end": "none",
20144            "arrow-start": "none",
20145            blur: 0,
20146            "clip-rect": "0 0 1e9 1e9",
20147            cursor: "default",
20148            cx: 0,
20149            cy: 0,
20150            fill: "#fff",
20151            "fill-opacity": 1,
20152            font: '10px "Arial"',
20153            "font-family": '"Arial"',
20154            "font-size": "10",
20155            "font-style": "normal",
20156            "font-weight": 400,
20157            gradient: 0,
20158            height: 0,
20159            href: "http://raphaeljs.com/",
20160            opacity: 1,
20161            path: "M0,0",
20162            r: 0,
20163            rx: 0,
20164            ry: 0,
20165            src: "",
20166            stroke: "#000",
20167            "stroke-dasharray": "",
20168            "stroke-linecap": "butt",
20169            "stroke-linejoin": "butt",
20170            "stroke-miterlimit": 0,
20171            "stroke-opacity": 1,
20172            "stroke-width": 1,
20173            target: "_blank",
20174            "text-anchor": "middle",
20175            title: "Raphael",
20176            transform: "",
20177            width: 0,
20178            x: 0,
20179            y: 0
20180        },
20181        availableAnimAttrs = R._availableAnimAttrs = {
20182            blur: nu,
20183            "clip-rect": "csv",
20184            cx: nu,
20185            cy: nu,
20186            fill: "colour",
20187            "fill-opacity": nu,
20188            "font-size": nu,
20189            height: nu,
20190            opacity: nu,
20191            path: "path",
20192            r: nu,
20193            rx: nu,
20194            ry: nu,
20195            stroke: "colour",
20196            "stroke-opacity": nu,
20197            "stroke-width": nu,
20198            transform: "transform",
20199            width: nu,
20200            x: nu,
20201            y: nu
20202        },
20203        commaSpaces = /\s*,\s*/,
20204        hsrg = { hs: 1, rg: 1 },
20205        p2s = /,?([achlmqrstvxz]),?/gi,
20206        pathCommand = /([achlmrqstvz])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?\s*,?\s*)+)/ig,
20207        tCommand = /([rstm])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?\s*,?\s*)+)/ig,
20208        pathValues = /(-?\d*\.?\d*(?:e[\-+]?\d+)?)\s*,?\s*/ig,
20209        radial_gradient = R._radial_gradient = /^r(?:\(([^,]+?)\s*,\s*([^\)]+?)\))?/,
20210        eldata = {},
20211        sortByKey = function (a, b) {
20212            return a.key - b.key;
20213        },
20214        sortByNumber = function (a, b) {
20215            return toFloat(a) - toFloat(b);
20216        },
20217        fun = function () { },
20218        pipe = function (x) {
20219            return x;
20220        },
20221        rectPath = R._rectPath = function (x, y, w, h, r) {
20222            if (r) {
20223                return [["M", x + r, y], ["l", w - r * 2, 0], ["a", r, r, 0, 0, 1, r, r], ["l", 0, h - r * 2], ["a", r, r, 0, 0, 1, -r, r], ["l", r * 2 - w, 0], ["a", r, r, 0, 0, 1, -r, -r], ["l", 0, r * 2 - h], ["a", r, r, 0, 0, 1, r, -r], ["z"]];
20224            }
20225            return [["M", x, y], ["l", w, 0], ["l", 0, h], ["l", -w, 0], ["z"]];
20226        },
20227        ellipsePath = function (x, y, rx, ry) {
20228            if (ry == null) {
20229                ry = rx;
20230            }
20231            return [["M", x, y], ["m", 0, -ry], ["a", rx, ry, 0, 1, 1, 0, 2 * ry], ["a", rx, ry, 0, 1, 1, 0, -2 * ry], ["z"]];
20232        },
20233        getPath = R._getPath = {
20234            path: function (el) {
20235                return el.attr("path");
20236            },
20237            circle: function (el) {
20238                var a = el.attrs;
20239                return ellipsePath(a.cx, a.cy, a.r);
20240            },
20241            ellipse: function (el) {
20242                var a = el.attrs;
20243                return ellipsePath(a.cx, a.cy, a.rx, a.ry);
20244            },
20245            rect: function (el) {
20246                var a = el.attrs;
20247                return rectPath(a.x, a.y, a.width, a.height, a.r);
20248            },
20249            image: function (el) {
20250                var a = el.attrs;
20251                return rectPath(a.x, a.y, a.width, a.height);
20252            },
20253            text: function (el) {
20254                var bbox = el._getBBox();
20255                return rectPath(bbox.x, bbox.y, bbox.width, bbox.height);
20256            }
20257        },
20258        mapPath = R.mapPath = function (path, matrix) {
20259            if (!matrix) {
20260                return path;
20261            }
20262            var x, y, i, j, pathi;
20263            path = path2curve(path);
20264            for (i = 0, ii = path.length; i < ii; i++) {
20265                pathi = path[i];
20266                for (j = 1, jj = pathi.length; j < jj; j += 2) {
20267                    x = matrix.x(pathi[j], pathi[j + 1]);
20268                    y = matrix.y(pathi[j], pathi[j + 1]);
20269                    pathi[j] = x;
20270                    pathi[j + 1] = y;
20271                }
20272            }
20273            return path;
20274        };
20275
20276    R._g = g;
20277
20278    R.type = (g.win.SVGAngle || g.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") ? "SVG" : "VML");
20279    if (R.type == "VML") {
20280        var d = g.doc.createElement("div"),
20281            b;
20282        d.innerHTML = '<v:shape adj="1"/>';
20283        b = d.firstChild;
20284        b.style.behavior = "url(#default#VML)";
20285        if (!(b && typeof b.adj == "object")) {
20286            return (R.type = E);
20287        }
20288        d = null;
20289    }
20290
20291
20292    R.svg = !(R.vml = R.type == "VML");
20293    R._Paper = Paper;
20294
20295    R.fn = paperproto = Paper.prototype = R.prototype;
20296    R._id = 0;
20297    R._oid = 0;
20298
20299    R.is = function (o, type) {
20300        type = lowerCase.call(type);
20301        if (type == "finite") {
20302            return !isnan[has](+o);
20303        }
20304        if (type == "array") {
20305            return o instanceof Array;
20306        }
20307        return (type == "null" && o === null) ||
20308            (type == typeof o) ||
20309            (type == "object" && o === Object(o)) ||
20310            (type == "array" && Array.isArray && Array.isArray(o)) ||
20311            objectToString.call(o).slice(8, -1).toLowerCase() == type;
20312    };
20313
20314    R.angle = function (x1, y1, x2, y2, x3, y3) {
20315        if (x3 == null) {
20316            var x = x1 - x2,
20317                y = y1 - y2;
20318            if (!x && !y) {
20319                return 0;
20320            }
20321            return (180 + math.atan2(-y, -x) * 180 / PI + 360) % 360;
20322        } else {
20323            return R.angle(x1, y1, x3, y3) - R.angle(x2, y2, x3, y3);
20324        }
20325    };
20326
20327    R.rad = function (deg) {
20328        return deg % 360 * PI / 180;
20329    };
20330
20331    R.deg = function (rad) {
20332        return rad * 180 / PI % 360;
20333    };
20334
20335    R.snapTo = function (values, value, tolerance) {
20336        tolerance = R.is(tolerance, "finite") ? tolerance : 10;
20337        if (R.is(values, array)) {
20338            var i = values.length;
20339            while (i--) if (abs(values[i] - value) <= tolerance) {
20340                return values[i];
20341            }
20342        } else {
20343            values = +values;
20344            var rem = value % values;
20345            if (rem < tolerance) {
20346                return value - rem;
20347            }
20348            if (rem > values - tolerance) {
20349                return value - rem + values;
20350            }
20351        }
20352        return value;
20353    };
20354
20355
20356    var createUUID = R.createUUID = (function (uuidRegEx, uuidReplacer) {
20357        return function () {
20358            return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(uuidRegEx, uuidReplacer).toUpperCase();
20359        };
20360    })(/[xy]/g, function (c) {
20361        var r = math.random() * 16 | 0,
20362            v = c == "x" ? r : (r & 3 | 8);
20363        return v.toString(16);
20364    });
20365
20366
20367    R.setWindow = function (newwin) {
20368        eve("setWindow", R, g.win, newwin);
20369        g.win = newwin;
20370        g.doc = g.win.document;
20371        if (initWin) {
20372            initWin(g.win);
20373        }
20374    };
20375    var toHex = function (color) {
20376        if (R.vml) {
20377            // http://dean.edwards.name/weblog/2009/10/convert-any-colour-value-to-hex-in-msie/
20378            var trim = /^\s+|\s+$/g;
20379            var bod;
20380            try {
20381                var docum = new ActiveXObject("htmlfile");
20382                docum.write("<body>");
20383                docum.close();
20384                bod = docum.body;
20385            } catch (e) {
20386                bod = createPopup().document.body;
20387            }
20388            var range = bod.createTextRange();
20389            toHex = cacher(function (color) {
20390                try {
20391                    bod.style.color = Str(color).replace(trim, E);
20392                    var value = range.queryCommandValue("ForeColor");
20393                    value = ((value & 255) << 16) | (value & 65280) | ((value & 16711680) >>> 16);
20394                    return "#" + ("000000" + value.toString(16)).slice(-6);
20395                } catch (e) {
20396                    return "none";
20397                }
20398            });
20399        } else {
20400            var i = g.doc.createElement("i");
20401            i.title = "Rapha\xebl Colour Picker";
20402            i.style.display = "none";
20403            g.doc.body.appendChild(i);
20404            toHex = cacher(function (color) {
20405                i.style.color = color;
20406                return g.doc.defaultView.getComputedStyle(i, E).getPropertyValue("color");
20407            });
20408        }
20409        return toHex(color);
20410    },
20411        hsbtoString = function () {
20412            return "hsb(" + [this.h, this.s, this.b] + ")";
20413        },
20414        hsltoString = function () {
20415            return "hsl(" + [this.h, this.s, this.l] + ")";
20416        },
20417        rgbtoString = function () {
20418            return this.hex;
20419        },
20420        prepareRGB = function (r, g, b) {
20421            if (g == null && R.is(r, "object") && "r" in r && "g" in r && "b" in r) {
20422                b = r.b;
20423                g = r.g;
20424                r = r.r;
20425            }
20426            if (g == null && R.is(r, string)) {
20427                var clr = R.getRGB(r);
20428                r = clr.r;
20429                g = clr.g;
20430                b = clr.b;
20431            }
20432            if (r > 1 || g > 1 || b > 1) {
20433                r /= 255;
20434                g /= 255;
20435                b /= 255;
20436            }
20437
20438            return [r, g, b];
20439        },
20440        packageRGB = function (r, g, b, o) {
20441            r *= 255;
20442            g *= 255;
20443            b *= 255;
20444            var rgb = {
20445                r: r,
20446                g: g,
20447                b: b,
20448                hex: R.rgb(r, g, b),
20449                toString: rgbtoString
20450            };
20451            R.is(o, "finite") && (rgb.opacity = o);
20452            return rgb;
20453        };
20454
20455
20456    R.color = function (clr) {
20457        var rgb;
20458        if (R.is(clr, "object") && "h" in clr && "s" in clr && "b" in clr) {
20459            rgb = R.hsb2rgb(clr);
20460            clr.r = rgb.r;
20461            clr.g = rgb.g;
20462            clr.b = rgb.b;
20463            clr.hex = rgb.hex;
20464        } else if (R.is(clr, "object") && "h" in clr && "s" in clr && "l" in clr) {
20465            rgb = R.hsl2rgb(clr);
20466            clr.r = rgb.r;
20467            clr.g = rgb.g;
20468            clr.b = rgb.b;
20469            clr.hex = rgb.hex;
20470        } else {
20471            if (R.is(clr, "string")) {
20472                clr = R.getRGB(clr);
20473            }
20474            if (R.is(clr, "object") && "r" in clr && "g" in clr && "b" in clr) {
20475                rgb = R.rgb2hsl(clr);
20476                clr.h = rgb.h;
20477                clr.s = rgb.s;
20478                clr.l = rgb.l;
20479                rgb = R.rgb2hsb(clr);
20480                clr.v = rgb.b;
20481            } else {
20482                clr = { hex: "none" };
20483                crl.r = clr.g = clr.b = clr.h = clr.s = clr.v = clr.l = -1;
20484            }
20485        }
20486        clr.toString = rgbtoString;
20487        return clr;
20488    };
20489
20490    R.hsb2rgb = function (h, s, v, o) {
20491        if (this.is(h, "object") && "h" in h && "s" in h && "b" in h) {
20492            v = h.b;
20493            s = h.s;
20494            h = h.h;
20495            o = h.o;
20496        }
20497        h *= 360;
20498        var R, G, B, X, C;
20499        h = (h % 360) / 60;
20500        C = v * s;
20501        X = C * (1 - abs(h % 2 - 1));
20502        R = G = B = v - C;
20503
20504        h = ~~h;
20505        R += [C, X, 0, 0, X, C][h];
20506        G += [X, C, C, X, 0, 0][h];
20507        B += [0, 0, X, C, C, X][h];
20508        return packageRGB(R, G, B, o);
20509    };
20510
20511    R.hsl2rgb = function (h, s, l, o) {
20512        if (this.is(h, "object") && "h" in h && "s" in h && "l" in h) {
20513            l = h.l;
20514            s = h.s;
20515            h = h.h;
20516        }
20517        if (h > 1 || s > 1 || l > 1) {
20518            h /= 360;
20519            s /= 100;
20520            l /= 100;
20521        }
20522        h *= 360;
20523        var R, G, B, X, C;
20524        h = (h % 360) / 60;
20525        C = 2 * s * (l < .5 ? l : 1 - l);
20526        X = C * (1 - abs(h % 2 - 1));
20527        R = G = B = l - C / 2;
20528
20529        h = ~~h;
20530        R += [C, X, 0, 0, X, C][h];
20531        G += [X, C, C, X, 0, 0][h];
20532        B += [0, 0, X, C, C, X][h];
20533        return packageRGB(R, G, B, o);
20534    };
20535
20536    R.rgb2hsb = function (r, g, b) {
20537        b = prepareRGB(r, g, b);
20538        r = b[0];
20539        g = b[1];
20540        b = b[2];
20541
20542        var H, S, V, C;
20543        V = mmax(r, g, b);
20544        C = V - mmin(r, g, b);
20545        H = (C == 0 ? null :
20546            V == r ? (g - b) / C :
20547                V == g ? (b - r) / C + 2 :
20548                    (r - g) / C + 4
20549        );
20550        H = ((H + 360) % 6) * 60 / 360;
20551        S = C == 0 ? 0 : C / V;
20552        return { h: H, s: S, b: V, toString: hsbtoString };
20553    };
20554
20555    R.rgb2hsl = function (r, g, b) {
20556        b = prepareRGB(r, g, b);
20557        r = b[0];
20558        g = b[1];
20559        b = b[2];
20560
20561        var H, S, L, M, m, C;
20562        M = mmax(r, g, b);
20563        m = mmin(r, g, b);
20564        C = M - m;
20565        H = (C == 0 ? null :
20566            M == r ? (g - b) / C :
20567                M == g ? (b - r) / C + 2 :
20568                    (r - g) / C + 4);
20569        H = ((H + 360) % 6) * 60 / 360;
20570        L = (M + m) / 2;
20571        S = (C == 0 ? 0 :
20572            L < .5 ? C / (2 * L) :
20573                C / (2 - 2 * L));
20574        return { h: H, s: S, l: L, toString: hsltoString };
20575    };
20576    R._path2string = function () {
20577        return this.join(",").replace(p2s, "$1");
20578    };
20579    function repush(array, item) {
20580        for (var i = 0, ii = array.length; i < ii; i++) if (array[i] === item) {
20581            return array.push(array.splice(i, 1)[0]);
20582        }
20583    }
20584    function cacher(f, scope, postprocessor) {
20585        function newf() {
20586            var arg = Array.prototype.slice.call(arguments, 0),
20587                args = arg.join("\u2400"),
20588                cache = newf.cache = newf.cache || {},
20589                count = newf.count = newf.count || [];
20590            if (cache[has](args)) {
20591                repush(count, args);
20592                return postprocessor ? postprocessor(cache[args]) : cache[args];
20593            }
20594            count.length >= 1e3 && delete cache[count.shift()];
20595            count.push(args);
20596            cache[args] = f[apply](scope, arg);
20597            return postprocessor ? postprocessor(cache[args]) : cache[args];
20598        }
20599        return newf;
20600    }
20601
20602    var preload = R._preload = function (src, f) {
20603        var img = g.doc.createElement("img");
20604        img.style.cssText = "position:absolute;
20604left:-9999em;top-9999em";
20605        img.onload = function () {
20606            f.call(this);
20607            this.onload = null;
20608            g.doc.body.removeChild(this);
20609        };
20610        img.onerror = function () {
20611            g.doc.body.removeChild(this);
20612        };
20613        g.doc.body.appendChild(img);
20614        img.src = src;
20615    };
20616
20617    function clrToString() {
20618        return this.hex;
20619    }
20620
20621
20622    R.getRGB = cacher(function (colour) {
20623        if (!colour || !!((colour = Str(colour)).indexOf("-") + 1)) {
20624            return { r: -1, g: -1, b: -1, hex: "none", error: 1, toString: clrToString };
20625        }
20626        if (colour == "none") {
20627            return { r: -1, g: -1, b: -1, hex: "none", toString: clrToString };
20628        }
20629        !(hsrg[has](colour.toLowerCase().substring(0, 2)) || colour.charAt() == "#") && (colour = toHex(colour));
20630        var res,
20631            red,
20632            green,
20633            blue,
20634            opacity,
20635            t,
20636            values,
20637            rgb = colour.match(colourRegExp);
20638        if (rgb) {
20639            if (rgb[2]) {
20640                blue = toInt(rgb[2].substring(5), 16);
20641                green = toInt(rgb[2].substring(3, 5), 16);
20642                red = toInt(rgb[2].substring(1, 3), 16);
20643            }
20644            if (rgb[3]) {
20645                blue = toInt((t = rgb[3].charAt(3)) + t, 16);
20646                green = toInt((t = rgb[3].charAt(2)) + t, 16);
20647                red = toInt((t = rgb[3].charAt(1)) + t, 16);
20648            }
20649            if (rgb[4]) {
20650                values = rgb[4].split(commaSpaces);
20651                red = toFloat(values[0]);
20652                values[0].slice(-1) == "%" && (red *= 2.55);
20653                green = toFloat(values[1]);
20654                values[1].slice(-1) == "%" && (green *= 2.55);
20655                blue = toFloat(values[2]);
20656                values[2].slice(-1) == "%" && (blue *= 2.55);
20657                rgb[1].toLowerCase().slice(0, 4) == "rgba" && (opacity = toFloat(values[3]));
20658                values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
20659            }
20660            if (rgb[5]) {
20661                values = rgb[5].split(commaSpaces);
20662                red = toFloat(values[0]);
20663                values[0].slice(-1) == "%" && (red *= 2.55);
20664                green = toFloat(values[1]);
20665                values[1].slice(-1) == "%" && (green *= 2.55);
20666                blue = toFloat(values[2]);
20667                values[2].slice(-1) == "%" && (blue *= 2.55);
20668                (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360);
20669                rgb[1].toLowerCase().slice(0, 4) == "hsba" && (opacity = toFloat(values[3]));
20670                values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
20671                return R.hsb2rgb(red, green, blue, opacity);
20672            }
20673            if (rgb[6]) {
20674                values = rgb[6].split(commaSpaces);
20675                red = toFloat(values[0]);
20676                values[0].slice(-1) == "%" && (red *= 2.55);
20677                green = toFloat(values[1]);
20678                values[1].slice(-1) == "%" && (green *= 2.55);
20679                blue = toFloat(values[2]);
20680                values[2].slice(-1) == "%" && (blue *= 2.55);
20681                (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360);
20682                rgb[1].toLowerCase().slice(0, 4) == "hsla" && (opacity = toFloat(values[3]));
20683                values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
20684                return R.hsl2rgb(red, green, blue, opacity);
20685            }
20686            rgb = { r: red, g: green, b: blue, toString: clrToString };
20687            rgb.hex = "#" + (16777216 | blue | (green << 8) | (red << 16)).toString(16).slice(1);
20688            R.is(opacity, "finite") && (rgb.opacity = opacity);
20689            return rgb;
20690        }
20691        return { r: -1, g: -1, b: -1, hex: "none", error: 1, toString: clrToString };
20692    }, R);
20693
20694    R.hsb = cacher(function (h, s, b) {
20695        return R.hsb2rgb(h, s, b).hex;
20696    });
20697
20698    R.hsl = cacher(function (h, s, l) {
20699        return R.hsl2rgb(h, s, l).hex;
20700    });
20701
20702    R.rgb = cacher(function (r, g, b) {
20703        return "#" + (16777216 | b | (g << 8) | (r << 16)).toString(16).slice(1);
20704    });
20705
20706    R.getColor = function (value) {
20707        var start = this.getColor.start = this.getColor.start || { h: 0, s: 1, b: value || .75 },
20708            rgb = this.hsb2rgb(start.h, start.s, start.b);
20709        start.h += .075;
20710        if (start.h > 1) {
20711            start.h = 0;
20712            start.s -= .2;
20713            start.s <= 0 && (this.getColor.start = { h: 0, s: 1, b: start.b });
20714        }
20715        return rgb.hex;
20716    };
20717
20718    R.getColor.reset = function () {
20719        delete this.start;
20720    };
20721
20722    // http://schepers.cc/getting-to-the-point
20723    function catmullRom2bezier(crp) {
20724        var d = [];
20725        for (var i = 0, iLen = crp.length; iLen - 2 > i; i += 2) {
20726            var p = [{ x: +crp[i], y: +crp[i + 1] },
20727            { x: +crp[i], y: +crp[i + 1] },
20728            { x: +crp[i + 2], y: +crp[i + 3] },
20729            { x: +crp[i + 4], y: +crp[i + 5] }];
20730            if (iLen - 4 == i) {
20731                p[0] = { x: +crp[i - 2], y: +crp[i - 1] };
20732                p[3] = p[2];
20733            } else if (i) {
20734                p[0] = { x: +crp[i - 2], y: +crp[i - 1] };
20735            }
20736            d.push(["C",
20737                (-p[0].x + 6 * p[1].x + p[2].x) / 6,
20738                (-p[0].y + 6 * p[1].y + p[2].y) / 6,
20739                (p[1].x + 6 * p[2].x - p[3].x) / 6,
20740                (p[1].y + 6 * p[2].y - p[3].y) / 6,
20741                p[2].x,
20742                p[2].y
20743            ]);
20744        }
20745
20746        return d;
20747    }
20748
20749    R.parsePathString = cacher(function (pathString) {
20750        if (!pathString) {
20751            return null;
20752        }
20753        var paramCounts = { a: 7, c: 6, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, z: 0 },
20754            data = [];
20755        if (R.is(pathString, array) && R.is(pathString[0], array)) { // rough assumption
20756            data = pathClone(pathString);
20757        }
20758        if (!data.length) {
20759            Str(pathString).replace(pathCommand, function (a, b, c) {
20760                var params = [],
20761                    name = b.toLowerCase();
20762                c.replace(pathValues, function (a, b) {
20763                    b && params.push(+b);
20764                });
20765                if (name == "m" && params.length > 2) {
20766                    data.push([b][concat](params.splice(0, 2)));
20767                    name = "l";
20768                    b = b == "m" ? "l" : "L";
20769                }
20770                if (name == "r") {
20771                    data.push([b][concat](params));
20772                } else while (params.length >= paramCounts[name]) {
20773                    data.push([b][concat](params.splice(0, paramCounts[name])));
20774                    if (!paramCounts[name]) {
20775                        break;
20776                    }
20777                }
20778            });
20779        }
20780        data.toString = R._path2string;
20781        return data;
20782    });
20783
20784    R.parseTransformString = cacher(function (TString) {
20785        if (!TString) {
20786            return null;
20787        }
20788        var paramCounts = { r: 3, s: 4, t: 2, m: 6 },
20789            data = [];
20790        if (R.is(TString, array) && R.is(TString[0], array)) { // rough assumption
20791            data = pathClone(TString);
20792        }
20793        if (!data.length) {
20794            Str(TString).replace(tCommand, function (a, b, c) {
20795                var params = [],
20796                    name = lowerCase.call(b);
20797                c.replace(pathValues, function (a, b) {
20798                    b && params.push(+b);
20799                });
20800                data.push([name][concat](params));
20801            });
20802        }
20803        data.toString = R._path2string;
20804        return data;
20805    });
20806
20807    R.findDotsAtSegment = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
20808        var t1 = 1 - t,
20809            t13 = pow(t1, 3),
20810            t12 = pow(t1, 2),
20811            t2 = t * t,
20812            t3 = t2 * t,
20813            x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x,
20814            y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y,
20815            mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x),
20816            my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y),
20817            nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x),
20818            ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y),
20819            ax = t1 * p1x + t * c1x,
20820            ay = t1 * p1y + t * c1y,
20821            cx = t1 * c2x + t * p2x,
20822            cy = t1 * c2y + t * p2y,
20823            alpha = (90 - math.atan2(mx - nx, my - ny) * 180 / PI);
20824        (mx > nx || my < ny) && (alpha += 180);
20825        return {
20826            x: x,
20827            y: y,
20828            m: { x: mx, y: my },
20829            n: { x: nx, y: ny },
20830            start: { x: ax, y: ay },
20831            end: { x: cx, y: cy },
20832            alpha: alpha
20833        };
20834    };
20835    var pathDimensions = cacher(function (path) {
20836        if (!path) {
20837            return { x: 0, y: 0, width: 0, height: 0 };
20838        }
20839        path = path2curve(path);
20840        var x = 0,
20841            y = 0,
20842            X = [],
20843            Y = [],
20844            p;
20845        for (var i = 0, ii = path.length; i < ii; i++) {
20846            p = path[i];
20847            if (p[0] == "M") {
20848                x = p[1];
20849                y = p[2];
20850                X.push(x);
20851                Y.push(y);
20852            } else {
20853                var dim = curveDim(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);
20854                X = X[concat](dim.min.x, dim.max.x);
20855                Y = Y[concat](dim.min.y, dim.max.y);
20856                x = p[5];
20857                y = p[6];
20858            }
20859        }
20860        var xmin = mmin[apply](0, X),
20861            ymin = mmin[apply](0, Y);
20862        return {
20863            x: xmin,
20864            y: ymin,
20865            width: mmax[apply](0, X) - xmin,
20866            height: mmax[apply](0, Y) - ymin
20867        };
20868    }, null, function (o) {
20869        return {
20870            x: o.x,
20871            y: o.y,
20872            width: o.width,
20873            height: o.height
20874        };
20875    }),
20876        pathClone = function (pathArray) {
20877            var res = [];
20878            if (!R.is(pathArray, array) || !R.is(pathArray && pathArray[0], array)) { // rough assumption
20879                pathArray = R.parsePathString(pathArray);
20880            }
20881            for (var i = 0, ii = pathArray.length; i < ii; i++) {
20882                res[i] = [];
20883                for (var j = 0, jj = pathArray[i].length; j < jj; j++) {
20884                    res[i][j] = pathArray[i][j];
20885                }
20886            }
20887            res.toString = R._path2string;
20888            return res;
20889        },
20890        pathToRelative = R._pathToRelative = cacher(function (pathArray) {
20891            if (!R.is(pathArray, array) || !R.is(pathArray && pathArray[0], array)) { // rough assumption
20892                pathArray = R.parsePathString(pathArray);
20893            }
20894            var res = [],
20895                x = 0,
20896                y = 0,
20897                mx = 0,
20898                my = 0,
20899                start = 0;
20900            if (pathArray[0][0] == "M") {
20901                x = pathArray[0][1];
20902                y = pathArray[0][2];
20903                mx = x;
20904                my = y;
20905                start++;
20906                res.push(["M", x, y]);
20907            }
20908            for (var i = start, ii = pathArray.length; i < ii; i++) {
20909                var r = res[i] = [],
20910                    pa = pathArray[i];
20911                if (pa[0] != lowerCase.call(pa[0])) {
20912                    r[0] = lowerCase.call(pa[0]);
20913                    switch (r[0]) {
20914                        case "a":
20915                            r[1] = pa[1];
20916                            r[2] = pa[2];
20917                            r[3] = pa[3];
20918                            r[4] = pa[4];
20919                            r[5] = pa[5];
20920                            r[6] = +(pa[6] - x).toFixed(3);
20921                            r[7] = +(pa[7] - y).toFixed(3);
20922                            break;
20923                        case "v":
20924                            r[1] = +(pa[1] - y).toFixed(3);
20925                            break;
20926                        case "m":
20927                            mx = pa[1];
20928                            my = pa[2];
20929                        default:
20930                            for (var j = 1, jj = pa.length; j < jj; j++) {
20931                                r[j] = +(pa[j] - ((j % 2) ? x : y)).toFixed(3);
20932                            }
20933                    }
20934                } else {
20935                    r = res[i] = [];
20936                    if (pa[0] == "m") {
20937                        mx = pa[1] + x;
20938                        my = pa[2] + y;
20939                    }
20940                    for (var k = 0, kk = pa.length; k < kk; k++) {
20941                        res[i][k] = pa[k];
20942                    }
20943                }
20944                var len = res[i].length;
20945                switch (res[i][0]) {
20946                    case "z":
20947                        x = mx;
20948                        y = my;
20949                        break;
20950                    case "h":
20951                        x += +res[i][len - 1];
20952                        break;
20953                    case "v":
20954                        y += +res[i][len - 1];
20955                        break;
20956                    default:
20957                        x += +res[i][len - 2];
20958                        y += +res[i][len - 1];
20959                }
20960            }
20961            res.toString = R._path2string;
20962            return res;
20963        }, 0, pathClone),
20964        pathToAbsolute = R._pathToAbsolute = cacher(function (pathArray) {
20965            if (!R.is(pathArray, array) || !R.is(pathArray && pathArray[0], array)) { // rough assumption
20966                pathArray = R.parsePathString(pathArray);
20967            }
20968            if (!pathArray || !pathArray.length) {
20969                return [["M", 0, 0]];
20970            }
20971            var res = [],
20972                x = 0,
20973                y = 0,
20974                mx = 0,
20975                my = 0,
20976                start = 0;
20977            if (pathArray[0][0] == "M") {
20978                x = +pathArray[0][1];
20979                y = +pathArray[0][2];
20980                mx = x;
20981                my = y;
20982                start++;
20983                res[0] = ["M", x, y];
20984            }
20985            for (var r, pa, i = start, ii = pathArray.length; i < ii; i++) {
20986                res.push(r = []);
20987                pa = pathArray[i];
20988                if (pa[0] != upperCase.call(pa[0])) {
20989                    r[0] = upperCase.call(pa[0]);
20990                    switch (r[0]) {
20991                        case "A":
20992                            r[1] = pa[1];
20993                            r[2] = pa[2];
20994                            r[3] = pa[3];
20995                            r[4] = pa[4];
20996                            r[5] = pa[5];
20997                            r[6] = +(pa[6] + x);
20998                            r[7] = +(pa[7] + y);
20999                            break;
21000                        case "V":
21001                            r[1] = +pa[1] + y;
21002                            break;
21003                        case "H":
21004                            r[1] = +pa[1] + x;
21005                            break;
21006                        case "R":
21007                            var dots = [x, y][concat](pa.slice(1));
21008                            for (var j = 2, jj = dots.length; j < jj; j++) {
21009                                dots[j] = +dots[j] + x;
21010                                dots[++j] = +dots[j] + y;
21011                            }
21012                            res.pop();
21013                            res = res[concat](catmullRom2bezier(dots));
21014                            break;
21015                        case "M":
21016                            mx = +pa[1] + x;
21017                            my = +pa[2] + y;
21018                        default:
21019                            for (j = 1, jj = pa.length; j < jj; j++) {
21020                                r[j] = +pa[j] + ((j % 2) ? x : y);
21021                            }
21022                    }
21023                } else if (pa[0] == "R") {
21024                    dots = [x, y][concat](pa.slice(1));
21025                    res.pop();
21026                    res = res[concat](catmullRom2bezier(dots));
21027                    r = ["R"][concat](pa.slice(-2));
21028                } else {
21029                    for (var k = 0, kk = pa.length; k < kk; k++) {
21030                        r[k] = pa[k];
21031                    }
21032                }
21033                switch (r[0]) {
21034                    case "Z":
21035                        x = mx;
21036                        y = my;
21037                        break;
21038                    case "H":
21039                        x = r[1];
21040                        break;
21041                    case "V":
21042                        y = r[1];
21043                        break;
21044                    case "M":
21045                        mx = r[r.length - 2];
21046                        my = r[r.length - 1];
21047                    default:
21048                        x = r[r.length - 2];
21049                        y = r[r.length - 1];
21050                }
21051            }
21052            res.toString = R._path2string;
21053            return res;
21054        }, null, pathClone),
21055        l2c = function (x1, y1, x2, y2) {
21056            return [x1, y1, x2, y2, x2, y2];
21057        },
21058        q2c = function (x1, y1, ax, ay, x2, y2) {
21059            var _13 = 1 / 3,
21060                _23 = 2 / 3;
21061            return [
21062                _13 * x1 + _23 * ax,
21063                _13 * y1 + _23 * ay,
21064                _13 * x2 + _23 * ax,
21065                _13 * y2 + _23 * ay,
21066                x2,
21067                y2
21068            ];
21069        },
21070        a2c = function (x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2, recursive) {
21071            // for more information of where this math came from visit:
21072            // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes
21073            var _120 = PI * 120 / 180,
21074                rad = PI / 180 * (+angle || 0),
21075                res = [],
21076                xy,
21077                rotate = cacher(function (x, y, rad) {
21078                    var X = x * math.cos(rad) - y * math.sin(rad),
21079                        Y = x * math.sin(rad) + y * math.cos(rad);
21080                    return { x: X, y: Y };
21081                });
21082            if (!recursive) {
21083                xy = rotate(x1, y1, -rad);
21084                x1 = xy.x;
21085                y1 = xy.y;
21086                xy = rotate(x2, y2, -rad);
21087                x2 = xy.x;
21088                y2 = xy.y;
21089                var cos = math.cos(PI / 180 * angle),
21090                    sin = math.sin(PI / 180 * angle),
21091                    x = (x1 - x2) / 2,
21092                    y = (y1 - y2) / 2;
21093                var h = (x * x) / (rx * rx) + (y * y) / (ry * ry);
21094                if (h > 1) {
21095                    h = math.sqrt(h);
21096                    rx = h * rx;
21097                    ry = h * ry;
21098                }
21099                var rx2 = rx * rx,
21100                    ry2 = ry * ry,
21101                    k = (large_arc_flag == sweep_flag ? -1 : 1) *
21102                        math.sqrt(abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x))),
21103                    cx = k * rx * y / ry + (x1 + x2) / 2,
21104                    cy = k * -ry * x / rx + (y1 + y2) / 2,
21105                    f1 = math.asin(((y1 - cy) / ry).toFixed(9)),
21106                    f2 = math.asin(((y2 - cy) / ry).toFixed(9));
21107
21108                f1 = x1 < cx ? PI - f1 : f1;
21109                f2 = x2 < cx ? PI - f2 : f2;
21110                f1 < 0 && (f1 = PI * 2 + f1);
21111                f2 < 0 && (f2 = PI * 2 + f2);
21112                if (sweep_flag && f1 > f2) {
21113                    f1 = f1 - PI * 2;
21114                }
21115                if (!sweep_flag && f2 > f1) {
21116                    f2 = f2 - PI * 2;
21117                }
21118            } else {
21119                f1 = recursive[0];
21120                f2 = recursive[1];
21121                cx = recursive[2];
21122                cy = recursive[3];
21123            }
21124            var df = f2 - f1;
21125            if (abs(df) > _120) {
21126                var f2old = f2,
21127                    x2old = x2,
21128                    y2old = y2;
21129                f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1);
21130                x2 = cx + rx * math.cos(f2);
21131                y2 = cy + ry * math.sin(f2);
21132                res = a2c(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [f2, f2old, cx, cy]);
21133            }
21134            df = f2 - f1;
21135            var c1 = math.cos(f1),
21136                s1 = math.sin(f1),
21137                c2 = math.cos(f2),
21138                s2 = math.sin(f2),
21139                t = math.tan(df / 4),
21140                hx = 4 / 3 * rx * t,
21141                hy = 4 / 3 * ry * t,
21142                m1 = [x1, y1],
21143                m2 = [x1 + hx * s1, y1 - hy * c1],
21144                m3 = [x2 + hx * s2, y2 - hy * c2],
21145                m4 = [x2, y2];
21146            m2[0] = 2 * m1[0] - m2[0];
21147            m2[1] = 2 * m1[1] - m2[1];
21148            if (recursive) {
21149                return [m2, m3, m4][concat](res);
21150            } else {
21151                res = [m2, m3, m4][concat](res).join().split(",");
21152                var newres = [];
21153                for (var i = 0, ii = res.length; i < ii; i++) {
21154                    newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x;
21155                }
21156                return newres;
21157            }
21158        },
21159        findDotAtSegment = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
21160            var t1 = 1 - t;
21161            return {
21162                x: pow(t1, 3) * p1x + pow(t1, 2) * 3 * t * c1x + t1 * 3 * t * t * c2x + pow(t, 3) * p2x,
21163                y: pow(t1, 3) * p1y + pow(t1, 2) * 3 * t * c1y + t1 * 3 * t * t * c2y + pow(t, 3) * p2y
21164            };
21165        },
21166        curveDim = cacher(function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) {
21167            var a = (c2x - 2 * c1x + p1x) - (p2x - 2 * c2x + c1x),
21168                b = 2 * (c1x - p1x) - 2 * (c2x - c1x),
21169                c = p1x - c1x,
21170                t1 = (-b + math.sqrt(b * b - 4 * a * c)) / 2 / a,
21171                t2 = (-b - math.sqrt(b * b - 4 * a * c)) / 2 / a,
21172                y = [p1y, p2y],
21173                x = [p1x, p2x],
21174                dot;
21175            abs(t1) > "1e12" && (t1 = .5);
21176            abs(t2) > "1e12" && (t2 = .5);
21177            if (t1 > 0 && t1 < 1) {
21178                dot = findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t1);
21179                x.push(dot.x);
21180                y.push(dot.y);
21181            }
21182            if (t2 > 0 && t2 < 1) {
21183                dot = findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t2);
21184                x.push(dot.x);
21185                y.push(dot.y);
21186            }
21187            a = (c2y - 2 * c1y + p1y) - (p2y - 2 * c2y + c1y);
21188            b = 2 * (c1y - p1y) - 2 * (c2y - c1y);
21189            c = p1y - c1y;
21190            t1 = (-b + math.sqrt(b * b - 4 * a * c)) / 2 / a;
21191            t2 = (-b - math.sqrt(b * b - 4 * a * c)) / 2 / a;
21192            abs(t1) > "1e12" && (t1 = .5);
21193            abs(t2) > "1e12" && (t2 = .5);
21194            if (t1 > 0 && t1 < 1) {
21195                dot = findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t1);
21196                x.push(dot.x);
21197                y.push(dot.y);
21198            }
21199            if (t2 > 0 && t2 < 1) {
21200                dot = findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t2);
21201                x.push(dot.x);
21202                y.push(dot.y);
21203            }
21204            return {
21205                min: { x: mmin[apply](0, x), y: mmin[apply](0, y) },
21206                max: { x: mmax[apply](0, x), y: mmax[apply](0, y) }
21207            };
21208        }),
21209        path2curve = R._path2curve = cacher(function (path, path2) {
21210            var p = pathToAbsolute(path),
21211                p2 = path2 && pathToAbsolute(path2),
21212                attrs = { x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null },
21213                attrs2 = { x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null },
21214                processPath = function (path, d) {
21215                    var nx, ny;
21216                    if (!path) {
21217                        return ["C", d.x, d.y, d.x, d.y, d.x, d.y];
21218                    }
21219                    !(path[0] in { T: 1, Q: 1 }) && (d.qx = d.qy = null);
21220                    switch (path[0]) {
21221                        case "M":
21222                            d.X = path[1];
21223                            d.Y = path[2];
21224                            break;
21225                        case "A":
21226                            path = ["C"][concat](a2c[apply](0, [d.x, d.y][concat](path.slice(1))));
21227                            break;
21228                        case "S":
21229                            nx = d.x + (d.x - (d.bx || d.x));
21230                            ny = d.y + (d.y - (d.by || d.y));
21231                            path = ["C", nx, ny][concat](path.slice(1));
21232                            break;
21233                        case "T":
21234                            d.qx = d.x + (d.x - (d.qx || d.x));
21235                            d.qy = d.y + (d.y - (d.qy || d.y));
21236                            path = ["C"][concat](q2c(d.x, d.y, d.qx, d.qy, path[1], path[2]));
21237                            break;
21238                        case "Q":
21239                            d.qx = path[1];
21240                            d.qy = path[2];
21241                            path = ["C"][concat](q2c(d.x, d.y, path[1], path[2], path[3], path[4]));
21242                            break;
21243                        case "L":
21244                            path = ["C"][concat](l2c(d.x, d.y, path[1], path[2]));
21245                            break;
21246                        case "H":
21247                            path = ["C"][concat](l2c(d.x, d.y, path[1], d.y));
21248                            break;
21249                        case "V":
21250                            path = ["C"][concat](l2c(d.x, d.y, d.x, path[1]));
21251                            break;
21252                        case "Z":
21253                            path = ["C"][concat](l2c(d.x, d.y, d.X, d.Y));
21254                            break;
21255                    }
21256                    return path;
21257                },
21258                fixArc = function (pp, i) {
21259                    if (pp[i].length > 7) {
21260                        pp[i].shift();
21261                        var pi = pp[i];
21262                        while (pi.length) {
21263                            pp.splice(i++, 0, ["C"][concat](pi.splice(0, 6)));
21264                        }
21265                        pp.splice(i, 1);
21266                        ii = mmax(p.length, p2 && p2.length || 0);
21267                    }
21268                },
21269                fixM = function (path1, path2, a1, a2, i) {
21270                    if (path1 && path2 && path1[i][0] == "M" && path2[i][0] != "M") {
21271                        path2.splice(i, 0, ["M", a2.x, a2.y]);
21272                        a1.bx = 0;
21273                        a1.by = 0;
21274                        a1.x = path1[i][1];
21275                        a1.y = path1[i][2];
21276                        ii = mmax(p.length, p2 && p2.length || 0);
21277                    }
21278                };
21279            for (var i = 0, ii = mmax(p.length, p2 && p2.length || 0); i < ii; i++) {
21280                p[i] = processPath(p[i], attrs);
21281                fixArc(p, i);
21282                p2 && (p2[i] = processPath(p2[i], attrs2));
21283                p2 && fixArc(p2, i);
21284                fixM(p, p2, attrs, attrs2, i);
21285                fixM(p2, p, attrs2, attrs, i);
21286                var seg = p[i],
21287                    seg2 = p2 && p2[i],
21288                    seglen = seg.length,
21289                    seg2len = p2 && seg2.length;
21290                attrs.x = seg[seglen - 2];
21291                attrs.y = seg[seglen - 1];
21292                attrs.bx = toFloat(seg[seglen - 4]) || attrs.x;
21293                attrs.by = toFloat(seg[seglen - 3]) || attrs.y;
21294                attrs2.bx = p2 && (toFloat(seg2[seg2len - 4]) || attrs2.x);
21295                attrs2.by = p2 && (toFloat(seg2[seg2len - 3]) || attrs2.y);
21296                attrs2.x = p2 && seg2[seg2len - 2];
21297                attrs2.y = p2 && seg2[seg2len - 1];
21298            }
21299            return p2 ? [p, p2] : p;
21300        }, null, pathClone),
21301        parseDots = R._parseDots = cacher(function (gradient) {
21302            var dots = [];
21303            for (var i = 0, ii = gradient.length; i < ii; i++) {
21304                var dot = {},
21305                    par = gradient[i].match(/^([^:]*):?([\d\.]*)/);
21306                dot.color = R.getRGB(par[1]);
21307                if (dot.color.error) {
21308                    return null;
21309                }
21310                dot.color = dot.color.hex;
21311                par[2] && (dot.offset = par[2] + "%");
21312                dots.push(dot);
21313            }
21314            for (i = 1, ii = dots.length - 1; i < ii; i++) {
21315                if (!dots[i].offset) {
21316                    var start = toFloat(dots[i - 1].offset || 0),
21317                        end = 0;
21318                    for (var j = i + 1; j < ii; j++) {
21319                        if (dots[j].offset) {
21320                            end = dots[j].offset;
21321                            break;
21322                        }
21323                    }
21324                    if (!end) {
21325                        end = 100;
21326                        j = ii;
21327                    }
21328                    end = toFloat(end);
21329                    var d = (end - start) / (j - i + 1);
21330                    for (; i < j; i++) {
21331                        start += d;
21332                        dots[i].offset = start + "%";
21333                    }
21334                }
21335            }
21336            return dots;
21337        }),
21338        tear = R._tear = function (el, paper) {
21339            el == paper.top && (paper.top = el.prev);
21340            el == paper.bottom && (paper.bottom = el.next);
21341            el.next && (el.next.prev = el.prev);
21342            el.prev && (el.prev.next = el.next);
21343        },
21344        tofront = R._tofront = function (el, paper) {
21345            if (paper.top === el) {
21346                return;
21347            }
21348            tear(el, paper);
21349            el.next = null;
21350            el.prev = paper.top;
21351            paper.top.next = el;
21352            paper.top = el;
21353        },
21354        toback = R._toback = function (el, paper) {
21355            if (paper.bottom === el) {
21356                return;
21357            }
21358            tear(el, paper);
21359            el.next = paper.bottom;
21360            el.prev = null;
21361            paper.bottom.prev = el;
21362            paper.bottom = el;
21363        },
21364        insertafter = R._insertafter = function (el, el2, paper) {
21365            tear(el, paper);
21366            el2 == paper.top && (paper.top = el);
21367            el2.next && (el2.next.prev = el);
21368            el.next = el2.next;
21369            el.prev = el2;
21370            el2.next = el;
21371        },
21372        insertbefore = R._insertbefore = function (el, el2, paper) {
21373            tear(el, paper);
21374            el2 == paper.bottom && (paper.bottom = el);
21375            el2.prev && (el2.prev.next = el);
21376            el.prev = el2.prev;
21377            el2.prev = el;
21378            el.next = el2;
21379        },
21380        removed = function (methodname) {
21381            return function () {
21382                throw new Error("Rapha\xebl: you are calling to method \u201c" + methodname + "\u201d of removed object");
21383            };
21384        },
21385        extractTransform = R._extractTransform = function (el, tstr) {
21386            if (tstr == null) {
21387                return el._.transform;
21388            }
21389            tstr = Str(tstr).replace(/\.{3}|\u2026/g, el._.transform || E);
21390            var tdata = R.parseTransformString(tstr),
21391                deg = 0,
21392                dx = 0,
21393                dy = 0,
21394                sx = 1,
21395                sy = 1,
21396                _ = el._,
21397                m = new Matrix;
21398            _.transform = tdata || [];
21399            if (tdata) {
21400                for (var i = 0, ii = tdata.length; i < ii; i++) {
21401                    var t = tdata[i],
21402                        tlen = t.length,
21403                        bb;
21404                    t[0] = Str(t[0]).toLowerCase();
21405                    if (t[0] == "t" && tlen == 3) {
21406                        m.translate(t[1], t[2]);
21407                    } else if (t[0] == "r") {
21408                        if (tlen == 2) {
21409                            bb = bb || el.getBBox(1);
21410                            m.rotate(t[1], bb.x + bb.width / 2, bb.y + bb.height / 2);
21411                            deg += t[1];
21412                        } else if (tlen == 4) {
21413                            m.rotate(t[1], t[2], t[3]);
21414                            deg += t[1];
21415                        }
21416                    } else if (t[0] == "s") {
21417                        if (tlen == 2 || tlen == 3) {
21418                            bb = bb || el.getBBox(1);
21419                            m.scale(t[1], t[tlen - 1], bb.x + bb.width / 2, bb.y + bb.height / 2);
21420                            sx *= t[1];
21421                            sy *= t[tlen - 1];
21422                        } else if (tlen == 5) {
21423                            m.scale(t[1], t[2], t[3], t[4]);
21424                            sx *= t[1];
21425                            sy *= t[2];
21426                        }
21427                    } else if (t[0] == "m" && tlen == 7) {
21428                        m.add(t[1], t[2], t[3], t[4], t[5], t[6]);
21429                    }
21430                    _.dirtyT = 1;
21431                    el.matrix = m;
21432                }
21433            }
21434
21435            el.matrix = m;
21436
21437            _.sx = sx;
21438            _.sy = sy;
21439            _.deg = deg;
21440            _.dx = dx = m.e;
21441            _.dy = dy = m.f;
21442
21443            if (sx == 1 && sy == 1 && !deg && _.bbox) {
21444                _.bbox.x += +dx;
21445                _.bbox.y += +dy;
21446            } else {
21447                _.dirtyT = 1;
21448            }
21449        },
21450        getEmpty = function (item) {
21451            switch (item[0]) {
21452                case "t": return ["t", 0, 0];
21453                case "m": return ["m", 1, 0, 0, 1, 0, 0];
21454                case "r": if (item.length == 4) {
21455                    return ["r", 0, item[2], item[3]];
21456                } else {
21457                    return ["r", 0];
21458                }
21459                case "s": if (item.length == 5) {
21460                    return ["s", 1, 1, item[3], item[4]];
21461                } else if (item.length == 3) {
21462                    return ["s", 1, 1];
21463                } else {
21464                    return ["s", 1];
21465                }
21466            }
21467        },
21468        equaliseTransform = R._equaliseTransform = function (t1, t2) {
21469            t2 = Str(t2).replace(/\.{3}|\u2026/g, t1);
21470            t1 = R.parseTransformString(t1) || [];
21471            t2 = R.parseTransformString(t2) || [];
21472            var maxlength = mmax(t1.length, t2.length),
21473                from = [],
21474                to = [],
21475                i = 0, j, jj,
21476                tt1, tt2;
21477            for (; i < maxlength; i++) {
21478                tt1 = t1[i] || getEmpty(t2[i]);
21479                tt2 = t2[i] || getEmpty(tt1);
21480                if ((tt1[0] != tt2[0]) ||
21481                    (tt1[0] == "r" && (tt1[2] != tt2[2] || tt1[3] != tt2[3])) ||
21482                    (tt1[0] == "s" && (tt1[3] != tt2[3] || tt1[4] != tt2[4]))
21483                ) {
21484                    return;
21485                }
21486                from[i] = [];
21487                to[i] = [];
21488                for (j = 0, jj = mmax(tt1.length, tt2.length); j < jj; j++) {
21489                    j in tt1 && (from[i][j] = tt1[j]);
21490                    j in tt2 && (to[i][j] = tt2[j]);
21491                }
21492            }
21493            return {
21494                from: from,
21495                to: to
21496            };
21497        };
21498    R._getContainer = function (x, y, w, h) {
21499        var container;
21500        container = h == null && !R.is(x, "object") ? g.doc.getElementById(x) : x;
21501        if (container == null) {
21502            return;
21503        }
21504        if (container.tagName) {
21505            if (y == null) {
21506                return {
21507                    container: container,
21508                    width: container.style.pixelWidth || container.offsetWidth,
21509                    height: container.style.pixelHeight || container.offsetHeight
21510                };
21511            } else {
21512                return {
21513                    container: container,
21514                    width: y,
21515                    height: w
21516                };
21517            }
21518        }
21519        return {
21520            container: 1,
21521            x: x,
21522            y: y,
21523            width: w,
21524            height: h
21525        };
21526    };
21527
21528    R.pathToRelative = pathToRelative;
21529    R._engine = {};
21530
21531    R.path2curve = path2curve;
21532
21533    R.matrix = function (a, b, c, d, e, f) {
21534        return new Matrix(a, b, c, d, e, f);
21535    };
21536    function Matrix(a, b, c, d, e, f) {
21537        if (a != null) {
21538            this.a = +a;
21539            this.b = +b;
21540            this.c = +c;
21541            this.d = +d;
21542            this.e = +e;
21543            this.f = +f;
21544        } else {
21545            this.a = 1;
21546            this.b = 0;
21547            this.c = 0;
21548            this.d = 1;
21549            this.e = 0;
21550            this.f = 0;
21551        }
21552    }
21553    (function (matrixproto) {
21554
21555        matrixproto.add = function (a, b, c, d, e, f) {
21556            var out = [[], [], []],
21557                m = [[this.a, this.c, this.e], [this.b, this.d, this.f], [0, 0, 1]],
21558                matrix = [[a, c, e], [b, d, f], [0, 0, 1]],
21559                x, y, z, res;
21560
21561            if (a && a instanceof Matrix) {
21562                matrix = [[a.a, a.c, a.e], [a.b, a.d, a.f], [0, 0, 1]];
21563            }
21564
21565            for (x = 0; x < 3; x++) {
21566                for (y = 0; y < 3; y++) {
21567                    res = 0;
21568                    for (z = 0; z < 3; z++) {
21569                        res += m[x][z] * matrix[z][y];
21570                    }
21571                    out[x][y] = res;
21572                }
21573            }
21574            this.a = out[0][0];
21575            this.b = out[1][0];
21576            this.c = out[0][1];
21577            this.d = out[1][1];
21578            this.e = out[0][2];
21579            this.f = out[1][2];
21580        };
21581
21582        matrixproto.invert = function () {
21583            var me = this,
21584                x = me.a * me.d - me.b * me.c;
21585            return new Matrix(me.d / x, -me.b / x, -me.c / x, me.a / x, (me.c * me.f - me.d * me.e) / x, (me.b * me.e - me.a * me.f) / x);
21586        };
21587
21588        matrixproto.clone = function () {
21589            return new Matrix(this.a, this.b, this.c, this.d, this.e, this.f);
21590        };
21591
21592        matrixproto.translate = function (x, y) {
21593            this.add(1, 0, 0, 1, x, y);
21594        };
21595
21596        matrixproto.scale = function (x, y, cx, cy) {
21597            y == null && (y = x);
21598            (cx || cy) && this.add(1, 0, 0, 1, cx, cy);
21599            this.add(x, 0, 0, y, 0, 0);
21600            (cx || cy) && this.add(1, 0, 0, 1, -cx, -cy);
21601        };
21602
21603        matrixproto.rotate = function (a, x, y) {
21604            a = R.rad(a);
21605            x = x || 0;
21606            y = y || 0;
21607            var cos = +math.cos(a).toFixed(9),
21608                sin = +math.sin(a).toFixed(9);
21609            this.add(cos, sin, -sin, cos, x, y);
21610            this.add(1, 0, 0, 1, -x, -y);
21611        };
21612
21613        matrixproto.x = function (x, y) {
21614            return x * this.a + y * this.c + this.e;
21615        };
21616
21617        matrixproto.y = function (x, y) {
21618            return x * this.b + y * this.d + this.f;
21619        };
21620        matrixproto.get = function (i) {
21621            return +this[Str.fromCharCode(97 + i)].toFixed(4);
21622        };
21623        matrixproto.toString = function () {
21624            return R.svg ?
21625                "matrix(" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)].join() + ")" :
21626                [this.get(0), this.get(2), this.get(1), this.get(3), 0, 0].join();
21627        };
21628        matrixproto.toFilter = function () {
21629            return "progid:DXImageTransform.Microsoft.Matrix(M11=" + this.get(0) +
21630                ", M12=" + this.get(2) + ", M21=" + this.get(1) + ", M22=" + this.get(3) +
21631                ", Dx=" + this.get(4) + ", Dy=" + this.get(5) + ", sizingmethod='auto expand')";
21632        };
21633        matrixproto.offset = function () {
21634            return [this.e.toFixed(4), this.f.toFixed(4)];
21635        };
21636        function norm(a) {
21637            return a[0] * a[0] + a[1] * a[1];
21638        }
21639        function normalize(a) {
21640            var mag = math.sqrt(norm(a));
21641            a[0] && (a[0] /= mag);
21642            a[1] && (a[1] /= mag);
21643        }
21644
21645        matrixproto.split = function () {
21646            var out = {};
21647            // translation
21648            out.dx = this.e;
21649            out.dy = this.f;
21650
21651            // scale and shear
21652            var row = [[this.a, this.c], [this.b, this.d]];
21653            out.scalex = math.sqrt(norm(row[0]));
21654            normalize(row[0]);
21655
21656            out.shear = row[0][0] * row[1][0] + row[0][1] * row[1][1];
21657            row[1] = [row[1][0] - row[0][0] * out.shear, row[1][1] - row[0][1] * out.shear];
21658
21659            out.scaley = math.sqrt(norm(row[1]));
21660            normalize(row[1]);
21661            out.shear /= out.scaley;
21662
21663            // rotation
21664            var sin = -row[0][1],
21665                cos = row[1][1];
21666            if (cos < 0) {
21667                out.rotate = R.deg(math.acos(cos));
21668                if (sin < 0) {
21669                    out.rotate = 360 - out.rotate;
21670                }
21671            } else {
21672                out.rotate = R.deg(math.asin(sin));
21673            }
21674
21675            out.isSimple = !+out.shear.toFixed(9) && (out.scalex.toFixed(9) == out.scaley.toFixed(9) || !out.rotate);
21676            out.isSuperSimple = !+out.shear.toFixed(9) && out.scalex.toFixed(9) == out.scaley.toFixed(9) && !out.rotate;
21677            out.noRotation = !+out.shear.toFixed(9) && !out.rotate;
21678            return out;
21679        };
21680
21681        matrixproto.toTransformString = function () {
21682            var s = this.split();
21683            if (s.isSimple) {
21684                return "t" + [s.dx, s.dy] + "s" + [s.scalex, s.scaley, 0, 0] + "r" + [s.rotate, 0, 0];
21685            } else {
21686                return "m" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)];
21687            }
21688        };
21689    })(Matrix.prototype);
21690
21691    // WebKit rendering bug workaround method
21692    var version = navigator.userAgent.match(/Version\/(.*?)\s/) || navigator.userAgent.match(/Chrome\/(\d+)/);
21693    if ((navigator.vendor == "Apple Computer, Inc.") && (version && version[1] < 4 || navigator.platform.slice(0, 2) == "iP") ||
21694        (navigator.vendor == "Google Inc." && version && version[1] < 8)) {
21695
21696        paperproto.safari = function () {
21697            var rect = this.rect(-99, -99, this.width + 99, this.height + 99).attr({ stroke: "none" });
21698            setTimeout(function () { rect.remove(); });
21699        };
21700    } else {
21701        paperproto.safari = fun;
21702    }
21703
21704    var preventDefault = function () {
21705        this.returnValue = false;
21706    },
21707        preventTouch = function () {
21708            return this.originalEvent.preventDefault();
21709        },
21710        stopPropagation = function () {
21711            this.cancelBubble = true;
21712        },
21713        stopTouch = function () {
21714            return this.originalEvent.stopPropagation();
21715        },
21716        addEvent = (function () {
21717            if (g.doc.addEventListener) {
21718                return function (obj, type, fn, element) {
21719                    var realName = supportsTouch && touchMap[type] ? touchMap[type] : type,
21720                        f = function (e) {
21721                            var scrollY = g.doc.documentElement.scrollTop || g.doc.body.scrollTop,
21722                                scrollX = g.doc.documentElement.scrollLeft || g.doc.body.scrollLeft,
21723                                x = e.clientX + scrollX,
21724                                y = e.clientY + scrollY;
21725                            if (supportsTouch && touchMap[has](type)) {
21726                                for (var i = 0, ii = e.targetTouches && e.targetTouches.length; i < ii; i++) {
21727                                    if (e.targetTouches[i].target == obj) {
21728                                        var olde = e;
21729                                        e = e.targetTouches[i];
21730                                        e.originalEvent = olde;
21731                                        e.preventDefault = preventTouch;
21732                                        e.stopPropagation = stopTouch;
21733                                        break;
21734                                    }
21735                                }
21736                            }
21737                            return fn.call(element, e, x, y);
21738                        };
21739                    obj.addEventListener(realName, f, false);
21740                    return function () {
21741                        obj.removeEventListener(realName, f, false);
21742                        return true;
21743                    };
21744                };
21745            } else if (g.doc.attachEvent) {
21746                return function (obj, type, fn, element) {
21747                    var f = function (e) {
21748                        e = e || g.win.event;
21749                        var scrollY = g.doc.documentElement.scrollTop || g.doc.body.scrollTop,
21750                            scrollX = g.doc.documentElement.scrollLeft || g.doc.body.scrollLeft,
21751                            x = e.clientX + scrollX,
21752                            y = e.clientY + scrollY;
21753                        e.preventDefault = e.preventDefault || preventDefault;
21754                        e.stopPropagation = e.stopPropagation || stopPropagation;
21755                        return fn.call(element, e, x, y);
21756                    };
21757                    obj.attachEvent("on" + type, f);
21758                    var detacher = function () {
21759                        obj.detachEvent("on" + type, f);
21760                        return true;
21761                    };
21762                    return detacher;
21763                };
21764            }
21765        })(),
21766        drag = [],
21767        dragMove = function (e) {
21768            var x = e.clientX,
21769                y = e.clientY,
21770                scrollY = g.doc.documentElement.scrollTop || g.doc.body.scrollTop,
21771                scrollX = g.doc.documentElement.scrollLeft || g.doc.body.scrollLeft,
21772                dragi,
21773                j = drag.length;
21774            while (j--) {
21775                dragi = drag[j];
21776                if (supportsTouch) {
21777                    var i = e.touches.length,
21778                        touch;
21779                    while (i--) {
21780                        touch = e.touches[i];
21781                        if (touch.identifier == dragi.el._drag.id) {
21782                            x = touch.clientX;
21783                            y = touch.clientY;
21784                            (e.originalEvent ? e.originalEvent : e).preventDefault();
21785                            break;
21786                        }
21787                    }
21788                } else {
21789                    e.preventDefault();
21790                }
21791                var node = dragi.el.node,
21792                    o,
21793                    next = node.nextSibling,
21794                    parent = node.parentNode,
21795                    display = node.style.display;
21796                g.win.opera && parent.removeChild(node);
21797                node.style.display = "none";
21798                o = dragi.el.paper.getElementByPoint(x, y);
21799                node.style.display = display;
21800                g.win.opera && (next ? parent.insertBefore(node, next) : parent.appendChild(node));
21801                o && eve("drag.over." + dragi.el.id, dragi.el, o);
21802                x += scrollX;
21803                y += scrollY;
21804                eve("drag.move." + dragi.el.id, dragi.move_scope || dragi.el, x - dragi.el._drag.x, y - dragi.el._drag.y, x, y, e);
21805            }
21806        },
21807        dragUp = function (e) {
21808            R.unmousemove(dragMove).unmouseup(dragUp);
21809            var i = drag.length,
21810                dragi;
21811            while (i--) {
21812                dragi = drag[i];
21813                dragi.el._drag = {};
21814                eve("drag.end." + dragi.el.id, dragi.end_scope || dragi.start_scope || dragi.move_scope || dragi.el, e);
21815            }
21816            drag = [];
21817        },
21818
21819        elproto = R.el = {};
21820
21821
21822
21823
21824
21825
21826
21827
21828
21829
21830
21831
21832
21833
21834
21835
21836
21837
21838
21839
21840
21841
21842
21843
21844
21845
21846
21847
21848
21849
21850
21851
21852    for (var i = events.length; i--;) {
21853        (function (eventName) {
21854            R[eventName] = elproto[eventName] = function (fn, scope) {
21855                if (R.is(fn, "function")) {
21856                    this.events = this.events || [];
21857                    this.events.push({ name: eventName, f: fn, unbind: addEvent(this.shape || this.node || g.doc, eventName, fn, scope || this) });
21858                }
21859                return this;
21860            };
21861            R["un" + eventName] = elproto["un" + eventName] = function (fn) {
21862                var events = this.events,
21863                    l = events.length;
21864                while (l--) if (events[l].name == eventName && events[l].f == fn) {
21865                    events[l].unbind();
21866                    events.splice(l, 1);
21867                    !events.length && delete this.events;
21868                    return this;
21869                }
21870                return this;
21871            };
21872        })(events[i]);
21873    }
21874
21875
21876    elproto.data = function (key, value) {
21877        var data = eldata[this.id] = eldata[this.id] || {};
21878        if (arguments.length == 1) {
21879            if (R.is(key, "object")) {
21880                for (var i in key) if (key[has](i)) {
21881                    this.data(i, key[i]);
21882                }
21883                return this;
21884            }
21885            eve("data.get." + this.id, this, data[key], key);
21886            return data[key];
21887        }
21888        data[key] = value;
21889        eve("data.set." + this.id, this, value, key);
21890        return this;
21891    };
21892
21893    elproto.removeData = function (key) {
21894        if (key == null) {
21895            eldata[this.id] = {};
21896        } else {
21897            eldata[this.id] && delete eldata[this.id][key];
21898        }
21899        return this;
21900    };
21901
21902    elproto.hover = function (f_in, f_out, scope_in, scope_out) {
21903        return this.mouseover(f_in, scope_in).mouseout(f_out, scope_out || scope_in);
21904    };
21905
21906    elproto.unhover = function (f_in, f_out) {
21907        return this.unmouseover(f_in).unmouseout(f_out);
21908    };
21909
21910    elproto.drag = function (onmove, onstart, onend, move_scope, start_scope, end_scope) {
21911        function start(e) {
21912            (e.originalEvent || e).preventDefault();
21913            var scrollY = g.doc.documentElement.scrollTop || g.doc.body.scrollTop,
21914                scrollX = g.doc.documentElement.scrollLeft || g.doc.body.scrollLeft;
21915            this._drag.x = e.clientX + scrollX;
21916            this._drag.y = e.clientY + scrollY;
21917            this._drag.id = e.identifier;
21918            !drag.length && R.mousemove(dragMove).mouseup(dragUp);
21919            drag.push({ el: this, move_scope: move_scope, start_scope: start_scope, end_scope: end_scope });
21920            onstart && eve.on("drag.start." + this.id, onstart);
21921            onmove && eve.on("drag.move." + this.id, onmove);
21922            onend && eve.on("drag.end." + this.id, onend);
21923            eve("drag.start." + this.id, start_scope || move_scope || this, e.clientX + scrollX, e.clientY + scrollY, e);
21924        }
21925        this._drag = {};
21926        this.mousedown(start);
21927        return this;
21928    };
21929
21930    elproto.onDragOver = function (f) {
21931        f ? eve.on("drag.over." + this.id, f) : eve.unbind("drag.over." + this.id);
21932    };
21933
21934    elproto.undrag = function () {
21935        var i = drag.length;
21936        while (i--) if (drag[i].el == this) {
21937            R.unmousedown(drag[i].start);
21938            drag.splice(i++, 1);
21939            eve.unbind("drag.*." + this.id);
21940        }
21941        !drag.length && R.unmousemove(dragMove).unmouseup(dragUp);
21942    };
21943
21944    paperproto.circle = function (x, y, r) {
21945        var out = R._engine.circle(this, x || 0, y || 0, r || 0);
21946        this.__set__ && this.__set__.push(out);
21947        return out;
21948    };
21949
21950    paperproto.rect = function (x, y, w, h, r) {
21951        var out = R._engine.rect(this, x || 0, y || 0, w || 0, h || 0, r || 0);
21952        this.__set__ && this.__set__.push(out);
21953        return out;
21954    };
21955
21956    paperproto.ellipse = function (x, y, rx, ry) {
21957        var out = R._engine.ellipse(this, x || 0, y || 0, rx || 0, ry || 0);
21958        this.__set__ && this.__set__.push(out);
21959        return out;
21960    };
21961
21962    paperproto.path = function (pathString) {
21963        pathString && !R.is(pathString, string) && !R.is(pathString[0], array) && (pathString += E);
21964        var out = R._engine.path(R.format[apply](R, arguments), this);
21965        this.__set__ && this.__set__.push(out);
21966        return out;
21967    };
21968
21969    paperproto.image = function (src, x, y, w, h) {
21970        var out = R._engine.image(this, src || "about:blank", x || 0, y || 0, w || 0, h || 0);
21971        this.__set__ && this.__set__.push(out);
21972        return out;
21973    };
21974
21975    paperproto.text = function (x, y, text) {
21976        var out = R._engine.text(this, x || 0, y || 0, Str(text));
21977        this.__set__ && this.__set__.push(out);
21978        return out;
21979    };
21980
21981    paperproto.set = function (itemsArray) {
21982        !R.is(itemsArray, "array") && (itemsArray = Array.prototype.splice.call(arguments, 0, arguments.length));
21983        var out = new Set(itemsArray);
21984        this.__set__ && this.__set__.push(out);
21985        return out;
21986    };
21987
21988    paperproto.setStart = function (set) {
21989        this.__set__ = set || this.set();
21990    };
21991
21992    paperproto.setFinish = function (set) {
21993        var out = this.__set__;
21994        delete this.__set__;
21995        return out;
21996    };
21997
21998    paperproto.setSize = function (width, height) {
21999        return R._engine.setSize.call(this, width, height);
22000    };
22001
22002    paperproto.setViewBox = function (x, y, w, h, fit) {
22003        return R._engine.setViewBox.call(this, x, y, w, h, fit);
22004    };
22005
22006
22007    paperproto.top = paperproto.bottom = null;
22008
22009    paperproto.raphael = R;
22010    var getOffset = function (elem) {
22011        var box = elem.getBoundingClientRect(),
22012            doc = elem.ownerDocument,
22013            body = doc.body,
22014            docElem = doc.documentElement,
22015            clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
22016            top = box.top + (g.win.pageYOffset || docElem.scrollTop || body.scrollTop) - clientTop,
22017            left = box.left + (g.win.pageXOffset || docElem.scrollLeft || body.scrollLeft) - clientLeft;
22018        return {
22019            y: top,
22020            x: left
22021        };
22022    };
22023
22024    paperproto.getElementByPoint = function (x, y) {
22025        var paper = this,
22026            svg = paper.canvas,
22027            target = g.doc.elementFromPoint(x, y);
22028        if (g.win.opera && target.tagName == "svg") {
22029            var so = getOffset(svg),
22030                sr = svg.createSVGRect();
22031            sr.x = x - so.x;
22032            sr.y = y - so.y;
22033            sr.width = sr.height = 1;
22034            var hits = svg.getIntersectionList(sr, null);
22035            if (hits.length) {
22036                target = hits[hits.length - 1];
22037            }
22038        }
22039        if (!target) {
22040            return null;
22041        }
22042        while (target.parentNode && target != svg.parentNode && !target.raphael) {
22043            target = target.parentNode;
22044        }
22045        target == paper.canvas.parentNode && (target = svg);
22046        target = target && target.raphael ? paper.getById(target.raphaelid) : null;
22047        return target;
22048    };
22049
22050    paperproto.getById = function (id) {
22051        var bot = this.bottom;
22052        while (bot) {
22053            if (bot.id == id) {
22054                return bot;
22055            }
22056            bot = bot.next;
22057        }
22058        return null;
22059    };
22060
22061    paperproto.forEach = function (callback, thisArg) {
22062        var bot = this.bottom;
22063        while (bot) {
22064            if (callback.call(thisArg, bot) === false) {
22065                return this;
22066            }
22067            bot = bot.next;
22068        }
22069        return this;
22070    };
22071    function x_y() {
22072        return this.x + S + this.y;
22073    }
22074    function x_y_w_h() {
22075        return this.x + S + this.y + S + this.width + " \xd7 " + this.height;
22076    }
22077
22078    elproto.getBBox = function (isWithoutTransform) {
22079        if (this.removed) {
22080            return {};
22081        }
22082        var _ = this._;
22083        if (isWithoutTransform) {
22084            if (_.dirty || !_.bboxwt) {
22085                this.realPath = getPath[this.type](this);
22086                _.bboxwt = pathDimensions(this.realPath);
22087                _.bboxwt.toString = x_y_w_h;
22088                _.dirty = 0;
22089            }
22090            return _.bboxwt;
22091        }
22092        if (_.dirty || _.dirtyT || !_.bbox) {
22093            if (_.dirty || !this.realPath) {
22094                _.bboxwt = 0;
22095                this.realPath = getPath[this.type](this);
22096            }
22097            _.bbox = pathDimensions(mapPath(this.realPath, this.matrix
22097));
22098            _.bbox.toString = x_y_w_h;
22099            _.dirty = _.dirtyT = 0;
22100        }
22101        return _.bbox;
22102    };
22103
22104    elproto.clone = function () {
22105        if (this.removed) {
22106            return null;
22107        }
22108        return this.paper[this.type]().attr(this.attr());
22109    };
22110
22111    elproto.glow = function (glow) {
22112        if (this.type == "text") {
22113            return null;
22114        }
22115        glow = glow || {};
22116        var s = {
22117            width: (glow.width || 10) + (+this.attr("stroke-width") || 1),
22118            fill: glow.fill || false,
22119            opacity: glow.opacity || .5,
22120            offsetx: glow.offsetx || 0,
22121            offsety: glow.offsety || 0,
22122            color: glow.color || "#000"
22123        },
22124            c = s.width / 2,
22125            r = this.paper,
22126            out = r.set(),
22127            path = this.realPath || getPath[this.type](this);
22128        path = this.matrix ? mapPath(path, this.matrix) : path;
22129        for (var i = 1; i < c + 1; i++) {
22130            out.push(r.path(path).attr({
22131                stroke: s.color,
22132                fill: s.fill ? s.color : "none",
22133                "stroke-linejoin": "round",
22134                "stroke-linecap": "round",
22135                "stroke-width": +(s.width / c * i).toFixed(3),
22136                opacity: +(s.opacity / c).toFixed(3)
22137            }));
22138        }
22139        return out.insertBefore(this).translate(s.offsetx, s.offsety);
22140    };
22141    var curveslengths = {},
22142        getPointAtSegmentLength = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length) {
22143            var len = 0,
22144                precision = 100,
22145                name = [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y].join(),
22146                cache = curveslengths[name],
22147                old, dot;
22148            !cache && (curveslengths[name] = cache = { data: [] });
22149            cache.timer && clearTimeout(cache.timer);
22150            cache.timer = setTimeout(function () { delete curveslengths[name]; }, 2e3);
22151            if (length != null && !cache.precision) {
22152                var total = getPointAtSegmentLength(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y);
22153                cache.precision = ~~total * 10;
22154                cache.data = [];
22155            }
22156            precision = cache.precision || precision;
22157            for (var i = 0; i < precision + 1; i++) {
22158                if (cache.data[i * precision]) {
22159                    dot = cache.data[i * precision];
22160                } else {
22161                    dot = R.findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, i / precision);
22162                    cache.data[i * precision] = dot;
22163                }
22164                i && (len += pow(pow(old.x - dot.x, 2) + pow(old.y - dot.y, 2), .5));
22165                if (length != null && len >= length) {
22166                    return dot;
22167                }
22168                old = dot;
22169            }
22170            if (length == null) {
22171                return len;
22172            }
22173        },
22174        getLengthFactory = function (istotal, subpath) {
22175            return function (path, length, onlystart) {
22176                path = path2curve(path);
22177                var x, y, p, l, sp = "", subpaths = {}, point,
22178                    len = 0;
22179                for (var i = 0, ii = path.length; i < ii; i++) {
22180                    p = path[i];
22181                    if (p[0] == "M") {
22182                        x = +p[1];
22183                        y = +p[2];
22184                    } else {
22185                        l = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);
22186                        if (len + l > length) {
22187                            if (subpath && !subpaths.start) {
22188                                point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);
22189                                sp += ["C" + point.start.x, point.start.y, point.m.x, point.m.y, point.x, point.y];
22190                                if (onlystart) { return sp; }
22191                                subpaths.start = sp;
22192                                sp = ["M" + point.x, point.y + "C" + point.n.x, point.n.y, point.end.x, point.end.y, p[5], p[6]].join();
22193                                len += l;
22194                                x = +p[5];
22195                                y = +p[6];
22196                                continue;
22197                            }
22198                            if (!istotal && !subpath) {
22199                                point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);
22200                                return { x: point.x, y: point.y, alph
22200a: point.alpha };
22201                            }
22202                        }
22203                        len += l;
22204                        x = +p[5];
22205                        y = +p[6];
22206                    }
22207                    sp += p.shift() + p;
22208                }
22209                subpaths.end = sp;
22210                point = istotal ? len : subpath ? subpaths : R.findDotsAtSegment(x, y, p[0], p[1], p[2], p[3], p[4], p[5], 1);
22211                point.alpha && (point = { x: point.x, y: point.y, alpha: point.alpha });
22212                return point;
22213            };
22214        };
22215    var getTotalLength = getLengthFactory(1),
22216        getPointAtLength = getLengthFactory(),
22217        getSubpathsAtLength = getLengthFactory(0, 1);
22218
22219    R.getTotalLength = getTotalLength;
22220
22221    R.getPointAtLength = getPointAtLength;
22222
22223    R.getSubpath = function (path, from, to) {
22224        if (this.getTotalLength(path) - to < 1e-6) {
22225            return getSubpathsAtLength(path, from).end;
22226        }
22227        var a = getSubpathsAtLength(path, to, 1);
22228        return from ? getSubpathsAtLength(a, from).end : a;
22229    };
22230
22231    elproto.getTotalLength = function () {
22232        if (this.type != "path") { return; }
22233        if (this.node.getTotalLength) {
22234            return this.node.getTotalLength();
22235        }
22236        return getTotalLength(this.attrs.path);
22237    };
22238
22239    elproto.getPointAtLength = function (length) {
22240        if (this.type != "path") { return; }
22241        return getPointAtLength(this.attrs.path, length);
22242    };
22243
22244    elproto.getSubpath = function (from, to) {
22245        if (this.type != "path") { return; }
22246        return R.getSubpath(this.attrs.path, from, to);
22247    };
22248
22249    var ef = R.easing_formulas = {
22250        linear: function (n) {
22251            return n;
22252        },
22253        "<": function (n) {
22254            return pow(n, 1.7);
22255        },
22256        ">": function (n) {
22257            return pow(n, .48);
22258        },
22259        "<>": function (n) {
22260            var q = .48 - n / 1.04,
22261                Q = math.sqrt(.1734 + q * q),
22262                x = Q - q,
22263                X = pow(abs(x), 1 / 3) * (x < 0 ? -1 : 1),
22264                y = -Q - q,
22265                Y = pow(abs(y), 1 / 3) * (y < 0 ? -1 : 1),
22266                t = X + Y + .5;
22267            return (1 - t) * 3 * t * t + t * t * t;
22268        },
22269        backIn: function (n) {
22270            var s = 1.70158;
22271            return n * n * ((s + 1) * n - s);
22272        },
22273        backOut: function (n) {
22274            n = n - 1;
22275            var s = 1.70158;
22276            return n * n * ((s + 1) * n + s) + 1;
22277        },
22278        elastic: function (n) {
22279            if (n == !!n) {
22280                return n;
22281            }
22282            return pow(2, -10 * n) * math.sin((n - .075) * (2 * PI) / .3) + 1;
22283        },
22284        bounce: function (n) {
22285            var s = 7.5625,
22286                p = 2.75,
22287                l;
22288            if (n < (1 / p)) {
22289                l = s * n * n;
22290            } else {
22291                if (n < (2 / p)) {
22292                    n -= (1.5 / p);
22293                    l = s * n * n + .75;
22294                } else {
22295                    if (n < (2.5 / p)) {
22296                        n -= (2.25 / p);
22297                        l = s * n * n + .9375;
22298                    } else {
22299                        n -= (2.625 / p);
22300                        l = s * n * n + .984375;
22301                    }
22302                }
22303            }
22304            return l;
22305        }
22306    };
22307    ef.easeIn = ef["ease-in"] = ef["<"];
22308    ef.easeOut = ef["ease-out"] = ef[">"];
22309    ef.easeInOut = ef["ease-in-out"] = ef["<>"];
22310    ef["back-in"] = ef.backIn;
22311    ef["back-out"] = ef.backOut;
22312
22313    var animationElements = [],
22314        requestAnimFrame = window.requestAnimationFrame ||
22315            window.webkitRequestAnimationFrame ||
22316            window.mozRequestAnimationFrame ||
22317            window.oRequestAnimationFrame ||
22318            window.msRequestAnimationFrame ||
22319            function (callback) {
22320                setTimeout(callback, 16);
22321            },
22322        animation = function () {
22323            var Now = +new Date,
22324                l = 0;
22325            for (; l < animationElements.length; l++) {
22326                var e = animationElements[l];
22327                if (e.el.removed || e.paused) {
22328                    continue;
22329                }
22330                var time = Now - e.start,
22331                    ms = e.ms,
22332                    easing = e.easing,
22333                    from = e.from,
22334                    diff = e.diff,
22335                    to = e.to,
22336                    t = e.t,
22337                    that = e.el,
22338                    set = {},
22339                    now;
22340                if (e.initstatus) {
22341                    time = (e.initstatus * e.anim.top - e.prev) / (e.percent - e.prev) * ms;
22342                    e.status = e.initstatus;
22343                    delete e.initstatus;
22344                    e.stop && animationElements.splice(l--, 1);
22345                } else {
22346                    e.status = (e.prev + (e.percent - e.prev) * (time / ms)) / e.anim.top;
22347                }
22348                if (time < 0) {
22349                    continue;
22350                }
22351                if (time < ms) {
22352                    var pos = easing(time / ms);
22353                    for (var attr in from) if (from[has](attr)) {
22354                        switch (availableAnimAttrs[attr]) {
22355                            case nu:
22356                                now = +from[attr] + pos * ms * diff[attr];
22357                                break;
22358                            case "colour":
22359                                now = "rgb(" + [
22360                                    upto255(round(from[attr].r + pos * ms * diff[attr].r)),
22361                                    upto255(round(from[attr].g + pos * ms * diff[attr].g)),
22362                                    upto255(round(from[attr].b + pos * ms * diff[attr].b))
22363                                ].join(",") + ")";
22364                                break;
22365                            case "path":
22366                                now = [];
22367                                for (var i = 0, ii = from[attr].length; i < ii; i++) {
22368                                    now[i] = [from[attr][i][0]];
22369                                    for (var j = 1, jj = from[attr][i].length; j < jj; j++) {
22370                                        now[i][j] = +from[attr][i][j] + pos * ms * diff[attr][i][j];
22371                                    }
22372                                    now[i] = now[i].join(S);
22373                                }
22374                                now = now.join(S);
22375                                break;
22376                            case "transform":
22377                                if (diff[attr].real) {
22378                                    now = [];
22379                                    for (i = 0, ii = from[attr].length; i < ii; i++) {
22380                                        now[i] = [from[attr][i][0]];
22381                                        for (j = 1, jj = from[attr][i].length; j < jj; j++) {
22382                                            now[i][j] = from[attr][i][j] + pos * ms * diff[attr][i][j];
22383                                        }
22384                                    }
22385                                } else {
22386                                    var get = function (i) {
22387                                        return +from[attr][i] + pos * ms * diff[attr][i];
22388                                    };
22389                                    // now = [["r", get(2), 0, 0], ["t", get(3), get(4)], ["s", get(0), get(1), 0, 0]];
22390                                    now = [["m", get(0), get(1), get(2), get(3), get(4), get(5)]];
22391                                }
22392                                break;
22393                            case "csv":
22394                                if (attr == "clip-rect") {
22395                                    now = [];
22396                                    i = 4;
22397                                    while (i--) {
22398                                        now[i] = +from[attr][i] + pos * ms * diff[attr][i];
22399                                    }
22400                                }
22401                                break;
22402                            default:
22403                                var from2 = [].concat(from[attr]);
22404                                now = [];
22405                                i = that.paper.customAttributes[attr].length;
22406                                while (i--) {
22407                                    now[i] = +from2[i] + pos * ms * diff[attr][i];
22408                                }
22409                                break;
22410                        }
22411                        set[attr] = now;
22412                    }
22413                    that.attr(set);
22414                    (function (id, that, anim) {
22415                        setTimeout(function () {
22416                            eve("anim.frame." + id, that, anim);
22417                        });
22418                    })(that.id, that, e.anim);
22419                } else {
22420                    (function (f, el, a) {
22421                        setTimeout(function () {
22422                            eve("anim.frame." + el.id, el, a);
22423                            eve("anim.finish." + el.id, el, a);
22424                            R.is(f, "function") && f.call(el);
22425                        });
22426                    })(e.callback, that, e.anim);
22427                    that.attr(to);
22428                    animationElements.splice(l--, 1);
22429                    if (e.repeat > 1 && !e.next) {
22430                        runAnimation(e.anim, e.el, e.anim.percents[0], null, e.totalOrigin, e.repeat - 1);
22431                    }
22432                    if (e.next && !e.stop) {
22433                        runAnimation(e.anim, e.el, e.next, null, e.totalOrigin, e.repeat);
22434                    }
22435                }
22436            }
22437            R.svg && that && that.paper && that.paper.safari();
22438            animationElements.length && requestAnimFrame(animation);
22439        },
22440        upto255 = function (color) {
22441            return color > 255 ? 255 : color < 0 ? 0 : color;
22442        };
22443
22444    elproto.animateWith = function (element, anim, params, ms, easing, callback) {
22445        var a = params ? R.animation(params, ms, easing, callback) : anim;
22446        status = element.status(anim);
22447        return this.animate(a).status(a, status * anim.ms / a.ms);
22448    };
22449    function CubicBezierAtTime(t, p1x, p1y, p2x, p2y, duration) {
22450        var cx = 3 * p1x,
22451            bx = 3 * (p2x - p1x) - cx,
22452            ax = 1 - cx - bx,
22453            cy = 3 * p1y,
22454            by = 3 * (p2y - p1y) - cy,
22455            ay = 1 - cy - by;
22456        function sampleCurveX(t) {
22457            return ((ax * t + bx) * t + cx) * t;
22458        }
22459        function solve(x, epsilon) {
22460            var t = solveCurveX(x, epsilon);
22461            return ((ay * t + by) * t + cy) * t;
22462        }
22463        function solveCurveX(x, epsilon) {
22464            var t0, t1, t2, x2, d2, i;
22465            for (t2 = x, i = 0; i < 8; i++) {
22466                x2 = sampleCurveX(t2) - x;
22467                if (abs(x2) < epsilon) {
22468                    return t2;
22469                }
22470                d2 = (3 * ax * t2 + 2 * bx) * t2 + cx;
22471                if (abs(d2) < 1e-6) {
22472                    break;
22473                }
22474                t2 = t2 - x2 / d2;
22475            }
22476            t0 = 0;
22477            t1 = 1;
22478            t2 = x;
22479            if (t2 < t0) {
22480                return t0;
22481            }
22482            if (t2 > t1) {
22483                return t1;
22484            }
22485            while (t0 < t1) {
22486                x2 = sampleCurveX(t2);
22487                if (abs(x2 - x) < epsilon) {
22488                    return t2;
22489                }
22490                if (x > x2) {
22491                    t0 = t2;
22492                } else {
22493                    t1 = t2;
22494                }
22495                t2 = (t1 - t0) / 2 + t0;
22496            }
22497            return t2;
22498        }
22499        return solve(t, 1 / (200 * duration));
22500    }
22501    elproto.onAnimation = function (f) {
22502        f ? eve.on("anim.frame." + this.id, f) : eve.unbind("anim.frame." + this.id);
22503        return this;
22504    };
22505    function Animation(anim, ms) {
22506        var percents = [],
22507            newAnim = {};
22508        this.ms = ms;
22509        this.times = 1;
22510        if (anim) {
22511            for (var attr in anim) if (anim[has](attr)) {
22512                newAnim[toFloat(attr)] = anim[attr];
22513                percents.push(toFloat(attr));
22514            }
22515            percents.sort(sortByNumber);
22516        }
22517        this.anim = newAnim;
22518        this.top = percents[percents.length - 1];
22519        this.percents = percents;
22520    }
22521
22522    Animation.prototype.delay = function (delay) {
22523        var a = new Animation(this.anim, this.ms);
22524        a.times = this.times;
22525        a.del = +delay || 0;
22526        return a;
22527    };
22528
22529    Animation.prototype.repeat = function (times) {
22530        var a = new Animation(this.anim, this.ms);
22531        a.del = this.del;
22532        a.times = math.floor(mmax(times, 0)) || 1;
22533        return a;
22534    };
22535    function runAnimation(anim, element, percent, status, totalOrigin, times) {
22536        percent = toFloat(percent);
22537        var params,
22538            isInAnim,
22539            isInAnimSet,
22540            percents = [],
22541            next,
22542            prev,
22543            timestamp,
22544            ms = anim.ms,
22545            from = {},
22546            to = {},
22547            diff = {};
22548        if (status) {
22549            for (i = 0, ii = animationElements.length; i < ii; i++) {
22550                var e = animationElements[i];
22551                if (e.el.id == element.id && e.anim == anim) {
22552                    if (e.percent != percent) {
22553                        animationElements.splice(i, 1);
22554                        isInAnimSet = 1;
22555                    } else {
22556                        isInAnim = e;
22557                    }
22558                    element.attr(e.totalOrigin);
22559                    break;
22560                }
22561            }
22562        } else {
22563            status = +to; // NaN
22564        }
22565        for (var i = 0, ii = anim.percents.length; i < ii; i++) {
22566            if (anim.percents[i] == percent || anim.percents[i] > status * anim.top) {
22567                percent = anim.percents[i];
22568                prev = anim.percents[i - 1] || 0;
22569                ms = ms / anim.top * (percent - prev);
22570                next = anim.percents[i + 1];
22571                params = anim.anim[percent];
22572                break;
22573            } else if (status) {
22574                element.attr(anim.anim[anim.percents[i]]);
22575            }
22576        }
22577        if (!params) {
22578            return;
22579        }
22580        if (!isInAnim) {
22581            for (attr in params) if (params[has](attr)) {
22582                if (availableAnimAttrs[has](attr) || element.paper.customAttributes[has](attr)) {
22583                    from[attr] = element.attr(attr);
22584                    (from[attr] == null) && (from[attr] = availableAttrs[attr]);
22585                    to[attr] = params[attr];
22586                    switch (availableAnimAttrs[attr]) {
22587                        case nu:
22588                            diff[attr] = (to[attr] - from[attr]) / ms;
22589                            break;
22590                        case "colour":
22591                            from[attr] = R.getRGB(from[attr]);
22592                            var toColour = R.getRGB(to[attr]);
22593                            diff[attr] = {
22594                                r: (toColour.r - from[attr].r) / ms,
22595                                g: (toColour.g - from[attr].g) / ms,
22596                                b: (toColour.b - from[attr].b) / ms
22597                            };
22598                            break;
22599                        case "path":
22600                            var pathes = path2curve(from[attr], to[attr]),
22601                                toPath = pathes[1];
22602                            from[attr] = pathes[0];
22603                            diff[attr] = [];
22604                            for (i = 0, ii = from[attr].length; i < ii; i++) {
22605                                diff[attr][i] = [0];
22606                                for (var j = 1, jj = from[attr][i].length; j < jj; j++) {
22607                                    diff[attr][i][j] = (toPath[i][j] - from[attr][i][j]) / ms;
22608                                }
22609                            }
22610                            break;
22611                        case "transform":
22612                            var _ = element._,
22613                                eq = equaliseTransform(_[attr], to[attr]);
22614                            if (eq) {
22615                                from[attr] = eq.from;
22616                                to[attr] = eq.to;
22617                                diff[attr] = [];
22618                                diff[attr].real = true;
22619                                for (i = 0, ii = from[attr].length; i < ii; i++) {
22620                                    diff[attr][i] = [from[attr][i][0]];
22621                                    for (j = 1, jj = from[attr][i].length; j < jj; j++) {
22622                                        diff[attr][i][j] = (to[attr][i][j] - from[attr][i][j]) / ms;
22623                                    }
22624                                }
22625                            } else {
22626                                var m = (element.matrix || new Matrix),
22627                                    to2 = {
22628                                        _: { transform: _.transform },
22629                                        getBBox: function () {
22630                                            return element.getBBox(1);
22631                                        }
22632                                    };
22633                                from[attr] = [
22634                                    m.a,
22635                                    m.b,
22636                                    m.c,
22637                                    m.d,
22638                                    m.e,
22639                                    m.f
22640                                ];
22641                                extractTransform(to2, to[attr]);
22642                                to[attr] = to2._.transform;
22643                                diff[attr] = [
22644                                    (to2.matrix.a - m.a) / ms,
22645                                    (to2.matrix.b - m.b) / ms,
22646                                    (to2.matrix.c - m.c) / ms,
22647                                    (to2.matrix.d - m.d) / ms,
22648                                    (to2.matrix.e - m.e) / ms,
22649                                    (to2.matrix.e - m.f) / ms
22650                                ];
22651                                // from[attr] = [_.sx, _.sy, _.deg, _.dx, _.dy];
22652                                // var to2 = {_:{}, getBBox: function () { return element.getBBox(); }};
22653                                // extractTransform(to2, to[attr]);
22654                                // diff[attr] = [
22655                                //     (to2._.sx - _.sx) / ms,
22656                                //     (to2._.sy - _.sy) / ms,
22657                                //     (to2._.deg - _.deg) / ms,
22658                                //     (to2._.dx - _.dx) / ms,
22659                                //     (to2._.dy - _.dy) / ms
22660                                // ];
22661                            }
22662                            break;
22663                        case "csv":
22664                            var values = Str(params[attr]).split(separator),
22665                                from2 = Str(from[attr]).split(separator);
22666                            if (attr == "clip-rect") {
22667                                from[attr] = from2;
22668                                diff[attr] = [];
22669                                i = from2.length;
22670                                while (i--) {
22671                                    diff[attr][i] = (values[i] - from[attr][i]) / ms;
22672                                }
22673                            }
22674                            to[attr] = values;
22675                            break;
22676                        default:
22677                            values = [].concat(params[attr]);
22678                            from2 = [].concat(from[attr]);
22679                            diff[attr] = [];
22680                            i = element.paper.customAttributes[attr].length;
22681                            while (i--) {
22682                                diff[attr][i] = ((values[i] || 0) - (from2[i] || 0)) / ms;
22683                            }
22684                            break;
22685                    }
22686                }
22687            }
22688            var easing = params.easing,
22689                easyeasy = R.easing_formulas[easing];
22690            if (!easyeasy) {
22691                easyeasy = Str(easing).match(bezierrg);
22692                if (easyeasy && easyeasy.length == 5) {
22693                    var curve = easyeasy;
22694                    easyeasy = function (t) {
22695                        return CubicBezierAtTime(t, +curve[1], +curve[2], +curve[3], +curve[4], ms);
22696                    };
22697                } else {
22698                    easyeasy = pipe;
22699                }
22700            }
22701            timestamp = params.start || anim.start || +new Date;
22702            e = {
22703                anim: anim,
22704                percent: percent,
22705                timestamp: timestamp,
22706                start: timestamp + (anim.del || 0),
22707                status: 0,
22708                initstatus: status || 0,
22709                stop: false,
22710                ms: ms,
22711                easing: easyeasy,
22712                from: from,
22713                diff: diff,
22714                to: to,
22715                el: element,
22716                callback: params.callback,
22717                prev: prev,
22718                next: next,
22719                repeat: times || anim.times,
22720                origin: element.attr(),
22721                totalOrigin: totalOrigin
22722            };
22723            animationElements.push(e);
22724            if (status && !isInAnim && !isInAnimSet) {
22725                e.stop = true;
22726                e.start = new Date - ms * status;
22727                if (animationElements.length == 1) {
22728                    return animation();
22729                }
22730            }
22731            if (isInAnimSet) {
22732                e.start = new Date - e.ms * status;
22733            }
22734            animationElements.length == 1 && requestAnimFrame(animation);
22735        } else {
22736            isInAnim.initstatus = status;
22737            isInAnim.start = new Date - isInAnim.ms * status;
22738        }
22739        eve("anim.start." + element.id, element, anim);
22740    }
22741
22742    R.animation = function (params, ms, easing, callback) {
22743        if (params instanceof Animation) {
22744            return params;
22745        }
22746        if (R.is(easing, "function") || !easing) {
22747            callback = callback || easing || null;
22748            easing = null;
22749        }
22750        params = Object(params);
22751        ms = +ms || 0;
22752        var p = {},
22753            json,
22754            attr;
22755        for (attr in params) if (params[has](attr) && toFloat(attr) != attr && toFloat(attr) + "%" != attr) {
22756            json = true;
22757            p[attr] = params[attr];
22758        }
22759        if (!json) {
22760            return new Animation(params, ms);
22761        } else {
22762            easing && (p.easing = easing);
22763            callback && (p.callback = callback);
22764            return new Animation({ 100: p }, ms);
22765        }
22766    };
22767
22768    elproto.animate = function (params, ms, easing, callback) {
22769        var element = this;
22770        if (element.removed) {
22771            callback && callback.call(element);
22772            return element;
22773        }
22774        var anim = params instanceof Animation ? params : R.animation(params, ms, easing, callback);
22775        runAnimation(anim, element, anim.percents[0], null, element.attr());
22776        return element;
22777    };
22778
22779    elproto.setTime = function (anim, value) {
22780        if (anim && value != null) {
22781            this.status(anim, mmin(value, anim.ms) / anim.ms);
22782        }
22783        return this;
22784    };
22785
22786    elproto.status = function (anim, value) {
22787        var out = [],
22788            i = 0,
22789            len,
22790            e;
22791        if (value != null) {
22792            runAnimation(anim, this, -1, mmin(value, 1));
22793            return this;
22794        } else {
22795            len = animationElements.length;
22796            for (; i < len; i++) {
22797                e = animationElements[i];
22798                if (e.el.id == this.id && (!anim || e.anim == anim)) {
22799                    if (anim) {
22800                        return e.status;
22801                    }
22802                    out.push({
22803                        anim: e.anim,
22804                        status: e.status
22805                    });
22806                }
22807            }
22808            if (anim) {
22809                return 0;
22810            }
22811            return out;
22812        }
22813    };
22814
22815    elproto.pause = function (anim) {
22816        for (var i = 0; i < animationElements.length; i++) if (animationElements[i].el.id == this.id && (!anim || animationElements[i].anim == anim)) {
22817            if (eve("anim.pause." + this.id, this, animationElements[i].anim) !== false) {
22818                animationElements[i].paused = true;
22819            }
22820        }
22821        return this;
22822    };
22823
22824    elproto.resume = function (anim) {
22825        for (var i = 0; i < animationElements.length; i++) if (animationElements[i].el.id == this.id && (!anim || animationElements[i].anim == anim)) {
22826            var e = animationElements[i];
22827            if (eve("anim.resume." + this.id, this, e.anim) !== false) {
22828                delete e.paused;
22829                this.status(e.anim, e.status);
22830            }
22831        }
22832        return this;
22833    };
22834
22835    elproto.stop = function (anim) {
22836        for (var i = 0; i < animationElements.length; i++) if (animationElements[i].el.id == this.id && (!anim || animationElements[i].anim == anim)) {
22837            if (eve("anim.stop." + this.id, this, animationElements[i].anim) !== false) {
22838                animationElements.splice(i--, 1);
22839            }
22840        }
22841        return this;
22842    };
22843    elproto.toString = function () {
22844        return "Rapha\xebl\u2019s object";
22845    };
22846
22847    // Set
22848    var Set = function (items) {
22849        this.items = [];
22850        this.length = 0;
22851        this.type = "set";
22852        if (items) {
22853            for (var i = 0, ii = items.length; i < ii; i++) {
22854                if (items[i] && (items[i].constructor == elproto.constructor || items[i].constructor == Set)) {
22855                    this[this.items.length] = this.items[this.items.length] = items[i];
22856                    this.length++;
22857                }
22858            }
22859        }
22860    },
22861        setproto = Set.prototype;
22862
22863    setproto.push = function () {
22864        var item,
22865            len;
22866        for (var i = 0, ii = arguments.length; i < ii; i++) {
22867            item = arguments[i];
22868            if (item && (item.constructor == elproto.constructor || item.constructor == Set)) {
22869                len = this.items.length;
22870                this[len] = this.items[len] = item;
22871                this.length++;
22872            }
22873        }
22874        return this;
22875    };
22876
22877    setproto.pop = function () {
22878        this.length && delete this[this.length--];
22879        return this.items.pop();
22880    };
22881
22882    setproto.forEach = function (callback, thisArg) {
22883        for (var i = 0, ii = this.items.length; i < ii; i++) {
22884            if (callback.call(thisArg, this.items[i]) === false) {
22885                return this;
22886            }
22887        }
22888        return this;
22889    };
22890    for (var method in elproto) if (elproto[has](method)) {
22891        setproto[method] = (function (methodname) {
22892            return function () {
22893                var arg = arguments;
22894                return this.forEach(function (el) {
22895                    el[methodname][apply](el, arg);
22896                });
22897            };
22898        })(method);
22899    }
22900    setproto.attr = function (name, value) {
22901        if (name && R.is(name, array) && R.is(name[0], "object")) {
22902            for (var j = 0, jj = name.length; j < jj; j++) {
22903                this.items[j].attr(name[j]);
22904            }
22905        } else {
22906            for (var i = 0, ii = this.items.length; i < ii; i++) {
22907                this.items[i].attr(name, value);
22908            }
22909        }
22910        return this;
22911    };
22912
22913    setproto.clear = function () {
22914        while (this.length) {
22915            this.pop();
22916        }
22917    };
22918
22919    setproto.splice = function (index, count, insertion) {
22920        index = index < 0 ? mmax(this.length + index, 0) : index;
22921        count = mmax(0, mmin(this.length - index, count));
22922        var tail = [],
22923            todel = [],
22924            args = [],
22925            i;
22926        for (i = 2; i < arguments.length; i++) {
22927            args.push(arguments[i]);
22928        }
22929        for (i = 0; i < count; i++) {
22930            todel.push(this[index + i]);
22931        }
22932        for (; i < this.length - index; i++) {
22933            tail.push(this[index + i]);
22934        }
22935        var arglen = args.length;
22936        for (i = 0; i < arglen + tail.length; i++) {
22937            this.items[index + i] = this[index + i] = i < arglen ? args[i] : tail[i - arglen];
22938        }
22939        i = this.items.length = this.length -= count - arglen;
22940        while (this[i]) {
22941            delete this[i++];
22942        }
22943        return new Set(todel);
22944    };
22945
22946    setproto.exclude = function (el) {
22947        for (var i = 0, ii = this.length, found; i < ii; i++) if (found || this[i] == el) {
22948            this[i] = this[i + 1];
22949            found = 1;
22950        }
22951        if (found) {
22952            this.length--;
22953            delete this[i];
22954            return true;
22955        }
22956    };
22957    setproto.animate = function (params, ms, easing, callback) {
22958        (R.is(easing, "function") || !easing) && (callback = easing || null);
22959        var len = this.items.length,
22960            i = len,
22961            item,
22962            set = this,
22963            collector;
22964        if (!len) {
22965            return this;
22966        }
22967        callback && (collector = function () {
22968            !--len && callback.call(set);
22969        });
22970        easing = R.is(easing, string) ? easing : collector;
22971        var anim = R.animation(params, ms, easing, collector);
22972        item = this.items[--i].animate(anim);
22973        while (i--) {
22974            this.items[i] && !this.items[i].removed && this.items[i].animateWith(item, anim);
22975        }
22976        return this;
22977    };
22978    setproto.insertAfter = function (el) {
22979        var i = this.items.length;
22980        while (i--) {
22981            this.items[i].insertAfter(el);
22982        }
22983        return this;
22984    };
22985    setproto.getBBox = function () {
22986        var x = [],
22987            y = [],
22988            w = [],
22989            h = [];
22990        for (var i = this.items.length; i--;) if (!this.items[i].removed) {
22991            var box = this.items[i].getBBox();
22992            x.push(box.x);
22993            y.push(box.y);
22994            w.push(box.x + box.width);
22995            h.push(box.y + box.height);
22996        }
22997        x = mmin[apply](0, x);
22998        y = mmin[apply](0, y);
22999        return {
23000            x: x,
23001            y: y,
23002            width: mmax[apply](0, w) - x,
23003            height: mmax[apply](0, h) - y
23004        };
23005    };
23006    setproto.clone = function (s) {
23007        s = new Set;
23008        for (var i = 0, ii = this.items.length; i < ii; i++) {
23009            s.push(this.items[i].clone());
23010        }
23011        return s;
23012    };
23013    setproto.toString = function () {
23014        return "Rapha\xebl\u2018s set";
23015    };
23016
23017
23018    R.registerFont = function (font) {
23019        if (!font.face) {
23020            return font;
23021        }
23022        this.fonts = this.fonts || {};
23023        var fontcopy = {
23024            w: font.w,
23025            face: {},
23026            glyphs: {}
23027        },
23028            family = font.face["font-family"];
23029        for (var prop in font.face) if (font.face[has](prop)) {
23030            fontcopy.face[prop] = font.face[prop];
23031        }
23032        if (this.fonts[family]) {
23033            this.fonts[family].push(fontcopy);
23034        } else {
23035            this.fonts[family] = [fontcopy];
23036        }
23037        if (!font.svg) {
23038            fontcopy.face["units-per-em"] = toInt(font.face["units-per-em"], 10);
23039            for (var glyph in font.glyphs) if (font.glyphs[has](glyph)) {
23040                var path = font.glyphs[glyph];
23041                fontcopy.glyphs[glyph] = {
23042                    w: path.w,
23043                    k: {},
23044                    d: path.d && "M" + path.d.replace(/[mlcxtrv]/g, function (command) {
23045                        return { l: "L", c: "C", x: "z", t: "m", r: "l", v: "c" }[command] || "M";
23046                    }) + "z"
23047                };
23048                if (path.k) {
23049                    for (var k in path.k) if (path[has](k)) {
23050                        fontcopy.glyphs[glyph].k[k] = path.k[k];
23051                    }
23052                }
23053            }
23054        }
23055        return font;
23056    };
23057
23058    paperproto.getFont = function (family, weight, style, stretch) {
23059        stretch = stretch || "normal";
23060        style = style || "normal";
23061        weight = +weight || { normal: 400, bold: 700, lighter: 300, bolder: 800 }[weight] || 400;
23062        if (!R.fonts) {
23063            return;
23064        }
23065        var font = R.fonts[family];
23066        if (!font) {
23067            var name = new RegExp("(^|\\s)" + family.replace(/[^\w\d\s+!~.:_-]/g, E) + "(\\s|$)", "i");
23068            for (var fontName in R.fonts) if (R.fonts[has](fontName)) {
23069                if (name.test(fontName)) {
23070                    font = R.fonts[fontName];
23071                    break;
23072                }
23073            }
23074        }
23075        var thefont;
23076        if (font) {
23077            for (var i = 0, ii = font.length; i < ii; i++) {
23078                thefont = font[i];
23079                if (thefont.face["font-weight"] == weight && (thefont.face["font-style"] == style || !thefont.face["font-style"]) && thefont.face["font-stretch"] == stretch) {
23080                    break;
23081                }
23082            }
23083        }
23084        return thefont;
23085    };
23086
23087    paperproto.print = function (x, y, string, font, size, origin, letter_spacing) {
23088        origin = origin || "middle"; // baseline|middle
23089        letter_spacing = mmax(mmin(letter_spacing || 0, 1), -1);
23090        var out = this.set(),
23091            letters = Str(string).split(E),
23092            shift = 0,
23093            path = E,
23094            scale;
23095        R.is(font, string) && (font = this.getFont(font));
23096        if (font) {
23097            scale = (size || 16) / font.face["units-per-em"];
23098            var bb = font.face.bbox.split(separator),
23099                top = +bb[0],
23100                height = +bb[1] + (origin == "baseline" ? bb[3] - bb[1] + (+font.face.descent) : (bb[3] - bb[1]) / 2);
23101            for (var i = 0, ii = letters.length; i < ii; i++) {
23102                var prev = i && font.glyphs[letters[i - 1]] || {},
23103                    curr = font.glyphs[letters[i]];
23104                shift += i ? (prev.w || font.w) + (prev.k && prev.k[letters[i]] || 0) + (font.w * letter_spacing) : 0;
23105                curr && curr.d && out.push(this.path(curr.d).attr({
23106                    fill: "#000",
23107                    stroke: "none",
23108                    transform: [["t", shift * scale, 0]]
23109                }));
23110            }
23111            out.transform(["...s", scale, scale, top, height, "t", (x - top) / scale, (y - height) / scale]);
23112        }
23113        return out;
23114    };
23115
23116
23117    R.format = function (token, params) {
23118        var args = R.is(params, array) ? [0][concat](params) : arguments;
23119        token && R.is(token, string) && args.length - 1 && (token = token.replace(formatrg, function (str, i) {
23120            return args[++i] == null ? E : args[i];
23121        }));
23122        return token || E;
23123    };
23124
23125    R.fullfill = (function () {
23126        var tokenRegex = /\{([^\}]+)\}/g,
23127            objNotationRegex = /(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g, // matches .xxxxx or ["xxxxx"] to run over object properties
23128            replacer = function (all, key, obj) {
23129                var res = obj;
23130                key.replace(objNotationRegex, function (all, name, quote, quotedName, isFunc) {
23131                    name = name || quotedName;
23132                    if (res) {
23133                        if (name in res) {
23134                            res = res[name];
23135                        }
23136                        typeof res == "function" && isFunc && (res = res());
23137                    }
23138                });
23139                res = (res == null || res == obj ? all : res) + "";
23140                return res;
23141            };
23142        return function (str, obj) {
23143            return String(str).replace(tokenRegex, function (all, key) {
23144                return replacer(all, key, obj);
23145            });
23146        };
23147    })();
23148
23149    R.ninja = function () {
23150        oldRaphael.was ? (g.win.Raphael = oldRaphael.is) : delete Raphael;
23151        return R;
23152    };
23153
23154    R.st = setproto;
23155    // Firefox <3.6 fix: http://webreflection.blogspot.com/2009/11/195-chars-to-help-lazy-loading.html
23156    (function (doc, loaded, f) {
23157        if (doc.readyState == null && doc.addEventListener) {
23158            doc.addEventListener(loaded, f = function () {
23159                doc.removeEventListener(loaded, f, false);
23160                doc.readyState = "complete";
23161            }, false);
23162            doc.readyState = "loading";
23163        }
23164        function isLoaded() {
23165            (/in/).test(doc.readyState) ? setTimeout(isLoaded, 9) : R.eve("DOMload");
23166        }
23167        isLoaded();
23168    })(document, "DOMContentLoaded");
23169
23170    oldRaphael.was ? (g.win.Raphael = R) : (Raphael = R);
23171
23172    eve.on("DOMload", function () {
23173        loaded = true;
23174    });
23175})();
23176
23177// ┌─────────────────────────────────────────────────────────────────────┐ \\
23178// │ Raphaël 2 - JavaScript Vector Library                               │ \\
23179// ├─────────────────────────────────────────────────────────────────────┤ \\
23180// │ SVG Module                                                          │ \\
23181// ├─────────────────────────────────────────────────────────────────────┤ \\
23182// │ Copyright (c) 2008-2011 Dmitry Baranovskiy (http://raphaeljs.com)   │ \\
23183// │ Copyright (c) 2008-2011 Sencha Labs (http://sencha.com)             │ \\
23184// │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\
23185// └─────────────────────────────────────────────────────────────────────┘ \\
23186window.Raphael.svg && function (R) {
23187    var has = "hasOwnProperty",
23188        Str = String,
23189        toFloat = parseFloat,
23190        toInt = parseInt,
23191        math = Math,
23192        mmax = math.max,
23193        abs = math.abs,
23194        pow = math.pow,
23195        separator = /[, ]+/,
23196        eve = R.eve,
23197        E = "",
23198        S = " ";
23199    var xlink = "http://www.w3.org/1999/xlink",
23200        markers = {
23201            block: "M5,0 0,2.5 5,5z",
23202            classic: "M5,0 0,2.5 5,5 3.5,3 3.5,2z",
23203            diamond: "M2.5,0 5,2.5 2.5,5 0,2.5z",
23204            open: "M6,1 1,3.5 6,6",
23205            oval: "M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"
23206        },
23207        markerCounter = {};
23208    R.toString = function () {
23209        return "Your browser supports SVG.\nYou are running Rapha\xebl " + this.version;
23210    };
23211    var $ = function (el, attr) {
23212        if (attr) {
23213            if (typeof el == "string") {
23214                el = $(el);
23215            }
23216            for (var key in attr) if (attr[has](key)) {
23217                if (key.substring(0, 6) == "xlink:") {
23218                    el.setAttributeNS(xlink, key.substring(6), Str(attr[key]));
23219                } else {
23220                    el.setAttribute(key, Str(attr[key]));
23221                }
23222            }
23223        } else {
23224            el = R._g.doc.createElementNS("http://www.w3.org/2000/svg", el);
23225            el.style && (el.style.webkitTapHighlightColor = "rgba(0,0,0,0)");
23226        }
23227        return el;
23228    },
23229        gradients = {},
23230        rgGrad = /^url\(#(.*)\)$/,
23231        removeGradientFill = function (node, paper) {
23232            var oid = node.getAttribute("fill");
23233            oid = oid && oid.match(rgGrad);
23234            if (oid && !--gradients[oid[1]]) {
23235                delete gradients[oid[1]];
23236                paper.defs.removeChild(R._g.doc.getElementById(oid[1]));
23237            }
23238        },
23239        addGradientFill = function (element, gradient) {
23240            var type = "linear",
23241                id = element.id + gradient,
23242                fx = .5, fy = .5,
23243                o = element.node,
23244                SVG = element.paper,
23245                s = o.style,
23246                el = R._g.doc.getElementById(id);
23247            if (!el) {
23248                gradient = Str(gradient).replace(R._radial_gradient, function (all, _fx, _fy) {
23249                    type = "radial";
23250                    if (_fx && _fy) {
23251                        fx = toFloat(_fx);
23252                        fy = toFloat(_fy);
23253                        var dir = ((fy > .5) * 2 - 1);
23254                        pow(fx - .5, 2) + pow(fy - .5, 2) > .25 &&
23255                            (fy = math.sqrt(.25 - pow(fx - .5, 2)) * dir + .5) &&
23256                            fy != .5 &&
23257                            (fy = fy.toFixed(5) - 1e-5 * dir);
23258                    }
23259                    return E;
23260                });
23261                gradient = gradient.split(/\s*\-\s*/);
23262                if (type == "linear") {
23263                    var angle = gradient.shift();
23264                    angle = -toFloat(angle);
23265                    if (isNaN(angle)) {
23266                        return null;
23267                    }
23268                    var vector = [0, 0, math.cos(R.rad(angle)), math.sin(R.rad(angle))],
23269                        max = 1 / (mmax(abs(vector[2]), abs(vector[3])) || 1);
23270                    vector[2] *= max;
23271                    vector[3] *= max;
23272                    if (vector[2] < 0) {
23273                        vector[0] = -vector[2];
23274                        vector[2] = 0;
23275                    }
23276                    if (vector[3] < 0) {
23277                        vector[1] = -vector[3];
23278                        vector[3] = 0;
23279                    }
23280                }
23281                var dots = R._parseDots(gradient);
23282                if (!dots) {
23283                    return null;
23284                }
23285                if (element.gradient) {
23286                    SVG.defs.removeChild(element.gradient);
23287                    delete element.gradient;
23288                }
23289
23290                id = id.replace(/[\(\)\s,\xb0#]/g, "-");
23291                el = $(type + "Gradient", { id: id });
23292                element.gradient = el;
23293                $(el, type == "radial" ? {
23294                    fx: fx,
23295                    fy: fy
23296                } : {
23297                        x1: vector[0],
23298                        y1: vector[1],
23299                        x2: vector[2],
23300                        y2: vector[3],
23301                        gradientTransform: element.matrix.invert()
23302                    });
23303                SVG.defs.appendChild(el);
23304                for (var i = 0, ii = dots.length; i < ii; i++) {
23305                    el.appendChild($("stop", {
23306                        offset: dots[i].offset ? dots[i].offset : i ? "100%" : "0%",
23307                        "stop-color": dots[i].color || "#fff"
23308                    }));
23309                }
23310            }
23311            $(o, {
23312                fill: "url(#" + id + ")",
23313                opacity: 1,
23314                "fill-opacity": 1
23315            });
23316            s.fill = E;
23317            s.opacity = 1;
23318            s.fillOpacity = 1;
23319            return 1;
23320        },
23321        updatePosition = function (o) {
23322            var bbox = o.getBBox(1);
23323            $(o.pattern, { patternTransform: o.matrix.invert() + " translate(" + bbox.x + "," + bbox.y + ")" });
23324        },
23325        addArrow = function (o, value, isEnd) {
23326            if (o.type == "path") {
23327                var values = Str(value).toLowerCase().split("-"),
23328                    p = o.paper,
23329                    se = isEnd ? "end" : "start",
23330                    node = o.node,
23331                    attrs = o.attrs,
23332                    stroke = attrs["stroke-width"],
23333                    i = values.length,
23334                    type = "classic",
23335                    from,
23336                    to,
23337                    dx,
23338                    refX,
23339                    attr,
23340                    w = 3,
23341                    h = 3,
23342                    t = 5;
23343                while (i--) {
23344                    switch (values[i]) {
23345                        case "block":
23346                        case "classic":
23347                        case "oval":
23348                        case "diamond":
23349                        case "open":
23350                        case "none":
23351                            type = values[i];
23352                            break;
23353                        case "wide": h = 5; break;
23354                        case "narrow": h = 2; break;
23355                        case "long": w = 5; break;
23356                        case "short": w = 2; break;
23357                    }
23358                }
23359                if (type == "open") {
23360                    w += 2;
23361                    h += 2;
23362                    t += 2;
23363                    dx = 1;
23364                    refX = isEnd ? 4 : 1;
23365                    attr = {
23366                        fill: "none",
23367                        stroke: attrs.stroke
23368                    };
23369                } else {
23370                    refX = dx = w / 2;
23371                    attr = {
23372                        fill: attrs.stroke,
23373                        stroke: "none"
23374                    };
23375                }
23376                if (o._.arrows) {
23377                    if (isEnd) {
23378                        o._.arrows.endPath && markerCounter[o._.arrows.endPath]--;
23379                        o._.arrows.endMarker && markerCounter[o._.arrows.endMarker]--;
23380                    } else {
23381                        o._.arrows.startPath && markerCounter[o._.arrows.startPath]--;
23382                        o._.arrows.startMarker && markerCounter[o._.arrows.startMarker]--;
23383                    }
23384                } else {
23385                    o._.arrows = {};
23386                }
23387                if (type != "none") {
23388                    var pathId = "raphael-marker-" + type,
23389                        markerId = "raphael-marker-" + se + type + w + h;
23390                    if (!R._g.doc.getElementById(pathId)) {
23391                        p.defs.appendChild($($("path"), {
23392                            "stroke-linecap": "round",
23393                            d: markers[type],
23394                            id: pathId
23395                        }));
23396                        markerCounter[pathId] = 1;
23397                    } else {
23398                        markerCounter[pathId]++;
23399                    }
23400                    var marker = R._g.doc.getElementById(markerId),
23401                        use;
23402                    if (!marker) {
23403                        marker = $($("marker"), {
23404                            id: markerId,
23405                            markerHeight: h,
23406                            markerWidth: w,
23407                            orient: "auto",
23408                            refX: refX,
23409                            refY: h / 2
23410                        });
23411                        use = $($("use"), {
23412                            "xlink:href": "#" + pathId,
23413                            transform: (isEnd ? " rotate(180 " + w / 2 + " " + h / 2 + ") " : S) + "scale(" + w / t + "," + h / t + ")",
23414                            "stroke-width": 1 / ((w / t + h / t) / 2)
23415                        });
23416                        marker.appendChild(use);
23417                        p.defs.appendChild(marker);
23418                        markerCounter[markerId] = 1;
23419                    } else {
23420                        markerCounter[markerId]++;
23421                        use = marker.getElementsByTagName("use")[0];
23422                    }
23423                    $(use, attr);
23424                    var delta = dx * (type != "diamond" && type != "oval");
23425                    if (isEnd) {
23426                        from = o._.arrows.startdx * stroke || 0;
23427                        to = R.getTotalLength(attrs.path) - delta * stroke;
23428                    } else {
23429                        from = delta * stroke;
23430                        to = R.getTotalLength(attrs.path) - (o._.arrows.enddx * stroke || 0);
23431                    }
23432                    attr = {};
23433                    attr["marker-" + se] = "url(#" + markerId + ")";
23434                    if (to || from) {
23435                        attr.d = Raphael.getSubpath(attrs.path, from, to);
23436                    }
23437                    $(node, attr);
23438                    o._.arrows[se + "Path"] = pathId;
23439                    o._.arrows[se + "Marker"] = markerId;
23440                    o._.arrows[se + "dx"] = delta;
23441                    o._.arrows[se + "Type"] = type;
23442                    o._.arrows[se + "String"] = value;
23443                } else {
23444                    if (isEnd) {
23445                        from = o._.arrows.startdx * stroke || 0;
23446                        to = R.getTotalLength(attrs.path) - from;
23447                    } else {
23448                        from = 0;
23449                        to = R.getTotalLength(attrs.path) - (o._.arrows.enddx * stroke || 0);
23450                    }
23451                    o._.arrows[se + "Path"] && $(node, { d: Raphael.getSubpath(attrs.path, from, to) });
23452                    delete o._.arrows[se + "Path"];
23453                    delete o._.arrows[se + "Marker"];
23454                    delete o._.arrows[se + "dx"];
23455                    delete o._.arrows[se + "Type"];
23456                    delete o._.arrows[se + "String"];
23457                }
23458                for (attr in markerCounter) if (markerCounter[has](attr) && !markerCounter[attr]) {
23459                    var item = R._g.doc.getElementById(attr);
23460                    item && item.parentNode.removeChild(item);
23461                }
23462            }
23463        },
23464        dasharray = {
23465            "": [0],
23466            "none": [0],
23467            "-": [3, 1],
23468            ".": [1, 1],
23469            "-.": [3, 1, 1, 1],
23470            "-..": [3, 1, 1, 1, 1, 1],
23471            ". ": [1, 3],
23472            "- ": [4, 3],
23473            "--": [8, 3],
23474            "- .": [4, 3, 1, 3],
23475            "--.": [8, 3, 1, 3],
23476            "--..": [8, 3, 1, 3, 1, 3]
23477        },
23478        addDashes = function (o, value, params) {
23479            value = dasharray[Str(value).toLowerCase()];
23480            if (value) {
23481                var width = o.attrs["stroke-width"] || "1",
23482                    butt = { round: width, square: width, butt: 0 }[o.attrs["stroke-linecap"] || params["stroke-linecap"]] || 0,
23483                    dashes = [],
23484                    i = value.length;
23485                while (i--) {
23486                    dashes[i] = value[i] * width + ((i % 2) ? 1 : -1) * butt;
23487                }
23488                $(o.node, { "stroke-dasharray": dashes.join(",") });
23489            }
23490        },
23491        setFillAndStroke = function (o, params) {
23492            var node = o.node,
23493                attrs = o.attrs,
23494                vis = node.style.visibility;
23495            node.style.visibility = "hidden";
23496            for (var att in params) {
23497                if (params[has](att)) {
23498                    if (!R._availableAttrs[has](att)) {
23499                        continue;
23500                    }
23501                    var value = params[att];
23502                    attrs[att] = value;
23503                    switch (att) {
23504                        case "blur":
23505                            o.blur(value);
23506                            break;
23507                        case "href":
23508                        case "title":
23509                        case "target":
23510                            var pn = node.parentNode;
23511                            if (pn.tagName.toLowerCase() != "a") {
23512                                var hl = $("a");
23513                                pn.insertBefore(hl, node);
23514                                hl.appendChild(node);
23515                                pn = hl;
23516                            }
23517                            if (att == "target" && value == "blank") {
23518                                pn.setAttributeNS(xlink, "show", "new");
23519                            } else {
23520                                pn.setAttributeNS(xlink, att, value);
23521                            }
23522                            break;
23523                        case "cursor":
23524                            node.style.cursor = value;
23525                            break;
23526                        case "transform":
23527                            o.transform(value);
23528                            break;
23529                        case "arrow-start":
23530                            addArrow(o, value);
23531                            break;
23532                        case "arrow-end":
23533                            addArrow(o, value, 1);
23534                            break;
23535                        case "clip-rect":
23536                            var rect = Str(value).split(separator);
23537                            if (rect.length == 4) {
23538                                o.clip && o.clip.parentNode.parentNode.removeChild(o.clip.parentNode);
23539                                var el = $("clipPath"),
23540                                    rc = $("rect");
23541                                el.id = R.createUUID();
23542                                $(rc, {
23543                                    x: rect[0],
23544                                    y: rect[1],
23545                                    width: rect[2],
23546                                    height: rect[3]
23547                                });
23548                                el.appendChild(rc);
23549                                o.paper.defs.appendChild(el);
23550                                $(node, { "clip-path": "url(#" + el.id + ")" });
23551                                o.clip = rc;
23552                            }
23553                            if (!value) {
23554                                var clip = R._g.doc.getElementById(node.getAttribute("clip-path").replace(/(^url\(#|\)$)/g, E));
23555                                clip && clip.parentNode.removeChild(clip);
23556                                $(node, { "clip-path": E });
23557                                delete o.clip;
23558                            }
23559                            break;
23560                        case "path":
23561                            if (o.type == "path") {
23562                                $(node, { d: value ? attrs.path = R._pathToAbsolute(value) : "M0,0" });
23563                                o._.dirty = 1;
23564                                if (o._.arrows) {
23565                                    "startString" in o._.arrows && addArrow(o, o._.arrows.startString);
23566                                    "endString" in o._.arrows && addArrow(o, o._.arrows.endString, 1);
23567                                }
23568                            }
23569                            break;
23570                        case "width":
23571                            node.setAttribute(att, value);
23572                            o._.dirty = 1;
23573                            if (attrs.fx) {
23574                                att = "x";
23575                                value = attrs.x;
23576                            } else {
23577                                break;
23578                            }
23579                        case "x":
23580                            if (attrs.fx) {
23581                                value = -attrs.x - (attrs.width || 0);
23582                            }
23583                        case "rx":
23584                            if (att == "rx" && o.type == "rect") {
23585                                break;
23586                            }
23587                        case "cx":
23588                            node.setAttribute(att, value);
23589                            o.pattern && updatePosition(o);
23590                            o._.dirty = 1;
23591                            break;
23592                        case "height":
23593                            node.setAttribute(att, value);
23594                            o._.dirty = 1;
23595                            if (attrs.fy) {
23596                                att = "y";
23597                                value = attrs.y;
23598                            } else {
23599                                break;
23600                            }
23601                        case "y":
23602                            if (attrs.fy) {
23603                                value = -attrs.y - (attrs.height || 0
23603);
23604                            }
23605                        case "ry":
23606                            if (att == "ry" && o.type == "rect") {
23607                                break;
23608                            }
23609                        case "cy":
23610                            node.setAttribute(att, value);
23611                            o.pattern && updatePosition(o);
23612                            o._.dirty = 1;
23613                            break;
23614                        case "r":
23615                            if (o.type == "rect") {
23616                                $(node, { rx: value, ry: value });
23617                            } else {
23618                                node.setAttribute(att, value);
23619                            }
23620                            o._.dirty = 1;
23621                            break;
23622                        case "src":
23623                            if (o.type == "image") {
23624                                node.setAttributeNS(xlink, "href", value);
23625                            }
23626                            break;
23627                        case "stroke-width":
23628                            if (o._.sx != 1 || o._.sy != 1) {
23629                                value /= mmax(abs(o._.sx), abs(o._.sy)) || 1;
23630                            }
23631                            if (o.paper._vbSize) {
23632                                value *= o.paper._vbSize;
23633                            }
23634                            node.setAttribute(att, value);
23635                            if (attrs["stroke-dasharray"]) {
23636                                addDashes(o, attrs["stroke-dasharray"], params);
23637                            }
23638                            if (o._.arrows) {
23639                                "startString" in o._.arrows && addArrow(o, o._.arrows.startString);
23640                                "endString" in o._.arrows && addArrow(o, o._.arrows.endString, 1);
23641                            }
23642                            break;
23643                        case "stroke-dasharray":
23644                            addDashes(o, value, params);
23645                            break;
23646                        case "fill":
23647                            var isURL = Str(value).match(R._ISURL);
23648                            if (isURL) {
23649                                el = $("pattern");
23650                                var ig = $("image");
23651                                el.id = R.createUUID();
23652                                $(el, { x: 0, y: 0, patternUnits: "userSpaceOnUse", height: 1, width: 1 });
23653                                $(ig, { x: 0, y: 0, "xlink:href": isURL[1] });
23654                                el.appendChild(ig);
23655
23656                                (function (el) {
23657                                    R._preload(isURL[1], function () {
23658                                        var w = this.offsetWidth,
23659                                            h = this.offsetHeight;
23660                                        $(el, { width: w, height: h });
23661                                        $(ig, { width: w, height: h });
23662                                        o.paper.safari();
23663                                    });
23664                                })(el);
23665                                o.paper.defs.appendChild(el);
23666                                node.style.fill = "url(#" + el.id + ")";
23667                                $(node, { fill: "url(#" + el.id + ")" });
23668                                o.pattern = el;
23669                                o.pattern && updatePosition(o);
23670                                break;
23671                            }
23672                            var clr = R.getRGB(value);
23673                            if (!clr.error) {
23674                                delete params.gradient;
23675                                delete attrs.gradient;
23676                                !R.is(attrs.opacity, "undefined") &&
23677                                    R.is(params.opacity, "undefined") &&
23678                                    $(node, { opacity: attrs.opacity });
23679                                !R.is(attrs["fill-opacity"], "undefined") &&
23680                                    R.is(params["fill-opacity"], "undefined") &&
23681                                    $(node, { "fill-opacity": attrs["fill-opacity"] });
23682                            } else if ((o.type == "circle" || o.type == "ellipse" || Str(value).charAt() != "r") && addGradientFill(o, value)) {
23683                                if ("opacity" in attrs || "fill-opacity" in attrs) {
23684                                    var gradient = R._g.doc.getElementById(node.getAttribute("fill").replace(/^url\(#|\)$/g, E));
23685                                    if (gradient) {
23686                                        var stops = gradient.getElementsByTagName("stop");
23687                                        $(stops[stops.length - 1], { "stop-opacity": ("opacity" in attrs ? attrs.opacity : 1) * ("fill-opacity" in attrs ? attrs["fill-opacity"] : 1) });
23688                                    }
23689                                }
23690                                attrs.gradient = value;
23691                                attrs.fill = "none";
23692                                break;
23693                            }
23694                            clr[has]("opacity") && $(node, { "fill-opacity": clr.opacity > 1 ? clr.opacity / 100 : clr.opacity });
23695                        case "stroke":
23696                            clr = R.getRGB(value);
23697                            node.setAttribute(att, clr.hex);
23698                            att == "stroke" && clr[has]("opacity") && $(node, { "stroke-opacity": clr.opacity > 1 ? clr.opacity / 100 : clr.opacity });
23699                            if (att == "stroke" && o._.arrows) {
23700                                "startString" in o._.arrows && addArrow(o, o._.arrows.startString);
23701                                "endString" in o._.arrows && addArrow(o, o._.arrows.endString, 1);
23702                            }
23703                            break;
23704                        case "gradient":
23705                            (o.type == "circle" || o.type == "ellipse" || Str(value).charAt() != "r") && addGradientFill(o, value);
23706                            break;
23707                        case "opacity":
23708                            if (attrs.gradient && !attrs[has]("stroke-opacity")) {
23709                                $(node, { "stroke-opacity": value > 1 ? value / 100 : value });
23710                            }
23711                        // fall
23712                        case "fill-opacity":
23713                            if (attrs.gradient) {
23714                                gradient = R._g.doc.getElementById(node.getAttribute("fill").replace(/^url\(#|\)$/g, E));
23715                                if (gradient) {
23716                                    stops = gradient.getElementsByTagName("stop");
23717                                    $(stops[stops.length - 1], { "stop-opacity": value });
23718                                }
23719                                break;
23720                            }
23721                        default:
23722                            att == "font-size" && (value = toInt(value, 10) + "px");
23723                            var cssrule = att.replace(/(\-.)/g, function (w) {
23724                                return w.substring(1).toUpperCase();
23725                            });
23726                            node.style[cssrule] = value;
23727                            o._.dirty = 1;
23728                            node.setAttribute(att, value);
23729                            break;
23730                    }
23731                }
23732            }
23733
23734            tuneText(o, params);
23735            node.style.visibility = vis;
23736        },
23737        leading = 1.2,
23738        tuneText = function (el, params) {
23739            if (el.type != "text" || !(params[has]("text") || params[has]("font") || params[has]("font-size") || params[has]("x") || params[has]("y"))) {
23740                return;
23741            }
23742            var a = el.attrs,
23743                node = el.node,
23744                fontSize = node.firstChild ? toInt(R._g.doc.defaultView.getComputedStyle(node.firstChild, E).getPropertyValue("font-size"), 10) : 10;
23745
23746            if (params[has]("text")) {
23747                a.text = params.text;
23748                while (node.firstChild) {
23749                    node.removeChild(node.firstChild);
23750                }
23751                var texts = Str(params.text).split("\n"),
23752                    tspans = [],
23753                    tspan;
23754                for (var i = 0, ii = texts.length; i < ii; i++) {
23755                    tspan = $("tspan");
23756                    i && $(tspan, { dy: fontSize * leading, x: a.x });
23757                    tspan.appendChild(R._g.doc.createTextNode(texts[i]));
23758                    node.appendChild(tspan);
23759                    tspans[i] = tspan;
23760                }
23761            } else {
23762                tspans = node.getElementsByTagName("tspan");
23763                for (i = 0, ii = tspans.length; i < ii; i++) if (i) {
23764                    $(tspans[i], { dy: fontSize * leading, x: a.x });
23765                } else {
23766                    $(tspans[0], { dy: 0 });
23767                }
23768            }
23769            $(node, { x: a.x, y: a.y });
23770            el._.dirty = 1;
23771            var bb = el._getBBox(),
23772                dif = a.y - (bb.y + bb.height / 2);
23773            dif && R.is(dif, "finite") && $(tspans[0], { dy: dif });
23774        },
23775        Element = function (node, svg) {
23776            var X = 0,
23777                Y = 0;
23778
23779            this[0] = this.node = node;
23780
23781            node.raphael = true;
23782
23783            this.id = R._oid++;
23784            node.raphaelid = this.id;
23785            this.matrix = R.matrix();
23786            this.realPath = null;
23787
23788            this.paper = svg;
23789            this.attrs = this.attrs || {};
23790            this._ = {
23791                transform: [],
23792                sx: 1,
23793                sy: 1,
23794                deg: 0,
23795                dx: 0,
23796                dy: 0,
23797                dirty: 1
23798            };
23799            !svg.bottom && (svg.bottom = this);
23800
23801            this.prev = svg.top;
23802            svg.top && (svg.top.next = this);
23803            svg.top = this;
23804
23805            this.next = null;
23806        },
23807        elproto = R.el;
23808
23809    Element.prototype = elproto;
23810    elproto.constructor = Element;
23811
23812    R._engine.path = function (pathString, SVG) {
23813        var el = $("path");
23814        SVG.canvas && SVG.canvas.appendChild(el);
23815        var p = new Element(el, SVG);
23816        p.type = "path";
23817        setFillAndStroke(p, {
23818            fill: "none",
23819            stroke: "#000",
23820            path: pathString
23821        });
23822        return p;
23823    };
23824
23825    elproto.rotate = function (deg, cx, cy) {
23826        if (this.removed) {
23827            return this;
23828        }
23829        deg = Str(deg).split(separator);
23830        if (deg.length - 1) {
23831            cx = toFloat(deg[1]);
23832            cy = toFloat(deg[2]);
23833        }
23834        deg = toFloat(deg[0]);
23835        (cy == null) && (cx = cy);
23836        if (cx == null || cy == null) {
23837            var bbox = this.getBBox(1);
23838            cx = bbox.x + bbox.width / 2;
23839            cy = bbox.y + bbox.height / 2;
23840        }
23841        this.transform(this._.transform.concat([["r", deg, cx, cy]]));
23842        return this;
23843    };
23844
23845    elproto.scale = function (sx, sy, cx, cy) {
23846        if (this.removed) {
23847            return this;
23848        }
23849        sx = Str(sx).split(separator);
23850        if (sx.length - 1) {
23851            sy = toFloat(sx[1]);
23852            cx = toFloat(sx[2]);
23853            cy = toFloat(sx[3]);
23854        }
23855        sx = toFloat(sx[0]);
23856        (sy == null) && (sy = sx);
23857        (cy == null) && (cx = cy);
23858        if (cx == null || cy == null) {
23859            var bbox = this.getBBox(1);
23860        }
23861        cx = cx == null ? bbox.x + bbox.width / 2 : cx;
23862        cy = cy == null ? bbox.y + bbox.height / 2 : cy;
23863        this.transform(this._.transform.concat([["s", sx, sy, cx, cy]]));
23864        return this;
23865    };
23866
23867    elproto.translate = function (dx, dy) {
23868        if (this.removed) {
23869            return this;
23870        }
23871        dx = Str(dx).split(separator);
23872        if (dx.length - 1) {
23873            dy = toFloat(dx[1]);
23874        }
23875        dx = toFloat(dx[0]) || 0;
23876        dy = +dy || 0;
23877        this.transform(this._.transform.concat([["t", dx, dy]]));
23878        return this;
23879    };
23880
23881    elproto.transform = function (tstr) {
23882        var _ = this._;
23883        if (tstr == null) {
23884            return _.transform;
23885        }
23886        R._extractTransform(this, tstr);
23887
23888        this.clip && $(this.clip, { transform: this.matrix.invert() });
23889        this.pattern && updatePosition(this);
23890        this.node && $(this.node, { transform: this.matrix });
23891
23892        if (_.sx != 1 || _.sy != 1) {
23893            var sw = this.attrs[has]("stroke-width") ? this.attrs["stroke-width"] : 1;
23894            this.attr({ "stroke-width": sw });
23895        }
23896
23897        return this;
23898    };
23899
23900    elproto.hide = function () {
23901        !this.removed && this.paper.safari(this.node.style.display = "none");
23902        return this;
23903    };
23904
23905    elproto.show = function () {
23906        !this.removed && this.paper.safari(this.node.style.display = "");
23907        return this;
23908    };
23909
23910    elproto.remove = function () {
23911        if (this.removed) {
23912            return;
23913        }
23914        eve.unbind("*.*." + this.id);
23915        R._tear(this, this.paper);
23916        this.node.parentNode.removeChild(this.node);
23917        for (var i in this) {
23918            delete this[i];
23919        }
23920        this.removed = true;
23921    };
23922    elproto._getBBox = function () {
23923        if (this.node.style.display == "none") {
23924            this.show();
23925            var hide = true;
23926        }
23927        var bbox = {};
23928        try {
23929            bbox = this.node.getBBox();
23930        } catch (e) {
23931            // Firefox 3.0.x plays badly here
23932        } finally {
23933            bbox = bbox || {};
23934        }
23935        hide && this.hide();
23936        return bbox;
23937    };
23938
23939    elproto.attr = function (name, value) {
23940        if (this.removed) {
23941            return this;
23942        }
23943        if (name == null) {
23944            var res = {};
23945            for (var a in this.attrs) if (this.attrs[has](a)) {
23946                res[a] = this.attrs[a];
23947            }
23948            res.gradient && res.fill == "none" && (res.fill = res.gradient) && delete res.gradient;
23949            res.transform = this._.transform;
23950            return res;
23951        }
23952        if (value == null && R.is(name, "string")) {
23953            if (name == "fill" && this.attrs.fill == "none" && this.attrs.gradient) {
23954                return this.attrs.gradient;
23955            }
23956            if (name == "transform") {
23957                return this._.transform;
23958            }
23959            var names = name.split(separator),
23960                out = {};
23961            for (var i = 0, ii = names.length; i < ii; i++) {
23962                name = names[i];
23963                if (name in this.attrs) {
23964                    out[name] = this.attrs[name];
23965                } else if (R.is(this.paper.customAttributes[name], "function")) {
23966                    out[name] = this.paper.customAttributes[name].def;
23967                } else {
23968                    out[name] = R._availableAttrs[name];
23969                }
23970            }
23971            return ii - 1 ? out : out[names[0]];
23972        }
23973        if (value == null && R.is(name, "array")) {
23974            out = {};
23975            for (i = 0, ii = name.length; i < ii; i++) {
23976                out[name[i]] = this.attr(name[i]);
23977            }
23978            return out;
23979        }
23980        if (value != null) {
23981            var params = {};
23982            params[name] = value;
23983        } else if (name != null && R.is(name, "object")) {
23984            params = name;
23985        }
23986        for (var key in this.paper.customAttributes) if (this.paper.customAttributes[has](key) && params[has](key) && R.is(this.paper.customAttributes[key], "function")) {
23987            var par = this.paper.customAttributes[key].apply(this, [].concat(params[key]));
23988            this.attrs[key] = params[key];
23989            for (var subkey in par) if (par[has](subkey)) {
23990                params[subkey] = par[subkey];
23991            }
23992        }
23993        setFillAndStroke(this, params);
23994        return this;
23995    };
23996
23997    elproto.toFront = function () {
23998        if (this.removed) {
23999            return this;
24000        }
24001        this.node.parentNode.appendChild(this.node);
24002        var svg = this.paper;
24003        svg.top != this && R._tofront(this, svg);
24004        return this;
24005    };
24006
24007    elproto.toBack = function () {
24008        if (this.removed) {
24009            return this;
24010        }
24011        if (this.node.parentN
24011ode.firstChild != this.node) {
24012            this.node.parentNode.insertBefore(this.node, this.node.parentNode.firstChild);
24013            R._toback(this, this.paper);
24014            var svg = this.paper;
24015        }
24016        return this;
24017    };
24018
24019    elproto.insertAfter = function (element) {
24020        if (this.removed) {
24021            return this;
24022        }
24023        var node = element.node || element[element.length - 1].node;
24024        if (node.nextSibling) {
24025            node.parentNode.insertBefore(this.node, node.nextSibling);
24026        } else {
24027            node.parentNode.appendChild(this.node);
24028        }
24029        R._insertafter(this, element, this.paper);
24030        return this;
24031    };
24032
24033    elproto.insertBefore = function (element) {
24034        if (this.removed) {
24035            return this;
24036        }
24037        var node = element.node || element[0].node;
24038        node.parentNode.insertBefore(this.node, node);
24039        R._insertbefore(this, element, this.paper);
24040        return this;
24041    };
24042    elproto.blur = function (size) {
24043        // Experimental. No Safari support. Use it on your own risk.
24044        var t = this;
24045        if (+size !== 0) {
24046            var fltr = $("filter"),
24047                blur = $("feGaussianBlur");
24048            t.attrs.blur = size;
24049            fltr.id = R.createUUID();
24050            $(blur, { stdDeviation: +size || 1.5 });
24051            fltr.appendChild(blur);
24052            t.paper.defs.appendChild(fltr);
24053            t._blur = fltr;
24054            $(t.node, { filter: "url(#" + fltr.id + ")" });
24055        } else {
24056            if (t._blur) {
24057                t._blur.parentNode.removeChild(t._blur);
24058                delete t._blur;
24059                delete t.attrs.blur;
24060            }
24061            t.node.removeAttribute("filter");
24062        }
24063    };
24064    R._engine.circle = function (svg, x, y, r) {
24065        var el = $("circle");
24066        svg.canvas && svg.canvas.appendChild(el);
24067        var res = new Element(el, svg);
24068        res.attrs = { cx: x, cy: y, r: r, fill: "none", stroke: "#000" };
24069        res.type = "circle";
24070        $(el, res.attrs);
24071        return res;
24072    };
24073    R._engine.rect = function (svg, x, y, w, h, r) {
24074        var el = $("rect");
24075        svg.canvas && svg.canvas.appendChild(el);
24076        var res = new Element(el, svg);
24077        res.attrs = { x: x, y: y, width: w, height: h, r: r || 0, rx: r || 0, ry: r || 0, fill: "none", stroke: "#000" };
24078        res.type = "rect";
24079        $(el, res.attrs);
24080        return res;
24081    };
24082    R._engine.ellipse = function (svg, x, y, rx, ry) {
24083        var el = $("ellipse");
24084        svg.canvas && svg.canvas.appendChild(el);
24085        var res = new Element(el, svg);
24086        res.attrs = { cx: x, cy: y, rx: rx, ry: ry, fill: "none", stroke: "#000" };
24087        res.type = "ellipse";
24088        $(el, res.attrs);
24089        return res;
24090    };
24091    R._engine.image = function (svg, src, x, y, w, h) {
24092        var el = $("image");
24093        $(el, { x: x, y: y, width: w, height: h, preserveAspectRatio: "none" });
24094        el.setAttributeNS(xlink, "href", src);
24095        svg.canvas && svg.canvas.appendChild(el);
24096        var res = new Element(el, svg);
24097        res.attrs = { x: x, y: y, width: w, height: h, src: src };
24098        res.type = "image";
24099        return res;
24100    };
24101    R._engine.text = function (svg, x, y, text) {
24102        var el = $("text");
24103        // $(el, {x: x, y: y, "text-anchor": "middle"});
24104        svg.canvas && svg.canvas.appendChild(el);
24105        var res = new Element(el, svg);
24106        res.attrs = {
24107            x: x,
24108            y: y,
24109            "text-anchor": "middle",
24110            text: text,
24111            font: R._availableAttrs.font,
24112            stroke: "none",
24113            fill: "#000"
24114        };
24115        res.type = "text";
24116        setFillAndStroke(res, res.attrs);
24117        return res;
24118    };
24119    R._engine.setSize = function (width, height) {
24120        this.width = width || this.width;
24121        this.height = height || this.height;
24122        this.canvas.setAttribute("width", this.width);
24123        this.canvas.setAttribute("height", this.height);
24124        if (this._viewBox) {
24125            this.setViewBox.apply(this, this._viewBox);
24126        }
24127        return this;
24128    };
24129    R._engine.create = function () {
24130        var con = R._getContainer.apply(0, arguments),
24131            container = con && con.container,
24132            x = con.x,
24133            y = con.y,
24134            width = con.width,
24135            height = con.height;
24136        if (!container) {
24137            throw new Error("SVG container not found.");
24138        }
24139        var cnvs = $("svg"),
24140            css = "overflow:hidden;",
24141            isFloating;
24142        x = x || 0;
24143        y = y || 0;
24144        width = width || 512;
24145        height = height || 342;
24146        $(cnvs, {
24147            height: height,
24148            version: 1.1,
24149            width: width,
24150            xmlns: "http://www.w3.org/2000/svg"
24151        });
24152        if (container == 1) {
24153            cnvs.style.cssText = css + "position:absolute;left:" + x + "px;top:" + y + "px";
24154            R._g.doc.body.appendChild(cnvs);
24155            isFloating = 1;
24156        } else {
24157            cnvs.style.cssText = css + "position:relative";
24158            if (container.firstChild) {
24159                container.insertBefore(cnvs, container.firstChild);
24160            } else {
24161                container.appendChild(cnvs);
24162            }
24163        }
24164        container = new R._Paper;
24165        container.width = width;
24166        container.height = height;
24167        container.canvas = cnvs;
24168        // plugins.call(container, container, R.fn);
24169        container.clear();
24170        container._left = container._top = 0;
24171        isFloating && (container.renderfix = function () { });
24172        container.renderfix();
24173        return container;
24174    };
24175    R._engine.setViewBox = function (x, y, w, h, fit) {
24176        eve("setViewBox", this, this._viewBox, [x, y, w, h, fit]);
24177        var size = mmax(w / this.width, h / this.height),
24178            top = this.top,
24179            aspectRatio = fit ? "meet" : "xMinYMin",
24180            vb,
24181            sw;
24182        if (x == null) {
24183            if (this._vbSize) {
24184                size = 1;
24185            }
24186            delete this._vbSize;
24187            vb = "0 0 " + this.width + S + this.height;
24188        } else {
24189            this._vbSize = size;
24190            vb = x + S + y + S + w + S + h;
24191        }
24192        $(this.canvas, {
24193            viewBox: vb,
24194            preserveAspectRatio: aspectRatio
24195        });
24196        while (size && top) {
24197            sw = "stroke-width" in top.attrs ? top.attrs["stroke-width"] : 1;
24198            top.attr({ "stroke-width": sw });
24199            top._.dirty = 1;
24200            top._.dirtyT = 1;
24201            top = top.prev;
24202        }
24203        this._viewBox = [x, y, w, h, !!fit];
24204        return this;
24205    };
24206
24207    R.prototype.renderfix = function () {
24208        var cnvs = this.canvas,
24209            s = cnvs.style,
24210            pos = cnvs.getScreenCTM() || cnvs.createSVGMatrix(),
24211            left = -pos.e % 1,
24212            top = -pos.f % 1;
24213        if (left || top) {
24214            if (left) {
24215                this._left = (this._left + left) % 1;
24216                s.left = this._left + "px";
24217            }
24218            if (top) {
24219                this._top = (this._top + top) % 1;
24220                s.top = this._top + "px";
24221            }
24222        }
24223    };
24224
24225    R.prototype.clear = function () {
24226        R.eve("clear", this);
24227        var c = this.canvas;
24228        while (c.firstChild) {
24229            c.removeChild(c.firstChild);
24230        }
24231        this.bottom = this.top = null;
24232        (this.desc = $("desc")).appendChild(R._g.doc.createTextNode("Created with Rapha\xebl " + R.version));
24233        c.appendChild(this.desc);
24234        c.appendChild(this.defs = $("defs"));
24235    };
24236
24237    R.prototype.remove = function () {
24238        eve("remove", this);
24239        this.canvas.parentNode && this.canvas.parentNode.removeChild(this.canvas);
24240        for (var i in this) {
24241            this[i] = removed(i);
24242        }
24243    };
24244    var setproto = R.st;
24245    for (var method in elproto) if (elproto[has](method) && !setproto[has](method)) {
24246        setproto[method] = (function (methodname) {
24247            return function () {
24248                var arg = arguments;
24249                return this.forEach(function (el) {
24250                    el[methodname].apply(el, arg);
24251                });
24252            };
24253        })(method);
24254    }
24255}(window.Raphael);
24256
24257// ┌─────────────────────────────────────────────────────────────────────┐ \\
24258// │ Raphaël 2 - JavaScript Vector Library                               │ \\
24259// ├─────────────────────────────────────────────────────────────────────┤ \\
24260// │ VML Module                                                          │ \\
24261// ├─────────────────────────────────────────────────────────────────────┤ \\
24262// │ Copyright (c) 2008-2011 Dmitry Baranovskiy (http://raphaeljs.com)   │ \\
24263// │ Copyright (c) 2008-2011 Sencha Labs (http://sencha.com)             │ \\
24264// │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\
24265// └─────────────────────────────────────────────────────────────────────┘ \\
24266window.Raphael.vml && function (R) {
24267    var has = "hasOwnProperty",
24268        Str = String,
24269        toFloat = parseFloat,
24270        math = Math,
24271        round = math.round,
24272        mmax = math.max,
24273        mmin = math.min,
24274        abs = math.abs,
24275        fillString = "fill",
24276        separator = /[, ]+/,
24277        eve = R.eve,
24278        ms = " progid:DXImageTransform.Microsoft",
24279        S = " ",
24280        E = "",
24281        map = { M: "m", L: "l", C: "c", Z: "x", m: "t", l: "r", c: "v", z: "x" },
24282        bites = /([clmz]),?([^clmz]*)/gi,
24283        blurregexp = / progid:\S+Blur\([^\)]+\)/g,
24284        val = /-?[^,\s-]+/g,
24285        cssDot = "position:absolute;left:0;top:0;width:1px;height:1px",
24286        zoom = 21600,
24287        pathTypes = { path: 1, rect: 1, image: 1 },
24288        ovalTypes = { circle: 1, ellipse: 1 },
24289        path2vml = function (path) {
24290            var total = /[ahqstv]/ig,
24291                command = R._pathToAbsolute;
24292            Str(path).match(total) && (command = R._path2curve);
24293            total = /[clmz]/g;
24294            if (command == R._pathToAbsolute && !Str(path).match(total)) {
24295                var res = Str(path).replace(bites, function (all, command, args) {
24296                    var vals = [],
24297                        isMove = command.toLowerCase() == "m",
24298                        res = map[command];
24299                    args.replace(val, function (value) {
24300                        if (isMove && vals.length == 2) {
24301                            res += vals + map[command == "m" ? "l" : "L"];
24302                            vals = [];
24303                        }
24304                        vals.push(round(value * zoom));
24305                    });
24306                    return res + vals;
24307                });
24308                return res;
24309            }
24310            var pa = command(path), p, r;
24311            res = [];
24312            for (var i = 0, ii = pa.length; i < ii; i++) {
24313                p = pa[i];
24314                r = pa[i][0].toLowerCase();
24315                r == "z" && (r = "x");
24316                for (var j = 1, jj = p.length; j < jj; j++) {
24317                    r += round(p[j] * zoom) + (j != jj - 1 ? "," : E);
24318                }
24319                res.push(r);
24320            }
24321            return res.join(S);
24322        },
24323        compensation = function (deg, dx, dy) {
24324            var m = R.matrix();
24325            m.rotate(-deg, .5, .5);
24326            return {
24327                dx: m.x(dx, dy),
24328                dy: m.y(dx, dy)
24329            };
24330        },
24331        setCoords = function (p, sx, sy, dx, dy, deg) {
24332            var _ = p._,
24333                m = p.matrix,
24334                fillpos = _.fillpos,
24335                o = p.node,
24336                s = o.style,
24337                y = 1,
24338                flip = "",
24339                dxdy,
24340                kx = zoom / sx,
24341                ky = zoom / sy;
24342            s.visibility = "hidden";
24343            if (!sx || !sy) {
24344                return;
24345            }
24346            o.coordsize = abs(kx) + S + abs(ky);
24347            s.rotation = deg * (sx * sy < 0 ? -1 : 1);
24348            if (deg) {
24349                var c = compensation(deg, dx, dy);
24350                dx = c.dx;
24351                dy = c.dy;
24352            }
24353            sx < 0 && (flip += "x");
24354            sy < 0 && (flip += " y") && (y = -1);
24355            s.flip = flip;
24356            o.coordorigin = (dx * -kx) + S + (dy * -ky);
24357            if (fillpos || _.fillsize) {
24358                var fill = o.getElementsByTagName(fillString);
24359                fill = fill && fill[0];
24360                o.removeChild(fill);
24361                if (fillpos) {
24362                    c = compensation(deg, m.x(fillpos[0], fillpos[1]), m.y(fillpos[0], fillpos[1]));
24363                    fill.position = c.dx * y + S + c.dy * y;
24364                }
24365                if (_.fillsize) {
24366                    fill.size = _.fillsize[0] * abs(sx) + S + _.fillsize[1] * abs(sy);
24367                }
24368                o.appendChild(fill);
24369            }
24370            s.visibility = "visible";
24371        };
24372    R.toString = function () {
24373        return "Your browser doesn\u2019t support SVG. Falling down to VML.\nYou are running Rapha\xebl " + this.version;
24374    };
24375    addArrow = function (o, value, isEnd) {
24376        var values = Str(value).toLowerCase().split("-"),
24377            se = isEnd ? "end" : "start",
24378            i = values.length,
24379            type = "classic",
24380            w = "medium",
24381            h = "medium";
24382        while (i--) {
24383            switch (values[i]) {
24384                case "block":
24385                case "classic":
24386                case "oval":
24387                case "diamond":
24388                case "open":
24389                case "none":
24390                    type = values[i];
24391                    break;
24392                case "wide":
24393                case "narrow": h = values[i]; break;
24394                case "long":
24395                case "short": w = values[i]; break;
24396            }
24397        }
24398        var stroke = o.node.getElementsByTagName("stroke")[0];
24399        stroke[se + "arrow"] = type;
24400        stroke[se + "arrowlength"] = w;
24401        stroke[se + "arrowwidth"] = h;
24402    };
24403    setFillAndStroke = function (o, params) {
24404        // o.paper.canvas.style.display = "none";
24405        o.attrs = o.attrs || {};
24406        var node = o.node,
24407            a = o.attrs,
24408            s = node.style,
24409            xy,
24410            newpath = pathTypes[o.type] && (params.x != a.x || params.y != a.y || params.width != a.width || params.height != a.height || params.cx != a.cx || params.cy != a.cy || params.rx != a.rx || params.ry != a.ry || params.r != a.r),
24411            isOval = ovalTypes[o.type] && (a.cx != params.cx || a.cy != params.cy || a.r != params.r || a.rx != params.rx || a.ry != params.ry),
24412            res = o;
24413
24414
24415        for (var par in params) if (params[has](par)) {
24416            a[par] = params[par];
24417        }
24418        if (newpath) {
24419            a.path = R._getPath[o.type](o);
24420            o._.dirty = 1;
24421        }
24422        params.href && (node.href = params.href);
24423        params.title && (node.title = params.title);
24424        params.target && (node.target = params.target);
24425        params.cursor && (s.cursor = params.cursor);
24426        "blur" in params && o.blur(params.blur);
24427        if (params.path && o.type == "path" || newpath) {
24428            node.path = path2vml(~Str(a.path).toLowerCase().indexOf("r") ? R._pathToAbsolute(a.path) : a.path);
24429            if (o.type == "image") {
24430                o._.fillpos = [a.x, a.y];
24431                o._.fillsize = [a.width, a.height];
24432                setCoords(o, 1, 1, 0, 0, 0);
24433            }
24434        }
24435        "transform" in params && o.transform(params.transform);
24436        if (isOval) {
24437            var cx = +a.cx,
24438                cy = +a.cy,
24439                rx = +a.rx || +a.r || 0,
24440                ry = +a.ry || +a.r || 0;
24441            node.path = R.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x", round((cx - rx) * zoom), round((cy - ry) * zoom), round((cx + rx) * zoom), round((cy + ry) * zoom), round(cx * zoom));
24442        }
24443        if ("clip-rect" in params) {
24444            var rect = Str(params["clip-rect"]).split(separator);
24445            if (rect.length == 4) {
24446                rect[2] = +rect[2] + (+rect[0]);
24447                rect[3] = +rect[3] + (+rect[1]);
24448                var div = node.clipRect || R._g.doc.createElement("div"),
24449                    dstyle = div.style;
24450                dstyle.clip = R.format("rect({1}px {2}px {3}px {0}px)", rect);
24451                if (!node.clipRect) {
24452                    dstyle.position = "absolute";
24453                    dstyle.top = 0;
24454                    dstyle.left = 0;
24455                    dstyle.width = o.paper.width + "px";
24456                    dstyle.height = o.paper.height + "px";
24457                    node.parentNode.insertBefore(div, node);
24458                    div.appendChild(node);
24459                    node.clipRect = div;
24460                }
24461            }
24462            if (!params["clip-rect"]) {
24463                node.clipRect && (node.clipRect.style.clip = E);
24464            }
24465        }
24466        if (o.textpath) {
24467            var textpathStyle = o.textpath.style;
24468            params.font && (textpathStyle.font = params.font);
24469            params["font-family"] && (textpathStyle.fontFamily = '"' + params["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g, E) + '"');
24470            params["font-size"] && (textpathStyle.fontSize = params["font-size"]);
24471            params["font-weight"] && (textpathStyle.fontWeight = params["font-weight"]);
24472            params["font-style"] && (textpathStyle.fontStyle = params["font-style"]);
24473        }
24474        if ("arrow-start" in params) {
24475            addArrow(res, params["arrow-start"]);
24476        }
24477        if ("arrow-end" in params) {
24478            addArrow(res, params["arrow-end"], 1);
24479        }
24480        if (params.opacity != null ||
24481            params["stroke-width"] != null ||
24482            params.fill != null ||
24483            params.src != null ||
24484            params.stroke != null ||
24485            params["stroke-width"] != null ||
24486            params["stroke-opacity"] != null ||
24487            params["fill-opacity"] != null ||
24488            params["stroke-dasharray"] != null ||
24489            params["stroke-miterlimit"] != null ||
24490            params["stroke-linejoin"] != null ||
24491            params["stroke-linecap"] != null) {
24492            var fill = node.getElementsByTagName(fillString),
24493                newfill = false;
24494            fill = fill && fill[0];
24495            !fill && (newfill = fill = createNode(fillString));
24496            if (o.type == "image" && params.src) {
24497                fill.src = params.src;
24498            }
24499            params.fill && (fill.on = true);
24500            if (fill.on == null || params.fill == "none" || params.fill === null) {
24501                fill.on = false;
24502            }
24503            if (fill.on && params.fill) {
24504                var isURL = Str(params.fill).match(R._ISURL);
24505                if (isURL) {
24506                    fill.parentNode == node && node.removeChild(fill);
24507                    fill.rotate = true;
24508                    fill.src = isURL[1];
24509                    fill.type = "tile";
24510                    var bbox = o.getBBox(1);
24511                    fill.position = bbox.x + S + bbox.y;
24512                    o._.fillpos = [bbox.x, bbox.y];
24513
24514                    R._preload(isURL[1], function () {
24515                        o._.fillsize = [this.offsetWidth, this.offsetHeight];
24516                    });
24517                } else {
24518                    fill.color = R.getRGB(params.fill).hex;
24519                    fill.src = E;
24520                    fill.type = "solid";
24521                    if (R.getRGB(params.fill).error && (res.type in { circle: 1, ellipse: 1 } || Str(params.fill).charAt() != "r") && addGradientFill(res, params.fill, fill)) {
24522                        a.fill = "none";
24523                        a.gradient = params.fill;
24524                        fill.rotate = false;
24525                    }
24526                }
24527            }
24528            if ("fill-opacity" in params || "opacity" in params) {
24529                var opacity = ((+a["fill-opacity"] + 1 || 2) - 1) * ((+a.opacity + 1 || 2) - 1) * ((+R.getRGB(params.fill).o + 1 || 2) - 1);
24530                opacity = mmin(mmax(opacity, 0), 1);
24531                fill.opacity = opacity;
24532                if (fill.src) {
24533                    fill.color = "none";
24534                }
24535            }
24536            node.appendChild(fill);
24537            var stroke = (node.getElementsByTagName("stroke") && node.getElementsByTagName("stroke")[0]),
24538                newstroke = false;
24539            !stroke && (newstroke = stroke = createNode("stroke"));
24540            if ((params.stroke && params.stroke != "none") ||
24541                params["stroke-width"] ||
24542                params["stroke-opacity"] != null ||
24543                params["stroke-dasharray"] ||
24544                params["stroke-miterlimit"] ||
24545                params["stroke-linejoin"] ||
24546                params["stroke-linecap"]) {
24547                stroke.on = true;
24548            }
24549            (params.stroke == "none" || params.stroke === null || stroke.on == null || params.stroke == 0 || params["stroke-width"] == 0) && (stroke.on = false);
24550            var strokeColor = R.getRGB(params.stroke);
24551            stroke.on && params.stroke && (stroke.color = strokeColor.hex);
24552            opacity = ((+a["stroke-opacity"] + 1 || 2) - 1) * ((+a.opacity + 1 || 2) - 1) * ((+strokeColor.o + 1 || 2) - 1);
24553            var width = (toFloat(params["stroke-width"]) || 1) * .75;
24554            opacity = mmin(mmax(opacity, 0), 1);
24555            params["stroke-width"] == null && (width = a["stroke-width"]);
24556            params["stroke-width"] && (stroke.weight = width);
24557            width && width < 1 && (opacity *= width) && (stroke.weight = 1);
24558            stroke.opacity = opacity;
24559
24560            params["stroke-linejoin"] && (stroke.joinstyle = params["stroke-linejoin"] || "miter");
24561            stroke.miterlimit = params["stroke-miterlimit"] || 8;
24562            params["stroke-linecap"] && (stroke.endcap = params["stroke-linecap"] == "butt" ? "flat" : params["stroke-linecap"] == "square" ? "square" : "round");
24563            if (params["stroke-dasharray"]) {
24564                var dasharray = {
24565                    "-": "shortdash",
24566                    ".": "shortdot",
24567                    "-.": "shortdashdot",
24568                    "-..": "shortdashdotdot",
24569                    ". ": "dot",
24570                    "- ": "dash",
24571                    "--": "longdash",
24572                    "- .": "dashdot",
24573                    "--.": "longdashdot",
24574                    "--..": "longdashdotdot"
24575                };
24576                stroke.dashstyle = dasharray[has](params["stroke-dasharray"]) ? dasharray[params["stroke-dasharray"]] : E;
24577            }
24578            newstroke && node.appendChild(stroke);
24579        }
24580        if (res.type == "text") {
24581            res.paper.canvas.style.display = E;
24582            var span = res.paper.span,
24583                m = 100,
24584                fontSize = a.font && a.font.match(/\d+(?:\.\d*)?(?=px)/);
24585            s = span.style;
24586            a.font && (s.font = a.font);
24587            a["font-family"] && (s.fontFamily = a["font-family"]);
24588            a["font-weight"] && (s.fontWeight = a["font-weight"]);
24589            a["font-style"] && (s.fontStyle = a["font-style"]);
24590            fontSize = toFloat(fontSize ? fontSize[0] : a["font-size"]);
24591            s.fontSize = fontSize * m + "px";
24592            res.textpath.string && (span.innerHTML = Str(res.textpath.string).replace(/</g, "&#60;").replace(/&/g, "&#38;").replace(/\n/g, "<br>"));
24593            var brect = span.getBoundingClientRect();
24594            res.W = a.w = (brect.right - brect.left) / m;
24595            res.H = a.h = (brect.bottom - brect.top) / m;
24596            // res.paper.canvas.style.display = "none";
24597            res.X = a.x;
24598            res.Y = a.y + res.H / 2;
24599
24600            ("x" in params || "y" in params) && (res.path.v = R.format("m{0},{1}l{2},{1}", round(a.x * zoom), round(a.y * zoom), round(a.x * zoom) + 1));
24601            var dirtyattrs = ["x", "y", "text", "font", "font-family", "font-weight", "font-style", "font-size"];
24602            for (var d = 0, dd = dirtyattrs.length; d < dd;
24602 d++) if (dirtyattrs[d] in params) {
24603                res._.dirty = 1;
24604                break;
24605            }
24606
24607            // text-anchor emulation
24608            switch (a["text-anchor"]) {
24609                case "start":
24610                    res.textpath.style["v-text-align"] = "left";
24611                    res.bbx = res.W / 2;
24612                    break;
24613                case "end":
24614                    res.textpath.style["v-text-align"] = "right";
24615                    res.bbx = -res.W / 2;
24616                    break;
24617                default:
24618                    res.textpath.style["v-text-align"] = "center";
24619                    res.bbx = 0;
24620                    break;
24621            }
24622            res.textpath.style["v-text-kern"] = true;
24623        }
24624        // res.paper.canvas.style.display = E;
24625    };
24626    addGradientFill = function (o, gradient, fill) {
24627        o.attrs = o.attrs || {};
24628        var attrs = o.attrs,
24629            opacity,
24630            oindex,
24631            type = "linear",
24632            fxfy = ".5 .5";
24633        o.attrs.gradient = gradient;
24634        gradient = Str(gradient).replace(R._radial_gradient, function (all, fx, fy) {
24635            type = "radial";
24636            if (fx && fy) {
24637                fx = toFloat(fx);
24638                fy = toFloat(fy);
24639                pow(fx - .5, 2) + pow(fy - .5, 2) > .25 && (fy = math.sqrt(.25 - pow(fx - .5, 2)) * ((fy > .5) * 2 - 1) + .5);
24640                fxfy = fx + S + fy;
24641            }
24642            return E;
24643        });
24644        gradient = gradient.split(/\s*\-\s*/);
24645        if (type == "linear") {
24646            var angle = gradient.shift();
24647            angle = -toFloat(angle);
24648            if (isNaN(angle)) {
24649                return null;
24650            }
24651        }
24652        var dots = R._parseDots(gradient);
24653        if (!dots) {
24654            return null;
24655        }
24656        o = o.shape || o.node;
24657        if (dots.length) {
24658            o.removeChild(fill);
24659            fill.on = true;
24660            fill.method = "none";
24661            fill.color = dots[0].color;
24662            fill.color2 = dots[dots.length - 1].color;
24663            var clrs = [];
24664            for (var i = 0, ii = dots.length; i < ii; i++) {
24665                dots[i].offset && clrs.push(dots[i].offset + S + dots[i].color);
24666            }
24667            fill.colors = clrs.length ? clrs.join() : "0% " + fill.color;
24668            if (type == "radial") {
24669                fill.type = "gradientTitle";
24670                fill.focus = "100%";
24671                fill.focussize = "0 0";
24672                fill.focusposition = fxfy;
24673                fill.angle = 0;
24674            } else {
24675                // fill.rotate= true;
24676                fill.type = "gradient";
24677                fill.angle = (270 - angle) % 360;
24678            }
24679            o.appendChild(fill);
24680        }
24681        return 1;
24682    };
24683    Element = function (node, vml) {
24684        this[0] = this.node = node;
24685        node.raphael = true;
24686        this.id = R._oid++;
24687        node.raphaelid = this.id;
24688        this.X = 0;
24689        this.Y = 0;
24690        this.attrs = {};
24691        this.paper = vml;
24692        this.matrix = R.matrix();
24693        this._ = {
24694            transform: [],
24695            sx: 1,
24696            sy: 1,
24697            dx: 0,
24698            dy: 0,
24699            deg: 0,
24700            dirty: 1,
24701            dirtyT: 1
24702        };
24703        !vml.bottom && (vml.bottom = this);
24704        this.prev = vml.top;
24705        vml.top && (vml.top.next = this);
24706        vml.top = this;
24707        this.next = null;
24708    };
24709    var elproto = R.el;
24710
24711    Element.prototype = elproto;
24712    elproto.constructor = Element;
24713    elproto.transform = function (tstr) {
24714        if (tstr == null) {
24715            return this._.transform;
24716        }
24717        var vbs = this.paper._viewBoxShift,
24718            vbt = vbs ? "s" + [vbs.scale, vbs.scale] + "-1-1t" + [vbs.dx, vbs.dy] : E,
24719            oldt;
24720        if (vbs) {
24721            oldt = tstr = Str(tstr).replace(/\.{3}|\u2026/g, this._.transform || E);
24722        }
24723        R._extractTransform(this, vbt + tstr);
24724        var matrix = this.matrix.clone(),
24725            skew = this.skew,
24726            o = this.node,
24727            split,
24728            isGrad = ~Str(this.attrs.fill).indexOf("-"),
24729            isPatt = !Str(this.attrs.fill).indexOf("url(");
24730        matrix.translate(-.5, -.5);
24731        if (isPatt || isGrad || this.type == "image") {
24732            skew.matrix = "1 0 0 1";
24733            skew.offset = "0 0";
24734            split = matrix.split();
24735            if ((isGrad && split.noRotation) || !split.isSimple) {
24736                o.style.filter = matrix.toFilter();
24737                var bb = this.getBBox(),
24738                    bbt = this.getBBox(1),
24739                    dx = bb.x - bbt.x,
24740                    dy = bb.y - bbt.y;
24741                o.coordorigin = (dx * -zoom) + S + (dy * -zoom);
24742                setCoords(this, 1, 1, dx, dy, 0);
24743            } else {
24744                o.style.filter = E;
24745                setCoords(this, split.scalex, split.scaley, split.dx, split.dy, split.rotate);
24746            }
24747        } else {
24748            o.style.filter = E;
24749            skew.matrix = Str(matrix);
24750            skew.offset = matrix.offset();
24751        }
24752        oldt && (this._.transform = oldt);
24753        return this;
24754    };
24755    elproto.rotate = function (deg, cx, cy) {
24756        if (this.removed) {
24757            return this;
24758        }
24759        if (deg == null) {
24760            return;
24761        }
24762        deg = Str(deg).split(separator);
24763        if (deg.length - 1) {
24764            cx = toFloat(deg[1]);
24765            cy = toFloat(deg[2]);
24766        }
24767        deg = toFloat(deg[0]);
24768        (cy == null) && (cx = cy);
24769        if (cx == null || cy == null) {
24770            var bbox = this.getBBox(1);
24771            cx = bbox.x + bbox.width / 2;
24772            cy = bbox.y + bbox.height / 2;
24773        }
24774        this._.dirtyT = 1;
24775        this.transform(this._.transform.concat([["r", deg, cx, cy]]));
24776        return this;
24777    };
24778    elproto.translate = function (dx, dy) {
24779        if (this.removed) {
24780            return this;
24781        }
24782        dx = Str(dx).split(separator);
24783        if (dx.length - 1) {
24784            dy = toFloat(dx[1]);
24785        }
24786        dx = toFloat(dx[0]) || 0;
24787        dy = +dy || 0;
24788        if (this._.bbox) {
24789            this._.bbox.x += dx;
24790            this._.bbox.y += dy;
24791        }
24792        this.transform(this._.transform.concat([["t", dx, dy]]));
24793        return this;
24794    };
24795    elproto.scale = function (sx, sy, cx, cy) {
24796        if (this.removed) {
24797            return this;
24798        }
24799        sx = Str(sx).split(separator);
24800        if (sx.length - 1) {
24801            sy = toFloat(sx[1]);
24802            cx = toFloat(sx[2]);
24803            cy = toFloat(sx[3]);
24804            isNaN(cx) && (cx = null);
24805            isNaN(cy) && (cy = null);
24806        }
24807        sx = toFloat(sx[0]);
24808        (sy == null) && (sy = sx);
24809        (cy == null) && (cx = cy);
24810        if (cx == null || cy == null) {
24811            var bbox = this.getBBox(1);
24812        }
24813        cx = cx == null ? bbox.x + bbox.width / 2 : cx;
24814        cy = cy == null ? bbox.y + bbox.height / 2 : cy;
24815
24816        this.transform(this._.transform.concat([["s", sx, sy, cx, cy]]));
24817        this._.dirtyT = 1;
24818        return this;
24819    };
24820    elproto.hide = function () {
24821        !this.removed && (this.node.style.display = "none");
24822        return this;
24823    };
24824    elproto.show = function () {
24825        !this.removed && (this.node.style.display = E);
24826        return this;
24827    };
24828    elproto._getBBox = function () {
24829        if (this.removed) {
24830            return {};
24831        }
24832        if (this.type == "text") {
24833            return {
24834                x: this.X + (this.bbx || 0) - this.W / 2,
24835                y: this.Y - this.H,
24836                width: this.W,
24837                height: this.H
24838            };
24839        } else {
24840            return pathDimensions(this.attrs.path);
24841        }
24842    };
24843    elproto.remove = function () {
24844        if (this.removed) {
24845            return;
24846        }
24847        R.eve.unbind("*.*." + this.id);
24848        R._tear(this, this.paper);
24849        this.node.parentNode.removeChild(this.node);
24850        this.shape && this.shape.parentNode.removeChild(this.shape);
24851        for (var i in this) {
24852            delete this[i];
24853        }
24854        this.removed = true;
24855    };
24856    elproto.attr = function (name, value) {
24857        if (this.removed) {
24858            return this;
24859        }
24860        if (name == null) {
24861            var res = {};
24862            for (var a in this.attrs) if (this.attrs[has](a)) {
24863                res[a] = this.attrs[a];
24864            }
24865            res.gradient && res.fill == "none" && (res.fill = res.gradient) && delete res.gradient;
24866            res.transform = this._.transform;
24867            return res;
24868        }
24869        if (value == null && R.is(name, "string")) {
24870            if (name == fillString && this.attrs.fill == "none" && this.attrs.gradient) {
24871                return this.attrs.gradient;
24872            }
24873            var names = name.split(separator),
24874                out = {};
24875            for (var i = 0, ii = names.length; i < ii; i++) {
24876                name = names[i];
24877                if (name in this.attrs) {
24878                    out[name] = this.attrs[name];
24879                } else if (R.is(this.paper.customAttributes[name], "function")) {
24880                    out[name] = this.paper.customAttributes[name].def;
24881                } else {
24882                    out[name] = R._availableAttrs[name];
24883                }
24884            }
24885            return ii - 1 ? out : out[names[0]];
24886        }
24887        if (this.attrs && value == null && R.is(name, "array")) {
24888            out = {};
24889            for (i = 0, ii = name.length; i < ii; i++) {
24890                out[name[i]] = this.attr(name[i]);
24891            }
24892            return out;
24893        }
24894        var params;
24895        if (value != null) {
24896            params = {};
24897            params[name] = value;
24898        }
24899        value == null && R.is(name, "object") && (params = name);
24900        for (var key in params) {
24901            R.eve("attr." + key + "." + this.id, this, params[key]);
24902        }
24903        if (params) {
24904            for (key in this.paper.customAttributes) if (this.paper.customAttributes[has](key) && params[has](key) && R.is(this.paper.customAttributes[key], "function")) {
24905                var par = this.paper.customAttributes[key].apply(this, [][concat](params[key]));
24906                this.attrs[key] = params[key];
24907                for (var subkey in par) if (par[has](subkey)) {
24908                    params[subkey] = par[subkey];
24909                }
24910            }
24911            // this.paper.canvas.style.display = "none";
24912            if (params.text && this.type == "text") {
24913                this.textpath.string = params.text;
24914            }
24915            setFillAndStroke(this, params);
24916            // this.paper.canvas.style.display = E;
24917        }
24918        return this;
24919    };
24920    elproto.toFront = function () {
24921        !this.removed && this.node.parentNode.appendChild(this.node);
24922        this.paper && this.paper.top != this && R._tofront(this, this.paper);
24923        return this;
24924    };
24925    elproto.toBack = function () {
24926        if (this.removed) {
24927            return this;
24928        }
24929        if (this.node.parentNode.firstChild != this.node) {
24930            this.node.parentNode.insertBefore(this.node, this.node.parentNode.firstChild);
24931            R._toback(this, this.paper);
24932        }
24933        return this;
24934    };
24935    elproto.insertAfter = function (element) {
24936        if (this.removed) {
24937            return this;
24938        }
24939        if (element.constructor == R.st.constructor) {
24940            element = element[element.length - 1];
24941        }
24942        if (element.node.nextSibling) {
24943            element.node.parentNode.insertBefore(this.node, element.node.nextSibling);
24944        } else {
24945            element.node.parentNode.appendChild(this.node);
24946        }
24947        R._insertafter(this, element, this.paper);
24948        return this;
24949    };
24950    elproto.insertBefore = function (element) {
24951        if (this.removed) {
24952            return this;
24953        }
24954        if (element.constructor == R.st.constructor) {
24955            element = element[0];
24956        }
24957        element.node.parentNode.insertBefore(this.node, element.node);
24958        R._insertbefore(this, element, this.paper);
24959        return this;
24960    };
24961    elproto.blur = function (size) {
24962        var s = this.node.runtimeStyle,
24963            f = s.filter;
24964        f = f.replace(blurregexp, E);
24965        if (+size !== 0) {
24966            this.attrs.blur = size;
24967            s.filter = f + S + ms + ".Blur(pixelradius=" + (+size || 1.5) + ")";
24968            s.margin = R.format("-{0}px 0 0 -{0}px", round(+size || 1.5));
24969        } else {
24970            s.filter = f;
24971            s.margin = 0;
24972            delete this.attrs.blur;
24973        }
24974    };
24975
24976    R._engine.path = function (pathString, vml) {
24977        var el = createNode("shape");
24978        el.style.cssText = cssDot;
24979        el.coordsize = zoom + S + zoom;
24980        el.coordorigin = vml.coordorigin;
24981        var p = new Element(el, vml),
24982            attr = { fill: "none", stroke: "#000" };
24983        pathString && (attr.path = pathString);
24984        p.type = "path";
24985        p.path = [];
24986        p.Path = E;
24987        setFillAndStroke(p, attr);
24988        vml.canvas.appendChild(el);
24989        var skew = createNode("skew");
24990        skew.on = true;
24991        el.appendChild(skew);
24992        p.skew = skew;
24993        p.transform(E);
24994        return p;
24995    };
24996    R._engine.rect = function (vml, x, y, w, h, r) {
24997        var path = R._rectPath(x, y, w, h, r),
24998            res = vml.path(path),
24999            a = res.attrs;
25000        res.X = a.x = x;
25001        res.Y = a.y = y;
25002        res.W = a.width = w;
25003        res.H = a.height = h;
25004        a.r = r;
25005        a.path = path;
25006        res.type = "rect";
25007        return res;
25008    };
25009    R._engine.ellipse = function (vml, x, y, rx, ry) {
25010        var res = vml.path(),
25011            a = res.attrs;
25012        res.X = x - rx;
25013        res.Y = y - ry;
25014        res.W = rx * 2;
25015        res.H = ry * 2;
25016        res.type = "ellipse";
25017        setFillAndStroke(res, {
25018            cx: x,
25019            cy: y,
25020            rx: rx,
25021            ry: ry
25022        });
25023        return res;
25024    };
25025    R._engine.circle = function (vml, x, y, r) {
25026        var res = vml.path(),
25027            a = res.attrs;
25028        res.X = x - r;
25029        res.Y = y - r;
25030        res.W = res.H = r * 2;
25031        res.type = "circle";
25032        setFillAndStroke(res, {
25033            cx: x,
25034            cy: y,
25035            r: r
25036        });
25037        return res;
25038    };
25039    R._engine.image = function (vml, src, x, y, w, h) {
25040        var path = R._rectPath(x, y, w, h),
25041            res = vml.path(path).attr({ stroke: "none" }),
25042            a = res.attrs,
25043            node = res.node,
25044            fill = node.getElementsByTagName(fillString)[0];
25045        a.src = src;
25046        res.X = a.x = x;
25047        res.Y = a.y = y;
25048        res.W = a.width = w;
25049        res.H = a.height = h;
25050        a.path = path;
25051        res.type = "image";
25052        fill.parentNode == node && node.removeChild(fill);
25053        fill.rotate = true;
25054        fill.src = src;
25055        fill.type = "tile";
25056        res._.fillpos = [x, y];
25057        res._.fillsize = [w, h];
25058        node.appendChild(fill);
25059        setCoords(res, 1, 1, 0, 0, 0);
25060        return res;
25061    };
25062    R._engine.text = function (vml, x, y, text) {
25063        var el = createNode("shape"),
25064            path = createNode("path"),
25065            o = createNode("textpath");
25066        x = x || 0;
25067        y = y || 0;
25068        text = text || "";
25069        path.v = R.format("m{0},{1}l{2},{1}", round(x * zoom), round(y * zoom), round(x * zoom) + 1);
25070        path.textpathok = true;
25071        o.string = Str(text);
25072        o.on = true;
25073        el.style.cssText = "position:absolute;left:0;top:0;width:1px;height:1px";
25074        el.coordsize = zoom + S + zoom;
25075        el.coordorigin = "0 0";
25076        var p = new Element(el, vml),
25077            attr = {
25078                fill: "#000",
25079                stroke: "none",
25080                font: R._availableAttrs.font,
25081                text: text
25082            };
25083        p.shape = el;
25084        p.path = path;
25085        p.textpath = o;
25086        p.type = "text";
25087        p.attrs.text = Str(text);
25088        p.attrs.x = x;
25089        p.attrs.y = y;
25090        p.attrs.w = 1;
25091        p.attrs.h = 1;
25092        setFillAndStroke(p, attr);
25093        el.appendChild(o);
25094        el.appendChild(path);
25095        vml.canvas.appendChild(el);
25096        var skew = createNode("skew");
25097        skew.on = true;
25098        el.appendChild(skew);
25099        p.skew = skew;
25100        p.transform(E);
25101        return p;
25102    };
25103    R._engine.setSize = function (width, height) {
25104        var cs = this.canvas.style;
25105        this.width = width;
25106        this.height = height;
25107        width == +width && (width += "px");
25108        height == +height && (height += "px");
25109        cs.width = width;
25110        cs.height = height;
25111        cs.clip = "rect(0 " + width + " " + height + " 0)";
25112        if (this._viewBox) {
25113            setViewBox.apply(this, this._viewBox);
25114        }
25115        return this;
25116    };
25117    R._engine.setViewBox = function (x, y, w, h, fit) {
25118        R.eve("setViewBox", this, this._viewBox, [x, y, w, h, fit]);
25119        var width = this.width,
25120            height = this.height,
25121            size = 1 / mmax(w / width, h / height),
25122            H, W;
25123        if (fit) {
25124            H = height / h;
25125            W = width / w;
25126            if (w * H < width) {
25127                x -= (width - w * H) / 2 / H;
25128            }
25129            if (h * W < height) {
25130                y -= (height - h * W) / 2 / W;
25131            }
25132        }
25133        this._viewBox = [x, y, w, h, !!fit];
25134        this._viewBoxShift = {
25135            dx: -x,
25136            dy: -y,
25137            scale: size
25138        };
25139        this.forEach(function (el) {
25140            el.transform("...");
25141        });
25142        return this;
25143    };
25144    var createNode,
25145        initWin = function (win) {
25146            var doc = win.document;
25147            doc.createStyleSheet().addRule(".rvml", "behavior:url(#default#VML)");
25148            try {
25149                !doc.namespaces.rvml && doc.namespaces.add("rvml", "urn:schemas-microsoft-com:vml");
25150                createNode = function (tagName) {
25151                    return doc.createElement('<rvml:' + tagName + ' class="rvml">');
25152                };
25153            } catch (e) {
25154                createNode = function (tagName) {
25155                    return doc.createElement('<' + tagName + ' xmlns="urn:schemas-microsoft.com:vml" class="rvml">');
25156                };
25157            }
25158        };
25159    initWin(R._g.win);
25160    R._engine.create = function () {
25161        var con = R._getContainer.apply(0, arguments),
25162            container = con.container,
25163            height = con.height,
25164            s,
25165            width = con.width,
25166            x = con.x,
25167            y = con.y;
25168        if (!container) {
25169            throw new Error("VML container not found.");
25170        }
25171        var res = new R._Paper,
25172            c = res.canvas = R._g.doc.createElement("div"),
25173            cs = c.style;
25174        x = x || 0;
25175        y = y || 0;
25176        width = width || 512;
25177        height = height || 342;
25178        res.width = width;
25179        res.height = height;
25180        width == +width && (width += "px");
25181        height == +height && (height += "px");
25182        res.coordsize = zoom * 1e3 + S + zoom * 1e3;
25183        res.coordorigin = "0 0";
25184        res.span = R._g.doc.createElement("span");
25185        res.span.style.cssText = "position:absolute;
25185left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;";
25186        c.appendChild(res.span);
25187        cs.cssText = R.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden", width, height);
25188        if (container == 1) {
25189            R._g.doc.body.appendChild(c);
25190            cs.left = x + "px";
25191            cs.top = y + "px";
25192            cs.position = "absolute";
25193        } else {
25194            if (container.firstChild) {
25195                container.insertBefore(c, container.firstChild);
25196            } else {
25197                container.appendChild(c);
25198            }
25199        }
25200        // plugins.call(res, res, R.fn);
25201        res.renderfix = function () { };
25202        return res;
25203    };
25204    R.prototype.clear = function () {
25205        R.eve("clear", this);
25206        this.canvas.innerHTML = E;
25207        this.span = R._g.doc.createElement("span");
25208        this.span.style.cssText = "position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";
25209        this.canvas.appendChild(this.span);
25210        this.bottom = this.top = null;
25211    };
25212    R.prototype.remove = function () {
25213        R.eve("remove", this);
25214        this.canvas.parentNode.removeChild(this.canvas);
25215        for (var i in this) {
25216            this[i] = removed(i);
25217        }
25218        return true;
25219    };
25220}(window.Raphael);
25221(function ($, document, window, Raphael, undefined) {
25222    // jQuery Plugin Factory
25223    function jQueryPluginFactory($, name, methods, getters) {
25224        getters = getters instanceof Array ? getters : [];
25225        var getters_obj = {};
25226        for (var i = 0; i < getters.length; i++) {
25227            getters_obj[getters[i]] = true;
25228        }
25229
25230
25231        // Create the object
25232        var Plugin = function (element) {
25233            this.element = element;
25234        };
25235        Plugin.prototype = methods;
25236
25237        // Assign the plugin
25238        $.fn[name] = function () {
25239            var args = arguments;
25240            var returnValue = this;
25241
25242            this.each(function () {
25243                var $this = $(this);
25244                var plugin = $this.data('plugin-' + name);
25245                // Init the plugin if first time
25246                if (!plugin) {
25247                    plugin = new Plugin($this);
25248                    $this.data('plugin-' + name, plugin);
25249                    if (plugin._init) {
25250                        plugin._init.apply(plugin, args);
25251                    }
25252
25253                    // call a method
25254                } else if (typeof args[0] == 'string' && args[0].charAt(0) != '_' && typeof plugin[args[0]] == 'function') {
25255                    var methodArgs = Array.prototype.slice.call(args, 1);
25256                    var r = plugin[args[0]].apply(plugin, methodArgs);
25257                    // set the return value if method is a getter
25258                    if (args[0] in getters_obj) {
25259                        returnValue = r;
25260                    }
25261                }
25262
25263            });
25264
25265            return returnValue; // returning the jQuery object
25266        };
25267    };
25268
25269
25270    // Some constants
25271    var WIDTH = 930,
25272        HEIGHT = 630,
25273        LABELS_WIDTH = 70;
25274
25275    // Default options
25276    var defaults = {
25277        // The styles for the state
25278        'stateStyles': {
25279            fill: "#333",
25280            stroke: "#666",
25281            "stroke-width": 1,
25282            "stroke-linejoin": "round",
25283            scale: [1, 1]
25284        },
25285
25286        // The styles for the hover
25287        'stateHoverStyles': {
25288            fill: "#33c",
25289            stroke: "#000",
25290            scale: [1.1, 1.1]
25291        },
25292
25293        // The time for the animation, set to false to remove the animation
25294        'stateHoverAnimation': 500,
25295
25296        // State specific styles. 'ST': {}
25297        'stateSpecificStyles': {},
25298
25299        // State specific hover styles
25300        'stateSpecificHoverStyles': {},
25301
25302
25303        // Events
25304        'click': null,
25305
25306        'mouseover': null,
25307
25308        'mouseout': null,
25309
25310        'clickState': {},
25311
25312        'mouseoverState': {},
25313
25314        'mouseoutState': {},
25315
25316
25317        // Labels
25318        'showLabels': true,
25319
25320        'labelWidth': 20,
25321
25322        'labelHeight': 15,
25323
25324        'labelGap': 6,
25325
25326        'labelRadius': 3,
25327
25328        'labelBackingStyles': {
25329            fill: "#333",
25330            stroke: "#666",
25331            "stroke-width": 1,
25332            "stroke-linejoin": "round",
25333            scale: [1, 1]
25334        },
25335
25336        // The styles for the hover
25337        'labelBackingHoverStyles': {
25338            fill: "#33c",
25339            stroke: "#000"
25340        },
25341
25342        'stateSpecificLabelBackingStyles': {},
25343
25344        'stateSpecificLabelBackingHoverStyles': {},
25345
25346        'labelTextStyles': {
25347            fill: "#fff",
25348            'stroke': 'none',
25349            'font-weight': 300,
25350            'stroke-width': 0,
25351            'font-size': '10px'
25352        },
25353
25354        // The styles for the hover
25355        'labelTextHoverStyles': {},
25356
25357        'stateSpecificLabelTextStyles': {},
25358
25359        'stateSpecificLabelTextHoverStyles': {}
25360    };
25361
25362
25363    // Methods
25364    var methods = {
25365        /**
25366         * The init function
25367         */
25368        _init: function (options) {
25369            // Save the options
25370            this.options = {};
25371            $.extend(this.options, defaults, options);
25372
25373            // Save the width and height;
25374            var width = this.element.width();
25375            var height = this.element.height();
25376
25377            // Calculate the width and height to match the container while keeping the labels at a fixed size
25378            var xscale = this.element.width() / WIDTH;
25379            var yscale = this.element.height() / HEIGHT;
25380            this.scale = Math.min(xscale, yscale);
25381            this.labelAreaWidth = Math.ceil(LABELS_WIDTH / this.scale); // The actual width with the labels reversed scaled
25382
25383            var paperWidthWithLabels = WIDTH + Math.max(0, this.labelAreaWidth - LABELS_WIDTH);
25384            // Create the Raphael instances
25385            this.paper = Raphael(this.element.get(0), paperWidthWithLabels, HEIGHT);//this.element.width(), this.element.height());
25386
25387            // Scale to fit
25388            this.paper.setSize(width, height);
25389            this.paper.setViewBox(0, 0, paperWidthWithLabels, HEIGHT, false);
25390
25391            // Keep track of all the states
25392            this.stateHitAreas = {}; // transparent for the hit area
25393            this.stateShapes = {}; // for the visual shape
25394            this.topShape = null;
25395
25396            // create all the states
25397            this._initCreateStates();
25398
25399            // create the labels for the smaller states
25400            this.labelShapes = {};
25401            this.labelTexts = {};
25402            this.labelHitAreas = {};
25403            if (this.options.showLabels) {
25404                this._initCreateLabels();
25405            }
25406
25407            // Add the
25408        },
25409
25410        /**
25411         * Create the state objects
25412         */
25413        _initCreateStates: function () {
25414            // TODO: Dynamic attrs
25415            var attr = this.options.stateStyles;
25416            var R = this.paper; // shorter name for usage here
25417
25418            // The coords for each state
25419            var paths = {
25420                HI: "M 233.08751,519.30948 L 235.02744,515.75293 L 237.2907,515.42961 L 237.61402,516.23791 L 235.51242,519.30948 z M 243.27217,515.59127 L 249.4153,518.17784 L 251.51689,517.85452 L 253.1335,513.97465 L 252.48686,510.57977 L 248.28366,510.09479 L 244.24213,511.87306 z M 273.9878,525.61427 L 277.706,531.11074 L 280.13092,530.78742 L 281.26255,530.30244 L 282.7175,531.59573 L 286.43571,531.43407 L 287.40568,529.97912 L 284.49577,528.20085 L 282.55584,524.48263 L 280.45424,520.92609 L 274.63444,523.83599 z M 294.19545,534.50564 L 295.48874,532.5657 L 300.17691,533.53566 L 300.82356,533.05068 L 306.96668,533.69732 L 306.64336,534.99062 L 304.05678,536.44556 L 299.69193,536.12224 z M 299.53027,539.67879 L 301.47021,543.55866 L 304.54176,542.42703 L 304.86509,540.81041 L 303.24848,538.70882 L 299.53027,538.3855 z M 306.4817,538.54716 L 308.74496,535.63726 L 313.43313,538.06218 L 317.79798,539.19381 L 322.16284,541.94205 L 322.16284,543.88198 L 318.6063,545.66026 L 313.75645,546.63022 L 311.33154,545.17527 z M 323.13281,554.06663 L 324.74942,552.77335 L 328.14431,554.38997 L 335.74238,557.94651 L 339.13727,560.0481 L 340.75387,562.47302 L 342.69381,566.83787 L 346.73534,569.42445 L 346.41202,570.71775 L 342.53215,573.95097 L 338.32896,575.40592 L 336.87401,574.75928 L 333.80244,576.53754 L 331.37753,579.77077 L 329.11427,582.68067 L 327.33599,582.51901 L 323.77945,579.93243 L 323.45613,575.40592 L 324.10277,572.981 L 322.48616,567.32286 L 320.38456,565.54458 L 320.2229,562.958 L 322.48616,561.98804 L 324.58776,558.91648 L 325.07274,557.94651 L 323.45613,556.16823 z",
25421                AK: "M 158.07671,453.67502 L 157.75339,539.03215 L 159.36999,540.00211 L 162.44156,540.16377 L 163.8965,539.03215 L 166.48308,539.03215 L 166.64475,541.94205 L 173.59618,548.73182 L 174.08117,551.3184 L 177.47605,549.37846 L 178.1227,549.2168 L 178.44602,546.14524 L 179.90096,544.52863 L 181.0326,544.36697 L 182.97253,542.91201 L 186.04409,545.01361 L 186.69074,547.92352 L 188.63067,549.05514 L 189.7623,551.48006 L 193.64218,553.25833 L 197.03706,559.2398 L 199.78529,563.11966 L 202.04855,565.86791 L 203.50351,569.58611 L 208.515,571.36439 L 213.68817,573.46598 L 214.65813,577.83084 L 215.14311,580.9024 L 214.17315,584.29729 L 212.39487,586.56054 L 210.77826,585.75224 L 209.32331,582.68067 L 206.57507,581.22573 L 204.7968,580.09409 L 203.98849,580.9024 L 205.44344,583.65065 L 205.6051,587.36885 L 204.47347,587.85383 L 202.53354,585.9139 L 200.43195,584.62061 L 200.91693,586.23722 L 202.21021,588.0155 L 201.40191,588.8238 C 201.40191,588.8238 200.59361,588.50048 200.10863,587.85383 C 199.62363,587.20719 198.00703,584.45895 198.00703,584.45895 L 197.03706,582.19569 C 197.03706,582.19569 196.71374,583.48898 196.06709,583.16565 C 195.42044,582.84233 194.7738,581.71071 194.7738,581.71071 L 196.55207,579.77077 L 195.09712,578.31582 L 195.09712,573.30432 L 194.28882,573.30432 L 193.48052,576.6992 L 192.34888,577.1842 L 191.37892,573.46598 L 190.73227,569.74777 L 189.92396,569.26279 L 190.24729,574.92094 L 190.24729,576.05256 L 188.79233,574.75928 L 185.23579,568.77781 L 183.13419,568.29283 L 182.48755,564.57462 L 180.87094,561.66472 L 179.25432,560.53308 L 179.25432,558.26983 L 181.35592,556.97654 L 180.87094,556.65322 L 178.28436,557.29986 L 174.88947,554.87495 L 172.30289,551.96504 L 167.45306,549.37846 L 163.41152,546.79188 L 164.70482,543.55866 L 164.70482,541.94205 L 162.92654,543.55866 L 160.01664,544.69029 L 156.29843,543.55866 L 150.64028,541.13375 L 145.14381,541.13375 L 144.49717,541.61873 L 138.03072,537.73885 L 135.92912,537.41553 L 133.18088,531.59573 L 129.62433,531.91905 L 126.06778,533.374 L 126.55277,537.90052 L 127.68439,534.99062 L 128.65437,535.31394 L 127.19941,539.67879 L 130.43263,536.93055 L 131.07928,538.54716 L 127.19941,542.91201 L 125.90612,542.58869 L 125.42114,540.64875 L 124.12785,539.84045 L 122.83456,540.97208 L 120.08632,539.19381 L 117.01475,541.29541 L 115.23649,543.397 L 111.8416,545.4986 L 107.15342,545.33693 L 106.66844,543.23534 L 110.38664,542.58869 L 110.38664,541.29541 L 108.12338,540.64875 L 109.09336,538.22384 L 111.35661,534.34397 L 111.35661,532.5657 L 111.51827,531.75739 L 115.88313,529.49413 L 116.85309,530.78742 L 119.60134,530.78742 L 118.30805,528.20085 L 114.58983,527.87752 L 109.57834,530.62576 L 107.15342,534.02064 L 105.37515,536.60723 L 104.24352,538.87049 L 100.04033,540.32543 L 96.96876,542.91201 L 96.645439,544.52863 L 98.908696,545.4986 L 99.717009,547.60018 L 96.96876,550.83341 L 90.502321,555.03661 L 82.742574,559.2398 L 80.640977,560.37142 L 75.306159,561.50306 L 69.971333,563.76631 L 71.749608,565.0596 L 70.294654,566.51455 L 69.809672,567.64618 L 67.061434,566.67621 L 63.828214,566.83787 L 63.019902,569.10113 L 62.049939,569.10113 L 62.37326,566.67621 L 58.816709,567.96951 L 55.90681,568.93947 L 52.511924,567.64618 L 49.602023,569.58611 L 46.368799,569.58611 L 44.267202,570.87941 L 42.65059,571.68771 L 40.548995,571.36439 L 37.962415,570.23276 L 35.699158,570.87941 L 34.729191,571.84937 L 33.112578,570.71775 L 33.112578,568.77781 L 36.184142,567.48452 L 42.488929,568.13117 L 46.853782,566.51455 L 48.955378,564.41296 L 51.86528,563.76631 L 53.643553,562.958 L 56.391794,563.11966 L 58.008406,564.41296 L 58.978369,564.08964 L 61.241626,561.3414 L 64.313196,560.37142 L 67.708076,559.72478 L 69.00137,559.40146 L 69.648012,559.88644 L 70.456324,559.88644 L 71.749608,556.16823 L 7
254215.791141,554.71329 L 77.731077,550.99508 L 79.994336,546.46856 L 81.610951,545.01361 L 81.934272,542.42703 L 80.317657,543.72032 L 76.922764,544.36697 L 76.276122,541.94205 L 74.982838,541.61873 L 74.012865,542.58869 L 73.851205,545.4986 L 72.39625,545.33693 L 70.941306,539.51713 L 69.648012,540.81041 L 68.516388,540.32543 L 68.193068,538.3855 L 64.151535,538.54716 L 62.049939,539.67879 L 59.463361,539.35547 L 60.918305,537.90052 L 61.403286,535.31394 L 60.756645,533.374 L 62.211599,532.40404 L 63.504883,532.24238 L 62.858241,530.4641 L 62.858241,526.09925 L 61.888278,525.12928 L 61.079966,526.58423 L 54.936843,526.58423 L 53.481892,525.29094 L 52.835247,521.41108 L 50.733651,517.85452 L 50.733651,516.88456 L 52.835247,516.07625 L 52.996908,513.97465 L 54.128536,512.84303 L 53.320231,512.35805 L 52.026941,512.84303 L 50.895313,510.09479 L 51.86528,505.08328 L 56.391794,501.85007 L 58.978369,500.23345 L 60.918305,496.51525 L 63.666554,495.22195 L 66.253132,496.35359 L 66.576453,498.77851 L 69.00137,498.45517 L 72.23459,496.03026 L 73.851205,496.67691 L 74.821167,497.32355 L 76.437782,497.32355 L 78.701041,496.03026 L 79.509354,491.6654 C 79.509354,491.6654 79.832675,488.75551 80.479317,488.27052 C 81.125959,487.78554 81.44928,487.30056 81.44928,487.30056 L 80.317657,485.36062 L 77.731077,486.16893 L 74.497847,486.97723 L 72.557911,486.49225 L 69.00137,484.71397 L 63.989875,484.55231 L 60.433324,480.83411 L 60.918305,476.95424 L 61.564957,474.52932 L 59.463361,472.75105 L 57.523423,469.03283 L 58.008406,468.22453 L 64.798177,467.73955 L 66.899773,467.73955 L 67.869736,468.70951 L 68.516388,468.70951 L 68.354728,467.0929 L 72.23459,466.44626 L 74.821167,466.76958 L 76.276122,467.90121 L 74.821167,470.00281 L 74.336186,471.45775 L 77.084435,473.07437 L 82.095932,474.85264 L 83.874208,473.88268 L 81.610951,469.51783 L 80.640977,466.2846 L 81.610951,465.47629 L 78.21606,463.53636 L 77.731077,462.40472 L 78.21606,460.78812 L 77.407756,456.90825 L 74.497847,452.22007 L 72.072929,448.01688 L 74.982838,446.07694 L 78.21606,446.07694 L 79.994336,446.72359 L 84.197528,446.56193 L 87.915733,443.00539 L 89.047366,439.93382 L 92.765578,437.5089 L 94.382182,438.47887 L 97.130421,437.83222 L 100.84863,435.73062 L 101.98027,435.56896 L 102.95023,436.37728 L 107.47674,436.21561 L 110.22498,433.14405 L 111.35661,433.14405 L 114.91316,435.56896 L 116.85309,437.67056 L 116.36811,438.80219 L 117.01475,439.93382 L 118.63137,438.31721 L 122.51124,438.64053 L 122.83456,442.35873 L 124.7745,443.81369 L 131.88759,444.46033 L 138.19238,448.66352 L 139.64732,447.69356 L 144.82049,450.28014 L 146.92208,449.6335 L 148.86202,448.82518 L 153.71185,450.76512 L 158.07671,453.67502 z M 42.973913,482.61238 L 45.075509,487.9472 L 44.913847,488.91717 L 42.003945,488.59384 L 40.225672,484.55231 L 38.447399,483.09737 L 36.02248,483.09737 L 35.86082,480.51078 L 37.639093,478.08586 L 38.770722,480.51078 L 40.225672,481.96573 z M 40.387333,516.07625 L 44.105542,516.88456 L 47.823749,517.85452 L 48.632056,518.8245 L 47.015444,522.5427 L 43.94388,522.38104 L 40.548995,518.8245 z M 19.694697,502.01173 L 20.826327,504.5983 L 21.957955,506.21492 L 20.826327,507.02322 L 18.72473,503.95166 L 18.72473,502.01173 z M 5.9534943,575.0826 L 9.3483796,572.81934 L 12.743265,571.84937 L 15.329845,572.17269 L 15.814828,573.7893 L 17.754763,574.27429 L 19.694697,572.33436 L 19.371375,570.71775 L 22.119616,570.0711 L 25.029518,572.65768 L 23.897889,574.43595 L 19.533037,575.56758 L 16.784795,575.0826 L 13.066588,573.95097 L 8.7017347,575.40592 L 7.0851227,575.72924 z M 54.936843,570.55609 L 56.553455,572.49602 L 58.655048,570.87941 L 57.2001,569.58611 z M 57.846745,573.62764 L 58.978369,571.36439 L 61.079966,571.68771 L 60.271663,573.62764 z M 81.44928,571.68771 L 82.904234,573.46598 L 83.874208,572.33436 L 83.065895,570.39442 z M 90.17899,559.2398 L 91.310623,565.0596 L 94.220522,565.86791 L 99.232017,562.958 L 103.59687,560.37142 L 101.98027,557.94651 L 102.46525,555.52159 L 100.36365,556.81488 L 97.453752,556.00657 L 99.070357,554.87495 L 101.01029,555.68325 L 104.89016,553.90497 L 105.37515,552.45003 L 102.95023,551.64172 L 103.75853,549.70178 L 101.01029,551.64172 L 96.322118,555.19827 L 91.472284,558.10817 z M 132.53423,539.35547 L 134.95915,537.90052 L 133.98918,536.12224 L 132.21091,537.09221 z",
25422                FL: "M 755.39728,445.50676 L 757.66294,452.82536 L 761.39264,462.56762 L 766.72743,471.94392 L 770.44562,478.24868 L 775.29544,483.74514 L 779.33695,487.46333 L 780.95355,490.37322 L 779.82193,491.666
254225 L 779.01363,492.95978 L 781.92351,500.39617 L 784.8334,503.30605 L 787.41997,508.64085 L 790.9765,514.46063 L 795.50299,522.70531 L 796.79628,530.30335 L 797.28126,542.26623 L 797.9279,544.04449 L 797.60458,547.43936 L 795.17967,548.73265 L 795.50299,550.67257 L 794.85635,552.6125 L 795.17967,555.0374 L 795.66465,556.97733 L 792.91643,560.21054 L 789.84488,561.66548 L 785.96503,561.82714 L 784.51008,563.44375 L 782.08518,564.41371 L 780.79189,563.92873 L 779.66027,562.95877 L 779.33695,560.04888 L 778.52864,556.65401 L 775.13377,551.48087 L 771.57724,549.21763 L 767.69739,548.89431 L 766.88909,550.18759 L 763.81754,545.82276 L 763.1709,542.26623 L 760.58433,538.22472 L 758.80607,537.09309 L 757.18946,539.19468 L 755.4112,538.87136 L 753.30961,533.85988 L 750.39972,529.98003 L 747.48983,524.64524 L 744.90327,521.57369 L 741.34674,517.8555 L 743.44832,515.43059 L 746.68153,509.93413 L 746.51987,508.31753 L 741.99338,507.34757 L 740.37677,507.99421 L 740.7001,508.64085 L 743.28666,509.61081 L 741.83172,514.13731 L 741.02342,514.62229 L 739.24515,510.58078 L 737.95187,505.73096 L 737.62855,502.98273 L 739.08349,498.29458 L 739.08349,488.75661 L 736.01194,485.03842 L 734.71866,481.96687 L 729.54552,480.67359 L 727.6056,480.02695 L 725.98899,477.44038 L 722.59412,475.82377 L 721.4625,472.4289 L 718.71427,471.45894 L 716.28936,467.74075 L 712.08619,466.28581 L 709.1763,464.83086 L 706.58974,464.83086 L 702.54822,465.63917 L 702.38656,467.57909 L 703.19487,468.54905 L 702.70988,469.68068 L 699.63834,469.51902 L 695.92015,473.07555 L 692.36361,475.01547 L 688.48376,475.01547 L 685.25055,476.30876 L 684.92723,473.56053 L 683.31063,471.6206 L 680.40074,470.48898 L 678.78414,469.03403 L 670.70111,465.15418 L 663.10307,463.37592 L 658.73824,464.02256 L 652.7568,464.50754 L 646.77536,466.60913 L 643.29612,467.22209 L 643.0582,459.17234 L 640.47163,457.23242 L 638.69336,455.45415 L 639.01668,452.38259 L 649.2013,451.08931 L 674.7437,448.17942 L 681.53345,447.53278 L 686.96945,447.81305 L 689.55602,451.69291 L 691.01096,453.14785 L 699.10912,453.66307 L 709.92887,453.01643 L 731.44126,451.72314 L 736.88698,451.04877 L 741.46423,451.0765 L 741.62589,453.98639 L 745.44989,454.79469 L 745.77321,449.98792 L 744.15661,445.46141 L 745.11145,444.72869 L 750.22414,445.18344 z M 767.94269,577.91184 L 770.36761,577.2652 L 771.66089,577.02271 L 773.11585,574.67862 L 775.45993,573.06201 L 776.75322,573.547 L 778.45066,573.87032 L 778.85481,574.92111 L 775.37911,576.13357 L 771.17591,577.58852 L 768.83183,578.80098 z M 781.44139,572.90035 L 782.65385,573.95115 L 785.40209,571.84956 L 790.7369,567.64637 L 794.4551,563.7665 L 796.96085,557.1384 L 797.93082,555.44096 L 798.09248,552.04608 L 797.365,552.53106 L 796.39504,555.36013 L 794.94008,559.96746 L 791.70686,565.22146 L 787.34202,569.42464 L 783.94714,571.36457 z",
25423                SC: "M 761.23097,412.93785 L 759.45391,413.90735 L 756.86734,412.61406 L 756.2207,410.51247 L 754.92742,406.95594 L 752.66416,404.85434 L 750.07759,404.2077 L 748.46099,399.35789 L 745.71275,393.37644 L 741.50958,391.4365 L 739.40798,389.49658 L 738.1147,386.91001 L 736.01311,384.97007 L 733.74986,383.67679 L 731.48661,380.7669 L 728.41506,378.50366 L 723.88855,376.72538 L 723.40357,375.27044 L 720.97867,372.36055 L 720.49368,370.90559 L 717.0988,365.73246 L 713.70393,365.89412 L 709.66241,363.4692 L 708.36913,362.17592 L 708.04581,360.39765 L 708.85411,358.45773 L 711.11736,357.48775 L 710.79404,355.38617 L 716.93714,352.7996 L 725.99014,348.2731 L 733.26487,347.46479 L 749.75427,346.97981 L 752.01752,348.91974 L 753.63412,352.15296 L 757.99897,351.66798 L 770.6085,350.21302 L 773.51839,351.02133 L 786.12793,358.61939 L 796.23601,366.74107 L 790.81484,372.19941 L 788.22827,378.34251 L 787.74329,384.64727 L 786.12669,385.45557 L 784.99506,388.2038 L 782.57016,388.85044 L 780.46857,392.40697 L 777.72034,395.1552 L 775.4571,398.55007 L 773.84049,399.35837 L 770.28396,402.75324 L 767.37407,402.9149 L 768.34404,406.14811 L 763.33256,411.64457 z",
25424                GA: "M 689.61648,357.97274 L 684.76666,358.78105 L 676.3603,359.91267 L 667.79229,360.8018 L 667.79229,362.98422 L 667.95395,365.08582 L 668.60059,368.48069 L 671.99547,376.40206 L 674.42038,386.26337 L 675.87532,392.40648 L 677.49193,397.25629 L 678.94688,404.2077 L 681.04847,410.51247 L 683.63504,413.90735 L 684.12002,417.30222 L 686.05995,418.110
2542452 L 686.22161,420.21212 L 684.44334,425.06193 L 683.95836,428.29515 L 683.7967,430.23508 L 685.41331,434.59992 L 685.73663,439.93472 L 684.92832,442.35963 L 685.57497,443.16794 L 687.02992,443.97624 L 687.67656,447.37111 L 690.26313,451.25097 L 691.71807,452.70591 L 699.63945,452.86757 L 710.4592,452.22093 L 731.97159,450.92765 L 737.41731,450.25328 L 741.99456,450.28101 L 742.15622,453.1909 L 744.74279,453.9992 L 745.06611,449.63436 L 743.4495,445.10786 L 744.58113,443.49126 L 750.40091,444.29956 L 755.37832,444.61734 L 754.6029,438.31855 L 756.86614,428.2956 L 758.32109,424.09242 L 757.8361,421.50586 L 761.17051,415.26156 L 760.66021,413.90988 L 758.7468,414.61446 L 756.16024,413.32116 L 755.51359,411.21957 L 754.22031,407.66304 L 751.95705,405.56145 L 749.37049,404.91481 L 747.75388,400.06499 L 744.82887,393.72999 L 740.6257,391.79006 L 738.5241,389.85013 L 737.23081,387.26356 L 735.12923,385.32363 L 732.86598,384.03034 L 730.60273,381.12045 L 727.53118,378.85721 L 723.00467,377.07893 L 722.51969,375.62399 L 720.09478,372.7141 L 719.6098,371.25915 L 716.21492,366.35117 L 712.82005,366.51284 L 708.69014,363.4692 L 707.39686,362.17592 L 707.07354,360.39765 L 707.88184,358.45773 L 710.23348,357.22259 L 709.09954,356.00037 L 709.17743,355.70949 L 703.35764,356.67945 L 696.40623,357.48775 z",
25425                AL: "M 625.59784,466.77079 L 623.98224,451.57429 L 621.234,432.82165 L 621.39566,418.75716 L 622.20396,387.71831 L 622.0423,371.06725 L 622.20739,364.64819 L 629.96369,364.2775 L 657.76933,361.69094 L 666.69187,361.02874 L 666.54407,363.21116 L 666.70573,365.31276 L 667.35238,368.70763 L 670.74726,376.629 L 673.17216,386.49031 L 674.62711,392.63342 L 676.24371,397.48324 L 677.69867,404.43465 L 679.80025,410.73941 L 682.38682,414.1343 L 682.8718,417.52916 L 684.81174,418.33747 L 684.9734,420.43906 L 683.19512,425.28888 L 682.71014,428.5221 L 682.54848,430.46202 L 684.1651,434.82687 L 684.48842,440.16166 L 683.6801,442.58658 L 684.32676,443.39488 L 685.7817,444.20318 L 686.81695,446.73845 L 680.51218,446.73845 L 673.72243,447.3851 L 648.18003,450.29498 L 637.76847,451.70175 L 637.67209,455.45415 L 639.45036,457.23242 L 642.03693,459.17234 L 642.61779,467.10778 L 637.07573,469.68068 L 634.32751,469.35736 L 637.07573,467.41743 L 637.07573,466.44747 L 634.00419,460.46603 L 631.74094,459.81939 L 630.28599,464.18422 L 628.99271,466.93245 L 628.34607,466.77079 z",
25426                NC: "M 832.10653,298.47179 L 833.81653,303.17039 L 837.37306,309.63681 L 839.79796,312.06172 L 840.4446,314.32497 L 838.0197,314.48663 L 838.828,315.13327 L 838.50468,319.33644 L 835.91811,320.62972 L 835.27147,322.73131 L 833.97819,325.6412 L 830.25999,327.2578 L 827.83509,326.93448 L 826.38014,326.77282 L 824.76354,325.47954 L 825.08686,326.77282 L 825.08686,327.74279 L 827.02679,327.74279 L 827.83509,329.03607 L 825.89516,335.34083 L 830.09833,335.34083 L 830.74498,336.95743 L 833.00822,334.69419 L 834.30151,334.2092 L 832.36158,337.76573 L 829.29003,342.61555 L 827.99675,342.61555 L 826.86512,342.13057 L 824.1169,342.77721 L 818.94376,345.20212 L 812.47734,350.53691 L 809.08247,355.22506 L 807.14255,361.69148 L 806.65757,364.11639 L 801.96941,364.60137 L 796.51628,365.93803 L 786.56987,357.7355 L 773.96033,350.13745 L 771.05044,349.32914 L 758.44091,350.78409 L 754.16445,351.53424 L 752.54785,348.30102 L 749.57749,346.18432 L 733.0881,346.6693 L 725.81336,347.4776 L 716.76037,352.00411 L 710.61726,354.59067 L 709.00066,354.91399 L 703.18087,355.88396 L 696.22946,356.69226 L 689.43971,357.17725 L 689.9398,353.12292 L 691.71807,351.66798 L 694.46631,351.02133 L 695.11295,347.30313 L 699.31613,344.55491 L 703.19598,343.09995 L 707.39917,339.54342 L 711.764,337.44183 L 712.41064,334.37027 L 716.2905,330.49042 L 716.93714,330.32876 C 716.93714,330.32876 716.93714,331.46039 717.74545,331.46039 C 718.55375,331.46039 719.68538,331.78371 719.68538,331.78371 L 721.94863,328.22717 L 724.05022,327.58052 L 726.31346,327.90385 L 727.93008,324.34732 L 730.83997,321.76074 L 731.32495,319.65915 L 731.32495,315.69846 L 735.85145,316.42594 L 742.98754,315.13265 L 758.80727,313.19272 L 775.94331,310.60615 L 795.86504,306.60555 L 815.59836,302.44073 L 826.9628,299.6443 z M 836.00199,331.45961 L 838.58857,328.95386 L 841.74095,326.36728 L 843.27673,325.72064 L 843.43839,323.69988 L 842.79175,317.55676 L 841.3368,315.21268 L 840.69015,313.35358 L 841.41763,313.11108 L 844.16587,318.60756 L 844.57002,323.05323 L 844.40836,326.44812 L 841.01348,327.98389 L 838.18441,330.40881 L 837.05279,331.62127 z",
25427                TN: "M 697.05288,320.62911 L 645.15979,325.6406 L 629.40023,327.41886 L 624.77903,327.93157 L 620.91068,327.90385 L 620.91068,331.78371 L 612.50433,332.26869 L 605.55292,332.91533 L 594.45689,332.96824 L 594.19215,338.80367 L 592.05398,345.07921 L 591.05891,348.09522 L 589.71017,352.47628 L 589.38685,355.06285 L 585.34533,357.32609 L 586.80027,360.88263 L 585.83031,365.24747 L 584.86193,366.03712 L 592.11797,365.84281 L 616.20542,363.90289 L 621.54027,363.74122 L 629.62326,363.25623 L 657.42891,360.66967 L 667.59966,359.86136 L 676.01988,358.8914 L 684.42624,357.75978 L 689.27606,356.95147 L 689.14548,352.44207 L 690.92375,350.98713 L 693.67198,350.34049 L 694.31863,346.62229 L 698.52181,343.87406 L 702.40166,342.4191 L 706.60484,338.86257 L 710.96967,336.76099 L 711.84326,333.23553 L 716.17702,329.35568 L 716.82367,329.19402 C 716.82367,329.19402 716.82367,330.32564 717.63197,330.32564 C 718.44027,330.32564 719.5719,330.64896 719.5719,330.64896 L 721.83515,327.09242 L 723.93674,326.44578 L 726.19998,326.7691 L 727.8166,323.21257 L 729.93216,320.9
254276641 L 730.53062,319.99957 L 730.70699,316.06745 L 729.22336,315.77929 L 726.79845,317.71923 L 718.87707,317.88089 L 706.88174,319.78157 z",
25428                RI: "M 874.07001,179.82344 L 873.58706,175.61904 L 872.77876,171.2542 L 871.08133,165.35359 L 876.82028,163.81781 L 878.43688,164.94943 L 881.83176,169.31427 L 884.74063,173.76056 L 881.82968,175.29696 L 880.5364,175.1353 L 879.40478,176.91357 L 876.97987,178.85349 z",
25429                CT: "M 873.19331,180.05038 L 872.56579,175.84599 L 871.75749,171.48115 L 870.14088,165.4997 L 865.989,166.40438 L 844.16479,171.17336 L 844.81143,174.48742 L 846.26638,181.76216 L 846.26638,189.84519 L 845.13475,192.10845 L 846.96715,194.21757 L 851.9225,190.81637 L 855.47903,187.58316 L 857.41895,185.48157 L 858.22726,186.12821 L 860.97548,184.67327 L 866.14862,183.54165 z",
25430                MA: "M 899.97704,173.85121 L 902.14896,173.16533 L 902.60622,171.45066 L 903.63502,171.56497 L 904.66382,173.85121 L 903.4064,174.30845 L 899.5198,174.42277 z M 890.6035,174.65139 L 892.88972,172.02222 L 894.49009,172.02222 L 896.31908,173.50827 L 893.91854,174.53707 L 891.74662,175.56587 z M 855.80437,152.6632 L 873.26374,148.46002 L 875.527,147.81338 L 877.62858,144.58017 L 881.36535,142.91686 L 884.25459,147.3297 L 881.82968,152.50284 L 881.50636,153.95778 L 883.44629,156.54435 L 884.57791,155.73605 L 886.35618,155.73605 L 888.61942,158.32261 L 892.49928,164.30405 L 896.05581,164.78903 L 898.31905,163.81907 L 900.09732,162.0408 L 899.28901,159.29258 L 897.18743,157.67597 L 895.73248,158.48427 L 894.76252,157.19099 L 895.2475,156.70601 L 897.34909,156.54435 L 899.12735,157.35265 L 901.06728,159.77756 L 902.03724,162.68745 L 902.36056,165.11235 L 898.15739,166.5673 L 894.27754,168.50722 L 890.39769,173.03372 L 888.45776,174.48866 L 888.45776,173.5187 L 890.88267,172.06375 L 891.36765,170.28549 L 890.55935,167.21394 L 887.64946,168.66888 L 886.84116,170.12383 L 887.32614,172.38707 L 885.25981,173.3875 L 882.51261,168.86037 L 879.11773,164.49553 L 877.04723,162.68306 L 870.51396,164.55926 L 865.42163,165.61005 L 843.59742,170.37904 L 843.19483,165.43441 L 843.84147,154.84564 L 849.01462,153.9565 z",
25431                ME: "M 923.21476,77.330719 L 925.15469,79.432305 L 927.41794,83.150496 L 927.41794,85.090422 L 925.31635,89.778575 L 923.37642,90.425217 L 919.98155,93.496766 L 915.13174,98.993222 C 915.13174,98.993222 914.4851,98.993222 913.83846,98.993222 C 913.19182,98.993222 912.86849,96.891636 912.86849,96.891636 L 911.09023,97.053296 L 910.12027,98.508241 L 907.69536,99.963185 L 906.7254,101.41813 L 908.342,102.87307 L 907.85702,103.51972 L 907.37204,106.26794 L 905.43211,106.10628 L 905.43211,104.48968 L 905.10879,103.19639 L 903.65385,103.51972 L 901.87558,100.28651 L 899.774,101.57979 L 901.06728,103.03473 L 901.3906,104.16636 L 900.5823,105.45964 L 900.90562,108.53119 L 901.06728,110.14779 L 899.45068,112.73436 L 896.54079,113.21934 L 896.21747,116.12923 L 890.88267,119.20078 L 889.58939,119.68576 L 887.97278,118.23082 L 884.90123,121.78735 L 885.8712,125.02056 L 884.41625,126.31384 L 884.25459,130.67867 L 883.13131,136.93803 L 880.66906,135.78208 L 880.18407,132.71052 L 876.30422,131.57889 L 875.9809,128.83065 L 868.70615,105.38983 L 864.50757,91.750088 L 865.92811,91.631923 L 867.4419,92.041822 L 867.4419,89.455254 L 868.2502,83.958798 L 870.83677,79.270645 L 872.29172,75.229133 L 870.35179,72.804226 L 870.35179,66.822789 L 871.16009,65.852826 L 871.9684,63.104598 L 871.80674,61.649654 L 871.64507,56.79984 L 873.42334,51.950026 L 876.33323,43.0587 L 878.43481,38.855528 L 879.7281,38.855528 L 881.02138,39.017188 L 881.02138,40.148811 L 882.31467,42.412058 L 885.06289,43.0587 L 885.8712,42.250397 L 885.8712,41.280435 L 889.91271,38.370546 L 891.69097,36.592281 L 893.14592,36.753942 L 899.12735,39.178849 L 901.06728,40.148811 L 910.12027,70.055998 L 916.1017,70.055998 L 916.91001,71.995924 L 917.07167,76.845738 L 919.98155,79.108984 L 920.78986,79.108984 L 920.95152,78.624003 L 920.46654,77.49238 z M 902.28301,107.47825 L 903.81879,105.94247 L 905.19291,106.99327 L 905.75872,109.41819 L 904.06128,110.30732 z M 908.99194,101.57763 L 910.77021,103.43673 C 910.77021,103.43673 912.0635,103.51755 912.0635,103.19423 C 912.0635,102.87091 912.30599,101.17347 912.30599,101.17347 L 913.19513,100.36517 L 912.38682,98.586893 L 910.36606,99.31437 z",
25432                NH: "M 880.79902,142.42476 L 881.66802,141.34826 L 882.75824,138.05724 L 880.21516,
25432137.14377 L 879.73017,134.07221 L 875.85032,132.94059 L 875.527,130.19235 L 868.25225,106.75153 L 863.65083,92.208542 L 862.75375,92.203482 L 862.10711,93.820087 L 861.46047,93.335106 L 860.4905,92.365143 L 859.03556,94.305068 L 858.98709,99.337122 L 859.29874,105.00434 L 861.23866,107.75258 L 861.23866,111.7941 L 857.52046,116.85688 L 854.93389,117.98852 L 854.93389,119.12014 L 856.06552,120.89841 L 856.06552,129.46643 L 855.25721,138.6811 L 855.09555,143.53092 L 856.06552,144.82422 L 855.90386,149.35071 L 855.41887,151.12899 L 856.87382,152.01499 L 873.26374,147.32527 L 875.527,146.67863 L 877.06121,144.12627 z",
25433                VT: "M 844.34355,153.72643 L 843.53525,148.0683 L 841.14454,138.09663 L 840.4979,137.77331 L 837.588,136.48002 L 838.3963,133.57013 L 837.588,131.46854 L 834.88795,126.82856 L 835.85792,122.9487 L 835.04961,117.77555 L 832.6247,111.30911 L 831.81913,106.3866 L 858.06661,99.63916 L 858.39094,105.45824 L 860.33087,108.20648 L 860.33087,112.248 L 856.61267,116.28952 L 854.0261,117.42115 L 854.0261,118.55277 L 855.15772,120.33104 L 855.15772,128.89906 L 854.34942,138.11373 L 854.18776,142.96356 L 855.15772,144.25685 L 854.99606,148.78334 L 854.51108,150.56162 L 855.1717,152.12847 L 848.22029,153.5026 z",
25434                NY: "M 828.61427,189.42238 L 827.48264,188.45242 L 824.89606,188.29076 L 822.63282,186.35084 L 821.00221,180.22171 L 817.54375,180.31225 L 815.10004,177.60405 L 795.71472,181.98599 L 752.71294,190.71568 L 745.18329,191.94367 L 744.44513,185.47533 L 745.87323,184.34995 L 747.16651,183.21833 L 748.13648,181.60172 L 749.91474,180.4701 L 751.85467,178.69183 L 752.33965,177.07523 L 754.44123,174.327 L 755.57286,173.35704 L 755.4112,172.38707 L 754.11791,169.31553 L 752.33965,169.15387 L 750.39972,163.01077 L 753.30961,161.2325 L 757.67444,159.77756 L 761.71596,158.48427 L 764.94917,157.99929 L 771.25392,157.83763 L 773.19385,159.13092 L 774.81045,159.29258 L 776.91204,157.99929 L 779.49861,156.86767 L 784.67174,156.38269 L 786.77333,154.60442 L 788.55159,151.37121 L 790.1682,149.43129 L 792.26978,149.43129 L 794.20971,148.29966 L 794.37137,146.03642 L 792.91643,143.93483 L 792.59311,142.47989 L 793.72473,140.3783 L 793.72473,138.92336 L 791.94646,138.92336 L 790.1682,138.11506 L 789.3599,136.98343 L 789.19824,134.39686 L 795.01801,128.90041 L 795.66465,128.09211 L 797.1196,125.18222 L 800.02949,120.65572 L 802.77772,116.93753 L 804.8793,114.51263 L 807.2944,112.68702 L 810.37576,111.44108 L 815.87221,110.14779 L 819.10542,110.30945 L 823.63192,108.85451 L 831.19711,106.78334 L 831.7169,111.76301 L 834.14182,118.22945 L 834.95012,123.4026 L 833.98016,127.28246 L 836.56673,131.80896 L 837.37503,133.91055 L 836.56673,136.82045 L 839.47663,138.11373 L 840.12327,138.43705 L 843.19483,149.42999 L 842.65854,154.48966 L 842.17356,165.32093 L 842.98186,170.8174 L 843.79016,174.37394 L 845.24511,181.64868 L 845.24511,189.73172 L 844.11348,191.99497 L 845.95281,193.98776 L 846.74936,195.66618 L 844.80944,197.44445 L 845.13276,198.73773 L 846.42604,198.41441 L 847.88099,197.12113 L 850.14423,194.53456 L 851.27586,193.88792 L 852.89246,194.53456 L 855.15571,194.69622 L 863.07707,190.81637 L 865.98696,188.06814 L 867.28024,186.6132 L 871.48341,188.2298 L 868.08854,191.78633 L 864.20869,194.69622 L 857.09563,200.03101 L 854.50907,201.00098 L 848.68929,202.9409 L 844.64778,204.07253 L 843.47304,203.5396 L 843.22902,199.85107 L 843.714,197.10283 L 843.55234,195.00125 L 840.73883,193.30225 L 836.21233,192.33228 L 832.33247,191.20066 z",
25435                NJ: "M 828.16036,190.33018 L 826.05878,192.75509 L 826.05878,195.82665 L 824.11884,198.8982 L 823.95718,200.51482 L 825.25048,201.8081 L 825.08882,204.23302 L 822.82556,205.36464 L 823.63386,208.11287 L 823.79552,209.2445 L 826.54376,209.56782 L 827.51372,212.15439 L 831.07026,214.57931 L 833.49517,216.19591 L 833.49517,217.00422 L 830.26196,220.07578 L 828.64535,222.33902 L 827.1904,225.08726 L 824.92715,226.38054 L 823.7147,227.10802 L 823.4722,228.32048 L 822.86297,230.92722 L 823.95524,233.17141 L 827.18845,236.0813 L 832.03826,238.34455 L 836.07977,238.99119 L 836.24143,240.44613 L 835.43313,241.41609 L 835.75645,244.16432 L 836.56475,244.16432 L 838.66634,241.73942 L 839.47464,236.8896 L 842.22287,232.84809 L 845.29442,226.38167 L 846.42604,220.88522 L 845.7794,219.75359 L 845.61774,210.37728 L 844.00113,206.98242 L 842.86951,207.79072 L 840.12128,208.11404 L 839.6363,207.62906 L 840.76793,206.65909 L 842.86951,204.71917 L 842.93257,203.62534 L 842.54818,200.1915 L 843.03316,197.44326 L 842.8715,195.34167 L 840.28493,194.21004 L 835.75843,193.24008 L 831.87857,192.10845 z",
25436                PA: "M 822.20688,226.45982 L 823.33852,225.81317 L 825.60176,225.20074 L 827.05671,222.4525 L 828.67332,220.18925 L 831.90653,217.11769 L 831.90653,216.30939 L 829.48162,214.69279 L 825.92508,212.26787 L 824.95512,209.6813 L 822.20688,209.35798 L 822.04522,208.22635 L 821.23692,205.47812 L 823.50018,204.3465 L 823.66184,201.92158 L 822.36854,200.62829 L 822.5302,199.01168 L 824.47014,195.94013 L 824.47014,192.86857 L 826.81422,190.44366 L 827.02874,189.36021 L 824.44216,189.19855 L 822.17892,187.25863 L 819.754,181.92382 L 816.74942,180.99309 L 814.41919,178.85226 L 795.8282,182.89378 L 752.82642,191.62347 L 743.93507,193.07841 L 743.4394,185.99452 L 737.95187,191.62467 L 736.65858,192.10965 L 732.45629,195.11854 L 735.36705,214.25599 L 737.84871,223.98535 L 741.42051,243.24684 L 744.68982,242.60916 L 756.6334,241.10669 L 794.56003,233.44149 L 809.43624,230.61817 L 817.73659,228.99581 L 818.0037,228.75728 L 820.1053,227.14066 z",
25437                DE: "M 822.35259,230.42318 L 822.94187,228.32048 L 822.96339,227.11557 L 821.69394,227.02719 L 819.59234,228.6438 L 818.13739,230.09874 L 819.59234,234.30193 L 821.8556,239.96005 L 823.95718,249.6597 L 825.5738,255.96448 L 830.58528,255.80282 L 836.7274,254.59089 L 834.46317,247.23587 L 833.4932,247.72085 L 829.93667,245.29595 L 828.15841,240.60779 L 826.21848,237.05126 L 823.95524,236.0813 L 821.85365,232.52477 z",
25438                MD: "M 836.95336,255.30492 L 830.81223,256.59715 L 825.00642,256.75881 L 823.16286,249.6597 L 821.06127,239.96005 L 818.79801,234.30193 L 817.50963,229.9036 L 810.00361,231.52596 L 795.1274,234.34928 L 757.67597,241.90018 L 758.80727,246.91184 L 759.77723,252.56995 L 760.10055,252.24663 L 762.20215,249.82173 L 764.46539,247.20407 L 766.8903,246.58851 L 768.34526,245.13356 L 770.12352,242.54699 L 771.4168,243.19364 L 774.32669,242.87031 L 776.91327,240.76873 L 778.92016,239.31546 L 780.76539,238.83048 L 782.40974,239.96043 L 785.31963,241.41537 L 787.25955,243.19364 L 788.47201,244.72942 L 792.59436,246.42685 L 792.59436,249.33674 L 798.09082,250.63003 L 799.23526,251.17201 L 800.64716,249.14369 L 803.52913,251.11385 L 802.25096,253.59578 L 801.48569,257.58144 L 799.70743,260.16801 L 799.70743,262.2696 L 800.35407,264.04787 L 805.41802,265.40356 L 809.72912,265.34184 L 812.80066,266.31181 L 814.90225,266.63513 L 815.87221,264.53354 L 814.41727,262.43196 L 814.41727,260.65369 L 811.99236,258.5521 L 809.89078,253.05565 L 811.18406,247.72085 L 811.0224,245.61927 L 809.72912,244.32598 C 809.72912,244.32598 811.18406,242.70938 811.18406,242.06274 C 811.18406,241.41609 811.66904,239.96115 811.66904,239.96115 L 813.60897,238.66787 L 815.54889,237.05126 L 816.03387,238.02123 L 814.57893,239.63783 L 813.28565,243.35602 L 813.60897,244.48764 L 815.38723,244.81096 L 815.87221,250.30742 L 813.77063,251.27738 L 814.09395,254.83391 L 814.57893,254.67225 L 815.71055,252.73233 L 817.32716,254.51059 L 815.71055,255.80388 L 815.38723,259.19875 L 817.9738,262.59362 L 821.85365,263.0786 L 823.47026,262.2703 L 826.70681,266.45323 L 828.06516,266.98953 L 834.71883,264.19258 L 836.72641,260.16871 z M 820.32087,264.28945 L 821.45249,266.7952 L 821.61415,268.57347 L 822.74578,270.43257 C 822.74578,270.43257 823.63492,269.54343 823.63492,269.22011 C 823.63492,268.89679 822.90745,266.14855 822.90745,266.14855 L 822.17997,263.80446 z",
25439                WV: "M 756.56051,241.96731 L 757.67252,246.91184 L 758.75596,253.81817 L 762.31563,251.06994 L 764.57887,247.99838 L 767.11725,247.38283 L 768.5722,245.92789 L 770.35047,243.34132 L 771.53028,243.98796 L 774.44017,243.66464 L 777.02675,241.56305 L 779.03364,240.10979 L 780.87887,239.6248 L 782.18279,240.64127 L 784.41183,241.75579 L 786.35176,243.53406 L 787.72588,244.82734 L 787.58288,249.4984 L 781.92475,246.42685 L 777.39825,244.64858 L 777.23659,249.98339 L 776.75161,252.08497 L 775.13501,254.83321 L 774.48835,256.44982 L 771.4168,258.87472 L 770.93182,261.13798 L 767.53694,261.4613 L 767.21362,264.53285 L 766.082,270.02932 L 763.49543,270.02932 L 762.20215,269.22101 L 760.58553,266.47277 L 758.80727,266.63443 L 758.48395,270.99928 L 7
2543956.38236,277.62737 L 751.37088,288.45864 L 752.17918,289.75192 L 752.01752,292.50015 L 749.91593,294.44008 L 748.46099,294.11676 L 745.22777,296.54167 L 742.6412,295.57171 L 740.86294,300.25986 C 740.86294,300.25986 737.14473,301.06817 736.49809,301.22983 C 735.85145,301.39149 734.07318,299.93654 734.07318,299.93654 L 731.64827,302.19979 L 729.0617,302.84644 L 726.1518,302.03813 L 724.85852,300.74485 L 722.6663,297.72149 L 719.52371,295.73337 L 716.93714,292.98513 L 714.02726,289.26694 L 713.38061,287.00369 L 710.79404,285.54874 L 709.98573,283.93214 L 709.74324,278.67816 L 711.92566,278.59733 L 713.8656,277.78903 L 714.02726,275.0408 L 715.64386,273.58585 L 715.80552,268.57437 L 716.77548,264.69451 L 718.06877,264.04787 L 719.36205,265.17949 L 719.84704,266.95776 L 721.62531,265.98779 L 722.11029,264.37119 L 720.97867,262.59292 L 720.97867,260.16801 L 721.94863,258.87472 L 724.21188,255.47985 L 725.50516,254.02491 L 727.60676,254.50989 L 729.87,252.89327 L 732.94155,249.4984 L 735.20481,245.61854 L 735.52813,239.96043 L 736.01311,234.94894 L 736.01311,230.26078 L 734.88149,227.18923 L 735.85145,225.73427 L 737.13493,224.44099 L 740.62618,244.26811 L 745.25719,243.51696 z",
25440                KY: "M 721.78301,297.81787 L 719.45844,300.5008 L 715.25525,304.05734 L 710.9557,309.95951 L 709.17743,311.73778 L 709.17743,313.83936 L 705.29757,315.94095 L 699.63945,319.33583 L 696.11989,319.72047 L 644.252,324.61933 L 628.49244,326.39759 L 623.87124,326.9103 L 620.00289,326.88258 L 619.77594,331.10286 L 611.59653,331.24742 L 604.64512,331.89406 L 594.21453,332.09966 L 596.12731,331.87803 L 598.30736,330.11601 L 600.36496,328.97291 L 600.59359,325.77218 L 601.50808,323.9432 L 599.90126,321.4043 L 600.70309,319.49749 L 602.96635,317.71923 L 605.06793,317.07258 L 607.81616,318.36587 L 611.3727,319.65915 L 612.50433,319.33583 L 612.66599,317.07258 L 611.3727,314.64767 L 611.69602,312.38442 L 613.63595,310.92948 L 616.22253,310.28283 L 617.83913,309.63619 L 617.03083,307.85792 L 616.38419,305.91799 L 617.51581,305.10969 L 618.5666,301.79563 L 621.55732,300.0982 L 627.37711,299.12824 L 630.93365,298.64326 L 632.38859,300.58319 L 634.16686,301.39149 L 635.94513,298.15828 L 638.85502,296.70333 L 640.79495,298.31994 L 641.60325,299.45156 L 643.70485,298.96658 L 643.54318,295.57171 L 646.45308,293.9551 L 647.5847,293.14679 L 648.71632,294.7634 L 653.40449,294.7634 L 654.21279,292.66181 L 653.88947,290.39857 L 656.79936,286.84202 L 661.48752,282.96217 L 661.9725,278.43567 L 664.72074,278.11235 L 668.60059,276.33408 L 671.34883,274.39415 L 671.0255,272.45422 L 669.57055,270.99928 L 670.13637,268.81687 L 674.25872,268.57437 L 676.68363,267.76607 L 679.59352,269.38267 L 681.21013,273.74751 L 687.02992,274.07083 L 688.80818,275.8491 L 690.90977,276.01076 L 693.33468,274.55582 L 696.40623,275.0408 L 697.69952,276.49574 L 700.44776,273.90917 L 702.22602,272.61588 L 703.84263,272.61588 L 704.48927,275.36412 L 706.26754,276.33408 L 708.68933,278.54915 L 708.85099,284.04561 L 709.65929,285.66222 L 712.24587,287.11716 L 712.89251,289.38042 L 715.8024,293.09861 L 718.38896,295.84685 z",
25441                OH: "M 731.43589,195.0077 L 725.34235,199.06105 L 721.4625,201.3243 L 718.06763,205.04249 L 714.02612,208.92234 L 710.79291,209.73064 L 707.88302,210.21562 L 702.38656,212.80219 L 700.28498,212.96385 L 696.89011,209.8923 L 691.71697,210.53895 L 689.13041,209.084 L 686.74934,207.73317 L 681.85677,208.43658 L 671.67215,210.05319 L 663.91243,211.26565 L 665.20572,225.89593 L 666.98399,239.6371 L 669.57055,263.0779 L 670.13637,267.90907 L 674.25872,267.78005 L 676.68363,266.97174 L 680.04743,268.47488 L 682.11792,272.83971 L 687.25686,272.82261 L 689.1486,274.94131 L 690.90977,274.87601 L 693.44816,273.53455 L 695.95233,273.90605 L 697.92646,275.361 L 699.65343,273.22832 L 701.99908,271.93504 L 704.06957,271.25419 L 704.71621,274.00243 L 706.49449,274.97239 L 709.97018,277.31646 L 712.1526,277.23564 L 713.29822,276.08691 L 713.23293,274.70038 L 714.84954,273.24542 L 715.0112,268.23395 C 715.0112,268.23395 715.98116,264.35409 715.98116,264.35409 L 717.5014,262.91312 L 719.02163,263.8178 L 719.84704,265.02868 L 721.05794,264.85305 L 720.63513,262.44212 L 720.07087,261.7986 L 720.07087,259.37368 L 721.04084,258.0804 L 723.30408,254.68553 L 724.59737,253.23058 L 726.69896,253.71556 L 728.96221,252.09895 L 732.03376,248.70408 L 734.29702,244.82422 L 734.50686,239.39306 L 734.99184,234.38157 L 734.99184,229.69341 L 733.86022,226.62186 L 734.83018,225.16691 L 735.75069,224.2123 L 734.34578,214.36947 z",
25442                MI: "M 581.61931,82.059006 L 583.4483,80.001402 L 585.62022,79.201221 L 590.99286,75.314624 L 593.27908,74.743065 L 593.73634,75.200319 L 588.59232,80.344339 L 585.27728,82.287628 L 583.21967,83.202124 z M 667.79369,114.18719 L 668.44033,116.69293 L 671.67355,116.85459 L 672.96684,115.64213 C 672.96684,115.64213 672.88601,114.18719 672.56269,114.02552 C 672.23936,113.86386 670.94608,112.16642 670.94608,112.16642 L 668.76366,112.40891 L 667.14704,112.57057 L 666.82372,113.7022 z M 697.86007,177.23689 L 694.62686,168.9922 L 692.36361,159.93922 L 689.93871,156.70601 L 687.35214,154.92774 L 685.73554,156.05937 L 681.85568,157.83763 L 679.91576,162.84911 L 677.16753,166.5673 L 676.03591,167.21394 L 674.58096,166.5673 C 674.58096,166.5673 671.9944,165.11235 672.15606,164.46571 C 672.31772,163.81907 672.64104,159.45424 672.64104,159.45424 L 676.03591,158.16095 L 676.84421,154.76608 L 677.49085,152.17952 L 679.91576,150.56291 L 679.59244,140.53996 L 677.97583,138.27672 L 676.68255,137.46841 L 675.87425,135.36683 L 676.68255,134.55853 L 678.29915,134.88185 L 678.46081,133.26524 L 676.03591,131.00199 L 674.74262,128.41543 L 672.15606,128.41543 L 667.62956,126.96048 L 662.13311,123.56561 L 659.38488,123.56561 L 658.73824,124.21226 L 657.76827,123.72727 L 654.69673,121.46403 L 651.78684,123.24229 L 648.87695,125.50554 L 649.20027,129.06207 L 650.
2544217023,129.38539 L 652.27182,129.87037 L 652.7568,130.67867 L 650.17023,131.48698 L 647.58367,131.8103 L 646.12872,133.58856 L 645.8054,135.69015 L 646.12872,137.30675 L 646.45204,142.80321 L 642.89551,144.9048 L 642.24887,144.74313 L 642.24887,140.53996 L 643.54215,138.11506 L 644.1888,135.69015 L 643.38049,134.88185 L 641.44057,135.69015 L 640.4706,139.89332 L 637.72238,141.02494 L 635.94411,142.96487 L 635.78245,143.93483 L 636.42909,144.74313 L 635.78245,147.3297 L 633.5192,147.81468 L 633.5192,148.94631 L 634.32751,151.37121 L 633.19588,157.51431 L 631.57928,161.55582 L 632.22592,166.24398 L 632.7109,167.3756 L 631.9026,169.80051 L 631.57928,170.60881 L 631.25596,173.35704 L 634.81249,179.33847 L 637.72238,185.80489 L 639.17732,190.65471 L 638.36902,195.34286 L 637.39906,201.3243 L 634.97415,206.49743 L 634.65083,209.24566 L 631.39196,212.33081 L 635.80057,212.16876 L 657.21906,209.90551 L 664.4969,208.91845 L 664.59327,210.5848 L 671.44521,209.37234 L 681.74329,207.86921 L 685.59749,207.4083 L 685.73554,206.82075 L 685.8972,205.36581 L 687.99878,201.64762 L 689.99934,199.90977 L 689.77705,194.85788 L 691.37404,193.26089 L 692.46466,192.91795 L 692.68694,189.36142 L 694.22271,186.3303 L 695.2735,186.93652 L 695.43516,187.58316 L 696.24347,187.74482 L 698.18339,186.77486 z M 567.49209,111.21318 L 568.20837,110.63278 L 570.9566,109.82447 L 574.51313,107.56123 L 574.51313,106.59126 L 575.15978,105.94462 L 581.14121,104.97466 L 583.56612,103.03473 L 587.93095,100.93315 L 588.09261,99.639864 L 590.03254,96.729975 L 591.8108,95.921673 L 593.10409,94.143408 L 595.36733,91.880161 L 599.73217,89.455254 L 604.42032,88.970273 L 605.55194,90.101896 L 605.22862,91.071859 L 601.51043,92.041822 L 600.05549,95.113371 L 597.79224,95.921673 L 597.30726,98.34658 L 594.88235,101.57979 L 594.55903,104.16636 L 595.36733,104.65134 L 596.3373,103.51972 L 599.89383,100.60983 L 601.18711,101.90311 L 603.45036,101.90311 L 606.68357,102.87307 L 608.13851,104.0047 L 609.59345,107.07625 L 612.34168,109.82447 L 616.22153,109.66281 L 617.67648,108.69285 L 619.29308,109.98613 L 620.90969,110.47112 L 622.20297,109.66281 L 623.33459,109.66281 L 624.9512,108.69285 L 628.99271,105.13632 L 632.38758,104.0047 L 639.01566,103.68138 L 643.54215,101.74145 L 646.12872,100.44817 L 647.58367,100.60983 L 647.58367,106.26794 L 648.06865,106.59126 L 650.97853,107.39957 L 652.91846,106.91458 L 659.06156,105.29798 L 660.19318,104.16636 L 661.64813,104.65134 L 661.64813,111.60274 L 664.88134,114.67429 L 666.17462,115.32093 L 667.4679,116.29089 L 666.17462,116.61421 L 665.36632,116.29089 L 661.64813,115.80591 L 659.54654,116.45255 L 657.28329,116.29089 L 654.05008,117.74584 L 652.27182,117.74584 L 646.45204,116.45255 L 641.27891,116.61421 L 639.33898,119.20078 L 632.38758,119.84742 L 629.96267,120.65572 L 628.83105,123.72727 L 627.53777,124.8589 L 627.05279,124.69724 L 625.59784,123.08063 L 621.07135,125.50554 L 620.42471,125.50554 L 619.29308,123.88893 L 618.48478,124.05059 L 616.54486,128.41543 L 615.57489,132.45694 L 612.39377,139.45774 L 611.21701,138.42347 L 609.84527,137.39215 L 607.90449,127.10413 L 604.36001,125.73408 L 602.30743,123.44785 L 590.18707,120.70437 L 587.3318,119.67473 L 579.10138,117.50199 L 571.21139,116.35887 z",
25443                WY: "M 354.25168,143.77587 L 343.70253,142.96884 L 311.61454,139.67342 L 295.38233,137.61582 L 267.03312,133.50061 L 247.14296,130.52852 L 245.72387,141.70448 L 241.88464,165.96502 L 236.62631,196.37183 L 235.09531,206.88801 L 233.4256,218.77684 L 239.94947,219.70521 L 265.82883,222.20513 L 286.39795,224.51213 L 323.18167,228.62731 L 347.00271,231.48733 L 351.50702,187.295 L 352.94689,161.91789 z",
25444                MT: "M 356.67064,122.27385 L 357.31846,111.12326 L 359.57695,86.336144 C 360.0342,81.306439 360.66066,77.864038 360.94869,70.926078 L 361.88845,56.374463 L 331.21413,53.56663 L 301.95358,50.0101 L 272.69304,45.968588 L 240.36094,40.633793 L 221.93165,37.238923 L 189.208,30.306187 L 184.72898,51.653719 L 188.15832,59.19826 L 186.78658,63.770712 L 188.61556,68.343163 L 191.81629,69.714902 L 196.43711,80.484355 L 199.13221,83.660878 L 199.58945,84.803996 L 203.01879,85.947114 L 203.47604,88.004707 L 196.38874,105.60866 L 196.38874,108.12351 L 198.90359,111.32422 L 199.81807,111.32422 L 204.61914,108.35213 L 205.30502,107.20901 L 206.90538,107.89488 L 206.67675,113.1532 L 209.42023,125.72745 L 212.39232,128.24229 L 213.3068,128.92816 L 215.13579,131.21438 L 214.67854,134.64373 L 215.36441,138.07306 L 216.50753,138.98756 L 218.79375,136.70133 L 221.53722,136.70133 L 224.73794,138.30169 L 227.25279,137.3872 L 231.368,137.3872 L 235.02595,138.98756 L 237.76943,138.53031 L 238.22667,135.55821 L 241.19876,
25444134.87235 L 242.5705,136.24409 L 243.02775,139.4448 L 244.80717,140.80977 L 246.34057,129.2447 L 267.03312,132.21679 L 295.22184,136.17153 L 311.77502,138.06865 L 343.2211,141.52455 L 354.21124,143.04862 L 355.26321,127.62136 z",
25445                ID: "M 162.11948,180.95969 C 139.5086,176.61641 147.97221,178.11269 140.97881,176.60895 L 145.40585,159.10648 L 149.74968,141.38823 L 151.12142,137.15871 L 153.63626,131.21453 L 152.37884,128.9283 L 149.86398,129.04261 L 149.06381,128.01381 L 149.52106,126.8707 L 149.86398,123.78429 L 154.32213,118.29734 L 156.15111,117.8401 L 157.29422,116.69699 L 157.86578,113.49627 L 158.78026,112.81041 L 162.66685,106.98053 L 166.55344,102.6367 L 166.78206,98.864432 L 163.35272,96.235269 L 162.03814,91.834286 L 162.43823,82.174988 L 166.09619,65.714155 L 170.55433,44.909503 L 174.3266,31.420781 L 175.08853,27.617595 L 188.08467,30.145706 L 183.92659,51.653719 L 186.8745,59.358741 L 185.82372,63.931193 L 187.81318,68.503644 L 191.0139,70.196335 L 195.47424,80.002923 L 198.16934,83.821359 L 198.78707,84.964477 L 202.21641,86.107595 L 202.67365,88.646611 L 195.74683,105.44818 L 196.06779,108.76541 L 198.7431,111.64517 L 200.62046,112.1266 L 205.42153,108.51261 L 205.78645,108.01139 L 205.94251,108.85775 L 206.19532,112.99272 L 208.77832,125.88793 L 212.23184,128.56324 L 212.6649,129.40959 L 214.81483,131.85629 L 214.03664,134.64373 L 214.7225,138.39401 L 216.66801,139.30851 L 218.79375,137.6642 L 221.37674,137.18276 L 224.73794,138.78312 L 227.25279,138.18958 L 231.04705,138.0291 L 235.02595,139.62946 L 237.76943,139.3327 L 238.70811,137.0025 L 241.19876,135.35378 L 241.9286,137.04647 L 242.54631,139.28432 L 244.85453,141.82336 L 241.08226,165.80454 L 235.9382,194.8133 L 231.779,194.4946 L 223.59476,192.96239 L 213.78818,191.13341 L 201.62502,188.75485 L 189.09694,186.25099 L 180.61372,184.41102 L 171.35451,182.74252 z",
25446                WA: "M 93.573239,6.3617734 L 97.938071,7.8167177 L 107.6377,10.564946 L 116.2057,12.504871 L 136.2516,18.162988 L 159.20739,23.821104 L 174.36801,27.215777 L 173.36373,31.099829 L 169.27051,44.909503 L 164.81238,65.714155 L 161.63584,81.854036 L 161.28429,91.232806 L 148.10315,87.33877 L 132.53264,83.955591 L 118.86585,84.551329 L 117.28528,83.01913 L 111.95881,84.916253 L 107.9821,84.665645 L 105.2606,82.904814 L 103.68223,83.430208 L 99.476903,83.201576 L 97.601755,81.829846 L 92.824862,80.093194 L 91.382778,79.886558 L 86.397035,78.560984 L 84.614222,80.069004 L 78.922841,79.726077 L 74.101997,75.931831 L 74.30643,75.131651 L 74.374575,67.197996 L 72.248826,63.31142 L 68.133618,62.57938 L 67.768708,60.225014 L 65.2543,59.597968 L 62.372763,59.063086 L 60.594498,60.033049 L 58.331251,57.123161 L 58.654572,54.213272 L 61.4028,53.889951 L 63.019405,49.84844 L 60.432837,48.716816 L 60.594498,44.998625 L 64.959331,44.351984 L 62.211103,41.603756 L 60.756158,34.490695 L 61.4028,31.580807 L 61.4028,23.659444 L 59.624535,20.426234 L 61.887782,11.049927 L 63.989368,11.534908 L 66.414275,14.444797 L 69.162503,17.031364 L 72.395712,18.97129 L 76.922205,21.072876 L 79.993756,21.719518 L 82.903645,23.174462 L 86.298518,24.144425 L 88.561764,23.982765 L 88.561764,21.557857 L 89.855048,20.426234 L 91.956634,19.13295 L 92.279955,20.264574 L 92.603276,22.042839 L 90.340029,22.52782 L 90.016708,24.629406 L 91.794974,26.084351 L 92.926597,28.509258 L 93.573239,30.449183 L 95.028183,30.287523 L 95.189843,28.994239 L 94.219881,27.700955 L 93.734899,24.467746 L 94.543201,22.689481 L 93.89656,21.234537 L 93.89656,18.97129 L 95.674825,15.41476 L 94.543201,12.828192 L 92.118294,7.9783781 L 92.441615,7.1700758 z M 84.116548,12.340738 L 86.137312,12.179078 L 86.622294,13.553197 L 88.158073,11.936582 L 90.502155,11.936582 L 91.310458,13.472361 L 89.774678,15.169801 L 90.42133,15.978114 L 89.693853,17.998875 L 88.319734,18.403021 C 88.319734,18.403021 87.430596,18.483857 87.430596,18.160536 C 87.430596,17.837215 88.885551,15.573958 88.885551,15.573958 L 87.188111,
2544615.008141 L 86.86479,16.463095 L 86.137312,17.109737 L 84.60153,14.84648 z",
25447                TX: "M 357.05332,333.3739 L 379.74411,334.45984 L 410.8368,335.60296 L 408.50219,359.05876 L 408.20543,377.21228 L 408.27357,379.29407 L 412.6174,383.1125 L 414.35405,383.93466 L 416.16326,384.18747 L 416.84913,382.93225 L 417.73945,383.79837 L 419.47609,384.2798 L 421.08086,383.54998 L 422.21956,383.95885 L 421.92279,387.364 L 426.19848,388.39501 L 428.8738,389.21718 L 432.82854,389.74256 L 435.02242,391.57154 L 438.27152,389.99537 L 441.05896,390.36028 L 443.09237,393.14772 L 444.16733,393.46868 L 444.00686,395.43395 L 447.09547,396.60124 L 449.86312,394.79644 L 451.37114,395.16136 L 453.72552,395.32184 L 454.15859,397.19478 L 458.79918,399.18423 L 461.45473,398.9798 L 463.4442,394.86459 L 463.78492,394.86459 L 464.92804,396.76172 L 469.3642,397.76853 L 472.7012,398.9798 L 475.99425,399.73382 L 478.14419,398.9798 L 478.99053,396.46496 L 482.69245,396.46496 L 484.58958,397.21896 L 487.654,395.64279 L 488.31569,395.64279 L 488.6806,396.76172 L 492.95629,396.76172 L 495.35904,395.5065 L 497.02754,395.80326 L 498.44324,397.67621 L 501.32299,399.34471 L 504.84467,400.41968 L 507.58814,401.83759 L 510.03484,403.45991 L 513.32788,402.56962 L 515.26897,403.55225 L 515.78008,413.69188 L 516.11532,423.39405 L 516.80118,432.92806 L 517.32658,436.97511 L 520.00191,441.57175 L 521.07687,445.63859 L 524.93927,451.92792 L 525.48884,454.80769 L 526.01424,455.8145 L 525.32836,463.31069 L 522.67723,467.69847 L 523.63568,470.55845 L 523.27076,473.0733 L 522.42442,480.38923 L 521.05268,483.10852 L 521.65692,487.49475 L 515.99204,489.07993 L 506.13075,493.60643 L 505.16079,495.54635 L 502.57422,497.48628 L 500.47264,498.94122 L 499.17935,499.74952 L 493.52124,505.08432 L 490.77301,507.18591 L 485.43821,510.41911 L 479.7801,512.84402 L 473.47534,516.23889 L 471.69708,517.69384 L 465.8773,521.25037 L 462.48243,521.89701 L 458.60258,527.39346 L 454.56107,527.71679 L 453.5911,529.65671 L 455.85435,531.59664 L 454.3994,537.09309 L 453.10612,541.61959 L 451.9745,545.49944 L 451.1662,550.02593 L 451.9745,552.45084 L 453.75276,559.40224 L 454.72273,565.54533 L 456.50099,568.29356 L 455.53103,569.74851 L 452.45948,571.68843 L 446.80136,567.80858 L 441.30491,566.67696 L 440.01162,567.16194 L 436.77841,566.5153 L 432.57524,563.44375 L 427.40211,562.31213 L 419.80406,558.91726 L 417.70248,555.0374 L 416.40919,548.57099 L 413.17599,546.63106 L 412.52934,544.36781 L 413.17599,543.72117 L 413.49931,540.3263 L 412.20602,539.67966 L 411.55938,538.7097 L 412.85266,534.34486 L 411.23606,532.08162 L 408.00285,530.78833 L 404.60798,526.4235 L 401.05145,519.79542 L 396.84828,517.20885 L 397.00994,515.26893 L 391.67514,502.98273 L 390.86684,498.77956 L 389.08858,496.83964 L 388.92692,495.38469 L 382.94548,490.0499 L 380.35891,486.97835 L 380.35891,485.84672 L 377.77234,483.74514 L 370.9826,482.61351 L 363.54622,481.96687 L 360.47467,479.70363 L 355.94818,481.48189 L 352.39165,482.93684 L 350.1284,486.17004 L 349.15844,489.88824 L 344.79361,496.03133 L 342.3687,498.45624 L 339.78213,497.48628 L 338.00387,496.35465 L 336.06394,495.70801 L 332.18409,493.44477 L 332.18409,492.79812 L 330.40583,490.8582 L 325.23269,488.75661 L 317.79631,480.99691 L 315.53306,476.30876 L 315.53306,468.22573 L 312.29985,461.75931 L 311.81487,459.01109 L 310.19827,458.04112 L 309.06664,455.93954 L 304.05517,453.83795 L 302.76189,452.22135 L 295.64882,444.29998 L 294.35554,441.06677 L 289.66738,438.80352 L 288.21243,434.43865 L 285.62584,431.52878 L 283.68593,431.04382 L 283.0367,426.36618 L 291.03857,427.05207 L 320.07356,429.79552 L 349.10864,431.39588 L 351.39487,407.61912 L 355.28142,352.0641 L 356.88181,333.31678 L 358.25355,333.34536 M 457.2302,567.32304 L 456.66439,560.20996 L 453.91615,553.01604 L 453.35033,545.98379 L 454.88611,537.73908 L 458.20017,530.86849 L 461.67587,525.45284 L 464.82827,521.89629 L 465.47491,522.13879 L 460.70591,528.76689 L 456.34107,535.31417 L 454.3203,541.94226 L 453.99698,547.11542 L 454.88611,553.25854 L 457.47269,560.45246 L 457.95767,565.6256 L 458.11933,567.08056 L 457.2302,567.32304 z",
25448                CA: "M 136.74132,386.75359 L 140.5564,386.26497 L 142.04244,384.25353 L 142.77448,382.31244 L 139.59796,382.22232 L 138.49879,380.45929 L 139.27701,378.74462 L 139.23083,372.59378 L 141.44892,371.266 L 144.14622,368.68302 L 144.5573,363.76763 L 146.20382,360.27014 L 148.14711,358.16638 L 151.41598,356.45171 L 152.69537,355.72188 L 153.4516,354.23804 L 152.58327,353.34553 L 151.62262,351.8353 L 150.68615,346.48685 L 147.7822,341.25051 L 147.87926,338.46426 L 145.67843,335.2162 L 130.67947,311.98682 L 111.24655,283.27272 L 88.819562,250.23896 L 76.117107,230.69405 L 77.913818,223.48571 L 84.726337,197.53705 L 92.84244,166.10144 L 80.477041,162.76442 L 66.988306,159.33508 L 54.414067,155.21987 L 46.869522,153.16227 L 35.438394,150.19018 L 28.387579,147.77848 L 26.80746,152.50284 L 26.645799,159.93922 L 21.472664,171.74043 L 18.401116,174.327 L 18.077795,175.45862 L 16.299529,176.26693 L 14.844585,180.4701 L 14.036283,183.70331 L 16.784511,187.90648 L 18.401116,192.10965 L 19.532739,195.66618 L 19.209418,202.1326 L 17.431153,205.20415 L 16.784511,211.02393 L 15.814548,214.74212 L 17.592813,218.62197 L 20.341041,223.14846 L 22.604288,227.99828 L 23.897571,232.03979 L 23.574251,235.273 L 23.25093,235.75798 L 23.25093,237.85956 L 28.909046,244.16432 L 28.424065,246.58923 L 27.777423,248.85248 L 27.130781,250.7924 L 27.292441,259.03709 L 29.394027,262.75528 L 31.333953,265.34184 L 34.082181,265.82683 L 35.052144,268.57505 L 33.920521,272.13158 L 31.818934,273.74819 L 30.687311,273.74819 L 29.879009,277.62804 L 30.36399,280.53793 L 33.5972,284.90276 L 35.213804,290.23756 L 36.668748,294.92571 L 37.962032,297.99726 L 41.356902,303.81704 L 42.811846,306.4036 L 43.296828,309.31349 L 44.913432,310.28345 L 44.913432,312.70836 L 44.10513,314.64829 L 42.326865,321.76135 L 41.841883,323.70127 L 44.266791,326.4495 L 48.469963,326.93448 L 52.996456,328.71275 L 56.876307,330.81433 L 59.786196,330.81433 L 62.696084,333.88588 L 65.282651,338.7357 L 66.414275,340.99894 L 70.294126,343.10053 L 75.14394,343.90883 L 76.598884,346.01042 L 77.245526,349.24363 L 75.790582,349.89027 L 76.113903,350.86023 L 79.347114,351.66853 L 82.095342,351.8302 L 85.005231,356.51835 L 88.885085,360.72152 L 89.693387,362.98477 L 92.279955,367.18794 L 92.603276,370.42115 L 92.603276,379.79746 L 93.088257,381.57572 L 103.11121,383.03067 L 122.83378,385.77889 z M 48.793607,337.03691 L 50.086895,338.57269 L 49.925235,339.86598 L 46.692014,339.78515 L 46.1262,338.57269 L 45.479556,337.11774 z M 50.733539,337.03691 L 51.945997,336.39027 L 55.50254,338.49186 L 58.5741,339.70431 L 57.684964,340.35097 L 53.158455,340.10847 L 51.541845,338.49186 z M 71.426153,356.84039 L 73.204418,359.18447 L 74.012731,360.15444 L 75.54851,360.72025 L 76.114317,359.2653 L 75.144354,357.48703 L 72.476951,355.46627 L 71.426153,355.62793 z M 69.971198,365.48925 L 71.749474,368.64164 L 72.961932,370.58158 L 71.506978,370.82406 L 70.213694,369.61161 C 70.213694,369.61161 69.486217,368.15666 69.486217,367.7525 C 69.486217,367.34836 69.486217,365.57008 69.486217,365.57008 z",
25449                AZ: "M 137.74699,387.50041 L 135.11998,389.65874 L 134.79666,391.11369 L 135.28164,392.08365 L 154.19591,402.75324 L 166.32045,410.35128 L 181.03155,418.91929 L 197.84424,428.94224 L 210.13044,431.36715 L 235.25838,434.07206 L 237.7892,421.56511 L 241.54187,394.32217 L 248.50673,341.44101 L 252.76399,310.47532 L 228.16728,306.79655 L 200.96119,302.2241 L 167.53204,295.90642 L 164.61014,313.99826 L 164.1529,314.45551 L 162.43823,317.08467 L 159.92338,316.97035 L 158.66596,314.22688 L 155.92249,313.88395 L 155.00799,312.74084 L 154.09351,312.74084 L 153.17901,313.3124 L 151.23572,314.3412 L 151.12142,321.31418 L 150.89278,323.02885 L 150.32124,335.60309 L 148.83519,337.775 L 148.26363,341.09003 L 151.0071,346.00542 L 152.26452,351.8353 L 153.06471,352.8641 L 154.09351,353.43566 L 153.97919,355.72188 L 152.37884,357.09361 L 148.9495,358.80828 L 147.00621,360.75158 L 145.52016,364.40953 L 144.9486,369.32492 L 142.09082,372.06839 L 140.03322,372.75426 L 139.91891,378.58414 L 139.46166,380.29881 L 139.91891,381.09899 L 143.57687,381.67053 L 143.00531,384.41401 L 141.51926,386.58592 z",
25450                NV: "M 140.65786,177.57182 L 161.63805,182.08304 L 171.35451,184.02634 L 180.61372,185.85531 L 187.22838,187.48864 L 186.67001,193.35369 L 183.12636,210.68284 L 179.03314,230.66313 L 177.08985,240.3818 L 174.91793,253.66389 L 171.76337,270.07854 L 168.24171,285.76337 L 166.27332,295.94373 L 163.80775,312.71445 L 163.35051,313.8136 L 162.27775,316.28228 L 160.40481,316.16797 L 159.30786,313.4245 L 156.56439,312.92108 L 155.16847,311.93845 L 153.13064,312.25941 L 152.21615,312.99145 L 150.91477,314.3412 L 150.47951,321.31418 L 149.92992,323.02885 L 149.51885,335.12166 L 148.19675,336.83582 L 146.32033,334.57429 L 131.80281,311.82634 L 112.36989,282.79128 L 89.621946,248.95514 L 77.240446,230.3731 L 78.87668,223.80666 L 85.849676,197.858 L 93.737155,166.51015 L 127.34467,174.65279 L 141.06203,177.62488",
25451                UT: "M 252.97063,309.30699 L 228.32776,305.83369 L 201.76357,300.94029 L 167.93683,294.92034 L 169.52553,285.76337 L 172.72624,270.55998 L 176.04127,253.98484 L 178.21319,240.3818 L 180.15648,231.46552 L 183.92875,211.00379 L 187.4724,193.51417 L 188.58694,187.94149 L 201.30406,190.19914 L 213.30675,192.25674 L 223.59476,194.08573 L 231.93948,195.45747 L 235.61725,195.93663 L 234.13245,206.56705 L 231.82083,219.73971 L 239.62852,220.66808 L 256.03504,222.47287 L 264.24601,223.32851 L 262.11553,245.29707 L 258.91482,267.86257 L 255.16215,295.68875 L 253.49601,306.79655 z",
25452                CO: "M 378.62078,256.79629 L 380.06066,235.51461 L 347.96558,232.45018 L 323.50262,229.75064 L 286.23746,225.63547 L 265.5471,223.12065 L 262.91791,245.29707 L 259.7172,267.70209 L 255.96454,295.68875 L 254.45888,306.79655 L 254.20828,309.55981 L 288.13455,313.35406 L 325.87526,317.62063 L 357.83587,320.7865 L 374.44407,321.63284",
25453                NM: "M 282.72425,431.045 L 282.07384,424.9219 L 290.71762,425.4473 L 320.23405,428.5117 L 348.62721,429.95159 L 350.59248,407.61912 L 354.31856,351.74315 L 355.43752,332.35392 L 357.45116,332.70345 L 357.43687,321.62845 L 325.23335,319.22539 L 288.29503,314.79835 L 253.83017,310.68314 L 249.63006,341.44101 L 242.6652,394.64312 L 238.91254,421.56511 L 236.86315,434.87445 L 252.32382,436.8636 L 253.6171,426.84065 L 270.26813,429.42722 z",
25454                OR: "M 140.30581,176.68623 L 144.60346,158.78553 L 149.26824,140.9068 L 150.31903,136.67728 L 152.6734,131.05405 L 152.05789,129.89117 L 149.54303,129.84499 L 148.26143,128.17429 L 148.71867,126.71022 L 149.22208,123.46334 L 153.68023,117.97639 L 155.50921,116.87724 L 156.65232,115.73413 L 158.13836,112.1685 L 162.18542,106.4991 L 165.75105,102.6367 L 165.97967,99.185383 L 162.71081,96.716701 L 161.50192,92.206659 L 148.26363,88.462106 L 133.17454,84.918456 L 117.74252,85.032762 L 117.28528,83.661033 L 111.79833,85.718637 L 107.34019,85.147078 L 104.93965,83.546717 L 103.68223,84.232592 L 98.99547,84.00396 L 97.280804,82.632231 L 92.022478,80.574627 L 91.222297,80.688943 L 86.878467,79.202887 L 84.935176,81.03187 L 78.762364,80.688943 L 72.818181,76.573734 L 73.504046,75.773554 L 73.732667,68.000381 L 71.446442,64.113804 L 67.331234,63.542245 L 66.645369,61.027398 L 64.291437,60.560833 L 58.492912,62.619617 L 56.229665,69.086035 L 52.996456,79.108984 L 49.763246,85.575403 L 44.751772,99.639864 L 38.285353,113.21934 L 30.20233,125.82886 L 28.262404,128.73875 L 27.454102,137.30675 L 26.160818,143.28819 L 28.86901,146.81562 L 35.598871,149.06684 L 47.190476,152.35988 L 55.055974,154.89892 L 67.469737,158.5327 L 80.797995,162.12252 L 93.965776,165.68813",
25455                ND: "M 471.30528,127.66846 L 470.94037,120.17229 L 468.95092,112.85637 L 467.12193,99.207152 L 466.66469,89.376374 L 464.67523,86.267982 L 463.07487,80.917336 L 463.07487,70.629316 L 463.76073,66.742729 L 461.64538,61.243718 L 433.22188,60.679691 L 414.63093,60.033049 L 388.11861,58.739765 L 363.17227,56.855896 L 361.91155,71.086559 L 360.53981,86.175663 L 358.28133,111.12326 L 357.79515,122.14348 L 414.61127,125.90763 z",
25456                SD: "M 472.79706,203.1809 L 471.84336,202.10003 L 470.32265,198.47334 L 472.15163,194.77142 L 473.20241,189.21633 L 470.61942,187.15872 L 470.32265,184.41526 L 470.91618,181.41897 L 473.06612,180.61658 L 473.36289,174.88124 L 473.29475,144.79538 L 472.67702,141.82329 L 468.56181,138.23348 L 467.57918,136.24402 L 467.57918,134.3227 L 469.4763,133.0433 L 471.00852,131.19013 L 471.19098,128.47084 L 413.80889,126.87049 L 357.63468,122.9839 L 356.86798,128.26326 L 355.25497,144.1315 L 353.90976,162.07837 L 352.30941,186.67509 L 368.33718,187.70389 L 387.97453,188.847 L 405.96758,190.15059 L 429.74434,191.45417 L 440.4896,190.67598 L 443.34959,192.96221 L 447.66923,195.93431 L 448.65187,196.68831 L 452.19331,195.798 L 456.24038,195.50124 L 458.98385,195.43309 L 462.09665,196.64436 L 466.64491,198.08424 L 469.77747,199.84507 L 470.3952,201.76638 L 471.30969,203.66351 L 472.01534,203.18207 z",
25457                NE: "M 484.24444,246.9897 L 485.61618,249.66503 L 485.70851,251.79078 L 488.06288,255.51689 L 490.78217,258.66923 L 485.73269,258.66923 L 442.25013,257.73055 L 401.46327,256.84025 L 380.27171,255.8796 L 381.34448,234.55175 L 347.96558,231.80828 L 352.30941,187.79842 L 367.85574,188.82723 L 387.97453,189.97033 L 405.8071,191.11345 L 429.58386,192.25656 L 440.32912,191.79932 L 442.38672,194.08554 L 447.1878,197.05764 L 448.33091,197.97213 L 452.67474,196.60039 L 456.56133,196.14315 L 459.3048,195.91452 L 461.13378,197.28626 L 466.16348,198.88662 L 469.13557,200.48698 L 469.59282,202.08734 L 470.50731,204.14494 L 472.33629,204.14494 L 473.13427,204.19111 L 474.11689,209.40326 L 476.86037,217.42924 L 478.09582,222.06983 L 480.22156,225.88828 L 480.74695,230.82564 L 482.18684,235.10132 L 482.73641,241.57092",
25458                IA: "M 566.59351,201.62843 L 566.76414,203.57088 L 569.05036,204.71064 L 570.1918,205.96722 L 570.53556,207.22883 L 574.42215,210.43123 L 575.10802,212.60398 L 574.30868,215.46595 L 572.82012,219.01043 L 572.02078,221.75222 L 569.84803,223.35426 L 568.13252,223.92666 L 562.64725,225.41186 L 561.96138,227.6947
254585 L 561.16204,229.9793 L 561.73443,231.35104 L 563.44994,233.06488 L 563.44826,236.72617 L 561.27886,238.32653 L 560.81995,239.81342 L 560.81995,242.32994 L 559.33139,242.78718 L 557.61755,244.15725 L 557.16198,245.64246 L 557.61755,247.35964 L 556.24331,248.56409 L 553.94955,245.87276 L 552.46601,243.24611 L 544.12548,244.04544 L 533.95428,244.61617 L 508.91758,245.30372 L 495.88274,245.53234 L 486.50922,245.76096 L 485.19344,245.88221 L 483.53879,241.41044 L 483.31017,234.78037 L 481.70981,230.66516 L 481.02395,225.40685 L 478.73772,221.74888 L 477.82324,216.94781 L 475.07976,209.40326 L 473.93665,204.03062 L 472.56491,201.85871 L 470.96455,199.11525 L 472.79353,194.77142 L 474.16527,189.05585 L 471.4218,186.99824 L 470.96455,184.25477 L 471.87905,181.73992 L 473.59372,181.73992 L 485.13916,181.73992 L 534.75027,181.05405 L 554.62705,180.36819 L 556.47778,183.115 L 558.31012,185.73663 L 558.76569,186.541 L 556.93503,189.28949 L 557.3906,193.51148 L 559.90546,197.39807 L 562.8742,199.22202 L 565.27892,199.45232 z",
25459                MS: "M 624.55882,466.96958 L 624.30456,468.22573 L 619.13142,468.22573 L 617.67648,467.41743 L 615.57489,467.09411 L 608.78515,469.03403 L 607.00689,468.22573 L 604.42032,472.4289 L 603.31778,473.20692 L 602.19395,470.71894 L 601.05083,466.83235 L 597.6215,463.63164 L 598.7646,456.08709 L 598.07874,455.1726 L 596.24976,455.40122 L 588.01934,456.08709 L 563.78534,456.77296 L 563.3281,455.1726 L 564.01397,447.1708 L 567.44331,440.99799 L 572.70163,431.85309 L 571.78714,429.79549 L 572.93025,429.79549 L 573.61612,426.59477 L 571.32989,424.76579 L 571.55852,422.93681 L 569.50091,418.36436 L 569.21513,413.0203 L 570.58686,410.36256 L 570.18678,406.01873 L 568.81504,403.04663 L 570.18678,401.6749 L 568.81504,399.6173 L 569.27229,397.78832 L 570.18678,391.6155 L 573.15887,388.87204 L 572.473,386.81443 L 576.13097,381.5561 L 578.87444,380.64162 L 578.87444,378.12677 L 578.18857,376.75503 L 580.93204,371.49672 L 583.67551,370.3536 L 583.78295,366.94152 L 592.4584,366.86408 L 616.54585,364.92416 L 621.12643,364.69553 L 621.13451,371.06725 L 621.29617,387.71831 L 620.48787,418.75716 L 620.32621,432.82165 L 623.07445,451.57429 z",
25460                IN: "M 618.42049,300.8552 L 618.48577,297.99662 L 618.97076,293.47011 L 621.234,290.56023 L 623.01228,286.68036 L 625.59884,282.47719 L 625.11386,276.6574 L 623.3356,273.90917 L 623.01228,270.67596 L 623.82058,265.17949 L 623.3356,258.22808 L 622.0423,242.22367 L 620.74902,226.86591 L 619.77855,215.14589 L 622.84961,216.0354 L 624.30456,217.00536 L 625.43618,216.68204 L 627.53777,214.74212 L 630.36734,213.12513 L 635.46014,212.96309 L 657.44601,210.69983 L 663.02174,210.16667 L 664.52488,226.12288 L 668.77623,262.96443 L 669.37469,268.73603 L 669.00319,270.99928 L 670.23117,272.79465 L 670.32756,274.1672 L 667.80627,275.76671 L 664.26684,277.31802 L 661.06471,277.8683 L 660.46625,282.73523 L 655.89156,286.0477 L 653.09514,290.05814 L 653.41846,292.43487 L 652.83712,293.96907 L 649.51065,293.96907 L 647.92512,292.35247 L 645.43181,293.61467 L 642.74885,295.11781 L 642.91052,298.17226 L 641.71673,298.43029 L 641.24885,297.41215 L 639.08197,295.90901 L 635.83165,297.25049 L 634.28034,300.25674 L 632.8425,299.44844 L 631.38755,297.84893 L 626.92321,298.33392 L 621.33038,299.30388 z",
25461                IL: "M 617.80493,301.60133 L 617.80493,297.99662 L 618.06296,293.12969 L 620.43968,289.99286 L 622.21795,28
254616.22646 L 624.80452,282.36371 L 624.43302,277.11131 L 622.42781,273.56874 L 622.33143,270.22206 L 623.02626,264.95255 L 622.20085,257.77418 L 621.13451,241.99673 L 619.84123,226.97939 L 618.91895,215.34019 L 618.64644,214.4188 L 617.83814,211.83223 L 616.54486,208.11404 L 614.92825,206.33577 L 613.47331,203.74921 L 613.23974,198.26025 L 603.33707,199.57249 L 576.13098,201.28716 L 567.44331,200.8585 L 567.67193,203.23045 L 569.95816,203.91632 L 570.87264,205.05943 L 571.32989,206.88841 L 575.21647,210.31775 L 575.90235,212.60398 L 575.21647,216.03332 L 573.38749,219.69128 L 572.70163,222.20612 L 570.4154,224.03511 L 568.58642,224.72098 L 563.3281,226.09271 L 562.64223,227.92169 L 561.95636,229.9793 L 562.64223,231.35104 L 564.47121,232.9514 L 564.24259,237.0666 L 562.4136,238.66696 L 561.72774,240.26732 L 561.72774,243.01079 L 559.89876,243.46803 L 558.2984,244.61115 L 558.06978,245.98289 L 558.2984,248.04049 L 556.58373,249.35506 L 555.55493,252.1557 L 556.01217,255.81365 L 558.2984,263.12958 L 565.61433,270.67413 L 571.10126,274.33209 L 570.87264,278.67592 L 571.78714,280.04766 L 578.18857,280.5049 L 580.93204,281.87664 L 580.24618,285.5346 L 577.95995,291.47879 L 577.27408,294.67951 L 579.5603,298.56609 L 585.96174,303.82441 L 590.5342,304.51028 L 592.59179,309.53998 L 594.6494,312.74069 L 593.73491,315.71278 L 595.33527,319.82799 L 597.16425,321.8856 L 599.10861,321.0933 L 599.7953,318.93012 L 601.8316,317.49228 L 605.06793,316.39174 L 608.15659,317.57154 L 611.03228,318.63788 L 611.82348,318.42804 L 611.75819,317.18606 L 610.69186,314.42072 L 611.12866,312.044 L 613.409,310.47557 L 615.76863,309.48851 L 616.93134,309.06882 L 616.34998,307.74444 L 615.58986,305.57757 L 616.83496,304.31536 z",
25462                MN: "M 471.87905,128.47084 L 471.4218,120.0118 L 469.59282,112.69588 L 467.76384,99.207152 L 467.30659,89.376374 L 465.47761,85.947031 L 463.87725,80.917336 L 463.87725,70.629316 L 464.56311,66.742729 L 462.74218,61.291062 L 492.8746,61.326333 L 493.19792,53.081649 L 493.84456,52.919988 L 496.10781,53.40497 L 498.04773,54.213272 L 498.85603,59.709728 L 500.31098,65.852826 L 501.92758,67.469431 L 506.7774,67.469431 L 507.10072,68.924375 L 513.40548,69.247696 L 513.40548,71.349282 L 518.25529,71.349282 L 518.57861,70.055998 L 519.71023,68.924375 L 521.97348,68.277733 L 523.26676,69.247696 L 526.17665,69.247696 L 530.0565,71.834263 L 535.3913,74.25917 L 537.81621,74.744152 L 538.30119,73.774189 L 539.75613,73.289207 L 540.24111,76.199096 L 542.82768,77.49238 L 543.31266,77.007398 L 544.60595,77.169059 L 544.60595,79.270645 L 547.19251,80.240608 L 550.26406,80.240608 L 551.88067,79.432305 L 555.11388,76.199096 L 557.70044,75.714115 L 558.50875,77.49238 L 558.99373,78.785663 L 559.96369,78.785663 L 560.93365,77.977361 L 569.82498,77.65404 L 571.60324,80.725589 L 572.24989,80.725589 L 572.9635,79.64131 L 577.40341,79.270645 L 576.79131,81.550104 L 572.85259,83.387229 L 563.60681,87.448357 L 558.83207,89.455254 L 555.76052,92.041822 L 553.33561,95.598352 L 551.07237,99.478203 L 549.2941,100.28651 L 544.76761,105.29798 L 543.47432,105.45964 L 539.63268,108.39354 L 536.81624,111.55445 L 536.58762,114.52487 L 536.81457,122.30306 L 535.21755,123.90342 L 529.95924,128.01694 L 528.12691,133.73419 L 530.6451,137.38211 L 531.10402,139.90198 L 529.95589,142.87575 L 529.72893,146.53538 L 530.18618,153.61933 L 533.61218,157.72618 L 536.58762,157.72618 L 539.09745,160.01909 L 542.29984,161.38414 L 545.95948,166.41886 L 553.04677,171.44186 L 554.87742,173.50448 L 555.11107,179.00649 L 534.52332,179.69236 L 474.27457,180.15128 L 473.93665,144.47443 L 473.47941,141.50234 L 469.3642,138.073 L 468.22108,136.24402 L 468.22108,134.64365 L 470.27868,133.0433 L 471.65042,131.67156 z",
25463                WI: "M 612.94089,197.18116 L 613.31165,194.21124 L 611.69504,189.68474 L 611.0484,183.54165 L 609.91678,181.11674 L 610.88674,178.04519 L 611.69504,175.1353 L 613.14999,172.54874 L 612.50334,169.15387 L 611.8567,165.59734 L 612.34168,163.81907 L 614.28161,161.39416 L 614.44327,158.64593 L 613.63497,157.35265 L 614.28161,154.76608 L 614.76659,151.53287 L 617.51482,145.87476 L 620.42471,139.08502 L 620.58637,136.82177 L 620.26305,135.85181 L 619.45474,136.33679 L 615.25157,142.64155 L 612.50334,146.68306 L 610.56342,148.46133 L 609.75512,150.72457 L 608.30017,151.53287 L 607.16855,153.4728 L 605.7136,153.14948 L 605.55194,151.37121 L 606.84523,148.94631 L 608.94681,144.25815 L 610.72508,142.64155 L 611.8264,140.34999 L 610.19574,139.44474 L 608.824,138.073 L 607.22364,127.78498 L 603.56569,126.64187 L 602.19395,124.35564 L 589.6197,121.61217 L 587.10485,120.46906 L 578.87444,118.18283 L 570.64402,117.03971 L 566.47456,111.63491 L 565.94513,112.89602 L 564.81351,112.73436 L 564.16686,111.60274 L 561.41864,110.79444 L 560.28701,110.9561 L 558.50875,111.92606 L 557.53878,111.27942 L 558.18543,109.33949 L 560.12535,
25463106.26794 L 561.25697,105.13632 L 559.31705,103.68138 L 557.21546,104.48968 L 554.30557,106.4296 L 546.86919,109.66281 L 543.9593,110.30945 L 541.04942,109.82447 L 540.06769,108.94622 L 537.95099,111.7814 L 537.72237,114.52487 L 537.72237,122.9839 L 536.57925,124.58427 L 531.32093,128.47084 L 529.03471,134.41503 L 529.49195,134.64365 L 532.0068,136.70126 L 532.69266,139.90198 L 530.86368,143.10269 L 530.86368,146.98928 L 531.32093,153.61933 L 534.29302,156.59143 L 537.72237,156.59143 L 539.55135,159.79215 L 542.98068,160.24939 L 546.86727,165.96496 L 553.95457,170.08017 L 556.01217,172.82364 L 556.92667,180.25388 L 557.61253,183.5689 L 559.89876,185.16926 L 560.12738,186.541 L 558.06978,189.97033 L 558.2984,193.17106 L 560.81325,197.05764 L 563.3281,198.20075 L 566.30019,198.65799 L 567.64253,200.03811 L 576.81603,200.03809 L 602.88316,198.55122 z",
25464                MO: "M 555.78857,249.52738 L 553.2687,246.44013 L 552.12558,244.1539 L 544.35242,244.83977 L 534.52164,245.29701 L 509.14453,246.21151 L 495.6558,246.44013 L 487.76835,246.55444 L 485.48209,246.66875 L 486.73952,249.1836 L 486.5109,251.46982 L 489.02574,255.35641 L 492.11214,259.47162 L 495.19855,262.21509 L 497.48478,262.44371 L 498.85651,263.35821 L 498.85651,266.3303 L 497.02754,267.93066 L 496.57028,270.21688 L 498.62789,273.64623 L 501.14275,276.61832 L 503.65759,278.4473 L 505.02932,290.10705 L 504.34346,325.42926 L 504.57208,330.11601 L 505.02932,335.49952 L 528.46231,335.3827 L 551.66834,334.69683 L 572.473,333.89582 L 584.12774,333.66552 L 586.29714,337.09152 L 585.61295,340.39902 L 582.5257,342.80206 L 581.95331,344.6394 L 587.3318,345.09666 L 591.22676,344.41078 L 592.94394,338.91715 L 593.59536,333.06036 L 595.91436,331.03553 L 597.62651,329.54864 L 599.68412,328.519 L 599.79926,325.65871 L 600.37334,323.9432 L 599.34202,322.19493 L 596.59688,322.3395 L 594.42748,319.71451 L 593.05406,315.48584 L 593.85507,312.96764 L 591.91094,309.53998 L 590.0803,304.96418 L 585.28089,304.16484 L 578.31209,298.56609 L 576.59323,294.45256 L 577.39258,291.25184 L 579.45185,285.19417 L 579.91077,282.33054 L 577.96163,281.29923 L 571.10629,280.50156 L 570.07832,278.7894 L 569.96652,274.55904 L 564.47958,271.12803 L 557.50407,263.35653 L 555.21785,256.0406 L 554.98756,251.81528 z",
25465                AR: "M 590.95215,344.95331 L 587.10485,345.89098 L 580.93204,345.43373 L 581.61791,342.46164 L 584.81863,339.71817 L 585.27587,337.43194 L 583.44689,334.45984 L 572.473,334.91709 L 551.66834,335.83158 L 528.34883,336.51745 L 505.02932,336.97469 L 506.62968,343.83338 L 506.62967,352.0638 L 508.00142,363.03779 L 508.23004,400.87472 L 510.51627,402.81801 L 513.48836,401.44628 L 516.23184,402.58939 L 516.66218,412.91269 L 539.548,412.77064 L 558.41187,411.96962 L 568.53344,411.77209 L 569.67907,409.68172 L 569.39245,406.13221 L 567.56682,403.16011 L 569.16551,401.6749 L 567.56682,399.1634 L 568.25102,396.65357 L 569.61941,391.04814 L 572.1376,388.98551 L 571.45173,386.70095 L 575.1097,381.32916 L 577.85317,379.96077 L 577.73969,378.46719 L 577.39425,376.64155 L 580.2512,371.04282 L 582.65424,369.78623 L 583.03837,366.3586 L 584.80904,365.1169 L 585.66552,360.88263 L 584.32406,356.87219 L 588.36558,354.49548 L 588.91584,352.47628 L 590.15112,348.2087 z",
25466                OK: "M 375.34313,322.57146 L 364.65498,322.11427 L 358.22497,321.62845 L 358.48217,321.82848 L 357.77873,332.25058 L 379.74411,333.65746 L 411.79966,334.96106 L 409.46506,359.37971 L 409.00781,377.21228 L 409.23644,378.81264 L 413.58027,382.4706 L 415.63787,383.61371 L 416.32374,383.38509 L 417.00961,381.32748 L 418.38135,383.15647 L 420.43895,383.15647 L 420.43895,381.78473 L 423.18242,383.15647 L 422.72518,387.04305 L 426.84039,387.27167 L 429.35523,388.41479 L 433.47044,389.10066 L 435.98529,390.92964 L 438.27152,388.87204 L 441.70086,389.5579 L 444.21571,392.98724 L 445.13019,392.98724 L 445.13019,395.27347 L 447.41642,395.95933 L 449.70264,393.67311 L 451.53163,394.35897 L 454.04647,394.35897 L 454.96097,396.87383 L 459.76204,398.7028 L 461.13378,398.01694 L 462.96276,393.90173 L 464.10587,393.90173 L 465.24899,395.95933 L 469.3642,396.6452 L 473.02215,398.01694 L 475.99425,398.93143 L 477.82324,398.01694 L 478.5091,395.50209 L 482.85293,395.50209 L 484.91053,396.41658 L 487.654,394.35897 
25466L 488.79712,394.35897 L 489.48299,395.95933 L 493.59819,395.95933 L 495.19855,393.90173 L 497.02754,394.35897 L 499.08514,396.87383 L 502.28585,398.7028 L 505.48658,399.6173 L 507.42766,400.73623 L 507.03856,363.51922 L 505.66681,352.54524 L 505.50635,343.6729 L 504.06646,337.13517 L 503.28826,329.95553 L 503.22012,326.13931 L 491.08328,326.45805 L 444.67324,326.00081 L 399.63433,323.94319 z",
25467                KS: "M 503.38059,325.13028 L 490.76233,325.33471 L 444.67324,324.87748 L 400.11576,322.81985 L 375.48602,321.56244 L 379.62981,256.84247 L 401.46327,257.64264 L 441.92918,259.01437 L 486.05364,259.47162 L 491.14927,259.47162 L 494.39617,262.69652 L 497.16383,262.92514 L 498.05413,264.00011 L 498.05413,266.00934 L 496.22515,267.60971 L 495.7679,270.21688 L 497.98598,273.80671 L 500.50084,276.93927 L 503.01569,278.92873 L 504.06646,290.10705 z",
25468                LA: "M 602.20213,472.99473 L 601.17268,470.37851 L 600.02956,467.28625 L 596.7137,463.74511 L 597.62986,456.99488 L 597.51137,455.85345 L 596.24976,456.19555 L 588.01934,457.10836 L 562.99102,457.56728 L 562.30683,455.1726 L 563.21964,446.7169 L 566.53552,440.77105 L 571.56688,432.08003 L 570.99281,429.68201 L 572.2494,429.00116 L 572.70833,427.04867 L 570.42209,424.99274 L 570.3103,423.05029 L 568.47964,418.70478 L 568.02323,412.76393 L 558.2984,412.87741 L 539.0941,413.79191 L 516.88913,413.82048 L 516.9177,423.39405 L 517.60357,432.76758 L 518.28944,436.65416 L 520.80429,440.76937 L 521.71878,445.79908 L 526.06261,451.28601 L 526.29123,454.48673 L 526.9771,455.1726 L 526.29123,463.63164 L 523.31914,468.66133 L 524.9195,470.71894 L 524.23362,473.23378 L 523.54776,480.54971 L 522.17602,483.75042 L 522.29848,487.36687 L 526.98496,485.84672 L 535.06798,485.5234 L 545.41425,489.07993 L 551.88067,490.21156 L 555.59886,488.75661 L 558.83207,489.88824 L 562.06528,490.8582 L 562.87358,488.75661 L 559.64037,487.62499 L 557.0538,488.10997 L 554.30557,486.49337 C 554.30557,486.49337 554.46724,485.20008 555.11388,485.03842 C 555.76052,484.87676 558.18543,484.06846 558.18543,484.06846 L 559.96369,485.5234 L 561.74196,484.55344 L 564.97517,485.20008 L 566.43011,487.62499 L 566.75343,489.88824 L 571.27992,490.21156 L 573.05819,491.98982 L 572.24989,493.60643 L 570.9566,494.41473 L 572.57321,496.03133 L 580.97955,499.58786 L 584.53608,498.29458 L 585.50605,495.86967 L 588.09261,495.22303 L 589.87088,493.76809 L 591.16416,494.73805 L 591.97246,497.64794 L 589.70922,498.45624 L 590.35586,499.10288 L 593.75073,497.8096 L 596.01398,494.41473 L 596.82228,493.92975 L 594.72069,493.60643 L 595.52899,491.98982 L 595.36733,490.53488 L 597.46892,490.0499 L 598.60054,488.75661 L 599.24718,489.56491 C 599.24718,489.56491 599.08552,492.63646 599.89383,492.63646 C 600.70213,492.63646 604.097,493.28311 604.097,493.28311 L 608.13851,495.22303 L 609.10847,496.67798 L 612.01836,496.67798 L 613.14999,497.64794 L 615.41323,494.57639 L 615.41323,493.12144 L 614.11995,493.12144 L 610.72508,490.37322 L 604.9053,489.56491 L 601.67209,487.30167 L 602.80372,484.55344 L 605.06696,484.87676 L 605.22862,484.23012 L 603.45036,483.26016 L 603.45036,482.77517 L 606.68357,482.77517 L 608.46183,479.70363 L 607.16855,477.7637 L 606.84523,475.01547 L 605.39028,475.17713 L 603.45036,477.27872 L 602.80372,479.86529 L 599.73217,479.21864 L 598.7622,477.44038 L 600.54047,475.50045 L 602.56122,473.7222 z",
25469                VA: "M 828.90662,269.2457 L 828.76271,267.29867 L 835.21614,264.74879 L 834.44573,267.96663 L 831.52578,271.74574 L 831.10769,276.33156 L 831.56944,279.722 L 829.74147,284.70016 L 827.5772,286.6163 L 826.10686,281.97549 L 826.55275,276.52638 L 828.13975,272.34331 z M 831.18615,297.54706 L 773.01197,310.12249 L 735.585,315.40156 L 728.90667,315.02638 L 726.32142,316.95276 L 718.98229,317.17345 L 710.60018,318.15112 L 701.67396,319.10283 L 710.15465,314.15454 L 710.14153,312.07961 L 711.66158,309.93348 L 722.21536,298.43205 L 726.16208,302.90951 L 729.94509,303.87349 L 732.48855,302.73317 L 734.72577,301.42201 L 737.26238,302.76553 L 741.17655,301.33777 L 743.05328,296.78143 L 745.6542,297.32145 L 748.50944,295.1902 L 7
2546950.30871,295.6838 L 753.13592,292.00723 L 753.48417,289.92412 L 752.52051,288.64855 L 753.52328,286.78192 L 758.79755,274.50477 L 759.41432,268.76969 L 760.64321,268.24615 L 762.82174,270.68902 L 766.7576,270.38785 L 768.68681,262.81422 L 771.4808,262.25336 L 772.53055,259.51229 L 775.11037,257.16541 L 776.37834,254.8232 L 777.8822,251.47022 L 777.96713,246.40267 L 787.78864,250.22549 C 788.46949,250.56591 788.44474,245.44151 788.44474,245.44151 L 792.49505,246.81886 L 792.03305,249.44766 L 800.18916,252.38732 L 801.48203,254.18171 L 800.61409,257.86385 L 799.35101,259.18967 L 798.84509,260.93571 L 799.339,263.33843 L 801.29798,264.61681 L 805.21607,266.06202 L 808.16474,267.02998 L 813.02121,267.97209 L 815.17352,270.06055 L 818.36396,270.46308 L 819.23203,271.6631 L 818.79254,276.35318 L 820.16727,277.45573 L 819.68832,279.38612 L 820.91773,280.17589 L 820.69593,281.56049 L 818.00194,281.46555 L 818.0909,283.08107 L 820.37189,284.62394 L 820.49343,286.03584 L 822.26654,287.82122 L 822.75833,290.34535 L 820.20529,291.72666 L 821.77751,293.22096 L 827.57853,291.53513 z",
25470                DC: "M 801.75695,253.84384 L 800.67992,252.20717 L 799.66604,251.36463 L 800.7653,249.74841 L 802.99814,251.25941 z"
25471
25472            }
25473
25474            // Create the actual objects
25475            var stateAttr = {};
25476            for (var state in paths) {
25477                stateAttr = {};
25478                if (this.options.stateSpecificStyles[state]) {
25479                    $.extend(stateAttr, attr, this.options.stateSpecificStyles[state]);
25480                } else {
25481                    stateAttr = attr;
25482                }
25483                this.stateShapes[state] = R.path(paths[state]).attr(stateAttr);
25484                this.topShape = this.stateShapes[state];
25485
25486                this.stateHitAreas[state] = R.path(paths[state]).attr({
25487                    fill: "#000",
25488                    "stroke-width": 0, "opacity": 0.0, 'cursor': 'pointer'
25489                });
25490                this.stateHitAreas[state].node.dataState = state;
25491            }
25492
25493            // Bind events
25494            this._onClickProxy = $.proxy(this, '_onClick');
25495            this._onMouseOverProxy = $.proxy(this, '_onMouseOver'),
25496                this._onMouseOutProxy = $.proxy(this, '_onMouseOut');
25497
25498            for (var state in this.stateHitAreas) {
25499                this.stateHitAreas[state].toFront();
25500                $(this.stateHitAreas[state].node).bind('mouseout', this._onMouseOutProxy);
25501                $(this.stateHitAreas[state].node).bind('click', this._onClickProxy);
25502                $(this.stateHitAreas[state].node).bind('mouseover', this._onMouseOverProxy);
25503            }
25504        },
25505
25506
25507
25508        /**
25509         * Create the labels
25510         */
25511        _initCreateLabels: function () {
25512            var R = this.paper; // shorter name for usage here
25513            var neStates = ['VT', 'NH', 'MA', 'RI', 'CT', 'NJ', 'DE', 'MD', 'DC'];
25514
25515            // calculate the values for placing items
25516            var neBoxX = 860;
25517            var neBoxY = 220;
25518            var oWidth = this.options.labelWidth;
25519            var oHeight = this.options.labelHeight;
25520            var oGap = this.options.labelGap;
25521            var oRadius = this.options.labelRadius;
25522
25523            var shapeWidth = oWidth / this.scale;
25524            var shapeHeight = oHeight / this.scale;
25525
25526            var colWidth = (oWidth + oGap) / this.scale;
25527            var downBy = (oHeight + oGap) / this.scale * 0.5;
25528
25529            var shapeRadius = oRadius / this.scale;
25530
25531            // Styling information
25532            var backingAttr = this.options.labelBackingStyles;
25533            var textAttr = this.options.labelTextStyles;
25534            var stateAttr = {};
25535
25536            // NE States
25537            for (var i = 0, x, y, state; i < neStates.length; ++i) {
25538                state = neStates[i];
25539
25540                // position
25541                x = ((i + 1) % 2) * colWidth + neBoxX;
25542                y = i * downBy + neBoxY;
25543
25544                // attributes for styling the backing
25545                stateAttr = {};
25546                if (this.options.stateSpecificLabelBackingStyles[state]) {
25547                    $.extend(stateAttr, backingAttr, this.options.stateSpecificLabelBackingStyles[state]);
25548                } else {
25549                    stateAttr = backingAttr;
25550                }
25551
25552                // add the backing
25553                this.labelShapes[state] = R.rect(x, y, shapeWidth, shapeHeight, shapeRadius).attr(stateAttr);
25554
25555                // attributes for styling the text
25556                stateAttr = {};
25557                if (this.options.stateSpecificLabelTextStyles[state]) {
25558                    $.extend(stateAttr, textAttr, this.options.stateSpecificLabelTextStyles[state]);
25559                } else {
25560                    $.extend(stateAttr, textAttr);
25561                }
25562
25563                // adjust font-size
25564                if (stateAttr['font-size']) {
25565                    stateAttr['font-size'] = (parseInt(stateAttr['font-size']) / this.scale) + 'px';
25566                }
25567
25568                // add the text
25569                this.labelTexts[state] = R.text(x + (shapeWidth / 2), y + (shapeHeight / 2), state).attr(stateAttr);
25570
25571                // Create the hit areas
25572                this.labelHitAreas[state] = R.rect(x, y, shapeWidth, shapeHeight, shapeRadius).attr({
25573                    fill: "#000",
25574                    "stroke-width": 0,
25575                    "opacity": 0.0,
25576                    'cursor': 'pointer'
25577                });
25578                this.labelHitAreas[state].node.dataState = state;
25579            }
25580
25581            var otherStates = {
25582                HI: { x: 332, y: 568 },
25583                AK: { x: 120, y: 495 },
25584                CA: { x: 70, y: 280 },
25585                NV: { x: 130, y: 235 },
25586                OR: { x: 90, y: 125 },
25587                WA: { x: 115, y: 50 },
25588                ID: { x: 185, y: 145 },
25589                MT: { x: 270, y: 85 },
25590                WY: { x: 295, y: 185 },
25591                UT: { x: 215, y: 255 },
25592                AZ: { x: 195, y: 365 },
25593                CO: { x: 310, y: 270 },
25594                NM: { x: 295, y: 370 },
25595                TX: { x: 420, y: 455 },
25596                OK: { x: 455, y: 360 },
25597                KS: { x: 440, y: 290 },
25598                NE: { x: 420, y: 225 },
25599                SD: { x: 410, y: 160 },
25600                ND: { x: 415, y: 95 },
25601                MN: { x: 500, y: 125 },
25602                IA: { x: 520, y: 215 },
25603                WI: { x: 578, y: 160 },
25604                IL: { x: 593, y: 255 },
25605                MO: { x: 540, y: 294 },
25606                AR: { x: 540, y: 375 },
25607                LA: { x: 544, y: 455 },
25608                MS: { x: 596, y: 420 },
25609                AL: { x: 648, y: 410 },
25610                TN: { x: 645, y: 346 },
25611                KY: { x: 680, y: 304 },
25612                IN: { x: 645, y: 250 },
25613                MI: { x: 665, y: 185 },
25614                OH: { x: 696, y: 240 },
25615                PA: { x: 775, y: 215 },
25616                NY: { x: 810, y: 160 },
25617                ME: { x: 895, y: 85 },
25618                WV: { x: 735, y: 278 },
25619                VA: { x: 785, y: 285 },
25620                NC: { x: 778, y: 334 },
25621                SC: { x: 758, y: 376 },
25622                GA: { x: 710, y: 410 },
25623                FL: { x: 763, y: 508 }
25624            };
25625            var textAttr = this.options.labelTextStyles;
25626            for (var state in otherStates) {
25627                // attributes for styling the text
25628                stateAttr = {};
25629                if (this.options.stateSpecificLabelTextStyles[state]) {
25630                    $.extend(stateAttr, textAttr, this.options.stateSpecificLabelTextStyles[state]);
25631                } else {
25632                    $.extend(stateAttr, textAttr);
25633                }
25634                // adjust font-size
25635                if (stateAttr['font-size']) {
25636                    stateAttr['font-size'] = (parseInt(stateAttr['font-size']) / this.scale) + 'px';
25637                }
25638
25639                this.labelTexts[state] = R.text(otherStates[state].x, otherStates[state].y, state).attr(stateAttr);
25640                this.labelHitAreas[state] = R.rect(otherStates[state].x - this.options.labelWidth / this.scale / 2, otherStates[state].y - this.options.labelHeight / this.scale / 2, this.options.labelWidth / this.scale, this.options.labelHeight / this.scale, this.options.labelRadius / this.scale).attr({
25641                    fill: "#000",
25642                    "stroke-width": 0,
25643                    "opacity": 0.0,
25644                    'cursor': 'pointer'
25645                });
25646                this.labelHitAreas[state].node.dataState = state;
25647            }
25648
25649            // Bind events
25650            for (var state in this.labelHitAreas) {
25651                this.labelHitAreas[state].toFront();
25652                $(this.labelHitAreas[state].node).bind('mouseout', this._onMouseOutProxy);
25653                $(this.labelHitAreas[state].node).bind('click', this._onClickProxy);
25654                $(this.labelHitAreas[state].node).bind('mouseover', this._onMouseOverProxy);
25655            }
25656        },
25657
25658
25659
25660        /**
25661         * Get the state Raphael object
25662         */
25663        _getStateFromEvent: function (event) {
25664            // first get the state name
25665            var stateName = (event.target && event.target.dataState) || (event.dataState);
25666            return this._getState(stateName);
25667        },
25668
25669
25670        /**
25671         *
25672         */
25673        _getState: function (stateName) {
25674            var stateShape = this.stateShapes[stateName];
25675            var stateHitArea = this.stateHitAreas[stateName];
25676            var labelBacking = this.labelShapes[stateName];
25677            var labelText = this.labelTexts[stateName];
25678            var labelHitArea = this.labelHitAreas[stateName]
25679
25680            return {
25681                shape: stateShape,
25682                hitArea: stateHitArea,
25683                name: stateName,
25684                labelBacking: labelBacking,
25685                labelText: labelText,
25686                labelHitArea: labelHitArea
25687            };
25688        },
25689
25690
25691
25692        /**
25693         * The mouseout handler
25694         */
25695        _onMouseOut: function (event) {
25696            var stateData = this._getStateFromEvent(event);
25697
25698            // Stop if no state was found
25699            if (!stateData.hitArea) {
25700                return;
25701            }
25702
25703            return !this._triggerEvent('mouseout', event, stateData);
25704
25705        },
25706
25707
25708        /**
25709         *
25710         */
25711        _defaultMouseOutAction: function (stateData) {
25712            // hover effect
25713            // ... state shape
25714            var attrs = {};
25715            if (this.options.stateSpecificStyles[stateData.name]) {
25716                $.extend(attrs, this.options.stateStyles, this.options.stateSpecificStyles[stateData.name]);
25717            } else {
25718                attrs = this.options.stateStyles;
25719            }
25720
25721            stateData.shape.animate(attrs, this.options.stateHoverAnimation);
25722
25723
25724            // ... for the label backing
25725            if (stateData.labelBacking) {
25726                var attrs = {};
25727
25728                if (this.options.stateSpecificLabelBackingStyles[stateData.name]) {
25729                    $.extend(attrs, this.options.labelBackingStyles, this.options.stateSpecificLabelBackingStyles[stateData.name]);
25730                } else {
25731                    attrs = this.options.labelBackingStyles;
25732                }
25733
25734                stateData.labelBacking.animate(attrs, this.options.stateHoverAnimation);
25735            }
25736        },
25737
25738
25739        /**
25740         * The click handler
25741         */
25742        _onClick: function (event) {
25743            var stateData = this._getStateFromEvent(event);
25744
25745            // Stop if no state was found
25746            if (!stateData.hitArea) {
25747                return;
25748            }
25749
25750            return !this._triggerEvent('click', event, stateData);
25751        },
25752
25753
25754
25755        /**
25756         * The mouseover handler
25757         */
25758        _onMouseOver: function (event) {
25759            var stateData = this._getStateFromEvent(event);
25760
25761            // Stop if no state was found
25762            if (!stateData.hitArea) {
25763                return;
25764            }
25765
25766            return !this._triggerEvent('mouseover', event, stateData);
25767        },
25768
25769
25770
25771        /**
25772         * The default on hover action for a state
25773         */
25774        _defaultMouseOverAction: function (stateData) {
25775            // hover effect
25776            this.bringShapeToFront(stateData.shape);
25777            this.paper.safari();
25778
25779            // ... for the state
25780            var attrs = {};
25781            if (this.options.stateSpecificHoverStyles[stateData.name]) {
25782                $.extend(attrs, this.options.stateHoverStyles, this.options.stateSpecificHoverStyles[stateData.name]);
25783            } else {
25784                attrs = this.options.stateHoverStyles;
25785            }
25786
25787            stateData.shape.animate(attrs, this.options.stateHoverAnimation);
25788
25789            // ... for the label backing
25790            if (stateData.labelBacking) {
25791                var attrs = {};
25792
25793                if (this.options.stateSpecificLabelBackingHoverStyles[stateData.name]) {
25794                    $.extend(attrs, this.options.labelBackingHoverStyles, this.options.stateSpecificLabelBackingHoverStyles[stateData.name]);
25795                } else {
25796                    attrs = this.options.labelBackingHoverStyles;
25797                }
25798
25799                stateData.labelBacking.animate(attrs, this.options.stateHoverAnimation);
25800            }
25801        },
25802
25803
25804
25805
25806
25807
25808        /**
25809         * Trigger events
25810         *
25811         * @param type string - the type of event
25812         * @param event Event object - the original event object
25813         * @param stateData object - information about the state
25814         *
25815         * return boolean - true to continue to default action, false to prevent the default action
25816         */
25817        _triggerEvent: function (type, event, stateData) {
25818            var name = stateData.name;
25819            var defaultPrevented = false;
25820
25821            // State specific
25822            var sEvent = $.Event('usmap' + type + name);
25823            sEvent.originalEvent = event;
25824
25825            // Do the one in options first
25826            if (this.options[type + 'State'][name]) {
25827                defaultPrevented = this.options[type + 'State'][name](sEvent, stateData) === false;
25828            }
25829
25830            // Then do the bounded ones
25831            if (sEvent.isPropagationStopped()) {
25832                this.element.trigger(sEvent, [stateData]);
25833                defaultPrevented = defaultPrevented || sEvent.isDefaultPrevented();
25834            }
25835
25836
25837            // General
25838            if (!sEvent.isPropagationStopped()) {
25839                var gEvent = $.Event('usmap' + type);
25840                gEvent.originalEvent = event;
25841
25842                // Options handler first
25843                if (this.options[type]) {
25844                    defaultPrevented = this.options[type](gEvent, stateData) === false || defaultPrevented;
25845                }
25846
25847                // Bounded options next
25848                if (!gEvent.isPropagationStopped()) {
25849                    this.element.trigger(gEvent, [stateData]);
25850                    defaultPrevented = defaultPrevented || gEvent.isDefaultPrevented();
25851                }
25852            }
25853
25854            // Do the default action
25855            if (!defaultPrevented) {
25856                switch (type) {
25857                    case 'mouseover':
25858                        this._defaultMouseOverAction(stateData);
25859                        break;
25860
25861                    case 'mouseout':
25862                        this._defaultMouseOutAction(stateData);
25863                        break;
25864                }
25865            }
25866
25867            return !defaultPrevented;
25868        },
25869
25870
25871        /**
25872         *
25873          @param string state - The two letter state abbr
25874         */
25875        trigger: function (state, type, event) {
25876            type = type.replace('usmap', ''); // remove the usmap if they added it
25877            state = state.toUpperCase(); // ensure state is uppercase to match
25878
25879            var stateData = this._getState(state);
25880
25881            this._triggerEvent(type, event, stateData);
25882        },
25883
25884
25885        /**
25886         * Bring a state shape to the top of the state shapes, but not above the hit areas
25887         */
25888        bringShapeToFront: function (shape) {
25889            if (this.topShape) {
25890                shape.insertAfter(this.topShape);
25891            }
25892            this.topShape = shape;
25893        }
25894    };
25895
25896
25897    // Getters
25898    var getters = [];
25899
25900
25901    // Create the plugin
25902    jQueryPluginFactory($, 'usmap', methods, getters);
25903
25904})(jQuery, document, window, window.Raphael);
25905
25906/**
25907 * Copyright (c) 2011-2014 Felix Gnass
25908 * Licensed under the MIT license
25909 * http://spin.js.org/
25910 *
25911 * Example:
25912    var opts = {
25913      lines: 12             // The number of lines to draw
25914    , length: 7             // The length of each line
25915    , width: 5              // The line thickness
25916    , radius: 10            // The radius of the inner circle
25917    , scale: 1.0            // Scales overall size of the spinner
25918    , corners: 1            // Roundness (0..1)
25919    , color: '#000'         // #rgb or #rrggbb
25920    , opacity: 1/4          // Opacity of the lines
25921    , rotate: 0             // Rotation offset
25922    , direction: 1          // 1: clockwise, -1: counterclockwise
25923    , speed: 1              // Rounds per second
25924    , trail: 100            // Afterglow percentage
25925    , fps: 20               // Frames per second when using setTimeout()
25926    , zIndex: 2e9           // Use a high z-index by default
25927    , className: 'spinner'  // CSS class to assign to the element
25928    , top: '50%'            // center vertically
25929    , left: '50%'           // center horizontally
25930    , shadow: false         // Whether to render a shadow
25931    , hwaccel: false        // Whether to use hardware acceleration (might be buggy)
25932    , position: 'absolute'  // Element positioning
25933    }
25934    var target = document.getElementById('foo')
25935    var spinner = new Spinner(opts).spin(target)
25936 */
25937;
25938(function (root, factory) {
25939    /* CommonJS */
25940    if (typeof module == 'object' && module.exports) module.exports = factory()
25941    /* AMD module */
25942    else if (typeof define == 'function' && define.amd) define(factory)
25943    /* Browser global */
25944    else root.Spinner = factory()
25945}(this, function () {
25946    "use strict"
25947    var prefixes = ['webkit', 'Moz', 'ms', 'O'] /* Vendor prefixes */,
25948        animations = {} /* Animation rules keyed by their name */,
25949        useCssAnimations /* Whether to use CSS animations or setTimeout */, sheet /* A stylesheet to hold the @keyframe or VML rules. */
25950    /**
25951     * Utility function to create elements. If no tag name is given,
25952     * a DIV is created. Optionally properties can be passed.
25953     */
25954    function createEl(tag, prop) {
25955        var el = document.createElement(tag || 'div'),
25956            n
25957        for (n in prop) el[n] = prop[n]
25958        return el
25959    }
25960    /**
25961     * Appends children and returns the parent.
25962     */
25963    function ins(parent /* child1, child2, ...*/) {
25964        for (var i = 1, n = arguments.length; i < n; i++) {
25965            parent.appendChild(arguments[i])
25966        }
25967        return parent
25968    }
25969    /**
25970     * Creates an opacity keyframe animation rule and returns its name.
25971     * Since most mobile Webkits have timing issues with animation-delay,
25972     * we create separate rules for each line/segment.
25973     */
25974    function addAnimation(alpha, trail, i, lines) {
25975        var name = ['opacity', trail, ~~(alpha * 100), i, lines].join('-'),
25976            start = 0.01 + i / lines * 100,
25977            z = Math.max(1 - (1 - alpha) / trail * (100 - start), alpha),
25978            prefix = useCssAnimations.substring(0, useCssAnimations.indexOf('Animation')).toLowerCase(),
25979            pre = prefix && '-' + prefix + '-' || ''
25980        if (!animations[name]) {
25981            sheet.insertRule('@' + pre + 'keyframes ' + name + '{' + '0%{opacity:' + z + '}' + start + '%{opacity:' + alpha + '}' + (start + 0.01) + '%{opacity:1}' + (start + trail) % 100 + '%{opacity:' + alpha + '}' + '100%{opacity:' + z + '}' + '}', sheet.cssRules.length)
25982            animations[name] = 1
25983        }
25984        return name
25985    }
25986    /**
25987     * Tries various vendor prefixes and returns the first supported property.
25988     */
25989    function vendor(el, prop) {
25990        var s = el.style,
25991            pp, i
25992        prop = prop.charAt(0).toUpperCase() + prop.slice(1)
25993        if (s[prop] !== undefined) return prop
25994        for (i = 0; i < prefixes.length; i++) {
25995            pp = prefixes[i] + prop
25996            if (s[pp] !== undefined) return pp
25997        }
25998    }
25999    /**
26000     * Sets multiple style properties at once.
26001     */
26002    function css(el, prop) {
26003        for (var n in prop) {
26004            el.style[vendor(el, n) || n] = prop[n]
26005        }
26006        return el
26007    }
26008    /**
26009     * Fills in default values.
26010     */
26011    function merge(obj) {
26012        for (var i = 1; i < arguments.length; i++) {
26013            var def = arguments[i]
26014            for (var n in def) {
26015                if (obj[n] === undefined) obj[n] = def[n]
26016            }
26017        }
26018        return obj
26019    }
26020    /**
26021     * Returns the line color from the given string or array.
26022     */
26023    function getColor(color, idx) {
26024        return typeof color == 'string' ? color : color[idx % color.length]
26025    }
26026    // Built-in defaults
26027    var defaults = {
26028        lines: 12 // The number of lines to draw
26029        ,
26030        length: 7 // The length of each line
26031        ,
26032        width: 5 // The line thickness
26033        ,
26034        radius: 10 // The radius of the inner circle
26035        ,
26036        scale: 1.0 // Scales overall size of the spinner
26037        ,
26038        corners: 1 // Roundness (0..1)
26039        ,
26040        color: '#6e6e6e' // #rgb or #rrggbb
26041        ,
26042        opacity: 1 / 4 // Opacity of the lines
26043        ,
26044        rotate: 0 // Rotation offset
26045        ,
26046        direction: 1 // 1: clockwise, -1: counterclockwise
26047        ,
26048        speed: 1 // Rounds per second
26049        ,
26050        trail: 100 // Afterglow percentage
26051        ,
26052        fps: 20 // Frames per second when using setTimeout()
26053        ,
26054        zIndex: 2e9 // Use a high z-index by default
26055        ,
26056        className: 'spinner' // CSS class to assign to the element
26057        ,
26058        top: '50%' // center vertically
26059        ,
26060        left: '50%' // center horizontally
26061        ,
26062        shadow: false // Whether to render a shadow
26063        ,
26064        hwaccel: false // Whether to use hardware acceleration (might be buggy)
26065        ,
26066        position: 'absolute' // Element positioning
26067    }
26068    /** The constructor */
26069    function Spinner(o) {
26070        this.opts = merge(o || {}, Spinner.defaults, defaults)
26071    }
26072    // Global defaults that override the built-ins:
26073    Spinner.defaults = {}
26074    merge(Spinner.prototype, {
26075        /**
26076         * Adds the spinner to the given target element. If this instance is already
26077         * spinning, it is automatically removed from its previous target b calling
26078         * stop() internally.
26079         */
26080        spin: function (target) {
26081            this.stop()
26082            var self = this,
26083                o = self.opts,
26084                el = self.el = createEl(null, {
26085                    className: o.className
26086                })
26087            css(el, {
26088                position: o.position,
26089                width: 0,
26090                zIndex: o.zIndex,
26091                left: o.left,
26092                top: o.top
26093            })
26094            if (target) {
26095                target.insertBefore(el, target.firstChild || null)
26096            }
26097            el.setAttribute('role', 'progressbar')
26098            self.lines(el, self.opts)
26099            if (!useCssAnimations) {
26100                // No CSS animation support, use setTimeout() instead
26101                var i = 0,
26102                    start = (o.lines - 1) * (1 - o.direction) / 2,
26103                    alpha, fps = o.fps,
26104                    f = fps / o.speed,
26105                    ostep = (1 - o.opacity) / (f * o.trail / 100),
26106                    astep = f / o.lines;
26107                (function anim() {
26108                    i++
26109                    for (var j = 0; j < o.lines; j++) {
26110                        alpha = Math.max(1 - (i + (o.lines - j) * astep) % f * ostep, o.opacity)
26111                        self.opacity(el, j * o.direction + start, alpha, o)
26112                    }
26113                    self.timeout = self.el && setTimeout(anim, ~~(1000 / fps))
26114                })()
26115            }
26116            return self
26117        }
26118        /**
26119         * Stops and removes the Spinner.
26120         */
26121        ,
26122        stop: function () {
26123            var el = this.el
26124            if (el) {
26125                clearTimeout(this.timeout)
26126                if (el.parentNode) el.parentNode.removeChild(el)
26127                this.el = undefined
26128            }
26129            return this
26130        }
26131        /**
26132         * Internal method that draws the individual lines. Will be overwritten
26133         * in VML fallback mode below.
26134         */
26135        ,
26136        lines: function (el, o) {
26137            var i = 0,
26138                start = (o.lines - 1) * (1 - o.direction) / 2,
26139                seg
26140
26141            function fill(color, shadow) {
26142                return css(createEl(), {
26143                    position: 'absolute',
26144                    width: o.scale * (o.length + o.width) + 'px',
26145                    height: o.scale * o.width + 'px',
26146                    background: color,
26147                    boxShadow: shadow,
26148                    transformOrigin: 'left',
26149                    transform: 'rotate(' + ~~(360 / o.lines * i + o.rotate) + 'deg) translate(' + o.scale * o.radius + 'px' + ',0)',
26150                    borderRadius: (o.corners * o.scale * o.width >> 1) + 'px'
26151                })
26152            }
26153            for (; i < o.lines; i++) {
26154                seg = css(createEl(), {
26155                    position: 'absolute',
26156                    top: 1 + ~(o.scale * o.width / 2) + 'px',
26157                    transform: o.hwaccel ? 'translate3d(0,0,0)' : '',
26158                    opacity: o.opacity,
26159                    animation: useCssAnimations && addAnimation(o.opacity, o.trail, start + i * o.direction, o.lines) + ' ' + 1 / o.speed + 's linear infinite'
26160                })
26161                if (o.shadow) ins(seg, css(fill('#000', '0 0 4px #000'), {
26162                    top: '2px'
26163                }))
26164                ins(el, ins(seg, fill(getColor(o.color, i), '0 0 1px rgba(0,0,0,.1)')))
26165            }
26166            return el
26167        }
26168        /**
26169         * Internal method that adjusts the opacity of a single line.
26170         * Will be overwritten in VML fallback mode below.
26171         */
26172        ,
26173        opacity: function (el, i, val) {
26174            if (i < el.childNodes.length) el.childNodes[i].style.opacity = val
26175        }
26176    })
26177
26178    function initVML() {
26179        /* Utility function to create a VML tag */
26180        function vml(tag, attr) {
26181            return createEl('<' + tag + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', attr)
26182        }
26183        // No CSS transforms but VML support, add a CSS rule for VML elements:
26184        sheet.addRule('.spin-vml', 'behavior:url(#default#VML)')
26185        Spinner.prototype.lines = function (el, o) {
26186            var r = o.scale * (o.length + o.width),
26187                s = o.scale * 2 * r
26188
26189            function grp() {
26190                return css(vml('group', {
26191                    coordsize: s + ' ' + s,
26192                    coordorigin: -r + ' ' + -r
26193                }), {
26194                        width: s,
26195                        height: s
26196                    })
26197            }
26198            var margin = -(o.width + o.length) * o.scale * 2 + 'px',
26199                g = css(grp(), {
26200                    position: 'absolute',
26201                    top: margin,
26202                    left: margin
26203                }),
26204                i
26205
26206            function seg(i, dx, filter) {
26207                ins(g, ins(css(grp(), {
26208                    rotation: 360 / o.lines * i + 'deg',
26209                    left: ~~dx
26210                }), ins(css(vml('roundrect', {
26211                    arcsize: o.corners
26212                }), {
26213                        width: r,
26214                        height: o.scale * o.width,
26215                        left: o.scale * o.radius,
26216                        top: -o.scale * o.width >> 1,
26217                        filter: filter
26218                    }), vml('fill', {
26219                        color: getColor(o.color, i),
26220                        opacity: o.opacity
26221                    }), vml('stroke', {
26222                        opacity: 0
26223                    }) // transparent stroke to fix color bleeding upon opacity change
26224                )))
26225            }
26226            if (o.shadow)
26227                for (i = 1; i <= o.lines; i++) {
26228                    seg(i, -2, 'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)')
26229                }
26230            for (i = 1; i <= o.lines; i++) seg(i)
26231            return ins(el, g)
26232        }
26233        Spinner.prototype.opacity = function (el, i, val, o) {
26234            var c = el.firstChild
26235            o = o.shadow && o.lines || 0
26236            if (c && i + o < c.childNodes.length) {
26237                c = c.childNodes[i + o];
26238                c = c && c.firstChild;
26239                c = c && c.firstChild
26240                if (c) c.opacity = val
26241            }
26242        }
26243    }
26244    if (typeof document !== 'undefined') {
26245        sheet = (function () {
26246            var el = createEl('style', {
26247                type: 'text/css'
26248            })
26249            ins(document.getElementsByTagName('head')[0], el)
26250            return el.sheet || el.styleSheet
26251        }())
26252        var probe = css(createEl('group'), {
26253            behavior: 'url(#default#VML)'
26254        })
26255        if (!vendor(probe, 'transform') && probe.adj) initVML()
26256        else useCssAnimations = vendor(probe, 'animation')
26257    }
26258    return Spinner
26259}));
26260
26261/*!
26262 * Bootstrap v3.4.1 (https://getbootstrap.com/)
26263 * Copyright 2011-2019 Twitter, Inc.
26264 * Licensed under the MIT license
26265 */
26266if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");!function(t){"use strict";var e=jQuery.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1||3<e[0])throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(),function(n){"use strict";n.fn.emulateTransitionEnd=function(t){var e=!1,i=this;n(this).one("bsTransitionEnd",function(){e=!0});return setTimeout(function(){e||n(i).trigger(n.support.transition.end)},t),this},n(function(){n.support.transition=function o(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(t.style[i]!==undefined)return{end:e[i]};return!1}(),n.support.transition&&(n.event.special.bsTransitionEnd={bindType:n.support.transition.end,delegateType:n.support.transition.end,handle:function(t){if(n(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery),function(s){"use strict";var e='[data-dismiss="alert"]',a=function(t){s(t).on("click",e,this.close)};a.VERSION="3.4.1",a.TRANSITION_DURATION=150,a.prototype.close=function(t){var e=s(this),i=e.attr("data-target");
vendor: 4,440 bytes, line 26266
26266i||(i=(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),i="#"===i?[]:i;var o=s(document).find(i);function n(){o.detach().trigger("closed.bs.alert").remove()}t&&t.preventDefault(),o.length||(o=e.closest(".alert")),o.trigger(t=s.Event("close.bs.alert")),t.isDefaultPrevented()||(o.removeClass("in"),s.support.transition&&o.hasClass("fade")?o.one("bsTransitionEnd",n).emulateTransitionEnd(a.TRANSITION_DURATION):n())};var t=s.fn.alert;s.fn.alert=function o(i){return this.each(function(){var t=s(this),e=t.data("bs.alert");e||t.data("bs.alert",e=new a(this)),"string"==typeof i&&e[i].call(t)})},s.fn.alert.Constructor=a,s.fn.alert.noConflict=function(){return s.fn.alert=t,this},s(document).on("click.bs.alert.data-api",e,a.prototype.close)}(jQuery),function(s){"use strict";var n=function(t,e){this.$element=s(t),this.options=s.extend({},n.DEFAULTS,e),this.isLoading=!1};function i(o){return this.each(function(){var t=s(this),e=t.data("bs.button"),i="object"==typeof o&&o;e||t.data("bs.button",e=new n(this,i)),"toggle"==o?e.toggle():o&&e.setState(o)})}n.VERSION="3.4.1",n.DEFAULTS={loadingText:"loading..."},n.prototype.setState=function(t){var e="disabled",i=this.$element,o=i.is("input")?"val":"html",n=i.data();t+="Text",null==n.resetText&&i.data("resetText",i[o]()),setTimeout(s.proxy(function(){i[o](null==n[t]?this.options[t]:n[t]),"loadingText"==t?(this.isLoading=!0,i.addClass(e).attr(e,e).prop(e,!0)):this.isLoading&&(this.isLoading=!1,i.removeClass(e).removeAttr(e).prop(e,!1))},this),0)},n.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")?(i.prop("checked")&&(t=!1),e.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==i.prop("type")&&(i.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),i.prop("checked",this.$element.hasClass("active")),t&&i.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var t=s.fn.button;s.fn.button=i,s.fn.button.Constructor=n,s.fn.button.noConflict=function(){return s.fn.button=t,this},s(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(t){var e=s(t.target).closest(".btn");i.call(e,"toggle"),s(t.target).is('input[type="radio"], input[type="checkbox"]')||(t.preventDefault(),e.is("input,button")?e.trigger("focus"):e.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(t){s(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))})}(jQuery),function(p){"use strict";var c=function(t,e){this.$element=p(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=e,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",p.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",p.proxy(this.pause,this)).on("mouseleave.bs.carousel",p.proxy(this.cycle,this))};function r(n){return this.each(function(){var t=p(this),e=t.data("bs.carousel"),i=p.extend({},c.DEFAULTS,t.data(),"object"==typeof n&&n),o="string"==typeof n?n:i.slide;e||t.data("bs.carousel",e=new c(this,i)),"number"==typeof n?e.to(n):o?e[o]():i.interval&&e.pause().cycle()})}c.VERSION="3.4.1",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(t){if(!/input|textarea/i.test(t.target.tagName)){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()}},c.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(p.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(t){return this.$items=t.parent().children(".item"),this.$items.index(t||this.$active)},c.prototype.getItemForDirection=function(t,e){var i=this.getItemIndex(e);if(("prev"==t&&0===i||"next"==t&&i==this.$items.length-1)&&!this.options.wrap)return e;var o=(i+("prev"==t?-1:1))%this.$items.length;return this.$items.eq(o)},c.prototype.to=function(t){var e=this,i=this.getItemIndex(this.$active=this.$element.find(".
26266item.active"));if(!(t>this.$items.length-1||t<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){e.to(t)}):i==t?this.pause().cycle():this.slide(i<t?"next":"prev",this.$items.eq(t))},c.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&p.support.transition&&(this.$element.trigger(p.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(t,e){var i=this.$element.find(".item.active"),o=e||this.getItemForDirection(t,i),n=this.interval,s="next"==t?"left":"right",a=this;if(o.hasClass("active"))return this.sliding=!1;var r=o[0],l=p.Event("slide.bs.carousel",{relatedTarget:r,direction:s});if(this.$element.trigger(l),!l.isDefaultPrevented()){if(this.sliding=!0,n&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var h=p(this.$indicators.children()[this.getItemIndex(o)]);h&&h.addClass("active")}var d=p.Event("slid.bs.carousel",{relatedTarget:r,direction:s});return p.support.transition&&this.$element.hasClass("slide")?(o.addClass(t),"object"==typeof o&&o.length&&o[0].offsetWidth,i.addClass(s),o.addClass(s),i.one("bsTransitionEnd",function(){o.removeClass([t,s].join(" ")).addClass("active"),i.removeClass(["active",s].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger(d)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(i.removeClass("active"),o.addClass("active"),this.sliding=!1,this.$element.trigger(d)),n&&this.cycle(),this}};var t=p.fn.carousel;p.fn.carousel=r,p.fn.carousel.Constructor=c,p.fn.carousel.noConflict=function(){return p.fn.carousel=t,this};var e=function(t){var e=p(this),i=e.attr("href");i&&(i=i.replace(/.*(?=#[^\s]+$)/,""));var o=e.attr("data-target")||i,n=p(document).find(o);if(n.hasClass("carousel")){var s=p.extend({},n.data(),e.data()),a=e.attr("data-slide-to");a&&(s.interval=!1),r.call(n,s),a&&n.data("bs.carousel").to(a),t.preventDefault()}};p(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),p(window).on("load",function(){p('[data-ride="carousel"]').each(function(){var t=p(this);r.call(t,t.data())})})}(jQuery),function(a){"use strict";var r=function(t,e){this.$element=a(t),this.options=a.extend({},r.DEFAULTS,e),this.$trigger=a('[data-toggle="collapse"][href="#'+t.id+'"],[data-toggle="collapse"][data-target="#'+t.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};function n(t){var e,i=t.attr("data-target")||(e=t.attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"");return a(document).find(i)}function l(o){return this.each(function(){var t=a(this),e=t.data("bs.collapse"),i=a.extend({},r.DEFAULTS,t.data(),"object"==typeof o&&o);!e&&i.toggle&&/show|hide/.test(o)&&(i.toggle=!1),e||t.data("bs.collapse",e=new r(this,i)),"string"==typeof o&&e[o]()})}r.VERSION="3.4.1",r.TRANSITION_DURATION=350,r.DEFAULTS={toggle:!0},r.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},r.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var t,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(t=e.data("bs.collapse"))&&t.transitioning)){var i=a.Event("show.bs.collapse");if(this.$element.trigger(i),!i.isDefaultPrevented()){e&&e.length&&(l.call(e,"hide"),t||e.data("bs.collapse",null));var o=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[o](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var n=function(){this.$element.removeClass("collapsing").addClass("collapse in")[o](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return n.call(this);var s=a.camelCase(["scroll",o].join("-"));this.$element.one("bsTransitionEnd",a.proxy(n,this)).emulateTransitionEnd(r.TRANSITION_DURATION)[o](this.$element[0][s])}}}},r.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var t=a.Event("hide.bs.collapse");if(this.$element.trigger(t),!t.isDefaultPrevented()){var e=this.dimension();this.$element[e](this.$element[e]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var i=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!a.support.transition)return i.call(this);this.$element[e](0).one("bsTransitionEnd",a.proxy(i,this)).emulateTransitionEnd(r.TRANSITION_DURATION)}}},r.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},r.prototype.getParent=function(){return a(document).find(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(t,e){var i=a(e);this.addAriaAndCollapsedClass(n(i),i)},this)).end()},r.prototype.addAriaAndCollapsedClass=function(t,e){var i=t.hasClass("in");t.attr("aria-expanded",i),e.toggleClass("collapsed",!i).attr("aria-expanded",i)};var t=a.fn.collapse;a.fn.collapse=l,a.fn.collapse.Constructor=r,a.fn.collapse.noConflict=function(){return a.fn.collapse=t,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(t){var e=a(this);e.attr("data-target")||t.preventDefault();var i=n(e),o=i.data("bs.collapse")?"toggle":e.data();l.call(i,o)})}(jQuery),function(a){"use strict";var r='[data-toggle="dropdown"]',o=function(t){a(t).on("click.bs.dropdown",this.toggle)};function l(t){var e=t.attr("data-target");e||(e=(e=t.attr("href"))&&/#[A-Za-z]/.test(e)&&e.replace(/.*(?=#[^\s]*$)/,""));var i="#"!==e?a(document).find(e):null;return i&&i.length?i:t.parent()}function s(o){o&&3===o.which||(a(".dropdown-backdrop").remove(),a(r).each(function(){var t=a(this),e=l(t),i={relatedTarget:this};e.hasClass("open")&&(o&&"click"==o.type&&/input|textarea/i.test(o.target.tagName)&&a.contains(e[0],o.target)||(e.trigger(o=a.Event("hide.bs.dropdown",i)),o.isDefaultPrevented()||(t.attr("aria-expanded","fal
26266se"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",i)))))}))}o.VERSION="3.4.1",o.prototype.toggle=function(t){var e=a(this);if(!e.is(".disabled, :disabled")){var i=l(e),o=i.hasClass("open");if(s(),!o){"ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",s);var n={relatedTarget:this};if(i.trigger(t=a.Event("show.bs.dropdown",n)),t.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),i.toggleClass("open").trigger(a.Event("shown.bs.dropdown",n))}return!1}},o.prototype.keydown=function(t){if(/(38|40|27|32)/.test(t.which)&&!/input|textarea/i.test(t.target.tagName)){var e=a(this);if(t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled")){var i=l(e),o=i.hasClass("open");if(!o&&27!=t.which||o&&27==t.which)return 27==t.which&&i.find(r).trigger("focus"),e.trigger("click");var n=i.find(".dropdown-menu li:not(.disabled):visible a");if(n.length){var s=n.index(t.target);38==t.which&&0<s&&s--,40==t.which&&s<n.length-1&&s++,~s||(s=0),n.eq(s).trigger("focus")}}}};var t=a.fn.dropdown;a.fn.dropdown=function e(i){return this.each(function(){var t=a(this),e=t.data("bs.dropdown");e||t.data("bs.dropdown",e=new o(this)),"string"==typeof i&&e[i].call(t)})},a.fn.dropdown.Constructor=o,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=t,this},a(document).on("click.bs.dropdown.data-api",s).on("click.bs.dropdown.data-api",".dropdown form",function(t){t.stopPropagation()}).on("click.bs.dropdown.data-api",r,o.prototype.toggle).on("keydown.bs.dropdown.data-api",r,o.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",o.prototype.keydown)}(jQuery),function(a){"use strict";var s=function(t,e){this.options=e,this.$body=a(document.body),this.$element=a(t),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.fixedContent=".navbar-fixed-top, .navbar-fixed-bottom",this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};function r(o,n){return this.each(function(){var t=a(this),e=t.data("bs.modal"),i=a.extend({},s.DEFAULTS,t.data(),"object"==typeof o&&o);e||t.data("bs.modal",e=new s(this,i)),"string"==typeof o?e[o](n):i.show&&e.show(n)})}s.VERSION="3.4.1",s.TRANSITION_DURATION=300,s.BACKDROP_TRANSITION_DURATION=150,s.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},s.prototype.toggle=function(t){return this.isShown?this.hide():this.show(t)},s.prototype.show=function(i){var o=this,t=a.Event("show.bs.modal",{relatedTarget:i});this.$element.trigger(t),this.isShown||t.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){o.$element.one("mouseup.dismiss.bs.modal",function(t){a(t.target).is(o.$element)&&(o.ignoreBackdropClick=!0)})}),this.backdrop(function(){var t=a.support.transition&&o.$element.hasClass("fade");o.$element.parent().length||o.$element.appendTo(o.$body),o.$element.show().scrollTop(0),o.adjustDialog(),t&&o.$element[0].offsetWidth,o.$element.addClass("in"),o.enforceFocus();var e=a.Event("shown.bs.modal",{relatedTarget:i});t?o.$dialog.one("bsTransitionEnd",function(){o.$element.trigger("focus").trigger(e)}).emulateTransitionEnd(s.TRANSITION_DURATION):o.$element.trigger("focus").trigger(e)}))},s.prototype.hide=function(t){t&&t.preventDefault(),t=a.Event("hide.bs.modal"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(s.TRANSITION_DURATION):this.hideModal())},s.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(t){document===t.target||this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.trigger("focus")},this))},s.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("key
26266down.dismiss.bs.modal",a.proxy(function(t){27==t.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},s.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},s.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop(function(){t.$body.removeClass("modal-open"),t.resetAdjustments(),t.resetScrollbar(),t.$element.trigger("hidden.bs.modal")})},s.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},s.prototype.backdrop=function(t){var e=this,i=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var o=a.support.transition&&i;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+i).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(t){this.ignoreBackdropClick?this.ignoreBackdropClick=!1:t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide())},this)),o&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;o?this.$backdrop.one("bsTransitionEnd",t).emulateTransitionEnd(s.BACKDROP_TRANSITION_DURATION):t()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var n=function(){e.removeBackdrop(),t&&t()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",n).emulateTransitionEnd(s.BACKDROP_TRANSITION_DURATION):n()}else t&&t()},s.prototype.handleUpdate=function(){this.adjustDialog()},s.prototype.adjustDialog=function(){var t=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})},s.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},s.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth<t,this.scrollbarWidth=this.measureScrollbar()},s.prototype.setScrollbar=function(){var t=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"";var n=this.scrollbarWidth;this.bodyIsOverflowing&&(this.$body.css("padding-right",t+n),a(this.fixedContent).each(function(t,e){var i=e.style.paddingRight,o=a(e).css("padding-right");a(e).data("padding-right",i).css("padding-right",parseFloat(o)+n+"px")}))},s.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad),a(this.fixedContent).each(function(t,e){var i=a(e).data("padding-right");a(e).removeData("padding-right"),e.style.paddingRight=i||""})},s.prototype.measureScrollbar=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",this.$body.append(t);var e=t.offsetWidth-t.clientWidth;return this.$body[0].removeChild(t),e};var t=a.fn.modal;a.fn.modal=r,a.fn.modal.Constructor=s,a.fn.modal.noConflict=function(){return a.fn.modal=t,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var e=a(this),i=e.attr("href"),o=e.attr("data-target")||i&&i.replace(/.*(?=#[^\s]+$)/,""),n=a(document).find(o),s=n.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(i)&&i},n.data(),e.data());e.is("a")&&t.preventDefault(),n.one("show.bs.modal",function(t){t.isDefaultPrevented()||n.one("hidden.bs.modal",function(){e.is(":visible")&&e.trigger("focus")})}),r.call(n,s,this)})}(jQuery),function(g){"use strict";var o=["sanitize","whiteList","sanitizeFn"],a=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],t={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},r=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,l=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function u(t,e){var i=t.nodeName.toLowerCase();if(-1!==g.inArray(i,e))return-1===g.inArray(i,a)||Boolean(t.nodeValue.match(r)||t.nodeValue.match(l));for(var o=g(e).filter(function(t,e){return e instanceof RegExp}),n=0,s=o.length;n<s;
vendor: 16,510 bytes, line 26266
26266n++)if(i.match(o[n]))return!0;return!1}function n(t,e,i){if(0===t.length)return t;if(i&&"function"==typeof i)return i(t);if(!document.implementation||!document.implementation.createHTMLDocument)return t;var o=document.implementation.createHTMLDocument("sanitization");o.body.innerHTML=t;for(var n=g.map(e,function(t,e){return e}),s=g(o.body).find("*"),a=0,r=s.length;a<r;a++){var l=s[a],h=l.nodeName.toLowerCase();if(-1!==g.inArray(h,n))for(var d=g.map(l.attributes,function(t){return t}),p=[].concat(e["*"]||[],e[h]||[]),c=0,f=d.length;c<f;c++)u(d[c],p)||l.removeAttribute(d[c].nodeName);else l.parentNode.removeChild(l)}return o.body.innerHTML}var m=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",t,e)};m.VERSION="3.4.1",m.TRANSITION_DURATION=150,m.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:t},m.prototype.init=function(t,e,i){if(this.enabled=!0,this.type=t,this.$element=g(e),this.options=this.getOptions(i),this.$viewport=this.options.viewport&&g(document).find(g.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var o=this.options.trigger.split(" "),n=o.length;n--;){var s=o[n];if("click"==s)this.$element.on("click."+this.type,this.options.selector,g.proxy(this.toggle,this));else if("manual"!=s){var a="hover"==s?"mouseenter":"focusin",r="hover"==s?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,g.proxy(this.enter,this)),this.$element.on(r+"."+this.type,this.options.selector,g.proxy(this.leave,this))}}this.options.selector?this._options=g.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},m.prototype.getDefaults=function(){return m.DEFAULTS},m.prototype.getOptions=function(t){var e=this.$element.data();for(var i in e)e.hasOwnProperty(i)&&-1!==g.inArray(i,o)&&delete e[i];return(t=g.extend({},this.getDefaults(),e,t)).delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t.sanitize&&(t.template=n(t.template,t.whiteList,t.sanitizeFn)),t},m.prototype.getDelegateOptions=function(){var i={},o=this.getDefaults();return this._options&&g.each(this._options,function(t,e){o[t]!=e&&(i[t]=e)}),i},m.prototype.enter=function(t){var e=t instanceof this.constructor?t:g(t.currentTarget).data("bs."+this.type);if(e||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e)),t instanceof g.Event&&(e.inState["focusin"==t.type?"focus":"hover"]=!0),e.tip().hasClass("in")||"in"==e.hoverState)e.hoverState="in";else{if(clearTimeout(e.timeout),e.hoverState="in",!e.options.delay||!e.options.delay.show)return e.show();e.timeout=setTimeout(function(){"in"==e.hoverState&&e.show()},e.options.delay.show)}},m.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},m.prototype.leave=function(t){var e=t instanceof this.constructor?t:g(t.currentTarget).data("bs."+this.type);if(e||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e)),t instanceof g.Event&&(e.inState["focusout"==t.type?"focus":"hover"]=!1),!e.isInStateTrue()){if(clearTimeout(e.timeout),e.hoverState="out",!e.options.delay||!e.options.delay.hide)return e.hide();e.timeout=setTimeout(function(){"out"==e.hoverState&&e.hide()},e.options.delay.hide)}},m.prototype.show=function(){var t=g.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);var e=g.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(t.isDefaultPrevented()||!e)return;var i=this,o=this.tip(),n=this.getUID(this.type);this.setContent(),o.attr("id",n),this.$element.attr("aria-describedby",n),this.options.animation&&o.addClass("fade");var s="function"==typeof this.options.placement?this.options.placement.call(this,o[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,r=a.test(s);r&&(s=s.replace(a,"")||"top"),o.detach().css({top:0,left:0,display:"block"}).addClass(s).data("bs."+this.type,this),this.options.container?o.appendTo(g(document).find(this.options.container)):o.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var l=this.getPosition(),h=o[0].offsetWidth,d=o[0].offsetHeight;if(r){var p=s,c=this.getPosition(this.$viewport);s="bottom"==s&&l.bottom+d>c.bottom?"top":"top"==s&&l.top-d<c.top?"bottom":"right"==s&&l.right+h>c.width?"left":"left"==s&&l.left-h<c.left?"right":s,o.removeClass(p).addClass(s)}var f=this.getCalculatedOffset(s,l,h,d);this.applyPlacement(f,s);var u=function(){var t=i.hoverState;i.$element.trigger("shown.bs."+i.type),i.hoverState=null,"out"==t&&i.leave(i)};g.support.transition&&this.$tip.hasClass("fade")?o.one("bsTransitionEnd",u).emulateTransitionEnd(m.TRANSITION_DURATION):u()}},m.prototype.applyPlacement=function(t,e){var i=this.tip(),o=i[0].offsetWidth,n=i[0].offsetHeight,s=parseInt(i.css("margin-top"),10),a=parseInt(i.css("margin-left"),10);isNaN(s)&&(s=0),isNaN(a)&&(a=0),t.top+=s,t.left+=a,g.offset.setOffset(i[0],g.extend({using:function(t){i.css({top:Math.round(t.top),left:Math.round(t.left)})}},t),0),i.addClass("in");var r=i[0].offsetWidth,l=i[0].offsetHeight;"top"==e&&l!=n&&(t.top=t.top+n-l);var h=this.getViewportAdjustedDelta(e,t,r,l);h.left?t.left+=h.left:t.top+=h.top;var d=/top|bottom/.test(e),p=d?2*h.left-o+r:2*h.top-n+l,c=d?"offsetWidth":"offsetHeight";i.offset(t),this.replaceArrow(p,i[0][c],d)},m.prototype.replaceArrow=function(t,e,i){this.arrow().css(i?"left":"top",50*(1-t/e)+"%").css(i?"top":"left","")},m.prototype.setContent=function(){var t=this.tip(),e=this.getTitle();this.options.html?(this.options.sanitize&&(e=n(e,this.options.whiteList,this.options.sanitizeFn)),t.find(".tooltip-inner").html(e)):t.find(".tooltip-inner").text(e),t.removeClass("fade in top bottom left right")},m.prototype.hide=function(t){var e=this,i=g(this.$tip),o=g.Event("hide.bs."+this.type);function n(){"in"!=e.hoverState&&i.detach(),e.$element&&e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),t&&t()}if(this.$element.trigger(o),!o.isDefaultPrevented())return i.removeClass("in"),g.support.transition&&i.hasClass("fade")?i.one("bsTransitionEnd",n).emulateTransitionEnd(m.TRANSITION_DURATION):n(),this.hoverState=null,this},m.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},m.prototype.hasContent=function(){return this.getTitle()},m.prototype.getPosition=function(t){var e=(t=t||this.$element)[0],i="BODY"==e.tagName,o=e.getBoundingClientRect();null==o.width&&(o=g.extend({},o,{width:o.right-o.left,height:o.bottom-o.top}));var n=window.SVGElement&&e instanceof window.SVGElement,s=i?{top:0,left:0}:n?null:t.offset(),a={scroll:i?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop()},r=i?{width:g(window).width(),height:g(window).height()}:null;return g.extend({},o,a,r,s)},m.prototype.getCalculatedOffset=function(t,e,i,o){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-i/2}:"top"==t?{top:e.top-o,left:e.left+e.width/2-i/2}:"left"==t?{top:e.top+e.height/2-o/2,left:e.left-i}:{top:e.top+e.height/2-o/2,left:e.left+e.width}},m.prototype.getViewportAdjustedDelta=function(t,e,i,o){var n={top:0,left:0};if(!this.$viewport)return n;var s=this.options.viewport&&this.options.viewport.padding||0,a=this.getPosition(this.$viewport);if(/right|left/.test(t)){var r=e.top-s-a.scroll,l=e.top+s-a.scroll+o;r<a.top?n.top=a.top-r:l>a.top+a.height&&(n.top=a.top+a.height-l)}else{var h=e.left-s,d=e.left+s+i;h<a.left?n.left=a.left-h:d>a.right&&(n.left=a.left+a.width-d)}return n},m.prototype.getTitle=function(){var t=this.$element,e=this.options;return t.attr("data-original-title")||("function"==typeof e.title?e.title.call(t[0]):e.title)},m.prototype.getUID=function(t){for(;t+=~~(1e6*Math.random()),document.getElementById(t););return t},m.prototype.tip=function(){if(!this.$tip&&(this.$tip=g(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},m.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},m.prototype.enable=function(){this.enabled=!0},m.prototype.disable=function(){this.enabled=!1},m.prototype.toggleEnabled=function(){this.enabled=!this.enabled},m.prototype.toggle=function(t){var e=this;t&&((e=g(t.currentTarget).data("bs."+this.type))||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e))),t?(e.inState.click=!e.inState.click,e.isInStateTrue()?e.enter(e):e.leave(e)):e.tip().hasClass("in")?e.leave(e):e.enter(e)},m.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide(function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null,t.$element=null})},m.prototype.sanitizeHtml=function(t){return n(t,this.options.whiteList,this.options.sanitizeFn)};var e=g.fn.tooltip;g.fn.tooltip=function i(o){return this.each(function(){var t=g(this),e=t.data("bs.tooltip"),i="object"==typeof o&&o;!e&&/destroy|hide/.test(o)||(e||t.data("bs.tooltip",e=new m(this,i)),"string"==typeof o&&e[o]())})},g.fn.tooltip.Constructor=m,g.fn.tooltip.noConflict=function(){return g.fn.tooltip=e,this}}(jQuery),function(n){"use strict";var s=function(t,e){this.init("popover",t,e)};if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");s.VERSION="3.4.1",s.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),((s.prototype=n.extend({},n.fn.tooltip.Constructor.prototype)).constructor=s).prototype.getDefaults=function(){return s.DEFAULTS},s.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();if(this.options.html){var o=typeof i;this.options.sanitize&&(e=this.sanitizeHtml(e),"string"===o&&(i=this.sanitizeHtml(i))),t.find(".popover-title").html(e),t.find(".popover-content").children().detach().end()["string"===o?"html":"append"](i)}else t.find(".popover-title").text(e),t.find(".popover-content").children().detach().end().text(i);t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},s.prototype.hasContent=function(){return this.getTitle()||this.getContent()},s.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},s.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var t=n.fn.popover;n.fn.popover=function e(o){return this.each(function(){var t=n(this),e=t.data("bs.popover"),i="object"==typeof o&&o;!e&&/destroy|hide/.test(o)||(e||t.data("bs.popover",e=new s(this,i)),"string"==typeof o&&e[o]())})},n.fn.popover.Constructor=s,n.fn.popover.noConflict=function(){return n.fn.popover=t,this}}(jQuery),function(s){"use strict";function n(t,e){this.$body=s(document.body),this.$scrollElement=s(t).is(document.body)?s(window):s(t),this.options=s.extend({},n.DEFAULTS,e),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",s.proxy(this.process,this)),this.refresh(),this.process()}function e(o){return this.each(function(){var t=s(this),e=t.data("bs.scrollspy"),i="object"==typeof o&&o;e||t.data("bs.scrollspy",e=new n(this,i)),"string"==typeof o&&e[o]()})}n.VERSION="3.4.1",n.DEFAULTS={offset:10},n.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},n.prototype.refresh=function(){var t=this,o="offset",n=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),s.isWindow(this.$scrollElement[0])||(o="position",n=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var t=s(this),e=t.data("target")||t.attr("href"),i=/^#./.test(e)&&s(e);return i&&i.length&&i.is(":visible")&&[[i[o]().top+n,e]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},n.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.getScrollHeight(),o=this.options.offset+i-this.$scrollElement.height(),n=this.offsets,s=this.targets,a=this.activeTarget;if(this.scrollHeight!=i&&this.refresh(),o<=e)return a!=(t=s[s.length-1])&&this.activate(t);if(a&&e<n[0])return this.activeTarget=null,this.clear();for(t=n.length;t--;)a!=s[t]&&e>=n[t]&&(n[t+1]===undefined||e<n[t+1])&&this.activate(s[t])},n.prototype.activate=function(t){this.activeTarget=t,this.clear();var e=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=s(e).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active")),i.trigger("activate.bs.scrollspy")},n.prototype.clear=function(){s(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var t=s.fn.scrollspy;s.fn.scrollspy=e,s.fn.scrollspy.Constructor=n,s.fn.scrollspy.noConflict=function(){return s.fn.scrollspy=t,this},s(window).on("load.bs.scrollspy.data-api",function(){s('[data-spy="scroll"]').each(function(){var t=s(this);e.call(t,t.data())})})}(jQuery),function(r){"use strict";var a=function(t){this.element=r(t)};function e(i){return this.each(function(){var t=r(this),e=t.data("bs.tab");e||t.data("bs.tab",e=new a(this)),"string"==typeof i&&e[i]()})}a.VERSION="3.4.1",a.TRANSITION_DURATION=150,a.prototype.show=function(){var t=this.element,e=t.closest("ul:not(.dropdown-menu)"),i=t.data("target");if(i||(i=(i=t.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var o=e.find(".active:last a"),n=r.Event("hide.bs.tab",{relatedTarget:t[0]}),s=r.Event("show.bs.tab",{relatedTarget:o[0]});if(o.trigger(n),t.trigger(s),!s.isDefaultPrevented()&&!n.isDefaultPrevented()){var a=r(document).find(i);this.activate(t.closest("li"),e),this.activate(a,a.parent(),function(){o.trigger({type:"hidden.bs.tab",relatedTarget:t[0]}),t.trigger({type:"shown.bs.tab",relatedTarget:o[0]})})}}},a.prototype.activate=function(t,e,i){var o=e.find("> .active"),n=i&&r.support.transition&&(o.length&&o.hasClass("fade")||!!e.find("> .fade").length);function s(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),t.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),n?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu").length&&t.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),i&&i()}o.length&&n?o.one("bsTransitionEnd",s).emulateTransitionEnd(a.TRANSITION_DURATION):s(),o.removeClass("in")};var t=r.fn.tab;r.fn.tab=e,r.fn.tab.Constructor=a,r.fn.tab.noConflict=function(){return r.fn.tab=t,this};var i=function(t){t.preventDefault(),e.call(r(this),"show")};r(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(jQuery),function(l){"use strict";var h=function(t,e){this.options=l.extend({},h.DEFAULTS,e);var i=this.options.target===h.DEFAULTS.target?l(this.options.target):l(document).find(this.options.target);this.$target=i.on("scroll.bs.affix.data-api",l.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",l.proxy(this.checkPositionWithEventLoop,this)),this.$element=l(t),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};function i(o){return this.each(function(){var t=l(this),e=t.data("bs.affix"),i="object"==typeof o&&o;
26266e||t.data("bs.affix",e=new h(this,i)),"string"==typeof o&&e[o]()})}h.VERSION="3.4.1",h.RESET="affix affix-top affix-bottom",h.DEFAULTS={offset:0,target:window},h.prototype.getState=function(t,e,i,o){var n=this.$target.scrollTop(),s=this.$element.offset(),a=this.$target.height();if(null!=i&&"top"==this.affixed)return n<i&&"top";if("bottom"==this.affixed)return null!=i?!(n+this.unpin<=s.top)&&"bottom":!(n+a<=t-o)&&"bottom";var r=null==this.affixed,l=r?n:s.top;return null!=i&&n<=i?"top":null!=o&&t-o<=l+(r?a:e)&&"bottom"},h.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(h.RESET).addClass("affix");var t=this.$target.scrollTop(),e=this.$element.offset();return this.pinnedOffset=e.top-t},h.prototype.checkPositionWithEventLoop=function(){setTimeout(l.proxy(this.checkPosition,this),1)},h.prototype.checkPosition=function(){if(this.$element.is(":visible")){var t=this.$element.height(),e=this.options.offset,i=e.top,o=e.bottom,n=Math.max(l(document).height(),l(document.body).height());"object"!=typeof e&&(o=i=e),"function"==typeof i&&(i=e.top(this.$element)),"function"==typeof o&&(o=e.bottom(this.$element));var s=this.getState(n,t,i,o);if(this.affixed!=s){null!=this.unpin&&this.$element.css("top","");var a="affix"+(s?"-"+s:""),r=l.Event(a+".bs.affix");if(this.$element.trigger(r),r.isDefaultPrevented())return;this.affixed=s,this.unpin="bottom"==s?this.getPinnedOffset():null,this.$element.removeClass(h.RESET).addClass(a).trigger(a.replace("affix","affixed")+".bs.affix")}"bottom"==s&&this.$element.offset({top:n-t-o})}};var t=l.fn.affix;l.fn.affix=i,l.fn.affix.Constructor=h,l.fn.affix.noConflict=function(){return l.fn.affix=t,this},l(window).on("load",function(){l('[data-spy="affix"]').each(function(){var t=l(this),e=t.data();e.offset=e.offset||{},null!=e.offsetBottom&&(e.offset.bottom=e.offsetBottom),null!=e.offsetTop&&(e.offset.top=e.offsetTop),i.call(t,e)})})}(jQuery);
26267$(document).ready(function () {  
26268    $('.cmp-form, .page-content form').hide();
26269    $("#loadingMessageElement").remove();
26270    $( ".cmp-form" ).each(function( index ) {
26271       $(".cmp-form .form_row.show-hide").each(function(){
26272           var doShowHide = $(this).attr("data-doshowhide");
26273           if(doShowHide == "true"){
26274              var action = $(this).find('input[name="rule"]').attr("data-action");
26275               var logicCondition = $(this).find('input[name="rule"]').attr("data-compositecondition");
26276               var targetField = $(this).find('input[name="rule"]').attr("data-targetfield");
26277               initialshowhide(action,targetField);
26278				 let conditionList = [];
26279               $(this).find('input[name^="condition-"]').each(function(){
26280                   var conditionfieldName = $(this).attr("data-conditionfield");
26281                   var condition = $(this).attr("data-condition");
26282                   var conditionValue = $(this).attr("data-conditionvalue");
26283                   let conditionObject = new Object();
26284					conditionObject.fieldName = conditionfieldName;
26285					conditionObject.condition = condition;
26286					conditionObject.conditionValue = conditionValue;
26287					conditionObject.check = false;
26288                    conditionList.push(conditionObject); 
26289                    skipMandatoryHiddenFields(targetField);
26290
26291                   $( '*[name="'+conditionfieldName+'"]:not(:radio):not(:checkbox):not(select):not(select.multiselect option)' ).focusout(function() {
26292                        var value = ($(this).parent().parent().css('display') == 'none')? '':$( this ).val();
26293                        var rule = "";
26294                        if(value !==null){
26295                            for(let i=0;i<=conditionList.length-1;i++){
26296                                if(conditionList[i].fieldName == conditionfieldName){
26297                                        rule = switchBlock(conditionList[i].condition, value, conditionList[i].conditionValue);
26298                                        conditionList[i].check = rule;
26299                                }
26300                            }
26301                            showhide(conditionList,action,logicCondition,targetField);
26302                        }      
26303                        skipMandatoryHiddenFields(targetField);
26304                    });                     
26305                    
26306                    // on change event :: radio
26307                    $( 'input[type="radio"][name="'+conditionfieldName+'"]' ).on("change", function(e) {
26308                        if($(this).prop("checked")){                             
26309                            var value = ($(this).parent().parent().css('display') == 'none')? '':$( this ).val();
26310                            var rule = "";
26311                            
26312                            if(value !==null){
26313                                for(let i=0;i<=conditionList.length-1;i++){
26314                                    if(conditionList[i].fieldName == conditionfieldName){
26315                                            rule = switchBlock(conditionList[i].condition, value, conditionList[i].conditionValue);
26316                                            conditionList[i].check = rule;
26317                                    }
26318                                }
26319                                showhide(conditionList,action,logicCondition,targetField);
26320                            }
26321                        }
26322                       skipMandatoryHiddenFields(targetField);
26323                    });
26324
26325                    // on change event :: select
26326                    $( 'select[name="'+conditionfieldName+'"]' ).on("change", function(e) {                       
26327                        // 1. changed 'prop' to 'attr' for the select dropdown to render the field on select of the value instead of click outside.
26328                        if(!($(this).hasClass('multiselect'))){
26329                        var value = '';
26330                        if($(this).attr("selected", "selected")){                             
26331                            value = ($(this).parent().parent().css('display') == 'none')? '':$( this ).val();
26332                             var rule = "";                             
26333                             if(value !==null){
26334                                 for(let i=0;i<=conditionList.length-1;i++){
26335                                     if(conditionList[i].fieldName == conditionfieldName){
26336                                             rule = switchBlock(conditionList[i].condition, value, conditionList[i].conditionValue);
26337                                             conditionList[i].check = rule;
26338                                     }
26339                                 }
26340                                 showhide(conditionList,action,logicCondition,targetField);
26341                             }
26342                         }
26343                         }else{
26344                         	var value =[];
26345                         	var rule = "";
26346                         	if($(this).parent().parent().css('display') == 'none'){
26347                         		value = [];
26348                         	}
26349                         	else{
26350                         			value = $(this).val();
26351                         	}
26352                         	if(value !==null){
26353                         		for(let i=0;i<=conditionList.length-1;i++){
26354                         			if(conditionList[i].fieldName == conditionfieldName){
26355                         				rule = value.includes(conditionList[i].conditionValue);
26356                         				conditionList[i].check = rule;
26357                         			}
26358                         		}
26359                         		showhide(conditionList,action,logicCondition,targetField);
26360                            }
26361                         }
26362                        skipMandatoryHiddenFields(targetField);
26363                     });
26364
26365                    //on change event :: checkbox
26366                    $( 'input[type="checkbox"][name="'+conditionfieldName+'"]' ).on("change", function(e) {
26367                        var value = [];
26368                        var rule = "";
26369                        if($(this).parent().parent().css('display') == 'none'){         
26370                            value = [];                          
26371                         }
26372                         else{
26373                            $('input[type="checkbox"][name="'+conditionfieldName+'"]:checkbox:checked').each(function(i){                            
26374                                value[i] = $(this).val();
26375                            });
26376                         }  
26377                        
26378                        if(value !==null){
26379                            for(let i=0;i<=conditionList.length-1;i++){
26380                                if(conditionList[i].fieldName == conditionfieldName){
26381                                    rule = value.includes(conditionList[i].conditionValue);
26382                                    conditionList[i].check = rule;
26383                                }
26384                            }
26385                            showhide(conditionList,action,logicCondition,targetField);
26386                        }
26387                       skipMandatoryHiddenFields(targetField);
26388                    });                   
26389
26390                    //start of on page loads show the associated fields -------------------------------------------//
26391                    //radio : show/hide the fields
26392                    $( 'input[type="radio"][name="'+conditionfieldName+'"]' ).each( function(e) {                                              
26393                        var value = '';
26394                        if($(this).prop("checked")){
26395                            value = ($(this).parent().parent().css('display') == 'none')? '':$( this ).val();
26396                            var rule = "";                            
26397                            if(value !==null){
26398                                for(let i=0;i<=conditionList.length-1;i++){
26399                                    if(conditionList[i].fieldName == conditionfieldName){
26400                                            rule = switchBlock(conditionList[i].condition, value, conditionList[i].conditionValue);
26401                                            conditionList[i].check = rule;
26402                                    }
26403                                }
26404                                showhide(conditionList,action,logicCondition,targetField);
26405                            }
26406
26407                        }
26408                        skipMandatoryHiddenFields(targetField);
26409                    });
26410                    
26411                    //dropdown
26412                    $( 'select[name="'+conditionfieldName+'"]' ).each( function(e) {
26413                    if(!($(this).hasClass('multiselect'))){
26414                        if($(this).attr("selected", "selected")){
26415                            var value = ($(this).parent().parent().css('display') == 'none')? '':$( this ).val();
26416                            var rule = "";
26417                            if(value == conditionValue){
26418                                for(let i=0;i<=conditionList.length-1;i++){
26419                                    if(conditionList[i].fieldName == conditionfieldName){
26420                                            rule = switchBlock(conditionList[i].condition, value, conditionList[i].conditionValue);
26421                                            conditionList[i].check = rule;
26422                                    }
26423                                }
26424                                showhide(conditionList,action,logicCondition,targetField);
26425                            }
26426                        }
26427                        }else{
26428                        	var value =[];
26429                        	var rule = "";
26430                        	if($(this).parent().parent().css('display') == 'none'){
26431                        		value = [];
26432                        	}
26433                        	else{
26434                        			value = $(this).val();
26435                        	}
26436                        	if(value !==null){
26437                        		for(let i=0;i<=conditionList.length-1;i++){
26438                        			if(conditionList[i].fieldName == conditionfieldName){
26439                        				rule = value.includes(conditionList[i].conditionValue);
26440                        				conditionList[i].check = rule;
26441                        			}
26442                        		}
26443                        		showhide(conditionList,action,logicCondition,targetField);
26444                        	}
26445                        }
26446                       skipMandatoryHiddenFields(targetField);
26447                    });
26448                    //end of on page loads show the associated fields -------------------------------------------//
26449               });
26450
26451           }
26452       });
26453   });
26454
26455   function showhide(conditionListGroup,action,logicCondition,targetField, conditionfieldName){
26456       var answer = conditionListGroup[0].check;
26457       if(logicCondition =="all"){
26458            for(let i=0;i<conditionListGroup.length;i++){
26459                answer = (answer&conditionListGroup[i].check);
26460            }
26461       }else{
26462        for(let i=0;i<conditionListGroup.length;i++){
26463            answer = (answer | conditionListGroup[i].check);
26464        }
26465       }
26466       if(answer == true){
26467           if(action == "show"){
26468               $( '*[name="'+targetField+'"]' ).parent().parent().show();
26469               if($('*[name="'+targetField+'"]').prop("checked") || $('*[name="'+targetField+'"]').attr("selected") || $('*[name="'+targetField+'"]').attr("multiple")){
26470                    $( '*[name="'+targetField+'"]' ).trigger("change");
26471                }
26472                $( '*[name="'+targetField+'"]' ).trigger("focusout");
26473           }else{
26474               $( '*[name="'+targetField+'"]' ).parent().parent().hide();
26475               if($('*[name="'+targetField+'"]').prop("checked") || $('*[name="'+targetField+'"]').attr("selected") || $('*[name="'+targetField+'"]').attr("multiple")){
26476                 $( '*[name="'+targetField+'"]' ).trigger("change");               	  
26477                }
26478                $( '*[name="'+targetField+'"]' ).trigger("focusout");
26479           }
26480       }else{
26481           if(action == "show"){
26482               $( '*[name="'+targetField+'"]' ).parent().parent().hide();
26483               if($('*[name="'+targetField+'"]').prop("checked") || $('*[name="'+targetField+'"]').attr("selected") || $('*[name="'+targetField+'"]').attr("multiple")){
26484                   $( '*[name="'+targetField+'"]' ).trigger("change");               	  
26485               }
26486               $( '*[name="'+targetField+'"]' ).trigger("focusout");
26487           }else{
26488               $( '*[name="'+targetField+'"]' ).parent().parent().show();
26489               if($('*[name="'+targetField+'"]').prop("checked") || $('*[name="'+targetField+'"]').attr("selected") || $('*[name="'+targetField+'"]').attr("multiple")){
26490                   $( '*[name="'+targetField+'"]' ).trigger("change");
26491               	   
26492               }
26493               $( '*[name="'+targetField+'"]' ).trigger("focusout");
26494           }
26495       }
26496
26497   }
26498   function initialshowhide(action,targetField){
26499       if(action == "show"){
26500           $( '*[name="'+targetField+'"]' ).parent().parent().hide();
26501       }else{
26502           $( '*[name="'+targetField+'"]' ).parent().parent().show();
26503       }
26504   }
26505
26506   function switchBlock(condition, value, conditionValue){
26507       let rule = false;
26508       switch (condition) {
26509           case "isEqualTo":
26510               rule = (value == conditionValue)?true:false;
26511               break;
26512           case "isNotEqualTo":
26513               rule = (value!=conditionValue)?true:false;
26514               break;
26515           case "isLessThan":
26516               rule = (value<conditionValue)?true:false;
26517               break;
26518           case "isLessThanOrEqual":
26519               rule = (value<=conditionValue)?true:false;
26520               break;
26521           case "isGreaterThan":
26522               rule = (value>conditionValue)?true:false;
26523               break;
26524           case "isGreaterThanOrEqual":
26525               rule = (value>=conditionValue)?true:false;
26526               break;
26527           case "startsWith":
26528               rule = (value.startsWith(conditionValue))?true:false;
26529               break;
26530           case "endsWith":
26531               rule = test(value, conditionValue, 'endsWith');
26532               break;
26533           case "contains":
26534               rule = test(value, conditionValue, 'contains');
26535               break;
26536       }
26537       return rule;
26538   }
26539   let test = (value, conditionValue, caseName) => {
26540       if(caseName === 'endsWith'){
26541           return value.endsWith(conditionValue);
26542       }else{
26543           return value.includes(conditionValue);
26544       }
26545   }
26546});
26547
26548function skipMandatoryHiddenFields(targetField){  
26549    $( '*[name="'+targetField+'"]' ).each(function(){       
26550        if($(this).parent().parent().css('display') !== 'block'){
26551            $(this).prop('required', false);       
26552            $(this).parent().parent().removeClass('has-error');
26553            $(this).parent().parent().parent().removeClass('has-error');
26554            $(this).parent().parent().parent().parent().removeClass('has-error');
26555            $(this).parents().find('.validation-box').remove();            
26556        }else{
26557            $(this).prop('required', true);     
26558            $('input[name="'+targetField+'"][type="hidden"]').prop('required', false);  
26559            if($(this).parent().parent().find('.required-asterisk').text() !== '*'){
26560                $(this).prop('required', false);
26561            }
26562        }        
26563    });
26564
26565    $('input[name="'+targetField+'"][type="radio"]').each(function(){
26566        if($(this).parent().parent().css('display') == 'none'){
26567            $(this).prop('required', false);
26568            $(this).removeClass("required");
26569        }else{
26570            $(this).prop('required', true);
26571            $(this).addClass("required");
26572        }
26573    });
26574
26575    $('input[name="'+targetField+'"][type="checkbox"]').each(function(){
26576        if($(this).parent().parent().css('display') == 'none'){
26577            $(this).removeClass("required");
26578        }else{
26579            $(this).prop('required', false);
26580            // $(this).addClass("required");
26581            $(this).removeAttr('required');
26582
26583            if($(this).parent().parent().find('.required-asterisk').text() === '*'){
26584                $(this).addClass("required");
26585            }
26586        }
26587    });
26588
26589    $('select[name="'+targetField+'"]').each(function(){
26590        if($(this).attr("multiple")){
26591            if($(this).parent().css('display') !== 'block'){
26592                $(this).prop('required', false);
26593                $(this).removeClass("required"); 
26594            }else{
26595                $(this).prop('required', true);
26596            }
26597        } else{
26598            if($(this).parent().parent().css('display') !== 'block'){
26599                $(this).prop('required', false);
26600            }else{
26601                if($(this).parent().parent().find('.required-asterisk').text() !== '*'){
26602                    $(this).prop('required', false);
26603                } else {
26604                    $(this).prop('required', true);
26605                }
26606            }
26607        }       
26608    });
26609}
26610
26611var fetchForm = () => {
26612    let forms = $("form");
26613    let loadingMessaage = 'The form fields are loading, please wait.';
26614    let loadingMessageElement = `<p id='loadingMessageElement' style='font-size: 15px;padding: 10px 10px;'>`;
26615    loadingMessageElement += `<span class='fa fa-spinner fa-spin' style='margin-right:10px;'></span>`;
26616    loadingMessageElement += `<span aria-live='polite'>${loadingMessaage}</span></p>`;
26617
26618    $(forms).each(function(){
26619       $(this).attr("name") ? $(this).addClass("cmp-form") : '';      
26620    });
26621    $('.cmp-form', $(this).attr("name")).hide();
26622    $('.cmp-form:eq(0)').after(loadingMessageElement);
26623}
26624
26625var renderForm = () =>{
26626    $('.cmp-form, .page-content form').show();
26627    $(".cmp-form", $(this).attr("name")).show();
26628    $("#loadingMessageElement").hide();
26629}
26630
26631$(document).ready(function() {
26632    $("#loadingMessageElement").each(function(){
26633        $('[id="'+ this.id +'"]:gt(0)').remove();
26634    });
26635
26636    $('.cmp-form').each(function(){
26637        $(this).parent().addClass('form-container-width-fluid'); 
26638        $(this).parent().parent().addClass('form-container-width-fluid'); 
26639     });
26640});
26641
26642$(function(){
26643    fetchForm();
26644});
26645
26646$(window).load(function(){
26647    $("#loadingMessageElement").each(function(){
26648        $('[id="'+ this.id +'"]:gt(0)').remove();
26649    });
26650    renderForm();
26651})
26652
26653// Carousel Extension
26654  // ===============================
26655$( document ).ready(function() {
26656      $('.carousel').each(function (index) {
26657        // This function positions a highlight box around the tabs in the tablist to use in focus styling
26658
26659        function setTablistHighlightBox() {
26660
26661          var $tab
26662              , offset
26663              , height
26664              , width
26665              , highlightBox = {}
26666
26667            highlightBox.top     = 0
26668          highlightBox.left    = 32000
26669          highlightBox.height  = 0
26670          highlightBox.width   = 0
26671
26672          for (var i = 0; i < $tabs.length; i++) {
26673            $tab = $tabs[i]
26674            offset = $($tab).offset()
26675            height = $($tab).height()
26676            width  = $($tab).width()
26677
26678//            console.log(" Top: " + offset.top + " Left: " + offset.left + " Height: " + height + " Width: " + width)
26679
26680            if (highlightBox.top < offset.top) {
26681              highlightBox.top    = Math.round(offset.top)
26682            }
26683
26684            if (highlightBox.height < height) {
26685              highlightBox.height = Math.round(height)
26686            }
26687
26688            if (highlightBox.left > offset.left) {
26689              highlightBox.left = Math.round(offset.left)
26690            }
26691
26692            var w = (offset.left - highlightBox.left) + Math.round(width)
26693
26694            if (highlightBox.width < w) {
26695              highlightBox.width = w
26696            }
26697
26698          } // end for
26699
26700//          console.log("[HIGHLIGHT]  Top: " +  highlightBox.top + " Left: " +  highlightBox.left + " Height: " +  highlightBox.height + " Width: " +  highlightBox.width)
26701
26702          $tablistHighlight.style.top    = (highlightBox.top    - 2)  + 'px'
26703          $tablistHighlight.style.left   = (highlightBox.left   - 2)  + 'px'
26704          $tablistHighlight.style.height = (highlightBox.height + 7)  + 'px'
26705          $tablistHighlight.style.width  = (highlightBox.width  + 8)  + 'px'
26706
26707        } // end function
26708
26709        var $this = $(this)
26710          , $prev        = $this.find('[data-slide="prev"]')
26711          , $next        = $this.find('[data-slide="next"]')
26712          , $tablist    = $this.find('.carousel-indicators')
26713          , $tabs       = $this.find('.carousel-indicators li')
26714          , $tabpanels  = $this.find('.item')
26715          , $tabpanel
26716          , $tablistHighlight
26717          , $pauseCarousel
26718          , $complementaryLandmark
26719          , $tab
26720          , $is_paused = false
26721          , offset
26722          , height
26723          , width
26724          , i
26725          , id_title  = 'id_title'
26726          , id_desc   = 'id_desc'
26727
26728
26729        $tablist.attr('role', 'tablist')
26730
26731        $tabs.focus(function() {
26732          $this.carousel('pause')
26733          $is_paused = true
26734          $pauseCarousel.innerHTML = "Play Carousel"
26735          $(this).parent().addClass('active');
26736//          $(this).addClass('focus')
26737          setTablistHighlightBox()
26738          $($tablistHighlight).addClass('focus')
26739          $(this).parents('.carousel').addClass('contrast')
26740        })
26741
26742        $tabs.blur(function(event) {
26743          $(this).parent().removeClass('active');
26744//          $(this).removeClass('focus')
26745          $($tablistHighlight).removeClass('focus')
26746          $(this).parents('.carousel').removeClass('contrast')
26747        })
26748
26749
26750        for (i = 0; i < $tabpanels.length; i++) {
26751          $tabpanel = $tabpanels[i]
26752          $tabpanel.setAttribute('role', 'tabpanel')
26753          $tabpanel.setAttribute('id', 'tabpanel-' + index + '-' + i)
26754          $tabpanel.setAttribute('aria-labelledby', 'tab-' + index + '-' + i)
26755        }
26756
26757        if (typeof $this.attr('role') !== 'string') {
26758          $this.attr('role', 'complementary');
26759          $this.attr('aria-labelledby', id_title);
26760          $this.attr('aria-describedby', id_desc);
26761          $this.prepend('<p  id="' + id_desc   + '" class="sr-only">A carousel is a rotating set of images, rotation stops on keyboard focus on carousel tab controls or hovering the mouse pointer over images.  Use the tabs or the previous and next buttons to change the displayed slide.</p>')
26762          $this.prepend('<h2 id="' + id_title  + '" class="sr-only">Carousel content with ' + $tabpanels.length + ' slides.</h2>')
26763        }
26764
26765
26766        for (i = 0; i < $tabs.length; i++) {
26767          $tab = $tabs[i]
26768
26769          $tab.setAttribute('role', 'tab')
26770          $tab.setAttribute('id', 'tab-' + index + '-' + i)
26771          $tab.setAttribute('aria-controls', 'tabpanel-' + index + '-' + i)
26772
26773          var tpId = '#tabpanel-' + index + '-' + i
26774          var caption = $this.find(tpId).find('h1').text()
26775
26776          if ((typeof caption !== 'string') || (caption.length === 0)) caption = $this.find(tpId).text()
26777          if ((typeof caption !== 'string') || (caption.length === 0)) caption = $this.find(tpId).find('h3').text()
26778          if ((typeof caption !== 'string') || (caption.length === 0)) caption = $this.find(tpId).find('h4').text()
26779          if ((typeof caption !== 'string') || (caption.length === 0)) caption = $this.find(tpId).find('h5').text()
26780          if ((typeof caption !== 'string') || (caption.length === 0)) caption = $this.find(tpId).find('h6').text()
26781          if ((typeof caption !== 'string') || (caption.length === 0)) caption = "no title";
26782
26783//          console.log("CAPTION: " + caption )
26784
26785          var tabName = document.createElement('span')
26786          tabName.setAttribute('class', 'sr-only')
26787          tabName.innerHTML='Slide ' + (i+1)
26788          if (caption) tabName.innerHTML += ": " +  caption
26789          $tab.appendChild(tabName)
26790
26791         }
26792
26793        // create div for focus styling of tablist
26794        $tablistHighlight = document.createElement('div')
26795        $tablistHighlight.className = 'carousel-tablist-highlight'
26796        document.body.appendChild($tablistHighlight)
26797
26798        // create button for screen reader users to stop rotation of carousel
26799
26800        // create button for screen reader users to pause carousel for virtual mode review
26801        $complementaryLandmark = document.createElement('article')
26802        $complementaryLandmark.setAttribute('class', 'carousel-aside-pause')
26803        $complementaryLandmark.setAttribute('aria-label', 'carousel pause/play control')
26804        $this.prepend($complementaryLandmark)
26805
26806        $pauseCarousel = document.createElement('button')
26807        $pauseCarousel.className = "carousel-pause-button"
26808        $pauseCarousel.innerHTML = "Pause Carousel"
26809        $pauseCarousel.setAttribute('title', "Pause/Play carousel button can be used by screen reader users to stop carousel animations")
26810        $($complementaryLandmark).append($pauseCarousel)
26811
26812        $($pauseCarousel).click(function() {
26813          if ($is_paused) {
26814            $pauseCarousel.innerHTML = "Pause Carousel"
26815            $this.carousel('cycle')
26816            $is_paused = false
26817          }
26818          else {
26819            $pauseCarousel.innerHTML = "Play Carousel"
26820            $this.carousel('pause')
26821            $is_paused = true
26822          }
26823        })
26824        $($pauseCarousel).focus(function() {
26825          $(this).addClass('focus')
26826        })
26827
26828        $($pauseCarousel).blur(function() {
26829          $(this).removeClass('focus')
26830        })
26831
26832        setTablistHighlightBox()
26833
26834        $( window ).resize(function() {
26835          setTablistHighlightBox()
26836        })
26837
26838        // Add space bar behavior to prev and next buttons for SR compatibility
26839        $prev.attr('aria-label', 'Previous Slide')
26840        $prev.keydown(function(e) {
26841          var k = e.which || e.keyCode
26842          if (/(13|32)/.test(k)) {
26843            e.preventDefault()
26844            e.stopPropagation()
26845            $prev.trigger('click');
26846          }
26847        });
26848
26849        $prev.focus(function() {
26850          $(this).parents('.carousel').addClass('contrast')
26851        })
26852
26853        $prev.blur(function() {
26854          $(this).parents('.carousel').removeClass('contrast')
26855        })
26856
26857        $next.attr('aria-label', 'Next Slide')
26858        $next.keydown(function(e) {
26859          var k = e.which || e.keyCode
26860          if (/(13|32)/.test(k)) {
26861            e.preventDefault()
26862            e.stopPropagation()
26863            $next.trigger('click');
26864          }
26865        });
26866
26867        $next.focus(function() {
26868          $(this).parents('.carousel').addClass('contrast')
26869        })
26870
26871        $next.blur(function() {
26872          $(this).parents('.carousel').removeClass('contrast')
26873        })
26874
26875        $('.carousel-inner a').focus(function() {
26876          $(this).parents('.carousel').addClass('contrast')
26877        })
26878
26879         $('.carousel-inner a').blur(function() {
26880          $(this).parents('.carousel').removeClass('contrast')
26881        })
26882
26883        $tabs.each(function () {
26884          var item = $(this)
26885          if(item.hasClass('active')) {
26886            item.attr({ 'aria-selected': 'true', 'tabindex' : '0' })
26887          }else{
26888            item.attr({ 'aria-selected': 'false', 'tabindex' : '-1' })
26889          }
26890        })
26891      })
26892
26893      var slideCarousel = $.fn.carousel.Constructor.prototype.slide
26894      $.fn.carousel.Constructor.prototype.slide = function (type, next) {
26895        var $element = this.$element
26896          , $active  = $element.find('[role=tabpanel].active')
26897          , $next    = next || $active[type]()
26898          , $tab
26899          , $tab_count = $element.find('[role=tabpanel]').size()
26900          , $prev_side = $element.find('[data-slide="prev"]')
26901          , $next_side = $element.find('[data-slide="next"]')
26902          , $index      = 0
26903          , $prev_index = $tab_count -1
26904          , $next_index = 1
26905          , $id
26906
26907        if ($next && $next.attr('id')) {
26908          $id = $next.attr('id')
26909          $index = $id.lastIndexOf("-")
26910          if ($index >= 0) $index = parseInt($id.substring($index+1), 10)
26911
26912          $prev_index = $index - 1
26913          if ($prev_index < 1) $prev_index = $tab_count - 1
26914
26915          $next_index = $index + 1
26916          if ($next_index >= $tab_count) $next_index = 0
26917        }
26918
26919        $prev_side.attr('aria-label', 'Show slide ' + ($prev_index+1) + ' of ' + $tab_count)
26920        $next_side.attr('aria-label', 'Show slide ' + ($next_index+1) + ' of ' + $tab_count)
26921
26922
26923        slideCarousel.apply(this, arguments)
26924
26925      $active
26926        .one('bsTransitionEnd', function () {
26927          var $tab
26928
26929          $tab = $element.find('li[aria-controls="' + $active.attr('id') + '"]')
26930          if ($tab) $tab.attr({'aria-selected':false, 'tabIndex': '-1'})
26931
26932          $tab = $element.find('li[aria-controls="' + $next.attr('id') + '"]')
26933          if ($tab) $tab.attr({'aria-selected': true, 'tabIndex': '0'})
26934
26935       })
26936      }
26937
26938     var $this;
26939     $.fn.carousel.Constructor.prototype.keydown = function (e) {
26940
26941     $this = $this || $(this)
26942     if(this instanceof Node) $this = $(this)
26943
26944     function selectTab(index) {
26945       if (index >= $tabs.length) return
26946       if (index < 0) return
26947
26948       $carousel.carousel(index)
26949       setTimeout(function () {
26950            $tabs[index].focus()
26951            // $this.prev().focus()
26952       }, 150)
26953     }
26954
26955     var $carousel = $(e.target).closest('.carousel')
26956      , $tabs      = $carousel.find('[role=tab]')
26957      , k = e.which || e.keyCode
26958      , index
26959
26960      if (!/(37|38|39|40)/.test(k)) return
26961
26962      index = $tabs.index($tabs.filter('.active'))
26963      if (k == 37 || k == 38) {                           //  Up
26964        index--
26965        selectTab(index);
26966      }
26967
26968      if (k == 39 || k == 40) {                          // Down
26969        index++
26970        selectTab(index);
26971      }
26972
26973      e.preventDefault()
26974      e.stopPropagation()
26975    }
26976 
26977    $(document).on('keydown.carousel.data-api', 'li[role=tab]', $.fn.carousel.Constructor.prototype.keydown);
26978});
26979/*!
26980 * jQuery Cookie Plugin v1.3.1
26981 * https://github.com/carhartl/jquery-cookie
26982 *
26983 * Copyright 2013 Klaus Hartl
26984 * Released under the MIT license
26985 */
26986(function ($, document, undefined) {
26987
26988    var pluses = /\+/g;
26989
26990    function raw(s) {
26991        return s;
26992    }
26993
26994    function decoded(s) {
26995        return unRfc2068(decodeURIComponent(s.replace(pluses, ' ')));
26996    }
26997
26998    function unRfc2068(value) {
26999        if (value.indexOf('"') === 0) {
27000            // This is a quoted cookie as according to RFC2068, unescape
27001            value = value.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
27002        }
27003        return value;
27004    }
27005
27006    function fromJSON(value) {
27007        return config.json ? JSON.parse(value) : value;
27008    }
27009
27010    var config = $.cookie = function (key, value, options) {
27011
27012        // write
27013        if (value !== undefined) {
27014            options = $.extend({}, config.defaults, options);
27015
27016            if (value === null) {
27017                options.expires = -1;
27018            }
27019
27020            if (typeof options.expires === 'number') {
27021                var days = options.expires, t = options.expires = new Date();
27022                t.setDate(t.getDate() + days);
27023            }
27024
27025            value = config.json ? JSON.stringify(value) : String(value);
27026
27027            return (document.cookie = [
27028                encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value),
27029                options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
27030                options.path ? '; path=' + options.path : '',
27031                options.domain ? '; domain=' + options.domain : '',
27032                options.secure ? '; secure' : ''
27033            ].join(''));
27034        }
27035
27036        // read
27037        var decode = config.raw ? raw : decoded;
27038        var cookies = document.cookie.split('; ');
27039        var result = key ? null : {};
27040        for (var i = 0, l = cookies.length; i < l; i++) {
27041            var parts = cookies[i].split('=');
27042            var name = decode(parts.shift());
27043            var cookie = decode(parts.join('='));
27044
27045            if (key && key === name) {
27046                result = fromJSON(cookie);
27047                break;
27048            }
27049
27050            if (!key) {
27051                result[name] = fromJSON(cookie);
27052            }
27053        }
27054
27055        return result;
27056    };
27057
27058    config.defaults = {};
27059
27060    $.removeCookie = function (key, options) {
27061        if ($.cookie(key) !== null) {
27062            $.cookie(key, null, options);
27063            return true;
27064        }
27065        return false;
27066    };
27067
27068})(jQuery, document);
27069
27070/*! jQuery Mobile v1.4.3 | Copyright 2010, 2014 jQuery Foundation, Inc. | jquery.org/license */
27071
27072(function(e,t,n){typeof define=="function"&&define.amd?define(["jquery"],function(r){return n(r,e,t),r.mobile}):n(e.jQuery,e,t)})(this,document,function(e,t,n,r){(function(e){e.event.special.throttledresize={setup:function(){e(this).bind("resize",n)},teardown:function(){e(this).unbind("resize",n)}};var t=250,n=function(){s=(new Date).getTime(),o=s-r,o>=t?(r=s,e(this).trigger("throttledresize")):(i&&clearTimeout(i),i=setTimeout(n,t-o))},r=0,i,s,o})(e)});
27073// js and jquery for interactive page elements
27074
27075
27076//mobile navigation
27077jQuery(document).ready(function () {
27078    //adjust height of shwocase image
27079    adjustShowcase();
27080    // Bind an event handler to window throttledresize event that, when triggered,
27081    // passes a reference of itself that is accessible by the callback function.
27082    $(window).on("throttledresize", adjustShowcase);
27083
27084
27085    $('.mobile-search-button').click(function () {
27086        $('.xs-global-nav > .mobile-search').toggle();
27087        $('.xs-modal-backdrop').toggle();
27088    });
27089
27090    /* Medicaid mobile menu js */
27091    $('.mobile-nav-button').click(function () {
27092        $('.xs-global-nav > div.mobilesidenavigation > ul').toggle();
27093    });
27094
27095    /* Ambetter mobile menu js*/
27096    $('.mobile-nav-button').click(function () {
27097        $('.xs-global-nav > div.mobiletopnavigation > #top_nav > ul').toggle();
27098    });
27099
27100    /* Ambetter Redesign mobile menu js*/
27101    $('.ambetter-header-right-nav').ready(function(){
27102        var rightNavButton = $('#ambetter-desktop-header .ambetter-header-right-nav .button').clone();
27103        if ($('#ambetter-mobile-header .ambetter-header-left-nav').length){
27104            $('#ambetter-mobile-header .ambetter-header-left-nav').before(rightNavButton);
27105        } else {
27106            $('#ambetter-mobile-header .ambetter-header-right-nav').before(rightNavButton);
27107        }
27108    })
27109    $('#ambetter-mobile-header').ready(function(){
27110        $('#ambetter-mobile-menu').hide();
27111    });
27112
27113    function ambetterPickHeader(_mediaBreakpoint) {
27114        if (_mediaBreakpoint.matches) {
27115            $('.mobile-menu-button').show();
27116        } else {
27117            $('.mobile-menu-button').hide();
27118        }
27119    }
27120
27121    var mediaBreakpoint = window.matchMedia("(max-width: 992px)");
27122    ambetterPickHeader(mediaBreakpoint);
27123    mediaBreakpoint.addListener(ambetterPickHeader);
27124
27125    /* Global mobile menu js*/
27126    $('.mobile-nav-button').click(function () {
27127        $('.xs-global-nav > div.mobiletopnavigation > ul').toggle();
27128    });
27129
27130    $('.curtain').click(function () {
27131        $('.xs-global-nav > ul').toggle();
27132        $(this).toggle();
27133    });
27134
27135    $('.first-level-sidebar-nav .parent-page-title a .glyphicon').click(function () {
27136        $('.sub-item').toggle();
27137    });
27138
27139    $('.sub-item a .glyphicon').click(function () {
27140        $(this).parent().children('.second-level-nav').toggle();
27141    });
27142
27143    //mobile icon switch / expander
27144    $('.xs-global-nav a, .mobilesidenav a, .homepageNav a').on('click', '.glyphicon', function (e) {
27145        //switched to children rather than find to only open menu items one level down
27146        $(this).parent('a').parent('li').children('ul').toggle();
27147        if ($(this).hasClass('glyphicon-plus-sign')) {
27148            $(this).addClass('glyphicon-minus-sign').removeClass('glyphicon-plus-sign');
27149        } else {
27150            $(this).addClass('glyphicon-plus-sign').removeClass('glyphicon-minus-sign');
27151        }
27152        e.stopPropagation();
27153        return false;
27154    });
27155
27156    $('.xs-global-nav a .glyphicon, .mobilesidenav a .glyphicon, .homepageNav a .glyphicon').keydown(function (e) {
27157        if (e.keyCode == 13) {
27158            //$(this).trigger('click') causes Firefox to execute the parent anchor element
27159            //tried to make this one function, but Chrome and Firefox wouldn't cooperate
27160            $(this).parent('a').parent('li').children('ul').toggle();
27161            if ($(this).hasClass('glyphicon-plus-sign')) {
27162                $(this).addClass('glyphicon-minus-sign').removeClass('glyphicon-plus-sign');
27163            } else {
27164                $(this).addClass('glyphicon-plus-sign').removeClass('glyphicon-minus-sign');
27165            }
27166            e.stopPropagation();
27167            return false;
27168        }
27169    });
27170
27171    //start keyboard accessible top nav
27172    $('.global-nav li').on('mouseenter', function () {
27173        $(this).children('ul').show();
27174        $(this).children('.glyphicon').attr('aria-expanded', 'true');
27175        $(this).children('.glyphicon').addClass('glyphicon-chevron-up').removeClass('glyphicon-chevron-down');
27176    });
27177
27178    $('.global-nav li').on('mouseleave', function () {
27179        if ($(this).closest(".topnavigation").length){
27180            //do nothing
27181        } else {
27182            $(this).children('ul').hide();
27183        }
27184        $(this).children('.glyphicon').attr('aria-expanded', 'false');
27185        $(this).children('.glyphicon').addClass('glyphicon-chevron-down').removeClass('glyphicon-chevron-up');
27186    });
27187
27188    $('.global-nav li a .glyphicon').on('focus', function () {
27189        $(this).css('width', '19px');
27190        $(this).css('color', 'white');
27191    });
27192    $('.global-nav li a .glyphicon').on('blur', function () {
27193        $(this).css('width', '0px');
27194        $(this).css('color', 'transparent');
27195    });
27196
27197    $('.global-nav li a .glyphicon').keydown(function (e) {
27198        if (e.keyCode == 13) {
27199            $(this).parent('a').parent('li').children('ul').toggle();
27200            if ($(this).attr('aria-expanded') == 'false') {
27201                $(this).attr('aria-expanded', 'true');
27202            } else {
27203                $(this).attr('aria-expanded', 'false');
27204            }
27205            if ($(this).hasClass('glyphicon-chevron-down')) {
27206                $(this).addClass('glyphicon-chevron-up').removeClass('glyphicon-chevron-down');
27207            } else {
27208                $(this).addClass('glyphicon-chevron-down').removeClass('glyphicon-chevron-up');
27209            }
27210            e.stopPropagation();
27211            return false;
27212        }
27213    });
27214    //end keyboard accessible top nav
27215
27216    //start flyoutmenu accessible top nav
27217    let menuItems1 = document.querySelectorAll('.flyoutmenu li.has-submenu');
27218    let timer2;
27219    let parentPageTitle = document.querySelectorAll('.flyoutmenu li.parent-page-title');
27220    if (parentPageTitle.length > 0) {
27221        parentPageTitle[0].parentNode.classList.add("closeMobile");
27222        let activatingParentPageA = parentPageTitle[0].querySelector('a');
27223        let parentBtn = '<button class="glyphicon glyphicon-plus-sign" aria-label="' + activatingParentPageA.textContent.trim() + '"></button>';
27224        activatingParentPageA.insertAdjacentHTML('afterend', parentBtn);
27225        parentPageTitle[0].querySelector('button').addEventListener("click", function(event){
27226            if (parentPageTitle[0].querySelector('button').className.lastIndexOf("glyphicon-plus-sign") == -1) {
27227                parentPageTitle[0].parentNode.querySelector('a').setAttribute('aria-expanded', "false");
27228                parentPageTitle[0].parentNode.querySelector('button').setAttribute('aria-expanded', "false");
27229                parentPageTitle[0].querySelector('button').classList.remove("glyphicon-minus-sign");
27230                parentPageTitle[0].querySelector('button').classList.add("glyphicon-plus-sign");
27231                parentPageTitle[0].parentNode.classList.add("closeMobile");
27232                parentPageTitle[0].parentNode.classList.remove("openMobile");
27233            } else {
27234                parentPageTitle[0].parentNode.querySelector('a').setAttribute('aria-expanded', "true");
27235                parentPageTitle[0].parentNode.querySelector('button').setAttribute('aria-expanded', "true");
27236                parentPageTitle[0].querySelector('button').classList.remove("glyphicon-plus-sign");
27237                parentPageTitle[0].querySelector('button').classList.add("glyphicon-minus-sign");
27238                parentPageTitle[0].parentNode.classList.add("openMobile");
27239                parentPageTitle[0].parentNode.classList.remove("closeMobile");
27240            }
27241            event.preventDefault();
27242        });
27243    }
27244    Array.prototype.forEach.call(menuItems1, function(el){
27245        let activatingA = el.querySelector('a');
27246        let isGlobalNav = el.closest(".global-nav");
27247        let btn;
27248        if(isGlobalNav) {
27249            btn = '<button class="glyphicon glyphicon-chevron-down" aria-label="' + activatingA.text + '"></button>';
27250        } else {
27251            btn = '<button class="glyphicon glyphicon-plus-sign" aria-label="' + activatingA.text + '"></button>';
27252        }
27253        activatingA.insertAdjacentHTML('afterend', btn);
27254        if(el.closest("li").classList.contains("open")) {
27255            el.querySelector('a').setAttribute('aria-expanded', "true");
27256            el.querySelector('button').setAttribute('aria-expanded', "true");
27257            el.querySelector('button').classList.remove("glyphicon-plus-sign");
27258            el.querySelector('button').classList.add("glyphicon-minus-sign");
27259        }
27260        if(isGlobalNav) {
27261            el.addEventListener("mouseover", function(){
27262                this.className = "has-submenu open";
27263                this.querySelector('a').setAttribute('aria-expanded', "true");
27264                this.querySelector('button').setAttribute('aria-expanded', "true");
27265                this.querySelector('button').classList.remove("glyphicon-chevron-down");
27266                this.querySelector('button').classList.add("glyphicon-chevron-up");
27267            });
27268            el.addEventListener("mouseout", function(){
27269                document.querySelector('.flyoutmenu .has-submenu.open a').setAttribute('aria-expanded', "false");
27270                document.querySelector('.flyoutmenu .has-submenu.open button').setAttribute('aria-expanded', "false");
27271                document.querySelector(".flyoutmenu .has-submenu.open").className = "has-submenu";
27272                this.querySelector('button').classList.remove("glyphicon-chevron-up");
27273                this.querySelector('button').classList.add("glyphicon-chevron-down");
27274            });
27275        }
27276        el.querySelector('button').addEventListener("click", function(event){
27277            if (this.parentNode.className.lastIndexOf("open") == -1) {
27278                this.parentNode.classList.add("open");
27279                this.parentNode.querySelector('a').setAttribute('aria-expanded', "true");
27280                this.parentNode.querySelector('button').setAttribute('aria-expanded', "true");
27281                if(isGlobalNav) {
27282                    this.parentNode.querySelector('button').classList.remove("glyphicon-chevron-down");
27283                    this.parentNode.querySelector('button').classList.add("glyphicon-chevron-up");
27284                } else {
27285                    this.parentNode.querySelector('button').classList.remove("glyphicon-plus-sign");
27286                    this.parentNode.querySelector('button').classList.add("glyphicon-minus-sign");
27287                }
27288            } else {
27289                this.parentNode.classList.remove("open");
27290                this.parentNode.querySelector('a').setAttribute('aria-expanded', "false");
27291                this.parentNode.querySelector('button').setAttribute('aria-expanded', "false");
27292                if(isGlobalNav) {
27293                    this.parentNode.querySelector('button').classList.remove("glyphicon-chevron-up");
27294                    this.parentNode.querySelector('button').classList.add("glyphicon-chevron-down");
27295                } else {
27296                    this.parentNode.querySelector('button').classList.remove("glyphicon-minus-sign");
27297                    this.parentNode.querySelector('button').classList.add("glyphicon-plus-sign");
27298                }
27299            }
27300            event.preventDefault();
27301        });
27302        let links = el.querySelectorAll('a');
27303        Array.prototype.forEach.call(links, function(_el){
27304            _el.addEventListener("focus", function() {
27305                if (timer2) {
27306                    clearTimeout(timer2);
27307                    timer2 = null;
27308                }
27309            });
27310            _el.addEventListener("blur", function() {
27311                timer2 = setTimeout(function() {
27312                    let openNav = document.querySelector(".global-nav.flyoutmenu .has-submenu.open");
27313                    if (openNav) {
27314                        openNav.className = "has-submenu";
27315                        openNav.querySelector('a').setAttribute('aria-expanded', "false");
27316                        openNav.querySelector('button').setAttribute('aria-expanded', "false");
27317                        if(isGlobalNav) {
27318                            openNav.querySelector('button').classList.remove("glyphicon-chevron-up");
27319                            openNav.querySelector('button').classList.add("glyphicon-chevron-down");
27320                        } else {
27321                            openNav.querySelector('button').classList.remove("glyphicon-minus-sign");
27322                            openNav.querySelector('button').classList.add("glyphicon-plus-sign");
27323                        }
27324                    }
27325                }, 10);
27326            });
27327        });
27328    });
27329    //end flyoutmenu accessible top nav
27330
27331    //icon switch / expander
27332    $('.sidebar-nav a').on('click', '.glyphicon', function (e) {
27333        //switched to children rather than find to only open menu items one level down
27334        $(this).parent('a').parent('li').children('ul').toggle();
27335        if ($(this).hasClass('glyphicon-plus-sign')) {
27336            $(this).addClass('glyphicon-minus-sign').removeClass('glyphicon-plus-sign');
27337        } else {
27338            $(this).addClass('glyphicon-plus-sign').removeClass('glyphicon-minus-sign');
27339        }
27340        e.stopPropagation();
27341        return false;
27342    });
27343
27344    ////////////////////////////////////////////
27345    ///    DISABLE LEFT NAV FUNCTIONALITY   ///
27346    //////////////////////////////////////////
27347
27348    $('.sidebar-nav .first-level-sidebar-nav a').on('click', function () {
27349        //switched to children rather than find to only open menu items one level down
27350        $(this).parent('li').children('ul').toggle();
27351        $(this).children('.glyphicon').toggleClass('glyphicon-minus-sign').toggleClass('glyphicon-plus-sign');
27352    });
27353
27354    ////////////////////////////////////////////
27355    ///  END DISABLE LEFT NAV FUNCTIONALITY  ///
27356    ////////////////////////////////////////////
27357
27358    $('.sidebar-nav a .glyphicon').keydown(function (e) {
27359        if (e.keyCode == 13) {
27360            //$(this).trigger('click') causes Firefox to execute the parent anchor element
27361            //tried to make this one function, but Chrome and Firefox wouldn't cooperate
27362            $(this).parent('a').parent('li').children('ul').toggle();
27363            if ($(this).hasClass('glyphicon-plus-sign')) {
27364                $(this).addClass('glyphicon-minus-sign').removeClass('glyphicon-plus-sign');
27365            } else {
27366                $(this).addClass('glyphicon-plus-sign').removeClass('glyphicon-minus-sign');
27367            }
27368            e.stopPropagation();
27369            return false;
27370        }
27371    });
27372
27373    //accordion glyphicon switch
27374    $('[data-toggle="collapse"]').addClass("collapsed");
27375
27376    $('.panel-title a').click(function () {
27377        $('.glyphicon-minus-sign').addClass('glyphicon-plus-sign');
27378        $('.glyphicon-minus-sign').removeClass('glyphicon-minus-sign');
27379        $(this).children('.glyphicon').removeClass('glyphicon-plus-sign');
27380        $(this).children('.glyphicon').addClass('glyphicon-minus-sign');
27381    });
27382
27383    //MEDICARE INTERACTIONS
27384
27385    $('.benefits-accordion').click(function () {
27386        $(this).toggleClass('benefits-open');
27387        $(this).children('a').children('h3').children('.glyphicon').toggleClass('glyphicon-minus-sign').toggleClass('glyphicon-plus-sign');
27388    });
27389
27390    $('.benefits-accordion .panel-collapse').click(function (e) {
27391        e.stopPropagation();
27392    });
27393
27394    function resolveShowcaseImage($link) {
27395        let showcaseImage = $link.attr('data-showcase-image');
27396        if (showcaseImage) {
27397            return showcaseImage;
27398        }
27399
27400        // Backward compatibility for old rendered markup where id stored the image URL.
27401        let legacyId = $link.attr('id');
27402        if (legacyId && (legacyId.indexOf('/content/') === 0 || legacyId.indexOf('http://') === 0 || legacyId.indexOf('https://') === 0)) {
27403            return legacyId;
27404        }
27405
27406        return '';
27407    }
27408
27409    //PRELOAD SHOWCASE
27410    $('.showcase-menu a').each(function () {
27411        let showcaseImage = resolveShowcaseImage($(this));
27412        if (showcaseImage) {
27413            $('.preload').append('<img src="' + showcaseImage + '">');
27414        }
27415    });
27416
27417    var backgroundImage = $('#showcase-background').text();
27418    if (typeof backgroundImage === "undefined" || backgroundImage == "") {
27419        backgroundImage = "/etc.clientlibs/centene/clientlibs/clientlibs-main/resources/images/showcase/default.jpg";
27420    }
27421    $('.preload').append('<img src="' + backgroundImage + '">');
27422
27423    $('.showcase-image').css("background-image", "url('" + backgroundImage + "')", "important");
27424
27425
27426    //SHOWCASE INTERCATIONS
27427    $('.showcase-menu a').mouseover(function () {
27428        let showcaseImage = resolveShowcaseImage($(this));
27429        let titleHeadingTag = new String($(this).attr('titleHeadingTag'));
27430        let messageTitle = $(this).data('messagetitle');
27431        let messageSubTitle = $(this).data('messagesubtitle') == undefined ? '' : $(this).data('messagesubtitle');
27432        let messageText = $(this).data('messagetext');
27433        $('.active').stop().removeClass('active');
27434        $('.inactive').stop().css('background-image', 'url(' + (showcaseImage || backgroundImage) + ')');
27435        $('.inactive').addClass('active');
27436        $('.inactive').fadeIn();
27437        $('.inactive').removeClass('inactive');
27438        $('.showcase-image:not(.active)').addClass('inactive');
27439        $('.inactive').fadeOut();
27440
27441        $('.showcase-circle').html('<' + titleHeadingTag + '>' + messageTitle + '</' + titleHeadingTag + '><h2 class="subhead">' + messageSubTitle + '</h2><p>' + messageText + '</p>');
27442    });
27443
27444    $('.showcase-menu').mouseleave(function () {
27445        let messageTitle = $('.home-showcase').data('messagetitle');
27446        let messageSubTitle = $('.home-showcase').data('messagesubtitle');
27447        let messageText = $('.home-showcase').data('messagetext');
27448
27449        $('.showcase-circle').html('<h1>' + messageTitle + '</h1><h2 class="subhead">' + messageSubTitle + '</h2><p>' + messageText + '</p>');
27450
27451        $('.active').stop().removeClass('active');
27452        $('.inactive').stop().css("background-image", "url('" + backgroundImage 
27452+ "')", "important");
27453        $('.inactive').addClass('active');
27454        $('.inactive').fadeIn();
27455        $('.inactive').removeClass('inactive');
27456        $('.showcase-image:not(.active)').addClass('inactive');
27457        $('.inactive').fadeOut();
27458    });
27459
27460    // Close the CTA in Mobile
27461    $('.ambetter-enrollment-cta .cta-close').on('click', function () {
27462        $('.topnotification').remove();
27463    });
27464
27465    $('.first-visit-footer .first-visit-close').on('click', function () {
27466        $('.first-visit-mobile-notification').remove();
27467    });
27468
27469    // A11Y - Tables
27470    focusTable();
27471});
27472
27473//functions
27474
27475function adjustShowcase() {
27476    let showcaseHeight = $('.showcase-menu').height();
27477    $('.showcase-image').css('height', showcaseHeight);
27478}
27479
27480function focusTable() {
27481    let tableTags = document.body.getElementsByTagName("table");
27482
27483    for (let i = 0; i < tableTags.length; i++) {
27484        let tableTag = tableTags[i];
27485        tableTag.setAttribute("tabindex", "0");
27486    }
27487}
27488
27489/**
27490 * Bootstrap Multiselect v0.9.8 (https://github.com/davidstutz/bootstrap-multiselect)
27491 * 
27492 * Copyright 2012 - 2014 David Stutz
27493 * 
27494 * Dual licensed under the BSD-3-Clause and the Apache License, Version 2.0.
27495 */
27496!function($) {
27497 
27498    "use strict";// jshint ;_;
27499
27500    if (typeof ko !== 'undefined' && ko.bindingHandlers && !ko.bindingHandlers.multiselect) {
27501        ko.bindingHandlers.multiselect = {
27502
27503            init: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {
27504
27505                var listOfSelectedItems = allBindingsAccessor().selectedOptions;
27506                var config = ko.utils.unwrapObservable(valueAccessor());
27507
27508                $(element).multiselect(config);
27509
27510                if (isObservableArray(listOfSelectedItems)) {
27511                    
27512                    // Set the initial selection state on the multiselect list.
27513                    $(element).multiselect('select', ko.utils.unwrapObservable(listOfSelectedItems));
27514                    
27515                    // Subscribe to the selectedOptions: ko.observableArray
27516                    listOfSelectedItems.subscribe(function (changes) {
27517                        var addedArray = [], deletedArray = [];
27518                        forEach(changes, function (change) {
27519                            switch (change.status) {
27520                                case 'added':
27521                                    addedArray.push(change.value);
27522                                    break;
27523                                case 'deleted':
27524                                    deletedArray.push(change.value);
27525                                    break;
27526                            }
27527                        });
27528                        
27529                        if (addedArray.length > 0) {
27530                            $(element).multiselect('select', addedArray);
27531                        }
27532                        
27533                        if (deletedArray.length > 0) {
27534                            $(element).multiselect('deselect', deletedArray);
27535                        }
27536                    }, null, "arrayChange");
27537                }
27538            },
27539
27540            update: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {
27541
27542                var listOfItems = allBindingsAccessor().options,
27543                    ms = $(element).data('multiselect'),
27544                    config = ko.utils.unwrapObservable(valueAccessor());
27545
27546                if (isObservableArray(listOfItems)) {
27547                    // Subscribe to the options: ko.observableArray incase it changes later
27548                    listOfItems.subscribe(function (theArray) {
27549                        $(element).multiselect('rebuild');
27550                    });
27551                }
27552
27553                if (!ms) {
27554                    $(element).multiselect(config);
27555                }
27556                else {
27557                    ms.updateOriginalOptions();
27558                }
27559            }
27560        };
27561    }
27562
27563    function isObservableArray(obj) {
27564        return ko.isObservable(obj) && !(obj.destroyAll === undefined);
27565    }
27566
27567    function forEach(array, callback) {
27568        for (var index = 0; index < array.length; ++index) {
27569            callback(array[index]);
27570        }
27571    }
27572
27573    /**
27574     * Constructor to create a new multiselect using the given select.
27575     * 
27576     * @param {jQuery} select
27577     * @param {Object} options
27578     * @returns {Multiselect}
27579     */
27580    function Multiselect(select, options) {
27581
27582        this.options = this.mergeOptions(options);
27583        this.$select = $(select);
27584
27585        // Initialization.
27586        // We have to clone to create a new reference.
27587        this.originalOptions = this.$select.clone()[0].options;
27588        this.query = '';
27589        this.searchTimeout = null;
27590
27591        this.options.multiple = this.$select.attr('multiple') === "multiple";
27592        this.options.onChange = $.proxy(this.options.onChange, this);
27593        this.options.onDropdownShow = $.proxy(this.options.onDropdownShow, this);
27594        this.options.onDropdownHide = $.proxy(this.options.onDropdownHide, this);
27595        this.options.onDropdownShown = $.proxy(this.options.onDropdownShown, this);
27596        this.options.onDropdownHidden = $.proxy(this.options.onDropdownHidden, this);
27597        
27598        // Build select all if enabled.
27599        this.buildContainer();
27600        this.buildButton();
27601        this.buildDropdown();
27602        this.buildSelectAll();
27603        this.buildDropdownOptions();
27604        this.buildFilter();
27605        
27606        this.updateButtonText();
27607        this.updateSelectAll();
27608        
27609        if (this.options.disableIfEmpty) {
27610            this.disableIfEmpty();
27611        }
27612        
27613        this.$select.hide().after(this.$container);
27614    };
27615
27616    Multiselect.prototype = {
27617
27618        defaults: {
27619            /**
27620             * Default text function will either print 'None selected' in case no
27621             * option is selected or a list of the selected options up to a length
27622             * of 3 selected options.
27623             * 
27624             * @param {jQuery} options
27625             * @param {jQuery} select
27626             * @returns {String}
27627             */
27628            buttonText: function(options, select) {
27629                if (options.length === 0) {
27630                    return this.nonSelectedText + ' <b class="caret"></b>';
27631                }
27632                else {
27633                    if (options.length > this.numberDisplayed) {
27634                        return options.length + ' ' + this.nSelectedText + ' <b class="caret"></b>';
27635                    }
27636                    else {
27637                        var selected = '';
27638                        options.each(function() {
27639                            var label = ($(this).attr('label') !== undefined) ? $(this).attr('label') : $(this).html();
27640
27641                            selected += label + ', ';
27642                        });
27643                        return selected.substr(0, selected.length - 2) + ' <b class="caret"></b>';
27644                    }
27645                }
27646            },
27647            /**
27648             * Updates the title of the button similar to the buttonText function.
27649             * 
27650             * @param {jQuery} options
27651             * @param {jQuery} select
27652             * @returns {@exp;selected@call;substr}
27653             */
27654            buttonTitle: function(options, select) {
27655                if (options.length === 0) {
27656                    return this.nonSelectedText;
27657                }
27658                else {
27659                    var selected = '';
27660                    options.each(function () {
27661                        selected += $(this).text() + ', ';
27662                    });
27663                    return selected.substr(0, selected.length - 2);
27664                }
27665            },
27666            /**
27667             * Create a label.
27668             * 
27669             * @param {jQuery} element
27670             * @returns {String}
27671             */
27672            label: function(element){
27673                return $(element).attr('label') || $(element).html();
27674            },
27675            /**
27676             * Triggered on change of the multiselect.
27677             * 
27678             * Not triggered when selecting/deselecting options manually.
27679             * 
27680             * @param {jQuery} option
27681             * @param {Boolean} checked
27682             */
27683            onChange : function(option, checked) {
27684
27685            },
27686            /**
27687             * Triggered when the dropdown is shown.
27688             * 
27689             * @param {jQuery} event
27690             */
27691            onDropdownShow: function(event) {
27692                
27693            },
27694            /**
27695             * Triggered when the dropdown is hidden.
27696             * 
27697             * @param {jQuery} event
27698             */
27699            onDropdownHide: function(event) {
27700                
27701            },
27702            /**
27703             * Triggered after the dropdown is shown.
27704             * 
27705             * @param {jQuery} event
27706             */
27707            onDropdownShown: function(event) {
27708                
27709            },
27710            /**
27711             * Triggered after the dropdown is hidden.
27712             * 
27713             * @param {jQuery} event
27714             */
27715            onDropdownHidden: function(event) {
27716                
27717            },
27718            buttonClass: 'btn btn-default',
27719            dropRight: false,
27720            selectedClass: 'active',
27721            buttonWidth: 'auto',
27722            buttonContainer: '<div class="btn-group" />',
27723            // Maximum height of the dropdown menu.
27724            // If maximum height is exceeded a scrollbar will be displayed.
27725            maxHeight: false,
27726            checkboxName: false,
27727            includeSelectAllOption: false,
27728            includeSelectAllIfMoreThan: 0,
27729            selectAllText: ' Select all',
27730            selectAllValue: 'multiselect-all',
27731            enableFiltering: false,
27732            enableCaseInsensitiveFiltering: false,
27733            filterPlaceholder: 'Search',
27734            // possible options: 'text', 'value', 'both'
27735            filterBehavior: 'text',
27736            preventInputChangeEvent: false,
27737            nonSelectedText: 'None selected',
27738            nSelectedText: 'selected',
27739            numberDisplayed: 3,
27740            disableIfEmpty: false,
27741            templates: {
27742                button: '<button type="button" class="multiselect dropdown-toggle" data-toggle="dropdown"></button>',
27743                ul: '<ul class="multiselect-container dropdown-menu"></ul>',
27744                filter: '<li class="multiselect-item filter"><div class="input-group"><span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span><input class="form-control multiselect-search" type="text"></div></li>',
27745                li: '<li><a href="javascript:void(0);"><label></label></a></li>',
27746                divider: '<li class="multiselect-item divider"></li>',
27747                liGroup: '<li class="multiselect-item group"><label class="multiselect-group"></label></li>'
27748            }
27749        },
27750
27751        constructor: Multiselect,
27752
27753        /**
27754         * Builds the container of the multiselect.
27755         */
27756        buildContainer: function() {
27757            this.$container = $(this.options.buttonContainer);
27758            this.$container.on('show.bs.dropdown', this.options.onDropdownShow);
27759            this.$container.on('hide.bs.dropdown', this.options.onDropdownHide);
27760            this.$container.on('shown.bs.dropdown', this.options.onDropdownShown);
27761            this.$container.on('hidden.bs.dropdown', this.options.onDropdownHidden);
27762        },
27763
27764        /**
27765         * Builds the button of the multiselect.
27766         */
27767        buildButton: function() {
27768            this.$button = $(this.options.templates.button).addClass(this.options.buttonClass);
27769
27770            // Adopt active state.
27771            if (this.$select.prop('disabled')) {
27772                this.disable();
27773            }
27774            else {
27775                this.enable();
27776            }
27777
27778            // Manually add button width if set.
27779            if (this.options.buttonWidth && this.options.buttonWidth !== 'auto') {
27780                this.$button.css({
27781                    'width' : this.options.buttonWidth
27782                });
27783                this.$container.css({
27784                    'width': this.options.buttonWidth
27785                });
27786            }
27787
27788            // Keep the tab index from the select.
27789            var tabindex = this.$select.attr('tabindex');
27790            if (tabindex) {
27791                this.$button.attr('tabindex', tabindex);
27792            }
27793
27794            this.$container.prepend(this.$button);
27795        },
27796
27797        /**
27798         * Builds the ul representing the dropdown menu.
27799         */
27800        buildDropdown: function() {
27801
27802            // Build ul.
27803            this.$ul = $(this.options.templates.ul);
27804
27805            if (this.options.dropRight) {
27806                this.$ul.addClass('pull-right');
27807            }
27808
27809            // Set max height of dropdown menu to activate auto scrollbar.
27810            if (this.options.maxHeight) {
27811                // TODO: Add a class for this option to move the css declarations.
27812                this.$ul.css({
27813                    'max-height': this.options.maxHeight + 'px',
27814                    'overflow-y': 'auto',
27815                    'overflow-x': 'hidden'
27816                });
27817            }
27818
27819            this.$container.append(this.$ul);
27820        },
27821
27822        /**
27823         * Build the dropdown options and binds all nessecary events.
27824         * 
27825         * Uses createDivider and createOptionValue to create the necessary options.
27826         */
27827        buildDropdownOptions: function() {
27828
27829            this.$select.children().each($.proxy(function(index, element) {
27830                
27831                // Support optgroups and options without a group simultaneously.
27832                var tag = $(element).prop('tagName')
27833                    .toLowerCase();
27834            
27835                if ($(element).prop('value') === this.options.selectAllValue) {
27836                    return;
27837                }
27838
27839                if (tag === 'optgroup') {
27840                    this.createOptgroup(element);
27841                }
27842                else if (tag === 'option') {
27843
27844                    if ($(element).data('role') === 'divider') {
27845                        this.createDivider();
27846                    }
27847                    else {
27848                        this.createOptionValue(element);
27849                    }
27850
27851                }
27852                
27853                // Other illegal tags will be ignored.
27854            }, this));
27855
27856            // Bind the change event on the dropdown elements.
27857            $('li input', this.$ul).on('change', $.proxy(function(event) {
27858                var $target = $(event.target);
27859
27860                var checked = $target.prop('checked') || false;
27861                var isSelectAllOption = $target.val() === this.options.selectAllValue;
27862
27863                // Apply or unapply the configured selected class.
27864                if (this.options.selectedClass) {
27865                    if (checked) {
27866                        $target.parents('li')
27867                            .addClass(this.options.selectedClass);
27868                    }
27869                    else {
27870                        $target.parents('li')
27871                            .removeClass(this.options.selectedClass);
27872                    }
27873                }
27874
27875                // Get the corresponding option.
27876                var value = $target.val();
27877                var $option = this.getOptionByValue(value);
27878
27879                var $optionsNotThis = $('option', this.$select).not($option);
27880                var $checkboxesNotThis = $('input', this.$container).not($target);
27881
27882                if (isSelectAllOption) {
27883                    if (checked) {
27884                        this.selectAll();
27885                    }
27886                    else {
27887                        this.deselectAll();
27888                    }
27889                }
27890
27891                if(!isSelectAllOption){
27892                    if (checked) {
27893                        $option.prop('selected', true);
27894
27895                        if (this.options.multiple) {
27896                            // Simply select additional option.
27897                            $option.prop('selected', true);
27898                        }
27899                        else {
27900                            // Unselect all other options and corresponding checkboxes.
27901                            if (this.options.selectedClass) {
27902                                $($checkboxesNotThis).parents('li').removeClass(this.options.selectedClass);
27903                            }
27904
27905                            $($checkboxesNotThis).prop('checked', false);
27906                            $optionsNotThis.prop('selected', false);
27907
27908                            // It's a single selection, so close.
27909                            this.$button.click();
27910                        }
27911
27912                        if (this.options.selectedClass === "active") {
27913                            $optionsNotThis.parents("a").css("outline", "");
27914                        }
27915                    }
27916                    else {
27917                        // Unselect option.
27918                        $option.prop('selected', false);
27919                    }
27920                }
27921
27922                this.$select.change();
27923
27924                this.updateButtonText();
27925                this.updateSelectAll();
27926                
27927                this.options.onChange($option, checked);
27928
27929                if(this.options.preventInputChangeEvent) {
27930                    return false;
27931                }
27932            }, this));
27933
27934            $('li a', this.$ul).on('touchstart click', function(event) {
27935                event.stopPropagation();
27936
27937                var $target = $(event.target);
27938
27939                if (event.shiftKey) {
27940                    var checked = $target.prop('checked') || false;
27941
27942                    if (checked) {
27943                        var prev = $target.parents('li:last')
27944                            .siblings('li[class="active"]:first');
27945
27946                        var currentIdx = $target.parents('li')
27947                            .index();
27948                        var prevIdx = prev.index();
27949
27950                        if (currentIdx > prevIdx) {
27951                            $target.parents("li:last").prevUntil(prev).each(
27952                                function() {
27953                                    $(this).find("input:first").prop("checked", true)
27954                                        .trigger("change");
27955                                }
27956                            );
27957                        }
27958                        else {
27959                            $target.parents("li:last").nextUntil(prev).each(
27960                                function() {
27961                                    $(this).find("input:first").prop("checked", true)
27962                                        .trigger("change");
27963                                }
27964                            );
27965                        }
27966                    }
27967                }
27968
27969                $target.blur();
27970            });
27971
27972            // Keyboard support.
27973            this.$container.off('keydown.multiselect').on('keydown.multiselect', $.proxy(function(event) {
27974                if ($('input[type="text"]', this.$container).is(':focus')) {
27975                    return;
27976                }
27977                if ((event.keyCode === 9 || event.keyCode === 27)
27978                        && this.$container.hasClass('open')) {
27979                    
27980                    // Close on tab or escape.
27981                    this.$button.click();
27982                }
27983                else {
27984                    var $items = $(this.$container).find("li:not(.divider):not(.disabled) a").filter(":visible");
27985
27986                    if (!$items.length) {
27987                        return;
27988                    }
27989
27990                    var index = $items.index($items.filter(':focus'));
27991
27992                    // Navigation up.
27993                    if (event.keyCode === 38 && index > 0) {
27994                        index--;
27995                    }
27996                    // Navigate down.
27997                    else if (event.keyCode === 40 && index < $items.length - 1) {
27998                        index++;
27999                    }
28000                    else if (!~index) {
28001                        index = 0;
28002                    }
28003
28004                    var $current = $items.eq(index);
28005                    $current.focus();
28006
28007                    if (event.keyCode === 32 || event.keyCode === 13) {
28008                        var $checkbox = $current.find('input');
28009
28010                        $checkbox.prop("checked", !$checkbox.prop("checked"));
28011                        $checkbox.change();
28012                    }
28013
28014                    event.stopPropagation();
28015                    event.preventDefault();
28016                }
28017            }, this));
28018        },
28019
28020        /**
28021         * Create an option using the given select option.
28022         * 
28023         * @param {jQuery} element
28024         */
28025        createOptionValue: function(element) {
28026            if ($(element).is(':selected')) {
28027                $(element).prop('selected', true);
28028            }
28029
28030            // Support the label attribute on options.
28031            var label = this.options.label(element);
28032            var value = $(element).val();
28033            var inputType = this.options.multiple ? "checkbox" : "radio";
28034
28035            var $li = $(this.options.templates.li);
28036            $('label', $li).addClass(inputType);
28037            
28038            if (this.options.checkboxName) {
28039                $('label', $li).append('<input type="' + inputType + '" name="' + this.options.checkboxName + '" />');
28040            }
28041            else {
28042                $('label', $li).append('<input type="' + inputType + '" />');
28043            }
28044            
28045            var selected = $(element).prop('selected') || false;
28046            var $checkbox = $('input', $li);
28047            $checkbox.val(value);
28048
28049            if (value === this.options.selectAllValue) {
28050                $li.addClass("multiselect-item multiselect-all");
28051                $checkbox.parent().parent()
28052                    .addClass('multiselect-all');
28053            }
28054
28055            $('label', $li).append(" " + label);
28056
28057            this.$ul.append($li);
28058
28059            if ($(element).is(':disabled')) {
28060                $checkbox.attr('disabled', 'disabled')
28061                    .prop('disabled', true)
28062                    .parents('a')
28063                    .attr("tabindex", "-1")
28064                    .parents('li')
28065                    .addClass('disabled');
28066            }
28067
28068            $checkbox.prop('checked', selected);
28069
28070            if (selected && this.options.selectedClass) {
28071                $checkbox.parents('li')
28072                    .addClass(this.options.selectedClass);
28073            }
28074        },
28075
28076        /**
28077         * Creates a divider using the given select option.
28078         * 
28079         * @param {jQuery} element
28080         */
28081        createDivider: function(element) {
28082            var $divider = $(this.options.templates.divider);
28083            this.$ul.append($divider);
28084        },
28085
28086        /**
28087         * Creates an optgroup.
28088         * 
28089         * @param {jQuery} group
28090         */
28091        createOptgroup: function(group) {
28092            var groupName = $(group).prop('label');
28093
28094            // Add a header for the group.
28095            var $li = $(this.options.templates.liGroup);
28096            $('label', $li).text(groupName);
28097
28098            this.$ul.append($li);
28099
28100            if ($(group).is(':disabled')) {
28101                $li.addClass('disabled');
28102            }
28103
28104            // Add the options of the group.
28105            $('option', group).each($.proxy(function(index, element) {
28106                this.createOptionValue(element);
28107            }, this));
28108        },
28109
28110        /**
28111         * Build the selct all.
28112         * 
28113         * Checks if a select all has already been created.
28114         */
28115        buildSelectAll: function() {
28116            var alreadyHasSelectAll = this.hasSelectAll();
28117            
28118            if (!alreadyHasSelectAll && this.options.includeSelectAllOption && this.options.multiple
28119                    && $('option', this.$select).length > this.options.includeSelectAllIfMoreThan) {
28120                
28121                // Check whether to add a divider after the select all.
28122                if (this.options.includeSelectAllDivider) {
28123                    this.$ul.prepend($(this.options.templates.divider));
28124                }
28125
28126                var $li = $(this.options.templates.li);
28127                $('label', $li).addClass("checkbox");
28128                
28129                if (this.options.checkboxName) {
28130                    $('label', $li).append('<input type="checkbox" name="' + this.options.checkboxName + '" />');
28131                }
28132                else {
28133                    $('label', $li).append('<input type="checkbox" />');
28134                }
28135                
28136                var $checkbox = $('input', $li);
28137                $checkbox.val(this.options.selectAllValue);
28138
28139                $li.addClass("multiselect-item multiselect-all");
28140                $checkbox.parent().parent()
28141                    .addClass('multiselect-all');
28142
28143                $('label', $li).append(" " + this.options.selectAllText);
28144
28145                this.$ul.prepend($li);
28146
28147                $checkbox.prop('checked', false);
28148            }
28149        },
28150
28151        /**
28152         * Builds the filter.
28153         */
28154        buildFilter: function() {
28155
28156            // Build filter if filtering OR case insensitive filtering is enabled and the number of options exceeds (or equals) enableFilterLength.
28157            if (this.options.enableFiltering || this.options.enableCaseInsensitiveFiltering) {
28158                var enableFilterLength = Math.max(this.options.enableFiltering, this.options.enableCaseInsensitiveFiltering);
28159
28160                if (this.$select.find('option').length >= enableFilterLength) {
28161
28162                    this.$filter = $(this.options.templates.filter);
28163                    $('input', this.$filter).attr('placeholder', this.options.filterPlaceholder);
28164                    this.$ul.prepend(this.$filter);
28165
28166                    this.$filter.val(this.query).on('click', function(event) {
28167                        event.stopPropagation();
28168                    }).on('input keydown', $.proxy(function(event) {
28169                        // This is useful to catch "keydown" events after the browser has updated the control.
28170                        clearTimeout(this.searchTimeout);
28171
28172                        this.searchTimeout = this.asyncFunction($.proxy(function() {
28173
28174                            if (this.query !== event.target.value) {
28175                                this.query = event.target.value;
28176
28177                                $.each($('li', this.$ul), $.proxy(function(index, element) {
28178                                    var value = $('input', element).val();
28179                                    var text = $('label', element).text();
28180
28181                                    var filterCandidate = '';
28182                                    if ((this.options.filterBehavior === 'text')) {
28183                                        filterCandidate = text;
28184                                    }
28185                                    else if ((this.options.filterBehavior === 'value')) {
28186                                        filterCandidate = value;
28187                                    }
28188                                    else if (this.options.filterBehavior === 'both') {
28189                                        filterCandidate = text + '\n' + value;
28190                                    }
28191
28192                                    if (value !== this.options.selectAllValue && text) {
28193                                        // By default lets assume that element is not
28194                                        // interesting for this search.
28195                                        var showElement = false;
28196
28197                                        if (this.options.enableCaseInsensitiveFiltering && filterCandidate.toLowerCase().indexOf(this.query.toLowerCase()) > -1) {
28198                                            showElement = true;
28199                                        }
28200                                        else if (filterCandidate.indexOf(this.query) > -1) {
28201                                            showElement = true;
28202                                        }
28203
28204                                        if (showElement) {
28205                                            $(element).show().removeClass("filter-hidden");
28206                                        }
28207                                        else {
28208                                            $(element).hide().addClass("filter-hidden");
28209                                        }
28210                                    }
28211                                }, this));
28212                            }
28213
28214                            this.updateSelectAll();
28215                        }, this), 300, this);
28216                    }, this));
28217                }
28218            }
28219        },
28220
28221        /**
28222         * Unbinds the whole plugin.
28223         */
28224        destroy: function() {
28225            this.$container.remove();
28226            this.$select.show();
28227            this.$select.data('multiselect', null);
28228        },
28229
28230        /**
28231         * Refreshs the multiselect based on the selected options of the select.
28232         */
28233        refresh: function() {
28234            $('option', this.$select).each($.proxy(function(index, element) {
28235                var $input = $('li input', this.$ul).filter(function() {
28236                    return $(this).val() === $(element).val();
28237                });
28238
28239                if ($(element).is(':selected')) {
28240                    $input.prop('checked', true);
28241
28242                    if (this.options.selectedClass) {
28243                        $input.parents('li')
28244                            .addClass(this.options.selectedClass);
28245                    }
28246                }
28247                else {
28248                    $input.prop('checked', false);
28249
28250                    if (this.options.selectedClass) {
28251                        $input.parents('li')
28252                            .removeClass(this.options.selectedClass);
28253                    }
28254                }
28255
28256                if ($(element).is(":disabled")) {
28257                    $input.attr('disabled', 'disabled')
28258                        .prop('disabled', true)
28259                        .parents('li')
28260                        .addClass('disabled');
28261                }
28262                else {
28263                    $input.prop('disabled', false)
28264                        .parents('li')
28265                        .removeClass('disabled');
28266                }
28267            }, this));
28268
28269            this.updateButtonText();
28270            this.updateSelectAll();
28271        },
28272
28273        /**
28274         * Select all options of the given values.
28275         * 
28276         * If triggerOnChange is set to true, the on change event is triggered if
28277         * and only if one value is passed.
28278         * 
28279         * @param {Array} selectValues
28280         * @param {Boolean} triggerOnChange
28281         */
28282        select: function(selectValues, triggerOnChange) {
28283            if(!$.isArray(selectValues)) {
28284                selectValues = [selectValues];
28285            }
28286
28287            for (var i = 0; i < selectValues.length; i++) {
28288                var value = selectValues[i];
28289
28290                var $option = this.getOptionByValue(value);
28291                var $checkbox = this.getInputByValue(value);
28292
28293                if($option === undefined || $checkbox === undefined) {
28294                    continue;
28295                }
28296                
28297                if (!this.options.multiple) {
28298                    this.deselectAll(false);
28299                }
28300                
28301                if (this.options.selectedClass) {
28302                    $checkbox.parents('li')
28303                        .addClass(this.options.selectedClass);
28304                }
28305
28306                $checkbox.prop('checked', true);
28307                $option.prop('selected', true);
28308            }
28309
28310            this.updateButtonText();
28311
28312            if (triggerOnChange && selectValues.length === 1) {
28313                this.options.onChange($option, true);
28314            }
28315        },
28316
28317        /**
28318         * Clears all selected items.
28319         */
28320        clearSelection: function () {
28321            this.deselectAll(false);
28322            this.updateButtonText();
28323            this.updateSelectAll();
28324        },
28325
28326        /**
28327         * Deselects all options of the given values.
28328         * 
28329         * If triggerOnChange is set to true, the on change event is triggered, if
28330         * and only if one value is passed.
28331         * 
28332         * @param {Array} deselectValues
28333         * @param {Boolean} triggerOnChange
28334         */
28335        deselect: function(deselectValues, triggerOnChange) {
28336            if(!$.isArray(deselectValues)) {
28337                deselectValues = [deselectValues];
28338            }
28339
28340            for (var i = 0; i < deselectValues.length; i++) {
28341
28342                var value = deselectValues[i];
28343
28344                var $option = this.getOptionByValue(value);
28345                var $checkbox = this.getInputByValue(value);
28346
28347                if($option === undefined || $checkbox === undefined) {
28348                    continue;
28349                }
28350
28351                if (this.options.selectedClass) {
28352                    $checkbox.parents('li')
28353                        .removeClass(this.options.selectedClass);
28354                }
28355
28356                $checkbox.prop('checked', false);
28357                $option.prop('selected', false);
28358            }
28359
28360            this.updateButtonText();
28361
28362            if (triggerOnChange && deselectValues.length === 1) {
28363                this.options.onChange($option, false);
28364            }
28365        },
28366        
28367        /**
28368         * Selects all enabled & visible options.
28369         */
28370        selectAll: function () {
28371            var allCheckboxes = $("li input[type='checkbox']:enabled", this.$ul);
28372            var visibleCheckboxes = allCheckboxes.filter(":visible");
28373            var allCheckboxesCount = allCheckboxes.length;
28374            var visibleCheckboxesCount = visibleCheckboxes.length;
28375                
28376            visibleCheckboxes.prop('checked', true);
28377            $("li:not(.divider):not(.disabled)", this.$ul).filter(":visible").addClass(this.options.selectedClass);
28378            
28379            if (allCheckboxesCount === visibleCheckboxesCount) {
28380                $("option:enabled", this.$select).prop('selected', true);
28381            }
28382            else {
28383                var values = visibleCheckboxes.map(function() {
28384                    return $(this).val();
28385                }).get();
28386                
28387                $("option:enabled", this.$select).filter(function(index) {
28388                    return $.inArray($(this).val(), values) !== -1;
28389                }).prop('selected', true);
28390            }
28391        },
28392
28393        /**
28394         * Deselects all options.
28395         * 
28396         * If justVisible is true or not specified, only visible options are deselected.
28397         * 
28398         * @param {Boolean} justVisible
28399         */
28400        deselectAll: function (justVisible) {
28401            var justVisible = typeof justVisible === 'undefined' ? true : justVisible;
28402            
28403            if(justVisible) {              
28404                var visibleCheckboxes = $("li input[type='checkbox']:enabled", this.$ul).filter(":visible");
28405                visibleCheckboxes.prop('checked', false);
28406                
28407                var values = visibleCheckboxes.map(function() {
28408                    return $(this).val();
28409                }).get();
28410                
28411                $("option:enabled", this.$select).filter(function(index) {
28412                    return $.inArray($(this).val(), values) !== -1;
28413                }).prop('selected', false);
28414                
28415                if (this.options.selectedClass) {
28416                    $("li:not(.divider):not(.disabled)", this.$ul).filter(":visible").removeClass(this.options.selectedClass);
28417                }
28418            }
28419            else {
28420                $("li input[type='checkbox']:enabled", this.$ul).prop('checked', false);
28421                $("option:enabled", this.$select).prop('selected', false);
28422                
28423                if (this.options.selectedClass) {
28424                    $("li:not(.divider):not(.disabled)", this.$ul).removeClass(this.options.selectedClass);
28425                }
28426            }
28427        },
28428
28429        /**
28430         * Rebuild the plugin.
28431         * 
28432         * Rebuilds the dropdown, the filter and the select all option.
28433         */
28434        rebuild: function() {
28435            this.$ul.html('');
28436
28437            // Important to distinguish between radios and checkboxes.
28438            this.options.multiple = this.$select.attr('multiple') === "multiple";
28439
28440            this.buildSelectAll();
28441            this.buildDropdownOptions();
28442            this.buildFilter();
28443            
28444            this.updateButtonText();
28445            this.updateSelectAll();
28446            
28447            if (this.options.disableIfEmpty) {
28448                this.disableIfEmpty();
28449            }
28450            
28451            if (this.options.dropRight) {
28452                this.$ul.addClass('pull-right');
28453            }
28454        },
28455
28456        /**
28457         * The provided data will be used to build the dropdown.
28458         * 
28459         * @param {Array} dataprovider
28460         */
28461        dataprovider: function(dataprovider) {
28462            var optionDOM = "";
28463            var groupCounter = 0;
28464
28465            $.each(dataprovider, function (index, option) {
28466                if ($.isArray(option.children)) {
28467                    groupCounter++;
28468                    optionDOM += '<optgroup label="' + (option.title || 'Group ' + groupCounter) + '">';
28469
28470                    forEach(option.children, function(subOption) {
28471                        optionDOM += '<option value="' + subOption.value + '">' + (subOption.label || subOption.value) + '</option>';
28472                    });
28473
28474                    optionDOM += '</optgroup>';
28475                }
28476                else {
28477                    optionDOM += '<option value="' + option.value + '">' + (option.label || option.value) + '</option>';
28478                }
28479            });
28480            
28481            this.$select.html(optionDOM);
28482            this.rebuild();
28483        },
28484
28485        /**
28486         * Enable the multiselect.
28487         */
28488        enable: function() {
28489            this.$select.prop('disabled', false);
28490            this.$button.prop('disabled', false)
28491                .removeClass('disabled');
28492        },
28493
28494        /**
28495         * Disable the multiselect.
28496         */
28497        disable: function() {
28498            this.$select.prop('disabled', true);
28499            this.$button.prop('disabled', true)
28500                .addClass('disabled');
28501        },
28502
28503        /**
28504         * Disable the multiselect if there are no options in the select.
28505         */
28506        disableIfEmpty: function () {
28507            if ($('option', this.$select).length <= 0) {
28508                this.disable();
28509            }
28510            else {
28511                this.enable();
28512            }
28513        },
28514
28515        /**
28516         * Set the options.
28517         * 
28518         * @param {Array} options
28519         */
28520        setOptions: function(options) {
28521            this.options = this.mergeOptions(options);
28522        },
28523
28524        /**
28525         * Merges the given options with the default options.
28526         * 
28527         * @param {Array} options
28528         * @returns {Array}
28529         */
28530        mergeOptions: function(options) {
28531            return $.extend(true, {}, this.defaults, options);
28532        },
28533        
28534        /**
28535         * Checks whether a select all checkbox is present.
28536         * 
28537         * @returns {Boolean}
28538         */
28539        hasSelectAll: function() {
28540            return $('li.' + this.options.selectAllValue, this.$ul).length > 0;
28541        },
28542        
28543        /**
28544         * Updates the select all checkbox based on the currently displayed and selected checkboxes.
28545         */
28546        updateSelectAll: function() {
28547            if (this.hasSelectAll()) {
28548                var allBoxes = $("li:not(.multiselect-item):not(.filter-hidden) input:enabled", this.$ul);
28549                var allBoxesLength = allBoxes.length;
28550                var checkedBoxesLength = allBoxes.filter(":checked").length;
28551                var selectAllLi  = $("li." + this.options.selectAllValue, this.$ul);
28552                var selectAllInput = selectAllLi.find("input");
28553                
28554                if (checkedBoxesLength > 0 && checkedBoxesLength === allBoxesLength) {
28555                    selectAllInput.prop("checked", true);
28556                    selectAllLi.addClass(this.options.selectedClass);
28557                }
28558                else {
28559                    selectAllInput.prop("checked", false);
28560                    selectAllLi.removeClass(this.options.selectedClass);
28561                }
28562            }
28563        },
28564        
28565        /**
28566         * Update the button text and its title based on the currently selected options.
28567         */
28568        updateButtonText: function() {
28569            var options = this.getSelected();
28570            
28571            // First update the displayed button text.
28572            $('button.multiselect', this.$container).html(this.options.buttonText(options, this.$select));
28573            
28574            // Now update the title attribute of the button.
28575            $('button.multiselect', this.$container).attr('title', this.options.buttonTitle(options, this.$select));
28576        },
28577
28578        /**
28579         * Get all selected options.
28580         * 
28581         * @returns {jQUery}
28582         */
28583        getSelected: function() {
28584            return $('option', this.$select).filter(":selected");
28585        },
28586
28587        /**
28588         * Gets a select option by its value.
28589         * 
28590         * @param {String} value
28591         * @returns {jQuery}
28592         */
28593        getOptionByValue: function (value) {
28594
28595            var options = $('option', this.$select);
28596            var valueToCompare = value.toString();
28597
28598            for (var i = 0; i < options.length; i = i + 1) {
28599                var option = options[i];
28600                if (option.value === valueToCompare) {
28601                    return $(option);
28602                }
28603            }
28604        },
28605
28606        /**
28607         * Get the input (radio/checkbox) by its value.
28608         * 
28609         * @param {String} value
28610         * @returns {jQuery}
28611         */
28612        getInputByValue: function (value) {
28613
28614            var checkboxes = $('li input', this.$ul);
28615            var valueToCompare = value.toString();
28616
28617            for (var i = 0; i < checkboxes.length; i = i + 1) {
28618                var checkbox = checkboxes[i];
28619                if (checkbox.value === valueToCompare) {
28620                    return $(checkbox);
28621                }
28622            }
28623        },
28624
28625        /**
28626         * Used for knockout integration.
28627         */
28628        updateOriginalOptions: function() {
28629            this.originalOptions = this.$select.clone()[0].options;
28630        },
28631
28632        asyncFunction: function(callback, timeout, self) {
28633            var args = Array.prototype.slice.call(arguments, 3);
28634            return setTimeout(function() {
28635                callback.apply(self || window, args);
28636            }, timeout);
28637        }
28638    };
28639
28640    $.fn.multiselect = function(option, parameter, extraOptions) {
28641        return this.each(function() {
28642            var data = $(this).data('multiselect');
28643            var options = typeof option === 'object' && option;
28644            
28645            // Initialize the multiselect.
28646            if (!data) {
28647                data = new Multiselect(this, options);
28648                $(this).data('multiselect', data);
28649            }
28650
28651            // Call multiselect method.
28652            if (typeof option === 'string') {
28653                data[option](parameter, extraOptions);
28654                
28655                if (option === 'destroy') {
28656                    $(this).data('multiselect', false);
28657                }
28658            }
28659        });
28660    };
28661
28662    $.fn.multiselect.Constructor = Multiselect;
28663
28664    $(function() {
28665        $("select[data-role=multiselect]").multiselect();
28666    });
28667
28668}(window.jQuery);
28669
28670/////////////////////////////////////////////////////////////////////
28671/// Ambetter Grid Builder
28672/// By. Sam B.
28673/////////////////////////////////////////////////////////////////////
28674
28675var csvObject;
28676
28677//Use this to define vanity names for the CSV Headers provided by Marketing.
28678// id will need to align with the headerObj
28679var vanityObj = [
28680    { 'vanity': 'Legal Entity', 'id': '0' },
28681    { 'vanity': 'Product Name', 'id': '1' },
28682    { 'vanity': 'Plan Name', 'id': '2' },
28683    { 'vanity': 'OFFER/WITHDRAW', 'id': '3' },
28684    { 'vanity': 'Eff Date', 'id': '4' },
28685    { 'vanity': 'End Date', 'id': '5' },
28686    { 'vanity': 'Issuer ID', 'id': '6' },
28687    { 'vanity': 'Product ID', 'id': '7' },
28688    { 'vanity': 'Plan ID', 'id': '8' },
28689    { 'vanity': 'Variant ID', 'id': '9' },
28690    { 'vanity': 'CSR Variation Type', 'id': '10' },
28691    { 'vanity': 'Plan Design', 'id': '11' },
28692    { 'vanity': 'Portfolio', 'id': '12' },
28693    { 'vanity': 'Deductible', 'id': '13' },
28694    { 'vanity': 'Coinsurance ', 'id': '14' },
28695    { 'vanity': 'RX Deductible', 'id': '15' },
28696    { 'vanity': 'Rx Coinsurance', 'id': '16' },
28697    { 'vanity': 'Out-Of-Pocket', 'id': '17' },
28698    { 'vanity': 'Primary Care Visit', 'id': '18' },
28699    { 'vanity': 'Free Visits', 'id': '19' },
28700    { 'vanity': 'Specialist Visit', 'id': '20' },
28701    { 'vanity': 'ER', 'id': '21' },
28702    { 'vanity': 'Inpatient', 'id': '22' },
28703    { 'vanity': 'Generics', 'id': '23' },
28704    { 'vanity': 'Preferred Brand Drugs', 'id': '24' },
28705    { 'vanity': 'Non-Preferred Brand Drugs', 'id': '25' },
28706    { 'vanity': 'Specialty High-Cost Drugs', 'id': '26' },
28707    { 'vanity': 'EHB AV (2)', 'id': '27' },
28708    { 'vanity': 'URL Codes', 'id': '28' },
28709    { 'vanity': '', 'id': '29' },
28710    { 'vanity': '', 'id': '30' },
28711    { 'vanity': 'Federal Poverty Level', 'id': '31' }
28712];
28713
28714// Parse the CSV and create an object
28715function performCSVParse(csvSRC) {
28716    //console.log('gridBuilder JS');
28717    Papa.parse(csvSRC, {
28718        download: true,
28719        complete: function (results) {
28720            csvObject = results;
28721            var rc = parseInt($('#resultCount').val());
28722            buildCSVTable(csvObject, rc);
28723        }
28724    });
28725}
28726
28727// REMOVE the Dublicate Entries in the Array
28728var arrayUnique = function (a) {
28729    return a.reduce(function (p, c) {
28730        if (p.indexOf(c) < 0) p.push(c);
28731        return p;
28732    }, []);
28733};
28734
28735// Take the CSV and Available Headers supplied by the JSP to create the Table
28736function buildCSVTable(obj, rc) {
28737    //Build the Table Header
28738    var csvHeader, csvCodeHeader, csvCodeID, csvPDFHeader, csvPDFID, csvPlanID, csvPlanMarketingName;
28739    for (var header of availableHeaders) {
28740        // Build the Table Header Cells
28741        if (obj.data[0][header.hID] == 'URL Codes') {
28742            csvCodeHeader = '<th class="hidden">' + obj.data[0][header.hID] + '</th>';
28743            csvCodeID = header.hID;
28744        } else if (obj.data[0][header.hID] == "Variant ID") {
28745            csvPDFID = header.hID;
28746            if (broURL != '') {
28747                csvPDFHeader += '<th>Brochures</th>';
28748            }
28749            if (sbcURL != '') {
28750                csvPDFHeader += '<th>Summary of Benefits</th>';
28751            }
28752
28753        } else {
28754            //csvHeader += '<th class="headerCol">' + obj.data[0][availableHeaders[h].hID] + '</th>';
28755            csvHeader += '<th class="headerCol">' + vanityObj[header.hID].vanity + '</th>';
28756        }
28757        if (obj.data[0][header.hID] == "Plan ID") {
28758            csvPlanID = header.hID;
28759        }
28760        if (obj.data[0][header.hID] == "Plan Marketing Name") {
28761            csvPlanMarketingName = header.hID;
28762        }
28763    }
28764    $('#csvTBODY').empty();
28765
28766    // Add the Header to the Table.
28767    $('#csvTHEAD').empty();
28768    $('#csvTHEAD').append(csvCodeHeader + csvHeader + csvPDFHeader);
28769
28770    // Build the Table Body
28771    var csvBody = "";
28772    var csvCodeBody = "";
28773    var csvPDFBody = "";
28774    var csvFillerBody = "";
28775    var filterObject = {};
28776    var filters = [];
28777    var products = [];
28778    var levels = [];
28779    var hasBro = false;
28780    var hasSBC = false;
28781    var r,c;
28782    for (r = 1; r < obj.data.length; r++) {
28783        // Add the Table Row Tag
28784        for (c = 0; c < availableHeaders.length; c++) {
28785            // Build Each Table Cell in the Row
28786            if (availableHeaders[c].hID == csvCodeID) {
28787                csvCodeBody = '<td class="urlCode hidden">' + obj.data[r][availableHeaders[c].hID] + '</td>';
28788                //console.log('objCSVCode: ' + obj.data[r][availableHeaders[c].hID] + ' c: ' + c);
28789            } else if (availableHeaders[c].hID == csvPDFID) {
28790                if (broURL != '' && sbcURL != '') {
28791                    //console.log('both true');
28792                    csvPDFBody = '<td><a class="btn brand-btn btn-sm" target="_blank" href="' + broURL + obj.data[r][availableHeaders[c].hID] + '.pdf">View PDF</a></td><td><a class="btn brand-btn btn-sm" target="_blank" href="' + sbcURL + obj.data[r][availableHeaders[c].hID] + '.pdf">View PDF</a></td>';
28793                } else if (broURL == '' && sbcURL != '') {
28794                    //console.log('sbc true');
28795                    csvPDFBody = '<td><a class="btn brand-btn btn-sm" target="_blank" href="' + sbcURL + obj.data[r][availableHeaders[c].hID] + '.pdf">View PDF</a></td>';
28796                } else if (broURL != '' && sbcURL == '') {
28797                    //console.log('bro true');
28798                    csvPDFBody = '<td><a class="btn brand-btn btn-sm" target="_blank" href="' + broURL + obj.data[r][availableHeaders[c].hID] + '.pdf">View PDF</a></td>';
28799                }
28800            } else {
28801                csvFillerBody += "<td>" + obj.data[r][availableHeaders[c].hID] + "</td>";
28802                //console.log('obj: ' + obj.data[r][availableHeaders[c].hID] + ' c: ' + c);
28803            }
28804
28805        }
28806        if (r > rc) {
28807            csvBody += '<tr class="hidden">' + csvCodeBody + csvFillerBody + csvPDFBody + '</tr>';
28808        } else {
28809            csvBody += '<tr class="">' + csvCodeBody + csvFillerBody + csvPDFBody + '</tr>';
28810        }
28811        csvFillerBody = "";
28812    }
28813    var f = 0;
28814    for (c = 0; c < availableHeaders.length; c++) {
28815        filters = [];
28816        for (r = 1; r < obj.data.length; r++) {
28817            if (availableHeaders[c].hID == csvCodeID) {
28818                // Un-Camel Case the Product names so we can build the filter drop down.
28819                if (obj.data[r][availableHeaders[c].hID] != undefined) {
28820                    var prod = obj.data[r][availableHeaders[c].hID].replace(/([A-Z]+)/g, "$1").replace(/([A-Z][a-z])/g, " $1");
28821                    // Trim the leading space
28822                    prod = prod.trim(0);
28823                    ////////////////////////////////////////////////
28824                    // USE IF WE NEED TO KEEP THE NUMBER FOR THE PRODUCT
28825                    //var index = prod.search(/\d/);
28826                    //prod = prod.slice(0, index) + ' ' + prod.slice(index);
28827                    ////////////////////////////////////////////////
28828
28829                    ////////////////////////////////////////////////
28830                    // USE TO REMOVE PRODUCT NUMBER - Current Practice
28831                    var index = prod.search(/\d/);
28832                    var lvl = prod.slice(index);
28833                    prod = prod.replace(/[0-9]/g, '');
28834                    ////////////////////////////////////////////////
28835
28836                    // Building an Array of Products and Levels
28837                    levels.push(lvl);
28838                    products.push(prod);
28839                }
28840
28841            } else if (availableHeaders[c].hID != csvPDFID || availableHeaders[c].hID != csvPlanID || availableHeaders[c].hID != csvPlanMarketingName) {
28842                filters.push({ 'option': obj.data[r][availableHeaders[c].hID] });
28843            }
28844        }
28845        if (availableHeaders[c].hID == csvCodeID || availableHeaders[c].hID == csvPDFID || availableHeaders[c].hID == csvPlanID || availableHeaders[c].hID == csvPlanMarketingName) {
28846
28847        } else {
28848            filterObject[f] = filters;
28849            f++;
28850        }
28851    }
28852
28853    var sortedProds = arrayUnique(products);
28854    var sortedLevels = arrayUnique(levels);
28855
28856    // Add the Body to the Table.
28857    $('#csvTBODY').append(csvBody);
28858
28859    // Set the True if there are brochures/sbc present
28860    if (csvPDFID != null) {
28861        if (broURL != '') {
28862            hasBro = true;
28863            //console.log('hasBro: ' + hasBro);
28864        }
28865        if (sbcURL != '') {
28866            hasSBC = true;
28867            //console.log('hasSBC: ' + hasSBC);
28868        }
28869    }
28870
28871    // Call the function that creates the filter drop downs
28872    makeFilters(sortedProds, sortedLevels, filterObject, hasBro, hasSBC);
28873    getRows(rc);
28874}
28875
28876// Make the Drop Downs in the THEAD to filter the columns
28877function makeFilters(products, levels, filterObj, hasBro, hasSBC) {
28878    $('#csvFILTERS').empty();
28879    var filterRow = '';
28880    var filterCol;
28881    var filterLvl;
28882    products = products.sort();
28883    levels = levels.sort();
28884    for (pf = 0; pf < products.length; pf++) {
28885        if (pf != 0) {
28886            filterCol += '<option value="' + products[pf] + '">' + products[pf] + '</option>';
28887        } else {
28888            filterCol = '<option value="default">Filter By...</option><option value="' + products[pf] + '">' + products[pf] + '</option>';
28889        }
28890    }
28891    for (pl = 0; pl < levels.length; pl++) {
28892        if (!isNaN(levels[pl])) {
28893            if (pl != 0) {
28894                filterLvl += '<option value="' + levels[pl] + '">' + levels[pl] + '</option>';
28895            } else {
28896                filterLvl = '<option value="default">Level</option><option value="' + levels[pl] + '">' + levels[pl] + '</option>';
28897            }
28898        }
28899    }
28900    filterRow += '<th class="hidden"></th><th><select class="filterPage prodname">' + filterCol + '</select><select class="filterPage prodlvl">' + filterLvl + '</select></th>';
28901
28902    var objKeys = Object.keys(filterObj).length;
28903    var i=0;
28904    while(i < objKeys) {
28905        if(i === objKeys) break;
28906        filterCol = '';
28907        var isCash;
28908        var obj2Array = [];
28909        for (var r of filterObj[i]) {
28910            if (r.option != undefined) {
28911                var cash = r.option;
28912                var isMoney = cash.slice(0, 1);
28913                if (isMoney != '$') {
28914                    obj2Array.push(r.option);
28915                    isCash = false;
28916                } else {
28917                    cash = cash.replace('$', '');
28918                    cash = cash.replace(',', '');
28919                    cash = parseInt(cash);
28920                    isCash = true;
28921                    obj2Array.push(cash);
28922                }
28923            }
28924        }
28925        //console.log(obj2Array);
28926        var uniqueFilters = arrayUnique(obj2Array);
28927        if ($.inArray(0, uniqueFilters) !== -1) {
28928            uniqueFilters = uniqueFilters.sort(function (a, b) { return a - b });
28929        } else {
28930            uniqueFilters = uniqueFilters.sort();
28931        }
28932        for (uf = 0; uf < uniqueFilters.length; uf++) {
28933            if (isNaN(uniqueFilters[uf]) == true && isCash == false) {
28934                if (uf != 0) {
28935                    filterCol += '<option value="' + uniqueFilters[uf] + '">' + uniqueFilters[uf] + '</option>';
28936                } else {
28937                    filterCol = '<option value="default">Filter By...</option><option value="' + uniqueFilters[uf] + '">' + uniqueFilters[uf] + '</option>';
28938                }
28939            } else if (isNaN(uniqueFilters[uf]) == true && isCash == true) {
28940                var cashOut = uniqueFilters[uf].toString();
28941                var cashLength = cashOut.length;
28942                if (cashLength > 3) {
28943                    cashOut = cashOut.slice(0, 1) + ',' + cashOut.slice(1);
28944                }
28945                if (uf != 0) {
28946                    filterCol += '<option value="$' + cashOut + '">$' + cashOut + '</option>';
28947                } else {
28948                    filterCol = '<option value="default">Filter By...</option><option value="$' + cashOut + '">$' + cashOut + '</option>';
28949                }
28950            } else {
28951                var cashOut = uniqueFilters[uf].toString();
28952                var cashLength = cashOut.length;
28953                if (cashLength > 3) {
28954                    cashOut = cashOut.slice(0, 1) + ',' + cashOut.slice(1);
28955                }
28956                if (uf != 0) {
28957                    filterCol += '<option value="$' + cashOut + '">$' + cashOut + '</option>';
28958                } else {
28959                    filterCol = '<option value="default">Filter By...</option><option value="$' + cashOut + '">$' + cashOut + '</option>';
28960                }
28961            }
28962        }
28963        filterRow += '<th><select class="filterPage">' + filterCol + '</select></th>';
28964
28965        i++;
28966    }
28967    if (hasBro == true && hasSBC == true) {
28968        //console.log('true true');
28969        $('#csvFILTERS').append(filterRow + '<th></th><th></th>');
28970    } else if (hasBro == true || hasSBC == true) {
28971        //console.log('half true');
28972        $('#csvFILTERS').append(filterRow + '<th></th>');
28973    } else {
28974        //console.log('no true');
28975        $('#csvFILTERS').append(filterRow);
28976    }
28977    initFilter();
28978}
28979$('document').ready(function () {
28980    $('#resultCount').on('change', function () {
28981        var rc = parseInt($('#resultCount').val());
28982        buildCSVTable2(csvObject, rc);
28983    });
28984});
28985/////////////////////////////////////////////////////////////////////
28986/// Ambetter Grid Pages Builder
28987/// By. Sam B.
28988/////////////////////////////////////////////////////////////////////
28989
28990function getPage() {
28991    var curPage = parseInt($('#pageSelect').val());
28992    return curPage;
28993}
28994function checkNextPage() {
28995    var np = getPage() + 1;
28996    if ($('.gridrow[data-page="' + (np + 1) + '"]').hasClass('filtered')) {
28997        $('#nextPage').addClass('disabled');
28998    }
28999}
29000function getPageCount() {
29001    var count = 0;
29002    $('#pageSelect option').each(function () {
29003        count++;
29004    });
29005    return count;
29006}
29007function getRows(rc) {
29008    var p = 0;
29009    $('#filterEmpty').remove();
29010    $('#csvTBODY tr').removeAttr('data-page');
29011    $('#csvTBODY tr').removeClass('gridrow');
29012    $('#csvTBODY tr').each(function () {
29013        if ($(this).hasClass('filtered')) {
29014
29015        } else {
29016            $(this).addClass('gridrow');
29017            p++;
29018        }
29019    });
29020    $('#pageSelect option').remove();
29021    //console.log("get rows p: " + p);
29022    makePages(p, rc);
29023}
29024function makePages(p, rc) {
29025    //console.log("p: " + p);
29026    //console.log("rc: " + rc);
29027    var c1 = 0;
29028    var c2 = 0;
29029    var pages = 0;
29030    var pages2 = 1;
29031    var pageList = '';
29032    if (p != 0) {
29033        //console.log('inside makePages');
29034        for (var i = 0; i < p; i++) {
29035            c1++;
29036            //console.log("c1 : " + c1);
29037            if (c1 === rc) {
29038                //console.log('c1 === rc : ' + c1 + " === " + rc);
29039                pages++;
29040                c1 = 0;
29041                pageList += '<option value="' + pages + '">' + pages + '</option>';
29042                //console.log('pages: ' + pages + ' | c: ' + c );
29043            } else if (i === (p - 1)) {
29044                if (c1 > 0) {
29045                    pages++;
29046                    pageList += '<option value="' + pages + '">' + pages + '</option>';
29047                    c1 = 0;
29048                    //console.log('pages: ' + pages + ' | c: ' + c + ' | i: ' + i );
29049                }
29050            }
29051        }
29052        $('.gridrow').each(function () {
29053            if (c2 === rc) {
29054                pages2++;
29055                c2 = 0;
29056            }
29057            c2++;
29058            if (pages2 != 1) {
29059                $(this).attr('data-page', pages2);
29060                $(this).addClass('hidden');
29061            } else {
29062                $(this).attr('data-page', pages2);
29063            }
29064        });
29065        if (pageList != '') {
29066            $('#pageSelect').append(pageList);
29067            $('tfoot #pageNumber').html(pages2);
29068        };
29069        checkNextPage();
29070    } else {
29071        var fh = 0;
29072        $('#csvFILTERS th').each(function () {
29073            fh++;
29074        });
29075        $('#csvTBODY').append('<tr id="filterEmpty"><td colspan="' + fh + '" align="center"><h3>'+gridTextValues[3]+'</h3></td></tr>');
29076        pageList = '<option value="' + p + '">' + p + '</option>';
29077        $('#pageSelect').append(pageList);
29078        $('tfoot #pageNumber').html(p);
29079    }
29080}
29081$(document).ready(function () {
29082    //console.log('pager JS');
29083    $('#pageSelect').on('change', function () {
29084        var pageNum = $(this).val();
29085        $('.gridrow').addClass('hidden');
29086        if (!!$('.gridrow[data-page="' + pageNum + '"]')) {
29087            $('.gridrow[data-page="' + pageNum + '"]').removeClass('hidden');
29088        }
29089        $(window).scrollTop(0);
29090    });
29091
29092    $('#prevPage').on('click', function (e) {
29093        var pp = getPage() - 1;
29094        if (pp <= 0) {
29095            $(this).addClass('disabled');
29096            e.preventDefault();
29097        } else {
29098            $(this).removeClass('disabled');
29099            $('#pageSelect').val(pp);
29100            $('#pageSelect').val(pp).change();
29101        }
29102    });
29103    $('#nextPage').on('click', function (e) {
29104        var np = getPage() + 1;
29105        var pc = getPageCount();
29106        if (np != 1) {
29107            if (!!$('.gridrow[data-page="' + np + '"]')) {
29108                if ($('.gridrow[data-page="' + (np + 1) + '"]').hasClass('filtered')) {
29109                    e.preventDefault();
29110                } else if (np <= pc) {
29111                    $(this).removeClass('disabled');
29112                    $('#pageSelect').val(np);
29113                    $('#pageSelect').val(np).change();
29114                } else {
29115                    e.preventDefault();
29116                }
29117
29118            } else {
29119                e.preventDefault();
29120            }
29121        } else {
29122            e.preventDefault();
29123        }
29124    });
29125});
29126/*!
29127	Papa Parse
29128	v4.1.0
29129	https://github.com/mholt/PapaParse
29130*/
29131!(function(e){"use strict";function u(t,n){n=n||{};if(n.worker&&Papa.WORKERS_SUPPORTED){var r=m();r.userStep=n.step;r.userChunk=n.chunk;r.userComplete=n.complete;r.userError=n.error;n.step=x(n.step);n.chunk=x(n.chunk);n.complete=x(n.complete);n.error=x(n.error);delete n.worker;r.postMessage({input:t,config:n,workerId:r.id});return}var i=null;if(typeof t==="string"){if(n.download)i=new l(n);else i=new h(n)}else if(e.File&&t instanceof File||t instanceof Object)i=new c(n);return i.stream(t)}function a(t,n){function a(){if(typeof n!=="object")return;if(typeof n.delimiter==="string"&&n.delimiter.length==1&&e.Papa.BAD_DELIMITERS.indexOf(n.delimiter)==-1){o=n.delimiter}if(typeof n.quotes==="boolean"||n.quotes instanceof Array)s=n.quotes;if(typeof n.newline==="string")u=n.newline}function f(e){if(typeof e!=="object")return[];var t=[];for(var n in e)t.push(n);return t}function l(e,t){var n="";if(typeof e==="string")e=JSON.parse(e);if(typeof t==="string")t=JSON.parse(t);var r=e instanceof Array&&e.length>0;var i=!(t[0]instanceof Array);if(r){for(var s=0;s<e.length;s++){if(s>0)n+=o;n+=c(e[s],s)}if(t.length>0)n+=u}for(var a=0;a<t.length;a++){var f=r?e.length:t[a].length;for(var l=0;l<f;l++){if(l>0)n+=o;var h=r&&i?e[l]:l;n+=c(t[a][h],l)}if(a<t.length-1)n+=u}return n}function c(t,n){if(typeof t==="undefined"||t===null)return"";t=t.toString().replace(/"/g,'""');var r=typeof s==="boolean"&&s||s instanceof Array&&s[n]||h(t,e.Papa.BAD_DELIMITERS)||t.indexOf(o)>-1||t.charAt(0)==" "||t.charAt(t.length-1)==" ";return r?'"'+t+'"':t}function h(e,t){for(var n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return true;return false}var r="";var i=[];var s=false;var o=",";var u="\r\n";a();if(typeof t==="string")t=JSON.parse(t);if(t instanceof Array){if(!t.length||t[0]instanceof Array)return l(null,t);else if(typeof t[0]==="object")return l(f(t[0]),t)}else if(typeof t==="object"){if(typeof t.data==="string")t.data=JSON.parse(t.data);if(t.data instanceof Array){if(!t.fields)t.fields=t.data[0]instanceof Array?t.fields:f(t.data[0]);if(!(t.data[0]instanceof Array)&&typeof t.data[0]!=="object")t.data=[t.data]}return l(t.fields||[],t.data||[])}throw"exception: Unable to serialize unrecognized input"}function f(n){function r(e){var t=E(e);t.chunkSize=parseInt(t.chunkSize);this._handle=new p(t);this._handle.streamer=this;this._config=t}this._handle=null;this._paused=false;this._finished=false;this._input=null;this._baseIndex=0;this._partialLine="";this._rowCount=0;this._start=0;this._nextChunk=null;r.call(this,n);this.parseChunk=function(n){var r=this._partialLine+n;this._partialLine="";var i=this._handle.parse(r,this._baseIndex,!this._finished);if(this._handle.paused())return;var s=i.meta.cursor;if(!this._finished){this._partialLine=r.substring(s-this._baseIndex);this._baseIndex=s}if(i&&i.data)this._rowCount+=i.data.length;var o=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(t){e.postMessage({results:i,workerId:Papa.WORKER_ID,finished:o})}else if(x(this._config.chunk)){this._config.chunk(i,this._handle);if(this._paused)return;i=undefined}if(o&&x(this._config.complete)&&(!i||!i.meta.aborted))this._config.complete(i);if(!o&&(!i||!i.meta.paused))this._nextChunk();return i};this._sendError=function(n){if(x(this._config.error))this._config.error(n);else if(t&&this._config.error){e.postMessage({workerId:Papa.WORKER_ID,error:n,finished:false})}}}function l(e){function r(e){var t=e.getResponseHeader("Content-Range");return parseInt(t.substr(t.lastIndexOf("/")+1))}e=e||{};
29131if(!e.chunkSize)e.chunkSize=Papa.RemoteChunkSize;f.call(this,e);var n;if(t){this._nextChunk=function(){this._readChunk();this._chunkLoaded()}}else{this._nextChunk=function(){this._readChunk()}}this.stream=function(e){this._input=e;this._nextChunk()};this._readChunk=function(){if(this._finished){this._chunkLoaded();return}n=new XMLHttpRequest;if(!t){n.onload=S(this._chunkLoaded,this);n.onerror=S(this._chunkError,this)}n.open("GET",this._input,!t);if(this._config.step||this._config.chunk){var e=this._start+this._config.chunkSize-1;n.setRequestHeader("Range","bytes="+this._start+"-"+e);n.setRequestHeader("If-None-Match","webkit-no-cache")}try{n.send()}catch(r){this._chunkError(r.message)}if(t&&n.status==0)this._chunkError();else this._start+=this._config.chunkSize};this._chunkLoaded=function(){if(n.readyState!=4)return;if(n.status<200||n.status>=400){this._chunkError();return}this._finished=!this._config.step&&!this._config.chunk||this._start>r(n);this.parseChunk(n.responseText)};this._chunkError=function(e){var t=n.statusText||e;this._sendError(t)}}function c(e){e=e||{};if(!e.chunkSize)e.chunkSize=Papa.LocalChunkSize;f.call(this,e);var t,n;var r=typeof FileReader!=="undefined";this.stream=function(e){this._input=e;n=e.slice||e.webkitSlice||e.mozSlice;if(r){t=new FileReader;t.onload=S(this._chunkLoaded,this);t.onerror=S(this._chunkError,this)}else t=new FileReaderSync;this._nextChunk()};this._nextChunk=function(){if(!this._finished&&(!this._config.preview||this._rowCount<this._config.preview))this._readChunk()};this._readChunk=function(){var e=Math.min(this._start+this._config.chunkSize,this._input.size);var i=t.readAsText(n.call(this._input,this._start,e),this._config.encoding);if(!r)this._chunkLoaded({target:{result:i}})};this._chunkLoaded=function(e){this._start+=this._config.chunkSize;this._finished=this._start>=this._input.size;this.parseChunk(e.target.result)};this._chunkError=function(){this._sendError(t.error)}}function h(e){e=e||{};f.call(this,e);var t;var n;this.stream=function(e){t=e;n=e;return this._nextChunk()};this._nextChunk=function(){if(this._finished)return;var e=this._config.chunkSize;var t=e?n.substr(0,e):n;n=e?n.substr(e):"";this._finished=!n;return this.parseChunk(t)}}function p(e){function c(){if(f&&u){b("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+Papa.DefaultDelimiter+"'");u=false}if(e.skipEmptyLines){for(var t=0;t<f.data.length;t++)if(f.data[t].length==1&&f.data[t][0]=="")f.data.splice(t--,1)}if(h())p();return v()}function h(){return e.header&&a.length==0}function p(){if(!f)return;for(var e=0;h()&&e<f.data.length;e++)for(var t=0;t<f.data[e].length;t++)a.push(f.data[e][t]);f.data.splice(0,1)}function v(){if(!f||!e.header&&!e.dynamicTyping)return f;for(var t=0;t<f.data.length;t++){var n={};for(var r=0;r<f.data[t].length;r++){if(e.dynamicTyping){var i=f.data[t][r];if(i=="true")f.data[t][r]=true;else if(i=="false")f.data[t][r]=false;else f.data[t][r]=y(i)}if(e.header){if(r>=a.length){if(!n["__parsed_extra"])n["__parsed_extra"]=[];n["__parsed_extra"].push(f.data[t][r])}else n[a[r]]=f.data[t][r]}}if(e.header){f.data[t]=n;if(r>a.length)b("FieldMismatch","TooManyFields","Too many fields: expected "+a.length+" fields but parsed "+r,t);else if(r<a.length)b("FieldMismatch","TooFewFields","Too few fields: expected "+a.length+" fields but parsed "+r,t)}}if(e.header&&f.meta)f.meta.fields=a;return f}function m(t){var n=[",","	","|",";",Papa.RECORD_SEP,Papa.UNIT_SEP];var r,i,s;for(var o=0;o<n.length;o++){var u=n[o];var a=0,f=0;s=undefined;var l=(new d({delimiter:u,preview:10})).parse(t);for(var c=0;c<l.data.length;c++){var h=l.data[c].length;f+=h;if(typeof s==="undefined"){s=h;continue}else if(h>1){a+=Math.abs(h-s);s=h}}f/=l.data.length;if((typeof i==="undefined"||a<i)&&f>1.99){i=a;r=u}}e.delimiter=r;return{successful:!!r,bestDelimiter:r}}function g(e){e=e.substr(0,1024*1024);var t=e.split("\r");if(t.length==1)return"\n";var n=0;for(var r=0;r<t.length;r++){if(t[r][0]=="\n")n++}return n>=t.length/2?"\r\n":"\r"}function y(e){var n=t.test(e);return n?parseFloat(e):e}function b(e,t,n,r){f.errors.push({type:e,code:t,message:n,row:r})}var t=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i;var n=this;var r=0;var i;var s;var o=false;var u;var a=[];var f={data:[],errors:[],meta:{}};if(x(e.step)){var l=e.step;e.step=function(t){f=t;if(h())c();else{c();if(f.data.length==0)return;r+=t.data.length;if(e.preview&&r>e.preview)s.abort();else l(f,n)}}}this.parse=function(t,n,r){if(!e.newline)e.newline=g(t);u=false;if(!e.delimiter){var a=m(t);if(a.successful)e.delimiter=a.bestDelimiter;else{u=true;e.delimiter=Papa.DefaultDelimiter}f.meta.delimiter=e.delimiter}var l=E(e);if(e.preview&&e.header)l.preview++;i=t;s=new d(l);f=s.parse(i,n,r);c();return o?{meta:{paused:true}}:f||{meta:{paused:false}}};this.paused=function(){return o};this.pause=function(){o=true;s.abort();i=i.substr(s.getCharIndex())};this.resume=function(){o=false;n.streamer.parseChunk(i)};this.abort=function(){s.abort();if(x(e.complete))e.complete(f);i=""}}function d(e){e=e||{};var t=e.delimiter;var n=e.newline;var r=e.comments;var i=e.step;var s=e.preview;var o=e.fastMode;if(typeof t!=="string"||t.length!=1||Papa.BAD_DELIMITERS.indexOf(t)>-1)t=",";if(r===t)throw"Comment character same as delimiter";else if(r===true)r="#";else if(typeof r!=="string"||Papa.BAD_DELIMITERS.indexOf(r)>-1)r=false;if(n!="\n"&&n!="\r"&&n!="\r\n")n="\n";var u=0;var a=false;this.parse=function(e,f,l){function C(e){m.push(e);b=u}function k(t){if(l)return A();if(!t)t=e.substr(u);y.push(t);u=c;C(y);if(v)O();return A()}function L(t){u=t;C(y);y=[];x=e.indexOf(n,u)}function A(e){return{data:m,errors:g,meta:{delimiter:t,linebreak:n,aborted:a,truncated:!!e,cursor:b+(f||0)}}}function O(){i(A());m=[],g=[]}if(typeof e!=="string")throw"Input must be a string";var c=e.length,h=t.length,p=n.length,d=r.length;var v=typeof i==="function";u=0;var m=[],g=[],y=[],b=0;if(!e)return A();if(o||o!==false&&e.indexOf('"')===-1){var w=e.split(n);for(var E=0;E<w.length;E++){var y=w[E];u+=y.length;if(E!==w.length-1)u+=n.length;else if(l)return A();if(r&&y.substr(0,d)==r)continue;if(v){m=[];C(y.split(t));O();if(a)return A()}else C(y.split(t));if(s&&E>=s){m=m.slice(0,s);return A(true)}}return A()}var S=e.indexOf(t,u);var x=e.indexOf(n,u);for(;;){if(e[u]=='"'){var T=u;u++;for(;;){var T=e.indexOf('"',T+1);if(T===-1){if(!l){g.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:m.length,index:u})}return k()}if(T===c-1){var N=e.substring(u,T).replace(/""/g,'"');return k(N)}if(e[T+1]=='"'){T++;continue}if(e[T+1]==t){y.push(e.substring(u,T).replace(/""/g,'"'));u=T+1+h;S=e.indexOf(t,u);x=e.indexOf(n,u);break}if(e.substr(T+1,p)===n){y.push(e.substring(u,T).replace(/""/g,'"'));L(T+1+p);S=e.indexOf(t,u);if(v){O();if(a)return A()}if(s&&m.length>=s)return A(true);break}}continue}if(r&&y.length===0&&e.substr(u,d)===r){if(x==-1)return A();u=x+p;x=e.indexOf(n,u);S=e.indexOf(t,u);continue}if(S!==-1&&(S<x||x===-1)){y.push(e.substring(u,S));u=S+h;S=e.indexOf(t,u);continue}if(x!==-1){y.push(e.substring(u,x));L(x+p);if(v){O();if(a)return A()}if(s&&m.length>=s)return A(true);continue}break}return k()};this.abort=function(){a=true};this.getCharIndex=function(){return u}}function v(){var e=document.getElementsByTagName("script");return e.length?e[e.length-1].src:""}function m(){if(!Papa.WORKERS_SUPPORTED)return false;if(!n&&Papa.SCRIPT_PATH===null)throw new Error("Script path cannot be determined automatically when Papa Parse is loaded asynchronously. "+"You need to set Papa.SCRIPT_PATH manually.");var t=new e.Worker(Papa.SCRIPT_PATH||r);t.onmessage=g;t.id=s++;i[t.id]=t;return t}function g(e){var t=e.data;var n=i[t.workerId];var r=false;if(t.error)n.userError(t.error,t.file);else if(t.results&&t.results.data){var s=function(){r=true;y(t.workerId,{data:[],errors:[],meta:{aborted:true}})};var o={abort:s,pause:b,resume:b};if(x(n.userStep)){for(var u=0;u<t.results.data.length;u++){n.userStep({data:[t.results.data[u]],errors:t.results.errors,meta:t.results.meta},o);if(r)break}delete t.results}else if(x(n.userChunk)){n.userChunk(t.results,o,t.file);delete t.results}}if(t.finished&&!r)y(t.workerId,t.results)}function y(e,t){var n=i[e];if(x(n.userComplete))n.userComplete(t);n.terminate();delete i[e]}function b(){throw"Not implemented."}function w(t){var n=t.data;if(typeof Papa.WORKER_ID==="undefined"&&n)Papa.WORKER_ID=n.workerId;if(typeof n.input==="string"){e.postMessage({workerId:Papa.WORKER_ID,results:Papa.parse(n.input,n.config),finished:true})}else if(e.File&&n.input instanceof File||n.input instanceof Object){var r=Papa.parse(n.input,n.config);if(r)e.postMessage({workerId:Papa.WORKER_ID,results:r,finished:true})}}function E(e){if(typeof e!=="object")return e;var t=e instanceof Array?[]:{};for(var n in e)t[n]=E(e[n]);return t}function S(e,t){return function(){e.apply(t,arguments)}}function x(e){return typeof e==="function"}var t=!e.document,n=false,r;var i={},s=0;e.Papa={};e.Papa.parse=u;e.Papa.unparse=a;e.Papa.RECORD_SEP=String.fromCharCode(30);e.Papa.UNIT_SEP=String.fromCharCode(31);e.Papa.BYTE_ORDER_MARK="";e.Papa.BAD_DELIMITERS=["\r","\n",'"',e.Papa.BYTE_ORDER_MARK];e.Papa.WORKERS_SUPPORTED=!!e.Worker;e.Papa.SCRIPT_PATH=null;e.Papa.LocalChunkSize=1024*1024*10;e.Papa.RemoteChunkSize=1024*1024*5;e.Papa.DefaultDelimiter=",";e.Papa.Parser=d;e.Papa.ParserHandle=p;e.Papa.NetworkStreamer=l;e.Papa.FileStreamer=c;e.Papa.StringStreamer=h;if(e.jQuery){var o=e.jQuery;o.fn.parse=function(t){function i(){if(r.length==0){if(x(t.complete))t.complete();return}var e=r[0];if(x(t.before)){var n=t.before(e.file,e.inputElem);if(typeof n==="object"){if(n.action=="abort"){s("AbortError",e.file,e.inputElem,n.reason);return}else if(n.action=="skip"){u();return}else if(typeof n.config==="object")e.instanceConfig=o.extend(e.instanceConfig,n.config)}else if(n=="skip"){u();return}}var i=e.instanceConfig.complete;e.instanceConfig.complete=function(t){if(x(i))i(t,e.file,e.inputElem);u()};Papa.parse(e.file,e.instanceConfig)}function s(e,n,r,i){if(x(t.error))t.error({name:e},n,r,i)}function u(){r.splice(0,1);i()}var n=t.config||{};var r=[];this.each(function(t){var i=o(this).prop("tagName").toUpperCase()=="INPUT"&&o(this).attr("type").toLowerCase()=="file"&&e.FileReader;if(!i||!this.files||this.files.length==0)return true;for(var s=0;s<this.files.length;s++){r.push({file:this.files[s],inputElem:this,instanceConfig:o.extend({},n)})}});i();return this}}if(t){e.onmessage=w}else if(Papa.WORKERS_SUPPORTED){r=v();if(!document.body){n=true}else{document.addEventListener("DOMContentLoaded",function(){n=true},true)}}l.prototype=Object.create(f.prototype);l.prototype.constructor=l;c.prototype=Object.create(f.prototype);c.prototype.constructor=c;h.prototype=Object.create(h.prototype);h.prototype.constructor=h})(this);
29132/////////////////////////////////////////////////////////////////////
29133/// Ambetter Grid Filter
29134/// By. Sam B.
29135/////////////////////////////////////////////////////////////////////
29136
29137// Have to call this in the ambettergrid.js because there was an issue with it trying to fire before the table was ready
29138function initFilter() {
29139
29140    var filterOption = $('.filterPage');
29141
29142    // Assign an ID to our select boxes
29143    var fid = 1;
29144    $('#csvFILTERS th').each(function () {
29145        $(this).attr('filter-id', fid);
29146        fid++;
29147    });
29148
29149    // Assign an ID to our header names
29150    var cid = 1;
29151    $('#csvTHEAD th').each(function () {
29152        $(this).attr('col-id', cid);
29153        cid++;
29154    });
29155
29156    // Add the correct colspan to the footer so our table has the proper HTML syntax
29157    //$('#footFiller').attr('colspan', cid - 4);
29158    $('.footFiller').attr('colspan', cid - 2);
29159    // When a select->option-val is clicked
29160    filterOption.on('change', function () {
29161        filterRows();
29162    });
29163
29164    // Filter Rows based on select->option->val : allows for multiple filters to be active
29165    function filterRows() {
29166        $('#csvTBODY tr').removeClass('filtered');
29167        filterOption.each(function () {
29168            var cv = $(this).val();
29169            var filterID = $(this).closest('th').attr('filter-id');
29170            //console.log('cv: ' + cv);
29171            if (filterID != 2) {
29172                if ($(this).val() == 'default') {
29173
29174                } else {
29175                    $('#csvTBODY tr td:nth-child(' + filterID + ')').each(function () {
29176                        if ($(this).is(':contains("' + cv + '")') && $(this).parent().hasClass('filtered')) {
29177
29178                        } else if ($(this).is(':contains("' + cv + '")')) {
29179                            $(this).parent().removeClass('hidden');
29180                            $(this).parent().prependTo('#csvTBODY');
29181                        } else {
29182                            $(this).closest('tr').addClass('filtered hidden');
29183                        }
29184                    });
29185                }
29186            } else {
29187                if ($(this).val() == 'default') {
29188
29189                } else {
29190                    //console.log('cv: ' + cv);
29191                    cv = cv.replaceAll(' ', '');
29192                    $('#csvTBODY tr td:nth-child(1)').each(function () {
29193                        if ($(this).is(':contains("' + cv + '")') && $(this).parent().hasClass('filtered')) {
29194
29195                        } else if ($(this).is(':contains("' + cv + '")')) {
29196                            $(this).parent().removeClass('hidden');
29197                            $(this).parent().prependTo('#csvTBODY');
29198                        } else {
29199                            $(this).closest('tr').addClass('filtered hidden');
29200                        }
29201                    });
29202                }
29203            }
29204        });
29205        // Calling getRows(); from the ambettergridpager.js // This builds our table body and makes sure our paging is correct
29206        getRows();
29207
29208    }
29209
29210    // RESET Button
29211    $('#resetAllFilters').on('click', function () {
29212        filterOption.val('default').change();
29213        $('#csvTBODY tr').removeClass('filtered');
29214        $('#csvTBODY tr').removeClass('hidden');
29215        // Calling getRows(); from the ambettergridpager.js // This builds our table body and makes sure our paging is correct
29216        getRows();
29217    });
29218
29219    // This is for filtering Columns by asc -> desc, not working right currently so it is hidden
29220
29221    // var headerOption = $('.headerCol');
29222
29223    // headerOption.on('click', function() {
29224    // 	filterCols($(this).attr('col-id'));
29225    // });
29226
29227    // function filterCols(column) {
29228    // 	var $tbody = $('#csvTBODY');
29229    // 	console.log('column: ' + column);
29230    // 	$('.gridrow').removeAttr('data-page');
29231    // 	$('.gridrow').removeClass('sortCol');
29232    // 	if ($('#csvTBODY tr').hasClass('filtered')) {
29233
29234    //    		} else {
29235    //    			$('.gridrow').addClass('sortCol');
29236    //    			$('.gridrow').removeClass('hidden');
29237    //    		}
29238
29239    // 	$tbody.find('.sortCol').sort(function(a,b){
29240
29241    //     		var tda = $(a).find('td:eq(' + column + ')').text(); // can replace 1 with the column you want to sort on
29242    //     		var tdb = $(b).find('td:eq(' + column + ')').text(); // this will sort on the second column
29243    //             // if a < b return 1
29244    //     		return tda < tdb ? 1
29245    //            // else if a > b return -1
29246    //            : tda > tdb ? -1
29247    //            // else they are equal - return 0
29248    //            : 0;
29249
29250    // 	}).appendTo($tbody);
29251    // 	getRows();
29252    // }
29253    //
29254
29255    // Grab the product from the URL if it is passed
29256    function getProductParameter() {
29257        var productCode = '';
29258        var urlCodeString = window.location.search.substring(1);
29259        if (urlCodeString != '') {
29260            var urlVariables = urlCodeString.split('&');
29261            for (var i = 0; i < urlVariables.length; i++) {
29262                paramName = urlVariables[i].split('=');
29263                if (paramName[0] === 'plan') {
29264                    productCode = paramName[1].replace(/%20/g, " ");
29265                    productCode = productCode.replace(/ /g, "");
29266                    productCode = productCode.replace(/([A-Z]+)/g, "$1").replace(/([A-Z][a-z])/g, " $1");
29267                    var index = productCode.search(/\d/);
29268                    var productLevel = productCode.slice(index - 1, index);
29269                    if (productLevel == ' ') {
29270                        productLevel = productCode.slice(index - 1);
29271                        productLevel = productLevel.trim(0);
29272                        productCode = productCode.slice(0, index - 1);
29273                        productCode = productCode.trim(0);
29274                    } else {
29275                        productLevel = productCode.slice(index);
29276                        productCode = productCode.replace(/[0-9]/g, '');
29277                        productCode = productCode.trim(0);
29278                    }
29279                }
29280            }
29281            if (productCode != '') {
29282                productFilter(productCode, productLevel);
29283            }
29284        }
29285    }
29286
29287    function productFilter(code, level) {
29288        $('.prodname').val(code);
29289        $('.prodname').change();
29290        if (!isNaN(level)) {
29291            $('.prodlvl').val(level);
29292            $('.prodlvl').change();
29293        }
29294    }
29295
29296    getProductParameter()
29297};
29298
29299$("document").ready(function () {
29300    if (document.cookie.indexOf("hasClosedCookie") == -1) {
29301        $("html").addClass("has-cookie")
29302    }
29303    $(".cookie-close").on("click", function () {
29304        $(".cookie-bar").fadeOut(500, function () {
29305            $(".cookie-bar").remove()
29306        });
29307        $("html").removeClass("has-cookie")
29308        document.cookie = "hasClosedCookie=true; max-age=864000; path=/; ";
29309    });
29310});
29311function cleanZips(stringZips) {
29312    var zipString = stringZips;
29313    var zips = new Array();
29314    zips = zipString.split(',');
29315    for (var i in zips) {
29316        zips[i] = cleanZipString(zips[i].toString());
29317    }
29318    return zips;
29319}
29320
29321function cleanZipString(stringZip) {
29322    if (stringZip.charAt(0) === " ") {
29323        stringZip = stringZip.substr(1);
29324    }
29325    return stringZip;
29326}
29327
29328function checkZip(searchZip) {
29329    var matchingIDs = new Array();
29330    for (var i = 0; zipRegions[i]; i++) {
29331        for (var j = 0; zipRegions[i]["zips"][j]; j++) {
29332            if (zipRegions[i]["zips"][j] == searchZip) {
29333                matchingIDs.push(zipRegions[i]);
29334            }
29335        }
29336    }
29337    return matchingIDs;
29338}
29339
29340var zipRegions = new Array();
29341function setZipRegionValues(id, zips, index) {
29342    var region = new Object();
29343    region["id"] = id;
29344    var zipList = new Array();
29345    zipList = cleanZips(zips);
29346    region["zips"] = zipList;
29347    zipRegions[index] = region;
29348}
29349
29350$(document).ready(function ($) {
29351    $(".region-description").hide("fast");
29352    $(".error").hide("fast");
29353    function searchZip(search) {
29354        var zipData = checkZip(search);
29355        if (zipData.length != '0') {
29356            $(".region-description").hide("fast");
29357            $(".error").hide("fast");
29358            for (var i = 0; zipData[i]; i++) {
29359                $("#" + zipData[i].id).show("slow");
29360            }
29361        }
29362        else {
29363            $(".region-description").hide("fast");
29364            $(".error").show("slow");
29365        }
29366    }
29367    $('.region-description').each(function (index) {
29368        setZipRegionValues($(this).attr('id'), $(this).children('.zip-codes').text(), index);
29369    });
29370    $('#searchZip').keypress(function (e) {
29371        if (e.which == 13) {
29372            // enter pressed
29373            var getSearch = $(this).val();
29374            searchZip(getSearch);
29375        }
29376    });
29377    $('#searchZipBtn').on('click', function () {
29378        var getSearch = $('#searchZip').val();
29379        searchZip(getSearch);
29380    });
29381});
29382
29383/**
29384 * Copyright (c) 2011-2014 Felix Gnass
29385 * Licensed under the MIT license
29386 * http://spin.js.org/
29387 *
29388 * Example:
29389    var opts = {
29390      lines: 12             // The number of lines to draw
29391    , length: 7             // The length of each line
29392    , width: 5              // The line thickness
29393    , radius: 10            // The radius of the inner circle
29394    , scale: 1.0            // Scales overall size of the spinner
29395    , corners: 1            // Roundness (0..1)
29396    , color: '#000'         // #rgb or #rrggbb
29397    , opacity: 1/4          // Opacity of the lines
29398    , rotate: 0             // Rotation offset
29399    , direction: 1          // 1: clockwise, -1: counterclockwise
29400    , speed: 1              // Rounds per second
29401    , trail: 100            // Afterglow percentage
29402    , fps: 20               // Frames per second when using setTimeout()
29403    , zIndex: 2e9           // Use a high z-index by default
29404    , className: 'spinner'  // CSS class to assign to the element
29405    , top: '50%'            // center vertically
29406    , left: '50%'           // center horizontally
29407    , shadow: false         // Whether to render a shadow
29408    , hwaccel: false        // Whether to use hardware acceleration (might be buggy)
29409    , position: 'absolute'  // Element positioning
29410    }
29411    var target = document.getElementById('foo')
29412    var spinner = new Spinner(opts).spin(target)
29413 */
29414; (function (root, factory) {
29415
29416    /* CommonJS */
29417    if (typeof module == 'object' && module.exports) module.exports = factory()
29418
29419    /* AMD module */
29420    else if (typeof define == 'function' && define.amd) define(factory)
29421
29422    /* Browser global */
29423    else root.Spinner = factory()
29424}(this, function () {
29425    "use strict"
29426
29427    var prefixes = ['webkit', 'Moz', 'ms', 'O'] /* Vendor prefixes */
29428        , animations = {} /* Animation rules keyed by their name */
29429        , useCssAnimations /* Whether to use CSS animations or setTimeout */
29430        , sheet /* A stylesheet to hold the @keyframe or VML rules. */
29431
29432    /**
29433     * Utility function to create elements. If no tag name is given,
29434     * a DIV is created. Optionally properties can be passed.
29435     */
29436    function createEl(tag, prop) {
29437        var el = document.createElement(tag || 'div')
29438            , n
29439
29440        for (n in prop) el[n] = prop[n]
29441        return el
29442    }
29443
29444    /**
29445     * Appends children and returns the parent.
29446     */
29447    function ins(parent /* child1, child2, ...*/) {
29448        for (var i = 1, n = arguments.length; i < n; i++) {
29449            parent.appendChild(arguments[i])
29450        }
29451
29452        return parent
29453    }
29454
29455    /**
29456     * Creates an opacity keyframe animation rule and returns its name.
29457     * Since most mobile Webkits have timing issues with animation-delay,
29458     * we create separate rules for each line/segment.
29459     */
29460    function addAnimation(alpha, trail, i, lines) {
29461        var name = ['opacity', trail, ~~(alpha * 100), i, lines].join('-')
29462            , start = 0.01 + i / lines * 100
29463            , z = Math.max(1 - (1 - alpha) / trail * (100 - start), alpha)
29464            , prefix = useCssAnimations.substring(0, useCssAnimations.indexOf('Animation')).toLowerCase()
29465            , pre = prefix && '-' + prefix + '-' || ''
29466
29467        if (!animations[name]) {
29468            sheet.insertRule(
29469                '@' + pre + 'keyframes ' + name + '{' +
29470                '0%{opacity:' + z + '}' +
29471                start + '%{opacity:' + alpha + '}' +
29472                (start + 0.01) + '%{opacity:1}' +
29473                (start + trail) % 100 + '%{opacity:' + alpha + '}' +
29474                '100%{opacity:' + z + '}' +
29475                '}', sheet.cssRules.length)
29476
29477            animations[name] = 1
29478        }
29479
29480        return name
29481    }
29482
29483    /**
29484     * Tries various vendor prefixes and returns the first supported property.
29485     */
29486    function vendor(el, prop) {
29487        var s = el.style
29488            , pp
29489            , i
29490
29491        prop = prop.charAt(0).toUpperCase() + prop.slice(1)
29492        if (s[prop] !== undefined) return prop
29493        for (i = 0; i < prefixes.length; i++) {
29494            pp = prefixes[i] + prop
29495            if (s[pp] !== undefined) return pp
29496        }
29497    }
29498
29499    /**
29500     * Sets multiple style properties at once.
29501     */
29502    function css(el, prop) {
29503        for (var n in prop) {
29504            el.style[vendor(el, n) || n] = prop[n]
29505        }
29506
29507        return el
29508    }
29509
29510    /**
29511     * Fills in default values.
29512     */
29513    function merge(obj) {
29514        for (var i = 1; i < arguments.length; i++) {
29515            var def = arguments[i]
29516            for (var n in def) {
29517                if (obj[n] === undefined) obj[n] = def[n]
29518            }
29519        }
29520        return obj
29521    }
29522
29523    /**
29524     * Returns the line color from the given string or array.
29525     */
29526    function getColor(color, idx) {
29527        return typeof color == 'string' ? color : color[idx % color.length]
29528    }
29529
29530    // Built-in defaults
29531
29532    var defaults = {
29533        lines: 12             // The number of lines to draw
29534        , length: 7             // The length of each line
29535        , width: 5              // The line thickness
29536        , radius: 10            // The radius of the inner circle
29537        , scale: 1.0            // Scales overall size of the spinner
29538        , corners: 1            // Roundness (0..1)
29539        , color: '#6e6e6e'         // #rgb or #rrggbb
29540        , opacity: 1 / 4          // Opacity of the lines
29541        , rotate: 0             // Rotation offset
29542        , direction: 1          // 1: clockwise, -1: counterclockwise
29543        , speed: 1              // Rounds per second
29544        , trail: 100            // Afterglow percentage
29545        , fps: 20               // Frames per second when using setTimeout()
29546        , zIndex: 2e9           // Use a high z-index by default
29547        , className: 'spinner'  // CSS class to assign to the element
29548        , top: '50%'            // center vertically
29549        , left: '50%'           // center horizontally
29550        , shadow: false         // Whether to render a shadow
29551        , hwaccel: false        // Whether to use hardware acceleration (might be buggy)
29552        , position: 'absolute'  // Element positioning
29553    }
29554
29555    /** The constructor */
29556    function Spinner(o) {
29557        this.opts = merge(o || {}, Spinner.defaults, defaults)
29558    }
29559
29560    // Global defaults that override the built-ins:
29561    Spinner.defaults = {}
29562
29563    merge(Spinner.prototype, {
29564        /**
29565         * Adds the spinner to the given target element. If this instance is already
29566         * spinning, it is automatically removed from its previous target b calling
29567         * stop() internally.
29568         */
29569        spin: function (target) {
29570            this.stop()
29571
29572            var self = this
29573                , o = self.opts
29574                , el = self.el = createEl(null, { className: o.className })
29575
29576            css(el, {
29577                position: o.position
29578                , width: 0
29579                , zIndex: o.zIndex
29580                , left: o.left
29581                , top: o.top
29582            })
29583
29584            if (target) {
29585                target.insertBefore(el, target.firstChild || null)
29586            }
29587
29588            el.setAttribute('role', 'progressbar')
29589            self.lines(el, self.opts)
29590
29591            if (!useCssAnimations) {
29592                // No CSS animation support, use setTimeout() instead
29593                var i = 0
29594                    , start = (o.lines - 1) * (1 - o.direction) / 2
29595                    , alpha
29596                    , fps = o.fps
29597                    , f = fps / o.speed
29598                    , ostep = (1 - o.opacity) / (f * o.trail / 100)
29599                    , astep = f / o.lines
29600
29601                    ; (function anim() {
29602                        i++
29603                        for (var j = 0; j < o.lines; j++) {
29604                            alpha = Math.max(1 - (i + (o.lines - j) * astep) % f * ostep, o.opacity)
29605
29606                            self.opacity(el, j * o.direction + start, alpha, o)
29607                        }
29608                        self.timeout = self.el && setTimeout(anim, ~~(1000 / fps))
29609                    })()
29610            }
29611            return self
29612        }
29613
29614        /**
29615         * Stops and removes the Spinner.
29616         */
29617        , stop: function () {
29618            var el = this.el
29619            if (el) {
29620                clearTimeout(this.timeout)
29621                if (el.parentNode) el.parentNode.removeChild(el)
29622                this.el = undefined
29623            }
29624            return this
29625        }
29626
29627        /**
29628         * Internal method that draws the individual lines. Will be overwritten
29629         * in VML fallback mode below.
29630         */
29631        , lines: function (el, o) {
29632            var i = 0
29633                , start = (o.lines - 1) * (1 - o.direction) / 2
29634                , seg
29635
29636            function fill(color, shadow) {
29637                return css(createEl(), {
29638                    position: 'absolute'
29639                    , width: o.scale * (o.length + o.width) + 'px'
29640                    , height: o.scale * o.width + 'px'
29641                    , background: color
29642                    , boxShadow: shadow
29643                    , transformOrigin: 'left'
29644                    , transform: 'rotate(' + ~~(360 / o.lines * i + o.rotate) + 'deg) translate(' + o.scale * o.radius + 'px' + ',0)'
29645                    , borderRadius: (o.corners * o.scale * o.width >> 1) + 'px'
29646                })
29647            }
29648
29649            for (; i < o.lines; i++) {
29650                seg = css(createEl(), {
29651                    position: 'absolute'
29652                    , top: 1 + ~(o.scale * o.width / 2) + 'px'
29653                    , transform: o.hwaccel ? 'translate3d(0,0,0)' : ''
29654                    , opacity: o.opacity
29655                    , animation: useCssAnimations && addAnimation(o.opacity, o.trail, start + i * o.direction, o.lines) + ' ' + 1 / o.speed + 's linear infinite'
29656                })
29657
29658                if (o.shadow) ins(seg, css(fill('#000', '0 0 4px #000'), { top: '2px' }))
29659                ins(el, ins(seg, fill(getColor(o.color, i), '0 0 1px rgba(0,0,0,.1)')))
29660            }
29661            return el
29662        }
29663
29664        /**
29665         * Internal method that adjusts the opacity of a single line.
29666         * Will be overwritten in VML fallback mode below.
29667         */
29668        , opacity: function (el, i, val) {
29669            if (i < el.childNodes.length) el.childNodes[i].style.opacity = val
29670        }
29671
29672    })
29673
29674
29675    function initVML() {
29676
29677        /* Utility function to create a VML tag */
29678        function vml(tag, attr) {
29679            return createEl('<' + tag + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', attr)
29680        }
29681
29682        // No CSS transforms but VML support, add a CSS rule for VML elements:
29683        sheet.addRule('.spin-vml', 'behavior:url(#default#VML)')
29684
29685        Spinner.prototype.lines = function (el, o) {
29686            var r = o.scale * (o.length + o.width)
29687                , s = o.scale * 2 * r
29688
29689            function grp() {
29690                return css(
29691                    vml('group', {
29692                        coordsize: s + ' ' + s
29693                        , coordorigin: -r + ' ' + -r
29694                    })
29695                    , { width: s, height: s }
29696                )
29697            }
29698
29699            var margin = -(o.width + o.length) * o.scale * 2 + 'px'
29700                , g = css(grp(), { position: 'absolute', top: margin, left: margin })
29701                , i
29702
29703            function seg(i, dx, filter) {
29704                ins(
29705                    g
29706                    , ins(
29707                        css(grp(), { rotation: 360 / o.lines * i + 'deg', left: ~~dx })
29708                        , ins(
29709                            css(
29710                                vml('roundrect', { arcsize: o.corners })
29711                                , {
29712                                    width: r
29713                                    , height: o.scale * o.width
29714                                    , left: o.scale * o.radius
29715                                    , top: -o.scale * o.width >> 1
29716                                    , filter: filter
29717                                }
29718                            )
29719                            , vml('fill', { color: getColor(o.color, i), opacity: o.opacity })
29720                            , vml('stroke', { opacity: 0 }) // transparent stroke to fix color bleeding upon opacity change
29721                        )
29722                    )
29723                )
29724            }
29725
29726            if (o.shadow)
29727                for (i = 1; i <= o.lines; i++) {
29728                    seg(i, -2, 'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)')
29729                }
29730
29731            for (i = 1; i <= o.lines; i++) seg(i)
29732            return ins(el, g)
29733        }
29734
29735        Spinner.prototype.opacity = function (el, i, val, o) {
29736            var c = el.firstChild
29737            o = o.shadow && o.lines || 0
29738            if (c && i + o < c.childNodes.length) {
29739                c = c.childNodes[i + o]; c = c && c.firstChild; c = c && c.firstChild
29740                if (c) c.opacity = val
29741            }
29742        }
29743    }
29744
29745    if (typeof document !== 'undefined') {
29746        sheet = (function () {
29747            var el = createEl('style', { type: 'text/css' })
29748            ins(document.getElementsByTagName('head')[0], el)
29749            return el.sheet || el.styleSheet
29750        }())
29751
29752        var probe = css(createEl('group'), { behavior: 'url(#default#VML)' })
29753
29754        if (!vendor(probe, 'transform') && probe.adj) initVML()
29755        else useCssAnimations = vendor(probe, 'animation')
29756    }
29757
29758    return Spinner
29759
29760}));
29761$(document).ready(function () {
29762    $('.language-select ul li a').each(function () {
29763        var href = $(this).attr('href');
29764        var qp = location.search;
29765        $(this).attr('href', href + qp);
29766    });
29767    //focusout and blur were showing strange behavior, so I set the menu to close when the next item is focused
29768    $('.topnavigation a:first').focus(function () {
29769        $('.language-select').removeClass('open');
29770    });
29771    $('.global-nav a:first').focus(function () {
29772        $('.language-select').removeClass('open');
29773    });
29774    //close language select on left navigation focus as well in case a to
29774p nav doesn't exist
29775    $('.sidebar-nav a:first').focus(function () {
29776        $('.language-select').removeClass('open');
29777    });
29778    $('.leftnavigation a:first').focus(function () {
29779        $('.language-select').removeClass('open');
29780    });
29781});
29782// Modified from versions found here: http://www.webreference.com/js/column8/functions.html
29783
29784// You can call getVisits(); for a self-explanatory integer
29785
29786function setCookie(name, value, expires, path, domain, secure) {
29787    var curCookie = name + "=" + escape(value) +
29788        ((expires) ? "; expires=" + expires.toGMTString() : "") +
29789        ((path) ? "; path=" + path : "") +
29790        ((domain) ? "; domain=" + domain : "") +
29791        ((secure) ? "; secure" : "");
29792    document.cookie = curCookie;
29793}
29794
29795/*
29796  name - name of the desired cookie
29797  return string containing value of specified cookie or null
29798  if cookie does not exist
29799*/
29800
29801function getCookie(name) {
29802    var dc = document.cookie;
29803    var prefix = name + "=";
29804    var begin = dc.indexOf("; " + prefix);
29805    if (begin == -1) {
29806        begin = dc.indexOf(prefix);
29807        if (begin != 0) return null;
29808    } else
29809        begin += 2;
29810    var end = document.cookie.indexOf(";", begin);
29811    if (end == -1)
29812        end = dc.length;
29813    return unescape(dc.substring(begin + prefix.length, end));
29814}
29815
29816// date - any instance of the Date object
29817// * hand all instances of the Date object to this function for "repairs"
29818
29819function fixDate(date) {
29820    var base = new Date(0);
29821    var skew = base.getTime();
29822    if (skew > 0)
29823        date.setTime(date.getTime() - skew);
29824}
29825
29826function getVisits() {
29827    // create an instance of the Date object
29828    var now = new Date();
29829    // fix the bug in Navigator 2.0, Macintosh
29830    fixDate(now);
29831
29832    now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
29833    var visits = getCookie("counter");
29834    // if the cookie wasn't found, this is your first visit
29835    if (!visits) {
29836        visits = 1; // the value for the new cookie
29837    } else {
29838        // increment the counter
29839        visits = parseInt(visits) + 1;
29840        //console.log("visits: " + visits);
29841    }
29842    // set the new cookie
29843    setCookie("counter", visits, now);
29844    return visits;
29845}
29846
29847function getVisitCounterValue() {
29848    var visits = getCookie("counter");
29849    return visits;
29850}
29851
29852$("document").ready(function () {
29853     //Default & Medicaid Theme -Mobile Screens, Accessibility------------------------------------------------------------//
29854     var getTopNavigationContent = $(".topnavigation .mobile-nav ul").html();
29855     var getTopNavigationCount = $(".topnavigation .mobile-nav ul li").size();
29856     if(getTopNavigationCount > 0){
29857         $(".mobilesidemenu ul.first-level-nav").html(getTopNavigationContent);
29858     }
29859
29860     $(".mobilesidemenu ul.first-level-nav li.has-submenu button").addClass('glyphicon-plus-sign handleMobileSideMenu').removeClass('glyphicon-chevron-down');
29861
29862     //hide the expand/collapse icon if there is no child menu exists
29863    $('.grand-parent, .grand-child').each(function(){
29864        if($(this).children('li').length == 0){
29865            $(this).parent().find('.handleMobileSideMenu').addClass('hide');
29866        } else {
29867            let getMenuTitle = $(this).parent().children("a").text();
29868            $(this).parent().find('.handleMobileSideMenu').attr("aria-label", $.trim(getMenuTitle)); 
29869        }
29870    });
29871    //hide the expand/collpase icon if there is no child menu exists
29872    $('.grand-parent-desktop').each(function(){
29873        if($(this).children('li').length == 0){
29874            $(this).addClass('hide');
29875            $(this).parent().children('button.glyphicon').addClass('hide');
29876        }
29877    });
29878    $('.nav-justified > li').on('mouseenter', function () {
29879        $(this).children('ul').show();
29880        $(this).children('.glyphicon').attr('aria-expanded', 'true');
29881        $(this).children('.glyphicon').addClass('glyphicon-chevron-up').removeClass('glyphicon-chevron-down');
29882    });
29883    $('.nav-justified > li').on('mouseleave', function () {
29884        $(this).children('ul').hide();
29885        $(this).children('.glyphicon').attr('aria-expanded', 'false');
29886        $(this).children('.glyphicon').addClass('glyphicon-chevron-down').removeClass('glyphicon-chevron-up');
29887        $(this).find(".grand-parent-desktop").removeClass('show');
29888    });
29889
29890   var navMenus = document.querySelectorAll('.nav-justified  li button.glyphicon');
29891   var dropdownLinks = document.querySelectorAll('.nav-justified  li.has-submenu');
29892   function hideAllDropsdowns() {
29893       dropdownLinks.forEach(droplink => {
29894           droplink.lastElementChild.classList.remove('show');
29895       });
29896   }
29897   navMenus.forEach(menu => {
29898       menu.addEventListener('click', function() {
29899           hideAllDropsdowns();
29900           if($(this).parent().hasClass('open')){
29901                this.parentElement.lastElementChild.classList.add('show');
29902           }else{
29903                this.parentElement.lastElementChild.classList.remove('show');
29904           }
29905       });
29906       if (menu.nextElementSibling) {
29907           const subMenu = menu.nextElementSibling;
29908           const subMenuLinks = subMenu.querySelectorAll('a');
29909           const lastLinkIndex = subMenuLinks.length - 1;
29910           const lastLink = subMenuLinks[lastLinkIndex];
29911
29912           $(lastLink).on('blur', function() {
29913               this.parentElement.parentElement.classList.remove('show');
29914               this.parentElement.parentElement.parentElement.querySelector('.nav-justified > li button.glyphicon').setAttribute('aria-expanded', 'false');
29915           })
29916       }
29917   });
29918   
29919   //remove the duplicate icon
29920   $(".mobilesidemenu ul li.has-submenu").each(function(){
29921       if($(this).children('.handleMobileSideMenu').length == 2){
29922           $(this).parent().find('.handleMobileSideMenu:nth-child(2)').remove();
29923       }
29924   });
29925    
29926    $('.mobile-nav-medicaid').on('click', function () {
29927        $(this).toggleClass('open');
29928        $('.mobile-side-nav-medicaid, .c-mask').toggleClass('is-active');
29929        $(".c-mask").toggleClass("is-active-overlay");
29930    });  
29931
29932    $(".mobilesidemenu ul li").unbind('mouseenter mouseleave');
29933    $('.mobilesidemenu .nav-justified li button.glyphicon').on('focus', function(e){
29934        $(this).parent().find(".dropdown").removeClass('show');
29935    });
29936    $('.mobilesidemenu .nav-justified li ul.dropdown li button.glyphicon').on('focus', function(e){
29937        $(this).parent().find(".grand-child").removeClass('show');
29938    });
29939
29940    $(".mobilesidemenu ul li.has-submenu .handleMobileSideMenu").on('click', function(){
29941       $(this).parent().find(".dropdown").toggle();
29942       $(this).parent().find(".grand-parent, .grand-child").removeClass('show');
29943       mobileSideMenuToggle('dropdown', $(this));
29944   });
29945    $(".mobilesidemenu ul li.has-submenu ul li.has-submenu .handleMobileSideMenu").on('click', function(){
29946        $(this).parent().toggleClass('open');
29947        $(this).parent().find(".grand-parent, .grand-child").removeClass('show');
29948        mobileSideMenuToggle('third-level-nav', $(this));
29949    });
29950
29951    function mobileSideMenuToggle(toggleElement, _this){
29952        if($(_this).parent().find("."+toggleElement).is(':visible')){
29953            $(_this).addClass('glyphicon-minus-sign').removeClass('glyphicon-plus-sign');
29954            $(_this).parent().find("button.handleMobileSideMenu").attr("aria-expanded", true);             
29955        }else{
29956            $(_this).addClass('glyphicon-plus-sign').removeClass('glyphicon-minus-sign');
29957            $(_this).parent().find("button.handleMobileSideMenu").attr("aria-expanded", false);                  
29958        }       
29959    }
29960
29961    //Dynamically set the mobile side meu based on the header element's height when they are visible
29962     var flexHeaderHeight = $(".flex-header").height();
29963     var cookieBannerHeight = $('.top-cookie-banner').height();
29964     $("html").hasClass('has-cookie') ?  $('.mobilesidenav').css('top', flexHeaderHeight + cookieBannerHeight) : $('.mobilesidenav').css('top', flexHeaderHeight);
29965     $("html").hasClass('has-cookie') ?  $('.mobile-side-nav-medicaid').css('top', flexHeaderHeight + cookieBannerHeight) :  $('.mobile-side-nav-medicaid').css('top', flexHeaderHeight);
29966     
29967     //---------------------------------------------------------------------------------------------//
29968    $('.mobile-nav-button, .c-mask').on('click', function () {
29969        handleSearchBarVisibility();
29970        $('.mobilesidenav, .c-mask').toggleClass('is-active');
29971    });
29972
29973    $('.language-dropdown-toggle, .mobile-search-button').on('focus', function () {
29974        if ($('.mobilesidenav, .c-mask').hasClass('is-active')) {
29975            $('.mobilesidenav, .c-mask').removeClass('is-active');
29976        }   
29977    });
29978    
29979    $(document).on('keydown', '.is-active, .mobile-nav-button', function(event) {
29980        if (event.keyCode == 27) {
29981            if ($('.mobilesidenav, .c-mask').hasClass('is-active')) {
29982                $('.mobilesidenav, .c-mask').removeClass('is-active');
29983                $('.mobile-nav-button').focus();
29984            }
29985        }
29986    }); 
29987
29988    $('.mobile-nav-button').on('keydown', function(event) {
29989        if (event.keyCode == 32) {
29990            event.preventDefault();
29991            handleSearchBarVisibility();
29992            $('.mobilesidenav, .c-mask').toggleClass('is-active');
29993        }
29994    });
29995});
29996
29997function handleSearchBarVisibility() {
29998    if ($('.mobile-search').is(':visible')) {
29999        $('.xs-global-nav > .mobile-search').toggle();
30000        $('.xs-modal-backdrop').toggle();
30001    }
30002}
30003
30004jQuery(document).ready(function () {
30005
30006    /******************************
30007     ******* MOBILE_TOP_NAV *******
30008     ******************************/
30009
30010    $("#top_nav ul").each(function (index, element) {
30011        $(this).not(":has(li)").closest('li').find('span').addClass("hide");
30012    });
30013
30014    /******************************
30015     ******* LEFT_SIDE_NAV ********
30016     ******************************/
30017
30018    $("#left_nav ul").each(function (index, element) {
30019        $(this).not(":has(li)").closest('li').find('span').addClass("hide");
30020    });
30021    /* Ambetter side nav */
30022    $("nav.sidebar-nav ul").each(function (index, element) {
30023        $(this).not(":has(li)").closest('li').find('span').addClass("hide");
30024    });
30025
30026    //modal menu
30027    function showAmbetterMobileMenu(){
30028        $('#ambetter-mobile-menu').show();
30029        $('#modal-background').show();
30030        $('#open-modal-menu').attr('aria-expanded', 'true');
30031        $('.navbarToggle').attr('aria-expanded', 'true');
30032    }
30033    function hideAmbetterMobileMenu(){
30034        $('#ambetter-mobile-menu').hide();
30035        $('#modal-background').hide();
30036        $('#open-modal-menu').attr('aria-expanded', 'false');
30037        $('.navbarToggle').attr('aria-expanded', 'false');
30038    }
30039    //end modal menu
30040
30041    //start mouse accessible
30042    //Technical debt/page speed note: commonly used selectors should be assigned to variables and refactored in some cases
30043    $('.ambetter-header-left-nav .parent-nav > li').on('click', function(e){
30044        var $this = $(this);
30045        var xyz = $(this).find('.dropdown-menu').first();
30046        // if the target is the child element.
30047        $(xyz).on('click', function(e) {
30048            e.stopPropagation();
30049
30050        });
30051        //adding '>' to the above code matches the direct children rather than the descendants
30052        if ( $(this).hasClass('closed') ){
30053            $(this).closest('.parent-nav').children('li.open').each(function(index, item) {
30054                $(item).removeClass('open');
30055                $(item).children('ul').addClass('hide');
30056                $(item).addClass('closed');
30057            });
30058            $(this).children('a').children('.fa').attr('aria-expanded', 'true');
30059            $(this).children('a').children('.fa').addClass('fa-minus-circle').removeClass('fa-plus-circle');
30060            $(this).addClass('open');
30061            $(this).children('ul').addClass('show-table-style-nav');
30062            $(this).removeClass('closed');
30063            $(this).children('ul').removeClass('hide');
30064        }
30065        else {
30066            $(this).children('a').children('.fa').attr('aria-expanded', 'false');
30067            $(this).children('a').children('.fa').addClass('fa-plus-circle').removeClass('fa-minus-circle');
30068            $(this).addClass('closed');
30069            $(this).children('ul').addClass('hide');
30070            $(this).removeClass('open');
30071        }
30072    });
30073
30074    //logic for closing menu by clicking outside of menu area.
30075    $(document).click(function(e){
30076        $target = $(event.target);
30077        if(!$target.closest('.ambetter-header-left-nav .parent-nav > li').length && $('.ambetter-header-left-nav .parent-nav > li').is(":visible")){
30078            $('.ambetter-header-left-nav .parent-nav > li').addClass('closed');
30079            $('.ambetter-header-left-nav .parent-nav > li').children('ul').addClass('hide');
30080            $('.ambetter-header-left-nav .parent-nav > li').removeClass('open');
30081        }
30082
30083    });
30084
30085    $('.ambetter-header-left-nav .parent-nav li a .fa').on('focus', function(e){
30086        $(this).css('width', '15px');
30087        $(this).css('color', '#333333');
30088    });
30089    $('.ambetter-header-left-nav .parent-nav li a .fa').on('blur', function(e){
30090        $(this).css('width', '0px');
30091        $(this).css('color', 'transparent');
30092    });
30093    $('.mobile-menu-button').click(function () {
30094        showAmbetterMobileMenu();
30095    });
30096    $('.navbarToggle').on('click', function () {
30097        hideAmbetterMobileMenu();
30098    });
30099    /* prevent page from jumping to the top on a click */
30100    $('#close-mobile-menu-wrapper, .mobile-menu-button, #main-menu-toggle').click(function (e) {
30101        e.preventDefault();
30102    });
30103    //end mouse accessible
30104
30105    //start keyboard accessible
30106    $('.ambetter-header-left-nav .parent-nav li a .fa').keydown(function (e){
30107        //redundancies could be cleaned up here, but be sure to retain e.stopPropagation();
30108        if(e.which == 13){
30109            if ( $(this).hasClass('fa-plus-circle') ){
30110                $(this).attr('aria-expanded', 'true');
30111                $(this).addClass('fa-minus-circle').removeClass('fa-plus-circle');
30112                $(this).parent().parent().addClass('open');
30113                $(this).parent().parent().children('ul').addClass('show-table-style-nav');
30114                $(this).parent().parent().removeClass('closed');
30115                $(this).parent().parent().children('ul').removeClass('hide');
30116            }
30117            else{
30118                $(this).attr('aria-expanded', 'false');
30119                $(this).addClass('fa-plus-circle').removeClass('fa-minus-circle');
30120                $(this).parent().parent().addClass('closed');
30121                $(this).parent().parent().children('ul').addClass('hide');
30122                $(this).parent().parent().removeClass('open');
30123            }
30124            e.stopPropagation();
30125            return false;
30126        }
30127        else if (e.which == 9 && e.shiftKey){
30128            $(this).attr('aria-expanded', 'false');
30129            $(this).addClass('fa-plus-circle').removeClass('fa-minus-circle');
30130            $(this).parent().parent().addClass('closed');
30131            $(this).parent().parent().children('ul').addClass('hide');
30132            $(this).parent().parent().removeClass('open');
30133        }
30134    });
30135
30136    $('.ambetter-header-left-nav .column-menu li a').keydown(function(e) {
30137        var closeMenu = false;
30138        if ( $(this).parent().parent().parent().is(':last-child') && $(this).parent().is(':last-child') && e.which == 9 && !e.shiftKey ){
30139            //forward tab on last menu item in last column
30140            closeMenu = true;
30141        } else if ( $(this).parent().parent().parent().is(':first-child') && $(this).parent().is(':first-child') && e.which == 9 && e.shiftKey ) {
30142            //backward tab on first menu item in first column
30143            closeMenu = true;
30144        }
30145        if ( closeMenu ){
30146            $(this).closest('.top-level').addClass('closed');
30147            $(this).closest('.top-level').removeClass('open');
30148            $(this).parent().parent().parent().parent().addClass('hide');
30149            $(this).closest('.parent-nav').children('.top-level').children('a').children('em').addClass('fa-plus-circle').removeClass('fa-minus-circle');
30150            $(this).closest('.parent-nav').children('.top-level').children('a').children('em').attr('aria-expanded', 'false');
30151        }
30152    });
30153
30154    $('#ambetter-mobile-menu input').keydown(function(e){
30155        if (e.which == 9 && !e.shiftKey){
30156            //forward tab out of search
30157            hideAmbetterMobileMenu();
30158        }
30159    });
30160
30161    $('#ambetter-mobile-menu .navbarToggle').keydown(function(e){
30162        if (e.which == 9 && e.shiftKey){
30163            //backward tab out of nav
30164            hideAmbetterMobileMenu();
30165        }
30166    });
30167    //end keyboard accessible
30168
30169});
30170
30171$(document).ready(function () {
30172
30173  var $hscontainer = $(".health-sherpa-container"),
30174    $redirect_url = $hscontainer.data('redirect-url'),
30175    $api_key = $hscontainer.data('api-key'),
30176    $year = $hscontainer.data('year'),
30177    $apply_for_subsidy = $hscontainer.data('apply-for-subsidy'),
30178    $zip_code_reg_ex = /^[0-9]{5}(?:-[0-9]{4})?$/,
30179    $show_debug_info = $hscontainer.data('show-debug-info');
30180
30181  hideMessages();
30182  
30183  setTimeout(function(){
30184    $("#zipcode").css("border-color", $("#btnSearchForCoverage").css("background-color"));
30185  }, 100);
30186
30187  $('#zipcode').keypress(function (event) {
30188    if (event.keyCode == 13) {
30189      $('#btnSearchForCoverage').click();
30190    }
30191  });
30192
30193  function showCoveredMessage(bolCovered) {
30194    if (bolCovered) {
30195      $("#not_covered_message").hide();
30196      $("#covered_message").show();
30197    } else {
30198      $("#not_covered_message").show();
30199      $("#covered_message").hide();
30200    }
30201  }
30202
30203  function hideMessages() {
30204    $("#validation_message").hide();
30205    $("#not_covered_message").hide();
30206    $("#covered_message").hide();
30207    $("#nv_message").hide();
30208    $("#pa_message").hide();
30209    $("#wa_message").hide();
30210    $("#ulSR").hide();
30211  }
30212
30213  function clearUL() {
30214    $("#ulSR").html("");
30215  }
30216
30217  function appendToUL(message) {
30218    $("#ulSR").append(message);
30219  }
30220
30221  /***** Toggles visibility of service output */
30222  $("#lblEnterZipCode").click(function () {
30223    if ($show_debug_info) {
30224      $("#ulSR").toggle();
30225    } else {
30226      $("#ulSR").hide();
30227    }
30228  });
30229
30230  function buildSearchServiceCall(data, offset) {
30231    var postBody = {
30232      market: "Individual",
30233      place: {
30234        countyfips: data.counties[0].fips,
30235        state: data.counties[0].state,
30236        zipcode: $("#zipcode").val()
30237      },
30238      year: $year,
30239      offset: offset
30240    };
30241    // Switched the call to be syncronous to eliminate timing issues
30242    var settings = {
30243      "url": "https://marketplace.api.healthcare.gov/api/v1/plans/search?apikey=" + $api_key + "&year=" + $year,
30244      "method": "POST",
30245      "timeout": 0,
30246      "headers": {
30247        "Content-Type": "text/plain"
30248      },
30249      "async": false,
30250      "data": JSON.stringify(postBody)
30251    };
30252    return settings;
30253  }
30254
30255  $("#btnSearchForCoverage").click(function () {
30256    var totalPlans = 0;
30257    var settings;
30258    var plans = [];
30259    clearUL();
30260    hideMessages();
30261
30262    if ($zip_code_reg_ex.test($("#zipcode").val())) {
30263      $.ajax({
30264        url: "https://marketplace.api.healthcare.gov/api/v1/counties/by/zip/" + $("#zipcode").val() + "?apikey=" + $api_key,
30265        type: 'GET',
30266        success: function(data) {
30267          // SUCCESS!!!!!!!!!!!!
30268          appendToUL('"<li>"' + JSON.stringify(data) + '"</li>"');
30269          if (data.counties.length != 0) {
30270
30271            // If the zipcode is in Nevada, Pennsylvania, or Washington a 
30271special message must be displayed
30272            if (data.counties[0].state == "NV") {
30273              $("#nv_message").show();
30274            } else if (data.counties[0].state == "WA") {
30275              $("#wa_message").show();
30276            } else if (data.counties[0].state == "PA") {
30277              $("#pa_message").show();
30278            } else {
30279
30280              // Now let's use the FIP Code and State to check marketplace to see if Plans are avaiable in the prospective members zip code.
30281
30282              // Lets grab the count first then loop through this call as many times as necessary.
30283              settings = buildSearchServiceCall(data, 0);
30284              $.ajax(settings).done(function (response) {
30285                totalPlans = response.total;
30286                let totalPlansSpanText = $('<span>').text(totalPlans);
30287                appendToUL('"<li>Total Plans: "' + totalPlansSpanText[0].innerText + '"</li>"');
30288
30289                for (var offset = 0; offset < totalPlans; offset += 10) {
30290                  settings = buildSearchServiceCall(data, offset);
30291
30292                  var xPromise = $.ajax(settings);
30293
30294                  xPromise.done(function (response) {
30295                    plans = plans.concat(response.plans);
30296                  });
30297                }
30298              });
30299
30300              $.each(plans, function (index, value) {
30301                // Test junk to show what the marketplace services are returning
30302                if (value.issuer.name.toLowerCase().includes('ambetter')) {
30303                  appendToUL('<li style="font-size: 16pt;"><strong>' + index + ' Name: ' + value.name + ' Issuer Name: ' + value.issuer.name + '</strong></li>');
30304                } else {
30305                  appendToUL("<li>" + index + ' Name: ' + value.name + ' Issuer Name: ' + value.issuer.name +  "</li>");
30306                }
30307              });
30308
30309              if ($.grep(plans, function (value, i) {
30310                  return value.issuer.name.toLowerCase().indexOf('ambetter') != -1
30311                }).length > 0) {
30312                // There is coverage in the Prospective Member's Zip code!!!
30313                // Now we can substitute the fip_code and zip code into the redirect url
30314                // If debug mode is enabled, don't do the redirect.
30315                if (!$show_debug_info) {
30316                  $(".health-sherpa-container #covered_message a").attr('href', $redirect_url.replace('{0}', $apply_for_subsidy).replace('{1}', data.counties[0].fips).replace('{2}', $("#zipcode").val()));
30317                  window.top.location.href = $redirect_url.replace('{0}', $apply_for_subsidy).replace('{1}', data.counties[0].fips).replace('{2}', $("#zipcode").val());
30318                }
30319                $("#covered_message").show();
30320              } else {
30321                // No AmBetter plans available for the passed in zip code.
30322                $("#not_covered_message").show();
30323              }
30324            }
30325          } else {
30326            // No county is returned for zip code
30327            $("#not_covered_message").show();
30328          }
30329          }
30330        });
30331    } else {
30332      // Zip code isn't valid
30333      $("#validation_message").show();
30334    }
30335  });
30336});
30337$(document).ready(function () {
30338    var $tabscontainer = $(".tabs-container"),
30339        $default_tab = $tabscontainer.data('default-tab');
30340    // Set all tabs inactive
30341    $('.tabs-container #tabs .tab-header').addClass('inactive');
30342    // Make the default tab active 
30343    $('#' + $default_tab).removeClass('inactive');
30344    // Hide all bodies and then show the default tab body
30345    $('.tabs-container .tab-body').hide();
30346    $('#' + $default_tab + 'B').show();
30347
30348    $(document).keydown(function (event) {
30349        if ($(document.activeElement).hasClass('tab-header-container')) {
30350            // Get the Tab Number 1,2,3
30351            var tabId = $(".tab-header:not(.inactive)")[0].id.replace('tab', '');
30352            // If it was an arrow key, set tab indexes and body tab index to -1
30353            if (event.which == 37 ||
30354                event.which == 38 ||
30355                event.which == 39 ||
30356                event.which == 40) {
30357                removeTabIndexes();
30358                switch (event.which) {
30359                    case 37:
30360                    case 38:
30361                        //back button
30362                        if (tabId == 1) {
30363                            // We need to make tab 3 active.
30364                            $('.tabs-container #tabs .tab-header').addClass('inactive');
30365                            $("#tab3").removeClass('inactive');
30366
30367                            $('.tab-body').hide();
30368                            $('#' + 'tab3' + 'B').show();
30369
30370                            $("#tab3").parent().attr('tabindex', '0');
30371                            $('#' + 'tab3' + 'B').attr('tabindex', '0');
30372                        } else {
30373                            // Go back one tab
30374                            $('.tabs-container #tabs .tab-header').addClass('inactive');
30375                            $("#tab" + (+tabId - 1)).removeClass('inactive');
30376
30377                            $('.tab-body').hide();
30378                            $('#' + 'tab' + (+tabId - 1) + 'B').show();
30379
30380                            $("#tab" + (+tabId - 1)).parent().attr('tabindex', '0');
30381                            $('#' + 'tab' + (+tabId - 1) + 'B').attr('tabindex', '0');
30382                        }
30383                        break;
30384                    case 39:
30385                    case 40:
30386                        //forward
30387                        if (tabId == 3) {
30388                            // we need to make the first tab active.
30389                            $('.tabs-container #tabs .tab-header').addClass('inactive');
30390                            $("#tab1").removeClass('inactive');
30391
30392                            $('.tab-body').hide();
30393                            $('#' + 'tab1' + 'B').show();
30394
30395                            $("#tab1").parent().attr('tabindex', '0');
30396                            $('#' + 'tab1' + 'B').attr('tabindex', '0');
30397
30398                        } else {
30399                            // Go forward one tab
30400                            $('.tabs-container #tabs .tab-header').addClass('inactive');
30401                            $("#tab" + (+tabId + 1)).removeClass('inactive');
30402
30403                            $('.tab-body').hide();
30404                            $('#' + 'tab' + (+tabId + 1) + 'B').show();
30405
30406                            $("#tab" + (+tabId + 1)).parent().attr('tabindex', '0');
30407                            $('#' + 'tab' + (+tabId + 1) + 'B').attr('tabindex', '0');
30408                        }
30409                }
30410
30411            }
30412        }
30413    });
30414
30415    function removeTabIndexes() {
30416        // set all body tab index to -1
30417        $('#' + 'tab1' + 'B').attr('tabindex', '-1');
30418        $('#' + 'tab2' + 'B').attr('tabindex', '-1');
30419        $('#' + 'tab3' + 'B').attr('tabindex', '-1');
30420        $("#tab1").parent().attr('tabindex', '-1');
30421        $("#tab2").parent().attr('tabindex', '-1');
30422        $("#tab3").parent().attr('tabindex', '-1');
30423    }
30424
30425    $('.tabs-container .tab-header').click(function () {
30426        var tabId = $(this).attr('id');
30427
30428        removeTabIndexes();
30429
30430        $('.tabs-container #tabs .tab-header').addClass('inactive');
30431        $(this).removeClass('inactive');        
30432
30433        $('.tab-body').hide();
30434        $('#' + tabId + 'B').show();
30435
30436        // Make the active tab tabable..
30437        $(this).parent().attr('tabindex', '0');
30438        // Make the active tab body tabable..
30439        $('#' + tabId + 'B').attr('tabindex', '0');
30440
30441    });
30442
30443});
30444$('document').ready(function () {
30445    switch(getQueryString("status")) {
30446        case "409":
30447            // show
30448            $('span#error-message').removeClass('hidden');
30449            $('span#error-message').attr('aria-hidden', 'false');
30450            $('span#error-message').html('This contact information was previously submitted. We will get back to you shortly.');
30451            if($('div.error-message-form')){
30452                $('.error-message-form').append('This contact information was previously submitted. We will get back to you shortly.');
30453            }
30454            break;
30455        default:
30456            $('span#error-message').addClass('hidden');
30457            $('span#error-message').attr('aria-hidden', 'true');
30458            $('span#error-message').html('');
30459    }
30460});
30461$(document).ready(function($){
30462	//check screen size
30463	if($(window).width() <= 991){
30464		if (document.cookie.indexOf("firstVisitMobile") < 0){
30465			//show footer message
30466			$('#firstVisitMobileFooter').toggle();
30467			//set cookie for 9999 days
30468    		var d = new Date();
30469    		d.setTime(d.getTime() + (9999*24*60*60*1000));
30470    		var expires = "expires="+d.toUTCString();
30471    		document.cookie = "firstVisitMobile=false; " + expires + "; Secure; SameSite=Lax";
30472		}
30473	}
30474});
30475$('document').ready(function () {
30476    $('.ambetter-redesign-page-banner').each(function(index, item) {
30477        $(item).css("background-image", "url('"+ $(item).data('image') +"')");
30478    });
30479});
30480
30481$(document).ready(function(){
30482    loadAccessibilityFix();
30483});
30484
30485$(window).load(function() {
30486    loadAccessibilityFix();
30487});
30488
30489
30490function loadAccessibilityFix(){    
30491    //random id for title, desc
30492    let random_id = Math.floor(Math.random() * 100) + 1;
30493    $("#id_title").attr("id", "id_title_"+ random_id);
30494    $("#id_desc").attr("id", "id_desc_"+ random_id);
30495
30496    $("#carousel").attr("id", "carousel_"+ random_id);
30497    $("#carousel").attr("aria-labelledby", "Feature Cards");
30498    $("#carousel").attr("aria-describedby", "Feature Cards Desc");
30499    $("#carousel").removeAttr("role", "complementary");
30500
30501    $("ol.carousel-indicators").find("li").each(function(){
30502        $(this).attr("data-target", "#"+$(this).parent().parent().attr("id"))
30503    });
30504
30505    var role_main_attr = document.querySelectorAll('[role="main"]');
30506    $(role_main_attr).attr('role', '');
30507
30508    $('.footer-link-information').each(function(index){
30509        let id = index+1;
30510        $(this).attr('aria-label', 'Footer Link List-'+id);
30511    });
30512}
30513var maxHeight = "";
30514var screenSize = "";
30515
30516function getHeight() {
30517	maxHeight = Math.max.apply(null, $("div.cardHeading").map(function () {
30518		return $(this).height();
30519	}).get());
30520}
30521
30522function setHeight() {
30523	$('div.cardHeading').css('height', maxHeight+'px');
30524}
30525
30526function resizeFeatureCards(){
30527	$('div.cardHeading').removeAttr("style");
30528	getHeight();
30529	setHeight();
30530}
30531
30532$(window).load(function(e) {
30533	screenSize = $(document).width();
30534	if (screenSize > 1000) {
30535		getHeight();
30536		if (maxHeight > 0) {
30537			setHeight();
30538		} else {
30539			setTimeout(function() {
30540				getHeight();
30541				setHeight();
30542			}, 800);
30543		}
30544	}
30545});
30546
30547var resizeId;
30548$(window).resize(function() {
30549	screenSize = $(document).width();
30550	if (screenSize > 1000) {
30551		clearTimeout(resizeId);
30552		resizeId = setTimeout(resizeFeatureCards, 200);
30553	}
30554});
30555function login() {
30556    		//used for analytics
30557    		var selected,selectedProduct,desc,loc;
30558    		var urls = new Array();
30559        	$('#login-urls li').each(function(index){
30560        		urls[this.id] = this.innerHTML;
30561        	});
30562        	var hasProduct = false;
30563        	if ($('#loginDD1 option:selected').hasClass("additionalLogic-true")) {
30564        		hasProduct = true;
30565        		selectedProduct = $('#loginDD2 option:selected').val();
30566        	}
30567        	selected = desc = $('#loginDD1 option:selected').val();
30568        	if ($('#track-location').html()){
30569                selected = desc = $('#loginDD1 option:selected').val();
30570                desc = $('#track-description').html()+":"+ desc;
30571                loc = $('#track-location').html();
30572                if (hasProduct){
30573                	if(typeof trackLogin == 'function'){
30574                		trackLogin(desc,loc,selected,selectedProduct);
30575                	}
30576                	window.open(urls[selectedProduct],'_blank');
30577                }
30578                else{
30579                	if(typeof trackLogin == 'function'){
30580                		trackLogin(desc,loc,selected);
30581                	}
30582                	window.open(urls[selected],'_blank');
30583                }
30584        	} else {
30585	            if (hasProduct) {
30586	            	window.open(urls[selectedProduct]);
30587	            } else {
30588	            	window.open(urls[selected]);
30589	            }
30590       		}
30591}
30592    	$('#login_form').ready(function() {
30593    		var selectCount=0;
30594    		$('#login_form select').each(function() {
30595    			selectCount++;
30596    		});
30597    		$('#login_form select').eq(1).attr("disabled",true);
30598    		$('#login_form select').eq(1).addClass('disabled');
30599    		$('#login_button').addClass('disabled');
30600    		$('#login_button').attr('disabled',true);
30601    		$('#login_form select').eq(0).on('change', function() {
30602    			if (selectCount > 1) {
30603        			if (this.value != "" && this.value != "default") {
30604        				if ($('#login_form select option:selected').hasClass("additionalLogic-true")) {
30605        					$('#login_form select').eq(1).removeAttr("disabled");
30606        	    			$('#login_form select').eq(1).removeClass('disabled');
30607        	    			$('#loginDD2wrapper').removeClass('hidden');
30608        	    			$('#login_button').addClass('disabled');
30609            	    		$('#login_button').attr('disabled',true);
30610        				} else {
30611        					$('#login_button').removeClass('disabled');
30612            	    		$('#login_button').removeAttr('disabled');
30613            	    		$('#login_form select').eq(1).attr("disabled",true);
30614            	    		$('#login_form select').eq(1).addClass('disabled');
30615            	    		$('#loginDD2wrapper').addClass("hidden");
30616            	    		$('#login_form select').eq(1).val('default');
30617        				}
30618        			} else {
30619        				$('#login_form select').eq(1).attr("disabled",true);
30620        	    		$('#login_form select').eq(1).addClass('disabled');
30621        	    		$('#loginDD2wrapper').addClass("hidden");
30622        	    		$('#login_form select').eq(1).val('default');
30623        	    		$('#login_button').addClass('disabled');
30624        	    		$('#login_button').attr('disabled',true);
30625        			}
30626        		} else {
30627        			if (this.value != "" && this.value != "default") {
30628        				$('#login_button').removeClass('disabled');
30629        	    		$('#login_button').removeAttr('disabled');
30630        			} else {
30631        				$('#login_button').addClass('disabled');
30632        	    		$('#login_button').attr('disabled',true);
30633        			}
30634        		}
30635    		});
30636    		$('#login_form select').eq(1).on('change', function() {
30637    			if (this.value != "" && this.value != "default") {
30638    				$('#login_button').removeClass('disabled');
30639    	    		$('#login_button').removeAttr('disabled');
30640    			} else {
30641    				$('#login_button').addClass('disabled');
30642    	    		$('#login_button').attr('disabled',true);
30643    			}
30644    		});
30645    		$('#login_form').on('submit', function(e) {
30646    				e.preventDefault();
30647    				login();
30648    		});
30649    	});
30650$('#dynamic-login-form').ready(function () {
30651    var secondOption = false;
30652    var dynamicLoginForm = $('#dynamic-login-form');
30653    var dynamicLoginButton = $('#dynamic-login-button');
30654    var primaryDropdown = $('#primary-dropdown');
30655    var url, description, category, product;
30656    primaryDropdown.on('change', function () {
30657        url,
30658            description,
30659            category,
30660            product = '';
30661        dynamicLoginForm.find('.form-group-secondary').each(function () {
30662            $(this).addClass('hidden');
30663        });
30664        var showSecondary = checkURL(this.value);
30665        if (showSecondary) {
30666            $('#form-group-' + this.value).removeClass('hidden');
30667            if ($('#' + this.value + ' option:selected')[0]) {
30668                if ($('#' + this.value + ' option:selected')[0].value != 'default') {
30669                    url = $('#' + this.value + ' option:selected')[0].value;
30670                    category = primaryDropdown.text();
30671                    product = $('#' + this.value + ' option:selected')[0]['innerText'];
30672                    dynamicLoginButton.removeAttr('disabled');
30673                } else {
30674                    dynamicLoginButton.attr('disabled', true);
30675                }
30676            } else {
30677                dynamicLoginButton.attr('disabled', true);
30678            }
30679        } else if (this.value != 'default') {
30680            url = this.value;
30681            category = primaryDropdown.children("option:selected").text();
30682            dynamicLoginButton.removeAttr('disabled');
30683        } else {
30684            dynamicLoginButton.attr('disabled', true);
30685        }
30686    });
30687    dynamicLoginForm.find('.secondary-dropdown').on('change', function () {
30688        url,
30689            description,
30690            category,
30691            product = '';
30692        if (this.value != 'default') {
30693            url = this.value;
30694            category = primaryDropdown.children("option:selected").text();
30695            product = $(this).children("option:selected").text();
30696            dynamicLoginButton.removeAttr('disabled');
30697        } else {
30698            dynamicLoginButton.attr('disabled', true);
30699        }
30700    });
30701    dynamicLoginForm.on('submit', function (e) {
30702        e.preventDefault();
30703        navigateToLogin(url, category, product);
30704    });
30705});
30706
30707function checkURL(primaryURL) {
30708    var match = false;
30709    $('.secondary-dropdown').each(function () {
30710        if (primaryURL == this.id) {
30711            match = true;
30712            //break: http://api.jquery.com/jquery.each/
30713            return false;
30714        }
30715    });
30716    return match;
30717}
30718
30719function navigateToLogin(url, selected, selectedProduct) {
30720    var openNewWindow = $('#open-new-window');
30721    if ($('#dynamic-track-location').html()) {
30722        var desc = $('#dynamic-track-description').html() + ":" + selected;
30723        var loc = $('#dynamic-track-location').html();
30724        if (selectedProduct) {
30725            if (typeof trackLogin == 'function') {
30726                trackLogin(desc, loc, selected, selectedProduct);
30727            }
30728            if (openNewWindow[0].value) {
30729                window.open(url);
30730            } else {
30731                window.location.href = url;
30732            }
30733        } else {
30734            if (typeof trackLogin == 'function') {
30735                trackLogin(desc, loc, selected);
30736            }
30737            if (openNewWindow[0].value) {
30738                window.open(url);
30739            } else {
30740                window.location.href = url;
30741            }
30742        }
30743    } else {
30744        if (openNewWindow[0].value) {
30745            window.open(url);
30746        } else {
30747            window.location.href = url;
30748        }
30749    }
30750}
30751document.addEventListener('DOMContentLoaded', function () {
30752
30753    let imageUrl, apiUrl = '';
30754
30755    const imageElem = document.getElementsByClassName('logo')[0]?.getElementsByTagName('img')[0];
30756    const urlElem = document.getElementById('print-dropdown')
30757
30758    if (imageElem) {
30759        imageUrl = imageElem.getAttribute('src');
30760    }
30761
30762    if (urlElem) {
30763        apiUrl = urlElem.getAttribute("data-url");
30764    }
30765
30766    let printPage = document.getElementById('print-page');
30767    let printSection = document.getElementById('print-section');
30768
30769    if (printPage) {
30770        printPage.addEventListener('click', (event) => {
30771            event.preventDefault();
30772            let node = document.createElement('div');
30773            node.innerHTML = document.getElementById('print-disclaimer').innerHTML;
30774            document.body.appendChild(node);
30775            window.print()
30776            document.body.removeChild(node);
30777        });
30778    }
30779
30780    if (printSection) {
30781        printSection.addEventListener('click', (event) => {
30782            event.preventDefault();
30783            $.ajax({
30784                url: apiUrl,
30785                type: 'GET',
30786                success: function(response){
30787                    printHTML(response);
30788                },
30789                error: function(error){
30790                    console.error('Error fetching HTML:', error);
30791                }
30792            })
30793        })
30794    }
30795
30796    function printHTML(html) {
30797        // Create a temporary div to manipulate the HTML content
30798        // Create a temporary div to hold the content
30799        let tempDiv = document.createElement('div');
30800        tempDiv.innerHTML = `
30801<table>
30802<tbody>
30803<tr>
30804<td>
30805<main class="content">
30806	<img src="${window.location.origin}${imageUrl}" alt="logo">
30807    ${html}
30808</main>
30809</td>
30810</tr>
30811</tbody>
30812<tfoot>
30813<tr>
30814<td>
30815<div class="page-footer-space"></div>
30816<div class="page-footer">
30817<div><p>${document.getElementById('print-disclaimer').innerHTML}</p></div>
30818</div>
30819</td>
30820</tr>
30821</tfoot>
30822</table>
30823        `;
30824    // Open a new window for printing
30825        let printWindow = window.open(document.title, 'Print-Window');
30826        printWindow.document.write(`
30827<!DOCTYPE html>
30828<html lang="en">
30829<head>
30830<meta charset="UTF-8">
30831<meta name="viewport" content="width=device-width, initial-scale=1.0">
30832<title>${document.title}</title>
30833<style>
30834        .page-footer, .page-footer-space {
30835            height: 50px;
30836        }
30837        .page-footer {
30838            position: fixed;
30839            bottom: 0;
30840            width: 100%;
30841            border-top: 0.5px solid grey;
30842        }
30843        @page {
30844            margin: 20mm;
30845        }
30846        @media print {
30847            tfoot {display: table-footer-group;}
30848            button {display: none;}
30849            body {margin: 0;}
30850        }
30851</style>
30852</head>
30853<body>
30854        ${tempDiv.innerHTML}
30855</body>
30856</html>
30857    `);
30858        printWindow.document.close();
30859        let promise = new Promise(resolve => {
30860            setTimeout(() => {
30861            resolve();
30862        }, 1000);
30863        });
30864        promise.then(() => {
30865            printWindow.print();
30866            printWindow.close();
30867        });
30868    }
30869});
30870$(document).ready(function(){
30871    //Vanity Small Icon With Text
30872    $('.vanitysmalliconwithtext').children('.vanity-small-icon-section').each(function(){
30873        if($(this).hasClass('lastItem')){
30874            $(this).parent('.vanitysmalliconwithtext').addClass('last-item-width');
30875        }
30876    });
30877
30878    //Vanity Large Icon With Text
30879    $('.vanitylargeiconwithtext').addClass('col-md-8 col-sm-8');
30880    $('.vanitylargeiconwithtext').find('.vanity-large-icon-section').each(function(){
30881        if($(this).hasClass('lastItem')){
30882            $(this).parent().parent('.vanitylargeiconwithtext').addClass('last-item-width').removeClass('col-md-8 col-sm-8');
30883        }
30884    });
30885});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.