From a9c9bfe4f0e5aeb264000041a7d384f5072fc658 Mon Sep 17 00:00:00 2001 From: stonedDiscord <10584181+stonedDiscord@users.noreply.github.com> Date: Mon, 26 Oct 2020 16:18:53 +0100 Subject: prevent essential windows from being closed --- webAO/ui.b.js | 2 +- webAO/ui.b.js.map | 2 +- webAO/ui.js | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/webAO/ui.b.js b/webAO/ui.b.js index 0dac01c..f2971f5 100644 --- a/webAO/ui.b.js +++ b/webAO/ui.b.js @@ -1,4 +1,4 @@ -!function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=157)}({155:function(t,e,n){var i,o,s,r;s=window.$,(r={config:{},container:{},controls:{},errors:{},items:{},utils:{}}).utils.F=function(){},r.utils.extend=function(t,e){t.prototype=r.utils.createObject(e.prototype),t.prototype.contructor=t},r.utils.createObject=function(t){return"function"==typeof Object.create?Object.create(t):(r.utils.F.prototype=t,new r.utils.F)},r.utils.objectKeys=function(t){var e,n;if("function"==typeof Object.keys)return Object.keys(t);for(n in e=[],t)e.push(n);return e},r.utils.getHashValue=function(t){var e=location.hash.match(new RegExp(t+"=([^&]*)"));return e?e[1]:null},r.utils.getQueryStringParam=function(t){if(window.location.hash)return r.utils.getHashValue(t);if(!window.location.search)return null;var e,n,i=window.location.search.substr(1).split("&"),o={};for(n=0;n/g,">").replace(/]+)>)/gi,""))},r.utils.EventEmitter=function(){this._mSubscriptions={},this._mSubscriptions[r.utils.EventEmitter.ALL_EVENT]=[],this.on=function(t,e,n){if(!r.utils.isFunction(e))throw new Error("Tried to listen to event "+t+" with non-function callback "+e);this._mSubscriptions[t]||(this._mSubscriptions[t]=[]),this._mSubscriptions[t].push({fn:e,ctx:n})},this.emit=function(t){var e,n,i;i=Array.prototype.slice.call(arguments,1);var o=this._mSubscriptions[t];if(o)for(o=o.slice(),e=0;ethis._nDistance||Math.abs(this._nY)>this._nDistance)&&(clearTimeout(this._timeout),this._startDrag()),this._bDragging&&this.emit("drag",this._nX,this._nY,t)}},onMouseUp:function(t){null!=this._timeout&&(clearTimeout(this._timeout),this._eBody.removeClass("lm_dragging"),this._eElement.removeClass("lm_dragging"),this._oDocument.find("iframe").css("pointer-events",""),this._oDocument.unbind("mousemove touchmove",this._fMove),this._oDocument.unbind("mouseup touchend",this._fUp),!0===this._bDragging&&(this._bDragging=!1,this.emit("dragStop",t,this._nOriginalX+this._nX)))},_startDrag:function(){this._bDragging=!0,this._eBody.addClass("lm_dragging"),this._eElement.addClass("lm_dragging"),this._oDocument.find("iframe").css("pointer-events","none"),this.emit("dragStart",this._nOriginalX,this._nOriginalY)},_getCoordinates:function(t){return{x:(t=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0]:t).pageX,y:t.pageY}}}),r.LayoutManager=function(t,e){if(!s||"function"!=typeof s.noConflict)throw new Error('jQuery is missing as dependency for GoldenLayout. Please either expose $ on GoldenLayout\'s scope (e.g. window) or add "jquery" to your paths when using RequireJS/AMD');r.utils.EventEmitter.call(this),this.isInitialised=!1,this._isFullPage=!1,this._resizeTimeoutId=null,this._components={"lm-react-component":r.utils.ReactComponentHandler},this._itemAreas=[],this._resizeFunction=r.utils.fnBind(this._onResize,this),this._unloadFunction=r.utils.fnBind(this._onUnload,this),this._maximisedItem=null,this._maximisePlaceholder=s('
'),this._creationTimeoutPassed=!1,this._subWindowsCreated=!1,this._dragSources=[],this._updatingColumnsResponsive=!1,this._firstLoad=!0,this.width=null,this.height=null,this.root=null,this.openPopouts=[],this.selectedItem=null,this.isSubWindow=!1,this.eventHub=new r.utils.EventHub(this),this.config=this._createConfig(t),this.container=e,this.dropTargetIndicator=null,this.transitionIndicator=null,this.tabDropPlaceholder=s('
'),!0===this.isSubWindow&&s("body").css("visibility","hidden"),this._typeToItem={column:r.utils.fnBind(r.items.RowOrColumn,this,[!0]),row:r.utils.fnBind(r.items.RowOrColumn,this,[!1]),stack:r.items.Stack,component:r.items.Component}},r.LayoutManager.__lm=r,r.LayoutManager.minifyConfig=function(t){return(new r.utils.ConfigMinifier).minifyConfig(t)},r.LayoutManager.unminifyConfig=function(t){return(new r.utils.ConfigMinifier).unminifyConfig(t)},r.utils.copy(r.LayoutManager.prototype,{registerComponent:function(t,e){if("function"!=typeof e)throw new Error("Please register a constructor function");if(void 0!==this._components[t])throw new Error("Component "+t+" is already registered");this._components[t]=e},toConfig:function(t){var e,n,i;if(!1===this.isInitialised)throw new Error("Can't create config, layout not yet initialised");if(t&&!(t instanceof r.items.AbstractContentItem))throw new Error("Root must be a ContentItem");for((e={settings:r.utils.copy({},this.config.settings),dimensions:r.utils.copy({},this.config.dimensions),labels:r.utils.copy({},this.config.labels)}).content=[],(n=function(t,e){var i,o;for(i in e.config)"content"!==i&&(t[i]=e.config[i]);if(e.contentItems.length)for(t.content=[],o=0;o(i=this._itemAreas[n]).x1&&ti.y1&&ei.surface&&(o=i.surface,s=i);return s},_$createRootItemAreas:function(){var t={y2:0,x2:0,y1:"y2",x1:"x2"};for(var e in t){var n=this.root._$getArea();n.side=e,n[e]=t[e]?n[t[e]]-50:50,n.surface=(n.x2-n.x1)*(n.y2-n.y1),this._itemAreas.push(n)}},_$calculateItemAreas:function(){var t,e,n=this._getAllContentItems();if(this._itemAreas=[],1!==n.length){for(this._$createRootItemAreas(),t=0;t
');t.click(r.utils.fnBind((function(){this.emit("popIn")}),this)),document.title=r.utils.stripTags(this.config.content[0].title),s("head").append(s("body link, body style, template, .gl_keep")),this.container=s("body").html("").css("visibility","visible").append(t),document.body.offsetHeight,window.__glInstance=this},_createSubWindows:function(){var t,e;for(t=0;t1)throw new Error("GoldenLayout more than one container element specified");t[0]===document.body&&(this._isFullPage=!0,s("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"})),this.container=t},_create:function(t){var e;if(!(t.content instanceof Array))throw e=void 0===t.content?"Missing setting 'content' on top level of configuration":"Configuration parameter 'content' must be an array",new r.errors.ConfigurationError(e,t);if(t.content.length>1)throw e="Top level content can't contain more then one element.",new r.errors.ConfigurationError(e,t);this.root=new r.items.Root(this,{content:t.content},this.container),this.root.callDownwards("_$init"),"__glMaximised"===t.maximisedItemId&&this.root.getItemsById(t.maximisedItemId)[0].toggleMaximise()},_onUnload:function(){if(!0===this.config.settings.closePopoutsOnUnload)for(var t=0;t','
',""].join("")),this._contentElement=this._element.find(".lm_content")},r.utils.copy(r.container.ItemContainer.prototype,{getElement:function(){return this._contentElement},hide:function(){this.emit("hide"),this.isHidden=!0,this._element.hide()},show:function(){this.emit("show"),this.isHidden=!1,this._element.show(),0==this.height&&0==this.width||this.emit("shown")},setSize:function(t,e){for(var n,i,o,s,r=this.parent,a=this;!r.isColumn&&!r.isRow;)if(a=r,(r=r.parent).isRoot)return!1;for(n=("height"==(i=r.isColumn?"height":"width")?e:t)/(this[i]*(1/(a.config[i]/100)))*100,o=(a.config[i]-n)/(r.contentItems.length-1),s=0;s0?this._layoutManager.root.contentItems[0]:this._layoutManager.root)),e.addChild(t,this._indexInParent),this.close()},_createWindow:function(){var t,e=this._createUrl(),n=Math.floor(1e6*Math.random()).toString(36),i=this._serializeWindowOptions({width:this._dimensions.width,height:this._dimensions.height,innerWidth:this._dimensions.width,innerHeight:this._dimensions.height,menubar:"no",toolbar:"no",location:"no",personalbar:"no",resizable:"yes",scrollbars:"no",status:"no"});if(this._popoutWindow=window.open(e,n,i),this._popoutWindow)s(this._popoutWindow).on("load",r.utils.fnBind(this._positionWindow,this)).on("unload beforeunload",r.utils.fnBind(this._onClose,this)),t=setInterval(r.utils.fnBind((function(){this._popoutWindow.__glInstance&&this._popoutWindow.__glInstance.isInitialised&&(this._onInitialised(),clearInterval(t))}),this),10);else if(!0===this._layoutManager.config.settings.blockedPopoutsThrowError){var o=new Error("Popout blocked");throw o.type="popoutBlocked",o}},_serializeWindowOptions:function(t){var e,n=[];for(e in t)n.push(e+"="+t[e]);return n.join(",")},_createUrl:function(){var t,e={content:this._config},n="gl-window-config-"+r.utils.getUniqueId();e=(new r.utils.ConfigMinifier).minifyConfig(e);try{localStorage.setItem(n,JSON.stringify(e))}catch(t){throw new Error("Error while writing to localStorage "+t.toString())}return 1===(t=document.location.href.split("?")).length?t[0]+"?gl-window="+n:document.location.href+"&gl-window="+n},_positionWindow:function(){this._popoutWindow.moveTo(this._dimensions.left,this._dimensions.top),this._popoutWindow.focus()},_onInitialised:function(){this.isInitialised=!0,this.getGlInstance().on("popIn",this.popIn,this),this.emit("initialised")},_onClose:function(){setTimeout(r.utils.fnBind(this.emit,this,["closed"]),50)}}),r.controls.DragProxy=function(t,e,n,i,o,a){r.utils.EventEmitter.call(this),this._dragListener=n,this._layoutManager=i,this._contentItem=o,this._originalParent=a,this._area=null,this._lastValidArea=null,this._dragListener.on("drag",this._onDrag,this),this._dragListener.on("dragStop",this._onDrop,this),this.element=s(r.controls.DragProxy._template),a&&a._side&&(this._sided=a._sided,this.element.addClass("lm_"+a._side),["right","bottom"].indexOf(a._side)>=0&&this.element.find(".lm_content").after(this.element.find(".lm_header"))),this.element.css({left:t,top:e}),this.element.find(".lm_tab").attr("title",r.utils.stripTags(this._contentItem.config.title)),this.element.find(".lm_title").html(this._contentItem.config.title),this.childElementContainer=this.element.find(".lm_content"),this.childElementContainer.append(o.element),this._updateTree(),this._layoutManager._$calculateItemAreas(),this._setDimensions(),s(document.body).append(this.element);var l=this._layoutManager.container.offset();this._minX=l.left,this._minY=l.top,this._maxX=this._layoutManager.container.width()+this._minX,this._maxY=this._layoutManager.container.height()+this._minY,this._width=this.element.width(),this._height=this.element.height(),this._setDropPosition(t,e)},r.controls.DragProxy._template='
',r.utils.copy(r.controls.DragProxy.prototype,{_onDrag:function(t,e,n){var i=(n=n.originalEvent&&n.originalEvent.touches?n.originalEvent.touches[0]:n).pageX,o=n.pageY;(i>this._minX&&ithis._minY&&o
',r.utils.copy(r.controls.DropTargetIndicator.prototype,{destroy:function(){this.element.remove()},highlight:function(t,e,n,i){this.highlightArea({x1:t,y1:e,x2:n,y2:i})},highlightArea:function(t){this.element.css({left:t.x1,top:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}).show()},hide:function(){this.element.hide()}}),r.controls.Header=function(t,e){r.utils.EventEmitter.call(this),this.layoutManager=t,this.element=s(r.controls.Header._template),!0===this.layoutManager.config.settings.selectionEnabled&&(this.element.addClass("lm_selectable"),this.element.on("click touchstart",r.utils.fnBind(this._onHeaderClick,this))),this.tabsContainer=this.element.find(".lm_tabs"),this.tabDropdownContainer=this.element.find(".lm_tabdropdown_list"),this.tabDropdownContainer.hide(),this.controlsContainer=this.element.find(".lm_controls"),this.parent=e,this.parent.on("resize",this._updateTabSizes,this),this.tabs=[],this.activeContentItem=null,this.closeButton=null,this.tabDropdownButton=null,this.hideAdditionalTabsDropdown=r.utils.fnBind(this._hideAdditionalTabsDropdown,this),s(document).mouseup(this.hideAdditionalTabsDropdown),this._lastVisibleTabIndex=-1,this._tabControlOffset=this.layoutManager.config.settings.tabControlOffset,this._createControls()},r.controls.Header._template=['
','
    ','
      ','
        ',"
        "].join(""),r.utils.copy(r.controls.Header.prototype,{createTab:function(t,e){var n,i;for(i=0;i0?this.tabs[e-1].element.after(n.element):this.tabs[0].element.before(n.element),this.tabs.splice(e,0,n),this._updateTabSizes()},removeTab:function(t){for(var e=0;ethis._lastVisibleTabIndex){for(o=this.tabs[this.parent.config.activeItemIndex],n=this.parent.config.activeItemIndex;n>0;n--)this.tabs[n]=this.tabs[n-1];this.tabs[0]=o,this.parent.config.activeItemIndex=0}this._updateTabSizes(),this.parent.emitBubblingEvent("stateChanged")},position:function(t){var e=this.parent._header.show;return e&&!this.parent._side&&(e="top"),void 0!==t&&this.parent._header.show!=t&&(this.parent._header.show=t,this.parent._setupHeaderPosition()),e},_$setClosable:function(t){return!(!this.closeButton||!this._isClosable()||(this.closeButton.element[t?"show":"hide"](),0))},_$destroy:function(){this.emit("destroy",this);for(var t=0;tr){if(u)i===d&&(n.css({"z-index":"auto","margin-left":""}),this.tabsContainer.append(n));else if((c=d>0&&d<=i?(l-r)/(i-1):(l-r)/i)'),this._header.on("destroy",this._$destroy,this),this._action=i,this.element.on("click touchstart",this._action),this._header.controlsContainer.append(this.element)},r.utils.copy(r.controls.HeaderButton.prototype,{_$destroy:function(){this.element.off(),this.element.remove()}}),r.controls.Splitter=function(t,e,n){this._isVertical=t,this._size=e,this._grabSize=n'),e=s('
        ');e.append(t);var n=this._grabSize-this._size,i=n/2;return this._isVertical?(t.css("top",-i),t.css("height",this._size+n),e.addClass("lm_vertical"),e.height(this._size)):(t.css("left",-i),t.css("width",this._size+n),e.addClass("lm_horizontal"),e.width(this._size)),e}}),r.controls.Tab=function(t,e){this.header=t,this.contentItem=e,this.element=s(r.controls.Tab._template),this.titleElement=this.element.find(".lm_title"),this.closeElement=this.element.find(".lm_close_tab"),this.closeElement[e.config.isClosable?"show":"hide"](),this.isActive=!1,this.setTitle(e.config.title),this.contentItem.on("titleChanged",this.setTitle,this),this._layoutManager=this.contentItem.layoutManager,!0===this._layoutManager.config.settings.reorderEnabled&&!0===e.config.reorderEnabled&&(this._dragListener=new r.utils.DragListener(this.element),this._dragListener.on("dragStart",this._onDragStart,this),this.contentItem.on("destroy",this._dragListener.destroy,this._dragListener)),this._onTabClickFn=r.utils.fnBind(this._onTabClick,this),this._onCloseClickFn=r.utils.fnBind(this._onCloseClick,this),this.element.on("mousedown touchstart",this._onTabClickFn),this.contentItem.config.isClosable?(this.closeElement.on("click touchstart",this._onCloseClickFn),this.closeElement.on("mousedown",this._onCloseMousedown)):this.closeElement.remove(),this.contentItem.tab=this,this.contentItem.emit("tab",this),this.contentItem.layoutManager.emit("tabCreated",this),this.contentItem.isComponent&&(this.contentItem.container.tab=this,this.contentItem.container.emit("tab",this))},r.controls.Tab._template='
      • ',r.utils.copy(r.controls.Tab.prototype,{setTitle:function(t){this.element.attr("title",r.utils.stripTags(t)),this.titleElement.html(t)},setActive:function(t){t!==this.isActive&&(this.isActive=t,t?this.element.addClass("lm_active"):this.element.removeClass("lm_active"))},_$destroy:function(){this.element.off("mousedown touchstart",this._onTabClickFn),this.closeElement.off("click touchstart",this._onCloseClickFn),this._dragListener&&(this.contentItem.off("destroy",this._dragListener.destroy,this._dragListener),this._dragListener.off("dragStart",this._onDragStart),this._dragListener=null),this.element.remove()},_onDragStart:function(t,e){!0===this.contentItem.parent.isMaximised&&this.contentItem.parent.toggleMaximise(),new r.controls.DragProxy(t,e,this._dragListener,this._layoutManager,this.contentItem,this.header.parent)},_onTabClick:function(t){if(0===t.button||"touchstart"===t.type){var e=this.header.parent.getActiveContentItem();this.contentItem!==e&&this.header.parent.setActiveContentItem(this.contentItem)}else 1===t.button&&this.contentItem.config.isClosable&&this._onCloseClick(t)},_onCloseClick:function(t){t.stopPropagation(),this.header.parent.removeChild(this.contentItem)},_onCloseMousedown:function(t){t.stopPropagation()}}),r.controls.TransitionIndicator=function(){this._element=s('
        '),s(document.body).append(this._element),this._toElement=null,this._fromDimensions=null,this._totalAnimationDuration=200,this._animationStartTime=null},r.utils.copy(r.controls.TransitionIndicator.prototype,{destroy:function(){this._element.remove()},transitionElements:function(t,e){},_nextAnimationFrame:function(){var t,e=this._measure(this._toElement),n=(r.utils.now()-this._animationStartTime)/this._totalAnimationDuration,i={};if(n>=1)this._element.hide();else{for(t in e.opacity=0,this._fromDimensions)i[t]=this._fromDimensions[t]+(e[t]-this._fromDimensions[t])*n;this._element.css(i),r.utils.animFrame(r.utils.fnBind(this._nextAnimationFrame,this))}},_measure:function(t){var e=t.offset();return{left:e.left,top:e.top,width:t.outerWidth(),height:t.outerHeight()}}}),r.errors.ConfigurationError=function(t,e){Error.call(this),this.name="Configuration Error",this.message=t,this.node=e},r.errors.ConfigurationError.prototype=new Error,r.items.AbstractContentItem=function(t,e,n){r.utils.EventEmitter.call(this),this.config=this._extendItemNode(e),this.type=e.type,this.contentItems=[],this.parent=n,this.isInitialised=!1,this.isMaximised=!1,this.isRoot=!1,this.isRow=!1,this.isColumn=!1,this.isStack=!1,this.isComponent=!1,this.layoutManager=t,this._pendingEventPropagations={},this._throttledEvents=["stateChanged"],this.on(r.utils.EventEmitter.ALL_EVENT,this._propagateEvent,this),e.content&&this._createContentItems(e)},r.utils.copy(r.items.AbstractContentItem.prototype,{setSize:function(){throw new Error("Abstract Method")},callDownwards:function(t,e,n,i){var o;for(!0!==n&&!0!==i&&this[t].apply(this,e||[]),o=0;o0?this.callDownwards("setSize"):this instanceof r.items.Root||!0!==this.config.isClosable||this.parent.removeChild(this)},addChild:function(t,e){void 0===e&&(e=this.contentItems.length),this.contentItems.splice(e,0,t),void 0===this.config.content&&(this.config.content=[]),this.config.content.splice(e,0,t.config),t.parent=this,!0===t.parent.isInitialised&&!1===t.isInitialised&&t._$init()},replaceChild:function(t,e,n){e=this.layoutManager._$normalizeContentItem(e);var i=r.utils.indexOf(t,this.contentItems),o=t.element[0].parentNode;if(-1===i)throw new Error("Can't replace child. oldChild is not child of this");o.replaceChild(e.element[0],t.element[0]),!0===n&&(t.parent=null,t._$destroy()),this.contentItems[i]=e,e.parent=this,this.isStack&&(this.header.tabs[i].contentItem=e),!0===e.parent.isInitialised&&!1===e.isInitialised&&e._$init(),this.callDownwards("setSize")},remove:function(){this.parent.removeChild(this)},popout:function(){var t=this.layoutManager.createPopout(this);return this.emitBubblingEvent("stateChanged"),t},toggleMaximise:function(t){t&&t.preventDefault(),!0===this.isMaximised?this.layoutManager._$minimiseItem(this):this.layoutManager._$maximiseItem(this),this.isMaximised=!this.isMaximised,this.emitBubblingEvent("stateChanged")},select:function(){this.layoutManager.selectedItem!==this&&(this.layoutManager.selectItem(this,!0),this.element.addClass("lm_selected"))},deselect:function(){this.layoutManager.selectedItem===this&&(this.layoutManager.selectedItem=null,this.element.removeClass("lm_selected"))},setTitle:function(t){this.config.title=t,this.emit("titleChanged",t),this.emit("stateChanged")},hasId:function(t){return!!this.config.id&&("string"==typeof this.config.id?this.config.id===t:this.config.id instanceof Array?-1!==r.utils.indexOf(t,this.config.id):void 0)},addId:function(t){this.hasId(t)||(this.config.id?"string"==typeof this.config.id?this.config.id=[this.config.id,t]:this.config.id instanceof Array&&this.config.id.push(t):this.config.id=t)},removeId:function(t){if(!this.hasId(t))throw new Error("Id not found");if("string"==typeof this.config.id)delete this.config.id;else if(this.config.id instanceof Array){var e=r.utils.indexOf(t,this.config.id);this.config.id.splice(e,1)}},getItemsByFilter:function(t){var e=[],n=function(i){for(var o=0;o'),this.childElementContainer=this.element,this._containerElement=n,this._containerElement.append(this.element)},r.utils.extend(r.items.Root,r.items.AbstractContentItem),r.utils.copy(r.items.Root.prototype,{addChild:function(t){if(this.contentItems.length>0)throw new Error("Root node can only have a single child");t=this.layoutManager._$normalizeContentItem(t,this),this.childElementContainer.append(t.element),r.items.AbstractContentItem.prototype.addChild.call(this,t),this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")},setSize:function(t,e){t=void 0===t?this._containerElement.width():t,e=void 0===e?this._containerElement.height():e,this.element.width(t),this.element.height(e),this.contentItems[0]&&(this.contentItems[0].element.width(t),this.contentItems[0].element.height(e))},_$highlightDropZone:function(t,e,n){this.layoutManager.tabDropPlaceholder.remove(),r.items.AbstractContentItem.prototype._$highlightDropZone.apply(this,arguments)},_$onDrop:function(t,e){var n;if(t.isComponent&&((n=this.layoutManager.createContentItem({type:"stack",header:t.config.header||{}},this))._$init(),n.addChild(t),t=n),this.contentItems.length){var i="x"==e.side[0]?"row":"column",o="x"==e.side[0]?"width":"height",s="2"==e.side[1],a=this.contentItems[0];if(!a instanceof r.items.RowOrColumn||a.type!=i){var l=this.layoutManager.createContentItem({type:i},this);this.replaceChild(a,l),l.addChild(t,s?0:void 0,!0),l.addChild(a,s?void 0:0,!0),a.config[o]=50,t.config[o]=50,l.callDownwards("setSize")}else{var c=a.contentItems[s?0:a.contentItems.length-1];a.addChild(t,s?0:void 0,!0),c.config[o]*=.5,t.config[o]=c.config[o],a.callDownwards("setSize")}}else this.addChild(t)}}),r.items.RowOrColumn=function(t,e,n,i){r.items.AbstractContentItem.call(this,e,n,i),this.isRow=!t,this.isColumn=t,this.element=s('
        '),this.childElementContainer=this.element,this._splitterSize=e.config.dimensions.borderWidth,this._splitterGrabSize=e.config.dimensions.borderGrabWidth,this._isColumn=t,this._dimension=t?"height":"width",this._splitter=[],this._splitterPosition=null,this._splitterMinPosition=null,this._splitterMaxPosition=null},r.utils.extend(r.items.RowOrColumn,r.items.AbstractContentItem),r.utils.copy(r.items.RowOrColumn.prototype,{addChild:function(t,e,n){var i,o,s,a;if(t=this.layoutManager._$normalizeContentItem(t,this),void 0===e&&(e=this.contentItems.length),this.contentItems.length>0?(a=this._createSplitter(Math.max(0,e-1)).element,e>0?(this.contentItems[e-1].element.after(a),a.after(t.element)):(this.contentItems[0].element.before(a),a.before(t.element))):this.childElementContainer.append(t.element),r.items.AbstractContentItem.prototype.addChild.call(this,t,e),i=1/this.contentItems.length*100,!0!==n){for(s=0;s0&&(this._calculateRelativeSizes(),this._setAbsoluteSizes()),this.emitBubblingEvent("stateChanged"),this.emit("resize")},_$init:function(){var t;if(!0!==this.isInitialised)for(r.items.AbstractContentItem.prototype._$init.call(this),t=0;t0&&e.itemSizes[t]++,this._isColumn?(this.contentItems[t].element.width(e.totalWidth),this.contentItems[t].element.height(e.itemSizes[t])):(this.contentItems[t].element.width(e.itemSizes[t]),this.contentItems[t].element.height(e.totalHeight))},_calculateAbsoluteSizes:function(){var t,e,n=(this.contentItems.length-1)*this._splitterSize,i=this.element.width(),o=this.element.height(),s=0,r=[];for(this._isColumn?o-=n:i-=n,t=0;t0){for(t=0;t100)for(t=0;tr)){for(e=a/r,l=a,u=0;uthis._splitterMinPosition&&i'),this._activeContentItem=null;var i=t.config;this._header={show:!0===i.settings.hasHeaders&&!1!==e.hasHeaders,popout:i.settings.showPopoutIcon&&i.labels.popout,maximise:i.settings.showMaximiseIcon&&i.labels.maximise,close:i.settings.showCloseIcon&&i.labels.close,minimise:i.labels.minimise},i.header&&r.utils.copy(this._header,i.header),e.header&&r.utils.copy(this._header,e.header),e.content&&e.content[0]&&e.content[0].header&&r.utils.copy(this._header,e.content[0].header),this._dropZones={},this._dropSegment=null,this._contentAreaDimensions=null,this._dropIndex=null,this.isStack=!0,this.childElementContainer=s('
        '),this.header=new r.controls.Header(t,this),this.element.append(this.header.element),this.element.append(this.childElementContainer),this._setupHeaderPosition(),this._$validateClosability()},r.utils.extend(r.items.Stack,r.items.AbstractContentItem),r.utils.copy(r.items.Stack.prototype,{setSize:function(){var t,e=this._header.show?this.layoutManager.config.dimensions.headerHeight:0,n=this.element.width()-(this._sided?e:0),i=this.element.height()-(this._sided?0:e);for(this.childElementContainer.width(n),this.childElementContainer.height(i),t=0;t0){if(!(e=this.contentItems[this.config.activeItemIndex||0]))throw new Error("Configured activeItemIndex out of bounds");this.setActiveContentItem(e)}}},setActiveContentItem:function(t){if(-1===r.utils.indexOf(t,this.contentItems))throw new Error("contentItem is not a child of this stack");null!==this._activeContentItem&&this._activeContentItem._$hide(),this._activeContentItem=t,this.header.setActiveContentItem(t),t._$show(),this.emit("activeContentItemChanged",t),this.layoutManager.emit("activeContentItemChanged",t),this.emitBubblingEvent("stateChanged")},getActiveContentItem:function(){return this.header.activeContentItem},addChild:function(t,e){t=this.layoutManager._$normalizeContentItem(t,this),r.items.AbstractContentItem.prototype.addChild.call(this,t,e),this.childElementContainer.append(t.element),this.header.createTab(t,e),this.setActiveContentItem(t),this.callDownwards("setSize"),this._$validateClosability(),this.emitBubblingEvent("stateChanged")},removeChild:function(t,e){var n=r.utils.indexOf(t,this.contentItems);r.items.AbstractContentItem.prototype.removeChild.call(this,t,e),this.header.removeTab(t),this.header.activeContentItem===t&&(this.contentItems.length>0?this.setActiveContentItem(this.contentItems[Math.max(n-1,0)]):this._activeContentItem=null),this._$validateClosability(),this.emitBubblingEvent("stateChanged")},_$validateClosability:function(){var t,e,n;for(t=this.header._isClosable(),n=0,e=this.contentItems.length;nt&&i.y1e)return void("header"===n?(this._dropSegment="header",this._highlightHeaderDropZone(this._sided?e:t)):(this._resetHeaderDropZone(),this._highlightBodyDropZone(n)))},_$getArea:function(){if(!1===this.element.is(":visible"))return null;var t=r.items.AbstractContentItem.prototype._$getArea,e=t.call(this,this.header.element),n=t.call(this,this.childElementContainer),i=n.x2-n.x1,o=n.y2-n.y1;return this._contentAreaDimensions={header:{hoverArea:{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},highlightArea:{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}},this._activeContentItem&&!1===this._activeContentItem.isComponent?e:0===this.contentItems.length?(this._contentAreaDimensions.body={hoverArea:{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2},highlightArea:{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2}},t.call(this,this.element)):(this._contentAreaDimensions.left={hoverArea:{x1:n.x1,y1:n.y1,x2:n.x1+.25*i,y2:n.y2},highlightArea:{x1:n.x1,y1:n.y1,x2:n.x1+.5*i,y2:n.y2}},this._contentAreaDimensions.top={hoverArea:{x1:n.x1+.25*i,y1:n.y1,x2:n.x1+.75*i,y2:n.y1+.5*o},highlightArea:{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y1+.5*o}},this._contentAreaDimensions.right={hoverArea:{x1:n.x1+.75*i,y1:n.y1,x2:n.x2,y2:n.y2},highlightArea:{x1:n.x1+.5*i,y1:n.y1,x2:n.x2,y2:n.y2}},this._contentAreaDimensions.bottom={hoverArea:{x1:n.x1+.25*i,y1:n.y1+.5*o,x2:n.x1+.75*i,y2:n.y2},highlightArea:{x1:n.x1,y1:n.y1+.5*o,x2:n.x2,y2:n.y2}},t.call(this,this.element))},_highlightHeaderDropZone:function(t){var e,n,i,o,s,r,a,l,c=this.header.tabs.length,h=!1;if(0===c)return a=this.header.element.offset(),void this.layoutManager.dropTargetIndicator.highlightArea({x1:a.left,x2:a.left+100,y1:a.top+this.header.element.height()-20,y2:a.top+this.header.element.height()});for(e=0;eo&&t=0&&this._header.show;if(this.header.element.toggle(!!this._header.show),this._side=t,this._sided=["right","left"].indexOf(this._side)>=0,this.element.removeClass("lm_left lm_right lm_bottom"),this._side&&this.element.addClass("lm_"+this._side),this.element.find(".lm_header").length&&this.childElementContainer){var e=["right","bottom"].indexOf(this._side)>=0?"before":"after";this.header.element[e](this.childElementContainer),this.callDownwards("setSize")}},_highlightBodyDropZone:function(t){var e=this._contentAreaDimensions[t].highlightArea;this.layoutManager.dropTargetIndicator.highlightArea(e),this._dropSegment=t}}),r.utils.BubblingEvent=function(t,e){this.name=t,this.origin=e,this.isPropagationStopped=!1},r.utils.BubblingEvent.prototype.stopPropagation=function(){this.isPropagationStopped=!0},r.utils.ConfigMinifier=function(){if(this._keys=["settings","hasHeaders","constrainDragToContainer","selectionEnabled","dimensions","borderWidth","minItemHeight","minItemWidth","headerHeight","dragProxyWidth","dragProxyHeight","labels","close","maximise","minimise","popout","content","componentName","componentState","id","width","type","height","isClosable","title","popoutWholeStack","openPopouts","parentId","activeItemIndex","reorderEnabled","borderGrabWidth"],this._keys.length>36)throw new Error("Too many keys in config minifier map");this._values=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"]},r.utils.copy(r.utils.ConfigMinifier.prototype,{minifyConfig:function(t){var e={};return this._nextLevel(t,e,"_min"),e},unminifyConfig:function(t){var e={};return this._nextLevel(t,e,"_max"),e},_nextLevel:function(t,e,n){var i,o;for(i in t)t instanceof Array&&(i=parseInt(i,10)),t.hasOwnProperty(i)&&(o=this[n](i,this._keys),"object"==typeof t[i]?(e[o]=t[i]instanceof Array?[]:{},this._nextLevel(t[i],e[o],n)):e[o]=this[n](t[i],this._values))},_min:function(t,e){if("string"==typeof t&&1===t.length)return"___"+t;var n=r.utils.indexOf(t,e);return-1===n?t:n.toString(36)},_max:function(t,e){return"string"==typeof t&&1===t.length?e[parseInt(t,36)]:"string"==typeof t&&"___"===t.substr(0,3)?t[3]:t}}),r.utils.EventHub=function(t){r.utils.EventEmitter.call(this),this._layoutManager=t,this._dontPropagateToParent=null,this._childEventSource=null,this.on(r.utils.EventEmitter.ALL_EVENT,r.utils.fnBind(this._onEventFromThis,this)),this._boundOnEventFromChild=r.utils.fnBind(this._onEventFromChild,this),s(window).on("gl_child_event",this._boundOnEventFromChild)},r.utils.EventHub.prototype._onEventFromThis=function(){var t=Array.prototype.slice.call(arguments);this._layoutManager.isSubWindow&&t[0]!==this._dontPropagateToParent&&this._propagateToParent(t),this._propagateToChildren(t),this._dontPropagateToParent=null,this._childEventSource=null},r.utils.EventHub.prototype._$onEventFromParent=function(t){this._dontPropagateToParent=t[0],this.emit.apply(this,t)},r.utils.EventHub.prototype._onEventFromChild=function(t){this._childEventSource=t.originalEvent.__gl,this.emit.apply(this,t.originalEvent.__glArgs)},r.utils.EventHub.prototype._propagateToParent=function(t){var e;document.createEvent?(e=window.opener.document.createEvent("HTMLEvents")).initEvent("gl_child_event",!0,!0):(e=window.opener.document.createEventObject()).eventType="gl_child_event",e.eventName="gl_child_event",e.__glArgs=t,e.__gl=this._layoutManager,document.createEvent?window.opener.dispatchEvent(e):window.opener.fireEvent("on"+e.eventType,e)},r.utils.EventHub.prototype._propagateToChildren=function(t){var e,n;for(n=0;n/g,">").replace(/]+)>)/gi,""))},r.utils.EventEmitter=function(){this._mSubscriptions={},this._mSubscriptions[r.utils.EventEmitter.ALL_EVENT]=[],this.on=function(t,e,n){if(!r.utils.isFunction(e))throw new Error("Tried to listen to event "+t+" with non-function callback "+e);this._mSubscriptions[t]||(this._mSubscriptions[t]=[]),this._mSubscriptions[t].push({fn:e,ctx:n})},this.emit=function(t){var e,n,i;i=Array.prototype.slice.call(arguments,1);var o=this._mSubscriptions[t];if(o)for(o=o.slice(),e=0;ethis._nDistance||Math.abs(this._nY)>this._nDistance)&&(clearTimeout(this._timeout),this._startDrag()),this._bDragging&&this.emit("drag",this._nX,this._nY,t)}},onMouseUp:function(t){null!=this._timeout&&(clearTimeout(this._timeout),this._eBody.removeClass("lm_dragging"),this._eElement.removeClass("lm_dragging"),this._oDocument.find("iframe").css("pointer-events",""),this._oDocument.unbind("mousemove touchmove",this._fMove),this._oDocument.unbind("mouseup touchend",this._fUp),!0===this._bDragging&&(this._bDragging=!1,this.emit("dragStop",t,this._nOriginalX+this._nX)))},_startDrag:function(){this._bDragging=!0,this._eBody.addClass("lm_dragging"),this._eElement.addClass("lm_dragging"),this._oDocument.find("iframe").css("pointer-events","none"),this.emit("dragStart",this._nOriginalX,this._nOriginalY)},_getCoordinates:function(t){return{x:(t=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0]:t).pageX,y:t.pageY}}}),r.LayoutManager=function(t,e){if(!s||"function"!=typeof s.noConflict)throw new Error('jQuery is missing as dependency for GoldenLayout. Please either expose $ on GoldenLayout\'s scope (e.g. window) or add "jquery" to your paths when using RequireJS/AMD');r.utils.EventEmitter.call(this),this.isInitialised=!1,this._isFullPage=!1,this._resizeTimeoutId=null,this._components={"lm-react-component":r.utils.ReactComponentHandler},this._itemAreas=[],this._resizeFunction=r.utils.fnBind(this._onResize,this),this._unloadFunction=r.utils.fnBind(this._onUnload,this),this._maximisedItem=null,this._maximisePlaceholder=s('
        '),this._creationTimeoutPassed=!1,this._subWindowsCreated=!1,this._dragSources=[],this._updatingColumnsResponsive=!1,this._firstLoad=!0,this.width=null,this.height=null,this.root=null,this.openPopouts=[],this.selectedItem=null,this.isSubWindow=!1,this.eventHub=new r.utils.EventHub(this),this.config=this._createConfig(t),this.container=e,this.dropTargetIndicator=null,this.transitionIndicator=null,this.tabDropPlaceholder=s('
        '),!0===this.isSubWindow&&s("body").css("visibility","hidden"),this._typeToItem={column:r.utils.fnBind(r.items.RowOrColumn,this,[!0]),row:r.utils.fnBind(r.items.RowOrColumn,this,[!1]),stack:r.items.Stack,component:r.items.Component}},r.LayoutManager.__lm=r,r.LayoutManager.minifyConfig=function(t){return(new r.utils.ConfigMinifier).minifyConfig(t)},r.LayoutManager.unminifyConfig=function(t){return(new r.utils.ConfigMinifier).unminifyConfig(t)},r.utils.copy(r.LayoutManager.prototype,{registerComponent:function(t,e){if("function"!=typeof e)throw new Error("Please register a constructor function");if(void 0!==this._components[t])throw new Error("Component "+t+" is already registered");this._components[t]=e},toConfig:function(t){var e,n,i;if(!1===this.isInitialised)throw new Error("Can't create config, layout not yet initialised");if(t&&!(t instanceof r.items.AbstractContentItem))throw new Error("Root must be a ContentItem");for((e={settings:r.utils.copy({},this.config.settings),dimensions:r.utils.copy({},this.config.dimensions),labels:r.utils.copy({},this.config.labels)}).content=[],(n=function(t,e){var i,o;for(i in e.config)"content"!==i&&(t[i]=e.config[i]);if(e.contentItems.length)for(t.content=[],o=0;o(i=this._itemAreas[n]).x1&&ti.y1&&ei.surface&&(o=i.surface,s=i);return s},_$createRootItemAreas:function(){var t={y2:0,x2:0,y1:"y2",x1:"x2"};for(var e in t){var n=this.root._$getArea();n.side=e,n[e]=t[e]?n[t[e]]-50:50,n.surface=(n.x2-n.x1)*(n.y2-n.y1),this._itemAreas.push(n)}},_$calculateItemAreas:function(){var t,e,n=this._getAllContentItems();if(this._itemAreas=[],1!==n.length){for(this._$createRootItemAreas(),t=0;t
        ');t.click(r.utils.fnBind((function(){this.emit("popIn")}),this)),document.title=r.utils.stripTags(this.config.content[0].title),s("head").append(s("body link, body style, template, .gl_keep")),this.container=s("body").html("").css("visibility","visible").append(t),document.body.offsetHeight,window.__glInstance=this},_createSubWindows:function(){var t,e;for(t=0;t1)throw new Error("GoldenLayout more than one container element specified");t[0]===document.body&&(this._isFullPage=!0,s("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"})),this.container=t},_create:function(t){var e;if(!(t.content instanceof Array))throw e=void 0===t.content?"Missing setting 'content' on top level of configuration":"Configuration parameter 'content' must be an array",new r.errors.ConfigurationError(e,t);if(t.content.length>1)throw e="Top level content can't contain more then one element.",new r.errors.ConfigurationError(e,t);this.root=new r.items.Root(this,{content:t.content},this.container),this.root.callDownwards("_$init"),"__glMaximised"===t.maximisedItemId&&this.root.getItemsById(t.maximisedItemId)[0].toggleMaximise()},_onUnload:function(){if(!0===this.config.settings.closePopoutsOnUnload)for(var t=0;t','
        ',""].join("")),this._contentElement=this._element.find(".lm_content")},r.utils.copy(r.container.ItemContainer.prototype,{getElement:function(){return this._contentElement},hide:function(){this.emit("hide"),this.isHidden=!0,this._element.hide()},show:function(){this.emit("show"),this.isHidden=!1,this._element.show(),0==this.height&&0==this.width||this.emit("shown")},setSize:function(t,e){for(var n,i,o,s,r=this.parent,a=this;!r.isColumn&&!r.isRow;)if(a=r,(r=r.parent).isRoot)return!1;for(n=("height"==(i=r.isColumn?"height":"width")?e:t)/(this[i]*(1/(a.config[i]/100)))*100,o=(a.config[i]-n)/(r.contentItems.length-1),s=0;s0?this._layoutManager.root.contentItems[0]:this._layoutManager.root)),e.addChild(t,this._indexInParent),this.close()},_createWindow:function(){var t,e=this._createUrl(),n=Math.floor(1e6*Math.random()).toString(36),i=this._serializeWindowOptions({width:this._dimensions.width,height:this._dimensions.height,innerWidth:this._dimensions.width,innerHeight:this._dimensions.height,menubar:"no",toolbar:"no",location:"no",personalbar:"no",resizable:"yes",scrollbars:"no",status:"no"});if(this._popoutWindow=window.open(e,n,i),this._popoutWindow)s(this._popoutWindow).on("load",r.utils.fnBind(this._positionWindow,this)).on("unload beforeunload",r.utils.fnBind(this._onClose,this)),t=setInterval(r.utils.fnBind((function(){this._popoutWindow.__glInstance&&this._popoutWindow.__glInstance.isInitialised&&(this._onInitialised(),clearInterval(t))}),this),10);else if(!0===this._layoutManager.config.settings.blockedPopoutsThrowError){var o=new Error("Popout blocked");throw o.type="popoutBlocked",o}},_serializeWindowOptions:function(t){var e,n=[];for(e in t)n.push(e+"="+t[e]);return n.join(",")},_createUrl:function(){var t,e={content:this._config},n="gl-window-config-"+r.utils.getUniqueId();e=(new r.utils.ConfigMinifier).minifyConfig(e);try{localStorage.setItem(n,JSON.stringify(e))}catch(t){throw new Error("Error while writing to localStorage "+t.toString())}return 1===(t=document.location.href.split("?")).length?t[0]+"?gl-window="+n:document.location.href+"&gl-window="+n},_positionWindow:function(){this._popoutWindow.moveTo(this._dimensions.left,this._dimensions.top),this._popoutWindow.focus()},_onInitialised:function(){this.isInitialised=!0,this.getGlInstance().on("popIn",this.popIn,this),this.emit("initialised")},_onClose:function(){setTimeout(r.utils.fnBind(this.emit,this,["closed"]),50)}}),r.controls.DragProxy=function(t,e,n,i,o,a){r.utils.EventEmitter.call(this),this._dragListener=n,this._layoutManager=i,this._contentItem=o,this._originalParent=a,this._area=null,this._lastValidArea=null,this._dragListener.on("drag",this._onDrag,this),this._dragListener.on("dragStop",this._onDrop,this),this.element=s(r.controls.DragProxy._template),a&&a._side&&(this._sided=a._sided,this.element.addClass("lm_"+a._side),["right","bottom"].indexOf(a._side)>=0&&this.element.find(".lm_content").after(this.element.find(".lm_header"))),this.element.css({left:t,top:e}),this.element.find(".lm_tab").attr("title",r.utils.stripTags(this._contentItem.config.title)),this.element.find(".lm_title").html(this._contentItem.config.title),this.childElementContainer=this.element.find(".lm_content"),this.childElementContainer.append(o.element),this._updateTree(),this._layoutManager._$calculateItemAreas(),this._setDimensions(),s(document.body).append(this.element);var l=this._layoutManager.container.offset();this._minX=l.left,this._minY=l.top,this._maxX=this._layoutManager.container.width()+this._minX,this._maxY=this._layoutManager.container.height()+this._minY,this._width=this.element.width(),this._height=this.element.height(),this._setDropPosition(t,e)},r.controls.DragProxy._template='
        ',r.utils.copy(r.controls.DragProxy.prototype,{_onDrag:function(t,e,n){var i=(n=n.originalEvent&&n.originalEvent.touches?n.originalEvent.touches[0]:n).pageX,o=n.pageY;(i>this._minX&&ithis._minY&&o
        ',r.utils.copy(r.controls.DropTargetIndicator.prototype,{destroy:function(){this.element.remove()},highlight:function(t,e,n,i){this.highlightArea({x1:t,y1:e,x2:n,y2:i})},highlightArea:function(t){this.element.css({left:t.x1,top:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}).show()},hide:function(){this.element.hide()}}),r.controls.Header=function(t,e){r.utils.EventEmitter.call(this),this.layoutManager=t,this.element=s(r.controls.Header._template),!0===this.layoutManager.config.settings.selectionEnabled&&(this.element.addClass("lm_selectable"),this.element.on("click touchstart",r.utils.fnBind(this._onHeaderClick,this))),this.tabsContainer=this.element.find(".lm_tabs"),this.tabDropdownContainer=this.element.find(".lm_tabdropdown_list"),this.tabDropdownContainer.hide(),this.controlsContainer=this.element.find(".lm_controls"),this.parent=e,this.parent.on("resize",this._updateTabSizes,this),this.tabs=[],this.activeContentItem=null,this.closeButton=null,this.tabDropdownButton=null,this.hideAdditionalTabsDropdown=r.utils.fnBind(this._hideAdditionalTabsDropdown,this),s(document).mouseup(this.hideAdditionalTabsDropdown),this._lastVisibleTabIndex=-1,this._tabControlOffset=this.layoutManager.config.settings.tabControlOffset,this._createControls()},r.controls.Header._template=['
        ','
          ','
            ','
              ',"
              "].join(""),r.utils.copy(r.controls.Header.prototype,{createTab:function(t,e){var n,i;for(i=0;i0?this.tabs[e-1].element.after(n.element):this.tabs[0].element.before(n.element),this.tabs.splice(e,0,n),this._updateTabSizes()},removeTab:function(t){for(var e=0;ethis._lastVisibleTabIndex){for(o=this.tabs[this.parent.config.activeItemIndex],n=this.parent.config.activeItemIndex;n>0;n--)this.tabs[n]=this.tabs[n-1];this.tabs[0]=o,this.parent.config.activeItemIndex=0}this._updateTabSizes(),this.parent.emitBubblingEvent("stateChanged")},position:function(t){var e=this.parent._header.show;return e&&!this.parent._side&&(e="top"),void 0!==t&&this.parent._header.show!=t&&(this.parent._header.show=t,this.parent._setupHeaderPosition()),e},_$setClosable:function(t){return!(!this.closeButton||!this._isClosable()||(this.closeButton.element[t?"show":"hide"](),0))},_$destroy:function(){this.emit("destroy",this);for(var t=0;tr){if(u)i===d&&(n.css({"z-index":"auto","margin-left":""}),this.tabsContainer.append(n));else if((c=d>0&&d<=i?(l-r)/(i-1):(l-r)/i)'),this._header.on("destroy",this._$destroy,this),this._action=i,this.element.on("click touchstart",this._action),this._header.controlsContainer.append(this.element)},r.utils.copy(r.controls.HeaderButton.prototype,{_$destroy:function(){this.element.off(),this.element.remove()}}),r.controls.Splitter=function(t,e,n){this._isVertical=t,this._size=e,this._grabSize=n'),e=s('
              ');e.append(t);var n=this._grabSize-this._size,i=n/2;return this._isVertical?(t.css("top",-i),t.css("height",this._size+n),e.addClass("lm_vertical"),e.height(this._size)):(t.css("left",-i),t.css("width",this._size+n),e.addClass("lm_horizontal"),e.width(this._size)),e}}),r.controls.Tab=function(t,e){this.header=t,this.contentItem=e,this.element=s(r.controls.Tab._template),this.titleElement=this.element.find(".lm_title"),this.closeElement=this.element.find(".lm_close_tab"),this.closeElement[e.config.isClosable?"show":"hide"](),this.isActive=!1,this.setTitle(e.config.title),this.contentItem.on("titleChanged",this.setTitle,this),this._layoutManager=this.contentItem.layoutManager,!0===this._layoutManager.config.settings.reorderEnabled&&!0===e.config.reorderEnabled&&(this._dragListener=new r.utils.DragListener(this.element),this._dragListener.on("dragStart",this._onDragStart,this),this.contentItem.on("destroy",this._dragListener.destroy,this._dragListener)),this._onTabClickFn=r.utils.fnBind(this._onTabClick,this),this._onCloseClickFn=r.utils.fnBind(this._onCloseClick,this),this.element.on("mousedown touchstart",this._onTabClickFn),this.contentItem.config.isClosable?(this.closeElement.on("click touchstart",this._onCloseClickFn),this.closeElement.on("mousedown",this._onCloseMousedown)):this.closeElement.remove(),this.contentItem.tab=this,this.contentItem.emit("tab",this),this.contentItem.layoutManager.emit("tabCreated",this),this.contentItem.isComponent&&(this.contentItem.container.tab=this,this.contentItem.container.emit("tab",this))},r.controls.Tab._template='
            • ',r.utils.copy(r.controls.Tab.prototype,{setTitle:function(t){this.element.attr("title",r.utils.stripTags(t)),this.titleElement.html(t)},setActive:function(t){t!==this.isActive&&(this.isActive=t,t?this.element.addClass("lm_active"):this.element.removeClass("lm_active"))},_$destroy:function(){this.element.off("mousedown touchstart",this._onTabClickFn),this.closeElement.off("click touchstart",this._onCloseClickFn),this._dragListener&&(this.contentItem.off("destroy",this._dragListener.destroy,this._dragListener),this._dragListener.off("dragStart",this._onDragStart),this._dragListener=null),this.element.remove()},_onDragStart:function(t,e){!0===this.contentItem.parent.isMaximised&&this.contentItem.parent.toggleMaximise(),new r.controls.DragProxy(t,e,this._dragListener,this._layoutManager,this.contentItem,this.header.parent)},_onTabClick:function(t){if(0===t.button||"touchstart"===t.type){var e=this.header.parent.getActiveContentItem();this.contentItem!==e&&this.header.parent.setActiveContentItem(this.contentItem)}else 1===t.button&&this.contentItem.config.isClosable&&this._onCloseClick(t)},_onCloseClick:function(t){t.stopPropagation(),this.header.parent.removeChild(this.contentItem)},_onCloseMousedown:function(t){t.stopPropagation()}}),r.controls.TransitionIndicator=function(){this._element=s('
              '),s(document.body).append(this._element),this._toElement=null,this._fromDimensions=null,this._totalAnimationDuration=200,this._animationStartTime=null},r.utils.copy(r.controls.TransitionIndicator.prototype,{destroy:function(){this._element.remove()},transitionElements:function(t,e){},_nextAnimationFrame:function(){var t,e=this._measure(this._toElement),n=(r.utils.now()-this._animationStartTime)/this._totalAnimationDuration,i={};if(n>=1)this._element.hide();else{for(t in e.opacity=0,this._fromDimensions)i[t]=this._fromDimensions[t]+(e[t]-this._fromDimensions[t])*n;this._element.css(i),r.utils.animFrame(r.utils.fnBind(this._nextAnimationFrame,this))}},_measure:function(t){var e=t.offset();return{left:e.left,top:e.top,width:t.outerWidth(),height:t.outerHeight()}}}),r.errors.ConfigurationError=function(t,e){Error.call(this),this.name="Configuration Error",this.message=t,this.node=e},r.errors.ConfigurationError.prototype=new Error,r.items.AbstractContentItem=function(t,e,n){r.utils.EventEmitter.call(this),this.config=this._extendItemNode(e),this.type=e.type,this.contentItems=[],this.parent=n,this.isInitialised=!1,this.isMaximised=!1,this.isRoot=!1,this.isRow=!1,this.isColumn=!1,this.isStack=!1,this.isComponent=!1,this.layoutManager=t,this._pendingEventPropagations={},this._throttledEvents=["stateChanged"],this.on(r.utils.EventEmitter.ALL_EVENT,this._propagateEvent,this),e.content&&this._createContentItems(e)},r.utils.copy(r.items.AbstractContentItem.prototype,{setSize:function(){throw new Error("Abstract Method")},callDownwards:function(t,e,n,i){var o;for(!0!==n&&!0!==i&&this[t].apply(this,e||[]),o=0;o0?this.callDownwards("setSize"):this instanceof r.items.Root||!0!==this.config.isClosable||this.parent.removeChild(this)},addChild:function(t,e){void 0===e&&(e=this.contentItems.length),this.contentItems.splice(e,0,t),void 0===this.config.content&&(this.config.content=[]),this.config.content.splice(e,0,t.config),t.parent=this,!0===t.parent.isInitialised&&!1===t.isInitialised&&t._$init()},replaceChild:function(t,e,n){e=this.layoutManager._$normalizeContentItem(e);var i=r.utils.indexOf(t,this.contentItems),o=t.element[0].parentNode;if(-1===i)throw new Error("Can't replace child. oldChild is not child of this");o.replaceChild(e.element[0],t.element[0]),!0===n&&(t.parent=null,t._$destroy()),this.contentItems[i]=e,e.parent=this,this.isStack&&(this.header.tabs[i].contentItem=e),!0===e.parent.isInitialised&&!1===e.isInitialised&&e._$init(),this.callDownwards("setSize")},remove:function(){this.parent.removeChild(this)},popout:function(){var t=this.layoutManager.createPopout(this);return this.emitBubblingEvent("stateChanged"),t},toggleMaximise:function(t){t&&t.preventDefault(),!0===this.isMaximised?this.layoutManager._$minimiseItem(this):this.layoutManager._$maximiseItem(this),this.isMaximised=!this.isMaximised,this.emitBubblingEvent("stateChanged")},select:function(){this.layoutManager.selectedItem!==this&&(this.layoutManager.selectItem(this,!0),this.element.addClass("lm_selected"))},deselect:function(){this.layoutManager.selectedItem===this&&(this.layoutManager.selectedItem=null,this.element.removeClass("lm_selected"))},setTitle:function(t){this.config.title=t,this.emit("titleChanged",t),this.emit("stateChanged")},hasId:function(t){return!!this.config.id&&("string"==typeof this.config.id?this.config.id===t:this.config.id instanceof Array?-1!==r.utils.indexOf(t,this.config.id):void 0)},addId:function(t){this.hasId(t)||(this.config.id?"string"==typeof this.config.id?this.config.id=[this.config.id,t]:this.config.id instanceof Array&&this.config.id.push(t):this.config.id=t)},removeId:function(t){if(!this.hasId(t))throw new Error("Id not found");if("string"==typeof this.config.id)delete this.config.id;else if(this.config.id instanceof Array){var e=r.utils.indexOf(t,this.config.id);this.config.id.splice(e,1)}},getItemsByFilter:function(t){var e=[],n=function(i){for(var o=0;o'),this.childElementContainer=this.element,this._containerElement=n,this._containerElement.append(this.element)},r.utils.extend(r.items.Root,r.items.AbstractContentItem),r.utils.copy(r.items.Root.prototype,{addChild:function(t){if(this.contentItems.length>0)throw new Error("Root node can only have a single child");t=this.layoutManager._$normalizeContentItem(t,this),this.childElementContainer.append(t.element),r.items.AbstractContentItem.prototype.addChild.call(this,t),this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")},setSize:function(t,e){t=void 0===t?this._containerElement.width():t,e=void 0===e?this._containerElement.height():e,this.element.width(t),this.element.height(e),this.contentItems[0]&&(this.contentItems[0].element.width(t),this.contentItems[0].element.height(e))},_$highlightDropZone:function(t,e,n){this.layoutManager.tabDropPlaceholder.remove(),r.items.AbstractContentItem.prototype._$highlightDropZone.apply(this,arguments)},_$onDrop:function(t,e){var n;if(t.isComponent&&((n=this.layoutManager.createContentItem({type:"stack",header:t.config.header||{}},this))._$init(),n.addChild(t),t=n),this.contentItems.length){var i="x"==e.side[0]?"row":"column",o="x"==e.side[0]?"width":"height",s="2"==e.side[1],a=this.contentItems[0];if(!a instanceof r.items.RowOrColumn||a.type!=i){var l=this.layoutManager.createContentItem({type:i},this);this.replaceChild(a,l),l.addChild(t,s?0:void 0,!0),l.addChild(a,s?void 0:0,!0),a.config[o]=50,t.config[o]=50,l.callDownwards("setSize")}else{var c=a.contentItems[s?0:a.contentItems.length-1];a.addChild(t,s?0:void 0,!0),c.config[o]*=.5,t.config[o]=c.config[o],a.callDownwards("setSize")}}else this.addChild(t)}}),r.items.RowOrColumn=function(t,e,n,i){r.items.AbstractContentItem.call(this,e,n,i),this.isRow=!t,this.isColumn=t,this.element=s('
              '),this.childElementContainer=this.element,this._splitterSize=e.config.dimensions.borderWidth,this._splitterGrabSize=e.config.dimensions.borderGrabWidth,this._isColumn=t,this._dimension=t?"height":"width",this._splitter=[],this._splitterPosition=null,this._splitterMinPosition=null,this._splitterMaxPosition=null},r.utils.extend(r.items.RowOrColumn,r.items.AbstractContentItem),r.utils.copy(r.items.RowOrColumn.prototype,{addChild:function(t,e,n){var i,o,s,a;if(t=this.layoutManager._$normalizeContentItem(t,this),void 0===e&&(e=this.contentItems.length),this.contentItems.length>0?(a=this._createSplitter(Math.max(0,e-1)).element,e>0?(this.contentItems[e-1].element.after(a),a.after(t.element)):(this.contentItems[0].element.before(a),a.before(t.element))):this.childElementContainer.append(t.element),r.items.AbstractContentItem.prototype.addChild.call(this,t,e),i=1/this.contentItems.length*100,!0!==n){for(s=0;s0&&(this._calculateRelativeSizes(),this._setAbsoluteSizes()),this.emitBubblingEvent("stateChanged"),this.emit("resize")},_$init:function(){var t;if(!0!==this.isInitialised)for(r.items.AbstractContentItem.prototype._$init.call(this),t=0;t0&&e.itemSizes[t]++,this._isColumn?(this.contentItems[t].element.width(e.totalWidth),this.contentItems[t].element.height(e.itemSizes[t])):(this.contentItems[t].element.width(e.itemSizes[t]),this.contentItems[t].element.height(e.totalHeight))},_calculateAbsoluteSizes:function(){var t,e,n=(this.contentItems.length-1)*this._splitterSize,i=this.element.width(),o=this.element.height(),s=0,r=[];for(this._isColumn?o-=n:i-=n,t=0;t0){for(t=0;t100)for(t=0;tr)){for(e=a/r,l=a,u=0;uthis._splitterMinPosition&&i'),this._activeContentItem=null;var i=t.config;this._header={show:!0===i.settings.hasHeaders&&!1!==e.hasHeaders,popout:i.settings.showPopoutIcon&&i.labels.popout,maximise:i.settings.showMaximiseIcon&&i.labels.maximise,close:i.settings.showCloseIcon&&i.labels.close,minimise:i.labels.minimise},i.header&&r.utils.copy(this._header,i.header),e.header&&r.utils.copy(this._header,e.header),e.content&&e.content[0]&&e.content[0].header&&r.utils.copy(this._header,e.content[0].header),this._dropZones={},this._dropSegment=null,this._contentAreaDimensions=null,this._dropIndex=null,this.isStack=!0,this.childElementContainer=s('
              '),this.header=new r.controls.Header(t,this),this.element.append(this.header.element),this.element.append(this.childElementContainer),this._setupHeaderPosition(),this._$validateClosability()},r.utils.extend(r.items.Stack,r.items.AbstractContentItem),r.utils.copy(r.items.Stack.prototype,{setSize:function(){var t,e=this._header.show?this.layoutManager.config.dimensions.headerHeight:0,n=this.element.width()-(this._sided?e:0),i=this.element.height()-(this._sided?0:e);for(this.childElementContainer.width(n),this.childElementContainer.height(i),t=0;t0){if(!(e=this.contentItems[this.config.activeItemIndex||0]))throw new Error("Configured activeItemIndex out of bounds");this.setActiveContentItem(e)}}},setActiveContentItem:function(t){if(-1===r.utils.indexOf(t,this.contentItems))throw new Error("contentItem is not a child of this stack");null!==this._activeContentItem&&this._activeContentItem._$hide(),this._activeContentItem=t,this.header.setActiveContentItem(t),t._$show(),this.emit("activeContentItemChanged",t),this.layoutManager.emit("activeContentItemChanged",t),this.emitBubblingEvent("stateChanged")},getActiveContentItem:function(){return this.header.activeContentItem},addChild:function(t,e){t=this.layoutManager._$normalizeContentItem(t,this),r.items.AbstractContentItem.prototype.addChild.call(this,t,e),this.childElementContainer.append(t.element),this.header.createTab(t,e),this.setActiveContentItem(t),this.callDownwards("setSize"),this._$validateClosability(),this.emitBubblingEvent("stateChanged")},removeChild:function(t,e){var n=r.utils.indexOf(t,this.contentItems);r.items.AbstractContentItem.prototype.removeChild.call(this,t,e),this.header.removeTab(t),this.header.activeContentItem===t&&(this.contentItems.length>0?this.setActiveContentItem(this.contentItems[Math.max(n-1,0)]):this._activeContentItem=null),this._$validateClosability(),this.emitBubblingEvent("stateChanged")},_$validateClosability:function(){var t,e,n;for(t=this.header._isClosable(),n=0,e=this.contentItems.length;nt&&i.y1e)return void("header"===n?(this._dropSegment="header",this._highlightHeaderDropZone(this._sided?e:t)):(this._resetHeaderDropZone(),this._highlightBodyDropZone(n)))},_$getArea:function(){if(!1===this.element.is(":visible"))return null;var t=r.items.AbstractContentItem.prototype._$getArea,e=t.call(this,this.header.element),n=t.call(this,this.childElementContainer),i=n.x2-n.x1,o=n.y2-n.y1;return this._contentAreaDimensions={header:{hoverArea:{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},highlightArea:{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}},this._activeContentItem&&!1===this._activeContentItem.isComponent?e:0===this.contentItems.length?(this._contentAreaDimensions.body={hoverArea:{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2},highlightArea:{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2}},t.call(this,this.element)):(this._contentAreaDimensions.left={hoverArea:{x1:n.x1,y1:n.y1,x2:n.x1+.25*i,y2:n.y2},highlightArea:{x1:n.x1,y1:n.y1,x2:n.x1+.5*i,y2:n.y2}},this._contentAreaDimensions.top={hoverArea:{x1:n.x1+.25*i,y1:n.y1,x2:n.x1+.75*i,y2:n.y1+.5*o},highlightArea:{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y1+.5*o}},this._contentAreaDimensions.right={hoverArea:{x1:n.x1+.75*i,y1:n.y1,x2:n.x2,y2:n.y2},highlightArea:{x1:n.x1+.5*i,y1:n.y1,x2:n.x2,y2:n.y2}},this._contentAreaDimensions.bottom={hoverArea:{x1:n.x1+.25*i,y1:n.y1+.5*o,x2:n.x1+.75*i,y2:n.y2},highlightArea:{x1:n.x1,y1:n.y1+.5*o,x2:n.x2,y2:n.y2}},t.call(this,this.element))},_highlightHeaderDropZone:function(t){var e,n,i,o,s,r,a,l,c=this.header.tabs.length,h=!1;if(0===c)return a=this.header.element.offset(),void this.layoutManager.dropTargetIndicator.highlightArea({x1:a.left,x2:a.left+100,y1:a.top+this.header.element.height()-20,y2:a.top+this.header.element.height()});for(e=0;eo&&t=0&&this._header.show;if(this.header.element.toggle(!!this._header.show),this._side=t,this._sided=["right","left"].indexOf(this._side)>=0,this.element.removeClass("lm_left lm_right lm_bottom"),this._side&&this.element.addClass("lm_"+this._side),this.element.find(".lm_header").length&&this.childElementContainer){var e=["right","bottom"].indexOf(this._side)>=0?"before":"after";this.header.element[e](this.childElementContainer),this.callDownwards("setSize")}},_highlightBodyDropZone:function(t){var e=this._contentAreaDimensions[t].highlightArea;this.layoutManager.dropTargetIndicator.highlightArea(e),this._dropSegment=t}}),r.utils.BubblingEvent=function(t,e){this.name=t,this.origin=e,this.isPropagationStopped=!1},r.utils.BubblingEvent.prototype.stopPropagation=function(){this.isPropagationStopped=!0},r.utils.ConfigMinifier=function(){if(this._keys=["settings","hasHeaders","constrainDragToContainer","selectionEnabled","dimensions","borderWidth","minItemHeight","minItemWidth","headerHeight","dragProxyWidth","dragProxyHeight","labels","close","maximise","minimise","popout","content","componentName","componentState","id","width","type","height","isClosable","title","popoutWholeStack","openPopouts","parentId","activeItemIndex","reorderEnabled","borderGrabWidth"],this._keys.length>36)throw new Error("Too many keys in config minifier map");this._values=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"]},r.utils.copy(r.utils.ConfigMinifier.prototype,{minifyConfig:function(t){var e={};return this._nextLevel(t,e,"_min"),e},unminifyConfig:function(t){var e={};return this._nextLevel(t,e,"_max"),e},_nextLevel:function(t,e,n){var i,o;for(i in t)t instanceof Array&&(i=parseInt(i,10)),t.hasOwnProperty(i)&&(o=this[n](i,this._keys),"object"==typeof t[i]?(e[o]=t[i]instanceof Array?[]:{},this._nextLevel(t[i],e[o],n)):e[o]=this[n](t[i],this._values))},_min:function(t,e){if("string"==typeof t&&1===t.length)return"___"+t;var n=r.utils.indexOf(t,e);return-1===n?t:n.toString(36)},_max:function(t,e){return"string"==typeof t&&1===t.length?e[parseInt(t,36)]:"string"==typeof t&&"___"===t.substr(0,3)?t[3]:t}}),r.utils.EventHub=function(t){r.utils.EventEmitter.call(this),this._layoutManager=t,this._dontPropagateToParent=null,this._childEventSource=null,this.on(r.utils.EventEmitter.ALL_EVENT,r.utils.fnBind(this._onEventFromThis,this)),this._boundOnEventFromChild=r.utils.fnBind(this._onEventFromChild,this),s(window).on("gl_child_event",this._boundOnEventFromChild)},r.utils.EventHub.prototype._onEventFromThis=function(){var t=Array.prototype.slice.call(arguments);this._layoutManager.isSubWindow&&t[0]!==this._dontPropagateToParent&&this._propagateToParent(t),this._propagateToChildren(t),this._dontPropagateToParent=null,this._childEventSource=null},r.utils.EventHub.prototype._$onEventFromParent=function(t){this._dontPropagateToParent=t[0],this.emit.apply(this,t)},r.utils.EventHub.prototype._onEventFromChild=function(t){this._childEventSource=t.originalEvent.__gl,this.emit.apply(this,t.originalEvent.__glArgs)},r.utils.EventHub.prototype._propagateToParent=function(t){var e;document.createEvent?(e=window.opener.document.createEvent("HTMLEvents")).initEvent("gl_child_event",!0,!0):(e=window.opener.document.createEventObject()).eventType="gl_child_event",e.eventName="gl_child_event",e.__glArgs=t,e.__gl=this._layoutManager,document.createEvent?window.opener.dispatchEvent(e):window.opener.fireEvent("on"+e.eventType,e)},r.utils.EventHub.prototype._propagateToChildren=function(t){var e,n;for(n=0;n/g, '>' )\n\t\t\t.replace( /]+)>)/ig, '' ) );\n};\n/**\n * A generic and very fast EventEmitter\n * implementation. On top of emitting the\n * actual event it emits an\n *\n * lm.utils.EventEmitter.ALL_EVENT\n *\n * event for every event triggered. This allows\n * to hook into it and proxy events forwards\n *\n * @constructor\n */\nlm.utils.EventEmitter = function() {\n\tthis._mSubscriptions = {};\n\tthis._mSubscriptions[ lm.utils.EventEmitter.ALL_EVENT ] = [];\n\n\t/**\n\t * Listen for events\n\t *\n\t * @param {String} sEvent The name of the event to listen to\n\t * @param {Function} fCallback The callback to execute when the event occurs\n\t * @param {[Object]} oContext The value of the this pointer within the callback function\n\t *\n\t * @returns {void}\n\t */\n\tthis.on = function( sEvent, fCallback, oContext ) {\n\t\tif( !lm.utils.isFunction( fCallback ) ) {\n\t\t\tthrow new Error( 'Tried to listen to event ' + sEvent + ' with non-function callback ' + fCallback );\n\t\t}\n\n\t\tif( !this._mSubscriptions[ sEvent ] ) {\n\t\t\tthis._mSubscriptions[ sEvent ] = [];\n\t\t}\n\n\t\tthis._mSubscriptions[ sEvent ].push( { fn: fCallback, ctx: oContext } );\n\t};\n\n\t/**\n\t * Emit an event and notify listeners\n\t *\n\t * @param {String} sEvent The name of the event\n\t * @param {Mixed} various additional arguments that will be passed to the listener\n\t *\n\t * @returns {void}\n\t */\n\tthis.emit = function( sEvent ) {\n\t\tvar i, ctx, args;\n\n\t\targs = Array.prototype.slice.call( arguments, 1 );\n\n\t\tvar subs = this._mSubscriptions[ sEvent ];\n\n\t\tif( subs ) {\n \tsubs = subs.slice();\n\t\t\tfor( i = 0; i < subs.length; i++ ) {\n\t\t\t\tctx = subs[ i ].ctx || {};\n subs[ i ].fn.apply( ctx, args );\n\t\t\t}\n\t\t}\n\n\t\targs.unshift( sEvent );\n\n\t\tvar allEventSubs = this._mSubscriptions[ lm.utils.EventEmitter.ALL_EVENT ].slice()\n\n\t\tfor( i = 0; i this._nDistance ||\n\t\t\t\t\tMath.abs( this._nY ) > this._nDistance\n\t\t\t\t) {\n\t\t\t\t\tclearTimeout( this._timeout );\n\t\t\t\t\tthis._startDrag();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif( this._bDragging ) {\n\t\t\t\tthis.emit( 'drag', this._nX, this._nY, oEvent );\n\t\t\t}\n\t\t}\n\t},\n\n\tonMouseUp: function( oEvent ) {\n\t\tif( this._timeout != null ) {\n\t\t\tclearTimeout( this._timeout );\n\t\t\tthis._eBody.removeClass( 'lm_dragging' );\n\t\t\tthis._eElement.removeClass( 'lm_dragging' );\n\t\t\tthis._oDocument.find( 'iframe' ).css( 'pointer-events', '' );\n\t\t\tthis._oDocument.unbind( 'mousemove touchmove', this._fMove );\n\t\t\tthis._oDocument.unbind( 'mouseup touchend', this._fUp );\n\n\t\t\tif( this._bDragging === true ) {\n\t\t\t\tthis._bDragging = false;\n\t\t\t\tthis.emit( 'dragStop', oEvent, this._nOriginalX + this._nX );\n\t\t\t}\n\t\t}\n\t},\n\n\t_startDrag: function() {\n\t\tthis._bDragging = true;\n\t\tthis._eBody.addClass( 'lm_dragging' );\n\t\tthis._eElement.addClass( 'lm_dragging' );\n\t\tthis._oDocument.find( 'iframe' ).css( 'pointer-events', 'none' );\n\t\tthis.emit( 'dragStart', this._nOriginalX, this._nOriginalY );\n\t},\n\n\t_getCoordinates: function( event ) {\n\t\tevent = event.originalEvent && event.originalEvent.touches ? event.originalEvent.touches[ 0 ] : event;\n\t\treturn {\n\t\t\tx: event.pageX,\n\t\t\ty: event.pageY\n\t\t};\n\t}\n} );\n/**\n * The main class that will be exposed as GoldenLayout.\n *\n * @public\n * @constructor\n * @param {GoldenLayout config} config\n * @param {[DOM element container]} container Can be a jQuery selector string or a Dom element. Defaults to body\n *\n * @returns {VOID}\n */\nlm.LayoutManager = function( config, container ) {\n\n\tif( !$ || typeof $.noConflict !== 'function' ) {\n\t\tvar errorMsg = 'jQuery is missing as dependency for GoldenLayout. ';\n\t\terrorMsg += 'Please either expose $ on GoldenLayout\\'s scope (e.g. window) or add \"jquery\" to ';\n\t\terrorMsg += 'your paths when using RequireJS/AMD';\n\t\tthrow new Error( errorMsg );\n\t}\n\tlm.utils.EventEmitter.call( this );\n\n\tthis.isInitialised = false;\n\tthis._isFullPage = false;\n\tthis._resizeTimeoutId = null;\n\tthis._components = { 'lm-react-component': lm.utils.ReactComponentHandler };\n\tthis._itemAreas = [];\n\tthis._resizeFunction = lm.utils.fnBind( this._onResize, this );\n\tthis._unloadFunction = lm.utils.fnBind( this._onUnload, this );\n\tthis._maximisedItem = null;\n\tthis._maximisePlaceholder = $( '
              ' );\n\tthis._creationTimeoutPassed = false;\n\tthis._subWindowsCreated = false;\n\tthis._dragSources = [];\n\tthis._updatingColumnsResponsive = false;\n\tthis._firstLoad = true;\n\n\tthis.width = null;\n\tthis.height = null;\n\tthis.root = null;\n\tthis.openPopouts = [];\n\tthis.selectedItem = null;\n\tthis.isSubWindow = false;\n\tthis.eventHub = new lm.utils.EventHub( this );\n\tthis.config = this._createConfig( config );\n\tthis.container = container;\n\tthis.dropTargetIndicator = null;\n\tthis.transitionIndicator = null;\n\tthis.tabDropPlaceholder = $( '
              ' );\n\n\tif( this.isSubWindow === true ) {\n\t\t$( 'body' ).css( 'visibility', 'hidden' );\n\t}\n\n\tthis._typeToItem = {\n\t\t'column': lm.utils.fnBind( lm.items.RowOrColumn, this, [ true ] ),\n\t\t'row': lm.utils.fnBind( lm.items.RowOrColumn, this, [ false ] ),\n\t\t'stack': lm.items.Stack,\n\t\t'component': lm.items.Component\n\t};\n};\n\n/**\n * Hook that allows to access private classes\n */\nlm.LayoutManager.__lm = lm;\n\n/**\n * Takes a GoldenLayout configuration object and\n * replaces its keys and values recursively with\n * one letter codes\n *\n * @static\n * @public\n * @param {Object} config A GoldenLayout config object\n *\n * @returns {Object} minified config\n */\nlm.LayoutManager.minifyConfig = function( config ) {\n\treturn ( new lm.utils.ConfigMinifier() ).minifyConfig( config );\n};\n\n/**\n * Takes a configuration Object that was previously minified\n * using minifyConfig and returns its original version\n *\n * @static\n * @public\n * @param {Object} minifiedConfig\n *\n * @returns {Object} the original configuration\n */\nlm.LayoutManager.unminifyConfig = function( config ) {\n\treturn ( new lm.utils.ConfigMinifier() ).unminifyConfig( config );\n};\n\nlm.utils.copy( lm.LayoutManager.prototype, {\n\n\t/**\n\t * Register a component with the layout manager. If a configuration node\n\t * of type component is reached it will look up componentName and create the\n\t * associated component\n\t *\n\t * {\n\t *\t\ttype: \"component\",\n\t *\t\tcomponentName: \"EquityNewsFeed\",\n\t *\t\tcomponentState: { \"feedTopic\": \"us-bluechips\" }\n\t * }\n\t *\n\t * @public\n\t * @param {String} name\n\t * @param {Function} constructor\n\t *\n\t * @returns {void}\n\t */\n\tregisterComponent: function( name, constructor ) {\n\t\tif( typeof constructor !== 'function' ) {\n\t\t\tthrow new Error( 'Please register a constructor function' );\n\t\t}\n\n\t\tif( this._components[ name ] !== undefined ) {\n\t\t\tthrow new Error( 'Component ' + name + ' is already registered' );\n\t\t}\n\n\t\tthis._components[ name ] = constructor;\n\t},\n\n\t/**\n\t * Creates a layout configuration object based on the the current state\n\t *\n\t * @public\n\t * @returns {Object} GoldenLayout configuration\n\t */\n\ttoConfig: function( root ) {\n\t\tvar config, next, i;\n\n\t\tif( this.isInitialised === false ) {\n\t\t\tthrow new Error( 'Can\\'t create config, layout not yet initialised' );\n\t\t}\n\n\t\tif( root && !( root instanceof lm.items.AbstractContentItem ) ) {\n\t\t\tthrow new Error( 'Root must be a ContentItem' );\n\t\t}\n\n\t\t/*\n\t\t * settings & labels\n\t\t */\n\t\tconfig = {\n\t\t\tsettings: lm.utils.copy( {}, this.config.settings ),\n\t\t\tdimensions: lm.utils.copy( {}, this.config.dimensions ),\n\t\t\tlabels: lm.utils.copy( {}, this.config.labels )\n\t\t};\n\n\t\t/*\n\t\t * Content\n\t\t */\n\t\tconfig.content = [];\n\t\tnext = function( configNode, item ) {\n\t\t\tvar key, i;\n\n\t\t\tfor( key in item.config ) {\n\t\t\t\tif( key !== 'content' ) {\n\t\t\t\t\tconfigNode[ key ] = item.config[ key ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif( item.contentItems.length ) {\n\t\t\t\tconfigNode.content = [];\n\n\t\t\t\tfor( i = 0; i < item.contentItems.length; i++ ) {\n\t\t\t\t\tconfigNode.content[ i ] = {};\n\t\t\t\t\tnext( configNode.content[ i ], item.contentItems[ i ] );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tif( root ) {\n\t\t\tnext( config, { contentItems: [ root ] } );\n\t\t} else {\n\t\t\tnext( config, this.root );\n\t\t}\n\n\t\t/*\n\t\t * Retrieve config for subwindows\n\t\t */\n\t\tthis._$reconcilePopoutWindows();\n\t\tconfig.openPopouts = [];\n\t\tfor( i = 0; i < this.openPopouts.length; i++ ) {\n\t\t\tconfig.openPopouts.push( this.openPopouts[ i ].toConfig() );\n\t\t}\n\n\t\t/*\n\t\t * Add maximised item\n\t\t */\n\t\tconfig.maximisedItemId = this._maximisedItem ? '__glMaximised' : null;\n\t\treturn config;\n\t},\n\n\t/**\n\t * Returns a previously registered component\n\t *\n\t * @public\n\t * @param {String} name The name used\n\t *\n\t * @returns {Function}\n\t */\n\tgetComponent: function( name ) {\n\t\tif( this._components[ name ] === undefined ) {\n\t\t\tthrow new lm.errors.ConfigurationError( 'Unknown component \"' + name + '\"' );\n\t\t}\n\n\t\treturn this._components[ name ];\n\t},\n\n\t/**\n\t * Creates the actual layout. Must be called after all initial components\n\t * are registered. Recurses through the configuration and sets up\n\t * the item tree.\n\t *\n\t * If called before the document is ready it adds itself as a listener\n\t * to the document.ready event\n\t *\n\t * @public\n\t *\n\t * @returns {void}\n\t */\n\tinit: function() {\n\n\t\t/**\n\t\t * Create the popout windows straight away. If popouts are blocked\n\t\t * an error is thrown on the same 'thread' rather than a timeout and can\n\t\t * be caught. This also prevents any further initilisation from taking place.\n\t\t */\n\t\tif( this._subWindowsCreated === false ) {\n\t\t\tthis._createSubWindows();\n\t\t\tthis._subWindowsCreated = true;\n\t\t}\n\n\n\t\t/**\n\t\t * If the document isn't ready yet, wait for it.\n\t\t */\n\t\tif( document.readyState === 'loading' || document.body === null ) {\n\t\t\t$( document ).ready( lm.utils.fnBind( this.init, this ) );\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * If this is a subwindow, wait a few milliseconds for the original\n\t\t * page's js calls to be executed, then replace the bodies content\n\t\t * with GoldenLayout\n\t\t */\n\t\tif( this.isSubWindow === true && this._creationTimeoutPassed === false ) {\n\t\t\tsetTimeout( lm.utils.fnBind( this.init, this ), 7 );\n\t\t\tthis._creationTimeoutPassed = true;\n\t\t\treturn;\n\t\t}\n\n\t\tif( this.isSubWindow === true ) {\n\t\t\tthis._adjustToWindowMode();\n\t\t}\n\n\t\tthis._setContainer();\n\t\tthis.dropTargetIndicator = new lm.controls.DropTargetIndicator( this.container );\n\t\tthis.transitionIndicator = new lm.controls.TransitionIndicator();\n\t\tthis.updateSize();\n\t\tthis._create( this.config );\n\t\tthis._bindEvents();\n\t\tthis.isInitialised = true;\n\t\tthis._adjustColumnsResponsive();\n\t\tthis.emit( 'initialised' );\n\t},\n\n\t/**\n\t * Updates the layout managers size\n\t *\n\t * @public\n\t * @param {[int]} width height in pixels\n\t * @param {[int]} height width in pixels\n\t *\n\t * @returns {void}\n\t */\n\tupdateSize: function( width, height ) {\n\t\tif( arguments.length === 2 ) {\n\t\t\tthis.width = width;\n\t\t\tthis.height = height;\n\t\t} else {\n\t\t\tthis.width = this.container.width();\n\t\t\tthis.height = this.container.height();\n\t\t}\n\n\t\tif( this.isInitialised === true ) {\n\t\t\tthis.root.callDownwards( 'setSize', [ this.width, this.height ] );\n\n\t\t\tif( this._maximisedItem ) {\n\t\t\t\tthis._maximisedItem.element.width( this.container.width() );\n\t\t\t\tthis._maximisedItem.element.height( this.container.height() );\n\t\t\t\tthis._maximisedItem.callDownwards( 'setSize' );\n\t\t\t}\n\n\t\t\tthis._adjustColumnsResponsive();\n\t\t}\n\t},\n\n\t/**\n\t * Destroys the LayoutManager instance itself as well as every ContentItem\n\t * within it. After this is called nothing should be left of the LayoutManager.\n\t *\n\t * @public\n\t * @returns {void}\n\t */\n\tdestroy: function() {\n\t\tif( this.isInitialised === false ) {\n\t\t\treturn;\n\t\t}\n\t\tthis._onUnload();\n\t\t$( window ).off( 'resize', this._resizeFunction );\n\t\t$( window ).off( 'unload beforeunload', this._unloadFunction );\n\t\tthis.root.callDownwards( '_$destroy', [], true );\n\t\tthis.root.contentItems = [];\n\t\tthis.tabDropPlaceholder.remove();\n\t\tthis.dropTargetIndicator.destroy();\n\t\tthis.transitionIndicator.destroy();\n\t\tthis.eventHub.destroy();\n\n\t\tthis._dragSources.forEach( function( dragSource ) {\n\t\t\tdragSource._dragListener.destroy();\n\t\t\tdragSource._element = null;\n\t\t\tdragSource._itemConfig = null;\n\t\t\tdragSource._dragListener = null;\n\t\t} );\n\t\tthis._dragSources = [];\n\t},\n\n\t/**\n\t * Recursively creates new item tree structures based on a provided\n\t * ItemConfiguration object\n\t *\n\t * @public\n\t * @param {Object} config ItemConfig\n\t * @param {[ContentItem]} parent The item the newly created item should be a child of\n\t *\n\t * @returns {lm.items.ContentItem}\n\t */\n\tcreateContentItem: function( config, parent ) {\n\t\tvar typeErrorMsg, contentItem;\n\n\t\tif( typeof config.type !== 'string' ) {\n\t\t\tthrow new lm.errors.ConfigurationError( 'Missing parameter \\'type\\'', config );\n\t\t}\n\n\t\tif( config.type === 'react-component' ) {\n\t\t\tconfig.type = 'component';\n\t\t\tconfig.componentName = 'lm-react-component';\n\t\t}\n\n\t\tif( !this._typeToItem[ config.type ] ) {\n\t\t\ttypeErrorMsg = 'Unknown type \\'' + config.type + '\\'. ' +\n\t\t\t\t'Valid types are ' + lm.utils.objectKeys( this._typeToItem ).join( ',' );\n\n\t\t\tthrow new lm.errors.ConfigurationError( typeErrorMsg );\n\t\t}\n\n\n\t\t/**\n\t\t * We add an additional stack around every component that's not within a stack anyways.\n\t\t */\n\t\tif(\n\t\t\t// If this is a component\n\t\tconfig.type === 'component' &&\n\n\t\t// and it's not already within a stack\n\t\t!( parent instanceof lm.items.Stack ) &&\n\n\t\t// and we have a parent\n\t\t!!parent &&\n\n\t\t// and it's not the topmost item in a new window\n\t\t!( this.isSubWindow === true && parent instanceof lm.items.Root )\n\t\t) {\n\t\t\tconfig = {\n\t\t\t\ttype: 'stack',\n\t\t\t\twidth: config.width,\n\t\t\t\theight: config.height,\n\t\t\t\tcontent: [ config ]\n\t\t\t};\n\t\t}\n\n\t\tcontentItem = new this._typeToItem[ config.type ]( this, config, parent );\n\t\treturn contentItem;\n\t},\n\n\t/**\n\t * Creates a popout window with the specified content and dimensions\n\t *\n\t * @param {Object|lm.itemsAbstractContentItem} configOrContentItem\n\t * @param {[Object]} dimensions A map with width, height, left and top\n\t * @param {[String]} parentId the id of the element this item will be appended to\n\t * when popIn is called\n\t * @param {[Number]} indexInParent The position of this item within its parent element\n\n\t * @returns {lm.controls.BrowserPopout}\n\t */\n\tcreatePopout: function( configOrContentItem, dimensions, parentId, indexInParent ) {\n\t\tvar config = configOrContentItem,\n\t\t\tisItem = configOrContentItem instanceof lm.items.AbstractContentItem,\n\t\t\tself = this,\n\t\t\twindowLeft,\n\t\t\twindowTop,\n\t\t\toffset,\n\t\t\tparent,\n\t\t\tchild,\n\t\t\tbrowserPopout;\n\n\t\tparentId = parentId || null;\n\n\t\tif( isItem ) {\n\t\t\tconfig = this.toConfig( configOrContentItem ).content;\n\t\t\tparentId = lm.utils.getUniqueId();\n\n\t\t\t/**\n\t\t\t * If the item is the only component within a stack or for some\n\t\t\t * other reason the only child of its parent the parent will be destroyed\n\t\t\t * when the child is removed.\n\t\t\t *\n\t\t\t * In order to support this we move up the tree until we find something\n\t\t\t * that will remain after the item is being popped out\n\t\t\t */\n\t\t\tparent = configOrContentItem.parent;\n\t\t\tchild = configOrContentItem;\n\t\t\twhile( parent.contentItems.length === 1 && !parent.isRoot ) {\n\t\t\t\tparent = parent.parent;\n\t\t\t\tchild = child.parent;\n\t\t\t}\n\n\t\t\tparent.addId( parentId );\n\t\t\tif( isNaN( indexInParent ) ) {\n\t\t\t\tindexInParent = lm.utils.indexOf( child, parent.contentItems );\n\t\t\t}\n\t\t} else {\n\t\t\tif( !( config instanceof Array ) ) {\n\t\t\t\tconfig = [ config ];\n\t\t\t}\n\t\t}\n\n\n\t\tif( !dimensions && isItem ) {\n\t\t\twindowLeft = window.screenX || window.screenLeft;\n\t\t\twindowTop = window.screenY || window.screenTop;\n\t\t\toffset = configOrContentItem.element.offset();\n\n\t\t\tdimensions = {\n\t\t\t\tleft: windowLeft + offset.left,\n\t\t\t\ttop: windowTop + offset.top,\n\t\t\t\twidth: configOrContentItem.element.width(),\n\t\t\t\theight: configOrContentItem.element.height()\n\t\t\t};\n\t\t}\n\n\t\tif( !dimensions && !isItem ) {\n\t\t\tdimensions = {\n\t\t\t\tleft: window.screenX || window.screenLeft + 20,\n\t\t\t\ttop: window.screenY || window.screenTop + 20,\n\t\t\t\twidth: 500,\n\t\t\t\theight: 309\n\t\t\t};\n\t\t}\n\n\t\tif( isItem ) {\n\t\t\tconfigOrContentItem.remove();\n\t\t}\n\n\t\tbrowserPopout = new lm.controls.BrowserPopout( config, dimensions, parentId, indexInParent, this );\n\n\t\tbrowserPopout.on( 'initialised', function() {\n\t\t\tself.emit( 'windowOpened', browserPopout );\n\t\t} );\n\n\t\tbrowserPopout.on( 'closed', function() {\n\t\t\tself._$reconcilePopoutWindows();\n\t\t} );\n\n\t\tthis.openPopouts.push( browserPopout );\n\n\t\treturn browserPopout;\n\t},\n\n\t/**\n\t * Attaches DragListener to any given DOM element\n\t * and turns it into a way of creating new ContentItems\n\t * by 'dragging' the DOM element into the layout\n\t *\n\t * @param {jQuery DOM element} element\n\t * @param {Object|Function} itemConfig for the new item to be created, or a function which will provide it\n\t *\n\t * @returns {void}\n\t */\n\tcreateDragSource: function( element, itemConfig ) {\n\t\tthis.config.settings.constrainDragToContainer = false;\n\t\tvar dragSource = new lm.controls.DragSource( $( element ), itemConfig, this );\n\t\tthis._dragSources.push( dragSource );\n\n\t\treturn dragSource;\n\t},\n\n\t/**\n\t * Programmatically selects an item. This deselects\n\t * the currently selected item, selects the specified item\n\t * and emits a selectionChanged event\n\t *\n\t * @param {lm.item.AbstractContentItem} item#\n\t * @param {[Boolean]} _$silent Wheather to notify the item of its selection\n\t * @event selectionChanged\n\t *\n\t * @returns {VOID}\n\t */\n\tselectItem: function( item, _$silent ) {\n\n\t\tif( this.config.settings.selectionEnabled !== true ) {\n\t\t\tthrow new Error( 'Please set selectionEnabled to true to use this feature' );\n\t\t}\n\n\t\tif( item === this.selectedItem ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif( this.selectedItem !== null ) {\n\t\t\tthis.selectedItem.deselect();\n\t\t}\n\n\t\tif( item && _$silent !== true ) {\n\t\t\titem.select();\n\t\t}\n\n\t\tthis.selectedItem = item;\n\n\t\tthis.emit( 'selectionChanged', item );\n\t},\n\n\t/*************************\n\t * PACKAGE PRIVATE\n\t *************************/\n\t_$maximiseItem: function( contentItem ) {\n\t\tif( this._maximisedItem !== null ) {\n\t\t\tthis._$minimiseItem( this._maximisedItem );\n\t\t}\n\t\tthis._maximisedItem = contentItem;\n\t\tthis._maximisedItem.addId( '__glMaximised' );\n\t\tcontentItem.element.addClass( 'lm_maximised' );\n\t\tcontentItem.element.after( this._maximisePlaceholder );\n\t\tthis.root.element.prepend( contentItem.element );\n\t\tcontentItem.element.width( this.container.width() );\n\t\tcontentItem.element.height( this.container.height() );\n\t\tcontentItem.callDownwards( 'setSize' );\n\t\tthis._maximisedItem.emit( 'maximised' );\n\t\tthis.emit( 'stateChanged' );\n\t},\n\n\t_$minimiseItem: function( contentItem ) {\n\t\tcontentItem.element.removeClass( 'lm_maximised' );\n\t\tcontentItem.removeId( '__glMaximised' );\n\t\tthis._maximisePlaceholder.after( contentItem.element );\n\t\tthis._maximisePlaceholder.remove();\n\t\tcontentItem.parent.callDownwards( 'setSize' );\n\t\tthis._maximisedItem = null;\n\t\tcontentItem.emit( 'minimised' );\n\t\tthis.emit( 'stateChanged' );\n\t},\n\n\t/**\n\t * This method is used to get around sandboxed iframe restrictions.\n\t * If 'allow-top-navigation' is not specified in the iframe's 'sandbox' attribute\n\t * (as is the case with codepens) the parent window is forbidden from calling certain\n\t * methods on the child, such as window.close() or setting document.location.href.\n\t *\n\t * This prevented GoldenLayout popouts from popping in in codepens. The fix is to call\n\t * _$closeWindow on the child window's gl instance which (after a timeout to disconnect\n\t * the invoking method from the close call) closes itself.\n\t *\n\t * @packagePrivate\n\t *\n\t * @returns {void}\n\t */\n\t_$closeWindow: function() {\n\t\twindow.setTimeout( function() {\n\t\t\twindow.close();\n\t\t}, 1 );\n\t},\n\n\t_$getArea: function( x, y ) {\n\t\tvar i, area, smallestSurface = Infinity, mathingArea = null;\n\n\t\tfor( i = 0; i < this._itemAreas.length; i++ ) {\n\t\t\tarea = this._itemAreas[ i ];\n\n\t\t\tif(\n\t\t\t\tx > area.x1 &&\n\t\t\t\tx < area.x2 &&\n\t\t\t\ty > area.y1 &&\n\t\t\t\ty < area.y2 &&\n\t\t\t\tsmallestSurface > area.surface\n\t\t\t) {\n\t\t\t\tsmallestSurface = area.surface;\n\t\t\t\tmathingArea = area;\n\t\t\t}\n\t\t}\n\n\t\treturn mathingArea;\n\t},\n\n\t_$createRootItemAreas: function() {\n\t\tvar areaSize = 50;\n\t\tvar sides = { y2: 0, x2: 0, y1: 'y2', x1: 'x2' };\n\t\tfor( var side in sides ) {\n\t\t\tvar area = this.root._$getArea();\n\t\t\tarea.side = side;\n\t\t\tif( sides [ side ] )\n\t\t\t\tarea[ side ] = area[ sides [ side ] ] - areaSize;\n\t\t\telse\n\t\t\t\tarea[ side ] = areaSize;\t\t\t\n\t\t\tarea.surface = ( area.x2 - area.x1 ) * ( area.y2 - area.y1 );\n\t\t\tthis._itemAreas.push( area );\n\t\t}\n\t},\n\n\t_$calculateItemAreas: function() {\n\t\tvar i, area, allContentItems = this._getAllContentItems();\n\t\tthis._itemAreas = [];\n\n\t\t/**\n\t\t * If the last item is dragged out, highlight the entire container size to\n\t\t * allow to re-drop it. allContentItems[ 0 ] === this.root at this point\n\t\t *\n\t\t * Don't include root into the possible drop areas though otherwise since it\n\t\t * will used for every gap in the layout, e.g. splitters\n\t\t */\n\t\tif( allContentItems.length === 1 ) {\n\t\t\tthis._itemAreas.push( this.root._$getArea() );\n\t\t\treturn;\n\t\t}\n\t\tthis._$createRootItemAreas();\n\n\t\tfor( i = 0; i < allContentItems.length; i++ ) {\n\n\t\t\tif( !( allContentItems[ i ].isStack ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tarea = allContentItems[ i ]._$getArea();\n\n\t\t\tif( area === null ) {\n\t\t\t\tcontinue;\n\t\t\t} else if( area instanceof Array ) {\n\t\t\t\tthis._itemAreas = this._itemAreas.concat( area );\n\t\t\t} else {\n\t\t\t\tthis._itemAreas.push( area );\n\t\t\t\tvar header = {};\n\t\t\t\tlm.utils.copy( header, area );\n\t\t\t\tlm.utils.copy( header, area.contentItem._contentAreaDimensions.header.highlightArea );\n\t\t\t\theader.surface = ( header.x2 - header.x1 ) * ( header.y2 - header.y1 );\n\t\t\t\tthis._itemAreas.push( header );\n\t\t\t}\n\t\t}\n\t},\n\n\t/**\n\t * Takes a contentItem or a configuration and optionally a parent\n\t * item and returns an initialised instance of the contentItem.\n\t * If the contentItem is a function, it is first called\n\t *\n\t * @packagePrivate\n\t *\n\t * @param {lm.items.AbtractContentItem|Object|Function} contentItemOrConfig\n\t * @param {lm.items.AbtractContentItem} parent Only necessary when passing in config\n\t *\n\t * @returns {lm.items.AbtractContentItem}\n\t */\n\t_$normalizeContentItem: function( contentItemOrConfig, parent ) {\n\t\tif( !contentItemOrConfig ) {\n\t\t\tthrow new Error( 'No content item defined' );\n\t\t}\n\n\t\tif( lm.utils.isFunction( contentItemOrConfig ) ) {\n\t\t\tcontentItemOrConfig = contentItemOrConfig();\n\t\t}\n\n\t\tif( contentItemOrConfig instanceof lm.items.AbstractContentItem ) {\n\t\t\treturn contentItemOrConfig;\n\t\t}\n\n\t\tif( $.isPlainObject( contentItemOrConfig ) && contentItemOrConfig.type ) {\n\t\t\tvar newContentItem = this.createContentItem( contentItemOrConfig, parent );\n\t\t\tnewContentItem.callDownwards( '_$init' );\n\t\t\treturn newContentItem;\n\t\t} else {\n\t\t\tthrow new Error( 'Invalid contentItem' );\n\t\t}\n\t},\n\n\t/**\n\t * Iterates through the array of open popout windows and removes the ones\n\t * that are effectively closed. This is necessary due to the lack of reliably\n\t * listening for window.close / unload events in a cross browser compatible fashion.\n\t *\n\t * @packagePrivate\n\t *\n\t * @returns {void}\n\t */\n\t_$reconcilePopoutWindows: function() {\n\t\tvar openPopouts = [], i;\n\n\t\tfor( i = 0; i < this.openPopouts.length; i++ ) {\n\t\t\tif( this.openPopouts[ i ].getWindow().closed === false ) {\n\t\t\t\topenPopouts.push( this.openPopouts[ i ] );\n\t\t\t} else {\n\t\t\t\tthis.emit( 'windowClosed', this.openPopouts[ i ] );\n\t\t\t}\n\t\t}\n\n\t\tif( this.openPopouts.length !== openPopouts.length ) {\n\t\t\tthis.emit( 'stateChanged' );\n\t\t\tthis.openPopouts = openPopouts;\n\t\t}\n\n\t},\n\n\t/***************************\n\t * PRIVATE\n\t ***************************/\n\t/**\n\t * Returns a flattened array of all content items,\n\t * regardles of level or type\n\t *\n\t * @private\n\t *\n\t * @returns {void}\n\t */\n\t_getAllContentItems: function() {\n\t\tvar allContentItems = [];\n\n\t\tvar addChildren = function( contentItem ) {\n\t\t\tallContentItems.push( contentItem );\n\n\t\t\tif( contentItem.contentItems instanceof Array ) {\n\t\t\t\tfor( var i = 0; i < contentItem.contentItems.length; i++ ) {\n\t\t\t\t\taddChildren( contentItem.contentItems[ i ] );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\taddChildren( this.root );\n\n\t\treturn allContentItems;\n\t},\n\n\t/**\n\t * Binds to DOM/BOM events on init\n\t *\n\t * @private\n\t *\n\t * @returns {void}\n\t */\n\t_bindEvents: function() {\n\t\tif( this._isFullPage ) {\n\t\t\t$( window ).resize( this._resizeFunction );\n\t\t}\n\t\t$( window ).on( 'unload beforeunload', this._unloadFunction );\n\t},\n\n\t/**\n\t * Debounces resize events\n\t *\n\t * @private\n\t *\n\t * @returns {void}\n\t */\n\t_onResize: function() {\n\t\tclearTimeout( this._resizeTimeoutId );\n\t\tthis._resizeTimeoutId = setTimeout( lm.utils.fnBind( this.updateSize, this ), 100 );\n\t},\n\n\t/**\n\t * Extends the default config with the user specific settings and applies\n\t * derivations. Please note that there's a seperate method (AbstractContentItem._extendItemNode)\n\t * that deals with the extension of item configs\n\t *\n\t * @param {Object} config\n\t * @static\n\t * @returns {Object} config\n\t */\n\t_createConfig: function( config ) {\n\t\tvar windowConfigKey = lm.utils.getQueryStringParam( 'gl-window' );\n\n\t\tif( windowConfigKey ) {\n\t\t\tthis.isSubWindow = true;\n\t\t\tconfig = localStorage.getItem( windowConfigKey );\n\t\t\tconfig = JSON.parse( config );\n\t\t\tconfig = ( new lm.utils.ConfigMinifier() ).unminifyConfig( config );\n\t\t\tlocalStorage.removeItem( windowConfigKey );\n\t\t}\n\n\t\tconfig = $.extend( true, {}, lm.config.defaultConfig, config );\n\n\t\tvar nextNode = function( node ) {\n\t\t\tfor( var key in node ) {\n\t\t\t\tif( key !== 'props' && typeof node[ key ] === 'object' ) {\n\t\t\t\t\tnextNode( node[ key ] );\n\t\t\t\t}\n\t\t\t\telse if( key === 'type' && node[ key ] === 'react-component' ) {\n\t\t\t\t\tnode.type = 'component';\n\t\t\t\t\tnode.componentName = 'lm-react-component';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tnextNode( config );\n\n\t\tif( config.settings.hasHeaders === false ) {\n\t\t\tconfig.dimensions.headerHeight = 0;\n\t\t}\n\n\t\treturn config;\n\t},\n\n\t/**\n\t * This is executed when GoldenLayout detects that it is run\n\t * within a previously opened popout window.\n\t *\n\t * @private\n\t *\n\t * @returns {void}\n\t */\n\t_adjustToWindowMode: function() {\n\t\tvar popInButton = $( '
              ' +\n\t\t\t'
              ' +\n\t\t\t'
              ' +\n\t\t\t'
              ' );\n\n\t\tpopInButton.click( lm.utils.fnBind( function() {\n\t\t\tthis.emit( 'popIn' );\n\t\t}, this ) );\n\n\t\tdocument.title = lm.utils.stripTags( this.config.content[ 0 ].title );\n\n\t\t$( 'head' ).append( $( 'body link, body style, template, .gl_keep' ) );\n\n\t\tthis.container = $( 'body' )\n\t\t\t.html( '' )\n\t\t\t.css( 'visibility', 'visible' )\n\t\t\t.append( popInButton );\n\n\t\t/*\n\t\t * This seems a bit pointless, but actually causes a reflow/re-evaluation getting around\n\t\t * slickgrid's \"Cannot find stylesheet.\" bug in chrome\n\t\t */\n\t\tvar x = document.body.offsetHeight; // jshint ignore:line\n\n\t\t/*\n\t\t * Expose this instance on the window object\n\t\t * to allow the opening window to interact with\n\t\t * it\n\t\t */\n\t\twindow.__glInstance = this;\n\t},\n\n\t/**\n\t * Creates Subwindows (if there are any). Throws an error\n\t * if popouts are blocked.\n\t *\n\t * @returns {void}\n\t */\n\t_createSubWindows: function() {\n\t\tvar i, popout;\n\n\t\tfor( i = 0; i < this.config.openPopouts.length; i++ ) {\n\t\t\tpopout = this.config.openPopouts[ i ];\n\n\t\t\tthis.createPopout(\n\t\t\t\tpopout.content,\n\t\t\t\tpopout.dimensions,\n\t\t\t\tpopout.parentId,\n\t\t\t\tpopout.indexInParent\n\t\t\t);\n\t\t}\n\t},\n\n\t/**\n\t * Determines what element the layout will be created in\n\t *\n\t * @private\n\t *\n\t * @returns {void}\n\t */\n\t_setContainer: function() {\n\t\tvar container = $( this.container || 'body' );\n\n\t\tif( container.length === 0 ) {\n\t\t\tthrow new Error( 'GoldenLayout container not found' );\n\t\t}\n\n\t\tif( container.length > 1 ) {\n\t\t\tthrow new Error( 'GoldenLayout more than one container element specified' );\n\t\t}\n\n\t\tif( container[ 0 ] === document.body ) {\n\t\t\tthis._isFullPage = true;\n\n\t\t\t$( 'html, body' ).css( {\n\t\t\t\theight: '100%',\n\t\t\t\tmargin: 0,\n\t\t\t\tpadding: 0,\n\t\t\t\toverflow: 'hidden'\n\t\t\t} );\n\t\t}\n\n\t\tthis.container = container;\n\t},\n\n\t/**\n\t * Kicks of the initial, recursive creation chain\n\t *\n\t * @param {Object} config GoldenLayout Config\n\t *\n\t * @returns {void}\n\t */\n\t_create: function( config ) {\n\t\tvar errorMsg;\n\n\t\tif( !( config.content instanceof Array ) ) {\n\t\t\tif( config.content === undefined ) {\n\t\t\t\terrorMsg = 'Missing setting \\'content\\' on top level of configuration';\n\t\t\t} else {\n\t\t\t\terrorMsg = 'Configuration parameter \\'content\\' must be an array';\n\t\t\t}\n\n\t\t\tthrow new lm.errors.ConfigurationError( errorMsg, config );\n\t\t}\n\n\t\tif( config.content.length > 1 ) {\n\t\t\terrorMsg = 'Top level content can\\'t contain more then one element.';\n\t\t\tthrow new lm.errors.ConfigurationError( errorMsg, config );\n\t\t}\n\n\t\tthis.root = new lm.items.Root( this, { content: config.content }, this.container );\n\t\tthis.root.callDownwards( '_$init' );\n\n\t\tif( config.maximisedItemId === '__glMaximised' ) {\n\t\t\tthis.root.getItemsById( config.maximisedItemId )[ 0 ].toggleMaximise();\n\t\t}\n\t},\n\n\t/**\n\t * Called when the window is closed or the user navigates away\n\t * from the page\n\t *\n\t * @returns {void}\n\t */\n\t_onUnload: function() {\n\t\tif( this.config.settings.closePopoutsOnUnload === true ) {\n\t\t\tfor( var i = 0; i < this.openPopouts.length; i++ ) {\n\t\t\t\tthis.openPopouts[ i ].close();\n\t\t\t}\n\t\t}\n\t},\n\n\t/**\n\t * Adjusts the number of columns to be lower to fit the screen and still maintain minItemWidth.\n\t *\n\t * @returns {void}\n\t */\n\t_adjustColumnsResponsive: function() {\n\n\t\t// If there is no min width set, or not content items, do nothing.\n\t\tif( !this._useResponsiveLayout() || this._updatingColumnsResponsive || !this.config.dimensions || !this.config.dimensions.minItemWidth || this.root.contentItems.length === 0 || !this.root.contentItems[ 0 ].isRow ) {\n\t\t\tthis._firstLoad = false;\n\t\t\treturn;\n\t\t}\n\n\t\tthis._firstLoad = false;\n\n\t\t// If there is only one column, do nothing.\n\t\tvar columnCount = this.root.contentItems[ 0 ].contentItems.length;\n\t\tif( columnCount <= 1 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If they all still fit, do nothing.\n\t\tvar minItemWidth = this.config.dimensions.minItemWidth;\n\t\tvar totalMinWidth = columnCount * minItemWidth;\n\t\tif( totalMinWidth <= this.width ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Prevent updates while it is already happening.\n\t\tthis._updatingColumnsResponsive = true;\n\n\t\t// Figure out how many columns to stack, and put them all in the first stack container.\n\t\tvar finalColumnCount = Math.max( Math.floor( this.width / minItemWidth ), 1 );\n\t\tvar stackColumnCount = columnCount - finalColumnCount;\n\n\t\tvar rootContentItem = this.root.contentItems[ 0 ];\n\t\tvar firstStackContainer = this._findAllStackContainers()[ 0 ];\n\t\tfor( var i = 0; i < stackColumnCount; i++ ) {\n\t\t\t// Stack from right.\n\t\t\tvar column = rootContentItem.contentItems[ rootContentItem.contentItems.length - 1 ];\n\t\t\tthis._addChildContentItemsToContainer( firstStackContainer, column );\n\t\t}\n\n\t\tthis._updatingColumnsResponsive = false;\n\t},\n\n\t/**\n\t * Determines if responsive layout should be used.\n\t *\n\t * @returns {bool} - True if responsive layout should be used; otherwise false.\n\t */\n\t_useResponsiveLayout: function() {\n\t\treturn this.config.settings && ( this.config.settings.responsiveMode == 'always' || ( this.config.settings.responsiveMode == 'onload' && this._firstLoad ) );\n\t},\n\n\t/**\n\t * Adds all children of a node to another container recursively.\n\t * @param {object} container - Container to add child content items to.\n\t * @param {object} node - Node to search for content items.\n\t * @returns {void}\n\t */\n\t_addChildContentItemsToContainer: function( container, node ) {\n\t\tif( node.type === 'stack' ) {\n\t\t\tnode.contentItems.forEach( function( item ) {\n\t\t\t\tcontainer.addChild( item );\n\t\t\t\tnode.removeChild( item, true );\n\t\t\t} );\n\t\t}\n\t\telse {\n\t\t\tnode.contentItems.forEach( lm.utils.fnBind( function( item ) {\n\t\t\t\tthis._addChildContentItemsToContainer( container, item );\n\t\t\t}, this ) );\n\t\t}\n\t},\n\n\t/**\n\t * Finds all the stack containers.\n\t * @returns {array} - The found stack containers.\n\t */\n\t_findAllStackContainers: function() {\n\t\tvar stackContainers = [];\n\t\tthis._findAllStackContainersRecursive( stackContainers, this.root );\n\n\t\treturn stackContainers;\n\t},\n\n\t/**\n\t * Finds all the stack containers.\n\t *\n\t * @param {array} - Set of containers to populate.\n\t * @param {object} - Current node to process.\n\t *\n\t * @returns {void}\n\t */\n\t_findAllStackContainersRecursive: function( stackContainers, node ) {\n\t\tnode.contentItems.forEach( lm.utils.fnBind( function( item ) {\n\t\t\tif( item.type == 'stack' ) {\n\t\t\t\tstackContainers.push( item );\n\t\t\t}\n\t\t\telse if( !item.isComponent ) {\n\t\t\t\tthis._findAllStackContainersRecursive( stackContainers, item );\n\t\t\t}\n\t\t}, this ) );\n\t}\n} );\n\n/**\n * Expose the Layoutmanager as the single entrypoint using UMD\n */\n(function() {\n\t/* global define */\n\tif( typeof define === 'function' && define.amd ) {\n\t\tdefine( [ 'jquery' ], function( jquery ) {\n\t\t\t$ = jquery;\n\t\t\treturn lm.LayoutManager;\n\t\t} ); // jshint ignore:line\n\t} else if( typeof exports === 'object' ) {\n\t\tmodule.exports = lm.LayoutManager;\n\t} else {\n\t\twindow.GoldenLayout = lm.LayoutManager;\n\t}\n})();\n\nlm.config.itemDefaultConfig = {\n\tisClosable: true,\n\treorderEnabled: true,\n\ttitle: ''\n};\nlm.config.defaultConfig = {\n\topenPopouts: [],\n\tsettings: {\n\t\thasHeaders: true,\n\t\tconstrainDragToContainer: true,\n\t\treorderEnabled: true,\n\t\tselectionEnabled: false,\n\t\tpopoutWholeStack: false,\n\t\tblockedPopoutsThrowError: true,\n\t\tclosePopoutsOnUnload: true,\n\t\tshowPopoutIcon: true,\n\t\tshowMaximiseIcon: true,\n\t\tshowCloseIcon: true,\n\t\tresponsiveMode: 'onload', // Can be onload, always, or none.\n\t\ttabOverlapAllowance: 0, // maximum pixel overlap per tab\n\t\treorderOnTabMenuClick: true,\n\t\ttabControlOffset: 10\n\t},\n\tdimensions: {\n\t\tborderWidth: 5,\n\t\tborderGrabWidth: 15,\n\t\tminItemHeight: 10,\n\t\tminItemWidth: 10,\n\t\theaderHeight: 20,\n\t\tdragProxyWidth: 300,\n\t\tdragProxyHeight: 200\n\t},\n\tlabels: {\n\t\tclose: 'close',\n\t\tmaximise: 'maximise',\n\t\tminimise: 'minimise',\n\t\tpopout: 'open in new window',\n\t\tpopin: 'pop in',\n\t\ttabDropdown: 'additional tabs'\n\t}\n};\n\nlm.container.ItemContainer = function( config, parent, layoutManager ) {\n\tlm.utils.EventEmitter.call( this );\n\n\tthis.width = null;\n\tthis.height = null;\n\tthis.title = config.componentName;\n\tthis.parent = parent;\n\tthis.layoutManager = layoutManager;\n\tthis.isHidden = false;\n\n\tthis._config = config;\n\tthis._element = $( [\n\t\t'
              ',\n\t\t'
              ',\n\t\t'
              '\n\t].join( '' ) );\n\n\tthis._contentElement = this._element.find( '.lm_content' );\n};\n\nlm.utils.copy( lm.container.ItemContainer.prototype, {\n\n\t/**\n\t * Get the inner DOM element the container's content\n\t * is intended to live in\n\t *\n\t * @returns {DOM element}\n\t */\n\tgetElement: function() {\n\t\treturn this._contentElement;\n\t},\n\n\t/**\n\t * Hide the container. Notifies the containers content first\n\t * and then hides the DOM node. If the container is already hidden\n\t * this should have no effect\n\t *\n\t * @returns {void}\n\t */\n\thide: function() {\n\t\tthis.emit( 'hide' );\n\t\tthis.isHidden = true;\n\t\tthis._element.hide();\n\t},\n\n\t/**\n\t * Shows a previously hidden container. Notifies the\n\t * containers content first and then shows the DOM element.\n\t * If the container is already visible this has no effect.\n\t *\n\t * @returns {void}\n\t */\n\tshow: function() {\n\t\tthis.emit( 'show' );\n\t\tthis.isHidden = false;\n\t\tthis._element.show();\n\t\t// call shown only if the container has a valid size\n\t\tif( this.height != 0 || this.width != 0 ) {\n\t\t\tthis.emit( 'shown' );\n\t\t}\n\t},\n\n\t/**\n\t * Set the size from within the container. Traverses up\n\t * the item tree until it finds a row or column element\n\t * and resizes its items accordingly.\n\t *\n\t * If this container isn't a descendant of a row or column\n\t * it returns false\n\t * @todo Rework!!!\n\t * @param {Number} width The new width in pixel\n\t * @param {Number} height The new height in pixel\n\t *\n\t * @returns {Boolean} resizeSuccesful\n\t */\n\tsetSize: function( width, height ) {\n\t\tvar rowOrColumn = this.parent,\n\t\t\trowOrColumnChild = this,\n\t\t\ttotalPixel,\n\t\t\tpercentage,\n\t\t\tdirection,\n\t\t\tnewSize,\n\t\t\tdelta,\n\t\t\ti;\n\n\t\twhile( !rowOrColumn.isColumn && !rowOrColumn.isRow ) {\n\t\t\trowOrColumnChild = rowOrColumn;\n\t\t\trowOrColumn = rowOrColumn.parent;\n\n\n\t\t\t/**\n\t\t\t * No row or column has been found\n\t\t\t */\n\t\t\tif( rowOrColumn.isRoot ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tdirection = rowOrColumn.isColumn ? \"height\" : \"width\";\n\t\tnewSize = direction === \"height\" ? height : width;\n\n\t\ttotalPixel = this[ direction ] * ( 1 / ( rowOrColumnChild.config[ direction ] / 100 ) );\n\t\tpercentage = ( newSize / totalPixel ) * 100;\n\t\tdelta = ( rowOrColumnChild.config[ direction ] - percentage ) / (rowOrColumn.contentItems.length - 1);\n\n\t\tfor( i = 0; i < rowOrColumn.contentItems.length; i++ ) {\n\t\t\tif( rowOrColumn.contentItems[ i ] === rowOrColumnChild ) {\n\t\t\t\trowOrColumn.contentItems[ i ].config[ direction ] = percentage;\n\t\t\t} else {\n\t\t\t\trowOrColumn.contentItems[ i ].config[ direction ] += delta;\n\t\t\t}\n\t\t}\n\n\t\trowOrColumn.callDownwards( 'setSize' );\n\n\t\treturn true;\n\t},\n\n\t/**\n\t * Closes the container if it is closable. Can be called by\n\t * both the component within at as well as the contentItem containing\n\t * it. Emits a close event before the container itself is closed.\n\t *\n\t * @returns {void}\n\t */\n\tclose: function() {\n\t\tif( this._config.isClosable ) {\n\t\t\tthis.emit( 'close' );\n\t\t\tthis.parent.close();\n\t\t}\n\t},\n\n\t/**\n\t * Returns the current state object\n\t *\n\t * @returns {Object} state\n\t */\n\tgetState: function() {\n\t\treturn this._config.componentState;\n\t},\n\n\t/**\n\t * Merges the provided state into the current one\n\t *\n\t * @param {Object} state\n\t *\n\t * @returns {void}\n\t */\n\textendState: function( state ) {\n\t\tthis.setState( $.extend( true, this.getState(), state ) );\n\t},\n\n\t/**\n\t * Notifies the layout manager of a stateupdate\n\t *\n\t * @param {serialisable} state\n\t */\n\tsetState: function( state ) {\n\t\tthis._config.componentState = state;\n\t\tthis.parent.emitBubblingEvent( 'stateChanged' );\n\t},\n\n\t/**\n\t * Set's the components title\n\t *\n\t * @param {String} title\n\t */\n\tsetTitle: function( title ) {\n\t\tthis.parent.setTitle( title );\n\t},\n\n\t/**\n\t * Set's the containers size. Called by the container's component.\n\t * To set the size programmatically from within the container please\n\t * use the public setSize method\n\t *\n\t * @param {[Int]} width in px\n\t * @param {[Int]} height in px\n\t *\n\t * @returns {void}\n\t */\n\t_$setSize: function( width, height ) {\n\t\tif( width !== this.width || height !== this.height ) {\n\t\t\tthis.width = width;\n\t\t\tthis.height = height;\n\t\t\tvar cl = this._contentElement[0];\n\t\t\tvar hdelta = cl.offsetWidth - cl.clientWidth;\n\t\t\tvar vdelta = cl.offsetHeight - cl.clientHeight;\n\t\t\tthis._contentElement.width( this.width-hdelta )\n\t\t\t .height( this.height-vdelta );\n\t\t\tthis.emit( 'resize' );\n\t\t}\n\t}\n} );\n\n/**\n * Pops a content item out into a new browser window.\n * This is achieved by\n *\n * - Creating a new configuration with the content item as root element\n * - Serializing and minifying the configuration\n * - Opening the current window's URL with the configuration as a GET parameter\n * - GoldenLayout when opened in the new window will look for the GET parameter\n * and use it instead of the provided configuration\n *\n * @param {Object} config GoldenLayout item config\n * @param {Object} dimensions A map with width, height, top and left\n * @param {String} parentId The id of the element the item will be appended to on popIn\n * @param {Number} indexInParent The position of this element within its parent\n * @param {lm.LayoutManager} layoutManager\n */\nlm.controls.BrowserPopout = function( config, dimensions, parentId, indexInParent, layoutManager ) {\n\tlm.utils.EventEmitter.call( this );\n\tthis.isInitialised = false;\n\n\tthis._config = config;\n\tthis._dimensions = dimensions;\n\tthis._parentId = parentId;\n\tthis._indexInParent = indexInParent;\n\tthis._layoutManager = layoutManager;\n\tthis._popoutWindow = null;\n\tthis._id = null;\n\tthis._createWindow();\n};\n\nlm.utils.copy( lm.controls.BrowserPopout.prototype, {\n\n\ttoConfig: function() {\n\t\tif( this.isInitialised === false ) {\n\t\t\tthrow new Error( 'Can\\'t create config, layout not yet initialised' );\n\t\t\treturn;\n\t\t}\n\t\treturn {\n\t\t\tdimensions: {\n\t\t\t\twidth: this.getGlInstance().width,\n\t\t\t\theight: this.getGlInstance().height,\n\t\t\t\tleft: this._popoutWindow.screenX || this._popoutWindow.screenLeft,\n\t\t\t\ttop: this._popoutWindow.screenY || this._popoutWindow.screenTop\n\t\t\t},\n\t\t\tcontent: this.getGlInstance().toConfig().content,\n\t\t\tparentId: this._parentId,\n\t\t\tindexInParent: this._indexInParent\n\t\t};\n\t},\n\n\tgetGlInstance: function() {\n\t\treturn this._popoutWindow.__glInstance;\n\t},\n\n\tgetWindow: function() {\n\t\treturn this._popoutWindow;\n\t},\n\n\tclose: function() {\n\t\tif( this.getGlInstance() ) {\n\t\t\tthis.getGlInstance()._$closeWindow();\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tthis.getWindow().close();\n\t\t\t} catch( e ) {\n\t\t\t}\n\t\t}\n\t},\n\n\t/**\n\t * Returns the popped out item to its original position. If the original\n\t * parent isn't available anymore it falls back to the layout's topmost element\n\t */\n\tpopIn: function() {\n\t\tvar childConfig,\n\t\t\tparentItem,\n\t\t\tindex = this._indexInParent;\n\n\t\tif( this._parentId ) {\n\n\t\t\t/*\n\t\t\t * The $.extend call seems a bit pointless, but it's crucial to\n\t\t\t * copy the config returned by this.getGlInstance().toConfig()\n\t\t\t * onto a new object. Internet Explorer keeps the references\n\t\t\t * to objects on the child window, resulting in the following error\n\t\t\t * once the child window is closed:\n\t\t\t *\n\t\t\t * The callee (server [not server application]) is not available and disappeared\n\t\t\t */\n\t\t\tchildConfig = $.extend( true, {}, this.getGlInstance().toConfig() ).content[ 0 ];\n\t\t\tparentItem = this._layoutManager.root.getItemsById( this._parentId )[ 0 ];\n\n\t\t\t/*\n\t\t\t * Fallback if parentItem is not available. Either add it to the topmost\n\t\t\t * item or make it the topmost item if the layout is empty\n\t\t\t */\n\t\t\tif( !parentItem ) {\n\t\t\t\tif( this._layoutManager.root.contentItems.length > 0 ) {\n\t\t\t\t\tparentItem = this._layoutManager.root.contentItems[ 0 ];\n\t\t\t\t} else {\n\t\t\t\t\tparentItem = this._layoutManager.root;\n\t\t\t\t}\n\t\t\t\tindex = 0;\n\t\t\t}\n\t\t}\n\n\t\tparentItem.addChild( childConfig, this._indexInParent );\n\t\tthis.close();\n\t},\n\n\t/**\n\t * Creates the URL and window parameter\n\t * and opens a new window\n\t *\n\t * @private\n\t *\n\t * @returns {void}\n\t */\n\t_createWindow: function() {\n\t\tvar checkReadyInterval,\n\t\t\turl = this._createUrl(),\n\n\t\t\t/**\n\t\t\t * Bogus title to prevent re-usage of existing window with the\n\t\t\t * same title. The actual title will be set by the new window's\n\t\t\t * GoldenLayout instance if it detects that it is in subWindowMode\n\t\t\t */\n\t\t\ttitle = Math.floor( Math.random() * 1000000 ).toString( 36 ),\n\n\t\t\t/**\n\t\t\t * The options as used in the window.open string\n\t\t\t */\n\t\t\toptions = this._serializeWindowOptions( {\n\t\t\t\twidth: this._dimensions.width,\n\t\t\t\theight: this._dimensions.height,\n\t\t\t\tinnerWidth: this._dimensions.width,\n\t\t\t\tinnerHeight: this._dimensions.height,\n\t\t\t\tmenubar: 'no',\n\t\t\t\ttoolbar: 'no',\n\t\t\t\tlocation: 'no',\n\t\t\t\tpersonalbar: 'no',\n\t\t\t\tresizable: 'yes',\n\t\t\t\tscrollbars: 'no',\n\t\t\t\tstatus: 'no'\n\t\t\t} );\n\n\t\tthis._popoutWindow = window.open( url, title, options );\n\n\t\tif( !this._popoutWindow ) {\n\t\t\tif( this._layoutManager.config.settings.blockedPopoutsThrowError === true ) {\n\t\t\t\tvar error = new Error( 'Popout blocked' );\n\t\t\t\terror.type = 'popoutBlocked';\n\t\t\t\tthrow error;\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t$( this._popoutWindow )\n\t\t\t.on( 'load', lm.utils.fnBind( this._positionWindow, this ) )\n\t\t\t.on( 'unload beforeunload', lm.utils.fnBind( this._onClose, this ) );\n\n\t\t/**\n\t\t * Polling the childwindow to find out if GoldenLayout has been initialised\n\t\t * doesn't seem optimal, but the alternatives - adding a callback to the parent\n\t\t * window or raising an event on the window object - both would introduce knowledge\n\t\t * about the parent to the child window which we'd rather avoid\n\t\t */\n\t\tcheckReadyInterval = setInterval( lm.utils.fnBind( function() {\n\t\t\tif( this._popoutWindow.__glInstance && this._popoutWindow.__glInstance.isInitialised ) {\n\t\t\t\tthis._onInitialised();\n\t\t\t\tclearInterval( checkReadyInterval );\n\t\t\t}\n\t\t}, this ), 10 );\n\t},\n\n\t/**\n\t * Serialises a map of key:values to a window options string\n\t *\n\t * @param {Object} windowOptions\n\t *\n\t * @returns {String} serialised window options\n\t */\n\t_serializeWindowOptions: function( windowOptions ) {\n\t\tvar windowOptionsString = [], key;\n\n\t\tfor( key in windowOptions ) {\n\t\t\twindowOptionsString.push( key + '=' + windowOptions[ key ] );\n\t\t}\n\n\t\treturn windowOptionsString.join( ',' );\n\t},\n\n\t/**\n\t * Creates the URL for the new window, including the\n\t * config GET parameter\n\t *\n\t * @returns {String} URL\n\t */\n\t_createUrl: function() {\n\t\tvar config = { content: this._config },\n\t\t\tstorageKey = 'gl-window-config-' + lm.utils.getUniqueId(),\n\t\t\turlParts;\n\n\t\tconfig = ( new lm.utils.ConfigMinifier() ).minifyConfig( config );\n\n\t\ttry {\n\t\t\tlocalStorage.setItem( storageKey, JSON.stringify( config ) );\n\t\t} catch( e ) {\n\t\t\tthrow new Error( 'Error while writing to localStorage ' + e.toString() );\n\t\t}\n\n\t\turlParts = document.location.href.split( '?' );\n\n\t\t// URL doesn't contain GET-parameters\n\t\tif( urlParts.length === 1 ) {\n\t\t\treturn urlParts[ 0 ] + '?gl-window=' + storageKey;\n\n\t\t\t// URL contains GET-parameters\n\t\t} else {\n\t\t\treturn document.location.href + '&gl-window=' + storageKey;\n\t\t}\n\t},\n\n\t/**\n\t * Move the newly created window roughly to\n\t * where the component used to be.\n\t *\n\t * @private\n\t *\n\t * @returns {void}\n\t */\n\t_positionWindow: function() {\n\t\tthis._popoutWindow.moveTo( this._dimensions.left, this._dimensions.top );\n\t\tthis._popoutWindow.focus();\n\t},\n\n\t/**\n\t * Callback when the new window is opened and the GoldenLayout instance\n\t * within it is initialised\n\t *\n\t * @returns {void}\n\t */\n\t_onInitialised: function() {\n\t\tthis.isInitialised = true;\n\t\tthis.getGlInstance().on( 'popIn', this.popIn, this );\n\t\tthis.emit( 'initialised' );\n\t},\n\n\t/**\n\t * Invoked 50ms after the window unload event\n\t *\n\t * @private\n\t *\n\t * @returns {void}\n\t */\n\t_onClose: function() {\n\t\tsetTimeout( lm.utils.fnBind( this.emit, this, [ 'closed' ] ), 50 );\n\t}\n} );\n/**\n * This class creates a temporary container\n * for the component whilst it is being dragged\n * and handles drag events\n *\n * @constructor\n * @private\n *\n * @param {Number} x The initial x position\n * @param {Number} y The initial y position\n * @param {lm.utils.DragListener} dragListener\n * @param {lm.LayoutManager} layoutManager\n * @param {lm.item.AbstractContentItem} contentItem\n * @param {lm.item.AbstractContentItem} originalParent\n */\nlm.controls.DragProxy = function( x, y, dragListener, layoutManager, contentItem, originalParent ) {\n\n\tlm.utils.EventEmitter.call( this );\n\n\tthis._dragListener = dragListener;\n\tthis._layoutManager = layoutManager;\n\tthis._contentItem = contentItem;\n\tthis._originalParent = originalParent;\n\n\tthis._area = null;\n\tthis._lastValidArea = null;\n\n\tthis._dragListener.on( 'drag', this._onDrag, this );\n\tthis._dragListener.on( 'dragStop', this._onDrop, this );\n\n\tthis.element = $( lm.controls.DragProxy._template );\n\tif( originalParent && originalParent._side ) {\n\t\tthis._sided = originalParent._sided;\n\t\tthis.element.addClass( 'lm_' + originalParent._side );\n\t\tif( [ 'right', 'bottom' ].indexOf( originalParent._side ) >= 0 )\n\t\t\tthis.element.find( '.lm_content' ).after( this.element.find( '.lm_header' ) );\n\t}\n\tthis.element.css( { left: x, top: y } );\n\tthis.element.find( '.lm_tab' ).attr( 'title', lm.utils.stripTags( this._contentItem.config.title ) );\n\tthis.element.find( '.lm_title' ).html( this._contentItem.config.title );\n\tthis.childElementContainer = this.element.find( '.lm_content' );\n\tthis.childElementContainer.append( contentItem.element );\n\n\tthis._updateTree();\n\tthis._layoutManager._$calculateItemAreas();\n\tthis._setDimensions();\n\n\t$( document.body ).append( this.element );\n\n\tvar offset = this._layoutManager.container.offset();\n\n\tthis._minX = offset.left;\n\tthis._minY = offset.top;\n\tthis._maxX = this._layoutManager.container.width() + this._minX;\n\tthis._maxY = this._layoutManager.container.height() + this._minY;\n\tthis._width = this.element.width();\n\tthis._height = this.element.height();\n\n\tthis._setDropPosition( x, y );\n};\n\nlm.controls.DragProxy._template = '
              ' +\n\t'
              ' +\n\t'
                ' +\n\t'
              • ' +\n\t'' +\n\t'
              • ' +\n\t'
              ' +\n\t'
              ' +\n\t'
              ' +\n\t'
              ';\n\nlm.utils.copy( lm.controls.DragProxy.prototype, {\n\n\t/**\n\t * Callback on every mouseMove event during a drag. Determines if the drag is\n\t * still within the valid drag area and calls the layoutManager to highlight the\n\t * current drop area\n\t *\n\t * @param {Number} offsetX The difference from the original x position in px\n\t * @param {Number} offsetY The difference from the original y position in px\n\t * @param {jQuery DOM event} event\n\t *\n\t * @private\n\t *\n\t * @returns {void}\n\t */\n\t_onDrag: function( offsetX, offsetY, event ) {\n\n\t\tevent = event.originalEvent && event.originalEvent.touches ? event.originalEvent.touches[ 0 ] : event;\n\n\t\tvar x = event.pageX,\n\t\t\ty = event.pageY,\n\t\t\tisWithinContainer = x > this._minX && x < this._maxX && y > this._minY && y < this._maxY;\n\n\t\tif( !isWithinContainer && this._layoutManager.config.settings.constrainDragToContainer === true ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._setDropPosition( x, y );\n\t},\n\n\t/**\n\t * Sets the target position, highlighting the appropriate area\n\t *\n\t * @param {Number} x The x position in px\n\t * @param {Number} y The y position in px\n\t *\n\t * @private\n\t *\n\t * @returns {void}\n\t */\n\t_setDropPosition: function( x, y ) {\n\t\tthis.element.css( { left: x, top: y } );\n\t\tthis._area = this._layoutManager._$getArea( x, y );\n\n\t\tif( this._area !== null ) {\n\t\t\tthis._lastValidArea = this._area;\n\t\t\tthis._area.contentItem._$highlightDropZone( x, y, this._area );\n\t\t}\n\t},\n\n\t/**\n\t * Callback when the drag has finished. Determines the drop area\n\t * and adds the child to it\n\t *\n\t * @private\n\t *\n\t * @returns {void}\n\t */\n\t_onDrop: function() {\n\t\tthis._layoutManager.dropTargetIndicator.hide();\n\n\t\t/*\n\t\t * Valid drop area found\n\t\t */\n\t\tif( this._area !== null ) {\n\t\t\tthis._area.contentItem._$onDrop( this._contentItem, this._area );\n\n\t\t\t/**\n\t\t\t * No valid drop area available at present, but one has been found before.\n\t\t\t * Use it\n\t\t\t */\n\t\t} else if( this._lastValidArea !== null ) {\n\t\t\tthis._lastValidArea.contentItem._$onDrop( this._contentItem, this._lastValidArea );\n\n\t\t\t/**\n\t\t\t * No valid drop area found during the duration of the drag. Return\n\t\t\t * content item to its original position if a original parent is provided.\n\t\t\t * (Which is not the case if the drag had been initiated by createDragSource)\n\t\t\t */\n\t\t} else if( this._originalParent ) {\n\t\t\tthis._originalParent.addChild( this._contentItem );\n\n\t\t\t/**\n\t\t\t * The drag didn't ultimately end up with adding the content item to\n\t\t\t * any container. In order to ensure clean up happens, destroy the\n\t\t\t * content item.\n\t\t\t */\n\t\t} else {\n\t\t\tthis._contentItem._$destroy();\n\t\t}\n\n\t\tthis.element.remove();\n\n\t\tthis._layoutManager.emit( 'itemDropped', this._contentItem );\n\t},\n\n\t/**\n\t * Removes the item from its original position within the tree\n\t *\n\t * @private\n\t *\n\t * @returns {void}\n\t */\n\t_updateTree: function() {\n\n\t\t/**\n\t\t * parent is null if the drag had been initiated by a external drag source\n\t\t */\n\t\tif( this._contentItem.parent ) {\n\t\t\tthis._contentItem.parent.removeChild( this._contentItem, true );\n\t\t}\n\n\t\tthis._contentItem._$setParent( this );\n\t},\n\n\t/**\n\t * Updates the Drag Proxie's dimensions\n\t *\n\t * @private\n\t *\n\t * @returns {void}\n\t */\n\t_setDimensions: function() {\n\t\tvar dimensions = this._layoutManager.config.dimensions,\n\t\t\twidth = dimensions.dragProxyWidth,\n\t\t\theight = dimensions.dragProxyHeight;\n\n\t\tthis.element.width( width );\n\t\tthis.element.height( height );\n\t\twidth -= ( this._sided ? dimensions.headerHeight : 0 );\n\t\theight -= ( !this._sided ? dimensions.headerHeight : 0 );\n\t\tthis.childElementContainer.width( width );\n\t\tthis.childElementContainer.height( height );\n\t\tthis._contentItem.element.width( width );\n\t\tthis._contentItem.element.height( height );\n\t\tthis._contentItem.callDownwards( '_$show' );\n\t\tthis._contentItem.callDownwards( 'setSize' );\n\t}\n} );\n\n/**\n * Allows for any DOM item to create a component on drag\n * start tobe dragged into the Layout\n *\n * @param {jQuery element} element\n * @param {Object} itemConfig the configuration for the contentItem that will be created\n * @param {LayoutManager} layoutManager\n *\n * @constructor\n */\nlm.controls.DragSource = function( element, itemConfig, layoutManager ) {\n\tthis._element = element;\n\tthis._itemConfig = itemConfig;\n\tthis._layoutManager = layoutManager;\n\tthis._dragListener = null;\n\n\tthis._createDragListener();\n};\n\nlm.utils.copy( lm.controls.DragSource.prototype, {\n\n\t/**\n\t * Called initially and after every drag\n\t *\n\t * @returns {void}\n\t */\n\t_createDragListener: function() {\n\t\tif( this._dragListener !== null ) {\n\t\t\tthis._dragListener.destroy();\n\t\t}\n\n\t\tthis._dragListener = new lm.utils.DragListener( this._element );\n\t\tthis._dragListener.on( 'dragStart', this._onDragStart, this );\n\t\tthis._dragListener.on( 'dragStop', this._createDragListener, this );\n\t},\n\n\t/**\n\t * Callback for the DragListener's dragStart event\n\t *\n\t * @param {int} x the x position of the mouse on dragStart\n\t * @param {int} y the x position of the mouse on dragStart\n\t *\n\t * @returns {void}\n\t */\n\t_onDragStart: function( x, y ) {\n\t\tvar itemConfig = this._itemConfig;\n\t\tif( lm.utils.isFunction( itemConfig ) ) {\n\t\t\titemConfig = itemConfig();\n\t\t}\n\t\tvar contentItem = this._layoutManager._$normalizeContentItem( $.extend( true, {}, itemConfig ) ),\n\t\t\tdragProxy = new lm.controls.DragProxy( x, y, this._dragListener, this._layoutManager, contentItem, null );\n\n\t\tthis._layoutManager.transitionIndicator.transitionElements( this._element, dragProxy.element );\n\t}\n} );\n\nlm.controls.DropTargetIndicator = function() {\n\tthis.element = $( lm.controls.DropTargetIndicator._template );\n\t$( document.body ).append( this.element );\n};\n\nlm.controls.DropTargetIndicator._template = '
              ';\n\nlm.utils.copy( lm.controls.DropTargetIndicator.prototype, {\n\tdestroy: function() {\n\t\tthis.element.remove();\n\t},\n\n\thighlight: function( x1, y1, x2, y2 ) {\n\t\tthis.highlightArea( { x1: x1, y1: y1, x2: x2, y2: y2 } );\n\t},\n\n\thighlightArea: function( area ) {\n\t\tthis.element.css( {\n\t\t\tleft: area.x1,\n\t\t\ttop: area.y1,\n\t\t\twidth: area.x2 - area.x1,\n\t\t\theight: area.y2 - area.y1\n\t\t} ).show();\n\t},\n\n\thide: function() {\n\t\tthis.element.hide();\n\t}\n} );\n/**\n * This class represents a header above a Stack ContentItem.\n *\n * @param {lm.LayoutManager} layoutManager\n * @param {lm.item.AbstractContentItem} parent\n */\nlm.controls.Header = function( layoutManager, parent ) {\n\tlm.utils.EventEmitter.call( this );\n\n\tthis.layoutManager = layoutManager;\n\tthis.element = $( lm.controls.Header._template );\n\n\tif( this.layoutManager.config.settings.selectionEnabled === true ) {\n\t\tthis.element.addClass( 'lm_selectable' );\n\t\tthis.element.on( 'click touchstart', lm.utils.fnBind( this._onHeaderClick, this ) );\n\t}\n\n\tthis.tabsContainer = this.element.find( '.lm_tabs' );\n\tthis.tabDropdownContainer = this.element.find( '.lm_tabdropdown_list' );\n\tthis.tabDropdownContainer.hide();\n\tthis.controlsContainer = this.element.find( '.lm_controls' );\n\tthis.parent = parent;\n\tthis.parent.on( 'resize', this._updateTabSizes, this );\n\tthis.tabs = [];\n\tthis.activeContentItem = null;\n\tthis.closeButton = null;\n\tthis.tabDropdownButton = null;\n\tthis.hideAdditionalTabsDropdown = lm.utils.fnBind(this._hideAdditionalTabsDropdown, this);\n\t$( document ).mouseup(this.hideAdditionalTabsDropdown);\n\n\tthis._lastVisibleTabIndex = -1;\n\tthis._tabControlOffset = this.layoutManager.config.settings.tabControlOffset;\n\tthis._createControls();\n};\n\nlm.controls.Header._template = [\n\t'
              ',\n\t'
                ',\n\t'
                  ',\n\t'
                    ',\n\t'
                    '\n].join( '' );\n\nlm.utils.copy( lm.controls.Header.prototype, {\n\n\t/**\n\t * Creates a new tab and associates it with a contentItem\n\t *\n\t * @param {lm.item.AbstractContentItem} contentItem\n\t * @param {Integer} index The position of the tab\n\t *\n\t * @returns {void}\n\t */\n\tcreateTab: function( contentItem, index ) {\n\t\tvar tab, i;\n\n\t\t//If there's already a tab relating to the\n\t\t//content item, don't do anything\n\t\tfor( i = 0; i < this.tabs.length; i++ ) {\n\t\t\tif( this.tabs[ i ].contentItem === contentItem ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\ttab = new lm.controls.Tab( this, contentItem );\n\n\t\tif( this.tabs.length === 0 ) {\n\t\t\tthis.tabs.push( tab );\n\t\t\tthis.tabsContainer.append( tab.element );\n\t\t\treturn;\n\t\t}\n\n\t\tif( index === undefined ) {\n\t\t\tindex = this.tabs.length;\n\t\t}\n\n\t\tif( index > 0 ) {\n\t\t\tthis.tabs[ index - 1 ].element.after( tab.element );\n\t\t} else {\n\t\t\tthis.tabs[ 0 ].element.before( tab.element );\n\t\t}\n\n\t\tthis.tabs.splice( index, 0, tab );\n\t\tthis._updateTabSizes();\n\t},\n\n\t/**\n\t * Finds a tab based on the contentItem its associated with and removes it.\n\t *\n\t * @param {lm.item.AbstractContentItem} contentItem\n\t *\n\t * @returns {void}\n\t */\n\tremoveTab: function( contentItem ) {\n\t\tfor( var i = 0; i < this.tabs.length; i++ ) {\n\t\t\tif( this.tabs[ i ].contentItem === contentItem ) {\n\t\t\t\tthis.tabs[ i ]._$destroy();\n\t\t\t\tthis.tabs.splice( i, 1 );\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tthrow new Error( 'contentItem is not controlled by this header' );\n\t},\n\n\t/**\n\t * The programmatical equivalent of clicking a Tab.\n\t *\n\t * @param {lm.item.AbstractContentItem} contentItem\n\t */\n\tsetActiveContentItem: function( contentItem ) {\n\t\tvar i, j, isActive, activeTab;\n\n\t\tfor( i = 0; i < this.tabs.length; i++ ) {\n\t\t\tisActive = this.tabs[ i ].contentItem === contentItem;\n\t\t\tthis.tabs[ i ].setActive( isActive );\n\t\t\tif( isActive === true ) {\n\t\t\t\tthis.activeContentItem = contentItem;\n\t\t\t\tthis.parent.config.activeItemIndex = i;\n\t\t\t}\n\t\t}\n\n\t\tif (this.layoutManager.config.settings.reorderOnTabMenuClick) {\n\t\t\t/**\n\t\t\t * If the tab selected was in the dropdown, move everything down one to make way for this one to be the first.\n\t\t\t * This will make sure the most used tabs stay visible.\n\t\t\t */\n\t\t\tif (this._lastVisibleTabIndex !== -1 && this.parent.config.activeItemIndex > this._lastVisibleTabIndex) {\n\t\t\t\tactiveTab = this.tabs[this.parent.config.activeItemIndex];\n\t\t\t\tfor ( j = this.parent.config.activeItemIndex; j > 0; j-- ) {\n\t\t\t\t\tthis.tabs[j] = this.tabs[j - 1];\n\t\t\t\t}\n\t\t\t\tthis.tabs[0] = activeTab;\n\t\t\t\tthis.parent.config.activeItemIndex = 0;\n\t\t\t}\n\t\t}\n\n\t\tthis._updateTabSizes();\n\t\tthis.parent.emitBubblingEvent( 'stateChanged' );\n\t},\n\n\t/**\n\t * Programmatically operate with header position.\n\t *\n\t * @param {string} position one of ('top','left','right','bottom') to set or empty to get it.\n\t *\n\t * @returns {string} previous header position\n\t */\n\tposition: function( position ) {\n\t\tvar previous = this.parent._header.show;\n\t\tif( previous && !this.parent._side )\n\t\t\tprevious = 'top';\n\t\tif( position !== undefined && this.parent._header.show != position ) {\n\t\t\tthis.parent._header.show = position;\n\t\t\tthis.parent._setupHeaderPosition();\n\t\t}\n\t\treturn previous;\n\t},\n\n\t/**\n\t * Programmatically set closability.\n\t *\n\t * @package private\n\t * @param {Boolean} isClosable Whether to enable/disable closability.\n\t *\n\t * @returns {Boolean} Whether the action was successful\n\t */\n\t_$setClosable: function( isClosable ) {\n\t\tif( this.closeButton && this._isClosable() ) {\n\t\t\tthis.closeButton.element[ isClosable ? \"show\" : \"hide\" ]();\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t},\n\n\t/**\n\t * Destroys the entire header\n\t *\n\t * @package private\n\t *\n\t * @returns {void}\n\t */\n\t_$destroy: function() {\n\t\tthis.emit( 'destroy', this );\n\n\t\tfor( var i = 0; i < this.tabs.length; i++ ) {\n\t\t\tthis.tabs[ i ]._$destroy();\n\t\t}\n\t\t$( document ).off('mouseup', this.hideAdditionalTabsDropdown);\n\t\tthis.element.remove();\n\t},\n\n\t/**\n\t * get settings from header\n\t *\n\t * @returns {string} when exists\n\t */\n\t_getHeaderSetting: function( name ) {\n\t\tif( name in this.parent._header )\n\t\t\treturn this.parent._header[ name ];\n\t},\n\t/**\n\t * Creates the popout, maximise and close buttons in the header's top right corner\n\t *\n\t * @returns {void}\n\t */\n\t_createControls: function() {\n\t\tvar closeStack,\n\t\t\tpopout,\n\t\t\tlabel,\n\t\t\tmaximiseLabel,\n\t\t\tminimiseLabel,\n\t\t\tmaximise,\n\t\t\tmaximiseButton,\n\t\t\ttabDropdownLabel,\n\t\t\tshowTabDropdown;\n\n\t\t/**\n\t\t * Dropdown to show additional tabs.\n\t\t */\n\t\tshowTabDropdown = lm.utils.fnBind( this._showAdditionalTabsDropdown, this );\n\t\ttabDropdownLabel = this.layoutManager.config.labels.tabDropdown;\n\t\tthis.tabDropdownButton = new lm.controls.HeaderButton( this, tabDropdownLabel, 'lm_tabdropdown', showTabDropdown );\n\t\tthis.tabDropdownButton.element.hide();\n\n\t\t/**\n\t\t * Popout control to launch component in new window.\n\t\t */\n\t\tif( this._getHeaderSetting( 'popout' ) ) {\n\t\t\tpopout = lm.utils.fnBind( this._onPopoutClick, this );\n\t\t\tlabel = this._getHeaderSetting( 'popout' );\n\t\t\tnew lm.controls.HeaderButton( this, label, 'lm_popout', popout );\n\t\t}\n\n\t\t/**\n\t\t * Maximise control - set the component to the full size of the layout\n\t\t */\n\t\tif( this._getHeaderSetting( 'maximise' ) ) {\n\t\t\tmaximise = lm.utils.fnBind( this.parent.toggleMaximise, this.parent );\n\t\t\tmaximiseLabel = this._getHeaderSetting( 'maximise' );\n\t\t\tminimiseLabel = this._getHeaderSetting( 'minimise' );\n\t\t\tmaximiseButton = new lm.controls.HeaderButton( this, maximiseLabel, 'lm_maximise', maximise );\n\n\t\t\tthis.parent.on( 'maximised', function() {\n\t\t\t\tmaximiseButton.element.attr( 'title', minimiseLabel );\n\t\t\t} );\n\n\t\t\tthis.parent.on( 'minimised', function() {\n\t\t\t\tmaximiseButton.element.attr( 'title', maximiseLabel );\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Close button\n\t\t */\n\t\tif( this._isClosable() ) {\n\t\t\tcloseStack = lm.utils.fnBind( this.parent.remove, this.parent );\n\t\t\tlabel = this._getHeaderSetting( 'close' );\n\t\t\tthis.closeButton = new lm.controls.HeaderButton( this, label, 'lm_close', closeStack );\n\t\t}\n\t},\n\n\t/**\n\t * Shows drop down for additional tabs when there are too many to display.\n\t *\n\t * @returns {void}\n\t */\n\t_showAdditionalTabsDropdown: function() {\n\t\tthis.tabDropdownContainer.show();\n\t},\n\n\t/**\n\t * Hides drop down for additional tabs when there are too many to display.\n\t *\n\t * @returns {void}\n\t */\n\t_hideAdditionalTabsDropdown: function( e ) {\n\t\tthis.tabDropdownContainer.hide();\n\t},\n\n\t/**\n\t * Checks whether the header is closable based on the parent config and\n\t * the global config.\n\t *\n\t * @returns {Boolean} Whether the header is closable.\n\t */\n\t_isClosable: function() {\n\t\treturn this.parent.config.isClosable && this.layoutManager.config.settings.showCloseIcon;\n\t},\n\n\t_onPopoutClick: function() {\n\t\tif( this.layoutManager.config.settings.popoutWholeStack === true ) {\n\t\t\tthis.parent.popout();\n\t\t} else {\n\t\t\tthis.activeContentItem.popout();\n\t\t}\n\t},\n\n\n\t/**\n\t * Invoked when the header's background is clicked (not it's tabs or controls)\n\t *\n\t * @param {jQuery DOM event} event\n\t *\n\t * @returns {void}\n\t */\n\t_onHeaderClick: function( event ) {\n\t\tif( event.target === this.element[ 0 ] ) {\n\t\t\tthis.parent.select();\n\t\t}\n\t},\n\n\t/**\n\t * Pushes the tabs to the tab dropdown if the available space is not sufficient\n\t *\n\t * @returns {void}\n\t */\n\t_updateTabSizes: function(showTabMenu) {\n\t\tif( this.tabs.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t//Show the menu based on function argument\n\t\tthis.tabDropdownButton.element.toggle(showTabMenu === true);\n\n\t\tvar size = function( val ) {\n\t\t\treturn val ? 'width' : 'height';\n\t\t};\n\t\tthis.element.css( size( !this.parent._sided ), '' );\n\t\tthis.element[ size( this.parent._sided ) ]( this.layoutManager.config.dimensions.headerHeight );\n\t\tvar availableWidth = this.element.outerWidth() - this.controlsContainer.outerWidth() - this._tabControlOffset,\n\t\t\tcumulativeTabWidth = 0,\n\t\t\tvisibleTabWidth = 0,\n\t\t\ttabElement,\n\t\t\ti,\n\t\t\tj,\n\t\t\tmarginLeft,\n\t\t\toverlap = 0,\n\t\t\ttabWidth,\n\t\t\ttabOverlapAllowance = this.layoutManager.config.settings.tabOverlapAllowance,\n\t\t\ttabOverlapAllowanceExceeded = false,\n\t\t\tactiveIndex = (this.activeContentItem ? this.tabs.indexOf(this.activeContentItem.tab) : 0),\n\t\t\tactiveTab = this.tabs[activeIndex];\n\t\tif( this.parent._sided )\n\t\t\tavailableWidth = this.element.outerHeight() - this.controlsContainer.outerHeight() - this._tabControlOffset;\n\t\tthis._lastVisibleTabIndex = -1;\n\n\t\tfor( i = 0; i < this.tabs.length; i++ ) {\n\t\t\ttabElement = this.tabs[ i ].element;\n\n\t\t\t//Put the tab in the tabContainer so its true width can be checked\n\t\t\tthis.tabsContainer.append( tabElement );\n\t\t\ttabWidth = tabElement.outerWidth() + parseInt( tabElement.css( 'margin-right' ), 10 );\n\n\t\t\tcumulativeTabWidth += tabWidth;\n\n\t\t\t//Include the active tab's width if it isn't already\n\t\t\t//This is to ensure there is room to show the active tab\n\t\t\tif (activeIndex <= i) {\n\t\t\t\tvisibleTabWidth = cumulativeTabWidth;\n\t\t\t} else {\n\t\t\t\tvisibleTabWidth = cumulativeTabWidth + activeTab.element.outerWidth() + parseInt(activeTab.element.css('margin-right'), 10);\n\t\t\t}\n\n\t\t\t// If the tabs won't fit, check the overlap allowance.\n\t\t\tif( visibleTabWidth > availableWidth ) {\n\n\t\t\t\t//Once allowance is exceeded, all remaining tabs go to menu.\n\t\t\t\tif (!tabOverlapAllowanceExceeded) {\n\n\t\t\t\t\t//No overlap for first tab or active tab\n\t\t\t\t\t//Overlap spreads among non-active, non-first tabs\n\t\t\t\t\tif (activeIndex > 0 && activeIndex <= i) {\n\t\t\t\t\t\toverlap = ( visibleTabWidth - availableWidth ) / (i - 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\toverlap = ( visibleTabWidth - availableWidth ) / i;\n\t\t\t\t\t}\n\n\t\t\t\t\t//Check overlap against allowance.\n\t\t\t\t\tif (overlap < tabOverlapAllowance) {\n\t\t\t\t\t\tfor ( j = 0; j <= i; j++ ) {\n\t\t\t\t\t\t\tmarginLeft = (j !== activeIndex && j !== 0) ? '-' + overlap + 'px' : '';\n\t\t\t\t\t\t\tthis.tabs[j].element.css({'z-index': i - j, 'margin-left': marginLeft});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._lastVisibleTabIndex = i;\n\t\t\t\t\t\tthis.tabsContainer.append(tabElement);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttabOverlapAllowanceExceeded = true;\n\t\t\t\t\t}\n\n\t\t\t\t} else if (i === activeIndex) {\n\t\t\t\t\t//Active tab should show even if allowance exceeded. (We left room.)\n\t\t\t\t\ttabElement.css({'z-index': 'auto', 'margin-left': ''});\n\t\t\t\t\tthis.tabsContainer.append(tabElement);\n\t\t\t\t}\n\n\t\t\t\tif (tabOverlapAllowanceExceeded && i !== activeIndex) {\n\t\t\t\t\tif (showTabMenu) {\n\t\t\t\t\t\t//Tab menu already shown, so we just add to it.\n\t\t\t\t\t\ttabElement.css({'z-index': 'auto', 'margin-left': ''});\n\t\t\t\t\t\tthis.tabDropdownContainer.append(tabElement);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//We now know the tab menu must be shown, so we have to recalculate everything.\n\t\t\t\t\t\tthis._updateTabSizes(true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis._lastVisibleTabIndex = i;\n\t\t\t\ttabElement.css({'z-index': 'auto', 'margin-left': ''});\n\t\t\t\tthis.tabsContainer.append( tabElement );\n\t\t\t}\n\t\t}\n\n\t}\n} );\n\n\nlm.controls.HeaderButton = function( header, label, cssClass, action ) {\n\tthis._header = header;\n\tthis.element = $( '
                  • ' );\n\tthis._header.on( 'destroy', this._$destroy, this );\n\tthis._action = action;\n\tthis.element.on( 'click touchstart', this._action );\n\tthis._header.controlsContainer.append( this.element );\n};\n\nlm.utils.copy( lm.controls.HeaderButton.prototype, {\n\t_$destroy: function() {\n\t\tthis.element.off();\n\t\tthis.element.remove();\n\t}\n} );\nlm.controls.Splitter = function( isVertical, size, grabSize ) {\n\tthis._isVertical = isVertical;\n\tthis._size = size;\n\tthis._grabSize = grabSize < size ? size : grabSize;\n\n\tthis.element = this._createElement();\n\tthis._dragListener = new lm.utils.DragListener( this.element );\n};\n\nlm.utils.copy( lm.controls.Splitter.prototype, {\n\ton: function( event, callback, context ) {\n\t\tthis._dragListener.on( event, callback, context );\n\t},\n\n\t_$destroy: function() {\n\t\tthis.element.remove();\n\t},\n\n\t_createElement: function() {\n\t\tvar dragHandle = $( '
                    ' );\n\t\tvar element = $( '
                    ' );\n\t\telement.append(dragHandle);\n\n\t\tvar handleExcessSize = this._grabSize - this._size;\n\t\tvar handleExcessPos = handleExcessSize / 2;\n\n\t\tif( this._isVertical ) {\n\t\t\tdragHandle.css( 'top', -handleExcessPos );\n\t\t\tdragHandle.css( 'height', this._size + handleExcessSize );\n\t\t\telement.addClass( 'lm_vertical' );\n\t\t\telement[ 'height' ]( this._size );\n\t\t} else {\n\t\t\tdragHandle.css( 'left', -handleExcessPos );\n\t\t\tdragHandle.css( 'width', this._size + handleExcessSize );\n\t\t\telement.addClass( 'lm_horizontal' );\n\t\t\telement[ 'width' ]( this._size );\n\t\t}\n\n\t\treturn element;\n\t}\n} );\n\n/**\n * Represents an individual tab within a Stack's header\n *\n * @param {lm.controls.Header} header\n * @param {lm.items.AbstractContentItem} contentItem\n *\n * @constructor\n */\nlm.controls.Tab = function( header, contentItem ) {\n\tthis.header = header;\n\tthis.contentItem = contentItem;\n\tthis.element = $( lm.controls.Tab._template );\n\tthis.titleElement = this.element.find( '.lm_title' );\n\tthis.closeElement = this.element.find( '.lm_close_tab' );\n\tthis.closeElement[ contentItem.config.isClosable ? 'show' : 'hide' ]();\n\tthis.isActive = false;\n\n\tthis.setTitle( contentItem.config.title );\n\tthis.contentItem.on( 'titleChanged', this.setTitle, this );\n\n\tthis._layoutManager = this.contentItem.layoutManager;\n\n\tif(\n\t\tthis._layoutManager.config.settings.reorderEnabled === true &&\n\t\tcontentItem.config.reorderEnabled === true\n\t) {\n\t\tthis._dragListener = new lm.utils.DragListener( this.element );\n\t\tthis._dragListener.on( 'dragStart', this._onDragStart, this );\n\t\tthis.contentItem.on( 'destroy', this._dragListener.destroy, this._dragListener );\n\t}\n\n\tthis._onTabClickFn = lm.utils.fnBind( this._onTabClick, this );\n\tthis._onCloseClickFn = lm.utils.fnBind( this._onCloseClick, this );\n\n\tthis.element.on( 'mousedown touchstart', this._onTabClickFn );\n\n\tif( this.contentItem.config.isClosable ) {\n\t\tthis.closeElement.on( 'click touchstart', this._onCloseClickFn );\n\t\tthis.closeElement.on('mousedown', this._onCloseMousedown);\n\t} else {\n\t\tthis.closeElement.remove();\n\t}\n\n\tthis.contentItem.tab = this;\n\tthis.contentItem.emit( 'tab', this );\n\tthis.contentItem.layoutManager.emit( 'tabCreated', this );\n\n\tif( this.contentItem.isComponent ) {\n\t\tthis.contentItem.container.tab = this;\n\t\tthis.contentItem.container.emit( 'tab', this );\n\t}\n};\n\n/**\n * The tab's html template\n *\n * @type {String}\n */\nlm.controls.Tab._template = '
                  • ' +\n\t'
                    ' +\n\t'
                  • ';\n\nlm.utils.copy( lm.controls.Tab.prototype, {\n\n\t/**\n\t * Sets the tab's title to the provided string and sets\n\t * its title attribute to a pure text representation (without\n\t * html tags) of the same string.\n\t *\n\t * @public\n\t * @param {String} title can contain html\n\t */\n\tsetTitle: function( title ) {\n\t\tthis.element.attr( 'title', lm.utils.stripTags( title ) );\n\t\tthis.titleElement.html( title );\n\t},\n\n\t/**\n\t * Sets this tab's active state. To programmatically\n\t * switch tabs, use header.setActiveContentItem( item ) instead.\n\t *\n\t * @public\n\t * @param {Boolean} isActive\n\t */\n\tsetActive: function( isActive ) {\n\t\tif( isActive === this.isActive ) {\n\t\t\treturn;\n\t\t}\n\t\tthis.isActive = isActive;\n\n\t\tif( isActive ) {\n\t\t\tthis.element.addClass( 'lm_active' );\n\t\t} else {\n\t\t\tthis.element.removeClass( 'lm_active' );\n\t\t}\n\t},\n\n\t/**\n\t * Destroys the tab\n\t *\n\t * @private\n\t * @returns {void}\n\t */\n\t_$destroy: function() {\n\t\tthis.element.off( 'mousedown touchstart', this._onTabClickFn );\n\t\tthis.closeElement.off( 'click touchstart', this._onCloseClickFn );\n\t\tif( this._dragListener ) {\n\t\t\tthis.contentItem.off( 'destroy', this._dragListener.destroy, this._dragListener );\n\t\t\tthis._dragListener.off( 'dragStart', this._onDragStart );\n\t\t\tthis._dragListener = null;\n\t\t}\n\t\tthis.element.remove();\n\t},\n\n\t/**\n\t * Callback for the DragListener\n\t *\n\t * @param {Number} x The tabs absolute x position\n\t * @param {Number} y The tabs absolute y position\n\t *\n\t * @private\n\t * @returns {void}\n\t */\n\t_onDragStart: function( x, y ) {\n\t\tif( this.contentItem.parent.isMaximised === true ) {\n\t\t\tthis.contentItem.parent.toggleMaximise();\n\t\t}\n\t\tnew lm.controls.DragProxy(\n\t\t\tx,\n\t\t\ty,\n\t\t\tthis._dragListener,\n\t\t\tthis._layoutManager,\n\t\t\tthis.contentItem,\n\t\t\tthis.header.parent\n\t\t);\n\t},\n\n\t/**\n\t * Callback when the tab is clicked\n\t *\n\t * @param {jQuery DOM event} event\n\t *\n\t * @private\n\t * @returns {void}\n\t */\n\t_onTabClick: function( event ) {\n\t\t// left mouse button or tap\n\t\tif( event.button === 0 || event.type === 'touchstart' ) {\n\t\t\tvar activeContentItem = this.header.parent.getActiveContentItem();\n\t\t\tif( this.contentItem !== activeContentItem ) {\n\t\t\t\tthis.header.parent.setActiveContentItem( this.contentItem );\n\t\t\t}\n\n\t\t\t// middle mouse button\n\t\t} else if( event.button === 1 && this.contentItem.config.isClosable ) {\n\t\t\tthis._onCloseClick( event );\n\t\t}\n\t},\n\n\t/**\n\t * Callback when the tab's close button is\n\t * clicked\n\t *\n\t * @param {jQuery DOM event} event\n\t *\n\t * @private\n\t * @returns {void}\n\t */\n\t_onCloseClick: function( event ) {\n\t\tevent.stopPropagation();\n\t\tthis.header.parent.removeChild( this.contentItem );\n\t},\n\n\n\t/**\n\t * Callback to capture tab close button mousedown\n\t * to prevent tab from activating.\n\t *\n\t * @param (jQuery DOM event) event\n\t *\n\t * @private\n\t * @returns {void}\n\t */\n\t_onCloseMousedown: function(event) {\n\t\tevent.stopPropagation();\n\t}\n} );\n\nlm.controls.TransitionIndicator = function() {\n\tthis._element = $( '
                    ' );\n\t$( document.body ).append( this._element );\n\n\tthis._toElement = null;\n\tthis._fromDimensions = null;\n\tthis._totalAnimationDuration = 200;\n\tthis._animationStartTime = null;\n};\n\nlm.utils.copy( lm.controls.TransitionIndicator.prototype, {\n\tdestroy: function() {\n\t\tthis._element.remove();\n\t},\n\n\ttransitionElements: function( fromElement, toElement ) {\n\t\t/**\n\t\t * TODO - This is not quite as cool as expected. Review.\n\t\t */\n\t\treturn;\n\t\tthis._toElement = toElement;\n\t\tthis._animationStartTime = lm.utils.now();\n\t\tthis._fromDimensions = this._measure( fromElement );\n\t\tthis._fromDimensions.opacity = 0.8;\n\t\tthis._element.show().css( this._fromDimensions );\n\t\tlm.utils.animFrame( lm.utils.fnBind( this._nextAnimationFrame, this ) );\n\t},\n\n\t_nextAnimationFrame: function() {\n\t\tvar toDimensions = this._measure( this._toElement ),\n\t\t\tanimationProgress = ( lm.utils.now() - this._animationStartTime ) / this._totalAnimationDuration,\n\t\t\tcurrentFrameStyles = {},\n\t\t\tcssProperty;\n\n\t\tif( animationProgress >= 1 ) {\n\t\t\tthis._element.hide();\n\t\t\treturn;\n\t\t}\n\n\t\ttoDimensions.opacity = 0;\n\n\t\tfor( cssProperty in this._fromDimensions ) {\n\t\t\tcurrentFrameStyles[ cssProperty ] = this._fromDimensions[ cssProperty ] +\n\t\t\t\t( toDimensions[ cssProperty ] - this._fromDimensions[ cssProperty ] ) *\n\t\t\t\tanimationProgress;\n\t\t}\n\n\t\tthis._element.css( currentFrameStyles );\n\t\tlm.utils.animFrame( lm.utils.fnBind( this._nextAnimationFrame, this ) );\n\t},\n\n\t_measure: function( element ) {\n\t\tvar offset = element.offset();\n\n\t\treturn {\n\t\t\tleft: offset.left,\n\t\t\ttop: offset.top,\n\t\t\twidth: element.outerWidth(),\n\t\t\theight: element.outerHeight()\n\t\t};\n\t}\n} );\nlm.errors.ConfigurationError = function( message, node ) {\n\tError.call( this );\n\n\tthis.name = 'Configuration Error';\n\tthis.message = message;\n\tthis.node = node;\n};\n\nlm.errors.ConfigurationError.prototype = new Error();\n\n/**\n * This is the baseclass that all content items inherit from.\n * Most methods provide a subset of what the sub-classes do.\n *\n * It also provides a number of functions for tree traversal\n *\n * @param {lm.LayoutManager} layoutManager\n * @param {item node configuration} config\n * @param {lm.item} parent\n *\n * @event stateChanged\n * @event beforeItemDestroyed\n * @event itemDestroyed\n * @event itemCreated\n * @event componentCreated\n * @event rowCreated\n * @event columnCreated\n * @event stackCreated\n *\n * @constructor\n */\nlm.items.AbstractContentItem = function( layoutManager, config, parent ) {\n\tlm.utils.EventEmitter.call( this );\n\n\tthis.config = this._extendItemNode( config );\n\tthis.type = config.type;\n\tthis.contentItems = [];\n\tthis.parent = parent;\n\n\tthis.isInitialised = false;\n\tthis.isMaximised = false;\n\tthis.isRoot = false;\n\tthis.isRow = false;\n\tthis.isColumn = false;\n\tthis.isStack = false;\n\tthis.isComponent = false;\n\n\tthis.layoutManager = layoutManager;\n\tthis._pendingEventPropagations = {};\n\tthis._throttledEvents = [ 'stateChanged' ];\n\n\tthis.on( lm.utils.EventEmitter.ALL_EVENT, this._propagateEvent, this );\n\n\tif( config.content ) {\n\t\tthis._createContentItems( config );\n\t}\n};\n\nlm.utils.copy( lm.items.AbstractContentItem.prototype, {\n\n\t/**\n\t * Set the size of the component and its children, called recursively\n\t *\n\t * @abstract\n\t * @returns void\n\t */\n\tsetSize: function() {\n\t\tthrow new Error( 'Abstract Method' );\n\t},\n\n\t/**\n\t * Calls a method recursively downwards on the tree\n\t *\n\t * @param {String} functionName the name of the function to be called\n\t * @param {[Array]}functionArguments optional arguments that are passed to every function\n\t * @param {[bool]} bottomUp Call methods from bottom to top, defaults to false\n\t * @param {[bool]} skipSelf Don't invoke the method on the class that calls it, defaults to false\n\t *\n\t * @returns {void}\n\t */\n\tcallDownwards: function( functionName, functionArguments, bottomUp, skipSelf ) {\n\t\tvar i;\n\n\t\tif( bottomUp !== true && skipSelf !== true ) {\n\t\t\tthis[ functionName ].apply( this, functionArguments || [] );\n\t\t}\n\t\tfor( i = 0; i < this.contentItems.length; i++ ) {\n\t\t\tthis.contentItems[ i ].callDownwards( functionName, functionArguments, bottomUp );\n\t\t}\n\t\tif( bottomUp === true && skipSelf !== true ) {\n\t\t\tthis[ functionName ].apply( this, functionArguments || [] );\n\t\t}\n\t},\n\n\t/**\n\t * Removes a child node (and its children) from the tree\n\t *\n\t * @param {lm.items.ContentItem} contentItem\n\t *\n\t * @returns {void}\n\t */\n\tremoveChild: function( contentItem, keepChild ) {\n\n\t\t/*\n\t\t * Get the position of the item that's to be removed within all content items this node contains\n\t\t */\n\t\tvar index = lm.utils.indexOf( contentItem, this.contentItems );\n\n\t\t/*\n\t\t * Make sure the content item to be removed is actually a child of this item\n\t\t */\n\t\tif( index === -1 ) {\n\t\t\tthrow new Error( 'Can\\'t remove child item. Unknown content item' );\n\t\t}\n\n\t\t/**\n\t\t * Call ._$destroy on the content item. This also calls ._$destroy on all its children\n\t\t */\n\t\tif( keepChild !== true ) {\n\t\t\tthis.contentItems[ index ]._$destroy();\n\t\t}\n\n\t\t/**\n\t\t * Remove the content item from this nodes array of children\n\t\t */\n\t\tthis.contentItems.splice( index, 1 );\n\n\t\t/**\n\t\t * Remove the item from the configuration\n\t\t */\n\t\tthis.config.content.splice( index, 1 );\n\n\t\t/**\n\t\t * If this node still contains other content items, adjust their size\n\t\t */\n\t\tif( this.contentItems.length > 0 ) {\n\t\t\tthis.callDownwards( 'setSize' );\n\n\t\t\t/**\n\t\t\t * If this was the last content item, remove this node as well\n\t\t\t */\n\t\t} else if( !(this instanceof lm.items.Root) && this.config.isClosable === true ) {\n\t\t\tthis.parent.removeChild( this );\n\t\t}\n\t},\n\n\t/**\n\t * Sets up the tree structure for the newly added child\n\t * The responsibility for the actual DOM manipulations lies\n\t * with the concrete item\n\t *\n\t * @param {lm.items.AbstractContentItem} contentItem\n\t * @param {[Int]} index If omitted item will be appended\n\t */\n\taddChild: function( contentItem, index ) {\n\t\tif( index === undefined ) {\n\t\t\tindex = this.contentItems.length;\n\t\t}\n\n\t\tthis.contentItems.splice( index, 0, contentItem );\n\n\t\tif( this.config.content === undefined ) {\n\t\t\tthis.config.content = [];\n\t\t}\n\n\t\tthis.config.content.splice( index, 0, contentItem.config );\n\t\tcontentItem.parent = this;\n\n\t\tif( contentItem.parent.isInitialised === true && contentItem.isInitialised === false ) {\n\t\t\tcontentItem._$init();\n\t\t}\n\t},\n\n\t/**\n\t * Replaces oldChild with newChild. This used to use jQuery.replaceWith... which for\n\t * some reason removes all event listeners, so isn't really an option.\n\t *\n\t * @param {lm.item.AbstractContentItem} oldChild\n\t * @param {lm.item.AbstractContentItem} newChild\n\t *\n\t * @returns {void}\n\t */\n\treplaceChild: function( oldChild, newChild, _$destroyOldChild ) {\n\n\t\tnewChild = this.layoutManager._$normalizeContentItem( newChild );\n\n\t\tvar index = lm.utils.indexOf( oldChild, this.contentItems ),\n\t\t\tparentNode = oldChild.element[ 0 ].parentNode;\n\n\t\tif( index === -1 ) {\n\t\t\tthrow new Error( 'Can\\'t replace child. oldChild is not child of this' );\n\t\t}\n\n\t\tparentNode.replaceChild( newChild.element[ 0 ], oldChild.element[ 0 ] );\n\n\t\t/*\n\t\t * Optionally destroy the old content item\n\t\t */\n\t\tif( _$destroyOldChild === true ) {\n\t\t\toldChild.parent = null;\n\t\t\toldChild._$destroy();\n\t\t}\n\n\t\t/*\n\t\t * Wire the new contentItem into the tree\n\t\t */\n\t\tthis.contentItems[ index ] = newChild;\n\t\tnewChild.parent = this;\n\n\t\t/*\n\t\t * Update tab reference\n\t\t */\n\t\tif( this.isStack ) {\n\t\t\tthis.header.tabs[ index ].contentItem = newChild;\n\t\t}\n\n\t\t//TODO This doesn't update the config... refactor to leave item nodes untouched after creation\n\t\tif( newChild.parent.isInitialised === true && newChild.isInitialised === false ) {\n\t\t\tnewChild._$init();\n\t\t}\n\n\t\tthis.callDownwards( 'setSize' );\n\t},\n\n\t/**\n\t * Convenience method.\n\t * Shorthand for this.parent.removeChild( this )\n\t *\n\t * @returns {void}\n\t */\n\tremove: function() {\n\t\tthis.parent.removeChild( this );\n\t},\n\n\t/**\n\t * Removes the component from the layout and creates a new\n\t * browser window with the component and its children inside\n\t *\n\t * @returns {lm.controls.BrowserPopout}\n\t */\n\tpopout: function() {\n\t\tvar browserPopout = this.layoutManager.createPopout( this );\n\t\tthis.emitBubblingEvent( 'stateChanged' );\n\t\treturn browserPopout;\n\t},\n\n\t/**\n\t * Maximises the Item or minimises it if it is already maximised\n\t *\n\t * @returns {void}\n\t */\n\ttoggleMaximise: function( e ) {\n\t\te && e.preventDefault();\n\t\tif( this.isMaximised === true ) {\n\t\t\tthis.layoutManager._$minimiseItem( this );\n\t\t} else {\n\t\t\tthis.layoutManager._$maximiseItem( this );\n\t\t}\n\n\t\tthis.isMaximised = !this.isMaximised;\n\t\tthis.emitBubblingEvent( 'stateChanged' );\n\t},\n\n\t/**\n\t * Selects the item if it is not already selected\n\t *\n\t * @returns {void}\n\t */\n\tselect: function() {\n\t\tif( this.layoutManager.selectedItem !== this ) {\n\t\t\tthis.layoutManager.selectItem( this, true );\n\t\t\tthis.element.addClass( 'lm_selected' );\n\t\t}\n\t},\n\n\t/**\n\t * De-selects the item if it is selected\n\t *\n\t * @returns {void}\n\t */\n\tdeselect: function() {\n\t\tif( this.layoutManager.selectedItem === this ) {\n\t\t\tthis.layoutManager.selectedItem = null;\n\t\t\tthis.element.removeClass( 'lm_selected' );\n\t\t}\n\t},\n\n\t/**\n\t * Set this component's title\n\t *\n\t * @public\n\t * @param {String} title\n\t *\n\t * @returns {void}\n\t */\n\tsetTitle: function( title ) {\n\t\tthis.config.title = title;\n\t\tthis.emit( 'titleChanged', title );\n\t\tthis.emit( 'stateChanged' );\n\t},\n\n\t/**\n\t * Checks whether a provided id is present\n\t *\n\t * @public\n\t * @param {String} id\n\t *\n\t * @returns {Boolean} isPresent\n\t */\n\thasId: function( id ) {\n\t\tif( !this.config.id ) {\n\t\t\treturn false;\n\t\t} else if( typeof this.config.id === 'string' ) {\n\t\t\treturn this.config.id === id;\n\t\t} else if( this.config.id instanceof Array ) {\n\t\t\treturn lm.utils.indexOf( id, this.config.id ) !== -1;\n\t\t}\n\t},\n\n\t/**\n\t * Adds an id. Adds it as a string if the component doesn't\n\t * have an id yet or creates/uses an array\n\t *\n\t * @public\n\t * @param {String} id\n\t *\n\t * @returns {void}\n\t */\n\taddId: function( id ) {\n\t\tif( this.hasId( id ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif( !this.config.id ) {\n\t\t\tthis.config.id = id;\n\t\t} else if( typeof this.config.id === 'string' ) {\n\t\t\tthis.config.id = [ this.config.id, id ];\n\t\t} else if( this.config.id instanceof Array ) {\n\t\t\tthis.config.id.push( id );\n\t\t}\n\t},\n\n\t/**\n\t * Removes an existing id. Throws an error\n\t * if the id is not present\n\t *\n\t * @public\n\t * @param {String} id\n\t *\n\t * @returns {void}\n\t */\n\tremoveId: function( id ) {\n\t\tif( !this.hasId( id ) ) {\n\t\t\tthrow new Error( 'Id not found' );\n\t\t}\n\n\t\tif( typeof this.config.id === 'string' ) {\n\t\t\tdelete this.config.id;\n\t\t} else if( this.config.id instanceof Array ) {\n\t\t\tvar index = lm.utils.indexOf( id, this.config.id );\n\t\t\tthis.config.id.splice( index, 1 );\n\t\t}\n\t},\n\n\t/****************************************\n\t * SELECTOR\n\t ****************************************/\n\tgetItemsByFilter: function( filter ) {\n\t\tvar result = [],\n\t\t\tnext = function( contentItem ) {\n\t\t\t\tfor( var i = 0; i < contentItem.contentItems.length; i++ ) {\n\n\t\t\t\t\tif( filter( contentItem.contentItems[ i ] ) === true ) {\n\t\t\t\t\t\tresult.push( contentItem.contentItems[ i ] );\n\t\t\t\t\t}\n\n\t\t\t\t\tnext( contentItem.contentItems[ i ] );\n\t\t\t\t}\n\t\t\t};\n\n\t\tnext( this );\n\t\treturn result;\n\t},\n\n\tgetItemsById: function( id ) {\n\t\treturn this.getItemsByFilter( function( item ) {\n\t\t\tif( item.config.id instanceof Array ) {\n\t\t\t\treturn lm.utils.indexOf( id, item.config.id ) !== -1;\n\t\t\t} else {\n\t\t\t\treturn item.config.id === id;\n\t\t\t}\n\t\t} );\n\t},\n\n\tgetItemsByType: function( type ) {\n\t\treturn this._$getItemsByProperty( 'type', type );\n\t},\n\n\tgetComponentsByName: function( componentName ) {\n\t\tvar components = this._$getItemsByProperty( 'componentName', componentName ),\n\t\t\tinstances = [],\n\t\t\ti;\n\n\t\tfor( i = 0; i < components.length; i++ ) {\n\t\t\tinstances.push( components[ i ].instance );\n\t\t}\n\n\t\treturn instances;\n\t},\n\n\t/****************************************\n\t * PACKAGE PRIVATE\n\t ****************************************/\n\t_$getItemsByProperty: function( key, value ) {\n\t\treturn this.getItemsByFilter( function( item ) {\n\t\t\treturn item[ key ] === value;\n\t\t} );\n\t},\n\n\t_$setParent: function( parent ) {\n\t\tthis.parent = parent;\n\t},\n\n\t_$highlightDropZone: function( x, y, area ) {\n\t\tthis.layoutManager.dropTargetIndicator.highlightArea( area );\n\t},\n\n\t_$onDrop: function( contentItem ) {\n\t\tthis.addChild( contentItem );\n\t},\n\n\t_$hide: function() {\n\t\tthis._callOnActiveComponents( 'hide' );\n\t\tthis.element.hide();\n\t\tthis.layoutManager.updateSize();\n\t},\n\n\t_$show: function() {\n\t\tthis._callOnActiveComponents( 'show' );\n\t\tthis.element.show();\n\t\tthis.layoutManager.updateSize();\n\t},\n\n\t_callOnActiveComponents: function( methodName ) {\n\t\tvar stacks = this.getItemsByType( 'stack' ),\n\t\t\tactiveContentItem,\n\t\t\ti;\n\n\t\tfor( i = 0; i < stacks.length; i++ ) {\n\t\t\tactiveContentItem = stacks[ i ].getActiveContentItem();\n\n\t\t\tif( activeContentItem && activeContentItem.isComponent ) {\n\t\t\t\tactiveContentItem.container[ methodName ]();\n\t\t\t}\n\t\t}\n\t},\n\n\t/**\n\t * Destroys this item ands its children\n\t *\n\t * @returns {void}\n\t */\n\t_$destroy: function() {\n\t\tthis.emitBubblingEvent( 'beforeItemDestroyed' );\n\t\tthis.callDownwards( '_$destroy', [], true, true );\n\t\tthis.element.remove();\n\t\tthis.emitBubblingEvent( 'itemDestroyed' );\n\t},\n\n\t/**\n\t * Returns the area the component currently occupies in the format\n\t *\n\t * {\n\t *\t\tx1: int\n\t *\t\txy: int\n\t *\t\ty1: int\n\t *\t\ty2: int\n\t *\t\tcontentItem: contentItem\n\t * }\n\t */\n\t_$getArea: function( element ) {\n\t\telement = element || this.element;\n\n\t\tvar offset = element.offset(),\n\t\t\twidth = element.width(),\n\t\t\theight = element.height();\n\n\t\treturn {\n\t\t\tx1: offset.left,\n\t\t\ty1: offset.top,\n\t\t\tx2: offset.left + width,\n\t\t\ty2: offset.top + height,\n\t\t\tsurface: width * height,\n\t\t\tcontentItem: this\n\t\t};\n\t},\n\n\t/**\n\t * The tree of content items is created in two steps: First all content items are instantiated,\n\t * then init is called recursively from top to bottem. This is the basic init function,\n\t * it can be used, extended or overwritten by the content items\n\t *\n\t * Its behaviour depends on the content item\n\t *\n\t * @package private\n\t *\n\t * @returns {void}\n\t */\n\t_$init: function() {\n\t\tvar i;\n\t\tthis.setSize();\n\n\t\tfor( i = 0; i < this.contentItems.length; i++ ) {\n\t\t\tthis.childElementContainer.append( this.contentItems[ i ].element );\n\t\t}\n\n\t\tthis.isInitialised = true;\n\t\tthis.emitBubblingEvent( 'itemCreated' );\n\t\tthis.emitBubblingEvent( this.type + 'Created' );\n\t},\n\n\t/**\n\t * Emit an event that bubbles up the item tree.\n\t *\n\t * @param {String} name The name of the event\n\t *\n\t * @returns {void}\n\t */\n\temitBubblingEvent: function( name ) {\n\t\tvar event = new lm.utils.BubblingEvent( name, this );\n\t\tthis.emit( name, event );\n\t},\n\n\t/**\n\t * Private method, creates all content items for this node at initialisation time\n\t * PLEASE NOTE, please see addChild for adding contentItems add runtime\n\t * @private\n\t * @param {configuration item node} config\n\t *\n\t * @returns {void}\n\t */\n\t_createContentItems: function( config ) {\n\t\tvar oContentItem, i;\n\n\t\tif( !( config.content instanceof Array ) ) {\n\t\t\tthrow new lm.errors.ConfigurationError( 'content must be an Array', config );\n\t\t}\n\n\t\tfor( i = 0; i < config.content.length; i++ ) {\n\t\t\toContentItem = this.layoutManager.createContentItem( config.content[ i ], this );\n\t\t\tthis.contentItems.push( oContentItem );\n\t\t}\n\t},\n\n\t/**\n\t * Extends an item configuration node with default settings\n\t * @private\n\t * @param {configuration item node} config\n\t *\n\t * @returns {configuration item node} extended config\n\t */\n\t_extendItemNode: function( config ) {\n\n\t\tfor( var key in lm.config.itemDefaultConfig ) {\n\t\t\tif( config[ key ] === undefined ) {\n\t\t\t\tconfig[ key ] = lm.config.itemDefaultConfig[ key ];\n\t\t\t}\n\t\t}\n\n\t\treturn config;\n\t},\n\n\t/**\n\t * Called for every event on the item tree. Decides whether the event is a bubbling\n\t * event and propagates it to its parent\n\t *\n\t * @param {String} name the name of the event\n\t * @param {lm.utils.BubblingEvent} event\n\t *\n\t * @returns {void}\n\t */\n\t_propagateEvent: function( name, event ) {\n\t\tif( event instanceof lm.utils.BubblingEvent &&\n\t\t\tevent.isPropagationStopped === false &&\n\t\t\tthis.isInitialised === true ) {\n\n\t\t\t/**\n\t\t\t * In some cases (e.g. if an element is created from a DragSource) it\n\t\t\t * doesn't have a parent and is not below root. If that's the case\n\t\t\t * propagate the bubbling event from the top level of the substree directly\n\t\t\t * to the layoutManager\n\t\t\t */\n\t\t\tif( this.isRoot === false && this.parent ) {\n\t\t\t\tthis.parent.emit.apply( this.parent, Array.prototype.slice.call( arguments, 0 ) );\n\t\t\t} else {\n\t\t\t\tthis._scheduleEventPropagationToLayoutManager( name, event );\n\t\t\t}\n\t\t}\n\t},\n\n\t/**\n\t * All raw events bubble up to the root element. Some events that\n\t * are propagated to - and emitted by - the layoutManager however are\n\t * only string-based, batched and sanitized to make them more usable\n\t *\n\t * @param {String} name the name of the event\n\t *\n\t * @private\n\t * @returns {void}\n\t */\n\t_scheduleEventPropagationToLayoutManager: function( name, event ) {\n\t\tif( lm.utils.indexOf( name, this._throttledEvents ) === -1 ) {\n\t\t\tthis.layoutManager.emit( name, event.origin );\n\t\t} else {\n\t\t\tif( this._pendingEventPropagations[ name ] !== true ) {\n\t\t\t\tthis._pendingEventPropagations[ name ] = true;\n\t\t\t\tlm.utils.animFrame( lm.utils.fnBind( this._propagateEventToLayoutManager, this, [ name, event ] ) );\n\t\t\t}\n\t\t}\n\n\t},\n\n\t/**\n\t * Callback for events scheduled by _scheduleEventPropagationToLayoutManager\n\t *\n\t * @param {String} name the name of the event\n\t *\n\t * @private\n\t * @returns {void}\n\t */\n\t_propagateEventToLayoutManager: function( name, event ) {\n\t\tthis._pendingEventPropagations[ name ] = false;\n\t\tthis.layoutManager.emit( name, event );\n\t}\n} );\n\n/**\n * @param {[type]} layoutManager [description]\n * @param {[type]} config [description]\n * @param {[type]} parent [description]\n */\nlm.items.Component = function( layoutManager, config, parent ) {\n\tlm.items.AbstractContentItem.call( this, layoutManager, config, parent );\n\n\tvar ComponentConstructor = layoutManager.getComponent( this.config.componentName ),\n\t\tcomponentConfig = $.extend( true, {}, this.config.componentState || {} );\n\n\tcomponentConfig.componentName = this.config.componentName;\n\tthis.componentName = this.config.componentName;\n\n\tif( this.config.title === '' ) {\n\t\tthis.config.title = this.config.componentName;\n\t}\n\n\tthis.isComponent = true;\n\tthis.container = new lm.container.ItemContainer( this.config, this, layoutManager );\n\tthis.instance = new ComponentConstructor( this.container, componentConfig );\n\tthis.element = this.container._element;\n};\n\nlm.utils.extend( lm.items.Component, lm.items.AbstractContentItem );\n\nlm.utils.copy( lm.items.Component.prototype, {\n\n\tclose: function() {\n\t\tthis.parent.removeChild( this );\n\t},\n\n\tsetSize: function() {\n\t\tif( this.element.is( ':visible' ) ) {\n\t\t\t// Do not update size of hidden components to prevent unwanted reflows\n\t\t\tthis.container._$setSize( this.element.width(), this.element.height() );\n\t\t}\n\t},\n\n\t_$init: function() {\n\t\tlm.items.AbstractContentItem.prototype._$init.call( this );\n\t\tthis.container.emit( 'open' );\n\t},\n\n\t_$hide: function() {\n\t\tthis.container.hide();\n\t\tlm.items.AbstractContentItem.prototype._$hide.call( this );\n\t},\n\n\t_$show: function() {\n\t\tthis.container.show();\n\t\tlm.items.AbstractContentItem.prototype._$show.call( this );\n\t},\n\n\t_$shown: function() {\n\t\tthis.container.shown();\n\t\tlm.items.AbstractContentItem.prototype._$shown.call( this );\n\t},\n\n\t_$destroy: function() {\n\t\tthis.container.emit( 'destroy', this );\n\t\tlm.items.AbstractContentItem.prototype._$destroy.call( this );\n\t},\n\n\t/**\n\t * Dragging onto a component directly is not an option\n\t *\n\t * @returns null\n\t */\n\t_$getArea: function() {\n\t\treturn null;\n\t}\n} );\n\nlm.items.Root = function( layoutManager, config, containerElement ) {\n\tlm.items.AbstractContentItem.call( this, layoutManager, config, null );\n\tthis.isRoot = true;\n\tthis.type = 'root';\n\tthis.element = $( '
                    ' );\n\tthis.childElementContainer = this.element;\n\tthis._containerElement = containerElement;\n\tthis._containerElement.append( this.element );\n};\n\nlm.utils.extend( lm.items.Root, lm.items.AbstractContentItem );\n\nlm.utils.copy( lm.items.Root.prototype, {\n\taddChild: function( contentItem ) {\n\t\tif( this.contentItems.length > 0 ) {\n\t\t\tthrow new Error( 'Root node can only have a single child' );\n\t\t}\n\n\t\tcontentItem = this.layoutManager._$normalizeContentItem( contentItem, this );\n\t\tthis.childElementContainer.append( contentItem.element );\n\t\tlm.items.AbstractContentItem.prototype.addChild.call( this, contentItem );\n\n\t\tthis.callDownwards( 'setSize' );\n\t\tthis.emitBubblingEvent( 'stateChanged' );\n\t},\n\n\tsetSize: function( width, height ) {\n\t\twidth = (typeof width === 'undefined') ? this._containerElement.width() : width;\n\t\theight = (typeof height === 'undefined') ? this._containerElement.height() : height;\n\n\t\tthis.element.width( width );\n\t\tthis.element.height( height );\n\n\t\t/*\n\t\t * Root can be empty\n\t\t */\n\t\tif( this.contentItems[ 0 ] ) {\n\t\t\tthis.contentItems[ 0 ].element.width( width );\n\t\t\tthis.contentItems[ 0 ].element.height( height );\n\t\t}\n\t},\n\t_$highlightDropZone: function( x, y, area ) {\n\t\tthis.layoutManager.tabDropPlaceholder.remove();\n\t\tlm.items.AbstractContentItem.prototype._$highlightDropZone.apply( this, arguments );\n\t},\n\n\t_$onDrop: function( contentItem, area ) {\n\t\tvar stack;\n\n\t\tif( contentItem.isComponent ) {\n\t\t\tstack = this.layoutManager.createContentItem( {\n\t\t\t\ttype: 'stack',\n\t\t\t\theader: contentItem.config.header || {}\n\t\t\t}, this );\n\t\t\tstack._$init();\n\t\t\tstack.addChild( contentItem );\n\t\t\tcontentItem = stack;\n\t\t}\n\n\t\tif( !this.contentItems.length ) {\n\t\t\tthis.addChild( contentItem );\n\t\t} else {\n\t\t\tvar type = area.side[ 0 ] == 'x' ? 'row' : 'column';\n\t\t\tvar dimension = area.side[ 0 ] == 'x' ? 'width' : 'height';\n\t\t\tvar insertBefore = area.side[ 1 ] == '2';\n\t\t\tvar column = this.contentItems[ 0 ];\n\t\t\tif( !column instanceof lm.items.RowOrColumn || column.type != type ) {\n\t\t\t\tvar rowOrColumn = this.layoutManager.createContentItem( { type: type }, this );\n\t\t\t\tthis.replaceChild( column, rowOrColumn );\n\t\t\t\trowOrColumn.addChild( contentItem, insertBefore ? 0 : undefined, true );\n\t\t\t\trowOrColumn.addChild( column, insertBefore ? undefined : 0, true );\n\t\t\t\tcolumn.config[ dimension ] = 50;\n\t\t\t\tcontentItem.config[ dimension ] = 50;\n\t\t\t\trowOrColumn.callDownwards( 'setSize' );\n\t\t\t} else {\n\t\t\t\tvar sibbling = column.contentItems[ insertBefore ? 0 : column.contentItems.length - 1 ]\n\t\t\t\tcolumn.addChild( contentItem, insertBefore ? 0 : undefined, true );\n\t\t\t\tsibbling.config[ dimension ] *= 0.5;\n\t\t\t\tcontentItem.config[ dimension ] = sibbling.config[ dimension ];\n\t\t\t\tcolumn.callDownwards( 'setSize' );\n\t\t\t}\n\t\t}\n\t}\n} );\n\n\n\nlm.items.RowOrColumn = function( isColumn, layoutManager, config, parent ) {\n\tlm.items.AbstractContentItem.call( this, layoutManager, config, parent );\n\n\tthis.isRow = !isColumn;\n\tthis.isColumn = isColumn;\n\n\tthis.element = $( '
                    ' );\n\tthis.childElementContainer = this.element;\n\tthis._splitterSize = layoutManager.config.dimensions.borderWidth;\n\tthis._splitterGrabSize = layoutManager.config.dimensions.borderGrabWidth;\n\tthis._isColumn = isColumn;\n\tthis._dimension = isColumn ? 'height' : 'width';\n\tthis._splitter = [];\n\tthis._splitterPosition = null;\n\tthis._splitterMinPosition = null;\n\tthis._splitterMaxPosition = null;\n};\n\nlm.utils.extend( lm.items.RowOrColumn, lm.items.AbstractContentItem );\n\nlm.utils.copy( lm.items.RowOrColumn.prototype, {\n\n\t/**\n\t * Add a new contentItem to the Row or Column\n\t *\n\t * @param {lm.item.AbstractContentItem} contentItem\n\t * @param {[int]} index The position of the new item within the Row or Column.\n\t * If no index is provided the item will be added to the end\n\t * @param {[bool]} _$suspendResize If true the items won't be resized. This will leave the item in\n\t * an inconsistent state and is only intended to be used if multiple\n\t * children need to be added in one go and resize is called afterwards\n\t *\n\t * @returns {void}\n\t */\n\taddChild: function( contentItem, index, _$suspendResize ) {\n\n\t\tvar newItemSize, itemSize, i, splitterElement;\n\n\t\tcontentItem = this.layoutManager._$normalizeContentItem( contentItem, this );\n\n\t\tif( index === undefined ) {\n\t\t\tindex = this.contentItems.length;\n\t\t}\n\n\t\tif( this.contentItems.length > 0 ) {\n\t\t\tsplitterElement = this._createSplitter( Math.max( 0, index - 1 ) ).element;\n\n\t\t\tif( index > 0 ) {\n\t\t\t\tthis.contentItems[ index - 1 ].element.after( splitterElement );\n\t\t\t\tsplitterElement.after( contentItem.element );\n\t\t\t} else {\n\t\t\t\tthis.contentItems[ 0 ].element.before( splitterElement );\n\t\t\t\tsplitterElement.before( contentItem.element );\n\t\t\t}\n\t\t} else {\n\t\t\tthis.childElementContainer.append( contentItem.element );\n\t\t}\n\n\t\tlm.items.AbstractContentItem.prototype.addChild.call( this, contentItem, index );\n\n\t\tnewItemSize = ( 1 / this.contentItems.length ) * 100;\n\n\t\tif( _$suspendResize === true ) {\n\t\t\tthis.emitBubblingEvent( 'stateChanged' );\n\t\t\treturn;\n\t\t}\n\n\t\tfor( i = 0; i < this.contentItems.length; i++ ) {\n\t\t\tif( this.contentItems[ i ] === contentItem ) {\n\t\t\t\tcontentItem.config[ this._dimension ] = newItemSize;\n\t\t\t} else {\n\t\t\t\titemSize = this.contentItems[ i ].config[ this._dimension ] *= ( 100 - newItemSize ) / 100;\n\t\t\t\tthis.contentItems[ i ].config[ this._dimension ] = itemSize;\n\t\t\t}\n\t\t}\n\n\t\tthis.callDownwards( 'setSize' );\n\t\tthis.emitBubblingEvent( 'stateChanged' );\n\t},\n\n\t/**\n\t * Removes a child of this element\n\t *\n\t * @param {lm.items.AbstractContentItem} contentItem\n\t * @param {boolean} keepChild If true the child will be removed, but not destroyed\n\t *\n\t * @returns {void}\n\t */\n\tremoveChild: function( contentItem, keepChild ) {\n\t\tvar removedItemSize = contentItem.config[ this._dimension ],\n\t\t\tindex = lm.utils.indexOf( contentItem, this.contentItems ),\n\t\t\tsplitterIndex = Math.max( index - 1, 0 ),\n\t\t\ti,\n\t\t\tchildItem;\n\n\t\tif( index === -1 ) {\n\t\t\tthrow new Error( 'Can\\'t remove child. ContentItem is not child of this Row or Column' );\n\t\t}\n\n\t\t/**\n\t\t * Remove the splitter before the item or after if the item happens\n\t\t * to be the first in the row/column\n\t\t */\n\t\tif( this._splitter[ splitterIndex ] ) {\n\t\t\tthis._splitter[ splitterIndex ]._$destroy();\n\t\t\tthis._splitter.splice( splitterIndex, 1 );\n\t\t}\n\n\t\t/**\n\t\t * Allocate the space that the removed item occupied to the remaining items\n\t\t */\n\t\tfor( i = 0; i < this.contentItems.length; i++ ) {\n\t\t\tif( this.contentItems[ i ] !== contentItem ) {\n\t\t\t\tthis.contentItems[ i ].config[ this._dimension ] += removedItemSize / ( this.contentItems.length - 1 );\n\t\t\t}\n\t\t}\n\n\t\tlm.items.AbstractContentItem.prototype.removeChild.call( this, contentItem, keepChild );\n\n\t\tif( this.contentItems.length === 1 && this.config.isClosable === true ) {\n\t\t\tchildItem = this.contentItems[ 0 ];\n\t\t\tthis.contentItems = [];\n\t\t\tthis.parent.replaceChild( this, childItem, true );\n\t\t} else {\n\t\t\tthis.callDownwards( 'setSize' );\n\t\t\tthis.emitBubblingEvent( 'stateChanged' );\n\t\t}\n\t},\n\n\t/**\n\t * Replaces a child of this Row or Column with another contentItem\n\t *\n\t * @param {lm.items.AbstractContentItem} oldChild\n\t * @param {lm.items.AbstractContentItem} newChild\n\t *\n\t * @returns {void}\n\t */\n\treplaceChild: function( oldChild, newChild ) {\n\t\tvar size = oldChild.config[ this._dimension ];\n\t\tlm.items.AbstractContentItem.prototype.replaceChild.call( this, oldChild, newChild );\n\t\tnewChild.config[ this._dimension ] = size;\n\t\tthis.callDownwards( 'setSize' );\n\t\tthis.emitBubblingEvent( 'stateChanged' );\n\t},\n\n\t/**\n\t * Called whenever the dimensions of this item or one of its parents change\n\t *\n\t * @returns {void}\n\t */\n\tsetSize: function() {\n\t\tif( this.contentItems.length > 0 ) {\n\t\t\tthis._calculateRelativeSizes();\n\t\t\tthis._setAbsoluteSizes();\n\t\t}\n\t\tthis.emitBubblingEvent( 'stateChanged' );\n\t\tthis.emit( 'resize' );\n\t},\n\n\t/**\n\t * Invoked recursively by the layout manager. AbstractContentItem.init appends\n\t * the contentItem's DOM elements to the container, RowOrColumn init adds splitters\n\t * in between them\n\t *\n\t * @package private\n\t * @override AbstractContentItem._$init\n\t * @returns {void}\n\t */\n\t_$init: function() {\n\t\tif( this.isInitialised === true ) return;\n\n\t\tvar i;\n\n\t\tlm.items.AbstractContentItem.prototype._$init.call( this );\n\n\t\tfor( i = 0; i < this.contentItems.length - 1; i++ ) {\n\t\t\tthis.contentItems[ i ].element.after( this._createSplitter( i ).element );\n\t\t}\n\t},\n\n\t/**\n\t * Turns the relative sizes calculated by _calculateRelativeSizes into\n\t * absolute pixel values and applies them to the children's DOM elements\n\t *\n\t * Assigns additional pixels to counteract Math.floor\n\t *\n\t * @private\n\t * @returns {void}\n\t */\n\t_setAbsoluteSizes: function() {\n\t\tvar i,\n\t\t\tsizeData = this._calculateAbsoluteSizes();\n\n\t\tfor( i = 0; i < this.contentItems.length; i++ ) {\n\t\t\tif( sizeData.additionalPixel - i > 0 ) {\n\t\t\t\tsizeData.itemSizes[ i ]++;\n\t\t\t}\n\n\t\t\tif( this._isColumn ) {\n\t\t\t\tthis.contentItems[ i ].element.width( sizeData.totalWidth );\n\t\t\t\tthis.contentItems[ i ].element.height( sizeData.itemSizes[ i ] );\n\t\t\t} else {\n\t\t\t\tthis.contentItems[ i ].element.width( sizeData.itemSizes[ i ] );\n\t\t\t\tthis.contentItems[ i ].element.height( sizeData.totalHeight );\n\t\t\t}\n\t\t}\n\t},\n\n\t/**\n\t * Calculates the absolute sizes of all of the children of this Item.\n\t * @returns {object} - Set with absolute sizes and additional pixels.\n\t */\n\t_calculateAbsoluteSizes: function() {\n\t\tvar i,\n\t\t\ttotalSplitterSize = (this.contentItems.length - 1) * this._splitterSize,\n\t\t\ttotalWidth = this.element.width(),\n\t\t\ttotalHeight = this.element.height(),\n\t\t\ttotalAssigned = 0,\n\t\t\tadditionalPixel,\n\t\t\titemSize,\n\t\t\titemSizes = [];\n\n\t\tif( this._isColumn ) {\n\t\t\ttotalHeight -= totalSplitterSize;\n\t\t} else {\n\t\t\ttotalWidth -= totalSplitterSize;\n\t\t}\n\n\t\tfor( i = 0; i < this.contentItems.length; i++ ) {\n\t\t\tif( this._isColumn ) {\n\t\t\t\titemSize = Math.floor( totalHeight * ( this.contentItems[ i ].config.height / 100 ) );\n\t\t\t} else {\n\t\t\t\titemSize = Math.floor( totalWidth * (this.contentItems[ i ].config.width / 100) );\n\t\t\t}\n\n\t\t\ttotalAssigned += itemSize;\n\t\t\titemSizes.push( itemSize );\n\t\t}\n\n\t\tadditionalPixel = Math.floor( (this._isColumn ? totalHeight : totalWidth) - totalAssigned );\n\n\t\treturn {\n\t\t\titemSizes: itemSizes,\n\t\t\tadditionalPixel: additionalPixel,\n\t\t\ttotalWidth: totalWidth,\n\t\t\ttotalHeight: totalHeight\n\t\t};\n\t},\n\n\t/**\n\t * Calculates the relative sizes of all children of this Item. The logic\n\t * is as follows:\n\t *\n\t * - Add up the total size of all items that have a configured size\n\t *\n\t * - If the total == 100 (check for floating point errors)\n\t * Excellent, job done\n\t *\n\t * - If the total is > 100,\n\t * set the size of items without set dimensions to 1/3 and add this to the total\n\t * set the size off all items so that the total is hundred relative to their original size\n\t *\n\t * - If the total is < 100\n\t * If there are items without set dimensions, distribute the remainder to 100 evenly between them\n\t * If there are no items without set dimensions, increase all items sizes relative to\n\t * their original size so that they add up to 100\n\t *\n\t * @private\n\t * @returns {void}\n\t */\n\t_calculateRelativeSizes: function() {\n\n\t\tvar i,\n\t\t\ttotal = 0,\n\t\t\titemsWithoutSetDimension = [],\n\t\t\tdimension = this._isColumn ? 'height' : 'width';\n\n\t\tfor( i = 0; i < this.contentItems.length; i++ ) {\n\t\t\tif( this.contentItems[ i ].config[ dimension ] !== undefined ) {\n\t\t\t\ttotal += this.contentItems[ i ].config[ dimension ];\n\t\t\t} else {\n\t\t\t\titemsWithoutSetDimension.push( this.contentItems[ i ] );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Everything adds up to hundred, all good :-)\n\t\t */\n\t\tif( Math.round( total ) === 100 ) {\n\t\t\tthis._respectMinItemWidth();\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Allocate the remaining size to the items without a set dimension\n\t\t */\n\t\tif( Math.round( total ) < 100 && itemsWithoutSetDimension.length > 0 ) {\n\t\t\tfor( i = 0; i < itemsWithoutSetDimension.length; i++ ) {\n\t\t\t\titemsWithoutSetDimension[ i ].config[ dimension ] = ( 100 - total ) / itemsWithoutSetDimension.length;\n\t\t\t}\n\t\t\tthis._respectMinItemWidth();\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * If the total is > 100, but there are also items without a set dimension left, assing 50\n\t\t * as their dimension and add it to the total\n\t\t *\n\t\t * This will be reset in the next step\n\t\t */\n\t\tif( Math.round( total ) > 100 ) {\n\t\t\tfor( i = 0; i < itemsWithoutSetDimension.length; i++ ) {\n\t\t\t\titemsWithoutSetDimension[ i ].config[ dimension ] = 50;\n\t\t\t\ttotal += 50;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Set every items size relative to 100 relative to its size to total\n\t\t */\n\t\tfor( i = 0; i < this.contentItems.length; i++ ) {\n\t\t\tthis.contentItems[ i ].config[ dimension ] = ( this.contentItems[ i ].config[ dimension ] / total ) * 100;\n\t\t}\n\n\t\tthis._respectMinItemWidth();\n\t},\n\n\t/**\n\t * Adjusts the column widths to respect the dimensions minItemWidth if set.\n\t * @returns {}\n\t */\n\t_respectMinItemWidth: function() {\n\t\tvar minItemWidth = this.layoutManager.config.dimensions ? (this.layoutManager.config.dimensions.minItemWidth || 0) : 0,\n\t\t\tsizeData = null,\n\t\t\tentriesOverMin = [],\n\t\t\ttotalOverMin = 0,\n\t\t\ttotalUnderMin = 0,\n\t\t\tremainingWidth = 0,\n\t\t\titemSize = 0,\n\t\t\tcontentItem = null,\n\t\t\treducePercent,\n\t\t\treducedWidth,\n\t\t\tallEntries = [],\n\t\t\tentry;\n\n\t\tif( this._isColumn || !minItemWidth || this.contentItems.length <= 1 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsizeData = this._calculateAbsoluteSizes();\n\n\t\t/**\n\t\t * Figure out how much we are under the min item size total and how much room we have to use.\n\t\t */\n\t\tfor( var i = 0; i < this.contentItems.length; i++ ) {\n\n\t\t\tcontentItem = this.contentItems[ i ];\n\t\t\titemSize = sizeData.itemSizes[ i ];\n\n\t\t\tif( itemSize < minItemWidth ) {\n\t\t\t\ttotalUnderMin += minItemWidth - itemSize;\n\t\t\t\tentry = { width: minItemWidth };\n\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttotalOverMin += itemSize - minItemWidth;\n\t\t\t\tentry = { width: itemSize };\n\t\t\t\tentriesOverMin.push( entry );\n\t\t\t}\n\n\t\t\tallEntries.push( entry );\n\t\t}\n\n\t\t/**\n\t\t * If there is nothing under min, or there is not enough over to make up the difference, do nothing.\n\t\t */\n\t\tif( totalUnderMin === 0 || totalUnderMin > totalOverMin ) {\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Evenly reduce all columns that are over the min item width to make up the difference.\n\t\t */\n\t\treducePercent = totalUnderMin / totalOverMin;\n\t\tremainingWidth = totalUnderMin;\n\t\tfor( i = 0; i < entriesOverMin.length; i++ ) {\n\t\t\tentry = entriesOverMin[ i ];\n\t\t\treducedWidth = Math.round( ( entry.width - minItemWidth ) * reducePercent );\n\t\t\tremainingWidth -= reducedWidth;\n\t\t\tentry.width -= reducedWidth;\n\t\t}\n\n\t\t/**\n\t\t * Take anything remaining from the last item.\n\t\t */\n\t\tif( remainingWidth !== 0 ) {\n\t\t\tallEntries[ allEntries.length - 1 ].width -= remainingWidth;\n\t\t}\n\n\t\t/**\n\t\t * Set every items size relative to 100 relative to its size to total\n\t\t */\n\t\tfor( i = 0; i < this.contentItems.length; i++ ) {\n\t\t\tthis.contentItems[ i ].config.width = (allEntries[ i ].width / sizeData.totalWidth) * 100;\n\t\t}\n\t},\n\n\t/**\n\t * Instantiates a new lm.controls.Splitter, binds events to it and adds\n\t * it to the array of splitters at the position specified as the index argument\n\t *\n\t * What it doesn't do though is append the splitter to the DOM\n\t *\n\t * @param {Int} index The position of the splitter\n\t *\n\t * @returns {lm.controls.Splitter}\n\t */\n\t_createSplitter: function( index ) {\n\t\tvar splitter;\n\t\tsplitter = new lm.controls.Splitter( this._isColumn, this._splitterSize, this._splitterGrabSize );\n\t\tsplitter.on( 'drag', lm.utils.fnBind( this._onSplitterDrag, this, [ splitter ] ), this );\n\t\tsplitter.on( 'dragStop', lm.utils.fnBind( this._onSplitterDragStop, this, [ splitter ] ), this );\n\t\tsplitter.on( 'dragStart', lm.utils.fnBind( this._onSplitterDragStart, this, [ splitter ] ), this );\n\t\tthis._splitter.splice( index, 0, splitter );\n\t\treturn splitter;\n\t},\n\n\t/**\n\t * Locates the instance of lm.controls.Splitter in the array of\n\t * registered splitters and returns a map containing the contentItem\n\t * before and after the splitters, both of which are affected if the\n\t * splitter is moved\n\t *\n\t * @param {lm.controls.Splitter} splitter\n\t *\n\t * @returns {Object} A map of contentItems that the splitter affects\n\t */\n\t_getItemsForSplitter: function( splitter ) {\n\t\tvar index = lm.utils.indexOf( splitter, this._splitter );\n\n\t\treturn {\n\t\t\tbefore: this.contentItems[ index ],\n\t\t\tafter: this.contentItems[ index + 1 ]\n\t\t};\n\t},\n\n\t/**\n\t * Gets the minimum dimensions for the given item configuration array\n\t * @param item\n\t * @private\n\t */\n\t_getMinimumDimensions: function( arr ) {\n\t\tvar minWidth = 0, minHeight = 0;\n\n\t\tfor( var i = 0; i < arr.length; ++i ) {\n\t\t\tminWidth = Math.max( arr[ i ].minWidth || 0, minWidth );\n\t\t\tminHeight = Math.max( arr[ i ].minHeight || 0, minHeight );\n\t\t}\n\n\t\treturn { horizontal: minWidth, vertical: minHeight };\n\t},\n\n\t/**\n\t * Invoked when a splitter's dragListener fires dragStart. Calculates the splitters\n\t * movement area once (so that it doesn't need calculating on every mousemove event)\n\t *\n\t * @param {lm.controls.Splitter} splitter\n\t *\n\t * @returns {void}\n\t */\n\t_onSplitterDragStart: function( splitter ) {\n\t\tvar items = this._getItemsForSplitter( splitter ),\n\t\t\tminSize = this.layoutManager.config.dimensions[ this._isColumn ? 'minItemHeight' : 'minItemWidth' ];\n\n\t\tvar beforeMinDim = this._getMinimumDimensions( items.before.config.content );\n\t\tvar beforeMinSize = this._isColumn ? beforeMinDim.vertical : beforeMinDim.horizontal;\n\n\t\tvar afterMinDim = this._getMinimumDimensions( items.after.config.content );\n\t\tvar afterMinSize = this._isColumn ? afterMinDim.vertical : afterMinDim.horizontal;\n\n\t\tthis._splitterPosition = 0;\n\t\tthis._splitterMinPosition = -1 * ( items.before.element[ this._dimension ]() - (beforeMinSize || minSize) );\n\t\tthis._splitterMaxPosition = items.after.element[ this._dimension ]() - (afterMinSize || minSize);\n\t},\n\n\t/**\n\t * Invoked when a splitter's DragListener fires drag. Updates the splitters DOM position,\n\t * but not the sizes of the elements the splitter controls in order to minimize resize events\n\t *\n\t * @param {lm.controls.Splitter} splitter\n\t * @param {Int} offsetX Relative pixel values to the splitters original position. Can be negative\n\t * @param {Int} offsetY Relative pixel values to the splitters original position. Can be negative\n\t *\n\t * @returns {void}\n\t */\n\t_onSplitterDrag: function( splitter, offsetX, offsetY ) {\n\t\tvar offset = this._isColumn ? offsetY : offsetX;\n\n\t\tif( offset > this._splitterMinPosition && offset < this._splitterMaxPosition ) {\n\t\t\tthis._splitterPosition = offset;\n\t\t\tsplitter.element.css( this._isColumn ? 'top' : 'left', offset );\n\t\t}\n\t},\n\n\t/**\n\t * Invoked when a splitter's DragListener fires dragStop. Resets the splitters DOM position,\n\t * and applies the new sizes to the elements before and after the splitter and their children\n\t * on the next animation frame\n\t *\n\t * @param {lm.controls.Splitter} splitter\n\t *\n\t * @returns {void}\n\t */\n\t_onSplitterDragStop: function( splitter ) {\n\n\t\tvar items = this._getItemsForSplitter( splitter ),\n\t\t\tsizeBefore = items.before.element[ this._dimension ](),\n\t\t\tsizeAfter = items.after.element[ this._dimension ](),\n\t\t\tsplitterPositionInRange = ( this._splitterPosition + sizeBefore ) / ( sizeBefore + sizeAfter ),\n\t\t\ttotalRelativeSize = items.before.config[ this._dimension ] + items.after.config[ this._dimension ];\n\n\t\titems.before.config[ this._dimension ] = splitterPositionInRange * totalRelativeSize;\n\t\titems.after.config[ this._dimension ] = ( 1 - splitterPositionInRange ) * totalRelativeSize;\n\n\t\tsplitter.element.css( {\n\t\t\t'top': 0,\n\t\t\t'left': 0\n\t\t} );\n\n\t\tlm.utils.animFrame( lm.utils.fnBind( this.callDownwards, this, [ 'setSize' ] ) );\n\t}\n} );\n\nlm.items.Stack = function( layoutManager, config, parent ) {\n\tlm.items.AbstractContentItem.call( this, layoutManager, config, parent );\n\n\tthis.element = $( '
                    ' );\n\tthis._activeContentItem = null;\n\tvar cfg = layoutManager.config;\n\tthis._header = { // defaults' reconstruction from old configuration style\n\t\tshow: cfg.settings.hasHeaders === true && config.hasHeaders !== false,\n\t\tpopout: cfg.settings.showPopoutIcon && cfg.labels.popout,\n\t\tmaximise: cfg.settings.showMaximiseIcon && cfg.labels.maximise,\n\t\tclose: cfg.settings.showCloseIcon && cfg.labels.close,\n\t\tminimise: cfg.labels.minimise,\n\t};\n\tif( cfg.header ) // load simplified version of header configuration (https://github.com/deepstreamIO/golden-layout/pull/245)\n\t\tlm.utils.copy( this._header, cfg.header );\n\tif( config.header ) // load from stack\n\t\tlm.utils.copy( this._header, config.header );\n\tif( config.content && config.content[ 0 ] && config.content[ 0 ].header ) // load from component if stack omitted\n\t\tlm.utils.copy( this._header, config.content[ 0 ].header );\n\n\tthis._dropZones = {};\n\tthis._dropSegment = null;\n\tthis._contentAreaDimensions = null;\n\tthis._dropIndex = null;\n\n\tthis.isStack = true;\n\n\tthis.childElementContainer = $( '
                    ' );\n\tthis.header = new lm.controls.Header( layoutManager, this );\n\n\tthis.element.append( this.header.element );\n\tthis.element.append( this.childElementContainer );\n\tthis._setupHeaderPosition();\n\tthis._$validateClosability();\n};\n\nlm.utils.extend( lm.items.Stack, lm.items.AbstractContentItem );\n\nlm.utils.copy( lm.items.Stack.prototype, {\n\n\tsetSize: function() {\n\t\tvar i,\n\t\t\theaderSize = this._header.show ? this.layoutManager.config.dimensions.headerHeight : 0,\n\t\t\tcontentWidth = this.element.width() - (this._sided ? headerSize : 0),\n\t\t\tcontentHeight = this.element.height() - (!this._sided ? headerSize : 0);\n\n\t\tthis.childElementContainer.width( contentWidth );\n\t\tthis.childElementContainer.height( contentHeight );\n\n\t\tfor( i = 0; i < this.contentItems.length; i++ ) {\n\t\t\tthis.contentItems[ i ].element.width( contentWidth ).height( contentHeight );\n\t\t}\n\t\tthis.emit( 'resize' );\n\t\tthis.emitBubblingEvent( 'stateChanged' );\n\t},\n\n\t_$init: function() {\n\t\tvar i, initialItem;\n\n\t\tif( this.isInitialised === true ) return;\n\n\t\tlm.items.AbstractContentItem.prototype._$init.call( this );\n\n\t\tfor( i = 0; i < this.contentItems.length; i++ ) {\n\t\t\tthis.header.createTab( this.contentItems[ i ] );\n\t\t\tthis.contentItems[ i ]._$hide();\n\t\t}\n\n\t\tif( this.contentItems.length > 0 ) {\n\t\t\tinitialItem = this.contentItems[ this.config.activeItemIndex || 0 ];\n\n\t\t\tif( !initialItem ) {\n\t\t\t\tthrow new Error( 'Configured activeItemIndex out of bounds' );\n\t\t\t}\n\n\t\t\tthis.setActiveContentItem( initialItem );\n\t\t}\n\t},\n\n\tsetActiveContentItem: function( contentItem ) {\n\t\tif( lm.utils.indexOf( contentItem, this.contentItems ) === -1 ) {\n\t\t\tthrow new Error( 'contentItem is not a child of this stack' );\n\t\t}\n\n\t\tif( this._activeContentItem !== null ) {\n\t\t\tthis._activeContentItem._$hide();\n\t\t}\n\n\t\tthis._activeContentItem = contentItem;\n\t\tthis.header.setActiveContentItem( contentItem );\n\t\tcontentItem._$show();\n\t\tthis.emit( 'activeContentItemChanged', contentItem );\n\t\tthis.layoutManager.emit( 'activeContentItemChanged', contentItem );\n\t\tthis.emitBubblingEvent( 'stateChanged' );\n\t},\n\n\tgetActiveContentItem: function() {\n\t\treturn this.header.activeContentItem;\n\t},\n\n\taddChild: function( contentItem, index ) {\n\t\tcontentItem = this.layoutManager._$normalizeContentItem( contentItem, this );\n\t\tlm.items.AbstractContentItem.prototype.addChild.call( this, contentItem, index );\n\t\tthis.childElementContainer.append( contentItem.element );\n\t\tthis.header.createTab( contentItem, index );\n\t\tthis.setActiveContentItem( contentItem );\n\t\tthis.callDownwards( 'setSize' );\n\t\tthis._$validateClosability();\n\t\tthis.emitBubblingEvent( 'stateChanged' );\n\t},\n\n\tremoveChild: function( contentItem, keepChild ) {\n\t\tvar index = lm.utils.indexOf( contentItem, this.contentItems );\n\t\tlm.items.AbstractContentItem.prototype.removeChild.call( this, contentItem, keepChild );\n\t\tthis.header.removeTab( contentItem );\n\t\tif (this.header.activeContentItem === contentItem) {\n\t\t\tif (this.contentItems.length > 0) {\n\t\t\t\tthis.setActiveContentItem(this.contentItems[Math.max(index - 1, 0)]);\n\t\t\t} else {\n\t\t\t\tthis._activeContentItem = null;\n\t\t\t}\n\t\t}\n\n\t\tthis._$validateClosability();\n\t\tthis.emitBubblingEvent( 'stateChanged' );\n\t},\n\n\t/**\n\t * Validates that the stack is still closable or not. If a stack is able\n\t * to close, but has a non closable component added to it, the stack is no\n\t * longer closable until all components are closable.\n\t *\n\t * @returns {void}\n\t */\n\t_$validateClosability: function() {\n\t\tvar contentItem,\n\t\t\tisClosable,\n\t\t\tlen,\n\t\t\ti;\n\n\t\tisClosable = this.header._isClosable();\n\n\t\tfor( i = 0, len = this.contentItems.length; i < len; i++ ) {\n\t\t\tif( !isClosable ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tisClosable = this.contentItems[ i ].config.isClosable;\n\t\t}\n\n\t\tthis.header._$setClosable( isClosable );\n\t},\n\n\t_$destroy: function() {\n\t\tlm.items.AbstractContentItem.prototype._$destroy.call( this );\n\t\tthis.header._$destroy();\n\t},\n\n\n\t/**\n\t * Ok, this one is going to be the tricky one: The user has dropped {contentItem} onto this stack.\n\t *\n\t * It was dropped on either the stacks header or the top, right, bottom or left bit of the content area\n\t * (which one of those is stored in this._dropSegment). Now, if the user has dropped on the header the case\n\t * is relatively clear: We add the item to the existing stack... job done (might be good to have\n\t * tab reordering at some point, but lets not sweat it right now)\n\t *\n\t * If the item was dropped on the content part things are a bit more complicated. If it was dropped on either the\n\t * top or bottom region we need to create a new column and place the items accordingly.\n\t * Unless, of course if the stack is already within a column... in which case we want\n\t * to add the newly created item to the existing column...\n\t * either prepend or append it, depending on wether its top or bottom.\n\t *\n\t * Same thing for rows and left / right drop segments... so in total there are 9 things that can potentially happen\n\t * (left, top, right, bottom) * is child of the right parent (row, column) + header drop\n\t *\n\t * @param {lm.item} contentItem\n\t *\n\t * @returns {void}\n\t */\n\t_$onDrop: function( contentItem ) {\n\n\t\t/*\n\t\t * The item was dropped on the header area. Just add it as a child of this stack and\n\t\t * get the hell out of this logic\n\t\t */\n\t\tif( this._dropSegment === 'header' ) {\n\t\t\tthis._resetHeaderDropZone();\n\t\t\tthis.addChild( contentItem, this._dropIndex );\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * The stack is empty. Let's just add the element.\n\t\t */\n\t\tif( this._dropSegment === 'body' ) {\n\t\t\tthis.addChild( contentItem );\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * The item was dropped on the top-, left-, bottom- or right- part of the content. Let's\n\t\t * aggregate some conditions to make the if statements later on more readable\n\t\t */\n\t\tvar isVertical = this._dropSegment === 'top' || this._dropSegment === 'bottom',\n\t\t\tisHorizontal = this._dropSegment === 'left' || this._dropSegment === 'right',\n\t\t\tinsertBefore = this._dropSegment === 'top' || this._dropSegment === 'left',\n\t\t\thasCorrectParent = ( isVertical && this.parent.isColumn ) || ( isHorizontal && this.parent.isRow ),\n\t\t\ttype = isVertical ? 'column' : 'row',\n\t\t\tdimension = isVertical ? 'height' : 'width',\n\t\t\tindex,\n\t\t\tstack,\n\t\t\trowOrColumn;\n\n\t\t/*\n\t\t * The content item can be either a component or a stack. If it is a component, wrap it into a stack\n\t\t */\n\t\tif( contentItem.isComponent ) {\n\t\t\tstack = this.layoutManager.createContentItem( {\n\t\t\t\ttype: 'stack',\n\t\t\t\theader: contentItem.config.header || {}\n\t\t\t}, this );\n\t\t\tstack._$init();\n\t\t\tstack.addChild( contentItem );\n\t\t\tcontentItem = stack;\n\t\t}\n\n\t\t/*\n\t\t * If the item is dropped on top or bottom of a column or left and right of a row, it's already\n\t\t * layd out in the correct way. Just add it as a child\n\t\t */\n\t\tif( hasCorrectParent ) {\n\t\t\tindex = lm.utils.indexOf( this, this.parent.contentItems );\n\t\t\tthis.parent.addChild( contentItem, insertBefore ? index : index + 1, true );\n\t\t\tthis.config[ dimension ] *= 0.5;\n\t\t\tcontentItem.config[ dimension ] = this.config[ dimension ];\n\t\t\tthis.parent.callDownwards( 'setSize' );\n\t\t\t/*\n\t\t\t * This handles items that are dropped on top or bottom of a row or left / right of a column. We need\n\t\t\t * to create the appropriate contentItem for them to live in\n\t\t\t */\n\t\t} else {\n\t\t\ttype = isVertical ? 'column' : 'row';\n\t\t\trowOrColumn = this.layoutManager.createContentItem( { type: type }, this );\n\t\t\tthis.parent.replaceChild( this, rowOrColumn );\n\n\t\t\trowOrColumn.addChild( contentItem, insertBefore ? 0 : undefined, true );\n\t\t\trowOrColumn.addChild( this, insertBefore ? undefined : 0, true );\n\n\t\t\tthis.config[ dimension ] = 50;\n\t\t\tcontentItem.config[ dimension ] = 50;\n\t\t\trowOrColumn.callDownwards( 'setSize' );\n\t\t}\n\t},\n\n\t/**\n\t * If the user hovers above the header part of the stack, indicate drop positions for tabs.\n\t * otherwise indicate which segment of the body the dragged item would be dropped on\n\t *\n\t * @param {Int} x Absolute Screen X\n\t * @param {Int} y Absolute Screen Y\n\t *\n\t * @returns {void}\n\t */\n\t_$highlightDropZone: function( x, y ) {\n\t\tvar segment, area;\n\n\t\tfor( segment in this._contentAreaDimensions ) {\n\t\t\tarea = this._contentAreaDimensions[ segment ].hoverArea;\n\n\t\t\tif( area.x1 < x && area.x2 > x && area.y1 < y && area.y2 > y ) {\n\n\t\t\t\tif( segment === 'header' ) {\n\t\t\t\t\tthis._dropSegment = 'header';\n\t\t\t\t\tthis._highlightHeaderDropZone( this._sided ? y : x );\n\t\t\t\t} else {\n\t\t\t\t\tthis._resetHeaderDropZone();\n\t\t\t\t\tthis._highlightBodyDropZone( segment );\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t},\n\n\t_$getArea: function() {\n\t\tif( this.element.is( ':visible' ) === false ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tvar getArea = lm.items.AbstractContentItem.prototype._$getArea,\n\t\t\theaderArea = getArea.call( this, this.header.element ),\n\t\t\tcontentArea = getArea.call( this, this.childElementContainer ),\n\t\t\tcontentWidth = contentArea.x2 - contentArea.x1,\n\t\t\tcontentHeight = contentArea.y2 - contentArea.y1;\n\n\t\tthis._contentAreaDimensions = {\n\t\t\theader: {\n\t\t\t\thoverArea: {\n\t\t\t\t\tx1: headerArea.x1,\n\t\t\t\t\ty1: headerArea.y1,\n\t\t\t\t\tx2: headerArea.x2,\n\t\t\t\t\ty2: headerArea.y2\n\t\t\t\t},\n\t\t\t\thighlightArea: {\n\t\t\t\t\tx1: headerArea.x1,\n\t\t\t\t\ty1: headerArea.y1,\n\t\t\t\t\tx2: headerArea.x2,\n\t\t\t\t\ty2: headerArea.y2\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * If this Stack is a parent to rows, columns or other stacks only its\n\t\t * header is a valid dropzone.\n\t\t */\n\t\tif( this._activeContentItem && this._activeContentItem.isComponent === false ) {\n\t\t\treturn headerArea;\n\t\t}\n\n\t\t/**\n\t\t * Highlight the entire body if the stack is empty\n\t\t */\n\t\tif( this.contentItems.length === 0 ) {\n\n\t\t\tthis._contentAreaDimensions.body = {\n\t\t\t\thoverArea: {\n\t\t\t\t\tx1: contentArea.x1,\n\t\t\t\t\ty1: contentArea.y1,\n\t\t\t\t\tx2: contentArea.x2,\n\t\t\t\t\ty2: contentArea.y2\n\t\t\t\t},\n\t\t\t\thighlightArea: {\n\t\t\t\t\tx1: contentArea.x1,\n\t\t\t\t\ty1: contentArea.y1,\n\t\t\t\t\tx2: contentArea.x2,\n\t\t\t\t\ty2: contentArea.y2\n\t\t\t\t}\n\t\t\t};\n\n\t\t\treturn getArea.call( this, this.element );\n\t\t}\n\n\t\tthis._contentAreaDimensions.left = {\n\t\t\thoverArea: {\n\t\t\t\tx1: contentArea.x1,\n\t\t\t\ty1: contentArea.y1,\n\t\t\t\tx2: contentArea.x1 + contentWidth * 0.25,\n\t\t\t\ty2: contentArea.y2\n\t\t\t},\n\t\t\thighlightArea: {\n\t\t\t\tx1: contentArea.x1,\n\t\t\t\ty1: contentArea.y1,\n\t\t\t\tx2: contentArea.x1 + contentWidth * 0.5,\n\t\t\t\ty2: contentArea.y2\n\t\t\t}\n\t\t};\n\n\t\tthis._contentAreaDimensions.top = {\n\t\t\thoverArea: {\n\t\t\t\tx1: contentArea.x1 + contentWidth * 0.25,\n\t\t\t\ty1: contentArea.y1,\n\t\t\t\tx2: contentArea.x1 + contentWidth * 0.75,\n\t\t\t\ty2: contentArea.y1 + contentHeight * 0.5\n\t\t\t},\n\t\t\thighlightArea: {\n\t\t\t\tx1: contentArea.x1,\n\t\t\t\ty1: contentArea.y1,\n\t\t\t\tx2: contentArea.x2,\n\t\t\t\ty2: contentArea.y1 + contentHeight * 0.5\n\t\t\t}\n\t\t};\n\n\t\tthis._contentAreaDimensions.right = {\n\t\t\thoverArea: {\n\t\t\t\tx1: contentArea.x1 + contentWidth * 0.75,\n\t\t\t\ty1: contentArea.y1,\n\t\t\t\tx2: contentArea.x2,\n\t\t\t\ty2: contentArea.y2\n\t\t\t},\n\t\t\thighlightArea: {\n\t\t\t\tx1: contentArea.x1 + contentWidth * 0.5,\n\t\t\t\ty1: contentArea.y1,\n\t\t\t\tx2: contentArea.x2,\n\t\t\t\ty2: contentArea.y2\n\t\t\t}\n\t\t};\n\n\t\tthis._contentAreaDimensions.bottom = {\n\t\t\thoverArea: {\n\t\t\t\tx1: contentArea.x1 + contentWidth * 0.25,\n\t\t\t\ty1: contentArea.y1 + contentHeight * 0.5,\n\t\t\t\tx2: contentArea.x1 + contentWidth * 0.75,\n\t\t\t\ty2: contentArea.y2\n\t\t\t},\n\t\t\thighlightArea: {\n\t\t\t\tx1: contentArea.x1,\n\t\t\t\ty1: contentArea.y1 + contentHeight * 0.5,\n\t\t\t\tx2: contentArea.x2,\n\t\t\t\ty2: contentArea.y2\n\t\t\t}\n\t\t};\n\n\t\treturn getArea.call( this, this.element );\n\t},\n\n\t_highlightHeaderDropZone: function( x ) {\n\t\tvar i,\n\t\t\ttabElement,\n\t\t\ttabsLength = this.header.tabs.length,\n\t\t\tisAboveTab = false,\n\t\t\ttabTop,\n\t\t\ttabLeft,\n\t\t\toffset,\n\t\t\tplaceHolderLeft,\n\t\t\theaderOffset,\n\t\t\ttabWidth,\n\t\t\thalfX;\n\n\t\t// Empty stack\n\t\tif( tabsLength === 0 ) {\n\t\t\theaderOffset = this.header.element.offset();\n\n\t\t\tthis.layoutManager.dropTargetIndicator.highlightArea( {\n\t\t\t\tx1: headerOffset.left,\n\t\t\t\tx2: headerOffset.left + 100,\n\t\t\t\ty1: headerOffset.top + this.header.element.height() - 20,\n\t\t\t\ty2: headerOffset.top + this.header.element.height()\n\t\t\t} );\n\n\t\t\treturn;\n\t\t}\n\n\t\tfor( i = 0; i < tabsLength; i++ ) {\n\t\t\ttabElement = this.header.tabs[ i ].element;\n\t\t\toffset = tabElement.offset();\n\t\t\tif( this._sided ) {\n\t\t\t\ttabLeft = offset.top;\n\t\t\t\ttabTop = offset.left;\n\t\t\t\ttabWidth = tabElement.height();\n\t\t\t} else {\n\t\t\t\ttabLeft = offset.left;\n\t\t\t\ttabTop = offset.top;\n\t\t\t\ttabWidth = tabElement.width();\n\t\t\t}\n\n\t\t\tif( x > tabLeft && x < tabLeft + tabWidth ) {\n\t\t\t\tisAboveTab = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif( isAboveTab === false && x < tabLeft ) {\n\t\t\treturn;\n\t\t}\n\n\t\thalfX = tabLeft + tabWidth / 2;\n\n\t\tif( x < halfX ) {\n\t\t\tthis._dropIndex = i;\n\t\t\ttabElement.before( this.layoutManager.tabDropPlaceholder );\n\t\t} else {\n\t\t\tthis._dropIndex = Math.min( i + 1, tabsLength );\n\t\t\ttabElement.after( this.layoutManager.tabDropPlaceholder );\n\t\t}\n\n\n\t\tif( this._sided ) {\n\t\t\tplaceHolderTop = this.layoutManager.tabDropPlaceholder.offset().top;\n\t\t\tthis.layoutManager.dropTargetIndicator.highlightArea( {\n\t\t\t\tx1: tabTop,\n\t\t\t\tx2: tabTop + tabElement.innerHeight(),\n\t\t\t\ty1: placeHolderTop,\n\t\t\t\ty2: placeHolderTop + this.layoutManager.tabDropPlaceholder.width()\n\t\t\t} );\n\t\t\treturn;\n\t\t}\n\t\tplaceHolderLeft = this.layoutManager.tabDropPlaceholder.offset().left;\n\n\t\tthis.layoutManager.dropTargetIndicator.highlightArea( {\n\t\t\tx1: placeHolderLeft,\n\t\t\tx2: placeHolderLeft + this.layoutManager.tabDropPlaceholder.width(),\n\t\t\ty1: tabTop,\n\t\t\ty2: tabTop + tabElement.innerHeight()\n\t\t} );\n\t},\n\n\t_resetHeaderDropZone: function() {\n\t\tthis.layoutManager.tabDropPlaceholder.remove();\n\t},\n\n\t_setupHeaderPosition: function() {\n\t\tvar side = [ 'right', 'left', 'bottom' ].indexOf( this._header.show ) >= 0 && this._header.show;\n\t\tthis.header.element.toggle( !!this._header.show );\n\t\tthis._side = side;\n\t\tthis._sided = [ 'right', 'left' ].indexOf( this._side ) >= 0;\n\t\tthis.element.removeClass( 'lm_left lm_right lm_bottom' );\n\t\tif( this._side )\n\t\t\tthis.element.addClass( 'lm_' + this._side );\n\t\tif( this.element.find( '.lm_header' ).length && this.childElementContainer ) {\n\t\t\tvar headerPosition = [ 'right', 'bottom' ].indexOf( this._side ) >= 0 ? 'before' : 'after';\n\t\t\tthis.header.element[ headerPosition ]( this.childElementContainer );\n\t\t\tthis.callDownwards( 'setSize' );\n\t\t}\n\t},\n\n\t_highlightBodyDropZone: function( segment ) {\n\t\tvar highlightArea = this._contentAreaDimensions[ segment ].highlightArea;\n\t\tthis.layoutManager.dropTargetIndicator.highlightArea( highlightArea );\n\t\tthis._dropSegment = segment;\n\t}\n} );\n\nlm.utils.BubblingEvent = function( name, origin ) {\n\tthis.name = name;\n\tthis.origin = origin;\n\tthis.isPropagationStopped = false;\n};\n\nlm.utils.BubblingEvent.prototype.stopPropagation = function() {\n\tthis.isPropagationStopped = true;\n};\n/**\n * Minifies and unminifies configs by replacing frequent keys\n * and values with one letter substitutes. Config options must\n * retain array position/index, add new options at the end.\n *\n * @constructor\n */\nlm.utils.ConfigMinifier = function() {\n\tthis._keys = [\n\t\t'settings',\n\t\t'hasHeaders',\n\t\t'constrainDragToContainer',\n\t\t'selectionEnabled',\n\t\t'dimensions',\n\t\t'borderWidth',\n\t\t'minItemHeight',\n\t\t'minItemWidth',\n\t\t'headerHeight',\n\t\t'dragProxyWidth',\n\t\t'dragProxyHeight',\n\t\t'labels',\n\t\t'close',\n\t\t'maximise',\n\t\t'minimise',\n\t\t'popout',\n\t\t'content',\n\t\t'componentName',\n\t\t'componentState',\n\t\t'id',\n\t\t'width',\n\t\t'type',\n\t\t'height',\n\t\t'isClosable',\n\t\t'title',\n\t\t'popoutWholeStack',\n\t\t'openPopouts',\n\t\t'parentId',\n\t\t'activeItemIndex',\n\t\t'reorderEnabled',\n\t\t'borderGrabWidth',\n\n\n\n\n\t\t//Maximum 36 entries, do not cross this line!\n\t];\n\tif( this._keys.length > 36 ) {\n\t\tthrow new Error( 'Too many keys in config minifier map' );\n\t}\n\n\tthis._values = [\n\t\ttrue,\n\t\tfalse,\n\t\t'row',\n\t\t'column',\n\t\t'stack',\n\t\t'component',\n\t\t'close',\n\t\t'maximise',\n\t\t'minimise',\n\t\t'open in new window'\n\t];\n};\n\nlm.utils.copy( lm.utils.ConfigMinifier.prototype, {\n\n\t/**\n\t * Takes a GoldenLayout configuration object and\n\t * replaces its keys and values recursively with\n\t * one letter counterparts\n\t *\n\t * @param {Object} config A GoldenLayout config object\n\t *\n\t * @returns {Object} minified config\n\t */\n\tminifyConfig: function( config ) {\n\t\tvar min = {};\n\t\tthis._nextLevel( config, min, '_min' );\n\t\treturn min;\n\t},\n\n\t/**\n\t * Takes a configuration Object that was previously minified\n\t * using minifyConfig and returns its original version\n\t *\n\t * @param {Object} minifiedConfig\n\t *\n\t * @returns {Object} the original configuration\n\t */\n\tunminifyConfig: function( minifiedConfig ) {\n\t\tvar orig = {};\n\t\tthis._nextLevel( minifiedConfig, orig, '_max' );\n\t\treturn orig;\n\t},\n\n\t/**\n\t * Recursive function, called for every level of the config structure\n\t *\n\t * @param {Array|Object} orig\n\t * @param {Array|Object} min\n\t * @param {String} translationFn\n\t *\n\t * @returns {void}\n\t */\n\t_nextLevel: function( from, to, translationFn ) {\n\t\tvar key, minKey;\n\n\t\tfor( key in from ) {\n\n\t\t\t/**\n\t\t\t * For in returns array indices as keys, so let's cast them to numbers\n\t\t\t */\n\t\t\tif( from instanceof Array ) key = parseInt( key, 10 );\n\n\t\t\t/**\n\t\t\t * In case something has extended Object prototypes\n\t\t\t */\n\t\t\tif( !from.hasOwnProperty( key ) ) continue;\n\n\t\t\t/**\n\t\t\t * Translate the key to a one letter substitute\n\t\t\t */\n\t\t\tminKey = this[ translationFn ]( key, this._keys );\n\n\t\t\t/**\n\t\t\t * For Arrays and Objects, create a new Array/Object\n\t\t\t * on the minified object and recurse into it\n\t\t\t */\n\t\t\tif( typeof from[ key ] === 'object' ) {\n\t\t\t\tto[ minKey ] = from[ key ] instanceof Array ? [] : {};\n\t\t\t\tthis._nextLevel( from[ key ], to[ minKey ], translationFn );\n\n\t\t\t\t/**\n\t\t\t\t * For primitive values (Strings, Numbers, Boolean etc.)\n\t\t\t\t * minify the value\n\t\t\t\t */\n\t\t\t} else {\n\t\t\t\tto[ minKey ] = this[ translationFn ]( from[ key ], this._values );\n\t\t\t}\n\t\t}\n\t},\n\n\t/**\n\t * Minifies value based on a dictionary\n\t *\n\t * @param {String|Boolean} value\n\t * @param {Array} dictionary\n\t *\n\t * @returns {String} The minified version\n\t */\n\t_min: function( value, dictionary ) {\n\t\t/**\n\t\t * If a value actually is a single character, prefix it\n\t\t * with ___ to avoid mistaking it for a minification code\n\t\t */\n\t\tif( typeof value === 'string' && value.length === 1 ) {\n\t\t\treturn '___' + value;\n\t\t}\n\n\t\tvar index = lm.utils.indexOf( value, dictionary );\n\n\t\t/**\n\t\t * value not found in the dictionary, return it unmodified\n\t\t */\n\t\tif( index === -1 ) {\n\t\t\treturn value;\n\n\t\t\t/**\n\t\t\t * value found in dictionary, return its base36 counterpart\n\t\t\t */\n\t\t} else {\n\t\t\treturn index.toString( 36 );\n\t\t}\n\t},\n\n\t_max: function( value, dictionary ) {\n\t\t/**\n\t\t * value is a single character. Assume that it's a translation\n\t\t * and return the original value from the dictionary\n\t\t */\n\t\tif( typeof value === 'string' && value.length === 1 ) {\n\t\t\treturn dictionary[ parseInt( value, 36 ) ];\n\t\t}\n\n\t\t/**\n\t\t * value originally was a single character and was prefixed with ___\n\t\t * to avoid mistaking it for a translation. Remove the prefix\n\t\t * and return the original character\n\t\t */\n\t\tif( typeof value === 'string' && value.substr( 0, 3 ) === '___' ) {\n\t\t\treturn value[ 3 ];\n\t\t}\n\t\t/**\n\t\t * value was not minified\n\t\t */\n\t\treturn value;\n\t}\n} );\n\n/**\n * An EventEmitter singleton that propagates events\n * across multiple windows. This is a little bit trickier since\n * windows are allowed to open childWindows in their own right\n *\n * This means that we deal with a tree of windows. Hence the rules for event propagation are:\n *\n * - Propagate events from this layout to both parents and children\n * - Propagate events from parent to this and children\n * - Propagate events from children to the other children (but not the emitting one) and the parent\n *\n * @constructor\n *\n * @param {lm.LayoutManager} layoutManager\n */\nlm.utils.EventHub = function( layoutManager ) {\n\tlm.utils.EventEmitter.call( this );\n\tthis._layoutManager = layoutManager;\n\tthis._dontPropagateToParent = null;\n\tthis._childEventSource = null;\n\tthis.on( lm.utils.EventEmitter.ALL_EVENT, lm.utils.fnBind( this._onEventFromThis, this ) );\n\tthis._boundOnEventFromChild = lm.utils.fnBind( this._onEventFromChild, this );\n\t$( window ).on( 'gl_child_event', this._boundOnEventFromChild );\n};\n\n/**\n * Called on every event emitted on this eventHub, regardles of origin.\n *\n * @private\n *\n * @param {Mixed}\n *\n * @returns {void}\n */\nlm.utils.EventHub.prototype._onEventFromThis = function() {\n\tvar args = Array.prototype.slice.call( arguments );\n\n\tif( this._layoutManager.isSubWindow && args[ 0 ] !== this._dontPropagateToParent ) {\n\t\tthis._propagateToParent( args );\n\t}\n\tthis._propagateToChildren( args );\n\n\t//Reset\n\tthis._dontPropagateToParent = null;\n\tthis._childEventSource = null;\n};\n\n/**\n * Called by the parent layout.\n *\n * @param {Array} args Event name + arguments\n *\n * @returns {void}\n */\nlm.utils.EventHub.prototype._$onEventFromParent = function( args ) {\n\tthis._dontPropagateToParent = args[ 0 ];\n\tthis.emit.apply( this, args );\n};\n\n/**\n * Callback for child events raised on the window\n *\n * @param {DOMEvent} event\n * @private\n *\n * @returns {void}\n */\nlm.utils.EventHub.prototype._onEventFromChild = function( event ) {\n\tthis._childEventSource = event.originalEvent.__gl;\n\tthis.emit.apply( this, event.originalEvent.__glArgs );\n};\n\n/**\n * Propagates the event to the parent by emitting\n * it on the parent's DOM window\n *\n * @param {Array} args Event name + arguments\n * @private\n *\n * @returns {void}\n */\nlm.utils.EventHub.prototype._propagateToParent = function( args ) {\n\tvar event,\n\t\teventName = 'gl_child_event';\n\n\tif( document.createEvent ) {\n\t\tevent = window.opener.document.createEvent( 'HTMLEvents' );\n\t\tevent.initEvent( eventName, true, true );\n\t} else {\n\t\tevent = window.opener.document.createEventObject();\n\t\tevent.eventType = eventName;\n\t}\n\n\tevent.eventName = eventName;\n\tevent.__glArgs = args;\n\tevent.__gl = this._layoutManager;\n\n\tif( document.createEvent ) {\n\t\twindow.opener.dispatchEvent( event );\n\t} else {\n\t\twindow.opener.fireEvent( 'on' + event.eventType, event );\n\t}\n};\n\n/**\n * Propagate events to children\n *\n * @param {Array} args Event name + arguments\n * @private\n *\n * @returns {void}\n */\nlm.utils.EventHub.prototype._propagateToChildren = function( args ) {\n\tvar childGl, i;\n\n\tfor( i = 0; i < this._layoutManager.openPopouts.length; i++ ) {\n\t\tchildGl = this._layoutManager.openPopouts[ i ].getGlInstance();\n\n\t\tif( childGl && childGl !== this._childEventSource ) {\n\t\t\tchildGl.eventHub._$onEventFromParent( args );\n\t\t}\n\t}\n};\n\n\n/**\n * Destroys the EventHub\n *\n * @public\n * @returns {void}\n */\n\nlm.utils.EventHub.prototype.destroy = function() {\n\t$( window ).off( 'gl_child_event', this._boundOnEventFromChild );\n};\n/**\n * A specialised GoldenLayout component that binds GoldenLayout container\n * lifecycle events to react components\n *\n * @constructor\n *\n * @param {lm.container.ItemContainer} container\n * @param {Object} state state is not required for react components\n */\nlm.utils.ReactComponentHandler = function( container, state ) {\n\tthis._reactComponent = null;\n\tthis._originalComponentWillUpdate = null;\n\tthis._container = container;\n\tthis._initialState = state;\n\tthis._reactClass = this._getReactClass();\n\tthis._container.on( 'open', this._render, this );\n\tthis._container.on( 'destroy', this._destroy, this );\n};\n\nlm.utils.copy( lm.utils.ReactComponentHandler.prototype, {\n\n\t/**\n\t * Creates the react class and component and hydrates it with\n\t * the initial state - if one is present\n\t *\n\t * By default, react's getInitialState will be used\n\t *\n\t * @private\n\t * @returns {void}\n\t */\n\t_render: function() {\n\t\tthis._reactComponent = ReactDOM.render( this._getReactComponent(), this._container.getElement()[ 0 ] );\n\t\tthis._originalComponentWillUpdate = this._reactComponent.componentWillUpdate || function() {\n\t\t\t};\n\t\tthis._reactComponent.componentWillUpdate = this._onUpdate.bind( this );\n\t\tif( this._container.getState() ) {\n\t\t\tthis._reactComponent.setState( this._container.getState() );\n\t\t}\n\t},\n\n\t/**\n\t * Removes the component from the DOM and thus invokes React's unmount lifecycle\n\t *\n\t * @private\n\t * @returns {void}\n\t */\n\t_destroy: function() {\n\t\tReactDOM.unmountComponentAtNode( this._container.getElement()[ 0 ] );\n\t\tthis._container.off( 'open', this._render, this );\n\t\tthis._container.off( 'destroy', this._destroy, this );\n\t},\n\n\t/**\n\t * Hooks into React's state management and applies the componentstate\n\t * to GoldenLayout\n\t *\n\t * @private\n\t * @returns {void}\n\t */\n\t_onUpdate: function( nextProps, nextState ) {\n\t\tthis._container.setState( nextState );\n\t\tthis._originalComponentWillUpdate.call( this._reactComponent, nextProps, nextState );\n\t},\n\n\t/**\n\t * Retrieves the react class from GoldenLayout's registry\n\t *\n\t * @private\n\t * @returns {React.Class}\n\t */\n\t_getReactClass: function() {\n\t\tvar componentName = this._container._config.component;\n\t\tvar reactClass;\n\n\t\tif( !componentName ) {\n\t\t\tthrow new Error( 'No react component name. type: react-component needs a field `component`' );\n\t\t}\n\n\t\treactClass = this._container.layoutManager.getComponent( componentName );\n\n\t\tif( !reactClass ) {\n\t\t\tthrow new Error( 'React component \"' + componentName + '\" not found. ' +\n\t\t\t\t'Please register all components with GoldenLayout using `registerComponent(name, component)`' );\n\t\t}\n\n\t\treturn reactClass;\n\t},\n\n\t/**\n\t * Copies and extends the properties array and returns the React element\n\t *\n\t * @private\n\t * @returns {React.Element}\n\t */\n\t_getReactComponent: function() {\n\t\tvar defaultProps = {\n\t\t\tglEventHub: this._container.layoutManager.eventHub,\n\t\t\tglContainer: this._container,\n\t\t};\n\t\tvar props = $.extend( defaultProps, this._container._config.props );\n\t\treturn React.createElement( this._reactClass, props );\n\t}\n} );})(window.$);","/* eslint indent: [\"error\", 2] */\r\n\r\n// import GoldenLayout from \"./golden/js/goldenlayout.js\";\r\nimport GoldenLayout from \"golden-layout\";\r\n\r\nconst config = {\r\n settings: {\r\n showPopoutIcon: false,\r\n showCloseIcon: false\r\n },\r\n dimensions: {\r\n minItemHeight: 40\r\n },\r\n content: [{\r\n type: \"row\",\r\n content: [{\r\n type: \"column\",\r\n width: 40,\r\n content: [{\r\n type: \"component\",\r\n componentName: \"template\",\r\n title: \"Game\",\r\n componentState: { id: \"client_wrapper\" }\r\n }]\r\n },\r\n {\r\n type: \"column\",\r\n content: [{\r\n type: \"row\",\r\n height: 65,\r\n content: [{\r\n type: \"stack\",\r\n content: [{\r\n type: \"component\",\r\n title: \"Main\",\r\n componentName: \"template\",\r\n componentState: { id: \"mainmenu\" }\r\n },\r\n {\r\n type: \"component\",\r\n title: \"Log\",\r\n componentName: \"template\",\r\n componentState: { id: \"log\" }\r\n }]\r\n },\r\n {\r\n type: \"component\",\r\n title: \"Music\",\r\n width: 30,\r\n componentName: \"template\",\r\n componentState: { id: \"music\" }\r\n }]\r\n },\r\n {\r\n type: \"row\",\r\n content: [{\r\n type: \"component\",\r\n title: \"Server chat\",\r\n componentName: \"template\",\r\n componentState: { id: \"ooc\" }\r\n }]\r\n }]\r\n }]\r\n }]\r\n};\r\n\r\nconst golden = new GoldenLayout(config);\r\ngolden.registerComponent(\"template\", function (container, componentState) {\r\n const template = document.querySelector(`#${componentState.id}`);\r\n container.getElement().html(template.content);\r\n // TODO: support multiple locales\r\n // container.setTitle(document.querySelector(`#${componentState.id} meta[name='frame-title']`).getAttribute(\"content\"));\r\n});\r\n\r\ngolden.init();","/*!\n * jQuery JavaScript Library v3.5.1\n * https://jquery.com/\n *\n * Includes Sizzle.js\n * https://sizzlejs.com/\n *\n * Copyright JS Foundation and other contributors\n * Released under the MIT license\n * https://jquery.org/license\n *\n * Date: 2020-05-04T22:49Z\n */\n( function( global, factory ) {\n\n\t\"use strict\";\n\n\tif ( typeof module === \"object\" && typeof module.exports === \"object\" ) {\n\n\t\t// For CommonJS and CommonJS-like environments where a proper `window`\n\t\t// is present, execute the factory and get jQuery.\n\t\t// For environments that do not have a `window` with a `document`\n\t\t// (such as Node.js), expose a factory as module.exports.\n\t\t// This accentuates the need for the creation of a real `window`.\n\t\t// e.g. var jQuery = require(\"jquery\")(window);\n\t\t// See ticket #14549 for more info.\n\t\tmodule.exports = global.document ?\n\t\t\tfactory( global, true ) :\n\t\t\tfunction( w ) {\n\t\t\t\tif ( !w.document ) {\n\t\t\t\t\tthrow new Error( \"jQuery requires a window with a document\" );\n\t\t\t\t}\n\t\t\t\treturn factory( w );\n\t\t\t};\n\t} else {\n\t\tfactory( global );\n\t}\n\n// Pass this if window is not defined yet\n} )( typeof window !== \"undefined\" ? window : this, function( window, noGlobal ) {\n\n// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1\n// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode\n// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common\n// enough that all such attempts are guarded in a try block.\n\"use strict\";\n\nvar arr = [];\n\nvar getProto = Object.getPrototypeOf;\n\nvar slice = arr.slice;\n\nvar flat = arr.flat ? function( array ) {\n\treturn arr.flat.call( array );\n} : function( array ) {\n\treturn arr.concat.apply( [], array );\n};\n\n\nvar push = arr.push;\n\nvar indexOf = arr.indexOf;\n\nvar class2type = {};\n\nvar toString = class2type.toString;\n\nvar hasOwn = class2type.hasOwnProperty;\n\nvar fnToString = hasOwn.toString;\n\nvar ObjectFunctionString = fnToString.call( Object );\n\nvar support = {};\n\nvar isFunction = function isFunction( obj ) {\n\n // Support: Chrome <=57, Firefox <=52\n // In some browsers, typeof returns \"function\" for HTML elements\n // (i.e., `typeof document.createElement( \"object\" ) === \"function\"`).\n // We don't want to classify *any* DOM node as a function.\n return typeof obj === \"function\" && typeof obj.nodeType !== \"number\";\n };\n\n\nvar isWindow = function isWindow( obj ) {\n\t\treturn obj != null && obj === obj.window;\n\t};\n\n\nvar document = window.document;\n\n\n\n\tvar preservedScriptAttributes = {\n\t\ttype: true,\n\t\tsrc: true,\n\t\tnonce: true,\n\t\tnoModule: true\n\t};\n\n\tfunction DOMEval( code, node, doc ) {\n\t\tdoc = doc || document;\n\n\t\tvar i, val,\n\t\t\tscript = doc.createElement( \"script\" );\n\n\t\tscript.text = code;\n\t\tif ( node ) {\n\t\t\tfor ( i in preservedScriptAttributes ) {\n\n\t\t\t\t// Support: Firefox 64+, Edge 18+\n\t\t\t\t// Some browsers don't support the \"nonce\" property on scripts.\n\t\t\t\t// On the other hand, just using `getAttribute` is not enough as\n\t\t\t\t// the `nonce` attribute is reset to an empty string whenever it\n\t\t\t\t// becomes browsing-context connected.\n\t\t\t\t// See https://github.com/whatwg/html/issues/2369\n\t\t\t\t// See https://html.spec.whatwg.org/#nonce-attributes\n\t\t\t\t// The `node.getAttribute` check was added for the sake of\n\t\t\t\t// `jQuery.globalEval` so that it can fake a nonce-containing node\n\t\t\t\t// via an object.\n\t\t\t\tval = node[ i ] || node.getAttribute && node.getAttribute( i );\n\t\t\t\tif ( val ) {\n\t\t\t\t\tscript.setAttribute( i, val );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdoc.head.appendChild( script ).parentNode.removeChild( script );\n\t}\n\n\nfunction toType( obj ) {\n\tif ( obj == null ) {\n\t\treturn obj + \"\";\n\t}\n\n\t// Support: Android <=2.3 only (functionish RegExp)\n\treturn typeof obj === \"object\" || typeof obj === \"function\" ?\n\t\tclass2type[ toString.call( obj ) ] || \"object\" :\n\t\ttypeof obj;\n}\n/* global Symbol */\n// Defining this global in .eslintrc.json would create a danger of using the global\n// unguarded in another place, it seems safer to define global only for this module\n\n\n\nvar\n\tversion = \"3.5.1\",\n\n\t// Define a local copy of jQuery\n\tjQuery = function( selector, context ) {\n\n\t\t// The jQuery object is actually just the init constructor 'enhanced'\n\t\t// Need init if jQuery is called (just allow error to be thrown if not included)\n\t\treturn new jQuery.fn.init( selector, context );\n\t};\n\njQuery.fn = jQuery.prototype = {\n\n\t// The current version of jQuery being used\n\tjquery: version,\n\n\tconstructor: jQuery,\n\n\t// The default length of a jQuery object is 0\n\tlength: 0,\n\n\ttoArray: function() {\n\t\treturn slice.call( this );\n\t},\n\n\t// Get the Nth element in the matched element set OR\n\t// Get the whole matched element set as a clean array\n\tget: function( num ) {\n\n\t\t// Return all the elements in a clean array\n\t\tif ( num == null ) {\n\t\t\treturn slice.call( this );\n\t\t}\n\n\t\t// Return just the one element from the set\n\t\treturn num < 0 ? this[ num + this.length ] : this[ num ];\n\t},\n\n\t// Take an array of elements and push it onto the stack\n\t// (returning the new matched element set)\n\tpushStack: function( elems ) {\n\n\t\t// Build a new jQuery matched element set\n\t\tvar ret = jQuery.merge( this.constructor(), elems );\n\n\t\t// Add the old object onto the stack (as a reference)\n\t\tret.prevObject = this;\n\n\t\t// Return the newly-formed element set\n\t\treturn ret;\n\t},\n\n\t// Execute a callback for every element in the matched set.\n\teach: function( callback ) {\n\t\treturn jQuery.each( this, callback );\n\t},\n\n\tmap: function( callback ) {\n\t\treturn this.pushStack( jQuery.map( this, function( elem, i ) {\n\t\t\treturn callback.call( elem, i, elem );\n\t\t} ) );\n\t},\n\n\tslice: function() {\n\t\treturn this.pushStack( slice.apply( this, arguments ) );\n\t},\n\n\tfirst: function() {\n\t\treturn this.eq( 0 );\n\t},\n\n\tlast: function() {\n\t\treturn this.eq( -1 );\n\t},\n\n\teven: function() {\n\t\treturn this.pushStack( jQuery.grep( this, function( _elem, i ) {\n\t\t\treturn ( i + 1 ) % 2;\n\t\t} ) );\n\t},\n\n\todd: function() {\n\t\treturn this.pushStack( jQuery.grep( this, function( _elem, i ) {\n\t\t\treturn i % 2;\n\t\t} ) );\n\t},\n\n\teq: function( i ) {\n\t\tvar len = this.length,\n\t\t\tj = +i + ( i < 0 ? len : 0 );\n\t\treturn this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );\n\t},\n\n\tend: function() {\n\t\treturn this.prevObject || this.constructor();\n\t},\n\n\t// For internal use only.\n\t// Behaves like an Array's method, not like a jQuery method.\n\tpush: push,\n\tsort: arr.sort,\n\tsplice: arr.splice\n};\n\njQuery.extend = jQuery.fn.extend = function() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\t\ttarget = arguments[ 0 ] || {},\n\t\ti = 1,\n\t\tlength = arguments.length,\n\t\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif ( typeof target === \"boolean\" ) {\n\t\tdeep = target;\n\n\t\t// Skip the boolean and the target\n\t\ttarget = arguments[ i ] || {};\n\t\ti++;\n\t}\n\n\t// Handle case when target is a string or something (possible in deep copy)\n\tif ( typeof target !== \"object\" && !isFunction( target ) ) {\n\t\ttarget = {};\n\t}\n\n\t// Extend jQuery itself if only one argument is passed\n\tif ( i === length ) {\n\t\ttarget = this;\n\t\ti--;\n\t}\n\n\tfor ( ; i < length; i++ ) {\n\n\t\t// Only deal with non-null/undefined values\n\t\tif ( ( options = arguments[ i ] ) != null ) {\n\n\t\t\t// Extend the base object\n\t\t\tfor ( name in options ) {\n\t\t\t\tcopy = options[ name ];\n\n\t\t\t\t// Prevent Object.prototype pollution\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif ( name === \"__proto__\" || target === copy ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\tif ( deep && copy && ( jQuery.isPlainObject( copy ) ||\n\t\t\t\t\t( copyIsArray = Array.isArray( copy ) ) ) ) {\n\t\t\t\t\tsrc = target[ name ];\n\n\t\t\t\t\t// Ensure proper type for the source value\n\t\t\t\t\tif ( copyIsArray && !Array.isArray( src ) ) {\n\t\t\t\t\t\tclone = [];\n\t\t\t\t\t} else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {\n\t\t\t\t\t\tclone = {};\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclone = src;\n\t\t\t\t\t}\n\t\t\t\t\tcopyIsArray = false;\n\n\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\ttarget[ name ] = jQuery.extend( deep, clone, copy );\n\n\t\t\t\t// Don't bring in undefined values\n\t\t\t\t} else if ( copy !== undefined ) {\n\t\t\t\t\ttarget[ name ] = copy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\njQuery.extend( {\n\n\t// Unique for each copy of jQuery on the page\n\texpando: \"jQuery\" + ( version + Math.random() ).replace( /\\D/g, \"\" ),\n\n\t// Assume jQuery is ready without the ready module\n\tisReady: true,\n\n\terror: function( msg ) {\n\t\tthrow new Error( msg );\n\t},\n\n\tnoop: function() {},\n\n\tisPlainObject: function( obj ) {\n\t\tvar proto, Ctor;\n\n\t\t// Detect obvious negatives\n\t\t// Use toString instead of jQuery.type to catch host objects\n\t\tif ( !obj || toString.call( obj ) !== \"[object Object]\" ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tproto = getProto( obj );\n\n\t\t// Objects with no prototype (e.g., `Object.create( null )`) are plain\n\t\tif ( !proto ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Objects with prototype are plain iff they were constructed by a global Object function\n\t\tCtor = hasOwn.call( proto, \"constructor\" ) && proto.constructor;\n\t\treturn typeof Ctor === \"function\" && fnToString.call( Ctor ) === ObjectFunctionString;\n\t},\n\n\tisEmptyObject: function( obj ) {\n\t\tvar name;\n\n\t\tfor ( name in obj ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t},\n\n\t// Evaluates a script in a provided context; falls back to the global one\n\t// if not specified.\n\tglobalEval: function( code, options, doc ) {\n\t\tDOMEval( code, { nonce: options && options.nonce }, doc );\n\t},\n\n\teach: function( obj, callback ) {\n\t\tvar length, i = 0;\n\n\t\tif ( isArrayLike( obj ) ) {\n\t\t\tlength = obj.length;\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( i in obj ) {\n\t\t\t\tif ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn obj;\n\t},\n\n\t// results is for internal usage only\n\tmakeArray: function( arr, results ) {\n\t\tvar ret = results || [];\n\n\t\tif ( arr != null ) {\n\t\t\tif ( isArrayLike( Object( arr ) ) ) {\n\t\t\t\tjQuery.merge( ret,\n\t\t\t\t\ttypeof arr === \"string\" ?\n\t\t\t\t\t[ arr ] : arr\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tpush.call( ret, arr );\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t},\n\n\tinArray: function( elem, arr, i ) {\n\t\treturn arr == null ? -1 : indexOf.call( arr, elem, i );\n\t},\n\n\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t// push.apply(_, arraylike) throws on ancient WebKit\n\tmerge: function( first, second ) {\n\t\tvar len = +second.length,\n\t\t\tj = 0,\n\t\t\ti = first.length;\n\n\t\tfor ( ; j < len; j++ ) {\n\t\t\tfirst[ i++ ] = second[ j ];\n\t\t}\n\n\t\tfirst.length = i;\n\n\t\treturn first;\n\t},\n\n\tgrep: function( elems, callback, invert ) {\n\t\tvar callbackInverse,\n\t\t\tmatches = [],\n\t\t\ti = 0,\n\t\t\tlength = elems.length,\n\t\t\tcallbackExpect = !invert;\n\n\t\t// Go through the array, only saving the items\n\t\t// that pass the validator function\n\t\tfor ( ; i < length; i++ ) {\n\t\t\tcallbackInverse = !callback( elems[ i ], i );\n\t\t\tif ( callbackInverse !== callbackExpect ) {\n\t\t\t\tmatches.push( elems[ i ] );\n\t\t\t}\n\t\t}\n\n\t\treturn matches;\n\t},\n\n\t// arg is for internal usage only\n\tmap: function( elems, callback, arg ) {\n\t\tvar length, value,\n\t\t\ti = 0,\n\t\t\tret = [];\n\n\t\t// Go through the array, translating each of the items to their new values\n\t\tif ( isArrayLike( elems ) ) {\n\t\t\tlength = elems.length;\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret.push( value );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Go through every key on the object,\n\t\t} else {\n\t\t\tfor ( i in elems ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret.push( value );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Flatten any nested arrays\n\t\treturn flat( ret );\n\t},\n\n\t// A global GUID counter for objects\n\tguid: 1,\n\n\t// jQuery.support is not used in Core but other projects attach their\n\t// properties to it so it needs to exist.\n\tsupport: support\n} );\n\nif ( typeof Symbol === \"function\" ) {\n\tjQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];\n}\n\n// Populate the class2type map\njQuery.each( \"Boolean Number String Function Array Date RegExp Object Error Symbol\".split( \" \" ),\nfunction( _i, name ) {\n\tclass2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n} );\n\nfunction isArrayLike( obj ) {\n\n\t// Support: real iOS 8.2 only (not reproducible in simulator)\n\t// `in` check used to prevent JIT error (gh-2145)\n\t// hasOwn isn't used here due to false negatives\n\t// regarding Nodelist length in IE\n\tvar length = !!obj && \"length\" in obj && obj.length,\n\t\ttype = toType( obj );\n\n\tif ( isFunction( obj ) || isWindow( obj ) ) {\n\t\treturn false;\n\t}\n\n\treturn type === \"array\" || length === 0 ||\n\t\ttypeof length === \"number\" && length > 0 && ( length - 1 ) in obj;\n}\nvar Sizzle =\n/*!\n * Sizzle CSS Selector Engine v2.3.5\n * https://sizzlejs.com/\n *\n * Copyright JS Foundation and other contributors\n * Released under the MIT license\n * https://js.foundation/\n *\n * Date: 2020-03-14\n */\n( function( window ) {\nvar i,\n\tsupport,\n\tExpr,\n\tgetText,\n\tisXML,\n\ttokenize,\n\tcompile,\n\tselect,\n\toutermostContext,\n\tsortInput,\n\thasDuplicate,\n\n\t// Local document vars\n\tsetDocument,\n\tdocument,\n\tdocElem,\n\tdocumentIsHTML,\n\trbuggyQSA,\n\trbuggyMatches,\n\tmatches,\n\tcontains,\n\n\t// Instance-specific data\n\texpando = \"sizzle\" + 1 * new Date(),\n\tpreferredDoc = window.document,\n\tdirruns = 0,\n\tdone = 0,\n\tclassCache = createCache(),\n\ttokenCache = createCache(),\n\tcompilerCache = createCache(),\n\tnonnativeSelectorCache = createCache(),\n\tsortOrder = function( a, b ) {\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t}\n\t\treturn 0;\n\t},\n\n\t// Instance methods\n\thasOwn = ( {} ).hasOwnProperty,\n\tarr = [],\n\tpop = arr.pop,\n\tpushNative = arr.push,\n\tpush = arr.push,\n\tslice = arr.slice,\n\n\t// Use a stripped-down indexOf as it's faster than native\n\t// https://jsperf.com/thor-indexof-vs-for/5\n\tindexOf = function( list, elem ) {\n\t\tvar i = 0,\n\t\t\tlen = list.length;\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( list[ i ] === elem ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t},\n\n\tbooleans = \"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|\" +\n\t\t\"ismap|loop|multiple|open|readonly|required|scoped\",\n\n\t// Regular expressions\n\n\t// http://www.w3.org/TR/css3-selectors/#whitespace\n\twhitespace = \"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",\n\n\t// https://www.w3.org/TR/css-syntax-3/#ident-token-diagram\n\tidentifier = \"(?:\\\\\\\\[\\\\da-fA-F]{1,6}\" + whitespace +\n\t\t\"?|\\\\\\\\[^\\\\r\\\\n\\\\f]|[\\\\w-]|[^\\0-\\\\x7f])+\",\n\n\t// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors\n\tattributes = \"\\\\[\" + whitespace + \"*(\" + identifier + \")(?:\" + whitespace +\n\n\t\t// Operator (capture 2)\n\t\t\"*([*^$|!~]?=)\" + whitespace +\n\n\t\t// \"Attribute values must be CSS identifiers [capture 5]\n\t\t// or strings [capture 3 or capture 4]\"\n\t\t\"*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(\" + identifier + \"))|)\" +\n\t\twhitespace + \"*\\\\]\",\n\n\tpseudos = \":(\" + identifier + \")(?:\\\\((\" +\n\n\t\t// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:\n\t\t// 1. quoted (capture 3; capture 4 or capture 5)\n\t\t\"('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|\" +\n\n\t\t// 2. simple (capture 6)\n\t\t\"((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\" + attributes + \")*)|\" +\n\n\t\t// 3. anything else (capture 2)\n\t\t\".*\" +\n\t\t\")\\\\)|)\",\n\n\t// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\n\trwhitespace = new RegExp( whitespace + \"+\", \"g\" ),\n\trtrim = new RegExp( \"^\" + whitespace + \"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\" +\n\t\twhitespace + \"+$\", \"g\" ),\n\n\trcomma = new RegExp( \"^\" + whitespace + \"*,\" + whitespace + \"*\" ),\n\trcombinators = new RegExp( \"^\" + whitespace + \"*([>+~]|\" + whitespace + \")\" + whitespace +\n\t\t\"*\" ),\n\trdescend = new RegExp( whitespace + \"|>\" ),\n\n\trpseudo = new RegExp( pseudos ),\n\tridentifier = new RegExp( \"^\" + identifier + \"$\" ),\n\n\tmatchExpr = {\n\t\t\"ID\": new RegExp( \"^#(\" + identifier + \")\" ),\n\t\t\"CLASS\": new RegExp( \"^\\\\.(\" + identifier + \")\" ),\n\t\t\"TAG\": new RegExp( \"^(\" + identifier + \"|[*])\" ),\n\t\t\"ATTR\": new RegExp( \"^\" + attributes ),\n\t\t\"PSEUDO\": new RegExp( \"^\" + pseudos ),\n\t\t\"CHILD\": new RegExp( \"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\" +\n\t\t\twhitespace + \"*(even|odd|(([+-]|)(\\\\d*)n|)\" + whitespace + \"*(?:([+-]|)\" +\n\t\t\twhitespace + \"*(\\\\d+)|))\" + whitespace + \"*\\\\)|)\", \"i\" ),\n\t\t\"bool\": new RegExp( \"^(?:\" + booleans + \")$\", \"i\" ),\n\n\t\t// For use in libraries implementing .is()\n\t\t// We use this for POS matching in `select`\n\t\t\"needsContext\": new RegExp( \"^\" + whitespace +\n\t\t\t\"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\" + whitespace +\n\t\t\t\"*((?:-\\\\d)?\\\\d*)\" + whitespace + \"*\\\\)|)(?=[^-]|$)\", \"i\" )\n\t},\n\n\trhtml = /HTML$/i,\n\trinputs = /^(?:input|select|textarea|button)$/i,\n\trheader = /^h\\d$/i,\n\n\trnative = /^[^{]+\\{\\s*\\[native \\w/,\n\n\t// Easily-parseable/retrievable ID or TAG or CLASS selectors\n\trquickExpr = /^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,\n\n\trsibling = /[+~]/,\n\n\t// CSS escapes\n\t// http://www.w3.org/TR/CSS21/syndata.html#escaped-characters\n\trunescape = new RegExp( \"\\\\\\\\[\\\\da-fA-F]{1,6}\" + whitespace + \"?|\\\\\\\\([^\\\\r\\\\n\\\\f])\", \"g\" ),\n\tfunescape = function( escape, nonHex ) {\n\t\tvar high = \"0x\" + escape.slice( 1 ) - 0x10000;\n\n\t\treturn nonHex ?\n\n\t\t\t// Strip the backslash prefix from a non-hex escape sequence\n\t\t\tnonHex :\n\n\t\t\t// Replace a hexadecimal escape sequence with the encoded Unicode code point\n\t\t\t// Support: IE <=11+\n\t\t\t// For values outside the Basic Multilingual Plane (BMP), manually construct a\n\t\t\t// surrogate pair\n\t\t\thigh < 0 ?\n\t\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n\t},\n\n\t// CSS string/identifier serialization\n\t// https://drafts.csswg.org/cssom/#common-serializing-idioms\n\trcssescape = /([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\0-\\x1f\\x7f-\\uFFFF\\w-]/g,\n\tfcssescape = function( ch, asCodePoint ) {\n\t\tif ( asCodePoint ) {\n\n\t\t\t// U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER\n\t\t\tif ( ch === \"\\0\" ) {\n\t\t\t\treturn \"\\uFFFD\";\n\t\t\t}\n\n\t\t\t// Control characters and (dependent upon position) numbers get escaped as code points\n\t\t\treturn ch.slice( 0, -1 ) + \"\\\\\" +\n\t\t\t\tch.charCodeAt( ch.length - 1 ).toString( 16 ) + \" \";\n\t\t}\n\n\t\t// Other potentially-special ASCII characters get backslash-escaped\n\t\treturn \"\\\\\" + ch;\n\t},\n\n\t// Used for iframes\n\t// See setDocument()\n\t// Removing the function wrapper causes a \"Permission Denied\"\n\t// error in IE\n\tunloadHandler = function() {\n\t\tsetDocument();\n\t},\n\n\tinDisabledFieldset = addCombinator(\n\t\tfunction( elem ) {\n\t\t\treturn elem.disabled === true && elem.nodeName.toLowerCase() === \"fieldset\";\n\t\t},\n\t\t{ dir: \"parentNode\", next: \"legend\" }\n\t);\n\n// Optimize for push.apply( _, NodeList )\ntry {\n\tpush.apply(\n\t\t( arr = slice.call( preferredDoc.childNodes ) ),\n\t\tpreferredDoc.childNodes\n\t);\n\n\t// Support: Android<4.0\n\t// Detect silently failing push.apply\n\t// eslint-disable-next-line no-unused-expressions\n\tarr[ preferredDoc.childNodes.length ].nodeType;\n} catch ( e ) {\n\tpush = { apply: arr.length ?\n\n\t\t// Leverage slice if possible\n\t\tfunction( target, els ) {\n\t\t\tpushNative.apply( target, slice.call( els ) );\n\t\t} :\n\n\t\t// Support: IE<9\n\t\t// Otherwise append directly\n\t\tfunction( target, els ) {\n\t\t\tvar j = target.length,\n\t\t\t\ti = 0;\n\n\t\t\t// Can't trust NodeList.length\n\t\t\twhile ( ( target[ j++ ] = els[ i++ ] ) ) {}\n\t\t\ttarget.length = j - 1;\n\t\t}\n\t};\n}\n\nfunction Sizzle( selector, context, results, seed ) {\n\tvar m, i, elem, nid, match, groups, newSelector,\n\t\tnewContext = context && context.ownerDocument,\n\n\t\t// nodeType defaults to 9, since context defaults to document\n\t\tnodeType = context ? context.nodeType : 9;\n\n\tresults = results || [];\n\n\t// Return early from calls with invalid selector or context\n\tif ( typeof selector !== \"string\" || !selector ||\n\t\tnodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {\n\n\t\treturn results;\n\t}\n\n\t// Try to shortcut find operations (as opposed to filters) in HTML documents\n\tif ( !seed ) {\n\t\tsetDocument( context );\n\t\tcontext = context || document;\n\n\t\tif ( documentIsHTML ) {\n\n\t\t\t// If the selector is sufficiently simple, try using a \"get*By*\" DOM method\n\t\t\t// (excepting DocumentFragment context, where the methods don't exist)\n\t\t\tif ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {\n\n\t\t\t\t// ID selector\n\t\t\t\tif ( ( m = match[ 1 ] ) ) {\n\n\t\t\t\t\t// Document context\n\t\t\t\t\tif ( nodeType === 9 ) {\n\t\t\t\t\t\tif ( ( elem = context.getElementById( m ) ) ) {\n\n\t\t\t\t\t\t\t// Support: IE, Opera, Webkit\n\t\t\t\t\t\t\t// TODO: identify versions\n\t\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\t\tif ( elem.id === m ) {\n\t\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t// Element context\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// Support: IE, Opera, Webkit\n\t\t\t\t\t\t// TODO: identify versions\n\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\tif ( newContext && ( elem = newContext.getElementById( m ) ) &&\n\t\t\t\t\t\t\tcontains( context, elem ) &&\n\t\t\t\t\t\t\telem.id === m ) {\n\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t// Type selector\n\t\t\t\t} else if ( match[ 2 ] ) {\n\t\t\t\t\tpush.apply( results, context.getElementsByTagName( selector ) );\n\t\t\t\t\treturn results;\n\n\t\t\t\t// Class selector\n\t\t\t\t} else if ( ( m = match[ 3 ] ) && support.getElementsByClassName &&\n\t\t\t\t\tcontext.getElementsByClassName ) {\n\n\t\t\t\t\tpush.apply( results, context.getElementsByClassName( m ) );\n\t\t\t\t\treturn results;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Take advantage of querySelectorAll\n\t\t\tif ( support.qsa &&\n\t\t\t\t!nonnativeSelectorCache[ selector + \" \" ] &&\n\t\t\t\t( !rbuggyQSA || !rbuggyQSA.test( selector ) ) &&\n\n\t\t\t\t// Support: IE 8 only\n\t\t\t\t// Exclude object elements\n\t\t\t\t( nodeType !== 1 || context.nodeName.toLowerCase() !== \"object\" ) ) {\n\n\t\t\t\tnewSelector = selector;\n\t\t\t\tnewContext = context;\n\n\t\t\t\t// qSA considers elements outside a scoping root when evaluating child or\n\t\t\t\t// descendant combinators, which is not what we want.\n\t\t\t\t// In such cases, we work around the behavior by prefixing every selector in the\n\t\t\t\t// list with an ID selector referencing the scope context.\n\t\t\t\t// The technique has to be used as well when a leading combinator is used\n\t\t\t\t// as such selectors are not recognized by querySelectorAll.\n\t\t\t\t// Thanks to Andrew Dupont for this technique.\n\t\t\t\tif ( nodeType === 1 &&\n\t\t\t\t\t( rdescend.test( selector ) || rcombinators.test( selector ) ) ) {\n\n\t\t\t\t\t// Expand context for sibling selectors\n\t\t\t\t\tnewContext = rsibling.test( selector ) && testContext( context.parentNode ) ||\n\t\t\t\t\t\tcontext;\n\n\t\t\t\t\t// We can use :scope instead of the ID hack if the browser\n\t\t\t\t\t// supports it & if we're not changing the context.\n\t\t\t\t\tif ( newContext !== context || !support.scope ) {\n\n\t\t\t\t\t\t// Capture the context ID, setting it first if necessary\n\t\t\t\t\t\tif ( ( nid = context.getAttribute( \"id\" ) ) ) {\n\t\t\t\t\t\t\tnid = nid.replace( rcssescape, fcssescape );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcontext.setAttribute( \"id\", ( nid = expando ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prefix every selector in the list\n\t\t\t\t\tgroups = tokenize( selector );\n\t\t\t\t\ti = groups.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tgroups[ i ] = ( nid ? \"#\" + nid : \":scope\" ) + \" \" +\n\t\t\t\t\t\t\ttoSelector( groups[ i ] );\n\t\t\t\t\t}\n\t\t\t\t\tnewSelector = groups.join( \",\" );\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tpush.apply( results,\n\t\t\t\t\t\tnewContext.querySelectorAll( newSelector )\n\t\t\t\t\t);\n\t\t\t\t\treturn results;\n\t\t\t\t} catch ( qsaError ) {\n\t\t\t\t\tnonnativeSelectorCache( selector, true );\n\t\t\t\t} finally {\n\t\t\t\t\tif ( nid === expando ) {\n\t\t\t\t\t\tcontext.removeAttribute( \"id\" );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// All others\n\treturn select( selector.replace( rtrim, \"$1\" ), context, results, seed );\n}\n\n/**\n * Create key-value caches of limited size\n * @returns {function(string, object)} Returns the Object data after storing it on itself with\n *\tproperty name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\n *\tdeleting the oldest entry\n */\nfunction createCache() {\n\tvar keys = [];\n\n\tfunction cache( key, value ) {\n\n\t\t// Use (key + \" \") to avoid collision with native prototype properties (see Issue #157)\n\t\tif ( keys.push( key + \" \" ) > Expr.cacheLength ) {\n\n\t\t\t// Only keep the most recent entries\n\t\t\tdelete cache[ keys.shift() ];\n\t\t}\n\t\treturn ( cache[ key + \" \" ] = value );\n\t}\n\treturn cache;\n}\n\n/**\n * Mark a function for special use by Sizzle\n * @param {Function} fn The function to mark\n */\nfunction markFunction( fn ) {\n\tfn[ expando ] = true;\n\treturn fn;\n}\n\n/**\n * Support testing using an element\n * @param {Function} fn Passed the created element and returns a boolean result\n */\nfunction assert( fn ) {\n\tvar el = document.createElement( \"fieldset\" );\n\n\ttry {\n\t\treturn !!fn( el );\n\t} catch ( e ) {\n\t\treturn false;\n\t} finally {\n\n\t\t// Remove from its parent by default\n\t\tif ( el.parentNode ) {\n\t\t\tel.parentNode.removeChild( el );\n\t\t}\n\n\t\t// release memory in IE\n\t\tel = null;\n\t}\n}\n\n/**\n * Adds the same handler for all of the specified attrs\n * @param {String} attrs Pipe-separated list of attributes\n * @param {Function} handler The method that will be applied\n */\nfunction addHandle( attrs, handler ) {\n\tvar arr = attrs.split( \"|\" ),\n\t\ti = arr.length;\n\n\twhile ( i-- ) {\n\t\tExpr.attrHandle[ arr[ i ] ] = handler;\n\t}\n}\n\n/**\n * Checks document order of two siblings\n * @param {Element} a\n * @param {Element} b\n * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b\n */\nfunction siblingCheck( a, b ) {\n\tvar cur = b && a,\n\t\tdiff = cur && a.nodeType === 1 && b.nodeType === 1 &&\n\t\t\ta.sourceIndex - b.sourceIndex;\n\n\t// Use IE sourceIndex if available on both nodes\n\tif ( diff ) {\n\t\treturn diff;\n\t}\n\n\t// Check if b follows a\n\tif ( cur ) {\n\t\twhile ( ( cur = cur.nextSibling ) ) {\n\t\t\tif ( cur === b ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn a ? 1 : -1;\n}\n\n/**\n * Returns a function to use in pseudos for input types\n * @param {String} type\n */\nfunction createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for buttons\n * @param {String} type\n */\nfunction createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn ( name === \"input\" || name === \"button\" ) && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for :enabled/:disabled\n * @param {Boolean} disabled true for :disabled; false for :enabled\n */\nfunction createDisabledPseudo( disabled ) {\n\n\t// Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable\n\treturn function( elem ) {\n\n\t\t// Only certain elements can match :enabled or :disabled\n\t\t// https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled\n\t\t// https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled\n\t\tif ( \"form\" in elem ) {\n\n\t\t\t// Check for inherited disabledness on relevant non-disabled elements:\n\t\t\t// * listed form-associated elements in a disabled fieldset\n\t\t\t// https://html.spec.whatwg.org/multipage/forms.html#category-listed\n\t\t\t// https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled\n\t\t\t// * option elements in a disabled optgroup\n\t\t\t// https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled\n\t\t\t// All such elements have a \"form\" property.\n\t\t\tif ( elem.parentNode && elem.disabled === false ) {\n\n\t\t\t\t// Option elements defer to a parent optgroup if present\n\t\t\t\tif ( \"label\" in elem ) {\n\t\t\t\t\tif ( \"label\" in elem.parentNode ) {\n\t\t\t\t\t\treturn elem.parentNode.disabled === disabled;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn elem.disabled === disabled;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Support: IE 6 - 11\n\t\t\t\t// Use the isDisabled shortcut property to check for disabled fieldset ancestors\n\t\t\t\treturn elem.isDisabled === disabled ||\n\n\t\t\t\t\t// Where there is no isDisabled, check manually\n\t\t\t\t\t/* jshint -W018 */\n\t\t\t\t\telem.isDisabled !== !disabled &&\n\t\t\t\t\tinDisabledFieldset( elem ) === disabled;\n\t\t\t}\n\n\t\t\treturn elem.disabled === disabled;\n\n\t\t// Try to winnow out elements that can't be disabled before trusting the disabled property.\n\t\t// Some victims get caught in our net (label, legend, menu, track), but it shouldn't\n\t\t// even exist on them, let alone have a boolean value.\n\t\t} else if ( \"label\" in elem ) {\n\t\t\treturn elem.disabled === disabled;\n\t\t}\n\n\t\t// Remaining elements are neither :enabled nor :disabled\n\t\treturn false;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for positionals\n * @param {Function} fn\n */\nfunction createPositionalPseudo( fn ) {\n\treturn markFunction( function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction( function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ ( j = matchIndexes[ i ] ) ] ) {\n\t\t\t\t\tseed[ j ] = !( matches[ j ] = seed[ j ] );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t} );\n}\n\n/**\n * Checks a node for validity as a Sizzle context\n * @param {Element|Object=} context\n * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value\n */\nfunction testContext( context ) {\n\treturn context && typeof context.getElementsByTagName !== \"undefined\" && context;\n}\n\n// Expose support vars for convenience\nsupport = Sizzle.support = {};\n\n/**\n * Detects XML nodes\n * @param {Element|Object} elem An element or a document\n * @returns {Boolean} True iff elem is a non-HTML XML node\n */\nisXML = Sizzle.isXML = function( elem ) {\n\tvar namespace = elem.namespaceURI,\n\t\tdocElem = ( elem.ownerDocument || elem ).documentElement;\n\n\t// Support: IE <=8\n\t// Assume HTML when documentElement doesn't yet exist, such as inside loading iframes\n\t// https://bugs.jquery.com/ticket/4833\n\treturn !rhtml.test( namespace || docElem && docElem.nodeName || \"HTML\" );\n};\n\n/**\n * Sets document-related variables once based on the current document\n * @param {Element|Object} [doc] An element or document object to use to set the document\n * @returns {Object} Returns the current document\n */\nsetDocument = Sizzle.setDocument = function( node ) {\n\tvar hasCompare, subWindow,\n\t\tdoc = node ? node.ownerDocument || node : preferredDoc;\n\n\t// Return early if doc is invalid or already selected\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {\n\t\treturn document;\n\t}\n\n\t// Update global variables\n\tdocument = doc;\n\tdocElem = document.documentElement;\n\tdocumentIsHTML = !isXML( document );\n\n\t// Support: IE 9 - 11+, Edge 12 - 18+\n\t// Accessing iframe documents after unload throws \"permission denied\" errors (jQuery #13936)\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( preferredDoc != document &&\n\t\t( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {\n\n\t\t// Support: IE 11, Edge\n\t\tif ( subWindow.addEventListener ) {\n\t\t\tsubWindow.addEventListener( \"unload\", unloadHandler, false );\n\n\t\t// Support: IE 9 - 10 only\n\t\t} else if ( subWindow.attachEvent ) {\n\t\t\tsubWindow.attachEvent( \"onunload\", unloadHandler );\n\t\t}\n\t}\n\n\t// Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only,\n\t// Safari 4 - 5 only, Opera <=11.6 - 12.x only\n\t// IE/Edge & older browsers don't support the :scope pseudo-class.\n\t// Support: Safari 6.0 only\n\t// Safari 6.0 supports :scope but it's an alias of :root there.\n\tsupport.scope = assert( function( el ) {\n\t\tdocElem.appendChild( el ).appendChild( document.createElement( \"div\" ) );\n\t\treturn typeof el.querySelectorAll !== \"undefined\" &&\n\t\t\t!el.querySelectorAll( \":scope fieldset div\" ).length;\n\t} );\n\n\t/* Attributes\n\t---------------------------------------------------------------------- */\n\n\t// Support: IE<8\n\t// Verify that getAttribute really returns attributes and not properties\n\t// (excepting IE8 booleans)\n\tsupport.attributes = assert( function( el ) {\n\t\tel.className = \"i\";\n\t\treturn !el.getAttribute( \"className\" );\n\t} );\n\n\t/* getElement(s)By*\n\t---------------------------------------------------------------------- */\n\n\t// Check if getElementsByTagName(\"*\") returns only elements\n\tsupport.getElementsByTagName = assert( function( el ) {\n\t\tel.appendChild( document.createComment( \"\" ) );\n\t\treturn !el.getElementsByTagName( \"*\" ).length;\n\t} );\n\n\t// Support: IE<9\n\tsupport.getElementsByClassName = rnative.test( document.getElementsByClassName );\n\n\t// Support: IE<10\n\t// Check if getElementById returns elements by name\n\t// The broken getElementById methods don't pick up programmatically-set names,\n\t// so use a roundabout getElementsByName test\n\tsupport.getById = assert( function( el ) {\n\t\tdocElem.appendChild( el ).id = expando;\n\t\treturn !document.getElementsByName || !document.getElementsByName( expando ).length;\n\t} );\n\n\t// ID filter and find\n\tif ( support.getById ) {\n\t\tExpr.filter[ \"ID\" ] = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn elem.getAttribute( \"id\" ) === attrId;\n\t\t\t};\n\t\t};\n\t\tExpr.find[ \"ID\" ] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n\t\t\t\tvar elem = context.getElementById( id );\n\t\t\t\treturn elem ? [ elem ] : [];\n\t\t\t}\n\t\t};\n\t} else {\n\t\tExpr.filter[ \"ID\" ] = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\tvar node = typeof elem.getAttributeNode !== \"undefined\" &&\n\t\t\t\t\telem.getAttributeNode( \"id\" );\n\t\t\t\treturn node && node.value === attrId;\n\t\t\t};\n\t\t};\n\n\t\t// Support: IE 6 - 7 only\n\t\t// getElementById is not reliable as a find shortcut\n\t\tExpr.find[ \"ID\" ] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n\t\t\t\tvar node, i, elems,\n\t\t\t\t\telem = context.getElementById( id );\n\n\t\t\t\tif ( elem ) {\n\n\t\t\t\t\t// Verify the id attribute\n\t\t\t\t\tnode = elem.getAttributeNode( \"id\" );\n\t\t\t\t\tif ( node && node.value === id ) {\n\t\t\t\t\t\treturn [ elem ];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Fall back on getElementsByName\n\t\t\t\t\telems = context.getElementsByName( id );\n\t\t\t\t\ti = 0;\n\t\t\t\t\twhile ( ( elem = elems[ i++ ] ) ) {\n\t\t\t\t\t\tnode = elem.getAttributeNode( \"id\" );\n\t\t\t\t\t\tif ( node && node.value === id ) {\n\t\t\t\t\t\t\treturn [ elem ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn [];\n\t\t\t}\n\t\t};\n\t}\n\n\t// Tag\n\tExpr.find[ \"TAG\" ] = support.getElementsByTagName ?\n\t\tfunction( tag, context ) {\n\t\t\tif ( typeof context.getElementsByTagName !== \"undefined\" ) {\n\t\t\t\treturn context.getElementsByTagName( tag );\n\n\t\t\t// DocumentFragment nodes don't have gEBTN\n\t\t\t} else if ( support.qsa ) {\n\t\t\t\treturn context.querySelectorAll( tag );\n\t\t\t}\n\t\t} :\n\n\t\tfunction( tag, context ) {\n\t\t\tvar elem,\n\t\t\t\ttmp = [],\n\t\t\t\ti = 0,\n\n\t\t\t\t// By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too\n\t\t\t\tresults = context.getElementsByTagName( tag );\n\n\t\t\t// Filter out possible comments\n\t\t\tif ( tag === \"*\" ) {\n\t\t\t\twhile ( ( elem = results[ i++ ] ) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\ttmp.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn tmp;\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\n\t// Class\n\tExpr.find[ \"CLASS\" ] = support.getElementsByClassName && function( className, context ) {\n\t\tif ( typeof context.getElementsByClassName !== \"undefined\" && documentIsHTML ) {\n\t\t\treturn context.getElementsByClassName( className );\n\t\t}\n\t};\n\n\t/* QSA/matchesSelector\n\t---------------------------------------------------------------------- */\n\n\t// QSA and matchesSelector support\n\n\t// matchesSelector(:active) reports false when true (IE9/Opera 11.5)\n\trbuggyMatches = [];\n\n\t// qSa(:focus) reports false when true (Chrome 21)\n\t// We allow this because of a bug in IE8/9 that throws an error\n\t// whenever `document.activeElement` is accessed on an iframe\n\t// So, we allow :focus to pass through QSA all the time to avoid the IE error\n\t// See https://bugs.jquery.com/ticket/13378\n\trbuggyQSA = [];\n\n\tif ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) {\n\n\t\t// Build QSA regex\n\t\t// Regex strategy adopted from Diego Perini\n\t\tassert( function( el ) {\n\n\t\t\tvar input;\n\n\t\t\t// Select is set to empty string on purpose\n\t\t\t// This is to test IE's treatment of not explicitly\n\t\t\t// setting a boolean content attribute,\n\t\t\t// since its presence should be enough\n\t\t\t// https://bugs.jquery.com/ticket/12359\n\t\t\tdocElem.appendChild( el ).innerHTML = \"\" +\n\t\t\t\t\"\";\n\n\t\t\t// Support: IE8, Opera 11-12.16\n\t\t\t// Nothing should be selected when empty strings follow ^= or $= or *=\n\t\t\t// The test attribute must be unknown in Opera but \"safe\" for WinRT\n\t\t\t// https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section\n\t\t\tif ( el.querySelectorAll( \"[msallowcapture^='']\" ).length ) {\n\t\t\t\trbuggyQSA.push( \"[*^$]=\" + whitespace + \"*(?:''|\\\"\\\")\" );\n\t\t\t}\n\n\t\t\t// Support: IE8\n\t\t\t// Boolean attributes and \"value\" are not treated correctly\n\t\t\tif ( !el.querySelectorAll( \"[selected]\" ).length ) {\n\t\t\t\trbuggyQSA.push( \"\\\\[\" + whitespace + \"*(?:value|\" + booleans + \")\" );\n\t\t\t}\n\n\t\t\t// Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+\n\t\t\tif ( !el.querySelectorAll( \"[id~=\" + expando + \"-]\" ).length ) {\n\t\t\t\trbuggyQSA.push( \"~=\" );\n\t\t\t}\n\n\t\t\t// Support: IE 11+, Edge 15 - 18+\n\t\t\t// IE 11/Edge don't find elements on a `[name='']` query in some cases.\n\t\t\t// Adding a temporary attribute to the document before the selection works\n\t\t\t// around the issue.\n\t\t\t// Interestingly, IE 10 & older don't seem to have the issue.\n\t\t\tinput = document.createElement( \"input\" );\n\t\t\tinput.setAttribute( \"name\", \"\" );\n\t\t\tel.appendChild( input );\n\t\t\tif ( !el.querySelectorAll( \"[name='']\" ).length ) {\n\t\t\t\trbuggyQSA.push( \"\\\\[\" + whitespace + \"*name\" + whitespace + \"*=\" +\n\t\t\t\t\twhitespace + \"*(?:''|\\\"\\\")\" );\n\t\t\t}\n\n\t\t\t// Webkit/Opera - :checked should return selected option elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( !el.querySelectorAll( \":checked\" ).length ) {\n\t\t\t\trbuggyQSA.push( \":checked\" );\n\t\t\t}\n\n\t\t\t// Support: Safari 8+, iOS 8+\n\t\t\t// https://bugs.webkit.org/show_bug.cgi?id=136851\n\t\t\t// In-page `selector#id sibling-combinator selector` fails\n\t\t\tif ( !el.querySelectorAll( \"a#\" + expando + \"+*\" ).length ) {\n\t\t\t\trbuggyQSA.push( \".#.+[+~]\" );\n\t\t\t}\n\n\t\t\t// Support: Firefox <=3.6 - 5 only\n\t\t\t// Old Firefox doesn't throw on a badly-escaped identifier.\n\t\t\tel.querySelectorAll( \"\\\\\\f\" );\n\t\t\trbuggyQSA.push( \"[\\\\r\\\\n\\\\f]\" );\n\t\t} );\n\n\t\tassert( function( el ) {\n\t\t\tel.innerHTML = \"\" +\n\t\t\t\t\"\";\n\n\t\t\t// Support: Windows 8 Native Apps\n\t\t\t// The type and name attributes are restricted during .innerHTML assignment\n\t\t\tvar input = document.createElement( \"input\" );\n\t\t\tinput.setAttribute( \"type\", \"hidden\" );\n\t\t\tel.appendChild( input ).setAttribute( \"name\", \"D\" );\n\n\t\t\t// Support: IE8\n\t\t\t// Enforce case-sensitivity of name attribute\n\t\t\tif ( el.querySelectorAll( \"[name=d]\" ).length ) {\n\t\t\t\trbuggyQSA.push( \"name\" + whitespace + \"*[*^$|!~]?=\" );\n\t\t\t}\n\n\t\t\t// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( el.querySelectorAll( \":enabled\" ).length !== 2 ) {\n\t\t\t\trbuggyQSA.push( \":enabled\", \":disabled\" );\n\t\t\t}\n\n\t\t\t// Support: IE9-11+\n\t\t\t// IE's :disabled selector does not pick up the children of disabled fieldsets\n\t\t\tdocElem.appendChild( el ).disabled = true;\n\t\t\tif ( el.querySelectorAll( \":disabled\" ).length !== 2 ) {\n\t\t\t\trbuggyQSA.push( \":enabled\", \":disabled\" );\n\t\t\t}\n\n\t\t\t// Support: Opera 10 - 11 only\n\t\t\t// Opera 10-11 does not throw on post-comma invalid pseudos\n\t\t\tel.querySelectorAll( \"*,:x\" );\n\t\t\trbuggyQSA.push( \",.*:\" );\n\t\t} );\n\t}\n\n\tif ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches ||\n\t\tdocElem.webkitMatchesSelector ||\n\t\tdocElem.mozMatchesSelector ||\n\t\tdocElem.oMatchesSelector ||\n\t\tdocElem.msMatchesSelector ) ) ) ) {\n\n\t\tassert( function( el ) {\n\n\t\t\t// Check to see if it's possible to do matchesSelector\n\t\t\t// on a disconnected node (IE 9)\n\t\t\tsupport.disconnectedMatch = matches.call( el, \"*\" );\n\n\t\t\t// This should fail with an exception\n\t\t\t// Gecko does not error, returns false instead\n\t\t\tmatches.call( el, \"[s!='']:x\" );\n\t\t\trbuggyMatches.push( \"!=\", pseudos );\n\t\t} );\n\t}\n\n\trbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( \"|\" ) );\n\trbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( \"|\" ) );\n\n\t/* Contains\n\t---------------------------------------------------------------------- */\n\thasCompare = rnative.test( docElem.compareDocumentPosition );\n\n\t// Element contains another\n\t// Purposefully self-exclusive\n\t// As in, an element does not contain itself\n\tcontains = hasCompare || rnative.test( docElem.contains ) ?\n\t\tfunction( a, b ) {\n\t\t\tvar adown = a.nodeType === 9 ? a.documentElement : a,\n\t\t\t\tbup = b && b.parentNode;\n\t\t\treturn a === bup || !!( bup && bup.nodeType === 1 && (\n\t\t\t\tadown.contains ?\n\t\t\t\t\tadown.contains( bup ) :\n\t\t\t\t\ta.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16\n\t\t\t) );\n\t\t} :\n\t\tfunction( a, b ) {\n\t\t\tif ( b ) {\n\t\t\t\twhile ( ( b = b.parentNode ) ) {\n\t\t\t\t\tif ( b === a ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t/* Sorting\n\t---------------------------------------------------------------------- */\n\n\t// Document order sorting\n\tsortOrder = hasCompare ?\n\tfunction( a, b ) {\n\n\t\t// Flag for duplicate removal\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\t// Sort on method existence if only one input has compareDocumentPosition\n\t\tvar compare = !a.compareDocumentPosition - !b.compareDocumentPosition;\n\t\tif ( compare ) {\n\t\t\treturn compare;\n\t\t}\n\n\t\t// Calculate position if both inputs belong to the same document\n\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t// two documents; shallow comparisons work.\n\t\t// eslint-disable-next-line eqeqeq\n\t\tcompare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?\n\t\t\ta.compareDocumentPosition( b ) :\n\n\t\t\t// Otherwise we know they are disconnected\n\t\t\t1;\n\n\t\t// Disconnected nodes\n\t\tif ( compare & 1 ||\n\t\t\t( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {\n\n\t\t\t// Choose the first element that is related to our preferred document\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\tif ( a == document || a.ownerDocument == preferredDoc &&\n\t\t\t\tcontains( preferredDoc, a ) ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\tif ( b == document || b.ownerDocument == preferredDoc &&\n\t\t\t\tcontains( preferredDoc, b ) ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\t// Maintain original order\n\t\t\treturn sortInput ?\n\t\t\t\t( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\n\t\t\t\t0;\n\t\t}\n\n\t\treturn compare & 4 ? -1 : 1;\n\t} :\n\tfunction( a, b ) {\n\n\t\t// Exit early if the nodes are identical\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\taup = a.parentNode,\n\t\t\tbup = b.parentNode,\n\t\t\tap = [ a ],\n\t\t\tbp = [ b ];\n\n\t\t// Parentless nodes are either documents or disconnected\n\t\tif ( !aup || !bup ) {\n\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t/* eslint-disable eqeqeq */\n\t\t\treturn a == document ? -1 :\n\t\t\t\tb == document ? 1 :\n\t\t\t\t/* eslint-enable eqeqeq */\n\t\t\t\taup ? -1 :\n\t\t\t\tbup ? 1 :\n\t\t\t\tsortInput ?\n\t\t\t\t( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\n\t\t\t\t0;\n\n\t\t// If the nodes are siblings, we can do a quick check\n\t\t} else if ( aup === bup ) {\n\t\t\treturn siblingCheck( a, b );\n\t\t}\n\n\t\t// Otherwise we need full lists of their ancestors for comparison\n\t\tcur = a;\n\t\twhile ( ( cur = cur.parentNode ) ) {\n\t\t\tap.unshift( cur );\n\t\t}\n\t\tcur = b;\n\t\twhile ( ( cur = cur.parentNode ) ) {\n\t\t\tbp.unshift( cur );\n\t\t}\n\n\t\t// Walk down the tree looking for a discrepancy\n\t\twhile ( ap[ i ] === bp[ i ] ) {\n\t\t\ti++;\n\t\t}\n\n\t\treturn i ?\n\n\t\t\t// Do a sibling check if the nodes have a common ancestor\n\t\t\tsiblingCheck( ap[ i ], bp[ i ] ) :\n\n\t\t\t// Otherwise nodes in our document sort first\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t/* eslint-disable eqeqeq */\n\t\t\tap[ i ] == preferredDoc ? -1 :\n\t\t\tbp[ i ] == preferredDoc ? 1 :\n\t\t\t/* eslint-enable eqeqeq */\n\t\t\t0;\n\t};\n\n\treturn document;\n};\n\nSizzle.matches = function( expr, elements ) {\n\treturn Sizzle( expr, null, null, elements );\n};\n\nSizzle.matchesSelector = function( elem, expr ) {\n\tsetDocument( elem );\n\n\tif ( support.matchesSelector && documentIsHTML &&\n\t\t!nonnativeSelectorCache[ expr + \" \" ] &&\n\t\t( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&\n\t\t( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {\n\n\t\ttry {\n\t\t\tvar ret = matches.call( elem, expr );\n\n\t\t\t// IE 9's matchesSelector returns false on disconnected nodes\n\t\t\tif ( ret || support.disconnectedMatch ||\n\n\t\t\t\t// As well, disconnected nodes are said to be in a document\n\t\t\t\t// fragment in IE 9\n\t\t\t\telem.document && elem.document.nodeType !== 11 ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t} catch ( e ) {\n\t\t\tnonnativeSelectorCache( expr, true );\n\t\t}\n\t}\n\n\treturn Sizzle( expr, document, null, [ elem ] ).length > 0;\n};\n\nSizzle.contains = function( context, elem ) {\n\n\t// Set document vars if needed\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( ( context.ownerDocument || context ) != document ) {\n\t\tsetDocument( context );\n\t}\n\treturn contains( context, elem );\n};\n\nSizzle.attr = function( elem, name ) {\n\n\t// Set document vars if needed\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( ( elem.ownerDocument || elem ) != document ) {\n\t\tsetDocument( elem );\n\t}\n\n\tvar fn = Expr.attrHandle[ name.toLowerCase() ],\n\n\t\t// Don't get fooled by Object.prototype properties (jQuery #13807)\n\t\tval = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?\n\t\t\tfn( elem, name, !documentIsHTML ) :\n\t\t\tundefined;\n\n\treturn val !== undefined ?\n\t\tval :\n\t\tsupport.attributes || !documentIsHTML ?\n\t\t\telem.getAttribute( name ) :\n\t\t\t( val = elem.getAttributeNode( name ) ) && val.specified ?\n\t\t\t\tval.value :\n\t\t\t\tnull;\n};\n\nSizzle.escape = function( sel ) {\n\treturn ( sel + \"\" ).replace( rcssescape, fcssescape );\n};\n\nSizzle.error = function( msg ) {\n\tthrow new Error( \"Syntax error, unrecognized expression: \" + msg );\n};\n\n/**\n * Document sorting and removing duplicates\n * @param {ArrayLike} results\n */\nSizzle.uniqueSort = function( results ) {\n\tvar elem,\n\t\tduplicates = [],\n\t\tj = 0,\n\t\ti = 0;\n\n\t// Unless we *know* we can detect duplicates, assume their presence\n\thasDuplicate = !support.detectDuplicates;\n\tsortInput = !support.sortStable && results.slice( 0 );\n\tresults.sort( sortOrder );\n\n\tif ( hasDuplicate ) {\n\t\twhile ( ( elem = results[ i++ ] ) ) {\n\t\t\tif ( elem === results[ i ] ) {\n\t\t\t\tj = duplicates.push( i );\n\t\t\t}\n\t\t}\n\t\twhile ( j-- ) {\n\t\t\tresults.splice( duplicates[ j ], 1 );\n\t\t}\n\t}\n\n\t// Clear input after sorting to release objects\n\t// See https://github.com/jquery/sizzle/pull/225\n\tsortInput = null;\n\n\treturn results;\n};\n\n/**\n * Utility function for retrieving the text value of an array of DOM nodes\n * @param {Array|Element} elem\n */\ngetText = Sizzle.getText = function( elem ) {\n\tvar node,\n\t\tret = \"\",\n\t\ti = 0,\n\t\tnodeType = elem.nodeType;\n\n\tif ( !nodeType ) {\n\n\t\t// If no nodeType, this is expected to be an array\n\t\twhile ( ( node = elem[ i++ ] ) ) {\n\n\t\t\t// Do not traverse comment nodes\n\t\t\tret += getText( node );\n\t\t}\n\t} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\n\n\t\t// Use textContent for elements\n\t\t// innerText usage removed for consistency of new lines (jQuery #11153)\n\t\tif ( typeof elem.textContent === \"string\" ) {\n\t\t\treturn elem.textContent;\n\t\t} else {\n\n\t\t\t// Traverse its children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tret += getText( elem );\n\t\t\t}\n\t\t}\n\t} else if ( nodeType === 3 || nodeType === 4 ) {\n\t\treturn elem.nodeValue;\n\t}\n\n\t// Do not include comment or processing instruction nodes\n\n\treturn ret;\n};\n\nExpr = Sizzle.selectors = {\n\n\t// Can be adjusted by the user\n\tcacheLength: 50,\n\n\tcreatePseudo: markFunction,\n\n\tmatch: matchExpr,\n\n\tattrHandle: {},\n\n\tfind: {},\n\n\trelative: {\n\t\t\">\": { dir: \"parentNode\", first: true },\n\t\t\" \": { dir: \"parentNode\" },\n\t\t\"+\": { dir: \"previousSibling\", first: true },\n\t\t\"~\": { dir: \"previousSibling\" }\n\t},\n\n\tpreFilter: {\n\t\t\"ATTR\": function( match ) {\n\t\t\tmatch[ 1 ] = match[ 1 ].replace( runescape, funescape );\n\n\t\t\t// Move the given value to match[3] whether quoted or unquoted\n\t\t\tmatch[ 3 ] = ( match[ 3 ] || match[ 4 ] ||\n\t\t\t\tmatch[ 5 ] || \"\" ).replace( runescape, funescape );\n\n\t\t\tif ( match[ 2 ] === \"~=\" ) {\n\t\t\t\tmatch[ 3 ] = \" \" + match[ 3 ] + \" \";\n\t\t\t}\n\n\t\t\treturn match.slice( 0, 4 );\n\t\t},\n\n\t\t\"CHILD\": function( match ) {\n\n\t\t\t/* matches from matchExpr[\"CHILD\"]\n\t\t\t\t1 type (only|nth|...)\n\t\t\t\t2 what (child|of-type)\n\t\t\t\t3 argument (even|odd|\\d*|\\d*n([+-]\\d+)?|...)\n\t\t\t\t4 xn-component of xn+y argument ([+-]?\\d*n|)\n\t\t\t\t5 sign of xn-component\n\t\t\t\t6 x of xn-component\n\t\t\t\t7 sign of y-component\n\t\t\t\t8 y of y-component\n\t\t\t*/\n\t\t\tmatch[ 1 ] = match[ 1 ].toLowerCase();\n\n\t\t\tif ( match[ 1 ].slice( 0, 3 ) === \"nth\" ) {\n\n\t\t\t\t// nth-* requires argument\n\t\t\t\tif ( !match[ 3 ] ) {\n\t\t\t\t\tSizzle.error( match[ 0 ] );\n\t\t\t\t}\n\n\t\t\t\t// numeric x and y parameters for Expr.filter.CHILD\n\t\t\t\t// remember that false/true cast respectively to 0/1\n\t\t\t\tmatch[ 4 ] = +( match[ 4 ] ?\n\t\t\t\t\tmatch[ 5 ] + ( match[ 6 ] || 1 ) :\n\t\t\t\t\t2 * ( match[ 3 ] === \"even\" || match[ 3 ] === \"odd\" ) );\n\t\t\t\tmatch[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === \"odd\" );\n\n\t\t\t\t// other types prohibit arguments\n\t\t\t} else if ( match[ 3 ] ) {\n\t\t\t\tSizzle.error( match[ 0 ] );\n\t\t\t}\n\n\t\t\treturn match;\n\t\t},\n\n\t\t\"PSEUDO\": function( match ) {\n\t\t\tvar excess,\n\t\t\t\tunquoted = !match[ 6 ] && match[ 2 ];\n\n\t\t\tif ( matchExpr[ \"CHILD\" ].test( match[ 0 ] ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Accept quoted arguments as-is\n\t\t\tif ( match[ 3 ] ) {\n\t\t\t\tmatch[ 2 ] = match[ 4 ] || match[ 5 ] || \"\";\n\n\t\t\t// Strip excess characters from unquoted arguments\n\t\t\t} else if ( unquoted && rpseudo.test( unquoted ) &&\n\n\t\t\t\t// Get excess from tokenize (recursively)\n\t\t\t\t( excess = tokenize( unquoted, true ) ) &&\n\n\t\t\t\t// advance to the next closing parenthesis\n\t\t\t\t( excess = unquoted.indexOf( \")\", unquoted.length - excess ) - unquoted.length ) ) {\n\n\t\t\t\t// excess is a negative index\n\t\t\t\tmatch[ 0 ] = match[ 0 ].slice( 0, excess );\n\t\t\t\tmatch[ 2 ] = unquoted.slice( 0, excess );\n\t\t\t}\n\n\t\t\t// Return only captures needed by the pseudo filter method (type and argument)\n\t\t\treturn match.slice( 0, 3 );\n\t\t}\n\t},\n\n\tfilter: {\n\n\t\t\"TAG\": function( nodeNameSelector ) {\n\t\t\tvar nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn nodeNameSelector === \"*\" ?\n\t\t\t\tfunction() {\n\t\t\t\t\treturn true;\n\t\t\t\t} :\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn elem.nodeName && elem.nodeName.toLowerCase() === nodeName;\n\t\t\t\t};\n\t\t},\n\n\t\t\"CLASS\": function( className ) {\n\t\t\tvar pattern = classCache[ className + \" \" ];\n\n\t\t\treturn pattern ||\n\t\t\t\t( pattern = new RegExp( \"(^|\" + whitespace +\n\t\t\t\t\t\")\" + className + \"(\" + whitespace + \"|$)\" ) ) && classCache(\n\t\t\t\t\t\tclassName, function( elem ) {\n\t\t\t\t\t\t\treturn pattern.test(\n\t\t\t\t\t\t\t\ttypeof elem.className === \"string\" && elem.className ||\n\t\t\t\t\t\t\t\ttypeof elem.getAttribute !== \"undefined\" &&\n\t\t\t\t\t\t\t\t\telem.getAttribute( \"class\" ) ||\n\t\t\t\t\t\t\t\t\"\"\n\t\t\t\t\t\t\t);\n\t\t\t\t} );\n\t\t},\n\n\t\t\"ATTR\": function( name, operator, check ) {\n\t\t\treturn function( elem ) {\n\t\t\t\tvar result = Sizzle.attr( elem, name );\n\n\t\t\t\tif ( result == null ) {\n\t\t\t\t\treturn operator === \"!=\";\n\t\t\t\t}\n\t\t\t\tif ( !operator ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tresult += \"\";\n\n\t\t\t\t/* eslint-disable max-len */\n\n\t\t\t\treturn operator === \"=\" ? result === check :\n\t\t\t\t\toperator === \"!=\" ? result !== check :\n\t\t\t\t\toperator === \"^=\" ? check && result.indexOf( check ) === 0 :\n\t\t\t\t\toperator === \"*=\" ? check && result.indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"$=\" ? check && result.slice( -check.length ) === check :\n\t\t\t\t\toperator === \"~=\" ? ( \" \" + result.replace( rwhitespace, \" \" ) + \" \" ).indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"|=\" ? result === check || result.slice( 0, check.length + 1 ) === check + \"-\" :\n\t\t\t\t\tfalse;\n\t\t\t\t/* eslint-enable max-len */\n\n\t\t\t};\n\t\t},\n\n\t\t\"CHILD\": function( type, what, _argument, first, last ) {\n\t\t\tvar simple = type.slice( 0, 3 ) !== \"nth\",\n\t\t\t\tforward = type.slice( -4 ) !== \"last\",\n\t\t\t\tofType = what === \"of-type\";\n\n\t\t\treturn first === 1 && last === 0 ?\n\n\t\t\t\t// Shortcut for :nth-*(n)\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn !!elem.parentNode;\n\t\t\t\t} :\n\n\t\t\t\tfunction( elem, _context, xml ) {\n\t\t\t\t\tvar cache, uniqueCache, outerCache, node, nodeIndex, start,\n\t\t\t\t\t\tdir = simple !== forward ? \"nextSibling\" : \"previousSibling\",\n\t\t\t\t\t\tparent = elem.parentNode,\n\t\t\t\t\t\tname = ofType && elem.nodeName.toLowerCase(),\n\t\t\t\t\t\tuseCache = !xml && !ofType,\n\t\t\t\t\t\tdiff = false;\n\n\t\t\t\t\tif ( parent ) {\n\n\t\t\t\t\t\t// :(first|last|only)-(child|of-type)\n\t\t\t\t\t\tif ( simple ) {\n\t\t\t\t\t\t\twhile ( dir ) {\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\twhile ( ( node = node[ dir ] ) ) {\n\t\t\t\t\t\t\t\t\tif ( ofType ?\n\t\t\t\t\t\t\t\t\t\tnode.nodeName.toLowerCase() === name :\n\t\t\t\t\t\t\t\t\t\tnode.nodeType === 1 ) {\n\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Reverse direction for :only-* (if we haven't yet done so)\n\t\t\t\t\t\t\t\tstart = dir = type === \"only\" && !start && \"nextSibling\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstart = [ forward ? parent.firstChild : parent.lastChild ];\n\n\t\t\t\t\t\t// non-xml :nth-child(...) stores cache data on `parent`\n\t\t\t\t\t\tif ( forward && useCache ) {\n\n\t\t\t\t\t\t\t// Seek `elem` from a previously-cached index\n\n\t\t\t\t\t\t\t// ...in a gzip-friendly way\n\t\t\t\t\t\t\tnode = parent;\n\t\t\t\t\t\t\touterCache = node[ expando ] || ( node[ expando ] = {} );\n\n\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t( outerCache[ node.uniqueID ] = {} );\n\n\t\t\t\t\t\t\tcache = uniqueCache[ type ] || [];\n\t\t\t\t\t\t\tnodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n\t\t\t\t\t\t\tdiff = nodeIndex && cache[ 2 ];\n\t\t\t\t\t\t\tnode = nodeIndex && parent.childNodes[ nodeIndex ];\n\n\t\t\t\t\t\t\twhile ( ( node = ++nodeIndex && node && node[ dir ] ||\n\n\t\t\t\t\t\t\t\t// Fallback to seeking `elem` from the start\n\t\t\t\t\t\t\t\t( diff = nodeIndex = 0 ) || start.pop() ) ) {\n\n\t\t\t\t\t\t\t\t// When found, cache indexes on `parent` and break\n\t\t\t\t\t\t\t\tif ( node.nodeType === 1 && ++diff && node === elem ) {\n\t\t\t\t\t\t\t\t\tuniqueCache[ type ] = [ dirruns, nodeIndex, diff ];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Use previously-cached element index if available\n\t\t\t\t\t\t\tif ( useCache ) {\n\n\t\t\t\t\t\t\t\t// ...in a gzip-friendly way\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\touterCache = node[ expando ] || ( node[ expando ] = {} );\n\n\t\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t\t( outerCache[ node.uniqueID ] = {} );\n\n\t\t\t\t\t\t\t\tcache = uniqueCache[ type ] || [];\n\t\t\t\t\t\t\t\tnodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n\t\t\t\t\t\t\t\tdiff = nodeIndex;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// xml :nth-child(...)\n\t\t\t\t\t\t\t// or :nth-last-child(...) or :nth(-last)?-of-type(...)\n\t\t\t\t\t\t\tif ( diff === false ) {\n\n\t\t\t\t\t\t\t\t// Use the same loop as above to seek `elem` from the start\n\t\t\t\t\t\t\t\twhile ( ( node = ++nodeIndex && node && node[ dir ] ||\n\t\t\t\t\t\t\t\t\t( diff = nodeIndex = 0 ) || start.pop() ) ) {\n\n\t\t\t\t\t\t\t\t\tif ( ( ofType ?\n\t\t\t\t\t\t\t\t\t\tnode.nodeName.toLowerCase() === name :\n\t\t\t\t\t\t\t\t\t\tnode.nodeType === 1 ) &&\n\t\t\t\t\t\t\t\t\t\t++diff ) {\n\n\t\t\t\t\t\t\t\t\t\t// Cache the index of each encountered element\n\t\t\t\t\t\t\t\t\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\t\t\t\touterCache = node[ expando ] ||\n\t\t\t\t\t\t\t\t\t\t\t\t( node[ expando ] = {} );\n\n\t\t\t\t\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t\t\t\t\t( outerCache[ node.uniqueID ] = {} );\n\n\t\t\t\t\t\t\t\t\t\t\tuniqueCache[ type ] = [ dirruns, diff ];\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tif ( node === elem ) {\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Incorporate the offset, then check against cycle size\n\t\t\t\t\t\tdiff -= last;\n\t\t\t\t\t\treturn diff === first || ( diff % first === 0 && diff / first >= 0 );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t},\n\n\t\t\"PSEUDO\": function( pseudo, argument ) {\n\n\t\t\t// pseudo-class names are case-insensitive\n\t\t\t// http://www.w3.org/TR/selectors/#pseudo-classes\n\t\t\t// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\n\t\t\t// Remember that setFilters inherits from pseudos\n\t\t\tvar args,\n\t\t\t\tfn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||\n\t\t\t\t\tSizzle.error( \"unsupported pseudo: \" + pseudo );\n\n\t\t\t// The user may use createPseudo to indicate that\n\t\t\t// arguments are needed to create the filter function\n\t\t\t// just as Sizzle does\n\t\t\tif ( fn[ expando ] ) {\n\t\t\t\treturn fn( argument );\n\t\t\t}\n\n\t\t\t// But maintain support for old signatures\n\t\t\tif ( fn.length > 1 ) {\n\t\t\t\targs = [ pseudo, pseudo, \"\", argument ];\n\t\t\t\treturn Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?\n\t\t\t\t\tmarkFunction( function( seed, matches ) {\n\t\t\t\t\t\tvar idx,\n\t\t\t\t\t\t\tmatched = fn( seed, argument ),\n\t\t\t\t\t\t\ti = matched.length;\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tidx = indexOf( seed, matched[ i ] );\n\t\t\t\t\t\t\tseed[ idx ] = !( matches[ idx ] = matched[ i ] );\n\t\t\t\t\t\t}\n\t\t\t\t\t} ) :\n\t\t\t\t\tfunction( elem ) {\n\t\t\t\t\t\treturn fn( elem, 0, args );\n\t\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn fn;\n\t\t}\n\t},\n\n\tpseudos: {\n\n\t\t// Potentially complex pseudos\n\t\t\"not\": markFunction( function( selector ) {\n\n\t\t\t// Trim the selector passed to compile\n\t\t\t// to avoid treating leading and trailing\n\t\t\t// spaces as combinators\n\t\t\tvar input = [],\n\t\t\t\tresults = [],\n\t\t\t\tmatcher = compile( selector.replace( rtrim, \"$1\" ) );\n\n\t\t\treturn matcher[ expando ] ?\n\t\t\t\tmarkFunction( function( seed, matches, _context, xml ) {\n\t\t\t\t\tvar elem,\n\t\t\t\t\t\tunmatched = matcher( seed, null, xml, [] ),\n\t\t\t\t\t\ti = seed.length;\n\n\t\t\t\t\t// Match elements unmatched by `matcher`\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( ( elem = unmatched[ i ] ) ) {\n\t\t\t\t\t\t\tseed[ i ] = !( matches[ i ] = elem );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} ) :\n\t\t\t\tfunction( elem, _context, xml ) {\n\t\t\t\t\tinput[ 0 ] = elem;\n\t\t\t\t\tmatcher( input, null, xml, results );\n\n\t\t\t\t\t// Don't keep the element (issue #299)\n\t\t\t\t\tinput[ 0 ] = null;\n\t\t\t\t\treturn !results.pop();\n\t\t\t\t};\n\t\t} ),\n\n\t\t\"has\": markFunction( function( selector ) {\n\t\t\treturn function( elem ) {\n\t\t\t\treturn Sizzle( selector, elem ).length > 0;\n\t\t\t};\n\t\t} ),\n\n\t\t\"contains\": markFunction( function( text ) {\n\t\t\ttext = text.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;\n\t\t\t};\n\t\t} ),\n\n\t\t// \"Whether an element is represented by a :lang() selector\n\t\t// is based solely on the element's language value\n\t\t// being equal to the identifier C,\n\t\t// or beginning with the identifier C immediately followed by \"-\".\n\t\t// The matching of C against the element's language value is performed case-insensitively.\n\t\t// The identifier C does not have to be a valid language name.\"\n\t\t// http://www.w3.org/TR/selectors/#lang-pseudo\n\t\t\"lang\": markFunction( function( lang ) {\n\n\t\t\t// lang value must be a valid identifier\n\t\t\tif ( !ridentifier.test( lang || \"\" ) ) {\n\t\t\t\tSizzle.error( \"unsupported lang: \" + lang );\n\t\t\t}\n\t\t\tlang = lang.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn function( elem ) {\n\t\t\t\tvar elemLang;\n\t\t\t\tdo {\n\t\t\t\t\tif ( ( elemLang = documentIsHTML ?\n\t\t\t\t\t\telem.lang :\n\t\t\t\t\t\telem.getAttribute( \"xml:lang\" ) || elem.getAttribute( \"lang\" ) ) ) {\n\n\t\t\t\t\t\telemLang = elemLang.toLowerCase();\n\t\t\t\t\t\treturn elemLang === lang || elemLang.indexOf( lang + \"-\" ) === 0;\n\t\t\t\t\t}\n\t\t\t\t} while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );\n\t\t\t\treturn false;\n\t\t\t};\n\t\t} ),\n\n\t\t// Miscellaneous\n\t\t\"target\": function( elem ) {\n\t\t\tvar hash = window.location && window.location.hash;\n\t\t\treturn hash && hash.slice( 1 ) === elem.id;\n\t\t},\n\n\t\t\"root\": function( elem ) {\n\t\t\treturn elem === docElem;\n\t\t},\n\n\t\t\"focus\": function( elem ) {\n\t\t\treturn elem === document.activeElement &&\n\t\t\t\t( !document.hasFocus || document.hasFocus() ) &&\n\t\t\t\t!!( elem.type || elem.href || ~elem.tabIndex );\n\t\t},\n\n\t\t// Boolean properties\n\t\t\"enabled\": createDisabledPseudo( false ),\n\t\t\"disabled\": createDisabledPseudo( true ),\n\n\t\t\"checked\": function( elem ) {\n\n\t\t\t// In CSS3, :checked should return both checked and selected elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\tvar nodeName = elem.nodeName.toLowerCase();\n\t\t\treturn ( nodeName === \"input\" && !!elem.checked ) ||\n\t\t\t\t( nodeName === \"option\" && !!elem.selected );\n\t\t},\n\n\t\t\"selected\": function( elem ) {\n\n\t\t\t// Accessing this property makes selected-by-default\n\t\t\t// options in Safari work properly\n\t\t\tif ( elem.parentNode ) {\n\t\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\t\telem.parentNode.selectedIndex;\n\t\t\t}\n\n\t\t\treturn elem.selected === true;\n\t\t},\n\n\t\t// Contents\n\t\t\"empty\": function( elem ) {\n\n\t\t\t// http://www.w3.org/TR/selectors/#empty-pseudo\n\t\t\t// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),\n\t\t\t// but not by others (comment: 8; processing instruction: 7; etc.)\n\t\t\t// nodeType < 6 works because attributes (2) do not appear as children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tif ( elem.nodeType < 6 ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\n\t\t\"parent\": function( elem ) {\n\t\t\treturn !Expr.pseudos[ \"empty\" ]( elem );\n\t\t},\n\n\t\t// Element/input types\n\t\t\"header\": function( elem ) {\n\t\t\treturn rheader.test( elem.nodeName );\n\t\t},\n\n\t\t\"input\": function( elem ) {\n\t\t\treturn rinputs.test( elem.nodeName );\n\t\t},\n\n\t\t\"button\": function( elem ) {\n\t\t\tvar name = elem.nodeName.toLowerCase();\n\t\t\treturn name === \"input\" && elem.type === \"button\" || name === \"button\";\n\t\t},\n\n\t\t\"text\": function( elem ) {\n\t\t\tvar attr;\n\t\t\treturn elem.nodeName.toLowerCase() === \"input\" &&\n\t\t\t\telem.type === \"text\" &&\n\n\t\t\t\t// Support: IE<8\n\t\t\t\t// New HTML5 attribute values (e.g., \"search\") appear with elem.type === \"text\"\n\t\t\t\t( ( attr = elem.getAttribute( \"type\" ) ) == null ||\n\t\t\t\t\tattr.toLowerCase() === \"text\" );\n\t\t},\n\n\t\t// Position-in-collection\n\t\t\"first\": createPositionalPseudo( function() {\n\t\t\treturn [ 0 ];\n\t\t} ),\n\n\t\t\"last\": createPositionalPseudo( function( _matchIndexes, length ) {\n\t\t\treturn [ length - 1 ];\n\t\t} ),\n\n\t\t\"eq\": createPositionalPseudo( function( _matchIndexes, length, argument ) {\n\t\t\treturn [ argument < 0 ? argument + length : argument ];\n\t\t} ),\n\n\t\t\"even\": createPositionalPseudo( function( matchIndexes, length ) {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\t\"odd\": createPositionalPseudo( function( matchIndexes, length ) {\n\t\t\tvar i = 1;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\t\"lt\": createPositionalPseudo( function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ?\n\t\t\t\targument + length :\n\t\t\t\targument > length ?\n\t\t\t\t\tlength :\n\t\t\t\t\targument;\n\t\t\tfor ( ; --i >= 0; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\t\"gt\": createPositionalPseudo( function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; ++i < length; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} )\n\t}\n};\n\nExpr.pseudos[ \"nth\" ] = Expr.pseudos[ \"eq\" ];\n\n// Add button/input type pseudos\nfor ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {\n\tExpr.pseudos[ i ] = createInputPseudo( i );\n}\nfor ( i in { submit: true, reset: true } ) {\n\tExpr.pseudos[ i ] = createButtonPseudo( i );\n}\n\n// Easy API for creating new setFilters\nfunction setFilters() {}\nsetFilters.prototype = Expr.filters = Expr.pseudos;\nExpr.setFilters = new setFilters();\n\ntokenize = Sizzle.tokenize = function( selector, parseOnly ) {\n\tvar matched, match, tokens, type,\n\t\tsoFar, groups, preFilters,\n\t\tcached = tokenCache[ selector + \" \" ];\n\n\tif ( cached ) {\n\t\treturn parseOnly ? 0 : cached.slice( 0 );\n\t}\n\n\tsoFar = selector;\n\tgroups = [];\n\tpreFilters = Expr.preFilter;\n\n\twhile ( soFar ) {\n\n\t\t// Comma and first run\n\t\tif ( !matched || ( match = rcomma.exec( soFar ) ) ) {\n\t\t\tif ( match ) {\n\n\t\t\t\t// Don't consume trailing commas as valid\n\t\t\t\tsoFar = soFar.slice( match[ 0 ].length ) || soFar;\n\t\t\t}\n\t\t\tgroups.push( ( tokens = [] ) );\n\t\t}\n\n\t\tmatched = false;\n\n\t\t// Combinators\n\t\tif ( ( match = rcombinators.exec( soFar ) ) ) {\n\t\t\tmatched = match.shift();\n\t\t\ttokens.push( {\n\t\t\t\tvalue: matched,\n\n\t\t\t\t// Cast descendant combinators to space\n\t\t\t\ttype: match[ 0 ].replace( rtrim, \" \" )\n\t\t\t} );\n\t\t\tsoFar = soFar.slice( matched.length );\n\t\t}\n\n\t\t// Filters\n\t\tfor ( type in Expr.filter ) {\n\t\t\tif ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||\n\t\t\t\t( match = preFilters[ type ]( match ) ) ) ) {\n\t\t\t\tmatched = match.shift();\n\t\t\t\ttokens.push( {\n\t\t\t\t\tvalue: matched,\n\t\t\t\t\ttype: type,\n\t\t\t\t\tmatches: match\n\t\t\t\t} );\n\t\t\t\tsoFar = soFar.slice( matched.length );\n\t\t\t}\n\t\t}\n\n\t\tif ( !matched ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Return the length of the invalid excess\n\t// if we're just parsing\n\t// Otherwise, throw an error or return tokens\n\treturn parseOnly ?\n\t\tsoFar.length :\n\t\tsoFar ?\n\t\t\tSizzle.error( selector ) :\n\n\t\t\t// Cache the tokens\n\t\t\ttokenCache( selector, groups ).slice( 0 );\n};\n\nfunction toSelector( tokens ) {\n\tvar i = 0,\n\t\tlen = tokens.length,\n\t\tselector = \"\";\n\tfor ( ; i < len; i++ ) {\n\t\tselector += tokens[ i ].value;\n\t}\n\treturn selector;\n}\n\nfunction addCombinator( matcher, combinator, base ) {\n\tvar dir = combinator.dir,\n\t\tskip = combinator.next,\n\t\tkey = skip || dir,\n\t\tcheckNonElements = base && key === \"parentNode\",\n\t\tdoneName = done++;\n\n\treturn combinator.first ?\n\n\t\t// Check against closest ancestor/preceding element\n\t\tfunction( elem, context, xml ) {\n\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\treturn matcher( elem, context, xml );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t} :\n\n\t\t// Check against all ancestor/preceding elements\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar oldCache, uniqueCache, outerCache,\n\t\t\t\tnewCache = [ dirruns, doneName ];\n\n\t\t\t// We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching\n\t\t\tif ( xml ) {\n\t\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\tif ( matcher( elem, context, xml ) ) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\touterCache = elem[ expando ] || ( elem[ expando ] = {} );\n\n\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\tuniqueCache = outerCache[ elem.uniqueID ] ||\n\t\t\t\t\t\t\t( outerCache[ elem.uniqueID ] = {} );\n\n\t\t\t\t\t\tif ( skip && skip === elem.nodeName.toLowerCase() ) {\n\t\t\t\t\t\t\telem = elem[ dir ] || elem;\n\t\t\t\t\t\t} else if ( ( oldCache = uniqueCache[ key ] ) &&\n\t\t\t\t\t\t\toldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {\n\n\t\t\t\t\t\t\t// Assign to newCache so results back-propagate to previous elements\n\t\t\t\t\t\t\treturn ( newCache[ 2 ] = oldCache[ 2 ] );\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Reuse newcache so results back-propagate to previous elements\n\t\t\t\t\t\t\tuniqueCache[ key ] = newCache;\n\n\t\t\t\t\t\t\t// A match means we're done; a fail means we have to keep checking\n\t\t\t\t\t\t\tif ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n}\n\nfunction elementMatcher( matchers ) {\n\treturn matchers.length > 1 ?\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar i = matchers.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( !matchers[ i ]( elem, context, xml ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} :\n\t\tmatchers[ 0 ];\n}\n\nfunction multipleContexts( selector, contexts, results ) {\n\tvar i = 0,\n\t\tlen = contexts.length;\n\tfor ( ; i < len; i++ ) {\n\t\tSizzle( selector, contexts[ i ], results );\n\t}\n\treturn results;\n}\n\nfunction condense( unmatched, map, filter, context, xml ) {\n\tvar elem,\n\t\tnewUnmatched = [],\n\t\ti = 0,\n\t\tlen = unmatched.length,\n\t\tmapped = map != null;\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( ( elem = unmatched[ i ] ) ) {\n\t\t\tif ( !filter || filter( elem, context, xml ) ) {\n\t\t\t\tnewUnmatched.push( elem );\n\t\t\t\tif ( mapped ) {\n\t\t\t\t\tmap.push( i );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn newUnmatched;\n}\n\nfunction setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {\n\tif ( postFilter && !postFilter[ expando ] ) {\n\t\tpostFilter = setMatcher( postFilter );\n\t}\n\tif ( postFinder && !postFinder[ expando ] ) {\n\t\tpostFinder = setMatcher( postFinder, postSelector );\n\t}\n\treturn markFunction( function( seed, results, context, xml ) {\n\t\tvar temp, i, elem,\n\t\t\tpreMap = [],\n\t\t\tpostMap = [],\n\t\t\tpreexisting = results.length,\n\n\t\t\t// Get initial elements from seed or context\n\t\t\telems = seed || multipleContexts(\n\t\t\t\tselector || \"*\",\n\t\t\t\tcontext.nodeType ? [ context ] : context,\n\t\t\t\t[]\n\t\t\t),\n\n\t\t\t// Prefilter to get matcher input, preserving a map for seed-results synchronization\n\t\t\tmatcherIn = preFilter && ( seed || !selector ) ?\n\t\t\t\tcondense( elems, preMap, preFilter, context, xml ) :\n\t\t\t\telems,\n\n\t\t\tmatcherOut = matcher ?\n\n\t\t\t\t// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,\n\t\t\t\tpostFinder || ( seed ? preFilter : preexisting || postFilter ) ?\n\n\t\t\t\t\t// ...intermediate processing is necessary\n\t\t\t\t\t[] :\n\n\t\t\t\t\t// ...otherwise use results directly\n\t\t\t\t\tresults :\n\t\t\t\tmatcherIn;\n\n\t\t// Find primary matches\n\t\tif ( matcher ) {\n\t\t\tmatcher( matcherIn, matcherOut, context, xml );\n\t\t}\n\n\t\t// Apply postFilter\n\t\tif ( postFilter ) {\n\t\t\ttemp = condense( matcherOut, postMap );\n\t\t\tpostFilter( temp, [], context, xml );\n\n\t\t\t// Un-match failing elements by moving them back to matcherIn\n\t\t\ti = temp.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( ( elem = temp[ i ] ) ) {\n\t\t\t\t\tmatcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( seed ) {\n\t\t\tif ( postFinder || preFilter ) {\n\t\t\t\tif ( postFinder ) {\n\n\t\t\t\t\t// Get the final matcherOut by condensing this intermediate into postFinder contexts\n\t\t\t\t\ttemp = [];\n\t\t\t\t\ti = matcherOut.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( ( elem = matcherOut[ i ] ) ) {\n\n\t\t\t\t\t\t\t// Restore matcherIn since elem is not yet a final match\n\t\t\t\t\t\t\ttemp.push( ( matcherIn[ i ] = elem ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpostFinder( null, ( matcherOut = [] ), temp, xml );\n\t\t\t\t}\n\n\t\t\t\t// Move matched elements from seed to results to keep them synchronized\n\t\t\t\ti = matcherOut.length;\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\tif ( ( elem = matcherOut[ i ] ) &&\n\t\t\t\t\t\t( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) {\n\n\t\t\t\t\t\tseed[ temp ] = !( results[ temp ] = elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Add elements to results, through postFinder if defined\n\t\t} else {\n\t\t\tmatcherOut = condense(\n\t\t\t\tmatcherOut === results ?\n\t\t\t\t\tmatcherOut.splice( preexisting, matcherOut.length ) :\n\t\t\t\t\tmatcherOut\n\t\t\t);\n\t\t\tif ( postFinder ) {\n\t\t\t\tpostFinder( null, results, matcherOut, xml );\n\t\t\t} else {\n\t\t\t\tpush.apply( results, matcherOut );\n\t\t\t}\n\t\t}\n\t} );\n}\n\nfunction matcherFromTokens( tokens ) {\n\tvar checkContext, matcher, j,\n\t\tlen = tokens.length,\n\t\tleadingRelative = Expr.relative[ tokens[ 0 ].type ],\n\t\timplicitRelative = leadingRelative || Expr.relative[ \" \" ],\n\t\ti = leadingRelative ? 1 : 0,\n\n\t\t// The foundational matcher ensures that elements are reachable from top-level context(s)\n\t\tmatchContext = addCombinator( function( elem ) {\n\t\t\treturn elem === checkContext;\n\t\t}, implicitRelative, true ),\n\t\tmatchAnyContext = addCombinator( function( elem ) {\n\t\t\treturn indexOf( checkContext, elem ) > -1;\n\t\t}, implicitRelative, true ),\n\t\tmatchers = [ function( elem, context, xml ) {\n\t\t\tvar ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (\n\t\t\t\t( checkContext = context ).nodeType ?\n\t\t\t\t\tmatchContext( elem, context, xml ) :\n\t\t\t\t\tmatchAnyContext( elem, context, xml ) );\n\n\t\t\t// Avoid hanging onto element (issue #299)\n\t\t\tcheckContext = null;\n\t\t\treturn ret;\n\t\t} ];\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {\n\t\t\tmatchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];\n\t\t} else {\n\t\t\tmatcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );\n\n\t\t\t// Return special upon seeing a positional matcher\n\t\t\tif ( matcher[ expando ] ) {\n\n\t\t\t\t// Find the next relative operator (if any) for proper handling\n\t\t\t\tj = ++i;\n\t\t\t\tfor ( ; j < len; j++ ) {\n\t\t\t\t\tif ( Expr.relative[ tokens[ j ].type ] ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn setMatcher(\n\t\t\t\t\ti > 1 && elementMatcher( matchers ),\n\t\t\t\t\ti > 1 && toSelector(\n\n\t\t\t\t\t// If the preceding token was a descendant combinator, insert an implicit any-element `*`\n\t\t\t\t\ttokens\n\t\t\t\t\t\t.slice( 0, i - 1 )\n\t\t\t\t\t\t.concat( { value: tokens[ i - 2 ].type === \" \" ? \"*\" : \"\" } )\n\t\t\t\t\t).replace( rtrim, \"$1\" ),\n\t\t\t\t\tmatcher,\n\t\t\t\t\ti < j && matcherFromTokens( tokens.slice( i, j ) ),\n\t\t\t\t\tj < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),\n\t\t\t\t\tj < len && toSelector( tokens )\n\t\t\t\t);\n\t\t\t}\n\t\t\tmatchers.push( matcher );\n\t\t}\n\t}\n\n\treturn elementMatcher( matchers );\n}\n\nfunction matcherFromGroupMatchers( elementMatchers, setMatchers ) {\n\tvar bySet = setMatchers.length > 0,\n\t\tbyElement = elementMatchers.length > 0,\n\t\tsuperMatcher = function( seed, context, xml, results, outermost ) {\n\t\t\tvar elem, j, matcher,\n\t\t\t\tmatchedCount = 0,\n\t\t\t\ti = \"0\",\n\t\t\t\tunmatched = seed && [],\n\t\t\t\tsetMatched = [],\n\t\t\t\tcontextBackup = outermostContext,\n\n\t\t\t\t// We must always have either seed elements or outermost context\n\t\t\t\telems = seed || byElement && Expr.find[ \"TAG\" ]( \"*\", outermost ),\n\n\t\t\t\t// Use integer dirruns iff this is the outermost matcher\n\t\t\t\tdirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),\n\t\t\t\tlen = elems.length;\n\n\t\t\tif ( outermost ) {\n\n\t\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t\t// two documents; shallow comparisons work.\n\t\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\t\toutermostContext = context == document || context || outermost;\n\t\t\t}\n\n\t\t\t// Add elements passing elementMatchers directly to results\n\t\t\t// Support: IE<9, Safari\n\t\t\t// Tolerate NodeList properties (IE: \"length\"; Safari: ) matching elements by id\n\t\t\tfor ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {\n\t\t\t\tif ( byElement && elem ) {\n\t\t\t\t\tj = 0;\n\n\t\t\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t\t\t// two documents; shallow comparisons work.\n\t\t\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\t\t\tif ( !context && elem.ownerDocument != document ) {\n\t\t\t\t\t\tsetDocument( elem );\n\t\t\t\t\t\txml = !documentIsHTML;\n\t\t\t\t\t}\n\t\t\t\t\twhile ( ( matcher = elementMatchers[ j++ ] ) ) {\n\t\t\t\t\t\tif ( matcher( elem, context || document, xml ) ) {\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( outermost ) {\n\t\t\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Track unmatched elements for set filters\n\t\t\t\tif ( bySet ) {\n\n\t\t\t\t\t// They will have gone through all possible matchers\n\t\t\t\t\tif ( ( elem = !matcher && elem ) ) {\n\t\t\t\t\t\tmatchedCount--;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Lengthen the array for every element, matched or not\n\t\t\t\t\tif ( seed ) {\n\t\t\t\t\t\tunmatched.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// `i` is now the count of elements visited above, and adding it to `matchedCount`\n\t\t\t// makes the latter nonnegative.\n\t\t\tmatchedCount += i;\n\n\t\t\t// Apply set filters to unmatched elements\n\t\t\t// NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`\n\t\t\t// equals `i`), unless we didn't visit _any_ elements in the above loop because we have\n\t\t\t// no element matchers and no seed.\n\t\t\t// Incrementing an initially-string \"0\" `i` allows `i` to remain a string only in that\n\t\t\t// case, which will result in a \"00\" `matchedCount` that differs from `i` but is also\n\t\t\t// numerically zero.\n\t\t\tif ( bySet && i !== matchedCount ) {\n\t\t\t\tj = 0;\n\t\t\t\twhile ( ( matcher = setMatchers[ j++ ] ) ) {\n\t\t\t\t\tmatcher( unmatched, setMatched, context, xml );\n\t\t\t\t}\n\n\t\t\t\tif ( seed ) {\n\n\t\t\t\t\t// Reintegrate element matches to eliminate the need for sorting\n\t\t\t\t\tif ( matchedCount > 0 ) {\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tif ( !( unmatched[ i ] || setMatched[ i ] ) ) {\n\t\t\t\t\t\t\t\tsetMatched[ i ] = pop.call( results );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Discard index placeholder values to get only actual matches\n\t\t\t\t\tsetMatched = condense( setMatched );\n\t\t\t\t}\n\n\t\t\t\t// Add matches to results\n\t\t\t\tpush.apply( results, setMatched );\n\n\t\t\t\t// Seedless set matches succeeding multiple successful matchers stipulate sorting\n\t\t\t\tif ( outermost && !seed && setMatched.length > 0 &&\n\t\t\t\t\t( matchedCount + setMatchers.length ) > 1 ) {\n\n\t\t\t\t\tSizzle.uniqueSort( results );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Override manipulation of globals by nested matchers\n\t\t\tif ( outermost ) {\n\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\toutermostContext = contextBackup;\n\t\t\t}\n\n\t\t\treturn unmatched;\n\t\t};\n\n\treturn bySet ?\n\t\tmarkFunction( superMatcher ) :\n\t\tsuperMatcher;\n}\n\ncompile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {\n\tvar i,\n\t\tsetMatchers = [],\n\t\telementMatchers = [],\n\t\tcached = compilerCache[ selector + \" \" ];\n\n\tif ( !cached ) {\n\n\t\t// Generate a function of recursive functions that can be used to check each element\n\t\tif ( !match ) {\n\t\t\tmatch = tokenize( selector );\n\t\t}\n\t\ti = match.length;\n\t\twhile ( i-- ) {\n\t\t\tcached = matcherFromTokens( match[ i ] );\n\t\t\tif ( cached[ expando ] ) {\n\t\t\t\tsetMatchers.push( cached );\n\t\t\t} else {\n\t\t\t\telementMatchers.push( cached );\n\t\t\t}\n\t\t}\n\n\t\t// Cache the compiled function\n\t\tcached = compilerCache(\n\t\t\tselector,\n\t\t\tmatcherFromGroupMatchers( elementMatchers, setMatchers )\n\t\t);\n\n\t\t// Save selector and tokenization\n\t\tcached.selector = selector;\n\t}\n\treturn cached;\n};\n\n/**\n * A low-level selection function that works with Sizzle's compiled\n * selector functions\n * @param {String|Function} selector A selector or a pre-compiled\n * selector function built with Sizzle.compile\n * @param {Element} context\n * @param {Array} [results]\n * @param {Array} [seed] A set of elements to match against\n */\nselect = Sizzle.select = function( selector, context, results, seed ) {\n\tvar i, tokens, token, type, find,\n\t\tcompiled = typeof selector === \"function\" && selector,\n\t\tmatch = !seed && tokenize( ( selector = compiled.selector || selector ) );\n\n\tresults = results || [];\n\n\t// Try to minimize operations if there is only one selector in the list and no seed\n\t// (the latter of which guarantees us context)\n\tif ( match.length === 1 ) {\n\n\t\t// Reduce context if the leading compound selector is an ID\n\t\ttokens = match[ 0 ] = match[ 0 ].slice( 0 );\n\t\tif ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === \"ID\" &&\n\t\t\tcontext.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {\n\n\t\t\tcontext = ( Expr.find[ \"ID\" ]( token.matches[ 0 ]\n\t\t\t\t.replace( runescape, funescape ), context ) || [] )[ 0 ];\n\t\t\tif ( !context ) {\n\t\t\t\treturn results;\n\n\t\t\t// Precompiled matchers will still verify ancestry, so step up a level\n\t\t\t} else if ( compiled ) {\n\t\t\t\tcontext = context.parentNode;\n\t\t\t}\n\n\t\t\tselector = selector.slice( tokens.shift().value.length );\n\t\t}\n\n\t\t// Fetch a seed set for right-to-left matching\n\t\ti = matchExpr[ \"needsContext\" ].test( selector ) ? 0 : tokens.length;\n\t\twhile ( i-- ) {\n\t\t\ttoken = tokens[ i ];\n\n\t\t\t// Abort if we hit a combinator\n\t\t\tif ( Expr.relative[ ( type = token.type ) ] ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( ( find = Expr.find[ type ] ) ) {\n\n\t\t\t\t// Search, expanding context for leading sibling combinators\n\t\t\t\tif ( ( seed = find(\n\t\t\t\t\ttoken.matches[ 0 ].replace( runescape, funescape ),\n\t\t\t\t\trsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) ||\n\t\t\t\t\t\tcontext\n\t\t\t\t) ) ) {\n\n\t\t\t\t\t// If seed is empty or no tokens remain, we can return early\n\t\t\t\t\ttokens.splice( i, 1 );\n\t\t\t\t\tselector = seed.length && toSelector( tokens );\n\t\t\t\t\tif ( !selector ) {\n\t\t\t\t\t\tpush.apply( results, seed );\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Compile and execute a filtering function if one is not provided\n\t// Provide `match` to avoid retokenization if we modified the selector above\n\t( compiled || compile( selector, match ) )(\n\t\tseed,\n\t\tcontext,\n\t\t!documentIsHTML,\n\t\tresults,\n\t\t!context || rsibling.test( selector ) && testContext( context.parentNode ) || context\n\t);\n\treturn results;\n};\n\n// One-time assignments\n\n// Sort stability\nsupport.sortStable = expando.split( \"\" ).sort( sortOrder ).join( \"\" ) === expando;\n\n// Support: Chrome 14-35+\n// Always assume duplicates if they aren't passed to the comparison function\nsupport.detectDuplicates = !!hasDuplicate;\n\n// Initialize against the default document\nsetDocument();\n\n// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)\n// Detached nodes confoundingly follow *each other*\nsupport.sortDetached = assert( function( el ) {\n\n\t// Should return 1, but returns 4 (following)\n\treturn el.compareDocumentPosition( document.createElement( \"fieldset\" ) ) & 1;\n} );\n\n// Support: IE<8\n// Prevent attribute/property \"interpolation\"\n// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx\nif ( !assert( function( el ) {\n\tel.innerHTML = \"\";\n\treturn el.firstChild.getAttribute( \"href\" ) === \"#\";\n} ) ) {\n\taddHandle( \"type|href|height|width\", function( elem, name, isXML ) {\n\t\tif ( !isXML ) {\n\t\t\treturn elem.getAttribute( name, name.toLowerCase() === \"type\" ? 1 : 2 );\n\t\t}\n\t} );\n}\n\n// Support: IE<9\n// Use defaultValue in place of getAttribute(\"value\")\nif ( !support.attributes || !assert( function( el ) {\n\tel.innerHTML = \"\";\n\tel.firstChild.setAttribute( \"value\", \"\" );\n\treturn el.firstChild.getAttribute( \"value\" ) === \"\";\n} ) ) {\n\taddHandle( \"value\", function( elem, _name, isXML ) {\n\t\tif ( !isXML && elem.nodeName.toLowerCase() === \"input\" ) {\n\t\t\treturn elem.defaultValue;\n\t\t}\n\t} );\n}\n\n// Support: IE<9\n// Use getAttributeNode to fetch booleans when getAttribute lies\nif ( !assert( function( el ) {\n\treturn el.getAttribute( \"disabled\" ) == null;\n} ) ) {\n\taddHandle( booleans, function( elem, name, isXML ) {\n\t\tvar val;\n\t\tif ( !isXML ) {\n\t\t\treturn elem[ name ] === true ? name.toLowerCase() :\n\t\t\t\t( val = elem.getAttributeNode( name ) ) && val.specified ?\n\t\t\t\t\tval.value :\n\t\t\t\t\tnull;\n\t\t}\n\t} );\n}\n\nreturn Sizzle;\n\n} )( window );\n\n\n\njQuery.find = Sizzle;\njQuery.expr = Sizzle.selectors;\n\n// Deprecated\njQuery.expr[ \":\" ] = jQuery.expr.pseudos;\njQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;\njQuery.text = Sizzle.getText;\njQuery.isXMLDoc = Sizzle.isXML;\njQuery.contains = Sizzle.contains;\njQuery.escapeSelector = Sizzle.escape;\n\n\n\n\nvar dir = function( elem, dir, until ) {\n\tvar matched = [],\n\t\ttruncate = until !== undefined;\n\n\twhile ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {\n\t\tif ( elem.nodeType === 1 ) {\n\t\t\tif ( truncate && jQuery( elem ).is( until ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tmatched.push( elem );\n\t\t}\n\t}\n\treturn matched;\n};\n\n\nvar siblings = function( n, elem ) {\n\tvar matched = [];\n\n\tfor ( ; n; n = n.nextSibling ) {\n\t\tif ( n.nodeType === 1 && n !== elem ) {\n\t\t\tmatched.push( n );\n\t\t}\n\t}\n\n\treturn matched;\n};\n\n\nvar rneedsContext = jQuery.expr.match.needsContext;\n\n\n\nfunction nodeName( elem, name ) {\n\n return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();\n\n};\nvar rsingleTag = ( /^<([a-z][^\\/\\0>:\\x20\\t\\r\\n\\f]*)[\\x20\\t\\r\\n\\f]*\\/?>(?:<\\/\\1>|)$/i );\n\n\n\n// Implement the identical functionality for filter and not\nfunction winnow( elements, qualifier, not ) {\n\tif ( isFunction( qualifier ) ) {\n\t\treturn jQuery.grep( elements, function( elem, i ) {\n\t\t\treturn !!qualifier.call( elem, i, elem ) !== not;\n\t\t} );\n\t}\n\n\t// Single element\n\tif ( qualifier.nodeType ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( elem === qualifier ) !== not;\n\t\t} );\n\t}\n\n\t// Arraylike of elements (jQuery, arguments, Array)\n\tif ( typeof qualifier !== \"string\" ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( indexOf.call( qualifier, elem ) > -1 ) !== not;\n\t\t} );\n\t}\n\n\t// Filtered directly for both simple and complex selectors\n\treturn jQuery.filter( qualifier, elements, not );\n}\n\njQuery.filter = function( expr, elems, not ) {\n\tvar elem = elems[ 0 ];\n\n\tif ( not ) {\n\t\texpr = \":not(\" + expr + \")\";\n\t}\n\n\tif ( elems.length === 1 && elem.nodeType === 1 ) {\n\t\treturn jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];\n\t}\n\n\treturn jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {\n\t\treturn elem.nodeType === 1;\n\t} ) );\n};\n\njQuery.fn.extend( {\n\tfind: function( selector ) {\n\t\tvar i, ret,\n\t\t\tlen = this.length,\n\t\t\tself = this;\n\n\t\tif ( typeof selector !== \"string\" ) {\n\t\t\treturn this.pushStack( jQuery( selector ).filter( function() {\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tif ( jQuery.contains( self[ i ], this ) ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} ) );\n\t\t}\n\n\t\tret = this.pushStack( [] );\n\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tjQuery.find( selector, self[ i ], ret );\n\t\t}\n\n\t\treturn len > 1 ? jQuery.uniqueSort( ret ) : ret;\n\t},\n\tfilter: function( selector ) {\n\t\treturn this.pushStack( winnow( this, selector || [], false ) );\n\t},\n\tnot: function( selector ) {\n\t\treturn this.pushStack( winnow( this, selector || [], true ) );\n\t},\n\tis: function( selector ) {\n\t\treturn !!winnow(\n\t\t\tthis,\n\n\t\t\t// If this is a positional/relative selector, check membership in the returned set\n\t\t\t// so $(\"p:first\").is(\"p:last\") won't return true for a doc with two \"p\".\n\t\t\ttypeof selector === \"string\" && rneedsContext.test( selector ) ?\n\t\t\t\tjQuery( selector ) :\n\t\t\t\tselector || [],\n\t\t\tfalse\n\t\t).length;\n\t}\n} );\n\n\n// Initialize a jQuery object\n\n\n// A central reference to the root jQuery(document)\nvar rootjQuery,\n\n\t// A simple way to check for HTML strings\n\t// Prioritize #id over to avoid XSS via location.hash (#9521)\n\t// Strict HTML recognition (#11290: must start with <)\n\t// Shortcut simple #id case for speed\n\trquickExpr = /^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]+))$/,\n\n\tinit = jQuery.fn.init = function( selector, context, root ) {\n\t\tvar match, elem;\n\n\t\t// HANDLE: $(\"\"), $(null), $(undefined), $(false)\n\t\tif ( !selector ) {\n\t\t\treturn this;\n\t\t}\n\n\t\t// Method init() accepts an alternate rootjQuery\n\t\t// so migrate can support jQuery.sub (gh-2101)\n\t\troot = root || rootjQuery;\n\n\t\t// Handle HTML strings\n\t\tif ( typeof selector === \"string\" ) {\n\t\t\tif ( selector[ 0 ] === \"<\" &&\n\t\t\t\tselector[ selector.length - 1 ] === \">\" &&\n\t\t\t\tselector.length >= 3 ) {\n\n\t\t\t\t// Assume that strings that start and end with <> are HTML and skip the regex check\n\t\t\t\tmatch = [ null, selector, null ];\n\n\t\t\t} else {\n\t\t\t\tmatch = rquickExpr.exec( selector );\n\t\t\t}\n\n\t\t\t// Match html or make sure no context is specified for #id\n\t\t\tif ( match && ( match[ 1 ] || !context ) ) {\n\n\t\t\t\t// HANDLE: $(html) -> $(array)\n\t\t\t\tif ( match[ 1 ] ) {\n\t\t\t\t\tcontext = context instanceof jQuery ? context[ 0 ] : context;\n\n\t\t\t\t\t// Option to run scripts is true for back-compat\n\t\t\t\t\t// Intentionally let the error be thrown if parseHTML is not present\n\t\t\t\t\tjQuery.merge( this, jQuery.parseHTML(\n\t\t\t\t\t\tmatch[ 1 ],\n\t\t\t\t\t\tcontext && context.nodeType ? context.ownerDocument || context : document,\n\t\t\t\t\t\ttrue\n\t\t\t\t\t) );\n\n\t\t\t\t\t// HANDLE: $(html, props)\n\t\t\t\t\tif ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {\n\t\t\t\t\t\tfor ( match in context ) {\n\n\t\t\t\t\t\t\t// Properties of context are called as methods if possible\n\t\t\t\t\t\t\tif ( isFunction( this[ match ] ) ) {\n\t\t\t\t\t\t\t\tthis[ match ]( context[ match ] );\n\n\t\t\t\t\t\t\t// ...and otherwise set as attributes\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.attr( match, context[ match ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this;\n\n\t\t\t\t// HANDLE: $(#id)\n\t\t\t\t} else {\n\t\t\t\t\telem = document.getElementById( match[ 2 ] );\n\n\t\t\t\t\tif ( elem ) {\n\n\t\t\t\t\t\t// Inject the element directly into the jQuery object\n\t\t\t\t\t\tthis[ 0 ] = elem;\n\t\t\t\t\t\tthis.length = 1;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\n\t\t\t// HANDLE: $(expr, $(...))\n\t\t\t} else if ( !context || context.jquery ) {\n\t\t\t\treturn ( context || root ).find( selector );\n\n\t\t\t// HANDLE: $(expr, context)\n\t\t\t// (which is just equivalent to: $(context).find(expr)\n\t\t\t} else {\n\t\t\t\treturn this.constructor( context ).find( selector );\n\t\t\t}\n\n\t\t// HANDLE: $(DOMElement)\n\t\t} else if ( selector.nodeType ) {\n\t\t\tthis[ 0 ] = selector;\n\t\t\tthis.length = 1;\n\t\t\treturn this;\n\n\t\t// HANDLE: $(function)\n\t\t// Shortcut for document ready\n\t\t} else if ( isFunction( selector ) ) {\n\t\t\treturn root.ready !== undefined ?\n\t\t\t\troot.ready( selector ) :\n\n\t\t\t\t// Execute immediately if ready is not present\n\t\t\t\tselector( jQuery );\n\t\t}\n\n\t\treturn jQuery.makeArray( selector, this );\n\t};\n\n// Give the init function the jQuery prototype for later instantiation\ninit.prototype = jQuery.fn;\n\n// Initialize central reference\nrootjQuery = jQuery( document );\n\n\nvar rparentsprev = /^(?:parents|prev(?:Until|All))/,\n\n\t// Methods guaranteed to produce a unique set when starting from a unique set\n\tguaranteedUnique = {\n\t\tchildren: true,\n\t\tcontents: true,\n\t\tnext: true,\n\t\tprev: true\n\t};\n\njQuery.fn.extend( {\n\thas: function( target ) {\n\t\tvar targets = jQuery( target, this ),\n\t\t\tl = targets.length;\n\n\t\treturn this.filter( function() {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tif ( jQuery.contains( this, targets[ i ] ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t},\n\n\tclosest: function( selectors, context ) {\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\tl = this.length,\n\t\t\tmatched = [],\n\t\t\ttargets = typeof selectors !== \"string\" && jQuery( selectors );\n\n\t\t// Positional selectors never match, since there's no _selection_ context\n\t\tif ( !rneedsContext.test( selectors ) ) {\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tfor ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {\n\n\t\t\t\t\t// Always skip document fragments\n\t\t\t\t\tif ( cur.nodeType < 11 && ( targets ?\n\t\t\t\t\t\ttargets.index( cur ) > -1 :\n\n\t\t\t\t\t\t// Don't pass non-elements to Sizzle\n\t\t\t\t\t\tcur.nodeType === 1 &&\n\t\t\t\t\t\t\tjQuery.find.matchesSelector( cur, selectors ) ) ) {\n\n\t\t\t\t\t\tmatched.push( cur );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );\n\t},\n\n\t// Determine the position of an element within the set\n\tindex: function( elem ) {\n\n\t\t// No argument, return index in parent\n\t\tif ( !elem ) {\n\t\t\treturn ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;\n\t\t}\n\n\t\t// Index in selector\n\t\tif ( typeof elem === \"string\" ) {\n\t\t\treturn indexOf.call( jQuery( elem ), this[ 0 ] );\n\t\t}\n\n\t\t// Locate the position of the desired element\n\t\treturn indexOf.call( this,\n\n\t\t\t// If it receives a jQuery object, the first element is used\n\t\t\telem.jquery ? elem[ 0 ] : elem\n\t\t);\n\t},\n\n\tadd: function( selector, context ) {\n\t\treturn this.pushStack(\n\t\t\tjQuery.uniqueSort(\n\t\t\t\tjQuery.merge( this.get(), jQuery( selector, context ) )\n\t\t\t)\n\t\t);\n\t},\n\n\taddBack: function( selector ) {\n\t\treturn this.add( selector == null ?\n\t\t\tthis.prevObject : this.prevObject.filter( selector )\n\t\t);\n\t}\n} );\n\nfunction sibling( cur, dir ) {\n\twhile ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}\n\treturn cur;\n}\n\njQuery.each( {\n\tparent: function( elem ) {\n\t\tvar parent = elem.parentNode;\n\t\treturn parent && parent.nodeType !== 11 ? parent : null;\n\t},\n\tparents: function( elem ) {\n\t\treturn dir( elem, \"parentNode\" );\n\t},\n\tparentsUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, \"parentNode\", until );\n\t},\n\tnext: function( elem ) {\n\t\treturn sibling( elem, \"nextSibling\" );\n\t},\n\tprev: function( elem ) {\n\t\treturn sibling( elem, \"previousSibling\" );\n\t},\n\tnextAll: function( elem ) {\n\t\treturn dir( elem, \"nextSibling\" );\n\t},\n\tprevAll: function( elem ) {\n\t\treturn dir( elem, \"previousSibling\" );\n\t},\n\tnextUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, \"nextSibling\", until );\n\t},\n\tprevUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, \"previousSibling\", until );\n\t},\n\tsiblings: function( elem ) {\n\t\treturn siblings( ( elem.parentNode || {} ).firstChild, elem );\n\t},\n\tchildren: function( elem ) {\n\t\treturn siblings( elem.firstChild );\n\t},\n\tcontents: function( elem ) {\n\t\tif ( elem.contentDocument != null &&\n\n\t\t\t// Support: IE 11+\n\t\t\t// elements with no `data` attribute has an object\n\t\t\t// `contentDocument` with a `null` prototype.\n\t\t\tgetProto( elem.contentDocument ) ) {\n\n\t\t\treturn elem.contentDocument;\n\t\t}\n\n\t\t// Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only\n\t\t// Treat the template element as a regular one in browsers that\n\t\t// don't support it.\n\t\tif ( nodeName( elem, \"template\" ) ) {\n\t\t\telem = elem.content || elem;\n\t\t}\n\n\t\treturn jQuery.merge( [], elem.childNodes );\n\t}\n}, function( name, fn ) {\n\tjQuery.fn[ name ] = function( until, selector ) {\n\t\tvar matched = jQuery.map( this, fn, until );\n\n\t\tif ( name.slice( -5 ) !== \"Until\" ) {\n\t\t\tselector = until;\n\t\t}\n\n\t\tif ( selector && typeof selector === \"string\" ) {\n\t\t\tmatched = jQuery.filter( selector, matched );\n\t\t}\n\n\t\tif ( this.length > 1 ) {\n\n\t\t\t// Remove duplicates\n\t\t\tif ( !guaranteedUnique[ name ] ) {\n\t\t\t\tjQuery.uniqueSort( matched );\n\t\t\t}\n\n\t\t\t// Reverse order for parents* and prev-derivatives\n\t\t\tif ( rparentsprev.test( name ) ) {\n\t\t\t\tmatched.reverse();\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched );\n\t};\n} );\nvar rnothtmlwhite = ( /[^\\x20\\t\\r\\n\\f]+/g );\n\n\n\n// Convert String-formatted options into Object-formatted ones\nfunction createOptions( options ) {\n\tvar object = {};\n\tjQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t} );\n\treturn object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n\t// Convert options from String-formatted to Object-formatted if needed\n\t// (we check in cache first)\n\toptions = typeof options === \"string\" ?\n\t\tcreateOptions( options ) :\n\t\tjQuery.extend( {}, options );\n\n\tvar // Flag to know if list is currently firing\n\t\tfiring,\n\n\t\t// Last fire value for non-forgettable lists\n\t\tmemory,\n\n\t\t// Flag to know if list was already fired\n\t\tfired,\n\n\t\t// Flag to prevent firing\n\t\tlocked,\n\n\t\t// Actual callback list\n\t\tlist = [],\n\n\t\t// Queue of execution data for repeatable lists\n\t\tqueue = [],\n\n\t\t// Index of currently firing callback (modified by add/remove as needed)\n\t\tfiringIndex = -1,\n\n\t\t// Fire callbacks\n\t\tfire = function() {\n\n\t\t\t// Enforce single-firing\n\t\t\tlocked = locked || options.once;\n\n\t\t\t// Execute callbacks for all pending executions,\n\t\t\t// respecting firingIndex overrides and runtime changes\n\t\t\tfired = firing = true;\n\t\t\tfor ( ; queue.length; firingIndex = -1 ) {\n\t\t\t\tmemory = queue.shift();\n\t\t\t\twhile ( ++firingIndex < list.length ) {\n\n\t\t\t\t\t// Run callback and check for early termination\n\t\t\t\t\tif ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&\n\t\t\t\t\t\toptions.stopOnFalse ) {\n\n\t\t\t\t\t\t// Jump to end and forget the data so .add doesn't re-fire\n\t\t\t\t\t\tfiringIndex = list.length;\n\t\t\t\t\t\tmemory = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Forget the data if we're done with it\n\t\t\tif ( !options.memory ) {\n\t\t\t\tmemory = false;\n\t\t\t}\n\n\t\t\tfiring = false;\n\n\t\t\t// Clean up if we're done firing for good\n\t\t\tif ( locked ) {\n\n\t\t\t\t// Keep an empty list if we have data for future add calls\n\t\t\t\tif ( memory ) {\n\t\t\t\t\tlist = [];\n\n\t\t\t\t// Otherwise, this object is spent\n\t\t\t\t} else {\n\t\t\t\t\tlist = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t// Actual Callbacks object\n\t\tself = {\n\n\t\t\t// Add a callback or a collection of callbacks to the list\n\t\t\tadd: function() {\n\t\t\t\tif ( list ) {\n\n\t\t\t\t\t// If we have memory from a past run, we should fire after adding\n\t\t\t\t\tif ( memory && !firing ) {\n\t\t\t\t\t\tfiringIndex = list.length - 1;\n\t\t\t\t\t\tqueue.push( memory );\n\t\t\t\t\t}\n\n\t\t\t\t\t( function add( args ) {\n\t\t\t\t\t\tjQuery.each( args, function( _, arg ) {\n\t\t\t\t\t\t\tif ( isFunction( arg ) ) {\n\t\t\t\t\t\t\t\tif ( !options.unique || !self.has( arg ) ) {\n\t\t\t\t\t\t\t\t\tlist.push( arg );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if ( arg && arg.length && toType( arg ) !== \"string\" ) {\n\n\t\t\t\t\t\t\t\t// Inspect recursively\n\t\t\t\t\t\t\t\tadd( arg );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t} )( arguments );\n\n\t\t\t\t\tif ( memory && !firing ) {\n\t\t\t\t\t\tfire();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Remove a callback from the list\n\t\t\tremove: function() {\n\t\t\t\tjQuery.each( arguments, function( _, arg ) {\n\t\t\t\t\tvar index;\n\t\t\t\t\twhile ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n\t\t\t\t\t\tlist.splice( index, 1 );\n\n\t\t\t\t\t\t// Handle firing indexes\n\t\t\t\t\t\tif ( index <= firingIndex ) {\n\t\t\t\t\t\t\tfiringIndex--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Check if a given callback is in the list.\n\t\t\t// If no argument is given, return whether or not list has callbacks attached.\n\t\t\thas: function( fn ) {\n\t\t\t\treturn fn ?\n\t\t\t\t\tjQuery.inArray( fn, list ) > -1 :\n\t\t\t\t\tlist.length > 0;\n\t\t\t},\n\n\t\t\t// Remove all callbacks from the list\n\t\t\tempty: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\tlist = [];\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Disable .fire and .add\n\t\t\t// Abort any current/pending executions\n\t\t\t// Clear all callbacks and values\n\t\t\tdisable: function() {\n\t\t\t\tlocked = queue = [];\n\t\t\t\tlist = memory = \"\";\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tdisabled: function() {\n\t\t\t\treturn !list;\n\t\t\t},\n\n\t\t\t// Disable .fire\n\t\t\t// Also disable .add unless we have memory (since it would have no effect)\n\t\t\t// Abort any pending executions\n\t\t\tlock: function() {\n\t\t\t\tlocked = queue = [];\n\t\t\t\tif ( !memory && !firing ) {\n\t\t\t\t\tlist = memory = \"\";\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tlocked: function() {\n\t\t\t\treturn !!locked;\n\t\t\t},\n\n\t\t\t// Call all callbacks with the given context and arguments\n\t\t\tfireWith: function( context, args ) {\n\t\t\t\tif ( !locked ) {\n\t\t\t\t\targs = args || [];\n\t\t\t\t\targs = [ context, args.slice ? args.slice() : args ];\n\t\t\t\t\tqueue.push( args );\n\t\t\t\t\tif ( !firing ) {\n\t\t\t\t\t\tfire();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Call all the callbacks with the given arguments\n\t\t\tfire: function() {\n\t\t\t\tself.fireWith( this, arguments );\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// To know if the callbacks have already been called at least once\n\t\t\tfired: function() {\n\t\t\t\treturn !!fired;\n\t\t\t}\n\t\t};\n\n\treturn self;\n};\n\n\nfunction Identity( v ) {\n\treturn v;\n}\nfunction Thrower( ex ) {\n\tthrow ex;\n}\n\nfunction adoptValue( value, resolve, reject, noValue ) {\n\tvar method;\n\n\ttry {\n\n\t\t// Check for promise aspect first to privilege synchronous behavior\n\t\tif ( value && isFunction( ( method = value.promise ) ) ) {\n\t\t\tmethod.call( value ).done( resolve ).fail( reject );\n\n\t\t// Other thenables\n\t\t} else if ( value && isFunction( ( method = value.then ) ) ) {\n\t\t\tmethod.call( value, resolve, reject );\n\n\t\t// Other non-thenables\n\t\t} else {\n\n\t\t\t// Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:\n\t\t\t// * false: [ value ].slice( 0 ) => resolve( value )\n\t\t\t// * true: [ value ].slice( 1 ) => resolve()\n\t\t\tresolve.apply( undefined, [ value ].slice( noValue ) );\n\t\t}\n\n\t// For Promises/A+, convert exceptions into rejections\n\t// Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in\n\t// Deferred#then to conditionally suppress rejection.\n\t} catch ( value ) {\n\n\t\t// Support: Android 4.0 only\n\t\t// Strict mode functions invoked without .call/.apply get global-object context\n\t\treject.apply( undefined, [ value ] );\n\t}\n}\n\njQuery.extend( {\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\n\t\t\t\t// action, add listener, callbacks,\n\t\t\t\t// ... .then handlers, argument index, [final state]\n\t\t\t\t[ \"notify\", \"progress\", jQuery.Callbacks( \"memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"memory\" ), 2 ],\n\t\t\t\t[ \"resolve\", \"done\", jQuery.Callbacks( \"once memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"once memory\" ), 0, \"resolved\" ],\n\t\t\t\t[ \"reject\", \"fail\", jQuery.Callbacks( \"once memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"once memory\" ), 1, \"rejected\" ]\n\t\t\t],\n\t\t\tstate = \"pending\",\n\t\t\tpromise = {\n\t\t\t\tstate: function() {\n\t\t\t\t\treturn state;\n\t\t\t\t},\n\t\t\t\talways: function() {\n\t\t\t\t\tdeferred.done( arguments ).fail( arguments );\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\t\t\t\t\"catch\": function( fn ) {\n\t\t\t\t\treturn promise.then( null, fn );\n\t\t\t\t},\n\n\t\t\t\t// Keep pipe for back-compat\n\t\t\t\tpipe: function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\t\t\tvar fns = arguments;\n\n\t\t\t\t\treturn jQuery.Deferred( function( newDefer ) {\n\t\t\t\t\t\tjQuery.each( tuples, function( _i, tuple ) {\n\n\t\t\t\t\t\t\t// Map tuples (progress, done, fail) to arguments (done, fail, progress)\n\t\t\t\t\t\t\tvar fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];\n\n\t\t\t\t\t\t\t// deferred.progress(function() { bind to newDefer or newDefer.notify })\n\t\t\t\t\t\t\t// deferred.done(function() { bind to newDefer or newDefer.resolve })\n\t\t\t\t\t\t\t// deferred.fail(function() { bind to newDefer or newDefer.reject })\n\t\t\t\t\t\t\tdeferred[ tuple[ 1 ] ]( function() {\n\t\t\t\t\t\t\t\tvar returned = fn && fn.apply( this, arguments );\n\t\t\t\t\t\t\t\tif ( returned && isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify )\n\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnewDefer[ tuple[ 0 ] + \"With\" ](\n\t\t\t\t\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\t\t\t\tfn ? [ returned ] : arguments\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tfns = null;\n\t\t\t\t\t} ).promise();\n\t\t\t\t},\n\t\t\t\tthen: function( onFulfilled, onRejected, onProgress ) {\n\t\t\t\t\tvar maxDepth = 0;\n\t\t\t\t\tfunction resolve( depth, deferred, handler, special ) {\n\t\t\t\t\t\treturn function() {\n\t\t\t\t\t\t\tvar that = this,\n\t\t\t\t\t\t\t\targs = arguments,\n\t\t\t\t\t\t\t\tmightThrow = function() {\n\t\t\t\t\t\t\t\t\tvar returned, then;\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.3\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-59\n\t\t\t\t\t\t\t\t\t// Ignore double-resolution attempts\n\t\t\t\t\t\t\t\t\tif ( depth < maxDepth ) {\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\treturned = handler.apply( that, args );\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.1\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-48\n\t\t\t\t\t\t\t\t\tif ( returned === deferred.promise() ) {\n\t\t\t\t\t\t\t\t\t\tthrow new TypeError( \"Thenable self-resolution\" );\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ sections 2.3.3.1, 3.5\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-54\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-75\n\t\t\t\t\t\t\t\t\t// Retrieve `then` only once\n\t\t\t\t\t\t\t\t\tthen = returned &&\n\n\t\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.4\n\t\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-64\n\t\t\t\t\t\t\t\t\t\t// Only check objects and functions for thenability\n\t\t\t\t\t\t\t\t\t\t( typeof returned === \"object\" ||\n\t\t\t\t\t\t\t\t\t\t\ttypeof returned === \"function\" ) &&\n\t\t\t\t\t\t\t\t\t\treturned.then;\n\n\t\t\t\t\t\t\t\t\t// Handle a returned thenable\n\t\t\t\t\t\t\t\t\tif ( isFunction( then ) ) {\n\n\t\t\t\t\t\t\t\t\t\t// Special processors (notify) just wait for resolution\n\t\t\t\t\t\t\t\t\t\tif ( special ) {\n\t\t\t\t\t\t\t\t\t\t\tthen.call(\n\t\t\t\t\t\t\t\t\t\t\t\treturned,\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Thrower, special )\n\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t// Normal processors (resolve) also hook into progress\n\t\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t\t// ...and disregard older resolution values\n\t\t\t\t\t\t\t\t\t\t\tmaxDepth++;\n\n\t\t\t\t\t\t\t\t\t\t\tthen.call(\n\t\t\t\t\t\t\t\t\t\t\t\treturned,\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Thrower, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity,\n\t\t\t\t\t\t\t\t\t\t\t\t\tdeferred.notifyWith )\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Handle all other returned values\n\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t// Only substitute handlers pass on context\n\t\t\t\t\t\t\t\t\t\t// and multiple values (non-spec behavior)\n\t\t\t\t\t\t\t\t\t\tif ( handler !== Identity ) {\n\t\t\t\t\t\t\t\t\t\t\tthat = undefined;\n\t\t\t\t\t\t\t\t\t\t\targs = [ returned ];\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// Process the value(s)\n\t\t\t\t\t\t\t\t\t\t// Default process is resolve\n\t\t\t\t\t\t\t\t\t\t( special || deferred.resolveWith )( that, args );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t// Only normal processors (resolve) catch and reject exceptions\n\t\t\t\t\t\t\t\tprocess = special ?\n\t\t\t\t\t\t\t\t\tmightThrow :\n\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\tmightThrow();\n\t\t\t\t\t\t\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t\t\t\t\t\t\tif ( jQuery.Deferred.exceptionHook ) {\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery.Deferred.exceptionHook( e,\n\t\t\t\t\t\t\t\t\t\t\t\t\tprocess.stackTrace );\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.4.1\n\t\t\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-61\n\t\t\t\t\t\t\t\t\t\t\t// Ignore post-resolution exceptions\n\t\t\t\t\t\t\t\t\t\t\tif ( depth + 1 >= maxDepth ) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Only substitute handlers pass on context\n\t\t\t\t\t\t\t\t\t\t\t\t// and multiple values (non-spec behavior)\n\t\t\t\t\t\t\t\t\t\t\t\tif ( handler !== Thrower ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tthat = undefined;\n\t\t\t\t\t\t\t\t\t\t\t\t\targs = [ e ];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tdeferred.rejectWith( that, args );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.1\n\t\t\t\t\t\t\t// https://promisesaplus.com/#point-57\n\t\t\t\t\t\t\t// Re-resolve promises immediately to dodge false rejection from\n\t\t\t\t\t\t\t// subsequent errors\n\t\t\t\t\t\t\tif ( depth ) {\n\t\t\t\t\t\t\t\tprocess();\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// Call an optional hook to record the stack, in case of exception\n\t\t\t\t\t\t\t\t// since it's otherwise lost when execution goes async\n\t\t\t\t\t\t\t\tif ( jQuery.Deferred.getStackHook ) {\n\t\t\t\t\t\t\t\t\tprocess.stackTrace = jQuery.Deferred.getStackHook();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\twindow.setTimeout( process );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\treturn jQuery.Deferred( function( newDefer ) {\n\n\t\t\t\t\t\t// progress_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 0 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onProgress ) ?\n\t\t\t\t\t\t\t\t\tonProgress :\n\t\t\t\t\t\t\t\t\tIdentity,\n\t\t\t\t\t\t\t\tnewDefer.notifyWith\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// fulfilled_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 1 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onFulfilled ) ?\n\t\t\t\t\t\t\t\t\tonFulfilled :\n\t\t\t\t\t\t\t\t\tIdentity\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// rejected_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 2 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onRejected ) ?\n\t\t\t\t\t\t\t\t\tonRejected :\n\t\t\t\t\t\t\t\t\tThrower\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t} ).promise();\n\t\t\t\t},\n\n\t\t\t\t// Get a promise for this deferred\n\t\t\t\t// If obj is provided, the promise aspect is added to the object\n\t\t\t\tpromise: function( obj ) {\n\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeferred = {};\n\n\t\t// Add list-specific methods\n\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\tvar list = tuple[ 2 ],\n\t\t\t\tstateString = tuple[ 5 ];\n\n\t\t\t// promise.progress = list.add\n\t\t\t// promise.done = list.add\n\t\t\t// promise.fail = list.add\n\t\t\tpromise[ tuple[ 1 ] ] = list.add;\n\n\t\t\t// Handle state\n\t\t\tif ( stateString ) {\n\t\t\t\tlist.add(\n\t\t\t\t\tfunction() {\n\n\t\t\t\t\t\t// state = \"resolved\" (i.e., fulfilled)\n\t\t\t\t\t\t// state = \"rejected\"\n\t\t\t\t\t\tstate = stateString;\n\t\t\t\t\t},\n\n\t\t\t\t\t// rejected_callbacks.disable\n\t\t\t\t\t// fulfilled_callbacks.disable\n\t\t\t\t\ttuples[ 3 - i ][ 2 ].disable,\n\n\t\t\t\t\t// rejected_handlers.disable\n\t\t\t\t\t// fulfilled_handlers.disable\n\t\t\t\t\ttuples[ 3 - i ][ 3 ].disable,\n\n\t\t\t\t\t// progress_callbacks.lock\n\t\t\t\t\ttuples[ 0 ][ 2 ].lock,\n\n\t\t\t\t\t// progress_handlers.lock\n\t\t\t\t\ttuples[ 0 ][ 3 ].lock\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// progress_handlers.fire\n\t\t\t// fulfilled_handlers.fire\n\t\t\t// rejected_handlers.fire\n\t\t\tlist.add( tuple[ 3 ].fire );\n\n\t\t\t// deferred.notify = function() { deferred.notifyWith(...) }\n\t\t\t// deferred.resolve = function() { deferred.resolveWith(...) }\n\t\t\t// deferred.reject = function() { deferred.rejectWith(...) }\n\t\t\tdeferred[ tuple[ 0 ] ] = function() {\n\t\t\t\tdeferred[ tuple[ 0 ] + \"With\" ]( this === deferred ? undefined : this, arguments );\n\t\t\t\treturn this;\n\t\t\t};\n\n\t\t\t// deferred.notifyWith = list.fireWith\n\t\t\t// deferred.resolveWith = list.fireWith\n\t\t\t// deferred.rejectWith = list.fireWith\n\t\t\tdeferred[ tuple[ 0 ] + \"With\" ] = list.fireWith;\n\t\t} );\n\n\t\t// Make the deferred a promise\n\t\tpromise.promise( deferred );\n\n\t\t// Call given func if any\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\t// All done!\n\t\treturn deferred;\n\t},\n\n\t// Deferred helper\n\twhen: function( singleValue ) {\n\t\tvar\n\n\t\t\t// count of uncompleted subordinates\n\t\t\tremaining = arguments.length,\n\n\t\t\t// count of unprocessed arguments\n\t\t\ti = remaining,\n\n\t\t\t// subordinate fulfillment data\n\t\t\tresolveContexts = Array( i ),\n\t\t\tresolveValues = slice.call( arguments ),\n\n\t\t\t// the master Deferred\n\t\t\tmaster = jQuery.Deferred(),\n\n\t\t\t// subordinate callback factory\n\t\t\tupdateFunc = function( i ) {\n\t\t\t\treturn function( value ) {\n\t\t\t\t\tresolveContexts[ i ] = this;\n\t\t\t\t\tresolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;\n\t\t\t\t\tif ( !( --remaining ) ) {\n\t\t\t\t\t\tmaster.resolveWith( resolveContexts, resolveValues );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\n\t\t// Single- and empty arguments are adopted like Promise.resolve\n\t\tif ( remaining <= 1 ) {\n\t\t\tadoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,\n\t\t\t\t!remaining );\n\n\t\t\t// Use .then() to unwrap secondary thenables (cf. gh-3000)\n\t\t\tif ( master.state() === \"pending\" ||\n\t\t\t\tisFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {\n\n\t\t\t\treturn master.then();\n\t\t\t}\n\t\t}\n\n\t\t// Multiple arguments are aggregated like Promise.all array elements\n\t\twhile ( i-- ) {\n\t\t\tadoptValue( resolveValues[ i ], updateFunc( i ), master.reject );\n\t\t}\n\n\t\treturn master.promise();\n\t}\n} );\n\n\n// These usually indicate a programmer mistake during development,\n// warn about them ASAP rather than swallowing them by default.\nvar rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;\n\njQuery.Deferred.exceptionHook = function( error, stack ) {\n\n\t// Support: IE 8 - 9 only\n\t// Console exists when dev tools are open, which can happen at any time\n\tif ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {\n\t\twindow.console.warn( \"jQuery.Deferred exception: \" + error.message, error.stack, stack );\n\t}\n};\n\n\n\n\njQuery.readyException = function( error ) {\n\twindow.setTimeout( function() {\n\t\tthrow error;\n\t} );\n};\n\n\n\n\n// The deferred used on DOM ready\nvar readyList = jQuery.Deferred();\n\njQuery.fn.ready = function( fn ) {\n\n\treadyList\n\t\t.then( fn )\n\n\t\t// Wrap jQuery.readyException in a function so that the lookup\n\t\t// happens at the time of error handling instead of callback\n\t\t// registration.\n\t\t.catch( function( error ) {\n\t\t\tjQuery.readyException( error );\n\t\t} );\n\n\treturn this;\n};\n\njQuery.extend( {\n\n\t// Is the DOM ready to be used? Set to true once it occurs.\n\tisReady: false,\n\n\t// A counter to track how many items to wait for before\n\t// the ready event fires. See #6781\n\treadyWait: 1,\n\n\t// Handle when the DOM is ready\n\tready: function( wait ) {\n\n\t\t// Abort if there are pending holds or we're already ready\n\t\tif ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remember that the DOM is ready\n\t\tjQuery.isReady = true;\n\n\t\t// If a normal DOM Ready event fired, decrement, and wait if need be\n\t\tif ( wait !== true && --jQuery.readyWait > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there are functions bound, to execute\n\t\treadyList.resolveWith( document, [ jQuery ] );\n\t}\n} );\n\njQuery.ready.then = readyList.then;\n\n// The ready event handler and self cleanup method\nfunction completed() {\n\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\twindow.removeEventListener( \"load\", completed );\n\tjQuery.ready();\n}\n\n// Catch cases where $(document).ready() is called\n// after the browser event has already occurred.\n// Support: IE <=9 - 10 only\n// Older IE sometimes signals \"interactive\" too soon\nif ( document.readyState === \"complete\" ||\n\t( document.readyState !== \"loading\" && !document.documentElement.doScroll ) ) {\n\n\t// Handle it asynchronously to allow scripts the opportunity to delay ready\n\twindow.setTimeout( jQuery.ready );\n\n} else {\n\n\t// Use the handy event callback\n\tdocument.addEventListener( \"DOMContentLoaded\", completed );\n\n\t// A fallback to window.onload, that will always work\n\twindow.addEventListener( \"load\", completed );\n}\n\n\n\n\n// Multifunctional method to get and set values of a collection\n// The value/s can optionally be executed if it's a function\nvar access = function( elems, fn, key, value, chainable, emptyGet, raw ) {\n\tvar i = 0,\n\t\tlen = elems.length,\n\t\tbulk = key == null;\n\n\t// Sets many values\n\tif ( toType( key ) === \"object\" ) {\n\t\tchainable = true;\n\t\tfor ( i in key ) {\n\t\t\taccess( elems, fn, i, key[ i ], true, emptyGet, raw );\n\t\t}\n\n\t// Sets one value\n\t} else if ( value !== undefined ) {\n\t\tchainable = true;\n\n\t\tif ( !isFunction( value ) ) {\n\t\t\traw = true;\n\t\t}\n\n\t\tif ( bulk ) {\n\n\t\t\t// Bulk operations run against the entire set\n\t\t\tif ( raw ) {\n\t\t\t\tfn.call( elems, value );\n\t\t\t\tfn = null;\n\n\t\t\t// ...except when executing function values\n\t\t\t} else {\n\t\t\t\tbulk = fn;\n\t\t\t\tfn = function( elem, _key, value ) {\n\t\t\t\t\treturn bulk.call( jQuery( elem ), value );\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tif ( fn ) {\n\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\tfn(\n\t\t\t\t\telems[ i ], key, raw ?\n\t\t\t\t\tvalue :\n\t\t\t\t\tvalue.call( elems[ i ], i, fn( elems[ i ], key ) )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( chainable ) {\n\t\treturn elems;\n\t}\n\n\t// Gets\n\tif ( bulk ) {\n\t\treturn fn.call( elems );\n\t}\n\n\treturn len ? fn( elems[ 0 ], key ) : emptyGet;\n};\n\n\n// Matches dashed string for camelizing\nvar rmsPrefix = /^-ms-/,\n\trdashAlpha = /-([a-z])/g;\n\n// Used by camelCase as callback to replace()\nfunction fcamelCase( _all, letter ) {\n\treturn letter.toUpperCase();\n}\n\n// Convert dashed to camelCase; used by the css and data modules\n// Support: IE <=9 - 11, Edge 12 - 15\n// Microsoft forgot to hump their vendor prefix (#9572)\nfunction camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}\nvar acceptData = function( owner ) {\n\n\t// Accepts only:\n\t// - Node\n\t// - Node.ELEMENT_NODE\n\t// - Node.DOCUMENT_NODE\n\t// - Object\n\t// - Any\n\treturn owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );\n};\n\n\n\n\nfunction Data() {\n\tthis.expando = jQuery.expando + Data.uid++;\n}\n\nData.uid = 1;\n\nData.prototype = {\n\n\tcache: function( owner ) {\n\n\t\t// Check if the owner object already has a cache\n\t\tvar value = owner[ this.expando ];\n\n\t\t// If not, create one\n\t\tif ( !value ) {\n\t\t\tvalue = {};\n\n\t\t\t// We can accept data for non-element nodes in modern browsers,\n\t\t\t// but we should not, see #8335.\n\t\t\t// Always return an empty object.\n\t\t\tif ( acceptData( owner ) ) {\n\n\t\t\t\t// If it is a node unlikely to be stringify-ed or looped over\n\t\t\t\t// use plain assignment\n\t\t\t\tif ( owner.nodeType ) {\n\t\t\t\t\towner[ this.expando ] = value;\n\n\t\t\t\t// Otherwise secure it in a non-enumerable property\n\t\t\t\t// configurable must be true to allow the property to be\n\t\t\t\t// deleted when data is removed\n\t\t\t\t} else {\n\t\t\t\t\tObject.defineProperty( owner, this.expando, {\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tconfigurable: true\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn value;\n\t},\n\tset: function( owner, data, value ) {\n\t\tvar prop,\n\t\t\tcache = this.cache( owner );\n\n\t\t// Handle: [ owner, key, value ] args\n\t\t// Always use camelCase key (gh-2257)\n\t\tif ( typeof data === \"string\" ) {\n\t\t\tcache[ camelCase( data ) ] = value;\n\n\t\t// Handle: [ owner, { properties } ] args\n\t\t} else {\n\n\t\t\t// Copy the properties one-by-one to the cache object\n\t\t\tfor ( prop in data ) {\n\t\t\t\tcache[ camelCase( prop ) ] = data[ prop ];\n\t\t\t}\n\t\t}\n\t\treturn cache;\n\t},\n\tget: function( owner, key ) {\n\t\treturn key === undefined ?\n\t\t\tthis.cache( owner ) :\n\n\t\t\t// Always use camelCase key (gh-2257)\n\t\t\towner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];\n\t},\n\taccess: function( owner, key, value ) {\n\n\t\t// In cases where either:\n\t\t//\n\t\t// 1. No key was specified\n\t\t// 2. A string key was specified, but no value provided\n\t\t//\n\t\t// Take the \"read\" path and allow the get method to determine\n\t\t// which value to return, respectively either:\n\t\t//\n\t\t// 1. The entire cache object\n\t\t// 2. The data stored at the key\n\t\t//\n\t\tif ( key === undefined ||\n\t\t\t\t( ( key && typeof key === \"string\" ) && value === undefined ) ) {\n\n\t\t\treturn this.get( owner, key );\n\t\t}\n\n\t\t// When the key is not a string, or both a key and value\n\t\t// are specified, set or extend (existing objects) with either:\n\t\t//\n\t\t// 1. An object of properties\n\t\t// 2. A key and value\n\t\t//\n\t\tthis.set( owner, key, value );\n\n\t\t// Since the \"set\" path can have two possible entry points\n\t\t// return the expected data based on which path was taken[*]\n\t\treturn value !== undefined ? value : key;\n\t},\n\tremove: function( owner, key ) {\n\t\tvar i,\n\t\t\tcache = owner[ this.expando ];\n\n\t\tif ( cache === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( key !== undefined ) {\n\n\t\t\t// Support array or space separated string of keys\n\t\t\tif ( Array.isArray( key ) ) {\n\n\t\t\t\t// If key is an array of keys...\n\t\t\t\t// We always set camelCase keys, so remove that.\n\t\t\t\tkey = key.map( camelCase );\n\t\t\t} else {\n\t\t\t\tkey = camelCase( key );\n\n\t\t\t\t// If a key with the spaces exists, use it.\n\t\t\t\t// Otherwise, create an array by matching non-whitespace\n\t\t\t\tkey = key in cache ?\n\t\t\t\t\t[ key ] :\n\t\t\t\t\t( key.match( rnothtmlwhite ) || [] );\n\t\t\t}\n\n\t\t\ti = key.length;\n\n\t\t\twhile ( i-- ) {\n\t\t\t\tdelete cache[ key[ i ] ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove the expando if there's no more data\n\t\tif ( key === undefined || jQuery.isEmptyObject( cache ) ) {\n\n\t\t\t// Support: Chrome <=35 - 45\n\t\t\t// Webkit & Blink performance suffers when deleting properties\n\t\t\t// from DOM nodes, so set to undefined instead\n\t\t\t// https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)\n\t\t\tif ( owner.nodeType ) {\n\t\t\t\towner[ this.expando ] = undefined;\n\t\t\t} else {\n\t\t\t\tdelete owner[ this.expando ];\n\t\t\t}\n\t\t}\n\t},\n\thasData: function( owner ) {\n\t\tvar cache = owner[ this.expando ];\n\t\treturn cache !== undefined && !jQuery.isEmptyObject( cache );\n\t}\n};\nvar dataPriv = new Data();\n\nvar dataUser = new Data();\n\n\n\n//\tImplementation Summary\n//\n//\t1. Enforce API surface and semantic compatibility with 1.9.x branch\n//\t2. Improve the module's maintainability by reducing the storage\n//\t\tpaths to a single mechanism.\n//\t3. Use the same single mechanism to support \"private\" and \"user\" data.\n//\t4. _Never_ expose \"private\" data to user code (TODO: Drop _data, _removeData)\n//\t5. Avoid exposing implementation details on user objects (eg. expando properties)\n//\t6. Provide a clear path for implementation upgrade to WeakMap in 2014\n\nvar rbrace = /^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,\n\trmultiDash = /[A-Z]/g;\n\nfunction getData( data ) {\n\tif ( data === \"true\" ) {\n\t\treturn true;\n\t}\n\n\tif ( data === \"false\" ) {\n\t\treturn false;\n\t}\n\n\tif ( data === \"null\" ) {\n\t\treturn null;\n\t}\n\n\t// Only convert to a number if it doesn't change the string\n\tif ( data === +data + \"\" ) {\n\t\treturn +data;\n\t}\n\n\tif ( rbrace.test( data ) ) {\n\t\treturn JSON.parse( data );\n\t}\n\n\treturn data;\n}\n\nfunction dataAttr( elem, key, data ) {\n\tvar name;\n\n\t// If nothing was found internally, try to fetch any\n\t// data from the HTML5 data-* attribute\n\tif ( data === undefined && elem.nodeType === 1 ) {\n\t\tname = \"data-\" + key.replace( rmultiDash, \"-$&\" ).toLowerCase();\n\t\tdata = elem.getAttribute( name );\n\n\t\tif ( typeof data === \"string\" ) {\n\t\t\ttry {\n\t\t\t\tdata = getData( data );\n\t\t\t} catch ( e ) {}\n\n\t\t\t// Make sure we set the data so it isn't changed later\n\t\t\tdataUser.set( elem, key, data );\n\t\t} else {\n\t\t\tdata = undefined;\n\t\t}\n\t}\n\treturn data;\n}\n\njQuery.extend( {\n\thasData: function( elem ) {\n\t\treturn dataUser.hasData( elem ) || dataPriv.hasData( elem );\n\t},\n\n\tdata: function( elem, name, data ) {\n\t\treturn dataUser.access( elem, name, data );\n\t},\n\n\tremoveData: function( elem, name ) {\n\t\tdataUser.remove( elem, name );\n\t},\n\n\t// TODO: Now that all calls to _data and _removeData have been replaced\n\t// with direct calls to dataPriv methods, these can be deprecated.\n\t_data: function( elem, name, data ) {\n\t\treturn dataPriv.access( elem, name, data );\n\t},\n\n\t_removeData: function( elem, name ) {\n\t\tdataPriv.remove( elem, name );\n\t}\n} );\n\njQuery.fn.extend( {\n\tdata: function( key, value ) {\n\t\tvar i, name, data,\n\t\t\telem = this[ 0 ],\n\t\t\tattrs = elem && elem.attributes;\n\n\t\t// Gets all values\n\t\tif ( key === undefined ) {\n\t\t\tif ( this.length ) {\n\t\t\t\tdata = dataUser.get( elem );\n\n\t\t\t\tif ( elem.nodeType === 1 && !dataPriv.get( elem, \"hasDataAttrs\" ) ) {\n\t\t\t\t\ti = attrs.length;\n\t\t\t\t\twhile ( i-- ) {\n\n\t\t\t\t\t\t// Support: IE 11 only\n\t\t\t\t\t\t// The attrs elements can be null (#14894)\n\t\t\t\t\t\tif ( attrs[ i ] ) {\n\t\t\t\t\t\t\tname = attrs[ i ].name;\n\t\t\t\t\t\t\tif ( name.indexOf( \"data-\" ) === 0 ) {\n\t\t\t\t\t\t\t\tname = camelCase( name.slice( 5 ) );\n\t\t\t\t\t\t\t\tdataAttr( elem, name, data[ name ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdataPriv.set( elem, \"hasDataAttrs\", true );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\t// Sets multiple values\n\t\tif ( typeof key === \"object\" ) {\n\t\t\treturn this.each( function() {\n\t\t\t\tdataUser.set( this, key );\n\t\t\t} );\n\t\t}\n\n\t\treturn access( this, function( value ) {\n\t\t\tvar data;\n\n\t\t\t// The calling jQuery object (element matches) is not empty\n\t\t\t// (and therefore has an element appears at this[ 0 ]) and the\n\t\t\t// `value` parameter was not undefined. An empty jQuery object\n\t\t\t// will result in `undefined` for elem = this[ 0 ] which will\n\t\t\t// throw an exception if an attempt to read a data cache is made.\n\t\t\tif ( elem && value === undefined ) {\n\n\t\t\t\t// Attempt to get data from the cache\n\t\t\t\t// The key will always be camelCased in Data\n\t\t\t\tdata = dataUser.get( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// Attempt to \"discover\" the data in\n\t\t\t\t// HTML5 custom data-* attrs\n\t\t\t\tdata = dataAttr( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// We tried really hard, but the data doesn't exist.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set the data...\n\t\t\tthis.each( function() {\n\n\t\t\t\t// We always store the camelCased key\n\t\t\t\tdataUser.set( this, key, value );\n\t\t\t} );\n\t\t}, null, value, arguments.length > 1, null, true );\n\t},\n\n\tremoveData: function( key ) {\n\t\treturn this.each( function() {\n\t\t\tdataUser.remove( this, key );\n\t\t} );\n\t}\n} );\n\n\njQuery.extend( {\n\tqueue: function( elem, type, data ) {\n\t\tvar queue;\n\n\t\tif ( elem ) {\n\t\t\ttype = ( type || \"fx\" ) + \"queue\";\n\t\t\tqueue = dataPriv.get( elem, type );\n\n\t\t\t// Speed up dequeue by getting out quickly if this is just a lookup\n\t\t\tif ( data ) {\n\t\t\t\tif ( !queue || Array.isArray( data ) ) {\n\t\t\t\t\tqueue = dataPriv.access( elem, type, jQuery.makeArray( data ) );\n\t\t\t\t} else {\n\t\t\t\t\tqueue.push( data );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn queue || [];\n\t\t}\n\t},\n\n\tdequeue: function( elem, type ) {\n\t\ttype = type || \"fx\";\n\n\t\tvar queue = jQuery.queue( elem, type ),\n\t\t\tstartLength = queue.length,\n\t\t\tfn = queue.shift(),\n\t\t\thooks = jQuery._queueHooks( elem, type ),\n\t\t\tnext = function() {\n\t\t\t\tjQuery.dequeue( elem, type );\n\t\t\t};\n\n\t\t// If the fx queue is dequeued, always remove the progress sentinel\n\t\tif ( fn === \"inprogress\" ) {\n\t\t\tfn = queue.shift();\n\t\t\tstartLength--;\n\t\t}\n\n\t\tif ( fn ) {\n\n\t\t\t// Add a progress sentinel to prevent the fx queue from being\n\t\t\t// automatically dequeued\n\t\t\tif ( type === \"fx\" ) {\n\t\t\t\tqueue.unshift( \"inprogress\" );\n\t\t\t}\n\n\t\t\t// Clear up the last queue stop function\n\t\t\tdelete hooks.stop;\n\t\t\tfn.call( elem, next, hooks );\n\t\t}\n\n\t\tif ( !startLength && hooks ) {\n\t\t\thooks.empty.fire();\n\t\t}\n\t},\n\n\t// Not public - generate a queueHooks object, or return the current one\n\t_queueHooks: function( elem, type ) {\n\t\tvar key = type + \"queueHooks\";\n\t\treturn dataPriv.get( elem, key ) || dataPriv.access( elem, key, {\n\t\t\tempty: jQuery.Callbacks( \"once memory\" ).add( function() {\n\t\t\t\tdataPriv.remove( elem, [ type + \"queue\", key ] );\n\t\t\t} )\n\t\t} );\n\t}\n} );\n\njQuery.fn.extend( {\n\tqueue: function( type, data ) {\n\t\tvar setter = 2;\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tdata = type;\n\t\t\ttype = \"fx\";\n\t\t\tsetter--;\n\t\t}\n\n\t\tif ( arguments.length < setter ) {\n\t\t\treturn jQuery.queue( this[ 0 ], type );\n\t\t}\n\n\t\treturn data === undefined ?\n\t\t\tthis :\n\t\t\tthis.each( function() {\n\t\t\t\tvar queue = jQuery.queue( this, type, data );\n\n\t\t\t\t// Ensure a hooks for this queue\n\t\t\t\tjQuery._queueHooks( this, type );\n\n\t\t\t\tif ( type === \"fx\" && queue[ 0 ] !== \"inprogress\" ) {\n\t\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t\t}\n\t\t\t} );\n\t},\n\tdequeue: function( type ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.dequeue( this, type );\n\t\t} );\n\t},\n\tclearQueue: function( type ) {\n\t\treturn this.queue( type || \"fx\", [] );\n\t},\n\n\t// Get a promise resolved when queues of a certain type\n\t// are emptied (fx is the type by default)\n\tpromise: function( type, obj ) {\n\t\tvar tmp,\n\t\t\tcount = 1,\n\t\t\tdefer = jQuery.Deferred(),\n\t\t\telements = this,\n\t\t\ti = this.length,\n\t\t\tresolve = function() {\n\t\t\t\tif ( !( --count ) ) {\n\t\t\t\t\tdefer.resolveWith( elements, [ elements ] );\n\t\t\t\t}\n\t\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tobj = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\ttype = type || \"fx\";\n\n\t\twhile ( i-- ) {\n\t\t\ttmp = dataPriv.get( elements[ i ], type + \"queueHooks\" );\n\t\t\tif ( tmp && tmp.empty ) {\n\t\t\t\tcount++;\n\t\t\t\ttmp.empty.add( resolve );\n\t\t\t}\n\t\t}\n\t\tresolve();\n\t\treturn defer.promise( obj );\n\t}\n} );\nvar pnum = ( /[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/ ).source;\n\nvar rcssNum = new RegExp( \"^(?:([+-])=|)(\" + pnum + \")([a-z%]*)$\", \"i\" );\n\n\nvar cssExpand = [ \"Top\", \"Right\", \"Bottom\", \"Left\" ];\n\nvar documentElement = document.documentElement;\n\n\n\n\tvar isAttached = function( elem ) {\n\t\t\treturn jQuery.contains( elem.ownerDocument, elem );\n\t\t},\n\t\tcomposed = { composed: true };\n\n\t// Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only\n\t// Check attachment across shadow DOM boundaries when possible (gh-3504)\n\t// Support: iOS 10.0-10.2 only\n\t// Early iOS 10 versions support `attachShadow` but not `getRootNode`,\n\t// leading to errors. We need to check for `getRootNode`.\n\tif ( documentElement.getRootNode ) {\n\t\tisAttached = function( elem ) {\n\t\t\treturn jQuery.contains( elem.ownerDocument, elem ) ||\n\t\t\t\telem.getRootNode( composed ) === elem.ownerDocument;\n\t\t};\n\t}\nvar isHiddenWithinTree = function( elem, el ) {\n\n\t\t// isHiddenWithinTree might be called from jQuery#filter function;\n\t\t// in that case, element will be second argument\n\t\telem = el || elem;\n\n\t\t// Inline style trumps all\n\t\treturn elem.style.display === \"none\" ||\n\t\t\telem.style.display === \"\" &&\n\n\t\t\t// Otherwise, check computed style\n\t\t\t// Support: Firefox <=43 - 45\n\t\t\t// Disconnected elements can have computed display: none, so first confirm that elem is\n\t\t\t// in the document.\n\t\t\tisAttached( elem ) &&\n\n\t\t\tjQuery.css( elem, \"display\" ) === \"none\";\n\t};\n\n\n\nfunction adjustCSS( elem, prop, valueParts, tween ) {\n\tvar adjusted, scale,\n\t\tmaxIterations = 20,\n\t\tcurrentValue = tween ?\n\t\t\tfunction() {\n\t\t\t\treturn tween.cur();\n\t\t\t} :\n\t\t\tfunction() {\n\t\t\t\treturn jQuery.css( elem, prop, \"\" );\n\t\t\t},\n\t\tinitial = currentValue(),\n\t\tunit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" ),\n\n\t\t// Starting value computation is required for potential unit mismatches\n\t\tinitialInUnit = elem.nodeType &&\n\t\t\t( jQuery.cssNumber[ prop ] || unit !== \"px\" && +initial ) &&\n\t\t\trcssNum.exec( jQuery.css( elem, prop ) );\n\n\tif ( initialInUnit && initialInUnit[ 3 ] !== unit ) {\n\n\t\t// Support: Firefox <=54\n\t\t// Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)\n\t\tinitial = initial / 2;\n\n\t\t// Trust units reported by jQuery.css\n\t\tunit = unit || initialInUnit[ 3 ];\n\n\t\t// Iteratively approximate from a nonzero starting point\n\t\tinitialInUnit = +initial || 1;\n\n\t\twhile ( maxIterations-- ) {\n\n\t\t\t// Evaluate and update our best guess (doubling guesses that zero out).\n\t\t\t// Finish if the scale equals or crosses 1 (making the old*new product non-positive).\n\t\t\tjQuery.style( elem, prop, initialInUnit + unit );\n\t\t\tif ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {\n\t\t\t\tmaxIterations = 0;\n\t\t\t}\n\t\t\tinitialInUnit = initialInUnit / scale;\n\n\t\t}\n\n\t\tinitialInUnit = initialInUnit * 2;\n\t\tjQuery.style( elem, prop, initialInUnit + unit );\n\n\t\t// Make sure we update the tween properties later on\n\t\tvalueParts = valueParts || [];\n\t}\n\n\tif ( valueParts ) {\n\t\tinitialInUnit = +initialInUnit || +initial || 0;\n\n\t\t// Apply relative offset (+=/-=) if specified\n\t\tadjusted = valueParts[ 1 ] ?\n\t\t\tinitialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :\n\t\t\t+valueParts[ 2 ];\n\t\tif ( tween ) {\n\t\t\ttween.unit = unit;\n\t\t\ttween.start = initialInUnit;\n\t\t\ttween.end = adjusted;\n\t\t}\n\t}\n\treturn adjusted;\n}\n\n\nvar defaultDisplayMap = {};\n\nfunction getDefaultDisplay( elem ) {\n\tvar temp,\n\t\tdoc = elem.ownerDocument,\n\t\tnodeName = elem.nodeName,\n\t\tdisplay = defaultDisplayMap[ nodeName ];\n\n\tif ( display ) {\n\t\treturn display;\n\t}\n\n\ttemp = doc.body.appendChild( doc.createElement( nodeName ) );\n\tdisplay = jQuery.css( temp, \"display\" );\n\n\ttemp.parentNode.removeChild( temp );\n\n\tif ( display === \"none\" ) {\n\t\tdisplay = \"block\";\n\t}\n\tdefaultDisplayMap[ nodeName ] = display;\n\n\treturn display;\n}\n\nfunction showHide( elements, show ) {\n\tvar display, elem,\n\t\tvalues = [],\n\t\tindex = 0,\n\t\tlength = elements.length;\n\n\t// Determine new display value for elements that need to change\n\tfor ( ; index < length; index++ ) {\n\t\telem = elements[ index ];\n\t\tif ( !elem.style ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tdisplay = elem.style.display;\n\t\tif ( show ) {\n\n\t\t\t// Since we force visibility upon cascade-hidden elements, an immediate (and slow)\n\t\t\t// check is required in this first loop unless we have a nonempty display value (either\n\t\t\t// inline or about-to-be-restored)\n\t\t\tif ( display === \"none\" ) {\n\t\t\t\tvalues[ index ] = dataPriv.get( elem, \"display\" ) || null;\n\t\t\t\tif ( !values[ index ] ) {\n\t\t\t\t\telem.style.display = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( elem.style.display === \"\" && isHiddenWithinTree( elem ) ) {\n\t\t\t\tvalues[ index ] = getDefaultDisplay( elem );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( display !== \"none\" ) {\n\t\t\t\tvalues[ index ] = \"none\";\n\n\t\t\t\t// Remember what we're overwriting\n\t\t\t\tdataPriv.set( elem, \"display\", display );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Set the display of the elements in a second loop to avoid constant reflow\n\tfor ( index = 0; index < length; index++ ) {\n\t\tif ( values[ index ] != null ) {\n\t\t\telements[ index ].style.display = values[ index ];\n\t\t}\n\t}\n\n\treturn elements;\n}\n\njQuery.fn.extend( {\n\tshow: function() {\n\t\treturn showHide( this, true );\n\t},\n\thide: function() {\n\t\treturn showHide( this );\n\t},\n\ttoggle: function( state ) {\n\t\tif ( typeof state === \"boolean\" ) {\n\t\t\treturn state ? this.show() : this.hide();\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tif ( isHiddenWithinTree( this ) ) {\n\t\t\t\tjQuery( this ).show();\n\t\t\t} else {\n\t\t\t\tjQuery( this ).hide();\n\t\t\t}\n\t\t} );\n\t}\n} );\nvar rcheckableType = ( /^(?:checkbox|radio)$/i );\n\nvar rtagName = ( /<([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)/i );\n\nvar rscriptType = ( /^$|^module$|\\/(?:java|ecma)script/i );\n\n\n\n( function() {\n\tvar fragment = document.createDocumentFragment(),\n\t\tdiv = fragment.appendChild( document.createElement( \"div\" ) ),\n\t\tinput = document.createElement( \"input\" );\n\n\t// Support: Android 4.0 - 4.3 only\n\t// Check state lost if the name is set (#11217)\n\t// Support: Windows Web Apps (WWA)\n\t// `name` and `type` must use .setAttribute for WWA (#14901)\n\tinput.setAttribute( \"type\", \"radio\" );\n\tinput.setAttribute( \"checked\", \"checked\" );\n\tinput.setAttribute( \"name\", \"t\" );\n\n\tdiv.appendChild( input );\n\n\t// Support: Android <=4.1 only\n\t// Older WebKit doesn't clone checked state correctly in fragments\n\tsupport.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;\n\n\t// Support: IE <=11 only\n\t// Make sure textarea (and checkbox) defaultValue is properly cloned\n\tdiv.innerHTML = \"\";\n\tsupport.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;\n\n\t// Support: IE <=9 only\n\t// IE <=9 replaces \";\n\tsupport.option = !!div.lastChild;\n} )();\n\n\n// We have to close these tags to support XHTML (#13200)\nvar wrapMap = {\n\n\t// XHTML parsers do not magically insert elements in the\n\t// same way that tag soup parsers do. So we cannot shorten\n\t// this by omitting or other required elements.\n\tthead: [ 1, \"\", \"
                    \" ],\n\tcol: [ 2, \"\", \"
                    \" ],\n\ttr: [ 2, \"\", \"
                    \" ],\n\ttd: [ 3, \"\", \"
                    \" ],\n\n\t_default: [ 0, \"\", \"\" ]\n};\n\nwrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\nwrapMap.th = wrapMap.td;\n\n// Support: IE <=9 only\nif ( !support.option ) {\n\twrapMap.optgroup = wrapMap.option = [ 1, \"\" ];\n}\n\n\nfunction getAll( context, tag ) {\n\n\t// Support: IE <=9 - 11 only\n\t// Use typeof to avoid zero-argument method invocation on host objects (#15151)\n\tvar ret;\n\n\tif ( typeof context.getElementsByTagName !== \"undefined\" ) {\n\t\tret = context.getElementsByTagName( tag || \"*\" );\n\n\t} else if ( typeof context.querySelectorAll !== \"undefined\" ) {\n\t\tret = context.querySelectorAll( tag || \"*\" );\n\n\t} else {\n\t\tret = [];\n\t}\n\n\tif ( tag === undefined || tag && nodeName( context, tag ) ) {\n\t\treturn jQuery.merge( [ context ], ret );\n\t}\n\n\treturn ret;\n}\n\n\n// Mark scripts as having already been evaluated\nfunction setGlobalEval( elems, refElements ) {\n\tvar i = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\tdataPriv.set(\n\t\t\telems[ i ],\n\t\t\t\"globalEval\",\n\t\t\t!refElements || dataPriv.get( refElements[ i ], \"globalEval\" )\n\t\t);\n\t}\n}\n\n\nvar rhtml = /<|&#?\\w+;/;\n\nfunction buildFragment( elems, context, scripts, selection, ignored ) {\n\tvar elem, tmp, tag, wrap, attached, j,\n\t\tfragment = context.createDocumentFragment(),\n\t\tnodes = [],\n\t\ti = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\telem = elems[ i ];\n\n\t\tif ( elem || elem === 0 ) {\n\n\t\t\t// Add nodes directly\n\t\t\tif ( toType( elem ) === \"object\" ) {\n\n\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\tjQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );\n\n\t\t\t// Convert non-html into a text node\n\t\t\t} else if ( !rhtml.test( elem ) ) {\n\t\t\t\tnodes.push( context.createTextNode( elem ) );\n\n\t\t\t// Convert html into DOM nodes\n\t\t\t} else {\n\t\t\t\ttmp = tmp || fragment.appendChild( context.createElement( \"div\" ) );\n\n\t\t\t\t// Deserialize a standard representation\n\t\t\t\ttag = ( rtagName.exec( elem ) || [ \"\", \"\" ] )[ 1 ].toLowerCase();\n\t\t\t\twrap = wrapMap[ tag ] || wrapMap._default;\n\t\t\t\ttmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];\n\n\t\t\t\t// Descend through wrappers to the right content\n\t\t\t\tj = wrap[ 0 ];\n\t\t\t\twhile ( j-- ) {\n\t\t\t\t\ttmp = tmp.lastChild;\n\t\t\t\t}\n\n\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\tjQuery.merge( nodes, tmp.childNodes );\n\n\t\t\t\t// Remember the top-level container\n\t\t\t\ttmp = fragment.firstChild;\n\n\t\t\t\t// Ensure the created nodes are orphaned (#12392)\n\t\t\t\ttmp.textContent = \"\";\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove wrapper from fragment\n\tfragment.textContent = \"\";\n\n\ti = 0;\n\twhile ( ( elem = nodes[ i++ ] ) ) {\n\n\t\t// Skip elements already in the context collection (trac-4087)\n\t\tif ( selection && jQuery.inArray( elem, selection ) > -1 ) {\n\t\t\tif ( ignored ) {\n\t\t\t\tignored.push( elem );\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tattached = isAttached( elem );\n\n\t\t// Append to fragment\n\t\ttmp = getAll( fragment.appendChild( elem ), \"script\" );\n\n\t\t// Preserve script evaluation history\n\t\tif ( attached ) {\n\t\t\tsetGlobalEval( tmp );\n\t\t}\n\n\t\t// Capture executables\n\t\tif ( scripts ) {\n\t\t\tj = 0;\n\t\t\twhile ( ( elem = tmp[ j++ ] ) ) {\n\t\t\t\tif ( rscriptType.test( elem.type || \"\" ) ) {\n\t\t\t\t\tscripts.push( elem );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn fragment;\n}\n\n\nvar\n\trkeyEvent = /^key/,\n\trmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,\n\trtypenamespace = /^([^.]*)(?:\\.(.+)|)/;\n\nfunction returnTrue() {\n\treturn true;\n}\n\nfunction returnFalse() {\n\treturn false;\n}\n\n// Support: IE <=9 - 11+\n// focus() and blur() are asynchronous, except when they are no-op.\n// So expect focus to be synchronous when the element is already active,\n// and blur to be synchronous when the element is not already active.\n// (focus and blur are always synchronous in other supported browsers,\n// this just defines when we can count on it).\nfunction expectSync( elem, type ) {\n\treturn ( elem === safeActiveElement() ) === ( type === \"focus\" );\n}\n\n// Support: IE <=9 only\n// Accessing document.activeElement can throw unexpectedly\n// https://bugs.jquery.com/ticket/13393\nfunction safeActiveElement() {\n\ttry {\n\t\treturn document.activeElement;\n\t} catch ( err ) { }\n}\n\nfunction on( elem, types, selector, data, fn, one ) {\n\tvar origFn, type;\n\n\t// Types can be a map of types/handlers\n\tif ( typeof types === \"object\" ) {\n\n\t\t// ( types-Object, selector, data )\n\t\tif ( typeof selector !== \"string\" ) {\n\n\t\t\t// ( types-Object, data )\n\t\t\tdata = data || selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tfor ( type in types ) {\n\t\t\ton( elem, type, selector, data, types[ type ], one );\n\t\t}\n\t\treturn elem;\n\t}\n\n\tif ( data == null && fn == null ) {\n\n\t\t// ( types, fn )\n\t\tfn = selector;\n\t\tdata = selector = undefined;\n\t} else if ( fn == null ) {\n\t\tif ( typeof selector === \"string\" ) {\n\n\t\t\t// ( types, selector, fn )\n\t\t\tfn = data;\n\t\t\tdata = undefined;\n\t\t} else {\n\n\t\t\t// ( types, data, fn )\n\t\t\tfn = data;\n\t\t\tdata = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t}\n\tif ( fn === false ) {\n\t\tfn = returnFalse;\n\t} else if ( !fn ) {\n\t\treturn elem;\n\t}\n\n\tif ( one === 1 ) {\n\t\torigFn = fn;\n\t\tfn = function( event ) {\n\n\t\t\t// Can use an empty set, since event contains the info\n\t\t\tjQuery().off( event );\n\t\t\treturn origFn.apply( this, arguments );\n\t\t};\n\n\t\t// Use same guid so caller can remove using origFn\n\t\tfn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );\n\t}\n\treturn elem.each( function() {\n\t\tjQuery.event.add( this, types, fn, data, selector );\n\t} );\n}\n\n/*\n * Helper functions for managing events -- not part of the public interface.\n * Props to Dean Edwards' addEvent library for many of the ideas.\n */\njQuery.event = {\n\n\tglobal: {},\n\n\tadd: function( elem, types, handler, data, selector ) {\n\n\t\tvar handleObjIn, eventHandle, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = dataPriv.get( elem );\n\n\t\t// Only attach events to objects that accept data\n\t\tif ( !acceptData( elem ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Caller can pass in an object of custom data in lieu of the handler\n\t\tif ( handler.handler ) {\n\t\t\thandleObjIn = handler;\n\t\t\thandler = handleObjIn.handler;\n\t\t\tselector = handleObjIn.selector;\n\t\t}\n\n\t\t// Ensure that invalid selectors throw exceptions at attach time\n\t\t// Evaluate against documentElement in case elem is a non-element node (e.g., document)\n\t\tif ( selector ) {\n\t\t\tjQuery.find.matchesSelector( documentElement, selector );\n\t\t}\n\n\t\t// Make sure that the handler has a unique ID, used to find/remove it later\n\t\tif ( !handler.guid ) {\n\t\t\thandler.guid = jQuery.guid++;\n\t\t}\n\n\t\t// Init the element's event structure and main handler, if this is the first\n\t\tif ( !( events = elemData.events ) ) {\n\t\t\tevents = elemData.events = Object.create( null );\n\t\t}\n\t\tif ( !( eventHandle = elemData.handle ) ) {\n\t\t\teventHandle = elemData.handle = function( e ) {\n\n\t\t\t\t// Discard the second event of a jQuery.event.trigger() and\n\t\t\t\t// when an event is called after a page has unloaded\n\t\t\t\treturn typeof jQuery !== \"undefined\" && jQuery.event.triggered !== e.type ?\n\t\t\t\t\tjQuery.event.dispatch.apply( elem, arguments ) : undefined;\n\t\t\t};\n\t\t}\n\n\t\t// Handle multiple events separated by a space\n\t\ttypes = ( types || \"\" ).match( rnothtmlwhite ) || [ \"\" ];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[ t ] ) || [];\n\t\t\ttype = origType = tmp[ 1 ];\n\t\t\tnamespaces = ( tmp[ 2 ] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// There *must* be a type, no attaching namespace-only handlers\n\t\t\tif ( !type ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If event changes its type, use the special event handlers for the changed type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// If selector defined, determine special event api type, otherwise given type\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\n\t\t\t// Update special based on newly reset type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// handleObj is passed to all event handlers\n\t\t\thandleObj = jQuery.extend( {\n\t\t\t\ttype: type,\n\t\t\t\torigType: origType,\n\t\t\t\tdata: data,\n\t\t\t\thandler: handler,\n\t\t\t\tguid: handler.guid,\n\t\t\t\tselector: selector,\n\t\t\t\tneedsContext: selector && jQuery.expr.match.needsContext.test( selector ),\n\t\t\t\tnamespace: namespaces.join( \".\" )\n\t\t\t}, handleObjIn );\n\n\t\t\t// Init the event handler queue if we're the first\n\t\t\tif ( !( handlers = events[ type ] ) ) {\n\t\t\t\thandlers = events[ type ] = [];\n\t\t\t\thandlers.delegateCount = 0;\n\n\t\t\t\t// Only use addEventListener if the special events handler returns false\n\t\t\t\tif ( !special.setup ||\n\t\t\t\t\tspecial.setup.call( elem, data, namespaces, eventHandle ) === false ) {\n\n\t\t\t\t\tif ( elem.addEventListener ) {\n\t\t\t\t\t\telem.addEventListener( type, eventHandle );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( special.add ) {\n\t\t\t\tspecial.add.call( elem, handleObj );\n\n\t\t\t\tif ( !handleObj.handler.guid ) {\n\t\t\t\t\thandleObj.handler.guid = handler.guid;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add to the element's handler list, delegates in front\n\t\t\tif ( selector ) {\n\t\t\t\thandlers.splice( handlers.delegateCount++, 0, handleObj );\n\t\t\t} else {\n\t\t\t\thandlers.push( handleObj );\n\t\t\t}\n\n\t\t\t// Keep track of which events have ever been used, for event optimization\n\t\t\tjQuery.event.global[ type ] = true;\n\t\t}\n\n\t},\n\n\t// Detach an event or set of events from an element\n\tremove: function( elem, types, handler, selector, mappedTypes ) {\n\n\t\tvar j, origCount, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = dataPriv.hasData( elem ) && dataPriv.get( elem );\n\n\t\tif ( !elemData || !( events = elemData.events ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Once for each type.namespace in types; type may be omitted\n\t\ttypes = ( types || \"\" ).match( rnothtmlwhite ) || [ \"\" ];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[ t ] ) || [];\n\t\t\ttype = origType = tmp[ 1 ];\n\t\t\tnamespaces = ( tmp[ 2 ] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// Unbind all events (on this namespace, if provided) for the element\n\t\t\tif ( !type ) {\n\t\t\t\tfor ( type in events ) {\n\t\t\t\t\tjQuery.event.remove( elem, type + types[ t ], handler, selector, true );\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\t\t\thandlers = events[ type ] || [];\n\t\t\ttmp = tmp[ 2 ] &&\n\t\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join( \"\\\\.(?:.*\\\\.|)\" ) + \"(\\\\.|$)\" );\n\n\t\t\t// Remove matching events\n\t\t\torigCount = j = handlers.length;\n\t\t\twhile ( j-- ) {\n\t\t\t\thandleObj = handlers[ j ];\n\n\t\t\t\tif ( ( mappedTypes || origType === handleObj.origType ) &&\n\t\t\t\t\t( !handler || handler.guid === handleObj.guid ) &&\n\t\t\t\t\t( !tmp || tmp.test( handleObj.namespace ) ) &&\n\t\t\t\t\t( !selector || selector === handleObj.selector ||\n\t\t\t\t\t\tselector === \"**\" && handleObj.selector ) ) {\n\t\t\t\t\thandlers.splice( j, 1 );\n\n\t\t\t\t\tif ( handleObj.selector ) {\n\t\t\t\t\t\thandlers.delegateCount--;\n\t\t\t\t\t}\n\t\t\t\t\tif ( special.remove ) {\n\t\t\t\t\t\tspecial.remove.call( elem, handleObj );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove generic event handler if we removed something and no more handlers exist\n\t\t\t// (avoids potential for endless recursion during removal of special event handlers)\n\t\t\tif ( origCount && !handlers.length ) {\n\t\t\t\tif ( !special.teardown ||\n\t\t\t\t\tspecial.teardown.call( elem, namespaces, elemData.handle ) === false ) {\n\n\t\t\t\t\tjQuery.removeEvent( elem, type, elemData.handle );\n\t\t\t\t}\n\n\t\t\t\tdelete events[ type ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove data and the expando if it's no longer used\n\t\tif ( jQuery.isEmptyObject( events ) ) {\n\t\t\tdataPriv.remove( elem, \"handle events\" );\n\t\t}\n\t},\n\n\tdispatch: function( nativeEvent ) {\n\n\t\tvar i, j, ret, matched, handleObj, handlerQueue,\n\t\t\targs = new Array( arguments.length ),\n\n\t\t\t// Make a writable jQuery.Event from the native event object\n\t\t\tevent = jQuery.event.fix( nativeEvent ),\n\n\t\t\thandlers = (\n\t\t\t\t\tdataPriv.get( this, \"events\" ) || Object.create( null )\n\t\t\t\t)[ event.type ] || [],\n\t\t\tspecial = jQuery.event.special[ event.type ] || {};\n\n\t\t// Use the fix-ed jQuery.Event rather than the (read-only) native event\n\t\targs[ 0 ] = event;\n\n\t\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\n\t\tevent.delegateTarget = this;\n\n\t\t// Call the preDispatch hook for the mapped type, and let it bail if desired\n\t\tif ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine handlers\n\t\thandlerQueue = jQuery.event.handlers.call( this, event, handlers );\n\n\t\t// Run delegates first; they may want to stop propagation beneath us\n\t\ti = 0;\n\t\twhile ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {\n\t\t\tevent.currentTarget = matched.elem;\n\n\t\t\tj = 0;\n\t\t\twhile ( ( handleObj = matched.handlers[ j++ ] ) &&\n\t\t\t\t!event.isImmediatePropagationStopped() ) {\n\n\t\t\t\t// If the event is namespaced, then each handler is only invoked if it is\n\t\t\t\t// specially universal or its namespaces are a superset of the event's.\n\t\t\t\tif ( !event.rnamespace || handleObj.namespace === false ||\n\t\t\t\t\tevent.rnamespace.test( handleObj.namespace ) ) {\n\n\t\t\t\t\tevent.handleObj = handleObj;\n\t\t\t\t\tevent.data = handleObj.data;\n\n\t\t\t\t\tret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||\n\t\t\t\t\t\thandleObj.handler ).apply( matched.elem, args );\n\n\t\t\t\t\tif ( ret !== undefined ) {\n\t\t\t\t\t\tif ( ( event.result = ret ) === false ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Call the postDispatch hook for the mapped type\n\t\tif ( special.postDispatch ) {\n\t\t\tspecial.postDispatch.call( this, event );\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\thandlers: function( event, handlers ) {\n\t\tvar i, handleObj, sel, matchedHandlers, matchedSelectors,\n\t\t\thandlerQueue = [],\n\t\t\tdelegateCount = handlers.delegateCount,\n\t\t\tcur = event.target;\n\n\t\t// Find delegate handlers\n\t\tif ( delegateCount &&\n\n\t\t\t// Support: IE <=9\n\t\t\t// Black-hole SVG instance trees (trac-13180)\n\t\t\tcur.nodeType &&\n\n\t\t\t// Support: Firefox <=42\n\t\t\t// Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)\n\t\t\t// https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click\n\t\t\t// Support: IE 11 only\n\t\t\t// ...but not arrow key \"clicks\" of radio inputs, which can have `button` -1 (gh-2343)\n\t\t\t!( event.type === \"click\" && event.button >= 1 ) ) {\n\n\t\t\tfor ( ; cur !== this; cur = cur.parentNode || this ) {\n\n\t\t\t\t// Don't check non-elements (#13208)\n\t\t\t\t// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)\n\t\t\t\tif ( cur.nodeType === 1 && !( event.type === \"click\" && cur.disabled === true ) ) {\n\t\t\t\t\tmatchedHandlers = [];\n\t\t\t\t\tmatchedSelectors = {};\n\t\t\t\t\tfor ( i = 0; i < delegateCount; i++ ) {\n\t\t\t\t\t\thandleObj = handlers[ i ];\n\n\t\t\t\t\t\t// Don't conflict with Object.prototype properties (#13203)\n\t\t\t\t\t\tsel = handleObj.selector + \" \";\n\n\t\t\t\t\t\tif ( matchedSelectors[ sel ] === undefined ) {\n\t\t\t\t\t\t\tmatchedSelectors[ sel ] = handleObj.needsContext ?\n\t\t\t\t\t\t\t\tjQuery( sel, this ).index( cur ) > -1 :\n\t\t\t\t\t\t\t\tjQuery.find( sel, this, null, [ cur ] ).length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( matchedSelectors[ sel ] ) {\n\t\t\t\t\t\t\tmatchedHandlers.push( handleObj );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( matchedHandlers.length ) {\n\t\t\t\t\t\thandlerQueue.push( { elem: cur, handlers: matchedHandlers } );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Add the remaining (directly-bound) handlers\n\t\tcur = this;\n\t\tif ( delegateCount < handlers.length ) {\n\t\t\thandlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );\n\t\t}\n\n\t\treturn handlerQueue;\n\t},\n\n\taddProp: function( name, hook ) {\n\t\tObject.defineProperty( jQuery.Event.prototype, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\n\t\t\tget: isFunction( hook ) ?\n\t\t\t\tfunction() {\n\t\t\t\t\tif ( this.originalEvent ) {\n\t\t\t\t\t\t\treturn hook( this.originalEvent );\n\t\t\t\t\t}\n\t\t\t\t} :\n\t\t\t\tfunction() {\n\t\t\t\t\tif ( this.originalEvent ) {\n\t\t\t\t\t\t\treturn this.originalEvent[ name ];\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\tset: function( value ) {\n\t\t\t\tObject.defineProperty( this, name, {\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tvalue: value\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t},\n\n\tfix: function( originalEvent ) {\n\t\treturn originalEvent[ jQuery.expando ] ?\n\t\t\toriginalEvent :\n\t\t\tnew jQuery.Event( originalEvent );\n\t},\n\n\tspecial: {\n\t\tload: {\n\n\t\t\t// Prevent triggered image.load events from bubbling to window.load\n\t\t\tnoBubble: true\n\t\t},\n\t\tclick: {\n\n\t\t\t// Utilize native event to ensure correct state for checkable inputs\n\t\t\tsetup: function( data ) {\n\n\t\t\t\t// For mutual compressibility with _default, replace `this` access with a local var.\n\t\t\t\t// `|| data` is dead code meant only to preserve the variable through minification.\n\t\t\t\tvar el = this || data;\n\n\t\t\t\t// Claim the first handler\n\t\t\t\tif ( rcheckableType.test( el.type ) &&\n\t\t\t\t\tel.click && nodeName( el, \"input\" ) ) {\n\n\t\t\t\t\t// dataPriv.set( el, \"click\", ... )\n\t\t\t\t\tleverageNative( el, \"click\", returnTrue );\n\t\t\t\t}\n\n\t\t\t\t// Return false to allow normal processing in the caller\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\ttrigger: function( data ) {\n\n\t\t\t\t// For mutual compressibility with _default, replace `this` access with a local var.\n\t\t\t\t// `|| data` is dead code meant only to preserve the variable through minification.\n\t\t\t\tvar el = this || data;\n\n\t\t\t\t// Force setup before triggering a click\n\t\t\t\tif ( rcheckableType.test( el.type ) &&\n\t\t\t\t\tel.click && nodeName( el, \"input\" ) ) {\n\n\t\t\t\t\tleverageNative( el, \"click\" );\n\t\t\t\t}\n\n\t\t\t\t// Return non-false to allow normal event-path propagation\n\t\t\t\treturn true;\n\t\t\t},\n\n\t\t\t// For cross-browser consistency, suppress native .click() on links\n\t\t\t// Also prevent it if we're currently inside a leveraged native-event stack\n\t\t\t_default: function( event ) {\n\t\t\t\tvar target = event.target;\n\t\t\t\treturn rcheckableType.test( target.type ) &&\n\t\t\t\t\ttarget.click && nodeName( target, \"input\" ) &&\n\t\t\t\t\tdataPriv.get( target, \"click\" ) ||\n\t\t\t\t\tnodeName( target, \"a\" );\n\t\t\t}\n\t\t},\n\n\t\tbeforeunload: {\n\t\t\tpostDispatch: function( event ) {\n\n\t\t\t\t// Support: Firefox 20+\n\t\t\t\t// Firefox doesn't alert if the returnValue field is not set.\n\t\t\t\tif ( event.result !== undefined && event.originalEvent ) {\n\t\t\t\t\tevent.originalEvent.returnValue = event.result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Ensure the presence of an event listener that handles manually-triggered\n// synthetic events by interrupting progress until reinvoked in response to\n// *native* events that it fires directly, ensuring that state changes have\n// already occurred before other listeners are invoked.\nfunction leverageNative( el, type, expectSync ) {\n\n\t// Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add\n\tif ( !expectSync ) {\n\t\tif ( dataPriv.get( el, type ) === undefined ) {\n\t\t\tjQuery.event.add( el, type, returnTrue );\n\t\t}\n\t\treturn;\n\t}\n\n\t// Register the controller as a special universal handler for all event namespaces\n\tdataPriv.set( el, type, false );\n\tjQuery.event.add( el, type, {\n\t\tnamespace: false,\n\t\thandler: function( event ) {\n\t\t\tvar notAsync, result,\n\t\t\t\tsaved = dataPriv.get( this, type );\n\n\t\t\tif ( ( event.isTrigger & 1 ) && this[ type ] ) {\n\n\t\t\t\t// Interrupt processing of the outer synthetic .trigger()ed event\n\t\t\t\t// Saved data should be false in such cases, but might be a leftover capture object\n\t\t\t\t// from an async native handler (gh-4350)\n\t\t\t\tif ( !saved.length ) {\n\n\t\t\t\t\t// Store arguments for use when handling the inner native event\n\t\t\t\t\t// There will always be at least one argument (an event object), so this array\n\t\t\t\t\t// will not be confused with a leftover capture object.\n\t\t\t\t\tsaved = slice.call( arguments );\n\t\t\t\t\tdataPriv.set( this, type, saved );\n\n\t\t\t\t\t// Trigger the native event and capture its result\n\t\t\t\t\t// Support: IE <=9 - 11+\n\t\t\t\t\t// focus() and blur() are asynchronous\n\t\t\t\t\tnotAsync = expectSync( this, type );\n\t\t\t\t\tthis[ type ]();\n\t\t\t\t\tresult = dataPriv.get( this, type );\n\t\t\t\t\tif ( saved !== result || notAsync ) {\n\t\t\t\t\t\tdataPriv.set( this, type, false );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = {};\n\t\t\t\t\t}\n\t\t\t\t\tif ( saved !== result ) {\n\n\t\t\t\t\t\t// Cancel the outer synthetic event\n\t\t\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\treturn result.value;\n\t\t\t\t\t}\n\n\t\t\t\t// If this is an inner synthetic event for an event with a bubbling surrogate\n\t\t\t\t// (focus or blur), assume that the surrogate already propagated from triggering the\n\t\t\t\t// native event and prevent that from happening again here.\n\t\t\t\t// This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the\n\t\t\t\t// bubbling surrogate propagates *after* the non-bubbling base), but that seems\n\t\t\t\t// less bad than duplication.\n\t\t\t\t} else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t}\n\n\t\t\t// If this is a native event triggered above, everything is now in order\n\t\t\t// Fire an inner synthetic event with the original arguments\n\t\t\t} else if ( saved.length ) {\n\n\t\t\t\t// ...and capture the result\n\t\t\t\tdataPriv.set( this, type, {\n\t\t\t\t\tvalue: jQuery.event.trigger(\n\n\t\t\t\t\t\t// Support: IE <=9 - 11+\n\t\t\t\t\t\t// Extend with the prototype to reset the above stopImmediatePropagation()\n\t\t\t\t\t\tjQuery.extend( saved[ 0 ], jQuery.Event.prototype ),\n\t\t\t\t\t\tsaved.slice( 1 ),\n\t\t\t\t\t\tthis\n\t\t\t\t\t)\n\t\t\t\t} );\n\n\t\t\t\t// Abort handling of the native event\n\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t}\n\t\t}\n\t} );\n}\n\njQuery.removeEvent = function( elem, type, handle ) {\n\n\t// This \"if\" is needed for plain objects\n\tif ( elem.removeEventListener ) {\n\t\telem.removeEventListener( type, handle );\n\t}\n};\n\njQuery.Event = function( src, props ) {\n\n\t// Allow instantiation without the 'new' keyword\n\tif ( !( this instanceof jQuery.Event ) ) {\n\t\treturn new jQuery.Event( src, props );\n\t}\n\n\t// Event object\n\tif ( src && src.type ) {\n\t\tthis.originalEvent = src;\n\t\tthis.type = src.type;\n\n\t\t// Events bubbling up the document may have been marked as prevented\n\t\t// by a handler lower down the tree; reflect the correct value.\n\t\tthis.isDefaultPrevented = src.defaultPrevented ||\n\t\t\t\tsrc.defaultPrevented === undefined &&\n\n\t\t\t\t// Support: Android <=2.3 only\n\t\t\t\tsrc.returnValue === false ?\n\t\t\treturnTrue :\n\t\t\treturnFalse;\n\n\t\t// Create target properties\n\t\t// Support: Safari <=6 - 7 only\n\t\t// Target should not be a text node (#504, #13143)\n\t\tthis.target = ( src.target && src.target.nodeType === 3 ) ?\n\t\t\tsrc.target.parentNode :\n\t\t\tsrc.target;\n\n\t\tthis.currentTarget = src.currentTarget;\n\t\tthis.relatedTarget = src.relatedTarget;\n\n\t// Event type\n\t} else {\n\t\tthis.type = src;\n\t}\n\n\t// Put explicitly provided properties onto the event object\n\tif ( props ) {\n\t\tjQuery.extend( this, props );\n\t}\n\n\t// Create a timestamp if incoming event doesn't have one\n\tthis.timeStamp = src && src.timeStamp || Date.now();\n\n\t// Mark it as fixed\n\tthis[ jQuery.expando ] = true;\n};\n\n// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding\n// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\njQuery.Event.prototype = {\n\tconstructor: jQuery.Event,\n\tisDefaultPrevented: returnFalse,\n\tisPropagationStopped: returnFalse,\n\tisImmediatePropagationStopped: returnFalse,\n\tisSimulated: false,\n\n\tpreventDefault: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isDefaultPrevented = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.preventDefault();\n\t\t}\n\t},\n\tstopPropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isPropagationStopped = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.stopPropagation();\n\t\t}\n\t},\n\tstopImmediatePropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isImmediatePropagationStopped = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.stopImmediatePropagation();\n\t\t}\n\n\t\tthis.stopPropagation();\n\t}\n};\n\n// Includes all common event props including KeyEvent and MouseEvent specific props\njQuery.each( {\n\taltKey: true,\n\tbubbles: true,\n\tcancelable: true,\n\tchangedTouches: true,\n\tctrlKey: true,\n\tdetail: true,\n\teventPhase: true,\n\tmetaKey: true,\n\tpageX: true,\n\tpageY: true,\n\tshiftKey: true,\n\tview: true,\n\t\"char\": true,\n\tcode: true,\n\tcharCode: true,\n\tkey: true,\n\tkeyCode: true,\n\tbutton: true,\n\tbuttons: true,\n\tclientX: true,\n\tclientY: true,\n\toffsetX: true,\n\toffsetY: true,\n\tpointerId: true,\n\tpointerType: true,\n\tscreenX: true,\n\tscreenY: true,\n\ttargetTouches: true,\n\ttoElement: true,\n\ttouches: true,\n\n\twhich: function( event ) {\n\t\tvar button = event.button;\n\n\t\t// Add which for key events\n\t\tif ( event.which == null && rkeyEvent.test( event.type ) ) {\n\t\t\treturn event.charCode != null ? event.charCode : event.keyCode;\n\t\t}\n\n\t\t// Add which for click: 1 === left; 2 === middle; 3 === right\n\t\tif ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {\n\t\t\tif ( button & 1 ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\tif ( button & 2 ) {\n\t\t\t\treturn 3;\n\t\t\t}\n\n\t\t\tif ( button & 4 ) {\n\t\t\t\treturn 2;\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn event.which;\n\t}\n}, jQuery.event.addProp );\n\njQuery.each( { focus: \"focusin\", blur: \"focusout\" }, function( type, delegateType ) {\n\tjQuery.event.special[ type ] = {\n\n\t\t// Utilize native event if possible so blur/focus sequence is correct\n\t\tsetup: function() {\n\n\t\t\t// Claim the first handler\n\t\t\t// dataPriv.set( this, \"focus\", ... )\n\t\t\t// dataPriv.set( this, \"blur\", ... )\n\t\t\tleverageNative( this, type, expectSync );\n\n\t\t\t// Return false to allow normal processing in the caller\n\t\t\treturn false;\n\t\t},\n\t\ttrigger: function() {\n\n\t\t\t// Force setup before trigger\n\t\t\tleverageNative( this, type );\n\n\t\t\t// Return non-false to allow normal event-path propagation\n\t\t\treturn true;\n\t\t},\n\n\t\tdelegateType: delegateType\n\t};\n} );\n\n// Create mouseenter/leave events using mouseover/out and event-time checks\n// so that event delegation works in jQuery.\n// Do the same for pointerenter/pointerleave and pointerover/pointerout\n//\n// Support: Safari 7 only\n// Safari sends mouseenter too often; see:\n// https://bugs.chromium.org/p/chromium/issues/detail?id=470258\n// for the description of the bug (it existed in older Chrome versions as well).\njQuery.each( {\n\tmouseenter: \"mouseover\",\n\tmouseleave: \"mouseout\",\n\tpointerenter: \"pointerover\",\n\tpointerleave: \"pointerout\"\n}, function( orig, fix ) {\n\tjQuery.event.special[ orig ] = {\n\t\tdelegateType: fix,\n\t\tbindType: fix,\n\n\t\thandle: function( event ) {\n\t\t\tvar ret,\n\t\t\t\ttarget = this,\n\t\t\t\trelated = event.relatedTarget,\n\t\t\t\thandleObj = event.handleObj;\n\n\t\t\t// For mouseenter/leave call the handler if related is outside the target.\n\t\t\t// NB: No relatedTarget if the mouse left/entered the browser window\n\t\t\tif ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {\n\t\t\t\tevent.type = handleObj.origType;\n\t\t\t\tret = handleObj.handler.apply( this, arguments );\n\t\t\t\tevent.type = fix;\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\t};\n} );\n\njQuery.fn.extend( {\n\n\ton: function( types, selector, data, fn ) {\n\t\treturn on( this, types, selector, data, fn );\n\t},\n\tone: function( types, selector, data, fn ) {\n\t\treturn on( this, types, selector, data, fn, 1 );\n\t},\n\toff: function( types, selector, fn ) {\n\t\tvar handleObj, type;\n\t\tif ( types && types.preventDefault && types.handleObj ) {\n\n\t\t\t// ( event ) dispatched jQuery.Event\n\t\t\thandleObj = types.handleObj;\n\t\t\tjQuery( types.delegateTarget ).off(\n\t\t\t\thandleObj.namespace ?\n\t\t\t\t\thandleObj.origType + \".\" + handleObj.namespace :\n\t\t\t\t\thandleObj.origType,\n\t\t\t\thandleObj.selector,\n\t\t\t\thandleObj.handler\n\t\t\t);\n\t\t\treturn this;\n\t\t}\n\t\tif ( typeof types === \"object\" ) {\n\n\t\t\t// ( types-object [, selector] )\n\t\t\tfor ( type in types ) {\n\t\t\t\tthis.off( type, selector, types[ type ] );\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif ( selector === false || typeof selector === \"function\" ) {\n\n\t\t\t// ( types [, fn] )\n\t\t\tfn = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tif ( fn === false ) {\n\t\t\tfn = returnFalse;\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.remove( this, types, fn, selector );\n\t\t} );\n\t}\n} );\n\n\nvar\n\n\t// Support: IE <=10 - 11, Edge 12 - 13 only\n\t// In IE/Edge using regex groups here causes severe slowdowns.\n\t// See https://connect.microsoft.com/IE/feedback/details/1736512/\n\trnoInnerhtml = /\\s*$/g;\n\n// Prefer a tbody over its parent table for containing new rows\nfunction manipulationTarget( elem, content ) {\n\tif ( nodeName( elem, \"table\" ) &&\n\t\tnodeName( content.nodeType !== 11 ? content : content.firstChild, \"tr\" ) ) {\n\n\t\treturn jQuery( elem ).children( \"tbody\" )[ 0 ] || elem;\n\t}\n\n\treturn elem;\n}\n\n// Replace/restore the type attribute of script elements for safe DOM manipulation\nfunction disableScript( elem ) {\n\telem.type = ( elem.getAttribute( \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}\nfunction restoreScript( elem ) {\n\tif ( ( elem.type || \"\" ).slice( 0, 5 ) === \"true/\" ) {\n\t\telem.type = elem.type.slice( 5 );\n\t} else {\n\t\telem.removeAttribute( \"type\" );\n\t}\n\n\treturn elem;\n}\n\nfunction cloneCopyEvent( src, dest ) {\n\tvar i, l, type, pdataOld, udataOld, udataCur, events;\n\n\tif ( dest.nodeType !== 1 ) {\n\t\treturn;\n\t}\n\n\t// 1. Copy private data: events, handlers, etc.\n\tif ( dataPriv.hasData( src ) ) {\n\t\tpdataOld = dataPriv.get( src );\n\t\tevents = pdataOld.events;\n\n\t\tif ( events ) {\n\t\t\tdataPriv.remove( dest, \"handle events\" );\n\n\t\t\tfor ( type in events ) {\n\t\t\t\tfor ( i = 0, l = events[ type ].length; i < l; i++ ) {\n\t\t\t\t\tjQuery.event.add( dest, type, events[ type ][ i ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// 2. Copy user data\n\tif ( dataUser.hasData( src ) ) {\n\t\tudataOld = dataUser.access( src );\n\t\tudataCur = jQuery.extend( {}, udataOld );\n\n\t\tdataUser.set( dest, udataCur );\n\t}\n}\n\n// Fix IE bugs, see support tests\nfunction fixInput( src, dest ) {\n\tvar nodeName = dest.nodeName.toLowerCase();\n\n\t// Fails to persist the checked state of a cloned checkbox or radio button.\n\tif ( nodeName === \"input\" && rcheckableType.test( src.type ) ) {\n\t\tdest.checked = src.checked;\n\n\t// Fails to return the selected option to the default selected state when cloning options\n\t} else if ( nodeName === \"input\" || nodeName === \"textarea\" ) {\n\t\tdest.defaultValue = src.defaultValue;\n\t}\n}\n\nfunction domManip( collection, args, callback, ignored ) {\n\n\t// Flatten any nested arrays\n\targs = flat( args );\n\n\tvar fragment, first, scripts, hasScripts, node, doc,\n\t\ti = 0,\n\t\tl = collection.length,\n\t\tiNoClone = l - 1,\n\t\tvalue = args[ 0 ],\n\t\tvalueIsFunction = isFunction( value );\n\n\t// We can't cloneNode fragments that contain checked, in WebKit\n\tif ( valueIsFunction ||\n\t\t\t( l > 1 && typeof value === \"string\" &&\n\t\t\t\t!support.checkClone && rchecked.test( value ) ) ) {\n\t\treturn collection.each( function( index ) {\n\t\t\tvar self = collection.eq( index );\n\t\t\tif ( valueIsFunction ) {\n\t\t\t\targs[ 0 ] = value.call( this, index, self.html() );\n\t\t\t}\n\t\t\tdomManip( self, args, callback, ignored );\n\t\t} );\n\t}\n\n\tif ( l ) {\n\t\tfragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );\n\t\tfirst = fragment.firstChild;\n\n\t\tif ( fragment.childNodes.length === 1 ) {\n\t\t\tfragment = first;\n\t\t}\n\n\t\t// Require either new content or an interest in ignored elements to invoke the callback\n\t\tif ( first || ignored ) {\n\t\t\tscripts = jQuery.map( getAll( fragment, \"script\" ), disableScript );\n\t\t\thasScripts = scripts.length;\n\n\t\t\t// Use the original fragment for the last item\n\t\t\t// instead of the first because it can end up\n\t\t\t// being emptied incorrectly in certain situations (#8070).\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tnode = fragment;\n\n\t\t\t\tif ( i !== iNoClone ) {\n\t\t\t\t\tnode = jQuery.clone( node, true, true );\n\n\t\t\t\t\t// Keep references to cloned scripts for later restoration\n\t\t\t\t\tif ( hasScripts ) {\n\n\t\t\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\t\t\tjQuery.merge( scripts, getAll( node, \"script\" ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcallback.call( collection[ i ], node, i );\n\t\t\t}\n\n\t\t\tif ( hasScripts ) {\n\t\t\t\tdoc = scripts[ scripts.length - 1 ].ownerDocument;\n\n\t\t\t\t// Reenable scripts\n\t\t\t\tjQuery.map( scripts, restoreScript );\n\n\t\t\t\t// Evaluate executable scripts on first document insertion\n\t\t\t\tfor ( i = 0; i < hasScripts; i++ ) {\n\t\t\t\t\tnode = scripts[ i ];\n\t\t\t\t\tif ( rscriptType.test( node.type || \"\" ) &&\n\t\t\t\t\t\t!dataPriv.access( node, \"globalEval\" ) &&\n\t\t\t\t\t\tjQuery.contains( doc, node ) ) {\n\n\t\t\t\t\t\tif ( node.src && ( node.type || \"\" ).toLowerCase() !== \"module\" ) {\n\n\t\t\t\t\t\t\t// Optional AJAX dependency, but won't run scripts if not present\n\t\t\t\t\t\t\tif ( jQuery._evalUrl && !node.noModule ) {\n\t\t\t\t\t\t\t\tjQuery._evalUrl( node.src, {\n\t\t\t\t\t\t\t\t\tnonce: node.nonce || node.getAttribute( \"nonce\" )\n\t\t\t\t\t\t\t\t}, doc );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tDOMEval( node.textContent.replace( rcleanScript, \"\" ), node, doc );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn collection;\n}\n\nfunction remove( elem, selector, keepData ) {\n\tvar node,\n\t\tnodes = selector ? jQuery.filter( selector, elem ) : elem,\n\t\ti = 0;\n\n\tfor ( ; ( node = nodes[ i ] ) != null; i++ ) {\n\t\tif ( !keepData && node.nodeType === 1 ) {\n\t\t\tjQuery.cleanData( getAll( node ) );\n\t\t}\n\n\t\tif ( node.parentNode ) {\n\t\t\tif ( keepData && isAttached( node ) ) {\n\t\t\t\tsetGlobalEval( getAll( node, \"script\" ) );\n\t\t\t}\n\t\t\tnode.parentNode.removeChild( node );\n\t\t}\n\t}\n\n\treturn elem;\n}\n\njQuery.extend( {\n\thtmlPrefilter: function( html ) {\n\t\treturn html;\n\t},\n\n\tclone: function( elem, dataAndEvents, deepDataAndEvents ) {\n\t\tvar i, l, srcElements, destElements,\n\t\t\tclone = elem.cloneNode( true ),\n\t\t\tinPage = isAttached( elem );\n\n\t\t// Fix IE cloning issues\n\t\tif ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&\n\t\t\t\t!jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2\n\t\t\tdestElements = getAll( clone );\n\t\t\tsrcElements = getAll( elem );\n\n\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\tfixInput( srcElements[ i ], destElements[ i ] );\n\t\t\t}\n\t\t}\n\n\t\t// Copy the events from the original to the clone\n\t\tif ( dataAndEvents ) {\n\t\t\tif ( deepDataAndEvents ) {\n\t\t\t\tsrcElements = srcElements || getAll( elem );\n\t\t\t\tdestElements = destElements || getAll( clone );\n\n\t\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\t\tcloneCopyEvent( srcElements[ i ], destElements[ i ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcloneCopyEvent( elem, clone );\n\t\t\t}\n\t\t}\n\n\t\t// Preserve script evaluation history\n\t\tdestElements = getAll( clone, \"script\" );\n\t\tif ( destElements.length > 0 ) {\n\t\t\tsetGlobalEval( destElements, !inPage && getAll( elem, \"script\" ) );\n\t\t}\n\n\t\t// Return the cloned set\n\t\treturn clone;\n\t},\n\n\tcleanData: function( elems ) {\n\t\tvar data, elem, type,\n\t\t\tspecial = jQuery.event.special,\n\t\t\ti = 0;\n\n\t\tfor ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {\n\t\t\tif ( acceptData( elem ) ) {\n\t\t\t\tif ( ( data = elem[ dataPriv.expando ] ) ) {\n\t\t\t\t\tif ( data.events ) {\n\t\t\t\t\t\tfor ( type in data.events ) {\n\t\t\t\t\t\t\tif ( special[ type ] ) {\n\t\t\t\t\t\t\t\tjQuery.event.remove( elem, type );\n\n\t\t\t\t\t\t\t// This is a shortcut to avoid jQuery.event.remove's overhead\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tjQuery.removeEvent( elem, type, data.handle );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Support: Chrome <=35 - 45+\n\t\t\t\t\t// Assign undefined instead of using delete, see Data#remove\n\t\t\t\t\telem[ dataPriv.expando ] = undefined;\n\t\t\t\t}\n\t\t\t\tif ( elem[ dataUser.expando ] ) {\n\n\t\t\t\t\t// Support: Chrome <=35 - 45+\n\t\t\t\t\t// Assign undefined instead of using delete, see Data#remove\n\t\t\t\t\telem[ dataUser.expando ] = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n} );\n\njQuery.fn.extend( {\n\tdetach: function( selector ) {\n\t\treturn remove( this, selector, true );\n\t},\n\n\tremove: function( selector ) {\n\t\treturn remove( this, selector );\n\t},\n\n\ttext: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\treturn value === undefined ?\n\t\t\t\tjQuery.text( this ) :\n\t\t\t\tthis.empty().each( function() {\n\t\t\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\t\t\tthis.textContent = value;\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t}, null, value, arguments.length );\n\t},\n\n\tappend: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.appendChild( elem );\n\t\t\t}\n\t\t} );\n\t},\n\n\tprepend: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.insertBefore( elem, target.firstChild );\n\t\t\t}\n\t\t} );\n\t},\n\n\tbefore: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this );\n\t\t\t}\n\t\t} );\n\t},\n\n\tafter: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this.nextSibling );\n\t\t\t}\n\t\t} );\n\t},\n\n\tempty: function() {\n\t\tvar elem,\n\t\t\ti = 0;\n\n\t\tfor ( ; ( elem = this[ i ] ) != null; i++ ) {\n\t\t\tif ( elem.nodeType === 1 ) {\n\n\t\t\t\t// Prevent memory leaks\n\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\n\t\t\t\t// Remove any remaining nodes\n\t\t\t\telem.textContent = \"\";\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tclone: function( dataAndEvents, deepDataAndEvents ) {\n\t\tdataAndEvents = dataAndEvents == null ? false : dataAndEvents;\n\t\tdeepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;\n\n\t\treturn this.map( function() {\n\t\t\treturn jQuery.clone( this, dataAndEvents, deepDataAndEvents );\n\t\t} );\n\t},\n\n\thtml: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\tvar elem = this[ 0 ] || {},\n\t\t\t\ti = 0,\n\t\t\t\tl = this.length;\n\n\t\t\tif ( value === undefined && elem.nodeType === 1 ) {\n\t\t\t\treturn elem.innerHTML;\n\t\t\t}\n\n\t\t\t// See if we can take a shortcut and just use innerHTML\n\t\t\tif ( typeof value === \"string\" && !rnoInnerhtml.test( value ) &&\n\t\t\t\t!wrapMap[ ( rtagName.exec( value ) || [ \"\", \"\" ] )[ 1 ].toLowerCase() ] ) {\n\n\t\t\t\tvalue = jQuery.htmlPrefilter( value );\n\n\t\t\t\ttry {\n\t\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\t\telem = this[ i ] || {};\n\n\t\t\t\t\t\t// Remove element nodes and prevent memory leaks\n\t\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\t\t\t\t\t\t\telem.innerHTML = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\telem = 0;\n\n\t\t\t\t// If using innerHTML throws an exception, use the fallback method\n\t\t\t\t} catch ( e ) {}\n\t\t\t}\n\n\t\t\tif ( elem ) {\n\t\t\t\tthis.empty().append( value );\n\t\t\t}\n\t\t}, null, value, arguments.length );\n\t},\n\n\treplaceWith: function() {\n\t\tvar ignored = [];\n\n\t\t// Make the changes, replacing each non-ignored context element with the new content\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tvar parent = this.parentNode;\n\n\t\t\tif ( jQuery.inArray( this, ignored ) < 0 ) {\n\t\t\t\tjQuery.cleanData( getAll( this ) );\n\t\t\t\tif ( parent ) {\n\t\t\t\t\tparent.replaceChild( elem, this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Force callback invocation\n\t\t}, ignored );\n\t}\n} );\n\njQuery.each( {\n\tappendTo: \"append\",\n\tprependTo: \"prepend\",\n\tinsertBefore: \"before\",\n\tinsertAfter: \"after\",\n\treplaceAll: \"replaceWith\"\n}, function( name, original ) {\n\tjQuery.fn[ name ] = function( selector ) {\n\t\tvar elems,\n\t\t\tret = [],\n\t\t\tinsert = jQuery( selector ),\n\t\t\tlast = insert.length - 1,\n\t\t\ti = 0;\n\n\t\tfor ( ; i <= last; i++ ) {\n\t\t\telems = i === last ? this : this.clone( true );\n\t\t\tjQuery( insert[ i ] )[ original ]( elems );\n\n\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t// .get() because push.apply(_, arraylike) throws on ancient WebKit\n\t\t\tpush.apply( ret, elems.get() );\n\t\t}\n\n\t\treturn this.pushStack( ret );\n\t};\n} );\nvar rnumnonpx = new RegExp( \"^(\" + pnum + \")(?!px)[a-z%]+$\", \"i\" );\n\nvar getStyles = function( elem ) {\n\n\t\t// Support: IE <=11 only, Firefox <=30 (#15098, #14150)\n\t\t// IE throws on elements created in popups\n\t\t// FF meanwhile throws on frame elements through \"defaultView.getComputedStyle\"\n\t\tvar view = elem.ownerDocument.defaultView;\n\n\t\tif ( !view || !view.opener ) {\n\t\t\tview = window;\n\t\t}\n\n\t\treturn view.getComputedStyle( elem );\n\t};\n\nvar swap = function( elem, options, callback ) {\n\tvar ret, name,\n\t\told = {};\n\n\t// Remember the old values, and insert the new ones\n\tfor ( name in options ) {\n\t\told[ name ] = elem.style[ name ];\n\t\telem.style[ name ] = options[ name ];\n\t}\n\n\tret = callback.call( elem );\n\n\t// Revert the old values\n\tfor ( name in options ) {\n\t\telem.style[ name ] = old[ name ];\n\t}\n\n\treturn ret;\n};\n\n\nvar rboxStyle = new RegExp( cssExpand.join( \"|\" ), \"i\" );\n\n\n\n( function() {\n\n\t// Executing both pixelPosition & boxSizingReliable tests require only one layout\n\t// so they're executed at the same time to save the second computation.\n\tfunction computeStyleTests() {\n\n\t\t// This is a singleton, we need to execute it only once\n\t\tif ( !div ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" +\n\t\t\t\"margin-top:1px;padding:0;border:0\";\n\t\tdiv.style.cssText =\n\t\t\t\"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" +\n\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\"width:60%;top:1%\";\n\t\tdocumentElement.appendChild( container ).appendChild( div );\n\n\t\tvar divStyle = window.getComputedStyle( div );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\treliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\n\n\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\tdiv.style.right = \"60%\";\n\t\tpixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\n\n\t\t// Support: IE 9 - 11 only\n\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\tboxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\n\n\t\t// Support: IE 9 only\n\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t// Support: Chrome <=64\n\t\t// Don't get tricked when zoom affects offsetWidth (gh-4029)\n\t\tdiv.style.position = \"absolute\";\n\t\tscrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;\n\n\t\tdocumentElement.removeChild( container );\n\n\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t// it will also be a sign that checks already performed\n\t\tdiv = null;\n\t}\n\n\tfunction roundPixelMeasures( measure ) {\n\t\treturn Math.round( parseFloat( measure ) );\n\t}\n\n\tvar pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,\n\t\treliableTrDimensionsVal, reliableMarginLeftVal,\n\t\tcontainer = document.createElement( \"div\" ),\n\t\tdiv = document.createElement( \"div\" );\n\n\t// Finish early in limited (non-browser) environments\n\tif ( !div.style ) {\n\t\treturn;\n\t}\n\n\t// Support: IE <=9 - 11 only\n\t// Style of cloned element affects source element cloned (#8908)\n\tdiv.style.backgroundClip = \"content-box\";\n\tdiv.cloneNode( true ).style.backgroundClip = \"\";\n\tsupport.clearCloneStyle = div.style.backgroundClip === \"content-box\";\n\n\tjQuery.extend( support, {\n\t\tboxSizingReliable: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn boxSizingReliableVal;\n\t\t},\n\t\tpixelBoxStyles: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn pixelBoxStylesVal;\n\t\t},\n\t\tpixelPosition: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn pixelPositionVal;\n\t\t},\n\t\treliableMarginLeft: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn reliableMarginLeftVal;\n\t\t},\n\t\tscrollboxSize: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn scrollboxSizeVal;\n\t\t},\n\n\t\t// Support: IE 9 - 11+, Edge 15 - 18+\n\t\t// IE/Edge misreport `getComputedStyle` of table rows with width/height\n\t\t// set in CSS while `offset*` properties report correct values.\n\t\t// Behavior in IE 9 is more subtle than in newer versions & it passes\n\t\t// some versions of this test; make sure not to make it pass there!\n\t\treliableTrDimensions: function() {\n\t\t\tvar table, tr, trChild, trStyle;\n\t\t\tif ( reliableTrDimensionsVal == null ) {\n\t\t\t\ttable = document.createElement( \"table\" );\n\t\t\t\ttr = document.createElement( \"tr\" );\n\t\t\t\ttrChild = document.createElement( \"div\" );\n\n\t\t\t\ttable.style.cssText = \"position:absolute;left:-11111px\";\n\t\t\t\ttr.style.height = \"1px\";\n\t\t\t\ttrChild.style.height = \"9px\";\n\n\t\t\t\tdocumentElement\n\t\t\t\t\t.appendChild( table )\n\t\t\t\t\t.appendChild( tr )\n\t\t\t\t\t.appendChild( trChild );\n\n\t\t\t\ttrStyle = window.getComputedStyle( tr );\n\t\t\t\treliableTrDimensionsVal = parseInt( trStyle.height ) > 3;\n\n\t\t\t\tdocumentElement.removeChild( table );\n\t\t\t}\n\t\t\treturn reliableTrDimensionsVal;\n\t\t}\n\t} );\n} )();\n\n\nfunction curCSS( elem, name, computed ) {\n\tvar width, minWidth, maxWidth, ret,\n\n\t\t// Support: Firefox 51+\n\t\t// Retrieving style before computed somehow\n\t\t// fixes an issue with getting wrong values\n\t\t// on detached elements\n\t\tstyle = elem.style;\n\n\tcomputed = computed || getStyles( elem );\n\n\t// getPropertyValue is needed for:\n\t// .css('filter') (IE 9 only, #12537)\n\t// .css('--customProperty) (#3144)\n\tif ( computed ) {\n\t\tret = computed.getPropertyValue( name ) || computed[ name ];\n\n\t\tif ( ret === \"\" && !isAttached( elem ) ) {\n\t\t\tret = jQuery.style( elem, name );\n\t\t}\n\n\t\t// A tribute to the \"awesome hack by Dean Edwards\"\n\t\t// Android Browser returns percentage for some values,\n\t\t// but width seems to be reliably pixels.\n\t\t// This is against the CSSOM draft spec:\n\t\t// https://drafts.csswg.org/cssom/#resolved-values\n\t\tif ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {\n\n\t\t\t// Remember the original values\n\t\t\twidth = style.width;\n\t\t\tminWidth = style.minWidth;\n\t\t\tmaxWidth = style.maxWidth;\n\n\t\t\t// Put in the new values to get a computed value out\n\t\t\tstyle.minWidth = style.maxWidth = style.width = ret;\n\t\t\tret = computed.width;\n\n\t\t\t// Revert the changed values\n\t\t\tstyle.width = width;\n\t\t\tstyle.minWidth = minWidth;\n\t\t\tstyle.maxWidth = maxWidth;\n\t\t}\n\t}\n\n\treturn ret !== undefined ?\n\n\t\t// Support: IE <=9 - 11 only\n\t\t// IE returns zIndex value as an integer.\n\t\tret + \"\" :\n\t\tret;\n}\n\n\nfunction addGetHookIf( conditionFn, hookFn ) {\n\n\t// Define the hook, we'll check on the first run if it's really needed.\n\treturn {\n\t\tget: function() {\n\t\t\tif ( conditionFn() ) {\n\n\t\t\t\t// Hook not needed (or it's not possible to use it due\n\t\t\t\t// to missing dependency), remove it.\n\t\t\t\tdelete this.get;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Hook needed; redefine it so that the support test is not executed again.\n\t\t\treturn ( this.get = hookFn ).apply( this, arguments );\n\t\t}\n\t};\n}\n\n\nvar cssPrefixes = [ \"Webkit\", \"Moz\", \"ms\" ],\n\temptyStyle = document.createElement( \"div\" ).style,\n\tvendorProps = {};\n\n// Return a vendor-prefixed property or undefined\nfunction vendorPropName( name ) {\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}\n\n// Return a potentially-mapped jQuery.cssProps or vendor prefixed property\nfunction finalPropName( name ) {\n\tvar final = jQuery.cssProps[ name ] || vendorProps[ name ];\n\n\tif ( final ) {\n\t\treturn final;\n\t}\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\treturn vendorProps[ name ] = vendorPropName( name ) || name;\n}\n\n\nvar\n\n\t// Swappable if display is none or starts with table\n\t// except \"table\", \"table-cell\", or \"table-caption\"\n\t// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display\n\trdisplayswap = /^(none|table(?!-c[ea]).+)/,\n\trcustomProp = /^--/,\n\tcssShow = { position: \"absolute\", visibility: \"hidden\", display: \"block\" },\n\tcssNormalTransform = {\n\t\tletterSpacing: \"0\",\n\t\tfontWeight: \"400\"\n\t};\n\nfunction setPositiveNumber( _elem, value, subtract ) {\n\n\t// Any relative (+/-) values have already been\n\t// normalized at this point\n\tvar matches = rcssNum.exec( value );\n\treturn matches ?\n\n\t\t// Guard against undefined \"subtract\", e.g., when used as in cssHooks\n\t\tMath.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || \"px\" ) :\n\t\tvalue;\n}\n\nfunction boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {\n\tvar i = dimension === \"width\" ? 1 : 0,\n\t\textra = 0,\n\t\tdelta = 0;\n\n\t// Adjustment may not be necessary\n\tif ( box === ( isBorderBox ? \"border\" : \"content\" ) ) {\n\t\treturn 0;\n\t}\n\n\tfor ( ; i < 4; i += 2 ) {\n\n\t\t// Both box models exclude margin\n\t\tif ( box === \"margin\" ) {\n\t\t\tdelta += jQuery.css( elem, box + cssExpand[ i ], true, styles );\n\t\t}\n\n\t\t// If we get here with a content-box, we're seeking \"padding\" or \"border\" or \"margin\"\n\t\tif ( !isBorderBox ) {\n\n\t\t\t// Add padding\n\t\t\tdelta += jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\n\t\t\t// For \"border\" or \"margin\", add border\n\t\t\tif ( box !== \"padding\" ) {\n\t\t\t\tdelta += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\n\t\t\t// But still keep track of it otherwise\n\t\t\t} else {\n\t\t\t\textra += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\n\t\t// If we get here with a border-box (content + padding + border), we're seeking \"content\" or\n\t\t// \"padding\" or \"margin\"\n\t\t} else {\n\n\t\t\t// For \"content\", subtract padding\n\t\t\tif ( box === \"content\" ) {\n\t\t\t\tdelta -= jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\t\t\t}\n\n\t\t\t// For \"content\" or \"padding\", subtract border\n\t\t\tif ( box !== \"margin\" ) {\n\t\t\t\tdelta -= jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Account for positive content-box scroll gutter when requested by providing computedVal\n\tif ( !isBorderBox && computedVal >= 0 ) {\n\n\t\t// offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border\n\t\t// Assuming integer scroll gutter, subtract the rest and round down\n\t\tdelta += Math.max( 0, Math.ceil(\n\t\t\telem[ \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -\n\t\t\tcomputedVal -\n\t\t\tdelta -\n\t\t\textra -\n\t\t\t0.5\n\n\t\t// If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter\n\t\t// Use an explicit zero to avoid NaN (gh-3964)\n\t\t) ) || 0;\n\t}\n\n\treturn delta;\n}\n\nfunction getWidthOrHeight( elem, dimension, extra ) {\n\n\t// Start with computed style\n\tvar styles = getStyles( elem ),\n\n\t\t// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).\n\t\t// Fake content-box until we know it's needed to know the true value.\n\t\tboxSizingNeeded = !support.boxSizingReliable() || extra,\n\t\tisBorderBox = boxSizingNeeded &&\n\t\t\tjQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\tvalueIsBorderBox = isBorderBox,\n\n\t\tval = curCSS( elem, dimension, styles ),\n\t\toffsetProp = \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );\n\n\t// Support: Firefox <=54\n\t// Return a confounding non-pixel value or feign ignorance, as appropriate.\n\tif ( rnumnonpx.test( val ) ) {\n\t\tif ( !extra ) {\n\t\t\treturn val;\n\t\t}\n\t\tval = \"auto\";\n\t}\n\n\n\t// Support: IE 9 - 11 only\n\t// Use offsetWidth/offsetHeight for when box sizing is unreliable.\n\t// In those cases, the computed value can be trusted to be border-box.\n\tif ( ( !support.boxSizingReliable() && isBorderBox ||\n\n\t\t// Support: IE 10 - 11+, Edge 15 - 18+\n\t\t// IE/Edge misreport `getComputedStyle` of table rows with width/height\n\t\t// set in CSS while `offset*` properties report correct values.\n\t\t// Interestingly, in some cases IE 9 doesn't suffer from this issue.\n\t\t!support.reliableTrDimensions() && nodeName( elem, \"tr\" ) ||\n\n\t\t// Fall back to offsetWidth/offsetHeight when value is \"auto\"\n\t\t// This happens for inline elements with no explicit setting (gh-3571)\n\t\tval === \"auto\" ||\n\n\t\t// Support: Android <=4.1 - 4.3 only\n\t\t// Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)\n\t\t!parseFloat( val ) && jQuery.css( elem, \"display\", false, styles ) === \"inline\" ) &&\n\n\t\t// Make sure the element is visible & connected\n\t\telem.getClientRects().length ) {\n\n\t\tisBorderBox = jQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\";\n\n\t\t// Where available, offsetWidth/offsetHeight approximate border box dimensions.\n\t\t// Where not available (e.g., SVG), assume unreliable box-sizing and interpret the\n\t\t// retrieved value as a content box dimension.\n\t\tvalueIsBorderBox = offsetProp in elem;\n\t\tif ( valueIsBorderBox ) {\n\t\t\tval = elem[ offsetProp ];\n\t\t}\n\t}\n\n\t// Normalize \"\" and auto\n\tval = parseFloat( val ) || 0;\n\n\t// Adjust for the element's box model\n\treturn ( val +\n\t\tboxModelAdjustment(\n\t\t\telem,\n\t\t\tdimension,\n\t\t\textra || ( isBorderBox ? \"border\" : \"content\" ),\n\t\t\tvalueIsBorderBox,\n\t\t\tstyles,\n\n\t\t\t// Provide the current computed size to request scroll gutter calculation (gh-3589)\n\t\t\tval\n\t\t)\n\t) + \"px\";\n}\n\njQuery.extend( {\n\n\t// Add in style property hooks for overriding the default\n\t// behavior of getting and setting a style property\n\tcssHooks: {\n\t\topacity: {\n\t\t\tget: function( elem, computed ) {\n\t\t\t\tif ( computed ) {\n\n\t\t\t\t\t// We should always get a number back from opacity\n\t\t\t\t\tvar ret = curCSS( elem, \"opacity\" );\n\t\t\t\t\treturn ret === \"\" ? \"1\" : ret;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t// Don't automatically add \"px\" to these possibly-unitless properties\n\tcssNumber: {\n\t\t\"animationIterationCount\": true,\n\t\t\"columnCount\": true,\n\t\t\"fillOpacity\": true,\n\t\t\"flexGrow\": true,\n\t\t\"flexShrink\": true,\n\t\t\"fontWeight\": true,\n\t\t\"gridArea\": true,\n\t\t\"gridColumn\": true,\n\t\t\"gridColumnEnd\": true,\n\t\t\"gridColumnStart\": true,\n\t\t\"gridRow\": true,\n\t\t\"gridRowEnd\": true,\n\t\t\"gridRowStart\": true,\n\t\t\"lineHeight\": true,\n\t\t\"opacity\": true,\n\t\t\"order\": true,\n\t\t\"orphans\": true,\n\t\t\"widows\": true,\n\t\t\"zIndex\": true,\n\t\t\"zoom\": true\n\t},\n\n\t// Add in properties whose names you wish to fix before\n\t// setting or getting the value\n\tcssProps: {},\n\n\t// Get and set the style property on a DOM Node\n\tstyle: function( elem, name, value, extra ) {\n\n\t\t// Don't set styles on text and comment nodes\n\t\tif ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure that we're working with the right name\n\t\tvar ret, type, hooks,\n\t\t\torigName = camelCase( name ),\n\t\t\tisCustomProp = rcustomProp.test( name ),\n\t\t\tstyle = elem.style;\n\n\t\t// Make sure that we're working with the right name. We don't\n\t\t// want to query the value if it is a CSS custom property\n\t\t// since they are user-defined.\n\t\tif ( !isCustomProp ) {\n\t\t\tname = finalPropName( origName );\n\t\t}\n\n\t\t// Gets hook for the prefixed version, then unprefixed version\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// Check if we're setting a value\n\t\tif ( value !== undefined ) {\n\t\t\ttype = typeof value;\n\n\t\t\t// Convert \"+=\" or \"-=\" to relative numbers (#7345)\n\t\t\tif ( type === \"string\" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {\n\t\t\t\tvalue = adjustCSS( elem, name, ret );\n\n\t\t\t\t// Fixes bug #9237\n\t\t\t\ttype = \"number\";\n\t\t\t}\n\n\t\t\t// Make sure that null and NaN values aren't set (#7116)\n\t\t\tif ( value == null || value !== value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If a number was passed in, add the unit (except for certain CSS properties)\n\t\t\t// The isCustomProp check can be removed in jQuery 4.0 when we only auto-append\n\t\t\t// \"px\" to a few hardcoded values.\n\t\t\tif ( type === \"number\" && !isCustomProp ) {\n\t\t\t\tvalue += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? \"\" : \"px\" );\n\t\t\t}\n\n\t\t\t// background-* props affect original clone's values\n\t\t\tif ( !support.clearCloneStyle && value === \"\" && name.indexOf( \"background\" ) === 0 ) {\n\t\t\t\tstyle[ name ] = \"inherit\";\n\t\t\t}\n\n\t\t\t// If a hook was provided, use that value, otherwise just set the specified value\n\t\t\tif ( !hooks || !( \"set\" in hooks ) ||\n\t\t\t\t( value = hooks.set( elem, value, extra ) ) !== undefined ) {\n\n\t\t\t\tif ( isCustomProp ) {\n\t\t\t\t\tstyle.setProperty( name, value );\n\t\t\t\t} else {\n\t\t\t\t\tstyle[ name ] = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// If a hook was provided get the non-computed value from there\n\t\t\tif ( hooks && \"get\" in hooks &&\n\t\t\t\t( ret = hooks.get( elem, false, extra ) ) !== undefined ) {\n\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\t// Otherwise just get the value from the style object\n\t\t\treturn style[ name ];\n\t\t}\n\t},\n\n\tcss: function( elem, name, extra, styles ) {\n\t\tvar val, num, hooks,\n\t\t\torigName = camelCase( name ),\n\t\t\tisCustomProp = rcustomProp.test( name );\n\n\t\t// Make sure that we're working with the right name. We don't\n\t\t// want to modify the value if it is a CSS custom property\n\t\t// since they are user-defined.\n\t\tif ( !isCustomProp ) {\n\t\t\tname = finalPropName( origName );\n\t\t}\n\n\t\t// Try prefixed name followed by the unprefixed name\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// If a hook was provided get the computed value from there\n\t\tif ( hooks && \"get\" in hooks ) {\n\t\t\tval = hooks.get( elem, true, extra );\n\t\t}\n\n\t\t// Otherwise, if a way to get the computed value exists, use that\n\t\tif ( val === undefined ) {\n\t\t\tval = curCSS( elem, name, styles );\n\t\t}\n\n\t\t// Convert \"normal\" to computed value\n\t\tif ( val === \"normal\" && name in cssNormalTransform ) {\n\t\t\tval = cssNormalTransform[ name ];\n\t\t}\n\n\t\t// Make numeric if forced or a qualifier was provided and val looks numeric\n\t\tif ( extra === \"\" || extra ) {\n\t\t\tnum = parseFloat( val );\n\t\t\treturn extra === true || isFinite( num ) ? num || 0 : val;\n\t\t}\n\n\t\treturn val;\n\t}\n} );\n\njQuery.each( [ \"height\", \"width\" ], function( _i, dimension ) {\n\tjQuery.cssHooks[ dimension ] = {\n\t\tget: function( elem, computed, extra ) {\n\t\t\tif ( computed ) {\n\n\t\t\t\t// Certain elements can have dimension info if we invisibly show them\n\t\t\t\t// but it must have a current display style that would benefit\n\t\t\t\treturn rdisplayswap.test( jQuery.css( elem, \"display\" ) ) &&\n\n\t\t\t\t\t// Support: Safari 8+\n\t\t\t\t\t// Table columns in Safari have non-zero offsetWidth & zero\n\t\t\t\t\t// getBoundingClientRect().width unless display is changed.\n\t\t\t\t\t// Support: IE <=11 only\n\t\t\t\t\t// Running getBoundingClientRect on a disconnected node\n\t\t\t\t\t// in IE throws an error.\n\t\t\t\t\t( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?\n\t\t\t\t\t\tswap( elem, cssShow, function() {\n\t\t\t\t\t\t\treturn getWidthOrHeight( elem, dimension, extra );\n\t\t\t\t\t\t} ) :\n\t\t\t\t\t\tgetWidthOrHeight( elem, dimension, extra );\n\t\t\t}\n\t\t},\n\n\t\tset: function( elem, value, extra ) {\n\t\t\tvar matches,\n\t\t\t\tstyles = getStyles( elem ),\n\n\t\t\t\t// Only read styles.position if the test has a chance to fail\n\t\t\t\t// to avoid forcing a reflow.\n\t\t\t\tscrollboxSizeBuggy = !support.scrollboxSize() &&\n\t\t\t\t\tstyles.position === \"absolute\",\n\n\t\t\t\t// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)\n\t\t\t\tboxSizingNeeded = scrollboxSizeBuggy || extra,\n\t\t\t\tisBorderBox = boxSizingNeeded &&\n\t\t\t\t\tjQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\t\t\tsubtract = extra ?\n\t\t\t\t\tboxModelAdjustment(\n\t\t\t\t\t\telem,\n\t\t\t\t\t\tdimension,\n\t\t\t\t\t\textra,\n\t\t\t\t\t\tisBorderBox,\n\t\t\t\t\t\tstyles\n\t\t\t\t\t) :\n\t\t\t\t\t0;\n\n\t\t\t// Account for unreliable border-box dimensions by comparing offset* to computed and\n\t\t\t// faking a content-box to get border and padding (gh-3699)\n\t\t\tif ( isBorderBox && scrollboxSizeBuggy ) {\n\t\t\t\tsubtract -= Math.ceil(\n\t\t\t\t\telem[ \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -\n\t\t\t\t\tparseFloat( styles[ dimension ] ) -\n\t\t\t\t\tboxModelAdjustment( elem, dimension, \"border\", false, styles ) -\n\t\t\t\t\t0.5\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Convert to pixels if value adjustment is needed\n\t\t\tif ( subtract && ( matches = rcssNum.exec( value ) ) &&\n\t\t\t\t( matches[ 3 ] || \"px\" ) !== \"px\" ) {\n\n\t\t\t\telem.style[ dimension ] = value;\n\t\t\t\tvalue = jQuery.css( elem, dimension );\n\t\t\t}\n\n\t\t\treturn setPositiveNumber( elem, value, subtract );\n\t\t}\n\t};\n} );\n\njQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,\n\tfunction( elem, computed ) {\n\t\tif ( computed ) {\n\t\t\treturn ( parseFloat( curCSS( elem, \"marginLeft\" ) ) ||\n\t\t\t\telem.getBoundingClientRect().left -\n\t\t\t\t\tswap( elem, { marginLeft: 0 }, function() {\n\t\t\t\t\t\treturn elem.getBoundingClientRect().left;\n\t\t\t\t\t} )\n\t\t\t\t) + \"px\";\n\t\t}\n\t}\n);\n\n// These hooks are used by animate to expand properties\njQuery.each( {\n\tmargin: \"\",\n\tpadding: \"\",\n\tborder: \"Width\"\n}, function( prefix, suffix ) {\n\tjQuery.cssHooks[ prefix + suffix ] = {\n\t\texpand: function( value ) {\n\t\t\tvar i = 0,\n\t\t\t\texpanded = {},\n\n\t\t\t\t// Assumes a single number if not a string\n\t\t\t\tparts = typeof value === \"string\" ? value.split( \" \" ) : [ value ];\n\n\t\t\tfor ( ; i < 4; i++ ) {\n\t\t\t\texpanded[ prefix + cssExpand[ i ] + suffix ] =\n\t\t\t\t\tparts[ i ] || parts[ i - 2 ] || parts[ 0 ];\n\t\t\t}\n\n\t\t\treturn expanded;\n\t\t}\n\t};\n\n\tif ( prefix !== \"margin\" ) {\n\t\tjQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;\n\t}\n} );\n\njQuery.fn.extend( {\n\tcss: function( name, value ) {\n\t\treturn access( this, function( elem, name, value ) {\n\t\t\tvar styles, len,\n\t\t\t\tmap = {},\n\t\t\t\ti = 0;\n\n\t\t\tif ( Array.isArray( name ) ) {\n\t\t\t\tstyles = getStyles( elem );\n\t\t\t\tlen = name.length;\n\n\t\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\t\tmap[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );\n\t\t\t\t}\n\n\t\t\t\treturn map;\n\t\t\t}\n\n\t\t\treturn value !== undefined ?\n\t\t\t\tjQuery.style( elem, name, value ) :\n\t\t\t\tjQuery.css( elem, name );\n\t\t}, name, value, arguments.length > 1 );\n\t}\n} );\n\n\nfunction Tween( elem, options, prop, end, easing ) {\n\treturn new Tween.prototype.init( elem, options, prop, end, easing );\n}\njQuery.Tween = Tween;\n\nTween.prototype = {\n\tconstructor: Tween,\n\tinit: function( elem, options, prop, end, easing, unit ) {\n\t\tthis.elem = elem;\n\t\tthis.prop = prop;\n\t\tthis.easing = easing || jQuery.easing._default;\n\t\tthis.options = options;\n\t\tthis.start = this.now = this.cur();\n\t\tthis.end = end;\n\t\tthis.unit = unit || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" );\n\t},\n\tcur: function() {\n\t\tvar hooks = Tween.propHooks[ this.prop ];\n\n\t\treturn hooks && hooks.get ?\n\t\t\thooks.get( this ) :\n\t\t\tTween.propHooks._default.get( this );\n\t},\n\trun: function( percent ) {\n\t\tvar eased,\n\t\t\thooks = Tween.propHooks[ this.prop ];\n\n\t\tif ( this.options.duration ) {\n\t\t\tthis.pos = eased = jQuery.easing[ this.easing ](\n\t\t\t\tpercent, this.options.duration * percent, 0, 1, this.options.duration\n\t\t\t);\n\t\t} else {\n\t\t\tthis.pos = eased = percent;\n\t\t}\n\t\tthis.now = ( this.end - this.start ) * eased + this.start;\n\n\t\tif ( this.options.step ) {\n\t\t\tthis.options.step.call( this.elem, this.now, this );\n\t\t}\n\n\t\tif ( hooks && hooks.set ) {\n\t\t\thooks.set( this );\n\t\t} else {\n\t\t\tTween.propHooks._default.set( this );\n\t\t}\n\t\treturn this;\n\t}\n};\n\nTween.prototype.init.prototype = Tween.prototype;\n\nTween.propHooks = {\n\t_default: {\n\t\tget: function( tween ) {\n\t\t\tvar result;\n\n\t\t\t// Use a property on the element directly when it is not a DOM element,\n\t\t\t// or when there is no matching style property that exists.\n\t\t\tif ( tween.elem.nodeType !== 1 ||\n\t\t\t\ttween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {\n\t\t\t\treturn tween.elem[ tween.prop ];\n\t\t\t}\n\n\t\t\t// Passing an empty string as a 3rd parameter to .css will automatically\n\t\t\t// attempt a parseFloat and fallback to a string if the parse fails.\n\t\t\t// Simple values such as \"10px\" are parsed to Float;\n\t\t\t// complex values such as \"rotate(1rad)\" are returned as-is.\n\t\t\tresult = jQuery.css( tween.elem, tween.prop, \"\" );\n\n\t\t\t// Empty strings, null, undefined and \"auto\" are converted to 0.\n\t\t\treturn !result || result === \"auto\" ? 0 : result;\n\t\t},\n\t\tset: function( tween ) {\n\n\t\t\t// Use step hook for back compat.\n\t\t\t// Use cssHook if its there.\n\t\t\t// Use .style if available and use plain properties where available.\n\t\t\tif ( jQuery.fx.step[ tween.prop ] ) {\n\t\t\t\tjQuery.fx.step[ tween.prop ]( tween );\n\t\t\t} else if ( tween.elem.nodeType === 1 && (\n\t\t\t\t\tjQuery.cssHooks[ tween.prop ] ||\n\t\t\t\t\ttween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {\n\t\t\t\tjQuery.style( tween.elem, tween.prop, tween.now + tween.unit );\n\t\t\t} else {\n\t\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Support: IE <=9 only\n// Panic based approach to setting things on disconnected nodes\nTween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {\n\tset: function( tween ) {\n\t\tif ( tween.elem.nodeType && tween.elem.parentNode ) {\n\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t}\n\t}\n};\n\njQuery.easing = {\n\tlinear: function( p ) {\n\t\treturn p;\n\t},\n\tswing: function( p ) {\n\t\treturn 0.5 - Math.cos( p * Math.PI ) / 2;\n\t},\n\t_default: \"swing\"\n};\n\njQuery.fx = Tween.prototype.init;\n\n// Back compat <1.8 extension point\njQuery.fx.step = {};\n\n\n\n\nvar\n\tfxNow, inProgress,\n\trfxtypes = /^(?:toggle|show|hide)$/,\n\trrun = /queueHooks$/;\n\nfunction schedule() {\n\tif ( inProgress ) {\n\t\tif ( document.hidden === false && window.requestAnimationFrame ) {\n\t\t\twindow.requestAnimationFrame( schedule );\n\t\t} else {\n\t\t\twindow.setTimeout( schedule, jQuery.fx.interval );\n\t\t}\n\n\t\tjQuery.fx.tick();\n\t}\n}\n\n// Animations created synchronously will run synchronously\nfunction createFxNow() {\n\twindow.setTimeout( function() {\n\t\tfxNow = undefined;\n\t} );\n\treturn ( fxNow = Date.now() );\n}\n\n// Generate parameters to create a standard animation\nfunction genFx( type, includeWidth ) {\n\tvar which,\n\t\ti = 0,\n\t\tattrs = { height: type };\n\n\t// If we include width, step value is 1 to do all cssExpand values,\n\t// otherwise step value is 2 to skip over Left and Right\n\tincludeWidth = includeWidth ? 1 : 0;\n\tfor ( ; i < 4; i += 2 - includeWidth ) {\n\t\twhich = cssExpand[ i ];\n\t\tattrs[ \"margin\" + which ] = attrs[ \"padding\" + which ] = type;\n\t}\n\n\tif ( includeWidth ) {\n\t\tattrs.opacity = attrs.width = type;\n\t}\n\n\treturn attrs;\n}\n\nfunction createTween( value, prop, animation ) {\n\tvar tween,\n\t\tcollection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ \"*\" ] ),\n\t\tindex = 0,\n\t\tlength = collection.length;\n\tfor ( ; index < length; index++ ) {\n\t\tif ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {\n\n\t\t\t// We're done with this property\n\t\t\treturn tween;\n\t\t}\n\t}\n}\n\nfunction defaultPrefilter( elem, props, opts ) {\n\tvar prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,\n\t\tisBox = \"width\" in props || \"height\" in props,\n\t\tanim = this,\n\t\torig = {},\n\t\tstyle = elem.style,\n\t\thidden = elem.nodeType && isHiddenWithinTree( elem ),\n\t\tdataShow = dataPriv.get( elem, \"fxshow\" );\n\n\t// Queue-skipping animations hijack the fx hooks\n\tif ( !opts.queue ) {\n\t\thooks = jQuery._queueHooks( elem, \"fx\" );\n\t\tif ( hooks.unqueued == null ) {\n\t\t\thooks.unqueued = 0;\n\t\t\toldfire = hooks.empty.fire;\n\t\t\thooks.empty.fire = function() {\n\t\t\t\tif ( !hooks.unqueued ) {\n\t\t\t\t\toldfire();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\thooks.unqueued++;\n\n\t\tanim.always( function() {\n\n\t\t\t// Ensure the complete handler is called before this completes\n\t\t\tanim.always( function() {\n\t\t\t\thooks.unqueued--;\n\t\t\t\tif ( !jQuery.queue( elem, \"fx\" ).length ) {\n\t\t\t\t\thooks.empty.fire();\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\t}\n\n\t// Detect show/hide animations\n\tfor ( prop in props ) {\n\t\tvalue = props[ prop ];\n\t\tif ( rfxtypes.test( value ) ) {\n\t\t\tdelete props[ prop ];\n\t\t\ttoggle = toggle || value === \"toggle\";\n\t\t\tif ( value === ( hidden ? \"hide\" : \"show\" ) ) {\n\n\t\t\t\t// Pretend to be hidden if this is a \"show\" and\n\t\t\t\t// there is still data from a stopped show/hide\n\t\t\t\tif ( value === \"show\" && dataShow && dataShow[ prop ] !== undefined ) {\n\t\t\t\t\thidden = true;\n\n\t\t\t\t// Ignore all other no-op show/hide data\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\torig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );\n\t\t}\n\t}\n\n\t// Bail out if this is a no-op like .hide().hide()\n\tpropTween = !jQuery.isEmptyObject( props );\n\tif ( !propTween && jQuery.isEmptyObject( orig ) ) {\n\t\treturn;\n\t}\n\n\t// Restrict \"overflow\" and \"display\" styles during box animations\n\tif ( isBox && elem.nodeType === 1 ) {\n\n\t\t// Support: IE <=9 - 11, Edge 12 - 15\n\t\t// Record all 3 overflow attributes because IE does not infer the shorthand\n\t\t// from identically-valued overflowX and overflowY and Edge just mirrors\n\t\t// the overflowX value there.\n\t\topts.overflow = [ style.overflow, style.overflowX, style.overflowY ];\n\n\t\t// Identify a display type, preferring old show/hide data over the CSS cascade\n\t\trestoreDisplay = dataShow && dataShow.display;\n\t\tif ( restoreDisplay == null ) {\n\t\t\trestoreDisplay = dataPriv.get( elem, \"display\" );\n\t\t}\n\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\tif ( display === \"none\" ) {\n\t\t\tif ( restoreDisplay ) {\n\t\t\t\tdisplay = restoreDisplay;\n\t\t\t} else {\n\n\t\t\t\t// Get nonempty value(s) by temporarily forcing visibility\n\t\t\t\tshowHide( [ elem ], true );\n\t\t\t\trestoreDisplay = elem.style.display || restoreDisplay;\n\t\t\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\t\t\tshowHide( [ elem ] );\n\t\t\t}\n\t\t}\n\n\t\t// Animate inline elements as inline-block\n\t\tif ( display === \"inline\" || display === \"inline-block\" && restoreDisplay != null ) {\n\t\t\tif ( jQuery.css( elem, \"float\" ) === \"none\" ) {\n\n\t\t\t\t// Restore the original display value at the end of pure show/hide animations\n\t\t\t\tif ( !propTween ) {\n\t\t\t\t\tanim.done( function() {\n\t\t\t\t\t\tstyle.display = restoreDisplay;\n\t\t\t\t\t} );\n\t\t\t\t\tif ( restoreDisplay == null ) {\n\t\t\t\t\t\tdisplay = style.display;\n\t\t\t\t\t\trestoreDisplay = display === \"none\" ? \"\" : display;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstyle.display = \"inline-block\";\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( opts.overflow ) {\n\t\tstyle.overflow = \"hidden\";\n\t\tanim.always( function() {\n\t\t\tstyle.overflow = opts.overflow[ 0 ];\n\t\t\tstyle.overflowX = opts.overflow[ 1 ];\n\t\t\tstyle.overflowY = opts.overflow[ 2 ];\n\t\t} );\n\t}\n\n\t// Implement show/hide animations\n\tpropTween = false;\n\tfor ( prop in orig ) {\n\n\t\t// General show/hide setup for this element animation\n\t\tif ( !propTween ) {\n\t\t\tif ( dataShow ) {\n\t\t\t\tif ( \"hidden\" in dataShow ) {\n\t\t\t\t\thidden = dataShow.hidden;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdataShow = dataPriv.access( elem, \"fxshow\", { display: restoreDisplay } );\n\t\t\t}\n\n\t\t\t// Store hidden/visible for toggle so `.stop().toggle()` \"reverses\"\n\t\t\tif ( toggle ) {\n\t\t\t\tdataShow.hidden = !hidden;\n\t\t\t}\n\n\t\t\t// Show elements before animating them\n\t\t\tif ( hidden ) {\n\t\t\t\tshowHide( [ elem ], true );\n\t\t\t}\n\n\t\t\t/* eslint-disable no-loop-func */\n\n\t\t\tanim.done( function() {\n\n\t\t\t/* eslint-enable no-loop-func */\n\n\t\t\t\t// The final step of a \"hide\" animation is actually hiding the element\n\t\t\t\tif ( !hidden ) {\n\t\t\t\t\tshowHide( [ elem ] );\n\t\t\t\t}\n\t\t\t\tdataPriv.remove( elem, \"fxshow\" );\n\t\t\t\tfor ( prop in orig ) {\n\t\t\t\t\tjQuery.style( elem, prop, orig[ prop ] );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t// Per-property setup\n\t\tpropTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );\n\t\tif ( !( prop in dataShow ) ) {\n\t\t\tdataShow[ prop ] = propTween.start;\n\t\t\tif ( hidden ) {\n\t\t\t\tpropTween.end = propTween.start;\n\t\t\t\tpropTween.start = 0;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction propFilter( props, specialEasing ) {\n\tvar index, name, easing, value, hooks;\n\n\t// camelCase, specialEasing and expand cssHook pass\n\tfor ( index in props ) {\n\t\tname = camelCase( index );\n\t\teasing = specialEasing[ name ];\n\t\tvalue = props[ index ];\n\t\tif ( Array.isArray( value ) ) {\n\t\t\teasing = value[ 1 ];\n\t\t\tvalue = props[ index ] = value[ 0 ];\n\t\t}\n\n\t\tif ( index !== name ) {\n\t\t\tprops[ name ] = value;\n\t\t\tdelete props[ index ];\n\t\t}\n\n\t\thooks = jQuery.cssHooks[ name ];\n\t\tif ( hooks && \"expand\" in hooks ) {\n\t\t\tvalue = hooks.expand( value );\n\t\t\tdelete props[ name ];\n\n\t\t\t// Not quite $.extend, this won't overwrite existing keys.\n\t\t\t// Reusing 'index' because we have the correct \"name\"\n\t\t\tfor ( index in value ) {\n\t\t\t\tif ( !( index in props ) ) {\n\t\t\t\t\tprops[ index ] = value[ index ];\n\t\t\t\t\tspecialEasing[ index ] = easing;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tspecialEasing[ name ] = easing;\n\t\t}\n\t}\n}\n\nfunction Animation( elem, properties, options ) {\n\tvar result,\n\t\tstopped,\n\t\tindex = 0,\n\t\tlength = Animation.prefilters.length,\n\t\tdeferred = jQuery.Deferred().always( function() {\n\n\t\t\t// Don't match elem in the :animated selector\n\t\t\tdelete tick.elem;\n\t\t} ),\n\t\ttick = function() {\n\t\t\tif ( stopped ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar currentTime = fxNow || createFxNow(),\n\t\t\t\tremaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),\n\n\t\t\t\t// Support: Android 2.3 only\n\t\t\t\t// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)\n\t\t\t\ttemp = remaining / animation.duration || 0,\n\t\t\t\tpercent = 1 - temp,\n\t\t\t\tindex = 0,\n\t\t\t\tlength = animation.tweens.length;\n\n\t\t\tfor ( ; index < length; index++ ) {\n\t\t\t\tanimation.tweens[ index ].run( percent );\n\t\t\t}\n\n\t\t\tdeferred.notifyWith( elem, [ animation, percent, remaining ] );\n\n\t\t\t// If there's more to do, yield\n\t\t\tif ( percent < 1 && length ) {\n\t\t\t\treturn remaining;\n\t\t\t}\n\n\t\t\t// If this was an empty animation, synthesize a final progress notification\n\t\t\tif ( !length ) {\n\t\t\t\tdeferred.notifyWith( elem, [ animation, 1, 0 ] );\n\t\t\t}\n\n\t\t\t// Resolve the animation and report its conclusion\n\t\t\tdeferred.resolveWith( elem, [ animation ] );\n\t\t\treturn false;\n\t\t},\n\t\tanimation = deferred.promise( {\n\t\t\telem: elem,\n\t\t\tprops: jQuery.extend( {}, properties ),\n\t\t\topts: jQuery.extend( true, {\n\t\t\t\tspecialEasing: {},\n\t\t\t\teasing: jQuery.easing._default\n\t\t\t}, options ),\n\t\t\toriginalProperties: properties,\n\t\t\toriginalOptions: options,\n\t\t\tstartTime: fxNow || createFxNow(),\n\t\t\tduration: options.duration,\n\t\t\ttweens: [],\n\t\t\tcreateTween: function( prop, end ) {\n\t\t\t\tvar tween = jQuery.Tween( elem, animation.opts, prop, end,\n\t\t\t\t\t\tanimation.opts.specialEasing[ prop ] || animation.opts.easing );\n\t\t\t\tanimation.tweens.push( tween );\n\t\t\t\treturn tween;\n\t\t\t},\n\t\t\tstop: function( gotoEnd ) {\n\t\t\t\tvar index = 0,\n\n\t\t\t\t\t// If we are going to the end, we want to run all the tweens\n\t\t\t\t\t// otherwise we skip this part\n\t\t\t\t\tlength = gotoEnd ? animation.tweens.length : 0;\n\t\t\t\tif ( stopped ) {\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\tstopped = true;\n\t\t\t\tfor ( ; index < length; index++ ) {\n\t\t\t\t\tanimation.tweens[ index ].run( 1 );\n\t\t\t\t}\n\n\t\t\t\t// Resolve when we played the last frame; otherwise, reject\n\t\t\t\tif ( gotoEnd ) {\n\t\t\t\t\tdeferred.notifyWith( elem, [ animation, 1, 0 ] );\n\t\t\t\t\tdeferred.resolveWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t} else {\n\t\t\t\t\tdeferred.rejectWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t}\n\t\t} ),\n\t\tprops = animation.props;\n\n\tpropFilter( props, animation.opts.specialEasing );\n\n\tfor ( ; index < length; index++ ) {\n\t\tresult = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );\n\t\tif ( result ) {\n\t\t\tif ( isFunction( result.stop ) ) {\n\t\t\t\tjQuery._queueHooks( animation.elem, animation.opts.queue ).stop =\n\t\t\t\t\tresult.stop.bind( result );\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tjQuery.map( props, createTween, animation );\n\n\tif ( isFunction( animation.opts.start ) ) {\n\t\tanimation.opts.start.call( elem, animation );\n\t}\n\n\t// Attach callbacks from options\n\tanimation\n\t\t.progress( animation.opts.progress )\n\t\t.done( animation.opts.done, animation.opts.complete )\n\t\t.fail( animation.opts.fail )\n\t\t.always( animation.opts.always );\n\n\tjQuery.fx.timer(\n\t\tjQuery.extend( tick, {\n\t\t\telem: elem,\n\t\t\tanim: animation,\n\t\t\tqueue: animation.opts.queue\n\t\t} )\n\t);\n\n\treturn animation;\n}\n\njQuery.Animation = jQuery.extend( Animation, {\n\n\ttweeners: {\n\t\t\"*\": [ function( prop, value ) {\n\t\t\tvar tween = this.createTween( prop, value );\n\t\t\tadjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );\n\t\t\treturn tween;\n\t\t} ]\n\t},\n\n\ttweener: function( props, callback ) {\n\t\tif ( isFunction( props ) ) {\n\t\t\tcallback = props;\n\t\t\tprops = [ \"*\" ];\n\t\t} else {\n\t\t\tprops = props.match( rnothtmlwhite );\n\t\t}\n\n\t\tvar prop,\n\t\t\tindex = 0,\n\t\t\tlength = props.length;\n\n\t\tfor ( ; index < length; index++ ) {\n\t\t\tprop = props[ index ];\n\t\t\tAnimation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];\n\t\t\tAnimation.tweeners[ prop ].unshift( callback );\n\t\t}\n\t},\n\n\tprefilters: [ defaultPrefilter ],\n\n\tprefilter: function( callback, prepend ) {\n\t\tif ( prepend ) {\n\t\t\tAnimation.prefilters.unshift( callback );\n\t\t} else {\n\t\t\tAnimation.prefilters.push( callback );\n\t\t}\n\t}\n} );\n\njQuery.speed = function( speed, easing, fn ) {\n\tvar opt = speed && typeof speed === \"object\" ? jQuery.extend( {}, speed ) : {\n\t\tcomplete: fn || !fn && easing ||\n\t\t\tisFunction( speed ) && speed,\n\t\tduration: speed,\n\t\teasing: fn && easing || easing && !isFunction( easing ) && easing\n\t};\n\n\t// Go to the end state if fx are off\n\tif ( jQuery.fx.off ) {\n\t\topt.duration = 0;\n\n\t} else {\n\t\tif ( typeof opt.duration !== \"number\" ) {\n\t\t\tif ( opt.duration in jQuery.fx.speeds ) {\n\t\t\t\topt.duration = jQuery.fx.speeds[ opt.duration ];\n\n\t\t\t} else {\n\t\t\t\topt.duration = jQuery.fx.speeds._default;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Normalize opt.queue - true/undefined/null -> \"fx\"\n\tif ( opt.queue == null || opt.queue === true ) {\n\t\topt.queue = \"fx\";\n\t}\n\n\t// Queueing\n\topt.old = opt.complete;\n\n\topt.complete = function() {\n\t\tif ( isFunction( opt.old ) ) {\n\t\t\topt.old.call( this );\n\t\t}\n\n\t\tif ( opt.queue ) {\n\t\t\tjQuery.dequeue( this, opt.queue );\n\t\t}\n\t};\n\n\treturn opt;\n};\n\njQuery.fn.extend( {\n\tfadeTo: function( speed, to, easing, callback ) {\n\n\t\t// Show any hidden elements after setting opacity to 0\n\t\treturn this.filter( isHiddenWithinTree ).css( \"opacity\", 0 ).show()\n\n\t\t\t// Animate to the value specified\n\t\t\t.end().animate( { opacity: to }, speed, easing, callback );\n\t},\n\tanimate: function( prop, speed, easing, callback ) {\n\t\tvar empty = jQuery.isEmptyObject( prop ),\n\t\t\toptall = jQuery.speed( speed, easing, callback ),\n\t\t\tdoAnimation = function() {\n\n\t\t\t\t// Operate on a copy of prop so per-property easing won't be lost\n\t\t\t\tvar anim = Animation( this, jQuery.extend( {}, prop ), optall );\n\n\t\t\t\t// Empty animations, or finishing resolves immediately\n\t\t\t\tif ( empty || dataPriv.get( this, \"finish\" ) ) {\n\t\t\t\t\tanim.stop( true );\n\t\t\t\t}\n\t\t\t};\n\t\t\tdoAnimation.finish = doAnimation;\n\n\t\treturn empty || optall.queue === false ?\n\t\t\tthis.each( doAnimation ) :\n\t\t\tthis.queue( optall.queue, doAnimation );\n\t},\n\tstop: function( type, clearQueue, gotoEnd ) {\n\t\tvar stopQueue = function( hooks ) {\n\t\t\tvar stop = hooks.stop;\n\t\t\tdelete hooks.stop;\n\t\t\tstop( gotoEnd );\n\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tgotoEnd = clearQueue;\n\t\t\tclearQueue = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\tif ( clearQueue ) {\n\t\t\tthis.queue( type || \"fx\", [] );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar dequeue = true,\n\t\t\t\tindex = type != null && type + \"queueHooks\",\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tdata = dataPriv.get( this );\n\n\t\t\tif ( index ) {\n\t\t\t\tif ( data[ index ] && data[ index ].stop ) {\n\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( index in data ) {\n\t\t\t\t\tif ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {\n\t\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this &&\n\t\t\t\t\t( type == null || timers[ index ].queue === type ) ) {\n\n\t\t\t\t\ttimers[ index ].anim.stop( gotoEnd );\n\t\t\t\t\tdequeue = false;\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Start the next in the queue if the last step wasn't forced.\n\t\t\t// Timers currently will call their complete callbacks, which\n\t\t\t// will dequeue but only if they were gotoEnd.\n\t\t\tif ( dequeue || !gotoEnd ) {\n\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t}\n\t\t} );\n\t},\n\tfinish: function( type ) {\n\t\tif ( type !== false ) {\n\t\t\ttype = type || \"fx\";\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tvar index,\n\t\t\t\tdata = dataPriv.get( this ),\n\t\t\t\tqueue = data[ type + \"queue\" ],\n\t\t\t\thooks = data[ type + \"queueHooks\" ],\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tlength = queue ? queue.length : 0;\n\n\t\t\t// Enable finishing flag on private data\n\t\t\tdata.finish = true;\n\n\t\t\t// Empty the queue first\n\t\t\tjQuery.queue( this, type, [] );\n\n\t\t\tif ( hooks && hooks.stop ) {\n\t\t\t\thooks.stop.call( this, true );\n\t\t\t}\n\n\t\t\t// Look for any active animations, and finish them\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this && timers[ index ].queue === type ) {\n\t\t\t\t\ttimers[ index ].anim.stop( true );\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Look for any animations in the old queue and finish them\n\t\t\tfor ( index = 0; index < length; index++ ) {\n\t\t\t\tif ( queue[ index ] && queue[ index ].finish ) {\n\t\t\t\t\tqueue[ index ].finish.call( this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Turn off finishing flag\n\t\t\tdelete data.finish;\n\t\t} );\n\t}\n} );\n\njQuery.each( [ \"toggle\", \"show\", \"hide\" ], function( _i, name ) {\n\tvar cssFn = jQuery.fn[ name ];\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn speed == null || typeof speed === \"boolean\" ?\n\t\t\tcssFn.apply( this, arguments ) :\n\t\t\tthis.animate( genFx( name, true ), speed, easing, callback );\n\t};\n} );\n\n// Generate shortcuts for custom animations\njQuery.each( {\n\tslideDown: genFx( \"show\" ),\n\tslideUp: genFx( \"hide\" ),\n\tslideToggle: genFx( \"toggle\" ),\n\tfadeIn: { opacity: \"show\" },\n\tfadeOut: { opacity: \"hide\" },\n\tfadeToggle: { opacity: \"toggle\" }\n}, function( name, props ) {\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn this.animate( props, speed, easing, callback );\n\t};\n} );\n\njQuery.timers = [];\njQuery.fx.tick = function() {\n\tvar timer,\n\t\ti = 0,\n\t\ttimers = jQuery.timers;\n\n\tfxNow = Date.now();\n\n\tfor ( ; i < timers.length; i++ ) {\n\t\ttimer = timers[ i ];\n\n\t\t// Run the timer and safely remove it when done (allowing for external removal)\n\t\tif ( !timer() && timers[ i ] === timer ) {\n\t\t\ttimers.splice( i--, 1 );\n\t\t}\n\t}\n\n\tif ( !timers.length ) {\n\t\tjQuery.fx.stop();\n\t}\n\tfxNow = undefined;\n};\n\njQuery.fx.timer = function( timer ) {\n\tjQuery.timers.push( timer );\n\tjQuery.fx.start();\n};\n\njQuery.fx.interval = 13;\njQuery.fx.start = function() {\n\tif ( inProgress ) {\n\t\treturn;\n\t}\n\n\tinProgress = true;\n\tschedule();\n};\n\njQuery.fx.stop = function() {\n\tinProgress = null;\n};\n\njQuery.fx.speeds = {\n\tslow: 600,\n\tfast: 200,\n\n\t// Default speed\n\t_default: 400\n};\n\n\n// Based off of the plugin by Clint Helfers, with permission.\n// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/\njQuery.fn.delay = function( time, type ) {\n\ttime = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;\n\ttype = type || \"fx\";\n\n\treturn this.queue( type, function( next, hooks ) {\n\t\tvar timeout = window.setTimeout( next, time );\n\t\thooks.stop = function() {\n\t\t\twindow.clearTimeout( timeout );\n\t\t};\n\t} );\n};\n\n\n( function() {\n\tvar input = document.createElement( \"input\" ),\n\t\tselect = document.createElement( \"select\" ),\n\t\topt = select.appendChild( document.createElement( \"option\" ) );\n\n\tinput.type = \"checkbox\";\n\n\t// Support: Android <=4.3 only\n\t// Default value for a checkbox should be \"on\"\n\tsupport.checkOn = input.value !== \"\";\n\n\t// Support: IE <=11 only\n\t// Must access selectedIndex to make default options select\n\tsupport.optSelected = opt.selected;\n\n\t// Support: IE <=11 only\n\t// An input loses its value after becoming a radio\n\tinput = document.createElement( \"input\" );\n\tinput.value = \"t\";\n\tinput.type = \"radio\";\n\tsupport.radioValue = input.value === \"t\";\n} )();\n\n\nvar boolHook,\n\tattrHandle = jQuery.expr.attrHandle;\n\njQuery.fn.extend( {\n\tattr: function( name, value ) {\n\t\treturn access( this, jQuery.attr, name, value, arguments.length > 1 );\n\t},\n\n\tremoveAttr: function( name ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.removeAttr( this, name );\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tattr: function( elem, name, value ) {\n\t\tvar ret, hooks,\n\t\t\tnType = elem.nodeType;\n\n\t\t// Don't get/set attributes on text, comment and attribute nodes\n\t\tif ( nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fallback to prop when attributes are not supported\n\t\tif ( typeof elem.getAttribute === \"undefined\" ) {\n\t\t\treturn jQuery.prop( elem, name, value );\n\t\t}\n\n\t\t// Attribute hooks are determined by the lowercase version\n\t\t// Grab necessary hook if one is defined\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\t\t\thooks = jQuery.attrHooks[ name.toLowerCase() ] ||\n\t\t\t\t( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\tif ( value === null ) {\n\t\t\t\tjQuery.removeAttr( elem, name );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( hooks && \"set\" in hooks &&\n\t\t\t\t( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\telem.setAttribute( name, value + \"\" );\n\t\t\treturn value;\n\t\t}\n\n\t\tif ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\tret = jQuery.find.attr( elem, name );\n\n\t\t// Non-existent attributes return null, we normalize to undefined\n\t\treturn ret == null ? undefined : ret;\n\t},\n\n\tattrHooks: {\n\t\ttype: {\n\t\t\tset: function( elem, value ) {\n\t\t\t\tif ( !support.radioValue && value === \"radio\" &&\n\t\t\t\t\tnodeName( elem, \"input\" ) ) {\n\t\t\t\t\tvar val = elem.value;\n\t\t\t\t\telem.setAttribute( \"type\", value );\n\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\telem.value = val;\n\t\t\t\t\t}\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tremoveAttr: function( elem, value ) {\n\t\tvar name,\n\t\t\ti = 0,\n\n\t\t\t// Attribute names can contain non-HTML whitespace characters\n\t\t\t// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n\t\t\tattrNames = value && value.match( rnothtmlwhite );\n\n\t\tif ( attrNames && elem.nodeType === 1 ) {\n\t\t\twhile ( ( name = attrNames[ i++ ] ) ) {\n\t\t\t\telem.removeAttribute( name );\n\t\t\t}\n\t\t}\n\t}\n} );\n\n// Hooks for boolean attributes\nboolHook = {\n\tset: function( elem, value, name ) {\n\t\tif ( value === false ) {\n\n\t\t\t// Remove boolean attributes when set to false\n\t\t\tjQuery.removeAttr( elem, name );\n\t\t} else {\n\t\t\telem.setAttribute( name, name );\n\t\t}\n\t\treturn name;\n\t}\n};\n\njQuery.each( jQuery.expr.match.bool.source.match( /\\w+/g ), function( _i, name ) {\n\tvar getter = attrHandle[ name ] || jQuery.find.attr;\n\n\tattrHandle[ name ] = function( elem, name, isXML ) {\n\t\tvar ret, handle,\n\t\t\tlowercaseName = name.toLowerCase();\n\n\t\tif ( !isXML ) {\n\n\t\t\t// Avoid an infinite loop by temporarily removing this function from the getter\n\t\t\thandle = attrHandle[ lowercaseName ];\n\t\t\tattrHandle[ lowercaseName ] = ret;\n\t\t\tret = getter( elem, name, isXML ) != null ?\n\t\t\t\tlowercaseName :\n\t\t\t\tnull;\n\t\t\tattrHandle[ lowercaseName ] = handle;\n\t\t}\n\t\treturn ret;\n\t};\n} );\n\n\n\n\nvar rfocusable = /^(?:input|select|textarea|button)$/i,\n\trclickable = /^(?:a|area)$/i;\n\njQuery.fn.extend( {\n\tprop: function( name, value ) {\n\t\treturn access( this, jQuery.prop, name, value, arguments.length > 1 );\n\t},\n\n\tremoveProp: function( name ) {\n\t\treturn this.each( function() {\n\t\t\tdelete this[ jQuery.propFix[ name ] || name ];\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tprop: function( elem, name, value ) {\n\t\tvar ret, hooks,\n\t\t\tnType = elem.nodeType;\n\n\t\t// Don't get/set properties on text, comment and attribute nodes\n\t\tif ( nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// Fix name and attach hooks\n\t\t\tname = jQuery.propFix[ name ] || name;\n\t\t\thooks = jQuery.propHooks[ name ];\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\tif ( hooks && \"set\" in hooks &&\n\t\t\t\t( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\treturn ( elem[ name ] = value );\n\t\t}\n\n\t\tif ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\treturn elem[ name ];\n\t},\n\n\tpropHooks: {\n\t\ttabIndex: {\n\t\t\tget: function( elem ) {\n\n\t\t\t\t// Support: IE <=9 - 11 only\n\t\t\t\t// elem.tabIndex doesn't always return the\n\t\t\t\t// correct value when it hasn't been explicitly set\n\t\t\t\t// https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/\n\t\t\t\t// Use proper attribute retrieval(#12072)\n\t\t\t\tvar tabindex = jQuery.find.attr( elem, \"tabindex\" );\n\n\t\t\t\tif ( tabindex ) {\n\t\t\t\t\treturn parseInt( tabindex, 10 );\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\trfocusable.test( elem.nodeName ) ||\n\t\t\t\t\trclickable.test( elem.nodeName ) &&\n\t\t\t\t\telem.href\n\t\t\t\t) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t},\n\n\tpropFix: {\n\t\t\"for\": \"htmlFor\",\n\t\t\"class\": \"className\"\n\t}\n} );\n\n// Support: IE <=11 only\n// Accessing the selectedIndex property\n// forces the browser to respect setting selected\n// on the option\n// The getter ensures a default option is selected\n// when in an optgroup\n// eslint rule \"no-unused-expressions\" is disabled for this code\n// since it considers such accessions noop\nif ( !support.optSelected ) {\n\tjQuery.propHooks.selected = {\n\t\tget: function( elem ) {\n\n\t\t\t/* eslint no-unused-expressions: \"off\" */\n\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent && parent.parentNode ) {\n\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\tset: function( elem ) {\n\n\t\t\t/* eslint no-unused-expressions: \"off\" */\n\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent ) {\n\t\t\t\tparent.selectedIndex;\n\n\t\t\t\tif ( parent.parentNode ) {\n\t\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\njQuery.each( [\n\t\"tabIndex\",\n\t\"readOnly\",\n\t\"maxLength\",\n\t\"cellSpacing\",\n\t\"cellPadding\",\n\t\"rowSpan\",\n\t\"colSpan\",\n\t\"useMap\",\n\t\"frameBorder\",\n\t\"contentEditable\"\n], function() {\n\tjQuery.propFix[ this.toLowerCase() ] = this;\n} );\n\n\n\n\n\t// Strip and collapse whitespace according to HTML spec\n\t// https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace\n\tfunction stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}\n\n\nfunction getClass( elem ) {\n\treturn elem.getAttribute && elem.getAttribute( \"class\" ) || \"\";\n}\n\nfunction classesToArray( value ) {\n\tif ( Array.isArray( value ) ) {\n\t\treturn value;\n\t}\n\tif ( typeof value === \"string\" ) {\n\t\treturn value.match( rnothtmlwhite ) || [];\n\t}\n\treturn [];\n}\n\njQuery.fn.extend( {\n\taddClass: function( value ) {\n\t\tvar classes, elem, cur, curValue, clazz, j, finalValue,\n\t\t\ti = 0;\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( j ) {\n\t\t\t\tjQuery( this ).addClass( value.call( this, j, getClass( this ) ) );\n\t\t\t} );\n\t\t}\n\n\t\tclasses = classesToArray( value );\n\n\t\tif ( classes.length ) {\n\t\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\t\tcurValue = getClass( elem );\n\t\t\t\tcur = elem.nodeType === 1 && ( \" \" + stripAndCollapse( curValue ) + \" \" );\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( ( clazz = classes[ j++ ] ) ) {\n\t\t\t\t\t\tif ( cur.indexOf( \" \" + clazz + \" \" ) < 0 ) {\n\t\t\t\t\t\t\tcur += clazz + \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only assign if different to avoid unneeded rendering.\n\t\t\t\t\tfinalValue = stripAndCollapse( cur );\n\t\t\t\t\tif ( curValue !== finalValue ) {\n\t\t\t\t\t\telem.setAttribute( \"class\", finalValue );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tremoveClass: function( value ) {\n\t\tvar classes, elem, cur, curValue, clazz, j, finalValue,\n\t\t\ti = 0;\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( j ) {\n\t\t\t\tjQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );\n\t\t\t} );\n\t\t}\n\n\t\tif ( !arguments.length ) {\n\t\t\treturn this.attr( \"class\", \"\" );\n\t\t}\n\n\t\tclasses = classesToArray( value );\n\n\t\tif ( classes.length ) {\n\t\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\t\tcurValue = getClass( elem );\n\n\t\t\t\t// This expression is here for better compressibility (see addClass)\n\t\t\t\tcur = elem.nodeType === 1 && ( \" \" + stripAndCollapse( curValue ) + \" \" );\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( ( clazz = classes[ j++ ] ) ) {\n\n\t\t\t\t\t\t// Remove *all* instances\n\t\t\t\t\t\twhile ( cur.indexOf( \" \" + clazz + \" \" ) > -1 ) {\n\t\t\t\t\t\t\tcur = cur.replace( \" \" + clazz + \" \", \" \" );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only assign if different to avoid unneeded rendering.\n\t\t\t\t\tfinalValue = stripAndCollapse( cur );\n\t\t\t\t\tif ( curValue !== finalValue ) {\n\t\t\t\t\t\telem.setAttribute( \"class\", finalValue );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\ttoggleClass: function( value, stateVal ) {\n\t\tvar type = typeof value,\n\t\t\tisValidValue = type === \"string\" || Array.isArray( value );\n\n\t\tif ( typeof stateVal === \"boolean\" && isValidValue ) {\n\t\t\treturn stateVal ? this.addClass( value ) : this.removeClass( value );\n\t\t}\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( i ) {\n\t\t\t\tjQuery( this ).toggleClass(\n\t\t\t\t\tvalue.call( this, i, getClass( this ), stateVal ),\n\t\t\t\t\tstateVal\n\t\t\t\t);\n\t\t\t} );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar className, i, self, classNames;\n\n\t\t\tif ( isValidValue ) {\n\n\t\t\t\t// Toggle individual class names\n\t\t\t\ti = 0;\n\t\t\t\tself = jQuery( this );\n\t\t\t\tclassNames = classesToArray( value );\n\n\t\t\t\twhile ( ( className = classNames[ i++ ] ) ) {\n\n\t\t\t\t\t// Check each className given, space separated list\n\t\t\t\t\tif ( self.hasClass( className ) ) {\n\t\t\t\t\t\tself.removeClass( className );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tself.addClass( className );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Toggle whole class name\n\t\t\t} else if ( value === undefined || type === \"boolean\" ) {\n\t\t\t\tclassName = getClass( this );\n\t\t\t\tif ( className ) {\n\n\t\t\t\t\t// Store className if set\n\t\t\t\t\tdataPriv.set( this, \"__className__\", className );\n\t\t\t\t}\n\n\t\t\t\t// If the element has a class name or if we're passed `false`,\n\t\t\t\t// then remove the whole classname (if there was one, the above saved it).\n\t\t\t\t// Otherwise bring back whatever was previously saved (if anything),\n\t\t\t\t// falling back to the empty string if nothing was stored.\n\t\t\t\tif ( this.setAttribute ) {\n\t\t\t\t\tthis.setAttribute( \"class\",\n\t\t\t\t\t\tclassName || value === false ?\n\t\t\t\t\t\t\"\" :\n\t\t\t\t\t\tdataPriv.get( this, \"__className__\" ) || \"\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t},\n\n\thasClass: function( selector ) {\n\t\tvar className, elem,\n\t\t\ti = 0;\n\n\t\tclassName = \" \" + selector + \" \";\n\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\tif ( elem.nodeType === 1 &&\n\t\t\t\t( \" \" + stripAndCollapse( getClass( elem ) ) + \" \" ).indexOf( className ) > -1 ) {\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n} );\n\n\n\n\nvar rreturn = /\\r/g;\n\njQuery.fn.extend( {\n\tval: function( value ) {\n\t\tvar hooks, ret, valueIsFunction,\n\t\t\telem = this[ 0 ];\n\n\t\tif ( !arguments.length ) {\n\t\t\tif ( elem ) {\n\t\t\t\thooks = jQuery.valHooks[ elem.type ] ||\n\t\t\t\t\tjQuery.valHooks[ elem.nodeName.toLowerCase() ];\n\n\t\t\t\tif ( hooks &&\n\t\t\t\t\t\"get\" in hooks &&\n\t\t\t\t\t( ret = hooks.get( elem, \"value\" ) ) !== undefined\n\t\t\t\t) {\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\n\t\t\t\tret = elem.value;\n\n\t\t\t\t// Handle most common string cases\n\t\t\t\tif ( typeof ret === \"string\" ) {\n\t\t\t\t\treturn ret.replace( rreturn, \"\" );\n\t\t\t\t}\n\n\t\t\t\t// Handle cases where value is null/undef or number\n\t\t\t\treturn ret == null ? \"\" : ret;\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tvalueIsFunction = isFunction( value );\n\n\t\treturn this.each( function( i ) {\n\t\t\tvar val;\n\n\t\t\tif ( this.nodeType !== 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( valueIsFunction ) {\n\t\t\t\tval = value.call( this, i, jQuery( this ).val() );\n\t\t\t} else {\n\t\t\t\tval = value;\n\t\t\t}\n\n\t\t\t// Treat null/undefined as \"\"; convert numbers to string\n\t\t\tif ( val == null ) {\n\t\t\t\tval = \"\";\n\n\t\t\t} else if ( typeof val === \"number\" ) {\n\t\t\t\tval += \"\";\n\n\t\t\t} else if ( Array.isArray( val ) ) {\n\t\t\t\tval = jQuery.map( val, function( value ) {\n\t\t\t\t\treturn value == null ? \"\" : value + \"\";\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\thooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];\n\n\t\t\t// If set returns undefined, fall back to normal setting\n\t\t\tif ( !hooks || !( \"set\" in hooks ) || hooks.set( this, val, \"value\" ) === undefined ) {\n\t\t\t\tthis.value = val;\n\t\t\t}\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tvalHooks: {\n\t\toption: {\n\t\t\tget: function( elem ) {\n\n\t\t\t\tvar val = jQuery.find.attr( elem, \"value\" );\n\t\t\t\treturn val != null ?\n\t\t\t\t\tval :\n\n\t\t\t\t\t// Support: IE <=10 - 11 only\n\t\t\t\t\t// option.text throws exceptions (#14686, #14858)\n\t\t\t\t\t// Strip and collapse whitespace\n\t\t\t\t\t// https://html.spec.whatwg.org/#strip-and-collapse-whitespace\n\t\t\t\t\tstripAndCollapse( jQuery.text( elem ) );\n\t\t\t}\n\t\t},\n\t\tselect: {\n\t\t\tget: function( elem ) {\n\t\t\t\tvar value, option, i,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tindex = elem.selectedIndex,\n\t\t\t\t\tone = elem.type === \"select-one\",\n\t\t\t\t\tvalues = one ? null : [],\n\t\t\t\t\tmax = one ? index + 1 : options.length;\n\n\t\t\t\tif ( index < 0 ) {\n\t\t\t\t\ti = max;\n\n\t\t\t\t} else {\n\t\t\t\t\ti = one ? index : 0;\n\t\t\t\t}\n\n\t\t\t\t// Loop through all the selected options\n\t\t\t\tfor ( ; i < max; i++ ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t// IE8-9 doesn't update selected after form reset (#2551)\n\t\t\t\t\tif ( ( option.selected || i === index ) &&\n\n\t\t\t\t\t\t\t// Don't return options that are disabled or in a disabled optgroup\n\t\t\t\t\t\t\t!option.disabled &&\n\t\t\t\t\t\t\t( !option.parentNode.disabled ||\n\t\t\t\t\t\t\t\t!nodeName( option.parentNode, \"optgroup\" ) ) ) {\n\n\t\t\t\t\t\t// Get the specific value for the option\n\t\t\t\t\t\tvalue = jQuery( option ).val();\n\n\t\t\t\t\t\t// We don't need an array for one selects\n\t\t\t\t\t\tif ( one ) {\n\t\t\t\t\t\t\treturn value;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Multi-Selects return an array\n\t\t\t\t\t\tvalues.push( value );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn values;\n\t\t\t},\n\n\t\t\tset: function( elem, value ) {\n\t\t\t\tvar optionSet, option,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tvalues = jQuery.makeArray( value ),\n\t\t\t\t\ti = options.length;\n\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t/* eslint-disable no-cond-assign */\n\n\t\t\t\t\tif ( option.selected =\n\t\t\t\t\t\tjQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1\n\t\t\t\t\t) {\n\t\t\t\t\t\toptionSet = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* eslint-enable no-cond-assign */\n\t\t\t\t}\n\n\t\t\t\t// Force browsers to behave consistently when non-matching value is set\n\t\t\t\tif ( !optionSet ) {\n\t\t\t\t\telem.selectedIndex = -1;\n\t\t\t\t}\n\t\t\t\treturn values;\n\t\t\t}\n\t\t}\n\t}\n} );\n\n// Radios and checkboxes getter/setter\njQuery.each( [ \"radio\", \"checkbox\" ], function() {\n\tjQuery.valHooks[ this ] = {\n\t\tset: function( elem, value ) {\n\t\t\tif ( Array.isArray( value ) ) {\n\t\t\t\treturn ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );\n\t\t\t}\n\t\t}\n\t};\n\tif ( !support.checkOn ) {\n\t\tjQuery.valHooks[ this ].get = function( elem ) {\n\t\t\treturn elem.getAttribute( \"value\" ) === null ? \"on\" : elem.value;\n\t\t};\n\t}\n} );\n\n\n\n\n// Return jQuery for attributes-only inclusion\n\n\nsupport.focusin = \"onfocusin\" in window;\n\n\nvar rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,\n\tstopPropagationCallback = function( e ) {\n\t\te.stopPropagation();\n\t};\n\njQuery.extend( jQuery.event, {\n\n\ttrigger: function( event, data, elem, onlyHandlers ) {\n\n\t\tvar i, cur, tmp, bubbleType, ontype, handle, special, lastElement,\n\t\t\teventPath = [ elem || document ],\n\t\t\ttype = hasOwn.call( event, \"type\" ) ? event.type : event,\n\t\t\tnamespaces = hasOwn.call( event, \"namespace\" ) ? event.namespace.split( \".\" ) : [];\n\n\t\tcur = lastElement = tmp = elem = elem || document;\n\n\t\t// Don't do events on text and comment nodes\n\t\tif ( elem.nodeType === 3 || elem.nodeType === 8 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// focus/blur morphs to focusin/out; ensure we're not firing them right now\n\t\tif ( rfocusMorph.test( type + jQuery.event.triggered ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( type.indexOf( \".\" ) > -1 ) {\n\n\t\t\t// Namespaced trigger; create a regexp to match event type in handle()\n\t\t\tnamespaces = type.split( \".\" );\n\t\t\ttype = namespaces.shift();\n\t\t\tnamespaces.sort();\n\t\t}\n\t\tontype = type.indexOf( \":\" ) < 0 && \"on\" + type;\n\n\t\t// Caller can pass in a jQuery.Event object, Object, or just an event type string\n\t\tevent = event[ jQuery.expando ] ?\n\t\t\tevent :\n\t\t\tnew jQuery.Event( type, typeof event === \"object\" && event );\n\n\t\t// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)\n\t\tevent.isTrigger = onlyHandlers ? 2 : 3;\n\t\tevent.namespace = namespaces.join( \".\" );\n\t\tevent.rnamespace = event.namespace ?\n\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join( \"\\\\.(?:.*\\\\.|)\" ) + \"(\\\\.|$)\" ) :\n\t\t\tnull;\n\n\t\t// Clean up the event in case it is being reused\n\t\tevent.result = undefined;\n\t\tif ( !event.target ) {\n\t\t\tevent.target = elem;\n\t\t}\n\n\t\t// Clone any incoming data and prepend the event, creating the handler arg list\n\t\tdata = data == null ?\n\t\t\t[ event ] :\n\t\t\tjQuery.makeArray( data, [ event ] );\n\n\t\t// Allow special events to draw outside the lines\n\t\tspecial = jQuery.event.special[ type ] || {};\n\t\tif ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine event propagation path in advance, per W3C events spec (#9951)\n\t\t// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)\n\t\tif ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {\n\n\t\t\tbubbleType = special.delegateType || type;\n\t\t\tif ( !rfocusMorph.test( bubbleType + type ) ) {\n\t\t\t\tcur = cur.parentNode;\n\t\t\t}\n\t\t\tfor ( ; cur; cur = cur.parentNode ) {\n\t\t\t\teventPath.push( cur );\n\t\t\t\ttmp = cur;\n\t\t\t}\n\n\t\t\t// Only add window if we got to document (e.g., not plain obj or detached DOM)\n\t\t\tif ( tmp === ( elem.ownerDocument || document ) ) {\n\t\t\t\teventPath.push( tmp.defaultView || tmp.parentWindow || window );\n\t\t\t}\n\t\t}\n\n\t\t// Fire handlers on the event path\n\t\ti = 0;\n\t\twhile ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {\n\t\t\tlastElement = cur;\n\t\t\tevent.type = i > 1 ?\n\t\t\t\tbubbleType :\n\t\t\t\tspecial.bindType || type;\n\n\t\t\t// jQuery handler\n\t\t\thandle = (\n\t\t\t\t\tdataPriv.get( cur, \"events\" ) || Object.create( null )\n\t\t\t\t)[ event.type ] &&\n\t\t\t\tdataPriv.get( cur, \"handle\" );\n\t\t\tif ( handle ) {\n\t\t\t\thandle.apply( cur, data );\n\t\t\t}\n\n\t\t\t// Native handler\n\t\t\thandle = ontype && cur[ ontype ];\n\t\t\tif ( handle && handle.apply && acceptData( cur ) ) {\n\t\t\t\tevent.result = handle.apply( cur, data );\n\t\t\t\tif ( event.result === false ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tevent.type = type;\n\n\t\t// If nobody prevented the default action, do it now\n\t\tif ( !onlyHandlers && !event.isDefaultPrevented() ) {\n\n\t\t\tif ( ( !special._default ||\n\t\t\t\tspecial._default.apply( eventPath.pop(), data ) === false ) &&\n\t\t\t\tacceptData( elem ) ) {\n\n\t\t\t\t// Call a native DOM method on the target with the same name as the event.\n\t\t\t\t// Don't do default actions on window, that's where global variables be (#6170)\n\t\t\t\tif ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {\n\n\t\t\t\t\t// Don't re-trigger an onFOO event when we call its FOO() method\n\t\t\t\t\ttmp = elem[ ontype ];\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = null;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prevent re-triggering of the same event, since we already bubbled it above\n\t\t\t\t\tjQuery.event.triggered = type;\n\n\t\t\t\t\tif ( event.isPropagationStopped() ) {\n\t\t\t\t\t\tlastElement.addEventListener( type, stopPropagationCallback );\n\t\t\t\t\t}\n\n\t\t\t\t\telem[ type ]();\n\n\t\t\t\t\tif ( event.isPropagationStopped() ) {\n\t\t\t\t\t\tlastElement.removeEventListener( type, stopPropagationCallback );\n\t\t\t\t\t}\n\n\t\t\t\t\tjQuery.event.triggered = undefined;\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\t// Piggyback on a donor event to simulate a different one\n\t// Used only for `focus(in | out)` events\n\tsimulate: function( type, elem, event ) {\n\t\tvar e = jQuery.extend(\n\t\t\tnew jQuery.Event(),\n\t\t\tevent,\n\t\t\t{\n\t\t\t\ttype: type,\n\t\t\t\tisSimulated: true\n\t\t\t}\n\t\t);\n\n\t\tjQuery.event.trigger( e, null, elem );\n\t}\n\n} );\n\njQuery.fn.extend( {\n\n\ttrigger: function( type, data ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.trigger( type, data, this );\n\t\t} );\n\t},\n\ttriggerHandler: function( type, data ) {\n\t\tvar elem = this[ 0 ];\n\t\tif ( elem ) {\n\t\t\treturn jQuery.event.trigger( type, data, elem, true );\n\t\t}\n\t}\n} );\n\n\n// Support: Firefox <=44\n// Firefox doesn't have focus(in | out) events\n// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787\n//\n// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1\n// focus(in | out) events fire after focus & blur events,\n// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order\n// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857\nif ( !support.focusin ) {\n\tjQuery.each( { focus: \"focusin\", blur: \"focusout\" }, function( orig, fix ) {\n\n\t\t// Attach a single capturing handler on the document while someone wants focusin/focusout\n\t\tvar handler = function( event ) {\n\t\t\tjQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );\n\t\t};\n\n\t\tjQuery.event.special[ fix ] = {\n\t\t\tsetup: function() {\n\n\t\t\t\t// Handle: regular nodes (via `this.ownerDocument`), window\n\t\t\t\t// (via `this.document`) & document (via `this`).\n\t\t\t\tvar doc = this.ownerDocument || this.document || this,\n\t\t\t\t\tattaches = dataPriv.access( doc, fix );\n\n\t\t\t\tif ( !attaches ) {\n\t\t\t\t\tdoc.addEventListener( orig, handler, true );\n\t\t\t\t}\n\t\t\t\tdataPriv.access( doc, fix, ( attaches || 0 ) + 1 );\n\t\t\t},\n\t\t\tteardown: function() {\n\t\t\t\tvar doc = this.ownerDocument || this.document || this,\n\t\t\t\t\tattaches = dataPriv.access( doc, fix ) - 1;\n\n\t\t\t\tif ( !attaches ) {\n\t\t\t\t\tdoc.removeEventListener( orig, handler, true );\n\t\t\t\t\tdataPriv.remove( doc, fix );\n\n\t\t\t\t} else {\n\t\t\t\t\tdataPriv.access( doc, fix, attaches );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t} );\n}\nvar location = window.location;\n\nvar nonce = { guid: Date.now() };\n\nvar rquery = ( /\\?/ );\n\n\n\n// Cross-browser xml parsing\njQuery.parseXML = function( data ) {\n\tvar xml;\n\tif ( !data || typeof data !== \"string\" ) {\n\t\treturn null;\n\t}\n\n\t// Support: IE 9 - 11 only\n\t// IE throws on parseFromString with invalid input.\n\ttry {\n\t\txml = ( new window.DOMParser() ).parseFromString( data, \"text/xml\" );\n\t} catch ( e ) {\n\t\txml = undefined;\n\t}\n\n\tif ( !xml || xml.getElementsByTagName( \"parsererror\" ).length ) {\n\t\tjQuery.error( \"Invalid XML: \" + data );\n\t}\n\treturn xml;\n};\n\n\nvar\n\trbracket = /\\[\\]$/,\n\trCRLF = /\\r?\\n/g,\n\trsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,\n\trsubmittable = /^(?:input|select|textarea|keygen)/i;\n\nfunction buildParams( prefix, obj, traditional, add ) {\n\tvar name;\n\n\tif ( Array.isArray( obj ) ) {\n\n\t\t// Serialize array item.\n\t\tjQuery.each( obj, function( i, v ) {\n\t\t\tif ( traditional || rbracket.test( prefix ) ) {\n\n\t\t\t\t// Treat each array item as a scalar.\n\t\t\t\tadd( prefix, v );\n\n\t\t\t} else {\n\n\t\t\t\t// Item is non-scalar (array or object), encode its numeric index.\n\t\t\t\tbuildParams(\n\t\t\t\t\tprefix + \"[\" + ( typeof v === \"object\" && v != null ? i : \"\" ) + \"]\",\n\t\t\t\t\tv,\n\t\t\t\t\ttraditional,\n\t\t\t\t\tadd\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t} else if ( !traditional && toType( obj ) === \"object\" ) {\n\n\t\t// Serialize object item.\n\t\tfor ( name in obj ) {\n\t\t\tbuildParams( prefix + \"[\" + name + \"]\", obj[ name ], traditional, add );\n\t\t}\n\n\t} else {\n\n\t\t// Serialize scalar item.\n\t\tadd( prefix, obj );\n\t}\n}\n\n// Serialize an array of form elements or a set of\n// key/values into a query string\njQuery.param = function( a, traditional ) {\n\tvar prefix,\n\t\ts = [],\n\t\tadd = function( key, valueOrFunction ) {\n\n\t\t\t// If value is a function, invoke it and use its return value\n\t\t\tvar value = isFunction( valueOrFunction ) ?\n\t\t\t\tvalueOrFunction() :\n\t\t\t\tvalueOrFunction;\n\n\t\t\ts[ s.length ] = encodeURIComponent( key ) + \"=\" +\n\t\t\t\tencodeURIComponent( value == null ? \"\" : value );\n\t\t};\n\n\tif ( a == null ) {\n\t\treturn \"\";\n\t}\n\n\t// If an array was passed in, assume that it is an array of form elements.\n\tif ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {\n\n\t\t// Serialize the form elements\n\t\tjQuery.each( a, function() {\n\t\t\tadd( this.name, this.value );\n\t\t} );\n\n\t} else {\n\n\t\t// If traditional, encode the \"old\" way (the way 1.3.2 or older\n\t\t// did it), otherwise encode params recursively.\n\t\tfor ( prefix in a ) {\n\t\t\tbuildParams( prefix, a[ prefix ], traditional, add );\n\t\t}\n\t}\n\n\t// Return the resulting serialization\n\treturn s.join( \"&\" );\n};\n\njQuery.fn.extend( {\n\tserialize: function() {\n\t\treturn jQuery.param( this.serializeArray() );\n\t},\n\tserializeArray: function() {\n\t\treturn this.map( function() {\n\n\t\t\t// Can add propHook for \"elements\" to filter or add form elements\n\t\t\tvar elements = jQuery.prop( this, \"elements\" );\n\t\t\treturn elements ? jQuery.makeArray( elements ) : this;\n\t\t} )\n\t\t.filter( function() {\n\t\t\tvar type = this.type;\n\n\t\t\t// Use .is( \":disabled\" ) so that fieldset[disabled] works\n\t\t\treturn this.name && !jQuery( this ).is( \":disabled\" ) &&\n\t\t\t\trsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&\n\t\t\t\t( this.checked || !rcheckableType.test( type ) );\n\t\t} )\n\t\t.map( function( _i, elem ) {\n\t\t\tvar val = jQuery( this ).val();\n\n\t\t\tif ( val == null ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif ( Array.isArray( val ) ) {\n\t\t\t\treturn jQuery.map( val, function( val ) {\n\t\t\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t} ).get();\n\t}\n} );\n\n\nvar\n\tr20 = /%20/g,\n\trhash = /#.*$/,\n\trantiCache = /([?&])_=[^&]*/,\n\trheaders = /^(.*?):[ \\t]*([^\\r\\n]*)$/mg,\n\n\t// #7653, #8125, #8152: local protocol detection\n\trlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,\n\trnoContent = /^(?:GET|HEAD)$/,\n\trprotocol = /^\\/\\//,\n\n\t/* Prefilters\n\t * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)\n\t * 2) These are called:\n\t * - BEFORE asking for a transport\n\t * - AFTER param serialization (s.data is a string if s.processData is true)\n\t * 3) key is the dataType\n\t * 4) the catchall symbol \"*\" can be used\n\t * 5) execution will start with transport dataType and THEN continue down to \"*\" if needed\n\t */\n\tprefilters = {},\n\n\t/* Transports bindings\n\t * 1) key is the dataType\n\t * 2) the catchall symbol \"*\" can be used\n\t * 3) selection will start with transport dataType and THEN go to \"*\" if needed\n\t */\n\ttransports = {},\n\n\t// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression\n\tallTypes = \"*/\".concat( \"*\" ),\n\n\t// Anchor tag for parsing the document origin\n\toriginAnchor = document.createElement( \"a\" );\n\toriginAnchor.href = location.href;\n\n// Base \"constructor\" for jQuery.ajaxPrefilter and jQuery.ajaxTransport\nfunction addToPrefiltersOrTransports( structure ) {\n\n\t// dataTypeExpression is optional and defaults to \"*\"\n\treturn function( dataTypeExpression, func ) {\n\n\t\tif ( typeof dataTypeExpression !== \"string\" ) {\n\t\t\tfunc = dataTypeExpression;\n\t\t\tdataTypeExpression = \"*\";\n\t\t}\n\n\t\tvar dataType,\n\t\t\ti = 0,\n\t\t\tdataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];\n\n\t\tif ( isFunction( func ) ) {\n\n\t\t\t// For each dataType in the dataTypeExpression\n\t\t\twhile ( ( dataType = dataTypes[ i++ ] ) ) {\n\n\t\t\t\t// Prepend if requested\n\t\t\t\tif ( dataType[ 0 ] === \"+\" ) {\n\t\t\t\t\tdataType = dataType.slice( 1 ) || \"*\";\n\t\t\t\t\t( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );\n\n\t\t\t\t// Otherwise append\n\t\t\t\t} else {\n\t\t\t\t\t( structure[ dataType ] = structure[ dataType ] || [] ).push( func );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\n// Base inspection function for prefilters and transports\nfunction inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t} );\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}\n\n// A special extend for ajax options\n// that takes \"flat\" options (not to be deep extended)\n// Fixes #9887\nfunction ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}\n\n/* Handles responses to an ajax request:\n * - finds the right dataType (mediates between content-type and expected dataType)\n * - returns the corresponding response\n */\nfunction ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}\n\n/* Chain conversions given the request and the original response\n * Also sets the responseXXX fields on the jqXHR instance\n */\nfunction ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s.throws ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}\n\njQuery.extend( {\n\n\t// Counter for holding the number of active queries\n\tactive: 0,\n\n\t// Last-Modified header cache for next request\n\tlastModified: {},\n\tetag: {},\n\n\tajaxSettings: {\n\t\turl: location.href,\n\t\ttype: \"GET\",\n\t\tisLocal: rlocalProtocol.test( location.protocol ),\n\t\tglobal: true,\n\t\tprocessData: true,\n\t\tasync: true,\n\t\tcontentType: \"application/x-www-form-urlencoded; charset=UTF-8\",\n\n\t\t/*\n\t\ttimeout: 0,\n\t\tdata: null,\n\t\tdataType: null,\n\t\tusername: null,\n\t\tpassword: null,\n\t\tcache: null,\n\t\tthrows: false,\n\t\ttraditional: false,\n\t\theaders: {},\n\t\t*/\n\n\t\taccepts: {\n\t\t\t\"*\": allTypes,\n\t\t\ttext: \"text/plain\",\n\t\t\thtml: \"text/html\",\n\t\t\txml: \"application/xml, text/xml\",\n\t\t\tjson: \"application/json, text/javascript\"\n\t\t},\n\n\t\tcontents: {\n\t\t\txml: /\\bxml\\b/,\n\t\t\thtml: /\\bhtml/,\n\t\t\tjson: /\\bjson\\b/\n\t\t},\n\n\t\tresponseFields: {\n\t\t\txml: \"responseXML\",\n\t\t\ttext: \"responseText\",\n\t\t\tjson: \"responseJSON\"\n\t\t},\n\n\t\t// Data converters\n\t\t// Keys separate source (or catchall \"*\") and destination types with a single space\n\t\tconverters: {\n\n\t\t\t// Convert anything to text\n\t\t\t\"* text\": String,\n\n\t\t\t// Text to html (true = no transformation)\n\t\t\t\"text html\": true,\n\n\t\t\t// Evaluate text as a json expression\n\t\t\t\"text json\": JSON.parse,\n\n\t\t\t// Parse text as xml\n\t\t\t\"text xml\": jQuery.parseXML\n\t\t},\n\n\t\t// For options that shouldn't be deep extended:\n\t\t// you can add your own custom options here if\n\t\t// and when you create one that shouldn't be\n\t\t// deep extended (see ajaxExtend)\n\t\tflatOptions: {\n\t\t\turl: true,\n\t\t\tcontext: true\n\t\t}\n\t},\n\n\t// Creates a full fledged settings object into target\n\t// with both ajaxSettings and settings fields.\n\t// If target is omitted, writes into ajaxSettings.\n\tajaxSetup: function( target, settings ) {\n\t\treturn settings ?\n\n\t\t\t// Building a settings object\n\t\t\tajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :\n\n\t\t\t// Extending ajaxSettings\n\t\t\tajaxExtend( jQuery.ajaxSettings, target );\n\t},\n\n\tajaxPrefilter: addToPrefiltersOrTransports( prefilters ),\n\tajaxTransport: addToPrefiltersOrTransports( transports ),\n\n\t// Main method\n\tajax: function( url, options ) {\n\n\t\t// If url is an object, simulate pre-1.5 signature\n\t\tif ( typeof url === \"object\" ) {\n\t\t\toptions = url;\n\t\t\turl = undefined;\n\t\t}\n\n\t\t// Force options to be an object\n\t\toptions = options || {};\n\n\t\tvar transport,\n\n\t\t\t// URL without anti-cache param\n\t\t\tcacheURL,\n\n\t\t\t// Response headers\n\t\t\tresponseHeadersString,\n\t\t\tresponseHeaders,\n\n\t\t\t// timeout handle\n\t\t\ttimeoutTimer,\n\n\t\t\t// Url cleanup var\n\t\t\turlAnchor,\n\n\t\t\t// Request state (becomes false upon send and true upon completion)\n\t\t\tcompleted,\n\n\t\t\t// To know if global events are to be dispatched\n\t\t\tfireGlobals,\n\n\t\t\t// Loop variable\n\t\t\ti,\n\n\t\t\t// uncached part of the url\n\t\t\tuncached,\n\n\t\t\t// Create the final options object\n\t\t\ts = jQuery.ajaxSetup( {}, options ),\n\n\t\t\t// Callbacks context\n\t\t\tcallbackContext = s.context || s,\n\n\t\t\t// Context for global events is callbackContext if it is a DOM node or jQuery collection\n\t\t\tglobalEventContext = s.context &&\n\t\t\t\t( callbackContext.nodeType || callbackContext.jquery ) ?\n\t\t\t\t\tjQuery( callbackContext ) :\n\t\t\t\t\tjQuery.event,\n\n\t\t\t// Deferreds\n\t\t\tdeferred = jQuery.Deferred(),\n\t\t\tcompleteDeferred = jQuery.Callbacks( \"once memory\" ),\n\n\t\t\t// Status-dependent callbacks\n\t\t\tstatusCode = s.statusCode || {},\n\n\t\t\t// Headers (they are sent all at once)\n\t\t\trequestHeaders = {},\n\t\t\trequestHeadersNames = {},\n\n\t\t\t// Default abort message\n\t\t\tstrAbort = \"canceled\",\n\n\t\t\t// Fake xhr\n\t\t\tjqXHR = {\n\t\t\t\treadyState: 0,\n\n\t\t\t\t// Builds headers hashtable if needed\n\t\t\t\tgetResponseHeader: function( key ) {\n\t\t\t\t\tvar match;\n\t\t\t\t\tif ( completed ) {\n\t\t\t\t\t\tif ( !responseHeaders ) {\n\t\t\t\t\t\t\tresponseHeaders = {};\n\t\t\t\t\t\t\twhile ( ( match = rheaders.exec( responseHeadersString ) ) ) {\n\t\t\t\t\t\t\t\tresponseHeaders[ match[ 1 ].toLowerCase() + \" \" ] =\n\t\t\t\t\t\t\t\t\t( responseHeaders[ match[ 1 ].toLowerCase() + \" \" ] || [] )\n\t\t\t\t\t\t\t\t\t\t.concat( match[ 2 ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmatch = responseHeaders[ key.toLowerCase() + \" \" ];\n\t\t\t\t\t}\n\t\t\t\t\treturn match == null ? null : match.join( \", \" );\n\t\t\t\t},\n\n\t\t\t\t// Raw string\n\t\t\t\tgetAllResponseHeaders: function() {\n\t\t\t\t\treturn completed ? responseHeadersString : null;\n\t\t\t\t},\n\n\t\t\t\t// Caches the header\n\t\t\t\tsetRequestHeader: function( name, value ) {\n\t\t\t\t\tif ( completed == null ) {\n\t\t\t\t\t\tname = requestHeadersNames[ name.toLowerCase() ] =\n\t\t\t\t\t\t\trequestHeadersNames[ name.toLowerCase() ] || name;\n\t\t\t\t\t\trequestHeaders[ name ] = value;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Overrides response content-type header\n\t\t\t\toverrideMimeType: function( type ) {\n\t\t\t\t\tif ( completed == null ) {\n\t\t\t\t\t\ts.mimeType = type;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Status-dependent callbacks\n\t\t\t\tstatusCode: function( map ) {\n\t\t\t\t\tvar code;\n\t\t\t\t\tif ( map ) {\n\t\t\t\t\t\tif ( completed ) {\n\n\t\t\t\t\t\t\t// Execute the appropriate callbacks\n\t\t\t\t\t\t\tjqXHR.always( map[ jqXHR.status ] );\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Lazy-add the new callbacks in a way that preserves old ones\n\t\t\t\t\t\t\tfor ( code in map ) {\n\t\t\t\t\t\t\t\tstatusCode[ code ] = [ statusCode[ code ], map[ code ] ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Cancel the request\n\t\t\t\tabort: function( statusText ) {\n\t\t\t\t\tvar finalText = statusText || strAbort;\n\t\t\t\t\tif ( transport ) {\n\t\t\t\t\t\ttransport.abort( finalText );\n\t\t\t\t\t}\n\t\t\t\t\tdone( 0, finalText );\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t};\n\n\t\t// Attach deferreds\n\t\tdeferred.promise( jqXHR );\n\n\t\t// Add protocol if not provided (prefilters might expect it)\n\t\t// Handle falsy url in the settings object (#10093: consistency with old signature)\n\t\t// We also use the url parameter if available\n\t\ts.url = ( ( url || s.url || location.href ) + \"\" )\n\t\t\t.replace( rprotocol, location.protocol + \"//\" );\n\n\t\t// Alias method option to type as per ticket #12004\n\t\ts.type = options.method || options.type || s.method || s.type;\n\n\t\t// Extract dataTypes list\n\t\ts.dataTypes = ( s.dataType || \"*\" ).toLowerCase().match( rnothtmlwhite ) || [ \"\" ];\n\n\t\t// A cross-domain request is in order when the origin doesn't match the current origin.\n\t\tif ( s.crossDomain == null ) {\n\t\t\turlAnchor = document.createElement( \"a\" );\n\n\t\t\t// Support: IE <=8 - 11, Edge 12 - 15\n\t\t\t// IE throws exception on accessing the href property if url is malformed,\n\t\t\t// e.g. http://example.com:80x/\n\t\t\ttry {\n\t\t\t\turlAnchor.href = s.url;\n\n\t\t\t\t// Support: IE <=8 - 11 only\n\t\t\t\t// Anchor's host property isn't correctly set when s.url is relative\n\t\t\t\turlAnchor.href = urlAnchor.href;\n\t\t\t\ts.crossDomain = originAnchor.protocol + \"//\" + originAnchor.host !==\n\t\t\t\t\turlAnchor.protocol + \"//\" + urlAnchor.host;\n\t\t\t} catch ( e ) {\n\n\t\t\t\t// If there is an error parsing the URL, assume it is crossDomain,\n\t\t\t\t// it can be rejected by the transport if it is invalid\n\t\t\t\ts.crossDomain = true;\n\t\t\t}\n\t\t}\n\n\t\t// Convert data if not already a string\n\t\tif ( s.data && s.processData && typeof s.data !== \"string\" ) {\n\t\t\ts.data = jQuery.param( s.data, s.traditional );\n\t\t}\n\n\t\t// Apply prefilters\n\t\tinspectPrefiltersOrTransports( prefilters, s, options, jqXHR );\n\n\t\t// If request was aborted inside a prefilter, stop there\n\t\tif ( completed ) {\n\t\t\treturn jqXHR;\n\t\t}\n\n\t\t// We can fire global events as of now if asked to\n\t\t// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)\n\t\tfireGlobals = jQuery.event && s.global;\n\n\t\t// Watch for a new set of requests\n\t\tif ( fireGlobals && jQuery.active++ === 0 ) {\n\t\t\tjQuery.event.trigger( \"ajaxStart\" );\n\t\t}\n\n\t\t// Uppercase the type\n\t\ts.type = s.type.toUpperCase();\n\n\t\t// Determine if request has content\n\t\ts.hasContent = !rnoContent.test( s.type );\n\n\t\t// Save the URL in case we're toying with the If-Modified-Since\n\t\t// and/or If-None-Match header later on\n\t\t// Remove hash to simplify url manipulation\n\t\tcacheURL = s.url.replace( rhash, \"\" );\n\n\t\t// More options handling for requests with no content\n\t\tif ( !s.hasContent ) {\n\n\t\t\t// Remember the hash so we can put it back\n\t\t\tuncached = s.url.slice( cacheURL.length );\n\n\t\t\t// If data is available and should be processed, append data to url\n\t\t\tif ( s.data && ( s.processData || typeof s.data === \"string\" ) ) {\n\t\t\t\tcacheURL += ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + s.data;\n\n\t\t\t\t// #9682: remove data so that it's not used in an eventual retry\n\t\t\t\tdelete s.data;\n\t\t\t}\n\n\t\t\t// Add or update anti-cache param if needed\n\t\t\tif ( s.cache === false ) {\n\t\t\t\tcacheURL = cacheURL.replace( rantiCache, \"$1\" );\n\t\t\t\tuncached = ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + \"_=\" + ( nonce.guid++ ) +\n\t\t\t\t\tuncached;\n\t\t\t}\n\n\t\t\t// Put hash and anti-cache on the URL that will be requested (gh-1732)\n\t\t\ts.url = cacheURL + uncached;\n\n\t\t// Change '%20' to '+' if this is encoded form body content (gh-2658)\n\t\t} else if ( s.data && s.processData &&\n\t\t\t( s.contentType || \"\" ).indexOf( \"application/x-www-form-urlencoded\" ) === 0 ) {\n\t\t\ts.data = s.data.replace( r20, \"+\" );\n\t\t}\n\n\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\tif ( s.ifModified ) {\n\t\t\tif ( jQuery.lastModified[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-Modified-Since\", jQuery.lastModified[ cacheURL ] );\n\t\t\t}\n\t\t\tif ( jQuery.etag[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-None-Match\", jQuery.etag[ cacheURL ] );\n\t\t\t}\n\t\t}\n\n\t\t// Set the correct header, if data is being sent\n\t\tif ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {\n\t\t\tjqXHR.setRequestHeader( \"Content-Type\", s.contentType );\n\t\t}\n\n\t\t// Set the Accepts header for the server, depending on the dataType\n\t\tjqXHR.setRequestHeader(\n\t\t\t\"Accept\",\n\t\t\ts.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?\n\t\t\t\ts.accepts[ s.dataTypes[ 0 ] ] +\n\t\t\t\t\t( s.dataTypes[ 0 ] !== \"*\" ? \", \" + allTypes + \"; q=0.01\" : \"\" ) :\n\t\t\t\ts.accepts[ \"*\" ]\n\t\t);\n\n\t\t// Check for headers option\n\t\tfor ( i in s.headers ) {\n\t\t\tjqXHR.setRequestHeader( i, s.headers[ i ] );\n\t\t}\n\n\t\t// Allow custom headers/mimetypes and early abort\n\t\tif ( s.beforeSend &&\n\t\t\t( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {\n\n\t\t\t// Abort if not done already and return\n\t\t\treturn jqXHR.abort();\n\t\t}\n\n\t\t// Aborting is no longer a cancellation\n\t\tstrAbort = \"abort\";\n\n\t\t// Install callbacks on deferreds\n\t\tcompleteDeferred.add( s.complete );\n\t\tjqXHR.done( s.success );\n\t\tjqXHR.fail( s.error );\n\n\t\t// Get transport\n\t\ttransport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );\n\n\t\t// If no transport, we auto-abort\n\t\tif ( !transport ) {\n\t\t\tdone( -1, \"No Transport\" );\n\t\t} else {\n\t\t\tjqXHR.readyState = 1;\n\n\t\t\t// Send global event\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxSend\", [ jqXHR, s ] );\n\t\t\t}\n\n\t\t\t// If request was aborted inside ajaxSend, stop there\n\t\t\tif ( completed ) {\n\t\t\t\treturn jqXHR;\n\t\t\t}\n\n\t\t\t// Timeout\n\t\t\tif ( s.async && s.timeout > 0 ) {\n\t\t\t\ttimeoutTimer = window.setTimeout( function() {\n\t\t\t\t\tjqXHR.abort( \"timeout\" );\n\t\t\t\t}, s.timeout );\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tcompleted = false;\n\t\t\t\ttransport.send( requestHeaders, done );\n\t\t\t} catch ( e ) {\n\n\t\t\t\t// Rethrow post-completion exceptions\n\t\t\t\tif ( completed ) {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\n\t\t\t\t// Propagate others as results\n\t\t\t\tdone( -1, e );\n\t\t\t}\n\t\t}\n\n\t\t// Callback for when everything is done\n\t\tfunction done( status, nativeStatusText, responses, headers ) {\n\t\t\tvar isSuccess, success, error, response, modified,\n\t\t\t\tstatusText = nativeStatusText;\n\n\t\t\t// Ignore repeat invocations\n\t\t\tif ( completed ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcompleted = true;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\twindow.clearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || \"\";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status > 0 ? 4 : 0;\n\n\t\t\t// Determine if successful\n\t\t\tisSuccess = status >= 200 && status < 300 || status === 304;\n\n\t\t\t// Get response data\n\t\t\tif ( responses ) {\n\t\t\t\tresponse = ajaxHandleResponses( s, jqXHR, responses );\n\t\t\t}\n\n\t\t\t// Use a noop converter for missing script\n\t\t\tif ( !isSuccess && jQuery.inArray( \"script\", s.dataTypes ) > -1 ) {\n\t\t\t\ts.converters[ \"text script\" ] = function() {};\n\t\t\t}\n\n\t\t\t// Convert no matter what (that way responseXXX fields are always set)\n\t\t\tresponse = ajaxConvert( s, response, jqXHR, isSuccess );\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( isSuccess ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"Last-Modified\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.lastModified[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"etag\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.etag[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if no content\n\t\t\t\tif ( status === 204 || s.type === \"HEAD\" ) {\n\t\t\t\t\tstatusText = \"nocontent\";\n\n\t\t\t\t// if not modified\n\t\t\t\t} else if ( status === 304 ) {\n\t\t\t\t\tstatusText = \"notmodified\";\n\n\t\t\t\t// If we have data, let's convert it\n\t\t\t\t} else {\n\t\t\t\t\tstatusText = response.state;\n\t\t\t\t\tsuccess = response.data;\n\t\t\t\t\terror = response.error;\n\t\t\t\t\tisSuccess = !error;\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t// Extract error from statusText and normalize for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif ( status || !statusText ) {\n\t\t\t\t\tstatusText = \"error\";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = ( nativeStatusText || statusText ) + \"\";\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( isSuccess ? \"ajaxSuccess\" : \"ajaxError\",\n\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s ] );\n\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger( \"ajaxStop\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn jqXHR;\n\t},\n\n\tgetJSON: function( url, data, callback ) {\n\t\treturn jQuery.get( url, data, callback, \"json\" );\n\t},\n\n\tgetScript: function( url, callback ) {\n\t\treturn jQuery.get( url, undefined, callback, \"script\" );\n\t}\n} );\n\njQuery.each( [ \"get\", \"post\" ], function( _i, method ) {\n\tjQuery[ method ] = function( url, data, callback, type ) {\n\n\t\t// Shift arguments if data argument was omitted\n\t\tif ( isFunction( data ) ) {\n\t\t\ttype = type || callback;\n\t\t\tcallback = data;\n\t\t\tdata = undefined;\n\t\t}\n\n\t\t// The url can be an options object (which then must have .url)\n\t\treturn jQuery.ajax( jQuery.extend( {\n\t\t\turl: url,\n\t\t\ttype: method,\n\t\t\tdataType: type,\n\t\t\tdata: data,\n\t\t\tsuccess: callback\n\t\t}, jQuery.isPlainObject( url ) && url ) );\n\t};\n} );\n\njQuery.ajaxPrefilter( function( s ) {\n\tvar i;\n\tfor ( i in s.headers ) {\n\t\tif ( i.toLowerCase() === \"content-type\" ) {\n\t\t\ts.contentType = s.headers[ i ] || \"\";\n\t\t}\n\t}\n} );\n\n\njQuery._evalUrl = function( url, options, doc ) {\n\treturn jQuery.ajax( {\n\t\turl: url,\n\n\t\t// Make this explicit, since user can override this through ajaxSetup (#11264)\n\t\ttype: \"GET\",\n\t\tdataType: \"script\",\n\t\tcache: true,\n\t\tasync: false,\n\t\tglobal: false,\n\n\t\t// Only evaluate the response if it is successful (gh-4126)\n\t\t// dataFilter is not invoked for failure responses, so using it instead\n\t\t// of the default converter is kludgy but it works.\n\t\tconverters: {\n\t\t\t\"text script\": function() {}\n\t\t},\n\t\tdataFilter: function( response ) {\n\t\t\tjQuery.globalEval( response, options, doc );\n\t\t}\n\t} );\n};\n\n\njQuery.fn.extend( {\n\twrapAll: function( html ) {\n\t\tvar wrap;\n\n\t\tif ( this[ 0 ] ) {\n\t\t\tif ( isFunction( html ) ) {\n\t\t\t\thtml = html.call( this[ 0 ] );\n\t\t\t}\n\n\t\t\t// The elements to wrap the target around\n\t\t\twrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );\n\n\t\t\tif ( this[ 0 ].parentNode ) {\n\t\t\t\twrap.insertBefore( this[ 0 ] );\n\t\t\t}\n\n\t\t\twrap.map( function() {\n\t\t\t\tvar elem = this;\n\n\t\t\t\twhile ( elem.firstElementChild ) {\n\t\t\t\t\telem = elem.firstElementChild;\n\t\t\t\t}\n\n\t\t\t\treturn elem;\n\t\t\t} ).append( this );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\twrapInner: function( html ) {\n\t\tif ( isFunction( html ) ) {\n\t\t\treturn this.each( function( i ) {\n\t\t\t\tjQuery( this ).wrapInner( html.call( this, i ) );\n\t\t\t} );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar self = jQuery( this ),\n\t\t\t\tcontents = self.contents();\n\n\t\t\tif ( contents.length ) {\n\t\t\t\tcontents.wrapAll( html );\n\n\t\t\t} else {\n\t\t\t\tself.append( html );\n\t\t\t}\n\t\t} );\n\t},\n\n\twrap: function( html ) {\n\t\tvar htmlIsFunction = isFunction( html );\n\n\t\treturn this.each( function( i ) {\n\t\t\tjQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );\n\t\t} );\n\t},\n\n\tunwrap: function( selector ) {\n\t\tthis.parent( selector ).not( \"body\" ).each( function() {\n\t\t\tjQuery( this ).replaceWith( this.childNodes );\n\t\t} );\n\t\treturn this;\n\t}\n} );\n\n\njQuery.expr.pseudos.hidden = function( elem ) {\n\treturn !jQuery.expr.pseudos.visible( elem );\n};\njQuery.expr.pseudos.visible = function( elem ) {\n\treturn !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );\n};\n\n\n\n\njQuery.ajaxSettings.xhr = function() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n};\n\nvar xhrSuccessStatus = {\n\n\t\t// File protocol always yields status code 0, assume 200\n\t\t0: 200,\n\n\t\t// Support: IE <=9 only\n\t\t// #1450: sometimes IE returns 1223 when it should be 204\n\t\t1223: 204\n\t},\n\txhrSupported = jQuery.ajaxSettings.xhr();\n\nsupport.cors = !!xhrSupported && ( \"withCredentials\" in xhrSupported );\nsupport.ajax = xhrSupported = !!xhrSupported;\n\njQuery.ajaxTransport( function( options ) {\n\tvar callback, errorCallback;\n\n\t// Cross domain only allowed if supported through XMLHttpRequest\n\tif ( support.cors || xhrSupported && !options.crossDomain ) {\n\t\treturn {\n\t\t\tsend: function( headers, complete ) {\n\t\t\t\tvar i,\n\t\t\t\t\txhr = options.xhr();\n\n\t\t\t\txhr.open(\n\t\t\t\t\toptions.type,\n\t\t\t\t\toptions.url,\n\t\t\t\t\toptions.async,\n\t\t\t\t\toptions.username,\n\t\t\t\t\toptions.password\n\t\t\t\t);\n\n\t\t\t\t// Apply custom fields if provided\n\t\t\t\tif ( options.xhrFields ) {\n\t\t\t\t\tfor ( i in options.xhrFields ) {\n\t\t\t\t\t\txhr[ i ] = options.xhrFields[ i ];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Override mime type if needed\n\t\t\t\tif ( options.mimeType && xhr.overrideMimeType ) {\n\t\t\t\t\txhr.overrideMimeType( options.mimeType );\n\t\t\t\t}\n\n\t\t\t\t// X-Requested-With header\n\t\t\t\t// For cross-domain requests, seeing as conditions for a preflight are\n\t\t\t\t// akin to a jigsaw puzzle, we simply never set it to be sure.\n\t\t\t\t// (it can always be set on a per-request basis or even using ajaxSetup)\n\t\t\t\t// For same-domain requests, won't change header if already provided.\n\t\t\t\tif ( !options.crossDomain && !headers[ \"X-Requested-With\" ] ) {\n\t\t\t\t\theaders[ \"X-Requested-With\" ] = \"XMLHttpRequest\";\n\t\t\t\t}\n\n\t\t\t\t// Set headers\n\t\t\t\tfor ( i in headers ) {\n\t\t\t\t\txhr.setRequestHeader( i, headers[ i ] );\n\t\t\t\t}\n\n\t\t\t\t// Callback\n\t\t\t\tcallback = function( type ) {\n\t\t\t\t\treturn function() {\n\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\tcallback = errorCallback = xhr.onload =\n\t\t\t\t\t\t\t\txhr.onerror = xhr.onabort = xhr.ontimeout =\n\t\t\t\t\t\t\t\t\txhr.onreadystatechange = null;\n\n\t\t\t\t\t\t\tif ( type === \"abort\" ) {\n\t\t\t\t\t\t\t\txhr.abort();\n\t\t\t\t\t\t\t} else if ( type === \"error\" ) {\n\n\t\t\t\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t\t\t\t// On a manual native abort, IE9 throws\n\t\t\t\t\t\t\t\t// errors on any property access that is not readyState\n\t\t\t\t\t\t\t\tif ( typeof xhr.status !== \"number\" ) {\n\t\t\t\t\t\t\t\t\tcomplete( 0, \"error\" );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tcomplete(\n\n\t\t\t\t\t\t\t\t\t\t// File: protocol always yields status 0; see #8605, #14207\n\t\t\t\t\t\t\t\t\t\txhr.status,\n\t\t\t\t\t\t\t\t\t\txhr.statusText\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcomplete(\n\t\t\t\t\t\t\t\t\txhrSuccessStatus[ xhr.status ] || xhr.status,\n\t\t\t\t\t\t\t\t\txhr.statusText,\n\n\t\t\t\t\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t\t\t\t\t// IE9 has no XHR2 but throws on binary (trac-11426)\n\t\t\t\t\t\t\t\t\t// For XHR2 non-text, let the caller handle it (gh-2498)\n\t\t\t\t\t\t\t\t\t( xhr.responseType || \"text\" ) !== \"text\" ||\n\t\t\t\t\t\t\t\t\ttypeof xhr.responseText !== \"string\" ?\n\t\t\t\t\t\t\t\t\t\t{ binary: xhr.response } :\n\t\t\t\t\t\t\t\t\t\t{ text: xhr.responseText },\n\t\t\t\t\t\t\t\t\txhr.getAllResponseHeaders()\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Listen to events\n\t\t\t\txhr.onload = callback();\n\t\t\t\terrorCallback = xhr.onerror = xhr.ontimeout = callback( \"error\" );\n\n\t\t\t\t// Support: IE 9 only\n\t\t\t\t// Use onreadystatechange to replace onabort\n\t\t\t\t// to handle uncaught aborts\n\t\t\t\tif ( xhr.onabort !== undefined ) {\n\t\t\t\t\txhr.onabort = errorCallback;\n\t\t\t\t} else {\n\t\t\t\t\txhr.onreadystatechange = function() {\n\n\t\t\t\t\t\t// Check readyState before timeout as it changes\n\t\t\t\t\t\tif ( xhr.readyState === 4 ) {\n\n\t\t\t\t\t\t\t// Allow onerror to be called first,\n\t\t\t\t\t\t\t// but that will not handle a native abort\n\t\t\t\t\t\t\t// Also, save errorCallback to a variable\n\t\t\t\t\t\t\t// as xhr.onerror cannot be accessed\n\t\t\t\t\t\t\twindow.setTimeout( function() {\n\t\t\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\t\t\terrorCallback();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Create the abort callback\n\t\t\t\tcallback = callback( \"abort\" );\n\n\t\t\t\ttry {\n\n\t\t\t\t\t// Do send the request (this may raise an exception)\n\t\t\t\t\txhr.send( options.hasContent && options.data || null );\n\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t// #14683: Only rethrow if this hasn't been notified as an error yet\n\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n} );\n\n\n\n\n// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)\njQuery.ajaxPrefilter( function( s ) {\n\tif ( s.crossDomain ) {\n\t\ts.contents.script = false;\n\t}\n} );\n\n// Install script dataType\njQuery.ajaxSetup( {\n\taccepts: {\n\t\tscript: \"text/javascript, application/javascript, \" +\n\t\t\t\"application/ecmascript, application/x-ecmascript\"\n\t},\n\tcontents: {\n\t\tscript: /\\b(?:java|ecma)script\\b/\n\t},\n\tconverters: {\n\t\t\"text script\": function( text ) {\n\t\t\tjQuery.globalEval( text );\n\t\t\treturn text;\n\t\t}\n\t}\n} );\n\n// Handle cache's special case and crossDomain\njQuery.ajaxPrefilter( \"script\", function( s ) {\n\tif ( s.cache === undefined ) {\n\t\ts.cache = false;\n\t}\n\tif ( s.crossDomain ) {\n\t\ts.type = \"GET\";\n\t}\n} );\n\n// Bind script tag hack transport\njQuery.ajaxTransport( \"script\", function( s ) {\n\n\t// This transport only deals with cross domain or forced-by-attrs requests\n\tif ( s.crossDomain || s.scriptAttrs ) {\n\t\tvar script, callback;\n\t\treturn {\n\t\t\tsend: function( _, complete ) {\n\t\t\t\tscript = jQuery( \"