/*!@license
* Infragistics.Web.ClientUI Combo 15.2.20152.1027
*
* Copyright (c) 2011-2015 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
* jquery-1.8.3.js
* jquery.ui.core.js
* jquery.ui.widget.js
* infragistics.templating.js
* infragistics.util.js
* infragistics.dataSource.js
*
* Example to use:
*   <script type="text/javascript">
*   $(function () {
*       $('#combo').igCombo();
*   });
*   </script>
*   <input id="combo" />
*/
(function($){$.widget("ui.igCombo",{options:{width:null,height:null,dropDownWidth:null,dataSource:null,dataSourceType:null,dataSourceUrl:null,responseTotalRecCountKey:null,responseDataKey:null,responseDataType:null,responseContentType:null,requestType:"GET",valueKey:null,textKey:null,itemTemplate:null,headerTemplate:null,footerTemplate:null,inputName:null,animationShowDuration:100,animationHideDuration:100,dropDownAttachedToBody:true,filteringType:"local",filterExprUrlKey:null,filteringCondition:"contains",filteringLogic:"OR",noMatchFoundText:null,loadOnDemandSettings:{enabled:false,pageSize:16},visibleItemsCount:15,placeHolder:null,mode:"editable",virtualization:false,multiSelection:{enabled:false,addWithKeyModifier:false,showCheckboxes:false,itemSeparator:", "},grouping:{key:null,dir:"asc"},validatorOptions:null,highlightMatchesMode:"multi",caseSensitive:false,autoSelectFirstMatch:true,autoComplete:false,allowCustomValue:false,closeDropDownOnBlur:true,delayInputChangeProcessing:250,tabIndex:null,dropDownOnFocus:false,closeDropDownOnSelect:true,selectItemBySpaceKey:false,initialSelectedItems:[{index:-1,value:null}],preventSubmitOnEnter:true,format:"auto",enableClearButton:true,dropDownButtonTitle:null,clearButtonTitle:null,dropDownOrientation:"auto"},events:{rendered:"rendered",dataBinding:"dataBinding",dataBound:"dataBound",filtering:"filtering",filtered:"filtered",itemsRendering:"itemsRendering",itemsRendered:"itemsRendered",dropDownOpening:"dropDownOpening",dropDownOpened:"dropDownOpened",dropDownClosing:"dropDownClosing",dropDownClosed:"dropDownClosed",selectionChanging:"selectionChanging",selectionChanged:"selectionChanged"},css:{comboWrapper:"ui-igcombo-wrapper",combo:"ui-igcombo ui-widget ui-state-default ui-corner-all ui-unselectable",dropDownMode:"ui-igcombo-mode-dropdown",readOnlyMode:"ui-igcombo-mode-readonly",readOnlyListMode:"ui-igcombo-mode-readonlylist",textBox:"ui-igcombo-textbox ui-state-default ui-corner-all",field:"ui-igcombo-field ui-corner-all",fieldHolder:"ui-igcombo-fieldholder",fieldHolderLTR:"ui-igcombo-fieldholder-ltr ui-corner-left",fieldHolderRTL:"ui-igcombo-fieldholder-rtl ui-corner-right",dropDownListRTL:"ig-rtl",button:"ui-igcombo-button ui-state-default ui-unselectable",buttonIcon:"ui-igcombo-buttonicon ui-icon-triangle-1-s ui-icon",buttonLTR:"ui-igcombo-button-ltr ui-corner-right",buttonRTL:"ui-igcombo-button-rtl ui-corner-left",clear:"ui-igcombo-clear ui-unselectable",clearHover:"ui-igcombo-clear-hover ui-state-hover",clearIcon:"ui-igcombo-clearicon ui-icon-circle-close ui-icon",dropDown:"ui-igcombo-dropdown ui-widget ui-widget-content ui-corner-all",list:"ui-igcombo-list",listOverflow:"ui-igcombo-list-overflow",listItemHolder:"ui-igcombo-listitemholder",listItem:"ui-igcombo-listitem ui-state-default ui-unselectable",header:"ui-igcombo-header",footer:"ui-igcombo-footer",group:"ui-igcombo-group",groupHeader:"ui-igcombo-group-header ui-state-default ui-unselectable",itemInFocus:"ui-igcombo-item-in-focus",listItemHighlighted:"ui-igcombo-highlight",noMatchFound:"ui-igcombo-nomatchfound",listItemTextWithCheckbox:"ui-igcombo-listitemtextwithcheckbox",checkbox:"ui-igcombo-checkbox ui-state-default ui-corner-all ui-igcheckbox-small",checkboxOff:"ui-icon ui-igcombo-checkbox-off ui-igcheckbox-small-off",checkboxOn:"ui-icon ui-icon-check ui-igcombo-checkbox-on ui-igcheckbox-small-on",hiddenField:"ui-igcombo-hidden-field",hover:"ui-state-hover",active:"ui-state-active",unselectable:"ui-unselectable",noBorder:"ui-igcombo-no-border",scrollHolder:"ui-igcombo-scrollholder ui-unselectable",scroll:"ui-igcombo-scroll ui-unselectable",recordsView:"ui-igcombo-records-view",recordsData:"ui-igcombo-records-data",recordsServer:"ui-igcombo-records-server",recordsServerTotal:"ui-igcombo-records-server-total",loading:"ui-igcombo-loading",hidden:"ui-helper-hidden",disabled:"ui-state-disabled",orientationTop:"ui-igcombo-orientation-top",orientationBottom:"ui-igcombo-orientation-bottom"},RECORDS_VIEW:"{0}",RECORDS_DATA:"{1}",RECORDS_SERVER:"{2}",RECORDS_SERVER_TOTAL:"{3}",_createWidget:function(options){var mode;this._options={$window:$(window),$comboWrapper:null,$combo:null,$input:null,$hiddenInput:null,$fieldCont:null,$clearCont:null,$clearIcon:null,$dropDownBtnCont:null,$dropDownBtnIcon:null,$dropDownCont:null,$dropDownListCont:null,$dropDownList:null,$header:undefined,$footer:undefined,$dropDownScrollCont:null,$dropDownScroll:null,$loading:null,$noMatchFound:null,$itemsToSelectOnShiftUpDown:$(),$itemsToSelectOnShiftClick:$(),selectedData:[],keyNavItemData:null,autoSelectedItemData:null,autoCompleteItemData:null,inputVal:"",highlightElement:"span",ltr:true,dropDownOpened:false,deltaItemsForLoadOnDemand:5,dataBinding:false,shiftKeyCode:16,validator:null,shiftDown:false,nameAttribute:"",internalSelChangeSubs:null,initialDataBinding:true,remoteFilteringTriggerEvt:null,preventInputBlur:false,mouseDownStartedFromListItem:false,cachedData:[],strDataSource:null,updateInputValuesOnRemoteFilter:false,hasFooterVariables:false,hadInputSelectionOnKeydown:false,expression:null,preventItemSeparatorOnFocus:false,preventDropDownOnFocus:false,keyUpTimeout:null,repositionInterval:null,disableScroll:false,cachedGroupLength:null,initialGroupHeaders:1,dropDownModeSearchBy:"",dropDownModeSearchByResetTimeout:null,dropDownModeSearchByResetDelay:1e3,originalOptions:options,checkboxItemTemplate:"<span class='{css.checkbox}'><span class='{css.checkboxOff}''></span></span><div class='{css.listItemTextWithCheckbox}'>{innerMarkup}</div>",scrollCallback:null};if(options){mode=options.mode;if(options.multiSelection&&options.multiSelection.enabled&&options.closeDropDownOnSelect===undefined){options.closeDropDownOnSelect=false}if(mode==="readonly"||mode==="readonlylist"||mode==="dropdown"&&!(options.multiSelection&&options.multiSelection.enabled)&&options.enableClearButton===undefined){options.enableClearButton=false}}$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){this._handlers={windowResize:$.proxy(this._windowResize,this),documentMouseUp:$.proxy(this._documentMouseUp,this),inputFocus:$.proxy(this._inputFocus,this),inputBlur:$.proxy(this._inputBlur,this),inputClick:$.proxy(this._inputClick,this),inputKeyDown:$.proxy(this._inputKeyDown,this),inputPaste:$.proxy(this._inputPaste,this),inputKeyUp:$.proxy(this._inputKeyUp,this),inputKeyPress:$.proxy(this._inputKeyPress,this),inputMouseDown:$.proxy(this._inputMouseDown,this)};this._analyzeOptions();this._analyzeInitialElem();this._render();this.validator();this._attachEvents();this.dataBind()},_analyzeOptions:function(){var key,firstDataItem,options=this.options,$combo=$(this.element),lod=options.loadOnDemandSettings;if(this.options.dataSource){if($.isArray(this.options.dataSource)){firstDataItem=this.options.dataSource[0]}else if(this.options.dataSource&&typeof this.options.dataSource._xmlToArray==="function"&&typeof this.options.dataSource._encodePkParams==="function"){firstDataItem=this.options.dataSource.data()[0]}}if(options.mode!=="editable"&&options.mode!=="dropdown"&&options.mode!=="readonly"&&options.mode!=="readonlylist"){options.mode="editable"}if(lod&&lod.enabled&&lod.pageSize&&options.loadOnDemandSettings.pageSize<5){lod.pageSize=5}else if(lod&&lod.enabled&&!lod.pageSize){lod.pageSize=this.options.visibleItemsCount+1}if(!options.textKey){if(options.valueKey){options.textKey=options.valueKey}else if(firstDataItem&&$.type(firstDataItem)==="object"){for(key in firstDataItem){if(firstDataItem.hasOwnProperty(key)){options.textKey=key;break}}}}if(!options.valueKey){options.valueKey=options.textKey}if(!options.textKey&&!options.valueKey){options.textKey="text";options.valueKey="value"}if(options.filteringType!=="local"&&options.filteringType!=="remote"&&options.filteringType!=="none"){options.filteringType="none"}if($combo.attr("name")&&this._options.originalOptions.inputName===undefined){options.inputName=$combo.attr("name")}this.options.noMatchFoundText=this.options.noMatchFoundText||$.ig.Combo&&$.ig.Combo.locale&&$.ig.Combo.locale.noMatchFoundText||"No Results";if(this.options.placeHolder===""){this.options.placeHolder=""}else{this.options.placeHolder=this.options.placeHolder||$.ig.Combo&&$.ig.Combo.locale&&$.ig.Combo.locale.placeHolder||"select..."}this.options.clearButtonTitle=this.options.clearButtonTitle||$.ig.Combo&&$.ig.Combo.locale&&$.ig.Combo.locale.clearButtonTitle||"Clear value";this.options.dropDownButtonTitle=this.options.dropDownButtonTitle||$.ig.Combo&&$.ig.Combo.locale&&$.ig.Combo.locale.dropDownButtonTitle||"Show drop-down";if($combo.attr("multiple")==="multiple"&&(this._options.originalOptions.multiSelection===undefined||this._options.originalOptions.multiSelection.enabled===undefined)){this.options.multiSelection.enabled=true}if($combo.attr("dir")==="rtl"){this._options.ltr=false}if(this.options.grouping.key&&firstDataItem&&firstDataItem[this.options.grouping.key]===undefined){throw new Error($.ig.Combo.locale.errorIncorrectGroupingKey)}},_analyzeInitialElem:function(){var element=this.element,_options=this._options;if(element.is("div")||element.is("span")){_options.$comboWrapper=element}else if(element.is("input")){_options.$input=element;_options.nameAttribute=element.attr("name");element.removeAttr("name")}else if(element.is("select")){element.hide();_options.nameAttribute=element.attr("name");element.removeAttr("name")}},_setupInput:function(){var _options=this._options;_options.$input.attr("placeholder",this.options.placeHolder);if(this.options.mode!=="editable"){_options.$input.attr({readonly:true,unselectable:"on"}).addClass(this.css.unselectable)}},_render:function(){var $header,$footer,footerMarkup,css=this.css,options=this.options,_options=this._options,$comboWrapper=(_options.$comboWrapper||$("<div>")).addClass(css.comboWrapper),$combo=$("<div>").addClass(css.combo).attr("unselectable","on"),$input=(_options.$input||$('<input type="text">')).addClass(css.field).attr({tabIndex:options.tabIndex,autocomplete:"off"}),$hiddenInput=$('<input type="hidden">').addClass(css.hiddenField),$fieldCont=$("<div>").addClass(css.fieldHolder),$clearCont=$("<div>").addClass(css.clear).attr({unselectable:"on",title:options.clearButtonTitle}),$clearIcon=$("<div>").addClass(css.clearIcon),$dropDownBtnCont=$("<div>").addClass(css.button).attr({unselectable:"on",title:options.dropDownButtonTitle}),$dropDownBtnIcon=$("<div>").addClass(css.buttonIcon),$dropDownCont=$("<div>").addClass(css.dropDown).width(options.dropDownWidth),$dropDownListCont=$("<div>").addClass(css.list),$dropDownList=$("<ul>").addClass(css.listItemHolder),$dropDownScrollCont=$("<div>").addClass(css.scrollHolder).attr("unselectable","on"),$dropDownScroll=$("<div>").addClass(css.scroll).attr("unselectable","on"),$loading=$("<div>").addClass(css.loading);switch(options.mode){case"dropdown":$combo.addClass(css.dropDownMode);break;case"readonlylist":$combo.addClass(css.readOnlyListMode);break;case"readonly":$combo.addClass(css.readOnlyMode);$comboWrapper.addClass(css.disabled);break}$fieldCont.addClass(css.fieldHolderLTR);$dropDownBtnCont.addClass(css.buttonLTR);if(!_options.ltr){$dropDownList.addClass(css.dropDownListRTL)}if(options.grouping.key){$dropDownList.addClass(css.group)}$clearIcon.appendTo($clearCont);$dropDownBtnIcon.appendTo($dropDownBtnCont);$dropDownList.appendTo($dropDownListCont);$dropDownListCont.appendTo($dropDownCont);if(typeof options.headerTemplate==="string"){$header=$("<div>").addClass(css.header).html(options.headerTemplate);$header.prependTo($dropDownCont)}if(typeof options.footerTemplate==="string"){footerMarkup=options.footerTemplate.replace(this.RECORDS_VIEW,"<span class="+css.recordsView+"></span>").replace(this.RECORDS_DATA,"<span class="+css.recordsData+"></span>").replace(this.RECORDS_SERVER,"<span class="+css.recordsServer+"></span>").replace(this.RECORDS_SERVER_TOTAL,"<span class="+css.recordsServerTotal+"></span>");_options.hasFooterVariables=footerMarkup!==options.footerTemplate;$footer=$("<div>").addClass(css.footer).html(footerMarkup);$footer.appendTo($dropDownCont)}if(options.virtualization){$dropDownListCont.addClass(css.listOverflow);$dropDownScrollCont.insertBefore($dropDownList);$dropDownScroll.appendTo($dropDownScrollCont)}if(this.element.is("input")){$input.wrap($fieldCont);$fieldCont=$input.parent();$fieldCont.wrap($combo);$combo=$fieldCont.parent();$combo.wrap($comboWrapper);$comboWrapper=$combo.parent();$clearCont.prependTo($combo);$dropDownBtnCont.prependTo($combo)}else{$input.appendTo($fieldCont);$dropDownBtnCont.appendTo($combo);$clearCont.appendTo($combo);$fieldCont.appendTo($combo);$combo.appendTo($comboWrapper)}$clearCont.hide();$hiddenInput.attr("name",options.inputName).appendTo($combo);$dropDownCont.css({height:0,top:-99999,left:-99999,overflow:"hidden"}).addClass(css.noBorder);if(options.dropDownAttachedToBody){$dropDownCont.appendTo($("body"))}else{$dropDownCont.appendTo($comboWrapper)}if(this.element.is("select")){$comboWrapper.insertBefore(this.element)}$comboWrapper.outerWidth(options.width);$comboWrapper.outerHeight(options.height);_options.$comboWrapper=$comboWrapper;_options.$combo=$combo;_options.$input=$input;_options.$hiddenInput=$hiddenInput;_options.$fieldCont=$fieldCont;_options.$clearCont=$clearCont;_options.$clearIcon=$clearIcon;_options.$dropDownBtnCont=$dropDownBtnCont;_options.$dropDownBtnIcon=$dropDownBtnIcon;_options.$dropDownCont=$dropDownCont;_options.$dropDownListCont=$dropDownListCont;_options.$dropDownList=$dropDownList;_options.$header=$header;_options.$footer=$footer;_options.$loading=$loading;this._setInputVal($input.val());if(options.virtualization){_options.$dropDownScrollCont=$dropDownScrollCont;_options.$dropDownScroll=$dropDownScroll}this._setupInput();if(options.disabled){this._disableCombo(true)}this._triggerRendered()},_itemInnerMarkup:function(data){var unwrappedData,dataItem,unwrappedDataItem;unwrappedData=this._unwrapData(data);dataItem=unwrappedData[this.options.textKey];unwrappedDataItem=this._unwrapData(dataItem);unwrappedDataItem=this._formatItem(unwrappedDataItem);return this.options.itemTemplate?$.ig.tmpl(this.options.itemTemplate,data):unwrappedDataItem},_formatItem:function(item){if($.ig&&$.ig.formatter){if(this.options.format==="auto"&&($.type(item)==="date"||$.type(item)==="number")){item=$.ig.formatter(item,null,null)}else if(this._formatEnabled()){item=$.ig.formatter(item,null,this.options.format)}}return item},_formatEnabled:function(){return!(this.options.format===""||this.options.format===null||this.options.format==="none")},_itemsToRenderCount:function(){return this._isPossibleToVirtualize()?this.options.visibleItemsCount:this.options.dataSource.dataView().length},_sortDataSource:function(){var options=this.options;options.dataSource.sort([{fieldName:options.grouping.key}],options.grouping.dir)},_groups:function(data){var prevGroup,curGroup,curData,len,i,options=this.options,groupKey=options.grouping.key,groups=[];data=data||options.dataSource.dataView();for(i=0,len=data.length;i<len;i++){curData=data[i];if(curData[groupKey]===undefined){throw new Error($.ig.Combo.locale.errorIncorrectGroupingKey)}curGroup=curData[groupKey];if(prevGroup===curGroup){groups[groups.length-1].members.push(curData)}else{prevGroup=curGroup;groups[groups.length]={name:curGroup,members:[curData]}}}return groups},_itemMarkup:function(data){var css=this.css,value=this._unwrapData(this._unwrapData(data)[this.options.valueKey]),innerMarkup=this._itemInnerMarkup(data),markup,escapedValue;escapedValue=$.ig.encode(value);markup='<li class="'+css.listItem+'" data-value="'+escapedValue+'" unselectable="on">';if(this._checkBoxesEnabled()){markup+=this._options.checkboxItemTemplate.replace("{css.checkbox}",css.checkbox).replace("{css.checkboxOff}",css.checkboxOff).replace("{css.listItemTextWithCheckbox}",css.listItemTextWithCheckbox).replace("{innerMarkup}",innerMarkup)}else{markup+=innerMarkup}markup+="</li>";return markup},_itemsMarkup:function(){var i,dataView=this.options.dataSource.dataView(),dataLen=this._itemsToRenderCount(),markup="";for(i=0;i<dataLen;i++){markup+=this._itemMarkup(dataView[i])}return markup},_groupHeaderMarkup:function(groupName){return'<li class="'+this.css.groupHeader+'">'+groupName+"</li>"},_groupMarkup:function(group){var len,i,members=group.members,itemsMarkup="";for(i=0,len=members.length;i<len;i++){itemsMarkup+=this._itemMarkup(members[i])}return this._groupHeaderMarkup(group.name)+itemsMarkup},_groupsMarkup:function(){var groups,groupsLen,i,dataView=this.options.dataSource.dataView(),dataLen=this._itemsToRenderCount(),markup="";this._sortDataSource();if(this.options.virtualization&&!this._options.cachedGroupLength){this._options.cachedGroupLength=this._groups(dataView).length}dataView=dataView.slice(0,dataLen);groups=this._groups(dataView);if(this.options.virtualization){for(i=0;i<dataLen;i++){if(this._isBoundaryOfGroups(dataView,i)){this._options.initialGroupHeaders++;i++}}dataView=dataView.slice(0,dataLen-this._options.initialGroupHeaders);groups=this._groups(dataView)}for(i=0,groupsLen=groups.length;i<groupsLen;i++){markup+=this._groupMarkup(groups[i])}return markup},_noMatchMarkup:function(){return'<li unselectable="on" class="'+this.css.noMatchFound+'">'+this.options.noMatchFoundText+"</li>"},_renderItems:function(success,msg,data){var markup,dropDownScrollHeight,schema,noCancel,options=this.options,_options=this._options,dataView=data.dataView(),dataLen=this._itemsToRenderCount();if(success!==null){this._triggerDataBound(success,msg)}if(!options.dataSource.settings.schema&&options.dataSource&&dataView.length>0){schema=this._initSchema(this._unwrapData(dataView)[0]);options.dataSource.schema(schema)}noCancel=this._triggerItemsRendering();if(noCancel){if(dataLen>0){if(options.grouping.key){markup=this._groupsMarkup()}else{markup=this._itemsMarkup()}}else{markup=this._noMatchMarkup()}_options.$dropDownList.html(markup);if(dataLen>0){this._setListContMaxHeight()}if(options.virtualization){dropDownScrollHeight=data.totalLocalRecordsCount()*this._itemHeight();_options.$dropDownScroll.height(dropDownScrollHeight);_options.$dropDownScrollCont.width($.ig.util.getScrollWidth()+1);this._updateVirtualScrollVisibility()}this._updateFooterVariables();if(_options.initialDataBinding){this._handleInitialSelection();_options.initialDataBinding=false}this._triggerItemsRendered()}},_handleRemoteFiltering:function(success,msg,data){var $items,selectedData,_options=this._options,event=_options.remoteFilteringTriggerEvt;this._renderItems(success,msg,data);this.positionDropDown();$items=this._$items();selectedData=_options.selectedData;_options.selectedData=[];this._selectData(selectedData,{focusCombo:true,keepFiltering:true,keepInputText:true,keepNavItem:true});this._updateSelection(event);this._updateAutoComplete();if(_options.keyNavItemData&&!this._isDataSelected(_options.keyNavItemData)){this._setKeyNavigationItem({data:_options.keyNavItemData,addStyles:true,resetDataOnNonFound:true})}if(_options.updateInputValuesOnRemoteFilter){this._updateInputValues();this._updateHighlighting();_options.updateInputValuesOnRemoteFilter=false}if(_options.inputVal){this._showClearButton()}else{this._hideClearButton()}this._updateFooterVariables();if(_options.validator){_options.validator._validateInternal(this.element,event)}if(event){this._triggerFiltered(event);_options.remoteFilteringTriggerEvt=null}},_handleLocalFilteringWithVirt:function(data){var $items,selectedData,_options=this._options;this._renderItems(null,null,data);this.positionDropDown();$items=this._$items();selectedData=_options.selectedData;_options.selectedData=[];this._selectData(selectedData,{focusCombo:true,keepFiltering:true,keepInputText:true});this._updateHighlighting()},_handleLoadOnDemand:function(err,success,data){var $items,selectedData,_options=this._options;this._renderItems(err,success,data);this.positionDropDown();$items=this._$items();selectedData=_options.selectedData;_options.selectedData=[];this._selectData(selectedData,{focusCombo:true,keepFiltering:true,keepInputText:true});this._updateHighlighting();if(this.options.multiSelection.enabled&&_options.keyNavItemData&&!this._isDataSelected(_options.keyNavItemData)){this._setKeyNavigationItem({data:_options.keyNavItemData,addStyles:true})}if(this.options.filteringType!=="remote"&&_options.expression){this._updateFiltering()}this._updateFooterVariables()},_updateGroupHeader:function($item,data){if(this.options.grouping.key&&this._isItem($item)){this._setVisualStylesToGroupHeader($item)}this._updateMarkupForGroupHeader($item,data);$item.attr("data-value",null);return this},_updateItem:function($item,data){var unwrappedDataItem,unwrappedDataValue,innerMarkup=this._itemInnerMarkup(data);if(this.options.grouping.key&&this._isGroupHeader($item)){this._setVisualStylesToItem($item);if(this._checkBoxesEnabled()){$item.html(this._options.checkboxItemTemplate.replace("{css.checkbox}",this.css.checkbox).replace("{css.checkboxOff}",this.css.checkboxOff).replace("{css.listItemTextWithCheckbox}",this.css.listItemTextWithCheckbox).replace("{innerMarkup}",""))}}this._updateMarkupForItem($item,innerMarkup);unwrappedDataItem=this._unwrapData(data);unwrappedDataValue=this._unwrapData(unwrappedDataItem[this.options.valueKey]);$item.attr("data-value",unwrappedDataValue);return this},_removePlaceholderOnEmptyTextVal:function(){var _options=this._options,placeholderAttr=_options.$input.attr("placeholder");if(_options.inputVal===""&&_options.selectedData.length>0&&(typeof placeholderAttr!==typeof undefined||placeholderAttr!==false)){_options.$input.removeAttr("placeholder")}},_addPlaceholderWhenEmptyTextVal:function(){var _options=this._options,placeholderAttr=_options.$input.attr("placeholder");if(_options.inputVal===""&&_options.selectedData.length===0&&(typeof placeholderAttr===typeof undefined||placeholderAttr===false)){_options.$input.attr("placeholder",this.options.placeHolder)}},_isGroupHeader:function($item){return $item.hasClass(this.css.groupHeader)},_isItem:function($item){return $item.hasClass(this.css.listItem)},_setVisualStylesToGroupHeader:function($item){$item.removeClass(this.css.listItem);$item.addClass(this.css.groupHeader)},_setVisualStylesToItem:function($item){$item.removeClass(this.css.groupHeader);$item.addClass(this.css.listItem)},_updateMarkupForGroupHeader:function($item,data){if(this.options.grouping.key&&data[this.options.grouping.key]!==undefined){$item.html(data[this.options.grouping.key])}},_updateMarkupForItem:function($item,innerMarkup){if(this._checkBoxesEnabled()){$item.find("."+this.css.listItemTextWithCheckbox).html(innerMarkup)}else{$item.html(innerMarkup)}},_$items:function(includeGroupHeaders){var selector="."+this.css.listItem.split(" ",1)[0];if(this.options.grouping.key&&includeGroupHeaders){selector+=",."+this.css.groupHeader.split(" ",1)[0]}return this._options.$dropDownList.children(selector)},_$filteredItems:function(){return this._$items().not("."+this.css.hidden)},_$elementFromData:function(data,$items){var curData,i,len,valueKey=this.options.valueKey,values=[];$items=$items||this._$items();if($.type(data)!=="array"){data=[data]}for(i=0,len=data.length;i<len;i++){curData=data[i];if(curData!==null&&curData!==undefined){values.push(curData[valueKey])}}return this._$elementFromValue(values,$items)},_$elementFromValue:function(value,$items){var i,result=$();$items=$items||this._$items();if($.type(value)!=="array"){value=[value]}for(i=0;i<value.length;i++){result=result.add($items.filter("[data-value='"+value[i]+"']"))}return result},_$elementsFromItems:function(items){var i,result=$();if($.type(items)!=="array"){items=[items]}for(i=0;i<items.length;i++){result=result.add(items[i].element)}return result},_$selectedItems:function(){var i,selItems=this.selectedItems(),$selItems=$(),len=selItems.length;for(i=0;i<len;i++){$selItems=$selItems.add(selItems[i].element)}return $selItems},_isDataEqual:function(data1,data2){var data1Value,data2Value;if(data1!==null&&data1!==undefined&&data2!==null&&data2!==undefined){data1Value=this._unwrapData(this._unwrapData(data1)[this.options.valueKey]);data2Value=this._unwrapData(this._unwrapData(data2)[this.options.valueKey]);return data1Value===data2Value}return false},_isDataSelected:function(data){return this.isValueSelected(data[this.options.valueKey])},_filterData:function(data1,data2){var data2Len,self=this;if($.type(data1)!=="array"){data1=[data1]}if($.type(data2)!=="array"){data2=[data2]}data2Len=data2.length;return data1.filter(function(data){var i;for(i=0;i<data2Len;i++){if(self._isDataEqual(data,data2[i])){return false}}return true})},_filterItems:function(items1,items2){var result,valKey=this.options.valueKey,self=this;result=items1.filter(function(item){var i,unwrappedDataItem,unwrappedDataValue,unwrappedDataItemToCompare,unwrappedDataValueToCompare,matchFound=false;unwrappedDataItem=self._unwrapData(item.data);unwrappedDataValue=self._unwrapData(unwrappedDataItem[valKey]);for(i=0;i<items2.length&&!matchFound;i++){unwrappedDataItemToCompare=self._unwrapData(items2[i].data);unwrappedDataValueToCompare=self._unwrapData(unwrappedDataItemToCompare[valKey]);if(unwrappedDataValue===unwrappedDataValueToCompare){matchFound=true}}return!matchFound});return result},_valuesFromData:function(data){var unwrappedDataItem,unwrappedDataValue,i,len=data.length,valKey=this.options.valueKey,values=[];for(i=0;i<len;i++){unwrappedDataItem=this._unwrapData(data[i]);unwrappedDataValue=this._unwrapData(unwrappedDataItem[valKey]);values.push(unwrappedDataValue)}return values},_valuesFromElements:function($items){var i,values=[];for(i=0;i<$items.length;i++){values.push($items.eq(i).attr("data-value"))}return values},_valuesFromItems:function(item){var i,unwrappedDataItem,unwrappedDataValue,values=[],valueKey=this.options.valueKey;if(!item){return}if($.type(item)!=="array"){item=[item]}for(i=0;i<item.length;i++){unwrappedDataItem=this._unwrapData(item[i].data);unwrappedDataValue=this._unwrapData(unwrappedDataItem[valueKey]);values.push(unwrappedDataValue)}return values},_dataFromItems:function(items){var len,i,data=[];for(i=0,len=items.length;i<len;i++){data.push(items[i].data)}return data},_dataFromIndex:function(index){var data=this.options.dataSource.data();return data.length>index?data[index]:null},_dataForValues:function(value){var data,i,len,result=[];if($.type(value)!=="array"){value=[value]}for(i=0,len=value.length;i<len;i++){data=this.dataForValue(value[i]);if(data!==null){result.push(data)}}return result},_dataIndexByValue:function(value,searchDataViewOnly){var unwrappedDataItem,unwrappedDataValue,i,result=-1,data=searchDataViewOnly?this.options.dataSource.dataView():this.options.dataSource.data(),len=data.length,valKey=this.options.valueKey;for(i=0;i<len;i++){unwrappedDataItem=this._unwrapData(data[i]);unwrappedDataValue=this._unwrapData(unwrappedDataItem[valKey]);if(this._areValuesEqual(unwrappedDataValue,value)){result=i;break}}return result},_itemsFromData:function(data){var curData,len,i,$items=this._$items(),result=[];if($.type(data)!=="array"){data=[data]}for(i=0,len=data.length;i<len;i++){curData=data[i];if(curData!==null&&curData!==undefined){result.push({element:this._$elementFromData(curData,$items),data:curData})}}return result.length>0?result:null},_$keyNavItem:function(){return this._$elementFromData(this._options.keyNavItemData)},_updateFooterVariables:function(){var ds,recordsView,recordsData,recordsServer,recordsServerTotal;if(this._options.hasFooterVariables){ds=this.options.dataSource;recordsView=ds.dataView().length;recordsData=ds.data().length;recordsServer=Math.max(ds.totalRecordsCount(),recordsData);recordsServerTotal=Math.max(recordsServer,parseInt(this._options.totalAll||0,10));this._options.$footer.find("."+this.css.recordsView).html(recordsView);this._options.$footer.find("."+this.css.recordsData).html(recordsData);this._options.$footer.find("."+this.css.recordsServer).html(recordsServer);this._options.$footer.find("."+this.css.recordsServerTotal).html(recordsServerTotal)}},_moveCaretToInputEnd:function(preventItemSeparatorOnFocus){var range,input=this._options.$input[0],readonly=this._options.$input.attr("readonly");if(readonly){this._options.$input.removeAttr("readonly")}this._safeFocusInput(preventItemSeparatorOnFocus);if(typeof input.selectionStart==="number"&&!$.ig.util.isIE){input.selectionStart=input.selectionEnd=input.value.length}else if(typeof input.createTextRange!=="undefined"&&$(input).is(":visible")&&!readonly){range=input.createTextRange();range.collapse(false);range.select()}if(readonly){this._options.$input.attr("readonly",readonly)}},_refreshVisualStylesForItem:function($item,data){var isSelected=this._isDataSelected(data);if(isSelected){this._addItemSelectionStyles($item)}else{this._removeItemSelectionStyles($item)}if(this.options.multiSelection.enabled){if(this._isDataEqual(this._options.keyNavItemData,data)&&!isSelected){$item.addClass(this.css.itemInFocus)}else{$item.removeClass(this.css.itemInFocus)}}},_handleInitialSelection:function(){var curSelItem,selectOptions,selectedOptions,curIndex,i,curDataItem,selItems=this.options.initialSelectedItems,data=this.options.dataSource.data(),dataToSel=[],mode=this.options.mode;if($.type(selItems)==="array"){for(i=0;i<selItems.length;i++){curSelItem=selItems[i];curIndex=curSelItem.index;if(curIndex>=0&&data.length>=curIndex){curDataItem=data[curIndex]}else if(curSelItem.value!==undefined&&curSelItem.value!==null){curDataItem=this.dataForValue(curSelItem.value)}if(curDataItem&&dataToSel.indexOf(curDataItem)===-1){dataToSel.push(curDataItem)}}}if(this.element.is("select")){selectOptions=this.element.find("option");selectedOptions=selectOptions.filter(":selected");for(i=0;i<selectedOptions.length;i++){dataToSel.push(data[selectOptions.index(selectedOptions.eq(i))])}}this._selectFirstItemInNonEditableModes(mode,dataToSel,data)},_selectFirstItemInNonEditableModes:function(mode,dataToSel,data){if((mode==="dropdown"&&!this.options.multiSelection.enabled||mode==="readonly"||mode==="readonlylist")&&dataToSel.length===0){if(data[0]!==null&&data[0]!==undefined){dataToSel.push(data[0])}}if(dataToSel.length>0){this._selectData(dataToSel,{additive:true,keepScrollPosition:true})}},_checkBoxesEnabled:function(){return this.options.multiSelection.enabled&&this.options.multiSelection.showCheckboxes},_isPossibleToVirtualize:function(){return this.options.virtualization&&this.options.dataSource.dataView().length>this.options.visibleItemsCount},_areItemsLowerInVir:function(){return this.options.virtualization&&this.options.dataSource.dataView().length<=this.options.visibleItemsCount},_dropDownHeight:function(itemHeight,allItemsCount){return itemHeight*allItemsCount},_itemHeight:function(){return this._$items().first().outerHeight()},_isFilteringEnabled:function(){return this.options.filteringType!=="none"},_updateItems:function(offset){var elementIndex,lengthOfElements,itemIndex,$this,curData,self=this,options=this.options,dataView=options.dataSource.dataView(),$items=this._$items(true),realOffset=0;offset=offset>0?offset:0;this._unhighlight();for(elementIndex=0,itemIndex=0,lengthOfElements=$items.length;elementIndex<lengthOfElements;elementIndex++){$this=$items.eq(elementIndex);realOffset=itemIndex+offset;curData=dataView[realOffset];if(curData&&this.options.grouping.key&&(self._isBoundaryOfGroups(dataView,realOffset)||self._isFirstItem(dataView,realOffset))){this._updateGroupHeader($this,curData)._refreshVisualStylesForItem($this,curData[options.grouping.key]);elementIndex++;$this=$items.eq(elementIndex)}if($this){this._updateItem($this,curData)._refreshVisualStylesForItem($this,curData)}itemIndex++}this._updateHighlighting()},_isFirstItem:function(data,itemIndex){if(!data[itemIndex-1]){return true}return false},_isBoundaryOfGroups:function(data,itemIndex){if(this.options.grouping.key&&data[itemIndex-1]&&data[itemIndex-1][this.options.grouping.key]!==data[itemIndex][this.options.grouping.key]){return true}return false},_toggleDropDownState:function(event){if(this._options.dropDownOpened){this.closeDropDown(null,event)
}else{this.openDropDown(null,true,event)}},_lastValAfterItemSep:function(){return this._options.inputVal.split(this.options.multiSelection.itemSeparator).pop()},_startsWith:function(text,fragment){return fragment!==""&&text.indexOf(fragment)===0},_endsPartialyWithItemSep:function(text){var separator=this.options.multiSelection.itemSeparator,i=separator.length,matchFound=0;for(;i>0&&!matchFound;i--){if(text.endsWith(separator.slice(0,i))){matchFound=i}}return matchFound},_filterItemSeparator:function(text){return text.slice(0,text.length-this._endsPartialyWithItemSep(text))},_separatedInputTexts:function(){var result=this._options.inputVal.split(this.options.multiSelection.itemSeparator);result[result.length-1]=this._filterItemSeparator(result[result.length-1]);return result},_updateSelection:function(event){var textsLen,dataLen,curText,curData,curDataValue,curDataText,setAsKeyNav,matchFound,isLastText,unwrappedData,i,j,options=this.options,_options=this._options,texts=_options.inputVal,data=options.dataSource.data(),textKey=options.textKey,valueKey=options.valueKey,justSelectedData=[],multiSelect=options.multiSelection.enabled;if(options.filteringType==="remote"){data=this._filterData(_options.cachedData,data).concat(data)}dataLen=data.length;if(multiSelect){texts=this._separatedInputTexts(texts)}else{texts=[texts]}if(options.autoSelectFirstMatch){_options.autoSelectedItemData=null}unwrappedData=this._unwrapData(data);for(i=0,textsLen=texts.length;i<textsLen;i++){curText=texts[i];matchFound=false;isLastText=i===textsLen-1;if(!options.caseSensitive){curText=curText.toLowerCase()}for(j=0;j<dataLen&&!matchFound;j++){curData=this._unwrapData(unwrappedData[j]);curDataText=this._unwrapData(curData[textKey]).toString();curDataValue=this._unwrapData(curData[valueKey]);setAsKeyNav=isLastText&&!this.isValueSelected(curDataValue);if(!options.caseSensitive){curDataText=curDataText.toLowerCase()}if(options.autoSelectFirstMatch){if(this._startsWith(curDataText,curText)){if(multiSelect){if(this._filterData(curData,justSelectedData).length===1){if(setAsKeyNav){this._setKeyNavigationItem({data:curData,addStyles:true,clearPrevItem:true,scrollToItem:true})}else{this._selectData(curData,{additive:true,focusCombo:true,keepInputText:true,keepHighlighting:true,keepFiltering:true},event)}matchFound=true;if(curDataText!==curText){_options.autoSelectedItemData=curData}}if(!setAsKeyNav){justSelectedData.push(curData)}}else{this._selectData(curData,{focusCombo:true,keepInputText:true,keepHighlighting:true,keepFiltering:true},event);if(curDataText!==curText){_options.autoSelectedItemData=curData}matchFound=true;justSelectedData.push(curData)}}}else if(curDataText===curText){if(multiSelect){if(this._filterData(curData,justSelectedData).length===1){if(setAsKeyNav){this._setKeyNavigationItem({data:curData,addStyles:true,clearPrevItem:true,scrollToItem:true})}else{this._selectData(curData,{additive:true,focusCombo:true,keepInputText:true,keepHighlighting:true,keepFiltering:true},event)}matchFound=true}if(!setAsKeyNav){justSelectedData.push(curData)}}else{this._selectData(curData,{additive:true,focusCombo:true,keepInputText:true,keepHighlighting:true,keepFiltering:true},event);matchFound=true;justSelectedData.push(curData)}}}}this._deselectData(this._filterData(_options.selectedData,justSelectedData),{focusCombo:true,keepInputText:true},event);if(multiSelect&&_options.inputVal.endsWith(options.multiSelection.itemSeparator)){this._updateInputValues(false)}this._updateHighlighting()},_updateAutoComplete:function(){var text,curData,curDataText,unwrappedData,i,options=this.options,_options=this._options,texts=_options.inputVal,data=options.dataSource.data(),dataLen=data.length,textKey=options.textKey,multiSelect=options.multiSelection.enabled;if(multiSelect){texts=this._options.inputVal.split(options.multiSelection.itemSeparator)}else{texts=[texts]}if(texts.length>this._fullySelectedItemsLen()){text=texts[texts.length-1];if(multiSelect&&this._endsPartialyWithItemSep(text)){return}if(!options.caseSensitive){text=text.toLowerCase()}if(_options.autoSelectedItemData){_options.autoCompleteItemData=_options.autoSelectedItemData;this._autoComplete(_options.autoCompleteItemData[textKey].toString().slice(text.length))}else{for(i=0;i<dataLen;i++){unwrappedData=this._unwrapData(data);curData=this._unwrapData(unwrappedData[i]);curDataText=this._unwrapData(curData[textKey]).toString();if(!options.caseSensitive){curDataText=curDataText.toLowerCase()}if(!(curData!==_options.autoSelectedItemData&&this._isDataSelected(curData))&&this._startsWith(curDataText,text)){_options.autoCompleteItemData=curData;this._autoComplete(this._unwrapData(curData[textKey]).toString().slice(text.length));break}}}}},_autoComplete:function(autoCompleteText){var oldInputVal,newInputVal;if(this.options.autoComplete){oldInputVal=this._options.inputVal;newInputVal=oldInputVal+autoCompleteText;this._options.$input.val(newInputVal);this._setInputSelection(oldInputVal.length,newInputVal.length)}},_setInputSelection:function(start,end){var selRange,field=this._options.$input[0];if(field.createTextRange){selRange=field.createTextRange();selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select();field.focus()}else if(field.setSelectionRange){field.focus();field.setSelectionRange(start,end)}else if(typeof field.selectionStart!=="undefined"){field.selectionStart=start;field.selectionEnd=end;field.focus()}},_hasInputSelection:function(){var field=this._options.$input[0],result=false;if(typeof field.selectionStart!=="undefined"){result=field.selectionStart!==field.selectionEnd}return result},_scrollToItem:function(data){var listContHeight,listContTop,listContScrollTop,itemTop,itemHeight,itemIndex,$item=this._$elementFromData(data);if(this._options.dropDownOpened){if($item.length>0){listContHeight=this._options.$dropDownListCont.height();listContTop=this._options.$dropDownListCont.offset().top;listContScrollTop=this.listScrollTop();itemTop=$item.offset().top;itemHeight=$item.outerHeight();if(!(itemTop>listContTop&&itemTop+itemHeight<listContHeight+listContTop)){this.listScrollTop(itemTop+listContScrollTop+itemHeight-listContTop-listContHeight)}}else if(this.options.virtualization){itemIndex=this._dataIndexByValue(data[this.options.valueKey]);this.listScrollTop((itemIndex-this.options.visibleItemsCount+2)*this._itemHeight())}}},_scrollToLastSelItem:function(){if(this._options.keyNavItemData!==null){this._scrollToItem(this._options.keyNavItemData)}else if(this._options.selectedData.length>0){this._scrollToItem(this._options.selectedData[this._options.selectedData.length-1])}},_positionItemInVisibleArea:function($item){var $listCont=this._options.$dropDownListCont,listContHeight=$listCont.height(),listContTop=$listCont.offset().top,listContScrollTop=this.listScrollTop(),itemTop=$item.offset().top,itemHeight=$item.outerHeight(true);if(listContTop>itemTop){this.listScrollTop(this._$items().filter(":visible").index($item)*itemHeight)}if(itemTop+itemHeight>listContHeight+listContTop){this.listScrollTop(itemTop+itemHeight+listContScrollTop-listContHeight-listContTop)}},_setKeyNavigationItem:function(options){var $item,$prevKeyNavItem,data=options.data,addStyles=options.addStyles,clearPrevItem=options.clearPrevItem,scrollToItem=options.scrollToItem,resetDataOnNonFound=options.resetDataOnNonFound;if(data instanceof $){$item=data;data=this.dataForValue($item.attr("data-value"))}else{$item=this._$elementFromData(data)}if(clearPrevItem){$prevKeyNavItem=this._$elementFromData(this._options.keyNavItemData);if($prevKeyNavItem.length>0){$prevKeyNavItem.removeClass(this.css.itemInFocus)}}if(addStyles&&$item.length>0){$item.addClass(this.css.itemInFocus)}if($item.length===0&&resetDataOnNonFound){this._options.keyNavItemData=null}else{this._options.keyNavItemData=data}if(scrollToItem){this._scrollToItem(data)}},_navigateToItem:function($item,addStyles,clearPrevItem,event,keepScrollPosition){if($item.length===0){return}if(!this.options.multiSelection.enabled){this.select($item,{focusCombo:true,keepFiltering:true,keepScrollPosition:keepScrollPosition},event)}else{this._setKeyNavigationItem({data:$item,addStyles:addStyles,clearPrevItem:clearPrevItem})}this._positionItemInVisibleArea($item)},_prevVisibleItem:function($item){do{$item=$item.prev()}while($item.length>0&&(!$item.is("."+this.css.listItem.split(" ",1)[0])||!$item.is(":visible")));return $item},_nextVisibleItem:function($item){do{$item=$item.next()}while($item.length>0&&(!$item.is("."+this.css.listItem.split(" ",1)[0])||!$item.is(":visible")));return $item},_visibleItemByIndex:function(index){return this._$items().filter(":visible").eq(index)},_handleInputChange:function(openDropDown,event){var options=this.options,_options=this._options,curVal=_options.$input.val();if(options.autoComplete&&event.which===8&&_options.hadInputSelectionOnKeydown){curVal=curVal.slice(0,curVal.length-1);_options.$input.val(curVal)}if(options.autoComplete&&this._hasInputSelection()){return}if(curVal!==_options.inputVal){this._setInputVal(curVal);if(options.filteringType==="remote"){this._updateFiltering(event)}else{if(options.filteringType==="local"){_options.disableScroll=true;this._updateFiltering(event);setTimeout(function(){_options.disableScroll=false},0)}if(curVal){this._showClearButton()}else{this._hideClearButton()}this._updateSelection(event);this._updateAutoComplete();if(_options.validator){_options.validator._validateInternal(this.element,event)}}if(openDropDown){this.openDropDown(null,false,event)}}},_handleShiftNavigation:function($itemToNavigate,event){var _options=this._options,$keyNavItem=this._$keyNavItem();if($itemToNavigate.is(_options.$itemsToSelectOnShiftUpDown)){$keyNavItem.removeClass(this.css.itemInFocus);_options.$itemsToSelectOnShiftUpDown=_options.$itemsToSelectOnShiftUpDown.not($keyNavItem)}else{$itemToNavigate.addClass(this.css.itemInFocus);_options.$itemsToSelectOnShiftUpDown=_options.$itemsToSelectOnShiftUpDown.add($itemToNavigate)}this._navigateToItem($itemToNavigate,false,false,event)},_handleShiftUp:function(event){var _options=this._options;if(_options.$itemsToSelectOnShiftUpDown.length>1){this.select(_options.$itemsToSelectOnShiftUpDown,{additive:true,focusCombo:true,keepNavItem:true,keepFiltering:true},event);_options.$itemsToSelectOnShiftUpDown.removeClass(this.css.itemInFocus)}_options.$itemsToSelectOnShiftUpDown=$();_options.shiftDown=false},_handleShiftClick:function(event){var _options=this._options;if(_options.$itemsToSelectOnShiftClick.length>1){this.select(_options.$itemsToSelectOnShiftClick,{additive:true,focusCombo:true,keepNavItem:true,keepFiltering:true},event);_options.$itemsToSelectOnShiftClick.removeClass(this.css.itemInFocus);this._setKeyNavigationItem({data:$(event.target),clearPrevItem:true})}_options.$itemsToSelectOnShiftClick=$()},_groupHeaderClass:function(){return"."+this.css.groupHeader.split(" ",1)[0]},_$groupHeaders:function(){return this._$items(true).filter(this._groupHeaderClass())},_handleKeyNavigation:function(event){var $item,index,multiSelect,closeDropDown,isAutoSelectedActive,$lastSelectedItem,visibleItemsCount,self=this,options=this.options,_options=this._options,multiSelection=options.multiSelection.enabled,$keyNavItem=this._$keyNavItem(),$visibleItems=this._$items().filter(":visible"),currentScrollTop=this.listScrollTop(),activeIndex=this.activeIndex(),itemHeight=this._itemHeight(),addScrollCallback=false;if(event.keyCode===$.ui.keyCode.ESCAPE){if(options.multiSelection.enabled){if(this._lastValAfterItemSep().length===0){this.closeDropDown(null,event)}else{this._updateInputValues();this.clearFiltering(event);this._unhighlight()}}else{if(_options.inputVal.length===0){this.closeDropDown(null,event)}else if(_options.selectedData.length===0){this._updateInputValues();this.clearFiltering(event);this._unhighlight()}else if(_options.autoSelectedItemData){this._deselectData(_options.autoSelectedItemData,null,event);this.clearFiltering(event);this._unhighlight()}else{this.closeDropDown(null,event)}}event.preventDefault()}if(event.keyCode===$.ui.keyCode.DOWN){if(event.altKey||!_options.dropDownOpened){this.openDropDown(null,true,event)}else{$item=$keyNavItem.length>0?this._nextVisibleItem($keyNavItem):$visibleItems.eq(0);if(event.shiftKey&&multiSelection&&_options.dropDownOpened){this._handleShiftNavigation($item,event)}else{this._navigateToItem($item,true,true,event)}visibleItemsCount=options.visibleItemsCount-1;if(options.grouping){visibleItemsCount-=this._$groupHeaders().length}if(options.virtualization&&activeIndex>=visibleItemsCount){this.listScrollTop(currentScrollTop+itemHeight+1)}}event.preventDefault()}if(event.keyCode===$.ui.keyCode.UP){if(_options.dropDownOpened){if(event.altKey||$keyNavItem.length===0||this._isDataEqual(_options.keyNavItemData,options.dataSource.dataView()[0])){this.closeDropDown(null,event)}else{$item=this._prevVisibleItem($keyNavItem);if(event.shiftKey&&multiSelection&&_options.dropDownOpened){this._handleShiftNavigation($item,event)}else{this._navigateToItem($item,true,true,event)}if(options.virtualization&&activeIndex-1<0){this.listScrollTop(currentScrollTop-itemHeight-1)}}}event.preventDefault()}if(event.keyCode===$.ui.keyCode.ENTER||options.selectItemBySpaceKey&&event.keyCode===$.ui.keyCode.SPACE){if(event.shiftKey&&_options.$itemsToSelectOnShiftUpDown.length===1){$lastSelectedItem=this._$elementFromData(_options.selectedData[_options.selectedData.length-1]);this.select(this._itemsBetweenTwoItems($keyNavItem,$lastSelectedItem),{additive:true})}else{isAutoSelectedActive=$keyNavItem.is(_options.$autoSelectedItem);multiSelect=multiSelection&&(!options.multiSelection.addWithKeyModifier||event.ctrlKey||isAutoSelectedActive);if(multiSelect&&this.isSelected($keyNavItem)&&!isAutoSelectedActive){this._deselectData(_options.keyNavItemData,{focusCombo:true},event)}else{closeDropDown=multiSelect?false:options.closeDropDownOnSelect;if(options.autoComplete&&$keyNavItem.length===0&&_options.autoCompleteItemData){this._selectData(_options.autoCompleteItemData,{additive:multiSelect,closeDropDown:closeDropDown,focusCombo:true},event)}else{this._selectData(_options.keyNavItemData,{additive:multiSelect,closeDropDown:closeDropDown,focusCombo:true},event)}}}if(event.keyCode===$.ui.keyCode.ENTER&&options.preventSubmitOnEnter||event.keyCode===$.ui.keyCode.SPACE){event.preventDefault()}}if(event.keyCode===$.ui.keyCode.HOME&&event.ctrlKey&&_options.dropDownOpened){if(options.virtualization){this.listScrollTop(0);addScrollCallback=true}if(addScrollCallback){this._options.scrollCallback=function(){self._navigateToItem($visibleItems.first(),true,true,event)}}else{this._navigateToItem($visibleItems.first(),true,true,event)}event.preventDefault()}if(event.keyCode===$.ui.keyCode.END&&event.ctrlKey&&_options.dropDownOpened){if(options.virtualization){this.listScrollTop(this.options.dataSource.totalLocalRecordsCount()*itemHeight);addScrollCallback=true}if(addScrollCallback){this._options.scrollCallback=function(){self._navigateToItem($visibleItems.last(),true,true,event)}}else{this._navigateToItem($visibleItems.last(),true,true,event)}event.preventDefault()}if(event.keyCode===$.ui.keyCode.PAGE_UP&&_options.dropDownOpened){index=-options.visibleItemsCount+1;if($keyNavItem.length>0){index+=$visibleItems.index($keyNavItem)}if(index<0){if(options.virtualization&&currentScrollTop>0){this.listScrollTop(currentScrollTop+itemHeight*index);addScrollCallback=true}index=0}if(addScrollCallback){this._options.scrollCallback=function(){self._navigateToItem($visibleItems.eq(index),true,true,event,true)}}else{this._navigateToItem($visibleItems.eq(index),true,true,event,true)}event.preventDefault()}if(event.keyCode===$.ui.keyCode.PAGE_DOWN&&_options.dropDownOpened){index=options.visibleItemsCount-1;if($keyNavItem.length>0){index+=$visibleItems.index($keyNavItem)}if(index>$visibleItems.length-1){if(options.virtualization){this.listScrollTop(currentScrollTop+itemHeight*index);addScrollCallback=currentScrollTop<this.listScrollTop()}index=$visibleItems.length-1}if(addScrollCallback){this._options.scrollCallback=function(){self._navigateToItem($visibleItems.eq(index),true,true,event)}}else{this._navigateToItem($visibleItems.eq(index),true,true,event)}event.preventDefault()}if(event.keyCode===_options.shiftKeyCode&&multiSelection&&_options.dropDownOpened&&!_options.shiftDown){_options.shiftDown=true;_options.$itemsToSelectOnShiftUpDown=$keyNavItem;$keyNavItem.addClass(this.css.itemInFocus)}},_dropDownContHeight:function(){var _options=this._options,dropDownContainerHeight=parseInt(_options.$dropDownListCont.outerHeight(true),10);if(_options.$header!==undefined){dropDownContainerHeight+=_options.$header.outerHeight(true)}if(_options.$footer!==undefined){dropDownContainerHeight+=_options.$footer.outerHeight(true)}return dropDownContainerHeight},_itemsBetweenTwoItems:function($item1,$item2){var firstIndex,sndIndex,temp,$items=this._$items(),$result=$();firstIndex=$items.index($item1);sndIndex=$items.index($item2);if(firstIndex>sndIndex){temp=firstIndex;firstIndex=sndIndex;sndIndex=temp}for(;firstIndex<=sndIndex;firstIndex++){$result=$result.add(this._visibleItemByIndex(firstIndex))}return $result},_safeFocusInput:function(preventItemSeparatorOnFocus){var $input=this._options.$input,input=$input[0];this._options.preventDropDownOnFocus=true;this._options.preventItemSeparatorOnFocus=preventItemSeparatorOnFocus;if(!$input.is(":focus")){input.focus()}else{$input.focus()}},_windowResize:function(){this.positionDropDown()},_documentMouseUp:function(){var _options=this._options;if(_options.$itemsToSelectOnShiftClick.length>0){_options.$itemsToSelectOnShiftClick=$()}_options.mouseDownStartedFromListItem=false},_inputFocus:function(event){var mode=this.options.mode;if(this.options.disabled){return}if(mode==="editable"||mode==="dropdown"){this._options.$combo.addClass(this.css.active)}if(mode==="editable"){if(this._options.preventItemSeparatorOnFocus){this._options.preventItemSeparatorOnFocus=false}else{this._addItemSeparatorToEnd()}}if(mode==="editable"&&this.options.dropDownOnFocus){if(this._options.preventDropDownOnFocus){this._options.preventDropDownOnFocus=false}else{this.openDropDown(null,true,event)}}},_inputBlur:function(event){var _options=this._options,$activeEl=$(document.activeElement);if(this.options.disabled){return}if($activeEl.is(_options.$dropDownListCont)||$activeEl.is(_options.$dropDownBtnIcon)||$activeEl.is(_options.$clearIcon)){_options.preventInputBlur=true;this._safeFocusInput(true)}if(!_options.preventInputBlur){if(this.options.mode==="editable"||this.options.mode==="dropdown"){_options.$combo.removeClass(this.css.active)}if(this.options.mode==="editable"){this._removeItemSeparatorFromEnd()}if(this.options.closeDropDownOnBlur){this.closeDropDown(null,event)}if(!_options.dropDownOpened){if(_options.validator){_options.validator._validateInternal(this.element,event,true)}}}else{_options.preventInputBlur=false}},_inputClick:function(event){if(this.options.disabled){return}if(this.options.mode==="dropdown"||this.options.mode==="readonlylist"){this._toggleDropDownState(event)}},_inputKeyDown:function(event){if(this.options.disabled){return}if(this.options.mode==="editable"||this.options.mode==="dropdown"){this._handleKeyNavigation(event);if(this.options.autoComplete){this._options.hadInputSelectionOnKeydown=this._hasInputSelection()}}},_inputPaste:function(event){var self=this;if(this.options.disabled){return}if(this.options.mode==="editable"){setTimeout(function(){self._handleInputChange(!self._options.dropDownOpened,event)},0)}},_handleDropDownModeKeypress:function(event){var curText,curData,value,startValue,startIndex,i,options=this.options,_options=this._options,curChar=String.fromCharCode(event.which),data=options.dataSource.dataView(),len=data.length,textKey=options.textKey;clearTimeout(_options.dropDownModeSearchByResetTimeout);if(_options.dropDownModeSearchBy!==curChar){_options.dropDownModeSearchBy+=curChar}if(options.multiSelection.enabled){startValue=_options.keyNavItemData}else{startValue=_options.selectedData[_options.selectedData.length-1][options.valueKey]}startIndex=this._dataIndexByValue(startValue,true);if(_options.dropDownModeSearchBy.length===1){startIndex+=1}for(i=0;i<len;i++){curData=this._unwrapData(data[(i+startIndex)%len]);curText=this._unwrapData(curData[textKey]);if(!options.caseSensitive){curText=curText.toLowerCase();_options.dropDownModeSearchBy=_options.dropDownModeSearchBy.toLowerCase()}if(curText.startsWith(_options.dropDownModeSearchBy)){if(options.multiSelection.enabled){this._setKeyNavigationItem({data:curData,addStyles:true,clearPrevItem:true})}else{this._selectData(curData,{},event)}break}}if(value!==undefined){if(options.multiSelection.enabled){this._scrollToItem(_options.keyNavItemData)}else{this._scrollToLastSelItem()}}_options.dropDownModeSearchByResetTimeout=setTimeout(function(){_options.dropDownModeSearchBy=""},_options.dropDownModeSearchByResetDelay)},_inputKeyPress:function(event){if(this.options.disabled){return}if(this.options.mode==="dropdown"){this._handleDropDownModeKeypress(event)}},_inputKeyUp:function(event){var self=this;if(this.options.disabled){return}if(this.options.mode==="editable"){clearTimeout(this._options.keyUpTimeout);this._options.autoCompleteItemData=null;this._options.keyUpTimeout=setTimeout(function(){self._handleInputChange(!self._options.dropDownOpened,event)},this.options.delayInputChangeProcessing)}if(this.options.mode==="editable"||this.options.mode==="dropdown"){if(event.keyCode===this._options.shiftKeyCode&&this.options.multiSelection.enabled){this._handleShiftUp(event)}}},_inputMouseDown:function(event){if(this.options.disabled){return}if(!this._options.$input.is(":focus")){this._options.$input.focus();this._moveCaretToInputEnd(true);event.preventDefault()}},_attachEvents:function(){var self=this,css=this.css,options=this.options,_options=this._options,_handlers=this._handlers;_options.$window.on({resize:_handlers.windowResize});$(document).on({mouseup:_handlers.documentMouseUp});_options.$combo.on({mouseenter:function(){if(options.disabled){return}if(options.mode!=="readonly"){_options.$combo.addClass(css.hover)}},mouseleave:function(){if(options.disabled){return}_options.$combo.removeClass(css.hover);if(!((options.mode==="editable"||options.mode==="dropdown")&&_options.$input.is(":focus"))){_options.$combo.removeClass(css.active)}},mousedown:function(){if(options.disabled){return}if(options.mode!=="readonly"){_options.$combo.addClass(css.active)}},mouseup:function(){if(options.disabled){return}if(options.mode==="readonlylist"){_options.$combo.removeClass(css.active)}}});_options.$dropDownBtnCont.on({mouseenter:function(){if(options.disabled){return}if(options.mode!=="readonly"){_options.$dropDownBtnCont.addClass(css.hover)}},mouseleave:function(){if(options.disabled){return}if(options.mode!=="readonly"){_options.$dropDownBtnCont.removeClass(css.hover)}},mousedown:function(event){if(options.disabled){return}event.preventDefault()},click:function(event){if(options.disabled||!(self._$items().length>0||_options.$dropDownListCont.find("."+css.noMatchFound).length>0)){return}if(options.mode!=="readonly"){if(_options.dropDownOpened){self.closeDropDown(null,event);self._moveCaretToInputEnd(true)}else{self.openDropDown(null,true,event)}}event.stopPropagation()}});_options.$clearCont.on({mouseenter:function(){if(options.disabled){return}if(options.mode!=="readonly"){_options.$clearCont.addClass(css.clearHover)}},mouseleave:function(){if(options.disabled){return}if(options.mode!=="readonly"){_options.$clearCont.removeClass(css.clearHover)}},mousedown:function(event){if(options.disabled){return}event.preventDefault()},click:function(event){if(options.disabled||_options.dataBinding){return}if(options.mode==="editable"||options.mode==="dropdown"){self._hideClearButton();self.clearInput(event);self._moveCaretToInputEnd(true)}}});_options.$input.on({focus:_handlers.inputFocus,blur:_handlers.inputBlur,click:_handlers.inputClick,keydown:_handlers.inputKeyDown,paste:_handlers.inputPaste,keyup:_handlers.inputKeyUp,keypress:_handlers.inputKeyPress,mousedown:_handlers.inputMouseDown});_options.$dropDownListCont.on({mouseenter:function(){var $this,$prevItems;if(options.disabled){return}if(options.mode==="editable"||options.mode==="dropdown"){$this=$(this);if(_options.$itemsToSelectOnShiftClick.length>0){$prevItems=_options.$itemsToSelectOnShiftClick;_options.$itemsToSelectOnShiftClick=self._itemsBetweenTwoItems(self._$keyNavItem(),$this);$prevItems.not(_options.$itemsToSelectOnShiftClick).removeClass(css.itemInFocus);_options.$itemsToSelectOnShiftClick.addClass(css.itemInFocus)}else{$this.addClass(css.hover);if(_options.mouseDownStartedFromListItem){$this.addClass(css.itemInFocus)}}}},mouseleave:function(){var $this;if(options.disabled){return}if(options.mode==="editable"||options.mode==="dropdown"){$this=$(this);$this.removeClass(css.hover);if(!($this.is(self._$keyNavItem())||$this.is(_options.$itemsToSelectOnShiftUpDown))){$this.removeClass(css.itemInFocus)}if(_options.$itemsToSelectOnShiftClick.length>0){_options.$itemsToSelectOnShiftClick.removeClass(css.itemInFocus)}}},mousedown:function(event){var $this,$keyNavItem;if(options.disabled){return}if(options.mode==="editable"||options.mode==="dropdown"){if(event.which===1){$this=$(this);$keyNavItem=self._$keyNavItem();if(event.shiftKey&&options.multiSelection.enabled){if($keyNavItem.length===0){$keyNavItem=self._$items().filter(":visible").eq(0);self._setKeyNavigationItem({data:$keyNavItem,addStyles:true})}_options.$itemsToSelectOnShiftClick=self._itemsBetweenTwoItems($this,$keyNavItem);_options.$itemsToSelectOnShiftClick.addClass(css.itemInFocus)}else{$this.addClass(css.itemInFocus)}_options.mouseDownStartedFromListItem=true}}},mouseup:function(event){var $this,multiSelect,closeDropDown;if(options.disabled){return}if(options.mode==="editable"||options.mode==="dropdown"){if(_options.mouseDownStartedFromListItem&&event.which===1){$this=$(this);if(event.shiftKey&&options.multiSelection.enabled){self._handleShiftClick(event)}else{multiSelect=options.multiSelection.enabled&&(!options.multiSelection.addWithKeyModifier||event.ctrlKey);closeDropDown=multiSelect?false:options.closeDropDownOnSelect;if(multiSelect&&self.isSelected($this)&&!self._$keyNavItem().is(_options.$autoSelectedItem)){self.deselect($this,{focusCombo:true},event)}else{self.select($this,{additive:multiSelect,closeDropDown:closeDropDown,focusCombo:true},event)}}$this.removeClass(css.itemInFocus)}}}},"."+css.listItem.split(" ",1)[0]);_options.$dropDownListCont.on({mousedown:function(event){if(options.disabled){return}event.preventDefault()},scroll:function(){if(options.disabled){return}_options.$loading.css({top:self.listScrollTop()});if(!(_options.dataBinding||_options.disableScroll)){self._callNextChunk(_options.$dropDownListCont,self._itemHeight())}}});_options.$dropDownCont.on({mousedown:function(event){event.preventDefault()}},"."+css.header+", ."+css.footer);if(_options.$dropDownScrollCont){_options.$dropDownScrollCont.on("scroll",function(){if(options.disabled){return}self._scrollVirtualization($(this));if(_options.scrollCallback){_options.scrollCallback();_options.scrollCallback=null}});_options.$dropDownListCont.on("mousewheel DOMMouseScroll",function(event){var currentScrollTop=self.listScrollTop(),itemHeight=self._itemHeight();if(options.disabled){return}if(event.originalEvent.wheelDelta>0||event.originalEvent.detail<0){self.listScrollTop(currentScrollTop-itemHeight)}else{self.listScrollTop(currentScrollTop+itemHeight)}if(options.virtualization){return false}})}},_scrollVirtualization:function($this){var itemHeight,offset,dropDownScrollHeight,options=this.options,self=this,_options=this._options;if(!options.virtualization||_options.dataBinding){return}if(options.filteringType==="local"&&_options.inputVal!==""&&_options.expression!==undefined&&_options.expression!==null){options.dataSource.filter(_options.expression,options.filteringLogic,true)}itemHeight=this._itemHeight();offset=this._offsetItems(options.dataSource.dataView(),itemHeight);this._updateItems(offset);options.dataSource.settings.callback=function(err,success,data){dropDownScrollHeight=data.totalLocalRecordsCount()*itemHeight;_options.$dropDownScroll.height(dropDownScrollHeight);self._updateFooterVariables()};this._callNextChunk($this,itemHeight)},_offsetItems:function(dataView,itemHeight){var offset,containerRatio,itemRatio;containerRatio=this.listScrollTop()/this._options.$dropDownScrollCont.prop("scrollHeight");itemRatio=itemHeight/this._dropDownHeight(itemHeight,dataView.length);offset=parseInt(containerRatio/itemRatio,10);return offset},_callNextChunk:function($element,itemHeight){var delta=this._options.deltaItemsForLoadOnDemand*itemHeight;if(this.listScrollTop()+$element.innerHeight()+delta>=$element.prop("scrollHeight")){this._nextChunk()}},_disableCombo:function(value){this._options.$comboWrapper.toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!value).attr("aria-disabled",value);this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus");if(value){this._options.$input.attr("readonly",true);this._options.$hiddenInput.attr("disabled",true)}else{this._options.$input.removeAttr("readonly");this._options.$hiddenInput.removeAttr("disabled")}},_setOption:function(option,value){var options=this.options,_options=this._options;if(options[option]===value){return}if(option==="dropDownAttachedToBody"||option==="virtualization"||option==="mode"||option==="format"){throw new Error($.ig.Combo.locale.notSuported)}if(option==="multiSelection"){value=$.extend(true,{},options.multiSelection,value)}if(option==="loadOnDemandSettings"){value=$.extend(true,{},options.loadOnDemandSettings,value)}if(option==="disabled"){this._disableCombo(value)}if(option==="grouping"){value=$.extend(true,{},options.grouping,value)}if(option==="enableClearButton"){if(_options.inputVal){if(value===true){this._showClearButton(true)}else{this._hideClearButton()}}}$.Widget.prototype._setOption.apply(this,arguments);this._analyzeOptions();switch(option){case"width":_options.$comboWrapper.outerWidth(value);this.positionDropDown();break;case"height":_options.$comboWrapper.outerHeight(value);this.positionDropDown();break;case"dropDownWidth":this.positionDropDown();break;case"itemTemplate":this._renderItems(null,null,this.options.dataSource);break;case"inputName":_options.$hiddenInput.attr("name",value);break;case"visibleItemsCount":this._setListContMaxHeight();break;case"placeHolder":_options.$input.attr("placeholder",value);break;case"multiSelection":this._selectData(this._options.selectedData[0]);this._renderItems(null,null,this.options.dataSource);this.clearInput();break;case"tabIndex":this._options.$input.attr("tabIndex",value);break;case"validatorOptions":this.validator();break;case"dropDownButtonTitle":_options.$dropDownBtnCont.attr("title",value);break;case"clearButtonTitle":_options.$clearCont.attr("title",value);break;case"dataSource":case"dataSourceType":case"dataSourceUrl":case"responseTotalRecCountKey":case"responseDataKey":case"responseDataType":case"responseContentType":case"requestType":case"filteringType":case"filterExprUrlKey":case"filteringCondition":case"filteringLogic":case"loadOnDemandSettings":case"grouping":this.dataBind();break;case"valueKey":case"textKey":this._updateItems();break}},_initDataSource:function(){var dataSourceOptions,schema,pagingOptions,curData,len,i,self=this,lod=this.options.loadOnDemandSettings,options=this.options,isStringDataSource=$.type(options.dataSource)==="string",url=options.dataSourceUrl;if(!options.dataSource&&this.element.is("select")){options.dataSource=this.element[0];schema=this._initSelectSchema()}else if(!options.dataSource&&url){options.dataSource=url;isStringDataSource=true}if($.type(options.dataSource)==="function"){options.dataSource=options.dataSource()
}if(!(options.dataSource&&this._isInstanceOfDataSource(options.dataSource))){if($.type(options.dataSource)==="array"&&($.type(options.dataSource[0])==="number"||$.type(options.dataSource[0])==="string"||$.type(options.dataSource[0])==="date")){for(i=0,len=options.dataSource.length;i<len;i++){curData=options.dataSource[i];options.dataSource[i]={};options.dataSource[i][options.textKey]=curData;options.dataSource[i][options.valueKey]=curData}}if(!schema&&options.dataSource&&($.isArray(options.dataSource)||$.isFunction(options.dataSource))){schema=this._initSchema(this._unwrapData(options.dataSource)[0])}dataSourceOptions={callback:this._renderItems,callee:this,dataSource:options.dataSource,type:options.dataSourceType||undefined,requestType:options.requestType||"GET",responseContentType:options.responseContentType||null,responseDataType:options.responseDataType||null,responseDataKey:options.responseDataKey||null,responseTotalRecCountKey:options.responseTotalRecCountKey||null,localSchemaTransform:false,schema:schema||null,dataBinding:function(){if(!self._options.dropDownOpened||self._options.dataBinding){return}self._options.dataBinding=true;self._options.$loading.insertBefore(self._options.$dropDownList)},dataBound:function(){self._options.$loading.remove();self._options.dataBinding=false}};if(lod&&lod.enabled&&(url||isStringDataSource)){pagingOptions={enabled:true,appendPage:true,pageSize:lod.pageSize,pageIndex:0,pageSizeUrlKey:lod.pageSizeUrlKey||null,pageIndexUrlKey:lod.pageIndexUrlKey||null};$.extend(dataSourceOptions,{paging:pagingOptions})}if($.type(options.dataSource)==="string"&&!options.dataSourceType&&$.ig.util.isJsonpUrl(options.dataSource)){this._options.strDataSource=options.dataSource;options.dataSource=new $.ig.JSONPDataSource(dataSourceOptions)}else{options.dataSource=new $.ig.DataSource(dataSourceOptions)}if(url){options.dataSource.settings.dataSource=url;options.dataSource.settings.type="remoteUrl";options.dataSource._runtimeType=options.dataSource.analyzeDataSource();options.dataSource.settings.urlParamsEncoded=$.proxy(function(data,params){params=params?params.filteringParams:null;if(params){params.textKey=options.textKey||options.valueKey;params.valueKey=options.valueKey;if(!options.caseSensitive){params.toLower="1"}if(options.compactData){params.compact="1"}}},this)}var _aNull=function(v,nan){return v===null||v===undefined||nan&&typeof v==="number"&&isNaN(v)};options.dataSource._responseData=function(data){var len=data?data.length:0,count=len>0?data[len-1][":totals:"]:null;if(count){data.pop();count=count.split(":");options.dataSource.totalRecordsCount(_aNull(len=parseInt(count[0],10),true)?0:len);len=_aNull(len=parseInt(count[1],10),true)?0:len;if(len){self._options.totalAll=len}}}}},_isInstanceOfDataSource:function(ds){return typeof ds._xmlToArray==="function"&&typeof ds._encodePkParams==="function"},_nextChunk:function(){var lod=this.options.loadOnDemandSettings,ds=this.options.dataSource;if(lod&&ds&&lod.enabled){ds.settings.paging.appendPage=true;if(!this.options.virtualization){this.options.dataSource.settings.callback=this._handleLoadOnDemand}ds.nextPage()}return this},_initSelectSchema:function(){var schema={};schema.fields=[{name:this.options.valueKey,type:"string"},{name:this.options.textKey,type:"string"}];return schema},_initSchema:function(firstDsRow){var field,schema={fields:[]};for(field in firstDsRow){if(firstDsRow.hasOwnProperty(field)){schema.fields.push({name:field,type:$.type(firstDsRow[field])})}}return schema},_filteringCondition:function(){return this.options.autoComplete?"startsWith":this.options.filteringCondition},_generateExpressions:function(texts){var i,expressions=[];if($.type(texts)==="string"){if(texts.length>0||this._options.expression&&this._options.expression.length>0){expressions.push({fieldName:this.options.textKey,expr:texts,cond:this._filteringCondition()})}}else if($.type(texts)==="array"){for(i=0;i<texts.length;i++){if($.type(texts[i])==="string"){expressions.push({fieldName:this.options.textKey,expr:texts[i],cond:this._filteringCondition(),logic:this.options.filteringLogic})}else{throw new Error($.ig.igCombo.locale.errorNoSupportedTextType)}}}else{throw new Error($.ig.igCombo.locale.errorNoSupportedTextsType)}return expressions},_generateRegExpPattern:function(texts){var pattern=null,types={multi:function(texts){return"("+texts.join("|")+")"},startsWith:function(texts){return"^("+texts.join("|")+")"},full:function(texts){return"^"+texts.join("|")+"$"},contains:function(texts){return texts.join("|")}};if($.type(texts)==="string"){texts=[texts]}texts=$.grep(texts,function(text){return text!==""});texts=$.map(texts,function(text){return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")});if(texts.length>0){if($.type(types[this.options.highlightMatchesMode])==="function"){pattern=types[this.options.highlightMatchesMode](texts)}else{throw new Error($.ig.igCombo.locale.errorUnrecognizedHighlightMatchesMode)}}return pattern},_highlight:function(texts){var pattern,regex,$curContents,$matchingTextNodes,filterMatches,highlighMatches,len,i,$items=this._$items(),highlightElement=this._options.highlightElement,highlightCssClass=this.css.listItemHighlighted,regExpFlag=this.options.caseSensitive?"":"i";if(this.options.highlightMatchesMode===null||this.options.itemTemplate){return}if(this.options.highlightMatchesMode!=="contains"){regExpFlag+="g"}pattern=this._generateRegExpPattern(texts);if(pattern){regex=new RegExp(pattern,regExpFlag);filterMatches=function(){return this.nodeType===3&&regex.test(this.nodeValue)};highlighMatches=function(){return(this.nodeValue||"").replace(regex,function(match){return"<"+highlightElement+' class="'+highlightCssClass+'">'+match+"</"+highlightElement+">"})};for(i=0,len=$items.length;i<len;i++){if(this._checkBoxesEnabled()){$curContents=$items.eq(i).children("."+this.css.listItemTextWithCheckbox).contents()}else{$curContents=$items.eq(i).contents()}$matchingTextNodes=$curContents.filter(filterMatches);$matchingTextNodes.replaceWith(highlighMatches)}}},_unhighlight:function(){var $highlightedItems,curItem,curParent,len,i;if(this.options.highlightMatchesMode===null){return this}if(this._checkBoxesEnabled()){$highlightedItems=this._$items().children("."+this.css.listItemTextWithCheckbox).children("."+this.css.listItemHighlighted)}else{$highlightedItems=this._$items().children("."+this.css.listItemHighlighted)}for(i=0,len=$highlightedItems.length;i<len;i++){curItem=$highlightedItems.eq(i)[0];curParent=curItem.parentNode;curParent.replaceChild(curItem.firstChild,curItem);curParent.normalize()}},_updateFiltering:function(event){var val=this._options.inputVal;if(this.options.multiSelection.enabled){if(this._endsPartialyWithItemSep(val)){val=""}else{val=this._lastValAfterItemSep()}}this.filter(val,event)},_updateHighlighting:function(){var val=this._options.inputVal,selItemsLen=this._fullySelectedItemsLen(),skipHighlight=false;if(!this.options.multiSelection.enabled){if(selItemsLen===1){skipHighlight=true}}else{if(this._separatedInputTexts(val).length===selItemsLen){skipHighlight=true}else{val=this._lastValAfterItemSep(val)}}this._unhighlight();if(!skipHighlight){this._highlight(val)}},_updateInputValues:function(keepInputText,selectedItems){var curText,curData,len,i,options=this.options,_options=this._options,inputVal="",hiddenInputVal="",itemSeparator=options.multiSelection.itemSeparator;selectedItems=selectedItems||this.selectedItems();len=selectedItems?selectedItems.length:0;if(options.allowCustomValue&&!len){inputVal=_options.$input.val();hiddenInputVal=inputVal}for(i=0;i<len;i++){curData=this._unwrapData(selectedItems[i].data);curText=this._unwrapData(curData[options.textKey]);if(i!==0){if(!_options.ltr){inputVal=itemSeparator+inputVal;hiddenInputVal=itemSeparator+hiddenInputVal}else{inputVal+=itemSeparator;hiddenInputVal+=itemSeparator}}if(!_options.ltr){if(curText!==""){inputVal=this._formatItem(curText)+inputVal}hiddenInputVal=this._unwrapData(curData[options.valueKey])+hiddenInputVal}else{if(curText!==""){inputVal+=this._formatItem(curText)}hiddenInputVal+=this._unwrapData(curData[options.valueKey])}}if(!keepInputText){if(options.multiSelection.enabled&&len>0&&options.mode==="editable"&&_options.$input.is(":focus")){inputVal+=itemSeparator}_options.$input.val(inputVal);this._setInputVal(inputVal);_options.autoSelectedItemData=null}_options.$hiddenInput.val(hiddenInputVal)},_handleLocalFilteringWithGrouping:function(){var groupsLen,i,$group,visibleItems=[],self=this,$groupHeaders=this._$groupHeaders(),filterVisible=function(index,item){return!$(item).hasClass(self.css.hidden)&&!$(item).hasClass(self.css.noMatchFound)};for(i=0,groupsLen=$groupHeaders.length;i<groupsLen;i++){$group=$($groupHeaders[i]);visibleItems=$group.nextUntil(self._groupHeaderClass()).filter(filterVisible);if(visibleItems.length===0){$group.addClass(this.css.hidden)}else{$group.removeClass(this.css.hidden)}}},_handleLocalFiltering:function(dataSource){var $curItem,curKey,filterItem,dataLen,i,j,unwrappedDataViewItem,unwrappedDataViewValue,_options=this._options,valKey=this.options.valueKey,dataView=dataSource.dataView().slice(),initialDataLen=dataView.length,$items=this._$items(),len=$items.length,$keyNavItem=this._$keyNavItem(),cssHidden=this.css.hidden;for(i=0;i<len;i++){$curItem=$items.eq(i);curKey=$curItem.attr("data-value");filterItem=true;for(j=0,dataLen=dataView.length;j<dataLen&&filterItem;j++){unwrappedDataViewItem=this._unwrapData(dataView[j]);unwrappedDataViewValue=this._unwrapData(unwrappedDataViewItem[valKey]);if(this._areValuesEqual(curKey,unwrappedDataViewValue)){filterItem=false;dataView.splice(j,1)}}if(filterItem){$curItem.addClass(cssHidden)}else{$curItem.removeClass(cssHidden)}}if(this.options.grouping.key){this._handleLocalFilteringWithGrouping()}if($keyNavItem.length>0&&$keyNavItem.hasClass(cssHidden)){this._setKeyNavigationItem({data:$(),clearPrevItem:true})}if(initialDataLen===0){if(!_options.$noMatchFound){_options.$noMatchFound=$("<li>").addClass(this.css.noMatchFound).addClass(this.css.unselectable).attr("unselectable","on").html(this.options.noMatchFoundText)}if(_options.$noMatchFound.parent().length===0){_options.$noMatchFound.appendTo(_options.$dropDownList)}}else if(_options.$noMatchFound&&_options.$noMatchFound.parent().length>0){_options.$noMatchFound.detach()}},_setInputVal:function(val){this._options.inputVal=val},_setListContMaxHeight:function(){this._options.$dropDownListCont.css("maxHeight",this.options.visibleItemsCount*this._itemHeight())},_updateVirtualScrollVisibility:function(){if(this._isPossibleToVirtualize()){this._options.$dropDownScrollCont.removeClass(this.css.hidden)}else if(this._areItemsLowerInVir()){this._options.$dropDownScrollCont.addClass(this.css.hidden)}},_addItemSelectionStyles:function($items){var $curItem,len,i;for(i=0,len=$items.length;i<len;i++){$curItem=$items.eq(i);if(this._isGroupHeader($curItem)){continue}$curItem.addClass(this.css.active);if(this._checkBoxesEnabled()){$curItem.find(".ui-igcombo-checkbox .ui-icon").removeClass(this.css.checkboxOff).addClass(this.css.checkboxOn)}}},_removeItemSelectionStyles:function($items){var $curItem,len,i;for(i=0,len=$items.length;i<len;i++){$curItem=$items.eq(i);$curItem.removeClass(this.css.active);if(this._checkBoxesEnabled()){$curItem.find(".ui-igcombo-checkbox .ui-icon").removeClass(this.css.checkboxOn).addClass(this.css.checkboxOff)}}},_addItemSeparatorToEnd:function(){var newVal,inputVal=this._options.inputVal,itemSep=this.options.multiSelection.itemSeparator,sepTexts=this._separatedInputTexts(inputVal),selItemsLen=this._fullySelectedItemsLen();if(inputVal.length>0&&this.options.multiSelection.enabled&&!inputVal.endsWith(itemSep)&&sepTexts.length===selItemsLen){newVal=inputVal+itemSep;this._options.$input.val(newVal);this._setInputVal(newVal)}},_removeItemSeparatorFromEnd:function(){var newVal,inputVal=this._options.inputVal,itemSep=this.options.multiSelection.itemSeparator;if(this.options.multiSelection.enabled&&inputVal.endsWith(itemSep)){newVal=inputVal.slice(0,inputVal.length-itemSep.length);this._options.$input.val(newVal);this._setInputVal(newVal)}},_callInternalSelChangeSubs:function(event){var curCallback,i,callbacks=this._options.internalSelChangeSubs;if($.type(callbacks)==="array"){for(i=0;i<callbacks.length;i++){curCallback=callbacks[i];if(typeof curCallback==="function"){curCallback()}}}if(this._options.validator){this._options.validator._validateInternal(this.element,event)}},_fullySelectedItemsLen:function(){var autoSelItemLen=this._options.autoSelectedItemData===null?0:1;return this._options.selectedData.length-autoSelItemLen},_unwrapData:function(data){if(typeof data==="function"){data=data()}return data},_dropDownOrientation:function(){var dropDownAndComboHeight,_options=this._options,direction=this.options.dropDownOrientation,$combo=_options.$combo,comboOffset=$combo.offset(),comboTopOffset=comboOffset.top,comboOuterHeight=parseInt($combo.outerHeight(),10),dropDownContainerHeight=this._dropDownContHeight(),windowHeight=_options.$window.height();dropDownAndComboHeight=parseInt(comboTopOffset+comboOuterHeight+dropDownContainerHeight,10);if(direction==="auto"){if(dropDownAndComboHeight<windowHeight+_options.$window.scrollTop()){direction="bottom"}else if(comboTopOffset-dropDownContainerHeight>0){direction="top"}else{direction="bottom"}}if(direction==="top"){if(_options.$dropDownCont.hasClass(this.css.orientationBottom)){_options.$dropDownCont.removeClass(this.css.orientationBottom).addClass(this.css.orientationTop)}}else{if(_options.$dropDownCont.hasClass(this.css.orientationTop)){_options.$dropDownCont.removeClass(this.css.orientationTop).addClass(this.css.orientationBottom)}}return direction},_startRepositionInterval:function(){var self=this;this._options.repositionInterval=setInterval(function(){self.positionDropDown()},200)},_clearRepositionInterval:function(){clearInterval(this._options.repositionInterval)},_areValuesEqual:function(val1,val2){return val1!==null&&val1!==undefined&&val2!==null&&val2!==undefined?$.ig.encode(val1.toString())===$.ig.encode(val2.toString()):false},_isValueInArray:function(val,vals){var i=0,len=vals.length;val=val&&val.toString();for(;i<len;i++){if(this._areValuesEqual(val,vals[i])){return i}}return-1},_triggerItemsRendering:function(){var args={owner:this,dataSource:this.options.dataSource};return this._trigger(this.events.itemsRendering,null,args)},_triggerItemsRendered:function(){var args={owner:this,dataSource:this.options.dataSource};this._trigger(this.events.itemsRendered,null,args)},_triggerRendered:function(){var args={owner:this,element:this._options.$comboWrapper};this._trigger(this.events.rendered,null,args)},_triggerDataBinding:function(){var args={owner:this,dataSource:this.options.dataSource};return this._trigger(this.events.dataBinding,null,args)},_triggerDataBound:function(success,msg){var args={owner:this,success:success,errorMessage:msg,dataSource:this.options.dataSource};this._trigger(this.events.dataBound,null,args)},_triggerFiltering:function(event){var args={owner:this,expression:this._options.expression};return this._trigger(this.events.filtering,event,args)},_triggerFiltered:function(event){var args={owner:this,elements:this._$filteredItems()};this._trigger(this.events.filtered,event,args)},_triggerDropDownOpening:function(event){var args={owner:this,list:this._options.$dropDownCont};return this._trigger(this.events.dropDownOpening,event,args)},_triggerDropDownOpened:function(event){var args={owner:this,list:this._options.$dropDownCont};this._trigger(this.events.dropDownOpened,event,args)},_triggerDropDownClosing:function(event){var args={owner:this,list:this._options.$dropDownCont};return this._trigger(this.events.dropDownClosing,event,args)},_triggerDropDownClosed:function(event){var args={owner:this,list:this._options.$dropDownCont};this._trigger(this.events.dropDownClosed,event,args)},_triggerSelectionChanging:function(newSelItems,currentSelItems,event){var args={owner:this,items:newSelItems,currentItems:currentSelItems};return this._trigger(this.events.selectionChanging,event,args)},_triggerSelectionChanged:function(newSelItems,oldItems,event){var args={owner:this,items:newSelItems,oldItems:oldItems};this._trigger(this.events.selectionChanged,event,args)},dataBind:function(){var noCancel;this._initDataSource();this._options.cachedData=[];noCancel=this._triggerDataBinding();if(noCancel){if(!this._options.initialDataBinding){this.clearInput();this._options.selectedData=[]}this.options.dataSource.dataBind(this._renderItems,this)}return this},refreshValue:function(){this._updateInputValues(true)},dataForValue:function(value){var data,unwrappedDataItem,unwrappedDataValue,len,i,valKey=this.options.valueKey,cachedData=this._options.cachedData,matchFound=false,result=null;if(!this.options.dataSource||value===null||value===undefined){return null}data=this.options.dataSource.data();for(i=0,len=data.length;i<len&&!matchFound;i++){unwrappedDataItem=this._unwrapData(data[i]);unwrappedDataValue=this._unwrapData(unwrappedDataItem[valKey]);if(this._areValuesEqual(unwrappedDataValue,value)){result=data[i];matchFound=true}}if(!matchFound&&this.options.filteringType==="remote"){for(i=0,len=cachedData.length;i<len&&!matchFound;i++){unwrappedDataItem=this._unwrapData(cachedData[i]);unwrappedDataValue=this._unwrapData(unwrappedDataItem[valKey]);if(this._areValuesEqual(unwrappedDataValue,value)){result=cachedData[i];matchFound=true}}}return result},dataForElement:function($element){if(!($element instanceof $&&$element.is(this._$items()))){return null}return this.dataForValue($element.attr("data-value"))},itemsFromElement:function($element){var i,result,$curElement;if(!($element instanceof $&&$element.is(this._$items()))){return null}if($element.length===1){result={element:$element,data:this.dataForElement($element)}}else{result=[];for(i=0;i<$element.length;i++){$curElement=$element.eq(i);result.push({element:$curElement,data:this.dataForElement($curElement)})}}return result},itemsFromValue:function(value){var data,i,len,self=this,$items=this._$items(),result=null;if($.type(value)==="array"){value=$.grep(value,function(val,index){return self._isValueInArray(val,value)===index});for(i=0,len=value.length;i<len;i++){data=this.dataForValue(value[i]);if(data){if(!result){result=[]}result.push({element:this._$elementFromValue(value[i],$items),data:data})}}}else{data=this.dataForValue(value);if(data){result={element:this._$elementFromValue(value,$items),data:data}}}return result},itemsFromIndex:function(index){var value,i,data=this.options.dataSource.data(),dataLen=data.length,valKey=this.options.valueKey;if($.type(index)==="array"){value=[];for(i=0;i<index.length;i++){if(typeof index[i]==="number"&&index[i]>=0&&index[i]<dataLen){value.push(data[index[i]][valKey])}}}else if(typeof index==="number"&&index>=0&&index<dataLen){value=this._unwrapData(this._unwrapData(data[index])[valKey])}return this.itemsFromValue(value)},items:function(){return this._itemsFromData(this.options.dataSource.data())},filteredItems:function(){return this._itemsFromData(this.options.dataSource.dataView())},selectedItems:function(){return this._options.selectedData.length>0?this._itemsFromData(this._options.selectedData):null},filter:function(texts,event){var noCancel,ds=this.options.dataSource,type=this.options.filteringType,logic=this.options.filteringLogic,filterExprUrlKey=this.options.filterExprUrlKey,paging=ds.settings.paging,filtering=ds.settings.filtering,clearFiltering=texts==="";if(!this._isFilteringEnabled()){return this}noCancel=event?this._triggerFiltering(event):true;if(noCancel){filtering.type=type;filtering.expressions=this._options.expression=this._generateExpressions(texts);filtering.caseSensitive=this.options.caseSensitive;if(type==="local"){if(clearFiltering){this._options.expression=null;ds.clearLocalFilter()}else{ds.filter(filtering.expressions,logic,true)}if(this.options.virtualization){this._handleLocalFilteringWithVirt(ds)}else{this._handleLocalFiltering(ds)}}if(type==="remote"){if(paging){paging.pageIndex=0;paging.appendPage=false}if(filterExprUrlKey){filtering.filterExprUrlKey=filterExprUrlKey}this._options.remoteFilteringTriggerEvt=event;ds.dataBind(this._handleRemoteFiltering,this)}if(this._options.dropDownOpened){this.listScrollTop(0)}if(event&&!this._options.remoteFilteringTriggerEvt){this._triggerFiltered(event)}}return this},clearFiltering:function(event){var ds=this.options.dataSource,expression=this._options.expression;if(!ds||!expression||expression.length<=0||expression.length===1&&expression[0].expr===""){if(this._options.updateInputValuesOnRemoteFilter&&this._endsPartialyWithItemSep(this._options.inputVal)){this._updateInputValues();this._hideClearButton()}this._options.updateInputValuesOnRemoteFilter=false;return}this.filter("",event);this.positionDropDown();return this},openDropDown:function(callback,focusCombo,event){var offset,itemHeight,noCancel,newAnimationStyle,_options=this._options,borderWidth=parseInt(_options.$combo.css("borderTopWidth"),10),topPosition=_options.$combo.offset().top-borderWidth,self=this,$ddCont=_options.$dropDownCont,orientation=this._dropDownOrientation(),autoHeight=this._dropDownContHeight();if(focusCombo===undefined){focusCombo=true}if(!_options.dropDownOpened){noCancel=event?this._triggerDropDownOpening(event):true;if(noCancel){_options.dropDownOpened=true;this.positionDropDown();this._scrollToLastSelItem();if(orientation==="top"){$ddCont.addClass(this.css.orientationTop).removeClass(this.css.orientationBottom).css({top:parseInt($ddCont.css("top"),10)-1});if(this.options.dropDownAttachedToBody){newAnimationStyle={height:autoHeight,top:topPosition-autoHeight}}else{newAnimationStyle={height:autoHeight,top:-autoHeight-borderWidth}}}else{$ddCont.addClass(this.css.orientationBottom).removeClass(this.css.orientationTop);newAnimationStyle={height:autoHeight}}this._startRepositionInterval();$ddCont.stop().removeClass(this.css.noBorder).animate(newAnimationStyle,{duration:this.options.animationShowDuration,queue:false,easing:"swing",complete:function(){$ddCont.height("").css("overflow","");if(self.options.virtualization){itemHeight=self._itemHeight();offset=self._offsetItems(self.options.dataSource.dataView(),itemHeight);self._updateItems(offset)}if($.type(callback)==="function"){callback()}if(event){self._triggerDropDownOpened(event)}}});if(focusCombo){this._moveCaretToInputEnd(false)}}}return this},closeDropDown:function(callback,event){var noCancel,newAnimationStyle,_options=this._options,self=this,borderWidth=parseInt(_options.$combo.css("borderTopWidth"),10),orientation=this._dropDownOrientation();if(_options.dropDownOpened&&!_options.dataBinding){noCancel=event?this._triggerDropDownClosing(event):true;if(noCancel){this.positionDropDown();if(orientation==="top"){if(this.options.dropDownAttachedToBody){newAnimationStyle={height:0,top:_options.$combo.offset().top-borderWidth,left:_options.$dropDownCont.offset().left}}else{newAnimationStyle={height:0,top:0}}}else{newAnimationStyle={height:0}}_options.$dropDownCont.stop().css("overflow","hidden").animate(newAnimationStyle,{duration:this.options.animationHideDuration,queue:false,easing:"swing",complete:function(){self._clearRepositionInterval();_options.$dropDownCont.addClass(self.css.noBorder).removeClass(self.css.orientationBottom).removeClass(self.css.orientationTop).css({top:-99999,left:-99999});if(self.options.filteringType!=="remote"){self._updateInputValues();self._unhighlight();self.clearFiltering(event);if(self.options.multiSelection.enabled){self._setKeyNavigationItem({data:$(),clearPrevItem:true})}if(!self.options.allowCustomValue&&_options.selectedData.length===0||self.options.allowCustomValue&&_options.$input.val()===""){self._hideClearButton()}self._removePlaceholderOnEmptyTextVal();if(_options.validator){_options.validator._validateInternal(this.element,event,true)}}else{_options.updateInputValuesOnRemoteFilter=true;self.clearFiltering(event)}if($.type(callback)==="function"){callback()}_options.dropDownOpened=false;if(event){self._triggerDropDownClosed(event)}}})}}return this},clearInput:function(event){this._options.$input.val("");this._options.$hiddenInput.val("");this._setInputVal("");this.deselectAll({focusCombo:true},event);this.clearFiltering(event);this._unhighlight();this._hideClearButton();this._setKeyNavigationItem({data:$(),clearPrevItem:true});return this},_hideClearButton:function(){if(!this.options.enableClearButton){return}this._options.$clearCont.hide()},_showClearButton:function(force){if(!force&&!this.options.enableClearButton){return}this._options.$clearCont.show()},isSelected:function($item){return $item instanceof $?this.isValueSelected($item.attr("data-value")):false},isValueSelected:function(value){return this._isValueInArray(value,this._valuesFromData(this._options.selectedData))!==-1},isIndexSelected:function(index){return this.isValueSelected(this.options.dataSource.data()[index][this.options.valueKey])},_selectData:function(data,options,event){var items,itemsLen,selectedValues,newSelItems,selAutoSelectedItem,selChanged,additive,prevSelValues,newSelData,skipEventTrigger,noCancel,i,comboOptions=this.options,_options=this._options,multiSelEnabled=comboOptions.multiSelection.enabled,prevSelItems=this.selectedItems();data=$.type(data)==="array"&&!multiSelEnabled?data[0]:data;items=this._itemsFromData(data);options=options||{};if(items===null){if(!options.additive){this.deselectAll(options,event)}return this}if($.type(items)!=="array"){items=[items]}additive=options.additive&&multiSelEnabled;itemsLen=items.length;selectedValues=this._valuesFromItems(items);if(additive){for(i=0;i<itemsLen&&!selChanged;i++){if(!this.isValueSelected(items[i].data[comboOptions.valueKey])){selChanged=true}}}else{prevSelValues=this._valuesFromItems(prevSelItems);if(!($(selectedValues).not(prevSelValues).length===0&&$(prevSelValues).not(selectedValues).length===0)){selChanged=true}}if(this._isValueInArray(_options.autoSelectedItemData&&_options.autoSelectedItemData[comboOptions.valueKey],selectedValues)!==-1){selAutoSelectedItem=true;skipEventTrigger=itemsLen===1}if(selChanged||selAutoSelectedItem){if(additive&&prevSelItems){newSelItems=prevSelItems.concat(this._filterItems(items,prevSelItems));newSelData=this._dataFromItems(newSelItems)}else{newSelItems=items;newSelData=this._dataFromItems(newSelItems)}if(event&&!skipEventTrigger){noCancel=this._triggerSelectionChanging(newSelItems,prevSelItems)}else{noCancel=true}if(noCancel){_options.selectedData=newSelData;if(prevSelItems&&prevSelItems.length>0&&!additive){this._removeItemSelectionStyles(this._$elementsFromItems(this._filterItems(prevSelItems,items)))}this._addItemSelectionStyles(this._$elementsFromItems(newSelItems));this._updateInputValues(options.keepInputText,newSelItems);if(!options.keepHighlighting){this._unhighlight()}this._showClearButton();if(options.focusCombo){if(!(options.autoComplete&&this._hasInputSelection())){this._moveCaretToInputEnd(true)}}if(!options.keepNavItem){this._setKeyNavigationItem({data:items[itemsLen-1].data?items[itemsLen-1].data:$(),clearPrevItem:true})}if(comboOptions.filteringType==="remote"){this._options.cachedData=this._dataFromItems(newSelItems)}if(options.closeDropDown){this.closeDropDown(null,event)}if(!options.keepFiltering){this.clearFiltering(event)}this._removePlaceholderOnEmptyTextVal();if(!options.keepScrollPosition){this._scrollToLastSelItem()}this._callInternalSelChangeSubs(event);if(event&&!skipEventTrigger){this._triggerSelectionChanged(newSelItems,prevSelItems,event)}}}else if(options.closeDropDown){noCancel=event?this._triggerDropDownClosing(event):true;if(noCancel){this.closeDropDown(null,event)}}return this},value:function(value,options,event){var selectedValues,selectedItems,i;if(value===undefined){selectedValues=[];selectedItems=this.selectedItems();if(selectedItems){for(i=0;i<selectedItems.length;i++){selectedValues.push(selectedItems[i].data[this.options.valueKey])}}else if(this.options.allowCustomValue&&this._options.$hiddenInput.val()!==""){selectedValues.push(this._options.$hiddenInput.val())}if(!this.options.multiSelection.enabled&&selectedItems){selectedValues=selectedValues.length>0?selectedValues[0]:null}return selectedValues}this._selectData(this._dataForValues(value),options,event);if(this.options.allowCustomValue&&!this.selectedItems()){this._options.$input.val(value);this._updateInputValues();this._showClearButton()}},select:function($items,options,event){if($items instanceof $){this.value(this._valuesFromElements($items),options,event)}return this},index:function(index,options,event){var selectedItems,indexes,unwrappedDataItem,unwrappedDataValue,i,len,dataToSel=[];if(index===undefined){selectedItems=this.selectedItems();if(selectedItems.length===1){unwrappedDataItem=this._unwrapData(selectedItems[0].data);unwrappedDataValue=this._unwrapData(unwrappedDataItem[this.options.valueKey]);indexes=this._dataIndexByValue(unwrappedDataValue)}else{indexes=[];for(i=0;i<selectedItems.length;i++){unwrappedDataItem=this._unwrapData(selectedItems[i].data);unwrappedDataValue=this._unwrapData(unwrappedDataItem[this.options.valueKey]);indexes.push(this._dataIndexByValue(unwrappedDataValue))}}return indexes}if($.type(index)!=="array"){index=[index]}for(i=0,len=index.length;i<len;i++){dataToSel.push(this._dataFromIndex(index[i]))}this._selectData(dataToSel,options,event);return this},selectAll:function(options,event){options=options||{};this._selectData(this.options.dataSource.data(),options,event);return this},_deselectData:function(data,options,event){var newSelItems,selChanged,noCancel,len,i,_options=this._options,items=this._itemsFromData(data),prevSelItems=this.selectedItems();options=options||{};if(items===null){return this}if($.type(items)!=="array"){items=[items]}for(i=0,len=items.length;i<len&&!selChanged;i++){if(this.isValueSelected(items[i].data[this.options.valueKey])){selChanged=true}}if(selChanged){newSelItems=this._filterItems(prevSelItems,items);noCancel=event?this._triggerSelectionChanging(newSelItems,prevSelItems):true;if(noCancel){_options.selectedData=this._dataFromItems(newSelItems);this._removeItemSelectionStyles(this._$elementsFromItems(items));this._updateInputValues(options.keepInputText,newSelItems);this._unhighlight();if(_options.selectedData.length===0){this._setKeyNavigationItem({data:$(),clearPrevItem:true})}if(_options.inputVal===""){this._hideClearButton()}if(options.focusCombo){this._moveCaretToInputEnd(true)}if(this.options.filteringType==="remote"){this._options.cachedData=this._dataFromItems(newSelItems)}this._addPlaceholderWhenEmptyTextVal();this._callInternalSelChangeSubs(event);if(event){this._triggerSelectionChanged(newSelItems,prevSelItems,event)}}}return this},deselectByValue:function(value,options,event){options=options||{};if(value===undefined&&this._options.selectedData.length===1){value=this._options.selectedData[0][this.options.valueKey]}this._deselectData(this._dataForValues(value),options,event)},deselect:function($items,options,event){if($items===undefined){this.deselectByValue()}if($items instanceof $){$items=$items.filter(this._$items());this.deselectByValue(this._valuesFromElements($items),options,event)}return this},deselectByIndex:function(index,options,event){var i,len,dataToDeselect=[];if($.type(index)!=="array"){index=[index]}for(i=0,len=index.length;i<len;i++){dataToDeselect.push(this._dataFromIndex(index[i]))}this._deselectData(dataToDeselect,options,event);return this},deselectAll:function(options,event){this._deselectData(this._options.selectedData,options,event);this._selectFirstItemInNonEditableModes(this.options.mode,[],this.options.dataSource.dataView());return this},activeIndex:function(index){if(index===undefined){return this._$items().index(this._$keyNavItem())}this._setKeyNavigationItem({data:this._dataFromIndex(index),addStyles:true,clearPrevItem:true});return this},text:function(text){if(text===undefined){return this._options.$input.val()
}this._options.$input.val(text);this._handleInputChange(false);return this},listScrollTop:function(value){var $listCont,_options=this._options;if(value!==undefined&&!_options.dropDownOpened){this.openDropDown()}$listCont=_options.$dropDownScrollCont||_options.$dropDownListCont;if(value===undefined){return $listCont?$listCont.prop("scrollTop"):0}if($listCont){$listCont.prop("scrollTop",value||0)}return this},listItems:function(){return this._$items()},comboWrapper:function(){return this._options.$comboWrapper},dropDown:function(){return this._options.$dropDownCont},list:function(){return this._options.$dropDownListCont},textInput:function(){return this._options.$input},valueInput:function(){return this._options.$hiddenInput},validator:function(destroy){var validatorOptions=this.options.validatorOptions,validator=this._options.validator;if(validator&&(destroy||!validatorOptions)&&validator.owner===this){validator.destroy();this._options.validator=validator=null}else if(!validator&&!destroy&&validatorOptions&&this.element.igValidator){this._options.validator=validator=this.element.igValidator(validatorOptions).data("igValidator");this._options.validator.owner=this}else if(validator&&!destroy&&validatorOptions&&this.element.igValidator){this._options.validator=validator=this.element.igValidator(validatorOptions).data("igValidator")}return validator},validate:function(){return this._options.validator?this._options.validator.validate():null},dropDownOpened:function(){return this._options.dropDownOpened},positionDropDown:function(){var comboOffset,width,_options=this._options,$combo=_options.$combo,orientation=this.options.dropDownOrientation;if(orientation==="auto"){orientation=this._dropDownOrientation()}if(this.options.dropDownAttachedToBody){comboOffset=$combo.offset();width=this.options.dropDownWidth||$combo.outerWidth();_options.$dropDownCont.outerWidth(width);if(orientation==="top"){_options.$dropDownCont.css({left:comboOffset.left,top:$combo.offset().top-_options.$dropDownCont.outerHeight()})}else{_options.$dropDownCont.css({left:comboOffset.left,top:comboOffset.top+$combo.outerHeight()})}}else{if(orientation==="top"){_options.$dropDownCont.css({left:"",top:-_options.$dropDownCont.outerHeight()})}else{_options.$dropDownCont.css({left:"",top:""})}}},_unsetupInput:function(){var _handlers=this._handlers;this.element.insertAfter(this._options.$comboWrapper);this._options.$comboWrapper.remove();this.element.removeClass(this.css.field).val("").removeAttr("placeholder").removeAttr("tabIndex").attr("name",this._options.nameAttribute);if(this.options.mode!=="editable"){this.element.removeAttr("readonly").removeAttr("unselectable").removeClass(this.css.unselectable)}this.element.off({focus:_handlers.inputFocus,blur:_handlers.inputBlur,click:_handlers.inputClick,keydown:_handlers.inputKeyDown,paste:_handlers.inputPaste,keyup:_handlers.inputKeyUp,keypress:_handlers.inputKeyPress,mousedown:_handlers.inputMouseDown})},destroy:function(){var _options=this._options,_handlers=this._handlers;this.validator(true);_options.$window.off("resize",_handlers.windowResize);$(document).off("mouseup",_handlers.documentMouseUp);this._clearRepositionInterval();_options.$dropDownCont.remove();if(this.element.is("input")){this._unsetupInput()}else if(this.element.is("select")){_options.$comboWrapper.remove();this.element.show().attr("name",_options.nameAttribute)}else{this.element.empty().removeClass(this.css.comboWrapper)}_options=null;$.Widget.prototype.destroy.apply(this,arguments);return this}});$.extend($.ui.igCombo,{version:"15.2.20152.1027"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Dialog 15.2.20152.1027
*
* Copyright (c) 2011-2015 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
* jquery-1.6.1.js
* jqueryui/1.8.11/jquery-ui.js
* jquery.ui.core.js
* jquery.ui.widget.js
* jquery.ui.mouse.js
* jquery.ui.draggable.js
* jquery.ui.resizable.js
* Example to use:
*	<script type="text/javascript">
*	$(function () {
*		$("#dialog1").igDialog();
*	});
*	</script>
*	<div id="dialog1"></div>
*/
(function($){var _lastTop,_iframe,_visCount=0,_modals=[],_lastZ=0,_maxZ=0,CLOSE=0,OPEN=1,MIN=2,MAX=3,PIN=4,UNPIN=5,RESTORE=6,_pos={my:"center",at:"center",collision:"fit",of:window,using:function(pos){if(pos.top<0){pos.top=0}if(pos.left<0){pos.left=0}var p=$(this).css(pos).offset();if(p.top<0){$(this).css("top",pos.top-p.top)}if(p.left<0){$(this).css("left",pos.left-p.left)}}},_isSrc=function(elem,src){return elem&&src&&(elem.has(src).length>0||elem[0]===src)},_notab=function(elem){return elem.attr("zIndex",-1).css("outline",0).attr("unselectable","on")},_toPx=function(elem,css){var val=elem.css(css);if(!val){return 0}css=parseFloat(val);if(val.indexOf("px")>0){css+=.7}else if(val.indexOf("em")>0){css*=12}else{return 0}return Math.floor(css)},_getPadding=function(elem,vert,margin){return _toPx(elem,(margin||"padding")+(vert?"Top":"Left"))+_toPx(elem,(margin||"padding")+(vert?"Bottom":"Right"))+_toPx(elem,"border"+(vert?"Top":"Left")+"Width")+_toPx(elem,"border"+(vert?"Bottom":"Right")+"Width")},_stopEvt=function(e){try{e.preventDefault();e.stopPropagation()}catch(ex){}};$.widget("ui.igDialog",{options:{mainElement:null,state:"opened",pinned:false,closeOnEscape:true,showCloseButton:true,showMaximizeButton:false,showMinimizeButton:false,showPinButton:false,pinOnMinimized:false,imageClass:null,headerText:null,showHeader:true,showFooter:false,footerText:null,dialogClass:null,container:null,height:null,width:300,minHeight:100,minWidth:150,maxHeight:null,maxWidth:null,draggable:true,position:null,resizable:true,tabIndex:0,openAnimation:null,closeAnimation:null,zIndex:null,modal:false,trackFocus:true,closeButtonTitle:null,minimizeButtonTitle:null,maximizeButtonTitle:null,pinButtonTitle:null,unpinButtonTitle:null,restoreButtonTitle:null,temporaryUrl:null,enableHeaderFocus:true,enableDblclick:"auto"},events:{stateChanging:null,stateChanged:null,animationEnded:null,focus:null,blur:null},css:{dialog:"ui-igdialog ui-dialog ui-widget ui-widget-content ui-corner-all",header:"ui-igdialog-header ui-dialog-titlebar ui-widget-header ui-corner-top ui-helper-clearfix",headerFocus:"ui-igdialog-header-focus ui-state-focus",headerMinimized:"ui-corner-bottom",headerText:"ui-igdialog-headertext ui-dialog-title",headerImage:"ui-igdialog-headerimage",headerTextMinimized:"ui-igdialog-headertext-minimized",headerButton:"ui-igdialog-headerbutton ui-corner-all ui-state-default",headerButtonHover:"ui-igdialog-headerbutton-hover ui-state-hover",close:"ui-igdialog-buttonclose",minimize:"ui-igdialog-buttonminimize",maximize:"ui-igdialog-buttonmaximize",pin:"ui-igdialog-buttonpin",closeIcon:"ui-igdialog-close-icon ui-icon ui-icon-close",minimizeIcon:"ui-igdialog-minimize-icon ui-icon ui-icon-minus",maximizeIcon:"ui-igdialog-maximize-icon ui-icon ui-icon-extlink",restoreIcon:"ui-igdialog-restore-icon ui-icon ui-icon-copy",pinIcon:"ui-igdialog-pin-icon ui-icon ui-icon-pin-s",unpinIcon:"ui-igdialog-unpin-icon ui-icon ui-icon-pin-w",footer:"ui-igdialog-footer ui-widget-header ui-corner-bottom ui-helper-clearfix",resizing:"ui-igdialog-resizing",dragging:"ui-igdialog-dragging",unmovable:"ui-igdialog-unmovable",overlay:"ui-igdialog-overlay ui-widget-overlay",contentIframe:"ui-igdialog-content-iframe",content:"ui-igdialog-content ui-widget-content ui-dialog-content"},_create:function(){var elem,self=this,elem0=self.element,el=elem0[0],url=el&&el.nodeName==="IFRAME"?el.src:null,o=self.options,state=o.state,parent,css=self.css;o.container=o.container||this.element.parent();parent=o.container;self._fixIE(elem0);self._old={position:elem0.css("position"),left:elem0.css("left"),top:elem0.css("top"),display:elem0.css("display"),visibility:elem0.css("visibility"),width:el.style.width,height:el.style.height};if(url){el.src=o.temporaryUrl||""}self._min=state==="minimized"||state===MIN;self._max=state==="maximized"||state===MAX;self._opened=state&&state!=="closed";self._oldDad=el.parentNode;self._next=self._oldDad?el.nextSibling:null;self._dad=parent;elem0=$("<div />");this.element.contents().appendTo(elem0);el=elem=this.element;elem.css({zIndex:o.zIndex||1e3,outline:0}).attr("tabIndex",o.tabIndex).keydown(function(e){if(o.closeOnEscape&&e.keyCode===$.ui.keyCode.ESCAPE){self.close(e);e.preventDefault()}if(e.keyCode!==$.ui.keyCode.TAB){return}self._tabTime=(new Date).getTime();if(!self._modal&&!self._max){return}var min,max,ti,next,iNext=-1,big=999999,iMin=big,iMax=-1,targ=e.target,ti0=self._getTabIndex(targ),shift=e.shiftKey,tabs=$(":tabbable",elem[0]),len=tabs.length,i=len;while(i-->0){ti=self._getTabIndex(el=tabs[i]);if(ti>iMax){iMax=ti;max=el}if(ti<=iMin){iMin=ti;min=el}if(ti===ti0){if(!next){next=el===targ;if(!next){iNext=i}}else if(iNext<0){iNext=i}}}if(iNext<0){i=len}iMin=shift?-1:big;while(i-->0){ti=self._getTabIndex(tabs[i]);if(ti>ti0&&ti<iMin&&!shift||ti<ti0&&ti>iMin&&shift){iMin=ti;iNext=i}}max=max||elem[0];min=min||max;self._nextTabElem=iNext>=0?tabs[iNext]:shift?max:min;if(targ===elem[0]||targ===min&&shift||targ===max&&!shift){_stopEvt(e);el=shift?max:min;try{el.focus()}catch(ex){}}}).mousedown(function(e){self.moveToTop(e)});el.addClass(css.dialog);if(o.dialogClass){el.addClass(o.dialogClass)}elem0.show().addClass(css.content).appendTo(el);if(url!==null){elem0[0].src=url;elem0.addClass(css.contentIframe)}self._modal=self._hasFocus=false;self._lastFoc="blur";self._doHeader();self._doFooter();self._doDraggable();self._doResizable();if(self._min){self._onMin(true,true,true)}if(self._max){o.pinned=false;self._onMax(true,true,true)}if(o.pinned){self._onPin(true,true,true)}if(self._opened){self._open()}else{elem.hide()}self._created=true;self._save()},_fixIE:function(elem){elem=elem.find("*");var n,e,i=elem.length;while(i-->0){e=elem[i];n=e.nodeName;if(n==="/INPUT"||n==="/IMG"){e.parentNode.removeChild(e)}}},destroy:function(){var self=this,elem0=this.element.children(".ui-igdialog-content");this._doClose(null,true);if(self._winResize){$(window).unbind("resize",self._winResize)}this.element.children(".ui-igdialog-header").remove();this.element.children(".ui-igdialog-footer").remove();elem0.contents().unwrap();this.element.removeClass(self.css.dialog).css(self._old);if(this.options.draggable){this.element.draggable("destroy")}if(this.options.resizable){this.element.resizable("destroy")}this.element.unbind();$.Widget.prototype.destroy.apply(this,arguments);return this},state:function(state){if(!arguments.length){return this.options.state}if((state==="minimized"||state===MIN)&&(!this._min||!this._opened)){if(!this._min){this._minimize()}else{this._open(null,1)}}if((state==="maximized"||state===MAX)&&(!this._max||!this._opened)){if(!this._max){this._maximize()}else{this._open(null,1)}}if((state==="opened"||state===OPEN)&&(this._min||this._max||!this._opened)){this._onMin();this._onMax();this._open();this.options.state=state}if((state==="closed"||!state)&&(this._min||this._max||this._opened)){this._onMin();this._onMax();this.close()}return this},mainElement:function(){return this.element},close:function(e){if(this._opened){this._doClose(e)}return this},open:function(){return this._open(null,1)},minimize:function(){if(!this._min){this._minimize()}return this},maximize:function(){if(!this._max){this._maximize()}return this},restore:function(){if(this._max){this._onMax()}if(this._min){this._onMin()}return this},pin:function(){if(!this.options.pinned){this._pin()}return this},unpin:function(){if(this.options.pinned){this._pin()}return this},getTopModal:function(){return _modals[_modals.length-1]},isTopModal:function(){return this.getTopModal()===this},moveToTop:function(e){var src,name,self=this,o=self.options,zi=o.zIndex,elem=self.element,zi0=self._created?null:zi,modal=o.modal,elem0=this.element[0],scrollTop=elem0.scrollTop,scrollLeft=elem0.scrollLeft;if($.ig&&$.ig.util&&$.ig.util.evtButton(e)){return}zi=zi||1e3;src=e?e.target:null;if(_isSrc(self._header,src)||_isSrc(self._footer,src)){name=src.nodeName;if(name!=="INPUT"&&name!=="BUTTON"){_stopEvt(e);self._setFocus()}}else if(e&&!this._hasFocus){self._setFocus()}_maxZ=Math.max(zi0||zi,_maxZ);if(o.pinned){return self}if(modal&&self._lastZ){elem=self._modalDiv;if(elem&&elem[0].offsetWidth<10){self._onResize()}return self}if(_lastTop===self&&(zi0||zi)>=_maxZ){return self}if(_lastTop&&!zi0){_lastTop.element.css("zIndex",_lastTop._lastZ||-1);_lastTop._save()}if(_lastZ>=_maxZ){_maxZ++}if(modal&&!zi0){_maxZ++;_maxZ++}_lastTop=self;self._lastZ=_lastZ=zi0||(modal||_modals.length>0?_maxZ:zi);if(!zi0){elem.css("zIndex",zi0||_maxZ);self._save()}elem0.scrollTop=scrollTop;elem0.scrollLeft=scrollLeft;if(modal){self._doModal(_maxZ)}return self},content:function(newContent){if(arguments.length===0){return this.element.children(".ui-igdialog-content")}this.element.children(".ui-igdialog-content").html(newContent)},_save:function(){var str,input,pos,o=this.options,name=o.inputName;if(!name){return}input=$('input[name="'+name+'"]');if(input.length===0){input=input.parents("form")[0]||document.forms[0];if(!input){return}input=$('<input type="hidden" name="'+name+'" />').appendTo(input)}str="s"+(o.pinned?"1":"")+(this._opened?this._min?2:this._max?3:1:0)+(o.width?":w"+o.width:"")+(o.height?":h"+o.height:"")+(":z"+this.element.css("zIndex")||o.zIndex);pos=o.position;if(pos&&pos.length===2){str+=":p"+pos[0]+","+pos[1]}input.val(str)},_open:function(e,raiseEvt){var self=this,o=self.options,elem=self.element,anim=self._min?null:o.openAnimation,arg={action:"open",owner:this};if(self._opened&&self._vis||raiseEvt&&!self._fireState(e,true,arg)){return self}if(!o.pinned){elem.css("position","absolute")}if(o.width!==null){elem.show()}self._opened=true;self._doSize(1);if(anim){elem.hide().show(anim,function(){self._trigger("animationEnded",e,arg)})}self._vis=true;_visCount++;self._trackFocus(elem);self.moveToTop(true);self._fixState();if(raiseEvt){self._fireState(e,false,arg)}self._save();return self},_initContainer:function(container,change){if(container){if(typeof container==="string"){container=$(container)}if(container&&container[0]){container=container[0]}}if(!container||!container.parentNode){container=this.element.parents("form")[0]||document.body}else if(container.nodeName!=="BODY"){var style=container.style,pos=style?style.position:null;if(style&&(!pos||pos==="static")){style.position="relative"}}if(change){this.element.appendTo(container)}return container},_fixState:function(){this.options.state=this._opened?this._min?"minimized":this._max?"maximized":"opened":"closed"},_minimize:function(e){return this._doState(e,{action:this._min?"restore":"minimize"},e?"minimize":null,"_onMin",true)},_maximize:function(e){return this._doState(e,{action:this._max?"restore":"maximize"},e?"maximize":null,"_onMax",true)},_pin:function(e){return this._doState(e,{action:this.options.pinned?"unpin":"pin"},e?"pin":null,"_onPin")},_close:function(e){return this._opened?this.close(e):this._open(e)},_getTabIndex:function(e){return isNaN(e=parseInt(e.tabIndex,10))||e<1?0:e},_doHeader:function(){var button,id,evts,i=4,self=this,header=self._header,o=self.options,txt=o.headerText,css=self.css;if(header){header.remove()}delete self._minHW;header=self._header=_notab($("<div />").addClass(css.header).css("display","block").prependTo(self.element)).dblclick(function(e){var dbl=o.enableDblclick;if(!dbl){return}if(self._min){self._doState(e,{action:"restore"},null,"_onMin",true)}else if(dbl===true||dbl==="auto"&&o.showMaximizeButton){self._doState(e,{action:self._max?"restore":"maximize"},null,"_onMax",true)}});if(o.imageClass){self._img=$("<span />").addClass(css.headerImage).addClass(o.imageClass).html("&nbsp;").appendTo(header)}self._headerText=$("<span />").addClass(css.headerText).html(txt||"&nbsp;").appendTo(header);evts={mouseover:function(){$(this).addClass(css.headerButtonHover)},mouseleave:function(){$(this).removeClass(css.headerButtonHover)},mousedown:function(e){this._mdb=$.ig&&$.ig.util&&$.ig.util.evtButton(e)},click:function(e){if(!e||this._mdb){return}try{self["_"+$(this).attr("data-id")](e)}catch(ex){}_stopEvt(e)},touchstart:function(e){this._drag=null;_stopEvt(e)},touchmove:function(e){this._drag=1;_stopEvt(e)},touchend:function(){if(!this._drag){$(this).trigger("click")}}};while(i-->=0){if(i===3&&o.showCloseButton){id="close"}else if(i===2&&o.showMaximizeButton){id="maximize"}else if(i===1&&o.showMinimizeButton){id="minimize"}else{id=i===0&&o.showPinButton?"pin":null}if(id){button=$("<a />").addClass(css.headerButton+" "+css[id]).attr("data-id",id).attr("href","#").attr("role","button").bind(evts).appendTo(header);$("<span />").addClass(css[id+"Icon"]).appendTo(button);self._loc(button,i===3?CLOSE:i===2?MAX:i===1?MIN:PIN)}}if(!o.showHeader){header.hide()}},_doFooter:function(){var self=this,o=self.options,txt=o.footerText,css=self.css;if(self._footer){self._footer.remove();delete self._footer}if(o.showFooter){self._footer=_notab($("<div />").addClass(css.footer).css("display","block").html(txt||"&nbsp").appendTo(self.element))}},_onMin:function(e,noSize,noFocus){var but,o=this.options,bar=this._footer,css=this.css,header=this._header,min=e&&e.type?!this._min:!!e;if(min===this._min&&this._created){return}this._min=min;if(min&&o.pinOnMinimized){this._onPin(min,true,true)}but=header.find("."+css.minimize);but.find("*").removeClass(min?css.minimizeIcon:css.restoreIcon).addClass(min?css.restoreIcon:css.minimizeIcon);if(e&&e.type&&min&&this._max){this._onMax(false,true,true)}this._loc(but,min?RESTORE:MIN);if(min){header.addClass(css.headerMinimized);if(bar){bar.hide()}}else{header.removeClass(css.headerMinimized);if(bar){bar.show()}}if(!noSize&&this._vis){this._doSize()}if(!noFocus&&this._vis){this._setFocus()}this._save()},_onMax:function(e,noSize,noFocus){var but,o=this.options,header=this._header,css=this.css,max=e&&e.type?!this._max:!!e;if(max===this._max&&this._created){return}this._max=max;if(!max){this._restoreHtml()}else{this._originalParent=this.element.parent();this.element.appendTo(document.body)}but=header.find("."+css.maximize);but.find("*").removeClass(max?css.maximizeIcon:css.restoreIcon).addClass(max?css.restoreIcon:css.maximizeIcon);this._loc(but,max?RESTORE:MAX);if(max){if(this._min){this._onMin(false,true,true)}if(o.pinned){this._onPin(false,true,true)}}if(max){header.addClass(css.unmovable)}else{header.removeClass(css.unmovable)}if(!noSize&&this._vis){this._doSize()}if(!noFocus&&this._vis){this._setFocus()}this._save()},_onPin:function(e,noSize,noFocus){var but,elem,parent,dad,pos,old=this._old,next=this._next,css=this.css,header=this._header,o=this.options,pin=e&&e.type?!o.pinned:!!e;if(pin===o.pinned&&this._created){return}o.pinned=pin;but=header.find("."+css.pin);but.find("*").removeClass(pin?css.pinIcon:css.unpinIcon).addClass(pin?css.unpinIcon:css.pinIcon);if(this._max&&pin){this._onMax(false,false,true)}this._loc(but,pin?UNPIN:PIN);if(pin){header.addClass(css.unmovable)}else{header.removeClass(css.unmovable)}elem=this.element;if(pin){pos=old.position;if(this._resize&&(pos==="static"||!pos)){pos="relative"}this._pinPos=pos={position:pos,left:old.left,top:old.top}}else{pos={position:"absolute"}}elem.css(pos);parent=elem.parent()[0];dad=pin?this._oldDad:this._dad;if(dad&&dad!==parent){if(pin&&next&&next.parentNode===dad){elem.insertBefore(next)}else{elem.appendTo(dad)}}if(!noFocus&&this._vis){this._setFocus()}if(!noSize&&this._vis){if(!pin){this._doSize(1)}else{this._doModal()}}this._save()},_doClose:function(e,destroy){var i,self=this,elem=self.element,arg={action:"close"},o=self.options,anim=self._min||destroy?null:o.closeAnimation;if(!self._opened||!destroy&&!self._fireState(e,true,arg,e?"close":null)){return}self._trackFocus(elem,1);self._restoreHtml();if(_lastTop===self){_lastTop=null}self._fireFoc(false);self._hasFocus=false;delete self._lastZ;self._vis=self._opened=false;if(destroy){o.modal=false}self._doModal();if(anim){elem.hide(anim,function(){self._trigger("animationEnded",e,arg)})}else if(!destroy){elem.hide()}if(!destroy){self._fixState();self._fireState(e,false,arg)}if(--_visCount<1){_visCount=_lastZ=_maxZ=0}else if(_visCount===(i=_modals.length)){_modals[i-1]._setFocus()}self._save()},_fireState:function(e,before,arg,but){if(before){var o=this.options;arg.oldState=o.state;arg.oldPinned=o.pinned;arg.owner=this;if(but){arg.button=but}}return this._created?this._trigger("stateChang"+(before?"ing":"ed"),e,arg):true},_doState:function(e,arg,but,fnName,show){if(this._fireState(e,true,arg,but)){this[fnName](e||{type:1});if(show&&!this._opened){this._open(null,true)}this._fixState();if(this._created){this._trigger("stateChanged",e,arg)}}return this},_fireFoc:function(foc,e){var name=foc?"focus":"blur";if(name!==this._lastFoc){this._trigger(this._lastFoc=name,e,{owner:this});if(this.options.enableHeaderFocus){name=this.css.headerFocus;if(foc){this._header.addClass(name)}else{this._header.removeClass(name)}}}},_trackFocus:function(elem,remove){var self=this,focusEvt=self._focusEvt,track=self.options.trackFocus;if(!focusEvt&&!track){return}if(remove){if(self._focBind){self._focBind.unbind(focusEvt);delete self._focBind}return}if(!focusEvt){focusEvt=function(e){var elems,old=self._focBind,foc=e.type==="focus";if(self._isDatePickerOpened()){return}if(!foc&&old&&elem){elems=elem.find("*").not(old);if(elems.length){self._focBind=old.add(elems);elems.bind(focusEvt)}}self._hasFocus=foc;setTimeout(function(){var focusTo=self.getTopModal(),elem=self.element;if(elem&&focusTo&&!self._hasFocus&&!foc&&_lastTop===self){if(self._max||focusTo===self){focusTo=self._nextTabElem||elem[0]}else{focusTo=self._tabTime&&(new Date).getTime()-self._tabTime<200?elem[0]:null}if(focusTo){self._setFocus(focusTo)}}self._fireFoc(self._hasFocus,e)},50)};focusEvt=self._focusEvt={focus:focusEvt,blur:focusEvt}}if(track&&elem){self._focBind=elem.find("*").add(elem).bind(focusEvt)}},_isDatePickerOpened:function(){return $("#ui-datepicker-div")[0]&&$("#ui-datepicker-div").css("display")==="block"},_setFocus:function(elem){var self=this;setTimeout(function(){try{if(!self._hasFocus){if(!self.options.trackFocus){self._hasFocus=true}elem=elem||self.element[0];elem.focus()}}catch(ex){}},100)},_restoreHtml:function(){var html,old=this._oldHtml,parent=this._originalParent;if(parent){this.element.appendTo(parent);this._originalParent=null}if(old){html=old.html;if(html.style){html.style.overflow=old.overflow}html.scrollLeft=old.scrollLeft;html.scrollTop=old.scrollTop;delete this._oldHtml}},_touch:function(elem,name){var start,self=this,evt=function(evt,type){var act,e=evt.originalEvent,touches=e?e.touches:null,one=touches&&touches.length===1;if(one&&type){_stopEvt(evt)}one=one&&type==="move";if(start){start=one?start:null;act=one?"Drag":"Stop"}else if(one){start=true;elem.trigger("mouseover");act="Start"}if(act){e=self.element.data(name);act="_mouse"+act;if(e&&e[act]){evt.pageX=one?touches[0].pageX:0;evt.pageY=one?touches[0].pageY:0;e[act](evt)}}};elem.bind({touchstart:function(e){evt(e,"start")},touchmove:function(e){evt(e,"move")},touchend:function(e){evt(e)}})},_doDraggable:function(){var self=this,o=self.options,elem=self.element;if(elem.draggable&&o.draggable){self._touch(self._header,"draggable");elem.draggable({cancel:".ui-igdialog-content, .ui-igdialog-headerbutton",handle:".ui-igdialog-header",containment:"document",start:function(){if(o.pinned||self._max){return false}$(this).addClass(self.css.dragging)},stop:function(e,ui){var doc=$(document);o.position=[ui.position.left-doc.scrollLeft(),ui.position.top-doc.scrollTop()];$(this).removeClass(self.css.dragging);self._save()}})}},_doResizable:function(){var elems,r,i=0,self=this,o=self.options,elem=self.element;if(!elem.resizable){return}self._resize=o.resizable;if(!self._resize){return}elem.css("position",elem.css("position")).resizable({cancel:"."+self.css.content,containment:"document",alsoResize:self.element.children(".ui-igdialog-content"),maxWidth:o.maxWidth,maxHeight:o.maxHeight,minWidth:self._minWidth(),minHeight:o.minHeight,handles:typeof o.resizable==="string"?o.resizable:"n,e,s,w,se,sw,ne,nw",start:function(){$(this).addClass(self.css.resizing);if(o.pinned&&self._pinPos){elem.css(self._pinPos)}},resize:function(){self._fixCaption();if(o.pinned&&self._pinPos){elem.css(self._pinPos)}},stop:function(){$(this).removeClass(self.css.resizing);o.height=$(this).height();o.width=$(this).width();self._save()}}).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se");r=elem.data("resizable")||elem.data("ui-resizable");if(r){if(!r._dragFix){r._dragFix=r._mouseDrag;r._mouseDrag=function(e){var x,y,d=r.parentData;if(d&&e){x=e.pageX;y=e.pageY;if(x<=d.left||y<=d.top||x>=d.left+d.width||y>=d.top+d.height){return false}}return r._dragFix(e)}}elems=r._handles;i=elems.length}while(i-->0){self._touch($(elems[i]),"resizable")}},_toPx:function(val,height){if(typeof val==="number"){return val}if(!val){return height?val:0}val=val.toString();var elem,num=parseInt(val,10);if(isNaN(num)){return 0}if(val.indexOf("m")>0||val.indexOf("e")>0||val.indexOf("i")>0||val.indexOf("t")>0){elem=$("<div />").css({visibility:"hidden",width:val}).appendTo(this._dad);num=elem.width();elem.remove()}else if(val.indexOf("%")>0){val=this._winRect(1);val=height?val.height:val.width;return Math.floor(num*val/100)}return num},_doSize:function(fixPos){var self=this,o=self.options,max=self._max,pos=max?[0,0]:o.position,resize=self._resize?".ui-resizable-handle":null,elem0=self.element.children(".ui-igdialog-content"),elem=self.element;if(resize){if(self._min||max){$(resize,elem).hide()}else{$(resize,elem).show()}}self._headerText.css("width",0);if(self._min){elem0.hide();self._fixCaption(elem)}else if(max){elem0.show().css({width:"auto",height:"auto"});elem.css({width:100,height:50})}else if(o.width!==null){this._doSizePX(elem0,elem,Math.max(self._minWidth(),self._toPx(o.width)),self._toPx(o.height,true),o.minHeight);if(resize){elem.resizable("option","minHeight",o.minHeight)}}if(o.width===null){this._fixCaption(elem);elem.show()}if(!o.pinned&&(fixPos||max||self._oldMax)){self._oldMax=max;if(max){self._onResize()}if(elem.position){if(pos){if(pos.left!==undefined&&pos.top!==undefined){pos=[pos.left,pos.top]}if(pos&&pos.length>1){if(typeof pos[0]!=="number"){pos[0]=parseInt(pos[0])}if(typeof pos[1]!=="number"){pos[1]=parseInt(pos[1])}if(isNaN(pos[0])||isNaN(pos[1])){pos={}}else{if($.ig.util.jQueryUIMainVersion<=1&&$.ig.util.jQueryUISubVersion<9){pos={my:"left top",at:"left top",offset:pos[0]+" "+pos[1]}}else{pos={my:"left+"+pos[0]+" top+"+pos[1],at:"left top"}}}}pos=$.extend({},_pos,pos)}elem.css({top:0,left:0}).position(pos||_pos)}}self._doModal();self._save()},_doSizePX:function(elem0,elem,width,height,minHeight){elem0.show().css({width:"auto",height:0,minHeight:0});var zeroHeight=elem.css({width:width,height:"auto",display:"block"}).height();this._fixCaption(elem);if(typeof height==="string"){if(height.indexOf("px")>0){height=parseInt(height,10)}}if(typeof height!=="number"){height=elem0.css("height","auto").height()+zeroHeight}height=Math.max(minHeight,height);elem0.height(Math.max(height-zeroHeight,0));minHeight=height-elem[0].offsetHeight;if(minHeight>0){elem0.height(Math.max(height-zeroHeight+minHeight,0))}},_onResize:function(){var rect,self=this,div=self.isTopModal()?self._modalDiv:null;if(!self._winResize){$(window).bind("resize",self._winResize=function(){setTimeout(function(){self._onResize()},50)})}if(!self._opened||self.options.pinned){return}if(div){div.hide();self._doIframe(div,1)}if(self._max){self._doMaxSize(self.element)}if(div){rect=self._winRect();div.css({width:rect.maxWidth-1,height:rect.maxHeight-1}).show();self._doIframe(div)}},_minHeaderWidth:function(){var outerWidth,elem,width=this._minHW,elems=this._header.children().not(this._headerText),i=elems.length;if(!width){width=3+_getPadding(this._header);while(--i>=0){elem=elems[i];try{outerWidth=$(elem).outerWidth(true)}catch(ex){}width+=1+(outerWidth&&outerWidth>2&&outerWidth<100?outerWidth:elem.offsetWidth)}this._minHW=width}return width},_minWidth:function(){if(!this._minW){this._minW=this._minHeaderWidth()}return Math.max(this.options.minWidth,this._minW)},_fixCaption:function(elem){var width,widths,top,len,topi,j=0,i=-1,header=this._header,cap=this._headerText,minCss=this.css.headerTextMinimized;if(this._min){cap.css("width","").addClass(minCss);if(!elem){return}elem.css({height:"auto",width:"auto",display:"inline-block"});widths=_getPadding(header)+3;cap=header.children();len=cap.length;while(++i<len){widths+=cap[i].offsetWidth+_toPx($(cap[i]),"marginLeft")+_toPx($(cap[i]),"marginRight")}while(j++<2){elem.css("width",widths);widths+=2;i=len;while(i-->0){topi=cap[i].offsetTop;if(i>0&&i<len-1&&Math.abs(top-topi)>4){break}top=topi}if(i<0){j=4}}return}cap.removeClass(minCss);try{width=header.innerWidth()-3}catch(ex){}if(!width||width>1e3){width=header[0].clientWidth-4}width=Math.max(1,width-this._minHeaderWidth());cap.css("width","auto");if(cap[0].offsetWidth*1.3>width){cap.css("width",width)}},_doMaxSize:function(elem){var html,old=this._oldHtml,elem0=this.element.children(".ui-igdialog-content"),rect=this._winRect(),paddingX=_getPadding(elem),paddingY=_getPadding(elem,1);html=rect.html;if(!old){this._oldHtml=old={html:html,scrollLeft:html.scrollLeft,scrollTop:html.scrollTop};html.scrollLeft=html.scrollTop=0;if(html.style){old.overflow=html.style.overflow;html.style.overflow="hidden";if(rect.maxWidth>rect.width||rect.maxHeight>rect.height){rect=this._winRect(1)}}}this._doSizePX(elem0,elem,rect.width-paddingX-1,rect.height-paddingY-1,0)},_winRect:function(sizeOnly){var size,docElem,width,height,widthOk,heightOk,maxWidth=0,maxHeight=0,big=999999,win=window,doc=win.document,body=doc.body,html=body;while(html&&html.nodeName!=="HTML"){html=html.parentNode}if(!html){html=body}docElem=doc.documentElement||html;size=doc.compatMode!=="CSS1Compat"&&$.ig.util.isIE?body:html;width=size.clientWidth;height=size.clientHeight;if(sizeOnly){return{width:width,height:height}}if(width&&width>50){maxWidth=width;maxHeight=height}else{width=height=big}widthOk=html.scrollWidth;heightOk=html.scrollHeight;if(widthOk&&heightOk){maxWidth=Math.max(maxWidth,widthOk);maxHeight=Math.max(maxHeight,heightOk)}maxWidth=Math.max(maxWidth,body.scrollWidth);maxHeight=Math.max(maxHeight,body.scrollHeight);widthOk=body.offsetWidth;heightOk=body.offsetHeight;maxWidth=Math.max(maxWidth,widthOk);maxHeight=Math.max(maxHeight,heightOk);return{width:width===big?widthOk:width,height:height===big?heightOk:height,maxWidth:maxWidth,maxHeight:maxHeight,html:html}},_doIframe:function(div,hide){var src="javascript";if(!_iframe){_iframe=_notab($("<iframe />").attr("frameBorder",0).attr("scrolling","no").attr("src",src+":''").css({position:"absolute",filter:"alpha(opacity=50)",opacity:0}))}if(_iframe.parent()[0]!==div.parent()[0]){_iframe.css({width:"1px",height:"1px",marginLeft:div.css("marginLeft"),marginTop:div.css("marginTop"),left:div.css("left"),top:div.css("top"),zIndex:div.attr("zIndex")-1}).insertBefore(div)}_iframe.css({width:hide?"1px":div.css("width"),height:hide?"1px":div.css("height")})},_doModal:function(zi){var i,pos,on,obj,len=_modals.length,self=this,o=self.options,elem=self.element,div=self._modalDiv;on=o.modal&&!o.pinned&&!self._min&&self._opened;i=$.inArray(self,_modals);if(self._modal===on){if(zi&&div){div.css("zIndex",zi-1);self._onResize()}if(!on&&!_lastTop&&len>0){_modals[len-1].moveToTop()}return}if(i<0&&on){if(len>0){_modals[len-1]._modalDiv.hide()}_modals.push(self)}if(i>=0&&!on){if(i>0&&i+1===len){obj=_modals[i-1]}_modals.splice(i,1)}self._modal=on;if(on){self._modalDiv=div=_notab($("<div />").css({position:"absolute",left:0,top:0,zIndex:_maxZ-1}).addClass(self.css.overlay).mousedown(function(e){self._setFocus();_stopEvt(e)}).insertBefore(elem));pos=div.offset();div.css({marginLeft:-pos.left+"px",marginTop:-pos.top+"px"});self._onResize()}else{div.remove();_iframe.remove();delete self._modalDiv;if(obj){obj.moveToTop()}}},_loc:function(but,state){state=(state===MIN?"minimize":state===MAX?"maximize":state===RESTORE?"restore":state===CLOSE?"close":state===PIN?"pin":state===UNPIN?"unpin":"open")+"ButtonTitle";var val=this.options[state]||($.ig&&$.ig.Dialog&&$.ig.Dialog.locale?$.ig.Dialog.locale[state]:null)||"";but.attr("title",val).attr("longdesc",val)},_setOption:function(key,val){var pos,size,drag,resize,elem=this.element,o=this.options,container=key==="container";if(!elem||!key||o[key]===val||key==="mainElement"){return this}if(key==="state"){return this.state(val)}if(key==="pinned"){return this._pin()}if(container){if(o.draggable&&elem.draggable){elem.draggable("destroy");drag=true}if(o.resizable&&elem.resizable){elem.resizable("destroy");resize=true}}$.Widget.prototype._setOption.apply(this,arguments);if(typeof val==="function"){return this}if(container){this._initContainer(val,1);if(drag){this._doDraggable()}if(resize){this._doResizable()}}if(key==="draggable"){if(val){this._doDraggable()}else if(elem.draggable){elem.draggable("destroy")}}if(key==="resizable"){if(val){this._doResizable()}else if(this._resize){this._resize=val;elem.resizable("destroy")}}if(key==="modal"){this._doModal()}if(key.indexOf("Button")>0||key==="image"||key==="headerText"||key==="showHeader"){this._doHeader();size=true}if(key.indexOf("ooter")>0){this._doFooter();size=true}if(key==="tabIndex"){elem.attr("tabIndex",val)}if(key==="zIndex"){elem.css("zIndex",val);this._save()}if(this._vis){pos=key==="position";if(container||size||pos||key.indexOf("idth")>0||key.indexOf("eight")>0){this._doSize(pos||container)}}if(key.indexOf("Foc")>0){this._header.removeClass(this.css.headerFocus);if(key==="trackFocus"&&val!==(this._focBind?true:false)){if(this._opened){this._doClose();this._open()}else{this._open();this._doClose()}}}return this}});$.extend($.ui.igDialog,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI jQuery Popover 15.2.20152.1027
 *
 * Copyright (c) 2013-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *  jquery-1.4.2.js
 *  jquery.ui.core.js
 *  jquery.ui.widget.js
 *  infragistics.util.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igPopover",{css:{baseClasses:"ui-widget ui-igpopover",arrowBaseClass:"ui-igpopover-arrow ui-igpopover-arrow-",closeButtonClass:"ui-icon ui-icon-closethick ui-igpopover-close-button",titleClass:"ui-igpopover-title"},options:{closeOnBlur:true,direction:"auto",position:"auto",width:null,height:null,minWidth:60,maxWidth:200,maxHeight:200,animationDuration:150,contentTemplate:null,selectors:null,headerTemplate:{closeButton:false,title:null},showOn:"mouseenter",containment:null,appendTo:"body"},events:{showing:"showing",shown:"shown",hiding:"hiding",hidden:"hidden"},_create:function(){this._target=this.options.selectors===null||this.options.selectors===undefined?this.element:null;this._priorityDir=["bottom","top","right","left"];this._arrowDir=["top","bottom","left","right"];this._positions=["balanced","start","end"];this._directionIndex=-1;this._positionIndex=-1;this._forced=this.options.direction!=="auto"&&this.options.position!=="auto";this._visible=false},_createWidget:function(options,element){$.Widget.prototype._createWidget.apply(this,arguments);this.element=$(element);if(element&&element.nodeType!==undefined){this._renderPopover()}if(this.options.direction!=="auto"||this.options.position!=="auto"){this._getPrioritiesIndex()}},_setOption:function(key,value){switch(key){case"direction":this.options.direction=value;if(this.options.direction!=="auto"){this._getPrioritiesIndex()}this._forced=this.options.direction!=="auto"&&this.options.position!=="auto";break;case"position":this.options.position=value;if(this.options.position!=="auto"){this._getPrioritiesIndex()}this._forced=this.options.direction!=="auto"&&this.options.position!=="auto";break;case"contentTemplate":if(typeof value==="string"){this.options.contentTemplate=value}break;case"animationDuration":if(typeof value==="number"){this.options.animationDuration=value}break;case"containment":if(value instanceof jQuery){this.options.containment=value}break;case"closeOnBlur":this.options.closeOnBlur=value;break;case"headerTemplate":case"selectors":case"width":case"height":case"maxWidth":case"maxHeight":case"minWidth":case"showOn":throw new Error($.ig.Popover.locale.popoverOptionChangeNotSupported+" "+key)}},destroy:function(){this._detachEventsFromTarget();this.popover.remove();$.Widget.prototype.destroy.call(this);return this},id:function(){return this.element[0].id},container:function(){return this.contentInner},show:function(trg,content){var target=trg||this._target;if(content){this._setNewContent(content)}if(target===null){throw new Error($.ig.Popover.locale.popoverShowMethodWithoutTarget)}this._openPopover(target)},hide:function(){this._closePopover()},getContent:function(){return this.contentInner.html()},setContent:function(newCnt){if(typeof newCnt==="string"){this._setNewContent(newCnt)}},target:function(){if(this._currentTarget){return this._currentTarget}return null},getCoordinates:function(){var currPosition={left:0,top:0};currPosition.left=this.popover.css("left");currPosition.top=this.popover.css("top");return currPosition},setCoordinates:function(pos){this.popover.css({top:pos.top,left:pos.left})},_renderPopover:function(){this.popover=$("<div></div>").addClass(this.css.baseClasses);if(this.id()){this.popover.attr("id",this.id()+"_popover")}if(this.options.direction!=="auto"){this._getPrioritiesIndex();this.arrow=$("<div></div>").addClass(this.css.arrowBaseClass+this._arrowDir[this._directionIndex]).appendTo(this.popover);if(this.id()){this.arrow.attr("id",this.id()+"_popover_arrow")}}this.popover.appendTo(this.options.appendTo);this._attachEventsToTarget();this._createContentDiv()},_createContentDiv:function(){var cnt,currContent,rightMargin,isTouchDeviceWithIE=this._isTouchDevice()&&$.ig.util.isIE;cnt=$("<div></div>").css("position","relative").css("max-width",this.options.maxWidth).css("max-height",this.options.maxHeight).css("min-width",this.options.minWidth).css("width",isTouchDeviceWithIE?"auto":this.options.width||"auto").css("height",isTouchDeviceWithIE?"auto":this.options.height||"auto").addClass("ui-widget-content ui-corner-all").appendTo(this.popover);if(this.id()){cnt.attr("id",this.id()+"_popover_contentFrame")}if(this.options.headerTemplate!==null){if(this.options.headerTemplate.closeButton){var closeBtn=$("<div></div>").addClass(this.css.closeButtonClass).bind("click.popover",$.proxy(this._closeBtnClick,this)).appendTo(cnt);if(this.id()){closeBtn.attr("id",this.id()+"_popover_closeBtn")}}if(this.options.headerTemplate.title!==null){var title=$("<div></div>").addClass(this.css.titleClass).html(this.options.headerTemplate.title).appendTo(cnt);if(this.id()){title.attr("id",this.id()+"_popover_title")}}}currContent=this.options.contentTemplate;if((typeof currContent==="string"||!currContent)&&this._target){currContent=this.options.contentTemplate||this._target[0].title||""}else if(this.options.selectors!==null&&!this._target&&!currContent){this.options.contentTemplate=function(){return $(this).attr("title")}}else if(typeof currContent==="function"&&this._target){currContent=this.options.contentTemplate.call(this._target[0],function(){return})}rightMargin=this.options.headerTemplate.closeButton&&(this.options.headerTemplate.title===null||this.options.headerTemplate.title==="")?$(".ui-icon").width():null;this.contentInner=$("<div></div>").css("position","relative").css("margin-right",rightMargin).html(currContent).appendTo(cnt);if(this.id()){this.contentInner.attr("id",this.id()+"_popover_contentInner")}$("<div></div>").css("clear","both").appendTo(cnt)},_updateArrowDiv:function(nDir,idx,trg){var conDiv=this.contentInner.parent(),dims;if(!this.arrow){this.arrow=$("<div></div>").addClass(this.css.arrowBaseClass+this._arrowDir[idx]).appendTo(this.popover);if(this.id()){this.arrow.attr("id",this.id()+"_popover_arrow")}}else{this.arrow.removeClass("ui-igpopover-arrow-left ui-igpopover-arrow-right ui-igpopover-arrow-bottom ui-igpopover-arrow-top").addClass(this.css.arrowBaseClass+this._arrowDir[idx])}dims=this._getHiddenElementsDimensions([this.arrow,conDiv],trg);switch(nDir){case"top":conDiv.css({left:"",top:dims[0].height*-1,"float":""});this.arrow.css({left:"",top:"","float":""});break;case"bottom":conDiv.css({left:"",top:dims[0].height,"float":""});this.arrow.css({left:"",top:"","float":""});break;case"left":conDiv.css({left:dims[0].width*-1,top:"","float":"left"});this.arrow.css({left:"",top:"","float":"left"});break;case"right":conDiv.css({left:dims[0].width,top:"","float":"left"});this.arrow.css({left:"",top:"","float":"left"});break}this.oDir=nDir},_targetMouseLeave:function(){this._hoveredTarget=null;if(this.options.closeOnBlur===true){this._closePopover()}},_targetMouseMove:function(trg){var self=this;if(this._target){this._openPopover($(this._target))}else{$(trg.currentTarget).addClass("is-hover");setTimeout(function(){if(self._hoveredTarget===trg.currentTarget){self._openPopover($(trg.currentTarget));$(trg.currentTarget).removeClass("is-hover")}},self.options.animationDuration);this._hoveredTarget=trg.currentTarget}},_targetClick:function(trg){var t=this._target||trg.currentTarget;if($(t).data("onFocus")&&this.container().is(":visible")){this._closePopover();$(t).data("onFocus",false)}else{this._openPopover($(t));$(t).focus();$(t).data("onFocus",true)}},_targetBlur:function(trg){var t=this._target||trg.currentTarget,self=this;setTimeout(function(){if($(t).data("onFocus")){if(self.options.closeOnBlur===true){self._closePopover();$(t).data("onFocus",false)}}else{$(t).focus()}},10)},_focusin:function(trg){var t=this._target||trg.currentTarget;this._openPopover($(t))},_focusout:function(){if(this.options.closeOnBlur===true){this._closePopover()}},_closeBtnClick:function(event){this._closePopover();event.stopPropagation()},_attachEventsToTarget:function(){var self=this,t=this._target,showEvt,hideEvt,targetShowEvt,targetHideEvt;if(this.options.showOn&&this.options.showOn.match(/click|focus|mouseenter/)){switch(this.options.showOn){case"click":showEvt="click.popover";hideEvt="blur.popover";targetShowEvt=self._targetClick;targetHideEvt=self._targetBlur;break;case"focus":showEvt="focusin.popover";hideEvt="focusout.popover";targetShowEvt=self._focusin;targetHideEvt=self._focusout;break;case"mouseenter":showEvt="mouseenter.popover";hideEvt="mouseleave.popover";targetShowEvt=self._targetMouseMove;targetHideEvt=self._targetMouseLeave;break}}if(t&&(window.HTMLElement!==undefined&&(t instanceof HTMLElement||t instanceof jQuery)&&showEvt||typeof t[0]==="object"&&t[0].nodeType===1&&typeof t[0].style==="object"&&typeof t[0].ownerDocument==="object")){$(t).unbind(showEvt).bind(showEvt,$.proxy(targetShowEvt,this));$(t).unbind(hideEvt).bind(hideEvt,$.proxy(targetHideEvt,this))}else if(this.options.selectors&&showEvt){this.element.find(self.options.selectors).addBack().each(function(){var target=$(this)[0];if(target===self.element[0]){return}$(target).unbind(showEvt).bind(showEvt,$.proxy(targetShowEvt,self));$(target).unbind(hideEvt).bind(hideEvt,$.proxy(targetHideEvt,self))})}},_detachEventsFromTarget:function(){var t=this._target,self=this;if(t&&(window.HTMLElement!==undefined&&(t instanceof HTMLElement||t instanceof jQuery)||typeof t[0]==="object"&&t[0].nodeType===1&&typeof t[0].style==="object"&&typeof t[0].ownerDocument==="object")){$(t).unbind(".popover")}else if(this.options.selectors){this.element.find(self.options.selectors).addBack().each(function(){var target=$(this);$(target).unbind(".popover")})}},_positionPopover:function(trg){var i=0,fn,fnRes;if(this.options.direction==="auto"){do{this._updateArrowDiv(this._priorityDir[i],i,trg);fn="_"+this._priorityDir[i]+"Position";fnRes=this[fn](trg);i++}while(fnRes===false&&i<this._priorityDir.length);if(fnRes===false){return}}else{this._updateArrowDiv(this.options.direction,this._directionIndex,trg);fn="_"+this.options.direction+"Position";if(!this[fn](trg)){this._forced=true;do{this._updateArrowDiv(this._priorityDir[i],i,trg);fn="_"+this._priorityDir[i]+"Position";fnRes=this[fn](trg);i++}while(fnRes===false&&i<this._priorityDir.length);return}}},_findProperPosition:function(dir,x,trg){var fnRes,y,cDim,cPos,win=$(window),trgFDim,wScroll,boundary,countainmentBoundary,leftOffset,$containment,oParent=trg.offsetParent(),useParentOffset=false,rightOffset=trg.offset().left+trg.outerWidth(),parentRightOffset=oParent.offset().left+oParent.outerWidth();if(dir==="left"){cPos="left";cDim="outerWidth";wScroll=win.scrollLeft()}else{cPos="top";cDim="outerHeight";wScroll=win.scrollTop()}boundary=wScroll+(cDim==="outerWidth"?win.width():win.height());$containment=this.options.containment;if(this.options.containment){countainmentBoundary=$containment.offset()[cPos];if(cDim==="outerWidth"){countainmentBoundary=countainmentBoundary+$containment.outerWidth()}else{countainmentBoundary=countainmentBoundary+$containment.outerHeight()}if(boundary>countainmentBoundary){boundary=countainmentBoundary}}if(trg.offset()[cPos]+trg[cDim]()>boundary){trgFDim=boundary-trg.offset()[cPos]}else if(cPos==="left"&&trg.offset()[cPos]<oParent.offset()[cPos]&&rightOffset>parentRightOffset){trgFDim=oParent[cDim]();useParentOffset=true}else if(cPos==="left"&&trg.offset()[cPos]<parentRightOffset&&rightOffset>parentRightOffset){trgFDim=parentRightOffset-trg.offset()[cPos]}else if(cPos==="left"&&trg.offset()[cPos]<oParent.offset()[cPos]&&oParent.offset()[cPos]<rightOffset){trgFDim=rightOffset-oParent.offset()[cPos];useParentOffset=true}else{trgFDim=trg[cDim]()}if(trgFDim>this.popover[cDim]()){leftOffset=useParentOffset?oParent.offset()[cPos]:trg.offset()[cPos];y=leftOffset+trgFDim/2-this.popover[cDim]()/2;fnRes=dir==="left"?this._checkCollision(x,y,trg):this._checkCollision(y,x,trg)}else{fnRes=this._cyclePossiblePositions(trg,dir,cPos,cDim,trgFDim,useParentOffset,x)}if(fnRes===false&&!this.options.containment){fnRes=this._cyclePossiblePositions(trg,dir,cPos,cDim,trgFDim,useParentOffset,x,true)}if(fnRes===true){this._adjustArrowPosition(trg,dir,cPos,cDim,trgFDim,useParentOffset)}return fnRes},_cyclePossiblePositions:function(trg,dir,cPos,cDim,trgFDim,useParentOffset,x,useDocument){var i=0,y,tPos,fnRes;if(this.options.position==="auto"){do{tPos=this._positions[i];y=this._getCounterPosition(trg,trgFDim,tPos,cPos,cDim,useParentOffset);fnRes=dir==="left"?this._checkCollision(x,y,trg,useDocument):this._checkCollision(y,x,trg,useDocument)}while(fnRes===false&&++i<this._positions.length)}else{y=this._getCounterPosition(trg,trgFDim,this.options.position,cPos,cDim,useParentOffset);fnRes=dir==="left"?this._checkCollision(x,y,trg,useDocument):this._checkCollision(y,x,trg,useDocument)}return fnRes},_getCounterPosition:function(trg,trgFDim,tPos,cPos,cDim,useParentOffset){var y,offset=useParentOffset?trg.offsetParent().offset()[cPos]:trg.offset()[cPos];switch(tPos){case"balanced":y=offset+trgFDim/2-this.popover[cDim]()/2;break;case"start":y=offset;break;case"end":y=offset-this.popover[cDim]()+trgFDim;break}return y},_topPosition:function(trg){var top=trg.offset().top-this.popover.outerHeight(),parentTop=trg.offsetParent().offset().top-this.popover.outerHeight();if(top<parentTop){top=parentTop}return this._findProperPosition("left",top,trg)},_bottomPosition:function(trg){var bottom=trg.offset().top+trg.outerHeight(),parentBottom=trg.offsetParent().offset().top+trg.offsetParent().outerHeight();if(bottom>parentBottom){bottom=parentBottom}return this._findProperPosition("left",bottom,trg)},_leftPosition:function(trg){var left=trg.offset().left-this.popover.outerWidth(),parentLeft=trg.offsetParent().offset().left-this.popover.outerWidth();if(left<parentLeft){left=parentLeft}return this._findProperPosition("top",left,trg)},_rightPosition:function(trg){var right=trg.offset().left+trg.outerWidth(),parentRight=trg.offsetParent().offset().right+trg.outerWidth();if(right>parentRight){right=parentRight}return this._findProperPosition("top",right,trg)},_checkCollision:function(top,left,trg,useDocument){var tfullw=this.popover.outerWidth(),tfullh=this.popover.outerHeight(),win=$(window),wh,ww,os,$containment,rightBoundary,bottomBoundary,leftBoundary,topBoundary;ww=win.width()+win.scrollLeft();wh=win.height()+win.scrollTop();rightBoundary=ww;bottomBoundary=wh;leftBoundary=win.scrollLeft();topBoundary=win.scrollTop();$containment=this.options.containment;if(this.options.containment){if(leftBoundary<$containment.offset().left){leftBoundary=$containment.offset().left}if($containment.offset().left+$containment.outerWidth()<rightBoundary){rightBoundary=$containment.offset().left+$containment.outerWidth()}if(bottomBoundary>$containment.offset().top+$containment.outerHeight()){bottomBoundary=$containment.offset().top+$containment.outerHeight()}if(topBoundary<$containment.offset().top){topBoundary=$containment.offset().top}}if(useDocument){leftBoundary=0;rightBoundary=$(document).width();bottomBoundary=$(document).height();topBoundary=0}if(left<leftBoundary){if(this.oDir==="left"){return false}left=leftBoundary}if(trg.offset().left+tfullw/2>rightBoundary&&this.options.direction!=="right"){left=rightBoundary-tfullw}if(trg.offset().top+tfullh+this.arrow.height()>bottomBoundary&&this.oDir==="bottom"||trg.offset().top-tfullh-this.arrow.height()<topBoundary&&this.oDir==="top"){if(this.options.selectors){return false}}if(left<leftBoundary||left+tfullw>rightBoundary||top<topBoundary||top+tfullh>bottomBoundary){if(this._forced===false){return false}}if(!$(this.options.appendTo).is("body")&&this._target){os=$.ig.util.getRelativeOffset(this.popover);top=top-os.top;left=left-os.left}this.popover.css({top:top,left:left});return true},_getPrioritiesIndex:function(){var i;if(this.options.direction!=="auto"){for(i=0;i<this._priorityDir.length;i++){if(this.options.direction===this._priorityDir[i]){this._directionIndex=i;break}}}if(this.options.position!=="auto"){for(i=0;i<this._positions.length;i++){if(this.options.position===this._positions[i]){this._positionIndex=i;break}}}},_openPopover:function(trg){var args,noCancel,val=this.getContent(),self=this,contentFunc;args={element:trg,content:val,popover:this.popover,owner:this};$(this.popover).data("isAnimating",true);noCancel=this._trigger(this.events.showing,this,args);if(noCancel===true){self._restoreOriginalTitle(self._currentTarget);if(args.content!==val){this._setNewContent(args.content)}else if(typeof this.options.contentTemplate==="function"){contentFunc=this.options.contentTemplate;args.content=contentFunc.call(trg[0],function(){return});this._setNewContent(args.content||"")}this._positionPopover(trg);this._currentTarget=trg;$(this.popover).data("isAnimating",false);this.popover.stop(true,true).fadeIn(this.options.animationDuration,function(){self._trigger(self.events.shown,self,args)});this._visible=true;this._removeOriginalTitle(trg)}},_closePopover:function(){var args,noCancel,self=this;args={element:this._currentTarget,content:this.getContent(),popover:this.popover,owner:this};$(this.popover).data("isAnimating",true);noCancel=this._trigger(this.events.hiding,this,args);if(noCancel===true){$(this.popover).data("isAnimating",false);this.popover.stop(true,true).fadeOut(this.options.animationDuration,function(){self._trigger(self.events.hidden,self,args)});this._visible=false}},_mouseenter:function(e){this._removeOriginalTitle($(e._currentTarget))},_removeOriginalTitle:function(element){while(element.length&&!element.is("body")){if(element.attr("title")){element.data("popover-title",element.attr("title"));element.attr("title","")}element=element.parent()}},_restoreOriginalTitle:function(element){if(element&&element.data("popover-title")){element.attr("title",element.data("popover-title"));element.removeData("popover-title")}},_adjustArrowPosition:function(trg,dir,cPos,cDim,trgFDim,useParentOffset){var offset={left:0,top:0},left,leftOffset=useParentOffset?trg.offsetParent().offset()[cPos]:trg.offset()[cPos];if(!$(this.options.appendTo).is("body")&&this._target){offset=$.ig.util.getRelativeOffset(this.popover)}if(dir==="top"){this.arrow.css({top:trg.offset()[cPos]-parseInt(this.popover.css(cPos),10)-offset.top+trgFDim/2-this.arrow.height()/2})}else{left=leftOffset-parseInt(this.popover.css(cPos),10)-offset.left+trgFDim/2;left=left<parseInt(this.arrow.css("border-left-width"),10)?parseInt(this.arrow.css("border-left-width"),10):left;this.arrow.css({left:left})}},_getHiddenElementsDimensions:function(elArr,trg){var dim=[],i,elem;if(this.options.containment===null){this.popover.css("left",trg.position().left);this.popover.css("top",trg.position().top)}if(!this._visible){this.popover.show()}for(i=0;i<elArr.length;i++){elem=elArr[i];dim.push({width:elem.outerWidth(),height:elem.outerHeight()})}if(!this._visible){this.popover.hide()}return dim},_setNewContent:function(nc){var newContent=nc;if(nc instanceof jQuery){newContent=nc.html()}else if(typeof nc==="object"){newContent=nc.innerHTML}this.contentInner.html(newContent)},_isTouchDevice:function(){return"ontouchstart"in window||navigator.MaxTouchPoints>0||navigator.msMaxTouchPoints>0}});if(!$.fn.addBack){$.fn.addBack=function(selector){return this.add(selector===null||selector===undefined?this.prevObject:this.prevObject.filter(selector))}}$.extend($.ui.igPopover,{version:"15.2.20152.1027"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI jQuery Notifier 15.2.20152.1027
*
* Copyright (c) 2013-2015 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
*  jquery-1.4.2.js
*  jquery.ui.core.js
*  jquery.ui.widget.js
*  infragistics.util.js
*  infragistics.ui.popover.js
*/
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igNotifier",$.ui.igPopover,{css:{baseClasses:"ui-widget ui-igpopover ui-ignotify",contentInner:"ui-ignotify-content",inline:"ui-ignotify-inline",infoState:"ui-ignotify-info",infoIcon:"ui-icon ui-icon-info",successState:"ui-ignotify-success",successIcon:"ui-icon ui-icon-circle-check",warningState:"ui-ignotify-warn",warningIcon:"ui-icon ui-icon-alert",errorState:"ui-ignotify-error",errorIcon:"ui-icon ui-icon-circle-close"},options:{state:"info",notifyLevel:"success",appendTo:"body",mode:"auto",allowCSSOnTarget:true,messages:{success:"Success",info:"",warning:"Warning",error:"Error"},showIcon:false,contentTemplate:"<span class='ui-ignotify-icon-container'><span class='{0}'></span></span>{1}",headerTemplate:{closeButton:true,title:null},showOn:"manual",animationDuration:250,animationSlideDistance:5},inlineStates:["success","error"],_create:function(){$.ui.igPopover.prototype._create.apply(this,arguments);this._priorityDir=["top","left","right","bottom"];this._arrowDir=["bottom","right","left","top"];this._states=["success","info","warning","error"];this._modes=["auto","popover","inline"];this._currentText=this.options.messages[this.options.state]},_createWidget:function(options){var messageDefaults={success:$.ig.Notifier&&$.ig.Notifier.locale?$.ig.Notifier.locale.successMsg:"Success",info:"",warning:$.ig.Notifier&&$.ig.Notifier.locale?$.ig.Notifier.locale.warningMsg:"Warning",error:$.ig.Notifier&&$.ig.Notifier.locale?$.ig.Notifier.locale.errorMsg:"Error"};this.options.messages=$.extend(messageDefaults,options&&options.messages||{});$.ui.igPopover.prototype._createWidget.apply(this,arguments)},_setState:function(value,message){if($.inArray(value,this._states)===-1){console.log("Supported states: "+this._states.join(", "));return}if(message!==undefined){this._currentText=message}if(this.options.state!==value){this._currentText=message!==undefined?this._currentText:this.options.messages[value];this._previousState=this.options.state;this.options.state=value;if(this._visible){this._setTargetState()}if(this._isInline(value)!==this._isInline(this._previousState)){this._setMode(this.options.mode,true);return}}this.popover.removeClass(this.css[this._previousState+"State"]).addClass(this.css[this.options.state+"State"]);this._setNewContent(this.options.contentTemplate)},_setTargetState:function(clean){this._target.removeClass(this.css[this._previousState+"State"]).removeClass(this.css[this.options.state+"State"]);if(this.options.allowCSSOnTarget&&!clean){this._target.addClass(this.css[this.options.state+"State"])}},_setOption:function(key,value){switch(key){case"state":this._setState(value);if(this._visible&&!this._isInline()){this._positionPopover(this._target);this._slide()}break;case"mode":if(typeof value==="string"){this._setMode(value)}break;case"contentTemplate":if(typeof value==="string"){this.options.contentTemplate=value;this._setNewContent(this.options.contentTemplate)}break;case"messages":if(typeof value==="object"){this.options.messages=$.extend(this.options.messages,value);this._currentText=this.options.messages[this.options.state];this._setNewContent(this.options.contentTemplate);if(this._visible&&!this._isInline()){this._positionPopover(this._target);this._slide()}}break;case"allowCSSOnTarget":this.options.allowCSSOnTarget=typeof value==="boolean"?value:this.options.allowCSSOnTarget;if(this._visible){this._setTargetState(!value)}break;case"showIcon":this.options.showIcon=value;if(this._visible){this._setNewContent(this.options.contentTemplate)}break}$.ui.igPopover.prototype._setOption.apply(this,arguments)},_setMode:function(value,force){if($.inArray(value,this._modes)===-1){console.log("Supported modes: "+this._modes.join(", "));return}if(this.options.mode!==value||force){this.popover.remove();delete this.arrow;this.options.mode=value;this._renderPopover();if(this._visible){if(!this._isInline()){this._positionPopover(this._target)}this.popover.show();this._slide()}}},_isInline:function(state){var target=state||this.options.state;if(this.options.mode==="inline"){return true}else{return this.options.mode==="auto"&&$.inArray(target,this.inlineStates)>-1}},notify:function(state,message){if($.inArray(state,this._states)>=$.inArray(this.options.notifyLevel,this._states)){if(!this._visible||this.options.state!==state||this._currentText!==message){this._setState(state,message);this.show()}}else{this.hide();this._setState(state,message)}},isVisible:function(){return this._visible},_renderPopover:function(){if(this._isInline()){this.popover=$("<div></div>").addClass(this.css.baseClasses).addClass(this.css.inline);this.contentInner=$("<div></div>").appendTo(this.popover);this.popover.insertAfter(this._target);this._attachEventsToTarget()}else{$.ui.igPopover.prototype._renderPopover.apply(this,arguments)}this._setState(this.options.state);this.contentInner.addClass(this.css.contentInner)},_openPopover:function(){var initialState=this._visible;this._visible=false;$.ui.igPopover.prototype._openPopover.apply(this,arguments);if(this._visible){var change=this._visible!==initialState;this._slide(!change);if(change){this._setTargetState()}}else{this._visible=initialState}},_slide:function(quick){if(!this.options.animationSlideDistance||!this.oDir||this._isInline()){return}var slideAnimation;switch(this.oDir){case"top":slideAnimation={top:"-="+this.options.animationSlideDistance+"px"};break;case"bottom":slideAnimation={top:"+="+this.options.animationSlideDistance+"px"};break;case"left":slideAnimation={left:"-="+this.options.animationSlideDistance+"px"};break;case"right":slideAnimation={left:"+="+this.options.animationSlideDistance+"px"};break}this.popover.animate(slideAnimation,{queue:false,duration:quick?0:this.options.animationDuration})},_attachEventsToTarget:function(){if(this.options.showOn!=="manual"){$.ui.igPopover.prototype._attachEventsToTarget.apply(this,arguments)}},_closePopover:function(){var initialState=this._visible;$.ui.igPopover.prototype._closePopover.apply(this,arguments);if(!this._visible&&this._visible!==initialState){this._setTargetState(true)}},_positionPopover:function(){if(!this._isInline()){$.ui.igPopover.prototype._positionPopover.apply(this,arguments)}},_setNewContent:function(nc){var newContent=nc;if(nc instanceof jQuery){newContent=nc.html()}else if(typeof nc==="object"){newContent=nc.innerHTML}newContent=newContent.replace("{0}",this.options.showIcon?this.css[this.options.state+"Icon"]:"").replace("{1}",this._currentText);this.contentInner.html(newContent)},destroy:function(){this._setTargetState(true);$.ui.igPopover.prototype.destroy.apply(this,arguments);return this}});$.extend($.ui.igNotifier,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI CountDown 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *  jquery-1.9.1.js
 *	jquery.ui-1.9.0.js
 *	infragistics.util.js
 *	infragistics.ui.popover.js
 *	infragistics.ui.notifier.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igBaseEditor",{options:{width:null,height:null,value:null,tabIndex:null,allowNullValue:false,nullValue:null,inputName:null,readOnly:false,disabled:false,validatorOptions:null},css:{editor:"ui-igedit-input",container:"ui-igedit ui-igedit-container ui-widget ui-corner-all ui-state-default",hover:"ui-state-hover",active:"ui-state-active",focus:"ui-state-focus",disabled:"ui-state-disabled"},events:{rendering:"rendering",rendered:"rendered",mousedown:"mousedown",mouseup:"mouseup",mousemove:"mousemove",mouseover:"mouseover",mouseout:"mouseout",blur:"blur",focus:"focus",valueChanging:"valueChanging",valueChanged:"valueChanged"},_createWidget:function(options){this._definedOptions=options;$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){this._initialize();this._readAttributes();this._saveDOMConent();this._render()},_initialize:function(){this._timeouts=[]},_readAttributes:function(){this._saveAttributes();this._removeAttributesAndSetThemAsOptions()},_saveAttributes:function(){var i;var element=this.element[0],attr;this._initialAttributes=[];attr=element.attributes;for(i=0;i<attr.length;i++){if(attr[i].name!=="id"){this._initialAttributes.push({name:attr[i].name,attrValue:attr[i].value,propValue:element[attr[i].name]})}}},_removeAttributesAndSetThemAsOptions:function(){var element=this.element,name=element.attr("name"),value=element.attr("value"),disabled=element.attr("disabled"),readOnly=element.attr("readOnly");if(name){element.removeAttr("name");if(this.options.inputName===null){this.options.inputName=name}}if(value){element.removeAttr("value");if(this.options.value===null){this.options.value=value}}if(disabled){element.removeAttr("disabled");if(this._definedOptions===undefined||this._definedOptions.disabled===undefined){this.options.disabled=true}}if(readOnly){element.removeAttr("readonly");if(this._definedOptions===undefined||this._definedOptions.readOnly===undefined){this.options.readOnly=true}}delete this._definedOptions},_saveDOMConent:function(){if(this.element.children().length>0){this._initialDOMContent=this.element.children().clone(true);this.element.empty()}},_render:function(){throw $.ig.Editor.locale.renderErrMsg},_applyOptions:function(){if(this.options.tabIndex!==null){this._setTabIndex(this.options.tabIndex)}if(this.options.readOnly){this._setReadOnly(true)}if(this.options.disabled){this._setDisabled(true)}if(this.options.inputName){this.inputName(this.options.inputName)}if(this.options.validatorOptions){this._setupValidator()}},_attachEvents:function(){var self=this;this._editorContainer.on({"mousedown.editor":function(event){self._triggerMouseDown(event)},"mouseup.editor":function(event){self._triggerMouseUp(event)},"mousemove.editor":function(event){self._triggerMouseMove(event)},"mouseover.editor":function(event){self._triggerMouseOver(event)},"mouseout.editor":function(event){self._triggerMouseOut(event)}})},_setupValidator:function(){if(this.element.igValidator){this._validator=this.element.igValidator(this.options.validatorOptions).data("igValidator");this._validator.owner=this}},_destroyValidator:function(){if(this._validator&&this._validator.owner===this){this._validator.destroy();this._validator=null}},_applyAria:function(){var ariaLabeledBy=this.element.attr("aria-labelledby");if(ariaLabeledBy){this.element.removeAttr("aria-labelledby");this._editorInput.attr("aria-labelledby",ariaLabeledBy)}if(this._dropDownButton){this._editorInput.attr("role","combobox")}else{this._editorInput.attr("role","textbox")}},_triggerRendering:function(){var args={element:this.element,owner:this};return this._trigger(this.events.rendering,null,args)},_triggerRendered:function(){var args={element:this.element,owner:this};this._trigger(this.events.rendered,null,args)},_triggerMouseMove:function(event){var args={owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.mousemove,event,args)},_triggerMouseDown:function(event){this._editorContainer.addClass(this.css.active);var args={owner:this,element:event.target,editorInput:this._editorInput};return this._trigger(this.events.mousedown,event,args)},_triggerMouseUp:function(event){this._editorContainer.removeClass(this.css.active);var args={owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.mouseup,event,args)},_triggerMouseOver:function(event){this._editorContainer.addClass(this.css.hover);var args={originalEvent:event,owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.mouseover,event,args)},_triggerMouseOut:function(event){this._editorContainer.removeClass(this.css.hover);var args={originalEvent:event,owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.mouseout,event,args)},_triggerFocus:function(event){this._editorContainer.addClass(this.css.focus);var args={originalEvent:event,owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.focus,event,args)},_triggerBlur:function(event){this._editorContainer.removeClass(this.css.focus);this._clearEditorNotifier();var args={owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.blur,event,args)},_setOption:function(option,value){var prevValue=this.options[option];if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"readOnly":this._setReadOnly(value);break;case"disabled":this._setDisabled(value);break;case"width":this._setWidth(value);break;case"height":this._setHeight(value);break;case"validatorOptions":this._setupValidator();break;default:break}},_validateValue:function(val){return val?true:false},_updateValue:function(value){if(value===this.options.nullValue&&this.options.nullValue===null){this._editorInput.val("");this._valueInput.val("")}else{this._editorInput.val(value);this._valueInput.val(value)}this.options.value=value},_clearValue:function(){if(this.options.allowNullValue){this._updateValue(this.options.nullValue)}else{this._updateValue("")}},_detachEvents:function(){if(this._detachButtonsEvents){this._detachButtonsEvents()}if(this._detachListEvents){this._detachListEvents()}this._editorContainer.off("mousedown.editor mouseup.editor mouseover.editor mouseout.editor mouseout.editor")},_detachButtonsEvents:function(){if(this._dropDownList){this._detachListEvents()}if(this._dropDownButton){this._detachButtonsEvents(this._dropDownButton)}if(this._clearButton){this._detachButtonsEvents(this._clearButton)}if(this._spinUpButton){this._detachButtonsEvents(this._spinUpButton)}if(this._spinDownButton){this._detachButtonsEvents(this._spinDownButton)}},_restoreDOMStructure:function(){this._removeDOM();this._removeAttributes();this._setPropsDefaults();this._recoverInitialAttributes();this._recoverInitialDOMContent()},_removeDOM:function(){if(this._dropDownList){this._deleteList()}this._valueInput.remove();if(this.element.is("input")){this.element.unwrap().unwrap()}else if(this.element.is("div")){this.element.empty()}else if(this.element.is("span")){this.element.empty();this.element.unwrap().unwrap()}},_removeAttributes:function(){var element=this.element,attr=element[0].attributes,concatenatedAttr="",i;for(i=0;i<attr.length;i++){if(attr[i].name!=="id"){concatenatedAttr+=attr[i].name+" "}}element.removeAttr(concatenatedAttr.trim(" "))},_setPropsDefaults:function(){var element=this.element[0];element.disabled=false;element.readOnly=false;element.checked=false;element.value=null},_recoverInitialAttributes:function(){var i;if(this._initialAttributes){for(i=0;i<this._initialAttributes.length;i++){if(this._initialAttributes[i].name!=="id"){this.element.attr(this._initialAttributes[i].name,this._initialAttributes[i].attrValue);if(this._initialAttributes[i].propValue!==undefined){this.element.prop(this._initialAttributes[i].name,this._initialAttributes[i].propValue)}}}delete this._initialAttributes}},_recoverInitialDOMContent:function(){if(this._initialDOMContent){this._initialDOMContent.appendTo(this.element);delete this._initialDOMContent}},_clearStyling:function(){this._editorContainer.removeClass(this.css.container).removeClass(this.css.hover).removeClass(this.css.active);this._editorInput.removeClass(this.css.editor)},_deleteInternalProperties:function(){delete this._editorInput;delete this._editorContainer;delete this._valueInput;if(this._timeouts){delete this._timeouts}},_clearTimeouts:function(){var i,timeouts=this._timeouts;if(timeouts&&timeouts instanceof Array){for(i=0;i<timeouts.length;i++){clearTimeout(timeouts[i])}this._timeouts=[]}},_disableEditor:function(){this._editorContainer.addClass(this.css.disabled);this._detachEvents()},_setEditableMode:function(){this._editorInput.prop("readonly",false);this._valueInput.prop("readonly",false);this._editorInput.prop("disabled",false);this._valueInput.prop("disabled",false);this._editorContainer.removeClass(this.css.disabled);this._attachEvents()},_setDisabled:function(activate){if(activate){this._editorInput.prop("disabled",true);this._valueInput.prop("disabled",true);this._disableEditor()}else{this._editorInput.prop("disabled",false);this._valueInput.prop("disabled",false);if(!this.options.readOnly){this._setEditableMode()}}},_setReadOnly:function(activate){if(activate){this._editorInput.prop("readonly",true);this._valueInput.prop("readonly",true);this._disableEditor()}else{this._editorInput.prop("readonly",false);this._valueInput.prop("readonly",false);if(!this.options.disabled){this._setEditableMode()}this._editorInput.off(".readonly")}},_setWidth:function(width){if(width){this._editorContainer.css("width",this.options.width)}},_setHeight:function(height){if(height){this._editorContainer.css("height",this.options.height)}},_setTabIndex:function(index){this._editorInput.attr("tabIndex",index)},_setFocusDelay:function(delay){var self=this;if(delay){this._timeouts.push(setTimeout(function(){self._setFocus()},delay))}else{self._setFocus()}},_setFocus:function(event){this._focused=true;this._enterEditMode();if(event){this._triggerFocus(event)}},_setBlur:function(event){var newValue;if(this._cancelBlurOnInput){this._editorInput.focus();delete this._cancelBlurOnInput}else{this._triggerBlur(event);newValue=$(event.target).val();this._currentInputTextValue=this._editorInput.val();this._processValueChanging(newValue);this._processTextChanged();this._exitEditMode();if(this._dropDownList&&this._triggerDropDownClosing()){this._hideDropDownList();this._triggerDropDownClosed()}this._focused=false;this._clearTimeouts();if(this._validator){this._validator._validateInternal(this.element,event,true)}}},inputName:function(newValue){if(newValue){this.options.inputName=newValue;this._valueInput.attr("name",newValue)}else{return this.options.inputName}},value:function(newValue){if(newValue!==undefined){if(this._validateValue(newValue)){this._updateValue(newValue);this._editorInput.val(this._getDisplayValue())}else{this._clearValue()}}else{return this.options.value}},field:function(){return this._editorInput},editorContainer:function(){return this._editorContainer},hasFocus:function(){return this._focused},setFocus:function(delay){this._setFocusDelay(delay)},hide:function(){this._editorContainer.hide()},show:function(){this._editorContainer.show()},validator:function(){return this._validator},isValid:function(){this._skipMessages=true;var valid=this._validateValue(this.value());this._skipMessages=false;return valid},validate:function(){this._validateValue(this.value())},destroy:function(){this._destroyValidator();this._detachEvents();this._clearTimeouts();this._clearStyling();this._restoreDOMStructure();this._deleteInternalProperties();delete this.options;$.Widget.prototype.destroy.apply(this,arguments);return this}});$.extend($.ui.igBaseEditor,{version:"15.2.20152.1027"});$.widget("ui.igTextEditor",$.ui.igBaseEditor,{options:{buttonType:"none",listItems:null,listWidth:0,listItemHoverDuration:0,dropDownAttachedToBody:false,dropDownAnimationDuration:300,visibleItemsCount:5,includeKeys:null,excludeKeys:null,textAlign:"left",placeHolder:null,selectionOnFocus:"selectAll",textMode:"text",spinWrapAround:false,isLimitedToListValues:false,revertIfNotValid:true,preventSubmitOnEnter:false,dropDownOrientation:"auto",maxLength:null,dropDownOnReadOnly:false,toUpper:false,toLower:false,locale:null,suppressNotifications:false},css:{editorInputContainer:"ui-igeditor-input-container ui-corner-all",spinButtonUpImage:"ui-igedit-spinupperimage ui-icon-carat-1-n ui-icon ui-igedit-buttondefault ui-igedit-spinbutton ui-igedit-buttonimage",spinButtonDownImage:"ui-igedit-spinlowerimage ui-icon-carat-1-s ui-icon ui-igedit-buttondefault ui-igedit-spinbutton ui-igedit-buttonimage",dropDownImage:"ui-icon ui-icon-triangle-1-s ui-igedit-buttonimage",dropDownButton:"ui-igedit-dropdown-button ",clearButtonImage:"ui-igedit-buttonimage ui-icon-circle-close ui-icon ui-igedit-buttondefault",clearButton:"ui-igedit-cleararea ui-state-default",buttonCommon:"ui-igedit-button-common ui-unselectable ui-igedit-button-ltr ui-state-default",dropDownList:"ui-igedit-dropdown ui-widget",listItem:"ui-igedit-listitem ui-state-default",listItemHover:"ui-igedit-listitemhover ui-state-hover",listItemActive:"ui-state-active ui-igedit-listitemactive",listItemSelected:"ui-igedit-listitemselected ui-state-highlight",buttonHover:"ui-igedit-buttonhover ui-state-hover",buttonPressed:"ui-igedit-buttonpressed ui-state-highlight",placeHolder:"ui-igedit-placeholder",textArea:"ui-igedit-textarea"},events:{keydown:"keydown",keypress:"keypress",keyup:"keyup",dropDownListOpening:"dropDownListOpening",dropDownListOpened:"dropDownListOpened",dropDownListClosing:"dropDownListClosing",dropDownListClosed:"dropDownListClosed",dropDownItemSelecting:"dropDownItemSelecting",dropDownItemSelected:"dropDownItemSelected",textChanged:"textChanged"},_create:function(){$.ui.igBaseEditor.prototype._create.call(this)},_setOption:function(option,value){var prevValue=this.options[option];if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"value":if(this._validateValue(value)){this._updateValue(value);this._exitEditMode()}else{this._clearValue();this._exitEditMode()}break;case"placeHolder":this._applyPlaceHolder();break;case"suppressNotifications":if(value){this._clearEditorNotifier()}break;case"listItems":this._deleteList();this._createList();break;case"dropDownOnReadOnly":case"visibleItemsCount":case"buttonType":case"dropDownAttachedToBody":throw new Error($.ig.Editor.locale.cannotSetRuntime);default:this.options[option]=prevValue;this._super(option,value);break}},_updateValue:function(value){if(value!==null&&value!==undefined){value=value.toString()}this._super(value)},_applyOptions:function(){var initialValue;this._super();if(this.options.includeKeys){this._includeKeysArray=this.options.includeKeys.toString().split("")}if(this.options.excludeKeys){this._excludeKeysArray=this.options.excludeKeys.toString().split("")}if(this.options.value!==undefined){initialValue=this.options.value;if(this.options.maxLength){if(initialValue&&initialValue.toString().length>=this.options.maxLength){initialValue=initialValue.toString().substring(0,this.options.maxLength);this._sendNotification("warning",$.ig.util.stringFormat($.ig.Editor.locale.maxLengthErrMsg,this.options.maxLength))}}if(this._validateValue(initialValue)){this._setInitialValue(initialValue);this._editorInput.val(this._getDisplayValue())}}else if(this.element.val()&&this._validateValue(this.element.val())){initialValue=this.element.val();if(this.options.maxLength){if(initialValue&&initialValue.toString().length>=this.options.maxLength){initialValue=initialValue.toString().substring(0,this.options.maxLength);this._sendNotification("warning",$.ig.util.stringFormat($.ig.Editor.locale.maxLengthErrMsg,this.options.maxLength))}}if(this._validateValue(initialValue)){this._setInitialValue(initialValue);this._editorInput.val(this._getDisplayValue())}else{this._editorInput.val("")}}this._applyPlaceHolder()},_render:function(){var editorElementWrapper,editorElement;this._triggerRendering();if(this.element.is("div")||this.element.is("span")){if(this.options.textMode==="multiline"){editorElement=$("<textarea rows='4' cols='50'></textarea>");editorElement.addClass(this.css.textArea)}else if(this.options.textMode==="password"){editorElement=$("<input type='password' autocomplete='off'/>")}else{editorElement=$("<input type='text' />")}if(this.element.is("span")){editorElement=this.element.html(editorElement)}editorElementWrapper=editorElement.wrap($("<div></div>")).parent();editorElementWrapper.addClass(this.css.editorInputContainer);this._editorInputWrapper=editorElementWrapper;if(this.element.is("span")){this._editorInput=editorElement.children(0);this._editorContainer=editorElementWrapper.wrap($("<div></div>")).parent()}else{this._editorInput=editorElement;this._editorContainer=this.element}this._editorContainer.prepend(editorElementWrapper)}else if(this.element.is("input")){this._editorContainer=this.element.wrap($("<div></div>")).parent();this._editorInput=this.element;editorElementWrapper=this._editorInput.wrap($("<div></div>")).parent();editorElementWrapper.addClass(this.css.editorInputContainer);this._editorInputWrapper=editorElementWrapper}else if(this.element.is("textarea")){if(this.options.textMode!=="multiline"){throw $.ig.Editor.locale.multilineErrMsg}else{this._editorContainer=this.element.wrap($("<div></div>")).parent();this._editorInput=this.element;this._editorInput.addClass(this.css.textArea);editorElementWrapper=this._editorInput.wrap($("<div></div>")).parent();editorElementWrapper.addClass(this.css.editorInputContainer);this._editorInputWrapper=editorElementWrapper}}else{throw $.ig.Editor.locale.targetNotSupported}this._editorContainer.addClass(this.css.container);this._editorInput.addClass(this.css.editor);this._editorInput.css("height","100%");if(!$.ig.util.isIE8){if(this.options.textMode!=="multiline"){if(this.options.textMode==="password"){this._editorInput.attr("type","password");this._editorInput.attr("autocomplete","off")}else{this._editorInput.attr("type","text")}}}if(this.options.buttonType&&this.options.buttonType!=="none"&&this.options.textMode!=="multiline"&&this.options.textMode!=="password"){this._renderButtons()}if(this.options.width){this._editorContainer.css("width",this.options.width)}if(this.options.height){this._editorContainer.css("height",this.options.height)}if(this.options.textMode==="multiline"){this._valueInput=$("<textarea style='display:none'></textarea>")}else{this._valueInput=$("<input type='hidden'></input>")}this._editorInput.after(this._valueInput);this._editorInput.css("text-align",this.options.textAlign);this._createList();this._attachEvents();this._applyOptions();this._applyAria();this._triggerRendered()},_sendNotification:function(state,message){if(this.options.suppressNotifications||this._skipMessages){this._currentMessage=message;return}if(!this._editorContainer.data("igNotifier")){this._editorContainer.igNotifier()}this._editorContainer.igNotifier("notify",state,message)},_applyPlaceHolder:function(){if(this.options.placeHolder&&this.options.placeHolder!==""){this._editorInput.attr("placeholder",this.options.placeHolder);this._editorInput.addClass(this.css.placeHolder);if(this._placeHolderNotSupported()){console.log($.ig.Editor.locale.placeHolderNotSupported)}}else if(this._editorInput.attr("placeholder")){this._editorInput.removeAttr("placeholder")}},_placeHolderNotSupported:function(){return document.createElement("input").placeholder===undefined},_setInitialValue:function(value){this._updateValue(value)},_disableEditor:function(){if(this.options.dropDownOnReadOnly){this._editorInput.addClass(this.css.disabled)}else{this._editorContainer.addClass(this.css.disabled);this._detachEvents()}if(this._dropDownList&&!this.options.dropDownOnReadOnly){this._dropDownList.addClass(this.css.disabled);this._detachListEvents()}if(this._dropDownButton&&!this.options.dropDownOnReadOnly){this._dropDownButton.addClass(this.css.disabled);this._detachButtonsEvents(this._dropDownButton)}if(this._clearButton){this._clearButton.addClass(this.css.disabled);this._detachButtonsEvents(this._clearButton)}if(this._spinUpButton){this._spinUpButton.addClass(this.css.disabled);this._detachButtonsEvents(this._spinUpButton)}if(this._spinDownButton){this._spinDownButton.addClass(this.css.disabled);this._detachButtonsEvents(this._spinDownButton)}},_validateValue:function(val){var loweredItems,result;if(val===undefined){result=false}else if(val===null){if(this.options.allowNullValue){result=val===this.options.nullValue?true:false}else{result=false}}else if(this.options.isLimitedToListValues&&this._dropDownList){loweredItems=$.map(this.options.listItems,function(item){return item.toString().toLowerCase()});if($.inArray(val.toString().toLowerCase(),loweredItems)!==-1){result=true}else{this._sendNotification("warning",$.ig.Editor.locale.allowedValuesMsg);result=false}}else if(this.options.maxLength){if(val.toString().length<=this.options.maxLength){result=true}else{this._sendNotification("warning",$.ig.util.stringFormat($.ig.Editor.locale.maxLengthErrMsg,this.options.maxLength));result=false}}else{result=true}return result},_setEditableMode:function(){this._super("_setEditableMode");if(this._dropDownList&&!this.options.dropDownOnReadOnly){this._dropDownList.removeClass(this.css.disabled);this._attachListEvents()}if(this._dropDownButton&&!this.options.dropDownOnReadOnly){this._dropDownButton.removeClass(this.css.disabled);this._attachButtonsEvents("dropdown",this._dropDownButton)}if(this._clearButton){this._clearButton.removeClass(this.css.disabled);this._attachButtonsEvents("clear",this._clearButton)}if(this._spinUpButton){this._spinUpButton.removeClass(this.css.disabled);this._attachButtonsEvents("spinUp",this._spinUpButton)}if(this._spinDownButton){this._spinDownButton.removeClass(this.css.disabled);this._attachButtonsEvents("spinDown",this._spinDownButton)}},_calculateDropDownListOrientation:function(){var containerOffset=this._editorContainer.offset(),containerTop=containerOffset.top,containerHeight=parseFloat(this._editorContainer.css("height")),dropDownAndEditorHeight=parseInt(containerTop+containerHeight+this._listInitialHeight),widndowHeight=$(window).height(),orientation;if(this.options.dropDownOrientation==="auto"){if(dropDownAndEditorHeight<widndowHeight+$(window).scrollTop()){orientation="bottom"}else if(containerTop-this._listInitialHeight>0){orientation="top"}else{orientation="bottom"}}else{orientation=this.options.dropDownOrientation}return orientation},_positionDropDownList:function(){var containerOffset=this._editorContainer.offset(),containerTop=containerOffset.top,containerLeft=containerOffset.left,containerHeight=parseFloat(this._editorContainer.css("height")),orientation=this._calculateDropDownListOrientation();if(this.options.dropDownAttachedToBody){this._dropDownList.css("left",containerLeft);if(orientation==="bottom"){this._dropDownList.css("top",containerTop+containerHeight);this._dropDownListOrientation="down";this._dropDownList.removeClass("ui-igedit-dropdown-orientation-top");this._dropDownList.addClass("ui-igedit-dropdown-orientation-bottom")}else{this._dropDownList.css("top",containerTop-this._listInitialHeight);this._dropDownListOrientation="up";this._dropDownList.removeClass("ui-igedit-dropdown-orientation-bottom");this._dropDownList.addClass("ui-igedit-dropdown-orientation-top")}}else{this._dropDownList.css("left","");if(orientation==="bottom"){this._dropDownList.css("top","");this._dropDownListOrientation="down";this._dropDownList.removeClass("ui-igedit-dropdown-orientation-top");this._dropDownList.addClass("ui-igedit-dropdown-orientation-bottom")}else{this._dropDownList.css("top",-this._listInitialHeight);this._dropDownListOrientation="up";this._dropDownList.removeClass("ui-igedit-dropdown-orientation-bottom");this._dropDownList.addClass("ui-igedit-dropdown-orientation-top")}}this._setDropDownListWidth()},_createList:function(){if(this.options.textMode!=="multiline"&&this.options.textMode!=="password"&&this.options.listItems&&this.options.listItems.length>0){if(this.options.buttonType.toString().indexOf("dropdown")===-1){this._renderDropDownButton()}this._renderList();this._positionDropDownList();this._attachListEvents()}},_renderList:function(){var i,list=this.options.listItems,itemValue,currentItem,itemHeight;var dropdown=$("<div></div>)").addClass(this.css.dropDownList);for(i=0;i<list.length;i++){currentItem=$("<span></span>").addClass(this.css.listItem);itemValue=this.options.displayFactor?list[i]*this.options.displayFactor:list[i];currentItem.append(itemValue).appendTo(dropdown)}if(this.options.dropDownAttachedToBody){$(document.body).append(dropdown)}else{this._editorContainer.append(dropdown)}itemHeight=currentItem.css("height");itemHeight=parseFloat(itemHeight);if(itemHeight===0){itemHeight=23}if(list.length<this.options.visibleItemsCount){dropdown.css("height",parseFloat(itemHeight*list.length));this._listInitialHeight=parseFloat(itemHeight*list.length)}else{dropdown.css("height",parseFloat(itemHeight*this.options.visibleItemsCount)+2);this._listInitialHeight=parseFloat(itemHeight*this.options.visibleItemsCount)+2}this._dropDownList=dropdown;this._setDropDownListWidth();dropdown.hide();dropdown.visible=false},_setDropDownListWidth:function(){if(this.options.listWidth&&this.options.listWidth>0){this._dropDownList.css("width",this.options.listWidth)}else{this._dropDownList.css("width",this._editorContainer.css("width"))}},_attachListEvents:function(){var self=this;this._dropDownList.on({"mouseenter.editorList":function(event){var item=event.target;$(item).addClass(self.css.listItemHover,self.options.listItemHoverDuration);$(item).attr("data-hovered",true)},"mouseleave.editorList":function(event){var item=event.target;$(item).removeClass(self.css.listItemHover,self.options.listItemHoverDuration);$(item).removeAttr("data-hovered")},"click.editorList":function(event){self._triggerListItemClick(event.target)},"mousedown.editorList":function(event){event.preventDefault();event.stopPropagation()}},".ui-igedit-listitem");this._dropDownList.on("mousedown.editorList",function(event){if($.ig.util.isIE){self._cancelBlurOnInput=true}else{event.preventDefault();event.stopPropagation()}})},_deleteList:function(){this._detachListEvents();this._detachButtonsEvents();this._dropDownList.remove();this._dropDownButton.remove()},_detachListEvents:function(){if(this._dropDownList){this._dropDownList.off("mouseenter.editorList mouseleave.editorList click.editorList mousedown.editorList")}},_renderDropDownButton:function(){var dropDownButton=$("<div></div>"),dropDownIcon=$("<div></div>");if(this._dropDownButton){return}dropDownButton.addClass(this.css.buttonCommon);dropDownButton.attr("title",this._getLocaleOption("buttonTitle"));this._editorContainer.prepend(dropDownButton.addClass(this.css.dropDownButton).append(dropDownIcon.addClass(this.css.dropDownImage)));this._dropDownButton=dropDownButton;this._attachButtonsEvents("dropdown",dropDownButton)},_renderSpinButtons:function(){var spinButtonUp=$("<div></div>"),spinButtonUpImage=$("<div></div>"),spinButtonDown=$("<div></div>"),spinButtonDownImage=$("<div></div>");if(this._spinUpButton){return}spinButtonUp.addClass(this.css.buttonCommon).append(spinButtonUpImage.addClass(this.css.spinButtonUpImage));spinButtonDown.addClass(this.css.buttonCommon).append(spinButtonDownImage.addClass(this.css.spinButtonDownImage));spinButtonUp.attr("title",this._getLocaleOption("spinUpperTitle"));spinButtonDown.attr("title",this._getLocaleOption("spinLowerTitle"));this._editorContainer.prepend(spinButtonDown).prepend(spinButtonUp);this._attachButtonsEvents("spinDown",spinButtonDown);this._attachButtonsEvents("spinUp",spinButtonUp);this._spinUpButton=spinButtonUp;this._spinDownButton=spinButtonDown},_renderClearButton:function(){var clearButton=$("<div></div>"),buttonClearIcon=$("<div></div>");if(this._clearButton){return}clearButton.addClass(this.css.buttonCommon);clearButton.append(buttonClearIcon.addClass(this.css.clearButtonImage));clearButton.attr("title",this._getLocaleOption("clearTitle"));this._editorContainer.prepend(clearButton.addClass(this.css.clearButton));this._clearButton=clearButton;this._attachButtonsEvents("clear",clearButton)},_renderButtons:function(){var buttons=this.options.buttonType.toString().split(/[\s,]+/),buttonsCountRendered=0;if($.inArray("clear",buttons)!==-1){this._renderClearButton();buttonsCountRendered++}if($.inArray("spin",buttons)!==-1){if(this._numericType||this.options.listItems&&this.options.listItems!==null){this._renderSpinButtons();buttonsCountRendered+=2}}if($.inArray("dropdown",buttons)!==-1&&this.options.listItems&&this.options.listItems!==null){this._renderDropDownButton();buttonsCountRendered++}if(buttonsCountRendered===0){console.log($.ig.Editor.locale.btnValueNotSupported)}},_attachButtonsEvents:function(type,target){var self=this;if(!target){return}target.on({"mouseenter.button":function(){target.addClass(self.css.buttonHover)},"mouseleave.button":function(){target.removeClass(self.css.buttonHover);if(target._pressed){delete target._pressed;target.removeClass(self.css.buttonPressed)}if(target._spinTimeOut){clearTimeout(target._spinTimeOut);delete target._spinTimeOut}if(target._spinInterval){clearInterval(target._spinInterval);delete target._spinInterval}},"mousedown.button":function(event){if(event.button===0||event.button===1&&$.ig.util.isIE8){target.addClass(self.css.buttonPressed);target._pressed=true;event.preventDefault();if(type==="spinUp"||type==="spinDown"){self._handleSpinEvent(type,target)}}},"mouseup.button":function(){target.removeClass(self.css.buttonPressed);delete target._pressed;if(target._spinTimeOut){clearTimeout(target._spinTimeOut);delete target._spinTimeOut}if(target._spinInterval){clearInterval(target._spinInterval);delete target._spinInterval}},"click.button":function(event){self._triggerButtonClick(event,type)}})},_detachButtonsEvents:function(target){if(target){target.off("mouseenter.button mouseleave.button mousedown.button mouseup.button click.button")}},_attachEvents:function(){var self=this;self._super();this._editorInput.on({"focus.editor":function(event){self._setFocus(event)},"blur.editor":function(event){self._setBlur(event)},"paste.editor":function(event){self._pasteHandler(event)},"keydown.editor":function(event){self._currentInputTextValue=self._editorInput.val();self._triggerKeyDown(event)},"keyup.editor":function(event){self._triggerKeyUp(event);self._processTextChanged()},"keypress.editor":function(event){self._triggerKeyPress(event)},"compositionstart.editor":function(){self._compositionStartValue=self._editorInput.val()},"compositionend.editor":function(){setTimeout(function(){var value=self._editorInput.val(),noCancel=self._triggerValueChanging(value);if(noCancel){self._insert(value,self._compositionStartValue);self._triggerValueChanged(value)}},0)}})},_detachEvents:function(){this._super();this._editorInput.off("focus.editor blur.editor paste.editor keydown.editor keyup.editor keypress.editor compositionstart.editor compositionend.editor")},_processValueChanging:function(value){if(value!==this.value()){if(!(this.value()===null&&value==="")){this._triggerInternalValueChange(value)}}},_triggerInternalValueChange:function(value){var noCancel=this._triggerValueChanging(value);if(noCancel){this._processInternalValueChanging(value);this._triggerValueChanged(value)}},_processInternalValueChanging:function(value){if(this._validateValue(value)){this._updateValue(value)}else{if(this.options.revertIfNotValid){value=this._valueInput.val();this._updateValue(value)}else{this._clearValue();value=this._valueInput.val()}}},_triggerKeyDown:function(event){var e=event,noCancel,activeItem,args,currentInputVal,selection;args={owner:this,element:event.target,key:event.keyCode,editorInput:this._editorInput};
noCancel=this._trigger(this.events.keydown,event,args);if(noCancel){this._clearEditorNotifier();if(e.keyCode===13){if(event.altKey&&this.options.textMode==="multiline"){this._editorInput.val(this._editorInput.val()+"\n")}else{currentInputVal=this._editorInput.val();if(this._dropDownList&&this._dropDownList.is(":visible")){activeItem=this._dropDownList.children(".ui-igedit-listitem").filter("[data-active='true']");if(activeItem.length>0){this._triggerListItemClick(activeItem)}else{this._processValueChanging(currentInputVal)}}else{this._processValueChanging(currentInputVal)}}}else if(this._dropDownList){if(e.keyCode===38){if(e.altKey&&this._dropDownList.is(":visible")){this._toggleDropDown()}else if(this._dropDownList.is(":visible")){activeItem=this._dropDownList.children(".ui-igedit-listitem").filter("[data-active='true']");if(activeItem.length>0&&!activeItem.is(":first-child")){this._hoverPreviousDropDownListItem()}else{this._toggleDropDown()}}}else if(e.keyCode===40||e.keyCode===38&&e.altKey){if(!this._dropDownList.is(":visible")){this._toggleDropDown()}else{this._hoverNextDropDownListItem()}}else if(e.keyCode===27&&this._dropDownList.is(":visible")){this._toggleDropDown()}}else if(this.options.maxLength){currentInputVal=this._editorInput.val();if(currentInputVal.length===this.options.maxLength&&e.keyCode>46&&!e.altKey&&!e.ctrlKey&&!e.shiftKey){selection=this._getSelection(this._editorInput[0]);if(selection.start===selection.end){e.preventDefault();e.stopPropagation();this._sendNotification("warning",$.ig.util.stringFormat($.ig.Editor.locale.maxLengthWarningMsg,this.options.maxLength))}}}}return noCancel},_triggerKeyUp:function(event){var args={originalEvent:event,owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.keyup,event,args)},_validateNonCharacter:function(event){if($.ig.util.isFF){var e=event;if($.inArray(e.keyCode,[46,8,9,27,13,110,190])!==-1||e.which===97&&e.ctrlKey===true||e.which===99&&e.ctrlKey===true||e.which===120&&e.ctrlKey===true||e.which===118&&e.ctrlKey===true||e.which===122&&e.ctrlKey===true||e.which===121&&e.ctrlKey===true||e.keyCode>=35&&e.keyCode<=40){return true}}else{return false}},_triggerKeyPress:function(event){if(this._validateKey(event)||this._validateNonCharacter(event)){var args={owner:this,element:event.target,key:event.keyCode,editorInput:this._editorInput};if(this.options.preventSubmitOnEnter&&event.keyCode===13&&!event.shiftKey&&this.options.textMode!=="multiline"){event.preventDefault();event.stopPropagation()}if(this.options.toUpper||this.options.toLower){var keyCode=event.which?event.which:event.keyCode;if(keyCode){var charStr,transformedChar,key,selection,val;charStr=String.fromCharCode(keyCode);if(this.options.toUpper){transformedChar=charStr.toLocaleUpperCase()}else{transformedChar=charStr.toLocaleLowerCase()}key=transformedChar.charCodeAt(0);args.key=key;selection=this._getSelection(this._editorInput[0]);val=this._editorInput.val();this._editorInput.val(val.slice(0,selection.start)+transformedChar+val.slice(selection.end));this._setCursorPosition(selection.start+1);event.preventDefault()}}return this._trigger(this.events.keypress,event,args)}else{event.preventDefault();event.stopPropagation()}},_triggerValueChanged:function(originalValue){var args={owner:this,editorInput:this._editorInput,newValue:this.options.value};if(originalValue){args.originalValue=originalValue}this._trigger(this.events.valueChanged,null,args)},_triggerValueChanging:function(newValue){var args={owner:this,editorInput:this._editorInput,oldValue:this.value(),newValue:newValue};return this._trigger(this.events.valueChanging,null,args)},_triggerListItemClick:function(item){var noCancel;noCancel=this._triggerDropDownItemSelecting(item);if(noCancel){$(item).parent().children(".ui-igedit-listitem").removeClass(this.css.listItemSelected);$(item).addClass(this.css.listItemSelected);noCancel=this._triggerDropDownClosing();if(noCancel){this._hideDropDownList();this._triggerDropDownClosed()}this._triggerDropDownItemSelected(item);if(this.value()!==$(item).text()){this._currentInputTextValue=this._editorInput.val();this._processValueChanging($(item).text());this._processTextChanged();this._enterEditMode()}}},_triggerButtonClick:function(event,buttonType){if(buttonType){switch(buttonType){case"dropdown":{this._toggleDropDown()}break;case"clear":{this._currentInputTextValue=this._editorInput.val();this._clearValue();this._processTextChanged();if(!this._editMode){this._exitEditMode();this._triggerValueChanged()}else{this._enterEditMode()}}break}}},_triggerDropDownClosing:function(){var args={editor:this._editorContainer,owner:this,editorInput:this._editorInput,list:this._dropDownList};return this._trigger(this.events.dropDownListClosing,null,args)},_triggerDropDownClosed:function(){var args={editor:this._editorContainer,owner:this,editorInput:this._editorInput,list:this._dropDownList};this._trigger(this.events.dropDownListClosed,null,args)},_triggerDropDownOpening:function(){var args={editor:this._editorContainer,owner:this,editorInput:this._editorInput,list:this._dropDownList};return this._trigger(this.events.dropDownListOpening,null,args)},_triggerDropDownOpened:function(){var args={owner:this,editorInput:this._editorInput,list:this._dropDownList};return this._trigger(this.events.dropDownListOpened,null,args)},_triggerDropDownItemSelecting:function(item){var args={editor:this._editorContainer,owner:this,editorInput:this._editorInput,list:this._dropDownList,item:item};return this._trigger(this.events.dropDownItemSelecting,null,args)},_triggerDropDownItemSelected:function(item){var args={owner:this,editorInput:this._editorInput,list:this._dropDownList,item:item};this._trigger(this.events.dropDownItemSelected,null,args)},_processTextChanged:function(){var currentVal=this._editorInput.val(),previousVal=this._currentInputTextValue;if(previousVal===undefined){this._triggerTextChanged("",currentVal)}else if(currentVal!==previousVal){this._triggerTextChanged(previousVal,currentVal);if(this._validator){this._validator._validateInternal(this.element)}}},_triggerTextChanged:function(oldValue,newValue){var args={owner:this,text:newValue,oldText:oldValue?oldValue:""};this._trigger(this.events.textChanged,null,args)},_elementPositionInViewport:function(el){var areaTop=Math.ceil(el.parent().offset().top),elementoffset=Math.ceil(el.offset().top),elementHeight=Math.ceil(el.outerHeight()),listVisibleHeight=el.parent().outerHeight(),result;if(elementoffset-areaTop<0){result="top"}else if(elementoffset+elementHeight-areaTop<listVisibleHeight){result="inside"}else if(elementoffset+elementHeight-areaTop>listVisibleHeight){result="bottom"}return result},_hoverPreviousDropDownListItem:function(){var items=this._dropDownList.children(".ui-igedit-listitem"),newItem,currentItem;if(items&&items.length>0){if(items.filter("[data-active='true']").length>0){currentItem=items.filter("[data-active='true']");newItem=currentItem.prev();if(currentItem.is(":first-child")){if(this.options.spinWrapAround){newItem=items.last();this._dropDownList.scrollTop(this._dropDownList.scrollTop()+newItem.position().top)}else{return}}else{if(this._elementPositionInViewport(newItem)==="top"){this._dropDownList.scrollTop(this._dropDownList.scrollTop()-newItem.outerHeight())}}currentItem.removeClass(this.css.listItemActive,this.options.listItemHoverDuration);currentItem.removeAttr("data-active");newItem.addClass(this.css.listItemActive,this.options.listItemHoverDuration);newItem.attr("data-active",true)}}},_hoverNextDropDownListItem:function(){var items=this._dropDownList.children(".ui-igedit-listitem"),newItem,currentItem;if(items&&items.length>0){if(items.filter("[data-active='true']").length>0){currentItem=items.filter("[data-active='true']");newItem=currentItem.next();if(currentItem.is(":last-child")){if(this.options.spinWrapAround){newItem=items.first();this._dropDownList.scrollTop(this._dropDownList.scrollTop()+newItem.position().top)}else{return}}if(this._elementPositionInViewport(newItem)==="bottom"){this._dropDownList.scrollTop(this._dropDownList.scrollTop()+newItem.outerHeight())}currentItem.removeClass(this.css.listItemActive,this.options.listItemHoverDuration);currentItem.removeAttr("data-active")}else{newItem=items.filter(":visible").first()}newItem.addClass(this.css.listItemActive,this.options.listItemHoverDuration);newItem.attr("data-active",true)}},_pasteHandler:function(event){var self=this,previousValue=$(event.target).val(),newValue;this._currentInputTextValue=this._editorInput.val();this._timeouts.push(setTimeout(function(){newValue=$(event.target).val();self._insert(newValue,previousValue)},10))},_insertHandler:function(string){var selection=this._getSelection(this.field()[0]),previousValue,newValue;if(string){previousValue=this._editMode?this._editorInput.val():this.displayValue();newValue=this._replaceDisplayValue(selection,previousValue,string);this._insert(newValue,previousValue)}},_replaceDisplayValue:function(selection,previousValue,string){return previousValue.substring(0,selection.start)+string+previousValue.substring(selection.end,previousValue.length)},_insert:function(newValue,previousValue){var selection;if(this.options.maxLength){if(newValue&&newValue.toString().length>=this.options.maxLength){newValue=newValue.toString().substring(0,this.options.maxLength);this._sendNotification("warning",$.ig.util.stringFormat($.ig.Editor.locale.maxLengthErrMsg,this.options.maxLength))}}if(this._validateValue(newValue)){selection=this._getSelection(this._editorInput[0]);if(this.options.toUpper){if(newValue){newValue=newValue.toLocaleUpperCase()}}else if(this.options.toLower){if(newValue){newValue=newValue.toLocaleLowerCase()}}this._processValueChanging(newValue);this._processTextChanged();this._setCursorPosition(selection.start+newValue.length)}else{this._editorInput.val(previousValue)}},_clearDropDownHoverActiveItem:function(){var hoveredItem=this._dropDownList.children(".ui-igedit-listitem").filter("[data-hovered='true']"),activeItem=this._dropDownList.children(".ui-igedit-listitem").filter("[data-active='true']");if(hoveredItem.length>0){hoveredItem.removeClass(this.css.listItemHover);hoveredItem.removeAttr("data-hovered")}if(activeItem.length>0){activeItem.removeClass(this.css.listItemActive);activeItem.removeAttr("data-active")}},_showDropDownList:function(){var direction;this._positionDropDownList();if(this._dropDownListOrientation==="up"){direction="down"}else{direction="up"}try{$(this._dropDownList).show("blind",{direction:direction},this.options.dropDownAnimationDuration,$.proxy(this._triggerDropDownOpened,this))}catch(ex){$(this._dropDownList).show(this.options.dropDownAnimationDuration,$.proxy(this._triggerDropDownOpened,this))}},_hideDropDownList:function(){var direction;if(this._dropDownListOrientation==="up"){direction="down"}else{direction="up"}try{$(this._dropDownList).hide("blind",{direction:direction},this.options.dropDownAnimationDuration,$.proxy(this._triggerDropDownClosed,this))}catch(ex){$(this._dropDownList).hide(this.options.dropDownAnimationDuration,$.proxy(this._triggerDropDownClosed,this))}this._clearDropDownHoverActiveItem()},_toggleDropDown:function(){var noCancel;if(this._dropDownList.is(":visible")){noCancel=this._triggerDropDownClosing();if(noCancel){this._hideDropDownList()}}else{noCancel=this._triggerDropDownOpening();if(noCancel){this._editorInput.focus();this._showDropDownList()}}},_validateKey:function(event){var ch,result;if(this.options.excludeKeys){ch=String.fromCharCode(event.charCode||event.which);if($.inArray(ch,this._excludeKeysArray)!==-1){result=false}else{result=true}}else if(this.options.includeKeys){ch=String.fromCharCode(event.charCode||event.which);if($.inArray(ch,this._includeKeysArray)!==-1){result=true}else{result=false}}else{result=true}return result},_enterEditMode:function(){this._editMode=true;var selection=this._getSelection(this._editorInput[0]);this._positionCursor(selection.start,selection.end);this._currentInputTextValue=this._editorInput.val();this._processTextChanged()},_exitEditMode:function(){if(this.options.textMode==="text"&&!$.ig.util.isIE8){this._editorInput.attr("type","text")}this._currentInputTextValue=this._editorInput.val();this._editorInput.val(this._getDisplayValue());this._editMode=false;this._processTextChanged()},_getDisplayValue:function(){return this._valueInput.val()},_getSelectionRange:function(){var selection;if(window.getSelection){selection=window.getSelection();if(selection.rangeCount){return selection.getRangeAt(0)}}else if(document.selection){return document.selection.createRange()}},_setCursorPosition:function(positionIndex){this._setSelectionRange(this._editorInput[0],positionIndex,positionIndex)},_setSelectionRange:function(input,selectionStart,selectionEnd){if(input.setSelectionRange){input.setSelectionRange(selectionStart,selectionEnd)}else if(input.createTextRange){var range=input.createTextRange();range.collapse(true);range.moveEnd("character",selectionEnd);range.moveStart("character",selectionStart);range.select()}},_positionCursor:function(startPostion,endPosition){var currentValue=this._editorInput.val(),self=this;if(currentValue&&currentValue.length>0){switch(this.options.selectionOnFocus){case"selectAll":{if($.ig.util.isChrome||$.ig.util.isSafari){this._timeouts.push(setTimeout(function(){self._editorInput.select()},100))}else{this._editorInput.select()}}break;case"atStart":{if($.ig.util.isChrome||$.ig.util.isSafari){this._timeouts.push(setTimeout(function(){self._setSelectionRange(self._editorInput[0],0,0)},100))}else{this._setSelectionRange(this._editorInput[0],0,0)}}break;case"atEnd":{if($.ig.util.isChrome||$.ig.util.isSafari){this._timeouts.push(setTimeout(function(){self._setSelectionRange(self._editorInput[0],currentValue.length,currentValue.length)},100))}else{this._setSelectionRange(this._editorInput[0],currentValue.length,currentValue.length)}}break;case"browserDefault":{if(startPostion){if(endPosition){if(endPosition>currentValue.length-1){endPosition=currentValue.length-1}}else{endPosition=startPostion}if($.ig.util.isChrome||$.ig.util.isSafari){this._timeouts.push(setTimeout(function(){self._setSelectionRange(self._editorInput[0],startPostion,endPosition)},100))}else{this._setSelectionRange(this._editorInput[0],startPostion,endPosition)}}else{if($.ig.util.isChrome||$.ig.util.isSafari){this._timeouts.push(setTimeout(function(){self._editorInput.select()},100))}else{this._editorInput.select()}}}break;default:}}else{this._editorInput.select()}},_spinUp:function(){if(this._dropDownList&&this._dropDownList.is(":visible")){this._hoverPreviousDropDownListItem()}},_spinDown:function(){if(this._dropDownList&&this._dropDownList.is(":visible")){this._hoverNextDropDownListItem()}},_handleSpinUpEvent:function(){this._spinUp()},_handleSpinDownEvent:function(){this._spinDown()},_handleSpinEvent:function(type,target){var self=this;if(type==="spinUp"){this._handleSpinUpEvent();if(!target.attr("disabled")){target._spinTimeOut=setTimeout(function(){target._spinInterval=setInterval(function(){self._handleSpinUpEvent()},75)},300)}}else if(type==="spinDown"){this._handleSpinDownEvent();if(!target.attr("disabled")){target._spinTimeOut=setTimeout(function(){target._spinInterval=setInterval(function(){self._handleSpinDownEvent()},75)},300)}}this._timeouts.push(target._spinTimeOut)},_clearValue:function(){this._super();if(this._dropDownList&&this._dropDownList.children(".ui-igedit-listitemselected").length>0){this._dropDownList.children(".ui-igedit-listitemselected").removeClass(this.css.listItemSelected)}},_clearEditorNotifier:function(){var notifier=this._editorContainer.data("igNotifier");if(notifier&&notifier.options.state==="warning"&&notifier.isVisible()){notifier.hide()}},_getCursorPosition:function(){var selection=this._getSelection(this._editorInput[0]);if(selection.end-selection.start===this._editorInput.val().length&&this._editorInput.val().length>0){return-1}else{return selection.start}},_getSelection:function(editor){var startPostion=0,endPosition=0;if(editor.selectionStart!==undefined){startPostion=editor.selectionStart;endPosition=editor.selectionEnd}else if(document.selection){var globalSelection=document.selection.createRange(),range,rangeClone;if(globalSelection!==null){range=editor.createTextRange();rangeClone=range.duplicate();range.moveToBookmark(globalSelection.getBookmark());endPosition=range.text.length;rangeClone.setEndPoint("EndToStart",range);startPostion=rangeClone.text.length;endPosition+=startPostion}}return{start:startPostion,end:endPosition}},_getLocaleOption:function(key){var locale=this.options.locale;if(locale&&locale[key]){return locale[key]}else if($.ig&&$.ig.Editor&&$.ig.Editor.locale){return $.ig.Editor.locale[key]}else{return""}},_listItems:function(){return this._dropDownList.children(".ui-igedit-listitem")},_getListItemByIndex:function(index){return this._dropDownList.children(".ui-igedit-listitem:nth-child("+(index+1)+")")},_getSelectedItemIndex:function(){var items=this._listItems(),i;for(i=0;i<items.length;i++){if($(items[i]).hasClass(this.css.listItemSelected)){return i}}return-1},_setSelectedItemByIndex:function(index){var oldSelectedItem,newSelectedItem;if(this._getSelectedItemIndex()!==index){oldSelectedItem=this.getSelectedListItem();oldSelectedItem.removeClass(this.css.listItemSelected);oldSelectedItem.removeAttr("data-active");newSelectedItem=this._getListItemByIndex(index);newSelectedItem.addClass(this.css.listItemSelected);if(this.dropDownVisible()){newSelectedItem.attr("data-active",true)}}},displayValue:function(){return this._getDisplayValue()},dropDownContainer:function(){return this._dropDownList?this._dropDownList:null},showDropDown:function(){this._showDropDownList()},hideDropDown:function(){this._hideDropDownList()},clearButton:function(){return this._clearButton},dropDownButton:function(){return this._dropDownButton},spinUpButton:function(){return this._spinUpButton},spinDownButton:function(){return this._spinDownButton},dropDownVisible:function(){return this._dropDownList.is(":visible")},findListItemIndex:function(text,matchType){var list=this.options.listItems,matchCase="i",index=-1,regString,regExp,i;if(!list||list.length===0){return-1}switch(matchType){case"startsWith":regString="^{pattern}";break;case"endsWith":regString="{pattern}$";break;case"exact":regString="^{pattern}$";matchCase=undefined;break;default:regString="{pattern}";break}regExp=new RegExp(regString.replace("{pattern}",$.ig.util.escapeRegExp(text)),matchCase);for(i=0;i<list.length;i++){if(regExp.test(list[i])){index=i}}return index},selectedListIndex:function(index){if(index!==undefined){this._setSelectedItemByIndex(index)}else{return this._getSelectedItemIndex()}},getSelectedListItem:function(){return this._listItems().filter(".ui-igedit-listitemselected")},getSelectedText:function(){var text=this._editMode?this._editorInput.val():this.displayValue(),startIndex=this.getSelectionStart(),endIndex=this.getSelectionEnd();if(startIndex===undefined||endIndex===undefined||startIndex===null||endIndex===null||startIndex===endIndex){return""}return text.substring(startIndex,endIndex)},getSelectionStart:function(){return this._getSelection(this._editorInput[0]).start},getSelectionEnd:function(){return this._getSelection(this._editorInput[0]).end},insert:function(string){this._insertHandler(string)},select:function(start,end){this._setSelectionRange(this._editorInput[0],start,end)},spinUp:function(){this._spinUp()},spinDown:function(){this._spinDown()}});$.widget("ui.igNumericEditor",$.ui.igTextEditor,{options:{regional:null,negativeSign:null,negativePattern:null,decimalSeparator:null,groupSeparator:null,groups:null,maxDecimals:null,minDecimals:null,textAlign:"right",dataMode:"double",minValue:null,maxValue:null,allowNullValue:false,spinDelta:1,scientificFormat:null,spinWrapAround:false,maxLength:null,excludeKeys:null,includeKeys:null},events:{},css:{negative:"ui-igedit-negative"},_create:function(){$.ui.igTextEditor.prototype._create.call(this);if(!$.ig.util.isIE8){this._editorInput.attr("type","tel")}},_initialize:function(){this._super();this._applyRegionalSettings();this._applyDataModeSettings();this._setNumericType();var numericChars="0123456789",dataMode=this.options.dataMode;if(dataMode==="double"||dataMode==="float"){numericChars+=this.options.decimalSeparator;if(this.options.decimalSeparator!=="."){numericChars+="."}}if(this._getScientificFormat()){numericChars+=this._getScientificFormat()}if(dataMode==="double"||dataMode==="float"||dataMode==="long"||dataMode==="int"||dataMode==="short"||dataMode==="sbyte"){numericChars+=this.options.negativeSign}if(this.options.excludeKeys){this.options.excludeKeys=null}this.options.includeKeys=numericChars},_setNumericType:function(){this._numericType="numeric"},_getScientificFormat:function(){var result;if(this.options.scientificFormat){switch(this.options.scientificFormat){case"E":case"E+":{result="E"}break;case"e":case"e+":{result="e"}break;default:{result="e";throw $.ig.Editor.locale.scientificFormatErrMsg}}}else{result=null}return result},_applyRegionalSettings:function(){this.options.negativeSign=this._getRegionalOption("negativeSign");this.options.negativePattern=this.options.negativePattern||this._getRegionalOption("numericNegativePattern");this.options.decimalSeparator=this.options.decimalSeparator||this._getRegionalOption("numericDecimalSeparator");this.options.groupSeparator=this.options.groupSeparator||this._getRegionalOption("numericGroupSeparator");this.options.groups=this.options.groups||this._getRegionalOption("numericGroups");this.options.maxDecimals=this.options.maxDecimals===null?this._getRegionalOption("numericMaxDecimals"):this.options.maxDecimals;this.options.minDecimals=this.options.minDecimals===null?this._getRegionalOption("numericMinDecimals"):this.options.minDecimals},_applyOptions:function(){var delta,fractional;this._super();if(this.options.spinDelta!==1){delta=this.options.spinDelta;if(typeof delta!=="number"){this.options.spinDelta=1;throw new Error($.ig.Editor.locale.spinDeltaIsOfTypeNumber)}if(delta<0){this.options.spinDelta=1;throw new Error($.ig.Editor.locale.spinDeltaCouldntBeNegative)}if(this.options.dataMode==="float"||this.options.dataMode==="double"){if(delta%1!==0){fractional=delta.toString().substring(delta.toString().indexOf(".")+1);if(fractional.toString().length>this.options.maxDecimals){throw $.ig.util.stringFormat($.ig.Editor.locale.spinDeltaContainsExceedsMaxDecimals,this.options.maxDecimals)}}}else{if(delta%1!==0){throw $.ig.Editor.locale.spinDeltaIncorrectFloatingPoint}}}if(this.options.scientificFormat){this.options.spinDelta=Number(this.options.spinDelta.toExponential())}if(this.options.maxLength!==null){this.options.maxLength=null}},_setOption:function(option,value){var prevValue=this.options[option];if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"spinDelta":{if(typeof value!=="number"){this.options[option]=prevValue;throw new Error($.ig.Editor.locale.spinDeltaIsOfTypeNumber)}else if(value<0){this.options[option]=prevValue;throw new Error($.ig.Editor.locale.spinDeltaCouldntBeNegative)}else if(this.options.dataMode!=="float"&&this.options.dataMode!=="double"&&value%1!==0){this.options[option]=prevValue;throw new Error($.ig.Editor.locale.spinDeltaIncorrectFloatingPoint)}else if(this.options.scientificFormat){this.options[option]=Number(value.toExponential())}break}case"minDecimals","maxDecimals":value=parseFloat(value);if(isNaN(value)){this.options[option]=prevValue;throw new Error($.ig.Editor.locale.notEditableOptionByInit)}break;default:{this.options[option]=prevValue;this._super(option,value)}break}},_processValueChanging:function(value){if(typeof value==="string"||value instanceof String){value=value.trim();value=this._parseNumericValueByMode(value,this._numericType,this.options.dataMode);if(this._numericType==="percent"&&this.options.displayFactor){value/=this.options.displayFactor}}this._super(value)},_processInternalValueChanging:function(value){if(!this._validateValue(value)){value=this._parseNumericValueByMode(value,this._numericType,this.options.dataMode);if(value!==""&&!isNaN(value)){if(this.options.revertIfNotValid){value=this._valueInput.val()}else{if(value<=this.options.minValue){value=this.options.minValue}else{value=this.options.maxValue}}}else{if(this.options.allowNullValue){value=this.options.nullValue}else{if(this.options.revertIfNotValid){value=this._valueInput.val()}else{value=0;if(this.options.minValue>0){value=this.options.minValue}else if(this.options.maxValue<0){value=this.options.maxValue}else{value=0}}}}}if(value!==this.value()){this._updateValue(value)}this._setSpinButtonsState(value)},_triggerKeyDown:function(event){var e=event,noCancel,args,currentInputVal;args={owner:this,element:event.target,key:event.keyCode,editorInput:this._editorInput};noCancel=this._trigger(this.events.keydown,event,args);if(noCancel){this._clearEditorNotifier();if(e.keyCode===13){currentInputVal=this._editorInput.val();this._processValueChanging(currentInputVal)}else if(e.keyCode===38){if(e.altKey&&this._dropDownList&&this._dropDownList.is(":visible")){this._toggleDropDown()}else if(!this.options.readOnly){this._handleSpinUpEvent()}}else if(e.keyCode===40){if(e.altKey&&this._dropDownList&&!this._dropDownList.is(":visible")){this._toggleDropDown()}else if(!this.options.readOnly){this._handleSpinDownEvent()}}else if(e.keyCode===27&&this._dropDownList&&this._dropDownList.is(":visible")){this._toggleDropDown()}else if(this.options.maxLength){currentInputVal=this._editorInput.val();if(currentInputVal.length===this.options.maxLength&&e.keyCode>46&&!e.altKey&&!e.ctrlKey&&!e.shiftKey){e.preventDefault();e.stopPropagation()}}}},_applyDataModeSettings:function(){var doubleMaxDecimals=15;switch(this.options.dataMode){case"double":{this._setMinMaxValues(-Number.MAX_VALUE,Number.MAX_VALUE);this._setMinMaxDecimals(doubleMaxDecimals)}break;case"float":{var floatMaxDecimals=7,floatMinValue=-3.40282347e38,floatMaxValue=3.40282347e38;this._setMinMaxValues(floatMinValue,floatMaxValue);this._setMinMaxDecimals(floatMaxDecimals)}break;case"long":{var longMinValue=-0x8000000000000000,longMaxValue=0x8000000000000000;this._setMinMaxValues(longMinValue,longMaxValue)}break;case"ulong":{var ulongMinValue=0,ulongMaxValue=0x10000000000000000;this._setMinMaxValues(ulongMinValue,ulongMaxValue)}break;case"int":{var intMinValue=-2147483647,intMaxValue=2147483647;this._setMinMaxValues(intMinValue,intMaxValue)}break;case"uint":{var uintMinValue=0,uintMaxValue=4294967295;this._setMinMaxValues(uintMinValue,uintMaxValue)}break;case"short":{var shortMinValue=-32768,shortMaxValue=32767;this._setMinMaxValues(shortMinValue,shortMaxValue)}break;case"ushort":{var ushortMinValue=0,ushortMaxValue=65535;this._setMinMaxValues(ushortMinValue,ushortMaxValue)}break;case"sbyte":{var sbyteMinValue=-127,sbyteMaxValue=127;this._setMinMaxValues(sbyteMinValue,sbyteMaxValue)}break;case"byte":{var byteMinValue=0,byteMaxValue=256;this._setMinMaxValues(byteMinValue,byteMaxValue)}break;default:{this.options.dataMode="double";this._setMinMaxValues(Number.MIN_VALUE,Number.MAX_VALUE);this._setMinMaxDecimals(doubleMaxDecimals)}}},_setMinMaxDecimals:function(typeMaxDecimals){if(this.options.maxDecimals===null||this.options.maxDecimals>typeMaxDecimals){this.options.maxDecimals=typeMaxDecimals}if(this.options.minDecimals&&this.options.minDecimals>this.options.maxDecimals){this.options.maxDecimals=this.options.minDecimals}},_setMinMaxValues:function(typeMinValue,typeMaxValue){if(this.options.minValue===null||this.options.minValue<typeMinValue){this.options.minValue=typeMinValue}if(this.options.maxValue===null||this.options.maxValue>typeMaxValue){this.options.maxValue=typeMaxValue}},_parseNumericValueByMode:function(value,numericEditorType,dataMode){var val,stringValue,decimalSeparator,groupSeparator,minDecimals,maxDecimals;decimalSeparator=this.options.decimalSeparator;groupSeparator=this.options.groupSeparator;minDecimals=this.options.minDecimals;maxDecimals=this.options.maxDecimals;if(value===null||value===""){return value}value=value.toString().replace(new RegExp(groupSeparator,"g"),"");if(numericEditorType==="percent"){value=value.replace(this.options.percentSymbol,"").trim()}else if(numericEditorType==="currency"){value=value.replace(this.options.currencySymbol,"").trim()}if(dataMode==="double"||dataMode==="float"){stringValue=value.toString().toLowerCase();if(stringValue.indexOf("e")!==-1){val=value}else{if(stringValue.indexOf(decimalSeparator)!==-1||stringValue.indexOf(".")!==-1){var integerDigits,fractionalDigits;if(stringValue.indexOf(".")!==-1){decimalSeparator="."}fractionalDigits=stringValue.substring(stringValue.indexOf(decimalSeparator)+1);if(fractionalDigits.indexOf(decimalSeparator)>0){fractionalDigits=fractionalDigits.substring(0,fractionalDigits.indexOf(decimalSeparator))}if(fractionalDigits.length>maxDecimals){fractionalDigits=fractionalDigits.substring(0,maxDecimals)}integerDigits=stringValue.substring(0,stringValue.indexOf(decimalSeparator));val=(integerDigits+"."+fractionalDigits)/1}else{val=parseFloat(parseInt(value).toFixed(minDecimals))}}}else{if(this._numericType==="percent"&&this.options.displayFactor===100&&this.options.dateMode==="int"&&parseInt(value)!==parseInt(this._editorInput.val())){val=value}else{val=parseInt(value)}}if(this.options.scientificFormat&&val.toString().toLowerCase().indexOf("e")===-1){val=val.toExponential()}return val},_updateValue:function(value){var val,dataMode=this.options.dataMode;if(value===""&&this.options.allowNullValue){val=this.options.nullValue;this._valueInput.val("")}else if(value===this.options.nullValue&&value===null){val=value;this._valueInput.val("")}else{val=this._parseNumericValueByMode(value,this._numericType,dataMode);this._valueInput.val(val)}this.options.value=val},_validateKey:function(event){if(this._super(event)){var dataMode=this.options.dataMode,negativeSign=this.options.negativeSign,ch,val,cursorPos=this._getCursorPosition(),isDecimal=event.which?event.which===46:false;ch=String.fromCharCode(event.charCode||event.which);if(ch===negativeSign&&cursorPos>0){return false}if(dataMode==="double"||dataMode==="float"){var decimalSeparator=this.options.decimalSeparator;val=this._editorInput.val();if(decimalSeparator!=="."&&isDecimal&&(val.indexOf(".")!==-1||val.indexOf(decimalSeparator)!==-1)&&cursorPos!==-1){return false}if((ch===decimalSeparator||isDecimal)&&(val.indexOf(decimalSeparator)!==-1||val.indexOf(".")!==-1)&&cursorPos!==-1||ch===negativeSign&&val.indexOf(negativeSign)!==-1&&cursorPos!==-1){return false}else{return true}}else if(dataMode==="long"||dataMode==="int"||dataMode==="short"||dataMode==="sbyte"){val=$(event.target).val();if(ch===negativeSign&&val.indexOf(negativeSign)>0&&cursorPos!==-1){return false}else{return true}}else{return true}}else{return false}},_disableSpinButton:function(target){if(target&&!target.attr("disabled")&&!this.options.spinWrapAround){target.addClass(this.css.disabled);target.attr("disabled",true);target.removeClass(this.css.buttonHover);if(target._pressed){delete target._pressed;target.removeClass(this.css.buttonPressed)}if(target._spinTimeOut){clearTimeout(target._spinTimeOut);delete this._spinUpButton._spinTimeOut}if(target._spinInterval){clearInterval(target._spinInterval);delete target._spinInterval}this._detachButtonsEvents(target)}},_enableSpinButton:function(target,type){if(target&&target.attr("disabled")){target.removeClass(this.css.disabled);target.attr("disabled",false);this._attachButtonsEvents(type,target)}},_setSpinButtonsState:function(val){if(typeof val==="string"||val instanceof String){val=val.trim()}if(val===null){this._enableSpinButton(this._spinDownButton,"spinDown");this._enableSpinButton(this._spinUpButton,"spinUp");return}if(val!==""&&!this.options.spinWrapAround){if(val>=this.options.maxValue){this._disableSpinButton(this._spinUpButton);this._enableSpinButton(this._spinDownButton,"spinDown");
this._sendNotification("warning",$.ig.util.stringFormat($.ig.Editor.locale.maxValErrMsg,this.options.maxValue))}else if(val<=this.options.minValue){this._disableSpinButton(this._spinDownButton);this._enableSpinButton(this._spinUpButton,"spinUp");this._sendNotification("warning",$.ig.util.stringFormat($.ig.Editor.locale.minValErrMsg,this.options.minValue))}else{this._enableSpinButton(this._spinDownButton,"spinDown");this._enableSpinButton(this._spinUpButton,"spinUp")}}},_validateValue:function(val){var result;if(this._super(val)&&!isNaN(val=this._parseNumericValueByMode(val,this._numericType,this.options.dataMode))){if(val>this.options.maxValue){result=false;if(this.options.revertIfNotValid){this._sendNotification("warning",$.ig.util.stringFormat($.ig.Editor.locale.maxValExceedRevertErrMsg,this.options.maxValue))}}else if(val<this.options.minValue){result=false;if(this.options.revertIfNotValid){this._sendNotification("warning",$.ig.util.stringFormat($.ig.Editor.locale.minValExceedRevertErrMsg,this.options.minValue))}}else{result=true}}else{result=false}return result},_insert:function(newValue,previousValue){if(!isNaN(newValue=this._parseNumericValueByMode(newValue,this._numericType,this.options.dataMode))){if(this.options.maxValue&&newValue>this.options.maxValue){newValue=this.options.maxValue}else if(this.options.minValue&&newValue<this.options.minValue){newValue=this.options.minValue}if(!this._validateValue(newValue)&&this.options.revertIfNotValid){newValue=previousValue}}else if(this.options.revertIfNotValid){newValue=previousValue}else{newValue=""}this._editorInput.val(newValue);this._setSpinButtonsState(newValue);this._processTextChanged()},_clearValue:function(){if(this.options.allowNullValue){this._updateValue(this.options.nullValue);if(this.options.nullValue===null){this._editorInput.val("")}else{this._editorInput.val(this.options.nullValue)}}else{if(this.options.minValue&&this.options.minValue>0){this._updateValue(this.options.minValue);this._editorInput.val(this.options.minValue)}else if(this.options.maxValue&&this.options.maxValue<0){this._updateValue(this.options.maxValue);this._editorInput.val(this.options.maxValue)}else{if(this.value()){this._updateValue(0);this._editorInput.val(0)}}}if(this.dropDownContainer()&&this.dropDownContainer().children(".ui-igedit-listitemselected").length>0){this.dropDownContainer().children(".ui-igedit-listitemselected").removeClass(this.css.listItemSelected)}},_getRegionalOption:function(key){var regional=this.options.regional;if(this.options[key]){return this.options[key]}if(typeof regional==="string"){regional=$.ig.regional[regional]}if(regional&&regional[key]){return regional[key]}else{return $.ig.regional.defaults[key]}},_convertScientificToNumeric:function(num){var parts=num.toString().split("e+"),first,zeroes,i;first=parts[0].replace(".","");zeroes=parseInt(parts[1],10)-(first.length-1);for(i=0;i<zeroes;i++){first+="0"}return first},_getDisplayValue:function(){var value=this._valueInput.val(),decimalSeparator=this.options.decimalSeparator,decimalPoint=".",minDecimals=this.options.minDecimals,dataMode=this.options.dataMode,stringValue,displayValue,integerDigits,fractionalDigits,scientificPrecision,scientificValue,positivePattern,negativePattern,groups,groupSeparator,symbol="";if(value===this.options.nullValue||value===""||isNaN(value)){if(isNaN(value)){this._valueInput.val("");return""}else{return value}}if(this._numericType!=="numeric"){positivePattern=this.options.positivePattern;symbol=this.options[this._numericType+"Symbol"]}negativePattern=this.options.negativePattern;groups=this.options.groups;groupSeparator=this.options.groupSeparator;if(this._numericType==="percent"&&this.options.displayFactor){value*=this.options.displayFactor;value=this._parseNumericValueByMode(value,this._numericType,this.options.dataMode)}if(dataMode==="double"||dataMode==="float"){stringValue=value.toString().toLowerCase();if(this.options.scientificFormat){if(stringValue.indexOf("e")!==-1){displayValue=stringValue.replace("e",this._getScientificFormat())}else{scientificValue=(stringValue/1).toExponential();displayValue=scientificValue.toString().replace("e",this._getScientificFormat())}}else{if(stringValue.indexOf("e")!==-1){scientificPrecision=stringValue.substring(stringValue.toLowerCase().indexOf("e")+1);stringValue=stringValue/1;if(scientificPrecision>0){stringValue=this._convertScientificToNumeric(stringValue)}else{stringValue=stringValue.toFixed(Math.abs(scientificPrecision))}}if(stringValue.indexOf("e")!==-1){displayValue=stringValue}else{if(stringValue.indexOf(decimalPoint)!==-1){fractionalDigits=stringValue.substring(stringValue.indexOf(decimalPoint)+1);if(fractionalDigits.length<minDecimals){var missingDecimals=minDecimals-fractionalDigits.length;while(missingDecimals>0){fractionalDigits+="0";missingDecimals--}}integerDigits=stringValue.substring(0,stringValue.indexOf(decimalPoint))}else{integerDigits=stringValue;if(minDecimals>0){stringValue=parseInt(stringValue).toFixed(minDecimals);fractionalDigits=stringValue.substring(stringValue.indexOf(decimalPoint)+1)}}integerDigits=this._applyGroups(integerDigits,groups,groupSeparator);if(fractionalDigits&&fractionalDigits.length>0){displayValue=integerDigits+decimalSeparator+fractionalDigits}else{displayValue=integerDigits}}}}else{displayValue=this._applyGroups(value.toString(),groups,groupSeparator)}if(value<0&&(this.options.scientificFormat===null||displayValue.indexOf("e")===-1)){displayValue=displayValue.replace("-","");displayValue=negativePattern.replace("n",displayValue).replace("$",symbol)}else if(positivePattern&&(this.options.scientificFormat===null||displayValue.indexOf("e")===-1)){displayValue=positivePattern.replace("n",displayValue).replace("$",symbol)}return displayValue},_applyGroups:function(integerDigits,groups,groupSeparator){var digitsPosition=integerDigits.length-1,br=1,l=groups.length,digitsLimit=0,group;group=groups.length>0?groups[0]:0;if(group>integerDigits.length||group===0){return integerDigits}if(parseFloat(integerDigits)<0){digitsLimit=1}for(digitsPosition;digitsPosition>digitsLimit;digitsPosition--){if(--group===0){integerDigits=integerDigits.substring(0,digitsPosition)+groupSeparator+integerDigits.substring(digitsPosition);if(br===l){group=groups[--br]}else{group=groups[br];br++}}}return integerDigits},_enterEditMode:function(){var val,selection=this._getSelection(this._editorInput[0]);if(!$.ig.util.isIE8){this._editorInput.attr("type","tel")}this._currentInputTextValue=this._editorInput.val();val=this._valueInput.val();if(val<0){this._editorInput.removeClass(this.css.negative)}if(this._numericType==="percent"&&this.options.displayFactor){val=this._parseNumericValueByMode(val,this._numericType,this.options.dataMode);val*=this.options.displayFactor}if(this.options.decimalSeparator!=="."){val=val.toString().replace(".",this.options.decimalSeparator)}this._editorInput.val(val);this._editMode=true;this._positionCursor(selection.start,selection.end);this._processTextChanged()},_exitEditMode:function(){this._super();if(this.value()<0){this._editorInput.addClass(this.css.negative)}else{this._editorInput.removeClass(this.css.negative)}},_getSpinValue:function(spinType,currentValue,decimalSeparator){var fractional,scientificPrecision,spinPrecision,spinDelta,toFixedVal,precision;if(currentValue.toString().toLowerCase().indexOf("e")!==-1){currentValue=Number(currentValue);if(this.options.spinDelta.toString().toLowerCase().indexOf("e")===-1){spinDelta=Number(this.options.spinDelta.toExponential())}else{spinDelta=this.options.spinDelta}if(spinType==="spinUp"){currentValue+=spinDelta}else{currentValue-=spinDelta}}else if(currentValue.toString().indexOf(decimalSeparator)!==-1){fractional=currentValue.substring(currentValue.toString().indexOf(decimalSeparator)+1);toFixedVal=fractional.toString().length;if(decimalSeparator!=="."){currentValue.replace(decimalSeparator,".")}currentValue=currentValue/1;if((this.options.displayFactor?this.options.spinDelta*this.options.displayFactor:this.options.spinDelta)%1===0){if(spinType==="spinUp"){currentValue+=this.options.spinDelta}else{currentValue-=this.options.spinDelta}}else{if(this.options.spinDelta.toString().toLowerCase().indexOf("e")!==-1){currentValue=Number(currentValue.toExponential());scientificPrecision=this.options.spinDelta.toString().toLowerCase().substring(this.options.spinDelta.toString().toLowerCase().indexOf("e")+1);spinPrecision=Math.abs(scientificPrecision);precision=Math.pow(10,spinPrecision)}else{precision=Math.pow(10,this.options.spinDelta.toString().toLowerCase().substring(this.options.spinDelta.toString().toLowerCase().indexOf(".")+1).length)}if(spinType==="spinUp"){if(currentValue===0&&scientificPrecision){currentValue=this.options.spinDelta.toFixed(spinPrecision)}else{currentValue=(Math.round(currentValue*precision)+Math.round(this.options.spinDelta*precision))/precision}}else{if(currentValue===0&&scientificPrecision){currentValue=(-this.options.spinDelta).toFixed(spinPrecision)}else{currentValue=(Math.round(currentValue*precision)-Math.round(this.options.spinDelta*precision))/precision}}}if(currentValue.toString().substring(currentValue.toString().indexOf(".")+1).length<fractional.length){currentValue=currentValue.toFixed(toFixedVal)}if(decimalSeparator!=="."){currentValue.replace(".",decimalSeparator)}}else{currentValue=currentValue/1;if((this.options.displayFactor?this.options.spinDelta*this.options.displayFactor:this.options.spinDelta)%1===0){if(spinType==="spinUp"){currentValue+=this.options.spinDelta}else{currentValue-=this.options.spinDelta}}else{if(this.options.spinDelta.toString().toLowerCase().indexOf("e")!==-1){scientificPrecision=this.options.spinDelta.toString().toLowerCase().substring(this.options.spinDelta.toString().toLowerCase().indexOf("e")+1);spinPrecision=Math.abs(scientificPrecision);precision=Math.pow(10,spinPrecision)}else{precision=Math.pow(10,this.options.spinDelta.toString().toLowerCase().substring(this.options.spinDelta.toString().toLowerCase().indexOf(".")+1).length)}if(spinType==="spinUp"){if(currentValue===0){currentValue=this.options.spinDelta.toFixed(spinPrecision)}else{currentValue=(Math.round(currentValue*precision)+Math.round(this.options.spinDelta*precision))/precision}}else{if(currentValue===0){currentValue=(-this.options.spinDelta).toFixed(spinPrecision)}else{currentValue=(Math.round(currentValue*precision)-Math.round(this.options.spinDelta*precision))/precision}}}}return currentValue},_spinUp:function(){var currVal,decimalSeparator=this.options.decimalSeparator,noCancel;if(this._focused){currVal=this._editorInput.val()}else{if(this.value()||this.value()===0){currVal=this.value().toString()}else{currVal=""}}this._clearEditorNotifier();this._currentInputTextValue=this._editorInput.val();currVal=this._getSpinValue("spinUp",currVal,decimalSeparator);if(!this._validateValue(currVal)&&currVal>this.options.maxValue&&this.options.spinWrapAround||currVal<this.options.minValue){currVal=this.options.minValue;this._sendNotification("warning",$.ig.util.stringFormat($.ig.Editor.locale.maxValExceededWrappedAroundErrMsg,this.options.maxValue))}else if(currVal>=this.options.maxValue&&!this.options.spinWrapAround){currVal=this.options.maxValue;this._sendNotification("warning",$.ig.util.stringFormat($.ig.Editor.locale.maxValErrMsg,this.options.maxValue))}if(this._focused){if(this.options.scientificFormat){currVal=Number(currVal).toExponential().replace("e",this._getScientificFormat())}this._editorInput.val(currVal);this._processTextChanged()}else{noCancel=this._triggerValueChanging(currVal);if(noCancel){this._updateValue(currVal);this._exitEditMode();this._triggerValueChanged(currVal)}}this._setSpinButtonsState(currVal)},_spinDown:function(){var currVal,decimalSeparator=this.options.decimalSeparator,noCancel;if(this._focused){currVal=this._editorInput.val()}else{if(this.value()||this.value()===0){currVal=this.value().toString()}else{currVal=""}}this._clearEditorNotifier();this._currentInputTextValue=this._editorInput.val();currVal=this._getSpinValue("spinDown",currVal,decimalSeparator);if(!this._validateValue(currVal)&&currVal<this.options.minValue&&this.options.spinWrapAround||currVal>this.options.maxValue){currVal=this.options.maxValue;this._sendNotification("warning",$.ig.util.stringFormat($.ig.Editor.locale.minValExceededWrappedAroundErrMsg,this.options.minValue))}else if(currVal<=this.options.minValue&&!this.options.spinWrapAround){currVal=this.options.minValue;this._sendNotification("warning",$.ig.util.stringFormat($.ig.Editor.locale.minValErrMsg,this.options.minValue))}if(this._focused){this._editorInput.val(currVal);this._processTextChanged()}else{noCancel=this._triggerValueChanging(currVal);if(noCancel){this._updateValue(currVal);this._exitEditMode();this._triggerValueChanged(currVal)}}this._setSpinButtonsState(currVal)},_handleSpinUpEvent:function(){var cursorPosition=this._getCursorPosition();if(this.options.dataMode==="double"||this.options.dataMode==="float"){if(this._focused){switch(this._fractionalOrIntegerSelected(cursorPosition)){case"fractional":{this._spinUp(true);this._setSelectionRange(this._editorInput[0],cursorPosition,cursorPosition)}break;case"integer":{this._spinUp();this._setSelectionRange(this._editorInput[0],cursorPosition,cursorPosition)}break;case"all":{this._spinUp();this._editorInput.select()}break;default:this._spinUp();this._editorInput.select()}}else{this._spinUp()}}else{this._spinUp()}},_handleSpinDownEvent:function(){var cursorPosition=this._getCursorPosition();if(this.options.dataMode==="double"||this.options.dataMode==="float"){if(this._focused){switch(this._fractionalOrIntegerSelected(cursorPosition)){case"fractional":{this._spinDown(true);this._setSelectionRange(this._editorInput[0],cursorPosition,cursorPosition)}break;case"integer":{this._spinDown();this._setSelectionRange(this._editorInput[0],cursorPosition,cursorPosition)}break;case"all":{this._spinDown();this._editorInput.select()}break;default:this._spinDown();this._editorInput.select()}}else{this._spinDown()}}else{this._spinDown()}},_fractionalOrIntegerSelected:function(cursorPosition){var decimalSeparator,val;if(cursorPosition===-1){return"all"}else{decimalSeparator=this.options.decimalSeparator;val=this._editorInput.val();if(val.indexOf(decimalSeparator)<0){return"all"}else{if(cursorPosition<=val.indexOf(decimalSeparator)){return"integer"}else{return"fractional"}}}},value:function(newValue){if(newValue!==undefined){if(newValue!==null&&!isNaN(this._parseNumericValueByMode(newValue,this._numericType,this.options.dataMode))){if(this._validateValue(newValue)){this._updateValue(newValue);if(!this._focused){this._editorInput.val(this._getDisplayValue())}}else{if(newValue<this.options.minValue){newValue=this.options.minValue}else if(newValue>this.options.maxValue){newValue=this.options.maxValue}this._updateValue(newValue);if(!this._focused){this._editorInput.val(this._getDisplayValue())}}this._setSpinButtonsState(newValue)}else{if(this.options.revertIfNotValid&&!(newValue===null&&this.options.allowNullValue)){newValue=this._valueInput.val()}else{this._clearValue()}}if(newValue<0){this._editorInput.addClass(this.css.negative)}else{this._editorInput.removeClass(this.css.negative)}}else{return this.options.value}},findListItemIndex:function(number){var list=this.options.listItems,i;for(i=0;i<list.length;i++){if(this._parseNumericValueByMode(list[i],this._numericType,this.options.dataMode)===number){return i}}return-1},getSelectedText:function(){throw $.ig.Editor.locale.numericEditorNoSuchMethod},getSelectionStart:function(){throw $.ig.Editor.locale.numericEditorNoSuchMethod},getSelectionEnd:function(){throw $.ig.Editor.locale.numericEditorNoSuchMethod},spinUp:function(){this._super()},spinDown:function(){this._super()},selectListIndexUp:function(){},selectListIndexDown:function(){},getRegionalOption:function(){this._getRegionalOption()}});$.widget("ui.igCurrencyEditor",$.ui.igNumericEditor,{options:{positivePattern:null,currencySymbol:null},events:{},_create:function(){$.ui.igNumericEditor.prototype._create.call(this)},_setNumericType:function(){this._numericType="currency"},_applyRegionalSettings:function(){this.options.negativeSign=this._getRegionalOption("negativeSign");this.options.currencySymbol=this._getRegionalOption("currencySymbol");this.options.positivePattern=this.options.positivePattern||this._getRegionalOption("currencyPositivePattern");this.options.negativePattern=this.options.negativePattern||this._getRegionalOption("currencyNegativePattern");this.options.decimalSeparator=this.options.decimalSeparator||this._getRegionalOption("currencyDecimalSeparator");this.options.groupSeparator=this.options.groupSeparator||this._getRegionalOption("currencyGroupSeparator");this.options.groups=this.options.groups||this._getRegionalOption("currencyGroups");this.options.maxDecimals=this.options.maxDecimals===null?this._getRegionalOption("currencyMaxDecimals"):this.options.maxDecimals;this.options.minDecimals=this.options.minDecimals===null?this._getRegionalOption("currencyMinDecimals"):this.options.minDecimals},currencySymbol:function(symbol){if(symbol){this.options.currencySymbol=symbol}else{return this.options.currencySymbol}}});$.widget("ui.igPercentEditor",$.ui.igNumericEditor,{options:{positivePattern:null,percentSymbol:null,displayFactor:100,dataMode:"float",spinDelta:.01},events:{},_create:function(){$.ui.igNumericEditor.prototype._create.call(this)},_setNumericType:function(){this._numericType="percent"},_insert:function(newValue,previousValue){if(!isNaN(newValue=this._parseNumericValueByMode(newValue,this._numericType,this.options.dataMode))){if(this.options.maxValue&&newValue/this.options.displayFactor>this.options.maxValue){newValue=this.options.maxValue*this.options.displayFactor}else if(this.options.minValue&&newValue/this.options.displayFactor<this.options.minValue){newValue=this.options.minValue*this.options.displayFactor}if(!this._validateValue(newValue/this.options.displayFactor)&&this.options.revertIfNotValid){newValue=previousValue}}else if(this.options.revertIfNotValid){newValue=previousValue}else{newValue=""}this._editorInput.val(newValue);this._setSpinButtonsState(newValue/this.options.displayFactor);this._processTextChanged()},_applyRegionalSettings:function(){this.options.negativeSign=this.options.negativeSign||this._getRegionalOption("negativeSign");this.options.percentSymbol=this.options.percentSymbol||this._getRegionalOption("percentSymbol");this.options.positivePattern=this.options.positivePattern||this._getRegionalOption("percentPositivePattern");this.options.negativePattern=this.options.negativePattern||this._getRegionalOption("percentNegativePattern");this.options.decimalSeparator=this.options.decimalSeparator||this._getRegionalOption("percentDecimalSeparator");this.options.groupSeparator=this.options.groupSeparator||this._getRegionalOption("percentGroupSeparator");this.options.groups=this.options.groups||this._getRegionalOption("percentGroups");this.options.maxDecimals=this.options.maxDecimals===null?this._getRegionalOption("percentMaxDecimals"):this.options.maxDecimals;this.options.minDecimals=this.options.minDecimals===null?this._getRegionalOption("percentMinDecimals"):this.options.minDecimals;if(this.options.displayFactor===100){this.options.maxDecimals+=2}this.options.displayFactor=this.options.displayFactor||this._getRegionalOption("displayFactor");if(typeof this.options.displayFactor!=="number"){throw new Error($.ig.Editor.locale.displayFactorIsOfTypeNumber)}else if(this.options.displayFactor!==1&&this.options.displayFactor!==100){throw new Error($.ig.Editor.locale.displayFactorAllowedValue)}},_setOption:function(option,value){var prevValue=this.options[option];if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"displayFactor":{if(typeof value!=="number"){this.options[option]=prevValue;throw new Error($.ig.Editor.locale.displayFactorIsOfTypeNumber)}else if(value!==1&&value!==100){this.options[option]=prevValue;throw new Error($.ig.Editor.locale.displayFactorAllowedValue)}}break;default:{this.options[option]=prevValue;this._super(option,value)}break}},percentSymbol:function(symbol){if(symbol){this.options.percentSymbol=symbol}else{return this.options.percentSymbol}}});$.widget("ui.igMaskEditor",$.ui.igTextEditor,{options:{regional:null,inputMask:"CCCCCCCCCC",dataMode:"allText",unfilledCharsPrompt:"_",padChar:" ",emptyChar:" "},events:{},_create:function(){$.ui.igTextEditor.prototype._create.call(this)},_initialize:function(){this._super();if(this.options.maxLength){this.options.maxLength=null}if(this.options.listItems){this.options.listItems=null}if(this._maskFlagsArray){this._maskFlagsArray=$.merge(this._maskFlagsArray,["C","&","a","A","?","L","9","0","<",">"])}else{this._maskFlagsArray=["C","&","a","A","?","L","9","0","<",">"]}},_applyOptions:function(){this._super();if(this.options.value===null||this.options.value===undefined){this._setInitialValue()}},_replaceCharAt:function(stringValue,index,ch){if(stringValue!==undefined){return stringValue.substring(0,index)+ch+stringValue.substring(index+1)}},_getStringRange:function(stringValue,start,end){if(stringValue!==undefined){return stringValue.substring(start,end)}},_replaceStringRange:function(stringValue,replacementValue,indexStart,indexEnd){var i=0;while(indexStart<=indexEnd){stringValue=this._replaceCharAt(stringValue,indexStart,replacementValue.charAt(i));i++;indexStart++}return stringValue},_enterEditMode:function(){var selection=this._getSelection(this._editorInput[0]);this._editMode=true;this._currentInputTextValue=this._editorInput.val();if(this._maskedValue===""){this._editorInput.val(this._maskWithPrompts)}else{this._editorInput.val(this._maskedValue)}this._positionCursor(selection.start,selection.end);this._processTextChanged()},_insert:function(newValue){var selection=this._getSelection(this._editorInput[0]);if(this.options.toUpper){if(newValue){newValue=newValue.toLocaleUpperCase()}}else if(this.options.toLower){if(newValue){newValue=newValue.toLocaleLowerCase()}}newValue=this._parseValueByMask(newValue);this._editorInput.val(newValue);this._processTextChanged();this._setCursorPosition(selection.start+newValue.length)},_attachEvents:function(){var self=this;self._super();this._editorInput.on({"dragend.editor":function(){self._handleDeleteKey(true)},"cut.editor":function(){self._handleDeleteKey(true)}})},_detachEvents:function(){this._super();this._editorInput.off("cut.editor dragend.editor")},_getMaskLiteralsAndRequiredPositions:function(){var mask,literalIndeces=[],requiredFieldsIndeces=[],maskFlagsArray=this._maskFlagsArray,output,maskChar,unescapedMask,i,j,isToLower=false,isToUpper=false,toLowerIndeces=[],toUpperIndeces=[];output=unescapedMask=mask=this.options.inputMask;for(i=0,j=0;i<mask.length;i++,j++){maskChar=mask.charAt(i);if($.inArray(maskChar,maskFlagsArray)!==-1){if(isToLower){toLowerIndeces.push(j)}else if(isToUpper){toUpperIndeces.push(j)}if(maskChar==="&"||maskChar==="A"||maskChar==="L"||maskChar==="0"){requiredFieldsIndeces.push(j)}else if(maskChar===">"){if(!isToUpper){isToUpper=true;if(isToLower){isToLower=false;toLowerIndeces.pop()}}else{isToUpper=false;toUpperIndeces.pop()}unescapedMask=this._replaceCharAt(unescapedMask,j,"");j--}else if(maskChar==="<"){if(!isToLower){isToLower=true;if(isToUpper){isToUpper=false;toUpperIndeces.pop()}}else{isToLower=false;toLowerIndeces.pop()}unescapedMask=this._replaceCharAt(unescapedMask,j,"");j--}}else if(maskChar==="\\"){if($.inArray(mask.charAt(i+1),maskFlagsArray)!==-1){unescapedMask=this._replaceCharAt(unescapedMask,j,"");i++}literalIndeces.push(j)}else{literalIndeces.push(j)}}this._literalIndeces=literalIndeces;this._requiredIndeces=requiredFieldsIndeces;this._toLowerIndeces=toLowerIndeces;this._toUpperIndeces=toUpperIndeces;this._unescapedMask=unescapedMask},_validateValue:function(val){return this._super(val)},_parseValueByMask:function(value){var mask=this.options.inputMask,outputVal=mask,ch,maskFlagsArray=this._maskFlagsArray,length=mask.length,i,j;value=value?value.toString():"";if(length&&length>0){for(i=0,j=0;i<length;i++,j++){ch=value.charAt(j);if(this._validateCharOnPostion(ch,i)===null){if(mask.charAt(i)==="\\"){i++;j--}else if(mask.charAt(i)==="<"||mask.charAt(i)===">"){j--}}else if(this._validateCharOnPostion(ch,i)===true){outputVal=this._replaceCharAt(outputVal,i,ch)}else{outputVal=this._replaceCharAt(outputVal,i,this.options.unfilledCharsPrompt)}}for(i=0;i<outputVal.length;i++){ch=outputVal.charAt(i);if(ch==="\\"&&$.inArray(outputVal.charAt(i+1),maskFlagsArray)!==-1){outputVal=this._replaceCharAt(outputVal,i,"")}else if(ch==="<"||ch===">"){outputVal=this._replaceCharAt(outputVal,i,"");i--}else if($.inArray(i,this._toLowerIndeces)!==-1){outputVal=this._replaceCharAt(outputVal,i,outputVal.charAt(i).toLocaleLowerCase())}else if($.inArray(i,this._toUpperIndeces)!==-1){outputVal=this._replaceCharAt(outputVal,i,outputVal.charAt(i).toLocaleUpperCase())}}}return outputVal},_getValueByDataMode:function(){var dataModeValue,regExpr,i,ch,maskedVal=this._maskedValue,dataMode=this.options.dataMode;switch(dataMode){case"allText":{regExpr=new RegExp($.ig.util.escapeRegExp(this.options.unfilledCharsPrompt),"g");dataModeValue=maskedVal.replace(regExpr,this.options.emptyChar)}break;case"rawText":{dataModeValue="";for(i=0;i<maskedVal.length;i++){ch=maskedVal.charAt(i);if($.inArray(i,this._literalIndeces)===-1&&ch!==this.options.unfilledCharsPrompt){dataModeValue+=ch}}}break;case"rawTextWithRequiredPrompts":{dataModeValue="";for(i=0;i<maskedVal.length;i++){ch=maskedVal.charAt(i);if($.inArray(i,this._literalIndeces)===-1){if(ch===this.options.unfilledCharsPrompt){if($.inArray(i,this._requiredIndeces)!==-1){dataModeValue+=this.options.emptyChar}}else{dataModeValue+=ch}}}}break;case"rawTextWithAllPrompts":{dataModeValue="";for(i=0;i<maskedVal.length;i++){ch=maskedVal.charAt(i);if($.inArray(i,this._literalIndeces)===-1){if(ch===this.options.unfilledCharsPrompt){dataModeValue+=this.options.emptyChar}else{dataModeValue+=ch}}}}break;case"rawTextWithLiterals":{dataModeValue="";for(i=0;i<maskedVal.length;i++){ch=maskedVal.charAt(i);if(ch!==this.options.unfilledCharsPrompt){dataModeValue+=ch}}}break;case"rawTextWithRequiredPromptsAndLiterals":{dataModeValue="";for(i=0;i<maskedVal.length;i++){ch=maskedVal.charAt(i);if($.inArray(i,this._literalIndeces)===-1){if(ch===this.options.unfilledCharsPrompt){if($.inArray(i,this._requiredIndeces)!==-1){dataModeValue+=this.options.emptyChar}}else{dataModeValue+=ch}}else{dataModeValue+=ch}}}break;default:{regExpr=new RegExp($.ig.util.escapeRegExp(this.options.unfilledCharsPrompt),"g");dataModeValue=this._maskedValue.replace(regExpr,this.options.emptyChar)}}return dataModeValue},_updateValue:function(value){if(value===""){if(this.options.allowNullValue){if(this.options.nullValue===null){this._valueInput.val("")}else{this._valueInput.val(this.options.nullValue)}this.options.value=this.options.nullValue}else{this.options.value="";this._valueInput.val("");this._maskedValue=""}}else{this._maskedValue=value;this.options.value=this._getValueByDataMode();this._valueInput.val(this.options.value)}},_getDisplayValue:function(){var result,maskedVal=this._maskedValue,i,j,p,maskChar,inputMask=this.options.inputMask,maskFlagsArray=this._maskFlagsArray;result=maskedVal;for(i=0,j=0,p=0;i<maskedVal.length;i++,j++,p++){if(inputMask.charAt(j)==="\\"&&$.inArray(inputMask.charAt(j+1),maskFlagsArray)!==-1){j++}if(maskedVal.charAt(i)===this.options.unfilledCharsPrompt){maskChar=inputMask.charAt(j);if(maskChar==="&"||maskChar==="A"||maskChar==="L"||maskChar==="0"){result=this._replaceCharAt(result,p,this.options.padChar)}else{result=this._replaceCharAt(result,p,"");p--}}}return result},_validateValueAgainstMask:function(value){var i,length=value.length,result=true,ch;if(length&&length>0){for(i=0;i<length;i++){ch=value.charAt(i);if(this._validateCharOnPostion(ch,i)===null){if(i+1<=length){result=this._validateCharOnPostion(ch,i+1)}}}}else{result=true}},_setInitialValue:function(value){this._maskWithPrompts=this._parseValueByMask("");this._getMaskLiteralsAndRequiredPositions();if(value===null||value===""||typeof value===undefined){this._maskedValue=""}else{this._maskedValue=this._parseValueByMask(value);this._updateValue(this._maskedValue)}},_triggerInternalValueChange:function(value){if(value===this._maskWithPrompts){value=""}var noCancel=this._triggerValueChanging(value);if(noCancel){this._processInternalValueChanging(value);this._triggerValueChanged(value);if(value!==""&&!this._validateRequiredPrompts(value)){this._sendNotification("warning",$.ig.Editor.locale.maskMessage)}}},_validateRequiredPrompts:function(value){var i;if(value===""){return false}for(i=0;i<this._requiredIndeces.length;i++){var ch=value.charAt(this._requiredIndeces[i]);if(ch===this.options.unfilledCharsPrompt){return false}}return true},_processInternalValueChanging:function(value){if(this._validateValue(value)){this._updateValue(value)}else{if(this.options.revertIfNotValid){value=this._valueInput.val();this._updateValue(value)}else{this._clearValue();value=this._valueInput.val()}}},_triggerKeyDown:function(event){var key=!event.charCode?event.which:event.charCode,ch,transformedChar,cursorStartPosition=this._getSelection(this._editorInput[0]).start;this._super(event);if(key===8){this._handleBackSpaceKey();event.preventDefault()}else if(key===46){this._handleDeleteKey();event.preventDefault()}else if($.inArray(cursorStartPosition,this._toUpperIndeces)!==-1){if(!event.ctrlKey&&!event.altKey&&(key>46&&key<91||key>145)){ch=String.fromCharCode(key);transformedChar=ch.toLocaleUpperCase();this._editorInput.val(this._replaceCharAt(this._editorInput.val(),cursorStartPosition,transformedChar));this._setCursorPosition(cursorStartPosition+1);event.preventDefault()}}else if($.inArray(cursorStartPosition,this._toLowerIndeces)!==-1){if(!event.ctrlKey&&!event.altKey&&(key>46&&key<91||key>145)){ch=String.fromCharCode(key);transformedChar=ch.toLocaleLowerCase();this._editorInput.val(this._replaceCharAt(this._editorInput.val(),cursorStartPosition,transformedChar));this._setCursorPosition(cursorStartPosition+1);event.preventDefault()}}},_triggerKeyPress:function(event){this._super(event)},_validateKey:function(event){var result,ch,key,cursorPosition=this._getCursorPosition();if(this._super(event)&&this.options.inputMask){key=!event.charCode?event.which:event.charCode;if(key!==8&&key!==46){ch=String.fromCharCode(key);if(cursorPosition===-1){cursorPosition++}while($.inArray(cursorPosition,this._literalIndeces)!==-1||cursorPosition===this._maskWithPrompts.length){cursorPosition++}result=this._validateKeyCharAgainstMask(ch,cursorPosition,this._unescapedMask);if(result===true){if($.ig.util.isFF&&event.keyCode===37){this._setSelectionRange(this._editorInput[0],cursorPosition,cursorPosition-1)}else{this._setSelectionRange(this._editorInput[0],cursorPosition,cursorPosition+1)}}}}else{result=false}return result},_validateKeyCharAgainstMask:function(ch,cursorPosition,inputMask){var mask=inputMask||this.options.inputMask,isValid;if(cursorPosition>=this._maskWithPrompts.length){isValid=false}else{if(this._validateCharOnPostion(ch,cursorPosition,mask)===null){isValid=this._validateKeyCharAgainstMask(ch,cursorPosition+1)}else{isValid=this._validateCharOnPostion(ch,cursorPosition,mask)}}return isValid},_validateCharOnPostion:function(ch,position,inputMask){var maskSymbol,mask,isValid,regex,inputChar=ch,letterOrDigitRegEx="[\\dÀ-῿Ⰰ-퟿a-zA-Z]",letterRegEx="[À-῿Ⰰ-퟿a-zA-Z]",digitRegEx="[\\d]",digitSpecialRegEx="[\\d_\\+]";mask=inputMask||this.options.inputMask;maskSymbol=mask.charAt(position);switch(maskSymbol){case"C":case"&":{if(inputChar===""){isValid=false}else{isValid=true}}break;case"a":case"A":{regex=new RegExp(letterOrDigitRegEx);if(regex.test(inputChar)){isValid=true}else{isValid=false}}break;case"?":case"L":{regex=new RegExp(letterRegEx);if(regex.test(inputChar)){isValid=true
}else{isValid=false}}break;case"0":case"9":{regex=new RegExp(digitRegEx);if(regex.test(inputChar)){isValid=true}else{isValid=false}}break;case"#":{regex=new RegExp(digitSpecialRegEx);if(regex.test(inputChar)){isValid=true}else{isValid=false}}break;default:{isValid=null}}return isValid},_setOption:function(option,value){var prevValue=this.options[option];if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"inputMask":{throw new Error($.ig.Editor.locale.cannotSetRuntime)}break;default:{this.options[option]=prevValue;this._super(option,value)}break}},_handleBackSpaceKey:function(){var selection=this._getSelection(this._editorInput[0]),startPostion=selection.start,endPosition=selection.end,index=endPosition;if(startPostion===endPosition){startPostion--}index--;for(index;index>startPostion-1;index--){while($.inArray(index,this._literalIndeces)!==-1||index===-1){index--}if(index>-1){this._editorInput.val(this._replaceCharAt(this._editorInput.val(),index,this.options.unfilledCharsPrompt));this._setCursorPosition(index)}}},_handleDeleteKey:function(skipCursorPosition){var selection=this._getSelection(this._editorInput[0]),startPostion=selection.start,endPosition=selection.end,index=startPostion;if(startPostion===endPosition){endPosition++}for(index;index<endPosition;index++){while($.inArray(index,this._literalIndeces)!==-1&&index<=this._maskWithPrompts.length){index++}if(index!==this._maskWithPrompts.length){this._editorInput.val(this._replaceCharAt(this._editorInput.val(),index,this.options.unfilledCharsPrompt));if(!skipCursorPosition){this._setCursorPosition(index+1)}}else{if(!skipCursorPosition){this._setCursorPosition(index)}}}},value:function(newValue){if(newValue!==undefined){this._setInitialValue(newValue);this._editorInput.val(this._getDisplayValue())}else{return this.options.value}},dropDownContainer:function(){throw $.ig.Editor.locale.maskEditorNoSuchMethod},showDropDown:function(){throw $.ig.Editor.locale.maskEditorNoSuchMethod},hideDropDown:function(){throw $.ig.Editor.locale.maskEditorNoSuchMethod},dropDownButton:function(){throw $.ig.Editor.locale.maskEditorNoSuchMethod},spinUpButton:function(){throw $.ig.Editor.locale.maskEditorNoSuchMethod},spinDownButton:function(){throw $.ig.Editor.locale.maskEditorNoSuchMethod},dropDownVisible:function(){throw $.ig.Editor.locale.maskEditorNoSuchMethod},findListItemIndex:function(){throw $.ig.Editor.locale.maskEditorNoSuchMethod},selectedListIndex:function(){throw $.ig.Editor.locale.maskEditorNoSuchMethod},getSelectedListItem:function(){throw $.ig.Editor.locale.maskEditorNoSuchMethod},spinUp:function(){throw $.ig.Editor.locale.maskEditorNoSuchMethod},spinDown:function(){throw $.ig.Editor.locale.maskEditorNoSuchMethod},isValid:function(){var value,valid;value=this.field().val();this._skipMessages=true;valid=this._validateValue(value);if(value!==""&&!this._validateRequiredPrompts(this._maskedValue)){valid=false;this._sendNotification("warning",$.ig.Editor.locale.maskMessage)}this._skipMessages=false;return valid}});$.widget("ui.igDateEditor",$.ui.igMaskEditor,{options:{minValue:null,maxValue:null,dateDisplayFormat:null,dateInputFormat:null,dataMode:"date",buttonType:"none",spinDelta:1,limitSpinToCurrentField:false,enableUTCDates:false,centuryThreshold:29,yearShift:0},events:{},_create:function(){$.ui.igMaskEditor.prototype._create.call(this)},_initialize:function(){this._super();this._applyRegionalSettings();this.options.inputMask=this._convertDateMaskToDigitMask(this.options.dateInputFormat);this._setNumericType();this._mvcDateRegex=/^\/Date\((.*?)\)\/$/i},_setNumericType:function(){this._numericType="datetime"},_setOption:function(option,value){var prevValue=this.options[option];if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"minValue":{this.options[option]=prevValue;throw new Error($.ig.Editor.locale.dateEditorMinValue)}case"maxValue":{this.options[option]=prevValue;throw new Error($.ig.Editor.locale.dateEditorMaxValue)}break;default:{this.options[option]=prevValue;this._super(option,value)}break}},_applyRegionalSettings:function(){var format;if(this.options.dateInputFormat!==null){format=this.options.dateInputFormat;if(format==="date"||format==="dateLong"||format==="dateTime"||format==="time"||format==="timeLong"){this.options.dateInputFormat=this._getRegionalOption(format+"Pattern")}}else{this.options.dateInputFormat=this._getRegionalOption("datePattern")}if(this.options.dateDisplayFormat!==null){format=this.options.dateDisplayFormat;if(format==="date"||format==="dateLong"||format==="dateTime"||format==="time"||format==="timeLong"){this.options.dateDisplayFormat=this._getRegionalOption(format+"Pattern")}}else{this.options.dateDisplayFormat=this.options.dateInputFormat}},_setInitialValue:function(value){this._maskWithPrompts=this._parseValueByMask("");this._getMaskLiteralsAndRequiredPositions();if(value===null||value===""||typeof value===undefined){this._maskedValue=""}else{if(this._validateValue(value)){this._updateValue(this._getDateObjectFromValue(value));this._updateMaskedValue()}this._editorInput.val(this._getDisplayValue())}},_applyOptions:function(){this._super();if(this.options.centuryThreshold>99||this.options.centuryThreshold<0){this.options.centuryThreshold=29;console.log($.ig.Editor.locale.centuryThresholdValidValues)}if(this.options.minValue){if(!this._isValidDate(new Date(this.options.minValue))){throw new Error($.ig.Editor.locale.invalidDate)}}if(this.options.maxValue){if(!this._isValidDate(new Date(this.options.maxValue))){throw new Error($.ig.Editor.locale.invalidDate)}}},_triggerKeyDown:function(event){var key=!event.charCode?event.which:event.charCode;this._super(event);if(key===38&&!(this instanceof $.ui.igDatePicker)){this._spinUpEditMode()}if(key===40&&!(this instanceof $.ui.igDatePicker)){this._spinDownEditMode()}if(key===13){this._enterEditMode()}},_handleSpinUpEvent:function(){this.spinUp(1)},_handleSpinDownEvent:function(){this.spinDown(1)},_replaceDisplayValue:function(selection,previousValue,newValue){var value=previousValue,currentIndex=selection.start,currentChar,charCode,charIndex=0,newChar;newValue=newValue.toString();while(currentIndex<previousValue.length&&charIndex<newValue.length){currentChar=previousValue.charAt(currentIndex);charCode=previousValue.charCodeAt(currentIndex);newChar=newValue.charAt(charIndex);if(charCode>=48&&charCode<=57||currentChar==="_"){value=value.substring(0,currentIndex)+newChar+value.substring(currentIndex+1,previousValue.length);charIndex++}currentIndex++}return value},_getDateField:function(flag,date){var utc=this.options.enableUTCDates,shift=this.options.yearShift,year;if(!date){date=this._dateObjectValue}if(!date){return null}if(flag==="year"){year=utc?date.getUTCFullYear():date.getFullYear();if(shift){year+=shift}return year}if(flag==="month"){return utc?date.getUTCMonth():date.getMonth()}if(flag==="day"){return utc?date.getUTCDay():date.getDay()}if(flag==="date"){return utc?date.getUTCDate():date.getDate()}if(flag==="hours"){return utc?date.getUTCHours():date.getHours()}if(flag==="minutes"){return utc?date.getUTCMinutes():date.getMinutes()}if(flag==="seconds"){return utc?date.getUTCSeconds():date.getSeconds()}return utc?date.getUTCMilliseconds():date.getMilliseconds()},_setDateField:function(flag,date,newValue){var utc=this.options.enableUTCDates,shift=this.options.yearShift;if(!date){date=this._dateObjectValue}if(flag==="year"){if(shift){newValue-=shift}if(utc){date.setUTCFullYear(newValue)}else{date.setFullYear(newValue)}}if(flag==="month"){if(utc){date.setUTCMonth(newValue)}else{date.setMonth(newValue)}}if(flag==="date"){if(utc){date.setUTCDate(newValue)}else{date.setDate(newValue)}}if(flag==="hours"){if(utc){date.setUTCHours(newValue)}else{date.setHours(newValue)}}if(flag==="minutes"){if(utc){date.setUTCMinutes(newValue)}else{date.setMinutes(newValue)}}if(flag==="seconds"){if(utc){date.setUTCSeconds(newValue)}else{date.setSeconds(newValue)}}if(flag==="miliseconds"){if(utc){date.setUTCMilliseconds(newValue)}else{date.setMilliseconds(newValue)}}return date},_updateMaskedValue:function(){var currentMaskValue=this._maskWithPrompts?this._maskWithPrompts:this._parseValueByMask(""),dateObj=this._dateObjectValue,year,month,day,hours,minutes,seconds,miliseconds;if(dateObj){if(this._dateIndices.yy!==undefined){year=this._getDateField("year",dateObj).toString();if(this._dateIndices.fourDigitYear){currentMaskValue=this._replaceStringRange(currentMaskValue,year,this._dateIndices.yy,this._dateIndices.yy+3)}else{year=year.substring(2);currentMaskValue=this._replaceStringRange(currentMaskValue,year,this._dateIndices.yy,this._dateIndices.yy+1)}}if(this._dateIndices.MM!==undefined){month=this._getDateField("month",dateObj);month++;if(month<10){month="0"+month.toString()}else{month=month.toString()}currentMaskValue=this._replaceStringRange(currentMaskValue,month,this._dateIndices.MM,this._dateIndices.MM+1)}if(this._dateIndices.dd!==undefined){day=this._getDateField("date",dateObj);if(day<10){day="0"+day.toString()}else{day=day.toString()}currentMaskValue=this._replaceStringRange(currentMaskValue,day,this._dateIndices.dd,this._dateIndices.dd+1)}if(this._dateIndices.hh!==undefined){hours=this._getDateField("hours",dateObj);if(!this._dateIndices.hh24&&hours>12){hours-=12}if(hours<10){hours="0"+hours.toString()}else{hours=hours.toString()}currentMaskValue=this._replaceStringRange(currentMaskValue,hours,this._dateIndices.hh,this._dateIndices.hh+1)}if(this._dateIndices.mm!==undefined){minutes=this._getDateField("minutes",dateObj);if(minutes<10){minutes="0"+minutes.toString()}else{minutes=minutes.toString()}currentMaskValue=this._replaceStringRange(currentMaskValue,minutes,this._dateIndices.mm,this._dateIndices.mm+1)}if(this._dateIndices.ss!==undefined){seconds=this._getDateField("seconds",dateObj);if(seconds<10){seconds="0"+seconds.toString()}else{seconds=seconds.toString()}currentMaskValue=this._replaceStringRange(currentMaskValue,minutes,this._dateIndices.ss,this._dateIndices.ss+1)}if(this._dateIndices.tt!==undefined){hours=this._getDateField("hours",dateObj);if(hours>12){if(this._dateIndices._ttLength===1){currentMaskValue=this._replaceCharAt(currentMaskValue,this._dateIndices.tt,"P")}else{currentMaskValue=this._replaceStringRange(currentMaskValue,"PM",this._dateIndices.tt,this._dateIndices.tt+1)}}else{if(this._dateIndices._ttLength===1){currentMaskValue=this._replaceCharAt(currentMaskValue,this._dateIndices.tt,"A")}else{currentMaskValue=this._replaceStringRange(currentMaskValue,"AM",this._dateIndices.tt,this._dateIndices.tt+1)}}}if(this._dateIndices.ff!==undefined){miliseconds=this._getDateField("miliseconds",dateObj);if(this._dateIndices.ffLength===1){currentMaskValue=this._replaceCharAt(currentMaskValue,this._dateIndices.ff,this._getMiliseconds(miliseconds,100).toString())}else if(this._dateIndices.ffLength===2){currentMaskValue=this._replaceStringRange(currentMaskValue,this._getMiliseconds(miliseconds,10).toString(),this._dateIndices.ff,this._dateIndices.tt+1)}else{currentMaskValue=this._replaceStringRange(currentMaskValue,miliseconds.toString(),this._dateIndices.ff,this._dateIndices.tt+2)}}}this._maskedValue=currentMaskValue},_convertDateMaskToDigitMask:function(mask){var x,i,j,flag=-1,txt="",maskVal=mask;if(!maskVal){maskVal=""}maskVal=maskVal.replace("dddd","ddd").replace("ddd,","").replace("ddd ","").replace(" ddd","").replace("ddd","");this._dateIndices={};this._dateIndices.fourDigitYear=false;maskVal=maskVal.replace(/\x08/g," ").replace(/\x09/g," ");maskVal=maskVal.replace(/\\f/g,"").replace(/\\d/g,"").replace(/\\s/g,"").replace(/\\m/g,"").replace(/\\t/g,"").replace(/\\H/g,"").replace(/\\h/g,"").replace(/\\M/g,"\b").replace(/\\y/g,"	");maskVal=maskVal.replace(/9/g,"").replace(/0/g,"");maskVal=maskVal.replace("fff","24").replace("ff","23").replace("f","22");maskVal=maskVal.replace("dddd","").replace("ddd","").replace("dd","09").replace("d","08").replace("ss","19").replace("s","18").replace("mm","17").replace("m","16");maskVal=maskVal.replace("tt","15").replace("t","14").replace("HH","13").replace("H","12").replace("hh","11").replace("h","10");maskVal=maskVal.replace("MMMM","MM").replace("MMM","MM").replace("MM","05").replace("M","04");maskVal=maskVal.replace("yyyy","03").replace("yy","02").replace("y","01");maskVal=maskVal.replace(/\x01/g,"g").replace(/\x02/g,"d").replace(/\x03/g,"s").replace(/\x04/g,"m").replace(/\x05/g,"t").replace(/\x06/g,"H").replace(/\x07/g,"h").replace(/\x08/g,"M").replace(/\x09/g,"y");for(i=0,j=0;i<maskVal.length;i++,j++){x=maskVal.charCodeAt(i);if(x<48||x>57){flag=maskVal.charAt(i);if(flag==="\\"&&i+1<maskVal.length&&$.inArray(maskVal.charAt(i+1),this._maskFlagsArray)!==-1||maskVal.charAt(i+1)===""||maskVal.charAt(i+1)===""){j--}txt+=maskVal.charAt(i);continue}flag=(x-48)*10+maskVal.charCodeAt(++i)-48;if(flag===14){txt+="L"}else if(flag===15){txt+="LL"}else if(flag===22){txt+="0"}else{txt+="00";if(flag===3){txt+="00"}while(flag>=23){txt+="0";flag--}}switch(flag){case 4:case 5:case 6:case 7:{if(this._dateIndices.MM){j++;break}else{this._dateIndices.MM=j;j++}}break;case 8:case 9:case 20:case 21:{if(this._dateIndices.dd){j++;break}else{this._dateIndices.dd=j;j++}}break;case 1:case 2:{if(this._dateIndices.yy){j++;break}else{this._dateIndices.yy=j;j++;this._dateIndices.fourDigitYear=false}}break;case 3:{if(this._dateIndices.yy){j+=3;break}else{this._dateIndices.yy=j;j+=3;this._dateIndices.fourDigitYear=true}}break;case 14:{if(this._dateIndices.tt){break}else{this._dateIndices.tt=j;j++;this._dateIndices._ttLength=1}}break;case 15:{if(this._dateIndices.tt){j++;break}else{this._dateIndices.tt=j;j++;this._dateIndices._ttLength=2}}break;case 10:case 11:{if(this._dateIndices.hh){j+=2;break}else{this._dateIndices.hh=j;this._dateIndices.hh24=false;j++}}break;case 12:case 13:{if(this._dateIndices.hh){j+=2;break}else{this._dateIndices.hh=j;this._dateIndices.hh24=true;j++}}break;case 16:case 17:{if(this._dateIndices.mm){j++;break}else{this._dateIndices.mm=j;j++}}break;case 18:case 19:{if(this._dateIndices.ss){j++;break}else{this._dateIndices.ss=j;j++}}break;case 22:{if(this._dateIndices.ff){break}else{this._dateIndices.ff=j;this._dateIndices.ffLength=1}}break;case 23:{if(this._dateIndices.ff){j++;break}else{this._dateIndices.ff=j;this._dateIndices.ffLength=2;j++}}break;case 22:{if(this._dateIndices.ff){j+=2;break}else{this._dateIndices.ff=j;this._dateIndices.ffLength=3;j+=2}}break;default:}}txt=txt.replace(/\x11/g,9).replace(/\x12/g,0);return txt},_getRegionalOption:function(key){var regional=this.options.regional;if(this.options[key]){return this.options[key]}if(typeof regional==="string"){regional=$.ig.regional[regional]}if(regional&&regional[key]){return regional[key]}else{return $.ig.regional.defaults[key]}},_validateKey:function(event){var result=true,ch,key,cursorPosition;if(this._super(event)===true){cursorPosition=this._getCursorPosition();if(cursorPosition===this._dateIndices.MM||cursorPosition-1===this._dateIndices.MM){result=this._validateMonthInput(event,cursorPosition)}else if(cursorPosition===this._dateIndices.dd||cursorPosition-1===this._dateIndices.dd){result=this._validateDayInput(event,cursorPosition)}else if(cursorPosition===this._dateIndices.hh||cursorPosition-1===this._dateIndices.hh){result=this._validateHoursInput(event,cursorPosition)}else if(cursorPosition===this._dateIndices.mm||cursorPosition-1===this._dateIndices.mm){result=this._validateMinutesInput(event,cursorPosition)}else if(cursorPosition===this._dateIndices.ss||cursorPosition-1===this._dateIndices.ss){result=this._validateSecondsInput(event,cursorPosition)}else if(cursorPosition===this._dateIndices.tt||cursorPosition-1===this._dateIndices.tt){result=this._validateMidDayInput(event,cursorPosition);if(result===true){key=!event.charCode?event.which:event.charCode;ch=String.fromCharCode(key);if(ch.toLocaleLowerCase()==="a"){this._editorInput.val(this._replaceCharAt(this._editorInput.val(),cursorPosition,"A"))}else{this._editorInput.val(this._replaceCharAt(this._editorInput.val(),cursorPosition,"P"))}if(this._dateIndices._ttLength===2){this._editorInput.val(this._replaceCharAt(this._editorInput.val(),++cursorPosition,"M"))}this._setCursorPosition(++cursorPosition);event.preventDefault()}}else{result=true}if(result===null){cursorPosition++;while($.inArray(cursorPosition,this._literalIndeces)!==-1||cursorPosition===this._maskWithPrompts.length){cursorPosition++}this._setCursorPosition(cursorPosition);result=this._validateKey(event)}if(result===false){this._setCursorPosition(cursorPosition)}}else{result=false}return result},_setBlur:function(event){var newValue,oldVal,convertedDate;if(this._cancelBlurOnInput){this._editorInput.focus();delete this._cancelBlurOnInput}else{this._triggerBlur(event);newValue=$(event.target).val();oldVal=this._dateObjectValue;convertedDate=this._parseDateFromMaskedValue(newValue);if(newValue===this._maskWithPrompts){if(oldVal){this._processValueChanging(newValue)}}else if(!oldVal){this._processValueChanging(newValue)}else if(convertedDate!==""&&convertedDate-oldVal!==0){this._processValueChanging(newValue)}this._exitEditMode();if(this._dropDownList&&this._triggerDropDownClosing()){this._hideDropDownList();this._triggerDropDownClosed()}this._focused=false;this._clearTimeouts();if(this._validator){this._validator._validateInternal(this.element,event,true)}}},_validateDayInput:function(event,position){var result=false,key=!event.charCode?event.which:event.charCode,ch=String.fromCharCode(key),num=parseInt(ch),charAtCurrentPosition=parseInt(this._editorInput.val().charAt(position)),charAtPreviousPosition,charAtNextPosition;if(position===this._dateIndices.dd){if(num<4){charAtNextPosition=parseInt(this._editorInput.val().charAt(position+1));if(!isNaN(charAtNextPosition)&&charAtNextPosition>1&&num===3){result=null}else{result=true}}else{if(!isNaN(charAtCurrentPosition)&&charAtCurrentPosition===3){result=null}else{this._setSelectionRange(this._editorInput[0],position+1,position+2);result=true}}}else{charAtPreviousPosition=parseInt(this._editorInput.val().charAt(position-1));if(!isNaN(charAtPreviousPosition)&&charAtPreviousPosition===3){if(num===0||num===1){result=true}else{result=null}}else{result=true}}return result},_validateMonthInput:function(event,position){var result=false,key=!event.charCode?event.which:event.charCode,ch=String.fromCharCode(key),num=parseInt(ch),charAtCurrentPosition=parseInt(this._editorInput.val().charAt(position)),charAtPreviousPosition,charAtNextPosition;position=position?position:this._getCursorPosition();if(position===this._dateIndices.MM){if(num<2){charAtNextPosition=parseInt(this._editorInput.val().charAt(position+1));if(!isNaN(charAtNextPosition)&&charAtNextPosition>2&&num===1){result=null}else{result=true}}else{if(!isNaN(charAtCurrentPosition)&&charAtCurrentPosition===1){if(num===2){result=true}else{result=null}}else if(this._editorInput.val().charAt(position)===this.options.unfilledCharsPrompt){if(num<2){result=true}else{result=null}}else{this._setSelectionRange(this._editorInput[0],position+1,position+2);result=true}}}else{charAtPreviousPosition=parseInt(this._editorInput.val().charAt(position-1));if(!isNaN(charAtPreviousPosition)&&charAtPreviousPosition===1){if(num===0||num===1||num===2){result=true}else{result=null}}else{result=true}}return result},_validateMidDayInput:function(evnt,position){var result=false,key=!event.charCode?event.which:event.charCode,ch=String.fromCharCode(key);position=position?position:this._getCursorPosition();if(position===this._dateIndices.tt){if(ch.toString().toLocaleLowerCase()==="a"||ch.toString().toLocaleLowerCase()==="p"){result=true}else{result=false}}else{result=null}return result},_validateHoursInput:function(event,position){var result=false,key=!event.charCode?event.which:event.charCode,ch=String.fromCharCode(key),num=parseInt(ch),charAtPreviousPosition,charAtNextPosition;position=position?position:this._getCursorPosition();if(position===this._dateIndices.hh){if(this._dateIndices.hh24){if(num===0||num===1){result=true}else if(num===2){charAtNextPosition=parseInt(this._editorInput.val().charAt(position+1));if(!isNaN(charAtNextPosition)&&charAtNextPosition>4){result=null}else{result=true}}else{result=null}}else{if(num===0){result=true}else if(num===1){charAtNextPosition=parseInt(this._editorInput.val().charAt(position+1));if(!isNaN(charAtNextPosition)&&charAtNextPosition>2){result=null}else{result=true}}else{result=null}}}else{charAtPreviousPosition=parseInt(this._editorInput.val().charAt(position-1));if(this._dateIndices.hh24){if(!isNaN(charAtPreviousPosition)&&charAtPreviousPosition===2){if(num<=4){result=true}else{result=null}}else{result=true}}else{if(!isNaN(charAtPreviousPosition)&&charAtPreviousPosition===1){if(num<=2){result=true}else{result=null}}else{result=true}}}return result},_validateMinutesInput:function(event,position){var result=false,key=!event.charCode?event.which:event.charCode,ch=String.fromCharCode(key),num=parseInt(ch);position=position?position:this._getCursorPosition();if(position===this._dateIndices.mm){if(num<6){result=true}else{result=null}}else{result=true}return result},_validateSecondsInput:function(event,position){var result=false,key=!event.charCode?event.which:event.charCode,ch=String.fromCharCode(key),num=parseInt(ch);position=position?position:this._getCursorPosition();if(position===this._dateIndices.ss){if(num<6){result=true}else{result=null}}else{result=true}return result},_fillCentury:function(year){if(!isNaN(year)){if(year>0&&year<=this.options.centuryThreshold){year=2e3+year}else if(year<100){year=1900+year}}return year},_triggerKeyPress:function(event){if(event.keyCode===13){this._processInternalValueChanging(this._editorInput.val())}else{this._super(event)}},_triggerInternalValueChange:function(value){if(value===this._maskWithPrompts){value=""}var noCancel=this._triggerValueChanging(value);if(noCancel){this._processInternalValueChanging(value);this._triggerValueChanged(value)}},_processInternalValueChanging:function(value){var parsedVal;if(value===""){this._clearValue();return}if($.type(value)==="date"){parsedVal=value}else{parsedVal=this._parseDateFromMaskedValue(value)}if(this._validateValue(parsedVal)){this._updateValue(parsedVal)}else{if(this.options.revertIfNotValid){value=this._valueInput.val();this._updateValue(value)}else{this._clearValue();value=this._valueInput.val()}}},_isValidDate:function(date){date=this._getDateObjectFromValue(date);return date.getTime()===date.getTime()},_validateValue:function(val){var result,dateObj,minValue,maxValue;if(val===null||val===""){return true}dateObj=this._getDateObjectFromValue(val);minValue=this._getDateObjectFromValue(this.options.minValue);maxValue=this._getDateObjectFromValue(this.options.maxValue);if(this._super(val)&&this._isValidDate(dateObj)){if(this.options.maxValue&&this._isValidDate(maxValue)&&dateObj>maxValue){result=false;if(this.options.revertIfNotValid){this._sendNotification("warning",$.ig.util.stringFormat($.ig.Editor.locale.maxValExceedRevertErrMsg,this.options.maxValue))}}else if(this.options.minValue&&this._isValidDate(minValue)&&dateObj<minValue){result=false;if(this.options.revertIfNotValid){this._sendNotification("warning",$.ig.util.stringFormat($.ig.Editor.locale.minValExceedRevertErrMsg,this.options.minValue))}}else{result=true}}else{result=false}return result},_updateValue:function(value){if(value===null){this._maskedValue=this._maskWithPrompts;this._valueInput.val("");this.options.value=null;this._dateObjectValue=null}else if(value===""){this._maskedValue=this._maskWithPrompts;this._valueInput.val("");this.options.value="";this._dateObjectValue=null}else{this._dateObjectValue=this._getDateObjectFromValue(value);this.options.value=this._getValueByDataMode();if(this.options.value instanceof Date){this._valueInput.val(this.options.value.toLocaleString(this.options.regional?this.options.regional:"en"))}else{this._valueInput.val(this.options.value)}}this._updateMaskedValue()},_clearValue:function(){if(this.options.allowNullValue){this._updateValue(this.options.nullValue);if(this.options.nullValue===null){this._editorInput.val(this._maskWithPrompts)}}else{this._updateValue("");this._editorInput.val(this._maskWithPrompts)}if(this._editMode===false){this._exitEditMode()}},_getDateObjectFromValue:function(value){if($.type(value)==="date"){if(this.options.enableUTCDates){value=new Date(Date.UTC(value.getFullYear(),value.getMonth(),value.getDate()))}return value}else if(this._mvcDateRegex.test(value)){return new Date(parseInt(value.replace(this._mvcDateRegex,"$1"),10))}else if(typeof value==="string"){return this._parseDateFromMaskedValue(value)}else{return new Date(value)}},_getValueByDataMode:function(){var dataModeValue,maskedVal=this._maskedValue?this._maskedValue:this._maskWithPrompts,dataMode=this.options.dataMode;switch(dataMode){case"date":{dataModeValue=this._dateObjectValue}break;case"displayModeText":{dataModeValue=this._getDisplayValue()}break;case"editModeText":{dataModeValue=maskedVal}break;default:{dataModeValue=this._dateObjectValue}}return dataModeValue},_parseDateFromMaskedValue:function(value){var dateField,monthField,yearField,hourField,minutesField,secondsField,milisecondsField,midDayField,dateStartIndex=this._dateIndices.dd,regExpr,ffCount,lastDayOfMonth,monthStartIndex=this._dateIndices.MM,yearStartIndex=this._dateIndices.yy,hourStartIndex=this._dateIndices.hh,minuteStartIndex=this._dateIndices.mm,secondsStartIndex=this._dateIndices.ss,midDayStartIndex=this._dateIndices.tt,milisecondsStartIndex=this._dateIndices.ff,extractedDate="";if(value===""||value===null||value instanceof Date){return extractedDate}if(dateStartIndex!==undefined&&dateStartIndex!==null){dateField=value.substring(dateStartIndex,dateStartIndex+2);if(dateField.indexOf(this.options.unfilledCharsPrompt)!==-1){regExpr=new RegExp($.ig.util.escapeRegExp(this.options.unfilledCharsPrompt),"g");dateField=dateField.replace(regExpr,"")}if(dateField!==""){dateField=parseInt(dateField)}else{dateField=null}}if(monthStartIndex!==undefined&&monthStartIndex!==null){monthField=value.substring(monthStartIndex,monthStartIndex+2);if(monthField.indexOf(this.options.unfilledCharsPrompt)!==-1){regExpr=new RegExp($.ig.util.escapeRegExp(this.options.unfilledCharsPrompt),"g");monthField=monthField.replace(regExpr,"")}if(monthField!==""){monthField=parseInt(monthField);monthField--}else{monthField=null}}if(yearStartIndex!==undefined&&yearStartIndex!==null){if(this._dateIndices.fourDigitYear){yearField=value.substring(yearStartIndex,yearStartIndex+4)}else{yearField=value.substring(yearStartIndex,yearStartIndex+2)}if(yearField.indexOf(this.options.unfilledCharsPrompt)!==-1){regExpr=new RegExp($.ig.util.escapeRegExp(this.options.unfilledCharsPrompt),"g");yearField=yearField.replace(regExpr,"")}if(yearField!==""){yearField=parseInt(yearField);yearField=this._fillCentury(yearField)}else{yearField=null}}if(midDayStartIndex!==undefined&&midDayStartIndex!==null){midDayField=value.substring(midDayStartIndex,midDayStartIndex+1);if(midDayField===this.options.unfilledCharsPrompt){midDayField=null}else{midDayField=midDayField.toLocaleLowerCase()}}if(hourStartIndex!==undefined&&hourStartIndex!==null){hourField=value.substring(hourStartIndex,hourStartIndex+2);if(hourField.indexOf(this.options.unfilledCharsPrompt)!==-1){regExpr=new RegExp($.ig.util.escapeRegExp(this.options.unfilledCharsPrompt),"g");hourField=hourField.replace(regExpr,"")}if(hourField!==""){hourField=parseInt(hourField);if(this._dateIndices.hh24===false){if(midDayField&&midDayField==="p"){hourField+=12}}}else{hourField=null}}if(minuteStartIndex!==undefined&&minuteStartIndex!==null){minutesField=value.substring(minuteStartIndex,minuteStartIndex+2);if(minutesField.indexOf(this.options.unfilledCharsPrompt)!==-1){regExpr=new RegExp($.ig.util.escapeRegExp(this.options.unfilledCharsPrompt),"g");minutesField=minutesField.replace(regExpr,"")}if(minutesField!==""){minutesField=parseInt(minutesField)}else{minutesField=null}}if(secondsStartIndex!==undefined&&secondsStartIndex!==null){secondsField=value.substring(secondsStartIndex,secondsStartIndex+2);if(secondsField.indexOf(this.options.unfilledCharsPrompt)!==-1){regExpr=new RegExp($.ig.util.escapeRegExp(this.options.unfilledCharsPrompt),"g");secondsField=secondsField.replace(regExpr,"")}if(secondsField!==""){secondsField=parseInt(secondsField)}else{secondsField=null}}if(milisecondsStartIndex!==undefined&&milisecondsStartIndex!==null){milisecondsField=value.substring(milisecondsStartIndex,milisecondsStartIndex+this._dateIndices.ffLength);if(milisecondsField.indexOf(this.options.unfilledCharsPrompt)!==-1){regExpr=new RegExp($.ig.util.escapeRegExp(this.options.unfilledCharsPrompt),"g");milisecondsField=milisecondsField.replace(regExpr,"")}if(milisecondsField!==""){if(milisecondsField.length<this._dateIndices.ffLength){ffCount=this._dateIndices.ffLength-milisecondsField.length;milisecondsField=parseInt(milisecondsField)*Math.pow(10,ffCount)}milisecondsField=parseInt(milisecondsField);if(this._dateIndices.ffLength===2){milisecondsField*=10}else if(this._dateIndices.ffLength===1){milisecondsField*=100}}else{milisecondsField=null}}if(!this._dateObjectValue){if(yearField!==null&&yearField!==undefined&&monthField!==null&&monthField!==undefined&&dateField!==null&&dateField!==undefined){if(this.options.enableUTCDates){extractedDate=new Date(Date.UTC(yearField,monthField,dateField))}else{extractedDate=new Date(yearField,monthField,dateField)}}else{if(this.options.enableUTCDates){extractedDate=new Date(Date.UTC())}else{extractedDate=new Date}if(yearField!==null&&yearField!==undefined){extractedDate=this._setDateField("year",extractedDate,yearField)}if(monthField!==null&&monthField!==undefined){extractedDate=this._setDateField("month",extractedDate,monthField)}if(dateField!==null&&dateField!==undefined){lastDayOfMonth=this._lastDayOfMonth(this._getDateField("year",extractedDate),this._getDateField("month",extractedDate)+1);if(dateField>lastDayOfMonth){dateField=lastDayOfMonth}extractedDate=this._setDateField("date",extractedDate,dateField)}}}else{extractedDate=new Date(this._dateObjectValue)}if(yearField!==null&&yearField!==undefined){extractedDate=this._setDateField("year",extractedDate,yearField)}if(monthField!==null&&monthField!==undefined){extractedDate=this._setDateField("month",extractedDate,monthField)}if(dateField!==null&&dateField!==undefined){lastDayOfMonth=this._lastDayOfMonth(this._getDateField("year",extractedDate),this._getDateField("month",extractedDate)+1);if(dateField>lastDayOfMonth){dateField=lastDayOfMonth}extractedDate=this._setDateField("date",extractedDate,dateField)}if(hourField!==null&&hourField!==undefined){extractedDate=this._setDateField("hours",extractedDate,hourField)}if(minutesField!==null&&minutesField!==undefined){extractedDate=this._setDateField("minutes",extractedDate,minutesField)}if(secondsField!==null&&secondsField!==undefined){extractedDate=this._setDateField("seconds",extractedDate,secondsField)}if(milisecondsField!==null&&milisecondsField!==undefined){extractedDate=this._setDateField("miliseconds",extractedDate,milisecondsField)}return extractedDate},_getDisplayValue:function(){var maskVal,dateObject=this._dateObjectValue;if(!dateObject){return""}maskVal=this.options.dateDisplayFormat;maskVal=maskVal.replace(/\x08/g," ").replace(/\x09/g," ");maskVal=maskVal.replace(/\\f/g,"").replace(/\\d/g,"").replace(/\\s/g,"").replace(/\\m/g,"").replace(/\\t/g,"").replace(/\\H/g,"").replace(/\\h/g,"").replace(/\\M/g,"\b").replace(/\\y/g,"	");maskVal=maskVal.replace(/fff/g,"030").replace(/ff/g,"031").replace(/f/g,"032");maskVal=maskVal.replace(/dddd/g,"033").replace(/ddd/g,"034").replace(/dd/g,"035").replace(/d/g,"036").replace(/ss/g,"037").replace(/s/g,"038").replace(/mm/g,"039").replace(/m/g,"040");maskVal=maskVal.replace(/tt/g,"041").replace(/t/g,"042").replace(/HH/g,"043").replace(/H/g,"044").replace(/hh/g,"045").replace(/h/g,"046");
maskVal=maskVal.replace(/MMMM/g,"047").replace(/MMM/g,"048").replace(/MM/g,"049").replace(/M/g,"050");maskVal=maskVal.replace(/yyyy/g,"051").replace(/yy/g,"052").replace(/y/g,"053");maskVal=maskVal.replace(/\x10030/g,this._getMiliseconds(this._getDateField("miliseconds",dateObject),1)).replace(/\x10031/g,this._getMiliseconds(this._getDateField("miliseconds",dateObject),10)).replace(/\x10032/g,this._getMiliseconds(this._getDateField("miliseconds",dateObject),100));maskVal=maskVal.replace(/\x10033/g,this._getDay(this._getDateField("day",dateObject),"dddd")).replace(/\x10034/g,this._getDay(this._getDateField("day",dateObject),"ddd")).replace(/\x10035/g,this._getDate(this._getDateField("date",dateObject),"dd")).replace(/\x10036/g,this._getDate(this._getDateField("date",dateObject),"d")).replace(/\x10037/g,this._getSeconds(this._getDateField("seconds",dateObject),"ss")).replace(/\x10038/g,this._getSeconds(this._getDateField("seconds",dateObject),"s")).replace(/\x10039/g,this._getMinutes(this._getDateField("minutes",dateObject),"mm")).replace(/\x10040/g,this._getMinutes(this._getDateField("minutes",dateObject),"m")).replace(/\x10041/g,this._getAMorPM(this._getDateField("hours",dateObject),"tt")).replace(/\x10042/g,this._getAMorPM(this._getDateField("hours",dateObject),"t")).replace(/\x10043/g,this._getHours(this._getDateField("hours",dateObject),"HH")).replace(/\x10044/g,this._getHours(this._getDateField("hours",dateObject),"H")).replace(/\x10045/g,this._getHours(this._getDateField("hours",dateObject),"hh")).replace(/\x10046/g,this._getHours(this._getDateField("hours",dateObject),"h"));maskVal=maskVal.replace(/\x10047/g,this._getMonth(this._getDateField("month",dateObject),"MMMM")).replace(/\x10048/g,this._getMonth(this._getDateField("month",dateObject),"MMM")).replace(/\x10049/g,this._getMonth(this._getDateField("month",dateObject),"MM")).replace(/\x10050/g,this._getMonth(this._getDateField("month",dateObject),"M"));maskVal=maskVal.replace(/\x10051/g,this._getYear(this._getDateField("year",dateObject),"yyyy")).replace(/\x10052/g,this._getYear(this._getDateField("year",dateObject),"yy")).replace(/\x10053/g,this._getYear(this._getDateField("year",dateObject),"y"));maskVal=maskVal.replace(/\x01/g,"g").replace(/\x02/g,"d").replace(/\x03/g,"s").replace(/\x04/g,"m").replace(/\x05/g,"t").replace(/\x06/g,"H").replace(/\x07/g,"h").replace(/\x08/g,"M").replace(/\x09/g,"y");return maskVal},_getMiliseconds:function(miliseconds,flag){return parseInt(miliseconds/flag)},_getSeconds:function(seconds,flag){var result;if(flag==="ss"&&seconds<10){result="0"+seconds.toString()}else{result=seconds.toString()}return result},_getMinutes:function(minutes,flag){var result;if(flag==="mm"&&minutes<10){result="0"+minutes.toString()}else{result=minutes.toString()}return result},_getAMorPM:function(hours,flag){var result;if(hours>=12){result=this._getRegionalOption("pm")}else{result=this._getRegionalOption("am")}if(flag==="t"){result=result.charAt(0)}return result},_getHours:function(hours,flag){var result;switch(flag){case"h":{if(hours>12){hours-=12}result=hours.toString()}break;case"hh":{if(hours>12){hours-=12}if(hours<10){result="0"+hours.toString()}else{result=hours.toString()}}break;case"H":{result=hours.toString()}break;case"HH":{if(hours<10){result="0"+hours.toString()}else{result=hours.toString()}}break}return result},_getDate:function(date,flag){var result;switch(flag){case"dd":{if(date<10){result="0"+date.toString()}else{result=date}}break;case"d":{result=date.toString()}break}return result},_getDay:function(day,flag){var result;switch(flag){case"dddd":{result=this._getRegionalOption("dayNames")[day]}break;case"ddd":{result=this._getRegionalOption("dayNamesShort")[day]}break}return result},_getMonth:function(month,flag){var result;switch(flag){case"MMMM":{result=this._getRegionalOption("monthNames")[month]}break;case"MMM":{result=this._getRegionalOption("monthNamesShort")[month]}break;case"MM":{month++;if(month<10){result="0"+month.toString()}else{result=month}}break;case"M":{month++;result=month.toString()}break}return result},_getYear:function(year,flag){var result;if(flag==="yy"){result=year.toString().substring(2)}else if(flag==="y"){result=parseInt(year.toString().substring(2)).toString()}else{result=year.toString()}return result},_handleBackSpaceKey:function(){var cursorPosition;this._super();cursorPosition=this._getSelection(this._editorInput[0]).start;if(cursorPosition===this._dateIndices.tt||cursorPosition-1===this._dateIndices.tt){if(this._dateIndices._ttLength===2){if(cursorPosition===this._dateIndices.tt){this._setCursorPosition(cursorPosition+1);$.ui.igMaskEditor.prototype._handleDeleteKey.call(this);this._setCursorPosition(cursorPosition)}else{this._super()}}}},_handleDeleteKey:function(skipCursorPosition){var cursorPosition;this._super(skipCursorPosition);cursorPosition=this._getSelection(this._editorInput[0]).start;if(cursorPosition-2===this._dateIndices.tt||cursorPosition-1===this._dateIndices.tt){if(this._dateIndices._ttLength===2){if(cursorPosition-1===this._dateIndices.tt){this._super()}else{if(!skipCursorPosition){this._setCursorPosition(cursorPosition-1)}$.ui.igMaskEditor.prototype._handleBackSpaceKey.call(this);if(!skipCursorPosition){this._setCursorPosition(cursorPosition)}}}}},_setMillisecondsEditMode:function(mask,time,currentMilliseconds,delta){var isLimited=this.options.limitSpinToCurrentField,newMilliseconds,secondsUpdateDelta=0,currentSecond,timeSecond;if(currentMilliseconds+delta>=60){if(isLimited){newMilliseconds=currentMilliseconds}else{newMilliseconds=currentMilliseconds+delta-60;secondsUpdateDelta=1}}else if(currentMilliseconds+delta<1){if(isLimited){newMilliseconds=currentMilliseconds}else{if(currentMilliseconds+delta===0){newMilliseconds=0}else{newMilliseconds=60+(currentMilliseconds+delta);secondsUpdateDelta=-1}}}else{newMilliseconds=currentMilliseconds+delta}mask=this._setTimeEditMode(mask,time,currentMilliseconds,newMilliseconds);if(secondsUpdateDelta!==undefined&&secondsUpdateDelta!==0){timeSecond=this._createSecondsPosition();currentSecond=parseInt(this._getStringRange(mask,timeSecond.startPosition,timeSecond.endPosition),10);mask=this._setSecondsEditMode(mask,timeSecond,currentSecond,secondsUpdateDelta)}return mask},_setSecondsEditMode:function(mask,time,currentSecond,delta){var isLimited=this.options.limitSpinToCurrentField,newSecond,minuteUpdateDelta=0,currentMinute,timeMinute;if(currentSecond+delta>=60){if(isLimited){newSecond=currentSecond}else{newSecond=currentSecond+delta-60;minuteUpdateDelta=1}}else if(currentSecond+delta<1){if(isLimited){newSecond=currentSecond}else{if(currentSecond+delta===0){newSecond=0}else{newSecond=60+(currentSecond+delta);minuteUpdateDelta=-1}}}else{newSecond=currentSecond+delta}mask=this._setTimeEditMode(mask,time,currentSecond,newSecond);if(minuteUpdateDelta!==undefined&&minuteUpdateDelta!==0){timeMinute=this._createMinutesPosition();currentMinute=parseInt(this._getStringRange(mask,timeMinute.startPosition,timeMinute.endPosition),10);mask=this._setMinutesEditMode(mask,timeMinute,currentMinute,minuteUpdateDelta)}return mask},_setMinutesEditMode:function(mask,time,currentMinute,delta){var isLimited=this.options.limitSpinToCurrentField,newMinute,hourUpdateDelta=0,currentHour,timeHour;if(currentMinute+delta>=60){if(isLimited){newMinute=currentMinute}else{newMinute=currentMinute+delta-60;hourUpdateDelta=1}}else if(currentMinute+delta<1){if(isLimited){newMinute=currentMinute}else{if(currentMinute+delta===0){newMinute=0}else{newMinute=60+(currentMinute+delta);hourUpdateDelta=-1}}}else{newMinute=currentMinute+delta}mask=this._setTimeEditMode(mask,time,currentMinute,newMinute);if(hourUpdateDelta!==undefined&&hourUpdateDelta!==0){timeHour=this._createHoursPosition();currentHour=parseInt(this._getStringRange(mask,timeHour.startPosition,timeHour.endPosition),10);mask=this._setHoursEditMode(mask,timeHour,currentHour,hourUpdateDelta)}return mask},_setHoursEditMode:function(mask,time,currentHour,delta){var isLimited=this.options.limitSpinToCurrentField,newHour,dayUpdateDelta=0,currentDay,timeDay;if(currentHour+delta>=24){if(isLimited){newHour=currentHour}else{newHour=currentHour+delta-24;dayUpdateDelta=1}}else if(currentHour+delta<1){if(isLimited){newHour=currentHour}else{if(currentHour+delta===0){newHour=0}else{newHour=24+(currentHour+delta);dayUpdateDelta=-1}}}else{newHour=currentHour+delta}mask=this._setTimeEditMode(mask,time,currentHour,newHour);if(dayUpdateDelta!==undefined&&dayUpdateDelta!==0){timeDay=this._createDayPosition();currentDay=parseInt(this._getStringRange(mask,timeDay.startPosition,timeDay.endPosition),10);mask=this._setDayEditMode(mask,timeDay,currentDay,dayUpdateDelta)}return mask},_setAmOrPmEditMode:function(mask,time,currentAmOrPm){var newAmOrPm;if(currentAmOrPm.toLocaleLowerCase()==="am"){newAmOrPm="PM"}else{newAmOrPm="AM"}mask=this._setTimeEditMode(mask,time,currentAmOrPm,newAmOrPm);return mask},_lastDayOfMonth:function(year,month){var day;if(month===1||month===3||month===5||month===7||month===8||month===10||month===12){day=31}else if(month===4||month===6||month===9||month===11){day=30}else if(month===2&&year%4===0){day=29}else if(month===2&&year%4!==0){day=28}return day},_setDayEditMode:function(mask,time,currentDay,delta){var isLimited=this.options.limitSpinToCurrentField,currentYear,currentMonth,lastDayOfMonth,lastDayOfPreviousMonth,newDay,monthUpdateDelta,timeYear,timeMonth;timeYear=this._createYearPosition();currentYear=parseInt(this._getStringRange(mask,timeYear.startPosition,timeYear.endPosition),10);timeMonth=this._createMonthPosition();currentMonth=parseInt(this._getStringRange(mask,timeMonth.startPosition,timeMonth.endPosition),10);lastDayOfMonth=this._lastDayOfMonth(currentYear,currentMonth);lastDayOfPreviousMonth=this._lastDayOfMonth(currentYear,currentMonth-1!==0?currentMonth-1:12);if(currentDay+delta>lastDayOfMonth){if(isLimited){newDay=currentDay}else{newDay=currentDay+delta-lastDayOfMonth;monthUpdateDelta=1}}else if(currentDay+delta<1){if(isLimited){newDay=currentDay}else{newDay=lastDayOfPreviousMonth+(currentDay+delta);monthUpdateDelta=-1}}else{newDay=currentDay+delta}mask=this._setTimeEditMode(mask,time,currentDay,newDay);if(monthUpdateDelta!==undefined&&monthUpdateDelta!==0){mask=this._setMonthEditMode(mask,timeMonth,currentMonth,monthUpdateDelta)}return mask},_setDayDisplayMode:function(newDay){var oldDay=parseInt(this._getDateField("date"),10),date=this._dateObjectValue;if(!date){date=new Date}if(newDay!==oldDay){this._setDateField("date",date,newDay);this._triggerInternalValueChange(date);this._editorInput.val(this._getDisplayValue())}},_setMonthEditMode:function(mask,time,currentMonth,delta){var isLimited=this.options.limitSpinToCurrentField,newMonth,yearUpdateDelta=0,currentYear,timeYear;if(currentMonth+delta>12){if(isLimited){newMonth=currentMonth}else{newMonth=currentMonth+delta-12;yearUpdateDelta=1}}else if(currentMonth+delta<1){if(isLimited){newMonth=currentMonth}else{newMonth=12+(currentMonth+delta);yearUpdateDelta=-1}}else{newMonth=currentMonth+delta}mask=this._setTimeEditMode(mask,time,currentMonth,newMonth);if(yearUpdateDelta!==undefined&&yearUpdateDelta!==0){timeYear=this._createYearPosition();currentYear=parseInt(this._getStringRange(mask,timeYear.startPosition,timeYear.endPosition),10);mask=this._setYearEditMode(mask,timeYear,currentYear,yearUpdateDelta)}return mask},_setYearEditMode:function(mask,time,currentYear,delta){var newYear;if(currentYear+delta<0){newYear=currentYear}else{newYear=currentYear+delta}mask=this._setTimeEditMode(mask,time,currentYear,newYear);return mask},_setTimeEditMode:function(mask,time,currentValue,newValue){var newValueAsString;newValueAsString=newValue.toString();if(newValueAsString.length===1){newValueAsString="0"+newValueAsString}mask=this._replaceStringRange(mask,newValueAsString,time.startPosition,time.endPosition-1);return mask},_createYearPosition:function(){var time=null;if(this._dateIndices.yy!==undefined){time={};time.name="year";time.startPosition=this._dateIndices.yy;time.length=this._dateIndices.fourDigitYear?4:2;time.endPosition=time.startPosition+time.length}return time},_createMonthPosition:function(){var time=null;if(this._dateIndices.MM!==undefined){time={};time.name="month";time.startPosition=this._dateIndices.MM;time.length=2;time.endPosition=time.startPosition+time.length}return time},_createDayPosition:function(){var time=null;if(this._dateIndices.dd!==undefined){time={};time.name="day";time.startPosition=this._dateIndices.dd;time.length=2;time.endPosition=time.startPosition+time.length}return time},_createAmOrPmPosition:function(){var time=null;if(this._dateIndices.tt!==undefined){time={};time.name="amOrPm";time.startPosition=this._dateIndices.tt;time.length=2;time.endPosition=time.startPosition+time.length}return time},_createHoursPosition:function(){var time=null;if(this._dateIndices.hh!==undefined){time={};time.name="hours";time.startPosition=this._dateIndices.hh;time.length=2;time.endPosition=time.startPosition+time.length}return time},_createMinutesPosition:function(){var time=null;if(this._dateIndices.mm!==undefined){time={};time.name="minutes";time.startPosition=this._dateIndices.mm;time.length=2;time.endPosition=time.startPosition+time.length}return time},_createSecondsPosition:function(){var time=null;if(this._dateIndices.ss!==undefined){time={};time.name="seconds";time.startPosition=this._dateIndicess.ss;time.length=2;time.endPosition=time.startPosition+time.length}return time},_createMillisecondsPosition:function(){var time=null;if(this._dateIndices.ff!==undefined){time={};time.name="milliseconds";time.startPosition=this._dateIndices.ff;time.length=2;time.endPosition=time.startPosition+time.length}return time},_getTimePosition:function(){var cursorPosition=this._getCursorPosition(),indices=this._dateIndices,time=null;if(cursorPosition<0){cursorPosition=0}if(cursorPosition>=indices.yy&&(indices.fourDigitYear&&cursorPosition<=indices.yy+4||indices.fourDigitYear===undefined&&indices.yy+2)){time=this._createYearPosition()}else if(cursorPosition>=indices.MM&&cursorPosition<=indices.MM+2){time=this._createMonthPosition()}else if(cursorPosition>=indices.dd&&cursorPosition<=indices.dd+2){time=this._createDayPosition()}else if(cursorPosition>=indices.tt&&cursorPosition<=indices.tt+2){time=this._createAmOrPmPosition()}else if(cursorPosition>=indices.hh&&cursorPosition<=indices.hh+2){time=this._createHoursPosition()}else if(cursorPosition>=indices.mm&&cursorPosition<=indices.mm+2){time=this._createMinutesPosition()}else if(cursorPosition>=indices.ss&&cursorPosition<=indices.ss+2){time=this._createSecondsPosition()}else if(cursorPosition>=indices.ff&&cursorPosition<=indices.ff+2){time=this._createMillisecondsPosition()}return time},_updateTimeMask:function(mask,time,delta){var currentValue;currentValue=parseInt(this._getStringRange(mask,time.startPosition,time.endPosition),10);switch(time.name){case"year":mask=this._setYearEditMode(mask,time,currentValue,delta);break;case"month":mask=this._setMonthEditMode(mask,time,currentValue,delta);break;case"day":mask=this._setDayEditMode(mask,time,currentValue,delta);break;case"amOrPm":currentValue=this._getStringRange(mask,time.startPosition,time.endPosition);mask=this._setAmOrPmEditMode(mask,time,currentValue);break;case"hours":mask=this._setHoursEditMode(mask,time,currentValue,delta);break;case"minutes":mask=this._setMinutesEditMode(mask,time,currentValue,delta);break;case"seconds":mask=this._setSecondsEditMode(mask,time,currentValue,delta);break;case"milliseconds":mask=this._setMillisecondsEditMode(mask,time,currentValue,delta);break}return mask},_initEmptyMask:function(){var mask=this._maskWithPrompts,today=new Date,timeYear,timeMonth,timeDay,timeHours,timeAmOrPM,timeMinutes,timeSeconds,timeMilliseconds,year,month,day;timeYear=this._createYearPosition();timeMonth=this._createMonthPosition();timeDay=this._createDayPosition();timeHours=this._createHoursPosition();timeAmOrPM=this._createAmOrPmPosition;timeMinutes=this._createMinutesPosition();timeSeconds=this._createSecondsPosition();timeMilliseconds=this._createMillisecondsPosition();year=today.getFullYear();month=today.getMonth()+1;day=today.getDate();if(timeYear){mask=this._setYearEditMode(mask,timeYear,year,0)}if(timeMonth){mask=this._setMonthEditMode(mask,timeMonth,month,0)}if(timeDay){mask=this._setDayEditMode(mask,timeDay,day,0)}if(timeHours){mask=this._setHoursEditMode(mask,timeHours,0,0)}if(timeAmOrPM){mask=this._setAmOrPmEditMode(mask,timeAmOrPM,"AM",0)}if(timeMinutes){mask=this._setMinutesEditMode(mask,timeMinutes,0,0)}if(timeSeconds){mask=this._setSecondsEditMode(mask,timeSeconds,0,0)}if(timeMilliseconds){mask=this._setMillisecondsEditMode(mask,timeMilliseconds,0,0)}return mask},_spinEditMode:function(delta){var self=this,cursorPosition=this._getCursorPosition(),mask=this._editorInput.val(),time;time=this._getTimePosition();if(!time){return}if(mask===undefined){return}else if(mask===""||mask===this._maskWithPrompts){mask=this._initEmptyMask()}else{mask=this._updateTimeMask(mask,time,delta)}this._maskedValue=mask;this._editorInput.val(mask);if($.ig.util.isChrome||$.ig.util.isSafari){this._timeouts.push(setTimeout(function(){self._setCursorPosition(cursorPosition)},0))}else{self._setCursorPosition(cursorPosition)}},_spinUpEditMode:function(delta){this._spinEditMode(delta?delta:this.options.spinDelta)},_spinDownEditMode:function(delta){this._spinEditMode(delta?-delta:-this.options.spinDelta)},_spin:function(delta){var day;this._currentInputTextValue=this._editorInput.val();if(this._editMode){this._spinEditMode(delta)}else{day=this._getDateField("date");if(day===null){day=this._getDateField("date",new Date);delta=0}this._setDayDisplayMode(day+delta)}this._processTextChanged()},value:function(newValue){if(newValue!==undefined){if(this._validateValue(newValue)){this._updateValue(newValue);this._updateMaskedValue()}this._editorInput.val(this._editMode?this._maskedValue:this._getDisplayValue())}else{if(this.options.value instanceof Date){return new Date(this.options.value.getTime())}else if(this._maskedValue!==""&&this._maskedValue!==this._parseValueByMask("")){if(this.options.dataMode==="date"){return new Date(this._maskedValue)}else if(this.options.dataMode==="editModeText"){return this._maskedValue}else if(this.options.dataMode==="displayModeText"){return this._getDisplayValue()}}else{if(this.options.allowNullValue){return this.options.nullValue}else{return""}}}},getSelectedDate:function(){return this._dateObjectValue},selectDate:function(date){this._updateValue(date);this._exitEditMode()},spinUp:function(delta){this._spin(delta?delta:this.options.spinDelta)},spinDown:function(delta){this._spin(delta?-delta:-this.options.spinDelta)},isValid:function(){var value,valid;value=this.field().val();this._skipMessages=true;valid=this._validateValue(this._dateObjectValue);if(value!==""&&!valid){valid=false;this._sendNotification("warning",$.ig.Editor.locale.dateMessage)}this._skipMessages=false;return valid}});$.widget("ui.igDatePicker",$.ui.igDateEditor,{options:{regional:null,buttonType:"dropdown",datepickerOptions:null},events:{},_setDropDownListWidth:function(){},_renderList:function(){var self=this,options,regional;regional=$.extend(self.options.datepickerOptions,self._dpRegion())||{};options=$.extend(regional,{showOn:"",duration:self.options.dropDownAnimationDuration?self.options.dropDownAnimationDuration:"normal",onClose:function(val){var date;self._currentInputTextValue=self._editorInput.val();date=new Date(val);if(self.options.enableUTCDates){date=new Date(Date.UTC(date.getFullYear(),date.getMonth(),date.getDate()))}self._processValueChanging(date);self._processTextChanged();self._editorInput.focus()}});this._editorInput.datepicker(options);this._dropDownList=this._editorInput.datepicker("widget");this._dropDownList.hide()},_renderDropDownButton:function(){var dropDownButton=$("<div></div>"),dropDownIcon=$("<div></div>");if(this._dropDownButton){return}dropDownButton.addClass(this.css.buttonCommon);dropDownButton.attr("title",this._getLocaleOption("datePickerButtonTitle"));this._editorContainer.prepend(dropDownButton.addClass(this.css.dropDownButton).append(dropDownIcon.addClass(this.css.dropDownImage)));this._dropDownButton=dropDownButton;this._attachButtonsEvents("dropdown",dropDownButton)},_dpRegion:function(){var reg=this.options.regional,lastRegional,regional;regional=$.datepicker&&typeof reg==="string"?$.datepicker.regional[reg==="defaults"||reg==="en-US"?"":reg]:null;if(regional===null&&$.datepicker){for(lastRegional in $.datepicker.regional){}if($.datepicker.regional[lastRegional]){regional=$.datepicker.regional[lastRegional]}}return regional},_create:function(){$.ui.igDateEditor.prototype._create.call(this)},_initialize:function(){this._super();this.options.listItems=["datePicker"]},_applyOptions:function(){this._super();if(!this.options.minValue&&this.options.datepickerOptions&&this.options.datepickerOptions.minDate){if(this._isValidDate(this.options.datepickerOptions.minDate)){this.options.minValue=this.options.datepickerOptions.minDate}}if(!this.options.maxValue&&this.options.datepickerOptions&&this.options.datepickerOptions.maxDate){if(this._isValidDate(this.options.datepickerOptions.minDate)){this.options.maxValue=this.options.datepickerOptions.maxDate}}},_setOption:function(option,value){var prevValue=this.options[option];if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"buttonType":{if(value!=="dropdown"){this.options[option]=prevValue;throw new Error($.ig.Editor.locale.buttonTypeIsDropDownOnly)}}break;default:{this.options[option]=prevValue;this._super(option,value)}break}},_triggerKeyDown:function(event){if(event.keyCode===38&&!event.altKey){if(!event.ctrlKey){this._spinUpEditMode()}}else if(event.keyCode===40&&!event.altKey){if(!event.ctrlKey){this._spinDownEditMode()}}else{this._super(event)}},_triggerDropDownOpened:function(){var args={owner:this,editorInput:this._editorInput,calendar:this._dropDownList};this._trigger(this.events.dropDownListOpened,null,args)},_triggerDropDownOpeninng:function(){var args={owner:this,editorInput:this._editorInput,calendar:this._dropDownList};return this._trigger(this.events.dropDownListOpening,null,args)},_showDropDownList:function(){var self=this,direction;this._cancelBlurDatePickerOpen=true;this._positionDropDownList();if(this._dropDownListOrientation==="up"){direction="up"}else{direction="down"}if(this.value()){$(this._editorInput).datepicker("setDate",this.value())}try{this._editorInput.datepicker("option","showOptions",{direction:direction});this._editorInput.datepicker("show")}catch(ex){this._editorInput.datepicker("show")}this._dropDownList.promise().done(function(){self._triggerDropDownOpened()})},getCalendar:function(){$.ui.igTextEditor.prototype.dropDownContainer.call(this)},dropDownContainer:function(){throw $.ig.Editor.locale.datePickerNoSuchMethodDropDownContainer},showDropDown:function(){$.ui.igTextEditor.prototype.showDropDown.call(this)},hideDropDown:function(){$.ui.igTextEditor.prototype.hideDropDown.call(this)},dropDownButton:function(){$.ui.igTextEditor.prototype.dropDownButton.call(this)},dropDownVisible:function(){$.ui.igTextEditor.prototype.dropDownVisible.call(this)}});$.widget("ui.igCheckboxEditor",$.ui.igBaseEditor,{options:{checked:false,size:"normal",iconClass:"ui-icon-check",tabIndex:0},css:{container:"ui-state-default ui-corner-all ui-widget ui-checkbox-container ui-igcheckbox-normal",containerChecked:"ui-state-checkbox-checked",checkboxIcon:"ui-icon",iconCentered:"ui-icon-custom",checked:"ui-igcheckbox-normal-on",unchecked:"ui-igcheckbox-normal-off",checkboxInput:"ui-helper-hidden"},events:{keydown:"keydown",keypress:"keypress",keyup:"keyup"},_triggerKeyUp:function(event){var args={originalEvent:event,owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.keyup,event,args)},_triggerKeyPress:function(event){var args={originalEvent:event,owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.keypress,event,args)},_triggerKeyDown:function(event){var args={originalEvent:event,owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.keydown,event,args)},_create:function(){this._checkedClass=this.css.checked;this._uncheckedClass=this.css.unchecked;$.ui.igBaseEditor.prototype._create.call(this)},_render:function(){this._triggerRendering();if(this.element.is("div")){this._editorContainer=this.element;this._editorInput=$("<span></span>");this._valueInput=$("<input type='checkbox'></input>");this._editorContainer.prepend(this._editorInput);this._editorInput.after(this._valueInput)}else if(this.element.is("input")){this._valueInput=this.element;this._editorInput=$("<span></span>");this._editorContainer=this.element.wrap($("<div></div>")).parent();this._valueInput.before(this._editorInput)}else if(this.element.is("span")){this._editorInput=this.element;this._valueInput=$("<input type='checkbox'></input>");this._editorContainer=this.element.wrap($("<div></div>")).parent();this._editorInput.after(this._valueInput)}else{throw $.ig.Editor.locale.instantiateCheckBoxErrMsg}this._editorContainer.addClass(this.css.container).attr("role","checkbox");this._editorInput.addClass(this.css.checkboxIcon).addClass(this.options.iconClass).addClass(this.css.checked);this._valueInput.addClass(this.css.checkboxInput).attr("aria-hidden","true");if(!$.ig.util.isIE8&&this._valueInput.attr("type")!=="checkbox"){this._valueInput.attr("type","checkbox")}this._attachEvents();this._applyOptions();this._applyAria();this._triggerRendered()},_applyAria:function(){var ariaLabeledBy=this.element.attr("aria-labelledby");if(ariaLabeledBy){this.element.removeAttr("aria-labelledby");this._editorContainer.attr("aria-labelledby",ariaLabeledBy)}},_applyOptions:function(){var checked=this.options.checked;this._super();if(checked){this._initialState()}else{this.options.checked=false}if(this.options.value){this._inputValue=this.options.value;this.value(this.options.value)}this._size(this.options.size);this._setWidth(this.options.width);this._setHeight(this.options.height);this._updateState(checked&&checked!=="false"?true:false)},_setOption:function(option,value){var iconClass=this.options.iconClass;this._super(option,value);switch(option){case"checked":this._updateState(value&&value!=="false"?true:false);break;case"value":this._inputValue=value;this._updateState(this.options.checked);break;case"size":this._size(value);break;case"iconClass":this._setIconClass(iconClass,value);break;default:break}},_readAttributes:function(){var checked=this.element.attr("checked");this._super(this.element);if(checked){this.element.removeAttr("checked");this.options.checked=true}},_attachEvents:function(){var self=this;this._super();this._editorContainer.on({"click.editor":function(event){self._toggleInternal(event)},"mousedown.editor":function(event){this.focus();event.preventDefault();return false},"focus.editor":function(event){self._setFocus(event,self._cancelFocusTrigger)},"blur.editor":function(event){self._setBlur(event)},"keyup.editor":function(event){var keyCode=event.keyCode||event.which||0;self._triggerKeyUp(event);if(keyCode===32){self._toggleInternal(event);event.preventDefault()}},"keydown.editor":function(event){self._triggerKeyDown(event)},"keypress.editor":function(event){var keyCode=event.keyCode||event.which||0;self._triggerKeyPress(event);if(keyCode===32){event.preventDefault()}}})},_triggerValueChanging:function(event,newState,newValue){var args={owner:this,element:event.target,editorInput:this._editorInput,oldState:this.options.checked,newState:newState,oldValue:this.value(),newValue:newValue};return this._trigger(this.events.valueChanging,event,args)},_triggerValueChanged:function(event){var args={owner:this,element:event.target,editorInput:this._editorInput,newState:this.options.checked,newValue:this.value()};this._trigger(this.events.valueChanged,event,args);this._trigger(this.options.checked?this.events.checked:this.events.unchecked,event,args)},_triggerFocus:function(event){var args={originalEvent:event,owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.focus,event,args)},_triggerBlur:function(event){var args={owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.blur,event,args)},_updateValue:function(value){this.options.value=value;this._valueInput.val(value)},_getState:function(){var state;if(this._inputValue!==undefined){state=this._valueInput[0].checked}else{var value=this._tryParseBool(this._valueInput[0].value);if(value.ret){state=value.p1}else{throw $.ig.Editor.locale.cannotParseNonBoolValue}}return state},_tryParseBool:function(value){if(typeof value==="boolean"){return{ret:true,p1:value}}else if(typeof value==="string"){return $.ig.Boolean.prototype.tryParse(value)}},_toggleInternal:function(event){var noCancel,newState,newVal;newState=!this._getState();newVal=this.value();if(this._inputValue===undefined){newVal=newState}noCancel=this._triggerValueChanging(event,newState,newVal);if(noCancel){this._updateState(newState);this._triggerValueChanged(event);if(this._validator){this._validator._validateInternal(this.element,event)}}},_initialState:function(){this._valueInput.attr("checked","checked")},_updateState:function(value){this.options.checked=value;this._editorContainer.attr("aria-checked",value);if(value){this._editorInput.removeClass(this._uncheckedClass);this._editorContainer.addClass(this.css.containerChecked)}else{this._editorInput.addClass(this._uncheckedClass);this._editorContainer.removeClass(this.css.containerChecked)}if(this._inputValue!==undefined){this._valueInput[0].checked=value;this._valueInput[0].value=this._inputValue}else{this._valueInput[0].checked=true;this._valueInput[0].value=value}},_removeDOM:function(){if(this.element.is("div")){this.element.empty()}else if(this.element.is("input")){this._editorInput.remove();this.element.unwrap()}else if(this.element.is("span")){this._valueInput.remove();this.element.unwrap()}},_detachEvents:function(){this._editorContainer.off("click.editor mousedown.editor focus.editor blur.editor keydown.editor");this._super()},_clearStyling:function(){this._editorContainer.removeClass(this.css.checkboxContainer).removeClass(this.css.containerChecked).removeAttr("role");this._editorInput.removeClass(this._checkedClass).removeClass(this._uncheckedClass).removeClass(this.css.checkboxIcon).removeClass(this.options.iconClass);this._valueInput.removeClass(this.css.checkboxInput).removeAttr("aria-hidden");this._super()},_deleteInternalProperties:function(){delete this._checkedClass;delete this._uncheckedClass;this._super()},_size:function(size){if(size){this._editorContainer.removeClass("ui-igcheckbox-verysmall ui-igcheckbox-small ui-igcheckbox-normal ui-igcheckbox-large");this._editorContainer.addClass("ui-igcheckbox-"+size);this._editorInput.removeClass(this._checkedClass).removeClass(this._uncheckedClass);this._checkedClass="ui-igcheckbox-"+size+"-on";this._uncheckedClass="ui-igcheckbox-"+size+"-off";this._editorInput.addClass(this._checkedClass)}},_setTabIndex:function(index){this._editorContainer.attr("tabIndex",index)},_setWidth:function(width){this._super(width);if(width){this._editorInput.addClass(this.css.iconCentered)}},_setHeight:function(height){this._super(height);if(height){this._editorInput.addClass(this.css.iconCentered)}},_setIconClass:function(oldIconClass,iconClass){this._editorInput.removeClass(oldIconClass).addClass(iconClass)},_setFocus:function(event,triggerEvent){this._editorContainer.addClass(this.css.focus);if(event&&!triggerEvent){this._triggerFocus(event)}else{delete this._cancelFocusTrigger}},_setFocusDelay:function(delay){var self=this;if(delay){this._timeouts.push(setTimeout(function(){self._cancelFocusTrigger=true;self._setFocus()},delay))}else{this._cancelFocusTrigger=true;this._editorContainer.focus()
}},_setBlur:function(event){this._editorContainer.removeClass(this.css.focus);this._triggerBlur(event);if(this._validator){this._validator._validateInternal(this.element,event,true)}},isValid:function(){return true},value:function(newValue){if(newValue!==undefined){if(this._inputValue===undefined){var result=this._tryParseBool(newValue);if(result.ret){this._updateState(result.p1)}else{throw $.ig.Editor.locale.cannotSetNonBoolValue}}else{this.options.value=newValue;this._inputValue=newValue;this._updateState(this._getState())}}else{if(this._inputValue===undefined){return this._getState()}return this.options.value}},toggle:function(){if(this._getState()){this._updateState(false)}else{this._updateState(true)}}})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Tree 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *  jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	jquery.ui.mouse.js
 *	jquery.ui.draggable.js
 *	jquery.ui.droppable.js
 *	infragistics.templating.js
 *	infragistics.dataSource.js
 *  infragistics.ui.shared.js
 *	infragistics.util.js
 *	infragistics.ui.tree-en.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igTree",{_const:{dragCursorAt:{top:-10,left:-10}},css:{tree:"ui-widget ui-igtree",treeCollection:"ui-igtree-collection",treeNode:"ui-igtree-node",treeRoot:"ui-igtree-root ui-widget-content",treeRootNode:"ui-igtree-noderoot",nodeNoChildren:"ui-igtree-node-nochildren",parentNode:"ui-igtree-parentnode",collapseIcon:"ui-icon ui-icon-triangle-1-s",expandIcon:"ui-icon ui-icon-triangle-1-e",nodeAnchor:"ui-corner-all",nodeExpander:"ui-igtree-expander",nodeNormal:"ui-state-default",nodeHightlight:"ui-state-highlight",nodeHovered:"ui-state-hover",nodeSelected:"ui-state-active",nodeActive:"ui-state-focus",checkbox:"ui-state-default ui-corner-all ui-igcheckbox-normal",checkboxOff:"ui-icon ui-icon-check ui-igcheckbox-normal-off",checkboxOn:"ui-icon ui-icon-check ui-igcheckbox-normal-on",checkboxPartial:"ui-icon ui-icon-check ui-state-disabled ui-igcheckbox-normal-on",invalidDropIndicator:"ui-widget ui-igtree-dropindicator ui-state-error ui-corner-all",dropIndicator:"ui-widget ui-igtree-dropindicator ui-state-highlight ui-corner-all",moveMarkupIcon:"ui-icon ui-icon-arrowthick-1-e",invalidMoveMarkupIcon:"ui-icon ui-icon-cancel",copyMarkupIcon:"ui-icon ui-icon-plus",insertLine:"ui-state-default ui-igtree-insertline"},options:{width:null,height:null,checkboxMode:"off",singleBranchExpand:false,hotTracking:true,parentNodeImageUrl:null,parentNodeImageClass:null,parentNodeImageTooltip:null,leafNodeImageUrl:null,leafNodeImageClass:null,leafNodeImageTooltip:null,animationDuration:200,pathSeparator:"_",dataSource:null,dataSourceUrl:null,dataSourceType:null,responseDataKey:null,responseDataType:null,requestType:"GET",responseContentType:null,initialExpandDepth:-1,loadOnDemand:false,bindings:{textKey:"Text",textXPath:"@Text",valueKey:"Value",valueXPath:"@Value",imageUrlKey:"ImageUrl",imageUrlXPath:"@ImageUrl",navigateUrlKey:"NavigateUrl",navigateUrlXPath:"@NavigateUrl",targetKey:"Target",expandedKey:"Expanded",primaryKey:null,nodeContentTemplate:null,childDataProperty:"Nodes",childDataXPath:"Children",searchFieldXPath:"Nodes",bindings:{}},defaultNodeTarget:"_self",dragAndDrop:false,updateUrl:null,dragAndDropSettings:{allowDrop:false,dragAndDropMode:"default",dragOpacity:.75,revert:true,revertDuration:500,zIndex:10,dragStartDelay:200,expandOnDragOver:true,expandDelay:1e3,helper:"default",customDropValidation:null,containment:false,invalidMoveToMarkup:"<div><p><span></span><strong>{0}</strong></p></div>",moveToMarkup:"<div><p><span></span><strong>Move to</strong> {0}</p></div>",moveBetweenMarkup:"<div><p><span></span><strong>Move between</strong> {0} and {1}</p></div>",moveAfterMarkup:"<div><p><span></span><strong>Move after</strong> {0}</p></div>",moveBeforeMarkup:"<div><p><span></span><strong>Move before</strong> {0}</p></div>",copyToMarkup:"<div><p><span></span><strong>Copy to</strong> {0}</p></div>",copyBetweenMarkup:"<div><p><span></span><strong>Copy between</strong> {0} and {1}</p></div>",copyAfterMarkup:"<div><p><span></span><strong>Copy after</strong> {0}</p></div>",copyBeforeMarkup:"<div><p><span></span><strong>Copy before</strong> {0}</p></div>"}},events:{dataBinding:"dataBinding",dataBound:"dataBound",rendering:"rendering",rendered:"rendered",selectionChanging:"selectionChanging",selectionChanged:"selectionChanged",nodeCheckstateChanging:"nodeCheckstateChanging",nodeCheckstateChanged:"nodeCheckstateChanged",nodePopulating:"nodePopulating",nodePopulated:"nodePopulated",nodeCollapsing:"nodeCollapsing",nodeCollapsed:"nodeCollapsed",nodeExpanding:"nodeExpanding",nodeExpanded:"nodeExpanded",nodeClick:"nodeClick",nodeDoubleClick:"nodeDoubleClick",dragStart:"dragStart",drag:"drag",dragStop:"dragStop",nodeDropping:"nodeDropping",nodeDropped:"nodeDropped"},widget:function(){return this.element},_createWidget:function(){this.options.bindings=null;this.options.dragAndDropSettings.moveToMarkup="<div><p><span></span>"+$.ig.Tree.locale.moveTo+"</p></div>";this.options.dragAndDropSettings.moveBetweenMarkup="<div><p><span></span>"+$.ig.Tree.locale.moveBetween+"</p></div>";this.options.dragAndDropSettings.moveAfterMarkup="<div><p><span></span>"+$.ig.Tree.locale.moveAfter+"</p></div>";this.options.dragAndDropSettings.moveBeforeMarkup="<div><p><span></span>"+$.ig.Tree.locale.moveBefore+"</p></div>";this.options.dragAndDropSettings.copyToMarkup="<div><p><span></span>"+$.ig.Tree.locale.copyTo+"</p></div>";this.options.dragAndDropSettings.copyBetweenMarkup="<div><p><span></span>"+$.ig.Tree.locale.copyBetween+"</p></div>";this.options.dragAndDropSettings.copyAfterMarkup="<div><p><span></span>"+$.ig.Tree.locale.copyAfter+"</p></div>";this.options.dragAndDropSettings.copyBeforeMarkup="<div><p><span></span>"+$.ig.Tree.locale.copyBefore+"</p></div>";$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){var opt=this.options;this.dataBind();this.element.addClass(this.css.tree);this._attachEvents();if($.ig.util.isIE&&$.ig.util.browserVersion===7&&this.element.css("position")==="static"){this.element.css("position","relative")}if(opt.width){this.element.css("width",opt.width)}if(opt.height){this.element.css("height",opt.height)}},_setOption:function(option,value){var css=this.css,elements,prevValue=this.options[option];if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"width":this.element.css("width",value);break;case"height":this.element.css("height",value);break;case"parentNodeImageUrl":elements=this.element.find("img[data-role=parent-node-image]");if(elements.length>0){elements.attr("src",value)}else{throw new Error($.ig.Tree.locale.setOptionError+option)}break;case"parentNodeImageTooltip":elements=this.element.find("img[data-role=parent-node-image]");if(elements.length<=0){elements=this.element.find("span[data-role=parent-node-image]")}if(elements.length>0){elements.attr("title",value)}else{throw new Error($.ig.Tree.locale.setOptionError+option)}break;case"parentNodeImageClass":elements=this.element.find("span[data-role=parent-node-image]");if(elements.length>0){elements.removeClass();elements.addClass(value)}else{throw new Error($.ig.Tree.locale.setOptionError+option)}break;case"leafNodeImageUrl":elements=this.element.find("img[data-role=leaf-node-image]");if(elements.length>0){elements.attr("src",value)}else{throw new Error($.ig.Tree.locale.setOptionError+option)}break;case"leafNodeImageTooltip":elements=this.element.find("img[data-role=leaf-node-image]");if(elements.length<=0){elements=this.element.find("span[data-role=leaf-node-image]")}if(elements.length>0){elements.attr("title",value)}else{throw new Error($.ig.Tree.locale.setOptionError+option)}break;case"leafNodeImageClass":elements=this.element.find("span[data-role=leaf-node-image]");if(elements.length>0){elements.removeClass();elements.addClass(value)}else{throw new Error($.ig.Tree.locale.setOptionError+option)}break;case"hotTracking":if(value){this.element.delegate("a",{mouseover:function(event){$(event.target).addClass(css.nodeHovered)},mouseout:function(event){$(event.target).removeClass(css.nodeHovered)}})}else{this.element.undelegate("a","mouseover");this.element.undelegate("a","mouseout")}break;case"checkboxMode":if(value.toLowerCase()==="off"){this._removeCheckboxes()}else if(prevValue==="off"){this._addCheckboxes()}break;case"dataSource":this.dataBind();break;case"dragAndDrop":if(value){this._initDragAndDrop()}else{this._destroyDragAndDrop()}break;case"updateUrl":this.options.dataSource.root().settings.updateUrl=value;break;case"bindings":case"loadOnDemand":case"pathSeparator":case"initialExpandDepth":case"defaultNodeTarget":throw new Error($.ig.Tree.locale.setOptionError+option);default:break}},_removeCheckboxes:function(){this.element.find("span[data-role=checkbox]").remove()},_addCheckboxes:function(){var self=this;this.element.find("li[data-role=node]").each(function(){var $this=$(this);if($this.children("span[data-role=expander]").length>0){$this.children("span[data-role=expander]").after(self._renderCheckbox())}else{$this.prepend(self._renderCheckbox())}})},_initDataOptions:function(){var dataOptions,ul,s;s=this._initDataSourceSchema();if(!this.options.dataSource&&!this.options.dataSourceUrl){if(!this.element.is("ul")){ul=this.element.children("ul");this.options.dataSource=ul[0]}else{this.options.dataSource=this.element[0]}}else if(!this.options.dataSource&&this.options.dataSourceUrl){this.options.dataSource=this.options.dataSourceUrl}else if($.type(this.options.dataSource)==="object"&&typeof this.options.dataSource._encodeHierarchicalUrlParams!=="function"&&typeof this.options.dataSource._xmlToArray!=="function"&&!this.options.dataSourceType){this.options.dataSource=[this.options.dataSource]}dataOptions={callback:this._constructFromData,callee:this,dataSource:this.options.dataSource,requestType:this.options.requestType,responseContentType:this.options.responseContentType,defaultChildrenDataProperty:this.options.bindings.childDataProperty,responseDataType:this.options.responseDataType,primaryKey:this.options.primaryKey,localSchemaTransform:this.options.dataSourceType&&this.options.dataSourceType==="xml"?true:false,schema:s,updateUrl:this.options.updateUrl};if(this.options.dataSourceType){dataOptions.type=this.options.dataSourceType}if(this.options.responseDataKey){dataOptions.responseDataKey=this.options.responseDataKey}return dataOptions},_initDataSourceSchema:function(){var schema={},opt=this.options,bindings=opt.bindings;if(bindings===null){opt.bindings={};schema.text={name:"Text",type:"string"};opt.bindings.textKey="Text";schema.value={name:"Value",type:"string"};opt.bindings.valueKey="Value";schema.imageUrl={name:"ImageUrl",type:"string"};opt.bindings.imageUrlKey="ImageUrl";schema.navigateUrl={name:"NavigateUrl",type:"string"};opt.bindings.navigateUrlKey="NavigateUrl";schema.childData={name:"Nodes",type:"object"};opt.bindings.childDataProperty="Nodes";schema.target={name:"Target",type:"string"};opt.bindings.targetKey="Target";bindings=opt.bindings}else if(opt.dataSourceType==="xml"){if(bindings.searchFieldXPath){schema.searchField=bindings.searchFieldXPath}}schema.fields=[];if(bindings.textKey){schema.fields.push({name:bindings.textKey,type:"string",xpath:bindings.textXPath});schema.textKey=bindings.textKey}if(bindings.valueKey){schema.fields.push({name:bindings.valueKey,type:"string",xpath:bindings.valueXPath});schema.valueKey=bindings.valueKey}if(bindings.navigateUrlKey){schema.fields.push({name:bindings.navigateUrlKey,type:"string",xpath:bindings.navigateUrlXPath});schema.navigateUrlKey=bindings.navigateUrlKey}if(bindings.imageUrlKey){schema.fields.push({name:bindings.imageUrlKey,type:"string",xpath:bindings.imageUrlXPath});schema.imageUrlKey=bindings.imageUrlKey}if(bindings.targetKey){schema.fields.push({name:bindings.targetKey,type:"string"});schema.targetKey=bindings.targetKey}if(bindings.expandedKey){schema.fields.push({name:"Expanded",type:"boolean"});schema.expandedKey=bindings.expandedKey}if(bindings.primaryKey){schema.fields.push({name:bindings.primaryKey,type:"string"});schema.primaryKey=bindings.primaryKey}if(bindings.childDataProperty){schema.fields.push({name:bindings.childDataProperty,type:"object",xpath:bindings.childDataXPath});schema.childDataProperty=bindings.childDataProperty}if(!schema.searchField&&opt.responseDataKey){schema.searchField=opt.responseDataKey}return schema},_initDataSource:function(dataOptions){var opt=this.options;if(!opt.dataSource||typeof opt.dataSource._encodeHierarchicalUrlParams!=="function"){opt.dataSource=new $.ig.HierarchicalDataSource(dataOptions)}},_helper:null,_insertLine:{html:null},_originalHelper:{html:null},_sourceNode:{data:null,element:null,owner:null},_validationObject:{valid:true,dropAfter:true,expandTimeout:null,target:null},_helperDirty:false,_dropAfter:true,_initDragOptions:function(){var self=this,dragAndDropSettings=self.options.dragAndDropSettings,helper=dragAndDropSettings.helper==="default"?function(event){var target=$(event.target).closest("li[data-role=node]"),markup=$(self.options.dragAndDropSettings.invalidMoveToMarkup.replace("{0}",target.children("a").text()));markup.addClass(self.css.invalidDropIndicator).find("span").addClass(self.css.invalidMoveMarkupIcon);return markup}:dragAndDropSettings.helper,opt={revert:dragAndDropSettings.revert?"invalid":false,opacity:dragAndDropSettings.dragOpacity,zIndex:dragAndDropSettings.zIndex,cursorAt:this._const.dragCursorAt,helper:helper,revertDuration:dragAndDropSettings.revertDuration,appendTo:self.element,delay:dragAndDropSettings.dragStartDelay,containment:dragAndDropSettings.containment,start:function(event,ui){var node=self.nodeFromElement($(this)),noCancel;noCancel=self._triggerDragStart(event,ui,node.element);if(noCancel){self._originalHelper.html=ui.helper.html();self._sourceNode.data=$.extend(false,{},node.data);self._sourceNode.owner=self;self._sourceNode.element=$(this)}else{return false}},drag:function(event,ui){var noCancel=self._triggerDrag(event,ui,self._sourceNode.element);if(noCancel){self._performDrag(event,ui)}else{self._resetSourceNode();self._resetValidationObject();return false}},stop:function(event,ui){self._triggerDragStop(event,ui);$(document).find("div[data-role=insert-line]").remove();self._helperDirty=false;self._resetSourceNode();self._resetValidationObject()}};return opt},_performDrag:function(event,ui){var target=$(event.originalEvent.target),markup,copy=event.ctrlKey&&this.options.dragAndDropSettings.dragAndDropMode==="default"||this.options.dragAndDropSettings.dragAndDropMode==="copy",targetTop,dragTop,self=this;if(target.is("div[data-role=insert-line]")){return}this._validationObject.valid=this._accept(this._sourceNode.element,target);$(document).find("div[data-role=insert-line]").remove();if(this.options.dragAndDropSettings.expandOnDragOver){if((target.is("a")||target.closest("a").parent().is("li[data-role=node]"))&&this._validationObject.target!==target.closest("li[data-role=node]")){clearTimeout(this._validationObject.expandTimeout);this._validationObject.target=target.closest("li[data-role=node]");if(this._validationObject.target.hasClass("ui-igtree-parentnode")){this._validationObject.expandTimeout=setTimeout(function(){self.expand(self._validationObject.target)},this.options.dragAndDropSettings.expandDelay)}}else{clearTimeout(this._validationObject.expandTimeout);this._validationObject.expandTimeout=null;this._validationObject.target=null}}if((target.is("a")||target.closest("a").parent().is("li[data-role=node]"))&&this._validationObject.valid){if(copy){markup=$(this.options.dragAndDropSettings.copyToMarkup.replace("{0}",target.text()));markup.find("span").addClass(this.css.copyMarkupIcon)}else{markup=$(this.options.dragAndDropSettings.moveToMarkup.replace("{0}",target.text()));markup.find("span").addClass(this.css.moveMarkupIcon)}this._helper=markup.html();ui.helper.removeClass(this.css.invalidDropIndicator).addClass(this.css.dropIndicator).html(this._helper);this._helperDirty=true}else if(target.is("li[data-role=node]")&&this._validationObject.valid){targetTop=target.offset().top+target.height()/2;dragTop=ui.offset.top+this._const.dragCursorAt.top;if(dragTop>targetTop){this._validationObject.dropAfter=true;if(copy){if(target.next("li[data-role=node]").length>0){markup=$(this.options.dragAndDropSettings.copyBetweenMarkup.replace("{0}",target.children("a").text()).replace("{1}",target.next("li[data-role=node]").children("a").text()));markup.find("span").addClass(this.css.copyMarkupIcon)}else{markup=$(this.options.dragAndDropSettings.copyAfterMarkup.replace("{0}",target.children("a").text()));markup.find("span").addClass(this.css.copyMarkupIcon)}}else{if(target.next("li[data-role=node]").length>0){markup=$(this.options.dragAndDropSettings.moveBetweenMarkup.replace("{0}",target.children("a").text()).replace("{1}",target.next("li[data-role=node]").children("a").text()));markup.find("span").addClass(this.css.moveMarkupIcon)}else{markup=$(this.options.dragAndDropSettings.moveAfterMarkup.replace("{0}",target.children("a").text()));markup.find("span").addClass(this.css.moveMarkupIcon)}}$(this._insertLine.html).appendTo(target);this._helper=markup.html();ui.helper.removeClass(this.css.invalidDropIndicator).addClass(this.css.dropIndicator).html(this._helper)}else{this._validationObject.dropAfter=false;if(copy){if(target.prev("li[data-role=node]").length>0){markup=$(this.options.dragAndDropSettings.copyBetweenMarkup.replace("{0}",target.children("a").text()).replace("{1}",target.prev("li[data-role=node]").children("a").text()));markup.find("span").addClass(this.css.copyMarkupIcon)}else{markup=$(this.options.dragAndDropSettings.copyBeforeMarkup.replace("{0}",target.children("a").text()));markup.find("span").addClass(this.css.copyMarkupIcon)}}else{if(target.prev("li[data-role=node]").length>0){markup=$(this.options.dragAndDropSettings.moveBetweenMarkup.replace("{0}",target.prev("li[data-role=node]").children("a").text()).replace("{1}",target.children("a").text()));markup.find("span").addClass(this.css.moveMarkupIcon)}else{markup=$(this.options.dragAndDropSettings.moveBeforeMarkup.replace("{0}",target.children("a").text()));markup.find("span").addClass(this.css.moveMarkupIcon)}}if(target.index()===0){$(this._insertLine.html).prependTo(target).css("padding-bottom","0.1em")}else{$(this._insertLine.html).appendTo(target.prev())}this._helper=markup.html();ui.helper.removeClass(this.css.invalidDropIndicator).addClass(this.css.dropIndicator).html(this._helper)}this._helperDirty=true}else if(target.is(":ui-igTree")&&target.data("igTree")!==this){if(copy){markup=$(this.options.dragAndDropSettings.copyToMarkup.replace("{0}",""));markup.find("span").addClass(this.css.copyMarkupIcon)}else{markup=$(this.options.dragAndDropSettings.moveToMarkup.replace("{0}",""));markup.find("span").addClass(this.css.moveMarkupIcon)}this._helper=markup.html();ui.helper.removeClass(this.css.invalidDropIndicator).addClass(this.css.dropIndicator).html(this._helper);this._helperDirty=true}else{$(document).find("div[data-role=insert-line]").remove();if(this._helperDirty){this._helper=null;ui.helper.removeClass(this.css.dropIndicator).addClass(this.css.invalidDropIndicator).html(this._originalHelper.html);this._helperDirty=false}}},_resetSourceNode:function(){this._originalHelper.html=null;this._sourceNode.data=null;this._sourceNode.owner=null;this._sourceNode.element=null},_resetValidationObject:function(){this._validationObject.valid=true;this._validationObject.dropAfter=true;clearTimeout(this._validationObject.expandTimeout);this._validationObject.expandTimeout=null;this._validationObject.target=null},_initDropOptions:function(){var self=this,opt={tolerance:"pointer",greedy:true,drop:function(event,ui){if(self._sourceNode.element===null&&self._sourceNode.owner===null){return false}return self._performDrop(event,ui)},accept:function(){return self._validationObject.valid}};return opt},_performDrop:function(event,ui){var self=this,parent,target=$(event.originalEvent.target),noCancel;if(target.is("div[data-role=insert-line]")){target=target.closest("li[data-role=node]")}self.element.find("div[data-role=insert-line]").remove();noCancel=self._triggerNodeDropping(event,ui,target.closest("li[data-role=node]"),target.next("li[data-role=node]").length>0||!self._validationObject.dropAfter?target.index()+(self._validationObject.dropAfter?1:0):target.index());if(noCancel){if(target.is("a")||target.closest("a").parent().is("li[data-role=node]")){target=target.closest("li[data-role=node]");switch(self.options.dragAndDropSettings.dragAndDropMode){case"move":self.addNode(self._sourceNode.data,target);self._sourceNode.owner.removeAt(self._sourceNode.element.attr("data-path"));break;case"copy":self.addNode(self._sourceNode.data,target);break;default:if(!event.ctrlKey){self.addNode(self._sourceNode.data,target);self._sourceNode.owner.removeAt(self._sourceNode.element.attr("data-path"))}else{self.addNode(self._sourceNode.data,target)}break}}else if(target.is("li")){parent=self.parentNode(target);switch(self.options.dragAndDropSettings.dragAndDropMode){case"move":self.addNode(self._sourceNode.data,parent,target.next("li[data-role=node]").length>0||!self._validationObject.dropAfter?target.index()+(self._validationObject.dropAfter?1:0):null);self._sourceNode.element.attr("data-path",self._sourceNode.element.attr("data-path")+"_remove");self._sourceNode.owner.removeAt(self._sourceNode.element.attr("data-path"));break;case"copy":self.addNode(self._sourceNode.data,parent,target.next("li[data-role=node]").length>0||!self._validationObject.dropAfter?target.index()+(self._validationObject.dropAfter?1:0):null);break;default:if(!event.ctrlKey){self.addNode(self._sourceNode.data,parent,target.next("li[data-role=node]").length>0||!self._validationObject.dropAfter?target.index()+(self._validationObject.dropAfter?1:0):null);self._sourceNode.element.attr("data-path",self._sourceNode.element.attr("data-path")+"_remove");self._sourceNode.owner.removeAt(self._sourceNode.element.attr("data-path"))}else{self.addNode(self._sourceNode.data,parent,target.next("li[data-role=node]").length>0||!self._validationObject.dropAfter?target.index()+(self._validationObject.dropAfter?1:0):null)}break}}else if(target.is(":ui-igTree")){switch(self.options.dragAndDropSettings.dragAndDropMode){case"move":self.addNode(self._sourceNode.data);self._sourceNode.owner.removeAt(self._sourceNode.element.attr("data-path"));break;case"copy":self.addNode(self._sourceNode.data);break;default:if(!event.ctrlKey){self.addNode(self._sourceNode.data);self._sourceNode.owner.removeAt(self._sourceNode.element.attr("data-path"))}else{self.addNode(self._sourceNode.data)}break}}self._triggerNodeDropped(event,ui,target)}else{return false}},_accept:function(dropElem,target){var valid=true,node=target.closest("li[data-role=node]"),dropPath=dropElem.attr("data-path"),tree=target.closest(".ui-widget.ui-igtree"),sourceBinding=this._retrieveCurrentDepthBinding(parseInt(this._sourceNode.element.closest("ul").attr("data-depth"),10)),destinationBinding;if(target.is("a")&&target.parent().is("li[data-role=node]")||target.closest("a").parent().is("li[data-role=node]")){destinationBinding=tree.data("igTree")._retrieveCurrentDepthBinding(parseInt(target.closest("ul").attr("data-depth"),10)+1)}else{if(target.is("li[data-role=node]")){destinationBinding=tree.data("igTree")._retrieveCurrentDepthBinding(parseInt(target.closest("ul").attr("data-depth"),10))}else if(target.is(":ui-igTree")){destinationBinding=tree.data("igTree")._retrieveCurrentDepthBinding(0)}else{destinationBinding=false}}if(node.length>0&&(node.attr("data-path")===dropPath||node.attr("data-path").indexOf(dropPath+this.options.pathSeparator)===0)&&this===tree.data("igTree")){valid=false}else if(this!==tree.data("igTree")&&!tree.igTree("option","dragAndDropSettings").allowDrop){valid=false}else if(typeof tree.igTree("option","dragAndDropSettings").customDropValidation==="function"){valid=tree.igTree("option","dragAndDropSettings").customDropValidation.apply(target,[dropElem])}if(sourceBinding&&destinationBinding&&valid){valid=this._validateBindings(sourceBinding,destinationBinding,target)}return valid},_validateBindings:function(sourceBinding,destinationBinding,target){var valid=true;if(destinationBinding.hasOwnProperty("primaryKey")){if(!sourceBinding.hasOwnProperty("primaryKey")||sourceBinding.primaryKey!==destinationBinding.primaryKey){valid=false}else if(target.is("a")&&this._sourceNode.element.parent().closest("li[data-role=node]").is(target.closest("li[data-role=node]"))){valid=false}}if(destinationBinding.textKey!==sourceBinding.textKey){valid=false}if(destinationBinding.hasOwnProperty("valueKey")&&sourceBinding.hasOwnProperty("valueKey")&&destinationBinding.valueKey!==sourceBinding.valueKey){valid=false}if(destinationBinding.hasOwnProperty("childDataProperty")&&sourceBinding.hasOwnProperty("childDataProperty")&&destinationBinding.childDataProperty!==sourceBinding.childDataProperty){valid=false}return valid},_initDragAndDrop:function(element){var dragOptions=this._initDragOptions(),dropOptions=this._initDropOptions();if(!this._insertLine.html){this._insertLine.html='<div data-role="insert-line" class="'+this.css.insertLine+'"></div>'}if(!element){this.element.find("li[data-role=node]").draggable(dragOptions);this.element.droppable(dropOptions);this.element.delegate("a","mousedown",function(){$(this).focus()})}else{element.draggable(dragOptions);element.find("li[data-role=node]").draggable(dragOptions)}},_destroyDragAndDrop:function(){this.element.find("li[data-role=node]").draggable("destroy");this.element.droppable("destroy");this.element.undelegate("a","mousedown")},_constructFromData:function(){var ul,data=this.options.dataSource._rootds.data(),self=this;this._triggerDataBound(data);this._triggerRendering(data);this.element.attr("data-scroll",true);if(this.element.is("ul")){this.element.empty();ul=this.element;ul.addClass(this.css.treeCollection).addClass(this.css.treeRoot).attr("data-depth",0);MSApp.execUnsafeLocalFunction(function(){ul.html(self._initChildrenRecursively("",data))});this._triggerRendered()}else{this.element.empty();ul='<ul class="'+this.css.treeCollection+" "+this.css.treeRoot+'" data-depth="0">';ul+=this._initChildrenRecursively("",data);ul+="</ul>";MSApp.execUnsafeLocalFunction(function(){$(ul).appendTo(self.element)});this._triggerRendered()}if(this.options.dragAndDrop){this._initDragAndDrop();if(typeof this.options.dragAndDropSettings.customDropValidation==="string"){if(window[this.options.dragAndDropSettings.customDropValidation]&&typeof window[this.options.dragAndDropSettings.customDropValidation]==="function"){this.options.dragAndDropSettings.customDropValidation=window[this.options.dragAndDropSettings.customDropValidation]}}}},_attachEvents:function(){var self=this,css=this.css,noCancel,target;this.element.delegate("span[data-role=expander]","click",function(event){self.toggle($(event.target).closest("li[data-role=node]"),event)});if(this.options.hotTracking){this.element.delegate("a",{click:function(event){target=$(event.target).closest("a");noCancel=self._triggerNodeClick(event,target.parent());if(noCancel){self.select(target.parent(),event);if($.ig.util.isWebKit){target.focus()}}else{event.preventDefault()}},dblclick:function(event){event.preventDefault();self._triggerNodeDoubleClick(event,$(event.target.parentNode))},keydown:function(event){self._kbNavigation(event)},focus:function(event){self._focusNode(event)},blur:function(event){self._blurNode(event)},mouseover:function(event){target=$(event.target).closest("a");target.addClass(css.nodeHovered)},mouseout:function(event){target=$(event.target).closest("a");target.removeClass(css.nodeHovered)}})}else{this.element.delegate("a",{click:function(event){target=$(event.target).closest("a");noCancel=self._triggerNodeClick(event,target.parent());if(noCancel){self.select(target.parent(),event);if($.ig.util.isWebKit){target.focus()}}else{event.preventDefault()}},dblclick:function(event){event.preventDefault();self._triggerNodeDoubleClick(event,$(event.target.parentNode))},keydown:function(event){self._kbNavigation(event)},focus:function(event){self._focusNode(event)},blur:function(event){self._blurNode(event)}})}this.element.delegate("span[data-role=checkbox] > span",{click:function(event){self.toggleCheckstate($(event.target).closest("li[data-role=node]"),event)},mouseover:function(event){$(event.target).closest("span[data-role=checkbox]").addClass(css.nodeHovered)},mouseout:function(event){$(event.target).closest("span[data-role=checkbox]").removeClass(css.nodeHovered)}})},_initChildrenRecursively:function(path,data,depth,checkFlag,indexFeed){var childUl,opt=this.options,childPath,binding,value,display,liStr=[],i=0,li,children;if(!indexFeed){indexFeed=0}if(!depth){depth=0}binding=this._retrieveCurrentDepthBinding(depth);if(!data.hasOwnProperty("length")&&data.hasOwnProperty(binding.textKey)){data=[data]}for(i;i<data.length;i++){childUl="";value="";if(path.length<=0){if(binding.hasOwnProperty("primaryKey")&&data[i].hasOwnProperty(binding.primaryKey)){childPath=typeof data[i][binding.primaryKey]==="function"?data[i][binding.primaryKey]():data[i][binding.primaryKey]}else{childPath=i+indexFeed}}else{if(binding.hasOwnProperty("primaryKey")&&data[i].hasOwnProperty(binding.primaryKey)){childPath=path+opt.pathSeparator+(typeof data[i][binding.primaryKey]==="function"?data[i][binding.primaryKey]():data[i][binding.primaryKey])}else{childPath=path+opt.pathSeparator+(i+indexFeed)}}if(binding.hasOwnProperty("valueKey")&&data[i].hasOwnProperty(binding.valueKey)){if(typeof data[i][binding.valueKey]==="function"){value=data[i][binding.valueKey]()}else{value=data[i][binding.valueKey]}}li='<li class="'+this._buildNodeCssString(data[i],depth,binding)+'" data-path="'+childPath+'" data-value="'+value+'" data-role="node">';children=data[i][binding.childDataProperty];if(typeof children==="function"){children=children()}if(children&&children.length>0||children&&opt.loadOnDemand){if(depth<=opt.initialExpandDepth&&!opt.loadOnDemand||binding.hasOwnProperty("expandedKey")&&data[i].hasOwnProperty(binding.expandedKey)&&data[i][binding.expandedKey]){li+=this._renderExpanderImage(true);display="block"}else{li+=this._renderExpanderImage(false);display="none"}}if(opt.checkboxMode&&opt.checkboxMode.toLowerCase()!=="off"){li+=this._renderCheckbox(checkFlag)}li+=this._renderNodeImage(data[i],binding);if(!binding.nodeContentTemplate){li+=this._renderAnchor(data[i],binding)}else{li+=this._renderNodeTemplate(data[i],binding)}if(children&&children.length>0||children&&opt.loadOnDemand){childUl='<ul style="display: '+display+'" data-depth="'+(depth+1)+'"';if(children.length>0&&!opt.loadOnDemand){childUl+=">"+this._initChildrenRecursively(childPath,children,depth+1,checkFlag)}else{childUl+=' data-populated="false">'}childUl+="</ul>"}li+=childUl;li+="</li>";liStr.push(li)}return liStr.join("")},_buildNodeCssString:function(data,depth,binding){var css=this.css,str=css.treeNode,children;if(depth===0){str+=" "+css.treeRootNode}children=data[binding.childDataProperty];if(typeof children==="function"){children=children()}if(children&&children.length>0||children&&this.options.loadOnDemand){str+=" "+css.parentNode}else{str+=" "+css.nodeNoChildren}return str},_retrieveCurrentDepthBinding:function(depth){var binding=this.options.bindings,i=0;for(i;i<depth;i++){if(binding.hasOwnProperty("bindings")){binding=binding.bindings}else{break}}return binding},_renderExpanderImage:function(expanded){var self=this,css=self.css,expander="";if(expanded){expander='<span data-role="expander" data-exp="true" class="'+css.collapseIcon+" "+css.nodeExpander+'"></span>'}else{expander='<span data-role="expander" data-exp="false" class="'+css.expandIcon+" "+css.nodeExpander+'"></span>'}return expander},_renderAnchor:function(data,binding){var href,target,text;if(binding.hasOwnProperty("navigateUrlKey")&&data[binding.navigateUrlKey]){if(typeof data[binding.navigateUrlKey]==="function"){href=data[binding.navigateUrlKey]()}else if(data[binding.navigateUrlKey].length<=0){href="#"}else{href=data[binding.navigateUrlKey]}}else{href="#"}if(binding.targetKey&&binding.targetKey.length>0&&data.hasOwnProperty(binding.targetKey)){target=data[binding.targetKey]}else{target=this.options.defaultNodeTarget}if(typeof data[binding.textKey]==="function"){text=data[binding.textKey]()}else{text=data[binding.textKey]}return'<a href="'+href+'" target="'+target+'" class="'+this.css.nodeAnchor+'">'+text+"</a>"},_renderNodeTemplate:function(data,binding){var div=$("<div></div>"),html,href,target,template=binding.nodeContentTemplate;if(binding.hasOwnProperty("navigateUrlKey")&&data[binding.navigateUrlKey]){if(typeof data[binding.navigateUrlKey]==="function"){href=data[binding.navigateUrlKey]()}else if(data[binding.navigateUrlKey].length<=0){href="#"}else{href=data[binding.navigateUrlKey]}}else{href="#"}if(binding.targetKey&&binding.targetKey.length>0&&data.hasOwnProperty(binding.targetKey)){target=data[binding.targetKey]
}else{target=this.options.defaultNodeTarget}div.html($.ig.tmpl(template,data));if(div.children("a").length<=0){html='<a href="'+href+'" target="'+target+'" class="'+this.css.nodeAnchor+'">'+div.html()+"</a>"}else if(!div.children("a").attr("href")){div.children("a").addClass(this.css.nodeAnchor).attr({href:href,target:target});html=div.html()}else{div.children("a").addClass(this.css.nodeAnchor);html=div.html()}return html},_renderCheckbox:function(checkFlag){var self=this,css=self.css;return'<span data-chk="'+(checkFlag?"on":"off")+'" data-role="checkbox" class="'+css.checkbox+'"><span class="'+(checkFlag?css.checkboxOn:css.checkboxOff)+'"></span></span>'},_renderNodeImage:function(data,binding){var opt=this.options,hasChildren,img="",src;hasChildren=data[binding.childDataProperty]&&data[binding.childDataProperty].length>0||data[binding.childDataProperty]&&opt.loadOnDemand;if(binding.hasOwnProperty("imageUrlKey")&&data.hasOwnProperty(binding.imageUrlKey)){if(typeof data[binding.imageUrlKey]==="function"){src=data[binding.imageUrlKey]();if(src&&src.length>0){img='<img src="'+src+'" alt="error" data-role="node-image" />'}}else if(data[binding.imageUrlKey].length>0){img='<img src="'+data[binding.imageUrlKey]+'" alt="error" data-role="node-image" />'}}if(opt.parentNodeImageUrl&&hasChildren){img+='<img src="'+opt.parentNodeImageUrl+'" alt="error" title="'+(opt.parentNodeImageTooltip!==null?opt.parentNodeImageTooltip:"")+'" data-role="parent-node-image" />'}else if(opt.parentNodeImageClass&&hasChildren){img+='<span title="'+(opt.parentNodeImageTooltip!==null?opt.parentNodeImageTooltip:"")+'" class="'+opt.parentNodeImageClass+'" data-role="parent-node-image"></span>'}else if(!hasChildren&&opt.leafNodeImageUrl){img+='<img src="'+opt.leafNodeImageUrl+'" alt="error" title="'+(opt.leafNodeImageTooltip!==null?opt.leafNodeImageTooltip:"")+'" data-role="leaf-node-image" />'}else if(!hasChildren&&opt.leafNodeImageClass){img+='<span title="'+(opt.leafNodeImageTooltip!==null?opt.leafNodeImageTooltip:"")+'" class="'+opt.leafNodeImageClass+'" data-role="leaf-node-image"></span>'}return img},_focusNode:function(event){$(event.target).addClass(this.css.nodeActive)},_blurNode:function(event){$(event.target).removeClass(this.css.nodeActive)},_kbNavigation:function(event){var opt=this.options,css=this.css,li=$(event.target.parentNode),nextLi,seq=li.index(),expander;if(event.keyCode===$.ui.keyCode.UP){nextLi=this._nextVisibleNodeUp(li);if(!nextLi){return}if(event.ctrlKey){li.children("a").blur();nextLi.children("a").focus()}else{li.children("a").blur();nextLi.children("a").focus();this.select(nextLi,null)}event.preventDefault()}else if(event.keyCode===$.ui.keyCode.DOWN){nextLi=this._nextVisibleNodeDown(li,seq);if(!nextLi){return}if(event.ctrlKey){li.children("a").blur();nextLi.children("a").focus()}else{li.children("a").blur();nextLi.children("a").focus();this.select(nextLi,null)}event.preventDefault()}else if(event.keyCode===$.ui.keyCode.RIGHT){if(li.children("ul").length>0){expander=li.children("."+css.nodeExpander);if(!expander.attr("data-exp")||expander.attr("data-exp")==="false"){this.toggle(li,null)}else{nextLi=li.find("ul > li:first");if(nextLi.length>0){if(event.ctrlKey){li.children("a").blur();nextLi.children("a").focus()}else{li.children("a").blur();nextLi.children("a").focus();this.select(nextLi,null)}}}}}else if(event.keyCode===$.ui.keyCode.LEFT){expander=li.children("."+css.nodeExpander);if(expander.attr("data-exp")&&expander.attr("data-exp")!=="false"){this.toggle(li,null)}else if(li.parent().parent().is("li")){nextLi=li.parent().parent();if(event.ctrlKey){li.children("a").blur();nextLi.children("a").focus()}else{li.children("a").blur();nextLi.children("a").focus();this.select(nextLi,null)}}}else if(event.keyCode===$.ui.keyCode.NUMPAD_ADD){if(li.children("ul").length>0){expander=li.children("."+css.nodeExpander);if(!expander.attr("data-exp")||expander.attr("data-exp")==="false"){this.toggle(li,null)}}}else if(event.keyCode===$.ui.keyCode.NUMPAD_SUBTRACT){if(li.children("ul").length>0){expander=li.children("."+css.nodeExpander);if(expander.attr("data-exp")&&expander.attr("data-exp")!=="false"){this.toggle(li,null)}}}else if(event.keyCode===$.ui.keyCode.SPACE){if(opt.checkboxMode&&opt.checkboxMode.toLowerCase()!=="off"){this.toggleCheckstate(li,null);event.preventDefault();event.stopPropagation()}}else if(event.keyCode===$.ui.keyCode.HOME){li.children("a").blur();li=this.element.find("li:first");if(li.length>0){li.children("a").focus();this.select(li)}event.preventDefault()}else if(event.keyCode===$.ui.keyCode.END){li.children("a").blur();li=this._lastVisibleNode();if(li){li.children("a").focus();this.select(li)}event.preventDefault()}},_nextVisibleNodeDown:function(node,nodeSeq){var expander=node.children("."+this.css.nodeExpander),parentLi,seq=nodeSeq,result=null;if(expander.length>0&&expander.attr("data-exp")&&expander.attr("data-exp")!=="false"&&node.children("ul").children("li:first").length>0){return node.children("ul").children("li:first")}if(seq===node.siblings().length){parentLi=node.parent().parent();while(parentLi.is("li")){seq=parentLi.index();if(seq!==parentLi.siblings().length){result=parentLi.next();break}parentLi=parentLi.parent().parent()}}else{result=node.next()}return result},_nextVisibleNodeUp:function(node){var li=node.prev(),expander,result=null;if(li.length<=0){if(node.parent().parent().is("li")){result=node.parent().parent()}}else{while(li.length>0){expander=li.children("."+this.css.nodeExpander);if(li.children("ul").children("li").length<=0||!expander.attr("data-exp")||expander.attr("data-exp")==="false"){result=li;break}li=li.children("ul").children("li:last")}}return result},_lastVisibleNode:function(){var li=this.element.is("ul")?this.element.children("li:last"):this.element.children("ul").children("li:last"),expander,result;if(li.length<=0){result=null}else{while(li.length>0){expander=li.children("."+this.css.nodeExpander);if(li.children("ul").children("li").length<=0||!expander.attr("data-exp")||expander.attr("data-exp")==="false"){result=li;break}li=li.children("ul").children("li:last")}}return result},_populatingNode:null,_populateNodeData:function(success,msg,data){if(!success){throw new Error($.ig.Tree.locale.errorOnRequest+msg)}var ul=this._populatingNode.ul,node=this._populatingNode.node,originalData=this.nodeDataFor(node.attr("data-path")),depth=ul.attr("data-depth"),binding=this._retrieveCurrentDepthBinding(depth-1),checked,newData=data.data();if(this.options.checkboxMode.toLowerCase()==="tristate"){checked=this.isChecked(node)}ul.children('li[data-role="loading"]').remove();if(!originalData[binding.childDataProperty]||!originalData[binding.childDataProperty].length){originalData[binding.childDataProperty]=newData}else{originalData[binding.childDataProperty]=originalData[binding.childDataProperty].concat(newData)}this._triggerNodePopulated(null,node);this._triggerRendering(newData);ul.append(this._initChildrenRecursively(node.attr("data-path"),newData,parseInt(ul.attr("data-depth"),10),checked));ul.attr("data-populated",true);if(this.options.dragAndDrop){this._initDragAndDrop(ul)}this._triggerRendered();this._populatingNode.indicator.hide();this._populatingNode.indicator.destroy();this._populatingNode=null;this.toggle(node);this._loadRequest()},_prepareRequest:function(node,event){var opt=this.options,pathKeyArr,path,key,data,binding,parentBinding,noCancel;if(this._populatingNode!==null){return}noCancel=this._triggerNodePopulating(event,node);if(noCancel){pathKeyArr=this._buildRequestString(node);binding=this._retrieveCurrentDepthBinding(parseInt(node.children("ul").attr("data-depth"),10));if(!pathKeyArr){return}path=pathKeyArr[0];key=pathKeyArr[1];data=this.nodeDataFor(node.attr("data-path"));parentBinding=this._retrieveCurrentDepthBinding(parseInt(node.children("ul").attr("data-depth"),10)-1);if(data.hasOwnProperty(parentBinding.childDataProperty)){data=data[parentBinding.childDataProperty]}if(data&&data.__deferred&&data.__deferred.uri){this._executeODataRequest(node,data)}else if(data&&data.length>0&&!opt.dataSourceUrl){this._renderOnDemand(node,data)}else{this._executeUrlRequest(node,binding,path,key)}}},_executeODataRequest:function(node,data){var dataSource,ul,indicator,opt=this.options,li;dataSource=new $.ig.JSONPDataSource({dataSource:data.__deferred.uri+"?$format=json&$callback=?",responseDataKey:opt.responseDataKey});ul=node.children("ul");li=$('<li style="width: 20px" data-role="loading">&nbsp;</li>').appendTo(ul);ul.show();indicator=li.igLoading({includeVerticalOffset:false}).data("igLoading").indicator();indicator.show();this._populatingNode={ul:ul,node:node,indicator:indicator};dataSource.dataBind(this._populateNodeData,this)},_renderOnDemand:function(node,data){var ul,checked;ul=node.children("ul");if(this.options.checkboxMode.toLowerCase()==="tristate"){checked=this.isChecked(node)}this._triggerNodePopulated(null,node);this._triggerRendering(data);ul.html(this._initChildrenRecursively(node.attr("data-path"),data,parseInt(ul.attr("data-depth"),10),checked));ul.attr("data-populated",true);if(this.options.dragAndDrop){this._initDragAndDrop(ul)}this._triggerRendered();this.toggle(node);this._loadRequest()},_executeUrlRequest:function(node,binding,path,key){var opt=this.options,ul,indicator,dataSource,li;if(opt.dataSourceUrl&&opt.dataSourceUrl.lastIndexOf("?")===-1){opt.dataSourceUrl+="?"}else if(!opt.dataSourceUrl){throw new Error($.ig.Tree.locale.noDataSourceUrl)}dataSource=new $.ig.DataSource({dataSource:opt.dataSourceUrl+"&"+this._encodeUrlPath(path,key)+"&"+this._encodeBinding(binding)+"&depth="+node.parent().attr("data-depth"),dataSourceType:"remoteUrl"});ul=node.children("ul");li=$('<li style="width: 20px" data-role="loading">&nbsp;</li>').appendTo(ul);ul.show();indicator=li.igLoading({includeVerticalOffset:false}).data("igLoading").indicator();indicator.show();this._populatingNode={ul:ul,node:node,indicator:indicator};dataSource.dataBind(this._populateNodeData,this)},_buildRequestString:function(node){var nodePath,key="",path="",binding=this.options.bindings,i,result;nodePath=node.attr("data-path").split(this.options.pathSeparator);for(i=0;i<nodePath.length;i++){if(key.length>0){key+="/"}key+=binding.childDataProperty;if(path.length>0){path+="/"}path+=(binding.primaryKey?binding.primaryKey+":":"")+nodePath[i];if(binding.bindings){binding=binding.bindings}}if(path.length<=0){result=null}else{result=[path,key]}return result},_encodeBinding:function(binding){var temp="binding=",item;for(item in binding){if(binding.hasOwnProperty(item)&&item!=="bindings"&&item!=="nodeContentTemplate"){temp+=item.toString()+":"+binding[item]+","}}temp=temp.substr(0,temp.length-1);return temp},_encodeUrlPath:function(path,key){var result;if(path.lastIndexOf("/")===-1){path+="/@"+key;result="path="+path}else{result="path="+path.substr(path.lastIndexOf("/")+1,path.length)+"/@"+key.substr(key.lastIndexOf("/")+1,key.length)}return result},_updateParentState:function(parent){var expander=parent.children("span[data-role=expander]");if(expander.length<=0){parent.removeClass(this.css.nodeNoChildren).addClass(this.css.parentNode);$(this._renderExpanderImage(false)).prependTo(parent)}else if(parent.children("ul").children("li").length<=0){parent.removeClass(this.css.parentNode).addClass(this.css.nodeNoChildren);parent.children("ul").remove();expander.remove()}this._updateImage(parent)},_updateParentCheckbox:function(parent){var checkbox=parent.children("span[data-role=checkbox]"),checkIcon=checkbox.children("span"),checkState=checkbox.attr("data-chk"),shouldBe,checkCount=0,css=this.css;parent.children("ul").children("li").each(function(){if($(this).children("span[data-role=checkbox]").attr("data-chk")==="on"){checkCount++}});if(checkCount===0){shouldBe="off"}else if(checkCount===parent.children("ul").children("li").length){shouldBe="on"}else{shouldBe="partial"}if(checkState!==shouldBe){checkbox.attr("data-chk",shouldBe);switch(shouldBe){case"off":checkIcon.removeClass(css.checkboxOn).removeClass(css.checkboxPartial).addClass(css.checkboxOff);break;case"partial":checkIcon.removeClass(css.checkboxOn).removeClass(css.checkboxOff).addClass(css.checkboxPartial);break;case"on":checkIcon.removeClass(css.checkboxPartial).removeClass(css.checkboxOff).addClass(css.checkboxOn);break;default:checkIcon.removeClass(css.checkboxOn).removeClass(css.checkboxPartial).addClass(css.checkboxOff)}parent=this.parentNode(parent);if(parent){this._updateParentCheckbox(parent)}}},_updateImage:function(parent){var hasChildren=parent.children("ul").children("li").length>0,opt=this.options,img;if(!hasChildren){if(opt.leafNodeImageUrl){img=parent.children("img[data-role=parent-node-image]");if(img.length>0){img.attr("title",opt.leafNodeImageTooltip!==null?opt.leafNodeImageTooltip:"");img.attr("src",opt.leafNodeImageUrl);img.attr("data-role","leaf-node-image")}}else if(opt.leafNodeImageClass){img=parent.children("span[data-role=parent-node-image]");if(img.length>0){img.attr("title",opt.leafNodeImageTooltip!==null?opt.leafNodeImageTooltip:"");img.removeClass(opt.parentNodeImageClass).addClass(opt.leafNodeImageClass);img.attr("data-role","leaf-node-image")}}}else{if(opt.parentNodeImageUrl){img=parent.children("img[data-role=leaf-node-image]");if(img.length>0){img.attr("title",opt.parentNodeImageTooltip!==null?opt.parentNodeImageTooltip:"");img.attr("src",opt.parentNodeImageUrl);img.attr("data-role","parent-node-image")}}else if(opt.parentNodeImageClass){img=parent.children("span[data-role=leaf-node-image]");if(img.length>0){img.attr("title",opt.parentNodeImageTooltip!==null?opt.parentNodeImageTooltip:"");img.removeClass(opt.leafNodeImageClass).addClass(opt.parentNodeImageClass);img.attr("data-role","parent-node-image")}}}},_addData:function(data,path,depth,dataIndex){var originalData=this.nodeDataFor(path),binding=this._retrieveCurrentDepthBinding(depth),temp,i;if(!binding.hasOwnProperty("primaryKey")){if(!originalData){if(this.options.dataSource._rootds._data.length<=this.element.find(".ui-igtree-noderoot").length||this.element.find(".ui-igtree-noderoot").length<=0){if(dataIndex===0){if($.type(data)==="array"){this.options.dataSource._rootds._data=data.concat(this.options.dataSource._rootds._data)}else{this.options.dataSource._rootds._data=[data].concat(this.options.dataSource._rootds._data)}}else if(!dataIndex){if($.type(data)==="array"){for(i=0;i<data.length;i++){this.options.dataSource._rootds._data.push(data[i])}}else{this.options.dataSource._rootds._data.push(data)}}else{this.options.dataSource._rootds._data.splice(dataIndex,0,data)}}}else{if(typeof originalData[binding.childDataProperty]!=="function"){if(!originalData.hasOwnProperty(binding.childDataProperty)||$.type(originalData[binding.childDataProperty])!=="array"){originalData[binding.childDataProperty]=[]}if(dataIndex===0){if($.type(data)==="array"){originalData[binding.childDataProperty]=data.concat(originalData[binding.childDataProperty])}else{originalData[binding.childDataProperty]=[data].concat(originalData[binding.childDataProperty])}}else if(!dataIndex){originalData[binding.childDataProperty]=originalData[binding.childDataProperty].concat(data)}else{temp=originalData[binding.childDataProperty].slice(0,dataIndex);temp=temp.concat(data);originalData[binding.childDataProperty]=temp.concat(originalData[binding.childDataProperty].slice(dataIndex))}}else{if(originalData[binding.childDataProperty]().length<=this.nodeByPath(path).children("ul").children("li").length){if(dataIndex===0){temp=$("<li></li>").appendTo(this.nodeByPath(path).children("ul"));originalData[binding.childDataProperty].unshift(data);temp.remove()}else if(!dataIndex){temp=$("<li></li>").appendTo(this.nodeByPath(path).children("ul"));originalData[binding.childDataProperty].push(data);temp.remove()}else{temp=$("<li></li>").appendTo(this.nodeByPath(path).children("ul"));originalData[binding.childDataProperty]().splice(dataIndex,0,data);temp.remove()}}}}}else{if(!originalData){if(this.options.dataSource._rootds._data.length<=this.element.find(".ui-igtree-noderoot").length||this.element.find(".ui-igtree-noderoot").length<=0){if($.type(data)==="array"){for(i=0;i<data.length;i++){this.options.dataSource._rootds._data.push(data[i])}}else{this.options.dataSource._rootds._data.push(data)}}}else{if(typeof originalData[binding.childDataProperty]!=="function"){if(!originalData.hasOwnProperty(binding.childDataProperty)||$.type(originalData[binding.childDataProperty])!=="array"){originalData[binding.childDataProperty]=[]}originalData[binding.childDataProperty]=originalData[binding.childDataProperty].concat(data)}else{if(originalData[binding.childDataProperty]().length<=this.nodeByPath(path).children("ul").children("li").length){temp=$("<li></li>").appendTo(this.nodeByPath(path).children("ul"));originalData[binding.childDataProperty].push(data);temp.remove()}}}}},_removeData:function(path){var splitPath=path.split(this.options.pathSeparator),data=this.options.dataSource._rootds.data(),i,j,binding=this.options.bindings,key;if(splitPath.length===1){if(!binding.hasOwnProperty("primaryKey")){data.splice(parseInt(splitPath[0],10),1)}else{for(j=0;j<data.length;j++){if(data[j].hasOwnProperty(binding.primaryKey)){key=typeof data[j][binding.primaryKey]==="function"?data[j][binding.primaryKey]():data[j][binding.primaryKey];if(key.toString()===splitPath[0].toString()){data.splice(j,1);break}}}}return}for(i=0;i<splitPath.length-1;i++){if(!binding.hasOwnProperty("primaryKey")){data=data[parseInt(splitPath[i],10)]}else{for(j=0;j<data.length;j++){if(data[j].hasOwnProperty(binding.primaryKey)){key=typeof data[j][binding.primaryKey]==="function"?data[j][binding.primaryKey]():data[j][binding.primaryKey];if(key.toString()===splitPath[i].toString()){data=data[j];break}}}}if(i<splitPath.length-2){if(data[binding.childDataProperty]&&typeof data[binding.childDataProperty]==="function"){data=data[binding.childDataProperty]()}else{data=data[binding.childDataProperty]}}if(binding.hasOwnProperty("bindings")&&i<splitPath.length-2){binding=binding.bindings}}if(data[binding.childDataProperty]&&typeof data[binding.childDataProperty]!=="function"){if(data[binding.childDataProperty]&&data[binding.childDataProperty].length<=1){delete data[binding.childDataProperty]}else{data=data[binding.childDataProperty];if(binding.hasOwnProperty("bindings")){binding=binding.bindings}if(!binding.hasOwnProperty("primaryKey")&&data.length){data.splice(parseInt(splitPath[splitPath.length-1],10),1)}else{for(j=0;j<data.length;j++){if(data[j].hasOwnProperty(binding.primaryKey)&&data[j][binding.primaryKey].toString()===splitPath[i].toString()){data.splice(j,1);break}}}}}else{data=data[binding.childDataProperty]();if(binding.hasOwnProperty("bindings")){binding=binding.bindings}if(!binding.hasOwnProperty("primaryKey")&&data.length){data.splice(parseInt(splitPath[splitPath.length-1],10),1)}else{for(j=0;j<data.length;j++){if(data[j].hasOwnProperty(binding.primaryKey)){key=typeof data[j][binding.primaryKey]==="function"?data[j][binding.primaryKey]():data[j][binding.primaryKey];if(key.toString()===splitPath[splitPath.length-1].toString()){data.splice(j,1);break}}}}}},_recalculatePaths:function(path){var splitPath=path.split(this.options.pathSeparator),index=path.length>0?splitPath[splitPath.length-1]:0,node,parentPath,newPath,ul,child;if(splitPath.length>1){splitPath.splice(splitPath.length-1,1);parentPath=splitPath.join(this.options.pathSeparator);node=this.nodeByPath(parentPath);for(index;index<node.children("ul").children("li").length;index++){newPath=parentPath+this.options.pathSeparator+index;child=$(node.children("ul").children("li")[index]);child.attr("data-path",newPath);if(child.children("ul").length>0&&child.children("ul").children("li").length>0){this._recalculatePaths(newPath+this.options.pathSeparator+"0")}}}else{ul=this.element.is("ul")?this.element:this.element.children("ul");for(index;index<ul.children("li").length;index++){child=$(ul.children("li")[index]);child.attr("data-path",index);if(child.children("ul").length>0&&child.children("ul").children("li").length>0){this._recalculatePaths(index+this.options.pathSeparator+"0")}}}},_loadQueue:null,_toSelect:false,_triggerChainRequest:function(path,toSelect){var list=path.split(this.options.pathSeparator),i,newPath="";if(this._loadQueue===null){this._loadQueue=[]}if(toSelect){this._toSelect=true}for(i=0;i<list.length;i++){newPath+=list[i];this._loadQueue.push(newPath);newPath+=this.options.pathSeparator}this._loadRequest()},_loadRequest:function(){var node;if(this._populatingNode===null){if(this._loadQueue&&this._loadQueue.length>0){node=this.nodeByPath(this._loadQueue.shift());if(this._loadQueue.length>0){if(!this.isExpanded(node)){this.toggle(node)}else{this._loadRequest()}}else if(this._toSelect){this.select(node);this._toSelect=false}}}},_replaceUIValue:function(node,data,item){var element=node.element,binding=this._retrieveCurrentDepthBinding(parseInt(element.parent().attr("data-depth"),10)),value,isFocused,anchor;switch(item){case binding.textKey:if(!binding.nodeContentTemplate){value=typeof data[item]==="function"?data[item]():data[item];element.children("a").text(value)}else{anchor=element.children("a");if(anchor.hasClass(this.css.nodeActive)){isFocused=true}anchor.replaceWith(this._renderNodeTemplate(data,binding));if(this.isSelected(element)){element.children("a").addClass(this.css.nodeSelected);this._selectedNode[0]=this.nodeFromElement(element)}if(isFocused){element.children("a").focus()}}break;case binding.valueKey:value=typeof data[item]==="function"?data[item]():data[item];element.attr("data-value",value);break;case binding.navigateUrlKey:value=typeof data[item]==="function"?data[item]():data[item];element.children("a").attr("href",value);break;case binding.imageUrlKey:value=typeof data[item]==="function"?data[item]():data[item];element.children("img[data-role=node-image]").attr("src",value);break}},dataBind:function(){this._triggerDataBinding();var dataOpt=this._initDataOptions();this._initDataSource(dataOpt);this.options.dataSource.dataBind(this._constructFromData,this)},toggleCheckstate:function(node,event){var self=this,opt=self.options,css=self.css,childCheckboxes,childCheckIcons,checkbox,checkIcon,parentLi,noCancel;if(!node){throw new Error($.ig.Tree.locale.incorrectNodeObject)}if(!opt.checkboxMode||opt.checkboxMode.toLowerCase()==="off"){return}checkbox=node.children("span[data-role=checkbox]");checkIcon=checkbox.children("span");noCancel=self._triggerNodeCheckstateChanging(event,node);if(noCancel){if(opt.checkboxMode.toLowerCase()==="tristate"){if(checkbox.attr("data-chk")==="on"||checkbox.attr("data-chk")==="partial"){childCheckboxes=node.find("span[data-role=checkbox]");childCheckIcons=childCheckboxes.children("span");checkbox.attr("data-chk","off");checkIcon.removeClass(css.checkboxOn).removeClass(css.checkboxPartial).addClass(css.checkboxOff);childCheckboxes.attr("data-chk","off");childCheckIcons.removeClass(css.checkboxOn).removeClass(css.checkboxPartial).addClass(css.checkboxOff);parentLi=checkbox.parent().parent().parent();while(parentLi&&parentLi.is("li")){if(parentLi.find("ul > li > span[data-chk=on]").length<=0){checkbox=parentLi.children("span[data-role=checkbox]");checkIcon=checkbox.children("span");checkbox.attr("data-chk","off");checkIcon.removeClass(css.checkboxOn).removeClass(css.checkboxPartial).addClass(css.checkboxOff);parentLi=this.parentNode(parentLi)}else{checkbox=parentLi.children("span[data-role=checkbox]");checkIcon=checkbox.children("span");checkbox.attr("data-chk","partial");checkIcon.removeClass(css.checkboxOn).removeClass(css.checkboxOff).addClass(css.checkboxPartial);parentLi=this.parentNode(parentLi)}}}else{childCheckboxes=node.find("span[data-role=checkbox]");childCheckIcons=childCheckboxes.children("span");checkbox.attr("data-chk","on");checkIcon.removeClass(css.checkboxOff).removeClass(css.checkboxPartial).addClass(css.checkboxOn);childCheckboxes.attr("data-chk","on");childCheckIcons.removeClass(css.checkboxOff).removeClass(css.checkboxPartial).addClass(css.checkboxOn);parentLi=checkbox.parent().parent().parent();while(parentLi&&parentLi.is("li")){if(parentLi.find("ul > li > span[data-chk=on]").length===parentLi.find("ul > li").length){checkbox=parentLi.children("span[data-role=checkbox]");checkIcon=checkbox.children("span");checkbox.attr("data-chk","on");checkIcon.removeClass(css.checkboxOff).removeClass(css.checkboxPartial).addClass(css.checkboxOn);parentLi=this.parentNode(parentLi)}else{checkbox=parentLi.children("span[data-role=checkbox]");checkIcon=checkbox.children("span");checkbox.attr("data-chk","partial");checkIcon.removeClass(css.checkboxOn).removeClass(css.checkboxOff).addClass(css.checkboxPartial);parentLi=this.parentNode(parentLi)}}}}else{if(checkbox.attr("data-chk")==="on"||checkbox.attr("data-chk")==="partial"){checkbox.attr("data-chk","off");checkIcon.removeClass(css.checkboxOn).removeClass(css.checkboxPartial).addClass(css.checkboxOff)}else{checkbox.attr("data-chk","on");checkIcon.removeClass(css.checkboxOff).addClass(css.checkboxOn)}}self._triggerNodeCheckstateChanged(event,node)}},toggle:function(node,event){var self=this,opt=self.options,css=self.css,noCancel,sibling,siblingExpander,i=0,expander;if(!node){throw new Error($.ig.Tree.locale.incorrectNodeObject)}if(!event){expander=node.children("."+css.nodeExpander)}else{expander=$(event.target).closest("span[data-role=expander]")}if(node.children("ul").attr("data-populated")&&node.children("ul").attr("data-populated")==="false"){this._prepareRequest(node,event);return}if(expander.attr("data-exp")&&expander.attr("data-exp")!=="false"){noCancel=self._triggerNodeCollapsing(event,node);if(noCancel){$(node).children("ul").hide(opt.animationDuration,function(){self._triggerNodeCollapsed(event,node)});expander.removeClass(css.collapseIcon).addClass(css.expandIcon).attr("data-exp",false)}}else{noCancel=self._triggerNodeExpanding(event,node);if(noCancel){if(opt.singleBranchExpand){sibling=node.siblings();for(i;i<sibling.length;i++){siblingExpander=$(sibling[i]).children("."+css.nodeExpander);if(siblingExpander.length>0&&(siblingExpander.attr("data-exp")==="true"||siblingExpander.attr("data-exp")===true)){noCancel=self._triggerNodeCollapsing(event,$(sibling[i]));if(noCancel){$(sibling[i]).children("ul").hide(opt.animationDuration,$.proxy(this._triggerNodeCollapsed(event,$(sibling[i])),this));siblingExpander.removeClass(css.collapseIcon).addClass(css.expandIcon).attr("data-exp",false)}}}}node.children("ul").show(opt.animationDuration,function(){self._triggerNodeExpanded(event,node)});expander.removeClass(css.expandIcon).addClass(css.collapseIcon).attr("data-exp",true)}}},expandToNode:function(node,toSelect){var parentNode,cachedanimationDuration;if(node&&node.length>0){if(typeof node==="string"&&this.nodeByPath(node).length>0){node=this.nodeByPath(node)}if(typeof node==="string"&&this.options.loadOnDemand){this._triggerChainRequest(node,toSelect);return}if(toSelect){this.select(node)}parentNode=this.parentNode(node);cachedanimationDuration=this.options.animationDuration;this.options.animationDuration=0;while(parentNode){if(!this.isExpanded(parentNode)){this.toggle(parentNode)}parentNode=this.parentNode(parentNode)}this.options.animationDuration=cachedanimationDuration}},expand:function(node){var self=this,opt=self.options,css=self.css,sibling,siblingExpander,i=0,expander;if(!node||node.length<=0){throw new Error($.ig.Tree.locale.incorrectNodeObject)}if(node.children("ul").attr("data-populated")&&node.children("ul").attr("data-populated")==="false"){this._prepareRequest(node);return}expander=node.children("."+css.nodeExpander);if(!expander.attr("data-exp")||expander.attr("data-exp")==="false"){if(opt.singleBranchExpand){sibling=node.siblings();for(i;i<sibling.length;i++){siblingExpander=$(sibling[i]).children("."+css.nodeExpander);if(siblingExpander.length>0&&(siblingExpander.attr("data-exp")==="true"||siblingExpander.attr("data-exp")===true)){$(sibling[i]).children("ul").hide(opt.animationDuration);siblingExpander.removeClass(css.collapseIcon).addClass(css.expandIcon).attr("data-exp",false)}}}node.children("ul").show(opt.animationDuration);expander.removeClass(css.expandIcon).addClass(css.collapseIcon).attr("data-exp",true)}},collapse:function(node){var self=this,opt=self.options,css=self.css,expander;if(!node||node.length<=0){throw new Error($.ig.Tree.locale.incorrectNodeObject)}expander=node.children("."+css.nodeExpander);if(expander.attr("data-exp")&&expander.attr("data-exp")!=="false"){$(node).children("ul").hide(opt.animationDuration);expander.removeClass(css.collapseIcon).addClass(css.expandIcon).attr("data-exp",false)}},parentNode:function(node){if(!node){throw new Error($.ig.Tree.locale.incorrectNodeObject)}var parent=node.parent().closest("li[data-role=node]");return parent.length>0?parent:null},nodeByPath:function(nodePath){return this.element.find('li[data-path="'+nodePath+'"]')},nodesByValue:function(value){return this.element.find('li[data-value="'+value+'"]')},checkedNodes:function(){var elements=this.element.find("span[data-chk=on]").parent(),i=0,collection=[];if(elements.length>0){for(i;i<elements.length;i++){collection.push(this.nodeFromElement($(elements[i])))}}return collection},uncheckedNodes:function(){var elements=this.element.find("span[data-chk=off]").parent(),i=0,collection=[];if(elements.length>0){for(i;i<elements.length;i++){collection.push(this.nodeFromElement($(elements[i])))}}return collection},partiallyCheckedNodes:function(){var elements=this.element.find("span[data-chk=partial]").parent(),i=0,collection=[];if(elements.length>0){for(i;i<elements.length;i++){collection.push(this.nodeFromElement($(elements[i])))}}return collection},select:function(node,event){if(!node||node.length<=0){throw new Error($.ig.Tree.locale.incorrectNodeObject)}var css=this.css,nodeId=node.attr("data-path"),noCancel,prevent=false;if(event&&(node.children("a").attr("href")==="#"||node.children("a").attr("href")===document.URLUnencoded+"#")){prevent=true}if(!this._selectedNode){this._selectedNode=[{path:null,element:null,data:null,binding:null}]}if(this._selectedNode[0].path!==null){if(this._selectedNode[0].path!==nodeId){noCancel=this._triggerSelectionChanging(event,node);if(noCancel){this._selectedNode[0].element.children("a").removeClass(css.nodeSelected);node.children("a").addClass(css.nodeSelected);this._selectedNode[0]=this.nodeFromElement(node);this._triggerSelectionChanged(event)}else if(event){prevent=true}}}else{noCancel=this._triggerSelectionChanging(event,node);if(noCancel){node.children("a").addClass(css.nodeSelected);this._selectedNode[0]=this.nodeFromElement(node);this._triggerSelectionChanged(event)}else if(event){prevent=true}}if(prevent){event.preventDefault()}},deselect:function(node){if(!node){throw new Error($.ig.Tree.locale.incorrectNodeObject)}var css=this.css,nodeId=node.attr("data-path");if(!this._selectedNode){this._selectedNode=[{path:null,element:null,data:null,binding:null}]}if(this._selectedNode[0].path!==null){if(this._selectedNode[0].path===nodeId){node.children("a").removeClass(css.nodeSelected);this._selectedNode[0].path=null;this._selectedNode[0].element=null;this._selectedNode[0].data=null;this._selectedNode[0].binding=null}}},clearSelection:function(){var css=this.css,i=0;if(this._selectedNode&&this._selectedNode[0].path!==null){for(i;i<this._selectedNode.length;i++){this._selectedNode[i].element.children("a").removeClass(css.nodeSelected)}this._selectedNode=[{path:null,element:null,data:null,binding:null}]}},selectedNode:function(){if(!this._selectedNode){this._selectedNode=[{path:null,element:null,data:null,binding:null}]}return this._selectedNode[0]},findNodesByText:function(text,parent){var collection=[],nodes,self=this;nodes=parent?parent.find('li > a:contains("'+text+'")'):this.element.find('li > a:contains("'+text+'")');nodes.each(function(){collection.push(self.nodeFromElement($(this).closest("li[data-role=node]")))});return collection
},findImmediateNodesByText:function(text,parent){var collection=[],nodes,self=this;nodes=parent?parent.children("ul").children("li").children('a:contains("'+text+'")'):this.element.is("ul")?this.element.children("li").children('a:contains("'+text+'")'):this.element.children("ul").children("li").children('a:contains("'+text+'")');nodes.each(function(){collection.push(self.nodeFromElement($(this).closest("li[data-role=node]")))});return collection},nodeByIndex:function(index,parent){var node;if(!parent){if(this.element.is("ul")){node=this.element.children().eq(index)}else{node=this.element.children("ul").children().eq(index)}}else{node=parent.children("ul").children().eq(index)}return node},nodeFromElement:function(element){if(element.length>0){var nodeElement={path:element.attr("data-path"),element:element,data:this.nodeDataFor(element.attr("data-path")),binding:this._retrieveCurrentDepthBinding(element.parent().attr("data-depth"))};return nodeElement}},children:function(parent){var children=[],self=this,child,ul;if(parent&&parent.length>0){ul=parent.children("ul");if(ul.length>0){ul.children("li").each(function(){child=$(this);children.push(self.nodeFromElement(child))})}return children}throw new Error($.ig.Tree.locale.incorrectNodeObject)},childrenByPath:function(path){var node=this.nodeByPath(path),children=[],self=this,child,ul;if(node.length>0){ul=node.children("ul");if(ul.length>0){ul.children("li").each(function(){child=$(this);children.push(self.nodeFromElement(child))})}return children}throw new Error($.ig.Tree.locale.incorrectPath+path)},isSelected:function(node){if(!this._selectedNode){this._selectedNode=[{path:null,element:null,data:null,binding:null}]}if(node&&node.length>0){return this._selectedNode[0].path===node.attr("data-path")}throw new Error($.ig.Tree.locale.incorrectNodeObject)},isExpanded:function(node){if(node&&node.length>0){var expander=node.children("span[data-role=expander]");if(expander.length>0){return expander.attr("data-exp")==="true"}}else{throw new Error($.ig.Tree.locale.incorrectNodeObject)}},isChecked:function(node){if(node&&node.length>0){var checkbox=node.children("span[data-role=checkbox]");if(checkbox.length>0){return checkbox.attr("data-chk")==="on"}}else{throw new Error($.ig.Tree.locale.incorrectNodeObject)}},checkState:function(node){if(node&&node.length>0){var checkbox=node.children("span[data-role=checkbox]");if(checkbox.length>0){return checkbox.attr("data-chk")}}else{throw new Error($.ig.Tree.locale.incorrectNodeObject)}},addNode:function(node,parent,nodeIndex){if(!nodeIndex&&typeof parent==="number"){nodeIndex=parent;parent=null}if(!node||node.length<=0){if(parent&&parent.length>0){this._updateParentState(parent)}return}var ul,path,checked,isLi,li,isEmpty,r,binding,self=this;if(!parent){parent=this.element.is("ul")?this.element:this.element.children("ul");if(parent.children().length<=0){this._addData(node,"",0);this._triggerRendering(node);r=$(this._initChildrenRecursively("",node)).appendTo(parent);if(this.options.dragAndDrop){this._initDragAndDrop(r)}this._triggerRendered();this.options.dataSource.root().addNode({data:node,parentPath:"",path:r.attr("data-path")});return}}isLi=parent.is("li");ul=isLi?parent.children("ul"):parent;if(ul.length<=0){ul=$('<ul data-depth="'+(parseInt(parent.parent().attr("data-depth"),10)+1)+'" style="display: none"></ul>').appendTo(parent)}path=isLi?parent.attr("data-path"):"";binding=this._retrieveCurrentDepthBinding(parseInt(ul.attr("data-depth"),10));if(this.options.checkboxMode.toLowerCase()==="tristate"){checked=isLi?this.isChecked(parent):false}this._addData(node,path,parseInt(ul.attr("data-depth"),10)-1,nodeIndex);this._triggerRendering(node);isEmpty=ul.children("li").length<=0;if(nodeIndex===0){MSApp.execUnsafeLocalFunction(function(){li=$(self._initChildrenRecursively(path,node,parseInt(ul.attr("data-depth"),10),checked,ul.children("li").length)).prependTo(ul)});if(!binding.hasOwnProperty("primaryKey")){this._recalculatePaths(path)}}else if(!nodeIndex){MSApp.execUnsafeLocalFunction(function(){li=$(self._initChildrenRecursively(path,node,parseInt(ul.attr("data-depth"),10),checked,ul.children("li").length)).appendTo(ul)})}else{MSApp.execUnsafeLocalFunction(function(){li=$(self._initChildrenRecursively(path,node,parseInt(ul.attr("data-depth"),10),checked,ul.children("li").length)).insertBefore(ul.children("li:eq("+nodeIndex+")"))});if(!binding.hasOwnProperty("primaryKey")){this._recalculatePaths(path)}}if(isLi&&isEmpty){this._updateParentState(parent)}if(this.options.dragAndDrop){this._initDragAndDrop(li)}this._triggerRendered();r=[];li.each(function(){r.push($(this).attr("data-path"))});this.options.dataSource.root().addNode({data:node,parentPath:path,path:r});this._trigger("nodeAdded",null,{owner:this,element:li,data:node,index:nodeIndex,binding:binding})},removeAt:function(path){var node=this.nodeByPath(path),depth=parseInt(node.parent().attr("data-depth"),10),binding,parent=this.parentNode(node),data;if(node.length<=0){return}if(path.indexOf("_remove")!==-1){path=path.replace("_remove","")}binding=this._retrieveCurrentDepthBinding(depth);data={data:$.extend(false,{},this.nodeDataFor(path)),path:path};this._removeData(path,binding);node.remove();if(!binding.hasOwnProperty("primaryKey")){this._recalculatePaths(path)}if(parent&&parent.children("ul").children("li").length<=0){this._updateParentState(parent)}if(this.options.checkboxMode.toLowerCase()==="tristate"&&parent){this._updateParentCheckbox(parent)}this.options.dataSource.root().removeNode(data);this._trigger("nodeDeleted",null,{owner:this,data:data.data,path:path})},removeNodesByValue:function(value){var nodes=this.nodesByValue(value),self=this;nodes.each(function(){self.removeAt($(this).attr("data-path"))})},applyChangesToNode:function(element,data){var node=this.nodeFromElement(element),item;for(item in node.data){if(node.data.hasOwnProperty(item)){this._replaceUIValue(node,data,item)}}},transactionLog:function(){return this.options.dataSource.root()._transactionLog},_triggerSelectionChanging:function(event,node){var args={owner:this,selectedNodes:this._selectedNode,newNodes:[this._constructNodeObject(node)]};return this._trigger(this.events.selectionChanging,event,args)},_triggerSelectionChanged:function(event){var args={owner:this,selectedNodes:this._selectedNode,newNodes:this._selectedNode};this._trigger(this.events.selectionChanged,event,args)},_triggerNodeCollapsing:function(event,node){var args={owner:this,node:this._constructNodeObject(node)};return this._trigger(this.events.nodeCollapsing,event,args)},_triggerNodeCollapsed:function(event,node){var args={owner:this,node:this._constructNodeObject(node)};this._trigger(this.events.nodeCollapsed,event,args)},_triggerNodeExpanding:function(event,node){var args={owner:this,node:this._constructNodeObject(node)};return this._trigger(this.events.nodeExpanding,event,args)},_triggerNodeExpanded:function(event,node){var args={owner:this,node:this._constructNodeObject(node)};this._trigger(this.events.nodeExpanded,event,args)},_triggerNodePopulating:function(event,node){var args=this._constructNodeObject(node);return this._trigger(this.events.nodePopulating,event,args)},_triggerNodePopulated:function(event,node){var args=this._constructNodeObject(node);this._trigger(this.events.nodePopulated,event,args)},_triggerNodeCheckstateChanging:function(event,node){var state=node.children("span[data-role=checkbox]").attr("data-chk"),args={owner:this,node:this._constructNodeObject(node),currentState:state,newState:state==="off"?"on":"off",currentCheckedNodes:this.checkedNodes()};return this._trigger(this.events.nodeCheckstateChanging,event,args)},_triggerNodeCheckstateChanged:function(event,node){var state=node.children("span[data-role=checkbox]").attr("data-chk"),args={owner:this,node:this._constructNodeObject(node),newState:state,newCheckedNodes:this.checkedNodes(),newPartiallyCheckedNodes:this.partiallyCheckedNodes()};return this._trigger(this.events.nodeCheckstateChanged,event,args)},_triggerNodeClick:function(event,node){var args={owner:this,node:this._constructNodeObject(node)};return this._trigger(this.events.nodeClick,event,args)},_triggerNodeDoubleClick:function(event,node){var args=this._constructNodeObject(node);return this._trigger(this.events.nodeDoubleClick,event,args)},_triggerDataBinding:function(){var args={owner:this};this._trigger(this.events.dataBinding,null,args)},_triggerDataBound:function(dataView){var args={owner:this,dataView:dataView};this._trigger(this.events.dataBound,null,args)},_triggerRendering:function(dataView){var args={owner:this,dataView:dataView};this._trigger(this.events.rendering,null,args)},_triggerRendered:function(){var args={owner:this};this._trigger(this.events.rendered,null,args)},_triggerDragStart:function(event,ui,node){var obj=this._constructNodeObject(node),args=$.extend(false,obj,ui);return this._trigger(this.events.dragStart,event,args)},_triggerDrag:function(event,ui,node){var obj=this._constructNodeObject(node),args=$.extend(false,obj,ui);return this._trigger(this.events.drag,event,args)},_triggerDragStop:function(event,ui){this._trigger(this.events.dragStop,event,ui)},_triggerNodeDropping:function(event,ui,node,targetIndex){var obj=this._constructNodeObject(node),args,indexDecrement;obj.targetIndex=targetIndex;obj.originalIndex=ui.draggable.index();indexDecrement=this._sourceNode.element.parent().attr("data-depth")===node.parent().attr("data-depth")&&obj.targetIndex>obj.originalIndex?-1:0;obj.targetIndex+=indexDecrement;args=$.extend(false,obj,ui);return this._trigger(this.events.nodeDropping,event,args)},_triggerNodeDropped:function(event,ui,node){var obj=this._constructNodeObject(node),args=$.extend(false,obj,ui);this._trigger(this.events.nodeDropped,event,args)},_constructNodeObject:function(node){var nodeData=this.nodeDataFor(node!==null?node.attr("data-path"):null),nodeObject={path:node!==null?node.attr("data-path"):null,element:node!==null?node:null,data:nodeData,binding:node!==null?this._retrieveCurrentDepthBinding(parseInt(node.parent().attr("data-depth"),10)):null};return nodeObject},nodeDataFor:function(path){if(!path){return}var splitPath=path.split(this.options.pathSeparator),data=this.options.dataSource._rootds.data(),i,j,binding=this.options.bindings,temp;for(i=0;i<splitPath.length-1;i++){if(!binding.hasOwnProperty("primaryKey")){if(data[parseInt(splitPath[i],10)]){if(typeof data[parseInt(splitPath[i],10)][binding.childDataProperty]==="function"){data=data[parseInt(splitPath[i],10)][binding.childDataProperty]()}else{data=data[parseInt(splitPath[i],10)][binding.childDataProperty]}}}else{for(j=0;j<data.length;j++){if(data[j].hasOwnProperty(binding.primaryKey)){temp=typeof data[j][binding.primaryKey]==="function"?data[j][binding.primaryKey]():data[j][binding.primaryKey];if(temp.toString()===splitPath[i].toString()){data=typeof data[j][binding.childDataProperty]==="function"?data[j][binding.childDataProperty]():data[j][binding.childDataProperty];break}}}}if(binding.hasOwnProperty("bindings")){binding=binding.bindings}}if(!binding.hasOwnProperty("primaryKey")&&data.length){data=data[parseInt(splitPath[splitPath.length-1],10)]}else{for(j=0;j<data.length;j++){if(data[j].hasOwnProperty(binding.primaryKey)){temp=typeof data[j][binding.primaryKey]==="function"?data[j][binding.primaryKey]():data[j][binding.primaryKey];if(temp.toString()===splitPath[i].toString()){data=data[j];break}}}}if(typeof data==="function"){data=data()}return data},destroy:function(){$.Widget.prototype.destroy.apply(this,arguments);this.element.undelegate();this.element.removeClass(this.css.tree);this.element.removeClass(this.css.treeCollection);this.element.removeClass(this.css.treeRoot);if(this.options.width){this.element.css("width","")}if(this.options.height){this.element.css("height","")}if(this.options.dragAndDrop){this._destroyDragAndDrop()}this.element.removeAttr("data-depth");this.element.removeAttr("data-scroll");this.element.empty();return this}});$.extend($.ui.igTree,{version:"15.2.20152.1027"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Grid 15.2.20152.1027
*
* Copyright (c) 2011-2015 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on: 
*	jquery-1.4.4.js
*	jquery.ui.core.js
*	jquery.ui.widget.js
*	modernizr.js (Optional)
*	infragistics.dataSource.js
*	infragistics.ui.shared.js
*	infragistics.templating.js
*	infragistics.util.js
*/
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){var _hovTR,_aNull=function(val){return val===null||val===undefined};$.widget("ui.igGrid",{css:{baseClass:"ui-widget ui-helper-clearfix ui-corner-all",baseContentClass:"ui-widget-content",gridClasses:"ui-iggrid",recordClass:"ui-ig-record ui-iggrid-record",recordAltClass:"ui-ig-altrecord ui-iggrid-altrecord",headerClass:"ui-iggrid-header ui-widget-header",headerTextClass:"ui-iggrid-headertext",headerCellFeatureEnabledClass:"ui-iggrid-headercell-featureenabled",baseHeaderClass:"ui-widget-header",gridTableClass:"ui-iggrid-table ui-widget-content",gridHeaderTableClass:"ui-iggrid-headertable",gridFooterTableClass:"ui-iggrid-footertable ui-widget-footer",gridFooterClass:"",gridCaptionTableClass:"ui-iggrid-captiontable",gridHeaderCaptionClass:"ui-iggrid-headercaption ui-widget-header ui-corner-top",gridTableBodyClass:"ui-iggrid-tablebody",gridScrollDivClass:"ui-iggrid-scrolldiv ui-widget-content",gridVirtualScrollDivClass:"ui-iggrid-virtualscrolldiv",gridFooterCaptionClass:"ui-iggrid-footercaption",deletedRecord:"ui-iggrid-deletedrecord",modifiedRecord:"ui-iggrid-modifiedrecord",rtl:"ui-iggrid-rtl"},options:{width:null,height:null,autoAdjustHeight:true,avgRowHeight:25,avgColumnWidth:null,defaultColumnWidth:null,autoGenerateColumns:true,virtualization:false,virtualizationMode:"fixed",requiresDataBinding:true,rowVirtualization:false,columnVirtualization:false,virtualizationMouseWheelStep:null,adjustVirtualHeights:false,rowTemplate:null,jQueryTemplating:false,templatingEngine:"infragistics",columns:[{headerText:null,key:null,formatter:null,format:null,dataType:"string",width:null,hidden:false,template:null,unbound:false,group:[],rowspan:0,formula:null,unboundValues:null,unboundValuesUpdateMode:"auto",headerCssClass:null,columnCssClass:null}],dataSource:null,dataSourceUrl:null,dataSourceType:null,responseDataKey:null,responseTotalRecCountKey:null,requestType:"GET",responseContentType:"application/json; charset=utf-8",showHeader:true,showFooter:true,fixedHeaders:true,fixedFooters:true,caption:null,features:[{}],tabIndex:0,accessibilityRendering:false,localSchemaTransform:true,primaryKey:null,serializeTransactionLog:true,autoCommit:false,aggregateTransactions:false,autoFormat:"date",renderCheckboxes:false,updateUrl:null,restSettings:{create:{url:null,template:null,batch:false},update:{url:null,template:null,batch:false},remove:{url:null,template:null,batch:false},encodeRemoveInRequestUri:true,contentSerializer:null,contentType:"application/json; charset=utf-8"},alternateRowStyles:true,autofitLastColumn:true,enableHoverStyles:true,enableUTCDates:false,mergeUnboundColumns:false,jsonpRequest:false,enableResizeContainerCheck:true,featureChooserIconDisplay:"desktopOnly"},events:{cellClick:"cellClick",cellRightClick:"cellRightClick",dataBinding:"dataBinding",dataBound:"dataBound",rendering:"rendering",rendered:"rendered",dataRendering:"dataRendering",dataRendered:"dataRendered",headerRendering:"headerRendering",headerRendered:"headerRendered",footerRendering:"footerRendering",footerRendered:"footerRendered",headerCellRendered:"headerCellRendered",rowsRendering:"rowsRendering",rowsRendered:"rowsRendered",schemaGenerated:"schemaGenerated",columnsCollectionModified:"columnsCollectionModified",requestError:"requestError",created:"igcontrolcreated",destroyed:"igcontroldestroyed"},resizeTimeout:300,speedupDOMCleanup:false,cloneChildElements:false,widget:function(){return this.element},_persistVirtualScrollTop:false,_createWidget:function(options){var cols;this.options.columns=null;this.options.features=null;if(options){if(options.dataSource&&($.type(options.dataSource)==="array"||$.type(options.dataSource)==="object")){this.tmpDataSource=options.dataSource;options.dataSource=null;this._originalOptions=options}if(options.autoGenerateColumns===undefined){cols=options.columns;if($.type(cols)==="array"&&cols.length){options.autoGenerateColumns=false}}}$.Widget.prototype._createWidget.apply(this,arguments)},_setOption:function(key,value){var header,isScrolling,hasWidthInPercent=this._gridHasWidthInPercent(),caption,width,id;if(value===this.options[key]){return}isScrolling=this.options.height!==null||this.options.width!==null;$.Widget.prototype._setOption.apply(this,arguments);if(key==="virtualization"||key==="autoGenerateColumns"||key==="rowVirtualization"||key==="columnVirtualization"||key==="fixedHeaders"||key==="scrollbars"){throw new Error($.ig.Grid.locale.optionChangeNotSupported.replace("{optionName}",key))}if(key==="width"){if(isScrolling===true){this.container().css("width",value);this.element.css("width",value);if(this.options.fixedHeaders){this.headersTable().css("width",value)}if(!this._allColumnWidthsInPercentage||!hasWidthInPercent){if(this.options.virtualization===true||this.options.columnVirtualization===true||this.options.rowVirtualization===true){id=this.id();width=parseInt(value,10);this.container().find("#"+id+"_headers_v").css("width",width).css("max-width",width);this.element.css("width",width-this._scrollbarWidth());this._vdisplaycontainer().css("width",width-this._scrollbarWidth()).css("max-width",width-this._scrollbarWidth());this._virtualcontainer().css("width",width).css("max-width",width);this._virtualcontainer().find("> colgroup > col").first().attr("width",width-this._scrollbarWidth());this.container().find("#"+id+"_footer_container").css("width",width).css("max-width",width);this.container().find("#"+id+"_footers").css("width",width).css("max-width",width);this._vhorizontalcontainer().css("width",width);this._gridInnerWidth=this._vdisplaycontainer().width()+this._scrollbarWidth()}else{this._gridInnerWidth=this.scrollContainer().width()}}if(this.options.width!==null&&this.options.height!==null){this._updateGridContentWidth()}this._fireInternalEvent("_gridWidthChanged")}else{throw new Error($.ig.Grid.locale.optionChangeNotScrollingGrid.replace("{optionName}",key))}}else if(key==="height"){if(isScrolling===true){this.scrollContainer().css("overflow-y","auto");if(this.options.autoAdjustHeight){this.container().css("height",value);this._virtualHeightReset=true;this._initializeHeights()}else{this.scrollContainer().css("height",value)}if(this.options.virtualization||this.options.rowVirtualization||this.options.columnVirtualization){if(this.options.virtualizationMode==="fixed"){this._buildVirtualDom();this.virtualScrollTo(this._startRowIndex)}else{this._updateVirtualScrollContainer()}}}else{throw new Error($.ig.Grid.locale.optionChangeNotScrollingGrid.replace("{optionName}",key))}}else if(key==="dataSource"){this.options.dataSource=value;this.dataBind();if(this._inferOpType()!=="remote"){this.autoSizeColumns()}}else if(key==="showHeader"){header=this.headersTable();if(header.length>0&&header.is("table")&&header.find("tbody").length===0){if(value===true){header.show()}else{header.hide()}}else{header=this.element.find("thead tr");if(value===true){header.show()}else{header.hide()}}}else if(key==="caption"){caption=this._caption();if(caption.length===0){this._renderCaption();if(this.options.autoAdjustHeight){this._initializeHeights()}}else{caption.text(value)}}},_initialized:false,_headersInitialized:false,_footerInitialized:false,_mouseClickEventHandler:function(event,eventToTrigger){var $et=$(event.target),row=$et.closest("tr"),key=row.attr("data-id"),colKey,$td,res,currGrid,colIndex=$et.closest("td").index(),rowIndex=row.index(),dataColIndex=colIndex-row.children("td.ui-iggrid-expandcolumn,th,td[data-skip]").length,grid=this;if(grid.element.closest(".ui-iggrid-root").data("igGrid")){currGrid=$et.closest(".ui-iggrid-table").data("igGrid");if(currGrid&&grid.id()!==currGrid.id()){return}}if(key===""||key===null||key===undefined){key=rowIndex}$td=$(event.target);if(!$td.is("td")){$td=$(event.target).closest("td")}if(grid.hasFixedColumns()){if($td.length===1){res=grid._getColumnByTD($td);if(res!==null){colKey=res.column.key;colIndex=res.index}}}else{if(dataColIndex>=0&&dataColIndex<grid._visibleColumns().length){colKey=grid._visibleColumns()[dataColIndex].key}}if(!$et.closest("tr").parent().is("thead")&&($et.is("td")||$et.closest("td").length===1&&$et.closest("td").parent().attr("data-container")!=="true")){key=grid._fixPKValue(key);if(grid.hasFixedColumns()){row=grid._isFixedElement(row)?row.add(this.rowAt(rowIndex)):row.add(this.fixedRowAt(rowIndex))}grid._trigger(eventToTrigger,event,{rowIndex:rowIndex,rowKey:key,row:row,colIndex:colIndex,colKey:colKey,cellElement:$td[0],owner:grid})}},_create:function(){var grid=this,i,container,attr;this._mouseClickEventHandlers={click:function(event){grid._mouseClickEventHandler(event,grid.events.cellClick)},contextmenu:function(event){grid._mouseClickEventHandler(event,grid.events.cellRightClick)}};this._isHierarchicalGrid=false;this._hasUnboundColumns=false;if(this.options._isHierarchicalGrid===true){this._isHierarchicalGrid=true}if(this.cloneChildElements&&this.element.is("table")&&this.element.children().length>0){this._initialChildren=this.element.children().clone(true)}this._initialAttributes=[];attr=this.element[0].attributes;for(i=0;i<attr.length;i++){if(attr[i].name!=="id"){this._initialAttributes.push({name:attr[i].name,value:attr[i].value})}}this._rtl=this.element[0].style.direction==="rtl";this._padding=this._rtl?"padding-left":"padding-right";if(this.tmpDataSource!==null&&this.tmpDataSource!==undefined){this.options.dataSource=this.tmpDataSource;this._originalOptions.dataSource=this.tmpDataSource}this._testInnerHtml();this._headerInitCallbacks=[];this._footerInitCallbacks=[];this._cellStyleSubscribers=[];this._firstBind=true;this._isMultiColumnGrid=false;this._unboundValues={};if(!this.options.columns){this.options.columns=[]}if(!this.options.features){this.options.features=[]}if(this._isMultiColumnHeader()===true){this._isMultiColumnGrid=true;this._generateColumnFlatStructure(this.options.columns);this._headerCells=[]}if(this.options.rowVirtualization===true&&this.options.virtualizationMode==="continuous"){this.options.virtualization=true}if(this.options.columnVirtualization===true){this.options.virtualization=true;if(this.options.virtualizationMode==="continuous"){throw new Error($.ig.Grid.locale.colVirtualizationDenied)}this.options.virtualizationMode="fixed"}if(this.options.virtualization===true||this.options.columnVirtualization===true||this.options.rowVirtualization===true){if(this.options.virtualizationMode===undefined||this.options.virtualizationMode===""){this.options.virtualizationMode="fixed"}if(this.options.virtualizationMode==="fixed"){this.options.fixedHeaders=true;this.options.fixedFooters=true}}if(this.options.virtualization===true||this.options.rowVirtualization===true){if(this.options.defaultColumnWidth==="*"){throw new Error($.ig.Grid.locale.virtualizationNotSupportedWithAutoSizeCols)}for(i=0;i<this.options.columns.length;i++){if(this.options.columns[i].width==="*"){throw new Error($.ig.Grid.locale.virtualizationNotSupportedWithAutoSizeCols)}}}if(this.options.virtualization===true&&this.options.virtualizationMode==="continuous"){this.options.fixedHeaders=true}if((this.options.height===null||parseInt(this.options.height,10)<=0)&&this.options.fixedHeaders===true){this.options.fixedHeaders=false}if((this.options.height===null||parseInt(this.options.height,10)<=0)&&this.options.fixedFooters===true){this.options.fixedFooters=false}this.dataBind(true);this.element.bind(this._mouseClickEventHandlers);if(this.options.enableResizeContainerCheck&&(this.options.height!==null&&this.options.height.indexOf&&this.options.height.indexOf("%")!==-1||this.options.width!==null&&this.options.width.indexOf&&this.options.width.indexOf("%")!==-1||!this.element.is(":visible"))){if(!this.element.is(":visible")){this._recheckVisibility=true}if($.ig.util.isIE){container=this.container();if(container.length>0&&container[0].attachEvent){this._resizeContainerHandler=$.proxy(this.resizeContainer,this);container[0].attachEvent("onresize",this._resizeContainerHandler)}}if(!this._resizeContainerHandler){this._resId=setInterval($.proxy(this.resizeContainer,this),this.resizeTimeout)}}for(i=0;i<this.options.columns.length;i++){if(this.options.columns[i].hidden===undefined){this.options.columns[i].hidden=false}}this._uiSoftDirtyHandler=$.proxy(this._onFeaturesSoftDirty,this);this.element.bind("iggriduisoftdirty",this._uiSoftDirtyHandler);this._oldScrollTop=0;this.element.trigger(this.events.created,{owner:this});if(this._rtl){this.container().addClass(this.css.rtl)}},_fixPKValue:function(val){var col,data,pk=this.options.primaryKey;if(_aNull(val)){return null}if(pk){col=this.columnByKey(pk);if(col&&col.dataType){if(col.dataType==="number"||col.dataType==="numeric"){val=parseInt(val,10)}}else{data=this.dataSource._data;if(data&&data.length>0){if(typeof data[0][pk]==="number"){val=parseInt(val,10)}}}}else{data=this.dataSource._data;if(data&&data.length>0){if(typeof data[0].ig_pk==="number"){val=parseInt(val,10)}}}return val},hasFixedDataSkippedColumns:function(){return!!this._hasFixedDataSkippedColumns},hasFixedColumns:function(){if(this._hasFixedDataSkippedColumns||!_aNull(this._fixedColumns)&&this._fixedColumns.length>0){return true}return false},fixingDirection:function(){var hasFixedCols=this.hasFixedColumns();return hasFixedCols?this.fixedBodyContainer().attr("data-fixing-direction"):null},isFixedColumn:function(colKey){var isFixed=false,typeColKey=$.type(colKey),cols;if(!this.hasFixedColumns()){return false}if(typeColKey==="string"){$.each(this._fixedColumns,function(ind,c){if(c.key===colKey){isFixed=true;return false}})}else if(typeColKey==="number"){cols=this._visibleColumns();if(colKey<0||colKey>=cols.length){return false}isFixed=cols[colKey].fixed===true}return isFixed},_onColumnFixed:function(colInd,isFixed,colsCount,isInit,visibleIndex,at){var result={colInd:colInd,isFixed:isFixed,fixedColsCount:colsCount,isInit:isInit,visibleIndex:visibleIndex,at:at};this._fireInternalEvent("_columnFixed",result)},_onGroupedColumnsChanging:function(groupedColumns){this._fireInternalEvent("_groupedColumnsChanging",{groupedColumns:groupedColumns})},_onGroupedColumnsChanged:function(groupedColumns){this._fireInternalEvent("_groupedColumnsChanged",{groupedColumns:groupedColumns})},_testInnerHtml:function(){var t=document.createElement("table");try{t.innerHTML="<tr><td> t </td></tr>";this._canreplaceinner=true}catch(e){this._canreplaceinner=false}},resizeContainer:function(){var scrollContainerWidth,o=this.options,visibilityChanged=false,v=o.virtualization===true||o.rowVirtualization===true||o.columnVirtualization===true;if(this._recheckVisibility&&this.element.is(":visible")){this._prevContainerHeight=0;visibilityChanged=true;this._recheckVisibility=false;if(this._resId&&!(this.options.height!==null&&this.options.height.indexOf&&this.options.height.indexOf("%")!==-1||this.options.width!==null&&this.options.width.indexOf&&this.options.width.indexOf("%")!==-1)){clearInterval(this._resId)}}if(o.autoAdjustHeight&&this.container().height()!==this._prevContainerHeight){this._initializeHeights();if(v&&visibilityChanged){this._avgRowHeight=null;if(!this.container().find("#"+this.id()+" > tbody > tr:not([data-container]):visible:first").length){delete this._virtualDom;this._renderVirtualRecords()}this._updateVirtualScrollContainer();this._onVirtualVerticalScroll()}}if(o.width!==null&&o.height!==null){if(v===false){scrollContainerWidth=this.scrollContainer().width()}else{scrollContainerWidth=this._vdisplaycontainer().width()+this._scrollbarWidth()}if(this._gridInnerWidth!==scrollContainerWidth&&(this._gridInnerWidth>0||scrollContainerWidth>0)){this._gridInnerWidth=scrollContainerWidth;this._updateHScrollbarVisibility()}if(v===false&&this.scrollContainer().get(0).scrollHeight>this.scrollContainer().get(0).clientHeight!==this._hasVerticalScrollbar){this._adjustLastColumnWidth()}}},_isMultiColumnHeader:function(){var cols=this.options.columns,i;for(i=0;i<cols.length;i++){if(cols[i].group!==undefined&&cols[i].group!==null){return true}}return false},_analyzeMultiColumnHeaders:function(cols,newCols,level,oldCols,children,isHidden){var i,j,res,colsLength=cols.length,colspan=0,ind=[],groupChildren=[],identifier,hidden;for(i=0;i<colsLength;i++){if(cols[i].group!==undefined&&cols[i].group!==null){if(cols[i].key!==undefined&&cols[i].key!==null){identifier=cols[i].key.toString()}else{identifier=(this._multiColumnIdentifier++).toString()}if(!cols[i].identifier){cols[i].identifier=identifier}groupChildren=[];hidden=false;if(isHidden===true||cols[i].hidden===true){hidden=true}res=this._analyzeMultiColumnHeaders(cols[i].group,newCols,level+1,oldCols[i].group,groupChildren,hidden);oldCols[i].colspan=res.colspan;oldCols[i].children=groupChildren;for(j=0;j<groupChildren.length;j++){children.push(groupChildren[j])}ind.push(i);colspan+=res.colspan}else{colspan++;oldCols[i].level=0;oldCols[i].level0=true;if(isHidden===true){cols[i].hidden=true}children.push(cols[i]);newCols.push(cols[i])}}for(j=0;j<ind.length;j++){oldCols[ind[j]].level=this._maxLevel-level}return{colspan:colspan}},_getMultiHeaderColumnById:function(id,level,cols){var i,colsLength,res=null;if(cols===null||cols===undefined){if(this._oldCols===null||this._oldCols===undefined){return null}cols=this._oldCols}colsLength=cols.length;for(i=0;i<colsLength;i++){if(cols[i].identifier===id&&(level===undefined||cols[i].level===level)){return cols[i]}if(cols[i].group!==null&&cols[i].group!==undefined){res=this._getMultiHeaderColumnById(id,level,cols[i].group);if(res!==null){return res}}}return null},_getMaxLevelRecursive:function(level,cols){var i,colsLength=cols.length,ml=level,l,rowspan;for(i=0;i<colsLength;i++){rowspan=1;if(cols[i].rowspan!==null&&cols[i].rowspan!==undefined&&cols[i].rowspan>0){rowspan=cols[i].rowspan}if(cols[i].group!==undefined&&cols[i].group!==null){l=this._getMaxLevelRecursive(level+rowspan,cols[i].group);if(l>ml){ml=l}}else if(rowspan>0){l=level+rowspan-1;if(l>ml){ml=l}}}return ml},_headerInit:function(tr,colgroup,prepend){var i;for(i=0;i<this._headerInitCallbacks.length;i++){this._headerInitCallbacks[i].func(tr,colgroup,prepend)}},_footerInit:function(tr,colgroup,prepend,cssClass){var i;for(i=0;i<this._footerInitCallbacks.length;i++){this._footerInitCallbacks[i].func(tr,colgroup,prepend,cssClass)}},id:function(){return this.element[0].id},_caption:function(){return this.container().find("caption")},_rootContainer:function(){var rootElement;if(!this._rContainer||this._rContainer.length===0){rootElement=this.element.closest(".ui-iggrid-root");this._rContainer=rootElement.length===1?rootElement.data("igGrid").container():this.container()}return this._rContainer},container:function(){if(!this._container||this._container.length===0){this._container=this.element.closest("div[id="+this.id()+"_container]")}return this._container},headersTable:function(){if(this.options.fixedHeaders===true&&this.options.height!==null){return this.container().find("#"+this.id()+"_headers")}return this.element},footersTable:function(){if(this.options.fixedFooters===true&&this.options.height!==null){return this.container().find("#"+this.id()+"_footers")}return this.element},scrollContainer:function(){return this.container().children("#"+this.id()+"_scroll")},fixedContainer:function(){return this.container().find("#"+this.id()+"_mainFixedContainer")},fixedBodyContainer:function(){return this.container().find("#"+this.id()+"_fixedBodyContainer")},fixedFooterContainer:function(){return this.container().find("#"+this.id()+"_fixedFooterContainer")},fixedHeaderContainer:function(){return this.container().find("#"+this.id()+"_fixedHeaderContainer")},fixedHeadersTable:function(){if(this.options.fixedHeaders===true&&this.options.height!==null){return this.container().find("#"+this.id()+"_headers_fixed")}return this.container().find("#"+this.id()+"_fixed")},fixedFootersTable:function(){if(this.options.fixedFooters===true&&this.options.height!==null){return this.container().find("#"+this.id()+"_footers_fixed")}return this.container().find("#"+this.id()+"_fixed")},_vdisplaycontainer:function(){return this.container().find("#"+this.id()+"_displayContainer")},_virtualcontainer:function(){return this.container().find("#"+this.id()+"_virtualContainer")},_vhorizontalcontainer:function(){return this.container().find("#"+this.id()+"_horizontalScrollContainer")},_fixedfooters:function(){return this.container().find("#"+this.id()+"_footer_container")},cellAt:function(x,y,isFixed){var i,row;if(x===undefined||y===undefined){return null}if(this.table===undefined){this.table=this.element[0]}i=this._dataRowIndex(y);if(isFixed===true){if(this._fixedTable===undefined){this._fixedTable=this.element}return this._fixedTable[0].rows[i].cells[x]}row=this.table.rows[i];if(!row){return null}return row.cells[x]},cellById:function(rowId,columnKey){var colIndex,i,cols,row,skippedCells,isFixed=this.isFixedColumn(columnKey),sci=this._startColIndex||0;if(_aNull(rowId)||_aNull(columnKey)){return null}if(this.table===undefined){this.table=this.element[0]}cols=this._visibleColumns(isFixed);for(i=0;i<cols.length;i++){if(cols[i].key===columnKey){colIndex=i;break}}if(_aNull(colIndex)){return null}if(isFixed){row=this.fixedBodyContainer().find("tbody").first().children("[data-id='"+rowId+"']").first()}else{row=this.element.children("tbody").children("[data-id='"+rowId+"']").first()}skippedCells=row.children("th,[data-skip=true],[data-parent]").length;return row.children("td:nth-child("+(colIndex+1+skippedCells-sci)+")")},fixedTable:function(){if(this._fixedTable===undefined){this._fixedTable=this.element}return this._fixedTable},_calculateHeaderFooterRows:function(){var theadCount=0,tfootCount=0;theadCount=this.element.children("thead").children("tr").length;if($.ig.util.isOpera){tfootCount=this.element.children("tfoot").children("tr").length}return theadCount+tfootCount},_dataRowIndex:function(i){var extrahr,j;if(this.table===undefined){this.table=this.element[0]}if(this._additionalTrCount===undefined||this._additionalTrCount===null){this._additionalTrCount=this._calculateHeaderFooterRows()}if(this._hc===true){extrahr=this.element.children("tbody").children("tr[data-container]");for(j=0;j<extrahr.length;j++){if($(extrahr[j]).index()<=i){i+=1}}}i=i+this._additionalTrCount;if(i>=this.table.rows.length){i=this.table.rows.length-1}else if(i<0){i=0}return i},immediateChildrenWidgets:function(){return this.element.children("tbody").children("tr").children(".ui-iggrid-childarea").children("div").children("div").map(function(){if($(this).children(".ui-iggrid-scrolldiv").length>0){return $(this).children(".ui-iggrid-scrolldiv").children(".ui-iggrid-table").data("igGrid")}return $(this).children(".ui-iggrid-table").data("igGrid")})},childrenWidgets:function(){return this.element.find("tbody > tr > .ui-iggrid-childarea").find(".ui-iggrid-table").map(function(){return $(this).data("igGrid")})},children:function(){return this.element.find("tbody > tr > .ui-iggrid-childarea").find(".ui-iggrid-table")},immediateChildren:function(){return this.element.children("tbody").children("tr").children(".ui-iggrid-childarea").children("div").children("div").map(function(){if($(this).children(".ui-iggrid-scrolldiv").length>0){return $(this).children(".ui-iggrid-scrolldiv").children(".ui-iggrid-table")}return $(this).children(".ui-iggrid-table")})},rowAt:function(i){i=this._dataRowIndex(i);return this.table.rows[i]},rowById:function(rowId,isFixed){if(_aNull(rowId)){return null}if(isFixed){return this.fixedBodyContainer().find("tbody").first().children("[data-id='"+rowId+"']").first()}return this.element.children("tbody").children("[data-id='"+rowId+"']").first()},fixedRowAt:function(i){var rows=this.fixedBodyContainer().find("tbody>tr");if(rows.length>0){return rows[i]}return null},fixedRows:function(){return this.fixedBodyContainer().find("tbody>tr")},rows:function(){return this.element.children("tbody").children("tr")},allFixedRows:function(){return this.fixedBodyContainer().find("tbody tr")},allRows:function(){return this.element.find("tbody tr")},columnByKey:function(key){var cols=this.options.columns,i;for(i=0;i<cols.length;i++){if(String(cols[i].key)===String(key)){return cols[i]}}return null},columnByText:function(text){var cols=this.options.columns,i;for(i=0;i<cols.length;i++){if(cols[i].headerText===text){return cols[i]}}return null},selectedCells:function(){if(this._selection.settings.owner!==this){return[]}return this._selection.settings.multipleSelection?this._selection.selectedCells():null},selectedRows:function(){if(this._selection.settings.owner!==this){return[]}return this._selection.settings.multipleSelection?this._selection.selectedRows():null},selectedCell:function(){var selectedCells;if(this._selection.settings.owner!==this){return null}selectedCells=this._selection.selectedCells();return this._selection.settings.multipleSelection?null:selectedCells.length===1?selectedCells[0]:null},selectedRow:function(){var selectedRows;if(this._selection.settings.owner!==this){return null}selectedRows=this._selection.selectedRows();return this._selection.settings.multipleSelection?null:selectedRows.length===1?selectedRows[0]:null},activeCell:function(){if(this._selection instanceof $.ig.SelectedRowsCollection){return null}if(this._selection.settings.owner!==this){return null}return this._selection.activeCell()},activeRow:function(){if(this._selection instanceof $.ig.SelectedCellsCollection){return null}if(this._selection.settings.owner!==this){return null}return this._selection.activeRow()},getCellValue:function(rowId,colKey){var id=parseInt(rowId,10),i,cols=this.options.columns,colFound=false,rec,primaryKeyCol,tx;tx=this.dataSource.pendingTransactions();if(this.options.autoCommit===false&&tx.length>0){for(i=0;i<tx.length;i++){if(tx[i].rowId===rowId){if(tx[i].type==="cell"&&tx[i].col===colKey){return tx[i].value}if(tx[i].type==="row"||tx[i].type==="newrow"){return tx[i].row[colKey]}}}}if($.type(colKey)==="string"){for(i=0;i<cols.length;i++){if(cols[i].key===colKey){colFound=true;break}}if(colFound===false){throw new Error($.ig.Grid.locale.noSuchColumnDefined)}}if(this.options.primaryKey!==null){primaryKeyCol=this.columnByKey(this.options.primaryKey);if(primaryKeyCol.dataType==="number"||primaryKeyCol.dataType==="numeric"){rec=this.dataSource.findRecordByKey(parseInt(rowId,10))}else{rec=this.dataSource.findRecordByKey(rowId)}if(rec===null||rec===undefined){throw new Error($.ig.Grid.locale.recordNotFound.replace("{id}",rowId))}return rec[colKey]}if(id>=this.dataSource.dataView().length){throw new Error($.ig.Grid.locale.indexOutOfRange.replace("{max}",this.dataSource.dataView().length))}if($.type(colKey)==="string"){return this.dataSource.dataView()[id][colKey]}if(cols.length<=colKey){throw new Error($.ig.Grid.locale.columnIndexOutOfRange.replace("{max}",cols.length))}return this.dataSource.dataView()[id][colKey]},getCellText:function(rowId,colKey){var colIndex;if($.type(colKey)==="string"){colIndex=this._getCellIndexByColumnKey(colKey)}else{colIndex=colKey}if(colIndex===undefined){throw new Error($.ig.Grid.locale.columnNotFound.replace("{key}",colKey))}if(this.options.primaryKey!==null){return this.element.find("tr[data-id='"+rowId+"']>td:nth-child("+(colIndex+1)+")").text()}return $(this.cellAt(colIndex,parseInt(rowId,10))).text()},setColumnTemplate:function(col,tmpl,render){var colIdx=this._getColIdxById(this.options.columns,col);if(colIdx===null||colIdx===undefined){return}col=this.options.columns[colIdx];col.template=tmpl;render=render===null||render===undefined?true:render;if(render&&!col.hidden){this._renderData()}},commit:function(rowId){var key;key=this._normalizedKey(rowId);this.dataSource.commit(key);if(this._fireInternalEvent("_gridCommit")){return}this._isToSetUnboundColumns=true;if(this.options.virtualization||this.options.rowVirtualization||this.options.columnVirtualization){if(this.options.virtualizationMode==="continuous"){this._renderVirtualRecords()}else{this._buildVirtualDom();this.virtualScrollTo(this._startRowIndex)}}else{this._renderData()}},rollback:function(rowId,updateUI){var key=this._normalizedKey(rowId),transactions=this.dataSource.rollback(key),transaction,content,i,tridx,rec,tr,td,index,col;if(updateUI===true){if(!_aNull(rowId)){if(transactions.length===0){return}i=transactions.length;while(i-->0){transaction=transactions[i];tr=this.element.find("tr[data-id='"+transaction.rowId+"']");switch(transaction.type){case"newrow":tridx=this.element.children("tbody").children("tr:not([data-container],[data-grouprow])").index(tr);tr.remove();this._reapplyZebraStyle(tridx);break;case"deleterow":tr.removeClass(this.css.deletedRecord);break;case"cell":col=this.columnByKey(transaction.col);tr.removeClass(this.css.modifiedRecord);td=this.cellById(transaction.rowId,transaction.col);rec=this.dataSource.findRecordByKey(transaction.rowId);if(col.template&&col.template.length){content=this._renderTemplatedCell(rec,col);index=content.indexOf(">");content=content.substring(index+1,content.length);td.html(content)}else{td.html(String(this._renderCell(rec[transaction.col],col,rec)))}break;case"row":tr.removeClass(this.css.modifiedRecord);rec=this.dataSource.findRecordByKey(transaction.rowId);this._renderRow(rec,tr[0],rec[this.options.primaryKey]);break}}}else{this.dataBind()}}},findRecordByKey:function(key){return this.dataSource.findRecordByKey(key)},getDetachedRecord:function(t){return this.dataSource.getDetachedRecord(t)},pendingTransactions:function(){return this.dataSource.pendingTransactions()},allTransactions:function(){return this.dataSource.allTransactions()},transactionsAsString:function(){return this.dataSource.transactionsAsString()},_normalizedKey:function(id){var key,primaryKeyCol;if(id===undefined||id===null){return null}key=id;if(this.options.primaryKey!==null){primaryKeyCol=this.columnByKey(this.options.primaryKey);if(primaryKeyCol.dataType==="number"||primaryKeyCol.dataType==="numeric"){key=parseInt(id,10)}}else{key=parseInt(id,10)}return key},saveChanges:function(success,error){this.dataSource.saveChanges(success,error)},_renderRow:function(rec,tr){var i,j=0,tds,cols,col,cs,cl,content,cv=this.options.virtualization||this.options.columnVirtualization;tr=$(tr);tds=tr.children("td:not([data-skip='true'],[data-parent])");cols=this._visibleColumns();cs=this._startColIndex||0;cl=cv?this._virtualColumnCount+cs:cols.length;for(i=cs;i<cl;i++){col=cols[i];if(col.template&&col.template.length){content=this._renderTemplatedCell(rec,col);if(content.indexOf("<td")===0){tds.eq(j).html($(content).html())}else{tds.eq(j).html(content)}}else{tds.eq(j).html(String(this._renderCell(rec[col.key],col,rec)))}j++}return tr},renderNewRow:function(rec){var tbody=this.element.children("tbody"),index,self=this,virt=this.options.virtualization===true||this.options.rowVirtualization===true,fv=this.options.virtualizationMode==="fixed";if(virt){if(fv){this._buildVirtualDom()}else{this._renderVirtualRecordsContinuous();this._startRowIndex=0}this.virtualScrollTo(this._totalRowCount)}else{index=tbody.children('[data-container!="true"]').length;MSApp.execUnsafeLocalFunction(function(){tbody.append(self._renderRecord(rec,index))})}},_findTableRowByKey:function(key){var primaryKeyIndex,cols=this.options.columns,r,i;if(this.options.primaryKey!==null){for(i=0;i<cols.length;i++){if(cols[i].key===this.options.primaryKey){primaryKeyIndex=i;break}}if(primaryKeyIndex===undefined){throw new Error($.ig.Grid.locale.columnNotFound.replace("{key}",this.options.primaryKey))}r=this.element.find("td:nth-child('"+(primaryKeyIndex+1)+"'):contains('"+key+"')").parent();return r.length===0?null:r[0]}return this.rowAt(parseInt(key,10))},dataSourceObject:function(dataSource){if(dataSource!==undefined){this.options.dataSource=dataSource}else{return this.options.dataSource}},totalRecordsCount:function(){return this.dataSource.totalRecordsCount()},_wrapElementDiv:function(){this._isWrapped=true;this.element=$("<table role='grid'></table>").appendTo(this.element).attr("id",this.id()+"_table");
this.element.data("igGrid",this)},dataBind:function(internal){var dataOptions,i,noCancel=true,noCancelRendering=true,customFunc,dataSource;if(!this._initialized){noCancelRendering=this._trigger(this.events.rendering,null,{owner:this})}if(noCancelRendering){dataOptions=this._generateDataSourceOptions(this.options);dataSource=this._createDataSource(dataOptions);noCancel=this._trigger(this.events.dataBinding,null,{owner:this,dataSource:dataSource});if(internal===undefined){this.options.requiresDataBinding=true}if(noCancel){if(this.options.requiresDataBinding){if(this._hasUnboundColumns){this._rebindUnboundColumns=true}this._dataOptions=dataOptions;this.dataSource=dataSource;if(this.dataSource){customFunc=this.dataSource.settings.sorting.customConvertFunc;this.dataSource.settings.sorting.customConvertFunc=$.proxy(this._convertSortingDataSourceValue,this);if(customFunc&&(customFunc.guid===undefined||customFunc.guid!==this.dataSource.settings.sorting.customConvertFunc.guid)){this._oSortingCustomConvertFunc=customFunc}}if(!this._initialized){if(this.element.is("div")){this._wrapElementDiv()}for(i=0;i<this.options.features.length;i++){this._initFeature(this.options.features[i],dataOptions)}if(this.options.autoGenerateColumns!==true){this._captureInitiallyHiddenColumns()}this._visibleColumnsArray=undefined}else{this._isDataBoundCalled=true;this.element.trigger("iggriduidirty",{owner:this});for(i=0;i<this.options.features.length;i++){this._initFeatureSettings(this.options.features[i])}}this._renderGrid();if(this._loadingIndicator===undefined){this._initLoadingIndicator()}if(this._loadingIndicator){this._loadingIndicator.show()}this.dataSource.dataBind();this.options.requiresDataBinding=false}else{this._renderGrid()}}}else{this._cancelRendering=true}},_mergeUnboundValues:function(){var i,primaryKeyCol,metadataUC,rec,ucLength,primaryKeyColIsNumber,col,schema,type,dataLength,data,key,val,j,pk=this.options.primaryKey,metadata=this.dataSource.metadata("unboundValues"),self=this,hasPrimaryKey=pk!==null&&pk!==undefined,metaDataMergeFunction;if(metadata===undefined||metadata===null||metadata.length===0||!this._unboundColumns){return}if(hasPrimaryKey){metaDataMergeFunction=function(ind,val){if(primaryKeyColIsNumber){rec=self.dataSource.findRecordByKey(parseInt(ind,10))}else{rec=self.dataSource.findRecordByKey(ind)}if(rec===null||rec===undefined){return true}if(schema!==undefined&&schema!==null){val=schema._convertType(type,val,rec[pk],key)}self._addUnboundColumnValue(key,val);rec[key]=val};primaryKeyCol=this.columnByKey(pk);primaryKeyColIsNumber=primaryKeyCol.dataType==="number"}ucLength=this._unboundColumns.length;schema=this.dataSource.schema();for(i=0;i<ucLength;i++){key=this._unboundColumns[i].key;metadataUC=metadata[key];if(metadataUC===null||metadataUC===undefined){continue}col=this.getUnboundColumnByKey(key);type=null;if(col!==null&&col.dataType){type=col.dataType}if(hasPrimaryKey){$.each(metadataUC,metaDataMergeFunction)}else{self._renderUnboundValues(metadataUC,key)}if(type==="bool"||type==="boolean"){data=this.dataSource.data();val=schema._convertType(type,undefined);dataLength=data.length;if(dataLength<=metadataUC.length){continue}for(j=0;j<dataLength;j++){if(data[j][key]===undefined){data[j][key]=val}}}}},_convertSortingDataSourceValue:function(val,key){var o=this.options,enableUTCDates=o.enableUTCDates,format,rowTemplate,col,dsFunc=this._oSortingCustomConvertFunc;if($.type(val)==="date"){rowTemplate=!o.rowTemplate||o.rowTemplate.length<=0;col=this.columnByKey(key);if(col!==undefined&&col!==null){format=col.format}if(format){if(format==="time"||format==="timeLong"||format==="h:mm:ss tt"){val=new Date("January 01, 2000 "+$.ig.formatter(val,"date",format,rowTemplate,enableUTCDates))}}}if($.isFunction(dsFunc)){if(dsFunc.guid===undefined||dsFunc.guid!==this.dataSource.settings.sorting.customConvertFunc.guid){val=dsFunc(val,key)}}return val},_generateDataSourceOptions:function(){var schema,dataOptions,t,headers,i,instanceOfDs;if(!this.options.dataSource&&!this.options.dataSourceUrl&&this.element.is("table")&&this.element.find("tbody").children().length>0){this.options.dataSource=this.element[0]}if(this.options.dataSource){if(this.options.dataSource.tagName&&this.options.dataSource.nodeType){t=$(this.options.dataSource)}else if($.type(this.options.dataSource.type)==="function"&&this.options.dataSource.type()==="htmlTableString"&&$.type(this.options.dataSource.dataSource)==="function"){t=$(this.options.dataSource.dataSource())}if(t&&t.is("table")&&t.find("thead th").length>0){headers=t.find("thead tr th");this._tb_h=true;this._tb_h_arr=[];for(i=0;i<headers.length;i++){this._tb_h_arr.push($(headers[i]).text())}}}dataOptions={callback:$.proxy(this._renderData,this),callee:this,responseDataKey:this.options.responseDataKey,responseTotalRecCountKey:this.options.responseTotalRecCountKey,dataSource:this.options.dataSource,requestType:this.options.requestType,responseContentType:this.options.responseContentType,primaryKey:this.options.primaryKey,localSchemaTransform:this.options.localSchemaTransform,autoCommit:this.options.autoCommit,aggregateTransactions:this.options.aggregateTransactions,serializeTransactionLog:this.options.serializeTransactionLog,updateUrl:this.options.updateUrl,restSettings:this.options.restSettings,enableUTCDates:this.options.enableUTCDates};if(this.options.dataSourceType!==null){dataOptions.type=this.options.dataSourceType}if(!this.options.dataSource||!this.options.dataSource.schema||!this.options.dataSource.schema()||this.options.dataSource.schema()._type!=="xml"){schema=this._generateDataSourceSchema()}instanceOfDs=this.options.dataSource&&typeof this.options.dataSource._xmlToArray==="function"&&typeof this.options.dataSource._encodePkParams==="function";if(instanceOfDs&&(this.options.dataSource.settings.schema===null||!this.options.dataSource.settings.schema.fields||this.options.dataSource.settings.schema.fields&&this.options.dataSource.settings.schema.fields.length>=0)||!instanceOfDs){dataOptions=$.extend(dataOptions,{schema:schema})}return dataOptions},_insertUnboundColumn:function(column){if(this._unboundColumns===null||this._unboundColumns===undefined){this._unboundColumns=[]}this._unboundColumns.push(column);if(column.key&&(this._unboundValues[column.key]===null||this._unboundValues[column.key]===undefined)){this._unboundValues[column.key]=[]}if(column.unboundValues&&column.unboundValues.length>0){this._isToSetUnboundColumns=true}this._hasUnboundColumns=true},_addUnboundColumnValue:function(key,value,index){if(this._unboundValues[key]===null||this._unboundValues[key]===undefined){this._unboundValues[key]=[]}if(index!==undefined&&index!==null){this._unboundValues[key][index]=value}else{this._unboundValues[key].push(value)}},_generateDataSourceSchema:function(){var schema,schemaType,dsSchema,i,rec,prop,count=0,cols=this.options.columns,ds=this.options.dataSource,cl,counter=0;if(ds&&typeof ds._xmlToArray==="function"&&typeof ds._encodePkParams==="function"){dsSchema=ds.schema();if(dsSchema&&$.type(dsSchema)==="object"&&typeof dsSchema.schema==="object"&&typeof dsSchema.isObjEmpty==="function"&&dsSchema._type){schemaType=dsSchema._type;if(schemaType&&schemaType!==ds.settings.type){ds.settings.type=schemaType}}else{dsSchema=null}if($.type(ds.settings.dataSource)==="array"||$.type(ds.settings.dataSource)==="object"){ds=ds.settings.dataSource}else if($.type(ds.settings.dataSource)!=="string"){ds=ds.data()}else{ds=[]}}if($.type(ds)==="object"&&this.options.responseDataKey){ds=$.ig.findPath(ds,this.options.responseDataKey)}schema={};schema.fields=[];schema.searchField=this.options.responseDataKey;this._unboundColumns=null;if(cols.length>0&&!this.options.autoGenerateColumns){for(i=0;i<cols.length;i++){if(cols[i].unbound===true||cols[i].unboundDS===true){this._insertUnboundColumn(cols[i]);if(cols[i].unbound===true){continue}}schema.fields[counter]={};schema.fields[counter].name=cols[i].key;schema.fields[counter].type=cols[i].dataType;counter++}}else if(this.options.autoGenerateColumns){if(ds&&ds.tagName&&$(ds).is("table")&&$(ds).find("tbody tr").length>0){rec=$(ds).find("tbody tr")[0];$(rec).find("td").each(function(){if(cols.length>count){schema.fields.push({name:cols[count].key||count+1,type:cols[count].dataType||"string"})}else{schema.fields.push({name:count+1,type:"string"})}count++})}else if(ds&&ds.length&&ds.length>0&&$.type(ds)==="array"){for(i=0;i<ds.length;i++){rec=ds[i];for(prop in rec){if(rec.hasOwnProperty(prop)){if(this.columnByKey(prop)===null&&!this._fieldExists(prop,schema)&&$.type(rec[prop])!=="object"&&$.type(rec[prop])!=="array"){schema.fields.push({name:prop,type:$.ig.getColType(rec[prop])})}else if(this.columnByKey(prop)!==null){schema.fields.push({name:prop,type:this.columnByKey(prop).dataType})}count++}}if(!this.options._recurseSchema){break}}}else if(dsSchema&&dsSchema.fields().length){schema.fields=dsSchema.fields()}for(i=0;i<cols.length;i++){if(cols[i].unbound===true||cols[i].unboundDS===true){this._insertUnboundColumn(cols[i])}}}this._trigger(this.events.schemaGenerated,null,{owner:this,schema:schema,dataSource:ds});cl=this.options.columnLayouts;if(cl&&cl.length&&cl.length>0){for(i=0;i<cl.length;i++){if(cl[i].key===undefined){continue}schema.fields.push({name:cl[i].key})}}return schema},_fieldExists:function(prop,schema){var i;for(i=0;i<schema.fields.length;i++){if(schema.fields[i].name===prop){return true}}return false},_createDataSource:function(dataOptions){var callee,dataSource;if(!this.options.dataSource||typeof this.options.dataSource._xmlToArray!=="function"||typeof this.options.dataSource._encodePkParams!=="function"){if($.type(dataOptions.dataSource)==="string"&&(this.options.jsonpRequest||$.ig.util.isJsonpUrl(dataOptions.dataSource))){dataSource=new $.ig.JSONPDataSource(dataOptions)}else if(this.options.restSettings.update.url!==null||this.options.restSettings.update.template!==null||this.options.restSettings.create.url!==null||this.options.restSettings.create.template!==null||this.options.restSettings.remove.url!==null||this.options.restSettings.remove.template!==null){dataSource=new $.ig.RESTDataSource(dataOptions)}else{dataSource=new $.ig.DataSource(dataOptions)}}else{dataSource=this.options.dataSource;if(dataSource.settings.responseDataKey!==null){delete dataOptions.responseDataKey;if(dataOptions.schema){dataOptions.schema.searchField=dataSource.settings.responseDataKey}}if(dataOptions.responseTotalRecCountKey===null&&dataSource.settings.responseTotalRecCountKey!==null){delete dataOptions.responseTotalRecCountKey}this._tds=dataSource.settings.dataSource;dataSource.settings.dataSource=null;if($.ig.util.isIE8&&dataOptions.callee){callee=dataOptions.callee;dataOptions.callee=null}dataSource.settings=$.extend(true,{},dataSource.settings,dataOptions);if($.ig.util.isIE8&&callee){dataSource.settings.callee=callee}dataSource.settings.dataSource=this._tds;this._tds=null;if(dataOptions.schema){dataSource._initSchema()}}return dataSource},_generateColumns:function(){var r,key,i,hasExplicitCols=this.options.columns.length>0,hasHeaders=false,len,col,isTable=false,arr=[],ds=this.options.dataSource,cdp=this.options.childrenDataProperty,newDs,colType,dsHtmlTableString=false;if(ds&&typeof ds._xmlToArray==="function"&&typeof ds._encodePkParams==="function"){if(this.options.dataSource.type()==="htmlTableString"&&this.options.autoGenerateColumns){dsHtmlTableString=true}ds=ds.data()}else if(typeof ds==="string"){ds=this.dataSource.data()}if($.type(ds)==="object"&&this.options.responseDataKey){newDs=$.ig.findPath(ds,this.options.responseDataKey);if($.type(newDs)==="array"){ds=newDs}}if(ds&&ds.tagName&&$(ds).is("table")){len=$(ds).find("tbody tr").length;isTable=true}else if(ds&&ds.length){len=ds.length}if(ds&&len&&len===0&&this.options.columns.length===0){throw new Error($.ig.Grid.locale.autoGenerateColumnsNoRecords)}if(ds&&len&&len>0){if(isTable){r=$(ds).find("tbody tr")[0]}else{r=ds[0]}if($.type(r)==="array"||isTable){hasHeaders=this._tb_h;if(isTable){$(r).find("td").each(function(){arr.push($(this).text())});r=arr}for(i=0;i<r.length;i++){if(this.columnByKey(i+1)===null&&$.ig.getColType(r[i])!=="object"){col={headerText:hasHeaders?this._tb_h_arr[i]:$.ig.Grid.locale.colPrefix+(i+1),key:String(i+1),dataType:$.ig.getColType(r[i]),hidden:false};if(dsHtmlTableString){col.key=String(i)}col.headerText=(col.headerText||"").toString().trim();if(this._isMultiColumnGrid){col.level0=true;col.level=0;this._oldCols.push(col)}this.options.columns.push(col);this._visibleColumnsArray=undefined}else if(hasHeaders&&!this.columnByKey(i+1).headerText){this.columnByKey(i+1).headerText=this._tb_h_arr[i]}}}else{for(key in r){if(r.hasOwnProperty(key)&&this.columnByKey(key)===null){colType=$.ig.getColType(r[key]);if((cdp&&cdp!==key||!cdp)&&(colType!=="object"||r[key]===null)&&key!=="ig_pk"){col={headerText:key,key:key,dataType:$.ig.getColType(r[key]),hidden:false};this.options.columns.push(col);if(this._isMultiColumnGrid){col.level0=true;col.level=0;this._oldCols.push(col)}this._visibleColumnsArray=undefined}}}}}this._trigger("_columnsgenerated",null,{owner:this,key:this.options.key});if((this.dataSource.schema()===null||this.dataSource.schema().fields().length===0)&&!hasExplicitCols){this.dataSource.settings.schema=this._generateDataSourceSchema();this.dataSource._initSchema()}if(this.options.width===null){this._setContainerWidth(this.container())}this._trigger("columnsgenerated",null,{owner:this,key:this.options.key})},_renderGrid:function(){var gridElement=this.element[0],containerId,containerDiv,tbody=this.element.children("tbody");this._cancelRendering=false;if(!this._initialized){this.element.attr("role","grid");if(this.options.virtualization===true||this.options.rowVirtualization===true||this.options.columnVirtualization===true){if(this.options.height===undefined||this.options.height===null){throw new Error($.ig.Grid.locale.virtualizationRequiresHeight)}if(this._isColumnVirtualizationEnabled()&&this.options.width.indexOf&&this.options.width.indexOf("%")>0){throw new Error($.ig.Grid.locale.columnVirtualizationNotSupportedWithPercentageWidth)}this._createVirtualGrid()}else if(this.options.height!==null||this.options.width!==null){this._createScrollingGrid()}else{containerId=gridElement.id+"_container";containerDiv='<div id="'+containerId+'" class="'+this.css.gridClasses+" "+this.css.baseClass+'" style="position: relative"> </div>';this.element.wrap(containerDiv);this.element.addClass(this.css.gridTableClass);this.element.attr("aria-describedby",containerId);this._setContainerWidth(this.container());this.container().attr("tabIndex",this.options.tabIndex);if(this.options.height!==null){this.container().css("overflow-y","hidden")}}this._touch();if(this.options.columns.length>0&&this.options.virtualization!==true&&this.options.rowVirtualization!==true&&this.options.columnVirtualization!==true&&this.options.autogenerateColumns===false&&this.options.columns.length>0){this._renderColgroup(this.element[0],false,false,this.options.autofitLastColumn)}$(gridElement).attr("cellpadding","0");$(gridElement).attr("cellspacing","0");$(gridElement).attr("border","0");$(gridElement).css("table-layout","fixed");$(gridElement).addClass(this.css.gridTableClass);if(this.options.autoGenerateColumns===false&&this.options.columns.length>0&&this._headerRenderCancel!==true){this._renderHeader()}this._renderCaption();if(this.options.autoAdjustHeight){this._initializeHeights()}}if(tbody.length===0){tbody=$('<tbody role="rowgroup"></tbody>').appendTo(gridElement).addClass(this.css.baseContentClass).addClass(this.css.gridTableBodyClass).addClass(this.css.recordClass)}if(this.dataSource.type()!=="htmlTableDom"&&this.dataSource.type()!=="htmlTableId"){tbody.attr("role","rowgroup").empty()}},_setContainerWidth:function(element,rendered){var cols=this._visibleColumns(),i,w,width=0,inPerc;if(cols.length>0){inPerc=false;for(i=0;i<cols.length;i++){w=cols[i].width;if(w!==0&&w!=="0"){w=w||this.options.defaultColumnWidth}if(_aNull(w)||w&&w.indexOf&&w.indexOf("%")>0){inPerc=true}else{inPerc=false;break}}if(inPerc){return}width=this._calculateContainerWidth(true);if(width>0){if(rendered){width=0;this.container().find(".ui-iggrid-header").each(function(){width+=$(this).outerWidth()});element.width(width)}else{width+=this._calculateSpecialColumnsWidth();element.css("width",width)}}}else if(this.options.width!==null){element.css("width",this.options.width)}},_calculateContainerWidth:function(addScrollWidth){var width=0,cols=this.options.columns,i;for(i=0;i<cols.length;i++){if(cols[i].hidden!==true&&cols[i].fixed!==true&&(this._initialHiddenColumns===undefined||$.inArray(cols[i],this._initialHiddenColumns)===-1)){width+=cols[i].width?parseInt(cols[i].width,10):this.options.defaultColumnWidth===null?0:parseInt(this.options.defaultColumnWidth,10)}}if(this.options.height!==null&&width>0&&addScrollWidth===true){width+=this._scrollbarWidth()}return width},_createScrollingGrid:function(){var self=this,id=this.id()+"_scroll",dataContainer,scrollDiv='<div id="'+id+'"></div>';this.element.wrap(scrollDiv);dataContainer=this.element.parent();this.element.attr("aria-describedby",id);dataContainer.addClass(this.css.gridScrollDivClass).wrap("<div id='"+this.id()+"_container'></div>");if($.ig.util.isIE7){dataContainer.css("padding-bottom",this._scrollbarWidth())}this.container().attr("tabIndex",this.options.tabIndex).addClass(this.css.baseClass).addClass(this.css.gridClasses);if(this.options.width!==null){this.container().css("width",this.options.width);if(this.options.width.indexOf&&this.options.width.indexOf("%")!==-1){this.element.css("width","100%")}if(this.options.height!==null){this._addHorizontalScrollBar(dataContainer);this.scrollContainer().css("overflow-x","hidden")}}else{this._setContainerWidth(this.container());this.scrollContainer().css("overflow-x","hidden")}this.container().css("position","relative");if(this.options.height!==null){this.scrollContainer().css("overflow-y","auto");if(this.options.autoAdjustHeight){this.container().css("height",this.options.height)}else{this.scrollContainer().css("height",this.options.height)}}if(this._persistVirtualScrollTop){this.scrollContainer().bind({scroll:function(){self._prevFirstVisibleTROffset=self.scrollContainer().scrollTop()}})}},_touch:function(){var id=this.id(),div=this.scrollContainer();if(div.length!==1){div=this._vdisplaycontainer()}if(div.length){div.attr("data-scroll","true").attr("data-oneDirection","true");if(this._hscrollbarcontent()[0]){div.attr("data-xScroller","#"+id+"_hscroller")}else if(this._vhorizontalcontainer()[0]){div.attr("data-xScroller","#"+id+"_horizontalScrollContainer")}if(this._scrollContainer()[0]){div.attr("data-yScroller","#"+id+"_scrollContainer")}if(typeof Modernizr==="object"&&Modernizr.touch===true&&this.element.igScroll!==undefined){this._scrollbarWidthResolved=0;div.css("overflow-y","hidden")}}},_createVirtualGrid:function(){var id=this.id(),$vCont,grid,newW,percWidthStr=$.ig.util.isWebKit?"width=100%":"",totalWidth,scrollContainerInner,scrollbarWidth,w=0,virtualGridMarkup='<div id="'+id+'_container" style="margin:0px; border:0px; padding:0px;"><table border="0" cellspacing="0" cellpadding="0" class="ui-iggrid-layout-helper" style="border-spacing:0px" id="'+id+'_virtualContainer" ><tbody role="rowgroup"><tr><td colspan="2" style="border-width:0px"><div id="'+id+'_headers_v" style="overflow:hidden;"></div></td></tr><tr><td style="border-width:0px;"><div id="'+id+'_displayContainer"></td>$verticalMarkup$</tr>$horizontalMarkup$</tbody></table></div>',verticalMarkup,horizontalMarkup='<tr><td colspan="2" style="border-width: 0px"><div id="'+id+'_horizontalScrollContainer"></div></td></tr>';scrollbarWidth=this._scrollbarWidth();if($.ig.util.isIE){scrollbarWidth+=1}if(parseInt(this.options.height,10)>0){verticalMarkup='<td style="border-width: 0px;"><div id="'+id+'_scrollContainer" style="overflow:scroll; overflow-x:hidden; width: '+scrollbarWidth+"px; height:"+this.options.height+';"></div></td>'}else{verticalMarkup='<td style="border-width: 0px;"><div id="'+id+'_scrollContainer" style="overflow:scroll; overflow-x:hidden; width: '+scrollbarWidth+'px;"></div></td>'}if(this.options.virtualization===true){virtualGridMarkup=virtualGridMarkup.replace("$verticalMarkup$",verticalMarkup).replace("$horizontalMarkup$",horizontalMarkup)}else if(this.options.rowVirtualization===true){virtualGridMarkup=virtualGridMarkup.replace("$verticalMarkup$",verticalMarkup).replace("$horizontalMarkup$","")}else if(this.options.columnVirtualization===true){virtualGridMarkup=virtualGridMarkup.replace("$horizontalMarkup$",horizontalMarkup).replace("$verticalMarkup$","")}if(this.options.virtualization===true||this.options.columnVirtualization===true){this.element.css("width","100%")}this.element.wrap(virtualGridMarkup);this.container().attr("tabIndex",this.options.tabIndex).addClass(this.css.baseClass).addClass(this.css.gridClasses);if(this.options.width!==null){this.container().width(this.options.width)}else{this._setContainerWidth(this.container())}this._vdisplaycontainer().addClass(this.css.gridScrollDivClass).addClass(this.css.gridVirtualScrollDivClass).append(this.element[0]);grid=this;totalWidth=this._calculateContainerWidth(false);if(this.options.width!==null){w=parseInt(this.options.width,10)}else{w=totalWidth}if(this.options.height!==null&&this.options.width!==null){w-=this._scrollbarWidth()}if(w<=0){w=undefined}if(w>0&&this.options.expandColWidth&&!this.options.width){w+=this.options.expandColWidth}$("<colgroup><col "+(w<=0?percWidthStr:'width="'+w+'"')+'></col><col width="'+this._scrollbarWidth()+'"></col></colgroup>').prependTo(this._virtualcontainer());newW=this.options.width;if(newW&&newW.indexOf&&newW.indexOf("%")!==-1){newW="100%"}this._virtualcontainer().css("width",newW).css("max-width",newW);scrollContainerInner='<div style="width:1px; overflow:hidden; height:'+this._totalRowCount*parseInt(this.options.avgRowHeight,10)+'px;"></div>';this._scrollContainer().append(scrollContainerInner);if((this.options.virtualization===true||this.options.rowVirtualization===true)&&this.options.width&&this.options.width.indexOf&&this.options.width.indexOf("%")>0){this._addHorizontalScrollBar(this._virtualcontainer());this._virtualcontainer().css("table-layout","fixed")}else if((this.options.virtualization===true||this.options.columnVirtualization===true)&&this.options.width&&totalWidth>parseInt(this.options.width,10)){this._renderHorizontalScrollContainer(totalWidth)}if(parseInt(this.options.height,10)>0){this._vdisplaycontainer().css("height",this.options.height).css("vertical-align","top")}this._vdisplaycontainer().css("position","relative").css("width",w).css("maxWidth",w);if(this.options.virtualization===true){this.container().find("#"+id+"_headers_v").append("<a href='#' id='"+id+"_displayContainer_a' tabindex='-1' style='position:absolute;top:-100px;left:-100px'>&nbsp;</a>")}if(this.options.width&&this.options.virtualization===false&&this.options.columnVirtualization===false){this._vdisplaycontainer().css({"overflow-y":"hidden","overflow-x":"auto"})}else{this._vdisplaycontainer().css("overflow","hidden")}this._vdisplaycontainer().parent().bind({mouseenter:function(){grid._isMouseOverVirtualTable=true},mouseleave:function(){grid._isMouseOverVirtualTable=false}});this._documentEvents={DOMMouseScroll:function(event){var dir="down",delta,step;step=grid.options.virtualizationMouseWheelStep===null?parseInt(grid.options.avgRowHeight,10):grid.options.virtualizationMouseWheelStep;delta=-event.originalEvent.detail/3;if(delta>0){dir="up"}if(grid._isMouseOverVirtualTable){grid._onVirtualVerticalScroll(event,step,dir);event.preventDefault()}},mousewheel:function(event){var dir="down",delta,step;step=grid.options.virtualizationMouseWheelStep===null?parseInt(grid.options.avgRowHeight,10):grid.options.virtualizationMouseWheelStep;delta=event.originalEvent.wheelDelta/120;if(delta>0){dir="up"}if(grid._isMouseOverVirtualTable){grid._onVirtualVerticalScroll(event,step,dir);event.preventDefault()}}};this._documentEvents["keydown."+this.id()]=function(event){var keyCode=event.keyCode,$sc,dir=null,step;if(grid._isMouseOverVirtualTable){if(keyCode===$.ui.keyCode.DOWN){dir=1}else if(keyCode===$.ui.keyCode.UP){dir=-1}if(dir&&grid._isMouseOverVirtualTable){step=grid.options.virtualizationMouseWheelStep===null?parseInt(grid.options.avgRowHeight,10):grid.options.virtualizationMouseWheelStep;$sc=grid._scrollContainer();$sc.scrollTop($sc.scrollTop()+step*dir)}}};$(document).bind(this._documentEvents);if(this.options.virtualization===true||this.options.rowVirtualization===true){this._scrollContainer().bind({scroll:function(event){grid._onVirtualVerticalScroll(event);grid._virtualScrollMouseDown=false},mousedown:function(){grid._virtualScrollMouseDown=true}})}if(this.options.virtualization===true||this.options.columnVirtualization===true){$vCont=this._vhorizontalcontainer();$vCont.data("containerName","vScrollbar").bind({scroll:function(event){grid._onVirtualHorizontalScroll(event)}});if(this.options.virtualizationMode==="continuous"){this._registerScrllCntnrToSync($vCont)}}if(this._vhorizontalcontainer().length===0&&this.options.width!==null){if(!this.options.width.indexOf||this.options.width.indexOf("%")===-1){this._addHorizontalScrollBar(this._virtualcontainer())}this._vdisplaycontainer().css("overflow-x","hidden")}this.element.height(this._scrollContainer().height());if(this.options.width&&this.options.width.indexOf&&this.options.width.indexOf("%")!==-1){this.container().find("#"+id+"_virtualContainer > colgroup > col:first").css("width","100%");this._vhorizontalcontainer().css("width","100%");this._vdisplaycontainer().css("width","100%").css("max-width","100%")}},_renderHorizontalScrollContainer:function(totalWidth){var horizontalScrollContainerInner,w=this.options.width;if(w&&w.indexOf&&w.indexOf("%")!==-1&&(this.options.virtualization===true||this.options.rowVirtualization===true)){return}this._vhorizontalcontainer().css("height",this._scrollbarWidth()+"px").css("overflow","scroll");if($.ig.util.isIE){this._vhorizontalcontainer().css("width",parseInt(this.options.width,10)+1).css("height",this._vhorizontalcontainer().outerHeight()+1+"px")}else{this._vhorizontalcontainer().css("width",this.options.width)}horizontalScrollContainerInner='<div style="width:'+totalWidth+'px;height:1px;"></div>';this._vhorizontalcontainer().append(horizontalScrollContainerInner)},_onVirtualVerticalScroll:function(event,offset,dir){var newSri;this._isHorizontal=false;var scrollContainer=this._scrollContainer(),scrollTopDiff,isIE=$.ig.util.isIE,current=scrollContainer.scrollTop(),mode=this.options.virtualizationMode;if(offset!==undefined){if(dir==="down"){scrollContainer.scrollTop(current+offset)}else{scrollContainer.scrollTop(current-offset)}current=scrollContainer.scrollTop()}scrollTopDiff=scrollContainer.scrollTop()-this._oldScrollTop;if(Math.abs(scrollTopDiff)<5&&$.ig.util.isFF&&!isIE){return}if(mode===undefined||mode===""){mode="continuous"}if(mode==="fixed"){newSri=Math.ceil(scrollContainer.scrollTop()/parseInt(this.options.avgRowHeight,10));if(!isIE&&newSri===this._startRowIndex&&this._virtualScrollMouseDown){if(scrollTopDiff>0&&scrollTopDiff<parseInt(this.options.avgRowHeight,10)){newSri++;scrollContainer.scrollTop(scrollContainer.scrollTop()-scrollTopDiff+parseInt(this.options.avgRowHeight,10))}else if(scrollTopDiff<0&&Math.abs(scrollTopDiff)<parseInt(this.options.avgRowHeight,10)){newSri--;scrollContainer.scrollTop(scrollContainer.scrollTop()-scrollTopDiff-parseInt(this.options.avgRowHeight,10))}}if(newSri>this._totalRowCount-this._virtualRowCount){newSri=this._totalRowCount-this._virtualRowCount}if(newSri<0){newSri=0}this._trigger("virtualrendering");this._startRowIndex=newSri;this._renderVirtualRecords()}else if(mode==="continuous"){this._trigger("virtualrendering");this._virtualScrollToInternal(current)}this._oldScrollTop=scrollContainer.scrollTop();if(this._persistVirtualScrollTop){this._saveFirstVisibleTRIndex()}},_scrollContainer:function(){if(!this._scrollContainerObj||this._scrollContainerObj.length===0){this._scrollContainerObj=this.container().find("#"+this.id()+"_scrollContainer")}return this._scrollContainerObj},_onVirtualHorizontalScroll:function(event){var newSci,internallyTriggered=event===undefined,horizontalScrollContainer=this._vhorizontalcontainer(),scrollLeft=horizontalScrollContainer.scrollLeft(),hiddenContentWidth=horizontalScrollContainer[0].scrollWidth-horizontalScrollContainer[0].offsetWidth;if(this.options.virtualization===true&&this.options.virtualizationMode==="continuous"){this._onScrollContainer(event);return}this._isHorizontal=true;if(hiddenContentWidth>0){newSci=Math.ceil(scrollLeft*this._totalColumnCount/hiddenContentWidth);newSci=Math.min(newSci,this._totalColumnCount-this._virtualColumnCount)}else{newSci=0}if(internallyTriggered||newSci!==this._startColIndex){this._trigger("virtualrendering");this._startColIndex=newSci;this._renderVirtualRecords();this._trigger("virtualhorizontalscroll",null,{startColIndex:this._startColIndex,endColIndex:this._startColIndex+this._virtualColumnCount-1})}},_initLoadingIndicator:function(){var widget;if(this.container().data("igLoading")){this._loadingIndicator=this.container().data("igLoading").indicator()}else{widget=this.container().igLoading().data("igLoading");if(widget){this._loadingIndicator=widget.indicator()}}},_addHorizontalScrollBar:function(parent){var sb=$("<div id='"+this.id()+"_hscroller_container' ></div>").css("height",this._scrollbarWidth()+"px").css("position","relative").css("display","none").css("overflow","hidden").append($("<div id='"+this.id()+"_hscroller' ></div>").data("containerName","hScrollbar").css("width","100%").css("position","absolute").css("bottom","0px").css("overflow-x","scroll").css("overflow-y","scroll").append($("<div id='"+this.id()+"_hscroller_inner' ></div>").css("height","1px")).bind("scroll",$.proxy(this._onScrollContainer,this)));if(parent){sb.insertAfter(parent)}this._registerScrllCntnrToSync($("#"+this.id()+"_hscroller"))},_updateVirtualHorizontalScrollbar:function(){var horizontalScrollContainerInner,horizontalScrollContainer,isVisible;horizontalScrollContainerInner=this.container().find("#"+this.id()+"_horizontalScrollContainer div");horizontalScrollContainerInner.css("width",this._calculateContainerWidth(false));horizontalScrollContainer=this._vhorizontalcontainer();isVisible=horizontalScrollContainer.is(":visible");if(horizontalScrollContainer.width()>horizontalScrollContainerInner.width()){horizontalScrollContainer.css("display","none")}else{horizontalScrollContainer.css("display","")}if(isVisible!==horizontalScrollContainer.is(":visible")){this._initializeHeights()}},_generateColumnFlatStructure:function(treeStructure){var cols,oldCols,newCols=[];cols=treeStructure.slice(0);oldCols=treeStructure.slice(0);this._multiColumnIdentifier=0;this._maxLevel=this._getMaxLevelRecursive(0,cols);this._hiddenColumns={};this._analyzeMultiColumnHeaders(cols,newCols,0,oldCols,[]);this._oldCols=oldCols;this.options.columns=newCols},moveColumn:function(column,target,after,inDom,callback){var grid=this,found,nColArray,movingParams,hcPreserve,isFixed,cCols=this._oldCols?jQuery.extend(true,[],this._oldCols):jQuery.extend(true,[],this.options.columns);after=after===null||after===undefined?true:after;inDom=inDom===null||inDom===undefined?true:inDom;movingParams={column:column,target:target,after:after};if(this._oldCols){found=this._performInternalMove(movingParams,this._oldCols);hcPreserve=jQuery.extend(true,{},this._hiddenColumns);this._generateColumnFlatStructure(this._oldCols);this._hiddenColumns=hcPreserve;this._preserveColspans(this._oldCols)}else{found=this._performInternalMove(movingParams,this.options.columns)}if(found===false){throw new Error($.ig.Grid.locale.movingNotAllowedOrIncompatible)}if(movingParams.columnFixed===movingParams.targetFixed){nColArray=this._buildColumnLayoutArray(cCols,movingParams.columnFixed)
}else{return movingParams}column=movingParams.column;target=movingParams.target;after=movingParams.after;isFixed=movingParams.columnFixed;if(inDom===true){this._loadingIndicator.show();setTimeout(function(){grid._columnMovingResets();grid._performDomColumnMove(column,target,after,nColArray,isFixed);grid._loadingIndicator.hide();if(callback){$.ig.util.invokeCallback(callback,[grid.options.columns])}},0)}else{this._columnMovingResets();this._performColumnMove(column,target,after,nColArray,isFixed);if(callback){$.ig.util.invokeCallback(callback,[grid.options.columns])}}},_columnMovingResets:function(){var i,$th;this._updateHeaderColumnIndexes();delete this._virtualDom;delete this._visibleColumnsArray;this._headerCells=[];for(i=0;i<this.options.columns.length;i++){$th=this.container().find("#"+this.id()+"_"+this.options.columns[i].key).data("columnIndex",i);$th.data("data-mch-order",i);if($th.is(":visible")){this._headerCells.push($th)}}},_preserveColspans:function(cols){var i,cs=0,col,res;for(i=0;i<cols.length;i++){col=cols[i];if(col.group!==undefined&&col.group!==null){res=this._preserveColspans(col.group);col.colspan=res;cs+=res}else{if(col.hidden!==true){cs++}}}return cs},_columnVisible:function(col){return!col.hidden},_buildColumnLayoutArray:function(cCols,fixed){var i=0,j=0,col,id,colrs,l,x=0,nCols,level=0,colgrp=fixed?this.fixedBodyContainer().find("colgroup:first"):this.element.find("colgroup:first"),width=colgrp.children("col:not([data-skip=true])").length,htbl=fixed?this.fixedHeadersTable():this.headersTable(),height=htbl.find("thead tr").length,array=[];if(height===0&&this.options.showHeader===false){height=1}for(i=0;i<width;i++){array[i]=[]}i=0;while(level<height){nCols=[];while(i<cCols.length){col=cCols[i];if(col.hidden===true||this._isSubsetFixed(col)!==fixed){i++;continue}colrs=col.rowspan||1;id=this._getColMarkForLevel(col);l=col.colspan||1;for(j=0;j<l;j++){array[x+j][level]=id}if(col.crs===colrs&&col.group){nCols.push.apply(nCols,$.grep(col.group,this._columnVisible).slice(0))}else{nCols.push(col)}x+=l;i++}cCols=nCols;level++;x=0;i=0}return array},_getColMarkForLevel:function(col){if(!col.crs){col.crs=0}col.crs++;if(col.crs>1){return-1}return col.key||col.identifier},_performInternalMove:function(movingParams,subset){var i=0,j,success=true;i=this._getColIdxById(subset,movingParams.column);if(typeof movingParams.column==="number"){movingParams.column=subset[i].key||subset[i].identifier}if(i||i===0){movingParams.columnFixed=this._isSubsetFixed(subset[i]);j=this._getColIdxById(subset,movingParams.target);if(typeof movingParams.target==="number"){movingParams.target=subset[j].key||subset[j].identifier;movingParams.after=j>=i}if(j||j===0){movingParams.targetFixed=this._isSubsetFixed(subset[j]);success=success&&this._rearrangeArray(subset,i,1,movingParams.after===true?j+1:j);success=success||movingParams.targetFixed!==movingParams.columnFixed;return success}return false}for(i=0;i<subset.length;i++){if(subset[i].group){if(this._performInternalMove(movingParams,subset[i].group)===true){return true}}}return false},_getColIdxById:function(array,id){var i,col;if(typeof id==="number"){return id}for(i=0;i<array.length;i++){col=array[i];if(col.key){if(col.key===id){return i}}else if(col.identifier){if(col.identifier===id){return i}}}},_isSubsetFixed:function(subset){var mchc;if(subset.group){mchc=this._getMultiHeaderColumnById(subset.identifier);return!!mchc.children[0].fixed}return!!subset.fixed},_getCellIndexByColumnKey:function(key){var i=this.getVisibleIndexByKey(key);return i===-1?i:i+this.element.find("tbody>tr:not([data-grouprow='true']):first").children("th,td[data-skip='true'],td[data-parent]").length},_findColAreaInLayout:function(col,nColArray,depth){var i,j,res={};for(i=0;i<nColArray.length;i++){if(nColArray[i][depth]===col){res.start=i;for(j=i;j<nColArray.length;j++){if(nColArray[j][depth]!==col){break}}res.length=j-i;return res}}return null},_rearrangeArray:function(array,start,length,at){var col,targetAfter=start<at,n;if(start===at||start<0||at<0||start>=array.length||at>array.length){return false}col=array.splice(start,length);for(n=0;n<col.length;n++){array.splice(targetAfter?at-length+n:at+n,0,col[n])}return true},_moveColumnInHeader:function(column,target,after,nColArray,fixed){var rmil,movedColumn,targetColumn,targetIndex,targetObject,spStart,spEnd,i,j,cols,n,header;if(fixed){header=this.fixedHeadersTable().children("thead")}else{header=this.headersTable().children("thead")}for(j=0;j<nColArray[0].length;j++){movedColumn=this._findColAreaInLayout(column,nColArray,j);if(movedColumn){targetColumn=this._findColAreaInLayout(target,nColArray,j);if(targetColumn){break}}}rmil=[movedColumn,targetColumn];if(this.options.showHeader===false){return rmil}this._moveThs(header,column,target,after);while(++j<nColArray[0].length){cols=[];n=null;for(i=movedColumn.start;i<movedColumn.start+movedColumn.length;i++){if(nColArray[i][j]===-1){continue}if(nColArray[i][j]!==n){n=nColArray[i][j];cols.push(n)}}targetIndex=after===true?targetColumn.start+targetColumn.length-1:targetColumn.start;if(nColArray[targetIndex][j]!==-1){this._moveThs(header,cols,nColArray[targetIndex][j],after);continue}if(after===true){spStart=targetColumn.start+targetColumn.length;spEnd=movedColumn.start>targetColumn.start+targetColumn.length-1?movedColumn.start:nColArray.length;targetObject=this._findTargetRight(spStart,spEnd,j,nColArray);if(!targetObject){spStart=targetColumn.start+targetColumn.length-2;spEnd=movedColumn.start>targetColumn.start+targetColumn.length-1?-1:movedColumn.start+movedColumn.length;targetObject=this._findTargetLeft(spStart,spEnd,j,nColArray)}}else{spStart=targetColumn.start-1;spEnd=movedColumn.start>targetColumn.start+targetColumn.length-1?-1:movedColumn.start+movedColumn.length;targetObject=this._findTargetLeft(spStart,spEnd,j,nColArray);if(!targetObject){spStart=targetColumn.start+1;spEnd=movedColumn.start>targetColumn.start+targetColumn.length-1?movedColumn.start:nColArray.length;targetObject=this._findTargetRight(spStart,spEnd,j,nColArray)}}if(targetObject&&targetObject.pos&&targetObject.left!==undefined&&targetObject.left!==null){this._moveThs(header,cols,nColArray[targetObject.pos][j],targetObject.left)}}return rmil},_moveColumnInBodyFooter:function(area,movedColumn,targetColumn,after){var i,j,trs,$tr,tds,tar,skip;trs=area.find(">tr:not([data-container='true'],[data-grouprow='true'])");if(trs.length>0){skip=trs.eq(0).find("[data-parent],[data-skip='true'],th").length}for(j=0;j<trs.length;j++){tds=$();$tr=trs.eq(j);for(i=movedColumn.start;i<movedColumn.start+movedColumn.length;i++){tds=tds.add($tr.children().eq(i+skip))}if(after===true){tar=$tr.children().eq(targetColumn.start+targetColumn.length+skip-1);tds.detach().insertAfter(tar)}else{tar=$tr.children().eq(targetColumn.start+skip);tds.detach().insertBefore(tar)}}this._updateVerticalScrollbarCellPadding(true)},_findTargetRight:function(start,end,level,nColArray){var i,colFound={};for(i=start;i>=0&&i<end&&i<nColArray.length;i++){if(nColArray[i][level]!==-1){colFound.pos=i;colFound.left=false;return colFound}}},_findTargetLeft:function(start,end,level,nColArray){var i,colFound={};for(i=start;i>=0&&i>end&&i<nColArray.length;i--){if(nColArray[i][level]!==-1){colFound.pos=i;colFound.left=true;return colFound}}},_moveCols:function(area,movedColumn,targetColumn,after){var i,cols=$(),tCol,skip=area.children("[data-skip='true']").length;for(i=movedColumn.start;i<movedColumn.start+movedColumn.length;i++){cols=cols.add(area.children().eq(i+skip))}if(after===true){tCol=area.children().eq(targetColumn.start+targetColumn.length+skip-1);cols.detach().insertAfter(tCol)}else{tCol=area.children().eq(targetColumn.start+skip);cols.detach().insertBefore(tCol)}},_moveThs:function(header,ids,tar,after){var $tar,$ids=$(),$id,i,$pid;$tar=header.find("th[data-mch-id='"+tar+"'],th[id='"+this.id()+"_"+tar+"']");if(typeof ids==="object"){for(i=0;i<ids.length;i++){$id=header.find("th[data-mch-id='"+ids[i]+"'],th[id='"+this.id()+"_"+ids[i]+"']");if($id.attr("data-vscr-padding-icrement")){$pid=$id}$ids=$ids.add($id)}}else{$ids=header.find("th[data-mch-id='"+ids+"'],th[id='"+this.id()+"_"+ids+"']");if($ids.attr("data-vscr-padding-icrement")){$pid=$ids}}$ids.detach();if(after){$ids.insertAfter($tar)}else{$ids.insertBefore($tar)}if($tar.attr("data-vscr-padding-icrement")&&after===true){$ids.last().css(this._padding,$tar.css(this._padding)).attr("data-vscr-padding-icrement",$tar.attr("data-vscr-padding-icrement"));$tar.css(this._padding,"");$tar.removeAttr("data-vscr-padding-icrement")}else if($pid){$pid.parent().children(":last").css(this._padding,$pid.css(this._padding)).attr("data-vscr-padding-icrement",$pid.attr("data-vscr-padding-icrement"));$pid.css(this._padding,"");$pid.removeAttr("data-vscr-padding-icrement")}},_moveSpecialThs:function(movedColumn,targetColumn,after,fixed){var i,j,spTrs,header,skip,ths,$tr,tar;if(fixed){header=this.fixedHeadersTable().children("thead")}else{header=this.headersTable().children("thead")}spTrs=header.find(">tr[data-role]");if(spTrs.length>0){skip=spTrs.eq(0).find("[data-parent],[data-skip='true']").length}for(j=0;j<spTrs.length;j++){ths=$();$tr=$(spTrs[j]);for(i=movedColumn.start;i<movedColumn.start+movedColumn.length;i++){ths=ths.add($tr.children("td,th").eq(i+skip))}if(after===true){tar=$tr.children().eq(targetColumn.start+targetColumn.length+skip-1);ths.detach().insertAfter(tar)}else{tar=$tr.children().eq(targetColumn.start+skip);ths.detach().insertBefore(tar)}}},_performDomColumnMove:function(column,target,after,nColArray,fixed){var rmil=this._moveColumnInHeader(column,target,after,nColArray,fixed),movedColumn=rmil[0],targetColumn=rmil[1],body,footer,indexMod=0;this._moveSpecialThs(movedColumn,targetColumn,after,fixed);if(this.options.fixedHeaders===true){this._moveCols(fixed?this.fixedHeadersTable().children("colgroup"):this.headersTable().children("colgroup"),movedColumn,targetColumn,after)}if(fixed){body=this.fixedBodyContainer().children("table")}else{body=this.element}this._moveColumnInBodyFooter(body.children("tbody"),movedColumn,targetColumn,after);this._moveCols(body.children("colgroup"),movedColumn,targetColumn,after);if(this.options.fixedFooters===true){footer=fixed?this.fixedFootersTable():this.footersTable();this._moveColumnInBodyFooter(footer.children("tfoot"),movedColumn,targetColumn,after);this._moveCols(footer.children("colgroup"),movedColumn,targetColumn,after)}else{this._moveColumnInBodyFooter(body.children("tfoot"),movedColumn,targetColumn,after)}if(!fixed&&this.fixingDirection()==="left"||fixed&&this.fixingDirection()==="right"){indexMod=this._fixedColumns?this._fixedColumns.length:0}this._trigger("_columnsmoved",null,{owner:this,start:movedColumn.start+indexMod,len:movedColumn.length,index:after===true?targetColumn.start+targetColumn.length+indexMod:targetColumn.start+indexMod,isFixed:fixed})},_performColumnMove:function(column,target,after,nColArray,fixed){var rmil=this._moveColumnInHeader(column,target,after,nColArray,fixed),movedColumn=rmil[0],targetColumn=rmil[1];if(this.options.fixedHeaders===true){this._moveCols(fixed?this.fixedHeadersTable().children("colgroup"):this.headersTable().children("colgroup"),movedColumn,targetColumn,after)}this._renderData();this._renderFooter();this._rerenderColgroups()},showColumn:function(column,callback){var grid=this;this._loadingIndicator.show();if(!this._isShowingAllowed([column])){return false}setTimeout(function(){var col;col=grid._setHidden(column,false);grid._loadingIndicator.hide();if(callback){$.ig.util.invokeCallback(callback,[[col],false])}},0);return true},hideColumn:function(column,callback){var grid=this;if(!this._isHidingAllowed([column])){return false}if(grid._visibleColumns().length===1){return false}this._loadingIndicator.show();setTimeout(function(){var col;col=grid._setHidden(column,true);grid._loadingIndicator.hide();if(callback){$.ig.util.invokeCallback(callback,[[col],true])}},0);return true},_setHidden:function(column,hidden){var col,applied=false;if(typeof column==="number"){col=this.options.columns[column]}else{col=this.columnByKey(column)}if(col&&col.hidden!==hidden){this._setHiddenColumns([col],hidden,false);applied=true}if(applied){return col}return null},_visibleAreaWidth:function(w){if(w!==undefined){this._minVAreaWidth=w}else{return this._minVAreaWidth}},_isShowingAllowed:function(columns){if(!this.hasFixedColumns()){return true}var i,columnsLength=columns.length,totalW=0,w,gridW,colType,col;for(i=0;i<columnsLength;i++){colType=typeof columns[i];if(colType==="string"){col=this.columnByKey(columns[i])}else if(colType==="number"){col=this.options.columns[columns[i]]}else{col=columns[i]}if(!col||!col.hidden){continue}if(col.fixed&&(col.width||col.oWidth)){w=col.width||col.oWidth;w=parseInt(w,10);totalW+=w}}if(totalW!==0){gridW=this.container().outerWidth();if(gridW-parseInt(this.fixedContainer().outerWidth(),10)-totalW<this._visibleAreaWidth()){return false}}return true},_isHidingAllowed:function(columns){if(!this.hasFixedColumns()){return true}var i,columnsLength=columns.length,col,colType,fixed=[],unfixed=[];for(i=0;i<columnsLength;i++){colType=typeof columns[i];if(colType==="string"){col=this.columnByKey(columns[i])}else if(colType==="number"){col=this.options.columns[columns[i]]}else{col=columns[i]}if(!col||col.hidden){continue}if(col.fixed){fixed.push(col)}else{unfixed.push(col)}}if(fixed.length!==0&&this._visibleColumns(true).length<=fixed.length||this._visibleColumns(false).length<=unfixed.length){return false}return true},_setHiddenColumns:function(columns,hidden,initial){var columnNumberChanged=false,visibleColumnsWithWidthLength,gridWidth,self=this,inPerc,visibleColumnsLength,hasVirtualization=this.options.virtualization===true||this.options.columnVirtualization===true||this.options.rowVirtualization===true,hasColumnVirtualization=this.options.virtualizationMode!=="continuous"&&(this.options.virtualization===true&&this.options.width||this.options.columnVirtualization===true),isContinuos=false;if(columns.length===0){return}this._fireInternalEvent("_hidingFinishing",{columns:columns,hidden:hidden});if(hasVirtualization){isContinuos=this.options.virtualizationMode==="continuous";self._updateVirtColCounters();if(!isContinuos){$.each(columns,function(index,col){var oldVirtualColumnCount=self._virtualColumnCount;col.hidden=hidden;self._visibleColumnsArray=undefined;self._updateVirtColCounters();if(self._virtualColumnCount!==oldVirtualColumnCount){if(self._virtualColumnCount<oldVirtualColumnCount){self._detachColumn(col)}else if(self._virtualColumnCount>oldVirtualColumnCount){self._attachColumn(col)}columnNumberChanged=true;self._resetVirtualDom()}});if(hasColumnVirtualization){this._vheaders=undefined;this._updateVirtualHorizontalScrollbar();this._onVirtualHorizontalScroll();if(!this._initialized){this._adjustLastColumnWidth(true)}}this._renderVirtualRecords()}}if(!hasVirtualization||isContinuos){$.each(columns,function(index,col){col.hidden=hidden;self._visibleColumnsArray=undefined;if(col.hidden){self._detachColumn(col)}else{self._attachColumn(col)}});if(this._isHierarchicalGrid){this.element.children("tbody").children("tr[data-container]").empty()}this._cleanupTBody();columnNumberChanged=true;if(hasVirtualization){if(this._initialized){this._renderVirtualRecords()}}else{this._renderRecords()}}if(columnNumberChanged){if(!this._initialized){if(this._visibleColumns().length===0){throw new Error($.ig.Grid.locale.allColumnsHiddenOnInitialization)}this._rerenderColgroups(initial);this._adjustLastColumnWidth(true);if(hasVirtualization){this._renderVirtualRecords()}}else{if(this._visibleColumns().length>0){this._rerenderColgroups(initial);this._adjustLastColumnWidth(true);visibleColumnsLength=this._visibleColumns().length;visibleColumnsWithWidthLength=$.grep(this._visibleColumns(),function(col){return col.width}).length;if(visibleColumnsWithWidthLength===visibleColumnsLength){if(this.options.width&&parseInt(this.options.width,10)>0){this._updateGridContentWidth()}else{if(this.options.width!==null){this._setContainerWidth(this.container())}if(hasVirtualization){gridWidth=this._calculateContainerWidth(true);if(this.options.height!==null){gridWidth-=this._scrollbarWidth()}this._vdisplaycontainer().css("width",gridWidth).css("max-width",gridWidth)}}}}}}this.element.trigger("iggriduisoftdirty",{owner:this});this._trigger(this.events.columnsCollectionModified,null,{owner:this});if(columnNumberChanged&&hasVirtualization&&this._visibleColumns().length>0&&visibleColumnsWithWidthLength===visibleColumnsLength){if(this.options.virtualizationMode==="continuous"){if(!isNaN(gridWidth)){gridWidth+=this._calculateSpecialColumnsWidth();this._vdisplaycontainer().css("width",gridWidth).css("max-width",gridWidth)}}if(!isNaN(gridWidth)){this.container().find("#"+this.id()+"_virtualContainer>colgroup col").eq(0).attr("width",gridWidth)}if(this.options.width===null||this.options.width===undefined){this._setContainerWidth(this.container().find("#"+this.id()+"_headers_v"))}}this._origWidth=parseInt(this.container().css("width"),10);if(columnNumberChanged&&$.ig.util.isSafari&&this.options.showHeader){self.headersTable().find("[data-header-row]").hide();setTimeout(function(){self.headersTable().find("[data-header-row]").show();if(self.options.height){self._initializeHeights()}},0)}if(columnNumberChanged&&($.ig.util.isFF||$.ig.util.isIE8)){inPerc=this.options.width===null||typeof this.options.width==="string"&&this.options.width.indexOf("%")!==-1;if(inPerc){if($.ig.util.isIE8){this._refreshUI()}this._refreshTableUI(this.element);if(this.options.showHeader){this._refreshTableUI(this.headersTable())}if(this.options.fixedFooters===true&&this.options.height!==null){this._refreshTableUI(this.footersTable())}}}if(columnNumberChanged){this._checkAndReinitializeContainersHeights()}this._fireInternalEvent("_hidingFinished",{columns:columns,hidden:hidden})},_refreshTableUI:function($tbl){if(!$tbl.length){return}var overflow;overflow=$tbl[0].style.overflow;$tbl[0].style.overflow="hidden";setTimeout(function(){$tbl[0].style.overflow=overflow},0)},_checkAndReinitializeContainersHeights:function(initH){var c;if(_aNull(this.options.height)||!this.options.height||$.type(this.options.height)==="string"&&this.options.height.indexOf("%")>0){return}c=this.container();if(!c.length){return}if(_aNull(initH)){initH=c.height()}if(c[0].scrollHeight-initH>1){this._initializeHeights()}},_calculateSpecialColumnsWidth:function(){var width=0;this.headersTable().find("> colgroup > col[data-skip=true]").each(function(){var colWidth=this.style.width;if(colWidth){width+=parseInt(colWidth,10)}});if(width>0){this._origSum=width}return width},_allSpecialColumnsInPercentage:function(){var specCols=this.headersTable().find("> colgroup > col[data-skip=true]"),i;for(i=0;i<specCols.length;i++){if(!specCols[i].style.width.endsWith("%")){return false}}return true},_synchronizeHScroll:function(){var hasFixedHeaders=this.options.showHeader&&this.options.fixedHeaders===true&&this.options.height!==null,hasFixedFooters=this.options.showFooter&&this.options.fixedFooters===true&&this.options.height!==null,scroller=this._hscrollbarcontent(),scrollContainer=this.scrollContainer(),horizontalScrollContainer,scrLeft=scroller.scrollLeft(),headers,footers;if(scroller.length===0){horizontalScrollContainer=$("#"+this.id()+"_horizontalScrollContainer");if(horizontalScrollContainer.length===1){scrLeft=horizontalScrollContainer.scrollLeft();this._vdisplaycontainer().scrollLeft(scrLeft)}else{return}}else if(scrollContainer.length>0){scrollContainer.scrollLeft(scrLeft);if(scrollContainer.scrollLeft()!==0||this.element.height()!==0){scrLeft=scrollContainer.scrollLeft();scroller.scrollLeft(scrLeft)}}if(hasFixedHeaders){headers=this.headersTable().parent();headers.scrollLeft(scrLeft)}if(hasFixedFooters){footers=this._fixedfooters();footers.scrollLeft(scrLeft)}},_updateGridContentWidth:function(){var gridWidth=0,hasWidthInPixels=this._gridHasWidthInPixels(),scroller,scrLeft,hasFixedHeader=this.options.height!==null&&this.options.fixedHeaders===true&&this.options.showHeader&&this._headerParent;$.each(this._visibleColumns(),function(index,col){if(col.fixed===true){return true}if(gridWidth!==undefined&&col.width&&!(col.width.charAt&&col.width.endsWith("%"))){gridWidth+=parseInt(col.width,10)}else{gridWidth=undefined}});if(gridWidth===undefined){return}gridWidth+=this._calculateSpecialColumnsWidth();if(!hasFixedHeader&&this._hasVerticalScrollbar&&(!hasWidthInPixels||hasWidthInPixels&&gridWidth<=parseInt(this.options.width,10))){gridWidth-=this._scrollbarWidth()}if(this.options.width!==null&&this.options.height!==null){scroller=this._hscrollbarcontent();scrLeft=scroller.scrollLeft()}this._setGridContentWidth(gridWidth);if(this.options.height!==null&&this.options.width!==null){this._updateVerticalScrollbarCellPadding()}if(this.options.width!==null&&this.options.height!==null){scroller.scrollLeft(scrLeft);this._synchronizeHScroll()}},_updateVerticalScrollbarCellPadding:function(skipHeaderFooters){var hasFixedHeaders=this.options.showHeader&&this.options.fixedHeaders===true&&this.options.height!==null,hasFixedFooters=this.options.showFooter&&this.options.fixedFooters===true&&this.options.height!==null,emptySpace,paddingIncrement;if(this.options.height===null){return}if(!hasFixedHeaders&&!hasFixedFooters){return}if(this._gridInnerWidth===undefined||this._gridContentWidth===undefined){emptySpace=0}else{emptySpace=this._gridInnerWidth-this._gridContentWidth}if(this._hasVerticalScrollbar){paddingIncrement=this._scrollbarWidth()}else{paddingIncrement=0}if(emptySpace>=0){paddingIncrement-=emptySpace}if(paddingIncrement<0){paddingIncrement=0}this._updateVScrollbarCellPaddingHelper(paddingIncrement,skipHeaderFooters);return paddingIncrement},_updateVScrollbarCellPaddingHelper:function(paddingIncrement,skipHeaderFooters){var hasFixedHeaders=this.options.showHeader&&this.options.fixedHeaders===true&&this.options.height!==null,hasFixedFooters=this.options.showFooter&&this.options.fixedFooters===true&&this.options.height!==null;if(hasFixedHeaders&&!skipHeaderFooters){this._increaseLastHeaderCellVScrollbarPadding(this.headersTable(),paddingIncrement)}if(hasFixedFooters&&!skipHeaderFooters){this._increaseLastCellVScrollbarPadding(this.footersTable(),"tfoot","td",paddingIncrement)}this._increaseLastCellVScrollbarPadding(this.element,"tbody","td",paddingIncrement)},_getLastCellsInMCH:function(headerTable){var $thead,ml=this._maxLevel,$tr,lastCells=$(),i,$th,rowspan;if(!headerTable){headerTable=this.headersTable()}$thead=headerTable.find("thead");if(!ml||!$thead.length){return lastCells}for(i=ml;i>=0;i--){$tr=$thead.children("tr[data-mch-level="+i+"]");if(!$tr.length){continue}$th=$tr.children("th:last-child").not("[data-skip=true]");lastCells=lastCells.add($th);rowspan=parseInt($th.attr("rowspan"),10);if(!isNaN(rowspan)&&rowspan>1){i-=rowspan-1}}lastCells=lastCells.add($thead.children("tr:not([data-mch-level])").not("[data-skip=true]").children("th:last-child").not("[data-skip=true]"));return lastCells},_increaseLastHeaderCellVScrollbarPadding:function(table,paddingIncrement){var lastCells,currIncrement,paddingValue;if(this._isMultiColumnHeader){lastCells=this._getLastCellsInMCH(table)}else{lastCells=table.children("thead").children("tr").not("[data-skip=true]").children("th:last-child").not("[data-skip=true]")}currIncrement=parseInt(lastCells.first().attr("data-vscr-padding-icrement"),10);paddingValue=parseInt(lastCells.first().css(this._padding),10);if(currIncrement){paddingValue-=currIncrement}this._removeHeaderCellPadding(table);lastCells.css(this._padding,paddingValue+paddingIncrement);lastCells.first().attr("data-vscr-padding-icrement",paddingIncrement);lastCells.find("[data-nonpaddedindicator=right]").css(this._rtl?"margin-left":"margin-right",-parseInt(lastCells.css(this._padding),10)+"px")},_removeHeaderCellPadding:function(table,removeAllPaddings){var withoutLastCell=":not(:last)";if(removeAllPaddings===true){withoutLastCell=""}table.find("thead > tr > th"+withoutLastCell+"[data-vscr-padding-icrement],thead > tr > td:not(:last)[data-vscr-padding-icrement]").removeAttr("data-vscr-padding-icrement").css(this._padding,"")},_removeCellPadding:function(table,tableGroup,rowElement,removeAllPaddings){var i,$cell,cells,withoutLastCell=":not(:last)";if(removeAllPaddings===true){withoutLastCell=""}cells=table.find(" > "+tableGroup+" > tr:first > "+rowElement+withoutLastCell+"[data-vscr-padding-icrement]");for(i=0;i<cells.length;i++){$cell=$(cells[i]);$cell.removeAttr("data-vscr-padding-icrement");table.find(" > "+tableGroup+" > tr > "+rowElement+":nth-child("+($cell.index()+1)+")").css(this._padding,"")}},_increaseLastCellVScrollbarPadding:function(table,tableGroup,rowElement,paddingIncrement){var paddingValue,lastCells=table.find(" > "+tableGroup+" > tr > "+rowElement+":last-child"),currIncrement=parseInt(lastCells.first().attr("data-vscr-padding-icrement"),10);this._removeCellPadding(table,tableGroup,rowElement);paddingValue=parseInt(lastCells.first().css(this._padding),10);if(currIncrement){paddingValue-=currIncrement}lastCells.css(this._padding,paddingValue+paddingIncrement);lastCells.first().attr("data-vscr-padding-icrement",paddingIncrement)},_updateHScrollbarVisibility:function(){var o=this.options,scrollerContainer=this._hscrollbar(),visibleScroller=scrollerContainer.is(":visible"),shouldInitHeights=false;if(!scrollerContainer.length&&o.virtualizationMode==="continuous"){scrollerContainer=this._vhorizontalcontainer();visibleScroller=scrollerContainer.is(":visible")}scrollerContainer.css("display","");if(!scrollerContainer.is(":visible")&&scrollerContainer.length>0){scrollerContainer.css("display","none");return}if(this._gridInnerWidth<this._gridContentWidth){if(o.virtualizationMode==="continuous"&&(scrollerContainer.length===0||this._getHScrollContainerInner().length===0)){this._vhorizontalcontainer().empty();this._renderHorizontalScrollContainer(this._calculateContainerWidth(false));shouldInitHeights=true}else if(o.virtualization||o.rowVirtualization){if((!o.width||o.width.indexOf&&o.width.indexOf("%")>0)&&!this._allColumnWidthsInPercentage&&!this._allColumnWidthsInPixels){scrollerContainer.css("display","none")}}}else{if(o.virtualizationMode==="continuous"&&scrollerContainer.length===0&&this._getHScrollContainerInner().length===1){this._vhorizontalcontainer().empty().attr("style","");shouldInitHeights=true}scrollerContainer.css("display","none")}shouldInitHeights=shouldInitHeights||scrollerContainer.is(":visible")!==visibleScroller;if(o.autoAdjustHeight&&shouldInitHeights){this._initializeHeights()}},_setGridContentWidth:function(gridContentWidth){var o=this.options,w,v=o.virtualization===true||o.rowVirtualization===true||o.columnVirtualization===true;if(this.options.height!==null){if(gridContentWidth){this._gridContentWidth=gridContentWidth}if(this._gridContentWidth){w=(this._hasVerticalScrollbar||this.options.rowVirtualization||this.options.virtualizationMode==="continuous"&&this.options.virtualization)&&this.options.fixedHeaders?this._gridContentWidth-this._scrollbarWidth():this._gridContentWidth;this._getHScrollContainerInner().css("width",w)}this._updateHScrollbarVisibility()}if(v===false){this._setGridTablesWidth(gridContentWidth)}},_setGridTablesWidth:function(width){var hasFixedHeaders=this.options.showHeader&&this.options.fixedHeaders===true&&this.options.height!==null,hasFixedFooters=this.options.showFooter&&this.options.fixedFooters===true&&this.options.height!==null;this.element.width(width);if(hasFixedHeaders){this.headersTable().width(width)}if(hasFixedFooters){this.footersTable().width(width)}},_detachHiddenColumns:function(){var col,i;for(i=0;i<this.options.columns.length;i++){col=this.options.columns[i];if(col.hidden){this._detachColumn(col)}}},_rerenderColgroups:function(){var hasFixedHeader=this.options.height!==null&&this.options.fixedHeaders===true&&this.options.showHeader,hasFixedFooter=this.options.height!==null&&this.options.fixedFooters===true&&this.options.showFooter,initial=this.options.autofitLastColumn;if(hasFixedHeader){this.headersTable().children("colgroup").remove();this._renderColgroup(this.headersTable()[0],true,false,initial)}if(hasFixedFooter){this.footersTable().children("colgroup").remove();this._renderColgroup(this.footersTable()[0],false,true,initial)}this.element.children("colgroup").remove();this._renderColgroup(this.element[0],false,false,initial)},_detachColumn:function(col){var position,cols,headerCells,isMultiColumnGrid=this._isMultiColumnGrid;col.hidden=false;this._visibleColumnsArray=undefined;cols=this._visibleColumns();position=$.inArray(col,cols);col.hidden=true;this._visibleColumnsArray=undefined;this._initializeDetachedContainers();headerCells=this.headersTable().children("thead").children("tr").not("[data-skip=true]");if(isMultiColumnGrid){this._hideMultiHeaderCells(this._headerCells,position,col.key);headerCells=this.headersTable().children("thead").children("tr:not([data-mch-level])").not("[data-skip=true]");this._detachCells(headerCells,function(row){return row.filter(":not([data-new-row],[data-add-row])").children("th, td").not("[data-skip=true]")},position,this._detachedHeaderCells,col.key)}else{this._detachCells(headerCells,function(row){return row.filter(":not([data-new-row],[data-add-row])").children("th, td").not("[data-skip=true]")},position,this._detachedHeaderCells,col.key)}this._detachCells(this.footersTable().children("tfoot").children("tr"),function(row){return row.children("td").not("[data-skip=true]")},position,this._detachedFooterCells,col.key)},_attachColumn:function(col){var headerCells,visibleCols=this._visibleColumns(),position=$.inArray(col,visibleCols);this._initializeDetachedContainers();if(this._isMultiColumnGrid){this._showMultiHeaderCells(col.key);headerCells=this.headersTable().children("thead").children("tr:not([data-mch-level])").not("[data-skip=true]");this._attachCells(headerCells,function(row){return row.children("th, td").not("[data-skip=true]")},position,this._detachedHeaderCells,col.key)}else{this._attachCells(this.headersTable().children("thead").children("tr").not("[data-skip=true]"),function(row){return row.children("th, td").not("[data-skip=true]")},position,this._detachedHeaderCells,col.key)}this._attachCells(this.footersTable().children("tfoot").children("tr"),function(row){return row.children("td").not("[data-skip=true]")},position,this._detachedFooterCells,col.key)},_initializeDetachedContainers:function(){if(!this._detachedContainersInitialized){this._detachedHeaderCells={};this._detachedFooterCells={};this._detachedContainersInitialized=true}},_getParentsMultiHeader:function(key){var i,cols=this._oldCols,colsLength=cols.length,arr=[];for(i=0;i<colsLength;i++){if(cols[i].key===key||cols[i].identifier===key){arr.push(cols[i]);break}if(cols[i].group){if(this._getParentsMultiHeaderRecursive(key,cols[i].group,arr)===true){arr.push(cols[i]);break}}}return arr},_getParentsMultiHeaderRecursive:function(key,arr,resArr){var i,cols=arr,colsLength=arr.length,res=false;for(i=0;i<colsLength;i++){if(cols[i].key===key||cols[i].identifier===key){resArr.push(cols[i]);res=true;break}if(cols[i].group&&this._getParentsMultiHeaderRecursive(key,cols[i].group,resArr)===true){resArr.push(cols[i]);res=true;break}}return res},_hideMultiHeaderCells:function(headerCells,position,key){var i,currentCell,parents=this._getParentsMultiHeader(key),parent,colspan,$th,headersTable=this.headersTable().find("thead > tr"),$tr;currentCell=headerCells[position];this._headerCells.splice(position,1);$tr=currentCell.closest("tr");if($tr[0].style.height===""){$tr[0].style.height=$tr.outerHeight()+"px"}currentCell.css("display","none");this._hiddenColumns[key]=currentCell;if(parents.length>0){for(i=0;i<parents.length;i++){parent=parents[i];if(parent.level===0){continue}$th=headersTable.find("th[data-mch-id="+parent.identifier+"]");if($th.length===0){$th=this.fixedHeadersTable().find("thead > tr").find("th[data-mch-id="+parent.identifier+"]")
}colspan=parseInt($th.attr("colspan"),10);if(colspan>1){$th.attr("colspan",--colspan);parent.colspan=colspan}else{$tr=$th.closest("tr");if($tr[0].style.height===""){$tr[0].style.height=$tr.outerHeight()+"px"}$th.attr("ishidden",1);$th.css("display","none");parent.hidden=true;parent.colspan=0}}}},_detachCells:function(rows,cellSelectorFunction,position,container,key){var detachedCells=[],i,cells,currentCell;if(rows.length>0){for(i=0;i<rows.length;i++){cells=cellSelectorFunction(rows.eq(i));currentCell=cells.eq(position);if(cells.length===1){currentCell.after($("<"+currentCell[0].tagName+"></"+currentCell[0].tagName+">").attr("data-hiddenreplacement","true").css("height",currentCell.height()).attr("class",currentCell.attr("class")))}detachedCells.push(currentCell.detach())}container[key]=detachedCells}},_showMultiHeaderCells:function(key){var i,currentCell=this._hiddenColumns[key],parents=this._getParentsMultiHeader(key),parent,colspan,$th,currentOrder,order,headerCellsLength=this._headerCells.length,headersTable=this.headersTable().find("thead > tr"),isHidden;if(currentCell===null||currentCell===undefined){return}currentOrder=currentCell.data("data-mch-order");for(i=0;i<headerCellsLength;i++){order=this._headerCells[i].data("data-mch-order");if(currentOrder<order){this._headerCells.splice(i,0,currentCell);break}}if(i===headerCellsLength){this._headerCells.push(currentCell)}currentCell.css("display","");currentCell.removeAttr("ishidden");if(parents.length>0){for(i=0;i<parents.length;i++){parent=parents[i];if(parent.level===0){continue}$th=headersTable.find("th[data-mch-id="+parent.identifier+"]");if($th.length===0){$th=this.fixedHeadersTable().find("thead > tr").find("th[data-mch-id="+parent.identifier+"]")}isHidden=$th.attr("ishidden")==="1";colspan=parseInt($th.attr("colspan"),10);if(!isHidden){$th.attr("colspan",++colspan);parent.colspan=colspan}else{$th.removeAttr("ishidden");$th.css("display","");parent.hidden=false;parent.colspan=1}}}},_attachCells:function(rows,cellSelectorFunction,position,container,key){var detachedCells,i,cells,replacementCell,storedKey;if(rows.length>0){if(this.options.virtualization===true||this.options.columnVirtualization===true){detachedCells=container[key];if(detachedCells===null||detachedCells===undefined){for(storedKey in container){if(container.hasOwnProperty(storedKey)){detachedCells=container[storedKey];delete container[storedKey];break}}}else{delete container[key]}}else{detachedCells=container[key];delete container[key]}if(detachedCells===undefined||detachedCells===null){return}for(i=0;i<rows.length;i++){cells=cellSelectorFunction(rows.eq(i)).not("[data-hiddenreplacement=true]");if(position===0){if(cells.length===0){replacementCell=rows.eq(i).find("[data-hiddenreplacement=true]");replacementCell.after(detachedCells[i]);replacementCell.remove()}else{cells.eq(0).before(detachedCells[i])}}else{cells.eq(position-1).after(detachedCells[i])}}}},_cleanupTBody:function(){var tbody=this.element.children("tbody");if($.ui.igGrid.speedupDOMCleanup===false){tbody.empty()}else{if(tbody.children().length>0){this.element[0].removeChild(tbody[0]);tbody=$('<tbody role="rowgroup"></tbody>');if(this.element.children("tfoot").length>0){tbody.insertBefore(this.element.children("tfoot"))}else{tbody.appendTo(this.element)}tbody.addClass(this.css.baseContentClass).addClass(this.css.gridTableBodyClass).addClass(this.css.recordClass)}}return tbody},_captureInitiallyHiddenColumns:function(){this._initialHiddenColumns=$.grep(this.options.columns,function(column){var hidden=column.hidden;column.hidden=false;return hidden})},getUnboundValues:function(key){var res;if(key===undefined||key===null){return this._unboundValues}res=this._unboundValues[key];if(res===undefined||res===null){if(this.getUnboundColumnByKey(key)!==null){res=[]}else{res=null}}return res},setUnboundValues:function(key,values,removeOldValues){var i,column=this.getUnboundColumnByKey(key),uVals,data,len,reRenderData=false;if(column&&!column.formula){uVals=column.unboundValues;if(removeOldValues){column.unboundValues=values;data=this.dataSource.data();len=data.length;for(i=0;i<len;i++){if(data[i][key]!==null&&data[i][key]!==undefined){reRenderData=true;delete data[i][key]}}if(reRenderData){this._renderData()}}else{len=values.length;if(uVals&&uVals.length>len){for(i=0;i<len;i++){column.unboundValues[i]=values[i]}}else{column.unboundValues=values}}}if(!this._hasInitialUnboundValues){this._hasInitialUnboundValues={}}this._hasInitialUnboundValues[key]=true;this._renderUnboundValues(values,key)},setUnboundValueByPK:function(col,rowId,val,notToRender){var data=this.dataSource.data(),pkCol,rec,tr,f,pk=this.options.primaryKey,colKey,pkVal;if($.type(col)==="string"){colKey=col;col=this.columnByKey(colKey)}else{colKey=col.key}if(!col||!col.unbound){return false}if(pk===null){pkVal=parseInt(rowId,10);rec=data[pkVal]}else{pkCol=this.columnByKey(this.options.primaryKey);if(pkCol){pkVal=rowId;if(pkCol.dataType==="number"||pkCol.dataType==="numeric"){pkVal=parseInt(rowId,10);rec=this.dataSource.findRecordByKey(rowId)}else{rec=this.dataSource.findRecordByKey(rowId)}}else{return false}}if(!rec){return false}if(val===undefined){if(col.formula){f=this._getUnboundColumnFormula(col);if(f){val=f.apply(col,[rec,this.element])}}}if(this.dataSource&&this.dataSource.schema){rec[colKey]=this.dataSource.schema()._convertType(col.type,val,pkVal,colKey)}else{rec[colKey]=val}if(!notToRender){tr=this.rowById(rowId,col.isFixed);if(tr.length){this._renderRow(rec,tr[0])}}return rec},_getUnboundColumnFormula:function(col){if(!col){return null}var f=null,colType=typeof col;if(colType==="string"){col=this.getUnboundColumnByKey(col);if(!col){return null}colType=typeof col}if(!col.formula||colType!=="object"){return null}f=col.formula;if(typeof f==="function"){return f}else if(window[f]&&typeof window[f]==="function"){return window[f]}return null},_renderUnboundValues:function(values,key,notToRender){var i,data=this.dataSource.data(),dataLength=data.length,valuesLength=values.length,isToConvert=false,type="string",pk=this.options.primaryKey,col,schema,pkVal;if(valuesLength===0){return}col=this.getUnboundColumnByKey(key);if(col===null){return}if(this.dataSource&&this.dataSource.schema){if(col.dataType){type=col.dataType;isToConvert=true;schema=this.dataSource.schema()}}if(pk===undefined){pk=null}for(i=0;i<valuesLength;i++){if(data[i]===undefined||data[i]===null){break}if(isToConvert){if(pk===null){pkVal=i}else{pkVal=data[i][pk]}values[i]=schema._convertType(type,values[i],pkVal,key)}data[i][key]=values[i];this._addUnboundColumnValue(key,values[i],i)}if((type==="bool"||type==="boolean")&&valuesLength<dataLength){for(i=valuesLength;i<dataLength;i++){data[i][key]=schema._convertType(type,null,pkVal,key)}}if(this.options.virtualization===true||this.options.rowVirtualization===true&&this._persistVirtualScrollTop){this._scrollTo(0)}if(notToRender!==true){this._renderColumnData(key,this.dataSource.dataView())}},getUnboundColumnByKey:function(key){if(this._unboundColumns===undefined||this._unboundColumns===null||this._unboundColumns.length===0||key===null||key===undefined){return null}var column=null;$.each(this._unboundColumns,function(ind,col){if(col.key===key){column=col;return false}});return column},_renderColumnData:function(key,values){if(values.length===0){return}var visibleColumns=this._visibleColumns(),grid=this,tdIndex,index,tds,column,ds,isToConvertToString=false,hasTemplate,temp;index=this.getVisibleIndexByKey(key);column=visibleColumns[index];hasTemplate=column.template&&column.template.length>0;if(column===undefined||column===null){return}isToConvertToString=column.dataType==="bool";if(hasTemplate){ds=this.dataSource.dataView()}tdIndex=index+this.headersTable().find(">thead>tr:eq(0)>th[data-skip=true]").length;tds=this.element.find(">tbody> tr > td:not([data-skip]):nth-child("+(tdIndex+1)+")");$.each(values,function(ind,val){var innerHtml;if(val[key]===undefined){return true}if(hasTemplate){temp=grid._renderTemplatedCell(ds[ind],column);if(temp.indexOf("<td")===0){innerHtml=$(temp).html()}else{innerHtml=temp}}else{innerHtml=grid._renderCell(val[key],column,val);if(isToConvertToString===true){innerHtml=innerHtml.toString()}}if(!tds[ind]){return false}$(tds[ind]).html(innerHtml)})},_renderData:function(success,errmsg,response){if(success!==undefined||!this._isDataBoundCalled){this._trigger(this.events.dataBound,null,{owner:this,dataSource:this.dataSource});this._isDataBoundCalled=false}var gridElement=this.element,div,self=this,noCancel=true,sum=0,cols,colsToUnbound,colsLength,data,key,j,i,f,diff=0,isTable=false,noCancelError=true,isRemoteDS=this._inferOpType()==="remote",ucFormulaFunction,tbody,newW,totalWidth,isToRefreshUI=false,jsrnd=String(this.options.templatingEngine).toLowerCase()==="jsrender",displayCont;if((this.options.requiresDataBinding===true||this._isToSetUnboundColumns===true||isRemoteDS)&&this._hasUnboundColumns){this._isToSetUnboundColumns=false;if(this._hasInitialUnboundValues===null||this._hasInitialUnboundValues===undefined){this._hasInitialUnboundValues={}}cols=this.options.columns;colsLength=cols.length;data=this.dataSource.data();ucFormulaFunction=function(data,f,col){$.each(data,function(ind,val){val[key]=f.apply(col,[val,gridElement]);self._addUnboundColumnValue(key,val[key],ind)})};colsToUnbound=[];if(isRemoteDS){this._unboundValues={}}for(i=0;i<colsLength;i++){if(cols[i].unbound===true){key=cols[i].key;if(cols[i].unboundValues!==null&&cols[i].unboundValues!==undefined&&$.type(cols[i].unboundValues)==="array"){if(this._rebindUnboundColumns===true||cols[i].unboundValues.length>0&&this._hasInitialUnboundValues[key]===undefined){this._hasInitialUnboundValues[key]=true;this._renderUnboundValues(cols[i].unboundValues,key,true)}}else if(cols[i].formula!==null&&cols[i].formula!==undefined){f=this._getUnboundColumnFormula(cols[i]);if(f){ucFormulaFunction(data,f,cols[i])}}else if(this._unboundValues[key]&&this._unboundValues[key].length>0){colsToUnbound.push(key)}}}this._rebindUnboundColumns=false;if(this.options.localSchemaTransform===true&&colsToUnbound.length>0&&data.length>0){for(i=0;i<colsToUnbound.length;i++){key=colsToUnbound[i];if(data[0][key]===undefined){this._renderUnboundValues(this._unboundValues[key],key)}}}if(this.options.mergeUnboundColumns===false){this._mergeUnboundValues()}}if(success===false){noCancelError=this._trigger(this.events.requestError,null,{owner:this,message:errmsg,response:response});if(noCancelError){throw new Error(errmsg)}}if(this._cancelRendering===true){this._cancelRendering=false;return}this.element.trigger("iggriduisoftdirty",{owner:this});if(!this._initialized){if(this.options.autoGenerateColumns===true){this._generateColumns();if((this.options.virtualization===true||this.options.columnVirtualization===true)&&this.options.width){totalWidth=this._calculateContainerWidth(false);if(totalWidth>parseInt(this.options.width,10)&&$("#"+this.id()+"_horizontalScrollContainer").children().length===0){this._renderHorizontalScrollContainer(totalWidth)}}for(i=0;i<this.options.features.length;i++){this._initFeature(this.options.features[i],this._dataOptions)}}}tbody=gridElement.children("tbody");noCancel=this._trigger(this.events.dataRendering,null,{owner:this,tbody:tbody});if(noCancel){if(!(this.options.dataSource&&this.options.dataSource.tagName&&$(this.options.dataSource).is("table"))){tbody=this._cleanupTBody()}else{isTable=true}this._resetVirtualDom();if(!this._initialized){if(this.options.autoGenerateColumns===true){this._captureInitiallyHiddenColumns();this._visibleColumnsArray=undefined;this._updateVirtColCounters()}if(isTable){tbody.empty()}if(this._renderHeaderCalled!==true){this._renderHeader();this._renderCaption()}else{if(this.options.width!==null&&this.options.height===null){this.scrollContainer().css("overflow-y","hidden").css("overflow-x","auto")}}if(this._rmvClgrpOnInitRenderData&&!this.element.find("colgroup[data-cols-injected]").length){this.element.find("colgroup").remove()}if(this.element.find("colgroup").length===0||this.element.find("colgroup").children().length===0){this._renderColgroup(this.element[0],false,false,this.options.autofitLastColumn)}this._renderFooter();div=this.scrollContainer();if(!div.length){div=this._vdisplaycontainer()}div.data("containerName","dataContainer").bind("scroll.syncScrollContainers",$.proxy(this._onScrollContainer,this));this._registerScrllCntnrToSync(div)}this._trigger("dataEmpty",null,{owner:this,tbody:tbody});if(this.options.autoGenerateColumns===false&&(this.options.columns&&this.options.columns.length===0||!this.options.columns)){throw new Error($.ig.Grid.locale.noColumnsButAutoGenerateTrue)}this._tmplWrappers=jsrnd?$.render:{};this._setTemplateDefinition(jsrnd);if(this._initialHiddenColumns===undefined||this._initialHiddenColumns.length===0){if(this.options.columns.length>0){if(this.options.virtualization===true||this.options.rowVirtualization===true||this.options.columnVirtualization===true){if(!this._persistVirtualScrollTop){this._scrollContainer()[0].scrollTop=0}this._renderVirtualRecords()}else{this._renderRecords()}if(this._initialized){this._adjustLastColumnWidth(false);if(this.options.width!==null&&this.options.height!==null){this._synchronizeHScroll()}}else{if(this.options.height!==null&&this.options.autoAdjustHeight){this._initializeHeights()}this._adjustLastColumnWidth(true)}}}if(!this._initialized){if(this.options.autoAdjustHeight){this._initializeHeights()}}if(this._initialHiddenColumns!==undefined&&this._initialHiddenColumns.length>0){this._setHiddenColumns(this._initialHiddenColumns,true,true);if(this._initialHiddenCells!==undefined&&this._initialHiddenCells.length>0){$.each(this._initialHiddenCells,function(index,cell){cell.css("display","")})}$.each(this._initialHiddenColumns,function(index,column){column._initiallyHidden=true});this._initialHiddenCells=undefined;this._initialHiddenColumns=undefined;if($.ig.util.isFF){isToRefreshUI=true}}this._registerAdditionalEvents();this._updateVirtualScrollContainer();this._fireInternalEvent("_dataRendered");if(!this._initialized){this.autoSizeColumns()}this._trigger(this.events.dataRendered,null,{owner:this});if(this._loadingIndicator===undefined){this._initLoadingIndicator()}this._loadingIndicator.hide()}if(this._fixScrollY){this.scrollContainer().css("overflow-y",this.rows().length>1?"hidden":"visible")}if(this.options.width===null&&this.container()[0]&&this.container()[0].style.width){cols=this.element.find("colgroup > col[data-skip]");if(cols.length>0){for(j=0;j<cols.length;j++){sum+=parseInt(cols[j].style.width,10)}}if(!this._origSum){this._origSum=0}diff=sum-this._origSum;if(diff<0){diff=0}newW=parseInt(this.container()[0].style.width,10)+diff;this.container().css("width",newW);displayCont=this._vdisplaycontainer();if(displayCont.length>0){displayCont.css("width",newW-this._scrollbarWidth()).css("max-width",newW-this._scrollbarWidth());this.container().find("#"+this.id()+"_headers_v").css("width",newW);this._fixedfooters().css("width",newW)}this._origSum=sum}if(this.options.dataSourceUrl!==null&&this._firstBind){this.options.dataSource=this.options.dataSourceUrl;this.dataSource.settings.dataSource=this.options.dataSourceUrl;this.dataSource.settings.type="remoteUrl";this.dataSource._runtimeType=this.dataSource.analyzeDataSource();this._firstBind=false}if(!this._initialized){this._trigger(this.events.rendered,null,{owner:this});this._hc=this.container().find(".ui-iggrid-expandheadercell").length>0;this._initialized=true;if(document.documentMode===7||$.ig.util.isIE7){$.each($("#"+this.id()+"_container colgroup col"),function(){var $col=$(this),styleWidth=parseInt(this.style.width,10),width=$col.outerWidth();if(styleWidth&&styleWidth<width){$col.width(2*styleWidth-width)}})}}this._fireInternalEvent("_gridRendered",this.container());if(isToRefreshUI){this._refreshUI()}},_refreshUI:function(){var self=this;self.container().hide();setTimeout(function(){self.container().show()},0)},_updateVirtualScrollContainer:function(){var h,e=this.element;this._totalRowCount=this._getTotalRowCount();if((this.options.virtualization||this.options.rowVirtualization)&&this._totalRowCount){if(this._avgRowHeight===undefined||this._avgRowHeight===null){this._avgRowHeight=this._calculateAvgRowHeight()}h=this._totalRowCount*this._avgRowHeight;if(this._scrollContainer().height()>=h){e.height("");if(this.options.virtualizationMode==="fixed"){e.find(".ui-iggrid-virtualrow").height(this._avgRowHeight)}this._setScrollContainerHeight(h)}else{if(this.options.virtualizationMode==="continuous"){e.height("");this._setScrollContainerHeight(h)}else{e.height(this._initialVirtualHeight)}}}},_hasColumnTemplates:function(){var i,hasTemplates=false,t;for(i=0;i<this.options.columns.length;i++){t=this.options.columns[i].template;if(t!==null&&t!==undefined&&t!==""&&t.length>0){hasTemplates=true;break}}return hasTemplates},_gridHasWidthInPixels:function(){if(typeof this.options.width==="string"&&this.options.width.indexOf("%")!==-1){return false}return parseInt(this.options.width,10)>0},_gridHasWidthInPercent:function(){if(typeof this.options.width==="string"&&this.options.width.indexOf("%")!==-1){return true}return false},_isColumnVirtualizationEnabled:function(){var i,w,o=this.options,cols,allColsInPercentage=true;if(!o.virtualization||o.virtualizationMode==="continuous"||o.width===null){return false}if(o.columnVirtualization){return true}cols=o.columns;for(i=0;i<cols.length;i++){if(cols[i].width){w=cols[i].width}w=_aNull(w)?o.defaultColumnWidth:w;if(!_aNull(w)&&($.type(w)!=="string"||!w.endsWith("%"))){allColsInPercentage=false;break}}if(!allColsInPercentage){return true}return false},hasVerticalScrollbar:function(){var hasVScrollbar;hasVScrollbar=this.options.autoAdjustHeight&&this.element.height()<=this.scrollContainer().height()||!this.options.autoAdjustHeight&&this.options.avgRowHeight*this.element[0].rows.length<parseInt(this.options.height,10);return!hasVScrollbar},_adjustLastColumnWidth:function(colgroupsRerendered){var grid=this,calcGridWidth,hasFixedHeader=this.options.height!==null&&this.options.fixedHeaders===true&&this.options.showHeader&&this._headerParent,hasFixedFooter=this.options.height!==null&&this.options.fixedFooters===true&&this.options.showFooter&&this._footerParent,hasHeight=this.options.height&&parseInt(this.options.height,10)>0,hasWidthInPixels=this._gridHasWidthInPixels(),hasWidthInPercent=this._gridHasWidthInPercent(),hasVirtualization=this.options.virtualization===true||this.options.columnVirtualization===true||this.options.rowVirtualization===true,gridWidth,paddingIncrement,specialColumnsWidth;if(hasHeight&&!hasVirtualization){if(this.hasVerticalScrollbar()){this._hasVerticalScrollbar=true}else{this._hasVerticalScrollbar=false}}if(colgroupsRerendered){if(hasVirtualization){if(hasFixedHeader){this._headerParent.css(this._padding,this._scrollbarWidth())}if(hasFixedFooter){this._footerParent.css(this._padding,this._scrollbarWidth())}}if(hasWidthInPixels||hasWidthInPercent){if(this._allColumnWidthsInPixels){gridWidth=this._totalColPixelWidth;specialColumnsWidth=this._calculateSpecialColumnsWidth();if(specialColumnsWidth>0){if(this._autoadjustedColumn&&this._lastColPixelWidth){if(this._autoadjustedColumn.difference<specialColumnsWidth){this._lastColPixelWidth-=this._autoadjustedColumn.difference;gridWidth-=this._autoadjustedColumn.difference-specialColumnsWidth}else{this._lastColPixelWidth-=specialColumnsWidth}this._autoadjustedColumn.width=this._lastColPixelWidth;if(hasFixedHeader){this._lastHeaderCol.css("width",this._lastColPixelWidth+"px")}if(hasFixedFooter){this._lastFooterCol.css("width",this._lastColPixelWidth+"px")}this._lastDataCol.css("width",this._lastColPixelWidth+"px")}else{gridWidth+=specialColumnsWidth}}if(!hasFixedHeader&&this._gridWidthGTColWidth&&this._hasVerticalScrollbar){gridWidth-=this._scrollbarWidth();this._lastColPixelWidth-=this._scrollbarWidth();this._lastDataCol.css("width",this._lastColPixelWidth+"px")}}else if(this._allColumnWidthsInPercentage){gridWidth=this.container().width();specialColumnsWidth=this._calculateSpecialColumnsWidth();if(this._allSpecialColumnsInPercentage()===true&&specialColumnsWidth>0){this._lastColPercentWidth=this._lastColPercentWidth-specialColumnsWidth}this._lastDataCol.css("width",this._lastColPercentWidth+"%");if(hasFixedHeader){this._lastHeaderCol.css("width",this._lastColPercentWidth+"%")}if(hasFixedFooter){this._lastFooterCol.css("width",this._lastColPercentWidth+"%")}}else if(hasWidthInPixels){calcGridWidth=this._calculateContainerWidth(false);gridWidth=parseInt(grid.options.width,10);if(calcGridWidth>gridWidth){gridWidth=calcGridWidth}}else if(hasWidthInPercent){gridWidth=this.container().width()}if(!this._allColumnWidthsInPercentage||!hasWidthInPercent){if(hasVirtualization===false){this._gridInnerWidth=this.scrollContainer().width()}else{this._gridInnerWidth=this._vdisplaycontainer().width()+this._scrollbarWidth()}grid._setGridContentWidth(gridWidth)}}}else{this._setGridContentWidth()}if(hasHeight&&!hasVirtualization){if(this.options.width!==null&&this.options.height!==null){if(this._hasVerticalScrollbar){this._hscrollbarcontent().css("overflow-y","scroll")}else{this._hscrollbarcontent().css("overflow-y","hidden")}}if(this._allColumnWidthsInPercentage&&hasWidthInPercent||!(hasWidthInPixels||hasWidthInPercent)){if(this._hasVerticalScrollbar){if(hasFixedHeader){this._headerParent.css(this._padding,this._scrollbarWidth())}if(hasFixedFooter){this._footerParent.css(this._padding,this._scrollbarWidth())}}else{if(hasFixedHeader){this._headerParent.css(this._padding,"")}if(hasFixedFooter){this._footerParent.css(this._padding,"")}}}else{paddingIncrement=this._updateVerticalScrollbarCellPadding()}}},_initializeHeights:function(){var initialHeight,hscrollerContainerHeight;if(this.options.height===null||this.options.height===undefined){return}initialHeight=parseInt(this.options.height,10);if(this.hasFixedColumns()){if(this.options.showHeader&&this.options.fixedHeaders===true&&this.options.height!==null){initialHeight-=this.fixedHeadersTable().height()}hscrollerContainerHeight=this._hscrollbar().height();if(this.fixedBodyContainer().height()<initialHeight+hscrollerContainerHeight){initialHeight-=hscrollerContainerHeight}}if(this.options.height.indexOf&&this.options.height.indexOf("%")!==-1){this.scrollContainer().height("100%")}else{this.scrollContainer().height(initialHeight)}this._initializeHeightsInternal()},_initializeHeightsInternal:function(){var children,height,i,$child,ch,heightChanged=false,dc=this._vdisplaycontainer(),sc=this._scrollContainer();ch=this.container().height();this._prevContainerHeight=ch;if(this.options.height!==null){children=this.container().children(":visible");height=0;for(i=0;i<children.length;i++){$child=$(children[i]);if(($child.attr("id")!==undefined&&!$child.attr("id").endsWith("_scroll")&&!$child.attr("data-fixed-container")&&!$child.attr("id").endsWith("_virtualContainer")&&!$child.attr("id").endsWith("_loading")||!$child.attr("id"))&&$child.is(":visible")&&$child.data("efh")!=="1"){if($child.is("table")&&$child.children().first().is("caption")){height+=$child.children().first().outerHeight()}else{if($child.css("position")!=="absolute"){height+=$child.outerHeight()}}}}if(height>0){this._trigger("_heightChanging",null,{ch:ch,h:height});this.scrollContainer().height(ch-height);heightChanged=true}if(this.options.virtualization||this.options.rowVirtualization){if(this.hasFixedColumns()){height+=this._hscrollbar().height()}if($.type(this.options.height)==="string"&&this.options.height.indexOf("%")!==-1||ch!==parseInt(this.options.height,10)){this.container().height(this.options.height);if($.type(this.options.height)==="string"&&this.options.height.indexOf("%")!==-1){ch=parseInt(this.container().height(),10)}}height+=this.container().find("#"+this.id()+"_headers_v").outerHeight();height+=this.container().find("#"+this.id()+"_footers_v").outerHeight();height+=this._fixedfooters().outerHeight();height+=this._vhorizontalcontainer().outerHeight();if(!this._virtualHeightReset){height=height*2;this._virtualHeightReset=true}if(height>0&&dc.height()!==ch-height){if(!heightChanged){this._trigger("_heightChanging",null,{ch:ch,h:height})}dc.height(ch-height);sc.height(ch-height);if(!this.options.rowVirtualization||this.options.virtualizationMode!=="continuous"){this.element.height(ch-height)}this._initialVirtualHeight=ch-height;heightChanged=true}}if(heightChanged){this._trigger("_heightChanged",null,{ch:ch,h:height})}}},_registerAdditionalEvents:function(){if(this._hovEvts){return}var self=this;if(this.options.enableHoverStyles){this._hovEvts={mousemove:function(e){var par,tag,tr=e.target;while(tr){par=tr.parentNode;tag=tr.nodeName;if(tag==="TR"&&par.nodeName==="TBODY"){break}tr=tag==="TABLE"?null:par}self._mousemoveTr(tr,e)},mouseleave:function(){self._mouseleaveTr()}};this.element.bind(this._hovEvts)}},_mousemoveTr:function(tr,e){var css="ui-state-hover",topmostGrid;if(_hovTR!==tr){if(_hovTR&&$(_hovTR).attr("data-container")!=="true"){$("td",_hovTR).removeClass(css)}if(tr&&$(tr).attr("data-container")!=="true"&&e.target.id.indexOf("_scrollContainer")===-1&&e.target.parentNode.id.indexOf("_scrollContainer")===-1){topmostGrid=this.element.closest(".ui-iggrid-root").data("igGrid")||this;if(!topmostGrid._cancelHoveringEffects){$("td",tr).addClass(css)}}_hovTR=tr}},_mouseleaveTr:function(){var css="ui-state-hover";if(_hovTR){$("td",_hovTR).removeClass(css);_hovTR=null}},_renderColgroup:function(table,isHeader,isFooter,autofitLastColumn){var colgroup,hasFixedColumns=this.hasFixedColumns(),i,lc,cols=this._visibleColumns(),defWidth=this.options.defaultColumnWidth,totalColWidth=0,totalGridWidth,hasWidthInPixels=this._gridHasWidthInPixels(),hasWidthInPercent=this._gridHasWidthInPercent(),hasWidth=hasWidthInPixels||hasWidthInPercent,hasVirtualization=this.options.virtualization===true||this.options.columnVirtualization===true||this.options.rowVirtualization===true,hasColumnVirtualization=this.options.virtualization===true&&this.options.virtualizationMode==="fixed"||this.options.columnVirtualization===true,hasColumnsWithNoWidth=false,isPercentage=true,desiredColWidth,desiredColWidthNumber,lastCol,lastColWidth,difference;colgroup=$(table).find("colgroup");if(colgroup.length===0){colgroup=$("<colgroup></colgroup>").prependTo(table)}if(hasVirtualization&&this.options.virtualizationMode==="fixed"||hasColumnVirtualization){this._updateVirtColCounters();cols=cols.slice(0,this._virtualColumnCount)}for(i=0;i<cols.length;i++){if(cols[i].fixed){continue}if(cols[i].width||cols[i].width===0){if(cols[i].oWidth){desiredColWidth=cols[i].oWidth}else{desiredColWidth=cols[i].width}}else{desiredColWidth=defWidth;cols[i].width=defWidth}if(desiredColWidth||desiredColWidth===0){if(!desiredColWidth.charAt||!desiredColWidth.endsWith("%")){isPercentage=false}desiredColWidthNumber=parseInt(desiredColWidth,10);if(desiredColWidthNumber<0||isNaN(desiredColWidthNumber)){desiredColWidthNumber=undefined}}else{desiredColWidthNumber=undefined;isPercentage=false}if(!_aNull(desiredColWidthNumber)){lastCol=$("<col></col>").appendTo(colgroup).css("width",desiredColWidth);lastColWidth=desiredColWidthNumber;totalColWidth+=desiredColWidthNumber;if($.type(cols[i].width)==="string"&&cols[i].width.endsWith("px")){cols[i].width=desiredColWidthNumber+"px"}else{cols[i].width=desiredColWidthNumber}if(desiredColWidth&&desiredColWidth.charAt&&desiredColWidth.endsWith("%")){cols[i].width=cols[i].width+"%"}}else{lastCol=$("<col></col>").appendTo(colgroup);lastColWidth=undefined;hasColumnsWithNoWidth=true}lc=cols[i]}if((!hasColumnVirtualization||this._vhorizontalcontainer().find("div").length===0)&&autofitLastColumn&&hasWidth&&!hasColumnsWithNoWidth&&lastColWidth){if(isPercentage){if(totalColWidth<100){lastColWidth+=100-totalColWidth;lastCol.css("width",lastColWidth+"%");this._autoadjustedColumn=cols.slice(-1)[0];if(!this._autoadjustedColumn.oWidth){this._autoadjustedColumn.oWidth=this._autoadjustedColumn.width}this._autoadjustedColumn.width=lastColWidth+"%";lc.width=lastColWidth+"%"}}else{if(hasWidthInPixels){if(hasFixedColumns){totalGridWidth=this.container().width()-this.fixedContainer().outerWidth()}else{totalGridWidth=parseInt(this.options.width,10)}}else if(hasWidthInPercent){totalGridWidth=this.container().width()}this._gridWidthGTColWidth=false;if(totalGridWidth&&totalGridWidth>totalColWidth){difference=totalGridWidth-totalColWidth;lastColWidth+=difference;totalColWidth+=difference;lastCol.css("width",lastColWidth+"px");this._autoadjustedColumn=cols.slice(-1)[0];if(!this._autoadjustedColumn.oWidth){this._autoadjustedColumn.oWidth=this._autoadjustedColumn.width}this._autoadjustedColumn.width=lastColWidth+"px";this._autoadjustedColumn.difference=difference;lc.width=lastColWidth+"px";this._gridWidthGTColWidth=true}}}else{this._autoadjustedColumn=undefined}if(hasWidth&&hasVirtualization&&!hasColumnsWithNoWidth&&lastColWidth){if(!isPercentage){lastColWidth-=this._scrollbarWidth();lastCol.css("width",lastColWidth+"px")}}if(isHeader){this._lastHeaderCol=lastCol}if(isFooter){this._lastFooterCol=lastCol}if(!isHeader&&!isFooter){this._lastDataCol=lastCol}this._allColumnWidthsInPercentage=isPercentage&&!hasColumnsWithNoWidth&&cols.length>0;this._allColumnWidthsInPixels=!isPercentage&&!hasColumnsWithNoWidth&&cols.length>0;if(this._allColumnWidthsInPixels){this._lastColPixelWidth=lastColWidth;this._totalColPixelWidth=totalColWidth}else if(this._allColumnWidthsInPercentage){this._lastColPercentWidth=lastColWidth;this._totalColPixelWidth=undefined}else{this._lastColPixelWidth=undefined;this._totalColPixelWidth=undefined}},_renderRecords:function(start,end){var grid=this,tbody=this.element.children("tbody"),ph,noCancelInternal=true,ds=this.dataSource.dataView(),i,d="",noCancel=true,tbodytmp;noCancelInternal=this._trigger("_rowsRendering",null,{owner:this,tbody:tbody,vrtWnd:{start:start,end:end}});if(noCancelInternal){noCancel=this._trigger(this.events.rowsRendering,null,{owner:this,tbody:tbody,vrtWnd:{start:start,end:end}});if(start===undefined){start=0;end=ds.length-1}if(start!==undefined&&end===undefined){end=start;if(end>ds.length-1){end=ds.length-1}start=0}if(start<0){start=0}if(end>ds.length-1){end=ds.length-1}if(noCancel){for(i=start;i<=end;i++){d+=grid._renderRecord(ds[i],i)}if(!this._canreplaceinner||$.ig.util.isWebKit){ph=document.createElement("div");ph.innerHTML="<table><tbody class='"+this.css.baseContentClass+" "+this.css.gridTableBodyClass+" "+this.css.recordClass+"' role='rowgroup'>"+d+"</tbody></table>";tbodytmp=ph.firstChild.firstChild;this.element[0].replaceChild(tbodytmp,tbody[0])}else if(this._canreplaceinner){MSApp.execUnsafeLocalFunction(function(){tbody[0].innerHTML=d})}d="";this._buildVirtualDomForContinuousVirtualization();this._trigger(this.events.rowsRendered,null,{owner:this,tbody:tbody});if((this.options.virtualization===false||this.options.rowVirtualization===false)&&this._persistVirtualScrollTop&&this._prevFirstVisibleTROffset&&this.scrollContainer().length>0){this.scrollContainer()[0].scrollTop=this._prevFirstVisibleTROffset}}}},autoSizeColumns:function(){var cols=this._visibleColumns(),colsToResize=[];$.each(cols,function(ind,col){if((col.width==="*"||col._oWidth==="*")&&!col.hidden){colsToResize.push({column:col,visibleIndex:ind})}});if(colsToResize.length>0){this._calculateAutoResizableWidths(colsToResize);this._rerenderColgroups(false);this._updateGridContentWidth()}},_calculateAutoResizableWidths:function(columns){if(!columns||!columns.length){return[]}var rowsContainer=this.element,$parentDiv,col,cell,w,clientRect,cols,i,index,$firstRowCells,$table,$measureDiv,html,$thead,$tfoot;$parentDiv=rowsContainer.closest("div");html=$parentDiv.html();$measureDiv=$("<div></div>").attr("style",$parentDiv.attr("style")).attr("class",$parentDiv.attr("class")+" "+this.container().attr("class"));$measureDiv.css({position:"absolute",resize:"both",visibility:"hidden",height:"auto",width:"auto",left:-6e3,top:-6e3}).appendTo($(document.body));
$measureDiv.html(html);$table=$measureDiv.find(">table");if(this._initialized){cols=$table.find(">colgroup>col:not([data-skip])");if(cols.length){for(i=0;i<columns.length;i++){index=columns[i].visibleIndex;$(cols[index]).css("width","")}}}if(this.options.fixedHeaders&&this.options.showHeader){$thead=this.headersTable().find(">thead");if($thead.length){$($thead[0].outerHTML).appendTo($table)}}if(this.options.fixedFooters&&this.options.showFooter){$tfoot=this.footersTable().find(">tfoot");if($tfoot.length){$($tfoot[0].outerHTML).appendTo($table)}}$table.css("width","auto").attr("id",$table.attr("id")+"__");$firstRowCells=$table.find("tbody>tr:not([data-grouprow='true']):first").children("td:not([data-skip]):not([data-parent])");if(!$firstRowCells.length){$firstRowCells=$table.find("tr:visible:not([data-grouprow='true']):first").children("th:not([data-skip]):not([data-parent]), td:not([data-skip]):not([data-parent])")}if(!$firstRowCells.length){return}for(i=0;i<columns.length;i++){col=columns[i].column;index=columns[i].visibleIndex;cell=$firstRowCells[index];clientRect=cell.getBoundingClientRect();w=clientRect.width;if(w!==undefined){col.width=Math.ceil(w)}else{col.width=Math.ceil(clientRect.right-clientRect.left)}col._oWidth="*"}$measureDiv.remove();return columns},calculateAutoFitColumnWidth:function(columnIndex){var rows,isFixed,columnKey,col,hasFixedCols=this.hasFixedColumns(),rowsContainer=this.element,visibleColumns,cells=[],visibleIndex=columnIndex,maxWidth=0,measureDiv,i;if(hasFixedCols){visibleColumns=this._visibleColumns();col=visibleColumns[columnIndex];if(!col){return-1}isFixed=col.fixed===true;columnKey=col.key;visibleIndex=this.getVisibleIndexByKey(columnKey);if(isFixed){rowsContainer=this.fixedBodyContainer().find("table")}}rows=rowsContainer.find("> tbody > tr").not("[data-container=true]").not("[data-grouprow=true]");for(i=0;i<rows.length;i++){cells.push(rows.eq(i).children("td").not("[data-skip=true]").not(".ui-iggrid-rowselector-class").not(".ui-iggrid-expandcolumn").eq(visibleIndex))}if(cells.length>0){measureDiv=$("<div></div>").css({position:"absolute",visibility:"hidden",height:"auto",width:"auto",left:-1e3,top:-1e3,"font-family":cells[0].css("fontFamily"),"font-size":cells[0].css("fontSize"),"font-size-adjust":cells[0].css("fontSizeAdjust"),"font-stretch":cells[0].css("fontStretch"),"font-style":cells[0].css("fontStyle"),"font-variant":cells[0].css("fontVariant"),"font-weight":cells[0].css("fontWeight")}).appendTo($(document.body));for(i=0;i<cells.length;i++){measureDiv.html(cells[i][0].innerHTML);maxWidth=Math.max(maxWidth,measureDiv[0].offsetWidth)}maxWidth=maxWidth+cells[0].outerWidth()-cells[0].width();if($.ig.util.isIE){maxWidth+=1}measureDiv.remove();return maxWidth}return-1},_reapplyZebraStyle:function(from){var dataRows,toChange;if(!this.options.alternateRowStyles){return}dataRows=this.element.children("tbody").children("tr:not([data-container],[data-grouprow])");from=from||0;toChange=dataRows.slice(from);toChange.filter(from%2===0?":odd":":even").addClass(this.css.recordAltClass);toChange.filter(from%2===0?":even":":odd").removeClass(this.css.recordAltClass);if(this.hasFixedColumns()){dataRows=this.fixedContainer().find("tbody").children("tr:not([data-container],[data-grouprow])");toChange=dataRows.slice(from);toChange.filter(from%2===0?":odd":":even").addClass(this.css.recordAltClass);toChange.filter(from%2===0?":even":":odd").removeClass(this.css.recordAltClass)}},_buildFormatters:function(){var i,cols=this.options.columns,ret={};for(i=0;i<cols.length;i++){if(cols[i].formatter!==undefined){if($.type(cols[i].formatter)==="function"){ret[cols[i].key+"Formatter"]=cols[i].formatter}else if(window[cols[i].formatter]&&typeof window[cols[i].formatter]==="function"){ret[cols[i].key+"Formatter"]=window[cols[i].formatter]}}}return ret},getVisibleIndexByKey:function(columnKey,includeDataSkip){var hasFixedColumns=this.hasFixedColumns(),fixedCounters,unfixedCounters,prevColumn,cols=this._visibleColumns(),index=-1,fixed=false,$colgroup;if(hasFixedColumns){fixedCounters=0;unfixedCounters=0;prevColumn=null;$.each(cols,function(ind,value){var isFixed=value.fixed===true,prevColumnFixed=prevColumn&&prevColumn.fixed===true;if(prevColumn===null||prevColumnFixed!==isFixed){if(value.fixed===true){fixedCounters=0}else{unfixedCounters=0}}prevColumn=value;if(value.hidden){return true}if(isFixed!==true){unfixedCounters++}else{fixedCounters++}if(value.key===columnKey){if(isFixed){fixed=true;index=fixedCounters-1}else{index=unfixedCounters-1}if(index===-1){index=0}return false}})}else{$.each(cols,function(ind,value){if(value.key===columnKey){index=ind;return false}})}if(index===-1){return-1}if(includeDataSkip){if(fixed){$colgroup=$("#"+this.id()+"_fixed").find("colgroup:first")}else{$colgroup=this.element.find("colgroup:first")}index+=$colgroup.children("col[data-skip]").length}return index},_isColumnHidden:function(columnKey){var cols=this.options.columns,i=cols.length;while(i-->=0){if(cols[i].key===columnKey){return cols[i].hidden||false}}return true},_visibleColumns:function(isFixed){var vcArr;if(isFixed!==undefined){vcArr=$.grep(this.options.columns,function(col){var fixed=col.fixed===true;return!col.hidden&&fixed===isFixed});return vcArr}if(this._visibleColumnsArray===undefined){this._visibleColumnsArray=$.grep(this.options.columns,function(col){return!col.hidden})}return this._visibleColumnsArray},_visibleMchColumns:function(curLvl){var vmch=[],cl=curLvl||this._oldCols,self=this;if(!cl){return null}$.each(cl,function(){if(!this.hidden||this.hidden===false){vmch.push($.extend({},this));if(this.group){vmch[vmch.length-1].group=self._visibleMchColumns(this.group)}}});return vmch},_renderVirtualRecordsFixed:function(){var noVirtualDom=this._virtualDom===null||this._virtualDom===undefined;if(this.hasFixedColumns()){this._updateVirtColCounters(true);this._renderVirtualRecordsFixedInternal(true);this._updateVirtColCounters(false)}this._renderVirtualRecordsFixedInternal(false);this._trigger("virtualrecordsrender",null,{owner:this,tbody:this.element.children("tbody"),dom:this._virtualDom,isBuiltVirtualDom:!noVirtualDom})},_renderVirtualRecordsFixedInternal:function(isFixed){var i,j,row,c,headerText,vheaderNode,trs,iRow,tr,ds=this.dataSource,data=ds.dataView(),key=this.options.primaryKey,vd=this._getVirtualDom(isFixed),col,noVirtualDom=vd===null||vd===undefined,visibleCols=this._visibleColumns(isFixed);if(this._startRowIndex===undefined||this._startRowIndex===null){this._startRowIndex=0}if(this._startColIndex===undefined||this._startColIndex===null){this._startColIndex=0}if(noVirtualDom){if(!this._persistVirtualScrollTop){this._scrollTo(0,true)}this._buildVirtualDom();if(this.options.adjustVirtualHeights===true){this._adjustVirtualHeights()}}else if(this._virtualColumnCount){for(i=0;i<this._virtualRowCount&&i<this._totalRowCount&&this._startRowIndex+i<data.length;i++){if($.type(data[i])==="array"){row=$(this._renderRecord([data[this._startRowIndex+i]],i,isFixed))}else{row=$(this._renderRecord(data[this._startRowIndex+i],i,isFixed))}c=row.children();for(j=0;j<this._virtualColumnCount;j++){vd[i][j].innerHTML=c[j+this._startColIndex].innerHTML;vd[i][j].className=c[j+this._startColIndex].className;vd[i][j].setAttribute("aria-describedby",c[j+this._startColIndex].getAttribute("aria-describedby"));vd[i][j].setAttribute("aria-readonly",c[j+this._startColIndex].getAttribute("aria-readonly"))}iRow=this._startRowIndex+i;tr=vd[i][0].parentNode;tr.className=i%2===0&&this.options.alternateRowStyles?"ui-iggrid-virtualrow ui-ig-altrecord":"ui-iggrid-virtualrow";if(data[iRow]){if(!_aNull(key)){tr.setAttribute("data-id",this._kval_from_key(key,data[iRow]))}else if(!_aNull(data[iRow].ig_pk)){tr.setAttribute("data-id",data[iRow].ig_pk)}}}}else if(isFixed){trs=this.fixedBodyContainer().find("tbody tr");for(i=0;i<this._virtualRowCount&&i<this._totalRowCount&&this._startRowIndex+i<data.length;i++){iRow=this._startRowIndex+i;tr=trs.eq(i)[0];if(_aNull(tr)){continue}tr.className=i%2===0&&this.options.alternateRowStyles?"ui-iggrid-virtualrow ui-ig-altrecord":"ui-iggrid-virtualrow";if(data[iRow]){if(!_aNull(key)){tr.setAttribute("data-id",this._kval_from_key(key,data[iRow]))}else if(!_aNull(data[iRow].ig_pk)){tr.setAttribute("data-id",data[iRow].ig_pk)}}}}if(this._isHorizontal){this._isHorizontal=false;if((this.options.virtualization===true||this.options.columnVirtualization===true)&&parseInt(this.options.width,10)>0){if(!this._vheaders){this._vheaders=this.headersTable().find("thead > tr > th > span.ui-iggrid-headertext")}for(i=0;i<visibleCols.length;i++){col=visibleCols[i];if(col.headerCssClass){this.headersTable().find("th."+col.headerCssClass).removeClass(col.headerCssClass)}}for(j=0;j<this._virtualColumnCount;j++){headerText=visibleCols[j+this._startColIndex].headerText;vheaderNode=$(this._vheaders[j]);vheaderNode.closest("th").attr("id",this.element[0].id+"_"+visibleCols[j+this._startColIndex].key);vheaderNode.parent().addClass(visibleCols[j+this._startColIndex].headerCssClass||"");vheaderNode.html(headerText)}}}},_updateVirtColCounters:function(isFixed){var visibleColsLength=this._visibleColumns(isFixed).length;if(this.options.columns){this._totalColumnCount=visibleColsLength;this._maxVirtualColumnCount=this.options.columns.length}else{this._totalColumnCount=this.dataSource.dataView()[0].length;this._maxVirtualColumnCount=this._totalColumnCount}if(this.options.columnVirtualization===false&&this.options.virtualization===false){this._virtualColumnCount=visibleColsLength}else{if(this.options.width===null){this._virtualColumnCount=this._totalColumnCount}else{this._virtualColumnCount=Math.ceil(parseInt(this.options.width,10)/this._avgColumnWidth());this._maxVirtualColumnCount=Math.min(this._maxVirtualColumnCount,this._virtualColumnCount);this._virtualColumnCount=Math.min(this._totalColumnCount,this._virtualColumnCount);this._vhorizontalcontainer().children().first().css("width",this._calculateContainerWidth(false))}}},_getVirtualDom:function(isFixed){if(!isFixed){return this._virtualDom}return this._fixedVirtualDom},_resetVirtualDom:function(){this._virtualDom=null;this._fixedVirtualDom=null},_buildVirtualDom:function(){var fixed,trs,fixedTrs;if(this.hasFixedColumns()){fixedTrs=this._buildVirtualDomInternal(true);fixed=false}trs=this._buildVirtualDomInternal(fixed);this._trigger("virtualdombuilt",null,{rows:trs,fixedRows:fixedTrs})},_buildVirtualDomInternal:function(isFixed){var grid=this,markup="",row,i,j,dataLinkFn,shouldHide=false,$tbody,visibleCols=this._visibleColumns(isFixed),key=this.options.primaryKey,data=this.dataSource.dataView(),temp,vd=this._getVirtualDom(isFixed),startIndex=0;if(this._startRowIndex===undefined||this._startRowIndex===null){this._startRowIndex=0;this._startColIndex=0}vd=[];if(!isFixed){this._virtualDom=vd}else{this._fixedVirtualDom=vd}this._totalRowCount=data.length;if(this.options.height===null){this._virtualRowCount=this._totalRowCount}else{if(this.options.height.indexOf&&this.options.height.indexOf("%")!==-1){this._virtualRowCount=Math.ceil(this._vdisplaycontainer().innerHeight()/parseInt(this.options.avgRowHeight,10),10)}else{this._virtualRowCount=Math.ceil(this._vdisplaycontainer().innerHeight()/parseInt(this.options.avgRowHeight,10),10)}}this._updateVirtColCounters(isFixed);if(this.options.height!==null){this._setScrollContainerHeight(this._totalRowCount*parseInt(this.options.avgRowHeight,10))}dataLinkFn=function(row,i,vc){for(j=0;j<vc;j++){if(j<grid._totalColumnCount){vd[i][j]=row[0].cells[j]}}};if(this._persistVirtualScrollTop){if(this._startRowIndex>this.dataSource.dataView().length-this._virtualRowCount){if(this.dataSource.dataView().length-this._virtualRowCount>0){this._startRowIndex=this.dataSource.dataView().length-this._virtualRowCount}else{this._startRowIndex=0}}startIndex=this._startRowIndex}this.element.children("tbody").empty();if(isFixed){$tbody=this.fixedBodyContainer().find("tbody")}else{$tbody=this.element.children("tbody")}$tbody.empty();for(i=0;i<this._virtualRowCount;i++){shouldHide=false;vd[i]=[];markup="";for(j=this._startColIndex;j<this._virtualColumnCount+this._startColIndex;j++){if(j>=this._totalColumnCount){break}markup+='<td role="gridcell" aria-readonly="'+!!visibleCols[j].readOnly+'" aria-describedby="'+this.id()+"_"+visibleCols[j].key+'" tabindex="'+this.options.tabIndex+'"';if(!data[startIndex+i]){shouldHide=true;markup+="></td>"}else{if(this.options.autoFormat!==false){if(visibleCols[j].template&&visibleCols[j].template.length){temp=this._renderTemplatedCell(data[startIndex+i],visibleCols[j]);if(temp.indexOf("<td")===0){markup+=temp.substring(3)}else{markup+=">"+temp}markup=grid._editCellStyle(markup,data[startIndex+i],visibleCols[j].key||j)}else{markup+=grid._addCellStyle(data[startIndex+i],visibleCols[j].key||j,visibleCols[j])+">"+this._renderCell(data[startIndex+i][visibleCols[j].key],visibleCols[j],data[startIndex+i])}}else{markup+=grid._addCellStyle(data[startIndex+i],visibleCols[j].key,visibleCols[j])+">"+data[i][visibleCols[j].key]}markup+="</td>"}}row=$("<tr>"+markup+"</tr>").appendTo($tbody);if(shouldHide){row.css("visibility","hidden")}if(i%2===0&&this.options.alternateRowStyles){row.addClass("ui-ig-altrecord")}row.addClass("ui-iggrid-virtualrow");if(i%2===0&&this.options.alternateRowStyles){row.addClass("ui-ig-altrecord")}row.attr("role","row");row.attr("tabindex",this.options.tabIndex);if(data[i+startIndex]){if(!_aNull(key)){row.attr("data-id",this._kval_from_key(key,data[i+startIndex]))}else if(!_aNull(data[i+startIndex].ig_pk)){row.attr("data-id",data[i+startIndex].ig_pk)}}dataLinkFn(row,i,this._virtualColumnCount);if(i===data.length-1){break}}this._updateVirtualScrollContainer();return $tbody.children("tr")},_adjustVirtualHeights:function(){var c=this._vdisplaycontainer(),tbody=c.find("tbody"),h=tbody.children().first().height();if(this.options.height===null){return}if(this.options.avgRowHeight!==h){this.options.avgRowHeight=h;this._buildVirtualDom()}},_verticalScroller:function(){if(!this._verticalScrollerObj||this._verticalScrollerObj.length===0){this._verticalScrollerObj=this._scrollContainer().children().first()}return this._verticalScrollerObj},_hscrollbar:function(){return this.container().find("#"+this.id()+"_hscroller_container")},_hscrollbarcontent:function(){return this.container().find("#"+this.id()+"_hscroller")},_hscrollbarinner:function(){return this.container().find("#"+this.id()+"_hscroller_inner")},_avgColumnWidth:function(){var width=0,cols=this.options.columns,count=cols.length,def=this.options.defaultColumnWidth,i;if(this.options.avgColumnWidth!==null){return parseInt(this.options.avgColumnWidth,10)}for(i=0;i<count;i++){width+=parseInt(cols[i].width,10)}if((count===0||isNaN(width))&&def){return parseInt(def,10)}if(count>0&&this.options.autoGenerateColumns&&isNaN(width)){if(this.options.width===null||this.options.width===undefined){throw new Error($.ig.Grid.locale.columnVirtualizationRequiresWidth)}return parseInt(this.options.width,10)/count}if(width===0||width<def){return def}if(isNaN(width)){width=100}return width/count},_registerScrllCntnrToSync:function($container){var name=$container.data("containerName");this._scrllCntrsToSync=this._scrllCntrsToSync||{};this._scrllCntrsToSync[name]=$container},_syncScrollLeft:function(scrLeft,ignoreContainer){var name,$container,containers=this._scrllCntrsToSync;for(name in containers){if(containers.hasOwnProperty(name)){if(name===ignoreContainer){continue}$container=containers[name];$container.scrollLeft(scrLeft)}}},_onScrollContainer:function(event){var $container=$(event.target),containerName,$hScrollBar,scrLeft=$container.scrollLeft();if(scrLeft!==this._scrollLeft){containerName=$container.data("containerName");this._syncScrollLeft(scrLeft,containerName);if($.ig.util.isIE&&containerName!=="hScrollbar"&&containerName!=="vScrollbar"){$hScrollBar=this._scrllCntrsToSync.vScrollbar||this._scrllCntrsToSync.hScrollbar;if($hScrollBar&&$hScrollBar.scrollLeft()!==scrLeft){this._synchronizeHScroll();return}}this._scrollLeft=scrLeft}},_renderCaption:function(){var colgroup,caption,tbl,scrollc;if(this.options.caption!==null){if(this.container().find(".ui-iggrid-headercaption").length>0){return}if(this.options.fixedHeaders===true&&this.options.showHeader===true){colgroup=this.headersTable().children("colgroup").first();if(colgroup.length===0){caption=$("<caption></caption>").prependTo(this.headersTable())}else{caption=$("<caption></caption>").insertAfter(colgroup)}caption.text(this.options.caption).attr("id",this.id()+"_caption").addClass(this.css.gridHeaderCaptionClass)}else{scrollc=this.scrollContainer();if(scrollc.length===0){tbl=$("<table></table>").prependTo(this.container())}else{tbl=$("<table></table>").insertBefore(scrollc)}caption=$("<caption></caption>").appendTo(tbl.css("width","100%").addClass(this.css.captionTable)).text(this.options.caption).attr("id",this.id()+"_caption").addClass(this.css.gridHeaderCaptionClass)}caption.parent().css("margin",0)}},_renderFixedCaption:function(){var colgroup,caption;if(this.options.caption!==null){if(this.options.fixedHeaders===true&&this.options.showHeader===true){colgroup=this.fixedHeadersTable().children("colgroup").first();if(colgroup.length===0){caption=$("<caption></caption>").prependTo(this.fixedHeadersTable())}else{caption=$("<caption></caption>").insertAfter(colgroup)}caption.text(this.options.caption).attr("id",this.id()+"_caption_fixed").addClass(this.css.gridHeaderCaptionClass)}caption.parent().css("margin",0)}},_createHeaderColumnMarkup:function(column,index){var headerClass=this.css.headerClass,customClass=column.headerCssClass?column.headerCssClass:"",headerText=$("<span>"+column.headerText+"</span>").addClass(this.css.headerTextClass),markup="<th></th>";return $(markup).append(headerText).attr({id:this.id()+"_"+column.key,role:"columnheader","aria-label":column.headerText,tabIndex:this.options.tabIndex}).addClass(headerClass).addClass(customClass).data("columnIndex",index)},_updateHeaderColumnIndexes:function(){var grid=this,cols=this.options.columns;if(this.options.virtualization===true&&this.options.virtualizationMode==="fixed"||this.options.columnVirtualization===true){cols=cols.slice(0,this._maxVirtualColumnCount)}grid._initialHiddenCells=[];$(cols).each(function(i){grid.container().find("#"+grid.id()+"_"+this.key).data("columnIndex",i)})},_renderHeaderColumns:function(header){var grid=this,cols=this.options.columns;if(this.options.virtualization===true&&this.options.virtualizationMode==="fixed"||this.options.columnVirtualization===true){cols=cols.slice(0,this._maxVirtualColumnCount)}grid._initialHiddenCells=[];$(cols).each(function(i){var headerCell,key=this.key;if(key){headerCell=grid._createHeaderColumnMarkup(this,i);header.append(headerCell);grid._trigger(grid.events.headerCellRendered,null,{owner:grid,th:headerCell,columnKey:this.key});$.each(grid._initialHiddenColumns,function(){if(this.key===key){grid._initialHiddenCells.push(headerCell);headerCell.css("display","none");return false}})}})},renderMultiColumnHeader:function(cols){var topmostGrid,layout;this._origSum=0;this.options.columns=cols;this.destroy(true);this._initialized=false;this.options.requiresDataBinding=true;this._renderHeaderCalled=false;if(this._isHierarchicalGrid){topmostGrid=this.element.closest(".ui-iggrid-root").data("igHierarchicalGrid");if(topmostGrid){if(topmostGrid.element[0].id!==this.element[0].id&&this.options.key){layout=topmostGrid._findLayout(topmostGrid.options.columnLayouts,this.options.key);layout.columns=cols;topmostGrid._setOption("columnLayouts",topmostGrid.options.columnLayouts);topmostGrid._create();return}topmostGrid._regevents(topmostGrid.element,topmostGrid)}}this._create()},_renderHeader:function(){var w,header,id,headerDom,headerMarkup="",scrollc=this.scrollContainer(),noCancel=true,fHeader=false,headerParent=this.element[0],width,headerScrollDiv,existingHeader,o=this.options,v=o.virtualization===true||o.rowVirtualization===true||o.columnVirtualization===true;this._renderHeaderCalled=true;if(this.options.showHeader){noCancel=this._trigger(this.events.headerRendering,null,{owner:this});if(noCancel){this._rmvClgrpOnInitRenderData=true;id=this.id();headerMarkup="<thead role='rowgroup'><tr data-header-row role='row'></tr></thead>";headerParent=this.container();width=scrollc.css("width");if(this.options.fixedHeaders&&this.options.height!==null){if(v===false){if(headerParent.length===0){scrollc.removeClass(this.css.gridClasses).removeClass(this.css.baseClasses).css("width","").wrap("<div id='"+id+"_container'></div>");headerParent=this.container().addClass(this.css.baseClasses).addClass(this.css.gridClasses).css("width",width);this._isWrapped=true}}else{width=this.element.parents(".ui-widget").css("width");headerParent=this.container().find("#"+id+"_headers_v");if(o.width!==null){w=o.width;if(w.indexOf&&w.indexOf("%")!==-1){w="100%"}headerParent.css("width",w).css("max-width",w).css("overflow-x","hidden")}}headerParent=$("<table id='"+id+"_headers'></table>").prependTo(headerParent).addClass(this.css.gridHeaderTableClass).attr("cellpadding",0).attr("cellspacing",0).attr("border","0");if(v===false){headerScrollDiv=$("<div></div>").prependTo(headerParent.parent());headerScrollDiv.css("overflow","hidden").css("position","relative").css("white-space","nowrap");headerScrollDiv.addClass("ui-widget-header ui-helper-reset");headerScrollDiv.append(headerParent)}else if(this.options.rowVirtualization===true){headerParent.addClass("ui-widget-header ui-helper-reset")}this.headersTable().parent().data("containerName","headerContainer").bind("scroll.syncScrollContainers",$.proxy(this._onScrollContainer,this));this._registerScrllCntnrToSync(this.headersTable().parent());fHeader=true;this._rmvClgrpOnInitRenderData=false}else if(this.options.fixedHeaders!==true){headerParent=this.element}if(this.options.width===null&&this.options.height===null){headerParent=this.element}if(this.options.width!==null&&this.options.height===null){this._fixScrollY=1;scrollc.css("overflow-y","hidden").css("overflow-x","auto");headerParent=this.element}if(!headerParent.find("colgroup").length){this._renderColgroup(headerParent,fHeader,false,this.options.autofitLastColumn)}if(this._isMultiColumnGrid===true){this._headerParent=headerParent;this._fireInternalEvent("_renderingMultiColumnHeader");if(this.options.virtualization===true||this.options.rowVirtualization===true){this.container().find("#"+id+"_headers_v").css("position","relative").addClass("ui-widget-header ui-helper-reset").addClass(this.css.baseClasses);headerParent.addClass(this.css.gridHeaderTableClass).attr("cellpadding",0).attr("cellspacing",0).attr("border","0")}}else{if(this.options.headerTemplate===null||this.options.headerTemplate===undefined){if(this.options.virtualization===true||this.options.rowVirtualization===true){this.container().find("#"+id+"_headers_v").css("position","relative").addClass("ui-widget-header ui-helper-reset").addClass(this.css.baseClasses);headerParent.addClass(this.css.gridHeaderTableClass).attr("cellpadding",0).attr("cellspacing",0).attr("border","0")}this.element.find(">thead").remove();existingHeader=headerParent.find(">thead");if(existingHeader.length===0){header=$(headerMarkup).appendTo(headerParent).children().first()}else{existingHeader.empty();header=$('<tr data-header-row role="row"></tr>').appendTo(existingHeader)}this._renderHeaderColumns(header)}else{headerDom=this.options.headerTemplate;if(this.options.virtualization===true||this.options.rowVirtualization===true){$(headerDom).children().each(function(){this.appendTo(this.container().find("#"+id+"_headers"))});header=this.headersTable().addClass(this.css.gridClasses)}else{header=$(headerMarkup).appendTo(headerParent).append(headerDom)}}this._headerParent=headerParent;this._trigger(this.events.headerRendered,null,{owner:this,table:this.headersTable()});this._headerRenderCancel=false}}else{this._headerRenderCancel=true}}this._trigger("headerRenderedInternal",null,{owner:this,table:this.headersTable()})},_renderFooter:function(){var gridId=this.id(),w,o=this.options,elemParent,footerId=gridId+"_footer_container",footerMarkup='<tfoot role="rowgroup" class="'+this.css.gridFooterClass+'"></tfoot>',$footer=this.container().find("#"+footerId),$table,width,noCancel,tableGrid=this.element,$tableGridContainer;if(tableGrid.length===0){return}if($footer.length===0&&o.showFooter){noCancel=this._trigger(this.events.footerRendering,null,{owner:this});if(noCancel){if((o.virtualization===true||o.rowVirtualization===true||o.columnVirtualization===true)&&(o.height!==null&&o.height!==undefined||o.width!==null&&o.width!==undefined)){$tableGridContainer=this._vdisplaycontainer();this.options.fixedFooters=true;w=o.width;if(w&&w.indexOf&&w.indexOf("%")!==-1){w="100%"}$tableGridContainer=$('<tr><td colspan="2" style="border-width: 0px;"></td></tr>').insertAfter($tableGridContainer.closest("tr"));$footer=$("<div></div>").attr("id",footerId).css({overflow:"hidden",position:"relative"}).addClass("ui-widget-footer").addClass(this.css.footerContainer).width(w).appendTo($tableGridContainer.find("td"));$table=$("<table></table>").attr("cellpadding",0).attr("cellspacing",0).attr("border",0).appendTo($footer).addClass(this.css.gridFooterTableClass).width(w).attr("id",gridId+"_footers");this._renderColgroup($table,false,true,this.options.autofitLastColumn);$(footerMarkup).appendTo($table);if(this.options.showFooter&&this.options.fixedFooters===true&&this.options.height!==null){elemParent=this.element.parents(".ui-widget:first");if(elemParent.length===1&&elemParent[0].style){width=elemParent[0].style.width;if(width&&(!width.indexOf||width.indexOf("%")===-1)){$footer.css("width",width)}}}if(o.expandColWidth&&!o.width){$footer.css("width",parseInt($footer.width(),10)+o.expandColWidth+"px")}}else if(o.fixedFooters===true&&o.height!==null){if(o.width!==null){$tableGridContainer=this._hscrollbar()}else{$tableGridContainer=this.scrollContainer()}if($tableGridContainer.length===0){$tableGridContainer=tableGrid}$footer=$("<div></div>").attr("id",footerId).css({overflow:"hidden",position:"relative","white-space":"nowrap"}).addClass(this.css.footerContainer).addClass("ui-widget-footer").insertAfter($tableGridContainer);$table=$("<table></table>").attr("cellpadding",0).attr("cellspacing",0).attr("border",0).appendTo($footer).addClass(this.css.gridFooterTableClass).attr("id",gridId+"_footers");this._renderColgroup($table,false,true,this.options.autofitLastColumn);$(footerMarkup).appendTo($table)}else{$tableGridContainer=tableGrid;$footer=$(footerMarkup).attr("id",footerId).insertAfter($tableGridContainer.find("tbody:eq(0)"))}$footer.data("containerName","footerContainer").bind("scroll.syncScrollContainers",$.proxy(this._onScrollContainer,this));this._registerScrllCntnrToSync($footer);$footer.css("display","none");this._footer=$footer;this._footerParent=$table;this._trigger(this.events.footerRendered,null,{owner:this,table:this.footersTable()})}}return $footer},_renderRecord:function(data,rowIndex,isFixed){var key=this.options.primaryKey,grid=this,dstr="",cols=this.options.columns,noVisibleColumns,temp;dstr+="<tr";if(rowIndex%2!==0&&this.options.alternateRowStyles){dstr+=' class="'+grid.css.recordAltClass+'"'}if(!_aNull(key)){dstr+=' data-id="'+this._kval_from_key(key,data)+'"'}else if(!_aNull(data.ig_pk)){dstr+=' data-id="'+data.ig_pk+'"'}if(this.options.virtualization&&this.options.virtualizationMode==="continuous"){dstr+=' data-row-idx="'+rowIndex+'"'}dstr+=' role="row" tabindex="'+this.options.tabIndex+'">';noVisibleColumns=true;$(cols).each(function(colIndex){var col=cols[colIndex];if(col.hidden||col.fixed===true&&!isFixed||col.fixed!==true&&isFixed){return}noVisibleColumns=false;dstr+='<td role="gridcell" aria-readonly="'+!!this.readOnly+'" aria-describedby="'+grid.id()+"_"+this.key+'" tabindex="'+grid.options.tabIndex+'"';if(col.template&&col.template.length){temp=grid._renderTemplatedCell(data,this);if(temp.indexOf("<td")===0){dstr+=temp.substring(3)}else{dstr+=">"+temp}dstr=grid._editCellStyle(dstr,data,this.key)}else{dstr+=grid._addCellStyle(data,this.key||colIndex,col)+">"+grid._renderCell(data[this.key||colIndex],this,data)}dstr+="</td>"});if(noVisibleColumns){dstr+='<td role="gridcell"></td>'}dstr+="</tr>";return dstr},_editCellStyle:function(dstr,data,col,isFixed){var lastCellIdx,lastCellClose,lastCellClass,start,end,nc="",i;if(!this._cellStyleSubscribers||this._cellStyleSubscribers.length===0){return dstr}for(i=0;i<this._cellStyleSubscribers.length;i++){nc+=this._cellStyleSubscribers[i](data,col,isFixed)+" "}nc=nc.trim();if(nc.length===0){return dstr}lastCellIdx=dstr.lastIndexOf("<td");lastCellClose=dstr.indexOf(">",lastCellIdx);if(lastCellClose>0){lastCellClass=dstr.substring(lastCellIdx,lastCellClose).indexOf("class");if(lastCellClass>0){lastCellClass+=lastCellIdx}}else{lastCellClass=dstr.indexOf("class",lastCellIdx)}if(lastCellClass>0){start=dstr.substring(0,lastCellClass+7);end=dstr.substring(lastCellClass+7);dstr=start+nc+" "+end}else{start=dstr.substring(0,lastCellIdx+3);end=dstr.substring(lastCellIdx+3);dstr=start+' class="'+nc+'"'+end}return dstr},_addCellStyle:function(data,colId,col,isFixed){var dstr="",i,hasSubs=this._cellStyleSubscribers&&this._cellStyleSubscribers.length,hasColClasses=col?col.columnCssClass:false;if(hasSubs){for(i=0;i<this._cellStyleSubscribers.length;i++){dstr+=this._cellStyleSubscribers[i](data,colId,isFixed)+" "}}if(hasColClasses){dstr+=col.columnCssClass}dstr=dstr.trim();return dstr.length>0?' class="'+dstr+'"':dstr},_getCellStyle:function(data,col,isFixed){var dstr="",i;if(!this._cellStyleSubscribers||this._cellStyleSubscribers.length===0){return dstr}for(i=0;i<this._cellStyleSubscribers.length;i++){dstr+=this._cellStyleSubscribers[i](data,col,isFixed)+" "}return dstr.trim()},_enableHeaderCellFeature:function(th){var $th;if($.type(th)==="string"){$th=this.container().find("#"+this.id()+"_"+th)}else{$th=th}$th.addClass(this.css.headerCellFeatureEnabledClass)},_renderRecordInArray:function(darr,tbody,data,rowIndex){var key=this.options.primaryKey,grid=this,appendBehavior=false,cols=this.options.columns,temp;if(darr===null){darr=[];appendBehavior=true}darr.push("<tr");if(rowIndex%2!==0&&this.options.alternateRowStyles){darr.push(' class="'+grid.css.recordAltClass+'"')}if(!_aNull(key)){darr.push(' data-id="'+this._kval_from_key(key,data)+'"')}else if(!_aNull(data.ig_pk)){darr.push(' data-id="'+data.ig_pk+'"')}darr.push(' role="row" tabindex="'+this.options.tabIndex+'">');$(cols).each(function(colIndex){if(cols[colIndex].hidden){return}darr.push('<td role="gridcell" aria-readonly='+!!this.readOnly+' aria-describedby="'+grid.id()+"_"+this.key+'" tabindex="'+grid.options.tabIndex+'"');if(data[this.key]===undefined){if(cols[colIndex].template&&cols[colIndex].template.length){temp=grid._renderTemplatedCell(data,this);if(temp.indexOf("<td")===0){darr[darr.length-1]=temp.replace("<td",darr[darr.length-1])}else{darr.push(">"+temp)}darr[darr.length-1]=grid._editCellStyle(darr[darr.length-1],data,colIndex)}else{darr.push(grid._addCellStyle(data,colIndex,cols[colIndex])+">"+grid._renderCell(data[colIndex],this,data))}darr.push("</td>")}else{if(cols[colIndex].template&&cols[colIndex].template.length){temp=grid._renderTemplatedCell(data,this);if(temp.indexOf("<td")===0){darr[darr.length-1]=temp.replace("<td",darr[darr.length-1])}else{darr.push(">"+temp)}darr[darr.length-2]=grid._editCellStyle(darr[darr.length-2],data,this.key)}else{darr.push(grid._addCellStyle(data,this.key,cols[colIndex])+">"+grid._renderCell(data[this.key],this,data))}darr.push("</td>")}});darr.push("</tr>");if(appendBehavior){tbody.append(darr.join(""))}},_fixDate:function(val,col){var d,i;if(!col||!val){return val}if(col.dataType==="date"&&!val.getTime){i=val.indexOf?val.indexOf("ate("):-1;if(i>0){d=val.substring(i+4);i=d.indexOf(")");if(i>0){d=parseInt(d.substring(0,i),10);if(!isNaN(d)){val=new Date(d)}}}}return val},_renderCell:function(val,col,record,displayStyle,returnObject){var type=col.dataType,format=col.format,o=this.options,auto=o.autoFormat;
val=this._fixDate(val,col);if(col.formatter){return col.formatter(val,record)}if(!format&&type==="bool"&&o.renderCheckboxes){format="checkbox"}if(format==="checkbox"&&type!=="bool"){format=null}type=type==="date"||type==="number"?type:"";if(format||(auto===true||auto==="dateandnumber")&&type||auto&&auto===type){return $.ig.formatter(val,type,format,true,o.enableUTCDates,displayStyle,col.headerText,this.options.tabIndex)}if(returnObject){return val}return val||val===0||val===false?val.toString():"&nbsp;"},_renderTemplatedCell:function(val,col){var v,d=$.extend({},val);if(val===undefined||val===null||val[col.key]===undefined){if(col.unbound===true){v="&nbsp;"}else{v=this._renderCell(val,col,val,null,true)}}else{v=this._renderCell(val[col.key],col,val,null,true)}d[col.key]=v;return this._tmplWrappers[this.id()+"_"+col.key](d,this._jsrnd?undefined:col.template)},_defaultTemplateFunc:function(d,tmpl){return $.ig.tmpl(tmpl,d)},_setTemplateDefinition:function(jsrnd){var i,key;for(i=0;i<this.options.columns.length;i++){if(this.options.columns[i].template&&this.options.columns[i].template.length){key=this.id()+"_"+this.options.columns[i].key;if(jsrnd){$.templates(key,this.options.columns[i].template);this._jsrnd=true}else{this._tmplWrappers[key]=this._defaultTemplateFunc}}}},_scrollbarWidth:function(){if(this._scrollbarWidthResolved===null||this._scrollbarWidthResolved===undefined){var $parent,$div=$('<div id="'+this.id()+'_tmp"></div>').css({width:50,height:50,position:"absolute",top:-500,left:-500}).prependTo("body").append("<div></div>").find("div").css({height:100}),w1,w2;if(document.documentMode===7||$.ig.util.isIE7){w1=$div.innerWidth();$div.parent().css("overflow-y","scroll");w2=$div.innerWidth();this._scrollbarWidthResolved=w1-w2}else{$parent=$div.parent();$parent.css({overflow:"auto"});$div.css({width:"100%"});this._scrollbarWidthResolved=$parent.width()-$div.width()}$("#"+this.id()+"_tmp").remove()}return this._scrollbarWidthResolved},_fireInternalEvent:function(name,args){var i,f,featureName,feature;for(i=0;i<this.options.features.length;i++){f=this.options.features[i];if(f!==undefined&&f!==null&&f.name!==undefined){featureName="igGrid"+f.name;feature=this.element.data(featureName);if(feature!==null&&feature!==undefined&&feature[name]){if(args){feature[name](args)}else{feature[name]()}}}}},_initFeature:function(featureObject){if(!featureObject){return}if(featureObject.name===undefined){return}var widget="igGrid"+featureObject.name;if($.type(this.element[widget])!=="function"){throw new Error($.ig.Grid.locale.noSuchWidget.replace("{featureName}",widget))}if(this.element.data(widget)){this.element[widget]("destroy")}this.element[widget](featureObject);this.element.data(widget)._injectGrid(this)},_initFeatureSettings:function(featureObject){if(!featureObject){return}if(featureObject.name===undefined){return}var widget="igGrid"+featureObject.name;if($.type(this.element[widget])!=="function"){throw new Error($.ig.Grid.locale.noSuchWidget.replace("{featureName}",widget))}if(this.element.data(widget)){this.element.data(widget)._injectGrid(this,true)}},_onFeaturesSoftDirty:function(e,args){var i,feature;if(args.owner.options.type!=="remote"){return}for(i=0;i<this.options.features.length;i++){feature=this.element.data("igGrid"+this.options.features[i].name);if(feature&&feature!==args.owner&&feature.options&&feature.options.type==="local"){if(feature._onUIDirty&&$.type(feature._onUIDirty)==="function"){feature._onUIDirty(e,args)}}}},_kval_from_key:function(key,data){var k,k_val="",i;if(key.indexOf(",")!==-1){k=key.split(",");for(i=0;i<k.length;i++){k_val+=data[k[i]];if(i<k.length-1){k_val+=","}}}else{k_val=data[key]}return k_val},_rowId:function(rec,index){var key=this.options.primaryKey;key=key?this._kval_from_key(key,rec):null;if(!key){key=index;if(key!==0){key=this.rows().length-1}}return key},_inferOpType:function(){if(this.options.dataSourceUrl||this.dataSource.type()==="remoteUrl"){return"remote"}return"local"},_renderVirtualRecords:function(){var mode=this.options.virtualizationMode;if(mode===undefined||mode===""){mode="continuous"}if(mode==="fixed"||this.options.columnVirtualization===true){if(this._persistVirtualScrollTop){this._startRowIndex=Math.ceil(this._scrollContainer().scrollTop()/parseInt(this.options.avgRowHeight,10));if(this._startRowIndex>this.dataSource.dataView().length-this._virtualRowCount){if(this.dataSource.dataView().length-this._virtualRowCount>0){this._startRowIndex=this.dataSource.dataView().length-this._virtualRowCount}else{this._startRowIndex=0}}}this._renderVirtualRecordsFixed()}else if(mode==="continuous"){this._renderVirtualRecordsContinuous();this._trigger("virtualrecordsrender",null,{owner:this,dom:this._virtualDom})}},_getHScrollContainerInner:function(){var ret=this._hscrollbarinner();if(ret.length===0&&this.options.virtualizationMode==="continuous"){ret=this.container().find("#"+this.id()+"_horizontalScrollContainer div")}return ret},_getScrollContainerHeight:function(){return this._scrollContainer().children(":first-child").height()},_getDisplayContainerHeight:function(){return this._vdisplaycontainer().height()},_getDisplayContainerWidth:function(){return this._vdisplaycontainer().width()},_setDisplayContainerWidth:function(width){if(width===undefined){return}this._vdisplaycontainer().css("max-width",width);this._vdisplaycontainer().width(width)},_getVHeadersWidth:function(){return this.container().find("#"+this.id()+"_headers_v").width()},_setVHeadersWidth:function(width){if(width===undefined){return}this.container().find("#"+this.id()+"_headers_v").width(width)},_setScrollContainerHeight:function(height){var sc=this._scrollContainer();if(height===undefined){return}sc.children(":first-child").height(height)},_setScrollContainerScrollTop:function(top){if(top===undefined){return}this._scrollContainer().scrollTop(top)},_getScrollContainerScrollTop:function(){return this._scrollContainer().scrollTop()},_setDisplayContainerScrollTop:function(top){if(top===undefined){return}this._vdisplaycontainer().scrollTop(top)},_getDisplayContainerScrollTop:function(){return this._vdisplaycontainer().scrollTop()},_setDisplayContainerScrollLeft:function(left){if(left===undefined){return}this._vdisplaycontainer().scrollLeft(left)},_getDisplayContainerScrollLeft:function(){return this._vdisplaycontainer().scrollLeft()},_calculateAvgRowHeight:function(){var rowHeightSum=this.container().find("#"+this.id()+" > tbody").height();if(rowHeightSum===0){rowHeightSum=parseInt(this.options.height,10)}if(this.options.virtualizationMode==="fixed"){if(this._fixedAvgRowHeight){return this._fixedAvgRowHeight}this._fixedAvgRowHeight=rowHeightSum/this._virtualRowCount}return rowHeightSum/this._virtualRowCount},_getDisplayContainerVisibleArea:function(){var scrollTop=this._getDisplayContainerScrollTop(),height=this._getDisplayContainerHeight();return{top:scrollTop,bottom:scrollTop+height}},virtualScrollTo:function(scrollerPosition){var avgRowHeight,$scrollContainer=this._scrollContainer(),pos=parseInt(scrollerPosition,10);if($.type(scrollerPosition)!=="string"){if(this.options.virtualizationMode==="fixed"){avgRowHeight=parseInt(this.options.avgRowHeight,10)}else{if(this._avgRowHeight){avgRowHeight=this._avgRowHeight}else{avgRowHeight=this._calculateAvgRowHeight()}}scrollerPosition--;pos=avgRowHeight*scrollerPosition;pos=Math.ceil(pos);this._virtualScrollToIndex=scrollerPosition}$scrollContainer.scrollTop(pos)},_virtualScrollToInternal:function(virtualScrollerY){var tableId,firstRow,lastRow,scrollData,scrollResult;if(virtualScrollerY===this._oldScrollTop){return}tableId="#"+this.id();firstRow=this.container().find(tableId+" > tbody > tr:not([data-container]):visible:first");lastRow=this.container().find(tableId+" > tbody > tr:not([data-container]):visible:last");if(firstRow.length===0||lastRow.length===0){return}scrollData={virtualScrollerY:this._getScrollContainerScrollTop(),deltaScroll:virtualScrollerY-this._oldScrollTop,firstRow:firstRow,lastRow:lastRow,firstRowDataIndex:parseInt(firstRow.attr("data-row-idx"),0),lastRowDataIndex:parseInt(lastRow.attr("data-row-idx"),0),visibleArea:this._getDisplayContainerVisibleArea()};scrollResult={action:"SA_INITIAL"};if(!this._tryScroll(scrollData,scrollResult)){this._rebuildVirtualRows(scrollData,scrollResult)}this._correctScrollPosition(this._getTotalRowsCount())},_getTotalRowsCount:function(){return this._getDataView().length},_tryScroll:function(scrollData,scrollResult){var deltaScroll,firstRow,lastRow,displayContainerHeight,displayContainerScrollTop;if(scrollResult===undefined){throw new Error("scrollResult parameter should be provided")}deltaScroll=scrollData.deltaScroll;firstRow=scrollData.firstRow;lastRow=scrollData.lastRow;displayContainerHeight=this._getDisplayContainerHeight();displayContainerScrollTop=this._getDisplayContainerScrollTop();if(deltaScroll>0){if(lastRow[0].offsetTop+lastRow.outerHeight()>=displayContainerScrollTop+deltaScroll+displayContainerHeight||isNaN(scrollData.lastRowDataIndex)||scrollData.lastRowDataIndex>=this._getLastVisibleDataRecordIndex()){this._setDisplayContainerScrollTop(displayContainerScrollTop+deltaScroll);scrollResult.action="SA_SUCCESSFUL";return true}if(deltaScroll<=this._avgRowHeight*this._virtualRowCount){if(deltaScroll+displayContainerHeight>this._avgRowHeight*this._virtualRowCount){scrollResult.action="SA_NEED_SOME_PAGE";return false}scrollResult.action="SA_NEED_NEXT_PAGE";return false}}if(deltaScroll<0){if(firstRow[0].offsetTop<=displayContainerScrollTop+deltaScroll||scrollData.firstRowDataIndex===0){this._setDisplayContainerScrollTop(displayContainerScrollTop+deltaScroll);scrollResult.action="SA_SUCCESSFUL";return true}if(Math.abs(deltaScroll)<=this._avgRowHeight*this._virtualRowCount){scrollResult.action="SA_NEED_PREV_PAGE";return false}}scrollResult.action="SA_NEED_SOME_PAGE";return false},_getDataView:function(){return this.dataSource.dataView()},_rebuildVirtualRows:function(scrollData,scrollResult){var noCancel,virtualScrollerY,deltaScroll,tableId,visibleArea,tbody,expandedRowsHeight,trs,i,scrollerHeight,firstVisibleTR,firstVisibleTRRelativeOffset,startIndexToBeLoaded,newFirstVisibleRow,displayContainerScrollTop,maxScrollPos,avgRowHeight,tr,lastVisibleTR,lastVisibleTRIndex,firstVisibleTRIndex,endIndexToBeLoaded,dataRowIndexToBeFirst,hasOverflow;noCancel=this._trigger("rebuildingvirtualrows",null,{owner:this,scrollData:scrollData,scrollResult:scrollResult});if(noCancel===false){return}virtualScrollerY=scrollData.virtualScrollerY;deltaScroll=scrollData.deltaScroll;tableId="#"+this.id();visibleArea=scrollData.visibleArea;tbody=this.container().find(tableId+" > tbody");expandedRowsHeight=0;trs=this.container().find(tableId+" > tbody > tr[data-container='true']");for(i=0;i<trs.length;i++){expandedRowsHeight+=$(trs[i]).outerHeight()}if(expandedRowsHeight>0){scrollerHeight=this._getScrollContainerHeight();this._setScrollContainerHeight(scrollerHeight-expandedRowsHeight)}if(deltaScroll>0&&scrollResult.action==="SA_NEED_NEXT_PAGE"){firstVisibleTR=this._getFirstVisibleTR(visibleArea);firstVisibleTRRelativeOffset=Math.abs(firstVisibleTR[0].offsetTop-visibleArea.top);startIndexToBeLoaded=parseInt(firstVisibleTR.attr("data-row-idx"),0);dataRowIndexToBeFirst=startIndexToBeLoaded;endIndexToBeLoaded=parseInt(this._virtualRowCount,0)+startIndexToBeLoaded-1;hasOverflow=false;if(endIndexToBeLoaded>this._getDataView().length-1){endIndexToBeLoaded=this._getDataView().length-1;startIndexToBeLoaded=endIndexToBeLoaded-this._virtualRowCount+1;hasOverflow=true}tbody.empty();this._startRowIndex=startIndexToBeLoaded;this._startColIndex=0;this._renderRecords(startIndexToBeLoaded,endIndexToBeLoaded);if(hasOverflow){tr=this.container().find(tableId+" > tbody > tr[data-row-idx='"+dataRowIndexToBeFirst+"']");firstVisibleTRRelativeOffset=tr[0].offsetTop+firstVisibleTRRelativeOffset}this._setDisplayContainerScrollTop(firstVisibleTRRelativeOffset+deltaScroll)}if(deltaScroll<0&&scrollResult.action==="SA_NEED_PREV_PAGE"){lastVisibleTR=this._getLastVisibleTR(visibleArea);lastVisibleTRIndex=parseInt(lastVisibleTR.attr("data-row-idx"),0);firstVisibleTR=this._getFirstVisibleTR(visibleArea);firstVisibleTRIndex=parseInt(firstVisibleTR.attr("data-row-idx"),0);endIndexToBeLoaded=lastVisibleTRIndex;startIndexToBeLoaded=endIndexToBeLoaded-parseInt(this._virtualRowCount,0)+1;if(startIndexToBeLoaded<0){startIndexToBeLoaded=0;endIndexToBeLoaded=startIndexToBeLoaded+this._virtualRowCount-1}tbody.empty();this._startRowIndex=startIndexToBeLoaded;this._renderRecords(startIndexToBeLoaded,endIndexToBeLoaded);tableId="#"+this.id();newFirstVisibleRow=this.container().find(tableId+' > tbody > tr[data-row-idx="'+firstVisibleTRIndex+'"]');this._setDisplayContainerScrollTop(newFirstVisibleRow[0].offsetTop+deltaScroll)}if(scrollResult.action==="SA_NEED_SOME_PAGE"){startIndexToBeLoaded=Math.floor(virtualScrollerY/this._avgRowHeight);endIndexToBeLoaded=startIndexToBeLoaded+this._virtualRowCount-1;if(startIndexToBeLoaded<0){startIndexToBeLoaded=0;endIndexToBeLoaded=startIndexToBeLoaded+this._virtualRowCount-1}if(endIndexToBeLoaded>=this._getDataView().length-1){endIndexToBeLoaded=this._getDataView().length-1;startIndexToBeLoaded=endIndexToBeLoaded-this._virtualRowCount+1}tbody.empty();this._startRowIndex=startIndexToBeLoaded;this._renderRecords(startIndexToBeLoaded,endIndexToBeLoaded);displayContainerScrollTop=0;maxScrollPos=this._getScrollContainerHeight()-this._getDisplayContainerHeight();if(maxScrollPos-3<=virtualScrollerY&&virtualScrollerY<=maxScrollPos+3){displayContainerScrollTop=1e4}if(!this._persistVirtualScrollTop){this._setDisplayContainerScrollTop(displayContainerScrollTop)}}avgRowHeight=this._calculateAvgRowHeight();if(avgRowHeight>this._avgRowHeight){this._avgRowHeight=avgRowHeight}this._trigger("virtualrecordsrender",null,{owner:this,tbody:tbody,dom:this._virtualDom})},_correctScrollPosition:function(totalRowCount){var scrollTop,maxScrollPos,tableId,firstRow,firstRowDataIndex,lastRow,lastRowDataIndex,visibleArea,tbody,rowsLeft,displayContainerScrollTop,targetRow,delta;scrollTop=this._getScrollContainerScrollTop();maxScrollPos=this._getScrollContainerHeight()-this._getDisplayContainerHeight();tableId="#"+this.id();firstRow=this.container().find(tableId+" > tbody > tr:first");firstRowDataIndex=parseInt(firstRow.attr("data-row-idx"),0);lastRow=this.container().find(tableId+" > tbody > tr:last");lastRowDataIndex=parseInt(lastRow.attr("data-row-idx"),0);visibleArea=this._getDisplayContainerVisibleArea();tbody=this.container().find(tableId+" > tbody");if(scrollTop===0){if(visibleArea.top>0){this._scrollTo(visibleArea.top,true)}else if(firstRowDataIndex>0){this._scrollTo(firstRowDataIndex*this._avgRowHeight,true)}}else if(scrollTop>=maxScrollPos-3&&scrollTop<=maxScrollPos+3){if(visibleArea.bottom<tbody.height()&&lastRowDataIndex===totalRowCount-1){this._scrollTo(this._getScrollContainerScrollTop()-(tbody.height()-visibleArea.bottom),true)}else if(lastRowDataIndex<totalRowCount-1){rowsLeft=totalRowCount-lastRowDataIndex;this._setScrollContainerHeight(this._getScrollContainerHeight()+rowsLeft*this._avgRowHeight)}}displayContainerScrollTop=this._getDisplayContainerScrollTop();if(displayContainerScrollTop===0&&firstRowDataIndex===0&&this._getScrollContainerScrollTop()!==0){if(!this._persistVirtualScrollTop){this._setScrollContainerHeight(this._totalRowCount*this._avgRowHeight);this._scrollTo(this._getScrollContainerScrollTop(),false)}else{this._scrollTo(0,true)}}if(displayContainerScrollTop===tbody.height()-this._getDisplayContainerHeight()&&lastRowDataIndex===totalRowCount-1){this._scrollTo(this._getScrollContainerHeight(),true)}if(this._virtualScrollToIndex!==undefined&&this._virtualScrollToIndex!==null){targetRow=this.container().find(tableId+" > tbody > tr[data-row-idx="+this._virtualScrollToIndex+"]");delta=0;if(targetRow.length===1&&firstRowDataIndex!==this._virtualScrollToIndex){delta=targetRow.offset().top-firstRow.offset().top}this._virtualScrollToIndex=null;if(delta>0){this._vdisplaycontainer().scrollTop(delta)}}},_scrollTo:function(scrollTop,suppressScrollEvent){if(suppressScrollEvent){this._suppressScroll=true}this._setScrollContainerScrollTop(scrollTop)},_getFirstVisibleTR:function(visibleArea){var tableId="#"+this.element[0].id,firstVisibleTR,visibleAreaTop=visibleArea.top;$(tableId+" > tbody > tr:visible").each(function(){firstVisibleTR=$(this);if(this.offsetTop+firstVisibleTR.height()>visibleAreaTop){return false}});return firstVisibleTR},_getLastVisibleTR:function(visibleArea){var tableId="#"+this.id(),lastVisibleTR;lastVisibleTR=this.container().find(tableId+" > tbody > tr:visible").filter(function(){return this.offsetTop<visibleArea.bottom}).last();return lastVisibleTR},_determineVirtualRowCount:function(){var div,rowNumber=10,ds,rows="",html,i,height,avgRowHeight,displayContainerHeight,rowsPerPage,result,$colgroup;ds=this._getDataView();if(rowNumber>ds.length){rowNumber=ds.length}div=$("<div></div>)").appendTo("body").css({position:"absolute",top:-1800,left:-1800,visibility:"hidden"});for(i=0;i<rowNumber;i++){rows+=this._renderRecord(ds[i],i)}html='<table class="'+this.css.gridTableClass+'"><tbody role="rowgroup">'+rows+"</tbody></table>";div.html(html);$colgroup=this.element.children("colgroup");if($colgroup.length){$($colgroup[0].outerHTML).appendTo(div.children("table"))}height=div.height();avgRowHeight=height/rowNumber;displayContainerHeight=this._getDisplayContainerHeight();rowsPerPage=displayContainerHeight/avgRowHeight;result=Math.ceil(rowsPerPage*3);div.remove();this._fireInternalEvent("_virtRowCountDetermined",result);return result},_getTotalRowCount:function(){return this.dataSource.dataView().length},_renderVirtualRecordsContinuous:function(){var dvLen,firstVisibleTRIndex,endIndexToBeLoaded,lastVisibleRow,isScrolledToBottom;this._totalRowCount=this._getTotalRowCount();if(this._totalRowCount===0){this._setScrollContainerHeight(0);this._virtualDom=[];return}this._virtualRowCount=this._determineVirtualRowCount();if(this._virtualRowCount>this._totalRowCount){this._virtualRowCount=this._totalRowCount}if(!this._persistVirtualScrollTop){this._scrollTo(0,true);this._renderRecords(this._virtualRowCount-1);this._avgRowHeight=this._calculateAvgRowHeight();this._setScrollContainerHeight(this._totalRowCount*this._avgRowHeight)}else{dvLen=this._getDataView().length;if(this._prevFirstVisibleTRIndex||this._prevFirstVisibleTRIndex===0){firstVisibleTRIndex=this._prevFirstVisibleTRIndex}else{firstVisibleTRIndex=0}if(firstVisibleTRIndex>=dvLen-1){endIndexToBeLoaded=dvLen-1;firstVisibleTRIndex=dvLen-this._virtualRowCount-1}else{endIndexToBeLoaded=parseInt(this._virtualRowCount,0)+firstVisibleTRIndex}if(endIndexToBeLoaded>dvLen-1){endIndexToBeLoaded=dvLen-1}if(firstVisibleTRIndex<0){firstVisibleTRIndex=0}this._renderRecords(firstVisibleTRIndex,endIndexToBeLoaded);lastVisibleRow=this.container().find("#"+this.id()+" > tbody > tr:visible:last");isScrolledToBottom=this._getScrollContainerScrollTop()+5>this._scrollContainer()[0].scrollHeight-this._scrollContainer().innerHeight();if(endIndexToBeLoaded===dvLen-1&&isScrolledToBottom){this._setDisplayContainerScrollTop(lastVisibleRow[0].offsetTop)}else{this._setDisplayContainerScrollTop(this._getDisplayContainerScrollTop()+this._prevFirstVisibleTROffset)}}},_rerenderVirtualRecordsContinuous:function(){var tableId="#"+this.id(),lastRow,lastRowDataIndex;lastRow=this.container().find(tableId+" > tbody > tr:last");lastRowDataIndex=parseInt(lastRow.attr("data-row-idx"),0);this._renderRecords(this._startRowIndex,lastRowDataIndex);this._trigger("virtualrecordsrender",null,{owner:this,tbody:this.element.children("tbody"),dom:this._virtualDom})},_buildVirtualDomForContinuousVirtualization:function(){var rows,cells,i,j;if(this.options.virtualization===true&&this.options.virtualizationMode==="continuous"){this._virtualDom=[];rows=this.container().find("#"+this.id()+" > tbody > tr");for(i=0;i<rows.length;i++){this._virtualDom[i]=[];cells=rows[i].children;for(j=0;j<cells.length;j++){this._virtualDom[i][j]=cells[j]}}this._updateVirtualScrollContainer()}},_isFixedElement:function($td){if(this.hasFixedColumns()&&$td.closest("div").attr("data-fixed-container")!==undefined){return true}return false},_getColumnByTD:function($td){var i,ind=0,isFixed,$tr=$td.closest("tr"),res={},visibleInd,visibleColumns,sci=this._startColIndex||0;if($tr.length===0){return null}if($td.attr("data-parent")||$td.attr("data-skip")){return null}visibleInd=$td.index()-$tr.find("td[data-parent='true'],td[data-skip='true'],td.ui-iggrid-expandcolumn").length;if($td.is("td")){visibleInd-=$tr.find("th").length}if(visibleInd<0){return null}visibleColumns=this._visibleColumns();if(visibleColumns.length<=visibleInd){return null}if(this.hasFixedColumns()){res.index=visibleInd;isFixed=$td.closest("div").attr("data-fixed-container")!==undefined;for(i=0;i<visibleColumns.length;i++){if(isFixed&&visibleColumns[i].fixed===true||!isFixed&&visibleColumns[i].fixed!==true){if(ind++===visibleInd){res.column=visibleColumns[i];break}}}}else{res={column:visibleColumns[visibleInd+sci],index:visibleInd}}return res},_savePersistenceData:function(data,feature,layout){var topmostGrid=this,featureId=feature;if($.type(layout)==="string"&&layout.length>0){topmostGrid=this.element.closest(".ui-iggrid-root").data("igGrid")||this;if(layout!==topmostGrid.element[0].id){featureId=feature+"_"+layout}}topmostGrid.persistenceData=topmostGrid.persistenceData||{};topmostGrid.persistenceData[featureId]=data},_getPersistenceData:function(feature,layout){var topmostGrid=this,featureId=feature;if($.type(layout)==="string"&&layout.length>0){topmostGrid=this.element.closest(".ui-iggrid-root").data("igGrid")||this;if(layout!==topmostGrid.element[0].id){featureId=feature+"_"+layout}}topmostGrid.persistenceData=topmostGrid.persistenceData||{};return topmostGrid.persistenceData[featureId]},_saveFirstVisibleTRIndex:function(){if(this._getFirstVisibleTR(this._getDisplayContainerVisibleArea())){this._prevFirstVisibleTRIndex=parseInt(this._getFirstVisibleTR(this._getDisplayContainerVisibleArea()).attr("data-row-idx"),0);this._prevFirstVisibleTROffset=this._getDisplayContainerScrollTop()-this._getFirstVisibleTR(this._getDisplayContainerVisibleArea())[0].offsetTop}},_getLastVisibleDataRecordIndex:function(){return this._getDataView().length-1},_revertToInitialState:function(){var i,a,attr;if(this.element.is("table")&&this._initialChildren){this._initialChildren.appendTo(this.element)}attr=this.element[0].attributes;a=[];for(i=0;i<attr.length;i++){if(attr[i].name!=="id"){a.push(attr[i].name)}}for(i=0;i<a.length;i++){this.element.removeAttr(a[i])}for(i=0;i<this._initialAttributes.length;i++){if(this._initialAttributes[i].name!=="id"){this.element.attr(this._initialAttributes[i].name,this._initialAttributes[i].value)}}},_removeDetachedDOM:function(container){if(!container){return}var colKey,arr,i;for(colKey in container){if(container.hasOwnProperty(colKey)){arr=container[colKey];for(i=0;i<arr.length;i++){if(arr[i]&&arr[i].length){arr[i].remove()}}}}},_detachEvents:function(){var container;if(this._cellClickHandler){this.element.unbind({click:this._cellClickHandler});this._cellClickHandler=null}if(this._mouseClickEventHandlers){this.element.unbind(this._mouseClickEventHandlers);delete this._mouseClickEventHandlers}if(this._uiSoftDirtyHandler){this.element.unbind("iggriduisoftdirty",this._uiSoftDirtyHandler);this._uiSoftDirtyHandler=null}if(this._hovEvts){this.element.unbind(this._hovEvts);this._hovEvts=null}container=this.scrollContainer();if(!container.length){container=this._vdisplaycontainer()}container.unbind(".syncScrollContainers");this.headersTable().parent().unbind(".syncScrollContainers");container=this.footersTable().closest("div");container.unbind(".syncScrollContainers")},_destroyFeatures:function(){var i,features=this.options.features,e=this.element;for(i=0;i<features.length;i++){if(e.data("igGrid"+features[i].name)){e["igGrid"+features[i].name]("destroy")}}},destroy:function(notToCallDestroy){var prev=this.container().prev(),prepend=false;if(this._scrollHeader&&this._hscrollbarcontent().length>0){this._hscrollbarcontent().unbind("scroll",$.proxy(this._scrollHeader,this))}if(this.scrollContainer()){this.scrollContainer().unbind("scroll")}if(this.dataSource._ajaxRequest&&this.dataSource._ajaxRequest.readyState!==4){this.dataSource._ajaxRequest.abort()}this._headerInitCallbacks=[];this._footerInitCallbacks=[];this.tmpDataSource=null;if(this._resId){clearInterval(this._resId)}this._destroyFeatures();if(this._detachedContainersInitialized){this._removeDetachedDOM(this._detachedHeaderCells);delete this._detachedHeaderCells;this._removeDetachedDOM(this._detachedFooterCells);delete this._detachedFooterCells;delete this._detachedContainersInitialized}this._detachEvents();if(this._isWrapped&&this.container().parent().data("igGrid")){this.element=this.container().parent();this.element.empty();if(notToCallDestroy!==true){$.Widget.prototype.destroy.call(this)}this._revertToInitialState();this.element.trigger(this.events.destroyed,{owner:this});return this}if(prev.length===0){prev=this.container().parent();prepend=true}this.element.empty();if(prepend){prev.prepend(this.element)}else{this.element.insertAfter(prev)}if(notToCallDestroy!==true){$.Widget.prototype.destroy.call(this)}this.container().remove();this._container=null;this._revertToInitialState();if(notToCallDestroy===true){return this}this.element.trigger(this.events.destroyed,{owner:this});return this}});$.extend($.ui.igGrid,{version:"15.2.20152.1027"})})(jQuery);if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igGridModalDialog",{options:{buttonApplyText:"Apply",buttonCancelText:"Cancel",buttonApplyTitle:null,buttonCancelTitle:null,modalDialogCaptionText:"Header",modalDialogWidth:250,modalDialogHeight:"",renderFooterButtons:true,animationDuration:200,buttonApplyDisabled:false},css:{modalDialog:"ui-dialog ui-draggable ui-resizable ui-iggrid-dialog ui-widget ui-widget-content ui-corner-all",modalDialogHeaderCaption:"ui-dialog-titlebar ui-widget-header ui-corner-top ui-helper-reset ui-corner-all ui-helper-clearfix",modalDialogHeaderCaptionTitle:"ui-dialog-title",modalDialogContent:"ui-dialog-content ui-widget-content",modalDialogHandleBar:"",captionButtonContainer:"ui-iggrid-modaldialog-caption-buttoncontainer",modalDialogFooter:"ui-dialog-buttonpane ui-widget-content ui-helper-clearfix",buttonset:"ui-dialog-buttonset",blockArea:"ui-widget-overlay ui-iggrid-blockarea"},events:{modalDialogOpening:"modalDialogOpening",modalDialogOpened:"modalDialogOpened",modalDialogMoving:"modalDialogMoving",modalDialogClosing:"modalDialogClosing",modalDialogClosed:"modalDialogClosed",modalDialogContentsRendering:"modalDialogContentsRendering",modalDialogContentsRendered:"modalDialogContentsRendered",buttonOKClick:"buttonOKClick",buttonCancelClick:"buttonCancelClick"},_createWidget:function(options){this.gridContainer=options.gridContainer;this.containment=options.containment||options.gridContainer;$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){this._setGridWidthHeight();this._renderModalDialog()},_setGridWidthHeight:function(){this.element.css("width",this.options.modalDialogWidth).css("height",this.options.modalDialogHeight)},_checkModalDialogFocus:function(){var self=this;self.gridContainer.unbind("keydown.focusChecker");self.gridContainer.bind("keydown.focusChecker",function(e){var target,gridContainer,tabElems;if(e.keyCode===$.ui.keyCode.TAB){target=document.activeElement;gridContainer=self.gridContainer[0];if(!target||!gridContainer){return}if(target===gridContainer||$.contains(gridContainer,target)&&!$.contains(self.element[0],target)){tabElems=$(":tabbable",self.element);tabElems.first().focus();return}}})},openModalDialog:function(){var maxZ=1e4,rOffset,scrollLeft,scrollTop,pageLeft,pageTop,pageRight,pageBottom,pos,h,w,bh,bw,mdW,mdH,caption,content,footer,modalDialogTop,modalDialogLeft,noCancel=true,modalDialog=this.element,block,animationDuration=this._getAnimationDuration(),blockId=this._id("_modaldialog_block");if(this._modalDialogOpened){return}noCancel=this._trigger(this.events.modalDialogOpening,null,{modalDialog:modalDialog,owner:this});if(noCancel){this._checkModalDialogFocus();$("#"+blockId).remove();this._setGridWidthHeight();pos=$.ig.util.offset(this.gridContainer);w=this.gridContainer.outerWidth();h=this.gridContainer.outerHeight();scrollLeft=$(window).scrollLeft();scrollTop=$(window).scrollTop();pageLeft=pos.left-scrollLeft;pageTop=pos.top-scrollTop;pageRight=pageLeft+w;pageBottom=pageTop+h;mdW=parseInt(this.options.modalDialogWidth,10);mdH=parseInt(this.options.modalDialogHeight,10);block=$("<div></div>").appendTo(this.gridContainer).attr("id",blockId).css("position","absolute").addClass(this.css.blockArea).hide();if(block.outerWidth()!==this.gridContainer.outerWidth()){block.css("width",this.gridContainer.outerWidth())}if(block.outerHeight()!==this.gridContainer.outerHeight()){block.css("height",this.gridContainer.outerHeight())}rOffset=$.ig.util.getRelativeOffset(block);block.css({left:pos.left-rOffset.left,top:pos.top-rOffset.top}).fadeToggle(animationDuration);if(!mdW){mdW=this.element.width()}if(!mdH){mdH=this.element.height()}if(pageLeft<0){pageLeft=0}if(pageTop<0){pageTop=0}bw=$(window).width();bh=$(window).height();if(pageRight>bw){pageRight=bw}if(pageBottom>bh){pageBottom=bh}modalDialogTop=pageTop+scrollTop+(pageBottom-pageTop)/2-mdH/2;modalDialogLeft=pageLeft+scrollLeft+(pageRight-pageLeft)/2-mdW/2;if(modalDialogTop<0){modalDialogTop=pageTop}if(modalDialogLeft<0){modalDialogLeft=pageLeft}maxZ=$.ig.getMaxZIndex(this.element[0].id);rOffset=$.ig.util.getRelativeOffset(modalDialog);modalDialog.css({left:modalDialogLeft-rOffset.left,top:modalDialogTop-rOffset.top,zIndex:maxZ+2}).fadeToggle(animationDuration);block.css({zIndex:maxZ+1});caption=modalDialog.children("div.ui-dialog-titlebar");content=modalDialog.children("div.ui-dialog-content");footer=modalDialog.children("div.ui-dialog-buttonpane");content.css("height",modalDialog.height()-caption.outerHeight()-(content.outerHeight()-content.height())-footer.outerHeight());$("#"+this._id("content")).css({width:""});this._modalDialogOpened=true;this._trigger(this.events.modalDialogOpened,null,{modalDialogElement:modalDialog,owner:this});modalDialog.focus()}},_getAnimationDuration:function(){var animationDuration=this.options.animationDuration;if(animationDuration===null||animationDuration===undefined){animationDuration=200}return animationDuration},_setOption:function(key,value){$.Widget.prototype._setOption.apply(this,arguments);switch(key){case"buttonApplyText":$("#"+this._id("footer_buttonok")).igButton("option","labelText",value);break;case"buttonApplyDisabled":$("#"+this._id("footer_buttonok")).igButton("option","disabled",value);break;case"buttonCancelText":$("#"+this._id("footer_buttoncancel")).igButton("option","labelText",value);break;case"modalDialogCaptionText":this.element.find("span.ui-dialog-title:eq(0)").html(value);break;case"modalDialogWidth":this.element.css("width",value);break;case"modalDialogHeight":this.element.css("height",value);break;case"renderFooterButtons":if(this.element.is(":visible")){this.closeModalDialog()}this.element.empty();this._renderModalDialog();break;default:break}},closeModalDialog:function(accepted){var noCancel=true,modalDialog=this.element,animationDuration=this._getAnimationDuration();if(!this._modalDialogOpened){return}noCancel=this._trigger(this.events.modalDialogClosing,null,{modalDialog:modalDialog,owner:this,accepted:!!accepted});if(noCancel){this.gridContainer.unbind("keydown.focusChecker");modalDialog.fadeToggle(animationDuration);$("#"+this._id("_modaldialog_block")).fadeToggle(animationDuration);this._modalDialogOpened=false;this._trigger(this.events.modalDialogClosed,null,{modalDialog:modalDialog,owner:this})}},_modalDialogMove:function(e,ui){var oPos=ui.originalPosition,pos=ui.position;
this._trigger(this.events.modalDialogMoving,null,{modalDialog:e.target,owner:this,originalPosition:oPos,position:pos})},getCaptionButtonContainer:function(){return $("#"+this._id("caption_button_container"))},getFooter:function(){return $("#"+this._id("footer"))},getContent:function(){return $("#"+this._id("content"))},_renderModalDialog:function(){var self=this,css=this.css,modalDialog=this.element,caption,containment,modalDialogContent,footer,o=this.options,$buttonSet,$buttonOK,$buttonCancel,noCancel=true;modalDialog.css("position","absolute").addClass(this.css.modalDialog).hide();noCancel=this._trigger(this.events.modalDialogContentsRendering,null,{modalDialog:modalDialog,owner:this});if(noCancel){caption=$("<div></div>").addClass(this.css.modalDialogHeaderCaption).appendTo(modalDialog);$("<span></span>").text(this.options.modalDialogCaptionText).addClass(this.css.modalDialogHeaderCaptionTitle).appendTo(caption);$("<div></div>").attr("id",this._id("caption_button_container")).addClass(css.captionButtonContainer).appendTo(caption);modalDialogContent=$("<div></div>").css("overflow","auto").addClass(this.css.modalDialogContent).attr("id",this._id("content")).appendTo(modalDialog);if(o.renderFooterButtons===true){footer=$("<div></div>").addClass(this.css.modalDialogFooter).attr("id",this._id("footer")).appendTo(modalDialog);$buttonSet=$("<div></div>").addClass(this.css.buttonset).appendTo(footer);$buttonOK=$("<button></button>").attr("id",this._id("footer_buttonok")).appendTo($buttonSet);$buttonOK.igButton({labelText:o.buttonApplyText,title:o.buttonApplyTitle,disabled:o.buttonApplyDisabled});$buttonCancel=$("<button></button>").attr("id",this._id("footer_buttoncancel")).appendTo($buttonSet);$buttonCancel.igButton({labelText:o.buttonCancelText,title:o.buttonCancelTitle});$buttonCancel.bind({click:function(e){noCancel=self._trigger(self.events.buttonCancelClick,e,{modalDialog:modalDialog,owner:self});if(noCancel){self.closeModalDialog();e.preventDefault();e.stopPropagation()}}});$buttonOK.bind({click:function(e){var arg={modalDialog:modalDialog,owner:self,toClose:false};self._trigger(self.events.buttonOKClick,e,arg);if(arg.toClose){self.closeModalDialog(true);e.preventDefault();e.stopPropagation()}}})}containment=this.containment;if(containment==="window"){containment="document"}modalDialog.bind({keydown:function(e){var tabElems,first,last;if(e.keyCode===$.ui.keyCode.ESCAPE){self.closeModalDialog();return}if(e.keyCode===$.ui.keyCode.ENTER&&!self.options.buttonApplyDisabled){self.closeModalDialog(true);return}if(e.keyCode!==$.ui.keyCode.TAB){return}tabElems=$(":tabbable",this);first=tabElems.first();last=tabElems.last();if(e.target===last[0]&&!e.shiftKey){first.focus(1);return false}if(e.target===first[0]&&e.shiftKey){last.focus(1);return false}}}).draggable({containment:containment,handle:caption,drag:$.proxy(this._modalDialogMove,this)}).attr("role","dialog").attr("tabIndex",-1);if(typeof Modernizr!=="object"||Modernizr.touch===false){modalDialog.resizable({alsoResize:modalDialogContent,minHeight:modalDialog.outerHeight()/4,minWidth:modalDialog.outerWidth()/2});if(this.containment!=="window"){modalDialog.resizable("option","containment","parent")}}this._trigger(this.events.modalDialogContentsRendered,null,{modalDialog:modalDialog,owner:this})}},_id:function(){var i,ar=arguments,res=this.element[0].id;for(i=0;i<ar.length;i++){res+="_"+ar[i]}return res},destroy:function(){$("#"+this._id("_modaldialog_block")).remove();if(this.gridContainer){this.gridContainer.unbind("keydown.focusChecker")}$.Widget.prototype.destroy.apply(this,arguments);return this}});$.extend($.ui.igGridModalDialog,{version:"15.2.20152.1027"})})(jQuery);if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igEditorFilter",{setFocus:function(delay,toggle){var provider=this.options.provider;if(delay&&$.type(delay)==="number"&&delay>0){setTimeout(function(){provider.setFocus(toggle)},delay)}else{provider.setFocus(toggle)}},remove:function(){if(!this.options.provider.removeFromParent()){var p,e=this.element;p=e[0].parentNode;if(p&&p.tagName){p.removeChild(e[0])}e=this.validator();if(e){e.hide()}}},validator:function(){return this.options.provider.validator()},hasInvalidMessage:function(){var validator=this.validator();return validator?validator.notifier().isVisible():false},destroy:function(){this.options.provider.destroy();$.Widget.prototype.destroy.call(this)}});$.extend($.ui.igEditorFilter,{version:"15.2.20152.1027"});$.ig.EditorProvider=$.ig.EditorProvider||Class.extend({createEditor:function(callbacks,key,editorOptions,tabIndex,format,element){this.handlers={};this.userHandlers={};this.options=editorOptions||{};this.callbacks=callbacks;this.columnKey=key;this.handlers.keyDownHandler=$.proxy(this.keyDown,this);if(this.options.keydown){this.userHandlers.keyDown=this.options.keydown}this.options.keydown=this.handlers.keyDownHandler},keyDown:function(evt,ui){if(this.callbacks&&typeof this.callbacks.keyDown==="function"){this.callbacks.keyDown(evt,ui,this.columnKey)}if(this.userHandlers.keyDown){this.userHandlers.keyDown.apply(this.editor,[evt,ui])}},attachErrorEvents:function(errorShowing,errorShown,errorHidden){this.editor.element.bind({"igvalidatorrerrorhidden.updating":errorHidden,"igvalidatorerrorshowing.updating":errorShowing,"igvalidatorerrorshown.updating":errorShown})},getEditor:function(){return this.editor},refreshValue:function(){return true},getValue:function(){return this.editor.value()},setValue:function(val){this.editor.value(val)},setFocus:function(toggle){return null},setSize:function(width,height){return null},removeFromParent:function(){return false},destroy:function(){this.editor.destroy()},validator:function(){return null},validate:function(){var validator=this.validator();return validator?validator.validate():true},isValid:function(){return true}});$.ig.EditorProviderBase=$.ig.EditorProviderBase||$.ig.EditorProvider.extend({createEditor:function(callbacks,key,editorOptions,tabIndex,format,element){this._super(callbacks,key,editorOptions,tabIndex,format,element);this.handlers.textChangeHandler=$.proxy(this.textChanged,this);if(this.options.textChanged){this.userHandlers.textChanged=this.options.textChanged}this.options.textChanged=this.handlers.textChangeHandler;this.options.tabIndex=tabIndex},textChanged:function(evt,ui){if(this.callbacks&&typeof this.callbacks.textChanged==="function"){this.callbacks.textChanged(evt,ui,this.columnKey)}if(this.userHandlers.textChanged){this.userHandlers.textChanged.apply(this.editor,[evt,ui])}},setSize:function(width,height){this.editor._setOption("width",width);this.editor._setOption("height",height)},setFocus:function(){this.editor.setFocus(false)},removeFromParent:function(){var v=this.validator();if(v){v.hide()}return this.editor.editorContainer().detach()},destroy:function(){this.editor.element.unbind(".updating");this.editor.destroy()},refreshValue:function(){if(this.editor._editorInput.is(":focus")){this.editor._processValueChanging(this.editor._editorInput.val())}},validator:function(){if($.type(this.editor.validator)==="function"){return this.editor.validator()}return null},isValid:function(){return this.editor.isValid()}});$.ig.EditorProviderText=$.ig.EditorProviderText||$.ig.EditorProviderBase.extend({createEditor:function(callbacks,key,editorOptions,tabIndex,format,element){element=element||$("<span />");if(!element.igTextEditor){throw new Error($.ig.GridUpdating.locale.igTextEditorException)}this._super(callbacks,key,editorOptions,tabIndex,format,element);element.igTextEditor(this.options);this.editor=element.data("igTextEditor");return this.editor.editorContainer()},keyDown:function(evt,ui){if(this.callbacks&&typeof this.callbacks.keyDown==="function"){if(!(ui.key===$.ui.keyCode.ENTER&&evt.originalEvent.altKey)||!ui.editorInput.is("textarea")){this.callbacks.keyDown(evt,ui,this.columnKey)}else{evt.originalEvent.stopPropagation()}}if(this.userHandlers.keyDown){this.userHandlers.keyDown.apply(this.editor,[evt,ui])}}});$.ig.EditorProviderNumeric=$.ig.EditorProviderNumeric||$.ig.EditorProviderBase.extend({createEditor:function(callbacks,key,editorOptions,tabIndex,format,element){element=element||$("<span />");if(!element.igNumericEditor){throw new Error($.ig.GridUpdating.locale.igNumericEditorException)}this._super(callbacks,key,editorOptions,tabIndex,format,element);if(format==="int"){this.options.maxDecimals=0}else if(format==="double"&&!this.options.maxDecimals){this.options.maxDecimals=100}this.options.allowNullValue=true;element.igNumericEditor(this.options);this.editor=element.data("igNumericEditor");return this.editor.editorContainer()},getValue:function(){var val=this.editor.value();return isNaN(val)?null:val}});$.ig.EditorProviderCurrency=$.ig.EditorProviderCurrency||$.ig.EditorProviderBase.extend({createEditor:function(callbacks,key,editorOptions,tabIndex,format,element){element=element||$("<span />");if(!element.igCurrencyEditor){throw new Error($.ig.GridUpdating.locale.igCurrencyEditorException)}this._super(callbacks,key,editorOptions,tabIndex,format,element);this.options.displayFactor=this.options.displayFactor||1;this.options.allowNullValue=true;element.igCurrencyEditor(this.options);this.editor=element.data("igCurrencyEditor");return this.editor.editorContainer()}});$.ig.EditorProviderPercent=$.ig.EditorProviderPercent||$.ig.EditorProviderBase.extend({createEditor:function(callbacks,key,editorOptions,tabIndex,format,element){element=element||$("<span />");if(!element.igPercentEditor){throw new Error($.ig.GridUpdating.locale.igPercentEditorException)}this._super(callbacks,key,editorOptions,tabIndex,format,element);this.options.displayFactor=this.options.displayFactor||100;this.options.allowNullValue=true;element.igPercentEditor(this.options);this.editor=element.data("igPercentEditor");return this.editor.editorContainer()}});$.ig.EditorProviderMask=$.ig.EditorProviderMask||$.ig.EditorProviderBase.extend({createEditor:function(callbacks,key,editorOptions,tabIndex,format,element){element=element||$("<span />");if(!element.igMaskEditor){throw new Error($.ig.GridUpdating.locale.igMaskEditorException)}this._super(callbacks,key,editorOptions,tabIndex,format,element);element.igMaskEditor(this.options);this.editor=element.data("igMaskEditor");return this.editor.editorContainer()}});$.ig.EditorProviderDate=$.ig.EditorProviderDate||$.ig.EditorProviderBase.extend({createEditor:function(callbacks,key,editorOptions,tabIndex,format,element){element=element||$("<span />");if(!element.igDateEditor){throw new Error($.ig.GridUpdating.locale.igDateEditorException)}this._super(callbacks,key,editorOptions,tabIndex,format,element);if(format&&!this.options.dateInputFormat){this.options.dateInputFormat=format}element.igDateEditor(this.options);this.editor=element.data("igDateEditor");return this.editor.editorContainer()},getValue:function(evt,ui){var date=this.editor.value();if(Object.prototype.toString.call(date)==="[object Date]"){return new Date(date.getTime())}return null}});$.ig.EditorProviderDatePicker=$.ig.EditorProviderDatePicker||$.ig.EditorProviderBase.extend({createEditor:function(callbacks,key,editorOptions,tabIndex,format,element){element=element||$("<span />");if(!element.igDatePicker){throw new Error($.ig.GridUpdating.locale.igDatePickerException)}this._super(callbacks,key,editorOptions,tabIndex,format,element);if(format&&!this.options.dateInputFormat){this.options.dateInputFormat=format}element.igDatePicker(this.options);this.editor=element.data("igDatePicker");return this.editor.editorContainer()},getValue:function(evt,ui){var date=this.editor.value();if(Object.prototype.toString.call(date)==="[object Date]"){return new Date(date.getTime())}return null}});$.ig.EditorProviderBoolean=$.ig.EditorProviderBoolean||$.ig.EditorProviderBase.extend({createEditor:function(callbacks,key,editorOptions,tabIndex,format,element){if(!this.renderFormat){this.renderFormat="checkbox"}this._super(callbacks,key,editorOptions,tabIndex,format,element);this.handlers.valueChanged=$.proxy(this.valueChanged,this);if(this.options.valueChanged){this.userHandlers.valueChanged=this.options.valueChanged}this.options.valueChanged=this.handlers.valueChanged;switch(this.renderFormat){case"checkbox":element=element||$("<input />");this.outerContainer=$("<div />").css({background:"rgb(255, 255, 255)",outline:"0px","text-align":"center",overflow:"hidden"}).addClass("ui-igedit ui-igedit-container ui-state-default ui-iggrid-editor").append(element);if(!element.igCheckboxEditor){throw new Error($.ig.GridUpdating.locale.igCheckboxEditorException)}element.igCheckboxEditor(this.options);this.editor=element.data("igCheckboxEditor");element=this.outerContainer;return element;case"dropdown":this.options.listItems=["true","false"];this.options.dropDownAttachToBody=true;this.options.button="dropdown";this.options.isLimitedToListValues=true;this.options.dropDownAttachedToBody=true;element=element||$("<span />");if(!element.igTextEditor){throw new Error($.ig.GridUpdating.locale.igTextEditorException)}element.igTextEditor(this.options);this.editor=element.data("igTextEditor");return this.editor.editorContainer()}},valueChanged:function(evt,ui){if(this.callbacks&&typeof this.callbacks.textChanged==="function"){this.callbacks.textChanged(evt,ui,this.columnKey)}if(this.userHandlers.valueChanged){this.userHandlers.valueChanged.apply(this.editor,[evt,ui])}},refreshValue:function(){if(this.renderFormat!=="checkbox"){this.editor._processValueChanging(this.editor._editorInput.val())}},getValue:function(){if(this.renderFormat==="checkbox"){return this.editor.value()}return this.editor.value()==="true"},setValue:function(val){if(this.renderFormat==="checkbox"){this.editor.value(val!==null?val:false)}else{this.editor.value(val!==null?String(val):"false")}},setSize:function(width,height){var cont,chb,defChb;if(this.renderFormat==="checkbox"){cont=this.outerContainer;chb=cont.children().first();cont.css("width",width);cont.css("height",height);chb.css({"margin-top":cont.height()/2-chb.height()/2});defChb=cont.siblings().first().children().first();width=defChb.width();height=defChb.height()}this._super(width,height)},removeFromParent:function(){if(this.renderFormat==="checkbox"){return this.outerContainer.detach()}return this._super()},destroy:function(){this.editor.element.unbind(".updating");this.editor.destroy();if(this.outerContainer&&this.outerContainer instanceof jQuery){this.outerContainer.remove()}}});$.ig.EditorProviderCombo=$.ig.EditorProviderCombo||$.ig.EditorProvider.extend({createEditor:function(callbacks,key,editorOptions,tabIndex,format,element){element=element||$("<span />");if(!element.igCombo){throw new Error($.ig.GridUpdating.locale.igComboException)}this._super(callbacks,key,editorOptions,tabIndex,format,element);this.handlers.selectionChangedHandler=$.proxy(this.selectionChanged,this);if(this.options.selectionChanged){this.userHandlers.selectionChanged=this.options.selectionChanged}this.options.selectionChanged=this.handlers.selectionChangedHandler;this.options.tabIndex=tabIndex;if(this.options.id){element.attr("id",this.options.id)}element.igCombo(this.options);this.editor=element.data("igCombo");this.editor.textInput().bind("keydown.updating",this.handlers.keyDownHandler);if(this.editor._options.internalSelChangeSubs&&$.type(this.editor._options.internalSelChangeSubs)==="array"){this.handlers.internalSelectionChangedHandler=$.proxy(this.internalSelectionChanged,this);this.editor._options.internalSelChangeSubs.push(this.handlers.internalSelectionChangedHandler)}return element},keyDown:function(evt,ui){if(evt.keyCode===$.ui.keyCode.TAB){this.editor.closeDropDown()}if(this.callbacks&&typeof this.callbacks.keyDown==="function"){if(evt.keyCode!==$.ui.keyCode.ENTER||!this.editor.dropDownOpened()){this.callbacks.keyDown(evt,ui||{owner:this.editor},this.columnKey)}}if(this.editor.options.allowCustomValue){this.internalSelectionChanged(evt,ui)}if(this.userHandlers.keyDown){this.userHandlers.keyDown.apply(this.editor,[evt,ui])}},internalSelectionChanged:function(evt,ui){if(this.callbacks&&typeof this.callbacks.textChanged==="function"){this.callbacks.textChanged(evt,ui,this.columnKey)}},selectionChanged:function(evt,ui){this.internalSelectionChanged(evt,ui);if(this.userHandlers.selectionChanged){this.userHandlers.selectionChanged.apply(this.editor,[evt,ui])}},refreshValue:function(){this.editor.refreshValue()},getValue:function(){var val=this.editor.value();if($.type(val)==="array"&&val.length){return val[0]}return val},setValue:function(val,fire){this.editor.deselectAll();this.editor.value(val,null,fire)},setSize:function(width,height){this.editor.element.igCombo({width:width,height:height})},setFocus:function(){this.editor.textInput().focus()},removeFromParent:function(){this.editor.closeDropDown();if(this.validator()){this.validator().hide()}return this.editor.element.closest(".ui-igcombo-wrapper").detach()},validator:function(){return this.editor.validator()},destroy:function(){this.editor.textInput().bind("keydown.updating");this.editor.element.unbind(".updating");this.editor.destroy()},isValid:function(){return true}});$.ig.EditorProviderRating=$.ig.EditorProviderRating||$.ig.EditorProvider.extend({createEditor:function(callbacks,key,editorOptions,tabIndex,format,element){element=element||$("<div />");if(!element.igRating){throw new Error($.ig.GridUpdating.locale.igRatingException)}this._super(callbacks,key,editorOptions,tabIndex,format,element);this.handlers.valueChange=$.proxy(this.valueChange,this);if(this.options.valueChange){this.userHandlers.valueChange=this.options.valueChange}this.options.valueChange=this.handlers.valueChange;if(this.options.id){element.attr("id",this.options.id)}element.igRating(this.options);this.editor=element.data("igRating");this.handlers.internalValueChange=$.proxy(this.internalValueChange,this);this.editor._internalChanged=this.handlers.internalValueChange;if(this.editor._foc){this.editor._foc.attr("tabIndex",tabIndex);this.editor._foc.keydown(this.handlers.keyDown)}return element},internalValueChange:function(evt,ui){if(this.callbacks&&typeof this.callbacks.textChanged==="function"){this.callbacks.textChanged(evt,ui,this.columnKey)}},valueChange:function(evt,ui){this.internalValueChange(evt,ui);if(this.userHandlers.valueChange){this.userHandlers.valueChange.apply(this.editor,[evt,ui])}},setValue:function(val){return this.editor.value(val||0)},setSize:function(width,height){if(!this._once){this.editor._doVotes(this.editor.options)}this._once=1;var back=this.editor.element.parent().css("backgroundColor");this.editor.element.css({width:width,height:height,backgroundColor:back})},setFocus:function(){this.editor.focus()},validator:function(){return this.editor.validator()},destroy:function(){this.editor.element.unbind(".updating");this.editor.destroy()},isValid:function(){return true}})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Multi Headers 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	modernizr.js (Optional)
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){var _aNull=function(val){return val===null||val===undefined};$.widget("ui.igGridColumnFixing",{renderInFeatureChooser:true,events:{columnFixing:"columnFixing",columnFixed:"columnFixed",columnUnfixing:"columnUnfixing",columnUnfixed:"columnUnfixed",columnFixingRefused:"columnFixingRefused",columnUnfixingRefused:"columnUnfixingRefused"},css:{fixedContainer:"ui-iggrid-fixedcontainer",headerButtonIconContainer:"ui-iggrid-fixcolumn-headerbuttoncontainer",leftFixedContainer:"ui-iggrid-fixedcontainer-left",rightFixedContainer:"ui-iggrid-fixedcontainer-right",headerButtonIcon:"ui-icon ui-corner-all ui-icon-pin-w",headerButtonIconHover:"",headerButtonUnfixIcon:"ui-icon ui-corner-all ui-icon-pin-s",featureChooserIconClassFixed:"ui-icon ui-iggrid-icon-unfix",featureChooserIconClassUnfixed:"ui-icon ui-iggrid-icon-fix",unfixedTableLeft:"ui-iggrid-unfixed-table-left",unfixedTableRight:"ui-iggrid-unfixed-table-right"},internalErrors:{none:$.ig.ColumnFixing.locale.internalErrors.none,notValidIdentifier:$.ig.ColumnFixing.locale.internalErrors.notValidIdentifier,fixingRefused:$.ig.ColumnFixing.locale.internalErrors.fixingRefused,fixingRefusedMinVisibleAreaWidth:$.ig.ColumnFixing.locale.internalErrors.fixingRefusedMinVisibleAreaWidth,alreadyHidden:$.ig.ColumnFixing.locale.internalErrors.alreadyHidden,alreadyUnfixed:$.ig.ColumnFixing.locale.internalErrors.alreadyUnfixed,alreadyFixed:$.ig.ColumnFixing.locale.internalErrors.alreadyFixed,unfixingRefused:$.ig.ColumnFixing.locale.internalErrors.unfixingRefused,targetNotFound:$.ig.ColumnFixing.locale.internalErrors.targetNotFound},options:{headerFixButtonText:$.ig.ColumnFixing.locale.headerFixButtonText,headerUnfixButtonText:$.ig.ColumnFixing.locale.headerUnfixButtonText,showFixButtons:true,syncRowHeights:true,scrollDelta:40,fixingDirection:"left",columnSettings:[{columnKey:null,columnIndex:null,allowFixing:true,isFixed:false}],featureChooserTextFixedColumn:$.ig.ColumnFixing.locale.featureChooserTextFixedColumn,featureChooserTextUnfixedColumn:$.ig.ColumnFixing.locale.featureChooserTextUnfixedColumn,minimalVisibleAreaWidth:30,fixNondataColumns:true,populateDataRowsAttributes:true},scrollContainerCheckValue:2,_createWidget:function(){this._fcData={};this._tds={};this._containers={};this._colgroups={};this._isInitFC=false;this._isFunctionsOverriden=false;$.Widget.prototype._createWidget.apply(this,arguments)},_unfixColumnInternal:function(colKey,isGroupHeader,target,after){var noCancel,res,grid=this.grid;noCancel=this._trigger(this.events.columnUnfixing,null,{columnIdentifier:colKey,isGroupHeader:isGroupHeader,owner:grid});if(noCancel){res=this.unfixColumn(colKey,isGroupHeader,target,after);if(res.result===false){this._trigger(this.events.columnUnfixingRefused,null,{columnIdentifier:colKey,isGroupHeader:isGroupHeader,errorMessage:res.error,owner:grid})}else{this._trigger(this.events.columnUnfixed,null,{columnIdentifier:colKey,isGroupHeader:isGroupHeader,owner:grid})}}return res},unfixColumn:function(colIdentifier,isGroupHeader,target,after){var col,self=this,res,colWidth,hasDataSkippedColumns=this._hasDataSkippedColumns(true),c,mchLevel,children,columnKeys,columnIndex,colKey,MCHchildren,key,$th,colIdentifierType=$.type(colIdentifier),initialFixedColsIndex,i,j,cols=this.grid.options.columns,colsLength=cols.length,grid=this.grid,childrenUnfixingAllowed=[],initialFixedColumnsLength=this.grid._fixedColumns.length,indexAt,columnIndexAt,hasTarget=false,targetRes,at,columnIndexes=[],gridId=grid.id(),visibleIndex,vI,inMCHGroup,$colgroup,$vContainer;res={error:this.internalErrors.none,result:true,col:null};columnKeys=[];if(!isGroupHeader){if(colIdentifierType==="number"){columnIndex=colIdentifier}else if(colIdentifierType==="string"){columnIndex=-1;for(i=0;i<colsLength;i++){if(cols[i].key===colIdentifier){columnIndex=i;break}}}col=cols[columnIndex];res.col=col;if(col===null||col===undefined){res.result=false;res.error=this.internalErrors.notValidIdentifier;return res}colKey=col.key;columnKeys.push(colKey);visibleIndex=this._getVisibleIndex(colKey,true);$th=this.grid.container().find("#"+gridId+"_"+colKey);res.col=col;columnIndexes.push({cI:columnIndex,vI:visibleIndex});children=[col];childrenUnfixingAllowed=[col]}else{c=[];$th=this.grid.fixedHeadersTable().find("th[data-mch-id="+colIdentifier+"]");colKey=colIdentifier;MCHchildren=this.grid._getMultiHeaderColumnById(colIdentifier);res.col=MCHchildren;if(!MCHchildren){res.result=false;res.error=this.internalErrors.notValidIdentifier;return res}children=MCHchildren.children;childrenUnfixingAllowed=MCHchildren.children;columnKeys=[];for(i=0;i<children.length;i++){key=children[i].key;columnKeys.push(key);if(children[i].hidden===true){vI=-1}else{vI=this._getVisibleIndex(children[i].key,true);c.push(children[i])}for(j=0;j<colsLength;j++){if(cols[j].key===key){columnIndexes.push({cI:j,vI:vI});break}}}children=c}if(!_aNull(target)){hasTarget=true;targetRes=this._analyzeTargetIndexes(target,after,false);if(!targetRes){res.result=false;res.error=this.internalErrors.targetNotFound.replace("{key}",res.col.key);return res}indexAt=targetRes.indexAt;columnIndexAt=targetRes.columnIndexAt}if(!!res.col.fixed===false){res.result=false;res.error=this.internalErrors.alreadyUnfixed;return res}if(res.col.hidden){res.result=false;res.error=this.internalErrors.alreadyHidden;return res}if(grid._isMultiColumnGrid){mchLevel=$th.closest("tr").attr("data-mch-level");if(mchLevel&&parseInt(mchLevel,10)!==grid._maxLevel){res.result=false;res.error=this.internalErrors.ActionNotAllowedForChildHeaderColumn;return res}}if(!this.checkUnfixingAllowed(childrenUnfixingAllowed)){res.result=false;res.error=this.internalErrors.unfixingRefused;return res}if($th.length>0){colWidth=$th.outerWidth()}else{colWidth=this.grid.container().find("#"+this.grid.id()+" tbody>tr:nth-child(1)>td:nth-child("+(visibleIndex+1)+")").outerWidth()}this._populateContainers();this._rearrangeOldColsByColumnKey(colKey,false,target,after);colWidth=-colWidth;initialFixedColsIndex=self.grid._fixedColumns.length-1;inMCHGroup=true;for(i=columnIndexes.length-1,j=0;i>-1;i--,j++){if(columnIndexes[i].vI!==-1){visibleIndex=columnIndexes[i].vI+1;this._unfixColumnByVisibleIndex(visibleIndex,colWidth,false,{inMCHGroup:inMCHGroup,colIdentifier:colKey,isGroupHeader:isGroupHeader},indexAt);inMCHGroup=false}col=cols.splice(columnIndexes[i].cI,1);col[0].fixed=false;if(!hasTarget){cols.splice(initialFixedColsIndex-j,0,col[0])}else{at=columnIndexAt-j-1;cols.splice(at,0,col[0])}vI=-1;if(columnIndexes[i].vI!==-1){vI=columnIndexes[i].vI+1}this.grid._onColumnFixed(columnIndexes[i].cI,false,initialFixedColumnsLength-j,false,vI,at)}for(i=0;i<columnKeys.length;i++){key=columnKeys[i];for(j=0;j<this.grid._fixedColumns.length;j++){if(this.grid._fixedColumns[j].key===key){col=self.grid._fixedColumns.splice(j,1);col[0].fixed=false;break}}}this.grid._visibleColumnsArray=undefined;if($.ig.util.isIE10){this.grid._hscrollbar().width("")}if(this.grid._fixedColumns.length===0&&(!hasDataSkippedColumns||this.options.fixingDirection==="right"||hasDataSkippedColumns&&!this.options.fixNondataColumns)){this._removeFixedContainer()}else if(this.options.syncRowHeights){this._checkSyncTablesHeights()}grid._updateHeaderColumnIndexes();grid._columnMovingResets();this._updateGridColWidths();this.grid._hscrollbarcontent().scrollLeft(0);if(isGroupHeader){this._changeStyleHeaderButton(colIdentifier,false,isGroupHeader)}else{this._changeStyleHeaderButton(columnKeys[0],false,isGroupHeader)}if(this.grid.element.data("igGridResizing")){this.grid._updateGridContentWidth()}if(this._isVirtualGrid()){grid._resetVirtualDom();if(grid._fixedColumns.length===0&&(!hasDataSkippedColumns||this.options.fixingDirection==="right"||hasDataSkippedColumns&&!this.options.fixNondataColumns)){$vContainer=grid._virtualcontainer();$colgroup=$vContainer.find("colgroup:first");$colgroup.find("[data-fixed-col]").remove();$vContainer.find("tr td[data-fixed-container]").remove();if(this.options.fixingDirection==="right"){this._adjustVirtualizationContainers(false);$vContainer.find("tr:first td:first").attr("colspan",2);$vContainer.find("tr:last td:first").attr("colspan",2)}}if(this._isContinuousVirtualization()){grid._setScrollContainerScrollTop(0)}if(this.options.fixingDirection!=="right"||this.grid._fixedColumns.length===0){grid._adjustLastColumnWidth(true)}}else{grid._adjustLastColumnWidth(true)}this._updateHScrollbarWidth();this._trigger("_columnUnfixed",null,{columnIdentifier:colIdentifier,isGroupHeader:isGroupHeader,columnindexAt:columnIndexAt});return res},_removeFixedContainer:function(){var grid=this.grid,scrollContainer;if(!this._containers){this._populateContainers()}scrollContainer=this._containers.body.unfixedContainer;if(this.options.fixingDirection==="left"){this.unfixDataSkippedColumns()}scrollContainer.unbind(".columnFixing");if(this._containers&&this._containers.body){this._containers.body.unfixedTable.removeClass(this.css.unfixedTableLeft).removeClass(this.css.unfixedTableRight)}if(this._DOMMouseScroll!==null&&this._DOMMouseScroll!==undefined){scrollContainer.unbind({DOMMouseScroll:this._DOMMouseScroll});this._DOMMouseScroll=null}grid.fixedContainer().remove();if(this.options.fixingDirection==="right"&&!this._isVirtualGrid()){scrollContainer.css({"overflow-y":"auto"})}grid._hscrollbar().css({width:"100%",left:0});if(grid.options.width===null&&grid.container()[0].style.width===""){grid.container().css("width","")}if(grid.options.enableHoverStyles){this._dettachHoverEvents()}},_checkSyncTablesHeights:function(){if(!this._containers||!this._containers.body){this._populateContainers()}var h,fH,ufH,$fixedTable=this._containers.body.fixedTable,$unfixedTable=this._containers.body.unfixedTable,$lastTr=$fixedTable.find("tbody tr:last");if($lastTr.length>0&&(Math.abs($fixedTable.outerHeight()-$unfixedTable.outerHeight())>1||Math.abs($lastTr.offset().top-$unfixedTable.find("tbody tr:last").offset().top)>1)){this._syncRowsHeights($fixedTable,$unfixedTable);fH=$fixedTable.height();ufH=$unfixedTable.height();h=ufH;if(fH>ufH){h=fH}$fixedTable.height(h);$unfixedTable.height(h)}},_getKeyByVisibleIndex:function(index,isFixed){var hasDataSkippedColumns=this._hasDataSkippedColumns(),cols,col,dataSkippedColsLength=0,visibleCols=this.grid._visibleColumns();cols=$.grep(visibleCols,function(col){var f=col.fixed===true;return f===isFixed});if(hasDataSkippedColumns){dataSkippedColsLength=this._getDataSkippedColumnsLength(isFixed);index-=dataSkippedColsLength}col=cols[index];if(!col){return undefined}return col.key},_unfixColumnByVisibleIndex:function(visibleIndex,colWidth,isDataSkip,MCHParams,indexAt){var grid=this.grid,inMCHGroup,colIdentifier,isGroupHeader,containerBody=this._containers.body,containerHeader=this._containers.header,containerFooter=this._containers.footer,isMCH=grid._isMultiColumnGrid;if(MCHParams){inMCHGroup=MCHParams.inMCHGroup;colIdentifier=MCHParams.colIdentifier;isGroupHeader=MCHParams.isGroupHeader}if(!containerHeader){containerHeader=containerBody}if(!containerFooter){containerFooter=containerBody}this._getElementsByDOM(visibleIndex,containerHeader.fixedTable.children("thead"),"header",false,isDataSkip);this._getElementsByDOM(visibleIndex,containerBody.fixedTable.children("tbody"),"body",false,isDataSkip);this._getElementsByDOM(visibleIndex,containerFooter.fixedTable.children("tfoot"),"footer",false,isDataSkip);this._getColgroups(visibleIndex,true);if(isDataSkip){if(this._tds.header.length>0){colWidth=$(this._tds.header[0]).outerWidth()}else if(this._tds.body.length>0){colWidth=$(this._tds.body[0]).outerWidth()}colWidth=-colWidth}this._detachColgroups();this._tds.header.detach();this._tds.body.detach();this._tds.footer.detach();if(inMCHGroup||isDataSkip){this._syncWidth(colWidth)}this._attachColgroups(true,indexAt);if(grid.options.showHeader){this._unfixHeaderColumn(indexAt)}this._unfixBodyColumn(indexAt);this._unfixFooterColumn(indexAt);if(grid.options.showHeader&&isMCH&&inMCHGroup){this._unfixMultiColumnHeader(colIdentifier,isGroupHeader,indexAt)}},_setOption:function(key,value){if(value===this.options[key]){return}$.Widget.prototype._setOption.apply(this,arguments);if(key==="minimalVisibleAreaWidth"){this.grid._visibleAreaWidth(value)}},unfixDataSkippedColumns:function(){var i,dataSkippedColsLength,isMCH=this.grid._isMultiColumnGrid,hasDataSkippedColumns=this._hasDataSkippedColumns();if(this.options.fixingDirection==="left"&&hasDataSkippedColumns){dataSkippedColsLength=this._getDataSkippedColumnsLength(true);if(isMCH){this._unfixMultiColumnHeaderDataSkip()}this.grid._hasFixedDataSkippedColumns=false;for(i=dataSkippedColsLength-1;i>-1;i--){this._unfixColumnByVisibleIndex(i+1,null,true);this.grid._onColumnFixed(-1,false,0,false)}}},unfixAllColumns:function(){var i,ths,self=this,colsToUnfix=[],isMCH=this.grid._isMultiColumnGrid,cols=this.grid._fixedColumns,colsLength=cols.length;if(colsLength>0){if(isMCH){ths=this.grid.fixedHeadersTable().find("thead tr[data-mch-level]:nth-child(1) th");ths.each(function(index,th){var $th=$(th),id,isGroupHeader=true;id=$th.attr("data-mch-id");if(id===undefined){id=$th.attr("id").replace(self.grid.id()+"_","");isGroupHeader=false}colsToUnfix.push({id:id,isGroupHeader:isGroupHeader})})}else{for(i=0;i<colsLength;i++){colsToUnfix.push({id:cols[i].key,isGroupHeader:undefined})}}if(colsToUnfix.length>0){for(i=colsToUnfix.length-1;i>=0;i--){this.unfixColumn(colsToUnfix[i].id,colsToUnfix[i].isGroupHeader)}}}},_unfixMultiColumnHeaderDataSkip:function(){var i,$th,dataSkippedColsLength,$unfixedThead,$fixedThead,maxLevel=this.grid._maxLevel,container=this._containers.header;if(!container){container=this._containers.body}$unfixedThead=container.unfixedTable.find("thead");$fixedThead=this.grid.container().find("#"+container.unfixedTable.attr("id")+"_fixed").find("thead");if(this._hasDataSkippedColumns()&&this.options.fixingDirection==="left"){dataSkippedColsLength=this._getDataSkippedColumnsLength(true);for(i=dataSkippedColsLength-1;i>-1;i--){$th=$fixedThead.find("tr[data-mch-level="+maxLevel+"] th[data-skip]:nth-child("+(i+1)+")");$th.detach();$th.prependTo($unfixedThead.find("tr[data-mch-level="+maxLevel+"]"))}}},_unfixMultiColumnHeader:function(colId,isGroupHeader,indexAt){var grid=this.grid,i,$th,gridId=grid.id(),maxLevel,cols,$fixedThead,$unfixedThead,fixedTable,oTable;if(this._containers.header){oTable=this._containers.header.unfixedTable;fixedTable=this._containers.header.fixedTable}else{oTable=this._containers.body.unfixedTable;fixedTable=this._containers.body.fixedTable}$unfixedThead=oTable.find("thead");$fixedThead=fixedTable.find("thead");if(!_aNull(indexAt)){this._fixUnfixMCHColumn(colId,{fixedThead:$fixedThead,unfixedThead:$unfixedThead,isToFix:false},indexAt);return}maxLevel=grid._maxLevel;if(isGroupHeader){cols=grid._oldCols;for(i=0;i<cols.length;i++){if(cols[i].identifier===colId){cols[i].fixed=false;this._unfixMCHColumn(cols[i],$fixedThead,$unfixedThead);break}}}else{$th=this.grid.container().find("#"+gridId+"_"+colId);$th.detach().prependTo($unfixedThead.find("tr[data-mch-level="+maxLevel+"]"))}},_updateGridColWidths:function(){var totalColWidth=0,lastColWidth,i,w,cols,grid=this.grid;if(grid._allColumnWidthsInPixels){cols=grid._visibleColumns();for(i=0;i<cols.length;i++){if(cols[i].fixed!==true&&cols[i].width){w=parseInt(cols[i].width,10);totalColWidth+=w;lastColWidth=w}}grid._lastColPixelWidth=lastColWidth;grid._totalColPixelWidth=totalColWidth}},_unfixMCHColumn:function(el,$fixedHeader,$unfixedHeader){var level=el.level,$th,domLevel,children,i;if(level===0){$th=this.grid.container().find("#"+this.grid.id()+"_"+el.key)}else{$th=$fixedHeader.find("th[data-mch-id="+el.identifier+"]");children=el.group}domLevel=$th.closest("tr").attr("data-mch-level");$th.detach();$th.prependTo($unfixedHeader.find("tr[data-mch-level="+domLevel+"]"));if(level>0){for(i=children.length-1;i>-1;i--){this._unfixMCHColumn(children[i],$fixedHeader,$unfixedHeader)}}},_isLastColumn:function(){var hasDataSkippedCols=this._hasDataSkippedColumns(),countFixedCols=this.grid._fixedColumns.length;return countFixedCols===1&&!hasDataSkippedCols||hasDataSkippedCols&&countFixedCols===0},_unfixHeaderColumn:function(indexAt){var $unfixedThead,tdsFirst,oTable;if(this._containers.header){oTable=this._containers.header.unfixedTable}else{oTable=this._containers.body.unfixedTable}$unfixedThead=oTable.children("thead");tdsFirst=this._tds.header;this._fixUnfixDOM($unfixedThead,tdsFirst,false,indexAt);if(this._isLastColumn()){$unfixedThead.children("tr[data-header-row]").css("height","")}},_unfixBodyColumn:function(indexAt){var tdsFirst,$tbody,oTable=this._containers.body.unfixedTable,scrollContainer=this._containers.body.unfixedContainer,oTableWidth=oTable.width();tdsFirst=this._tds.body;$tbody=oTable.children("tbody");this._fixUnfixDOM($tbody,tdsFirst,false,indexAt);scrollContainer.scrollTop(0);this.grid._hscrollbarinner().css({width:(this.grid._hasVerticalScrollbar&&this.grid.options.fixedHeaders?oTableWidth-this.grid._scrollbarWidth():oTableWidth)+"px",left:0});if(this._isLastColumn()){$tbody.children("tr").height("")}if(this.grid.options.width===null){if(this.grid._fixedColumns.length===1){oTable[0].style.width=""}}},_unfixFooterColumn:function(indexAt){var $tfoot,container=this._containers.footer,oTable,tdsFirst;if(!container){container=this._containers.body}oTable=container.unfixedTable;tdsFirst=this._tds.footer;$tfoot=oTable.children("tfoot");this._fixUnfixDOM($tfoot,tdsFirst,false,indexAt);if(this._isLastColumn()){$tfoot.children("tr").height("")}},_fixColumnInternal:function(colKey,isGroupHeader,target,after){var noCancel,res,grid=this.grid;if(isGroupHeader===undefined||isGroupHeader===null){isGroupHeader=false}noCancel=this._trigger(this.events.columnFixing,null,{columnIdentifier:colKey,isGroupHeader:isGroupHeader,owner:grid});if(noCancel){res=this.fixColumn(colKey,isGroupHeader,target,after);if(res.error===this.internalErrors.fixingRefused||res.result===false){this._trigger(this.events.columnFixingRefused,null,{columnIdentifier:colKey,isGroupHeader:isGroupHeader,errorMessage:res.error,owner:grid})}else{this._trigger(this.events.columnFixed,null,{columnIdentifier:colKey,isGroupHeader:isGroupHeader,owner:grid})}}return res},_getVisibleIndex:function(colId,isFixed,ignoreDataSkip){if($.type(colId)==="number"){return colId}var i,fixedCol,unfixedColsLength,unfixedCols,col,cols=this.grid._visibleColumns(),visibleIndex=0,fixedCols=this.grid._fixedColumns,fixedColsLength=fixedCols.length;if(isFixed===undefined){col=this.grid.columnByKey(colId);if(col){isFixed=col.fixed===true}}if(isFixed){for(i=0;i<fixedColsLength;i++){fixedCol=fixedCols[i];if(fixedCol.key===colId){break}if(!fixedCol.hidden){visibleIndex++}}}else{unfixedCols=[];unfixedColsLength=0;for(i=0;i<cols.length;i++){if(!cols[i].fixed){unfixedColsLength++;unfixedCols.push(cols[i])}}for(i=0;i<unfixedColsLength;i++){if(unfixedCols[i].key===colId){break}visibleIndex++}}if(ignoreDataSkip){return visibleIndex}if(this._hasDataSkippedColumns()){if(this.options.fixingDirection==="left"){if(isFixed){visibleIndex+=this._getDataSkippedColumnsLength(isFixed)}}else if(!isFixed){visibleIndex+=this._getDataSkippedColumnsLength()}}return visibleIndex},checkFixingAllowed:function(columns){var i,visibleColumnsCount=0;for(i=0;i<columns.length;i++){if(!columns[i].hidden){visibleColumnsCount++}}if(this.grid._visibleColumns(false).length-visibleColumnsCount<1){return false}return this._isFixingUnfixingAllowed(columns,true)},checkUnfixingAllowed:function(columns){return this._isFixingUnfixingAllowed(columns,false)},_isFixingUnfixingAllowed:function(columns,isToFix){var i,columnsLength=columns.length,j,col,columnsInArea=[],oCols=this.grid.options.columns,oColsLength=oCols.length;for(i=0;i<oColsLength;i++){if(!isToFix&&oCols[i].fixed||isToFix&&!oCols[i].fixed){for(j=0;j<columnsLength;j++){col=columns[j];if(col.key===oCols[i].key){break}}if(j===columnsLength){columnsInArea.push(oCols[i])}}}if(columnsInArea.length===0){return true}for(i=0;i<columnsInArea.length;i++){if(!columnsInArea[i].hidden){return true}}return false},_isVirtualGrid:function(){var gridOptions=this.grid.options;return gridOptions.virtualization===true||gridOptions.rowVirtualization===true},_isContinuousVirtualization:function(){return this._isVirtualGrid()&&this.grid.options.virtualizationMode==="continuous"},fixColumn:function(colIdentifier,isGroupHeader,target,after){var col,colWidth,columnIndex,res,i,j,children,colIdentifierType=$.type(colIdentifier),colKey,visibleIndex,isI,virtualization=this._isVirtualGrid(),shoulRerendedColgroups,grid=this.grid,gridId=grid.id(),$th,vI,isGridWidthPercentage=$.type(grid.options.width)==="string"&&grid.options.width.indexOf("%")!==-1,MCHchildren,mchLevel,$mainFixedContainer,mainFixedContainerWidth=0,gridWidth=parseInt(grid.options.width,10),columnIndexes=[],hasTarget=false,hasDataSkippedColumns=false,initialFixedColumnsLength=grid._fixedColumns.length,isInit=initialFixedColumnsLength===0,indexAt,columnIndexAt,targetRes,vIndexAt,at,inMCHGroup,cols=grid.options.columns,colsLength=cols.length;res={error:this.internalErrors.none,result:true,col:null};if(!isGroupHeader){if(colIdentifierType==="number"){columnIndex=colIdentifier}else if(colIdentifierType==="string"){columnIndex=-1;for(i=0;i<colsLength;i++){if(cols[i].key===colIdentifier){columnIndex=i;break}}}col=cols[columnIndex];res.col=col;if(col===null||col===undefined){res.result=false;res.error=this.internalErrors.notValidIdentifier;return res}visibleIndex=this._getVisibleIndex(col.key);res.col=col;colKey=col.key;$th=grid.container().find("#"+gridId+"_"+colKey);columnIndexes.push({cI:columnIndex,vI:visibleIndex});children=[col]}else{$th=grid.headersTable().find("th[data-mch-id="+colIdentifier+"]");colKey=colIdentifier;MCHchildren=this.grid._getMultiHeaderColumnById(colIdentifier);res.col=MCHchildren;if(!MCHchildren){res.result=false;res.error=this.internalErrors.notValidIdentifier;return res}children=MCHchildren.children}if(!_aNull(target)){hasTarget=true;targetRes=this._analyzeTargetIndexes(target,after,true);if(!targetRes){res.result=false;res.error=this.internalErrors.targetNotFound.replace("{key}",res.col.key);return res}indexAt=targetRes.indexAt;columnIndexAt=targetRes.columnIndexAt}if(res.col.fixed){res.result=false;res.error=this.internalErrors.alreadyFixed;return res}if(res.col.hidden){res.result=false;res.error=this.internalErrors.alreadyHidden;return res}if(grid._isMultiColumnGrid){mchLevel=$th.closest("tr").attr("data-mch-level");if(mchLevel&&parseInt(mchLevel,10)!==grid._maxLevel){res.result=false;res.error=this.internalErrors.ActionNotAllowedForChildHeaderColumn;return res}}if(!this.checkFixingAllowed(children,isGroupHeader)){res.result=false;res.error=this.internalErrors.fixingRefused;return res}if(isNaN(gridWidth)||isGridWidthPercentage){gridWidth=grid.container().outerWidth()}if($th.length===1||visibleIndex===undefined){colWidth=$th.outerWidth()}else{colWidth=grid.container().find("#"+gridId+" tbody tr:nth-child(1) td:nth-child("+(visibleIndex+1)+")").outerWidth()}shoulRerendedColgroups=false;if(col&&grid.element.data("igGridHiding")){if(col.oWidth!==undefined){colWidth=parseInt(col.oWidth,10);col.width=colWidth}else if(col.width){colWidth=parseInt(col.width,10)}shoulRerendedColgroups=true}if(col&&col.hidden||colWidth===undefined){colWidth=0}if(grid.hasFixedColumns()){$mainFixedContainer=grid.fixedContainer();if(virtualization){mainFixedContainerWidth=parseInt(grid._virtualcontainer().find("col[data-fixed-col]").attr("width"),10)}else if($mainFixedContainer.length){mainFixedContainerWidth=$mainFixedContainer.outerWidth()}}if(isNaN(mainFixedContainerWidth)){mainFixedContainerWidth=0}if(colWidth+mainFixedContainerWidth+grid._scrollbarWidth()>=gridWidth-parseInt(this.options.minimalVisibleAreaWidth,10)){res.result=false;res.error=this.internalErrors.fixingRefusedMinVisibleAreaWidth;return res}this._populateContainers();this._rearrangeOldColsByColumnKey(colKey,true,target,after);if(isGroupHeader){visibleIndex=undefined;for(i=0;i<children.length;i++){if(children[i].hidden!==true){if(i===0||visibleIndex===undefined){visibleIndex=this._getVisibleIndex(children[i].key,false)}vI=visibleIndex}else{vI=-1}for(j=0;j<colsLength;j++){if(cols[j].key===children[i].key){columnIndexes.push({cI:j,vI:vI});break}}children[i].fixed=true;if(!hasTarget){grid._fixedColumns.push(children[i])}else{grid._fixedColumns.splice(i+columnIndexAt,0,children[i])}}}else{col.fixed=true;if(!hasTarget){grid._fixedColumns.push(col)}else{grid._fixedColumns.splice(columnIndexAt,0,col)}}isI=isInit;if(isInit&&this.options.fixingDirection==="left"){hasDataSkippedColumns=this._hasDataSkippedColumns();if(hasDataSkippedColumns){if(this._getDataSkippedColumnsLength(true)===0){this.fixDataSkippedColumns()}isI=false}}inMCHGroup=true;vIndexAt=indexAt;for(i=0;i<columnIndexes.length;i++){vI=-1;if(columnIndexes[i].vI!==-1){vI=columnIndexes[i].vI+1;this._fixColumnByVisibleIndex(vI,colWidth,isI,false,{inMCHGroup:inMCHGroup,colIdentifier:colKey,isGroupHeader:isGroupHeader,dataIndexAt:indexAt},vIndexAt);if(hasTarget){vIndexAt++}inMCHGroup=false}col=cols.splice(columnIndexes[i].cI,1);if(!hasTarget){cols.splice(initialFixedColumnsLength+i,0,col[0])}else{at=columnIndexAt+i;cols.splice(at,0,col[0])}grid._onColumnFixed(columnIndexes[i].cI,true,initialFixedColumnsLength+i+1,isI,vI,at);if(isI&&vI!==-1){isI=false}}if(isInit){if(grid.options.height===null){if($.ig.util.isIE&&$.ig.util.browserVersion>=9){this._syncTableHeights()}}if(this._containers&&this._containers.body){if(this.options.fixingDirection==="left"){this._containers.body.unfixedTable.addClass(this.css.unfixedTableLeft)}else{this._containers.body.unfixedTable.addClass(this.css.unfixedTableRight)}}}grid._visibleColumnsArray=undefined;grid._updateHeaderColumnIndexes();if(grid.options.width===null&&grid._fixedColumns.length===1){gridWidth=grid.container().outerWidth();grid.container().width(gridWidth)}grid._columnMovingResets();this._updateGridColWidths();grid._hscrollbarcontent().scrollLeft(0);this._changeStyleHeaderButton(colKey,true,isGroupHeader);if(shoulRerendedColgroups){grid._rerenderColgroups();this._updateHScrollbarWidth()}grid._adjustLastColumnWidth(true);this._syncHScrollbarHeight();if(virtualization){this._updateContinuousHScrollbar();grid._resetVirtualDom();if(isInit){this._attachVirtualizationEvents();if(this.options.fixingDirection==="right"){this._adjustVirtualizationContainers(true)}}if(this.options.fixingDirection==="right"){this._containers.header.unfixedTable.css(grid._padding,"");this._containers.footer.unfixedTable.css(grid._padding,"")}if(this._isContinuousVirtualization()){this._syncScrollTop()}grid._hscrollbarcontent().css("overflow-y","hidden")}if(this.options.syncRowHeights){this._checkSyncTablesHeights()}this._checkAndRenderHeightCompensateContainer();this._trigger("_columnFixed",null,{columnIdentifier:colIdentifier,isGroupHeader:isGroupHeader,at:columnIndexAt,len:children.length});return res},_syncScrollTop:function(){if(!this._containers||!this._containers.body){this._populateContainers()}var top,$scrollContainer=this._containers.body.unfixedContainer,$fixedBodyContainer=this._containers.body.fixedContainer;top=$scrollContainer.scrollTop();$fixedBodyContainer.scrollTop(top)},_attachVirtualizationEvents:function(){var grid=this.grid;grid.fixedBodyContainer().bind({mouseenter:function(){grid._isMouseOverVirtualTable=true},mouseleave:function(){grid._isMouseOverVirtualTable=false}})},_checkAndRenderHeightCompensateContainer:function(){var grid=this.grid,scH,h,$fc=grid.fixedContainer(),$div=$fc.find("div[data-height-compensate]");if($div.length||!grid.element.is(":visible")){return}scH=grid.scrollContainer().height();h=scH-grid.element.outerHeight();if(h>this.scrollContainerCheckValue&&scH-$fc.height()>this.scrollContainerCheckValue){$('<div data-height-compensate="true"></div>').css("height",h).appendTo(grid.fixedContainer())}},fixDataSkippedColumns:function(){var i,dataSkippedColsLength,isMCH=this.grid._isMultiColumnGrid,hasDataSkippedColumns=this._hasDataSkippedColumns();if(this.options.fixingDirection==="left"&&hasDataSkippedColumns){dataSkippedColsLength=this._getDataSkippedColumnsLength();if(dataSkippedColsLength>0){this.grid._hasFixedDataSkippedColumns=true}for(i=0;i<dataSkippedColsLength;i++){this._fixColumnByVisibleIndex(1,null,i===0,true);this.grid._onColumnFixed(-1,true,0,i===0)}if(isMCH){this._fixMultiColumnHeaderDataSkip()}if(this.grid.options.height===null){if($.ig.util.isIE&&$.ig.util.browserVersion>=9){this._syncTableHeights()}}if(this.grid.options.height===null){this._checkAndRenderHeightCompensateContainer()}this.grid._updateGridContentWidth();if(this.options.syncRowHeights){this._checkSyncTablesHeights()}if(this._isVirtualGrid()){this.grid._hscrollbarcontent().css("overflow-y","hidden")}if(this.grid._hasFixedDataSkippedColumns){this._trigger("_dataSkipColumnFixed",null)}this._syncHScrollbarHeight()}},_fixColumnByVisibleIndex:function(visibleIndex,colWidth,isInit,isDataSkip,MCHParams,indexAt){var grid=this.grid,inMCHGroup,colIdentifier,isGroupHeader,isMCH=grid._isMultiColumnGrid,isGridWidthPercentage=$.type(grid.options.width)==="string"&&grid.options.width.indexOf("%")!==-1,isToShowHeader=grid.options.showHeader,isToShowFooter=grid.options.showFooter,containerBody=this._containers.body,containerHeader=this._containers.header,containerFooter=this._containers.footer;if(MCHParams){inMCHGroup=MCHParams.inMCHGroup;colIdentifier=MCHParams.colIdentifier;isGroupHeader=MCHParams.isGroupHeader}if(!containerHeader){containerHeader=containerBody}if(!containerFooter){containerFooter=containerBody}this._getElementsByDOM(visibleIndex,containerHeader.unfixedTable.children("thead"),"header",isInit,isDataSkip);this._getElementsByDOM(visibleIndex,containerBody.unfixedTable.children("tbody"),"body",isInit,isDataSkip);this._getElementsByDOM(visibleIndex,containerFooter.unfixedTable.children("tfoot"),"footer",isInit,isDataSkip);this._getColgroups(visibleIndex);if(isInit&&this.options.syncRowHeights){this._setRowHeightsByContainer("header");this._setRowHeightsByContainer("body");this._setRowHeightsByContainer("footer")}if(isDataSkip){inMCHGroup=true;if(this._tds.header.length>0){colWidth=$(this._tds.header[0]).outerWidth()}else if(this._tds.body.length>0){colWidth=$(this._tds.body[0]).outerWidth()}if(colWidth===null){colWidth=containerHeader.unfixedTable.find("thead").find("tr:not([data-skip]):first>th:nth-child("+visibleIndex+")").outerWidth()}}if(isInit){this._syncUnfixedWidth(colWidth);this._renderMainFixedContainer(colWidth)}else if(inMCHGroup){this._syncWidth(colWidth)}if(!($.ig.util.isFF&&isGridWidthPercentage)){this._tds.header.detach()}this._tds.body.detach();this._tds.footer.detach();this._detachColgroups();this._attachColgroups(false,indexAt);this._fixBodyColumn(isInit,indexAt);if(isToShowFooter){this._fixFooterColumn(isInit,indexAt)}if(isToShowHeader){if(isMCH){if(inMCHGroup){this._fixMultiColumnHeader(colIdentifier,isInit,isGroupHeader,indexAt)}}this._fixHeaderColumn(isInit,indexAt);if(this.options.syncRowHeights&&this._heights){this._syncHeights(this._heights.header,containerHeader.fixedTable.find("thead").eq(0))}}},_hasDataSkippedColumns:function(isFixed){if(this._hasDataSkippedColumn!==undefined){return this._hasDataSkippedColumn}this._hasDataSkippedColumn=this._getDataSkippedColumnsLength(isFixed)>0;return this._hasDataSkippedColumn},_getDataSkippedColumnsLength:function(isFixed){if(!this._containers||!this._containers.body){this._populateContainers()}var $table=this._containers.body.unfixedTable;if(isFixed){$table=this._containers.body.fixedTable}return $table.find("colgroup col[data-skip]").length},_renderVirtualFixedContainer:function(colWidth){var self=this,grid=this.grid,gridId=grid.id(),$col,cssClass,$colgroup,$trHeader,$trBody,$trFooter,leftFixingDirection=true,fixingDirection="left",$vContainer=grid._virtualcontainer(),functionRenderContainer,fixedBodyTable,fixedHeaderContainer,fixedFooterContainer,fixedBodyContainer,scrollContainer,headerContainer,footerContainer,oTable,scrollContainerHeight;
$colgroup=$vContainer.find("colgroup:first");$trHeader=this._containers.header.unfixedContainer.closest("tr");$trBody=this._containers.body.unfixedContainer.closest("tr");$trFooter=this._containers.footer.unfixedContainer.closest("tr");scrollContainer=this._containers.body.unfixedContainer;cssClass=this.css.leftFixedContainer;if(this.options.fixingDirection==="right"){cssClass=this.css.rightFixedContainer;leftFixingDirection=false;fixingDirection="right"}colWidth=colWidth+"px";$col=$('<col width="'+colWidth+'" data-fixed-col="'+this.options.fixingDirection+'"></col>');if(leftFixingDirection){$col.prependTo($colgroup)}else{$col.insertBefore($colgroup.find("col:last"))}functionRenderContainer=function(fixedContainerId,$container,type,$tr){var $fixedContainer,$fixedTable,$td;oTable=$container.find("table");$td=$('<td data-fixed-container="true" style="border-width: 0px;"></td>');if(leftFixingDirection){$td.prependTo($tr)}else{$tr.find("td:first").removeAttr("colspan");if(type==="body"){$td.insertBefore($tr.find("td:last"))}else{$td.attr("colspan",2);$td.appendTo($tr)}}$fixedContainer=$('<div id="'+fixedContainerId+'" data-scroll="true" data-fixing-direction="'+fixingDirection+'" class="'+cssClass+'" data-fixed-container="true"></div>').appendTo($td);$fixedTable=$('<table id="'+oTable.attr("id")+'_fixed" class="'+oTable.attr("class")+'" style="table-layout:fixed; width: '+colWidth+';" border=0 cellpadding=0 cellspacing=0><colgroup /></table>').appendTo($fixedContainer);self._containers[type].fixedContainer=$fixedContainer;self._containers[type].fixedTable=$fixedTable;$fixedContainer.css({overflow:"hidden",position:"relative"});if(!leftFixingDirection&&type!=="body"){$fixedTable.css(grid._padding,$colgroup.find("col:last").attr("width")+"px")}return $fixedContainer};fixedBodyContainer=functionRenderContainer(gridId+"_fixedBodyContainer",this._containers.body.unfixedContainer,"body",$trBody);if(grid.options.height!==null&&$.ig.util.isIE){fixedBodyContainer.find("table").height(scrollContainer.find("table").height())}if(grid.options.height===null){scrollContainerHeight="100%"}else{scrollContainerHeight=scrollContainer.height();if(this.grid._hscrollbar().is(":visible")){scrollContainerHeight+=this.grid._hscrollbar().outerHeight()}}fixedBodyContainer.height(scrollContainerHeight);fixedBodyTable=fixedBodyContainer.find("table");$("<tbody />").appendTo(fixedBodyTable);if(grid.options.showHeader){if(grid.options.fixedHeaders&&grid.options.height!==null){headerContainer=this._containers.header.unfixedContainer;fixedHeaderContainer=functionRenderContainer(gridId+"_fixedHeaderContainer",headerContainer,"header",$trHeader);$("<thead />").appendTo(fixedHeaderContainer.find("table"));grid._renderFixedCaption()}else{$("<thead />").insertBefore(fixedBodyContainer.find("tbody"))}}if(grid.options.showFooter){if(grid.options.fixedFooters&&grid.options.height!==null){footerContainer=this._containers.footer.unfixedContainer;fixedFooterContainer=functionRenderContainer(gridId+"_fixedFooterContainer",footerContainer,"footer",$trFooter);$("<tfoot />").appendTo(fixedFooterContainer.find("table"));this._containers.footer.fixedTable.css("whiteSpace",this._containers.footer.unfixedTable.css("whiteSpace"))}else{$('<tfoot role="rowgroup"/>').insertAfter(fixedBodyContainer.find("tbody"))}}grid._fixedTable=fixedBodyTable;if(this._isContinuousVirtualization()){scrollContainer.bind({scroll:function(){var top=$(this).scrollTop();fixedBodyContainer.scrollTop(top)}})}else{grid._hscrollbar().detach().insertAfter(this._containers.body.unfixedContainer)}},_renderMainFixedContainer:function(colWidth){if(this._isVirtualGrid()){this._renderVirtualFixedContainer(colWidth);return}var self=this,grid=this.grid,gridId=grid.id(),diff,functionRenderContainer,fixedBodyTable,fixedHeaderContainer,fixedFooterContainer,fixingDirection,syncScrollContainers,$mainFixedContainer,fixedBodyContainer,mainFixedContainerId=grid.id()+"_mainFixedContainer",scrollContainer,virtualization=this._isVirtualGrid(),headerContainer,footerContainer,oTable,scrollContainerHeight;$mainFixedContainer=$('<div id="'+mainFixedContainerId+'" data-fixed-container="true"></div>');$mainFixedContainer.css({overflow:"hidden",position:"relative"});scrollContainer=this._containers.body.unfixedContainer;$mainFixedContainer.addClass(this.css.fixedContainer);fixingDirection="left";if(this.options.fixingDirection==="left"){fixingDirection="left";$mainFixedContainer.addClass(this.css.leftFixedContainer);if(this._containers.header){$mainFixedContainer.insertBefore(this._containers.header.unfixedContainer)}else{$mainFixedContainer.insertBefore(scrollContainer)}$mainFixedContainer.css({"float":"left",left:0})}else if(this.options.fixingDirection==="right"){fixingDirection="right";$mainFixedContainer.addClass(this.css.rightFixedContainer);if(virtualization){$mainFixedContainer.insertBefore(this.grid._virtualcontainer())}else{if(this._containers.header){$mainFixedContainer.insertBefore(this._containers.header.unfixedContainer)}else{$mainFixedContainer.insertBefore(scrollContainer)}}$mainFixedContainer.css({"float":"right",right:0})}$mainFixedContainer.attr("data-fixing-direction",fixingDirection);$mainFixedContainer.bind(this.grid._mouseClickEventHandlers);colWidth="width:"+colWidth+"px";functionRenderContainer=function(fixedContainerId,$container,type){var $fixedContainer,$fixedTable;oTable=$container.find("table");$fixedContainer=$('<div id="'+fixedContainerId+'" data-scroll="true" data-fixed-container="true"></div>').appendTo($mainFixedContainer);$fixedTable=$('<table id="'+oTable.attr("id")+'_fixed" class="'+oTable.attr("class")+'" style="table-layout:fixed; '+colWidth+'" border=0 cellpadding=0 cellspacing=0><colgroup /></table>').appendTo($fixedContainer);self._containers[type].fixedContainer=$fixedContainer;self._containers[type].fixedTable=$fixedTable;$fixedContainer.css({overflow:"hidden",position:"relative"});return $fixedContainer};fixedBodyContainer=functionRenderContainer(gridId+"_fixedBodyContainer",scrollContainer,"body");fixedBodyContainer.attr("data-fixing-direction",fixingDirection);if(grid.options.height!==null&&$.ig.util.isIE){fixedBodyContainer.find("table").height(scrollContainer.find("table").height())}if(grid.options.height===null){scrollContainerHeight="100%"}else{scrollContainerHeight=scrollContainer.height();if(this.grid._hscrollbar().is(":visible")){scrollContainerHeight+=this.grid._hscrollbar().outerHeight()}}fixedBodyContainer.height(scrollContainerHeight);fixedBodyTable=fixedBodyContainer.find("table");$("<tbody />").appendTo(fixedBodyTable);if(grid.options.showHeader){if(grid.options.fixedHeaders&&grid.options.height!==null){headerContainer=this._containers.header.unfixedContainer;fixedHeaderContainer=functionRenderContainer(gridId+"_fixedHeaderContainer",headerContainer,"header");$("<thead />").appendTo(fixedHeaderContainer.find("table"));fixedHeaderContainer.prependTo($mainFixedContainer);grid._renderFixedCaption()}else{if(grid.element.find("thead").next().is("tbody")){$("<thead />").insertBefore(fixedBodyContainer.find("tbody"))}else{if(grid.element.find("thead").prev().is("colgroup")){$("<thead />").insertAfter(fixedBodyContainer.find("colgroup"))}else{$("<thead />").insertAfter(fixedBodyContainer.find("tbody"))}}}}if(grid.options.showFooter){if(grid.options.fixedFooters&&grid.options.height!==null){footerContainer=this._containers.footer.unfixedContainer;fixedFooterContainer=functionRenderContainer(gridId+"_fixedFooterContainer",footerContainer,"footer");$('<tfoot role="rowgroup" />').appendTo(fixedFooterContainer.find("table"));this._containers.footer.fixedTable.css("whiteSpace",this._containers.footer.unfixedTable.css("whiteSpace"));fixedFooterContainer.appendTo($mainFixedContainer)}else{$('<tfoot role="rowgroup" />').insertAfter(fixedBodyContainer.find("tbody"))}}grid._fixedTable=fixedBodyTable;if(this.options.fixingDirection==="right"){fixedBodyContainer.css({"overflow-y":"auto"});scrollContainer.css({"overflow-y":"hidden"})}syncScrollContainers=function(direction){var scrollTop=fixedBodyContainer.scrollTop();scrollTop+=-direction*self.options.scrollDelta;if(scrollTop<=0){scrollTop=0}fixedBodyContainer.scrollTop(scrollTop);scrollContainer.scrollTop(scrollTop)};this._onMouseWheelHandler=function(event){var evt,direction,w,d,st;evt=event.originalEvent;w=evt.wheelDelta;d=evt.detail;if(d){if(w){direction=w/d/40*d>0?1:-1}else{direction=-d/3}}else{direction=w/120}st=fixedBodyContainer.scrollTop();syncScrollContainers(direction);if(grid.options.height===null||st===fixedBodyContainer.scrollTop()){return true}return false};this._DOMMouseScroll=function(event){var dir=-1,delta;delta=-event.originalEvent.detail/3;if(delta>0){dir=1}syncScrollContainers(dir);if(grid.options.height===null){return true}event.preventDefault()};this._onKeyDown=function(event){var isUp=event.keyCode===$.ui.keyCode.UP,isDown=event.keyCode===$.ui.keyCode.DOWN;if(isUp){syncScrollContainers(1)}else if(isDown){syncScrollContainers(-1)}};if(grid.element.igScroll!==undefined&&(typeof Modernizr==="object"&&Modernizr.touch===true||window.PointerEvent||window.navigator.msPointerEnabled)){fixedBodyContainer.igScroll({scrolled:function(){syncScrollContainers(0)},stopped:function(){syncScrollContainers(0)}});fixedBodyContainer.css("-ms-touch-action","none")}if($.ig.util.isIE||this.options.fixingDirection==="right"){scrollContainer.bind({"keydown.columnFixing":this._onKeyDown,"mousewheel.columnFixing":this._onMouseWheelHandler,"DOMMouseScroll.columnFixing":this._DOMMouseScroll})}scrollContainer.bind({"scroll.columnFixing":function(){var top=$(this).scrollTop();fixedBodyContainer.scrollTop(top)}});fixedBodyContainer.bind({scroll:function(){var fTop=fixedBodyContainer.scrollTop(),sTop=scrollContainer.scrollTop();if(fTop!==sTop){scrollContainer.scrollTop(fTop)}},mousewheel:this._onMouseWheelHandler,DOMMouseScroll:this._DOMMouseScroll});if(this.options.fixingDirection==="right"){fixedBodyContainer.bind({keydown:this._onMouseWheelHandler})}if(grid.options.width===null){diff=parseFloat($mainFixedContainer.css("borderRightWidth"));if(diff>0){this._syncUnfixedWidth(diff)}}},_getElementsByDOM:function(visibleIndex,$DOM,type,isInit,isDataSkipped){var self=this,$TRS=$DOM.find("tr");if(isInit&&this.options.syncRowHeights){if(!self._heights){self._heights={}}self._heights[type]=[];$TRS.each(function(ind,tr){self._heights[type].push({h:tr.offsetHeight,tr:tr})})}if(type==="header"){this._tds[type]=$DOM.find("tr:not([data-mch-level],[data-skip]) th:nth-child("+visibleIndex+"),tr:not([data-mch-level],[data-skip]) td:nth-child("+visibleIndex+")")}else if(isDataSkipped){this._tds[type]=$DOM.find("th:nth-child("+visibleIndex+"), td:nth-child("+visibleIndex+")")}else{this._tds[type]=$DOM.find("td:nth-child("+visibleIndex+")")}},_getColgroups:function(visibleIndex,isFixed){var $bodyTable=this._containers.body.unfixedTable,$headerTable,$footerTable;if(isFixed){$bodyTable=this._containers.body.fixedTable}this._getColgroup(visibleIndex,$bodyTable,"body");if(this._containers.header){if(isFixed){$headerTable=this._containers.header.fixedTable}else{$headerTable=this._containers.header.unfixedTable}this._getColgroup(visibleIndex,$headerTable,"header")}if(this._containers.footer){if(isFixed){$footerTable=this._containers.footer.fixedTable}else{$footerTable=this._containers.footer.unfixedTable}this._getColgroup(visibleIndex,$footerTable,"footer")}},_getColgroup:function(visibleIndex,$DOM,type){var $cols=$DOM.find("colgroup col:nth-child("+visibleIndex+")");this._colgroups[type]=$cols},_detachColgroups:function(){this._colgroups.body.detach();if(this._colgroups.header){this._colgroups.header.detach()}if(this._colgroups.footer){this._colgroups.footer.detach()}},_attachColgroups:function(isFixed,indexAt){var cols=this._colgroups.body,$bodyTable,$headerTable,$footerTable;if(isFixed){$bodyTable=this._containers.body.unfixedTable}else{$bodyTable=this._containers.body.fixedTable}this._attachColgroup(cols,$bodyTable,isFixed,indexAt);if(this._colgroups.header&&this._colgroups.header.length>0){if(isFixed){$headerTable=this._containers.header.unfixedTable}else{$headerTable=this._containers.header.fixedTable}cols=this._colgroups.header;this._attachColgroup(cols,$headerTable,isFixed,indexAt)}if(this._colgroups.footer&&this._colgroups.footer.length>0){if(isFixed){$footerTable=this._containers.footer.unfixedTable}else{$footerTable=this._containers.footer.fixedTable}cols=this._colgroups.footer;this._attachColgroup(cols,$footerTable,isFixed,indexAt)}},_attachColgroup:function(cols,$table,isFixed,indexAt){var i,$col,dataSkippedColsLength,colsLength=cols.length,$colgroup=$table.find("colgroup"),insertAfter;if(!_aNull(indexAt)){indexAt++;insertAfter=false;if(indexAt>$colgroup.children("col").length){indexAt=$colgroup.children("col").length;insertAfter=true}$col=$colgroup.children("col:nth-child("+indexAt+")");if(!$col.length){return}for(i=0;i<colsLength;i++){if(insertAfter){cols.insertAfter($col)}else{cols.insertBefore($col)}}return}if(isFixed&&this._hasDataSkippedColumns(true)&&this.options.fixingDirection==="right"){dataSkippedColsLength=this._getDataSkippedColumnsLength();for(i=0;i<colsLength;i++){$(cols[i]).insertAfter($colgroup.find("col").eq(dataSkippedColsLength-1))}}else{for(i=0;i<colsLength;i++){if(isFixed){$(cols[i]).prependTo($colgroup)}else{$(cols[i]).appendTo($colgroup)}}}},_setRowHeightsByContainer:function(type){var i,heights=this._heights[type],heightsLength=heights.length;for(i=0;i<heightsLength;i++){heights[i].tr.style.height=heights[i].h+"px"}},_syncRowStyles:function(){var i,fixedRow,unfixedRow,container=this._containers.body,$unfixedTable=container.unfixedTable,$fixedTable=container.fixedTable,fixedRows=$fixedTable.find("tbody tr"),unfixedRows=$unfixedTable.find("tbody tr"),rowsLength=fixedRows.length;for(i=0;i<rowsLength;i++){fixedRow=fixedRows[i];unfixedRow=unfixedRows[i];fixedRow.setAttribute("style",unfixedRow.getAttribute("style"));fixedRow.setAttribute("class",unfixedRow.getAttribute("class"))}},_populateContainers:function(){var gridId=this.grid.id(),grid=this.grid,self=this,virtualization=this._isVirtualGrid(),$unfixedHeaders=this.grid.container().find("#"+gridId+"_headers"),$unfixedFooters=this.grid.container().find("#"+gridId+"_footer_container"),$fixedBodyContainer=this.grid.container().find("#"+gridId+"_fixedBodyContainer"),functionPopulateContainers,scrollContainer;if(virtualization){scrollContainer=this.grid._vdisplaycontainer()}else{scrollContainer=this.grid.scrollContainer()}if(scrollContainer.length===0){scrollContainer=this.grid.element}this._containers={};functionPopulateContainers=function($unfixedContainer,$fixedContainer,type){var $unfixedTable=$unfixedContainer.find("table"),$fixedTable=grid.container().find("#"+$unfixedTable.attr("id")+"_fixed");if($unfixedTable.length===0){$unfixedTable=$unfixedContainer}self._containers[type]={fixedContainer:$fixedContainer,unfixedContainer:$unfixedContainer,fixedTable:$fixedTable,unfixedTable:$unfixedTable}};if($unfixedHeaders.length>0){functionPopulateContainers($unfixedHeaders.parent("div"),grid.fixedHeaderContainer(),"header")}functionPopulateContainers(scrollContainer,$fixedBodyContainer,"body");if($unfixedFooters.length>0&&$unfixedFooters[0].nodeName!=="TFOOT"){functionPopulateContainers($unfixedFooters,grid.fixedFooterContainer(),"footer")}},_fixMultiColumnHeaderDataSkip:function(){var i,$th,dataSkippedColsLength,$unfixedThead,$fixedThead,maxLevel=this.grid._maxLevel,container=this._containers.header;if(!container){container=this._containers.body}$unfixedThead=container.unfixedTable.find("thead");$fixedThead=this.grid.container().find("#"+container.unfixedTable.attr("id")+"_fixed").find("thead");if(this._hasDataSkippedColumns()&&this.options.fixingDirection==="left"){dataSkippedColsLength=this._getDataSkippedColumnsLength(true);for(i=0;i<dataSkippedColsLength;i++){$th=$unfixedThead.find("tr[data-mch-level="+maxLevel+"] th[data-skip]:nth-child(1)");$th.detach();$th.appendTo($fixedThead.find("tr[data-mch-level="+maxLevel+"]"))}}},_fixMultiColumnHeader:function(colInd,isInit,isGroupHeader,indexAt){var grid=this.grid,i,cols,gridId=grid.id(),$th,maxLevel,$fixedThead,$unfixedThead,fixedTable,oTable,container=this._containers.header;if(!container){container=this._containers.body}oTable=container.unfixedTable;$unfixedThead=oTable.find("thead");fixedTable=this.grid.container().find("#"+oTable.attr("id")+"_fixed");if(fixedTable.length===0){fixedTable=container.fixedTable}$fixedThead=fixedTable.find("thead");maxLevel=grid._maxLevel;if(isInit){$unfixedThead.find("tr[data-mch-level]").each(function(ci,tr){var attr=tr.attributes,attrStr="";if(attr){for(i=0;i<attr.length;i++){attrStr+=" "+attr[i].name+'="'+attr[i].value+'"'}}$("<tr"+attrStr+"></tr>").appendTo($fixedThead)})}if(!_aNull(indexAt)){this._fixUnfixMCHColumn(colInd,{fixedThead:$fixedThead,unfixedThead:$unfixedThead,isToFix:true});return}if(isGroupHeader){cols=grid._oldCols;for(i=0;i<cols.length;i++){if(cols[i].identifier===colInd){cols[i].fixed=true;this._renderMCHColumn(cols[i],$fixedThead,$unfixedThead);break}}}else{$th=this.grid.container().find("#"+gridId+"_"+colInd);$th.detach();$th.appendTo($fixedThead.find("tr[data-mch-level="+maxLevel+"]"))}},_renderMCHColumn:function(el,$fixedHeader,$unfixedHeader){var level=el.level,domLevel,children,i,$th;if(level===0){$th=this.grid.container().find("#"+this.grid.id()+"_"+el.key)}else{$th=$unfixedHeader.find("th[data-mch-id="+el.identifier+"]");children=el.group}domLevel=$th.closest("tr").attr("data-mch-level");$th.detach();$th.appendTo($fixedHeader.find("tr[data-mch-level="+domLevel+"]"));if(level>0){for(i=0;i<children.length;i++){this._renderMCHColumn(children[i],$fixedHeader,$unfixedHeader)}}},_fixUnfixMCHColumn:function(colInd,fixingParams){var i,grid=this.grid,oCols=grid._oldCols,col,fixedThead=fixingParams.fixedThead,unfixedThead=fixingParams.unfixedThead,isToFix=fixingParams.isToFix,area=isToFix?fixedThead:unfixedThead,mchInstance=grid.element.data("igGridMultiColumnHeaders");if(!mchInstance){return}for(i=0;i<oCols.length;i++){if(oCols[i].identifier===colInd||oCols[i].key===colInd){col=oCols[i];col.fixed=isToFix;break}}if(i===oCols.length){return}mchInstance._rows={};mchInstance._analyzeRowspanRows(this._getColumnsByState(isToFix),0);this._fixUnfixMCHColumnRecursive(col,mchInstance._rows,area,isToFix)},_fixUnfixMCHColumnRecursive:function(col,rows,area,isToFix){var grid=this.grid,$th,i,j,level=col.level,id,domLevel,cells,$targetTh,children;if(level===0){id=col.key;$th=grid.container().find("#"+this.grid.id()+"_"+col.key)}else{id=col.identifier;$th=grid.container().find("th[data-mch-id="+col.identifier+"]")}domLevel=parseInt($th.closest("tr").attr("data-mch-level"),10);cells=rows[domLevel];if(cells){for(i=0;i<cells.length;i++){if(cells[i].identifier===id||cells[i].key===id){col.fixed=isToFix;$th.detach();if(!cells[i+1]){$th.appendTo(area.find("tr[data-mch-level="+domLevel+"]"))}else{if(_aNull(cells[i+1].key)){$targetTh=area.find("th[data-mch-id="+cells[i+1].identifier+"]")}else{$targetTh=area.find("#"+grid.id()+"_"+cells[i+1].key)}if(!$targetTh.length){i+=2;for(j=i;j<cells.length;j++){if(_aNull(cells[j].key)){$targetTh=area.find("th[data-mch-id="+cells[j].identifier+"]")}else{$targetTh=area.find("#"+grid.id()+"_"+cells[j].key)}if(!$targetTh.length){$targetTh=null}else{break}}if($targetTh&&$targetTh.length){$th.insertBefore($targetTh)}else{$th.appendTo(area.find("tr[data-mch-level="+domLevel+"]"))}}else{$th.insertBefore($targetTh)}}break}}}children=col.group;if(children){for(i=0;i<children.length;i++){this._fixUnfixMCHColumnRecursive(children[i],rows,area,isToFix)}}},_fixHeaderColumn:function(isInit,indexAt){var self=this,$fixedThead,$tr,syncRowHeights=this.options.syncRowHeights===true,$fixedTable,tdsFirst,$unfixedThead,$unfixedTable,heights,container=this._containers.header;if(!container){container=this._containers.body}$unfixedTable=container.unfixedTable;$fixedTable=container.fixedTable;$unfixedThead=$unfixedTable.find("thead");$fixedThead=$fixedTable.find("thead");tdsFirst=this._tds.header;if(!isInit){this._fixUnfixDOM($fixedTable.children("thead"),tdsFirst,true,indexAt)}else{if(syncRowHeights){heights=self._heights.header}$unfixedThead.find("tr:not([data-mch-level])").each(function(ci,tr){var i,$td=$(tdsFirst[ci]),attr=tr.attributes,attrStr="";if(attr){for(i=0;i<attr.length;i++){attrStr+=" "+attr[i].name+'="'+attr[i].value+'"'}}$tr=$("<tr"+attrStr+"></tr>").appendTo($fixedThead);$td.appendTo($tr);if(syncRowHeights){this.style.height=heights[ci].h+"px"}})}},_fixBodyColumn:function(isInit,indexAt){var grid=this.grid,i,heights,$trsUnfixed,$trs,trsLength,tr,$fixedTable,tdsFirst,$unfixedTable,syncDataIds,dataId,container=this._containers.body;$unfixedTable=container.unfixedTable;$fixedTable=container.fixedTable;tdsFirst=this._tds.body;if(isInit){$trsUnfixed=$unfixedTable.find("tbody>tr");trsLength=$trsUnfixed.length;this._renderFixedRecords($fixedTable,0,trsLength-1,true,$trsUnfixed);$trs=$fixedTable.find("tbody>tr");syncDataIds=false;if(trsLength!==grid.dataSource.dataView().length){syncDataIds=true;$trsUnfixed=$unfixedTable.find("tbody>tr")}for(i=0;i<trsLength;i++){tr=$trs[i];$(tdsFirst[i]).appendTo(tr);if(syncDataIds){dataId=$trsUnfixed[i].getAttribute("data-id");if(dataId){tr.setAttribute("data-id",dataId)}}}if(this.options.syncRowHeights){heights=this._heights.body;for(i=0;i<trsLength;i++){$trs[i].style.height=heights[i].h+"px"}}}else{this._fixUnfixDOM($fixedTable.children("tbody"),tdsFirst,true,indexAt)}this._updateHScrollbarWidth();if(grid.options.width===null&&$unfixedTable[0].style.width===""){$unfixedTable[0].style.width=$unfixedTable.outerWidth()+"px"}if(isInit&&this.grid.options.enableHoverStyles){this._attachHoverEvents()}},_fixUnfixDOM:function(area,tds,isToFix,indexAt){var i,trs=area.children("tr:not([data-mch-level],[data-skip])"),tdsLength=tds.length,$tr0,target,skip,insertAfter=false;if(!tdsLength){return}if(_aNull(indexAt)){if(isToFix){for(i=0;i<tdsLength;i++){$(tds[i]).appendTo(trs[i])}}else{if(this._hasDataSkippedColumns(true)&&this.options.fixingDirection==="right"){skip=this._getDataSkippedColumnsLength();for(i=0;i<trs.length;i++){$(tds[i]).insertAfter(trs[i].children[skip-1])}}else{trs.each(function(ind,tr){$(tds[ind]).prependTo($(tr))})}}}else{$tr0=$(trs[0]);insertAfter=false;indexAt++;if(indexAt>$tr0.children("td,th").length){indexAt=$tr0.children("td,th").length;insertAfter=true}target=trs.children(":nth-child("+indexAt+")");if(!target.length){return}tds.each(function(index,td){if(insertAfter){$(td).insertAfter(target[index])}else{$(td).insertBefore(target[index])}})}},_fixFooterColumn:function(isInit,indexAt){var heights,$fixedTable,tdsFirst,$tfoot,$unfixedTable,syncRowHeights=this.options.syncRowHeights===true,container=this._containers.footer;if(!container){container=this._containers.body}$unfixedTable=container.unfixedTable;$fixedTable=container.fixedTable;tdsFirst=this._tds.footer;if(!isInit){this._fixUnfixDOM($fixedTable.children("tfoot"),tdsFirst,true,indexAt)}else{$tfoot=$fixedTable.find("tfoot");if(syncRowHeights){heights=this._heights.footer}$unfixedTable.find("tfoot tr").each(function(ci,tr){var i,h,$td=$(tdsFirst[ci]),attr=tr.attributes,$tr,attrValue,attrName,attrStr="";if(attr){for(i=0;i<attr.length;i++){attrName=attr[i].name;attrValue=attr[i].value;if(attrName.toLowerCase()==="id"){attrValue+="_fixed"}attrStr+=" "+attrName+'="'+attrValue+'"'}}$tr=$("<tr"+attrStr+"></tr>").appendTo($tfoot);if(syncRowHeights){h=heights[ci].h;$tr.height(h);this.style.height=h+"px"}$td.appendTo($tr)});if(this._hasDataSkippedColumns()&&this.grid._fixedColumns.length<=1){this._syncRowsHeights(this.grid.footersTable().find("tfoot"),this.grid.fixedFootersTable().find("tfoot"))}}},_dettachHoverEvents:function(){this._populateContainers();var container=this._containers.body,$unfixedTable=container.unfixedTable,$fixedTable=container.fixedTable;$fixedTable.undelegate("tbody",".hoverColumnFixing");$unfixedTable.undelegate("tbody",".hoverColumnFixing")},_attachHoverEvents:function(){this._populateContainers();var container=this._containers.body,$unfixedTable=container.unfixedTable,$fixedTable=container.fixedTable;this._mouseOverHandler=$.proxy(this._mouseOver,this);this._mouseLeaveHandler=$.proxy(this._mouseLeave,this);$fixedTable.delegate("tbody",{"mousemove.hoverColumnFixing":this._mouseOverHandler,"mouseleave.hoverColumnFixing":this._mouseLeaveHandler});$unfixedTable.delegate("tbody",{"mousemove.hoverColumnFixing":this._mouseOverHandler,"mouseleave.hoverColumnFixing":this._mouseLeaveHandler})},_mouseOver:function(event){var css="ui-state-hover",$tr=$(event.target).closest("tr"),grid=this.grid;if(grid._isFixedElement($tr)){grid._mousemoveTr(grid.element.find("tbody tr:nth-child("+($tr.index()+1)+")")[0],event)}if(this._hoverTr){this._hoverTr.find("td,th").removeClass(css)}this._hoverTr=grid.fixedTable().find("tbody tr:nth-child("+($tr.index()+1)+")");this._hoverTr.find("td,th").addClass(css)},_mouseLeave:function(event){var css="ui-state-hover",$tr=$(event.target).closest("tr"),grid=this.grid;if(grid._isFixedElement($tr)){grid._mouseleaveTr(grid.element.find("tbody tr:nth-child("+($tr.index()+1)+")")[0],event)}if(this._hoverTr){this._hoverTr.find("td,th").removeClass(css)}},_syncHScrollbarHeight:function(){var scroller=this.grid._hscrollbarcontent(),hscrollbar=this.grid._hscrollbar(),fixedControllerScrollerId=this.grid.id()+"_fixedContainerScroller",$fixedScroller=this.grid.container().find("#"+fixedControllerScrollerId);if(scroller.length===1&&hscrollbar.is(":visible")&&$fixedScroller.length===0){$('<div style="height:'+hscrollbar.height()+'px" id="'+fixedControllerScrollerId+'"></div>').appendTo(this._containers.body.fixedContainer)}else if($fixedScroller.length===1&&hscrollbar.length===1){if(hscrollbar.is(":visible")){$fixedScroller.show()}else{$fixedScroller.hide()}}},syncRowsHeights:function($trs,$anotherRows){$trs.each(function(ind,tr){var h=$(tr).outerHeight(),hToSync=$($anotherRows[ind]).outerHeight();if(h>hToSync){hToSync=h}$($anotherRows[ind]).height(hToSync);$(tr).height(hToSync)})},_syncRowsHeights:function($container,$containerToSync){var $trs=$container.find("tr"),$trsToSync=$containerToSync.find("tr");this.syncRowsHeights($trs,$trsToSync)},_syncHeights:function(heights,fixedTable){var trs;if(this.options.syncRowHeights){trs=fixedTable.find("tr");$.each(heights,function(ci,elem){var h=elem.h+"px";trs[ci].style.height=h;elem.tr.style.height=h})}},_syncContainerHeights:function(){var $fixedTable,$unfixedTable,containers=this._containers;if(containers&&containers.body){$fixedTable=containers.body.fixedTable;$unfixedTable=containers.body.unfixedTable;if($fixedTable.height()!==$unfixedTable.height()){$fixedTable.height($unfixedTable.height())}}},_syncUnfixedWidth:function(colWidth){var w,$col;this._syncUnfixedWidthByContainer(colWidth,this._containers.body.unfixedTable,this._containers.body.unfixedContainer);if(this._containers.header){this._syncUnfixedWidthByContainer(colWidth,this._containers.header.unfixedTable,this._containers.header.unfixedContainer)}if(this._containers.footer){this._syncUnfixedWidthByContainer(colWidth,this._containers.footer.unfixedTable,this._containers.footer.unfixedContainer)}if(this._isVirtualGrid()){$col=this.grid._virtualcontainer().find("colgroup col:first");w=parseInt($col.attr("width"),10)-colWidth;$col.attr("width",w)}},_adjustVirtualizationContainers:function(isToFix){var funcAdjust,grid=this.grid;if(this.options.fixingDirection==="right"){funcAdjust=function(container){var padding,cWidth,tWidth,$unfixedTable=container.unfixedTable,$unfixedContainer=container.unfixedContainer;padding=grid._scrollbarWidth();if(!isToFix){padding=-padding}cWidth=$unfixedContainer.outerWidth();tWidth=$unfixedTable.outerWidth();$unfixedContainer.width(cWidth-padding);$unfixedTable.width(tWidth-padding);if(isToFix){$unfixedTable.css(grid._padding,"")}else{$unfixedTable.css(grid._padding,-padding+"px")}};funcAdjust(this._containers.header);funcAdjust(this._containers.footer)}},_syncUnfixedWidthByContainer:function(colWidth,$unfixedTable,scrollContainer){if($unfixedTable.length===0){return}var scWidth,w=$unfixedTable[0].style.width,oTableWidth=parseInt(w,10),virtGrid=this._isVirtualGrid();if(!virtGrid||w!==""&&!(w.indexOf&&w.indexOf("%")>-1)){if(isNaN(oTableWidth)){oTableWidth=$unfixedTable.outerWidth()}oTableWidth-=colWidth;$unfixedTable[0].style.width=oTableWidth+"px"}if(virtGrid){scWidth=parseInt(scrollContainer[0].style.width,10);if(isNaN(scWidth)){scWidth=scrollContainer.outerWidth()}scWidth-=colWidth;scrollContainer.width(scWidth)}},_syncVirtualizationWidth:function(colWidth){var grid=this.grid,gridId=grid.id(),$fixedFooterContainer,scrollContainer=grid._vdisplaycontainer(),$unfixedHeaders=grid.container().find("#"+gridId+"_headers"),$unfixedFooters=grid._fixedfooters(),$fixedBodyContainer=grid.fixedBodyContainer();if($unfixedHeaders.length>0){this._updateContainersWidth(colWidth,$unfixedHeaders.parent("div"),grid.fixedHeaderContainer(),true)}this._updateContainersWidth(colWidth,scrollContainer,$fixedBodyContainer,true);if($unfixedFooters.length>0){$fixedFooterContainer=grid.fixedFooterContainer();if($fixedFooterContainer.length>0){this._updateContainersWidth(colWidth,$unfixedFooters,$fixedFooterContainer,true)}}this._syncFixedVirtualizationColgroup(colWidth)},_updateFixedGridContentWidth:function(){var fixedContainerWidth=0,gridW,gridInnerWidth,grid=this.grid,$colFixed,wDelta;if(!grid._gridHasWidthInPixels()){return}$.each(grid._fixedColumns,function(index,col){var colW;if(!col.width||col.width.charAt&&col.width.endsWith("%")||col.hidden){return true}colW=parseInt(col.width,10);if(col.fixed===true){fixedContainerWidth+=colW}});gridW=parseInt(grid.options.width,10);if(this._isVirtualGrid()){$colFixed=grid._virtualcontainer().find("colgroup:first col[data-fixed-col]");wDelta=fixedContainerWidth-parseInt($colFixed.attr("width"),10);this._syncWidth(wDelta);gridInnerWidth=grid._vdisplaycontainer().outerWidth();grid._gridInnerWidth=gridInnerWidth;grid._hscrollbar().css("width",gridInnerWidth+"px");grid._updateHScrollbarVisibility();this._updateHScrollbarWidth()}else{this._setGridFixedTablesWidth(fixedContainerWidth);gridW=parseInt(grid.options.width,10);gridInnerWidth=gridW-parseInt(grid.fixedContainer().outerWidth(),10);grid._hscrollbar().css("width",gridInnerWidth+"px");if(grid.options.height!==null){grid._gridInnerWidth=gridInnerWidth;grid._gridInnerWidth=grid.scrollContainer().width();grid._updateHScrollbarVisibility()}}},_syncFixedVirtualizationColgroup:function(colWidthDelta){var w,$colFixed,$colUnfixed,$colgroup;$colgroup=this.grid._virtualcontainer().find("colgroup:first");$colFixed=$colgroup.find("col[data-fixed-col]");$colUnfixed=$colgroup.find("col:not(:last):not([data-fixed-col])");w=parseInt($colFixed.attr("width"),10);$colFixed.attr("width",w+colWidthDelta);w=parseInt($colUnfixed.attr("width"),10);$colUnfixed.attr("width",w-colWidthDelta)},_setGridFixedTablesWidth:function(width){var grid=this.grid,hasFixedHeaders=grid.options.showHeader&&grid.options.fixedHeaders===true&&grid.options.height!==null,hasFixedFooters=grid.options.showFooter&&grid.options.fixedFooters===true&&grid.options.height!==null;grid.fixedTable().width(width);if(hasFixedHeaders){grid.fixedHeadersTable().width(width)}if(hasFixedFooters){grid.fixedFootersTable().width(width)}},_syncWidth:function(colWidth){if(this._isVirtualGrid()){this._syncVirtualizationWidth(colWidth);return}var grid=this.grid,gridId=grid.id(),scrollContainer,$fixedFooterContainer,updateFixedTable=true,$unfixedHeaders=grid.container().find("#"+gridId+"_headers"),$unfixedFooters=grid._fixedfooters(),$fixedBodyContainer=grid.fixedBodyContainer();if(grid.options.virtualization===true||grid.options.rowVirtualization===true){scrollContainer=grid._vdisplaycontainer()}else{scrollContainer=grid.scrollContainer();if(scrollContainer.length===0){scrollContainer=grid.element}}if($unfixedHeaders.length>0){this._updateContainersWidth(colWidth,$unfixedHeaders.parent("div"),grid.fixedHeaderContainer(),updateFixedTable)
}this._updateContainersWidth(colWidth,scrollContainer,$fixedBodyContainer,updateFixedTable);if($unfixedFooters.length>0){$fixedFooterContainer=grid.fixedFooterContainer();if($fixedFooterContainer.length>0){this._updateContainersWidth(colWidth,$unfixedFooters,$fixedFooterContainer,updateFixedTable)}}},_updateContinuousHScrollbar:function(){var $hScrollerContainer=this.grid._vhorizontalcontainer(),fixedTableWidth=this._containers.body.fixedTable.outerWidth(),gridWidth=parseInt(this.grid.options.width,10);if(fixedTableWidth===0){$hScrollerContainer.css({position:"",left:""})}else if(this.options.fixingDirection==="left"){$hScrollerContainer.css({left:fixedTableWidth+"px",position:"relative"})}$hScrollerContainer.width(gridWidth-fixedTableWidth+"px");this.grid._updateVirtualHorizontalScrollbar()},getWidthOfFixedColumns:function(fCols,excludeNonDataColumns,includeHidden){var $fTable,w=0,i;if(!this._containers||!this._containers.body){this._populateContainers()}$fTable=this._containers.body.fixedTable;if(excludeNonDataColumns){$fTable.children("colgroup").children("col[data-skip]").each(function(){w+=parseInt($(this).css("width"),10)})}fCols=fCols||this.grid._fixedColumns;if(!fCols||!fCols.length){return w}for(i=0;i<fCols.length;i++){if(!includeHidden&&fCols[i].hidden){continue}w+=fCols[i].width}return w},_updateHScrollbarWidth:function(){if(this._isContinuousVirtualization()){this._updateContinuousHScrollbar();return}var scrollContainer,grid=this.grid,$hScrollerContainer,scW,oTableWidth=this._containers.body.unfixedTable.outerWidth();scrollContainer=this._containers.body.unfixedContainer;if(oTableWidth>0){scrollContainer.scrollTop(0);$hScrollerContainer=grid._hscrollbar();if(scrollContainer.is(":visible")){scW=scrollContainer.width()}else{scW=parseInt(grid.options.width,10)-this.getWidthOfFixedColumns()}$hScrollerContainer.css({width:scW-1+"px",left:0});grid._hscrollbarinner().css({width:(grid._hasVerticalScrollbar&&grid.options.fixedHeaders?oTableWidth-grid._scrollbarWidth():oTableWidth)+"px",left:0})}},_updateSingleContainerWidth:function(width,fixed){var $bodyTbl,$headerTbl,$footerTbl,funcUpdateTbl,$bodyContainer,$headerContainer,$footerContainer;width=!width?0:parseInt(width,10);this._populateContainers();if(fixed){$bodyTbl=this._containers.body.fixedTable;$bodyContainer=this._containers.body.fixedContainer;if(this._containers.header){$headerTbl=this._containers.header.fixedTable;$headerContainer=this._containers.header.fixedContainer}if(this._containers.footer){$footerTbl=this._containers.footer.fixedTable;$footerContainer=this._containers.footer.fixedContainer}}else{$bodyTbl=this._containers.body.unfixedTable;$bodyContainer=this._containers.body.unfixedContainer;if(this._containers.header){$headerTbl=this._containers.header.unfixedTable;$headerContainer=this._containers.header.unfixedContainer}if(this._containers.footer){$footerTbl=this._containers.footer.unfixedTable;$footerContainer=this._containers.footer.unfixedContainer}}funcUpdateTbl=function(nW,$tbl){var w=$tbl[0].style.width;if($.type(w)==="string"&&(w.indexOf("%")!==-1||w==="")){return}else{w=parseInt($tbl[0].style.width,10)}if(isNaN(w)){w=$tbl.outerWidth()}w+=nW;$tbl.width(w)};funcUpdateTbl(width,$bodyTbl);if($headerTbl){funcUpdateTbl(width,$headerTbl)}if($footerTbl){funcUpdateTbl(width,$footerTbl)}if(this._isVirtualGrid()){if(fixed){this._syncFixedVirtualizationColgroup(width)}else{funcUpdateTbl(width,$bodyContainer);if($headerTbl){funcUpdateTbl(width,$headerContainer)}if($footerTbl){funcUpdateTbl(width,$footerContainer)}}}},_updateContainersWidth:function(colWidth,$unfixedContainer,$fixedContainer,updateFixedTable){var oTableWidth,width=0,$unfixedTable=$unfixedContainer.find("table"),scWidth,virtGrid=this._isVirtualGrid(),w,$fixedTable=this.grid.container().find("#"+$unfixedTable.attr("id")+"_fixed");if($unfixedTable.length===0){$unfixedTable=$unfixedContainer}if($fixedTable.length===0){return}width=parseInt($fixedTable[0].style.width,10);if(isNaN(width)){width=$fixedTable.outerWidth()}w=$unfixedTable[0].style.width;if(!virtGrid||w!==""&&!(w.indexOf&&w.indexOf("%")>-1)){oTableWidth=parseInt(w,10);if(isNaN(oTableWidth)){oTableWidth=$unfixedTable.outerWidth()}oTableWidth-=colWidth;$unfixedTable[0].style.width=oTableWidth+"px"}if(updateFixedTable){width+=colWidth;$fixedTable.width(width)}if(virtGrid){scWidth=parseInt($unfixedContainer[0].style.width,10);if(isNaN(scWidth)){scWidth=$unfixedContainer.outerWidth()}scWidth-=colWidth;$unfixedContainer.width(scWidth)}},_headerRendered:function(sender,args){if(args.owner.element.attr("id")!==this.grid.element.attr("id")){return}if(this.options.showFixButtons===false){return}var i,j,cs,columnKey,ths,children,isFixed=false,allowFixing=true,grid=this.grid,self=this,cols=grid.options.columns,colsLength=cols.length;if(grid._isMultiColumnGrid){ths=grid.headersTable().find("tr[data-mch-level="+grid._maxLevel+"] th");ths.each(function(){var $th=$(this);if($th.attr("data-mch-id")){columnKey=$th.attr("data-mch-id");allowFixing=true;cs=self._getColumnSettingByKey(columnKey);if(cs&&cs.allowFixing===false){return true}for(j=0;j<grid._oldCols.length;j++){if(grid._oldCols[j].identifier===columnKey){children=grid._oldCols[j].children;for(i=0;i<children.length;i++){cs=self._getColumnSettingByKey(children[i].key,i);if(cs&&cs.allowFixing===false){allowFixing=false;break}}break}}if(!allowFixing){return true}self._renderHeaderCellButton(columnKey,isFixed,true,$th)}else{if($th.attr("data-skip")){return true}columnKey=$th.attr("id").replace(grid.id()+"_","");cs=self._getColumnSettingByKey(columnKey);if(cs&&cs.allowFixing===false){return true}if(self._fcData[columnKey]!==true){self._renderHeaderCellButton(columnKey,isFixed,false,$th)}}})}else{for(i=0;i<colsLength;i++){columnKey=cols[i].key;cs=this._getColumnSettingByKey(columnKey,i);isFixed=false;if(cs!==null){if(cs.allowFixing===false){continue}if(cs.isFixed===true){isFixed=true}}if(this._fcData[columnKey]!==true){this._renderHeaderCellButton(columnKey,isFixed)}}}},_headerRendering:function(){var i;for(i=0;i<this.grid.options.features.length;i++){if(this.grid.options.features[i].name==="Hiding"){this._hiding=this.grid.element.data("igGridHiding");break}}},_columnsMoved:function(e,ui){var start=ui.start,len=ui.len,idx=ui.index;if(!ui.isFixed){return}this.grid._rearrangeArray(this.grid._fixedColumns,start,len,idx)},_getColumnSettingByKey:function(key,colIndex){var i,cs=this.options.columnSettings,csLength=cs.length,res=null;for(i=0;i<csLength;i++){if(cs[i].columnKey!==null&&cs[i].columnKey!==undefined){if(cs[i].columnKey===key){res=cs[i];break}}else if(cs[i].columnIndex!==null&&cs[i].columnIndex!==undefined){if(cs[i].columnIndex===colIndex){res=cs[i];break}}}return res},_id:function(){var i,res=this.grid.id(),argumentsLength=arguments.length;if(argumentsLength===0){return null}for(i=0;i<argumentsLength;i++){res+="_"+arguments[i]}return res},_renderHeaderCellButton:function(columnKey,isFixed,isGroupHeader,$th){var self=this,css=self.css,buttonId,gridId=this.grid.id(),$button,$divHeaderButtonContainer,$columnFixingHeaderIconContainer;if($th===undefined){$th=this.grid.container().find("#"+gridId+"_"+columnKey)}buttonId=this._id("header_cell","fixing",columnKey);if($th.length===0){return}this.grid._enableHeaderCellFeature($th);$columnFixingHeaderIconContainer=$th.find(".ui-iggrid-indicatorcontainer");if($columnFixingHeaderIconContainer.length===0){$columnFixingHeaderIconContainer=$('<div class="ui-iggrid-indicatorcontainer"></div>').appendTo($th)}$button=this.grid.container().find("#"+buttonId);if($button.length===0){$button=$("<a></a>").attr("href","#").attr("data-fixing-indicator","true").attr("id",buttonId);$divHeaderButtonContainer=$columnFixingHeaderIconContainer.find(".ui-iggrid-fixcolumn-headerbuttoncontainer");if($divHeaderButtonContainer.length===0){$divHeaderButtonContainer=$("<div></div>").addClass(css.headerButtonIconContainer).appendTo($columnFixingHeaderIconContainer)}$button.appendTo($divHeaderButtonContainer);$("<span></span>").appendTo($button);$button.bind({mousedown:function(){$(this).trigger("mouseout")},click:function(event){self._preventDefaultEvent(event);if($button.attr("data-fixed")==="true"){self._unfixColumnInternal(columnKey,isGroupHeader)}else{self._fixColumnInternal(columnKey,isGroupHeader)}}})}this._changeStyleHeaderButton(columnKey,isFixed)},_getMCHHeader:function(id){return this.grid.headersTable().find("th[data-mch-id="+id+"]")},_changeStyleHeaderButton:function(columnKey,isFixed){var css=this.css,fc,attrVal="true",title=this.options.headerFixButtonText,$button=this.grid.container().find("#"+this._id("header_cell","fixing",columnKey)),$span;$span=$button.find("span");if(isFixed){$span.removeClass(css.headerButtonIcon);$span.addClass(css.headerButtonUnfixIcon);title=this.options.headerUnfixButtonText}else{attrVal="false";$span.removeClass(css.headerButtonUnfixIcon);$span.addClass(css.headerButtonIcon)}$button.attr("data-fixed",attrVal).attr("title",title);fc=this.grid.element.data("igGridFeatureChooser");if(fc!==undefined&&fc!==null){fc._setSelectedState("ColumnFixing",columnKey,isFixed,false)}},_dataRendering:function(event,ui){if(ui===undefined){return}if(this.grid.id()!==ui.owner.id()){return}if(this.grid.options.height===null&&this.grid.hasFixedColumns()&&$.ig.util.isIE&&$.ig.util.browserVersion>=9){$("#"+this.grid.id()+"_fixed").height("")}},_dataRendered:function(event,ui){if(ui===undefined){return}if(this.grid.id()!==ui.owner.id()){return}if(!this.grid._initialized){this._gridInternalRendered()}this._checkSyncTablesHeights()},_syncTableHeights:function(){$("#"+this.grid.id()+"_fixed").height(this.grid.element.height())},_gridInternalRendered:function(){var i,j,cs=this.options.columnSettings,csLength=cs.length,columnKeys=[],hasColumnKey,hasColumnIndex,res,cols=this.grid.options.columns,col,isGroupHeader,countHidden=0,colsLength=cols.length;for(i=0;i<csLength;i++){if(cs[i].isFixed!==true){continue}hasColumnKey=cs[i].columnKey!==null&&cs[i].columnKey!==undefined;hasColumnIndex=cs[i].columnIndex!==null&&cs[i].columnIndex!==undefined;if(!hasColumnKey){if(!hasColumnIndex){continue}if(cs[i].columnIndex>=0&&cs[i].columnIndex<colsLength){columnKeys.push(cols[cs[i].columnIndex].key);if(cols[cs[i].columnIndex].hidden){countHidden++}}}else{columnKeys.push(cs[i].columnKey);col=this.grid.columnByKey(cs[i].columnKey);if(col&&col.hidden){countHidden++}}}if(countHidden===columnKeys.length&&countHidden>0){this._trigger(this.events.columnFixingRefused,null,{columnIdentifier:columnKeys,owner:this.grid});return}for(j=0;j<columnKeys.length;j++){isGroupHeader=false;if(this.grid._isMultiColumnGrid&&!this.grid.columnByKey(columnKeys[j])){isGroupHeader=true}res=this.fixColumn(columnKeys[j],isGroupHeader);if(!res.result){throw new Error($.ig.util.stringFormat($.ig.ColumnFixing.locale.initialFixingNotApplied,columnKeys[j],res.error))}}if($.type(this.grid.options.width)==="string"&&this.grid.options.width.indexOf("%")!==-1&&!this.grid.element.closest(".ui-widget").data("igResponsiveContainer")&&!this._responsive){this._responsive=this.grid.element.closest(".ui-widget").igResponsiveContainer().data("igResponsiveContainer");this._callBackId=this._responsive.addCallback(this._containerResized,this,10,"x")}if(this.options.fixNondataColumns){this.fixDataSkippedColumns()}},_syncRowsOnAddEdit:function(rowId){if(!this.options.syncRowHeights||!this.grid.hasFixedColumns()){return}var $fRow=this.grid.rowById(rowId,true),$ufRow=this.grid.rowById(rowId);if(!$fRow||!$ufRow){return}if(!this._containers||!this._containers.body){this._populateContainers()}this._containers.body.fixedTable.height("");this._containers.body.unfixedTable.height("");$fRow.height("");$ufRow.height("");this.syncRowsHeights($fRow,$ufRow);this._checkSyncTablesHeights()},_internalRowDeleted:function(){if(!this._containers||!this._containers.body){this._populateContainers()}this._containers.body.fixedTable.height("");this._containers.body.unfixedTable.height("");this._checkSyncTablesHeights()},_internalRowAdded:function(args){this._syncRowsOnAddEdit(args.row.attr("data-id"))},_internalCellUpdated:function(args){this._syncRowsOnAddEdit(args.rowID)},_internalRowUpdated:function(args){this._syncRowsOnAddEdit(args.rowID)},_preventDefaultEvent:function(event){event.preventDefault();event.stopPropagation()},_detachEvents:function(){if(this._headerRenderedHandler){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler)}if(this._headerCellRenderedHandler){this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler)}if(this._headerRenderingHandler){this.grid.element.unbind("iggridheaderrendering",this._headerRenderingHandler)}if(this._columnsMovedHandler){this.grid.element.unbind("iggrid_columnsmoved",this._columnsMovedHandler)}if(this._gridHeightChangingHandler){this.grid.element.unbind("iggrid_heightchanging",this._gridHeightChangingHandler)}if(this._dataRenderingHandler){this.grid.element.unbind("iggriddatarendering",this._dataRenderingHandler)}if(this._dataRenderedHandler){this.grid.element.unbind("iggriddatarendered",this._dataRenderedHandler)}if(this._virtualrecordsrenderHandler){this.grid.element.unbind("iggridvirtualrecordsrender",this._virtualrecordsrenderHandler)}if(this._gridContainerHeightHandler){this.grid.element.unbind("iggrid_heightchanged",this._gridContainerHeightHandler)}},destroy:function(){var fc;if(this.grid._fixedColumns&&this.grid._fixedColumns.length>0){this.unfixAllColumns()}this.grid.headersTable().find("thead > tr > th").not("[data-skip=true]").each(function(){var th=$(this);th.find("a[data-fixing-indicator=true]").parent().remove()});this._detachEvents();if(this._gridRenderRowHandler!==undefined){this.grid._renderRow=this._gridRenderRowHandler}if(typeof this._callBackId==="number"){this._responsive.removeCallback(this._callBackId);this._callBackId=null}fc=this.grid.element.data("igGridFeatureChooser");if(fc&&this.renderInFeatureChooser){fc._removeFeature("ColumnFixing")}$.Widget.prototype.destroy.call(this);return this},_headerCellRendered:function(event,ui){if(ui.owner.element.attr("id")!==this.grid.element.attr("id")){return}if(this._isInitFC!==true){this._initFC()}},_heightChanged:function(e,args){if(!this.grid.hasFixedColumns()){return}if(this._isVirtualGrid()){this._onHeigtChangedInVGrid(e,args)}this._syncHScrollbarHeight()},_onHeigtChangedInVGrid:function(e,args){if(!this.grid.hasFixedColumns()){return}var $fixedBodyContainer=this.grid.fixedBodyContainer(),h=args.ch-args.h;$fixedBodyContainer.height(h);if(this.options.syncRowHeights){this._syncRowsHeights(this._containers.body.unfixedContainer,this._containers.body.fixedContainer)}},_gridHeightChanging:function(e,arg){if(!this._containers.body){return}if(this._isVirtualGrid()){return}var scrollContainerHeight,diff,pc=this.grid._prevContainerHeight,$fixedBodyContainer=this.grid.fixedBodyContainer();if($fixedBodyContainer.length===0){return}scrollContainerHeight=arg.ch-arg.h;if(this.grid._hscrollbar().is(":visible")){scrollContainerHeight+=this.grid._hscrollbar().outerHeight()}$fixedBodyContainer.height(scrollContainerHeight);diff=Math.abs(pc-this.grid.container().height());$fixedBodyContainer.height(scrollContainerHeight-diff)},_initFC:function(){var i,fc,isMCH=this.grid._isMultiColumnGrid,o=this.options,cols=this.grid.options.columns,colsLength=cols.length,cs,columnKey;this._isInitFC=true;fc=this.grid.element.data("igGridFeatureChooser");if(fc!==null&&fc!==undefined&&this.renderInFeatureChooser&&o.showFixButtons){if(isMCH){cols=this.grid._oldCols;colsLength=cols.length}for(i=0;i<colsLength;i++){columnKey=cols[i].key;this._fcData[columnKey]=false;if(isMCH&&cols[i].level!==0){continue}cs=this._getColumnSettingByKey(columnKey,i);if(cs&&cs.allowFixing===false){continue}if(fc._shouldRenderInFeatureChooser(columnKey)===true){fc._renderInFeatureChooser(columnKey,{name:"ColumnFixing",text:o.featureChooserTextUnfixedColumn,textHide:o.featureChooserTextFixedColumn,iconClass:this.css.featureChooserIconClassFixed,iconClassOff:this.css.featureChooserIconClassUnfixed,isSelected:cs&&cs.isFixed===true,method:$.proxy(this._togglefromfc,this),updateOnClickAll:false,order:3,groupName:"toggle",groupOrder:1,type:"toggle",state:"hide"});this._fcData[columnKey]=true}}}},_togglefromfc:function(event,columnKey){var i,cols=this.grid.options.columns,colsLength=cols.length,col,ret;for(i=0;i<colsLength;i++){col=cols[i];if(col.key===columnKey){if(col.fixed===true){ret=this._unfixColumnInternal(columnKey)}else{ret=this._fixColumnInternal(columnKey)}break}}return ret.error===undefined},_columnMap:function(){var i,j,isMCH=this.grid._isMultiColumnGrid,cs,columnKey,elem,result=[],cols=this.grid.options.columns,colsLength=cols.length;if(this.options.showFixButtons===false){return false}for(i=0;i<colsLength;i++){columnKey=cols[i].key;elem={columnKey:columnKey,enabled:true};cs=this._getColumnSettingByKey(columnKey,i);if(cs&&cs.allowFixing===false){elem.enabled=false}else if(isMCH){for(j=0;j<this.grid._oldCols.length;j++){if(this.grid._oldCols[j].key===columnKey){break}}if(j===this.grid._oldCols.length){elem.enabled=false}}result.push(elem)}return result},_renderRow:function(rec,tr,rowId){if(!this.grid.hasFixedColumns()){return this._gridRenderRowHandler(rec,tr,rowId)}var i,col,content,$fixedRow,$unfixedRow,fixedCells,unfixedCells,counterFixed=0,counterUnfixed=0,$td,$tr=$(tr),grid=this.grid,cols=grid.options.columns,colsLength=cols.length,isFixedRow=this.grid._isFixedElement($tr);if(isFixedRow){$fixedRow=$tr;$unfixedRow=grid.element.find("tbody tr:nth-child("+($tr.index()+1)+")")}else{$unfixedRow=$tr;$fixedRow=this.grid.fixedTable().find("tbody tr:nth-child("+($tr.index()+1)+")")}fixedCells=$fixedRow.find("td:not([data-skip])");unfixedCells=$unfixedRow.find("td:not([data-skip])");for(i=0;i<colsLength;i++){col=cols[i];if(col.hidden===true){continue}if(col.fixed===true){$td=fixedCells.eq(counterFixed++)}else{$td=unfixedCells.eq(counterUnfixed++)}if(col.template&&col.template.length){content=grid._renderTemplatedCell(rec,col);if(content.indexOf("<td")===0){$td.html($(content).html())}else{$td.html(content)}}else{$td.html(String(grid._renderCell(rec[col.key],col,rec)))}}return tr},_renderRecords:function(start,end){var $fixedTable,hasFixedColumns=this.grid.hasFixedColumns();this._gridRenderRecordsHandler(start,end);if(hasFixedColumns){$fixedTable=this.grid.fixedTable();this._renderFixedRecords($fixedTable,start,end);if(this.options.syncRowHeights&&this._applySyncRowHeights!==false){this._syncFixedHeights($fixedTable,this.grid.element)}}},_renderNewRow:function(rec,key){var grid=this.grid,self=this,tbody=this.grid.element.children("tbody"),index=tbody.children('[data-container!="true"]').length,virt=grid.options.virtualization===true||grid.options.rowVirtualization===true;this._gridRenderNewRowHandler(rec,key);if(!virt){if(grid.hasFixedColumns()){MSApp.execUnsafeLocalFunction(function(){grid.fixedTable().find("tbody").append(self._renderFixedRecord(rec,index))})}}},_updateVScrollbarCellPaddingHelper:function(paddingIncrement,skipHeaderFooters){if(!this.grid.hasFixedColumns()){this._gridUpdatePaddingHandler(paddingIncrement,skipHeaderFooters);return}var grid=this.grid,gridOpts=grid.options,fTable,hTable,container,hasFixedHeaders=gridOpts.showHeader&&gridOpts.fixedHeaders===true&&gridOpts.height!==null,hasFixedFooters=gridOpts.showFooter&&gridOpts.fixedFooters===true&&gridOpts.height!==null;if(this.options.fixingDirection==="right"){if(hasFixedHeaders&&!skipHeaderFooters){hTable=grid.fixedHeadersTable();grid._removeHeaderCellPadding(grid.headersTable(),true)}if(hasFixedFooters&&!skipHeaderFooters){fTable=grid.fixedFootersTable();grid._removeCellPadding(grid.footersTable(),"tfoot","td",true)}grid._removeCellPadding(grid.element,"tbody","td",true);container=grid.fixedBodyContainer()}else{if(hasFixedHeaders&&!skipHeaderFooters){hTable=grid.headersTable();grid._removeHeaderCellPadding(grid.fixedHeadersTable(),true)}if(hasFixedFooters&&!skipHeaderFooters){fTable=grid.footersTable();grid._removeCellPadding(grid.fixedFootersTable(),"tfoot","td",true)}grid._removeCellPadding(grid.fixedBodyContainer(),"tbody","td",true);container=this.element}if(hasFixedHeaders&&!skipHeaderFooters){grid._increaseLastHeaderCellVScrollbarPadding(hTable,paddingIncrement)}if(hasFixedFooters&&!skipHeaderFooters){grid._increaseLastCellVScrollbarPadding(fTable,"tfoot","td",paddingIncrement)}grid._increaseLastCellVScrollbarPadding(container,"tbody","td",paddingIncrement)},_syncFixedHeights:function($fixedTable,$unfixedTable){var heights=[],$trsFixedTable,$trsUnfixedTable,h,fH,ufH,resetHeights=false;if($unfixedTable.lenght&&$unfixedTable[0].style.height!==""){resetHeights=true}$fixedTable.css("height","");$unfixedTable.css("height","");$trsFixedTable=$fixedTable.find("tr");$trsUnfixedTable=$unfixedTable.find("tr");$trsUnfixedTable.map(function(ind){var unfixedHeight=this.offsetHeight,fixedHeight=$trsFixedTable[ind].offsetHeight;if(unfixedHeight<fixedHeight){unfixedHeight=fixedHeight}heights.push(unfixedHeight)});$.each(heights,function(ci,h){var height=h+"px";$trsFixedTable[ci].style.height=height;$trsUnfixedTable[ci].style.height=height});if(resetHeights){fH=$fixedTable.height();ufH=$unfixedTable.height();h=fH;if(fH<ufH){h=ufH}$fixedTable.height(h);$unfixedTable.height(h)}},_renderFixedRecords:function($table,start,end,onlyRows,$trsUnfixed){var grid=this.grid,tr,ds=grid.dataSource.dataView(),i,d="",noCancel=true;if(start===undefined){start=0;end=ds.length-1}if(start!==undefined&&end===undefined){end=start;if(end>ds.length-1){end=ds.length-1}start=0}if(start<0){start=0}if(end>ds.length-1&&!onlyRows){end=ds.length-1}if(noCancel){for(i=start;i<=end;i++){if($trsUnfixed){tr=$trsUnfixed[i]}d+=this._renderFixedRecord(ds[i],i,onlyRows,tr)}$table.find("tbody").html(d)}},_renderFixedRecord:function(data,rowIndex,onlyRows,tr){var i,grid=this.grid,o=grid.options,attr,key=o.primaryKey,dstr="",cols=grid._fixedColumns;dstr+="<tr";if(tr&&this.options.populateDataRowsAttributes){attr=tr.attributes;if(attr){for(i=0;i<attr.length;i++){dstr+=" "+attr[i].name+'="'+attr[i].value+'"'}}}else{if(rowIndex%2!==0&&o.alternateRowStyles){dstr+=' class="'+grid.css.recordAltClass+'"'}}if(data){if(!_aNull(key)){dstr+=' data-id="'+grid._kval_from_key(key,data)+'"'}else if(!_aNull(data.ig_pk)){dstr+=' data-id="'+data.ig_pk+'"'}}if(o.virtualization&&o.virtualizationMode==="continuous"){dstr+=' data-row-idx="'+rowIndex+'"'}dstr+=' role="row" tabindex="'+this.grid.options.tabIndex+'">';if(onlyRows===true){dstr+="</tr>";return dstr}$(cols).each(function(colIndex){var temp,k;if(cols[colIndex].hidden||cols[colIndex].fixed!==true){return}dstr+='<td role="gridcell" aria-readonly="'+!!this.readOnly+'" aria-describedby="'+grid.id()+"_"+this.key+'" tabindex="'+grid.options.tabIndex+'"';if(cols[colIndex].template&&cols[colIndex].template.length){temp=grid._renderTemplatedCell(data,this);if(temp.indexOf("<td")===0){dstr+=temp.substring(3)}else{dstr+=">"+temp}dstr=grid._editCellStyle(dstr,data,this.key,true)}else{k=this.key||colIndex;dstr+=grid._addCellStyle(data,k,cols[colIndex],true)+">"+grid._renderCell(data[k],this,data)}dstr+="</td>"});dstr+="</tr>";return dstr},_detachColumn:function(col){var position,fixed,headerCells,grid=this.grid,tPos,isMultiColumnGrid=grid._isMultiColumnGrid,footerCells,hasFixedColumns=grid.hasFixedColumns();if(!hasFixedColumns){this._gridDetachColumnHandler(col)}else{fixed=col.fixed;col.hidden=false;grid._visibleColumnsArray=undefined;tPos=$.inArray(col,this.grid._visibleColumns());position=this._getVisibleIndex(col.key,col.fixed===true,true);col.hidden=true;grid._visibleColumnsArray=undefined;grid._initializeDetachedContainers();if(fixed){headerCells=grid.fixedHeadersTable().children("thead").children("tr").not("[data-skip=true]");footerCells=grid.fixedFootersTable().children("tfoot").children("tr")}else{footerCells=grid.footersTable().children("tfoot").children("tr");headerCells=grid.headersTable().children("thead").children("tr").not("[data-skip=true]")}if(isMultiColumnGrid){grid._hideMultiHeaderCells(grid._headerCells,tPos,col.key);if(fixed){headerCells=grid.fixedHeadersTable().children("thead").children("tr:not([data-mch-level])").not("[data-skip=true]")}else{headerCells=grid.headersTable().children("thead").children("tr:not([data-mch-level])").not("[data-skip=true]")}grid._detachCells(headerCells,function(row){return row.filter(":not([data-new-row],[data-add-row])").children("th, td").not("[data-skip=true]")},position,grid._detachedHeaderCells,col.key)}else{grid._detachCells(headerCells,function(row){return row.filter(":not([data-new-row],[data-add-row])").children("th, td").not("[data-skip=true]")},position,grid._detachedHeaderCells,col.key)}grid._detachCells(footerCells,function(row){return row.children("td").not("[data-skip=true]")},position,grid._detachedFooterCells,col.key)}},_attachColumn:function(col){if(!this.grid.hasFixedColumns()){this._gridAttachColumnHandler(col);return}var headerCells,footerCells,fixed=col.fixed,grid=this.grid,position=this._getVisibleIndex(col.key,col.fixed===true,true);grid._initializeDetachedContainers();if(grid._isMultiColumnGrid){grid._showMultiHeaderCells(col.key);if(fixed){headerCells=grid.fixedHeadersTable().children("thead").children("tr:not([data-mch-level])").not("[data-skip=true]");footerCells=grid.fixedFootersTable().children("tfoot").children("tr")}else{headerCells=grid.headersTable().children("thead").children("tr:not([data-mch-level])").not("[data-skip=true]");footerCells=grid.footersTable().children("tfoot").children("tr")}grid._attachCells(headerCells,function(row){return row.children("th, td").not("[data-skip=true]")},position,grid._detachedHeaderCells,col.key)}else{if(fixed){headerCells=grid.fixedHeadersTable().children("thead").children("tr").not("[data-skip=true]");footerCells=grid.fixedFootersTable().children("tfoot").children("tr")}else{headerCells=grid.headersTable().children("thead").children("tr").not("[data-skip=true]");footerCells=grid.footersTable().children("tfoot").children("tr")}grid._attachCells(headerCells,function(row){return row.children("th, td").not("[data-skip=true]")},position,grid._detachedHeaderCells,col.key)}grid._attachCells(footerCells,function(row){return row.children("td").not("[data-skip=true]")},position,grid._detachedFooterCells,col.key)},_renderColgroup:function(table,isHeader,isFooter,autofitLastColumn){this._gridRenderColgroupHandler(table,isHeader,isFooter,autofitLastColumn);if(!this.grid.hasFixedColumns()){return}this._renderFixedColgroup(isHeader,isFooter,autofitLastColumn)},_rerenderFixedColgroups:function(){if(this._containers.header.fixedTable){this._renderFixedColgroup(true,false)}this._renderFixedColgroup();if(this._containers.footer.fixedTable){this._renderFixedColgroup(false,true)}},_renderFixedColgroup:function(isHeader,isFooter){var i,table,colgroup,w,totalWidth=0,cols=this.grid._visibleColumns(true);if(!this._containers||!this._containers.body){this._populateContainers()}if(isHeader){table=this._containers.header.fixedTable||this._containers.body.fixedTable}else if(isFooter){table=this._containers.footer.fixedTable||this._containers.body.fixedTable}else{table=this._containers.body.fixedTable}colgroup=$(table).find("colgroup");if(colgroup.length===0){colgroup=$("<colgroup></colgroup>").prependTo(table)}colgroup.empty();for(i=0;i<cols.length;i++){if(!cols[i].fixed){continue}if(cols[i].oWidth){w=cols[i].oWidth}else{w=cols[i].width}totalWidth+=parseInt(w,10);$("<col></col>").appendTo(colgroup).css("width",w)}return totalWidth},_gridWidthChanged:function(){if(!this.grid.hasFixedColumns()){return}if(!this._containers||!this._containers.body){this._populateContainers()}var scrollContainer=this._containers.body.unfixedContainer;this.grid._hscrollbar().css({width:scrollContainer.width()+"px",left:0})},_containerResized:function(){if(!this.grid.hasFixedColumns()){return}var headersTableHeight=this.grid.headersTable().outerHeight(),fixedHeadersTableHeight=this.grid.fixedHeadersTable().outerHeight();if(this._containers&&this._containers.body){if(Math.abs(this._containers.body.fixedTable.outerHeight()-this._containers.body.unfixedTable.outerHeight())>1){this._checkSyncTablesHeights();this._syncRowsHeights(this._containers.body.unfixedContainer,this._containers.body.fixedContainer)}}if(Math.abs(headersTableHeight-fixedHeadersTableHeight)>1){this._syncRowsHeights(this.grid.headersTable().find("thead"),this.grid.fixedHeadersTable().find("thead"));this.grid._initializeHeights()}},_checkGridSupportedFeatures:function(){if(this.grid.options._isHierarchicalGrid){throw new Error($.ig.ColumnFixing.locale.hierarchicalGridNotSupported)}var i,featureName,gridOptions=this.grid.options,cols=gridOptions.columns,dW=gridOptions.defaultColumnWidth,features=gridOptions.features,featuresLength=features.length;if(gridOptions.width===null||gridOptions.width===""||$.type(gridOptions.width)==="string"&&gridOptions.width.indexOf("%")>0){throw new Error($.ig.ColumnFixing.locale.noGridWidthNotSupported)}if(dW){if($.type(dW)==="string"&&dW.indexOf("%")>0){throw new Error($.ig.ColumnFixing.locale.defaultColumnWidthInPercentageNotSupported)}}else{$.each(cols,function(ind,col){var w=col.width;if(!w||$.type(w)==="string"&&w.indexOf("%")>0){throw new Error($.ig.ColumnFixing.locale.columnsWidthShouldBeSetInPixels.replace("{key}",col.key))}})}$.each(cols,function(ind,col){if(col.unbound){throw new Error($.ig.ColumnFixing.locale.unboundColumnsNotSupported)}});if(gridOptions.columnVirtualization===true){throw new Error($.ig.ColumnFixing.locale.columnVirtualizationNotSupported)}if(gridOptions.virtualization&&gridOptions.virtualizationMode!=="continuous"){throw new Error($.ig.ColumnFixing.locale.virtualizationNotSupported)}if(featuresLength===1){return}for(i=0;i<featuresLength;i++){featureName=features[i].name;if(!featureName){continue}featureName=featureName.toLowerCase();switch(featureName){case"groupby":throw new Error($.ig.ColumnFixing.locale.groupByNotSupported);case"responsive":throw new Error($.ig.ColumnFixing.locale.responsiveNotSupported)}}},_hidingFinishing:function(args){if(!this.grid.hasFixedColumns()){return}var i,cols=args.columns;this._applySyncRowHeights=false;if(args.hidden){for(i=0;i<cols.length;i++){this._columnHiding(null,{columnKey:cols[i].key})}}},_hidingFinished:function(args){var i,cols=args.columns,$fixedTable;if(args.hidden){for(i=0;i<cols.length;i++){this._columnHidden(null,{columnKey:cols[i].key})}}else{for(i=0;i<cols.length;i++){this._columnShown(null,{columnKey:cols[i].key})}}if(this.grid.hasFixedColumns()&&this.options.syncRowHeights&&this._applySyncRowHeights===false){$fixedTable=this.grid.fixedTable();this._syncFixedHeights($fixedTable,this.grid.element);this._checkAndRenderHeightCompensateContainer();this._syncRowsHeights(this.grid.footersTable().find("tfoot"),this.grid.fixedFootersTable().find("tfoot"))}this._syncHScrollbarHeight();this._applySyncRowHeights=true},_columnShown:function(event,ui){var i,w,columnKey=ui.columnKey,cols=this.grid.options.columns,colsLength=cols.length,col;for(i=0;i<colsLength;i++){col=cols[i];if(col.key===columnKey){break}}if(!col){return}if(col.fixed){w=parseInt(col.width,10);this._updateSingleContainerWidth(w,true);if(this.grid.options.autofitLastColumn){this._updateSingleContainerWidth(-w,false);this.grid._rerenderColgroups();this.grid._adjustLastColumnWidth(false)}}this._populateContainers();this._updateHScrollbarWidth();this.grid._columnMovingResets();this._syncHScrollbarHeight()},_columnHiding:function(event,ui){var w,columnKey=ui.columnKey,col=this.grid.columnByKey(columnKey);if(!col){return}if(col.fixed&&col.width){w=parseInt(col.width,10);this._updateSingleContainerWidth(-w,true)}},_columnHidden:function(event,ui){var i,w,columnKey=ui.columnKey,cols=this.grid.options.columns,colsLength=cols.length,col;for(i=0;i<colsLength;i++){col=cols[i];if(col.key===columnKey){break}}if(!col){return}if(col.fixed){w=parseInt(col.width,10);if(this.grid.options.autofitLastColumn){this._updateSingleContainerWidth(w,false);
this.grid._rerenderColgroups();this.grid._adjustLastColumnWidth(true)}}else{if(this.grid.options.autofitLastColumn){this.grid._rerenderColgroups();this.grid._adjustLastColumnWidth(true)}}this._populateContainers();this._updateHScrollbarWidth()},_virtualrecordsrender:function(){var grid=this.grid,fnRemoveHeigths,h,$fixedTable,$unfixedTable;if(!grid.hasFixedColumns()){return}$fixedTable=this._containers.body.fixedTable;$unfixedTable=this._containers.body.unfixedTable;h=$unfixedTable[0].style.height;if(!$.ig.util.isChrome){$fixedTable.height("");$unfixedTable.height("")}if(this._isContinuousVirtualization()){if(this.options.syncRowHeights){this._checkSyncTablesHeights()}return}fnRemoveHeigths=function($rows){$rows.each(function(ind,row){row.style.height=""})};fnRemoveHeigths($unfixedTable.find("tr"));fnRemoveHeigths($fixedTable.find("tr"));this._syncRowsHeights($unfixedTable,$fixedTable);if(!$.ig.util.isChrome){$fixedTable.height(h);$unfixedTable.height(h)}},_rearrangeOldColsByColumnKey:function(colKey,isToFix,target,after){if(!this.grid._isMultiColumnGrid){return}var grid=this.grid,at,targetCol,currCol;if(!target){if(isToFix||this.options.fixingDirection==="right"){at=this._getColumnsByState(isToFix).length}else{at=0}grid._rearrangeArray(grid._oldCols,this._getColumnByKey(colKey).index,1,at);return}currCol=this._getColumnByKey(colKey);targetCol=this._getColumnByKey(target);if(!currCol||!targetCol){return}at=targetCol.index;if(after){at++}grid._rearrangeArray(grid._oldCols,currCol.index,1,at)},_getColumnByKey:function(id,cols){var oCols=cols||this.grid._oldCols,i;for(i=0;i<oCols.length;i++){if(oCols[i].key===id||oCols[i].identifier===id){return{column:oCols[i],index:i}}}return null},_getColumnsByState:function(fixed,cols){var oCols=cols||this.grid._oldCols,i,res=[];for(i=0;i<oCols.length;i++){if(!!oCols[i].fixed===fixed){res.push(oCols[i])}}return res},_analyzeTargetIndexes:function(target,after,fixed){var grid=this.grid,targetCol,targetMCHColumn,children,child,res={indexAt:0,columnIndexAt:0};if(_aNull(target)){return false}if(!grid._isMultiColumnGrid){targetCol=this.grid.columnByKey(target)}else{targetMCHColumn=this._getColumnByKey(target);if(!targetMCHColumn){return false}targetCol=targetMCHColumn.column}if(!targetCol||!!targetCol.fixed!==fixed){return false}if(!targetMCHColumn||!targetCol.group){res.indexAt=this._getVisibleIndex(targetCol.key,fixed);res.columnIndexAt=this._getColumnByKey(target,grid.options.columns).index;if(after){res.indexAt++;res.columnIndexAt++}}else{children=targetCol.children;if(after){child=children[children.length-1];res.indexAt=this._getVisibleIndex(child.key,fixed)+1;res.columnIndexAt=this._getColumnByKey(child.key,grid.options.columns).index+1}else{child=children[0];res.indexAt=this._getVisibleIndex(child.key,fixed);res.columnIndexAt=this._getColumnByKey(child.key,grid.options.columns).index}}return res},_injectGrid:function(gridInstance,isRebind){this.grid=gridInstance;if(!isRebind){this._checkGridSupportedFeatures()}this._detachEvents();this._headerCellRenderedHandler=$.proxy(this._headerCellRendered,this);this.grid.element.bind("iggridheadercellrendered",this._headerCellRenderedHandler);this._headerRenderedHandler=$.proxy(this._headerRendered,this);this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);this._headerRenderingHandler=$.proxy(this._headerRendering,this);this.grid.element.bind("iggridheaderrendering",this._headerRenderingHandler);this._columnsMovedHandler=$.proxy(this._columnsMoved,this);this.grid.element.bind("iggrid_columnsmoved",this._columnsMovedHandler);if(this._isVirtualGrid()&&this.options.syncRowHeights){this._virtualrecordsrenderHandler=$.proxy(this._virtualrecordsrender,this);this.grid.element.bind("iggridvirtualrecordsrender",this._virtualrecordsrenderHandler)}this._gridContainerHeightHandler=$.proxy(this._heightChanged,this);this.grid.element.bind("iggrid_heightchanged",this._gridContainerHeightHandler);this._gridHeightChangingHandler=$.proxy(this._gridHeightChanging,this);this.grid.element.bind("iggrid_heightchanging",this._gridHeightChangingHandler);if(this.grid._columns===undefined||this.grid._columns===null){this.grid._columns=this.grid.options.columns.clone()}if(this.grid._fixedColumns===undefined){this.grid._fixedColumns=[]}if(this.grid.options.height===null&&$.ig.util.isIE&&$.ig.util.browserVersion>=9){this._dataRenderingHandler=$.proxy(this._dataRendering,this);this.grid.element.bind("iggriddatarendering",this._dataRenderingHandler)}this._dataRenderedHandler=$.proxy(this._dataRendered,this);this.grid.element.bind("iggriddatarendered",this._dataRenderedHandler);if(!this._isFunctionsOverriden){this.grid._visibleAreaWidth(this.options.minimalVisibleAreaWidth);this._gridRenderRowHandler=$.proxy(this.grid._renderRow,this.grid);this._renderRowHandler=$.proxy(this._renderRow,this);this.grid._renderRow=this._renderRowHandler;this._gridRenderRecordsHandler=$.proxy(this.grid._renderRecords,this.grid);this._renderRecordsHandler=$.proxy(this._renderRecords,this);this.grid._renderRecords=this._renderRecordsHandler;this._gridRenderNewRowHandler=$.proxy(this.grid.renderNewRow,this.grid);this._renderNewRowHandler=$.proxy(this._renderNewRow,this);this.grid.renderNewRow=this._renderNewRowHandler;this._gridDetachColumnHandler=$.proxy(this.grid._detachColumn,this.grid);this._detachColumnHandler=$.proxy(this._detachColumn,this);this.grid._detachColumn=this._detachColumnHandler;this._gridAttachColumnHandler=$.proxy(this.grid._attachColumn,this.grid);this._attachColumnHandler=$.proxy(this._attachColumn,this);this.grid._attachColumn=this._attachColumnHandler;this._gridRenderColgroupHandler=$.proxy(this.grid._renderColgroup,this.grid);this._renderColgroupHandler=$.proxy(this._renderColgroup,this);this.grid._renderColgroup=this._renderColgroupHandler;this._gridUpdatePaddingHandler=$.proxy(this.grid._updateVScrollbarCellPaddingHelper,this.grid);this._updateVScrollbarCellPaddingHelperHandler=$.proxy(this._updateVScrollbarCellPaddingHelper,this);this.grid._updateVScrollbarCellPaddingHelper=this._updateVScrollbarCellPaddingHelperHandler;this._isFunctionsOverriden=true}}});$.extend($.ui.igGridColumnFixing,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Column Moving 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	jquery.ui.mouse.js
 *	jquery.ui.draggable.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.tree.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 *	infragistics.ui.grid.shared.js
 *	infragistics.ui.grid.featurechooser.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){"use strict";$.widget("ui.igGridColumnMoving",{renderInFeatureChooser:true,options:{columnSettings:[{columnKey:null,columnIndex:null,allowMoving:true}],mode:"immediate",moveType:"dom",addMovingDropdown:true,movingDialogWidth:400,movingDialogHeight:"",movingDialogAnimationDuration:200,movingAcceptanceTolerance:20,movingScrollTolerance:20,scrollSpeedMultiplier:2,scrollDelta:2,hideHeaderContentsDuringDrag:true,dragHelperOpacity:1,movingDialogCaptionButtonDesc:$.ig.ColumnMoving.locale.movingDialogCaptionButtonDesc,movingDialogCaptionButtonAsc:$.ig.ColumnMoving.locale.movingDialogCaptionButtonAsc,movingDialogCaptionText:$.ig.ColumnMoving.locale.movingDialogCaptionText,movingDialogDisplayText:$.ig.ColumnMoving.locale.movingDialogDisplayText,movingDialogDropTooltipText:$.ig.ColumnMoving.locale.movingDialogDropTooltipText,movingDialogDropTooltipMarkup:"<div><p><span></span><strong>{text}</strong></p></div>",dropDownMoveLeftText:$.ig.ColumnMoving.locale.dropDownMoveLeftText,dropDownMoveRightText:$.ig.ColumnMoving.locale.dropDownMoveRightText,dropDownMoveFirstText:$.ig.ColumnMoving.locale.dropDownMoveFirstText,dropDownMoveLastText:$.ig.ColumnMoving.locale.dropDownMoveLastText,movingToolTipMove:$.ig.ColumnMoving.locale.movingToolTipMove,featureChooserSubmenuText:$.ig.ColumnMoving.locale.featureChooserSubmenuText,columnMovingDialogContainment:"owner",inherit:false},css:{headerCellMouseOver:"ui-state-hover",dropDownButton:"ui-iggrid-moving-indicator",dropDownIndicatorContainer:"ui-iggrid-indicatorcontainer",dragIndicatorTop:"ui-iggrid-columnmoving-dragtop",dragIndicatorBottom:"ui-iggrid-columnmoving-dragbottom",dragIndicatorLeft:"ui-iggrid-columnmoving-dragleft",dragIndicatorRight:"ui-iggrid-columnmoving-dragright",dropDownIconContainer:"ui-iggrid-columnmovingiconcontainer",featureChooserMovingDialogIcon:"ui-icon ui-iggrid-icon-move",featureChooserLeftIcon:"ui-iggrid-featurechooser-li-iconcontainer ui-icon ui-iggrid-icon-left",featureChooserRightIcon:"ui-iggrid-featurechooser-li-iconcontainer ui-icon ui-iggrid-icon-right",featureChooserFirstIcon:"ui-iggrid-featurechooser-li-iconcontainer ui-icon ui-iggrid-icon-first",featureChooserLastIcon:"ui-iggrid-featurechooser-li-iconcontainer ui-icon ui-iggrid-icon-last",featureChooserSubmenu:"ui-iggrid-featurechooser-list-submenu ui-menu ui-widget ui-widget-content ui-corner-all",featureChooserSubmenuItem:"ui-iggrid-featurechooser-list-submenu-item ui-state-default",featureChooserSubmenuItemMouserOver:"ui-state-hover",columnMovingDropDown:"ui-iggrid-columnmoving-dropdown-dialog ui-widget ui-widget-content ui-corner-all",columnMovingDropDownList:"ui-iggrid-columnmoving-dropdown-list ui-menu",columnMovingDropDownItem:"ui-iggrid-columnmoving-dropdown-ddlistitemicons ui-state-default",columnMovingDropDownItemHover:"ui-iggrid-columnmoving-dropdown-listitem-hover ui-state-active ui-state-hover",columnMovingDropDownItemText:"ui-iggrid-columnmoving-dropdown-ddlistitemtext",columnMovingIndicatorSelected:"ui-iggrid-hiding-indicator-selected",movingDialogItemList:"ui-iggrid-moving-dialog-columns",movingDialogListItem:"ui-widget-content",movingDialogListItemArrowUp:"ui-icon-arrowthick-1-n ui-button-icon-primary ui-icon",movingDialogListItemArrowDown:"ui-icon-arrowthick-1-s ui-button-icon-primary ui-icon",movingDialogListItemArrowButton:"ui-button ui-corner-all ui-button-icon-only ig-sorting-indicator",movingDialogListItemText:"ui-iggrid-dialog-text",movingDialogCloseButton:"ui-icon ui-icon-close"},events:{columnDragStart:"columnDragStart",columnDragEnd:"columnDragEnd",columnDragCanceled:"columnDragCanceled",columnMoving:"columnMoving",columnMoved:"columnMoved",movingDialogOpening:"movingDialogOpening",movingDialogOpened:"movingDialogOpened",movingDialogDragged:"movingDialogDragged",movingDialogClosing:"movingDialogClosing",movingDialogClosed:"movingDialogClosed",movingDialogContentsRendering:"movingDialogContentsRendering",movingDialogContentsRendered:"movingDialogContentsRendered",movingDialogMoveUpButtonPressed:"movingDialogMoveUpButtonPressed",movingDialogMoveDownButtonPressed:"movingDialogMoveDownButtonPressed",movingDialogDragColumnMoving:"movingDialogDragColumnMoving",movingDialogDragColumnMoved:"movingDialogDragColumnMoved"},_createWidget:function(){this.options.columnSettings=[];$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){this._cache={};this._cKey="";this._cIdx=-1;this._tKey="";this._tIdx=-1;this._oTh=null;this._cmib=null;this._cmit=null;this._movingDialog=null;this._groupBy=null;this._ddButtons={first:{text:this.options.dropDownMoveFirstText,func:$.proxy(this._moveFirst,this),icon:this.css.featureChooserFirstIcon},left:{text:this.options.dropDownMoveLeftText,func:$.proxy(this._moveLeft,this),icon:this.css.featureChooserLeftIcon},right:{text:this.options.dropDownMoveRightText,func:$.proxy(this._moveRight,this),icon:this.css.featureChooserRightIcon},last:{text:this.options.dropDownMoveLastText,func:$.proxy(this._moveLast,this),icon:this.css.featureChooserLastIcon}};this._hscroller=null;this._scroller={on:false,delay:-1};if(this.options.mode!=="immediate"&&this.options.mode!=="deferred"){this.options.mode="immediate"}if(this.options.mode==="immediate"&&this.options.moveType==="render"){this.options.moveType="dom"}if(this.options.addMovingDropdown===false){this.renderInFeatureChooser=false}},_setOption:function(key){if(key==="mode"||key==="columnSettings"||key==="addMovingDropdown"){throw new Error($.ig.Grid.locale.optionChangeNotSupported.replace("{optionName}",key))}$.Widget.prototype._setOption.apply(this,arguments)},destroy:function(){this.grid.moveColumn=this._gridMoveColumn;this._unregisterEvents();this._removeMoving();$.Widget.prototype.destroy.call(this);return this},moveColumn:function(column,target,after,inDom,callback){this._moveColumn(column,target,after,inDom,true,callback)},_headerCellRendered:function(event,args){if(this.grid.id()!==args.owner.id()){return}this._thRendered(args.th)},_headerRendering:function(){var i;for(i=0;i<this.grid.options.features.length;i++){if(this.grid.options.features[i].name==="GroupBy"){this._groupBy=this.grid.element.data("igGridGroupBy");break}}},_headerRendered:function(event,args){if(this.grid.id()!==args.owner.id()){return}this._thsRendered(args.table)},_gridFullyRendered:function(){this.grid.scrollContainer().bind("scroll",this._containerScrolledHandler);this._updateLayout()},_containerScrolled:function(event,args,fromParent){var grids,i,cmi;if(!this._autoScrolled){if(this.options.mode==="deferred"){this._adjustIndicators(event.originalEvent.detail,fromParent)}}grids=this.grid.element.find(".ui-iggrid-table");for(i=0;i<grids.length;i++){cmi=grids.eq(i).data("igGridColumnMoving");if(cmi){cmi._containerScrolled(event,args,true)}}},_columnFixed:function(){this._updateLayout()},_headerPicked:function(event,args){var $th=$(event.target).closest("th"),id=this._getIdOfTh($th),noCancel=true;args={columnKey:id,columnIndex:$th.index(),owner:this,header:$th,helper:args.helper};noCancel=this._trigger(this.events.columnDragStart,event,args);if(noCancel){if(this.grid._focusedElement){this.grid._focusedElement.blur()}this._thPicked($th,id)}return noCancel},_headerDragged:function(event,args){var left;if(this._oPos){left=this._oPos.left>args.position.left}else{left=args.originalPosition.left>args.position.left}this._oPos={left:args.position.left};if(this.options.mode==="deferred"){this._thDragedDeferred(args.helper,args.offset,left)}else if(this._thDragged(args.helper,args.offset,left)){args.originalPosition.left=args.position.left}},_headerDropped:function(event,args){var $th=$(event.target).closest("th"),id=this._getIdOfTh($th),noCancel=true;args={columnKey:id,columnIndex:$th.index(),owner:this,header:$th,helper:args.helper};noCancel=this._trigger(this.events.columnDragEnd,event,args);if(noCancel){this._thDropped()}else{this._trigger(this.events.columnDragCanceled,event,args)}return noCancel},_dialogUpPressed:function(event){var tar=$(event.target),item=tar.closest("li"),parent=item.parent(),idx=item.index(),iItem=idx===0?item.parent().children().last().attr("data-value"):item.prev().attr("data-value"),iDir=idx===0?true:false,col=tar.closest("span").attr("datakey"),a,oc;a={owner:this,movingDialog:this._movingDialog,columnKey:col,columnIndex:idx,targetIndex:idx===0?parent.children().length-1:idx-1};this._cKey=col;this._cIdx=a.columnIndex;this._tIdx=a.targetIndex;oc=this._moveColumn(col,iItem,iDir,this.options.moveType==="dom",false);if(!oc){return false}if(idx===0){item.detach().insertAfter(parent.children("li:last"))}else{item.detach().insertBefore(parent.children("li:eq("+(idx-1)+")"))}this._trigger(this.events.movingDialogMoveUpButtonPressed,event,a)},_dialogDownPressed:function(event){var tar=$(event.target),item=tar.closest("li"),parent=item.parent(),idx=item.index(),iItem=idx===item.siblings().length?item.parent().children().first().attr("data-value"):item.next().attr("data-value"),iDir=idx===item.siblings().length?false:true,col=tar.closest("span").attr("datakey"),a,oc;a={owner:this,movingDialog:this._movingDialog,columnKey:col,columnIndex:idx,targetIndex:idx===parent.children().length-1?0:idx+1};this._cKey=col;this._cIdx=a.columnIndex;this._tIdx=a.targetIndex;oc=this._moveColumn(col,iItem,iDir,this.options.moveType==="dom",false);if(!oc){return false}if(idx===item.parent().children().length-1){item.detach().insertBefore(parent.children("li:first"))}else{item.detach().insertAfter(parent.children("li:eq("+idx+")"))}this._trigger(this.events.movingDialogMoveDownButtonPressed,event,a)},_dialogRearranging:function(event,args){var noCancel,a,oc,column=$(args.draggable),target=$(args.element),cid=column.attr("data-value"),tid=target.attr("data-value"),aft=$(args.element).closest("ul[data-depth=0]").data("igTree")._validationObject.dropAfter,cix=column.index(),tix=target.index();tix=tix>cix?aft?tix:tix-1:aft?tix+1:tix;a={owner:this,movingDialog:this._movingDialog,columnKey:cid,columnIndex:cix,targetIndex:tix};if(cix===tix){return false}noCancel=this._trigger(this.events.movingDialogDragColumnMoving,event,a);if(noCancel){this._cKey=cid;this._cIdx=a.columnIndex;this._tIdx=a.targetIndex;oc=this._moveColumn(cid,tid,aft,this.options.moveType==="dom",false);if(!oc){return false}a.movingDialog.find("div.ui-state-highlight").remove();this._trigger(this.events.movingDialogDragColumnMoved,event,a);return true}return false},_dialogRearranged:function(event,args){this._bindUpDownDialogButtons(args.element.parent())},_dialogDragged:function(event,args){this._trigger(this.events.movingDialogDragged,null,{movingDialogElement:event.target,owner:this,originalPosition:args.originalPosition,position:args.position})},_dialogOpening:function(event,args){var noCancel;noCancel=this._trigger(this.events.movingDialogOpening,null,{movingDialogElement:event.target,owner:this});if(noCancel){this._renderMovingDialogContent(event,args);this._trigger(this.events.movingDialogOpened,null,{movingDialogElement:event.target,owner:this})}return noCancel},_dialogClosing:function(event){return this._trigger(this.events.movingDialogClosing,null,{movingDialogElement:event.target,owner:this})},_dialogClosed:function(event){this._trigger(this.events.movingDialogClosed,null,{movingDialogElement:event.target,owner:this})},_dropDownMouseDown:function(event){var ind=$(event.target);this._toggleDropDown(ind,$("div[data-moving-inddropdown='"+this.grid.id()+"']"));this._cancelEvent(event)},_dropDownKeyDown:function(event){var sItem,nItem,nItemB,dropdown=$("div[data-moving-inddropdown='"+this.grid.id()+"']");if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){sItem=dropdown.find("ul .ui-state-hover:first");if(dropdown.is(":visible")&&sItem.length>0){sItem.trigger("mousedown")}this._toggleDropDown($(event.target),dropdown,false);this._cancelEvent(event)}else if(event.keyCode===$.ui.keyCode.ESCAPE){this._toggleDropDown($(event.target),dropdown,false);this._cancelEvent(event)}else if(event.keyCode===$.ui.keyCode.DOWN||event.keyCode===$.ui.keyCode.UP){if(dropdown.is(":visible")){sItem=dropdown.find("ul .ui-state-hover:first").closest("li");if(sItem.length===0){nItem=dropdown.find("ul li:eq(0)")}else{if(sItem.index()===0&&event.keyCode===$.ui.keyCode.UP){nItem=sItem.parent().children(":last")}else{nItem=event.keyCode===$.ui.keyCode.DOWN?sItem.next():sItem.prev()}}dropdown.find("ul .ui-state-hover").removeClass(this.css.columnMovingDropDownItemHover);nItemB=nItem.find("[role='button']");if(nItemB.length>0){nItem=nItemB}nItem.addClass(this.css.columnMovingDropDownItemHover)}this._cancelEvent(event)}},_dropDownButtonMouseOver:function(event){$(event.currentTarget).addClass(this.css.columnMovingDropDownItemHover)},_dropDownButtonMouseOut:function(event){$(event.currentTarget).removeClass(this.css.columnMovingDropDownItemHover)},_moveLeft:function(event,args){var sib=this._getAllSiblings(args),cid,tid,i;for(i=0;i<sib.length;i++){cid=sib[i].key||sib[i].identifier;if(cid===args){if(i>0){this._cKey=args;this._cIdx=i;this._tIdx=i-1;tid=sib[i-1].key||sib[i-1].identifier;this._moveColumn(cid,tid,false,this.options.moveType==="dom",false)}break}}},_moveRight:function(event,args){var sib=this._getAllSiblings(args),cid,tid,i;for(i=0;i<sib.length;i++){cid=sib[i].key||sib[i].identifier;if(cid===args){if(i<sib.length-1){this._cKey=args;this._cIdx=i;this._tIdx=i+1;tid=sib[i+1].key||sib[i+1].identifier;this._moveColumn(cid,tid,true,this.options.moveType==="dom",false)}break}}},_moveFirst:function(event,args){var sib=this._getAllSiblings(args),cid,tid,i;for(i=0;i<sib.length;i++){cid=sib[i].key||sib[i].identifier;if(cid===args){if(i!==0){this._cKey=args;this._cIdx=i;this._tIdx=0;tid=sib[0].key||sib[0].identifier;this._moveColumn(cid,tid,false,this.options.moveType==="dom",false)}break}}},_moveLast:function(event,args){var sib=this._getAllSiblings(args),cid,tid,i;for(i=0;i<sib.length;i++){cid=sib[i].key||sib[i].identifier;if(cid===args){if(i!==sib.length-1){this._cKey=args;this._cIdx=i;this._tIdx=sib.length-1;tid=sib[sib.length-1].key||sib[sib.length-1].identifier;this._moveColumn(cid,tid,true,this.options.moveType==="dom",false)}break}}},_headerMouseOver:function(event){$(event.target).closest("th").addClass(this.css.headerCellMouseOver)},_headerMouseOut:function(event){$(event.target).closest("th").removeClass(this.css.headerCellMouseOver)},_renderHelpers:function(){var existingBottomIndicator=this.grid._rootContainer().children("[id$='_moving_indicator_bottom']"),existingTopIndicator=this.grid._rootContainer().children("[id$='_moving_indicator_top']");if(existingBottomIndicator.length>0&&existingTopIndicator.length>0){this._cmib=existingBottomIndicator;this._cmib.data("users",this._cmib.data("users")+1);this._cmit=existingTopIndicator;this._cmit.data("users",this._cmit.data("users")+1)}else{this._cmib=$("<div>&nbsp;</div>").attr("id",this.grid.id()+"_moving_indicator_bottom").addClass(this.css.dragIndicatorBottom).css({position:"absolute","z-index":"1000000",width:"16px",height:"16px",display:"none"}).appendTo(this.grid._rootContainer());this._cmit=$("<div>&nbsp;</div>").attr("id",this.grid.id()+"_moving_indicator_top").addClass(this.css.dragIndicatorTop).css({position:"absolute","z-index":"1000000",width:"16px",height:"16px",display:"none"}).appendTo(this.grid._rootContainer())}},_renderFeatureChooser:function(col,th){var fc=this.grid.element.data("igGridFeatureChooser");if(fc&&this.renderInFeatureChooser){if(fc._shouldRenderInFeatureChooser(col)===true){this._addMoveButtonsInFeatureChooser(fc,col)}else{this._renderMovingDropDownIndicator(th,col);this.grid._enableHeaderCellFeature(th)}}},_renderMovingDropDownIndicator:function(th,col){var $button,$anchor,$container,self=this;$button=$("<span></span>").addClass(this.css.dropDownButton);$anchor=$("<a></a>").attr("href","#").attr("th-remove-focus","").attr("title",this.options.movingToolTipMove).attr("id",this.grid.id()+"_moving_headerButton_"+col).bind({keydown:this._dropDownKeyHandler,blur:function(e){self._toggleDropDown($(e.target),$("div[data-moving-inddropdown='"+self.grid.id()+"']"),true)},mousedown:this._dropDownButtonHandler,mouseup:this._cancelEventHandler,click:this._cancelEventHandler});$container=$("<div></div>").addClass(this.css.dropDownIndicatorContainer).appendTo(th);$button.appendTo($anchor);$anchor.appendTo($container);this._needToRenderDropDown=true},_renderMovingDialogContent:function(){var $content=this._movingDialog.igGridModalDialog("getContent"),movingDialog=this._movingDialog,$tree=$content.find("#"+this.grid.id()+"_dialog_tree"),noCancel;noCancel=this._trigger(this.events.movingDialogContentsRendering,null,{movingDialogElement:movingDialog,owner:this});if(noCancel){if($tree.length>0){$tree.igTree("option","dataSource",this._getClonedDataSource(this.grid._visibleMchColumns()||this.grid._visibleColumns()))}else{$tree=this._initializeTree($content)}this._bindUpDownDialogButtons($tree);this._trigger(this.events.movingDialogContentsRendered,null,{movingDialogElement:movingDialog,owner:this})}},_initializeTree:function(content){var self=this,markup=self.options.movingDialogDropTooltipMarkup.replace("{text}",self.options.movingDialogDropTooltipText);return $("<ul id='"+this.grid.id()+"_dialog_tree'></ul>").appendTo(content).igTree({dataSourceType:"json",dataSource:this._getClonedDataSource(this.grid._visibleMchColumns()||this.grid._visibleColumns()),bindings:{primaryKey:"key",textKey:"headerText",valueKey:"key",childDataProperty:"group",nodeContentTemplate:this._getTreeTemplate()},dragAndDrop:true,dragAndDropSettings:{dragAndDropMode:"move",revert:true,zIndex:1000001,moveBetweenMarkup:markup,customDropValidation:function(col){var context=$(this),$col=$(col);if(self._isColumnMovable($col.attr("data-value"))){if(context.is("li")&&context.parent()[0]===$col.parent()[0]){return true}}return false},containment:false},nodeDropping:this._dialogRearrangingHandler,nodeDropped:this._dialogRearrangedHandler,selectionChanging:function(){return false}})},_getClonedDataSource:function(ds){return jQuery.extend(true,[],ds,this._cloneMovable(ds))},_cloneMovable:function(ds){var self=this,movableClone=[],idx=0;$.each(ds,function(){if(this.group){movableClone.push({movable:self._isColumnMovable(this.key,idx++),group:self._cloneMovable(this.group),key:this.key||this.identifier||idx})}else{movableClone.push({movable:self._isColumnMovable(this.key,idx++),key:this.key||idx})}});return movableClone},_getTreeTemplate:function(){var tmpl="",up,down,wrapper,data;data="<span>${headerText}</span>";wrapper="<span class='"+this.css.movingDialogListItemArrowButton+"'>";up=wrapper+"<span id='"+this.grid.id()+"_moving_dialog_${key}_up' title='"+this.options.movingDialogCaptionButtonAsc+"' role='button' datakey='${key}' class='"+this.css.movingDialogListItemArrowUp+"' style='"+"margin-top:-10px;'></span></span>";down=wrapper+"<span id='"+this.grid.id()+"_moving_dialog_${key}_down' title='"+this.options.movingDialogCaptionButtonDesc+"' role='button' datakey='${key}' class='"+this.css.movingDialogListItemArrowDown+"' style='"+"margin-top:-10px;'></span></span>";wrapper+="</span>";tmpl+="{{if ${movable} }}";tmpl+=up+down+data;tmpl+="{{else}}";tmpl+=wrapper+wrapper+data;tmpl+="{{/if}}";return tmpl},_renderMovingDialog:function(){var containment,o=this.options,$captionButtonContainer,$closeButton,movingDialog;if(this.options.columnMovingDialogContainment==="owner"){containment=this.grid.container()}else{containment="window"}movingDialog=$("<div></div>").appendTo(this.grid._rootContainer()).attr("id",this.grid.id()+"_moving_movingDialog");this._movingDialog=movingDialog;movingDialog.igGridModalDialog({containment:containment,renderFooterButtons:false,modalDialogCaptionText:o.movingDialogCaptionText,modalDialogWidth:o.movingDialogWidth,modalDialogHeight:o.movingDialogHeight,animationDuration:o.movingDialogAnimationDuration,gridContainer:this.grid.container(),modalDialogOpening:this._dialogOpeningHandler,modalDialogMoving:this._dialogDraggedHandler,modalDialogClosing:this._dialogClosingHandler,modalDialogClosed:this._dialogClosedHandler});$captionButtonContainer=movingDialog.igGridModalDialog("getCaptionButtonContainer");$closeButton=$("<button></button>").attr("id",this.grid.id()+"_moving_movingDialog_closeButton").appendTo($captionButtonContainer);$closeButton.igButton({onlyIcons:true,icons:{primary:this.css.movingDialogCloseButton},width:"20px",height:"20px",click:this._dialogCloseButtonHandler})},_renderDropDown:function(element){var self=this,dropDown,list;dropDown=$("<div data-moving-inddropdown='"+this.grid.id()+"'></div>").css("position","absolute").css("display","none").addClass(this.css.columnMovingDropDown).appendTo(this.grid._rootContainer());list=$('<ul tabindex="0"></ul>').addClass(this.css.columnMovingDropDownList).appendTo(dropDown);$.each(this._ddButtons,function(key,val){$("<li></li>").addClass(self.css.columnMovingDropDownItem).attr("data-key",key).bind({mouseover:self._dropDownButtonMouseOverHandler,mouseout:self._dropDownButtonMouseOutHandler}).append($("<span></span>").addClass(self.css.dropDownIconContainer).append($("<span></span>").addClass(val.icon))).append($("<span></span>").addClass(self.css.columnMovingDropDownItemText).text(val.text)).appendTo(list)});$("<a></a>").appendTo($("<li></li>").appendTo(list)).igButton({labelText:this.options.movingDialogCaptionText,mousedown:function(event){if(event.target){setTimeout(function(){$(event.target).removeClass("ui-state-active")},0)}self._toggleDropDown(element,dropDown,true);self._openMovingDialog(element,dropDown,true)}});return dropDown},_toggleDropDown:function(element,dropDown,isCalledFromBlur){var th,id,isLast,offset,rOffset,left,isVisible=dropDown.is(":visible")===true,nth=element?element.closest("th"):null,nid=nth?nth.attr("id")||nth.attr("data-mch-id"):null,self=this;if(dropDown.data("isAnimating")===true||nid!==null&&this._currentlyToggled!==nid&&isCalledFromBlur===true||isVisible===false&&isCalledFromBlur===true){return}if(!isVisible){th=nth;isLast=th.parent().children().length-th.index()<=2;offset=$.ig.util.offset(th);if(isLast){left=offset.left+th.outerWidth()-dropDown.outerWidth()}else{left=offset.left}rOffset=$.ig.util.getRelativeOffset(dropDown);left=Math.max(0,left-rOffset.left);dropDown.css("top",offset.top+th.outerHeight()-rOffset.top);dropDown.css("left",left);$.each(this._ddButtons,function(key,value){dropDown.find("li[data-key='"+key+"']").bind("mousedown.temp",function(event){self._toggleDropDown(element,dropDown,true);id=th.attr("id");if(id){id=id.replace(self.grid.id()+"_","")}else{id=th.attr("data-mch-id")}value.func(null,id);event.stopPropagation();event.preventDefault()})});this._currentlyToggled=th.attr("id")||th.attr("data-mch-id")}else{$.each(this._ddButtons,function(key){dropDown.find("li[data-key='"+key+"']").unbind("mousedown.temp")})}dropDown.data("isAnimating",true);dropDown.toggle(200,function(){if(dropDown.is(":visible")===true){th.find("a").focus();if(element){element.addClass(self.css.columnMovingIndicatorSelected);element.attr("data-indicator-selected","true")}}else{if(element){element.removeClass(self.css.columnMovingIndicatorSelected);element.removeAttr("data-indicator-selected")}}dropDown.data("isAnimating",false)})},_renderSubmenuFC:function(columnKey,$submenu){var $ul,moveColumns,moveLeft,moveRight,moveFirst,moveLast;$ul=$('<ul class="'+this.css.featureChooserSubmenu+'"></ul>').appendTo($submenu);moveColumns={name:"ColumnMovingDialog",text:this.options.movingDialogDisplayText,iconClass:this.css.featureChooserMovingDialogIcon,method:this._openMovingDialogHandler};moveLeft={name:"Left",text:this.options.dropDownMoveLeftText,iconClass:this.css.featureChooserLeftIcon,method:$.proxy(this._moveLeft,this)};moveRight={name:"Right",text:this.options.dropDownMoveRightText,iconClass:this.css.featureChooserRightIcon,method:$.proxy(this._moveRight,this)};moveFirst={name:"First",text:this.options.dropDownMoveFirstText,iconClass:this.css.featureChooserFirstIcon,method:$.proxy(this._moveFirst,this)};moveLast={name:"Last",text:this.options.dropDownMoveLastText,iconClass:this.css.featureChooserLastIcon,method:$.proxy(this._moveLast,this)};this._renderSubmenuFCItem(moveColumns,$ul,columnKey,$submenu);this._renderSubmenuFCItem(moveFirst,$ul,columnKey,$submenu);this._renderSubmenuFCItem(moveLeft,$ul,columnKey,$submenu);this._renderSubmenuFCItem(moveRight,$ul,columnKey,$submenu);this._renderSubmenuFCItem(moveLast,$ul,columnKey,$submenu)},_renderSubmenuFCItem:function(obj,$ul,columnKey,$submenu){var $li,text=obj.text,html,fnBlur,$next,css=this.css,id=this.grid.id()+"_featurechooser_dd_li_"+columnKey+"_"+obj.name,method=obj.method;fnBlur=function($e){setTimeout(function(){$e.blur()},50)};html='<li tabindex="0" data-fc-item="1" class="'+this.css.featureChooserSubmenuItem+'" id="'+id+'" title="'+text+'">'+text+"</li>";$li=$(html).appendTo($ul);$li.bind({keydown:function(event){var keyCode=event.keyCode;switch(keyCode){case $.ui.keyCode.ENTER:case $.ui.keyCode.SPACE:method(event,columnKey);fnBlur($(event.target));break;case $.ui.keyCode.DOWN:$next=$li.next();if($next.length===0){$ul.find("li:first").focus()}else{$next.focus()}break;case $.ui.keyCode.UP:$li.prev().focus();if($li.prev().length===0){$("#"+$submenu.data("buttonId")).focus()}break;case $.ui.keyCode.ESCAPE:fnBlur($(event.target));break}},mousedown:function(e){method(e,columnKey);fnBlur($(e.target))},mouseover:function(){$(this).addClass(css.featureChooserSubmenuItemMouserOver)},mouseleave:function(){$(this).removeClass(css.featureChooserSubmenuItemMouserOver)}})},_addMoveButtonsInFeatureChooser:function(fc,key){fc._renderInFeatureChooser(key,{name:"ColumnMovingDropDown",text:this.options.featureChooserSubmenuText,iconClass:"ui-iggrid-featurechooser-li-iconcontainer ui-icon ui-iggrid-icon-move",methodRenderSubmenu:$.proxy(this._renderSubmenuFC,this),order:1,groupName:"dropdown",groupOrder:4,type:"dropdown",state:"hide"})},_moveColumn:function(column,target,after,inDom,fromApi,callback){var noCancel=true,args;if(fromApi===false){args={columnKey:this._cKey,columnIndex:this._cIdx,targetIndex:this._tIdx,owner:this};noCancel=this._trigger(this.events.columnMoving,null,args)}if(noCancel){this._movingDirty=true;this.grid.moveColumn(column,target,after,inDom,callback);if(fromApi===false){delete args.columnIndex;delete args.targetIndex;args.oldIndex=this._cIdx;args.newIndex=this._tIdx;this._triggerColumnMovedAsync(args)}return true}return false},_moveColumnOverwrite:function(column,target,after,inDom,callback){var mp,fixing,isgh,i;this._oldColsSave=this.grid._oldCols?jQuery.extend(true,[],this.grid._oldCols):null;this._colsSave=this.grid.options.columns?jQuery.extend(true,[],this.grid.options.columns):null;mp=this._gridMoveColumn.apply(this.grid,[column,target,after,inDom,callback]);if(mp){this.grid._oldCols=this._oldColsSave;if(this.grid._oldCols){this.grid._generateColumnFlatStructure(this.grid._oldCols)}else{this.grid.options.columns=this._colsSave}fixing=this.grid.element.data("igGridColumnFixing");isgh=!!this.grid._getMultiHeaderColumnById(mp.column);this.grid._columnMovingResets();if(mp.columnFixed){fixing._unfixColumnInternal(mp.column,isgh,mp.target,mp.after)}if(mp.targetFixed){fixing._fixColumnInternal(mp.column,isgh,mp.target,mp.after)}this.grid._fixedColumns=[];for(i=0;i<this.grid.options.columns.length;i++){if(this.grid.options.columns[i].fixed){this.grid._fixedColumns.push(this.grid.options.columns[i])}}this._updateLayout();if(callback){$.ig.util.invokeCallback(callback,[this.grid.options.columns])}}},_getAllSiblings:function(col){var fixing=this.grid.hasFixedColumns(),fixingDir=this.grid.fixingDirection(),sib=this._cache.siblings[col],fsib=fixing?this._cache.fixedSiblings[col]:null;if(fixing&&fsib&&fsib.length>0){if(fixingDir==="left"){return fsib.concat(sib)}return sib.concat(fsib)}return sib},_fixingFilter:function(cols,fixed){if(fixed){return $.grep(cols,this._isColFixed)}return $.grep(cols,this._isColUnfixed)},_isColFixed:function(col){return col.fixed},_isColUnfixed:function(col){return!col.fixed},_thRendered:function(th){var cid=this._getIdOfTh(th),cix=th.index("not[data-skip='true']");if(this._isColumnMovable(cid,cix)===true){this._markForMoving(th);if(this.options.addMovingDropdown===true){this._renderFeatureChooser(cid,th)}}},_thsRendered:function(){if(this.options.mode==="deferred"){this._renderHelpers()}if(this.options.addMovingDropdown===true){if(!this._movingDialog||this._movingDialog instanceof jQuery&&this._movingDialog.length===0){this._renderMovingDialog()}if($("div[data-moving-inddropdown='"+this.grid.id()+"']").length===0){this._renderDropDown()}}},_thPicked:function(th,id){this._cKey=id;this._cIdx=th.index();this._currentlyDraggedFixed=this.grid._isFixedElement(th);this._updateLayout();if(this.options.mode==="immediate"){if(this.options.hideHeaderContentsDuringDrag===true){th.children().not("div[data-hiddencolindicator]").hide()}this._oTh=th}},_thDragedDeferred:function(helper,pos,left){var movingOpts=this._moArrays[this._cKey],mo,targetLeft,targetPosition,scrollLeft=0,dragX,i;if(this._hscroller.length>0){scrollLeft=this._hscroller.scrollLeft()}dragX=left===true?pos.left:pos.left+helper.width();dragX+=this._getAbsoluteScroll(this.grid.headersTable());if(!this._gridReady()||this._movingDirty){return}for(i=0;i<movingOpts.length;i++){mo=movingOpts[i];targetLeft=mo.position;if(dragX>targetLeft-this.options.movingAcceptanceTolerance&&dragX<targetLeft+this.options.movingAcceptanceTolerance){this._activeMO=mo;if(dragX-targetLeft>0){this._tKey=mo.after||mo.before;this._aft=mo.after?false:true;targetPosition=this._cache.columns[this._tKey];this._showIndicators(targetLeft-this._getAbsoluteScroll(this.grid.headersTable()),targetPosition.element.offset().top,targetPosition.dimensions,mo.fixing?"right":null)}else{this._tKey=mo.before||mo.after;this._aft=mo.before?true:false;targetPosition=this._cache.columns[this._tKey];this._showIndicators(targetLeft-this._getAbsoluteScroll(this.grid.headersTable()),targetPosition.element.offset().top,targetPosition.dimensions,mo.fixing?"left":null)}break}}if(this._hscroller.length>0){this._checkScroll(scrollLeft,dragX,left)}return false},_thDragged:function(helper,pos,left){var movingOpts=this._moArrays[this._cKey],mo,targetLeft,scrollLeft=0,dragX,i,after,updateEvent=false;if(this._hscroller.length>0){scrollLeft=this._hscroller.scrollLeft()}dragX=left===true?pos.left:pos.left+helper.width();dragX+=this._getAbsoluteScroll(this.grid.headersTable());if(!this._gridReady()||this._movingDirty){return}for(i=0;i<movingOpts.length;i++){mo=movingOpts[i];targetLeft=mo.position;if(dragX>targetLeft-this.options.movingAcceptanceTolerance&&dragX<targetLeft+this.options.movingAcceptanceTolerance){this._activeMO=mo;after=dragX-targetLeft<=0&&mo.before!==null;if(!mo.fixing&&(mo.after===this._cKey&&after||mo.before===this._cKey&&!after)){continue}this._tKey=after?mo.before:mo.after;if(this._cKey!==this._tKey&&this._cKey!==this._activeMO.after||this._activeMO.fixing===true&&this._tKey!==this._cKey){if(mo.fixing&&(mo.after===this._cKey||mo.before===this._cKey)){if(Math.abs(dragX-targetLeft)<this._cache.columns[this._tKey].dimensions.width/3){continue}}if(this._cKey&&this._tKey){this._moveColumn(this._cKey,this._tKey,after,true,false)}updateEvent=true;break}}}if(this._hscroller.length>0){this._checkScroll(scrollLeft,dragX,left)}return updateEvent},_thDropped:function(){if(this.options.mode==="immediate"){if(this.options.hideHeaderContentsDuringDrag===true){this._oTh.children().show()}this._scroller.on=false;return}this._hideIndicators();if(this._activeMO&&(this._cKey!==this._tKey&&this._cKey!==this._activeMO.after||this._activeMO.fixing===true&&this._tKey!==this._cKey)){this._moveColumn(this._cKey,this._tKey,this._aft,this.options.moveType==="dom",false)}delete this._cKey;delete this._tKey;delete this._aft;delete this._activeMO;$(".ui-draggable-dragging").hide();this._scroller.on=false
},_isColumnMovable:function(col,idx){var i,cs;for(i=0;i<this.options.columnSettings.length;i++){cs=this.options.columnSettings[i];if(cs.columnIndex){if(i===idx){return cs.allowMoving}}if(cs.columnKey){if(col===cs.columnKey){return cs.allowMoving}}}return true},_isColumnGroupable:function(col){var gbColumnSetting=this._groupBy._findColumnSetting(this._getIdOfTh(col));return gbColumnSetting&&gbColumnSetting.allowGrouping},_getIdOfTh:function(th){var mchid=th.attr("data-mch-id");if(mchid){return mchid}return th.attr("id").replace(this.grid.id()+"_","")},_getThById:function(id){return $("th[data-mch-id='"+id+"'],th[id='"+this.grid.id()+"_"+id+"']")},_adjustIndicators:function(delta,fromParent){var newl=parseInt(this._cmib.css("left"),10)-delta,fhr,fhrt;this._cmib.css("left",newl);this._cmit.css("left",newl);if(fromParent){fhr=this.grid.headersTable().find("tr").first();fhrt=fhr.offset().top;this._cmib.css("top",fhrt-16-$.ig.util.getRelativeOffset(this._cmib).top);this._cmit.css("top",fhrt+fhr.height()-$.ig.util.getRelativeOffset(this._cmit).top)}},_showIndicators:function(left,top,dim,tilt){if(tilt==="left"){this._cmib.removeClass(this.css.dragIndicatorRight).addClass(this.css.dragIndicatorLeft);this._cmit.removeClass(this.css.dragIndicatorRight).addClass(this.css.dragIndicatorLeft);this._cmit.css("left",left-12-$.ig.util.getRelativeOffset(this._cmib).left).show();this._cmit.css("top",top-14-$.ig.util.getRelativeOffset(this._cmib).top);this._cmib.css("left",left-12-$.ig.util.getRelativeOffset(this._cmit).left).show();this._cmib.css("top",top+dim.height-2-$.ig.util.getRelativeOffset(this._cmit).top)}else if(tilt==="right"){this._cmib.removeClass(this.css.dragIndicatorLeft).addClass(this.css.dragIndicatorRight);this._cmit.removeClass(this.css.dragIndicatorLeft).addClass(this.css.dragIndicatorRight);this._cmit.css("left",left-4-$.ig.util.getRelativeOffset(this._cmib).left).show();this._cmit.css("top",top-14-$.ig.util.getRelativeOffset(this._cmib).top);this._cmib.css("left",left-4-$.ig.util.getRelativeOffset(this._cmit).left).show();this._cmib.css("top",top+dim.height-2-$.ig.util.getRelativeOffset(this._cmit).top)}else{this._cmib.removeClass(this.css.dragIndicatorRight).removeClass(this.css.dragIndicatorLeft);this._cmit.removeClass(this.css.dragIndicatorRight).removeClass(this.css.dragIndicatorLeft);this._cmit.css("left",left-8-$.ig.util.getRelativeOffset(this._cmib).left).show();this._cmit.css("top",top-16-$.ig.util.getRelativeOffset(this._cmib).top);this._cmib.css("left",left-8-$.ig.util.getRelativeOffset(this._cmit).left).show();this._cmib.css("top",top+dim.height-$.ig.util.getRelativeOffset(this._cmit).top)}},_hideIndicators:function(){this._cmib.hide();this._cmit.hide()},_markForMoving:function(col){if(col.data("draggable")||this._groupBy){if(this._isColumnGroupable(col)){col.bind("drag",this._moveHandler);col.bind("dragstop",this._dropHandler);col.bind("dragstart",this._dragHandler);return}col.attr("groupby-disabled","true")}col.draggable({containment:this.grid._rootContainer(),appendTo:this.grid.container(),distance:5,scroll:false,revert:"valid",helper:function(event){var th,clone;th=$(event.target).closest("th");clone=th.clone().css("overflow","hidden").css("z-index",1e4).width(th.width()).height(th.height()).attr("data-mch-id",null).attr("id",null).addClass("ui-widget ui-iggrid").wrap($('<div class="ui-iggrid-dragMarkup"></div>').width(th.outerWidth()).height(th.outerHeight())).parent();clone.find("div[data-hiddencolindicator]").remove();return clone},opacity:this.options.dragHelperOpacity,drag:this._moveHandler,stop:this._dropHandler,start:this._dragHandler});col.unbind("mouseover.moving").bind("mouseover.moving",this._headerMouseOverHandler);col.unbind("mouseout.moving").bind("mouseout.moving",this._headerMouseOutHandler)},_updateLayout:function(){var cols,self=this;if(!this._gridReady()){setTimeout(function(){self._updateLayout()},50);return}if(this.grid._oldCols){cols=$.grep(this.grid._oldCols,this.grid._columnVisible)}else{cols=this.grid._visibleColumns()}this._hscroller=this.grid._hscrollbarcontent();this._hscroller=this._hscroller.length>0?this._hscroller:this.grid.scrollContainer();this._cache.columns={};this._cache.siblings={};this._cache.fixedSiblings={};this._updateLayoutPerLevel(cols,true);this._createMovingOptions();delete this._movingDirty},_updateLayoutPerLevel:function(cols,firstLevel){var i,id,$th,os;for(i=0;i<cols.length;i++){id=cols[i].key||cols[i].identifier;$th=this._getThById(id);os=$th.offset();if(!os||$.type(os.left)!=="number"){os={left:0,top:0}}os.left=os.left+this._getAbsoluteScroll($th);this._cache.columns[id]={};this._cache.columns[id].element=$th;this._cache.columns[id].offset=os;this._cache.columns[id].dimensions={width:$th.outerWidth(),height:$th.outerHeight()};if(firstLevel){this._cache.fixedSiblings[id]=this._fixingFilter(cols,true);this._cache.siblings[id]=this._fixingFilter(cols,false)}else{this._cache.siblings[id]=cols}}for(i=0;i<cols.length;i++){if(cols[i].group&&cols[i].hidden!==true){this._updateLayoutPerLevel($.grep(cols[i].group,this.grid._columnVisible))}}},_createMovingOptions:function(){var col,us=this._cache.siblings,fs=this._cache.fixedSiblings,fixingDir=this.grid.fixingDirection(),umo,fmo,mo;this._moArrays={};for(col in us){if(us.hasOwnProperty(col)){umo=this._movingOptsForSiblings(us[col]);if(fs.hasOwnProperty(col)){fmo=this._movingOptsForSiblings(fs[col])}if(umo.length&&fmo.length){mo=this._combineMovingOptions(umo,fmo,fixingDir)}else if(umo.length){mo=umo}this._moArrays[col]=mo}}for(col in fs){if(fs.hasOwnProperty(col)&&!this._moArrays[col]){fmo=this._movingOptsForSiblings(fs[col]);this._moArrays[col]=fmo}}},_movingOptsForSiblings:function(siblings){var mo=[],pkey,ckey,i;if(siblings&&siblings.length){pkey=siblings[0].key||siblings[0].identifier;mo.push({before:null,after:pkey,position:this._cache.columns[pkey].offset.left,fixing:false});for(i=1;i<siblings.length;i++){ckey=siblings[i].key||siblings[i].identifier;mo.push({before:pkey,after:ckey,position:this._cache.columns[ckey].offset.left,fixing:false});pkey=ckey}mo.push({before:pkey,after:null,position:this._cache.columns[pkey].offset.left+this._cache.columns[pkey].dimensions.width,fixing:false})}return mo},_combineMovingOptions:function(umo,fmo,fixingDir){var combined,left,right;if(fixingDir==="left"){left=fmo;right=umo}else{left=umo;right=fmo}combined=left.slice(0,left.length-1);combined.push({before:left[left.length-1].before,after:right[0].after,position:right[0].position,fixing:true});combined=combined.concat(right.slice(1,right.length));return combined},_getAbsoluteScroll:function(el){var cel=el,abs=0;while(cel.length>0&&cel.attr("id")!==this.grid._rootContainer().attr("id")){abs+=cel.scrollLeft();cel=cel.parent()}return abs},_openMovingDialog:function(){this._movingDialog.igGridModalDialog("openModalDialog")},_closeMovingDialog:function(e){this._movingDialog.igGridModalDialog("closeModalDialog");if(e){e.preventDefault()}},_triggerColumnMovedAsync:function(args){var self=this;if(!this._gridReady()){setTimeout(function(){self._triggerColumnMovedAsync(args)},50);return}this._trigger(this.events.columnMoved,null,args)},_gridReady:function(){return!(this.grid._loadingIndicator&&this.grid._loadingIndicator._indicator.is(":visible"))},_bindUpDownDialogButtons:function(list){list.find("span[class='"+this.css.movingDialogListItemArrowDown+"']").unbind("mousedown",this._dialogDownHandler).bind("mousedown",this._dialogDownHandler);list.find("span[class='"+this.css.movingDialogListItemArrowUp+"']").unbind("mousedown",this._dialogUpHandler).bind("mousedown",this._dialogUpHandler)},_checkScroll:function(scrollLeft,dragX,left){var sbw=this.grid._hasVerticalScrollbar===true?this.grid._scrollbarWidth():0;if(this._currentlyDraggedFixed){return}dragX-=this._hscroller.offset().left;if(scrollLeft>0&&left===true&&dragX-scrollLeft<this.options.movingScrollTolerance){this._updateScroller(true,dragX-scrollLeft)}else if(scrollLeft<this._hscroller[0].scrollWidth+sbw-this._hscroller.outerWidth()&&left===false&&dragX-scrollLeft>this._hscroller.outerWidth()-this.options.movingScrollTolerance){this._updateScroller(false,this._hscroller.outerWidth()-dragX+scrollLeft)}else{this._stopScroller()}},_startScroller:function(left,delta){this._scroller.on=true;this._scroller.delay=delta*this.options.scrollSpeedMultiplier;this._scroller.direction=left===true?"left":"right";this._autoScroll()},_updateScroller:function(left,delta){if(this._scroller.on===false){this._startScroller(left,delta);return}this._scroller.delay=delta},_stopScroller:function(){this._scroller.on=false},_scrollGrid:function(){var sl=this._hscroller.scrollLeft(),delta,res,sbw;delta=this._scroller.direction==="left"?this.options.scrollDelta*-1:this.options.scrollDelta;res=sl+delta;sbw=this.grid._hasVerticalScrollbar===true?this.grid._scrollbarWidth():0;this._hscroller.scrollLeft(res);if(res<=0&&delta<0||res>=this._hscroller[0].scrollWidth+sbw-this._hscroller.outerWidth()&&delta>0){this._stopScroller()}if(this._hscroller[0].id.indexOf("_hscroller")>0){this.grid._synchronizeHScroll()}if(this.options.mode==="deferred"){this._adjustIndicators(delta)}if(this._scroller.on===true){setTimeout(this._autoScroll,this._scroller.delay)}},_cancelEvent:function(e){e.stopPropagation();e.preventDefault()},_columnMap:function(){return $.map(this.grid.options.columns,function(col){return{columnKey:col.key,enabled:true}})},_removeMoving:function(){var ths=this.grid.headersTable().find(">thead th"),i,th,mdl,removeContainer,fc;if(this._cmit&&this._cmit.length>0){if(this._cmit.data("users")===1){this._cmit.remove()}else{this._cmit.data("users",this._cmit.data("users")-1)}}if(this._cmib&&this._cmib.length>0){if(this._cmib.data("users")===1){this._cmib.remove()}else{this._cmib.data("users",this._cmib.data("users")-1)}}if(this.options.addMovingDropdown===true){mdl=this._movingDialog;if(mdl&&mdl instanceof jQuery){mdl.igGridModalDialog("destroy");mdl.remove()}$("div[data-moving-inddropdown='"+this.grid.id()+"']").remove()}fc=this.grid.element.data("igGridFeatureChooser");removeContainer=true;if(this.renderInFeatureChooser&&fc){fc._removeFeature("ColumnMovingDropDown",true);removeContainer=false}for(i=0;i<ths.length;++i){th=$(ths[i]);if(removeContainer){th.find(">div").find("span").unbind("mousedown",this._dropDownButtonHandler);th.find(">div").remove()}th.unbind("mouseover.moving",this._headerMouseOverHandler);th.unbind("mouseout.moving",this._headerMouseOutHandler);if(!this._grpByEnabled){if(th.data&&th.data("draggable")){th.draggable("destroy")}}else{th.unbind("draggabledrag",this._moveHandler);th.unbind("draggablestop",this._dropHandler);th.unbind("draggablestart",this._dragHandler)}}},_unregisterEvents:function(){this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.unbind("iggridheaderrendering",this._headerRenderingHandler);this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.unbind("iggridrendered",this._gridFullyRenderedHandler);this.grid.element.unbind("iggridresizingcolumnresized",this._columnStateChanged);this.grid.element.unbind("iggridcolumnscollectionmodified",this._columnStateChanged);this.grid.element.unbind("iggridpagingpagingdropdownrendered",this._columnStateChanged);this.grid.element.unbind("iggrid_columnsmoved",this._columnStateChanged);this.grid.headersTable().find("th").unbind("moving")},_registerEvents:function(){this.grid.element.bind("iggridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.bind("iggridheaderrendering",this._headerRenderingHandler);this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.bind("iggridrendered",this._gridFullyRenderedHandler);this.grid.element.bind("iggridresizingcolumnresized",this._columnStateChanged);this.grid.element.bind("iggridcolumnscollectionmodified",this._columnStateChanged);this.grid.element.bind("iggridpagingpagingdropdownrendered",this._columnStateChanged);this.grid.element.bind("iggrid_columnsmoved",this._columnStateChanged)},_createHandlers:function(){this._headerCellRenderedHandler=$.proxy(this._headerCellRendered,this);this._headerRenderingHandler=$.proxy(this._headerRendering,this);this._headerRenderedHandler=$.proxy(this._headerRendered,this);this._gridFullyRenderedHandler=$.proxy(this._gridFullyRendered,this);this._dragHandler=$.proxy(this._headerPicked,this);this._moveHandler=$.proxy(this._headerDragged,this);this._dropHandler=$.proxy(this._headerDropped,this);this._headerMouseOverHandler=$.proxy(this._headerMouseOver,this);this._headerMouseOutHandler=$.proxy(this._headerMouseOut,this);this._dropDownButtonHandler=$.proxy(this._dropDownMouseDown,this);this._dropDownKeyHandler=$.proxy(this._dropDownKeyDown,this);this._openMovingDialogHandler=$.proxy(this._openMovingDialog,this);this._dropDownButtonMouseOverHandler=$.proxy(this._dropDownButtonMouseOver,this);this._dropDownButtonMouseOutHandler=$.proxy(this._dropDownButtonMouseOut,this);this._dialogOpeningHandler=$.proxy(this._dialogOpening,this);this._dialogDraggedHandler=$.proxy(this._dialogDragged,this);this._dialogClosingHandler=$.proxy(this._dialogClosing,this);this._dialogClosedHandler=$.proxy(this._dialogClosed,this);this._dialogCloseButtonHandler=$.proxy(this._closeMovingDialog,this);this._dialogUpHandler=$.proxy(this._dialogUpPressed,this);this._dialogDownHandler=$.proxy(this._dialogDownPressed,this);this._dialogRearrangingHandler=$.proxy(this._dialogRearranging,this);this._dialogRearrangedHandler=$.proxy(this._dialogRearranged,this);this._columnStateChanged=$.proxy(this._updateLayout,this);this._cancelEventHandler=$.proxy(this._cancelEvent,this);this._autoScroll=$.proxy(this._scrollGrid,this);this._containerScrolledHandler=$.proxy(this._containerScrolled,this)},_injectGrid:function(gridInstance,isRebind){this.grid=gridInstance;if(isRebind===true){return}if(this.grid.element.igGridFeatureChooser!==undefined){this.grid.element.igGridFeatureChooser()}else{throw new Error($.ig.ColumnMoving.locale.featureChooserNotReferenced)}this._gridMoveColumn=this.grid.moveColumn;this.grid.moveColumn=$.proxy(this._moveColumnOverwrite,this);this._createHandlers();this._unregisterEvents();this._registerEvents()}});$.extend($.ui.igGridColumnMoving,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Feature Chooser 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	jquery.ui.mouse.js
 *	jquery.ui.draggable.js
 *	jquery.ui.resizable.js
 *	modernizr.js (Optional)
 *	infragistics.ui.popover.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.grid.shared.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igGridFeatureChooserPopover",$.ui.igPopover,{options:{gridId:"",targetButton:null,closeOnBlur:true,containment:null},_create:function(){$.extend($.ui.igGridFeatureChooserPopover.prototype.options,$.ui.igPopover.prototype.options);$.extend($.ui.igGridFeatureChooserPopover.prototype.css,$.ui.igPopover.prototype.css);$.ui.igPopover.prototype._create.apply(this)},isShown:function(){return this.container().is(":visible")},_setFCElementFocus:function(focus,$target){if($target===undefined||$target===null){$target=this.options.targetButton}this.options.targetButton.data("onFocus",focus);if(focus){$target.focus()}},registerElements:function(elements){var events,$targetButton=this.options.targetButton,self=this;events={focus:function(){setTimeout(function(){$targetButton.data("onFocus",true)},1)},blur:function(){$targetButton.data("onFocus",false);setTimeout(function(){if(!$targetButton.data("onFocus")&&self.isShown()){self._closePopover()}},10)}};elements.bind(events)},_createWidget:function(){var self=this,$targetButton;this._attachedToBody=true;this.options.content="";$.Widget.prototype._createWidget.apply(this,arguments);$.ui.igPopover.prototype._createWidget.apply(this,arguments);this._detachEventsFromTarget();$targetButton=this.options.targetButton;if(this.options.closeOnBlur){$targetButton.attr("tabindex","0");this._eventsFC={iggridfeaturechooserpopovershown:function(){self._setFCElementFocus(true)},iggridfeaturechooserpopoverhidden:function(){self._setFCElementFocus(false);self.popover.width("");self.popover.css({left:""})},mousedown:function(){setTimeout(function(){self._setFCElementFocus(true)},1)},touchstart:function(){setTimeout(function(){self._setFCElementFocus(true)},1)}};this.element.bind(this._eventsFC);this.registerElements($targetButton)}},_removeOriginalTitle:function(){},_positionPopover:function(){var $popover,availableWidth,mw=this.options.maxWidth,$containment=this.options.containment,$window=$(window);if(mw&&$.type(mw)==="string"){mw=parseInt(mw,10)}$popover=this.popover;if($popover){if($containment.offset().left>=$window.scrollLeft()){availableWidth=$window.width()+$window.scrollLeft()-$containment.offset().left}else{availableWidth=$window.width()}if(mw&&$.type(mw)==="number"&&mw<availableWidth){availableWidth=mw}this.popover.css("max-width",availableWidth)}$.ui.igPopover.prototype._positionPopover.apply(this,arguments)},destroy:function(){var $targetButton;if(this._eventsFCTargetButton){$targetButton=this.options.targetButton;$targetButton.unbind(this._eventsFCTargetButton)}if(this._eventsFC){this.element.unbind(this._eventsFC)}$.ui.igPopover.prototype.destroy.apply(this,arguments)}});$.extend($.ui.igGridFeatureChooserPopover,{version:"15.2.20152.1027"});$.ig=$.ig||{};$.ig.GridFeatureChooserSections=$.ig.GridFeatureChooserSections||{click:"click",toggle:"toggle",modalDialog:"modalDialog"};$.widget("ui.igGridFeatureChooser",{css:{featureChooserDropDown:"",headerButtonIcon:"ui-iggrid-featurechooserbutton ui-icon ui-icon-gear",headerButtonIconMouseOver:"ui-iggrid-header-icon-mouseover",headerButtonIconSelected:"ui-iggrid-header-icon-selected",listClass:"ui-iggrid-featurechooser-list ui-menu ui-widget ui-widget-content ui-corner-all",listItemClass:"ui-iggrid-featurechooserddlistitemicons ui-state-default",listItemContainer:"ui-iggrid-featurechooser-li-container",listItemIconContainer:"ui-iggrid-featurechooser-li-iconcontainer",itemSecondaryIconContainer:"ui-iggrid-featurechooser-secondaryicon-container",separator:"ui-iggrid-featurechooser-separator",listItemText:"ui-iggrid-featurechooserddlistitemtext",itemSelected:"item-selected",dropDownListItemHover:"ui-iggrid-featurechooser-listitem-hover ui-state-active ui-state-hover",dropDownButtonClasses:"ui-igbutton",dropDownButtonHoverClasses:"",dropDownButtonActiveClasses:"",dropDownButtonFocusClasses:"",dropDownButtonLabelClass:"",containerDelimiter:"ui-iggrid-featurechooser-container-delimiter",containerSection:"ui-iggrid-featurechooser-container-section",itemNoIcon:"ui-iggrid-featurechooserbutton ui-icon ui-icon-close",submenu:"ui-iggrid-featurechooser-submenu ui-widget-content ui-corner-all",submenuIcon:"ui-iggrid-featurechooser-submenuicon ui-icon ui-icon-triangle-1-s"},options:{dropDownWidth:null,animationDuration:400},events:{featureChooserRendering:"featureChooserRendering",featureChooserRendered:"featureChooserRendered",featureChooserDropDownOpening:"featureChooserDropDownOpening",featureChooserDropDownOpened:"featureChooserDropDownOpened",menuToggling:"menuToggling",featureToggling:"featureToggling",featureToggled:"featureToggled"},_createWidget:function(){$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){this.analyzedData={};this.data={};this._features=[];this._isFeaturesAnalyzed=false;this.isInitialized=false;this.grid=this.element.data("igGrid");this.gridId=this.element[0].id;this._analyzeGridFeaturesOptions();this._countRenderedFeatures=0;if(this._headerRenderedHandler){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler)}this._headerRenderedHandler=$.proxy(this._headerRendered,this);this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);if(this._gridDestroyedHandler){this.grid.element.unbind("igcontroldestroyed",this._gridDestroyedHandler)}this._gridDestroyedHandler=$.proxy(this.destroy,this);this.grid.element.bind("igcontroldestroyed",this._gridDestroyedHandler);if(this._virtualHorizontalScrollHandler){this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler)}this._virtualHorizontalScrollHandler=$.proxy(this._virtualHorizontalScroll,this);this.grid.element.bind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler)},_analyzeGridFeaturesOptions:function(){var i,features=this.grid.options.features,featuresLength=features.length;for(i=0;i<featuresLength;i++){this._features.push(features[i].name)}},shouldShowFeatureIcon:function(key){if(this.analyzedData[key]!==undefined&&this.analyzedData[key]!==null){return this.analyzedData[key].length<=1}return true},_setOption:function(){$.Widget.prototype._setOption.apply(this,arguments)},_id:function(name,suffix){var res=this.gridId+"_"+name;if(suffix!==undefined&&suffix!==null&&$.type(suffix)==="string"){res+="_"+suffix}return res},_isMetroIE:function(){return!$.ig.util.isIEOld&&$.ig.util.isIE&&(window.hasOwnProperty("ontouchstart")||navigator.MaxTouchPoints>0||navigator.msMaxTouchPoints>0)},_isTouchDevice:function(){var fcIconDisplay;if(this._isTouch===undefined){fcIconDisplay=this.grid.options.featureChooserIconDisplay;if(fcIconDisplay==="none"){this._isTouch=true}else if(fcIconDisplay==="always"){this._isTouch=false}else{this._isTouch=typeof Modernizr==="object"&&Modernizr.touch===true||this._isMetroIE()}}return this._isTouch},_callFeatureMethod:function(feature,isSelected,columnKey,event){var method,returnType=true,methodType=$.type(feature.method),featureData=this.grid.element.data("igGrid"+feature.name);if(methodType==="string"){if(featureData===undefined||featureData===null){return false}method=featureData[feature.method]}else if(methodType==="function"){method=feature.method}if(method===undefined||method===null){return false}if($.type(feature.method)==="string"){returnType=featureData[feature.method](event,columnKey,isSelected,feature.methodData)}else{returnType=feature.method(event,columnKey,isSelected,feature.methodData)}return returnType},_getFeatureByKeyName:function(columnKey,featureName){var i,feature=null,columnData=this.data[columnKey],columnDataLength;if(!columnData){return feature}columnDataLength=columnData.length;for(i=0;i<columnDataLength;i++){if(columnData[i].name===featureName){feature=columnData[i];break}}return feature},_clickFeature:function(event){var i,j,$target=$(event.target).data("data")!==undefined?$(event.target):$(event.currentTarget),d=$target.data("data"),self=this,isSelected=null,type=d.type,columnKey=d.columnKey,featureName=d.featureName,columnData=this.data[columnKey],columnDataLength=columnData.length,feature=null;feature=this._getFeatureByKeyName(columnKey,featureName);if(feature===null||feature===undefined){return}if(type==="toggle"){isSelected=!feature.isSelected}if(this._trigger(this.events.featureToggling,null,{target:$target,columnKey:columnKey,isToSelect:isSelected,featureName:"igGrid"+feature.name})===false){return}if(this._callFeatureMethod(feature,isSelected,columnKey,event)===false){return}if(type==="toggle"){feature.isSelected=isSelected;self._setSelectedItem(columnKey,isSelected,$("#"+self._id("featurechooser_dd_li_"+columnKey,featureName)));if(feature.updateOnClickAll===true){$.each(self.data,function(index,value){if(index!==columnKey){for(j=0;j<value.length;j++){if(value[j].name===featureName){break}}if(j===value.length){return true}columnData=self.data[index];if(columnData===null||columnData===undefined){return true}columnDataLength=columnData.length;for(i=0;i<columnDataLength;i++){if(columnData[i].name===featureName){columnData[i].isSelected=isSelected;break}}self._setSelectedItem(index,isSelected,$("#"+self._id("featurechooser_dd_li_"+index,value[j].name)))}})}}},_setListItemText:function(columnKey,featureName,text){$("#"+this._id("featurechooser_dd_li_"+columnKey,featureName)+" span.ui-iggrid-featurechooserddlistitemtext").text(text)},_analyzeFeatures:function(){if(this._isFeaturesAnalyzed===true){return}var i,k,cs=this.grid.options.columns,csLength=cs.length,featureName,featuresLength=this._features.length,features=this._features,newFeatures=[],columnsFeature,columnsFeatureLength,featureInstance,columnKey;for(i=0;i<featuresLength;i++){featureName=features[i];featureInstance=this.grid.element.data("igGrid"+featureName);if(featureInstance===undefined||featureInstance===null){continue}if(featureInstance.renderInFeatureChooser!==true){continue}if(featureInstance._columnMap===undefined||featureInstance._columnMap===null){continue}columnsFeature=featureInstance._columnMap();if(columnsFeature===false||columnsFeature===null||columnsFeature===undefined){continue}columnsFeatureLength=columnsFeature.length;if(columnsFeatureLength===0){for(k=0;k<csLength;k++){columnKey=cs[k].key;if(this.analyzedData[columnKey]===undefined||this.analyzedData[columnKey]===null){this.analyzedData[columnKey]=[]}if(this._isFeatureExistByColumnKey(featureName,columnKey)===true){continue}this.analyzedData[columnKey].push({name:featureName,method:null,text:null,iconClass:null,isSelected:false,columnCell:null,isActive:false})}}else{for(k=0;k<columnsFeatureLength;k++){columnKey=columnsFeature[k].columnKey;if(this.analyzedData[columnKey]===undefined||this.analyzedData[columnKey]===null){this.analyzedData[columnKey]=[]}if(columnsFeature[k].enabled!==true||this._isFeatureExistByColumnKey(featureName,columnKey)===true){continue}this.analyzedData[columnKey].push({name:featureName,method:null,text:null,iconClass:null,isSelected:false,columnCell:null,isActive:false})}}newFeatures.push({name:featureName,instance:featureInstance})}this._features=newFeatures;this._isFeaturesAnalyzed=true},_isFeatureExistByColumnKey:function(featureName,columnKey){var aData=this.analyzedData[columnKey],ret=false;if(aData===null||aData===undefined){return true}$.each(aData,function(index,value){if(value.name===featureName){ret=true;return false}});return ret},_shouldRenderInFeatureChooser:function(columnKey){this._analyzeFeatures();if(this.analyzedData[columnKey]!==undefined&&this.analyzedData[columnKey]!==null){return this.analyzedData[columnKey].length>1}return false},_headerRendered:function(sender,args){if(args.owner.element.attr("id")!==this.grid.element.attr("id")){return}if(sender.target.id!==this.grid.element[0].id){return}this._renderFCForAllColumns()},_renderFCForAllColumns:function(){var self=this;$.each(this.data,function(columnKey,elem){self._initFC(columnKey,elem)})},_touchStart:function(e,columnKey){if($(e.target).attr("data-skip-event")){return e}this.toggleDropDown(columnKey);e.preventDefault();e.stopPropagation()},_initFC:function(columnKey,elem){var self=this,thead=this.grid.container().find("thead"),$columnCell,$theadCell,buttonId,cancelFunc,$button,$headerContainer;$columnCell=$("#"+self.grid.element[0].id+"_"+columnKey);buttonId=self._id("featureChooser_headerButton",columnKey);if(!$columnCell.length){return}$columnCell.find("[data-fc-button]").remove();$("#"+buttonId).remove();cancelFunc=function(e){e.preventDefault();e.stopPropagation()};if(elem.isCancelledRendering!==false&&self._trigger(self.events.featureChooserRendering,null,{owner:self.grid,columnKey:columnKey,columnCell:$columnCell})===false){elem.isCancelledRendering=true;return}elem.isCancelledRendering=false;if(this._isTouchDevice()){$columnCell.bind({click:function(e){self._touchStart(e,columnKey)}})}else{$theadCell=thead.find("#"+self.grid.element[0].id+"_"+columnKey);this.grid._enableHeaderCellFeature($theadCell);$headerContainer=$theadCell.find(".ui-iggrid-indicatorcontainer");if($headerContainer.length===0){$headerContainer=$("<div></div>").appendTo($theadCell).addClass("ui-iggrid-indicatorcontainer")}$button=$("<span></span>").prependTo($headerContainer).addClass(self.css.headerButtonIcon);$button.wrap('<a id="'+buttonId+'" role="button" tabindex="'+self.grid.options.tabIndex+'" data-fc-button="'+columnKey+'" href="#" title="'+$.ig.Grid.locale.featureChooserTooltip+'"></a>');$button.parent().attr("th-remove-focus","").bind({keydown:function(event){var $item,$nextPrevItem,$dialog=$("#"+self._id("featureChooser_dd",columnKey));if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){$item=$dialog.find("ul li.ui-iggrid-featurechooser-listitem-hover");if($dialog.is(":visible")&&$item.length>0){if($item.find('*[role="button"]').length){event.target=$item.find('*[role="button"]:eq(0)')}else{event.target=$item[0]}self._clickFeature(event)}self.toggleDropDown(columnKey);cancelFunc(event)}else if(event.keyCode===$.ui.keyCode.DOWN||event.keyCode===$.ui.keyCode.UP){if($dialog.is(":visible")){$item=$dialog.find("ul li.ui-iggrid-featurechooser-listitem-hover");if($item.length>1){$.each($item,function(index,value){self._removeCssSelectionListItem($(value))})}$nextPrevItem=event.keyCode===$.ui.keyCode.DOWN?$item.next():$item.prev();if($nextPrevItem.attr("data-fc-separator")){$nextPrevItem=event.keyCode===$.ui.keyCode.DOWN?$nextPrevItem.next():$nextPrevItem.prev()}if($item.length===0){self._addCssSelectionListItem($dialog.find("ul li:eq(0)"))}else if($nextPrevItem.length>0&&$nextPrevItem.is("li")){self._removeCssSelectionListItem($item);self._addCssSelectionListItem($nextPrevItem)}cancelFunc(event)}}},mousedown:function(event){self.toggleDropDown(columnKey);cancelFunc(event)},mouseover:function(){if($button.hasClass(self.css.headerButtonIconSelected)===false){$button.addClass(self.css.headerButtonIconMouseOver)}},mouseout:function(){$button.removeClass(self.css.headerButtonIconMouseOver)},mouseup:cancelFunc,click:cancelFunc});$("#"+this._id("featureChooser_dd",columnKey)).remove()}self._trigger(self.events.featureChooserRendered,null,{owner:self.grid,columnKey:columnKey,columnCell:$columnCell})},_renderInFeatureChooser:function(columnKey,data){var i,columnData=this.analyzedData[columnKey],columnDataLength;if(columnData===undefined||columnData===null){return}columnDataLength=columnData.length;if(columnData.isCancelledRendering===true){return}for(i=0;i<columnDataLength;i++){if(columnData[i].name.toLowerCase()===data.name.toLowerCase()){this.analyzedData[columnKey][i]=data;break}}if(i===columnDataLength){this.analyzedData[columnKey].push(data)}if(this.data[columnKey]===null||this.data[columnKey]===undefined){this.data[columnKey]=[]}if($.type(this.data[columnKey].order)!=="number"){this.data[columnKey].order=0}for(i=0;i<this.data[columnKey].length;i++){if(this.data[columnKey][i].name===data.name&&data.name!==undefined){return}}this.data[columnKey].push(data)},_renderMenu:function(columnKey){var i,data,self=this,listItems,popoverInstance,$targetButton,$headerCell=$("#"+this.grid.id()+"_"+columnKey),dropDownId=this._id("featureChooser_dd",columnKey),$dropDown=$("#"+dropDownId),rootContainer=this.grid._rootContainer();if($dropDown.length>0){return}$dropDown=$('<div tabindex="0"></div>').attr("id",dropDownId).appendTo(rootContainer);$targetButton=$("#"+this._id("featureChooser_headerButton",columnKey)).find("span");if($targetButton.length===0){$targetButton=$headerCell}$dropDown.igGridFeatureChooserPopover({position:"auto",targetButton:$targetButton,maxWidth:this.grid.container().width(),direction:"bottom",maxHeight:null,containment:rootContainer,appendTo:rootContainer});popoverInstance=$dropDown.data("igGridFeatureChooserPopover");$dropDown.bind("iggridfeaturechooserpopovershown",function(){self._visiblePopover=dropDownId});$dropDown.bind("iggridfeaturechooserpopoverhiding",function(){if(self._activeSubmenuId){$("#"+self._activeSubmenuId).hide();self._activeSubmenuId=null}});data=this.data[columnKey];if(data){for(i=0;i<data.length;i++){this._renderDropDownItem(columnKey,data[i])}listItems=popoverInstance.container().find("li[data-fc-order]");$dropDown.igGridFeatureChooserPopover("registerElements",listItems);$targetButton.bind({keydown:function(e){if(e.keyCode===$.ui.keyCode.ESCAPE){popoverInstance._closePopover();e.stopPropagation()}else if(e.keyCode===$.ui.keyCode.TAB&&!e.shiftKey&&popoverInstance.isShown()){popoverInstance.popover.find("li[data-fc-order]:first").focus();e.stopPropagation();e.preventDefault()}}});listItems.bind({keydown:function(e){var $elem,keyCode=e.keyCode;switch(keyCode){case $.ui.keyCode.ESCAPE:$targetButton.data("onFocus",false).focus();popoverInstance._closePopover();break;case $.ui.keyCode.TAB:$elem=$(this);if(!e.shiftKey){if($elem.is(":last-child")){$elem.closest("ul").find("li:first-child").focus();e.preventDefault()}}else{if($elem.is(":first-child")){$elem.closest("ul").find("li:last-child").focus();e.preventDefault()}}break;case $.ui.keyCode.RIGHT:$elem=$(this);$elem=$elem.nextAll("li[data-fc-order]").eq(0);if($elem.length===0){$elem=$(this).closest("ul").find("li:first-child")}$elem.focus();e.preventDefault();break;case $.ui.keyCode.LEFT:$elem=$(this);$elem=$elem.prevAll("li[data-fc-order]").eq(0);if($elem.length===0){$elem=$(this).closest("ul").find("li:last-child")}$elem.focus();e.preventDefault();break}}})}$dropDown.bind({keydown:function(event){if(event.keyCode===$.ui.keyCode.ESCAPE&&popoverInstance.container().is(":visible")){self.toggleDropDown(columnKey);popoverInstance.container().blur()}}})},_removeFeature:function(featureName,submenu){var self=this,cols=this.grid.options.columns;$.each(cols,function(index,col){self._removeDropDownItem(col.key,featureName);if(submenu){$("#"+self._id("featurechooser_submenu_"+col.key,featureName)).remove()}})},_removeDropDownItem:function(columnKey,featureName){var index=-1,data,$dropDown=$("#"+this._id("featureChooser_dd",columnKey)),$dropDownList=$("#"+this._id("featurechooser_dd_list",columnKey)),$item=$("#"+this._id("featurechooser_dd_li_"+columnKey,featureName));if($dropDown.length===0){data=this.data[columnKey];if(data){$.each(data,function(i,dataItem){if(dataItem.name===featureName){index=i;return false}});if(index>-1){data.splice(index,1);if(data.length===0){this._removeFC(columnKey)}}}}else if($item.length>0){$item.remove();if($dropDownList.find("li:not([data-fc-separator])").length===0){this._removeFC(columnKey)}else{this._removeSeparatorItem(columnKey)}}},_removeFC:function(columnKey){var $dropDown=$("#"+this._id("featureChooser_dd",columnKey));$dropDown.igGridFeatureChooserPopover("destroy");$dropDown.remove();$("#"+this._id("featureChooser_headerButton",columnKey)).remove()},_removeSeparatorItem:function(columnKey){var listLiSeparator=$("#"+this._id("featurechooser_dd_list",columnKey)).find("[data-fc-separator]");listLiSeparator.each(function(){var $li=$(this),$prevLi=$li.prev(),$nextLi=$li.next();if($prevLi.length===0||$prevLi.attr("data-fc-separator")!==undefined||$nextLi.length===0||$nextLi.attr("data-fc-separator")!==undefined){$li.remove();return false}})},_renderDropDownItem:function(columnKey,data){var dropDownId=this._id("featureChooser_dd",columnKey),$dropDownContainer=$("#"+dropDownId).igGridFeatureChooserPopover("container"),$li,listId,$list,funcClickOnFeature,$iconContainer,$span,cssClassIcon="",self=this,isSelected=data.isSelected,featureName=data.name,innerData,liId=this._id("featurechooser_dd_li_"+columnKey,featureName),groupName=data.groupName,groupOrder=data.groupOrder,listItemsGroup,insertElementObj,labelText;if($("#"+liId).length>0){return}if(groupName===undefined||groupName===null){groupName="click"}listId=this._id("featurechooser_dd_list",columnKey);$list=$("#"+listId);if($list.length===0){$dropDownContainer.html("");$list=$("<ul></ul>").attr("id",listId).addClass(this.css.listClass).appendTo($dropDownContainer)}if(isSelected===undefined||isSelected===null){isSelected=false}$li=$('<li tabindex="0"></li>').addClass(this.css.listItemClass).attr("id",liId).attr("data-fc-order",data.order);if(groupName!==undefined&&groupName!==null){$li.attr("data-fc-groupname",groupName)}if(groupOrder!==undefined&&groupOrder!==null){$li.attr("data-fc-grouporder",groupOrder)}innerData={columnKey:columnKey,featureName:featureName,updateOnClickAll:data.updateOnClickAll,iconClass:data.iconClass,iconClassOff:data.iconClassOff,groupName:groupName,groupOrder:groupOrder,type:data.type,textHide:data.textHide,state:data.state,text:data.text};$li.data("data",innerData);funcClickOnFeature=function(event){var submenuId=self._id("featurechooser_submenu_"+columnKey,featureName),e=event,$submenu,keyCode=event.keyCode;if(data.type!=="dropdown"){if(!keyCode||keyCode===$.ui.keyCode.ENTER||keyCode===$.ui.keyCode.SPACE){if(event.target===undefined){e.target=event.srcElement}self._clickFeature(event);self.hideDropDown(columnKey)}}else{if(self._visiblePopover){if(!keyCode){self._toggleSubmenu(columnKey,featureName,data);setTimeout(function(){$("#"+self._visiblePopover).data("igGridFeatureChooserPopover")._setFCElementFocus(true)},5)}else{if(keyCode===$.ui.keyCode.DOWN){$submenu=$("#"+submenuId);if($submenu.is(":visible")){$submenu.find("[data-fc-item]:first").focus()}else{self._toggleSubmenu(columnKey,featureName,data)}}else if(keyCode===$.ui.keyCode.ENTER||keyCode===$.ui.keyCode.SPACE){self._toggleSubmenu(columnKey,featureName,data)}else if(keyCode===$.ui.keyCode.UP){$submenu=$("#"+submenuId);if($submenu.is(":visible")){self._toggleSubmenu(columnKey,featureName,data)}}}}if(event.preventDefault){event.preventDefault()}}};$li.bind({keydown:funcClickOnFeature,mousedown:funcClickOnFeature});if(data.iconClass!==null&&data.iconClass!==undefined&&data.iconClass!==""){if(data.iconClassOff&&data.isSelected===false){cssClassIcon=data.iconClassOff}else{cssClassIcon=data.iconClass}}$iconContainer=$("<div></div>").addClass(this.css.listItemContainer).appendTo($li);$span=$("<span></span>").addClass(this.css.listItemIconContainer).appendTo($iconContainer);if(cssClassIcon!==""){$span.addClass(cssClassIcon)}else{$span.addClass(this.css.itemNoIcon)}labelText=data.text;$li.attr("title",labelText);$("<span></span>").text(data.text).addClass(this.css.listItemText).appendTo($iconContainer);listItemsGroup=$("#"+listId+" li[data-fc-groupName = "+groupName+"]");if(listItemsGroup.length===0){listItemsGroup=$("#"+listId+" li[data-fc-groupName]");insertElementObj=this._getInsertElement(listItemsGroup,groupOrder,"data-fc-grouporder");if(insertElementObj.item!==null){$list=listItemsGroup}this._insertElement(insertElementObj,$list,$li,groupName)}else{insertElementObj=this._getInsertElement(listItemsGroup,data.order,"data-fc-order");this._insertElement(insertElementObj,listItemsGroup,$li,groupName)}if(data.type==="toggle"){this._setSelectedItem(columnKey,data.isSelected,$li)}if(data.type==="dropdown"){$('<span class="'+this.css.submenuIcon+'" data-submenu-arrow="true"></span>').appendTo($iconContainer);self._renderSubmenu(columnKey,featureName,data)}},_renderSubmenu:function(columnKey,featureName,data){var submenuId=this._id("featurechooser_submenu_"+columnKey,featureName),$submenu;if($("#"+submenuId).length>0){$("#"+submenuId).remove()}if(this._submenus===null||this._submenus===undefined){this._submenus=[]}this._submenus.push(submenuId);$submenu=$('<div id="'+submenuId+'" style="position:absolute" class="'+this.css.submenu+'"></div>').appendTo(this.grid._rootContainer());$submenu.data("buttonId",this._id("featurechooser_dd_li_"+columnKey,featureName));$submenu.hide();if(data.methodRenderSubmenu){data.methodRenderSubmenu(columnKey,$submenu);$("#"+this._id("featureChooser_dd",columnKey)).igGridFeatureChooserPopover("registerElements",$submenu.find("[data-fc-item]"))}},_toggleSubmenu:function(columnKey,featureName,data){var rOffset,$li=$("#"+this._id("featurechooser_dd_li_"+columnKey,featureName)),$innerDiv=$li.find("div:nth-child(1)"),targetWidth=$innerDiv.outerWidth(),targetLeft=$innerDiv.offset().left,submenuId=this._id("featurechooser_submenu_"+columnKey,featureName),$submenu=$("#"+submenuId),left=targetLeft-Math.abs($submenu.outerWidth()-targetWidth)/2,top=$innerDiv.offset().top+$innerDiv.outerHeight();rOffset=$.ig.util.getRelativeOffset($submenu);$submenu.css({left:left-rOffset.left,top:top-rOffset.top});if(data.methodToggleSubmenu){data.methodToggleSubmenu(columnKey,!$submenu.is(":visible"),$submenu)}if(this._activeSubmenuId&&this._activeSubmenuId!==submenuId){$("#"+this._activeSubmenuId).hide()}this._activeSubmenuId=submenuId;$submenu.toggle("slide",{duration:150,direction:"up"})},_getSeparatorItem:function(){return $('<li data-fc-separator="1" class="'+this.css.separator+'"></li>')},_insertElement:function(insertElementObj,$list,$li,groupName){var $insertElement=insertElementObj.item,insertElementPosition=insertElementObj.position,$prevElement;if($insertElement===null){$li.appendTo($list);$prevElement=$li.prev();if($prevElement!==undefined&&$prevElement.length>0&&$prevElement.attr("data-fc-separator")!=="1"&&$prevElement.attr("data-fc-groupname")!==undefined&&$prevElement.attr("data-fc-groupname")!==groupName){this._getSeparatorItem().insertBefore($li)}}else{if(insertElementPosition==="after"){$li.insertAfter($insertElement);if($insertElement!==undefined&&$insertElement.length>0&&$insertElement.attr("data-fc-separator")!=="1"&&$insertElement.attr("data-fc-groupname")!==undefined&&$insertElement.attr("data-fc-groupname")!==groupName){this._getSeparatorItem().insertBefore($li)}}else{$li.insertBefore($insertElement);$prevElement=$li.prev();if($prevElement!==undefined&&$prevElement.length>0&&$prevElement.attr("data-fc-separator")!=="1"&&$prevElement.attr("data-fc-groupname")!==undefined&&$prevElement.attr("data-fc-groupname")!==groupName){this._getSeparatorItem().insertBefore($li)}else if($insertElement!==undefined&&$insertElement.length>0&&$insertElement.attr("data-fc-separator")!=="1"&&$insertElement.attr("data-fc-groupname")!==undefined&&$insertElement.attr("data-fc-groupname")!==groupName){this._getSeparatorItem().insertAfter($li)}}}},_getInsertElement:function(listItems,targetOrder,attr){var $item=null,itemOrder,at,i;for(i=0;i<listItems.length;i++){$item=$(listItems[i]);at=$item.attr(attr);if(at===undefined){continue}itemOrder=parseInt(at,10);if(itemOrder>targetOrder){return{item:$item,position:"before"}}}return{item:$item,position:"after"}},_setSelectedState:function(featureName,columnKey,isSelected,executeCallback){var data=this.data[columnKey],$listItem,self=this;if(data===undefined||data===null){return false}$.each(data,function(index,value){if(value.name.toLowerCase()===featureName.toLowerCase()){$listItem=$("#"+self._id("featurechooser_dd_li_"+columnKey,value.name));self._setSelectedItem(columnKey,isSelected,$listItem);self.data[columnKey][index].isSelected=!isSelected;if(executeCallback===true){self._callFeatureMethod(value,isSelected,columnKey,null)}value.isSelected=isSelected;return false}})},_setSelectedItem:function(columnKey,isSelected,$listItem){if($listItem===null||$listItem===undefined||$listItem.length===0){return}var innerData=$listItem.data("data"),textShow,textHide,labelText,$label=null;if(innerData!==undefined&&innerData!==null){textShow=innerData.text;textHide=innerData.textHide;$label=$listItem.find("span.ui-iggrid-featurechooserddlistitemtext")}$listItem.attr("data-fc-selected",isSelected);if(isSelected===true){$listItem.addClass(this.css.itemSelected);labelText=textShow;if($label!==null&&textShow!==null&&textShow!==undefined){$label.text(labelText)}if(innerData.iconClassOff){$listItem.find("span.ui-iggrid-featurechooser-li-iconcontainer").removeClass(innerData.iconClassOff).addClass(innerData.iconClass)}}else{$listItem.removeClass(this.css.itemSelected);labelText=textHide;if($label!==null&&textHide!==null&&textHide!==undefined){$label.text(labelText)}if(innerData.iconClassOff){$listItem.find("span.ui-iggrid-featurechooser-li-iconcontainer").removeClass(innerData.iconClass).addClass(innerData.iconClassOff)}}$listItem.attr("title",labelText)},_toggleSelectedItems:function(featureName,selected){var i,$li,columnKey,cols=this.grid.options.columns,colsLength=cols.length,isSelected,feature;if(selected!==undefined){isSelected=selected}for(i=0;i<colsLength;i++){columnKey=cols[i].key;if($("#"+this._id("featureChooser_dd",columnKey)).length===0){feature=this._getFeatureByKeyName(columnKey,featureName);if(feature===null||feature===undefined){continue}if(isSelected===undefined){isSelected=feature.isSelected}}else{$li=$("#"+this._id("featurechooser_dd_li_"+columnKey,featureName));if($li.data("data")===null||$li.data("data")===undefined){continue}if(selected===undefined){isSelected=$li.attr("data-fc-selected")==="true"}}this._setSelectedState(featureName,columnKey,!isSelected)}},showDropDown:function(columnKey){var $targetButton,dropDownId=this._id("featureChooser_dd",columnKey),$dropDown=this.getDropDownByColumnKey(columnKey),fcp;this.grid._focusedElement=$("#"+this._id("featureChooser_headerButton",columnKey)).find("span");$targetButton=$("#"+this._id("featureChooser_headerButton",columnKey)).find("span");if($targetButton.length===0){$targetButton=$("#"+this.grid.id()+"_"+columnKey)}if(this._visiblePopover&&dropDownId!==this._visiblePopover){fcp=$("#"+this._visiblePopover).data("igGridFeatureChooserPopover");if(fcp){fcp._closePopover()}setTimeout(function(){$dropDown.igGridFeatureChooserPopover("show",$targetButton)},100)}else{$dropDown.igGridFeatureChooserPopover("show",$targetButton)}},hideDropDown:function(columnKey){var $dropDown=this.getDropDownByColumnKey(columnKey);$dropDown.igGridFeatureChooserPopover("hide");this.grid._focusedElement=null},getDropDownByColumnKey:function(columnKey){var dropDownId=this._id("featureChooser_dd",columnKey),$dropDown=$("#"+dropDownId);if($dropDown.length===0){this._renderMenu(columnKey);$dropDown=$("#"+dropDownId)}return $dropDown},toggleDropDown:function(columnKey){var $dropDown=this.getDropDownByColumnKey(columnKey),isVisible=$dropDown.igGridFeatureChooserPopover("isShown");this._trigger(this.events.menuToggling,null,{isVisible:isVisible,columnKey:columnKey,owner:this});if(isVisible){this.hideDropDown(columnKey)}else{this.showDropDown(columnKey)}},_mouseOverDropDownItem:function(event){this._addCssSelectionListItem($(event.currentTarget))},_mouseOutDropDownItem:function(event){this._removeCssSelectionListItem($(event.currentTarget))},_addCssSelectionListItem:function($listItem){$listItem.addClass(this.css.dropDownListItemHover)},_removeCssSelectionListItem:function($listItem){$listItem.removeClass(this.css.dropDownListItemHover)},_virtualHorizontalScroll:function(){this._renderFCForAllColumns()},destroy:function(e,args){var i,l,self=this,sbm=this._submenus,grid;if(args&&args.owner){grid=args.owner;if(grid&&grid.id()!==this.gridId){return}}this.data=null;$.each(this.grid.options.columns,function(ind,column){var $dd=$("#"+self._id("featureChooser_dd",column.key));if($dd.length>0){$dd.igGridFeatureChooserPopover("destroy");
$dd.remove()}});if(sbm){l=sbm.length;for(i=0;i<l;i++){$("#"+sbm[i]).remove()}}if(this._headerRenderedHandler){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler)}if(this._gridDestroyedHandler){this.grid.element.unbind("igcontroldestroyed",this._gridDestroyedHandler)}if(this._gridRenderedHandler){this.grid.element.unbind("iggridrendered",this._gridRenderedHandler)}if(this._virtualHorizontalScrollHandler){this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler)}delete this._gridRenderedHandler;delete this._headerRenderedHandler;delete this._gridDestroyedHandler;delete this._virtualHorizontalScrollHandler;$.Widget.prototype.destroy.apply(this,arguments);return this}});$.extend($.ui.igGridFeatureChooser,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Sorting 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	jquery.ui.mouse.js
 *	jquery.ui.draggable.js
 *	jquery.ui.resizable.js
 *	modernizr.js (Optional)
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.grid.shared.js
 *	infragistics.ui.grid.featurechooser.js
 *	infragistics.ui.editors.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.templating.js
 *	infragistics.util.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igGridFiltering",{renderInFeatureChooser:true,options:{caseSensitive:false,filterSummaryAlwaysVisible:true,renderFC:true,filterSummaryTemplate:$.ig.GridFiltering.locale.filterSummaryTemplate,filterDropDownAnimations:"linear",filterDropDownAnimationDuration:500,filterDropDownWidth:0,filterDropDownHeight:0,filterExprUrlKey:null,filterDropDownItemIcons:true,columnSettings:[{columnKey:null,columnIndex:null,allowFiltering:true,condition:null,conditionList:[],defaultExpressions:[],customConditions:null}],type:null,filterDelay:500,mode:null,advancedModeEditorsVisible:false,advancedModeHeaderButtonLocation:"left",filterDialogWidth:430,filterDialogHeight:"",filterDialogFilterDropDownDefaultWidth:80,filterDialogExprInputDefaultWidth:130,filterDialogColumnDropDownDefaultWidth:null,renderFilterButton:true,filterButtonLocation:"left",nullTexts:{startsWith:$.ig.GridFiltering.locale.startsWithNullText,endsWith:$.ig.GridFiltering.locale.endsWithNullText,contains:$.ig.GridFiltering.locale.containsNullText,doesNotContain:$.ig.GridFiltering.locale.doesNotContainNullText,equals:$.ig.GridFiltering.locale.equalsNullText,doesNotEqual:$.ig.GridFiltering.locale.doesNotEqualNullText,greaterThan:$.ig.GridFiltering.locale.greaterThanNullText,lessThan:$.ig.GridFiltering.locale.lessThanNullText,greaterThanOrEqualTo:$.ig.GridFiltering.locale.greaterThanOrEqualToNullText,lessThanOrEqualTo:$.ig.GridFiltering.locale.lessThanOrEqualToNullText,on:$.ig.GridFiltering.locale.onNullText,notOn:$.ig.GridFiltering.locale.notOnNullText,after:$.ig.GridFiltering.locale.afterNullText,before:$.ig.GridFiltering.locale.beforeNullText,thisMonth:$.ig.GridFiltering.locale.thisMonthLabel,lastMonth:$.ig.GridFiltering.locale.lastMonthLabel,nextMonth:$.ig.GridFiltering.locale.nextMonthLabel,thisYear:$.ig.GridFiltering.locale.thisYearLabel,lastYear:$.ig.GridFiltering.locale.lastYearLabel,nextYear:$.ig.GridFiltering.locale.nextYearLabel,empty:$.ig.GridFiltering.locale.emptyNullText,notEmpty:$.ig.GridFiltering.locale.notEmptyNullText,"null":$.ig.GridFiltering.locale.nullNullText,notNull:$.ig.GridFiltering.locale.notNullNullText},labels:{noFilter:$.ig.GridFiltering.locale.noFilterLabel,clear:$.ig.GridFiltering.locale.clearLabel,startsWith:$.ig.GridFiltering.locale.startsWithLabel,endsWith:$.ig.GridFiltering.locale.endsWithLabel,contains:$.ig.GridFiltering.locale.containsLabel,doesNotContain:$.ig.GridFiltering.locale.doesNotContainLabel,equals:$.ig.GridFiltering.locale.equalsLabel,doesNotEqual:$.ig.GridFiltering.locale.doesNotEqualLabel,greaterThan:$.ig.GridFiltering.locale.greaterThanLabel,lessThan:$.ig.GridFiltering.locale.lessThanLabel,greaterThanOrEqualTo:$.ig.GridFiltering.locale.greaterThanOrEqualToLabel,lessThanOrEqualTo:$.ig.GridFiltering.locale.lessThanOrEqualToLabel,trueLabel:$.ig.GridFiltering.locale.trueLabel,falseLabel:$.ig.GridFiltering.locale.falseLabel,after:$.ig.GridFiltering.locale.afterLabel,before:$.ig.GridFiltering.locale.beforeLabel,today:$.ig.GridFiltering.locale.todayLabel,yesterday:$.ig.GridFiltering.locale.yesterdayLabel,thisMonth:$.ig.GridFiltering.locale.thisMonthLabel,lastMonth:$.ig.GridFiltering.locale.lastMonthLabel,nextMonth:$.ig.GridFiltering.locale.nextMonthLabel,thisYear:$.ig.GridFiltering.locale.thisYearLabel,lastYear:$.ig.GridFiltering.locale.lastYearLabel,nextYear:$.ig.GridFiltering.locale.nextYearLabel,on:$.ig.GridFiltering.locale.onLabel,notOn:$.ig.GridFiltering.locale.notOnLabel,advancedButtonLabel:$.ig.GridFiltering.locale.advancedButtonLabel,filterDialogCaptionLabel:$.ig.GridFiltering.locale.filterDialogCaptionLabel,filterDialogConditionLabel1:$.ig.GridFiltering.locale.filterDialogConditionLabel1,filterDialogConditionLabel2:$.ig.GridFiltering.locale.filterDialogConditionLabel2,filterDialogOkLabel:$.ig.GridFiltering.locale.filterDialogOkLabel,filterDialogCancelLabel:$.ig.GridFiltering.locale.filterDialogCancelLabel,filterDialogAnyLabel:$.ig.GridFiltering.locale.filterDialogAnyLabel,filterDialogAllLabel:$.ig.GridFiltering.locale.filterDialogAllLabel,filterDialogAddLabel:$.ig.GridFiltering.locale.filterDialogAddLabel,filterDialogErrorLabel:$.ig.GridFiltering.locale.filterDialogErrorLabel,filterSummaryTitleLabel:$.ig.GridFiltering.locale.filterSummaryTitleLabel,filterDialogClearAllLabel:$.ig.GridFiltering.locale.filterDialogClearAllLabel,empty:$.ig.GridFiltering.locale.emptyNullText,notEmpty:$.ig.GridFiltering.locale.notEmptyNullText,nullLabel:$.ig.GridFiltering.locale.nullNullText,notNull:$.ig.GridFiltering.locale.notNullNullText,"true":$.ig.GridFiltering.locale.trueLabel,"false":$.ig.GridFiltering.locale.falseLabel},tooltipTemplate:$.ig.GridFiltering.locale.tooltipTemplate,filterDialogAddConditionTemplate:null,filterDialogAddConditionDropDownTemplate:null,filterDialogFilterTemplate:null,filterDialogFilterConditionTemplate:null,filterDialogAddButtonWidth:100,filterDialogOkCancelButtonWidth:120,filterDialogMaxFilterCount:5,filterDialogContainment:"owner",showEmptyConditions:false,showNullConditions:false,featureChooserText:$.ig.GridFiltering.locale.featureChooserText,featureChooserTextHide:$.ig.GridFiltering.locale.featureChooserTextHide,featureChooserTextAdvancedFilter:$.ig.GridFiltering.locale.featureChooserTextAdvancedFilter,persist:true,inherit:false},css:{filterRow:"ui-iggrid-filterrow ui-widget",filterCell:"ui-iggrid-filtercell",filterCellEditor:"ui-iggrid-filtereditor",filterDropDownList:"ui-menu ui-widget ui-widget-content ui-iggrid-filterddlist ui-corner-all",filterDropDown:"ui-iggrid-filterdd",filterDropDownListItemTextContainer:"ui-iggrid-filterddlistitemcontainer",filterDropDownListItem:"ui-iggrid-filterddlistitem",filterDropDownListItemAdvanced:"ui-iggrid-filterddlistitemadvanced",filterDropDownListItemWithIcons:"ui-iggrid-filterddlistitemicons ui-state-default",filterDropDownListItemClear:"ui-iggrid-filterddlistitemclear",filterDropDownListItemHover:"ui-iggrid-filterddlistitemhover ui-state-hover",filterDropDownListItemActive:"ui-iggrid-filterddlistitemactive ui-state-active",filterDateCell:"",filterTextCell:"",filterNumberCell:"",filterBoolCell:"",filterButton:"ui-iggrid-filterbutton ui-corner-all ui-icon ui-icon-triangle-1-s",filterButtonAdvanced:"ui-iggrid-filterbutton ui-iggrid-filterbuttonadvanced ui-icon ui-icon-search",filterButtonAdvancedRight:"ui-iggrid-filterbuttonright ui-iggrid-filterbuttonadvanced ui-icon ui-icon-search",filterButtonHover:"ui-iggrid-filterbuttonhover ui-state-hover",filterButtonActive:"ui-iggrid-filterbuttonactive ui-state-active",filterButtonFocus:"ui-iggrid-filterbuttonfocus ui-state-focus",filterButtonDisabled:"ui-iggrid-filterbuttondisabled ui-state-disabled",filterButtonDate:"ui-iggrid-filterbuttondate",filterButtonString:"ui-iggrid-filterbuttonstring",filterButtonNumber:"ui-iggrid-filterbuttonnumber",filterButtonBoolean:"ui-iggrid-filterbuttonbool",filterButtonAdvancedHover:"ui-iggrid-filterbuttonadvancedhover ui-state-hover",filterButtonAdvancedActive:"ui-iggrid-filterbuttonadvancedactive ui-state-active",filterButtonAdvancedFocus:"ui-iggrid-filterbuttonadvancedfocus ui-state-focus",filterButtonAdvancedDisabled:"ui-iggrid-filterbuttonadvanceddisabled ui-state-disabled",filterItemIcon:"ui-iggrid-filtericon",filterItemIconContainer:"ui-iggrid-filtericoncontainer",filterItemIconStartsWith:"ui-iggrid-filtericonstartswith",filterItemIconEndsWith:"ui-iggrid-filtericonendswith",filterItemIconContains:"ui-iggrid-filtericoncontains",filterItemIconEquals:"ui-iggrid-filtericonequals",filterItemIconDoesNotEqual:"ui-iggrid-filtericondoesnotequal",filterItemIconDoesNotContain:"ui-iggrid-filtericondoesnotcontain",filterItemIconGreaterThan:"ui-iggrid-filtericongreaterthan",filterItemIconLessThan:"ui-iggrid-filtericonlessthan",filterItemIconGreaterThanOrEqualTo:"ui-iggrid-filtericongreaterthanorequalto",filterItemIconLessThanOrEqualTo:"ui-iggrid-filtericonlessthanorequalto",filterItemIconTrue:"ui-iggrid-filtericontrue",filterItemIconFalse:"ui-iggrid-filtericonfalse",filterItemIconAfter:"ui-iggrid-filtericonafter",filterItemIconBefore:"ui-iggrid-filtericonbefore",filterItemIconToday:"ui-iggrid-filtericontoday",filterItemIconYesterday:"ui-iggrid-filtericonyesterday",filterItemIconThisMonth:"ui-iggrid-filtericonthismonth",filterItemIconLastMonth:"ui-iggrid-filtericonlastmonth",filterItemIconNextMonth:"ui-iggrid-filtericonnextmonth",filterItemIconThisYear:"ui-iggrid-filtericonthisyear",filterItemIconLastYear:"ui-iggrid-filtericonlastyear",filterItemIconNextYear:"ui-iggrid-filtericonnextyear",filterItemIconOn:"ui-iggrid-filtericonon",filterItemIconNotOn:"ui-iggrid-filtericonnoton",filterItemIconClear:"ui-iggrid-filtericonclear",blockArea:"ui-widget-overlay ui-iggrid-blockarea",filterDialog:"ui-dialog ui-draggable ui-resizable ui-iggrid-dialog ui-widget ui-widget-content ui-corner-all",filterDialogHeaderCaption:"ui-dialog-titlebar ui-iggrid-filterdialogcaption ui-widget-header ui-corner-all ui-helper-reset ui-helper-clearfix",filterDialogHeaderCaptionTitle:"ui-dialog-title",filterDialogAddCondition:"ui-iggrid-filterdialogaddcondition",filterDialogAddConditionDropDown:"ui-iggrid-filterdialogaddconditionlist",filterDialogAddButton:"ui-iggrid-filterdialogaddbuttoncontainer ui-helper-reset",filterDialogOkCancelButton:"ui-dialog-buttonpane ui-widget-content ui-helper-clearfix ui-iggrid-filterdialogokcancelbuttoncontainer",filterDialogFiltersTable:"ui-iggrid-filtertable ui-helper-reset",filterDialogFilterRemoveButton:"ui-icon ui-icon-closethick",filterDialogClearAllButton:"ui-iggrid-filterdialogclearall",featureChooserModalDialogIcon:"ui-icon ui-iggrid-icon-advanced-filter"},events:{dataFiltering:"dataFiltering",dataFiltered:"dataFiltered",dropDownOpening:"dropDownOpening",dropDownOpened:"dropDownOpened",dropDownClosing:"dropDownClosing",dropDownClosed:"dropDownClosed",filterDialogOpening:"filterDialogOpening",filterDialogOpened:"filterDialogOpened",filterDialogMoving:"filterDialogMoving",filterDialogFilterAdding:"filterDialogFilterAdding",filterDialogFilterAdded:"filterDialogFilterAdded",filterDialogClosing:"filterDialogClosing",filterDialogClosed:"filterDialogClosed",filterDialogContentsRendering:"filterDialogContentsRendering",filterDialogContentsRendered:"filterDialogContentsRendered",filterDialogFiltering:"filterDialogFiltering"},_createWidget:function(){this.options.columnSettings=[];$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){this._editors=[];if(!$.fn.fadeToggle){$.fn.fadeToggle=$.fn.toggle}this._fcData={};this._isInitFC=false;this._dsTransformedCustomConditions=null;if(this.options.filterDropDownAnimations==="none"){this.options.filterDropDownAnimationDuration=1;this.options.filterDropDownAnimations="linear"}},_setOption:function(key,value){$.Widget.prototype._setOption.apply(this,arguments);if(key==="mode"||key==="renderFilterButton"||key==="filterButtonLocation"||key==="type"){throw new Error($.ig.Grid.locale.optionChangeNotSupported.replace("{optionName}",key))}if(key==="filterDropDownWidth"){this.grid.container().find("div ul").parent().css("width",value)}else if(key==="filterDropDownHeight"){this.grid.container().find("div ul").parent().css("height",value)}else if(key==="filterDialogWidth"){$("#"+this.grid.container().attr("id")+"_dialog").css("width",value)}else if(key==="filterDialogHeight"){$("#"+this.grid.container().attr("id")+"_dialog").css("height",value)}else if(key==="columnSettings"){this._initDefaultSettings()}},destroy:function(){var i,fc,cols=this.grid.options.columns,block=$("#"+this.grid.id()+"_container_block"),dialog=$("#"+this.grid.id()+"_container_dialog"),gridContainer=this.grid.container();$("#"+gridContainer[0].id+" .ui-iggrid-filterrow").remove();$("#"+gridContainer[0].id+" .ui-iggrid-filterdd").remove();for(i=0;i<cols.length;i++){$("#"+this.grid.id()+"_dd_"+cols[i].key).remove()}block.remove();dialog.remove();gridContainer.unbind("keydown.focusChecker");this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler);this.grid.element.unbind("iggridresizingcolumnresized",this._columnResizedHandler);this.grid.element.unbind("iggridheaderextracellsmodified",this._headerInitHandler);this.grid.element.unbind("iggrid_columnsmoved",this._columnsAlteredHandler);this.grid.element.unbind("iggriduidirty",this._onUIDirtyHandler);delete this._headerCellRenderedHandler;delete this._headerRenderedHandler;delete this._virtualHorizontalScrollHandler;delete this._columnResizedHandler;delete this._headerInitHandler;delete this._onUIDirtyHandler;delete this._columnsAlteredHandler;this._editors=null;this._fcData=null;this.options.columnSettings=null;this.options=null;if(this._loadingIndicator){delete this._loadingIndicator}if(this._filterInternal){delete this._filterInternal}if(this._toggleFilterRowHandler){delete this._toggleFilterRowHandler}if(this._openFilterDialogFromFCHandler){delete this._openFilterDialogFromFCHandler}fc=this.grid.element.data("igGridFeatureChooser");if(fc&&this.renderInFeatureChooser){fc._removeFeature("Filtering");fc._removeFeature("AdvancedFiltering")}$.Widget.prototype.destroy.call(this);return this},_initLoadingIndicator:function(){this._loadingIndicator=this.grid.container().length>0?this.grid.container().igLoading().data("igLoading"):this.grid.element.igLoading().data("igLoading").indicator()},_onUIDirty:function(e,args){if(this.options.persist&&this.options.type==="remote"){return}var i,cols=this.grid.options.columns,condition;if(args.owner===this||args.owner.element[0].id!==this.element[0].id){return}this._filterDialogClearAll();if(this._editors!==null&&this._editors!==undefined){for(i=0;i<this._editors.length;i++){if(this.options.columnSettings[i].allowFiltering!==false){this._editors[i].value(null);condition=null;if(this.options.columnSettings[i].columnKey){condition=this.options.nullTexts[this._findColumnSetting(this.options.columnSettings[i].columnKey).condition]}if(condition===null||condition===undefined){condition=this.options.nullTexts[this._getDefaultCondition(cols[i].dataType)]}this._editors[i].element.igGridFilterEditor("option","placeHolder",condition)}}}for(i=0;i<cols.length;i++){$("#"+this.grid.id()+"_dd_"+cols[i].key).find("li").removeClass("ui-iggrid-filterddlistitemactive ui-state-active")}$(".ui-iggrid-filterbutton",this.grid.container()).parent().attr("title",this.options.tooltipTemplate.replace("${condition}",this.options.labels.noFilter));this.grid.dataSource.settings.filtering.expressions=[]},getFilteringMatchesCount:function(){var o=this.options,ds=this.grid.dataSource,matches;if(o.type==="local"||o.type==="remote"&&ds.hasTotalRecordsCount()===false){if(ds._filter){matches=ds._filteredData.length}else{matches=ds._data.length}}else{matches=ds.totalRecordsCount()}return matches},_dataRendered:function(){var defExpr,expr,matches=0,grid=this.grid,summary=this.grid.container().find(".ui-iggrid-footer .ui-iggrid-results").eq(0),footer=summary.parent(),shouldInitHeights=false,isInitiallyFiltered=false,i,isFiltering=false,exprs;if(!this._loadingIndicator){this._initLoadingIndicator()}if(this._hiddenCells&&this._hiddenCells.length>0){for(i=0;i<this._hiddenCells.length;i++){this._hiddenCells[i].show()}this._hiddenCells=undefined}if(this._defaultExpressions&&this._defaultExpressions.length>0){defExpr=this._defaultExpressions;this._defaultExpressions=[];this._updateFiltersUI(defExpr,false);isInitiallyFiltered=true;this._isFilteringRequest=true}if(this._shouldFireDataFiltered){exprs=this._getDataColumnFilteringExpressions(this.grid.dataSource.settings.filtering.expressions);this._shouldFireDataFiltered=false;this._trigger(this.events.dataFiltered,null,{columnKey:this._curColKey,columnIndex:this._curColIndex,owner:this,expressions:exprs})}if(!summary.is(":visible")){shouldInitHeights=true}if(this._isFilteringRequest===true){if(this.options.filterSummaryAlwaysVisible===true&&summary.length===0){footer=$("<div></div>").appendTo(this.grid.container()).addClass("ui-widget ui-helper-clearfix ui-corner-bottom ui-widget-header ui-iggrid-footer");summary=$("<span></span>").appendTo(footer).addClass("ui-iggrid-results");if(isInitiallyFiltered&&this.grid.element.data("igGridPaging")){footer.attr("id",this.grid.element[0].id+"_pager").addClass("ui-iggrid-pager");summary.attr("id",this.grid.element[0].id+"_pager_label").addClass("ui-iggrid-pagerrecordslabel")}shouldInitHeights=true}matches=this.getFilteringMatchesCount();if(!summary.parent().is(":visible")){summary.parent().show();shouldInitHeights=true}summary.text(this.options.filterSummaryTemplate.replace("${matches}",matches)).attr("title",this.options.labels.filterSummaryTitleLabel);summary.show();isFiltering=true;this._isFilteringRequest=false}else if(this._isFilteringRequest===false){expr=this.grid.dataSource.settings.filtering.expressions||[];if(summary.data("hideflag")!==false&&expr.length===0){isFiltering=true;summary.hide();if(summary.parent().children().length===1){summary.parent().hide()}}else{summary.data("hideflag",true)}shouldInitHeights=true}this._loadingIndicator.hide();if(shouldInitHeights){this.grid._initializeHeights();if(isFiltering&&(grid.options.virtualization||grid.options.rowVirtualization)){grid._updateVirtualScrollContainer();grid._virtualDom=null;grid._renderVirtualRecords()}}this._setEditorsWidth()},_initFC:function(){var columnKey,i,fc=this.grid.element.data("igGridFeatureChooser"),o=this.options,cs=this.options.columnSettings,showAdvancedButton=o.mode==="advanced"&&o.advancedModeEditorsVisible===true,isAdvanced=o.mode!=="simple"&&o.advancedModeEditorsVisible===false;this._isInitFC=true;if(o.renderFC===false){return}if(fc!==null&&fc!==undefined&&this.renderInFeatureChooser){if(this._toggleFilterRowHandler===null||this._toggleFilterRowHandler===undefined){this._toggleFilterRowHandler=$.proxy(this.toggleFilterRowByFeatureChooser,this)}if(this._openFilterDialogFromFCHandler===null||this._openFilterDialogFromFCHandler===undefined){this._openFilterDialogFromFCHandler=$.proxy(this._openFilterDialogFromFC,this)}for(i=0;i<cs.length;i++){columnKey=cs[i].columnKey;if(columnKey&&cs[i].allowFiltering===true&&fc._shouldRenderInFeatureChooser(columnKey)===true){this._filterRowShown=true;this._fcData[columnKey]=true;if(isAdvanced||showAdvancedButton){fc._renderInFeatureChooser(columnKey,{name:"AdvancedFiltering",text:o.featureChooserTextAdvancedFilter,iconClass:this.css.featureChooserModalDialogIcon,isSelected:true,method:this._openFilterDialogFromFCHandler,updateOnClickAll:true,groupName:"modaldialog",groupOrder:3,order:3})}if(!isAdvanced){fc._renderInFeatureChooser(columnKey,{name:"Filtering",text:o.featureChooserText,textHide:o.featureChooserTextHide,iconClass:this.css.featureChooserModalDialogIcon,isSelected:true,method:this._toggleFilterRowHandler,updateOnClickAll:true,groupName:"toggle",groupOrder:1,order:2,type:"toggle",state:"hide"})}}}}},_columnResized:function(){if(this._filterRowShown!==false){this._setEditorsWidth()}},_setEditorsWidth:function(){if(this.options.mode!=="simple"&&this.options.advancedModeEditorsVisible!==true){return}var cs=this.options.columnSettings,cols=this.grid._visibleColumns(),cells=this.grid.headersTable().find("thead tr[data-role=filterrow]").first().find("td").not("[data-skip=true]"),cellWidth,i,j,skipColumn;for(i=0;i<cols.length;i++){for(j=0;j<cs.length;j++){if(cs[j].columnKey===cols[i].key&&cs[j].allowFiltering===false){skipColumn=true;break}}if(skipColumn){skipColumn=false;continue}if(!$.ig.util.isOpera&&(this.grid.options.height&&this.grid.options.fixedHeaders===true||$.ig.util.isWebKit)){cellWidth=cells.eq(i).innerWidth()}else{cellWidth=cells.eq(i).width()}cellWidth-=cells.eq(i).data("buttonWidth");cells.eq(i).children("span[data-filter-editor]").first().igGridFilterEditor("option","width",cellWidth)}},_headerRendered:function(sender){var thead,filterrow,i=0,cell,w,button,cols=this.grid.options.columns,thCell,id,j,cs=this.options.columnSettings,skipColumn=false,buttonCss,showAdvancedInHeader=false,indicatorContainer,cancelFunc,ci,buttonWidth,isSimpleMode=this.options.mode==="simple"||this.options.advancedModeEditorsVisible===true,isToCheck=this.grid._initialHiddenColumns&&this.grid._initialHiddenColumns.length>0;if(sender.target.id!==this.grid.element[0].id){return}thead=this.grid.container().find("thead");if(this.options.mode==="simple"||this.options.advancedModeEditorsVisible===true){filterrow=$("<tr></tr>").appendTo(thead).addClass(this.css.filterRow).attr("data-role","filterrow");this.grid._headerInit(filterrow)}else{filterrow=thead.find("tr:first")}cancelFunc=function(e){e.preventDefault();e.stopPropagation()};if(isToCheck){this._hiddenCells=[]}ci=i+filterrow.find("[data-skip=true]").length;for(i=0;i<cols.length;i++,ci++){if(isSimpleMode===true){cell=$("<td></td>").appendTo(filterrow).addClass(this.css.filterCell);if(isToCheck&&this._hiddenCells.length<this.grid._initialHiddenColumns.length){for(j=this.grid._initialHiddenColumns.length-1;j>=0;j--){if(this.grid._initialHiddenColumns[j].key===cols[i].key){cell.hide();this._hiddenCells.push(cell);break}}}}else{if(this.grid._isMultiColumnGrid){cell=$(this.grid._headerCells[ci])}else{cell=$(filterrow[0].cells[ci])}if(cell.children().first().is("a")){cell.children().first().css("display","inline");cell.css("cursor","pointer")}cell.data("colName",cols[i].key)}if(this.grid._isMultiColumnGrid!==true||isSimpleMode===true){if(i===cols.length-1&&this.grid.options.height&&parseInt(this.grid.options.height,10)>0){cell.css("width",parseInt(cols[i].width,10)+this.grid._scrollbarWidth())}else{cell.css("width",cols[i].width)}}for(j=0;j<cs.length;j++){if(cs[j].columnKey===cols[i].key&&cs[j].allowFiltering===false){if(this.options.advancedModeEditorsVisible===true||this.options.mode!=="advanced"){this._editors.push({})}skipColumn=true;break}}if(skipColumn){skipColumn=false;continue}thCell=thead.children().first().find("th:nth-child("+(ci+1)+")");if($.ig.util.isWebKit&&thCell.length>0){w=thCell[0].offsetWidth}else if(this.grid.options.height&&this.grid.options.fixedHeaders===true||$.ig.util.isWebKit){w=thCell.innerWidth()}else{w=thCell.width()}showAdvancedInHeader=this.options.advancedModeEditorsVisible===false&&this.options.mode==="advanced"&&this.options.renderFilterButton===true;if(this.options.renderFilterButton===true&&!showAdvancedInHeader||showAdvancedInHeader&&this._renderFCFor(cols[i].key)===false){id=this.grid.element.attr("id")+"_dd_"+cols[i].key;if(this.options.advancedModeEditorsVisible===true||this.options.mode!=="advanced"){this._renderDropDown(cols[i].dataType,id,cols[i].key)}buttonCss=this.options.mode==="advanced"?this.css.filterButtonAdvanced:this.css.filterButton;if(showAdvancedInHeader&&this.options.advancedModeHeaderButtonLocation==="right"){buttonCss=this.css.filterButtonAdvancedRight;button=$("<span></span>").appendTo(cell).addClass(buttonCss).data("colIndex",i)}else{button=$("<span></span>").prependTo(cell).addClass(buttonCss).data("colIndex",i)}if(this.options.mode==="advanced"){if(!cell.hasClass(this.grid.css.headerCellFeatureEnabledClass)){cell.addClass(this.grid.css.headerCellFeatureEnabledClass)}}if(this.options.mode==="simple"||this.options.mode==="advanced"&&this.options.advancedModeEditorsVisible===true){button.wrap('<a id="'+id+'_button" href="#" title="'+this.options.tooltipTemplate.replace("${condition}",this.options.labels.noFilter)+'" ></a>')}else{button.wrap('<a id="'+id+'_button" href="#" title="'+this.options.tooltipTemplate.replace("${condition}",this.options.labels.noFilter)+'" style="display:inline;"></a>')}indicatorContainer=cell.find(".ui-iggrid-indicatorcontainer");if(indicatorContainer.length===0){indicatorContainer=$("<div></div>").appendTo(cell).addClass("ui-iggrid-indicatorcontainer")}indicatorContainer.append(button.parent());w=parseInt(w,10);if(this.grid.options.height===null&&$.ig.util.isFF){buttonWidth=button.outerWidth(true)}else{buttonWidth=button.outerWidth(false)}w-=buttonWidth;cell.data("buttonWidth",buttonWidth)}if(this.options.renderFilterButton===true){if(this.options.advancedModeEditorsVisible===true||this.options.mode!=="advanced"){button.parent().bind({mousedown:$.proxy(this._toggleDropDown,this),mouseup:cancelFunc,click:cancelFunc,blur:$.proxy(this._closeDropDown,this),keydown:$.proxy(this._toggleDropDownKeyboard,this),mouseover:$.proxy(this._hoverButton,this),mouseout:$.proxy(this._unhoverButton,this),focus:$.proxy(this._activateButton,this)});if(document.documentMode===5||document.documentMode===7||$.ig.util.isIE7){button.parent().bind({focusout:$.proxy(this._closeDropDown,this)})}}else if(this._renderFCFor(cols[i].key)===false){button.parent().bind({click:$.proxy(this._openFilterDialog,this),keydown:$.proxy(this._openFilterDialogFromKeyboard,this),focus:$.proxy(this._activateButton,this),blur:$.proxy(this._deactivateButton,this)})}}if(this.options.advancedModeEditorsVisible===true||this.options.mode!=="advanced"){this._createEditor(cell,w,i,cols[i])}}if($("#"+this.grid.container().attr("id")+"_dialog").length>0){$("#"+this.grid.container().attr("id")+"_dialog").remove()}this._renderFilterDialog()},_renderFCFor:function(columnKey){return!(this._fcData===null||this._fcData===undefined||this.options.renderFC===false||this._fcData[columnKey]!==true)},_columnMap:function(){var o=this.options,i,elem,cs=o.columnSettings,csLength=cs.length,result=[];if(o.renderFC===false){return false}for(i=0;i<csLength;i++){elem={columnKey:cs[i].columnKey,enabled:true};if(cs[i].allowFiltering===false){elem.enabled=false}result.push(elem)}return result},_headerCellRendered:function(){if(this._isInitFC!==true){this._initFC()}},_openFilterDialogFromFC:function(event,columnKey){this._openFilterDialog(event,columnKey)},toggleFilterRowByFeatureChooser:function(event){var fc,$filterRow,o=this.options,isShown=this._filterRowShown,$thead=this.grid.container().find("thead"),isAdvanced=!(o.mode==="simple"||o.advancedModeEditorsVisible===true);if(isShown===null||isShown===undefined){this._filterRowShown=true;isShown=this._filterRowShown}if(isAdvanced===false||isAdvanced&&o.advancedModeEditorsVisible){$filterRow=$thead.find('tr[data-role="filterrow"]');if(isShown===true){$filterRow.hide();if(document.documentMode===7||$.ig.util.isIE7){$filterRow.children().hide()}isShown=false}else{$filterRow.show();if(document.documentMode===7||$.ig.util.isIE7){$filterRow.children().show()}this._setEditorsWidth();isShown=true}if(event===null||event===undefined){fc=this.grid.element.data("igGridFeatureChooser");if(fc){fc._toggleSelectedItems("Filtering")}}this._filterRowShown=isShown;this.grid._initializeHeights();if(this.grid.options.autofitLastColumn&&this.grid.options.height&&this.grid.hasVerticalScrollbar()!==this.grid._hasVerticalScrollbar){this.grid._adjustLastColumnWidth()}}},_getEditorVal:function(editor){if(editor._editorInput.is(":focus")&&editor.element.data("editorType")!=="igDatePicker"){editor._processValueChanging(editor._editorInput.val())}return editor.value()},_getEditorNameByColType:function(colType){if(colType==="date"||colType==="datetime"){return"igDatePicker"}if(colType==="number"||colType==="numeric"){return"igNumericEditor"}return"igTextEditor"},_createEditor:function(parent,w,colIndex,col){var $editor,colType,colKey,options,edtrType,self=this;colType=col.dataType;colKey=col.key;edtrType=this._getEditorNameByColType(colType);$editor=$("<span />").attr("data-filter-editor",true);if(this.options.filterButtonLocation==="left"){$editor.appendTo(parent)}else{$editor.prependTo(parent)}options={width:w,suppressNotifications:true,disabled:this.grid.options.columns[colIndex].dataType==="bool"||this.grid.options.columns[colIndex].dataType==="boolean",textAlign:"left",revertIfNotValid:false,placeHolder:this.options.nullTexts[this._findColumnSetting(colKey).condition],allowNullValue:true,rendered:function(e,args){var edtr=args.owner,$edtrCont=edtr.editorContainer(),$indCont=parent.find(".ui-iggrid-indicatorcontainer");if(self.grid.options.columns[colIndex].dataType==="bool"){edtr.field().removeClass("ui-state-disabled");edtr.editorContainer().removeClass("ui-state-disabled")}if(self.options.filterButtonLocation==="left"){$indCont.prependTo($edtrCont);$edtrCont.on({mousedown:function(e){if(edtr.options.disabled){self._toggleDropDown({currentTarget:$indCont.find("a")});e.stopPropagation()}}})}else{$indCont.appendTo($edtrCont)}}};$editor.data("colIndex",colIndex).data("colKey",colKey);if(colType==="date"||colType==="datetime"){options=$.extend({},options,{enableUTCDates:this.grid.options.enableUTCDates,valueChanged:$.proxy(this._filter,this),revertIfNotValid:false});if(col.format){options.dateInputFormat=col.format}}else{options.textChanged=$.proxy(this._filter,this)}$editor.data("editorType",edtrType);$editor.igGridFilterEditor(options);this._editors.push($editor.data(edtrType));$editor.find("input").addClass(this.css.filterCellEditor)},_columnFixed:function(args){var i,colInd=args.colInd,at=args.at,edtr,cs;cs=this.options.columnSettings[colInd];if(cs){if(at===undefined||at===null){at=args.fixedColsCount-1}this.options.columnSettings.splice(colInd,1);this.options.columnSettings.splice(at,0,cs);if(!this._editors||!this._editors.length||!this._editors[colInd]){return}edtr=this._editors.splice(colInd,1);this._editors.splice(at,0,edtr[0]);for(i=0;i<this._editors.length;i++){edtr=$(this._editors[i].element);edtr.data("colIndex",i);edtr.closest("td").find("span.ui-iggrid-filterbutton").data("colIndex",i)}}},_columnsAltered:function(event,args){var i,cs,start=args.start,len=args.len,idx=args.index;for(i=0;i<this.options.columnSettings.length;i++){cs=this.options.columnSettings[i];if(this.grid._isColumnHidden(cs.columnKey)===true){start+=i<=start?1:0;len+=i>=start&&i<start+len?1:0;idx+=i<=idx?1:0}}this.grid._rearrangeArray(this.options.columnSettings,start,len,idx);this.grid._rearrangeArray(this._editors,start,len,idx);for(i=0;i<this._editors.length;i++){$(this._editors[i].element).data("colIndex",i);$(this._editors[i].element).closest("td").find("span.ui-iggrid-filterbutton").data("colIndex",i)}},_findColumnSetting:function(key){var i;for(i=0;i<this.options.columnSettings.length;i++){if(this.options.columnSettings[i].columnKey===key){return this.options.columnSettings[i]}}},filter:function(expressions,updateUI,addedFromAdvanced){this._loadingIndicator.show();if(expressions!==undefined&&expressions.length>0){this._isFilteringRequest=true}if(!addedFromAdvanced){this._filterDataSource(expressions,true);this._updateFiltersUI([],false)}else{this._filterDataSource(expressions)}if(updateUI===undefined||updateUI===true){this._updateFiltersUI(expressions===undefined?this._generateExpressions():expressions,addedFromAdvanced)}},_filter:function(ui,args){clearTimeout(this._timeoutId);this._ui=ui;this._args=args;if(parseInt(this.options.filterDelay,10)===0){this._filterInternal()}else{this._timeoutId=setTimeout($.proxy(this._filterInternal,this),this.options.filterDelay)}},_filterInternal:function(colIndex,colKey){var args=this._args,_colIndex,_colKey,noCancel,editor,exprs;if(args!==undefined){_colIndex=$(args.owner.element).data("colIndex");_colKey=$(args.owner.element).data("colKey")}else{_colIndex=colIndex;_colKey=colKey}exprs=this._generateExpressions(true);noCancel=this._trigger(this.events.dataFiltering,null,{columnKey:_colKey,columnIndex:_colIndex,owner:this,newExpressions:exprs});if(noCancel){this._loadingIndicator.show();editor=this._editors?this._editors[_colIndex]:null;if(editor){editor._addedFromAdvanced=false}this._curColKey=_colKey;this._curColIndex=_colIndex;this._filterDataSource(exprs,false,true)}},_filterDataSource:function(expressions,apiCall,updateUI){var exprs,i,j,expr,col,button,groupBy,cols=this.grid.options.columns,found=false,defaultTooltip,noCancel;defaultTooltip=this.options.tooltipTemplate.replace("${condition}",this.options.labels.noFilter);if(apiCall){if($.type(expressions)==="array"&&expressions.length){for(i=0;i<expressions.length;i++){expr=expressions[i];
if(expr.dataType){continue}col=this.grid.columnByKey(expr.fieldName);if(col){if(col.dataType){expr.dataType=col.dataType}else{expr.dataType="string"}}}}}if(expressions!==undefined&&!updateUI){if(apiCall===true){this.grid.dataSource.settings.filtering.expressions=expressions;this._filterDialogClearAll();for(i=0;i<expressions.length;i++){this._addFilterFromDialog(null,expressions[i])}}else{this.grid.dataSource.settings.filtering.expressions=expressions}}else{if(expressions!==undefined&&updateUI){exprs=expressions}else{exprs=this._generateExpressions(true)}for(i=0;i<cols.length;i++){found=false;button=$("#"+this.grid.element[0].id+"_dd_"+cols[i].key+"_button");for(j=0;j<exprs.length;j++){if(cols[i].key===exprs[j].fieldName){found=true;if((exprs[j].expr===undefined||exprs[j].expr===null||exprs[j].expr==="")&&this._requiresEntry(exprs[j].cond)){button.attr("title",defaultTooltip)}else{button.attr("title",this.options.tooltipTemplate.replace("${condition}",this.options.labels[exprs[j].cond]))}break}}if(!found){button.attr("title",defaultTooltip)}}this.grid.dataSource.settings.filtering.expressions=exprs}if(this.options.persist){this._saveFilteringExpressions()}if(this.grid._hasUnboundColumns){this.grid._rebindUnboundColumns=true}this.grid.element.trigger("iggriduisoftdirty",{owner:this});noCancel=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid,dataSource:this.grid.dataSource});if(noCancel){exprs=this.grid.dataSource.settings.filtering.expressions;if(this.options.type==="remote"){this.grid.dataSource.settings.paging.pageIndex=0;this.grid._shouldResetPaging=true}else if(this.grid.container().find(".ui-iggrid-footer .ui-iggrid-results").length>0){this.grid.container().find(".ui-iggrid-footer .ui-iggrid-results").data("overrideLabel",exprs.length)}this._isFilteringRequest=true;this._preserveSorting();if(exprs.length===0){if(!apiCall){this._shouldFireDataFiltered=true}if(this.options.type==="remote"){this._isFilteringRequest=false;this.grid.dataSource.dataBind()}else{this.grid.dataSource.settings.filtering.type="local";this._isFilteringRequest=false;this.grid.dataSource.clearLocalFilter();groupBy=this.grid.element.data("igGridGroupBy");if(groupBy&&groupBy.options&&groupBy.options.groupedColumns&&groupBy.options.groupedColumns.length>0){if(this.grid.dataSource.settings.sorting.expressions.length>0&&groupBy.options.type==="local"){this.grid.dataSource.sort(this.grid.dataSource.settings.sorting.expressions)}}this.grid._renderData()}}else{if(this.options.type==="remote"){if(!apiCall){this._shouldFireDataFiltered=true}this.grid.dataSource.dataBind()}else{this.grid.dataSource.settings.filtering.type="local";this.grid.dataSource.filter(exprs);groupBy=this.grid.element.data("igGridGroupBy");if(groupBy&&groupBy.options&&groupBy.options.groupedColumns&&groupBy.options.groupedColumns.length>0){if(this.grid.dataSource.settings.sorting.expressions.length>0&&groupBy.options.type==="local"&&this.grid.dataSource._allDataSorted===false){this.grid.dataSource.sort(this.grid.dataSource.settings.sorting.expressions)}}this.grid._renderData();if(!apiCall){this._trigger(this.events.dataFiltered,null,{columnKey:this._curColKey,columnIndex:this._curColIndex,owner:this,expressions:exprs})}}}}},_filterDataSourceClear:function(colKey,colIndex){var i,exprs=this._generateExpressions(true),noCancel,noCancelFiltering;for(i=0;i<exprs.length;i++){if(exprs[i].fieldName===colKey){$.ig.removeFromArray(exprs,i);break}}this.grid.dataSource.settings.filtering.expressions=exprs;if(this.options.persist){this._saveFilteringExpressions()}if(!this._curColKey||colKey){this._curColKey=colKey;this._curColIndex=colIndex}noCancelFiltering=this._trigger(this.events.dataFiltering,null,{columnKey:this._curColKey,columnIndex:this._curColIndex,owner:this,newExpressions:exprs});if(noCancelFiltering){noCancel=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid,dataSource:this.grid.dataSource});if(noCancel){this.grid.dataSource.settings.paging.pageIndex=0;this._preserveSorting();this.grid._shouldResetPaging=true;this._loadingIndicator.show();if(this.options.type==="remote"){if(exprs.length>0){this._shouldFireDataFiltered=true}else{this._isFilteringRequest=false;this._shouldFireDataFiltered=true}this.grid.dataSource.dataBind()}else{this.grid.dataSource.settings.filtering.type="local";if(this.grid.container().find(".ui-iggrid-footer .ui-iggrid-results").length>0){this.grid.container().find(".ui-iggrid-footer .ui-iggrid-results").data("overrideLabel",exprs.length)}if(exprs.length>0){this.grid.dataSource.filter(exprs)}else{this._isFilteringRequest=false;this.grid.dataSource.clearLocalFilter()}this.grid._renderData();this._trigger(this.events.dataFiltered,null,{columnKey:this._curColKey,columnIndex:this._curColIndex,owner:this,expressions:exprs})}}}},_preserveSorting:function(){var hasGroupedCols=false,groupBy=this.grid.element.data("igGridGroupBy");if(groupBy&&groupBy.options&&groupBy.options.groupedColumns&&groupBy.options.groupedColumns.length>0){hasGroupedCols=true}if(this.grid.dataSource.settings.sorting.expressions.length>0&&hasGroupedCols){this.grid.dataSource.settings.sorting.defaultFields=this.grid.dataSource.settings.sorting.expressions}},_getDataColumnFilteringExpressions:function(fe){if(!this.grid._hasUnboundColumns){return fe}var grid=this.grid,newFE;newFE=$.grep(fe,function(s){var col=grid.columnByKey(s.fieldName);return!col||col.unbound!==true});return newFE},_saveFilteringExpressions:function(){var fe=this._getDataColumnFilteringExpressions(this.grid.dataSource.settings.filtering.expressions);if(this.element.closest(".ui-iggrid-root").data("igGrid")){this.grid._savePersistenceData(fe,"filtering",this.grid.element[0].id)}this._filteringExpressions=fe},_preserveFiltering:function(){var fe=this._filteringExpressions||this.grid._getPersistenceData("filtering",this.grid.element[0].id);if(fe){if(this.grid._hasUnboundColumns){this._updateFiltersUI([],false)}this.grid.dataSource.settings.filtering.expressions=fe;this.grid.dataSource.settings.filtering.defaultFields=fe;this._defaultExpressions=fe}},_updateFiltersUI:function(expressions){var i,j,editor,filterList,items,condName,$li,exprLen=expressions.length;if(this._editors){for(i=0;i<this._editors.length;i++){if(this.options.columnSettings[i].allowFiltering!==false){this._editors[i].value(null)}}}if(this.options.showEmptyConditions&&!exprLen){for(i=0;i<this.options.columnSettings.length;i++){condName=this.options.columnSettings[i].condition;if(condName==="empty"||condName==="notEmpty"||condName==="null"||condName==="notNull"){$li=$("#"+this.grid.element[0].id+"_dd_"+this.options.columnSettings[i].columnKey).find("ul").children().first();if($li.length){this._selectDropDownItem({currentTarget:$li},null)}}}}for(i=0;i<exprLen;i++){filterList=$("#"+this.grid.element[0].id+"_dd_"+expressions[i].fieldName).find("ul");items=filterList.children();condName=this._resolveConditionNameFromExpression(expressions[i]);for(j=0;j<items.length;j++){if($(items[j]).data("cond")===condName){this._selectDropDownItem({currentTarget:items[j]},null,expressions[i]);break}}editor=this._editors[this._columnIndexFromKey(expressions[i].fieldName)];if(editor!==undefined&&editor!==null&&editor.value){editor.value(expressions[i].expr);editor._addedFromAdvanced=true}}this._updateTooltips(expressions)},_updateTooltips:function(expressions){var button,title,found,titleText,tempTooltipExpr,cols=this.grid.options.columns,colsLength=cols.length,i,j,expressionFieldName,condName,conditionLabel,isSimpleMode=this.options.mode==="simple"||this.options.advancedModeEditorsVisible===true;titleText=this.options.tooltipTemplate.replace("${condition}",this.options.labels.noFilter);title="";for(i=0;i<expressions.length;i++){button=$("#"+this.grid.element[0].id+"_dd_"+expressions[i].fieldName+"_button");if(!this._requiresEntry(expressions[i].cond)||expressions[i].expr===undefined||expressions[i].expr===null){tempTooltipExpr=""}else{tempTooltipExpr=expressions[i].expr;if(expressions[i].type==="date"){if($.type(tempTooltipExpr)==="number"){tempTooltipExpr=new Date(tempTooltipExpr)}if(this.grid.options.enableUTCDates&&$.type(tempTooltipExpr)==="date"&&tempTooltipExpr.toUTCString){tempTooltipExpr=tempTooltipExpr.toUTCString()}}}expressionFieldName=expressions[i].fieldName;for(j=0;j<colsLength;j++){if(cols[j].key===expressionFieldName){expressionFieldName=cols[j].headerText;break}}condName=this._resolveConditionNameFromExpression(expressions[i],expressionFieldName);conditionLabel=this.options.labels[condName];if(isSimpleMode){button.attr("title",this.options.tooltipTemplate.replace("${condition}",conditionLabel));continue}if(i===0){button.attr("title",expressionFieldName+" "+conditionLabel+" "+tempTooltipExpr+" ")}else{button.attr("title",title+expressions[i].logic+" "+expressionFieldName+" "+conditionLabel+" "+tempTooltipExpr+" ")}title=button.attr("title")}for(i=0;i<colsLength;i++){found=false;for(j=0;j<expressions.length;j++){if(expressions[j].fieldName===cols[i].key){found=true;break}}if(!found){$("#"+this.grid.element[0].id+"_dd_"+cols[i].key+"_button").attr("title",titleText)}}},_resolveConditionNameFromExpression:function(expression,fieldName){var j,expressionFieldName,custConds=this._dsTransformedCustomConditions,cols=this.grid.options.columns,colsLength=cols.length;if(fieldName){expressionFieldName=fieldName}else{expressionFieldName=expression.fieldName;for(j=0;j<colsLength;j++){if(cols[j].key===expressionFieldName){expressionFieldName=cols[j].headerText;break}}}if(custConds&&custConds[expressionFieldName+"_"+expression.cond]){return expressionFieldName+"_"+expression.cond}else{return expression.cond}},_columnIndexFromKey:function(key){var i;for(i=0;i<this.grid.options.columns.length;i++){if(this.grid.options.columns[i].key===key){return i}}},_generateExpressions:function(filterRowTrigger){var exprs=[],cols=this.grid.options.columns,expr,i,currentCondition,requiresEntry,isExprAdded,dt,defExpr,precise,format,preciseInd;for(i=0;i<cols.length;i++){if(this._editors&&this._editors[i]&&this._editors[i]._addedFromAdvanced&&!filterRowTrigger){continue}if(this.options.columnSettings[i].allowFiltering!==true){defExpr=this.options.columnSettings[i].defaultExpressions;if(defExpr&&defExpr.length){expr=defExpr[0].expr;currentCondition=defExpr[0].cond}else{continue}}else{expr=this._getEditorVal(this._editors[i]);currentCondition=this.options.columnSettings[i].condition}requiresEntry=this._requiresEntry(currentCondition);if(currentCondition===undefined||currentCondition===null||currentCondition===""){continue}if((expr===undefined||expr===null||expr==="")&&requiresEntry){continue}precise="";dt=cols[i].dataType;if(dt==="date"&&expr){if(this.options.type==="remote"&&this.options.filterExprUrlKey!==null&&this.options.filterExprUrlKey!==undefined){expr=Date.UTC(expr.getUTCFullYear(),expr.getUTCMonth(),expr.getUTCDate(),expr.getUTCHours(),expr.getUTCMinutes())}else{format=cols[i].format;if(format&&format.indexOf){preciseInd=format.toLowerCase().indexOf("h");if(preciseInd===-1){preciseInd=format.indexOf("m")}if(preciseInd===-1){preciseInd=format.indexOf("s")}if(preciseInd>-1){precise=format.substr(preciseInd)}}if(precise===""&&currentCondition==="after"&&$.type(expr)==="date"){expr.setHours(23);expr.setMinutes(59);expr.setSeconds(59);expr.setMilliseconds(999)}}}isExprAdded=false;if(dt!=="date"||dt==="date"&&expr!==null&&expr!==undefined&&currentCondition!=="empty"&&currentCondition!=="notEmpty"&&currentCondition!=="null"&&currentCondition!=="notNull"||dt==="date"&&!this._requiresEntry(currentCondition)){if(expr!==""&&dt!=="bool"&&!this.options.filterExprUrlKey){isExprAdded=true;exprs.push({fieldName:cols[i].key,cond:currentCondition,expr:expr})}else if(dt==="bool"&&expr!==""&&expr!==null||dt!=="bool"&&(this.options.filterExprUrlKey!==undefined&&this.options.filterExprUrlKey!==null||this.options.type==="local")){isExprAdded=true;exprs.push({fieldName:cols[i].key,cond:currentCondition,expr:expr})}else if(dt==="bool"&&(expr===""||expr===null)&&(currentCondition==="null"||currentCondition==="notNull"||currentCondition==="empty"||currentCondition==="notEmpty")){isExprAdded=true;exprs.push({fieldName:cols[i].key,cond:currentCondition,expr:expr})}if(isExprAdded){if(dt===undefined&&$.type(expr)==="string"){exprs[exprs.length-1].dataType="string"}if(cols[i].unbound){exprs[exprs.length-1].dataType=dt}if(precise){exprs[exprs.length-1].preciseDateFormat=precise}}}}return exprs},_getDefaultCondition:function(type){var result="equals";if(type===undefined||type===null||type==="string"){result="contains"}else if(type==="number"){result="equals"}else if(type==="date"){result="on"}else if(type==="bool"){result="true"}return result},_initDefaultSettings:function(){var settings=[],key,de,cs=this.options.columnSettings,i,j,k,l,cols=this.grid.options.columns,allowFiltering,defExpr,isToCheckUnboundColumns=this.grid._hasUnboundColumns===true&&this.options.type==="remote",conditionIsValid,conds,custConds;function getColumnTypeFromSchema(colKey,schemaFields){var schemaLoop;for(schemaLoop=0;schemaLoop<schemaFields.length;++schemaLoop){if(schemaFields[schemaLoop].name===colKey){return schemaFields[schemaLoop].type}}}this._defaultExpressions=this.grid.dataSource.settings.filtering.expressions||[];if(cols&&cols.length>0){for(i=0;i<cols.length;i++){allowFiltering=true;if(isToCheckUnboundColumns&&this.grid.getUnboundColumnByKey(cols[i].key)!==null){allowFiltering=false}settings[i]={columnIndex:i,columnKey:cols[i].key,condition:this._getDefaultCondition(cols[i].dataType),allowFiltering:allowFiltering}}}if(settings.length===0&&this.grid.options.autoGenerateColumns&&cs.length>0){for(i=0;i<cs.length;i++){if(!cs[i].columnKey){continue}conds=this._populateConditionsList(cs[i].columnKey,getColumnTypeFromSchema(cs[i].columnKey,this.grid.dataSource._schema.schema.fields));defExpr=cs[i].defaultExpressions;custConds=cs[i].customConditions;if(defExpr&&defExpr.length>0){for(k=0;k<defExpr.length;k++){conditionIsValid=false;for(l=0;l<conds.length;++l){for(key in custConds){if(custConds.hasOwnProperty(key)){if(conds[l].condition===cs[i].columnKey+"_"+defExpr[k].cond){conditionIsValid=true;break}}}if(conditionIsValid){break}if(conds[l].condition===defExpr[k].cond){conditionIsValid=true;break}}if(!conditionIsValid){throw new Error($.ig.util.stringFormat($.ig.GridFiltering.locale.defaultConditionContainsInvalidCondition,cs[i].columnKey))}de={fieldName:cs[i].columnKey,expr:defExpr[k].expr,cond:defExpr[k].cond};if(defExpr[k].logic){de.logic=defExpr[k].logic}this._defaultExpressions.push(de)}}}}else{for(i=0;i<cs.length;i++){for(j=0;j<settings.length;j++){if(settings[j].columnKey===cs[i].columnKey||cs[i].columnKey===undefined&&settings[j].columnIndex===cs[i].columnIndex){break}}if(j===settings.length){continue}conds=this._populateConditionsList(cs[i].columnKey,getColumnTypeFromSchema(cs[i].columnKey,this.grid.dataSource._schema.schema.fields));for(key in cs[i]){if(cs[i].hasOwnProperty(key)){if(key!=="columnKey"&&key!=="columnIndex"){settings[j][key]=cs[i][key]}if(key==="defaultExpressions"&&cs[i][key]){defExpr=cs[i][key];custConds=cs[i].customConditions;for(k=0;k<defExpr.length;k++){conditionIsValid=false;for(l=0;l<conds.length;++l){for(key in custConds){if(custConds.hasOwnProperty(key)){if(conds[l].condition===cs[i].columnKey+"_"+defExpr[k].cond){conditionIsValid=true;break}}}if(conditionIsValid){break}if(conds[l].condition===defExpr[k].cond){conditionIsValid=true;break}}if(!conditionIsValid){throw new Error($.ig.util.stringFormat($.ig.GridFiltering.locale.defaultConditionContainsInvalidCondition,cs[i].columnKey))}de={fieldName:cs[i].columnKey,expr:defExpr[k].expr,cond:defExpr[k].cond};if(defExpr[k].logic){de.logic=defExpr[k].logic}this._defaultExpressions.push(de)}}}}}}this.options.columnSettings=settings;this.grid.dataSource.settings.filtering.expressions=this._defaultExpressions;this.grid.dataSource.settings.filtering.defaultFields=this._defaultExpressions},_transformCustomConditionsForDataSource:function(){var i,cs=this.options.columnSettings,curCS,custConds,curCond,newCond,key,keyCond;for(i=0;i<cs.length;++i){curCS=cs[i];custConds=curCS.customConditions;if(custConds){this._dsTransformedCustomConditions=this._dsTransformedCustomConditions||{};for(key in custConds){if(custConds.hasOwnProperty(key)){curCond=custConds[key];keyCond=curCS.columnKey+"_"+key;newCond={requireExpr:!!curCond.requireExpr,filterFunc:curCond.filterFunc,expressionText:curCond.expressionText||key};this.options.labels[keyCond]=this.options.labels[keyCond]||curCond.labelText;this.options.nullTexts[keyCond]=this.options.nullTexts[keyCond]||curCond.labelText;this._dsTransformedCustomConditions[keyCond]=newCond}}}}this.grid.dataSource.settings.filtering.customConditions=this._dsTransformedCustomConditions},_renderDropDown:function(type,id,colName){var ul=this._renderDropDownElement(id,colName),i,cs=this.options.columnSettings,cols=this.grid.options.columns,item,obj,conds;conds=this._populateConditionsList(colName,type);if(this.options.filterDropDownItemIcons!==true){$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).addClass(this.css.filterDropDownListItemClear)).text(this.options.labels.clear).addClass("ui-corner-all");for(i=0;i<conds.length;++i){$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond",conds[i].condition)).text(conds[i].text).addClass("ui-corner-all")}}else{obj={itemClass:this.css.filterDropDownListItemWithIcons,imgContainerClass:this.css.filterItemIconContainer,textClass:this.css.filterDropDownListItemTextContainer};this._renderDropDownToList(obj,[{text:this.options.labels.clear,imgClass:this.css.filterItemIconClear}],ul);this._renderDropDownToList(obj,conds,ul)}if(this.options.mode==="advanced"){this._renderAdvancedButton(ul)}for(i=0;i<cs.length;i++){if(cs[i].columnKey===colName&&cs[i].condition!==this._getDefaultCondition(cols[i].dataType)){if(cs[i].condition==="null"){item=ul.find(':contains("'+this.options.labels.nullLabel+'")')}else{item=ul.find(':contains("'+this.options.labels[cs[i].condition]+'")')}item=item.children().first().closest("li");item.addClass(this.css.filterDropDownListItemActive).parent().data("selectedItem",$("li",item.parent()).index(item))}}},_renderAdvancedButton:function(ul){var li;li=$("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItemAdvanced);this._currentButton=$(toStaticHTML('<input type="button"></input>'));this._currentButton.igButton({labelText:this.options.labels.advancedButtonLabel}).bind({mousedown:$.proxy(this._openFilterDialog,this)});li.append(this._currentButton)},_openFilterDialogFromKeyboard:function(event){if(event.keyCode===$.ui.keyCode.ENTER){this._openFilterDialog(event)}},_checkModalDialogFocus:function(){var $dialog=$("#"+this.grid.container().attr("id")+"_dialog"),$container=this.grid.container();$container.unbind("keydown.focusChecker");$container.bind("keydown.focusChecker",function(e){var tabElems,target,gridContainer=$container[0];if(e.keyCode===$.ui.keyCode.TAB){target=document.activeElement;if(!target||!gridContainer){return}if(target===gridContainer||$.contains(gridContainer,target)&&!$.contains($dialog[0],target)){tabElems=$(":tabbable",$dialog);tabElems.first().focus();return}}})},_openFilterDialog:function(event,columnKey){var maxZ,left,top,pos,h,w,bh,dh,dw,bw,noCancel=true,block=$("#"+this.grid.container().attr("id")+"_block"),dialog=$("#"+this.grid.container().attr("id")+"_dialog"),addDefault=true,rOffset,i,expressions=this.grid.dataSource.settings.filtering.expressions;this._checkModalDialogFocus();maxZ=$.ig.getMaxZIndex(this.grid.container().attr("id")+"_dialog");block.css("zIndex",maxZ+1);dialog.css("zIndex",maxZ+2);if(this.options.filterDialogContainment==="owner"){dialog.draggable("option","containment",this.grid.container())}else{dialog.draggable("option","containment","document")}this._dialogCurrentColumn=$(event.target).closest("ul").data("colName");if(this._dialogCurrentColumn===undefined||this._dialogCurrentColumn===null){if(columnKey!==null&&columnKey!==undefined){this._dialogCurrentColumn=columnKey}else{this._dialogCurrentColumn=$(event.target).closest("th").data("colName")}}if(this._dialogCurrentColumn===undefined||this._dialogCurrentColumn===null){this._dialogCurrentColumn=this.grid.options.columns[0]}dialog.find(".ui-iggrid-filtertable tbody tr").remove();this._dialogCurrentType=this.grid.columnByKey(this._dialogCurrentColumn).dataType;dialog.find(".ui-iggrd-filtertable tbody tr").remove();if(expressions&&expressions.length>0){addDefault=true;for(i=0;i<expressions.length;i++){if(!addDefault||expressions[i].fieldName===this._dialogCurrentColumn){addDefault=false}this._addFilterFromDialog(null,expressions[i])}if(addDefault){this._addFilterFromDialog()}}else{this._addFilterFromDialog()}noCancel=this._trigger(this.events.filterDialogOpening,null,{dialog:dialog,owner:this});if(noCancel){pos=$.ig.util.offset(this.grid.container());left=pos.left;top=pos.top;if(block.outerWidth()!==this.grid.container().outerWidth()){block.css("width",this.grid.container().outerWidth())}if(block.outerHeight()!==this.grid.container().outerHeight()){block.css("height",this.grid.container().outerHeight())}$("#"+this.grid.container().attr("id")+"_dialog_error").hide();rOffset=$.ig.util.getRelativeOffset(block);block.css({left:left-rOffset.left,top:top-rOffset.top}).fadeToggle();w=this.grid.container().outerWidth();h=this.grid.container().outerHeight();bw=$(window).width();bh=$(window).height();if(w+left>bw){w=w-(w+left-bw)}if(w<=0){w=this.grid.container().outerWidth()}if(h+top>bh){h=h-(h+top-bh)}if(h<=0){h=this.grid.container().outerHeight()}dh=parseInt(this.options.filterDialogHeight,10);dw=parseInt(this.options.filterDialogWidth,10);if(isNaN(dh)||dh<=0){dh=dialog.outerHeight()}if(isNaN(dw)||dw<=0){dw=dialog.outerWidth()}top=top+parseInt(h/2,10)-dh/2;left=left+parseInt(w/2,10)-dw/2;top=top<0?pos.top:top;left=left<0?pos.left:left;rOffset=$.ig.util.getRelativeOffset(dialog);dialog.css({left:left-rOffset.left,top:top-rOffset.top}).fadeToggle($.proxy(this._setResizableEnv,this));dialog.focus();event.preventDefault();event.stopPropagation();if(!(this.options.mode==="advanced"&&this.options.advancedModeEditorsVisible===false)&&this._currentTarget!==null&&this._currentTarget!==undefined){this._toggleDropDown({currentTarget:this._currentTarget},true)}}},_closeFilterDialog:function(e){var noCancel=true,$gridContainer=this.grid.container();noCancel=this._trigger(this.events.filterDialogClosing,null,{owner:this});if(noCancel){$gridContainer.unbind("keydown.focusChecker");$("#"+$gridContainer.attr("id")+"_block").fadeToggle();$("#"+$gridContainer.attr("id")+"_dialog").fadeToggle();this._trigger(this.events.filterDialogClosed,null,{owner:this});if(e){e.preventDefault();e.stopPropagation()}return false}},_searchFilterDialog:function(e){var expressions=[],rows,boolLogic,selectLogic,noCancel=true,i,type,exprObj,$row,expr,noCancelFiltering=true,cond,col,$input,hrs,mins,sec,ms;noCancel=this._trigger(this.events.filterDialogFiltering,null,{dialog:$("#"+this.grid.container().attr("id")+"_dialog"),owner:this});if(noCancel){rows=$("#"+this.grid.container().attr("id")+"_dialog").find("[data-af-row]");if(!rows.length){rows=$("#"+this.grid.container().attr("id")+"_dialog table tbody").children()}boolLogic="and";selectLogic=$("#"+this.grid.container().attr("id")+"_dialog select:first");if(selectLogic.length>0){boolLogic=$("#"+this.grid.container().attr("id")+"_dialog select:first")[0].value==="all"?"AND":"OR"}for(i=0;i<rows.length;i++){$row=$(rows[i]);$input=this._getDialogColSelByRow($row);if($input.data("value")!==undefined){col=this.grid.columnByKey($input.data("value"))}else{col=this.grid.columnByText($input[0].value)}if(!col){continue}type=col.dataType;expr=this._getDialogExprSelByRow($row).igGridFilterEditor("value");cond=this._getDialogCondSelByRow($row)[0].value;if($.type(expr)==="date"){if(this.options.type==="local"&&(!col.format||col.format==="date")){if(cond==="after"){hrs=23;mins=59;sec=59;ms=999}else{hrs=0;mins=0;sec=0;ms=0}}if(this.grid.options.enableUTCDates){if(hrs===undefined){hrs=expr.getUTCHours();mins=expr.getUTCMinutes()}expr=Date.UTC(expr.getUTCFullYear(),expr.getUTCMonth(),expr.getUTCDate(),hrs,mins)}else if(hrs!==undefined){expr.setHours(hrs);expr.setMinutes(mins);expr.setSeconds(sec);expr.setMilliseconds(ms)}}exprObj={fieldName:col.key,cond:cond,expr:expr,logic:boolLogic,type:type};if(col.unbound&&type){exprObj.dataType=type}else if(type===undefined&&$.type(expr)==="string"){exprObj.dataType="string"}expressions.push(exprObj)}this._closeFilterDialog(e);this._currentAdvancedExpressions=expressions;noCancelFiltering=this._trigger(this.events.dataFiltering,null,{owner:this,newExpressions:expressions});if(noCancelFiltering){this.filter(expressions,true,true)}}e.preventDefault();e.stopPropagation()},_filterDialogStartMove:function(){this._isFilterDialogMouseDown=true},_filterDialogStopMove:function(){this._isFilterDialogMouseDown=false;this._dialogClientX=undefined;this._dialogClientY=undefined},_filterDialogMove:function(e,ui){$(e.target).find(".ui-igedit-fieldincontainer").igGridFilterEditor("hideDropDown");this._trigger(this.events.filterDialogMoving,null,{dialog:e.target,owner:this,originalPosition:ui.originalPosition,position:ui.position})},_renderFilterDialog:function(){var dialog,condObj,dropDownData,condElement,condDropDown,okCancelContainer,f=this,caption,dialogContent,noCancel=true,addClearButtons,limit,container;container=this.grid._rootContainer();$("<div></div>").appendTo(container).attr("id",this.grid.container().attr("id")+"_block").css("position","absolute").addClass(this.css.blockArea).data("efh","1").hide();dialog=$("<div></div>").appendTo(container).attr("id",this.grid.container().attr("id")+"_dialog").css("position","absolute").css("width",this.options.filterDialogWidth).css("height",this.options.filterDialogHeight).addClass(this.css.filterDialog).data("efh","1").hide();noCancel=this._trigger(this.events.filterDialogContentsRendering,null,{dialogElement:dialog,owner:this});if(noCancel){caption=$("<div></div>").appendTo(dialog).addClass(this.css.filterDialogHeaderCaption);$("<span></span>").appendTo(caption).text(this.options.labels.filterDialogCaptionLabel).addClass(this.css.filterDialogHeaderCaptionTitle);$("<span></span>").appendTo($("<a></a>").appendTo(caption).attr({href:"#",role:"button",title:$.ig.GridFiltering.locale.filterDialogCloseLabel}).addClass("ui-dialog-titlebar-close ui-corner-all")).bind({click:$.proxy(this._closeFilterDialog,this)}).addClass("ui-icon ui-icon-closethick");dialogContent=$("<div></div>").appendTo(dialog).addClass("ui-dialog-content").css("overflow","auto");condObj={label1:this.options.labels.filterDialogConditionLabel1,label2:this.options.labels.filterDialogConditionLabel2};dropDownData=[{text:this.options.labels.filterDialogAllLabel,value:"all"},{text:this.options.labels.filterDialogAnyLabel,value:"any"}];if(this.options.filterDialogAddConditionTemplate&&typeof this.options.filterDialogAddConditionTemplate==="string"){condElement=$(this._fTmplWrappers[this.grid.id()+"_filterDialogAddConditionTemplate"](condObj))}else{condElement=$("<div><span>"+condObj.label1+"</span><div><select title='"+$.ig.GridFiltering.locale.filterDialogConditionDropDownLabel+"'></select></div><span>"+condObj.label2+"</span></div>")}condElement.appendTo(dialogContent).addClass(this.css.filterDialogAddCondition);if(this.options.filterDialogAddConditionDropDownTemplate&&typeof this.options.filterDialogAddConditionDropDownTemplate==="string"){condDropDown=$(this._fTmplWrappers[this.grid.id()+"_filterDialogAddConditionDropDownTemplate"](dropDownData))}else{condDropDown=$("<option value='"+dropDownData[0].value+"'>"+dropDownData[0].text+"</option>"+"<option value='"+dropDownData[1].value+"'>"+dropDownData[1].text+"</option>")}condDropDown.appendTo(condElement.find("div").addClass(this.css.filterDialogAddConditionDropDown).find("select"));addClearButtons=$("<div></div>").appendTo(dialogContent);$(toStaticHTML('<input type="button"></input>')).appendTo($("<span></span>").appendTo(addClearButtons).addClass(this.css.filterDialogAddButton)).igButton({labelText:this.options.labels.filterDialogAddLabel,width:this.options.filterDialogAddButtonWidth}).bind({click:$.proxy(this._addFilterFromDialog,this)});$("<button />").appendTo(addClearButtons).css("float","right").igButton({labelText:this.options.labels.filterDialogClearAllLabel,click:$.proxy(this._filterDialogClearAll,this),css:{buttonClasses:this.css.filterDialogClearAllButton,buttonHoverClasses:"",buttonActiveClasses:"",buttonFocusClasses:"",buttonLabelClass:""}});$("<label></label>").appendTo(dialogContent).attr("id",dialog.attr("id")+"_error").hide().text(this.options.labels.filterDialogErrorLabel).addClass("ui-widget ui-state-error ui-igvalidator-label");$("<table><tbody></tbody></table>").appendTo(dialogContent).addClass(this.css.filterDialogFiltersTable);okCancelContainer=$("<div></div>").appendTo($("<div></div>").appendTo(dialog).addClass(this.css.filterDialogOkCancelButton)).addClass("ui-dialog-buttonset");$('<button id="'+this.grid.element[0].id+'_filter_dialog_ok_button"/>').appendTo(okCancelContainer).igButton({labelText:this.options.labels.filterDialogOkLabel,width:this.options.filterDialogOkCancelButtonWidth}).bind({click:$.proxy(this._searchFilterDialog,this)});$('<button id="'+this.grid.element[0].id+'_filter_dialog_cancel_button"/>').appendTo(okCancelContainer).igButton({labelText:this.options.labels.filterDialogCancelLabel,width:this.options.filterDialogOkCancelButtonWidth}).bind({click:$.proxy(this._closeFilterDialog,this)});if(this._hc===true){limit=$("#"+this.grid.element[0].id.split("_")[0]+"_container")}else{limit=this.grid.container()}dialog.bind({keydown:function(e){var tabElems,first,last;if(e.keyCode===$.ui.keyCode.ESCAPE){f._closeFilterDialog()}if(e.keyCode!==$.ui.keyCode.TAB){return}tabElems=$(":tabbable",dialog);first=tabElems.first();last=tabElems.last();if(e.target===last[0]&&!e.shiftKey){first.focus(1);return false}if(e.target===first[0]&&e.shiftKey){last.focus(1);return false}}}).draggable({containment:limit,handle:caption,drag:$.proxy(this._filterDialogMove,this)}).attr("role","dialog").attr("tabIndex",-1);if(typeof Modernizr!=="object"||Modernizr.touch===false){dialog.resizable({minHeight:dialog.outerHeight()/4,minWidth:dialog.outerWidth()/2,resize:$.proxy(this._resizeHandler,this)});if(this.options.filterDialogContainment==="owner"){dialog.resizable("option","containment","parent")}}this._trigger(this.events.filterDialogContentsRendered,null,{dialogElement:dialog,owner:this})}},_setResizableEnv:function(){var initH,e=$("#"+this.grid.container().attr("id")+"_dialog"),rCont=e.find(">.ui-dialog-content"),hCont=e.find(">.ui-dialog-titlebar"),bCont=e.find(">.ui-dialog-buttonpane");if(!this._resizeCont){this._resizeCont=rCont;initH=e.height()-hCont.outerHeight()-(rCont.outerHeight()-rCont.height())-bCont.outerHeight();this._setFilterDialogContentHeight(initH)}this._resizeCont=rCont;if(e[0].style.height===""){e.css("height",e.height())}this._trigger(this.events.filterDialogOpened,null,{dialog:e,owner:this})},_resizeHandler:function(event,ui){var u=ui.originalElement,heightDifference,e=$("#"+this.grid.container().attr("id")+"_dialog"),rCont=e.find(">.ui-dialog-content"),hCont=e.find(">.ui-dialog-titlebar"),bCont=e.find(">.ui-dialog-buttonpane"),pad=rCont.outerHeight()-rCont.height();heightDifference=hCont.outerHeight(true)+bCont.outerHeight(true)+pad;this._setFilterDialogContentHeight(u.height()-heightDifference)},_setFilterDialogContentHeight:function(height){this._resizeCont.css({height:height+"px"})},_changeFilterCondition:function(e){var editor,condition,$target=$(e.target),$row=$target.closest("[data-af-row]");if(!$row.length){$row=$target.closest("tr")}condition=e.target.value;editor=this._getDialogExprSelByRow($row);this._setFilterDialogInput(editor,condition)
},_setFilterDialogInput:function(editor,condition){var requiresEntry,editorObject;requiresEntry=this._requiresEntry(condition);if(!requiresEntry){editor.igGridFilterEditor("option","disabled",true);editorObject=editor.data(editor.data("editorType"));this._editorValueForCondition(condition,editorObject)}else{editor.igGridFilterEditor("option","disabled",false)}},_getDialogColSelByRow:function($frow){var $elem=$frow.find("[data-af-col]");if(!$elem.length){$elem=$frow.find("td:first").find("input")}return $elem},_getDialogCondSelByRow:function($frow){var $elem=$frow.find("[data-af-cond]");if(!$elem.length){$elem=$frow.find("td:nth-child(2)").find("select")}return $elem},_getDialogExprSelByRow:function($frow){var $elem=$frow.find("[data-af-expr]");if(!$elem.length){$elem=$frow.find("td:nth-child(3)").find("input")}return $elem},_getDialogRmvBtnByRow:function($frow){var $elem=$frow.find("[data-af-rmv]");if(!$elem.length){$elem=$frow.find("td:last").find("span")}return $elem},_addFilterFromDialog:function(e,expression){var tableBody=$("#"+this.grid.container().attr("id")+"_dialog table tbody"),j,cs=this.options.columnSettings,rows,filterObj={},filterRow,colKeys,i,noCancel=true,field,type,cnd,allowed,defaultValue,condition,col,conds;noCancel=this._trigger(this.events.filterDialogFilterAdding,null,{filtersTableBody:tableBody,owner:this});if(noCancel){rows=$("#"+this.grid.container().attr("id")+"_dialog").find("[data-af-row]");if(!rows.length){rows=tableBody.children()}if(rows.length>=this.options.filterDialogMaxFilterCount){$("#"+this.grid.container().attr("id")+"_dialog_error").show();return}if(this.options.filterDialogFilterTemplate&&typeof this.options.filterDialogFilterTemplate==="string"){filterRow=$(this._fTmplWrappers[this.grid.id()+"_filterDialogFilterTemplate"](filterObj))}else{filterRow=$("<tr data-af-row><td><input data-af-col/></td><td><select data-af-cond title='"+$.ig.GridFiltering.locale.filterDialogConditionDropDownLabel+"'></select></td><td><input data-af-expr /> </td><td><span data-af-rmv></span></td></tr>")}filterRow.appendTo(tableBody);colKeys=[];for(i=0;i<this.grid.options.columns.length;i++){allowed=true;for(j=0;j<cs.length;j++){if((this.grid.options.columns[i].key===cs[j].columnKey||i===cs[j].columnIndex)&&cs[j].allowFiltering===false){allowed=false;break}}if(allowed){colKeys.push(this.grid.options.columns[i].headerText)}}if(expression===undefined){col=this.grid.columnByKey(this._dialogCurrentColumn);field=col.headerText;type=this._dialogCurrentType}else{col=this.grid.columnByKey(expression.fieldName);if(col!==null){field=col.headerText;type=col.dataType}condition=this._resolveConditionNameFromExpression(expression);defaultValue=expression.expr;if(type==="date"&&$.type(defaultValue)==="number"&&this.grid.options.enableUTCDates){defaultValue=new Date(defaultValue)}}cnd=this._getDialogCondSelByRow(filterRow);this._getDialogColSelByRow(filterRow).css("width",80).igTextEditor({listItems:colKeys,button:"dropdown",isLimitedToListValues:true,allowNullValue:false,buttonType:"dropdown",width:this.options.filterDialogColumnDropDownDefaultWidth||120,valueChanged:$.proxy(this._polulateFilterConditionDropDown,this),dropDownAttachedToBody:true,value:field});conds=this._populateConditionsList(col.key,type);this._renderAdvancedConditionsDropDown(cnd,conds);if(condition!==undefined&&cnd.length>0){cnd[0].value=condition}cnd.bind("change",$.proxy(this._changeFilterCondition,this));this._getDialogCondSelByRow(filterRow).css("width",this.options.filterDialogFilterDropDownDefaultWidth);this._populateFilterDialogInput(this._getDialogExprSelByRow(filterRow),type,defaultValue,col,condition);this._getDialogRmvBtnByRow(filterRow).addClass(this.css.filterDialogFilterRemoveButton).bind({mousedown:$.proxy(this._removeFilterFromDialog,this)});this._trigger(this.events.filterDialogFilterAdded,null,{filter:filterRow,owner:this})}},_filterDialogClearAll:function(e){var tableBody=$("#"+this.grid.container().attr("id")+"_dialog table tbody");tableBody.empty();$("#"+this.grid.container().attr("id")+"_dialog_error").hide();if(e){e.preventDefault()}},_polulateFilterConditionDropDown:function(e,args){var selectedColKey=args.newValue,conditionListElem,cols=this.grid.options.columns,type,input,i,col,conds,$tr,$target=$(e.target);$tr=$target.closest("[data-af-row]");if(!$tr.length){$tr=$target.closest("tr")}conditionListElem=this._getDialogCondSelByRow($tr);input=this._getDialogExprSelByRow($tr);if($(e.target).data("value")!==undefined){col=this.grid.columnByKey($(e.target).data("value"));if(col){type=col.dataType}}else{for(i=0;i<cols.length;i++){if(cols[i].headerText===selectedColKey){type=cols[i].dataType;col=cols[i];break}}}if(type===undefined){return}conds=this._populateConditionsList(col.key,type);this._renderAdvancedConditionsDropDown(conditionListElem,conds);this._populateFilterDialogInput(input,type,undefined,col,conds[0].condition)},_populateFilterDialogInput:function(input,type,defaultValue,col,condition){var edtrT=this._getEditorNameByColType(type),options={suppressNotifications:true,buttonHidden:type!=="date",button:"dropdown",disabled:type==="bool",maxDecimals:12,textAlign:type==="number"?"right":"left",width:this.options.filterDialogExprInputDefaultWidth,value:defaultValue,enableUTCDates:this.grid.options.enableUTCDates};if(type==="date"&&col&&col.format){options.dateInputFormat=col.format}if(!input.is("input")){input=input.find("INPUT").eq(0)}if(input.data("editorType")){input.igGridFilterEditor("destroy")}input.data("editorType",edtrT);input.igGridFilterEditor(options);if(condition){this._setFilterDialogInput(input,condition)}},_populateConditionsList:function(selectedColKey,type){var conditions=[],i,j,labels=this.options.labels,cs=this.options.columnSettings,css=this.css,validConditions=[],matchingCondition,custConds,curCond,newCond,key;if(type==="number"){validConditions.push({condition:"equals",text:labels.equals,imgClass:css.filterItemIconEquals});validConditions.push({condition:"doesNotEqual",text:labels.doesNotEqual,imgClass:css.filterItemIconDoesNotEqual});validConditions.push({condition:"greaterThan",text:labels.greaterThan,imgClass:css.filterItemIconGreaterThan});validConditions.push({condition:"lessThan",text:labels.lessThan,imgClass:css.filterItemIconLessThan});validConditions.push({condition:"greaterThanOrEqualTo",text:labels.greaterThanOrEqualTo,imgClass:css.filterItemIconGreaterThanOrEqualTo});validConditions.push({condition:"lessThanOrEqualTo",text:labels.lessThanOrEqualTo,imgClass:css.filterItemIconLessThanOrEqualTo})}else if(type==="bool"||type==="boolean"){validConditions.push({condition:"true",text:labels.trueLabel,imgClass:css.filterItemIconTrue});validConditions.push({condition:"false",text:labels.falseLabel,imgClass:css.filterItemIconFalse})}else if(type==="date"){validConditions.push({condition:"on",text:labels.on,imgClass:css.filterItemIconOn});validConditions.push({condition:"notOn",text:labels.notOn,imgClass:css.filterItemIconNotOn});validConditions.push({condition:"after",text:labels.after,imgClass:css.filterItemIconAfter});validConditions.push({condition:"before",text:labels.before,imgClass:css.filterItemIconBefore});validConditions.push({condition:"today",text:labels.today,imgClass:css.filterItemIconToday});validConditions.push({condition:"yesterday",text:labels.yesterday,imgClass:css.filterItemIconYesterday});validConditions.push({condition:"thisMonth",text:labels.thisMonth,imgClass:css.filterItemIconThisMonth});validConditions.push({condition:"lastMonth",text:labels.lastMonth,imgClass:css.filterItemIconLastMonth});validConditions.push({condition:"nextMonth",text:labels.nextMonth,imgClass:css.filterItemIconNextMonth});validConditions.push({condition:"thisYear",text:labels.thisYear,imgClass:css.filterItemIconThisYear});validConditions.push({condition:"lastYear",text:labels.lastYear,imgClass:css.filterItemIconLastYear});validConditions.push({condition:"nextYear",text:labels.nextYear,imgClass:css.filterItemIconNextYear})}else{validConditions.push({condition:"startsWith",text:labels.startsWith,imgClass:css.filterItemIconStartsWith});validConditions.push({condition:"endsWith",text:labels.endsWith,imgClass:css.filterItemIconEndsWith});validConditions.push({condition:"contains",text:labels.contains,imgClass:css.filterItemIconContains});validConditions.push({condition:"doesNotContain",text:labels.doesNotContain,imgClass:css.filterItemIconDoesNotContain});validConditions.push({condition:"equals",text:labels.equals,imgClass:css.filterItemIconEquals});validConditions.push({condition:"doesNotEqual",text:labels.doesNotEqual,imgClass:css.filterItemIconDoesNotEqual})}if(this.options.showEmptyConditions){validConditions.push({condition:"empty",text:labels.empty,imgClass:css.filterItemIcon});validConditions.push({condition:"notEmpty",text:labels.notEmpty,imgClass:css.filterItemIcon})}if(this.options.showNullConditions){validConditions.push({condition:"null",text:labels.nullLabel,imgClass:css.filterItemIcon});validConditions.push({condition:"notNull",text:labels.notNull,imgClass:css.filterItemIcon})}for(i=0;i<cs.length;++i){if(cs[i].columnKey===selectedColKey){cs=cs[i];break}}custConds=cs.customConditions;for(key in custConds){if(custConds.hasOwnProperty(key)){curCond=custConds[key];newCond={condition:cs.columnKey+"_"+key,text:curCond.labelText,imgClass:curCond.filterImgIcon};validConditions.push(newCond)}}if(cs.conditionList){if(cs.conditionList.length===0){throw new Error($.ig.GridFiltering.locale.conditionListLengthCannotBeZero)}for(i=0;i<cs.conditionList.length;++i){matchingCondition=null;for(j=0;j<validConditions.length;++j){if(validConditions[j].condition===cs.conditionList[i]){matchingCondition=validConditions[j];break}}if(!matchingCondition){throw new Error($.ig.util.stringFormat($.ig.GridFiltering.locale.conditionNotValidForColumnType,cs.conditionList[i],type))}conditions.push(matchingCondition)}}else{for(i=0;i<validConditions.length;++i){conditions.push(validConditions[i])}}return conditions},_renderAdvancedConditionsDropDown:function(conditionListElem,conditions){var i,condList="";conditionListElem.empty();if(this.options.filterDialogFilterConditionTemplate&&typeof this.options.filterDialogFilterConditionTemplate==="string"){condList=$(this._fTmplWrappers[this.grid.id()+"_filterDialogFilterConditionTemplate"](conditions))}else{for(i=0;i<conditions.length;i++){condList+="<option value='"+conditions[i].condition+"'>"+conditions[i].text+"</option>"}condList=$(condList)}condList.appendTo(conditionListElem);if($.ig.util.isIE){conditionListElem.parent().append(conditionListElem);conditionListElem.width(conditionListElem.width())}},_removeFilterFromDialog:function(e){var filterR,$target=$(e.target),$tr=$target.closest("[data-af-row]");if(!$tr.length){$target.closest("tr").remove();filterR=$("#"+this.grid.container().attr("id")+"_dialog").find("tr")}else{$tr.remove();filterR=$("#"+this.grid.container().attr("id")+"_dialog").find("[data-af-row]")}if(filterR.length<this.options.filterDialogMaxFilterCount){$("#"+this.grid.container().attr("id")+"_dialog_error").hide()}},_renderDropDownToList:function(obj,list,ul){var i,cond;for(i=0;i<list.length;i++){cond=$("<li class='"+obj.itemClass+"'><span class='"+obj.imgContainerClass+"'>"+"<span class='"+this.css.filterItemIcon+" "+list[i].imgClass+"'></span></span>"+"<span class='"+obj.textClass+"'> "+list[i].text+"</span></li>");cond.appendTo(ul).data("cond",list[i].condition)}},_renderDropDownElement:function(id,colName){var ul,container;ul=$("<ul></ul>").appendTo(this.grid._rootContainer()).addClass(this.css.filterDropDownList);container=$("<div></div>").appendTo(this.grid._rootContainer()).attr("id",id).addClass(this.css.filterDropDown).css("overflow","hidden").css("position","absolute").hide();if(!$.ig.util.isIE){container.css("overflow-y","auto")}container.remove();if(this.options.filterDropDownWidth>0){ul.css("width",this.options.filterDropDownWidth)}if(this.options.filterDropDownHeight>0){container.css("height",this.options.filterDropDownHeight)}ul.data("colName",colName);ul.wrap(container);ul.parent().data("efh","1");$("#"+id).delegate("li",{mousedown:$.proxy(this._selectDropDownItem,this),mouseover:$.proxy(this._hoverDropDownItem,this),mouseout:$.proxy(this._unhoverDropDownItem,this)});return ul},_hoverButton:function(event){var $target=$(event.currentTarget).find("span");if(this.options.mode==="advanced"){$target.addClass(this.css.filterButtonAdvancedHover)}else{$target.addClass(this.css.filterButtonHover)}},_unhoverButton:function(event){var $target=$(event.currentTarget).find("span");if(this.options.mode==="advanced"){$target.removeClass(this.css.filterButtonAdvancedHover)}else{$target.removeClass(this.css.filterButtonHover)}},_activateButton:function(event){var $target=$(event.currentTarget).find("span");if(this._dontApplyStyles){this._dontApplyStyles=false;return}if(this.options.mode==="advanced"){$target.addClass(this.css.filterButtonAdvancedActive)}else{$target.addClass(this.css.filterButtonActive)}},_deactivateButton:function(event){var target=$(event.target).find("span");target.removeClass(this.css.filterButtonAdvancedActive);target.removeClass(this.css.filterButtonActive)},_toggleDropDown:function(event,close,dontFocus){var $target=$(event.currentTarget),id=$target.attr("id"),dd,left,top,noCancel=true,button=$target.find("span"),rOffset,maxZ,block=$("#"+this.grid.container().attr("id")+"_block"),dialog=$("#"+this.grid.container().attr("id")+"_dialog");if(this._animating&&id===this._animatingId){return}maxZ=$.ig.getMaxZIndex(this.grid.container().attr("id")+"_dialog");block.css("zIndex",maxZ+1);dialog.css("zIndex",maxZ+2);dd=$("#"+id.substring(0,id.lastIndexOf("_button")));dd.css("zIndex",maxZ+3);if(!(!dd.is(":visible")&&close===true)){this._animating=true;this._animatingId=id}if(this._openingAnimation!==true){this._dontFocus=dontFocus}else{this._dontFocus=null}this._isClosing=false;if(dd.is(":visible")){noCancel=this._trigger(this.events.dropDownClosing,null,{dropDown:dd,owner:this});this._isClosing=true}else{if(!close){noCancel=this._trigger(this.events.dropDownOpening,null,{dropDown:dd,owner:this})}}if(noCancel){left=$.ig.util.offset(button).left;top=$.ig.util.offset(button).top+button.outerHeight();if(dd.offset().left!==left&&dd.offset().top!==top){rOffset=$.ig.util.getRelativeOffset(dd);left-=rOffset.left;top-=rOffset.top;dd.css("left",left).css("top",top)}this._currentTarget=$target;this._dd=dd;if(!this._isClosing){this._opendd=dd}if($.ig.util.isIE){dd.css("overflow-x","hidden");dd.css("overflow-y","hidden")}if(close!==undefined&&close===true){if(dd.is(":visible")){if(this.options.filterDropDownAnimations!=="none"){dd.hide(this.options.filterDropDownAnimationDuration,$.proxy(this._animationEnd,this))}else{dd.hide();this._trigger(this.events.dropDownClosed,null,{dropDown:dd,owner:this})}}}else{if(this.options.filterDropDownAnimations!=="none"){if(dd.is(":visible")){this._closingTarget=this._currentTarget}else{this._openingTarget=this._currentTarget;this._openingAnimation=true}dd.toggle(this.options.filterDropDownAnimationDuration,$.proxy(this._animationEnd,this))}else{dd.toggle();if(this._isClosing){this._trigger(this.events.dropDownClosed,null,{dropDown:dd,owner:this})}else{this._trigger(this.events.dropDownOpened,null,{dropDown:dd,owner:this})}if(dontFocus!==true){this._dontApplyStyles=true;$target.focus()}}}}if($.type(event.stopPropagation)==="function"){event.stopPropagation()}},_animationEnd:function(){if(this.options===null){return}if(this._isClosing===true){this._trigger(this.events.dropDownClosed,null,{dropDown:this._dd,owner:this})}else{this._trigger(this.events.dropDownOpened,null,{dropDown:this._opendd,owner:this});this._openingAnimation=false}if(this._dd&&$.ig.util.isIE){this._dd.css("overflow-y","auto")}this._isClosing=null;if(this._dontFocus!==true){this._dontApplyStyles=true;this._openingTarget.focus()}this._animating=false},_toggleDropDownKeyboard:function(event){var parent,selectedItem,$target=$(event.target),ddVisible;if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){event.stopPropagation();event.preventDefault();parent=$("#"+$target.attr("id").substring(0,$target.attr("id").lastIndexOf("_button"))).find("ul");if(parent.data("selectedItem")||parent.data("selectedItem")===0){selectedItem=parent.find("li:nth-child("+(parent.data("selectedItem")+1)+")");ddVisible=$("#"+$target.attr("id").substring(0,$target.attr("id").lastIndexOf("_button"))).is(":visible");if($(selectedItem).hasClass("ui-iggrid-filterddlistitemadvanced")&&ddVisible){this._openFilterDialog(event)}}if(selectedItem&&ddVisible){event.currentTarget=selectedItem;this._selectDropDownItem(event)}else{this._toggleDropDown(event)}}else if(event.keyCode===$.ui.keyCode.DOWN){event.stopPropagation();event.preventDefault();this._selectDropDownItem(event,"next")}else if(event.keyCode===$.ui.keyCode.UP){event.stopPropagation();event.preventDefault();this._selectDropDownItem(event,"prev")}},_closeDropDown:function(event){var $target=$(event.currentTarget).find("span"),$targetButton=$(event.currentTarget),dd;if(this._openingTarget&&event.target.id===this._openingTarget.attr("id")&&this._openingAnimation===true){return}dd=$("#"+$targetButton.attr("id").substring(0,$targetButton.attr("id").lastIndexOf("_button")));if(dd&&!dd.is(":visible")){$target.removeClass(this.css.filterButtonActive);return}this._toggleDropDown(event,true,true);if(this._dontApplyStyles){this._dontApplyStyles=false;return}if(this.options.mode==="advanced"){$target.removeClass(this.css.filterButtonAdvancedActive)}else{$target.removeClass(this.css.filterButtonActive)}},_selectDropDownItem:function(event,nav,expr){var $target=$(event.currentTarget),filterCondition,colIndex,sel,parent,requiresEntry,button,currentCond,targetParent,evtArgs;if($target.find("input").length>0&&this.options.mode==="advanced"){return}if(nav==="next"||nav==="prev"){parent=$("#"+$target.attr("id").substring(0,$target.attr("id").lastIndexOf("_button"))).find("ul")}if(nav==="next"){if(parent.data("selectedItem")===undefined){$target=parent.find("li:first")}else{$target=parent.find("li:nth-child("+(parent.data("selectedItem")+1)+")");if($target.next().length===0){$target=parent.find("li:first")}else{$target=$target.next()}}}if(nav==="prev"){if(parent.data("selectedItem")===undefined){$target=parent.find("li:last")}else{$target=parent.find("li:nth-child("+(parent.data("selectedItem")+1)+")");if($target.prev().length===0){$target=parent.find("li:last")}else{$target=$target.prev()}}}filterCondition=$target.data("cond");button=$("#"+$target.closest("div").attr("id")+"_button");button.attr("title",this.options.tooltipTemplate.replace("${condition}",this.options.labels.noFilter));if($target.data("cond")===undefined){button.attr("title",this.options.tooltipTemplate.replace("${condition}",this.options.labels.noFilter))}colIndex=$("#"+$target.closest("div").attr("id")+"_button").find("span").data("colIndex");if(!colIndex&&expr){$.each(this.options.columnSettings,function(index,col){if(col.columnKey===expr.fieldName){colIndex=index;return false}})}currentCond=this.options.columnSettings[parseInt(colIndex,10)].condition;targetParent=$target.parent();sel=targetParent.data("selectedItem");requiresEntry=this._requiresEntry(filterCondition);if(filterCondition!==undefined){this.options.columnSettings[parseInt(colIndex,10)].condition=filterCondition;if(sel!==undefined){targetParent.find("li:nth-child("+(sel+1)+")").removeClass(this.css.filterDropDownListItemActive)}$target.addClass(this.css.filterDropDownListItemActive);targetParent.data("selectedItem",$("li",targetParent).index($target));this._editors[colIndex].element.igGridFilterEditor("option","placeHolder",this.options.nullTexts[filterCondition])}else if(currentCond==="empty"||currentCond==="notEmpty"||currentCond==="null"||currentCond==="notNull"||!this._requiresEntry(currentCond)){this.options.columnSettings[parseInt(colIndex,10)].condition=this._getDefaultCondition(this.grid.options.columns[colIndex].dataType);if(sel!==undefined){targetParent.find("li:nth-child("+(sel+1)+")").removeClass(this.css.filterDropDownListItemActive);targetParent.data("selectedItem",null);if(this.grid.options.columns[colIndex].dataType!=="bool"){this._editors[colIndex].element.igGridFilterEditor("option","placeHolder",this._getDefaultCondition(this.grid.options.columns[colIndex].dataType))}else{this._editors[colIndex].element.igGridFilterEditor("option","placeHolder",this.options.nullTexts[this._getDefaultCondition(this.grid.options.columns[colIndex].dataType)])}}if(currentCond==="null"||this.grid.options.columns[colIndex].dataType==="date"){this._editors[colIndex].element.igGridFilterEditor("option","placeHolder",this.options.nullTexts[this._getDefaultCondition(this.grid.options.columns[colIndex].dataType)])}}else{if(sel!==undefined){targetParent.find("li:nth-child("+(sel+1)+")").removeClass(this.css.filterDropDownListItemActive)}$target.addClass(this.css.filterDropDownListItemActive);targetParent.data("selectedItem",$("li",targetParent).index($target))}if(nav===undefined||event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){if($target.hasClass("ui-iggrid-filterddlistitemclear")||this.options.filterDropDownItemIcons===true&&$target.find(".ui-iggrid-filtericonclear").length>0){if(!requiresEntry||filterCondition===undefined){this._editors[colIndex].element.igGridFilterEditor("option","disabled",this.grid.options.columns[colIndex].dataType==="bool")}this._editors[colIndex].value(null);this._filterDataSourceClear(this.grid.options.columns[colIndex].key,colIndex);this._toggleDropDown({currentTarget:button},true)}else{if(!requiresEntry&&!expr){this._editors[colIndex].element.igGridFilterEditor("option","disabled",true);this._editors[colIndex].editorContainer().removeClass("ui-state-disabled");this._editorValueForCondition(filterCondition,this._editors[colIndex]);this._args=undefined;this._filterInternal(colIndex,this.grid.options.columns[colIndex].key)}else if(this._editors[colIndex].value()!==""&&this._editors[colIndex].value()!==null){this._editors[colIndex].setFocus(true);evtArgs={owner:this._editors[colIndex],text:this._editors[colIndex].displayValue()};this._filter(event,evtArgs)}if(requiresEntry){this._editors[colIndex].element.igGridFilterEditor("option","disabled",false);if(nav===undefined&&filterCondition!==undefined){this._editors[colIndex].setFocus()}}}}},_requiresEntry:function(filterCondition){var custConds=this._dsTransformedCustomConditions;if(filterCondition==="true"||filterCondition==="false"||filterCondition==="today"||filterCondition==="yesterday"||filterCondition==="thisMonth"||filterCondition==="nextMonth"||filterCondition==="lastMonth"||filterCondition==="thisYear"||filterCondition==="lastYear"||filterCondition==="empty"||filterCondition==="notEmpty"||filterCondition==="null"||filterCondition==="notNull"||filterCondition==="nextYear"){return false}if(custConds&&custConds[filterCondition]){return custConds[filterCondition].requireExpr}if(filterCondition===undefined||filterCondition===null){return false}return true},_editorValueForCondition:function(filterCondition,editor){var date=new Date,custConds=this._dsTransformedCustomConditions;if(filterCondition==="true"){editor.value(true)}else if(filterCondition==="false"){editor.value(false)}else if(filterCondition==="today"){editor.value(new Date)}else if(filterCondition==="yesterday"){if(this.grid.options.enableUTCDates){editor.value(new Date(Date.UTC(date.getFullYear(),date.getMonth(),date.getDate()-1,0,0,0,0)))}else{editor.value(new Date(date.getFullYear(),date.getMonth(),date.getDate()-1,0,0,0,0))}}else if(custConds&&custConds[filterCondition]){editor.value(custConds[filterCondition].expressionText)}else{editor.value(null)}},_assignTemplates:function(){var self=this,opts=self.options,gId=this.grid.id();this._fTmplWrappers={};this._fTmplWrappers[gId+"_filterDialogFilterTemplate"]=function(d){return $.ig.tmpl(opts.filterDialogFilterTemplate,d)};this._fTmplWrappers[gId+"_filterDialogAddConditionTemplate"]=function(d){return $.ig.tmpl(opts.filterDialogAddConditionTemplate,d)};this._fTmplWrappers[gId+"_filterDialogAddConditionDropDownTemplate"]=function(d){return $.ig.tmpl(opts.filterDialogAddConditionDropDownTemplate,d)};this._fTmplWrappers[gId+"_filterDialogFilterConditionTemplate"]=function(d){return $.ig.tmpl(opts.filterDialogFilterConditionTemplate,d)};if(String(this.grid.options.templatingEngine).toLowerCase()==="jsrender"){this._jsr=true;$.templates(gId+"_filterDialogFilterTemplate",opts.filterDialogFilterTemplate);$.templates(gId+"_filterDialogAddConditionTemplate",opts.filterDialogAddConditionTemplate);$.templates(gId+"_filterDialogAddConditionDropDownTemplate",opts.filterDialogAddConditionDropDownTemplate);$.templates(gId+"_filterDialogFilterConditionTemplate",opts.filterDialogFilterConditionTemplate);this._fTmplWrappers=$.render}},_hoverDropDownItem:function(event){if($(event.currentTarget).find("input").length===0){$(event.currentTarget).addClass(this.css.filterDropDownListItemHover)}},_unhoverDropDownItem:function(event){$(event.currentTarget).removeClass(this.css.filterDropDownListItemHover)},_virtualHorizontalScroll:function(event,args){var start=args.startColIndex,i,headers=this.grid.headersTable().find("th"),columnKey;if(this._currentTarget){this._toggleDropDown({currentTarget:this._currentTarget},true)}if(this.options.mode==="advanced"&&this.options.advancedModeEditorsVisible!==true){for(i=0;i<this.grid._virtualColumnCount;i++){columnKey=this.grid.options.columns[i+start].key;$(headers[i]).data("colName",columnKey);if(this._fcData[columnKey]===true){continue}$(headers[i]).find("a").attr("id",this.grid.element[0].id+"_dd_"+columnKey+"_button")}this._updateTooltips(this._currentAdvancedExpressions||[])}else{throw new Error($.ig.GridFiltering.locale.virtualizationSimpleFilteringNotAllowed)}},_headerInit:function(owner,args){var filterrow;if(this.options.mode!=="simple"&&this.options.advancedModeEditorsVisible!==true||this.grid.element.attr("id")!==args.owner.element.attr("id")){return}filterrow=this.grid.headersTable().children("thead").find("[data-role=filterrow]");filterrow.find("[data-skip=true]").remove();this.grid._headerInit(filterrow,null,true)},_injectGrid:function(gridInstance){var topmostGrid=null;this.grid=gridInstance;if(this.options.type===null){this.options.type=this.grid._inferOpType()}if(this.options.persist&&this.options.type==="remote"){topmostGrid=this.element.closest(".ui-iggrid-root").data("igGrid");if(topmostGrid&&topmostGrid.element.attr("id")!==this.grid.element[0].id&&topmostGrid.options.initialDataBindDepth===-1){this.options.persist=false}}if(this.options.type){this.grid.dataSource.settings.filtering.type=this.options.type}else{this.grid.dataSource.settings.filtering.type="remote"}if(this.options.filterExprUrlKey){this.grid.dataSource.settings.filtering.filterExprUrlKey=this.options.filterExprUrlKey}this.grid.dataSource.settings.filtering.caseSensitive=this.options.caseSensitive;if(this._headerCellRenderedHandler!==null&&this._headerCellRenderedHandler!==undefined){this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler)}this._headerCellRenderedHandler=$.proxy(this._headerCellRendered,this);this.grid.element.bind("iggridheadercellrendered",this._headerCellRenderedHandler);if(this._headerRenderedHandler!==null&&this._headerRenderedHandler!==undefined){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler)}this._headerRenderedHandler=$.proxy(this._headerRendered,this);this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);if(this._columnResizedHandler!==null&&this._columnResizedHandler!==undefined){this.grid.element.unbind("iggridresizingcolumnresized",this._columnResizedHandler)}this._columnResizedHandler=$.proxy(this._columnResized,this);this.grid.element.bind("iggridresizingcolumnresized",this._columnResizedHandler);if(this._columnsAlteredHandler!==null&&this._columnsAlteredHandler!==undefined){this.grid.element.unbind("iggrid_columnsmoved",this._columnsAlteredHandler)}this._columnsAlteredHandler=$.proxy(this._columnsAltered,this);this.grid.element.bind("iggrid_columnsmoved",this._columnsAlteredHandler);this._transformCustomConditionsForDataSource();this._initDefaultSettings();if(this._onUIDirtyHandler!==null&&this._onUIDirtyHandler!==undefined){this.grid.element.unbind("iggriduidirty",this._onUIDirtyHandler)}this._onUIDirtyHandler=$.proxy(this._onUIDirty,this);this.grid.element.bind("iggriduidirty",this._onUIDirtyHandler);if(this._virtualHorizontalScrollHandler!==null&&this._virtualHorizontalScrollHandler!==undefined){this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler)}this._virtualHorizontalScrollHandler=$.proxy(this._virtualHorizontalScroll,this);this.grid.element.bind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler);if((this.grid.options.virtualization===true&&this.grid.options.width!==null||this.grid.options.columnVirtualization===true)&&this.options.mode===null){this.options.mode="advanced"}else if((this.grid.options.virtualization===false||this.grid.options.virtualization===true&&!this.grid._isColumnVirtualizationEnabled())&&(this.options.mode===null||this.options.mode==="simple")){this.options.mode="simple"}else if(this.options.mode==="simple"&&(this.grid.options.virtualization===true||this.grid.options.columnVirtualization===true)){throw new Error($.ig.GridFiltering.locale.virtualizationSimpleFilteringNotAllowed)}if(this._headerInitHandler!==null&&this._headerInitHandler!==undefined){this.grid.element.unbind("iggridheaderextracellsmodified",this._headerInitHandler)}this._headerInitHandler=$.proxy(this._headerInit,this);this.grid.element.bind("iggridheaderextracellsmodified",this._headerInitHandler);if(this.grid.element.igGridFeatureChooser!==undefined){this.grid.element.igGridFeatureChooser()}else{throw new Error($.ig.GridFiltering.locale.featureChooserNotReferenced)}this._assignTemplates();if(this.options.persist){this._preserveFiltering()}}});$.extend($.ui.igGridFiltering,{version:"15.2.20152.1027"});$.fn.extend({igGridFilterEditor:function(){var edtrT=this.data("editorType"),func=this[edtrT];if($.type(func)!=="function"){return}return func.apply(this,arguments)}})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Outlook GroupBy feature 15.2.20152.1027
*
* Copyright (c) 2011-2015 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
*	jquery-1.4.4.js
*	jquery.ui.core.js
*	jquery.ui.widget.js
*	jquery.ui.mouse.js
*	jquery.ui.draggable.js
*	jquery.ui.droppable.js
*	modernizr.js (Optional)
*	infragistics.ui.grid.framework.js
*	infragistics.ui.grid.shared.js
*	infragistics.ui.grid.featurechooser.js
*/
(function($){$.widget("ui.igGridGroupBy",{css:{dragMarkup:"ui-iggrid-dragMarkup",groupByArea:"ui-iggrid-groupbyarea",groupByAreaText:"ui-iggrid-groupbyareatext",groupedRow:"ui-iggrid-groupedrow",expandHeaderCellGroupBy:"ui-iggrid-header ui-widget-header",groupByExpandCellExpanded:"ui-icon ui-iggrid-expandbutton ui-iggrid-expandbuttonexpanded ui-icon-minus",groupByExpandCellCollapsed:"ui-icon ui-iggrid-expandbutton ui-icon-plus",groupByAreaDropHover:"ui-iggrid-groupbyareahover",groupByExpandColumn:"ui-iggrid-expandcolumn",nonGroupRowEmptyCell:"ui-iggrid-nongrouprowemptycell",groupedColumnLabel:"ui-iggrid-groupedcolumnlabel ui-state-default",groupedColumnLabelText:"ui-iggrid-groupedcolumnlabeltext",groupByRemoveButton:"ui-icon ui-icon-circle-close ui-iggrid-groupbyremovebutton",groupedColumnLabelRightEdgeEnd:"ui-iggrid-groupbylabelrightedgeend",groupedColumnLabelRightEdge:"ui-iggrid-groupbylabelrightedge",groupedColumnLayoutLabel:"ui-iggrid-groupbylayoutlabel",headerExtraCell:"ui-iggrid-expandheadercellgb",footerExtraCell:"ui-widget-content ui-iggrid-footerextracell",featureChooserIconClass:"ui-icon ui-iggrid-icon-groupby",dialogGroupedColumns:"ui-iggrid-groupby-dialog-groupedcolumns",dialogUnroupedColumns:"ui-iggrid-groupby-dialog-ungroupedcolumns",dialogGroupedItem:"ui-widget-content",dialogUngroupedItem:"ui-widget-content",dialogUngroupedColumnsGroupByButton:"ui-iggrid-dialog-groupby-button",dialogUngroupedColumnsText:"ui-iggrid-dialog-text",dialogButtonAsc:"ui-button ui-corner-all ui-button-icon-only ig-sorting-indicator",dialogButtonAscIcon:"ui-button-icon-primary ui-icon ui-icon-arrowthick-1-n",dialogButtonDesc:"ui-button ui-corner-all ui-button-icon-only ig-sorting-indicator",dialogButtonDescIcon:"ui-button-icon-primary ui-icon ui-icon-arrowthick-1-s",dialogButtonUngroup:"ui-iggrid-dialog-groupedbuttons ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only ui-igbutton ui-widget-content ui-igbutton-remove",dialogButtonUngroupContainer:"ui-button-icon-primary ui-icon ui-icon-circle-close",dialogGroupedColumnTextContainer:"ui-iggrid-dialog-text",dialogListGroupedColumns:"ui-iggrid-dialog-list-groupedcolumns",dialogListUngroupedColumns:"ui-iggrid-dialog-list-ungroupedcolumns",dialogLayoutsDDButton:"ui-icon ui-icon-triangle-1-s ui-iggrid-dialog-layouts-dd-button",dropDownLayoutsContainer:"ui-iggrid-featurechooser-dropdown-dialog ui-widget ui-widget-content ui-corner-all",dialogLayoutsDDField:"ui-iggrid-dialog-layouts-dd-field",dialogLayoutsDD:"ui-iggrid-dialog-layouts-dd ui-widget-content ui-corner-all ig-combo-icon-container",modalDialogTreeContainer:"ui-iggrid-groupby-dialog-tree",modalDialogLayoutsContainer:"ui-iggrid-groupby-dialog-layoutscontainer",dialogButtonsHover:"ui-state-hover",groupByLastEmptyCell:"ui-iggrid-last-emptycell"},renderInFeatureChooser:false,options:{groupByAreaVisibility:"top",initialExpand:true,emptyGroupByAreaContent:$.ig.GridGroupBy.locale.emptyGroupByAreaContent,emptyGroupByAreaContentSelectColumns:$.ig.GridGroupBy.locale.emptyGroupByAreaContentSelectColumns,expansionIndicatorVisibility:true,groupByLabelWidth:null,labelDragHelperOpacity:.5,indentation:30,defaultSortingDirection:"asc",groupedColumns:[{key:null,dir:"asc",layout:null,col:null}],resultResponseKey:null,groupedRowTextTemplate:"${key}: ${val} (${count})",type:null,groupByUrlKey:null,groupByUrlKeyAscValue:null,groupByUrlKeyDescValue:null,summarySettings:{multiSummaryDelimiter:",",summaryFormat:"#.00"},columnSettings:[{allowGrouping:true,isGroupBy:false,groupComparerFunction:null,groupLabelFormatter:null,dir:"asc",summaries:[{summaryFunction:"avg",text:null,customSummary:null}]}],expandTooltip:$.ig.GridGroupBy.locale.expandTooltip,collapseTooltip:$.ig.GridGroupBy.locale.collapseTooltip,removeButtonTooltip:$.ig.GridGroupBy.locale.removeButtonTooltip,featureChooserText:$.ig.GridGroupBy.locale.featureChooserText,featureChooserTextHide:$.ig.GridGroupBy.locale.featureChooserTextHide,modalDialogGroupByOnClick:false,modalDialogGroupByButtonText:$.ig.GridGroupBy.locale.modalDialogGroupByButtonText,modalDialogCaptionButtonDesc:$.ig.GridGroupBy.locale.modalDialogCaptionButtonDesc,modalDialogCaptionButtonAsc:$.ig.GridGroupBy.locale.modalDialogCaptionButtonAsc,modalDialogCaptionButtonUngroup:$.ig.GridGroupBy.locale.modalDialogCaptionButtonUngroup,modalDialogCaptionText:$.ig.GridGroupBy.locale.modalDialogCaptionText,modalDialogDropDownLabel:$.ig.GridGroupBy.locale.modalDialogDropDownLabel,modalDialogRootLevelHierarchicalGrid:$.ig.GridGroupBy.locale.modalDialogRootLevelHierarchicalGrid,modalDialogDropDownButtonCaption:$.ig.GridGroupBy.locale.modalDialogDropDownButtonCaption,modalDialogClearAllButtonLabel:$.ig.GridGroupBy.locale.modalDialogClearAllButtonLabel,emptyGroupByAreaContentSelectColumnsCaption:$.ig.GridGroupBy.locale.emptyGroupByAreaContentSelectColumnsCaption,modalDialogDropDownWidth:200,modalDialogDropDownAreaWidth:null,modalDialogAnimationDuration:200,modalDialogWidth:400,modalDialogHeight:"",modalDialogButtonApplyText:$.ig.GridGroupBy.locale.modalDialogButtonApplyText,modalDialogButtonCancelText:$.ig.GridGroupBy.locale.modalDialogButtonCancelText,useGridColumnFormatter:true,persist:true,groupByDialogContainment:"owner",inherit:false},events:{groupedColumnsChanging:"groupedColumnsChanging",groupedColumnsChanged:"groupedColumnsChanged",modalDialogMoving:"modalDialogMoving",modalDialogClosing:"modalDialogClosing",modalDialogClosed:"modalDialogClosed",modalDialogOpening:"modalDialogOpening",modalDialogOpened:"modalDialogOpened",modalDialogContentsRendering:"modalDialogContentsRendering",modalDialogContentsRendered:"modalDialogContentsRendered",modalDialogButtonApplyClick:"modalDialogButtonApplyClick",modalDialogButtonResetClick:"modalDialogButtonResetClick",modalDialogGroupingColumn:"modalDialogGroupingColumn",modalDialogGroupColumn:"modalDialogGroupColumn",modalDialogUngroupingColumn:"modalDialogUngroupingColumn",modalDialogUngroupColumn:"modalDialogUngroupColumn",modalDialogSortGroupedColumn:"modalDialogSortGroupedColumn"},_create:function(){this._orderedGroupedCols=[]},_createWidget:function(){this.options.columnSettings=[];this.options.groupedColumns=[];this._tempSortingExpr=[];this._tempGroupedColumns=[];this._tempOrderedGroupedCols=[];this._tempOptions={};this._currentTreeLayer=null;this._isInitFC=false;this._modalSelectedLayout=null;$.Widget.prototype._createWidget.apply(this,arguments)},_setOption:function(key,value){var modalDialog=$("#"+this.grid.id()+"_groupby_modalDialog");$.Widget.prototype._setOption.apply(this,arguments);if(key==="groupByAreaVisibility"||key==="expansionIndicatorVisibility"){throw new Error($.ig.Grid.locale.optionChangeNotSupported.replace("{optionName}",key))}switch(key){case"modalDialogGroupByOnClick":$("#"+this.grid.id()+"_groupby_modalDialog").remove();this._renderGroupByDialog();break;case"modalDialogCaptionText":modalDialog.igGridModalDialog("option","modalDialogCaptionText",value);break;case"modalDialogAnimationDuration":modalDialog.igGridModalDialog("option","animationDuration",value);break;case"modalDialogWidth":modalDialog.igGridModalDialog("option","modalDialogWidth",value);break;case"modalDialogHeight":modalDialog.igGridModalDialog("option","modalDialogHeight",value);break;case"modalDialogButtonApplyText":modalDialog.igGridModalDialog("option","buttonApplyText",value);break;case"modalDialogButtonCancelText":modalDialog.igGridModalDialog("option","buttonCancelText",value);break;default:break}},_headerRendered:function(event,args){var groupby=this,groupbyarea;if(args.owner.id()!==this.grid.id()){return}if(args.owner.element.attr("data-childgrid")){return}this._renderGroupByDialog();if(this.options.groupByAreaVisibility==="top"){groupbyarea=$("<div></div>").prependTo(this.grid.container())}else if(this.options.groupByAreaVisibility==="bottom"){groupbyarea=$("<div></div>").appendTo(args.owner.container())}else if(this.options.groupByAreaVisibility==="hidden"){return}groupbyarea.attr("id",this.grid.element.attr("id")+"_groupbyarea").addClass(this.css.groupByArea);this._setGroupAreaTextContent($("<span></span>").appendTo(groupbyarea).addClass(this.css.groupByAreaText));groupbyarea.droppable({accept:"th:not([groupby-disabled])",hoverClass:groupby.css.groupByAreaDropHover,drop:function(event,ui){var accepted,isdescendant;isdescendant=ui.draggable.closest(".ui-iggrid-root").attr("id")===groupby.grid.id()||ui.draggable.closest(".ui-iggrid").find(".ui-iggrid-root").length>0;if(!groupby.grid.element.hasClass("ui-iggrid-root")){isdescendant=true}accepted=ui.draggable.hasClass("ui-iggrid-header")&&isdescendant;if(accepted){groupby._groupBy(event,ui.draggable)}}});if(this.grid._isMultiColumnGrid){groupbyarea.droppable("option","tolerance","touch")}},_renderGroupByDialog:function(){var $buttonOK,containment,self=this,o=this.options,$captionButtonContainer,modalDialog;if(this.options.groupByDialogContainment==="owner"){containment=this.grid.container()}else{containment="window"}modalDialog=$("<div></div>").appendTo(this.grid._rootContainer()).attr("id",this.grid.id()+"_groupby_modalDialog");modalDialog.igGridModalDialog({renderFooterButtons:!o.modalDialogGroupByOnClick,modalDialogCaptionText:o.modalDialogCaptionText,modalDialogWidth:o.modalDialogWidth,modalDialogHeight:o.modalDialogHeight,animationDuration:o.modalDialogAnimationDuration,buttonApplyText:o.modalDialogButtonApplyText,buttonCancelText:o.modalDialogButtonCancelText,containment:containment,gridContainer:this.grid.container(),modalDialogOpening:function(event,args){return self._groupByDialogOpening(event,args)},modalDialogMoving:function(e,ui){self._trigger(self.events.modalDialogMoving,null,{modalDialogElement:e.target,owner:self,originalPosition:ui.originalPosition,position:ui.position})},modalDialogClosing:function(){return self._trigger(self.events.modalDialogClosing,null,{modalDialogElement:modalDialog,owner:self})},modalDialogClosed:function(){self._trigger(self.events.modalDialogClosed,null,{modalDialogElement:modalDialog,owner:self})}});if(o.modalDialogGroupByOnClick){$captionButtonContainer=modalDialog.igGridModalDialog("getCaptionButtonContainer");$("<span></span>").bind("click.hiding",function(event){modalDialog.igGridModalDialog("closeModalDialog",true);event.preventDefault();event.stopPropagation();return false}).addClass("ui-icon ui-icon-closethick").appendTo($("<a></a>").appendTo($captionButtonContainer).attr("title",$.ig.GridHiding.locale.columnChooserCloseButtonTooltip).attr("href","#").attr("role","button").addClass("ui-dialog-titlebar-close ui-corner-all"))}else{$captionButtonContainer=modalDialog.igGridModalDialog("getCaptionButtonContainer");$buttonOK=$("#"+this.grid.id()+"_groupby_modalDialog_footer_buttonok");$buttonOK.bind("igbuttonclick",function(e){self._groupByDialogButtonOKClick(e)})}},openGroupByDialog:function(){var modalDialog=$("#"+this.grid.id()+"_groupby_modalDialog");modalDialog.igGridModalDialog("openModalDialog")},closeGroupByDialog:function(){var modalDialog=$("#"+this.grid.id()+"_groupby_modalDialog");modalDialog.igGridModalDialog("closeModalDialog")},_groupByDialogOpening:function(){var noCancel,modalDialog=$("#"+this.grid.id()+"_groupby_modalDialog");noCancel=this._trigger(this.events.modalDialogOpening,null,{modalDialogElement:modalDialog,owner:this});if(noCancel){this.renderGroupByModalDialog();this._trigger(this.events.modalDialogOpened,null,{modalDialogElement:modalDialog,owner:this})}return noCancel},renderGroupByModalDialog:function(){var $content,i,self=this,o=this.options,css=this.css,modalDialog=$("#"+this.grid.id()+"_groupby_modalDialog"),noCancel,$groupedColumns,$ungroupedColumns;noCancel=this._trigger(this.events.modalDialogContentsRendering,null,{modalDialogElement:modalDialog,owner:this});if(noCancel){$content=modalDialog.igGridModalDialog("getContent");$content.empty();self._tempGroupedColumns=o.groupedColumns.slice(0);self._tempOrderedGroupedCols=self._orderedGroupedCols.slice(0);self._tempSortingExpr=self.grid.dataSource.settings.sorting.expressions.slice(0);self._tempOptions={columnLayouts:[]};if(this.grid.options.columnLayouts&&this.grid.options.columnLayouts.length>0){for(i=0;i<this.grid.options.columnLayouts.length;i++){self._tempOptions.columnLayouts.push($.extend(true,{},this.grid.options.columnLayouts[i]))}this._renderLayoutsDropDown()}$groupedColumns=$("<div></div>").attr("id",this.grid.id()+"_groupby_modalDialog_groupedcolumns").addClass(css.dialogGroupedColumns).appendTo($content);$ungroupedColumns=$("<div></div>").attr("id",this.grid.id()+"_groupby_modalDialog_ungroupedcolumns").addClass(css.dialogUnroupedColumns).appendTo($content);$("<ul></ul>").addClass(css.dialogListGroupedColumns).appendTo($groupedColumns);$("<ul></ul>").addClass(css.dialogListUngroupedColumns).appendTo($ungroupedColumns);this._renderColumnsDialog(this.grid.options.columns);this._currentTreeLayer=null;if(this._isToRenderClearAllButton()){this._renderDialogButtonClearAll()}else{$("#"+this.grid.id()+"_groupbydialog_reset_button").remove()}this._trigger(this.events.modalDialogContentsRendered,null,{modalDialogElement:modalDialog,owner:this})}},_addSlideButtonGroupedColumns:function(){var css=this.css,o=this.options,$groupedColumns=$("#"+this.grid.id()+"_groupby_modalDialog_groupedcolumns"),buttonId=this.grid.id()+"_groupbymodaldialot_slidebutton",$button,innerHTML;innerHTML='<div class="'+css.dialogSlideArea+'">'+'	<div class="'+css.dialogSlideAreaContainer+'">'+'		<button id="'+buttonId+'" class="'+css.dialogButtonSlide+'" role="button" aria-disabled="false" title="'+o.dialogButtonSlideCaption+'">'+'			<span class="'+css.dialogButtonSlideContainer+'"></span>'+'			<span class="ui-button-text">'+o.dialogButtonSlideCaption+"</span>"+"		</button>"+"	</div>"+"</div>";$(innerHTML).insertAfter($groupedColumns);$button=$("#"+buttonId);$button.bind({click:function(){$groupedColumns.slideToggle("slow");$(this).find("span:eq(0)").toggleClass(css.dialogButtonSlideUp);return false}})},_renderLayoutsDropDown:function(){var o=this.options,fn,w,dW,$ddField,self=this,css=this.css,modalDialog=$("#"+this.grid.id()+"_groupby_modalDialog"),$content=modalDialog.igGridModalDialog("getContent"),cancelFunc,htmlLayouts,$buttonDD,$dropDown,$tree,dropDownId=this.grid.id()+"_groupby_modalDialog_layoutsDD",modalDialogDropDownAreaWidth=o.modalDialogDropDownAreaWidth||o.modalDialogDropDownWidth,columnLayoutsData=this.grid.options.columnLayouts.slice(0),$layoutsContainer;$layoutsContainer=$("<div></div>").attr("id",this.grid.id()+"_groupby_modalDialog_layoutsContainer").addClass(css.modalDialogLayoutsContainer).appendTo($content);htmlLayouts='<div style="float: left;">'+o.modalDialogDropDownLabel+"</div>"+'<div class="'+css.dialogLayoutsDD+'">'+'	<div id="'+this.grid.id()+'_groupby_modalDialog_layoutsDDField" class="'+css.dialogLayoutsDDField+'">'+o.modalDialogRootLevelHierarchicalGrid+"</div>"+'	<span id="'+this.grid.id()+'_groupby_modalDialog_layoutsDDButton" style="float:right;">^</span>'+'	<div style="clear: both;"></div>'+"</div>"+'<div style="clear: both;"></div>';$layoutsContainer.html(htmlLayouts);$buttonDD=$("#"+this.grid.id()+"_groupby_modalDialog_layoutsDDButton");$buttonDD.wrap('<a href="#" title="'+o.modalDialogDropDownButtonCaption+' "></a>');cancelFunc=function(e){e.preventDefault();e.stopPropagation()};$buttonDD.closest("div").bind({mousedown:function(event){self._toggleDropDown(event,false)},mouseup:cancelFunc,click:cancelFunc});$buttonDD.addClass(css.dialogLayoutsDDButton);if(this._checkIsGroupByInherit(this.grid.options)===false){columnLayoutsData=this._getEnabledGroupByLayouts(columnLayoutsData)}if(columnLayoutsData.length>0||this._checkIsGroupByEnabled(this.grid.options)){$dropDown=$("#"+dropDownId);$dropDown.remove();$dropDown=$("<div></div>");$dropDown.attr("id",dropDownId).css({position:"absolute",display:"none","z-index":"1000"}).addClass(this.css.dropDownLayoutsContainer).appendTo($("#"+this.grid.id()+"_groupby_modalDialog_content")).bind({mousedown:function(){clearTimeout(self._dropDownTimeout);setTimeout(function(){$buttonDD.closest("a").focus()},10)}});if(o.modalDialogDropDownWidth){$buttonDD.closest("div").width(o.modalDialogDropDownWidth)}if(modalDialogDropDownAreaWidth){$dropDown.width(modalDialogDropDownAreaWidth)}if(o.modalDialogDropDownWidth&&(!o.modalDialogDropDownWidth.indexOf||o.modalDialogDropDownWidth.indexOf("%")===-1)){w=$buttonDD.closest("div").width()-$buttonDD.outerWidth();$ddField=$("#"+this.grid.id()+"_groupby_modalDialog_layoutsDDField");$ddField.width(w);dW=$ddField.outerWidth()-w;if(dW>0){w-=dW;$ddField.width(w-2)}}$tree=$("<div></div>").attr("id",this.grid.id()+"_groupby_modal_treeLayouts").addClass(css.modalDialogTreeContainer);$tree.appendTo($dropDown);columnLayoutsData=[{key:"Root",columnLayouts:columnLayoutsData,isRoot:true}];$tree.igTree({dataSourceType:"json",dataSource:columnLayoutsData,initialExpandDepth:1e6,bindings:{textKey:"key",childDataProperty:"columnLayouts"},nodeClick:function(event,args){var data=args.node.data,keyLayout=data.key,$groupedUL=$("#"+self.grid.id()+"_groupby_modalDialog_groupedcolumns ul"),$ungroupedUL=$("#"+self.grid.id()+"_groupby_modalDialog_ungroupedcolumns ul");if(data.dislabledGroupBy===true){return}$groupedUL.empty();$ungroupedUL.empty();$("#"+self.grid.id()+"_groupby_modalDialog_layoutsDDField").text(keyLayout);if(args.node.path.length===1){self._renderColumnsDialog(self.grid.options.columns);self._currentTreeLayer=null}else{self._currentTreeLayer=keyLayout;self._renderColumnsDialog(data.columns,keyLayout)}self._toggleDropDown()}});fn=function(){self._dropDownTimeout=setTimeout(function(){self.closeDropDown()},200)};$buttonDD.closest("a").bind({focus:function(){self._igTreeHasFocus=true;clearTimeout(self._dropDownTimeout)},blur:function(){self._igTreeHasFocus=false;fn()}});$tree.find("a").bind({focus:function(){clearTimeout(self._dropDownTimeout)},blur:function(){fn()}});$tree.find("span.ui-igtree-expander.ui-icon").bind({click:function(){clearTimeout(self._dropDownTimeout);setTimeout(function(){$buttonDD.closest("a").focus()},10)}})}},openDropDown:function(){var $dropDown=$("#"+this.grid.id()+"_groupby_modalDialog_layoutsDD");if($dropDown.is(":visible")===false){this._toggleDropDown()}},closeDropDown:function(){var $dropDown=$("#"+this.grid.id()+"_groupby_modalDialog_layoutsDD");if($dropDown.is(":visible")===true){this._toggleDropDown()}},_getEnabledGroupByLayouts:function(layouts){var resultLayouts=[],i,tempChildLayouts,layout;if(layouts){for(i=0;i<layouts.length;i++){tempChildLayouts=null;layout=$.extend(true,{},layouts[i]);if(layout.columnLayouts&&this._checkIsGroupByInherit(layout)===false){tempChildLayouts=this._getEnabledGroupByLayouts(layout.columnLayouts);if(tempChildLayouts&&tempChildLayouts.length>0){layout.columnLayouts=tempChildLayouts}else{layout.columnLayouts=null}}if(this._checkIsGroupByEnabled(layout)){resultLayouts.push(layout)}else if(layout.columnLayouts!==null&&layout.columnLayouts!==undefined){layout.dislabledGroupBy=true;resultLayouts.push(layout)}}}return resultLayouts},_checkIsGroupByInherit:function(layout){var i;if(layout&&layout.features){for(i=0;i<layout.features.length;i++){if(layout.features[i].name==="GroupBy"&&layout.features[i].inherit===true){return true}}}return false},_checkIsGroupByEnabled:function(layout){var i;if(layout&&layout.features){for(i=0;i<layout.features.length;i++){if(layout.features[i].name==="GroupBy"){return true}}}return false},_toggleDropDown:function(){var $button=$("#"+this.grid.id()+"_groupby_modalDialog_layoutsDDButton").parent(),$modalDialogContent=$("#"+this.grid.id()+"_groupby_modalDialog_content"),$layoutsDDField=$("#"+this.grid.id()+"_groupby_modalDialog_layoutsDDField").parent(),left=0,top=0,$dropDown=$("#"+this.grid.id()+"_groupby_modalDialog_layoutsDD"),isVisible=$dropDown.is(":visible")===true,self=this;if($dropDown.data("isAnimating")===true){return}if(!isVisible){top=$layoutsDDField.offset().top-$modalDialogContent.offset().top+$layoutsDDField.height()+1;left=$layoutsDDField.offset().left-$modalDialogContent.offset().left;$dropDown.css({top:top,left:left})}$dropDown.data("isAnimating",true);$dropDown.slideToggle(400,function(){var $layoutsDD=$("#"+self.grid.id()+"_groupby_modalDialog_layoutsDD"),$tree=$("#"+self.grid.id()+"_groupby_modal_treeLayouts");if($dropDown.is(":visible")===true){$button.focus();self._activeDropdown=$dropDown;if(!self.options.modalDialogDropDownAreaWidth&&!self.options.modalDialogDropDownWidth){if($layoutsDD.width()!==$tree.width()){$layoutsDD.width($tree.width())}}}else{self._activeDropdown=null}$dropDown.data("isAnimating",false)})},_groupByDialogButtonOKClick:function(e){var noCancel,noCancelGroupBy,i,j,len,tempGroupedCol,copy,o=this.options,$hTable,modalDialog=$("#"+this.grid.id()+"_groupby_modalDialog"),isToCallGroupedColumnsChanged=false;noCancel=this._trigger(this.events.modalDialogButtonApplyClick,null,{modalDialogElement:modalDialog,owner:this,groupedColumns:this._tempGroupedColumns,groupedColumnLayouts:this._tempOptions.columnLayouts,sortingExpr:this._tempSortingExpr});if(noCancel){noCancelGroupBy=this._trigger(this.events.groupedColumnsChanging,e,{owner:this,groupedColumns:o.groupedColumns,newGroupedColumns:{columns:this._tempGroupedColumns,layouts:this._tempOptions.columnLayouts},triggeredBy:"modalDialog"});if(noCancelGroupBy){if(this._orderedGroupedCols.length!==this._tempOrderedGroupedCols.length){isToCallGroupedColumnsChanged=true}else{len=this._orderedGroupedCols.length;for(i=0;i<len;i++){tempGroupedCol=this._tempOrderedGroupedCols[i];for(j=0;j<len;j++){if(tempGroupedCol.key===this._orderedGroupedCols[j].key&&tempGroupedCol.layout===this._orderedGroupedCols[j].layout){break}}if(j===len){isToCallGroupedColumnsChanged=true;break}}}if(isToCallGroupedColumnsChanged===true){this.grid._onGroupedColumnsChanged(this._tempGroupedColumns);this._trigger(this.events.groupedColumnsChanged,e,{owner:this,groupedColumns:this._tempGroupedColumns,triggeredBy:"modalDialog"})}this._orderedGroupedCols=this._tempOrderedGroupedCols;if(o.groupedColumns){o.groupedColumns=this._tempGroupedColumns}if(this.grid.options.columnLayouts){this.grid.options.columnLayouts=this._tempOptions.columnLayouts}if(this.grid.dataSource.settings.sorting.expressions){this.grid.dataSource.settings.sorting.expressions=this._tempSortingExpr}if(this._isToRenderClearAllButton()===false){if($(".ui-iggrid-groupbyarea",this.grid.container()).find("ul li").length===0){this._isgroup=null}else{this._isgroup=false}}else{this._isgroup=true}$hTable=this.grid.headersTable();if(o.groupedColumns.length===0&&$hTable.find("thead tr").children().first().hasClass("ui-iggrid-expandheadercellgb")){if($.ig.util.isIE){this.grid.element.children("tbody").hide();$hTable.hide()}this.grid.element.find("colgroup").children().first().remove();if(this.grid.options.fixedHeaders){$hTable.find("colgroup").children().first().remove()}if(this.grid.options.fixedFooters&&this.grid.options.height!==null){this.grid.footersTable().find("colgroup").children().first().remove()}$hTable.find("thead tr").children("[data-skip]").first().remove()}copy=this._orderedGroupedCols.slice(0);this._orderedGroupedCols=[];this._ensureLabelsOrder(copy,this._orderedGroupedCols,this.grid.options);this._rebind();if($.ig.util.isIE&&!$hTable.is(":visible")){$hTable.show()}if(this.grid.options.width!==null&&this.grid.options.width!==undefined){this.grid._updateGridContentWidth()}this.grid._trigger("headerExtraCellsModified",null,{owner:this})}e.preventDefault();e.stopPropagation();modalDialog.igGridModalDialog("closeModalDialog")}},_setSortingTempExpr:function(key,dir,layout){var i,layouts,j,gc=this._tempGroupedColumns,gcTemp,sexpr,s=this._tempSortingExpr,settings,lobj;sexpr={fieldName:key,dir:dir,layout:layout,isGroupBy:true};if(dir===""){for(j=0;j<s.length;j++){if(s[j].fieldName===key&&s[j].layout===layout){s.splice(j,1);break}}return}if(gc.length===0&&!layout){gcTemp=this._tempGroupedColumns.slice(0);this._allGroupedCols(gcTemp);gc=gcTemp.slice(0)}for(i=0;i<gc.length;i++){if(gc[i].key===key){gc[i].dir=dir;for(j=0;j<s.length;j++){if(s[j].fieldName===key){s[j].dir=gc[i].dir;if(gc[i].layout){s[j].layout=gc[i].layout}break}}if(j===s.length){this._addSortingExpressions(s,sexpr)}break}}if(layout){for(i=0;i<this._tempOrderedGroupedCols.length;i++){if(this._tempOrderedGroupedCols[i].key===key&&(this._tempOrderedGroupedCols.layout&&this._tempOrderedGroupedCols.layout===layout||!this._tempOrderedGroupedCols.layout)){this._tempOrderedGroupedCols[i].dir=dir;break}}for(j=0;j<s.length;j++){if(s[j].fieldName===key&&s[j].layout===layout){s[j].dir=dir;break}}if(j===s.length){this._addSortingExpressions(s,sexpr)}layouts=[];this._findLayout(layout,this._tempOptions,layouts);lobj=layouts[0];for(i=0;lobj.features&&i<lobj.features.length;i++){if(lobj.features[i].name==="GroupBy"){settings=lobj.features[i].columnSettings;for(j=0;j<settings.length;j++){if(settings[j].columnKey===key){settings[j].dir=dir;break}}break}}}},_setGroupByTempExpr:function(key,isGroupBy,dir,layout){var i,gexpr,expr,lobj,c,fcs,setting,layouts;if(layout){layouts=[];this._findLayout(layout,this._tempOptions,layouts);lobj=layouts[0];c=this._getColumnByLayoutKey(key,lobj.columns)}else{lobj=this.grid.options;c=this.grid.columnByKey(key)}if(layout){if(!lobj.features){lobj.features=[];lobj.features.push({name:"GroupBy",columnSettings:[]});fcs=lobj.features[0].columnSettings}else{for(i=0;i<lobj.features.length;i++){if(lobj.features[i].name==="GroupBy"){fcs=lobj.features[i].columnSettings;if(!fcs){lobj.features[i].columnSettings=[];fcs=lobj.features[i].columnSettings}break}}}for(i=0;i<fcs.length;i++){if(fcs[i].columnKey===key){if(!isGroupBy){fcs.splice(i,1)}else{setting=fcs[i]}break}}if(isGroupBy){if(!setting){fcs.push({columnKey:key,isGroupBy:isGroupBy,dir:dir})}else{setting.isGroupBy=isGroupBy;setting.dir=dir}}}gexpr={key:key,dir:dir,layout:layout,col:c};if(!layout){expr=this._tempGroupedColumns;for(i=0;i<expr.length;i++){if(expr[i].key===key){expr.splice(i,1);break}}if(isGroupBy){expr=expr.concat(gexpr)}this._tempGroupedColumns=expr}if(isGroupBy){this._tempOrderedGroupedCols.push(gexpr)}else{for(i=0;i<this._tempOrderedGroupedCols.length;i++){if(this._tempOrderedGroupedCols[i].key===key&&(this._tempOrderedGroupedCols.layout&&this._tempOrderedGroupedCols.layout===layout||!this._tempOrderedGroupedCols.layout)){$.ig.removeFromArray(this._tempOrderedGroupedCols,i);break}}}this._setSortingTempExpr(key,dir,layout)},_checkColumnIsGroupedInternal:function(key,layout,groupedColumns,options){var isGrouped=false,i,j,layouts,lobj,fcs;if(!layout){for(i=0;i<groupedColumns.length;i++){if(groupedColumns[i].key===key){isGrouped=true;break}}}else{layouts=[];this._findLayout(layout,options,layouts);lobj=layouts[0];if(lobj&&lobj.features){for(i=0;i<lobj.features.length;i++){if(lobj.features[i].name==="GroupBy"){fcs=lobj.features[i].columnSettings;if(fcs){for(j=0;j<fcs.length;j++){if(fcs[j].columnKey===key){if(fcs[j].isGroupBy){isGrouped=true}break}}}break}}}}return isGrouped},checkColumnIsGrouped:function(key,layout){return this._checkColumnIsGroupedInternal(key,layout,this.options.groupedColumns,this.grid.options)},_getAllColumns:function(columns,columnsRes){var i,columnsLength=columns.length;for(i=0;i<columnsLength;i++){if(columns[i].group){this._getAllColumns(columns[i].group,columnsRes)}else{columnsRes.push(columns[i])}}},_renderColumnsDialog:function(columns,layout){var self=this,columnsRes=[];if(this.grid._isMultiColumnGrid){this._getAllColumns(columns,columnsRes)}else{columnsRes=columns}$.each(columnsRes,function(columnIndex,column){var cs=self._findColumnSetting(column.key);if(self.options.type==="remote"&&(column.unboundDS===true||column.unbound===true)){return true}if(!cs||cs.allowGrouping){if(self._checkColumnIsGroupedInternal(column.key,layout,self._tempGroupedColumns,self._tempOptions)){self._renderDialogGroupedColumn(column,layout)}else{self._renderDialogUngroupedColumn(column,layout)}}})},_clearAllGroupedColumns:function(){this._tempGroupedColumns=[];this._clearAllGroupedColumnsLayout(this._tempOptions)},_clearAllGroupedColumnsLayout:function(layout){var i,fcs;if(layout!==null&&layout.features){for(i=0;i<layout.features.length;i++){if(layout.features[i].name==="GroupBy"){fcs=layout.features[i].columnSettings;if(fcs){layout.features[i].columnSettings=[]}}}}for(i=0;layout.columnLayouts&&i<layout.columnLayouts.length;i++){this._clearAllGroupedColumnsLayout(layout.columnLayouts[i])}},_isToRenderClearAllButton:function(){if(this.options.modalDialogGroupByOnClick===true){return true}if(this._tempGroupedColumns.length>0){return true}if(this._checkRenderLayoutsClearAll(this.grid.options)===true){return true}return false},_checkRenderLayoutsClearAll:function(layout){var i,j,fcs;if(layout!==null&&layout.features){for(i=0;i<layout.features.length;i++){if(layout.features[i].name==="GroupBy"){fcs=layout.features[i].columnSettings;if(fcs){for(j=0;j<fcs.length;j++){if(fcs[j].isGroupBy){return true}}}}}}for(i=0;layout.columnLayouts&&i<layout.columnLayouts.length;i++){if(this._checkRenderLayoutsClearAll(layout.columnLayouts[i])===true){return true}}return false},_renderDialogGroupedColumn:function(column,layout){var i,j,s,$li,liHTML,$buttonUngroup,o=this.options,self=this,css=this.css,key=column.key,$ul=$("#"+this.grid.id()+"_groupby_modalDialog_groupedcolumns ul"),buttonAscDescId=this.grid.id()+"_"+key+"_groupbydialog_groupedcolumns_buttonascdesc",buttonUngroupId=this.grid.id()+"_"+key+"_groupbydialog_groupedcolumns_buttonungroup",dir="asc",gc=null;$("#"+this.grid.id()+"_groupby_modalDialog").css("width");if(!layout){for(i=0;i<self._tempGroupedColumns.length;i++){if(self._tempGroupedColumns[i].key===key){gc=self._tempGroupedColumns[i];dir=gc.dir;break}}}else{s=self._tempSortingExpr;for(j=0;j<s.length;j++){if(s[j].fieldName===key&&s[j].layout===layout){dir=s[j].dir;break}}}$li=$('<li tabIndex="0"></li>').attr("id",self.grid.id()+"_"+key+"_groupbydialog_grouped_li").addClass(css.dialogGroupedItem);$li.appendTo($ul);liHTML='<span id="'+buttonAscDescId+'" class="'+css.dialogButtonAsc+'" role="button" title="'+o.modalDialogCaptionButtonAsc+'">'+'	<span class="'+css.dialogButtonAscIcon+'"></span>'+"</span>"+'<span class="'+css.dialogGroupedColumnTextContainer+'">'+column.headerText+"</span>"+'<button id="'+buttonUngroupId+'" class="'+css.dialogButtonUngroup+'" role="button" title="'+o.modalDialogCaptionButtonUngroup+'" >'+'	<span class="'+css.dialogButtonUngroupContainer+'"></span>'+'	<span class="ui-button-text">'+o.modalDialogCaptionButtonUngroup+"</span>"+"</button>";$li.html(liHTML);$buttonUngroup=$("#"+buttonUngroupId);self._setDialogButtonAscDesc(dir==="asc",key);$li.bind({keydown:function(e){if(e.keyCode===$.ui.keyCode.ENTER||e.keyCode===$.ui.keyCode.SPACE){$li.click();e.preventDefault();e.stopPropagation()}},click:function(){self._dialogButtonAscDescClick(key,layout)}});$buttonUngroup.bind({keydown:function(e){if(e.keyCode===$.ui.keyCode.ENTER||e.keyCode===$.ui.keyCode.SPACE){e.target.click();e.preventDefault();e.stopPropagation()}},click:function(e){var noCancel,$nextLi;noCancel=self._trigger(self.events.modalDialogUngroupingColumn,e,{key:key,layout:layout,owner:self});if(noCancel){$li.remove();if(o.modalDialogGroupByOnClick===true){self.ungroupByColumn(key,layout)}else{self._setGroupByTempExpr(key,false,"",layout)}$nextLi=self._renderDialogUngroupedColumn(column,layout);$nextLi.find(":focusable").first().focus(1);if($("#"+self.grid.id()+"_groupby_modalDialog_groupedcolumns ul li").length===0&&self._isToRenderClearAllButton()===false){$("#"+self.grid.id()+"_groupbydialog_reset_button").remove()}self._trigger(self.events.modalDialogUngroupColumn,e,{key:key,layout:layout,owner:self,groupedColumns:self._tempGroupedColumns})}e.preventDefault();e.stopPropagation()},mouseover:function(){if(!$(this).hasClass(css.dialogButtonsHover)){$(this).addClass(css.dialogButtonsHover)}},mouseout:function(){if($(this).hasClass(css.dialogButtonsHover)){$(this).removeClass(css.dialogButtonsHover)}}});
return $li},_dialogButtonAscDescClick:function(key,layout){var o=this.options,$buttonAscDesc=$("#"+this.grid.id()+"_"+key+"_groupbydialog_groupedcolumns_buttonascdesc"),noCancel,modalDialog=$("#"+this.grid.id()+"_groupby_modalDialog"),isAsc=$buttonAscDesc.data("isAsc");noCancel=this._trigger(this.events.modalDialogSortGroupedColumn,null,{modalDialogElement:modalDialog,owner:this,key:key,isAsc:!isAsc,layout:layout});if(noCancel){if(isAsc===true){if(o.modalDialogGroupByOnClick===true){this._setSortingTempExpr(key,"desc",layout);this.grid.dataSource.settings.sorting.expressions=this._tempSortingExpr;this._rebind()}else{this._setSortingTempExpr(key,"desc",layout)}}else{if(o.modalDialogGroupByOnClick===true){this._setSortingTempExpr(key,"asc",layout);this.grid.dataSource.settings.sorting.expressions=this._tempSortingExpr;this._rebind()}else{this._setSortingTempExpr(key,"asc",layout)}}this._setDialogButtonAscDesc(!isAsc,key)}},_setDialogButtonAscDesc:function(isAsc,key){var css=this.css,$buttonAscDesc=$("#"+this.grid.id()+"_"+key+"_groupbydialog_groupedcolumns_buttonascdesc"),$spanIcon=$buttonAscDesc.find("span:eq(0)"),caption;if(isAsc===true){$buttonAscDesc.removeClass(css.dialogButtonDesc).addClass(css.dialogButtonAsc);$spanIcon.removeClass(css.dialogButtonDescIcon).addClass(css.dialogButtonAscIcon);caption=this.options.modalDialogCaptionButtonAsc}else{$buttonAscDesc.removeClass(css.dialogButtonAsc).addClass(css.dialogButtonDesc);$spanIcon.removeClass(css.dialogButtonAscIcon).addClass(css.dialogButtonDescIcon);caption=this.options.modalDialogCaptionButtonDesc}$buttonAscDesc.data("isAsc",isAsc).attr("title",caption)},_renderDialogButtonClearAll:function(){if(this.options.modalDialogGroupByOnClick===true){return}var self=this,o=this.options,resetButtonId=self.grid.id()+"_groupbydialog_reset_button",modalDialog=$("#"+this.grid.id()+"_groupby_modalDialog"),$captionButtonContainer,$resetButton;if($("#"+resetButtonId).length===0){$captionButtonContainer=modalDialog.igGridModalDialog("getCaptionButtonContainer");$resetButton=$("<button></button>").attr("id",resetButtonId).appendTo($captionButtonContainer);$resetButton.igButton({labelText:o.modalDialogClearAllButtonLabel,click:function(e){var noCancel,$groupedUL,$ungroupedUL,layouts=[];noCancel=self._trigger(self.events.modalDialogButtonResetClick,e,{modalDialogElement:modalDialog,owner:self});if(noCancel){self._clearAllGroupedColumns();self._tempSortingExpr=self.grid.dataSource.settings.sorting.expressions.slice(0);$groupedUL=$("#"+self.grid.id()+"_groupby_modalDialog_groupedcolumns ul");$ungroupedUL=$("#"+self.grid.id()+"_groupby_modalDialog_ungroupedcolumns ul");$groupedUL.empty();$ungroupedUL.empty();self._tempSortingExpr=[];self._tempOrderedGroupedCols=[];if(!self._currentTreeLayer){self._renderColumnsDialog(self.grid.options.columns)}else{self._findLayout(self._currentTreeLayer,self._tempOptions,layouts);if(layouts.length>0){self._renderColumnsDialog(layouts[0].columns,self._currentTreeLayer)}}$(this).remove()}}})}},_renderDialogUngroupedColumn:function(column,layout){var self=this,$li,$a,key=column.key,o=this.options,css=this.css,$ul=$("#"+this.grid.id()+"_groupby_modalDialog_ungroupedcolumns ul");$li=$("<li></li>").attr("id",self.grid.id()+"_"+key+"_groupbydialog_grouped_li").addClass(css.dialogUngroupedItem).append('<span class="'+css.dialogUngroupedColumnsGroupByButton+'"><a href="#"></a></span> <span class="'+css.dialogUngroupedColumnsText+'">'+column.headerText+"</span>");$li.appendTo($ul);$a=$li.find("a:first");$a.addClass(css.modalDialogSortByColumn);$a.html(o.modalDialogGroupByButtonText);$li.bind({click:function(e){var noCancel,$nextLi;noCancel=self._trigger(self.events.modalDialogGroupingColumn,e,{key:key,layout:layout,owner:self});if(noCancel){$li.remove();if(o.modalDialogGroupByOnClick){self.groupByColumn(key,layout)}else{self._setGroupByTempExpr(key,true,o.defaultSortingDirection,layout)}self._renderDialogButtonClearAll();$nextLi=self._renderDialogGroupedColumn(column,layout);$nextLi.find(":focusable").first().focus(1);self._renderDialogButtonClearAll();self._trigger(self.events.modalDialogGroupColumn,e,{key:key,layout:layout,owner:self,groupedColumns:self._tempGroupedColumns})}e.preventDefault();e.stopPropagation()}});return $li},_setGroupAreaTextContent:function($area){var text=this.options.emptyGroupByAreaContent,linkText=this.options.emptyGroupByAreaContentSelectColumns,linkTextCaption=this.options.emptyGroupByAreaContentSelectColumnsCaption,$a,self=this;text=text.replace("{0}",'<a href="#" id="'+this.grid.id()+'_link_selectcolumns" title="'+linkTextCaption+'">'+linkText+"</a>");$area.html(text);$a=$("#"+this.grid.id()+"_link_selectcolumns");$a.bind({click:function(e){self.openGroupByDialog();e.preventDefault();e.stopPropagation()}})},_headerCellDragCancel:function(){return false},_headerCellRendered:function(event,args){var groupby=this,cs,hg,hgTemp,isMultiColumnHeaderGrid=this.grid._isMultiColumnGrid;if(args.owner.id()!==this.grid.id()){return}if(args.isMultiColumnHeader===true){return}hg=groupby.grid.element.hasClass("ui-iggrid-root")?groupby.grid.container():groupby.grid.element.closest(".ui-iggrid-root");if(hg.length===0){hg=groupby.grid.container()}else{hgTemp=hg.closest(".ui-widget");if(hgTemp.length>0){hg=hgTemp}}cs=this._findColumnSetting(args.columnKey);if(!$.ig.util.isIE||$.ig.util.browserVersion>=9){args.th.find(".ui-iggrid-headertext").css("width","100%")}if(cs&&cs.allowGrouping||!cs){args.th.draggable({containment:hg,appendTo:hg,distance:5,revert:"invalid",scroll:false,cancel:"div.ui-iggrid-indicatorcontainer",helper:function(event){var th,helperDOM;if($(event.target).is("span")){groupby._spanDragging=true}else{groupby._spanDragging=false}th=$(event.target).closest("th");helperDOM=th.clone().css("overflow","hidden").width(th.width()).addClass("ui-widget ui-iggrid").wrap($('<div class="'+groupby.css.dragMarkup+'"/>').width(th.outerWidth()));if(isMultiColumnHeaderGrid){helperDOM.height(th.height())}return helperDOM.parent()},opacity:groupby.options.labelDragHelperOpacity,drag:function(event,ui){var groupbyarea;groupby._isDragging=true;groupbyarea=$(".ui-iggrid-groupbyarea",hg);if(!groupbyarea.hasClass("ui-iggrid-groupbyareahover")&&!groupby._movingEnabled){if(groupby._spanDragging){ui.helper.find("span").css("cursor","no-drop")}else{ui.helper.css("cursor","no-drop")}}else{if(groupby._spanDragging){ui.helper.find("span").css("cursor","move")}else{ui.helper.css("cursor","move")}}},stop:function(){groupby._isDragging=false}}).bind({mouseover:groupby._headerMouseOverHandler,mouseout:groupby._headerMouseOutHandler});if(args.owner.element.attr("data-childgrid")){args.th.attr("data-layout",args.owner.options.key).attr("data-grid-id",args.owner.element.attr("id"))}}},_findColumnSetting:function(key){var i;for(i=0;i<this.options.columnSettings.length;i++){if(this.options.columnSettings[i].columnKey===key){return this.options.columnSettings[i]}}},_renderRecords:function(ui,args){if(args.owner.id()!==this.grid.id()){return}if(args.vrtWnd&&args.vrtWnd.calledFromGroupBy){return true}if(this.options.groupedColumns.length>0){this._renderRecordsInternal(args)}else{return true}return false},_recordsRendered:function(ui,args){if(args.calledFromGroupBy){return}var currentScrollTop=$(window).scrollTop();if(!args.tbody.is(":visible")){args.tbody.css("display","")}if(this._scrolltop!==0&&currentScrollTop!==0&&this._scrolltop!==currentScrollTop){$(window).scrollTop(this._scrolltop)}},_renderRecordsInternal:function(args){var grid=this.grid,idval=null,ds=grid.dataSource.dataView(),firstTime=true,counter,d=[],tbody=grid.element.children("tbody"),fh=false,html,i,tbodyHtml,$thDataSkip,noCancel=true,gr,groupedRowsLength,tr,countHiddenRows,startIndex=0,endIndex=0,newFirstVisibleRow,isScrolledToBottom,lastVisibleRow,avgRowHeight,dataSkipWidth=0,scrollContainer;noCancel=grid._trigger(grid.events.rowsRendering,null,args);if(noCancel){this._indent=this.options.indentation;if(grid.options.fixedHeaders===true){fh=true}if(grid._isMultiColumnGrid){this._colspan=grid.container().find("#"+grid.id()+" colgroup:first>col").length-1}else{if(grid.options.showHeader){this._colspan=grid.container().find("#"+grid.id()+(fh===true?"_headers":"")+" thead>tr:first").children("th:not(.ui-iggrid-expandheadercellgb)").length}else{this._colspan=grid.container().find("#"+grid.id()+" colgroup:first>col").length-1}}this._processGroupsRecursive(0,ds,tbody,d,idval,0,ds.length,firstTime);if(!grid.headersTable().find("thead tr th").hasClass("ui-iggrid-expandheadercellgb")){$thDataSkip=$("<th></th>").prependTo(grid.headersTable().find("thead tr:nth-child(1)")).addClass(this.css.expandHeaderCellGroupBy).addClass(this.css.headerExtraCell).attr("data-skip",true);if(grid._isMultiColumnGrid){$thDataSkip.attr("rowspan",grid._maxLevel+1)}if(grid.headersTable().attr("id")!==grid.element.attr("id")){$("<col />").prependTo(grid.headersTable().find("colgroup")).attr("data-skip","true").width(this._indent)}if(grid.footersTable().attr("id")!==grid.element.attr("id")){$("<col />").prependTo(grid.footersTable().find("colgroup")).attr("data-skip","true").width(this._indent)}}else{grid.headersTable().find("colgroup col:nth-child(1)").width(this._indent);grid.footersTable().find("colgroup col:nth-child(1)").width(this._indent)}tbody.show();html=d.join("");this._expandedRowCount=0;if(grid.options.virtualization===true){this._visibleGroupedRows=[];this._groupedRows=this._tokenizeTBody(html);if(this._groupedRows.length>0){this._groupedRows[0]=this._groupedRows[0].substr(0,3)+' data-firstgrouprow="true" '+this._groupedRows[0].substr(3);this._groupedRows[this._groupedRows.length-1]=this._groupedRows[this._groupedRows.length-1].substr(0,3)+' data-lastrow="true" '+this._groupedRows[this._groupedRows.length-1].substr(3);for(i=this._groupedRows.length-1;i>=0;i--){if(this._groupedRows[i].indexOf('data-grouprow="true"')>=0){this._groupedRows[i]=this._groupedRows[i].substr(0,3)+' data-lastgrouprow="true" '+this._groupedRows[i].substr(3);break}}this._virtualRowCount=this._determineVirtualRowCount(this._groupedRows,grid._getDisplayContainerHeight());if(this._virtualRowCount>this._groupedRows.length){this._virtualRowCount=this._groupedRows.length}endIndex=this._virtualRowCount;if(!grid._persistVirtualScrollTop||!grid._prevFirstVisibleTRIndex){grid._scrollTo(0,true)}tbodyHtml="";if(!this.options.initialExpand){this._countGroupedRows=html.match(/(data-grouprow="true")/gi).length;this._cachedGroupedRows=this._groupedRows;this._visibleRowIndexes=[];gr=[];this._groups={};counter=0;groupedRowsLength=this._groupedRows.length;countHiddenRows=0;for(i=0;i<groupedRowsLength;i++){tr=this._groupedRows[i];if(tr.indexOf("data-grouprow")>-1){counter++;countHiddenRows=0;tr=tr.replace(/data-row-idx="(\d)+"/i,'data-row-idx="'+(counter-1)+'"');if(tr.indexOf("display:none")===-1){this._visibleRowIndexes.push(counter-1);this._visibleGroupedRows.push(tr)}gr.push(tr)}else{if(++countHiddenRows>this._virtualRowCount){continue}if(!this._groups[counter-1]){this._groups[counter-1]=[]}this._groups[counter-1].push(tr)}}this._groupedRows=gr;gr=null;this._virtualRowCount=this._determineVirtualRowCount(this._visibleGroupedRows,grid._getDisplayContainerHeight());if(this._virtualRowCount>this._visibleGroupedRows.length){this._virtualRowCount=this._visibleGroupedRows.length}if(this.grid._prevFirstVisibleTRIndex&&this.grid._persistVirtualScrollTop){startIndex=this._visibleRowIndexes.indexOf(this.grid._prevFirstVisibleTRIndex)}endIndex=startIndex+this._virtualRowCount;tbodyHtml+=this._renderInitiallyCollapsedRows(startIndex,endIndex)}else{if(this.grid._prevFirstVisibleTRIndex&&this.grid._persistVirtualScrollTop){startIndex=this.grid._prevFirstVisibleTRIndex;endIndex=startIndex+this._virtualRowCount;if(startIndex>=this._groupedRows.length){endIndex=this._groupedRows.length;startIndex=this._groupedRows.length-this._virtualRowCount-1}else{endIndex=this._determineVirtualRowCount(this._groupedRows,grid._getDisplayContainerHeight())+startIndex}if(endIndex>this._groupedRows.length){endIndex=this._groupedRows.length;startIndex=endIndex-this._determineVirtualRowCount(this._groupedRows,grid._getDisplayContainerHeight())}if(startIndex<0){startIndex=0}}for(i=startIndex;i<endIndex;i++){tbodyHtml+=this._groupedRows[i]}}if(window.MSApp===undefined){tbody.html(tbodyHtml)}else{MSApp.execUnsafeLocalFunction(function(){tbody.html(tbodyHtml)})}grid._totalRowCount=grid._getTotalRowCount();grid._avgRowHeight=grid._calculateAvgRowHeight();grid._buildVirtualDomForContinuousVirtualization()}avgRowHeight=grid._calculateAvgRowHeight();if(!grid._persistVirtualScrollTop||!this._avgRowHeight||Math.abs(this._avgRowHeight-avgRowHeight)>1){this._avgRowHeight=avgRowHeight}if(grid._persistVirtualScrollTop&&grid._prevFirstVisibleTRIndex){grid._setScrollContainerHeight(this._avgRowHeight*grid._getTotalRowCount());newFirstVisibleRow=tbody.find('tr[data-row-idx="'+grid._prevFirstVisibleTRIndex+'"]');isScrolledToBottom=grid._getScrollContainerScrollTop()+5>grid._scrollContainer()[0].scrollHeight-grid._scrollContainer().innerHeight();if(isScrolledToBottom){lastVisibleRow=tbody.find("tr:visible:last");grid._setDisplayContainerScrollTop(lastVisibleRow[0].offsetTop)}else{if(newFirstVisibleRow.length>0){grid._setDisplayContainerScrollTop(newFirstVisibleRow[0].offsetTop)}}}}else{if(window.MSApp===undefined){tbody.html(html)}else{MSApp.execUnsafeLocalFunction(function(){tbody.html(html)})}if(grid.options.width===null){grid._setContainerWidth(grid.container())}else{grid._updateGridContentWidth()}if(grid._persistVirtualScrollTop&&grid._prevFirstVisibleTROffset){grid.scrollContainer()[0].scrollTop=grid._prevFirstVisibleTROffset}}scrollContainer=grid._virtualcontainer().length>0?grid._virtualcontainer():grid.scrollContainer();if(this.options.groupedColumns.length>0&&scrollContainer.length>0&&grid.element.width()>scrollContainer.width()&&(grid.options.virtualization===true||grid.options.rowVirtualization===true)){$(grid.element).find(">colgroup>col[data-skip=true]").each(function(){dataSkipWidth+=parseInt(this.style.width,10)});grid._setGridContentWidth(grid._calculateContainerWidth(false)+dataSkipWidth)}this.grid._trigger(this.grid.events.rowsRendered,null,{owner:this.grid,tbody:tbody})}},_getTotalRowCount:function(){if(this.grid.options.virtualization&&this.options.groupedColumns.length>0){if(this.options.initialExpand&&this._groupedRows){return this._groupedRows.length}if(!this.options.initialExpand&&this._visibleGroupedRows){return this._visibleGroupedRows.length}}return this._getTotalRowCountHandler()},_calculateAvgRowHeight:function(){var rowHeightSum=this.grid.container().find("#"+this.grid.id()+" > tbody").height();if(rowHeightSum===0){rowHeightSum=parseInt(this.options.height,10)}if(this.options.groupedColumns.length>0){return rowHeightSum/this._virtualRowCount}return rowHeightSum/this.grid._virtualRowCount},_processGroupsRecursive:function(i,ds,tbody,d,idval,start,end,firstTime){var index,tmpSum=0,j,tmpCount=start,tmpStart=start,k,arr,arrLength,cssClass,gcval=this.options.groupedColumns[i].key,cs;if(ds.length===0){return}idval=ds[tmpCount][gcval];cs=this._settingFromKey(gcval);firstTime=true;if(!(this.options.indentation&&this.options.indentation.indexOf&&this.options.indentation.indexOf("%")!==-1)){this._indent=parseInt(this.options.indentation,10)*(i+1)}for(j=start;j<end;j++){if(j<tmpCount||tmpCount>=end){continue}if(!this._cmp(cs,ds[tmpCount][gcval],idval)||firstTime){firstTime=false;idval=ds[tmpCount][gcval];if(cs.customGroupName){index=this._renderGroupRow(d,i,gcval,idval,cs.customGroupName,cs,ds[tmpCount])}else{index=this._renderGroupRow(d,i,gcval,idval,null,cs,ds[tmpCount])}tmpStart=tmpCount;if(this.options.groupedColumns.length-1>i){while(tmpCount<end&&this._cmp(cs,ds[tmpCount][gcval],idval)){tmpCount++;tmpSum++}this._rs(gcval,idval,index,tmpSum,tmpStart,tmpCount,ds,d);tmpSum=0;this._processGroupsRecursive(i+1,ds,tbody,d,idval,j,tmpCount,firstTime)}else{arr=[];while(tmpCount<end&&this._cmp(cs,ds[tmpCount][gcval],idval)){tmpCount++;tmpSum++;this._renderRecord(d,tbody,ds[tmpCount-1],tmpCount-1,this.options.initialExpand,arr)}arrLength=arr.length;for(k=0;k<arrLength;k++){cssClass=this.css.nonGroupRowEmptyCell;if(k===arrLength-1){cssClass+=" "+this.css.groupByLastEmptyCell}d[arr[k]]+='<td class="'+cssClass+'" data-skip="true"></td>'}this._rs(gcval,idval,index,tmpSum,tmpStart,tmpCount,ds,d);tmpSum=0}}}},_rs:function(gcval,idval,index,tmpSum,tmpStart,tmpCount,ds,d){var subdata;tmpSum=this._calcRealSum(gcval,idval,tmpSum,ds);d[index]=d[index].replace(new RegExp("__sum__","g"),tmpSum);if(d[index].indexOf("$$value$$")!==-1){subdata=ds.slice(tmpStart,tmpCount);d[index]=this._calcRealSummary(d[index],gcval,idval,subdata)}},_cmp:function(cs,val1,val2){var res,o=this.grid.options,enableUTCDates=o.enableUTCDates,rowTemplate=!o.rowTemplate||o.rowTemplate.length<=0,format,key,col;if(cs.groupComparerFunction){if(typeof cs.groupComparerFunction==="function"){res=cs.groupComparerFunction(cs,val1,val2)}else{res=window[cs.groupComparerFunction](cs,val1,val2)}return res}if($.type(val1)==="date"&&$.type(val2)==="date"){key=cs.columnKey;if(key!==undefined&&key!==null){col=this.grid.columnByKey(key);if(col!==undefined&&col!==null){format=col.format}}return $.ig.formatter(val1,"date",format,rowTemplate,enableUTCDates)===$.ig.formatter(val2,"date",format,rowTemplate,enableUTCDates)}return val1===val2},_encodeSummaryParams:function(owner,params){var cs=this.options.columnSettings,i,j,key;for(i=0;i<cs.length;i++){if(cs[i].summaries&&cs[i].summaries.length>0){for(j=0;j<cs[i].summaries.length;j++){key="gs("+cs[i].columnKey+")";if(params.extraParams[key]){params.extraParams[key]=params.extraParams[key]+","+cs[i].summaries[j].summaryFunction}else{params.extraParams[key]=cs[i].summaries[j].summaryFunction}}}}},_calcRealSummary:function(contents,gcval,idval,subdata){var n,k,i,cs,j,mdata=this.grid.dataSource.metadata(this.options.resultResponseKey),o,str=contents,val,found=false,mul=1,t,kVal;n=this.grid.dataSource.data();if(mdata&&mdata!==null){cs=this.options.columnSettings;for(i=0;i<cs.length;i++){for(j=0;j<cs[i].summaries.length;j++){o=mdata[cs[i].columnKey+"_"+cs[i].summaries[j].summaryFunction];for(k in o){if(o.hasOwnProperty(k)){t=this.grid.columnByKey(gcval).dataType;if(t==="bool"&&$.type(k)==="string"){kVal=k.toLowerCase()==="true"?true:false}else if(t==="number"&&$.type(k)==="string"){kVal=mul*k}else{kVal=k}if(idval!==null&&!idval.length&&idval===kVal*mul||kVal===idval){val=o[k];val=$.ig.formatter(val,"number",this.options.summarySettings.summaryFormat);if(cs[i].summaries[j].customSummary===undefined||cs[i].summaries[j].customSummary===null){str=str.replace(cs[i].columnKey+cs[i].summaries[j].summaryFunction+"$$value$$",val)}}}}}}}if(!found||this.grid.dataSource.dataView().length<n.length){return this._summaries(str,subdata,gcval)}},_calcRealSum:function(gcval,idval,sum,ds){var tmpSum=0,k,n,nLen,setting,mul=1,idx,metadata,t,nVal;setting=this._settingFromKey(gcval);metadata=this.grid.dataSource.metadata(this.options.resultResponseKey);if(metadata&&metadata[gcval]){k=metadata[gcval];for(n in k){if(k.hasOwnProperty(n)){t=this.grid.columnByKey(gcval).dataType;if(t==="bool"&&$.type(n)==="string"){nVal=n.toLowerCase()==="true"?true:false}else if(t==="number"&&$.type(n)==="string"){nVal=mul*n}else{nVal=n}if(idval!==null&&idval!==undefined&&!idval.length&&idval===nVal*mul){tmpSum=k[n]}else if(nVal===idval){tmpSum=k[n]}}}}else if(ds.length<this.grid.dataSource.data().length){tmpSum=0;if(this.grid.dataSource._filter&&this.grid.dataSource._filteredData&&this.options.type==="local"){n=this.grid.dataSource._filteredData}else{n=this.grid.dataSource.data()}nLen=n.length;for(k=0;k<nLen;k++){if(this._cmp(setting,n[k][gcval],idval)){idx=k;break}}for(k=idx;k<nLen;k++){if(this._cmp(setting,n[k][gcval],idval)){tmpSum++}else{break}}}return tmpSum>0?tmpSum:sum},_settingFromKey:function(key){var cs,j;for(j=0;j<this.options.columnSettings.length;j++){if(this.options.columnSettings[j].columnKey===key){cs=this.options.columnSettings[j]}}return cs},_renderGroupRow:function(arr,indent,field,val,customName,colCustomSetting,record){var expcell,textcell,col,margin=indent>0?parseInt(this.options.indentation,10)*indent:0,text,state,css,i,cs=this.options.columnSettings,shtml="",tmpl,title,j,hide=false,grpRowId;if(this.options.initialExpand){css=this.css.groupByExpandCellExpanded;title=this.options.collapseTooltip}else{css=this.css.groupByExpandCellCollapsed;title=this.options.expandTooltip;if(indent>0){hide=true}}if(this.options.expansionIndicatorVisibility){expcell='<td class="'+this.css.groupByExpandColumn+'" gbexpandcell="1"'+' tabindex="'+this.grid.options.tabIndex+'"><span class="ui-iggrid-expandbuttoncontainer-group-by" style="margin-left:'+margin+'px;"><span class="'+css+'" title="'+title+'"></span></span></td>'}else{expcell='<td class="'+this.css.groupByExpandColumn+'" gbexpandcell="1"></td>'}tmpl=this.options.groupedRowTextTemplate;col=this.grid.columnByKey(field);if(colCustomSetting&&colCustomSetting.groupLabelFormatter){if(typeof colCustomSetting.groupLabelFormatter==="function"){val=colCustomSetting.groupLabelFormatter(val)}else{val=window[colCustomSetting.groupLabelFormatter](val)}}else if(this.options.useGridColumnFormatter===true){val=this.grid._renderCell(val,col,record," ")}tmpl=tmpl.replace(new RegExp("\\$\\{key\\}","g"),col.headerText);if(customName){text=tmpl.replace(new RegExp("\\$\\{val\\}","g"),customName).replace(new RegExp("\\$\\{count\\}","g"),"__sum__")}else{text=tmpl.replace(new RegExp("\\$\\{val\\}","g"),val).replace(new RegExp("\\$\\{count\\}","g"),"__sum__")}if(this.options.initialExpand){state="expanded"}else{state="collapsed"}for(i=0;i<cs.length;i++){for(j=0;j<cs[i].summaries.length;j++){shtml+=" "+cs[i].columnKey+" "+(cs[i].summaries[j].text||cs[i].summaries[j].summaryFunction)+" "+cs[i].columnKey+cs[i].summaries[j].summaryFunction+"$$value$$";if(j!==cs[i].summaries.length-1){shtml+=this.options.summarySettings.multiSummaryDelimiter}}}text+=shtml;textcell='<td data-gbsummary="true" colspan="'+this._colspan+'" tabindex="'+this.grid.options.tabIndex+'">'+text+"</td>";grpRowId=this.grid.options.primaryKey||record.hasOwnProperty("ig_pk")?$.ig.util.getCheckSumForObject({text:text}):null;arr.push('<tr class="'+this.grid.css.recordClass+" "+this.css.groupedRow+'" data-grouprow="true" data-state="'+state+'" data-glevel="'+indent+'"'+(hide?' style="display:none;"':"")+' aria-expanded="'+(state==="expanded"?"true":"false")+'"'+' aria-describedby="'+this.grid.id()+"_"+col.key+'"'+' title="'+$.ig.GridGroupBy.locale.summaryRowTitle+'"'+(grpRowId?' data-id="'+grpRowId+'"':"")+' tabindex="'+this.grid.options.tabIndex+'" >'+expcell+textcell+"</tr>");return arr.length-1},_renderRecord:function(d,tbody,data,rowIndex,expand,arr){var i,j,dLen,lastIndex=d.length;this.grid._renderRecordInArray(d,tbody,data,rowIndex);dLen=d.length;for(i=lastIndex;i<dLen;i++){if(d[i].indexOf&&d[i].indexOf("<tr")!==-1){if(!expand){d[i]=d[i]+' style="display: none;"'}for(j=i;j<dLen;j++){if(d[j].indexOf&&d[j].indexOf("data-grouprow")!==-1){break}if(d[j].indexOf&&d[j].indexOf(">")!==-1){arr.push(j);break}}break}}},_renderNewRow:function(rec){var tbody=this.grid.element.children("tbody"),dataRows=tbody.children("tr:not([data-container='true'],[data-grouprow='true'])"),index=dataRows.length,row,ind,i;row=$(this.grid._renderRecord(rec,index));ind=dataRows.last().find("td."+this.css.nonGroupRowEmptyCell).removeClass(this.css.groupByLastEmptyCell).length;for(i=0;i<ind;i++){$("<td></td>").addClass(this.css.nonGroupRowEmptyCell).addClass(this.css.groupByLastEmptyCell).attr("data-skip",true).prependTo(row)}MSApp.execUnsafeLocalFunction(function(){tbody.append(row)})},_summaries:function(contents,data){var i,j,cs=this.options.columnSettings,s,ret=contents,arr,val;if(contents&&contents.indexOf&&contents.indexOf("$$value$$")===-1){return contents}for(i=0;i<cs.length;i++){s=cs[i].summaries;if(s.length>0){arr=this._arr(cs[i].columnKey,data);for(j=0;j<s.length;j++){val=$.ig.calcSummaries(s[j].summaryFunction,arr,s[j].customSummary);val=$.ig.formatter(val,"number",this.options.summarySettings.summaryFormat);ret=ret.replace(cs[i].columnKey+s[j].summaryFunction+"$$value$$",val)}}}return ret},_arr:function(key,data){var arr=[],i;for(i=0;i<data.length;i++){arr.push(data[i][key])}return arr},_dataEmpty:function(event,args){var indent=0,indentation=parseInt(this.options.indentation,10),colGroup,headersColGroup;if(args.owner.id()!==this.grid.id()){return}if(this.options.groupedColumns.length>0){indent+=indentation*this.options.groupedColumns.length;if(this.options.indentation&&this.options.indentation.indexOf&&this.options.indentation.indexOf("%")>=0){indent=this.options.indentation}colGroup=args.owner.element.children("colgroup");headersColGroup=this.grid.headersTable().children("colgroup");if(colGroup.children("[data-registeredCol=true]").length===0&&headersColGroup.children("[data-registeredCol=true]").length===0){$("<col />").prependTo(colGroup).attr("data-skip","true").attr("data-registeredCol","true").width(indent)}else{colGroup.children("col:nth-child(1)").width(indent)}}if(this._isgroup!==null&&this._isgroup!==undefined&&parseInt(this.grid.container().width(),10)>0&&!this.grid.options.width){if(this._isgroup===true){if(this.grid.options.virtualization!==true){this.grid.container().width(parseInt(this.grid.container().width(),10)+indentation)}}else{this.grid.container().width(parseInt(this.grid.container().width(),10)-indentation);indentation*=-1}if(this.grid.options.virtualization===true&&this.grid.options.virtualizationMode==="continuous"){this.grid._setDisplayContainerWidth(this.grid._getDisplayContainerWidth()+indentation);this.grid._setVHeadersWidth(this.grid._getVHeadersWidth()+indentation)}this._isgroup=null}this._tbody=args.tbody;if(!this._isgroup&&this.groupByColumns().length>0){this._groupAreaList()}event.stopPropagation()},_checkGroupExists:function(key){var exists=false,i;for(i=0;i<this.options.groupedColumns.length;i++){if(this.options.groupedColumns[i].key===key){exists=true;break}}return exists},_groupBy:function(event,th){var noCancel,key,layout,cgrid,fc,eArgs,exists=false;layout=th.attr("data-layout");if(layout){cgrid=$("#"+th.attr("data-grid-id")).data("igGrid");key=cgrid.options.columns[th.data("columnIndex")].key}else{if(th.data("columnIndex")===null||th.data("columnIndex")===undefined){return}key=this.grid.options.columns[th.data("columnIndex")].key;cgrid=this.grid}fc=this.grid.element.data("igGridFeatureChooser");if(fc!==undefined&&fc!==null){fc._setSelectedState("GroupBy",key,true,false)}if(!layout){exists=this._checkGroupExists(key)}if(exists){return}eArgs={owner:this,groupedColumns:this.options.groupedColumns,key:key,layout:layout,grid:cgrid,triggeredBy:"dragAndDrop"};noCancel=this._trigger(this.events.groupedColumnsChanging,event,eArgs);if(noCancel){this.groupByColumn(key,layout);this._trigger(this.events.groupedColumnsChanged,event,eArgs)}},groupByColumns:function(){var gc=[];if(this._hierarchical){gc=this._orderedGroupedCols}else{gc=this.options.groupedColumns}return gc},_ensureLabelsOrder:function(from,to,layout){var i,key=layout?layout.key:null;for(i=0;i<from.length;i++){if((from[i].layout===key||!from[i].layout&&!key)&&!this._exists(to,from[i])){to.push(from[i])}}for(i=0;layout.columnLayouts&&i<layout.columnLayouts.length;i++){this._ensureLabelsOrder(from,to,layout.columnLayouts[i])}},_exists:function(arr,layout){var i;for(i=0;i<arr.length;i++){if((arr[i].layout===layout.layout||!arr[i].layout&&!layout.layout)&&arr[i].key===layout.key){return true}}return false},_findLayout:function(layout,opts,layouts){var i;if(opts.key===layout){layouts.push(opts)}else if(!layout){layouts.push(this.grid.options)}else{for(i=0;opts.columnLayouts&&i<opts.columnLayouts.length;i++){this._findLayout(layout,opts.columnLayouts[i],layouts)}}},_isGroupColumn:function(key,layout,gc){var i,gcLen=gc.length;for(i=0;i<gcLen;i++){if(gc[i].key===key&&gc[i].layout===layout){return true}}return false},_allGroupedCols:function(gc){var i,j,key,layout,isToAdd;for(i=0;i<this.options.groupedColumns.length;i++){key=this.options.groupedColumns[i].key;layout=this.options.groupedColumns[i].layout;isToAdd=true;for(j=0;j<gc.length;j++){if(key===gc[j].key&&layout===gc[j].layout){this.options.groupedColumns[i]=gc[j];isToAdd=false;break}}if(isToAdd){gc.push(this.options.groupedColumns[i])}}this._addGroupsRecursive(gc,this.grid.options.columnLayouts)},_addGroupsRecursive:function(gc,layouts){var i,j,gb,col,k,persist;if(!layouts){return}for(i=0;i<layouts.length;i++){for(j=0;layouts[i].features&&j<layouts[i].features.length;j++){if(layouts[i].features[j].name==="GroupBy"){gb=layouts[i].features[j];break}}if(gb){persist=gb.persist||this.options.persist;for(j=0;gb.columnSettings&&gb.columnSettings.length&&j<gb.columnSettings.length;j++){if(gb.columnSettings[j].isGroupBy){if(persist&&gb.columnSettings[j].columnKey){if(this._isGroupColumn(gb.columnSettings[j].columnKey,layouts[i].key,gc)){continue}}for(k=0;k<layouts[i].columns.length;k++){if(layouts[i].columns[k].key===gb.columnSettings[j].columnKey||gb.columnSettings[j].columnIndex===k){col=layouts[i].columns[k];break}}gc.push({key:gb.columnSettings[j].columnKey||col.key,layout:layouts[i].key,dir:gb.columnSettings[j].dir,col:col})}}}gb=null;this._addGroupsRecursive(gc,layouts[i].columnLayouts)}},_getColumnByLayoutKey:function(key,columns){var c,i;if(this.grid._isMultiColumnGrid){for(i=0;i<columns.length;i++){if(columns[i].key===key){c=columns[i];break}if(columns[i].group!==undefined&&columns[i].group!==null){c=this._getColumnByLayoutKey(key,columns[i].group);if(c!==undefined&&c!==null){break}}}}else{for(i=0;i<columns.length;i++){if(columns[i].key===key){c=columns[i];break}}}return c},groupByColumn:function(key,layout,sortingDirection){var i,expr,gexpr,lobj,c,fcs,setting,layouts,exists=this._checkGroupExists(key),copy,dir="asc";this.grid._onGroupedColumnsChanging(this.options.groupedColumns);if(sortingDirection!==undefined&&sortingDirection!==null){dir=sortingDirection}else if(this.options.defaultSortingDirection!==undefined){dir=this.options.defaultSortingDirection}if(!layout&&exists){return}if(layout){layouts=[];this._findLayout(layout,this.grid.options,layouts);lobj=layouts[0];c=this._getColumnByLayoutKey(key,lobj.columns)}else{lobj=this.grid.options;c=this.grid.columnByKey(key)}if(layout){if(!lobj.features){lobj.features=[];lobj.features.push({name:"GroupBy",columnSettings:[]});fcs=lobj.features[0].columnSettings}else{for(i=0;i<lobj.features.length;i++){if(lobj.features[i].name==="GroupBy"){fcs=lobj.features[i].columnSettings;if(!fcs){lobj.features[i].columnSettings=[];fcs=lobj.features[i].columnSettings}break}}}for(i=0;i<fcs.length;i++){if(fcs[i].columnKey===key){if(fcs[i].isGroupBy){return}setting=fcs[i];break}}if(!setting){fcs.push({columnKey:key,isGroupBy:true,dir:dir})}else{setting.isGroupBy=true}}expr={fieldName:key,dir:dir,layout:layout,isGroupBy:true};gexpr={key:key,dir:dir,layout:layout,col:c};if(!layout){this.options.groupedColumns.push(gexpr)}this._orderedGroupedCols.push(gexpr);copy=this._orderedGroupedCols.slice(0);this._orderedGroupedCols=[];this._ensureLabelsOrder(copy,this._orderedGroupedCols,this.grid.options);this.grid._trigger("headerExtraCellsModified",null,{owner:this});this._addSortingExpressions(this.grid.dataSource.settings.sorting.expressions,expr);if(!layout){this._isgroup=true}this._rebind();this.grid._onGroupedColumnsChanged(this.options.groupedColumns)},_addSortingExpressions:function(se,expr){var i,seLength=se.length,found=-1,layout=expr.layout,key=expr.fieldName;for(i=0;i<seLength;i++){if(se[i].fieldName===key&&(!layout&&!se[i].layout||layout&&layout===se[i].layout)){if(se[i].isSorting){expr.isSorting=true}se.splice(i,1);break}}seLength=se.length;for(i=0;i<seLength;i++){if(se[i].isGroupBy===true){found=i}else{break}}if(found===-1){se.unshift(expr)}else{se.splice(found+1,0,expr)}},ungroupByColumn:function(key,layout){var i,fc,self=this,exprs=this.grid.dataSource.settings.sorting.expressions,lobj,fcs,layouts,exists=this._checkGroupExists(key),copy;
if(!layout&&!exists){return}this.grid._onGroupedColumnsChanging(this.options.groupedColumns);if(layout){layouts=[];this._findLayout(layout,this.grid.options,layouts);lobj=layouts[0]}else{lobj=this.grid.options}fc=this.grid.element.data("igGridFeatureChooser");if(fc!==undefined&&fc!==null){fc._setSelectedState("GroupBy",key,false,false)}for(i=0;i<lobj.features.length;i++){if(lobj.features[i].name==="GroupBy"){fcs=lobj.features[i].columnSettings;break}}for(i=0;fcs&&i<fcs.length;i++){if(fcs[i].columnKey===key){fcs[i].isGroupBy=false}}if(!layout){for(i=0;i<this.options.groupedColumns.length;i++){if(this.options.groupedColumns[i].key===key){$.ig.removeFromArray(this.options.groupedColumns,i);break}}}for(i=0;i<this._orderedGroupedCols.length;i++){if(this._orderedGroupedCols[i].key===key&&(this._orderedGroupedCols[i].layout&&this._orderedGroupedCols[i].layout===layout||!this._orderedGroupedCols[i].layout&&(layout===""||layout===undefined))){$.ig.removeFromArray(this._orderedGroupedCols,i);break}}for(i=0;i<exprs.length;i++){if(exprs[i].fieldName===key&&(!layout||layout&&layout===exprs[i].layout)){if(exprs[i].isSorting){exprs[i].isGroupBy=undefined}else{$.ig.removeFromArray(exprs,i)}}}copy=this._orderedGroupedCols.slice(0);this._orderedGroupedCols=[];this._ensureLabelsOrder(copy,this._orderedGroupedCols,this.grid.options);this.grid._trigger("headerExtraCellsModified",null,{owner:this});this.grid.element.children("tbody").hide();if(document.documentMode===8){this.grid.element.hide();this.grid.headersTable().hide()}if(!layout&&this.options.groupedColumns.length===0){this.grid.element.find("colgroup").children().first().remove();if(this.grid.options.fixedHeaders){this.grid.headersTable().find("colgroup").children().first().remove()}if(this.grid.options.fixedFooters&&this.grid.options.height!==null){this.grid.footersTable().find("colgroup").children().first().remove()}this.grid.headersTable().find("thead tr").children("[data-skip]").first().remove()}if(!layout){this._isgroup=false}this._rebind();if(document.documentMode===8){this.grid.headersTable().show();this.grid.element.show()}if(this.options.groupedColumns.length===0){if(window.mozInnerScreenX!==undefined&&self.grid.options.fixedFooters===true){self.grid.footersTable().hide();setTimeout(function(){self.grid.footersTable().show()},0)}this._setGroupAreaTextContent($(".ui-iggrid-groupbyarea .ui-iggrid-groupbyareatext",this.grid.container()));if(this.grid.options.width!==null&&this.grid.options.width!==undefined){this.grid._updateGridContentWidth()}}this.grid._onGroupedColumnsChanged(this.options.groupedColumns)},_clearSettings:function(layouts){var i,j,cs,k;for(i=0;i<layouts.length;i++){if(layouts[i].features&&layouts[i].features.length){for(j=0;j<layouts[i].features.length;j++){if(layouts[i].features[j].name==="GroupBy"){cs=layouts[i].features[j].columnSettings;if(cs){for(k=0;k<cs.length;k++){cs[k].isGroupBy=false}}}}}if(layouts[i].columnLayouts){this._clearSettings(layouts[i].columnLayouts)}}},ungroupAll:function(){var indent=0,i,layouts=this.grid.options.columnLayouts,cols=this.groupByColumns(),hasRoot=false;if(cols.length===0){return}this.grid._onGroupedColumnsChanging(this.options.groupedColumns);for(i=1;i<this.options.groupedColumns.length;i++){indent+=parseInt(this.options.indentation,10)}if(parseInt(this.grid.container().width(),10)>0&&!this.grid.options.width){this.grid.container().width(parseInt(this.grid.container().width(),10)-indent)}this.grid.dataSource.settings.sorting.expressions=[];this.options.groupedColumns=[];this._orderedGroupedCols=[];if(!this._hierarchical){cols=[]}else{for(i=0;i<cols.length;i++){if(!cols[i].layout){hasRoot=true;break}}if(hasRoot){cols=[]}}if(layouts){this._clearSettings(layouts)}if(this.options.groupedColumns.length===0&&cols.length===0){this.grid.element.find("colgroup").children().first().remove();if(this.grid.options.fixedHeaders){this.grid.headersTable().find("colgroup").each(function(){$(this).children("[data-skip]").first().remove()})}if(this.grid.options.fixedFooters){this.grid.footersTable().find("colgroup").each(function(){$(this).children("[data-skip]").first().remove()})}this.grid.headersTable().find("thead tr").each(function(){$(this).children("[data-skip]").first().remove()});this.grid.footersTable().find("tfoot tr").each(function(){$(this).children("[data-skip]").first().remove()})}this._isgroup=false;this._rebind();if(this.options.groupedColumns.length===0){if(this.grid.options.width!==null&&this.grid.options.width!==undefined){this.grid._updateGridContentWidth()}}this.grid._onGroupedColumnsChanged([])},_regroup:function(){var items=$(".ui-iggrid-groupbyarea",this.grid.container()).find("ul li"),groupby=this,i,copy,gbObj,eArgs,noCancel,sExprs=[],gbExprs=[];this.options.groupedColumns=[];this.grid.dataSource.settings.sorting.expressions=[];copy=this._orderedGroupedCols.slice(0);this._orderedGroupedCols=[];items.each(function(){var direction,k,layout,c,lobj,layouts=[],sExpr;k=$(this).attr("data-key");layout=$(this).attr("data-layout");direction=$(this).find(".ui-iggrid-asc").length>0?"asc":"desc";if(layout){groupby._findLayout(layout,groupby.grid.options,layouts);lobj=layouts[0];for(i=0;lobj&&i<lobj.columns.length;i++){if(lobj.columns[i].key===k){c=lobj.columns[i];break}}}else{c=groupby.grid.columnByKey(k)}gbObj={key:k,dir:direction,col:c,layout:layout};sExpr={fieldName:k,dir:direction,isGroupBy:true};if(layout){sExpr.layout=layout}gbExprs.push(gbObj);sExprs.push(sExpr)});eArgs={owner:this,groupedColumns:gbExprs,triggeredBy:"regroup"};noCancel=this._trigger(this.events.groupedColumnsChanging,null,eArgs);if(noCancel){for(i=0;i<gbExprs.length;i++){groupby._addSortingExpressions(groupby.grid.dataSource.settings.sorting.expressions,sExprs[i]);groupby._orderedGroupedCols.push(gbExprs[i]);if(!gbExprs[i].layout){groupby.options.groupedColumns.push(gbExprs[i])}}groupby._ensureLabelsOrder(copy,groupby._orderedGroupedCols,groupby.grid.options);this.grid._loadingIndicator.show();this._rebindDataSource();this._trigger(this.events.groupedColumnsChanged,null,eArgs)}},_rebind:function(){this._scrolltop=$(window).scrollTop();this.grid._loadingIndicator.show();this._saveSortingExpressions();this._rebindDataSource();this._groupAreaList()},_rebindDataSource:function(){var ds=this.grid.dataSource;if(this.options.type==="remote"){ds.dataBind()}else{if(ds.settings.sorting.expressions.length===0){this.grid.dataBind()}else{ds.sort(ds.settings.sorting.expressions);this.grid._renderData()}}},_renderPartialRecords:function(parentrow){if(parentrow.attr("data-loaded")){return}var dataRowId,rows,html="",i,rowsLength,scrollerHeight;dataRowId=parseInt(parentrow.attr("data-row-idx"),10);if(dataRowId>=0){rows=this._groups[dataRowId]}if(!rows){return}rowsLength=rows.length;for(i=0;i<rowsLength;i++){html+=rows[i]}$(html).insertAfter(parentrow);scrollerHeight=this.grid._getScrollContainerHeight();this._addScrollHeight=parentrow.outerHeight()*rowsLength;this.grid._setScrollContainerHeight(scrollerHeight+this._addScrollHeight);parentrow.attr("data-loaded",true)},_onKeyDownGroup:function(event){var $target;if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){$target=$(event.target);this._toggleGroup(event);event.preventDefault();event.stopPropagation();$target.focus()}},_toggleGroup:function(event){var parentrow=$(event.target).closest("tr"),grid,i,el,currentLevel,cindex,glevel=parentrow.attr("data-glevel"),grouprow,rowPath=[],level=glevel,style,owner=this;cindex=parentrow.index();if(this._hierarchical){grid=parentrow.closest(".ui-iggrid-table").data("igGrid")}else{grid=this.grid}if(parentrow.attr("data-state")==="expanded"){parentrow.attr("data-state","collapsed").attr("aria-expanded","false").find(".ui-iggrid-expandbutton").attr("title",this.options.expandTooltip).removeClass(this.css.groupByExpandCellExpanded).addClass(this.css.groupByExpandCellCollapsed)}else{parentrow.attr("data-state","expanded").attr("aria-expanded","true").find(".ui-iggrid-expandbutton").attr("title",this.options.collapseTooltip).removeClass(this.css.groupByExpandCellCollapsed).addClass(this.css.groupByExpandCellExpanded);if(!this.options.initialExpand){this._renderPartialRecords(parentrow)}}rowPath[glevel]=parentrow;grid.element.children("tbody").children().each(function(index){if(index>cindex){var $this=$(this);grouprow=$this.attr("data-grouprow");level=$this.attr("data-glevel");if(grouprow==="true"&&level<=glevel){return false}if(grouprow){currentLevel=level}else{currentLevel=parseInt(rowPath[rowPath.length-1].attr("data-glevel"),10)+1}style="";for(i=0;i<currentLevel;i++){if(rowPath[i]!==undefined&&rowPath[i].attr("data-state")!=="expanded"){style="none";break}}$this.css("display",style);if(style!=="none"){owner._expandedRowCount++}else{owner._expandedRowCount--}if(grouprow){rowPath[parseInt($this.attr("data-glevel"),10)]=$this}}});if(this._expandedRowCount>0){this._virtualRowCount=this.grid._determineVirtualRowCount(this._groupedRows,this.grid._getDisplayContainerHeight());this._avgRowHeight=this.grid._calculateAvgRowHeight();this.grid._setScrollContainerHeight(this.grid._getScrollContainerHeight()+this._avgRowHeight*this._expandedRowCount)}else{this._virtualRowCount=this.grid._determineVirtualRowCount(this._groupedRows,this.grid._getDisplayContainerHeight());this._avgRowHeight=this.grid._calculateAvgRowHeight();this.grid._setScrollContainerHeight(this._avgRowHeight*this.grid._getTotalRowCount())}for(el in rowPath){if(rowPath.hasOwnProperty(el)){el=null;$.ig.removeFromArray(rowPath,el)}}this.grid._adjustLastColumnWidth(false);event.stopPropagation()},_groupAreaList:function(){var area=$(".ui-iggrid-groupbyarea",this.grid.container()),layout,allgrouped=[],dropFunc,mousedownFunc,list=area.find("ul"),i,groupby=this,css,key,item,itemEdge,helperFunc,overFunc,outFunc,text;allgrouped=this.groupByColumns();if(list.length>0){list.empty()}else{list=$("<ul></ul>").appendTo(area).addClass("ui-iggrid-grouparealist")}helperFunc=function(event){var li=null;if($(event.target).is("li")){li=$(event.target)}else{li=$(event.target).closest("li")}li=li.clone();li.find(".ui-iggrid-groupbylabelrightedgeend").remove();li.find(".ui-iggrid-groupbylabelrightedge").remove();li.find(".ui-iggrid-groupbyremovebutton").remove();li.attr("data-dragging",true);return li};overFunc=function(event,ui){var $li;if(!ui.draggable.hasClass("ui-iggrid-groupedcolumnlabel")){return false}if(ui.draggable.attr("data-key")===$(this).attr("data-key")){return false}if(groupby._thOver){$li=ui.draggable.closest("ul").find("li[data-key="+groupby._thOver+"]");if($li.length>0&&$li.hasClass("ui-iggrid-groupbydroppableedge")){$li.removeClass("ui-iggrid-groupbydroppableedge")}}groupby._thOver=$(event.target).attr("data-key");$(event.target).addClass("ui-iggrid-groupbydroppableedge")};outFunc=function(event,ui){if(!ui.draggable.hasClass("ui-iggrid-groupedcolumnlabel")){return false}if(ui.draggable.attr("data-key")===$(this).attr("data-key")){return false}$(event.target).removeClass("ui-iggrid-groupbydroppableedge")};dropFunc=function(event,ui){var parent,$dragged,$target;$(this).removeClass("ui-iggrid-groupbydroppableedge");if(!ui.draggable.hasClass("ui-iggrid-groupedcolumnlabel")){return}if(ui.draggable.attr("data-key")!==$(this).attr("data-key")){parent=$(this).closest("ul");$target=$(this);$dragged=ui.draggable;if($dragged.index()>$target.index()){$dragged.insertBefore($target)}else{$dragged.insertAfter($target)}parent.find("li[data-dragging=true]").remove();parent.find("li").removeClass("ui-iggrid-groupbydroppableedge");groupby._regroup();groupby._groupAreaList();event.preventDefault();event.stopPropagation();return false}return};mousedownFunc=function(event){event.preventDefault();event.stopPropagation();return false};for(i=0;i<allgrouped.length;i++){key=allgrouped[i].key;layout=allgrouped[i].layout;text=allgrouped[i].col.headerText;if(allgrouped[i].dir==="asc"){css="ui-iggrid-asc ui-icon ui-icon-arrowthick-1-n"}else{css="ui-iggrid-desc ui-icon ui-icon-arrowthick-1-s"}item=$("<li></li>").appendTo(list).addClass(this.css.groupedColumnLabel).css("float","left").attr("data-key",key).attr("data-layout",layout||"").bind({mouseup:$.proxy(this._changeSortState,this)}).draggable({containment:"body",appendTo:"parent",distance:5,revert:"invalid",helper:helperFunc}).droppable({accept:"li",tolerance:"touch",over:overFunc,out:outFunc,drop:dropFunc});if(this.options.groupByLabelWidth!==null){item.width(this.options.groupByLabelWidth)}itemEdge=$("<span></span>").appendTo(item).css({"float":"right"}).addClass(this.css.groupedColumnLabel).addClass(this.css.groupedColumnLabelRightEdgeEnd);itemEdge.attr("data-marker","edge");item.prev().find("span[data-marker]").removeClass(this.css.groupedColumnLabelRightEdgeEnd).addClass(this.css.groupedColumnLabelRightEdge);if(layout){$("<span></span>").appendTo(item).text(text).addClass(this.css.groupedColumnLabelText);$("<span></span>").prependTo(item).text(layout).addClass(this.css.groupedColumnLayoutLabel)}else{$("<span></span>").appendTo(item).text(text)}$("<span></span>").appendTo(item).addClass(css);if(typeof Modernizr!=="object"||Modernizr.touch===false){$("<span></span>").appendTo(item).addClass("ui-iggrid-groupbyremovebutton").attr("title",groupby.options.removeButtonTooltip).bind({mouseup:$.proxy(groupby._removeButtonClick,groupby),mousedown:mousedownFunc})}if($.ig.util.isIE7&&item.width()>300){item.width(260)}else{item.width(Math.ceil(item.width())+22)}}list.children().bind({mouseover:$.proxy(this._showRemoveButton,this),mouseout:$.proxy(this._hideRemoveButton,this)})},_changeSortState:function(event){var li=$(event.target).closest("li"),key=li.attr("data-key"),i,layout=li.attr("data-layout"),layouts,eArgs,j,gc=this._orderedGroupedCols,s=this.grid.dataSource.settings.sorting.expressions,settings,lobj,noCancel;for(i=0;i<gc.length;i++){if(gc[i].key===key&&(layout&&layout===gc[i].layout||!layout)){if(gc[i].dir==="asc"){gc[i].dir="desc"}else{gc[i].dir="asc"}for(j=0;j<s.length;j++){if(s[j].fieldName===key&&(layout&&layout===s[j].layout||!layout)){s[j].dir=gc[i].dir;break}}eArgs={owner:this,groupedColumns:gc,key:gc[i].key,triggeredBy:"sortStateChanged"};noCancel=this._trigger(this.events.groupedColumnsChanging,event,eArgs);if(noCancel){this._rebind();this._trigger(this.events.groupedColumnsChanged,event,eArgs)}break}}if(layout){layouts=[];this._findLayout(layout,this.grid.options,layouts);lobj=layouts[0];for(i=0;lobj.features&&i<lobj.features.length;i++){if(lobj.features[i].name==="GroupBy"){settings=lobj.features[i].columnSettings;for(j=0;j<settings.length;j++){if(settings[j].columnKey===key){settings[j].dir=settings[j].dir==="asc"?"desc":"asc";break}}break}}this._rebind()}},_showRemoveButton:function(event){var button=$(event.target).closest("li").find(".ui-iggrid-groupbyremovebutton"),key=$(event.target).closest("li").attr("data-key"),layout=$(event.target).closest("li").attr("data-layout");if(!key){return}button.attr("data-key",key).attr("data-layout",layout).addClass("ui-icon ui-icon-circle-close")},_hideRemoveButton:function(event){var button=$(event.target).closest("li").find(".ui-iggrid-groupbyremovebutton");button.removeClass("ui-icon ui-icon-circle-close");$(event.target).closest("li").removeClass("ui-state-hover")},_removeButtonClick:function(event){var key=$(event.target).attr("data-key"),noCancel,layout,eArgs;if(this._isDragging){return}eArgs={owner:this,groupedColumns:this.options.groupedColumns,key:key,triggeredBy:"removeButton"};noCancel=this._trigger(this.events.groupedColumnsChanging,event,eArgs);if(noCancel){layout=$(event.target).attr("data-layout");this.ungroupByColumn(key,layout);this._trigger(this.events.groupedColumnsChanged,event,eArgs)}event.preventDefault();event.stopPropagation();return false},destroy:function(){var modalDialog=$("#"+this.grid.id()+"_groupby_modalDialog");this.grid.container().find(".ui-iggrid-groupbyarea").remove();if(this.grid._initialized){this.ungroupAll()}this._detachEvents(true);modalDialog.igGridModalDialog("getCaptionButtonContainer");modalDialog.remove();$.Widget.prototype.destroy.call(this);return this},_detachEvents:function(isDestroyDraggable){var ths=this.grid.headersTable().find("th"),i;if(isDestroyDraggable===true){for(i=0;i<ths.length;++i){if($(ths[i]).data().draggable){$(ths[i]).draggable("destroy")}}}ths.unbind("mouseover",this._headerMouseOverHandler).unbind("mouseout",this._headerMouseOutHandler);$(document).undelegate("#"+this.grid.id()+"_container td[gbexpandcell=1]","mousedown",this._toggleGroupHandler);$(document).undelegate("#"+this.grid.id()+"_container td[gbexpandcell=1]","keydown",this._onKeyDownGroupHandler);this.grid.element.unbind("iggridheaderrenderedinternal",this._headerRenderedHandler);this.grid.element.unbind("iggriddataempty",this._dataRenderingHandler);this.grid.element.unbind("iggrid_rowsrendering",this._rowsRenderingHandler);this.grid.element.unbind("iggridrowsrendered",this._rowsRenderedHandler);this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.unbind("iggridheadercelldragcancel",this._headerDragCancelHandler);this.grid.element.unbind("iggriduidirty",this._uiDirtyHandler);this.grid.element.unbind("iggriddatabound",this._dataBoundHandler);if(this._columnsCollectionModifiedHandler){this.grid.element.unbind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler)}if(isDestroyDraggable===true){delete this._dataRenderingHandler;delete this._rowsRenderingHandler;delete this._rowsRenderedHandler;delete this._headerCellRenderedHandler;delete this._headerDragCancelHandler;delete this._uiDirtyHandler;delete this._columnsCollectionModifiedHandler}},_initDefaultSettings:function(){var settings=[],key,cs=this.options.columnSettings,i,j,allowGroupBy,isToCheckUnboundColumns=this.grid._hasUnboundColumns===true&&this.options.type==="remote";this._orderedColumnSettings=[];if(this.grid.options.columns&&this.grid.options.columns.length>0){for(i=0;i<this.grid.options.columns.length;i++){allowGroupBy=true;if(isToCheckUnboundColumns&&this.grid.getUnboundColumnByKey(this.grid.options.columns[i].key)!==null){allowGroupBy=false}settings[i]={columnIndex:i,columnKey:this.grid.options.columns[i].key,allowGrouping:allowGroupBy,summaries:[],isGroupBy:false}}}if(settings.length===0&&this.grid.options.autoGenerateColumns&&cs.length>0){for(i=0;i<cs.length;i++){if(!cs[i].columnKey){continue}if(!cs[i].dir){cs[i].dir=this.options.defaultSortingDirection||"asc"}this._orderedColumnSettings.push(cs[i])}}else{for(i=0;i<cs.length;i++){for(j=0;j<settings.length;j++){if(settings[j].columnKey===cs[i].columnKey||settings[j].columnIndex===cs[i].columnIndex){break}}if(j===settings.length){continue}for(key in cs[i]){if(cs[i].hasOwnProperty(key)&&key!=="columnKey"&&key!=="columnIndex"){settings[j][key]=cs[i][key]}}if(settings[j].dir===undefined&&this.options.defaultSortingDirection){settings[j].dir=this.options.defaultSortingDirection}this._orderedColumnSettings.push(settings[j])}}this.options.columnSettings=settings;for(i=0;this.grid._headerInitCallbacks&&i<this.grid._headerInitCallbacks.length;i++){if(this.grid._headerInitCallbacks[i].type==="GroupBy"){$.ig.removeFromArray(this.grid._headerInitCallbacks,i);break}}for(i=0;this.grid._footerInitCallbacks&&i<this.grid._footerInitCallbacks.length;i++){if(this.grid._footerInitCallbacks[i].type==="GroupBy"){$.ig.removeFromArray(this.grid._footerInitCallbacks,i);break}}},_renderExtraFooterCells:function(row,colgroup,prepend){if(this.options.groupedColumns.length>0){if(prepend===true){$("<td></td>").addClass(this.css.footerExtraCell).prependTo(row).attr("data-skip",true)}else{$("<td></td>").addClass(this.css.footerExtraCell).appendTo(row).attr("data-skip",true)}}},_renderExtraHeaderCells:function(row,colgroup,prepend){if(this.options.groupedColumns.length>0){if(prepend===true){$("<td></td>").prependTo(row).addClass(this.css.headerExtraCell).attr("data-skip",true);if(colgroup){$("<col />").prependTo(colgroup).attr("data-skip",true).css("width",this.options.indentation)}}else{$("<td></td>").appendTo(row).addClass(this.css.headerExtraCell).attr("data-skip",true);if(colgroup){$("<col />").appendTo(colgroup).attr("data-skip",true).css("width",this.options.indentation)}}}},_columnsCollectionModified:function(event,args){var colGroup;if(args.owner.id()!==this.grid.id()){return}args.tbody=this.grid.element.children("tbody");if(this.options.groupedColumns.length>0){colGroup=this.grid.headersTable().children("colgroup");if(colGroup.children("[data-registeredCol=true]").length===0){$("<col />").prependTo(colGroup).attr("data-skip","true").attr("data-registeredCol","true").width(this._indent)}else{colGroup.children("col:nth-child(1)").width(this._indent)}if(this.grid.headersTable().attr("id")!==this.grid.element.attr("id")){$("<col />").prependTo(this.grid.element.children("colgroup")).attr("data-skip","true").width(this._indent)}if(this.grid.footersTable().attr("id")!==this.grid.element.attr("id")){$("<col />").prependTo(this.grid.footersTable().children("colgroup")).attr("data-skip","true").width(this._indent)}if(this.grid.options.width===null){this.grid._setContainerWidth(this.grid.container())}else{this.grid._updateGridContentWidth()}}this._dataEmpty(event,args)},_onUIDirty:function(){if(this.options.persist){return}this.ungroupAll()},_saveSortingExpressions:function(){if(this.options.persist){this.grid._savePersistenceData(this.grid.dataSource.settings.sorting.expressions,"sorting");this._groupedColumns=this._orderedGroupedCols;this._optionsGC=this.options.groupedColumns}},_getSortingExpressions:function(){return this.grid._getPersistenceData("sorting")},_restoreGroupBy:function(){var se=this._getSortingExpressions(),col,layouts,lobj,i,key;if(this._groupedColumns){this._orderedGroupedCols=this._groupedColumns}if(this._optionsGC){this.options.groupedColumns=this._optionsGC;if(this.grid._hasUnboundColumns&&this.options.type==="local"){for(i=0;i<this._optionsGC.length;i++){key=this._optionsGC[i].key;if(this._optionsGC[i].layout){layouts=[];this._findLayout(this._optionsGC[i].layout,this.grid.options,layouts);lobj=layouts[0];col=this._getColumnByLayoutKey(key,lobj.columns)}else{col=this.grid.columnByKey(key)}if(col&&col.unbound){this.ungroupByColumn(key,this._optionsGC[i].layout)}}}}if(se){this.grid.dataSource.settings.sorting.expressions=se;this.grid.dataSource.settings.sorting.defaultFields=se}},_onDataBound:function(){if(this.options.groupedColumns.length>0&&this.grid._isDataBoundCalled){this.grid._trigger("headerExtraCellsModified",null,{owner:this})}},_injectGrid:function(gridInstance){var i,gc,gcsort,s,root=null,orderedGrouped=null,layoutGrouped=null;this.grid=gridInstance;this._checkGridNotSupportedFeatures();if(this.options.type===null){this.options.type=this.grid._inferOpType()}root=this.element.closest(".ui-iggrid-root");if(this.options.persist&&this.options.type==="remote"&&root.data("igGrid")){this.options.persist=false}if(root.is("div")){root=root.find("#"+root.attr("id")+"_table")}root=root.data("igGridGroupBy");if(root){orderedGrouped=root._orderedGroupedCols;if(orderedGrouped&&orderedGrouped.length>0&&this.grid.options.key){layoutGrouped=[];for(i=0;i<orderedGrouped.length;i++){if(this.grid.options.key===orderedGrouped[i].layout){layoutGrouped.push(orderedGrouped[i])}}}}for(i=0;i<this.grid.options.features.length;i++){if(this.grid.options.features[i].name==="ColumnMoving"){this._movingEnabled=true;break}}this._dataBoundHandler=$.proxy(this._onDataBound,this);this._headerRenderedHandler=$.proxy(this._headerRendered,this);this._dataRenderingHandler=$.proxy(this._dataEmpty,this);this._toggleGroupHandler=$.proxy(this._toggleGroup,this);this._onKeyDownGroupHandler=$.proxy(this._onKeyDownGroup,this);this._rowsRenderingHandler=$.proxy(this._renderRecords,this);this._rowsRenderedHandler=$.proxy(this._recordsRendered,this);this._headerCellRenderedHandler=$.proxy(this._headerCellRendered,this);this._headerDragCancelHandler=$.proxy(this._headerCellDragCancel,this);if(this.grid.options.virtualization===true&&this.grid.options.virtualizationMode==="continuous"){this._rebuildVirtualRowsHandler=$.proxy(this._rebuildVirtualRows,this);this.grid.element.bind("iggridrebuildingvirtualrows",this._rebuildVirtualRowsHandler);this.grid._getTotalRowsCount=$.proxy(this._getTotalRowsCount,this)}this._getLastVisibleDataRecordIndexHandler=$.proxy(this.grid._getLastVisibleDataRecordIndex,this.grid);this.grid._getLastVisibleDataRecordIndex=$.proxy(this._getLastVisibleDataRecordIndex,this);if(!this._calculateAvgRowHeightHandler){this._calculateAvgRowHeightHandler=$.proxy(this.grid._calculateAvgRowHeight,this.grid);this.grid._calculateAvgRowHeight=$.proxy(this._calculateAvgRowHeight,this)}if(!this._getTotalRowCountHandler){this._getTotalRowCountHandler=$.proxy(this.grid._getTotalRowCount,this.grid);this.grid._getTotalRowCount=$.proxy(this._getTotalRowCount,this)}this._detachEvents();this.grid.element.bind("iggridheaderrenderedinternal",this._headerRenderedHandler);this.grid.element.bind("iggriddataempty",this._dataRenderingHandler);this.grid.element.bind("iggrid_rowsrendering",this._rowsRenderingHandler);this.grid.element.bind("iggridrowsrendered",this._rowsRenderedHandler);this.grid.element.bind("iggridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.bind("iggriddatabound",this._dataBoundHandler);this.grid.element.bind("iggridheadercelldragcancel",this._headerDragCancelHandler);this._headerMouseOverHandler=function(event){$(event.currentTarget).addClass("ui-state-hover")};this._headerMouseOutHandler=function(event){$(event.currentTarget).removeClass("ui-state-hover")};this.grid.dataSource.settings.sorting.sortUrlKey=this.options.groupByUrlKey;this.grid.dataSource.settings.sorting.sortUrlAscValueKey=this.options.groupByUrlKeyAscValue;this.grid.dataSource.settings.sorting.sortUrlDescValueKey=this.options.groupByUrlKeyDescValue;if(this.options.type){this.grid.dataSource.settings.sorting.type=this.options.type}else{this.grid.dataSource.settings.sorting.type="remote"}this.grid.dataSource.settings.encodeExtraParams=$.proxy(this._encodeSummaryParams,this);this._initDefaultSettings();this.options.groupedColumns=[];if(!this.grid.options.key&&(layoutGrouped===null||layoutGrouped.length===0)){for(i=0;i<this._orderedColumnSettings.length;i++){if(this._orderedColumnSettings[i].isGroupBy){s=this._orderedColumnSettings[i];gc={key:s.columnKey,dir:s.dir||"asc",col:this.grid.columnByKey(s.columnKey)};this.options.groupedColumns.push(gc);gcsort={fieldName:s.columnKey,dir:s.dir||"asc",layout:this.grid.options.key,isGroupBy:true};if(this.options.type==="local"){gcsort.layout=null;this.grid.dataSource.settings.sorting.defaultFields.push(gcsort)}this._addSortingExpressions(this.grid.dataSource.settings.sorting.expressions,gcsort)}}}else{for(i=0;layoutGrouped!==null&&i<layoutGrouped.length;i++){this.options.groupedColumns.push(layoutGrouped[i]);gcsort={fieldName:layoutGrouped[i].key,dir:layoutGrouped[i].dir||"asc",layout:this.grid.options.key,isGroupBy:true};if(this.options.type==="local"){gcsort.layout=null;this.grid.dataSource.settings.sorting.defaultFields.push(gcsort)}this._addSortingExpressions(this.grid.dataSource.settings.sorting.expressions,gcsort)}}if(this.grid.element.closest(".ui-iggrid-root").length===0||this.grid.element.hasClass("ui-iggrid-root")||this.grid._isWrapped){$(document).delegate("#"+this.grid.id()+"_container td[gbexpandcell=1]","mousedown",this._toggleGroupHandler);$(document).delegate("#"+this.grid.id()+"_container td[gbexpandcell=1]","keydown",this._onKeyDownGroupHandler)}this._renderExtraHeaderCellHandler=$.proxy(this._renderExtraHeaderCells,this);this._renderExtraFooterCellHandler=$.proxy(this._renderExtraFooterCells,this);this.grid._headerInitCallbacks.push({type:"GroupBy",func:this._renderExtraHeaderCellHandler});this.grid._footerInitCallbacks.push({type:"GroupBy",func:this._renderExtraFooterCellHandler});this._columnsCollectionModifiedHandler=$.proxy(this._columnsCollectionModified,this);this.grid.element.bind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler);this._uiDirtyHandler=$.proxy(this._onUIDirty,this);this.grid.element.bind("iggriduidirty",this._uiDirtyHandler);if(this.grid.element.igGridFeatureChooser!==undefined){this.grid.element.igGridFeatureChooser()}this._hierarchical=this.grid._isHierarchicalGrid;if(this.options.persist){this._restoreGroupBy()}this._allGroupedCols(this._orderedGroupedCols)},_tokenizeTBody:function(html){var start=0,trTokens=[],index=0,begin,end,tr;while(true){begin=html.indexOf("<tr",start);end=html.indexOf("</tr>",start);if(begin===-1||end===-1){break}tr=html.substr(begin,end+5-begin);tr=tr.substr(0,3)+' data-row-idx="'+index++ +'" '+tr.substr(3);trTokens.push(tr);if(end+5<html.length-1){start=end+5}else{break}}return trTokens},_determineVirtualRowCount:function(allRows,displayContainerHeight){var div,rowNumber,rows,i,height,avgRowHeight,rowsPerPage,result;div=$("<div></div>)").appendTo("body").css({position:"absolute",top:-1800,left:-1800,visibility:"hidden"});rowNumber=allRows.length>10?10:allRows.length;rows="";for(i=0;i<rowNumber;i++){rows+=allRows[i]}div.html(rows);height=div.height();avgRowHeight=height/rowNumber;rowsPerPage=displayContainerHeight/avgRowHeight;result=Math.ceil(rowsPerPage*3);div.remove();return result},_getTotalRowsCount:function(){if(this.options.groupedColumns.length>0&&this._groupedRows){if(!this.options.initialExpand&&this._getTotalRowCountHandler){return this._countGroupedRows}return this._groupedRows.length}return this.grid.dataSource.dataView().length},_renderInitiallyCollapsedRows:function(startIndex,endIndex){var i=0,index=0,tbodyHtml="",tr;if(endIndex>this._visibleGroupedRows.length){endIndex=this._visibleGroupedRows.length;startIndex=endIndex-this._virtualRowCount}if(startIndex<0){startIndex=0}for(i=startIndex;i<endIndex;i++){tbodyHtml+=this._visibleGroupedRows[i];index=this._visibleRowIndexes[i]+1;if(index>this._groupedRows.length-1){index=this._groupedRows.length-1}tr=this._groupedRows[index];while(tr!==null&&tr!==undefined&&tr.indexOf("display:none")>-1&&tr.indexOf("data-grouprow")>-1){tbodyHtml+=tr;index++;tr=this._groupedRows[index]}}return tbodyHtml},_getLastVisibleDataRecordIndex:function(){if(this.options.groupedColumns.length>0){if(!this.options.initialExpand){return this._visibleRowIndexes[this._visibleRowIndexes.length-1]}return this._groupedRows.length}return this.grid.dataSource.dataView().length},_rebuildVirtualRows:function(event,args){var scrollData,scrollResult,virtualScrollerY,deltaScroll,tableId,noCancel,visibleArea,tbody,expandedRowsHeight,trs,i,scrollerHeight,firstVisibleTR,firstVisibleTRRelativeOffset,startIndexToBeLoaded,dataRowIndexToBeFirst,endIndexToBeLoaded,hasOverflow,tr,lastVisibleTR,lastVisibleTRIndex,firstVisibleTRIndex,rowsHtml,newFirstVisibleRow,start,end,displayContainerScrollTop,avgRowHeight,maxScrollPos;if(args.owner.id()!==this.grid.id()){return}if(this.options.groupedColumns.length===0){return true}scrollData=args.scrollData;scrollResult=args.scrollResult;virtualScrollerY=scrollData.virtualScrollerY;deltaScroll=scrollData.deltaScroll;tableId="#"+this.element[0].id;visibleArea=scrollData.visibleArea;tbody=$(tableId+" > tbody");expandedRowsHeight=0;tableId="#"+this.element[0].id;trs=$(tableId+" > tbody > tr[data-container='true']");for(i=0;i<trs.length;i++){expandedRowsHeight+=$(trs[i]).outerHeight()}if(expandedRowsHeight>0){scrollerHeight=this.grid._getScrollContainerHeight();this.grid._setScrollContainerHeight(scrollerHeight-expandedRowsHeight)}if(deltaScroll>0&&scrollResult.action==="SA_NEED_NEXT_PAGE"){firstVisibleTR=this.grid._getFirstVisibleTR(visibleArea);firstVisibleTRRelativeOffset=Math.abs(firstVisibleTR[0].offsetTop-visibleArea.top);startIndexToBeLoaded=parseInt(firstVisibleTR.attr("data-row-idx"),0);dataRowIndexToBeFirst=startIndexToBeLoaded;endIndexToBeLoaded=parseInt(this._virtualRowCount,0)+startIndexToBeLoaded-1;hasOverflow=false;if(endIndexToBeLoaded>this._groupedRows.length-1){endIndexToBeLoaded=this._groupedRows.length-1;
startIndexToBeLoaded=endIndexToBeLoaded-this._virtualRowCount+1;hasOverflow=true}noCancel=this.grid._trigger(this.grid.events.rowsRendering,null,{owner:this.grid,tbody:tbody,vrtWnd:{calledFromGroupBy:true,start:startIndexToBeLoaded,end:endIndexToBeLoaded}});if(noCancel){tbody.empty();rowsHtml="";if(this.options.initialExpand){for(i=startIndexToBeLoaded;i<=endIndexToBeLoaded;i++){rowsHtml+=this._groupedRows[i]}}else{startIndexToBeLoaded=this._visibleRowIndexes.indexOf(parseInt(firstVisibleTR.attr("data-row-idx"),0));endIndexToBeLoaded=startIndexToBeLoaded+this._virtualRowCount;rowsHtml=this._renderInitiallyCollapsedRows(startIndexToBeLoaded,endIndexToBeLoaded)}tbody.html(rowsHtml);if(hasOverflow){tr=$(tableId+" > tbody > tr[data-row-idx='"+dataRowIndexToBeFirst+"']");firstVisibleTRRelativeOffset=tr[0].offsetTop+firstVisibleTRRelativeOffset}this.grid._setDisplayContainerScrollTop(firstVisibleTRRelativeOffset+deltaScroll)}}if(deltaScroll<0&&!this.options.initialExpand){scrollResult.action="SA_NEED_SOME_PAGE"}if(deltaScroll<0&&scrollResult.action==="SA_NEED_PREV_PAGE"){lastVisibleTR=this.grid._getLastVisibleTR(visibleArea);lastVisibleTRIndex=parseInt(lastVisibleTR.attr("data-row-idx"),0);firstVisibleTR=this.grid._getFirstVisibleTR(visibleArea);firstVisibleTRIndex=parseInt(firstVisibleTR.attr("data-row-idx"),0);endIndexToBeLoaded=lastVisibleTRIndex;startIndexToBeLoaded=endIndexToBeLoaded-parseInt(this._virtualRowCount,0)+1;if(startIndexToBeLoaded<0){startIndexToBeLoaded=0;endIndexToBeLoaded=startIndexToBeLoaded+this._virtualRowCount-1}noCancel=this.grid._trigger(this.grid.events.rowsRendering,null,{owner:this.grid,tbody:tbody,vrtWnd:{calledFromGroupBy:true,start:startIndexToBeLoaded,end:endIndexToBeLoaded}});if(noCancel){tbody.empty();rowsHtml="";for(i=startIndexToBeLoaded;i<=endIndexToBeLoaded;i++){rowsHtml+=this._groupedRows[i]}tbody.html(rowsHtml);tableId="#"+this.element[0].id;newFirstVisibleRow=$(tableId+' > tbody > tr[data-row-idx="'+firstVisibleTRIndex+'"]');this.grid._setDisplayContainerScrollTop(newFirstVisibleRow[0].offsetTop+deltaScroll)}}if(scrollResult.action==="SA_NEED_SOME_PAGE"){start=Math.floor(virtualScrollerY/this._avgRowHeight);end=start+this._virtualRowCount-1;if(start<0){start=0;end=start+this._virtualRowCount-1}if(end>=this._groupedRows.length-1){end=this._groupedRows.length-1;start=end-this._virtualRowCount+1}noCancel=this.grid._trigger(this.grid.events.rowsRendering,null,{owner:this.grid,tbody:tbody,vrtWnd:{calledFromGroupBy:true,start:start,end:end}});if(noCancel){tbody.empty();rowsHtml="";if(this.options.initialExpand){for(i=start;i<=end;i++){rowsHtml+=this._groupedRows[i]}}else{rowsHtml=this._renderInitiallyCollapsedRows(start,end)}tbody.html(rowsHtml);displayContainerScrollTop=0;maxScrollPos=this.grid._getScrollContainerHeight()-this.grid._getDisplayContainerHeight();if(maxScrollPos-3<=virtualScrollerY&&virtualScrollerY<=maxScrollPos+3){displayContainerScrollTop=1e4}if(!this.grid._persistVirtualScrollTop||displayContainerScrollTop!==0){this.grid._setDisplayContainerScrollTop(displayContainerScrollTop)}}}if(this._addScrollHeight&&this.options.initialExpand){scrollerHeight=this.grid._getScrollContainerHeight();this.grid._setScrollContainerHeight(scrollerHeight-this._addScrollHeight);this.grid.element.height("")}avgRowHeight=this.grid._calculateAvgRowHeight();if(avgRowHeight>this._avgRowHeight){this._avgRowHeight=avgRowHeight}if(this._expandedRowCount>0){this._expandedRowCount=0;this._avgRowHeight=avgRowHeight}this.grid._setScrollContainerHeight(this._avgRowHeight*this.grid._getTotalRowCount());if(noCancel){this.grid._trigger(this.grid.events.rowsRendered,null,{owner:this.grid,tbody:tbody,calledFromGroupBy:true})}return false},_checkGridNotSupportedFeatures:function(){var gridOptions=this.grid.options;if((gridOptions.virtualization===true||gridOptions.rowVirtualization===true||gridOptions.columnVirtualization===true)&&gridOptions.virtualizationMode==="fixed"){throw new Error($.ig.GridGroupBy.locale.fixedVirualizationNotSupported)}}});$.extend($.ui.igGridGroupBy,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Column Hiding 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 *	infragistics.ui.grid.shared.js
 *	infragistics.ui.grid.featurechooser.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igGridHiding",{options:{columnSettings:[{columnKey:null,columnIndex:null,allowHiding:true,hidden:false}],hiddenColumnIndicatorHeaderWidth:7,columnChooserContainment:"owner",columnChooserWidth:350,columnChooserHeight:"",dropDownAnimationDuration:500,columnChooserCaptionText:$.ig.GridHiding.locale.columnChooserCaptionLabel,columnChooserDisplayText:$.ig.GridHiding.locale.columnChooserDisplayText,hiddenColumnIndicatorTooltipText:$.ig.GridHiding.locale.hiddenColumnIndicatorTooltipText,columnHideText:$.ig.GridHiding.locale.columnHideText,columnChooserShowText:$.ig.GridHiding.locale.columnChooserShowText,columnChooserHideText:$.ig.GridHiding.locale.columnChooserHideText,columnChooserHideOnClick:false,columnChooserResetButtonLabel:$.ig.GridHiding.locale.columnChooserResetButtonLabel,columnChooserAnimationDuration:200,columnChooserButtonApplyText:$.ig.GridHiding.locale.columnChooserButtonApplyText,columnChooserButtonCancelText:$.ig.GridHiding.locale.columnChooserButtonCancelText,inherit:false},css:{columnChooser:"ui-dialog ui-draggable ui-resizable ui-iggrid-dialog ui-widget ui-widget-content ui-corner-all",columnChooserHeaderCaption:"ui-dialog-titlebar ui-iggrid-columnchooser-caption ui-widget-header ui-corner-top ui-helper-reset ui-helper-clearfix",columnChooserHeaderCaptionTitle:"ui-dialog-title ui-iggrid-columnchooser-caption-title",columnChooserContent:"ui-dialog-content ui-iggrid-columnchooser-content",hidingHeaderIndicator:"ui-iggrid-hiding-indicator",columnChooserHandleBar:"ui-iggrid-columnchooser-handlebar",hiddenColumnIndicator:"ui-iggrid-hiding-hiddencolumnindicator",hiddenColumnIndicatorSelected:"ui-iggrid-hiding-indicator-selected",hiddenColumnIndicatorMouseOver:"ui-iggrid-hiding-indicator-mouseover",hiddenColumnsDropDown:"ui-iggrid-hiding-dropdown-dialog ui-widget ui-widget-content ui-corner-all",hiddenColumnsDropDownList:"ui-iggrid-hiding-dropdown-list ui-menu",hiddenColumnsDropDownItem:"ui-iggrid-hiding-dropdown-ddlistitemicons ui-state-default",hiddenColumnsDropDownItemHover:"ui-iggrid-hiding-dropdown-listitem-hover ui-state-active ui-state-hover",hiddenColumnsDropDownItemText:"ui-iggrid-hiding-dropdown-ddlistitemtext",columnChooserListItems:"ui-iggrid-columnchooser-listitems",columnChooserItem:"ui-iggrid-columnchooser-item ui-widget-content",columnChooserItemHidden:"ui-iggrid-columnchooser-itemhidden",columnChooserHideButton:"ui-iggrid-columnchooser-hidebutton",columnChooserItemText:"ui-iggrid-dialog-text",featureChooserHidingIcon:"ui-icon ui-iggrid-icon-hide",featureChooserModalDialogIcon:"ui-icon ui-iggrid-icon-column-chooser"},events:{columnHiding:"columnHiding",columnHidingRefused:"columnHidingRefused",columnShowingRefused:"columnShowingRefused",multiColumnHiding:"multiColumnHiding",columnHidden:"columnHidden",columnShowing:"columnShowing",columnShown:"columnShown",columnChooserOpening:"columnChooserOpening",columnChooserOpened:"columnChooserOpened",columnChooserMoving:"columnChooserMoving",columnChooserClosing:"columnChooserClosing",columnChooserClosed:"columnChooserClosed",columnChooserContentsRendering:"columnChooserContentsRendering",columnChooserContentsRendered:"columnChooserContentsRendered",columnChooserButtonApplyClick:"columnChooserButtonApplyClick",columnChooserButtonResetClick:"columnChooserButtonResetClick"},renderInFeatureChooser:true,_headerHashDataKey:"igGrid-hiding-hash",_createWidget:function(){this.options.columnSettings=[];$.Widget.prototype._createWidget.apply(this,arguments)},_setOption:function(key){throw new Error($.ig.Grid.locale.optionChangeNotSupported.replace("{optionName}",key))},destroy:function(){var fc,self=this,modalDialog=$("#"+this.grid.id()+"_hiding_modalDialog");this.grid.element.unbind(".hiding");this.grid.headersTable().find("thead > tr > th").not("[data-skip=true]").each(function(){var th=$(this);th.find("a[data-hiding-indicator=true]").remove();self._clearHiddenColumnIndicator(true,th);self._clearHiddenColumnIndicator(false,th)});$("div[data-hiding-inddropdown='"+this.grid.id()+"']").remove();this._detachEvents();modalDialog.igGridModalDialog("getCaptionButtonContainer");modalDialog.remove();fc=this.grid.element.data("igGridFeatureChooser");if(fc&&this.renderInFeatureChooser){fc._removeFeature("Hiding");fc._removeFeature("ColumnChooser")}$.Widget.prototype.destroy.call(this);return this},showColumnChooser:function(){this._openColumnChooser(false)},hideColumnChooser:function(){this._closeColumnChooser(false)},showColumn:function(column,isMultiColumnHeader,callback){var i,colToShow,len,arrIds=[];if(isMultiColumnHeader===true){colToShow=this.grid._getMultiHeaderColumnById(column);if(colToShow===null){return}len=colToShow.children.length;for(i=0;i<len;i++){arrIds.push(colToShow.children[i].key)}this.showMultiColumns(arrIds,callback);colToShow.hidden=false;colToShow.colspan=len}else{this.grid.showColumn(column,callback)}},hideColumn:function(column,isMultiColumnHeader,callback){var i,colToHide,len,arrIds=[];if(isMultiColumnHeader===true){colToHide=this.grid._getMultiHeaderColumnById(column);if(colToHide===null){return}len=colToHide.children.length;for(i=0;i<len;i++){arrIds.push(colToHide.children[i].key)}this.hideMultiColumns(arrIds,callback);colToHide.hidden=true;colToHide.colspan=0}else{this.grid.hideColumn(column,callback)}},hideMultiColumns:function(columns,callback){this._setHiddenMultipleColumns([],columns,false,callback)},showMultiColumns:function(columns,callback){this._setHiddenMultipleColumns(columns,[],false,callback)},_showColumnFromUI:function(column){var columnKey,columnIndex,noCancel,self=this;if(typeof column==="number"){columnIndex=column}else{columnKey=column}noCancel=this._trigger(this.events.columnShowing,null,{owner:this,columnKey:columnKey,columnIndex:columnIndex});if(!this.grid._isShowingAllowed([column])){this._trigger(this.events.columnShowingRefused,null,{owner:this,columnKeys:[columnKey]});return false}if(noCancel){self.grid._loadingIndicator.show();setTimeout(function(){self.grid._setHidden(column,false);self._trigger(self.events.columnShown,null,{owner:self,columnKey:columnKey,columnIndex:columnIndex});self.grid._loadingIndicator.hide()},0)}return noCancel},_setHiddenMultipleColumns:function(columnsToShow,columnsToHide,callEvents,callback){var self=this,columnKey,columnIndex;self.grid._loadingIndicator.show();setTimeout(function(){var i,column,noCancel,cols=[],c;for(i=0;i<columnsToShow.length;i++){column=columnsToShow[i];if(typeof column==="number"){columnIndex=column}else{columnKey=column}noCancel=true;if(callEvents){noCancel=self._trigger(self.events.columnShowing,null,{owner:self,columnKey:columnKey,columnIndex:columnIndex})}if(noCancel){c=self.grid._setHidden(column,false);if(callEvents){self._trigger(self.events.columnShown,null,{owner:self,columnKey:columnKey,columnIndex:columnIndex})}if(c){cols.push(c)}}}for(i=0;i<columnsToHide.length;i++){column=columnsToHide[i];if(self.grid._visibleColumns().length===1){break}if(typeof column==="number"){columnIndex=column}else{columnKey=column}noCancel=true;if(callEvents){noCancel=self._trigger(self.events.columnHiding,null,{owner:self,columnKey:columnKey,columnIndex:columnIndex})}if(noCancel){c=self.grid._setHidden(column,true);if(callEvents){self._trigger(self.events.columnHidden,null,{owner:self,columnKey:columnKey,columnIndex:columnIndex})}if(c){cols.push(c)}}}self.grid._loadingIndicator.hide();if(callback){$.ig.util.invokeCallback(callback,[cols,columnsToShow.length===0])}},0)},_hideMultiColumnFromUI:function(id){var i,self=this,grid=this.grid,column,children,columnKey,childrenLength,noCancel,visibleChildrenLength=0,columnKeysToHide=[],columnKeysHidden=[];if(grid._visibleColumns().length===1){return false}column=grid._getMultiHeaderColumnById(id);if(column===null){return}children=column.children;childrenLength=children.length;for(i=0;i<childrenLength;i++){if(!children[i].hidden){visibleChildrenLength++}}if(grid._visibleColumns().length-visibleChildrenLength<1){return false}for(i=0;i<childrenLength;i++){columnKeysToHide.push(children[i].key)}if(!grid._isHidingAllowed(columnKeysToHide)){this._trigger(this.events.columnHidingRefused,null,{owner:this,columnKeys:columnKeysToHide});return false}noCancel=this._trigger(this.events.multiColumnHiding,null,{owner:this,columnKeys:columnKeysToHide});if(noCancel){grid._loadingIndicator.show();setTimeout(function(){for(i=0;i<childrenLength;i++){columnKey=columnKeysToHide[i];noCancel=self._trigger(self.events.columnHiding,null,{owner:self,columnKey:columnKey,columnIndex:undefined});if(noCancel){if(children[i].allowHiding&&!children[i].hidden){grid._setHidden(columnKey,true);columnKeysHidden.push(columnKey);self._trigger(self.events.columnHidden,null,{owner:self,columnKey:columnKey,columnIndex:undefined})}}}if($.ig.util.isFF&&(grid.options.width===null||typeof grid.options.width==="string"&&grid.options.width.indexOf("%")!==-1)){grid._refreshUI()}column.hidden=true;column.colspan=0;grid._loadingIndicator.hide();self._trigger(self.events.multiColumnHidden,null,{owner:self,columnKeys:columnKeysHidden})},0)}},_columnFixed:function(){this._renderHiddenColumnIndicators()},_hideColumnFromUI:function(column){var self=this,columnKey,columnIndex,noCancel;if(self.grid._visibleColumns().length===1){return false}if(typeof column==="number"){columnIndex=column}else{columnKey=column}if(!this.grid._isHidingAllowed([column])){this._trigger(this.events.columnHidingRefused,null,{owner:this,columnKeys:[columnKey]});return}noCancel=this._trigger(this.events.columnHiding,null,{owner:this,columnKey:columnKey,columnIndex:columnIndex});if(noCancel){if(!self.grid._allColumnWidthsInPixels&&$.ig.util.isFF){self.grid._refreshUI()}self.grid._loadingIndicator.show();setTimeout(function(){self.grid._setHidden(column,true);self._trigger(self.events.columnHidden,null,{owner:self,columnKey:columnKey,columnIndex:columnIndex});self.grid._loadingIndicator.hide()},0)}return noCancel},_headerCellRendered:function(event,ui){if(ui.owner.element.attr("id")!==this.grid.element.attr("id")){return}if(ui.isMultiColumnHeader===true){return}var i,col,featureChooserInstance=this.grid.element.data("igGridFeatureChooser");if(!this._featureChooserInitialized&&featureChooserInstance&&this.renderInFeatureChooser){this._featureChooserInitialized=true;this._hidingIconColumnKeys=[];for(i=0;i<this.grid.options.columns.length;i++){col=this.grid.options.columns[i];if(this._getColumnSettingsByIndex(i).allowHiding){if(featureChooserInstance._shouldRenderInFeatureChooser(col.key)===true){featureChooserInstance._renderInFeatureChooser(col.key,{name:"Hiding",text:this.options.columnHideText,iconClass:this.css.featureChooserHidingIcon,isSelectable:false,isSelected:false,method:$.proxy(this._featureChooserHide,this),updateOnClickAll:false,groupName:"click",groupOrder:2,order:2});featureChooserInstance._renderInFeatureChooser(col.key,{name:"ColumnChooser",text:this.options.columnChooserDisplayText,iconClass:this.css.featureChooserModalDialogIcon,method:$.proxy(this._featureChooserColumnChooser,this),groupName:"modaldialog",groupOrder:3,order:1})}else{this._hidingIconColumnKeys.push(col.key)}}}}},_featureChooserHide:function(event,columnKey){this._closeColumnChooser(true);this._hideColumnFromUI(columnKey)},_featureChooserColumnChooser:function(){this._openColumnChooser(true)},_columnMap:function(){var self=this;return $.map(this.grid.options.columns,function(col,index){return{columnKey:col.key,enabled:self._getColumnSettingsByIndex(index).allowHiding}})},_renderHidingColumnIcon:function(th,columnKey,isMultiColumnHeader){var self=this,$a,indicatorContainer=th.find(".ui-iggrid-indicatorcontainer");if(indicatorContainer.length===0){indicatorContainer=$("<div></div>").addClass("ui-iggrid-indicatorcontainer").appendTo(th)}$a=$("<a></a>").css("display","inline").attr("data-hiding-indicator","true").attr("href","#").attr("title",$.ig.GridHiding.locale.hideColumnIconTooltip).bind("keydown.hiding",function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){if(isMultiColumnHeader){self._hideMultiColumnFromUI(th.attr("data-mch-id"))}else{self._hideColumnFromUI(columnKey)}event.preventDefault();event.stopPropagation()}});$("<span>&laquo;</span>").addClass(this.css.hidingHeaderIndicator).appendTo(indicatorContainer).wrap($a).bind("click.hiding",function(event){$(this).parent().mouseout();self._closeColumnChooser(true);if(isMultiColumnHeader){self._hideMultiColumnFromUI(th.attr("data-mch-id"))}else{self._hideColumnFromUI(columnKey)}event.preventDefault();event.stopPropagation()});this.grid._enableHeaderCellFeature(th)},_populateMultiColumnHeadersLevel0:function(){var i,j,self=this,cols=this.grid._oldCols,colsLength=cols.length,ths=$(this.grid._headerCells),level0=[],level0Length,visibleColumns=this.grid._visibleColumns();for(i=0;i<colsLength;i++){if(cols[i].level===0){level0.push(cols[i])}else{for(j=0;j<cols[i].children.length;j++){level0.push(cols[i].children[j])}}}level0Length=level0.length;ths.each(function(index){var th=$(this),col=visibleColumns[index],cs;if(col===null||col===undefined){return true}cs=self._getColumnSettingsByKey(col.key);if(cs.allowHiding){for(i=0;i<level0.length;i++){if(level0[i].key===col.key){break}}if(i<level0Length){level0[i].allowHiding=true;level0[i].visibleIndex=index;level0[i].settings=cs}th.col=level0[i]}})},_renderHidingIcons:function(){var thsMultiHeader,self=this,ths;if(self.grid._isMultiColumnGrid===true){thsMultiHeader=this.grid.headersTable().find("> thead > tr th").not("[data-skip=true]").not("[data-isheadercell=true]");this._populateMultiColumnHeadersLevel0();thsMultiHeader.each(function(){var th=$(this),id=th.attr("id"),col,allowHiding=true;if(id){id=id.replace(self.grid.id()+"_","");if(id){col=self._getColumnSettings(null,id);if(col&&col.allowHiding===false){allowHiding=false}}}if(allowHiding){self._renderHidingColumnIcon(th,null,true)}});ths=$(this.grid._headerCells)}else{ths=this.grid.headersTable().find("thead > tr > th").not("[data-skip=true]")}ths.find("a[data-hiding-indicator=true]").remove();ths.each(function(index){var th=$(this),visibleColumns=self.grid._visibleColumns(),visibleIndex,columnKey;if(self.grid.options.virtualizationMode==="fixed"&&(self.grid.options.virtualization===true||self.grid.options.columnVirtualization===true)){visibleIndex=(self.grid._startColIndex||0)+index}else{visibleIndex=index}columnKey=visibleColumns[visibleIndex].key;if($.inArray(columnKey,self._hidingIconColumnKeys)!==-1){self._renderHidingColumnIcon(th,columnKey)}})},_headerRendered:function(event,ui){if(ui.owner.element.attr("id")!==this.grid.element.attr("id")){return}this._renderHidingIcons();this._renderColumnChooser()},_columnChooserButtonOKClick:function(){var self=this,changedColumns=self._columnsToHide,columnsToHide=[],columnsToShow=[],noCancel,modalDialog=$("#"+this.grid.id()+"_hiding_modalDialog");$.each(this.grid.options.columns,function(columnIndex,column){var cs,columnIdentifier,col;cs=self._getColumnSettingsByIndex(columnIndex);if(!cs.allowHiding){return}columnIdentifier=cs.columnKey||cs.columnIndex||column.key;col=changedColumns[columnIdentifier];if(col!==null&&col!==undefined){if(col){if(column.hidden===false){columnsToHide.push(columnIdentifier)}}else{if(column.hidden===true){columnsToShow.push(columnIdentifier)}}}});noCancel=this._trigger(this.events.columnChooserButtonApplyClick,null,{columnChooserElement:modalDialog,owner:this,columnsToHide:columnsToHide,columnsToShow:columnsToShow});if(!this.grid._isHidingAllowed(columnsToHide)){this._trigger(this.events.columnHidingRefused,null,{owner:this,columnKeys:columnsToHide});return}if(!this.grid._isShowingAllowed(columnsToShow)){this._trigger(this.events.columnShowingRefused,null,{owner:this,columnKeys:columnsToShow});return}if(noCancel){self._setHiddenMultipleColumns(columnsToShow,columnsToHide,true);$("#"+this.grid.id()+"_hiding_modalDialog").igGridModalDialog("closeModalDialog",true)}},isToRenderButtonReset:function(){var self=this,columnsToHide=self._columnsToHide,result=false;$.each(this.grid.options.columns,function(columnIndex,column){var cs,columnIdentifier,col,isHidden;cs=self._getColumnSettingsByIndex(columnIndex);if(cs&&!cs.allowHiding){return true}columnIdentifier=cs.columnKey||cs.columnIndex||column.key;col=columnsToHide[columnIdentifier];if(column._initiallyHidden===true){isHidden=true}else{isHidden=cs.hidden}if(col!==null&&col!==undefined){if(col!==isHidden){result=true;return false}}});return result},_isVisibleColumnsNotAllowHiding:function(){var self=this,res=false;$.each(this.grid.options.columns,function(columnIndex,column){var cs;cs=self._getColumnSettingsByIndex(columnIndex);if(cs&&!cs.allowHiding&&!column.hidden){res=true;return false}});return res},_columnChooserOpening:function(){var $ul,noCancel,$content,self=this,o=this.options,css=this.css,countColumnsAllowHiding=0,modalDialog=$("#"+this.grid.id()+"_hiding_modalDialog");noCancel=this._trigger(this.events.columnChooserOpening,null,{columnChooserElement:modalDialog,owner:this});if(noCancel){noCancel=this._trigger(this.events.columnChooserContentsRendering,null,{columnChooserElement:modalDialog,owner:this});if(noCancel){this.removeColumnChooserResetButton();$content=modalDialog.igGridModalDialog("getContent");$content.empty();$ul=$("<ul></ul>").addClass(css.columnChooserListItems).appendTo($content);this._columnsToHide={};$.each(this.grid.options.columns,function(columnIndex,column){var cs,columnIdentifier,$a,$li;cs=self._getColumnSettingsByIndex(columnIndex);if(!cs.allowHiding){return}countColumnsAllowHiding++;columnIdentifier=cs.columnKey||cs.columnIndex||column.key;$li=$("<li></li>").attr("id",self.grid.element[0].id+"_"+columnIdentifier+"_columnchooser_li").addClass(css.columnChooserItem).append('<span class="'+css.columnChooserHideButton+'"><a href="#"></a></span><span class="'+css.columnChooserItemText+'">'+column.headerText+"</span>");$li.appendTo($ul);$a=$li.find("a:first");if(o.columnChooserHideOnClick===true){$li.bind("click.hiding",function(event){var isHidden;if($a.attr("ishidden")==="1"){noCancel=self._showColumnFromUI(columnIdentifier);isHidden=false}else{noCancel=self._hideColumnFromUI(columnIdentifier);isHidden=true}if(noCancel){self._renderColumnChooserHideButton($a,isHidden)}event.preventDefault();event.stopPropagation();return false})}else{$li.bind("click.hiding",function(event){var isHidden,key,c;if($a.attr("ishidden")==="1"){isHidden=false}else{isHidden=true}if(isHidden&&self.grid.hasFixedColumns()){c=[];for(key in self._columnsToHide){if(self._columnsToHide.hasOwnProperty(key)&&self._columnsToHide[key]){c.push(key)}}c.push(columnIdentifier);if(!self.grid._isHidingAllowed(c)){return}}if(isHidden&&!self._isVisibleColumnsNotAllowHiding()&&$ul.find("a[ishidden=1]").length===countColumnsAllowHiding-1){return}self._columnsToHide[columnIdentifier]=isHidden;self._renderColumnChooserHideButton($a,isHidden);if(self.isToRenderButtonReset()){self.renderColumnChooserResetButton()}else{self.removeColumnChooserResetButton()}event.preventDefault();event.stopPropagation();return false})}self._columnsToHide[columnIdentifier]=column.hidden;self._renderColumnChooserHideButton($a,column.hidden)});this._trigger(this.events.columnChooserContentsRendered,null,{columnChooserElement:modalDialog,owner:this});if(o.columnChooserHideOnClick===false&&self.isToRenderButtonReset()){self.renderColumnChooserResetButton()}}this._trigger(this.events.columnChooserOpened,null,{columnChooserElement:modalDialog,owner:this})}return noCancel},resetHidingColumnChooser:function(){var self=this;$.each(this.grid.options.columns,function(columnIndex,column){var cs,columnIdentifier,isToHide;cs=self._getColumnSettingsByIndex(columnIndex);if(!cs){return true}if(!cs.allowHiding){return true}isToHide=cs.hidden;if(column._initiallyHidden===true){isToHide=true}columnIdentifier=cs.columnKey||cs.columnIndex||column.key;self._columnsToHide[columnIdentifier]=isToHide;self._renderColumnChooserHideButton($("#"+self.grid.id()+"_"+columnIdentifier+"_columnchooser_li a:first"),isToHide)});self.removeColumnChooserResetButton()},renderColumnChooserResetButton:function(){var o=this.options,self=this,resetButtonId=this.grid.id()+"_hiding_modalDialog_reset_button",modalDialog=$("#"+this.grid.id()+"_hiding_modalDialog"),$captionButtonContainer,$resetButton;if($("#"+resetButtonId).length===0){$captionButtonContainer=modalDialog.igGridModalDialog("getCaptionButtonContainer");$resetButton=$("<button></button>").attr("id",resetButtonId).appendTo($captionButtonContainer);$resetButton.igButton({labelText:o.columnChooserResetButtonLabel,click:function(e){self._trigger(self.events.columnChooserButtonResetClick,e,{columnChooserElement:modalDialog,owner:self});self.resetHidingColumnChooser()}})}},removeColumnChooserResetButton:function(){$("#"+this.grid.id()+"_hiding_modalDialog_reset_button").remove()},_renderColumnChooserHideButton:function($a,isHidden){var text,attrIsHidden,css=this.css,$li=$a.closest("li");if(isHidden===false){attrIsHidden="0";text=this.options.columnChooserHideText;$li.removeClass(css.columnChooserItemHidden)}else{attrIsHidden="1";text=this.options.columnChooserShowText;$li.addClass(css.columnChooserItemHidden)}$a.attr("ishidden",attrIsHidden).text(text)},_renderColumnChooser:function(){$("#"+this.grid.id()+"_hiding_modalDialog").remove();var $buttonOK,self=this,o=this.options,$captionButtonContainer,containment=this.grid._rootContainer(),modalDialog;if(this.options.columnChooserContainment!=="owner"){containment="window"}modalDialog=$("<div></div>").appendTo(this.grid._rootContainer()).attr("id",this.grid.id()+"_hiding_modalDialog");modalDialog.igGridModalDialog({modalDialogWidth:o.columnChooserWidth,modalDialogHeight:o.columnChooserHeight,modalDialogCaptionText:o.columnChooserCaptionText,buttonApplyText:o.columnChooserButtonApplyText,buttonCancelText:o.columnChooserButtonCancelText,containment:containment,gridContainer:this.grid.container(),renderFooterButtons:!o.columnChooserHideOnClick,animationDuration:o.columnChooserAnimationDuration,modalDialogOpening:function(event,args){return self._columnChooserOpening(event,args)},modalDialogMoving:function(e,ui){self._trigger(self.events.columnChooserMoving,null,{columnChooserElement:$(e.target),owner:self,originalPosition:ui.originalPosition,position:ui.position})},modalDialogClosing:function(){return self._trigger(self.events.columnChooserClosing,null,{columnChooserElement:modalDialog,owner:self})},modalDialogClosed:function(){self._trigger(self.events.columnChooserClosed,null,{columnChooserElement:modalDialog,owner:self})}});if(!o.columnChooserHideOnClick){$buttonOK=$("#"+this.grid.id()+"_hiding_modalDialog_footer_buttonok");$buttonOK.bind("igbuttonclick",function(e){self._columnChooserButtonOKClick(e);e.preventDefault()})}else{$captionButtonContainer=modalDialog.igGridModalDialog("getCaptionButtonContainer");$("<span></span>").bind("click.hiding",function(event){modalDialog.igGridModalDialog("closeModalDialog",true);event.preventDefault();event.stopPropagation();return false}).addClass("ui-icon ui-icon-closethick").appendTo($("<a></a>").appendTo($captionButtonContainer).attr("title",$.ig.GridHiding.locale.columnChooserCloseButtonTooltip).attr("href","#").attr("role","button").addClass("ui-dialog-titlebar-close ui-corner-all"))}},_hidingFinished:function(){if(this.options.virtualization===true&&this.options.virtualizationMode==="fixed"){return}if(this.options.columnVirtualization===true){return}this._renderHiddenColumnIndicators()},_virtualHorizontalScroll:function(){this._renderHiddenColumnIndicators();this._renderHidingIcons()},_getIndicators:function(indicators,isFixed){var i,col,columns=this.grid.options.columns,columnsLength=columns.length,visibleIndex=0,fixed;for(i=0;i<columnsLength;i++){col=columns[i];fixed=col.fixed===true;if(fixed!==isFixed){continue}if(col.hidden){if(this._getColumnSettingsByIndex(i).allowHiding){if(indicators[visibleIndex]===undefined){indicators[visibleIndex]=[]}indicators[visibleIndex].push(col.key)}}else{visibleIndex++}}return visibleIndex},_renderHiddenColumnIndicators:function(){var self=this,ths,visibleIndex=0,indicators=[],oldDropDowns,fHCells,ufHCells,hasFixedColumns=this.grid.hasFixedColumns(),fixedIndicators=[];visibleIndex=this._getIndicators(indicators,false);if(hasFixedColumns){this._getIndicators(fixedIndicators,true)}oldDropDowns=this.grid.container().children("div[data-hiding-inddropdown='"+self.grid.id()+"']");if(oldDropDowns.length){setTimeout(function(){oldDropDowns.remove()},this.options.dropDownAnimationDuration*2+1)}if(visibleIndex===0){this.grid.headersTable().find("thead > tr > th[data-hiddenreplacement=true]").each(function(){var a=self._renderHiddenColumnIndicator(true,$(this));self._bindDropDownToIndicator(a.find("span"),indicators[0])})}else{if(this.grid._isMultiColumnGrid){ths=$(this.grid._headerCells)}else{ths=this.grid.headersTable().find("thead > tr > th").not("[data-skip=true]")}if(hasFixedColumns){if(this.grid._isMultiColumnGrid){fHCells=$();ufHCells=$();$.each(this.grid._headerCells,function(index,cell){if(self.grid._isFixedElement(cell)){fHCells.push(cell)}else{ufHCells.push(cell)}});this._renderHiddenColumnIndicatorsHelper(ufHCells,indicators,false);this._renderHiddenColumnIndicatorsHelper(fHCells,fixedIndicators,true)}else{this._renderHiddenColumnIndicatorsHelper(ths,indicators,false);ths=this.grid.fixedHeadersTable().find("thead > tr > th").not("[data-skip=true]");this._renderHiddenColumnIndicatorsHelper(ths,fixedIndicators,true)}}else{this._renderHiddenColumnIndicatorsHelper(ths,indicators)}}},_renderHiddenColumnIndicatorsHelper:function(ths,indicators,isFixed){var self=this;ths.each(function(index){var th=$(this),a,visibleIndex;if(self.grid.options.virtualization===true&&self.grid.options.virtualizationMode==="fixed"||self.grid.options.columnVirtualization===true){visibleIndex=self.grid._startColIndex+index}else{visibleIndex=index}self._clearHiddenColumnIndicator(true,th);self._clearHiddenColumnIndicator(false,th);if(indicators[visibleIndex]!==undefined){a=self._renderHiddenColumnIndicator(true,th);self._bindDropDownToIndicator(a.find("span"),indicators[visibleIndex])}if(visibleIndex===self.grid._visibleColumns(isFixed).length-1){if(indicators[visibleIndex+1]!==undefined){a=self._renderHiddenColumnIndicator(false,th);self._bindDropDownToIndicator(a.find("span"),indicators[visibleIndex+1])}}})},_renderHiddenColumnIndicator:function(left,th){var padding,margin,nonPaddedIndicatorsAttr,position,indicatorMarkup,spanMarkup,paddingValue,div,a,span;if(left){padding="padding-left";margin="margin-left";position="left";indicatorMarkup="<div data-hiddencolindicator='left' />";spanMarkup="<span data-nonpaddedindicator='left'></span>";nonPaddedIndicatorsAttr="[data-nonpaddedindicator=left]"}else{padding="padding-right";margin="margin-right";position="right";indicatorMarkup="<div data-hiddencolindicator='right' />";spanMarkup="<span data-nonpaddedindicator='right'></span>";nonPaddedIndicatorsAttr="[data-nonpaddedindicator=right]"}paddingValue=parseInt(th.css(padding),10)+this.options.hiddenColumnIndicatorHeaderWidth;th.css(padding,paddingValue+"px");th.find(nonPaddedIndicatorsAttr).css(margin,-paddingValue+"px");div=$(indicatorMarkup).css("position","relative").css("width","100%").css("height","0px").css("top","0px").css("left","0px").prependTo(th);a=$("<a href='#' />").attr("title",this.options.hiddenColumnIndicatorTooltipText).prependTo(div);span=$(spanMarkup).attr("title",this.options.hiddenColumnIndicatorTooltipText).attr("data-skip-event","true").css("position","absolute").css(margin,-paddingValue+"px").css(position,"0px").css("width",this.options.hiddenColumnIndicatorHeaderWidth+"px").addClass(this.css.hiddenColumnIndicator).appendTo(a);if($.ig.util.isIE7){span.css({top:-parseInt(th.css("padding-top"),10),height:th.innerHeight()})}return a},_clearHiddenColumnIndicator:function(left,th){var padding,paddingValue,indicatorSelector,indicator;if(left){padding="padding-left";indicatorSelector="div[data-hiddencolindicator=left]"}else{padding="padding-right";indicatorSelector="div[data-hiddencolindicator=right]"}indicator=th.find(indicatorSelector);if(indicator.length!==0){indicator.remove();paddingValue=parseInt(th.css(padding),10);th.css(padding,paddingValue-this.options.hiddenColumnIndicatorHeaderWidth+"px")}},_bindDropDownToIndicator:function(button,columnKeys){var self=this,dropDown=this._renderDropDown(button,columnKeys);dropDown.find("ul").bind({blur:function(){self._toggleDropDown(button,dropDown,true)}});button.parent().bind({mousedown:function(e){self._toggleDropDown(button,dropDown,false);e.preventDefault();e.stopPropagation()},mouseover:function(){if(button.attr("data-indicator-selected")!=="true"){button.addClass(self.css.hiddenColumnIndicatorMouseOver)}},mouseout:function(){button.removeClass(self.css.hiddenColumnIndicatorMouseOver)},mouseup:function(e){e.preventDefault();e.stopPropagation()},click:function(e){e.preventDefault();e.stopPropagation()}})},_renderDropDown:function(button,columnKeys){var self=this,dropDown,list;dropDown=$("<div data-hiding-inddropdown='"+this.grid.id()+"'></div>").css("position","absolute").css("display","none").addClass(this.css.hiddenColumnsDropDown).appendTo(this.grid._rootContainer());list=$('<ul tabindex="0"></ul>').addClass(this.css.hiddenColumnsDropDownList).appendTo(dropDown);$.each(columnKeys,function(index,columnKey){$("<li></li>").addClass(self.css.hiddenColumnsDropDownItem).bind({mouseover:function(e){$(e.currentTarget).addClass(self.css.hiddenColumnsDropDownItemHover)},mouseout:function(e){$(e.currentTarget).removeClass(self.css.hiddenColumnsDropDownItemHover)},mousedown:function(){self._closeColumnChooser(true);self._showColumnFromUI(columnKey);self._toggleDropDown(button,dropDown,true)}}).append($("<span></span>").addClass(self.css.hiddenColumnsDropDownItemText).text(self.grid.columnByKey(columnKey).headerText)).appendTo(list)});$("<a></a>").appendTo($("<li></li>").appendTo(list)).igButton({labelText:this.options.columnChooserDisplayText,mousedown:function(event){if(event.target){setTimeout(function(){$(event.target).removeClass("ui-state-active")},0)}self._openColumnChooser(true);self._toggleDropDown(button,dropDown,true)}});return dropDown},_toggleDropDown:function(button,dropDown,isCalledFromBlur){var th,rOffset,isLast,offset,left,isVisible=dropDown.is(":visible")===true,self=this;if(dropDown.data("isAnimating")===true||isVisible===false&&isCalledFromBlur===true){return}if(!isVisible){th=button.closest("th");isLast=button.closest("div").attr("data-hiddencolindicator")==="right";offset=$.ig.util.offset(th);if(isLast){left=offset.left+th.outerWidth()-dropDown.outerWidth();left=Math.max(0,left)}else{left=offset.left}rOffset=$.ig.util.getRelativeOffset(dropDown);dropDown.css("top",offset.top+th.outerHeight()-rOffset.top);dropDown.css("left",left-rOffset.left)}dropDown.data("isAnimating",true);dropDown.toggle(this.options.dropDownAnimationDuration,function(){if(dropDown.is(":visible")===true){dropDown.find("ul").focus();button.addClass(self.css.hiddenColumnIndicatorSelected);button.attr("data-indicator-selected","true")}else{button.removeClass(self.css.hiddenColumnIndicatorSelected);button.removeAttr("data-indicator-selected")}dropDown.data("isAnimating",false)})},_openColumnChooser:function(){var modalDialog=$("#"+this.grid.id()+"_hiding_modalDialog");modalDialog.igGridModalDialog("openModalDialog")},_closeColumnChooser:function(){var modalDialog=$("#"+this.grid.id()+"_hiding_modalDialog");modalDialog.igGridModalDialog("closeModalDialog")},_columnChooserMove:function(e,ui){this._trigger(this.events.columnChooserMoving,null,{columnChooserElement:e.target,owner:this,originalPosition:ui.originalPosition,position:ui.position})},_getColumnSettings:function(index,key){var i,foundByIndex;for(i=0;i<this.options.columnSettings.length;i++){if(this.options.columnSettings[i].columnKey===key){return this._mergeColumnSettingsDefaults(this.options.columnSettings[i])
}if(this.options.columnSettings[i].columnIndex===index){foundByIndex=this.options.columnSettings[i]}}return this._mergeColumnSettingsDefaults(foundByIndex)},_getColumnSettingsByIndex:function(index){var key=this.grid.options.columns[index].key;return this._getColumnSettings(index,key)},_getColumnSettingsByKey:function(key){var i;for(i=0;i<this.grid.options.columns.length;i++){if(this.grid.options.columns[i].key===key){return this._getColumnSettings(i,key)}}},_mergeColumnSettingsDefaults:function(columnSettings){var defaults={allowHiding:true,hidden:false},copy=$.extend({},columnSettings),key;for(key in defaults){if(defaults.hasOwnProperty(key)&&typeof copy[key]!=="boolean"){copy[key]=defaults[key]}}return copy},_columnsMoved:function(){var self=this;this.grid.headersTable().find("thead > tr > th").not("[data-skip=true]").each(function(){var th=$(this);self._clearHiddenColumnIndicator(true,th);self._clearHiddenColumnIndicator(false,th)});this._renderHiddenColumnIndicators()},_detachEvents:function(){if(this._headerCellRenderedHandler!==null&&this._headerCellRenderedHandler!==undefined){this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler)}if(this._headerRenderedHandler!==null&&this._headerRenderedHandler!==undefined){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler)}if(this._virtualHorizontalScrollHandler!==null&&this._virtualHorizontalScrollHandler!==undefined){this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler)}if(this._columnsMovedHandler!==null&&this._columnsMovedHandler!==undefined){this.grid.element.unbind("iggrid_columnsmoved",this._columnsMovedHandler)}},_injectGrid:function(gridInstance){var i,j,cs,col,children;this.grid=gridInstance;this._detachEvents();this._headerRenderedHandler=$.proxy(this._headerRendered,this);this._headerCellRenderedHandler=$.proxy(this._headerCellRendered,this);this._virtualHorizontalScrollHandler=$.proxy(this._virtualHorizontalScroll,this);this._columnsMovedHandler=$.proxy(this._columnsMoved,this);this.grid.element.bind("iggridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.bind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler);this.grid.element.bind("iggrid_columnsmoved",this._columnsMovedHandler);if(this.grid.element.igGridFeatureChooser!==undefined){this.grid.element.igGridFeatureChooser()}else{throw new Error($.ig.GridHiding.locale.featureChooserNotReferenced)}for(i=0;i<this.options.columnSettings.length;i++){cs=this.options.columnSettings[i];if(typeof cs.hidden==="boolean"){if(typeof cs.columnKey==="string"){col=this.grid.columnByKey(cs.columnKey)}else if(typeof cs.columnIndex==="number"){col=this.grid.options.columns[cs.columnIndex]}if(col!==undefined&&col!==null){if(col.hidden===undefined||cs.hidden===true&&col.hidden!==col._initiallyHidden&&col._initiallyHidden!==true){col.hidden=cs.hidden}}else if(this.grid._isMultiColumnGrid===true&&cs.columnKey!==null&&cs.columnKey!==undefined){col=this.grid._getMultiHeaderColumnById(cs.columnKey);if(col!==undefined&&col!==null&&col.children){children=col.children;for(j=0;j<children.length;j++){if(children[j].hidden===undefined||cs.hidden===true&&children[j].hidden!==children[j]._initiallyHidden&&children[j]._initiallyHidden!==true){children[j].hidden=cs.hidden}}}}}}}});$.extend($.ui.igGridHiding,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Hierarchical Grid 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.shared.js
 *	infragistics.util.js
 *	infragistics.ui.grid.framework.js
 */
(function($){$.widget("ui.igHierarchicalGrid",{css:{expandColumn:"ui-iggrid-expandcolumn",expandColumnExpanded:"ui-iggrid-expandcolumn-expanded",expandButton:"ui-iggrid-expandbutton ui-icon-plus",expandButtonHover:"ui-iggrid-expandbuttonhover ui-icon-plus ui-state-hover",expandButtonExpandedHover:"ui-iggrid-expandbuttonexpandedhover ui-icon-plus ui-state-hover",expandButtonExpanded:"ui-iggrid-expandbutton ui-iggrid-expandbuttonexpanded ui-icon-minus",expandButtonClick:"ui-iggrid-expandbuttonclick ui-icon-plus",childGridArea:"ui-iggrid-childarea",childGridAreaCollapsed:"ui-iggrid-childarea-collapsed",expandHeaderCell:"ui-iggrid-expandheadercell ui-iggrid-header ui-widget-header",expandHeaderCellTriangle:"ui-icon ui-icon-triangle-1-se",root:"ui-iggrid-root",childGridSeparator:"ui-iggrid-childgridseparator"},options:{initialDataBindDepth:-1,initialExpandDepth:-1,odata:false,rest:false,maxDataBindDepth:-1,defaultChildrenDataProperty:"children",autoGenerateLayouts:false,expandCollapseAnimations:true,expandColWidth:30,pathSeparator:"/",animationDuration:500,expandTooltip:$.ig.Grid.locale.expandTooltip,collapseTooltip:$.ig.Grid.locale.collapseTooltip,columns:[],columnLayouts:[{key:null,primaryKey:null,foreignKey:null}]},events:{rowExpanding:"rowExpanding",rowExpanded:"rowExpanded",rowCollapsing:"rowCollapsing",rowCollapsed:"rowCollapsed",childrenPopulating:"childrenPopulating",childrenPopulated:"childrenPopulated",childGridRendered:"childGridRendered",childGridCreating:"igchildgridcreating",childGridCreated:"igchildgridcreated"},_setOption:function(key,value){if(key==="dataSource"){this.options.dataSource=value;this.dataBind()}else if(key==="initialDataBindDepth"||key==="initialExpandDepth"||key==="expandColWidth"){throw new Error($.ig.Grid.locale.optionChangeNotSupported.replace("{optionName}",key))}if(key==="odata"||key==="defaultChildrenDataProperty"||key==="expandTooltip"||key==="collapseTooltip"||key==="autoGenerateLayouts"||key==="expandCollapseAnimations"||key==="animationDuration"){$.Widget.prototype._setOption.apply(this,arguments)}else if(this.rootWidget()&&key!=="dataSource"){this.rootWidget()._setOption(key,value)}},_create:function(){this._regevents(this.element,this);$.ui.igGrid.prototype.options.columns=[];$.ui.igGrid.prototype.options.features=[];this.options=$.extend(true,{},$.ui.igGrid.prototype.options,this.options);if(this.tmpDataSource!==null&&this.tmpDataSource!==undefined){this.options.dataSource=this.tmpDataSource;this._originalOptions.dataSource=this.tmpDataSource}if(this.options.virtualization===true||this.options.rowVirtualization===true){this.options.virtualizationMode="continuous"}this._eventQueue=[];this._animationQueue=[];this.dataBind();this.rootWidget()._isMultiColumnGrid=this._checkIsMultiColumnHeader(this.options)},_createWidget:function(options){this.options.columns=[];this.options.features=[];this.options.columnLayouts=[];if(options.dataSource&&($.type(options.dataSource)==="array"||$.type(options.dataSource)==="object")){this.tmpDataSource=options.dataSource;options.dataSource=null;this._originalOptions=options}$.Widget.prototype._createWidget.apply(this,arguments)},dataBind:function(){var hds,hdsoptions,rootds,opts;if(this.options.autoGenerateLayouts){this._generateLayouts()}hdsoptions=this._hdsoptions();hds=new $.ig.HierarchicalDataSource(hdsoptions);this._hds=hds;rootds=this._hds.root();this._tmpds=this.options.dataSource;this.options.dataSource=null;opts=$.extend(true,{},this.options);this.options.dataSource=this._tmpds;this._tmpds=null;opts.dataSource=rootds;if($.type(hdsoptions.dataSource)==="string"){opts.dataSourceUrl=hdsoptions.dataSource}if(!this._columnsGeneratedHandler){this._columnsGeneratedHandler=$.proxy(this._columnsGenerated,this)}else{this.element.unbind("iggridcolumnsgenerated",this._columnsGeneratedHandler)}this.element.bind("iggridcolumnsgenerated",this._columnsGeneratedHandler);if(this.options.autoGenerateLayouts===true){if(!this._databoundHandler){this._databoundHandler=$.proxy(this._layouts,this)}else{this.element.unbind("iggridcolumnsgenerated",this._databoundHandler)}this.element.bind("iggriddatarendering",this._databoundHandler)}this.element.addClass(this.css.root);this.element.attr("data-level",0);opts._isHierarchicalGrid=true;if(this._root){this._root.igGrid("option","dataSource",opts.dataSource)}else{if(this.options.autoGenerateLayouts===true){opts._recurseSchema=true}this._root=this.element.igGrid(opts)}if(this.rootWidget().container().data("igLoading")){this.indicator=this.rootWidget().container().data("igLoading").indicator()}else{this.indicator=this.rootWidget().container().igLoading().data("igLoading").indicator()}this._regToggleEvent(this.element,this)},_generateLayouts:function(){var rec,i,ds=this.options.dataSource;if($.type(ds)!=="array"&&$.type(ds)!=="object"||ds.length===0){return}if($.type(ds)==="object"&&this.options.responseDataKey){ds=ds[this.options.responseDataKey]||ds}for(i=0;i<ds.length;i++){rec=ds[i];this._generateLayout(rec,this.options)}},_generateLayout:function(record,options){var name,layout,tmpLayout,i,rec,hasRespKey=false;for(name in record){if(record.hasOwnProperty(name)&&($.type(record[name])==="array"||$.type(record[name])==="object"&&options.responseDataKey&&$.type(record[name][options.responseDataKey])==="array")){rec=record[name];if(options.responseDataKey&&$.type(rec)==="object"){if(rec[options.responseDataKey]&&$.type(rec[options.responseDataKey])==="array"){rec=rec[options.responseDataKey];hasRespKey=true}else{continue}}layout={key:name,childrenDataProperty:name,columnLayouts:[]};if(hasRespKey){layout.responseDataKey=options.responseDataKey}tmpLayout=this._layoutExistsRecursive(this.options,name);if(!tmpLayout){if(options.columnLayouts===undefined||options.columnLayouts===null){options.columnLayouts=[]}options.columnLayouts.push(layout)}else{layout=tmpLayout}if(rec.length>0){for(i=0;i<rec.length;i++){this._generateLayout(rec[i],layout)}}}}},_layoutExistsRecursive:function(options,key){var i,tmpLayout=null;tmpLayout=options.key===key?options:tmpLayout;if(!tmpLayout){for(i=0;options.columnLayouts&&i<options.columnLayouts.length;i++){tmpLayout=this._layoutExistsRecursive(options.columnLayouts[i],key);if(tmpLayout){break}}}return tmpLayout},root:function(){return this._root},rootWidget:function(){return this.root().data("igGrid")},allChildrenWidgets:function(){return this.root().find(".ui-iggrid-table").map(function(){return $(this).data("igGrid")})},allChildren:function(){return this.root().find(".ui-iggrid-table")},toggle:function(element,callback){this._toggleInternal({target:$(element).find(".ui-iggrid-expandcolumn")},true,callback)},expand:function(id,callback){if(!this.populated(id)){this._toggleInternal({target:$(id).find(".ui-iggrid-expandcolumn")},true,callback)}else{this._expand(id,true,callback)}},_expand:function(id,suppressEvents,callback){var tr=$(id),c,noCancel=true,handler,rootgrid;if(this.expanded(tr)){return}if(!suppressEvents){noCancel=this._trigger(this.events.rowExpanding,null,{owner:this,parentrow:tr})}if(this.expanded(tr)){return}rootgrid=this._rootgrid||this.element.closest(".ui-iggrid-root").data("igHierarchicalGrid");if(noCancel){if(this.options.expandCollapseAnimations){if(rootgrid._animationQueue[tr.attr("data-id")+"_"+tr.index()]===true){return}rootgrid._animationQueue[tr.attr("data-id")+"_"+tr.index()]=true}c=tr.find(".ui-iggrid-expandcolumn");tr.next().css("display","").css("visibility","visible");if(this.options.expandCollapseAnimations){if(!suppressEvents){handler=this._expandend}else{handler=this._expandendnoevents}tr.next().find("> td > div").slideDown(this.options.animationDuration,function(ctx){handler.apply(this,[ctx,callback])})}else{tr.next().find("> td > div").show();c.addClass(this.css.expandColumnExpanded).find(".ui-iggrid-expandbutton").removeClass(this.css.expandButton).addClass(this.css.expandButtonExpanded).attr("title",this.options.collapseTooltip)}tr.attr("state","e");tr.attr("aria-expanded",true);tr.next().children().first().removeClass(this.css.childGridAreaCollapsed).addClass(this.css.childGridArea);if(!this.options.expandCollapseAnimations){this._rowExpanded({owner:this,parentrow:tr});if(!suppressEvents){this._trigger(this.events.rowExpanded,null,{owner:this,parentrow:tr})}else if(callback){$.ig.util.invokeCallback(callback,[this,tr])}}}},expanded:function(element){var $e=element.length!==undefined?element:$(element);if($e===null||$e===undefined){return false}if($e.attr("state")!=="e"||$e.attr("state")===undefined){return false}return true},_expandendnoevents:function(ctx,callback){var expcell,expcellspan,rootgrid,$this=ctx?$(ctx):$(this),prow=$this.closest("tr[data-container]").prev();rootgrid=this._rootgrid||$this.closest(".ui-iggrid-root").data("igHierarchicalGrid");expcell=$this.closest("[data-container=true]").prev().find(".ui-iggrid-expandcolumn");expcellspan=expcell.find(".ui-iggrid-expandbutton");expcell.addClass(rootgrid.css.expandColumnExpanded);expcellspan.removeClass(rootgrid.css.expandButton).addClass(rootgrid.css.expandButtonExpanded).attr("title",rootgrid.options.collapseTooltip);rootgrid._rowExpanded({owner:rootgrid,parentrow:prow});if(rootgrid._animationQueue[prow.attr("data-id")+"_"+prow.index()]===true){delete rootgrid._animationQueue[prow.attr("data-id")+"_"+prow.index()]}if(callback){$.ig.util.invokeCallback(callback,[rootgrid,prow])}},_expandend:function(){var $this=$(this),rootgrid,prow=$this.closest("tr[data-container]").prev(),parentGrid=prow.closest(".ui-iggrid-table").data("igGrid");rootgrid=this._rootgrid||$this.closest(".ui-iggrid-root").data("igHierarchicalGrid");rootgrid._expandendnoevents(this);parentGrid._adjustLastColumnWidth(false);rootgrid._trigger(rootgrid.events.rowExpanded,null,{owner:rootgrid,parentrow:prow})},_collapseendnoevents:function(ctx,callback){var expcell,expcellspan,rootgrid,$this=ctx?$(ctx):$(this),ctd=$this.closest(".ui-iggrid-childarea"),prow=$this.closest("tr[data-container]").prev();rootgrid=this._rootgrid||$this.closest(".ui-iggrid-root").data("igHierarchicalGrid");ctd.removeClass(rootgrid.css.childGridArea).addClass(rootgrid.css.childGridAreaCollapsed);ctd.closest("tr").css("display","none").css("visibility","hidden");expcell=$this.closest("[data-container=true]").prev().find(".ui-iggrid-expandcolumn");expcellspan=expcell.find(".ui-iggrid-expandbutton");expcell.removeClass(rootgrid.css.expandColumnExpanded);expcellspan.removeClass(rootgrid.css.expandButtonExpanded).addClass(rootgrid.css.expandButton).attr("title",rootgrid.options.expandTooltip);if(rootgrid._animationQueue[prow.attr("data-id")+"_"+prow.index()]===true){delete rootgrid._animationQueue[prow.attr("data-id")+"_"+prow.index()]}if(callback){$.ig.util.invokeCallback(callback,[rootgrid,prow])}},_collapseend:function(){var $this=$(this),rootgrid,prow=$this.closest("tr[data-container]").prev(),parentGrid=prow.closest(".ui-iggrid-table").data("igGrid");rootgrid=this._rootgrid||$this.closest(".ui-iggrid-root").data("igHierarchicalGrid");rootgrid._collapseendnoevents(this);parentGrid._adjustLastColumnWidth(false);rootgrid._trigger(rootgrid.events.rowCollapsed,null,{owner:rootgrid,parentrow:prow})},collapse:function(id,callback){this._collapse(id,true,callback)},_collapse:function(id,suppressEvents,callback){var tr=$(id),c,noCancel=true,handler,rootgrid;if(this.collapsed(tr)){return}if(!suppressEvents){noCancel=this._trigger(this.events.rowCollapsing,null,{owner:this,parentrow:tr})}rootgrid=this._rootgrid||this.element.closest(".ui-iggrid-root").data("igHierarchicalGrid");if(noCancel){if(this.options.expandCollapseAnimations){if(rootgrid._animationQueue[tr.attr("data-id")+"_"+tr.index()]===true){return}rootgrid._animationQueue[tr.attr("data-id")+"_"+tr.index()]=true}c=tr.find(".ui-iggrid-expandcolumn");if(this.options.expandCollapseAnimations){if(!suppressEvents){handler=this._collapseend}else{handler=this._collapseendnoevents}this._rowCollapsed({owner:this,parentrow:tr});tr.next().find("> td > div").slideUp(this.options.animationDuration,function(ctx){handler.apply(this,[ctx,callback])})}else{this._rowCollapsed({owner:this,parentrow:tr});tr.next().find("> td > div").hide();tr.next().children().first().removeClass(this.css.childGridArea).addClass(this.css.childGridAreaCollapsed);tr.next().css("display","none").css("visibility","hidden");c.find(".ui-iggrid-expandbutton").removeClass(this.css.expandButtonExpanded).addClass(this.css.expandButton).attr("title",this.options.expandTooltip);if(!suppressEvents){this._trigger(this.events.rowCollapsed,null,{owner:this,parentrow:tr})}else if(callback){$.ig.util.invokeCallback(callback,[this,tr])}}tr.attr("state","c");tr.attr("aria-expanded",false)}},collapsed:function(element){var $e=element.length!==undefined?element:$(element);if($e===null||$e===undefined){return true}if($e.attr("state")==="c"||$e.attr("state")===undefined){return true}return false},populated:function(element){var $e=element.length!==undefined?element:$(element);if($e===null||$e===undefined){return false}if($e.attr("c")==="true"){return true}return false},_mouseOver:function(event){$(event.target).addClass(this.css.expandButtonHover)},_mouseOut:function(event){$(event.target).removeClass(this.css.expandButtonHover).addClass(this.css.expandButton)},_toggleInternalWithDelay:function(event){var self=this;setTimeout(function(){self._toggleInternal(event)},0);event.stopImmediatePropagation()},_toggleInternal:function(event,suppressEvents,callback){var created=$(event.target).closest("tr").attr("c"),tr=$(event.target).closest("tr"),p=tr.find(".ui-iggrid-expandcolumn"),hgrid=this,isExpand,expandTout=this.options.virtualization===true?50:0;isExpand=$(event.target).hasClass("ui-iggrid-expandbutton")||$(event.target).children(".ui-iggrid-expandbutton").length>0;if(!created&&this.options.initialDataBindDepth===-1&&isExpand){this.indicator.refreshPos();if(!$.ig.util.isWebKit){p.find(".ui-iggrid-expandbutton").css("visibility","hidden");this.indicator.show(false)}else{this.indicator.show(false)}setTimeout(function(){hgrid._toggleInternalAsync(event,suppressEvents,callback)},expandTout)}else{hgrid._toggleInternalAsync(event,suppressEvents,callback)}if(!suppressEvents){if(event.originalEvent&&typeof event.originalEvent.cancelBubble==="unknown"){event.originalEvent={}}event.stopImmediatePropagation()}},_toggleInternalAsync:function(event,suppressEvents,callback){var $td=$(event.target),parentrow=$td.closest("tr"),rowid="",keyspath="",keyspathvar="",pgridp,o,level=-1,sp=false,curpath=0,restSettingsSet,childds,created=parentrow.attr("c"),childrow,childgrids=[],ds,opts=[],id,k,isHierarchical,tmpkey,pki,dsobj,dsString,key,pgInstance,cs,popts,i,h,parentLevel=0,tmpgrid,state=parentrow.attr("state"),animatec,noCancel=true,noCancelChild=true,pid,instanceOfDs,eArgs;if($td.is("td")&&$td.attr("data-parent")!=="true"||$td.closest("td").attr("data-parent")!=="true"){return}if(state===undefined){state="c"}restSettingsSet=this.options.restSettings.update.url!==null||this.options.restSettings.update.template!==null||this.options.restSettings.create.url!==null||this.options.restSettings.create.template!==null||this.options.restSettings.remove.url!==null||this.options.restSettings.remove.template!==null;if(!created&&state==="c"){parentrow.after("<tr></tr>");childrow=parentrow.next();childrow.attr("data-container",true);popts=parentrow.closest("table").data("igGrid").options;opts=this._optsFor(popts);if(popts.childrenDataProperty===undefined){if(popts.key){keyspath=popts.key}}else{keyspath+=popts.childrenDataProperty}pgridp=parentrow.closest(".ui-iggrid-childarea").parent().prev();while(pgridp.length>0){if(curpath!==0){rowid+=this.options.pathSeparator}o=pgridp.closest(".ui-iggrid-table").data("igGrid").options;k=o.primaryKey;rowid+=k+":"+pgridp.attr("data-id");if(o.childrenDataProperty===undefined){if(o.key){keyspath+=this.options.pathSeparator+o.key}}else{keyspath+=this.options.pathSeparator+o.childrenDataProperty}pgridp=pgridp.closest(".ui-iggrid-childarea").parent().prev();curpath++}keyspath=keyspath.split(this.options.pathSeparator).reverse().join(this.options.pathSeparator);rowid=rowid.split(this.options.pathSeparator).reverse().join(this.options.pathSeparator);k=parentrow.closest("table").data("igGrid").options.primaryKey;if(rowid===""){rowid=k+":"+parentrow.attr("data-id")}else{rowid+=this.options.pathSeparator+k+":"+parentrow.attr("data-id")}cs=parentrow.find("td,th").length;animatec=$("<div></div>").appendTo($("<td></td>").appendTo(childrow).addClass(this.css.childGridArea).attr("colspan",cs));for(i=0;i<opts.length;i++){keyspathvar="";childgrids.push($("<table></table>").appendTo(animatec).attr("data-childgrid",true));if(i<opts.length-1){$("<div></div>").appendTo(animatec).addClass(this.css.childGridSeparator)}key=opts[i].key!==undefined?opts[i].key:opts[i].childrenDataProperty;childgrids[i].attr("id",this.root()[0].id+"_"+parentrow.attr("data-id")+"_"+key+"_child");parentLevel=parseInt(parentrow.closest("table").attr("data-level"),10);childgrids[i].attr("id",childgrids[i].attr("id").replace(",","-")).attr("data-level",parentLevel+1);if(keyspath===""){keyspathvar=opts[i].childrenDataProperty===undefined?opts[i].key:opts[i].childrenDataProperty}else{keyspathvar=this.options.pathSeparator+(opts[i].childrenDataProperty===undefined?opts[i].key:opts[i].childrenDataProperty)}childds=this._hds.dataAt(rowid,keyspath+keyspathvar);if($.type(childds)!=="array"&&!opts[i].responseDataKey&&childds!==undefined){childds=[childds]}else if(childds===null||childds===undefined){childds=[]}isHierarchical=false;if(opts[i].columnLayouts&&opts[i].columnLayouts.length>0){isHierarchical=true}if(isHierarchical){this._regevents(childgrids[i],this)}level=rowid.split(this.options.pathSeparator).length;if(level>this.options.initialDataBindDepth&&this.options.initialDataBindDepth!==-1){sp=true}ds=this._hdsoptions().dataSource;eArgs={owner:this,options:opts[i],element:childgrids[i],id:rowid,path:keyspath+keyspathvar};if(!sp){opts[i].dataSource=childds;if($.type(ds)==="string"&&this.options.rest!==true&&!opts[i].dataSourceUrl){opts[i].dataSourceUrl=ds}if(opts[i].dataSourceUrl&&$.type(opts[i].dataSourceUrl)==="string"){if(opts[i].dataSourceUrl.indexOf("?")!==-1){opts[i].dataSourceUrl+="&"+this._hds._encodeUrlPath(rowid,opts[i].key)}else{opts[i].dataSourceUrl+="?"+this._hds._encodeUrlPath(rowid,opts[i].key)}}if(this.options.autoGenerateLayouts===true){opts[i]._recurseSchema=true}childgrids[i].trigger(this.events.childGridCreating,eArgs);noCancelChild=childgrids[i].attr("data-create");if(noCancelChild!=="false"){if((this.options.rest||this.options.odata)&&restSettingsSet===true){this._inheritRestSettings(null,parentrow.attr("data-id"),keyspathvar.toLowerCase(),popts,opts[i])}if(isHierarchical){opts[i]._isHierarchicalGrid=true}pgInstance=parentrow.closest(".ui-iggrid-table").data("igGrid");if(pgInstance){opts[i].foreignKeyValue=pgInstance._fixPKValue(parentrow.data("id"))}else{opts[i].foreignKeyValue=parentrow.data("id")}h=$.proxy(this._childRendered,this);childgrids[i].bind("iggridrendered.hierarchicalgrid",h);childgrids[i].igGrid(opts[i]);if(isHierarchical){this._regToggleEvent(childgrids[i],this)}childgrids[i].trigger(this.events.childGridCreated,{owner:this,element:childgrids[i]})}if(opts[i].primaryKey===null||opts[i].primaryKey===undefined){if(opts[i].dataSource&&typeof opts[i].dataSource._xmlToArray==="function"&&typeof opts[i].dataSource._encodePkParams==="function"){throw new Error($.ig.Grid.locale.noPrimaryKey)}tmpgrid=childgrids[i].data("igGrid");tmpkey=tmpgrid.dataSource.schema().schema.searchField;if(tmpkey!==null){for(pki=0;pki<opts[i].dataSource[tmpkey].length;pki++){opts[i].dataSource[tmpkey][pki].ig_pk=tmpgrid.dataSource.data()[pki].ig_pk}}else{for(pki=0;pki<opts[i].dataSource.length;pki++){if(opts[i].dataSource[pki]){opts[i].dataSource[pki].ig_pk=tmpgrid.dataSource.data()[pki].ig_pk}}}}}else{instanceOfDs=ds&&typeof ds._xmlToArray==="function"&&typeof ds._encodePkParams==="function";if(this.options.odata){dsobj=instanceOfDs?ds.settings.dataSource:ds;dsString=popts.dataSource&&typeof popts.dataSource._xmlToArray==="function"&&typeof popts.dataSource._encodePkParams==="function"?popts.dataSource.settings.dataSource:popts.dataSource;childds=parentrow.closest("table").data("igGrid").dataSource.data();tmpkey=parentrow.attr("data-id");k=parentrow.closest("table").data("igGrid").options.primaryKey;if(parentrow.closest("table").data("igGrid").columnByKey(k).dataType==="number"){tmpkey=parseInt(tmpkey,10)}for(pki=0;pki<childds.length;pki++){if(childds[pki][parentrow.closest("table").data("igGrid").options.primaryKey]===tmpkey){childds=childds[pki][opts[i].key];break}}if(!childds){if(dsString.substr(dsString.length-1)==="/"){dsString=dsString.substring(0,dsString.length-1)}pid=typeof tmpkey==="string"?"'"+tmpkey+"'":tmpkey;if(keyspathvar.charAt(0)!=="/"){keyspathvar="/"+keyspathvar}if($.type(dsobj)==="string"&&dsobj!==dsString){dsString=dsobj.substring(0,dsobj.lastIndexOf("/"))+dsString.substring(dsString.lastIndexOf("/"))}opts[i].dataSource=dsString+"("+pid+")"+keyspathvar}else{if(childds.__deferred&&childds.__deferred.uri){opts[i].dataSource=childds.__deferred.uri;if(dsobj.indexOf("$callback=?")!==-1){opts[i].dataSource+="?$callback=?"}if(dsobj.indexOf("$format=")!==-1){if(dsobj.indexOf("$format=json")!==-1){opts[i].dataSource+="&$format=json"}else{opts[i].dataSource+="&$format=atom"}}}}if(restSettingsSet===true){this._inheritRestSettings(null,parentrow.attr("data-id"),keyspathvar.toLowerCase(),popts,opts[i])}}else if(this.options.rest===true){if(ds.substr(ds.length-1)!=="/"){ds+="/"}pid=parentrow.attr("data-id");opts[i].dataSource=ds+pid+"/"+keyspathvar.toLowerCase();if(restSettingsSet===true){this._inheritRestSettings(opts[i].dataSource,pid,keyspathvar.toLowerCase(),popts,opts[i])}}else if(instanceOfDs){opts[i].dataSource=ds.settings.dataSource+this._hds._encodeUrlPath(rowid,opts[i].key)}else{if(opts[i].dataSource){if(opts[i].dataSource.indexOf("?")!==-1){opts[i].dataSource+="&"+this._hds._encodeUrlPath(rowid,opts[i].key)}else{opts[i].dataSource+="?"+this._hds._encodeUrlPath(rowid,opts[i].key)}opts[i].dataSourceType="remoteUrl"}else{if($.type(opts[i].dataSource)==="string"&&$.type(ds)!=="string"){opts[i].dataSource+="?"+this._hds._encodeUrlPath(rowid,opts[i].key);opts[i].dataSourceType="remoteUrl"}else{opts[i].dataSource=ds+"?"+this._hds._encodeUrlPath(rowid,opts[i].key)}}if(opts[i].dataSource!==opts[i].dataSourceUrl){opts[i].dataSourceUrl=opts[i].dataSource}}}}if(sp){noCancel=this._trigger(this.events.childrenPopulating,null,{owner:this,parentrow:parentrow,id:rowid});if(noCancel){for(i=0;i<opts.length;i++){id=parentrow.attr("data-id");if(!this._eventQueue["id"+id]||!this._eventQueue["id"+id].length){this._eventQueue["id"+id]=[]}h=$.proxy(this._childRendered,this);this._eventQueue["id"+id].push({grid:childgrids[i],handler:h,parentrow:parentrow,id:rowid});childgrids[i].bind("iggridrendered",h);if(this.options.autoGenerateLayouts===true){opts[i]._recurseSchema=true}if(isHierarchical){opts[i]._isHierarchicalGrid=true}pgInstance=parentrow.closest(".ui-iggrid-table").data("igGrid");if(pgInstance){opts[i].foreignKeyValue=pgInstance._fixPKValue(parentrow.data("id"))}else{opts[i].foreignKeyValue=parentrow.data("id")}childgrids[i].trigger(this.events.childGridCreating,eArgs);noCancelChild=childgrids[i].attr("data-create");if(noCancelChild!=="false"){childgrids[i].igGrid(opts[i]);childgrids[i].trigger(this.events.childGridCreated,{owner:this,element:childgrids[i]});if(isHierarchical){this._regToggleEvent(childgrids[i],this)}}}}}animatec.attr("id","ac_"+parentrow.attr("data-id"));parentrow.attr("c",true);parentrow.next().hide();animatec.hide();this._expand(parentrow,suppressEvents,callback)}else{if(state==="e"){this._collapse(parentrow,suppressEvents,callback)}else if(state==="c"){this._expand(parentrow,suppressEvents,callback)}}this.indicator.hide();parentrow.find(".ui-iggrid-expandbutton").css("visibility","visible")},_layouts:function(){this.element.unbind("iggriddatarendering",this._databoundHandler)},_columnsGenerated:function(event,args){var layoutKey=args.key,layout;if(!layoutKey){return}layout=this._findLayout(this.rootWidget().options.columnLayouts,layoutKey);if(layout.columns&&layout.columns.length&&layout.columns.length>0){return}layout.columns=args.owner.options.columns},_findLayout:function(layouts,key){var i,layout;for(i=0;layouts&&i<layouts.length;i++){if(layouts[i].key===key){layout=layouts[i];break}if(!layout&&layouts[i].columnLayouts){layout=this._findLayout(layouts[i].columnLayouts,key)}}return layout},_hdsoptions:function(){var opts,schema,instanceOfHds;opts={responseDataKey:this.options.responseDataKey,responseTotalRecCountKey:this.options.responseTotalRecCountKey,dataSource:this.options.dataSource,primaryKey:this.options.primaryKey,localSchemaTransform:this.options.localSchemaTransform,autoCommit:this.options.autoCommit,odata:this.options.odata,serializeTransactionLog:this.options.serializeTransactionLog,updateUrl:this.options.updateUrl,restSettings:this.options.restSettings,initialDataBindDepth:this.options.initialDataBindDepth};if(this.options.dataSourceType!==null){opts.type=this.options.dataSourceType}schema=this._hschema();instanceOfHds=this.options.dataSource&&typeof this.options.dataSource._encodeHierarchicalUrlParams==="function"&&this.options.dataSource.settings&&this.options.dataSource.settings.hasOwnProperty&&this.options.dataSource.settings.hasOwnProperty("initialDataBindDepth");if(instanceOfHds&&this.options.dataSource.settings.schema===null||!instanceOfHds){opts=$.extend(opts,{schema:schema})}return opts},_getDataColumns:function(cols){var i,j,res=[],colsLength=cols.length,dCols;for(i=0;i<colsLength;i++){if(cols[i].group!==undefined&&cols[i].group!==null){dCols=this._getDataColumns(this._getDataColumns(cols[i].group));for(j=0;j<dCols.length;j++){res.push(dCols[j])}}else{res.push(cols[i])}}return res},_hschema:function(){var schema,i,j,rec,prop,cols=this._getDataColumns(this.options.columns),encodedLayouts=[],k,c;if(cols.length>0&&!this.options.autoGenerateColumns){schema={};schema.fields=[];j=0;for(i=0;i<cols.length;i++){if(cols[i].unbound===true){continue}schema.fields[j]={};schema.fields[j].name=cols[i].key;schema.fields[j].type=cols[i].dataType;j++}schema.searchField=this.options.responseDataKey}else if(this.options.autoGenerateColumns){schema={};schema.fields=[];if(this.options.dataSource&&this.options.dataSource.length&&this.options.dataSource.length>0&&$.type(this.options.dataSource)==="array"){rec=this.options.dataSource[0];for(prop in rec){if(rec.hasOwnProperty(prop)){for(k=0;k<cols;k++){if(cols[k].key===prop){c=cols[k];break}}if(c===null||c===undefined){schema.fields.push({name:prop,type:$.ig.getColType(rec[prop])})}else{if(c.unbound===true){continue}schema.fields.push({name:prop,type:c.dataType})}}}}}if(this.options.columnLayouts&&this.options.columnLayouts.length>0){for(j=0;j<this.options.columnLayouts.length;j++){schema.fields.push({name:this.options.columnLayouts[j].childrenDataProperty===undefined?this.options.columnLayouts[j].key:this.options.columnLayouts[j].childrenDataProperty})}}this._parseLayouts(encodedLayouts,"",this.options);schema.layouts=encodedLayouts;return schema},_parseLayouts:function(layouts,cpath,options){var j,layout,p,cdp=null;if(options.columnLayouts&&options.columnLayouts.length!==undefined&&options.columnLayouts.length>0){for(j=0;j<options.columnLayouts.length;j++){layout=options.columnLayouts[j];cdp=layout.childrenDataProperty===undefined?layout.key:layout.childrenDataProperty;if(!cdp){cdp=this.options.defaultChildrenDataProperty}p=cpath+this.options.pathSeparator+cdp+":"+layout.primaryKey;layouts[p]=layout;this._parseLayouts(layouts,p,layout)}}},_batchExpand:function(){var crows=[],tmpanim,hgrid;hgrid=this.element.closest(".ui-iggrid-root").data("igHierarchicalGrid");if(!hgrid){hgrid=this.element.data("igHierarchicalGrid")}tmpanim=hgrid.options.expandCollapseAnimations;hgrid.options.expandCollapseAnimations=false;crows=this.element.find("tr[data-id]");hgrid._batchExpandLevel(crows);hgrid.options.expandCollapseAnimations=tmpanim},_batchExpandLevel:function(rows){var i;for(i=0;i<rows.length;i++){this.toggle(rows[i])}},_renderExtraHeaderCell:function(row,colgroup,prepend){if(prepend===true){$("<td></td>").prependTo(row).css("border-width",0).attr("data-skip",true)}else{$("<td></td>").appendTo(row).css("border-width",0).attr("data-skip",true)}},_renderExtraFooterCell:function(row,colgroup,prepend,cssClass){if(prepend===true){$("<td></td>").addClass(cssClass).prependTo(row).attr("data-skip",true)}else{$("<td></td>").addClass(cssClass).appendTo(row).attr("data-skip",true)}},_headerrenderedinternal:function(sender,args){if(args.owner.element[0].id!==sender.currentTarget.id&&args.owner.element[0].id!==sender.currentTarget.id+"_table"){return}var self=this,flatRenderColgroup=args.owner._renderColgroup,tmpid,$thDataSkip;args.owner._renderRecord=$.proxy(this._hierarchicalRenderRecord,args.owner);args.owner._getFirstVisibleTR=$.proxy(this._hierarchicalGetFirstVisibleTR,args.owner);args.owner._getLastVisibleTR=$.proxy(this._hierarchicalGetLastVisibleTR,args.owner);args.owner._renderRecordInArray=$.proxy(this._hierarchicalRenderRecordInArray,args.owner);args.owner._renderColgroup=function(){self._hierarchicalRenderColgroup.apply(args.owner,$.merge([flatRenderColgroup,self],arguments))};args.owner._headerInitCallbacks.push({type:"HierarchicalGrid",func:$.proxy(this._renderExtraHeaderCell,this)});args.owner._footerInitCallbacks.push({type:"HierarchicalGrid",func:$.proxy(this._renderExtraFooterCell,this)});args.owner._trigger("headerextracellsmodified",null,{owner:args.owner});if(args.table.attr("id")!==args.owner.element.attr("id")&&$(args.table).find("colgroup col[data-expander]").length===0){$("<col></col>").attr("data-skip","true").attr("data-expander",true).prependTo(args.table.find("colgroup")).width(this.options.expandColWidth)}$thDataSkip=$("<th></th>");$("<span></span>").appendTo($thDataSkip.prependTo(args.table.find("thead tr:first")).addClass(this.css.expandHeaderCell).attr("data-skip",true)).addClass(this.css.expandHeaderCellTriangle);if(args.owner._isMultiColumnGrid){$thDataSkip.attr("rowspan",args.owner._maxLevel+1)}if(args.owner._isWrapped){tmpid=args.owner.element.attr("id").substring(0,args.owner.element.attr("id").indexOf("_table"));args.owner.container().find("#"+tmpid).unbind("iggridheaderrenderedinternal",args.owner.element.data("hr"));args.owner.container().find("#"+tmpid).removeData("hr")}else{args.owner.element.unbind("iggridheaderrenderedinternal",args.owner.element.data("hr"));args.owner.element.removeData("hr")}},_checkIsMultiColumnHeader:function(lobj){var i,cols=lobj.columns,colsLength;if(cols){colsLength=cols.length;for(i=0;i<colsLength;i++){if(cols[i].group!==undefined&&cols[i].group!==null){return true}}}return false},_hierarchicalRenderRecord:function(data,rowIndex){var i,grid=this,lod,hg,childprop,dstr="",val,markup="",layouts,hasChildren,noVisibleColumns,layout,temp;if(rowIndex%2!==0&&this.options.alternateRowStyles){dstr+='<tr class="'+grid.css.recordAltClass+'"'}else{dstr+="<tr"}dstr+=' data-row-idx="'+rowIndex+'"';if(!this._hg){hg=this.element.closest(".ui-iggrid-root").data("igHierarchicalGrid");if(!hg){hg=this.element.hasClass(".ui-iggrid-root")?this.element:undefined}this._hg=hg}else{hg=this._hg}if(this.options.foreignKey){dstr+=" data-id-fk='"+this._kval_from_key(this.options.foreignKey,data)+"'"}else{if(this.options.primaryKey===null||this.options.primaryKey===undefined){this.options.primaryKey="ig_pk";val=hg._getVal(data);dstr+=" data-id-fk='"+val+"'"}else if(this.options.primaryKey==="ig_pk"){val=hg._getVal(data);dstr+=" data-id-fk='"+val+"'"}else{dstr+=" data-id-fk='"+this._kval_from_key(this.options.primaryKey,data)+"'"}}if(this.options.primaryKey===null||this.options.primaryKey===undefined){this.options.primaryKey="ig_pk";val=hg._getVal(data);dstr+=" data-id='"+val+"'"}else if(this.options.primaryKey==="ig_pk"){val=hg._getVal(data);
dstr+=" data-id='"+val+"'"}else{dstr+=" data-id='"+this._kval_from_key(this.options.primaryKey,data)+"'"}dstr+=' role="row" aria-expanded="false" tabindex="'+this.options.tabIndex+'">';layouts=this.options.columnLayouts;hasChildren=false;lod=hg?hg.options.initialDataBindDepth>-1:false;if(!lod){for(i=0;layouts&&i<layouts.length;i++){if(data[layouts[i].key]){childprop=layouts[i].key;layout=layouts[i]}else{childprop=layouts[i].childrenDataProperty}childprop=childprop||this.options.defaultChildrenDataProperty;if(childprop){if(layout&&layout.responseDataKey){if(data[childprop]&&data[childprop][layout.responseDataKey]&&data[childprop][layout.responseDataKey].length!==undefined&&(data[childprop][layout.responseDataKey].length>0||this._shouldAlwaysRenderChildIndicator)){hasChildren=true;break}}else{if(data[childprop]){if(data[childprop].length!==undefined&&(data[childprop].length>0||this._shouldAlwaysRenderChildIndicator)){hasChildren=true;break}if(this.options.responseDataKey&&data[childprop][this.options.responseDataKey]&&data[childprop][this.options.responseDataKey].length!==undefined&&(data[childprop][this.options.responseDataKey].length>0||this._shouldAlwaysRenderChildIndicator)){hasChildren=true;break}}}}}}else{hasChildren=true}if(hasChildren){markup='<span class="ui-iggrid-expandbuttoncontainer"><span class="ui-iggrid-expandbutton ui-icon ui-icon-plus" title="'+hg.options.expandTooltip+'"></span></span>'}dstr+='<td tabindex="0" class="ui-iggrid-expandcolumn'+grid._addCellStyle(data,-1).replace(/class=\"/,"").replace(/\"/,"")+'" data-parent="'+hasChildren+'">'+markup+"</td>";noVisibleColumns=true;$(this.options.columns).each(function(colIndex){var col=grid.options.columns[colIndex];if(col.hidden){return}noVisibleColumns=false;dstr+='<td role="gridcell"  aria-readonly='+!!this.readOnly+' aria-describedby="'+grid.id()+"_"+this.key+'" tabindex="'+grid.options.tabIndex+'"';if(data[this.key]===undefined){if(this.template&&this.template.length){if(col.unbound){temp=grid._renderTemplatedCell(data,this)}else{temp=grid._renderTemplatedCell(data[colIndex],this)}if(temp.indexOf("<td")===0){dstr+=temp.substring(3)}else{dstr+=">"+temp}dstr=grid._editCellStyle(dstr,data,colIndex)}else{dstr+=grid._addCellStyle(data,colIndex,col)+">"+grid._renderCell(data[colIndex],this,data)}dstr+="</td>"}else{if(this.template&&this.template.length){temp=grid._renderTemplatedCell(data,this);if(temp.indexOf("<td")===0){dstr+=temp.substring(3)}else{dstr+=">"+temp}dstr=grid._editCellStyle(dstr,data,this.key)}else{dstr+=grid._addCellStyle(data,this.key,col)+">"+grid._renderCell(data[this.key],this,data)}dstr+="</td>"}});if(noVisibleColumns){dstr+='<td role="gridcell"></td>'}dstr+="</tr>";return dstr},_getVal:function(data){var val;if(data.ig_pk){val=data.ig_pk}else{val=$.ig.util.getCheckSumForObject(data);data.ig_pk=val}return val},_hierarchicalRenderRecordInArray:function(darr,tbody,data,rowIndex){var i,grid=this,lod,hg,childprop,layout,val,responseDataKey,markup="",layouts,hasChildren,noVisibleColumns,appendBehavior=false,temp;if(darr===null){darr=[];appendBehavior=true}if(rowIndex%2!==0&&this.options.alternateRowStyles){darr.push('<tr class="'+grid.css.recordAltClass+'"')}else{darr.push("<tr")}if(this.options.foreignKey){darr.push(" data-id-fk='"+this._kval_from_key(this.options.foreignKey,data)+"'")}else{if(this.options.primaryKey===null||this.options.primaryKey===undefined){this.options.primaryKey="ig_pk";val=$.ig.util.getCheckSumForObject(data);darr.push(" data-id-fk='"+val+"'");data.ig_pk=val}else if(this.options.primaryKey==="ig_pk"){val=$.ig.util.getCheckSumForObject(data);darr.push(" data-id-fk='"+val+"'");data.ig_pk=val}else{darr.push(" data-id-fk='"+this._kval_from_key(this.options.primaryKey,data)+"'")}}if(this.options.primaryKey===null||this.options.primaryKey===undefined){this.options.primaryKey="ig_pk";val=$.ig.util.getCheckSumForObject(data);darr.push(" data-id='"+val+"'");data.ig_pk=val}else if(this.options.primaryKey==="ig_pk"){val=$.ig.util.getCheckSumForObject(data);darr.push(" data-id='"+val+"'");data.ig_pk=val}else{darr.push(" data-id='"+this._kval_from_key(this.options.primaryKey,data)+"'")}darr.push(' role="row">');layouts=this.options.columnLayouts;hasChildren=false;hg=this.element.closest(".ui-iggrid-root").data("igHierarchicalGrid");if(!hg){hg=this.element.hasClass(".ui-iggrid-root")?this.element:undefined}lod=hg?hg.options.initialDataBindDepth>-1:false;if(!lod){for(i=0;layouts&&i<layouts.length;i++){layout=layouts[i];if(data[layout.key]){childprop=layout.key}else{childprop=layout.childrenDataProperty}childprop=childprop||this.options.defaultChildrenDataProperty;responseDataKey=layout&&layout.responseDataKey||this.options.responseDataKey;if(childprop&&data[childprop]){if(responseDataKey&&data[childprop][responseDataKey]&&data[childprop][responseDataKey].length!==undefined&&data[childprop][responseDataKey].length>0){hasChildren=true;break}if(data[childprop].length!==undefined&&data[childprop].length>0){hasChildren=true;break}}}}else{hasChildren=true}if(hasChildren){markup='<span class="ui-iggrid-expandbuttoncontainer"><span class="ui-iggrid-expandbutton ui-icon ui-icon-plus" title="'+hg.options.expandTooltip+'"></span></span>'}darr.push('<td tabindex="0" class="ui-iggrid-expandcolumn'+grid._addCellStyle(data,-1)+'" data-parent="'+hasChildren+'">'+markup+"</td>");noVisibleColumns=true;$(this.options.columns).each(function(colIndex){if(grid.options.columns[colIndex].hidden){return}noVisibleColumns=false;darr.push('<td role="gridcell"  aria-readonly='+!!this.readOnly+' aria-describedby="'+grid.id()+"_"+this.key+'" tabindex="'+grid.options.tabIndex+'"');if(data[this.key]===undefined){if(this.template&&this.template.length){temp=grid._renderTemplatedCell(data,this);if(temp.indexOf("<td")===0){darr[darr.length-1]=temp.replace("<td",darr[darr.length-1])}else{darr.push(">"+temp)}darr[darr.length-1]=grid._editCellStyle(darr[darr.length-1],data,colIndex)}else{darr.push(grid._addCellStyle(data,colIndex,grid.options.columns[colIndex])+">"+grid._renderCell(data[colIndex],this,data))}darr.push("</td>")}else{if(this.template&&this.template.length){temp=grid._renderTemplatedCell(data,this);if(temp.indexOf("<td")===0){darr[darr.length-1]=temp.replace("<td",darr[darr.length-1])}else{darr.push(">"+temp)}darr[darr.length-1]=grid._editCellStyle(darr[darr.length-1],data,this.key)}else{darr.push(grid._addCellStyle(data,this.key,grid.options.columns[colIndex])+">"+grid._renderCell(data[this.key],this,data))}darr.push("</td>")}});if(noVisibleColumns){darr.push('<td role="gridcell"></td>')}darr.push("</tr>");if(appendBehavior){tbody.append(darr.join(""))}},_hierarchicalRenderColgroup:function(flatRenderColgroup,hierarchicalGrid,table,isHeader,isFooter,autofitLastColumn){flatRenderColgroup.apply(this,[table,isHeader,isFooter,autofitLastColumn]);if($(table).find("colgroup col[data-expander]").length>0){return}$("<col></col>").prependTo($(table).find("colgroup")).css("width",hierarchicalGrid.options.expandColWidth).attr("data-skip","true").attr("data-expander",true)},_schemaGenerated:function(event,args){var hg,i,rec,schema=args.schema,ds=args.dataSource,$this=args.owner,prop;hg=$this.element.closest(".ui-iggrid-root").data("igHierarchicalGrid");if(!hg){hg=$this.element.hasClass(".ui-iggrid-root")?$this.element:undefined}if(!hg||hg.options.initialDataBindDepth>-1){return}for(i=0;ds&&ds.length&&$.type(ds)==="array"&&i<ds.length;i++){rec=ds[i];for(prop in rec){if(rec.hasOwnProperty(prop)){if(!$this._fieldExists(prop,schema)&&($.type(rec[prop])==="array"||$.type(rec[prop])==="object")){schema.fields.push({name:prop,type:$.ig.getColType(rec[prop])})}}}}},_childRendered:function(sender,args){var ptr=args.owner.element.closest("tr").prev(),pid="id"+ptr.attr("data-id"),e=this._eventQueue[pid],i,fire=true;this._trigger(this.events.childGridRendered,null,{owner:this,parentrow:ptr,childgrid:args.owner});if(!e){args.owner.element.unbind("iggridrendered.hierarchicalgrid");return}for(i=0;e.length!==undefined&&i<e.length;i++){if(e[i].grid.attr("id")===args.owner.element.attr("id")){e[i].done=true;e[i].grid.unbind("iggridrendered",e[i].handler);break}}for(i=0;e.length!==undefined&&i<e.length;i++){if(!e[i].done){fire=false;break}}if(fire){this._trigger(this.events.childrenPopulated,null,{owner:this,parentrow:ptr,id:e[0].id});delete this._eventQueue[pid]}},_optsFor:function(popts){var i,j,o=[],layouts;if(popts.columnLayouts&&popts.columnLayouts.length>0&&$.type(popts.columnLayouts)==="array"){layouts=popts.columnLayouts;for(j=0;j<layouts.length;j++){this._inherit(popts,layouts[j]);o.push($.extend(true,{},$.ui.igGrid.prototype.options,layouts[j]))}}for(i=0;i<o.length;i++){if(!o[i].dataSource){o[i].dataSourceUrl=popts.dataSourceUrl}else{if(String(popts.initialDataBindDepth)==="-1"||popts.initialDataBindDepth===undefined){o[i].dataSourceUrl=o[i].dataSource}}}return o},_inherit:function(parent,child){var i,f,j,nowrite;if(parent.dataSourceType){child.dataSourceType=parent.dataSourceType}if(!parent.features||parent.features.length===undefined||parent.features.length===0){return}if(!child.features||child.features.length===undefined){child.features=[]}for(i=0;i<parent.features.length;i++){if(parent.features[i].inherit===true){f=null;for(j=0;j<child.features.length;j++){if(child.features[j].name===parent.features[i].name){f=child.features[j];break}}if(f===null||f===undefined){child.features.push($.extend(true,{},parent.features[i]));child.features[child.features.length-1].columnSettings=[]}else{nowrite=false;if(child.features[j].columnSettings&&child.features[j].columnSettings.length>0){nowrite=true}child.features[j]=$.extend(true,{},parent.features[i],f);if(!nowrite){child.features[j].columnSettings=[]}}}}},_regevents:function(e,context){var headerRenderedInternal,datarendered,schemaGenerated;headerRenderedInternal=$.proxy(context._headerrenderedinternal,context);datarendered=$.proxy(this._handleBatchExpandRender,context);schemaGenerated=$.proxy(this._schemaGenerated,context);e.bind("iggridheaderrenderedinternal",headerRenderedInternal);e.bind("iggriddatarendered",datarendered);e.bind("iggridschemagenerated",schemaGenerated);e.data("hr",headerRenderedInternal)},_regToggleEvent:function(e,context){var toggle;toggle=$.proxy(context._toggleInternalWithDelay,context);e.undelegate(".ui-iggrid-expandcolumn > .ui-iggrid-expandbuttoncontainer","mousedown");e.delegate(".ui-iggrid-expandcolumn > .ui-iggrid-expandbuttoncontainer","mousedown",toggle)},commit:function(){var elem=this.element;elem.find(".ui-iggrid-table").each(function(){$(this).igGrid("commit")});elem.igGrid("commit")},rollback:function(rebind){var elem=this.element;elem.find(".ui-iggrid-table").each(function(){$(this).igGrid("rollback",null,rebind)});elem.igGrid("rollback",null,rebind)},_addToLog:function(elem,taLog,child){var grid=elem.data("igGrid"),ds=grid?grid.dataSource:null,gridLog=ds?ds._accumulatedTransactionLog:null,i=gridLog?gridLog.length:0;if(!i){return}this._dsLog=this._dsLog||[];this._dsLog.push(ds);while(i-->0){taLog.push($.extend(true,child?{layoutKey:grid.options.key}:{},gridLog[i]))}},saveChanges:function(success,error){var self=this,opts,elem=self.element,url=self.options.updateUrl,taLog=[];if((this.options.rest||this.options.odata)&&this.options.restSettings){this._saveChangesForEachGrid();return}if(!url||!elem){return}delete self._dsLog;self._addToLog(elem,taLog);elem.find(".ui-iggrid-table").each(function(){self._addToLog($(this),taLog,true)});opts={type:"POST",url:url,data:{ig_transactions:JSON.stringify(taLog)},success:function(data,textStatus,jqXHR){var logs=self._dsLog,i=logs?logs.length:0;while(i-->0){logs[i]._saveChangesSuccess(data,textStatus,jqXHR)}if(success){success(data,textStatus,jqXHR)}},error:function(jqXHR,textStatus,errorThrown){var logs=self._dsLog,i=logs?logs.length:0;while(i-->0){logs[i]._saveChangesError(jqXHR,textStatus,errorThrown)}if(error){error(jqXHR,textStatus,errorThrown)}}};$.ajax(opts)},_saveChangesForEachGrid:function(success,error){this.rootWidget().saveChanges(success,error);$.each(this.allChildrenWidgets(),function(){this.saveChanges(success,error)})},_handleBatchExpandRender:function(sender,args){var level=0,grid=args.owner,keyspath,ds,hdsData,o,k,curpath,rowid,popts,pgridp,gridId=grid.element[0].id,tId=sender.currentTarget.id;if(gridId!==tId&&gridId!==tId+"_table"){return}level=parseInt(grid.element.attr("data-level"),10);if(isNaN(level)){level=0;grid.element.attr("data-level",level)}if(level>0&&this.options.initialDataBindDepth===-1&&this._hds.settings.type==="json"&&$.type(grid.options.dataSource)==="string"){keyspath="";curpath=0;rowid="";popts=grid.options;if(popts.childrenDataProperty===undefined){if(popts.key){keyspath=popts.key}}else{keyspath+=popts.childrenDataProperty}pgridp=grid.element;pgridp=pgridp.closest(".ui-iggrid-childarea").parent().prev();while(pgridp.length>0){if(curpath!==0){rowid+=this.options.pathSeparator}o=pgridp.closest(".ui-iggrid-table").data("igGrid").options;k=o.primaryKey;rowid+=k+":"+pgridp.attr("data-id");if(o.childrenDataProperty===undefined){if(o.key){keyspath+=this.options.pathSeparator+o.key}}else{keyspath+=this.options.pathSeparator+o.childrenDataProperty}pgridp=pgridp.closest(".ui-iggrid-childarea").parent().prev();curpath++}keyspath=keyspath.split(this.options.pathSeparator).reverse().join(this.options.pathSeparator);rowid=rowid.split(this.options.pathSeparator).reverse().join(this.options.pathSeparator);hdsData=this._hds.dataAt(rowid,keyspath);ds=grid.dataSource;if(hdsData[popts.responseDataKey]){hdsData[popts.responseDataKey]=ds._dataView;hdsData.Metadata=ds.metadata()}}if(level>this.options.initialExpandDepth){return}if((this.options.initialDataBindDepth===-1||this.options.initialDataBindDepth>=this.options.initialExpandDepth)&&this.options.initialExpandDepth!==-1){setTimeout($.proxy(this._batchExpand,args.owner),1)}},_inheritRestSettings:function(path,pid,layout,popts,copts){var crest=copts.restSettings,prest=popts.restSettings,rs,ptmpl,fullpath;if(!path){if(prest.update.template||prest.remove.template){path=prest.update.template||prest.remove.template;path=path.replace("${id}",pid)}else{path=prest.create.url||prest.update.url||prest.remove.url;if(path.substr(path.length-1)!=="/"){path+="/"}path+=pid}if(layout.substr(0,1)==="/"){layout=layout.substr(1)}if(path.substr(path.length-1)!=="/"){path+="/"}fullpath=path+layout}else{fullpath=path}rs={update:{url:fullpath},create:{url:fullpath},remove:{url:fullpath}};if(crest.create.template&&prest.create.template){ptmpl=prest.create.template.replace("${id}",pid);crest.create.template=ptmpl+"/"+crest.create.template}if(crest.remove.template&&prest.remove.template){ptmpl=prest.remove.template.replace("${id}",pid);crest.remove.template=ptmpl+"/"+crest.remove.template}if(crest.update.template&&prest.update.template){ptmpl=prest.update.template.replace("${id}",pid);crest.update.template=ptmpl+"/"+crest.update.template}crest=$.extend(true,crest,rs)},_rowExpanded:function(args){var rowExpansion,rowHeight,parentGrid,currentHeight,rootGrid;rowExpansion=args.parentrow.next();if(rowExpansion.length===0||!rowExpansion.is('tr[data-container="true"]')){return}rowHeight=rowExpansion.outerHeight();parentGrid=args.parentrow.closest(".ui-iggrid-table").data("igGrid");currentHeight=parentGrid._getScrollContainerHeight();parentGrid._setScrollContainerHeight(currentHeight+rowHeight);rootGrid=this.element.closest(".ui-iggrid-root").data("igGrid");if(rootGrid.options.rowVirtualization&&!parentGrid.options.height&&rootGrid.options.height){currentHeight=rootGrid._getScrollContainerHeight();rootGrid._setScrollContainerHeight(currentHeight+rowHeight)}},_rowCollapsed:function(args){var rowExpansion=args.parentrow.next(),rowHeight,parentGrid,currentHeight,rootGrid;if(rowExpansion.length===0||!rowExpansion.is('tr[data-container="true"]')){return}rowHeight=rowExpansion.outerHeight();parentGrid=args.parentrow.closest(".ui-iggrid-table").data("igGrid");currentHeight=parentGrid._getScrollContainerHeight();parentGrid._setScrollContainerHeight(currentHeight-rowHeight);rootGrid=this.element.closest(".ui-iggrid-root").data("igGrid");if(rootGrid.options.rowVirtualization&&!parentGrid.options.height&&rootGrid.options.height){currentHeight=rootGrid._getScrollContainerHeight();rootGrid._setScrollContainerHeight(currentHeight-rowHeight)}},_hierarchicalGetFirstVisibleTR:function(visibleArea){var tableId="#"+this.element[0].id,firstVisibleTR;firstVisibleTR=$(tableId+' > tbody > tr:not([data-container="true"])').filter(function(){return this.offsetTop+$(this).height()>visibleArea.top}).first();return firstVisibleTR},_hierarchicalGetLastVisibleTR:function(visibleArea){var tableId="#"+this.element[0].id,lastVisibleTR;lastVisibleTR=$(tableId+' > tbody > tr:not([data-container="true"])').filter(function(){return this.offsetTop<visibleArea.bottom}).last();return lastVisibleTR},destroy:function(){this.tmpDataSource=null;this._rootgrid=null;this.rootWidget().destroy();$.Widget.prototype.destroy.call(this)}});$.extend($.ui.igHierarchicalGrid,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Merged Cells 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){"use strict";$.widget("ui.igGridCellMerging",{css:{mergedCellsTop:"ui-iggrid-mergedcellstop",mergedCellsBottom:"ui-iggrid-mergedcellsbottom",mergedCell:"ui-iggrid-mergedcell"},options:{initialState:"regular",inherit:false},events:{cellsMerging:"cellsMerging",cellsMerged:"cellsMerged"},_create:function(){this._sortingRequested=false;this._v=false},destroy:function(){this._removePaint();this._unregisterEvents();$.Widget.prototype.destroy.call(this);return this},_gridSorting:function(){this._sortingRequested=true},_gridSorted:function(){this._sortingRequested=false;this._notInitial=true},_gridRendered:function(){var key,index,sExp=this.grid.dataSource.settings.sorting.expressions,i,j;if(this.options.initialState==="merged"&&this._sortingRequested===false&&!this._notInitial){for(j=0;j<this.grid._visibleColumns().length;j++){this._paintMergedCells(j,this.grid._visibleColumns()[j].key)}}else{for(i=0;i<sExp.length;i++){key=sExp[i].fieldName;for(j=0;j<this.grid._visibleColumns().length;j++){if(this.grid._visibleColumns()[j].key===key){index=j;break}}if(typeof this.grid._startColIndex==="number"){index-=this.grid._startColIndex}if(index!==null&&index!==undefined&&key){this._paintMergedCells(index,key)}}}},_rrn:function(){this._gridRendered()},_rcn:function(){this._gridRendered()},_columnsCollectionModified:function(){this._gridRendered()},_paintMergedCells:function(index,key){var cells,prvCell,curCell,prvCellTxt,curCellTxt,first=true,str=false,hasFixedCols=this.grid.hasFixedColumns(),count=0,i,args,cval,noCancel;if(hasFixedCols){if(key){index=this.grid.element.data("igGridColumnFixing")._getVisibleIndex(key)+1}else{index=index+1+this._getSystemFixedColumnsCount()}if(this.grid.isFixedColumn(key)){cells=this.grid.container().find("#"+this.grid.id()+"_fixed tbody tr>td:nth-child("+index+")")}else{cells=this.grid.container().find("#"+this.grid.id()+" tbody tr>td:nth-child("+index+")")}}else{cells=this.grid.container().find("#"+this.grid.id()+" tbody tr>td:nth-child("+(index+1+this._getSystemColumnsCount())+")")}this._addVirtualBorderCells(cells,key);prvCell=cells.eq(0);for(i=1;i<cells.length;i++){curCell=cells.eq(i);prvCellTxt=this._getComparableCellText(prvCell);curCellTxt=this._getComparableCellText(curCell);if(prvCellTxt===curCellTxt&&prvCellTxt!==cval){if(str===false){args=this._getEventArgsForCell(prvCell);noCancel=this._trigger(this.events.cellsMerging,this,args);if(noCancel!==true){cval=prvCellTxt;prvCell=curCell;continue}}cval=null;str=true;if(first===true){if(!cells.eq(i-1)[0].fictive){cells.eq(i-1).addClass(this.css.mergedCellsTop)}first=false;count++}if(!curCell[0].fictive){curCell.addClass(this.css.mergedCell)}count++}else{if(str===true){args.count=count;count=0;this._trigger(this.events.cellsMerged,this,args);cells.eq(i-1).addClass(this.css.mergedCellsBottom);str=false}first=true}prvCell=curCell}if(str===true){args.count=count;this._trigger(this.events.cellsMerged,this,args);if(!cells.eq(cells.length-1)[0].fictive){cells.eq(cells.length-1).addClass(this.css.mergedCellsBottom)}}},_addVirtualBorderCells:function(list,key){var ds=this.grid.dataSource.dataView();if(this._v===true){if(this.grid._startRowIndex>0){list.splice(0,0,{txt:String(ds[this.grid._startRowIndex-1][key]),fictive:true})}if(this.grid._startRowIndex+this.grid._virtualRowCount<this.grid.dataSource.dataView().length){list.splice(list.length,0,{txt:String(ds[this.grid._startRowIndex+this.grid._virtualRowCount][key]),fictive:true})}}},_getSystemFixedColumnsCount:function(){var firstRow=this.grid.fixedContainer().find("tbody>tr:not([data-container='true'],[data-grouprow='true']):first");return firstRow.children("[data-parent='true'],[data-skip='true'],th").length},_getSystemColumnsCount:function(){var firstRow=this.grid.container().find("#"+this.grid.id()+" tbody>tr:not([data-container='true'],[data-grouprow='true']):first");return firstRow.children("[data-parent='true'],[data-skip='true'],th").length},_getEventArgsForCell:function(cell){var args,row,rKey,rIdx,val;if(cell[0].fictive){row=null;rKey=null;rIdx=this.grid._startRowIndex?this.grid._startRowIndex-1:-1;val=cell[0].txt}else{row=cell.closest("tr");rKey=row.attr("data-id");rIdx=this._getVisibleRowIndex(row);if(rKey===""||rKey===null||rKey===undefined){rKey=rIdx}val=cell.html()}args={owner:this,row:row,rowIndex:rIdx,rowKey:rKey,grid:this.grid,value:val};return args},_getComparableCellText:function(cell){var text=cell[0].fictive?cell[0].txt:cell.html().replace(/^&nbsp;$/,"");if(this.grid.dataSource.settings.sorting.caseSensitive===false){text=text.toLowerCase()}return text},_getVisibleRowIndex:function(row){return row.closest("tbody").children("tr:not([data-container='true'],[data-grouprow='true'])").index(row)+(this.grid._startRowIndex||0)},_removePaint:function(){var dataRows=this.grid.container().find("#"+this.grid.id()+"> tbody > tr:not([data-container='true'],[data-grouprow='true'])"),cells,i;cells=dataRows.children("td."+this.css.mergedCellsTop+",td."+this.css.mergedCell);for(i=0;i<cells.length;i++){$(cells[i]).removeClass(this.css.mergedCellsTop).removeClass(this.css.mergedCell).removeClass(this.css.mergedCellsBottom)}},_createHandlers:function(){this._sortingInitiatedHandler=$.proxy(this._gridSorting,this);this._sortingHandler=$.proxy(this._gridSorted,this);this._virtualRowsHandler=$.proxy(this._rrn,this);this._virtualColumnsHandler=$.proxy(this._rcn,this);this._columnsCollectionModifiedHandler=$.proxy(this._columnsCollectionModified,this)},_registerEvents:function(){this.grid.element.bind("iggridsortingcolumnsorting",this._sortingInitiatedHandler);this.grid.element.bind("iggridsortingcolumnsorted",this._sortingHandler);this.grid.element.bind("iggridvirtualrecordsrender",this._virtualRowsHandler);this.grid.element.bind("iggridvirtualhorizontalscroll",this._virtualColumnsHandler);this.grid.element.bind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler)},_unregisterEvents:function(){this.grid.element.unbind("iggridsortingcolumnsorting",this._sortingInitiatedHandler);this.grid.element.unbind("iggridsortingcolumnsorted",this._sortingHandler);this.grid.element.unbind("iggridvirtualrecordsrender",this._virtualRowsHandler);this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualColumnsHandler);this.grid.element.unbind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler)},_injectGrid:function(gridInstance){this.grid=gridInstance;this._v=this.grid.options.virtualization===true||this.grid.options.rowVirtualization===true;this._createHandlers();this._unregisterEvents();this._registerEvents()}});$.extend($.ui.igGridCellMerging,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid AppendRowsOnDemand 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 *	infragistics.util.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igGridAppendRowsOnDemand",{options:{type:null,chunkSize:25,recordCountKey:null,chunkSizeUrlKey:null,chunkIndexUrlKey:null,defaultChunkIndex:0,currentChunkIndex:0,loadTrigger:"auto",loadMoreDataButtonText:$.ig.GridAppendRowsOnDemand.locale.loadMoreDataButtonText},events:{rowsRequesting:"rowsRequesting",rowsRequested:"rowsRequested"},_loadingIndicator:null,_persistLocalSorting:true,_persistLocalFiltering:true,_recalcLocalSummaries:true,_keepCurrentChunkIndex:true,_callDataRendered:true,_initialProbeForChunkIndex:true,_injectGrid:function(gridInstance){this.grid=gridInstance;this._checkNotSupportedScenarios();this.options.currentChunkIndex=this.options.defaultChunkIndex;if(this.options.type===null){this.options.type=this.grid._inferOpType()}this.grid.dataSource.settings.paging.type=this.options.type||"remote";this._defaultChunkSize=parseInt(this.options.chunkSize,10)*(this.options.defaultChunkIndex+1);this.grid.dataSource.settings.paging.pageSize=this._defaultChunkSize;if(this.options.chunkSizeUrlKey!==null&&this.options.chunkIndexUrlKey){this.grid.dataSource.settings.paging.pageSizeUrlKey=this.options.chunkSizeUrlKey;this.grid.dataSource.settings.paging.pageIndexUrlKey=this.options.chunkIndexUrlKey}if(this.options.recordCountKey!==null){this.grid.dataSource.settings.responseTotalRecCountKey=this.options.recordCountKey}this.grid.dataSource.settings.paging.enabled=true;if(this.options.loadTrigger==="auto"){this._verticalScrollHandler=$.proxy(this._probeForNextChunk,this)}this._appendRecordsHandler=$.proxy(this._appendRecords,this);this._columnSortingHandler=$.proxy(this._columnSorting,this);this._syncCurrentChunkIndexHandler=$.proxy(this._syncCurrentChunkIndex,this);this.grid.element.bind("iggridsortinginternalcolumnsorting",this._columnSortingHandler);this.grid.element.bind("iggriduisoftdirty iggriduidirty",this._syncCurrentChunkIndexHandler)},_dataRendered:function(){var buttonId,container;if(!this._callDataRendered){return}this._keepCurrentChunkIndex=false;this.grid.scrollContainer().css("background-color","white");this.grid.dataSource.settings.paging.pageSize=this.options.chunkSize;this._originalDataSourceCallback=this.grid.dataSource.settings.callback;this._initLoadingIndicator();if(this.options.loadTrigger==="auto"){this.grid.scrollContainer().unbind("scroll",this._verticalScrollHandler);this.grid.scrollContainer().bind("scroll",this._verticalScrollHandler);if(this._initialProbeForChunkIndex||this.options.type==="local"){this._probeForNextChunk()}}this._requestPending=false;this._triggerEvents=true;if(this.options.loadTrigger==="button"){if(!this._buttonRow){buttonId=this.grid.id()+"_loadMoreButton";container=this.grid.options.height?this.grid.scrollContainer():this.grid.container();this._buttonRow=container.append("<div class='ui-iggrid-loadmorebutton'><input type='button' id='"+buttonId+"'></input></div>");$("#"+buttonId).igButton({labelText:this.options.loadMoreDataButtonText,click:$.proxy(this._nextChunk,this),width:"100%"})}}if(this._loadingIndicator){this._hideLoading()}},_checkNotSupportedScenarios:function(){if(this.options.loadTrigger==="auto"&&!this.grid.options.height){throw new Error($.ig.GridAppendRowsOnDemand.locale.appendRowsOnDemandRequiresHeight)}if(this.grid.options.virtualization||this.grid.options.rowVirtualization||this.grid.options.columnVirtualization){throw new Error($.ig.GridAppendRowsOnDemand.locale.virtualizationNotSupported)}var i,featureName,features=this.grid.options.features,featuresLength=features.length;if(featuresLength===1){return}for(i=0;i<featuresLength;i++){featureName=features[i].name;if(!featureName){continue}featureName=featureName.toLowerCase();switch(featureName){case"groupby":throw new Error($.ig.GridAppendRowsOnDemand.locale.groupByNotSupported);case"paging":throw new Error($.ig.GridAppendRowsOnDemand.locale.pagingNotSupported);case"cellmerging":throw new Error($.ig.GridAppendRowsOnDemand.locale.cellMergingNotSupported)}}},_setOption:function(key){$.Widget.prototype._setOption.apply(this,arguments);if(key==="defaultChunkIndex"){throw new Error($.ig.Grid.locale.optionChangeNotSupported.replace("{optionName}",key))}if(key==="currentChunkIndex"||key==="chunkSize"){this._keepCurrentChunkIndex=true;this.grid.dataSource.settings.paging.pageSize=(this.options.currentChunkIndex+1)*this.options.chunkSize;this.grid.dataSource.dataBind()}},_initLoadingIndicator:function(){this._loadingIndicator=this.grid.container().igLoading().data("igLoading").indicator()},_nextChunk:function(){var noCancel=true;if(this.options.currentChunkIndex>=this.grid.dataSource.pageCount()-1){return}if(this._triggerEvents){noCancel=this._trigger(this.events.rowsRequesting,null,{owner:this,chunkIndex:this.options.currentChunkIndex+1,chunkSize:this.options.chunkSize})}if(noCancel){this._showLoading();this.grid.dataSource.settings.paging.pageSize=this.options.chunkSize;this.grid.dataSource.settings.paging.pageIndex=this.options.currentChunkIndex;this.grid.dataSource.settings.paging.appendPage=true;this._originalDataSourceCallback=this.grid.dataSource.settings.callback;this.grid.dataSource.settings.callback=this._appendRecordsHandler;this._requestPending=true;this.grid.dataSource.nextPage()}},_showLoading:function(){this._loadingIndicator.show()},_hideLoading:function(){this._loadingIndicator.hide()},destroy:function(){var buttonId=this.grid.id()+"_loadMoreButton",container=this.grid.options.height?this.grid.scrollContainer():this.grid.container(),button=container.find("div.ui-iggrid-loadmorebutton");$("#"+buttonId).igButton("destroy");if(button){button.remove()}this.grid.element.unbind("iggridsortinginternalcolumnsorting",this._columnSortingHandler);this.grid.element.unbind("iggriduisoftdirty iggriduidirty",this._syncCurrentChunkIndexHandler);this.grid.scrollContainer().unbind("scroll",this._verticalScrollHandler);$.Widget.prototype.destroy.call(this);return this},_appendRecords:function(success,errmsg){var i,currentPage=[],noCancelError,sorting=this.grid.element.data("igGridSorting"),filtering=this.grid.element.data("igGridFiltering"),summaries=this.grid.element.data("igGridSummaries");if(success===true){currentPage=this.grid.dataSource.dataView().slice(this.grid.dataSource.settings.paging.pageIndex*this.grid.dataSource.settings.paging.pageSize)}this._requestPending=false;this.grid.dataSource.settings.paging.pageIndex=0;this.grid.dataSource.settings.paging.appendPage=false;this.grid.dataSource.settings.callback=this._originalDataSourceCallback;for(i=0;i<currentPage.length;i++){this.grid.renderNewRow(currentPage[i])}if(sorting){this._keepCurrentChunkIndex=true;if(this.options.type==="remote"&&this.grid.dataSource.settings.sorting.type==="local"){if(!this._persistLocalSorting){this.grid.dataSource.settings.sorting.expressions=[]}else{if(this.grid.dataSource.settings.sorting.expressions.length>0){this._callDataRendered=false;sorting.sortMultiple();this._callDataRendered=true}}}else{sorting._dataRendered()}this._keepCurrentChunkIndex=false}if(filtering){this._keepCurrentChunkIndex=true;if(this.options.type==="remote"&&this.grid.dataSource.settings.filtering.type==="local"){if(!this._persistLocalFiltering){this.grid.dataSource.settings.filtering.expressions=[]}this._callDataRendered=false;filtering.filter(this.grid.dataSource.settings.filtering.expressions,true);this._callDataRendered=true}this._keepCurrentChunkIndex=false}if(summaries){if(this.options.type==="remote"&&this.grid.dataSource.settings.summaries.type==="local"){if(this._recalcLocalSummaries){summaries.calculateSummaries()}}}this._hideLoading();if(success===false){noCancelError=this._trigger(this.grid.events.requestError,null,{owner:this,message:errmsg});if(noCancelError){throw new Error(errmsg)}}this.options.currentChunkIndex++;this._keepCurrentChunkIndex=false;if(this._triggerEvents){this._trigger(this.events.rowsRequested,null,{owner:this,chunkIndex:this.options.currentChunkIndex,chunkSize:this.options.chunkSize,rows:currentPage})}this._triggerEvents=true;if(this._initialProbeForChunkIndex||this.options.type==="local"){this._probeForNextChunk()}},_probeForNextChunk:function(){if(this.options.loadTrigger!=="auto"){return}var delta=(this.grid.scrollContainer().scrollTop()+this.grid.scrollContainer().height())/$(this.grid.element).height();if(delta>=1&&!this._requestPending){this._nextChunk()}else{this._initialProbeForChunkIndex=false}},_columnSorting:function(){this.grid.dataSource.settings.paging.pageSize=this.options.chunkSize*(this.options.currentChunkIndex+1);this._keepCurrentChunkIndex=true},_syncCurrentChunkIndex:function(){if(this.options.type==="remote"&&this.grid.dataSource.settings.filtering.type==="local"){return}if(!this._keepCurrentChunkIndex){if(this.grid.dataSource.settings.paging.pageIndex!==this.options.currentChunkIndex){this.options.currentChunkIndex=this.grid.dataSource.settings.paging.pageIndex}this._keepCurrentChunkIndex=true}},nextChunk:function(){this._triggerEvents=false;this._nextChunk()}});$.extend($.ui.igGridAppendRowsOnDemand,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Multi Headers 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igGridMultiColumnHeaders",{css:{multiHeaderCell:"ui-iggrid-multiheader-cell"},options:{inherit:false},_createWidget:function(){$.Widget.prototype._createWidget.apply(this,arguments)},_renderingMultiColumnHeader:function(){this._renderHeaderColumns(this.grid._headerParent);this.grid._trigger(this.grid.events.headerRendered,null,{owner:this.grid,table:this.grid.headersTable()});this.grid._headerRenderCancel=false},_analyzeRowspanRows:function(oldCols,level){var i,col,groups=[],ml=this.grid._maxLevel-level,rowspan;for(i=0;i<oldCols.length;i++){rowspan=1;col=oldCols[i];if($.type(col.rowspan)==="string"){col.rowspan=parseInt(col.rowspan,10)}if(col.rowspan>0){rowspan=col.rowspan}if(col.group!==undefined&&col.group!==null){groups.push({group:col.group,level:level+rowspan})}else{if(col.level===0){if(col.rowspan===null||col.rowspan===undefined||isNaN(col.rowspan)){if(ml+1-col.level>0){col.rowspan=ml+1-col.level}}}}if(this._rows[ml]===undefined||this._rows[ml]===null){this._rows[ml]=[]}this._rows[ml].push(col)}for(i=0;i<groups.length;i++){this._analyzeRowspanRows(groups[i].group,groups[i].level)}},_renderRow:function(headerContainer,row,level){var col,i,$headerCell,$tr=$('<tr data-mch-level="'+level+'" role="row"></tr>').appendTo(headerContainer);for(i=0;i<row.length;i++){col=row[i];$headerCell=this._createHeaderColumnMarkup(col);$headerCell.appendTo($tr)}},_renderHeaderColumns:function($container){var $th,i,j,k,oldCols,parents,key,headersTable,parentCol,mchElement,cols=this.grid.options.columns,mchChildren,isToHide,colsLength=cols.length,initHiddenCols=this.grid._initialHiddenColumns,gridId=this.grid.id(),$thead;this._arrayTargetRowspan=[];this._totalColumnsLength=$container.find("colgroup col").length;$thead=$container.find("thead");if($thead.length>0){$container=$thead.empty().attr("role","rowgroup")}else{$container=$('<thead role="rowgroup"></thead>').appendTo($container)}this._tr={};oldCols=this.grid._oldCols;this._rows={};this._analyzeRowspanRows(oldCols,0);for(i=this.grid._maxLevel;i>=0;i--){if(this._rows[i]!==null&&this._rows[i]!==undefined){this._renderRow($container,this._rows[i],i)}}for(i=0;i<colsLength;i++){$th=this.grid.container().find("#"+gridId+"_"+cols[i].key).data("columnIndex",i);$th.data("data-mch-order",i);this.grid._headerCells.push($th)}if(initHiddenCols){headersTable=this.grid.headersTable().find("thead");for(i=0;i<initHiddenCols.length;i++){key=initHiddenCols[i].key;this.grid.container().find("#"+gridId+"_"+key).css("display","none");parents=this.grid._getParentsMultiHeader(key);for(j=0;j<parents.length;j++){parentCol=parents[j];if(parentCol.level>0){mchElement=this.grid._getMultiHeaderColumnById(parentCol.identifier);if(mchElement&&mchElement.children){mchChildren=mchElement.children;isToHide=true;if(mchElement.hidden!==true){for(k=0;k<mchChildren.length;k++){if(mchChildren[k].level===0){$th=this.grid.container().find("#"+gridId+"_"+mchChildren[k].key)}else{$th=headersTable.find("th[data-mch-id="+mchChildren[k].identifier+"]")}if(!$th.is(":visible")){isToHide=false;break}}}if(isToHide){headersTable.find("th[data-mch-id="+parentCol.identifier+"]").css("display","none")}}}}}}},_createHeaderColumnMarkup:function(col){var grid=this.grid,id,isMultiColumnHeader=true,headerClass=grid.css.headerClass,customClass=col.headerCssClass||"",$th=$("<th></th>"),$headerCell,childIds="",i,length;if(col.group){length=col.group.length;for(i=0;i<length;i++){childIds+=this.grid.element[0].id+"_"+col.group[i].key+(i===length-1?"":" ")}}$headerCell=$th.append('<span class="'+grid.css.headerTextClass+'">'+col.headerText+"</span>").attr({role:"columnheader","aria-label":col.headerText,tabIndex:grid.options.tabIndex}).addClass(headerClass).addClass(customClass);if(col.colspan>1){$th.attr("colspan",col.colspan)}if(col.rowspan>1){$headerCell.attr("rowspan",col.rowspan)}if(col.key){$headerCell.attr("id",this.grid.element[0].id+"_"+col.key)}if(col.level===0){id=col.key;isMultiColumnHeader=false;$headerCell.attr("data-isheadercell",true)}else{id=col.identifier;$headerCell.addClass(this.css.multiHeaderCell);$headerCell.attr("data-mch-id",col.identifier);if(childIds){$headerCell.attr("aria-owns",childIds)}}grid._trigger(grid.events.headerCellRendered,null,{owner:grid,th:$headerCell,columnKey:id,isMultiColumnHeader:isMultiColumnHeader});return $headerCell},getMultiColumnHeaders:function(){return this.grid._oldCols},destroy:function(){$.Widget.prototype.destroy.call(this);return this},_injectGrid:function(gridInstance){this.grid=gridInstance;if(this.grid.options.virtualizationMode!=="continuous"&&(this.grid.options.virtualization===true&&this.grid.options.width||this.grid.options.columnVirtualization===true)){throw new Error($.ig.igGridMultiColumnHeaders.locale.multiColumnHeadersNotSupportedWithColumnVirtualization)}}});$.extend($.ui.igGridMultiHeaders,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Paging 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.editors.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igGridPaging",{css:{pagerClass:"ui-widget ui-iggrid-pager ui-helper-clearfix ui-corner-bottom ui-widget-header ui-iggrid-footer",pageLink:"ui-iggrid-pagelink ui-helper-reset",page:"ui-iggrid-page ui-state-default ui-corner-all",pageHover:"ui-iggrid-page-hover ui-state-hover",pageList:"ui-helper-reset ui-iggrid-pagelist ui-iggrid-paging-item",pageLinkCurrent:"ui-iggrid-pagelinkcurrent",pageCurrent:"ui-iggrid-pagecurrent ui-state-active ui-corner-all",pageFocused:"ui-iggrid-pagefocused ui-state-focus",nextPage:"ui-iggrid-nextpage ui-iggrid-paging-item ui-state-default",prevPage:"ui-iggrid-prevpage ui-iggrid-paging-item ui-state-default",firstPage:"ui-iggrid-firstpage ui-iggrid-paging-item ui-state-default ui-corner-left",lastPage:"ui-iggrid-lastpage ui-iggrid-paging-item ui-state-default ui-corner-right",nextPageLabel:"ui-iggrid-nextpagelabel",prevPageLabel:"ui-iggrid-prevpagelabel",firstPageLabel:"ui-iggrid-firstpagelabel",lastPageLabel:"ui-iggrid-lastpagelabel",nextPageLabelDisabled:"ui-iggrid-nextpagelabeldisabled ui-state-disabled",prevPageLabelDisabled:"ui-iggrid-prevpagelabeldisabled ui-state-disabled",firstPageLabelDisabled:"ui-iggrid-firstpagelabeldisabled ui-state-disabled",lastPageLabelDisabled:"ui-iggrid-lastpagelabeldisabled ui-state-disabled",nextPageImage:"ui-iggrid-pageimg ui-iggrid-nextpageimg ui-icon ui-icon-triangle-1-e",prevPageImage:"ui-iggrid-pageimg ui-iggrid-prevpageimg ui-icon ui-icon-triangle-1-w",firstPageImage:"ui-iggrid-pageimg ui-iggrid-firstpageimg ui-icon ui-icon-arrowstop-1-w",lastPageImage:"ui-iggrid-pageimg ui-iggrid-lastpageimg ui-icon ui-icon-arrowstop-1-e",nextPageImageDisabled:"ui-iggrid-pageimg ui-iggrid-nextpageimgdisabled ui-icon ui-state-disabled ui-icon-triangle-1-e",prevPageImageDisabled:"ui-iggrid-pageimg ui-iggrid-prevpageimgdisabled ui-icon ui-state-disabled ui-icon-triangle-1-w",firstPageImageDisabled:"ui-iggrid-pageimg ui-iggrid-firstpageimgdisabled ui-icon ui-state-disabled ui-icon-arrowstop-1-w",lastPageImageDisabled:"ui-iggrid-pageimg ui-iggrid-lastpageimgdisabled ui-icon ui-state-disabled ui-icon-arrowstop-1-e",pagerRecordsLabel:"ui-iggrid-pagerrecordslabel ui-iggrid-results",pageSizeLabel:"ui-iggrid-pagesizelabel",pageSizeDropDown:"ui-iggrid-pagesizedropdown",pageSizeDropDownContainer:"ui-helper-clearfix ui-iggrid-pagesizedropdowncontainer",pageSizeDropDownContainerAbove:"ui-widget ui-helper-clearfix ui-iggrid-pagesizedropdowncontainerabove ui-iggrid-toolbar ui-widget-header and ui-corner-top",pageDropDownContainer:"ui-iggrid-pagedropdowncontainer",pageDropDownLabels:"ui-iggrid-pagedropdownlabels",pageDropDown:"ui-iggrid-pagedropdown",pagerRightAreaContainer:"ui-iggrid-paging",pagingResults:"ui-iggrid-results"},options:{pageSize:25,recordCountKey:null,pageSizeUrlKey:null,pageIndexUrlKey:null,currentPageIndex:0,type:null,showPageSizeDropDown:true,pageSizeDropDownLabel:$.ig.GridPaging.locale.pageSizeDropDownLabel,pageSizeDropDownTrailingLabel:$.ig.GridPaging.locale.pageSizeDropDownTrailingLabel,pageSizeDropDownLocation:"above",showPagerRecordsLabel:true,pagerRecordsLabelTemplate:$.ig.GridPaging.locale.pagerRecordsLabelTemplate,nextPageLabelText:$.ig.GridPaging.locale.nextPageLabelText,prevPageLabelText:$.ig.GridPaging.locale.prevPageLabelText,firstPageLabelText:$.ig.GridPaging.locale.firstPageLabelText,lastPageLabelText:$.ig.GridPaging.locale.lastPageLabelText,showFirstLastPages:true,showPrevNextPages:true,currentPageDropDownLeadingLabel:$.ig.GridPaging.locale.currentPageDropDownLeadingLabel,currentPageDropDownTrailingLabel:$.ig.GridPaging.locale.currentPageDropDownTrailingLabel,currentPageDropDownTooltip:$.ig.GridPaging.locale.currentPageDropDownTooltip,pageSizeDropDownTooltip:$.ig.GridPaging.locale.pageSizeDropDownTooltip,pagerRecordsLabelTooltip:$.ig.GridPaging.locale.pagerRecordsLabelTooltip,prevPageTooltip:$.ig.GridPaging.locale.prevPageTooltip,nextPageTooltip:$.ig.GridPaging.locale.nextPageTooltip,firstPageTooltip:$.ig.GridPaging.locale.firstPageTooltip,lastPageTooltip:$.ig.GridPaging.locale.lastPageTooltip,pageTooltipFormat:$.ig.GridPaging.locale.pageTooltipFormat,pageSizeList:[],pageCountLimit:10,visiblePageCount:5,defaultDropDownWidth:70,delayOnPageChanged:350,persist:true,inherit:false},events:{pageIndexChanging:"pageIndexChanging",pageIndexChanged:"pageIndexChanged",pageSizeChanging:"pageSizeChanging",pageSizeChanged:"pageSizeChanged",pagerRendering:"pagerRendering",pagerRendered:"pagerRendered"},dropDownVisibleItemsCount:10,_loadingIndicator:null,_isPaging:false,_create:function(){this._oPageIndex=this.options.currentPageIndex;this._oPageSize=this.options.pageSize},_setOption:function(key,value){var items,label,pager;pager=this._pager();$.Widget.prototype._setOption.apply(this,arguments);if(key==="type"||key==="showPageSizeDropDown"||key==="pageSizeDropDownLocation"||key==="showPagerRecordsLabel"||key==="visiblePageCount"){throw new Error($.ig.Grid.locale.optionChangeNotSupported.replace("{optionName}",key))}if(key==="pageSize"){this.pageSize(value)}else if(key==="currentPageIndex"){this.pageIndex(value)}else if(key==="showFirstLastPages"){if(value===true){pager.find(".ui-iggrid-firstpage").show();pager.find(".ui-iggrid-lastpage").show()}else{pager.find(".ui-iggrid-firstpage").hide();pager.find(".ui-iggrid-lastpage").hide()}}else if(key==="showPrevNextPages"){if(value===true){pager.find(".ui-iggrid-prevpage").show();pager.find(".ui-iggrid-nextpage").show()}else{pager.find(".ui-iggrid-prevpage").hide();pager.find(".ui-iggrid-nextpage").hide()}}else if(key==="pageSizeList"){if($.type(value)==="string"){items=value.split(",")}else{items=value}if(this._pageSizeDD){this._pageSizeDD.igNumericEditor("option","listItems",items)}}else if(key==="nextPageLabelText"){label=pager.find(".ui-iggrid-nextpagelabel");label=label.length===0?pager.find(".ui-iggrid-nextpagelabeldisabled"):label;label.text(value)}else if(key==="prevPageLabelText"){label=pager.find(".ui-iggrid-prevpagelabel");label=label.length===0?pager.find(".ui-iggrid-prevpagelabeldisabled"):label;label.text(value)}else if(key==="firstPageLabelText"){label=pager.find(".ui-iggrid-firstpagelabel");label=label.length===0?pager.find(".ui-iggrid-firstpagelabeldisabled"):label;label.text(value)}else if(key==="lastPageLabelText"){label=pager.find(".ui-iggrid-lastpagelabel");label=label.length===0?pager.find(".ui-iggrid-nextpagelabeldisabled"):label;label.text(value)}},pageIndex:function(index){if(index!==null&&index!==undefined){if(index<0||index>=this.grid.dataSource.pageCount()){throw new Error($.ig.GridPaging.locale.invalidPageIndex)}this._overrideLabel=true;this.options.currentPageIndex=index}if(index!==undefined&&index!==null){this.grid.element.trigger("iggriduisoftdirty",{owner:this})}if(this.grid._hasUnboundColumns&&this.options.type==="remote"){this.grid._rebindUnboundColumns=true}this._savePagingData();return this.grid.dataSource.pageIndex(index)},pageSize:function(size){var noCancel=true;if(size){this.grid.dataSource.settings.paging.pageIndex=0;this.options.currentPageIndex=0;noCancel=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid,dataSource:this.grid.dataSource});if(noCancel){this._showLoading();if(this.grid._hasUnboundColumns&&this.options.type==="remote"){this.grid._rebindUnboundColumns=true}this._overrideLabel=true;this.options.pageSize=size;this._savePagingData();this.grid.dataSource.pageSize(size)}if(this._pageSizeDD){this._pageSizeDD.igNumericEditor("value",size)}}else{return this.grid.dataSource.pageSize()}},_savePagingData:function(){if(!this.options.persist){return}var pagingData;if(this.element.closest(".ui-iggrid-root").data("igGrid")){pagingData={pageIndex:this.options.currentPageIndex,pageSize:this.options.pageSize};this.grid._savePersistenceData(pagingData,"paging",this.grid.element[0].id)}},_loadPagingData:function(){var pagingData;if(this.element.closest(".ui-iggrid-root").data("igGrid")){pagingData=this.grid._getPersistenceData("paging",this.grid.element[0].id);if(!pagingData){return}this.grid.dataSource.settings.paging.pageIndex=pagingData.pageIndex;this.options.currentPageIndex=pagingData.pageIndex;this.options.pageSize=pagingData.pageSize}},_initLoadingIndicator:function(){this._loadingIndicator=this.grid.container().igLoading().data("igLoading").indicator()},_nextPage:function(event){var noCancel=true,noCancelBinding=true;noCancel=this._trigger(this.events.pageIndexChanging,null,{newPageIndex:this.options.currentPageIndex+1,currentPageIndex:this.options.currentPageIndex,owner:this});if(noCancel){if(this.options.currentPageIndex>=this.grid.dataSource.pageCount()-1){return}this.options.currentPageIndex=this.options.currentPageIndex+1;noCancelBinding=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid,dataSource:this.grid.dataSource});this._shouldFirePageIndexChanged=true;if(noCancelBinding){this._showLoading();this._overrideLabel=true;this.grid.element.trigger("iggriduisoftdirty",{owner:this});if(this.grid._hasUnboundColumns&&this.options.type==="remote"){this.grid._rebindUnboundColumns=true}this._savePagingData();this.grid.dataSource.nextPage()}}if(event){event.stopPropagation();event.preventDefault()}},_prevPage:function(event){var noCancel=true,noCancelBinding=true;noCancel=this._trigger(this.events.pageIndexChanging,null,{newPageIndex:this.options.currentPageIndex-1,currentPageIndex:this.options.currentPageIndex,owner:this});if(noCancel){if(this.options.currentPageIndex===0){return}this.options.currentPageIndex=this.options.currentPageIndex-1;noCancelBinding=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid,dataSource:this.grid.dataSource});this._shouldFirePageIndexChanged=true;if(noCancelBinding){this._showLoading();this._overrideLabel=true;this.grid.element.trigger("iggriduisoftdirty",{owner:this});if(this.grid._hasUnboundColumns&&this.options.type==="remote"){this.grid._rebindUnboundColumns=true}this._savePagingData();this.grid.dataSource.prevPage()}}if(event){event.stopPropagation();event.preventDefault()}},_firstPage:function(event){var noCancel=true,noCancelBinding=true;noCancel=this._trigger(this.events.pageIndexChanging,null,{newPageIndex:0,currentPageIndex:this.options.currentPageIndex,owner:this});if(noCancel){noCancelBinding=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid,dataSource:this.grid.dataSource});this._shouldFirePageIndexChanged=true;if(noCancelBinding){this._showLoading();this.pageIndex(0)}}if(event){event.stopPropagation();event.preventDefault()}},_lastPage:function(event){var noCancel=true,noCancelBinding=true;noCancel=this._trigger(this.events.pageIndexChanging,null,{newPageIndex:this.grid.dataSource.pageCount()-1,currentPageIndex:this.options.currentPageIndex,owner:this});if(noCancel){noCancelBinding=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid,dataSource:this.grid.dataSource});this._shouldFirePageIndexChanged=true;if(noCancelBinding){this._showLoading();this.pageIndex(this.grid.dataSource.pageCount()-1)}}if(event){event.stopPropagation();event.preventDefault()}},_showLoading:function(){this._loadingIndicator.show()},_hideLoading:function(){this._loadingIndicator.hide()},_bindEvents:function(){var paging=this,grid=this.grid,noCancel=true,id,noCancelBinding=true;id="#"+grid.element[0].id+"_pager";$(id+" li").bind({mousedown:function(event){var $eventTarget=$(event.target),newIndex=$eventTarget.data("pageIndex");if(newIndex===undefined){newIndex=$eventTarget.parent().data("pageIndex")}if($.type(newIndex)==="number"&&newIndex!==paging.options.currentPageIndex){noCancel=paging._trigger(paging.events.pageIndexChanging,event,{newPageIndex:newIndex,currentPageIndex:paging.options.currentPageIndex,owner:paging});paging._shouldFirePageIndexChanged=true;if(noCancel){noCancelBinding=paging.grid._trigger(paging.grid.events.dataBinding,null,{owner:paging.grid,dataSource:paging.grid.dataSource});if(noCancelBinding){paging._showLoading(grid.element.children("tbody"));paging.pageIndex(newIndex)}}}}});$(id+" li").bind({mouseover:function(event){$(event.currentTarget).addClass(paging.css.pageHover)},mouseout:function(event){$(event.currentTarget).removeClass(paging.css.pageHover)}})},_gridRendered:function(gridContainer){var self=this;if(this.options.showPageSizeDropDown===true&&this.options.pageSizeDropDownLocation==="above"&&!this._pageSizeDropDownRendered){self._renderPageSizeDropDown(gridContainer,true)}if(this.grid.options.autoAdjustHeight){this.grid._initializeHeights();this.grid._adjustLastColumnWidth()}if(this.grid.options.caption!==null&&!($.ig.util.isIE&&$.ig.util.browserVersion>=8)){this.grid._caption().removeClass("ui-corner-top")}},_rowDeleted:function(){if(this.options.type==="remote"){return}var currentPageIndex=this.options.currentPageIndex,pageCount=this.grid.dataSource.pageCount();if(currentPageIndex>0&&currentPageIndex+1>pageCount){currentPageIndex--}this.pageIndex(currentPageIndex)},_rowAdded:function(){if(this.options.type==="remote"){return}var currentPageIndex=this.options.currentPageIndex,pageCount=this.grid.dataSource.pageCount();if(currentPageIndex<pageCount&&this.grid.options.autoCommit){this.pageIndex(pageCount-1)}else{this._dataRendered()}},_gridCommit:function(){if(this.options.type==="remote"){return}this.pageIndex(this.options.currentPageIndex);return true},_plabel:function(){return this._pager().find(".ui-iggrid-pagerrecordslabel")},_pager:function(){return this.grid.container().find(".ui-iggrid-pager")},_getDSLocalRecordsCount:function(){if(this.grid.dataSource._filter){return this.grid.dataSource._filteredData.length}return this.grid.dataSource.totalLocalRecordsCount()},_dataRendered:function(){var id=this.grid.element[0].id,filtering,tmpl,kbrdNavEvents,edtrOpts,i,html,pager=null,pageList,pagesArray,dropDownContainer,pageCount,startRecord=0,endRecord=0,recordsCount=0,localRecordsCount=0,noCancel=true,startPageIndex=0,endPageIndex=0,pagerHtml=toStaticHTML('<div id="'+id+'_pager"></div>'),pageLinkHtml=toStaticHTML('<li class="${pageClass}" tabIndex="0"><a class="${pageLinkClass}" href="javascript:void(0);" tabIndex="-1">${page}</a></li>'),template=this.options.pagerRecordsLabelTemplate,self=this,pagerRight=null,vpc=this.options.visiblePageCount,val=0,recordsLabel=null;this._deleteOld();this._initLoadingIndicator();noCancel=this._trigger(this.events.pagerRendering,null,{dataSource:this.grid.dataSource,owner:this});if(noCancel){if(this.grid._shouldResetPaging){this.options.currentPageIndex=0;this.grid._shouldResetPaging=false}if(this._plabel().length>0){this._pager().find(".ui-iggrid-paging").remove()}else{this._pager().empty()}if(this.grid.dataSource.pageSizeDirty()){this.options.currentPageIndex=this.grid.dataSource.pageIndex();this.grid.dataSource.pageSizeDirty(false)}if(this._pager().length===0){id=this.grid.element[0].id;pager=$(pagerHtml).appendTo(this.grid.container())}else{pager=this._pager()}pager.addClass(this.css.pagerClass);if(this.options.showPagerRecordsLabel){recordsCount=this.grid.dataSource.totalRecordsCount()>0?this.grid.dataSource.totalRecordsCount():this.grid.dataSource.totalLocalRecordsCount();startRecord=this.options.currentPageIndex===0?1:this.options.currentPageIndex*this.pageSize()+1;localRecordsCount=this._getDSLocalRecordsCount();if(this.grid.dataSource._filter){recordsCount=localRecordsCount;filtering=this.grid.element.data("igTreeGridFiltering");if(filtering){tmpl=filtering._getFilterSummaryPagerTemplate();if(tmpl!==undefined&&tmpl!==null){template=tmpl}}}if(startRecord>recordsCount){startRecord=this.grid.dataSource.pageIndex()*this.pageSize()+1;this.options.currentPageIndex=this.grid.dataSource.pageIndex()}endRecord=this.options.currentPageIndex===0&&this.pageSize()<=recordsCount?this.pageSize():startRecord+this.pageSize()>recordsCount?recordsCount:startRecord-1+this.pageSize();if(this.grid.dataSource.totalLocalRecordsCount()===0){startRecord=0;endRecord=0}if(endRecord>localRecordsCount&&this.options.type==="local"){endRecord=localRecordsCount}if(this.grid.container().find(".ui-iggrid-footer .ui-iggrid-results").data("overrideLabel")===0||this._overrideLabel||!this.grid.dataSource._filter){this._plabel().remove();template=template.replace("${startRecord}",startRecord).replace("${endRecord}",endRecord).replace("${recordCount}",recordsCount);recordsLabel=$("<span>"+template+"</span>").appendTo(pager).attr("id",pager[0].id+"_label").addClass(this.css.pagerRecordsLabel).attr("title",this.options.pagerRecordsLabelTooltip).show()}else if(this._plabel().length===0){recordsLabel=$("<span></span>").appendTo(pager).attr("id",pager[0].id+"_label").addClass(this.css.pagerRecordsLabel).attr("title",this.options.pagerRecordsLabelTooltip).show()}if(recordsLabel){recordsLabel.data("hideflag",false)}this._plabel().show();this._overrideLabel=false}pageCount=this.grid.dataSource.pageCount();pagerRight=$("<div></div>").appendTo(pager).addClass(this.css.pagerRightAreaContainer);if(this.options.showFirstLastPages===true){this._renderFirstPage(pagerRight)}if(this.options.showPrevNextPages===true){this._renderPrevPage(pagerRight)}if(this.grid.dataSource.pageCount()<=this.options.pageCountLimit){pageList=$("<ul></ul>").appendTo(pagerRight).addClass(this.css.pageList);if(!this._pagerEvents){this._pagerEvents={keydown:function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){var noCancel=true,noCancelBinding=true,newIndex=$(event.currentTarget).closest("li").data("pageIndex");if(newIndex!==self.options.currentPageIndex){noCancel=self._trigger(self.events.pageIndexChanging,null,{newPageIndex:newIndex,currentPageIndex:self.options.currentPageIndex,owner:self});self._shouldFirePageIndexChanged=true;if(noCancel){noCancelBinding=self.grid._trigger(self.grid.events.dataBinding,null,{owner:self.grid,dataSource:self.grid.dataSource});if(noCancelBinding){self._showLoading();self.pageIndex(newIndex)}}}event.stopPropagation();event.preventDefault()}},focus:function(event){$(event.currentTarget).closest("li").addClass(self.css.pageFocused)},blur:function(event){$(event.currentTarget).closest("li").removeClass(self.css.pageFocused)}}}else{this._pager().undelegate("li",this._pagerEvents)}this._pager().delegate("li",this._pagerEvents);val=Math.floor(parseInt(vpc,10)/2);startPageIndex=this.options.currentPageIndex-val;if(startPageIndex<0){startPageIndex=0}endPageIndex=this.options.currentPageIndex+val;if(this.options.currentPageIndex-startPageIndex<val){endPageIndex+=val-(this.options.currentPageIndex-startPageIndex)}if(this.grid.dataSource.pageCount()-(this.options.currentPageIndex+1)<val&&vpc%2!==0){startPageIndex=startPageIndex-(val-(this.grid.dataSource.pageCount()-(this.options.currentPageIndex+1)))}if(endPageIndex>=this.grid.dataSource.pageCount()){endPageIndex=this.grid.dataSource.pageCount()-1}if(startPageIndex<0){startPageIndex=0}if(vpc%2===0&&endPageIndex-startPageIndex<vpc-1){startPageIndex-=vpc-1-(endPageIndex-startPageIndex)}if(startPageIndex<0){startPageIndex=0}for(i=startPageIndex;i<=endPageIndex&&i-startPageIndex<vpc;i++){html=pageLinkHtml.replace("${page}",i+1).replace("${pageLinkClass}",i===this.options.currentPageIndex?this.css.pageLinkCurrent:this.css.pageLink);html=html.replace("${pageClass}",i===this.options.currentPageIndex?this.css.pageCurrent:this.css.page);$(html).appendTo(pageList).attr("title",this.options.pageTooltipFormat.replace("${index}",i+1)).data("pageIndex",i)}}else{pagesArray=[];for(i=1;i<=pageCount;i++){pagesArray.push(i+this._empty())}dropDownContainer=$("<div></div>").appendTo(pagerRight).addClass(this.css.pageDropDownContainer).attr("title",this.options.currentPageDropDownTooltip);$("<span></span>").appendTo(dropDownContainer).text(this.options.currentPageDropDownLeadingLabel).addClass(this.css.pageDropDownLabels);kbrdNavEvents=this._getEditorKeyboardNavigation();edtrOpts={listItems:pagesArray,dropDownAttachedToBody:true,visibleItemsCount:this.dropDownVisibleItemsCount,suppressNotifications:true,isLimitedToListValues:true,width:this.options.defaultDropDownWidth,allowNullValue:false,buttonType:"dropdown",value:this.options.currentPageIndex+1,minValue:1,maxValue:pagesArray[pagesArray.length-1],dropDownListOpened:$.proxy(this._onSelectDropDownOpened,this),textChanged:$.proxy(this._onSelectDropDownPageIndex,this)};edtrOpts=$.extend(edtrOpts,kbrdNavEvents);this._curPageDD=$("<span />").appendTo(dropDownContainer).addClass(this.css.pageDropDownContainer).igNumericEditor(edtrOpts);this._curPageDD.igNumericEditor("selectedListIndex",this.options.currentPageIndex);$("<span></span>").appendTo(dropDownContainer).text(this.options.currentPageDropDownTrailingLabel.replace("${count}",this.grid.dataSource.pageCount())).addClass(this.css.pageDropDownLabels)}if(this.options.showPrevNextPages===true){this._renderNextPage(pagerRight)}if(this.options.showFirstLastPages===true){this._renderLastPage(pagerRight)}if(this.options.showPageSizeDropDown&&this.options.pageSizeDropDownLocation==="inpager"){this._renderPageSizeDropDown(pagerRight)}this._bindEvents(pager);this._hideLoading(this.grid.element.children("tbody"));pager.show();if(this._shouldFirePageSizeChanged){this._shouldFirePageSizeChanged=false;this._trigger(this.events.pageSizeChanged,null,{pageSize:this.pageSize(),owner:this})}this._trigger(this.events.pagerRendered,null,{dataSource:this.grid.dataSource,owner:this});if(this._shouldFirePageIndexChanged){this._shouldFirePageIndexChanged=false;this._trigger(this.events.pageIndexChanged,null,{pageIndex:this.options.currentPageIndex,owner:this})}}},_getEditorKeyboardNavigation:function(){return{focus:function(e,args){var edtr=args.owner;if(edtr._dropDownList&&!edtr._dropDownList.is(":visible")){edtr.showDropDown()}},keydown:function(e,args){var edtr=args.owner,$activeItem;if(edtr._dropDownList&&edtr._dropDownList.is(":visible")){if(e.keyCode===$.ui.keyCode.DOWN){edtr._hoverNextDropDownListItem();e.preventDefault()}else if(e.keyCode===$.ui.keyCode.UP){edtr._hoverPreviousDropDownListItem();e.preventDefault()}else if(e.keyCode===$.ui.keyCode.ENTER){$activeItem=edtr._dropDownList.children(".ui-igedit-listitem").filter("[data-active='true']");if($activeItem.length){edtr._triggerListItemClick($activeItem)}e.preventDefault()}}}}},_onSelectDropDownOpened:function(event,args){var dd=args.owner,$ddCont=dd.dropDownContainer(),$selItem=dd.getSelectedListItem();if(!$selItem.length){return}$ddCont.scrollTop($selItem.position().top-(this.dropDownVisibleItemsCount-1)*$selItem.outerHeight())},_onSelectDropDownPageIndex:function(event,args){var self=this;if(this._timeoutId!==undefined){clearTimeout(this._timeoutId)}if(parseInt(this.options.delayOnPageChanged,10)===0||event&&event.originalEvent&&event.originalEvent.type!=="keypress"){this._dropDownPageIndex(event,args)}else{this._timeoutId=setTimeout(function(){self._dropDownPageIndex(event,args)},this.options.delayOnPageChanged)}},_dropDownPageIndex:function(event,args){var noCancel=true,noCancelBinding=true,parsedString,editor=args.owner,val=args.text,pageInd=parseInt(val,10),mapping={"１":"1","２":"2","３":"3","４":"4","５":"5","６":"6","７":"7","８":"8","９":"9","０":"0"};if(val===""){return}if(isNaN(pageInd)){parsedString=val;$.each(mapping,function(jpVal,engVal){parsedString=parsedString.replace(new RegExp(jpVal,"g"),engVal)});pageInd=parseInt(parsedString,10);if(isNaN(pageInd)){editor.value(this.options.currentPageIndex+1);return}}if(pageInd<=0||pageInd>this.grid.dataSource.pageCount()){editor.hideDropDown();editor.value(this.options.currentPageIndex+1);return}if(pageInd-1===this.options.currentPageIndex){editor.hideDropDown();return}noCancel=this._trigger(this.events.pageIndexChanging,null,{newPageIndex:pageInd-1,currentPageIndex:this.options.currentPageIndex,owner:this});if(noCancel){noCancelBinding=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid,dataSource:this.grid.dataSource});if(noCancelBinding){editor.selectedListIndex(pageInd-1);this._shouldFirePageIndexChanged=true;if(!isNaN(pageInd)){this._showLoading();this.pageIndex(pageInd-1)}}}},_renderPrevPage:function(pager){var prev,self=this,imgspan;prev=$("<div></div>").appendTo(pager).addClass(this.css.prevPage).attr("title",this.options.prevPageTooltip);if(this.options.currentPageIndex===0){$("<span></span>").appendTo(prev).addClass(this.css.prevPageImageDisabled);$("<span></span>").appendTo(prev).addClass(this.css.prevPageLabelDisabled).append(this.options.prevPageLabelText)}else{prev.bind("mousedown",$.proxy(this._prevPage,this));imgspan=$("<span></span>").appendTo(prev).addClass(this.css.prevPageImage);$("<span></span>").appendTo(prev).addClass(this.css.prevPageLabel).append(this.options.prevPageLabelText);imgspan.wrap(toStaticHTML('<a href="javascript:void(0);" tabIndex="-1"></a>'));prev.attr("tabIndex","0").bind({keydown:function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){self._prevPage();event.stopPropagation();event.preventDefault()}},focus:function(event){$(event.currentTarget).closest("div").removeClass("ui-state-default").addClass("ui-state-focus")},blur:function(event){$(event.currentTarget).closest("div").removeClass("ui-state-focus").addClass("ui-state-default")}})}},_renderNextPage:function(pager){var next,self=this,imgspan;next=$("<div></div>").appendTo(pager).addClass(this.css.nextPage).attr("title",this.options.nextPageTooltip);if(this.options.currentPageIndex===this.grid.dataSource.pageCount()-1){$("<span></span>").appendTo(next).addClass(this.css.nextPageLabelDisabled).append(this.options.nextPageLabelText);$("<span></span>").appendTo(next).addClass(this.css.nextPageImageDisabled)}else{next.bind("mousedown",$.proxy(this._nextPage,this));$("<span></span>").appendTo(next).addClass(this.css.nextPageLabel).append(this.options.nextPageLabelText);imgspan=$("<span></span>").appendTo(next).addClass(this.css.nextPageImage);imgspan.wrap(toStaticHTML('<a href="javascript:void(0);" tabIndex="-1"></a>'));next.attr("tabIndex","0").bind({keydown:function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){self._nextPage();event.stopPropagation();event.preventDefault()}},focus:function(event){$(event.currentTarget).closest("div").removeClass("ui-state-default").addClass("ui-state-focus")},blur:function(event){$(event.currentTarget).closest("div").removeClass("ui-state-focus").addClass("ui-state-default")}})}},_renderFirstPage:function(pager){var first,self=this,imgspan;first=$("<div></div>").appendTo(pager).addClass(this.css.firstPage).attr("title",this.options.firstPageTooltip);if(this.options.currentPageIndex===0){$("<span></span>").appendTo(first).addClass(this.css.firstPageImageDisabled);$("<span></span>").appendTo(first).addClass(this.css.firstPageLabelDisabled).append(this.options.firstPageLabelText)}else{first.bind("mousedown",$.proxy(this._firstPage,this));imgspan=$("<span></span>").appendTo(first).addClass(this.css.firstPageImage);$("<span></span>").appendTo(first).addClass(this.css.firstPageLabel).append(this.options.firstPageLabelText);imgspan.wrap(toStaticHTML('<a href="javascript:void(0);" tabIndex="-1"></a>'));first.attr("tabIndex","0").bind({keydown:function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){self._firstPage();event.stopPropagation();event.preventDefault()}},focus:function(event){$(event.currentTarget).closest("div").removeClass("ui-state-default").addClass("ui-state-focus")},blur:function(event){$(event.currentTarget).closest("div").removeClass("ui-state-focus").addClass("ui-state-default")}})}},_renderLastPage:function(pager){var last,self=this,imgspan;last=$("<div></div>").appendTo(pager).addClass(this.css.lastPage).attr("title",this.options.lastPageTooltip);if(this.options.currentPageIndex===this.grid.dataSource.pageCount()-1){$("<span></span>").appendTo(last).addClass(this.css.lastPageLabelDisabled).append(this.options.lastPageLabelText);$("<span></span>").appendTo(last).addClass(this.css.lastPageImageDisabled)}else{last.bind("mousedown",$.proxy(this._lastPage,this));$("<span></span>").appendTo(last).addClass(this.css.lastPageLabel).append(this.options.lastPageLabelText);imgspan=$("<span></span>").appendTo(last).addClass(this.css.lastPageImage);imgspan.wrap(toStaticHTML('<a href="javascript:void(0);" tabIndex="-1"></a>'));last.attr("tabIndex","0").bind({keydown:function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){self._lastPage();event.stopPropagation();event.preventDefault()}},focus:function(event){$(event.currentTarget).closest("div").removeClass("ui-state-default").addClass("ui-state-focus")},blur:function(event){$(event.currentTarget).closest("div").removeClass("ui-state-focus").addClass("ui-state-default")}})}},_renderPageSizeDropDown:function(parent,prepend){var i,ps,editorId=this.grid.id()+"_editor",cClass,items,self=this,edtrOpts,kbrdNavEvents;cClass=this.options.pageSizeDropDownLocation==="above"?this.css.pageSizeDropDownContainerAbove:this.css.pageSizeDropDownContainer;if(prepend){parent=$("<div></div>").prependTo(parent).addClass(cClass)}else{parent=$("<div></div>").appendTo(parent).addClass(cClass)}parent.attr("title",this.options.pageSizeDropDownTooltip);parent=$("<div></div>").appendTo(parent).addClass(this.css.pagingResults);if(prepend){$("<span>"+this.options.pageSizeDropDownTrailingLabel+"</span>").prependTo(parent).addClass(this.css.pageSizeLabel);$("<span></span>").prependTo(parent).attr("id",editorId);$("<span>"+this.options.pageSizeDropDownLabel+"</span>").prependTo(parent).addClass(this.css.pageSizeLabel)}else{$("<span>"+this.options.pageSizeDropDownLabel+"</span>").appendTo(parent).addClass(this.css.pageSizeLabel);$("<span></span>").appendTo(parent).attr("id",editorId).addClass(this.css.pageSizeDropDown);$("<span>"+this.options.pageSizeDropDownTrailingLabel+"</span>").appendTo(parent).addClass(this.css.pageSizeLabel)}items=this.options.pageSizeList===null||this.options.pageSizeList.length===0?[5,10,20,25,50,75,100]:this.options.pageSizeList;if($.type(items)==="string"){items=items.split(",")}ps=this.pageSize();kbrdNavEvents=this._getEditorKeyboardNavigation();edtrOpts={width:this.options.defaultDropDownWidth,dropDownAttachedToBody:true,suppressNotifications:true,buttonType:"dropdown",dropDownOnReadOnly:true,listItems:items,allowNullValue:false,readOnly:true,textAlign:"left",value:ps,valueChanged:function(e,args){if(self.options.pageSizeDropDownLocation==="inpager"){setTimeout(function(){self._changePageSize(e,args)},0)}else{self._changePageSize(e,args)}},rendered:function(e,args){var edtr=args.owner;edtr.editorContainer().addClass(self.css.pageSizeDropDown);edtr.field().removeClass("ui-state-disabled");edtr.editorContainer().removeClass("ui-state-disabled")}};edtrOpts=$.extend(edtrOpts,kbrdNavEvents);this._pageSizeDD=this.grid.container().find("#"+editorId).igNumericEditor(edtrOpts);for(i=0;i<items.length;i++){if(items[i]===ps){this._pageSizeDD.igNumericEditor("selectedListIndex",i);break}}if($.ig.util.isIE8===true&&this.grid.options._isHierarchicalGrid&&this.grid.options.fixedHeaders){$("<col></col>").appendTo(this.grid.headersTable().find("colgroup")).remove()}this._pageSizeDropDownRendered=true;this._trigger("pagingdropdownrendered")},_changePageSize:function(event,args){var noCancel=true,size=args.owner.value();noCancel=this._trigger(this.events.pageSizeChanging,null,{currentPageSize:this.pageSize(),newPageSize:size,owner:this});if(noCancel){if(this.options.type==="remote"){this.grid.element.trigger("iggriduidirty",{owner:this})}else{this.grid.element.trigger("iggriduisoftdirty",{owner:this})}this.pageSize(size);if(this.options.type==="remote"){this._shouldFirePageSizeChanged=true}else{this._trigger(this.events.pageSizeChanged,null,{pageSize:size,owner:this})}}else{args.owner.value(this.pageSize())}},_deleteOld:function(destroy){if(this._curPageDD){this._curPageDD.igNumericEditor("destroy");delete this._curPageDD}if(destroy&&this._pageSizeDD&&this._pageSizeDD.closest("body").length>0){this._pageSizeDD.igNumericEditor("destroy");
delete this._pageSizeDD}},destroy:function(){var pager=this._pager();this.pageSize(0);this._deleteOld(true);if(this.options.showPageSizeDropDown===true&&this.options.pageSizeDropDownLocation==="above"){$("#"+this.grid.container()[0].id+" .ui-iggrid-pagesizedropdowncontainerabove").remove()}pager.remove();if(this._loadingIndicator){delete this._loadingIndicator}$.Widget.prototype.destroy.call(this);return this},_injectGrid:function(gridInstance,isRebind){this.grid=gridInstance;if(this.options.type===null){this.options.type=this.grid._inferOpType()}if(!this.options.persist){if(isRebind){this.options.currentPageIndex=this._oPageIndex;this.options.pageSize=this._oPageSize}}else{this._loadPagingData()}this.grid.dataSource.settings.paging.type=this.options.type||"remote";this.grid.dataSource.settings.paging.pageIndex=this.options.currentPageIndex;if(this.options.type==="local"){this.grid.dataSource.persistedPageIndex(this.grid.dataSource.settings.paging.pageIndex)}this.grid.dataSource.settings.paging.pageSize=parseInt(this.options.pageSize,10);if(this.options.pageSizeUrlKey!==null&&this.options.pageIndexUrlKey){this.grid.dataSource.settings.paging.pageSizeUrlKey=this.options.pageSizeUrlKey;this.grid.dataSource.settings.paging.pageIndexUrlKey=this.options.pageIndexUrlKey}if(this.options.recordCountKey!==null){this.grid.dataSource.settings.responseTotalRecCountKey=this.options.recordCountKey}this.grid.dataSource.settings.paging.enabled=true;if(this._pageSizeDD){this._pageSizeDD.igNumericEditor("option","value",this.options.pageSize)}},_empty:function(){return""}});$.extend($.ui.igGridPaging,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Column Resizing 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 *	infragistics.ui.grid.shared.js
 *	infragistics.ui.grid.featurechooser.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igGridResizing",{options:{allowDoubleClickToResize:true,deferredResizing:false,columnSettings:[{columnKey:null,columnIndex:null,allowResizing:true,minimumWidth:20,maximumWidth:null}],handleThreshold:5,inherit:false},css:{columnResizeLine:"ui-iggrid-resize-line",resizingHandleCursor:"ui-iggrid-resizing-handle-cursor",resizingHandle:"ui-iggrid-resizing-handle"},events:{columnResizing:"columnResizing",columnResizingRefused:"columnResizingRefused",columnResized:"columnResized"},_createWidget:function(){this.options.columnSettings=[];$.Widget.prototype._createWidget.apply(this,arguments)},_setOption:function(key){throw new Error($.ig.Grid.locale.optionChangeNotSupported.replace("{optionName}",key))},destroy:function(){this._clearResizingHandles();this.grid.element.unbind(".resizing");$.Widget.prototype.destroy.call(this);return this},resize:function(column,width){var columnIndex;if(typeof column==="number"){columnIndex=column}else{$.each(this.grid._visibleColumns(),function(index,col){if(col.key===column){columnIndex=index}});if(columnIndex===undefined){throw new Error($.ig.GridResizing.locale.noSuchVisibleColumn)}}if(width===undefined||width===null){this._autoResize(columnIndex,false,null)}else{this._resizeColumn(columnIndex,width,false,null)}},_headerRendered:function(){if(this.grid.element.igGridColumnFixing!==undefined){this._columnFixing=this.grid.element.data("igGridColumnFixing")}this._renderResizingHandles()},_columnsCollectionModified:function(){this._renderResizingHandles()},_columnsMoved:function(e,args){var ths,grid=this.grid,len=args.len,startIndex=args.start,endIndex=args.index,ind,after=endIndex-startIndex>0,$th;this._populateMultiColumnHeadersLevel0();if(after){endIndex-=len}if(grid._isMultiColumnGrid){ths=$(grid._headerCells)}else{if(grid.options.virtualization===true||grid.options.rowVirtualization===true){ths=grid.headersTable().find("> thead > tr").eq(0).children("th").not("[data-skip=true]")}else{ths=grid.headersTable().find("> thead > tr[data-header-row]").eq(0).children("th").not("[data-skip=true]")}}function funcCalibrateResizingHandle(ind){if(ths&&ths[ind]){$th=$(ths[ind]);$th.find("span[data-nonpaddedindicator='right']").css("margin-right",-parseInt($th.css("padding-right"),10)+"px")}}if(after){ind=endIndex-1}else{ind=startIndex+len-1}funcCalibrateResizingHandle(ind);funcCalibrateResizingHandle(endIndex+len-1)},_columnFixed:function(){this._renderResizingHandles()},_renderResizingHandles:function(){var self=this,i,ths,visibleColumns=this.grid._visibleColumns(),thsMultiHeader,gridId=this.grid.element.attr("id"),hasFixedColumns=this.grid.hasFixedColumns();this._clearResizingHandles();if(visibleColumns.length===0){return}if(this.grid._isMultiColumnGrid){thsMultiHeader=this.grid.headersTable().find("> thead > tr th").not("[data-skip=true]").not("[data-isheadercell=true]");if(hasFixedColumns){$.each(this.grid.fixedHeadersTable().find("> thead > tr th").not("[data-skip=true]").not("[data-isheadercell=true]"),function(index,th){thsMultiHeader.push($(th))})}this._populateMultiColumnHeadersLevel0();thsMultiHeader.each(function(){var a,th=$(this),mchId=th.data("mchId"),i,cs=self._oColumnSettings;for(i=0;i<cs.length;i++){if(cs[i].columnKey===mchId&&cs[i].allowResizing===false){return true}}a=self._renderResizingHandle(th);self._bindMultipleResizingHandle(th,a.find("span"))});ths=$(this.grid._headerCells)}else{if(this.grid.options.virtualization===true||this.grid.options.rowVirtualization===true){if(hasFixedColumns){ths=$();for(i=0;i<visibleColumns.length;i++){ths.push($("#"+gridId+"_"+visibleColumns[i].key))}}else{ths=this.grid.headersTable().find("> thead > tr").eq(0).children("th").not("[data-skip=true]")}}else{if(hasFixedColumns){ths=$();for(i=0;i<visibleColumns.length;i++){ths.push($("#"+gridId+"_"+visibleColumns[i].key))}}else{ths=this.grid.headersTable().find("> thead > tr[data-header-row]").eq(0).children("th").not("[data-skip=true]")}}}ths.each(function(index){var a,cs,th=$(this),col=visibleColumns[index];if(col===null||col===undefined){return true}cs=self._findColumnSettingsByKey(col.key);if(cs.allowResizing){a=self._renderResizingHandle(th);self._bindResizingHandle(th,a.find("span"),col)}})},_renderResizingHandle:function(th){var div,a;if(!this._resizingHandles){this._resizingHandles=[]}div=$("<div data-resizinghandle='true' />").css("position","relative").css("width","100%").css("height","0px").css("top","0px").css("left","0px").prependTo(th);a=$("<a />").attr("title","").prependTo(div);if($.ig.util.isIE9){a.addClass(this.css.resizingHandleCursor)}$("<span data-nonpaddedindicator='right'></span>").attr("title","").css("position","absolute").css("margin-right",-parseInt(th.css("padding-right"),10)+"px").css("right","0px").css("width",this.options.handleThreshold+"px").addClass(this.css.resizingHandleCursor).addClass(this.css.resizingHandle).appendTo(a);this._resizingHandles.push(div);return a},_populateMultiColumnHeadersLevel0:function(){var i,j,self=this,cols=this.grid._oldCols||[],colsLength=cols.length,ths=$(this.grid._headerCells),level0=[],level0Length,visibleColumns=this.grid._visibleColumns();for(i=0;i<colsLength;i++){if(cols[i].level===0){level0.push(cols[i])}else{for(j=0;j<cols[i].children.length;j++){level0.push(cols[i].children[j])}}}level0Length=level0.length;ths.each(function(index){var th=$(this),col=visibleColumns[index],cs;if(col===null||col===undefined){return true}cs=self._findColumnSettingsByKey(col.key);if(cs.allowResizing){for(i=0;i<level0.length;i++){if(level0[i].key===col.key){break}}if(i<level0Length){level0[i].allowResizing=true;level0[i].visibleIndex=index;level0[i].settings=cs}th.col=level0[i]}})},_bindMultipleResizingHandle:function($th,button){var self=this,id=$th.attr("data-mch-id"),column;column=this.grid._getMultiHeaderColumnById(id);button.mouseWrapper({distance:5,start:function(){return self._startResizing($th)},drag:function(event){return self._doResizingMultiColumnHeader(event.originalEvent,$th,column)},stop:function(event){return self._stopResizingMiltiColumnHeader(event.originalEvent,$th,column)}}).bind("dblclick.resizing",function(event){self._handleMouseMultiColumnHeaderDbClick(event,$th,column)}).bind("click.resizing",function(event){event.preventDefault();event.stopPropagation()})},_bindResizingHandle:function(th,button,column){var self=this;button.mouseWrapper({distance:5,start:function(){return self._startResizing(th)},drag:function(event){return self._doResizing(event.originalEvent,th,column)},stop:function(event){return self._stopResizing(event.originalEvent,th,column)}}).bind("dblclick.resizing",function(event){self._handleMouseDbClick(event,th,column)}).bind("click.resizing",function(event){event.preventDefault();event.stopPropagation()})},_clearResizingHandles:function(){var i;if(this._resizingHandles){for(i=0;i<this._resizingHandles.length;i++){this._resizingHandles[i].remove()}this._resizingHandles=[]}},_handleMouseDbClick:function(event,th,column){if(!this.options.allowDoubleClickToResize){return}this._autoResize($.inArray(column,this.grid._visibleColumns()),true,event)},_handleMouseMultiColumnHeaderDbClick:function(event,$th,column){var i,children=column.children,childrenLength=children.length;if(!this.options.allowDoubleClickToResize){return}for(i=0;i<childrenLength;i++){if(children[i].allowResizing===true){this._autoResize(children[i].visibleIndex,true,event)}}},_autoResize:function(columnIndex,fireEvents,event){var maxWidth=this.grid.calculateAutoFitColumnWidth(columnIndex);if(maxWidth>-1){return this._resizeColumn(columnIndex,maxWidth,fireEvents,event)}},_cancelHoveringEffects:function(cancel){var topmostGrid=this.grid.element.closest(".ui-iggrid-root").data("igGrid");if(topmostGrid===undefined||topmostGrid===null){topmostGrid=this.grid}topmostGrid._cancelHoveringEffects=cancel},_startResizing:function(th){var body=$(document.body),resizeLineTop,heightOffset;this._resizing=true;this._cancelHoveringEffects(true);if(!$.ig.util.isIE10){$(document.activeElement).blur()}else{body.focus()}body.addClass(this.css.resizingHandleCursor);if(this.grid._isMultiColumnGrid){heightOffset=th.offset().top-this._gridContainerPositioningOffset().top}resizeLineTop=th.offset().top+this._gridContainerPositioningOffset().top;if(this.grid.options.height!==null&&this.grid.options.showHeader===true&&this.grid.options.fixedHeaders===false){resizeLineTop+=this.grid.scrollContainer().scrollTop()}this._resizeLine=$("<div></div>").addClass(this.css.columnResizeLine).data("efh","1").css({height:this._calculateGridResizableHeight(heightOffset),top:resizeLineTop,visibility:"hidden"}).appendTo(this.grid.container());if($.ig.util.isIE8){this.grid.container().attr("tabIndex",this.grid.container().attr("tabIndex"))}return true},_doResizingMultiColumnHeader:function(event,$th,column){var i,width,resizeCellRange,resizeResult,range,vI,offsetLeft,offsetHeight,children=column.children,childrenLength=children.length,child=null,cellToResize;width=event.pageX-$th.offset().left;if(width<0){width=0}offsetHeight=$th.offset().top-this.grid.headersTable().offset().top;if(!this.options.deferredResizing){for(i=childrenLength-1;i>=0;i--){if(children[i].allowResizing&&!children[i].hidden){child=children[i];child.resized=!child.resized;if(child.resized){break}}}if(child!==null&&!child.hidden){cellToResize=$("#"+this.grid.element[0].id+"_"+child.key);vI=$.inArray(child,this.grid._visibleColumns());width=cellToResize[0].offsetWidth-$th[0].offsetWidth+width;resizeResult=this._resizeColumn(vI,width,true,event,vI)}if(!resizeResult){return true}if(!resizeResult.canceled){this._resizeLine.css("height",this._calculateGridResizableHeight(offsetHeight));this._resizeLine.css({left:$th.offset().left+$th.outerWidth()+this._gridContainerPositioningOffset().left,visibility:"visible"})}}else{offsetLeft=$th.offset().left;range={min:offsetLeft,max:offsetLeft};for(i=0;i<childrenLength;i++){child=children[i];if(child.hidden){continue}if(child.allowResizing){resizeCellRange=this._getRange(this.options.columnSettings[child.visibleIndex]);range.min+=resizeCellRange.min;if(resizeCellRange.max===Infinity){range.max=Infinity}else if(range.max!==Infinity){range.max+=resizeCellRange.max}}else{range.min+=$("#"+this.grid.element[0].id+"_"+child.key)[0].offsetWidth}}this._resizeLine.css("height",this._calculateGridResizableHeight(offsetHeight));this._resizeLine.css({left:this._coerceRange(range,event.pageX)+this._gridContainerPositioningOffset().left,visibility:"visible"})}return true},_doResizing:function(event,th,column){var width,resizeResult,columnIndex=$.inArray(column,this.grid._visibleColumns()),range,offsetLeft,offsetHeight;if(!this.options.deferredResizing){width=event.pageX-th.offset().left;if(width<0){width=0}if(this.grid._isMultiColumnGrid){offsetHeight=th.offset().top-this.grid.headersTable().offset().top}resizeResult=this._resizeColumn(columnIndex,width,true,event);if(!resizeResult.canceled){this._resizeLine.css("height",this._calculateGridResizableHeight(offsetHeight));this._resizeLine.css({left:th.offset().left+th.outerWidth()+this._gridContainerPositioningOffset().left,visibility:"visible"})}}else{range=this._getRange(this.options.columnSettings[columnIndex]);offsetLeft=th.offset().left;range.min+=offsetLeft;range.max+=offsetLeft;this._resizeLine.css({left:this._coerceRange(range,event.pageX)+this._gridContainerPositioningOffset().left,visibility:"visible"})}return true},_stopResizingMiltiColumnHeader:function(event,th,column){var i,width,cs,columnKey,self=this,children,childrenLength,childrenLengthAllowResizing=0,childrenToResize;if(this.options.deferredResizing){width=event.pageX-th.offset().left;children=column.children;childrenLength=children.length;childrenToResize=[];for(i=0;i<childrenLength;i++){columnKey=children[i].key;cs=this._findColumnSettingsByKey(columnKey);if(children[i].allowResizing===false||cs&&cs.allowResizing===false){width-=$("#"+this.grid.element[0].id+"_"+columnKey)[0].offsetWidth;continue}childrenToResize.push(children[i]);childrenLengthAllowResizing++}if(childrenLengthAllowResizing>0){this._resizeMCHDeffered(width,childrenToResize)}}$("body").removeClass(this.css.resizingHandleCursor);setTimeout(function(){self._resizing=false},0);this._cancelHoveringEffects(false);this._resizeLine.remove();this._resizeLine=undefined;return true},_resizeMCHDeffered:function(width,columns){var i,column,columnIndex,columnsLength=columns.length,visibleColumns=[],gridVC=this.grid._visibleColumns(),resizeInfo,newWidth=width,newColumnsToResize=[],avgWidth;if(columnsLength===0){return}for(i=0;i<columnsLength;i++){columnIndex=$.inArray(columns[i],gridVC);if(columnIndex===-1||this.options.columnSettings[columnIndex].allowResizing===false){continue}visibleColumns.push({column:column,columnIndex:columnIndex})}columnsLength=visibleColumns.length;if(columnsLength>0){avgWidth=parseInt(width/columnsLength,10);for(i=0;i<columnsLength;i++){column=visibleColumns[i].column;columnIndex=visibleColumns[i].columnIndex;resizeInfo=this._resizeColumn(columnIndex,avgWidth,true);if(resizeInfo.newWidth!==avgWidth){newWidth-=resizeInfo.newWidth}else{newColumnsToResize.push(column)}}}if(newWidth>5&&newWidth!==width&&newColumnsToResize.length>0){this._resizeMCHDeffered(newWidth,newColumnsToResize)}},_stopResizing:function(event,th,column){var width,self=this,columnIndex=$.inArray(column,this.grid._visibleColumns());if(this.options.deferredResizing){width=event.pageX-th.offset().left;width=this._coerceRange(this._getRange(this.options.columnSettings[columnIndex]),width);this._resizeColumn(columnIndex,width,true,event)}$("body").removeClass(this.css.resizingHandleCursor);setTimeout(function(){self._resizing=false},0);this._cancelHoveringEffects(false);this._resizeLine.remove();this._resizeLine=undefined;return true},_resizeColumn:function(columnIndex,width,fireEvents,originalEvent,startIndex){var gridWidth,minimalVisibleAreaWidth=0,widthFixedContainer,visibleColumns=this.grid._visibleColumns(),columnKey=visibleColumns[columnIndex].key,typeW,hasWidthPx,visibleIndex=columnIndex,headersTable=this.grid.headersTable(),cs,isFixed,headers,headerWidth,headerColumns,columnSettings=this.options.columnSettings,hasFixedCols=this.grid.hasFixedColumns(),columnsLength,headerColStyleWidth,hasPercentageWidth,actualColumnStyleWidths=[],actualColumnWidths=[],requiredColumnPercentageWidths=[],newColumnStyleWidths=[],i,widthToDistribute,shrinkColumns,widthDistributed,widthUsed,coercedWidth,widthPerColumn,range,totalWidth,readyColumns,readyColumnsCount,finalPixelWidth,allColumnsHaveWidth,noCancel,containerWidth,isResized=true;if(hasFixedCols){visibleIndex=this.grid.getVisibleIndexByKey(columnKey);isFixed=visibleColumns[columnIndex].fixed===true;if(isFixed){headersTable=this.grid.fixedHeadersTable()}}if(this.grid._isMultiColumnGrid){headers=$(this.grid._headerCells);if(headers.length>0){headerWidth=$(headers[columnIndex])[0].offsetWidth}}else{if(this.grid.options.virtualization===true||this.grid.options.rowVirtualization===true){headers=headersTable.find("> thead > tr").first().children("th").not("[data-skip=true]")}else{headers=headersTable.find("> thead > tr[data-header-row]").first().children("th").not("[data-skip=true]")}if(headers.length>0){headerWidth=headers.get(visibleIndex).offsetWidth}}headerColumns=headersTable.find("> colgroup > col").not("[data-skip=true]");columnSettings=this.options.columnSettings;columnsLength=headerColumns.length;headerColStyleWidth=headerColumns[visibleIndex].style.width;hasPercentageWidth=/%$/.test(headerColStyleWidth);if(headerColStyleWidth===""){hasPercentageWidth=true;headerColumns.each(function(ind,col){if(col.style.width!==""){hasPercentageWidth=false;return false}})}if(fireEvents){noCancel=this._trigger(this.events.columnResizing,originalEvent,{owner:this,columnIndex:columnIndex,columnKey:columnKey,desiredWidth:width});if(!noCancel){return{canceled:true,originalWidth:width,newWidth:width}}}if(columnKey!==undefined){cs=this._findColumnSettingsByKey(columnKey)}else{cs=columnSettings[columnIndex]}range=this._getRange(cs);width=this._coerceRange(range,width);width=Math.floor(width);if(width===range.min||width===range.max){isResized=false}if(isFixed){widthToDistribute=headerWidth-width;gridWidth=parseInt(this.grid.options.width,10);if(isNaN(gridWidth)){gridWidth=this.grid.container().outerWidth()}if(widthToDistribute<0){if(this._columnFixing){minimalVisibleAreaWidth=this._columnFixing.options.minimalVisibleAreaWidth}if(this._columnFixing._isVirtualGrid()){widthFixedContainer=this.grid._virtualcontainer().find("colgroup:first col[data-fixed-col]").width()}else{widthFixedContainer=this.grid.fixedContainer().outerWidth()}if(widthFixedContainer-widthToDistribute>gridWidth-this.grid._scrollbarWidth()-minimalVisibleAreaWidth){if(fireEvents){this._trigger(this.events.columnResizingRefused,originalEvent,{owner:this,columnIndex:columnIndex,columnKey:columnKey,desiredWidth:width})}return{canceled:true,originalWidth:width,newWidth:width}}}}if(this.grid._isMultiColumnGrid){if($.ig.util.isWebKit&&hasPercentageWidth){totalWidth=headersTable[0].offsetWidth;for(i=0;i<columnsLength;i++){if(headerColumns[i].style.width===""){actualColumnWidths[i]=parseFloat(headers[i].offsetWidth)/100*totalWidth}else{actualColumnWidths[i]=parseFloat(headerColumns[i].style.width)/100*totalWidth}}}else if(headers.length>0){for(i=0;i<columnsLength;i++){actualColumnStyleWidths[i]=headerColumns[i].style.width;actualColumnWidths[i]=headers[i][0].offsetWidth}}}else{if($.ig.util.isWebKit&&hasPercentageWidth){totalWidth=headersTable[0].offsetWidth;for(i=0;i<columnsLength;i++){if(headerColumns[i].style.width===""){actualColumnWidths[i]=parseFloat(headers[i].offsetWidth)/100*totalWidth}else{actualColumnWidths[i]=parseFloat(headerColumns[i].style.width)/100*totalWidth}}}else if(headers.length>0){for(i=0;i<columnsLength;i++){actualColumnStyleWidths[i]=headerColumns[i].style.width;actualColumnWidths[i]=headers[i].offsetWidth}}}if(hasPercentageWidth){widthToDistribute=headerWidth-width;shrinkColumns=widthToDistribute<0;readyColumns=[];readyColumnsCount=0;widthDistributed=0;if(startIndex===undefined||startIndex===null){startIndex=0}while(readyColumnsCount<columnsLength-1-startIndex&&(shrinkColumns&&widthToDistribute<-.05||!shrinkColumns&&widthToDistribute>.05)){widthPerColumn=widthToDistribute/(columnsLength-1);for(i=startIndex;i<columnsLength;i++){if(i!==columnIndex&&!readyColumns[i]){if(shrinkColumns){widthUsed=Math.max(widthPerColumn,widthToDistribute)}else{widthUsed=Math.min(widthPerColumn,widthToDistribute)}actualColumnWidths[i]+=widthUsed;range=this._getRange(columnSettings[i]);coercedWidth=this._coerceRange(range,actualColumnWidths[i]);if(Math.abs(actualColumnWidths[i]-coercedWidth)>5e-6){widthUsed-=actualColumnWidths[i]-coercedWidth;actualColumnWidths[i]=coercedWidth;readyColumns[i]=true;readyColumnsCount++}widthDistributed+=widthUsed;widthToDistribute-=widthUsed}}}actualColumnWidths[columnIndex]-=widthDistributed;totalWidth=0;for(i=0;i<columnsLength;i++){totalWidth+=actualColumnWidths[i]}for(i=0;i<columnsLength;i++){requiredColumnPercentageWidths[i]=100*actualColumnWidths[i]/totalWidth}for(i=0;i<columnsLength;i++){newColumnStyleWidths[i]=requiredColumnPercentageWidths[i]+"%";visibleColumns[i].width=newColumnStyleWidths[i]}finalPixelWidth=actualColumnWidths[columnIndex];this._applyToEachGridCOL(function(index,col){col.css("width",newColumnStyleWidths[index])},isFixed)}else{allColumnsHaveWidth=true;for(i=0;i<columnsLength;i++){if(i===visibleIndex){newColumnStyleWidths[i]=width+"px";finalPixelWidth=width;typeW=$.type(visibleColumns[columnIndex].width);hasWidthPx=typeW==="string"&&visibleColumns[columnIndex].width.indexOf("px")>0;if(typeW==="number"){visibleColumns[columnIndex].width=width}else if(typeW==="string"){if(!hasWidthPx){visibleColumns[columnIndex].width=String(width)}else{visibleColumns[columnIndex].width=newColumnStyleWidths[i]}}else{visibleColumns[columnIndex].width=newColumnStyleWidths[i]}}else{newColumnStyleWidths[i]=actualColumnStyleWidths[i];allColumnsHaveWidth=allColumnsHaveWidth&&parseInt(actualColumnStyleWidths[i],10)>0}}this._applyToEachGridCOL(function(index,col){col.css("width",newColumnStyleWidths[index])},isFixed);containerWidth=this.grid._calculateContainerWidth(false);if(allColumnsHaveWidth){if(this.grid.options.width&&parseInt(this.grid.options.width,10)>0){if(isFixed){this._columnFixing._updateFixedGridContentWidth()}else{this.grid._updateGridContentWidth()}$("#"+this.grid.element[0].id+"_horizontalScrollContainer").children("div").css("width",containerWidth);if(this.grid.options.virtualization===true||this.grid.options.rowVirtualization===true){this.grid._oldScrollLeft=$("#"+this.grid.id()+"_horizontalScrollContainer").scrollLeft()}}else{if(hasFixedCols){if(isFixed){this._columnFixing._updateFixedGridContentWidth()}else{this.grid._updateGridContentWidth()}}this.grid._setContainerWidth($("#"+this.grid.id()+"_container"));if(this.grid.options.rowVirtualization||this.grid.options.virtualization===true){$("#"+this.grid.element[0].id+"_headers_v").css("width",containerWidth+this.grid._scrollbarWidth()).css("max-width",containerWidth+this.grid._scrollbarWidth());$("#"+this.grid.element[0].id+"_displayContainer").css("width",containerWidth).css("max-width",containerWidth);$("#"+this.grid.element[0].id+"_virtualContainer > colgroup > col").first().attr("width",containerWidth);$("#"+this.grid.id()+"_footer_container").css("width",containerWidth+this.grid._scrollbarWidth()).css("max-width",containerWidth+this.grid._scrollbarWidth())}}}}if(hasFixedCols){this._columnFixing._containerResized()}if(fireEvents){this._trigger(this.events.columnResized,originalEvent,{owner:this,columnIndex:columnIndex,columnKey:columnKey,originalWidth:headerWidth,newWidth:finalPixelWidth})}return{canceled:false,originalWidth:headerWidth,newWidth:finalPixelWidth,isResized:isResized}},_applyToEachGridCOL:function(appliedFunction,isFixed){var headersTable,footersTable;if(this.grid.options.showHeader){if(isFixed){headersTable=this.grid.fixedHeadersTable()}else{headersTable=this.grid.headersTable()}headersTable.find("> colgroup > col").not("[data-skip=true]").each(function(i){appliedFunction(i,$(this))})}if(this.grid.options.fixedHeaders===true&&this.grid.options.height!==null||this.grid.options.showHeader===false){if(isFixed){$("#"+this.grid.id()+"_fixed").find("> colgroup > col").not("[data-skip=true]").each(function(i){appliedFunction(i,$(this))})}else{this.grid.element.find("> colgroup > col").not("[data-skip=true]").each(function(i){appliedFunction(i,$(this))})}}if(this.grid.options.fixedFooters===true&&this.grid.options.height!==null){if(isFixed){footersTable=this.grid.fixedFootersTable()}else{footersTable=this.grid.footersTable()}footersTable.find("> colgroup > col").not("[data-skip=true]").each(function(i){appliedFunction(i,$(this))})}},_getRange:function(column){var min=column.minimumWidth,max=column.maximumWidth;min=isNaN(min)?0:min;min=Math.max(0,min);max=isNaN(max)?Infinity:max;return{min:min,max:max}},_coerceRange:function(range,value){value=Math.max(range.min,value);value=Math.min(range.max,value);return value},_gridContainerPositioningOffset:function(){var gridContainer=this.grid.container(),containerPosition=gridContainer.css("position"),gridContainerOffsetParent=gridContainer.offsetParent(),gridContainerPosition=gridContainer.position(),gridContainerOffset=gridContainer.offset(),offsetParentScrollTop,offsetParentScrollLeft;if(containerPosition==="relative"||containerPosition==="absolute"){return{top:-gridContainerOffset.top,left:-gridContainerOffset.left}}if(gridContainerOffsetParent.is("body")){offsetParentScrollTop=0;offsetParentScrollLeft=0}else{offsetParentScrollTop=gridContainerOffsetParent.scrollTop();offsetParentScrollLeft=gridContainerOffsetParent.scrollLeft()}return{top:offsetParentScrollTop+gridContainerPosition.top-gridContainerOffset.top,left:offsetParentScrollLeft+gridContainerPosition.left-gridContainerOffset.left}},_calculateGridResizableHeight:function(heightOffset){var height,caption,headersTable,footersTable,scrollerContainer,hasVirtualization=this.grid.options.virtualization===true||this.grid.options.rowVirtualization===true||this.grid.options.columnVirtualization===true,hasWidthOrHeight=this.grid.options.height!==null||this.grid.options.width!==null;if(hasVirtualization){height=$("#"+this.grid.element[0].id+"_displayContainer").height()}else if(hasWidthOrHeight){height=this.grid.scrollContainer().height()}else{height=this.grid.element.height()}if(hasVirtualization||hasWidthOrHeight){headersTable=this.grid.headersTable();footersTable=this.grid.footersTable();if(this.grid.options.fixedHeaders===true&&this.grid.options.showHeader===true){if(headersTable.length!==0&&this.grid.element[0].id!==headersTable[0].id){height+=headersTable.height()}caption=headersTable.children("#"+this.grid.element[0].id+"_caption");if(caption.length!==0){if(!$.ig.util.isFF){height-=caption.outerHeight(true)}}}scrollerContainer=$("#"+this.element[0].id+"_hscroller_container");if(scrollerContainer.is(":visible")){height+=scrollerContainer.height()}if(this.grid.options.fixedFooters===true&&this.grid.options.showFooter===true&&footersTable.length!==0&&this.grid.element[0].id!==footersTable[0].id){height+=footersTable.height()}}if(heightOffset){height-=heightOffset}return height},_findColumnSettingsByKey:function(key,settings){var i;if(!settings){settings=this.options.columnSettings}for(i=0;i<settings.length;i++){if(settings[i].columnKey===key){return settings[i]}}},_initDefaultSettings:function(){var settings=[],key,cs=this.options.columnSettings,i,j,mch,s;if(this.grid.options.columns&&this.grid.options.columns.length>0){for(i=0;i<this.grid.options.columns.length;i++){settings[i]={columnIndex:i,columnKey:this.grid.options.columns[i].key,allowResizing:true,minimumWidth:20}}}for(i=0;i<cs.length;i++){for(j=0;j<settings.length;j++){if(settings[j].columnKey===cs[i].columnKey||settings[j].columnIndex===cs[i].columnIndex){break}}if(j===settings.length){if(this.grid._isMultiColumnGrid&&cs[i].allowResizing===false){mch=this.grid._getMultiHeaderColumnById(cs[i].columnKey);if(mch&&mch.children){mch.allowResizing=false;for(j=0;j<mch.children.length;j++){s=this._findColumnSettingsByKey(mch.children[j].key,settings);if(s){s.allowResizing=false}mch.children[j].allowResizing=false}}}continue}for(key in cs[i]){if(cs[i].hasOwnProperty(key)&&key!=="columnIndex"&&key!=="columnKey"){settings[j][key]=cs[i][key]}}}this._oColumnSettings=this.options.columnSettings;this.options.columnSettings=settings},_injectGrid:function(gridInstance){this.grid=gridInstance;this._checkGridNotSupportedFeatures();this.grid.element.unbind(".resizing");this._initDefaultSettings();this.grid.element.bind("iggridheaderrendered.resizing",$.proxy(this._headerRendered,this));this.grid.element.bind("iggridcolumnscollectionmodified.resizing",$.proxy(this._columnsCollectionModified,this));this.grid.element.bind("iggrid_columnsmoved.resizing",$.proxy(this._columnsMoved,this))},_checkGridNotSupportedFeatures:function(){var gridOptions=this.grid.options;if((gridOptions.virtualization===true||gridOptions.columnVirtualization===true)&&gridOptions.virtualizationMode==="fixed"){throw new Error($.ig.GridResizing.locale.resizingAndFixedVirtualizationNotSupported)}}});$.extend($.ui.igGridResizing,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Responsive 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.tree.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){"use strict";$.widget("ui.igGridResponsive",{options:{columnSettings:[{columnKey:null,columnIndex:null,classes:"",configuration:null}],reactOnContainerWidthChanges:true,forceResponsiveGridWidth:true,responsiveSensitivity:20,responsiveModes:null,enableVerticalRendering:true,windowWidthToRenderVertically:null,propertiesColumnWidth:"50%",valuesColumnWidth:"50%",allowedColumnWidthPerType:{string:120,number:50,bool:50,date:80,object:150},singleColumnTemplate:null,inherit:false},events:{responsiveColumnHiding:"responsiveColumnHiding",responsiveColumnHidden:"responsiveColumnHidden",responsiveColumnShowing:"responsiveColumnShowing",responsiveColumnShown:"responsiveColumnShown",responsiveModeChanged:"responsiveModeChanged"},css:{verticalContainerCssClass:"ui-iggrid-responsive-vertical"},_createWidget:function(){this.options.columnSettings=[];$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){this._callBackId=null;this._responsive=null;this._exclusiveContainer=false;this._mode="";this._modes=this.options.responsiveModes||{desktop:"infragistics",tablet:"infragistics",phone:"infragistics"};this._modes=this._initializeModeRecognizers(this._modes);this._hiddenByClass=this._flagClassConfiguration();this._defaultColumnTemplates=null;this._defaultColumnFormatters=null;this._footersDisplacement=.1;this._originalRenderRecord=null;this._newRenderRecord=null;this._vrw=typeof this.options.windowWidthToRenderVertically==="string"?parseInt(this.options.windowWidthToRenderVertically,10):this.options.windowWidthToRenderVertically;this._vr=null},_setOption:function(key,value){switch(key){case"propertiesColumnWidth":case"valuesColumnWidth":throw new Error($.ig.Grid.locale.optionChangeNotSupported.replace("{optionName}",key));case"responsiveModes":this._modes=value;this._modes=this._initializeModeRecognizers(this._modes);break;case"reactOnContainerWidthChanges":if(value===true){this._activateContainer()}else{this._deactivateContainer()}break;case"enableVerticalRendering":this.options.enableVerticalRendering=value;if(this._shouldRenderVertically()){if(!this._vr){this._enableVerticalGrid()}}else{if(this._vr){this._disableVerticalGrid()}}break;case"windowWidthToRenderVertically":this._vrw=typeof value==="string"?parseInt(value,10):value;break}$.Widget.prototype._setOption.apply(this,arguments);this._hiddenByClass=this._flagClassConfiguration()},destroy:function(){this._deactivateContainer();if(this._initialGridRenderedHandler){this.grid.element.unbind("iggridrendered",this._initialGridRenderedHandler);this.grid.element.unbind("iggridheaderrendering",this._gridHeaderRenderingHandler)}this.grid.element.unbind("iggrid_heightchanged",this._gridContainerHeightHandler);$("#"+this.grid.element[0].id+"_responsive_test_container").remove();this.grid._renderRecord=this._originalRenderRecord;this.grid._renderColgroup=this._originalRenderColgroup;this.grid._renderCell=this._originalRenderCell;$.Widget.prototype.destroy.call(this);return this},getCurrentResponsiveMode:function(){return this._mode},_activateContainer:function(){if(!this._responsive||typeof this._responsive.addCallback!=="function"){this._responsive=this.grid.element.closest(".ui-widget").igResponsiveContainer().data("igResponsiveContainer");this._exclusiveContainer=true}this._callBackId=this._responsive.addCallback(this._containerResized,this,this.options.responsiveSensitivity,"x")},_deactivateContainer:function(){if(typeof this._callBackId==="number"){this._responsive.removeCallback(this._callBackId);this._callBackId=null}if(this._exclusiveContainer===true){this._responsive.destroy();delete this._responsive;this._exclusiveContainer=false}},_renderTestElement:function(){$("<div></div>").attr("id",this.grid.element[0].id+"_responsive_test_container").css("position","fixed").css("top","-100px").text("&nbsp;").appendTo(this.grid.container())},_initializeModeRecognizers:function(){var self=this,transformed={},nval;$.each(this._modes,function(key,value){if(typeof value==="string"){nval=value.substring(0,1).toUpperCase()+value.substring(1);nval=new $.ig[nval+"Mode"]({key:key,visibilityTester:$.proxy(self._checkVisibilityByClass,self)})}else if(typeof value==="object"&&!value.isActive){nval=new $.ig.ResponsiveMode({minWidth:value.minWidth||-1,maxWidth:value.maxWidth||Number.MAX_VALUE,minHeight:value.minHeight||-1,maxHeight:value.maxHeight||Number.MAX_VALUE})}else{nval=value}transformed[key]=nval});return transformed},_flagClassConfiguration:function(){var byClass=false;$.each(this.options.columnSettings,function(){if(this.classes){byClass=true;return false}});return byClass},_getDefaultColumnTemplates:function(){var cache={},col,i;for(i=0;i<this.grid.options.columns.length;i++){col=this.grid.options.columns[i];if(col.template){if(col.key){cache[col.key]=col.template}else{cache[i]=col.template}}}return cache},_getDefaultColumnFormatters:function(){var cache={},col,i;for(i=0;i<this.grid.options.columns.length;i++){col=this.grid.options.columns[i];if(col.formatter){if(col.key){cache[col.key]=col.formatter}else{cache[i]=col.formatter}}}return cache},_checkVisibilityByClass:function(classes){var testContainer=$("#"+this.grid.element[0].id+"_responsive_test_container");testContainer.removeClass();testContainer.addClass(classes);return testContainer.is(":visible")},_gridReady:function(){return!(this.grid._loadingIndicator&&this.grid._loadingIndicator._indicator.is(":visible"))},_shouldRenderVertically:function(){if(!this.options.enableVerticalRendering){return false}if(this._vrw===null||this._vrw===undefined){return this._shouldRenderVerticallyByDefault()}if($(window).width()<this._vrw){return true}if($(window).width()>=this._vrw){return false}return false},_shouldRenderVerticallyByDefault:function(){var i,gw=this.grid.element.width(),gp=100,cw,cols=[],col,tcocww=0,p,aw;for(i=0;i<this.grid._visibleColumns().length;i++){col=this.grid._visibleColumns()[i];if(col.width){cw=-1;if(typeof col.width==="string"){if(col.width.endsWith("%")){cw=parseInt(col.width,10);gp-=cw}else{gw-=parseInt(col.width,10)}}else{gw-=col.width}if(cw!==-1){cols.push({key:col.key||i,width:cw,type:col.dataType})}continue}tcocww++;cols.push({key:col.key||i,width:-1,type:col.dataType})}for(i=0;i<cols.length;i++){p=cols[i].width===-1?gp/tcocww:cols[i].width;aw=p/100*gw;if(aw<=this.options.allowedColumnWidthPerType[cols[i].type]){return true}}return false},_isSingleColumn:function(){if(this.options.singleColumnTemplate&&this.options.singleColumnTemplate[this._mode]){return true}},_updateGridSync:function(initial,full){var self=this;if(!this._gridReady()){setTimeout(function(){self._updateGridSync(initial,full)},50);return}return self._updateGrid(initial,full)},_updateGrid:function(initial,full){var result=[],applyTemplatesFormatters=false,colsToShow,colsToHide,self=this,i;this._vr=this._vr===null?this._shouldRenderVertically():this._vr;if(this._vr){this.grid.element.addClass(this.css.verticalContainerCssClass)}if(this._hiddenByClass===true){result=this._updateColumnsByClass()}if(full===true){if(this._hiddenByClass===false){result=this._updateColumns()}applyTemplatesFormatters=this._updateTemplatesFormatters()}colsToShow=result[0]||[];colsToHide=result[1]||[];if(colsToShow.length===0&&colsToHide.length===0){if(applyTemplatesFormatters===true&&initial===false){return true}return}if(initial===false){this.grid._loadingIndicator.show();setTimeout(function(){self.grid._setHiddenColumns(colsToShow,false,initial);for(i=0;i<colsToShow.length;i++){self._trigger(self.events.responsiveColumnShown,null,self._getArgsByColumn(colsToShow[i]))}self.grid._setHiddenColumns(colsToHide,true,initial);for(i=0;i<colsToHide.length;i++){self._trigger(self.events.responsiveColumnHidden,null,self._getArgsByColumn(colsToHide[i]))}if(initial===false){self.grid._loadingIndicator.hide()}self._setMaxWidthOnGrid()},0)}else{$.each(colsToShow,function(){this.hidden=false});$.each(colsToHide,function(){this.hidden=true})}},_updateColumnsByClass:function(){var i,cs=this.options.columnSettings,col,colsToHide=[],colsToShow=[],noCancel,hidden,visible;for(i=0;i<cs.length;i++){if(cs[i].classes){col=this._getGridColumnBySetting(cs[i]);if(!col){continue}hidden=col.hidden||false;visible=this._checkVisibilityByClass(cs[i].classes);if(hidden===true&&visible===true){noCancel=this._trigger(this.events.responsiveColumnShowing,null,this._getArgsByColumnSetting(cs[i]));if(noCancel){colsToShow.push(col)}}if(hidden===false&&visible===false){noCancel=this._trigger(this.events.responsiveColumnHiding,null,this._getArgsByColumnSetting(cs[i]));if(noCancel){colsToHide.push(col)}}}}return[colsToShow,colsToHide]},_updateColumns:function(){var i,cs=this.options.columnSettings,col,colsToHide=[],colsToShow=[],noCancel,m=this._mode,hidden,visible;for(i=0;i<cs.length;i++){if(cs[i].configuration){col=this._getGridColumnBySetting(cs[i]);if(!col){continue}hidden=col.hidden||false;visible=!(cs[i].configuration[m]&&cs[i].configuration[m].hidden);if(hidden===true&&visible===true){noCancel=this._trigger(this.events.responsiveColumnShowing,null,this._getArgsByColumnSetting(cs[i]));if(noCancel){colsToShow.push(col)}}if(hidden===false&&visible===false){noCancel=this._trigger(this.events.responsiveColumnHiding,null,this._getArgsByColumnSetting(cs[i]));if(noCancel){colsToHide.push(col)}}}}return[colsToShow,colsToHide]},_updateTemplatesFormatters:function(){var i,cs=this.options.columnSettings,nt,nf,updated=false,col,m=this._mode,jsRndr=String(this.grid.options.templatingEngine).toLowerCase()==="jsrender";for(i=0;i<cs.length;i++){col=this._getGridColumnBySetting(cs[i]);if(!col){continue}if(cs[i].configuration&&cs[i].configuration[m]&&cs[i].configuration[m].template){nt=cs[i].configuration[m].template}else{nt=col.key?this._defaultColumnTemplates[col.key]:this._defaultColumnTemplates[$.inArray(col,this.grid.options.columns)]}if(cs[i].configuration&&cs[i].configuration[m]&&cs[i].configuration[m].formatter){nf=cs[i].configuration[m].formatter;nf=$.type(nf)==="string"?window[nf]:nf}else{nf=col.key?this._defaultColumnFormatters[col.key]:this._defaultColumnFormatters[$.inArray(col,this.grid.options.columns)]}if(col.template!==nt){col.template=nt;updated=true}if(col.formatter!==nf){col.formatter=nf;updated=true}}if(updated===true){if(!this.grid._tmplWrappers){this.grid._tmplWrappers=jsRndr?$.render:{}}this.grid._setTemplateDefinition(jsRndr)}return updated},_executeTemplate:function(data){if(this._jsr){return $.render[this.grid.id()+"_responsiveSct_"+this._mode](data).replace("<td","").replace("</td>","")}return $.ig.tmpl(this.options.singleColumnTemplate[this._mode],data).replace("<td","").replace("</td>","")},_renderRecord:function(data,index){if(this._vr){return this._renderRecordVerticalGrid(data,index)}if(this._scr){return this._renderRecordSingleColumnGrid(data,index)}return this._originalRenderRecord(data,index)},_renderRecordVerticalGrid:function(data,index){var i=0,str="",tstr,alt,vc=this.grid._visibleColumns(),key=this.grid.options.primaryKey;alt=index%2!==0&&this.grid.options.alternateRowStyles;for(i=0;i<vc.length;i++){str+="<tr";if(alt){str+=' class="'+this.grid.css.recordAltClass+'"'}str+=' data-id="'+data[key]+'"';str+=' data-col-key="'+vc[i].key+'"';str+="><td>";str+=vc[i].headerText+"</td>";str+="<td aria-readonly='true'";if(vc[i].template&&vc[i].template.length){tstr=this.grid._renderTemplatedCell(data,vc[i]);if(tstr.indexOf("<td")===0){str+=tstr.substring(3)}else{str+=">"+tstr}}else{str+=">"+this.grid._renderCell(data[vc[i].key],vc[i])}str+="</td></tr>"}return str},_renderRecordSingleColumnGrid:function(data,index){var str="<tr",pk=this.grid.options.primaryKey,formattedData,key,tmplRes;if(index%2!==0&&this.options.alternateRowStyles){str+=' class="'+this.grid.css.recordAltClass+'"'}if(pk!==null&&pk!==undefined){str+=' data-id="'+this.grid._kval_from_key(pk,data)+'"'}else if(data.ig_pk!==null&&pk!==undefined){str+=' data-id="'+data.ig_pk+'"'}str+="><td aria-readonly='true'";formattedData=$.extend(true,{},data);for(key in formattedData){if(formattedData.hasOwnProperty(key)){formattedData[key]=this.grid._renderCell(data[key],this.grid.columnByKey(key)||{},formattedData)}}tmplRes=this._executeTemplate(formattedData);if(tmplRes.indexOf("<td")===0){str+=tmplRes.substring(3)}else{str+=">"+tmplRes}str+="</td></tr>";return str},_renderCell:function(val,col,record,displayStyle,returnObject){var type=col.dataType,format=col.format,o=this.grid.options,auto=o.autoFormat;val=this.grid._fixDate(val,col);if(col.formatter){return col.formatter(val,record,this._mode)}if(!format&&type==="bool"&&o.renderCheckboxes){format="checkbox"}if(format==="checkbox"&&type!=="bool"){format=null}type=type==="date"||type==="number"?type:"";if(format||(auto===true||auto==="dateandnumber")&&type||auto&&auto===type){return $.ig.formatter(val,type,format,true,o.enableUTCDates,displayStyle)}if(returnObject){return val}return val||val===0||val===false?val.toString():"&nbsp;"},_renderColgroup:function(table,isHeader,isFooter,autofitLastColumn){var colgroup,fcw,scw;this._vr=this._vr===null?this._shouldRenderVertically():this._vr;this._scr=this._scr===undefined||this._scr===null?this._isSingleColumn():this._scr;if(!this._vr&&!this._scr){this._originalRenderColgroup(table,isHeader,isFooter,autofitLastColumn);return}colgroup=$(table).find("colgroup");if(colgroup.length===0){colgroup=$("<colgroup></colgroup>").prependTo(table)}colgroup.empty();if(this._vr){fcw=typeof this.options.propertiesColumnWidth==="string"?parseInt(this.options.propertiesColumnWidth,10):this.options.propertiesColumnWidth;scw=typeof this.options.valuesColumnWidth==="string"?parseInt(this.options.valuesColumnWidth,10):this.options.valuesColumnWidth;colgroup.append("<col width='"+fcw+"%'></col><col width='"+scw+"%'></col>")}else if(this._scr){colgroup.append("<col width='100%'></col>")}},_enableNoHeaderLayout:function(vr,scr){this.grid.element.addClass(this.css.verticalContainerCssClass);if(!this.grid.options.showHeader||!this.grid.options.fixedHeaders||this.grid.options.height===null){this.grid.headersTable().children("thead").css("display","none")}else{this.grid.headersTable().css("position","absolute");this.grid.headersTable().css("top","-100px")}this._vr=vr;this._scr=scr;this._modifySortingStyles();this.grid._rerenderColgroups();this.grid._renderData()},_disableNoHeaderLayout:function(){this.grid.element.removeClass(this.css.verticalContainerCssClass);if(!this.grid.options.showHeader||!this.grid.options.fixedHeaders||this.grid.options.height===null){this.grid.headersTable().children("thead").css("display","")}else{this.grid.headersTable().css("position","");this.grid.headersTable().css("top","")}this._scr=false;this._vr=false;this._modifySortingStyles(true);this.grid._rerenderColgroups();this.grid._renderData()},_getGridColumnBySetting:function(cs){var col;if(cs.columnKey&&typeof cs.columnKey==="string"){col=this.grid.columnByKey(cs.columnKey)}else if(cs.columnIndex!==null&&cs.columnIndex!==undefined&&typeof cs.columnIndex==="number"&&cs.columnIndex>=0&&cs.columnIndex<this.grid.options.columns.length){col=this.grid.options.columns[cs.columnIndex]}return col},_getArgsByColumnSetting:function(cs){return{owner:this,columnIndex:cs.columnIndex||null,columnKey:cs.columnKey||null}},_getArgsByColumn:function(col){return{owner:this,columnIndex:$.inArray(col,this.grid.options.columns),columnKey:col.key||null}},_getCurrentMode:function(){var env;$.each(this._modes,function(key){if(this.isActive()===true){env=key;return false}});return env},_containerResized:function(nw,nh){var mode=this._getCurrentMode(),prevMode,shouldUpdate=false,shouldRerender=false;if(nw<=0&&nh<=0){return}this._setMaxWidthOnGrid();if(mode&&mode!==this._mode){prevMode=this._mode;this._mode=mode;this._trigger(this.events.responsiveModeChanged,null,{owner:this,previousMode:prevMode,mode:mode});shouldUpdate=true}if(shouldUpdate||this._hiddenByClass){shouldRerender=this._updateGridSync(false,shouldUpdate)}if(this._isSingleColumn()){if(!this._scr){this._enableNoHeaderLayout(false,true)}else if(shouldUpdate){this.grid._renderData()}}else{if(this._scr){this._disableNoHeaderLayout();this._scr=false}else if(shouldRerender){this.grid._renderData()}}if(this._shouldRenderVertically()){if(!this._vr){this._enableNoHeaderLayout(true,false)}}else{if(this._vr){this._disableNoHeaderLayout();this._vr=false}else if(shouldRerender){this.grid._renderData()}}},_gridHeaderRendering:function(evt,ui){var i;if(ui.owner.id()!==this.grid.id()){return}this._renderTestElement();this._mode=this._getCurrentMode();this._defaultColumnTemplates=this._getDefaultColumnTemplates();this._defaultColumnFormatters=this._getDefaultColumnFormatters();if($.isArray(this.grid._initialHiddenColumns)){for(i=0;i<this.grid._initialHiddenColumns.length;i++){this.grid._initialHiddenColumns[i].hidden=true}}this._updateGrid(true,true);this.grid._captureInitiallyHiddenColumns()},_initialGridRendered:function(){this._activateContainer();if(this._vr||this._scr){if(!this.grid.options.showHeader||!this.grid.options.fixedHeaders||this.grid.options.height===null){this.grid.headersTable().children("thead").css("display","none")}else{this.grid.headersTable().css("position","absolute");this.grid.headersTable().css("top","-100px")}this._modifySortingStyles()}this._alreadyRendered=true;this._setMaxWidthOnGrid()},_dataRendered:function(){this._setMaxWidthOnGrid()},_modifySortingStyles:function(restore){var sorting=this.grid.element.data("igGridSorting");if(sorting){if(restore){sorting.options.applySortedColumnCss=this._srs}else{this._srs=sorting.options.applySortedColumnCss;sorting.options.applySortedColumnCss=false}}},_heightChanged:function(){var newHeight=$("#"+this.grid.element[0].id+"_scroll").height();if(this._height!==newHeight){this._height=newHeight;this.grid._adjustLastColumnWidth(false);this._setMaxWidthOnGrid()}},_setMaxWidthOnGrid:function(){var sbw=this.grid._hasVerticalScrollbar===true?this.grid._scrollbarWidth():0,npw;this.grid._gridContentWidth=0;this.grid.element.css("width","100%");if(!this.grid._allColumnWidthsInPercentage){npw=100-sbw/this.grid.container().width()*100;if(this.grid.options.fixedHeaders===true){this.grid.headersTable().css("width",npw+"%")}if(this.grid.options.fixedFooters===true){this.grid.footersTable().css("width",npw+this._footersDisplacement+"%")}}},_createHandlers:function(){this._gridHeaderRenderingHandler=$.proxy(this._gridHeaderRendering,this);this._initialGridRenderedHandler=$.proxy(this._initialGridRendered,this);this._gridContainerHeightHandler=$.proxy(this._heightChanged,this)},_injectGrid:function(gridInstance,isRebind){var key,sct;if(isRebind===true){return}this.grid=gridInstance;this._checkGridNotSupportedFeatures();this._createHandlers();if(this.options.forceResponsiveGridWidth===true){this.grid.options.width=typeof this.grid.options.width==="string"&&this.grid.options.width.endsWith("%")?this.grid.options.width:"100%";this.grid.options.autoFitLastColumn=false}if(this.options.reactOnContainerWidthChanges===true){this.grid.element.bind("iggridheaderrendering",this._gridHeaderRenderingHandler);this.grid.element.bind("iggridrendered",this._initialGridRenderedHandler)}if(this.grid.options.height!==null&&this.grid.options.height.indexOf&&this.grid.options.height.indexOf("%")!==-1){this.grid.element.bind("iggrid_heightchanged",this._gridContainerHeightHandler)}this._originalRenderRecord=$.proxy(this.grid._renderRecord,this.grid);this._newRenderRecord=$.proxy(this._renderRecord,this);this._originalRenderColgroup=$.proxy(this.grid._renderColgroup,this.grid);this._newRenderColgroup=$.proxy(this._renderColgroup,this);this._originalRenderCell=this.grid._renderCell;this._newRenderCell=$.proxy(this._renderCell,this);this.grid._renderRecord=this._newRenderRecord;this.grid._renderColgroup=this._newRenderColgroup;this.grid._renderCell=this._newRenderCell;if(String(this.grid.options.templatingEngine).toLowerCase()==="jsrender"){this._jsr=true;sct=this.options.singleColumnTemplate;if(sct&&typeof sct==="object"){for(key in sct){if(sct.hasOwnProperty(key)){$.templates(this.grid.id()+"_responsiveSct_"+key,sct[key])}}}}},_checkGridNotSupportedFeatures:function(){var gridOptions=this.grid.options;if((gridOptions.virtualization===true||gridOptions.rowVirtualization===true||gridOptions.columnVirtualization===true)&&gridOptions.virtualizationMode==="fixed"){throw new Error($.ig.igGridResponsive.locale.fixedVirualizationNotSupported)}}});$.extend($.ui.igGridResponsive,{version:"15.2.20152.1027"});$.ig=$.ig||{};$.ig.ResponsiveMode=$.ig.ResponsiveMode||Class.extend({settings:{minWidth:-1,maxWidth:Number.MAX_VALUE,minHeight:-1,maxHeight:Number.MAX_VALUE},init:function(options){if(options){this.settings=$.extend(true,{},$.ig.ResponsiveMode.prototype.settings,options)}return this},isActive:function(){return window.innerWidth>=this.settings.minWidth&&window.innerWidth<=this.settings.maxWidth&&window.innerHeight>=this.settings.minHeight&&window.innerHeight<=this.settings.maxHeight}});$.ig.InfragisticsMode=$.ig.InfragisticsMode||$.ig.ResponsiveMode.extend({settings:{key:"",visibilityTester:null},init:function(options){this._hc="ui-hidden-"+options.key;this._vc="ui-visible-"+options.key;this._super(options);return this},isActive:function(){if(typeof this.settings.visibilityTester==="function"){return this.settings.visibilityTester(this._hc)===false&&this.settings.visibilityTester(this._vc)===true}return this._super()}});$.ig.BootstrapMode=$.ig.BootstrapMode||$.ig.ResponsiveMode.extend({settings:{key:"",visibilityTester:null},init:function(options){this._hc="hidden-"+options.key;this._vc="visible-"+options.key;this._super(options);return this},isActive:function(){if(typeof this.settings.visibilityTester==="function"){return this.settings.visibilityTester(this._hc)===false&&this.settings.visibilityTester(this._vc)===true}return this._super()}})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Tooltips 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.editors.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){"use strict";$.widget("ui.igGridRowSelectors",{options:{enableRowNumbering:true,enableCheckBoxes:false,rowNumberingSeed:0,rowSelectorColumnWidth:null,requireSelection:true,showCheckBoxesOnFocus:false,inherit:false,enableSelectAllForPaging:true,selectAllForPagingTemplate:null,deselectAllForPagingTemplate:null},css:{rowSelector:"ui-iggrid-rowselector-class",rowSelectorSelected:"ui-iggrid-selectedcell ui-state-active",rowSelectorActivated:"ui-iggrid-activecell ui-state-focus",headerRowSelector:"ui-iggrid-rowselector-header",footerRowSelector:"ui-iggrid-rowselector-footer",checkBox:"ui-state-default ui-corner-all ui-igcheckbox-normal",checkBoxOff:"ui-icon ui-icon-check ui-igcheckbox-normal-off",checkBoxOn:"ui-icon ui-icon-check ui-igcheckbox-normal-on",nodeHovered:"ui-state-hover"},events:{rowSelectorClicked:"rowSelectorClicked",checkBoxStateChanging:"checkBoxStateChanging",checkBoxStateChanged:"checkBoxStateChanged"},_createWidget:function(){$.Widget.prototype._createWidget.apply(this,arguments);if(this.options.rowSelectorColumnWidth===null){this.options.rowSelectorColumnWidth=55;if(this.options.enableCheckBoxes===true&&this.options.enableRowNumbering===true){this.options.rowSelectorColumnWidth+=15}}},_create:function(){this._cIdx=0;this._functionsRedirected=false;this._hovTR=null;this._gridRenderRecord=null;this._gridRenderRecordInArray=null;this._checkBoxesShown=false;this._nTmpl="{{html ig_rs_idx}}";this._sTmpl="{{if ${ig_rs_sel} === true}}"+this.css.rowSelectorSelected+"{{/if}}";this._v=false;this._ms=false},destroy:function(){this._unregisterEvents();this._unregisterCellEvents();this._unregisterSelectAllEvents();if(this._gridRenderRecordHandler!==undefined){this.grid._renderColgroup=this._flatRenderColgroup;this.grid._renderRecord=this._gridRenderRecordHandler;this.grid._renderRecordInArray=this._gridRenderRecordInArrayHandler}if(this.options.enableCheckBoxes===true){this._unregisterCheckBoxEvents()}this._cleanInterface(false);if(this.grid._selection){this.grid._selection.removeSubscriber(this._subId,this.grid.id())}$.Widget.prototype.destroy.call(this);return this},_shouldRenderHeaderCheckBoxes:function(){return this.options.enableCheckBoxes===true&&this._ms},_renderHeaderRowSelectors:function(owner){var rows,i,cell,header,$thDataSkip;if(owner.id()!==this.grid.id()){return}rows=this.grid.headersTable().children("thead").children();if(rows.length>0){cell=rows.eq(0).find("th.ui-iggrid-expandheadercell").first();if(cell.length===0){this._index=0}else{this._index=cell.index()+1}if(this.grid._isMultiColumnGrid){$thDataSkip=$("<th></th>").prependTo(this.grid.headersTable().find("thead tr:nth-child(1)")).addClass(this.css.headerRowSelector).addClass(this.grid.css.headerClass).attr("data-role","rs").attr("data-skip","true");$thDataSkip.attr("rowspan",this.grid._maxLevel+1);if(this._shouldRenderHeaderCheckBoxes()){$(this._getCheckBox(true)).appendTo($thDataSkip)}}else{for(i=0;i<rows.length;i++){if(rows.eq(i).find("th[data-role='rs']").length>0){continue}header=$("<th>"+($.ig.util.isIE7?"&nbsp;":"")+"</th>").addClass(this.css.headerRowSelector).addClass(i===0?this.grid.css.headerClass:"").attr("data-role","rs").attr("data-skip","true").insertBefore(rows.eq(i).children().eq(this._index));if(this._shouldRenderHeaderCheckBoxes()&&i===0){$(this._getCheckBox(true)).appendTo(header)}}}}},_renderFooterRowSelectors:function(owner){var rows,i;if(owner.id()!==this.grid.id()){return}rows=this.grid.footersTable().children("tfoot").children();if(rows.length>0){for(i=0;i<rows.length;i++){if(rows.eq(i).find("td[data-role='rs']").length>0){continue}$("<td>"+($.ig.util.isIE7?"&nbsp;":"")+"</td>").addClass(this.css.footerRowSelector).attr("data-role","rs").attr("data-skip","true").insertBefore(rows.eq(i).children().eq(this._index))}}},_headerRendered:function(event,ui){this._ms=!this._skipRefresh&&this._getSelectionInstance().options.multipleSelection===true;this._renderHeaderRowSelectors(ui.owner);this._getColumnFixingInstance()},_footerRendered:function(event,ui){this._renderFooterRowSelectors(ui.owner)},_getColumnFixingInstance:function(){if(!this._columnFixing&&this.grid.element.data("igGridColumnFixing")){this._columnFixing=this.grid.element.data("igGridColumnFixing")}return this._columnFixing},_getSelectionInstance:function(){if(!this._selection&&this.grid.element.data("igGridSelection")){this._selection=this.grid.element.data("igGridSelection")}return this._selection},_recordsRendering:function(event,ui){if(this.grid.id()!==ui.owner.id()){return}this._cIdx=ui.vrtWnd.start&&ui.vrtWnd.end?ui.vrtWnd.start:0;this._redirectFunctions()},_redirectFunctions:function(){if(this._functionsRedirected===false){this._renderRecordHandler=$.proxy(this._rsRenderRecord,this);this._renderRecordInArrayHandler=$.proxy(this._rsRenderRecordInArray,this);this._gridRenderRecordHandler=$.proxy(this.grid._renderRecord,this.grid);this._gridRenderRecordInArrayHandler=$.proxy(this.grid._renderRecordInArray,this.grid);this._gridRenderRecord=this._gridRenderRecordHandler;this._gridRenderRecordInArray=this._gridRenderRecordInArrayHandler;this.grid._renderRecord=this._renderRecordHandler;this.grid._renderRecordInArray=this._renderRecordInArrayHandler}this._functionsRedirected=true},_recordsRendered:function(event,ui){if(this.grid.id()!==ui.owner.id()){return}if(this.options.enableCheckBoxes===true){this._registerCheckBoxEvents();this._updateHeader()}},_gridRendered:function(event,ui){if(ui===undefined){return}if(this.grid.id()!==ui.owner.id()){return}this._ms=!this._skipRefresh&&this._getSelectionInstance().options.multipleSelection===true;this._unregisterCellEvents();this._registerCellEvents();if(this.options.enableCheckBoxes===true){this._registerCheckBoxEvents()}this._bindToSelectionCollection()},_hidingFinished:function(){this._unregisterCellEvents();this._registerCellEvents()},_rsRenderColgroup:function(flatRenderColgroup,rs,table,isHeader,isFooter,autofitLastColumn){var cf;flatRenderColgroup.apply(this,[table,isHeader,isFooter,autofitLastColumn]);if(rs.grid.hasFixedColumns()){cf=rs._getColumnFixingInstance();if(cf.options.fixingDirection==="left"){return}}rs._rsRenderColgroupHelper(table)},_rsRenderColgroupHelper:function(table){var cgrp;cgrp=$(table).find("colgroup");if(cgrp.find("col[data-role='rs']").length===0){$("<col></col>").prependTo(cgrp).css("width",this.options.rowSelectorColumnWidth).attr("data-skip","true").attr("data-role","rs")}},_rsRenderFixedColgroup:function(isHeader,isFooter,autofitLastColumn){var cf=this._columnFixing,table;this._renderFixedColgroupHandler(isHeader,isFooter,autofitLastColumn);if(!cf||cf.options.fixingDirection!=="left"){return}if(isHeader){table=cf._containers.header.fixedTable||cf._containers.body.fixedTable}else if(isFooter){table=cf._containers.footer.fixedTable||cf._containers.body.fixedTable}else{table=cf._containers.body.fixedTable}this._rsRenderColgroupHelper(table)},_rsRenderFixedRecord:function(data,rowIndex){var markup=this._renderFixedRecordHandler(data,rowIndex),pre,app,idx,rs=this._getRowSelectorCellMarkup(false,this._rowHasSelection(data));idx=markup.indexOf("ui-iggrid-expandcolumn");if(idx>=0){app=markup.substr(idx);idx=idx+app.indexOf("</td>")+4;pre=markup.substring(0,idx+1);app=markup.substring(idx+1)}else{idx=markup.indexOf(">")+1;pre=markup.substring(0,idx);app=markup.substring(idx)}markup=pre+rs+app;return markup},_rsRenderRecord:function(data,rowIndex){var markup=this._gridRenderRecord(data,rowIndex),pre,app,idx,rs=this._getRowSelectorCellMarkup(false,markup.indexOf("ui-iggrid-selectedcell")!==-1);idx=markup.indexOf("ui-iggrid-expandcolumn");if(idx>=0){app=markup.substr(idx);idx=idx+app.indexOf("</td>")+4;pre=markup.substring(0,idx+1);app=markup.substring(idx+1)}else{idx=markup.indexOf(">")+1;pre=markup.substring(0,idx);app=markup.substring(idx)}markup=pre+rs+app;return markup},_rsRenderRecordInArray:function(darr,tbody,data,rowIndex){var i,j,sel=false;this._gridRenderRecordInArray(darr,tbody,data,rowIndex);for(i=darr.length-1;i>=0;i--){if(darr[i].indexOf&&darr[i].indexOf("<tr")!==-1){for(j=i;j<darr.length;j++){if(darr[j].indexOf&&darr[j].indexOf("ui-iggrid-selectedcell")!==-1){sel=true;break}}for(j=i;j<darr.length;j++){if(darr[j].indexOf&&darr[j].indexOf("<td")!==-1){if(darr[j].indexOf("ui-iggrid-expandcolumn")!==-1){darr[j]+=this._getRowSelectorCellMarkup(false,sel);sel=false;break}darr[j]=this._getRowSelectorCellMarkup(false,sel)+darr[j];sel=false;break}}break}}},_renderExtraHeaderCells:function(row,colgroup,prepend){this._renderExtraCells(row,colgroup,prepend,true)},_renderExtraFooterCells:function(row,colgroup,prepend,cssClass){this._renderExtraCells(row,colgroup,prepend,false,cssClass)},_renderExtraCells:function(row,colgroup,prepend,header,cssClass){var rHeader,rCol,index,cell;if(row.find("[data-role='rs']").length>0){return}if(header===true){rHeader=$("<th>"+($.ig.util.isIE7?"&nbsp;":"")+"</th>").addClass(this.css.headerRowSelector).attr("data-role","rs").attr("data-skip","true")}else{rHeader=$("<td>"+($.ig.util.isIE7?"&nbsp;":"")+"</td>").addClass(this.css.footerRowSelector).addClass(cssClass).attr("data-role","rs").attr("data-skip","true")}cell=row.find("th.ui-iggrid-expandheadercell,td.ui-iggrid-expandheadercellgb");if(cell.length===0){cell=row.children().first();index=0}else{index=cell.last().index()+1}if(index===0){rHeader.prependTo(row)}else{rHeader.insertBefore(row.children().eq(index))}if(colgroup){rCol=$("<col></col>").attr("data-skip","true").attr("data-role","rs").css("width",this.options.rowSelectorColumnWidth);rCol.insertBefore(colgroup.children().eq(index))}},_registerCellEvents:function(){this._allRowSelectorCells().bind({click:this._rsClickHandler});this.grid.element.children("tbody").bind({mousemove:this._rrHoverHandler,mouseleave:this._rrLeaveHandler})},_unregisterCellEvents:function(){this._allRowSelectorCells().unbind({click:this._rsClickHandler});this.grid.element.children("tbody").unbind({mousemove:this._rrHoverHandler,mouseleave:this._rrLeaveHandler})},_registerCheckBoxEvents:function(){this._allCheckboxes().unbind({click:this._checkboxClickHandler,keydown:this._checkboxClickHandler,mouseover:this._checkboxMouseOverHandler,mouseout:this._checkboxMouseOutHandler}).bind({click:this._checkboxClickHandler,keydown:this._checkboxClickHandler,mouseover:this._checkboxMouseOverHandler,mouseout:this._checkboxMouseOutHandler});this._headerCheckbox().unbind({click:this._hCheckboxClickHandler,keydown:this._hCheckboxClickHandler,mouseover:this._checkboxMouseOverHandler,mouseout:this._checkboxMouseOutHandler}).bind({click:this._hCheckboxClickHandler,keydown:this._hCheckboxClickHandler,mouseover:this._checkboxMouseOverHandler,mouseout:this._checkboxMouseOutHandler})},_unregisterCheckBoxEvents:function(){this._allCheckboxes().unbind({click:this._checkboxClickHandler,keydown:this._checkboxClickHandler,mouseover:this._checkboxMouseOverHandler,mouseout:this._checkboxMouseOutHandler});this._headerCheckbox().unbind({click:this._hCheckboxClickHandler,keydown:this._hCheckboxClickHandler,mouseover:this._checkboxMouseOverHandler,mouseout:this._checkboxMouseOutHandler})},_checkboxMouseOver:function(event){$(event.target).closest("span[data-role='checkbox']").addClass(this.css.nodeHovered)},_checkboxMouseOut:function(event){$(event.target).closest("span[data-role='checkbox']").removeClass(this.css.nodeHovered)},_checkBoxClicked:function(event){if(event.type==="keydown"&&event.keyCode!==$.ui.keyCode.ENTER&&event.keyCode!==$.ui.keyCode.SPACE){return}var trg=$(event.target).closest("span[name='chk']"),rCell=trg.parent(),rRow=rCell.parent(),args,rIdx=this._getVisibleRowIndex(rRow),rKey=rRow.attr("data-id"),noCancel,state=trg.attr("data-chk");if(rKey===""||rKey===null||rKey===undefined){rKey=rIdx}args={row:rRow,rowIndex:rIdx,rowKey:rKey,rowSelector:rCell,owner:this,grid:this.grid,currentState:state,newState:state==="off"?"on":"off",isHeader:false};noCancel=this._triggerCheckingEvent(event,args);if(noCancel===true){this._handleCheck(trg);delete args.currentState;args.state=args.newState;delete args.newState;this._triggerCheckedEvent(event,args)}event.preventDefault();event.stopPropagation()},_headerCheckBoxClicked:function(event){var trg=$(event.target).closest("span[name='hchk']"),args,noCancel,state=trg.attr("data-chk");if(event.type==="keydown"&&event.keyCode!==$.ui.keyCode.ENTER&&event.keyCode!==$.ui.keyCode.SPACE){return}args={owner:this,grid:this.grid,currentState:state,newState:state==="off"?"on":"off",isHeader:true};noCancel=this._triggerCheckingEvent(event,args);if(noCancel===true){this._handleHeaderCheck(trg);delete args.currentState;args.state=args.newState;delete args.newState;this._triggerCheckedEvent(event,args)}event.stopPropagation();event.preventDefault()},_handleCheck:function(checkbox){var row,rowId,upd,sel,offset;if(!checkbox){return}upd=this.grid.element.data("igGridUpdating");sel=this._getSelectionInstance();if(sel&&sel._suspend){if(upd){if(upd.findInvalid()){return}upd._endEdit(null,true)}else{return}}offset=this._v?this.grid._startRowIndex:0;row=checkbox.parent().parent();if(this.grid.hasFixedColumns()){if(this.grid.fixedBodyContainer().attr("data-fixing-direction")==="left"){row=row.add(this.grid.element.find("tbody > tr").eq(row.index()))}else{row=row.add(this.grid.fixedBodyContainer().find("tbody > tr").eq(row.index()))}}rowId=this.grid._fixPKValue(row.attr("data-id"));if(rowId===null||rowId===undefined){rowId=row.closest("tbody").children("tr:not([data-container])").index(row)+offset}if(this.grid._selection.settings.owner!==this.grid){this.grid._selection.changeOwner(this.grid)}if(checkbox.attr("data-chk")==="off"){if(sel.options.activation){this.grid._selection.activate(rowId,row)}this.grid._selection.select(rowId,true,{element:row,checkbox:checkbox})}else{this.grid._selection.deselect(rowId,{element:row,checkbox:checkbox})}},_handleHeaderCheck:function(checkbox){var sel,go=this.grid.options,v=go.virtualization||go.rowVirtualization,templateData,toCheck=checkbox.attr("data-chk")==="off";sel=this._getSelectionInstance();if(this.grid._selection.settings.owner!==this.grid){this.grid._selection.changeOwner(this.grid)}if(toCheck){if(v){this._selectAllVirtualRows(sel)}else{this._selectAllRows(sel)}this._alterCheckbox(checkbox,true)}else{if(v){this._deselectAllVirtualRows(sel)}else{this._deselectAllRows(sel)}this._alterCheckbox(checkbox,false)}if(this.options.enableSelectAllForPaging&&this.grid.element.data("igGridPaging")){templateData=[{checked:this._getSelectionInstance().selectedRows().length,totalRecordsCount:this._getDSLocalRecords().length}];this._renderOverlay(templateData,toCheck)}},_getDSLocalRecords:function(){var ds=this.grid.dataSource,trecCount=ds.totalLocalRecordsCount();if(ds._filteredData&&ds._filteredData.length>trecCount){return ds._filteredData}return this._getAllData()},_renderOverlay:function(templateData,toCheck){var hTable=this.grid.headersTable(),overlay;if(toCheck){overlay=this._getSelectAllOverlay(templateData)}else{overlay=this._getDeselectAllOverlay(templateData)}if(overlay){overlay.css({"z-index":"1000",width:"inherit",position:"absolute",top:(this.grid.options.height||this.grid.options.width?hTable.parent().position().top:hTable.position().top)+hTable.find("thead:first").outerHeight()});overlay.children("div:first").css("padding-left",this.options.rowSelectorColumnWidth);overlay.appendTo(this.grid.container());this._registerSelectAllEvents(overlay)}},_getSelectAllOverlay:function(templateData){var ti=this.grid.options.tabIndex,overlay,selectAllTemplate;if(templateData[0].checked>=templateData[0].totalRecordsCount){return null}if(this.options.selectAllForPagingTemplate){overlay=this._jsr?$($.render([this.grid.id()+"_selectAllForPagingTemplate"](templateData))):$($.ig.tmpl(this.options.selectAllForPagingTemplate,templateData))}else{selectAllTemplate=$.ig.GridRowSelectors.locale.selectedRecordsText.replace("${checked}",templateData[0].checked)+" <a href='#' data-rs-select-all tabindex='"+ti+"'>"+$.ig.GridRowSelectors.locale.selectAllText.replace("${totalRecordsCount}",templateData[0].totalRecordsCount)+"</a>";overlay=this._getDefaultOverlay(selectAllTemplate,true)}return overlay},_getDeselectAllOverlay:function(templateData){var ti=this.grid.options.tabIndex,overlay,deselectAllTemplate;if(templateData[0].checked===0){return null}if(this.options.deselectAllForPagingTemplate){overlay=this._jsr?$($.render([this.grid.id()+"_deselectAllForPagingTemplate"](templateData))):$($.ig.tmpl(this.options.deselectAllForPagingTemplate,templateData))}else{deselectAllTemplate=$.ig.GridRowSelectors.locale.deselectedRecordsText.replace("${unchecked}",templateData[0].totalRecordsCount-templateData[0].checked)+" <a href='#' data-rs-deselect-all tabindex='"+ti+"'>"+$.ig.GridRowSelectors.locale.deselectAllText.replace("${totalRecordsCount}",templateData[0].totalRecordsCount)+"</a>";overlay=this._getDefaultOverlay(deselectAllTemplate,false)}return overlay},_getDefaultOverlay:function(template,toCheck){var ti=this.grid.options.tabIndex;return $("<div>").attr({"class":"ui-widget-header ui-priority-secondary",tabIndex:ti,id:this.grid.id()+(toCheck?"_":"_de")+"select_all_overlay"}).append($("<div>").html(template).append($("<div>").css("float","right").append($("<span>").addClass("ui-icon-close").addClass("ui-icon").addClass("ui-button").attr("data-rs-close-all","").attr("tabindex",ti))))},_registerSelectAllEvents:function(overlay){var self=this,overlayId=overlay.attr("id");this.grid.container().bind("mouseup.containerselectall",function(event){if(event.type==="mouseup"&&$(event.target).closest("#"+overlayId).length===0){$(this).unbind(".containerselectall");if($(overlay)){overlay.remove()}}});overlay.bind("blur.containerselectall",function(){$(this).unbind(".containerselectall");if($(overlay)){overlay.remove()}});overlay.find("[data-rs-select-all]").bind("mouseup",function(event){self._selectAllFromOverlay();event.stopPropagation();overlay.remove()});overlay.find("[data-rs-deselect-all]").bind("mouseup",function(event){self._deselectAllFromOverlay();event.stopPropagation();overlay.remove()});overlay.find("[data-rs-select-all]").bind("keypress",function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){self._selectAllFromOverlay();overlay.remove()}});overlay.find("[data-rs-deselect-all]").bind("keypress",function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){self._deselectAllFromOverlay();overlay.remove()}});overlay.find("[data-rs-close-all]").bind("mouseup",function(event){event.stopPropagation();overlay.remove()});overlay.find("[data-rs-close-all]").bind("keypress",function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){overlay.remove()}})},_selectAllFromOverlay:function(){this._changeCheckStateForAllRecords(this._getSelectionInstance(),true)},_deselectAllFromOverlay:function(){this._changeCheckStateForAllRecords(this._getSelectionInstance(),false)},_unregisterSelectAllEvents:function(){if(this.grid.element.data("igGridPaging")&&this.options.enableSelectAllForPaging){this.grid.container().unbind(".containerselectall");$(this.grid.id()+"_select_all_overlay").remove();$(this.grid.id()+"_deselect_all_overlay").remove()}},_updateHeader:function(){var dvl,sl,checkboxes,check=true,i;if(this.grid.element.data("igGridPaging")){checkboxes=this._allCheckboxes();if(checkboxes.length===0){check=false}else{for(i=0;i<checkboxes.length;i++){if(checkboxes.eq(i).attr("data-chk")==="off"){check=false;break}}}}else{dvl=this._getDataView().length;sl=this.grid._selection?this.grid._selection.selectionLength():0;check=sl===dvl&&this._isFirstRowSelected()}this._alterCheckbox(this._headerCheckbox(),check)},_alterCheckbox:function(checkbox,check){var inner=checkbox.children().first();if(checkbox.length>0&&inner.length>0){if(check===true){checkbox.attr("data-chk","on");inner.removeClass(this.css.checkBoxOff).addClass(this.css.checkBoxOn)}else{checkbox.attr("data-chk","off");inner.removeClass(this.css.checkBoxOn).addClass(this.css.checkBoxOff)}}},_getRowSelectorCellMarkup:function(template,selected){var markup="";markup+='<th role="rowheader" tabindex="'+this.grid.options.tabIndex+'" class="'+this.css.rowSelector;if(selected){markup+=" "+this.css.rowSelectorSelected}if(template){markup+=" "+this._sTmpl}markup+='"><span class="ui-icon ui-icon-triangle-1-e" style="margin-left: -5px"></span>';if(this.options.enableRowNumbering){markup+=template===true?this._nTmpl:this._getCurrentNumber()}if(this.options.enableCheckBoxes){markup+=this._getCheckBox(false,selected)}markup+="</th>";return markup},_getCheckBox:function(header,checked){var markup="";markup+='<span name="'+(header===true?"hchk":"chk")+'" ';markup+='data-chk="'+(checked?"on":"off")+'" ';markup+='data-role="checkbox" class="'+this.css.checkBox+' "';markup+='tabindex="'+this.grid.options.tabIndex+' "';if(this.options.showCheckBoxesOnFocus===true&&this._checkBoxesShown===false){markup+=' style="visibility: hidden;"'}markup+='><span class="'+(checked?this.css.checkBoxOn:this.css.checkBoxOff)+'">';markup+="</span></span>";return markup},_getCurrentNumber:function(id){var seed;if(id!==undefined&&id!==null){seed=id}else{seed=++this._cIdx}return'<span class="ui-iggrid-rowselector-row-number">'+(seed+this.options.rowNumberingSeed+this._getStartingIndexForPage())+"</span>"},_getStartingIndexForPage:function(){return this.grid.dataSource.pageIndex()*this.grid.dataSource.pageSize()},_selectAllRows:function(selection){var checkboxes=this._allCheckboxes(),i,range=[],row,rowId;if(checkboxes.length===0){return}for(i=0;i<checkboxes.length;i++){row=checkboxes.eq(i).parent().parent();if(this.grid.hasFixedColumns()){if(this.grid.fixedBodyContainer().attr("data-fixing-direction")==="left"){row=row.add(this.grid.element.find("tbody > tr").eq(row.index()))}else{row=row.add(this.grid.fixedBodyContainer().find("tbody > tr").eq(row.index()))}}rowId=selection._pkProp?this.grid._fixPKValue(row.attr("data-id")):i;range.push({id:rowId,element:row,checkbox:checkboxes.eq(i)})}this._suspendHeader=true;this.grid._selection.rangeSelect(range,true,null,false,false);this._suspendHeader=false},_selectAllVirtualRows:function(selection){var dv=this._getDataView(),fr,lr,rangeStats;if(dv.length===0){return}if(selection._pkProp){fr=dv[0][selection._pkProp];lr=dv[dv.length-1][selection._pkProp]}else{fr=0;lr=dv.length-1}rangeStats=selection._getRecordRange(fr,lr);this._suspendHeader=true;this.grid._selection.rangeSelect(rangeStats.range,true,null,rangeStats,false);if(this.grid.options.virtualizationMode==="continuous"){this.grid._correctScrollPosition(this.grid._getTotalRowsCount())}this._suspendHeader=false},_changeCheckStateForAllRecords:function(selection,toCheck){var dv=this._getDSLocalRecords(),fr,lr,rangeStats;if(dv.length===0){return}if(selection._pkProp){fr=dv[0][selection._pkProp];lr=dv[dv.length-1][selection._pkProp]}else{fr=0;lr=dv.length-1}rangeStats=selection._getRecordRange(fr,lr,dv);this._suspendHeader=true;if(toCheck){this.grid._selection.rangeSelect(rangeStats.range,true,null,rangeStats,false)}else{this.grid._selection.rangeDeselect(rangeStats.range,rangeStats,false)}this._suspendHeader=false},_deselectAllRows:function(selection){var checkboxes=this._allCheckboxes(),i,row,rowId,range=[];if(checkboxes.length===0){return}if(this.grid.element.data("igGridPaging")){for(i=0;i<checkboxes.length;i++){row=checkboxes.eq(i).parent().parent();if(this.grid.hasFixedColumns()){row=row.add(this.grid.scrollContainer().find("tbody > tr").eq(i))}rowId=selection._pkProp?this.grid._fixPKValue(row.attr("data-id")):i;range.push({id:rowId,element:row,checkbox:checkboxes.eq(i)})}this._suspendHeader=true;this.grid._selection.rangeDeselect(range,false,false);this._suspendHeader=false}else{this.grid._selection.deselectAll(false)}},_deselectAllVirtualRows:function(selection){var dv=this._getDataView(),rangeStats,fr,lr;if(dv.length===0){return}if(this.grid.element.data("igGridPaging")){if(selection._pkProp){fr=dv[0][selection._pkProp];lr=dv[dv.length-1][selection._pkProp]}else{fr=0;lr=dv.length-1}rangeStats=selection._getRecordRange(fr,lr);this._suspendHeader=true;this.grid._selection.rangeDeselect(rangeStats.range,false,false);this._suspendHeader=false}else{this.grid._selection.deselectAll(false)}},_isFirstRowSelected:function(){var row=this.grid.element.find("tbody > tr:not([data-grouprow='true']):first"),rowId=row.attr("data-id");rowId=rowId!==null&&rowId!==undefined?this.grid._fixPKValue(rowId):this._getStartingIndexForPage();return this.grid._selection.isSelected(rowId,this.grid)},_rowHasSelection:function(data){var sel=this._getSelectionInstance(),rowId=data[this.grid.options.primaryKey||"ig_pk"];if(!sel||rowId===null||rowId===undefined){return false}if(sel.options.mode==="cell"){return this.grid._selection.atLeastOneSelected(rowId,sel)}return this.grid._selection.isSelected(rowId,this.grid)},_rsRenderVirtualRecords:function(event,ui){var i=0,rs,rows,rowsLen;this._cIdx=0;if(this.grid.hasFixedColumns()&&this._getColumnFixingInstance().options.fixingDirection==="left"){rows=ui.fixedRows}else{rows=ui.rows}rowsLen=rows.length;for(i;i<rowsLen;i++){rs=$(this._getRowSelectorCellMarkup());rs.prependTo(rows.eq(i))}this._unregisterCellEvents();this._registerCellEvents();if(this.options.enableCheckBoxes===true){this._registerCheckBoxEvents()}},_rrn:function(){var rs=this._allRowSelectorCells(),cb=this._allCheckboxes(),cbx,i=0,self=this,sri=this.grid._startRowIndex||0,row,rowId;if(this.grid.options.virtualization===true&&this.grid.options.virtualizationMode==="continuous"){this._unregisterCellEvents();this._registerCellEvents();if(this.options.enableCheckBoxes===true){this._unregisterCheckBoxEvents();this._registerCheckBoxEvents()}}if(this.grid.options.virtualizationMode==="fixed"){for(i=0;i<rs.length;i++){rs.eq(i).removeClass(this.css.nodeHovered);if(this.options.enableRowNumbering===true){rs.eq(i).children("span.ui-iggrid-rowselector-row-number").text(sri+i+this.options.rowNumberingSeed+1)}}}if(!this._skipRefresh){rs.removeClass(this.css.rowSelectorSelected);cb.map(function(){self._alterCheckbox($(this),false)});for(i=0;i<rs.length;i++){row=rs.eq(i).closest("tr");rowId=this.grid._fixPKValue(row.attr("data-id"));if(rowId===null||rowId===undefined){rowId=i+sri}if(this.grid._selection.selection[rowId]!==undefined){rs.eq(i).addClass(this.css.rowSelectorSelected);cbx=cb.eq(i);if(cbx.length===1){this._alterCheckbox(cbx,true)}}}}},_bindToSelectionCollection:function(){if(this.grid._selection&&!this._subId){this._subId=this.grid._selection.addSubscriber(this,this.grid.id())}},_select:function(info){var res;info.element=info.element||this.grid._selection.elementFromIdentifier(info.id);res=this._rowSelectorFromSelection(info);if(!res){return}res.rowSelector.addClass(this.css.rowSelectorSelected);if(this.options.enableCheckBoxes){this._alterCheckbox(res.checkbox,true);if(this._ms&&!this._suspendHeader){this._updateHeader()}}},_deselect:function(info){var res,shouldDeselect;info.element=info.element||this.grid._selection.elementFromIdentifier(info.id);res=this._rowSelectorFromSelection(info);if(!res){return}shouldDeselect=this.grid._selection instanceof $.ig.SelectedRowsCollection||!this.grid._selection.atLeastOneSelected(this.grid._fixPKValue(info.element.parent().attr("data-id")));if(shouldDeselect){res.rowSelector.removeClass(this.css.rowSelectorSelected);if(this.options.enableCheckBoxes){this._alterCheckbox(res.checkbox,false);if(this._ms&&!this._suspendHeader){this._updateHeader()}}}},_activate:function(element){if(element.is("th")){element.addClass(this.css.rowSelectorActivated)}},_deactivate:function(){if(this.grid.hasFixedColumns()){this.grid.fixedBodyContainer().find("tbody").find("th.ui-iggrid-activecell").removeClass(this.css.rowSelectorActivated)}this.grid.element.find("tbody").find("th.ui-iggrid-activecell").removeClass(this.css.rowSelectorActivated)},_clearSelection:function(){var rsCells,self=this;if(this.grid.hasFixedColumns()&&this.grid.fixedBodyContainer().attr("data-fixing-direction")==="left"){rsCells=this.grid.fixedBodyContainer().find("tbody").find("th.ui-iggrid-selectedcell").removeClass(this.css.rowSelectorSelected)}else{rsCells=this.grid.element.children("tbody").find("th.ui-iggrid-selectedcell").removeClass(this.css.rowSelectorSelected)}if(this.options.enableCheckBoxes){$.each(rsCells,function(){self._alterCheckbox($(this).children("span:last"),false)});this._alterCheckbox(this._headerCheckbox(),false)}},_cellClick:function(event){var args,target=$(event.target),fRow,rCell=target.closest("th"),rRow=rCell.parent(),rIdx=this._getVisibleRowIndex(rRow),rKey=rRow.attr("data-id"),fdCell,gridContainer,sel=this._getSelectionInstance();if(this.options.showCheckBoxesOnFocus===true&&this._checkBoxesShown===false){this._animateCheckboxes(true)}if(!sel){return}if(target.is("span")&&target.attr("unselectable")){return}if(rKey===""||rKey===null||rKey===undefined){rKey=rIdx}if(this.grid.hasFixedColumns()){if(this.grid._isFixedElement(rCell)){if(this.grid.options.virtualization||this.grid.options.rowVirtualization){gridContainer=this.grid._vdisplaycontainer()}else{gridContainer=this.grid.scrollContainer()}fRow=rRow;rRow=gridContainer.find("tbody > tr").eq(fRow.index())}else{fRow=this.grid.fixedBodyContainer().find("tbody > tr").eq(rRow.index())}}fdCell=this._getFirstDataCell(rRow,fRow);if(event.shiftKey&&this._ms){sel._shiftSelectChange(fdCell)}else{sel._singleSelectChange(fdCell,event.ctrlKey)}args={row:rRow,fixedRow:fRow,rowIndex:rIdx,rowKey:rKey,rowSelector:rCell,owner:this,grid:this.grid};this._triggerClickEvent(event,args)},_getFirstDataCell:function(row,frow){if(frow&&frow.length>0){frow.children("td").not("[data-skip='true'],[data-parent='true']").first()}return row.children("td").not("[data-skip='true'],[data-parent='true']").first()},_mouseHoverRow:function(event){var par,tag,tr=event.target;while(tr){par=tr.parentNode;tag=tr.nodeName;if(tag==="TR"&&par.nodeName==="TBODY"){break}tr=tag==="TABLE"?null:par}if(this._hovTR!==tr){this._mouseHoverRowHelper(this._hovTR,tr);if(this.grid.hasFixedColumns()){this._mouseHoverFixedRow($(this._hovTR),$(tr))}this._hovTR=tr}},_mouseHoverRowHelper:function(hovTr,tr){if(hovTr&&$(hovTr).attr("data-container")!=="true"){$("th."+this.css.rowSelector,hovTr).removeClass(this.css.nodeHovered)}if(tr&&$(tr).attr("data-container")!=="true"){$("th."+this.css.rowSelector,tr).addClass(this.css.nodeHovered)}},_mouseHoverFixedRow:function($hovTR,$tr){var $fHTR,$fTR,ind;ind=$hovTR.index();$fHTR=this.grid.fixedBodyContainer().find("tr:nth-child("+(ind+1)+")");ind=$tr.index();$fTR=this.grid.fixedBodyContainer().find("tr:nth-child("+(ind+1)+")");this._mouseHoverRowHelper($fHTR,$fTR)},_mouseLeaveRow:function(){var ind,$fHTR;if(this._hovTR){$("th",this._hovTR).removeClass(this.css.nodeHovered);if(this.grid.hasFixedColumns()){ind=$(this._hovTR).index();$fHTR=this.grid.fixedBodyContainer().find("tr:nth-child("+(ind+1)+")");$fHTR.find("th").removeClass(this.css.nodeHovered)}this._hovTR=null}},_triggerClickEvent:function(event,args){this._trigger(this.events.rowSelectorClicked,event,args)},_triggerCheckingEvent:function(event,args){return this._trigger(this.events.checkBoxStateChanging,event,args)},_triggerCheckedEvent:function(event,args){this._trigger(this.events.checkBoxStateChanged,event,args)},_getVisibleRowIndex:function(row){return row.closest("tbody").children("tr:not([data-container='true'],[data-grouprow='true'])").index(row)},_getVisibleHRowIndex:function(row){return row.closest("tbody").children("tr:not([data-container='true'])").index(row)},_animateCheckboxes:function(trans){var h=this._headerCheckbox(),c=this._allCheckboxes(),all=h.add(c);if(trans===true){all.css("visibility","visible").css("opacity",0).animate({opacity:1},1e3)}else{all.css("opacity",1e3).animate({opacity:0},1e3,function(){$(this).css("visibility","hidden")})}this._checkBoxesShown=trans},_rowAdded:function(){this._unregisterCellEvents();
this._registerCellEvents();if(this.options.enableCheckBoxes===true){this._registerCheckBoxEvents()}},_resetIndexing:function(){this._cIdx=0},_groupedColumnsChanging:function(){this._resetIndexing()},_cleanInterface:function(isRebind){var header,footer,cols,rsCells,w;if(isRebind===true){this._alterCheckbox(this._headerCheckbox(),false);return}cols=this.grid.element.children("colgroup").children("[data-role='rs']");cols=cols.add(this.grid.fixedBodyContainer().find("colgroup").children("[data-role='rs']"));if(this.grid.options.fixedHeaders===true){cols=cols.add(this.grid.headersTable().children("colgroup").children("[data-role='rs']"));cols=cols.add(this.grid.fixedHeadersTable().children("colgroup").children("[data-role='rs']"))}if(this.grid.options.fixedFooters===true){cols=cols.add(this.grid.footersTable().children("colgroup").children("[data-role='rs']"));cols=cols.add(this.grid.fixedFootersTable().children("colgroup").children("[data-role='rs']"))}footer=this._footerRowSelectorCells();header=this._headerRowSelectorCells();rsCells=this._allRowSelectorCells();if(!this.grid.options.width&&this._functionsRedirected){w=this.grid.container().css("width");if(w&&!w.endsWith("%")){this.grid.container().css("width",parseInt(w,10)-this.options.rowSelectorColumnWidth)}}cols.remove();footer.remove();header.remove();rsCells.remove()},_allRowSelectorCells:function(){var rowSelectors,grid=this.grid;if(grid.hasFixedColumns()&&this._getColumnFixingInstance().options.fixingDirection==="left"){if(grid.options.virtualization||grid.options.rowVirtualization){rowSelectors=grid.fixedBodyContainer().find("tbody > tr > th."+this.css.rowSelector)}else{rowSelectors=grid.fixedBodyContainer().find("tbody > tr > th."+this.css.rowSelector)}}else{rowSelectors=grid.element.children("tbody").children("tr").children("th."+this.css.rowSelector)}return rowSelectors},_headerRowSelectorCells:function(){var headerCells=this.grid.headersTable().children("thead").find("th[data-role='rs']");if(headerCells.length===0&&this.grid.hasFixedColumns()){headerCells=this.grid.fixedHeadersTable().children("thead").find("th[data-role='rs']")}return headerCells},_footerRowSelectorCells:function(){var footerCells=this.grid.footersTable().children("tfoot").find("td[data-role='rs']");if(footerCells.length===0&&this.grid.hasFixedColumns()){footerCells=this.grid.fixedFootersTable().children("tfoot").find("td[data-role='rs']")}return footerCells},_allCheckboxes:function(){var checkboxes=this.grid.element.children("tbody").children("tr").children("th").find("span[name='chk']");if(checkboxes.length===0&&this.grid.hasFixedColumns()&&this._getColumnFixingInstance().options.fixingDirection==="left"){checkboxes=this.grid.fixedBodyContainer().find("tbody > tr > th span[name='chk']")}return checkboxes},_headerCheckbox:function(){var checkbox=this.grid.headersTable().children("thead").find("tr > th span[name='hchk']");if(checkbox.length===0&&this.grid.hasFixedColumns()&&this._getColumnFixingInstance().options.fixingDirection==="left"){checkbox=this.grid.fixedHeadersTable().children("thead").find("tr > th span[name='hchk']")}return checkbox},_rowSelectorFromSelection:function(info){var element=info.element,rs,checkbox=info.checkbox,fixingDir;if(element.is("th")){return}if(checkbox){rs=checkbox.parent()}else{if(element.is("tr")||element.length===2){rs=element.children("th:first")}else if(this.grid.hasFixedColumns()){fixingDir=this.grid.fixedBodyContainer().attr("data-fixing-direction");if(fixingDir==="left"&&!this.grid._isFixedElement(element)){rs=this.grid.fixedBodyContainer().find("tbody > tr").eq(element.closest("tr").index()).children("th:first")}else if(fixingDir==="right"&&this.grid._isFixedElement(element)){rs=this.grid.element.find("tbody > tr").eq(element.closest("tr").index()).children("th:first")}}if(!rs){rs=element.closest("tr").children("th:first")}checkbox=this.options.enableCheckBoxes?rs.children("span:last"):null}return{rowSelector:rs,checkbox:checkbox}},_columnFixed:function(args){var columnFixingInstance=this._getColumnFixingInstance(),countFixedCols=args.fixedColsCount;if(!columnFixingInstance){return}if(columnFixingInstance.options.fixingDirection==="right"){return}if(!this._renderFixedColgroupHandler){this._renderFixedColgroupHandler=$.proxy(columnFixingInstance._renderFixedColgroup,columnFixingInstance);columnFixingInstance._renderFixedColgroup=$.proxy(this._rsRenderFixedColgroup,this)}if(!this._isColumnFixingFunctionsRedirected){this._renderFixedRecordHandler=$.proxy(columnFixingInstance._renderFixedRecord,columnFixingInstance);this._isColumnFixingFunctionsRedirected=true}if(args.isFixed){if(args.isInit){this._redirectFunctions();if(!this._gridRenderRecordHandler){this._gridRenderRecordHandler=$.proxy(this.grid._renderRecord,this.grid)}this.grid._renderRecord=this._gridRenderRecordHandler;columnFixingInstance._renderFixedRecord=$.proxy(this._rsRenderFixedRecord,this)}}else{if(countFixedCols<=1&&!this.grid.hasFixedDataSkippedColumns()){if(!this._renderRecordHandler){this._renderRecordHandler=$.proxy(this._rsRenderRecord,this)}this.grid._renderRecord=this._renderRecordHandler;columnFixingInstance._renderFixedRecord=this._renderFixedRecordHandler}}},_checkForSelection:function(){var i,isSelection=false;for(i=0;i<this.grid.options.features.length;i++){if(this.grid.options.features[i].name==="Selection"){isSelection=true;if(this.options.enableCheckBoxes===true){this.grid.options.features[i].mode="row"}break}}if(isSelection===false){if(this.options.requireSelection===true){throw new Error($.ig.GridRowSelectors.locale.selectionNotLoaded)}this._skipRefresh=true}},_checkForColumnVirtualization:function(){return this.grid.options.virtualizationMode!=="continuous"&&(this.grid.options.virtualization===true&&this.grid.options.width||this.grid.options.columnVirtualization===true)},_checkForRequireSelectionWithCheckboxes:function(){return this.options.requireSelection===false&&this.options.enableCheckBoxes===true},_createHandlers:function(){this._headerRenderedHandler=$.proxy(this._headerRendered,this);this._footerRenderedHandler=$.proxy(this._footerRendered,this);this._recordsRenderingHandler=$.proxy(this._recordsRendering,this);this._recordsRenderedHandler=$.proxy(this._recordsRendered,this);this._gridRenderedHandler=$.proxy(this._gridRendered,this);this._virtualDomBuiltHandler=$.proxy(this._rsRenderVirtualRecords,this);this._virtualRowsHandler=$.proxy(this._rrn,this);this._renderExtraHeaderCellHandler=$.proxy(this._renderExtraHeaderCells,this);this._renderExtraFooterCellHandler=$.proxy(this._renderExtraFooterCells,this);this._rsClickHandler=$.proxy(this._cellClick,this);this._rrHoverHandler=$.proxy(this._mouseHoverRow,this);this._rrLeaveHandler=$.proxy(this._mouseLeaveRow,this);this._newRowAddedHandler=$.proxy(this._rowAdded,this);if(this.options.enableCheckBoxes===true){this._checkboxMouseOverHandler=$.proxy(this._checkboxMouseOver,this);this._checkboxMouseOutHandler=$.proxy(this._checkboxMouseOut,this);this._checkboxClickHandler=$.proxy(this._checkBoxClicked,this);this._hCheckboxClickHandler=$.proxy(this._headerCheckBoxClicked,this)}},_registerEvents:function(){this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.bind("iggridfooterrendered",this._footerRenderedHandler);this.grid.element.bind("iggrid_rowsrendering",this._recordsRenderingHandler);this.grid.element.bind("iggridrowsrendered",this._recordsRenderedHandler);this.grid.element.bind("iggriddatarendered",this._gridRenderedHandler);this.grid.element.bind("iggridvirtualdombuilt",this._virtualDomBuiltHandler);this.grid.element.bind("iggridvirtualrecordsrender",this._virtualRowsHandler);this.grid.element.bind("iggridappendrowsondemandrowsrequested",this._newRowAddedHandler)},_unregisterEvents:function(){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.unbind("iggridfooterrendered",this._footerRenderedHandler);this.grid.element.unbind("iggrid_rowsrendering",this._recordsRenderingHandler);this.grid.element.unbind("iggridrowsrendered",this._recordsRenderedHandler);this.grid.element.unbind("iggriddatarendered",this._gridRenderedHandler);this.grid.element.unbind("iggridvirtualdombuilt",this._virtualDomBuiltHandler);this.grid.element.unbind("iggridvirtualrecordsrender",this._virtualRowsHandler);this.grid.element.unbind("iggridappendrowsondemandrowsrequested",this._newRowAddedHandler)},_injectGrid:function(gridInstance,isRebind){if(isRebind===true){this._cleanInterface(true);return}var self=this;this.grid=gridInstance;this._v=this.grid.options.virtualization===true||this.grid.options.rowVirtualization===true;this._flatRenderColgroup=this.grid._renderColgroup;this._createHandlers();this.grid._headerInitCallbacks.push({type:"RowSelectors",func:this._renderExtraHeaderCellHandler});this.grid._footerInitCallbacks.push({type:"RowSelectors",func:this._renderExtraFooterCellHandler});this._registerEvents();this.grid._renderColgroup=function(){if(self._flatRenderColgroup!==undefined){self._rsRenderColgroup.apply(self.grid,$.merge([self._flatRenderColgroup,self],arguments))}};this._checkForSelection();if(this._checkForColumnVirtualization()){throw new Error($.ig.GridRowSelectors.locale.columnVirtualizationEnabled)}if(this._checkForRequireSelectionWithCheckboxes()){throw new Error($.ig.GridRowSelectors.locale.requireSelectionWithCheckboxes)}if(String(this.grid.options.templatingEngine).toLowerCase()==="jsrender"){this._jsr=true;if(this.options.selectAllForPagingTemplate&&typeof this.options.selectAllForPagingTemplate==="string"){$.templates(this.grid.id()+"_selectAllForPagingTemplate",this.options.selectAllForPagingTemplate)}if(this.options.deselectAllForPagingTemplate&&typeof this.options.deselectAllForPagingTemplate==="string"){$.templates(this.grid.id()+"_deselectAllForPagingTemplate",this.options.deselectAllForPagingTemplate)}}},_getDataView:function(){return this.grid.dataSource.dataView()},_getAllData:function(){return this.grid.dataSource.data()}});$.extend($.ui.igGridRowSelectors,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Selection (and Keyboard navigation) 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	modernizr.js (Optional)
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){"use strict";$.widget("ui.igGridSelection",{css:{selectedCell:"ui-iggrid-selectedcell ui-state-active",selectedRow:"ui-iggrid-selectedrow ui-state-active",activeCell:"ui-iggrid-activecell ui-state-focus",activeRow:"ui-iggrid-activerow ui-state-focus"},options:{multipleSelection:false,mouseDragSelect:true,mode:"row",activation:true,wrapAround:true,skipChildren:true,multipleCellSelectOnClick:false,touchDragSelect:true,persist:true,allowMultipleRangeSelection:true},events:{rowSelectionChanging:"rowSelectionChanging",rowSelectionChanged:"rowSelectionChanged",cellSelectionChanging:"cellSelectionChanging",cellSelectionChanged:"cellSelectionChanged",activeCellChanging:"activeCellChanging",activeCellChanged:"activeCellChanged",activeRowChanging:"activeRowChanging",activeRowChanged:"activeRowChanged"},_create:function(){this._isMouseDown=false;this._pkProp=null;this._rsCellKey="##ROWSEL##";this._gbExpandCellKey="##GBXCEL##";this._gbSummaryCellKey="##GBSCEL##";this._gbEmptyCellKey="##GBECEL##";this._hgCellKey="##HIEGRD##";this._tgExpandKey="##TGXCEL##";this.element.attr("aria-multiselectable",this.options.multipleSelection)},destroy:function(){this.grid.element.unbind({iggriddatarendering:this._dataRenderingHandler,iggridvirtualrendering:this._virtualRecordsRenderingHandler,igtreegridvirtualrendering:this._virtualRecordsRenderingHandler,iggridvirtualrecordsrender:this._virtualRecordsRendererHandler,igtreegridvirtualrecordsrender:this._virtualRecordsRendererHandler,iggridcolumnscollectionmodified:this._columnsCollectionModifiedHandler});this.clearSelection();this._unregisterEvents();this._selection.removeSubscriber(this._subId,this.grid.id());$.Widget.prototype.destroy.call(this);return this},_setOption:function(key){$.Widget.prototype._setOption.apply(this,arguments);if(key==="mode"){throw new Error($.ig.Grid.locale.optionChangeNotSupported.replace("{optionName}",key))}},_dataRendering:function(event,ui){var tbody;if(ui.owner.id()!==this.grid.id()){return}tbody=this.grid.element.find("tbody").add(this.grid.fixedBodyContainer().find("tbody"));if(this._tbodyBinding){tbody.unbind(this._tbodyBinding)}this._pkProp=this.grid.options.primaryKey;if(this.options.persist&&!this.grid.options.primaryKey){this._createUidForData();this._pkProp="ig_pk"}},_dataRendered:function(){this._unregisterEvents();this._registerEvents();if(this._hc===undefined){this._hc=this.grid.container().closest(".ui-iggrid-root").length>0;if(this._hc===false){this._hc=this.grid.element.hasClass("ui-iggrid-root")}}this.grid._startRowIndex=this.grid._startRowIndex||0;this._defaultAttributes();if(this.options.persist){this._paintActive();this._renderAttributes();this._selection.invalid=true}else{this.clearSelection()}},_columnFixed:function(args){if(args.isFixed){if(args.isInit){this._unregisterEvents();this._registerEvents();this._selection.invalid=true}}},_virtualRecordsRendering:function(){this._storedActiveElement=this.activeCell()||this.activeRow()},_virtualRecordsRender:function(evt,ui){var ae;if(ui.owner.id()!==this.grid.id()){return}this._selection.invalid=true;$(document).unbind("keydown."+this.grid.id());if(this.grid.options.virtualization===true&&this.grid.options.virtualizationMode==="continuous"){this._unregisterEvents();this._registerEvents()}this._paintActive();this._renderAttributes();if(this.options.mode==="cell"){ae=this.activeCell()}else{ae=this.activeRow()}if(ae&&ae.element instanceof jQuery){ae.element.focus()}else if(this._storedActiveElement){if(this.options.mode==="cell"){this._getCellByIdentifier(this._storedActiveElement).focus()}else{this._getRowsByIdentifier(this._storedActiveElement.id).focus()}}},_columnsCollectionModified:function(evt,ui){if(ui.owner.id()===this.grid.id()){this._unregisterEvents();this._registerEvents();this._selection.invalid=true;this._paintActive()}},_hidingFinished:function(){if(this.options.persist){this._paintActive();this._selection.invalid=true}},_rowDeleted:function(rowId){var cellsForRow,colKey,cellId;this._selection.invalid=true;if(this.options.mode==="cell"){if(this._selection.settings.owner===this.grid){if(this._selection.activeElement&&this._selection.activeElement.id===rowId){this._selection.deactivate()}cellsForRow=this._selection.selection[rowId];for(colKey in cellsForRow){if(cellsForRow.hasOwnProperty(colKey)){cellId={id:rowId,columnKey:colKey};this._selection.deselect(cellId,null,false)}}}}else{if(this._selection.isActive(rowId,this.grid)){this._selection.deactivate()}if(this._selection.isSelected(rowId,this.grid)){this._selection.deselect(rowId,null,false)}}},_mouseDown:function(event){var target,targetGrid,re=new RegExp("^"+this.grid.id()+"(_fixed)?$");if(event&&this._suspend){return}if(event&&event.which!==1){return}target=event&&event.target?$(event.target):null;this._mouseDownTarget=target;this._prevDragTar=target[0];this._previousRangeCache=event.ctrlKey?[]:null;if(this.options.allowMultipleRangeSelection&&this.options.mode==="cell"){this._selection._lockSelection()}targetGrid=target?target.closest(".ui-iggrid-table"):null;if(target&&target.hasClass("ui-iggrid-scrolldiv")){return}if(targetGrid&&targetGrid.length>0&&!targetGrid.attr("id").match(re)){return}this._isMouseDown=true;if(this.options.mouseDragSelect===false||this.options.multipleSelection===false||this.options.mode==="row"){return}this._firstDragCell=target},_mouseMove:function(event){var target=event&&event.target?$(event.target):null,fdc=this._firstDragCell,re;if(event&&this._suspend){return}if(this.options.mode!=="cell"||!this.options.mouseDragSelect||!this._isMouseDown){return}target=target.closest("td,th");if(fdc&&fdc.length>0){re=new RegExp("^"+this.grid.id()+"(_fixed)?$");if(target[0]!==this._prevDragTar&&target.closest(".ui-iggrid-table").attr("id").match(re)&&fdc.closest(".ui-iggrid-table").attr("id").match(re)&&!(target.is("th")||target.attr("data-skip"))){this._selection.rangeSelectStart=this._identifierForTarget(fdc);this._dragSelect=true;this._prevDragTar=target[0];this._shiftSelectChange(target,false);this._storedActiveIndex=target.closest("td").index()}}},_mouseUp:function(event){var target=event&&event.target?$(event.target):null,targetGrid=target?target.closest(".ui-iggrid-table"):null,re=new RegExp("^"+this.grid.id()+"(_fixed)?$"),shouldCancel,self=this;if(targetGrid&&targetGrid.length>0&&!targetGrid.attr("id").match(re)){return}this._isMouseDown=false;if(!target||this._dragSelect||!this._mouseDownTarget||this._mouseDownTarget[0]!==target[0]){this._dragSelect=false;this._prevDragTar=null;this._firstDragCell=null;this._mouseDownTarget=null;return}if(target.closest(".ui-iggrid-rowselector-class").length===1||target.hasClass("ui-iggrid-childarea")||target.parent().hasClass("ui-iggrid-childarea")||target.hasClass("ui-widget-header")){return}if(this._hc){target.parents("tr[data-container]").each(function(){if($(this).closest(".ui-iggrid-table").attr("id")===self.grid.element.attr("id")){shouldCancel=true;return false}});if(shouldCancel){return}}if(event.shiftKey&&this.options.multipleSelection){this._shiftSelectChange(target,true)}else{this._singleSelectChange(target,event.ctrlKey)}},_touchStart:function(event){event.target=$(document.elementFromPoint(event.originalEvent.touches[0].clientX,event.originalEvent.touches[0].clientY));event.which=1;if(event.target.hasClass("ui-iggrid-selectedcell")){this._canDrag=true}else{this._canDrag=false}this._mouseDown(event)},_touchEnd:function(event){event.target=$(document.elementFromPoint(event.originalEvent.changedTouches[0].clientX,event.originalEvent.changedTouches[0].clientY));this._canDrag=false;this._mouseUp(event)},_touchMove:function(event){if(!this._isMouseDown||!this._canDrag){return true}event.preventDefault();event.target=$(document.elementFromPoint(event.originalEvent.touches[0].clientX,event.originalEvent.touches[0].clientY));this._mouseMove(event)},_pointerDown:function(event){this.grid.element.css("-ms-touch-action","none");this._mouseDown(event)},_pointerMove:function(event){this._mouseMove(event)},_pointerUp:function(event){this.grid.element.css("-ms-touch-action","auto");this._mouseUp(event)},_keyDown:function(event){var target,targetGrid,re=new RegExp("^"+this.grid.id()+"(_fixed)?$"),el;if(event&&this._suspend){return}if(this.grid!==this._selection.settings.owner){return}if(this._isMouseDown===true){return}if(this.options.activation!==true){return}if(event.keyCode!==$.ui.keyCode.ENTER&&event.keyCode!==$.ui.keyCode.SPACE&&event.keyCode!==$.ui.keyCode.UP&&event.keyCode!==$.ui.keyCode.DOWN&&event.keyCode!==$.ui.keyCode.LEFT&&event.keyCode!==$.ui.keyCode.RIGHT){return}target=event&&event.target?$(event.target):null;targetGrid=target?target.closest(".ui-iggrid-table"):null;if(targetGrid&&targetGrid.length>0&&!targetGrid.attr("id").match(re)){return}if(this._selection.activeElement===null||this._selection.activeElement===undefined){if(this.options.mode==="cell"){el=target.children("td:not([data-skip='true']):first");if(!el.length){return}this._singleSelectChange(el,false,false)}else{el=target.closest("tr");if(!el.length){return}this._selection.activate(this._identifierForRow(el),el);this._selection.toggle()}if(event.keyCode===$.ui.keyCode.SPACE){event.preventDefault()}return}event.preventDefault();if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){if(this._suppressKey(event.keyCode)){return}if(!this._isDataElement(this._selection.activeElement)){this._handleToggle(event.ctrlKey)}else{this._selection.toggle()}return}this._navigate(event.keyCode,event.ctrlKey,event.shiftKey)},_selectStart:function(event){var re=new RegExp("^"+this.grid.id()+"(_fixed)?$"),target=event.target?$(event.target):null,targetGrid=target?target.closest(".ui-iggrid-table"):$();if(targetGrid.length>0&&!targetGrid.attr("id").match(re)){return}if(event&&this._suspend){return}if(this.options.mouseDragSelect===false||this.options.multipleSelection===false){return false}event.stopPropagation();event.preventDefault()},_selectStartContainer:function(event){if(event.target&&$(event.target).hasClass("ui-iggrid-fixedcontainer")){event.preventDefault()}},_tbodyFocusIn:function(event){var target=event&&event.target?$(event.target):null,targetGrid=target?target.closest(".ui-iggrid-table"):null,re=new RegExp("^"+this.grid.id()+"(_fixed)?$");if(targetGrid&&targetGrid.length>0&&!targetGrid.attr("id").match(re)){return}if(this.options.mode==="row"){if(target.is("tr")){this._selection.activate(this._identifierForRow(target),target)}}else{if(target.is("td")){this._selection.activate(this._identifierForTarget(target),target);if(!target.attr("data-gbsummary")){this._storedActiveIndex=target.index()}}}},_tbodyFocusOut:function(event){var target=event&&event.target?$(event.target):null,targetGrid=target?target.closest(".ui-iggrid-table"):null,re=new RegExp("^"+this.grid.id()+"(_fixed)?$"),id;if(targetGrid&&targetGrid.length>0&&!targetGrid.attr("id").match(re)){return}if(this.options.mode==="row"){if(target.is("tr")){id=this._identifierForRow(target);if(this._selection.isActive(id)){this._selection.deactivate()}}}else{if(target.is("td")){id=this._identifierForTarget(target);if(this._selection.isActive(id)){this._selection.deactivate()}}}},_preventDefault:function(event){if($(event.target).is("td")){event.preventDefault()}},_releaseMouse:function(){this._dragSelect=false;this._firstDragCell=null;this._isMouseDown=false},_applyCellStyle:function(data,col){var identifier={id:data[this._pkProp],columnKey:col};return this._selection.isSelected(identifier,this.grid)?this.css.selectedCell:""},_applyRowStyle:function(data){return this._selection.isSelected(data[this._pkProp],this.grid)?this.css.selectedCell:""},_paintActive:function(){if(this._selection.activeElement&&this._selection.settings.owner===this.grid){if(this.options.mode==="row"){this._getRowsByIdentifier(this._selection.activeElement).addClass(this.css.activeRow)}else{this._getCellByIdentifier(this._selection.activeElement).addClass(this.css.activeCell)}}},_renderAttributes:function(){if(this._selection.selectionLength()){if(this.options.mode==="row"){this.grid.element.children("tbody").find("td.ui-iggrid-selectedcell").closest("tr").attr("aria-selected",true);this.grid.fixedBodyContainer().find("tbody").find("td.ui-iggrid-selectedcell").closest("tr").attr("aria-selected",true)}else{this.grid.element.children("tbody").find("td.ui-iggrid-selectedcell").attr("aria-selected",true);this.grid.fixedBodyContainer().find("tbody").find("td.ui-iggrid-selectedcell").attr("aria-selected",true)}}else{if(this.options.mode==="row"){this.grid.element.children("tbody").find("td:not('.ui-iggrid-selectedcell')").closest("tr").attr("aria-selected",false);this.grid.fixedBodyContainer().find("tbody").find("td:not('.ui-iggrid-selectedcell')").closest("tr").attr("aria-selected",false)}else{this.grid.element.children("tbody").find("td:not('.ui-iggrid-selectedcell')").attr("aria-selected",false);this.grid.fixedBodyContainer().find("tbody").find("td:not('.ui-iggrid-selectedcell')").attr("aria-selected",false)}}},_defaultAttributes:function(){if(this.options.mode==="row"){this.grid.element.children("tbody").children("tr").attr("aria-selected",false);this.grid.fixedBodyContainer().find("tbody").children("tr").attr("aria-selected",false)}else{this.grid.element.children("tbody").find("td").attr("aria-selected",false);this.grid.fixedBodyContainer().find("tbody").find("td").attr("aria-selected",false)}},clearSelection:function(){this._selection.cleanAll(this.grid)},selectCell:function(row,col,isFixed){var rowElement,cellId,cellElement,record;if(this.options.mode==="row"){return}if(this._isOutOfView(row,col)){record=this._getDataView()[row];if(!record){return}if(this.grid._visibleColumns().length<col||col<0){return}cellId={id:this._pkProp?row[this._pkProp]:row,columnKey:this.grid._visibleColumns()[col].key};cellElement=$()}else{row-=this.grid._startRowIndex||0;col-=this.grid._startColIndex||0;rowElement=this._getRowByIndex(row,isFixed);cellId=this._identifierForCell(this._getCellByIndex(col,rowElement));cellElement=this._getCellByIdentifier(cellId)}if(this._selection.settings.owner!==this.grid){this._selection.changeOwner(this.grid)}if(this.options.activation){this._selection.activate(cellId,cellElement)}if(!this._selection.isSelected(cellId,this.grid)){this._selection.select(cellId,true,{element:cellElement},true)}},selectCellById:function(id,colKey){var identifier={id:id,columnKey:colKey};if(this.options.mode==="row"){return}if(!this._selection.isSelected(identifier,this.grid)){if(this._selection.settings.owner!==this.grid){this._selection.changeOwner(this.grid)}this._selection.select(identifier,true,{element:this._getCellByIdentifier(identifier)},true)}},deselectCell:function(row,col,isFixed){var rowElement=this._getRowByIndex(row,isFixed),cellId=this._identifierForCell(this._getCellByIndex(col,rowElement)),cellElement=this._getCellByIdentifier(cellId);if(this.options.mode==="row"){return}if(this._selection.isSelected(cellId,this.grid)){this._selection.deselect(cellId,{element:cellElement},true)}},deselectCellById:function(id,colKey){var identifier={id:id,columnKey:colKey};if(this.options.mode==="row"){return}if(this._selection.isSelected(identifier,this.grid)){this._selection.deselect(identifier,{element:this._getCellByIdentifier(identifier)},true)}},selectRow:function(index){var row,rowId;if(this.options.mode==="cell"){return}if(this._isOutOfView(index)){row=this._getDataView()[index];if(!row){return}rowId=this._pkProp?row[this._pkProp]:index;row=$()}else{index-=this.grid._startRowIndex||0;row=this._getRowByIndex(index,false).add(this._getRowByIndex(index,true));rowId=this._identifierForRow(row.eq(0))}if(this._selection.settings.owner!==this.grid){this._selection.changeOwner(this.grid)}if(this.options.activation){this._selection.activate(rowId,row)}if(!this._selection.isSelected(rowId,this.grid)){this._selection.select(rowId,true,{element:row},true)}},selectRowById:function(id){if(this.options.mode==="cell"){return}if(!this._selection.isSelected(id,this.grid)){if(this._selection.settings.owner!==this.grid){this._selection.changeOwner(this.grid)}this._selection.select(id,true,{element:this._getRowsByIdentifier(id)},true)}},deselectRow:function(index){var row=this._getRowByIndex(index,false).add(this._getRowByIndex(index,true)),rowId=this._identifierForRow(row.eq(0));if(this.options.mode==="cell"){return}if(this._selection.isSelected(rowId,this.grid)){this._selection.deselect(rowId,{element:row},true)}},deselectRowById:function(id){if(this.options.mode==="cell"){return}if(this._selection.isSelected(id,this.grid)){this._selection.deselect(id,{element:this._getRowsByIdentifier(id)},true)}},selectedCells:function(){if(this._selection.settings.owner!==this.grid){return[]}return this.options.multipleSelection?this._selection.selectedCells():null},selectedRows:function(){if(this._selection.settings.owner!==this.grid){return[]}return this.options.multipleSelection?this._selection.selectedRows():null},selectedCell:function(){var selectedCells;if(this._selection.settings.owner!==this.grid){return null}selectedCells=this._selection.selectedCells();return this.options.multipleSelection?null:selectedCells.length===1?selectedCells[0]:null},selectedRow:function(){var selectedRows;if(this._selection.settings.owner!==this.grid){return null}selectedRows=this._selection.selectedRows();return this.options.multipleSelection?null:selectedRows.length===1?selectedRows[0]:null},activeCell:function(){if(this.options.mode==="row"){return null}if(this._selection.settings.owner!==this.grid){return null}return this._selection.activeCell()},activeRow:function(){if(this.options.mode==="cell"){return null}if(this._selection.settings.owner!==this.grid){return null}return this._selection.activeRow()},_singleSelectChange:function(target,ctrlKey){var tId,tIdx,oldT=target;if(this.options.mode==="row"){target=target.closest("tr");target.addClass("initially-focused");if(this.grid.hasFixedColumns()){tIdx=target.index();target=target.add(this._getRowByIndex(tIdx,!this.grid._isFixedElement(target)))}}else{target=target.closest("td")}if(this._selection.settings.owner!==this.grid){this._selection.changeOwner(this.grid)}tId=this._identifierForTarget(target);if(this.options.activation&&(oldT.is("tr")||oldT.is("td"))){this._selection.activate(tId,target)}if(this._canBeSelected(tId)){this._selection.select(tId,ctrlKey,{element:target})}},_shiftSelectChange:function(target){var tId,rangeStats,keep=this.options.mode==="cell"&&this.options.allowMultipleRangeSelection,v=this.grid.options.virtualization||this.grid.options.rowVirtualization||this.grid.options.columnVirtualization;target=this.options.mode==="row"?target.closest("tr"):target.closest("td");if(this._selection.settings.owner!==this.grid){this._selection.changeOwner(this.grid)}tId=this._identifierForTarget(target);if(!this._canBeSelected(tId)){return}if(this._selection.rangeSelectStart===null||this._selection.rangeSelectStart===undefined){this._selection.rangeSelectStart=tId}if(v){rangeStats=this._getRecordRange(this._selection.rangeSelectStart,tId)}else{rangeStats=this._getElementRange(this._selection.rangeSelectStart,tId)}if(keep){this._selection.rangeSelect(rangeStats.range,false,this._previousRangeCache,rangeStats,false);this._previousRangeCache=rangeStats.range}else{this._selection.rangeSelect(rangeStats.range,false,null,rangeStats,false)}},_navigate:function(code,ctrlKey,shiftKey,prevElementOverride){var prevActiveElement=prevElementOverride||this._selection.activeElement,nextActiveElementParent,childSelection,nextActiveElement=this._getNextActiveElement(code,!shiftKey&&this.options.wrapAround,prevActiveElement);if(!nextActiveElement||nextActiveElement.length===0){return}nextActiveElementParent=nextActiveElement.closest(".ui-iggrid-table");if(nextActiveElementParent.attr("id")!==this.grid.id()&&nextActiveElement.closest(".ui-iggrid").attr("id")!==this.grid.container().attr("id")){childSelection=nextActiveElementParent.data("igGridSelection");this._selection.changeOwner(childSelection.grid);nextActiveElementParent.closest(".ui-iggrid").focus();childSelection._storedActiveIndex=null;childSelection._navigateOwn(nextActiveElement,prevActiveElement,code,ctrlKey,shiftKey)}else{this._navigateOwn(nextActiveElement,prevActiveElement,code,ctrlKey,shiftKey)}},_navigateOwn:function(nextActiveElement,prevActiveElement,code,ctrlKey,shiftKey){var nextId=this._identifierForTarget(nextActiveElement);if(nextActiveElement.is("tr")&&this.grid.hasFixedColumns()){nextActiveElement.addClass("initially-focused");nextActiveElement=nextActiveElement.add(this._getRowByIndex(nextActiveElement.index(),!this.grid._isFixedElement(nextActiveElement)))}if(!nextActiveElement.is("tr")&&nextId.columnKey.startsWith("##")&&shiftKey){this._navigate(code,ctrlKey,shiftKey,nextId);return}this._selection.activate(nextId,nextActiveElement);if(ctrlKey){this._setScroll(code,nextActiveElement);return}if(shiftKey){if(this.options.mode==="row"||!this.options.multipleSelection){if(this._selection.isSelected(this._selection.activeElement,this.grid)){this._selection.deselect(prevActiveElement)}else{this._selection.toggle(nextActiveElement)}}else{this._shiftSelectChange(nextActiveElement,false)}}else{if(nextId.columnKey&&nextId.columnKey.startsWith("##")){if(this._selection.isSelected(prevActiveElement)){this._selection.clearSelection()}}else{this._selection.select(nextId,false,{element:nextActiveElement})}}this._setScroll(code,nextActiveElement)},_handleToggle:function(ctrlKey){var element=this._selection.elementFromIdentifier(this._selection.activeElement),row,cell;if(element.is("th")){row=this._getRowsByIdentifier(this._selection.activeElement.id);if(this.grid.hasFixedColumns()&&this.grid._isFixedElement(element)){cell=this._firstDataCellForRow(row.first())}else{cell=this._firstDataCellForRow(row.last())}this._singleSelectChange(cell,ctrlKey)}else if(element.attr("data-parent")){element.closest(".ui-iggrid-root").igHierarchicalGrid("toggle",element.closest("tr"))}else if(element.hasClass("ui-igtreegrid-expansion-indicator-cell")&&element.attr("data-expand-cell")){element.closest(".ui-iggrid-table").igTreeGrid("toggleRow",element.closest("tr"))}},_getNextActiveElement:function(code,wrapAround,override){var currentActiveElement=override instanceof jQuery?override:this._selection.elementFromIdentifier(override||this._selection.activeElement),currentRow=currentActiveElement.closest("tr"),currentCellIndex=currentActiveElement.index(),hasFixedCols=this.grid.hasFixedColumns(),isFixedElement=hasFixedCols?this.grid._isFixedElement(currentActiveElement):false,fixingDir=this.grid.fixingDirection(),nextElement,nextElementIndex,nextRow,wrapped,go=this.grid.options,vVirt=go.virtualization||go.rowVirtualization;if(code===$.ui.keyCode.UP){nextRow=this._getPrevRow(currentRow,wrapAround,isFixedElement,false,vVirt);if(this.options.mode==="row"||!nextRow){return nextRow}nextElementIndex=currentCellIndex>=nextRow.children().length?nextRow.children().length-1:this._storedActiveIndex||currentCellIndex;nextElement=nextRow.children().eq(nextElementIndex)}else if(code===$.ui.keyCode.DOWN){nextRow=this._getNextRow(currentRow,wrapAround,isFixedElement,false,vVirt);if(this.options.mode==="row"||!nextRow){return nextRow}nextElementIndex=currentCellIndex>=nextRow.children().length?nextRow.children().length-1:this._storedActiveIndex||currentCellIndex;nextElement=nextRow.children().eq(nextElementIndex)}else if(code===$.ui.keyCode.LEFT&&this.options.mode==="cell"){if(currentActiveElement.is(":first-child")){if(hasFixedCols&&!isFixedElement&&fixingDir==="left"){nextRow=this._getRowByIndex(currentRow.index(),true)}else if(hasFixedCols&&isFixedElement&&fixingDir==="right"){nextRow=this._getRowByIndex(currentRow.index(),false)}else{nextRow=this._getPrevRow(currentRow,wrapAround,isFixedElement,hasFixedCols,vVirt)}wrapped=true}else{nextRow=currentRow}if(!nextRow){return null}nextElementIndex=wrapped?nextRow.children().length-1:currentCellIndex-1;nextElement=nextRow.children().eq(nextElementIndex);this._revertH=wrapped}else if(code===$.ui.keyCode.RIGHT&&this.options.mode==="cell"){if(currentActiveElement.is(":last-child")){if(hasFixedCols&&isFixedElement&&fixingDir==="left"){nextRow=this._getRowByIndex(currentRow.index(),false)}else if(hasFixedCols&&!isFixedElement&&fixingDir==="right"){nextRow=this._getRowByIndex(currentRow.index(),true)}else{nextRow=this._getNextRow(currentRow,wrapAround,isFixedElement,hasFixedCols,vVirt)}wrapped=true}else{nextRow=currentRow}if(!nextRow){return null}nextElementIndex=wrapped?0:currentCellIndex+1;nextElement=nextRow.children().eq(nextElementIndex);this._revertH=wrapped}if(nextElement&&!nextElement.attr("data-gbsummary")){this._storedActiveIndex=nextElementIndex}return nextElement},_getNextRow:function(currentRow,wrapAround,isFixed,swap,virt){var hierRowSkip=this.options.skipChildren?"[data-container=true]":"",nextRow,cIdx;if(virt){cIdx=currentRow.index();if(cIdx>=this.grid._virtualRowCount-1){this._scrollVmanual(true);return null}}if(currentRow.first().parent().children((hierRowSkip.length>0?":not("+hierRowSkip+")":"")+":visible:last")[0]===currentRow[0]){if(wrapAround){nextRow=this._firstRow(null,swap?!isFixed:isFixed,hierRowSkip)}else{return}this._revertV=true}else{if(swap){nextRow=this._getRowByIndex(currentRow.index()+1,!isFixed)}else{nextRow=currentRow.nextAll("tr"+(hierRowSkip.length>0?":not("+hierRowSkip+")":"")+":visible").first()}this._revertV=false}if(nextRow.attr("data-container")){nextRow=this._firstRow(nextRow,swap?!isFixed:isFixed,hierRowSkip)}return nextRow},_getPrevRow:function(currentRow,wrapAround,isFixed,swap,virt){var hierRowSkip=this.options.skipChildren?"[data-container=true]":"",nextRow,cIdx;if(virt){cIdx=currentRow.index();if(cIdx<=0){this._scrollVmanual(false);return null}}if(currentRow.is(":first-child")){if(wrapAround){nextRow=this._lastRow(null,swap?!isFixed:isFixed,hierRowSkip)}else{return}this._revertV=true}else{if(swap){nextRow=this._getRowByIndex(currentRow.index()-1,!isFixed)}else{nextRow=currentRow.prevAll("tr"+(hierRowSkip.length>0?":not("+hierRowSkip+")":"")+":visible").first()}this._revertV=false}if(nextRow.attr("data-container")){nextRow=this._lastRow(nextRow,swap?!isFixed:isFixed,hierRowSkip)}return nextRow},_lastRow:function(container,fixed,rowSkip){var body;if(container){body=container.find("tbody")}else if(fixed){body=this.grid.fixedBodyContainer().find("tbody")}else{body=this.grid.element.children("tbody")}return body.children("tr"+(rowSkip.length>0?":not("+rowSkip+")":"")+":visible").last()},_firstRow:function(container,fixed,rowSkip){var body;if(container){body=container.find("tbody")}else if(fixed){body=this.grid.fixedBodyContainer().find("tbody")}else{body=this.grid.element.children("tbody")}return body.children("tr"+(rowSkip.length>0?":not("+rowSkip+")":"")).first()},_createUidForData:function(){var i=0,ds=this.grid.dataSource?this.grid.dataSource._data:[];for(i=0;i<ds.length;i++){if(!ds[i].ig_pk){ds[i].ig_pk=$.ig.util.getCheckSumForObject(ds[i])}}},_initSelectionCollection:function(){var rootGrid,opts;rootGrid=this.grid.element.closest(".ui-iggrid-root");if(rootGrid.length>0){rootGrid=rootGrid.data("igGrid")}else{rootGrid=this.grid}opts={multipleSelection:this.options.multipleSelection,byIndex:this._pkProp===null,owner:this.grid};if(this.options.mode==="row"){rootGrid._selectionCollection=rootGrid._selectionCollection||new $.ig.SelectedRowsCollection(opts)}else{rootGrid._selectionCollection=rootGrid._selectionCollection||new $.ig.SelectedCellsCollection(opts)}this._selection=rootGrid._selectionCollection;this.grid._selection=this._selection;if(!this._subId){this._subId=this._selection.addSubscriber(this,this.grid.id())}},_setScroll:function(code,nextActiveElement){var scrollHDir;var scrollVDir=this._revertV?code===$.ui.keyCode.DOWN||code===$.ui.keyCode.RIGHT?"up":"down":code===$.ui.keyCode.DOWN||code===$.ui.keyCode.RIGHT?"down":"up";this._setScrollTop(this.grid.element.parent(),nextActiveElement.closest("tr"),scrollVDir,nextActiveElement.closest("tr").index());if(this.options.mode==="cell"&&(code===$.ui.keyCode.LEFT||code===$.ui.keyCode.RIGHT)){scrollHDir=this._revertH?code===$.ui.keyCode.LEFT?"right":"left":code===$.ui.keyCode.LEFT?"left":"right";this._setScrollLeft(this.grid._hscrollbarcontent(),nextActiveElement,scrollHDir,nextActiveElement.index())}},_setScrollTop:function(parent,child,direction,index){var parentOffset=parent.offset(),childOffset=child.offset(),childh,isDown,isUp,v,c;if(!child||child.length===0){return}v=this.grid.options.virtualization||this.grid.options.rowVirtualization;c=v&&this.grid.options.virtualizationMode==="continuous";childh=v&&!c?parseInt(this.grid.options.avgRowHeight,10):child.outerHeight();if(!v||c){isDown=childOffset.top+childh+this.grid._scrollbarWidth()>parentOffset.top+$(parent).outerHeight();isUp=childOffset.top-childh/2<=parentOffset.top||c&&index<0}if(index===0&&(!v||c)){parent[0].scrollTop=0}else if(direction==="down"){if(isDown){if(c){this.grid._onVirtualVerticalScroll({},childh,direction)}}}else{if(isUp){if(c){this.grid._onVirtualVerticalScroll({},childh,direction)}}}},_setScrollLeft:function(parent,child,direction,index){var parentOffset=parent.offset(),sc,childOffset=child.offset(),fullLeft;if(!child||!child.length||!parent.length){return}sc=this.grid.scrollContainer();fullLeft=childOffset.left+(sc.length>0?sc.scrollLeft():0);if(index===0){parent[0].scrollLeft=0;this.grid._synchronizeHScroll()}else if(direction==="right"){if(fullLeft+child.outerWidth()>parentOffset.left+parent.outerWidth()){parent[0].scrollLeft=parent[0].scrollLeft+fullLeft-(parentOffset.left+parent.outerWidth())+child.outerWidth();this.grid._synchronizeHScroll()}}else{if(childOffset.left<parentOffset.left){parent[0].scrollLeft=parent[0].scrollLeft-child.outerWidth();this.grid._synchronizeHScroll()}}},_scrollVmanual:function(down){var sc=$("#"+this.grid.element[0].id+"_scrollContainer"),h=parseInt(this.grid.options.avgRowHeight,10);this.grid._ignoreScroll=true;if(down){sc.scrollTop(sc.scrollTop()+h)}else{sc.scrollTop(sc.scrollTop()-h)}this.grid._onVirtualVerticalScroll();this.grid._ignoreScroll=false},_getRecordRange:function(start,end,data){var startRecord,endRecord,startRecordIndex,endRecordIndex,startPropIndex,endPropIndex,range=[],recordRange,propRange,i,j,dv=data?data:this._getDataView(),srId,erId,vcols=this.grid._visibleColumns();if(this.options.mode==="row"){srId=start;erId=end}else{srId=start.id;erId=end.id}if(this._pkProp){for(i=0;i<dv.length;i++){if(dv[i][this._pkProp]===srId){startRecord=dv[i];startRecordIndex=i}if(dv[i][this._pkProp]===erId){endRecord=dv[i];endRecordIndex=i}if(startRecord&&endRecord){break}}}else{startRecord=srId>=0&&srId<dv.length?dv[srId]:null;startRecordIndex=srId;endRecord=erId>=0&&erId<dv.length?dv[erId]:null;endRecordIndex=erId}if(!startRecord||!endRecord){return}if(startRecordIndex>endRecordIndex){recordRange=dv.slice(endRecordIndex,startRecordIndex+1)}else{recordRange=dv.slice(startRecordIndex,endRecordIndex+1)}startRecordIndex=Math.min(startRecordIndex,endRecordIndex);if(this.options.mode==="row"){if(!this._pkProp){for(i=0;i<recordRange.length;i++){range.push({id:i+startRecordIndex})}}else{for(i=0;i<recordRange.length;i++){range.push({id:recordRange[i][this._pkProp]})}}return{startIndex:startRecordIndex,endIndex:endRecordIndex,active:end,element:this._getRowsByIdentifier(end),range:range}}for(i=0;i<vcols.length;i++){if(vcols[i].key===start.columnKey){startPropIndex=i}if(vcols[i].key===end.columnKey){endPropIndex=i}if(startPropIndex!==undefined&&endPropIndex!==undefined){break}}if(startPropIndex===undefined||endPropIndex===undefined){return}if(startPropIndex>endPropIndex){propRange=vcols.slice(endPropIndex,startPropIndex+1)}else{propRange=vcols.slice(startPropIndex,endPropIndex+1)}if(!this._pkProp){for(i=0;i<recordRange.length;i++){for(j=0;j<propRange.length;j++){range.push({id:{id:i+startRecordIndex,columnKey:propRange[j].key}})
}}}else{for(i=0;i<recordRange.length;i++){for(j=0;j<propRange.length;j++){range.push({id:{id:recordRange[i][this._pkProp],columnKey:propRange[j].key}})}}}return{firstRowIndex:startRecordIndex,lastRowIndex:endRecordIndex,firstColumnIndex:startPropIndex,lastColumnIndex:endPropIndex,active:end,element:this._getCellByIdentifier(end),range:range}},_getElementRange:function(start,end){var startElement,endElement,startRowIndex,endRowIndex,range=[],i,reverse,rowRange,fixedRowRange,cellRange,rowIndex,isStartFixed,isEndFixed;startElement=this._selection.elementFromIdentifier(start);endElement=this._selection.elementFromIdentifier(end);startRowIndex=this._getIndexForRow(startElement.closest("tr"));endRowIndex=this._getIndexForRow(endElement.closest("tr"));reverse=startRowIndex>endRowIndex;if(reverse){startRowIndex=startRowIndex+endRowIndex;endRowIndex=startRowIndex-endRowIndex;startRowIndex=startRowIndex-endRowIndex}rowRange=this.grid.element.find("tbody").children("tr:not([data-container]):visible").slice(startRowIndex,endRowIndex+1);if(this.grid.hasFixedColumns()){fixedRowRange=this.grid.fixedBodyContainer().find("tbody").children("tr:not([data-container]):visible").slice(startRowIndex,endRowIndex+1)}if(this.options.mode==="row"){for(i=0;i<rowRange.length;i++){rowIndex=i+startRowIndex;range.push({id:this._pkProp?this._identifierForRow(rowRange.eq(i)):rowIndex,index:rowIndex,element:rowRange.eq(i).add(fixedRowRange?fixedRowRange.eq(i):null)})}return{startIndex:startRowIndex,endIndex:endRowIndex,active:end,element:endElement,range:range}}if(this.grid.hasFixedColumns()){isStartFixed=this.grid._isFixedElement(startElement);isEndFixed=this.grid._isFixedElement(endElement);if(isStartFixed&&isEndFixed){cellRange=this._getCellRangeFor(fixedRowRange,startElement,endElement,startRowIndex)}else if(isStartFixed!==isEndFixed){cellRange=this._getCrossCellRange(rowRange,fixedRowRange,startElement,endElement,startRowIndex)}else{cellRange=this._getCellRangeFor(rowRange,startElement,endElement,startRowIndex)}}else{cellRange=this._getCellRangeFor(rowRange,startElement,endElement,startRowIndex)}return $.extend(cellRange,{firstRowIndex:startRowIndex,lastRowIndex:endRowIndex,active:end,element:endElement})},_getCrossCellRange:function(rowRange,fixedRowRange,startElement,endElement,startRowIndex){var fixingDir=this.grid.fixedBodyContainer().attr("data-fixing-direction"),startFixedElement,endFixedElement,startUnfixedElement,endUnfixedElement,startFixedRow,endFixedRow,startUnfixedRow,endUnfixedRow,unfixedRange,fixedRange;if(this.grid._isFixedElement(startElement)){startFixedRow=startElement.parent();startFixedElement=startElement;endUnfixedRow=endElement.parent();endUnfixedElement=endElement;endFixedRow=this._getRowByIndex(endUnfixedRow.index(),true);startUnfixedRow=this._getRowByIndex(startFixedRow.index(),false);if(fixingDir==="left"){endFixedElement=endFixedRow.children("td:not([data-skip=true])").last();startUnfixedElement=startUnfixedRow.children("td:not([data-skip=true])").first()}else{endFixedElement=endFixedRow.children("td:not([data-skip=true])").first();startUnfixedElement=startUnfixedRow.children("td:not([data-skip=true])").last()}}else{startUnfixedRow=startElement.parent();startUnfixedElement=startElement;endFixedRow=endElement.parent();endFixedElement=endElement;endUnfixedRow=this._getRowByIndex(endFixedRow.index(),false);startFixedRow=this._getRowByIndex(startUnfixedRow.index(),true);if(fixingDir==="left"){endUnfixedElement=endUnfixedRow.children("td:not([data-skip=true])").first();startFixedElement=startFixedRow.children("td:not([data-skip=true])").last()}else{endUnfixedElement=endUnfixedRow.children("td:not([data-skip=true])").last();startFixedElement=startFixedRow.children("td:not([data-skip=true])").first()}}fixedRange=this._getCellRangeFor(fixedRowRange,startFixedElement,endFixedElement,startRowIndex);unfixedRange=this._getCellRangeFor(rowRange,startUnfixedElement,endUnfixedElement,startRowIndex);return{range:fixedRange.range.concat(unfixedRange.range),firstColumnIndex:fixedRange.startCellIndex,lastColumnIndex:fixedRange.endCellIndex}},_getCellRangeFor:function(rowRange,startElement,endElement,startRowIndex){var startCellIndex,endCellIndex,reverse,crLength,cellRange,range=[],row,rowIndex,cell,cellIndex,i,startElementIndex;startCellIndex=startElement.parent().children("td").index(startElement);endCellIndex=endElement.parent().children("td").index(endElement);reverse=startCellIndex>endCellIndex;if(reverse){startCellIndex=startCellIndex+endCellIndex;endCellIndex=startCellIndex-endCellIndex;startCellIndex=startCellIndex-endCellIndex}crLength=endCellIndex-startCellIndex+1;cellRange=rowRange.find("td:nth-of-type(n+"+(startCellIndex+1)+"):nth-of-type(-n+"+(endCellIndex+1)+")");if(!cellRange.length){return{range:range}}row=cellRange.eq(0).parent();rowIndex=startRowIndex;startElementIndex=startElement.index();for(i=0;i<cellRange.length;i++){cell=cellRange.eq(i);if(cell.parent()[0]!==row[0]){row=cell.parent();rowIndex=startRowIndex+Math.floor(i/crLength)}cellIndex=i%crLength+startElementIndex;range.push({id:this._identifierForCell(cell),element:cell,rowIndex:rowIndex,index:cellIndex})}return{firstColumnIndex:startCellIndex,lastColumnIndex:endCellIndex,range:range}},_isOutOfView:function(rowIdx,colIdx){var rv=this.grid.options.rowVirtualization||this.grid.options.virtualization,cv=this.grid.options.columnVirtualization||this.grid.options.virtualization,sri=this.grid._startRowIndex||0,sci=this.grid._startColIndex||0,vrc=this.grid._virtualRowCount,vcc=this.grid._virtualColumnCount;if(colIdx===null||colIdx===undefined){return rv?rowIdx<sri||rowIdx>=sri+vrc:false}return rv||cv?rowIdx<sri||rowIdx>=sri+vrc||colIdx<sci||colIdx>=sci+vcc:false},_isDataElement:function(identifier){var type=$.type(identifier);return type==="number"||type==="string"||!identifier.columnKey.startsWith("##")},_suppressKey:function(keyCode){var updating=this.grid.element.data("igGridUpdating"),key;switch(keyCode){case $.ui.keyCode.ENTER:key="enter";break;case $.ui.keyCode.SPACE:key="space";break}if(updating){return updating.options.startEditTriggers.indexOf(key)>=0}return false},_firstDataCellForRow:function(row){return row.children("td:not([data-skip='true'],td[data-parent]):first")},_canBeSelected:function(identifier){return!identifier.columnKey||identifier.columnKey&&!identifier.columnKey.startsWith("##")},_identifierForTarget:function(target){if(target.is("tr")){return this._identifierForRow(target)}if(target.hasClass("ui-iggrid-nongrouprowemptycell")){return this._identifierForDataSkipCell(target,this._gbEmptyCellKey)}if(target.hasClass("ui-iggrid-expandcolumn")){if(target.attr("data-parent")){return this._identifierForDataSkipCell(target,this._hgCellKey)}return this._identifierForDataSkipCell(target,this._gbExpandCellKey)}if(target.attr("data-gbsummary")){return this._identifierForDataSkipCell(target,this._gbSummaryCellKey)}if(target.hasClass("ui-igtreegrid-non-data-column")&&target.attr("data-skip")){return this._identifierForDataSkipCell(target,this._tgExpandKey)}if(target.is("td")){return this._identifierForCell(target)}if(target.is("th")){return this._identifierForDataSkipCell(target,this._rsCellKey)}return null},_identifierForCell:function(cell){var row=cell.parent(),id=this.grid._fixPKValue(row.attr("data-id"));if(id===null||id===undefined){id=this._getIndexForRow(row)}return{id:id,columnKey:this._getColKeyForCell(cell)}},_identifierForRow:function(row){var id=this.grid._fixPKValue(row.attr("data-id"));if(id!==null&&id!==undefined){return id}return this._getIndexForRow(row)},_identifierForDataSkipCell:function(cell,key){var row=cell.parent(),id=this.grid._fixPKValue(row.attr("data-id"));if(id===null||id===undefined){id=this._getIndexForRow(row)}return{id:id,columnKey:key}},_getRowsByIdentifier:function(identifier){var urow,frow=$();if(!this._pkProp){if(this.grid.hasFixedColumns()){frow=this._getRowByIndex(identifier,true)}urow=this._getRowByIndex(identifier,false)}else{if(this.grid.hasFixedColumns()){frow=this.grid.rowById(identifier,true)}urow=this.grid.rowById(identifier,false)}return urow instanceof jQuery?urow.add(frow):$()},_getCellByIdentifier:function(identifier){var cellRow,isFixed,skippedCells,colIndex,i,cols,sci=this.grid._startColIndex||0;if(identifier.columnKey&&identifier.columnKey.startsWith("##")){return this._getNonDataCellByIdentifier(identifier)}if(!this._pkProp){isFixed=this.grid.isFixedColumn(identifier.columnKey);cellRow=this._getRowByIndex(identifier.id,isFixed);cols=this.grid._visibleColumns(isFixed);skippedCells=cellRow.children("th,[data-skip=true],[data-parent]").length;for(i=0;i<cols.length;i++){if(cols[i].key===identifier.columnKey){colIndex=i;break}}return cellRow.children("td:nth-child("+(colIndex+1+skippedCells-sci)+")")}return this.grid.cellById(identifier.id,identifier.columnKey)||$()},_getNonDataCellByIdentifier:function(identifier){var cellRow;if(!this._pkProp){cellRow=this._getRowByIndex(identifier.id,this.grid.hasFixedColumns())}else{cellRow=this._getRowsByIdentifier(identifier.id)}switch(identifier.columnKey){case this._rsCellKey:return cellRow.children("th:first");case this._gbEmptyCellKey:return cellRow.children(".ui-iggrid-nongrouprowemptycell:first");case this._gbExpandCellKey:return cellRow.children().first();case this._gbSummaryCellKey:return cellRow.children().last();case this._hgCellKey:return cellRow.children("td[data-parent='true']");case this._tgExpandKey:return cellRow.children(".ui-igtreegrid-non-data-column:first");default:return $()}},_getRecordByIdentifier:function(identifier){var dv=this._getDataView(),i,record=null,index=-1;if(this._pkProp){for(i=0;i<dv.length;i++){if(dv[i][this._pkProp]===identifier){record=dv[i];index=i;break}}}else{if(identifier>=0&&identifier<dv.length){record=dv[identifier];index=identifier}}return{record:record,index:index}},_getRowByIndex:function(index,fixed){var tbody=fixed?this.grid.fixedBodyContainer().find("tbody"):this.grid.element.find("tbody");return tbody.children("tr:not([data-container])").eq(index)},_getCellByIndex:function(index,row){return row.children("td").eq(index)},_getIndexForRow:function(row){return row.closest("tbody").children("tr:not([data-container])").index(row)+(this.grid._startRowIndex||0)},_getColKeyForCell:function(cell){var col=this.grid._getColumnByTD(cell);return col?col.column.key:null},_getColIndexByKey:function(key){var i,columns=this.grid._visibleColumns();for(i=0;i<columns.length;i++){if(columns[i].key===key){return i}}return-1},_getDataView:function(){return this.grid.dataSource.dataView()},_onRowSelectionChanging:function(a){var args={owner:this,selectedRows:this._selection.selectedRows()};if(a.element){args.row={element:a.element,index:a.index!==undefined?a.index:this._getIndexForRow(a.element)};if(this._pkProp){args.row.id=a.id||this._identifierForRow(a.element)}}if(a.startIndex!==undefined){args.startIndex=a.startIndex;args.endIndex=a.endIndex}return this._trigger(this.events.rowSelectionChanging,null,args)},_onRowSelectionChanged:function(a){var args={owner:this,selectedRows:this._selection.selectedRows()};if(a.element){args.row={element:a.element,index:a.index!==undefined?a.index:this._getIndexForRow(a.element)};if(this._pkProp){args.row.id=a.id||this._identifierForRow(a.element)}}return this._trigger(this.events.rowSelectionChanged,null,args)},_onCellSelectionChanging:function(a){var args={owner:this,selectedCells:this._selection.selectedCells()};if(a.element){args.cell={element:a.element,row:a.row||a.element.closest("tr"),columnKey:a.columnKey||this._getColKeyForCell(a.element)};args.cell.index=a.index!==undefined?a.index:this._getColIndexByKey(args.cell.columnKey);args.cell.rowIndex=a.rowIndex!==undefined?a.rowIndex:this._getIndexForRow(args.cell.row);if(this._pkProp){args.cell.rowId=a.rowId||this._identifierForRow(args.cell.row)}}if(a.firstColumnIndex!==undefined){args.firstColumnIndex=a.firstColumnIndex;args.firstRowIndex=a.firstRowIndex;args.lastColumnIndex=a.lastColumnIndex;args.lastRowIndex=a.lastRowIndex}return this._trigger(this.events.cellSelectionChanging,null,args)},_onCellSelectionChanged:function(a){var args={owner:this,selectedCells:this._selection.selectedCells()};if(a.element){args.cell={element:a.element,row:a.row||a.element.closest("tr"),columnKey:a.columnKey||this._getColKeyForCell(a.element)};args.cell.index=a.index!==undefined?a.index:this._getColIndexByKey(args.cell.columnKey);args.cell.rowIndex=a.rowIndex!==undefined?a.rowIndex:this._getIndexForRow(args.cell.row);if(this._pkProp){args.cell.rowId=a.rowId||this._identifierForRow(args.cell.row)}}return this._trigger(this.events.cellSelectionChanged,null,args)},_onRowActivationChanging:function(a){var args={owner:this,row:{element:a.element,index:this._getIndexForRow(a.element)}};if(this._pkProp){args.row.id=a.id}return this._trigger(this.events.activeRowChanging,null,args)},_onRowActivationChanged:function(a){var args={owner:this,row:{element:a.element,index:this._getIndexForRow(a.element)}};if(this._pkProp){args.row.id=a.id}return this._trigger(this.events.activeRowChanged,null,args)},_onCellActivationChanging:function(a){var args={owner:this,cell:{element:a.element,row:a.element.closest("tr")}};args.cell.index=this._getColIndexByKey(a.id.columnKey);args.cell.rowIndex=this._getIndexForRow(args.cell.row);args.cell.columnKey=a.id.columnKey;if(this._pkProp){args.cell.rowId=a.id.id}return this._trigger(this.events.activeCellChanging,null,args)},_onCellActivationChanged:function(a){var args={owner:this,cell:{element:a.element,row:a.element.closest("tr")}};args.cell.index=this._getColIndexByKey(a.id.columnKey);args.cell.rowIndex=this._getIndexForRow(args.cell.row);args.cell.columnKey=a.id.columnKey;if(this._pkProp){args.cell.rowId=a.id.id}return this._trigger(this.events.activeCellChanged,null,args)},_select:function(info){var element=info.element||this._selection.elementFromIdentifier(info.id);if(element.is("tr")){element.children("td").not("[data-skip=true]").addClass(this.css.selectedCell)}else{element.addClass(this.css.selectedCell)}element.attr("aria-selected",true)},_deselect:function(info){var element=info.element||this._selection.elementFromIdentifier(info.id);if(element.is("tr")){element.children("td").removeClass(this.css.selectedCell)}else{element.removeClass(this.css.selectedCell)}element.attr("aria-selected",false)},_resizeGridWidth:function(decrease){if(decrease&&this._gridWidthDecreased||!decrease&&!this._gridWidthDecreased){return}var grid=this.grid,diff,padding=parseInt(grid.element.find("tbody tr td:last-child").css(grid._padding),10),$col=grid.element.find("colgroup:first>col:last");this._scrollbarWidth=this._scrollbarWidth||grid._scrollbarWidth();diff=this._scrollbarWidth;this._gridWidthDecreased=false;if(decrease){diff=-diff;this._gridWidthDecreased=true}grid.element.find("tbody tr td:last-child").css({"padding-right":padding+diff,"border-right":diff>0?"1px":"0px"});grid.element.css("width",grid.element.width()+diff);$col.width($col.width()+diff)},_isScrollbarOverLastCells:function(){if(this._isScrollbarOverLastCellsCache===undefined||this._isScrollbarOverLastCellsCache===null){var opts=this.grid.options,hasFixedHeaders=opts.showHeader&&opts.fixedHeaders===true&&opts.height!==null,hasVirtualization=opts.virtualization===true||opts.columnVirtualization===true||opts.rowVirtualization===true,lastColInPixels=this.grid.headersTable().children("colgroup").length>0&&this.grid.headersTable().children("colgroup").first().children("col:last").css("width").indexOf("%")===-1,hasHorizontalScrollbar=this.grid._hscrollbar().length>0;this._isScrollbarOverLastCellsCache=this.grid._hasVerticalScrollbar&&hasFixedHeaders&&!hasVirtualization&&hasHorizontalScrollbar&&lastColInPixels}return this._isScrollbarOverLastCellsCache},_activate:function(element){var initiallyFocused,me=this;if(element.is("tr")){element.addClass(this.css.activeRow);initiallyFocused=element.filter(".initially-focused");if(initiallyFocused.length){initiallyFocused.focus();initiallyFocused.removeClass("initially-focused");return}}else{element.addClass(this.css.activeCell)}if(this.options.mode==="cell"&&$.ig.util.isIE&&element.is(":last-child")&&this._isScrollbarOverLastCells()){this._resizeGridWidth(true);element.focus();if(this._timeoutResizeGrid){clearTimeout(this._timeoutResizeGrid);this._timeoutResizeGrid=null}this._timeoutResizeGrid=setTimeout(function(){me._resizeGridWidth(false)},100)}else{element.focus()}},_deactivate:function(){if(this.grid.hasFixedColumns()){if(this.options.mode==="row"){this.grid.fixedBodyContainer().find("tbody").find("tr.ui-iggrid-activerow").removeClass(this.css.activeRow)}else{this.grid.fixedBodyContainer().find("tbody").find("td.ui-iggrid-activecell").removeClass(this.css.activeCell)}}if(this.options.mode==="row"){this.grid.element.find("tbody").find("tr.ui-iggrid-activerow").removeClass(this.css.activeRow)}else{this.grid.element.find("tbody").find("td.ui-iggrid-activecell").removeClass(this.css.activeCell)}},_clearSelection:function(){this.grid.fixedBodyContainer().find("tbody").find("td.ui-iggrid-selectedcell").removeClass(this.css.selectedCell).attr("aria-selected",false);this.grid.fixedBodyContainer().find("tbody").find("tr[aria-selected]").attr("aria-selected",false);this.grid.element.children("tbody").find("td.ui-iggrid-selectedcell").removeClass(this.css.selectedCell).attr("aria-selected",false);this.grid.element.children("tbody").find("tr[aria-selected]").attr("aria-selected",false)},_createHandlers:function(){this._dataRenderingHandler=$.proxy(this._dataRendering,this);this._virtualRecordsRenderingHandler=$.proxy(this._virtualRecordsRendering,this);this._virtualRecordsRendererHandler=$.proxy(this._virtualRecordsRender,this);this._columnsCollectionModifiedHandler=$.proxy(this._columnsCollectionModified,this);this._mouseDownHandler=$.proxy(this._mouseDown,this);this._mouseMoveHandler=$.proxy(this._mouseMove,this);this._mouseUpHandler=$.proxy(this._mouseUp,this);this._pointerDownHandler=$.proxy(this._pointerDown,this);this._pointerMoveHandler=$.proxy(this._pointerMove,this);this._pointerUpHandler=$.proxy(this._pointerUp,this);this._selectStartHandler=$.proxy(this._selectStart,this);this._selectStartContainerHandler=$.proxy(this._selectStartContainer,this);this._releaseMouseHandler=$.proxy(this._releaseMouse,this);this._touchStartHandler=$.proxy(this._touchStart,this);this._touchEndHandler=$.proxy(this._touchEnd,this);this._touchMoveHandler=$.proxy(this._touchMove,this);this._keyDownHandler=$.proxy(this._keyDown,this);this._containerFocusHandler=$.proxy(this._containerFocus,this);this._focusInHandler=$.proxy(this._tbodyFocusIn,this);this._focusOutHandler=$.proxy(this._tbodyFocusOut,this);this._preventDefaultHandler=$.proxy(this._preventDefault,this)},_unregisterEvents:function(){var gOpts=this.grid.options,tbody=this.grid.element.find("tbody").add(this.grid.fixedBodyContainer().find("tbody")),hasVirtualization=gOpts.virtualization||gOpts.rowVirtualization||gOpts.columnVirtualization,scrollCont=hasVirtualization?this.grid._vdisplaycontainer():this.grid.scrollContainer();if(this._tbodyBinding){tbody.unbind(this._tbodyBinding)}$(document).unbind("mouseup",this._releaseMouseHandler);scrollCont.unbind("scroll",this._releaseMouseHandler);this.grid.container().unbind("selectstart",this._selectStartContainerHandler);this.grid.element.removeClass("ui-iggrid-canceltextselection");if(this.options.mode==="row"){this.grid.element.find("tbody td").unbind("mousedown",this._preventDefaultHandler)}},_registerEvents:function(){var gOpts=this.grid.options,tbody=this.grid.element.find("tbody").add(this.grid.fixedBodyContainer().find("tbody")),hasVirtualization=gOpts.virtualization||gOpts.rowVirtualization||gOpts.columnVirtualization,scrollCont=hasVirtualization?this.grid._vdisplaycontainer():this.grid.scrollContainer();this._tbodyBinding=this._tbodyBinding||this._generateTbodyBinding();tbody.unbind(this._tbodyBinding).bind(this._tbodyBinding);$(document).bind("mouseup",this._releaseMouseHandler);scrollCont.bind("scroll",this._releaseMouseHandler);this.grid.container().bind("selectstart",this._selectStartContainerHandler);if(this.options.multipleSelection===true){this.grid.element.addClass("ui-iggrid-canceltextselection")}if(this.options.mode==="row"){this.grid.element.find("tbody td").bind("mousedown",this._preventDefaultHandler)}},_generateTbodyBinding:function(){var binding={};binding.selectstart=this._selectStartHandler;binding.focusin=this._focusInHandler;binding.focusout=this._focusOutHandler;binding.keydown=this._keyDownHandler;if(typeof Modernizr==="object"&&Modernizr.touch===true){binding.touchstart=this._touchStartHandler;binding.touchend=this._touchEndHandler;binding.touchmove=this._touchMoveHandler}if(window.navigator.msPointerEnabled||window.navigator.pointerEnabled){binding.MSPointerDown=this._pointerDownHandler;binding.MSPointerMove=this._pointerMoveHandler;binding.MSPointerUp=this._pointerUpHandler;binding.pointerdown=this._pointerDownHandler;binding.pointermove=this._pointerMoveHandler;binding.pointerup=this._pointerUpHandler}else{binding.mousedown=this._mouseDownHandler;binding.mousemove=this._mouseMoveHandler;binding.mouseup=this._mouseUpHandler}return binding},_injectGrid:function(gridInstance,isRebind){var i;this.grid=gridInstance;for(i=0;i<this.grid.options.features.length;i++){if(this.grid.options.features[i].name==="Selection"){this.grid.options.features[i].inherit=true}if(this.grid.options.features[i].name==="RowSelectors"){if(this.grid.options.features[i].enableCheckBoxes===true&&this.grid.options.features[i].checkBoxMode!=="triState"){this.options.mode="row"}}}this._initSelectionCollection(isRebind);if(!isRebind){this._createHandlers()}this.grid.element.unbind("iggriddatarendering",this._dataRenderingHandler).bind("iggriddatarendering",this._dataRenderingHandler);this.grid.element.unbind("iggridvirtualrendering",this._virtualRecordsRenderingHandler).bind("iggridvirtualrendering",this._virtualRecordsRenderingHandler);this.grid.element.unbind("igtreegridvirtualrendering",this._virtualRecordsRenderingHandler).bind("igtreegridvirtualrendering",this._virtualRecordsRenderingHandler);this.grid.element.unbind("iggridvirtualrecordsrender",this._virtualRecordsRendererHandler).bind("iggridvirtualrecordsrender",this._virtualRecordsRendererHandler);this.grid.element.unbind("igtreegridvirtualrecordsrender",this._virtualRecordsRendererHandler).bind("igtreegridvirtualrecordsrender",this._virtualRecordsRendererHandler);this.grid.element.unbind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler).bind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler);if(!isRebind){this.grid._cellStyleSubscribers.push(this.options.mode==="row"?$.proxy(this._applyRowStyle,this):$.proxy(this._applyCellStyle,this))}}});$.extend($.ui.igGridSelection,{version:"15.2.20152.1027"});$.ig.SelectionCollection=$.ig.SelectionCollection||Class.extend({settings:{multipleSelection:false,subscribers:{},owner:null},init:function(options){if(options){this.settings=$.extend(true,{},$.ig.SelectionCollection.prototype.settings,options)}this.selection={};return this},addSubscriber:function(subscriber,owner){var suid=$.ig.uid();if(!this.settings.subscribers[owner]){this.settings.subscribers[owner]={}}this.settings.subscribers[owner][suid]=subscriber;return suid},removeSubscriber:function(subscriberId,owner){delete this.settings.subscribers[owner][subscriberId]},changeOwner:function(newOwner){this.cleanAll();this.settings.owner=newOwner},isSelected:function(identifier,forOwner){return false},isActive:function(identifier,forOwner){return false},elementFromIdentifier:function(identifier){return $()},toggle:function(element){if(this.activeElement===null){return}this.select(this.activeElement,true,{element:element||this.elementFromIdentifier(this.activeElement)})},activate:function(identifier,element,suppress){var info={element:element,id:identifier};if(!this.isActive(identifier)){if(this._requestTrigger("ActivationChanging",suppress,info)){this._notify("deactivate");this.activeElement=identifier;this._notify("activate",element);this._requestTrigger("ActivationChanged",suppress,info)}}},deactivate:function(suppress){var info=suppress?null:{element:this.elementFromIdentifier(this.activeElement),id:this.activeElement};if(this._requestTrigger("ActivationChanging",suppress,info)){this._notify("deactivate");this.activeElement=null;this._requestTrigger("ActivationChanged",suppress,info)}},select:function(identifier,add,info,suppress){info=info||{};info.element=info.element||this.elementFromIdentifier(identifier);if(this.isSelected(identifier)){if(add){if(this._requestTrigger("SelectionChanging",suppress,info)){this._markUnselected(identifier);this._notify("deselect",info);this._requestTrigger("SelectionChanged",suppress,info)}}else{if(this.onlyOneSelected()){return}if(this._requestTrigger("SelectionChanging",suppress,info)){this.clearSelection();this._markSelected(identifier,info);this._notify("select",info);this._requestTrigger("SelectionChanged",suppress,info)}}}else{if(this._requestTrigger("SelectionChanging",suppress,info)){if(!add||!this.settings.multipleSelection){this.clearSelection()}this._markSelected(identifier,info);this._notify("select",info);this._requestTrigger("SelectionChanged",suppress,info)}}this.rangeSelectStart=identifier},rangeSelect:function(range,add,prevRange,info,suppress){var i;if(!this._requestTrigger("SelectionChanging",suppress,info)){return}if(!prevRange||!this._rangeUnlock){if(!add){this.clearSelection()}}else{this._rangeUnlock(prevRange)}for(i=0;i<range.length;i++){if(!this.isSelected(range[i].id)){this._markSelected(range[i].id,range[i]);this._notify("select",range[i])}}this.activate(info.active,info.element||this.elementFromIdentifier(info.active));this._requestTrigger("SelectionChanged",suppress,info)},rangeDeselect:function(range,info,suppress){var i;if(!this._requestTrigger("SelectionChanging",suppress,info)){return}for(i=0;i<range.length;i++){this._markUnselected(range[i].id);this._notify("deselect",range[i])}this._requestTrigger("SelectionChanged",suppress,info)},deselect:function(identifier,info,suppress){info=info||{};info.element=info.element||this.elementFromIdentifier(identifier);this.select(identifier,true,info,suppress)},deselectAll:function(suppress){if(!this._requestTrigger("SelectionChanging",suppress,{})){return}this.clearSelection();this._requestTrigger("SelectionChanged",suppress,{})},clearSelection:function(forOwner){if(!forOwner||forOwner===this.settings.owner){this.selection={};this._notify("clearSelection")}},cleanAll:function(forOwner){if(!forOwner||forOwner===this.settings.owner){this.deactivate(true);this.clearSelection()}},onlyOneSelected:function(){return false},selectedCells:function(){return[]},selectedRows:function(){return[]},selectionLength:function(){return Object.keys(this.selection).length},_requestTrigger:function(type,suppress,args){var subs=this.settings.subscribers[this.settings.owner.id()],func="_on"+this._selectionMode()+type,key,result=true;if(suppress){return true}for(key in subs){if(subs.hasOwnProperty(key)&&typeof subs[key][func]==="function"){result=result&&subs[key][func](args)}}return result},_notify:function(message,info){var subs=this.settings.subscribers[this.settings.owner.id()],func="_"+message,key;for(key in subs){if(subs.hasOwnProperty(key)&&typeof subs[key][func]==="function"){subs[key][func](info)}}}});$.ig.SelectedRowsCollection=$.ig.SelectedRowsCollection||$.ig.SelectionCollection.extend({isSelected:function(identifier,forOwner){if(forOwner&&this.settings.owner!==forOwner){return false}return this.selection[identifier]!==undefined},isActive:function(identifier,forOwner){if(forOwner&&this.settings.owner!==forOwner){return false}return this.activeElement===identifier},selectedRows:function(){var rows=this._rowscache||[],rowKey;for(rowKey in this.selection){if(this.selection.hasOwnProperty(rowKey)){rows.push(this._selectedRowObject(this.settings.owner._fixPKValue(rowKey)))}}this.invalid=false;return rows},activeRow:function(){var row;if(this.activeElement!==null&&this.activeElement!==undefined){row=this.elementFromIdentifier(this.activeElement);return{id:this.activeElement,index:this.elementPosition(this.activeElement,row),element:row}}return null},elementFromIdentifier:function(identifier){return this.settings.owner.element.data("igGridSelection")._getRowsByIdentifier(identifier)},elementPosition:function(identifier,element){var ownSelection=this.settings.owner.element.data("igGridSelection");if(element&&element.length>0){return ownSelection._getIndexForRow(element)}return ownSelection._getRecordByIdentifier(identifier).index},onlyOneSelected:function(){return Object.keys(this.selection).length===1},_markSelected:function(identifier,info){this.selection[identifier]=info||true},_markUnselected:function(identifier){delete this.selection[identifier]},_selectedRowObject:function(identifier){var rowInfo=this.selection[identifier];if($.type(rowInfo)!=="object"){rowInfo={};this.selection[identifier]=rowInfo}if(this.invalid){rowInfo.element=this.elementFromIdentifier(identifier);rowInfo.index=this.elementPosition(identifier,rowInfo.element)}else{rowInfo.element=rowInfo.element||this.elementFromIdentifier(identifier);rowInfo.index=rowInfo.index!==undefined&&rowInfo.index!==null?rowInfo.index:this.elementPosition(identifier,rowInfo.element)}return $.extend(true,{},rowInfo,{id:identifier})},_selectionMode:function(){return"Row"}});$.ig.SelectedCellsCollection=$.ig.SelectedCellsCollection||$.ig.SelectionCollection.extend({isSelected:function(identifier,forOwner){if(forOwner&&this.settings.owner!==forOwner){return false}return this.selection[identifier.id]!==undefined&&this.selection[identifier.id][identifier.columnKey]!==undefined},atLeastOneSelected:function(rowId,forOwner){if(forOwner&&this.settings.owner!==forOwner){return false}return Object.keys(this.selection[rowId]).length>0},isActive:function(identifier,forOwner){if(forOwner&&this.settings.owner!==forOwner){return false}return this.activeElement&&this.activeElement.id===identifier.id&&this.activeElement.columnKey===identifier.columnKey},selectedCells:function(){var cells=[],sid,rowKey,columnKey;for(rowKey in this.selection){if(this.selection.hasOwnProperty(rowKey)){for(columnKey in this.selection[rowKey]){if(this.selection[rowKey].hasOwnProperty(columnKey)){sid={id:this.settings.owner._fixPKValue(rowKey),columnKey:columnKey};cells.push(this._selectedCellObject(sid))}}}}this.invalid=false;return cells},activeCell:function(){var cell,pos;if(this.activeElement){cell=this.elementFromIdentifier(this.activeElement);pos=this.elementPosition(this.activeElement,cell);return{row:cell.parent(),id:this.activeElement.id,columnKey:this.activeElement.columnKey,rowIndex:pos.x,index:pos.y,element:cell}}return null},elementFromIdentifier:function(identifier){return this.settings.owner.element.data("igGridSelection")._getCellByIdentifier(identifier)},elementPosition:function(identifier,element){var ownSelection=this.settings.owner.element.data("igGridSelection");if(element&&element.length>0){return{x:ownSelection._getIndexForRow(element.parent()),y:element.index()}}return{x:ownSelection._getRecordByIdentifier(identifier.id).index,y:ownSelection._getColIndexByKey(identifier.columnKey)}},onlyOneSelected:function(){var rKeys=Object.keys(this.selection);if(rKeys.length===1){return Object.keys(this.selection[rKeys[0]]).length===1}return false},_lockSelection:function(){var rowId,cellId;for(rowId in this.selection){if(this.selection.hasOwnProperty(rowId)){for(cellId in this.selection[rowId]){if(this.selection[rowId].hasOwnProperty(cellId)){if($.type(this.selection[rowId][cellId]==="object")){this.selection[rowId][cellId].locked=true}else{this.selection[rowId][cellId]={locked:true}}}}}}},_markSelected:function(identifier,info){this.selection[identifier.id]=this.selection[identifier.id]||{};this.selection[identifier.id][identifier.columnKey]=info||true
},_markUnselected:function(identifier){if(!this.selection[identifier.id]){return}delete this.selection[identifier.id][identifier.columnKey]},_unlockSelected:function(identifier){var c;if(!this.selection[identifier.id]){return false}c=this.selection[identifier.id][identifier.columnKey];if($.type(c)==="object"){if(!c.locked){delete this.selection[identifier.id][identifier.columnKey];return true}return false}delete this.selection[identifier.id][identifier.columnKey];return true},_rangeUnlock:function(range){var i;for(i=0;i<range.length;i++){if(this._unlockSelected(range[i].id)){this._notify("deselect",range[i])}}},_selectedCellObject:function(identifier){var cellInfo=this.selection[identifier.id][identifier.columnKey],pos;if($.type(cellInfo)!=="object"){cellInfo={};this.selection[identifier.id][identifier.columnKey]=cellInfo}if(this.invalid){cellInfo.element=this.elementFromIdentifier(identifier);cellInfo.row=cellInfo.element.parent();pos=this.elementPosition(identifier,cellInfo.element);cellInfo.rowIndex=pos.x;cellInfo.index=pos.y}else{cellInfo.element=cellInfo.element||this.elementFromIdentifier(identifier);cellInfo.row=cellInfo.row||cellInfo.element.parent();if(!(cellInfo.rowIndex!==undefined&&cellInfo.rowIndex!==null&&cellInfo.index!==undefined&&cellInfo.index!==null)){pos=this.elementPosition(identifier,cellInfo.element);cellInfo.rowIndex=pos.x;cellInfo.index=pos.y}}return $.extend(true,{},cellInfo,{id:identifier.id,columnKey:identifier.columnKey})},_selectionMode:function(){return"Cell"}})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Sorting 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 *	infragistics.ui.grid.shared.js
 *	infragistics.ui.grid.featurechooser.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igGridSorting",{css:{sortableColumnHeader:"ui-iggrid-sortableheader ui-state-default",sortableColumnHeaderActive:"ui-iggrid-sortableheaderactive ui-state-active",sortableColumnHeaderHover:"ui-iggrid-sortableheaderhover ui-state-hover",sortableColumnHeaderFocus:"ui-iggrid-sortableheaderfocus ui-state-focus",ascendingColumnHeader:"ui-iggrid-colheaderasc",descendingColumnHeader:"ui-iggrid-colheaderdesc",ascendingColumn:"ui-iggrid-colasc ui-state-highlight",descendingColumn:"ui-iggrid-coldesc ui-state-highlight",sortIndicator:"ui-iggrid-colindicator",fcSortIndicatorAscending:"ui-iggrid-featurechooser-li-iconcontainer ui-icon ui-iggrid-icon-sort-a-z",fcSortIndicatorDescending:"ui-iggrid-featurechooser-li-iconcontainer ui-icon ui-iggrid-icon-sort-z-a",sortIndicatorAscending:"ui-iggrid-colindicator-asc ui-icon ui-icon-arrowthick-1-n",sortIndicatorDescending:"ui-iggrid-colindicator-desc ui-icon ui-icon-arrowthick-1-s",dialogSortedColumns:"ui-iggrid-sorting-dialog-sortedcolumns",dialogUnsortedColumns:"ui-iggrid-sorting-dialog-unsortedcolumns",dialogUnsortedColumnsSortByButton:"ui-iggrid-sorting-dialog-unsortedcolumns-sortbybutton",dialogAsdDescButton:"ui-iggrid-sorting-dialog-ascdescbutton",modalDialogSortByColumn:"ui-iggrid-sorting-dialog-sortbybutton",dialogSortedColumnsItem:"ui-widget-content",dialogUnsortedColumnsItem:"ui-widget-content",dialogButtonAsc:"ui-button ui-corner-all ui-button-icon-only ig-sorting-indicator",dialogButtonAscIcon:"ui-button-icon-primary ui-icon ui-icon-arrowthick-1-n",dialogButtonDesc:"ui-button ui-corner-all ui-button-icon-only ig-sorting-indicator",dialogButtonDescIcon:"ui-button-icon-primary ui-icon ui-icon-arrowthick-1-s",dialogButtonUnsort:"ui-iggrid-sorting-dialog-sortbybuttons ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only ui-igbutton ui-widget-content ui-igbutton-remove",dialogButtonUnsortContainer:"ui-button-icon-primary ui-icon ui-icon-circle-close",dialogSortedColumnTextContainer:"ui-iggrid-dialog-text",dialogItemText:"ui-iggrid-dialog-text",dialogButtonsHover:"ui-state-hover",featureChooserModalDialogIcon:"ui-icon ui-iggrid-icon-multiple-sorting"},options:{type:null,caseSensitive:false,applySortedColumnCss:true,sortUrlKey:null,sortUrlKeyAscValue:null,sortUrlKeyDescValue:null,mode:"single",customSortFunction:null,firstSortDirection:"ascending",sortedColumnTooltip:$.ig.GridSorting.locale.sortedColumnTooltipFormat,modalDialogSortOnClick:false,modalDialogSortByButtonText:$.ig.GridSorting.locale.modalDialogSortByButtonText,modalDialogResetButtonLabel:$.ig.GridSorting.locale.modalDialogResetButton,modalDialogCaptionButtonDesc:$.ig.GridSorting.locale.modalDialogCaptionButtonDesc,modalDialogCaptionButtonAsc:$.ig.GridSorting.locale.modalDialogCaptionButtonAsc,modalDialogCaptionButtonUnsort:$.ig.GridSorting.locale.modalDialogCaptionButtonUnsort,modalDialogWidth:350,modalDialogHeight:"",modalDialogAnimationDuration:200,featureChooserText:$.ig.GridSorting.locale.featureChooserText,unsortedColumnTooltip:$.ig.GridSorting.locale.unsortedColumnTooltip,columnSettings:[{columnKey:null,columnIndex:null,firstSortDirection:null,currentSortDirection:null,allowSorting:true}],modalDialogCaptionText:$.ig.GridSorting.locale.modalDialogCaptionText,modalDialogButtonApplyText:$.ig.GridSorting.locale.modalDialogButtonApplyText,modalDialogButtonCancelText:$.ig.GridSorting.locale.modalDialogButtonCancelText,featureChooserSortAsc:$.ig.GridSorting.locale.featureChooserSortAsc,featureChooserSortDesc:$.ig.GridSorting.locale.featureChooserSortDesc,persist:true,sortingDialogContainment:"owner",inherit:false},renderInFeatureChooser:true,events:{columnSorting:"columnSorting",columnSorted:"columnSorted",modalDialogOpening:"modalDialogOpening",modalDialogOpened:"modalDialogOpened",modalDialogMoving:"modalDialogMoving",modalDialogClosing:"modalDialogClosing",modalDialogClosed:"modalDialogClosed",modalDialogContentsRendering:"modalDialogContentsRendering",modalDialogContentsRendered:"modalDialogContentsRendered",modalDialogSortingChanged:"modalDialogSortingChanged",modalDialogButtonUnsortClick:"modalDialogButtonUnsortClick",modalDialogSortClick:"modalDialogSortClick",modalDialogButtonApplyClick:"modalDialogButtonApplyClick",modalDialogButtonResetClick:"modalDialogButtonResetClick"},_createWidget:function(){this.options.columnSettings=[];$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){var self=this;this._headers=[];this._clickHandler=function(event){var th,id,scrLeft,$scrContainer;id=$(event.target).closest(".ui-iggrid").attr("id").replace("_container","");if(self.grid.element.attr("id")!==id){return}th=$(event.currentTarget).closest("th");if(th.attr("data-skip")!=="true"&&(self.grid._isMultiColumnGrid!==true||th.attr("data-isheadercell")==="true")){if(!self._checkSortingAllowed(th.data("columnIndex"))){return}self._handleSort(event);scrLeft=$("#"+self.grid.id()+"_hscroller").scrollLeft();if(scrLeft>0){if(self.grid.options.fixedHeaders===true){self.grid.headersTable().parent().scrollLeft(scrLeft)}if(self.grid.options.fixedFooters===true){self.grid.footersTable().parent().scrollLeft(scrLeft)}$scrContainer=self.grid.scrollContainer();if(!$scrContainer.length){$scrContainer=self.grid._vdisplaycontainer()}$scrContainer.scrollLeft(scrLeft)}}};this._dragStartHandler=function(event){var id,noCancel=true;noCancel=self.grid._trigger("headercelldragcancel",event,{});if(noCancel){id=$(event.target).closest(".ui-iggrid").attr("id").replace("_container","");if(self.grid.element.attr("id")!==id){return}event.stopPropagation();event.preventDefault()}else{return true}return false};this._mouseOverHandler=function(event){var id,$target=$(event.currentTarget),cs;id=$(event.target).closest(".ui-iggrid").attr("id").replace("_container","");if(self.grid.element.attr("id")!==id){return}cs=self._getColSettingFromElement(event.currentTarget);if(cs&&cs.allowSorting!==false){$target.addClass(self.css.sortableColumnHeaderHover)}};this._mouseOutHandler=function(event){var id;id=$(event.target).closest(".ui-iggrid").attr("id").replace("_container","");if(self.grid.element.attr("id")!==id){return}$(event.currentTarget).removeClass(self.css.sortableColumnHeaderHover)};$("#"+this.element[0].id).delegate("thead th",{click:this._clickHandler,mouseover:this._mouseOverHandler,mouseout:this._mouseOutHandler});$("#"+this.element[0].id+" thead th").bind("dragstart",this._dragStartHandler);$("#"+this.element[0].id+"_headers thead th").bind("dragstart",this._dragStartHandler);$(document).delegate("#"+this.element[0].id+"_headers thead th",{click:this._clickHandler,mouseover:this._mouseOverHandler,mouseout:this._mouseOutHandler});this._keyDownHandler=function(event){self._handleSortKb(event)};this._focusHandler=function(event){self._handleFocusKb(event)};this._blurHandler=function(event){self._handleBlurKb(event)};$("#"+this.element[0].id).delegate("thead th",{keydown:this._keyDownHandler,focus:this._focusHandler,blur:this._blurHandler});$(document).delegate("#"+this.element[0].id+"_headers thead th",{keydown:this._keyDownHandler,focus:this._focusHandler,blur:this._blurHandler})},_setOption:function(key,value){var i,col,featureChooserInstance,modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog");$.Widget.prototype._setOption.apply(this,arguments);switch(key){case"type":throw new Error($.ig.Grid.locale.optionChangeNotSupported.replace("{optionName}",key));case"caseSensitive":this.grid.dataSource.settings.sorting.caseSensitive=this.options.caseSensitive;break;case"modalDialogSortOnClick":modalDialog.remove();this._renderMultipleSortingDialog();break;case"modalDialogAnimationDuration":modalDialog.igGridModalDialog("option","animationDuration",value);break;case"modalDialogWidth":modalDialog.igGridModalDialog("option","modalDialogWidth",value);break;case"modalDialogHeight":modalDialog.igGridModalDialog("option","modalDialogHeight",value);break;case"modalDialogButtonApplyText":modalDialog.igGridModalDialog("option","buttonApplyText",value);break;case"modalDialogButtonCancelText":modalDialog.igGridModalDialog("option","buttonCancelText",value);break;case"modalDialogCaptionText":modalDialog.igGridModalDialog("option","modalDialogCaptionText",value);break;case"featureChooserText":featureChooserInstance=this.grid.element.data("igGridFeatureChooser");if(featureChooserInstance){for(i=0;i<this.grid.options.columns.length;i++){col=this.grid.options.columns[i].key;featureChooserInstance._setListItemText(col,"Sorting",value)}}break;default:break}},_getColSettingFromElement:function(e){var index,cs=this.options.columnSettings,$e=$(e);index=parseInt($e.data("columnIndex"),10);return cs[index]},_handleSortKb:function(event){if($(event.target).attr("id")===undefined||$(event.target).attr("id")===null){return}var $el=$(event.target),key=$el.attr("id").replace(this.grid.element.attr("id")+"_",""),id;id=$el.closest(".ui-iggrid").attr("id").replace("_container","");if(this.grid.element.attr("id")!==id){return}if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){if(this._checkSortingAllowed($el.data("columnIndex"))){if(this._currentActiveHeader){this._currentActiveHeader.removeClass(this.css.sortableColumnHeaderActive)}$el.addClass(this.css.sortableColumnHeaderActive);this._currentActiveHeader=$el;if(event.shiftKey){this.unsortColumn(key,$el)}else{this.sortColumn(key,null,$el)}}event.stopPropagation();event.preventDefault()}},_handleFocusKb:function(event){if(this._resizing&&this._resizing._resizing){return}var $target=$(event.target),id=$target.closest(".ui-iggrid").attr("id").replace("_container","");if(this.grid.element.attr("id")!==id||$target.attr("data-fixing-indicator")!==undefined||!this._checkSortingAllowed($target.data("columnIndex"))){return}$target.addClass(this.css.sortableColumnHeaderFocus)},_handleBlurKb:function(event){var id=$(event.target).closest(".ui-iggrid").attr("id").replace("_container","");if(this.grid.element.attr("id")!==id){return}$(event.target).removeClass(this.css.sortableColumnHeaderFocus)},_handleSort:function(event){if(this._resizing&&this._resizing._resizing){this._resizing._resizing=false;return}var $currentTarget=$(event.currentTarget),$th=$currentTarget.closest("th"),key=$th.attr("id").replace(this.grid.element.attr("id")+"_",""),isShiftClicked=false;if(this._currentActiveHeader){this._currentActiveHeader.removeClass(this.css.sortableColumnHeaderActive).removeClass(this.css.sortableColumnHeaderFocus)}isShiftClicked=event.shiftKey;if(isShiftClicked){$th.removeClass(this.css.sortableColumnHeaderFocus).removeClass(this.css.sortableColumnHeaderActive);this._currentHeader=$th;this.unsortColumn(key,$th)}else{$currentTarget.addClass(this.css.sortableColumnHeaderActive);this._currentActiveHeader=$th;this.sortColumn(key,null,$currentTarget)}event.stopPropagation();event.preventDefault()},_checkSortingAllowed:function(index){var s,colKey,col=this.grid.options.columns[index];if(!col){return false}colKey=col.key;if(col.hidden){return true}s=this._findColumnSetting(colKey);if(s===null||s===undefined||s&&s.allowSorting===false){return false}return true},_initLoadingIndicator:function(){this._loadingIndicator=this.grid.container().length>0?this.grid.container().igLoading().data("igLoading").indicator():this.grid.element.igLoading().data("igLoading").indicator()},_getHeaderCellByIdentifier:function(identifier){var $headerCell,colKey;if($.type(identifier)==="number"){colKey=this.grid.options.columns[identifier].key}else{colKey=identifier}$headerCell=$("#"+this.grid.element[0].id+"_"+colKey);return $headerCell},sortColumn:function(index,direction,header){var colKey,expr,noCancel=true,s,se,i,visualIndex,groupby,reset=true,newDir,apiCall=header===null||header===undefined,addSE=false,isHidden=false,sortingNewExprs,curNewExpr;this._activeSortedCol=null;if($.type(index)==="number"){colKey=this.grid.options.columns[index].key;if(this.grid.options.columns[index].hidden){isHidden=true}}else{colKey=index;if(header===null||header===undefined){header=$("#"+this.grid.element[0].id+"_"+colKey)}index=header.data("columnIndex");if(index===undefined){isHidden=true}}this._curColKey=colKey;expr=this.grid.dataSource.settings.sorting.expressions;s=this._findColumnSetting(colKey);if(this.grid.options.virtualizationMode==="fixed"&&(this.grid.options.virtualization===true||this.grid.options.columnVirtualization===true)){visualIndex=index-this.grid._startColIndex}else{visualIndex=index}if(apiCall&&this._currentActiveHeader){this._currentActiveHeader.removeClass(this.css.sortableColumnHeaderActive)}if(header===null||header===undefined){visualIndex+=this.grid.headersTable().children("thead").children("tr").children("th[data-skip=true]").length;if(colKey){header=$("#"+this.grid.element[0].id+"_"+colKey)}else{header=this.grid.headersTable().children("thead").children("tr").children("th:nth-child("+(visualIndex+1)+")")}apiCall=true}if(s&&s.allowSorting===false){return}if(direction!==null&&direction!==undefined){newDir=direction}else{if(s.currentSortDirection!==undefined&&s.currentSortDirection!==null&&!s.currentSortDirection.startsWith("asc")&&!s.currentSortDirection.startsWith("desc")||s.currentSortDirection===undefined||s.currentSortDirection===null){newDir=s.firstSortDirection===undefined?this.options.firstSortDirection:s.firstSortDirection}else{newDir=s.currentSortDirection!==undefined&&s.currentSortDirection!==null&&s.currentSortDirection.indexOf("asc")!==-1?"descending":"ascending"}}this._trigger("internalcolumnsorting",null,{owner:this});for(i=0;this.grid.options.features&&i<this.grid.options.features.length;i++){if(this.grid.options.features[i]&&this.grid.options.features[i].name==="GroupBy"){groupby=this.grid.element.data("igGridGroupBy");if(groupby&&groupby.options.groupedColumns&&groupby.options.groupedColumns.length>0){reset=false}}}curNewExpr={fieldName:colKey,isSorting:true,dir:newDir.startsWith("asc")?"asc":"desc"};if(this.options.mode==="single"){if(reset){sortingNewExprs=[{fieldName:colKey,isSorting:true,dir:newDir.startsWith("asc")?"asc":"desc"}]}else{sortingNewExprs=[];se=this.grid.dataSource.settings.sorting.expressions;addSE=true;for(i=0;i<se.length;i++){if(se[i].isGroupBy===true){if(se[i].fieldName===colKey){addSE=false}sortingNewExprs.push(se[i])}}if(addSE){sortingNewExprs.push({fieldName:colKey,isSorting:true,dir:newDir.startsWith("asc")?"asc":"desc"})}}}else{sortingNewExprs=expr.slice();for(i=0;i<expr.length;i++){if(sortingNewExprs[i].fieldName===colKey){sortingNewExprs.splice(i,1);break}}sortingNewExprs=sortingNewExprs.concat([{fieldName:colKey,isSorting:true,dir:newDir.startsWith("asc")?"asc":"desc"}])}if(!apiCall){noCancel=this._trigger(this.events.columnSorting,null,{columnKey:colKey,direction:newDir,owner:this,newExpressions:sortingNewExprs})}if(noCancel){s.currentSortDirection=curNewExpr.dir.startsWith("asc")?"ascending":"descending";this._loadingIndicator.show();header.attr("title",s.currentSortDirection.startsWith("asc")?this.options.sortedColumnTooltip.replace("${direction}",$.ig.GridSorting.locale.ascending):this.options.sortedColumnTooltip.replace("${direction}",$.ig.GridSorting.locale.descending));if(this.options.mode==="single"){if(isHidden){this._clearSortStates(header,-1);for(i=0;i<this.grid.options.columns.length;i++){if(this.options.columnSettings[i]&&this.options.columnSettings[i].allowSorting!==false&&this.options.columnSettings[i].columnKey!==colKey){this._clearSortState(header,this.options.columnSettings[i].columnIndex,this.options.columnSettings[i].columnKey)}}}else{this._clearSortStatesByKey(header,colKey)}if(isHidden&&direction!==null&&direction!==undefined){s.currentSortDirection=direction}}this.grid.dataSource.settings.sorting.expressions=sortingNewExprs;noCancel=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid,dataSource:this.grid.dataSource});if(this.grid._hasUnboundColumns&&this.options.type==="remote"){this.grid._rebindUnboundColumns=true}if(noCancel){this._saveSortingExpressions();this.grid.element.trigger("iggriduisoftdirty",{owner:this});this._currentHeader=header;this._curColKey=colKey;if(this.options.type==="remote"){if(!apiCall){this._shouldFireColumnSorted=true}this.grid.dataSource.dataBind()}else{this.grid.dataSource.sort(this.grid.dataSource.settings.sorting.expressions,s.currentSortDirection);this.grid._renderData();if(!apiCall){this._trigger(this.events.columnSorted,null,{columnKey:colKey,direction:s.currentSortDirection,owner:this,expressions:this.grid.dataSource.settings.sorting.expressions})}}this._curSortDir=s.currentSortDirection}}},sortMultiple:function(){var self=this,exprLen,id=self.grid.element[0].id,noCancel,expr=this.grid.dataSource.settings.sorting.expressions;noCancel=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid,dataSource:this.grid.dataSource});if(noCancel){this._currentHeader=null;this._curColKey=null;if(this._currentActiveHeader){this._currentActiveHeader.removeClass(this.css.sortableColumnHeaderActive)}exprLen=expr&&expr.length;if(!exprLen){exprLen=0}$.each(this.grid.options.columns,function(index,column){var i,cs,colKey=column.key,header=$("#"+id+"_"+colKey);for(i=0;i<exprLen;i++){if(expr[i].fieldName===colKey){if(i===exprLen-1){self._currentHeader=header;self._curColKey=colKey}break}}cs=self._findColumnSetting(colKey);if(cs){if(i===exprLen){cs.currentSortDirection=undefined;if(cs.allowSorting!==false){self._clearSortState(header,cs.columnIndex,colKey)}}else{cs.currentSortDirection=expr[i].dir;self._applySortStyles(header,colKey)}}});this.grid.element.trigger("iggriduisoftdirty",{owner:this});if(this._isResetClick===true){this._isResetClick=false}this._saveSortingExpressions();if(this.options.type==="remote"){this.grid.dataSource.dataBind()}else{this.grid.dataSource.sort(this.grid.dataSource.settings.sorting.expressions);this.grid._renderData()}}},clearSorting:function(){var i,se=[],exprs=this.grid.dataSource.settings.sorting.expressions;for(i=0;i<exprs.length;i++){se.push(exprs[i].fieldName)}for(i=0;i<se.length;i++){this.unsortColumn(se[i],undefined)}},unsortColumn:function(index,header){var colKey,expr,noCancel=true,s,i,exprLen,apiCall=header===null||header===undefined;this._activeSortedCol=null;if($.type(index)==="number"){colKey=this.grid.options.columns[index].key}else{colKey=index}expr=this.grid.dataSource.settings.sorting.expressions;s=this._findColumnSetting(colKey);if(s===null||s===undefined){return}if(s&&s.allowSorting===false){return}s.currentSortDirection=undefined;if(s.userSet_currentSortDirection){delete s.userSet_currentSortDirection}exprLen=expr.length;for(i=0;i<expr.length;i++){if(expr[i].fieldName===colKey){expr.splice(i,1);break}}if(i===exprLen){return}this._curColKey=null;this._currentHeader=null;this._applySortStyles($("#"+this.grid.element[0].id+"_"+colKey),index);if(!apiCall&&!(this.grid.dataSource.settings.sorting.expressions.length===0&&this.options.type==="local")){noCancel=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid,dataSource:this.grid.dataSource})}if(noCancel){this.grid.element.trigger("iggriduisoftdirty",{owner:this});this._curColKey=colKey;this._currentHeader=header;if(this.options.type==="remote"){if(!this._loadingIndicator){this._initLoadingIndicator()}this._loadingIndicator.show();if(!apiCall){this._shouldFireColumnSorted=true}this.grid.dataSource.dataBind()}else{if(this.grid.dataSource.settings.sorting.expressions.length===0&&exprLen>0){this.grid.dataBind()}else{this.grid.dataSource.sort(this.grid.dataSource.settings.sorting.expressions);this.grid._renderData()}if(!apiCall){this._trigger(this.events.columnSorted,null,{columnKey:colKey,direction:s.currentSortDirection,owner:this,expressions:this.grid.dataSource.settings.sorting.expressions})}}this._curSortDir=s.currentSortDirection;this._saveSortingExpressions()}},_excludeExpr:function(key){if(this.options.persist&&!this._couldPreserveData()){return}var expr=this.grid.dataSource.settings.sorting.expressions,i;for(i=0;i<expr.length;i++){if(expr[i].fieldName===key){$.ig.removeFromArray(expr,i)}}},_applySortStyles:function(header,columnKey,ignoreActiveSelection){var oldHeight=null,span,col,indicatorContainer,indexResolved,i,currentColumnSetting,toolTip=this.options.sortedColumnTooltip,hasFixedColumns=this.grid.hasFixedColumns(),sortAsc=toolTip.replace("${direction}",$.ig.GridSorting.locale.ascending),sortDesc=toolTip.replace("${direction}",$.ig.GridSorting.locale.descending);if(this.grid.options.fixedHeaders){oldHeight=this.grid.headersTable().outerHeight()}span=header.find(".ui-iggrid-colindicator");if(span.length===0){span=$("<span></span>").addClass(this.css.sortIndicator)}indicatorContainer=header.find(".ui-iggrid-indicatorcontainer");if(indicatorContainer.length===0){indicatorContainer=$("<div></div>").appendTo(header).addClass("ui-iggrid-indicatorcontainer")}indicatorContainer.append(span);indexResolved=this.grid.getVisibleIndexByKey(columnKey,true)+1;if(columnKey!==null&&columnKey!==undefined){for(i=0;i<this.options.columnSettings.length;i++){if(this.options.columnSettings[i].columnKey===columnKey){currentColumnSetting=this.options.columnSettings[i];break}}}if(hasFixedColumns&&this.grid._isFixedElement(header)){col=$("#"+this.element[0].id+"_fixed tbody tr td:nth-child("+indexResolved+")")}else{if(this.grid.options.fixedHeaders!==true){col=header.closest("thead").parent().find("tbody tr:not([data-grouprow]) td:nth-child("+indexResolved+")")}else if(this.options.applySortedColumnCss!==false){col=this.grid.element.find("tr:not([data-grouprow]) td:nth-child("+indexResolved+")")}}this._activeSortedCol=null;if(currentColumnSetting!==undefined&&currentColumnSetting.currentSortDirection!==undefined){if(currentColumnSetting.currentSortDirection.indexOf("asc")!==-1){span.removeClass(this.css.sortIndicatorDescending).addClass(this.css.sortIndicatorAscending);header.removeClass(this.css.descendingColumnHeader).addClass(this.css.ascendingColumnHeader);header.attr("title",sortAsc);header.attr("aria-sort","ascending");header.siblings("th").removeAttr("aria-sort");if(this.options.applySortedColumnCss!==false&&ignoreActiveSelection!==true){this._activeSortedCol={key:currentColumnSetting.columnKey,asc:true};col.removeClass(this.css.descendingColumn).addClass(this.css.ascendingColumn)}}else{span.removeClass(this.css.sortIndicatorAscending).addClass(this.css.sortIndicatorDescending);header.removeClass(this.css.ascendingColumnHeader).addClass(this.css.descendingColumnHeader);header.attr("title",sortDesc);header.attr("aria-sort","descending");header.siblings("th").removeAttr("aria-sort");if(this.options.applySortedColumnCss!==false&&ignoreActiveSelection!==true){this._activeSortedCol={key:currentColumnSetting.columnKey,asc:false};col.removeClass(this.css.ascendingColumn).addClass(this.css.descendingColumn)}}}else{header.attr("title",this.options.unsortedColumnTooltip);header.removeAttr("aria-sort");if(this.grid._isMultiColumnGrid===true){span=header.find(".ui-iggrid-colindicator")}else{span=header.parent("tr").find("th:nth-child("+indexResolved+") .ui-iggrid-colindicator")}span.removeClass(this.css.sortIndicatorAscending).removeClass(this.css.descendingColumnHeader);header.removeClass(this.css.ascendingColumnHeader).removeClass(this.css.descendingColumnHeader)}if(oldHeight!==null&&oldHeight!==this.grid.headersTable().outerHeight()){this.grid._initializeHeights()}},_clearSortStatesByKey:function(header,key){var i,cs=this.options.columnSettings,csLen=cs.length,clearHiddenCols=this.options.mode==="single"&&this.grid._detachedHeaderCells;for(i=0;i<csLen;i++){if(cs[i].allowSorting===false||cs[i].columnKey===key){continue}delete cs[i].currentSortDirection;this._clearSortState(header,cs[i].columnIndex,cs[i].columnKey);if(clearHiddenCols&&cs[i].columnKey&&this.grid._detachedHeaderCells[cs[i].columnKey]){this._clearHeaderCellSortState(this.grid._detachedHeaderCells[cs[i].columnKey][0])}}},_clearSortStates:function(header,index){var i,cs=this.options.columnSettings,realIndex=index,isSingleMode=this.options.mode==="single";for(i=0;i<this.grid.options.columns.length;i++){if(i<index&&this.grid.options.columns[i].hidden){realIndex--}}index=realIndex;for(i=0;i<this.options.columnSettings.length;i++){if(cs[i].allowSorting!==false){if(index!==undefined&&cs[i].columnIndex!==index){delete cs[i].currentSortDirection;this._clearSortState(header,cs[i].columnIndex,cs[i].columnKey)}if(this.grid._detachedHeaderCells&&isSingleMode&&cs[i].columnKey&&this.grid._detachedHeaderCells[cs[i].columnKey]){if(cs[i].currentSortDirection!==undefined&&cs[i].currentSortDirection!==null){delete cs[i].currentSortDirection}this._clearHeaderCellSortState(this.grid._detachedHeaderCells[cs[i].columnKey][0])}}}},_clearSortStateFixing:function(columnKey){var th,id=this.grid.element.attr("id")+"_"+columnKey,visibleIndex=this._columnFixing._getVisibleIndex(columnKey);th=$("#"+id);this._clearSortStateByVisibleIndex(visibleIndex,th)},_clearSortState:function(header,i,columnKey){if(this.grid.hasFixedColumns()&&columnKey!==undefined){this._clearSortStateFixing(columnKey);return}var th,ths,fixedColumnsLength;if(this.grid._isMultiColumnGrid===true){ths=this.grid._headerCells;th=ths[i];if(th===undefined){return}}else{if(this.grid.hasFixedColumns()){fixedColumnsLength=this.grid._fixedColumns.length;if(i<fixedColumnsLength){ths=this.grid.fixedHeadersTable().find("thead > tr").first().find("th").not("[data-skip=true]")}else{ths=this.grid.headersTable().find("thead > tr").first().find("th").not("[data-skip=true]");i-=fixedColumnsLength}th=ths.eq(i)}else{ths=this.grid.headersTable().find("thead > tr").first().find("th").not("[data-skip=true]");th=ths.eq(i)}}this._clearSortStateByVisibleIndex(i,th)},_clearSortStateByVisibleIndex:function(i,th){var spanHeader=th,col;this._clearHeaderCellSortState(spanHeader);if(this.options.columnSettings.length>i&&this.options.columnSettings[i].allowSorting){th.attr("title",this.options.unsortedColumnTooltip)}else{th.attr("title","")}if(this.options.applySortedColumnCss!==false){if(this.grid.options.fixedHeaders!==true){col=th.closest("thead").parent().find("tbody tr td:nth-child("+(i+1)+")")}else{col=this.grid.element.find("tr td:nth-child("+(i+1)+")")}col.removeClass(this.css.descendingColumn).removeClass(this.css.ascendingColumn)}},_clearHeaderCellSortState:function(spanHeader){var span=spanHeader.find(".ui-iggrid-colindicator");if(span.hasClass("ui-iggrid-colindicator-desc")||span.hasClass("ui-iggrid-colindicator-asc")){span.removeClass(this.css.sortIndicatorDescending).removeClass(this.css.sortIndicatorAscending);spanHeader.removeClass(this.css.ascendingColumnHeader).removeClass(this.css.descendingColumnHeader).removeClass(this.css.sortableColumnHeaderFocus)}},_initDefaultSettings:function(suppressUsrOpts){var settings=[],key,cs=this.options.columnSettings,i,j,k,colIndex=0,defaultExpressions=[],defExpLength,isToSkipGroupBySortingExpr=false,dir,allowSorting,isToCheckUnboundColumns=this.grid._hasUnboundColumns===true&&this.options.type==="remote";if(this.grid.dataSource.settings.sorting.expressions!==null&&this.grid.dataSource.settings.sorting.expressions!==undefined){defaultExpressions=this.grid.dataSource.settings.sorting.expressions}defExpLength=defaultExpressions.length;if(this.grid.options.columns&&this.grid.options.columns.length>0){for(i=0;i<this.grid.options.columns.length;i++){allowSorting=true;if(isToCheckUnboundColumns&&this.grid.getUnboundColumnByKey(this.grid.options.columns[i].key)!==null){allowSorting=false}settings[i]={columnIndex:colIndex,columnKey:this.grid.options.columns[i].key,allowSorting:allowSorting};if(this.grid.options.columns[i].hidden!==true){colIndex++}}}for(i=0;i<cs.length;i++){for(key in cs[i]){if(cs[i].hasOwnProperty(key)&&key!=="columnKey"&&key!=="columnIndex"){if(key==="userSet_currentSortDirection"){if(cs[i].userSet_currentSortDirection==="undefined"||cs[i].userSet_currentSortDirection===undefined){delete cs[i].currentSortDirection}else{cs[i].currentSortDirection=cs[i].userSet_currentSortDirection}}else if(key==="userSet_allowSorting"){cs[i].allowSorting=cs[i][key];delete cs[i][key]}}}}if(settings.length===0&&this.grid.options.autoGenerateColumns&&cs.length>0){for(i=0;i<cs.length;i++){if(!cs[i].columnKey||typeof cs[i].currentSortDirection!=="string"){continue}dir=cs[i].currentSortDirection.startsWith("asc")?"asc":"desc";defaultExpressions.push({fieldName:cs[i].columnKey,isSorting:true,dir:dir})}}else{for(i=0;i<cs.length;i++){for(j=0;j<settings.length;j++){if(settings[j].columnKey!==null&&settings[j].columnKey!==undefined&&cs[i].columnKey!==null&&cs[i].columnKey!==undefined){if(settings[j].columnKey===cs[i].columnKey){break}}else if(settings[j].columnIndex===cs[i].columnIndex){break}}if(j===settings.length){continue}for(key in cs[i]){if(cs[i].hasOwnProperty(key)&&key!=="columnKey"&&key!=="columnIndex"&&!key.startsWith("userSet")){settings[j][key]=cs[i][key];if(!suppressUsrOpts){settings[j]["userSet_"+key]=cs[i][key]}if(key==="currentSortDirection"&&cs[i][key]){if($.type(settings[j].columnKey)!=="number"){isToSkipGroupBySortingExpr=false;if(defExpLength>0){for(k=0;k<defExpLength;k++){if(defaultExpressions[k].fieldName===settings[j].columnKey){if(defaultExpressions[k].isGroupBy===true){isToSkipGroupBySortingExpr=true}else{defaultExpressions.splice(k,1)}break}}}if(isToSkipGroupBySortingExpr===true){continue}defaultExpressions.push({fieldName:settings[j].columnKey,isSorting:true,dir:cs[i][key].startsWith("asc")?"asc":"desc"})}else{defaultExpressions.push({fieldIndex:settings[j].columnKey,isSorting:true,dir:cs[i][key].startsWith("asc")?"asc":"desc"})}}}}}}for(i=0;i<settings.length;i++){if(!settings[i].hasOwnProperty("currentSortDirection")){settings[i].userSet_currentSortDirection="undefined"}for(j=0;j<this.grid.dataSource.settings.sorting.expressions.length;j++){if(this.grid.dataSource.settings.sorting.expressions[j].fieldName===settings[i].columnKey){settings[i].currentSortDirection=this.grid.dataSource.settings.sorting.expressions[j].dir}}}this.options.columnSettings=settings;this.grid.dataSource.settings.sorting.expressions=defaultExpressions;this.grid.dataSource.settings.sorting.defaultFields=defaultExpressions},_headerCellRendered:function(event,ui){var cs=this._findColumnSetting(ui.columnKey),i,col,initialSorting,featureChooserInstance=this.grid.element.data("igGridFeatureChooser");if(event.target.id!==this.grid.element[0].id){return}if(ui.isMultiColumnHeader===true){return}if(ui.columnKey&&cs){this._headers.push({header:ui.th,index:cs.columnIndex});if(cs.allowSorting!==false){ui.th.addClass(this.css.sortableColumnHeader);if(cs.currentSortDirection===undefined||cs.currentSortDirection===null){ui.th.attr("title",this.options.unsortedColumnTooltip)}else{ui.th.attr("title",cs.currentSortDirection.startsWith("asc")?this.options.sortedColumnTooltip.replace("${direction}",$.ig.GridSorting.locale.ascending):this.options.sortedColumnTooltip.replace("${direction}",$.ig.GridSorting.locale.descending))}$("<span></span>").appendTo(ui.th).addClass(this.css.sortIndicator);if(cs.currentSortDirection!==undefined){this._applySortStyles(ui.th,cs.columnKey)}}}if(!this._featureChooserInitialized&&featureChooserInstance&&this.renderInFeatureChooser){this._featureChooserInitialized=true;if(this._featureChooserMenuTogglingHandler){this.grid.element.unbind("iggridfeaturechoosermenutoggling",this._featureChooserMenuTogglingHandler)}this._featureChooserMenuTogglingHandler=$.proxy(this._featureChooserMenuToggling,this);this.grid.element.bind("iggridfeaturechoosermenutoggling",this._featureChooserMenuTogglingHandler);if(featureChooserInstance._isTouchDevice()){for(i=0;i<this.grid.options.columns.length;i++){col=this.grid.options.columns[i];cs=this._getColumnSettingsByIndex(i);if(cs.allowSorting){if(featureChooserInstance&&featureChooserInstance._shouldRenderInFeatureChooser(col.key)===true){initialSorting=cs.currentSortDirection;if(initialSorting===null){initialSorting=false}featureChooserInstance._renderInFeatureChooser(col.key,{name:"SortingAscending",text:this.options.featureChooserSortAsc,textHide:this.options.featureChooserSortAsc,iconClass:this.css.fcSortIndicatorAscending,iconClassOff:this.css.fcSortIndicatorAscending,isSelected:initialSorting&&typeof initialSorting==="string"?initialSorting.toLowerCase().indexOf("asc")>-1:false,method:$.proxy(this._sortAscFromFeatureChooser,this),updateOnClickAll:false,groupName:"toggle",groupOrder:1,order:0,type:"toggle"});
featureChooserInstance._renderInFeatureChooser(col.key,{name:"SortingDescending",text:this.options.featureChooserSortDesc,textHide:this.options.featureChooserSortDesc,iconClass:this.css.fcSortIndicatorDescending,iconClassOff:this.css.fcSortIndicatorDescending,isSelected:initialSorting&&typeof initialSorting==="string"?initialSorting.toLowerCase().indexOf("desc")>-1:false,method:$.proxy(this._sortDescFromFeatureChooser,this),updateOnClickAll:false,groupName:"toggle",groupOrder:1,order:0,type:"toggle"})}}}}if(this.options.mode!=="single"){for(i=0;i<this.grid.options.columns.length;i++){col=this.grid.options.columns[i];if(this._getColumnSettingsByIndex(i).allowSorting){if(featureChooserInstance._shouldRenderInFeatureChooser(col.key)===true){featureChooserInstance._renderInFeatureChooser(col.key,{name:"MultipleSorting",text:this.options.featureChooserText,iconClass:this.css.featureChooserModalDialogIcon,method:$.proxy(this.openMultipleSortingDialog,this),groupName:"modaldialog",groupOrder:3,order:2})}}}}}},_featureChooserMenuToggling:function(event,args){var i,expr,isAsc,hasSorting=false,columnKey=args.columnKey,featureChooserInstance=this.grid.element.data("igGridFeatureChooser"),exprs=this.grid.dataSource.settings.sorting.expressions,exprsLength=exprs.length;if(!args.isVisible){for(i=0;i<exprsLength;i++){expr=exprs[i];if(expr.fieldName===columnKey){hasSorting=true;isAsc=false;if(expr.dir&&expr.dir.toLowerCase().indexOf("asc")>-1){isAsc=true}featureChooserInstance._setSelectedState("SortingDescending",columnKey,!isAsc,false);featureChooserInstance._setSelectedState("SortingAscending",columnKey,isAsc,false)}}if(!hasSorting){featureChooserInstance._setSelectedState("SortingDescending",columnKey,false,false);featureChooserInstance._setSelectedState("SortingAscending",columnKey,false,false)}}},_sortAscFromFeatureChooser:function(event,columnKey,isSelected){var featureChooserInstance=this.grid.element.data("igGridFeatureChooser"),gridId=this.grid.id(),$th=$("#"+gridId+"_"+columnKey);if(!featureChooserInstance){return}featureChooserInstance._setSelectedState("SortingDescending",columnKey,false,false);if(isSelected){this.sortColumn(columnKey,"asc",$th)}else{this.unsortColumn(columnKey,$th)}},_sortDescFromFeatureChooser:function(event,columnKey,isSelected){var featureChooserInstance=this.grid.element.data("igGridFeatureChooser"),gridId=this.grid.id(),$th=$("#"+gridId+"_"+columnKey);featureChooserInstance._setSelectedState("SortingAscending",columnKey,false,false);if(!featureChooserInstance){return}if(isSelected){this.sortColumn(columnKey,"desc",$th)}else{this.unsortColumn(columnKey,$th)}},_columnFixed:function(args){var i,colInd=args.colInd,cs,fixedTable=this.grid.fixedHeadersTable(),at=args.at,isAttachedSortingHandlers=false,fixedColumnsLength=args.fixedColsCount;isAttachedSortingHandlers=fixedTable.data("attachedSortingHandlers");if(isAttachedSortingHandlers!==true){fixedTable.data("attachedSortingHandlers",true);fixedTable.delegate("thead th",{click:this._clickHandler,mouseover:this._mouseOverHandler,mouseout:this._mouseOutHandler})}cs=this.options.columnSettings[colInd];if(cs){if(at===undefined){at=fixedColumnsLength-1}this.options.columnSettings.splice(colInd,1);this.options.columnSettings.splice(at,0,cs)}for(i=0;i<this.options.columnSettings.length;i++){this.options.columnSettings[i].columnIndex=i}},_columnsRearranged:function(){this._initDefaultSettings(true)},_columnMap:function(){var self=this,isMultiple=self.options.mode!=="single";return $.map(this.grid.options.columns,function(col,index){var allowSorting=false;if(isMultiple&&self._getColumnSettingsByIndex(index).allowSorting){allowSorting=true}return{columnKey:col.key,enabled:allowSorting}})},_findColumnSetting:function(key){var i;for(i=0;i<this.options.columnSettings.length;i++){if(this.options.columnSettings[i].columnKey===key){return this.options.columnSettings[i]}}},_dataRendered:function(){var i,cs,expr,col,colKey,gridId=this.grid.element[0].id,ignoreActiveSelection;if(!this._loadingIndicator){this._initLoadingIndicator()}expr=this._sortingExpressions;if(this._shouldFireColumnSorted){this._trigger(this.events.columnSorted,null,{columnKey:this._curColKey,direction:this._curSortDir,owner:this,expressions:this.grid.dataSource.settings.sorting.expressions});this._shouldFireColumnSorted=false}this._loadingIndicator.hide();if(this._curColKey!==undefined&&this._curColKey!==null&&this._currentHeader!==undefined&&this._currentHeader!==null){this._applySortStyles(this._currentHeader,this._curColKey)}else if(this.options.persist&&this._restoreSorting&&expr&&expr.length>0){for(i=0;i<expr.length;i++){if(expr[i].isGroupBy){continue}colKey=expr[i].fieldName;cs=this._findColumnSetting(colKey);if(cs){cs.currentSortDirection=expr[i].dir}ignoreActiveSelection=true;col=$("#"+gridId+"_"+colKey);if(i===expr.length-1){col.addClass(this.css.sortableColumnHeaderActive);this._currentActiveHeader=col;ignoreActiveSelection=false;this._curColKey=colKey}this._applySortStyles(col,colKey,ignoreActiveSelection)}this._restoreSorting=false}if(this._hc===undefined){this._hc=this.grid.container().find(".ui-iggrid-expandheadercell").length>0}if((this.grid.options.rowVirtualization||this.grid.options.virtualization)&&!this.grid._persistVirtualScrollTop){$("#"+this.grid.element.attr("id")+"_scrollContainer").scrollTop(0)}},_onUIDirty:function(e,args){if(this.options.persist&&this.options.type==="remote"){return}var i,j,exprs=this.grid.dataSource.settings.sorting.expressions,defaultExprs=this.grid.dataSource.settings.sorting.defaultFields,cs=this.options.columnSettings,skip=false;if(args.owner===this||args.owner.element[0].id!==this.element[0].id){return}this._curColKey=null;this._currentHeader=null;this._clearUi(true);for(i=0;i<exprs.length;i++){skip=false;for(j=0;j<cs.length;j++){if(cs[j].columnKey===exprs[i].fieldName&&cs[j].userSet_currentSortDirection){skip=true;break}}if(!skip){if(exprs.length>i){$.ig.removeFromArray(exprs,i)}if(defaultExprs.length>i){$.ig.removeFromArray(defaultExprs,i)}}}},_clearUi:function(){var i,header,csd,isMCH=this.grid._isMultiColumnGrid,persist=this.options.persist;for(i=0;this._headers&&i<this._headers.length;i++){csd=this.options.columnSettings[i].userSet_currentSortDirection;if((isMCH||persist)&&this.options.columnSettings[i].columnKey){header=$("#"+this.grid.element[0].id+"_"+this.options.columnSettings[i].columnKey)}else{header=this._headers[i].header}if(csd===undefined||csd===null||csd==="undefined"){this._clearSortState(header,i,this.options.columnSettings[i].columnKey);if(this.options.mode!=="single"){delete this.options.columnSettings[i].currentSortDirection;this._excludeExpr(this.options.columnSettings[i].columnKey)}}else{this._applySortStyles(header,this.options.columnSettings[i].columnKey)}header.removeClass(this.css.sortableColumnHeaderActive).removeClass(this.css.sortableColumnHeaderHover).addClass(this.grid.css.headerClass);if(this.options.columnSettings[i].allowSorting){header.addClass(this.css.sortableColumnHeader)}}},_virtualHorizontalScroll:function(event,args){var start=args.startColIndex,end=args.endColIndex,i,j,cs=this.options.columnSettings,header,ths=this.grid.headersTable().find("thead > tr").first().find("th").not("[data-skip=true]"),visibleColumns=this.grid._visibleColumns();for(i=0;i<ths.length;i++){header=ths.eq(i);this._clearSortState(header,i);header.removeClass(this.css.sortableColumnHeaderActive).removeClass(this.css.sortableColumnHeaderHover).addClass(this.grid.css.headerClass).addClass(this.css.sortableColumnHeader)}for(i=start;i<=end;i++){header=ths.eq(i-start);header.data("columnIndex",i);for(j=0;j<cs.length;j++){if(cs[j].currentSortDirection&&cs[j].columnKey===visibleColumns[i].key){this._applySortStyles(header,cs[j].columnKey)}}}},_columnsCollectionModified:function(event,args){if(args.owner.element.attr("id")!==this.grid.element.attr("id")){return}var i,j,found,colKey,cs,col;for(i=0;i<this.options.columnSettings.length;i++){j=0;found=false;for(j=0;j<this.grid._visibleColumns().length;j++){if(this.grid._visibleColumns()[j].key===this.options.columnSettings[i].columnKey){found=true;colKey=this.grid._visibleColumns()[j].key;break}}if(found){this.options.columnSettings[i].columnIndex=j;cs=this._findColumnSetting(colKey);if(cs&&cs.currentSortDirection!==undefined&&this.options.applySortedColumnCss!==false){col=$("#"+this.grid.element[0].id+"_"+colKey);this._applySortStyles(col,colKey,true)}}}if(this._curColKey){col=$("#"+this.grid.element[0].id+"_"+this._curColKey);this._applySortStyles(col,this._curColKey)}$("#"+this.element[0].id+" thead th").removeClass(this.css.sortableColumnHeaderHover)},_detachEvents:function(){if(this._headerCellRenderedHandler){this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler)}if(this._virtualHorizontalScrollHandler){this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler)}if(this._uiDirtyHandler){this.grid.element.unbind("iggriduidirty",this._uiDirtyHandler)}if(this._headerRenderedHandler){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler)}if(this._columnsCollectionModifiedHandler){this.grid.element.unbind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler)}if(this._columnsRearangedHandler){this.grid.element.unbind("iggrid_columnsmoved",this._columnsRearangedHandler)}if(this._featureChooserMenuTogglingHandler){this.grid.element.unbind("iggridfeaturechoosermenutoggling",this._featureChooserMenuTogglingHandler)}},destroy:function(){var i,a,fc,header,span,text,modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog");if(!this.grid){return}$("#"+this.element[0].id+" thead th").unbind("dragstart",this._dragStartHandler);$("#"+this.element[0].id+"_headers thead th").unbind("dragstart",this._dragStartHandler);$(document).undelegate("#"+this.element[0].id+"_headers thead th",{click:this._clickHandler,mouseover:this._mouseOverHandler,mouseout:this._mouseOutHandler});$("#"+this.element[0].id).undelegate("thead th",{click:this._clickHandler,mouseover:this._mouseOverHandler,mouseout:this._mouseOutHandler});$("#"+this.element[0].id).undelegate("thead th",{keydown:this._keyDownHandler,focus:this._focusHandler,blur:this._blurHandler});$(document).undelegate("#"+this.element[0].id+"_headers thead th",{keydown:this._keyDownHandler,focus:this._focusHandler,blur:this._blurHandler});this._detachEvents();delete this._blurHandler;delete this._clickHandler;delete this._headerCellRenderedHandler;delete this._focusHandler;delete this._keyDownHandler;delete this._mouseOutHandler;delete this._mouseOverHandler;delete this._dragStartHandler;delete this._uiDirtyHandler;delete this._virtualHorizontalScrollHandler;delete this._headerRenderedHandler;delete this._columnsRearangedHandler;this.grid.element.find(".ui-iggrid-colasc").removeClass("ui-iggrid-colasc ui-state-highlight");this.grid.element.find(".ui-iggrid-coldesc").removeClass("ui-iggrid-coldesc ui-state-highlight");this._clearUi(true);for(i=0;this._headers&&i<this._headers.length;i++){header=this._headers[i].header;header.removeClass("ui-iggrid-sortableheader ui-state-default ui-state-active ui-state-hover ui-state-focus");header.attr("title","");span=header.find("a span");text=span.text();a=header.find("a:not([th-remove-focus])");$("<span>"+text+"</span>").appendTo(header).addClass("ui-iggrid-headertext");a.remove()}fc=this.grid.element.data("igGridFeatureChooser");if(fc&&this.renderInFeatureChooser){fc._removeFeature("SortingAscending");fc._removeFeature("SortingDescending");fc._removeFeature("MultipleSorting")}this._headers=null;if(this._loadingIndicator){delete this._loadingIndicator}modalDialog.igGridModalDialog("getCaptionButtonContainer");modalDialog.remove();$.Widget.prototype.destroy.apply(this,arguments);return this},_renderMultipleSortingDialog:function(){var $buttonOK,containment,self=this,o=this.options,modalDialogId=this.grid.element[0].id+"_multiplesorting_modalDialog",$captionButtonContainer,modalDialog;if(this.options.sortingDialogContainment==="owner"){containment=this.grid.container()}else{containment="window"}$("#"+modalDialogId).remove();modalDialog=$("<div></div>").appendTo(this.grid._rootContainer()).attr("id",modalDialogId);modalDialog.igGridModalDialog({containment:containment,buttonApplyText:o.modalDialogButtonApplyText,buttonCancelText:o.modalDialogButtonCancelText,renderFooterButtons:!o.modalDialogSortOnClick,modalDialogCaptionText:o.modalDialogCaptionText,modalDialogWidth:o.modalDialogWidth,modalDialogHeight:o.modalDialogHeight,animationDuration:o.modalDialogAnimationDuration,gridContainer:this.grid.container(),modalDialogOpening:function(event,args){var noCancel=self._trigger(self.events.modalDialogOpening,null,{modalDialogElement:modalDialog,owner:self});if(noCancel){self._multiplesortingDialogOpening(event,args);self._trigger(self.events.modalDialogOpened,null,{modalDialogElement:modalDialog,owner:self})}return noCancel},modalDialogMoving:function(e,ui){self._trigger(self.events.modalDialogMoving,null,{modalDialogElement:e.target,owner:self,originalPosition:ui.originalPosition,position:ui.position})},modalDialogClosing:function(){return self._trigger(self.events.modalDialogClosing,null,{modalDialogElement:modalDialog,owner:self})},modalDialogClosed:function(){self._trigger(self.events.modalDialogClosed,null,{modalDialogElement:modalDialog,owner:self})}});if(o.modalDialogSortOnClick){$captionButtonContainer=modalDialog.igGridModalDialog("getCaptionButtonContainer");$("<span></span>").bind("click.hiding",function(event){modalDialog.igGridModalDialog("closeModalDialog",true);event.preventDefault();event.stopPropagation();return false}).addClass("ui-icon ui-icon-closethick").appendTo($("<a></a>").appendTo($captionButtonContainer).attr("title",$.ig.GridHiding.locale.columnChooserCloseButtonTooltip).attr("href","#").attr("role","button").addClass("ui-dialog-titlebar-close ui-corner-all"))}else{$captionButtonContainer=modalDialog.igGridModalDialog("getCaptionButtonContainer");$buttonOK=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog_footer_buttonok");$buttonOK.bind("igbuttonclick",function(e){self._multiplesortingDialogButtonOKClick(e);e.preventDefault()})}},openMultipleSortingDialog:function(){var modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog");modalDialog.igGridModalDialog("openModalDialog")},closeMultipleSortingDialog:function(){var modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog");modalDialog.igGridModalDialog("closeModalDialog")},_multiplesortingDialogOpening:function(){this._tempExpr=this.grid.dataSource.settings.sorting.expressions.slice(0);this.renderMultipleSortingDialogContent(true)},renderMultipleSortingDialogContent:function(isToCallEvents){var $content,$sortedColumns,$unsortedColumns,i,j,noCancel=true,self=this,columns=this.grid.options.columns,css=this.css,se=this.grid.dataSource.settings.sorting.expressions,seLength=se.length,sortedColumns=[],modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog");if(isToCallEvents){noCancel=this._trigger(this.events.modalDialogContentsRendering,null,{modalDialogElement:modalDialog,owner:this})}if(noCancel){this.removeDialogClearButton();$content=modalDialog.igGridModalDialog("getContent");$content.empty();$sortedColumns=$("<div></div>").attr("id",this.grid.element[0].id+"_multiplesorting_modalDialog_sortedcolumns").addClass(css.dialogSortedColumns).appendTo($content);$unsortedColumns=$("<div></div>").attr("id",this.grid.element[0].id+"_multiplesorting_modalDialog_unsortedcolumns").addClass(css.dialogUnsortedColumns).appendTo($content);$("<ul></ul>").addClass(css.dialogSortedColumnsList).appendTo($sortedColumns);$("<ul></ul>").addClass(css.dialogUnsortedColumnsList).appendTo($unsortedColumns);$.each(columns,function(columnIndex,column){var cs,columnIdentifier,direction;cs=self._getColumnSettingsByIndex(columnIndex);if(cs===null||cs===undefined||cs.allowSorting===false){return true}columnIdentifier=cs.columnKey||cs.columnIndex||column.key;for(i=0;i<self._tempExpr.length;i++){if(self._tempExpr[i].fieldName===columnIdentifier){break}}if(i!==self._tempExpr.length){sortedColumns.push({column:column,columnIndex:cs.columnIndex,dir:self._tempExpr[i].dir,columnIdentifier:columnIdentifier})}else{direction=cs.currentSortDirection||cs.firstSortDirection||self.options.firstSortDirection;self._renderDialogUnsortedColumn(column,cs.columnIndex,direction,columnIdentifier)}});for(i=0;i<seLength;i++){for(j=0;j<sortedColumns.length;j++){if(se[i].fieldName===sortedColumns[j].columnIdentifier){self._renderDialogSortedColumn(sortedColumns[j].column,sortedColumns[j].columnIndex,sortedColumns[j].dir,sortedColumns[j].columnIdentifier);break}}}if(isToCallEvents){this._trigger(this.events.modalDialogContentsRendered,null,{modalDialogElement:modalDialog,owner:this})}if(this._checkRenderButtonReset()){this._renderDialogButtonClearAll()}}},_addSlideButtonSortingColumns:function(){var css=this.css,o=this.options,$sortedColumns=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog_sortedcolumns"),buttonId=this.grid.element[0].id+"_multiplesorting_modalDialog_slidebutton",$button,innerHTML;innerHTML='<div class="'+css.dialogSlideArea+'">'+'	<div class="'+css.dialogSlideAreaContainer+'">'+'		<button id="'+buttonId+'" class="'+css.dialogButtonSlide+'" role="button" aria-disabled="false" title="'+o.dialogButtonSlideCaption+'">'+'			<span class="'+css.dialogButtonSlideContainer+'"></span>'+'			<span class="ui-button-text">'+o.dialogButtonSlideCaption+"</span>"+"		</button>"+"	</div>"+"</div>";$(innerHTML).insertAfter($sortedColumns);$button=$("#"+buttonId);$button.bind({click:function(){$sortedColumns.slideToggle("slow");$(this).find("span:eq(0)").toggleClass(css.dialogButtonSlideUp);return false}})},_renderDialogSortedColumn:function(column,columnIndex,direction,columnIdentifier){var self=this,$li,css=this.css,$buttonUnsort,liHTML,o=this.options,buttonAscDescId=this.grid.element[0].id+"_"+columnIdentifier+"_multiplesorting_modalDialog_sortedcolumns_buttonascdesc",buttonUnsortId=this.grid.element[0].id+"_"+columnIdentifier+"_multiplesorting_modalDialog_sortedcolumns_buttonunsort",$ul=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog_sortedcolumns ul");$ul.css("width");$li=$('<li  tabIndex="0"></li>').attr("id",self.grid.element[0].id+"_"+columnIdentifier+"_multiplesorting_sorted_li").addClass(css.dialogSortedColumnsItem);$li.appendTo($ul);if(columnIndex!==null&&columnIndex!==undefined){$li.attr("li-order",columnIndex)}liHTML='<span id="'+buttonAscDescId+'" class="'+css.dialogButtonAsc+'" role="button" title="'+o.modalDialogCaptionButtonDesc+'" >'+'	<span class="'+css.dialogButtonAscIcon+'"></span>'+"</span>"+'<span class="'+css.dialogSortedColumnTextContainer+'">'+column.headerText+"</span>"+'<button id="'+buttonUnsortId+'" class="'+css.dialogButtonUnsort+'" role="button" title="'+o.modalDialogCaptionButtonUnsort+'" >'+'	<span class="'+css.dialogButtonUnsortContainer+'"></span>'+'	<span class="ui-button-text">'+o.modalDialogCaptionButtonUnsort+"</span>"+"</button>";$li.bind({click:function(e){self._curColKey=columnIdentifier;self._dialogButtonAscDescClick(columnIdentifier);if(self._checkRenderButtonReset()){self._renderDialogButtonClearAll()}else{self.removeDialogClearButton()}e.preventDefault();e.stopPropagation()}});$li.html(liHTML);$buttonUnsort=$("#"+buttonUnsortId);if(direction!==undefined){if(direction.indexOf("asc")!==-1){self._setDialogButtonAscDesc(true,columnIdentifier);self._setTempExpr(columnIdentifier,"asc")}else{self._setDialogButtonAscDesc(false,columnIdentifier);self._setTempExpr(columnIdentifier,"desc")}}else{self._setDialogButtonAscDesc(true,columnIdentifier);self._setTempExpr(columnIdentifier,"asc")}$buttonUnsort.bind({keydown:function(e){if(e.keyCode===$.ui.keyCode.ENTER||e.keyCode===$.ui.keyCode.SPACE){e.target.click();e.preventDefault();e.stopPropagation()}},click:function(e){var noCancel,gridId=self.grid.element[0].id,$nextLi,modalDialog=$("#"+gridId+"_multiplesorting_modalDialog");noCancel=self._trigger(self.events.modalDialogButtonUnsortClick,e,{modalDialogElement:modalDialog,owner:self,columnKey:columnIdentifier});if(noCancel){$li.remove();if(o.modalDialogSortOnClick===true){self.unsortColumn(columnIdentifier,$("#"+gridId+"_"+columnIdentifier))}else{self._setTempExpr(columnIdentifier)}$nextLi=self._renderDialogUnsortedColumn(column,columnIndex,direction,columnIdentifier);$nextLi.find(":focusable").first().focus(1);if(self._checkRenderButtonReset()){self._renderDialogButtonClearAll()}else{self.removeDialogClearButton()}}e.preventDefault();e.stopPropagation()},mouseover:function(){if(!$(this).hasClass(css.dialogButtonsHover)){$(this).addClass(css.dialogButtonsHover)}},mouseout:function(){if($(this).hasClass(css.dialogButtonsHover)){$(this).removeClass(css.dialogButtonsHover)}}});return $li},_dialogButtonAscDescClick:function(columnIdentifier){var o=this.options,noCancel,modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog"),$buttonAscDesc=$("#"+this.grid.element[0].id+"_"+columnIdentifier+"_multiplesorting_modalDialog_sortedcolumns_buttonascdesc"),isAsc=$buttonAscDesc.data("isAsc");noCancel=this._trigger(this.events.modalDialogSortingChanged,null,{modalDialogElement:modalDialog,owner:this,columnKey:columnIdentifier,isAsc:!isAsc});if(noCancel){if(isAsc===true){if(o.modalDialogSortOnClick===true){this.sortColumn(columnIdentifier,"descending",this._getHeaderCellByIdentifier(columnIdentifier))}else{this._setTempExpr(columnIdentifier,"desc")}this._setDialogButtonAscDesc(false,columnIdentifier)}else{if(o.modalDialogSortOnClick===true){this.sortColumn(columnIdentifier,"ascending",this._getHeaderCellByIdentifier(columnIdentifier))}else{this._setTempExpr(columnIdentifier,"asc")}this._setDialogButtonAscDesc(true,columnIdentifier)}}},_setDialogButtonAscDesc:function(isAsc,columnIdentifier){var css=this.css,buttonAscDescId=this.grid.element[0].id+"_"+columnIdentifier+"_multiplesorting_modalDialog_sortedcolumns_buttonascdesc",$buttonAscDesc=$("#"+buttonAscDescId),$spanIcon=$buttonAscDesc.find("span:eq(0)");$buttonAscDesc.data("isAsc",isAsc);if(isAsc===true){$buttonAscDesc.attr("title",this.options.modalDialogCaptionButtonDesc).removeClass(css.dialogButtonDesc).addClass(css.dialogButtonAsc);$spanIcon.removeClass(css.dialogButtonDescIcon).addClass(css.dialogButtonAscIcon);this._setTempExpr(columnIdentifier,"asc")}else{$buttonAscDesc.attr("title",this.options.modalDialogCaptionButtonAsc).removeClass(css.dialogButtonAsc).addClass(css.dialogButtonDesc);$spanIcon.removeClass(css.dialogButtonAscIcon).addClass(css.dialogButtonDescIcon);this._setTempExpr(columnIdentifier,"desc")}},_setTempExpr:function(colKey,dir){var i,expr=this._tempExpr;for(i=0;i<expr.length;i++){if(expr[i].fieldName===colKey){expr.splice(i,1);if(dir===null||dir===undefined){this._tempExpr=expr;return}}}this._tempExpr=expr.concat([{fieldName:colKey,isSorting:true,dir:dir}])},_renderDialogUnsortedColumn:function(column,columnIndex,direction,columnIdentifier){var self=this,$li,$a,o=this.options,css=this.css,$ul=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog_unsortedcolumns ul");$ul.css("width");$li=$("<li></li>").attr("id",self.grid.element[0].id+"_"+columnIdentifier+"_multiplesorting_unsorted_li").addClass(css.dialogUnsortedColumnsItem).append('<span class="'+css.dialogUnsortedColumnsSortByButton+'"><a href="#"></a></span> <span class="'+css.dialogItemText+'">'+column.headerText+"</span>");this._insertColumnModalDialog($ul,$li,columnIndex);if(columnIndex!==null&&columnIndex!==undefined){$li.attr("li-order",columnIndex)}$a=$li.find("a:first");$a.addClass(css.modalDialogSortByColumn);$a.html(o.modalDialogSortByButtonText);$li.bind({keydown:function(e){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){$li.click();e.preventDefault();e.stopPropagation()}},click:function(e){var noCancel,modalDialog=$("#"+self.grid.element[0].id+"_multiplesorting_modalDialog"),$nextLi;noCancel=self._trigger(self.events.modalDialogSortClick,e,{modalDialogElement:modalDialog,owner:self,columnKey:columnIdentifier});if(noCancel){$li.remove();$nextLi=self._renderDialogSortedColumn(column,columnIndex,direction,columnIdentifier);$nextLi.find(":focusable").first().focus(1);if(o.modalDialogSortOnClick){self.sortColumn(columnIdentifier,null,self._getHeaderCellByIdentifier(columnIdentifier))}else{if(self._checkRenderButtonReset()){self._renderDialogButtonClearAll()}else{self.removeDialogClearButton()}}}e.preventDefault();e.stopPropagation()}});return $li},_checkRenderButtonReset:function(){var i,j,cs,columnKey,expr=this._tempExpr;this._isResetClick=false;for(i=0;i<this.options.columnSettings.length;i++){cs=this.options.columnSettings[i];if(cs.allowSorting===false){continue}columnKey=cs.columnKey;for(j=0;j<expr.length;j++){if(expr[j].fieldName===columnKey){if(cs.userSet_currentSortDirection!==expr[j].dir){return true}break}}if(j===expr.length&&cs.userSet_currentSortDirection!=="undefined"&&cs.userSet_currentSortDirection!==undefined){return true}}this._isResetClick=true;return false},removeDialogClearButton:function(){$("#"+this.grid.element[0].id+"_sorting_modalDialog_reset_button").remove()},_renderDialogButtonClearAll:function(){if(this.options.modalDialogSortOnClick===true){return}var self=this,o=this.options,resetButtonId=self.grid.element[0].id+"_sorting_modalDialog_reset_button",modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog"),$captionButtonContainer,$resetButton;if($("#"+resetButtonId).length===0){$captionButtonContainer=modalDialog.igGridModalDialog("getCaptionButtonContainer");$resetButton=$("<button></button>").attr("id",resetButtonId).appendTo($captionButtonContainer);$resetButton.igButton({labelText:o.modalDialogResetButtonLabel,click:function(e){var noCancel,i,cs=self.options.columnSettings;noCancel=self._trigger(self.events.modalDialogButtonResetClick,e,{modalDialogElement:modalDialog,owner:self});if(noCancel){self._tempExpr=[];for(i=0;i<cs.length;i++){if(cs[i].allowSorting!==false&&cs[i].userSet_currentSortDirection!=="undefined"&&cs[i].userSet_currentSortDirection!==undefined){self._tempExpr.push({fieldName:cs[i].columnKey,isSorting:true,dir:cs[i].userSet_currentSortDirection})}}self.renderMultipleSortingDialogContent(false);self.removeDialogClearButton();self._isResetClick=true}}})}},_multiplesortingDialogButtonOKClick:function(){var noCancel,modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog");noCancel=this._trigger(this.events.modalDialogButtonApplyClick,null,{modalDialogElement:modalDialog,owner:this,columnsToSort:this._tempExpr});if(noCancel){this.grid.dataSource.settings.sorting.expressions=this._tempExpr;this.sortMultiple();modalDialog.igGridModalDialog("closeModalDialog")}},_insertColumnModalDialog:function($ul,$li,pos){var i,$currLi,currPos,listItems=$ul.find("li"),listItemsLength=listItems.length;if(listItemsLength===0||pos===null||pos===undefined){$li.appendTo($ul);return}for(i=0;i<listItemsLength;i++){$currLi=$(listItems[i]);currPos=$currLi.attr("li-order");if(currPos>=pos){$li.insertBefore($currLi);break}}if(i===listItemsLength){$li.appendTo($ul)}},_getColumnSettings:function(index,key){var i,foundByIndex=null;for(i=0;i<this.options.columnSettings.length;i++){if(this.options.columnSettings[i].columnKey===key){foundByIndex=this.options.columnSettings[i];break}if(this.options.columnSettings[i].columnIndex===index){foundByIndex=this.options.columnSettings[i];break}}return foundByIndex},_getColumnSettingsByIndex:function(index){var key=this.grid.options.columns[index].key;return this._getColumnSettings(index,key)},_headerRendered:function(event,ui){if(ui.owner.element.attr("id")!==this.grid.element.attr("id")){return}if(this.grid.element.data("igGridResizing")){this._resizing=this.grid.element.data("igGridResizing")}if(!this._columnFixing&&this.grid.element.data("igGridColumnFixing")){this._columnFixing=this.grid.element.data("igGridColumnFixing")}if(this.options.mode!=="single"){this._renderMultipleSortingDialog()}},_getDataColumnSortingExpressions:function(se){if(!this.grid._hasUnboundColumns){return se}var grid=this.grid,newSE;newSE=$.grep(se,function(s){var col=grid.columnByKey(s.fieldName);return!col||col.unbound!==true});return newSE},_saveSortingExpressions:function(){if(this.options.persist){var se;if(this._restoreSorting===undefined||this._restoreSorting){$.each(this.options.columnSettings,function(i,setting){delete setting.userSet_currentSortDirection})}se=this._getDataColumnSortingExpressions(this.grid.dataSource.settings.sorting.expressions);this.grid._savePersistenceData(se,"sorting",this.grid.element[0].id);this._sortingExpressions=se;this._restoreSorting=false}},_preserveSorting:function(){var se=this.grid._getPersistenceData("sorting",this.grid.element[0].id);if(se){this._restoreSorting=true;if(se!==this._sortingExpressions){this._sortingExpressions=se}this.grid.dataSource.settings.sorting.expressions=se;this.grid.dataSource.settings.sorting.defaultFields=se}},_applyActiveSortCellStyle:function(data,col){if(this._activeSortedCol&&col===this._activeSortedCol.key){return this._activeSortedCol.asc?this.css.ascendingColumn:this.css.descendingColumn}return""},_couldPreserveData:function(){return!this.options.persist||this.grid.dataSource.settings.sorting.expressions!==this.grid._getPersistenceData("sorting",this.grid.element[0].id)},_injectGrid:function(gridInstance,isRebind){var i,cs,col,restoreSortingExpr,topmostGrid;this.grid=gridInstance;this._detachEvents();if(this.options.type===null){this.options.type=this.grid._inferOpType()}if(this.options.persist&&this.options.type==="remote"){topmostGrid=this.element.closest(".ui-iggrid-root").data("igGrid");if(topmostGrid&&topmostGrid.element.attr("id")!==this.grid.element[0].id&&topmostGrid.options.initialDataBindDepth===-1){this.options.persist=false}}if(this.options.type){this.grid.dataSource.settings.sorting.type=this.options.type}else{this.grid.dataSource.settings.sorting.type="remote"}this.grid.dataSource.settings.sorting.caseSensitive=this.options.caseSensitive;this.grid.dataSource.settings.sorting.defaultFields=this.grid.dataSource.settings.sorting.expressions;this.grid.dataSource.settings.sorting.enabled=true;this.grid.dataSource.settings.sorting.sortUrlKey=this.options.sortUrlKey;this.grid.dataSource.settings.sorting.sortUrlAscValueKey=this.options.sortUrlKeyAscValue;this.grid.dataSource.settings.sorting.sortUrlDescValueKey=this.options.sortUrlKeyDescValue;if($.type(this.options.customSortFunction)==="function"){this.grid.dataSource.settings.sorting.customFunc=this.options.customSortFunction}else if(typeof this.options.customSortFunction==="string"){if(window[this.options.customSortFunction]&&typeof window[this.options.customSortFunction]==="function"){this.grid.dataSource.settings.sorting.customFunc=window[this.options.customSortFunction]}}this._headerCellRenderedHandler=$.proxy(this._headerCellRendered,this);this._columnsCollectionModifiedHandler=$.proxy(this._columnsCollectionModified,this);this._uiDirtyHandler=$.proxy(this._onUIDirty,this);this._headerRenderedHandler=$.proxy(this._headerRendered,this);this._columnsRearangedHandler=$.proxy(this._columnsRearranged,this);this.grid.element.bind("iggridheadercellrendered",this._headerCellRenderedHandler);this._virtualHorizontalScrollHandler=$.proxy(this._virtualHorizontalScroll,this);this.grid.element.bind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler);this.grid.element.bind("iggriduidirty",this._uiDirtyHandler);this.grid.element.bind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler);this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.bind("iggrid_columnsmoved",this._columnsRearangedHandler);if(this.options.persist&&this.grid._hasUnboundColumns){cs=this.options.columnSettings;for(i=0;i<cs.length;i++){if(cs[i].columnKey&&cs[i].currentSortDirection){col=this.grid.columnByKey(cs[i].columnKey);
if(col&&col.unbound===true){delete cs[i].currentSortDirection}}}}this._initDefaultSettings();restoreSortingExpr=null;if(this.options.persist&&this.grid.element.data("igGridGroupBy")&&this.options.mode!=="single"){if(this.grid.element.data("igGridGroupBy")._getSortingExpressions()===this.grid.dataSource.settings.sorting.expressions){restoreSortingExpr=this.grid.dataSource.settings.sorting.expressions.slice(0)}}this._clearUi();if(restoreSortingExpr){this.grid.dataSource.settings.sorting.expressions=restoreSortingExpr;this._saveSortingExpressions()}this._currentActiveHeader=null;this._currentHeader=null;this._curColKey=null;if(this.options.persist){this._preserveSorting()}if(!isRebind&&(this.grid.options.rowVirtualization||this.grid.options.virtualization)){this.grid._cellStyleSubscribers.push($.proxy(this._applyActiveSortCellStyle,this))}}});$.extend($.ui.igGridSorting,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Column Summaries 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 *	infragistics.ui.grid.shared.js
 *	infragistics.ui.grid.featurechooser.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igGridSummaries",{grid:null,css:{columnSummariesDropdown:"ui-iggrid-summaries-dialog",footerRowTextContainer:"ui-iggrid-summaries-footer-text-container",footerRowIconContainer:"ui-corner-all ui-iggrid-summaries-footer-icon-container",footerDropdownButtonsContainer:"ui-iggrid-summaries-footer-dialog-buttons-container",footerButtonIcon:"ui-icon ui-icon-calculator ui-iggrid-icon-summaries",footerButtonIconHover:"ui-iggrid-filterbuttonhover ui-state-hover",footerButtonIconActive:"ui-iggrid-filterbuttonactive ui-state-active",featureChooserIconClass:"ui-icon ui-iggrid-icon-summaries",dropDownListContainer:"ui-iggrid-summaries-dropdown-listcontainer ui-widget",dropDownListItem:"ui-iggrid-summaries-dialog-listitem",headerButtonContainer:"ui-iggrid-summaries-headerbuttoncontainer ui-corner-all",headerButtonIcon:"ui-iggrid-summaries-header-icon ui-corner-all ui-icon ui-icon-summaries",headerButtonIconHover:"ui-iggrid-summaries-header-icon-hover ui-state-hover",footerRowCell:"ui-widget-footer ui-state-default",footerRowCellHover:"ui-state-hover",checkbox:"ui-state-default ui-corner-all ui-igcheckbox-normal",checkboxOff:"ui-icon ui-icon-check ui-igcheckbox-normal-off",checkboxOn:"ui-icon ui-icon-check ui-igcheckbox-normal-on",checkboxHovered:"ui-state-hover",footerRowIconContainerEmpty:"ui-iggrid-summaries-footer-icon-container-empty",footerRowTextContainerEmpty:"ui-iggrid-summaries-footer-text-container-empty",baseClassIE7:"ui-ie7"},defaultDecimalDisplay:2,defaultSummaryMethods:[{rowDisplayLabel:$.ig.GridSummaries.locale.defaultSummaryRowDisplayLabelCount,type:"count",allowed:"all",active:true,order:0,decimalDisplay:this.defaultDecimalDisplay},{rowDisplayLabel:$.ig.GridSummaries.locale.defaultSummaryRowDisplayLabelMin,type:"min",allowed:["number","date","numeric"],active:true,order:1,decimalDisplay:this.defaultDecimalDisplay},{rowDisplayLabel:$.ig.GridSummaries.locale.defaultSummaryRowDisplayLabelMax,type:"max",allowed:["number","date","numeric"],active:true,order:2,decimalDisplay:this.defaultDecimalDisplay},{rowDisplayLabel:$.ig.GridSummaries.locale.defaultSummaryRowDisplayLabelSum,type:"sum",allowed:["number","numeric"],active:true,order:3,decimalDisplay:this.defaultDecimalDisplay},{rowDisplayLabel:$.ig.GridSummaries.locale.defaultSummaryRowDisplayLabelAvg,type:"avg",allowed:["number","numeric"],active:true,order:4,decimalDisplay:this.defaultDecimalDisplay},{rowDisplayLabel:$.ig.GridSummaries.locale.defaultSummaryRowDisplayLabelCustom,type:"custom",allowed:"all",active:true,summaryCalculator:null,order:5,decimalDisplay:this.defaultDecimalDisplay}],renderInFeatureChooser:true,options:{type:null,dialogButtonOKText:$.ig.GridSummaries.locale.dialogButtonOKText,dialogButtonCancelText:$.ig.GridSummaries.locale.dialogButtonCancelText,calculateRenderMode:"okcancelbuttons",featureChooserText:$.ig.GridSummaries.locale.featureChooserText,featureChooserTextHide:$.ig.GridSummaries.locale.featureChooserTextHide,compactRenderingMode:true,defaultDecimalDisplay:2,showSummariesButton:true,summariesResponseKey:"summaries",summaryExprUrlKey:"summaries",callee:null,dropDownHeight:"",dropDownWidth:"",showDropDownButton:true,summaryExecution:"afterfilteringbeforepaging",dropDownDialogAnimationDuration:400,emptyCellText:$.ig.GridSummaries.locale.emptyCellText,summariesHeaderButtonTooltip:$.ig.GridSummaries.locale.summariesHeaderButtonTooltip,resultTemplate:"{0} = {1}",isGridFormatter:true,renderSummaryCellFunc:null,columnSettings:[{allowSummaries:true,columnKey:null,columnIndex:-1,summaryOperands:[{rowDisplayLabel:"",type:"custom",active:true,summaryCalculator:null,order:5,decimalDisplay:2,isGridFormatter:false}]}],inherit:false},events:{dropDownOpening:"dropDownOpening",dropDownOpened:"dropDownOpened",dropDownClosing:"dropDownClosing",dropDownClosed:"dropDownClosed",summariesCalculating:"summariesCalculating",summariesCalculated:"summariesCalculated",summariesMethodSelectionChanged:"summariesMethodSelectionChanged",summariesToggling:"summariesToggling",summariesToggled:"summariesToggled",dropDownOKClicked:"dropDownOKClicked",dropDownCancelClicked:"dropDownCancelClicked"},_createWidget:function(){this.options.columnSettings=[];this._summariesRows=[];this._data={};this._currentOpenedColumnKey=null;this._isRenderedSummariesRows=false;this._footerInitialized=false;this._currentRowShownIcons=null;this._customInitMethods=[];this._fcData={};this._isInitFC=false;this._isSummariesRowsHidden=false;this._disallowedSummaries=[];$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){var compactRenderingMode=this.options.compactRenderingMode;this._setRenderSummaryCellFunction(this.options.renderSummaryCellFunc);if(compactRenderingMode==="true"){compactRenderingMode=true}else if(compactRenderingMode==="false"){compactRenderingMode=false}this.options.compactRenderingMode=compactRenderingMode},_setRenderSummaryCellFunction:function(func){if(func&&$.type(func)!=="function"){if(window[func]&&typeof window[func]==="function"){func=window[func]}}if(func&&$.type(func)==="function"){this._renderCellHandler=func}else{this._renderCellHandler=$.proxy(this._renderCell,this)}},_initColumnSettings:function(){var settings=[],i,j,k,l,cs=$.extend(true,[],this.options.columnSettings),csetting,columnSettingsLength=cs.length,gridColumnsLength=this.grid.options.columns?this.grid.options.columns.length:0;this.newColumnSettings=[];this._disallowedSummaries=[];for(i=0;i<gridColumnsLength;i++){settings.push({columnIndex:i,columnKey:this.grid.options.columns[i].key,dataType:this.grid.options.columns[i].dataType})}if(columnSettingsLength>0){for(i=0;i<columnSettingsLength;i++){csetting=cs[i];if(csetting.summaryOperands===null||csetting.summaryOperands===undefined){continue}if(csetting.columnKey!==null&&csetting.columnKey!==undefined||csetting.columnIndex!==null&&csetting.columnIndex!==undefined){for(j=0;j<gridColumnsLength;j++){for(l=0;l<csetting.summaryOperands.length;l++){if(csetting.summaryOperands[l].active===null||csetting.summaryOperands[l].active===undefined){csetting.summaryOperands[l].active=true}if(csetting.summaryOperands[l].type.startsWith("custom")===true){if(csetting.summaryOperands[l].type!=="custom"){for(k=0;k<this._customInitMethods.length;k++){if(csetting.summaryOperands[l].summaryCalculator===this._customInitMethods[k].summaryCalculator){break}}if(this._customInitMethods.length===k){this._customInitMethods.push({summaryCalculator:csetting.summaryOperands[l].summaryCalculator,type:csetting.summaryOperands[l].type,index:csetting.summaryOperands[l].type.replace("custom","")})}}}}}}}for(i=0;i<columnSettingsLength;i++){csetting=cs[i];if(csetting.columnKey!==null&&csetting.columnKey!==undefined||csetting.columnIndex!==null&&csetting.columnIndex!==undefined){for(j=0;j<gridColumnsLength;j++){if(settings[j].columnIndex===csetting.columnIndex&&csetting.columnIndex!==undefined&&csetting.columnIndex!==null||settings[j].columnKey===csetting.columnKey&&csetting.columnKey!==undefined&&csetting.columnKey!==null){csetting.dataType=settings[j].dataType;csetting.columnIndex=settings[j].columnIndex;csetting.columnKey=settings[j].columnKey;csetting.summaryOperands=this._initAllowedSummaryMethods(csetting);if(csetting.allowSummaries!==false){this.newColumnSettings.push(csetting)}else{this._disallowedSummaries[settings[j].columnKey]=true}break}}}}for(i=0;i<gridColumnsLength;i++){for(j=0;j<this.newColumnSettings.length;j++){if(this.newColumnSettings[j].columnKey===settings[i].columnKey){break}}if(j===this.newColumnSettings.length&&this._disallowedSummaries[settings[i].columnKey]!==true){this.newColumnSettings.push({dataType:settings[i].dataType,columnIndex:i,columnKey:settings[i].columnKey,summaryOperands:this._initAllowedSummaryMethods(settings[i],false)})}}}else{for(i=0;i<gridColumnsLength;i++){this.newColumnSettings.push({dataType:settings[i].dataType,columnIndex:i,columnKey:settings[i].columnKey,summaryOperands:this._initAllowedSummaryMethods(settings[i])})}}this.columnSettings=this.newColumnSettings},_initAllowedSummaryMethods:function(column,isNotActive){var i,j,k,z,c,lastCustomSummaryOperandIndex,defaultSummaryMethodsLength=this.defaultSummaryMethods.length,columnDataType,methods=[],allowedMethods=[],methodName,methodsLength,isActive,defaultMethodName;if(column===null||column===undefined){return}columnDataType=column.dataType;if(column!==null&&column!==undefined&&column.summaryOperands!==undefined&&column.summaryOperands!==null){for(i=0;i<column.summaryOperands.length;i++){if(column.summaryOperands[i].type===undefined||column.summaryOperands[i].type===null){return}methodName=column.summaryOperands[i].type.toLowerCase();if(this._isAllowedMethodName(methodName)===true){if(isNotActive===true){column.summaryOperands[i].active=false}if(column.summaryOperands[i].type==="custom"){if(column.summaryOperands[i].summaryCalculator===null||column.summaryOperands[i].summaryCalculator===undefined){continue}lastCustomSummaryOperandIndex=1;for(k=0;k<this._customInitMethods.length;k++){if(column.summaryOperands[i].summaryCalculator===this._customInitMethods[k].summaryCalculator){column.summaryOperands[i].type=this._customInitMethods[k].type;break}if(this._customInitMethods[k].index>lastCustomSummaryOperandIndex){lastCustomSummaryOperandIndex=this._customInitMethods[k].index}}if(this._customInitMethods.length===k){lastCustomSummaryOperandIndex++;column.summaryOperands[i].type="custom"+lastCustomSummaryOperandIndex;this._customInitMethods.push({summaryCalculator:column.summaryOperands[i].summaryCalculator,type:"custom"+lastCustomSummaryOperandIndex,index:lastCustomSummaryOperandIndex})}}methods.push(column.summaryOperands[i])}}}else{for(i=0;i<defaultSummaryMethodsLength;i++){c=this.defaultSummaryMethods[i];if(c.type.startsWith("custom")){continue}isActive=c.active;if(isNotActive===true){isActive=false}methods.push({rowDisplayLabel:c.rowDisplayLabel,type:c.type,allowed:c.allowed,active:isActive,order:c.order,decimalDisplay:c.decimalDisplay,isGridFormatter:c.isGridFormatter})}}methodsLength=methods.length;for(i=0;i<methodsLength;i++){for(j=0;j<defaultSummaryMethodsLength;j++){defaultMethodName=this.defaultSummaryMethods[j].type.toUpperCase();if(defaultMethodName===methods[i].type.toUpperCase()||methods[i].type.startsWith("custom")){if(methods[i].type.toLowerCase().startsWith("custom")){if(methods[i].order<this.defaultSummaryMethods[j].order){methods[i].order=this.defaultSummaryMethods[j].order}}else if(methods[i].order!==this.defaultSummaryMethods[j].order){methods[i].order=this.defaultSummaryMethods[j].order}if(methods[i].rowDisplayLabel===null||methods[i].rowDisplayLabel===undefined){methods[i].rowDisplayLabel=this.defaultSummaryMethods[j].rowDisplayLabel}if(this.defaultSummaryMethods[j].allowed==="all"){allowedMethods.push(methods[i])}else{for(z=0;z<this.defaultSummaryMethods[j].allowed.length;z++){if(this.defaultSummaryMethods[j].allowed[z]===columnDataType){allowedMethods.push(methods[i]);break}}}break}}}return allowedMethods},_setOption:function(key,value){var i,o=this.options,columns,columnsLength,cs,csLength,$colCell,columnKey,gridId=this.grid.element[0].id;switch(key){case"dialogButtonOKText":if(o.dialogButtonOKText!==value){columns=this.grid.options.columns;columnsLength=columns.length;for(i=0;i<columnsLength;i++){$("#"+this._id("summaries","dialog_button_ok",columns[i].key)).igButton("option","labelText",value)}}break;case"dialogButtonCancelText":if(o.dialogButtonCancelText!==value){columns=this.grid.options.columns;columnsLength=columns.length;for(i=0;i<columnsLength;i++){$("#"+this._id("summaries","dialog_button_cancel",columns[i].key)).igButton("option","labelText",value)}}break;case"calculateRenderMode":if(o.calculateRenderMode!==value){o.calculateRenderMode=value;columns=this.grid.options.columns;columnsLength=columns.length;for(i=0;i<columnsLength;i++){this._renderDropDown(columns[i].key)}}break;case"compactRenderingMode":if(o.compactRenderingMode!==value){o.compactRenderingMode=value;this._clearAllRows();this.calculateSummaries()}break;case"showSummariesButton":if(o.showSummariesButton!==value){o.showSummariesButton=value;cs=this.columnSettings;csLength=cs.length;for(i=0;i<csLength;i++){columnKey=cs[i].columnKey;if(value===true){$colCell=$("#"+gridId+"_"+columnKey);if(this._fcData!==null&&this._fcData!==undefined&&$colCell.length>0&&this._fcData[columnKey]!==true){this._renderHeaderCellButton($colCell,columnKey)}}else{$("#"+this._id("summaries","header_column_icon",columnKey)).remove()}}}break;case"disabled":if(o.disabled!==value){o.disabled=value;if(value===true){this._clearAllRows()}else{this.calculateSummaries()}}break;case"type":if(o.type!==value){o.type=value;this._setDataSourceColumnSettingsOptions()}break;case"summaryExprUrlKey":if(o.summaryExprUrlKey!==value){o.summaryExprUrlKey=value;this._setDataSourceColumnSettingsOptions()}break;case"dropDownHeight":if(o.dropDownHeight!==value){o.dropDownHeight=value;columns=this.grid.options.columns;columnsLength=columns.length;for(i=0;i<columnsLength;i++){$("#"+this._id("summaries","methods_dialog",columns[i].key)).css("height",value)}}break;case"dropDownWidth":if(o.dropDownWidth!==value){o.dropDownWidth=value;columns=this.grid.options.columns;columnsLength=columns.length;for(i=0;i<columnsLength;i++){$("#"+this._id("summaries","methods_dialog",columns[i].key)).css("width",value)}}break;case"showDropDownButton":if(o.showDropDownButton!==value){o.showDropDownButton=value;if(value===true){this._renderFooterIcons()}else{this._clearFooterIcons()}}break;case"emptyCellText":if(o.emptyCellText!==value){o.emptyCellText=value;this._clearAllRows();this.calculateSummaries()}break;case"resultTemplate":if(o.resultTemplate!==value){o.resultTemplate=value;this._clearAllRows();this.calculateSummaries()}break;case"isGridFormatter":if(o.isGridFormatter!==value){o.isGridFormatter=value;this._clearAllRows();this.calculateSummaries()}break;case"defaultDecimalDisplay":if(o.defaultDecimalDisplay!==value){o.defaultDecimalDisplay=value;this._clearAllRows();this.calculateSummaries()}break;case"columnSettings":if(o.columnSettings!==value){o.columnSettings=value;this.columnSettings=[];this.newColumnSettings=[];this._data={};this._clearAllRows();this._initColumnSettings();columns=this.grid.options.columns;columnsLength=columns.length;this.grid.dataSource.dataBind();for(i=0;i<columnsLength;i++){this._renderDropDown(columns[i].key)}}break;case"renderSummaryCellFunc":if(o.renderSummaryCellFunc!==value){this._setRenderSummaryCellFunction(value)}break}$.Widget.prototype._setOption.apply(this,arguments)},_removeHeaderColumnIcons:function(){var i,cs=this.columnSettings,csLength=cs.length;for(i=0;i<csLength;i++){$("#"+this._id("summaries","header_column_icon",cs[i].columnKey)).remove()}},destroy:function(){var i,columns,columnsLength,fc;this._detachEvents();this._clearAllRows();this.newColumnSettings=null;this.options.columnSettings=null;this.options=null;this._summariesRows.length=0;this._summariesRows=null;if(this._activeDialog){this._activeDialog.remove();this._activeDialog=null}this._data=null;this._currentOpenedColumnKey=null;this._isRenderedSummariesRows=null;this._footerInitialized=null;this._currentRowShownIcons=null;this._customInitMethods=null;this._fcData=null;this._isInitFC=null;this._isSummariesRowsHidden=null;this._disallowedSummaries=null;this._activeDialog=null;this.defaultSummaryMethods=null;columns=this.grid.options.columns;columnsLength=columns.length;for(i=0;i<columnsLength;i++){$("#"+this._id("summaries","methods_dialog",columns[i].key)).remove()}fc=this.grid.element.data("igGridFeatureChooser");if(fc&&this.renderInFeatureChooser){fc._removeFeature("Summaries")}$.Widget.prototype.destroy.call(this);return this},_detachEvents:function(){this.grid.footersTable().find("tr:first td").unbind(".summaries");if(this._headerRenderedHandler){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler)}if(this._footerRenderedHandler){this.grid.element.unbind("iggridfooterrendered",this._footerRenderedHandler)}if(this._headerCellRenderedHandler){this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler)}if(this._headerFooterInitHandler){this.grid.element.unbind("iggridheaderextracellsmodified",this._headerFooterInitHandler)}if(this._columnsCollectionModifiedHandler){this.grid.element.unbind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler)}if(this._virtualHorizontalScrollHandler){this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler)}},_headerCellRendered:function(event,ui){if(ui.owner.element.attr("id")!==this.grid.element.attr("id")){return}if(this._isInitFC!==true){this._initFC()}},_initFC:function(){var i,fc,o=this.options,cs=this.columnSettings,csLength=cs.length,columnKey;this._isInitFC=true;fc=this.grid.element.data("igGridFeatureChooser");if(fc!==null&&fc!==undefined&&this.renderInFeatureChooser&&o.showSummariesButton){for(i=0;i<csLength;i++){if(cs[i].allowSummaries===false){continue}columnKey=cs[i].columnKey;if(fc._shouldRenderInFeatureChooser(columnKey)===true){fc._renderInFeatureChooser(columnKey,{name:"Summaries",text:o.featureChooserText,textHide:o.featureChooserTextHide,iconClass:this.css.featureChooserIconClass,iconClassOff:this.css.featureChooserIconClass,isSelected:true,method:$.proxy(this._togglefromfc,this),updateOnClickAll:true,order:1,groupName:"toggle",groupOrder:1,type:"toggle",state:"hide"});this._fcData[columnKey]=true}}}},_footerRendered:function(sender,args){if(args.owner.element.attr("id")!==this.grid.element.attr("id")){return}var i,cs=this.columnSettings,csLength=cs.length,columnKey;for(i=0;i<csLength;i++){if(cs[i].allowSummaries===false){continue}columnKey=cs[i].columnKey;this._renderDropDown(columnKey)}},_headerRendered:function(sender,args){if(args.owner.element.attr("id")!==this.grid.element.attr("id")){return}var i,cs=this.columnSettings,csLength=cs.length,$colCell,columnKey,gridId=this.grid.element[0].id;for(i=0;i<csLength;i++){if(cs[i].allowSummaries===false){continue}columnKey=cs[i].columnKey;$colCell=this.grid.headersTable().find("#"+gridId+"_"+columnKey);if($colCell.length>0&&this._fcData[columnKey]!==true&&this.options.showSummariesButton!==false){this._renderHeaderCellButton($colCell,columnKey)}}},_columnMap:function(){var o=this.options,cs=this.newColumnSettings,i,csLength=cs.length,elem,result=[];if(o.showSummariesButton===false){return false}for(i=0;i<csLength;i++){elem={columnKey:cs[i].columnKey,enabled:true};if(cs[i].allowSummaries===false){elem.enabled=false}result.push(elem)}return result},_dataRendered:function(){if(this.options.disabled!==true&&this._isSummariesRowsHidden===false){this.calculateSummaries()}},_updatingApplied:function(){if(this.grid.options.autoCommit&&this._isRenderedSummariesRows){this.calculateSummaries()}},_rowDeleted:function(){this._updatingApplied()},_rowAdded:function(){this._updatingApplied()},_internalRowUpdated:function(){this._updatingApplied()},_internalCellUpdated:function(){this._updatingApplied()},isSummariesRowsHidden:function(){return this._isSummariesRowsHidden},calculateSummaries:function(){this._trigger(this.events.rowsInitialize,null,{});this._calculateInternalSummaries();if(this.options.showDropDownButton===true){this._renderFooterIcons()}this._adjustHeights()},_adjustHeights:function(){var grid=this.grid,gridHeight=grid.options.height,oS;if(gridHeight===null||gridHeight===undefined){return}if(this._isVirtualization()===true){grid._initializeHeights();grid._updateVirtualScrollContainer();grid._virtualDom=null;oS=grid._scrollContainer().scrollTop();grid._renderVirtualRecords();if(grid.options.virtualizationMode==="fixed"){if(oS>0){if($.ig.util.isFF){grid._scrollContainer().scrollTop(0);setTimeout(function(){grid._scrollContainer().scrollTop(oS)},0)}else{grid._scrollContainer().scrollTop(oS-2);grid._scrollContainer().scrollTop(oS)}}}}else{if(!this.grid.hasFixedColumns()){this.grid._initializeHeights();if(grid.hasVerticalScrollbar()!==grid._hasVerticalScrollbar){this.grid._adjustLastColumnWidth(false)}}else{this._syncFixedUnfixedRowHeights();this.grid._initializeHeights()}}},_removeFooterRows:function(){var i,sr=this._summariesRows,hasFixedColumns=this.grid.hasFixedColumns(),srLength=sr.length;for(i=0;i<srLength;i++){$("#"+this._id("summaries","footer_row",sr[i].type)).remove();if(hasFixedColumns){$("#"+this._id("summaries","footer_row",sr[i].type,"fixed")).remove()}}this._isRenderedSummariesRows=false;this._summariesRows=[]},_calculateSelectedSummaries:function(columnKey){var i,k,methods,hasFixedColumns=this.grid.hasFixedColumns(),res=[],csLength,$checkbox,methodsLength,summariesRowsLength,isToCalculate=false,data,newMax,max,cs=null,isChecked,j,compactRenderingMode=this.options.compactRenderingMode,selectedColumnSettingsIndex,columnSettingsLength=this.columnSettings.length,isToRerender=false,isToRemoveRow=false,methodNameToRemove,unactiveMethods=[],unactiveMethodsLength=0,activeMethods=[],isToRemoveFirstRow=false,elemDataCalculating,rowToRemoveMethodName="";if(columnKey===undefined||columnKey===null){return}for(j=0;j<columnSettingsLength;j++){if(this.columnSettings[j].columnKey===columnKey&&this._isVisibleColumn(columnKey)){cs=this.columnSettings[j];selectedColumnSettingsIndex=j;break}}if(cs===null||cs===undefined){return}methods=cs.summaryOperands;methodsLength=methods.length;for(i=0;i<methodsLength;i++){$checkbox=$("#"+this._id("summaries_footer_checkbox",methods[i].type.toLowerCase(),columnKey));isChecked=$checkbox.attr("data-chk").toLowerCase()==="on";if(isChecked!==methods[i].active){isToRerender=true;this.newColumnSettings[selectedColumnSettingsIndex].summaryOperands[i].active=isChecked;if(isChecked===true){isToCalculate=true;activeMethods.push(this.newColumnSettings[selectedColumnSettingsIndex].summaryOperands[i])}else{unactiveMethods.push(methods[i])}}}this.columnSettings[selectedColumnSettingsIndex].summaryOperands=this.newColumnSettings[selectedColumnSettingsIndex].summaryOperands;this.isToCalculateInRemoteMode=false;if(this.options.compactRenderingMode==="auto"){if(this._summariesRows.length===1&&this._analyzeAutoCompactRenderingMode()===false){$("#"+this._summariesRows[0].id).remove();if(hasFixedColumns){$("#"+this._summariesRows[0].id+"_fixed").remove()}this._summariesRows=[];this.calculateSummaries();return}if(this._summariesRows.length>1&&this._analyzeAutoCompactRenderingMode()===true){for(i=0;i<this._summariesRows.length;i++){$("#"+this._summariesRows[i].id).remove();if(hasFixedColumns){$("#"+this._summariesRows[i].id+"_fixed").remove()}}this._summariesRows=[];this.calculateSummaries();return}}if(isToCalculate===true){if((compactRenderingMode===false||compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===false)&&this._summariesRows.length===1){rowToRemoveMethodName=this._summariesRows[0].type.toLowerCase();isToRemoveFirstRow=true;for(j=0;j<this.columnSettings.length;j++){if(!this._isVisibleColumn(this.columnSettings[j].columnKey)){continue}for(k=0;k<this.columnSettings[j].summaryOperands.length;k++){if(this.columnSettings[j].summaryOperands[k].type.toLowerCase()===rowToRemoveMethodName&&this.columnSettings[j].summaryOperands[k].active!==false){isToRemoveFirstRow=false;break}}if(isToRemoveFirstRow===false){break}}}if(this.options.type==="remote"){if(this.options.calculateRenderMode==="onselect"){this.isToCalculateInRemoteMode=true;elemDataCalculating={type:activeMethods[0].type,result:"calculating",rowDisplayLabel:activeMethods[0].rowDisplayLabel,order:activeMethods[0].order,decimalDisplay:activeMethods[0].decimalDisplay,dataType:this.newColumnSettings[selectedColumnSettingsIndex].dataType};if(this._data[columnKey]===null||this._data[columnKey]===undefined){this._data[columnKey]=[]}this._data[columnKey].push(elemDataCalculating);this._renderFooterColumnInfo(columnKey,this._data[columnKey])}else{this._setDataSourceColumnSettingsOptions();this.grid.dataSource.dataBind()}}else{data=this._dataSummaries();if(this._trigger(this.events.summariesCalculating,null,{owner:this})!==false){res=this.calculateSummaryColumn(columnKey,activeMethods,data,this.newColumnSettings[selectedColumnSettingsIndex].dataType);if(compactRenderingMode===false||compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===false){this._renderFooterColumnInfo(columnKey,res)}this._trigger(this.events.summariesCalculated,null,{data:data,owner:this})}}}unactiveMethodsLength=unactiveMethods.length;if(compactRenderingMode===true||compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===true){cs=this.newColumnSettings;csLength=cs.length;max=0;newMax=0;if(compactRenderingMode==="auto"){unactiveMethods=[];for(i=0;i<methodsLength;i++){$checkbox=$("#"+this._id("summaries_footer_checkbox",methods[i].type.toLowerCase(),columnKey));isChecked=$checkbox.attr("data-chk").toLowerCase()==="on";if(isChecked===false){unactiveMethods.push(methods[i])}}unactiveMethodsLength=unactiveMethods.length}for(i=0;i<unactiveMethodsLength;i++){this._removeDataResult(columnKey,unactiveMethods[i].type.toLowerCase())}if(unactiveMethodsLength>activeMethods.length){for(i=0;i<csLength;i++){if(!this._isVisibleColumn(cs[i].columnKey)){continue}newMax=0;for(j=0;j<cs[i].summaryOperands.length;j++){if(cs[i].summaryOperands[j].active===true){newMax++}}if(newMax>max){max=newMax}}summariesRowsLength=this._summariesRows.length;if(max>summariesRowsLength){return}for(i=0;i<max;i++){$("#"+this._id("summaries","footer_row_text_container",this._summariesRows[i].type.toLowerCase(),columnKey)).html(this.options.emptyCellText)}for(i=max;i<summariesRowsLength;i++){$("#"+this._summariesRows[i].id).remove();if(hasFixedColumns){$("#"+this._summariesRows[i].id+"_fixed").remove()}}for(i=max;i<summariesRowsLength;i++){this._summariesRows.pop()}if(hasFixedColumns&&this.grid.options.height===null&&$.ig.util.isIE&&$.ig.util.browserVersion>=9){this.grid.element.data("igGridColumnFixing")._syncTableHeights()}}else if(activeMethods.length>unactiveMethodsLength){this._initCompactModeSummariesRows()}this._renderFooterColumnInfo(columnKey,this._data[columnKey]);if(this._summariesRows.length===0){this._insertSummariesRows(this.defaultSummaryMethods[0].type.toLowerCase(),this.defaultSummaryMethods[0].order);this._renderFooterIcons()}this._adjustHeights()}if(isToRerender&&(compactRenderingMode===false||compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===false)){for(i=0;i<unactiveMethodsLength;i++){methodNameToRemove=unactiveMethods[i].type.toLowerCase();$("#"+this._id("summaries","footer_row_text_container",methodNameToRemove,columnKey)).html(this.options.emptyCellText);this._removeDataResult(columnKey,methodNameToRemove);if(this._summariesRows.length<=1){continue}isToRemoveRow=true;for(j=0;j<this.columnSettings.length;j++){if(!this._isVisibleColumn(this.columnSettings[j].columnKey)){continue}for(k=0;k<this.columnSettings[j].summaryOperands.length;k++){if(this.columnSettings[j].summaryOperands[k].type.toLowerCase()===methodNameToRemove&&this.columnSettings[j].summaryOperands[k].active!==false){isToRemoveRow=false;break}}if(isToRemoveRow===false){break}}if(isToRemoveRow===true&&this._summariesRows.length>1){this._removeRowsDataByType(methodNameToRemove);$("#"+this._id("summaries","footer_row",methodNameToRemove)).remove();if(hasFixedColumns){$("#"+this._id("summaries","footer_row",methodNameToRemove,"fixed")).remove()}}}if(this._summariesRows.length>=1&&isToRemoveFirstRow===true){for(i=0;i<activeMethods.length;i++){if(activeMethods[i].type.toLowerCase()===rowToRemoveMethodName){break}}if(i===activeMethods.length){this._removeRowsDataByType(rowToRemoveMethodName);$("#"+this._id("summaries","footer_row",rowToRemoveMethodName)).remove();if(hasFixedColumns){$("#"+this._id("summaries","footer_row",rowToRemoveMethodName,"fixed")).remove()}}}if(this._summariesRows.length>0&&$("#"+this._id("summaries","footer_row_button_dd",this._summariesRows[0].type,columnKey)).length===0){this._renderFooterIcons()}this._adjustHeights()}},_analyzeAutoCompactRenderingMode:function(){var i,j,methods,cs,methodsLength,activeMethodsCount,columnSettingsLength=this.columnSettings.length;for(j=0;j<columnSettingsLength;j++){cs=this.columnSettings[j];methods=cs.summaryOperands;methodsLength=methods.length;activeMethodsCount=0;for(i=0;i<methodsLength;i++){if(methods[i].active===true&&++activeMethodsCount>1){return false}}}return true},_removeRowsDataByType:function(methodNameToRemove){if(methodNameToRemove===undefined||methodNameToRemove===null){return}var hasFixedColumns=this.grid.hasFixedColumns();this._summariesRows=$.grep(this._summariesRows,function(n){if(n.type===methodNameToRemove){$(n).remove();if(hasFixedColumns){$("#"+n.id+"_fixed").remove()}}return n.type!==methodNameToRemove})},_syncFixedUnfixedRowHeights:function(){var $tfoot=this.grid.footersTable().find("tfoot"),$fixedTFoot=this.grid.fixedFootersTable().find("tfoot"),summariesRows=$tfoot.find("tr[data-role]"),fixedSummariesRows=$fixedTFoot.find("tr[data-role]"),$fixedRow;$.each(summariesRows,function(index,r){var h,fixedRowHeight,rowHeight,$row=$(r);$fixedRow=fixedSummariesRows.eq(index);if($fixedRow.length===0){return true}fixedRowHeight=$fixedRow.height();rowHeight=$row.height();if(fixedRowHeight>rowHeight){h=fixedRowHeight}else{h=rowHeight}$row.height(h);$fixedRow.height(h)})},_clearFooterIcons:function(){var i,currentRow=this._currentRowShownIcons,columns,columnsLength;if(currentRow===null||currentRow===undefined){return}columns=this.grid.options.columns;columnsLength=columns.length;for(i=0;i<columnsLength;i++){$("#"+this._id("summaries","footer_row_button_dd",currentRow.type,columns[i].key)).remove()}},clearAllFooterIcons:function(){var i,j,rows=this._summariesRows,rowsLength=rows.length,columns=this.grid.options.columns,columnsLength=columns.length;for(i=0;i<rowsLength;i++){for(j=0;j<columnsLength;j++){$("#"+this._id("summaries","footer_row_button_dd",rows[i].type,columns[j].key)).remove()}}},_clearAllRows:function(){var i,summaryRowsLength=this._summariesRows.length,hasFixedColumns=this.grid.hasFixedColumns(),$row;for(i=0;i<summaryRowsLength;i++){$row=$("#"+this._summariesRows[i].id);$row.remove();if(hasFixedColumns){$("#"+this._summariesRows[i].id+"_fixed").remove()}}this._summariesRows.length=0},_removeUnusedFooterRows:function(oldRows){var i,j,sr=this._summariesRows,summariesRowsLength=this._summariesRows.length,hasFixedColumns=this.grid.hasFixedColumns(),oldRowsLength=oldRows.length;if(summariesRowsLength===0){for(i=0;i<oldRowsLength;i++){$("#"+oldRows.id).remove()}return}for(i=0;i<oldRowsLength;i++){for(j=0;j<summariesRowsLength;j++){if(sr[j].id===oldRows[i].id){continue}}if(j===summariesRowsLength){$("#"+oldRows[i].id).remove();if(hasFixedColumns){$("#"+oldRows[i].id+"_fixed").remove()}}}},_renderFooterIcons:function(startInd,endInd){var i,columnKey,sr=this._summariesRows,columnSetting,isToRemoveRow=true,gridColumns=this.grid.options.columns,gridColumnsLength=gridColumns.length,methodName;if(startInd===null||startInd===undefined){startInd=0}if(endInd===null||endInd===undefined){endInd=gridColumnsLength}if(sr.length===0){return}this._clearFooterIcons();methodName=sr[0].type;this._currentRowShownIcons=sr[0];for(i=startInd;i<endInd;i++){columnKey=gridColumns[i].key;if(this._disallowedSummaries[columnKey]===true){continue}columnSetting=this._getColumnSettingByKey(columnKey);if(columnSetting===null||columnSetting===undefined||columnSetting.length===0||columnSetting.allowSummaries===false){continue}isToRemoveRow=false;this._renderFooterIconMarkup(methodName,columnKey)}if(isToRemoveRow===true){this._removeRowsDataByType(methodName)}},_renderFooterIconMarkup:function(methodName,columnKey){var self=this,$td,$button;$button=$("<span></span>").appendTo($("#"+this._id("summaries","footer_row_icon_container",methodName,columnKey))).addClass(self.css.footerButtonIcon);$button.wrap('<a id="'+this._id("summaries","footer_row_button_dd",methodName,columnKey)+'" href="#" title="" tabindex="'+this.grid.options.tabIndex+'"></a>');
$button.data("columnKey",columnKey);$td=$button.closest("td");$td.data("columnKey",columnKey);$td.bind({"mousedown.summaries":function(e){self.toggleDropDown(columnKey,e);e.stopPropagation()}});$button.parent().bind({mousedown:$.proxy(self._onMouseDownFooterIcon,self),click:$.proxy(self._onClickFooterIcon,self),mouseover:$.proxy(self._onMouseOverFooterIcon,self),mouseout:$.proxy(self._onMouseOutFooterIcon,self),focus:$.proxy(self._onMouseOverFooterIcon,self),blur:$.proxy(self._onMouseOutFooterIcon,self),keydown:function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){event.stopPropagation();event.preventDefault();self.toggleDropDown(null,event)}}})},_onMouseOverFooterIcon:function(e){var $button=$(e.target);if($button.closest("div").hasClass(this.css.footerButtonIconActive)===false){$button.closest("div").addClass(this.css.footerButtonIconHover)}},_onMouseOutFooterIcon:function(e){var $button=$(e.target);if($button.closest("div").hasClass(this.css.footerButtonIconActive)===false){$button.closest("div").removeClass(this.css.footerButtonIconHover)}},_onClickFooterIcon:function(e){e.preventDefault()},_onMouseDownFooterIcon:function(event){this.toggleDropDown(null,event)},_isFirstRowEmpty:function(){var i,res=true,columnKey,sr=this._summariesRows,data=null,row,gridColumns=this.grid.options.columns,gridColumnsLength=gridColumns.length;if(sr.length===0){return false}row=sr[0];for(i=0;i<gridColumnsLength;i++){columnKey=gridColumns[i].key;data=this._getDataByKeyMethodName(columnKey,row.type);if(data!==null){return false}}return res},toggleDropDown:function(columnKey,event){var $target,$dialog,top,left,self,isVisible,rOffset,$footersTable,$td;if(!event){if(this.grid.isFixedColumn(columnKey)){$footersTable=this.grid.fixedFootersTable()}else{$footersTable=this.grid.footersTable()}$target=$footersTable.find("tfoot tr:first-child td[data-key="+columnKey+"] a>span")}else{$td=$(event.target).closest("td");columnKey=$td.data("columnKey");$target=$td.find("a>span");if(!$target.length){return}}if(columnKey===null||columnKey===undefined){$target=$target.find("span");columnKey=$target.data("columnKey")}$dialog=$("#"+this._id("summaries","methods_dialog",columnKey));top=$.ig.util.offset($target).top;left=$.ig.util.offset($target).left;self=this;isVisible=$dialog.is(":visible")===true;if($dialog.length===0||$dialog.data("isAnimating")===true){return}top-=$target.height()-2;if($target.is("span")===true){$dialog.data("buttonId",$target.parent().attr("id"))}if(!isVisible){rOffset=$.ig.util.getRelativeOffset($dialog);$dialog.css({top:top-$dialog.height()-rOffset.top,left:left-rOffset.left})}if(self._activeDialog!==null&&self._activeDialog!==undefined&&$dialog!==self._activeDialog&&columnKey!==self._activeDialog.data("columnKey")){self.showHideDialog(self._activeDialog)}if(isVisible===true){self._currentOpenedColumnKey=null}else{self._currentOpenedColumnKey=columnKey}self.showHideDialog($dialog)},showHideDialog:function($dialog){if($dialog===null||$dialog===undefined){return}var self=this,e=this.events,$button=$("#"+$dialog.data("buttonId")),columnKey=$dialog.data("columnKey"),animationDuration=self.options.dropDownDialogAnimationDuration;if($dialog.data("isAnimating")===true&&self._activeDialog===$dialog){return}if($dialog.is(":visible")===true){if(this._trigger(e.dropDownClosing,null,{columnKey:columnKey,owner:this})===false){return}if($button!==null&&$button!==undefined){$button.closest("div").removeClass(self.css.footerButtonIconActive)}}else{if(this._trigger(e.dropDownOpening,null,{columnKey:columnKey,owner:this})===false){return}if($button!==null&&$button!==undefined){$button.closest("div").removeClass(self.css.footerButtonIconHover);$button.closest("div").addClass(self.css.footerButtonIconActive);this._rollbackCheckboxState(columnKey)}}if(animationDuration<=0){animationDuration=1}$dialog.data("isAnimating",true);$dialog.toggle("slide",{duration:animationDuration,direction:"down"},function(){$dialog.data("isAnimating",false);if($dialog.is(":visible")===true){$dialog.focus();self.grid._focusedElement=$dialog;self._activeDialog=$dialog;self._trigger(e.dropDownOpened,null,{columnKey:columnKey,owner:this})}else{self._trigger(e.dropDownClosed,null,{columnKey:columnKey,owner:this});self.grid._focusedElement=null;if(self.options.type==="remote"&&self.options.calculateRenderMode==="onselect"&&self.isToCalculateInRemoteMode===true){self.isToCalculateInRemoteMode=false;self._setDataSourceColumnSettingsOptions();self.grid.dataSource.dataBind()}if(self._activeDialog!==null&&self._activeDialog!==undefined&&self._activeDialog.data("columnKey")===columnKey){self._activeDialog=null}}})},_closeDropDown:function(){var $dialog=this._activeDialog;this.showHideDialog($dialog)},_setDataSourceColumnSettingsOptions:function(){var o=this.options;this.grid.dataSource.settings.summaries.columnSettings=this.newColumnSettings;this.grid.dataSource.settings.summaries.type=o.type;this.grid.dataSource.settings.summaries.summaryExecution=o.summaryExecution;this.grid.dataSource.settings.summaries.summaryExprUrlKey=o.summaryExprUrlKey;this.grid.dataSource.settings.summaries.summariesResponseKey=o.summariesResponseKey;if(this.grid.dataSource.type&&this.grid.dataSource.type()==="remoteUrl"&&this.grid._dataOptions&&$.type(this.grid._dataOptions.dataSource)==="string"){this.grid.dataSource.settings.dataSource=this.grid._dataOptions.dataSource}},_getColumnSettingByKey:function(columnKey){var i,len=this.columnSettings.length;if(columnKey===null||columnKey===undefined){return null}for(i=0;i<len;i++){if(this.columnSettings[i].columnKey===columnKey){return this.columnSettings[i]}}return null},_renderHeaderCellButton:function(columnCell,columnKey){var summaryHeaderIconContainer,self=this,css=self.css,buttonId=this._id("summaries","header_column_icon",columnKey),$button,$divHeaderButtonContainer;summaryHeaderIconContainer=columnCell.find(".ui-iggrid-indicatorcontainer");this.grid._enableHeaderCellFeature(columnCell);if(summaryHeaderIconContainer.length===0){summaryHeaderIconContainer=$("<div></div>").appendTo(columnCell);summaryHeaderIconContainer.addClass("ui-iggrid-indicatorcontainer")}$("#"+buttonId).remove();$button=$("<a></a>").attr({href:"#",id:buttonId,tabindex:this.grid.options.tabIndex,title:this.options.summariesHeaderButtonTooltip});$divHeaderButtonContainer=summaryHeaderIconContainer.find(".ui-iggrid-summaries-headerbuttoncontainer");if($divHeaderButtonContainer.length===0){$divHeaderButtonContainer=$("<div></div>").addClass(css.headerButtonContainer).appendTo(summaryHeaderIconContainer)}$button.appendTo($divHeaderButtonContainer);$("<span></span>").addClass(css.headerButtonIcon).appendTo($button);if($.ig.util.isIE7===true){$button.parent().addClass(this.css.baseClassIE7)}$button.hover(function(){$(this).parent().addClass(css.headerButtonIconHover)},function(){$(this).parent().removeClass(css.headerButtonIconHover)});$button.bind({click:function(event){event.preventDefault();event.stopPropagation();self._internalToggleSummariesRow(null,event)}})},_togglefromfc:function(event,columnKey,isSelected){this._internalToggleSummariesRow(isSelected,event)},_internalToggleSummariesRow:function(isToShow,event){if(isToShow===null||isToShow===undefined){isToShow=!this._isRenderedSummariesRows}if(this._trigger(this.events.summariesToggling,event,{isToShow:isToShow,owner:this})===false){return}this.toggleSummariesRows(isToShow,true);this._trigger(this.events.summariesToggled,event,{isShown:isToShow,owner:this})},toggleSummariesRows:function(isToShow,isInternalCall){var fc,cs,csLength,i,$hScroller,hScrollerLeft,grid=this.grid;if(isToShow===true){$hScroller=$("#"+grid.id()+"_horizontalScrollContainer");if($hScroller.length>0&&(grid.options.columnVirtualization||grid._isColumnVirtualizationEnabled())){hScrollerLeft=$hScroller.scrollLeft();$hScroller.scrollLeft(0)}this.calculateSummaries();if(hScrollerLeft){setTimeout(function(){$hScroller.scrollLeft(hScrollerLeft)},0)}grid._synchronizeHScroll();this._isSummariesRowsHidden=false;if(this._summariesRows.length===0){cs=this.newColumnSettings;csLength=cs.length;this._insertSummariesRows(this.defaultSummaryMethods[0].type,this.defaultSummaryMethods[0].order);for(i=0;i<csLength;i++){if(!this._isVisibleColumn(cs[i].columnKey)){continue}this._renderFooterIconMarkup(this.defaultSummaryMethods[0].type,cs[i].columnKey)}}}else{this._removeFooterRows();this._isSummariesRowsHidden=true}this._adjustHeights();if(isInternalCall===undefined||isInternalCall===false){fc=grid.element.data("igGridFeatureChooser");if(fc!==null&&fc!==undefined){fc._toggleSelectedItems("Summaries",!isToShow)}}if(grid.hasFixedColumns()){if($.ig.util.isIE&&$.ig.util.browserVersion>=9){grid.element.data("igGridColumnFixing")._syncTableHeights()}this._syncFixedUnfixedRowHeights()}},_renderDropDown:function(columnKey){var $dialog,$ul,i,j,$buttonOK,$buttonCancel,$div,minInd,swap,$li,id=this._id("summaries","methods_dialog",columnKey),methodsLength,cs=this._getColumnSettingByKey(columnKey),css=this.css,checkboxId,allowedMethods,self=this,o=this.options,isChecked=false,cssClassCheckBox,onFocusLi,onMousedownLi,toggleState,onBlurLi,onKeydownLi,onMousedown,onMouseover,onMouseout,$checkbox,onClick;if(cs===null||cs===undefined){return}allowedMethods=cs.summaryOperands;if(allowedMethods===null||allowedMethods===undefined){return}$("#"+id).remove();$dialog=$("<div></div>").appendTo(this.grid._rootContainer()).attr("id",id).css("position","absolute").css("width",this.options.dropDownWidth).css("height",this.options.dropDownHeight).addClass(this.css.columnSummariesDropdown).attr("tabindex",this.grid.options.tabIndex).hide();$dialog.data("methods",allowedMethods);$ul=$("<ul></ul>").addClass(css.dropDownListContainer);$ul.appendTo($dialog);methodsLength=allowedMethods.length;for(i=0;i<methodsLength;i++){minInd=i;for(j=i;j<methodsLength;j++){if(allowedMethods[j].order===null||allowedMethods[j].order===undefined){allowedMethods[j].order=0}if(allowedMethods[minInd].order>allowedMethods[j].order){minInd=j}}if(minInd!==i){swap=allowedMethods[minInd];allowedMethods[minInd]=allowedMethods[i];allowedMethods[i]=swap}}toggleState=function($checkbox,event){self.toggleCheckstate($checkbox);self._trigger(self.events.summariesMethodSelectionChanged,event,{columnKey:columnKey,isSelected:$checkbox.attr("data-chk").toLowerCase()==="on",methodName:$checkbox.data("methodName"),owner:this});if(o.calculateRenderMode==="onselect"){self._calculateSelectedSummaries(columnKey);if(self.grid.hasFixedColumns()){self._syncFixedUnfixedRowHeights()}}};onClick=function(event){toggleState($(event.currentTarget),event);if(self._activeDialog){self._activeDialog.data("focussed",true);self._activeDialog.focus()}event.preventDefault();event.stopPropagation()};onMousedown=function(event){if(self._activeDialog){self._activeDialog.data("focussed",true);self._activeDialog.focus()}event.preventDefault();event.stopPropagation()};onMouseover=function(event){$(event.currentTarget).addClass(css.checkboxHovered)};onMouseout=function(event){$(event.currentTarget).removeClass(css.checkboxHovered)};$dialog.bind({blur:function(){$dialog.data("focussed",false);setTimeout(function(){self._checkCloseDropDown($dialog)},10)},focus:function(){$dialog.data("focussed",true)},keydown:function(event){if(event.keyCode===$.ui.keyCode.ESCAPE||event.keyCode===$.ui.keyCode.SPACE||event.keyCode===$.ui.keyCode.ENTER){event.stopPropagation();event.preventDefault();self.toggleDropDown(null,event);if(self._summariesRows.length>0){$("#"+self._id("summaries","footer_row_button_dd",self._summariesRows[0].type,columnKey)).focus()}}}});onFocusLi=function(){if(self._activeDialog){self._activeDialog.data("focussed",true)}};onBlurLi=function(){if(self._activeDialog){self._activeDialog.data("focussed",false)}setTimeout($.proxy(self._checkCloseDropDown,self),300)};onKeydownLi=function(event){var $liFocused=$(this),keyCode=event.keyCode;if(keyCode===$.ui.keyCode.ENTER||keyCode===$.ui.keyCode.SPACE){toggleState($("#"+$liFocused.data("checkboxId")),event);event.stopPropagation();event.preventDefault()}else if(keyCode===$.ui.keyCode.ESCAPE){$dialog.blur()}};onMousedownLi=function(event){toggleState($("#"+$(this).data("checkboxId")),event)};for(i=0;i<methodsLength;i++){checkboxId=this._id("summaries_footer_checkbox",allowedMethods[i].type.toLowerCase(),columnKey);if(allowedMethods[i].active===true||allowedMethods[i].active===1){isChecked="on";cssClassCheckBox=css.checkboxOn}else{isChecked="off";cssClassCheckBox=css.checkboxOff}$li=$("<li></li>").data("checkboxId",checkboxId).addClass(css.dropDownListItem).appendTo($ul).attr("tabindex",this.grid.options.tabIndex);$li.bind({focus:onFocusLi,blur:onBlurLi,keydown:onKeydownLi,mousedown:onMousedownLi});$('<span id="'+checkboxId+'" class="'+css.checkbox+'"></span>').appendTo($li);$("<label></label>").html(allowedMethods[i].rowDisplayLabel).appendTo($li);$checkbox=$("#"+checkboxId);$('<span class="'+cssClassCheckBox+'"></span>').appendTo($checkbox);$checkbox.attr("data-chk",isChecked).attr("data-role","checkbox");$checkbox.data("methodName",allowedMethods[i].type);$checkbox.bind({click:onClick,mouseover:onMouseover,mouseout:onMouseout,mousedown:onMousedown})}$div=$("<div></div>").addClass(this.css.footerDropdownButtonsContainer).appendTo($dialog);if(o.calculateRenderMode==="okcancelbuttons"){$buttonOK=$('<a href="http://localhost/"></a>');$buttonOK.attr({id:this._id("summaries","dialog_button_ok",columnKey),tabindex:this.grid.options.tabIndex}).appendTo($div);$buttonOK.igButton({link:{href:"#",title:""},labelText:this.options.dialogButtonOKText,keydown:function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){self._clickOKButton(columnKey)}if(event.keyCode!==$.ui.keyCode.TAB){event.stopPropagation();event.preventDefault()}},click:function(e){self._clickOKButton(columnKey);e.preventDefault();e.stopPropagation()},mousedown:function(event){event.preventDefault();event.stopPropagation()},focus:function(){if(self._activeDialog){self._activeDialog.data("focussed",true)}},blur:function(){if(self._activeDialog){self._activeDialog.data("focussed",false)}setTimeout($.proxy(self._checkCloseDropDown,self),300)}});$buttonCancel=$("<a></a>");$buttonCancel.attr({id:this._id("summaries","dialog_button_cancel",columnKey),tabindex:this.grid.options.tabIndex}).appendTo($div);$buttonCancel.igButton({link:{href:"#",title:""},labelText:this.options.dialogButtonCancelText,click:function(e){self._clickCancelButton(columnKey);e.preventDefault();e.stopPropagation()},mousedown:function(event){event.preventDefault();event.stopPropagation()},focus:function(){if(self._activeDialog){self._activeDialog.data("focussed",true)}},blur:function(){if(self._activeDialog){self._activeDialog.data("focussed",false)}setTimeout($.proxy(self._checkCloseDropDown,self),300)}})}$dialog.data("columnKey",columnKey)},_checkCloseDropDown:function($dialog){if(this._activeDialog===null){return}if(this._activeDialog.data("focussed")===false){setTimeout($.proxy(this._closeDropDown,this),10);return}if($dialog&&$dialog.is(":visible")&&$dialog.attr("id")!==this._activeDialog.attr("id")){this.showHideDialog($dialog)}},toggleCheckstate:function($checkbox){var noCancel;noCancel=true;if(noCancel){if($checkbox.attr("data-chk")==="on"){this.selectCheckBox($checkbox,false)}else{this.selectCheckBox($checkbox,true)}}},selectCheckBox:function($checkbox,isToSelect){var css=this.css,$innerSpan=$checkbox.children("span");if(isToSelect===true){$innerSpan.removeClass(css.checkboxOff).addClass(css.checkboxOn);$checkbox.attr("data-chk","on")}else{$innerSpan.removeClass(css.checkboxOn).addClass(css.checkboxOff);$checkbox.attr("data-chk","off")}},_clickOKButton:function(columnKey){var i,j,cs,$checkbox,columnSettingsLength=this.columnSettings.length,methods,methodsLength,eventData=[],elem;if(columnKey===null||columnKey===undefined){return}for(j=0;j<columnSettingsLength;j++){if(this.columnSettings[j].columnKey===columnKey){cs=this.columnSettings[j];break}}if(cs===null||cs===undefined){return}methods=cs.summaryOperands;methodsLength=methods.length;for(i=0;i<methodsLength;i++){$checkbox=$("#"+this._id("summaries_footer_checkbox",methods[i].type.toLowerCase(),columnKey));elem={type:methods[i].type.toLowerCase(),active:false};if($checkbox.attr("data-chk")!==undefined&&$checkbox.attr("data-chk").toLowerCase()==="on"){elem.active=true}eventData.push(elem)}this._trigger(this.events.dropDownOKClicked,null,{columnKey:columnKey,eventData:eventData,owner:this});this.showHideDialog($("#"+this._id("summaries","methods_dialog",columnKey)));this._calculateSelectedSummaries(columnKey);if(this.grid.hasFixedColumns()){this._syncFixedUnfixedRowHeights()}},_clickCancelButton:function(columnKey){this._trigger(this.events.dropDownCancelClicked,null,{columnKey:columnKey,owner:this});this.showHideDialog($("#"+this._id("summaries","methods_dialog",columnKey)))},_rollbackCheckboxState:function(columnKey){var cs,i,j,methods,isChecked,methodsLength,columnSettingsLength=this.columnSettings.length,$checkbox;if(columnKey===undefined||columnKey===null){return}for(j=0;j<columnSettingsLength;j++){if(this.columnSettings[j].columnKey===columnKey){cs=this.columnSettings[j];break}}if(cs===null||cs===undefined){return}methods=cs.summaryOperands;methodsLength=methods.length;for(i=0;i<methodsLength;i++){$checkbox=$("#"+this._id("summaries_footer_checkbox",methods[i].type.toLowerCase(),columnKey));if($checkbox.attr("data-chk")!==undefined){isChecked=$checkbox.attr("data-chk").toLowerCase()==="on";if(methods[i].active!==isChecked){if(methods[i].active===true){this.selectCheckBox($checkbox,true)}else{this.selectCheckBox($checkbox,false)}}}}},_initCompactModeSummariesRows:function(){var i,j,k,cs=this.newColumnSettings,csLength=cs.length,columnMaxMethods=cs[0],cmm,cmmLength,countRowsToAdd,methodName,maxMethods=-1,summariesRowsLength,newMaxMethods;for(i=0;i<csLength;i++){if(!this._isVisibleColumn(cs[i].columnKey)){continue}newMaxMethods=0;if(cs[i].summaryOperands===null||cs[i].summaryOperands===undefined){continue}for(j=0;j<cs[i].summaryOperands.length;j++){if(cs[i].summaryOperands[j].active===true){newMaxMethods++}}if(newMaxMethods>maxMethods){maxMethods=newMaxMethods;columnMaxMethods=cs[i]}}if(columnMaxMethods===undefined||columnMaxMethods===null){return}cmm=columnMaxMethods.summaryOperands;cmmLength=cmm.length;summariesRowsLength=this._summariesRows.length;if(summariesRowsLength>maxMethods){return}countRowsToAdd=maxMethods-summariesRowsLength;if(countRowsToAdd===0){return}k=0;for(i=0;i<cmmLength;i++){methodName=cmm[i].type.toLowerCase();if($("#"+this._id("summaries","footer_row",methodName)).length===0){this._insertSummariesRows(methodName,null);if(++k===countRowsToAdd){break}}}},_calculateInternalSummaries:function(){var cs=this.newColumnSettings,csLength=cs.length,i,o=this.options,data,res,e=this.events;if(this._trigger(e.summariesCalculating,null,{owner:this})===false){return}data=this._dataSummaries();if(o.callee!==null&&o.callee!==undefined&&$.type(o.callee)==="function"){data=o.callee(data)}if(data===null||data===undefined){data=[]}if(o.compactRenderingMode===true||o.compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===true){this._initCompactModeSummariesRows()}for(i=0;i<csLength;i++){if(!this._isVisibleColumn(cs[i].columnKey)){continue}res=this.calculateSummaryColumn(cs[i].columnKey,cs[i].summaryOperands,data,cs[i].dataType);this._renderFooterColumnInfo(cs[i].columnKey,res)}this._isRenderedSummariesRows=true;this._trigger(e.summariesCalculated,null,{data:data,owner:this})},_isVisibleColumn:function(columnKey){var cols=this.grid._visibleColumns(),ret=false;$.each(cols,function(index,value){if(value.key===columnKey){ret=true;return false}});return ret},calculateSummaryColumn:function(ck,columnMethods,data,dataType){var i,j,val,o=this.options,columnMethodsLength,tmpArr=[],rowsCount=0,res=[],order,resultCalculated,resElement,methodName,gridDataSource,isDate;if(ck===null||ck===undefined){throw new Error($.ig.GridSummaries.locale.calculateSummaryColumnKeyNotSpecified)}if(columnMethods===undefined||columnMethods===null){return}columnMethodsLength=columnMethods.length;if(o.type==="local"){rowsCount=data.length;isDate=dataType==="date";if(isDate===true){for(i=0;i<rowsCount;i++){if(data[i][ck]!==null&&data[i][ck]!==undefined){if(data[i][ck].getTime){tmpArr.push(data[i][ck].getTime())}else{tmpArr.push(data[i][ck])}}}}else{for(i=0;i<rowsCount;i++){if(data[i][ck]===undefined){data[i][ck]=null}tmpArr.push(data[i][ck])}}for(i=0;i<columnMethodsLength;i++){methodName=columnMethods[i].type.toLowerCase();if(methodName.startsWith("custom")){methodName="custom"}if(columnMethods[i].active===true||columnMethods[i].active===1){order=columnMethods[i].order;if(order===undefined){order=null}if(methodName==="count"){resultCalculated=rowsCount}else{resultCalculated=$.ig.calcSummaries(methodName,tmpArr,columnMethods[i].summaryCalculator,dataType)}resElement={type:columnMethods[i].type,result:resultCalculated,rowDisplayLabel:columnMethods[i].rowDisplayLabel,order:order,decimalDisplay:columnMethods[i].decimalDisplay,isGridFormatter:columnMethods[i].isGridFormatter,dataType:dataType};res.push(resElement);this._addDataResult(ck,resElement)}}}else if(o.type==="remote"){if(data[ck]!==undefined&&data[ck]!==null){for(i=0;i<columnMethodsLength;i++){val=data[ck][columnMethods[i].type];if(columnMethods[i].active===true||columnMethods[i].active===1){order=columnMethods[i].order;if(order===undefined){order=null}if(val===null||val===undefined){if(columnMethods[i].summaryCalculator!==undefined){gridDataSource=this.grid.dataSource._data;rowsCount=gridDataSource.length;isDate=dataType==="date";if(isDate===true){for(j=0;j<rowsCount;j++){if(gridDataSource[j][ck]!==null&&gridDataSource[j][ck]!==undefined){tmpArr.push(gridDataSource[j][ck].getTime())}}}else{for(j=0;j<rowsCount;j++){tmpArr.push(gridDataSource[j][ck])}}val=$.ig.calcSummaries(columnMethods[i].type.toLowerCase(),tmpArr,columnMethods[i].summaryCalculator,dataType)}else{val=""}}res.push({type:columnMethods[i].type,result:val,rowDisplayLabel:columnMethods[i].rowDisplayLabel,order:order,decimalDisplay:columnMethods[i].decimalDisplay,isGridFormatter:columnMethods[i].isGridFormatter,dataType:dataType})}}}this._data[ck]=res}return res},summaryCollection:function(){return this._data},summariesFor:function(columnKey){return this._data[columnKey]},_addDataResult:function(columnKey,resElement){var d=this._data[columnKey],i,dLen;if(d===null||d===undefined){this._data[columnKey]=[];this._data[columnKey].push(resElement);return}dLen=d.length;for(i=0;i<dLen;i++){if(d[i].type.toLowerCase()===resElement.type.toLowerCase()){d[i]=resElement;break}}if(i===dLen){this._data[columnKey].push(resElement)}},_removeDataResult:function(columnKey,methodName){var d=this._data[columnKey];if(d===undefined||d===null){return}d=$.grep(d,function(n){return n.type.toLowerCase()!==methodName.toLowerCase()});this._data[columnKey]=d},_getDataByKeyMethodName:function(columnKey,methodName){var i,d=this._data[columnKey],dLength,res=null;methodName=methodName.toLowerCase();if(d===undefined||d===null){return null}dLength=d.length;for(i=0;i<dLength;i++){if(d[i].type.toLowerCase()===methodName){return d[i]}}return res},_renderFooterColumnInfo:function(columnKey,data){if(data===null||data===undefined){return}var i,j,methodName,result,decimalDisplay,footerRowId,$footerRow,order,compactRenderingMode=this.options.compactRenderingMode,dataLength=data.length,min,swapElement;if(compactRenderingMode===true||this.options.compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===true){if(dataLength>1){for(i=0;i<dataLength;i++){min=i;for(j=i+1;j<dataLength;j++){if(data[j].order<data[min].order){swapElement=data[j];data[j]=data[min];data[min]=swapElement;min=j}}}}for(i=0;i<dataLength;i++){if(this._summariesRows[i]===undefined||this._summariesRows[i]===null||data[i]===undefined||data[i]===null){continue}result=data[i].result;decimalDisplay=data[i].decimalDisplay;if(decimalDisplay===undefined||decimalDisplay===null){decimalDisplay=this.defaultDecimalDisplay}if(decimalDisplay!==null&&decimalDisplay!==undefined&&this._isNumber(result)===true){result=parseFloat(result).toFixed(decimalDisplay)}this._renderCellHandler(this._summariesRows[i].type,columnKey,data[i])}}else if(compactRenderingMode===false||this.options.compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===false){for(i=0;i<dataLength;i++){methodName=data[i].type.toLowerCase();footerRowId=this._id("summaries","footer_row",methodName);$footerRow=this.grid.container().find("#"+footerRowId);if($footerRow.length===0){order=data[i].order;if(order===undefined){order=null}this._addDataResult(columnKey,data[0]);this._insertSummariesRows(methodName,order)}this._renderCellHandler(methodName,columnKey,data[i])}}},_renderCell:function(methodName,columnKey,data){var i,resultTemplate=this.options.resultTemplate,column,value=data.result,format,res,parseToDate=false,oColumnType,oColumnFormat,summaryOperand=data.type,rowDisplayLabel=data.rowDisplayLabel,isGridFormatter=data.isGridFormatter,dataType=data.dataType,defaultDecimalDisplay=this.options.defaultDecimalDisplay,decimalDisplay=data.decimalDisplay,isNumber=this._isNumber(value);if(isNumber&&dataType==="bool"){isGridFormatter=false}if(dataType==="date"&&isNumber&&(summaryOperand==="min"||summaryOperand==="max")){parseToDate=true;value=new Date(parseInt(value,10))}if(isGridFormatter===true||isGridFormatter===undefined&&this.options.isGridFormatter===true){column=this._getGridColumnFor(columnKey);if(column!==null){oColumnFormat=column.format;oColumnType=column.dataType;if(isNumber&&!parseToDate){if(this._isNumber(decimalDisplay)||(oColumnFormat===undefined||oColumnFormat===null)&&this._isNumber(defaultDecimalDisplay)||summaryOperand==="count"&&oColumnFormat&&oColumnFormat.indexOf&&oColumnFormat.indexOf(".")===-1&&oColumnFormat!=="0"){if(oColumnFormat===undefined||oColumnFormat===null||decimalDisplay===undefined){decimalDisplay=defaultDecimalDisplay}if(decimalDisplay>0){format="0.";for(i=0;i<decimalDisplay;i++){format+="0"}}else{format="0"}column.format=format}}if(summaryOperand==="count"){column.dataType="number"}value=this.grid._renderCell(value,column);column.format=oColumnFormat;column.dataType=oColumnType}}else if(isNumber&&!parseToDate){if(decimalDisplay===undefined||decimalDisplay===null){decimalDisplay=defaultDecimalDisplay}value=parseFloat(value).toFixed(decimalDisplay)}if(value===null||value===undefined){value=""}if(resultTemplate){res=resultTemplate.replace("{0}",rowDisplayLabel).replace("{1}",value)}else{res=value}this.grid.container().find("#"+this._id("summaries","footer_row_text_container",methodName,columnKey)).html(res)},_getGridColumnFor:function(columnKey){var i,gridColumnsLength=this.grid.options.columns?this.grid.options.columns.length:0;for(i=0;i<gridColumnsLength;i++){if(this.grid.options.columns[i].key===columnKey){return this.grid.options.columns[i]}}return null},_isNumber:function(n){return!isNaN(parseFloat(n))&&isFinite(n)},_columnsCollectionModified:function(event,ui){if(ui.owner.element.attr("id")!==this.grid.element.attr("id")){return}if(this._isSummariesRowsHidden===true){return}this._clearAllRows();this.calculateSummaries()},_insertSummariesRows:function(methodName,order){methodName=methodName.toLowerCase();var srLength,i,j,srOrder,hasFixed=this.grid.hasFixedColumns(),css=this.css,$grid=this.grid,gridColumns=$grid._visibleColumns(),gridColumnsLength=gridColumns.length,$tfoot=this._tfoot,$td,$tfootFixed,$footer=$grid._footer,footerRowIdFixed,$footerRowFixed,footerRowId=this._id("summaries","footer_row",methodName),$footerRow=$("<tr></tr>").attr("id",footerRowId).attr("data-role","summaryrow"),elem={id:footerRowId,type:methodName,order:order},footerRowCellMousein=function(){$(this).addClass(css.footerRowCellHover)},footerRowCellMouseout=function(){$(this).removeClass(css.footerRowCellHover)};if(hasFixed===true){footerRowIdFixed=this._id("summaries","footer_row",methodName,"fixed");$footerRowFixed=$("<tr></tr>").attr("id",footerRowIdFixed).attr("data-role","summaryrow");$tfootFixed=this.grid.fixedFootersTable().find("tfoot")}if($tfoot===null||$tfoot===undefined){if($footer===undefined||$footer===null||$footer.length===0){$grid._renderFooter();$footer=$grid._footer}if($footer===undefined||$footer===null||$footer.length===0){return}$footer.css("display","");if(this._isVirtualization()===true){$tfoot=this.grid.footersTable().find("tfoot")}else if(this._isFixedFooters()===true){$tfoot=$footer.find("tfoot")}else{$tfoot=$footer}this._tfoot=$tfoot}if($tfoot.attr("id")!==""&&$tfoot.attr("id")!==null&&$tfoot.attr("id")!==undefined){$tfoot=$("#"+$tfoot.attr("id"))}if(order===null){elem.order=this._summariesRows.length;this._summariesRows.push(elem);$footerRow.appendTo($tfoot);if(hasFixed){$footerRowFixed.appendTo($tfootFixed)}}else{srLength=this._summariesRows.length;if(srLength===0){this._summariesRows.push(elem);$footerRow.appendTo($tfoot);if(hasFixed){$footerRowFixed.appendTo($tfootFixed)}}else{if(this.options.compactRenderingMode===true||this.options.compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===true){$footerRow.appendTo($tfoot);if(hasFixed){$footerRowFixed.appendTo($tfootFixed)}this._summariesRows.push(elem)}else if(this.options.compactRenderingMode===false||this.options.compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===false){for(i=0;i<srLength;i++){srOrder=this._summariesRows[i].order;if(srOrder===undefined||srOrder===null){continue}if(order<=srOrder){$footerRow.insertBefore($("#"+this._id("summaries","footer_row",this._summariesRows[i].type)));if(hasFixed){$footerRowFixed.insertBefore($("#"+this._id("summaries","footer_row",this._summariesRows[i].type,"fixed")))}this._summariesRows.splice(i,0,elem);break}}if(i===srLength){this._summariesRows.push(elem);$footerRow.appendTo($tfoot);if(hasFixed){$footerRowFixed.appendTo($tfootFixed)}}}}}if(this._isVirtualization()&&this.grid.options.virtualizationMode==="fixed"){gridColumnsLength=this.grid._virtualColumnCount}for(j=0;j<gridColumnsLength;j++){$td=$("<td></td>").attr("tabIndex",this.grid.options.tabIndex).attr("aria-describedby",this.grid.id()+"_"+gridColumns[j].key).addClass(css.footerRowCell).attr("data-key",gridColumns[j].key);if(gridColumns[j].fixed===true){$td.appendTo($footerRowFixed);$("#"+footerRowIdFixed+" td.ui-state-default").hover(footerRowCellMousein,footerRowCellMouseout)}else{$td.appendTo($footerRow);$("#"+footerRowId+" td.ui-state-default").hover(footerRowCellMousein,footerRowCellMouseout)}if(j===gridColumnsLength-1&&$grid.options.height&&parseInt($grid.options.height,10)>0){$td.css("width",parseInt(gridColumns[j].width,10)+$grid._scrollbarWidth())}else{$td.css("width",gridColumns[j].width)}this._renderInnerCellMarkup($td,methodName,gridColumns[j].key)}if(hasFixed&&this.grid.hasFixedDataSkippedColumns()&&this.grid.element.data("igGridColumnFixing").options.fixingDirection==="left"){this.grid._footerInit($footerRowFixed,null,true,css.footerRowCell)}else{this.grid._footerInit($footerRow,null,true,css.footerRowCell)}},_renderInnerCellMarkup:function($td,methodName,columnKey){var $textContainer,$iconContainer;$textContainer=$("<div></div>").attr("id",this._id("summaries","footer_row_text_container",methodName,columnKey)).addClass(this.css.footerRowTextContainer).appendTo($td).html(this.options.emptyCellText);$iconContainer=$("<div></div>").attr("id",this._id("summaries","footer_row_icon_container",methodName,columnKey)).addClass(this.css.footerRowIconContainer).insertBefore($textContainer);if($.ig.util.isIE7===true){$iconContainer.addClass(this.css.baseClassIE7)}if(this.options.showDropDownButton===false){$iconContainer.addClass(this.css.footerRowIconContainerEmpty);$textContainer.addClass(this.css.footerRowTextContainerEmpty)}},_virtualHorizontalScroll:function(event,args){if(this._isRenderedSummariesRows===false){return}var start=args.startColIndex,end=args.endColIndex,i,j,$row,$children,$td,sr=this._summariesRows,srLength=sr.length,columnSetting,columnKey,cols=this.grid._visibleColumns(),self=this;
end=start+this.grid._virtualColumnCount;if(srLength>0){$children=sr[0];$.each($children,function(index,element){$("#"+self._id("summaries","methods_dialog",$(element).attr("data-key"))).remove()})}for(i=0;i<srLength;i++){$row=$("#"+sr[i].id);$children=$row.children();$children.html("");for(j=start;j<=end;j++){$td=$row.find("td:nth-child("+(j-start+1)+")");$td.html("");if(cols[j]===null||cols[j]===undefined){continue}this._renderInnerCellMarkup($td,sr[i].type,cols[j].key)}}for(i=start;i<end;i++){if(cols[i]!==null&&cols[i]!==undefined){columnKey=cols[i].key;columnSetting=this._getColumnSettingByKey(columnKey);if(columnKey===undefined||columnKey===null){continue}this._renderFooterIconMarkup(sr[0].type,columnKey);this._renderDropDown(columnKey);if(columnSetting===null||columnSetting===undefined){continue}this._renderFooterColumnInfo(columnKey,this._data[columnKey])}}if(this.grid.hasFixedColumns()){this._syncFixedUnfixedRowHeights()}},_isFixedFooters:function(){return this.grid.options.fixedFooters===true&&this.grid.options.height!==null},_isVirtualization:function(){var gridOptions=this.grid.options;return gridOptions.virtualization===true||gridOptions.rowVirtualization===true&&gridOptions.height!==null||gridOptions.columnVirtualization===true&&gridOptions.width!==null},_id:function(){var i,res=this.grid.element[0].id,argumentsLength=arguments.length;if(argumentsLength===0){return null}for(i=0;i<argumentsLength;i++){res+="_"+arguments[i]}return res},_isAllowedMethodName:function(methodName){var defaultMethodName,isAllowed=false,len=this.defaultSummaryMethods.length,i;for(i=0;i<len;i++){defaultMethodName=this.defaultSummaryMethods[i].type;if(defaultMethodName===methodName||defaultMethodName===methodName.substr(0,defaultMethodName.length)){isAllowed=true;break}}return isAllowed},_footerInit:function(owner,args){if(args.owner.element.attr("id")!==this.grid.element.attr("id")){return}var rows,i;rows=this.grid.footersTable().find("[data-role=summaryrow]");rows.find("[data-skip=true]").remove();for(i=0;i<rows.length;i++){this.grid._footerInit($(rows[i]),null,true,this.css.footerRowCell)}},_dataSummaries:function(){var ds=this.grid.dataSource;return ds.dataSummaries()},_injectGrid:function(gridInstance){this.grid=gridInstance;if(this.options.type===null){this.options.type=this.grid._inferOpType()}this._detachEvents();this._headerRenderedHandler=$.proxy(this._headerRendered,this);this._footerRenderedHandler=$.proxy(this._footerRendered,this);this._headerCellRenderedHandler=$.proxy(this._headerCellRendered,this);this._headerFooterInitHandler=$.proxy(this._footerInit,this);this._columnsCollectionModifiedHandler=$.proxy(this._columnsCollectionModified,this);this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.bind("iggridfooterrendered",this._footerRenderedHandler);this.grid.element.bind("iggridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.bind("iggridheaderextracellsmodified",this._headerFooterInitHandler);this.grid.element.bind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler);this._virtualHorizontalScrollHandler=$.proxy(this._virtualHorizontalScroll,this);this.grid.element.bind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler);this._initColumnSettings();this._setDataSourceColumnSettingsOptions();if(this.grid.element.igGridFeatureChooser!==undefined){this.grid.element.igGridFeatureChooser()}else{throw new Error($.ig.GridSummaries.locale.featureChooserNotReferenced)}}});$.extend($.ui.igGridSummaries,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Tooltips 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.3.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	modernizr.js (Optional)
 *	infragistics.ui.popover.js
 *	infragistics.ui.grid.framework.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){"use strict";$.widget("ui.igGridTooltips",{options:{visibility:"overflow",style:"tooltip",showDelay:500,hideDelay:300,columnSettings:[{columnKey:null,columnIndex:-1,allowTooltips:true,maxWidth:null}],fadeTimespan:150,cursorLeftOffset:10,cursorTopOffset:15,inherit:false},css:{tooltip:"ui-iggrid-tooltip",tooltipContent:"ui-iggrid-tooltip-content"},events:{tooltipShowing:"tooltipShowing",tooltipShown:"tooltipShown",tooltipHiding:"tooltipHiding",tooltipHidden:"tooltipHidden"},_createWidget:function(){this.visible=false;this._canFadeIn=true;this._canFadeOut=true;$.Widget.prototype._createWidget.apply(this,arguments)},destroy:function(){this.grid.element.unbind(".tooltip");if(this.tooltip&&this._registered){if(this.tooltip.data("users")===1){this.tooltip.remove()}else{this.tooltip.data("users",this.tooltip.data("users")-1);this.tooltip.children("[id$='_content']").unbind("pointerenter."+this.grid.id()).unbind("MSPointerEnter."+this.grid.id()).unbind("pointerleave."+this.grid.id()).unbind("MSPointerLeave."+this.grid.id()).unbind("mouseenter."+this.grid.id()).unbind("mouseleave."+this.grid.id())}}if(this.ruler&&this._registered){if(this.ruler.data("users")===1){this.ruler.remove()}else{this.ruler.data("users",this.ruler.data("users")-1)}}this._registered=false;$.Widget.prototype.destroy.call(this);return this},id:function(){return this.tooltip[0].id},_injectGrid:function(gridInstance,isRebind){if(isRebind===true){return}this.grid=gridInstance;this._createHandlers();this._unregisterGridEvents();this._registerGridEvents()},_createTooltip:function(){var existingTooltip=this.grid._rootContainer().children("[id$='_tooltips']"),tooltipContent,closeButton=typeof Modernizr==="object"&&Modernizr.touch===true;if(existingTooltip.length>0){this.tooltip=existingTooltip;this.tooltip.data("users",this.tooltip.data("users")+1)}else{if(this.options.style==="tooltip"){this.tooltip=$("<div></div>").attr("id",this.grid.id()+"_tooltips").attr("role","tooltip").addClass("ui-tooltip").addClass("ui-widget").addClass("ui-corner-all").addClass("ui-widget-content").addClass(this.css.tooltip).css({position:"absolute",display:"none","white-space":"normal","word-wrap":"break-word"});$("<div></div>").attr("id",this.id()+"_content").addClass("ui-tooltip-content").addClass(this.css.tooltipContent).appendTo(this.tooltip)}else if(this.options.style==="popover"){this.tooltip=$("<div><div>").attr("id",this.grid.id()+"_tooltips").igPopover({animationDuration:this.options.fadeTimespan,maxHeight:"auto",headerTemplate:{closeButton:closeButton}})}this.tooltip.data("users",1)}if(this.options.style==="tooltip"){tooltipContent=this.tooltip.children("[id$='_content']");if(window.navigator.msPointerEnabled||window.navigator.pointerEnabled){tooltipContent.bind("MSPointerEnter."+this.grid.id(),$.proxy(this._tooltipMouseEnter,this)).bind("pointerenter."+this.grid.id(),$.proxy(this._tooltipMouseEnter,this)).bind("MSPointerLeave."+this.grid.id(),$.proxy(this._tooltipMouseLeave,this)).bind("pointerleave."+this.grid.id(),$.proxy(this._tooltipMouseLeave,this))}else{tooltipContent.bind("mouseenter."+this.grid.id(),$.proxy(this._tooltipMouseEnter,this)).bind("mouseleave."+this.grid.id(),$.proxy(this._tooltipMouseLeave,this))}}this.tooltip.appendTo(this.grid._rootContainer())},_createRuler:function(){var existingRuler=this.grid._rootContainer().children("[id$='_ruler']");if(existingRuler.length>0){this.ruler=existingRuler;this.ruler.data("users",this.ruler.data("users")+1)}else{this.ruler=$("<span></span>").attr("id",this.id()+"_ruler").css("display","none").css("white-space","normal").css("word-wrap","break-word").appendTo(this.grid._rootContainer());this.ruler.data("users",1)}},_displayOverflow:function(element){var ruler=this.ruler,textHeightInPixels;ruler.text(element.text());ruler.css({"font-family":element.css("font-family"),"font-size":element.css("font-size"),"font-size-adjust":element.css("font-size-adjust"),"font-stretch":element.css("font-stretch"),"font-style":element.css("font-style"),"font-variant":element.css("font-variant"),"font-weight":element.css("font-weight"),"padding-left":element.css("padding-left"),"padding-top":element.css("padding-top"),"padding-right":element.css("padding-right"),"padding-bottom":element.css("padding-bottom")});ruler.width(element.width());textHeightInPixels=ruler.height();if(textHeightInPixels<=element.height()){return false}return true},_gridHeaderRendering:function(event,ui){if(ui.owner.id()!==this.grid.id()){return}this._createTooltip();this._createRuler();this._registered=true},_dataRendered:function(event,ui){var $tbody,$tbodyFixed;if(ui!==undefined){if($(ui.owner.element).attr("id")!==this.grid.id()){return}}if(!this.tooltip){this._createTooltip();this._createRuler();this._registered=true}$tbody=this.grid.element.children("tbody");this._registerMouseEvents($tbody);if(this.grid.hasFixedColumns()){$tbodyFixed=this.grid.fixedTable().find("tbody");this._registerMouseEvents($tbodyFixed)}if(this.grid.options.fixedHeaders===true){this._$thead=this.grid.headersTable().find("thead")}else{this._$thead=this.grid.container().find("#"+this.grid.id()+" thead")}},_rowsRendered:function(event,ui){var tbody;if(ui!==undefined){if($(ui.owner.element).attr("id")!==this.grid.id()){return}}tbody=this.grid.element.children("tbody");this._registerMouseEvents(tbody);if(this.grid.hasFixedColumns()){tbody=this.grid.fixedTable().find("tbody");this._registerMouseEvents(tbody)}},_registerMouseEvents:function(tbody){var binding;if(window.navigator.msPointerEnabled||window.navigator.pointerEnabled){binding={"MSPointerLeave.tooltip":this._gridMouseLeaveHandler,"pointerleave.tooltip":this._gridMouseLeaveHandler,"MSPointerMove.tooltip":this._gridMouseMoveHandler,"pointermove.tooltip":this._gridMouseMoveHandler};tbody.unbind(binding).bind(binding)}else{binding={"mouseleave.tooltip":this._gridMouseLeaveHandler,"mousemove.tooltip":this._gridMouseMoveHandler};tbody.unbind(binding).bind(binding)}},_gridMouseLeave:function(){clearTimeout(this.timeoutShowing);clearTimeout(this.timeoutHiding);if(this.tooltip.css("display")!=="none"){this._hideTooltip(true)}this._currentlyHovered=null},_gridMouseMove:function(event){var element=$(event.target).closest("td,th"),elementData,hidePrevious=true,shouldShow,hasFixedCols=this.grid.hasFixedColumns(),isFixedElement=this.grid._isFixedElement(element);if(element.closest("table").attr("id")!==this.grid.id()&&!isFixedElement||hasFixedCols&&isFixedElement&&element.closest("table").attr("id")!==this.grid.id()+"_fixed"){return}this.mouseX=event.pageX!==undefined?event.pageX:event.originalEvent.pageX;this.mouseY=event.pageY!==undefined?event.pageY:event.originalEvent.pageY;if(element[0]===this._currentlyHovered||element.length===0){return}elementData=this._getElementValue(element);if(elementData===undefined){hidePrevious=true}if(element[0]===this._currentlyDisplayed&&this.visible===true){hidePrevious=false;clearTimeout(this.timeoutHiding);return}this._currentlyHovered=element[0];this._previouslyHoveredData=this._currentlyHoveredData;this._currentlyHoveredData=elementData;clearTimeout(this.timeoutShowing);shouldShow=this._shouldShowForTarget(element)&&elementData!==undefined&&elementData!==""&&$(event.target).attr("unselectable")===undefined;if(this.visible===true&&hidePrevious===true){this._hideTooltip(!shouldShow)}if(shouldShow===true){this._currentlyDisplayed=this._currentlyHovered;this._showTooltip()}},_tooltipMouseEnter:function(){if(this.timeoutHiding!==null&&this.timeoutHiding!==undefined){clearTimeout(this.timeoutHiding)}},_tooltipMouseLeave:function(){this._hideTooltip()},_getColumnFixingInstance:function(){if(!this._columnFixing&&this.grid.element.data("igGridColumnFixing")){this._columnFixing=this.grid.element.data("igGridColumnFixing")}return this._columnFixing},_getDataView:function(){return this.grid.dataSource.dataView()},_getRowIndex:function(element,row){return element.closest("tbody").children("tr:not([data-container='true'],[data-grouprow='true'])").index(row)},_getElementValue:function(element){var col,val,tlog,i,tid,row=element.closest("tr"),vrowidx=-1,key,hasFixedCols=this.grid.hasFixedColumns(),hskip=0,cf;if(this.grid.options.virtualization||this.grid.options.columnVirtualization){hskip=this.grid._startColIndex||0}if(hasFixedCols){cf=this._getColumnFixingInstance();col=element.index();key=cf._getKeyByVisibleIndex(col,this.grid._isFixedElement(element))}else{if(this._$thead.length>0){col=element.index()-this._$thead.children(":first").children("th[data-skip='true']").length+hskip}else{col=element.index()-element.parent().find("td[data-parent='true'],td[data-skip='true'],th").length+hskip}}if(col<0){return val}if(!key){key=this.grid._visibleColumns()[col].key}this._pRowIdx=this._rowIdx;this._rowIdx=this._getRowIndex(element,row);if(this.grid.options.virtualization||this.grid.options.rowVirtualization){if(this.grid.options.virtualizationMode==="fixed"){this._rowIdx+=this.grid._startRowIndex}else{vrowidx=parseInt(row.attr("data-row-idx"),10);this._rowIdx=vrowidx||this._rowIdx}}tlog=this.grid.dataSource.pendingTransactions();tid=parseInt(element.parent().attr("data-id"),10);for(i=tlog.length-1;i>=0;i--){if(tlog[i].type==="deleterow"){continue}if(tlog[i].type==="cell"){if(tlog[i].rowId===tid&&tlog[i].col===key){val=tlog[i].value;break}}else{if(tlog[i].rowId===tid){val=tlog[i].row[key];break}}}if(val===undefined&&this._getDataView()[this._rowIdx]!==undefined){val=this._getDataView()[this._rowIdx][key]}if($.type(val)==="date"){if(this.grid.options.enableUTCDates===true){val=$.ig.formatter(val,"date","dateTime",true,this.grid.options.enableUTCDates)}}return val},_shouldShowForTarget:function(element){var shouldShow=true,dataIdx,hasFixedColumns=this.grid.hasFixedColumns(),col;switch(this.options.visibility){case"always":break;case"never":shouldShow=false;break;case"overflow":shouldShow=this._displayOverflow(element);break}if(shouldShow===false){return false}dataIdx=element.parent().children("td:not([data-parent],[data-skip='true'])").index(element);this._pColumnIdx=this._columnIdx;if(this.grid._isMultiColumnGrid){this._columnIdx=dataIdx}else{if(hasFixedColumns&&element.closest("[data-fixed-container]").length===1){this._columnIdx=this.grid.fixedHeadersTable().find("thead th[id]").not("[data-skip='true']").eq(dataIdx).data("columnIndex")}else{this._columnIdx=this._$thead.find("th[id]").not("[data-skip='true']").eq(dataIdx).data("columnIndex")}}if(this._columnIdx===undefined||this._columnIdx===null){this._columnIdx=dataIdx}if(this._columnIdx<0||this._columnIdx>=this.grid.options.columns.length){return false}this._pColumnKey=this._columnKey;if(hasFixedColumns){col=this.grid._getColumnByTD(element);if(col){this._columnKey=col.column.key}}else{if(this.grid._isMultiColumnGrid){this._columnKey=this.grid._visibleColumns()[dataIdx].key}else{this._columnKey=this.grid.options.columns[this._columnIdx].key}}return shouldShow&&this._shouldShowForColumn()},_shouldShowForColumn:function(){var i,colSettings=this.options.columnSettings;for(i=0;i<colSettings.length;i++){if(colSettings[i].columnKey===this._columnKey||colSettings[i].columnIndex===this._columnIdx){return colSettings[i].allowTooltips!==undefined?colSettings[i].allowTooltips:true}}return true},_hideTooltip:function(current){var self=this,args,fn;args={owner:this,tooltip:current===true?String(this._currentlyHoveredData):String(this._previouslyHoveredData),value:current===true?this._currentlyHoveredData:this._previouslyHoveredData,element:this._currentlyDisplayed,columnKey:current===true?this._columnKey:this._pColumnKey,index:current===true?this._rowIdx:this._pRowIdx,columnIndex:current===true?this._columnIdx:this._pColumnIdx};fn=function(){var noCancel=self._trigger(self.events.tooltipHiding,self,args);if(noCancel===true){self._hideTooltipNoDelay();self._trigger(self.events.tooltipHidden,self,args)}};if(typeof Modernizr==="object"&&Modernizr.touch===true){fn()}else{clearTimeout(this.timeoutHiding);this.timeoutHiding=setTimeout(fn,this.options.hideDelay)}},_showTooltip:function(){var self=this,args,fn;args={owner:this,tooltip:String(this._currentlyHoveredData),value:this._currentlyHoveredData,element:this._currentlyDisplayed,columnKey:this._columnKey,index:this._rowIdx,columnIndex:this._columnIdx};fn=function(){var noCancel=self._trigger(self.events.tooltipShowing,self,args);if(noCancel===true){self._showTooltipNoDelay(args.tooltip);self._trigger(self.events.tooltipShown,self,args)}};if(typeof Modernizr==="object"&&Modernizr.touch===true){fn()}else{this.timeoutShowing=setTimeout(fn,this.options.showDelay)}},_hideTooltipNoDelay:function(){if(this.options.style==="tooltip"){if(this._canFadeOut===true){this._canFadeOut=false;this.tooltip.fadeOut(this.options.fadeTimespan,$.proxy(this._fadeOutEnd,this))}}else if(this.options.style==="popover"){this.tooltip.igPopover("hide")}this.visible=false},_showTooltipNoDelay:function(value){var tooltip;if(this._currentlyDisplayed===null){return}clearTimeout(this.timeoutHiding);tooltip=$("#"+this.id());if(this.options.style==="tooltip"){this._updateTooltip(value);if(this._canFadeIn===true){this._canFadeIn=false;tooltip.fadeIn(this.options.fadeTimespan,$.proxy(this._fadeInEnd,this))}}else if(this.options.style==="popover"){tooltip.igPopover("show",$(this._currentlyDisplayed),value)}this.visible=true},_fadeOutEnd:function(){this._canFadeOut=true},_fadeInEnd:function(){this._canFadeIn=true},_updateTooltip:function(value){var tooltipContent=this.tooltip.children("[id$='_content']");tooltipContent.text(value);tooltipContent.parent().css("max-width",this._getMaxWidth(this._columnKey,this._columnIdx,this._currentlyDisplayed));this._positionTooltip(tooltipContent.parent())},_getMaxWidth:function(colKey,colIdx,td){var colSettings=this.options.columnSettings,i;for(i=0;i<colSettings.length;i++){if(colSettings[i].columnKey===colKey||colSettings[i].columnIndex===colIdx){if(colSettings[i].maxWidth!==null&&colSettings[i].maxWidth!==undefined){return colSettings[i].maxWidth}break}}return $(td).width()},_positionTooltip:function(tooltip){var win=$(window),left,top,toffset,tfullw=tooltip.outerWidth(),tfullh=tooltip.outerHeight();toffset=$.ig.util.getRelativeOffset(tooltip);left=this.mouseX-toffset.left+this.options.cursorLeftOffset;top=this.mouseY-toffset.top+this.options.cursorTopOffset;if(left+tfullw+win.scrollLeft()>win.width()){left=win.width()-toffset.left-tfullw+win.scrollLeft()}if(top+tfullh+toffset.top>win.height()+win.scrollTop()){top=win.height()-toffset.top-tfullh+win.scrollTop()}tooltip.css({top:top,left:left})},_columnFixed:function(){var $tbodyFixed;this._registerMouseEvents(this.grid.element.children("tbody"));if(this.grid.hasFixedColumns()){$tbodyFixed=this.grid.fixedTable().find("tbody");this._registerMouseEvents($tbodyFixed)}},_createHandlers:function(){this._rowsRenderedHandler=$.proxy(this._rowsRendered,this);this._gridMouseLeaveHandler=$.proxy(this._gridMouseLeave,this);this._gridMouseMoveHandler=$.proxy(this._gridMouseMove,this);this._gridHeaderRenderingHandler=$.proxy(this._gridHeaderRendering,this)},_registerGridEvents:function(){this.grid.element.bind("iggridrowsrendered.tooltip",this._rowsRenderedHandler);this.grid.element.bind("iggridheaderrendering.tooltip",this._gridHeaderRenderingHandler)},_unregisterGridEvents:function(){this.grid.element.unbind("iggridrendered.tooltip",this._dataRenderedHandler);this.grid.element.unbind("iggridheaderrendering.tooltip",this._gridHeaderRenderingHandler)}});$.extend($.ui.igGridTooltips,{version:"15.2.20152.1027"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Grid Editing 15.2.20152.1027
*
* Copyright (c) 2011-2015 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
* jquery-1.9.1.js
* jquery.ui-1.9.0.js
* modernizr.js (Optional)
* infragistics.ui.grid.framework.js
* infragistics.ui.grid.shared.js
* infragistics.ui.editors.js
* infragistics.ui.validator.js
* infragistics.ui.combo.js
* infragistics.ui.rating.js
* infragistics.ui.shared.js
* infragistics.dataSource.js
* infragistics.util.js
*/
(function($){"use strict";$.widget("ui.igGridUpdating",{options:{columnSettings:[{columnKey:null,editorType:null,editorProvider:null,editorOptions:null,required:null,readOnly:null,validation:null,defaultValue:null}],editMode:"row",enableDeleteRow:true,enableAddRow:true,validation:false,doneLabel:null,doneTooltip:null,cancelLabel:null,cancelTooltip:null,addRowLabel:null,addRowTooltip:null,deleteRowLabel:null,deleteRowTooltip:null,showDoneCancelButtons:true,enableDataDirtyException:true,startEditTriggers:"click,F2,enter",horizontalMoveOnEnter:false,excelNavigationMode:false,saveChangesSuccessHandler:null,saveChangesErrorHandler:null,swipeDistance:"100px",wrapAround:true,rowEditDialogOptions:{captionLabel:null,containment:"owner",width:"370px",height:"350px",animationDuration:200,showReadonlyEditors:true,showEditorsForHiddenColumns:false,namesColumnWidth:"150px",editorsColumnWidth:null,showDoneCancelButtons:true,dialogTemplate:null,dialogTemplateSelector:null,editorsTemplate:null,editorsTemplateSelector:null},inherit:false},events:{editRowStarting:"editRowStarting",editRowStarted:"editRowStarted",editRowEnding:"editRowEnding",editRowEnded:"editRowEnded",editCellStarting:"editCellStarting",editCellStarted:"editCellStarted",editCellEnding:"editCellEnding",editCellEnded:"editCellEnded",rowAdding:"rowAdding",rowAdded:"rowAdded",rowDeleting:"rowDeleting",rowDeleted:"rowDeleted",dataDirty:"dataDirty",generatePrimaryKeyValue:"generatePrimaryKeyValue",rowEditDialogBeforeOpen:"rowEditDialogBeforeOpen",rowEditDialogAfterOpen:"rowEditDialogAfterOpen",rowEditDialogBeforeClose:"rowEditDialogBeforeClose",rowEditDialogAfterClose:"rowEditDialogAfterClose",rowEditDialogContentsRendered:"rowEditDialogContentsRendered"},css:{buttonContainer:"ui-iggrid-buttoncontainer ui-widget-content ui-corner-all",button:"ui-iggrid-button ui-state-default ui-corner-all",doneButton:"ui-iggrid-donebutton ui-priority-primary ui-corner-all",cancelButton:"ui-iggrid-cancelbutton ui-corner-all",deleteButton:"ui-iggrid-deletebutton ui-state-default ui-corner-all",buttonHover:"ui-iggrid-buttonhover ui-state-hover",buttonDisabled:"ui-iggrid-buttondisabled ui-state-disabled",buttonActive:"ui-iggrid-buttonactive ui-state-active",doneIcon:"ui-iggrid-doneicon ui-icon ui-icon-check",cancelIcon:"ui-iggrid-cancelicon ui-icon ui-icon-cancel",buttonIconOnly:"ui-iggrid-button-icon-only",editingCell:"ui-iggrid-editingcell",addRow:"ui-iggrid-addrow ui-widget-header",addRowHover:"ui-iggrid-addrowhover ui-state-hover",addRowActive:"ui-iggrid-addrowactive ui-state-active",addRowIcon:"ui-iggrid-addrowicon ui-icon ui-icon-circle-plus",deleteIcon:"ui-iggrid-deleteicon ui-icon ui-icon-circle-close",editor:"ui-iggrid-editor",rowEditDialogHeaderCaption:"ui-dialog-titlebar ui-iggrid-filterdialogcaption ui-widget-header ui-corner-all ui-helper-reset ui-helper-clearfix",rowEditDialogHeaderCaptionTitle:"ui-dialog-title",rowEditDialogCloseButton:"ui-icon ui-icon-close",rowEditDialog:"ui-dialog ui-draggable ui-resizable ui-iggrid-dialog ui-widget ui-widget-content ui-corner-all",blockArea:"ui-widget-overlay ui-iggrid-blockarea",rowEditDialogButtonsContainer:"ui-dialog-buttonpane ui-widget-content ui-helper-clearfix",rowEditDialogTable:"ui-iggrid-filtertable ui-helper-reset"},setCellValue:function(rowId,colKey,value){var provider;if(rowId===null||rowId===undefined||$.type(colKey)!=="string"){return}if(value===undefined){throw new Error($.ig.GridUpdating.locale.undefinedCellValue)}if(!this._recOrPropFound(rowId,colKey)){throw new Error($.ig.GridUpdating.locale.recordOrPropertyNotFoundException)}if(this.isEditing()){if(this._originalValues.hasOwnProperty(colKey)){provider=this.editorForKey(colKey).igEditorFilter("option","provider");provider.setValue(value);this._editorTextChanged();return}else{this.endEdit(false,false)}}this._updateCell(rowId,colKey,value)},updateRow:function(rowId,values){var key,provider,shouldUpdate=false;if(rowId===null||rowId===undefined||$.type(values)!=="object"){return}if(!this._recOrPropFound(rowId)){throw new Error($.ig.GridUpdating.locale.recordOrPropertyNotFoundException)}if(this.isEditing()&&this._editingForRowId===rowId){for(key in values){if(values.hasOwnProperty(key)&&this._originalValues.hasOwnProperty(key)){provider=this.editorForKey(key).igEditorFilter("option","provider");provider.setValue(values[key])}else{this.endEdit(false,false);shouldUpdate=true;break}}this._editorTextChanged()}else{shouldUpdate=true}if(shouldUpdate){this._updateRow(rowId,values)}},addRow:function(values){var settings=this.options.columnSettings,i=settings?settings.length:0,defVals={},key,val;while(i-->0){key=settings[i].columnKey;val=settings[i].defaultValue;if(val!==undefined&&key!==undefined&&key!==null){defVals[key]=val}}this._addRow(null,$.extend(defVals,values),defVals,true)},deleteRow:function(rowId){if(rowId===null||rowId===undefined){return}if(!this._recOrPropFound(rowId)){throw new Error($.ig.GridUpdating.locale.recordOrPropertyNotFoundException)}if(this.isEditing()&&this._editingForRowId===rowId){this.endEdit(false)}this._deleteRow(null,rowId,true)},startEdit:function(rowId,column,raiseEvents){var columnIndex,columnKey,mode=this.options.editMode,visibleColumns=this.grid._visibleColumns(),cell,row;if(this.isEditing()){throw new Error($.ig.GridUpdating.locale.editingInProgress)}if($.type(column)==="string"){columnKey=column;columnIndex=this._getVisibleIndexForKey(columnKey)}else if($.type(column)==="number"&&column>=0&&column<visibleColumns.length){columnKey=visibleColumns[column].key;columnIndex=column}if(!columnKey||columnIndex===undefined||columnIndex===null){if(mode==="cell"){throw new Error($.ig.Grid.locale.columnNotFound.replace("{key}",columnKey))}columnKey=visibleColumns[0].key;columnIndex=0}if(mode==="cell"&&visibleColumns[columnIndex].readOnly){return false}switch(mode){case"dialog":return this._startEditDialog(null,!raiseEvents,rowId);case"row":row=this.grid.rowById(rowId);if(!row||!row.length){throw new Error($.ig.GridUpdating.locale.rowOrColumnSpecifiedOutOfView)}return this._startEditForRow(null,!raiseEvents,rowId,columnKey,row);case"cell":cell=this.grid.cellById(rowId,columnKey);if(!cell||!cell.length){throw new Error($.ig.GridUpdating.locale.rowOrColumnSpecifiedOutOfView)}return this._startEditForCell(null,!raiseEvents,rowId,columnKey,cell,true,false)}},startAddRowEdit:function(raiseEvents){if(this.isEditing()){throw new Error($.ig.GridUpdating.locale.editingInProgress)}if(!this.options.enableAddRow){return false}if(this.options.editMode==="dialog"){return this._startEditDialog(null,!raiseEvents,null,true)}return this._startEditForRow(null,!raiseEvents,null,null,this.grid.headersTable().children("thead").children("[data-add-row]").children(":not([data-skip='true'])").first())},endEdit:function(update,raiseEvents){var dialog;if(!this.isEditing()){return}if(this.options.editMode==="dialog"){dialog=$("#"+this.grid.id()+"_updating_dialog_container");if(dialog&&dialog.data("igGridModalDialog")){this._dialogClosingFromUI=!!raiseEvents;dialog.igGridModalDialog("closeModalDialog",update)}}else{return this._endEdit(null,!!update,!raiseEvents)}},findInvalid:function(){var key,all=this._editors,provider;for(key in all){if(all.hasOwnProperty(key)&&all[key]){provider=all[key].data("igEditorFilter").options.provider;provider.refreshValue();if(!all[key].data("igEditorFilter").options.provider.validate()){return key}}}return null},isEditing:function(){return!!this._originalValues},editorForKey:function(key){if(!this._editors){return null}return this._editors[key]||null},editorForCell:function(cell,create){var columnKey=this._getColumnKeyForCell(cell);if(!this._editors){this._editors={}}if(!this._editors[columnKey]&&create){this._editors[columnKey]=this._createEditor(cell,columnKey)}return this._editors[columnKey]||null},destroy:function(){if(this.options.enableAddRow){this._removeAddRow()}if(this.options.enableDeleteRow){this._removeDeleteButton()}if(this.options.showDoneCancelButtons&&this.options.editMode==="row"){this._removeDoneCancelButtons()}this._destroyAllEditors();this._unbindAllEvents();delete this._stopEditingHandler;delete this._gridHandlers;delete this._handlers;delete this._buttonHandlers;delete this._addNewRowHandlers;delete this._validationHandlers;delete this._dialogHandlers;delete this._editorCallbacks;$.Widget.prototype.destroy.call(this);return this},_setOption:function(key,value){var opts=this.options;if(opts[key]===value){return this}if(key==="editMode"){this.endEdit(false,false);this._destroyAllEditors()}$.Widget.prototype._setOption.apply(this,arguments);switch(key){case"rowEditDialogOptions":this._dialogInvalid=true;opts.rowEditDialogOptions=$.extend(opts.rowEditDialogOptions,value);break;case"enableDeleteRow":if(value===true){this._renderDeleteButton()}else{this._removeDeleteButton()}break;case"enableAddRow":if(value===true&&this.grid.options.showHeader){this._updateAddNewRow()}else{this._removeAddRow()}this._rebindEditTriggers();break;case"startEditTriggers":this._analyzeEditTriggers();this._rebindEditTriggers();break;case"columnSettings":this.endEdit(false,false);this._destroyAllEditors();this._processReadOnly();this.grid._renderData();break}if(key==="saveChangesSuccessHandler"){this._addDSSuccessHandler()}else if(key==="saveChangesErrorHandler"){this._addDSErrorHandler()}return this},_gridDataRendering:function(evt,ui){var ds,l,noCancel;if(ui&&ui.owner.id()!==this.grid.id()){return}ds=this.grid.dataSource;l=ds.data()?ds.data().length:0;if(!this.grid.options.showHeader){this._processReadOnly()}if(this.isEditing()){if(!this.endEdit(this.grid.options.autoCommit,true)){this.endEdit(false,true)}}this._pkVal=l+1;if(ds.pendingTransactions().length){if(this.options.enableDataDirtyException){noCancel=this._trigger(this.events.dataDirty,null,{});if(noCancel){throw new Error($.ig.GridUpdating.locale.dataDirtyException)}}}if(l&&!this.grid.options.primaryKey){throw new Error($.ig.Grid.locale.noPrimaryKeyDefined)}},_gridRendered:function(){this._rebindEditTriggers()},_rowsRendered:function(evt,ui){if(ui&&ui.owner&&ui.owner.id()!==this.grid.id()){return}this._paintModifiedCells()},_virtPreRender:function(evt,ui){if(ui&&ui.owner&&ui.owner.id()!==this.grid.id()){return}if(this.isEditing()){if(!this._endEdit(evt,true,false)){this._endEdit(evt,false,false)}}},_virtPostRender:function(evt,ui){if(ui&&ui.owner&&ui.owner.id()!==this.grid.id()){return}this._hideDeleteButton();this._paintModifiedCells()},_headerRendered:function(evt,ui){if(ui.owner.id()!==this.grid.id()){return}this._updateAddNewRow()},_columnFixed:function(){this._editorsContainerInvalid=true;if(this.options.enableAddRow){this._updateAddNewRow()}},_groupedColumnsChanged:function(){if(this.options.enableAddRow){this._updateAddNewRow()}},_hidingFinishing:function(){if(this.isEditing()){if(!this.endEdit(true,true)){this.endEdit(false,true)}}},_columnsModified:function(evt,ui){if(ui.owner.id()!==this.grid.id()){return}this._editorsContainerInvalid=true;if(this.options.enableAddRow){this._updateAddNewRow()}this._paintModifiedCells()},_scroll:function(){if(this.isEditing()){if(this._editingForRowId===null){this._positionDoneCancelButtons(this.grid.headersTable().find("tr[data-new-row]"))}else if(this._editingForRowId!==undefined){this._positionDoneCancelButtons(this.grid.rowById(this._editingForRowId))}this._hideValidatorMessages()}},_mouseDown:function(evt){var target=$(evt.target).closest("td"),targetContainer=target.closest(".ui-iggrid"),targetGrid=target.closest(".ui-iggrid-table"),re=new RegExp("^"+this.grid.id()+"(_fixed)?$"),selection=this.grid.element.data("igGridSelection");if(targetContainer.length&&targetContainer[0]===this.grid.container()[0]){if(this.isEditing()){if(!target.hasClass(this.css.editingCell)&&this._getRowId(target.closest("tr"))!==this._editingForRowId){this._endEdit(evt,true,false)}}if(this.grid.headersTable().children("thead").has(target).length||this.grid.fixedHeadersTable().children("thead").has(target).length){return}if(targetGrid.length&&targetGrid.attr("id").match(re)){if(selection&&!target.hasClass("ui-iggrid-selectedcell")){this._wait=true}}}},_clickTrigger:function(evt){var target=$(evt.target).closest("td"),targetGrid=target.closest(".ui-iggrid");if(targetGrid.length&&targetGrid[0]===this.grid.container()[0]){if(this._wait){delete this._wait;if(evt.type!=="dblclick"){return}}this._startEditForElement(evt,target)}},_keyDown:function(evt){var target=$(evt.target),targetGrid=target.closest(".ui-iggrid"),sel,row;if(!targetGrid.length||targetGrid[0]!==this.grid.container()[0]){return}if(target.is("td,tr")){if(evt.keyCode===$.ui.keyCode.ENTER&&this._editTriggers.enter||evt.keyCode===113&&this._editTriggers.f2){if(this.options.editMode==="cell"&&target.is("tr")){target=this._getEditableCellsForRow(target).first()}this._startEditForElement(evt,target)}else if(evt.keyCode===$.ui.keyCode.DELETE&&this.options.enableDeleteRow&&!this.isEditing()){sel=this.grid.element.data("igGridSelection");if(sel&&sel.options.mode==="row"&&sel.options.multipleSelection){this._deleteMultipleRows(evt)}else{row=target.closest("tr");if(this._isEditableRow(row)){this._deleteRow(evt,this._getRowId(row),false)}}}}},_touchStart:function(evt){this._firstTouchX=evt.originalEvent.touches&&evt.originalEvent.touches[0]?evt.originalEvent.touches[0].pageX:evt.originalEvent.clientX;this._firstTouchRow=evt.originalEvent.touches?$(evt.originalEvent.touches[0].target).closest("tr"):$(evt.originalEvent.target).closest("tr");this._storedScrollLeft=this.grid.scrollContainer().scrollLeft()||0;this._storedScrollWidth=this.grid.scrollContainer().width()||0},_touchEnd:function(evt){var changedTouchX=evt.originalEvent.changedTouches&&evt.originalEvent.changedTouches[0]?evt.originalEvent.changedTouches[0].pageX:evt.originalEvent.clientX;this._storedScrollLeft-=this.grid.scrollContainer().scrollLeft()||0;this._storedScrollWidth-=this.grid.scrollContainer().width()||0;if(this.options.enableDeleteRow&&Math.abs(changedTouchX-this._firstTouchX)>parseInt(this.options.swipeDistance,10)&&this._firstTouchRow&&this._storedScrollLeft===0&&this._storedScrollWidth===0){this._showDeleteButtonFor(this._firstTouchRow)}delete this._firstTouchX;delete this._firstTouchRow;delete this._storedScrollLeft;delete this._storedScrollWidth;delete this._firstTouchRow},_addRowFocus:function(evt){$(evt.target).closest("tr").addClass(this.css.addRowActive)},_addRowBlur:function(evt){$(evt.target).closest("tr").removeClass(this.css.addRowActive)},_rowMouseEnter:function(evt){var row=$(evt.target).closest("tr");if(!this.isEditing()&&this._isEditableRow(row)){this._showDeleteButtonFor(row)}else{this._hideDeleteButton()}},_containerMouseLeave:function(){this._hideDeleteButton()},_buttonMouseEnter:function(evt){var button=$(evt.target).closest(".ui-iggrid-button,.ui-iggrid-deletebutton");if(!button.hasClass("ui-state-disabled")){button.addClass(this.css.buttonHover)}},_buttonMouseLeave:function(evt){var button=$(evt.target).closest(".ui-iggrid-button,.ui-iggrid-deletebutton");button.removeClass(this.css.buttonHover)},_buttonFocus:function(evt){var button=$(evt.target).closest(".ui-iggrid-button,.ui-iggrid-deletebutton");if(!button.hasClass("ui-state-disabled")){button.addClass(this.css.buttonActive)}},_buttonBlur:function(evt){$(evt.target).removeClass(this.css.buttonActive)},_doneButtonClick:function(evt){var target=$(evt.target).closest(".ui-iggrid-button");if(!target.length||target.hasClass(this.css.buttonDisabled)){return}this._endEdit(evt,true)},_doneButtonKeyUp:function(evt){var target=$(evt.target).closest(".ui-iggrid-button");if(!target.length||target.hasClass(this.css.buttonDisabled)||evt.keyCode!==$.ui.keyCode.ENTER){return}this._endEdit(evt,true)},_cancelButtonKeyUp:function(evt){if(evt.keyCode===$.ui.keyCode.ENTER){this._stopEditing()}},_deleteButtonClick:function(evt){var rowId=$(evt.target).closest(".ui-iggrid-deletebutton").data("button-for");if(this._deleteRow(evt,rowId,false)){this._hideDeleteButton()}},_touchDeleteButtonClick:function(evt){var rowId=this._editingForRowId,target=$(evt.target).closest(".ui-iggrid-button");if(this.isEditing()&&!target.hasClass(this.css.buttonDisabled)){this._endEdit(evt,false,false);this._deleteRow(evt,rowId,false)}},_touchDeleteButtonKeyUp:function(evt){var rowId,target=$(evt.target).closest(".ui-iggrid-button");if(evt.keyCode===$.ui.keyCode.ENTER){rowId=this._editingForRowId;if(this.isEditing()&&!target.hasClass(this.css.buttonDisabled)){this._endEdit(evt,false,false);this._deleteRow(evt,rowId,false)}}},_dialogCloseClick:function(){var dialog=$("#"+this.grid.id()+"_updating_dialog_container");if(dialog&&dialog.data("igGridModalDialog")){this._dialogClosingFromUI=true;dialog.igGridModalDialog("closeModalDialog",false)}},_dialogDone:function(evt,ui){ui.toClose=true;this._dialogClosingFromUI=true},_dialogCancel:function(evt,ui){ui.toClose=true;this._dialogClosingFromUI=true},_dialogClosing:function(evt,ui){var dialog=ui.modalDialog;if(this._dialogClosingFromUI){this._trigger(this.events.rowEditDialogBeforeClose,evt,{owner:this,dialogElement:dialog})}return this._endEditDialog(evt,ui.accepted,ui.owner.getContent(),!this._dialogClosingFromUI)},_dialogClosed:function(evt,ui){if(this._dialogClosingFromUI){this._trigger(this.events.rowEditDialogAfterClose,evt,{owner:this,dialogElement:ui.modalDialog})}},_dialogOpening:function(evt,ui){var dialog=ui.modalDialog,opts=this.options.rowEditDialogOptions,rowId=this.grid._fixPKValue(dialog.attr("data-for-rowid")),isAdding=dialog.attr("data-isadding")==="true",content=dialog.igGridModalDialog("getContent"),templateParent,she=opts.showEditorsForHiddenColumns,cols=$.extend([],this.grid.options.columns),values=isAdding?this._getDefaultValues():this._getLatestValues(rowId),cache=content.find("[data-render-tmpl]").children(),invalid=!!this._editorsContainerInvalid;if(cache.length){if(!invalid){cache.detach()}else{this._clearEditorsFromContainer(cache);cache.remove()}}this._renderDialogContent(content,values);this._initDialogEditors(content,cols,values);templateParent=content.find("[data-render-tmpl]");if(templateParent.length&&!templateParent.children().length){if(!invalid){cache.appendTo(templateParent)}else{this._renderDialogTemplate(templateParent,cols,!she);delete this._editorsContainerInvalid}}this._initDialogEditors(content,cols,values);if(isAdding&&!this._anyEditorInvalid()){this._enableDoneButton()}else{this._disableDoneButton()}$.extend(this._originalValues,values,this._originalValues);this._trigger(this.events.rowEditDialogAfterOpen,evt,{owner:this,dialogElement:dialog});this._trigger(this.events.editRowStarted,evt,{owner:this,rowAdding:isAdding,rowID:rowId})},_editorErrorShowing:function(evt,ui){var colKey=this._getEditorKey(ui.owner.element);if(this._errorShownFor&&this._errorShownFor!==colKey){return false}},_editorErrorShown:function(evt,ui){var colKey=this._getEditorKey(ui.owner.element);this._errorShownFor=colKey;this._disableDoneButton()},_editorErrorHidden:function(){delete this._errorShownFor;this._enableDoneButton()},_editorTextChanged:function(){if(!this.findInvalid()){this._enableDoneButton()}},_editorKeyDown:function(evt,ui,columnKey){var keyCode=evt.keyCode,rowId,editor=this._editors[columnKey],providerWrapper=editor.data("igEditorFilter"),provider,row=ui.owner.element.closest("tr"),isAdd=row.hasClass("ui-iggrid-addrow")||row.attr("data-new-row");if(!row.length){return}if(providerWrapper){provider=providerWrapper.options.provider}if(keyCode===$.ui.keyCode.ESCAPE){if(this._revertValueForEditor(provider,columnKey)){evt.stopPropagation();return}}if(this.options.editMode==="dialog"){return}rowId=isAdd?null:this._getRowId(row);this._navigateElement(evt,keyCode,rowId,columnKey,isAdd)},_stopEditing:function(){if(this.isEditing()){this._endEdit(null,false)}},_paintModifiedCells:function(){var transactions=this.grid.pendingTransactions(),tran,i;for(i=0;i<transactions.length;i++){tran=transactions[i];this._updateUIForTransaction(tran)}},_removeAddRow:function(){this.grid.fixedHeadersTable().children("thead").children("tr[data-add-row='true'],tr[data-new-row='true']").remove();this.grid.headersTable().children("thead").children("tr[data-add-row='true'],tr[data-new-row='true']").remove()},_updateAddNewRow:function(){if(this.grid.hasFixedColumns()){this._updateAddNewRowForTable(true)}this._updateAddNewRowForTable(false)},_updateAddNewRowForTable:function(fixed){var numOfCols,thead,i,j,addRow,newRow,vcols,ihc;if(fixed){thead=this.grid.fixedHeadersTable().children("thead")}else{thead=this.grid.headersTable().children("thead")}this._renderAddNewRow(thead);vcols=$.extend([],this.grid._visibleColumns(fixed));ihc=this.grid._initialHiddenColumns;if(ihc&&ihc.length){for(i=0;i<ihc.length;i++){for(j=0;j<vcols.length;j++){if(ihc[i].key===vcols[j].key){$.ig.removeFromArray(vcols,j,j);break}}}}numOfCols=vcols.length;addRow=thead.children("tr[data-add-row='true']");addRow.children("td:last").attr("colspan",numOfCols);newRow=thead.children("tr[data-new-row='true']").empty();for(i=0;i<numOfCols;i++){$("<td></td>").attr("aria-readonly",!!vcols[i].readOnly).appendTo(newRow)}if(fixed&&this.grid.fixingDirection()==="left"||!fixed&&this.grid.fixingDirection()!=="left"){addRow.find("th[data-skip='true'],td[data-skip='true']").remove();newRow.find("th[data-skip='true'],td[data-skip='true']").remove();this.grid._headerInit(addRow,null,true);this.grid._headerInit(newRow,null,true)}},_toggleAddRow:function(){var newRow=this.grid.headersTable().find("tr[data-new-row]"),addRow=this.grid.headersTable().find("tr[data-add-row]"),height;if(this.grid.hasFixedColumns()){newRow=newRow.add(this.grid.fixedHeadersTable().find("tr[data-new-row]"));addRow=addRow.add(this.grid.fixedHeadersTable().find("tr[data-add-row]"))}if(newRow.is(":visible")){newRow.hide();addRow.show()}else{height=addRow.height();addRow.hide();newRow.show();newRow.css("height",height)}},_startEditForElement:function(evt,target){var mode=this.options.editMode,td=target.is("td")?target:null,tr=target.is("tr")?target:target.parent(),isAdding=tr.hasClass("ui-iggrid-addrow"),rowId=isAdding?null:this._getRowId(tr),editEnded=true,col;if(mode==="dialog"){if(!td){td=tr.children("td:not([data-skip='true'],[data-parent='true'])")}if(!this._isDataCell(td)||!this._isEditableRow(tr)){return false}this._startEditDialog(evt,false,rowId,isAdding)}else if(mode==="row"||tr.hasClass("ui-iggrid-addrow")){if(!td){td=tr.children("td:not([data-skip='true'],[data-parent='true'])")}if(!this._isDataCell(td)||!this._isEditableRow(tr)){return false}if(this.isEditing()){if(this._editingForRowId===rowId){return false}editEnded=this._endEdit(evt,true,false)}return!editEnded?false:this._startEditForRow(evt,false,rowId,null,td)}else if(mode==="cell"){if(!this._isEditableCell(td)){return false}if(this.isEditing()){col=this._getColumnKeyForCell(td);if(rowId===this._editingForRowId&&col&&this._originalValues.hasOwnProperty(col)){return false}editEnded=this._endEdit(evt,true,false)}return!editEnded?false:this._startEditForCell(evt,false,rowId,col,td,true,isAdding)}return false},_startEditDialog:function(evt,suppress,rowId,adding){var dialog=this._renderRowEditDialog(!!this._dialogInvalid);if(!suppress&&!this._trigger(this.events.editRowStarting,evt,{owner:this,rowAdding:adding,rowID:rowId})){return false}dialog.attr({"data-for-rowid":rowId,"data-isadding":adding});if(!suppress){this._trigger(this.events.rowEditDialogBeforeOpen,evt,{owner:this,dialogElement:dialog})}this._disableDoneButton();dialog.igGridModalDialog("openModalDialog");return true},_startEditForRow:function(evt,suppress,rowId,columnKey,element){var rowElement,args,editModeStarted=false,colElements,pair,columnToFocus=null,defaultIndex,i,allValues,cellValue,isAdding,visibleCols=this.grid._visibleColumns(),vcc=this.grid._virtualColumnCount||visibleCols.length,vci=this.grid._startColIndex||0;if(element.is("tr")){rowElement=element}else if(element.is("td")){rowElement=element.parent()}else{rowElement=this.grid.rowById(rowId)}isAdding=rowElement.hasClass("ui-iggrid-addrow");args={owner:this,rowAdding:isAdding,rowID:rowId};if(!suppress&&!this._trigger(this.events.editRowStarting,evt,args)){return}if(isAdding){rowElement=this._combineRowElements(rowElement);if(!rowElement.attr("[data-new-row]")){rowElement=rowElement.siblings("[data-new-row]");this._toggleAddRow()}}if(element&&element.is("td")&&!columnKey){columnKey=this._getColumnKeyForCell(element)}defaultIndex=isAdding?0:this._getVisibleIndexForKey(columnKey);defaultIndex=Math.min(Math.max(vci,defaultIndex),vci+vcc-1);if(!this.grid.columnByKey(columnKey).readOnly){columnToFocus=columnKey}else{i=defaultIndex+1;while(visibleCols[i].key!==columnKey){if(i===vci+vcc){i=vci}if(!visibleCols[i].readOnly){columnToFocus=visibleCols[i].key;break}i++}}colElements=this._getEditableElementsForRow(rowElement);allValues=isAdding?this._getDefaultValues():this._getLatestValues(rowId);for(i=0;i<colElements.length;i++){pair=colElements[i];cellValue=allValues[pair.colKey]===undefined?null:allValues[pair.colKey];editModeStarted=this._startEditForCell(evt,suppress,rowId,pair.colKey,pair.element,pair.colKey===columnToFocus,isAdding,cellValue)||editModeStarted}if(this.options.showDoneCancelButtons){this._showDoneCancelButtons();this._positionDoneCancelButtons(rowElement);if(isAdding&&!this._anyEditorInvalid()){this._enableDoneButton()}else{this._disableDoneButton()}if(this._renderTouchUI){this._updateDeleteButton(isAdding)}}if(editModeStarted){if(!suppress){this._trigger(this.events.editRowStarted,evt,args)}this._editingForRowId=isAdding?null:rowId;$.extend(this._originalValues,allValues,this._originalValues);this._selectionToggle(rowElement)}else{rowElement.children().removeClass(this.css.editingCell);return false}return true},_startEditForCell:function(evt,suppress,rowId,columnKey,element,focus,isAdding,value){var providerWrapper,provider,validator,args,editor,width,height;columnKey=columnKey||this._getColumnKeyForCell(element);rowId=rowId===null?this._getRowId(element.closest("tr")):rowId;if(element){element.addClass(this.css.editingCell);editor=this.editorForCell(element,true);providerWrapper=editor.data("igEditorFilter");if(providerWrapper){provider=providerWrapper.options.provider}else{return false}height=element.outerHeight();width=element.outerWidth();width=this._isLastScrollableCell(element)?width-this.grid._scrollbarWidth():width}if(value===undefined){value=this._getLatestValues(rowId,columnKey);value=value===undefined?null:value}args={owner:this,rowID:rowId,columnIndex:element?element.index():-1,columnKey:columnKey,editor:editor,value:value,rowAdding:isAdding};if(!suppress&&!this._trigger(this.events.editCellStarting,evt,args)){if(editor){provider.setValue(null)}element.removeClass(this.css.editingCell);return false}if(editor){editor.prependTo(element);provider.setSize(Math.max(8,width),Math.max(10,height));validator=provider.validator();provider.setValue(args.value)}this._originalValues=this._originalValues||{};this._originalValues[columnKey]=editor?provider.getValue():value;this._trigger(this.events.editCellStarted,evt,args);if(focus&&editor){this._activateEditor(editor)}this._hideDeleteButton();this._editingForRowId=rowId;if(this.options.editMode==="cell"&&!isAdding){this._selectionToggle(element)}return true},_endEditDialog:function(evt,shouldUpdate,dialogContent,suppress){var newValues={},prevValues=this._originalValues,update,colElements,hasInvalid,add=dialogContent.parent().attr("data-isadding")==="true",noCancel,isChanged,rowId=this.grid._fixPKValue(dialogContent.parent().data("for-rowid"));colElements=this._getEditedColumnElementsForDialog(dialogContent);if(shouldUpdate){hasInvalid=this._handleInvalid(colElements);if(hasInvalid){return false}newValues=this._getNewValuesForRow(colElements);isChanged=this._compareValues(prevValues,newValues);if(add){newValues=$.extend({},prevValues,newValues)}}update={update:shouldUpdate&&(isChanged||add)};if(!suppress){noCancel=this._fireEndingEvents(evt,prevValues,newValues,colElements,rowId,add,update);if(!noCancel){return false}}delete this._originalValues;delete this._editingForRowId;if(update.update&&(this._compareValues(prevValues,newValues)||add)){if(add){this._addRow(evt,newValues,prevValues,suppress)}else{this._updateRow(prevValues[this.grid.options.primaryKey],newValues,null)}}if(!suppress){this._fireEndedEvents(evt,prevValues,newValues,colElements,rowId,add,update)}this._hideValidatorMessages();return true},_endEdit:function(evt,shouldUpdate,suppress){var cell,row,rowId,colKey,colElements,hasInvalid,add,prevValues=this._originalValues,newValues={},isChanged,noCancel=true,update,val;cell=this.grid.container().find("."+this.css.editingCell).first();row=cell.closest("tr");rowId=this._getRowId(row);add=row.data("new-row");colElements=this._getEditedColumnElementsForRow(row);if(shouldUpdate){hasInvalid=this._handleInvalid(colElements);if(hasInvalid){return false}newValues=this._getNewValuesForRow(colElements);isChanged=this._compareValues(prevValues,newValues);if(add){newValues=$.extend({},prevValues,newValues)}}update={update:shouldUpdate&&(isChanged||add)};if(!suppress){noCancel=this._fireEndingEvents(evt,prevValues,newValues,colElements,rowId,add,update);if(!noCancel){return false}}this._closeEditingForRow(colElements);delete this._originalValues;delete this._editingForRowId;if(update.update&&(this._compareValues(prevValues,newValues)||add)){if(add){this._addRow(evt,newValues,prevValues,suppress)}else if(this.options.editMode==="cell"){colKey=colElements[0].colKey;cell=colElements[0].element;val=newValues[colKey];this._updateCell(rowId,colKey,val,cell)}else{this._updateRow(rowId,newValues,row)}}if(!suppress){this._fireEndedEvents(evt,prevValues,newValues,colElements,rowId,add,update)}this._hideDoneCancelButtons();if(add){this._toggleAddRow()}this._selectionToggle();return true},_handleInvalid:function(colElements){var i,key,editor,provider,providerWrapper;for(i=0;i<colElements.length;i++){key=colElements[i].colKey;editor=this.editorForKey(key);providerWrapper=editor.data("igEditorFilter");provider=providerWrapper.options.provider;if(editor&&editor.length&&editor.is(":visible")&&(providerWrapper.hasInvalidMessage()||!provider.validate()||!provider.isValid())){this._activateEditor(editor);this._disableDoneButton();return true}}return false},_fireEndingEvents:function(evt,prevValues,newValues,colElements,rowId,add,update){var i,colKey,editor,rArg,cArg,mode=this.options.editMode,noCancel;if(mode!=="cell"){rArg={owner:this,oldValues:prevValues,values:update.update?newValues:prevValues,rowID:rowId,update:update.update,rowAdding:add};noCancel=this._trigger(this.events.editRowEnding,evt,rArg);if(update.update){update.update=rArg.update}if(!noCancel){return false}}if(mode!=="dialog"){for(i=0;i<colElements.length;i++){colKey=colElements[i].colKey;editor=this.editorForKey(colKey);cArg={owner:this,rowID:rowId,columnIndex:colElements[i].element.index(),columnKey:colKey,editor:editor,value:newValues[colKey],oldValue:prevValues[colKey],update:update.update&&newValues[colKey]!==prevValues[colKey],rowAdding:add};noCancel=this._trigger(this.events.editCellEnding,evt,cArg);if(!noCancel&&mode==="cell"){return false}if(update.update){if(mode==="cell"&&!add){update.update=cArg.update}else{if(!cArg.update){newValues[colKey]=prevValues[colKey]}}}}}return true},_fireEndedEvents:function(evt,prevValues,newValues,colElements,rowId,add,update){var i,colKey,editor,rArg,cArg,mode=this.options.editMode;if(mode!=="dialog"){for(i=0;i<colElements.length;i++){colKey=colElements[i].colKey;editor=this.editorForKey(colKey);cArg={owner:this,rowID:rowId,columnIndex:colElements[i].element.index(),columnKey:colKey,editor:editor,value:newValues[colKey],oldValue:prevValues[colKey],update:update.update&&newValues[colKey]!==prevValues[colKey],rowAdding:add};this._trigger(this.events.editCellEnded,evt,cArg)}}if(mode!=="cell"){rArg={owner:this,oldValues:prevValues,values:update.update?newValues:prevValues,rowID:rowId,update:update.update,rowAdding:add};
this._trigger(this.events.editRowEnded,evt,rArg)}},_getNewValuesForRow:function(colElements){var i,key,editor,provider,providerWrapper,newValues={};for(i=0;i<colElements.length;i++){key=colElements[i].colKey;editor=this.editorForKey(key);providerWrapper=editor.data("igEditorFilter");provider=providerWrapper.options.provider;provider.refreshValue();newValues[key]=provider.getValue()}return newValues},_compareValues:function(prevValues,newValues){var key,noChange=true;for(key in newValues){if(newValues.hasOwnProperty(key)){if($.type(newValues[key])==="date"&&$.type(prevValues[key])==="date"){noChange=noChange&&newValues[key].getTime()===prevValues[key].getTime()}else{noChange=noChange&&newValues[key]===prevValues[key]}}}return!noChange},_closeEditingForRow:function(colElements){var i,colKey,editor,provider,providerWrapper;for(i=0;i<colElements.length;i++){colKey=colElements[i].colKey;editor=this.editorForKey(colKey);providerWrapper=editor.data("igEditorFilter");provider=providerWrapper.options.provider;providerWrapper.remove();colElements[i].element.closest("td").removeClass(this.css.editingCell)}},_createEditor:function(cell,columnKey,element){var vh=this._validationHandlers,colSetting=this._getColSettingsForCol(columnKey),column=this.grid.columnByKey(columnKey),provider=colSetting?colSetting.editorProvider:null,editorOptions,validatorOptions,required,editorMargins,wrapper,elem,format=column.format;editorMargins=!element?this._getEditorMargins(cell):null;if(colSetting){editorOptions=colSetting.editorOptions||{};validatorOptions=editorOptions.validatorOptions;required=colSetting.required;if(!validatorOptions&&(colSetting.validation||required)){validatorOptions={}}if(required){validatorOptions.required=true;editorOptions.required=true}}if(!validatorOptions&&this.options.validation){validatorOptions={}}if(validatorOptions){if(!this.grid.element.igValidator){throw new Error($.ig.GridUpdating.locale.igValidatorException)}if(colSetting){colSetting.editorOptions=editorOptions}editorOptions.validatorOptions=validatorOptions;validatorOptions.notificationOptions=validatorOptions.notificationOptions||{};if(!element){validatorOptions.notificationOptions.mode="popover";validatorOptions.notificationOptions.containment=this.grid.container();validatorOptions.notificationOptions.appendTo=this.grid.container()}}if(!provider){provider=this._getProviderForKey(column,colSetting)}elem=provider.createEditor(this._editorCallbacks,columnKey,colSetting?colSetting.editorOptions||null:null,this._getNextTabIndex(),format,element);provider.attachErrorEvents(vh.errorShowing,vh.errorShown,vh.errorHidden);if(!element){elem.addClass(this.css.editor).css({marginLeft:editorMargins.x+"px",marginTop:editorMargins.y+"px"});elem.css("position","absolute")}wrapper=elem.igEditorFilter({provider:provider});return wrapper},_getProviderForKey:function(column,setting){var provider,dataType=column.dataType,format=column.format,editorType=setting?setting.editorType:null,value,ds;if(dataType==="bool"){provider=new $.ig.EditorProviderBoolean;if(format==="checkbox"||!format&&this.grid.options.renderCheckboxes){provider.renderFormat="checkbox"}else{provider.renderFormat="dropdown"}}else if(editorType==="combo"){provider=new $.ig.EditorProviderCombo}else if(editorType==="rating"){provider=new $.ig.EditorProviderRating}else if(editorType==="mask"){provider=new $.ig.EditorProviderMask}else if((editorType||format)==="currency"){provider=new $.ig.EditorProviderCurrency}else if((editorType||format)==="percent"){provider=new $.ig.EditorProviderPercent}else if(editorType==="numeric"||dataType==="number"){provider=new $.ig.EditorProviderNumeric}else if(editorType==="text"||dataType==="string"){provider=new $.ig.EditorProviderText}else if(editorType==="datepicker"){provider=new $.ig.EditorProviderDatePicker}else if((editorType||dataType)==="date"){provider=new $.ig.EditorProviderDate}else{ds=this.grid.dataSource;if(ds&&ds.data()&&ds.data().length){value=ds.data()[0][column.key];switch($.type(value)){case"number":return new $.ig.EditorProviderNumeric;case"string":return new $.ig.EditorProviderText;case"date":return new $.ig.EditorProviderDate;case"boolean":provider=new $.ig.EditorProviderBoolean;if(format==="checkbox"||!format&&this.grid.options.renderCheckboxes){provider.renderFormat="checkbox"}else{provider.renderFormat="dropdown"}return provider}}throw new Error($.ig.GridUpdating.locale.editorTypeCannotBeDetermined+column.key)}return provider},_getEditorKey:function(element){var id=element.attr("id"),colKey,idx;if(id&&id.length){idx=id.indexOf("_editorfor_");colKey=idx>0?id.substring(idx+10):null}if(!colKey){colKey=this._getColumnKeyForCell(element.closest("td"))}return colKey},_getEditorMargins:function(cell){if(!cell||!cell.length){return{x:0,y:0}}if(!this._editorMargins){var btw=parseInt(cell.css("borderTopWidth"),10);var paddingTop=parseInt(cell.css("paddingTop"),10);var blw=parseInt(cell.css("borderLeftWidth"),10);var paddingLeft=parseInt(cell.css("paddingLeft"),10);this._editorMargins={x:-1*(paddingLeft+blw),y:-1*(paddingTop+btw)}}return this._editorMargins},_getColSettingsForCol:function(colKey){var i,settings=this.options.columnSettings;if(!settings){return null}for(i=0;i<settings.length;i++){if(settings[i].columnKey===colKey){return settings[i]}}},_destroyAllEditors:function(){var key;for(key in this._editors){if(this._editors.hasOwnProperty(key)){if(this._editors[key].data("igEditorFilter")){this._editors[key].igEditorFilter("destroy");this._editors[key].remove()}}}delete this._editors},_navigateElement:function(evt,keyCode,rowId,columnKey,isAdd){if(keyCode===$.ui.keyCode.TAB||this.options.horizontalMoveOnEnter&&keyCode===$.ui.keyCode.ENTER){if(evt.shiftKey){return this._navigateLeft(evt,rowId,columnKey,isAdd)}this._navigateRight(evt,rowId,columnKey,isAdd)}if(keyCode===$.ui.keyCode.ENTER){if(isAdd){return this._endEdit(evt,true,false)}if(evt.shiftKey){return this._navigateUp(evt,rowId,columnKey)}return this._navigateDown(evt,rowId,columnKey)}if(keyCode===$.ui.keyCode.ESCAPE){return this._stopEditing()}if(this.options.excelNavigationMode){switch(keyCode){case $.ui.keyCode.LEFT:return this._navigateLeft(evt,rowId,columnKey,isAdd);case $.ui.keyCode.RIGHT:return this._navigateRight(evt,rowId,columnKey,isAdd);case $.ui.keyCode.DOWN:if(!isAdd){return this._navigateDown(evt,rowId,columnKey)}break;case $.ui.keyCode.UP:if(!isAdd){return this._navigateUp(evt,rowId,columnKey)}break}}},_navigateLeft:function(evt,rowId,columnKey,isAdd){if(!isAdd&&this.options.editMode==="cell"){return this._navigateLeftForCell(evt,rowId,columnKey)}},_navigateLeftForCell:function(evt,rowId,columnKey){var i,cols=this.grid._visibleColumns(),nextCell,curRow=this.grid.rowById(rowId);if(!this._endEdit(evt,true,false)){return}for(i=0;i<cols.length;i++){if(cols[i].key===columnKey){break}}while(curRow.length){rowId=this._getRowId(curRow);while(--i>=0){if(!cols[i].readOnly){nextCell=this.grid.cellById(rowId,cols[i].key);this._startEditForCell(evt,false,rowId,cols[i].key,nextCell,true,false);evt.preventDefault();return}}curRow=curRow.prevAll(":not([data-container],[data-grouprow],.ui-iggrid-deletedrecord):visible").first();if(!curRow.length&&this.options.wrapAround){curRow=this.element.children("tbody").children("tr:not([data-container=true]):last")}i=cols.length}},_navigateRight:function(evt,rowId,columnKey,isAdd){if(!isAdd&&this.options.editMode==="cell"){return this._navigateRightForCell(evt,rowId,columnKey)}},_navigateRightForCell:function(evt,rowId,columnKey){var i,cols=this.grid._visibleColumns(),nextCell,curRow=this.grid.rowById(rowId);if(!this._endEdit(evt,true,false)){return}for(i=0;i<cols.length;i++){if(cols[i].key===columnKey){break}}while(curRow.length){rowId=this._getRowId(curRow);while(++i<cols.length){if(!cols[i].readOnly){nextCell=this.grid.cellById(rowId,cols[i].key);this._startEditForCell(evt,false,rowId,cols[i].key,nextCell,true,false);evt.preventDefault();return}}curRow=curRow.nextAll(":not([data-container],[data-grouprow],.ui-iggrid-deletedrecord):visible").first();if(!curRow.length&&this.options.wrapAround){curRow=this.element.children("tbody").children("tr:first")}i=-1}},_navigateUp:function(evt,rowId,columnKey,element){var nextCell,curRow=element?element.closest("tr"):this.grid.rowById(rowId);if(!this._endEdit(evt,true,false)){return}curRow=curRow.prevAll(":not([data-container],[data-grouprow],.ui-iggrid-deletedrecord):visible").first();if(!curRow.length&&this.options.wrapAround){curRow=this.element.children("tbody").children("tr:not([data-container=true]):last")}if(curRow.length){rowId=this._getRowId(curRow);nextCell=this.grid.cellById(rowId,columnKey);if(this.options.editMode==="row"){this._startEditForRow(evt,false,rowId,columnKey,nextCell)}else{this._startEditForCell(evt,false,rowId,columnKey,nextCell,true,false)}evt.originalEvent.stopPropagation();evt.originalEvent.preventDefault()}},_navigateDown:function(evt,rowId,columnKey,element){var nextCell,curRow=element?element.closest("tr"):this.grid.rowById(rowId);if(!this._endEdit(evt,true,false)){return}curRow=curRow.nextAll(":not([data-container],[data-grouprow],.ui-iggrid-deletedrecord):visible").first();if(!curRow.length&&this.options.wrapAround){curRow=this.element.children("tbody").children("tr:first")}if(curRow.length){rowId=this._getRowId(curRow);nextCell=this.grid.cellById(rowId,columnKey);if(this.options.editMode==="row"){this._startEditForRow(evt,false,rowId,columnKey,nextCell)}else{this._startEditForCell(evt,false,rowId,columnKey,nextCell,true,false)}evt.originalEvent.stopPropagation();evt.originalEvent.preventDefault()}},_updateUnboundValuesForRow:function(row){if(!this.grid._hasUnboundColumns){return}var i,uc=this.grid._unboundColumns,col,f,rec;if(!uc||!uc.length){return}if($.type(row)==="object"){rec=row}for(i=0;i<uc.length;i++){col=uc[i];if(col&&col.editModeUnboundValues!=="manual"&&col.formula){if(col.formula){f=this.grid._getUnboundColumnFormula(col);if(f){if(!rec){rec=this.grid.findRecordByKey(row)}if(!rec){return}rec[col.key]=f.apply(col,[rec,this.grid.element])}}}}},_isEditableRow:function(row){return row&&row.is("tr")&&!row.hasClass(this.grid.css.deletedRecord)&&!row.attr("data-grouprow")&&(row.attr("data-id")!==undefined||row.attr("data-add-row")!==undefined)},_isEditableCell:function(cell){return this._isDataCell(cell)&&cell.attr("aria-readonly")!=="true"&&this._isEditableRow(cell.parent())},_isDataCell:function(cell){return cell&&cell.is("td")&&!cell.attr("data-skip")&&!cell.attr("data-parent")},_isLastScrollableCell:function(cell){return cell&&cell.is(":last-child")&&(parseInt(cell.css("padding-right"),10)>12||this.grid._hscrollbar().is(":visible")&&this.grid._hasVerticalScrollbar)&&this.grid.scrollContainer()&&this.grid.scrollContainer().has(cell).length},_selectionToggle:function(element){var sel=this.grid.element.data("igGridSelection");if(!sel){return}sel._suspend=!sel._suspend;if(element){this._actElement=element}else{this._actElement.focus()}},_showDoneCancelButtons:function(){var container=this._findElementInScrollContainer(".ui-iggrid-buttoncontainer:first");if(!container.length){container=this._renderDoneCancelButtons()}container.show()},_hideDoneCancelButtons:function(){var container=this._findElementInScrollContainer(".ui-iggrid-buttoncontainer:first");if(container.length){container.hide()}},_positionDoneCancelButtons:function(row){var container=this._findElementInScrollContainer(".ui-iggrid-buttoncontainer:first"),sbw=this.grid._hasVerticalScrollbar===true?this.grid._scrollbarWidth():0,left,top,sc,contHeight,scHeight,rowPos,go=this.grid.options,v,hasHeight=go.height!==null&&go.height!==undefined,scrContainer;row=this._combineRowElements(row);sc=container.parent();left=sc.outerWidth()-container.outerWidth()-sbw+sc.scrollLeft();if(!sc.has(row).length&&sc[0]!==this.grid.container()[0]){top=sc.scrollTop()}else{contHeight=container.outerHeight();scHeight=sc.outerHeight();rowPos=row.position();top=rowPos.top+row.outerHeight();if(top+contHeight>scHeight){top=rowPos.top-contHeight}if(!hasHeight){v=go.virtualization||go.rowVirtualization||go.columnVirtualization;scrContainer=v?this.grid._vdisplaycontainer():this.grid.scrollContainer();if(scrContainer.length){top+=scrContainer.position().top}}top+=sc.scrollTop()}container.css({top:top,left:left})},_disableDoneButton:function(){if(this.options.editMode==="dialog"){$("#"+this.grid.id()+"_updating_dialog_container").igGridModalDialog("option","buttonApplyDisabled",true)}else{$("#"+this.grid.id()+"_updating_done").addClass(this.css.buttonDisabled).removeClass(this.css.buttonActive)}},_enableDoneButton:function(){if(this.options.editMode==="dialog"){$("#"+this.grid.id()+"_updating_dialog_container").igGridModalDialog("option","buttonApplyDisabled",false)}else{$("#"+this.grid.id()+"_updating_done").removeClass(this.css.buttonDisabled)}},_updateDeleteButton:function(isAdding){var button=$("#"+this.grid.id()+"_updating_delete_touch");if(button.length){if(isAdding||!this.options.enableDeleteRow){button.addClass(this.css.buttonDisabled)}else{button.removeClass(this.css.buttonDisabled)}}},_showDeleteButtonFor:function(row){var db=$("#"+this.grid.id()+"_updating_deletehover"),go=this.grid.options,v,hasHeight=go.height!==null&&go.height!==undefined,sbw=this.grid._hasVerticalScrollbar===true?this.grid._scrollbarWidth():0,left,top,sc,offset=0,scrContainer;if(db.length){db.show();sc=db.parent();if(!hasHeight){v=go.virtualization||go.rowVirtualization||go.columnVirtualization;scrContainer=v?this.grid._vdisplaycontainer():this.grid.scrollContainer();if(scrContainer.length){offset=scrContainer.position().top}}left=sc.outerWidth()-db.outerWidth()-sbw+sc.scrollLeft()-5;top=row.position().top+row.outerHeight()/2-db.outerHeight()/2+sc.scrollTop()+offset;db.css({top:top,left:left});db.data("button-for",this._getRowId(row))}},_hideDeleteButton:function(){var db=$("#"+this.grid.id()+"_updating_deletehover");if(db.length){db.hide()}},_getNextTabIndex:function(){var gti=this.grid.options.tabIndex;return gti+1},_getRowId:function(element){return this.grid._fixPKValue(element.attr("data-id"))},_getEditableElementsForRow:function(row){var result=[],i,cells=this._getEditableCellsForRow(row),editableCols=$.grep(this.grid._visibleColumns(),function(col){return!col.readOnly}),vcc=this.grid._virtualColumnCount||this.grid._visibleColumns().length,vci=this.grid._startColIndex||0;for(i=0;i<editableCols.length;i++){result.push({colKey:editableCols[i].key,element:i>=vci&&i<vci+vcc?cells.eq(i-vci):null})}return result},_getEditedColumnElementsForRow:function(row){var result=[],cells,i;cells=this._getEditableCellsForRow(row).filter("."+this.css.editingCell);for(i=0;i<cells.length;i++){result.push({colKey:this._getColumnKeyForCell(cells.eq(i)),element:cells.eq(i)})}return result},_getEditedColumnElementsForDialog:function(content){var result=[],cols=this.grid.options.columns,i,key,element;for(i=0;i<cols.length;i++){key=cols[i].key;element=content.find("[data-editor-for-"+key.toLowerCase()+"]");if(element.length===1){result.push({colKey:key,element:element})}}return result},_getEditableCellsForRow:function(row){return this._combineRowElements(row).children("td[aria-readonly='false']:not([data-skip='true'],[data-parent])")},_combineRowElements:function(row){var frow,urow,fixingDir=this.grid.fixingDirection(),type=row.attr("data-new-row")?"[data-new-row]":"[data-add-row]";if(this.grid.hasFixedColumns()){if(this.grid._isFixedElement(row)){frow=row;urow=row.parent().is("thead")?this.grid.headersTable().children("thead").children("tr"+type):this._getRowByIndex(this._getIndexForRow(row),false)}else{urow=row;frow=row.parent().is("thead")?this.grid.fixedHeadersTable().children("thead").children("tr"+type):this._getRowByIndex(this._getIndexForRow(row),true)}return fixingDir==="left"?frow.add(urow):urow.add(frow)}return row},_getVisibleIndexForKey:function(columnKey){var vc=this.grid._visibleColumns(),i;for(i=0;i<vc.length;i++){if(vc[i].key===columnKey){return i}}return null},_getRowByIndex:function(index,fixed){var tbody=fixed?this.grid.fixedBodyContainer().find("tbody"):this.grid.element.find("tbody");return tbody.children("tr:not([data-container])").eq(index)},_getIndexForRow:function(row){return row.closest("tbody").children("tr:not([data-container])").index(row)+(this.grid._startRowIndex||0)},_getColumnKeyForCell:function(cell){var col=this.grid._getColumnByTD(cell);return col?col.column.key:null},_analyzeEditTriggers:function(){var trg=this.options.startEditTriggers,key;this._editTriggers={click:false,dblclick:false,f2:false,enter:false};for(key in this._editTriggers){if(this._editTriggers.hasOwnProperty(key)){if($.type(trg)==="array"){this._editTriggers[key]=$.inArray(key,trg)}else{this._editTriggers[key]=trg.toLowerCase().indexOf(key)>=0}}}},_rebindEditTriggers:function(){var selector="#"+this.grid.id()+">tbody>tr>td,#"+this.grid.id()+"_fixed>tbody>tr>td",hId,scr;if(this.options.enableAddRow&&this.grid.options.showHeader){hId=this.grid.headersTable().attr("id");selector+=",#"+hId+">thead>tr.ui-iggrid-addrow,#"+hId+"_fixed>thead>tr.ui-iggrid-addrow"}this.grid.container().off(".triggers");this.grid.container().on({"mousedown.triggers":this._handlers.mouseDown},selector);if(this._editTriggers.dblclick){this.grid.container().on({"dblclick.triggers":this._handlers.clickTrigger},selector)}else if(this._editTriggers.click){this.grid.container().on({"click.triggers":this._handlers.clickTrigger},selector)}this.grid.container().on({"keydown.triggers":this._handlers.keyDown},selector.replace(/>td/g,""));if(this.options.enableDeleteRow){this._renderDeleteButton()}scr=this._addElementToScrollContainer($());if(scr&&scr.length&&scr[0]!==this.grid.container()[0]){scr.unbind("scroll",this._handlers.scroll).bind("scroll",this._handlers.scroll)}},_getLatestValues:function(id,columnKey){var original,record,transactions,i,notNew=false;original=this.grid.dataSource.findRecordByKey(id);record=jQuery.extend(true,{},original);transactions=this.grid.dataSource.pendingTransactions();for(i=transactions.length-1;i>=0;i--){if(transactions[i].rowId===id){switch(transactions[i].type){case"row":case"newrow":jQuery.extend(true,record,transactions[i].row);break;case"cell":record[transactions[i].col]=transactions[i].value;break;case"deleterow":record=null;break}notNew=true}}if(original||notNew){return $.type(columnKey)==="string"?record[columnKey]:record}throw new Error($.ig.GridUpdating.locale.recordOrPropertyNotFoundException)},_getDefaultValues:function(columnKey){var defVals=this._defaultValues,allValues,settings=this.options.columnSettings,i,gpkArgs;if(!defVals){defVals={};for(i=0;i<settings.length;i++){if(settings[i].defaultValue!==undefined&&$.type(settings[i].columnKey)==="string"){defVals[settings[i].columnKey]=settings[i].defaultValue}}this._defaultValues=defVals}allValues=jQuery.extend(true,{},defVals);if((!columnKey||columnKey===this.grid.options.primaryKey)&&!defVals.hasOwnProperty(columnKey)){gpkArgs={};if(this._getPKType()==="string"){gpkArgs.value=String(this._pkVal)}else{gpkArgs.value=this._pkVal}this._trigger(this.events.generatePrimaryKeyValue,null,gpkArgs);allValues[this.grid.options.primaryKey]=gpkArgs.value}return columnKey?allValues[columnKey]:allValues},_getPKType:function(){var pk=this.grid.options.primaryKey,pkType,pkColumn,data=this.grid.dataSource._data;if(!this._pkt){if(!pk){throw new Error($.ig.GridUpdating.locale.noPrimaryKeyException)}pkColumn=this.grid.columnByKey(pk);if(pkColumn&&pkColumn.dataType){pkType=pkColumn.dataType}else{pkType=data&&data.length>0&&data[0][pk]!==null&&data[0][pk]!==undefined?$.type(data[0][pk]):null}this._pkt=pkType}return this._pkt},_updateUIForTransaction:function(t,element){var go=this.grid.options,autoCommit=go.autoCommit,v=go.virtualization||go.rowVirtualization||go.columnVirtualization,fv=go.virtualizationMode==="fixed",row,vals,pk,grp,idx,nextRow;switch(t.type){case"newrow":grp=this.grid.element.children("tbody").children("tr.ui-iggrid-groupedrow").length>0;this._updateUnboundValuesForRow(t.row);if(v&&!autoCommit){break}if(grp){this.grid.element.data("igGridGroupBy")._renderNewRow(t.row)}else{this.grid.renderNewRow(t.row)}row=this.grid.rowById(t.rowId);if(!autoCommit&&row.length){this._combineRowElements(row).addClass(this.grid.css.modifiedRecord)}break;case"cell":pk=autoCommit&&t.col===go.primaryKey?t.value:t.rowId;row=element?element.parent():this.grid.rowById(pk);vals=this._getLatestValues(pk);vals[t.col]=t.value;this._updateUnboundValuesForRow(vals);if(!row||!row.length){break}this.grid._renderRow(vals,row);if(!autoCommit){this._combineRowElements(row).addClass(this.grid.css.modifiedRecord)}else{this._combineRowElements(row).attr("data-id",pk).data("id",pk)}break;case"row":pk=autoCommit&&t.row.hasOwnProperty(go.primaryKey)?t.row[go.primaryKey]:t.rowId;row=element||this.grid.rowById(pk);vals=$.extend({},this._getLatestValues(pk),t.row);this._updateUnboundValuesForRow(vals);if(!row||!row.length){break}this.grid._renderRow(vals,row);if(!autoCommit){this._combineRowElements(row).addClass(this.grid.css.modifiedRecord)}else{this._combineRowElements(row).attr("data-id",pk).data("id",pk)}break;case"deleterow":row=element||this.grid.rowById(t.rowId);if(autoCommit&&v){this._deleteRowVirtualization(row,fv);break}if(!row||!row.length){break}if(autoCommit){idx=row.index();row=this._combineRowElements(row);nextRow=row.next("tr[data-container='true']");if(nextRow.length===1){nextRow.remove()}row.remove();this.grid._reapplyZebraStyle(idx)}else{this._combineRowElements(row).addClass(this.grid.css.deletedRecord)}break}return row},_processReadOnly:function(){var i,col,colSettings=this.options.columnSettings;if(colSettings){for(i=0;i<colSettings.length;i++){if(colSettings[i].readOnly){col=this.grid.columnByKey(colSettings[i].columnKey);if(col){col.readOnly=true}}}}},_isMultiLineText:function(key){var cs=this._getColSettingsForCol(key);if(cs&&cs.editorOptions){return cs.editorOptions.textMode==="multiline"}return false},_anyEditorInvalid:function(){var key,all=this._editors,provider;for(key in all){if(all.hasOwnProperty(key)&&all[key]){provider=all[key].data("igEditorFilter").options.provider;provider.refreshValue();if(!all[key].data("igEditorFilter").options.provider.isValid()){return true}}}return false},_revertValueForEditor:function(provider,columnKey){var oval,nval;provider.refreshValue();nval=provider.getValue();oval=this._originalValues[columnKey];if($.type(nval)==="date"&&$.type(oval)==="date"&&nval.getTime()!==oval.getTime()){provider.setValue(new Date(oval.getTime()));return true}if(oval!==nval){provider.setValue(oval);return true}return false},_hideValidatorMessages:function(){var key,e=this._editors,editor,wrapper;for(key in e){if(e.hasOwnProperty(key)){editor=e[key];wrapper=editor.data("igEditorFilter");if(wrapper&&wrapper.hasInvalidMessage()){editor.igNotifier("hide")}}}},_addDSSuccessHandler:function(){var fS,grid=this.grid;if(this._addChangesSuccessHandler!==null&&this._addChangesSuccessHandler!==undefined){grid.dataSource._removeChangesSuccessHandler(this._addChangesSuccessHandler)}fS=this.options.saveChangesSuccessHandler;if(fS){if($.type(fS)==="string"&&window[fS]&&$.type(window[fS])==="function"){fS=window[fS]}}if($.type(fS)!=="function"){fS=null}this._addChangesSuccessHandler=function(data){if(data.Success){if(grid.rows().parent().find("."+grid.css.deletedRecord).length){grid._renderData()}grid.rows().removeClass(grid.css.modifiedRecord);if(fS){fS(data)}}};grid.dataSource._addChangesSuccessHandler(this._addChangesSuccessHandler)},_addDSErrorHandler:function(){var fE;if(this._addChangesErrorHandler!==null&&this._addChangesErrorHandler!==undefined){this.grid.dataSource._removeChangesErrorHandler(this._addChangesErrorHandler)}if(this.options.saveChangesErrorHandler){fE=this.options.saveChangesErrorHandler;if($.type(fE)==="string"&&window[fE]&&$.type(window[fE])==="function"){fE=window[fE]}if($.type(fE)==="function"){this._addChangesErrorHandler=function(jqXHR,textStatus,errorThrown){fE(jqXHR,textStatus,errorThrown)};this.grid.dataSource._addChangesErrorHandler(this._addChangesErrorHandler)}}},_deleteRowVirtualization:function(row,fixed){if(fixed){if(this.grid._startRowIndex+this.grid._virtualRowCount===this.grid._totalRowCount){this.grid._startRowIndex=Math.max(0,this.grid._startRowIndex-1)}this.grid._totalRowCount--;if(this.grid._virtualRowCount>this.grid._totalRowCount){this.grid._buildVirtualDom()}else{this.grid._renderVirtualRecords();this.grid._setScrollContainerHeight(this.grid._totalRowCount*parseInt(this.grid.options.avgRowHeight,10))}}else{this.grid._rerenderVirtualRecordsContinuous()}},_childrenWithAddRowEnabled:function(opts,inheritedRule){var i,j,cl,clr;if(opts.columnLayouts){for(i=0;i<opts.columnLayouts.length;i++){cl=opts.columnLayouts[i];if(inheritedRule!==null&&inheritedRule!==undefined){clr=inheritedRule}else{clr=$.ui.igGridUpdating.prototype.options.enableAddRow}if(cl.features&&cl.features.length>0){for(j=0;j<cl.features.length;j++){if(cl.features[j].name==="Updating"){return cl.features[j].enableAddRow===null||cl.features[j].enableAddRow===undefined?clr:cl.features[j].enableAddRow}}}else{return inheritedRule===true}}}return false},_recOrPropFound:function(rowId,colKey){var pendingTransactions=this.grid.dataSource.pendingTransactions(),rec,i=pendingTransactions.length,found;rec=this.grid.dataSource.findRecordByKey(rowId);found=!!rec;if(colKey){found=found&&rec.hasOwnProperty(colKey)}if(!found){while(--i>=0){if(pendingTransactions[i].rowId===rowId){return colKey?pendingTransactions[i].row.hasOwnProperty(colKey):true}}return false}return true},_activateEditor:function(editor){var cell=editor.closest("td");this._scrollTo(cell);editor.igEditorFilter("setFocus")},_scrollTo:function(cell){var scrollContainer=this.grid.scrollContainer(),cellPosition,ct,cl;if(scrollContainer.length&&scrollContainer.has(cell)){cellPosition=cell.position();ct=cellPosition.top+scrollContainer.scrollTop();cl=cellPosition.left+scrollContainer.scrollLeft();if(cellPosition.left<0){scrollContainer.scrollLeft(cl)}else if(cl+cell.outerWidth()>scrollContainer.scrollLeft()+scrollContainer.outerWidth()){scrollContainer.scrollLeft(cl+cell.outerWidth()-scrollContainer.outerWidth())}if(cellPosition.top<0){scrollContainer.scrollTop(ct)}else if(ct+cell.outerHeight()>scrollContainer.scrollTop()+scrollContainer.outerHeight()){scrollContainer.scrollTop(ct+cell.outerHeight()-scrollContainer.outerHeight())}}},_deleteRow:function(evt,rowId,suppress){var arg,t,autoCommit=this.grid.options.autoCommit,row=this.grid.rowById(rowId);if(row.hasClass(this.grid.css.deletedRecord)){return}arg={owner:this,element:row,rowID:rowId};if(!suppress){if(!this._trigger(this.events.rowDeleting,evt,arg)){return false}}t=this.grid.dataSource.deleteRow(rowId,autoCommit);row=this._updateUIForTransaction(t,row);this._notifyRowDeleted(rowId,row);if(!suppress){this._trigger(this.events.rowDeleted,evt,arg)}return true},_deleteMultipleRows:function(evt){var selectedRows=this.grid.element.igGridSelection("selectedRows"),i;for(i=0;i<selectedRows.length;i++){if(selectedRows[i]&&selectedRows[i].hasOwnProperty("id")&&!selectedRows[i].element.hasClass(this.grid.css.deletedRecord)){this._deleteRow(evt,selectedRows[i].id,false)}}},_updateRow:function(rowId,updateObj,row){var t,autoCommit=this.grid.options.autoCommit;row=row||this.grid.rowById(rowId);t=this.grid.dataSource.updateRow(rowId,updateObj,autoCommit);this._updateUIForTransaction(t,row);this._notifyRowUpdated(rowId,row)},_updateCell:function(rowId,colKey,value,cell){var t,autoCommit=this.grid.options.autoCommit;t=this.grid.dataSource.setCellValue(rowId,colKey,value,autoCommit);this._updateUIForTransaction(t,cell);this._notifyCellUpdated(rowId,cell)},_addRow:function(evt,addObj,defVals,suppress){var arg,key,t,row;addObj=$.extend({},defVals,addObj);arg={owner:this,values:addObj,oldValues:defVals};if(!suppress){if(!this._trigger(this.events.rowAdding,evt,arg)){return false}}key=addObj[this.grid.options.primaryKey];t=this.grid.dataSource.addRow(key,addObj,this.grid.options.autoCommit);row=this._updateUIForTransaction(t);this._notifyRowAdded(row);if($.type(this._pkVal)==="number"){this._pkVal++}if(!suppress){this._trigger(this.events.rowAdded,evt,arg)}},_notifyRowAdded:function(row){var rs=this.grid.element.data("igGridRowSelectors"),pa=this.grid.element.data("igGridPaging"),su=this.grid.element.data("igGridSummaries");if(rs&&typeof rs._rowAdded==="function"){rs._rowAdded(row)}if(pa&&typeof pa._rowAdded==="function"){pa._rowAdded(row)}if(su&&typeof su._rowAdded==="function"){su._rowAdded(row)}this.grid._fireInternalEvent("_internalRowAdded",{row:row})},_notifyRowDeleted:function(rowId,element){var se=this.grid.element.data("igGridSelection"),pa=this.grid.element.data("igGridPaging"),su=this.grid.element.data("igGridSummaries");if(se&&typeof se._rowDeleted==="function"){se._rowDeleted(rowId,element)}if(su&&typeof su._rowDeleted==="function"){su._rowDeleted(rowId,element)}if(pa&&typeof pa._rowDeleted==="function"){pa._rowDeleted(rowId,element)}this.grid._fireInternalEvent("_internalRowDeleted",{rowID:rowId,row:element})},_notifyCellUpdated:function(rowId,cell){this.grid._fireInternalEvent("_internalCellUpdated",{rowID:rowId,cell:cell})},_notifyRowUpdated:function(rowId,row){this.grid._fireInternalEvent("_internalRowUpdated",{rowID:rowId,row:row})},_renderRowEditDialog:function(rerender){var opts=this.options.rowEditDialogOptions,container,containment,captionsContainer,closeButton,dialogSelector="#"+this.grid.id()+"_updating_dialog_container",titleLabel=opts.captionLabel!==null?opts.captionLabel:$.ig.GridUpdating.locale.rowEditDialogCaptionLabel,doneButtonLabel=this.options.doneLabel!==null?this.options.doneLabel:$.ig.GridUpdating.locale.doneLabel,doneButtonTitle=this.options.doneTooltip!==null?this.options.doneTooltip:$.ig.GridUpdating.locale.doneTooltip,cancelButtonLabel=this.options.cancelLabel!==null?this.options.cancelLabel:$.ig.GridUpdating.locale.cancelLabel,cancelButtonTitle=this.options.cancelTooltip!==null?this.options.cancelTooltip:$.ig.GridUpdating.locale.cancelTooltip;container=$(dialogSelector);if(container.length){if(!rerender){return container}container.igGridModalDialog("destroy");container.remove();this._destroyAllEditors()}if(opts.containment==="owner"){containment=this.grid._rootContainer()}else{containment="window"}container=$("<div></div>").appendTo(this.grid._rootContainer()).attr("id",dialogSelector.substring(1));container.igGridModalDialog({containment:containment,renderFooterButtons:opts.showDoneCancelButtons,modalDialogCaptionText:titleLabel,modalDialogWidth:opts.width,modalDialogHeight:opts.height,buttonApplyText:doneButtonLabel,buttonApplyTitle:doneButtonTitle,buttonCancelText:cancelButtonLabel,buttonCancelTitle:cancelButtonTitle,animationDuration:opts.animationDuration,buttonApplyDisabled:true,gridContainer:this.grid._rootContainer(),modalDialogOpening:this._dialogHandlers.dialogOpening,modalDialogClosing:this._dialogHandlers.dialogClosing,modalDialogClosed:this._dialogHandlers.dialogClosed,buttonOKClick:this._dialogHandlers.dialogDone,buttonCancelClick:this._dialogHandlers.dialogCancel});captionsContainer=container.igGridModalDialog("getCaptionButtonContainer");closeButton=$("<button></button>").attr("id",this.grid.id()+"_updating_dialog_closeButton").appendTo(captionsContainer);closeButton.igButton({onlyIcons:true,icons:{primary:this.css.rowEditDialogCloseButton},width:"20px",height:"20px",click:this._dialogHandlers.dialogCloseClick});this._dialogInvalid=false;this._editorsContainerInvalid=true;this._trigger(this.events.rowEditDialogContentsRendered,null,{owner:this,dialogElement:container});return container},_renderDialogContent:function(content,values){var opts=this.options.rowEditDialogOptions,colgroup,tmpl;this._clearEditorsFromContainer(content);content.empty();if(opts.dialogTemplateSelector){tmpl=$(opts.dialogTemplateSelector);content.append($(this._jsr?tmpl.render(values):$.ig.tmpl(tmpl.html().fullTrim(),values)))
}else if(opts.dialogTemplate){tmpl=opts.dialogTemplate;content.append($(this._jsr?$.render[this.grid.id()+"_rowEditDialogTemplate"](values):$.ig.tmpl(tmpl,values)))}else{content.html(this._defaultDialogTemplate);content.find("table").addClass(this.css.rowEditDialogTable);colgroup=content.find("colgroup");colgroup.children(":first").css("width",opts.namesColumnWidth);colgroup.children(":last").css("width",opts.editorsColumnWidth);colgroup.parent().css("width","100%")}},_renderDialogTemplate:function(tmplParent,cols,onlyVisible){var opts=this.options.rowEditDialogOptions,tmpl,i,tr,e;cols=onlyVisible?$.grep(cols,function(col){return!col.hidden}):cols;if(!opts.showReadonlyEditors){cols=$.grep(cols,function(col){return!col.readOnly})}if(opts.editorsTemplateSelector){tmpl=$(opts.editorsTemplateSelector);tmplParent.append($(this._jsr?tmpl.render(cols):$.ig.tmpl(tmpl.html().fullTrim(),cols)))}else if(opts.editorsTemplate){tmpl=opts.editorsTemplate;tmplParent.append($(this._jsr?$.render[this.grid.id()+"_rowEditDialogEditorsTemplate"](cols):$.ig.tmpl(tmpl,cols)))}else{for(i=0;i<cols.length;i++){tr=$("<tr></tr>");$("<td>"+(cols[i].headerText||cols[i].key)+"</td>").appendTo(tr);$("<td></td>").appendTo(tr);e=this._isMultiLineText(cols[i].key)?$("<textarea></textarea>"):$("<input />");e.attr("data-editor-for-"+cols[i].key,"").appendTo(tr.children(":last"));tr.appendTo(tmplParent)}}},_initDialogEditors:function(content,cols,values){var i=0,provider,providerWrapper,ro,key,element,val,settings;this._editors=this._editors||{};while(i<cols.length){key=cols[i].key;ro=!!cols[i].readOnly;val=values[key]===undefined?null:values[key];element=content.find("[data-editor-for-"+key.toLowerCase()+"]");if(element.length===1){providerWrapper=element.data("igEditorFilter");if(providerWrapper){provider=providerWrapper.options.provider;provider.setValue(val)}else{if(ro){settings=this._getColSettingsForCol(key);if(!settings){this.options.columnSettings.push({columnKey:key,editorOptions:{readOnly:true}})}else{$.extend(true,settings,{editorOptions:{readOnly:true}})}}providerWrapper=this._createEditor(null,key,element);this._editors[key]=providerWrapper;provider=providerWrapper.igEditorFilter("option","provider");provider.setValue(val)}this._originalValues=this._originalValues||{};this._originalValues[key]=provider.getValue();$.ig.removeFromArray(cols,i,i)}else{i++}}},_clearEditorsFromContainer:function(content){var cols=this.grid.options.columns,i=-1,key,element,providerWrapper;while(++i<cols.length){key=cols[i].key;element=content.find("[data-editor-for-"+key.toLowerCase()+"]");if(element.length){providerWrapper=this.editorForKey(key).data("igEditorFilter");if(providerWrapper){this.editorForKey(key).igEditorFilter("destroy");delete this._editors[key]}}}},_renderDoneCancelButtons:function(){var buttonContainer,buttonsParent,doneButton,cancelButton,deleteButton,doneButtonLabel=this.options.doneLabel!==null?this.options.doneLabel:$.ig.GridUpdating.locale.doneLabel,doneButtonTitle=this.options.doneTooltip!==null?this.options.doneTooltip:$.ig.GridUpdating.locale.doneTooltip,cancelButtonLabel=this.options.cancelLabel!==null?this.options.cancelLabel:$.ig.GridUpdating.locale.cancelLabel,cancelButtonTitle=this.options.cancelTooltip!==null?this.options.cancelTooltip:$.ig.GridUpdating.locale.cancelTooltip,doneSelector,cancelSelector,deleteSelector;buttonContainer=$("<div></div>").css("position","absolute").attr("unselectable","on").addClass(this.css.buttonContainer);buttonsParent=this._addElementToScrollContainer(buttonContainer);doneButton=$("<span></span").attr("id",this.grid.id()+"_updating_done").addClass(this.css.button).addClass(this.css.doneButton).attr({unselectable:"on",tabIndex:this._getNextTabIndex()+1,title:doneButtonTitle}).appendTo(buttonContainer);$("<span></span>").css("display","inline-block").addClass(this.css.doneIcon).attr("unselectable","on").appendTo(doneButton);if(doneButtonLabel&&doneButton.length){$("<span></span>").css("display","inline-block").attr("unselectable","on").html(doneButtonLabel).appendTo(doneButton)}else{doneButton.addClass(this.css.buttonIconOnly)}cancelButton=$("<span></span>").attr("id",this.grid.id()+"_updating_cancel").addClass(this.css.button).addClass(this.css.cancelButton).attr({unselectable:"on",tabIndex:this._getNextTabIndex()+1,title:cancelButtonTitle}).appendTo(buttonContainer);$("<span></span>").css("display","inline-block").addClass(this.css.cancelIcon).attr("unselectable","on").appendTo(cancelButton);if(cancelButtonLabel&&cancelButtonLabel.length){$("<span></span>").css("display","inline-block").attr("unselectable","on").html(cancelButtonLabel).appendTo(cancelButton)}else{cancelButton.addClass(this.css.buttonIconOnly)}if(this._renderTouchUI&&this.options.enableDeleteRow){deleteButton=$("<span />").attr("id",this.grid.id()+"_updating_delete_touch").addClass(this.css.button).addClass(this.css.doneButton).attr({unselectable:"on",tabIndex:this._getNextTabIndex()+1,title:this.options.deleteRowTooltip!==null?this.options.deleteRowTooltip:$.ig.GridUpdating.locale.deleteRowTooltip}).prependTo(buttonContainer);$("<span />").css({display:"inline-block",left:0}).addClass(this.css.deleteIcon).attr("unselectable","on").appendTo(deleteButton);$("<span />").css("display","inline-block").attr("unselectable","on").html(this.options.deleteRowLabel!==null?this.options.deleteRowLabel:$.ig.GridUpdating.locale.deleteRowLabel).appendTo(deleteButton);deleteButton.css("float","left");doneButton.css("float","right");cancelButton.css("float","right");buttonContainer.css("width",buttonsParent.outerWidth());deleteSelector="#"+deleteButton.attr("id")}doneSelector="#"+doneButton.attr("id");cancelSelector="#"+cancelButton.attr("id");this.grid.container().on({"mouseenter.donecancel":this._buttonHandlers.mouseEnter,"mouseleave.donecancel":this._buttonHandlers.mouseLeave,"focus.donecancel":this._buttonHandlers.focus,"blur.donecancel":this._buttonHandlers.blur},doneSelector+","+cancelSelector+(deleteSelector?","+deleteSelector:""));this.grid.container().on({"click.donecancel":this._buttonHandlers.doneClick,"keyup.donecancel":this._buttonHandlers.doneKeyUp},doneSelector);this.grid.container().on({"click.donecancel":this._buttonHandlers.cancelClick,"keyup.donecancel":this._buttonHandlers.cancelKeyUp},cancelSelector);if(deleteSelector){this.grid.container().on({"click.donecancel":this._buttonHandlers.touchDeleteClick,"keyup.donecancel":this._buttonHandlers.touchDeleteKeyUp},deleteSelector)}return buttonContainer},_removeDoneCancelButtons:function(){var container=this._findElementInScrollContainer(".ui-iggrid-buttoncontainer:first");this.grid.container().off(".donecancel");container.remove()},_renderDeleteButton:function(){var deleteButton,deleteParent,ubodySelector="#"+this.grid.id()+">tbody",fbodySelector="#"+this.grid.id()+"_fixed>tbody",deleteSelector="#"+this.grid.id()+"_updating_deletehover",deleteButtonTitle=this.options.deleteRowTooltip!==null?this.options.deleteRowTooltip:$.ig.GridUpdating.locale.deleteRowTooltip;deleteButton=$(deleteSelector);if(deleteButton.length){return}deleteButton=$("<span></span>").attr("id",deleteSelector.substring(1)).css("position","absolute").addClass(this.css.deleteButton).attr({unselectable:"on",title:deleteButtonTitle});deleteButton.hide();$("<span></span>").css("display","inline-block").addClass(this.css.deleteIcon).attr("unselectable","on").appendTo(deleteButton);deleteParent=this._addElementToScrollContainer(deleteButton);this.grid.container().on({"mouseenter.deletebutton":this._buttonHandlers.mouseEnter,"mouseleave.deletebutton":this._buttonHandlers.mouseLeave,"click.deletebutton":this._buttonHandlers.deleteClick,"pointerup.deletebutton":this._buttonHandlers.deleteClick,"keyup.deletebutton":this._buttonHandlers.deleteClick},deleteSelector);this.grid.container().on({"mouseenter.deletebutton":this._handlers.mouseEnter},ubodySelector+">tr,"+fbodySelector+">tr");if(this._renderTouchUI){this.grid.container().on({"touchstart.deletebutton":this._handlers.touchStart,"touchend.deletebutton":this._handlers.touchEnd},ubodySelector+">tr,"+fbodySelector+">tr")}if(deleteParent[0]===this.grid.container()[0]){this.grid.container().bind("mouseleave.deletebutton",this._handlers.mouseLeave)}else{this.grid.container().on({"mouseleave.deletebutton":this._handlers.mouseLeave},"#"+deleteParent.attr("id"))}},_removeDeleteButton:function(){$("#"+this.grid.id()+"_updating_deletehover").remove();this.grid.container().off(".deletebutton");this.grid.container().unbind(".deletebutton")},_renderAddNewRow:function(thead){var addRowLabel=this.options.addRowLabel!==null?this.options.addRowLabel:$.ig.GridUpdating.locale.addRowLabel,addRowTitle=this.options.addRowTooltip!==null?this.options.addRowTooltip:$.ig.GridUpdating.locale.addRowTooltip,addTr,newTr,mainTd;addTr=thead.children("tr[data-add-row='true']");if(!addTr.length){addTr=$("<tr></tr>").addClass(this.css.addRow).attr({"data-add-row":true,tabIndex:this.grid.options.tabIndex}).appendTo(thead)}addTr.empty();mainTd=$("<td></td>").attr("title",addRowTitle).addClass(this.css.addRow).appendTo(addTr);$("<span></span>").css("display","inline-block").addClass(this.css.addRowIcon).appendTo(mainTd);$("<span></span>").text(addRowLabel).css("outline",0).attr("tabIndex",0).appendTo(mainTd);newTr=thead.children("tr[data-new-row='true']");if(!newTr.length){newTr=$("<tr></tr>").attr("data-new-row","true").attr("data-role","newrow").appendTo(thead).hide()}},_addElementToScrollContainer:function(element){var go=this.grid.options,container,hasHeight=go.height!==null&&go.height!==undefined;if(!hasHeight){container=this.grid.container();element.appendTo(container)}else{if(go.virtualization||go.rowVirtualization||go.columnVirtualization){container=this.grid._vdisplaycontainer()}else{container=this.grid.scrollContainer()}element.prependTo(container)}return container},_findElementInScrollContainer:function(selector){var go=this.grid.options,container,hasHeight=go.height!==null&&go.height!==undefined;if(!hasHeight){container=this.grid.container()}else{if(go.virtualization||go.rowVirtualization||go.columnVirtualization){container=this.grid._vdisplaycontainer()}else{container=this.grid.scrollContainer()}}return container.children(selector)},_createHandlers:function(){this._stopEditingHandler=this._stopEditingHandler||$.proxy(this._stopEditing,this);this._gridHandlers=this._gridHandlers||{stopEditing:this._stopEditingHandler,gridDataRendering:$.proxy(this._gridDataRendering,this),rowsRendered:$.proxy(this._rowsRendered,this),headerRendering:$.proxy(this._processReadOnly,this),headerRendered:$.proxy(this._headerRendered,this),rendered:$.proxy(this._headerRendered,this),virtualFrameChanging:$.proxy(this._virtPreRender,this),virtualFrameChanged:$.proxy(this._virtPostRender,this),columnsCollectionModified:$.proxy(this._columnsModified,this)};this._handlers=this._handlers||{mouseDown:$.proxy(this._mouseDown,this),clickTrigger:$.proxy(this._clickTrigger,this),keyDown:$.proxy(this._keyDown,this),focus:$.proxy(this._focus,this),blur:$.proxy(this._blur,this),touchStart:$.proxy(this._touchStart,this),touchEnd:$.proxy(this._touchEnd,this),mouseEnter:$.proxy(this._rowMouseEnter,this),mouseLeave:$.proxy(this._containerMouseLeave,this),scroll:$.proxy(this._scroll,this)};this._buttonHandlers=this._buttonHandlers||{mouseEnter:$.proxy(this._buttonMouseEnter,this),mouseLeave:$.proxy(this._buttonMouseLeave,this),focus:$.proxy(this._buttonFocus,this),blur:$.proxy(this._buttonBlur,this),doneClick:$.proxy(this._doneButtonClick,this),doneKeyUp:$.proxy(this._doneButtonKeyUp,this),cancelClick:this._stopEditingHandler,cancelKeyUp:$.proxy(this._cancelButtonKeyUp,this),deleteClick:$.proxy(this._deleteButtonClick,this),touchDeleteClick:$.proxy(this._touchDeleteButtonClick,this),touchDeleteKeyUp:$.proxy(this._touchDeleteButtonKeyUp,this)};this._addNewRowHandlers=this._addNewRowHandlers||{focus:$.proxy(this._addRowFocus,this),blur:$.proxy(this._addRowBlur,this)};this._validationHandlers=this._validationHandlers||{errorShowing:$.proxy(this._editorErrorShowing,this),errorShown:$.proxy(this._editorErrorShown,this),errorHidden:$.proxy(this._editorErrorHidden,this)};this._dialogHandlers=this._dialogHandlers||{dialogCloseClick:$.proxy(this._dialogCloseClick,this),dialogOpening:$.proxy(this._dialogOpening,this),dialogClosing:$.proxy(this._dialogClosing,this),dialogClosed:$.proxy(this._dialogClosed,this),dialogDone:$.proxy(this._dialogDone,this),dialogCancel:$.proxy(this._dialogCancel,this)};this._editorCallbacks=this._editorCallbacks||{keyDown:$.proxy(this._editorKeyDown,this),textChanged:$.proxy(this._editorTextChanged,this)}},_unbindAllEvents:function(){this.grid.element.off({iggriduidirty:this._gridHandlers.stopEditing,iggridresizingcolumnresizing:this._gridHandlers.stopEditing,ighierarchicalgridrowexpanded:this._gridHandlers.stopEditing,iggridrendered:this._gridHandlers.gridRendered,iggriddatarendering:this._gridHandlers.gridDataRendering,iggridrowsrendered:this._gridHandlers.rowsRendered,iggridvirtualrendering:this._gridHandlers.virtualFrameChanging,iggridvirtualrecordsrender:this._gridHandlers.virtualFrameChanged,iggridcolumnscollectionmodified:this._gridHandlers.columnsCollectionModified,iggridheaderrendering:this._gridHandlers.headerRendering});if(this.options.enableAddRow){this.grid.element.off({iggridheaderrenderedinternal:this._gridHandlers.headerRendered,iggridrendered:this._gridHandlers.rendered})}this.grid.container().off({click:this._handlers.click})},_bindGridEvents:function(){this.grid.element.on({iggriduidirty:this._gridHandlers.stopEditing,iggridresizingcolumnresizing:this._gridHandlers.stopEditing,ighierarchicalgridrowexpanded:this._gridHandlers.stopEditing,iggriddatarendering:this._gridHandlers.gridDataRendering,iggridrowsrendered:this._gridHandlers.rowsRendered,iggridvirtualrendering:this._gridHandlers.virtualFrameChanging,iggridvirtualrecordsrender:this._gridHandlers.virtualFrameChanged,iggridcolumnscollectionmodified:this._gridHandlers.columnsCollectionModified,iggridheaderrendering:this._gridHandlers.headerRendering});if(this.options.enableAddRow){this.grid.element.on({iggridheaderrenderedinternal:this._gridHandlers.headerRendered,iggridrendered:this._gridHandlers.rendered})}},_injectGrid:function(gridInstance,isRebind){var hg,cl;this.grid=gridInstance;if(isRebind){return}this._dialogInvalid=true;this._defaultDialogTemplate="<table><colgroup><col></col><col></col></colgroup><tbody data-render-tmpl></tbody></table>";this._editors=this._editors||{};if(this.options.excelNavigationMode&&this.options.editMode!=="cell"&&this.options.editMode!=="row"){throw new Error($.ig.GridUpdating.locale.excelNavigationNotSupportedWithCurrentEditMode)}this._createHandlers();this._bindGridEvents();this._addDSSuccessHandler();this._addDSErrorHandler();this._analyzeEditTriggers();if(this.grid.options._isHierarchicalGrid&&this.grid._originalOptions){if(this.options.inherit){this.grid._shouldAlwaysRenderChildIndicator=this._childrenWithAddRowEnabled(this.grid.options,this.options.enableAddRow)}else{this.grid._shouldAlwaysRenderChildIndicator=this._childrenWithAddRowEnabled(this.grid.options)}if(!this.grid.dataSource.settings.schema.layouts){hg=this.grid.element.closest(".ui-iggrid-root").data("igHierarchicalGrid");cl=[];hg._parseLayouts(cl,"",this.grid._originalOptions);this.grid.dataSource.settings.schema.layouts=cl}}this._renderTouchUI=typeof Modernizr==="object"&&Modernizr.touch===true;if(window.navigator.msPointerEnabled||window.navigator.pointerEnabled){this.grid.element.css("-ms-touch-action","none");this.grid.element.css("touch-action","none")}if(String(this.grid.options.templatingEngine).toLowerCase()==="jsrender"){this._jsr=true;if(this.options.rowEditDialogOptions.dialogTemplate&&typeof this.options.rowEditDialogOptions.dialogTemplate==="string"){$.templates(this.grid.id()+"_rowEditDialogTemplate",this.options.rowEditDialogOptions.dialogTemplate)}if(this.options.rowEditDialogOptions.editorsTemplate&&typeof this.options.rowEditDialogOptions.editorsTemplate==="string"){$.templates(this.grid.id()+"_rowEditDialogEditorsTemplate",this.options.rowEditDialogOptions.editorsTemplate)}}}});$.extend($.ui.igGridUpdating,{version:"15.2.20152.1027"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Layout Manager 15.2.20152.1027
*
* Copyright (c) 2011-2015 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
*	jquery-1.7.0.js
*	jquery.ui.core.js
*	jquery.ui.widget.js
*	modernizr.js (Optional)
*   infragistics.util.js
*/
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igLayoutManager",{css:{item:"ig-layout-item",container:"ig-layout",flowItem:"ig-layout-flow-item",flow:"ig-layout-flow",vertical:"ig-layout-vertical",verticalItem:"ig-layout-vertical-item",border:"ig-layout-border",borderItem:"ig-layout-border-item",borderHeader:"ig-layout-border-header",borderFooter:"ig-layout-border-footer",borderLeft:"ig-layout-border-left",borderCenter:"ig-layout-border-center",borderRight:"ig-layout-border-right",borderContainer:"ig-layout-border-container",gridItemAbs:"ig-layout-griditem-abs",gridItemRel:"ig-layout-griditem-rel"},options:{layoutMode:"column",itemCount:null,gridLayout:{cols:null,rows:null,columnWidth:null,columnHeight:null,marginLeft:0,marginTop:0,rearrangeItems:true,overrideConfigOnSetOption:true,animationDuration:500},borderLayout:{showHeader:true,showFooter:true,showLeft:true,showRight:true,leftWidth:"20%",rightWidth:"10%"},items:[{rowSpan:1,colSpan:1,colIndex:0,rowIndex:0,width:null,height:null}],width:null,height:null},events:{itemRendering:"itemRendering",itemRendered:"itemRendered",rendered:"rendered",internalResizing:"internalResizing",internalResized:"internalResized"},_opt:null,_createWidget:function(options){this.options.items=[];this.options.gridLayout.useOffset=true;if(options&&options.items){options.items=$.extend(true,[],options.items)}$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){var self=this;this._opt={eventHandlers:{},gridLayout:null,borderLayout:null,scrollBarWidth:$.ig.util.getScrollWidth(),scrollBarHeight:$.ig.util.getScrollHeight(),resizeLayout:this.options.layoutMode==="grid"||this.options.layoutMode==="border"};this.element.addClass(this.css.container);if(this.options.width!==null){this.element.css("width",this.options.width)}if(this.options.height!==null){this.element.css("height",this.options.height)}if(this._opt.resizeLayout){this._opt.eventHandlers.windowResizeHandler=function(e){var noCancel=self._triggerInternalResizing(e);if(noCancel){self.reflow(false,null,e)}};$(window).on("resize",this._opt.eventHandlers.windowResizeHandler)}switch(this.options.layoutMode){case"grid":this._initGridLayout();break;case"border":this._initBorderLayout();break;case"flow":this._initFlowLayout();break;case"column":break;case"vertical":this._initVerticalLayout();break;default:break}},_setOption:function(option,value){if(this.options[option]===value){return}var opt=this.options,borderLayout=$.extend(true,{},this.options.borderLayout),initGridLayout,gridLayout;switch(option){case"gridLayout":if(opt.gridLayout.overrideConfigOnSetOption){gridLayout=$.extend(true,{overrideConfigOnSetOption:opt.gridLayout.overrideConfigOnSetOption,useOffset:opt.gridLayout.useOffset},{cols:null,rows:null,columnWidth:null,columnHeight:null,marginLeft:0,marginTop:0,rearrangeItems:true,animationDuration:500});initGridLayout=true}else{gridLayout=$.extend(true,{},this.options.gridLayout);initGridLayout=value.cols||value.rows||value.columnWidth||value.columnHeight||typeof value.marginLeft==="number"||typeof value.marginTop==="number"||value.useOffset}break;default:break}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"width":this.element.width(this.options.width);if(opt.layoutMode==="grid"){this.reflow(true)}break;case"height":this.element.height(this.options.height);if(opt.layoutMode==="grid"){this.reflow(true)}break;case"gridLayout":this.options.gridLayout=$.extend(true,{},gridLayout,this.options.gridLayout);if(initGridLayout){this._initGlFromItemsConfig(false)}else{if(value.hasOwnProperty("rearrangeItems")){this._opt.gridLayout.rearrangeItems=value.rearrangeItems}if(value.hasOwnProperty("animationDuration")){this._opt.gridLayout.animationDuration=value.animationDuration}}break;case"borderLayout":this._destroyBorderLayout();this.options.borderLayout=$.extend(true,{},borderLayout,this.options.borderLayout);this._initBorderLayout();break;case"items":switch(opt.layoutMode){case"vertical":this._destroyVerticalLayout();this._initVerticalLayout();break;case"grid":this._initGlFromItemsConfig(false);break;case"flow":this._destroyFlowLayout();this._initFlowLayout();break}break;case"itemCount":switch(opt.layoutMode){case"vertical":this._destroyVerticalLayout();this._initVerticalLayout();break;case"flow":this._destroyFlowLayout();this._initFlowLayout();break}break;default:break}},reflow:function(forceReflow,animationDuration,event){var parsedDur;if(this.options.layoutMode==="grid"){parsedDur=parseInt(animationDuration,10);animationDuration=parsedDur>=0?parsedDur:this.options.gridLayout.animationDuration;this._reflowGlConfiguration(forceReflow,animationDuration,event)}if(this.options.layoutMode==="border"){this._setBorderLayoutPaddings()}},_initVerticalLayout:function(){var i,length=this.options.itemCount,items=this.options.items,item;this.element.addClass(this.css.vertical);if(length>0){for(i=0;i<length;i++){this._trigger(this.events.itemRendering,null,{index:i});item=$("<div></div>").appendTo(this.element).addClass(this.css.verticalItem);this.options.destroyItems=true;this._trigger(this.events.itemRendered,null,{item:item,index:i})}this._trigger(this.events.rendered,null,{owner:this})}else if(items&&items.length>0){this.element.empty();for(i=0;i<items.length;i++){this._trigger(this.events.itemRendering,null,{itemData:items[i],index:i});item=$("<div></div>").appendTo(this.element).addClass(this.css.verticalItem);if(items[i].width){item.css("width",items[i].width)}if(items[i].height){item.css("height",items[i].height)}this._trigger(this.events.itemRendered,null,{item:item,index:i})}this.options.destroyItems=true;this._trigger(this.events.rendered,null,{owner:this})}else{this.element.children().addClass(this.css.verticalItem)}},_analyzeGlItems:function(){var gl=this._opt.gridLayout,items=this.options.items,cols=0,rows=0,item,itemCols,itemRows,i;for(i=0;items.length>i;i++){item=items[i];itemCols=item.colIndex+item.colSpan;itemRows=item.rowIndex+item.rowSpan;if(itemCols>cols){cols=itemCols}if(itemRows>rows){rows=itemRows}}if(cols>0){gl.cols=cols}if(rows>0){gl.rows=rows}},_analyzeGlWidth:function(){var gl=this._opt.gridLayout,columnWidth=gl.columnWidth,elWidth=this.element.width(),units;if(columnWidth){if(typeof columnWidth==="string"){if(columnWidth.indexOf("%")!==-1){units=columnWidth.substring(0,columnWidth.length-1);units=parseInt(units,10)/100;if(!isNaN(units)&&units>0){gl.columnWidthRatio=units;gl.columnWidth=Math.floor(elWidth*units-gl.marginLeft)}}else{units=parseInt(columnWidth,10);if(!isNaN(units)&&units>0){gl.columnWidth=units}}}}},_analyzeGlHeight:function(){var gl=this._opt.gridLayout,columnHeight=gl.columnHeight,elHeight=this.element.height(),units;if(columnHeight){if(typeof columnHeight==="string"){if(columnHeight.indexOf("%")!==-1){units=columnHeight.substring(0,columnHeight.length-1);units=parseInt(units,10)/100;if(!isNaN(units)&&units>0){gl.columnHeightRatio=units;gl.columnHeight=Math.floor(elHeight*units-gl.marginTop)}}else{units=parseInt(columnHeight,10);if(!isNaN(units)&&units>0){gl.columnHeight=units}}}}},_analyzeGlNotSetOptions:function(){var gl=this._opt.gridLayout,elWidth=this.element.width(),elHeight=this.element.height(),itemsLength=this.options.items.length,columnWidthOption=typeof gl.columnWidth==="number"&&gl.columnWidth>0,columnHeightOption=typeof gl.columnHeight==="number"&&gl.columnHeight>0,colsOption=typeof gl.cols==="number"&&gl.cols>0,rowsOption=typeof gl.rows==="number"&&gl.rows>0;if(!colsOption){if(rowsOption){gl.cols=Math.ceil(itemsLength/gl.rows)}else{if(columnWidthOption){gl.cols=Math.floor(elWidth/(gl.columnWidth+gl.marginLeft));gl.rows=Math.ceil(itemsLength/gl.cols)}else if(columnHeightOption){gl.rows=Math.floor(elHeight/(gl.columnHeight+gl.marginTop));gl.cols=Math.ceil(itemsLength/gl.rows)}else{gl.cols=Math.ceil(Math.sqrt(itemsLength));gl.rows=Math.ceil(itemsLength/gl.cols)}}}else if(!rowsOption){gl.rows=Math.ceil(itemsLength/gl.cols)}if(!columnWidthOption){gl.columnWidth=Math.floor(elWidth*(1/gl.cols)-gl.marginLeft);gl.columnWidthRatio=1/gl.cols}if(!columnHeightOption){gl.columnHeight=Math.floor(elHeight*(1/gl.rows)-gl.marginTop);gl.columnHeightRatio=1/gl.rows}if(!columnHeightOption&&!colsOption&&!gl.columnWidthRatio){gl.autoAdjustColumnHeight=true}if(!columnWidthOption&&!rowsOption&&!gl.columnHeightRatio){gl.autoAdjustColumnWidth=true}},_analyzeGlConfiguration:function(){this._analyzeGlWidth();this._analyzeGlHeight();this._analyzeGlItems();this._analyzeGlNotSetOptions()},_createGlConfig:function(){var gl,e=this.element;this._opt.gridLayout=gl=$.extend(true,{},this.options.gridLayout,{elements:$(),minColCount:1,columnWidthRatio:null,columnHeightRatio:null,containerWidthNoScroll:e.width(),containerHeightNoScroll:e.height(),resizeItems:false,animating:false,autoAdjustColumnWidth:false,autoAdjustColumnHeight:false,initialCols:0,initialRows:0,initialColWidth:0,initialColWidthRatio:null,initialColHeight:0,initialColHeightRation:null,initialItems:[],initialReflow:true,useOffset:(e.css("position")==="static"||e.css("position")==="fixed")&&this.options.gridLayout.useOffset?true:false,destroyItemsFromIndex:e.children().length});if(typeof gl.cols==="string"){gl.cols=parseInt(gl.cols,10)}if(typeof gl.rows==="string"){gl.rows=parseInt(gl.rows,10)}this._analyzeGlConfiguration();gl.resizeItems=!!(gl.columnWidthRatio||gl.columnHeightRatio)},_glSortItemsByPositionOrder:function(){var items=this.options.items,compareFunc=function(item1,item2){return item1.rowIndex!==item2.rowIndex?item1.rowIndex-item2.rowIndex:item1.colIndex-item2.colIndex};items=items.sort(compareFunc)},_renderGlItemsFromItemsConfig:function(initialRendering){var i,item,itemData,width,height,top,left,row,col,colSpan,rowSpan,$currChild,renderNewItem,e=this.element,items=this.options.items,gl=this._opt.gridLayout,ml=gl.marginLeft,mt=gl.marginTop,iw=gl.columnWidth,ih=gl.columnHeight,offset=e.offset(),$children=e.children();for(i=0;i<items.length;i++){itemData=items[i];$currChild=$children.eq(i);renderNewItem=$currChild.length===0;colSpan=itemData.colSpan=typeof itemData.colSpan==="number"?itemData.colSpan:1;rowSpan=itemData.rowSpan=typeof itemData.rowSpan==="number"?itemData.rowSpan:1;row=itemData.rowIndex=typeof itemData.rowIndex==="number"?itemData.rowIndex:Math.floor(i/gl.cols);col=itemData.colIndex=typeof itemData.colIndex==="number"?itemData.colIndex:i%gl.cols;if(renderNewItem||initialRendering){this._trigger(this.events.itemRendering,null,{itemData:itemData,index:i})}if(renderNewItem){item=$("<div>").appendTo(this.element)}else{item=$currChild}itemData.item=item;gl.elements=gl.elements.add(item);if(colSpan>gl.minColCount){gl.minColCount=colSpan}width=colSpan*iw+(colSpan-1)*ml;height=rowSpan*ih+(rowSpan-1)*mt;left=col*iw+(col+1)*ml;top=row*ih+(row+1)*mt;if(gl.useOffset){top+=offset.top;left+=offset.left}item.addClass(this.css.item).addClass(this.css.gridItemAbs).attr("data-index",i).css({top:top,left:left,width:width,height:height});if(renderNewItem||initialRendering){this._trigger(this.events.itemRendered,null,{item:item,itemData:itemData,index:i})}}this._glSortItemsByPositionOrder();$children.slice(items.length).remove();if(initialRendering){this._trigger(this.events.rendered,null,{items:this.options.items})}},_initGlFromItemsConfig:function(initialRendering){this._createGlConfig();this._renderGlItemsFromItemsConfig(initialRendering);this.reflow(false,0)},_renderGlItemsFromColsRows:function(initialRendering){var i,j,top,left,item,gl=this._opt.gridLayout,ml=gl.marginLeft,mt=gl.marginTop,iw=gl.columnWidth,ih=gl.columnHeight;for(i=0;i<gl.rows;i++){for(j=0;j<gl.cols;j++){item=$("<div>").appendTo(this.element).addClass(this.css.item).addClass(this.css.gridItemAbs).attr("data-index",i*gl.cols+j).width(iw).height(ih);this._trigger(this.events.itemRendered,null,{item:item});left=j*iw+(j+1)*ml;top=i*ih+(i+1)*mt;left+=j===0?ml:0;item.css({top:top,left:left})}}if(initialRendering){this._trigger(this.events.rendered,null,{items:this.options.items})}},_initGlFromColsRows:function(initialRendering){this._createGlConfig();this._renderGlItemsFromColsRows(initialRendering)},_initGridLayout:function(){var i,items=this.options.items,e=this.element,$children=e.children(),lenDiff=$children.length-this.options.items.length;if(lenDiff>0){for(i=0;i<lenDiff;i++){this.options.items.push({})}}if(items&&items.length>0){this._initGlFromItemsConfig(true)}else if($children.length===0){this._initGlFromColsRows(true)}},_setGlInitialConfig:function(){var gl=this._opt.gridLayout;gl.initialCols=gl.cols;gl.initialRows=gl.rows;gl.initialColHeight=gl.columnHeight;gl.initialColWidth=gl.columnWidth;gl.initialColWidthRatio=gl.columnWidthRatio;gl.initialColHeightRatio=gl.columnHeightRatio;gl.initialItems=$.extend(true,[],this.options.items)},_getContainerWidthNoScroll:function(){var widthNoScroll;if(($.ig.util.isWebKit||$.ig.util.isIE9)&&window.getComputedStyle){widthNoScroll=parseInt(window.getComputedStyle(this.element[0]).width,10)}else{widthNoScroll=this.element.width()-($.ig.util.hasVerticalScroll(this.element)?this._opt.scrollBarWidth:0)}return widthNoScroll},_getContainerHeightNoScroll:function(){var heightNoScroll;if(($.ig.util.isWebKit||$.ig.util.isIE9)&&window.getComputedStyle){heightNoScroll=parseInt(window.getComputedStyle(this.element[0]).height,10)}else{heightNoScroll=this.element.height()-($.ig.util.hasHorizontalScroll(this.element)?this._opt.scrollBarHeight:0)}return heightNoScroll},_glReflowNeeded:function(){var gl=this._opt.gridLayout,newContainerWidthNoScroll=this._getContainerWidthNoScroll(),newContainerHeightNoScroll=this._getContainerHeightNoScroll();return gl.containerWidthNoScroll!==newContainerWidthNoScroll&&(gl.columnWidthRatio||gl.cols!==Math.floor(newContainerWidthNoScroll/(gl.columnWidth+gl.marginLeft)))||gl.containerHeightNoScroll!==newContainerHeightNoScroll&&gl.columnHeightRatio},_reflowGlConfiguration:function(forceReflow,animationDuration,event){var self=this,e=this.element,gl=this._opt.gridLayout,ml=gl.marginLeft,mt=gl.marginTop,items=this.options.items,newContainerWidthNoScroll=this._getContainerWidthNoScroll(),newContainerHeightNoScroll=this._getContainerHeightNoScroll(),leftOffset=gl.useOffset?e.offset().left:0,topOffset=gl.useOffset?e.offset().top:0,col,row,colSpan,rowSpan,newColCount,newDim,helperArray,itemData,colWidthChanged,colHeightChanged,positionsChanged,foundMatch,currentRow,item,i,j,k,r,n,rearrangeCallback=function(){if(!gl.elements.is(":animated")){gl.animating=false;if(self._glReflowNeeded()){self.reflow(false,animationDuration,event)}else{self._triggerInternalResized(event)}}};if(items){if(gl.columnWidthRatio&&gl.containerWidthNoScroll!==newContainerWidthNoScroll){gl.columnWidth=Math.floor(newContainerWidthNoScroll*gl.columnWidthRatio-ml);colWidthChanged=true}else{colWidthChanged=false}if(gl.columnHeightRatio&&gl.containerHeightNoScroll!==newContainerHeightNoScroll){gl.columnHeight=Math.floor(newContainerHeightNoScroll*gl.columnHeightRatio-mt);colHeightChanged=true}else{colHeightChanged=false}if(gl.autoAdjustColumnWidth&&(gl.containerHeightNoScroll!==newContainerHeightNoScroll&&gl.rearrangeItems||forceReflow)){gl.rows=Math.max(Math.floor(newContainerHeightNoScroll/(gl.columnHeight+mt)),1);gl.columnWidthRatio=1/Math.ceil(items.length/gl.rows);gl.columnWidth=Math.floor(newContainerWidthNoScroll*gl.columnWidthRatio-ml);colWidthChanged=true}gl.containerWidthNoScroll=newContainerWidthNoScroll;gl.containerHeightNoScroll=newContainerHeightNoScroll;if(gl.rearrangeItems||forceReflow){if(gl.rearrangeItems){if(gl.columnWidthRatio){newColCount=Math.floor(1/gl.columnWidthRatio)}else{newColCount=Math.floor(newContainerWidthNoScroll/(gl.columnWidth+ml))}}else{if(gl.autoAdjustColumnWidth){newColCount=Math.ceil(items.length/gl.rows)}else if(gl.autoAdjustColumnHeight){newColCount=Math.floor(newContainerWidthNoScroll/(gl.columnWidth+ml))}else{newColCount=gl.cols}}if(gl.minColCount>newColCount){newColCount=gl.minColCount}if(newColCount!==gl.cols||forceReflow){if(newColCount===gl.initialCols){items=this.options.items=$.extend(true,[],gl.initialItems);gl.rows=gl.initialRows;gl.cols=gl.initialCols}else{gl.cols=newColCount;helperArray=[[]];helperArray[0].length=gl.cols;for(i=0;i<items.length;i++){itemData=items[i];colSpan=itemData.colSpan;rowSpan=itemData.rowSpan;foundMatch=false;for(j=0;j<helperArray.length&&!foundMatch;j++){for(k=0;k<helperArray[j].length&&!foundMatch;k++){if(!helperArray[j][k]){foundMatch=true;for(r=0;foundMatch&&r<rowSpan*colSpan;r++){if(colSpan>helperArray[j].length-k){foundMatch=false}else{currentRow=j+Math.floor(r/colSpan);if(!helperArray[currentRow]){helperArray[currentRow]=[];helperArray[currentRow].length=gl.cols}if(helperArray[currentRow][k+r%colSpan]===1){foundMatch=false}}}}if(foundMatch){itemData.rowIndex=j;itemData.colIndex=k;for(n=0;n<rowSpan*colSpan;n++){helperArray[itemData.rowIndex+Math.floor(n/colSpan)][itemData.colIndex+n%colSpan]=1}}else if(j===helperArray.length-1&&k===helperArray[j].length-1){helperArray[j+1]=[];helperArray[j+1].length=gl.cols}}}}if(gl.autoAdjustColumnHeight&&gl.rows!==helperArray.length){gl.columnHeightRatio=1/helperArray.length;gl.columnHeight=Math.floor(newContainerHeightNoScroll*gl.columnHeightRatio-mt);colHeightChanged=true}gl.rows=helperArray.length}positionsChanged=true}}if(colWidthChanged||colHeightChanged||positionsChanged||forceReflow){gl.animating=positionsChanged&&animationDuration>0||gl.animating;for(i=0;i<items.length;i++){itemData=items[i];item=itemData.item;row=itemData.rowIndex;col=itemData.colIndex;colSpan=itemData.colSpan;rowSpan=itemData.rowSpan;newDim={};if(positionsChanged||gl.animating){newDim.left=col*gl.columnWidth+(col+1)*ml+leftOffset;newDim.top=row*gl.columnHeight+(row+1)*mt+topOffset;if(colWidthChanged||forceReflow){newDim.width=colSpan*gl.columnWidth+(colSpan-1)*ml}if(colHeightChanged||forceReflow){newDim.height=rowSpan*gl.columnHeight+(rowSpan-1)*mt}if(animationDuration>0){item.animate(newDim,{duration:animationDuration,queue:false,complete:rearrangeCallback})}else{item.css(newDim)}}else{if(colWidthChanged||forceReflow){newDim.left=col*gl.columnWidth+(col+1)*ml+leftOffset;newDim.width=colSpan*gl.columnWidth+(colSpan-1)*ml}if(colHeightChanged||forceReflow){newDim.top=row*gl.columnHeight+(row+1)*mt+topOffset;newDim.height=rowSpan*gl.columnHeight+(rowSpan-1)*mt}item.css(newDim)}}}if(!gl.animating){if(this._glReflowNeeded()){this.reflow(false,animationDuration,event)}else{if(gl.initialReflow){this._setGlInitialConfig();gl.initialReflow=false}this._triggerInternalResized(event)}}}},_initBorderLayout:function(){var left,right,center,header,footer,rwidth,lwidth,container,sections,maxHeight,currHeight,i,bl=this.options.borderLayout;this.element.addClass(this.css.border);left=this.element.find(".left");header=this.element.find(".header");right=this.element.find(".right");center=this.element.find(".center");footer=this.element.find(".footer");if(left.length===0&&bl.showLeft){this._trigger(this.events.itemRendering,null,{region:"left"});left=$("<div></div>").appendTo(this.element);this._removeLeft=true;this._trigger(this.events.itemRendered,null,{region:"left",element:left})}left.addClass(this.css.borderItem).addClass(this.css.borderLeft);if(right.length===0&&bl.showRight){this._trigger(this.events.itemRendering,null,{region:"right"});right=$("<div></div>").appendTo(this.element);this._removeRight=true;this._trigger(this.events.itemRendered,null,{region:"right",element:right})}right.addClass(this.css.borderItem).addClass(this.css.borderRight);if(center.length===0){this._trigger(this.events.itemRendering,null,{region:"center"});center=$("<div></div>").appendTo(this.element);this._removeCenter=true;this._trigger(this.events.itemRendered,null,{region:"center",element:center})}center.addClass(this.css.borderItem).addClass(this.css.borderCenter);if(footer.length===0&&bl.showFooter){this._trigger(this.events.itemRendering,null,{region:"footer"});footer=$("<div></div>").appendTo(this.element);this._removeFooter=true;this._trigger(this.events.itemRendered,null,{region:"footer",element:footer})}footer.addClass(this.css.borderItem).addClass(this.css.borderFooter);if(header.length===0&&bl.showHeader){this._trigger(this.events.itemRendering,null,{region:"header"});header=$("<div></div>").appendTo(this.element);this._removeHeader=true;this._trigger(this.events.itemRendered,null,{region:"header",element:header})}header.addClass(this.css.borderItem).addClass(this.css.borderHeader);container=$("<div></div>").appendTo(this.element).addClass(this.css.borderContainer).append(left).append(right).append(center);this.element.append(footer);if(bl.leftWidth!==null&&bl.showLeft){left.css("width",bl.leftWidth)}else if(bl.showLeft===false||left.length===0){container.css("padding-left",0)}if(bl.rightWidth!==null&&bl.showRight){right.css("width",bl.rightWidth)}else if(bl.showRight===false||right.length===0){container.css("padding-right",0)}lwidth=bl.leftWidth&&bl.leftWidth.indexOf&&bl.leftWidth.indexOf("%")!==-1?0:parseInt(bl.leftWidth,10);rwidth=bl.rightWidth&&bl.rightWidth.indexOf&&bl.rightWidth.indexOf("%")!==-1?0:parseInt(bl.rightWidth,10);this.element.css("min-width",lwidth+rwidth);this._opt.borderLayout={header:header,footer:footer,paddingTop:null,paddingBottom:null};this._setBorderLayoutPaddings();if(this.options.height===null){sections=left.add(right).add(center);for(i=0,maxHeight=0;i<sections.length;i++){currHeight=sections.eq(i).outerHeight(true);if(currHeight>maxHeight){maxHeight=currHeight}}this.element.height(maxHeight)}this._trigger(this.events.rendered,null,{owner:this})},_setBorderLayoutPaddings:function(){var headerHeight,footerHeight,_bl=this._opt.borderLayout;if(_bl.header.length){headerHeight=_bl.header.outerHeight(true);if(_bl.paddingTop!==headerHeight){_bl.paddingTop=headerHeight;this.element.css("paddingTop",_bl.paddingTop)}}if(_bl.footer.length){footerHeight=_bl.footer.outerHeight(true);if(_bl.paddingBottom!==footerHeight){_bl.paddingBottom=footerHeight;this.element.css("paddingBottom",_bl.paddingBottom)}}},_initFlowLayout:function(){var i,length=this.options.itemCount,items=this.options.items,item;this.element.addClass(this.css.flow);if(length>0){for(i=0;i<length;i++){this._trigger(this.events.itemRendering,null,{index:i});item=$("<li></li>").appendTo(this.element).addClass(this.css.flowItem);this.options.destroyItems=true;this._trigger(this.events.itemRendered,null,{item:item,index:i})}this._trigger(this.events.rendered,null,{owner:this})}else if(items&&items.length>0){this.element.empty();for(i=0;i<items.length;i++){this._trigger(this.events.itemRendering,null,{itemData:items[i],index:i});item=$("<li></li>").appendTo(this.element).addClass(this.css.flowItem);if(items[i].width){item.css("width",items[i].width)}if(items[i].height){item.css("height",items[i].height)}this._trigger(this.events.itemRendered,null,{item:item,index:i})}this.options.destroyItems=true;this._trigger(this.events.rendered,null,{owner:this})}else{this.element.children().addClass(this.css.flowItem)}},_triggerInternalResizing:function(event){var args={owner:this};return this._trigger(this.events.internalResizing,event,args)},_triggerInternalResized:function(event){var args={owner:this};return this._trigger(this.events.internalResized,event,args)},_destroyBorderLayout:function(){this.element.removeClass(this.css.border);this.element.find("."+this.css.borderLeft).unwrap();if(this._removeLeft){this.element.children("."+this.css.borderLeft).remove()}if(this._removeRight){this.element.children("."+this.css.borderRight).remove()}if(this._removeCenter){this.element.children("."+this.css.borderCenter).remove()}if(this._removeHeader){this.element.children("."+this.css.borderHeader).remove()}if(this._removeFooter){this.element.children("."+this.css.borderFooter).remove()}this.element.children().removeClass(this.css.borderItem).removeClass(this.css.borderLeft).removeClass(this.css.borderRight).removeClass(this.css.borderCenter).removeClass(this.css.borderFooter).removeClass(this.css.borderHeader)},_destroyGridLayout:function(){var $children=this.element.children();$children.slice(this._opt.gridLayout.destroyItemsFromIndex).remove();$children.removeClass(this.css.item).removeClass(this.css.gridItemAbs).removeClass(this.css.gridItemRel).removeAttr("data-index")},_destroyFlowLayout:function(){this.element.removeClass(this.css.flow);if(this.options.destroyItems){this.element.empty()}else{this.element.children().removeClass(this.css.flowItem)}},_destroyVerticalLayout:function(){this.element.removeClass(this.css.vertical);if(this.options.destroyItems){this.element.empty()}else{this.element.children().removeClass(this.css.verticalItem)}},destroy:function(){$.Widget.prototype.destroy.apply(this,arguments);this.element.removeClass(this.css.container);switch(this.options.layoutMode){case"grid":this._destroyGridLayout();break;case"border":this._destroyBorderLayout();break;case"flow":this._destroyFlowLayout();break;case"vertical":this._destroyVerticalLayout();break;default:break}if(this._opt.resizeLayout){$(window).off("resize",this._opt.eventHandlers.windowResizeHandler)}return this}});$.extend($.ui.igLayoutManager,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Splitter 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *  jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	modernizr.js (Optional)
 *	infragistics.util.js
 *	infragistics.ui.splitter-en.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igSplitter",{_const:{orientations:{horizontal:{size:"height",oppositeSize:"width",outerSize:"outerHeight",dimention:"top",start:"_startY",mouse:"_mouseStartY",page:"pageY",keyboard:["UP","DOWN"]},vertical:{size:"width",oppositeSize:"height",outerSize:"outerWidth",dimention:"left",start:"_startX",mouse:"_mouseStartX",page:"pageX",keyboard:["LEFT","RIGHT"]}},properties:["max","_max","min","_min","size","collapsed","collapsible","resizable"],step:10,touchEvents:{mousedown:"touchstart",mouseup:"touchend",mousemove:"touchmove",mouseenter:"",mouseleave:"",focus:"focus",blur:"blur",keydown:"keydown"}},css:{splitter:"ui-igsplitter ui-widget ui-widget-content",verticalPanel:"ui-igsplitter-panel-vertical ui-widget-content",horizontalPanel:"ui-igsplitter-panel-horizontal ui-widget-content",bar:"ui-igsplitter-splitbar",barNormal:"ui-igsplitter-splitbar-default ui-state-default",barCollapsed:"ui-igsplitter-splitbar-collapsed",barHover:"ui-igsplitter-splitbar-hover ui-state-hover",barActive:"ui-igsplitter-splitbar-focus ui-state-focus",barInvalid:"ui-igsplitter-splitbar-invalid",resizeHandler:"ui-igsplitter-splitbar-resize-handler",resizeHandlerInner:"ui-igsplitter-splitbar-resize-handler-inner",verticalCollapseButtonLeftExpanded:"ui-igsplitter-collapse-button-vertical-left",verticalCollapseButtonLeftExpandedIcon:"ui-icon ui-icon-triangle-1-w",verticalCollapseButtonLeftCollapsed:"ui-igsplitter-collapse-button-vertical-left",verticalCollapseButtonLeftCollapsedIcon:"ui-icon ui-icon-triangle-1-e",verticalCollapseButtonRightExpanded:"ui-igsplitter-collapse-button-vertical-right",verticalCollapseButtonRightExpandedIcon:"ui-icon ui-icon-triangle-1-e",verticalCollapseButtonRightCollapsed:"ui-igsplitter-collapse-button-vertical-right",verticalCollapseButtonRightCollapsedIcon:"ui-icon ui-icon-triangle-1-w",horizontalCollapseButtonLeftExpanded:"ui-igsplitter-collapse-button-horizontal-left",horizontalCollapseButtonLeftExpandedIcon:"ui-icon ui-icon-triangle-1-n",horizontalCollapseButtonLeftCollapsed:"ui-igsplitter-collapse-button-horizontal-left",horizontalCollapseButtonLeftCollapsedIcon:"ui-icon ui-icon-triangle-1-s",horizontalCollapseButtonRightExpanded:"ui-igsplitter-collapse-button-horizontal-right",horizontalCollapseButtonRightExpandedIcon:"ui-icon ui-icon-triangle-1-s",horizontalCollapseButtonRightCollapsed:"ui-igsplitter-collapse-button-horizontal-right",horizontalCollapseButtonRightCollapsedIcon:"ui-icon ui-icon-triangle-1-n",collapseButtonDefault:"ui-state-default",collapseButtonSingle:"ui-igsplitter-collapse-single-button",collapseButtonPressed:"ui-igsplitter-collapse-button-pressed",collapseButtonHover:"ui-igsplitter-collapse-button-hover ui-state-hover",noScroll:"ui-igsplitter-no-scroll"},events:{collapsed:"collapsed",expanded:"expanded",resizeStarted:"resizeStarted",resizing:"resizing",resizeEnded:"resizeEnded",layoutRefreshing:"layoutRefreshing",layoutRefreshed:"layoutRefreshed"},options:{width:null,height:null,orientation:"vertical",panels:[],dragDelta:3,resizeOtherSplitters:true},widget:function(){return this.element},_createWidget:function(){this._opt={eventHandlers:{},defaultPanelSize:"50%",calculateSizeCloneObject:{element:null,panels:[{options:{},element:null},{options:{},element:null}],bar:{element:null}}};$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){var splitters,length=$(this.element.children("div")).length;this._htmlMarkup=this.element.html();if(this.options.panels.length>2||length>2){throw new Error($.ig.Splitter.locale.errorPanels)}if(length===1){this.element.append("<div/>")}else if(length===0){this.element.append("<div/>");this.element.append("<div/>")}this._panels=[];this._splitter={};splitters=$.data(document.body,"ig-splitters")||[];splitters.push(this.element);$.data(document.body,"ig-splitters",splitters);if(this.options.width){this.element.css("width",this.options.width)}if(this.options.height){this.element.css("height",this.options.height)}this._opt.barMouseDown=false;this._render();this._removeClasses();this._addClasses();this._removeEventHandlers();this._addEventHandlers();this._panelsLayout()},_setOption:function(option,value){var oldWidth,oldHeight;if(this.options[option]===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"width":oldWidth=this.element.width();this.element.css("width",value);if(this.options.orientation==="vertical"){this._setPanelsNewWidth(value,oldWidth)}this._panelsLayout();break;case"height":oldHeight=this.element.height();this.element.css("height",value);if(this.options.orientation==="horizontal"){this._setPanelsNewHeight(value,oldHeight)}this._panelsLayout();break;case"orientation":case"panels":throw new Error($.ig.Splitter.locale.errorSettingOption);default:break}},_setPanelsNewWidth:function(newWidth,oldWidth){var secondPanelRatio=this.secondPanel().width()/oldWidth;this.setSecondPanelSize(newWidth*secondPanelRatio)},_setPanelsNewHeight:function(newHeight,oldHeight){var secondPanelRatio=this.secondPanel().height()/oldHeight;this.setSecondPanelSize(newHeight*secondPanelRatio)},_render:function(){var panels=$(this.element.children("div")),panel,self=this,reducedSize,defaultSize=0,j,elementSize;reducedSize=this._reducedSize();if(this.options[this._getOrientation("size")]){elementSize=this._getOrientation("size")==="width"?this.element.width():this.element.height();defaultSize=elementSize-reducedSize.size}else{defaultSize=this._getSize(this._getOrientation("size"))-reducedSize.size}if(panels.length-reducedSize.length!==0){defaultSize=Math.floor(defaultSize/(panels.length-reducedSize.length))}if(this._panels.length<1){panels.each(function(i,element){panel=$(element);panel.options={max:9007199254740992,_max:"100%",min:0,_min:"0",collapsible:false,resizable:true,collapsed:false,size:panel[self._getOrientation("size")]()};for(j=0;j<self._const.properties.length;j++){if(self.options.panels[i]&&self.options.panels[i][self._const.properties[j]]!==undefined&&self.options.panels[i][self._const.properties[j]]!==null){panel.options[self._const.properties[j]]=self.options.panels[i][self._const.properties[j]]}else{if(self._const.properties[j]==="size"){if(panel[0].style[self._getOrientation("size")]!=="auto"&&panel[0].style[self._getOrientation("size")]!==""){panel.options.size=panel[self._getOrientation("size")]()}else{panel.options.size=defaultSize}}}}self._panels.push(panel)});this._createSplitter()}},_reducedSize:function(){var i,reducedSize={size:0,length:0},size=0;for(i=0;i<this.options.panels.length;i++){size=0;if(this.options.panels[i].size!==undefined){if(/%/.test(this.options.panels[i].size)){this.options.panels[i].size=this.options.panels[i].size.replace("%","")*this._getSize(this._getOrientation("size"))/100;this._isPercentLayout=true}if(/px/.test(this.options.panels[i].size)){this.options.panels[i].size=parseInt(this.options.panels[i].size,10)}size=this.options.panels[i].size;reducedSize.length+=1}if(this.options.panels[i].min!==undefined){if(/px/.test(this.options.panels[i].min)){this.options.panels[i].min=parseInt(this.options.panels[i].min,10)}if(/%/.test(this.options.panels[i].min)){this.options.panels[i]._min=this.options.panels[i].min;this.options.panels[i].min=this.options.panels[i].min.replace("%","")*this._getSize(this._getOrientation("size"))/100}}if(this.options.panels[i].max!==undefined){if(/px/.test(this.options.panels[i].max)){this.options.panels[i].max=parseInt(this.options.panels[i].max,10)}if(/%/.test(this.options.panels[i].max)){this.options.panels[i]._max=this.options.panels[i].max;this.options.panels[i].max=this.options.panels[i].max.replace("%","")*this._getSize(this._getOrientation("size"))/100}}reducedSize.size+=size}return reducedSize},_getSize:function(size){var boxSizing=this.element.css("box-sizing"),value;if(window.getComputedStyle!==undefined){value=parseInt(window.getComputedStyle(this.element[0])[size],10);if($.ig.util.isChrome&&boxSizing==="border-box"){value-=parseInt(this.element.css("border-width"),10)*2}return value}return this.element[size]()},_getOrientation:function(property){return this._const.orientations[this.options.orientation][property]},_getEvent:function(event){if(this._isTouch()){return event+" "+this._const.touchEvents[event]}return event},_isTouch:function(event){var isTouch=typeof window.Modernizr==="object"&&window.Modernizr.touch===true;if(event){isTouch=isTouch&&event.originalEvent.touches}return isTouch},_createSplitter:function(){var collapseButtons=$("<div><span></span></div><div><span></span></div>"),bar=$("<div></div>").attr("tabindex",0),div,topMarginButtonLeftCollapsed;this._splitter={left:this._panels[0],right:this._panels[1]};bar.insertAfter(this._panels[0]);this._splitter.bar=bar;this._splitter.bar.append(collapseButtons);div=$("<div/>").appendTo(this._splitter.bar);$("<span></span>")[this._getOrientation("size")](this._splitter.bar[this._getOrientation("size")]).attr("title","").appendTo(div);if($.ig.util.isIEOld){setTimeout(function(){topMarginButtonLeftCollapsed=$(".ui-igsplitter-collapse-button-vertical-left.ui-state-default").css("margin-top");$(".ui-igsplitter-collapse-button-vertical-left.ui-state-default").css("margin-top",topMarginButtonLeftCollapsed)},1)}},_removeClasses:function(){var buttonLeft,buttonRight,resizeHandler,i;this.element.removeClass(this.css.splitter);for(i=0;i<this._panels.length;i++){this._panels[i].removeClass(this.css[this.options.orientation+"Panel"])}this._splitter.bar.removeClass(this.css.bar+"-"+this.options.orientation);this._splitter.bar.removeClass(this.css.barNormal);this._splitter.bar.removeClass(this.css.barCollapsed);buttonLeft=$(this._splitter.bar.children()[0]);buttonRight=$(this._splitter.bar.children()[1]);buttonLeft.removeClass(this.css[this.options.orientation+"CollapseButtonLeftExpanded"]);buttonRight.removeClass(this.css[this.options.orientation+"CollapseButtonRightExpanded"]);buttonLeft.removeClass(this.css.collapseButtonDefault);buttonRight.removeClass(this.css.collapseButtonDefault);resizeHandler=$(this._splitter.bar.children()[2]);resizeHandler.removeClass(this.css.resizeHandler+"-"+this.options.orientation);$(resizeHandler.children()[0]).removeClass(this.css.resizeHandlerInner+"-"+this.options.orientation)},_addClasses:function(){var buttonLeft,buttonRight,i,resizeHandler;this.element.addClass(this.css.splitter);for(i=0;i<this._panels.length;i++){this._panels[i].addClass(this.css[this.options.orientation+"Panel"])}this._splitter.bar.addClass(this.css.bar+"-"+this.options.orientation);this._splitter.bar.addClass(this.css.barNormal);if(this._panels[0].options.collapsed||this._panels[1].options.collapsed){this._splitter.bar.addClass(this.css.barCollapsed)}buttonLeft=$(this._splitter.bar.children()[0]);buttonRight=$(this._splitter.bar.children()[1]);buttonLeft.addClass(this.css[this.options.orientation+"CollapseButtonLeftExpanded"]);$(buttonLeft.children()).addClass(this.css[this.options.orientation+"CollapseButtonLeftExpandedIcon"]);buttonRight.addClass(this.css[this.options.orientation+"CollapseButtonRightExpanded"]);$(buttonRight.children()).addClass(this.css[this.options.orientation+"CollapseButtonRightExpandedIcon"]);resizeHandler=$(this._splitter.bar.children()[2]);resizeHandler.addClass(this.css.resizeHandler+"-"+this.options.orientation);$(resizeHandler.children()[0]).addClass(this.css.resizeHandlerInner+"-"+this.options.orientation);if(!this._panels[0].options.collapsible){buttonLeft.hide();buttonRight.addClass(this.css.collapseButtonSingle)}if(!this._panels[1].options.collapsible){buttonRight.hide();buttonLeft.addClass(this.css.collapseButtonSingle)}buttonLeft.addClass(this.css.collapseButtonDefault);buttonRight.addClass(this.css.collapseButtonDefault)},_removeEventHandlers:function(){$(this._splitter.bar).unbind(this._getEvent("focus"),this._getEvent("blur"),this._getEvent("keydown"));$(this._splitter.bar.children()[0]).unbind(this._getEvent("mousedown"));$(this._splitter.bar.children()[1]).unbind(this._getEvent("mousedown"));if(!this._isTouch()){$(this._splitter.bar).unbind(this._getEvent("mouseenter"),this._getEvent("mouseleave"));$(this._splitter.bar.children()[0]).unbind(this._getEvent("mouseenter"),this._getEvent("mouseleave"));$(this._splitter.bar.children()[1]).unbind(this._getEvent("mouseenter"),this._getEvent("mouseleave"))}},_addEventHandlers:function(){var self=this,options=this.options;self.autoResize=true;this._opt.eventHandlers.documentMouseUp=function(){if(options.disabled){return}self.autoResize=false;self._stopDrag(self);self.autoResize=true;self._lastMove=null;self._opt.barMouseDown=false};this._opt.eventHandlers.documentMouseMove=function(ev){if(options.disabled){return}var noCancel=true;self._currentMove=self._isTouch(ev)?ev.originalEvent.touches[0][self._getOrientation("page")]:ev[self._getOrientation("page")];if(self._capturedElement&&self._isDragging()&&!self._isDrag){self._triggerResizeStarted();self._isDrag=true}if(self._capturedElement&&self._isDragging()){noCancel=self._triggerResizing()}if(noCancel&&self._isDragging()){self._performDrag(self,ev)}else{return false}};this._opt.eventHandlers.windowResize=function(){var noCancel=self._triggerLayoutRefreshing();if(noCancel){self._panelsLayout({isWindowResize:true});self._triggerLayoutRefreshed()}};$(document).bind(this._getEvent("mouseup")+"."+this.element.attr("id"),this._opt.eventHandlers.documentMouseUp).bind(this._getEvent("mousemove")+"."+this.element.attr("id"),this._opt.eventHandlers.documentMouseMove);$(window).bind("resize."+this.element.attr("id"),this._opt.eventHandlers.windowResize);this._addBarHandlers();this._addCollapseButtonHandlers($(this._splitter.bar.children()[0]),0);this._addCollapseButtonHandlers($(this._splitter.bar.children()[1]),1)},_isDragging:function(){if(this.element.find("iframe").length){return true}return Math.abs(this._currentMove-this._lastMove)>this.options.dragDelta},_addBarHandlers:function(){var self=this,splitter=this._splitter,options=this.options;splitter.bar.bind(this._getEvent("mousedown"),{self:this},this._startDrag).bind(this._getEvent("mousedown"),function(){if(options.disabled){return}self._opt.barMouseDown=true});this._splitter.bar.find("."+this.css.resizeHandler+"-"+this.options.orientation).bind(this._getEvent("mousedown"),{self:this},this._startDrag);splitter.bar.bind(this._getEvent("keydown"),{self:this},this._kbNavigation);if(!this._isTouch()){splitter.bar.bind(this._getEvent("mouseenter"),function(){if(options.disabled){return}$(this).addClass(self.css.barHover)});splitter.bar.bind(this._getEvent("mouseleave"),function(){if(options.disabled){return}$(this).removeClass(self.css.barHover)})}splitter.bar.bind(this._getEvent("focus"),function(){if(options.disabled){return}$(this).addClass(self.css.barActive)});splitter.bar.bind(this._getEvent("blur"),function(){if(options.disabled){return}$(this).removeClass(self.css.barActive)})},_kbNavigation:function(event){var splitter=event.data.self,noCancel=true;if(splitter.options.disabled){return}if(event.keyCode===$.ui.keyCode[splitter._getOrientation("keyboard")[0]]){if(event.ctrlKey){splitter._stopDrag(splitter,true,true);if(splitter._panels[1].options.collapsed){splitter.expandAt(1)}else if(!splitter._panels[0].options.collapsed){splitter.collapseAt(0)}}else{splitter._startDrag(event);splitter._kbMove-=splitter._kbLockRight?0:splitter._getStep();if(splitter._capturedElement&&!splitter._isDrag){splitter._triggerResizeStarted();splitter._isDrag=true}if(splitter._capturedElement){noCancel=splitter._triggerResizing()}if(noCancel){splitter._performDrag(splitter,event)}else{return false}if(splitter._capturedElement&&splitter._capturedElement.hasClass(splitter.css.barInvalid)){splitter._kbLockRight=true;splitter._kbLockLeft=false}else{splitter._kbLockRight=false;splitter._kbLockLeft=false}}event.preventDefault()}else if(event.keyCode===$.ui.keyCode[splitter._getOrientation("keyboard")[1]]){if(event.ctrlKey){splitter._stopDrag(splitter,true,true);if(splitter._panels[0].options.collapsed){splitter.expandAt(0)}else if(!splitter._panels[1].options.collapsed){splitter.collapseAt(1)}}else{splitter._startDrag(event);splitter._kbMove+=splitter._kbLockLeft?0:splitter._getStep();if(splitter._capturedElement&&!splitter._isDrag){splitter._triggerResizeStarted();splitter._isDrag=true}if(splitter._capturedElement){noCancel=splitter._triggerResizing()}if(noCancel){splitter._performDrag(splitter,event)}else{return false}if(splitter._capturedElement&&splitter._capturedElement.hasClass(splitter.css.barInvalid)){splitter._kbLockRight=false;splitter._kbLockLeft=true}else{splitter._kbLockRight=false;splitter._kbLockLeft=false}}event.preventDefault()}else if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){splitter._stopDrag(splitter,false,true);event.preventDefault()}else if(event.keyCode===$.ui.keyCode.ESCAPE){splitter._stopDrag(splitter,true)}else if(event.keyCode===$.ui.keyCode.TAB){splitter._stopDrag(splitter,false,true)}},_startDrag:function(event){var left,right,splitter=event.data.self;if(splitter.options.disabled){return}splitter._splitter.bar.focus();splitter._resizeArea=splitter._splitter;if(splitter._resizeArea!==null){if((splitter._resizeArea.left.options.resizable===undefined||splitter._resizeArea.left.options.resizable)&&(splitter._resizeArea.right.options.resizable===undefined||splitter._resizeArea.right.options.resizable)){left=splitter._resizeArea.left;right=splitter._resizeArea.right;if(!left.options.collapsed&&!right.options.collapsed&&!(right.options.max<=right[splitter._getOrientation("outerSize")]()&&left.options.max<=left[splitter._getOrientation("outerSize")]())){if(!splitter._capturedElement){splitter._lastMove=splitter._isTouch(event)?event.originalEvent.touches[0][splitter._getOrientation("page")]:event[splitter._getOrientation("page")];if($(event.target).is("span")){splitter._capturedElement=splitter._clone($($(event.target).parent()).parent(),splitter)}else{splitter._capturedElement=splitter._clone(event.target,splitter)}splitter._capturedElement.offset();splitter._startX=splitter._capturedElement.offset().left;splitter._startY=splitter._capturedElement.offset().top;splitter._kbMove=0;splitter._kbLockLeft=false;splitter._kbLockRight=false;splitter._mouseStartX=splitter._isTouch(event)?event.originalEvent.touches[0].pageX:event.pageX;splitter._mouseStartY=splitter._isTouch(event)?event.originalEvent.touches[0].pageY:event.pageY}}}return false}return false},_clone:function(bar,splitter){var opt=this._opt,$bar=$(bar),clonedBar=$bar.clone(),offset=$bar.offset();clonedBar.css({position:"absolute",top:offset.top,left:offset.left,"z-index":9999}).fadeTo(0,.7);clonedBar.mouseup(function(){if(splitter.options.orientation==="vertical"){if(opt.barMouseDown&&Math.round(offset.left)===Math.round(clonedBar.offset().left)){$bar.trigger("click")}}else{if(opt.barMouseDown&&Math.round(offset.top)===Math.round(clonedBar.offset().top)){$bar.trigger("click")}}opt.barMouseDown=false});$(document.body).append(clonedBar);return clonedBar},_addCollapseButtonHandlers:function(button,index){var self=this,options=this.options;button.bind(this._getEvent("mouseenter"),function(e){if(options.disabled){return}$($(this).parent()).removeClass(self.css.barHover);$(this).addClass(self.css.collapseButtonHover);if(e.stopPropagation!==undefined){e.stopPropagation()}if(e.preventDefault!==undefined){e.preventDefault()}return false});button.bind(this._getEvent("mouseleave"),function(){if(options.disabled){return}$($(this).parent()).addClass(self.css.barHover);$(this).removeClass(self.css.collapseButtonHover)});button.bind("mousedown touchstart",function(e){if(options.disabled){return}$(this).toggleClass(self.css.collapseButtonPressed);if(self._panels[index].options.collapsed){self.expandAt(index)}else{self.collapseAt(index)}if(e.stopPropagation!==undefined){e.stopPropagation()}if(e.preventDefault!==undefined){e.preventDefault()}return false})},_performDrag:function(self,ev){var page=self._isTouch(ev)?ev.originalEvent.touches[0][self._getOrientation("page")]:ev[self._getOrientation("page")],bar;if(ev.which===0&&$.ig.util.isIE&&$.ig.util.isIEOld){self._stopDrag(self);return false}if(self._capturedElement){if(ev.type==="keydown"){bar=self[self._getOrientation("start")]+self._kbMove}else{bar=page-self[self._getOrientation("mouse")]+self[self._getOrientation("start")]}self._moveBar(bar);return false}return true},_moveBar:function(bar){bar=this._validatePosition(bar);if(bar.invalid){this._capturedElement.addClass(this.css.barInvalid)}else{this._capturedElement.removeClass(this.css.barInvalid)}this._capturedElement.css(this._getOrientation("dimention"),bar.position)},_validatePosition:function(bar){var resizeArea=this._resizeArea,rightBoundary=this._getNextBoundary(resizeArea),getPreviousBoundary=this._getPreviousBoundary(resizeArea),min=Math.min(rightBoundary,rightBoundary-resizeArea.right.options.min,getPreviousBoundary+resizeArea.left.options.max),max=Math.max(getPreviousBoundary,getPreviousBoundary+resizeArea.left.options.min,rightBoundary-resizeArea.right.options.max),pos;if(max>min){pos=resizeArea.right.offset()[this._getOrientation("dimention")]-this._capturedElement[this._getOrientation("outerSize")](true);return{position:pos,invalid:true}}if(bar<max){return{position:max,invalid:true}}if(bar>min){return{position:min,invalid:true}}return{position:bar,invalid:false}},_getNextBoundary:function(panel){var size=panel.right.offset()[this._getOrientation("dimention")]+panel.right[this._getOrientation("size")]()-this._capturedElement[this._getOrientation("outerSize")](true);if(panel.right.options.collapsed){size-=panel.right.options.min}return size},_getPreviousBoundary:function(panel){var size=panel.left.offset()[this._getOrientation("dimention")];if(panel.left.options.collapsed){size+=panel.left.options.min}return size},_stopDrag:function(self,cancel,kbMove){if(self._capturedElement){if(!cancel&&(self._isDrag||kbMove)){self._performAreaResize()}self._capturedElement.remove();self._isDrag=false}self._capturedElement=null},_performAreaResize:function(){var resizeArea=this._resizeArea,offset=this._capturedElement.offset()[this._getOrientation("dimention")]-this[this._getOrientation("start")],left=resizeArea.left[this._getOrientation("size")]()+offset,right=resizeArea.right[this._getOrientation("size")]()-offset;this._setPanelSize(resizeArea.left,left);this._setPanelSize(resizeArea.right,right);if(offset!==0){this._triggerResizeEnded()}this._splittersLayout()},_splittersLayout:function(){var splitters=$.data(document.body,"ig-splitters")||[],$currSplitter,i;for(i=0;i<splitters.length;i++){$currSplitter=splitters[i];if($currSplitter===this.element){$currSplitter.data("igSplitter")._panelsLayout()}else if(this.options.resizeOtherSplitters){$currSplitter.data("igSplitter")._panelsLayout()}}},_getSplitBarSize:function(){var style,innerSize,border,size,elem=this._splitter.bar[0],sizeKey=this._const.orientations[this.options.orientation].size;if(window.getComputedStyle){style=window.getComputedStyle(elem,null)}else{style=elem.currentStyle}innerSize=style[sizeKey];border=style.borderLeftWidth;size=parseFloat(innerSize)+2*parseFloat(border);return Math.ceil(size)},_panelsLayout:function(parameterObject){var i,$currChild,$currChildChildren,oppositeSize,panelsSizeInPercentages,outerSize=(this._panels.length-1)*this._getSplitBarSize(),sizeKey=this._getOrientation("size"),oppositeSizeKey=this._getOrientation("oppositeSize"),size=this._getSize(sizeKey),$splitBarChildren=this._splitter.bar.children(),regExp=new RegExp("%"),cloneObjPanels=this._opt.calculateSizeCloneObject.panels;if($.ig.util.isIEOld){if(regExp.test(this.element[0].style[sizeKey])){size-=1}}for(i=0;i<this._panels.length;i++){if(!this._panels[i].options.collapsed){outerSize+=this._handlerPanelSize(this._panels[i],outerSize,size)}else{$currChild=$splitBarChildren.eq(i);$currChildChildren=$currChild.children();this._handlerPanelSize(this._panels[i],outerSize,size);$splitBarChildren.eq((i+1)%2).hide();$currChild.removeClass(this.css[this.options.orientation+"CollapseButton"+(i%2===0?"Left":"Right")+"Expanded"]).addClass(this.css[this.options.orientation+"CollapseButton"+(i%2===0?"Left":"Right")+"Collapsed"]);$currChildChildren.removeClass(this.css[this.options.orientation+"CollapseButton"+(i%2===0?"Left":"Right")+"ExpandedIcon"]).addClass(this.css[this.options.orientation+"CollapseButton"+(i%2===0?"Left":"Right")+"CollapsedIcon"])}}if(regExp.test(this.options[sizeKey])||!this.options[sizeKey]){if(parameterObject&&parameterObject.isWindowResize){this._calculateSizeWithClone()}else{cloneObjPanels[0].options={min:this._getPanelInitMin(0),max:this._getPanelInitMax(0)};cloneObjPanels[1].options={min:this._getPanelInitMin(1),max:this._getPanelInitMax(1)};if(this._isPercentLayout||!this.options.panels.length||(this.options.panels[0]===undefined||this.options.panels[0].size===undefined)&&(this.options.panels[1]===undefined||this.options.panels[1].size===undefined)){panelsSizeInPercentages=this._getPanelsSizeInPercentages.call(this,sizeKey);cloneObjPanels[0].options.size=panelsSizeInPercentages[0];cloneObjPanels[1].options.size=panelsSizeInPercentages[1]}else{cloneObjPanels[0].options.size=this.options.panels[0]&&this.options.panels[0].size&&this._panels[0].options.size;cloneObjPanels[1].options.size=this.options.panels[1]&&this.options.panels[1].size&&this._panels[1].options.size}if(outerSize<size){this._createPanel(size,outerSize,this._panels.length-1)}}}else if(outerSize<size){this._createPanel(size,outerSize,this._panels.length-1)}oppositeSize=this.element[oppositeSizeKey]();this._splitter.bar[oppositeSizeKey](oppositeSize);$splitBarChildren.eq(2).find("span")[oppositeSizeKey](oppositeSize)},_calculateSizeWithClone:function(){var $splitterClone,sizeWithoutBarSize,panel2RecalculatedSize,min,max,oppositeSizeKey=this._getOrientation("oppositeSize"),cloneObj=this._opt.calculateSizeCloneObject,cloneObjPanels=cloneObj.panels,$bar=cloneObj.bar.element,$panel1=cloneObjPanels[0].element,$panel2=cloneObjPanels[1].element,sizeKey=this._getOrientation("size"),minSize="min-"+sizeKey,maxSize="max-"+sizeKey,cssObj={},size=this._getSize(sizeKey),barSize=this._getSplitBarSize(),panel1Size=cloneObjPanels[0].options.size,panel2Size=cloneObjPanels[1].options.size&&/%/.test(cloneObjPanels[1].options.size)?size*cloneObjPanels[1].options.size.replace("%","")/100-barSize:cloneObjPanels[1].options.size;if(!cloneObj.element||!$panel1||!$panel2||!$bar){$splitterClone=this.element.clone().html("");$splitterClone.removeAttr("id").css({top:-99999,left:-99999,position:"absolute"}).addClass("calc-size-clone");$panel2=$("<div>");cssObj={"float":"right"};cssObj[oppositeSizeKey]="100%";$panel2.css(cssObj).appendTo($splitterClone);$bar=$("<div>");$bar.css(cssObj).appendTo($splitterClone);cssObj={};cssObj[oppositeSizeKey]="100%";cssObj.overflow="hidden";$panel1=$("<div>");$panel1.css(cssObj).appendTo($splitterClone);cssObj={};cloneObj.element=$splitterClone;cloneObjPanels[0].element=$panel1;cloneObjPanels[1].element=$panel2;cloneObj.bar.element=$bar}cssObj[maxSize]=cloneObjPanels[1].options.max;cssObj[minSize]=cloneObjPanels[1].options.min;cssObj[sizeKey]=this._panels[1].options.collapsed?0:this._panels[0].options.collapsed?size:panel2Size;$panel2.css(cssObj);$bar[sizeKey](barSize);cssObj[maxSize]=cloneObjPanels[0].options.max;cssObj[minSize]=cloneObjPanels[0].options.min;cssObj[sizeKey]=this._panels[0].options.collapsed?0:this._panels[1].options.collapsed?size-barSize+"px":panel1Size;$panel1.css(cssObj);cloneObj.element[sizeKey](this.element[sizeKey]());cloneObj.element.appendTo($("body"));sizeWithoutBarSize=size-barSize;panel2RecalculatedSize=sizeWithoutBarSize-$panel1[sizeKey]();if(panel2Size===undefined&&panel1Size===undefined){$panel1[sizeKey](this._opt.defaultPanelSize)}else if($panel1[sizeKey]()>sizeWithoutBarSize&&!this._panels[1].options.size){$panel1[sizeKey](sizeWithoutBarSize)}if($panel2[sizeKey]()!==panel2RecalculatedSize||panel2Size===undefined&&panel1Size!==undefined){$panel2[sizeKey](panel2RecalculatedSize)}if($panel1[sizeKey]()+$panel2[sizeKey]()+barSize!==cloneObj.element[sizeKey]()){this._resolveSizeConflictsOfCloneObject($panel1,$panel2,cloneObj.element,sizeKey)}this._resolveRoundingConflictsOfCloneObject($panel1,$panel1.css(minSize),$panel2,size,sizeKey);this._resolveRoundingConflictsOfCloneObject($panel2,$panel2.css(minSize),$panel1,size,sizeKey);this._setPanelSize(this._panels[1],$panel2[sizeKey]());if($panel2.css(minSize)&&$panel2.css(minSize)!=="none"){min=$panel2.css(minSize);this._setPanelActualMin(1,min)}else{this._panels[1].css(minSize,"")}if($panel2.css(maxSize)&&$panel2.css(maxSize)!=="none"){max=$panel2.css(maxSize);this._setPanelActualMax(1,max)}else{this._panels[1].css(maxSize,"")}this._setPanelSize(this._panels[0],$panel1[sizeKey]());if($panel1.css(minSize)&&$panel1.css(minSize)!=="none"){min=$panel1.css(minSize);this._setPanelActualMin(0,min)}else{this._panels[0].css(minSize,"")}if($panel1.css(maxSize)&&$panel1.css(maxSize)!=="none"){max=$panel1.css(maxSize);this._setPanelActualMax(0,max)}else{this._panels[0].css(maxSize,"")}cloneObj.element.detach()},_resolveSizeConflictsOfCloneObject:function(clonePanel1,clonePanel2,cloneSplitter,sizeKey){var barSize=this._getSplitBarSize(),size=cloneSplitter[sizeKey](),size1=this._getSizeInPixels(clonePanel1[sizeKey](),size),size2=this._getSizeInPixels(clonePanel2[sizeKey](),size),clonePanel1NeededArea=size-barSize-size2,clonePanel2NeededArea=size-barSize-size1,clonePanel1Min=this._getSizeInPixels(clonePanel1.css("min-"+sizeKey),size),clonePanel2Min=this._getSizeInPixels(clonePanel2.css("min-"+sizeKey),size);if(size1>clonePanel1NeededArea&&(clonePanel1Min||clonePanel2Min)){if(clonePanel1Min&&!clonePanel2Min){clonePanel2[sizeKey](clonePanel2NeededArea)}else if(!clonePanel1Min&&clonePanel2Min){if(clonePanel2NeededArea>clonePanel2Min){clonePanel2[sizeKey](clonePanel2NeededArea)}else{clonePanel2[sizeKey](clonePanel2Min);clonePanel1[sizeKey](size-barSize-clonePanel2Min)}}else{if(clonePanel2NeededArea>clonePanel2Min){clonePanel2[sizeKey](clonePanel2NeededArea)}else if(clonePanel1NeededArea>clonePanel1Min){clonePanel2[sizeKey](clonePanel2Min);clonePanel1[sizeKey](size-barSize-clonePanel2Min)}else{clonePanel1[sizeKey](Math.floor(clonePanel1Min));clonePanel2.css("min-"+sizeKey,size-barSize-Math.floor(clonePanel1Min))}}}},_resolveRoundingConflictsOfCloneObject:function(checkedPanel,checkedPanelMin,oppositePanel,sizeSplitter,sizeKey){var floatSize,diff,newSize,barSize=this._getSplitBarSize();floatSize=Math.floor(checkedPanel[0].getBoundingClientRect()[sizeKey]*1e3)/1e3;diff=Math.abs(this._getSizeInPixels(checkedPanel[sizeKey]())-floatSize);if(0<diff&&diff<=1){if(checkedPanelMin){checkedPanelMin=this._getSizeInPixels(checkedPanelMin,sizeSplitter);diff=Math.abs(Math.floor(checkedPanelMin)-checkedPanelMin);if(0<diff&&diff<=1){checkedPanel.css("min-"+sizeKey,Math.floor(checkedPanelMin)+"px")}}newSize=Math.floor(floatSize);checkedPanel[sizeKey](newSize+"px");oppositePanel[sizeKey](sizeSplitter-barSize-newSize+"px")}},_getSizeInPixels:function(candidateValue,sizeOfParentInPixels){if(/%/.test(candidateValue)){return parseFloat(sizeOfParentInPixels*candidateValue.replace("%","")/100)}else{return parseFloat(candidateValue)}},_getPanelInitMin:function(panelIndex){var optionsPanel=this.options.panels[panelIndex];return optionsPanel&&(optionsPanel._min||optionsPanel.min)},_getPanelInitMax:function(panelIndex){var optionsPanel=this.options.panels[panelIndex];return optionsPanel&&(optionsPanel._max||optionsPanel.max)},_getStep:function(){return this._const.step+this._splitter.bar[this._getOrientation("size")]()},_handlerPanelSize:function(panel,outerSize,size){if(this._isPercentLayout){if(panel.options._min!==undefined){panel.options.min=panel.options._min.replace("%","")*this._getSize(this._getOrientation("size"))/100}if(panel.options._max!==undefined){panel.options.max=panel.options._max.replace("%","")*this._getSize(this._getOrientation("size"))/100
}}this._setPanelSize(panel,panel.options.size);var newSize;if(outerSize+panel.options.size>=size&&!panel.options.collapsed){newSize=size-outerSize;if(!panel.options.collapsed){if(this._isPercentLayout){panel[this._getOrientation("size")](newSize/this._getSize(this._getOrientation("size"))*100+"%")}else{panel[this._getOrientation("size")](newSize)}panel.options.size=newSize}}return panel[this._getOrientation("outerSize")](true)},_setPanelSize:function(panel,size){if(!panel.options.collapsed){panel.options.size=parseInt(size,10);if(panel.options.size===0||this._isPercentLayout&&panel.options.size<=$.ig.util.getScrollWidth()){panel.addClass(this.css.noScroll)}else{panel.removeClass(this.css.noScroll)}if(this._isPercentLayout){size=parseInt(size,10);panel[this._getOrientation("size")](size/this._getSize(this._getOrientation("size"))*100+"%")}else{panel[this._getOrientation("size")](size)}}else{panel.addClass(this.css.noScroll);panel[this._getOrientation("size")](0)}},_setPanelActualMin:function(panelIndex,min){var convertedMin,panel=this._panels[panelIndex],sizeKey=this._getOrientation("size"),size=this._getSize(sizeKey);if(min===undefined){return}if(/%/.test(min)){if(this._isInitMinDefinedInPercentages(panelIndex)){panel.options._min=min}convertedMin=size*parseFloat(min,10)/100;panel.options.min=convertedMin}else{min=parseInt(min,10);if(this._isInitMinDefinedInPercentages(panelIndex)){convertedMin=min/size*100;panel.options._min=convertedMin+"%"}panel.options.min=min;min+="px"}if(!panel.options.collapsed){panel.css("min-"+this._getOrientation("size"),min)}},_setPanelActualMax:function(panelIndex,max){var convertedMax,panel=this._panels[panelIndex],sizeKey=this._getOrientation("size"),size=this._getSize(sizeKey);if(max===undefined){return}if(/%/.test(max)){if(this._isInitMaxDefinedInPercentages(panelIndex)){panel.options._max=max}convertedMax=size*parseFloat(max,10)/100;panel.options.max=convertedMax}else{max=parseInt(max,10);if(this._isInitMaxDefinedInPercentages(panelIndex)){convertedMax=max/size*100;panel.options._max=convertedMax+"%"}panel.options.max=max;max+="px"}if(!panel.options.collapsed){panel.css("max-"+this._getOrientation("size"),max)}},_isInitMinDefinedInPercentages:function(panelIndex){var initPanelOptions=this.options.panels[panelIndex];return initPanelOptions!==undefined&&(initPanelOptions._min!==undefined||/%/.test(initPanelOptions.min))},_isInitMaxDefinedInPercentages:function(panelIndex){var initPanelOptions=this.options.panels[panelIndex];return initPanelOptions!==undefined&&(initPanelOptions._max!==undefined||/%/.test(initPanelOptions.max))},_createPanel:function(size,outerSize,index,overrideMax){var panel,newSize,panelSize,maxSize;if(overrideMax===undefined){overrideMax=true}if(index===undefined){index=0}panel=this._panels[index];newSize=size-outerSize;panelSize=panel[this._getOrientation("size")]();maxSize=newSize+panelSize;if(index<=this._panels.length){if(panel.options.collapsed){this._panelHelper(outerSize,size)}else{if(maxSize>panel.options.max&&overrideMax){panel.options.max=maxSize}if(this._isPercentLayout){panel[this._getOrientation("size")](maxSize/this._getSize(this._getOrientation("size"))*100+"%")}else{panel[this._getOrientation("size")](maxSize)}panel.options.size=maxSize}}else{maxSize=Math.min(maxSize,panel.options.max);if(!panel.options.collapsed){panel[this._getOrientation("size")](maxSize);panel.options.size=maxSize}else{maxSize=panelSize=0}if(maxSize+(outerSize-panelSize)<size||panel.options.collapsed){this._createPanel(size,outerSize-panelSize+maxSize,index-1)}}},_panelHelper:function(outerSize,size){var panel,flag=false,i;for(i=0;i<this._panels.length&&!flag;i++){panel=this._panels[i];if(!panel.options.collapsed){flag=true}}panel[this._getOrientation("size")](size-outerSize+panel[this._getOrientation("size")]())},expandAt:function(index){var neighborPanel;if(index<=this._panels.length&&index>=0&&this._panels[index].options.collapsed){neighborPanel=this._panels[index%2===0?1:0];this._panels[index].options.collapsed=false;this._panels[index].options.size=Math.min(this._panels[index].options.size,neighborPanel[this._getOrientation("size")]());neighborPanel.options.size=neighborPanel[this._getOrientation("size")]()-this._panels[index].options.size;this._splitter.bar.removeClass(this.css.barCollapsed);if(this._panels[(index+1)%2].options.collapsible){$(this._splitter.bar.children()[(index+1)%2]).show()}$(this._splitter.bar.children()[index]).removeClass(this.css.collapseButtonPressed);$(this._splitter.bar.children()[index]).removeClass(this.css[this.options.orientation+"CollapseButton"+(index%2===0?"Left":"Right")+"Collapsed"]);$($(this._splitter.bar.children()[index]).children()).removeClass(this.css[this.options.orientation+"CollapseButton"+(index%2===0?"Left":"Right")+"CollapsedIcon"]);$(this._splitter.bar.children()[index]).addClass(this.css[this.options.orientation+"CollapseButton"+(index%2===0?"Left":"Right")+"Expanded"]);$($(this._splitter.bar.children()[index]).children()).addClass(this.css[this.options.orientation+"CollapseButton"+(index%2===0?"Left":"Right")+"ExpandedIcon"]);neighborPanel.css(this._getOrientation("size"),neighborPanel.options.size);this._panels[index].css(this._getOrientation("size"),this._panels[index].options.size);this._splittersLayout();this._triggerExpanded(index)}},collapseAt:function(index){var size,neighborPanel;if(index<this._panels.length&&index>=0&&!this._panels[index].options.collapsed&&this._panels[index].options.collapsible){size=this._panels[index][this._getOrientation("size")]();neighborPanel=this._panels[index%2===0?1:0];this._panels[index].options.size=size||this._panels[index].options.size;this._panels[index].options.collapsed=true;this._splitter.bar.addClass(this.css.barCollapsed);$(this._splitter.bar.children()[(index+1)%2]).hide();$(this._splitter.bar.children()[index]).addClass(this.css.collapseButtonPressed);$(this._splitter.bar.children()[index]).removeClass(this.css[this.options.orientation+"CollapseButton"+(index%2===0?"Left":"Right")+"Expanded"]);$($(this._splitter.bar.children()[index]).children()).removeClass(this.css[this.options.orientation+"CollapseButton"+(index%2===0?"Left":"Right")+"ExpandedIcon"]);$(this._splitter.bar.children()[index]).addClass(this.css[this.options.orientation+"CollapseButton"+(index%2===0?"Left":"Right")+"Collapsed"]);$($(this._splitter.bar.children()[index]).children()).addClass(this.css[this.options.orientation+"CollapseButton"+(index%2===0?"Left":"Right")+"CollapsedIcon"]);neighborPanel.options.size=neighborPanel[this._getOrientation("size")]()+size;neighborPanel.css(this._getOrientation("size"),neighborPanel.options.size);this._panels[index].css(this._getOrientation("size"),0);this._splittersLayout();this._triggerCollapsed(index)}},_animateResize:function(panel,size,animationDuration,callback){var properties={},self=this;properties[this._getOrientation("size")]=size;panel.animate(properties,{step:function(){self._splittersLayout()},duration:animationDuration,complete:function(){self._splittersLayout();if(callback&&typeof callback==="function"){callback()}}})},_triggerCollapsed:function(index){var args={owner:this,index:index};this._trigger(this.events.collapsed,null,args)},_triggerExpanded:function(index){var args={owner:this,index:index};this._trigger(this.events.expanded,null,args)},_triggerResizeStarted:function(){var args={owner:this},iframes=this.element.find("iframe");if(iframes.length>0){iframes.css("pointer-events","none")}this._trigger(this.events.resizeStarted,null,args)},_triggerResizing:function(){var args={owner:this};return this._trigger(this.events.resizing,null,args)},_triggerResizeEnded:function(){var args={owner:this},iframes=this.element.find("iframe");if(iframes.length>0){iframes.css("pointer-events","auto")}this._trigger(this.events.resizeEnded,null,args)},_triggerLayoutRefreshing:function(){var args={owner:this};return this._trigger(this.events.layoutRefreshing,null,args)},_triggerLayoutRefreshed:function(){var args={owner:this};return this._trigger(this.events.layoutRefreshed,null,args)},firstPanel:function(){return this._panels[0]},secondPanel:function(){return this._panels[1]},refreshLayout:function(){this._panelsLayout()},setFirstPanelSize:function(size){if(/%/.test(size)){size=size.replace("%","")*this._getSize(this._getOrientation("size"))/100;this._isPercentLayout=true}if(/px/.test(size)){size=parseInt(size,10)}this._setPanelSize(this._panels[0],size);this._splittersLayout()},setSecondPanelSize:function(size){if(/%/.test(size)){size=size.replace("%","")*this._getSize(this._getOrientation("size"))/100;this._isPercentLayout=true}if(/px/.test(size)){size=parseInt(size,10)}this._setPanelSize(this._panels[0],this._getSize(this._getOrientation("size"))-size);this._splittersLayout()},_getPanelsSizeInPercentages:function(sizeKey){var panel1CalculatedSize=this._panels[0].options.size/this._getSize(sizeKey)*100,panel1Size=panel1CalculatedSize<0?0:panel1CalculatedSize>100?100:panel1CalculatedSize,panel2CalculatedSize=100-panel1Size,panel2Size=panel2CalculatedSize<0?0:panel2CalculatedSize>100?100:panel2CalculatedSize;return[panel1Size+"%",panel2Size+"%"]},destroy:function(){var evtHandlers=this._opt.eventHandlers,i,splitters,index;this._removeEventHandlers();this._removeClasses();this.element.html(this._htmlMarkup);splitters=$.data(document.body,"ig-splitters")||[];for(i=0;i<splitters.length;i++){if(splitters[i][0].id===this.element[0].id){index=i;break}}splitters.splice(index,1);$.data(document.body,"ig-splitters",splitters);$(document).unbind(this._getEvent("mouseup"),evtHandlers.documentMouseUp);$(document).unbind(this._getEvent("mousemove"),evtHandlers.documentMouseMove);$(window).unbind("resize",evtHandlers.windowResize);$.Widget.prototype.destroy.apply(this,arguments);this._opt=null;return this}});$.extend($.ui.igSplitter,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI SplitButton 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 * <Licensing info>
 *
 * http://www.infragistics.com/
 *
 * Depends on: 
 *   jquery-1.9.1.js
 *   jquery.ui.core.js
 *   jquery.ui.widget.js
 *   infragistics.util.js
 *   infragistics.ui.shared.js
 *   infragistics.ui.toolbarbutton.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igSplitButton",{options:{items:[{name:"button1",label:"Button 1",iconClass:"ui-icon-gear"}],defaultItemName:"button1",swapDefaultEnabled:false},events:{click:"click",expanded:"expanded",expanding:"expanding",collapsed:"collapsed",collapsing:"collapsing"},css:{container:"ui-splitbutton ui-widget ui-state-default",arrow:"ui-splitbutton-arrow",conrnersLeft:"ui-corner-left",conrnersRight:"ui-corner-right",hover:"ui-splitbutton-hover",active:"ui-state-active",focus:"ui-state-focus"},_id:function(id){return this.element[0].id+id},_renderDefaultBtn:function(){var options=this.options,defaultItem=this._getDefaultItem(options.defaultItemName);this._options.defaultButton=$('<div id="'+this._id("_"+options.defaultItemName)+'"></div>').appendTo(this.element).igToolbarButton({onlyIcons:true,labelText:"&nbsp;",title:defaultItem.label,icons:{primary:defaultItem.iconClass},name:options.defaultItemName,allowToggling:false}).addClass("ui-splitbutton-cleargaps "+this.css.conrnersLeft).removeClass("ui-corner-all")},_renderExpandBtn:function(){this._options.expandButton=$("<div id='"+this._id("_arrow")+"' class='"+this.css.arrow+"'></div>").igToolbarButton({onlyIcons:true,labelText:"&nbsp;",icons:{primary:"ui-icon-triangle-1-s"},allowToggling:false}).addClass("ui-splitbutton-cleargaps "+this.css.conrnersRight).removeClass("ui-corner-all").appendTo(this.element)},_setupElement:function(){this.element.addClass(this.css.container).attr("tabIndex",0)},_create:function(){this._options={defaultButton:null,expandButton:null,itemsList:null,isExpanded:false,justFocused:false};this._setupElement();this._renderDefaultBtn();this._renderExpandBtn();this._createItemsList();this._attachEvents()},_attachEvents:function(){var _opt=this._options;_opt.defaultButton.on("igtoolbarbuttonclick",$.proxy(this._onDefaultBtnClick,this));_opt.expandButton.on("focus",$.proxy(this._onExpandBtnFocus,this));_opt.expandButton.on("blur",$.proxy(this._onExpandBtnBlur,this));_opt.expandButton.on("igtoolbarbuttonclick",$.proxy(this._onExpandBtnClick,this));_opt.itemsList.on("igtoolbarbuttonclick","a",$.proxy(this._onItemClick,this));this.element.on("keypress",$.proxy(this._onEnterKeypress,this));this.element.hover($.proxy(this._onMouseEnter,this),$.proxy(this._onMouseLeave,this))},_onDefaultBtnClick:function(e){var self=this;e.stopPropagation();this._trigger(this.events.click,e,{name:self._options.defaultButton.igToolbarButton("option","name"),item:self.element})},_onExpandBtnClick:function(e){var _options=this._options;if(!_options.expandButton.is(":focus")){if(!_options.isExpanded){_options.expandButton.focus()}return}if(_options.justFocused){_options.justFocused=false}else{this.toggle(e)}},_onExpandBtnFocus:function(e){var noCancel;if(!this._options.isExpanded){noCancel=this._triggerExpanding(e);if(noCancel){this.expand(e);this._options.justFocused=true}}},_onExpandBtnBlur:function(e){var noCancel,self=this;if(this._options.isExpanded){setTimeout(function(){noCancel=self._triggerCollapsing(e);if(noCancel){self.collapse(e)}},150)}},_onItemClick:function(e){var $target=$(e.currentTarget);if(this.options.swapDefaultEnabled){this.switchToButton($target)}e.stopImmediatePropagation();this._trigger(this.events.click,e,{name:$target.igToolbarButton("option","name")})},_onEnterKeypress:function(e){if(e.which===$.ui.keyCode.ENTER){this.toggle(e)}},_onMouseEnter:function(){this.element.addClass(this.css.hover)},_onMouseLeave:function(){this.element.removeClass(this.css.hover)},_getDefaultItem:function(name){var options=this.options,i;for(i=0;i<options.items.length;i++){if(options.items[i].name===name){return options.items[i]}}},_createItemsList:function(){var list=$("<ul class='ui-splitbutton-list ui-menu ui-widget ui-widget-content ui-corner-all'></ul>"),options=this.options,i,item;for(i=0;i<options.items.length;i++){if(options.items[i].name!==options.defaultItemName){item=$('<a id="'+this._id("_"+options.items[i].name)+'" class="ui-corner-all" tabindex="-1"></a>').igToolbarButton({onlyIcons:true,labelText:"",title:options.items[i].label,icons:{primary:options.items[i].iconClass},name:options.items[i].name,allowToggling:false}).addClass("ui-splitbutton-cleargaps");$('<li class="ui-menu-item" role="menuitem"></li>').appendTo(list).append(item)}}this._options.itemsList=list.appendTo(this.element)},switchToButton:function(button){var defaultButton=this._options.defaultButton,targetButton=typeof button==="string"?$("#"+this._id("_"+button)):button,defBtnOpts=defaultButton.igToolbarButton("option"),defBtnId=defaultButton.attr("id"),targetBtnOpts=targetButton.igToolbarButton("option"),targetBtnId=targetButton.attr("id");targetButton.igToolbarButton("option",defBtnOpts).attr("id",defBtnId);defaultButton.igToolbarButton("option",targetBtnOpts).attr("id",targetBtnId).igToolbarButton("toggle")},_triggerCollapsing:function(){var args={owner:this};return this._trigger(this.events.collapsing,null,args)},_triggerCollapsed:function(){var args={owner:this};return this._trigger(this.events.collapsed,null,args)},_triggerExpanding:function(){var args={owner:this};return this._trigger(this.events.expanding,null,args)},_triggerExpanded:function(){var args={owner:this};return this._trigger(this.events.expanded,null,args)},widget:function(){return this.element},toggle:function(e){var noCancel,_options=this._options;if(_options.isExpanded){noCancel=this._triggerCollapsing(e);if(noCancel){this.collapse(e)}}else{noCancel=this._triggerExpanding(e);if(noCancel){this.expand(e)}}},collapse:function(e){var self=this,_opt=this._options,expandButton=_opt.expandButton;_opt.itemsList.hide(0,function(){self.element.removeClass(self.css.active);_opt.expandButton.removeClass(self.css.focus);_opt.isExpanded=false;if(e&&e.originalEvent){self._triggerCollapsed(e)}else if(expandButton.is(":focus")){expandButton.blur()}})},expand:function(e){var self=this,_opt=this._options,expandButton=_opt.expandButton;_opt.itemsList.show(0,function(){self.element.addClass(self.css.active);_opt.isExpanded=true;if(e&&e.originalEvent){self._triggerExpanded(e)}else if(!expandButton.is(":focus")){expandButton.focus()}})},destroy:function(){var _opt=this._options;$.Widget.prototype.destroy.apply(this,arguments);_opt.itemsList.off();this.element.find(":ui-igToolbarButton").igToolbarButton("destroy").end().off().removeClass(this.css.container).removeAttr("tabindex").empty();delete _opt.expandButton;delete _opt.itemsList},_setOption:function(key,value){var options=this.options,self=this;if(options[key]===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(key){case"defaultItemName":var result=$("#"+self.element.attr("id")+"_"+value);if(result.length===1){self.switchToButton(result)}break}}});$.extend($.ui.igSplitButton,{version:"15.2.20152.1027"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI infragistics.olapxmladatasource.js 15.2.20152.1027
*
* Copyright (c) 2011-2015 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends:
*     jquery-1.4.4.js
*     jquery.ui.core.js
*     jquery.ui.widget.js
*     infragistics.util.js
*/
$.ig=$.ig||{};(function($){var $$t={};$.ig.$currDefinitions=$$t;$.ig.util.bulkDefine(["AbstractEnumerable:a","Object:b","Type:c","Boolean:d","ValueType:e","Void:f","IConvertible:g","IFormatProvider:h","Number:i","String:j","IComparable:k","Number:l","Number:m","Number:n","Number:o","NumberStyles:p","Enum:q","Array:r","IList:s","ICollection:t","IEnumerable:u","IEnumerator:v","NotSupportedException:w","Error:x","Number:y","String:z","StringComparison:aa","RegExp:ab","CultureInfo:ac","DateTimeFormatInfo:ad","Calendar:ae","Date:af","Number:ag","DayOfWeek:ah","DateTimeKind:ai","CalendarWeekRule:aj","NumberFormatInfo:ak","CompareInfo:al","CompareOptions:am","IEnumerable$1:an","IEnumerator$1:ao","IDisposable:ap","StringSplitOptions:aq","Number:ar","Number:as","Number:at","Number:au","Number:av","Number:aw","Assembly:ax","Stream:ay","SeekOrigin:az","RuntimeTypeHandle:a0","MethodInfo:a1","MethodBase:a2","MemberInfo:a3","ParameterInfo:a4","TypeCode:a5","ConstructorInfo:a6","PropertyInfo:a7","Func$1:a8","MulticastDelegate:a9","IntPtr:ba","AbstractEnumerator:bb","ArgumentException:be","IArray:bg","List$1:bh","IList$1:bi","ICollection$1:bj","Script:bk","IArrayList:bl","Array:bm","CompareCallback:bn","Func$3:bo","Action$1:bp","Comparer$1:bq","IComparer:br","IComparer$1:bs","DefaultComparer$1:bt","IComparable$1:bu","Comparison$1:bv","ReadOnlyCollection$1:bw","Predicate$1:bx","NotImplementedException:by","IDictionary$2:b0","Dictionary$2:b1","IDictionary:b2","Func$2:b3","KeyValuePair$2:b4","Enumerable:b5","Thread:b6","ThreadStart:b7","IOrderedEnumerable$1:b8","SortedList$1:b9","Math:ca","ArgumentNullException:cb","IEqualityComparer$1:cc","EqualityComparer$1:cd","IEqualityComparer:ce","DefaultEqualityComparer$1:cf","InvalidOperationException:ch","GenericEnumerable$1:ci","GenericEnumerator$1:cj","INotifyCollectionChanged:cl","NotifyCollectionChangedEventHandler:cm","NotifyCollectionChangedEventArgs:cn","EventArgs:co","NotifyCollectionChangedAction:cp","ObservableCollection$1:cs","INotifyPropertyChanged:ct","PropertyChangedEventHandler:cu","PropertyChangedEventArgs:cv","Delegate:cw","Interlocked:cx","NameValueCollection:c0","Stack$1:c1","ReverseArrayEnumerator$1:c2","AggregateException:dq","APIFactory:dr","Point:ds","Rect:dt","Size:du","Color:dv","AsyncCompletedEventArgs:dz","ListSortDirection:d1","Environment:d3","UTF8Encoding:eg","Encoding:eh","UnicodeEncoding:ei","AsciiEncoding:ej","Decoder:ek","DefaultDecoder:el","UTF8Encoding_UTF8Decoder:em","StringBuilder:et","ICredentials:eu","NetworkCredential:ev","Uri:ew","UriKind:ex","UploadStringCompletedEventHandler:ey","UploadStringCompletedEventArgs:ez","WebClient:e0","WebHeaderCollection:e1","Task$1:e2","Task:e3","JQueryPromise:e4","Action:e5","TaskStatus:e6","TaskCompletionSource$1:e7","JQueryDeferred:e8","JQuery:e9","JQueryObject:fa","Element:fb","ElementAttributeCollection:fc","ElementCollection:fd","WebStyle:fe","ElementNodeType:ff","Document:fg","EventListener:fh","IElementEventHandler:fi","ElementEventHandler:fj","ElementAttribute:fk","JQueryPosition:fl","JQueryCallback:fm","JQueryEvent:fn","JQueryUICallback:fo","FaultCode:fr","FaultException:fs","FaultReason:ft","FaultException$1:fu","TaskFactory:f4","Tuple$2:f5","JavaScriptSerializer:f8","XObject:h6","XmlNode:h7","XmlNodeList:h8","XmlNamedNodeMap:h9","XmlNodeType:ia","XmlDocument:ib","XmlElement:ic","XmlLinkedNode:id","XmlAttribute:ie","XmlUtils:ig","XAttribute:ih","XNode:ii","XContainer:ij","XElement:ik","XName:il","XNamespace:im","XDocument:io"]);var $a=$.ig.intDivide,$b=$.ig.util.cast,$c=$.ig.util.defType,$d=$.ig.util.getBoxIfEnum,$e=$.ig.util.getDefaultValue,$f=$.ig.util.getEnumValue,$g=$.ig.util.getValue,$h=$.ig.util.intSToU,$i=$.ig.util.nullableEquals,$j=$.ig.util.nullableIsNull,$k=$.ig.util.nullableNotEquals,$l=$.ig.util.toNullable,$m=$.ig.util.toString$1,$n=$.ig.util.u32BitwiseAnd,$o=$.ig.util.u32BitwiseOr,$p=$.ig.util.u32BitwiseXor,$q=$.ig.util.u32LS,$r=$.ig.util.unwrapNullable,$s=$.ig.util.wrapNullable,$t=String.fromCharCode,$u=$.ig.util.castObjTo$t,$v=$.ig.util.compareSimple,$w=$.ig.util.tryParseNumber,$x=$.ig.util.tryParseNumber1,$y=$.ig.util.numberToString,$z=$.ig.util.numberToString1,$0=$.ig.util.parseNumber,$1=$.ig.util.tryParseInt32_1,$2=$.ig.util.tryParseInt32_2,$3=$.ig.util.intToString1,$4=$.ig.util.parseInt32_1,$5=$.ig.util.parseInt32_2,$6=$.ig.util.compare,$7=$.ig.util.replace,$8=$.ig.util.stringFormat,$9=$.ig.util.stringFormat1,$aa=$.ig.util.stringFormat2,$ab=$.ig.util.stringCompare1,$ac=$.ig.util.stringCompare2,$ad=$.ig.util.stringCompare3,$ae=$.ig.util.isDigit,$af=$.ig.util.isDigit1,$ag=$.ig.util.isLetter,$ah=$.ig.util.isNumber,$ai=$.ig.util.isLetterOrDigit,$aj=$.ig.util.isLower,$ak=$.ig.util.toLowerCase,$al=$.ig.util.toUpperCase;$c("UriKind:ex","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"RelativeOrAbsolute";case 1:return"Absolute";case 2:return"Relative";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("UriKind",$.ig.$ep.$type)},true);$c("TaskStatus:e6","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"Created";case 5:return"RanToCompletion";case 6:return"Canceled";case 7:return"Faulted";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("TaskStatus",$.ig.$ep.$type)},true);$c("ListSortDirection:d1","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"Ascending";case 1:return"Descending";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("ListSortDirection",$.ig.$ep.$type)},true);$c("NotifyCollectionChangedAction:cp","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"Add";case 1:return"Remove";case 2:return"Replace";case 4:return"Reset";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("NotifyCollectionChangedAction",$.ig.$ep.$type)},true);$c("AbstractEnumerable:a","Object",{a:null,init:function(a){$.ig.$op.init.call(this);this.a=a},getEnumerator:function(){return new $$t.bb(this.a().getEnumerator())},$type:new $.ig.Type("AbstractEnumerable",$.ig.$ot,[$.ig.IEnumerable.prototype.$type])},true);$c("AbstractEnumerator:bb","Object",{a:null,init:function(a){$.ig.$op.init.call(this);this.a=a},current:function(){return this.a.current()},moveNext:function(){return this.a.moveNext()},reset:function(){this.a.reset()},$type:new $.ig.Type("AbstractEnumerator",$.ig.$ot,[$.ig.IEnumerator.prototype.$type])},true);$c("IArray:bg","Object",{$type:new $.ig.Type("IArray",null)},true);$c("List$1:bh","Object",{$t:null,__inner:null,c:false,init:function($t,a){this.$t=$t;this.$type=this.$type.specialize(this.$t);if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}this.l={};$.ig.$op.init.call(this);this.__inner=[];this.c=this.$t.InstanceConstructor&&this.$t.InstanceConstructor.prototype.equals===$.ig.Object.prototype.equals},init1:function($t,a,b){this.$t=$t;this.$type=this.$type.specialize(this.$t);$$t.$bh.init.call(this,this.$t,0);if(this.d(0,b)){return}var d=b.getEnumerator();while(d.moveNext()){var c=d.current();this.add(c)}},init2:function($t,a,b){this.$t=$t;this.$type=this.$type.specialize(this.$t);$$t.$bh.init.call(this,this.$t,0)},w:function(a,b){this.__inner[a]=b},q:function(a,b){this.__inner.splice(a,0,b)},m:function(a){this.__inner.push(a)},t:function(a){this.__inner.splice(a,1)},o:function(){this.__inner=[]},item:function(a,b){if(arguments.length===2){this.w(a,b);return b}else{return this.__inner[a]}},indexOf:function(a){if(this.c){return this.__inner.indexOf(a)}for(var b=0;b<this.__inner.length;b++){if($.ig.$op.equalsStatic($d(this.$t,a),$d(this.$t,this.__inner[b]))){return b}}return-1},indexOf2:function(a,b){if(this.c){return this.__inner.indexOf(a,b)}for(;b<this.__inner.length;b++){if($.ig.$op.equalsStatic($d(this.$t,a),$d(this.$t,this.__inner[b]))){return b}}return-1},lastIndexOf:function(a){if(this.c){return this.__inner.lastIndexOf(a)}for(var b=this.__inner.length-1;b>=0;b--){if($.ig.$op.equalsStatic($d(this.$t,a),$d(this.$t,this.__inner[b]))){return b}}return-1},insert:function(a,b){this.q(a,b)},removeAt:function(a){this.t(a)},count:function(){return this.__inner.length},isReadOnly:function(){return false},add:function(a){this.m(a)},clear:function(){this.o()},contains:function(a){return this.indexOf(a)>=0},copyTo:function(a,b){for(var c=0;c<this.__inner.length;c++){a[b+c]=this.__inner[c]}},remove:function(a){var b=this.indexOf(a);if(b<0){return false}this.t(b);return true},getEnumerator:function(){return this.__inner.getEnumerator()},getEnumerator:function(){return this.__inner.getEnumerator()},asArray:function(){return this.__inner},d:function(index_,collection_){var a=$b($$t.$bl.$type,collection_);if(a!=null){var a_=a.asArrayList();Array.prototype.splice.apply(this.__inner,Array.prototype.concat.apply([index_,0],a_));return true}var b=$b($$t.$bg.$type,collection_);if(b!=null){var a_=b.asArray();Array.prototype.splice.apply(this.__inner,Array.prototype.concat.apply([index_,0],a_));return true}var asList_=$b($$t.$bi.$type.specialize(this.$t),collection_);if(asList_!=null){for(var i_=0;i_<asList_.count();i_++){var item_=asList_.item(i_);this.__inner.splice(index_+i_,0,item_)}return true}var arr_=$.isArray(collection_)?collection_:null;if(arr_!=null){var inn_=this.__inner;if(this.__inner.length==0){for(var i_=0;i_<arr_.length;i_++){inn_[index_++]=$u(this.$t,arr_[i_])}}else{for(var i_=0;i_<arr_.length;i_++){inn_.splice(index_++,0,arr_[i_])}}return true}return false},insertRange1:function(a,b){if(this.d(a,b)){return}var j_=a;var c=b.getEnumerator();while(c.moveNext()){var item_=c.current();this.__inner.splice(j_,0,item_);j_++}},insertRange:function(a,b){if(this.d(a,b)){return}var j_=a;var c=b.getEnumerator();while(c.moveNext()){var item_=c.current();this.__inner.splice(j_,0,item_);j_++}},removeRange:function(index_,numToRemove_){this.__inner.splice(index_,numToRemove_)},copyTo1:function(a,b){$.ig.util.arrayCopyTo(this.__inner,a,b)},isFixedSize:function(){return false},add1:function(a){this.m($u(this.$t,a));return this.__inner.length-1},contains1:function(a){return this.indexOf1(a)>=0},indexOf1:function(a){return this.indexOf($u(this.$t,a))},insert1:function(a,b){this.q(a,$u(this.$t,b))},remove1:function(a){var b=this.indexOf1(a);if(b<0){return}this.t(b)},sort:function(){var a=null;if(this.$t==Number){a=function(b,c){var d=b;var e=c;if(d<e){return-1}if(d==e){return 0}return 1}}else if(this.$t==$.ig.Number.prototype.$type){a=function(b,c){var d=b;var e=c;if(d<e){return-1}if(d==e){return 0}return 1}}else if(this.$t==$.ig.Number.prototype.$type){a=function(b,c){var d=$g(b);var e=$g(c);if(d<e){return-1}if(d==e){return 0}return 1}}else if(this.$t==$$t.$af.$type){a=function(b,c){var d=b;var e=c;if(d.getTime()<e.getTime()){return-1}if(d.getTime()==e.getTime()){return 0}return 1}}else{a=function(b,c){return b.compareTo(c)}}this.aa(a)},aa:function(compare_){this.__inner.sort(compare_)},sort2:function(compare_){this.__inner.sort(compare_)},_capacity:0,capacity:function(a){if(arguments.length===1){this._capacity=a;return a}else{return this._capacity}},addRange:function(a){var b=a.getEnumerator();while(b.moveNext()){var item_=b.current();this.__inner.push(item_)}},toArray:function(){return this.__inner},forEach:function(a){for(var b=0;b<this.__inner.length;b++){a(this.__inner[b])}},isSynchronized:function(){return true},l:null,syncRoot:function(){return this.l},binarySearch:function(a){return this.binarySearch1(a,$$t.$bq.defaultComparerValue(this.$t))},binarySearch1:function(a,b){var c=0;var d=this.count()-1;while(c<=d){var e=c+$a(d-c,2);var f=this.__inner[e];var g=b.compare(f,a);if(g==0){return e}if(g<0){c=e+1}else{d=e-1}}return~c},asReadOnly:function(){return new $$t.bw(this.$t,1,this)},reverse:function(){for(var a=0;a<$a(this.count(),2);a++){var b=this.count()-a-1;var c=this.__inner[a];this.__inner[a]=this.__inner[b];this.__inner[b]=c}},sort1:function(a){this.sort2(a.compare.runOn(a))},removeAll:function(a){throw new $$t.by(0);return 0},$type:new $.ig.Type("List$1",$.ig.$ot,[$$t.$bi.$type.specialize(0),$$t.$bg.$type,$.ig.IList.prototype.$type])},true);$c("IComparer:br","Object",{$type:new $.ig.Type("IComparer",null)},true);$c("IComparer$1:bs","Object",{$type:new $.ig.Type("IComparer$1",null)},true);$c("Comparer$1:bq","Object",{$t:null,init:function($t){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this)},defaultComparerValue:function($t){return new $$t.bt($t)},compare:function(a,b){},a:function($t,a){return null},$type:new $.ig.Type("Comparer$1",$.ig.$ot,[$$t.$br.$type,$$t.$bs.$type.specialize(0)])},true);$c("DefaultComparer$1:bt","Comparer$1",{$t:null,init:function($t){this.$t=$t;this.$type=this.$type.specialize(this.$t);$$t.$bq.init.call(this,this.$t)},compare:function(a,b){var c=$b($$t.$bu.$type.specialize(this.$t),a);if(c!=null){return c.compareTo(b)}var d=$b($$t.$bu.$type.specialize(this.$t),b);if(d!=null){return-d.compareTo(a)}return $.ig.util.compare(a,b)},$type:new $.ig.Type("DefaultComparer$1",$$t.$bq.$type.specialize(0))},true);$c("KeyValuePair$2:b4","ValueType",{$tKey:null,$tValue:null,init:function($tKey,$tValue,a){this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$.ig.ValueType.prototype.init.call(this)},a:null,c:null,init1:function($tKey,$tValue,a,b,c){this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$.ig.ValueType.prototype.init.call(this);this.a=b;this.c=c},key:function(){return this.a},value:function(){return this.c},$type:new $.ig.Type("KeyValuePair$2",$.ig.ValueType.prototype.$type)},true);$c("IDictionary$2:b0","Object",{$type:new $.ig.Type("IDictionary$2",null,[$$t.$bj.$type.specialize($$t.$b4.$type.specialize(this.$tKey,this.$tValue)),$$t.$an.$type.specialize($$t.$b4.$type.specialize(this.$tKey,this.$tValue)),$.ig.IEnumerable.prototype.$type])},true);$c("Dictionary$2:b1","Object",{$tKey:null,$tValue:null,g:null,h:0,e:false,d:false,c:false,a:null,b:null,init:function($tKey,$tValue,a){this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break;case 3:this.init3.apply(this,arguments);break;case 4:this.init4.apply(this,arguments);break}return}$$t.$b1.init4.call(this,this.$tKey,this.$tValue,4,0,null)},init1:function($tKey,$tValue,a,b){this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$$t.$b1.init4.call(this,this.$tKey,this.$tValue,4,b,null)},init2:function($tKey,$tValue,a,b){this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$$t.$b1.init4.call(this,this.$tKey,this.$tValue,4,0,b)},init3:function($tKey,$tValue,a,b){this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$$t.$b1.init1.call(this,this.$tKey,this.$tValue,1,b.count());var d=b.getEnumerator();while(d.moveNext()){var c=d.current();this.item(c.key(),c.value())}},init4:function($tKey,$tValue,a,b,c){this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$.ig.$op.init.call(this);this.a={};this.b={};this.g=c||$$t.$cd.defaultEqualityComparerValue(this.$tKey);this.e=c==null&&($tKey===$.ig.String.prototype.$type||$tKey===String);this.d=$tKey===$.ig.Object.prototype.$type||$tKey.InstanceConstructor&&!$tKey.InstanceConstructor.prototype.getHashCode;this.c=c==null&&(this.e||this.d||$tKey.InstanceConstructor&&$tKey.InstanceConstructor.prototype.getHashCode==$.ig.Object.prototype.getHashCode)},count:function(){return this.h},item:function(key_,a){if(arguments.length===2){this.l(key_,a,false);return a}else{var $self=this;var a;if(function(){var b=$self.tryGetValue(key_,a);a=b.p1;return b.ret}()){return a}return $e(this.$tValue)}},length:function(){return this.h},containsKey:function(a){if(this.c){var b=this.k(a);return this.a.hasOwnProperty(b)}else{var c=this.i(a);var d=this.b[c];if(d){if(d.$isHashSetBucket){var g=d;for(var f=0;f<g.length;f++){var e=g[f];return this.g.equalsC(e.key,a)}}else{return this.g.equalsC(d.key,a)}}}return false},remove:function(a){if(this.c){var b=this.k(a);if(!this.a.hasOwnProperty(b)){return false}delete this.a[b];delete this.b[b];this.h--;return true}var c=this.i(a);var d=this.b[c];if(d){if(d.$isHashSetBucket){var g=d;for(var f=0;f<g.length;f++){var e=g[f];if(this.g.equalsC(e.key,a)){d.removeItem(e);if(d.length==1){this.b[c]=d[0]}this.h--;return true}}}else{if(this.g.equalsC(d.key,a)){delete this.b[c];this.h--;return true}}}return false},clear:function(){this.h=0;this.a={};this.b={}},k:function(a){if(this.d){$.ig.util.ensureUniqueId(a)}if(this.e){return $m(this.$tKey,a)}else{return a.getHashCode().toString()}},i:function(a){if(this.d){$.ig.util.ensureUniqueId(a)}else{if(!a.getHashCode){this.d=true;$.ig.util.ensureUniqueId(a)}}return this.g.getHashCodeC(a)},add:function(a,b){this.l(a,b,true)},l:function(a,b,c){if(this.c){var d=this.k(a);if(!this.a.hasOwnProperty(d)){this.h++}else if(c){throw new $$t.be(1,"Duplicate key added to the dictionary")}this.a[d]=a;this.b[d]=b}else{var e=this.i(a);var f=this.b[e];if(f){if(f.$isHashSetBucket){var i=f;for(var h=0;h<i.length;h++){var g=i[h];if(this.g.equalsC(g.key,a)){if(c){throw new $$t.be(1,"Duplicate key added to the dictionary")}g.value=b;return}}f.push({key:a,value:b});this.h++}else{if(this.g.equalsC(f.key,a)){if(c){throw new $$t.be(1,"Duplicate key added to the dictionary")}f.value=b}else{var j=[f,{key:a,value:b}];j.$isHashSetBucket=true;this.b[e]=j;this.h++}}}else{this.b[e]={key:a,value:b};this.h++}}},tryGetValue:function(a,b){if(this.c){var c=this.k(a);if(this.a.hasOwnProperty(c)){b=this.b[c];return{ret:true,p1:b}}}else{var d=this.i(a);var e=this.b[d];if(e){if(e.$isHashSetBucket){var h=e;for(var g=0;g<h.length;g++){var f=h[g];if(this.g.equalsC(f.key,a)){b=f.value;return{ret:true,p1:b}}}}else{if(this.g.equalsC(e.key,a)){b=e.value;return{ret:true,p1:b}}}}}b=$e(this.$tValue);return{ret:false,p1:b}},isReadOnly:function(){return false},add1:function(a){this.add(a.key(),a.value())},contains:function(a){var $self=this;var b;return function(){var c=$self.tryGetValue(a.key(),b);b=c.p1;return c.ret}()&&$.ig.$op.equalsStatic($d(this.$tValue,b),$d(this.$tValue,a.value()))},copyTo:function(a,b){throw new $$t.by(0)},remove1:function(a){this.remove(a.key());return true},getEnumerator:function(){return this.f().getEnumerator()},f:function(){var d__=new $.ig.Dictionary___ToEnumerable__IteratorClass$2(this.$tKey,this.$tValue,-2);d__.__4__this=this;return d__},getEnumerator:function(){return this.f().getEnumerator()},keys:function(){return new $$t.cg(this.$tKey,this.$tValue,this.$tKey,this,$$t.$b5.n($$t.$b4.$type.specialize(this.$tKey,this.$tValue),this.$tKey,this.f(),function(a){return a.key()}),this.g||$$t.$cd.defaultEqualityComparerValue(this.$tKey))},values:function(){return new $$t.cg(this.$tKey,this.$tValue,this.$tValue,this,$$t.$b5.n($$t.$b4.$type.specialize(this.$tKey,this.$tValue),this.$tValue,this.f(),function(a){return a.value()}),$$t.$cd.defaultEqualityComparerValue(this.$tValue))},$type:new $.ig.Type("Dictionary$2",$.ig.$ot,[$.ig.IDictionary$2.prototype.$type.specialize(0,1),$.ig.IDictionary.prototype.$type])},true);$c("Dictionary_EnumerableCollection$3:cg","Object",{$tKey:null,$tValue:null,$t:null,c:null,b:null,a:null,init:function($tKey,$tValue,$t,a,b,c){this.$tKey=$tKey;this.$tValue=$tValue;this.$t=$t;this.$type=this.$type.specialize(this.$tKey,this.$tValue,this.$t);$.ig.$op.init.call(this);this.c=b;this.b=c;this.a=a},count:function(){return this.a.count()},isReadOnly:function(){return true},add:function(a){throw new $$t.ch(0)},clear:function(){throw new $$t.ch(0)},contains:function(a){var c=this.c.getEnumerator();while(c.moveNext()){var b=c.current();if($.ig.$op.equalsStatic($d(this.$t,b),$d(this.$t,a))){return true}}return false},copyTo:function(a,b){var d=this.c.getEnumerator();while(d.moveNext()){var c=d.current();a[b++]=c}},remove:function(a){throw new $$t.ch(0)},getEnumerator:function(){return this.c.getEnumerator()},getEnumerator1:function(){return this.c.getEnumerator()},$type:new $.ig.Type("Dictionary_EnumerableCollection$3",$.ig.$ot,[$$t.$bj.$type.specialize(0)])},true);$c("EqualityComparer$1:cd","Object",{$t:null,init:function($t){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this)},defaultEqualityComparerValue:function($t){return new $$t.cf($t)},equalsC:function(a,b){},getHashCodeC:function(a){},equalsC:function(a,b){return this.equalsC($u(this.$t,a),$u(this.$t,b))},getHashCodeC:function(a){return this.getHashCodeC($u(this.$t,a))},$type:new $.ig.Type("EqualityComparer$1",$.ig.$ot,[$$t.$ce.$type,$$t.$cc.$type.specialize(0)])},true);$c("DefaultEqualityComparer$1:cf","EqualityComparer$1",{$t:null,init:function($t){this.$t=$t;this.$type=this.$type.specialize(this.$t);$$t.$cd.init.call(this,this.$t)},equalsC:function(a,b){return $.ig.$op.equalsStatic($d(this.$t,a),$d(this.$t,b))},getHashCodeC:function(a){return a.getHashCode()},$type:new $.ig.Type("DefaultEqualityComparer$1",$$t.$cd.$type.specialize(0))},true);$c("GenericEnumerable$1:ci","Object",{$t:null,a:null,init:function($t,a){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this);this.a=a},getEnumerator:function(){return new $$t.cj(this.$t,this.a().getEnumerator())},getEnumerator:function(){return new $$t.cj(this.$t,this.a().getEnumerator())},$type:new $.ig.Type("GenericEnumerable$1",$.ig.$ot,[$$t.$an.$type.specialize(0)])},true);$c("GenericEnumerator$1:cj","Object",{$t:null,a:null,init:function($t,a){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this);this.a=a},current:function(){return this.a.current()},moveNext:function(){return this.a.moveNext()},reset:function(){this.a.reset()},dispose:function(){},$type:new $.ig.Type("GenericEnumerator$1",$.ig.$ot,[$$t.$ao.$type.specialize(0)])},true);$c("INotifyCollectionChanged:cl","Object",{$type:new $.ig.Type("INotifyCollectionChanged",null)},true);$c("NotifyCollectionChangedEventArgs:cn","EventArgs",{init:function(a,b){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$$t.$co.init.call(this);this.f=b;this.c=new $$t.bh($.ig.$op.$type,0);this.b=new $$t.bh($.ig.$op.$type,0)},init1:function(a,b,c,d){$$t.$co.init.call(this);this.f=b;this.c=new $$t.bh($.ig.$op.$type,0);if(this.f==1||this.f==2){this.c.add(c);this.i=d}if(this.f!=1){this.b=function(){var $ret=new $$t.bh($.ig.$op.$type,0);$ret.add1(c);return $ret}()}else{this.b=new $$t.bh($.ig.$op.$type,0)}this.h=d},init2:function(a,b,c,d,e){$$t.$co.init.call(this);this.f=b;this.h=e;this.i=e;this.b=function(){var $ret=new $$t.bh($.ig.$op.$type,0);$ret.add1(c);return $ret}();this.c=function(){var $ret=new $$t.bh($.ig.$op.$type,0);$ret.add1(d);return $ret}()},f:0,action:function(){return this.f},b:null,newItems:function(){return this.b},h:0,newStartingIndex:function(){return this.h},c:null,oldItems:function(){return this.c},i:0,oldStartingIndex:function(){return this.i},$type:new $.ig.Type("NotifyCollectionChangedEventArgs",$$t.$co.$type)},true);$c("ObservableCollection$1:cs","List$1",{$t:null,init:function($t,a){this.$t=$t;this.$type=this.$type.specialize(this.$t);if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$$t.$bh.init.call(this,this.$t,0)},init1:function($t,a,b){this.$t=$t;this.$type=this.$type.specialize(this.$t);$$t.$bh.init1.call(this,this.$t,1,b)},init2:function($t,a,b){this.$t=$t;this.$type=this.$type.specialize(this.$t);$$t.$bh.init2.call(this,this.$t,2,b)},w:function(a,b){var c=this.__inner[a];$$t.$bh.w.call(this,a,b);if(this.propertyChanged!=null){this.ac(new $$t.cv("Item[]"))}if(this.collectionChanged!=null){var d=new $$t.cn(2,2,$d(this.$t,b),$d(this.$t,c),a);this.ab(d)}},o:function(){$$t.$bh.o.call(this);if(this.propertyChanged!=null){this.ac(new $$t.cv("Count"));this.ac(new $$t.cv("Item[]"))}if(this.collectionChanged!=null){var a=new $$t.cn(0,4);this.ab(a)}},q:function(a,b){$$t.$bh.q.call(this,a,b);if(this.propertyChanged!=null){this.ac(new $$t.cv("Count"));this.ac(new $$t.cv("Item[]"))}if(this.collectionChanged!=null){var c=new $$t.cn(1,0,$d(this.$t,b),a);this.ab(c)}},m:function(a){$$t.$bh.m.call(this,a);if(this.propertyChanged!=null){this.ac(new $$t.cv("Count"));this.ac(new $$t.cv("Item[]"))}if(this.collectionChanged!=null){var b=new $$t.cn(1,0,$d(this.$t,a),this.count()-1);this.ab(b)}},t:function(a){var b=this.__inner[a];$$t.$bh.t.call(this,a);if(this.propertyChanged!=null){this.ac(new $$t.cv("Count"));this.ac(new $$t.cv("Item[]"))}if(this.collectionChanged!=null){var c=new $$t.cn(1,1,$d(this.$t,b),a);this.ab(c)}},collectionChanged:null,propertyChanged:null,ac:function(a){if(this.propertyChanged!=null){this.propertyChanged(this,a)}},ab:function(a){if(this.collectionChanged!=null){this.collectionChanged(this,a)}},$type:new $.ig.Type("ObservableCollection$1",$$t.$bh.$type.specialize(0),[$$t.$cl.$type,$$t.$ct.$type])},true);$c("ReadOnlyCollection$1:bw","Object",{$t:null,init:function($t,a){this.$t=$t;this.$type=this.$type.specialize(this.$t);if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}this.c={};$.ig.$op.init.call(this)},init1:function($t,a,b){this.$t=$t;this.$type=this.$type.specialize(this.$t);this.c={};$.ig.$op.init.call(this);this.a=b},a:null,item:function(a,b){if(arguments.length===2){this.a.item(a,b);return b}else{return this.a.item(a)}},indexOf:function(a){return this.a.indexOf(a)},insert:function(a,b){},removeAt:function(a){},count:function(){return this.a.count()},isReadOnly:function(){return true},add:function(a){},clear:function(){},contains:function(a){return this.a.contains(a)},copyTo:function(a,b){this.a.copyTo(a,b)},remove:function(a){return false},getEnumerator:function(){return this.a.getEnumerator()},getEnumerator:function(){return this.a.getEnumerator()},isFixedSize:function(){return true},add1:function(a){return-1},contains1:function(a){return this.a.contains($u(this.$t,a))},indexOf1:function(a){return this.a.indexOf($u(this.$t,a))},insert1:function(a,b){},remove1:function(a){},copyTo1:function(a,b){this.a.copyTo(a,b)},b:function(){return this.a},isSynchronized:function(){return true},c:null,syncRoot:function(){return this.c},$type:new $.ig.Type("ReadOnlyCollection$1",$.ig.$ot,[$$t.$bi.$type.specialize(0),$.ig.IList.prototype.$type])},true);$c("NameValueCollection:c0","Object",{a:null,init:function(){$.ig.$op.init.call(this);this.a=new $$t.b1(String,String,0)},item:function(a,b){if(arguments.length===2){if(this.a.containsKey(a)){this.a.item(a,b)}else{this.a.add(a,b)}return b}else{if(this.a.containsKey(a)){return this.a.item(a)}else{return null}}},$type:new $.ig.Type("NameValueCollection",$.ig.$ot)},true);$c("Stack$1:c1","Object",{$t:null,init:function($t){this.$t=$t;this.$type=this.$type.specialize(this.$t);this.b=new $.ig.Array;$.ig.$op.init.call(this)},b:null,push:function(a){this.b.add($d(this.$t,a))},peek:function(){if(this.b.length<1){return $e(this.$t)}return $u(this.$t,this.b[this.b.length-1])},pop:function(){var a=this.b[this.b.length-1];this.b.removeAt(this.b.length-1);return $u(this.$t,a)},count:function(){return this.b.length},clear:function(){this.b.clear()},contains:function(a){return this.b.contains($d(this.$t,a))},getEnumerator:function(){return new $$t.c2(this.$t,this.b)},getEnumerator:function(){return new $$t.c2(this.$t,this.b)},$type:new $.ig.Type("Stack$1",$.ig.$ot,[$$t.$an.$type.specialize(0)])},true);$c("ReverseArrayEnumerator$1:c2","Object",{$t:null,b:0,a:null,init:function($t,a){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this);this.a=a;this.b=a.length},current:function(){return $u(this.$t,this.a[this.b])},current:function(){return this.a[this.b]},moveNext:function(){this.b--;return this.b>=0},reset:function(){this.b=this.a.length},dispose:function(){throw new $$t.by(0)},$type:new $.ig.Type("ReverseArrayEnumerator$1",$.ig.$ot,[$$t.$ao.$type.specialize(0)])},true);$c("IOrderedEnumerable$1:b8","Object",{$type:new $.ig.Type("IOrderedEnumerable$1",null,[$$t.$an.$type.specialize(0),$.ig.IEnumerable.prototype.$type])},true);$c("Enumerable:b5","Object",{init:function(){$.ig.$op.init.call(this)},t:function($tSource,a,b){var d__=new $.ig.Enumerable___Where__IteratorClass$1($tSource,-2);d__.__3__source=a;d__.__3__predicate=b;return d__},u:function($tSource,a,b){var d__=new $.ig.Enumerable___Where__IteratorClass1$1($tSource,-2);d__.__3__source=a;d__.__3__predicate=b;return d__},n:function($tSource,$tResult,a,b){var d__=new $.ig.Enumerable___Select__IteratorClass$2($tSource,$tResult,-2);d__.__3__source=a;d__.__3__selector=b;return d__},o:function($tSource,$tResult,a,b){var d__=new $.ig.Enumerable___SelectMany__IteratorClass$2($tSource,$tResult,-2);d__.__3__source=a;d__.__3__selector=b;return d__},k:function($tResult,a){var d__=new $.ig.Enumerable___OfType__IteratorClass$1($tResult,-2);d__.__3__source=a;return d__},ag:function($tSource,a){var b=$b($$t.$bi.$type.specialize($tSource),a);if(b!=null){return b.item(b.count()-1)}var c=$e($tSource);var e=a.getEnumerator();while(e.moveNext()){var d=e.current();c=d}return c},ac:function($tSource,a){var c=a.getEnumerator();while(c.moveNext()){var b=c.current();return b}return $e($tSource)},ad:function($tSource,a,b){var d=a.getEnumerator();while(d.moveNext()){var c=d.current();if(b(c)){return c}}return $e($tSource)},ae:function($tSource,a){var c=a.getEnumerator();while(c.moveNext()){var b=c.current();return b}return $e($tSource)},w:function($tSource,$tKey,a,b){var c=new $$t.b9($tSource,a);c.sort2(function(d,e){var f=d;var g=e;var h=b(f);var i=b(g);if($b($$t.$k.$type,h)!==null){return $b($$t.$k.$type,h).compareTo($d($tKey,i))}else{return $m($tKey,h).compareTo($m($tKey,i))}});return c},x:function($tSource,$tKey,a,b){var c=new $$t.b9($tSource,a);c.sort2(function(d,e){var f=e;var g=d;var h=b(f);var i=b(g);if($b($$t.$k.$type,h)!==null){return $b($$t.$k.$type,h).compareTo($d($tKey,i))}else{return $m($tKey,h).compareTo($m($tKey,i))}});return c},y:function($tSource,a){var b=new $$t.bh($tSource,1,a);return b},l:function(a,b){var d__=new $.ig.Enumerable___Range__IteratorClass(-2);d__.__3__startValue=a;d__.__3__count=b;return d__},h:function($tSource,a,b){var d__=new $.ig.Enumerable___Concat__IteratorClass$1($tSource,-2);d__.__3__source1=a;d__.__3__source2=b;return d__},aj:function(a){var b=true;var c=0;var e=a.getEnumerator();while(e.moveNext()){var d=e.current();if(b){b=false;c=d}else{c=Math.max(c,d)}}return c},ak:function($tSource,a,b){return $$t.$b5.aj($$t.$b5.n($tSource,$.ig.Number.prototype.$type,a,b))},al:function(a){var b=true;var c=0;var e=a.getEnumerator();while(e.moveNext()){var d=e.current();if(b){b=false;c=d}else{c=Math.min(c,d)}}return c},am:function($tSource,a,b){return $$t.$b5.aj($$t.$b5.n($tSource,$.ig.Number.prototype.$type,a,b))},ai:function($tSource,a){var b=0;var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b++}return b},m:function($tSource,a){var d__=new $.ig.Enumerable___Reverse__IteratorClass$1($tSource,-2);d__.__3__source=a;return d__},g:function($tResult,a){if(a==null){throw new $$t.cb(0,"source")}var b=$b($$t.$an.$type.specialize($tResult),a);if(b!=null){return b}var c=new $$t.bh($tResult,0);var e=a.getEnumerator();while(e.moveNext()){var d=e.current();if($b($tResult,d)!==null){c.add($u($tResult,d))}else{c.add($e($tResult))}}return c},r:function($tSource,a,b){var d__=new $.ig.Enumerable___Take__IteratorClass$1($tSource,-2);d__.__3__source=a;d__.__3__toTake=b;return d__},q:function($tSource,a,b){var d__=new $.ig.Enumerable___Skip__IteratorClass$1($tSource,-2);d__.__3__source=a;d__.__3__toSkip=b;return d__},c:function($tSource,a){var c=a.getEnumerator();while(c.moveNext()){var b=c.current();return true}return false},e:function($tSource,a,value_){var b=a.getEnumerator();
while(b.moveNext()){var item_=b.current();if(item_===value_){return true}}return false},s:function($tSource,a,b){return null},a:function($tSource,a){var b=$b($$t.$bh.$type.specialize($tSource),a);if(b!=null){return b.toArray()}b=new $$t.bh($tSource,1,a);return b.asArray()},ab:function($tSource,a,b){var c=$b($$t.$bi.$type.specialize($tSource),a);if(c!=null){return c.item(b)}return $$t.$b5.ac($tSource,$$t.$b5.q($tSource,a,b))},z:function(a){var b=0;var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b+=c}return b},aa:function($tSource,a,b){return $$t.$b5.z($$t.$b5.n($tSource,Number,a,b))},f:function($tSource,a,b){if(a==null){throw new $$t.cb(0,"first")}if(b==null){throw new $$t.cb(0,"second")}{var c=a.getEnumerator();try{var d=b.getEnumerator();try{while(c.moveNext()){if(!d.moveNext()||!$.ig.$op.equalsStatic($d($tSource,c.current()),$d($tSource,d.current()))){return false}}return d.moveNext()==false}finally{if(d!=null){d.dispose()}}}finally{if(c!=null){c.dispose()}}}},j:function($tSource){return new $.ig.Enumerable___Empty__IteratorClass$1($tSource,-2)},p:function($tSource,$tCollection,$tResult,a,b,c){var d__=new $.ig.Enumerable___SelectMany__IteratorClass1$3($tSource,$tCollection,$tResult,-2);d__.__3__source=a;d__.__3__collectionSelector=b;d__.__3__resultSelector=c;return d__},d:function($tSource,a,b){var d=a.getEnumerator();while(d.moveNext()){var c=d.current();if(b(c)){return true}}return false},af:function($tSource,a,b){var d=a.getEnumerator();while(d.moveNext()){var c=d.current();if(b(c)){return c}}return $e($tSource)},b:function($tSource,a,b){var d=a.getEnumerator();while(d.moveNext()){var c=d.current();if(b(c)==false){return false}}return true},ah:function($tSource,a){throw new $$t.by(0);var b=$b($$t.$bi.$type.specialize($tSource),a);if(b!=null){return b.count()==0?$e($tSource):b.item(b.count()-1)}var c=$e($tSource);var e=a.getEnumerator();while(e.moveNext()){var d=e.current();c=d}return c},v:function($tFirst,$tSecond,$tResult,a,b,c){throw new $$t.by(0)},i:function($tSource,a){throw new $$t.by(0);return null},$type:new $.ig.Type("Enumerable",$.ig.$ot)},true);$c("SortedList$1:b9","List$1",{$tElement:null,init:function($tElement,a){this.$tElement=$tElement;this.$type=this.$type.specialize(this.$tElement);$$t.$bh.init1.call(this,this.$tElement,1,a)},getEnumerator:function(){return $$t.$bh.getEnumerator.call(this)},$type:new $.ig.Type("SortedList$1",$$t.$bh.$type.specialize(0),[$$t.$b8.$type.specialize(0)])},true);$c("IArrayList:bl","Object",{$type:new $.ig.Type("IArrayList",null)},true);$c("AggregateException:dq","Error",{init:function(a){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$$t.$x.init.call(this,0)},init1:function(a,b){$$t.$x.init1.call(this,1,b)},init2:function(a,b,c){$$t.$x.init2.call(this,2,b,c)},$type:new $.ig.Type("AggregateException",$$t.$x.$type)},true);$c("APIFactory:dr","Object",{init:function(){$.ig.$op.init.call(this)},createPoint:function(a,b){return{__x:a,__y:b,$type:$.ig.Point.prototype.$type,getType:$.ig.Object.prototype.getType,getGetHashCode:$.ig.Object.prototype.getGetHashCode,typeName:$.ig.Object.prototype.typeName}},createRect:function(a,b,c,d){return new $$t.dt(0,a,b,c,d)},createSize:function(a,b){return new $$t.du(1,a,b)},createColor:function(a){var b=new $$t.dv;b.colorString(a);return b},$type:new $.ig.Type("APIFactory",$.ig.$ot)},true);$c("ArgumentException:be","Error",{init:function(a){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break;case 3:this.init3.apply(this,arguments);break}return}$$t.$x.init.call(this,0)},init1:function(a,b){$$t.$x.init1.call(this,1,b)},init2:function(a,b,c){$$t.$x.init1.call(this,1,b)},init3:function(a,b,c){$$t.$x.init2.call(this,2,b,c)},$type:new $.ig.Type("ArgumentException",$$t.$x.$type)},true);$c("ArgumentNullException:cb","Error",{init:function(a,b){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$$t.$x.init1.call(this,1,b+" cannot be null.")},init1:function(a){$$t.$x.init.call(this,0);throw new $$t.by(0)},init2:function(a,b,c){$$t.$x.init1.call(this,1,c);throw new $$t.by(0)},$type:new $.ig.Type("ArgumentNullException",$$t.$x.$type)},true);$c("AsyncCompletedEventArgs:dz","EventArgs",{d:null,b:false,f:null,init:function(a,b,c){$$t.$co.init.call(this);this.b=b;this.d=a;this.f=c},error:function(){return this.d},cancelled:function(){return this.b},userState:function(){return this.f},h:function(){if(this.error()!=null){throw this.error()}},$type:new $.ig.Type("AsyncCompletedEventArgs",$$t.$co.$type)},true);$c("Environment:d3","Object",{init:function(){$.ig.$op.init.call(this)},newLine:function(){return"\n"},$type:new $.ig.Type("Environment",$.ig.$ot)},true);$c("IComparable$1:bu","Object",{$type:new $.ig.Type("IComparable$1",null)},true);$c("InvalidOperationException:ch","Error",{init:function(a){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$$t.$x.init1.call(this,1,"Invalid operation")},init1:function(a,b){$$t.$x.init1.call(this,1,b)},init2:function(a,b,c){$$t.$x.init2.call(this,2,b,c);throw new $$t.by(0)},$type:new $.ig.Type("InvalidOperationException",$$t.$x.$type)},true);$c("ICredentials:eu","Object",{$type:new $.ig.Type("ICredentials",null)},true);$c("NetworkCredential:ev","Object",{init:function(a,b,c){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$$t.$ev.init1.call(this,1,b,c,String.empty())},init1:function(a,b,c,d){$.ig.$op.init.call(this);this.c(b);this.b(c);this.a(d)},getCredential:function(a,b){return this},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},$type:new $.ig.Type("NetworkCredential",$.ig.$ot,[$$t.$eu.$type])},true);$c("UploadStringCompletedEventArgs:ez","AsyncCompletedEventArgs",{i:null,init:function(a,b,c,d){$$t.$dz.init.call(this,b,c,d);this.i=a},result:function(){this.h();return this.i},$type:new $.ig.Type("UploadStringCompletedEventArgs",$$t.$dz.$type)},true);$c("WebClient:e0","Object",{init:function(){$.ig.$op.init.call(this);this.c(new $$t.e1)},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},uploadStringCompleted:null,h:function(a,b,c,d){var $self=this;this.e(a,b,c).i(function(e){if($self.uploadStringCompleted!=null){var f=null;var g=null;try{f=e.m()}catch(e_){g=e_}$self.uploadStringCompleted($self,new $$t.ez(f,g,e.g()==6,d))}})},e:function(a,b,c){var url_=a.value();var method_=b;var data_=c;var contentType_=this.c().item("Content-Type");var credentials_=this.a();var d=$.ig.util.ajax(url_,contentType_,data_,method_,credentials_);return new $$t.e2(String,d,null)},g:function(a,b,c,d){a.e(b)},f:function(a,b,c,d){a.d(new $$t.x(1,d))},$type:new $.ig.Type("WebClient",$.ig.$ot)},true);$c("WebHeaderCollection:e1","NameValueCollection",{init:function(){$$t.$c0.init.call(this)},$type:new $.ig.Type("WebHeaderCollection",$$t.$c0.$type)},true);$c("FaultCode:fr","Object",{init:function(a){$.ig.$op.init.call(this);this.a(a)},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},$type:new $.ig.Type("FaultCode",$.ig.$ot)},true);$c("FaultException:fs","Error",{init:function(a,b,c){$$t.$x.init.call(this,0);this.reason(a);this.code(b);this.action(c)},_action:null,action:function(a){if(arguments.length===1){this._action=a;return a}else{return this._action}},_code:null,code:function(a){if(arguments.length===1){this._code=a;return a}else{return this._code}},_reason:null,reason:function(a){if(arguments.length===1){this._reason=a;return a}else{return this._reason}},$type:new $.ig.Type("FaultException",$$t.$x.$type)},true);$c("FaultException$1:fu","FaultException",{$tDetail:null,init:function($tDetail,a,b,c,d){this.$tDetail=$tDetail;this.$type=this.$type.specialize(this.$tDetail);$$t.$fs.init.call(this,b,c,d);this.detail(a)},_detail:null,detail:function(a){if(arguments.length===1){this._detail=a;return a}else{return this._detail}},$type:new $.ig.Type("FaultException$1",$$t.$fs.$type)},true);$c("FaultReason:ft","Object",{a:null,init:function(a){$.ig.$op.init.call(this);this.a=a},toString:function(){return this.a},$type:new $.ig.Type("FaultReason",$.ig.$ot)},true);$c("StringBuilder:et","Object",{_internal:null,internal:function(a){if(arguments.length===1){this._internal=a;return a}else{return this._internal}},init:function(a){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$.ig.$op.init.call(this);this.internal("")},init1:function(a,b){$$t.$et.init.call(this,0)},init2:function(a,b){$.ig.$op.init.call(this);this.internal(b)},j:function(a){if(a!=null){this.k(a.toString())}return this},k:function(str_){if(str_!=null){this._internal=this._internal.concat(str_)}return this},m:function(a){var str_=a.toString();this._internal=this._internal.concat(str_);return this},h:function(chr_){this._internal=this._internal.concat(chr_);return this},i:function(value_){this._internal=this._internal.concat(value_);return this},l:function(value_,startIndex_,count_){this._internal=this._internal.concat(value_.substr(startIndex_,count_));return this},g:function(value_,startIndex_,charCount_){this._internal=this._internal.concat(value_.slice(startIndex_,startIndex_+charCount_).join(""));return this},s:function(){return this.t("")},t:function(str_){if(str_!=null){this._internal=this._internal.concat(str_)}this._internal=this._internal.concat($.ig.Environment.prototype.newLine());return this},u:function(){this.internal("");return this},v:function(index_,chr_){if(index_==this.c()){this.h(chr_)}else{this._internal=this._internal.substring(0,index_).concat(chr_).concat(this._internal.substring(index_,this._internal.length))}return this},w:function(index_,str_){if(index_==this.c()){this.k(str_)}else{this._internal=this._internal.substring(0,index_).concat(str_).concat(this._internal.substring(index_,this._internal.length))}return this},x:function(startIndex_,length_){this._internal=this._internal.substring(0,startIndex_).concat(this._internal.substring(startIndex_+length_,this._internal.length));return this},toString:function(){return this.internal()},f:function(a,b){return this.internal().substr(a,b)},c:function(a){if(arguments.length===1){if(a<=this.c()){this._internal=this._internal.substring(0,a)}else{throw new $$t.by(0)}return a}else{return this.internal().length}},item:function(index_,a){if(arguments.length===2){this._internal=this._internal.substring(0,index_).concat(a).concat(this._internal.substring(index_+1,this._internal.length));return a}else{return this.internal().charAt(index_)}},p:function(a,b){return this.k($8(a,b))},o:function(a,b){return this.k($9(a,b))},n:function(a,b,c){return this.k($aa(a,b,c))},q:function(a,b,c){return this.k($8(a,b,c))},r:function(a,b,c,d){return this.k($8(a,b,c,d))},_b:0,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},$type:new $.ig.Type("StringBuilder",$.ig.$ot)},true);$c("NotImplementedException:by","Error",{init:function(a){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$$t.$x.init1.call(this,1,"not implemented")},init1:function(a,b){$$t.$x.init1.call(this,1,b);throw new $$t.by(0)},$type:new $.ig.Type("NotImplementedException",$$t.$x.$type)},true);$c("Encoding:eh","Object",{init:function(){$.ig.$op.init.call(this)},uTF8:function(){if($$t.$eh.t==null){$$t.$eh.t=new $$t.eg(1)}return $$t.$eh.t},uTF8Unmarked:function(){if($$t.$eh.s==null){$$t.$eh.s=new $$t.eg(1)}return $$t.$eh.s},unicode:function(){if($$t.$eh.r==null){$$t.$eh.r=new $$t.ei(0)}return $$t.$eh.r},getString1:function(a,b,c){return""},getBytes2:function(a,b,c,d,e){},getBytes:function(a,b,c){var d=new Array(this.getByteCount(a,b,c));this.getBytes2(a,b,c,d,0);return d},getBytes1:function(a){if(a==null){throw new $$t.cb(0,"input")}var b=new Array(a.length);for(var c=0;c<a.length;c++){b[c]=a.charAt(c)}return this.getBytes(b,0,b.length)},getByteCount:function(a,b,c){},getString:function(a){return this.getString1(a,0,a.length)},getCharCount:function(a){if(a==null){throw new $$t.cb(0,"bytes")}return this.getCharCount1(a,0,a.length)},getCharCount1:function(a,b,c){throw new $$t.by(0)},getChars:function(a,b,c,d,e){throw new $$t.by(0)},aSCII:function(){if($$t.$eh.p==null){$$t.$eh.p=new $$t.ej(1)}return $$t.$eh.p},getDecoder:function(){return new $$t.el(this)},getBytes3:function(a,b,c,d,e){return this.getBytes2($.ig.util.toCharArray(a),b,c,d,e)},getMaxCharCount:function(a){return a},getMaxByteCount:function(a){return a+1},getPreamble:function(){return new Array(0)},bigEndianUnicode:function(){if($$t.$eh.q==null){$$t.$eh.q=new $$t.ei(1,true,false)}return $$t.$eh.q},defaultValue:function(){return $$t.$eh.aSCII()},getEncoding:function(a){switch(a.toUpperCase()){case"ASCII":return $$t.$eh.aSCII();case"UNICODE":return $$t.$eh.unicode();case"UTF-8":return $$t.$eh.uTF8();default:throw new $$t.be(1,"'"+a+"' is not a valid encoding name.")}},webName:function(){throw new $$t.by(0);return null},$type:new $.ig.Type("Encoding",$.ig.$ot)},true);$c("UnicodeEncoding:ei","Encoding",{ab:false,getString1:function(bytes_,a,b){var c="";var d=a+b;for(var i_=a;i_<d;i_=i_+2){if(i_+1>=d){c=c+"�"}else{var e;var f;if(this.ab){e=bytes_[i_+1].toString(16);f=bytes_[i_].toString(16)}else{e=bytes_[i_].toString(16);f=bytes_[i_+1].toString(16)}if(e.length==1){e="0"+e}if(f.length==1){f="0"+f}var g=$.ig.Number.prototype.parseInt(f+e,16);c=c+String.fromCharCode(g)}}return c},getCharCount1:function(a,b,c){return $a(c,2)},getBytes:function(a,b,c){return $$t.$eh.getBytes.call(this,a,b,c)},getBytes1:function(a){var b=new Array(a.length*2);this.getBytes3(a,0,a.length,b,0);return b},init:function(a){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$$t.$eh.init.call(this)},init1:function(a,b,c){$$t.$eh.init.call(this);this.ab=b},getMaxByteCount:function(a){return(a+1)*2},getMaxCharCount:function(a){return $.ig.truncate(Math.ceil(a/2))+1},getBytes3:function(a,b,c,d,e){for(var f=b;f<b+c;f++){var g=a.charCodeAt(f);var h=g&255;var i=g>>8&255;if(this.ab){d[e++]=i;d[e++]=h}else{d[e++]=h;d[e++]=i}}return c*2},getByteCount:function(a,b,c){throw new $$t.by(0);return 0},getBytes2:function(a,b,c,d,e){throw new $$t.by(0);return 0},getChars:function(a,b,c,d,e){throw new $$t.by(0)},$type:new $.ig.Type("UnicodeEncoding",$$t.$eh.$type)},true);$c("UTF8Encoding:eg","Encoding",{init:function(a,b,c){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$$t.$eh.init.call(this)},init1:function(a){$$t.$eh.init.call(this)},getString1:function(a,b,c){var d="";var e=b;var f=0;var g=0;var h=0;while(e<b+c){f=a[e++];if(f<128){d+=$t(f)}else if(f>191&&f<224){if(e>=b+c){throw new $$t.ch(1,"UTF-8 decoding error.")}g=a[e++];d+=$t((f&31)<<6|g&63)}else{if(e+1>=b+c){throw new $$t.ch(1,"UTF-8 decoding error.")}g=a[e++];h=a[e++];d+=$t((f&15)<<12|(g&63)<<6|h&63)}}return d},getCharCount1:function(a,b,c){return c},getByteCount:function(a,b,c){throw new $$t.by(0);return 0},getBytes2:function(chars_,charIndex_,charCount_,a,b){var inputUTF8_=unescape(encodeURIComponent(chars_.slice(charIndex_,charIndex_+charCount_).join("")));for(var i_=0;i_<inputUTF8_.length;i_++){a[b+i_]=inputUTF8_.charCodeAt(i_)}return inputUTF8_.length},getBytes:function(a,b,c){return $$t.$eh.getBytes.call(this,a,b,c)},getBytes1:function(input_){var a=new Array(input_.length);var inputUTF8_=unescape(encodeURIComponent(input_));for(var i_=0;i_<inputUTF8_.length;i_++){a[i_]=inputUTF8_.charCodeAt(i_)}return a},getChars:function(a,b,c,d,e){var f=e;var g=b;var h=0;var i=0;var j=0;while(g<b+c){h=a[g++];if(h<128){d[e++]=$t(h)}else if(h>191&&h<224){if(g>=b+c){throw new $$t.ch(1,"UTF-8 decoding error.")}i=a[g++];d[e++]=$t((h&31)<<6|i&63)}else{if(g+1>=b+c){throw new $$t.ch(1,"UTF-8 decoding error.")}i=a[g++];j=a[g++];d[e++]=$t((h&15)<<12|(i&63)<<6|j&63)}}return e-f},getDecoder:function(){return new $$t.em(this)},getMaxByteCount:function(a){return(a+1)*3},getMaxCharCount:function(a){return a+1},$type:new $.ig.Type("UTF8Encoding",$$t.$eh.$type)},true);$c("Decoder:ek","Object",{init:function(){$.ig.$op.init.call(this)},e:function(a,b,c,d,e,f,g,h,i,j){throw new $$t.by(0);h=0;i=0;j=false;return{p7:h,p8:i,p9:j}},a:function(a,b,c){},b:function(a,b,c,d){throw new $$t.by(0);return 0},c:function(a,b,c,d,e){},d:function(a,b,c,d,e,f){throw new $$t.by(0);return 0},f:function(){throw new $$t.by(0)},$type:new $.ig.Type("Decoder",$.ig.$ot)},true);$c("UTF8Encoding_UTF8Decoder:em","Decoder",{g:0,h:0,i:0,j:null,init:function(a){$$t.$ek.init.call(this);this.j=a},a:function(a,b,c){return this.b(a,b,c,false)},b:function(a,b,c,d){var e=0;var f=b;while(f<b+c){if(this.g==0){this.g=a[f++]}if(this.g<128){e++}else{if(f>=b+c){break}if(this.h==0){this.h=a[f++]}if(this.g>191&&this.g<224){e++}else{if(f>=b+c){break}if(this.i==0){this.i=a[f++]}e++;this.i=0}this.h=0}this.g=0}if(d){this.g=0;this.h=0;this.i=0}return e},c:function(a,b,c,d,e){return this.d(a,b,c,d,e,false)},d:function(a,b,c,d,e,f){var g=e;var h=b;while(h<b+c){if(this.g==0){this.g=a[h++]}if(this.g<128){d[e++]=$t(this.g)}else{if(h>=b+c){break}if(this.h==0){this.h=a[h++]}if(this.g>191&&this.g<224){d[e++]=$t((this.g&31)<<6|this.h&63)}else{if(h>=b+c){break}if(this.i==0){this.i=a[h++]}d[e++]=$t((this.g&15)<<12|(this.h&63)<<6|this.i&63);this.i=0}this.h=0}this.g=0}if(f){this.g=0;this.h=0;this.i=0}return e-g},$type:new $.ig.Type("UTF8Encoding_UTF8Decoder",$$t.$ek.$type)},true);$c("AsciiEncoding:ej","Encoding",{init:function(a,b,c){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$$t.$eh.init.call(this)},init1:function(a){$$t.$eh.init.call(this)},getString1:function(bytes_,a,b){var ret_="";for(var i_=a;i_<a+b;i_++){if(bytes_[i_]==0){break}ret_=ret_+String.fromCharCode(bytes_[i_])}return ret_},getCharCount1:function(a,b,c){return c},getByteCount:function(a,b,c){return c},getBytes2:function(a,b,c,d,e){throw new $$t.by(0)},getBytes:function(a,b,c){return $$t.$eh.getBytes.call(this,a,b,c)},getBytes1:function(input_){var a=new Array(input_.length);for(var i_=0;i_<input_.length;i_++){a[i_]=input_.charCodeAt(i_)}return a},getChars:function(bytes_,byteIndex_,a,b,c){var d=c;var ret_="";for(var i_=0;i_<a;i_++){if(bytes_[i_]==0){break}b[c++]=String.fromCharCode(bytes_[byteIndex_++])}return c-d},$type:new $.ig.Type("AsciiEncoding",$$t.$eh.$type)},true);$c("DefaultDecoder:el","Decoder",{g:null,init:function(a){$$t.$ek.init.call(this);this.g=a},a:function(a,b,c){return this.b(a,b,c,false)},b:function(a,b,c,d){return this.g.getCharCount1(a,b,c)},c:function(a,b,c,d,e){return this.d(a,b,c,d,e,false)},d:function(a,b,c,d,e,f){return this.g.getChars(a,b,c,d,e)},$type:new $.ig.Type("DefaultDecoder",$$t.$ek.$type)},true);$c("Task:e3","Object",{_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_b:false,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},init:function(a,b){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$$t.$e3.init1.call(this,1,b,null)},init1:function(a,b,c){var $self=this;$.ig.$op.init.call(this);var d=function(){};var e=function(f){if(f==null){$self.b(true)}else{$self.a(new $$t.dq(2,"Exception occurred during task execution",f))}};this.c(b.done(d).fail(e));this.d(c)},g:function(){if(this.b()){return 6}switch(this.c().state()){case"pending":return 0;case"resolved":return 5;case"rejected":return 7;default:return 0}},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},e:function(a){var $self=this;var b=function(){a($self)};var c=function(d){a($self)};var d=this.c().done(b).fail(c);return new $$t.e3(0,d)},f:function($tNewResult,a){var $self=this;var b=new $$t.e7($tNewResult,0);var c=function(){try{var d=a($self);b.e(d)}catch(e_){b.d(e_)}};var d=function(e){c()};var e=function(f){c()};this.c().done(d).fail(e);return b.b()},$type:new $.ig.Type("Task",$.ig.$ot)},true);$c("Task$1:e2","Task",{$tResult:null,init:function($tResult,a,b){var $self=this;this.$tResult=$tResult;this.$type=this.$type.specialize(this.$tResult);this.h=false;$$t.$e3.init1.call(this,1,a,b);var c=function(d){var e=$u($self.$tResult,d);$self.l=e;$self.h=true};var d=function(e){$self.h=true};this.c().done(c).fail(d)},h:false,l:null,m:function(){if(!this.h){throw"Result is not ready yet"}if(this.a()!=null){throw this.a()}return this.l},i:function(a){return $$t.$e3.e.call(this,function(b){a(b)})},j:function($tNewResult,a){var b=function(c){return $d($tNewResult,a(c))};return this.k($.ig.$op.$type,b).k($tNewResult,function(c){return $u($tNewResult,c.m())})},k:function($tNewResult,a){return $$t.$e3.f.call(this,$tNewResult,a)},$type:new $.ig.Type("Task$1",$$t.$e3.$type)},true);$c("TaskCompletionSource$1:e7","Object",{$tResult:null,_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},init:function($tResult,a){this.$tResult=$tResult;this.$type=this.$type.specialize(this.$tResult);if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$$t.$e7.init1.call(this,this.$tResult,1,null)},init1:function($tResult,a,b){this.$tResult=$tResult;this.$type=this.$type.specialize(this.$tResult);$.ig.$op.init.call(this);this.a($.ig.util.deferred());this.b(new $$t.e2(this.$tResult,this.a().promise(),b))},c:function(){this.a().reject(null)},d:function(a){this.a().reject(a)},e:function(a){this.a().resolve($d(this.$tResult,a))},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},$type:new $.ig.Type("TaskCompletionSource$1",$.ig.$ot)},true);$c("TaskFactory:f4","Object",{init:function(){$.ig.$op.init.call(this)},c:function(a,b){return new $$t.e3(0,this.b(this.a(a)).always(function(){b(a)}))},d:function($tResult,a,b){var c=new $$t.e7($tResult,0);this.b(this.a(a)).always(function(){try{var d=b(a);c.e(d)}catch(e_){c.d(e_)}});return c.b()},e:function($tAntecedentResult,$tResult,a,b){var c=function(d){return $d($tResult,b(d))};return this.d($.ig.$op.$type,a,c).j($tResult,function(d){return $u($tResult,d.m())})},a:function(a){var b=new Array(a.length);for(var c=0;c<a.length;c++){b[c]=a[c].c()}return b},b:function(a){var promises_=a;var b=function(p){function whenAll(){var whenDeffered=$.ig.util.deferred();if(arguments.length===0){whenDeffered.resolve();return whenDeffered}var count=arguments.length;var resolve=true;for(var i=0;i<arguments.length;i++){arguments[i].done(function(){resolve=resolve&&true}).fail(function(){resolve=resolve&&false}).always(function(){count--;if(count<=0){if(resolve){whenDeffered.resolve()}else{whenDeffered.reject()}}})}return whenDeffered}return whenAll.apply($,p)}(promises_);return b},$type:new $.ig.Type("TaskFactory",$.ig.$ot)},true);$c("Tuple$2:f5","Object",{$t1:null,$t2:null,_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},init:function($t1,$t2,a,b){this.$t1=$t1;this.$t2=$t2;this.$type=this.$type.specialize(this.$t1,this.$t2);$.ig.$op.init.call(this);this.a(a);this.b(b)},$type:new $.ig.Type("Tuple$2",$.ig.$ot)},true);$c("Uri:ew","Object",{init:function(a,b){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break;case 3:this.init3.apply(this,arguments);break}return}$$t.$ew.init2.call(this,2,b,1,true)},init1:function(a,b,c){$$t.$ew.init2.call(this,2,b,c,true)},init2:function(a,b,c,d){$.ig.$op.init.call(this);this.value(b)},_value:null,value:function(a){if(arguments.length===1){this._value=a;return a}else{return this._value}},isAbsoluteUri:function(){var a=this.value();var b=a.length;if(b!=0&&$ag(a.charAt(0))){for(var c=1;c<b;c++){var d=a.charAt(c);if(d==":"){return true}if(d!="+"&&d!="-"&&d!="."&&!$ai(d)){break}}}return false},scheme:function(){var a=this.value();var b=a.length;if(b!=0&&$ag(a.charAt(0))){for(var c=1;c<b;c++){var d=a.charAt(c);if(d==":"){return a.substr(0,c)}if(d!="+"&&d!="-"&&d!="."&&!$ai(d)){break}}}throw new $$t.ch(1,"The scheme cannot be obtained from a relative Uri.")},encodeURIComponent:function(a){return null},escapeUriString:function(a){if(/^([A-Z]:)|(\\\\)/i.test(a)){return a}return encodeURI(a)},tryCreate:function(a,b,c){if($$t.$ew.isWellFormedUriString(a,b)){c=new $$t.ew(2,a,b,false);return{ret:true,p2:c}}c=null;return{ret:false,p2:c}},isWellFormedUriString:function(a,b){switch(b){case 1:if(!/^(((http|ftp|https):\/\/[\w-]+(\.[\w-]*)+)|(file:\/\/\/?))([\w\\$()!'.,@?^=%&amp;:\/~+#-]*[\w@?^=%&amp;\/~+#-])?$/i.test(a)){return false}break;case 2:if(!/^([\w\\$()!'.,@?^=%&amp;:\/~+#-]*[\w@?^=%&amp;\/~+#-])?$/i.test(a)){return false}break;default:case 0:if(!/^((((http|ftp|https):\/\/[\w-]+(\.[\w-]*)+)|(file:\/\/\/?)))?([\w\\$()!'.,@?^=%&amp;:\/~+#-]*[\w@?^=%&amp;\/~+#-])?$/i.test(a)){return false}break}return true},toString:function(){if(/^([A-Z]:)|(\\\\)/i.test(this.value())){return this.value()}var a=decodeURI(this.value());if(/^(http|ftp|https):\/\/[\w-]+(\.[\w-]*)+?$/i.test(a)){a+="/"}return a},init3:function(a,b,c){$.ig.$op.init.call(this);throw new $$t.by(0)},absolutePath:function(){throw new $$t.by(0);return null},absoluteUri:function(){throw new $$t.by(0);return null},localPath:function(){var a=/^(((http|ftp|https):\/\/[\w-]+(\.[\w-]*)+)|(file:\/\/\/?))([\w\\$()!'.,@?^=%&amp;:\/~+#-]*[\w@?^=%&amp;\/~+#-])?$/i.exec(this.value());if(a==null){throw new $$t.ch(0)}if(a[6]!=null){return decodeURI(a[6])}return"/"},originalString:function(){return this.value()},isWellFormedOriginalString:function(){throw new $$t.by(0);return false},$type:new $.ig.Type("Uri",$.ig.$ot)},true);$c("JavaScriptSerializer:f8","Object",{init:function(){$.ig.$op.init.call(this)},a:function(a){var text_=a;return JSON.parse(text_)},b:function(a){var value_=a;return JSON.stringify(value_)},$type:new $.ig.Type("JavaScriptSerializer",$.ig.$ot)},true);$c("XObject:h6","Object",{init:function(a){$.ig.$op.init.call(this);this.backingNode(a)},_backingNode:null,backingNode:function(a){if(arguments.length===1){this._backingNode=a;return a}else{return this._backingNode}},c:function(){},toString:function(){if(this.backingNode()!=null){return $$t.$ig.xmlNodeToString(this.backingNode())}else{return""}},$type:new $.ig.Type("XObject",$.ig.$ot)},true);$c("XAttribute:ih","XObject",{init:function(a){$$t.$h6.init.call(this,a)},e:function(a){this.backingNode(this.backingNode().cloneNode(true));a.setAttributeNode(this.backingNode())},c:function(){return 2},d:function(){return $$t.$ig.b(this.backingNode())},$type:new $.ig.Type("XAttribute",$$t.$h6.$type)},true);$c("XNode:ii","XObject",{init:function(a){$$t.$h6.init.call(this,a)},$type:new $.ig.Type("XNode",$$t.$h6.$type)},true);$c("XContainer:ij","XNode",{init:function(a){$$t.$ii.init.call(this,a)},h:function(a){var b=null;var c=this.backingNode();var d=c.childNodes;var e=d.length;var f=a.c();var g=a.d();for(var h=0;h<e;h++){var i=d.item(h);if(i.namespaceURI==g&&i.nodeType==1&&$$t.$ig.d(i)==f){b=i}}if(b==null){return null}else{return new $$t.ik(0,b)}},d:function(){return this.f(null)},e:function(a){return this.f(a)},f:function(a){var b=new $$t.bh($$t.$ik.$type,0);for(var c=0;c<this.backingNode().childNodes.length;c++){var d=this.backingNode().childNodes.item(c);if(d.nodeType==1){var e=false;if(a!=null){if($$t.$ig.d(d)==a.c()&&d.namespaceURI==a.d()){e=true}}else{e=true}if(e){b.add(new $$t.ik(0,d))}}}return b},g:function(a){var b=this.backingNode();var c;if($b($$t.$io.$type,this)!==null){c=this.backingNode()}else{c=this.backingNode().ownerDocument}if($b($$t.$ih.$type,a)!==null){a.e(b)}else if($b($$t.$ik.$type,a)!==null){a.j(b,c)}},$type:new $.ig.Type("XContainer",$$t.$ii.$type)},true);$c("XDocument:io","XContainer",{init:function(a,b){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$$t.$ij.init.call(this,b)},init1:function(a){$$t.$ij.init.call(this,$$t.$ig.j())},c:function(){return 9},i:function(a){return new $$t.io(0,$$t.$ig.n(a))},$type:new $.ig.Type("XDocument",$$t.$ij.$type)},true);$c("XElement:ik","XContainer",{init:function(a,b){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$$t.$ij.init.call(this,b)},init1:function(a,b){$$t.$ik.init2.call(this,2,b,null)},init2:function(a,b,c){$$t.$ij.init.call(this,$$t.$ig.o(b.c(),b.d()));var d=c==null?"":c.toString();this.i(d)},i:function(a){if(arguments.length===1){$$t.$ig.h(this.backingNode(),a);return a}else{return $$t.$ig.c(this.backingNode())}},c:function(){return 1},l:function(){return $$t.$il.e($$t.$ig.d(this.backingNode()),this.backingNode().namespaceURI)},k:function(a){return new $$t.ih($$t.$ig.i(this.backingNode(),a.c(),a.d()))},j:function(a,b){if(this.backingNode().ownerDocument!=b){this.backingNode($$t.$ig.p(b,this.backingNode()))}a.appendChild(this.backingNode())},$type:new $.ig.Type("XElement",$$t.$ij.$type)},true);$c("XmlUtils:ig","Object",{init:function(){$.ig.$op.init.call(this)},a:function(){return!!window.DOMParser},m:function(a){var text_=a;return(new DOMParser).parseFromString(text_,"text/xml")},l:function(a){var text_=a;return function(xml){var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");xmlDoc.async=false;xmlDoc.loadXML(xml);return xmlDoc}(text_)},f:function(a){var node_=a;return(new XMLSerializer).serializeToString(node_)},e:function(a){var node_=a;return node_.xml},k:function(){return new ActiveXObject("Microsoft.XMLDOM")},n:function(a){if($$t.$ig.a()){return $$t.$ig.m(a)}else{return $$t.$ig.l(a)}},xmlNodeToString:function(a){if($$t.$ig.a()){return $$t.$ig.f(a)}else{return $$t.$ig.e(a)}},j:function(){var a;if($$t.$ig.a()){a=$$t.$ig.m("<dummy/>");a.removeChild(a.documentElement)}else{a=$$t.$ig.k()}return a},o:function(a,b){var doc_=$$t.$ig.j();if($$t.$ig.a()){return doc_.createElementNS(b,a)}else{var name_=a;var namespaceURI_=b;return doc_.createNode(1,name_,namespaceURI_)}},c:function(a){if($$t.$ig.a()){return a.textContent}else{var node_=a;return node_.text}},h:function(a,b){if($$t.$ig.a()){a.textContent=b}else{var node_=a;var text_=b;node_.text=text_}},p:function(a,b){if($$t.$ig.a()){return a.importNode(b,true)}else{return b}},d:function(a){if($$t.$ig.a()){return a.localName}else{var node_=a;return node_.baseName}},i:function(a,b,c){if($$t.$ig.a()){return a.getAttributeNodeNS(c,b)}else{var elem_=a;var ln_=b;var nn_=c;return elem_.attributes.getQualifiedItem(ln_,nn_)}},b:function(a){if($$t.$ig.a()){return a.nodeValue}else{var attr_=a;return attr_.value}},$type:new $.ig.Type("XmlUtils",$.ig.$ot)},true);$c("XName:il","Object",{a:null,b:null,init:function(a,b){$.ig.$op.init.call(this);this.a=a;this.b=b},c:function(){return this.a},d:function(){return this.b},f:function(){return $$t.$im.c(this.b)},e:function(a,b){return new $$t.il(a,b)},$type:new $.ig.Type("XName",$.ig.$ot)},true);$c("XNamespace:im","Object",{a:null,init:function(a){$.ig.$op.init.call(this);this.a=a},c:function(a){return new $$t.im(a)},d:function(){return $$t.$im.c("http://www.w3.org/2000/xmlns/")},b:function(){return this.a},$type:new $.ig.Type("XNamespace",$.ig.$ot)},true);$c("Enumerable___Skip__IteratorClass$1:Enumerable___Skip__IteratorClass$1","Object",{$tSource:null,f:0,d:null,c:null,e:null,b:null,__3__source:null,h:0,__3__toSkip:0,init:function($tSource,a){this.$tSource=$tSource;this.$type=this.$type.specialize(this.$tSource);$.ig.$op.init.call(this);this.f=a},i:function(){this.f=-1;if(this.c!=null){this.c.dispose()}},moveNext:function(){var __hasError__=false;try{while(this.f>=0){switch(this.f){case 0:this.f=1;this.c=this.b.getEnumerator();this.f=2;break;case 2:this.f=1;
if(this.c.moveNext()){this.e=this.c.current();if(this.h<=0){this.d=this.e;this.f=2;return true}this.h--;this.f=2;break}this.i();break}}}catch(a){__hasError__=true;throw a}finally{if(__hasError__){this.dispose()}}return false},getEnumerator:function(){var d__;if(this.f==-2){this.f=0;d__=this}else{d__=new $.ig.Enumerable___Skip__IteratorClass$1(this.$tSource,0)}d__.b=this.__3__source;d__.h=this.__3__toSkip;return d__},reset:function(){throw new $$t.w(1)},dispose:function(){switch(this.f){case 1:case 2:this.i();break}},current:function(){return this.d},current1:function(){return $d(this.$tSource,this.d)},$type:new $.ig.Type("Enumerable___Skip__IteratorClass$1",$.ig.$ot,[$$t.$an.$type.specialize(0),$.ig.IEnumerable.prototype.$type,$$t.$ao.$type.specialize(0),$.ig.IEnumerator.prototype.$type,$$t.$ap.$type])},true);$c("Enumerable___Take__IteratorClass$1:Enumerable___Take__IteratorClass$1","Object",{$tSource:null,f:0,d:null,c:null,e:null,b:null,__3__source:null,h:0,__3__toTake:0,init:function($tSource,a){this.$tSource=$tSource;this.$type=this.$type.specialize(this.$tSource);$.ig.$op.init.call(this);this.f=a},i:function(){this.f=-1;if(this.c!=null){this.c.dispose()}},moveNext:function(){var __hasError__=false;try{while(this.f>=0){switch(this.f){case 0:this.f=1;this.c=this.b.getEnumerator();this.f=2;break;case 2:this.f=1;if(this.c.moveNext()){this.e=this.c.current();if(this.h>0){this.h--;this.d=this.e;this.f=2;return true}return false}this.i();break}}}catch(a){__hasError__=true;throw a}finally{if(__hasError__){this.dispose()}}return false},getEnumerator:function(){var d__;if(this.f==-2){this.f=0;d__=this}else{d__=new $.ig.Enumerable___Take__IteratorClass$1(this.$tSource,0)}d__.b=this.__3__source;d__.h=this.__3__toTake;return d__},reset:function(){throw new $$t.w(1)},dispose:function(){switch(this.f){case 1:case 2:this.i();break}},current:function(){return this.d},current1:function(){return $d(this.$tSource,this.d)},$type:new $.ig.Type("Enumerable___Take__IteratorClass$1",$.ig.$ot,[$$t.$an.$type.specialize(0),$.ig.IEnumerable.prototype.$type,$$t.$ao.$type.specialize(0),$.ig.IEnumerator.prototype.$type,$$t.$ap.$type])},true);$c("Enumerable___SelectMany__IteratorClass1$3:Enumerable___SelectMany__IteratorClass1$3","Object",{$tSource:null,$tCollection:null,$tResult:null,l:0,j:null,c:null,k:null,d:null,i:null,b:null,__3__source:null,g:null,__3__collectionSelector:null,h:null,__3__resultSelector:null,init:function($tSource,$tCollection,$tResult,a){this.$tSource=$tSource;this.$tCollection=$tCollection;this.$tResult=$tResult;this.$type=this.$type.specialize(this.$tSource,this.$tCollection,this.$tResult);$.ig.$op.init.call(this);this.l=a},m:function(){this.l=-1;if(this.c!=null){this.c.dispose()}},n:function(){this.l=1;if(this.d!=null){this.d.dispose()}},moveNext:function(){var __hasError__=false;try{while(this.l>=0){switch(this.l){case 0:this.l=1;this.c=this.b.getEnumerator();this.l=2;break;case 2:this.l=1;if(this.c.moveNext()){this.k=this.c.current();this.l=3;this.d=this.g(this.k).getEnumerator();this.l=4;break}this.m();break;case 4:this.l=3;if(this.d.moveNext()){this.i=this.d.current();this.j=this.h(this.k,this.i);this.l=4;return true}this.n();this.l=2;break}}}catch(a){__hasError__=true;throw a}finally{if(__hasError__){this.dispose()}}return false},getEnumerator:function(){var d__;if(this.l==-2){this.l=0;d__=this}else{d__=new $.ig.Enumerable___SelectMany__IteratorClass1$3(this.$tSource,this.$tCollection,this.$tResult,0)}d__.b=this.__3__source;d__.g=this.__3__collectionSelector;d__.h=this.__3__resultSelector;return d__},reset:function(){throw new $$t.w(1)},dispose:function(){switch(this.l){case 1:case 2:this.m();break;case 3:case 4:try{this.n()}finally{this.m()}break}},current:function(){return this.j},current1:function(){return $d(this.$tResult,this.j)},$type:new $.ig.Type("Enumerable___SelectMany__IteratorClass1$3",$.ig.$ot,[$$t.$an.$type.specialize(0),$.ig.IEnumerable.prototype.$type,$$t.$ao.$type.specialize(0),$.ig.IEnumerator.prototype.$type,$$t.$ap.$type])},true);$c("Enumerable___Reverse__IteratorClass$1:Enumerable___Reverse__IteratorClass$1","Object",{$tSource:null,e:0,d:null,c:null,f:0,b:null,__3__source:null,init:function($tSource,a){this.$tSource=$tSource;this.$type=this.$type.specialize(this.$tSource);$.ig.$op.init.call(this);this.e=a},moveNext:function(){while(this.e>=0){switch(this.e){case 0:this.e=-1;this.c=new $$t.bh(this.$tSource,1,this.b);this.f=this.c.count()-1;this.e=1;break;case 1:this.e=-1;if(this.f>=0){this.d=this.c.__inner[this.f];this.e=2;return true}break;case 2:this.e=-1;this.f--;this.e=1;break}}return false},getEnumerator:function(){var d__;if(this.e==-2){this.e=0;d__=this}else{d__=new $.ig.Enumerable___Reverse__IteratorClass$1(this.$tSource,0)}d__.b=this.__3__source;return d__},reset:function(){throw new $$t.w(1)},dispose:function(){},current:function(){return this.d},current1:function(){return $d(this.$tSource,this.d)},$type:new $.ig.Type("Enumerable___Reverse__IteratorClass$1",$.ig.$ot,[$$t.$an.$type.specialize(0),$.ig.IEnumerable.prototype.$type,$$t.$ao.$type.specialize(0),$.ig.IEnumerator.prototype.$type,$$t.$ap.$type])},true);$c("Enumerable___Range__IteratorClass:Enumerable___Range__IteratorClass","Object",{a:0,b:0,e:0,g:0,__3__startValue:0,f:0,__3__count:0,init:function(a){$.ig.$op.init.call(this);this.a=a},moveNext:function(){while(this.a>=0){switch(this.a){case 0:this.a=-1;this.e=this.g;this.a=1;break;case 1:this.a=-1;if(this.e<this.f){this.b=this.e;this.a=2;return true}break;case 2:this.a=-1;this.e++;this.a=1;break}}return false},getEnumerator:function(){var d__;if(this.a==-2){this.a=0;d__=this}else{d__=new $.ig.Enumerable___Range__IteratorClass(0)}d__.g=this.__3__startValue;d__.f=this.__3__count;return d__},reset:function(){throw new $$t.w(1)},dispose:function(){},current:function(){return this.b},current1:function(){return this.b},$type:new $.ig.Type("Enumerable___Range__IteratorClass",$.ig.$ot,[$$t.$an.$type.specialize($.ig.Number.prototype.$type),$.ig.IEnumerable.prototype.$type,$$t.$ao.$type.specialize($.ig.Number.prototype.$type),$.ig.IEnumerator.prototype.$type,$$t.$ap.$type])},true);$c("Enumerable___OfType__IteratorClass$1:Enumerable___OfType__IteratorClass$1","Object",{$tResult:null,e:0,d:null,c:null,f:null,b:null,__3__source:null,init:function($tResult,a){this.$tResult=$tResult;this.$type=this.$type.specialize(this.$tResult);$.ig.$op.init.call(this);this.e=a},g:function(){this.e=-1;var d__=$b($$t.$ap.$type,this.c);if(d__!=null){d__.dispose()}},moveNext:function(){var __hasError__=false;try{while(this.e>=0){switch(this.e){case 0:this.e=1;this.c=this.b.getEnumerator();this.e=2;break;case 2:this.e=1;if(this.c.moveNext()){this.f=this.c.current();if($b(this.$tResult,this.f)!==null){this.d=$u(this.$tResult,this.f);this.e=2;return true}this.e=2;break}this.g();break}}}catch(a){__hasError__=true;throw a}finally{if(__hasError__){this.dispose()}}return false},getEnumerator:function(){var d__;if(this.e==-2){this.e=0;d__=this}else{d__=new $.ig.Enumerable___OfType__IteratorClass$1(this.$tResult,0)}d__.b=this.__3__source;return d__},reset:function(){throw new $$t.w(1)},dispose:function(){switch(this.e){case 1:case 2:this.g();break}},current:function(){return this.d},current1:function(){return $d(this.$tResult,this.d)},$type:new $.ig.Type("Enumerable___OfType__IteratorClass$1",$.ig.$ot,[$$t.$an.$type.specialize(0),$.ig.IEnumerable.prototype.$type,$$t.$ao.$type.specialize(0),$.ig.IEnumerator.prototype.$type,$$t.$ap.$type])},true);$c("Enumerable___SelectMany__IteratorClass$2:Enumerable___SelectMany__IteratorClass$2","Object",{$tSource:null,$tResult:null,j:0,g:null,d:null,i:null,c:null,h:null,b:null,__3__source:null,f:null,__3__selector:null,init:function($tSource,$tResult,a){this.$tSource=$tSource;this.$tResult=$tResult;this.$type=this.$type.specialize(this.$tSource,this.$tResult);$.ig.$op.init.call(this);this.j=a},k:function(){this.j=-1;if(this.d!=null){this.d.dispose()}},l:function(){this.j=1;if(this.c!=null){this.c.dispose()}},moveNext:function(){var __hasError__=false;try{while(this.j>=0){switch(this.j){case 0:this.j=1;this.d=this.b.getEnumerator();this.j=2;break;case 2:this.j=1;if(this.d.moveNext()){this.i=this.d.current();this.j=3;this.c=this.f(this.i).getEnumerator();this.j=4;break}this.k();break;case 4:this.j=3;if(this.c.moveNext()){this.h=this.c.current();this.g=this.h;this.j=4;return true}this.l();this.j=2;break}}}catch(a){__hasError__=true;throw a}finally{if(__hasError__){this.dispose()}}return false},getEnumerator:function(){var d__;if(this.j==-2){this.j=0;d__=this}else{d__=new $.ig.Enumerable___SelectMany__IteratorClass$2(this.$tSource,this.$tResult,0)}d__.b=this.__3__source;d__.f=this.__3__selector;return d__},reset:function(){throw new $$t.w(1)},dispose:function(){switch(this.j){case 1:case 2:this.k();break;case 3:case 4:try{this.l()}finally{this.k()}break}},current:function(){return this.g},current1:function(){return $d(this.$tResult,this.g)},$type:new $.ig.Type("Enumerable___SelectMany__IteratorClass$2",$.ig.$ot,[$$t.$an.$type.specialize(0),$.ig.IEnumerable.prototype.$type,$$t.$ao.$type.specialize(0),$.ig.IEnumerator.prototype.$type,$$t.$ap.$type])},true);$c("Enumerable___Select__IteratorClass$2:Enumerable___Select__IteratorClass$2","Object",{$tSource:null,$tResult:null,h:0,f:null,c:null,g:null,b:null,__3__source:null,e:null,__3__selector:null,init:function($tSource,$tResult,a){this.$tSource=$tSource;this.$tResult=$tResult;this.$type=this.$type.specialize(this.$tSource,this.$tResult);$.ig.$op.init.call(this);this.h=a},i:function(){this.h=-1;if(this.c!=null){this.c.dispose()}},moveNext:function(){var __hasError__=false;try{while(this.h>=0){switch(this.h){case 0:this.h=1;this.c=this.b.getEnumerator();this.h=2;break;case 2:this.h=1;if(this.c.moveNext()){this.g=this.c.current();this.f=this.e(this.g);this.h=2;return true}this.i();break}}}catch(a){__hasError__=true;throw a}finally{if(__hasError__){this.dispose()}}return false},getEnumerator:function(){var d__;if(this.h==-2){this.h=0;d__=this}else{d__=new $.ig.Enumerable___Select__IteratorClass$2(this.$tSource,this.$tResult,0)}d__.b=this.__3__source;d__.e=this.__3__selector;return d__},reset:function(){throw new $$t.w(1)},dispose:function(){switch(this.h){case 1:case 2:this.i();break}},current:function(){return this.f},current1:function(){return $d(this.$tResult,this.f)},$type:new $.ig.Type("Enumerable___Select__IteratorClass$2",$.ig.$ot,[$$t.$an.$type.specialize(0),$.ig.IEnumerable.prototype.$type,$$t.$ao.$type.specialize(0),$.ig.IEnumerator.prototype.$type,$$t.$ap.$type])},true);$c("Enumerable___Where__IteratorClass1$1:Enumerable___Where__IteratorClass1$1","Object",{$tSource:null,h:0,f:null,i:0,c:null,g:null,b:null,__3__source:null,e:null,__3__predicate:null,init:function($tSource,a){this.$tSource=$tSource;this.$type=this.$type.specialize(this.$tSource);$.ig.$op.init.call(this);this.h=a},j:function(){this.h=-1;if(this.c!=null){this.c.dispose()}},moveNext:function(){var __hasError__=false;try{while(this.h>=0){switch(this.h){case 0:this.h=-1;this.i=0;this.h=1;this.c=this.b.getEnumerator();this.h=2;break;case 2:this.h=1;if(this.c.moveNext()){this.g=this.c.current();if(this.e(this.g,this.i)){this.f=this.g;this.h=3;return true}this.h=3;break}this.j();break;case 3:this.h=1;this.i++;this.h=2;break}}}catch(a){__hasError__=true;throw a}finally{if(__hasError__){this.dispose()}}return false},getEnumerator:function(){var d__;if(this.h==-2){this.h=0;d__=this}else{d__=new $.ig.Enumerable___Where__IteratorClass1$1(this.$tSource,0)}d__.b=this.__3__source;d__.e=this.__3__predicate;return d__},reset:function(){throw new $$t.w(1)},dispose:function(){switch(this.h){case 1:case 2:case 3:this.j();break}},current:function(){return this.f},current1:function(){return $d(this.$tSource,this.f)},$type:new $.ig.Type("Enumerable___Where__IteratorClass1$1",$.ig.$ot,[$$t.$an.$type.specialize(0),$.ig.IEnumerable.prototype.$type,$$t.$ao.$type.specialize(0),$.ig.IEnumerator.prototype.$type,$$t.$ap.$type])},true);$c("Enumerable___Where__IteratorClass$1:Enumerable___Where__IteratorClass$1","Object",{$tSource:null,h:0,f:null,c:null,g:null,b:null,__3__source:null,e:null,__3__predicate:null,init:function($tSource,a){this.$tSource=$tSource;this.$type=this.$type.specialize(this.$tSource);$.ig.$op.init.call(this);this.h=a},i:function(){this.h=-1;if(this.c!=null){this.c.dispose()}},moveNext:function(){var __hasError__=false;try{while(this.h>=0){switch(this.h){case 0:this.h=1;this.c=this.b.getEnumerator();this.h=2;break;case 2:this.h=1;if(this.c.moveNext()){this.g=this.c.current();if(this.e(this.g)){this.f=this.g;this.h=2;return true}this.h=2;break}this.i();break}}}catch(a){__hasError__=true;throw a}finally{if(__hasError__){this.dispose()}}return false},getEnumerator:function(){var d__;if(this.h==-2){this.h=0;d__=this}else{d__=new $.ig.Enumerable___Where__IteratorClass$1(this.$tSource,0)}d__.b=this.__3__source;d__.e=this.__3__predicate;return d__},reset:function(){throw new $$t.w(1)},dispose:function(){switch(this.h){case 1:case 2:this.i();break}},current:function(){return this.f},current1:function(){return $d(this.$tSource,this.f)},$type:new $.ig.Type("Enumerable___Where__IteratorClass$1",$.ig.$ot,[$$t.$an.$type.specialize(0),$.ig.IEnumerable.prototype.$type,$$t.$ao.$type.specialize(0),$.ig.IEnumerator.prototype.$type,$$t.$ap.$type])},true);$c("Dictionary___ToEnumerable__IteratorClass$2:Dictionary___ToEnumerable__IteratorClass$2","Object",{$tKey:null,$tValue:null,g:0,f:null,a:null,h:0,b:null,i:0,e:null,c:null,j:0,__4__this:null,init:function($tKey,$tValue,a){this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);this.f=new $$t.b4(this.$tKey,this.$tValue);$.ig.$op.init.call(this);this.g=a},moveNext:function(){while(this.g>=0){switch(this.g){case 0:this.g=-1;if(this.__4__this.c){this.a=$.ig.util.getArrayOfProperties(this.__4__this.a);this.h=0;this.g=1;break}this.b=$.ig.util.getArrayOfProperties(this.__4__this.b);this.i=0;this.g=3;break;case 1:this.g=-1;if(this.h<this.a.length){this.f=new $$t.b4(this.$tKey,this.$tValue,1,this.__4__this.a[this.a[this.h]],this.__4__this.b[this.a[this.h]]);this.g=2;return true}break;case 2:this.g=-1;this.h++;this.g=1;break;case 3:this.g=-1;if(this.i<this.b.length){this.e=this.__4__this.b[this.b[this.i]];if(this.e.$isHashSetBucket){this.c=this.e;this.j=0;this.g=4;break}this.f=new $$t.b4(this.$tKey,this.$tValue,1,this.e.key,this.e.value);this.g=6;return true}break;case 4:this.g=-1;if(this.j<this.c.length){var subItem_=this.c[this.j];this.f=new $$t.b4(this.$tKey,this.$tValue,1,subItem_.key,subItem_.value);this.g=5;return true}this.g=6;break;case 5:this.g=-1;this.j++;this.g=4;break;case 6:this.g=-1;this.i++;this.g=3;break}}return false},getEnumerator:function(){var d__;if(this.g==-2){this.g=0;d__=this}else{d__=new $.ig.Dictionary___ToEnumerable__IteratorClass$2(this.$tKey,this.$tValue,0);d__.__4__this=this.__4__this}return d__},reset:function(){throw new $$t.w(1)},dispose:function(){},current:function(){return this.f},current1:function(){return this.f},$type:new $.ig.Type("Dictionary___ToEnumerable__IteratorClass$2",$.ig.$ot,[$$t.$an.$type.specialize($$t.$b4.$type.specialize(this.$tKey,this.$tValue)),$.ig.IEnumerable.prototype.$type,$$t.$ao.$type.specialize($$t.$b4.$type.specialize(this.$tKey,this.$tValue)),$.ig.IEnumerator.prototype.$type,$$t.$ap.$type])},true);$c("Enumerable___Concat__IteratorClass$1:Enumerable___Concat__IteratorClass$1","Object",{$tSource:null,j:0,g:null,e:null,h:null,f:null,i:null,c:null,__3__source1:null,d:null,__3__source2:null,init:function($tSource,a){this.$tSource=$tSource;this.$type=this.$type.specialize(this.$tSource);$.ig.$op.init.call(this);this.j=a},k:function(){this.j=-1;if(this.e!=null){this.e.dispose()}},l:function(){this.j=-1;if(this.f!=null){this.f.dispose()}},moveNext:function(){var __hasError__=false;try{while(this.j>=0){switch(this.j){case 0:this.j=1;this.e=this.c.getEnumerator();this.j=2;break;case 2:this.j=1;if(this.e.moveNext()){this.h=this.e.current();this.g=this.h;this.j=2;return true}this.k();this.j=3;this.f=this.d.getEnumerator();this.j=4;break;case 4:this.j=3;if(this.f.moveNext()){this.i=this.f.current();this.g=this.i;this.j=4;return true}this.l();break}}}catch(a){__hasError__=true;throw a}finally{if(__hasError__){this.dispose()}}return false},getEnumerator:function(){var d__;if(this.j==-2){this.j=0;d__=this}else{d__=new $.ig.Enumerable___Concat__IteratorClass$1(this.$tSource,0)}d__.c=this.__3__source1;d__.d=this.__3__source2;return d__},reset:function(){throw new $$t.w(1)},dispose:function(){switch(this.j){case 1:case 2:this.k();break;case 3:case 4:this.l();break}},current:function(){return this.g},current1:function(){return $d(this.$tSource,this.g)},$type:new $.ig.Type("Enumerable___Concat__IteratorClass$1",$.ig.$ot,[$$t.$an.$type.specialize(0),$.ig.IEnumerable.prototype.$type,$$t.$ao.$type.specialize(0),$.ig.IEnumerator.prototype.$type,$$t.$ap.$type])},true);$c("Enumerable___Empty__IteratorClass$1:Enumerable___Empty__IteratorClass$1","Object",{$tSource:null,b:0,a:null,init:function($tSource,a){this.$tSource=$tSource;this.$type=this.$type.specialize(this.$tSource);$.ig.$op.init.call(this);this.b=a},moveNext:function(){switch(this.b){case 0:this.b=-1;return false}return false},getEnumerator:function(){if(this.b==-2){this.b=0;return this}return new $.ig.Enumerable___Empty__IteratorClass$1(this.$tSource,0)},reset:function(){throw new $$t.w(1)},dispose:function(){},current:function(){return this.a},current1:function(){return $d(this.$tSource,this.a)},$type:new $.ig.Type("Enumerable___Empty__IteratorClass$1",$.ig.$ot,[$$t.$an.$type.specialize(0),$.ig.IEnumerable.prototype.$type,$$t.$ao.$type.specialize(0),$.ig.IEnumerator.prototype.$type,$$t.$ap.$type])},true);$$t.$ex.relativeOrAbsolute=0;$$t.$ex.absolute=1;$$t.$ex.relative=2;$$t.$e6.created=0;$$t.$e6.ranToCompletion=5;$$t.$e6.canceled=6;$$t.$e6.faulted=7;$$t.$d1.ascending=0;$$t.$d1.descending=1;$$t.$cp.add=0;$$t.$cp.remove=1;$$t.$cp.replace=2;$$t.$cp.reset=4;$$t.$eh.t=null;$$t.$eh.s=null;$$t.$eh.r=null;$$t.$eh.p=null;$$t.$eh.q=null})(jQuery);$.ig=$.ig||{};(function($){var $$t={};$.ig.$currDefinitions=$$t;$.ig.util.bulkDefine(["ICoreOlapElement:a","String:b","Object:c","Type:d","Boolean:e","ValueType:f","Void:g","IConvertible:h","IFormatProvider:i","Number:j","NumberStyles:k","Enum:l","Array:m","IList:n","ICollection:o","IEnumerable:p","IEnumerator:q","Number:r","IComparable:s","Number:t","Number:u","Number:v","NotSupportedException:w","Error:x","Number:y","String:z","Date:aa","Number:ab","DayOfWeek:ac","DateTimeKind:ad","Number:ae","Number:af","Number:ag","Number:ah","Number:ai","Number:aj","Assembly:ak","Stream:al","IDisposable:am","SeekOrigin:an","RuntimeTypeHandle:ao","MethodInfo:ap","MethodBase:aq","MemberInfo:ar","ParameterInfo:as","TypeCode:at","ConstructorInfo:au","PropertyInfo:av","StringComparison:aw","RegExp:ax","CultureInfo:ay","DateTimeFormatInfo:az","Calendar:a0","CalendarWeekRule:a1","NumberFormatInfo:a2","CompareInfo:a3","CompareOptions:a4","IEnumerable$1:a5","IEnumerator$1:a6","StringSplitOptions:a7","Cube:a8","CubeType:a9","Catalog:ba","Dimension:bb","DimensionType:bc","KpiDimension:bd","HierarchyOrigin:bg","AggregatorType:bh","CardinalityType:bi","MemberType:bj","Hierarchy:bk","Kpi:bl","Level:bm","Measure:bn","KpiMeasure:bo","MeasureGroup:bp","MeasureGroupDimension:bq","Member:br","Nullable$1:bs","OlapResult:bt","IList$1:bu","ICollection$1:bv","OlapResultAxis:bw","PositionResolver$2:bx","List$1:by","IArray:bz","Script:b0","IArrayList:b1","Array:b2","CompareCallback:b3","MulticastDelegate:b4","IntPtr:b5","Func$3:b6","Action$1:b7","Comparer$1:b8","IComparer:b9","IComparer$1:ca","DefaultComparer$1:cb","IComparable$1:cc","Comparison$1:cd","ReadOnlyCollection$1:ce","Predicate$1:cf","NotImplementedException:cg","IPosition$2:ch","IPositionItem$2:ci","PositionItemInfo$2:cj","Dictionary$2:ck","IDictionary$2:cl","IDictionary:cm","Func$2:cn","KeyValuePair$2:co","Enumerable:cp","Thread:cq","ThreadStart:cr","IOrderedEnumerable$1:cs","SortedList$1:ct","Math:cu","ArgumentNullException:cv","IEqualityComparer$1:cw","EqualityComparer$1:cx","IEqualityComparer:cy","DefaultEqualityComparer$1:cz","InvalidOperationException:c0","ArgumentException:c1","IHierarchicalPositionItem$2:c2","EventHandler$1:c3","AsyncCompletedEventArgs:c4","EventArgs:c5","Delegate:c6","Interlocked:c7","ListSortDirection:c8","OlapResultTuple:c9","OlapResultAxisMember:da","OlapResultCell:db","IConnection:dc","IOlapDataProviderFactory:dd","IOlapDiscoverDataProvider:de","Task$1:df","Task:dg","JQueryPromise:dh","Action:di","AggregateException:dj","TaskStatus:dk","TaskCompletionSource$1:dl","JQueryDeferred:dm","JQuery:dn","JQueryObject:dp","Element:dq","ElementAttributeCollection:dr","ElementCollection:ds","WebStyle:dt","ElementNodeType:du","Document:dv","EventListener:dw","IElementEventHandler:dx","ElementEventHandler:dy","ElementAttribute:dz","JQueryPosition:d0","JQueryCallback:d1","JQueryEvent:d2","JQueryUICallback:d3","KeyValueItem:d4","IOlapExecuteCommandProvider:d5","HeaderCellsLayoutOrientation:d6","LevelSpanManager:d7","SpanSource:d8","ITableViewHeadersFactory:d9","OlapTableViewHeaderCell:ea","TableViewHeadersFactory:eb","ArrayListCollection$1:ec","INotifyCollectionChanged:ed","NotifyCollectionChangedEventHandler:ee","NotifyCollectionChangedEventArgs:ef","NotifyCollectionChangedAction:eg","TableViewHeaderCellSource:eh","TableSuperCompactViewHeadersFactory:ei","TreeStackAttributesBehavior:ej","OlapTableViewTreeHeaderCell:ek","TreeStackNextDimensionFirstBehavior:em","TableViewTreeHeadersFactory:en","Stack$1:eo","ReverseArrayEnumerator$1:ep","TableViewImpl:eq","TableViewSettings:er","RowHeaderLayout:es","OlapTableViewResultCell:et","TupleSortDirection:eu","LevelSortDirection:ev","LevelSortBehavior:ew","ResultHeaderSorter:ex","ResultSorter$1:ey","AxisTupleVisitor:ez","AxisHeaderSortingVisitor:e0","ResultColumnValueSorter:e1","AxisValueSortingVisitor:e2","TreeLayoutTableViewSettings:e3","OlapResultView:e4","ResultViewHelper:e5","IOlapDataSource:e6","OlapMetadataTreeItem:e7","OlapMetadataTreeItemType:e8","MeasureListLocation:e9","MeasureList:fa","OlapDataSource:fb","DataSourceBaseOptions:fc","CubeMetaItemsCache:fd","MeasureGroupMetaItemsCache:fe","Tuple$2:ff","AxisElement:fg","PositionInfo:fh","TaskFactory:fi","TaskExtensions:fj","AxisDefinitionParser:fk","MetaTreeHelper:fl","HierarchyItemPosition:fm","CoreOlapElementParser:fq","HierarchyFilterView:fz","FilterMember:f0","INotifyPropertyChanged:f1","PropertyChangedEventHandler:f2","PropertyChangedEventArgs:f3","FilterMemberStateChangedEventArgs:f4","DataSourceBase:f5","jQueryUtils:f6","OlapUtilities:f7","OlapTableView:f8","AbstractEnumerable:f9","Func$1:ga","AbstractEnumerator:gb","GenericEnumerable$1:gc","GenericEnumerator$1:gd"]);var $a=$.ig.intDivide,$b=$.ig.util.cast,$c=$.ig.util.defType,$d=$.ig.util.getBoxIfEnum,$e=$.ig.util.getDefaultValue,$f=$.ig.util.getEnumValue,$g=$.ig.util.getValue,$h=$.ig.util.intSToU,$i=$.ig.util.nullableEquals,$j=$.ig.util.nullableIsNull,$k=$.ig.util.nullableNotEquals,$l=$.ig.util.toNullable,$m=$.ig.util.toString$1,$n=$.ig.util.u32BitwiseAnd,$o=$.ig.util.u32BitwiseOr,$p=$.ig.util.u32BitwiseXor,$q=$.ig.util.u32LS,$r=$.ig.util.unwrapNullable,$s=$.ig.util.wrapNullable,$t=String.fromCharCode,$u=$.ig.util.castObjTo$t,$v=$.ig.util.compare,$w=$.ig.util.replace,$x=$.ig.util.stringFormat,$y=$.ig.util.stringFormat1,$z=$.ig.util.stringFormat2,$0=$.ig.util.stringCompare1,$1=$.ig.util.stringCompare2,$2=$.ig.util.stringCompare3,$3=$.ig.util.compareSimple;$c("LevelSortBehavior:ew","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"Alphabetical";case 1:return"System";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("LevelSortBehavior",$.ig.$ep.$type)},true);$c("OlapMetadataTreeItemType:e8","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"Cube";case 1:return"Dimension";case 2:return"Group";case 3:return"UserDefinedHierarchy";case 4:return"SystemEnabledHierarchy";case 5:return"ParentChildHierarchy";case 6:return"Measure";case 7:return"Level1";case 8:return"Level2";case 9:return"Level3";case 10:return"Level4";case 11:return"Level5";case 12:return"KpiRoot";case 13:return"Kpi";case 14:return"KpiValue";case 15:return"KpiGoal";case 16:return"KpiStatus";case 17:return"KpiTrend";case 18:return"KpiWeight";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("OlapMetadataTreeItemType",$.ig.$ep.$type)},true);$c("MeasureListLocation:e9","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"Rows";case 1:return"Columns";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("MeasureListLocation",$.ig.$ep.$type)},true);$c("RowHeaderLayout:es","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"Standard";case 1:return"SuperCompact";case 2:return"Tree";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("RowHeaderLayout",$.ig.$ep.$type)},true);$c("HeaderCellsLayoutOrientation:d6","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"Horizontal";case 1:return"Vertical";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("HeaderCellsLayoutOrientation",$.ig.$ep.$type)},true);$c("MemberType:bj","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"Unknown";case 1:return"Regular";case 2:return"All";case 3:return"Measure";case 4:return"Formula";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("MemberType",$.ig.$ep.$type)},true);$c("CardinalityType:bi","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"One";case 1:return"Many";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("CardinalityType",$.ig.$ep.$type)},true);$c("AggregatorType:bh","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"Unknown";case 1:return"Sum";case 2:return"Count";case 3:return"Min";case 4:return"Max";case 5:return"Average";case 6:return"Variance";case 7:return"Std";case 8:return"DistinctCount";case 9:return"None";case 10:return"AverageOfChildren";case 13:return"FirstNonEmpty";case 14:return"LastNonEmpty";case 15:return"ByAccount";case 127:return"Calculated";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("AggregatorType",$.ig.$ep.$type)},true);$c("HierarchyOrigin:bg","Enum",{init:function(v){this._v=v},$getName:function(){function getNameSingle(v){switch(v){case 1:return"UserDefined";case 2:return"SystemEnabled";case 4:return"SystemInternal";default:return v.toString()}}return function(v){return this.getFlaggedName(v,getNameSingle)}}(),$value:function(){return this._v},$type:new $.ig.Type("HierarchyOrigin",$.ig.$ep.$type)},true);$c("DimensionType:bc","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"Unknown";case 1:return"Time";case 2:return"Measure";case 3:return"Other";case 5:return"Quantitative";case 6:return"Accounts";case 7:return"Customers";case 8:return"Products";case 9:return"Scenario";case 10:return"Utility";case 11:return"Currency";case 12:return"Rates";case 13:return"Channel";case 14:return"Promotion";case 15:return"Organization";case 16:return"BillOfMaterials";case 17:return"Geography";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("DimensionType",$.ig.$ep.$type)},true);$c("CubeType:a9","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"Cube";case 1:return"Dimension";case 2:return"Unknown";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("CubeType",$.ig.$ep.$type)},true);$c("ICoreOlapElement:a","Object",{$type:new $.ig.Type("ICoreOlapElement",null)},true);$c("Cube:a8","Object",{init:function(){$.ig.$op.init.call(this)},_catalogName:null,catalogName:function(a){if(arguments.length===1){this._catalogName=a;return a}else{return this._catalogName}},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_cubeType:0,cubeType:function(a){if(arguments.length===1){this._cubeType=a;return a}else{return this._cubeType}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_lastProcessed:new Date,lastProcessed:function(a){if(arguments.length===1){this._lastProcessed=a;return a}else{return this._lastProcessed}},_lastUpdated:new Date,lastUpdated:function(a){if(arguments.length===1){this._lastUpdated=a;return a}else{return this._lastUpdated}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},uniqueName:function(a){if(arguments.length===1){this.name(a);return a}else{return this.name()}},$type:new $.ig.Type("Cube",$.ig.$ot,[$$t.$a.$type])},true);$c("Catalog:ba","Object",{init:function(){$.ig.$op.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},$type:new $.ig.Type("Catalog",$.ig.$ot,[$$t.$a.$type])},true);$c("Dimension:bb","Object",{init:function(){$.ig.$op.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_dimensionType:0,dimensionType:function(a){if(arguments.length===1){this._dimensionType=a;return a}else{return this._dimensionType}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_defaultHierarchy:null,defaultHierarchy:function(a){if(arguments.length===1){this._defaultHierarchy=a;return a}else{return this._defaultHierarchy}},$type:new $.ig.Type("Dimension",$.ig.$ot,[$$t.$a.$type])},true);$c("KpiDimension:bd","Object",{init:function(){$.ig.$op.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},$type:new $.ig.Type("KpiDimension",$.ig.$ot,[$$t.$a.$type])},true);$c("Hierarchy:bk","Object",{init:function(){$.ig.$op.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_defaultHierarchy:null,defaultHierarchy:function(a){if(arguments.length===1){this._defaultHierarchy=a;return a}else{return this._defaultHierarchy}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_defaultMember:null,defaultMember:function(a){if(arguments.length===1){this._defaultMember=a;return a}else{return this._defaultMember}},_allMember:null,allMember:function(a){if(arguments.length===1){this._allMember=a;return a}else{return this._allMember}},_dimensionUniqueName:null,dimensionUniqueName:function(a){if(arguments.length===1){this._dimensionUniqueName=a;return a}else{return this._dimensionUniqueName
}},_hierarchyOrigin:0,hierarchyOrigin:function(a){if(arguments.length===1){this._hierarchyOrigin=a;return a}else{return this._hierarchyOrigin}},_hierarchyDisplayFolder:null,hierarchyDisplayFolder:function(a){if(arguments.length===1){this._hierarchyDisplayFolder=a;return a}else{return this._hierarchyDisplayFolder}},$type:new $.ig.Type("Hierarchy",$.ig.$ot,[$$t.$a.$type])},true);$c("Kpi:bl","Object",{init:function(){$.ig.$op.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_measureGroupName:null,measureGroupName:function(a){if(arguments.length===1){this._measureGroupName=a;return a}else{return this._measureGroupName}},_kpiDisplayFolder:null,kpiDisplayFolder:function(a){if(arguments.length===1){this._kpiDisplayFolder=a;return a}else{return this._kpiDisplayFolder}},_kpiValue:null,kpiValue:function(a){if(arguments.length===1){this._kpiValue=a;return a}else{return this._kpiValue}},_kpiGoal:null,kpiGoal:function(a){if(arguments.length===1){this._kpiGoal=a;return a}else{return this._kpiGoal}},_kpiStatus:null,kpiStatus:function(a){if(arguments.length===1){this._kpiStatus=a;return a}else{return this._kpiStatus}},_kpiTrend:null,kpiTrend:function(a){if(arguments.length===1){this._kpiTrend=a;return a}else{return this._kpiTrend}},_kpiStatusGraphic:null,kpiStatusGraphic:function(a){if(arguments.length===1){this._kpiStatusGraphic=a;return a}else{return this._kpiStatusGraphic}},_kpiTrendGraphic:null,kpiTrendGraphic:function(a){if(arguments.length===1){this._kpiTrendGraphic=a;return a}else{return this._kpiTrendGraphic}},_kpiWeight:null,kpiWeight:function(a){if(arguments.length===1){this._kpiWeight=a;return a}else{return this._kpiWeight}},_parentKpiName:null,parentKpiName:function(a){if(arguments.length===1){this._parentKpiName=a;return a}else{return this._parentKpiName}},_currentTimeMember:null,currentTimeMember:function(a){if(arguments.length===1){this._currentTimeMember=a;return a}else{return this._currentTimeMember}},$type:new $.ig.Type("Kpi",$.ig.$ot,[$$t.$a.$type])},true);$c("Level:bm","Object",{init:function(){$.ig.$op.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_depth:0,depth:function(a){if(arguments.length===1){this._depth=a;return a}else{return this._depth}},_hierarchyUniqueName:null,hierarchyUniqueName:function(a){if(arguments.length===1){this._hierarchyUniqueName=a;return a}else{return this._hierarchyUniqueName}},_dimensionUniqueName:null,dimensionUniqueName:function(a){if(arguments.length===1){this._dimensionUniqueName=a;return a}else{return this._dimensionUniqueName}},_membersCount:0,membersCount:function(a){if(arguments.length===1){this._membersCount=a;return a}else{return this._membersCount}},_levelOrigin:0,levelOrigin:function(a){if(arguments.length===1){this._levelOrigin=a;return a}else{return this._levelOrigin}},_levelOrderingProperty:null,levelOrderingProperty:function(a){if(arguments.length===1){this._levelOrderingProperty=a;return a}else{return this._levelOrderingProperty}},$type:new $.ig.Type("Level",$.ig.$ot,[$$t.$a.$type])},true);$c("Measure:bn","Object",{init:function(){$.ig.$op.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_measureGroupName:null,measureGroupName:function(a){if(arguments.length===1){this._measureGroupName=a;return a}else{return this._measureGroupName}},_aggregatorType:0,aggregatorType:function(a){if(arguments.length===1){this._aggregatorType=a;return a}else{return this._aggregatorType}},_defaultFormatString:null,defaultFormatString:function(a){if(arguments.length===1){this._defaultFormatString=a;return a}else{return this._defaultFormatString}},_measureDisplayFolder:null,measureDisplayFolder:function(a){if(arguments.length===1){this._measureDisplayFolder=a;return a}else{return this._measureDisplayFolder}},$type:new $.ig.Type("Measure",$.ig.$ot,[$$t.$a.$type])},true);$c("KpiMeasure:bo","Measure",{init:function(a,b){$$t.$bn.init.call(this);this.uniqueName(a);this.caption(b)},_graphic:null,graphic:function(a){if(arguments.length===1){this._graphic=a;return a}else{return this._graphic}},createKpiValueMeasure:function(a){return new $$t.bo(a.kpiValue(),a.caption()+" Value")},createKpiGoalMeasure:function(a){return new $$t.bo(a.kpiGoal(),a.caption()+" Goal")},createKpiWeightMeasure:function(a){return new $$t.bo(a.kpiWeight(),a.caption()+" Weight")},createKpiStatusMeasure:function(a){var b=new $$t.bo(a.kpiStatus(),a.caption()+" Status");b.graphic(a.kpiStatusGraphic());return b},createKpiTrendMeasure:function(a){var b=new $$t.bo(a.kpiTrend(),a.caption()+" Trend");b.graphic(a.kpiTrendGraphic());return b},$type:new $.ig.Type("KpiMeasure",$$t.$bn.$type)},true);$c("MeasureGroup:bp","Object",{init:function(){$.ig.$op.init.call(this)},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_cubeName:null,cubeName:function(a){if(arguments.length===1){this._cubeName=a;return a}else{return this._cubeName}},_catalogName:null,catalogName:function(a){if(arguments.length===1){this._catalogName=a;return a}else{return this._catalogName}},uniqueName:function(a){if(arguments.length===1){this.name(a);return a}else{return this.name()}},$type:new $.ig.Type("MeasureGroup",$.ig.$ot,[$$t.$a.$type])},true);$c("MeasureGroupDimension:bq","Object",{init:function(){$.ig.$op.init.call(this)},_cubeName:null,cubeName:function(a){if(arguments.length===1){this._cubeName=a;return a}else{return this._cubeName}},_catalogName:null,catalogName:function(a){if(arguments.length===1){this._catalogName=a;return a}else{return this._catalogName}},_measureGroupName:null,measureGroupName:function(a){if(arguments.length===1){this._measureGroupName=a;return a}else{return this._measureGroupName}},_dimensionUniqueName:null,dimensionUniqueName:function(a){if(arguments.length===1){this._dimensionUniqueName=a;return a}else{return this._dimensionUniqueName}},_measureGroupCardinality:0,measureGroupCardinality:function(a){if(arguments.length===1){this._measureGroupCardinality=a;return a}else{return this._measureGroupCardinality}},_dimensionCardinality:0,dimensionCardinality:function(a){if(arguments.length===1){this._dimensionCardinality=a;return a}else{return this._dimensionCardinality}},_isDimensionVisible:false,isDimensionVisible:function(a){if(arguments.length===1){this._isDimensionVisible=a;return a}else{return this._isDimensionVisible}},_isFactDimension:false,isFactDimension:function(a){if(arguments.length===1){this._isFactDimension=a;return a}else{return this._isFactDimension}},_dimensionPath:null,dimensionPath:function(a){if(arguments.length===1){this._dimensionPath=a;return a}else{return this._dimensionPath}},_dimensionGranularity:null,dimensionGranularity:function(a){if(arguments.length===1){this._dimensionGranularity=a;return a}else{return this._dimensionGranularity}},$type:new $.ig.Type("MeasureGroupDimension",$.ig.$ot)},true);$c("Member:br","Object",{init:function(){$.ig.$op.init.call(this);var a=$l($.ig.Number.prototype.$type,null);this.scope(a)},_cubeName:null,cubeName:function(a){if(arguments.length===1){this._cubeName=a;return a}else{return this._cubeName}},_catalogName:null,catalogName:function(a){if(arguments.length===1){this._catalogName=a;return a}else{return this._catalogName}},_dimensionUniqueName:null,dimensionUniqueName:function(a){if(arguments.length===1){this._dimensionUniqueName=a;return a}else{return this._dimensionUniqueName}},_hierarchyUniqueName:null,hierarchyUniqueName:function(a){if(arguments.length===1){this._hierarchyUniqueName=a;return a}else{return this._hierarchyUniqueName}},_levelUniqueName:null,levelUniqueName:function(a){if(arguments.length===1){this._levelUniqueName=a;return a}else{return this._levelUniqueName}},_levelDepth:0,levelDepth:function(a){if(arguments.length===1){this._levelDepth=a;return a}else{return this._levelDepth}},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_memberType:0,memberType:function(a){if(arguments.length===1){this._memberType=a;return a}else{return this._memberType}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_childrenCardinality:0,childrenCardinality:function(a){if(arguments.length===1){this._childrenCardinality=a;return a}else{return this._childrenCardinality}},_parentLevel:0,parentLevel:function(a){if(arguments.length===1){this._parentLevel=a;return a}else{return this._parentLevel}},_parentUniqueName:null,parentUniqueName:function(a){if(arguments.length===1){this._parentUniqueName=a;return a}else{return this._parentUniqueName}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_scope:$l($.ig.Number.prototype.$type,null),scope:function(a){if(arguments.length===1){this._scope=a;return a}else{return this._scope}},$type:new $.ig.Type("Member",$.ig.$ot,[$$t.$a.$type])},true);$c("OlapResult:bt","Object",{init:function(){$.ig.$op.init.call(this)},_isEmpty:false,isEmpty:function(a){if(arguments.length===1){this._isEmpty=a;return a}else{return this._isEmpty}},_axes:null,axes:function(a){if(arguments.length===1){this._axes=a;return a}else{return this._axes}},_cells:null,cells:function(a){if(arguments.length===1){this._cells=a;return a}else{return this._cells}},$type:new $.ig.Type("OlapResult",$.ig.$ot)},true);$c("OlapResultAxis:bw","Object",{init:function(a,b){$.ig.$op.init.call(this);this.tuples($$t.$cp.y($$t.$c9.$type,a));this.tupleSize(b);this.positionResolver(new $$t.bx(String,$.ig.$op.$type,a,b))},_positionResolver:null,positionResolver:function(a){if(arguments.length===1){this._positionResolver=a;return a}else{return this._positionResolver}},clone:function(){var $self=this;var a=new $$t.by($$t.$c9.$type,0);var c=this.tuples().getEnumerator();while(c.moveNext()){var b=c.current();a.add(b.clone())}return function(){var $ret=new $$t.bw(a,$self.tupleSize());$ret.name($self.name());return $ret}()},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_tupleSize:0,tupleSize:function(a){if(arguments.length===1){this._tupleSize=a;return a}else{return this._tupleSize}},_tuples:null,tuples:function(a){if(arguments.length===1){this._tuples=a;return a}else{return this._tuples}},$type:new $.ig.Type("OlapResultAxis",$.ig.$ot)},true);$c("IPosition$2:ch","Object",{$type:new $.ig.Type("IPosition$2",null)},true);$c("OlapResultTuple:c9","Object",{init:function(a){$.ig.$op.init.call(this);this.members(new $$t.ce($$t.$da.$type,1,a))},_members:null,members:function(a){if(arguments.length===1){this._members=a;return a}else{return this._members}},getItems:function(){return this.members()},itemsCount:function(){return this.members().count()},indexOf:function(a){return this.members().indexOf(a)},item:function(a){return this.members().item(a)},isEmpty:function(){return false},clone:function(){var a=new $$t.by($$t.$da.$type,0);var c=this.members().getEnumerator();while(c.moveNext()){var b=c.current();a.add(b.clone())}var d=new $$t.c9(a);var f=a.getEnumerator();while(f.moveNext()){var e=f.current();e.position(d)}return d},$type:new $.ig.Type("OlapResultTuple",$.ig.$ot,[$$t.$ch.$type.specialize(String,$.ig.$op.$type)])},true);$c("IPositionItem$2:ci","Object",{$type:new $.ig.Type("IPositionItem$2",null)},true);$c("IHierarchicalPositionItem$2:c2","Object",{$type:new $.ig.Type("IHierarchicalPositionItem$2",null,[$$t.$ci.$type.specialize(0,1)])},true);$c("OlapResultAxisMember:da","Object",{init:function(){$.ig.$op.init.call(this);this.properties(new $$t.ck(String,String,0));this.ordinal(-1)},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_levelUniqueName:null,levelUniqueName:function(a){if(arguments.length===1){this._levelUniqueName=a;return a}else{return this._levelUniqueName}},_hierarchyUniqueName:null,hierarchyUniqueName:function(a){if(arguments.length===1){this._hierarchyUniqueName=a;return a}else{return this._hierarchyUniqueName}},_levelNumber:0,levelNumber:function(a){if(arguments.length===1){this._levelNumber=a;return a}else{return this._levelNumber}},_displayInfo:0,displayInfo:function(a){if(arguments.length===1){this._displayInfo=a;return a}else{return this._displayInfo}},e:function(){return $n(this.displayInfo(),~65536)&~131072},drilledDown:function(){return(this.displayInfo()&65536)==65536},parentSameAsPrev:function(){return(this.displayInfo()&131072)==131072},_properties:null,properties:function(a){if(arguments.length===1){this._properties=a;return a}else{return this._properties}},_position:null,position:function(a){if(arguments.length===1){this._position=a;return a}else{return this._position}},key:function(){return this.uniqueName()},sortKey:function(){if(this.ordinal()>-1){return this.ordinal()}if(this.caption().contains("/")){return this.caption()}var a=parseFloat(this.caption());if(!isNaN(a)){return a}return this.caption()},_ordinal:0,ordinal:function(a){if(arguments.length===1){this._ordinal=a;return a}else{return this._ordinal}},hierarchyKey:function(){return this.hierarchyUniqueName()},hierarchyLevelKey:function(){return this.levelUniqueName()},parentKey:function(){var a;var b=this.properties().tryGetValue("PARENT_UNIQUE_NAME",a);a=b.p1;return a},depth:function(){return this.levelNumber()},isExpandable:function(){return this.e()>0},clone:function(){var a=new $$t.da;a.caption(this.caption());a.displayInfo(this.displayInfo());a.hierarchyUniqueName(this.hierarchyUniqueName());a.levelNumber(this.levelNumber());a.levelUniqueName(this.levelUniqueName());a.ordinal(this.ordinal());var c=this.properties().getEnumerator();while(c.moveNext()){var b=c.current();a.properties().add(b.key(),b.value())}a.uniqueName(this.uniqueName());a.position(this.position());return a},$type:new $.ig.Type("OlapResultAxisMember",$.ig.$ot,[$$t.$c2.$type.specialize(String,$.ig.$op.$type)])},true);$c("OlapResultCell:db","Object",{init:function(){$.ig.$op.init.call(this);this.properties(new $$t.ck(String,$.ig.$op.$type,0))},_cellOrdinal:0,cellOrdinal:function(a){if(arguments.length===1){this._cellOrdinal=a;return a}else{return this._cellOrdinal}},_properties:null,properties:function(a){if(arguments.length===1){this._properties=a;return a}else{return this._properties}},clone:function(){var $self=this;var a=function(){var $ret=new $$t.db;$ret.cellOrdinal($self.cellOrdinal());return $ret}();var c=this.properties().getEnumerator();while(c.moveNext()){var b=c.current();a.properties().add(b.key(),b.value())}return a},$type:new $.ig.Type("OlapResultCell",$.ig.$ot)},true);$c("IConnection:dc","Object",{$type:new $.ig.Type("IConnection",null)},true);$c("IOlapDataProviderFactory:dd","Object",{$type:new $.ig.Type("IOlapDataProviderFactory",null)},true);$c("IOlapDiscoverDataProvider:de","Object",{$type:new $.ig.Type("IOlapDiscoverDataProvider",null)},true);$c("IOlapExecuteCommandProvider:d5","Object",{$type:new $.ig.Type("IOlapExecuteCommandProvider",null)},true);$c("LevelSpanManager:d7","Object",{a:null,init:function(a){$.ig.$op.init.call(this);this.c(a);this.a=new Array(a)},_c:0,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},b:function(a,b){var c=this.a[a];if(c==null){c=new $$t.ck($.ig.Number.prototype.$type,$$t.$d8.$type,0);this.a[a]=c}var d;if(!function(){var e=c.tryGetValue(b,d);d=e.p1;return e.ret}()){d=new $$t.d8;if(b>0){var e;if(function(){var f=c.tryGetValue(b-1,e);e=f.p1;return f.ret}()){d.a(e);e.e()}}c.add(b,d)}return d},$type:new $.ig.Type("LevelSpanManager",$.ig.$ot)},true);$c("SpanSource:d8","Object",{init:function(){$.ig.$op.init.call(this);this.c=1},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},c:0,d:function(a){if(arguments.length===1){if(this.c!=a){var b=a-this.c;if(this.a()!=null){this.a().d(this.a().d()+b)}this.c=a}return a}else{return this.c}},b:false,e:function(){if(!this.b){this.b=true;this.d(this.d()+1)}},$type:new $.ig.Type("SpanSource",$.ig.$ot)},true);$c("ITableViewHeadersFactory:d9","Object",{$type:new $.ig.Type("ITableViewHeadersFactory",null)},true);$c("TableViewHeadersFactory:eb","Object",{_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_c:0,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_d:false,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},init:function(a,b,c,d,e){$.ig.$op.init.call(this);this.b(a);this.a(b);this.c(c);this.d(d);this.e(e)},createHeaderCells:function(){var $self=this;if(this.b().positionResolver().hasUnregisterdPositions()){this.b().positionResolver().completeRegisterPositions()}var a=this.b().positionResolver().rootPositionInfo();var b=new $$t.by($$t.$bu.$type.specialize($$t.$eh.$type),0);for(var c=0;c<a.positionSize();c++){b.add(new $$t.by($$t.$eh.$type,0))}$$t.$eb.createHeaderCells2(a,a.positionItemDepthMin(),b,this.d(),this.e());var d=new $$t.ec($$t.$ea.$type);var e=0;for(var f=0;f<a.positionSize();f++){var g=b.item(f);var h=0;var i=0;var k=g.getEnumerator();while(k.moveNext()){var j=k.current();var l;var m;var n;var o;if(this.c()==0){l=h;m=j.c().d();n=j.b().positionItemDepth()+e;o=j.d().d()}else{n=h;o=j.c().d();l=j.b().positionItemDepth()+e;m=j.d().d()}var p=this.b().tuples().__inner[j.b().positionIndex()];var q=p.item(j.b().positionItemIndex());var r=this.b().tuples().__inner[j.l()];if(this.a().positionResolver().hasUnregisterdPositions()){this.a().positionResolver().completeRegisterPositions()}var s=this.a().positionResolver().getPositionIndex(r);var t=function(){var $ret=new $$t.ea;$ret.axisName($self.b().name());$ret.hierarchyNumber(j.b().positionItemIndex());$ret.levelNumber(j.b().positionItemDepth());$ret.caption(q.caption());$ret.columnIndex(l);$ret.columnSpan(m);$ret.isExpanded(j.g());$ret.isExpandable(j.f());$ret.tupleIndex(s);$ret.memberIndex(j.b().positionItemIndex());$ret.rowIndex(n);$ret.rowSpan(o);return $ret}();if(!j.h()){h=h+j.c().d()}i=Math.max(i,j.b().positionItemDepth());d.add(t)}e+=i+1}return d},createHeaderCells2:function(a,b,c,d,e){var f=new $$t.d7(a.positionSize());var h=$$t.$cp.t($$t.$cj.$type.specialize(String,$.ig.$op.$type),a.values(),function(i){return i.positionItemDepth()==b}).getEnumerator();while(h.moveNext()){var g=h.current();var i;var j;var k=$$t.$eb.createHeaderCells1(a,g,c,f,d,e,i,j);i=k.p6;j=k.p7}},h:function(a,b,c,d,e,f){var g=$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.t($$t.$cj.$type.specialize(String,$.ig.$op.$type),a.values(),function(h){return h.positionItemDepth()==a.positionItemDepthMin()}));if(g.count()>0){var i=g.getEnumerator();while(i.moveNext()){var h=i.current();var j;var k;var l=$$t.$eb.createHeaderCells1(a,h,b,c,d,f,j,k);j=l.p6;k=l.p7;e.c().d(e.c().d()+k);if(j.h()){e.c().d(e.c().d()+1)}}e.c().d(e.c().d()-1)}else{f.add(a.positionIndex())}e.l(a.positionIndex())},createHeaderCells1:function(a,b,c,d,e,f,g,h){var i=c.item(b.positionItemIndex());var j=d.b(b.positionItemIndex(),b.positionItemDepth());var k=function(){var $ret=new $$t.eh;$ret.d(j);$ret.b(b);$ret.a(a);$ret.f(b.isExpandable());return $ret}();g=k;if(e){i.add(k);$$t.$eb.h(b,c,d,true,k,f)}var l=null;if(b.isExpanded()){l=$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.t($$t.$cj.$type.specialize(String,$.ig.$op.$type),a.values(),function(m){return m.parentKey()==b.key()}))}if(l!=null&&l.count()>0){var m=function(){var $ret=new $$t.eh;$ret.h(true);$ret.b(b);$ret.f(b.isExpandable());return $ret}();i.add(m);var o=l.getEnumerator();while(o.moveNext()){var n=o.current();var p;var q;var r=$$t.$eb.createHeaderCells1(a,n,c,d,e,f,p,q);p=r.p6;q=r.p7;m.c().d(m.c().d()+q);if(p.h()){m.c().d(m.c().d()+1)}}m.c().d(m.c().d()-1);k.g(true);k.f(false);m.g(true);k.e(m);if(!e){i.add(k);$$t.$eb.h(b,c,d,false,k,f)}m.l(k.l());g=m;h=k.c().d()+m.c().d()-1}else{if(b.isExpanded()){k.f(false)}if(!e){i.add(k);$$t.$eb.h(b,c,d,false,k,f)}h=k.c().d()}return{p6:g,p7:h}},$type:new $.ig.Type("TableViewHeadersFactory",$.ig.$ot,[$$t.$d9.$type])},true);$c("TableSuperCompactViewHeadersFactory:ei","Object",{_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_c:0,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_d:false,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},init:function(a,b,c,d,e){$.ig.$op.init.call(this);this.b(a);this.a(b);this.c(c);this.d(d);this.e(e)},createHeaderCells:function(){var $self=this;if(this.b().positionResolver().hasUnregisterdPositions()){this.b().positionResolver().completeRegisterPositions()}var a=this.b().positionResolver().rootPositionInfo();var b=new $$t.by($$t.$bu.$type.specialize($$t.$eh.$type),0);for(var c=0;c<a.positionSize();c++){b.add(new $$t.by($$t.$eh.$type,0))}$$t.$ei.createHeaderCells2(a,a.positionItemDepthMin(),b,this.d(),this.e());var d=new $$t.ec($$t.$ea.$type);var e=0;for(var f=0;f<a.positionSize();f++){var g=b.item(f);var h=0;var i=0;var k=g.getEnumerator();while(k.moveNext()){var j=k.current();var l;var m;var n;var o;if(this.c()==0){l=h;m=j.c().d();n=e;o=1}else{n=h;o=j.c().d();l=e;m=1}var p=this.b().tuples().__inner[j.b().positionIndex()];var q=p.item(j.b().positionItemIndex());var r=this.b().tuples().__inner[j.l()];if(this.a().positionResolver().hasUnregisterdPositions()){this.a().positionResolver().completeRegisterPositions()}var s=this.a().positionResolver().getPositionIndex(r);var t=function(){var $ret=new $$t.ea;$ret.axisName($self.b().name());$ret.hierarchyNumber(j.b().positionItemIndex());$ret.levelNumber(j.b().positionItemDepth());$ret.caption(q.caption());$ret.columnIndex(l);$ret.columnSpan(m);$ret.isExpanded(j.g());$ret.isExpandable(j.f());$ret.tupleIndex(s);$ret.memberIndex(j.b().positionItemIndex());$ret.rowIndex(n);$ret.rowSpan(o);return $ret}();if(!j.h()){h=h+j.c().d()}d.add(t)}e+=i+1}return d},createHeaderCells2:function(a,b,c,d,e){var f=new $$t.d7(a.positionSize());var h=$$t.$cp.t($$t.$cj.$type.specialize(String,$.ig.$op.$type),a.values(),function(i){return i.positionItemDepth()==b}).getEnumerator();while(h.moveNext()){var g=h.current();var i;var j;var k=$$t.$ei.createHeaderCells1(a,g,c,f,d,e,i,j);i=k.p6;j=k.p7}},h:function(a,b,c,d,e,f){var g=$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.t($$t.$cj.$type.specialize(String,$.ig.$op.$type),a.values(),function(h){return h.positionItemDepth()==a.positionItemDepthMin()}));if(g.count()>0){var i=g.getEnumerator();while(i.moveNext()){var h=i.current();var j;var k;var l=$$t.$ei.createHeaderCells1(a,h,b,c,d,f,j,k);j=l.p6;k=l.p7;e.c().d(e.c().d()+k);if(j.e()!=null){e.c().d(e.c().d()+1)}}e.c().d(e.c().d()-1)}else{f.add(a.positionIndex())}e.l(a.positionIndex())},createHeaderCells1:function(a,b,c,d,e,f,g,h){var i=c.item(b.positionItemIndex());var j=d.b(b.positionItemIndex(),b.positionItemDepth());var k=function(){var $ret=new $$t.eh;$ret.d(j);$ret.b(b);$ret.f(b.isExpandable());return $ret}();g=k;if(e){i.add(k);$$t.$ei.h(b,c,d,true,k,f)}var l=null;if(b.isExpanded()){l=$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.t($$t.$cj.$type.specialize(String,$.ig.$op.$type),a.values(),function(m){return m.parentKey()==b.key()}))}if(l!=null&&l.count()>0){var m=function(){var $ret=new $$t.eh;$ret.h(true);$ret.b(b);$ret.f(b.isExpandable());return $ret}();var o=l.getEnumerator();while(o.moveNext()){var n=o.current();var p;var q;var r=$$t.$ei.createHeaderCells1(a,n,c,d,e,f,p,q);p=r.p6;q=r.p7;m.c().d(m.c().d()+q);if(p.e()!=null){m.c().d(m.c().d()+1)}}m.c().d(m.c().d()-1);k.g(true);k.f(true);k.e(m);if(!e){i.add(k);$$t.$ei.h(b,c,d,false,k,f)}m.l(k.l());h=k.c().d()+m.c().d()-1}else{if(b.isExpanded()){k.f(false)}if(!e){i.add(k);$$t.$ei.h(b,c,d,false,k,f)}h=k.c().d()}return{p6:g,p7:h}},$type:new $.ig.Type("TableSuperCompactViewHeadersFactory",$.ig.$ot,[$$t.$d9.$type])},true);$c("TableViewHeaderCellSource:eh","Object",{init:function(){$.ig.$op.init.call(this);this.c(new $$t.d8);this.d(new $$t.d8)},_h:false,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},_k:0,k:function(a){if(arguments.length===1){this._k=a;return a}else{return this._k}},_i:0,i:function(a){if(arguments.length===1){this._i=a;return a}else{return this._i}},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_l:0,l:function(a){if(arguments.length===1){this._l=a;return a}else{return this._l}},_j:0,j:function(a){if(arguments.length===1){this._j=a;return a}else{return this._j}},_g:false,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},_f:false,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},toString:function(){return $x("{0}-{1}",this.b().positionIndex(),this.b().positionItemIndex())},$type:new $.ig.Type("TableViewHeaderCellSource",$.ig.$ot)},true);$c("TreeStackAttributesBehavior:ej","Object",{init:function(){$.ig.$op.init.call(this)},a:function(a,b){},$type:new $.ig.Type("TreeStackAttributesBehavior",$.ig.$ot)},true);$c("TreeStackNextDimensionFirstBehavior:em","TreeStackAttributesBehavior",{init:function(a,b){$$t.$ej.init.call(this);this.b(a);this.c(b)},_b:0,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_c:0,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},a:function(a,b){if(a.memberIndex()<b.memberIndex()){return true}if(a.memberIndex()==b.memberIndex()){if(a.levelNumber()<=b.levelNumber()){return true}}if(a.memberIndex()>b.memberIndex()&&a.parentMemberLevelNumber()<b.levelNumber()){return true}return false},$type:new $.ig.Type("TreeStackNextDimensionFirstBehavior",$$t.$ej.$type)},true);$c("TableViewTreeHeadersFactory:en","Object",{_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_c:0,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_d:false,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},_f:0,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},_g:0,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},init:function(a,b,c,d,e,f){$.ig.$op.init.call(this);this.b(a);this.a(b);this.c(c);this.d(true);this.e(d);this.f(e);this.g(f)},createHeaderCells:function(){var $self=this;if(this.b().positionResolver().hasUnregisterdPositions()){this.b().positionResolver().completeRegisterPositions()}var a=this.b().positionResolver().rootPositionInfo();var b=new $$t.by($$t.$eh.$type,0);$$t.$en.createHeaderCells2(a,a.positionItemDepthMin(),b,this.e());var c=new $$t.ck(String,$$t.$ea.$type,0);var d=new $$t.eo($$t.$ek.$type);var e=new $$t.ec($$t.$ea.$type);var f=0;var h=b.getEnumerator();while(h.moveNext()){var g=h.current();if(g.h()){continue}var i=this.b().tuples().__inner[g.b().positionIndex()];var j=i.item(g.b().positionItemIndex());var k=this.b().tuples().__inner[g.l()];if(this.a().positionResolver().hasUnregisterdPositions()){this.a().positionResolver().completeRegisterPositions()}var l=this.a().positionResolver().getPositionIndex(k);var m=function(){var $ret=new $$t.ek;$ret.axisName($self.b().name());$ret.hierarchyNumber(g.b().positionItemIndex());$ret.levelNumber(g.b().positionItemDepth());$ret.parentMemberLevelNumber(g.a().positionItemDepth());$ret.caption(j.caption());$ret.columnIndex(0);$ret.columnSpan(1);$ret.isExpanded(g.g());$ret.isExpandable(g.f());$ret.tupleIndex(l);$ret.memberIndex(g.b().positionItemIndex());$ret.rowIndex(f);$ret.rowSpan(1);return $ret}();c.add($x("{0}-{1}",m.tupleIndex(),m.memberIndex()),m);var n=g.b().positionItemIndex()>0&&g.b().positionItemDepth()==0;if(!g.h()&&!n){f=f+1}if(!n){e.add(m);this.m(d,m,new $$t.em(this.f(),this.g()))}}var p=e.getEnumerator();while(p.moveNext()){var o=p.current();if(o.memberIndex()<this.b().tupleSize()){var q=$x("{0}-{1}",o.tupleIndex(),o.memberIndex()+1);var r=null;if(function(){var s=c.tryGetValue(q,r);r=s.p1;return s.ret}()){o.isItemExpanded(r.isExpanded());o.isItemExpandable(r.isExpandable())}}}return e},m:function(a,b,c){var d=null;if(a.count()==0){this.l(a,b,null);return}d=a.peek();if(c.a(b,d)){this.h(a,b,c);d=null;if(a.count()>0){d=a.peek()}}this.l(a,b,d)},l:function(a,b,c){if(c!=null){if(b.memberIndex()>c.memberIndex()){b.indent(c.indent()+this.g())}else{b.indent(c.indent()+this.f())}}a.push(b)},h:function(a,b,c){a.pop();if(a.count()>0){var d=a.peek();if(c.a(b,d)){this.h(a,b,c)}}},createHeaderCells2:function(a,b,c,d){var e=new $$t.d7(a.positionSize());var g=$$t.$cp.t($$t.$cj.$type.specialize(String,$.ig.$op.$type),a.values(),function(h){return h.positionItemDepth()==b}).getEnumerator();while(g.moveNext()){var f=g.current();var h;var i;var j=$$t.$en.createHeaderCells1(a,f,c,e,d,true,h,i);h=j.p6;i=j.p7}},k:function(a,b,c,d,e,f){var g=$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.t($$t.$cj.$type.specialize(String,$.ig.$op.$type),a.values(),function(h){return h.positionItemDepth()==a.positionItemDepthMin()}));if(g.count()>0){var i=g.getEnumerator();while(i.moveNext()){var h=i.current();var j;var k;var l=$$t.$en.createHeaderCells1(a,h,b,c,e,f,j,k);j=l.p6;k=l.p7;d.c().d(d.c().d()+k);if(j.h()){d.c().d(d.c().d()+1)}}d.c().d(d.c().d()-1)}d.l(a.positionIndex())},createHeaderCells1:function(a,b,c,d,e,f,g,h){var i=c;var j=d.b(b.positionItemIndex(),b.positionItemDepth());var k=function(){var $ret=new $$t.eh;$ret.d(j);$ret.b(b);$ret.a(a);$ret.f(b.isExpandable());return $ret}();g=k;i.add(k);if(f){f=false;e.add(b.positionIndex())}var l=null;if(b.isExpanded()){l=$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.t($$t.$cj.$type.specialize(String,$.ig.$op.$type),a.values(),function(m){return m.parentKey()==b.key()
}))}if(l!=null&&l.count()>0){var m=function(){var $ret=new $$t.eh;$ret.h(true);$ret.b(b);$ret.a(a);$ret.f(b.isExpandable());return $ret}();i.add(m);var o=l.getEnumerator();while(o.moveNext()){var n=o.current();var p;var q;var r=$$t.$en.createHeaderCells1(a,n,c,d,e,true,p,q);p=r.p6;q=r.p7;m.c().d(m.c().d()+q);if(p.h()){m.c().d(m.c().d()+1)}}m.c().d(m.c().d()-1);k.g(true);m.g(true);k.e(m);m.l(k.l());g=m;h=k.c().d()+m.c().d()-1}else{h=k.c().d()}$$t.$en.k(b,c,d,k,e,false);return{p6:g,p7:h}},$type:new $.ig.Type("TableViewTreeHeadersFactory",$.ig.$ot,[$$t.$d9.$type])},true);$c("TableViewImpl:eq","Object",{init:function(a,b,c,d){var $self=this;this.w=40;this.x=20;$.ig.$op.init.call(this);if(a==null){throw new $$t.cv(0,"result")}this.result(a);this.originalResult(a);if(d==null){this.viewSettings(new $$t.er)}else{this.viewSettings(d)}this.hasColumns(b);this.hasRows(c);this.columnSortDirections(new $$t.ec($$t.$eu.$type));var e=this.columnSortDirections();e.collectionChanged=$.ig.Delegate.prototype.combine(e.collectionChanged,function(e,f){$self.i(true)});this.levelSortDirections(new $$t.ec($$t.$ev.$type));var f=this.levelSortDirections();f.collectionChanged=$.ig.Delegate.prototype.combine(f.collectionChanged,function(f,g){$self.i(true)});this.appliedColumnSortDirections(new $$t.by($$t.$eu.$type,0));this.appliedLevelSortDirections(new $$t.by($$t.$ev.$type,0));this.appliedSortDirectionsMap(new $$t.ck(String,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$$t.$c8.$type)),0))},_viewSettings:null,viewSettings:function(a){if(arguments.length===1){this._viewSettings=a;return a}else{return this._viewSettings}},_result:null,result:function(a){if(arguments.length===1){this._result=a;return a}else{return this._result}},_originalResult:null,originalResult:function(a){if(arguments.length===1){this._originalResult=a;return a}else{return this._originalResult}},_hasRows:false,hasRows:function(a){if(arguments.length===1){this._hasRows=a;return a}else{return this._hasRows}},_hasColumns:false,hasColumns:function(a){if(arguments.length===1){this._hasColumns=a;return a}else{return this._hasColumns}},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_h:false,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},_i:false,i:function(a){if(arguments.length===1){this._i=a;return a}else{return this._i}},m:null,k:null,l:null,rowHeaders:function(a){if(arguments.length===1){this.m=a;return a}else{if(!this.h()||this.i()){this.initialize()}return this.m}},columnHeaders:function(a){if(arguments.length===1){this.k=a;return a}else{if(!this.h()||this.i()){this.initialize()}return this.k}},resultCells:function(a){if(arguments.length===1){this.l=a;return a}else{if(!this.h()||this.i()){this.initialize()}return this.l}},_columnSortDirections:null,columnSortDirections:function(a){if(arguments.length===1){this._columnSortDirections=a;return a}else{return this._columnSortDirections}},_levelSortDirections:null,levelSortDirections:function(a){if(arguments.length===1){this._levelSortDirections=a;return a}else{return this._levelSortDirections}},_appliedColumnSortDirections:null,appliedColumnSortDirections:function(a){if(arguments.length===1){this._appliedColumnSortDirections=a;return a}else{return this._appliedColumnSortDirections}},_appliedLevelSortDirections:null,appliedLevelSortDirections:function(a){if(arguments.length===1){this._appliedLevelSortDirections=a;return a}else{return this._appliedLevelSortDirections}},_appliedSortDirectionsMap:null,appliedSortDirectionsMap:function(a){if(arguments.length===1){this._appliedSortDirectionsMap=a;return a}else{return this._appliedSortDirectionsMap}},initialize:function(){this.d(null);this.c(null);this.rowHeaders(null);this.columnHeaders(null);this.resultCells(null);this.result(this.originalResult());if(this.result().isEmpty()){this.i(false);this.h(true);return}if(this.levelSortDirections().count()>0){var a=new $$t.ex(this.result(),this.hasRows(),this.hasColumns(),this.levelSortDirections());this.result(a.b());this.appliedLevelSortDirections(a.h());this.appliedSortDirectionsMap(a.g())}else{this.appliedLevelSortDirections(new $$t.by($$t.$ev.$type,0));this.appliedSortDirectionsMap(new $$t.ck(String,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$$t.$c8.$type)),0))}if(this.hasRows()&&this.columnSortDirections().count()>0){if(this.appliedLevelSortDirections().count()>0){if(this.originalResult().axes().item(0).positionResolver().hasUnregisterdPositions()){this.originalResult().axes().item(0).positionResolver().completeRegisterPositions()}if(this.result().axes().item(0).positionResolver().hasUnregisterdPositions()){this.result().axes().item(0).positionResolver().completeRegisterPositions()}var b=new $$t.by($$t.$eu.$type,2,this.columnSortDirections().count());var c=new $$t.ck($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,1,this.appliedColumnSortDirections().count());var e=this.columnSortDirections().getEnumerator();while(e.moveNext()){var d=e.current();var f=this.originalResult().axes().item(0).tuples().__inner[d.tupleIndex()];var g=this.result().axes().item(0).positionResolver().getPositionIndex(f);var h=new $$t.eu;h.sortDirection(d.sortDirection());h.tupleIndex(g);h.comparer(d.comparer());b.add(h);c.item(g,d.tupleIndex())}var i=new $$t.e1(this.result(),this.hasRows(),this.hasColumns(),b);this.result(i.b());var k=i.g().getEnumerator();while(k.moveNext()){var j=k.current();j.tupleIndex(c.item(j.tupleIndex()))}this.appliedColumnSortDirections(i.g())}else{var l=new $$t.e1(this.result(),this.hasRows(),this.hasColumns(),this.columnSortDirections());this.result(l.b());this.appliedColumnSortDirections(l.g())}}else{this.appliedColumnSortDirections(new $$t.by($$t.$eu.$type,0))}var m=0;var n=new $$t.ck($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);var o=1;if(this.hasColumns()){var p=this.result().axes().item(m);var q=this.originalResult().axes().item(m);var r=this.r(p,q);for(var s=0;s<r.count();s++){var t=r.item(s);n.add(t,s)}m++;o=p.tuples().count()}var u=new $$t.ck($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);if(this.hasRows()){var v=this.result().axes().item(m);var w=this.originalResult().axes().item(m);var x=this.s(v,w);for(var y=0;y<x.count();y++){var z=x.item(y);u.add(z,y)}}var aa=new $$t.ec($$t.$et.$type);for(var ab=0;ab<this.result().cells().count();ab++){var ac=this.result().cells().item(ab);var ad;var ae=ac.properties().tryGetValue("Value",ad);ad=ae.p1;var af;var ag=ac.properties().tryGetValue("FmtValue",af);af=ag.p1;var ah=ac.cellOrdinal();if(this.hasColumns()){var ai=ah%o;var aj=n.item(ai);if(ai!=aj){var ak=$a(ah,o);ah=ak*o+aj}}if(this.hasRows()){var al=$a(ah,o);var am=u.item(al);if(al!=am){var an=ah%o;ah=am*o+an}}aa.add(function(){var $ret=new $$t.et;$ret.value(ad);$ret.formattedValue(af);$ret.cellOrdinal(ah);$ret.resultCellIndex(ab);return $ret}());this.resultCells(aa)}this.i(false);this.h(true)},r:function(a,b){var c=new $$t.by($.ig.Number.prototype.$type,0);if(this.viewSettings().b()){this.c(new $$t.ei(a,b,0,this.viewSettings().c(),c))}else{this.c(new $$t.eb(a,b,0,this.viewSettings().c(),c))}this.columnHeaders(this.c().createHeaderCells());return c},w:0,x:0,s:function(a,b){var c=new $$t.by($.ig.Number.prototype.$type,0);var d=this.viewSettings().a();var e=this.viewSettings().d();switch(d){case 0:this.d(new $$t.eb(a,b,1,e,c));break;case 1:this.d(new $$t.ei(a,b,1,e,c));break;case 2:var f=this.w;var g=this.x;var h=$b($$t.$e3.$type,this.viewSettings());if(h!=null){f=h.e();g=h.f()}this.d(new $$t.en(a,b,1,c,f,g));break}this.rowHeaders(this.d().createHeaderCells());return c},$type:new $.ig.Type("TableViewImpl",$.ig.$ot)},true);$c("OlapResultView:e4","Object",{init:function(a,b,c,d){$.ig.$op.init.call(this);if(a==null){throw new $$t.cv(0,"result")}this.result(a);this.visibleResult(b);this.hasColumns(c);this.hasRows(d)},_result:null,result:function(a){if(arguments.length===1){this._result=a;return a}else{return this._result}},_visibleResult:null,visibleResult:function(a){if(arguments.length===1){this._visibleResult=a;return a}else{return this._visibleResult}},_hasRows:false,hasRows:function(a){if(arguments.length===1){this._hasRows=a;return a}else{return this._hasRows}},_hasColumns:false,hasColumns:function(a){if(arguments.length===1){this._hasColumns=a;return a}else{return this._hasColumns}},c:function(a,b,c,d,e){var f=0;var g=null;var h=1;if(e){g=a.axes().item(f);h=g.tuples().count();f++}var i=null;var j=1;if(d){i=a.axes().item(f);j=i.tuples().count()}var k=1;if(b!=null){k=b.tuples().count()}var l=1;if(c!=null){l=c.tuples().count()}var m=new Array(k*l);if(a.cells().count()>0){var n=0;var o=a.cells().item(n);for(var p=0;p<j;p++){var q=$a(o.cellOrdinal(),h);if(q!=p){continue}var r=0;if(b!=null&&i!=null){var s=i.tuples().__inner[p];r=b.positionResolver().getPositionIndex(s)}if(r==-1){while(q==p){n++;if(n<a.cells().count()){o=a.cells().item(n);q=$a(o.cellOrdinal(),h)}else{break}}continue}var t=o.cellOrdinal()%h;for(var u=0;u<h;u++){if(t!=u){continue}var v=-1;if(c==null||g==null){v=0}else{var w=g.tuples().__inner[u];v=c.positionResolver().getPositionIndex(w)}if(v==-1){n++;if(n<a.cells().count()){o=a.cells().item(n);q=$a(o.cellOrdinal(),h);if(q>p){break}t=o.cellOrdinal()%h}continue}var x=o.clone();x.cellOrdinal(r*l+v);m[x.cellOrdinal()]=x;n++;if(n<a.cells().count()){o=a.cells().item(n);q=$a(o.cellOrdinal(),h);if(q>p){break}t=o.cellOrdinal()%h}}}}var y=new $$t.by($$t.$db.$type,0);for(var aa=0;aa<m.length;aa++){var z=m[aa];if(z!=null){y.add(z)}}var ab=new $$t.by($$t.$bw.$type,0);if(e){ab.add(c)}if(d){ab.add(b)}return function(){var $ret=new $$t.bt;$ret.axes(ab);$ret.cells(y);$ret.isEmpty(!d&&!e&&y.count()==0);return $ret}()},a:function(a,b,c){var d=new $$t.by($$t.$c9.$type,0);if(c){for(var e=0;e<b.count();e++){var f=b.item(e);d.add(a.tuples().__inner[f].clone())}}else{var g=0;var h=b.item(g);for(var i=0;i<a.tuples().count();i++){if(i==h){g++;if(g<b.count()){h=b.item(g)}}else{d.add(a.tuples().__inner[i].clone())}}}var j=function(){var $ret=new $$t.bw(d,a.tupleSize());$ret.name(a.name());return $ret}();return j},expandTupleMember:function(a,b,c){var d=this.f(a,b,c,this.visibleResult());if(d==null){return null}if(!d.isExpandable()){throw new $$t.c0(1,"The position is not expandable.")}if(d.isExpanded()){return this}var e=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,this.visibleResult().axes(),function(f){return f.name()==a}));var f=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,this.result().axes(),function(g){return g.name()==a}));var g=a=="Axis0"&&!this.hasColumns()||a=="Axis1"&&this.hasRows();var h=e.tuples().__inner[b];var i=f.positionResolver().getPositionIndex(h);var j=this.l(a,i,c,this.result());if(j.count()==0){return null}var k=null;var l=null;if(g){k=this.a(f,j,true);if(this.hasColumns()){l=this.visibleResult().axes().item(0)}}else{l=this.a(f,j,true);if(this.hasRows()){k=this.visibleResult().axes().item(1)}}var m=this.c(this.result(),k,l,this.hasRows(),this.hasColumns());var n=this.b(this.visibleResult(),m,f.name());return new $$t.e4(this.result(),n,this.hasColumns(),this.hasRows())},collapseTupleMember:function(a,b,c){var d=this.f(a,b,c,this.visibleResult());if(d==null){return null}if(!d.isExpandable()){throw new $$t.c0(1,"The position is not expandable.")}if(!d.isExpanded()){return this}var e=this.l(a,b,c,this.visibleResult());if(e.count()==0){return null}var f=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,this.visibleResult().axes(),function(g){return g.name()==a}));var g=a=="Axis0"&&!this.hasColumns()||a=="Axis1"&&this.hasRows();var h=null;var i=null;if(g){h=this.a(f,e,false);if(this.hasColumns()){i=this.visibleResult().axes().item(0)}}else{i=this.a(f,e,false);if(this.hasRows()){h=this.visibleResult().axes().item(1)}}var j=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,this.result().axes(),function(k){return k.name()==a}));var k=j.tuples().__inner[b];if(j.positionResolver().hasUnregisterdPositions()){j.positionResolver().completeRegisterPositions()}var l=j.positionResolver().getHostPositionItemInfo(k,c);var m=l.item(k.item(c).key());m.isExpanded(false);var n=this.c(this.visibleResult(),h,i,this.hasRows(),this.hasColumns());return new $$t.e4(this.result(),n,this.hasColumns(),this.hasRows())},extend:function(a,b){var c=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,this.visibleResult().axes(),function(d){return d.name()==b}));var d=b=="Axis0"&&!this.hasColumns()||b=="Axis1"&&this.hasRows();var e=null;var f=null;var g=null;var h=false;if(d){e=c;if(this.hasColumns()){f=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,this.visibleResult().axes(),function(i){return i.name()!=b}));g=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,this.result().axes(),function(i){return i.name()!=b}));h=f.tuples().count()!=g.tuples().count()}}else{f=c;if(this.hasRows()){e=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,this.visibleResult().axes(),function(i){return i.name()!=b}));g=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,this.result().axes(),function(i){return i.name()!=b}));h=e.tuples().count()!=g.tuples().count()}}var i=null;var j=null;if(g!=null&&h){var k=this.c(this.result(),e,f,this.hasRows(),this.hasColumns());i=this.b(k,a,b);j=this.b(k,a,b)}else{i=this.b(this.result(),a,b);j=this.b(this.visibleResult(),a,b)}return new $$t.e4(i,j,this.hasColumns(),this.hasRows())},b:function(a,b,c){var d=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,a.axes(),function(e){return e.name()==c}));if(d==null){return null}var e=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,b.axes(),function(f){return f.name()==c}));var f=c=="Axis0"&&!this.hasColumns()||c=="Axis1"&&this.hasRows();var g=null;var h=null;if(f){if(this.hasColumns()){g=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,a.axes(),function(i){return i.name()!=c}));h=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,b.axes(),function(i){return i.name()!=c}))}}else{if(this.hasRows()){g=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,a.axes(),function(i){return i.name()!=c}));h=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,b.axes(),function(i){return i.name()!=c}))}}var i=new $$t.by($$t.$c9.$type,0);var k=d.tuples().getEnumerator();while(k.moveNext()){var j=k.current();i.add(j.clone())}var m=e.tuples().getEnumerator();while(m.moveNext()){var l=m.current();i.add(l)}var n=e.tuples().count();var o=h!=null&&h.tuples().count()>0?h.tuples().count():1;var p=d.tuples().count()>0?d.tuples().count():1;var q=g!=null&&g.tuples().count()>0?g.tuples().count():1;var r=p*q;var s=new $$t.by($$t.$db.$type,0);if(f){var u=a.cells().getEnumerator();while(u.moveNext()){var t=u.current();s.add(t.clone())}var v=new Array(n*q);var w=p*q;var y=b.cells().getEnumerator();while(y.moveNext()){var x=y.current();var z=x.clone();var aa=this.m(z.cellOrdinal(),g,h);var ab=$a(z.cellOrdinal(),o);z.cellOrdinal(ab*q+aa);z.cellOrdinal(z.cellOrdinal()+r);v[z.cellOrdinal()-w]=z}for(var ac=0;ac<v.length;ac++){var ad=v[ac];if(ad!=null){s.add(ad)}}}else{var ae=new Array(q*(p+n));var ag=a.cells().getEnumerator();while(ag.moveNext()){var af=ag.current();var ah=af.clone();var ai=$a(ah.cellOrdinal(),p);ah.cellOrdinal(ah.cellOrdinal()+ai*n);ae[ah.cellOrdinal()]=ah}var ak=b.cells().getEnumerator();while(ak.moveNext()){var aj=ak.current();var al=aj.clone();var am=this.n(al.cellOrdinal(),g,h,n);var an=$a(aj.cellOrdinal(),n);if(am!=an){}var ao=al.cellOrdinal()%n;al.cellOrdinal(am*n+ao);al.cellOrdinal(al.cellOrdinal()+(am+1)*p);ae[al.cellOrdinal()]=al}for(var aq=0;aq<ae.length;aq++){var ap=ae[aq];if(ap!=null){s.add(ap)}}}var ar=new $$t.bt;ar.axes(new $$t.by($$t.$bw.$type,0));var as=function(){var $ret=new $$t.bw(i,d.tupleSize());$ret.name(d.name());return $ret}();if(f){if(g!=null){ar.axes().add(g)}ar.axes().add(as)}else{ar.axes().add(as);if(g!=null){ar.axes().add(g)}}ar.cells(s);ar.isEmpty(!this.hasColumns()&&!this.hasRows()&&s.count()==0);return ar},m:function(a,b,c){if(c==null){return 0}var d=a%c.tuples().count();var e=c.tuples().__inner[d];var f=b.positionResolver().getPositionIndex(e);return f},n:function(a,b,c,d){if(c==null){return 0}var e=$a(a,d);var f=c.tuples().__inner[e];var g=b.positionResolver().getPositionIndex(f);return g},l:function(a,b,c,d){var e=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,d.axes(),function(f){return f.name()==a}));var f=e.tuples().__inner[b];var g=f.item(c);if(e.positionResolver().hasUnregisterdPositions()){e.positionResolver().completeRegisterPositions()}var h=e.positionResolver().i(g,0);if(h!=null){return $$t.$cp.y($.ig.Number.prototype.$type,h)}return null},f:function(a,b,c,d){var e=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,d.axes(),function(f){return f.name()==a}));var f=e.tuples().__inner[b];var g=f.item(c);if(e.positionResolver().hasUnregisterdPositions()){e.positionResolver().completeRegisterPositions()}var h=e.positionResolver().getHostPositionItemInfo(f,c);var i;var j=h.tryGetValue(g.key(),i);i=j.p1;return i},$type:new $.ig.Type("OlapResultView",$.ig.$ot)},true);$c("ResultViewHelper:e5","Object",{init:function(){$.ig.$op.init.call(this)},e:function(a,b,c,d,e){$$t.$e5.d(a,b,c,true,e.visibleResult());$$t.$e5.d(a,b,c,true,e.result())},f:function(a,b,c){var d=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,b.visibleResult().axes(),function(e){return e.name()==a}));var e=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,c.visibleResult().axes(),function(f){return f.name()==a}));$$t.$e5.b(d.positionResolver(),e.positionResolver());var f=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,b.result().axes(),function(g){return g.name()==a}));var g=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,c.result().axes(),function(h){return h.name()==a}));$$t.$e5.b(f.positionResolver(),g.positionResolver())},d:function(a,b,c,d,e){var f=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,e.axes(),function(g){return g.name()==a}));if(f.positionResolver().hasUnregisterdPositions()){f.positionResolver().completeRegisterPositions()}$$t.$e5.c(b,c,d,f.positionResolver())},c:function(a,b,c,d){if(d.hasUnregisterdPositions()){d.completeRegisterPositions()}var e=d.positions().__inner[a];var f=d.getHostPositionItemInfo(e,b);var g=f.item(e.item(b).key());g.isExpanded(c)},b:function(a,b){if(a.hasUnregisterdPositions()){a.completeRegisterPositions()}if(b.hasUnregisterdPositions()){b.completeRegisterPositions()}$$t.$e5.a(a.rootPositionInfo(),b.rootPositionInfo())},a:function(a,b){var d=a.getEnumerator();while(d.moveNext()){var c=d.current();var e=c.value();var f;if(function(){var g=b.tryGetValue(c.key(),f);f=g.p1;return g.ret}()){if(e.isExpanded()!=true){f.isExpanded(false)}if(f.count()>0){$$t.$e5.a(e,f)}}}},$type:new $.ig.Type("ResultViewHelper",$.ig.$ot)},true);$c("OlapTableViewHeaderCell:ea","Object",{init:function(){$.ig.$op.init.call(this);this.columnSpan(1);this.rowSpan(1)},_id:null,id:function(a){if(arguments.length===1){this._id=a;return a}else{return this._id}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_isExpanded:false,isExpanded:function(a){if(arguments.length===1){this._isExpanded=a;return a}else{return this._isExpanded}},_isExpandable:false,isExpandable:function(a){if(arguments.length===1){this._isExpandable=a;return a}else{return this._isExpandable}},_rowIndex:0,rowIndex:function(a){if(arguments.length===1){this._rowIndex=a;return a}else{return this._rowIndex}},_rowSpan:0,rowSpan:function(a){if(arguments.length===1){this._rowSpan=a;return a}else{return this._rowSpan}},_columnIndex:0,columnIndex:function(a){if(arguments.length===1){this._columnIndex=a;return a}else{return this._columnIndex}},_columnSpan:0,columnSpan:function(a){if(arguments.length===1){this._columnSpan=a;return a}else{return this._columnSpan}},_axisName:null,axisName:function(a){if(arguments.length===1){this._axisName=a;return a}else{return this._axisName}},_tupleIndex:0,tupleIndex:function(a){if(arguments.length===1){this._tupleIndex=a;return a}else{return this._tupleIndex}},_memberIndex:0,memberIndex:function(a){if(arguments.length===1){this._memberIndex=a;return a}else{return this._memberIndex}},_levelNumber:0,levelNumber:function(a){if(arguments.length===1){this._levelNumber=a;return a}else{return this._levelNumber}},_hierarchyNumber:0,hierarchyNumber:function(a){if(arguments.length===1){this._hierarchyNumber=a;return a}else{return this._hierarchyNumber}},_headerSpan:0,headerSpan:function(a){if(arguments.length===1){this._headerSpan=a;return a}else{return this._headerSpan}},_rowOrigin:0,rowOrigin:function(a){if(arguments.length===1){this._rowOrigin=a;return a}else{return this._rowOrigin}},toString:function(){return this.caption()},$type:new $.ig.Type("OlapTableViewHeaderCell",$.ig.$ot)},true);$c("OlapTableViewResultCell:et","Object",{init:function(){$.ig.$op.init.call(this)},_value:null,value:function(a){if(arguments.length===1){this._value=a;return a}else{return this._value}},_formattedValue:null,formattedValue:function(a){if(arguments.length===1){this._formattedValue=a;return a}else{return this._formattedValue}},_cellOrdinal:0,cellOrdinal:function(a){if(arguments.length===1){this._cellOrdinal=a;return a}else{return this._cellOrdinal}},_resultCellIndex:0,resultCellIndex:function(a){if(arguments.length===1){this._resultCellIndex=a;return a}else{return this._resultCellIndex}},$type:new $.ig.Type("OlapTableViewResultCell",$.ig.$ot)},true);$c("TableViewSettings:er","Object",{init:function(){$.ig.$op.init.call(this)},_c:false,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_d:false,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_a:0,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_b:false,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},$type:new $.ig.Type("TableViewSettings",$.ig.$ot)},true);$c("OlapTableViewTreeHeaderCell:ek","OlapTableViewHeaderCell",{init:function(){$$t.$ea.init.call(this);this.parentMemberLevelNumber(-1)},_indent:0,indent:function(a){if(arguments.length===1){this._indent=a;return a}else{return this._indent}},_parentMemberLevelNumber:0,parentMemberLevelNumber:function(a){if(arguments.length===1){this._parentMemberLevelNumber=a;return a}else{return this._parentMemberLevelNumber}},_isItemExpanded:false,isItemExpanded:function(a){if(arguments.length===1){this._isItemExpanded=a;return a}else{return this._isItemExpanded}},_isItemExpandable:false,isItemExpandable:function(a){if(arguments.length===1){this._isItemExpandable=a;return a}else{return this._isItemExpandable}},$type:new $.ig.Type("OlapTableViewTreeHeaderCell",$$t.$ea.$type)},true);$c("TreeLayoutTableViewSettings:e3","TableViewSettings",{init:function(a,b){$$t.$er.init.call(this);this.a(2);this.e(a);this.f(b)},_e:0,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},_f:0,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},$type:new $.ig.Type("TreeLayoutTableViewSettings",$$t.$er.$type)},true);$c("ArrayListCollection$1:ec","Object",{$t:null,init:function($t){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this);this.inner(new $.ig.Array)},_inner:null,inner:function(a){if(arguments.length===1){this._inner=a;return a}else{return this._inner}},collectionChanged:null,indexOf:function(a){return this.inner().indexOf($d(this.$t,a))},insert:function(a,b){this.inner().insert(a,$d(this.$t,b));this.d(a,b)},removeAt:function(a){var b=$u(this.$t,this.inner()[a]);this.inner().removeAt(a);this.e(a,b)},item:function(a,b){if(arguments.length===2){this.inner()[a]=$d(this.$t,b);return b}else{return $u(this.$t,this.inner()[a])}},add:function(a){this.inner().add($d(this.$t,a));this.d(this.inner().length-1,a)},clear:function(){this.inner().clear();this.c()},contains:function(a){return this.inner().contains($d(this.$t,a))},copyTo:function(a,b){throw new $$t.cg(0)},count:function(){return this.inner().length},isReadOnly:function(){return false},remove:function(a){var b=this.inner().indexOf($d(this.$t,a));if(b>=0){this.inner().removeAt(b);this.e(b,a);return true}return false},b:function(){var d__=new $.ig.ArrayListCollection___Enumerate__IteratorClass$1(this.$t,-2);d__.__4__this=this;return d__},getEnumerator:function(){return this.b().getEnumerator()},d:function(a,b){if(this.collectionChanged!=null){var c=new $$t.ef(1,0,$d(this.$t,b),a);this.collectionChanged(this,c)}},e:function(a,b){if(this.collectionChanged!=null){var c=new $$t.ef(1,1,$d(this.$t,b),a);this.collectionChanged(this,c)}},c:function(){if(this.collectionChanged!=null){var a=new $$t.ef(1,4,null,-1);this.collectionChanged(this,a)}},$type:new $.ig.Type("ArrayListCollection$1",$.ig.$ot,[$$t.$bu.$type.specialize(0),$$t.$ed.$type])},true);$c("IOlapDataSource:e6","Object",{$type:new $.ig.Type("IOlapDataSource",null)},true);$c("MeasureList:fa","Object",{init:function(){$.ig.$op.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},uniqueName:function(a){if(arguments.length===1){this.name(a);return a}else{return this.name()}},_measures:null,measures:function(a){if(arguments.length===1){this._measures=a;return a}else{return this._measures}},$type:new $.ig.Type("MeasureList",$.ig.$ot,[$$t.$a.$type])},true);$c("OlapMetadataTreeItem:e7","Object",{init:function(){$.ig.$op.init.call(this)},_item:null,item:function(a){if(arguments.length===1){this._item=a;return a}else{return this._item}},_type:0,type:function(a){if(arguments.length===1){this._type=a;return a}else{return this._type}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_children:null,children:function(a){if(arguments.length===1){this._children=a;return a}else{return this._children}},e:function(a){if(this.children()==null){this.children(new Array(1));this.children()[0]=a;return}var b=new Array(this.children().length+1);$.ig.util.arrayCopy1(this.children(),0,b,0,this.children().length);b[this.children().length]=a;this.children(b)},$type:new $.ig.Type("OlapMetadataTreeItem",$.ig.$ot)},true);$c("OlapDataSource:fb","Object",{v:null,u:null,ag:null,ah:0,j:0,g:null,init:function(a){this.v=new $$t.by($$t.$fh.$type,0);this.u=new $$t.by($$t.$fh.$type,0);this.ag=new $$t.by(String,0);this.ae=new $$t.by(String,0);$.ig.$op.init.call(this);this.x(new $$t.by($$t.$fg.$type,0));this.af(new $$t.by($$t.$fg.$type,0));this.y(new $$t.by($$t.$fg.$type,0));this.o(false);this.ak(null);this.t(false);this.at(null);this.isInitialized(false);this.m(false);this.s(false);this.n(false);this.r(false);this.q(false);this.p(false);this.catalogs(new $$t.ec($$t.$ba.$type));this.cubes(new $$t.ec($$t.$a8.$type));this.measureGroups(new $$t.ec($$t.$bp.$type));this.rowAxis(new $$t.ec($$t.$a.$type));this.columnAxis(new $$t.ec($$t.$a.$type));this.filters(new $$t.ec($$t.$bk.$type));this.measures(new $$t.ec($$t.$bn.$type));this.measureListLocation(1);this.measureListIndex(-1);this.sourceOptions(a);this.result(function(){var $ret=new $$t.bt;$ret.isEmpty(true);return $ret}())},_isInitialized:false,isInitialized:function(a){if(arguments.length===1){this._isInitialized=a;return a}else{return this._isInitialized}},_catalogs:null,catalogs:function(a){if(arguments.length===1){this._catalogs=a;return a}else{return this._catalogs}},_cubes:null,cubes:function(a){if(arguments.length===1){this._cubes=a;return a}else{return this._cubes}},_cube:null,cube:function(a){if(arguments.length===1){this._cube=a;return a}else{return this._cube}},_measureGroup:null,measureGroup:function(a){if(arguments.length===1){this._measureGroup=a;return a}else{return this._measureGroup}},_measureGroups:null,measureGroups:function(a){if(arguments.length===1){this._measureGroups=a;return a}else{return this._measureGroups}},_sourceOptions:null,sourceOptions:function(a){if(arguments.length===1){this._sourceOptions=a;return a}else{return this._sourceOptions}},dataProviderFactory:function(a){if(arguments.length===1){this.g=a;return a}else{if(this.g==null){this.g=this.h()}return this.g}},_metadataTree:null,metadataTree:function(a){if(arguments.length===1){this._metadataTree=a;return a}else{return this._metadataTree}},_rowAxis:null,rowAxis:function(a){if(arguments.length===1){this._rowAxis=a;return a}else{return this._rowAxis}},_columnAxis:null,columnAxis:function(a){if(arguments.length===1){this._columnAxis=a;return a}else{return this._columnAxis}},_filters:null,filters:function(a){if(arguments.length===1){this._filters=a;return a}else{return this._filters}},_measures:null,measures:function(a){if(arguments.length===1){this._measures=a;return a}else{return this._measures}},measureListIndex:function(a){if(arguments.length===1){if(this.ah!=a){this.p(true);this.ah=a;this.a0();this.p(false)}return a}else{return this.ah}},measureListLocation:function(a){if(arguments.length===1){if(this.j!=a){this.ay();this.j=a;this.a0()}return a}else{return this.j}},_result:null,result:function(a){if(arguments.length===1){this._result=a;return a}else{return this._result}},_l:null,l:function(a){if(arguments.length===1){this._l=a;return a}else{return this._l}},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_x:null,x:function(a){if(arguments.length===1){this._x=a;return a}else{return this._x}},_af:null,af:function(a){if(arguments.length===1){this._af=a;return a}else{return this._af}},_y:null,y:function(a){if(arguments.length===1){this._y=a;return a}else{return this._y}},ae:null,_o:false,o:function(a){if(arguments.length===1){this._o=a;return a}else{return this._o}},_ak:null,ak:function(a){if(arguments.length===1){this._ak=a;return a}else{return this._ak}},_t:false,t:function(a){if(arguments.length===1){this._t=a;return a}else{return this._t}},_at:null,at:function(a){if(arguments.length===1){this._at=a;return a}else{return this._at}},_m:false,m:function(a){if(arguments.length===1){this._m=a;return a}else{return this._m}},_s:false,s:function(a){if(arguments.length===1){this._s=a;return a}else{return this._s}},_n:false,n:function(a){if(arguments.length===1){this._n=a;return a}else{return this._n}},_r:false,r:function(a){if(arguments.length===1){this._r=a;return a}else{return this._r}},_q:false,q:function(a){if(arguments.length===1){this._q=a;return a}else{return this._q}},_p:false,p:function(a){if(arguments.length===1){this._p=a;return a}else{return this._p}},getMembersOfLevel:function(a){},getMembersOfHierarchy:function(a){},getMembersOfMember:function(a){},setCube:function(a){if(!this.isInitialized()){throw new $$t.c0(1,"Data source is not initialized.")}return this.ap(a)},setMeasureGroup:function(a){if(!this.isInitialized()){throw new $$t.c0(1,"Data source is not initialized.")}return this.aq(a)},getCoreElement:function(a,b){if(b==$$t.$fa.$type){var c;if(this.measureListLocation()==1){c=this.columnAxis()}else{c=this.rowAxis()}var d=null;var f=c.getEnumerator();while(f.moveNext()){var e=f.current();d=$b($$t.$fa.$type,e);if(d!=null){break}}return d}else{return $$t.$cp.ae($$t.$a.$type,this.getCoreElements(a,b))}},getCoreElements:function(a,b){if(b==$$t.$bb.$type){return this.a($$t.$bb.$type,$$t.$cp.t($$t.$bb.$type,this.c().t(),function(c){return a(c)}))}if(b==$$t.$bk.$type){return this.a($$t.$bk.$type,$$t.$cp.t($$t.$bk.$type,this.c().u(),function(c){return a(c)}))}if(b==$$t.$bm.$type){return this.a($$t.$bm.$type,$$t.$cp.t($$t.$bm.$type,this.c().x(),function(c){return a(c)}))}if(b==$$t.$bn.$type){return this.a($$t.$bn.$type,$$t.$cp.t($$t.$bn.$type,this.c().z(),function(c){return a(c)}))}if(b==$$t.$bo.$type){return this.a($$t.$bo.$type,$$t.$cp.t($$t.$bo.$type,this.c().v(),function(c){return a(c)}))}if(b==$$t.$bl.$type){return this.a($$t.$bl.$type,$$t.$cp.t($$t.$bl.$type,this.c().w(),function(c){return a(c)
}))}throw new $$t.w(0,"Supported types are Dimension, Hierarchy, Level and Measure")},expandTupleMember:function(a,b,c){var d=this.d(a,this.result());if(d==null){throw new $$t.c0(1,"No axis found for the specified index.")}var e=$$t.$cp.ae($$t.$fh.$type,$$t.$cp.t($$t.$fh.$type,this.v,function(f){return f.c()==a&&f.b()==b&&f.a()==c}));if(e==null){e=function(){var $ret=new $$t.fh;$ret.c(a);$ret.a(c);$ret.b(b);return $ret}();this.v.add(e)}else{this.v.remove(e)}},collapseTupleMember:function(a,b,c){var d=this.d(a,this.result());if(d==null){throw new $$t.c0(1,"No axis found for the specified index.")}var e=$$t.$cp.ae($$t.$fh.$type,$$t.$cp.t($$t.$fh.$type,this.v,function(f){return f.c()==a&&f.b()==b&&f.a()==c}));if(e==null){e=function(){var $ret=new $$t.fh;$ret.c(a);$ret.a(c);$ret.b(b);return $ret}();this.u.add(e)}else{this.v.remove(e)}},clearPendingChanges:function(){this.u.clear();this.v.clear()},update:function(){var $self=this;if(this.t()){return this.at()}this.t(true);var a=null;if(this.v.count()>0){a=this.am(this.v)}if(this.ag.count()>0){var b=new $$t.dl(Array,0);var c=new Array(this.ag.count());for(var d=0;d<c.length;d++){c[d]=this.getMembersOfHierarchy(this.ag.__inner[d])}this.ag.clear();var e=new $$t.fi;e.c(c,b.e.runOn(b));if(a!=null){a=$$t.$fj.a(Array,a,function(f){return b.b()})}else{a=b.b()}}if(a!=null){a=$$t.$fj.a($$t.$bt.$type,a,function(f){return $self.ar()})}else{a=this.ar()}this.at(a);this.at().i(function(f){$self.t(false);$self.at(null)});return a},initialize:function(){var $self=this;if(this.o()){return this.ak()}this.o(true);this.ak(this.ao());var a=this.ak();this.ak().i(function(b){$self.o(false);$self.ak(null)});return a},addFilterMember:function(a,b){var $self=this;var c;var d=function(){var e=$self.b(a,c);c=e.p1;return e.ret}();if(d==null){d=new $$t.fg(a,function(){var $ret=new $$t.ec(String);$ret.add(b);return $ret}());c.add(d)}if(!d.a().contains(b)){d.a().add(b);if(this.ae.contains(b)){this.ae.remove(b)}else{this.ae.add(b)}}var e;if(!function(){var f=$self.c().h(b,e);e=f.p1;return f.ret}()&&!this.ag.contains(a)){this.ag.add(a)}},getFilterMemberNames:function(a){var $self=this;var b;var c=function(){var d=$self.b(a,b);b=d.p1;return d.ret}();if(c!=null){return this.a(String,c.a())}return new $$t.ec(String)},removeFilterMember:function(a,b){var $self=this;var c;var d=function(){var e=$self.b(a,c);c=e.p1;return e.ret}();if(d==null){return}if(d.a().remove(b)){if(this.ae.contains(b)){this.ae.remove(b)}else{this.ae.add(b)}}},removeAllFilterMembers:function(a){var $self=this;var b;var c=function(){var d=$self.b(a,b);b=d.p1;return d.ret}();if(c==null){return}for(var d=c.a().count()-1;d>=0;d--){var e=c.a().item(d);c.a().removeAt(d);if(this.ae.contains(e)){this.ae.remove(e)}else{this.ae.add(e)}}},getProviderDefaultProperties:function(){var a=new $$t.by($$t.$d4.$type,0);return a},getProviderDefaultRestrictions:function(){var a=new $$t.by($$t.$d4.$type,0);return a},tryGetMember:function(a,b){var $self=this;return{ret:function(){var c=$self.c().h(a,b);b=c.p1;return c.ret}(),p1:b}},tryGetMembersForLevel:function(a,b){var $self=this;return{ret:function(){var c=$self.c().j(a,b);b=c.p1;return c.ret}(),p1:b}},ao:function(){},ar:function(){},h:function(){},ai:function(){},ap:function(a){var $self=this;if(String.isNullOrEmpty(a)){if(a==null){throw new $$t.cv(0,"cubeName")}throw new $$t.c0(1,"cubeName cannot be empty.")}var b=new $$t.dl($$t.$e7.$type,0);if(this.cube()!=null){if(this.cube().name()==a){b.e(this.metadataTree());return b.b()}this.av()}var d=this.cubes().getEnumerator();while(d.moveNext()){var c=d.current();if(c.name()==a){this.cube(c);break}}var e=this.ai();if(!this.isInitialized()){var f=this.sourceOptions().measureGroup();if(!String.isNullOrEmpty(f)){return $$t.$fj.a($$t.$e7.$type,e,function(g){return $self.aq(f)})}}return $$t.$fj.a($$t.$e7.$type,e,function(g){return $self.aq(null)})},aj:function(){var $self=this;var a=null;var b=null;var c=null;var d=new $$t.by($$t.$fg.$type,0);if(!String.isNullOrEmpty(this.sourceOptions().columns())){var e=new $$t.fk(this.sourceOptions().columns());a=e.c()}if(!String.isNullOrEmpty(this.sourceOptions().rows())){var f=new $$t.fk(this.sourceOptions().rows());b=f.c()}if(!String.isNullOrEmpty(this.sourceOptions().filters())){var g=new $$t.fk(this.sourceOptions().filters());c=g.c()}if(a!=null&&a.count()>0){var i=a.getEnumerator();while(i.moveNext()){var h=i.current();this.au($$t.$a.$type,h.b(),this.columnAxis(),$$t.$bk.$type);this.x().add(h);if(h.a().count()>0){d.add(h);var k=h.a().getEnumerator();while(k.moveNext()){var j=k.current();this.ae.add(j)}}}}if(b!=null&&b.count()>0){var m=b.getEnumerator();while(m.moveNext()){var l=m.current();this.au($$t.$a.$type,l.b(),this.rowAxis(),$$t.$bk.$type);this.af().add(l);if(l.a().count()>0){d.add(l);var o=l.a().getEnumerator();while(o.moveNext()){var n=o.current();this.ae.add(n)}}}}if(c!=null&&c.count()>0){var q=c.getEnumerator();while(q.moveNext()){var p=q.current();this.au($$t.$bk.$type,p.b(),this.filters(),$$t.$bk.$type);this.y().add(p);if(p.a().count()>0){d.add(p);var s=p.a().getEnumerator();while(s.moveNext()){var r=s.current();this.ae.add(r)}}}}var t=null;if(!String.isNullOrEmpty(this.sourceOptions().measures())){var u=new $$t.fk(this.sourceOptions().measures());t=u.c()}if(t!=null&&t.count()>0){var w=t.getEnumerator();while(w.moveNext()){var v=w.current();this.au($$t.$bn.$type,v.b(),this.measures(),$$t.$bn.$type)}}if(this.m()||this.s()||this.n()||this.r()||this.p()){if(d.count()>0){var x=new Array(d.count());for(var y=0;y<d.count();y++){var z=d.item(y).b();x[y]=this.getMembersOfHierarchy(z)}var aa=new $$t.dl($$t.$e7.$type,0);var ab=new $$t.fi;ab.c(x,function(ac){$self.ar().i(function(ad){$self.ax();aa.e($self.metadataTree())})});return aa.b()}return $$t.$fj.b($$t.$bt.$type,$$t.$e7.$type,this.ar(),function(ac){$self.ax();var ad=new $$t.dl($$t.$e7.$type,0);ad.e($self.metadataTree());return ad.b()})}this.ax();var ac=new $$t.dl($$t.$e7.$type,0);ac.e(this.metadataTree());return ac.b()},al:function(a){var $self=this;var b=this.dataProviderFactory().createDataProvider();var c=this.getProviderDefaultRestrictions();var d=this.getProviderDefaultProperties();var e=b.discoverCubesAsync(d,c).j($$t.$bu.$type.specialize($$t.$a8.$type),function(f){$self.cubes($self.a($$t.$a8.$type,f.m()));return $self.cubes()});return e},an:function(){var $self=this;var a=this.dataProviderFactory().createDataProvider();var b=this.getProviderDefaultRestrictions();var c=this.getProviderDefaultProperties();var d=a.discoverMeasureGroupsAsync(c,b).j($$t.$bu.$type.specialize($$t.$bp.$type),function(e){$self.measureGroups($self.a($$t.$bp.$type,e.m()));return $self.measureGroups()});return d},ax:function(){this.isInitialized(true)},av:function(){this.cube(null);this.measureGroups(new $$t.ec($$t.$bp.$type));this.filters().clear();this.rowAxis().clear();this.columnAxis().clear();this.measures().clear();this.c(null);this.aw()},aw:function(){this.measureGroup(null);this.metadataTree(null)},aq:function(a){var $self=this;if(this.cube()==null){throw new $$t.c0(1,"Data source has no Cube set.")}var b=new $$t.dl($$t.$e7.$type,0);if(this.measureGroup()!=null){if(this.measureGroup().name()==a){b.e(this.metadataTree());return b.b()}this.aw()}if(!String.isNullOrEmpty(a)&&this.measureGroups().count()==0){var c=$$t.$fj.b($$t.$bu.$type.specialize($$t.$bp.$type),$$t.$e7.$type,this.an(),function(d){if($self.measureGroups().count()==0){return $self.aq(null)}return $self.aq(a)});return c}var e=this.measureGroups().getEnumerator();while(e.moveNext()){var d=e.current();if(d.name()==a){this.measureGroup(d);break}}this.metadataTree(this.k(a));b.e(this.metadataTree());return b.b()},k:function(a){var $self=this;var b=function(){var $ret=new $$t.e7;$ret.type(0);$ret.caption($self.cube().caption());$ret.item($self.cube());return $ret}();var c;var d;var e;var f=true;if(String.isNullOrEmpty(a)||this.measureGroups()==null){c=this.c().t();d=this.c().z();e=this.c().w()}else{f=false;c=this.c().a().getMeasureGroupDimensions(a);d=this.c().a().getMeasureGroupMeasures(a);e=this.c().a().getMeasureGroupKpis(a)}var g=$$t.$fl.getDimensionMetaItems(c,d,e,this.c().u(),this.c().x(),f,this.c());$$t.$fl.setMetaItemChildren(b,g);return b},d:function(a,b){if(b!=null&&b.axes().count()>0){return $$t.$cp.ae($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,b.axes(),function(c){return c.name()==a}))}return null},az:function(a,b){switch(a.action()){case 0:var d=a.newItems().getEnumerator();while(d.moveNext()){var c=d.current();var e=$b($$t.$bk.$type,c);if(e!=null){if(this.isInitialized()){b.add(new $$t.fg(e.uniqueName(),new $$t.ec(String)))}}}break;case 1:var g=a.oldItems().getEnumerator();while(g.moveNext()){var f=g.current();var h=$b($$t.$bk.$type,f);if(h!=null){var i=$$t.$cp.ae($$t.$fg.$type,$$t.$cp.t($$t.$fg.$type,b,function(j){return j.b()==h.uniqueName()}));if(i!=null){var j=new $$t.by(String,0);for(var k=0;k<i.a().count();k++){j.add(i.a().item(k))}for(var l=0;l<j.count();l++){var m=j.item(l);this.removeFilterMember(i.b(),m)}b.remove(i)}}else{var n=$b($$t.$fa.$type,f);if(n!=null){if(!this.r()&&!this.q()&&!this.p()){this.measures().clear()}}}}break}},a1:function(a,b){switch(a.action()){case 0:var d=a.newItems().getEnumerator();while(d.moveNext()){var c=d.current();var e=$b($$t.$bk.$type,c);if(e!=null){var f=$b($$t.$fa.$type,$$t.$cp.ae($$t.$a.$type,$$t.$cp.t($$t.$a.$type,b,function(g){return $b($$t.$fa.$type,g)!==null})));if(f!=null&&this.measureListIndex()>=a.newStartingIndex()){this.measureListIndex(this.measureListIndex()+1)}}}break;case 1:var h=a.oldItems().getEnumerator();while(h.moveNext()){var g=h.current();var i=$b($$t.$bk.$type,g);if(i!=null){var j=$b($$t.$fa.$type,$$t.$cp.ae($$t.$a.$type,$$t.$cp.t($$t.$a.$type,b,function(k){return $b($$t.$fa.$type,k)!==null})));if(j!=null&&this.measureListIndex()>a.oldStartingIndex()){this.measureListIndex(this.measureListIndex()-1)}}}break}},a0:function(){var $self=this;var a;if(this.measureListLocation()==1){a=this.columnAxis()}else{a=this.rowAxis()}var b=null;var c=0;var e=a.getEnumerator();while(e.moveNext()){var d=e.current();b=$b($$t.$fa.$type,d);if(b!=null){break}c++}if(this.measures().count()>1){if(b==null){b=function(){var $ret=new $$t.fa;$ret.measures($self.measures());return $ret}();if(this.measureListIndex()<0||this.measureListIndex()>a.count()){this.ah=a.count();a.add(b)}else{a.insert(this.measureListIndex(),b)}}else{if(c!=this.measureListIndex()){a.removeAt(c);if(this.measureListIndex()>a.count()){this.ah=a.count();a.add(b)}else{a.insert(this.measureListIndex(),b)}}}}else{if(b!=null){a.removeAt(c)}}},aa:function(){return this.v},z:function(){return this.u},au:function($tItem,a,b,c){var d=function(e){return $u($tItem,e).uniqueName()==a};var e=this.getCoreElement(d,c);if(e!=null&&!$$t.$cp.e($.ig.$op.$type,b,e)){b.add($u($tItem,e))}},am:function(a){var b=new $$t.by(String,0);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();var e=this.d(c.c(),this.result()).tuples().__inner[c.b()].members().item(c.a());var f=this.getCoreElement(function(g){return g.hierarchyUniqueName()==e.hierarchyUniqueName()&&g.depth()==e.levelNumber()+1},$$t.$bm.$type);if(f!=null&&!this.c().c(f.uniqueName())&&!b.contains(f.uniqueName())){b.add(f.uniqueName())}}if(b.count()>0){var g=new Array(b.count());for(var h=0;h<b.count();h++){g[h]=this.getMembersOfLevel(b.item(h))}return(new $$t.fi).d(Array,g,function(i){return i})}var i=new $$t.dl(Array,0);i.e(new Array(0));return i.b()},ay:function(){var a;if(this.measureListLocation()==1){a=this.columnAxis()}else{a=this.rowAxis()}if(a==null){return}var b=null;var c=0;var e=a.getEnumerator();while(e.moveNext()){var d=e.current();b=$b($$t.$fa.$type,d);if(b!=null){break}c++}if(b!=null){this.q(true);a.removeAt(c)}},a:function($t,a){var b=new $$t.ec($t);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b.add(c)}return b},b:function(a,b){var c=$$t.$cp.ae($$t.$fg.$type,$$t.$cp.t($$t.$fg.$type,this.x(),function(d){return d.b()==a}));if(c!=null){b=this.x();return{ret:c,p1:b}}c=$$t.$cp.ae($$t.$fg.$type,$$t.$cp.t($$t.$fg.$type,this.af(),function(d){return d.b()==a}));if(c!=null){b=this.af();return{ret:c,p1:b}}c=$$t.$cp.ae($$t.$fg.$type,$$t.$cp.t($$t.$fg.$type,this.y(),function(d){return d.b()==a}));if(c!=null){b=this.y();return{ret:c,p1:b}}b=null;return{ret:null,p1:b}},$type:new $.ig.Type("OlapDataSource",$.ig.$ot,[$$t.$e6.$type])},true);$c("PositionInfo:fh","Object",{init:function(){$.ig.$op.init.call(this)},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_b:0,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_a:0,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},$type:new $.ig.Type("PositionInfo",$.ig.$ot)},true);$c("CubeMetaItemsCache:fd","Object",{init:function(){this.p=new $$t.ck(String,$$t.$ff.$type.specialize($.ig.Number.prototype.$type,$$t.$br.$type),0);this.s=new $$t.ck($.ig.Number.prototype.$type,$$t.$br.$type,0);this.q=new $$t.ck(String,$$t.$bu.$type.specialize($$t.$br.$type),0);this.r=new $$t.ck(String,$$t.$bu.$type.specialize($$t.$br.$type),0);this.o=new $$t.ck(String,$$t.$bn.$type,0);this.l=new $$t.ck(String,$$t.$bo.$type,0);this.n=new $$t.ck(String,$$t.$e.$type,0);this.m=new $$t.ck(String,$$t.$e.$type,0);$.ig.$op.init.call(this)},p:null,s:null,q:null,r:null,o:null,l:null,n:null,m:null,_z:null,z:function(a){if(arguments.length===1){this._z=a;return a}else{return this._z}},_v:null,v:function(a){if(arguments.length===1){this._v=a;return a}else{return this._v}},_t:null,t:function(a){if(arguments.length===1){this._t=a;return a}else{return this._t}},_u:null,u:function(a){if(arguments.length===1){this._u=a;return a}else{return this._u}},_x:null,x:function(a){if(arguments.length===1){this._x=a;return a}else{return this._x}},_w:null,w:function(a){if(arguments.length===1){this._w=a;return a}else{return this._w}},_y:null,y:function(a){if(arguments.length===1){this._y=a;return a}else{return this._y}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},c:function(a){var $self=this;var b;if(!function(){var c=$self.n.tryGetValue(a,b);b=c.p1;return c.ret}()){return false}return b},ac:function(a){this.n.item(a,true)},b:function(a){var $self=this;var b;if(!function(){var c=$self.m.tryGetValue(a,b);b=c.p1;return c.ret}()){return false}return b},ab:function(a){this.m.item(a,true);var c=$$t.$cp.t($$t.$bm.$type,this.x(),function(d){return d.hierarchyUniqueName()==a}).getEnumerator();while(c.moveNext()){var b=c.current();this.ac(b.uniqueName())}},d:function(a){return this.r.containsKey(a)},aa:function(a){var $self=this;var b;if(!function(){var c=$self.p.tryGetValue(a.uniqueName(),b);b=c.p1;return c.ret}()){var c=this.p.count();b=new $$t.ff($.ig.Number.prototype.$type,$$t.$br.$type,c,a);this.p.item(a.uniqueName(),b);this.s.item(c,a);var d;if(!function(){var e=$self.q.tryGetValue(a.levelUniqueName(),d);d=e.p1;return e.ret}()){d=new $$t.ec($$t.$br.$type);this.q.item(a.levelUniqueName(),d)}if(!String.isNullOrEmpty(a.parentUniqueName())){var e;if(!function(){var f=$self.r.tryGetValue(a.parentUniqueName(),e);e=f.p1;return f.ret}()){e=new $$t.by($$t.$br.$type,0);this.r.item(a.parentUniqueName(),e)}e.add(a)}d.add(a)}return b.a()},i:function(a,b){var $self=this;var c;if(function(){var d=$self.p.tryGetValue(a,c);c=d.p1;return d.ret}()){b=c.a();return{ret:true,p1:b}}b=-1;return{ret:false,p1:b}},h:function(a,b){var $self=this;var c;if(function(){var d=$self.p.tryGetValue(a,c);c=d.p1;return d.ret}()){b=c.b();return{ret:true,p1:b}}b=null;return{ret:false,p1:b}},g:function(a,b){var $self=this;return{ret:function(){var c=$self.s.tryGetValue(a,b);b=c.p1;return c.ret}(),p1:b}},k:function(a,b){var $self=this;return{ret:function(){var c=$self.r.tryGetValue(a,b);b=c.p1;return c.ret}(),p1:b}},j:function(a,b){var $self=this;return{ret:function(){var c=$self.q.tryGetValue(a,b);b=c.p1;return c.ret}(),p1:b}},f:function(a,b){var $self=this;if(!function(){var c=$self.o.tryGetValue(a,b);b=c.p1;return c.ret}()){b=$$t.$cp.ae($$t.$bn.$type,$$t.$cp.t($$t.$bn.$type,this.z(),function(c){return c.uniqueName()==a}));if(b==null){return{ret:false,p1:b}}this.o.add(a,b)}return{ret:true,p1:b}},e:function(a,b){var $self=this;if(!function(){var c=$self.l.tryGetValue(a,b);b=c.p1;return c.ret}()){b=$$t.$cp.ae($$t.$bo.$type,$$t.$cp.t($$t.$bo.$type,this.v(),function(c){return c.uniqueName()==a}));if(b==null){return{ret:false,p1:b}}this.l.add(a,b)}return{ret:true,p1:b}},$type:new $.ig.Type("CubeMetaItemsCache",$.ig.$ot)},true);$c("MetaTreeHelper:fl","Object",{init:function(){$.ig.$op.init.call(this)},getDimensionMetaItems:function(a,b,c,d,e,f,g){var h=new $$t.by($$t.$e7.$type,0);var i=new $$t.fm;i.a(0);i.b(0);var j=new $$t.by($$t.$bk.$type,0);var l=d.getEnumerator();while(l.moveNext()){var k=l.current();j.add(k)}var m=new $$t.by($$t.$bm.$type,0);var o=e.getEnumerator();while(o.moveNext()){var n=o.current();m.add(n)}var q=a.getEnumerator();while(q.moveNext()){var p=q.current();var r=$$t.$fl.e(j,m,p,i);if(p.dimensionType()!=2){var s=function(){var $ret=new $$t.e7;$ret.type(1);$ret.caption(p.caption());$ret.item(p);return $ret}();$$t.$fl.setMetaItemChildren(s,r);h.add(s)}else{var t=$$t.$fl.c(b,p);h.insert(0,t);if($$t.$cp.ai($$t.$bl.$type,c)>0){var u=function(){var $ret=new $$t.bd;$ret.caption("Kpis");return $ret}();var v=$$t.$fl.b(c,u,g);v.type(12);h.insert(1,v)}}}return h},setMetaItemChildren:function(a,b){if(b.count()>0){var c=$$t.$cp.a($$t.$e7.$type,$$t.$cp.w($$t.$e7.$type,String,$$t.$cp.t($$t.$e7.$type,b,function(d){return d.type()==2}),function(d){return d.caption()}));var d=$$t.$cp.a($$t.$e7.$type,$$t.$cp.t($$t.$e7.$type,b,function(e){return e.type()!=2}));var e=new Array(c.length+d.length);for(var f=0;f<c.length;f++){e[f]=c[f]}for(var g=0;g<d.length;g++){e[c.length+g]=d[g]}a.children(e)}},e:function(a,b,c,d){var e=new $$t.ck(String,$$t.$ff.$type.specialize($$t.$e7.$type,$$t.$bu.$type.specialize($$t.$e7.$type)),0);var f=new $$t.by($$t.$e7.$type,0);var g=a.item(d.a());while(g.dimensionUniqueName()!=c.uniqueName()){d.a(d.a()+1);g=a.item(d.a())}while(g.dimensionUniqueName()==c.uniqueName()){var h=null;if(!String.isNullOrEmpty(g.hierarchyDisplayFolder())){var i=String.empty();var j=$$t.$fl.a(g.hierarchyDisplayFolder());for(var k=0;k<j.length;k++){var l=j[k];i+=l+"\\";var m;if(!function(){var n=e.tryGetValue(i,m);m=n.p1;return n.ret}()){var n=function(){var $ret=new $$t.e7;$ret.type(2);$ret.caption(l);return $ret}();m=new $$t.ff($$t.$e7.$type,$$t.$bu.$type.specialize($$t.$e7.$type),n,new $$t.by($$t.$e7.$type,0));e.add(i,m);if(h!=null){h.b().add(n)}else{f.add(n)}}h=m}}var o;switch(g.hierarchyOrigin()){case 2:o=4;break;case 1:o=3;break;default:o=5;break}var p=$$t.$fl.f(b,g,d);var q=function(){var $ret=new $$t.e7;$ret.type(o);$ret.caption(g.caption());$ret.item(g);return $ret}();$$t.$fl.setMetaItemChildren(q,p);if(h!=null){h.b().add(q)}else{f.add(q)}if(d.a()+1>=a.count()){break}d.a(d.a()+1);g=a.item(d.a())}var s=e.values().getEnumerator();while(s.moveNext()){var r=s.current();var t=r.a();$$t.$fl.setMetaItemChildren(t,r.b())}return f},f:function(a,b,c){var d=new $$t.by($$t.$e7.$type,0);if(a==null||a.count()==0){return d}var e=a.item(c.b());while(e.hierarchyUniqueName()!=b.uniqueName()){c.b(c.b()+1);e=a.item(c.b())}while(e.hierarchyUniqueName()==b.uniqueName()){var f;switch(e.depth()){case 0:case 1:f=7;break;case 2:f=8;break;case 3:f=9;break;case 4:f=10;break;default:f=11;break}var g=function(){var $ret=new $$t.e7;$ret.type(f);$ret.caption(e.caption());$ret.item(e);return $ret}();d.add(g);if(c.b()+1>=a.count()){break}c.b(c.b()+1);e=a.item(c.b())}return d},c:function(a,b){var c=new $$t.ck(String,$$t.$ff.$type.specialize($$t.$e7.$type,$$t.$bu.$type.specialize($$t.$e7.$type)),0);var d=function(){var $ret=new $$t.e7;$ret.type(6);$ret.caption(b.caption());$ret.item(b);return $ret}();var e=new $$t.ff($$t.$e7.$type,$$t.$bu.$type.specialize($$t.$e7.$type),d,new $$t.by($$t.$e7.$type,0));var g=a.getEnumerator();while(g.moveNext()){var f=g.current();if($b($$t.$bo.$type,f)!==null){continue}var h=e;if(!String.isNullOrEmpty(f.measureGroupName())){if(!function(){var i=c.tryGetValue(f.measureGroupName(),h);h=i.p1;return i.ret}()){var i=function(){var $ret=new $$t.e7;$ret.type(2);$ret.caption(f.measureGroupName());return $ret}();h=new $$t.ff($$t.$e7.$type,$$t.$bu.$type.specialize($$t.$e7.$type),i,new $$t.by($$t.$e7.$type,0));c.add(f.measureGroupName(),h);e.b().add(h.a())}}var j=h;if(!String.isNullOrEmpty(f.measureDisplayFolder())){var k=f.measureGroupName();var l=$$t.$fl.a(f.measureDisplayFolder());for(var m=0;m<l.length;m++){var n=l[m];k+="\\"+n;var o;if(!function(){var p=c.tryGetValue(k,o);o=p.p1;return p.ret}()){var p=function(){var $ret=new $$t.e7;$ret.type(2);$ret.caption(n);return $ret}();o=new $$t.ff($$t.$e7.$type,$$t.$bu.$type.specialize($$t.$e7.$type),p,new $$t.by($$t.$e7.$type,0));c.add(k,o);j.b().add(p)}j=o}}var q=function(){var $ret=new $$t.e7;$ret.type(6);$ret.caption(f.caption());$ret.item(f);return $ret}();j.b().add(q)}var r=new $$t.by($$t.$e7.$type,0);var t=$$t.$cp.w($$t.$e7.$type,String,$$t.$cp.t($$t.$e7.$type,e.b(),function(u){return u.type()==2}),function(u){return u.caption()}).getEnumerator();while(t.moveNext()){var s=t.current();r.add(s)}var v=$$t.$cp.w($$t.$e7.$type,String,$$t.$cp.t($$t.$e7.$type,e.b(),function(w){return w.type()!=2}),function(w){return w.caption()}).getEnumerator();while(v.moveNext()){var u=v.current();r.add(u)}$$t.$fl.setMetaItemChildren(d,r);var x=c.values().getEnumerator();while(x.moveNext()){var w=x.current();var y=w.b();var z=$$t.$cp.y($$t.$e7.$type,$$t.$cp.w($$t.$e7.$type,String,$$t.$cp.t($$t.$e7.$type,y,function(aa){return aa.type()==2}),function(aa){return aa.caption()}));var aa=$$t.$cp.y($$t.$e7.$type,$$t.$cp.w($$t.$e7.$type,String,$$t.$cp.t($$t.$e7.$type,y,function(ab){return ab.type()!=2}),function(ab){return ab.caption()}));var ab=new $$t.by($$t.$e7.$type,0);for(var ac=0;ac<z.count();ac++){ab.add(z.item(ac))}for(var ad=0;ad<aa.count();ad++){ab.add(aa.item(ad))}var ae=w.a();$$t.$fl.setMetaItemChildren(ae,ab)}return d},b:function(a,b,c){var d=new $$t.ck(String,$$t.$ff.$type.specialize($$t.$e7.$type,$$t.$bu.$type.specialize($$t.$e7.$type)),0);var e=$$t.$cp.y($$t.$bn.$type,c.z());c.z(e);var f=new $$t.by($$t.$bo.$type,0);c.v(f);var g=function(){var $ret=new $$t.e7;$ret.type(12);$ret.caption(b.caption());$ret.item(b);return $ret}();var h=new $$t.ff($$t.$e7.$type,$$t.$bu.$type.specialize($$t.$e7.$type),g,new $$t.by($$t.$e7.$type,0));var j=a.getEnumerator();while(j.moveNext()){var i=j.current();var k=h;if(!String.isNullOrEmpty(i.kpiDisplayFolder())){var l=String.empty();var m=$$t.$fl.a(i.kpiDisplayFolder());for(var n=0;n<m.length;n++){var o=m[n];l+="\\"+o;var p;if(!function(){var q=d.tryGetValue(l,p);p=q.p1;return q.ret}()){var q=function(){var $ret=new $$t.e7;$ret.type(2);$ret.caption(o);return $ret}();p=new $$t.ff($$t.$e7.$type,$$t.$bu.$type.specialize($$t.$e7.$type),q,new $$t.by($$t.$e7.$type,0));d.add(l,p);k.b().add(q)}k=p}}var r=function(){var $ret=new $$t.e7;$ret.type(13);$ret.caption(i.caption());$ret.item(i);return $ret}();if(!String.isNullOrEmpty(i.kpiValue())){var s=null;var t=6;var u="Value";if(!function(){var v=c.f(i.kpiValue(),s);s=v.p1;return v.ret}()){t=14;s=$$t.$bo.createKpiValueMeasure(i);e.add(s);f.add(s)}else{u+=" ("+s.caption()+")"}r.e(function(){var $ret=new $$t.e7;$ret.caption(u);$ret.item(s);$ret.type(t);return $ret}())}if(!String.isNullOrEmpty(i.kpiGoal())){var v=null;var w=6;var x="Goal";if(!function(){var y=c.f(i.kpiGoal(),v);v=y.p1;return y.ret}()){w=15;v=$$t.$bo.createKpiGoalMeasure(i);e.add(v);f.add(v)}else{x+=" ("+v.caption()+")"}r.e(function(){var $ret=new $$t.e7;$ret.caption(x);$ret.item(v);$ret.type(w);return $ret}())}if(!String.isNullOrEmpty(i.kpiStatus())){var y=$$t.$bo.createKpiStatusMeasure(i);e.add(y);f.add(y);r.e(function(){var $ret=new $$t.e7;$ret.caption("Status");$ret.item(y);$ret.type(16);return $ret}())}if(!String.isNullOrEmpty(i.kpiTrend())){var z=$$t.$bo.createKpiTrendMeasure(i);e.add(z);f.add(z);r.e(function(){var $ret=new $$t.e7;$ret.caption("Trend");$ret.item(z);$ret.type(17);return $ret}())}if(!String.isNullOrEmpty(i.kpiWeight())){var aa=$$t.$bo.createKpiWeightMeasure(i);e.add(aa);f.add(aa);r.e(function(){var $ret=new $$t.e7;$ret.caption("Weight");$ret.item(aa);$ret.type(18);return $ret}())}k.b().add(r)}var ab=new $$t.by($$t.$e7.$type,0);var ad=$$t.$cp.w($$t.$e7.$type,String,$$t.$cp.t($$t.$e7.$type,h.b(),function(ae){return ae.type()==2}),function(ae){return ae.caption()}).getEnumerator();while(ad.moveNext()){var ac=ad.current();ab.add(ac)}var af=$$t.$cp.w($$t.$e7.$type,String,$$t.$cp.t($$t.$e7.$type,h.b(),function(ag){return ag.type()!=2}),function(ag){return ag.caption()}).getEnumerator();while(af.moveNext()){var ae=af.current();ab.add(ae)}$$t.$fl.setMetaItemChildren(g,ab);var ah=d.values().getEnumerator();while(ah.moveNext()){var ag=ah.current();var ai=ag.b();var aj=$$t.$cp.y($$t.$e7.$type,$$t.$cp.w($$t.$e7.$type,String,$$t.$cp.t($$t.$e7.$type,ai,function(ak){return ak.type()==2}),function(ak){return ak.caption()}));var ak=$$t.$cp.y($$t.$e7.$type,$$t.$cp.w($$t.$e7.$type,String,$$t.$cp.t($$t.$e7.$type,ai,function(al){return al.type()!=2}),function(al){return al.caption()}));var al=new $$t.by($$t.$e7.$type,0);for(var am=0;am<aj.count();am++){al.add(aj.item(am))}for(var an=0;an<ak.count();an++){al.add(ak.item(an))}var ao=ag.a();$$t.$fl.setMetaItemChildren(ao,al)}return g},a:function(a){var b=a.split("\\");return b},$type:new $.ig.Type("MetaTreeHelper",$.ig.$ot)},true);$c("HierarchyItemPosition:fm","Object",{init:function(){$.ig.$op.init.call(this)},_a:0,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_b:0,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},$type:new $.ig.Type("HierarchyItemPosition",$.ig.$ot)},true);$c("DataSourceBaseOptions:fc","Object",{init:function(){$.ig.$op.init.call(this)},_cube:null,cube:function(a){if(arguments.length===1){this._cube=a;return a}else{return this._cube}},_measureGroup:null,measureGroup:function(a){if(arguments.length===1){this._measureGroup=a;return a}else{return this._measureGroup}},_measures:null,measures:function(a){if(arguments.length===1){this._measures=a;return a}else{return this._measures}},_filters:null,filters:function(a){if(arguments.length===1){this._filters=a;return a}else{return this._filters}},_columns:null,columns:function(a){if(arguments.length===1){this._columns=a;return a}else{return this._columns}},_rows:null,rows:function(a){if(arguments.length===1){this._rows=a;return a}else{return this._rows}},$type:new $.ig.Type("DataSourceBaseOptions",$.ig.$ot)},true);$c("AxisDefinitionParser:fk","Object",{init:function(a){$.ig.$op.init.call(this);this.d(-1);this.k(a)},_a:false,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},_d:0,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_k:null,k:function(a){if(arguments.length===1){this._k=a;return a}else{return this._k}},b:function(){if(this.d()==this.k().length-1){return false}var a=-1;var b=-1;var c=false;while(this.d()+1<this.k().length){this.d(this.d()+1);var d=this.k().substr(this.d(),1);switch(d){case"[":if(a==-1){a=this.d()}break;case"]":b=this.d();while(this.d()+1<this.k().length){d=this.k().substr(this.d()+1,1);switch(d){case"]":b=this.d()+1;break;case",":if("]"==this.k().substr(this.d(),1)){c=true}break;case"{":case"}":c=true;break}if(c){break}this.d(this.d()+1)}c=true;break;case",":c=true;break;case"{":this.a(true);break;case"}":c=true;this.a(false);break}if(c){c=false;if(a>-1&&b>-1){break}}}if(this.d()==this.k().length-1){if(b==-1||a==-1){return false}}var e=this.k().substr(a,b-a+1).trim([]);this.g(e);return true},c:function(){var a=new $$t.by($$t.$fg.$type,0);var b=null;while(this.b()){if(!this.a()){b=new $$t.ec(String);var c=new $$t.fg(this.g(),b);a.add(c)}else if(b!=null){b.add(this.g())}}return a},$type:new $.ig.Type("AxisDefinitionParser",$.ig.$ot)},true);$c("CoreOlapElementParser:fq","Object",{init:function(a){$.ig.$op.init.call(this);this.c(-1);this.h(a)},_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},_c:0,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_h:null,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},a:function(){if(this.c()==this.h().length-1){return false}var a=-1;var b=-1;var c=false;while(this.c()+1<this.h().length){this.c(this.c()+1);var d=this.h().substr(this.c(),1);switch(d){case"[":if(a==-1){a=this.c()}break;case"]":b=this.c();while(this.c()+1<this.h().length){d=this.h().substr(this.c()+1,1);switch(d){case"]":b=this.c()+1;break;case".":c=true;break}if(c){break}this.c(this.c()+1)}break;case".":c=true;break}if(c){c=false;if(a>-1&&b>-1){break}}}if(this.c()==this.h().length-1){if(b==-1||a==-1){return false}}var e=this.h().substr(a,b-a+1).trim([]);this.f(e);return true},b:function(){var a=new $$t.by(String,0);while(this.a()){a.add(this.f())}return a},$type:new $.ig.Type("CoreOlapElementParser",$.ig.$ot)},true);$c("KeyValueItem:d4","Object",{init:function(){$.ig.$op.init.call(this)},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},$type:new $.ig.Type("KeyValueItem",$.ig.$ot)},true);$c("AxisElement:fg","Object",{init:function(a,b){$.ig.$op.init.call(this);this.b(a);this.a(b)},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},$type:new $.ig.Type("AxisElement",$.ig.$ot)},true);$c("MeasureGroupMetaItemsCache:fe","Object",{a:null,c:null,b:null,f:null,d:null,g:null,e:null,init:function(a,b,c,d){$.ig.$op.init.call(this);this.a=new $$t.ck(String,$$t.$a5.$type.specialize($$t.$bb.$type),0);this.c=new $$t.ck(String,$$t.$a5.$type.specialize($$t.$bn.$type),0);this.b=new $$t.ck(String,$$t.$a5.$type.specialize($$t.$bl.$type),0);this.f=d;this.d=a;this.g=b;this.e=c},getMeasureGroupDimensions:function(a){var $self=this;var b;if(!function(){var c=$self.a.tryGetValue(a,b);b=c.p1;return c.ret}()){var c=new $$t.by(String,0);var e=this.f.getEnumerator();while(e.moveNext()){var d=e.current();if(d.measureGroupName()==a){c.add(d.dimensionUniqueName())}}var f=new $$t.by($$t.$bb.$type,0);var h=this.d.getEnumerator();while(h.moveNext()){var g=h.current();if(c.contains(g.uniqueName())||g.dimensionType()==2){f.add(g)}}this.a.add(a,f);b=f}return b},getMeasureGroupMeasures:function(a){var $self=this;var b;if(!function(){var c=$self.c.tryGetValue(a,b);b=c.p1;return c.ret}()){var c=new $$t.by($$t.$bn.$type,0);var e=this.g.getEnumerator();while(e.moveNext()){var d=e.current();if(d.measureGroupName()==a){c.add(d)}}this.c.add(a,c);b=c}return b},getMeasureGroupKpis:function(a){var $self=this;var b;if(!function(){var c=$self.b.tryGetValue(a,b);b=c.p1;return c.ret}()){var c=new $$t.by($$t.$bl.$type,0);var e=this.e.getEnumerator();while(e.moveNext()){var d=e.current();if(d.measureGroupName()==a){c.add(d)}}this.b.add(a,c);b=c}return b},$type:new $.ig.Type("MeasureGroupMetaItemsCache",$.ig.$ot)},true);$c("PositionItemInfo$2:cj","Dictionary$2",{$tKey:null,$tSortKey:null,init:function($tKey,$tSortKey,a,b,c,d){this.$tKey=$tKey;this.$tSortKey=$tSortKey;this.$type=this.$type.specialize(this.$tKey,this.$tSortKey);$$t.$ck.init.call(this,this.$tKey,$$t.$cj.$type.specialize(this.$tKey,this.$tSortKey),0);this.x=new $$t.ck(this.$tKey,$.ig.$op.$type,0);this.positionItem(a);this.positionIndex(b);this.positionItemIndex(c);this.positionItemDepth(0);this.positionItemDepthMin(-1);this.positionItemDepthMax(2147483647);this.positionSize(d);if(a!=null){this.positionItemDepth(this.positionItem().depth());this.key(this.positionItem().key());this.parentKey(this.positionItem().parentKey());this.hierarchyKey(this.positionItem().hierarchyKey());this.hierarchyLevelKey(this.positionItem().hierarchyLevelKey());
this.sortKey(this.positionItem().sortKey());this.caption(this.positionItem().caption())}},n:function(a,b,c,d){return new $$t.cj(this.$tKey,this.$tSortKey,a,b,c,d)},_positionItemDepthMin:0,positionItemDepthMin:function(a){if(arguments.length===1){this._positionItemDepthMin=a;return a}else{return this._positionItemDepthMin}},_positionItemDepthMax:0,positionItemDepthMax:function(a){if(arguments.length===1){this._positionItemDepthMax=a;return a}else{return this._positionItemDepthMax}},_positionItem:null,positionItem:function(a){if(arguments.length===1){this._positionItem=a;return a}else{return this._positionItem}},_positionIndex:0,positionIndex:function(a){if(arguments.length===1){this._positionIndex=a;return a}else{return this._positionIndex}},_positionItemDepth:0,positionItemDepth:function(a){if(arguments.length===1){this._positionItemDepth=a;return a}else{return this._positionItemDepth}},_positionItemIndex:0,positionItemIndex:function(a){if(arguments.length===1){this._positionItemIndex=a;return a}else{return this._positionItemIndex}},_positionSize:0,positionSize:function(a){if(arguments.length===1){this._positionSize=a;return a}else{return this._positionSize}},_key:null,key:function(a){if(arguments.length===1){this._key=a;return a}else{return this._key}},_parentKey:null,parentKey:function(a){if(arguments.length===1){this._parentKey=a;return a}else{return this._parentKey}},_hierarchyKey:null,hierarchyKey:function(a){if(arguments.length===1){this._hierarchyKey=a;return a}else{return this._hierarchyKey}},_hierarchyLevelKey:null,hierarchyLevelKey:function(a){if(arguments.length===1){this._hierarchyLevelKey=a;return a}else{return this._hierarchyLevelKey}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_sortKey:null,sortKey:function(a){if(arguments.length===1){this._sortKey=a;return a}else{return this._sortKey}},_isExpandable:false,isExpandable:function(a){if(arguments.length===1){this._isExpandable=a;return a}else{return this._isExpandable}},_isExpanded:false,isExpanded:function(a){if(arguments.length===1){this._isExpanded=a;return a}else{return this._isExpanded}},t:function(a,b,c){var d=false;if(this.positionItemIndex()==-1){d=true}else{if(c!=null){if($d(this.$tKey,a.item(this.positionItemIndex()).key())!=null){var e=c.item(this.positionItemIndex());d=a.item(this.positionItemIndex()).key().equals($d(this.$tKey,e.key()))}}}if(this.positionItemIndex()+1==this.positionSize()){return d}var f=this.u(a,b,this.positionItemIndex()+1,c);return d&&f},ai:function(a,b){},x:null,u:function(a,b,c,d){var $self=this;var e;var f=a.item(c);if(!this.containsKey(f.key())){var g=this.n(f,b,c,this.positionSize());g.isExpandable(f.isExpandable());if(this.x.containsKey(g.key())){this.x.remove(g.key());g.isExpanded(true)}if($d(this.$tKey,f.parentKey())!=null){var h=null;if(function(){var i=$self.tryGetValue(f.parentKey(),h);h=i.p1;return i.ret}()){h.isExpanded(true)}else{if(!this.x.containsKey(f.parentKey())){this.x.add(f.parentKey(),null)}}}e=g.t(a,b,d);this.add(f.key(),g);if(this.positionItemDepthMin()==-1){this.positionItemDepthMin(f.depth())}else{this.positionItemDepthMin(Math.min(this.positionItemDepthMin(),f.depth()))}if(this.positionItemDepthMax()==2147483647){this.positionItemDepthMax(f.depth())}else{this.positionItemDepthMax(Math.max(this.positionItemDepthMax(),f.depth()))}this.ai(a,g)}else{var i=this.item(f.key());e=i.t(a,b,d)}return e},getIndex2:function(a){var b=new Array(a.count());for(var c=0;c<b.length;c++){b[c]=a.item(c).key()}return this.getIndex(b)},getIndex:function(a){return this.z(a,a.length)},z:function(a,b){var $self=this;if(this.positionItemIndex()==b-1){return this.positionIndex()}var c;if(!function(){var d=$self.tryGetValue(a[$self.positionItemIndex()+1],c);c=d.p1;return d.ret}()){return-1}if(c.count()==0){return c.positionIndex()}return c.z(a,b)},$type:new $.ig.Type("PositionItemInfo$2",$$t.$ck.$type.specialize(0,1))},true);$c("PositionResolver$2:bx","Object",{$tKey:null,$tSortKey:null,m:0,b:null,f:null,g:null,init:function($tKey,$tSortKey,a,b){this.$tKey=$tKey;this.$tSortKey=$tSortKey;this.$type=this.$type.specialize(this.$tKey,this.$tSortKey);this.m=0;$.ig.$op.init.call(this);this.positions($$t.$cp.y($$t.$ch.$type.specialize(this.$tKey,this.$tSortKey),a));this.positionSize(b)},getPositionIndexCompleted:null,_positions:null,positions:function(a){if(arguments.length===1){this._positions=a;return a}else{return this._positions}},_positionSize:0,positionSize:function(a){if(arguments.length===1){this._positionSize=a;return a}else{return this._positionSize}},rootPositionInfo:function(){if(this.b==null){this.b=this.d(this.positionSize())}return this.b},d:function(a){return new $$t.cj(this.$tKey,this.$tSortKey,null,-1,-1,a)},hasUnregisterdPositions:function(){return this.m<this.positions().count()},completeRegisterPositions:function(){if(this.hasUnregisterdPositions()){this.q(null)}},resolveParentPositionItem:function(a,b){b=-1;var c=$b($$t.$c2.$type.specialize(this.$tKey,this.$tSortKey),a);if(c==null||$d(this.$tKey,c.parentKey())==null){return{ret:null,p1:b}}var d=c.position().indexOf(c);var e=new Array(c.position().itemsCount());for(var f=0;f<c.position().itemsCount();f++){e[f]=c.position().item(f).key()}e[d]=c.parentKey();b=this.rootPositionInfo().getIndex(e);if(b==-1){return{ret:null,p1:b}}var g=this.positions().__inner[b];var h=g.item(d);return{ret:h,p1:b}},getHostPositionItemInfo:function(a,b){var c=this.rootPositionInfo();var d=a.item(b);for(var e=0;e<b;e++){var f;if(function(){var g=c.tryGetValue(a.item(e).key(),f);f=g.p1;return g.ret}()){c=f}else{c=null;break}}if(c==null){return null}if(!c.containsKey(d.key())){return null}return c},i:function(a,b){if(this.rootPositionInfo().count()==0){return null}var c=this.rootPositionInfo();var d=a.position().indexOf(a);for(var e=0;e<d;e++){var f;if(function(){var g=c.tryGetValue(a.position().item(e).key(),f);f=g.p1;return g.ret}()){c=f}else{c=null;break}}if(c==null){return null}if(!c.containsKey(a.key())){return null}var g=new $$t.by($.ig.Number.prototype.$type,0);this.u(a.key(),c,g);if(b==1){g.sort2(function(h,i){if(h==i){return 0}if(h>i){return-1}return 1});return g}g.sort2(function(h,i){if(h==i){return 0}if(h>i){return 1}return-1});return g},u:function(a,b,c){var $self=this;var e=$$t.$cp.t($$t.$cj.$type.specialize(this.$tKey,this.$tSortKey),b.values(),function(f){return a.equals($d($self.$tKey,f.parentKey()))}).getEnumerator();while(e.moveNext()){var d=e.current();if(d.count()==0){c.add(d.positionIndex())}else{this.t(d,c)}if(!d.isExpanded()){continue}if(d.positionItemDepth()<b.positionItemDepthMax()){this.u(d.key(),b,c)}}},t:function(a,b){var $self=this;var d=$$t.$cp.t($$t.$cj.$type.specialize(this.$tKey,this.$tSortKey),a.values(),function(e){return $d($self.$tKey,e.parentKey())==null}).getEnumerator();while(d.moveNext()){var c=d.current();if(c.count()==0){b.add(c.positionIndex())}else{this.t(c,b)}if(!c.isExpanded()){continue}if(c.positionItemDepth()<a.positionItemDepthMax()){this.u(c.key(),a,b)}}},getChildren:function(a,b){var $self=this;if(this.hasUnregisterdPositions()){this.completeRegisterPositions()}var c=this.getHostPositionItemInfo(a,b);var d=a.item(b);return $$t.$cp.t($$t.$cj.$type.specialize(this.$tKey,this.$tSortKey),c.values(),function(e){return d.key().equals($d($self.$tKey,e.parentKey()))})},isMemberExpanded:function(a){if(this.hasUnregisterdPositions()){this.completeRegisterPositions()}var b=this.getPositionIndex(a.position());if(b==-1||this.rootPositionInfo().count()==0){return $l($$t.$e.$type,null)}var c=a.position().indexOf(a);var d=this.rootPositionInfo();for(var e=0;e<c;e++){var f;if(function(){var g=d.tryGetValue(a.position().item(e).key(),f);f=g.p1;return g.ret}()){d=f}else{d=null;break}}if(d==null){return $l($$t.$e.$type,null)}if(!d.containsKey(a.key())){return $l($$t.$e.$type,null)}var g=null;var h=d.values().getEnumerator();while(h.moveNext()){if(a.key().equals($d(this.$tKey,h.current().parentKey()))){g=h.current();break}}return $l($$t.$e.$type,g!=null)},getPositionIndex:function(a){if(a==null){return-1}if(a.itemsCount()!=this.positionSize()){return-1}if(a.isEmpty()&&this.positions().count()==1&&this.positions().__inner[0].isEmpty()){return 0}if(this.m>0){var b=this.o(a);if(b>-1){return b}if(this.m==this.positions().count()){return-1}}return this.q(a)},o:function(a){if(a.isEmpty()&&this.positions().count()==1&&this.positions().__inner[0].isEmpty()){return 0}return this.rootPositionInfo().getIndex2($$t.$cp.y($$t.$ci.$type.specialize(this.$tKey,this.$tSortKey),a.getItems()))},q:function(a){var b=a==null;var c=-1;for(var d=this.m;d<this.positions().count();d++){var e=this.positions().__inner[d];var f=this.rootPositionInfo().t(e,d,a);this.m++;if(c==-1&&f){c=d;if(!b){break}}}return c},$type:new $.ig.Type("PositionResolver$2",$.ig.$ot)},true);$c("LevelSortDirection:ev","Object",{init:function(){$.ig.$op.init.call(this);this.sortBehavior(1)},_levelUniqueName:null,levelUniqueName:function(a){if(arguments.length===1){this._levelUniqueName=a;return a}else{return this._levelUniqueName}},_sortDirection:0,sortDirection:function(a){if(arguments.length===1){this._sortDirection=a;return a}else{return this._sortDirection}},_sortBehavior:0,sortBehavior:function(a){if(arguments.length===1){this._sortBehavior=a;return a}else{return this._sortBehavior}},$type:new $.ig.Type("LevelSortDirection",$.ig.$ot)},true);$c("TaskExtensions:fj","Object",{init:function(){$.ig.$op.init.call(this)},a:function($tResult,a,b){var c=new $$t.dl($tResult,0);a.e(function(d){if(d.a()==null){try{b(d).i(function(e){if(e.a()==null){c.e(e.m());return}c.d(e.a())})}catch(e_){var e;e=e_;console.log(e_);c.d(e)}}else{c.d(d.a())}});return c.b()},b:function($tResult1,$tResult2,a,b){return $$t.$fj.a($tResult2,a,function(c){return b(c)})},$type:new $.ig.Type("TaskExtensions",$.ig.$ot)},true);$c("HierarchyFilterView:fz","Object",{c:null,d:null,e:null,init:function(a){this.e=new $$t.ck(String,$$t.$f0.$type,0);$.ig.$op.init.call(this);this.hierarchy(a);this.d=new $$t.ck($.ig.Number.prototype.$type,$$t.$bu.$type.specialize($$t.$f0.$type),0);this.c=new $$t.ck(String,$$t.$f0.$type,0)},filterMemberExpansionChanged:null,filterMemberSelectionChanged:null,_hierarchy:null,hierarchy:function(a){if(arguments.length===1){this._hierarchy=a;return a}else{return this._hierarchy}},addFiltersForMembers:function(a){var c=a.getEnumerator();while(c.moveNext()){var b=c.current();this.addFilterForMember(b)}},addFilterForMember:function(a){var $self=this;if(!this.c.containsKey(a.uniqueName())){var b=new $$t.f0(a);b.propertyChanged=$.ig.Delegate.prototype.combine(b.propertyChanged,this.o.runOn(this));b.selectionChanged=$.ig.Delegate.prototype.combine(b.selectionChanged,this.p.runOn(this));var c;if(!function(){var d=$self.d.tryGetValue(a.levelDepth(),c);c=d.p1;return d.ret}()){c=new $$t.by($$t.$f0.$type,0);this.d.add(a.levelDepth(),c)}this.c.add(a.uniqueName(),b);this.e.add(a.uniqueName(),b);c.add(b);this.j(b);this.m(b)}},tryGetFilterMember:function(a){if(this.c.containsKey(a)){return this.c.item(a)}return null},getRootFilterMembers:function(){var a=-1;var c=this.d.keys().getEnumerator();while(c.moveNext()){var b=c.current();if(a==-1){a=b}else{a=Math.min(b,a)}}if(a==-1){return null}return this.d.item(a)},getSelectedFilterItems:function(){var a=this.getRootFilterMembers();var b=new $$t.by($$t.$f0.$type,0);var c=0;var e=a.getEnumerator();while(e.moveNext()){var d=e.current();if(d.isSelected().hasValue()==true&&d.isSelected().value()==true){c++}}if(c==a.count()){return b}var g=a.getEnumerator();while(g.moveNext()){var f=g.current();if(f.isSelected().hasValue()==false){this.n(f,b)}else if(f.isSelected().hasValue()==true&&f.isSelected().value()==true){b.add(f)}}return b},p:function(a,b){if(this.filterMemberSelectionChanged!=null){this.filterMemberSelectionChanged(this,new $$t.f4(a))}},o:function(a,b){if(b.propertyName()=="IsExpanded"){if(this.filterMemberExpansionChanged!=null){this.filterMemberExpansionChanged(this,new $$t.f4(a))}}},n:function(a,b){if(a.isSelected().hasValue()==true&&a.isSelected().value()==true){b.add(a)}else{if(a.children()==null){return}var d=a.children().getEnumerator();while(d.moveNext()){var c=d.current();this.n(c,b)}}},m:function(a){var $self=this;var b=a.member().parentUniqueName();if(String.isNullOrEmpty(b)){return}var c;if(function(){var d=$self.c.tryGetValue(b,c);c=d.p1;return d.ret}()){c.n(a);if(c.isSelected().hasValue()==true&&c.isSelected().value()==false){a.isSelected($l($$t.$e.$type,false))}}},j:function(a){var $self=this;var b=a.member().levelDepth();var c;if(function(){var d=$self.d.tryGetValue(b+1,c);c=d.p1;return d.ret}()){var e=c.getEnumerator();while(e.moveNext()){var d=e.current();if(d.member().parentUniqueName()==a.member().uniqueName()){a.n(d)}}}},$type:new $.ig.Type("HierarchyFilterView",$.ig.$ot)},true);$c("FilterMember:f0","Object",{l:$l($$t.$e.$type,null),c:false,e:false,d:false,init:function(a){this.e=false;this.d=false;$.ig.$op.init.call(this);var b=$l($$t.$e.$type,true);this.l=b;this.member(a);this.k(0);this.j(0)},selectionChanged:null,propertyChanged:null,_parent:null,parent:function(a){if(arguments.length===1){this._parent=a;return a}else{return this._parent}},_member:null,member:function(a){if(arguments.length===1){this._member=a;return a}else{return this._member}},isExpandable:function(){return this.member().childrenCardinality()>0},isExpanded:function(a){if(arguments.length===1){if(this.c!=a){this.c=a;this.o("IsExpanded")}return a}else{return this.c}},isSelected:function(a){if(arguments.length===1){var b=a;var c=$l($$t.$e.$type,null);if($i(this.l,b)==false){var d=this.l;this.l=a;if(!this.d){if(this.l.hasValue()==true){if(this.children()!=null){var f=this.children().getEnumerator();while(f.moveNext()){var e=f.current();e.e=true;e.isSelected(this.l);e.e=false}}}}if(this.parent()!=null){if(d.hasValue()==true&&d.value()==false){if(this.l.hasValue()==false){this.p(true)}this.q(false)}else if(d.hasValue()==false){if(this.l.hasValue()==true&&this.l.value()==false){this.q(true)}this.p(false)}else{if(this.l.hasValue()==true&&this.l.value()==false){this.q(true)}else if(this.l.hasValue()==false){this.p(true)}}if(!this.e){this.parent().d=true;var g=this.parent().k();var h=this.parent().j();var i=this.parent().children().count();if(h==0){if(g==0){this.parent().isSelected($l($$t.$e.$type,true))}else if(g==i){this.parent().isSelected($l($$t.$e.$type,false))}else{this.parent().isSelected(c)}}else{this.parent().isSelected(c)}this.parent().d=false}}this.o("IsSelected");if(!this.e&&!this.d){if(this.selectionChanged!=null){this.selectionChanged(this,$$t.$c5.empty)}}}return a}else{return this.l}},q:function(a){if(a){this.parent().k(this.parent().k()+1)}else{this.parent().k(this.parent().k()-1)}},p:function(a){if(a){this.parent().j(this.parent().j()+1)}else{this.parent().j(this.parent().j()-1)}},_children:null,children:function(a){if(arguments.length===1){this._children=a;return a}else{return this._children}},n:function(a){if(this.children()==null){this.children(new $$t.by($$t.$f0.$type,0))}a.parent(this);this.children().add(a);this.o("Children")},_k:0,k:function(a){if(arguments.length===1){this._k=a;return a}else{return this._k}},_j:0,j:function(a){if(arguments.length===1){this._j=a;return a}else{return this._j}},o:function(a){if(this.propertyChanged!=null){this.propertyChanged(this,new $$t.f3(a))}},$type:new $.ig.Type("FilterMember",$.ig.$ot,[$$t.$f1.$type])},true);$c("FilterMemberStateChangedEventArgs:f4","EventArgs",{init:function(a){$$t.$c5.init.call(this);this.filterMember(a)},_filterMember:null,filterMember:function(a){if(arguments.length===1){this._filterMember=a;return a}else{return this._filterMember}},$type:new $.ig.Type("FilterMemberStateChangedEventArgs",$$t.$c5.$type)},true);$c("ResultSorter$1:ey","Object",{$t:null,_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_d:false,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_c:false,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},init:function($t,a,b,c){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this);this.a(a);this.d(b);this.c(c)},b:function(){},e:function(a,b,c){a.e();var d=a.d();var e=new Array(d.count());for(var f=0;f<d.count();f++){var g=d.item(f);c.add(g,f)}for(var h=0;h<d.count();h++){var i=d.item(h);var j=b.tuples().__inner[i];e[h]=j}return new $$t.by($$t.$c9.$type,1,e)},$type:new $.ig.Type("ResultSorter$1",$.ig.$ot)},true);$c("AxisTupleVisitor:ez","Object",{_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},init:function(a){$.ig.$op.init.call(this);this.a(a)},e:function(){if(this.a().positionResolver().hasUnregisterdPositions()){this.a().positionResolver().completeRegisterPositions()}this.d(new $$t.by($.ig.Number.prototype.$type,2,this.a().tuples().count()));var a=this.a().positionResolver().rootPositionInfo();var b=$$t.$cp.t($$t.$cj.$type.specialize(String,$.ig.$op.$type),a.values(),function(c){return c.positionItemDepth()==a.positionItemDepthMin()});var d=this.c(a,b).getEnumerator();while(d.moveNext()){var c=d.current();this.f(a,c)}},b:function(a,b){},c:function(a,b){},f:function(a,b){var c=$$t.$cp.t($$t.$cj.$type.specialize(String,$.ig.$op.$type),b.values(),function(d){return d.positionItemDepth()==b.positionItemDepthMin()});if($$t.$cp.ai($$t.$cj.$type.specialize(String,$.ig.$op.$type),c)>0){var e=c.getEnumerator();while(e.moveNext()){var d=e.current();this.f(b,d)}}else{this.d().add(b.positionIndex())}var f=this.b(a,b);var h=f.getEnumerator();while(h.moveNext()){var g=h.current();this.f(a,g)}},$type:new $.ig.Type("AxisTupleVisitor",$.ig.$ot)},true);$c("AxisHeaderSortingVisitor:e0","AxisTupleVisitor",{h:null,i:null,g:null,init:function(a,b,c,d){$$t.$ez.init.call(this,a);this.h=b;this.i=c;this.g=d},b:function(a,b){var $self=this;var c=$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.t($$t.$cj.$type.specialize(String,$.ig.$op.$type),a.values(),function(d){return d.parentKey()==b.key()}));if(c.count()>0){var d=c.item(0);var e;if(function(){var f=$self.h.tryGetValue(d.hierarchyLevelKey(),e);e=f.p1;return f.ret}()){if(e.sortBehavior()==1){c=e.sortDirection()==0?$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.w($$t.$cj.$type.specialize(String,$.ig.$op.$type),$.ig.$op.$type,c,function(f){return f.sortKey()})):$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.x($$t.$cj.$type.specialize(String,$.ig.$op.$type),$.ig.$op.$type,c,function(f){return f.sortKey()}))}else{c=e.sortDirection()==0?$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.w($$t.$cj.$type.specialize(String,$.ig.$op.$type),String,c,function(f){return f.caption()})):$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.x($$t.$cj.$type.specialize(String,$.ig.$op.$type),String,c,function(f){return f.caption()}))}if(!$$t.$cp.e(String,$$t.$cp.n($$t.$ev.$type,String,this.i,function(f){return f.levelUniqueName()}),e.levelUniqueName())){this.i.add(e)}var f;if(!function(){var g=$self.g.tryGetValue(d.positionItemIndex(),f);f=g.p1;return g.ret}()){f=new $$t.ck($.ig.Number.prototype.$type,$$t.$c8.$type,0);this.g.add(b.positionItemIndex(),f)}f.item(b.positionItemDepth(),e.sortDirection())}}return c},c:function(a,b){var $self=this;var c=$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),b);if(c.count()>0){var d=c.item(0);var e;if(d.hierarchyLevelKey()!=null&&function(){var f=$self.h.tryGetValue(d.hierarchyLevelKey(),e);e=f.p1;return f.ret}()){if(e.sortBehavior()==1){c=e.sortDirection()==0?$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.w($$t.$cj.$type.specialize(String,$.ig.$op.$type),$.ig.$op.$type,c,function(f){return f.sortKey()})):$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.x($$t.$cj.$type.specialize(String,$.ig.$op.$type),$.ig.$op.$type,c,function(f){return f.sortKey()}))}else{c=e.sortDirection()==0?$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.w($$t.$cj.$type.specialize(String,$.ig.$op.$type),String,c,function(f){return f.caption()})):$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.x($$t.$cj.$type.specialize(String,$.ig.$op.$type),String,c,function(f){return f.caption()}))}this.i.add(e);var f;if(!function(){var g=$self.g.tryGetValue(d.positionItemIndex(),f);f=g.p1;return g.ret}()){f=new $$t.ck($.ig.Number.prototype.$type,$$t.$c8.$type,0);this.g.add(a.positionItemIndex(),f)}f.item(a.positionItemDepth(),e.sortDirection())}}return c},$type:new $.ig.Type("AxisHeaderSortingVisitor",$$t.$ez.$type)},true);$c("ResultHeaderSorter:ex","ResultSorter$1",{f:null,_h:null,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},init:function(a,b,c,d){$$t.$ey.init.call(this,$$t.$e0.$type,a,b,c);this.f=new $$t.ck(String,$$t.$ev.$type,1,d.count());var f=d.getEnumerator();while(f.moveNext()){var e=f.current();this.f.item(e.levelUniqueName(),e)}},b:function(){var $self=this;this.h(new $$t.by($$t.$ev.$type,0));this.g(new $$t.ck(String,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$$t.$c8.$type)),0));if(this.a().isEmpty()){return this.a()}var a=new $$t.by($$t.$bw.$type,0);var b=0;var c=1;var d=new $$t.ck($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);var e=new $$t.ck($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);if(this.c()){var f=this.a().axes().item(b);var g=new $$t.ck($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$$t.$c8.$type),0);var h=new $$t.e0(f,this.f,this.h(),g);var i=this.e(h,f,d);var j=function(){var $ret=new $$t.bw(i,f.tupleSize());$ret.name(f.name());return $ret}();a.add(j);this.g().item(f.name(),g);c=f.tuples().count();b++}if(this.d()){var k=this.a().axes().item(b);var l=new $$t.ck($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$$t.$c8.$type),0);var m=new $$t.e0(k,this.f,this.h(),l);var n=this.e(m,k,e);var o=function(){var $ret=new $$t.bw(n,k.tupleSize());$ret.name(k.name());return $ret}();a.add(o);this.g().item(k.name(),l)}var p=new $$t.by($$t.$db.$type,2,this.a().cells().count());var r=this.a().cells().getEnumerator();while(r.moveNext()){var q=r.current();var s=q.clone();var t=s.cellOrdinal();if(this.c()){var u=t%c;var v=d.item(u);if(u!=v){var w=$a(t,c);t=w*c+v}}if(this.d()){var x=$a(t,c);var y=e.item(x);if(x!=y){var z=t%c;t=y*c+z}}s.cellOrdinal(t);p.add(s)}var aa=function(){var $ret=new $$t.bt;$ret.isEmpty($self.a().isEmpty());$ret.axes(a);$ret.cells(p);return $ret}();return aa},$type:new $.ig.Type("ResultHeaderSorter",$$t.$ey.$type.specialize($$t.$e0.$type))},true);$c("AxisValueSortingVisitor:e2","AxisTupleVisitor",{g:null,init:function(a,b){$$t.$ez.init.call(this,a);this.g=b},b:function(a,b){var c=$$t.$cp.t($$t.$cj.$type.specialize(String,$.ig.$op.$type),a.values(),function(d){return d.parentKey()==b.key()});return this.c(a,c)},c:function(a,b){var positionItemInfos_=$$t.$cp.a($$t.$cj.$type.specialize(String,$.ig.$op.$type),b);if(positionItemInfos_.length>0){var tupleSortDirections_=$$t.$cp.a($$t.$co.$type.specialize($$t.$eu.$type,Array),this.g);var sortFunction=function(tupleSortDirections){var compareCells=function(comparer,cell1,cell2){var result=comparer(cell1,cell2);if(result<0){return-1}if(result>0){return 1}return!isNaN(parseFloat(result))&&isFinite(result)?result:0};return function(o1,o2){var i,length,tupleSortDirection,cells,direction,cell1,cell2,arr1=[],arr2=[];for(i=0;i<tupleSortDirections.length;i++){tupleSortDirection=tupleSortDirections[i].key();cells=tupleSortDirections[i].value();if(tupleSortDirection.sortDirection()===$.ig.ListSortDirection.prototype.ascending){direction=1}else{direction=-1}comparer=tupleSortDirection.comparer();cell1=cells[o1.positionIndex()];cell2=cells[o2.positionIndex()];if(tupleSortDirections.length===1){arr1=direction*compareCells(comparer,cell1,cell2);arr2=direction*compareCells(comparer,cell2,cell1)}else{arr1.push(direction*compareCells(comparer,cell1,cell2));arr2.push(direction*compareCells(comparer,cell2,cell1))}}if(arr1<arr2){return-1}if(arr1>arr2){return 1}return 0}};positionItemInfos_.sort(sortFunction(tupleSortDirections_))}return positionItemInfos_},$type:new $.ig.Type("AxisValueSortingVisitor",$$t.$ez.$type)},true);$c("ResultColumnValueSorter:e1","ResultSorter$1",{f:null,_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},init:function(a,b,c,d){$$t.$ey.init.call(this,$$t.$e2.$type,a,b,c);this.f=d},b:function(){var $self=this;this.g(new $$t.by($$t.$eu.$type,0));if(!this.d()||this.a().isEmpty()){return this.a()}var a=new $$t.by($$t.$bw.$type,0);var b=0;var c=null;var d=1;if(this.c()){c=this.a().axes().item(b);d=c.tuples().count();a.add(c.clone());b++}var e=this.a().axes().item(b);var f=this.a().axes().item(b).tuples().count();var g=new $$t.ck($.ig.Number.prototype.$type,$.ig.$op.$type,1,this.a().cells().count());var i=this.a().cells().getEnumerator();while(i.moveNext()){var h=i.current();var j=null;if(function(){var k=h.properties().tryGetValue("Value",j);j=k.p1;return k.ret}()){g.item(h.cellOrdinal(),j)}else{var k=h.properties().tryGetValue("FmtValue",j);j=k.p1;g.item(h.cellOrdinal(),j)}}var l=new $$t.by($$t.$co.$type.specialize($$t.$eu.$type,Array),2,this.f.count());var n=this.f.getEnumerator();while(n.moveNext()){var m=n.current();var o;if(c!=null&&m.memberNames()!=null){if(c.positionResolver().hasUnregisterdPositions()){c.positionResolver().completeRegisterPositions()}o=c.positionResolver().rootPositionInfo().getIndex(m.memberNames());m.tupleIndex(o)}else{o=m.tupleIndex()}if(o>-1&&o<d){var p=new Array(f);for(var q=0;q<f;q++){var r=null;var s=g.tryGetValue(q*d+o,r);r=s.p1;p[q]=r}l.add(new $$t.co($$t.$eu.$type,Array,1,m,p));this.g().add(m)}}var t=new $$t.ck($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);var u=new $$t.e2(e,l);var v=this.e(u,e,t);var w=function(){var $ret=new $$t.bw(v,e.tupleSize());$ret.name(e.name());return $ret}();a.add(w);var x=new $$t.by($$t.$db.$type,2,this.a().cells().count());var z=this.a().cells().getEnumerator();while(z.moveNext()){var y=z.current();var aa=y.clone();var ab=aa.cellOrdinal();var ac=$a(ab,d);var ad=t.item(ac);if(ac!=ad){var ae=ab%d;ab=ad*d+ae}aa.cellOrdinal(ab);x.add(aa)}var af=function(){var $ret=new $$t.bt;$ret.isEmpty($self.a().isEmpty());$ret.axes(a);$ret.cells(x);return $ret}();return af},$type:new $.ig.Type("ResultColumnValueSorter",$$t.$ey.$type.specialize($$t.$e2.$type))},true);$c("TupleSortDirection:eu","Object",{init:function(){$.ig.$op.init.call(this)},_tupleIndex:0,tupleIndex:function(a){if(arguments.length===1){this._tupleIndex=a;return a}else{return this._tupleIndex}},_memberNames:null,memberNames:function(a){if(arguments.length===1){this._memberNames=a;return a}else{return this._memberNames}},_sortDirection:0,sortDirection:function(a){if(arguments.length===1){this._sortDirection=a;return a}else{return this._sortDirection}},_comparer:null,comparer:function(a){if(arguments.length===1){this._comparer=a;return a}else{return this._comparer}},$type:new $.ig.Type("TupleSortDirection",$.ig.$ot)},true);$c("DataSourceBase:f5","Object",{init:function(){$.ig.$op.init.call(this)},_dataSource:null,dataSource:function(a){if(arguments.length===1){this._dataSource=a;return a}else{return this._dataSource}},isInitialized:function(){if(this.dataSource()==null){return false}return this.dataSource().isInitialized()},_isModified:false,isModified:function(a){if(arguments.length===1){this._isModified=a;return a}else{return this._isModified}},_isUpdating:false,isUpdating:function(a){if(arguments.length===1){this._isUpdating=a;return a}else{return this._isUpdating}},initialize:function(){var promise_=this.dataSource().initialize().c();var $this=this;if(!this._isInitializedAttached){this._isInitializedAttached=true;promise_.always(function(result){var args={error:null,metadataTreeRoot:null};if(this.state()==="rejected"){args.error=result}else{args.metadataTreeRoot=result}$($this).trigger("initialized",args);$this._isInitializedAttached=false})}return promise_},cubes:function(){return this.dataSource().cubes().inner()},cube:function(){return this.dataSource().cube()},setCube:function(a){return this.dataSource().setCube(a).j($$t.$e7.$type,function(b){return b.m()}).c()},metadataTree:function(){return this.dataSource().metadataTree()},addRowItem:function(a){if($b($$t.$bk.$type,a)!==null){this.dataSource().rowAxis().add(a);this.isModified(true)}},insertRowItem:function(a,b){if($b($$t.$bk.$type,b)!==null){this.dataSource().rowAxis().insert(a,b);this.isModified(true)}},removeRowItem:function(a){if($b($$t.$bk.$type,a)!==null||$b($$t.$fa.$type,a)!==null){this.dataSource().rowAxis().remove(a);this.isModified(true)}},addColumnItem:function(a){if($b($$t.$bk.$type,a)!==null){this.dataSource().columnAxis().add(a);this.isModified(true)}},insertColumnItem:function(a,b){if($b($$t.$bk.$type,b)!==null){this.dataSource().columnAxis().insert(a,b);this.isModified(true)}},removeColumnItem:function(a){if($b($$t.$bk.$type,a)!==null||$b($$t.$fa.$type,a)!==null){this.dataSource().columnAxis().remove(a);this.isModified(true)}},addFilterItem:function(a){if($b($$t.$bk.$type,a)!==null){this.dataSource().filters().add(a);this.isModified(true)}},insertFilterItem:function(a,b){if($b($$t.$bk.$type,b)!==null){this.dataSource().filters().insert(a,b);this.isModified(true)}},removeFilterItem:function(a){if($b($$t.$bk.$type,a)!==null){this.dataSource().filters().remove(a);this.isModified(true)}},addMeasureItem:function(a){if($b($$t.$bn.$type,a)!==null){this.dataSource().measures().add(a);this.isModified(true)}},insertMeasureItem:function(a,b){if($b($$t.$bn.$type,b)!==null){this.dataSource().measures().insert(a,b);this.isModified(true)}},removeMeasureItem:function(a){if($b($$t.$bn.$type,a)!==null){this.dataSource().measures().remove(a);this.isModified(true)}},setMeasureListIndex:function(a){this.dataSource().measureListIndex(a);this.isModified(true)},setMeasureListLocation:function(a){switch(a){case"rows":this.dataSource().measureListLocation(0);break;case"columns":this.dataSource().measureListLocation(1);break;default:break}this.isModified(true)},getMeasureListLocation:function(){switch(this.dataSource().measureListLocation()){case 0:return"rows";break;case 1:return"columns";break;default:return null;break}},expandTupleMember:function(a,b,c){this.dataSource().expandTupleMember(a,b,c)},collapseTupleMember:function(a,b,c){this.dataSource().collapseTupleMember(a,b,c)},rowAxis:function(){return this.dataSource().rowAxis().inner()},columnAxis:function(){return this.dataSource().columnAxis().inner()},filters:function(){return this.dataSource().filters().inner()},measures:function(){return this.dataSource().measures().inner()},result:function(){return this.dataSource().result()},bindCollectionChanged:function(a){var options_=a;var ds_=this.dataSource();var attachCollectionChanged=function(collection,handler){collection.collectionChanged=$.ig.Delegate.prototype.combine(collection.collectionChanged,handler)};if($.isFunction(options_["filters"])){attachCollectionChanged(ds_._filters,options_["filters"])}if($.isFunction(options_["rowAxis"])){attachCollectionChanged(ds_._rowAxis,options_["rowAxis"])}if($.isFunction(options_["columnAxis"])){attachCollectionChanged(ds_._columnAxis,options_["columnAxis"])}if($.isFunction(options_["measures"])){attachCollectionChanged(ds_._measures,options_["measures"])}},unbindCollectionChanged:function(a){var options_=a;var ds_=this.dataSource();unbindCollectionChanged=function(collection,handler){collection.collectionChanged=$.ig.Delegate.prototype.remove(collection.collectionChanged,handler)};if($.isFunction(options_["filters"])){unbindCollectionChanged(ds_._filters,options_["filters"])
}if($.isFunction(options_["rowAxis"])){unbindCollectionChanged(ds_._rowAxis,options_["rowAxis"])}if($.isFunction(options_["columnAxis"])){unbindCollectionChanged(ds_._columnAxis,options_["columnAxis"])}if($.isFunction(options_["measures"])){unbindCollectionChanged(ds_._measures,options_["measures"])}},clearPendingChanges:function(){this.dataSource().clearPendingChanges()},update:function(){var promise_=this.dataSource().update().c();var $this=this;if(!this.isUpdating()){this.isUpdating(true);promise_.always(function(result){var args={error:null,result:null};if(this.state()==="rejected"){args.error=result}else{args.result=result}$this.isUpdating(false);$this.isModified(false);$($this).trigger("updated",args)})}return promise_},getCoreElement:function(a,b){return this.dataSource().getCoreElement(a,b)},getCoreElements:function(a,b){return this.dataSource().getCoreElements(a,b).inner()},getMembersOfHierarchy:function(a){return this.dataSource().getMembersOfHierarchy(a).c()},getMembersOfLevel:function(a){return this.dataSource().getMembersOfLevel(a).c()},tryGetMember:function(a){var $self=this;var b;if(function(){var c=$self.dataSource().tryGetMember(a,b);b=c.p1;return c.ret}()){return b}return null},tryGetMembersForLevel:function(a){var $self=this;var b=new $$t.ec($$t.$br.$type);var c=function(){var d=$self.dataSource().tryGetMembersForLevel(a,b);b=d.p1;return d.ret}();return c?b.inner():new $$t.ec($$t.$br.$type).inner()},getMembersOfMember:function(a){return this.dataSource().getMembersOfMember(a).c()},addFilterMember:function(a,b){this.dataSource().addFilterMember(a,b);this.isModified(true)},removeAllFilterMembers:function(a){this.dataSource().removeAllFilterMembers(a);this.isModified(true)},getFilterMemberNames:function(a){return this.dataSource().getFilterMemberNames(a).inner()},getDimension:function(a){return this.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$$t.$bb.$type)},getHierarchy:function(a){return this.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$$t.$bk.$type)},getLevel:function(a){return this.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$$t.$bm.$type)},getMeasure:function(a){return this.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$$t.$bn.$type)},getMeasureList:function(){return this.dataSource().getCoreElement(null,$$t.$fa.$type)},$type:new $.ig.Type("DataSourceBase",$.ig.$ot)},true);$c("jQueryUtils:f6","Object",{init:function(){$.ig.$op.init.call(this)},c:function($t,a){if(a==null){return null}var jsObject_=a;var dict_=new $$t.ck(String,$t,0);(function(obj,dict){var tempDict=$.ig.Dictionary.prototype.getDictionary(obj);var keys=tempDict.keys();while(keys.moveNext()){var key=keys.current();var value=tempDict.item(key);dict.add(key,value)}})(jsObject_,dict_);return dict_},i:function($t,a){if(a==null){return null}var jsObject_=$$t.$f6.createJavascriptObject();var b=a.getEnumerator();while(b.moveNext()){var item_=b.current();jsObject_[item_.key()]=item_.value()}return jsObject_},convertToObjectDictionary:function(a){return $$t.$f6.c($.ig.$op.$type,a)},convertToStringDictionary:function(a){return $$t.$f6.c(String,a)},convertFromObjectDictionary:function(a){return $$t.$f6.i($.ig.$op.$type,a)},convertFromStringDictionary:function(a){return $$t.$f6.i(String,a)},createJavascriptObject:function(){return{}},getJavascriptObjectProperty:function(a,b){var jsObject_=a;var property_=b;return jsObject_[property_]},setJavascriptObjectProperty:function(a,b,c){var jsObject_=a;var property_=b;var value_=c;jsObject_[property_]=value_},getJavascriptObjectMethodResult:function(a,b,c){var jsObject_=a;var method_=b;var args_=c;return jsObject_[method_].call(jsObject_,args_)},$type:new $.ig.Type("jQueryUtils",$.ig.$ot)},true);$c("OlapUtilities:f7","Object",{init:function(){$.ig.$op.init.call(this)},dateMemberProvider:function(a,b,c,d){if(String.isNullOrEmpty(a)||String.isNullOrEmpty(b)){return null}var propName_=b;var datePartFormat_=d;var format_=c;var yearProvider_;var semesterProvider_;var quarterProvider_;var monthProvider_;a=a.toLowerCase();switch(a){case"year":if(datePartFormat_==null){datePartFormat_="yyyy"}if(format_==null){return function(item){return $.ig.formatter(new Date(item[propName_]),"date",datePartFormat_)}}return function(item){return format_.replace("{0}",$.ig.formatter(new Date(item[propName_]),"date",datePartFormat_))};case"semester":if(format_==null){format_="H{0}"}yearProvider_=$$t.$f7.dateMemberProvider("year",b,null,null);return function(item){var year=yearProvider_(item);return format_.replace("{0}",Math.floor(new Date(item[propName_]).getMonth()/6)+1).replace("{1}",year)};case"quarter":if(format_==null){format_="Q{0}"}yearProvider_=$$t.$f7.dateMemberProvider("year",b,null,null);semesterProvider_=$$t.$f7.dateMemberProvider("semester",b,null,null);return function(item){var year=yearProvider_(item);var semester=semesterProvider_(item);return format_.replace("{0}",Math.floor(new Date(item[propName_]).getMonth()/3)+1).replace("{1}",semester).replace("{2}",year)};case"month":if(datePartFormat_==null){datePartFormat_="MMMM"}if(format_==null){return function(item){return $.ig.formatter(new Date(item[propName_]),"date",datePartFormat_)}}yearProvider_=$$t.$f7.dateMemberProvider("year",b,null,null);semesterProvider_=$$t.$f7.dateMemberProvider("semester",b,null,null);quarterProvider_=$$t.$f7.dateMemberProvider("quarter",b,null,null);return function(item){var year=yearProvider_(item);var semester=semesterProvider_(item);var quarter=quarterProvider_(item);return format_.replace("{0}",$.ig.formatter(new Date(item[propName_]),"date",datePartFormat_)).replace("{1}",quarter).replace("{2}",semester).replace("{3}",year)};case"date":if(datePartFormat_==null){datePartFormat_="MM/dd/yyyy"}if(format_==null){return function(item){return $.ig.formatter(new Date(item[propName_]),"date",datePartFormat_)}}yearProvider_=$$t.$f7.dateMemberProvider("year",b,null,null);semesterProvider_=$$t.$f7.dateMemberProvider("semester",b,null,null);quarterProvider_=$$t.$f7.dateMemberProvider("quarter",b,null,null);monthProvider_=$$t.$f7.dateMemberProvider("month",b,null,null);return function(item){var year=yearProvider_(item);var semester=semesterProvider_(item);var quarter=quarterProvider_(item);var month=monthProvider_(item);return format_.replace("{0}",$.ig.formatter(new Date(item[propName_]),"date",datePartFormat_)).replace("{1}",month).replace("{2}",quarter).replace("{3}",semester).replace("{4}",year)}}return null},getDateHierarchy:function(a,b,c,d,e,f){if(String.isNullOrEmpty(a)){return null}if(b==null||b.length==0){b=["year","quarter","month","date"]}else{for(var g=0;g<b.length;g++){b[g]=b[g].toLowerCase()}}if(c==null){c="Dates"}if(d==null){d=c}var res_=null;var name_=c;var caption_=d;var rootCaption_=f;var dateParts_=b;if(e==null){e=new Array(b.length);for(var h=0;h<e.length;h++){var i=b[h];e[h]=i.substr(0,1).toUpperCase()+i.substr(1,i.length)+"s"}}var captions_=e;var memberProviders_=new Array(b.length);for(var j=0;j<b.length;j++){var k=b[j];memberProviders_[j]=$$t.$f7.dateMemberProvider(k,a,null,null)}var levelsMetadata=[];var levelOffset=0;if(rootCaption_!=null&&rootCaption_!=""){levelOffset=1;levelsMetadata[0]={name:rootCaption_,caption:rootCaption_,memberProvider:function(item){return rootCaption_}}}for(var i=0;i<memberProviders_.length;i++){levelsMetadata[i+levelOffset]={name:dateParts_[i],caption:captions_[i],memberProvider:memberProviders_[i]}}res_={name:name_,caption:caption_,levels:levelsMetadata};return res_},sumAggregator:function(a,b){var propName_=a;var precision_=b;return function(items,cellMetadata){var sum=0,areAllNullOrUndefined=true,value;for(var i=0;i<items.length;i++){value=items[i][propName_];if(value!==null&&value!==undefined){areAllNullOrUndefined=false;sum+=value}}if(areAllNullOrUndefined)return null;if(precision_!=null){return sum.toFixed(precision_)}return sum}},avgAggregator:function(a,b){var propName_=a;var precision_=b;return function(items,cellMetadata){if(precision_==null){precision_=2}var sum=0,count=0,areAllNullOrUndefined=true,value;for(var i=0;i<items.length;i++){value=items[i][propName_];if(value!==null&&value!==undefined){areAllNullOrUndefined=false;sum+=value;count++}}if(areAllNullOrUndefined)return null;return(sum/count).toFixed(precision_)}},minAggregator:function(a){var propName_=a;return function(items,cellMetadata){var result=items[0][propName_];for(var i=1;i<items.length;i++){result=Math.min(result,items[i][propName_])}return result}},maxAggregator:function(a){var propName_=a;return function(items,cellMetadata){var result=items[0][propName_];for(var i=1;i<items.length;i++){result=Math.max(result,items[i][propName_])}return result}},countAggregator:function(){return function(items,cellMetadata){return items.length}},$type:new $.ig.Type("OlapUtilities",$.ig.$ot)},true);$c("OlapTableView:f8","Object",{a:null,init:function(a,b,c,d){$.ig.$op.init.call(this);var e=this.b(d);this.a=new $$t.eq(a,b,c,e)},rowHeaders:function(){if(this.a.rowHeaders()==null){return null}return this.a.rowHeaders().inner()},columnHeaders:function(){if(this.a.columnHeaders()==null){return null}return this.a.columnHeaders().inner()},resultCells:function(){if(this.a.resultCells()==null){return null}return this.a.resultCells().inner()},columnSortDirections:function(a){if(arguments.length===1){this.a.columnSortDirections().clear();var c=a.getEnumerator();while(c.moveNext()){var b=c.current();var d=this.d(b);this.a.columnSortDirections().add(d)}return a}else{var a=new $.ig.Array;var c=this.a.columnSortDirections().getEnumerator();while(c.moveNext()){var b=c.current();a.add(this.n(b))}return a}},appliedColumnSortDirections:function(){var a=new $.ig.Array;var c=this.a.appliedColumnSortDirections().getEnumerator();while(c.moveNext()){var b=c.current();a.add(this.n(b))}return a},levelSortDirections:function(a){if(arguments.length===1){this.a.levelSortDirections().clear();var c=a.getEnumerator();while(c.moveNext()){var b=c.current();var d=this.c(b);this.a.levelSortDirections().add(d)}return a}else{var a=new $.ig.Array;var c=this.a.levelSortDirections().getEnumerator();while(c.moveNext()){var b=c.current();a.add(this.m(b))}return a}},appliedLevelSortDirections:function(){var a=new $.ig.Array;var c=this.a.appliedLevelSortDirections().getEnumerator();while(c.moveNext()){var b=c.current();a.add(this.m(b))}return a},appliedSortDirectionsMap:function(){var resultMap_=$$t.$f6.createJavascriptObject();var a=this.a.appliedSortDirectionsMap().getEnumerator();while(a.moveNext()){var i_=a.current();var axisMap_=$$t.$f6.createJavascriptObject();var b=i_.value().getEnumerator();while(b.moveNext()){var j_=b.current();var hierarchyMap_=$$t.$f6.createJavascriptObject();var c=j_.value().getEnumerator();while(c.moveNext()){var k_=c.current();var sortDirection_=k_.value()==0?"ascending":"descending";hierarchyMap_[k_.key()]=sortDirection_}axisMap_[j_.key()]=hierarchyMap_}resultMap_[i_.key()]=axisMap_}return resultMap_},initialize:function(){this.a.initialize()},b:function(a){var b=new $$t.er;var c=$$t.$f6.getJavascriptObjectProperty(a,"rowHeadersLayout");var d=1;if(!String.isNullOrEmpty(c)){switch(c){case"tree":d=2;var e=$$t.$f6.getJavascriptObjectProperty(a,"compactRowHeaderIndentation");var f=$$t.$f6.getJavascriptObjectProperty(a,"treeRowHeaderIndentation");b=new $$t.e3(e,f);break;case"standard":d=0;break}}var g=$$t.$f6.getJavascriptObjectProperty(a,"isParentInFrontForColumns");var h=$$t.$f6.getJavascriptObjectProperty(a,"isParentInFrontForRows");var i=$$t.$f6.getJavascriptObjectProperty(a,"compactColumnHeaders");b.c(g);b.d(h);b.b(i);b.a(d);return b},d:function(o_){var a=$$t.$f6.getJavascriptObjectProperty(o_,"memberNames");var b=$g($$t.$f6.getJavascriptObjectProperty(o_,"tupleIndex"));var c=$$t.$f6.getJavascriptObjectProperty(o_,"sortDirection");var d=0;if(!String.isNullOrEmpty(c)){c=c.toLowerCase();if(c=="descending"){d=1}}var comparer_=null;if($.isFunction(o_.comparer)){comparer_=o_.comparer}else{comparer_=function(o1,o2){return parseFloat(o1||-Infinity)-parseFloat(o2||-Infinity)}}return function(){var $ret=new $$t.eu;$ret.memberNames(a);$ret.tupleIndex(b);$ret.sortDirection(d);$ret.comparer(comparer_);return $ret}()},n:function(a){var b=$$t.$f6.createJavascriptObject();$$t.$f6.setJavascriptObjectProperty(b,"memberNames",a.memberNames());$$t.$f6.setJavascriptObjectProperty(b,"tupleIndex",a.tupleIndex());$$t.$f6.setJavascriptObjectProperty(b,"sortDirection",a.sortDirection()==0?"ascending":"descending");if(a.comparer()!=null){$$t.$f6.setJavascriptObjectProperty(b,"comparer",a.comparer())}return b},c:function(a){var b=$$t.$f6.getJavascriptObjectProperty(a,"levelUniqueName");var c=$$t.$f6.getJavascriptObjectProperty(a,"sortDirection");var d=$$t.$f6.getJavascriptObjectProperty(a,"sortBehavior");if(!String.isNullOrEmpty(b)){var e=new $$t.ev;e.sortDirection(0);e.sortBehavior(1);e.levelUniqueName(b);if(!String.isNullOrEmpty(c)){c=c.toLowerCase();if(c=="descending"){e.sortDirection(1)}}if(!String.isNullOrEmpty(d)){d=d.toLowerCase();if(d=="alphabetical"){e.sortBehavior(0)}}return e}else{return null}},m:function(a){var b=$$t.$f6.createJavascriptObject();$$t.$f6.setJavascriptObjectProperty(b,"levelUniqueName",a.levelUniqueName());$$t.$f6.setJavascriptObjectProperty(b,"sortBehavior",a.sortBehavior()==1?"system":"alphabetical");$$t.$f6.setJavascriptObjectProperty(b,"sortDirection",a.sortDirection()==0?"ascending":"descending");return b},$type:new $.ig.Type("OlapTableView",$.ig.$ot)},true);$c("ArrayListCollection___Enumerate__IteratorClass$1:ArrayListCollection___Enumerate__IteratorClass$1","Object",{$t:null,c:0,b:null,d:0,__4__this:null,init:function($t,a){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this);this.c=a},moveNext:function(){while(this.c>=0){switch(this.c){case 0:this.c=-1;this.d=0;this.c=1;break;case 1:this.c=-1;if(this.d<this.__4__this.inner().length){this.b=$u(this.$t,this.__4__this.inner()[this.d]);this.c=2;return true}break;case 2:this.c=-1;this.d++;this.c=1;break}}return false},getEnumerator:function(){var d__;if(this.c==-2){this.c=0;d__=this}else{d__=new $.ig.ArrayListCollection___Enumerate__IteratorClass$1(this.$t,0);d__.__4__this=this.__4__this}return d__},reset:function(){throw new $$t.w(1)},dispose:function(){},current:function(){return this.b},current1:function(){return $d(this.$t,this.b)},$type:new $.ig.Type("ArrayListCollection___Enumerate__IteratorClass$1",$.ig.$ot,[$$t.$a5.$type.specialize(0),$.ig.IEnumerable.prototype.$type,$$t.$a6.$type.specialize(0),$.ig.IEnumerator.prototype.$type,$$t.$am.$type])},true);$$t.$ew.alphabetical=0;$$t.$ew.system=1;$$t.$e8.cube=0;$$t.$e8.dimension=1;$$t.$e8.group=2;$$t.$e8.userDefinedHierarchy=3;$$t.$e8.systemEnabledHierarchy=4;$$t.$e8.parentChildHierarchy=5;$$t.$e8.measure=6;$$t.$e8.level1=7;$$t.$e8.level2=8;$$t.$e8.level3=9;$$t.$e8.level4=10;$$t.$e8.level5=11;$$t.$e8.kpiRoot=12;$$t.$e8.kpi=13;$$t.$e8.kpiValue=14;$$t.$e8.kpiGoal=15;$$t.$e8.kpiStatus=16;$$t.$e8.kpiTrend=17;$$t.$e8.kpiWeight=18;$$t.$e9.rows=0;$$t.$e9.columns=1;$$t.$es.standard=0;$$t.$es.superCompact=1;$$t.$es.tree=2;$$t.$d6.horizontal=0;$$t.$d6.vertical=1;$$t.$bj.unknown=0;$$t.$bj.regular=1;$$t.$bj.all=2;$$t.$bj.measure=3;$$t.$bj.formula=4;$$t.$bi.one=0;$$t.$bi.many=1;$$t.$bh.unknown=0;$$t.$bh.sum=1;$$t.$bh.count=2;$$t.$bh.min=3;$$t.$bh.max=4;$$t.$bh.average=5;$$t.$bh.variance=6;$$t.$bh.std=7;$$t.$bh.distinctCount=8;$$t.$bh.none=9;$$t.$bh.averageOfChildren=10;$$t.$bh.firstNonEmpty=13;$$t.$bh.lastNonEmpty=14;$$t.$bh.byAccount=15;$$t.$bh.calculated=127;$$t.$bg.userDefined=1;$$t.$bg.systemEnabled=2;$$t.$bg.systemInternal=4;$$t.$bc.unknown=0;$$t.$bc.time=1;$$t.$bc.measure=2;$$t.$bc.other=3;$$t.$bc.quantitative=5;$$t.$bc.accounts=6;$$t.$bc.customers=7;$$t.$bc.products=8;$$t.$bc.scenario=9;$$t.$bc.utility=10;$$t.$bc.currency=11;$$t.$bc.rates=12;$$t.$bc.channel=13;$$t.$bc.promotion=14;$$t.$bc.organization=15;$$t.$bc.billOfMaterials=16;$$t.$bc.geography=17;$$t.$a9.cube=0;$$t.$a9.dimension=1;$$t.$a9.unknown=2;$$t.$fk.e="[";$$t.$fk.f="]";$$t.$fk.i="{";$$t.$fk.j="}";$$t.$fk.h=",";$$t.$fq.d="[";$$t.$fq.e="]";$$t.$fq.g=".";$$t.$fq.i="&"})(jQuery);$.ig=$.ig||{};(function($){var $$t={};$.ig.$currDefinitions=$$t;$.ig.util.bulkDefine(["IXmlaDataProvider:a","IOlapDiscoverDataProvider:b","Task$1:c","Task:d","Object:e","Type:f","Boolean:g","ValueType:h","Void:i","IConvertible:j","IFormatProvider:k","Number:l","String:m","IComparable:n","Number:o","Number:p","Number:q","Number:r","NumberStyles:s","Enum:t","Array:u","IList:v","ICollection:w","IEnumerable:x","IEnumerator:y","NotSupportedException:z","Error:aa","Number:ab","String:ac","StringComparison:ad","RegExp:ae","CultureInfo:af","DateTimeFormatInfo:ag","Calendar:ah","Date:ai","Number:aj","DayOfWeek:ak","DateTimeKind:al","CalendarWeekRule:am","NumberFormatInfo:an","CompareInfo:ao","CompareOptions:ap","IEnumerable$1:aq","IEnumerator$1:ar","IDisposable:as","StringSplitOptions:at","Number:au","Number:av","Number:aw","Number:ax","Number:ay","Number:az","Assembly:a0","Stream:a1","SeekOrigin:a2","RuntimeTypeHandle:a3","MethodInfo:a4","MethodBase:a5","MemberInfo:a6","ParameterInfo:a7","TypeCode:a8","ConstructorInfo:a9","PropertyInfo:ba","JQueryPromise:bb","Action:bc","MulticastDelegate:bd","IntPtr:be","Action$1:bf","AggregateException:bg","TaskStatus:bh","Func$2:bi","TaskCompletionSource$1:bj","JQueryDeferred:bk","JQuery:bl","JQueryObject:bm","Element:bn","ElementAttributeCollection:bo","ElementCollection:bp","WebStyle:bq","ElementNodeType:br","Document:bs","EventListener:bt","IElementEventHandler:bu","ElementEventHandler:bv","ElementAttribute:bw","JQueryPosition:bx","JQueryCallback:by","JQueryEvent:bz","JQueryUICallback:b0","Script:b1","Catalog:b2","ICoreOlapElement:b3","KeyValueItem:b4","Cube:b5","CubeType:b6","Dimension:b7","DimensionType:b8","Hierarchy:b9","HierarchyOrigin:ca","Level:cb","Measure:cc","AggregatorType:cd","MeasureGroup:ce","MeasureGroupDimension:cf","CardinalityType:cg","Member:ch","MemberType:ci","Nullable$1:cj","Kpi:ck","IOlapExecuteCommandProvider:cl","OlapResult:cm","IList$1:cn","ICollection$1:co","OlapResultAxis:cp","PositionResolver$2:cq","List$1:cr","IArray:cs","IArrayList:ct","Array:cu","CompareCallback:cv","Func$3:cw","Comparer$1:cx","IComparer:cy","IComparer$1:cz","DefaultComparer$1:c0","IComparable$1:c1","Comparison$1:c2","ReadOnlyCollection$1:c3","Predicate$1:c4","NotImplementedException:c5","IPosition$2:c6","IPositionItem$2:c7","PositionItemInfo$2:c8","Dictionary$2:c9","IDictionary$2:da","IDictionary:db","KeyValuePair$2:dc","Enumerable:dd","Thread:de","ThreadStart:df","IOrderedEnumerable$1:dg","SortedList$1:dh","Math:di","ArgumentNullException:dj","IEqualityComparer$1:dk","EqualityComparer$1:dl","IEqualityComparer:dm","DefaultEqualityComparer$1:dn","InvalidOperationException:dp","ArgumentException:dq","IHierarchicalPositionItem$2:dr","EventHandler$1:ds","AsyncCompletedEventArgs:dt","EventArgs:du","Delegate:dv","Interlocked:dw","ListSortDirection:dx","OlapResultTuple:dy","OlapResultAxisMember:dz","OlapResultCell:d0","MdxDataSourceImpl:d1","OlapDataSource:d2","IOlapDataSource:d3","OlapMetadataTreeItem:d4","OlapMetadataTreeItemType:d5","MeasureListLocation:d6","ArrayListCollection$1:d7","INotifyCollectionChanged:d8","NotifyCollectionChangedEventHandler:d9","NotifyCollectionChangedEventArgs:ea","NotifyCollectionChangedAction:eb","DataSourceBaseOptions:ec","IOlapDataProviderFactory:ed","OlapResultView:ee","CubeMetaItemsCache:ef","KpiMeasure:eg","MeasureGroupMetaItemsCache:eh","Tuple$2:ei","AxisElement:ej","PositionInfo:ek","MeasureList:el","TaskFactory:em","TaskExtensions:en","AxisDefinitionParser:eo","MetaTreeHelper:ep","HierarchyItemPosition:eq","KpiDimension:er","MdxDataSourceOptions:es","MdxSettings:et","MdxDimensionAxisSettings:eu","MdxAxisSettings:ev","MdxSetSettings:ew","MdxSlicerAxisSettings:ex","ObservableCollection$1:ey","INotifyPropertyChanged:ez","PropertyChangedEventHandler:e0","PropertyChangedEventArgs:e1","MdxDimensionAxisProvider:e2","IMdxDimensionAxisProvider:e3","IMdxAxisProvider:e4","IMdxAxis:e5","IMdxExpression:e6","IMdxSet:e7","IMdxElement:e8","MdxElementType:e9","MdxElementCollectionElement:fa","IMdxCollectionElement:fb","StringBuilder:fc","Environment:fd","MdxAxis:fe","MdxSet:ff","MdxSingleElement:fg","MdxElement:fh","IMdxItemElement:fi","MdxLevelMembersElement:fj","MdxChildrenCollectionElement:fk","MdxDimensionMember:fl","MdxSlicerAxisProvider:fm","MdxSlicerAxis:fn","IMdxSlicerAxis:fo","IMdxExtendedFilterInfo:fp","IMdxFilterInfo:fq","IAxisFilterElement:fr","MdxSlicerAxisBuilder:fs","MdxAxisFilterElement:ft","MdxSlicerSet:fu","ResultViewHelper:fv","MdxQueryBuilder:fw","MdxCalculatedMembersCache:fx","XmlaDataProvider:fy","ICoreXmlaConnection:fz","IConnection:f0","XmlaSoapWebClient$1:f1","XmlaSoapWebClient:f2","ICredentials:f3","NetworkCredential:f4","Uri:f5","UriKind:f6","Encoding:f7","UTF8Encoding:f8","Decoder:f9","UnicodeEncoding:ga","AsciiEncoding:gb","DefaultDecoder:gc","WebClient:gd","WebHeaderCollection:ge","NameValueCollection:gf","UploadStringCompletedEventHandler:gg","UploadStringCompletedEventArgs:gh","RequestCompletedEventArgs$1:gi","IXmlaSoapMethod:gj","XElement:gk","XContainer:gl","XNode:gm","XObject:gn","XmlNode:go","XmlNodeList:gp","XmlNamedNodeMap:gq","XmlNodeType:gr","XmlDocument:gs","XmlElement:gt","XmlLinkedNode:gu","XmlAttribute:gv","XmlUtils:gw","XName:gx","XNamespace:gy","XDocument:gz","XAttribute:g0","XmlaPropertiesCollection:g1","XmlaQueryProperty:g2","XmlaSoapMessageBuilder:g3","XmlaSoapFaultXmlTypeSerializer:g4","IXmlTypeSerializer$1:g5","XmlaSoapFault:g6","FaultDetail:g7","FaultError:g8","SerializerUtils:g9","ErrorXmlTypeSerializer:ha","FaultReason:hb","FaultCode:hc","FaultException$1:hd","FaultException:he","DiscoverResponseResult:hf","XmlaSoapMethodResult:hg","IXmlaMethodResult:hh","ExecuteResponseResult:hi","DatabaseXmlTypeSerializer:hj","CubeXmlTypeSerializer:hk","DimensionXmlTypeSerializer:hl","HierarchyXmlTypeSerializer:hm","LevelXmlTypeSerializer:hn","MeasureXmlTypeSerializer:ho","MeasureGroupXmlTypeSerializer:hp","MeasureGroupDimensionXmlTypeSerializer:hq","MemberXmlTypeSerializer:hr","KpiXmlTypeSerializer:hs","ResultXmlTypeSerializer:ht","ArraySerializer:hu","AxisXmlTypeSerializer:hv","TupleXmlTypeSerializer:hw","AxisMemberXmlTypeSerializer:hx","CellXmlTypeSerializer:hy","XmlaSoapMethodExecute:hz","XmlaSoapMethod:h0","XmlaSoapMethodDiscover:h1","XmlaSoapMessageHeader:h2","CatalogConstants:h3","DbSchemaConstants:h7","CubeConstants:ic","DimensionConstants:id","HierarchyConstants:ie","InstanceConstants:ig","KpiConstants:ih","LevelConstants:ii","MeasureConstants:ij","MeasureGroupConstants:ik","MeasureGroupDimensionConstants:il","MemberConstants:im","OlapSchemaConstants:io","CubeRestrictions:ip","DimensionRestrictions:iq","HierarchyRestrictions:ir","KpiRestrictions:is","LevelRestrictions:it","MeasureRestrictions:iu","MeasureGroupRestrictions:iv","MeasureGroupDimensionRestrictions:iw","MemberRestrictions:ix","XmlaConstants:iy","XmlaNamespace:iz","IXmlaDataProviderFactory:i5","DefaultXmlaDataProviderFactory:i6","XmlaConnection:i7","RemoteXmlaDataProviderFactory:i8","JsonRemoteRequestSerializer:i9","IRemoteRequestSerializer:ja","RemoteRequest:jb","RemoteRequestType:jc","JavaScriptSerializer:jd","RemoteRequestJsonTypeSeriazlier:je","JsonTypeSeriazlierBase$1:jf","IJsonTypeSerializer$1:jg","JsonSerializerUtils:jh","jQueryUtils:ji","JsonRemoteResponseSerializer:jj","IRemoteResponseSerializer:jk","ArrayJsonSerializer:jl","CatalogJsonTypeSeriazlier:jm","CubeJsonTypeSeriazlier:jn","DimensionJsonTypeSeriazlier:jo","HierarchyJsonTypeSeriazlier:jp","LevelJsonTypeSeriazlier:jq","MeasureJsonTypeSeriazlier:jr","MeasureGroupJsonTypeSeriazlier:js","MeasureGroupDimensionJsonTypeSeriazlier:jt","MemberJsonTypeSeriazlier:ju","KpiJsonTypeSeriazlier:jv","ResultJsonTypeSeriazlier:jw","AxisJsonTypeSeriazlier:jx","TupleJsonTypeSeriazlier:jy","AxisMemberJsonTypeSeriazlier:jz","CellJsonTypeSeriazlier:j0","RemoteXmlaDataProvder:j1","XmlaDataSourceImpl:j2","XmlaDataSourceOptions:j3","RequestOptions:j4","XmlaDiscoverProperties:j5","CustomRemoteXmlaRequestSerializer:j7","CustomRemoteXmlaResponseSerializer:j8","OlapXmlaDataSource:j9","DataSourceBase:ka","AbstractEnumerable:kb","Func$1:kc","AbstractEnumerator:kd","GenericEnumerable$1:ke","GenericEnumerator$1:kf"]);var $a=$.ig.intDivide,$b=$.ig.util.cast,$c=$.ig.util.defType,$d=$.ig.util.getBoxIfEnum,$e=$.ig.util.getDefaultValue,$f=$.ig.util.getEnumValue,$g=$.ig.util.getValue,$h=$.ig.util.intSToU,$i=$.ig.util.nullableEquals,$j=$.ig.util.nullableIsNull,$k=$.ig.util.nullableNotEquals,$l=$.ig.util.toNullable,$m=$.ig.util.toString$1,$n=$.ig.util.u32BitwiseAnd,$o=$.ig.util.u32BitwiseOr,$p=$.ig.util.u32BitwiseXor,$q=$.ig.util.u32LS,$r=$.ig.util.unwrapNullable,$s=$.ig.util.wrapNullable,$t=String.fromCharCode,$u=$.ig.util.castObjTo$t,$v=$.ig.util.compare,$w=$.ig.util.replace,$x=$.ig.util.stringFormat,$y=$.ig.util.stringFormat1,$z=$.ig.util.stringFormat2,$0=$.ig.util.stringCompare1,$1=$.ig.util.stringCompare2,$2=$.ig.util.stringCompare3,$3=$.ig.util.compareSimple,$4=$.ig.util.numberToString,$5=$.ig.util.tryParseInt32_1,$6=$.ig.util.tryParseInt32_2,$7=$.ig.util.intToString1,$8=$.ig.util.parseInt32_1,$9=$.ig.util.parseInt32_2;$c("RemoteRequestType:jc","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"DiscoverCatalogs";case 1:return"DiscoverCubes";case 2:return"DiscoverDimensions";case 3:return"DiscoverHierarchies";case 4:return"DiscoverLevels";case 5:return"DiscoverMeasures";case 6:return"DiscoverMeasureGroups";case 7:return"DiscoverMeasureGroupDimensions";case 8:return"DiscoverMembers";case 9:return"DiscoverKpis";case 10:return"ExecuteStatement";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("RemoteRequestType",$.ig.$ep.$type)},true);$c("MdxElementType:e9","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"Member";case 1:return"MemberTree";case 2:return"Calculated";case 3:return"Filter";case 4:return"Collection";case 5:return"UserDefined";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("MdxElementType",$.ig.$ep.$type)},true);$c("XmlaSoapMessageHeader:h2","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"None";case 1:return"Session";case 2:return"BeginSession";case 3:return"EndSession";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("XmlaSoapMessageHeader",$.ig.$ep.$type)},true);$c("IXmlaDataProvider:a","Object",{$type:new $.ig.Type("IXmlaDataProvider",null,[$$t.$b.$type,$$t.$cl.$type])},true);$c("MdxDataSourceImpl:d1","OlapDataSource",{bb:null,ba:false,init:function(a){this.bb=new $$t.cr($$t.$e2.$type,0);$$t.$d2.init.call(this,a);this.mdxSettings(a.mdxSettings());this.mdxSourceOptions(a);this.dataProviderFactory(a.dataProviderFactory());this.ba=true;if(this.mdxSourceOptions()!=null){this.ba=this.mdxSourceOptions().enableResultCache()==true}},_mdxSourceOptions:null,mdxSourceOptions:function(a){if(arguments.length===1){this._mdxSourceOptions=a;return a}else{return this._mdxSourceOptions}},_mdxSettings:null,mdxSettings:function(a){if(arguments.length===1){this._mdxSettings=a;return a}else{return this._mdxSettings}},_catalog:null,catalog:function(a){if(arguments.length===1){this._catalog=a;return a}else{return this._catalog}},setCatalog:function(a){if(!this.isInitialized()){throw new $$t.dp(1,"Data source is not initialized.")}return this.be(a)},bn:function(a,b){if(a.positionItemIndex()==b){a.clear()}else{var d=a.values().getEnumerator();while(d.moveNext()){var c=d.current();this.bn(c,b)}}},a9:function(a,b,c,d){var $self=this;var e=new $$t.cr($$t.$ej.$type,0);var g=c.getEnumerator();while(g.moveNext()){var f=g.current();var h=new $$t.ej(f.b(),new $$t.cr(String,0));for(var i=0;i<f.a().count();i++){var j=f.a().item(i);var k;if(function(){var l=$self.c().h(j,k);k=l.p1;return l.ret}()){if(k.scope().hasValue()==false){h.a().add(j)}}}e.add(h)}var l=new $$t.cr($$t.$ej.$type,0);var n=b.getEnumerator();while(n.moveNext()){var m=n.current();var o=new $$t.ej(m.b(),new $$t.cr(String,0));for(var p=0;p<m.a().count();p++){var q=m.a().item(p);var r;if(function(){var s=$self.c().h(q,r);r=s.p1;return s.ret}()){if(r.scope().hasValue()==false){o.a().add(q)}}}l.add(o)}var s=new $$t.cr($$t.$ej.$type,0);var u=a.getEnumerator();while(u.moveNext()){var t=u.current();var v=new $$t.ej(t.b(),new $$t.cr(String,0));for(var w=0;w<t.a().count();w++){var x=t.a().item(w);var y;if(function(){var z=$self.c().h(x,y);y=z.p1;return z.ret}()){if(y.scope().hasValue()==false){v.a().add(x)}}}s.add(v)}return new $$t.fm(this,s,l,e,d)},getMembersOfLevel:function(a){var $self=this;var b=a;var c=this.getProviderDefaultProperties();var d=this.getProviderDefaultRestrictions();if(d!=null){d.add(function(){var $ret=new $$t.b4;$ret.a("LEVEL_UNIQUE_NAME");$ret.b(a);return $ret}())}var e=this.dataProviderFactory().createDataProvider();var f=e.discoverMembersAsync(c,d);f.i(function(g){var i=g.m().getEnumerator();while(i.moveNext()){var h=i.current();$self.c().aa(h)}$self.c().ac(b)});return f},getMembersOfHierarchy:function(a){var $self=this;var b=a;var c=this.getProviderDefaultProperties();var d=this.getProviderDefaultRestrictions();if(d!=null){d.add(function(){var $ret=new $$t.b4;$ret.a("HIERARCHY_UNIQUE_NAME");$ret.b(a);return $ret}())}var e=this.dataProviderFactory().createDataProvider();var f=e.discoverMembersAsync(c,d);f.i(function(g){var i=g.m().getEnumerator();while(i.moveNext()){var h=i.current();$self.c().aa(h)}$self.c().ab(b)});return f},getMembersOfMember:function(a){var $self=this;var b=this.getProviderDefaultProperties();var c=this.getProviderDefaultRestrictions();if(c!=null){c.add(function(){var $ret=new $$t.b4;$ret.a("MEMBER_UNIQUE_NAME");$ret.b(a);return $ret}());c.add(function(){var $ret=new $$t.b4;$ret.a("TREE_OP");$ret.b("1");return $ret}())}var d=this.dataProviderFactory().createDataProvider();var e=d.discoverMembersAsync(b,c);$$t.$en.b($$t.$aq.$type.specialize($$t.$ch.$type),$$t.$aq.$type.specialize($$t.$ch.$type),e,function(f){return $self.bf(f.m())});return e},bf:function(a){var b=new $$t.cr($$t.$ch.$type,0);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b.add(c);break}if(b.count()>0){var e=b.item(0).levelUniqueName();if(!this.c().c(e)){return this.getMembersOfLevel(e).j($$t.$aq.$type.specialize($$t.$ch.$type),function(f){return a})}}var f=new $$t.bj($$t.$aq.$type.specialize($$t.$ch.$type),0);f.e(a);return f.b()},bq:function(a){var $self=this;if(a.isEmpty()){return}var c=a.axes().getEnumerator();while(c.moveNext()){var b=c.current();var d=b.tuples();for(var e=0;e<d.count();e++){var f=d.__inner[e].members();for(var g=0;g<f.count();g++){var h=f.item(g);var i;if(function(){var j=$self.c().i(h.uniqueName(),i);i=j.p1;return j.ret}()){h.ordinal(i)}}}}},bs:function(a,b){var c=0;var d=this.measureListIndex();if(a){var e=this.a7(c);if(e!=null&&this.measureListLocation()==1){if(d>-1){var f=e.d();if(f!=null){this.bn(f,d-1)}e.q()}}c++}if(b){var g=this.a7(c);if(g!=null&&this.measureListLocation()==0){if(d>-1){var h=g.d();if(h!=null){this.bn(h,d-1)}g.q()}}}},br:function(a,b,c){var d=0;if(c){var e=d<a.axes().count()?a.axes().item(d):null;var f=e!=null?this.a7(d):null;if(f!=null){f.d(e.positionResolver().rootPositionInfo());f.q()}d++}if(b){var g=d<a.axes().count()?a.axes().item(d):null;var h=g!=null?this.a7(d):null;if(h!=null){h.d(g.positionResolver().rootPositionInfo());h.q()}d++}},bc:function(a,b,c,d){this.bi(a,b,c);var e=new $$t.c9(String,$$t.$g.$type,0);var f=this.aa();d=new $$t.c9(String,$$t.$cn.$type.specialize($$t.$ek.$type),0);for(var g=0;g<f.count();g++){var h=f.item(g);var i;if(!function(){var j=d.tryGetValue(h.c(),i);i=j.p1;return j.ret}()){i=new $$t.cr($$t.$ek.$type,0);d.add(h.c(),i)}i.add(h);if(this.l()==null){this.l(new $$t.ee(this.result(),this.result(),a,b))}var j=this.l().expandTupleMember(h.c(),h.b(),h.a());if(j==null){e.item(h.c(),true)}else{var k=this.l();this.l(j);$$t.$fv.f(h.c(),k,this.l());$$t.$fv.e(h.c(),h.b(),h.a(),true,this.l());
this.result(this.l().visibleResult());this.bq(this.result());this.br(this.l().visibleResult(),b,a)}}var l=new $$t.cr($$t.$e5.$type,0);var n=d.getEnumerator();while(n.moveNext()){var m=n.current();var o=this.a3(m.key());if(o==null){continue}if(o.positionResolver().hasUnregisterdPositions()){o.positionResolver().completeRegisterPositions()}var p=new $$t.cr($$t.$c7.$type.specialize(String,$.ig.$op.$type),0);var r=m.value().getEnumerator();while(r.moveNext()){var q=r.current();if(q.b()<o.tuples().count()){var s=o.tuples().__inner[q.b()];var t=s.item(q.a());p.add(t)}}if(p.count()>0){var u=this.result().axes().indexOf(o);var v=this.a7(u);var w=v.createAxis(u);var x=false;if(function(){var y=e.tryGetValue(o.name(),x);x=y.p1;return y.ret}()&&x){v=new $$t.e2(1,o,v.g(),p);var y=v.extendAxis(w,w.axisIndex());l.add(y)}}}this.aa().clear();return{ret:l,p3:d}},a5:function(a,b,c){var d=null;if(a.count()>0){d=this.a7(c);if(b){var e=null;if(d!=null){e=d.d()}var f=c==0?this.mdxSettings().a():this.mdxSettings().b();d=new $$t.e2(0,this,f,a,e);this.bp(c,d)}}if(d!=null){return d.createAxis(c)}return null},bi:function(a,b,c){if(this.result()!=null){var d=new $$t.c9(String,$$t.$cn.$type.specialize($$t.$ek.$type),0);var e=this.z();for(var f=0;f<e.count();f++){var g=e.item(f);var h;if(!function(){var i=d.tryGetValue(g.c(),h);h=i.p1;return i.ret}()){h=new $$t.cr($$t.$ek.$type,0);d.add(g.c(),h)}h.add(g);if(c){if(this.l()==null){this.l(new $$t.ee(this.result(),this.result(),a,b))}else{this.l(this.l().collapseTupleMember(g.c(),g.b(),g.a()));this.result(this.l().visibleResult());this.bq(this.result());this.br(this.l().visibleResult(),b,a)}}}var i=new $$t.cr($$t.$cp.$type,0);var k=d.getEnumerator();while(k.moveNext()){var j=k.current();var l=this.a3(j.key());if(l==null){continue}if(l.positionResolver().hasUnregisterdPositions()){l.positionResolver().completeRegisterPositions()}if(!i.contains(l)){i.add(l)}if(!c){var n=j.value().getEnumerator();while(n.moveNext()){var m=n.current();if(m.b()<l.tuples().count()){var o=l.tuples().__inner[m.b()];var p=o.item(m.a());var q=l.positionResolver().getHostPositionItemInfo(o,m.a());var r=$$t.$dd.ae($$t.$c8.$type.specialize(String,$.ig.$op.$type),$$t.$dd.t($$t.$c8.$type.specialize(String,$.ig.$op.$type),q.values(),function(s){return s.key()==p.key()}));if(r!=null){r.isExpanded(false)}}}}}if(i.count()>0){if(!c&&!this.result().isEmpty()){this.br(this.result(),b,a)}var t=i.getEnumerator();while(t.moveNext()){var s=t.current();var u=b&&s.name()=="Axis1"?1:0;var v=this.a7(u);v.q()}}this.z().clear()}},bh:function(){this.catalog(null);this.cubes(new $$t.d7($$t.$b5.$type));this.av()},bd:function(){var $self=this;var a=this.dataProviderFactory().createDataProvider();var b=this.getProviderDefaultProperties();var c=$$t.$en.b($$t.$aq.$type.specialize($$t.$b2.$type),$$t.$aq.$type.specialize($$t.$b2.$type),a.discoverCatalogsAsync(b,null),function(d){$self.catalogs($self.a2($$t.$b2.$type,d.m()));return d});return c},be:function(a){if(String.isNullOrEmpty(a)){if(a==null){throw new $$t.dj(0,"catalogName")}throw new $$t.dp(1,"catalogName cannot be empty.")}var b=new $$t.bj($$t.$cn.$type.specialize($$t.$b5.$type),0);if(this.catalog()!=null){if(this.catalog().name()==a){b.e(this.cubes());return b.b()}this.bh()}var d=this.catalogs().getEnumerator();while(d.moveNext()){var c=d.current();if(c.name()==a){this.catalog(c);break}}if(this.cubes()==null||this.cubes().count()==0){this.al(a).i(function(e){if(e.a()==null){b.e(e.m());return}b.d(e.a())})}else{b.e(this.cubes())}return b.b()},ao:function(){var $self=this;var a=new $$t.bj($$t.$d4.$type,0);if(this.isInitialized()){a.e(this.metadataTree());return a.b()}var b=this.mdxSourceOptions().catalog();var c=this.mdxSourceOptions().cube();var d=this.columnAxis();d.collectionChanged=$.ig.Delegate.prototype.combine(d.collectionChanged,this.bj.runOn(this));var e=this.rowAxis();e.collectionChanged=$.ig.Delegate.prototype.combine(e.collectionChanged,this.bo.runOn(this));var f=this.filters();f.collectionChanged=$.ig.Delegate.prototype.combine(f.collectionChanged,this.bl.runOn(this));var g=this.measures();g.collectionChanged=$.ig.Delegate.prototype.combine(g.collectionChanged,this.bm.runOn(this));var h=this.bd();if(String.isNullOrEmpty(b)){h.i(function(i){if(i.a()==null){$self.ax();var j=function(){var $ret=new $$t.cm;$ret.isEmpty(true);return $ret}();$self.l(new $$t.ee(j,j,false,false));$self.result(j);a.e(null);return}a.d(i.a())});return a.b()}var i=$$t.$en.b($$t.$aq.$type.specialize($$t.$b2.$type),$$t.$cn.$type.specialize($$t.$b5.$type),h,function(j){if(j.a()==null){return $self.be(b)}var k=new $$t.bj($$t.$cn.$type.specialize($$t.$b5.$type),0);k.d(j.a());return k.b()});if(String.isNullOrEmpty(c)){i.i(function(j){if(j.a()==null){$self.ax();var k=function(){var $ret=new $$t.cm;$ret.isEmpty(true);return $ret}();$self.l(new $$t.ee(k,k,false,false));$self.result(k);a.e(null);return}a.d(j.a())});return a.b()}var j=$$t.$en.b($$t.$d4.$type,$$t.$d4.$type,$$t.$en.b($$t.$cn.$type.specialize($$t.$b5.$type),$$t.$d4.$type,i,function(k){return $self.ap(c)}),function(k){return $self.aj()});return j},ar:function(){var $self=this;var a=this.m();var b=this.s();var c=this.r();var d=this.n();var e=this.aa().count()>0;var f=this.z().count()>0;var g=this.ae.count()>0;if(!a&&!b&&!c&&!d&&!e&&!f&&!g){var h=new $$t.bj($$t.$cm.$type,0);h.e(this.result());return h.b()}var i=this.columnAxis().count()>0;var j=this.rowAxis().count()>0;if(this.rowAxis().count()==0&&this.columnAxis().count()==0&&this.measures().count()==0){var k=function(){var $ret=new $$t.cm;$ret.isEmpty(true);return $ret}();var l=new $$t.bj($$t.$cm.$type,0);l.e(k);this.l(new $$t.ee(k,k,false,false));this.result(k);this.bq(k);this.br(this.l().visibleResult(),j,i);this.clearPendingChanges();return l.b()}if(this.r()){this.bs(i,j)}this.r(false);this.n(false);this.q(false);var m=false;if(this.ba&&!this.m()&&!this.s()){m=true}var n=null;var o=null;var p=0;n=this.a5(this.columnAxis(),this.m(),p);this.m(false);if(n!=null){p++}o=this.a5(this.rowAxis(),this.s(),p);this.s(false);if(o!=null){o.axisIndex(p);p++}var q;var r=function(){var s=$self.bc(i,j,m,q);q=s.p3;return s.ret}();var s=this.a9(this.x(),this.af(),this.y(),this.mdxSettings());var t=s.createAxis(p);var u=new $$t.fw(1,this.mdxSettings());var v=this.getProviderDefaultProperties();var w=this.getProviderDefaultRestrictions();var x=this.dataProviderFactory().createDataProvider();if(m&&!g&&(e||f)){var y=null;if(n!=null){var z=$$t.$dd.ae($$t.$e5.$type,$$t.$dd.t($$t.$e5.$type,r,function(aa){return aa.axisIndex()==n.axisIndex()}));var aa;var ab=q.tryGetValue("Axis0",aa);aa=ab.p1;if(z!=null){var ac=u.c(z,o,t,new $$t.fx,this.cube().name());y=x.executeStatementAsync(ac,v,w);y=$$t.$en.b($$t.$cm.$type,$$t.$cm.$type,y,function(ad){if($self.l()==null){$self.l(new $$t.ee($self.result(),$self.result(),i,j))}var ae=$self.l();$self.l($self.l().extend(ad.m(),"Axis0"));$self.result($self.l().visibleResult());$self.bq($self.result());$$t.$fv.f("Axis0",ae,$self.l());var ag=aa.getEnumerator();while(ag.moveNext()){var af=ag.current();$$t.$fv.e(af.c(),af.b(),af.a(),true,$self.l())}var ah=j;var ai=i;$self.br($self.l().visibleResult(),ah,ai);var aj=new $$t.bj($$t.$cm.$type,0);aj.e($self.l().visibleResult());return aj.b()})}}if(o!=null){var ad=$$t.$dd.ae($$t.$e5.$type,$$t.$dd.t($$t.$e5.$type,r,function(ae){return ae.axisIndex()==o.axisIndex()}));var ae=this.l().hasColumns()?"Axis1":"Axis0";var af;var ag=q.tryGetValue(ae,af);af=ag.p1;if(ad!=null){if(y!=null){y=$$t.$en.b($$t.$cm.$type,$$t.$cm.$type,y,function(ah){n=$self.a5($self.columnAxis(),false,0);var ai=u.c(n,ad,t,new $$t.fx,$self.cube().name());return x.executeStatementAsync(ai,v,w)})}else{var ah=u.c(n,ad,t,new $$t.fx,this.cube().name());y=x.executeStatementAsync(ah,v,w)}y=$$t.$en.b($$t.$cm.$type,$$t.$cm.$type,y,function(ai){if($self.l()==null){$self.l(new $$t.ee($self.result(),$self.result(),i,j))}var aj=$self.l();$self.l($self.l().extend(ai.m(),ae));$self.result($self.l().visibleResult());$self.bq($self.result());$$t.$fv.f(ae,aj,$self.l());var al=af.getEnumerator();while(al.moveNext()){var ak=al.current();$$t.$fv.e(ak.c(),ak.b(),ak.a(),true,$self.l())}var am=j;var an=i;$self.br($self.l().visibleResult(),am,an);var ao=new $$t.bj($$t.$cm.$type,0);ao.e($self.l().visibleResult());return ao.b()})}}if(y!=null){return y}var ai=new $$t.bj($$t.$cm.$type,0);ai.e(this.result());return ai.b()}else{if(g){this.ae.clear()}{p=0;n=this.a5(this.columnAxis(),this.m(),p);if(n!=null){p++}o=this.a5(this.rowAxis(),this.s(),p)}var aj=u.c(n,o,t,new $$t.fx,this.cube().name());return x.executeStatementAsync(aj,v,w).j($$t.$cm.$type,function(ak){$self.l(new $$t.ee(ak.m(),ak.m(),i,j));$self.result($self.l().visibleResult());$self.bq($self.result());var al=j;var am=i;$self.br($self.l().visibleResult(),al,am);$self.clearPendingChanges();return $self.result()})}},ap:function(a){if(this.catalog()==null){throw new $$t.dp(1,"Data source has no Catalog set.")}return $$t.$d2.ap.call(this,a)},aq:function(a){if(this.catalog()==null){throw new $$t.dp(1,"Data source has no Catalog set.")}return $$t.$d2.aq.call(this,a)},ai:function(){var $self=this;var a=new $$t.cr($$t.$d.$type,0);var b=this.getProviderDefaultProperties();var c=this.getProviderDefaultRestrictions();var d=this.dataProviderFactory().createDataProvider();a.add(d.discoverMeasuresAsync(b,c));a.add(d.discoverKpisAsync(b,c));a.add(d.discoverDimensionsAsync(b,c));a.add(d.discoverHierarchiesAsync(b,c));a.add(d.discoverLevelsAsync(b,c));a.add(d.discoverMeasureGroupDimensionsAsync(b,c));a.add(this.an());var e=new Array(a.count());a.copyTo(e,0);var f=new $$t.em;var g=new $$t.ef;this.c(g);return f.c(e,function(h){var i=h[0];var j=h[1];var k=h[2];var l=h[3];var m=h[4];var n=h[5];g.z(i.m());g.t(k.m());g.u(l.m());g.x(m.m());g.w(j.m());if($self.measureGroups()!=null){g.y(n.m());g.a(new $$t.eh(g.t(),g.z(),g.w(),g.y()))}})},a2:function($t,a){var b=new $$t.d7($t);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b.add(c)}return b},getProviderDefaultRestrictions:function(){var $self=this;var a=$$t.$d2.getProviderDefaultRestrictions.call(this);if(this.catalog()!=null){a.add(function(){var $ret=new $$t.b4;$ret.a("CATALOG_NAME");$ret.b($self.catalog().name());return $ret}());if(this.cube()!=null){a.add(function(){var $ret=new $$t.b4;$ret.a("CUBE_NAME");$ret.b($self.cube().name());return $ret}())}}return a},bj:function(a,b){this.m(true);this.bu(0,this.columnAxis(),this.rowAxis());this.az(b,this.x());this.a1(b,this.columnAxis());if(b.action()!=4&&this.columnAxis()!=null){var c=Math.max(b.newStartingIndex(),b.oldStartingIndex());this.bt("Axis0",c)}},bo:function(a,b){this.s(true);this.bu(1,this.rowAxis(),this.columnAxis());this.az(b,this.af());this.a1(b,this.rowAxis());if(b.action()!=4&&this.rowAxis()!=null){var c=this.columnAxis()==null?"Axis0":"Axis1";var d=Math.max(b.newStartingIndex(),b.oldStartingIndex());this.bt(c,d)}},bt:function(a,b){var c=this.z();for(var d=c.count()-1;d>=0;d--){var e=c.item(d);if(e.c()==a&&e.a()>=b){c.removeAt(d)}}var f=this.aa();for(var g=f.count()-1;g>=0;g--){var h=f.item(g);if(h.c()==a&&h.a()>=b){f.removeAt(g)}}},bu:function(a,b,c){if(b.count()>0){if(c.count()>0){if(this.bb.count()<2){this.bb.insert(a,null)}}else{if(this.bb.count()==0){this.bb.insert(0,null)}}}else{if(this.bb.count()>0){if(this.bb.count()>1){this.bb.removeAt(a)}else{this.bb.removeAt(0)}}}},bl:function(a,b){this.n(true);this.az(b,this.y())},bm:function(a,b){this.r(true);this.a0()},bk:function(a,b,c){var d=null;var f=a.getEnumerator();while(f.moveNext()){var e=f.current();if(e.a()==b){d=e;break}}if(d==null){a.add(function(){var $ret=new $$t.b4;$ret.a(b);$ret.b(c);return $ret}())}},a3:function(a){if(this.result()!=null&&this.result().axes().count()>0){return $$t.$dd.ae($$t.$cp.$type,$$t.$dd.t($$t.$cp.$type,this.result().axes(),function(b){return b.name()==a}))}return null},a7:function(a){if(a<this.bb.count()){return this.bb.item(a)}return null},bp:function(a,b){this.bb.item(a,b)},$type:new $.ig.Type("MdxDataSourceImpl",$$t.$d2.$type)},true);$c("MdxDataSourceOptions:es","DataSourceBaseOptions",{init:function(){$$t.$ec.init.call(this)},_catalog:null,catalog:function(a){if(arguments.length===1){this._catalog=a;return a}else{return this._catalog}},_discoverProperties:null,discoverProperties:function(a){if(arguments.length===1){this._discoverProperties=a;return a}else{return this._discoverProperties}},_executeProperties:null,executeProperties:function(a){if(arguments.length===1){this._executeProperties=a;return a}else{return this._executeProperties}},_dataProviderFactory:null,dataProviderFactory:function(a){if(arguments.length===1){this._dataProviderFactory=a;return a}else{return this._dataProviderFactory}},_enableResultCache:false,enableResultCache:function(a){if(arguments.length===1){this._enableResultCache=a;return a}else{return this._enableResultCache}},_mdxSettings:null,mdxSettings:function(a){if(arguments.length===1){this._mdxSettings=a;return a}else{return this._mdxSettings}},$type:new $.ig.Type("MdxDataSourceOptions",$$t.$ec.$type)},true);$c("XmlaDataProvider:fy","Object",{a:null,b:null,init:function(a,b){$.ig.$op.init.call(this);this.a=a;this.b=b},discoverCatalogsAsync:function(a,b){return this.c($$t.$b2.$type,new $$t.hj,"DBSCHEMA_CATALOGS",a,b)},discoverCubesAsync:function(a,b){return this.c($$t.$b5.$type,new $$t.hk,"MDSCHEMA_CUBES",a,b)},discoverDimensionsAsync:function(a,b){return this.c($$t.$b7.$type,new $$t.hl,"MDSCHEMA_DIMENSIONS",a,b)},discoverHierarchiesAsync:function(a,b){return this.c($$t.$b9.$type,new $$t.hm,"MDSCHEMA_HIERARCHIES",a,b)},discoverLevelsAsync:function(a,b){return this.c($$t.$cb.$type,new $$t.hn,"MDSCHEMA_LEVELS",a,b)},discoverMeasuresAsync:function(a,b){return this.c($$t.$cc.$type,new $$t.ho,"MDSCHEMA_MEASURES",a,b)},discoverMeasureGroupsAsync:function(a,b){return this.c($$t.$ce.$type,new $$t.hp,"MDSCHEMA_MEASUREGROUPS",a,b)},discoverMeasureGroupDimensionsAsync:function(a,b){return this.c($$t.$cf.$type,new $$t.hq,"MDSCHEMA_MEASUREGROUP_DIMENSIONS",a,b)},discoverMembersAsync:function(a,b){return this.c($$t.$ch.$type,new $$t.hr,"MDSCHEMA_MEMBERS",a,b)},discoverKpisAsync:function(a,b){return this.c($$t.$ck.$type,new $$t.hs,"MDSCHEMA_KPIS",a,b)},executeStatementAsync:function(a,b,c){var $self=this;var d=new $$t.bj($$t.$cm.$type,0);var e=this.a.getXmlaSoapWebClient$1($$t.$hi.$type);var f=new $$t.ht;e.requestCompleted=$.ig.Delegate.prototype.combine(e.requestCompleted,function(g,h){$self.e($$t.$cm.$type,f,h,d)});var g=new $$t.hz(a);this.g(g,b,c);e.j(g);return d.b()},c:function($t,a,b,c,d){var $self=this;var e=new $$t.bj($$t.$aq.$type.specialize($t),0);var f=this.a.getXmlaSoapWebClient$1($$t.$hf.$type);f.requestCompleted=$.ig.Delegate.prototype.combine(f.requestCompleted,function(g,h){$self.d($t,a,h,e)});var g=new $$t.h1(b);this.f(g,c,d);f.j(g);return e.b()},f:function(a,b,c){if(c!=null){var e=c.getEnumerator();while(e.moveNext()){var d=e.current();a.l().add(d.a(),d.b())}}if(b!=null){var g=b.getEnumerator();while(g.moveNext()){var f=g.current();a.properties().add$1(new $$t.g2(1,f.a(),f.b()))}}if(this.b!=null){this.b(a)}},g:function(a,b,c){if(c!=null){var e=c.getEnumerator();while(e.moveNext()){var d=e.current()}}if(b!=null){var g=b.getEnumerator();while(g.moveNext()){var f=g.current();a.properties().add$1(new $$t.g2(1,f.a(),f.b()))}}if(this.b!=null){this.b(a)}},d:function($t,a,b,c){if(b.error()!=null){c.d(b.error())}else if(b.cancelled()){c.c()}else{var d=b.result();if(d!=null){var e=new $$t.hu;var f=e.a($t,b.result().returnElement(),$$t.$gx.e("row",$$t.$iz.e),a);c.e(f)}}},e:function($t,a,b,c){if(b.error()!=null){c.d(b.error())}else if(b.cancelled()){c.c()}else{var d=b.result();if(d!=null){var e=a.deserialize(b.result().returnElement());c.e(e)}}},$type:new $.ig.Type("XmlaDataProvider",$.ig.$ot,[$$t.$a.$type])},true);$c("CatalogConstants:h3","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("CatalogConstants",$.ig.$ot)},true);$c("DbSchemaConstants:h7","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("DbSchemaConstants",$.ig.$ot)},true);$c("CubeConstants:ic","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("CubeConstants",$.ig.$ot)},true);$c("DimensionConstants:id","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("DimensionConstants",$.ig.$ot)},true);$c("HierarchyConstants:ie","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("HierarchyConstants",$.ig.$ot)},true);$c("InstanceConstants:ig","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("InstanceConstants",$.ig.$ot)},true);$c("KpiConstants:ih","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("KpiConstants",$.ig.$ot)},true);$c("LevelConstants:ii","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("LevelConstants",$.ig.$ot)},true);$c("MeasureConstants:ij","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("MeasureConstants",$.ig.$ot)},true);$c("MeasureGroupConstants:ik","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("MeasureGroupConstants",$.ig.$ot)},true);$c("MeasureGroupDimensionConstants:il","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("MeasureGroupDimensionConstants",$.ig.$ot)},true);$c("MemberConstants:im","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("MemberConstants",$.ig.$ot)},true);$c("OlapSchemaConstants:io","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("OlapSchemaConstants",$.ig.$ot)},true);$c("CubeRestrictions:ip","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("CubeRestrictions",$.ig.$ot)},true);$c("DimensionRestrictions:iq","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("DimensionRestrictions",$.ig.$ot)},true);$c("HierarchyRestrictions:ir","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("HierarchyRestrictions",$.ig.$ot)},true);$c("KpiRestrictions:is","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("KpiRestrictions",$.ig.$ot)},true);$c("LevelRestrictions:it","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("LevelRestrictions",$.ig.$ot)},true);$c("MeasureRestrictions:iu","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("MeasureRestrictions",$.ig.$ot)},true);$c("MeasureGroupRestrictions:iv","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("MeasureGroupRestrictions",$.ig.$ot)},true);$c("MeasureGroupDimensionRestrictions:iw","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("MeasureGroupDimensionRestrictions",$.ig.$ot)},true);$c("MemberRestrictions:ix","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("MemberRestrictions",$.ig.$ot)},true);$c("ICoreXmlaConnection:fz","Object",{$type:new $.ig.Type("ICoreXmlaConnection",null,[$$t.$f0.$type])},true);$c("ArraySerializer:hu","Object",{init:function(){$.ig.$op.init.call(this)},a:function($t,a,b,c){var d=new $$t.cr($t,0);var f=a.e(b).getEnumerator();while(f.moveNext()){var e=f.current();d.add(c.deserialize(e))}return d},$type:new $.ig.Type("ArraySerializer",$.ig.$ot)},true);$c("IXmlTypeSerializer$1:g5","Object",{$type:new $.ig.Type("IXmlTypeSerializer$1",null)},true);$c("AxisXmlTypeSerializer:hv","Object",{init:function(){$.ig.$op.init.call(this);if($$t.$hv.a!=null){return}$$t.$hv.a=new $$t.c9(String,$$t.$gx.$type,0);$$t.$hv.a.item("0",$$t.$gx.e("Tuple",$$t.$iz.d));$$t.$hv.a.item("1",$$t.$gx.e("Tuples",$$t.$iz.d))},deserialize:function(a){if(a.c()!=1){return null}var b=a;var c=$$t.$g9.e(b.k($$t.$gx.e("name","")));var d=b.h($$t.$hv.a.item("1"));var e=new $$t.hu;var f=e.a($$t.$dy.$type,d,$$t.$hv.a.item("0"),new $$t.hw);var g=0;if(f.count()>0){g=f.__inner[0].members().count()}return function(){var $ret=new $$t.cp(f,g);$ret.name(c);return $ret}()},$type:new $.ig.Type("AxisXmlTypeSerializer",$.ig.$ot,[$$t.$g5.$type.specialize($$t.$cp.$type)])},true);$c("TupleXmlTypeSerializer:hw","Object",{init:function(){$.ig.$op.init.call(this);if($$t.$hw.a!=null){return}$$t.$hw.a=new $$t.c9(String,$$t.$gx.$type,0);$$t.$hw.a.item("0",$$t.$gx.e("Member",$$t.$iz.d))},deserialize:function(a){if(a.c()!=1){return null}var b=a;var c=new $$t.hu;var d=c.a($$t.$dz.$type,b,$$t.$hw.a.item("0"),new $$t.hx);var e=new $$t.dy(d);var g=d.getEnumerator();while(g.moveNext()){var f=g.current();f.position(e)}return e},$type:new $.ig.Type("TupleXmlTypeSerializer",$.ig.$ot,[$$t.$g5.$type.specialize($$t.$dy.$type)])},true);$c("AxisMemberXmlTypeSerializer:hx","Object",{init:function(){$.ig.$op.init.call(this);if($$t.$hx.a!=null){return}$$t.$hx.a=new $$t.c9(String,$$t.$gx.$type,0);$$t.$hx.a.item("0",$$t.$gx.e("UName",$$t.$iz.d));$$t.$hx.a.item("1",$$t.$gx.e("LName",$$t.$iz.d));$$t.$hx.a.item("2",$$t.$gx.e("Caption",$$t.$iz.d));$$t.$hx.a.item("3",$$t.$gx.e("LNum",$$t.$iz.d));$$t.$hx.a.item("4",$$t.$gx.e("DisplayInfo",$$t.$iz.d))},deserialize:function(a){if(a.c()!=1){return null}var b=a;var c=$$t.$g9.f(b.h($$t.$hx.a.item("0")));var d=$$t.$g9.f(b.h($$t.$hx.a.item("1")));var e=$$t.$g9.f(b.h($$t.$hx.a.item("2")));var f=$$t.$g9.f(b.h($$t.$hx.a.item("3")));var g=$$t.$g9.f(b.h($$t.$hx.a.item("4")));var h=b.k($$t.$gx.e("Hierarchy","")).d();var i=function(){var $ret=new $$t.dz;$ret.hierarchyUniqueName(h);$ret.levelUniqueName(d);$ret.levelNumber($.ig.Number.prototype.parseInt(f));$ret.uniqueName(c);$ret.caption(e);$ret.displayInfo(String.isNullOrEmpty(g)?0:$h($.ig.Number.prototype.parseInt(g)));return $ret}();var k=b.d().getEnumerator();while(k.moveNext()){var j=k.current();switch(j.l().c()){case"UName":case"LName":case"Caption":case"LNum":case"DisplayInfo":continue;default:i.properties().add(j.l().c(),j.i());break}}return i},$type:new $.ig.Type("AxisMemberXmlTypeSerializer",$.ig.$ot,[$$t.$g5.$type.specialize($$t.$dz.$type)])},true);$c("CellXmlTypeSerializer:hy","Object",{init:function(){$.ig.$op.init.call(this)},deserialize:function(a){if(a.c()!=1){return null}var b=a;var c=b.k($$t.$gx.e("CellOrdinal","")).d();var d=function(){var $ret=new $$t.d0;$ret.cellOrdinal($.ig.Number.prototype.parseInt(c));return $ret}();var f=b.d().getEnumerator();while(f.moveNext()){var e=f.current();d.properties().add(e.l().c(),e.i())}return d},$type:new $.ig.Type("CellXmlTypeSerializer",$.ig.$ot,[$$t.$g5.$type.specialize($$t.$d0.$type)])},true);$c("CubeXmlTypeSerializer:hk","Object",{init:function(){$.ig.$op.init.call(this)},deserialize:function(a){if(a.c()!=1){return null}var b=a;var c=$$t.$g9.f(b.h($$t.$gx.e("CUBE_NAME",$$t.$iz.e)));var d=$$t.$g9.f(b.h($$t.$gx.e("CUBE_CAPTION",$$t.$iz.e)));var e=$$t.$g9.f(b.h($$t.$gx.e("DESCRIPTION",$$t.$iz.e)));var f;var g=$$t.$g9.f(b.h($$t.$gx.e("CUBE_TYPE",$$t.$iz.e)));switch(g){case"CUBE":f=0;break;case"DIMENSION":f=1;break;default:f=2;break}var h=$$t.$g9.f(b.h($$t.$gx.e("CATALOG_NAME",$$t.$iz.e)));var i=$$t.$g9.b(b.h($$t.$gx.e("LAST_DATA_UPDATE",$$t.$iz.e)));var j=$$t.$g9.b(b.h($$t.$gx.e("LAST_SCHEMA_UPDATE",$$t.$iz.e)));return function(){var $ret=new $$t.b5;$ret.name(c);$ret.caption(d);$ret.description(e);$ret.cubeType(f);$ret.catalogName(h);$ret.lastProcessed(i);$ret.lastUpdated(j);return $ret}()},$type:new $.ig.Type("CubeXmlTypeSerializer",$.ig.$ot,[$$t.$g5.$type.specialize($$t.$b5.$type)])},true);$c("DatabaseXmlTypeSerializer:hj","Object",{init:function(){$.ig.$op.init.call(this)},deserialize:function(a){if(a.c()!=1){return null}var b=a;var c=$$t.$g9.f(b.h($$t.$gx.e("CATALOG_NAME",$$t.$iz.e)));var d=$$t.$g9.f(b.h($$t.$gx.e("DESCRIPTION",$$t.$iz.e)));return function(){var $ret=new $$t.b2;$ret.name(c);$ret.caption(c);$ret.uniqueName(c);$ret.description(d);return $ret}()},$type:new $.ig.Type("DatabaseXmlTypeSerializer",$.ig.$ot,[$$t.$g5.$type.specialize($$t.$b2.$type)])},true);$c("DimensionXmlTypeSerializer:hl","Object",{init:function(){$.ig.$op.init.call(this);if($$t.$hl.a!=null){return}$$t.$hl.a=new $$t.c9(String,$$t.$gx.$type,0);$$t.$hl.a.item("DIMENSION_NAME",$$t.$gx.e("DIMENSION_NAME",$$t.$iz.e));$$t.$hl.a.item("DIMENSION_UNIQUE_NAME",$$t.$gx.e("DIMENSION_UNIQUE_NAME",$$t.$iz.e));$$t.$hl.a.item("DIMENSION_CAPTION",$$t.$gx.e("DIMENSION_CAPTION",$$t.$iz.e));$$t.$hl.a.item("DESCRIPTION",$$t.$gx.e("DESCRIPTION",$$t.$iz.e));$$t.$hl.a.item("DIMENSION_TYPE",$$t.$gx.e("DIMENSION_TYPE",$$t.$iz.e));$$t.$hl.a.item("DEFAULT_HIERARCHY",$$t.$gx.e("DEFAULT_HIERARCHY",$$t.$iz.e))},deserialize:function(a){if(a.c()!=1){return null}var b=a;var c=$$t.$g9.f(b.h($$t.$hl.a.item("DIMENSION_NAME")));var d=$$t.$g9.f(b.h($$t.$hl.a.item("DIMENSION_UNIQUE_NAME")));var e=$$t.$g9.f(b.h($$t.$hl.a.item("DIMENSION_CAPTION")));var f=$$t.$g9.f(b.h($$t.$hl.a.item("DESCRIPTION")));var g=$$t.$g9.f(b.h($$t.$hl.a.item("DIMENSION_TYPE")));var h=$.ig.Number.prototype.parseInt(g);var i=$$t.$g9.f(b.h($$t.$hl.a.item("DEFAULT_HIERARCHY")));return function(){var $ret=new $$t.b7;$ret.name(c);$ret.uniqueName(d);$ret.caption(e);$ret.description(f);$ret.dimensionType(h);$ret.defaultHierarchy(i);return $ret}()},$type:new $.ig.Type("DimensionXmlTypeSerializer",$.ig.$ot,[$$t.$g5.$type.specialize($$t.$b7.$type)])},true);$c("FaultError:g8","Object",{init:function(){$.ig.$op.init.call(this)},_errorCode:null,errorCode:function(a){if(arguments.length===1){this._errorCode=a;return a}else{return this._errorCode}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_source:null,source:function(a){if(arguments.length===1){this._source=a;return a}else{return this._source}},_helpFile:null,helpFile:function(a){if(arguments.length===1){this._helpFile=a;return a}else{return this._helpFile}},_severity:null,severity:function(a){if(arguments.length===1){this._severity=a;return a}else{return this._severity}},$type:new $.ig.Type("FaultError",$.ig.$ot)},true);$c("ErrorXmlTypeSerializer:ha","Object",{init:function(){$.ig.$op.init.call(this)},deserialize:function(a){var b=new $$t.g8;var c=a;b.errorCode($$t.$g9.e(c.k($$t.$gx.e("ErrorCode",""))));b.description($$t.$g9.e(c.k($$t.$gx.e("Description",""))));b.source($$t.$g9.e(c.k($$t.$gx.e("Source",""))));b.helpFile($$t.$g9.e(c.k($$t.$gx.e("HelpFile",""))));b.severity($$t.$g9.e(c.k($$t.$gx.e("Severity",""))));return b},$type:new $.ig.Type("ErrorXmlTypeSerializer",$.ig.$ot,[$$t.$g5.$type.specialize($$t.$g8.$type)])},true);$c("HierarchyXmlTypeSerializer:hm","Object",{init:function(){$.ig.$op.init.call(this);if($$t.$hm.a!=null){return}$$t.$hm.a=new $$t.c9(String,$$t.$gx.$type,0);$$t.$hm.a.item("HIERARCHY_NAME",$$t.$gx.e("HIERARCHY_NAME",$$t.$iz.e));$$t.$hm.a.item("HIERARCHY_UNIQUE_NAME",$$t.$gx.e("HIERARCHY_UNIQUE_NAME",$$t.$iz.e));$$t.$hm.a.item("HIERARCHY_CAPTION",$$t.$gx.e("HIERARCHY_CAPTION",$$t.$iz.e));$$t.$hm.a.item("DESCRIPTION",$$t.$gx.e("DESCRIPTION",$$t.$iz.e));$$t.$hm.a.item("DEFAULT_MEMBER",$$t.$gx.e("DEFAULT_MEMBER",$$t.$iz.e));$$t.$hm.a.item("ALL_MEMBER",$$t.$gx.e("ALL_MEMBER",$$t.$iz.e));$$t.$hm.a.item("DIMENSION_UNIQUE_NAME",$$t.$gx.e("DIMENSION_UNIQUE_NAME",$$t.$iz.e));$$t.$hm.a.item("HIERARCHY_DISPLAY_FOLDER",$$t.$gx.e("HIERARCHY_DISPLAY_FOLDER",$$t.$iz.e));$$t.$hm.a.item("HIERARCHY_ORIGIN",$$t.$gx.e("HIERARCHY_ORIGIN",$$t.$iz.e))},deserialize:function(a){if(a.c()!=1){return null}var b=a;var c=$$t.$g9.f(b.h($$t.$hm.a.item("HIERARCHY_NAME")));var d=$$t.$g9.f(b.h($$t.$hm.a.item("HIERARCHY_UNIQUE_NAME")));var e=$$t.$g9.f(b.h($$t.$hm.a.item("HIERARCHY_CAPTION")));var f=$$t.$g9.f(b.h($$t.$hm.a.item("DESCRIPTION")));var g=$$t.$g9.f(b.h($$t.$hm.a.item("DEFAULT_MEMBER")));var h=$$t.$g9.f(b.h($$t.$hm.a.item("ALL_MEMBER")));var i=$$t.$g9.f(b.h($$t.$hm.a.item("DIMENSION_UNIQUE_NAME")));var j=$$t.$g9.f(b.h($$t.$hm.a.item("HIERARCHY_DISPLAY_FOLDER")));var k=$$t.$g9.f(b.h($$t.$hm.a.item("HIERARCHY_ORIGIN")));var l=k==null?1:$.ig.Number.prototype.parseInt(k);return function(){var $ret=new $$t.b9;$ret.name(c);$ret.uniqueName(d);$ret.caption(e);$ret.description(f);$ret.defaultMember(g);$ret.allMember(h);$ret.dimensionUniqueName(i);$ret.hierarchyDisplayFolder(j);$ret.hierarchyOrigin(l);return $ret}()},$type:new $.ig.Type("HierarchyXmlTypeSerializer",$.ig.$ot,[$$t.$g5.$type.specialize($$t.$b9.$type)])},true);$c("KpiXmlTypeSerializer:hs","Object",{init:function(){$.ig.$op.init.call(this)},deserialize:function(a){if(a.c()!=1){return null}var b=a;var c=$$t.$g9.f(b.h($$t.$gx.e("KPI_NAME",$$t.$iz.e)));var d=c;var e=$$t.$g9.f(b.h($$t.$gx.e("KPI_CAPTION",$$t.$iz.e)));var f=$$t.$g9.f(b.h($$t.$gx.e("KPI_DESCRIPTION",$$t.$iz.e)));var g=$$t.$g9.f(b.h($$t.$gx.e("MEASUREGROUP_NAME",$$t.$iz.e)));var h=$$t.$g9.f(b.h($$t.$gx.e("KPI_DISPLAY_FOLDER",$$t.$iz.e)));var i=$$t.$g9.f(b.h($$t.$gx.e("KPI_VALUE",$$t.$iz.e)));var j=$$t.$g9.f(b.h($$t.$gx.e("KPI_GOAL",$$t.$iz.e)));var k=$$t.$g9.f(b.h($$t.$gx.e("KPI_STATUS",$$t.$iz.e)));var l=$$t.$g9.f(b.h($$t.$gx.e("KPI_TREND",$$t.$iz.e)));var m=$$t.$g9.f(b.h($$t.$gx.e("KPI_WEIGHT",$$t.$iz.e)));var n=$$t.$g9.f(b.h($$t.$gx.e("KPI_STATUS_GRAPHIC",$$t.$iz.e)));var o=$$t.$g9.f(b.h($$t.$gx.e("KPI_TREND_GRAPHIC",$$t.$iz.e)));var p=$$t.$g9.f(b.h($$t.$gx.e("KPI_PARENT_KPI_NAME",$$t.$iz.e)));var q=$$t.$g9.f(b.h($$t.$gx.e("KPI_CURRENT_TIME_MEMBER",$$t.$iz.e)));return function(){var $ret=new $$t.ck;$ret.name(c);$ret.uniqueName(d);$ret.caption(e);$ret.description(f);$ret.measureGroupName(g);$ret.kpiDisplayFolder(h);$ret.kpiValue(i);$ret.kpiGoal(j);$ret.kpiStatus(k);$ret.kpiTrend(l);$ret.kpiStatusGraphic(n);$ret.kpiTrendGraphic(o);$ret.kpiWeight(m);$ret.parentKpiName(p);$ret.currentTimeMember(q);return $ret}()},$type:new $.ig.Type("KpiXmlTypeSerializer",$.ig.$ot,[$$t.$g5.$type.specialize($$t.$ck.$type)])},true);$c("LevelXmlTypeSerializer:hn","Object",{init:function(){$.ig.$op.init.call(this)},deserialize:function(a){if(a.c()!=1){return null}var b=a;var c=$$t.$g9.f(b.h($$t.$gx.e("LEVEL_NAME",$$t.$iz.e)));var d=$$t.$g9.f(b.h($$t.$gx.e("LEVEL_UNIQUE_NAME",$$t.$iz.e)));var e=$$t.$g9.f(b.h($$t.$gx.e("LEVEL_CAPTION",$$t.$iz.e)));var f=$$t.$g9.f(b.h($$t.$gx.e("DESCRIPTION",$$t.$iz.e)));var g=$$t.$g9.f(b.h($$t.$gx.e("DIMENSION_UNIQUE_NAME",$$t.$iz.e)));var h=$$t.$g9.f(b.h($$t.$gx.e("HIERARCHY_UNIQUE_NAME",$$t.$iz.e)));var i=$$t.$g9.f(b.h($$t.$gx.e("LEVEL_NUMBER",$$t.$iz.e)));var j=$$t.$g9.f(b.h($$t.$gx.e("LEVEL_CARDINALITY",$$t.$iz.e)));var k=$$t.$g9.f(b.h($$t.$gx.e("LEVEL_ORIGIN",$$t.$iz.e)));var l=$$t.$g9.f(b.h($$t.$gx.e("LEVEL_ORDERING_PROPERTY",$$t.$iz.e)));return function(){var $ret=new $$t.cb;$ret.name(c);$ret.uniqueName(d);$ret.caption(e);$ret.description(f);$ret.dimensionUniqueName(g);$ret.hierarchyUniqueName(h);$ret.depth($.ig.Number.prototype.parseInt(i));$ret.membersCount($.ig.Number.prototype.parseInt(j));$ret.levelOrigin(String.isNullOrEmpty(k)?0:$.ig.Number.prototype.parseInt(k));$ret.levelOrderingProperty(l);return $ret}()},$type:new $.ig.Type("LevelXmlTypeSerializer",$.ig.$ot,[$$t.$g5.$type.specialize($$t.$cb.$type)])},true);$c("MeasureGroupDimensionXmlTypeSerializer:hq","Object",{init:function(){$.ig.$op.init.call(this);if($$t.$hq.a!=null){return}$$t.$hq.a=new $$t.c9(String,$$t.$gx.$type,0);$$t.$hq.a.item("CATALOG_NAME",$$t.$gx.e("CATALOG_NAME",$$t.$iz.e));$$t.$hq.a.item("CUBE_NAME",$$t.$gx.e("CUBE_NAME",$$t.$iz.e));$$t.$hq.a.item("MEASUREGROUP_NAME",$$t.$gx.e("MEASUREGROUP_NAME",$$t.$iz.e));$$t.$hq.a.item("DIMENSION_UNIQUE_NAME",$$t.$gx.e("DIMENSION_UNIQUE_NAME",$$t.$iz.e));$$t.$hq.a.item("MEASUREGROUP_CARDINALITY",$$t.$gx.e("MEASUREGROUP_CARDINALITY",$$t.$iz.e));$$t.$hq.a.item("DIMENSION_CARDINALITY",$$t.$gx.e("DIMENSION_CARDINALITY",$$t.$iz.e));$$t.$hq.a.item("DIMENSION_IS_VISIBLE",$$t.$gx.e("DIMENSION_IS_VISIBLE",$$t.$iz.e));$$t.$hq.a.item("DIMENSION_IS_FACT_DIMENSION",$$t.$gx.e("DIMENSION_IS_FACT_DIMENSION",$$t.$iz.e));$$t.$hq.a.item("DIMENSION_PATH",$$t.$gx.e("DIMENSION_PATH",$$t.$iz.e));$$t.$hq.a.item("DIMENSION_GRANULARITY",$$t.$gx.e("DIMENSION_GRANULARITY",$$t.$iz.e))},deserialize:function(a){if(a.c()!=1){return null}var b=a;var c=$$t.$g9.f(b.h($$t.$hq.a.item("CATALOG_NAME")));var d=$$t.$g9.f(b.h($$t.$hq.a.item("CUBE_NAME")));var e=$$t.$g9.f(b.h($$t.$hq.a.item("MEASUREGROUP_NAME")));var f=$$t.$g9.f(b.h($$t.$hq.a.item("DIMENSION_UNIQUE_NAME")));
var g=$$t.$g9.f(b.h($$t.$hq.a.item("MEASUREGROUP_CARDINALITY")));var h=g=="ONE"?0:1;var i=$$t.$g9.f(b.h($$t.$hq.a.item("DIMENSION_CARDINALITY")));var j=i=="ONE"?0:1;var k=$$t.$g9.a(b.h($$t.$hq.a.item("DIMENSION_IS_VISIBLE")));var l=$$t.$g9.a(b.h($$t.$hq.a.item("DIMENSION_IS_FACT_DIMENSION")));var m=$$t.$g9.f(b.h($$t.$hq.a.item("DIMENSION_PATH")));var n=$$t.$g9.f(b.h($$t.$hq.a.item("DIMENSION_GRANULARITY")));return function(){var $ret=new $$t.cf;$ret.catalogName(c);$ret.cubeName(d);$ret.measureGroupName(e);$ret.dimensionUniqueName(f);$ret.measureGroupCardinality(h);$ret.dimensionCardinality(j);$ret.isDimensionVisible(k);$ret.isFactDimension(l);$ret.dimensionPath(m);$ret.dimensionGranularity(n);return $ret}()},$type:new $.ig.Type("MeasureGroupDimensionXmlTypeSerializer",$.ig.$ot,[$$t.$g5.$type.specialize($$t.$cf.$type)])},true);$c("MeasureGroupXmlTypeSerializer:hp","Object",{init:function(){$.ig.$op.init.call(this);if($$t.$hp.a!=null){return}$$t.$hp.a=new $$t.c9(String,$$t.$gx.$type,0);$$t.$hp.a.item("CATALOG_NAME",$$t.$gx.e("CATALOG_NAME",$$t.$iz.e));$$t.$hp.a.item("CUBE_NAME",$$t.$gx.e("CUBE_NAME",$$t.$iz.e));$$t.$hp.a.item("MEASUREGROUP_NAME",$$t.$gx.e("MEASUREGROUP_NAME",$$t.$iz.e));$$t.$hp.a.item("MEASUREGROUP_CAPTION",$$t.$gx.e("MEASUREGROUP_CAPTION",$$t.$iz.e));$$t.$hp.a.item("DESCRIPTION",$$t.$gx.e("DESCRIPTION",$$t.$iz.e))},deserialize:function(a){if(a.c()!=1){return null}var b=a;var c=$$t.$g9.f(b.h($$t.$hp.a.item("CATALOG_NAME")));var d=$$t.$g9.f(b.h($$t.$hp.a.item("CUBE_NAME")));var e=$$t.$g9.f(b.h($$t.$hp.a.item("MEASUREGROUP_NAME")));var f=$$t.$g9.f(b.h($$t.$hp.a.item("MEASUREGROUP_CAPTION")));var g=$$t.$g9.f(b.h($$t.$hp.a.item("DESCRIPTION")));return function(){var $ret=new $$t.ce;$ret.catalogName(c);$ret.cubeName(d);$ret.name(e);$ret.caption(f);$ret.description(g);return $ret}()},$type:new $.ig.Type("MeasureGroupXmlTypeSerializer",$.ig.$ot,[$$t.$g5.$type.specialize($$t.$ce.$type)])},true);$c("MeasureXmlTypeSerializer:ho","Object",{init:function(){$.ig.$op.init.call(this);if($$t.$ho.a!=null){return}$$t.$ho.a=new $$t.c9(String,$$t.$gx.$type,0);$$t.$ho.a.item("MEASURE_NAME",$$t.$gx.e("MEASURE_NAME",$$t.$iz.e));$$t.$ho.a.item("MEASURE_UNIQUE_NAME",$$t.$gx.e("MEASURE_UNIQUE_NAME",$$t.$iz.e));$$t.$ho.a.item("MEASURE_CAPTION",$$t.$gx.e("MEASURE_CAPTION",$$t.$iz.e));$$t.$ho.a.item("DESCRIPTION",$$t.$gx.e("DESCRIPTION",$$t.$iz.e));$$t.$ho.a.item("DEFAULT_FORMAT_STRING",$$t.$gx.e("DEFAULT_FORMAT_STRING",$$t.$iz.e));$$t.$ho.a.item("MEASUREGROUP_NAME",$$t.$gx.e("MEASUREGROUP_NAME",$$t.$iz.e));$$t.$ho.a.item("MEASURE_AGGREGATOR",$$t.$gx.e("MEASURE_AGGREGATOR",$$t.$iz.e));$$t.$ho.a.item("MEASURE_DISPLAY_FOLDER",$$t.$gx.e("MEASURE_DISPLAY_FOLDER",$$t.$iz.e))},deserialize:function(a){if(a.c()!=1){return null}var b=a;var c=$$t.$g9.f(b.h($$t.$ho.a.item("MEASURE_NAME")));var d=$$t.$g9.f(b.h($$t.$ho.a.item("MEASURE_UNIQUE_NAME")));var e=$$t.$g9.f(b.h($$t.$ho.a.item("MEASURE_CAPTION")));var f=$$t.$g9.f(b.h($$t.$ho.a.item("DESCRIPTION")));var g=$$t.$g9.f(b.h($$t.$ho.a.item("DEFAULT_FORMAT_STRING")));var h=$$t.$g9.f(b.h($$t.$ho.a.item("MEASUREGROUP_NAME")));var i=$$t.$g9.f(b.h($$t.$ho.a.item("MEASURE_AGGREGATOR")));var j=$.ig.Number.prototype.parseInt(i);var k=$$t.$g9.f(b.h($$t.$ho.a.item("MEASURE_DISPLAY_FOLDER")));return function(){var $ret=new $$t.cc;$ret.name(c);$ret.uniqueName(d);$ret.caption(e);$ret.description(f);$ret.defaultFormatString(g);$ret.measureGroupName(h);$ret.aggregatorType(j);$ret.measureDisplayFolder(k);return $ret}()},$type:new $.ig.Type("MeasureXmlTypeSerializer",$.ig.$ot,[$$t.$g5.$type.specialize($$t.$cc.$type)])},true);$c("MemberXmlTypeSerializer:hr","Object",{init:function(){$.ig.$op.init.call(this);if($$t.$hr.a!=null){return}$$t.$hr.a=new $$t.c9(String,$$t.$gx.$type,0);$$t.$hr.a.item("CATALOG_NAME",$$t.$gx.e("CATALOG_NAME",$$t.$iz.e));$$t.$hr.a.item("CUBE_NAME",$$t.$gx.e("CUBE_NAME",$$t.$iz.e));$$t.$hr.a.item("MEMBER_NAME",$$t.$gx.e("MEMBER_NAME",$$t.$iz.e));$$t.$hr.a.item("MEMBER_UNIQUE_NAME",$$t.$gx.e("MEMBER_UNIQUE_NAME",$$t.$iz.e));$$t.$hr.a.item("MEMBER_TYPE",$$t.$gx.e("MEMBER_TYPE",$$t.$iz.e));$$t.$hr.a.item("DIMENSION_UNIQUE_NAME",$$t.$gx.e("DIMENSION_UNIQUE_NAME",$$t.$iz.e));$$t.$hr.a.item("HIERARCHY_UNIQUE_NAME",$$t.$gx.e("HIERARCHY_UNIQUE_NAME",$$t.$iz.e));$$t.$hr.a.item("LEVEL_UNIQUE_NAME",$$t.$gx.e("LEVEL_UNIQUE_NAME",$$t.$iz.e));$$t.$hr.a.item("MEMBER_CAPTION",$$t.$gx.e("MEMBER_CAPTION",$$t.$iz.e));$$t.$hr.a.item("DESCRIPTION",$$t.$gx.e("DESCRIPTION",$$t.$iz.e));$$t.$hr.a.item("LEVEL_NUMBER",$$t.$gx.e("LEVEL_NUMBER",$$t.$iz.e));$$t.$hr.a.item("CHILDREN_CARDINALITY",$$t.$gx.e("CHILDREN_CARDINALITY",$$t.$iz.e));$$t.$hr.a.item("PARENT_UNIQUE_NAME",$$t.$gx.e("PARENT_UNIQUE_NAME",$$t.$iz.e));$$t.$hr.a.item("SCOPE",$$t.$gx.e("SCOPE",$$t.$iz.e));$$t.$hr.a.item("PARENT_LEVEL",$$t.$gx.e("PARENT_LEVEL",$$t.$iz.e))},deserialize:function(a){if(a.c()!=1){return null}var b=a;var c=$$t.$g9.f(b.h($$t.$hr.a.item("CATALOG_NAME")));var d=$$t.$g9.f(b.h($$t.$hr.a.item("CUBE_NAME")));var e=$$t.$g9.f(b.h($$t.$hr.a.item("MEMBER_NAME")));var f=$$t.$g9.f(b.h($$t.$hr.a.item("MEMBER_UNIQUE_NAME")));var g=$$t.$g9.f(b.h($$t.$hr.a.item("MEMBER_TYPE")));var h=$$t.$g9.f(b.h($$t.$hr.a.item("DIMENSION_UNIQUE_NAME")));var i=$$t.$g9.f(b.h($$t.$hr.a.item("HIERARCHY_UNIQUE_NAME")));var j=$$t.$g9.f(b.h($$t.$hr.a.item("LEVEL_UNIQUE_NAME")));var k=$$t.$g9.f(b.h($$t.$hr.a.item("MEMBER_CAPTION")));var l=$$t.$g9.f(b.h($$t.$hr.a.item("DESCRIPTION")));var m=$$t.$g9.f(b.h($$t.$hr.a.item("LEVEL_NUMBER")));var n=$$t.$g9.f(b.h($$t.$hr.a.item("CHILDREN_CARDINALITY")));var o=$$t.$g9.f(b.h($$t.$hr.a.item("PARENT_UNIQUE_NAME")));var p=$$t.$g9.f(b.h($$t.$hr.a.item("SCOPE")));var q=$$t.$g9.f(b.h($$t.$gx.e("PARENT_LEVEL",$$t.$iz.e)));var r=$l($.ig.Number.prototype.$type,null);return function(){var $ret=new $$t.ch;$ret.catalogName(c);$ret.cubeName(d);$ret.dimensionUniqueName(h);$ret.hierarchyUniqueName(i);$ret.levelUniqueName(j);$ret.levelDepth($.ig.Number.prototype.parseInt(m));$ret.name(e);$ret.uniqueName(f);$ret.memberType($.ig.Number.prototype.parseInt(g));$ret.caption(k);$ret.childrenCardinality($.ig.Number.prototype.parseInt(n));$ret.description(l);$ret.parentUniqueName(o);$ret.scope(p==null?r:$l($.ig.Number.prototype.$type,$.ig.Number.prototype.parseInt(p)));$ret.parentLevel(String.isNullOrEmpty(q)?0:$.ig.Number.prototype.parseInt(q));return $ret}()},$type:new $.ig.Type("MemberXmlTypeSerializer",$.ig.$ot,[$$t.$g5.$type.specialize($$t.$ch.$type)])},true);$c("ResultXmlTypeSerializer:ht","Object",{init:function(){$.ig.$op.init.call(this)},deserialize:function(a){if(a.c()!=1){return null}var b=a;var c=b.l().d();switch(c){case $$t.$iz.b:return function(){var $ret=new $$t.cm;$ret.isEmpty(true);return $ret}();case $$t.$iz.d:var d=b.h($$t.$gx.e("OlapInfo",$$t.$iz.d));var e=b.h($$t.$gx.e("Axes",$$t.$iz.d));var f=new $$t.hu;var g=f.a($$t.$cp.$type,e,$$t.$gx.e("Axis",$$t.$iz.d),new $$t.hv);var h=b.h($$t.$gx.e("CellData",$$t.$iz.d));var i=f.a($$t.$d0.$type,h,$$t.$gx.e("Cell",$$t.$iz.d),new $$t.hy);return function(){var $ret=new $$t.cm;$ret.axes(g);$ret.cells(i);return $ret}()}return null},$type:new $.ig.Type("ResultXmlTypeSerializer",$.ig.$ot,[$$t.$g5.$type.specialize($$t.$cm.$type)])},true);$c("SerializerUtils:g9","Object",{init:function(){$.ig.$op.init.call(this)},f:function(a){if(a!=null){return a.i()}else{return null}},e:function(a){if(a!=null){return a.d()}else{return null}},a:function(a){var b=$$t.$g9.f(a).toLowerCase();return b=="true"},b:function(a){if(a!=null&&!String.isNullOrEmpty(a.i())){return $$t.$g9.d(a.i())}else{return $$t.$g9.c()}},d:function(a){var dateString_=a;var b;b=function(text){var match=/^\s*(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(.*)$/.exec(text);if(!match){throw"Invalid textual date representation."}var year=parseInt(match[1],10);var month=parseInt(match[2],10)-1;var day=parseInt(match[3],10);var hours=parseInt(match[4],10);var minutes=parseInt(match[5],10);var seconds=parseInt(match[6],10);return new Date(year,month,day,hours,minutes,seconds)}(dateString_);return b},c:function(){var a;a=new Date(2e3,0,1);return a},$type:new $.ig.Type("SerializerUtils",$.ig.$ot)},true);$c("XmlaConstants:iy","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("XmlaConstants",$.ig.$ot)},true);$c("XmlaSoapFault:g6","Object",{init:function(){$.ig.$op.init.call(this)},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},$type:new $.ig.Type("XmlaSoapFault",$.ig.$ot)},true);$c("XmlaSoapFaultXmlTypeSerializer:g4","Object",{init:function(){$.ig.$op.init.call(this)},deserialize:function(a){var b=a;var c=new $$t.g6;var e=b.d().getEnumerator();while(e.moveNext()){var d=e.current();switch(d.l().c()){case"faultcode":c.c($$t.$g9.f(d));break;case"faultstring":c.d($$t.$g9.f(d));break;case"faultactor":c.b($$t.$g9.f(d));break}}var f=b.h($$t.$gx.e("detail",""));if(f!=null){var g=f.e($$t.$gx.e("Error",""));var h=new $$t.cr($$t.$g8.$type,0);var i=new $$t.ha;var k=g.getEnumerator();while(k.moveNext()){var j=k.current();var l=i.deserialize(j);h.add(l)}c.a(function(){var $ret=new $$t.g7;$ret.a(h.toArray());return $ret}())}return c},$type:new $.ig.Type("XmlaSoapFaultXmlTypeSerializer",$.ig.$ot,[$$t.$g5.$type.specialize($$t.$g6.$type)])},true);$c("IXmlaMethodResult:hh","Object",{$type:new $.ig.Type("IXmlaMethodResult",null)},true);$c("XmlaSoapMethodResult:hg","Object",{init:function(){$.ig.$op.init.call(this)},b:null,returnElement:function(a){if(arguments.length===1){this.b=a;return a}else{return this.b}},_sessionId:null,sessionId:function(a){if(arguments.length===1){this._sessionId=a;return a}else{return this._sessionId}},$type:new $.ig.Type("XmlaSoapMethodResult",$.ig.$ot,[$$t.$hh.$type])},true);$c("DiscoverResponseResult:hf","XmlaSoapMethodResult",{init:function(){$$t.$hg.init.call(this)},$type:new $.ig.Type("DiscoverResponseResult",$$t.$hg.$type)},true);$c("RequestCompletedEventArgs$1:gi","AsyncCompletedEventArgs",{$t:null,i:null,init:function($t,a,b,c,d){this.$t=$t;this.$type=this.$type.specialize(this.$t);$$t.$dt.init.call(this,b,c,d);this.i=a},result:function(){$$t.$dt.h.call(this);return this.i},$type:new $.ig.Type("RequestCompletedEventArgs$1",$$t.$dt.$type)},true);$c("ExecuteResponseResult:hi","XmlaSoapMethodResult",{init:function(){$$t.$hg.init.call(this)},$type:new $.ig.Type("ExecuteResponseResult",$$t.$hg.$type)},true);$c("FaultDetail:g7","Object",{init:function(){$.ig.$op.init.call(this)},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},$type:new $.ig.Type("FaultDetail",$.ig.$ot)},true);$c("IXmlaSoapMethod:gj","Object",{$type:new $.ig.Type("IXmlaSoapMethod",null)},true);$c("XmlaNamespace:iz","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("XmlaNamespace",$.ig.$ot)},true);$c("XmlaQueryProperty:g2","Object",{init:function(a){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$.ig.$op.init.call(this)},init1:function(a,b,c){$.ig.$op.init.call(this);this.a(b);this.c(c)},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},toString:function(){return String.concat(this.a()," = ",this.c())},$type:new $.ig.Type("XmlaQueryProperty",$.ig.$ot)},true);$c("XmlaPropertiesCollection:g1","Object",{c:null,d:null,e:null,init:function(){$.ig.$op.init.call(this);this.c=new $$t.c9(String,$$t.$g2.$type,0);this.d=new $$t.c9(String,$.ig.Number.prototype.$type,0);this.e=new $$t.cr($$t.$g2.$type,0)},tryGetValue:function(a,b){var $self=this;return{ret:function(){var c=$self.c.tryGetValue(a,b);b=c.p1;return c.ret}(),p1:b}},contains1:function(a){return this.c.containsKey(a)},indexOf:function(a){return this.e.indexOf(a)},insert:function(a,b){this.c.add(b.a(),b);this.e.insert(a,b)},removeAt:function(a){if(a<this.e.count()){var b=this.e.item(a);if(this.c.remove(b.a())){this.e.removeAt(a)}}},item:function(a,b){if(arguments.length===2){var c=this.e.item(a);this.c.remove(c.a());this.c.add(b.a(),b);this.e.item(a,b);return b}else{return this.e.item(a)}},add$1:function(a){this.c.add(a.a(),a);this.e.add(a)},clear:function(){this.e.clear();this.c.clear()},contains:function(a){return this.e.contains(a)},copyTo$1:function(a,b){this.e.copyTo(a,b)},count:function(){return this.e.count()},isReadOnly:function(){return this.e.isReadOnly()},remove:function(a){if(this.e.remove(a)){return this.c.remove(a.a())}return false},getEnumerator:function(){return this.e.getEnumerator()},getEnumerator:function(){return this.e.getEnumerator()},add:function(a){this.add$1(a);return this.count()-1},isFixedSize:function(){return false},copyTo:function(a,b){throw new $$t.c5(0)},isSynchronized:function(){return this.e.isSynchronized()},syncRoot:function(){return this.e.syncRoot()},$type:new $.ig.Type("XmlaPropertiesCollection",$.ig.$ot,[$$t.$cn.$type.specialize($$t.$g2.$type),$.ig.IList.prototype.$type])},true);$c("XmlaSoapMessageBuilder:g3","Object",{init:function(){$.ig.$op.init.call(this)},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},c:function(){if(this.a()==null){throw new $$t.dp(1,"XmlaMethod is not specified.")}var a=$$t.$gy.c($$t.$g3.g);this.a().construct(a);var b=this.j();return b.toString()},j:function(){var a=new $$t.gk(1,$$t.$gx.e("Envelope",$$t.$g3.g));this.i(a);this.h(a);return a},i:function(a){var b=new $$t.gk(1,$$t.$gx.e("Header",a.l().f().b()));a.g(b);var d=this.a().headers().getEnumerator();while(d.moveNext()){var c=d.current();b.g(c)}},h:function(a){var b=new $$t.gk(1,$$t.$gx.e("Body",a.l().f().b()));a.g(b);var c=new $$t.gk(1,$$t.$gx.e(this.a().name(),"urn:schemas-microsoft-com:xml-analysis"));b.g(c);var e=this.a().parameters().getEnumerator();while(e.moveNext()){var d=e.current();c.g(d)}},$type:new $.ig.Type("XmlaSoapMessageBuilder",$.ig.$ot)},true);$c("XmlaSoapMethod:h0","Object",{g:null,f:null,c:null,b:null,a:null,init:function(){$.ig.$op.init.call(this);this.c=new $$t.cr($$t.$gk.$type,0);this.b=new $$t.cr($$t.$gk.$type,0);this.g=new $$t.c3($$t.$gk.$type,1,this.c);this.f=new $$t.c3($$t.$gk.$type,1,this.b);this.a=new $$t.g1},properties:function(){return this.a},name:function(){},parameters:function(){return this.g},headers:function(){return this.f},e:function(){return this.c},d:function(){return this.b},construct:function(a){},mergeProperties:function(a){var $self=this;if(a==null){return}var c=a.getEnumerator();while(c.moveNext()){var b=c.current();var d;if(function(){var e=$self.properties().tryGetValue(b.a(),d);d=e.p1;return e.ret}()){d.c(b.c())}else{this.properties().add$1(b)}}},$type:new $.ig.Type("XmlaSoapMethod",$.ig.$ot,[$$t.$gj.$type])},true);$c("XmlaSoapMethodDiscover:h1","XmlaSoapMethod",{k:null,init:function(a){$$t.$h0.init.call(this);this.j(0);this.n(a);this.k=new $$t.c9(String,$.ig.$op.$type,0)},l:function(){return this.k},_n:null,n:function(a){if(arguments.length===1){this._n=a;return a}else{return this._n}},name:function(){return"Discover"},_j:0,j:function(a){if(arguments.length===1){this._j=a;return a}else{return this._j}},_r:null,r:function(a){if(arguments.length===1){this._r=a;return a}else{return this._r}},construct:function(a){var b=$$t.$gy.c("urn:schemas-microsoft-com:xml-analysis");var c=new $$t.gk(1,$$t.$gx.e("RequestType",b.b()));c.i(this.n());var d=new $$t.gk(1,$$t.$gx.e("Properties","urn:schemas-microsoft-com:xml-analysis"));var e=new $$t.gk(1,$$t.$gx.e("PropertyList",d.l().f().b()));d.g(e);var f=new $$t.gk(1,$$t.$gx.e("Restrictions","urn:schemas-microsoft-com:xml-analysis"));var g=new $$t.gk(1,$$t.$gx.e("RestrictionList",f.l().f().b()));f.g(g);var i=this.properties().getEnumerator();while(i.moveNext()){var h=i.current();e.g(new $$t.gk(2,$$t.$gx.e(h.a(),"urn:schemas-microsoft-com:xml-analysis"),h.c()))}var k=this.k.getEnumerator();while(k.moveNext()){var j=k.current();g.g(new $$t.gk(2,$$t.$gx.e(j.key(),""),j.value()))}this.e().add(c);this.e().add(f);this.e().add(d)},$type:new $.ig.Type("XmlaSoapMethodDiscover",$$t.$h0.$type)},true);$c("XmlaSoapMethodExecute:hz","XmlaSoapMethod",{init:function(a){$$t.$h0.init.call(this);this.l(a)},name:function(){return"Execute"},_l:null,l:function(a){if(arguments.length===1){this._l=a;return a}else{return this._l}},construct:function(a){var b=$$t.$gy.c("urn:schemas-microsoft-com:xml-analysis");var c=new $$t.gk(1,$$t.$gx.e("Command",b.b()));var d=new $$t.gk(1,$$t.$gx.e("Statement",b.b()));d.i(this.l());c.g(d);var e=new $$t.gk(1,$$t.$gx.e("Properties","urn:schemas-microsoft-com:xml-analysis"));var f=new $$t.gk(1,$$t.$gx.e("PropertyList",e.l().f().b()));e.g(f);var h=this.properties().getEnumerator();while(h.moveNext()){var g=h.current();f.g(new $$t.gk(2,$$t.$gx.e(g.a(),"urn:schemas-microsoft-com:xml-analysis"),g.c()))}this.e().add(c);this.e().add(e)},$type:new $.ig.Type("XmlaSoapMethodExecute",$$t.$h0.$type)},true);$c("XmlaSoapWebClient:f2","Object",{staticInit:function(){$$t.$f2.a=new $$t.cr(String,0)},$type:new $.ig.Type("XmlaSoapWebClient",$.ig.$ot)},true);$c("XmlaSoapWebClient$1:f1","XmlaSoapWebClient",{$t:null,f:null,b:false,init:function($t,a,b){this.$t=$t;this.$type=this.$type.specialize(this.$t);$$t.$f2.init.call(this);this.f=new $$t.gd;this.f.d(b);var c=this.f;c.uploadStringCompleted=$.ig.Delegate.prototype.combine(c.uploadStringCompleted,this.l.runOn(this));this.g(a)},requestCompleted:null,_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},c:function(){return this.b},j:function(a){this.k(a,null)},k:function(a,b){var c=new $$t.g3;c.a(a);var d=c.c();if(this.e()!=null){this.f.a(this.e())}else{this.f.a(null)}this.f.c().item("Content-Type","text/xml");this.f.h(this.g(),"POST",d,b)},h:function(a){if(this.requestCompleted!=null){this.requestCompleted(this,a)}},l:function(a,b){this.b=true;this.i(b)},i:function(a){var b=null;var c=null;var d=null;if(!a.cancelled()&&a.error()==null){try{var e=$$t.$gz.i(a.result());var f=e.h($$t.$gx.e("Envelope","http://schemas.xmlsoap.org/soap/envelope/"));var g=f.h($$t.$gx.e("Body","http://schemas.xmlsoap.org/soap/envelope/"));var h=g.h($$t.$gx.e("Fault","http://schemas.xmlsoap.org/soap/envelope/"));if(h!=null){var i=new $$t.g4;var j=i.deserialize(h);c=new $$t.hd($$t.$g6.$type,j,new $$t.hb(j.d()),new $$t.hc(j.c()),null)}else{if(this.$t==$$t.$hf.$type){var k=g.h($$t.$gx.e("DiscoverResponse","urn:schemas-microsoft-com:xml-analysis"));var l=k.h($$t.$gx.e("return","urn:schemas-microsoft-com:xml-analysis"));var m=l.h($$t.$gx.e("root",$$t.$iz.e));var n=new $$t.hf;n.returnElement(m);b=n}if(this.$t==$$t.$hi.$type){var o=g.h($$t.$gx.e("ExecuteResponse","urn:schemas-microsoft-com:xml-analysis"));var p=o.h($$t.$gx.e("return","urn:schemas-microsoft-com:xml-analysis"));var q=p.h($$t.$gx.e("root",$$t.$iz.d));var r=new $$t.hi;r.returnElement(q);b=r}}}catch(e_){d=e_}}if(d==null){d=a.error()!=null?a.error():c}var s=new $$t.gi(this.$t,b,d,a.cancelled(),a.userState());this.h(s)},$type:new $.ig.Type("XmlaSoapWebClient$1",$$t.$f2.$type)},true);$c("IMdxExpression:e6","Object",{$type:new $.ig.Type("IMdxExpression",null)},true);$c("IMdxElement:e8","Object",{$type:new $.ig.Type("IMdxElement",null,[$$t.$e6.$type])},true);$c("IAxisFilterElement:fr","Object",{$type:new $.ig.Type("IAxisFilterElement",null,[$$t.$e8.$type])},true);$c("IMdxAxis:e5","Object",{$type:new $.ig.Type("IMdxAxis",null,[$$t.$e6.$type])},true);$c("IMdxAxisProvider:e4","Object",{$type:new $.ig.Type("IMdxAxisProvider",null)},true);$c("IMdxCollectionElement:fb","Object",{$type:new $.ig.Type("IMdxCollectionElement",null,[$$t.$e8.$type])},true);$c("IMdxDimensionAxisProvider:e3","Object",{$type:new $.ig.Type("IMdxDimensionAxisProvider",null,[$$t.$e4.$type])},true);$c("IMdxFilterInfo:fq","Object",{$type:new $.ig.Type("IMdxFilterInfo",null)},true);$c("IMdxExtendedFilterInfo:fp","Object",{$type:new $.ig.Type("IMdxExtendedFilterInfo",null,[$$t.$fq.$type])},true);$c("IMdxItemElement:fi","Object",{$type:new $.ig.Type("IMdxItemElement",null,[$$t.$e8.$type])},true);$c("IMdxSet:e7","Object",{$type:new $.ig.Type("IMdxSet",null,[$$t.$e6.$type])},true);$c("MdxAxis:fe","Object",{e:null,f:null,d:false,i:null,h:0,a:null,init:function(a,b){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$$t.$fe.init1.call(this,1,b,new $$t.eu)},init1:function(a,b,c){this.a=["COLUMNS","ROWS","PAGES"];$.ig.$op.init.call(this);this.axisIndex(b);this.b(c!=null?c:new $$t.eu);this.e=new $$t.cr($$t.$e7.$type,0);this.f=new $$t.c3($$t.$e7.$type,1,this.e)},axisIndex:function(a){if(arguments.length===1){if(this.h!=a){this.h=a;this.d=false}return a}else{return this.h}},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},c:function(){return $b($$t.$eu.$type,this.b())},g:function(){return this.f},mdxExpression:function(){if(!this.d){this.i=this.j();this.d=true}return this.i},rebuildExpression:function(){this.i=this.j();this.d=true},getMdxSets:function(){var d__=new $.ig.MdxAxis___GetMdxSets__IteratorClass(-2);d__.__4__this=this;return d__},addSet:function(a){this.e.add(a);this.d=false},j:function(){var a=new $$t.fc(0);var b=false;var d=this.g().getEnumerator();while(d.moveNext()){var c=d.current();if(!c.isEnabled()){continue}if(b){a.k(",");a.k($$t.$fd.newLine())}a.k(c.mdxExpression());b=true}if(this.g().count()>1){a.w(0,"{");a.k("}")}this.m(a,this.c());this.n(a,this.c());this.l(a,this.c());this.k(a);return a.toString()},m:function(a,b){if(b.f()){a.w(0,"Distinct(");a.k(")")}},n:function(a,b){if(b.h()){a.w(0,$$t.$fd.newLine());a.w(0,"NON EMPTY")}},l:function(a,b){if(b.e()){a.k($$t.$fd.newLine());a.k("DIMENSION PROPERTIES");var c=b.j();var d=false;var f=c.getEnumerator();while(f.moveNext()){var e=f.current();a.k($$t.$fd.newLine());if(d){a.k(",")}a.k(e);d=true}}},k:function(a){if(this.axisIndex()<2){a.k($$t.$fd.newLine());a.k(String.concat("ON ",this.a[this.axisIndex()]))}},$type:new $.ig.Type("MdxAxis",$.ig.$ot,[$$t.$e5.$type])},true);$c("MdxAxisFilterElement:ft","Object",{a:null,b:null,init:function(){$.ig.$op.init.call(this);this.b=new $$t.cr($$t.$e8.$type,0);this.singleFilterElements(new $$t.c3($$t.$e8.$type,1,this.b));this.a=new $$t.fa},mdxExpression:function(){if(this.a.collectionElements().count()>1){this.a.b(["(",")"])}return this.a.mdxExpression()},_singleFilterElements:null,singleFilterElements:function(a){if(arguments.length===1){this._singleFilterElements=a;return a}else{return this._singleFilterElements}},filterCollection:function(){return this.a.collectionElements()},rebuildExpression:function(){this.a.rebuildExpression()},addFilterPart:function(a,b){if(a.collectionElements().count()>0){if(a.collectionElements().count()==1&&b){this.b.add(a.collectionElements().item(0));return}this.a.addElement(a)}},elementType:function(){return 3},$type:new $.ig.Type("MdxAxisFilterElement",$.ig.$ot,[$$t.$fr.$type])},true);$c("MdxCalculatedMembersCache:fx","Object",{init:function(){this.d=new $$t.cr(String,0);this.b=new $$t.c9(String,String,0);$.ig.$op.init.call(this)},d:null,b:null,e:function(a){var b=new $$t.fc(0);var d=a.c().getEnumerator();while(d.moveNext()){var c=d.current();$$t.$fx.f(b,c.key(),c.value())}return b.toString()},g:function(a,b,c){if(!this.d.contains(a)){this.d.add(a)}if(!this.b.containsKey(b)){this.b.add(b,c)}},c:function(){var d__=new $.ig.MdxCalculatedMembersCache___GetMemberAliasExpressionPairs__IteratorClass(-2);d__.__4__this=this;return d__},a:function(a){return this.d.contains(a)},f:function(a,b,c){a.k(String.concat("MEMBER ",b," AS",$$t.$fd.newLine()));a.k(c);a.k($$t.$fd.newLine())},$type:new $.ig.Type("MdxCalculatedMembersCache",$.ig.$ot)},true);$c("MdxElement:fh","Object",{init:function(){$.ig.$op.init.call(this);this.elementType(5)},mdxExpression:function(){},_elementType:0,elementType:function(a){if(arguments.length===1){this._elementType=a;return a}else{return this._elementType}},_sourceItemExpression:null,sourceItemExpression:function(a){if(arguments.length===1){this._sourceItemExpression=a;return a}else{return this._sourceItemExpression}},rebuildExpression:function(){},$type:new $.ig.Type("MdxElement",$.ig.$ot,[$$t.$fi.$type])},true);$c("MdxSingleElement:fg","MdxElement",{init:function(a,b,c,d){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$$t.$fg.init1.call(this,1,b,c,d,0)},init1:function(a,b,c,d,e){$$t.$fh.init.call(this);this.a(d);switch(e){case 0:case 2:this.sourceItemExpression(b);this.b(c);this.elementType(e);break;default:throw new $$t.dq(2,"Element type could be MdxElementType.Member or MdxElementType.Calculated","elementType")}},mdxExpression:function(){return this.sourceItemExpression()},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_a:0,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},$type:new $.ig.Type("MdxSingleElement",$$t.$fh.$type)},true);$c("MdxDimensionMember:fl","MdxSingleElement",{init:function(a,b,c,d,e){$$t.$fg.init.call(this,0,a,b,c);this.d(d);this.c(e)},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},$type:new $.ig.Type("MdxDimensionMember",$$t.$fg.$type)},true);$c("MdxChildrenCollectionElement:fk","MdxDimensionMember",{init:function(a,b,c,d,e){$$t.$fl.init.call(this,a,b,c,d,e)},mdxExpression:function(){return String.concat(this.sourceItemExpression(),".Children")},$type:new $.ig.Type("MdxChildrenCollectionElement",$$t.$fl.$type)},true);$c("MdxElementCollectionElement:fa","Object",{d:null,c:false,e:null,a:null,init:function(){$.ig.$op.init.call(this);this.d=new $$t.cr($$t.$e8.$type,0);this.collectionElements(new $$t.c3($$t.$e8.$type,1,this.d))},b:function(a){if(arguments.length===1){if(this.a!=a){this.c=false;this.a=a}return a}else{return this.a}},_collectionElements:null,collectionElements:function(a){if(arguments.length===1){this._collectionElements=a;return a}else{return this._collectionElements}},elementType:function(){return 4},mdxExpression:function(){if(!this.c){this.e=this.f();this.c=true}return this.e},rebuildExpression:function(){this.e=this.f();this.c=true},addElement:function(a){this.d.add(a);if(this.collectionElements().count()>1){this.b(["{","}"])}this.c=false},f:function(){if(this.collectionElements().count()==0){return String.empty()}var a=new $$t.fc(0);var b=false;var d=this.collectionElements().getEnumerator();while(d.moveNext()){var c=d.current();if(b){a.k(",");a.k($$t.$fd.newLine())}a.k(c.mdxExpression());b=true}if(this.b()!=null&&this.b().length==2){a.w(0,this.b()[0]);a.k(this.b()[1])}return a.toString()},$type:new $.ig.Type("MdxElementCollectionElement",$.ig.$ot,[$$t.$fb.$type])},true);$c("MdxLevelMembersElement:fj","MdxSingleElement",{init:function(a,b,c){$$t.$fg.init.call(this,0,a,b,c)},mdxExpression:function(){return String.concat(this.sourceItemExpression(),".MEMBERS")},$type:new $.ig.Type("MdxLevelMembersElement",$$t.$fg.$type)},true);$c("MdxQueryBuilder:fw","Object",{a:null,init:function(a){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$$t.$fw.init1.call(this,1,new $$t.et)},init1:function(a,b){$.ig.$op.init.call(this);this.b(b)},b:function(a){if(arguments.length===1){this.a=a;return a}else{if(this.a==null){this.a=new $$t.et}return this.a}},c:function(a,b,c,d,e){var f=c;var g=this.d(a,b,f,d);var h=this.h(f);var i=this.g(f,e);var j=new $$t.fc(0);if(!String.isNullOrEmpty(g)){j.k(String.concat("WITH",$$t.$fd.newLine()))}j.k(g);j.k("SELECT");j.k($$t.$fd.newLine());if(a!=null){j.k(a.mdxExpression())}if(b!=null){if(a==null){b.axisIndex(0)}else{j.k(String.concat(",",$$t.$fd.newLine()))}j.k(b.mdxExpression())}j.k($$t.$fd.newLine());j.k(i);if(!String.isNullOrEmpty(h)){j.k($$t.$fd.newLine());j.k(h)}var k=j.toString();return k},d:function(a,b,c,d){return $$t.$fx.e(d)},g:function(a,b){var c=String.concat("FROM ","[",b,"]");var d=$b($$t.$fp.$type,a);c=this.f(c,a.filtersFilter(),null);if(a.columnsFilter()!=null){c=this.f(c,a.columnsFilter(),a.rowsFilter())}else{c=this.f(c,a.rowsFilter(),null)}if(d!=null){c=this.e(c,d)}return c},e:function(a,b){if(b.filterElements()!=null&&b.filterElements().count()>0){var d=b.filterElements().getEnumerator();while(d.moveNext()){var c=d.current();var e=new $$t.fc(0);e.w(0,String.concat(["FROM",$$t.$fd.newLine(),"(",$$t.$fd.newLine(),"SELECT",$$t.$fd.newLine()]));e.k(String.concat(c.mdxExpression()," ON COLUMNS",$$t.$fd.newLine()));e.k(a);e.k(this.h(b));e.k(String.concat(")",$$t.$fd.newLine()));a=e.toString()}}return a},f:function(a,b,c){if(b==null||b.filterCollection().count()==0){return a}var d=new $$t.fc(0);d.k("FROM");d.k($$t.$fd.newLine());d.k("(");d.k($$t.$fd.newLine());d.k("SELECT");d.k($$t.$fd.newLine());d.k(b.mdxExpression());d.k(" ON COLUMNS");if(c!=null&&c.filterCollection().count()>0){d.k($$t.$fd.newLine());d.k(", ");d.k(c.mdxExpression());d.k(" ON ROWS")}d.k($$t.$fd.newLine());d.k(a);d.k($$t.$fd.newLine());d.k(")");return d.toString()},h:function(a){var b=new $$t.fa;if(a.measureFilter()!=null&&a.measureFilter().singleFilterElements().count()==1){b.addElement(a.measureFilter().singleFilterElements().item(0))}if(a.filtersFilter()!=null){var d=a.filtersFilter().singleFilterElements().getEnumerator();while(d.moveNext()){var c=d.current();b.addElement(c)}}if(b.collectionElements().count()==0){return String.empty()}b.b(["(",")"]);return String.concat("WHERE ",b.mdxExpression())},$type:new $.ig.Type("MdxQueryBuilder",$.ig.$ot)},true);$c("MdxSet:ff","Object",{d:null,e:null,b:false,g:null,init:function(a){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$$t.$ff.init1.call(this,1,new $$t.ew);this.d=new $$t.cr($$t.$e8.$type,0);this.e=new $$t.c3($$t.$e8.$type,1,this.d);this.isEnabled(true)},init1:function(a,b){$.ig.$op.init.call(this);this.d=new $$t.cr($$t.$e8.$type,0);this.e=new $$t.c3($$t.$e8.$type,1,this.d);this.isEnabled(true);this.a(b!=null?b:new $$t.ew)},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_isEnabled:false,isEnabled:function(a){if(arguments.length===1){this._isEnabled=a;return a}else{return this._isEnabled}},f:function(){return this.e},mdxExpression:function(){if(!this.b){this.g=this.h();this.b=true}return this.g},rebuildExpression:function(){this.g=this.h();this.b=true},addElement:function(a){if(this.c(a)){this.d.add(a);this.b=false}},getMdxElements:function(){var d__=new $.ig.MdxSet___GetMdxElements__IteratorClass(-2);d__.__4__this=this;return d__},c:function(a){switch(a.elementType()){case 1:case 0:case 2:case 4:return true}return false},h:function(){var a=new $$t.fc(0);var b=this.f().item(0);this.j(a,b);for(var c=1;c<this.f().count();c++){a.w(0,"CrossJoin(");a.w(10,$$t.$fd.newLine());a.k(",");a.k($$t.$fd.newLine());var d=this.f().item(c);this.j(a,d);a.k(")")}return a.toString()},j:function(a,b){var c=new $$t.fc(0);switch(b.elementType()){case 2:var d=b;var e=d.b();c.k("{");c.k(e);c.k("}");break;case 0:c.k("{");c.k(b.mdxExpression());c.k("}");break;case 4:case 1:c.k(b.mdxExpression());break}if($b($$t.$fj.$type,b)!==null||$b($$t.$fk.$type,b)!==null){this.i(c,b)}switch(b.elementType()){case 1:case 0:this.k(c,b);break}a.m(c)},k:function(a,b){},i:function(a,b){if(this.a().a()){a.w(0,"AddCalculatedMembers(");a.k(")")}},clone:function(){var a=new $$t.ff(1,this.a());var c=this.f().getEnumerator();while(c.moveNext()){var b=c.current();a.addElement(b)}return a},$type:new $.ig.Type("MdxSet",$.ig.$ot,[$$t.$e7.$type])},true);$c("MdxSettings:et","Object",{i:false,h:false,e:false,d:false,m:false,l:false,k:false,j:false,o:false,n:false,g:false,f:false,init:function(){$.ig.$op.init.call(this);this.a(new $$t.eu);this.b(new $$t.eu);this.c(new $$t.ex);this.y(true);this.x(true);var a=new $$t.ey(String,0);a.collectionChanged=$.ig.Delegate.prototype.combine(a.collectionChanged,this.ae.runOn(this));
this.ac(a);var b=new $$t.ey(String,0);b.collectionChanged=$.ig.Delegate.prototype.combine(b.collectionChanged,this.ad.runOn(this));this.ab(b);this.s(true);this.r(true);this.q(true);this.p(true);this.ag(this.ac());this.ag(this.ab())},ae:function(a,b){this.b().j().clear();var d=this.ac().getEnumerator();while(d.moveNext()){var c=d.current();this.b().j().add(c)}},ad:function(a,b){this.a().j().clear();var d=this.ab().getEnumerator();while(d.moveNext()){var c=d.current();this.a().j().add(c)}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},aa:function(a){if(arguments.length===1){if(this.i!=a){this.i=a;this.b().i(a)}return a}else{return this.i}},z:function(a){if(arguments.length===1){if(this.h!=a){this.h=a;this.a().i(a)}return a}else{return this.h}},q:function(a){if(arguments.length===1){if(this.e!=a){this.e=a;this.b().d(a)}return a}else{return this.e}},p:function(a){if(arguments.length===1){if(this.d!=a){this.d=a;this.a().d(a)}return a}else{return this.d}},w:function(a){if(arguments.length===1){if(this.m!=a){this.m=a;this.b().g(a)}return a}else{return this.m}},v:function(a){if(arguments.length===1){if(this.l!=a){this.l=a;this.a().g(a)}return a}else{return this.l}},u:function(a){if(arguments.length===1){if(this.k!=a){this.k=a;this.b().f(a)}return a}else{return this.k}},t:function(a){if(arguments.length===1){if(this.j!=a){this.j=a;this.a().f(a)}return a}else{return this.j}},y:function(a){if(arguments.length===1){if(this.o!=a){this.o=a;this.b().h(a)}return a}else{return this.o}},x:function(a){if(arguments.length===1){if(this.n!=a){this.n=a;this.a().h(a)}return a}else{return this.n}},s:function(a){if(arguments.length===1){if(this.g!=a){this.g=a;this.b().e(a)}return a}else{return this.g}},r:function(a){if(arguments.length===1){if(this.f!=a){this.f=a;this.a().e(a)}return a}else{return this.f}},_ac:null,ac:function(a){if(arguments.length===1){this._ac=a;return a}else{return this._ac}},_ab:null,ab:function(a){if(arguments.length===1){this._ab=a;return a}else{return this._ab}},af:function(a){this.ag(a)},ag:function(a){a.clear();a.add("CHILDREN_CARDINALITY");a.add("PARENT_UNIQUE_NAME")},$type:new $.ig.Type("MdxSettings",$.ig.$ot)},true);$c("MdxAxisSettings:ev","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("MdxAxisSettings",$.ig.$ot)},true);$c("MdxSlicerAxisSettings:ex","MdxAxisSettings",{init:function(){$$t.$ev.init.call(this)},$type:new $.ig.Type("MdxSlicerAxisSettings",$$t.$ev.$type)},true);$c("MdxDimensionAxisSettings:eu","MdxAxisSettings",{c:false,b:false,init:function(){$$t.$ev.init.call(this);this.j(new $$t.cr(String,0));this.a(new $$t.ew)},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_g:false,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},_f:false,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},_h:false,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},_e:false,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},i:function(a){if(arguments.length===1){if(this.c!=a){this.c=a;this.a().b(a)}return a}else{return this.c}},d:function(a){if(arguments.length===1){if(this.b!=a){this.b=a;this.a().a(a)}return a}else{return this.b}},_j:null,j:function(a){if(arguments.length===1){this._j=a;return a}else{return this._j}},$type:new $.ig.Type("MdxDimensionAxisSettings",$$t.$ev.$type)},true);$c("MdxSetSettings:ew","Object",{init:function(){$.ig.$op.init.call(this)},_b:false,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_a:false,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},$type:new $.ig.Type("MdxSetSettings",$.ig.$ot)},true);$c("IMdxSlicerAxis:fo","Object",{$type:new $.ig.Type("IMdxSlicerAxis",null,[$$t.$fp.$type])},true);$c("MdxSlicerAxis:fn","MdxAxis",{init:function(a){$$t.$fe.init1.call(this,1,2,a)},_columnsFilter:null,columnsFilter:function(a){if(arguments.length===1){this._columnsFilter=a;return a}else{return this._columnsFilter}},_rowsFilter:null,rowsFilter:function(a){if(arguments.length===1){this._rowsFilter=a;return a}else{return this._rowsFilter}},_filtersFilter:null,filtersFilter:function(a){if(arguments.length===1){this._filtersFilter=a;return a}else{return this._filtersFilter}},_measureFilter:null,measureFilter:function(a){if(arguments.length===1){this._measureFilter=a;return a}else{return this._measureFilter}},_filterElements:null,filterElements:function(a){if(arguments.length===1){this._filterElements=a;return a}else{return this._filterElements}},$type:new $.ig.Type("MdxSlicerAxis",$$t.$fe.$type,[$$t.$fo.$type])},true);$c("MdxSlicerSet:fu","MdxSet",{init:function(){$$t.$ff.init.call(this,0)},c:function(a){return $b($$t.$fr.$type,a)!==null},$type:new $.ig.Type("MdxSlicerSet",$$t.$ff.$type)},true);$c("MdxDimensionAxisProvider:e2","Object",{h:null,i:null,l:0,init:function(a,b,c,d,e){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}this.h=new $$t.c9(String,$$t.$fa.$type,0);this.i=new $$t.cr(String,0);this.l=-1;$.ig.$op.init.call(this);if(b==null){throw new $$t.dj(0,"xmlaDataSource")}this.b(b);this.g(c);this.k(d);this.d(e)},init1:function(a,b,c,d){this.h=new $$t.c9(String,$$t.$fa.$type,0);this.i=new $$t.cr(String,0);this.l=-1;$.ig.$op.init.call(this);this.g(c);this.a(b);this.j(d)},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},c:null,d:function(a){if(arguments.length===1){this.c=a;return a}else{return this.c}},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_k:null,k:function(a){if(arguments.length===1){this._k=a;return a}else{return this._k}},_j:null,j:function(a){if(arguments.length===1){this._j=a;return a}else{return this._j}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},q:function(){this.e(null)},extendAxis:function(a,b){var c=a;var d=this.j();var e=this.a().positionResolver();var f=new $$t.fe(1,a.axisIndex(),this.g());var h=d.getEnumerator();while(h.moveNext()){var g=h.current();var i=new $$t.ff(1,c.b().a());var j=new $$t.cr($$t.$e7.$type,0);var k=e.getHostPositionItemInfo(g.position(),g.position().indexOf(g));var m=g.position().getItems().getEnumerator();while(m.moveNext()){var l=m.current();var n;if(l==g){n=new $$t.fk(l.key(),l.key(),-1,null,null);i.addElement(n);break}n=new $$t.fg(0,l.key(),l.key(),l.depth());i.addElement(n)}var o=$$t.$dd.ae($$t.$c8.$type.specialize(String,$.ig.$op.$type),$$t.$dd.t($$t.$c8.$type.specialize(String,$.ig.$op.$type),k.values(),function(p){return p.key()==g.key()}));if(o!=null){if(o.count()==0){j.add(i)}else{this.p(o,i,j,false,true,false)}var q=j.getEnumerator();while(q.moveNext()){var p=q.current();a.addSet(p);f.addSet(p)}}}return f},t:function(a,b){if(this.l!=0){var c=new $$t.ff(1,this.g().a());if(this.l==-1){b.add(c)}this.s(a,c,b);this.p(a,new $$t.ff(1,this.g().a()),b,true,false,true)}else{this.p(a,new $$t.ff(1,this.g().a()),b,false,false,true)}},s:function(a,b,c){var d=$$t.$dd.y($$t.$c8.$type.specialize(String,$.ig.$op.$type),$$t.$dd.t($$t.$c8.$type.specialize(String,$.ig.$op.$type),a.values(),function(e){return e.positionItemDepth()==a.positionItemDepthMin()}));if(d.count()==0){return}if(this.l==a.positionItemIndex()+1){var f=$$t.$dd.t($$t.$c8.$type.specialize(String,$.ig.$op.$type),a.values(),function(g){return g.positionItemDepth()==0}).getEnumerator();while(f.moveNext()){var e=f.current();var g=b.clone();var h=new $$t.fg(0,e.positionItem().key(),e.positionItem().key(),0);g.addElement(h);c.add(g);this.u(e);if(e.count()==0){this.n(this.k(),e.positionItemIndex()+1,g)}else{this.s(e,g,c)}}}else{var i=d.item(0);var j=new $$t.fj(i.hierarchyLevelKey(),i.hierarchyLevelKey(),a.positionItemDepthMin());b.addElement(j);this.u(i);if(i.count()==0){if(this.l!=-1){c.add(b)}this.n(this.k(),i.positionItemIndex()+1,b)}else{this.s(i,b,c)}}},createAxis:function(a){if(this.e()!=null){return this.e()}if(this.d()==null){this.e(this.createAxis1(a,this.k()));return this.e()}this.r(a);this.u(this.d());if(this.d().count()==0){this.e(this.createAxis1(a,this.k()));return this.e()}var b=new $$t.cr($$t.$e7.$type,0);this.t(this.d(),b);var c=new $$t.fe(1,a,this.g());var e=b.getEnumerator();while(e.moveNext()){var d=e.current();c.addSet(d)}this.e(c);return c},r:function(a){var b=this.b().columnAxis().count()>0;var c=this.b().rowAxis().count()>0;var d=this.b().measures().count()>1;if(d){if(a==0){if(b){if(this.b().measureListLocation()==1){this.l=this.b().measureListIndex()}}else if(c&&this.b().measureListLocation()==0){this.l=this.b().measureListIndex()}}else if(a==1&&c&&this.b().measureListLocation()==0){this.l=this.b().measureListIndex()}}var f=this.b().measures().getEnumerator();while(f.moveNext()){var e=f.current();this.i.add(e.uniqueName())}},u:function(a){if(this.k()!=null){var b=a.positionItemIndex()+1;if(b<this.k().count()){var c=this.k().item(b);var d=$b($$t.$el.$type,c);if(d!=null){var e=$$t.$dd.y($$t.$c8.$type.specialize(String,$.ig.$op.$type),a.values());var g=e.getEnumerator();while(g.moveNext()){var f=g.current();if(!this.i.contains(f.key())){a.remove(f.key())}}}var h=$b($$t.$b9.$type,c);if(h!=null){var i=$$t.$dd.ae($$t.$c8.$type.specialize(String,$.ig.$op.$type),a.values());if(i!=null){if(i.hierarchyKey()!=h.uniqueName()){a.clear()}}}}else{a.clear()}}},createAxis1:function(a,b){var c=new $$t.ff(1,this.g().a());this.n(b,0,c);var d=new $$t.fe(1,a,this.g());d.addSet(c);return d},n:function(a,b,c){var $self=this;if(a==null){return}for(var d=b;d<a.count();d++){var e=a.item(d);var f=$b($$t.$b9.$type,e);if(f!=null){if(f.allMember()==null){var g=$$t.$dd.y($$t.$b3.$type,this.b().getCoreElements(function(h){return h.hierarchyUniqueName()==f.uniqueName()},$$t.$cb.$type));var h=g.item(0);c.addElement(new $$t.fj(h.uniqueName(),h.uniqueName(),0))}else{c.addElement(new $$t.fg(0,f.defaultMember(),f.defaultMember(),0))}continue}var i=$b($$t.$cb.$type,e);if(i!=null){var j;if(!function(){var k=$self.h.tryGetValue(i.hierarchyUniqueName(),j);j=k.p1;return k.ret}()){j=new $$t.fa;c.addElement(j);this.h.add(i.hierarchyUniqueName(),j)}j.addElement(new $$t.fj(i.uniqueName(),i.uniqueName(),i.depth()));continue}var k=$b($$t.$el.$type,e);if(k!=null){var l=new $$t.fa;var n=k.measures().getEnumerator();while(n.moveNext()){var m=n.current();l.addElement(new $$t.fg(0,m.uniqueName(),m.uniqueName(),0))}c.addElement(l)}}},o:function(a,b,c,d,e,f,g){var h=c.clone();h.addElement(new $$t.fg(0,b.key(),b.key(),b.positionItemDepth()));this.u(b);if(b.count()==0){if(e){if(f){d.add(h);this.n(this.k(),b.positionItemIndex()+1,h)}}else{d.add(h);this.n(this.k(),b.positionItemIndex()+1,h)}}else{this.p(b,h,d,e,f,g)}if(g&&b.isExpanded()){this.m(b,d,a,c)}},m:function(a,b,c,d){var e=$$t.$dd.y($$t.$c8.$type.specialize(String,$.ig.$op.$type),$$t.$dd.t($$t.$c8.$type.specialize(String,$.ig.$op.$type),c.values(),function(f){return f.parentKey()==a.key()}));if(e.count()>0){var f=d.clone();f.addElement(new $$t.fk(a.key(),a.key(),a.positionItemDepth(),null,null));this.u(a);if(a.count()==0){b.add(f);this.n(this.k(),a.positionItemIndex()+1,f)}else{this.p(a,f,b,true,true,false)}}var h=e.getEnumerator();while(h.moveNext()){var g=h.current();var i=d.clone();i.addElement(new $$t.fg(0,g.key(),g.key(),g.positionItemDepth()));this.u(g);if(g.isExpanded()){this.m(g,b,c,d)}this.p(g,i,b,true,false,true)}},p:function(a,b,c,d,e,f){var g=$$t.$dd.y($$t.$c8.$type.specialize(String,$.ig.$op.$type),$$t.$dd.t($$t.$c8.$type.specialize(String,$.ig.$op.$type),a.values(),function(h){return h.positionItemDepth()==a.positionItemDepthMin()}));if(g.count()==0){return}var i=g.getEnumerator();while(i.moveNext()){var h=i.current();this.o(a,h,b,c,d,e,f)}},$type:new $.ig.Type("MdxDimensionAxisProvider",$.ig.$ot,[$$t.$e3.$type])},true);$c("MdxSlicerAxisProvider:fm","Object",{c:null,e:null,d:null,init:function(a,b,c,d,e){this.c=new $$t.cr($$t.$ej.$type,0);this.e=new $$t.cr($$t.$ej.$type,0);this.d=new $$t.cr($$t.$ej.$type,0);$.ig.$op.init.call(this);this.a(a);this.b(e);this.c=b;this.e=c;this.d=d},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},createAxis:function(a){var b=new $$t.fn(this.b().c());b.axisIndex(a);b.columnsFilter($$t.$fs.a(this.c,b));b.rowsFilter($$t.$fs.a(this.e,b));b.filtersFilter($$t.$fs.a(this.d,b));b.measureFilter($$t.$fs.b(this.a().measures(),b));return b},$type:new $.ig.Type("MdxSlicerAxisProvider",$.ig.$ot,[$$t.$e4.$type])},true);$c("MdxSlicerAxisBuilder:fs","Object",{init:function(){$.ig.$op.init.call(this)},b:function(a,b){if($$t.$dd.ai($$t.$cc.$type,a)==0){return null}var c=new $$t.ft;var d=new $$t.fa;var f=a.getEnumerator();while(f.moveNext()){var e=f.current();var g=new $$t.fg(0,e.uniqueName(),e.uniqueName(),0);d.addElement(g)}var h=new $$t.fu;h.addElement(c);b.addSet(h);c.addFilterPart(d,true);return c},a:function(a,b){var c=new $$t.ft;for(var d=0;d<a.count();d++){var e=a.item(d);var f=new $$t.fa;var g=new $$t.c9(String,$$t.$fg.$type,0);var i=e.a().getEnumerator();while(i.moveNext()){var h=i.current();var j;if(!function(){var k=g.tryGetValue(h,j);j=k.p1;return k.ret}()){j=new $$t.fg(0,h,h,-1);g.add(h,j)}f.addElement(j)}c.addFilterPart(f,false)}if(c.filterCollection().count()==0&&c.singleFilterElements().count()==0){return null}var k=new $$t.fu;k.addElement(c);b.addSet(k);return c},$type:new $.ig.Type("MdxSlicerAxisBuilder",$.ig.$ot)},true);$c("IXmlaDataProviderFactory:i5","Object",{$type:new $.ig.Type("IXmlaDataProviderFactory",null,[$$t.$ed.$type])},true);$c("DefaultXmlaDataProviderFactory:i6","Object",{b:null,a:null,init:function(a,b){$.ig.$op.init.call(this);this.b=a;this.a=b},createDataProvider:function(){return new $$t.fy(new $$t.i7(new $$t.f5(0,this.b),this.a),null)},$type:new $.ig.Type("DefaultXmlaDataProviderFactory",$.ig.$ot,[$$t.$i5.$type])},true);$c("RemoteXmlaDataProviderFactory:i8","Object",{a:null,b:null,d:null,c:null,init:function(a){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$.ig.$op.init.call(this);this.a=new $$t.i9;this.b=new $$t.jj},init1:function(a,b,c){$.ig.$op.init.call(this);this.a=new $$t.i9;this.b=new $$t.jj;this.d=b;this.c=c},init2:function(a,b,c){$.ig.$op.init.call(this);this.a=b;this.b=c},createDataProvider:function(){return new $$t.j1(this.d,this.c,this.a,this.b)},$type:new $.ig.Type("RemoteXmlaDataProviderFactory",$.ig.$ot,[$$t.$i5.$type])},true);$c("IRemoteRequestSerializer:ja","Object",{$type:new $.ig.Type("IRemoteRequestSerializer",null)},true);$c("IRemoteResponseSerializer:jk","Object",{$type:new $.ig.Type("IRemoteResponseSerializer",null)},true);$c("JsonRemoteRequestSerializer:i9","Object",{a:null,init:function(){$.ig.$op.init.call(this);this.a=new $$t.jd},serializeRequest:function(a){return $$t.$je.b().serialize(a,this.a)},deserializeRequest:function(a){return $$t.$je.b().deserialize(a,this.a)},$type:new $.ig.Type("JsonRemoteRequestSerializer",$.ig.$ot,[$$t.$ja.$type])},true);$c("JsonRemoteResponseSerializer:jj","Object",{a:null,init:function(){$.ig.$op.init.call(this);this.a=new $$t.jd},serializeResponse:function(a,b){switch(b){case 0:return $$t.$jl.c().f($$t.$b2.$type,a,$$t.$jm.b(),this.a);case 1:return $$t.$jl.c().f($$t.$b5.$type,a,$$t.$jn.b(),this.a);case 2:return $$t.$jl.c().f($$t.$b7.$type,a,$$t.$jo.b(),this.a);case 3:return $$t.$jl.c().f($$t.$b9.$type,a,$$t.$jp.b(),this.a);case 4:return $$t.$jl.c().f($$t.$cb.$type,a,$$t.$jq.b(),this.a);case 5:return $$t.$jl.c().f($$t.$cc.$type,a,$$t.$jr.b(),this.a);case 6:return $$t.$jl.c().f($$t.$ce.$type,a,$$t.$js.b(),this.a);case 7:return $$t.$jl.c().f($$t.$cf.$type,a,$$t.$jt.b(),this.a);case 8:return $$t.$jl.c().f($$t.$ch.$type,a,$$t.$ju.b(),this.a);case 9:return $$t.$jl.c().f($$t.$ck.$type,a,$$t.$jv.b(),this.a);case 10:return $$t.$jw.b().serialize(a,this.a);default:throw new $$t.aa(1,"Unknown RemoteXmlaRequestType.")}},deserializeResponse:function(a,b){switch(b){case 0:return $$t.$jl.c().d($$t.$b2.$type,a,$$t.$jm.b(),this.a);case 1:return $$t.$jl.c().d($$t.$b5.$type,a,$$t.$jn.b(),this.a);case 2:return $$t.$jl.c().d($$t.$b7.$type,a,$$t.$jo.b(),this.a);case 3:return $$t.$jl.c().d($$t.$b9.$type,a,$$t.$jp.b(),this.a);case 4:return $$t.$jl.c().d($$t.$cb.$type,a,$$t.$jq.b(),this.a);case 5:return $$t.$jl.c().d($$t.$cc.$type,a,$$t.$jr.b(),this.a);case 6:return $$t.$jl.c().d($$t.$ce.$type,a,$$t.$js.b(),this.a);case 7:return $$t.$jl.c().d($$t.$cf.$type,a,$$t.$jt.b(),this.a);case 8:return $$t.$jl.c().d($$t.$ch.$type,a,$$t.$ju.b(),this.a);case 9:return $$t.$jl.c().d($$t.$ck.$type,a,$$t.$jv.b(),this.a);case 10:return $$t.$jw.b().deserialize(a,this.a);default:throw new $$t.aa(1,"Unknown RemoteXmlaRequestType.")}},$type:new $.ig.Type("JsonRemoteResponseSerializer",$.ig.$ot,[$$t.$jk.$type])},true);$c("ArrayJsonSerializer:jl","Object",{init:function(){$.ig.$op.init.call(this)},c:function(){return $$t.$jl.b},d:function($t,a,b,c){var d=c.a(a);return this.e($t,d,b)},f:function($t,a,b,c){var d=this.a($t,a,b);return c.b(d)},e:function($t,a,b){var c=new $$t.cr($t,0);for(var d=0;d<a.length;d++){var e=a[d];c.add(b.fromJsonObject(e))}return c},a:function($t,a,b){var c=$$t.$dd.a($t,a);var d=new Array(c.length);for(var e=0;e<c.length;e++){d[e]=b.toJsonObject(c[e])}return d},$type:new $.ig.Type("ArrayJsonSerializer",$.ig.$ot)},true);$c("IJsonTypeSerializer$1:jg","Object",{$type:new $.ig.Type("IJsonTypeSerializer$1",null)},true);$c("JsonTypeSeriazlierBase$1:jf","Object",{$t:null,init:function($t){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this)},deserialize:function(a,b){return this.fromJsonObject(b.a(a))},serialize:function(a,b){return b.b(this.toJsonObject(a))},fromJsonObject:function(a){},toJsonObject:function(a){},$type:new $.ig.Type("JsonTypeSeriazlierBase$1",$.ig.$ot,[$$t.$jg.$type.specialize(0)])},true);$c("AxisJsonTypeSeriazlier:jx","JsonTypeSeriazlierBase$1",{init:function(){$$t.$jf.init.call(this,$$t.$cp.$type)},b:function(){return $$t.$jx.a},fromJsonObject:function(a){var b=$$t.$jh.d(a,"n");var c=$$t.$jl.c().e($$t.$dy.$type,$$t.$jh.d(a,"t"),$$t.$jy.b());var d=0;if(c.count()>0){d=c.item(0).members().count()}return function(){var $ret=new $$t.cp(c,d);$ret.name(b);return $ret}()},toJsonObject:function(a){var b=$$t.$jl.c().a($$t.$dy.$type,a.tuples(),$$t.$jy.b());var c=$$t.$jh.c();$$t.$jh.f(c,"n",a.name());$$t.$jh.f(c,"t",b);return c},$type:new $.ig.Type("AxisJsonTypeSeriazlier",$$t.$jf.$type.specialize($$t.$cp.$type))},true);$c("AxisMemberJsonTypeSeriazlier:jz","JsonTypeSeriazlierBase$1",{init:function(){$$t.$jf.init.call(this,$$t.$dz.$type)},b:function(){return $$t.$jz.a},fromJsonObject:function(a){return function(){var $ret=new $$t.dz;$ret.hierarchyUniqueName($$t.$jh.d(a,"hun"));$ret.uniqueName($$t.$jh.d(a,"un"));$ret.levelUniqueName($$t.$jh.d(a,"lun"));$ret.caption($$t.$jh.d(a,"c"));$ret.levelNumber($g($$t.$jh.d(a,"ln")));$ret.displayInfo($g($$t.$jh.d(a,"di")));$ret.properties($$t.$jh.b(a,"p"));return $ret}()},toJsonObject:function(a){var b=$$t.$jh.c();$$t.$jh.f(b,"hun",a.hierarchyUniqueName());$$t.$jh.f(b,"un",a.uniqueName());$$t.$jh.f(b,"lun",a.levelUniqueName());$$t.$jh.f(b,"c",a.caption());$$t.$jh.f(b,"ln",a.levelNumber());$$t.$jh.f(b,"di",a.displayInfo());$$t.$jh.g(b,"p",a.properties());return b},$type:new $.ig.Type("AxisMemberJsonTypeSeriazlier",$$t.$jf.$type.specialize($$t.$dz.$type))},true);$c("CatalogJsonTypeSeriazlier:jm","JsonTypeSeriazlierBase$1",{init:function(){$$t.$jf.init.call(this,$$t.$b2.$type)},b:function(){return $$t.$jm.a},fromJsonObject:function(a){return function(){var $ret=new $$t.b2;$ret.caption($$t.$jh.d(a,"c"));$ret.description($$t.$jh.d(a,"d"));$ret.name($$t.$jh.d(a,"n"));$ret.uniqueName($$t.$jh.d(a,"un"));return $ret}()},toJsonObject:function(a){var b=$$t.$jh.c();$$t.$jh.f(b,"c",a.caption());$$t.$jh.f(b,"d",a.description());$$t.$jh.f(b,"n",a.name());$$t.$jh.f(b,"un",a.uniqueName());return b},$type:new $.ig.Type("CatalogJsonTypeSeriazlier",$$t.$jf.$type.specialize($$t.$b2.$type))},true);$c("CellJsonTypeSeriazlier:j0","JsonTypeSeriazlierBase$1",{init:function(){$$t.$jf.init.call(this,$$t.$d0.$type)},b:function(){return $$t.$j0.a},fromJsonObject:function(a){return function(){var $ret=new $$t.d0;$ret.cellOrdinal($g($$t.$jh.d(a,"co")));$ret.properties($$t.$jh.a(a,"p"));return $ret}()},toJsonObject:function(a){var b=$$t.$jh.c();$$t.$jh.f(b,"co",a.cellOrdinal());$$t.$jh.e(b,"p",a.properties());return b},$type:new $.ig.Type("CellJsonTypeSeriazlier",$$t.$jf.$type.specialize($$t.$d0.$type))},true);$c("CubeJsonTypeSeriazlier:jn","JsonTypeSeriazlierBase$1",{init:function(){$$t.$jf.init.call(this,$$t.$b5.$type)},b:function(){return $$t.$jn.a},fromJsonObject:function(a){return function(){var $ret=new $$t.b5;$ret.caption($$t.$jh.d(a,"c"));$ret.description($$t.$jh.d(a,"d"));$ret.name($$t.$jh.d(a,"n"));$ret.catalogName($$t.$jh.d(a,"cn"));$ret.cubeType($f($$t.$jh.d(a,"ct")));$ret.lastProcessed($$t.$jh.d(a,"lp"));$ret.lastUpdated($$t.$jh.d(a,"lu"));return $ret}()},toJsonObject:function(a){var b=$$t.$jh.c();$$t.$jh.f(b,"c",a.caption());$$t.$jh.f(b,"d",a.description());$$t.$jh.f(b,"n",a.name());$$t.$jh.f(b,"cn",a.catalogName());$$t.$jh.f(b,"ct",$$t.$b6.getBox(a.cubeType()));$$t.$jh.f(b,"lp",a.lastProcessed());$$t.$jh.f(b,"lu",a.lastUpdated());return b},$type:new $.ig.Type("CubeJsonTypeSeriazlier",$$t.$jf.$type.specialize($$t.$b5.$type))},true);$c("DimensionJsonTypeSeriazlier:jo","JsonTypeSeriazlierBase$1",{init:function(){$$t.$jf.init.call(this,$$t.$b7.$type)},b:function(){return $$t.$jo.a},fromJsonObject:function(a){return function(){var $ret=new $$t.b7;$ret.caption($$t.$jh.d(a,"c"));$ret.description($$t.$jh.d(a,"d"));$ret.name($$t.$jh.d(a,"n"));$ret.uniqueName($$t.$jh.d(a,"un"));$ret.dimensionType($f($$t.$jh.d(a,"dt")));return $ret}()},toJsonObject:function(a){var b=$$t.$jh.c();$$t.$jh.f(b,"c",a.caption());$$t.$jh.f(b,"d",a.description());$$t.$jh.f(b,"n",a.name());$$t.$jh.f(b,"un",a.uniqueName());$$t.$jh.f(b,"dt",$$t.$b8.getBox(a.dimensionType()));return b},$type:new $.ig.Type("DimensionJsonTypeSeriazlier",$$t.$jf.$type.specialize($$t.$b7.$type))},true);$c("HierarchyJsonTypeSeriazlier:jp","JsonTypeSeriazlierBase$1",{init:function(){$$t.$jf.init.call(this,$$t.$b9.$type)},b:function(){return $$t.$jp.a},fromJsonObject:function(a){return function(){var $ret=new $$t.b9;$ret.caption($$t.$jh.d(a,"c"));$ret.description($$t.$jh.d(a,"d"));$ret.name($$t.$jh.d(a,"n"));$ret.uniqueName($$t.$jh.d(a,"un"));$ret.allMember($$t.$jh.d(a,"am"));$ret.defaultMember($$t.$jh.d(a,"dm"));$ret.dimensionUniqueName($$t.$jh.d(a,"dun"));$ret.hierarchyDisplayFolder($$t.$jh.d(a,"hdf"));$ret.hierarchyOrigin($f($$t.$jh.d(a,"ho")));return $ret}()},toJsonObject:function(a){var b=$$t.$jh.c();$$t.$jh.f(b,"c",a.caption());$$t.$jh.f(b,"d",a.description());$$t.$jh.f(b,"n",a.name());$$t.$jh.f(b,"un",a.uniqueName());$$t.$jh.f(b,"am",a.allMember());$$t.$jh.f(b,"dm",a.defaultMember());$$t.$jh.f(b,"dun",a.dimensionUniqueName());$$t.$jh.f(b,"hdf",a.hierarchyDisplayFolder());$$t.$jh.f(b,"ho",$$t.$ca.getBox(a.hierarchyOrigin()));return b},$type:new $.ig.Type("HierarchyJsonTypeSeriazlier",$$t.$jf.$type.specialize($$t.$b9.$type))},true);$c("JsonSerializerUtils:jh","Object",{init:function(){$.ig.$op.init.call(this)},c:function(){return $$t.$ji.createJavascriptObject()},d:function(a,b){return $$t.$ji.getJavascriptObjectProperty(a,b)},f:function(a,b,c){$$t.$ji.setJavascriptObjectProperty(a,b,c)},a:function(a,b){return $$t.$ji.convertToObjectDictionary($$t.$ji.getJavascriptObjectProperty(a,b))},e:function(a,b,c){var d=$$t.$ji.convertFromObjectDictionary(c);$$t.$ji.setJavascriptObjectProperty(a,b,d)},b:function(a,b){return $$t.$ji.convertToStringDictionary($$t.$ji.getJavascriptObjectProperty(a,b))},g:function(a,b,c){var d=$$t.$ji.convertFromStringDictionary(c);$$t.$ji.setJavascriptObjectProperty(a,b,d)},$type:new $.ig.Type("JsonSerializerUtils",$.ig.$ot)},true);$c("KpiJsonTypeSeriazlier:jv","JsonTypeSeriazlierBase$1",{init:function(){$$t.$jf.init.call(this,$$t.$ck.$type)},b:function(){return $$t.$jv.a},fromJsonObject:function(a){return function(){var $ret=new $$t.ck;$ret.caption($$t.$jh.d(a,"c"));$ret.description($$t.$jh.d(a,"d"));$ret.name($$t.$jh.d(a,"n"));$ret.uniqueName($$t.$jh.d(a,"un"));$ret.kpiDisplayFolder($$t.$jh.d(a,"kdf"));$ret.measureGroupName($$t.$jh.d(a,"mgn"));$ret.kpiStatusGraphic($$t.$jh.d(a,"ksg"));$ret.kpiTrendGraphic($$t.$jh.d(a,"ktg"));$ret.parentKpiName($$t.$jh.d(a,"pkn"));$ret.kpiGoal($$t.$jh.d(a,"kg"));$ret.kpiStatus($$t.$jh.d(a,"ks"));$ret.kpiTrend($$t.$jh.d(a,"kt"));$ret.kpiValue($$t.$jh.d(a,"kv"));$ret.kpiWeight($$t.$jh.d(a,"kw"));return $ret}()},toJsonObject:function(a){var b=$$t.$jh.c();$$t.$jh.f(b,"c",a.caption());$$t.$jh.f(b,"d",a.description());$$t.$jh.f(b,"n",a.name());$$t.$jh.f(b,"un",a.uniqueName());$$t.$jh.f(b,"kdf",a.kpiDisplayFolder());$$t.$jh.f(b,"mgn",a.measureGroupName());$$t.$jh.f(b,"ksg",a.kpiStatusGraphic());$$t.$jh.f(b,"ktg",a.kpiTrendGraphic());$$t.$jh.f(b,"pkn",a.parentKpiName());$$t.$jh.f(b,"kg",a.kpiGoal());$$t.$jh.f(b,"ks",a.kpiStatus());$$t.$jh.f(b,"kt",a.kpiTrend());$$t.$jh.f(b,"kv",a.kpiValue());$$t.$jh.f(b,"kw",a.kpiWeight());return b},$type:new $.ig.Type("KpiJsonTypeSeriazlier",$$t.$jf.$type.specialize($$t.$ck.$type))},true);$c("LevelJsonTypeSeriazlier:jq","JsonTypeSeriazlierBase$1",{init:function(){$$t.$jf.init.call(this,$$t.$cb.$type)},b:function(){return $$t.$jq.a},fromJsonObject:function(a){return function(){var $ret=new $$t.cb;$ret.caption($$t.$jh.d(a,"c"));$ret.description($$t.$jh.d(a,"d"));$ret.name($$t.$jh.d(a,"n"));$ret.uniqueName($$t.$jh.d(a,"un"));$ret.depth($g($$t.$jh.d(a,"d")));$ret.dimensionUniqueName($$t.$jh.d(a,"dun"));$ret.hierarchyUniqueName($$t.$jh.d(a,"hun"));$ret.levelOrderingProperty($$t.$jh.d(a,"lop"));$ret.levelOrigin($g($$t.$jh.d(a,"lo")));$ret.membersCount($g($$t.$jh.d(a,"mc")));return $ret}()},toJsonObject:function(a){var b=$$t.$jh.c();$$t.$jh.f(b,"c",a.caption());$$t.$jh.f(b,"d",a.description());$$t.$jh.f(b,"n",a.name());$$t.$jh.f(b,"un",a.uniqueName());$$t.$jh.f(b,"d",a.depth());$$t.$jh.f(b,"dun",a.dimensionUniqueName());$$t.$jh.f(b,"hun",a.hierarchyUniqueName());$$t.$jh.f(b,"lop",a.levelOrderingProperty());$$t.$jh.f(b,"lo",a.levelOrigin());$$t.$jh.f(b,"mc",a.membersCount());return b},$type:new $.ig.Type("LevelJsonTypeSeriazlier",$$t.$jf.$type.specialize($$t.$cb.$type))},true);$c("MeasureGroupDimensionJsonTypeSeriazlier:jt","JsonTypeSeriazlierBase$1",{init:function(){$$t.$jf.init.call(this,$$t.$cf.$type)},b:function(){return $$t.$jt.a},fromJsonObject:function(a){return function(){var $ret=new $$t.cf;$ret.catalogName($$t.$jh.d(a,"cn"));$ret.cubeName($$t.$jh.d(a,"cbn"));$ret.dimensionCardinality($f($$t.$jh.d(a,"dc")));$ret.dimensionGranularity($$t.$jh.d(a,"dg"));$ret.dimensionPath($$t.$jh.d(a,"dap"));$ret.dimensionUniqueName($$t.$jh.d(a,"dun"));$ret.isDimensionVisible($$t.$jh.d(a,"idv"));$ret.isFactDimension($$t.$jh.d(a,"iafd"));$ret.measureGroupCardinality($f($$t.$jh.d(a,"mgc")));$ret.measureGroupName($$t.$jh.d(a,"mgn"));return $ret}()},toJsonObject:function(a){var b=$$t.$jh.c();$$t.$jh.f(b,"cn",a.catalogName());$$t.$jh.f(b,"cbn",a.cubeName());$$t.$jh.f(b,"dc",$$t.$cg.getBox(a.dimensionCardinality()));$$t.$jh.f(b,"dg",a.dimensionGranularity());$$t.$jh.f(b,"dap",a.dimensionPath());$$t.$jh.f(b,"dun",a.dimensionUniqueName());$$t.$jh.f(b,"idv",a.isDimensionVisible());$$t.$jh.f(b,"iafd",a.isFactDimension());$$t.$jh.f(b,"mgc",$$t.$cg.getBox(a.measureGroupCardinality()));$$t.$jh.f(b,"mgn",a.measureGroupName());return b},$type:new $.ig.Type("MeasureGroupDimensionJsonTypeSeriazlier",$$t.$jf.$type.specialize($$t.$cf.$type))},true);$c("MeasureGroupJsonTypeSeriazlier:js","JsonTypeSeriazlierBase$1",{init:function(){$$t.$jf.init.call(this,$$t.$ce.$type)},b:function(){return $$t.$js.a},fromJsonObject:function(a){return function(){var $ret=new $$t.ce;$ret.caption($$t.$jh.d(a,"c"));$ret.description($$t.$jh.d(a,"d"));$ret.name($$t.$jh.d(a,"n"));$ret.catalogName($$t.$jh.d(a,"cn"));$ret.cubeName($$t.$jh.d(a,"cbn"));return $ret}()},toJsonObject:function(a){var b=$$t.$jh.c();$$t.$jh.f(b,"c",a.caption());$$t.$jh.f(b,"d",a.description());$$t.$jh.f(b,"n",a.name());$$t.$jh.f(b,"cn",a.catalogName());$$t.$jh.f(b,"cbn",a.cubeName());return b},$type:new $.ig.Type("MeasureGroupJsonTypeSeriazlier",$$t.$jf.$type.specialize($$t.$ce.$type))},true);$c("MeasureJsonTypeSeriazlier:jr","JsonTypeSeriazlierBase$1",{init:function(){$$t.$jf.init.call(this,$$t.$cc.$type)},b:function(){return $$t.$jr.a},fromJsonObject:function(a){return function(){var $ret=new $$t.cc;$ret.caption($$t.$jh.d(a,"c"));$ret.description($$t.$jh.d(a,"d"));$ret.name($$t.$jh.d(a,"n"));$ret.uniqueName($$t.$jh.d(a,"un"));$ret.aggregatorType($f($$t.$jh.d(a,"at")));$ret.defaultFormatString($$t.$jh.d(a,"dfs"));$ret.measureDisplayFolder($$t.$jh.d(a,"mdf"));$ret.measureGroupName($$t.$jh.d(a,"mgn"));return $ret}()},toJsonObject:function(a){var b=$$t.$jh.c();$$t.$jh.f(b,"c",a.caption());$$t.$jh.f(b,"d",a.description());$$t.$jh.f(b,"n",a.name());$$t.$jh.f(b,"un",a.uniqueName());$$t.$jh.f(b,"at",$$t.$cd.getBox(a.aggregatorType()));$$t.$jh.f(b,"dfs",a.defaultFormatString());$$t.$jh.f(b,"mdf",a.measureDisplayFolder());$$t.$jh.f(b,"mgn",a.measureGroupName());return b},$type:new $.ig.Type("MeasureJsonTypeSeriazlier",$$t.$jf.$type.specialize($$t.$cc.$type))},true);$c("MemberJsonTypeSeriazlier:ju","JsonTypeSeriazlierBase$1",{init:function(){$$t.$jf.init.call(this,$$t.$ch.$type)},b:function(){return $$t.$ju.a},fromJsonObject:function(a){var b=$l($.ig.Number.prototype.$type,null);var c=$$t.$jh.d(a,"s");return function(){var $ret=new $$t.ch;$ret.caption($$t.$jh.d(a,"c"));$ret.description($$t.$jh.d(a,"d"));$ret.name($$t.$jh.d(a,"n"));$ret.uniqueName($$t.$jh.d(a,"un"));$ret.catalogName($$t.$jh.d(a,"cn"));$ret.childrenCardinality($g($$t.$jh.d(a,"cc")));$ret.cubeName($$t.$jh.d(a,"cbn"));$ret.dimensionUniqueName($$t.$jh.d(a,"dun"));$ret.hierarchyUniqueName($$t.$jh.d(a,"hun"));$ret.levelDepth($g($$t.$jh.d(a,"ld")));$ret.levelUniqueName($$t.$jh.d(a,"lun"));$ret.memberType($f($$t.$jh.d(a,"mt")));$ret.parentLevel($g($$t.$jh.d(a,"pl")));$ret.parentUniqueName($$t.$jh.d(a,"pun"));$ret.scope(c==null?b:$l($.ig.Number.prototype.$type,$.ig.Number.prototype.parseInt(c)));return $ret}()},toJsonObject:function(a){var b=$$t.$jh.c();$$t.$jh.f(b,"c",a.caption());$$t.$jh.f(b,"d",a.description());$$t.$jh.f(b,"n",a.name());$$t.$jh.f(b,"un",a.uniqueName());$$t.$jh.f(b,"cn",a.catalogName());$$t.$jh.f(b,"cc",a.childrenCardinality());$$t.$jh.f(b,"cbn",a.cubeName());$$t.$jh.f(b,"dun",a.dimensionUniqueName());$$t.$jh.f(b,"hun",a.hierarchyUniqueName());$$t.$jh.f(b,"ld",a.levelDepth());$$t.$jh.f(b,"lun",a.levelUniqueName());$$t.$jh.f(b,"mt",$$t.$ci.getBox(a.memberType()));$$t.$jh.f(b,"pl",a.parentLevel());$$t.$jh.f(b,"pun",a.parentUniqueName());$$t.$jh.f(b,"s",$r(a.scope()));return b},$type:new $.ig.Type("MemberJsonTypeSeriazlier",$$t.$jf.$type.specialize($$t.$ch.$type))},true);$c("RemoteRequest:jb","Object",{init:function(){$.ig.$op.init.call(this)},_a:0,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},$type:new $.ig.Type("RemoteRequest",$.ig.$ot)},true);$c("RemoteRequestJsonTypeSeriazlier:je","JsonTypeSeriazlierBase$1",{init:function(){$$t.$jf.init.call(this,$$t.$jb.$type)},b:function(){return $$t.$je.a},fromJsonObject:function(a){var b=new $$t.jb;b.a($f($b($$t.$c9.$type.specialize(String,$.ig.$op.$type),$$t.$jh.d(a,"t")).item("_v")));
b.c($$t.$jh.b(a,"p"));b.d($$t.$jh.b(a,"r"));b.b($$t.$jh.b(a,"par"));b.e($$t.$jh.d(a,"s")!=null?$$t.$jh.d(a,"s"):null);return b},toJsonObject:function(a){var b=$$t.$jh.c();$$t.$jh.f(b,"t",$$t.$jc.getBox(a.a()));$$t.$jh.g(b,"p",a.c());$$t.$jh.g(b,"r",a.d());$$t.$jh.g(b,"par",a.b());$$t.$jh.f(b,"s",a.e());return b},$type:new $.ig.Type("RemoteRequestJsonTypeSeriazlier",$$t.$jf.$type.specialize($$t.$jb.$type))},true);$c("ResultJsonTypeSeriazlier:jw","JsonTypeSeriazlierBase$1",{init:function(){$$t.$jf.init.call(this,$$t.$cm.$type)},b:function(){return $$t.$jw.a},fromJsonObject:function(a){var b=$$t.$jh.d(a,"ie");if(b){return function(){var $ret=new $$t.cm;$ret.isEmpty(true);return $ret}()}else{var c=$$t.$jl.c().e($$t.$cp.$type,$$t.$jh.d(a,"a"),$$t.$jx.b());var d=$$t.$jl.c().e($$t.$d0.$type,$$t.$jh.d(a,"c"),$$t.$j0.b());return function(){var $ret=new $$t.cm;$ret.axes(c);$ret.cells(d);return $ret}()}},toJsonObject:function(a){var b=$$t.$jh.c();$$t.$jh.f(b,"ie",a.isEmpty());if(!a.isEmpty()){var c=$$t.$jl.c().a($$t.$cp.$type,a.axes(),$$t.$jx.b());var d=$$t.$jl.c().a($$t.$d0.$type,a.cells(),$$t.$j0.b());$$t.$jh.f(b,"a",c);$$t.$jh.f(b,"c",d)}return b},$type:new $.ig.Type("ResultJsonTypeSeriazlier",$$t.$jf.$type.specialize($$t.$cm.$type))},true);$c("TupleJsonTypeSeriazlier:jy","JsonTypeSeriazlierBase$1",{init:function(){$$t.$jf.init.call(this,$$t.$dy.$type)},b:function(){return $$t.$jy.a},fromJsonObject:function(a){var b=$$t.$jl.c().e($$t.$dz.$type,$$t.$jh.d(a,"m"),$$t.$jz.b());var c=new $$t.dy(b);var e=b.getEnumerator();while(e.moveNext()){var d=e.current();d.position(c)}return c},toJsonObject:function(a){var b=$$t.$jl.c().a($$t.$dz.$type,a.members(),$$t.$jz.b());var c=$$t.$jh.c();$$t.$jh.f(c,"m",b);return c},$type:new $.ig.Type("TupleJsonTypeSeriazlier",$$t.$jf.$type.specialize($$t.$dy.$type))},true);$c("RemoteXmlaDataProvder:j1","Object",{e:null,d:null,a:null,b:null,init:function(a,b,c,d){$.ig.$op.init.call(this);this.e=a;this.d=b;this.a=c;this.b=d},discoverCatalogsAsync:function(a,b){var c=this.b;return this.f(0,a,b,null,null).j($$t.$aq.$type.specialize($$t.$b2.$type),function(d){return c.deserializeResponse(d.m(),0)})},discoverCubesAsync:function(a,b){var c=this.b;return this.f(1,a,b,null,null).j($$t.$aq.$type.specialize($$t.$b5.$type),function(d){return c.deserializeResponse(d.m(),1)})},discoverDimensionsAsync:function(a,b){var c=this.b;return this.f(2,a,b,null,null).j($$t.$aq.$type.specialize($$t.$b7.$type),function(d){return c.deserializeResponse(d.m(),2)})},discoverHierarchiesAsync:function(a,b){var c=this.b;return this.f(3,a,b,null,null).j($$t.$aq.$type.specialize($$t.$b9.$type),function(d){return c.deserializeResponse(d.m(),3)})},discoverLevelsAsync:function(a,b){var c=this.b;return this.f(4,a,b,null,null).j($$t.$aq.$type.specialize($$t.$cb.$type),function(d){return c.deserializeResponse(d.m(),4)})},discoverMeasuresAsync:function(a,b){var c=this.b;return this.f(5,a,b,null,null).j($$t.$aq.$type.specialize($$t.$cc.$type),function(d){return c.deserializeResponse(d.m(),5)})},discoverMeasureGroupsAsync:function(a,b){var c=this.b;return this.f(6,a,b,null,null).j($$t.$aq.$type.specialize($$t.$ce.$type),function(d){return c.deserializeResponse(d.m(),6)})},discoverMeasureGroupDimensionsAsync:function(a,b){var c=this.b;return this.f(7,a,b,null,null).j($$t.$aq.$type.specialize($$t.$cf.$type),function(d){return c.deserializeResponse(d.m(),7)})},discoverMembersAsync:function(a,b){var c=this.b;return this.f(8,a,b,null,null).j($$t.$aq.$type.specialize($$t.$ch.$type),function(d){return c.deserializeResponse(d.m(),8)})},discoverKpisAsync:function(a,b){var c=this.b;return this.f(9,a,b,null,null).j($$t.$aq.$type.specialize($$t.$ck.$type),function(d){return c.deserializeResponse(d.m(),9)})},executeStatementAsync:function(a,b,c){var d=this.b;return this.f(10,b,null,c,a).j($$t.$cm.$type,function(e){return d.deserializeResponse(e.m(),10)})},f:function(a,b,c,d,e){var $self=this;var f=function(){var $ret=new $$t.gd;$ret.a($self.d);return $ret}();var g=this.a.serializeRequest(function(){var $ret=new $$t.jb;$ret.a(a);$ret.c($self.c(b));$ret.d($self.c(c));$ret.b($self.c(d));$ret.e(e);return $ret}());var h=new $$t.bj(String,0);f.uploadStringCompleted=$.ig.Delegate.prototype.combine(f.uploadStringCompleted,this.g.runOn(this));f.h(new $$t.f5(0,this.e),"POST",g,h);return h.b()},g:function(a,b){var c=b.userState();if(b.cancelled()){c.c()}else if(b.error()!=null){c.d(b.error())}else{c.e(b.result())}},c:function(a){if(a==null){return null}var b=new $$t.c9(String,String,0);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b.add(c.a(),c.b())}return b},$type:new $.ig.Type("RemoteXmlaDataProvder",$.ig.$ot,[$$t.$a.$type])},true);$c("XmlaConnection:i7","Object",{b:null,a:null,init:function(a,b){$.ig.$op.init.call(this);this.b=a;this.a=b},getXmlaSoapWebClient$1:function($t){var a=new $$t.f1($t,this.b,$$t.$f7.uTF8());a.e(this.a);return a},$type:new $.ig.Type("XmlaConnection",$.ig.$ot,[$$t.$fz.$type])},true);$c("XmlaDataSourceImpl:j2","MdxDataSourceImpl",{init:function(a){$$t.$d1.init.call(this,a);this.xmlaSourceOptions(a)},_xmlaSourceOptions:null,xmlaSourceOptions:function(a){if(arguments.length===1){this._xmlaSourceOptions=a;return a}else{return this._xmlaSourceOptions}},al:function(a){var $self=this;var b=this.dataProviderFactory().createDataProvider();var c=this.getProviderDefaultRestrictions();this.bk(c,"CATALOG_NAME",a);var d=this.getProviderDefaultProperties();this.bk(d,"Catalog",a);var e=b.discoverCubesAsync(d,c).j($$t.$cn.$type.specialize($$t.$b5.$type),function(f){$self.cubes($self.a2($$t.$b5.$type,f.m()));return $self.cubes()});return e},an:function(){var $self=this;var a=this.catalog().name();var b=this.cube().name();var c=this.dataProviderFactory().createDataProvider();var d=this.getProviderDefaultRestrictions();this.bk(d,"CATALOG_NAME",a);this.bk(d,"CUBE_NAME",b);var e=this.getProviderDefaultProperties();this.bk(e,"Catalog",a);var f=c.discoverMeasureGroupsAsync(e,d).j($$t.$cn.$type.specialize($$t.$ce.$type),function(g){$self.measureGroups($self.a2($$t.$ce.$type,g.m()));return $self.measureGroups()});return f},h:function(){return new $$t.i6(this.xmlaSourceOptions().serverUrl(),this.xmlaSourceOptions().requestOptions())},getProviderDefaultProperties:function(){var a=new $$t.cr($$t.$b4.$type,0);if(this.mdxSourceOptions().discoverProperties()!=null){var c=this.mdxSourceOptions().discoverProperties().getEnumerator();while(c.moveNext()){var b=c.current();var d=new $$t.g2(1,b.key(),b.value());a.add(function(){var $ret=new $$t.b4;$ret.a(d.a());$ret.b(d.c());return $ret}())}}if(this.catalog()!=null){this.bk(a,"Catalog",this.catalog().name())}return a},$type:new $.ig.Type("XmlaDataSourceImpl",$$t.$d1.$type)},true);$c("XmlaDiscoverProperties:j5","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("XmlaDiscoverProperties",$.ig.$ot)},true);$c("XmlaDataSourceOptions:j3","MdxDataSourceOptions",{init:function(){$$t.$es.init.call(this)},_serverUrl:null,serverUrl:function(a){if(arguments.length===1){this._serverUrl=a;return a}else{return this._serverUrl}},_requestOptions:null,requestOptions:function(a){if(arguments.length===1){this._requestOptions=a;return a}else{return this._requestOptions}},$type:new $.ig.Type("XmlaDataSourceOptions",$$t.$es.$type)},true);$c("RequestOptions:j4","NetworkCredential",{init:function(a,b,c){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$$t.$j4.init1.call(this,1,b,c,String.empty())},init1:function(a,b,c,d){$$t.$f4.init1.call(this,1,b,c,d)},$type:new $.ig.Type("RequestOptions",$$t.$f4.$type)},true);$c("CustomRemoteXmlaRequestSerializer:j7","Object",{a:null,init:function(a){$.ig.$op.init.call(this);this.a=a},serializeRequest:function(a){return this.a(a)},deserializeRequest:function(a){throw new $$t.z(1)},$type:new $.ig.Type("CustomRemoteXmlaRequestSerializer",$.ig.$ot,[$$t.$ja.$type])},true);$c("CustomRemoteXmlaResponseSerializer:j8","Object",{a:null,init:function(a){$.ig.$op.init.call(this);this.a=a},serializeResponse:function(a,b){throw new $$t.z(1)},deserializeResponse:function(a,b){return this.a(a,b)},$type:new $.ig.Type("CustomRemoteXmlaResponseSerializer",$.ig.$ot,[$$t.$jk.$type])},true);$c("OlapXmlaDataSource:j9","DataSourceBase",{staticInit:function(){$$t.$j9.a5()},init:function(a){$$t.$ka.init.call(this);var b=$$t.$ji.getJavascriptObjectProperty(a,"serverUrl");var c=$$t.$ji.getJavascriptObjectProperty(a,"catalog");var d=$$t.$ji.getJavascriptObjectProperty(a,"cube");var e=$$t.$ji.getJavascriptObjectProperty(a,"measures");var f=$$t.$ji.getJavascriptObjectProperty(a,"measureGroup");var g=$$t.$ji.getJavascriptObjectProperty(a,"filters");var h=$$t.$ji.getJavascriptObjectProperty(a,"columns");var i=$$t.$ji.getJavascriptObjectProperty(a,"rows");var j=$$t.$ji.getJavascriptObjectProperty(a,"requestOptions");var k=$$t.$ji.getJavascriptObjectProperty(a,"enableResultCache");var l=true;if(k!=null){l=k}var m=$$t.$ji.convertToStringDictionary($$t.$ji.getJavascriptObjectProperty(a,"discoverProperties"));var n=$$t.$ji.convertToStringDictionary($$t.$ji.getJavascriptObjectProperty(a,"executeProperties"));var o=$$t.$ji.getJavascriptObjectProperty(a,"isRemote");if(o){if(j==null){j={}}var ro_=j;ro_.isCrossDomain=false}var p=$$t.$ji.getJavascriptObjectProperty(a,"serializeRequest");var q=$$t.$ji.getJavascriptObjectProperty(a,"deserializeResponse");var r=this.a0(a);var s=function(){var $ret=new $$t.j3;$ret.serverUrl(b);$ret.requestOptions(j);$ret.catalog(c);$ret.cube(d);$ret.measures(e);$ret.measureGroup(f);$ret.filters(g);$ret.columns(h);$ret.rows(i);$ret.discoverProperties(m);$ret.executeProperties(n);$ret.enableResultCache(l);$ret.mdxSettings(r);return $ret}();if(o){var t=null;var u=null;if(p!=null){t=new $$t.j7(p)}if(q!=null){u=new $$t.j8(q)}var v=new $$t.i8(1,b,j);s.dataProviderFactory(v)}this.dataSource(new $$t.j2(s))},catalogs:function(){return this.dataSource().catalogs().inner()},catalog:function(){return this.dataSource().catalog()},setCatalog:function(a){return this.dataSource().setCatalog(a).j(Array,function(b){return b.m().inner()}).c()},measureGroups:function(){return this.dataSource().measureGroups().inner()},measureGroup:function(){return this.dataSource().measureGroup()},setMeasureGroup:function(a){return this.dataSource().setMeasureGroup(a).j($$t.$d4.$type,function(b){return b.m()}).c()},a0:function(a){var b=new $$t.et;var c=$$t.$ji.getJavascriptObjectProperty(a,"mdxSettings");if(c==null){return b}var d=$$t.$ji.getJavascriptObjectProperty(c,"nonEmptyOnRows");if(d!=null){b.y(d)}var e=$$t.$ji.getJavascriptObjectProperty(c,"nonEmptyOnColumns");if(e!=null){b.x(e)}var f=$$t.$ji.getJavascriptObjectProperty(c,"addCalculatedMembersOnRows");if(f!=null){b.q(f)}var g=$$t.$ji.getJavascriptObjectProperty(c,"addCalculatedMembersOnColumns");if(g!=null){b.p(g)}var h=$$t.$ji.getJavascriptObjectProperty(c,"dimensionPropertiesOnRows");if(h!=null){for(var i=0;i<h.count();i++){b.ac().add(h.item(i))}}var j=$$t.$ji.getJavascriptObjectProperty(c,"dimensionPropertiesOnColumns");if(j!=null){for(var k=0;k<j.count();k++){b.ab().add(j.item(k))}}return b},a5:function(){$.ig.StringBuilder.prototype.toString=function(){return this._internal.join("")};$.ig.XObject.prototype.toString=function(){if(this.backingNode()!=null){return $.ig.XmlUtils.prototype.xmlNodeToString(this.backingNode())}else{return""}}},$type:new $.ig.Type("OlapXmlaDataSource",$$t.$ka.$type)},true);$c("MdxAxis___GetMdxSets__IteratorClass:MdxAxis___GetMdxSets__IteratorClass","Object",{d:0,a:null,c:null,__4__this:null,init:function(a){$.ig.$op.init.call(this);this.d=a},moveNext:function(){while(this.d>=0){switch(this.d){case 0:this.d=-1;this.c=this.__4__this.f.getEnumerator();this.d=1;break;case 1:this.d=-1;if(this.c.moveNext()){this.a=this.c.current();this.d=1;return true}break}}return false},getEnumerator:function(){var d__;if(this.d==-2){this.d=0;d__=this}else{d__=new $.ig.MdxAxis___GetMdxSets__IteratorClass(0);d__.__4__this=this.__4__this}return d__},reset:function(){throw new $$t.z(1)},dispose:function(){},current:function(){return this.a},current1:function(){return this.a},$type:new $.ig.Type("MdxAxis___GetMdxSets__IteratorClass",$.ig.$ot,[$$t.$aq.$type.specialize($$t.$e7.$type),$.ig.IEnumerable.prototype.$type,$$t.$ar.$type.specialize($$t.$e7.$type),$.ig.IEnumerator.prototype.$type,$$t.$as.$type])},true);$c("MdxCalculatedMembersCache___GetMemberAliasExpressionPairs__IteratorClass:MdxCalculatedMembersCache___GetMemberAliasExpressionPairs__IteratorClass","Object",{d:0,c:null,b:null,__4__this:null,init:function(a){this.c=new $$t.dc(String,String);$.ig.$op.init.call(this);this.d=a},moveNext:function(){while(this.d>=0){switch(this.d){case 0:this.d=-1;this.b=this.__4__this.b.getEnumerator();this.d=1;break;case 1:this.d=-1;if(this.b.moveNext()){this.c=this.b.current();this.d=1;return true}break}}return false},getEnumerator:function(){var d__;if(this.d==-2){this.d=0;d__=this}else{d__=new $.ig.MdxCalculatedMembersCache___GetMemberAliasExpressionPairs__IteratorClass(0);d__.__4__this=this.__4__this}return d__},reset:function(){throw new $$t.z(1)},dispose:function(){},current:function(){return this.c},current1:function(){return this.c},$type:new $.ig.Type("MdxCalculatedMembersCache___GetMemberAliasExpressionPairs__IteratorClass",$.ig.$ot,[$$t.$aq.$type.specialize($$t.$dc.$type.specialize(String,String)),$.ig.IEnumerable.prototype.$type,$$t.$ar.$type.specialize($$t.$dc.$type.specialize(String,String)),$.ig.IEnumerator.prototype.$type,$$t.$as.$type])},true);$c("MdxSet___GetMdxElements__IteratorClass:MdxSet___GetMdxElements__IteratorClass","Object",{d:0,a:null,c:null,__4__this:null,init:function(a){$.ig.$op.init.call(this);this.d=a},moveNext:function(){while(this.d>=0){switch(this.d){case 0:this.d=-1;this.c=this.__4__this.d.getEnumerator();this.d=1;break;case 1:this.d=-1;if(this.c.moveNext()){this.a=this.c.current();this.d=1;return true}break}}return false},getEnumerator:function(){var d__;if(this.d==-2){this.d=0;d__=this}else{d__=new $.ig.MdxSet___GetMdxElements__IteratorClass(0);d__.__4__this=this.__4__this}return d__},reset:function(){throw new $$t.z(1)},dispose:function(){},current:function(){return this.a},current1:function(){return this.a},$type:new $.ig.Type("MdxSet___GetMdxElements__IteratorClass",$.ig.$ot,[$$t.$aq.$type.specialize($$t.$e8.$type),$.ig.IEnumerable.prototype.$type,$$t.$ar.$type.specialize($$t.$e8.$type),$.ig.IEnumerator.prototype.$type,$$t.$as.$type])},true);$$t.$jc.discoverCatalogs=0;$$t.$jc.discoverCubes=1;$$t.$jc.discoverDimensions=2;$$t.$jc.discoverHierarchies=3;$$t.$jc.discoverLevels=4;$$t.$jc.discoverMeasures=5;$$t.$jc.discoverMeasureGroups=6;$$t.$jc.discoverMeasureGroupDimensions=7;$$t.$jc.discoverMembers=8;$$t.$jc.discoverKpis=9;$$t.$jc.executeStatement=10;$$t.$e9.member=0;$$t.$e9.memberTree=1;$$t.$e9.calculated=2;$$t.$e9.filter=3;$$t.$e9.collection=4;$$t.$e9.userDefined=5;$$t.$h2.none=0;$$t.$h2.session=1;$$t.$h2.beginSession=2;$$t.$h2.endSession=3;$$t.$h3.a="CATALOG_NAME";$$t.$h3.c="DESCRIPTION";$$t.$h3.d="ROLES";$$t.$h3.b="DATE_MODIFIED";$$t.$h7.a="DBSCHEMA_CATALOGS";$$t.$h7.b="DBSCHEMA_COLUMNS";$$t.$h7.d="DBSCHEMA_TABLES";$$t.$h7.c="DBSCHEMA_PROVIDER_TYPES";$$t.$ic.c="CATALOG_NAME";$$t.$ic.n="SCHEMA_NAME";$$t.$ic.e="CUBE_NAME";$$t.$ic.f="CUBE_TYPE";$$t.$ic.m="LAST_SCHEMA_UPDATE";$$t.$ic.l="LAST_DATA_UPDATE";$$t.$ic.g="DESCRIPTION";$$t.$ic.h="IS_DRILLTHROUGH_ENABLED";$$t.$ic.i="IS_LINKABLE";$$t.$ic.k="IS_WRITE_ENABLED";$$t.$ic.j="IS_SQL_ENABLED";$$t.$ic.d="CUBE_CAPTION";$$t.$ic.b="BASE_CUBE_NAME";$$t.$ic.a="ANNOTATIONS";$$t.$id.a="CATALOG_NAME";$$t.$id.p="SCHEMA_NAME";$$t.$id.b="CUBE_NAME";$$t.$id.i="DIMENSION_NAME";$$t.$id.l="DIMENSION_UNIQUE_NAME";$$t.$id.e="DIMENSION_CAPTION";$$t.$id.j="DIMENSION_ORDINAL";$$t.$id.k="DIMENSION_TYPE";$$t.$id.f="DIMENSION_CARDINALITY";$$t.$id.c="DEFAULT_HIERARCHY";$$t.$id.d="DESCRIPTION";$$t.$id.o="IS_VIRTUAL";$$t.$id.n="IS_READWRITE";$$t.$id.m="DIMENSION_UNIQUE_SETTINGS";$$t.$id.h="DIMENSION_MASTER_NAME";$$t.$id.g="DIMENSION_IS_VISIBLE";$$t.$ie.b="CATALOG_NAME";$$t.$ie.c="CUBE_NAME";$$t.$ie.j="DIMENSION_UNIQUE_NAME";$$t.$ie.q="HIERARCHY_NAME";$$t.$ie.t="HIERARCHY_UNIQUE_NAME";$$t.$ie.m="HIERARCHY_CAPTION";$$t.$ie.i="DIMENSION_TYPE";$$t.$ie.n="HIERARCHY_CARDINALITY";$$t.$ie.d="DEFAULT_MEMBER";$$t.$ie.a="ALL_MEMBER";$$t.$ie.e="DESCRIPTION";$$t.$ie.w="IS_VIRTUAL";$$t.$ie.v="IS_READWRITE";$$t.$ie.k="DIMENSION_UNIQUE_SETTINGS";$$t.$ie.g="DIMENSION_IS_VISIBLE";$$t.$ie.h="DIMENSION_MASTER_UNIQUE_NAME";$$t.$ie.r="HIERARCHY_ORDINAL";$$t.$ie.f="DIMENSION_IS_SHARED";$$t.$ie.p="HIERARCHY_IS_VISIBLE";$$t.$ie.s="HIERARCHY_ORIGIN";$$t.$ie.o="HIERARCHY_DISPLAY_FOLDER";$$t.$ie.u="INSTANCE_SELECTION";$$t.$ie.l="GROUPING_BEHAVIOR";$$t.$ie.x="STRUCTURE_TYPE";$$t.$ig.a="INSTANCE_NAME";$$t.$ig.b="INSTANCE_PORT_NUMBER";$$t.$ig.c="INSTANCE_STATE";$$t.$ih.a="CATALOG_NAME";$$t.$ih.q="SCHEMA_NAME";$$t.$ih.b="CUBE_NAME";$$t.$ih.p="MEASUREGROUP_NAME";$$t.$ih.h="KPI_NAME";$$t.$ih.c="KPI_CAPTION";$$t.$ih.e="KPI_DESCRIPTION";$$t.$ih.f="KPI_DISPLAY_FOLDER";$$t.$ih.n="KPI_VALUE";$$t.$ih.g="KPI_GOAL";$$t.$ih.j="KPI_STATUS";$$t.$ih.l="KPI_TREND";$$t.$ih.k="KPI_STATUS_GRAPHIC";$$t.$ih.m="KPI_TREND_GRAPHIC";$$t.$ih.o="KPI_WEIGHT";$$t.$ih.d="KPI_CURRENT_TIME_MEMBER";$$t.$ih.i="KPI_PARENT_KPI_NAME";$$t.$ii.a="CATALOG_NAME";$$t.$ii.b="CUBE_NAME";$$t.$ii.e="DIMENSION_UNIQUE_NAME";$$t.$ii.f="HIERARCHY_UNIQUE_NAME";$$t.$ii.l="LEVEL_NAME";$$t.$ii.q="LEVEL_UNIQUE_NAME";$$t.$ii.g="LEVEL_CAPTION";$$t.$ii.m="LEVEL_NUMBER";$$t.$ii.h="LEVEL_CARDINALITY";$$t.$ii.p="LEVEL_TYPE";$$t.$ii.d="DESCRIPTION";$$t.$ii.c="CUSTOM_ROLLUP_SETTINGS";$$t.$ii.r="LEVEL_UNIQUE_SETTINGS";$$t.$ii.j="LEVEL_IS_VISIBLE";$$t.$ii.n="LEVEL_ORDERING_PROPERTY";$$t.$ii.i="LEVEL_DBTYPE";$$t.$ii.k="LEVEL_KEY_CARDINALITY";$$t.$ii.o="LEVEL_ORIGIN";$$t.$ij.a="CATALOG_NAME";$$t.$ij.r="SCHEMA_NAME";$$t.$ij.b="CUBE_NAME";$$t.$ij.l="MEASURE_NAME";$$t.$ij.n="MEASURE_UNIQUE_NAME";$$t.$ij.h="MEASURE_CAPTION";$$t.$ij.g="MEASURE_AGGREGATOR";$$t.$ij.c="DATA_TYPE";$$t.$ij.p="NUMERIC_PRECISION";$$t.$ij.q="NUMERIC_SCALE";$$t.$ij.f="EXPRESSION";$$t.$ij.e="DESCRIPTION";$$t.$ij.k="MEASURE_IS_VISIBLE";$$t.$ij.m="MEASURE_NAME_SQL_COLUMN_NAME";$$t.$ij.o="MEASURE_UNQUALIFIED_CAPTION";$$t.$ij.j="MEASUREGROUP_NAME";$$t.$ij.i="MEASURE_DISPLAY_FOLDER";$$t.$ij.d="DEFAULT_FORMAT_STRING";$$t.$ik.a="CATALOG_NAME";$$t.$ik.f="SCHEMA_NAME";$$t.$ik.b="CUBE_NAME";$$t.$ik.e="MEASUREGROUP_NAME";$$t.$ik.c="DESCRIPTION";$$t.$ik.d="MEASUREGROUP_CAPTION";$$t.$il.a="CATALOG_NAME";$$t.$il.k="SCHEMA_NAME";$$t.$il.b="CUBE_NAME";$$t.$il.j="MEASUREGROUP_NAME";$$t.$il.i="MEASUREGROUP_CARDINALITY";$$t.$il.h="DIMENSION_UNIQUE_NAME";$$t.$il.c="DIMENSION_CARDINALITY";$$t.$il.f="DIMENSION_IS_VISIBLE";$$t.$il.e="DIMENSION_IS_FACT_DIMENSION";$$t.$il.g="DIMENSION_PATH";$$t.$il.d="DIMENSION_GRANULARITY";$$t.$im.a="CATALOG_NAME";$$t.$im.u="SCHEMA_NAME";$$t.$im.c="CUBE_NAME";$$t.$im.e="DIMENSION_UNIQUE_NAME";$$t.$im.g="HIERARCHY_UNIQUE_NAME";$$t.$im.k="LEVEL_UNIQUE_NAME";$$t.$im.j="LEVEL_NUMBER";$$t.$im.o="MEMBER_NAME";$$t.$im.q="MEMBER_UNIQUE_NAME";$$t.$im.p="MEMBER_TYPE";$$t.$im.m="MEMBER_GUID";$$t.$im.l="MEMBER_CAPTION";$$t.$im.b="CHILDREN_CARDINALITY";$$t.$im.s="PARENT_LEVEL";$$t.$im.t="PARENT_UNIQUE_NAME";$$t.$im.r="PARENT_COUNT";$$t.$im.d="DESCRIPTION";$$t.$im.f="EXPRESSION";$$t.$im.n="MEMBER_KEY";$$t.$im.i="IS_PLACEHOLDERMEMBER";$$t.$im.h="IS_DATAMEMBER";$$t.$im.v="SCOPE";$$t.$io.a="MDSCHEMA_CUBES";$$t.$io.b="MDSCHEMA_DIMENSIONS";$$t.$io.g="MDSCHEMA_MEASUREGROUPS";$$t.$io.f="MDSCHEMA_MEASUREGROUP_DIMENSIONS";$$t.$io.h="MDSCHEMA_MEASURES";$$t.$io.c="MDSCHEMA_HIERARCHIES";$$t.$io.e="MDSCHEMA_LEVELS";$$t.$io.i="MDSCHEMA_MEMBERS";$$t.$io.d="MDSCHEMA_KPIS";$$t.$ip.a="CATALOG_NAME";$$t.$ip.d="SCHEMA_NAME";$$t.$ip.b="CUBE_NAME";$$t.$ip.c="CUBE_SOURCE";$$t.$iq.a="CATALOG_NAME";$$t.$iq.g="SCHEMA_NAME";$$t.$iq.b="CUBE_NAME";$$t.$iq.d="DIMENSION_NAME";$$t.$iq.e="DIMENSION_UNIQUE_NAME";$$t.$iq.c="CUBE_SOURCE";$$t.$iq.f="DIMENSION_VISIBILITY";$$t.$ir.a="CATALOG_NAME";$$t.$ir.i="SCHEMA_NAME";$$t.$ir.b="CUBE_NAME";$$t.$ir.d="DIMENSION_UNIQUE_NAME";$$t.$ir.e="HIERARCHY_NAME";$$t.$ir.g="HIERARCHY_UNIQUE_NAME";$$t.$ir.f="HIERARCHY_ORIGIN";$$t.$ir.c="CUBE_SOURCE";$$t.$ir.h="HIERARCHY_VISIBILITY";$$t.$is.a="CATALOG_NAME";$$t.$is.e="SCHEMA_NAME";$$t.$is.b="CUBE_NAME";$$t.$is.d="KPI_NAME";$$t.$is.c="CUBE_SOURCE";$$t.$it.a="CATALOG_NAME";$$t.$it.j="SCHEMA_NAME";$$t.$it.b="CUBE_NAME";$$t.$it.d="DIMENSION_UNIQUE_NAME";$$t.$it.e="HIERARCHY_UNIQUE_NAME";$$t.$it.f="LEVEL_NAME";$$t.$it.h="LEVEL_UNIQUE_NAME";$$t.$it.g="LEVEL_ORIGIN";$$t.$it.c="CUBE_SOURCE";$$t.$it.i="LEVEL_VISIBILITY";$$t.$iu.a="CATALOG_NAME";$$t.$iu.h="SCHEMA_NAME";$$t.$iu.b="CUBE_NAME";$$t.$iu.e="MEASURE_NAME";$$t.$iu.f="MEASURE_UNIQUE_NAME";$$t.$iu.d="MEASUREGROUP_NAME";$$t.$iu.c="CUBE_SOURCE";$$t.$iu.g="MEASURE_VISIBILITY";$$t.$iv.a="CATALOG_NAME";$$t.$iv.d="SCHEMA_NAME";$$t.$iv.b="CUBE_NAME";$$t.$iv.c="MEASUREGROUP_NAME";$$t.$iw.a="CATALOG_NAME";$$t.$iw.f="SCHEMA_NAME";$$t.$iw.b="CUBE_NAME";$$t.$iw.e="MEASUREGROUP_NAME";$$t.$iw.c="DIMENSION_UNIQUE_NAME";$$t.$iw.d="DIMENSION_VISIBILITY";$$t.$ix.a="CATALOG_NAME";$$t.$ix.k="SCHEMA_NAME";$$t.$ix.b="CUBE_NAME";$$t.$ix.d="DIMENSION_UNIQUE_NAME";$$t.$ix.e="HIERARCHY_UNIQUE_NAME";$$t.$ix.g="LEVEL_UNIQUE_NAME";$$t.$ix.f="LEVEL_NUMBER";$$t.$ix.h="MEMBER_NAME";$$t.$ix.j="MEMBER_UNIQUE_NAME";$$t.$ix.i="MEMBER_TYPE";$$t.$ix.l="TREE_OP";$$t.$ix.c="CUBE_SOURCE";$$t.$hv.a=null;$$t.$hw.a=null;$$t.$hx.a=null;$$t.$hl.a=null;$$t.$hm.a=null;$$t.$hq.a=null;$$t.$hp.a=null;$$t.$ho.a=null;$$t.$hr.a=null;$$t.$iy.ak="DBSCHEMA_CATALOGS";$$t.$iy.al="MDSCHEMA_CUBES";$$t.$iy.ai="RestrictionList";$$t.$iy.ah="PropertyList";$$t.$iy.e="DataSourceInfo";$$t.$iy.b="Catalog";$$t.$iy.at="SCHEMA_NAME";$$t.$iy.aj="row";$$t.$iy.h="DESCRIPTION";$$t.$iy.d="CUBE";$$t.$iy.k="DIMENSION";$$t.$iy.am="MDSCHEMA_DIMENSIONS";$$t.$iy.aq="MDSCHEMA_MEASUREGROUPS";$$t.$iy.aa="MEASUREGROUP_NAME";$$t.$iy.z="MEASUREGROUP_CAPTION";$$t.$iy.ap="MDSCHEMA_MEASUREGROUP_DIMENSIONS";$$t.$iy.j="DIMENSION_NAME";$$t.$iy.m="DIMENSION_UNIQUE_NAME";$$t.$iy.i="DIMENSION_CAPTION";$$t.$iy.ar="MDSCHEMA_MEASURES";$$t.$iy.ab="MEASURE_NAME";$$t.$iy.ac="MEASURE_UNIQUE_NAME";$$t.$iy.y="MEASURE_CAPTION";$$t.$iy.x="MEASURE_AGGREGATOR";$$t.$iy.l="DIMENSION_TYPE";$$t.$iy.an="MDSCHEMA_HIERARCHIES";$$t.$iy.p="HIERARCHY_NAME";$$t.$iy.r="HIERARCHY_UNIQUE_NAME";$$t.$iy.n="HIERARCHY_CAPTION";$$t.$iy.q="HIERARCHY_ORIGIN";$$t.$iy.g="DEFAULT_MEMBER";$$t.$iy.a="ALL_MEMBER";$$t.$iy.u="LEVEL_NAME";$$t.$iy.s="LEVEL_CAPTION";$$t.$iy.w="LEVEL_UNIQUE_NAME";$$t.$iy.v="LEVEL_NUMBER";$$t.$iy.t="LEVEL_CARDINALITY";$$t.$iy.ao="MDSCHEMA_LEVELS";$$t.$iy.as="MDSCHEMA_MEMBERS";$$t.$iy.av="TREE_OP";$$t.$iy.ae="MEMBER_NAME";$$t.$iy.af="MEMBER_UNIQUE_NAME";$$t.$iy.ad="MEMBER_CAPTION";$$t.$iy.ag="PARENT_UNIQUE_NAME";$$t.$iy.c="CHILDREN_CARDINALITY";$$t.$iy.f="DEFAULT_FORMAT_STRING";$$t.$iy.o="HIERARCHY_DISPLAY_FOLDER";$$t.$iy.au="SCOPE";$$t.$hg.a="return";$$t.$iz.f="urn:schemas-microsoft-com:xml-sql";$$t.$iz.a="urn:schemas-microsoft-com:xml-analysis";$$t.$iz.d="urn:schemas-microsoft-com:xml-analysis:mddataset";$$t.$iz.e="urn:schemas-microsoft-com:xml-analysis:rowset";$$t.$iz.b="urn:schemas-microsoft-com:xml-analysis:empty";$$t.$iz.c="urn:schemas-microsoft-com:xml-analysis:exception";$$t.$g3.d="Envelope";$$t.$g3.e="Header";$$t.$g3.b="Body";$$t.$g3.f="soap";$$t.$g3.g="http://schemas.xmlsoap.org/soap/envelope/";$$t.$h0.h="Properties";$$t.$h0.i="PropertyList";$$t.$h1.m="Discover";$$t.$h1.o="RequestType";$$t.$h1.q="Restrictions";$$t.$h1.p="RestrictionList";$$t.$h1.s="SessionId";$$t.$hz.k="Execute";$$t.$hz.j="Command";$$t.$hz.m="Statement";$$t.$f2.a=null;if($$t.$f2.staticInit&&!$$t.$f2.xmlaSoapWebClientStaticInitCalled){$$t.$f2.staticInit();$$t.$f2.xmlaSoapWebClientStaticInitCalled=true}$$t.$jl.b=new $$t.jl;$$t.$jx.a=new $$t.jx;$$t.$jz.a=new $$t.jz;$$t.$jm.a=new $$t.jm;$$t.$j0.a=new $$t.j0;$$t.$jn.a=new $$t.jn;$$t.$jo.a=new $$t.jo;$$t.$jp.a=new $$t.jp;$$t.$jv.a=new $$t.jv;$$t.$jq.a=new $$t.jq;$$t.$jt.a=new $$t.jt;$$t.$js.a=new $$t.js;$$t.$jr.a=new $$t.jr;$$t.$ju.a=new $$t.ju;$$t.$je.a=new $$t.je;$$t.$jw.a=new $$t.jw;$$t.$jy.a=new $$t.jy;$$t.$j5.a="Catalog"})(jQuery);/*!@license
* Infragistics.Web.ClientUI infragistics.olapflatdatasource.js 15.2.20152.1027
*
* Copyright (c) 2011-2015 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends:
*     jquery-1.4.4.js
*     jquery.ui.core.js
*     jquery.ui.widget.js
*     infragistics.util.js
*/
$.ig=$.ig||{};(function($){var $$t={};$.ig.$currDefinitions=$$t;$.ig.util.bulkDefine(["AbstractEnumerable:a","Object:b","Type:c","Boolean:d","ValueType:e","Void:f","IConvertible:g","IFormatProvider:h","Number:i","String:j","IComparable:k","Number:l","Number:m","Number:n","Number:o","NumberStyles:p","Enum:q","Array:r","IList:s","ICollection:t","IEnumerable:u","IEnumerator:v","NotSupportedException:w","Error:x","Number:y","String:z","StringComparison:aa","RegExp:ab","CultureInfo:ac","DateTimeFormatInfo:ad","Calendar:ae","Date:af","Number:ag","DayOfWeek:ah","DateTimeKind:ai","CalendarWeekRule:aj","NumberFormatInfo:ak","CompareInfo:al","CompareOptions:am","IEnumerable$1:an","IEnumerator$1:ao","IDisposable:ap","StringSplitOptions:aq","Number:ar","Number:as","Number:at","Number:au","Number:av","Number:aw","Assembly:ax","Stream:ay","SeekOrigin:az","RuntimeTypeHandle:a0","MethodInfo:a1","MethodBase:a2","MemberInfo:a3","ParameterInfo:a4","TypeCode:a5","ConstructorInfo:a6","PropertyInfo:a7","Func$1:a8","MulticastDelegate:a9","IntPtr:ba","AbstractEnumerator:bb","ArgumentException:be","IArray:bg","List$1:bh","IList$1:bi","ICollection$1:bj","Script:bk","IArrayList:bl","Array:bm","CompareCallback:bn","Func$3:bo","Action$1:bp","Comparer$1:bq","IComparer:br","IComparer$1:bs","DefaultComparer$1:bt","IComparable$1:bu","Comparison$1:bv","ReadOnlyCollection$1:bw","Predicate$1:bx","NotImplementedException:by","IDictionary$2:b0","Dictionary$2:b1","IDictionary:b2","Func$2:b3","KeyValuePair$2:b4","Enumerable:b5","Thread:b6","ThreadStart:b7","IOrderedEnumerable$1:b8","SortedList$1:b9","Math:ca","ArgumentNullException:cb","IEqualityComparer$1:cc","EqualityComparer$1:cd","IEqualityComparer:ce","DefaultEqualityComparer$1:cf","InvalidOperationException:ch","GenericEnumerable$1:ci","GenericEnumerator$1:cj","INotifyCollectionChanged:cl","NotifyCollectionChangedEventHandler:cm","NotifyCollectionChangedEventArgs:cn","EventArgs:co","NotifyCollectionChangedAction:cp","ObservableCollection$1:cs","INotifyPropertyChanged:ct","PropertyChangedEventHandler:cu","PropertyChangedEventArgs:cv","Delegate:cw","Interlocked:cx","NameValueCollection:c0","Stack$1:c1","ReverseArrayEnumerator$1:c2","AggregateException:dq","APIFactory:dr","Point:ds","Rect:dt","Size:du","Color:dv","AsyncCompletedEventArgs:dz","ListSortDirection:d1","Environment:d3","UTF8Encoding:eg","Encoding:eh","UnicodeEncoding:ei","AsciiEncoding:ej","Decoder:ek","DefaultDecoder:el","UTF8Encoding_UTF8Decoder:em","StringBuilder:et","ICredentials:eu","NetworkCredential:ev","Uri:ew","UriKind:ex","UploadStringCompletedEventHandler:ey","UploadStringCompletedEventArgs:ez","WebClient:e0","WebHeaderCollection:e1","Task$1:e2","Task:e3","JQueryPromise:e4","Action:e5","TaskStatus:e6","TaskCompletionSource$1:e7","JQueryDeferred:e8","JQuery:e9","JQueryObject:fa","Element:fb","ElementAttributeCollection:fc","ElementCollection:fd","WebStyle:fe","ElementNodeType:ff","Document:fg","EventListener:fh","IElementEventHandler:fi","ElementEventHandler:fj","ElementAttribute:fk","JQueryPosition:fl","JQueryCallback:fm","JQueryEvent:fn","JQueryUICallback:fo","FaultCode:fr","FaultException:fs","FaultReason:ft","FaultException$1:fu","TaskFactory:f4","Tuple$2:f5","JavaScriptSerializer:f8","XObject:h6","XmlNode:h7","XmlNodeList:h8","XmlNamedNodeMap:h9","XmlNodeType:ia","XmlDocument:ib","XmlElement:ic","XmlLinkedNode:id","XmlAttribute:ie","XmlUtils:ig","XAttribute:ih","XNode:ii","XContainer:ij","XElement:ik","XName:il","XNamespace:im","XDocument:io"]);var $a=$.ig.intDivide,$b=$.ig.util.cast,$c=$.ig.util.defType,$d=$.ig.util.getBoxIfEnum,$e=$.ig.util.getDefaultValue,$f=$.ig.util.getEnumValue,$g=$.ig.util.getValue,$h=$.ig.util.intSToU,$i=$.ig.util.nullableEquals,$j=$.ig.util.nullableIsNull,$k=$.ig.util.nullableNotEquals,$l=$.ig.util.toNullable,$m=$.ig.util.toString$1,$n=$.ig.util.u32BitwiseAnd,$o=$.ig.util.u32BitwiseOr,$p=$.ig.util.u32BitwiseXor,$q=$.ig.util.u32LS,$r=$.ig.util.unwrapNullable,$s=$.ig.util.wrapNullable,$t=String.fromCharCode,$u=$.ig.util.castObjTo$t,$v=$.ig.util.compareSimple,$w=$.ig.util.tryParseNumber,$x=$.ig.util.tryParseNumber1,$y=$.ig.util.numberToString,$z=$.ig.util.numberToString1,$0=$.ig.util.parseNumber,$1=$.ig.util.tryParseInt32_1,$2=$.ig.util.tryParseInt32_2,$3=$.ig.util.intToString1,$4=$.ig.util.parseInt32_1,$5=$.ig.util.parseInt32_2,$6=$.ig.util.compare,$7=$.ig.util.replace,$8=$.ig.util.stringFormat,$9=$.ig.util.stringFormat1,$aa=$.ig.util.stringFormat2,$ab=$.ig.util.stringCompare1,$ac=$.ig.util.stringCompare2,$ad=$.ig.util.stringCompare3,$ae=$.ig.util.isDigit,$af=$.ig.util.isDigit1,$ag=$.ig.util.isLetter,$ah=$.ig.util.isNumber,$ai=$.ig.util.isLetterOrDigit,$aj=$.ig.util.isLower,$ak=$.ig.util.toLowerCase,$al=$.ig.util.toUpperCase;$c("UriKind:ex","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"RelativeOrAbsolute";case 1:return"Absolute";case 2:return"Relative";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("UriKind",$.ig.$ep.$type)},true);$c("TaskStatus:e6","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"Created";case 5:return"RanToCompletion";case 6:return"Canceled";case 7:return"Faulted";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("TaskStatus",$.ig.$ep.$type)},true);$c("ListSortDirection:d1","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"Ascending";case 1:return"Descending";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("ListSortDirection",$.ig.$ep.$type)},true);$c("NotifyCollectionChangedAction:cp","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"Add";case 1:return"Remove";case 2:return"Replace";case 4:return"Reset";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("NotifyCollectionChangedAction",$.ig.$ep.$type)},true);$c("AbstractEnumerable:a","Object",{a:null,init:function(a){$.ig.$op.init.call(this);this.a=a},getEnumerator:function(){return new $$t.bb(this.a().getEnumerator())},$type:new $.ig.Type("AbstractEnumerable",$.ig.$ot,[$.ig.IEnumerable.prototype.$type])},true);$c("AbstractEnumerator:bb","Object",{a:null,init:function(a){$.ig.$op.init.call(this);this.a=a},current:function(){return this.a.current()},moveNext:function(){return this.a.moveNext()},reset:function(){this.a.reset()},$type:new $.ig.Type("AbstractEnumerator",$.ig.$ot,[$.ig.IEnumerator.prototype.$type])},true);$c("IArray:bg","Object",{$type:new $.ig.Type("IArray",null)},true);$c("List$1:bh","Object",{$t:null,__inner:null,c:false,init:function($t,a){this.$t=$t;this.$type=this.$type.specialize(this.$t);if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}this.l={};$.ig.$op.init.call(this);this.__inner=[];this.c=this.$t.InstanceConstructor&&this.$t.InstanceConstructor.prototype.equals===$.ig.Object.prototype.equals},init1:function($t,a,b){this.$t=$t;this.$type=this.$type.specialize(this.$t);$$t.$bh.init.call(this,this.$t,0);if(this.d(0,b)){return}var d=b.getEnumerator();while(d.moveNext()){var c=d.current();this.add(c)}},init2:function($t,a,b){this.$t=$t;this.$type=this.$type.specialize(this.$t);$$t.$bh.init.call(this,this.$t,0)},w:function(a,b){this.__inner[a]=b},q:function(a,b){this.__inner.splice(a,0,b)},m:function(a){this.__inner.push(a)},t:function(a){this.__inner.splice(a,1)},o:function(){this.__inner=[]},item:function(a,b){if(arguments.length===2){this.w(a,b);return b}else{return this.__inner[a]}},indexOf:function(a){if(this.c){return this.__inner.indexOf(a)}for(var b=0;b<this.__inner.length;b++){if($.ig.$op.equalsStatic($d(this.$t,a),$d(this.$t,this.__inner[b]))){return b}}return-1},indexOf2:function(a,b){if(this.c){return this.__inner.indexOf(a,b)}for(;b<this.__inner.length;b++){if($.ig.$op.equalsStatic($d(this.$t,a),$d(this.$t,this.__inner[b]))){return b}}return-1},lastIndexOf:function(a){if(this.c){return this.__inner.lastIndexOf(a)}for(var b=this.__inner.length-1;b>=0;b--){if($.ig.$op.equalsStatic($d(this.$t,a),$d(this.$t,this.__inner[b]))){return b}}return-1},insert:function(a,b){this.q(a,b)},removeAt:function(a){this.t(a)},count:function(){return this.__inner.length},isReadOnly:function(){return false},add:function(a){this.m(a)},clear:function(){this.o()},contains:function(a){return this.indexOf(a)>=0},copyTo:function(a,b){for(var c=0;c<this.__inner.length;c++){a[b+c]=this.__inner[c]}},remove:function(a){var b=this.indexOf(a);if(b<0){return false}this.t(b);return true},getEnumerator:function(){return this.__inner.getEnumerator()},getEnumerator:function(){return this.__inner.getEnumerator()},asArray:function(){return this.__inner},d:function(index_,collection_){var a=$b($$t.$bl.$type,collection_);if(a!=null){var a_=a.asArrayList();Array.prototype.splice.apply(this.__inner,Array.prototype.concat.apply([index_,0],a_));return true}var b=$b($$t.$bg.$type,collection_);if(b!=null){var a_=b.asArray();Array.prototype.splice.apply(this.__inner,Array.prototype.concat.apply([index_,0],a_));return true}var asList_=$b($$t.$bi.$type.specialize(this.$t),collection_);if(asList_!=null){for(var i_=0;i_<asList_.count();i_++){var item_=asList_.item(i_);this.__inner.splice(index_+i_,0,item_)}return true}var arr_=$.isArray(collection_)?collection_:null;if(arr_!=null){var inn_=this.__inner;if(this.__inner.length==0){for(var i_=0;i_<arr_.length;i_++){inn_[index_++]=$u(this.$t,arr_[i_])}}else{for(var i_=0;i_<arr_.length;i_++){inn_.splice(index_++,0,arr_[i_])}}return true}return false},insertRange1:function(a,b){if(this.d(a,b)){return}var j_=a;var c=b.getEnumerator();while(c.moveNext()){var item_=c.current();this.__inner.splice(j_,0,item_);j_++}},insertRange:function(a,b){if(this.d(a,b)){return}var j_=a;var c=b.getEnumerator();while(c.moveNext()){var item_=c.current();this.__inner.splice(j_,0,item_);j_++}},removeRange:function(index_,numToRemove_){this.__inner.splice(index_,numToRemove_)},copyTo1:function(a,b){$.ig.util.arrayCopyTo(this.__inner,a,b)},isFixedSize:function(){return false},add1:function(a){this.m($u(this.$t,a));return this.__inner.length-1},contains1:function(a){return this.indexOf1(a)>=0},indexOf1:function(a){return this.indexOf($u(this.$t,a))},insert1:function(a,b){this.q(a,$u(this.$t,b))},remove1:function(a){var b=this.indexOf1(a);if(b<0){return}this.t(b)},sort:function(){var a=null;if(this.$t==Number){a=function(b,c){var d=b;var e=c;if(d<e){return-1}if(d==e){return 0}return 1}}else if(this.$t==$.ig.Number.prototype.$type){a=function(b,c){var d=b;var e=c;if(d<e){return-1}if(d==e){return 0}return 1}}else if(this.$t==$.ig.Number.prototype.$type){a=function(b,c){var d=$g(b);var e=$g(c);if(d<e){return-1}if(d==e){return 0}return 1}}else if(this.$t==$$t.$af.$type){a=function(b,c){var d=b;var e=c;if(d.getTime()<e.getTime()){return-1}if(d.getTime()==e.getTime()){return 0}return 1}}else{a=function(b,c){return b.compareTo(c)}}this.aa(a)},aa:function(compare_){this.__inner.sort(compare_)},sort2:function(compare_){this.__inner.sort(compare_)},_capacity:0,capacity:function(a){if(arguments.length===1){this._capacity=a;return a}else{return this._capacity}},addRange:function(a){var b=a.getEnumerator();while(b.moveNext()){var item_=b.current();this.__inner.push(item_)}},toArray:function(){return this.__inner},forEach:function(a){for(var b=0;b<this.__inner.length;b++){a(this.__inner[b])}},isSynchronized:function(){return true},l:null,syncRoot:function(){return this.l},binarySearch:function(a){return this.binarySearch1(a,$$t.$bq.defaultComparerValue(this.$t))},binarySearch1:function(a,b){var c=0;var d=this.count()-1;while(c<=d){var e=c+$a(d-c,2);var f=this.__inner[e];var g=b.compare(f,a);if(g==0){return e}if(g<0){c=e+1}else{d=e-1}}return~c},asReadOnly:function(){return new $$t.bw(this.$t,1,this)},reverse:function(){for(var a=0;a<$a(this.count(),2);a++){var b=this.count()-a-1;var c=this.__inner[a];this.__inner[a]=this.__inner[b];this.__inner[b]=c}},sort1:function(a){this.sort2(a.compare.runOn(a))},removeAll:function(a){throw new $$t.by(0);return 0},$type:new $.ig.Type("List$1",$.ig.$ot,[$$t.$bi.$type.specialize(0),$$t.$bg.$type,$.ig.IList.prototype.$type])},true);$c("IComparer:br","Object",{$type:new $.ig.Type("IComparer",null)},true);$c("IComparer$1:bs","Object",{$type:new $.ig.Type("IComparer$1",null)},true);$c("Comparer$1:bq","Object",{$t:null,init:function($t){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this)},defaultComparerValue:function($t){return new $$t.bt($t)},compare:function(a,b){},a:function($t,a){return null},$type:new $.ig.Type("Comparer$1",$.ig.$ot,[$$t.$br.$type,$$t.$bs.$type.specialize(0)])},true);$c("DefaultComparer$1:bt","Comparer$1",{$t:null,init:function($t){this.$t=$t;this.$type=this.$type.specialize(this.$t);$$t.$bq.init.call(this,this.$t)},compare:function(a,b){var c=$b($$t.$bu.$type.specialize(this.$t),a);if(c!=null){return c.compareTo(b)}var d=$b($$t.$bu.$type.specialize(this.$t),b);if(d!=null){return-d.compareTo(a)}return $.ig.util.compare(a,b)},$type:new $.ig.Type("DefaultComparer$1",$$t.$bq.$type.specialize(0))},true);$c("KeyValuePair$2:b4","ValueType",{$tKey:null,$tValue:null,init:function($tKey,$tValue,a){this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$.ig.ValueType.prototype.init.call(this)},a:null,c:null,init1:function($tKey,$tValue,a,b,c){this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$.ig.ValueType.prototype.init.call(this);this.a=b;this.c=c},key:function(){return this.a},value:function(){return this.c},$type:new $.ig.Type("KeyValuePair$2",$.ig.ValueType.prototype.$type)},true);$c("IDictionary$2:b0","Object",{$type:new $.ig.Type("IDictionary$2",null,[$$t.$bj.$type.specialize($$t.$b4.$type.specialize(this.$tKey,this.$tValue)),$$t.$an.$type.specialize($$t.$b4.$type.specialize(this.$tKey,this.$tValue)),$.ig.IEnumerable.prototype.$type])},true);$c("Dictionary$2:b1","Object",{$tKey:null,$tValue:null,g:null,h:0,e:false,d:false,c:false,a:null,b:null,init:function($tKey,$tValue,a){this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break;case 3:this.init3.apply(this,arguments);break;case 4:this.init4.apply(this,arguments);break}return}$$t.$b1.init4.call(this,this.$tKey,this.$tValue,4,0,null)},init1:function($tKey,$tValue,a,b){this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$$t.$b1.init4.call(this,this.$tKey,this.$tValue,4,b,null)},init2:function($tKey,$tValue,a,b){this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$$t.$b1.init4.call(this,this.$tKey,this.$tValue,4,0,b)},init3:function($tKey,$tValue,a,b){this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$$t.$b1.init1.call(this,this.$tKey,this.$tValue,1,b.count());var d=b.getEnumerator();while(d.moveNext()){var c=d.current();this.item(c.key(),c.value())}},init4:function($tKey,$tValue,a,b,c){this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$.ig.$op.init.call(this);this.a={};this.b={};this.g=c||$$t.$cd.defaultEqualityComparerValue(this.$tKey);this.e=c==null&&($tKey===$.ig.String.prototype.$type||$tKey===String);this.d=$tKey===$.ig.Object.prototype.$type||$tKey.InstanceConstructor&&!$tKey.InstanceConstructor.prototype.getHashCode;this.c=c==null&&(this.e||this.d||$tKey.InstanceConstructor&&$tKey.InstanceConstructor.prototype.getHashCode==$.ig.Object.prototype.getHashCode)},count:function(){return this.h},item:function(key_,a){if(arguments.length===2){this.l(key_,a,false);return a}else{var $self=this;var a;if(function(){var b=$self.tryGetValue(key_,a);a=b.p1;return b.ret}()){return a}return $e(this.$tValue)}},length:function(){return this.h},containsKey:function(a){if(this.c){var b=this.k(a);return this.a.hasOwnProperty(b)}else{var c=this.i(a);var d=this.b[c];if(d){if(d.$isHashSetBucket){var g=d;for(var f=0;f<g.length;f++){var e=g[f];return this.g.equalsC(e.key,a)}}else{return this.g.equalsC(d.key,a)}}}return false},remove:function(a){if(this.c){var b=this.k(a);if(!this.a.hasOwnProperty(b)){return false}delete this.a[b];delete this.b[b];this.h--;return true}var c=this.i(a);var d=this.b[c];if(d){if(d.$isHashSetBucket){var g=d;for(var f=0;f<g.length;f++){var e=g[f];if(this.g.equalsC(e.key,a)){d.removeItem(e);if(d.length==1){this.b[c]=d[0]}this.h--;return true}}}else{if(this.g.equalsC(d.key,a)){delete this.b[c];this.h--;return true}}}return false},clear:function(){this.h=0;this.a={};this.b={}},k:function(a){if(this.d){$.ig.util.ensureUniqueId(a)}if(this.e){return $m(this.$tKey,a)}else{return a.getHashCode().toString()}},i:function(a){if(this.d){$.ig.util.ensureUniqueId(a)}else{if(!a.getHashCode){this.d=true;$.ig.util.ensureUniqueId(a)}}return this.g.getHashCodeC(a)},add:function(a,b){this.l(a,b,true)},l:function(a,b,c){if(this.c){var d=this.k(a);if(!this.a.hasOwnProperty(d)){this.h++}else if(c){throw new $$t.be(1,"Duplicate key added to the dictionary")}this.a[d]=a;this.b[d]=b}else{var e=this.i(a);var f=this.b[e];if(f){if(f.$isHashSetBucket){var i=f;for(var h=0;h<i.length;h++){var g=i[h];if(this.g.equalsC(g.key,a)){if(c){throw new $$t.be(1,"Duplicate key added to the dictionary")}g.value=b;return}}f.push({key:a,value:b});this.h++}else{if(this.g.equalsC(f.key,a)){if(c){throw new $$t.be(1,"Duplicate key added to the dictionary")}f.value=b}else{var j=[f,{key:a,value:b}];j.$isHashSetBucket=true;this.b[e]=j;this.h++}}}else{this.b[e]={key:a,value:b};this.h++}}},tryGetValue:function(a,b){if(this.c){var c=this.k(a);if(this.a.hasOwnProperty(c)){b=this.b[c];return{ret:true,p1:b}}}else{var d=this.i(a);var e=this.b[d];if(e){if(e.$isHashSetBucket){var h=e;for(var g=0;g<h.length;g++){var f=h[g];if(this.g.equalsC(f.key,a)){b=f.value;return{ret:true,p1:b}}}}else{if(this.g.equalsC(e.key,a)){b=e.value;return{ret:true,p1:b}}}}}b=$e(this.$tValue);return{ret:false,p1:b}},isReadOnly:function(){return false},add1:function(a){this.add(a.key(),a.value())},contains:function(a){var $self=this;var b;return function(){var c=$self.tryGetValue(a.key(),b);b=c.p1;return c.ret}()&&$.ig.$op.equalsStatic($d(this.$tValue,b),$d(this.$tValue,a.value()))},copyTo:function(a,b){throw new $$t.by(0)},remove1:function(a){this.remove(a.key());return true},getEnumerator:function(){return this.f().getEnumerator()},f:function(){var d__=new $.ig.Dictionary___ToEnumerable__IteratorClass$2(this.$tKey,this.$tValue,-2);d__.__4__this=this;return d__},getEnumerator:function(){return this.f().getEnumerator()},keys:function(){return new $$t.cg(this.$tKey,this.$tValue,this.$tKey,this,$$t.$b5.n($$t.$b4.$type.specialize(this.$tKey,this.$tValue),this.$tKey,this.f(),function(a){return a.key()}),this.g||$$t.$cd.defaultEqualityComparerValue(this.$tKey))},values:function(){return new $$t.cg(this.$tKey,this.$tValue,this.$tValue,this,$$t.$b5.n($$t.$b4.$type.specialize(this.$tKey,this.$tValue),this.$tValue,this.f(),function(a){return a.value()}),$$t.$cd.defaultEqualityComparerValue(this.$tValue))},$type:new $.ig.Type("Dictionary$2",$.ig.$ot,[$.ig.IDictionary$2.prototype.$type.specialize(0,1),$.ig.IDictionary.prototype.$type])},true);$c("Dictionary_EnumerableCollection$3:cg","Object",{$tKey:null,$tValue:null,$t:null,c:null,b:null,a:null,init:function($tKey,$tValue,$t,a,b,c){this.$tKey=$tKey;this.$tValue=$tValue;this.$t=$t;this.$type=this.$type.specialize(this.$tKey,this.$tValue,this.$t);$.ig.$op.init.call(this);this.c=b;this.b=c;this.a=a},count:function(){return this.a.count()},isReadOnly:function(){return true},add:function(a){throw new $$t.ch(0)},clear:function(){throw new $$t.ch(0)},contains:function(a){var c=this.c.getEnumerator();while(c.moveNext()){var b=c.current();if($.ig.$op.equalsStatic($d(this.$t,b),$d(this.$t,a))){return true}}return false},copyTo:function(a,b){var d=this.c.getEnumerator();while(d.moveNext()){var c=d.current();a[b++]=c}},remove:function(a){throw new $$t.ch(0)},getEnumerator:function(){return this.c.getEnumerator()},getEnumerator1:function(){return this.c.getEnumerator()},$type:new $.ig.Type("Dictionary_EnumerableCollection$3",$.ig.$ot,[$$t.$bj.$type.specialize(0)])},true);$c("EqualityComparer$1:cd","Object",{$t:null,init:function($t){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this)},defaultEqualityComparerValue:function($t){return new $$t.cf($t)},equalsC:function(a,b){},getHashCodeC:function(a){},equalsC:function(a,b){return this.equalsC($u(this.$t,a),$u(this.$t,b))},getHashCodeC:function(a){return this.getHashCodeC($u(this.$t,a))},$type:new $.ig.Type("EqualityComparer$1",$.ig.$ot,[$$t.$ce.$type,$$t.$cc.$type.specialize(0)])},true);$c("DefaultEqualityComparer$1:cf","EqualityComparer$1",{$t:null,init:function($t){this.$t=$t;this.$type=this.$type.specialize(this.$t);$$t.$cd.init.call(this,this.$t)},equalsC:function(a,b){return $.ig.$op.equalsStatic($d(this.$t,a),$d(this.$t,b))},getHashCodeC:function(a){return a.getHashCode()},$type:new $.ig.Type("DefaultEqualityComparer$1",$$t.$cd.$type.specialize(0))},true);$c("GenericEnumerable$1:ci","Object",{$t:null,a:null,init:function($t,a){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this);this.a=a},getEnumerator:function(){return new $$t.cj(this.$t,this.a().getEnumerator())},getEnumerator:function(){return new $$t.cj(this.$t,this.a().getEnumerator())},$type:new $.ig.Type("GenericEnumerable$1",$.ig.$ot,[$$t.$an.$type.specialize(0)])},true);$c("GenericEnumerator$1:cj","Object",{$t:null,a:null,init:function($t,a){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this);this.a=a},current:function(){return this.a.current()},moveNext:function(){return this.a.moveNext()},reset:function(){this.a.reset()},dispose:function(){},$type:new $.ig.Type("GenericEnumerator$1",$.ig.$ot,[$$t.$ao.$type.specialize(0)])},true);$c("INotifyCollectionChanged:cl","Object",{$type:new $.ig.Type("INotifyCollectionChanged",null)},true);$c("NotifyCollectionChangedEventArgs:cn","EventArgs",{init:function(a,b){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$$t.$co.init.call(this);this.f=b;this.c=new $$t.bh($.ig.$op.$type,0);this.b=new $$t.bh($.ig.$op.$type,0)},init1:function(a,b,c,d){$$t.$co.init.call(this);this.f=b;this.c=new $$t.bh($.ig.$op.$type,0);if(this.f==1||this.f==2){this.c.add(c);this.i=d}if(this.f!=1){this.b=function(){var $ret=new $$t.bh($.ig.$op.$type,0);$ret.add1(c);return $ret}()}else{this.b=new $$t.bh($.ig.$op.$type,0)}this.h=d},init2:function(a,b,c,d,e){$$t.$co.init.call(this);this.f=b;this.h=e;this.i=e;this.b=function(){var $ret=new $$t.bh($.ig.$op.$type,0);$ret.add1(c);return $ret}();this.c=function(){var $ret=new $$t.bh($.ig.$op.$type,0);$ret.add1(d);return $ret}()},f:0,action:function(){return this.f},b:null,newItems:function(){return this.b},h:0,newStartingIndex:function(){return this.h},c:null,oldItems:function(){return this.c},i:0,oldStartingIndex:function(){return this.i},$type:new $.ig.Type("NotifyCollectionChangedEventArgs",$$t.$co.$type)},true);$c("ObservableCollection$1:cs","List$1",{$t:null,init:function($t,a){this.$t=$t;this.$type=this.$type.specialize(this.$t);if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$$t.$bh.init.call(this,this.$t,0)},init1:function($t,a,b){this.$t=$t;this.$type=this.$type.specialize(this.$t);$$t.$bh.init1.call(this,this.$t,1,b)},init2:function($t,a,b){this.$t=$t;this.$type=this.$type.specialize(this.$t);$$t.$bh.init2.call(this,this.$t,2,b)},w:function(a,b){var c=this.__inner[a];$$t.$bh.w.call(this,a,b);if(this.propertyChanged!=null){this.ac(new $$t.cv("Item[]"))}if(this.collectionChanged!=null){var d=new $$t.cn(2,2,$d(this.$t,b),$d(this.$t,c),a);this.ab(d)}},o:function(){$$t.$bh.o.call(this);if(this.propertyChanged!=null){this.ac(new $$t.cv("Count"));this.ac(new $$t.cv("Item[]"))}if(this.collectionChanged!=null){var a=new $$t.cn(0,4);this.ab(a)}},q:function(a,b){$$t.$bh.q.call(this,a,b);if(this.propertyChanged!=null){this.ac(new $$t.cv("Count"));this.ac(new $$t.cv("Item[]"))}if(this.collectionChanged!=null){var c=new $$t.cn(1,0,$d(this.$t,b),a);this.ab(c)}},m:function(a){$$t.$bh.m.call(this,a);if(this.propertyChanged!=null){this.ac(new $$t.cv("Count"));this.ac(new $$t.cv("Item[]"))}if(this.collectionChanged!=null){var b=new $$t.cn(1,0,$d(this.$t,a),this.count()-1);this.ab(b)}},t:function(a){var b=this.__inner[a];$$t.$bh.t.call(this,a);if(this.propertyChanged!=null){this.ac(new $$t.cv("Count"));this.ac(new $$t.cv("Item[]"))}if(this.collectionChanged!=null){var c=new $$t.cn(1,1,$d(this.$t,b),a);this.ab(c)}},collectionChanged:null,propertyChanged:null,ac:function(a){if(this.propertyChanged!=null){this.propertyChanged(this,a)}},ab:function(a){if(this.collectionChanged!=null){this.collectionChanged(this,a)}},$type:new $.ig.Type("ObservableCollection$1",$$t.$bh.$type.specialize(0),[$$t.$cl.$type,$$t.$ct.$type])},true);$c("ReadOnlyCollection$1:bw","Object",{$t:null,init:function($t,a){this.$t=$t;this.$type=this.$type.specialize(this.$t);if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}this.c={};$.ig.$op.init.call(this)},init1:function($t,a,b){this.$t=$t;this.$type=this.$type.specialize(this.$t);this.c={};$.ig.$op.init.call(this);this.a=b},a:null,item:function(a,b){if(arguments.length===2){this.a.item(a,b);return b}else{return this.a.item(a)}},indexOf:function(a){return this.a.indexOf(a)},insert:function(a,b){},removeAt:function(a){},count:function(){return this.a.count()},isReadOnly:function(){return true},add:function(a){},clear:function(){},contains:function(a){return this.a.contains(a)},copyTo:function(a,b){this.a.copyTo(a,b)},remove:function(a){return false},getEnumerator:function(){return this.a.getEnumerator()},getEnumerator:function(){return this.a.getEnumerator()},isFixedSize:function(){return true},add1:function(a){return-1},contains1:function(a){return this.a.contains($u(this.$t,a))},indexOf1:function(a){return this.a.indexOf($u(this.$t,a))},insert1:function(a,b){},remove1:function(a){},copyTo1:function(a,b){this.a.copyTo(a,b)},b:function(){return this.a},isSynchronized:function(){return true},c:null,syncRoot:function(){return this.c},$type:new $.ig.Type("ReadOnlyCollection$1",$.ig.$ot,[$$t.$bi.$type.specialize(0),$.ig.IList.prototype.$type])},true);$c("NameValueCollection:c0","Object",{a:null,init:function(){$.ig.$op.init.call(this);this.a=new $$t.b1(String,String,0)},item:function(a,b){if(arguments.length===2){if(this.a.containsKey(a)){this.a.item(a,b)}else{this.a.add(a,b)}return b}else{if(this.a.containsKey(a)){return this.a.item(a)}else{return null}}},$type:new $.ig.Type("NameValueCollection",$.ig.$ot)},true);$c("Stack$1:c1","Object",{$t:null,init:function($t){this.$t=$t;this.$type=this.$type.specialize(this.$t);this.b=new $.ig.Array;$.ig.$op.init.call(this)},b:null,push:function(a){this.b.add($d(this.$t,a))},peek:function(){if(this.b.length<1){return $e(this.$t)}return $u(this.$t,this.b[this.b.length-1])},pop:function(){var a=this.b[this.b.length-1];this.b.removeAt(this.b.length-1);return $u(this.$t,a)},count:function(){return this.b.length},clear:function(){this.b.clear()},contains:function(a){return this.b.contains($d(this.$t,a))},getEnumerator:function(){return new $$t.c2(this.$t,this.b)},getEnumerator:function(){return new $$t.c2(this.$t,this.b)},$type:new $.ig.Type("Stack$1",$.ig.$ot,[$$t.$an.$type.specialize(0)])},true);$c("ReverseArrayEnumerator$1:c2","Object",{$t:null,b:0,a:null,init:function($t,a){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this);this.a=a;this.b=a.length},current:function(){return $u(this.$t,this.a[this.b])},current:function(){return this.a[this.b]},moveNext:function(){this.b--;return this.b>=0},reset:function(){this.b=this.a.length},dispose:function(){throw new $$t.by(0)},$type:new $.ig.Type("ReverseArrayEnumerator$1",$.ig.$ot,[$$t.$ao.$type.specialize(0)])},true);$c("IOrderedEnumerable$1:b8","Object",{$type:new $.ig.Type("IOrderedEnumerable$1",null,[$$t.$an.$type.specialize(0),$.ig.IEnumerable.prototype.$type])},true);$c("Enumerable:b5","Object",{init:function(){$.ig.$op.init.call(this)},t:function($tSource,a,b){var d__=new $.ig.Enumerable___Where__IteratorClass$1($tSource,-2);d__.__3__source=a;d__.__3__predicate=b;return d__},u:function($tSource,a,b){var d__=new $.ig.Enumerable___Where__IteratorClass1$1($tSource,-2);d__.__3__source=a;d__.__3__predicate=b;return d__},n:function($tSource,$tResult,a,b){var d__=new $.ig.Enumerable___Select__IteratorClass$2($tSource,$tResult,-2);d__.__3__source=a;d__.__3__selector=b;return d__},o:function($tSource,$tResult,a,b){var d__=new $.ig.Enumerable___SelectMany__IteratorClass$2($tSource,$tResult,-2);d__.__3__source=a;d__.__3__selector=b;return d__},k:function($tResult,a){var d__=new $.ig.Enumerable___OfType__IteratorClass$1($tResult,-2);d__.__3__source=a;return d__},ag:function($tSource,a){var b=$b($$t.$bi.$type.specialize($tSource),a);if(b!=null){return b.item(b.count()-1)}var c=$e($tSource);var e=a.getEnumerator();while(e.moveNext()){var d=e.current();c=d}return c},ac:function($tSource,a){var c=a.getEnumerator();while(c.moveNext()){var b=c.current();return b}return $e($tSource)},ad:function($tSource,a,b){var d=a.getEnumerator();while(d.moveNext()){var c=d.current();if(b(c)){return c}}return $e($tSource)},ae:function($tSource,a){var c=a.getEnumerator();while(c.moveNext()){var b=c.current();return b}return $e($tSource)},w:function($tSource,$tKey,a,b){var c=new $$t.b9($tSource,a);c.sort2(function(d,e){var f=d;var g=e;var h=b(f);var i=b(g);if($b($$t.$k.$type,h)!==null){return $b($$t.$k.$type,h).compareTo($d($tKey,i))}else{return $m($tKey,h).compareTo($m($tKey,i))}});return c},x:function($tSource,$tKey,a,b){var c=new $$t.b9($tSource,a);c.sort2(function(d,e){var f=e;var g=d;var h=b(f);var i=b(g);if($b($$t.$k.$type,h)!==null){return $b($$t.$k.$type,h).compareTo($d($tKey,i))}else{return $m($tKey,h).compareTo($m($tKey,i))}});return c},y:function($tSource,a){var b=new $$t.bh($tSource,1,a);return b},l:function(a,b){var d__=new $.ig.Enumerable___Range__IteratorClass(-2);d__.__3__startValue=a;d__.__3__count=b;return d__},h:function($tSource,a,b){var d__=new $.ig.Enumerable___Concat__IteratorClass$1($tSource,-2);d__.__3__source1=a;d__.__3__source2=b;return d__},aj:function(a){var b=true;var c=0;var e=a.getEnumerator();while(e.moveNext()){var d=e.current();if(b){b=false;c=d}else{c=Math.max(c,d)}}return c},ak:function($tSource,a,b){return $$t.$b5.aj($$t.$b5.n($tSource,$.ig.Number.prototype.$type,a,b))},al:function(a){var b=true;var c=0;var e=a.getEnumerator();while(e.moveNext()){var d=e.current();if(b){b=false;c=d}else{c=Math.min(c,d)}}return c},am:function($tSource,a,b){return $$t.$b5.aj($$t.$b5.n($tSource,$.ig.Number.prototype.$type,a,b))},ai:function($tSource,a){var b=0;var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b++}return b},m:function($tSource,a){var d__=new $.ig.Enumerable___Reverse__IteratorClass$1($tSource,-2);d__.__3__source=a;return d__},g:function($tResult,a){if(a==null){throw new $$t.cb(0,"source")}var b=$b($$t.$an.$type.specialize($tResult),a);if(b!=null){return b}var c=new $$t.bh($tResult,0);var e=a.getEnumerator();while(e.moveNext()){var d=e.current();if($b($tResult,d)!==null){c.add($u($tResult,d))}else{c.add($e($tResult))}}return c},r:function($tSource,a,b){var d__=new $.ig.Enumerable___Take__IteratorClass$1($tSource,-2);d__.__3__source=a;d__.__3__toTake=b;return d__},q:function($tSource,a,b){var d__=new $.ig.Enumerable___Skip__IteratorClass$1($tSource,-2);d__.__3__source=a;d__.__3__toSkip=b;return d__},c:function($tSource,a){var c=a.getEnumerator();while(c.moveNext()){var b=c.current();return true}return false},e:function($tSource,a,value_){var b=a.getEnumerator();
while(b.moveNext()){var item_=b.current();if(item_===value_){return true}}return false},s:function($tSource,a,b){return null},a:function($tSource,a){var b=$b($$t.$bh.$type.specialize($tSource),a);if(b!=null){return b.toArray()}b=new $$t.bh($tSource,1,a);return b.asArray()},ab:function($tSource,a,b){var c=$b($$t.$bi.$type.specialize($tSource),a);if(c!=null){return c.item(b)}return $$t.$b5.ac($tSource,$$t.$b5.q($tSource,a,b))},z:function(a){var b=0;var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b+=c}return b},aa:function($tSource,a,b){return $$t.$b5.z($$t.$b5.n($tSource,Number,a,b))},f:function($tSource,a,b){if(a==null){throw new $$t.cb(0,"first")}if(b==null){throw new $$t.cb(0,"second")}{var c=a.getEnumerator();try{var d=b.getEnumerator();try{while(c.moveNext()){if(!d.moveNext()||!$.ig.$op.equalsStatic($d($tSource,c.current()),$d($tSource,d.current()))){return false}}return d.moveNext()==false}finally{if(d!=null){d.dispose()}}}finally{if(c!=null){c.dispose()}}}},j:function($tSource){return new $.ig.Enumerable___Empty__IteratorClass$1($tSource,-2)},p:function($tSource,$tCollection,$tResult,a,b,c){var d__=new $.ig.Enumerable___SelectMany__IteratorClass1$3($tSource,$tCollection,$tResult,-2);d__.__3__source=a;d__.__3__collectionSelector=b;d__.__3__resultSelector=c;return d__},d:function($tSource,a,b){var d=a.getEnumerator();while(d.moveNext()){var c=d.current();if(b(c)){return true}}return false},af:function($tSource,a,b){var d=a.getEnumerator();while(d.moveNext()){var c=d.current();if(b(c)){return c}}return $e($tSource)},b:function($tSource,a,b){var d=a.getEnumerator();while(d.moveNext()){var c=d.current();if(b(c)==false){return false}}return true},ah:function($tSource,a){throw new $$t.by(0);var b=$b($$t.$bi.$type.specialize($tSource),a);if(b!=null){return b.count()==0?$e($tSource):b.item(b.count()-1)}var c=$e($tSource);var e=a.getEnumerator();while(e.moveNext()){var d=e.current();c=d}return c},v:function($tFirst,$tSecond,$tResult,a,b,c){throw new $$t.by(0)},i:function($tSource,a){throw new $$t.by(0);return null},$type:new $.ig.Type("Enumerable",$.ig.$ot)},true);$c("SortedList$1:b9","List$1",{$tElement:null,init:function($tElement,a){this.$tElement=$tElement;this.$type=this.$type.specialize(this.$tElement);$$t.$bh.init1.call(this,this.$tElement,1,a)},getEnumerator:function(){return $$t.$bh.getEnumerator.call(this)},$type:new $.ig.Type("SortedList$1",$$t.$bh.$type.specialize(0),[$$t.$b8.$type.specialize(0)])},true);$c("IArrayList:bl","Object",{$type:new $.ig.Type("IArrayList",null)},true);$c("AggregateException:dq","Error",{init:function(a){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$$t.$x.init.call(this,0)},init1:function(a,b){$$t.$x.init1.call(this,1,b)},init2:function(a,b,c){$$t.$x.init2.call(this,2,b,c)},$type:new $.ig.Type("AggregateException",$$t.$x.$type)},true);$c("APIFactory:dr","Object",{init:function(){$.ig.$op.init.call(this)},createPoint:function(a,b){return{__x:a,__y:b,$type:$.ig.Point.prototype.$type,getType:$.ig.Object.prototype.getType,getGetHashCode:$.ig.Object.prototype.getGetHashCode,typeName:$.ig.Object.prototype.typeName}},createRect:function(a,b,c,d){return new $$t.dt(0,a,b,c,d)},createSize:function(a,b){return new $$t.du(1,a,b)},createColor:function(a){var b=new $$t.dv;b.colorString(a);return b},$type:new $.ig.Type("APIFactory",$.ig.$ot)},true);$c("ArgumentException:be","Error",{init:function(a){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break;case 3:this.init3.apply(this,arguments);break}return}$$t.$x.init.call(this,0)},init1:function(a,b){$$t.$x.init1.call(this,1,b)},init2:function(a,b,c){$$t.$x.init1.call(this,1,b)},init3:function(a,b,c){$$t.$x.init2.call(this,2,b,c)},$type:new $.ig.Type("ArgumentException",$$t.$x.$type)},true);$c("ArgumentNullException:cb","Error",{init:function(a,b){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$$t.$x.init1.call(this,1,b+" cannot be null.")},init1:function(a){$$t.$x.init.call(this,0);throw new $$t.by(0)},init2:function(a,b,c){$$t.$x.init1.call(this,1,c);throw new $$t.by(0)},$type:new $.ig.Type("ArgumentNullException",$$t.$x.$type)},true);$c("AsyncCompletedEventArgs:dz","EventArgs",{d:null,b:false,f:null,init:function(a,b,c){$$t.$co.init.call(this);this.b=b;this.d=a;this.f=c},error:function(){return this.d},cancelled:function(){return this.b},userState:function(){return this.f},h:function(){if(this.error()!=null){throw this.error()}},$type:new $.ig.Type("AsyncCompletedEventArgs",$$t.$co.$type)},true);$c("Environment:d3","Object",{init:function(){$.ig.$op.init.call(this)},newLine:function(){return"\n"},$type:new $.ig.Type("Environment",$.ig.$ot)},true);$c("IComparable$1:bu","Object",{$type:new $.ig.Type("IComparable$1",null)},true);$c("InvalidOperationException:ch","Error",{init:function(a){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$$t.$x.init1.call(this,1,"Invalid operation")},init1:function(a,b){$$t.$x.init1.call(this,1,b)},init2:function(a,b,c){$$t.$x.init2.call(this,2,b,c);throw new $$t.by(0)},$type:new $.ig.Type("InvalidOperationException",$$t.$x.$type)},true);$c("ICredentials:eu","Object",{$type:new $.ig.Type("ICredentials",null)},true);$c("NetworkCredential:ev","Object",{init:function(a,b,c){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$$t.$ev.init1.call(this,1,b,c,String.empty())},init1:function(a,b,c,d){$.ig.$op.init.call(this);this.c(b);this.b(c);this.a(d)},getCredential:function(a,b){return this},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},$type:new $.ig.Type("NetworkCredential",$.ig.$ot,[$$t.$eu.$type])},true);$c("UploadStringCompletedEventArgs:ez","AsyncCompletedEventArgs",{i:null,init:function(a,b,c,d){$$t.$dz.init.call(this,b,c,d);this.i=a},result:function(){this.h();return this.i},$type:new $.ig.Type("UploadStringCompletedEventArgs",$$t.$dz.$type)},true);$c("WebClient:e0","Object",{init:function(){$.ig.$op.init.call(this);this.c(new $$t.e1)},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},uploadStringCompleted:null,h:function(a,b,c,d){var $self=this;this.e(a,b,c).i(function(e){if($self.uploadStringCompleted!=null){var f=null;var g=null;try{f=e.m()}catch(e_){g=e_}$self.uploadStringCompleted($self,new $$t.ez(f,g,e.g()==6,d))}})},e:function(a,b,c){var url_=a.value();var method_=b;var data_=c;var contentType_=this.c().item("Content-Type");var credentials_=this.a();var d=$.ig.util.ajax(url_,contentType_,data_,method_,credentials_);return new $$t.e2(String,d,null)},g:function(a,b,c,d){a.e(b)},f:function(a,b,c,d){a.d(new $$t.x(1,d))},$type:new $.ig.Type("WebClient",$.ig.$ot)},true);$c("WebHeaderCollection:e1","NameValueCollection",{init:function(){$$t.$c0.init.call(this)},$type:new $.ig.Type("WebHeaderCollection",$$t.$c0.$type)},true);$c("FaultCode:fr","Object",{init:function(a){$.ig.$op.init.call(this);this.a(a)},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},$type:new $.ig.Type("FaultCode",$.ig.$ot)},true);$c("FaultException:fs","Error",{init:function(a,b,c){$$t.$x.init.call(this,0);this.reason(a);this.code(b);this.action(c)},_action:null,action:function(a){if(arguments.length===1){this._action=a;return a}else{return this._action}},_code:null,code:function(a){if(arguments.length===1){this._code=a;return a}else{return this._code}},_reason:null,reason:function(a){if(arguments.length===1){this._reason=a;return a}else{return this._reason}},$type:new $.ig.Type("FaultException",$$t.$x.$type)},true);$c("FaultException$1:fu","FaultException",{$tDetail:null,init:function($tDetail,a,b,c,d){this.$tDetail=$tDetail;this.$type=this.$type.specialize(this.$tDetail);$$t.$fs.init.call(this,b,c,d);this.detail(a)},_detail:null,detail:function(a){if(arguments.length===1){this._detail=a;return a}else{return this._detail}},$type:new $.ig.Type("FaultException$1",$$t.$fs.$type)},true);$c("FaultReason:ft","Object",{a:null,init:function(a){$.ig.$op.init.call(this);this.a=a},toString:function(){return this.a},$type:new $.ig.Type("FaultReason",$.ig.$ot)},true);$c("StringBuilder:et","Object",{_internal:null,internal:function(a){if(arguments.length===1){this._internal=a;return a}else{return this._internal}},init:function(a){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$.ig.$op.init.call(this);this.internal("")},init1:function(a,b){$$t.$et.init.call(this,0)},init2:function(a,b){$.ig.$op.init.call(this);this.internal(b)},j:function(a){if(a!=null){this.k(a.toString())}return this},k:function(str_){if(str_!=null){this._internal=this._internal.concat(str_)}return this},m:function(a){var str_=a.toString();this._internal=this._internal.concat(str_);return this},h:function(chr_){this._internal=this._internal.concat(chr_);return this},i:function(value_){this._internal=this._internal.concat(value_);return this},l:function(value_,startIndex_,count_){this._internal=this._internal.concat(value_.substr(startIndex_,count_));return this},g:function(value_,startIndex_,charCount_){this._internal=this._internal.concat(value_.slice(startIndex_,startIndex_+charCount_).join(""));return this},s:function(){return this.t("")},t:function(str_){if(str_!=null){this._internal=this._internal.concat(str_)}this._internal=this._internal.concat($.ig.Environment.prototype.newLine());return this},u:function(){this.internal("");return this},v:function(index_,chr_){if(index_==this.c()){this.h(chr_)}else{this._internal=this._internal.substring(0,index_).concat(chr_).concat(this._internal.substring(index_,this._internal.length))}return this},w:function(index_,str_){if(index_==this.c()){this.k(str_)}else{this._internal=this._internal.substring(0,index_).concat(str_).concat(this._internal.substring(index_,this._internal.length))}return this},x:function(startIndex_,length_){this._internal=this._internal.substring(0,startIndex_).concat(this._internal.substring(startIndex_+length_,this._internal.length));return this},toString:function(){return this.internal()},f:function(a,b){return this.internal().substr(a,b)},c:function(a){if(arguments.length===1){if(a<=this.c()){this._internal=this._internal.substring(0,a)}else{throw new $$t.by(0)}return a}else{return this.internal().length}},item:function(index_,a){if(arguments.length===2){this._internal=this._internal.substring(0,index_).concat(a).concat(this._internal.substring(index_+1,this._internal.length));return a}else{return this.internal().charAt(index_)}},p:function(a,b){return this.k($8(a,b))},o:function(a,b){return this.k($9(a,b))},n:function(a,b,c){return this.k($aa(a,b,c))},q:function(a,b,c){return this.k($8(a,b,c))},r:function(a,b,c,d){return this.k($8(a,b,c,d))},_b:0,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},$type:new $.ig.Type("StringBuilder",$.ig.$ot)},true);$c("NotImplementedException:by","Error",{init:function(a){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$$t.$x.init1.call(this,1,"not implemented")},init1:function(a,b){$$t.$x.init1.call(this,1,b);throw new $$t.by(0)},$type:new $.ig.Type("NotImplementedException",$$t.$x.$type)},true);$c("Encoding:eh","Object",{init:function(){$.ig.$op.init.call(this)},uTF8:function(){if($$t.$eh.t==null){$$t.$eh.t=new $$t.eg(1)}return $$t.$eh.t},uTF8Unmarked:function(){if($$t.$eh.s==null){$$t.$eh.s=new $$t.eg(1)}return $$t.$eh.s},unicode:function(){if($$t.$eh.r==null){$$t.$eh.r=new $$t.ei(0)}return $$t.$eh.r},getString1:function(a,b,c){return""},getBytes2:function(a,b,c,d,e){},getBytes:function(a,b,c){var d=new Array(this.getByteCount(a,b,c));this.getBytes2(a,b,c,d,0);return d},getBytes1:function(a){if(a==null){throw new $$t.cb(0,"input")}var b=new Array(a.length);for(var c=0;c<a.length;c++){b[c]=a.charAt(c)}return this.getBytes(b,0,b.length)},getByteCount:function(a,b,c){},getString:function(a){return this.getString1(a,0,a.length)},getCharCount:function(a){if(a==null){throw new $$t.cb(0,"bytes")}return this.getCharCount1(a,0,a.length)},getCharCount1:function(a,b,c){throw new $$t.by(0)},getChars:function(a,b,c,d,e){throw new $$t.by(0)},aSCII:function(){if($$t.$eh.p==null){$$t.$eh.p=new $$t.ej(1)}return $$t.$eh.p},getDecoder:function(){return new $$t.el(this)},getBytes3:function(a,b,c,d,e){return this.getBytes2($.ig.util.toCharArray(a),b,c,d,e)},getMaxCharCount:function(a){return a},getMaxByteCount:function(a){return a+1},getPreamble:function(){return new Array(0)},bigEndianUnicode:function(){if($$t.$eh.q==null){$$t.$eh.q=new $$t.ei(1,true,false)}return $$t.$eh.q},defaultValue:function(){return $$t.$eh.aSCII()},getEncoding:function(a){switch(a.toUpperCase()){case"ASCII":return $$t.$eh.aSCII();case"UNICODE":return $$t.$eh.unicode();case"UTF-8":return $$t.$eh.uTF8();default:throw new $$t.be(1,"'"+a+"' is not a valid encoding name.")}},webName:function(){throw new $$t.by(0);return null},$type:new $.ig.Type("Encoding",$.ig.$ot)},true);$c("UnicodeEncoding:ei","Encoding",{ab:false,getString1:function(bytes_,a,b){var c="";var d=a+b;for(var i_=a;i_<d;i_=i_+2){if(i_+1>=d){c=c+"�"}else{var e;var f;if(this.ab){e=bytes_[i_+1].toString(16);f=bytes_[i_].toString(16)}else{e=bytes_[i_].toString(16);f=bytes_[i_+1].toString(16)}if(e.length==1){e="0"+e}if(f.length==1){f="0"+f}var g=$.ig.Number.prototype.parseInt(f+e,16);c=c+String.fromCharCode(g)}}return c},getCharCount1:function(a,b,c){return $a(c,2)},getBytes:function(a,b,c){return $$t.$eh.getBytes.call(this,a,b,c)},getBytes1:function(a){var b=new Array(a.length*2);this.getBytes3(a,0,a.length,b,0);return b},init:function(a){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$$t.$eh.init.call(this)},init1:function(a,b,c){$$t.$eh.init.call(this);this.ab=b},getMaxByteCount:function(a){return(a+1)*2},getMaxCharCount:function(a){return $.ig.truncate(Math.ceil(a/2))+1},getBytes3:function(a,b,c,d,e){for(var f=b;f<b+c;f++){var g=a.charCodeAt(f);var h=g&255;var i=g>>8&255;if(this.ab){d[e++]=i;d[e++]=h}else{d[e++]=h;d[e++]=i}}return c*2},getByteCount:function(a,b,c){throw new $$t.by(0);return 0},getBytes2:function(a,b,c,d,e){throw new $$t.by(0);return 0},getChars:function(a,b,c,d,e){throw new $$t.by(0)},$type:new $.ig.Type("UnicodeEncoding",$$t.$eh.$type)},true);$c("UTF8Encoding:eg","Encoding",{init:function(a,b,c){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$$t.$eh.init.call(this)},init1:function(a){$$t.$eh.init.call(this)},getString1:function(a,b,c){var d="";var e=b;var f=0;var g=0;var h=0;while(e<b+c){f=a[e++];if(f<128){d+=$t(f)}else if(f>191&&f<224){if(e>=b+c){throw new $$t.ch(1,"UTF-8 decoding error.")}g=a[e++];d+=$t((f&31)<<6|g&63)}else{if(e+1>=b+c){throw new $$t.ch(1,"UTF-8 decoding error.")}g=a[e++];h=a[e++];d+=$t((f&15)<<12|(g&63)<<6|h&63)}}return d},getCharCount1:function(a,b,c){return c},getByteCount:function(a,b,c){throw new $$t.by(0);return 0},getBytes2:function(chars_,charIndex_,charCount_,a,b){var inputUTF8_=unescape(encodeURIComponent(chars_.slice(charIndex_,charIndex_+charCount_).join("")));for(var i_=0;i_<inputUTF8_.length;i_++){a[b+i_]=inputUTF8_.charCodeAt(i_)}return inputUTF8_.length},getBytes:function(a,b,c){return $$t.$eh.getBytes.call(this,a,b,c)},getBytes1:function(input_){var a=new Array(input_.length);var inputUTF8_=unescape(encodeURIComponent(input_));for(var i_=0;i_<inputUTF8_.length;i_++){a[i_]=inputUTF8_.charCodeAt(i_)}return a},getChars:function(a,b,c,d,e){var f=e;var g=b;var h=0;var i=0;var j=0;while(g<b+c){h=a[g++];if(h<128){d[e++]=$t(h)}else if(h>191&&h<224){if(g>=b+c){throw new $$t.ch(1,"UTF-8 decoding error.")}i=a[g++];d[e++]=$t((h&31)<<6|i&63)}else{if(g+1>=b+c){throw new $$t.ch(1,"UTF-8 decoding error.")}i=a[g++];j=a[g++];d[e++]=$t((h&15)<<12|(i&63)<<6|j&63)}}return e-f},getDecoder:function(){return new $$t.em(this)},getMaxByteCount:function(a){return(a+1)*3},getMaxCharCount:function(a){return a+1},$type:new $.ig.Type("UTF8Encoding",$$t.$eh.$type)},true);$c("Decoder:ek","Object",{init:function(){$.ig.$op.init.call(this)},e:function(a,b,c,d,e,f,g,h,i,j){throw new $$t.by(0);h=0;i=0;j=false;return{p7:h,p8:i,p9:j}},a:function(a,b,c){},b:function(a,b,c,d){throw new $$t.by(0);return 0},c:function(a,b,c,d,e){},d:function(a,b,c,d,e,f){throw new $$t.by(0);return 0},f:function(){throw new $$t.by(0)},$type:new $.ig.Type("Decoder",$.ig.$ot)},true);$c("UTF8Encoding_UTF8Decoder:em","Decoder",{g:0,h:0,i:0,j:null,init:function(a){$$t.$ek.init.call(this);this.j=a},a:function(a,b,c){return this.b(a,b,c,false)},b:function(a,b,c,d){var e=0;var f=b;while(f<b+c){if(this.g==0){this.g=a[f++]}if(this.g<128){e++}else{if(f>=b+c){break}if(this.h==0){this.h=a[f++]}if(this.g>191&&this.g<224){e++}else{if(f>=b+c){break}if(this.i==0){this.i=a[f++]}e++;this.i=0}this.h=0}this.g=0}if(d){this.g=0;this.h=0;this.i=0}return e},c:function(a,b,c,d,e){return this.d(a,b,c,d,e,false)},d:function(a,b,c,d,e,f){var g=e;var h=b;while(h<b+c){if(this.g==0){this.g=a[h++]}if(this.g<128){d[e++]=$t(this.g)}else{if(h>=b+c){break}if(this.h==0){this.h=a[h++]}if(this.g>191&&this.g<224){d[e++]=$t((this.g&31)<<6|this.h&63)}else{if(h>=b+c){break}if(this.i==0){this.i=a[h++]}d[e++]=$t((this.g&15)<<12|(this.h&63)<<6|this.i&63);this.i=0}this.h=0}this.g=0}if(f){this.g=0;this.h=0;this.i=0}return e-g},$type:new $.ig.Type("UTF8Encoding_UTF8Decoder",$$t.$ek.$type)},true);$c("AsciiEncoding:ej","Encoding",{init:function(a,b,c){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$$t.$eh.init.call(this)},init1:function(a){$$t.$eh.init.call(this)},getString1:function(bytes_,a,b){var ret_="";for(var i_=a;i_<a+b;i_++){if(bytes_[i_]==0){break}ret_=ret_+String.fromCharCode(bytes_[i_])}return ret_},getCharCount1:function(a,b,c){return c},getByteCount:function(a,b,c){return c},getBytes2:function(a,b,c,d,e){throw new $$t.by(0)},getBytes:function(a,b,c){return $$t.$eh.getBytes.call(this,a,b,c)},getBytes1:function(input_){var a=new Array(input_.length);for(var i_=0;i_<input_.length;i_++){a[i_]=input_.charCodeAt(i_)}return a},getChars:function(bytes_,byteIndex_,a,b,c){var d=c;var ret_="";for(var i_=0;i_<a;i_++){if(bytes_[i_]==0){break}b[c++]=String.fromCharCode(bytes_[byteIndex_++])}return c-d},$type:new $.ig.Type("AsciiEncoding",$$t.$eh.$type)},true);$c("DefaultDecoder:el","Decoder",{g:null,init:function(a){$$t.$ek.init.call(this);this.g=a},a:function(a,b,c){return this.b(a,b,c,false)},b:function(a,b,c,d){return this.g.getCharCount1(a,b,c)},c:function(a,b,c,d,e){return this.d(a,b,c,d,e,false)},d:function(a,b,c,d,e,f){return this.g.getChars(a,b,c,d,e)},$type:new $.ig.Type("DefaultDecoder",$$t.$ek.$type)},true);$c("Task:e3","Object",{_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_b:false,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},init:function(a,b){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$$t.$e3.init1.call(this,1,b,null)},init1:function(a,b,c){var $self=this;$.ig.$op.init.call(this);var d=function(){};var e=function(f){if(f==null){$self.b(true)}else{$self.a(new $$t.dq(2,"Exception occurred during task execution",f))}};this.c(b.done(d).fail(e));this.d(c)},g:function(){if(this.b()){return 6}switch(this.c().state()){case"pending":return 0;case"resolved":return 5;case"rejected":return 7;default:return 0}},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},e:function(a){var $self=this;var b=function(){a($self)};var c=function(d){a($self)};var d=this.c().done(b).fail(c);return new $$t.e3(0,d)},f:function($tNewResult,a){var $self=this;var b=new $$t.e7($tNewResult,0);var c=function(){try{var d=a($self);b.e(d)}catch(e_){b.d(e_)}};var d=function(e){c()};var e=function(f){c()};this.c().done(d).fail(e);return b.b()},$type:new $.ig.Type("Task",$.ig.$ot)},true);$c("Task$1:e2","Task",{$tResult:null,init:function($tResult,a,b){var $self=this;this.$tResult=$tResult;this.$type=this.$type.specialize(this.$tResult);this.h=false;$$t.$e3.init1.call(this,1,a,b);var c=function(d){var e=$u($self.$tResult,d);$self.l=e;$self.h=true};var d=function(e){$self.h=true};this.c().done(c).fail(d)},h:false,l:null,m:function(){if(!this.h){throw"Result is not ready yet"}if(this.a()!=null){throw this.a()}return this.l},i:function(a){return $$t.$e3.e.call(this,function(b){a(b)})},j:function($tNewResult,a){var b=function(c){return $d($tNewResult,a(c))};return this.k($.ig.$op.$type,b).k($tNewResult,function(c){return $u($tNewResult,c.m())})},k:function($tNewResult,a){return $$t.$e3.f.call(this,$tNewResult,a)},$type:new $.ig.Type("Task$1",$$t.$e3.$type)},true);$c("TaskCompletionSource$1:e7","Object",{$tResult:null,_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},init:function($tResult,a){this.$tResult=$tResult;this.$type=this.$type.specialize(this.$tResult);if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$$t.$e7.init1.call(this,this.$tResult,1,null)},init1:function($tResult,a,b){this.$tResult=$tResult;this.$type=this.$type.specialize(this.$tResult);$.ig.$op.init.call(this);this.a($.ig.util.deferred());this.b(new $$t.e2(this.$tResult,this.a().promise(),b))},c:function(){this.a().reject(null)},d:function(a){this.a().reject(a)},e:function(a){this.a().resolve($d(this.$tResult,a))},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},$type:new $.ig.Type("TaskCompletionSource$1",$.ig.$ot)},true);$c("TaskFactory:f4","Object",{init:function(){$.ig.$op.init.call(this)},c:function(a,b){return new $$t.e3(0,this.b(this.a(a)).always(function(){b(a)}))},d:function($tResult,a,b){var c=new $$t.e7($tResult,0);this.b(this.a(a)).always(function(){try{var d=b(a);c.e(d)}catch(e_){c.d(e_)}});return c.b()},e:function($tAntecedentResult,$tResult,a,b){var c=function(d){return $d($tResult,b(d))};return this.d($.ig.$op.$type,a,c).j($tResult,function(d){return $u($tResult,d.m())})},a:function(a){var b=new Array(a.length);for(var c=0;c<a.length;c++){b[c]=a[c].c()}return b},b:function(a){var promises_=a;var b=function(p){function whenAll(){var whenDeffered=$.ig.util.deferred();if(arguments.length===0){whenDeffered.resolve();return whenDeffered}var count=arguments.length;var resolve=true;for(var i=0;i<arguments.length;i++){arguments[i].done(function(){resolve=resolve&&true}).fail(function(){resolve=resolve&&false}).always(function(){count--;if(count<=0){if(resolve){whenDeffered.resolve()}else{whenDeffered.reject()}}})}return whenDeffered}return whenAll.apply($,p)}(promises_);return b},$type:new $.ig.Type("TaskFactory",$.ig.$ot)},true);$c("Tuple$2:f5","Object",{$t1:null,$t2:null,_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},init:function($t1,$t2,a,b){this.$t1=$t1;this.$t2=$t2;this.$type=this.$type.specialize(this.$t1,this.$t2);$.ig.$op.init.call(this);this.a(a);this.b(b)},$type:new $.ig.Type("Tuple$2",$.ig.$ot)},true);$c("Uri:ew","Object",{init:function(a,b){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break;case 3:this.init3.apply(this,arguments);break}return}$$t.$ew.init2.call(this,2,b,1,true)},init1:function(a,b,c){$$t.$ew.init2.call(this,2,b,c,true)},init2:function(a,b,c,d){$.ig.$op.init.call(this);this.value(b)},_value:null,value:function(a){if(arguments.length===1){this._value=a;return a}else{return this._value}},isAbsoluteUri:function(){var a=this.value();var b=a.length;if(b!=0&&$ag(a.charAt(0))){for(var c=1;c<b;c++){var d=a.charAt(c);if(d==":"){return true}if(d!="+"&&d!="-"&&d!="."&&!$ai(d)){break}}}return false},scheme:function(){var a=this.value();var b=a.length;if(b!=0&&$ag(a.charAt(0))){for(var c=1;c<b;c++){var d=a.charAt(c);if(d==":"){return a.substr(0,c)}if(d!="+"&&d!="-"&&d!="."&&!$ai(d)){break}}}throw new $$t.ch(1,"The scheme cannot be obtained from a relative Uri.")},encodeURIComponent:function(a){return null},escapeUriString:function(a){if(/^([A-Z]:)|(\\\\)/i.test(a)){return a}return encodeURI(a)},tryCreate:function(a,b,c){if($$t.$ew.isWellFormedUriString(a,b)){c=new $$t.ew(2,a,b,false);return{ret:true,p2:c}}c=null;return{ret:false,p2:c}},isWellFormedUriString:function(a,b){switch(b){case 1:if(!/^(((http|ftp|https):\/\/[\w-]+(\.[\w-]*)+)|(file:\/\/\/?))([\w\\$()!'.,@?^=%&amp;:\/~+#-]*[\w@?^=%&amp;\/~+#-])?$/i.test(a)){return false}break;case 2:if(!/^([\w\\$()!'.,@?^=%&amp;:\/~+#-]*[\w@?^=%&amp;\/~+#-])?$/i.test(a)){return false}break;default:case 0:if(!/^((((http|ftp|https):\/\/[\w-]+(\.[\w-]*)+)|(file:\/\/\/?)))?([\w\\$()!'.,@?^=%&amp;:\/~+#-]*[\w@?^=%&amp;\/~+#-])?$/i.test(a)){return false}break}return true},toString:function(){if(/^([A-Z]:)|(\\\\)/i.test(this.value())){return this.value()}var a=decodeURI(this.value());if(/^(http|ftp|https):\/\/[\w-]+(\.[\w-]*)+?$/i.test(a)){a+="/"}return a},init3:function(a,b,c){$.ig.$op.init.call(this);throw new $$t.by(0)},absolutePath:function(){throw new $$t.by(0);return null},absoluteUri:function(){throw new $$t.by(0);return null},localPath:function(){var a=/^(((http|ftp|https):\/\/[\w-]+(\.[\w-]*)+)|(file:\/\/\/?))([\w\\$()!'.,@?^=%&amp;:\/~+#-]*[\w@?^=%&amp;\/~+#-])?$/i.exec(this.value());if(a==null){throw new $$t.ch(0)}if(a[6]!=null){return decodeURI(a[6])}return"/"},originalString:function(){return this.value()},isWellFormedOriginalString:function(){throw new $$t.by(0);return false},$type:new $.ig.Type("Uri",$.ig.$ot)},true);$c("JavaScriptSerializer:f8","Object",{init:function(){$.ig.$op.init.call(this)},a:function(a){var text_=a;return JSON.parse(text_)},b:function(a){var value_=a;return JSON.stringify(value_)},$type:new $.ig.Type("JavaScriptSerializer",$.ig.$ot)},true);$c("XObject:h6","Object",{init:function(a){$.ig.$op.init.call(this);this.backingNode(a)},_backingNode:null,backingNode:function(a){if(arguments.length===1){this._backingNode=a;return a}else{return this._backingNode}},c:function(){},toString:function(){if(this.backingNode()!=null){return $$t.$ig.xmlNodeToString(this.backingNode())}else{return""}},$type:new $.ig.Type("XObject",$.ig.$ot)},true);$c("XAttribute:ih","XObject",{init:function(a){$$t.$h6.init.call(this,a)},e:function(a){this.backingNode(this.backingNode().cloneNode(true));a.setAttributeNode(this.backingNode())},c:function(){return 2},d:function(){return $$t.$ig.b(this.backingNode())},$type:new $.ig.Type("XAttribute",$$t.$h6.$type)},true);$c("XNode:ii","XObject",{init:function(a){$$t.$h6.init.call(this,a)},$type:new $.ig.Type("XNode",$$t.$h6.$type)},true);$c("XContainer:ij","XNode",{init:function(a){$$t.$ii.init.call(this,a)},h:function(a){var b=null;var c=this.backingNode();var d=c.childNodes;var e=d.length;var f=a.c();var g=a.d();for(var h=0;h<e;h++){var i=d.item(h);if(i.namespaceURI==g&&i.nodeType==1&&$$t.$ig.d(i)==f){b=i}}if(b==null){return null}else{return new $$t.ik(0,b)}},d:function(){return this.f(null)},e:function(a){return this.f(a)},f:function(a){var b=new $$t.bh($$t.$ik.$type,0);for(var c=0;c<this.backingNode().childNodes.length;c++){var d=this.backingNode().childNodes.item(c);if(d.nodeType==1){var e=false;if(a!=null){if($$t.$ig.d(d)==a.c()&&d.namespaceURI==a.d()){e=true}}else{e=true}if(e){b.add(new $$t.ik(0,d))}}}return b},g:function(a){var b=this.backingNode();var c;if($b($$t.$io.$type,this)!==null){c=this.backingNode()}else{c=this.backingNode().ownerDocument}if($b($$t.$ih.$type,a)!==null){a.e(b)}else if($b($$t.$ik.$type,a)!==null){a.j(b,c)}},$type:new $.ig.Type("XContainer",$$t.$ii.$type)},true);$c("XDocument:io","XContainer",{init:function(a,b){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$$t.$ij.init.call(this,b)},init1:function(a){$$t.$ij.init.call(this,$$t.$ig.j())},c:function(){return 9},i:function(a){return new $$t.io(0,$$t.$ig.n(a))},$type:new $.ig.Type("XDocument",$$t.$ij.$type)},true);$c("XElement:ik","XContainer",{init:function(a,b){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$$t.$ij.init.call(this,b)},init1:function(a,b){$$t.$ik.init2.call(this,2,b,null)},init2:function(a,b,c){$$t.$ij.init.call(this,$$t.$ig.o(b.c(),b.d()));var d=c==null?"":c.toString();this.i(d)},i:function(a){if(arguments.length===1){$$t.$ig.h(this.backingNode(),a);return a}else{return $$t.$ig.c(this.backingNode())}},c:function(){return 1},l:function(){return $$t.$il.e($$t.$ig.d(this.backingNode()),this.backingNode().namespaceURI)},k:function(a){return new $$t.ih($$t.$ig.i(this.backingNode(),a.c(),a.d()))},j:function(a,b){if(this.backingNode().ownerDocument!=b){this.backingNode($$t.$ig.p(b,this.backingNode()))}a.appendChild(this.backingNode())},$type:new $.ig.Type("XElement",$$t.$ij.$type)},true);$c("XmlUtils:ig","Object",{init:function(){$.ig.$op.init.call(this)},a:function(){return!!window.DOMParser},m:function(a){var text_=a;return(new DOMParser).parseFromString(text_,"text/xml")},l:function(a){var text_=a;return function(xml){var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");xmlDoc.async=false;xmlDoc.loadXML(xml);return xmlDoc}(text_)},f:function(a){var node_=a;return(new XMLSerializer).serializeToString(node_)},e:function(a){var node_=a;return node_.xml},k:function(){return new ActiveXObject("Microsoft.XMLDOM")},n:function(a){if($$t.$ig.a()){return $$t.$ig.m(a)}else{return $$t.$ig.l(a)}},xmlNodeToString:function(a){if($$t.$ig.a()){return $$t.$ig.f(a)}else{return $$t.$ig.e(a)}},j:function(){var a;if($$t.$ig.a()){a=$$t.$ig.m("<dummy/>");a.removeChild(a.documentElement)}else{a=$$t.$ig.k()}return a},o:function(a,b){var doc_=$$t.$ig.j();if($$t.$ig.a()){return doc_.createElementNS(b,a)}else{var name_=a;var namespaceURI_=b;return doc_.createNode(1,name_,namespaceURI_)}},c:function(a){if($$t.$ig.a()){return a.textContent}else{var node_=a;return node_.text}},h:function(a,b){if($$t.$ig.a()){a.textContent=b}else{var node_=a;var text_=b;node_.text=text_}},p:function(a,b){if($$t.$ig.a()){return a.importNode(b,true)}else{return b}},d:function(a){if($$t.$ig.a()){return a.localName}else{var node_=a;return node_.baseName}},i:function(a,b,c){if($$t.$ig.a()){return a.getAttributeNodeNS(c,b)}else{var elem_=a;var ln_=b;var nn_=c;return elem_.attributes.getQualifiedItem(ln_,nn_)}},b:function(a){if($$t.$ig.a()){return a.nodeValue}else{var attr_=a;return attr_.value}},$type:new $.ig.Type("XmlUtils",$.ig.$ot)},true);$c("XName:il","Object",{a:null,b:null,init:function(a,b){$.ig.$op.init.call(this);this.a=a;this.b=b},c:function(){return this.a},d:function(){return this.b},f:function(){return $$t.$im.c(this.b)},e:function(a,b){return new $$t.il(a,b)},$type:new $.ig.Type("XName",$.ig.$ot)},true);$c("XNamespace:im","Object",{a:null,init:function(a){$.ig.$op.init.call(this);this.a=a},c:function(a){return new $$t.im(a)},d:function(){return $$t.$im.c("http://www.w3.org/2000/xmlns/")},b:function(){return this.a},$type:new $.ig.Type("XNamespace",$.ig.$ot)},true);$c("Enumerable___Skip__IteratorClass$1:Enumerable___Skip__IteratorClass$1","Object",{$tSource:null,f:0,d:null,c:null,e:null,b:null,__3__source:null,h:0,__3__toSkip:0,init:function($tSource,a){this.$tSource=$tSource;this.$type=this.$type.specialize(this.$tSource);$.ig.$op.init.call(this);this.f=a},i:function(){this.f=-1;if(this.c!=null){this.c.dispose()}},moveNext:function(){var __hasError__=false;try{while(this.f>=0){switch(this.f){case 0:this.f=1;this.c=this.b.getEnumerator();this.f=2;break;case 2:this.f=1;
if(this.c.moveNext()){this.e=this.c.current();if(this.h<=0){this.d=this.e;this.f=2;return true}this.h--;this.f=2;break}this.i();break}}}catch(a){__hasError__=true;throw a}finally{if(__hasError__){this.dispose()}}return false},getEnumerator:function(){var d__;if(this.f==-2){this.f=0;d__=this}else{d__=new $.ig.Enumerable___Skip__IteratorClass$1(this.$tSource,0)}d__.b=this.__3__source;d__.h=this.__3__toSkip;return d__},reset:function(){throw new $$t.w(1)},dispose:function(){switch(this.f){case 1:case 2:this.i();break}},current:function(){return this.d},current1:function(){return $d(this.$tSource,this.d)},$type:new $.ig.Type("Enumerable___Skip__IteratorClass$1",$.ig.$ot,[$$t.$an.$type.specialize(0),$.ig.IEnumerable.prototype.$type,$$t.$ao.$type.specialize(0),$.ig.IEnumerator.prototype.$type,$$t.$ap.$type])},true);$c("Enumerable___Take__IteratorClass$1:Enumerable___Take__IteratorClass$1","Object",{$tSource:null,f:0,d:null,c:null,e:null,b:null,__3__source:null,h:0,__3__toTake:0,init:function($tSource,a){this.$tSource=$tSource;this.$type=this.$type.specialize(this.$tSource);$.ig.$op.init.call(this);this.f=a},i:function(){this.f=-1;if(this.c!=null){this.c.dispose()}},moveNext:function(){var __hasError__=false;try{while(this.f>=0){switch(this.f){case 0:this.f=1;this.c=this.b.getEnumerator();this.f=2;break;case 2:this.f=1;if(this.c.moveNext()){this.e=this.c.current();if(this.h>0){this.h--;this.d=this.e;this.f=2;return true}return false}this.i();break}}}catch(a){__hasError__=true;throw a}finally{if(__hasError__){this.dispose()}}return false},getEnumerator:function(){var d__;if(this.f==-2){this.f=0;d__=this}else{d__=new $.ig.Enumerable___Take__IteratorClass$1(this.$tSource,0)}d__.b=this.__3__source;d__.h=this.__3__toTake;return d__},reset:function(){throw new $$t.w(1)},dispose:function(){switch(this.f){case 1:case 2:this.i();break}},current:function(){return this.d},current1:function(){return $d(this.$tSource,this.d)},$type:new $.ig.Type("Enumerable___Take__IteratorClass$1",$.ig.$ot,[$$t.$an.$type.specialize(0),$.ig.IEnumerable.prototype.$type,$$t.$ao.$type.specialize(0),$.ig.IEnumerator.prototype.$type,$$t.$ap.$type])},true);$c("Enumerable___SelectMany__IteratorClass1$3:Enumerable___SelectMany__IteratorClass1$3","Object",{$tSource:null,$tCollection:null,$tResult:null,l:0,j:null,c:null,k:null,d:null,i:null,b:null,__3__source:null,g:null,__3__collectionSelector:null,h:null,__3__resultSelector:null,init:function($tSource,$tCollection,$tResult,a){this.$tSource=$tSource;this.$tCollection=$tCollection;this.$tResult=$tResult;this.$type=this.$type.specialize(this.$tSource,this.$tCollection,this.$tResult);$.ig.$op.init.call(this);this.l=a},m:function(){this.l=-1;if(this.c!=null){this.c.dispose()}},n:function(){this.l=1;if(this.d!=null){this.d.dispose()}},moveNext:function(){var __hasError__=false;try{while(this.l>=0){switch(this.l){case 0:this.l=1;this.c=this.b.getEnumerator();this.l=2;break;case 2:this.l=1;if(this.c.moveNext()){this.k=this.c.current();this.l=3;this.d=this.g(this.k).getEnumerator();this.l=4;break}this.m();break;case 4:this.l=3;if(this.d.moveNext()){this.i=this.d.current();this.j=this.h(this.k,this.i);this.l=4;return true}this.n();this.l=2;break}}}catch(a){__hasError__=true;throw a}finally{if(__hasError__){this.dispose()}}return false},getEnumerator:function(){var d__;if(this.l==-2){this.l=0;d__=this}else{d__=new $.ig.Enumerable___SelectMany__IteratorClass1$3(this.$tSource,this.$tCollection,this.$tResult,0)}d__.b=this.__3__source;d__.g=this.__3__collectionSelector;d__.h=this.__3__resultSelector;return d__},reset:function(){throw new $$t.w(1)},dispose:function(){switch(this.l){case 1:case 2:this.m();break;case 3:case 4:try{this.n()}finally{this.m()}break}},current:function(){return this.j},current1:function(){return $d(this.$tResult,this.j)},$type:new $.ig.Type("Enumerable___SelectMany__IteratorClass1$3",$.ig.$ot,[$$t.$an.$type.specialize(0),$.ig.IEnumerable.prototype.$type,$$t.$ao.$type.specialize(0),$.ig.IEnumerator.prototype.$type,$$t.$ap.$type])},true);$c("Enumerable___Reverse__IteratorClass$1:Enumerable___Reverse__IteratorClass$1","Object",{$tSource:null,e:0,d:null,c:null,f:0,b:null,__3__source:null,init:function($tSource,a){this.$tSource=$tSource;this.$type=this.$type.specialize(this.$tSource);$.ig.$op.init.call(this);this.e=a},moveNext:function(){while(this.e>=0){switch(this.e){case 0:this.e=-1;this.c=new $$t.bh(this.$tSource,1,this.b);this.f=this.c.count()-1;this.e=1;break;case 1:this.e=-1;if(this.f>=0){this.d=this.c.__inner[this.f];this.e=2;return true}break;case 2:this.e=-1;this.f--;this.e=1;break}}return false},getEnumerator:function(){var d__;if(this.e==-2){this.e=0;d__=this}else{d__=new $.ig.Enumerable___Reverse__IteratorClass$1(this.$tSource,0)}d__.b=this.__3__source;return d__},reset:function(){throw new $$t.w(1)},dispose:function(){},current:function(){return this.d},current1:function(){return $d(this.$tSource,this.d)},$type:new $.ig.Type("Enumerable___Reverse__IteratorClass$1",$.ig.$ot,[$$t.$an.$type.specialize(0),$.ig.IEnumerable.prototype.$type,$$t.$ao.$type.specialize(0),$.ig.IEnumerator.prototype.$type,$$t.$ap.$type])},true);$c("Enumerable___Range__IteratorClass:Enumerable___Range__IteratorClass","Object",{a:0,b:0,e:0,g:0,__3__startValue:0,f:0,__3__count:0,init:function(a){$.ig.$op.init.call(this);this.a=a},moveNext:function(){while(this.a>=0){switch(this.a){case 0:this.a=-1;this.e=this.g;this.a=1;break;case 1:this.a=-1;if(this.e<this.f){this.b=this.e;this.a=2;return true}break;case 2:this.a=-1;this.e++;this.a=1;break}}return false},getEnumerator:function(){var d__;if(this.a==-2){this.a=0;d__=this}else{d__=new $.ig.Enumerable___Range__IteratorClass(0)}d__.g=this.__3__startValue;d__.f=this.__3__count;return d__},reset:function(){throw new $$t.w(1)},dispose:function(){},current:function(){return this.b},current1:function(){return this.b},$type:new $.ig.Type("Enumerable___Range__IteratorClass",$.ig.$ot,[$$t.$an.$type.specialize($.ig.Number.prototype.$type),$.ig.IEnumerable.prototype.$type,$$t.$ao.$type.specialize($.ig.Number.prototype.$type),$.ig.IEnumerator.prototype.$type,$$t.$ap.$type])},true);$c("Enumerable___OfType__IteratorClass$1:Enumerable___OfType__IteratorClass$1","Object",{$tResult:null,e:0,d:null,c:null,f:null,b:null,__3__source:null,init:function($tResult,a){this.$tResult=$tResult;this.$type=this.$type.specialize(this.$tResult);$.ig.$op.init.call(this);this.e=a},g:function(){this.e=-1;var d__=$b($$t.$ap.$type,this.c);if(d__!=null){d__.dispose()}},moveNext:function(){var __hasError__=false;try{while(this.e>=0){switch(this.e){case 0:this.e=1;this.c=this.b.getEnumerator();this.e=2;break;case 2:this.e=1;if(this.c.moveNext()){this.f=this.c.current();if($b(this.$tResult,this.f)!==null){this.d=$u(this.$tResult,this.f);this.e=2;return true}this.e=2;break}this.g();break}}}catch(a){__hasError__=true;throw a}finally{if(__hasError__){this.dispose()}}return false},getEnumerator:function(){var d__;if(this.e==-2){this.e=0;d__=this}else{d__=new $.ig.Enumerable___OfType__IteratorClass$1(this.$tResult,0)}d__.b=this.__3__source;return d__},reset:function(){throw new $$t.w(1)},dispose:function(){switch(this.e){case 1:case 2:this.g();break}},current:function(){return this.d},current1:function(){return $d(this.$tResult,this.d)},$type:new $.ig.Type("Enumerable___OfType__IteratorClass$1",$.ig.$ot,[$$t.$an.$type.specialize(0),$.ig.IEnumerable.prototype.$type,$$t.$ao.$type.specialize(0),$.ig.IEnumerator.prototype.$type,$$t.$ap.$type])},true);$c("Enumerable___SelectMany__IteratorClass$2:Enumerable___SelectMany__IteratorClass$2","Object",{$tSource:null,$tResult:null,j:0,g:null,d:null,i:null,c:null,h:null,b:null,__3__source:null,f:null,__3__selector:null,init:function($tSource,$tResult,a){this.$tSource=$tSource;this.$tResult=$tResult;this.$type=this.$type.specialize(this.$tSource,this.$tResult);$.ig.$op.init.call(this);this.j=a},k:function(){this.j=-1;if(this.d!=null){this.d.dispose()}},l:function(){this.j=1;if(this.c!=null){this.c.dispose()}},moveNext:function(){var __hasError__=false;try{while(this.j>=0){switch(this.j){case 0:this.j=1;this.d=this.b.getEnumerator();this.j=2;break;case 2:this.j=1;if(this.d.moveNext()){this.i=this.d.current();this.j=3;this.c=this.f(this.i).getEnumerator();this.j=4;break}this.k();break;case 4:this.j=3;if(this.c.moveNext()){this.h=this.c.current();this.g=this.h;this.j=4;return true}this.l();this.j=2;break}}}catch(a){__hasError__=true;throw a}finally{if(__hasError__){this.dispose()}}return false},getEnumerator:function(){var d__;if(this.j==-2){this.j=0;d__=this}else{d__=new $.ig.Enumerable___SelectMany__IteratorClass$2(this.$tSource,this.$tResult,0)}d__.b=this.__3__source;d__.f=this.__3__selector;return d__},reset:function(){throw new $$t.w(1)},dispose:function(){switch(this.j){case 1:case 2:this.k();break;case 3:case 4:try{this.l()}finally{this.k()}break}},current:function(){return this.g},current1:function(){return $d(this.$tResult,this.g)},$type:new $.ig.Type("Enumerable___SelectMany__IteratorClass$2",$.ig.$ot,[$$t.$an.$type.specialize(0),$.ig.IEnumerable.prototype.$type,$$t.$ao.$type.specialize(0),$.ig.IEnumerator.prototype.$type,$$t.$ap.$type])},true);$c("Enumerable___Select__IteratorClass$2:Enumerable___Select__IteratorClass$2","Object",{$tSource:null,$tResult:null,h:0,f:null,c:null,g:null,b:null,__3__source:null,e:null,__3__selector:null,init:function($tSource,$tResult,a){this.$tSource=$tSource;this.$tResult=$tResult;this.$type=this.$type.specialize(this.$tSource,this.$tResult);$.ig.$op.init.call(this);this.h=a},i:function(){this.h=-1;if(this.c!=null){this.c.dispose()}},moveNext:function(){var __hasError__=false;try{while(this.h>=0){switch(this.h){case 0:this.h=1;this.c=this.b.getEnumerator();this.h=2;break;case 2:this.h=1;if(this.c.moveNext()){this.g=this.c.current();this.f=this.e(this.g);this.h=2;return true}this.i();break}}}catch(a){__hasError__=true;throw a}finally{if(__hasError__){this.dispose()}}return false},getEnumerator:function(){var d__;if(this.h==-2){this.h=0;d__=this}else{d__=new $.ig.Enumerable___Select__IteratorClass$2(this.$tSource,this.$tResult,0)}d__.b=this.__3__source;d__.e=this.__3__selector;return d__},reset:function(){throw new $$t.w(1)},dispose:function(){switch(this.h){case 1:case 2:this.i();break}},current:function(){return this.f},current1:function(){return $d(this.$tResult,this.f)},$type:new $.ig.Type("Enumerable___Select__IteratorClass$2",$.ig.$ot,[$$t.$an.$type.specialize(0),$.ig.IEnumerable.prototype.$type,$$t.$ao.$type.specialize(0),$.ig.IEnumerator.prototype.$type,$$t.$ap.$type])},true);$c("Enumerable___Where__IteratorClass1$1:Enumerable___Where__IteratorClass1$1","Object",{$tSource:null,h:0,f:null,i:0,c:null,g:null,b:null,__3__source:null,e:null,__3__predicate:null,init:function($tSource,a){this.$tSource=$tSource;this.$type=this.$type.specialize(this.$tSource);$.ig.$op.init.call(this);this.h=a},j:function(){this.h=-1;if(this.c!=null){this.c.dispose()}},moveNext:function(){var __hasError__=false;try{while(this.h>=0){switch(this.h){case 0:this.h=-1;this.i=0;this.h=1;this.c=this.b.getEnumerator();this.h=2;break;case 2:this.h=1;if(this.c.moveNext()){this.g=this.c.current();if(this.e(this.g,this.i)){this.f=this.g;this.h=3;return true}this.h=3;break}this.j();break;case 3:this.h=1;this.i++;this.h=2;break}}}catch(a){__hasError__=true;throw a}finally{if(__hasError__){this.dispose()}}return false},getEnumerator:function(){var d__;if(this.h==-2){this.h=0;d__=this}else{d__=new $.ig.Enumerable___Where__IteratorClass1$1(this.$tSource,0)}d__.b=this.__3__source;d__.e=this.__3__predicate;return d__},reset:function(){throw new $$t.w(1)},dispose:function(){switch(this.h){case 1:case 2:case 3:this.j();break}},current:function(){return this.f},current1:function(){return $d(this.$tSource,this.f)},$type:new $.ig.Type("Enumerable___Where__IteratorClass1$1",$.ig.$ot,[$$t.$an.$type.specialize(0),$.ig.IEnumerable.prototype.$type,$$t.$ao.$type.specialize(0),$.ig.IEnumerator.prototype.$type,$$t.$ap.$type])},true);$c("Enumerable___Where__IteratorClass$1:Enumerable___Where__IteratorClass$1","Object",{$tSource:null,h:0,f:null,c:null,g:null,b:null,__3__source:null,e:null,__3__predicate:null,init:function($tSource,a){this.$tSource=$tSource;this.$type=this.$type.specialize(this.$tSource);$.ig.$op.init.call(this);this.h=a},i:function(){this.h=-1;if(this.c!=null){this.c.dispose()}},moveNext:function(){var __hasError__=false;try{while(this.h>=0){switch(this.h){case 0:this.h=1;this.c=this.b.getEnumerator();this.h=2;break;case 2:this.h=1;if(this.c.moveNext()){this.g=this.c.current();if(this.e(this.g)){this.f=this.g;this.h=2;return true}this.h=2;break}this.i();break}}}catch(a){__hasError__=true;throw a}finally{if(__hasError__){this.dispose()}}return false},getEnumerator:function(){var d__;if(this.h==-2){this.h=0;d__=this}else{d__=new $.ig.Enumerable___Where__IteratorClass$1(this.$tSource,0)}d__.b=this.__3__source;d__.e=this.__3__predicate;return d__},reset:function(){throw new $$t.w(1)},dispose:function(){switch(this.h){case 1:case 2:this.i();break}},current:function(){return this.f},current1:function(){return $d(this.$tSource,this.f)},$type:new $.ig.Type("Enumerable___Where__IteratorClass$1",$.ig.$ot,[$$t.$an.$type.specialize(0),$.ig.IEnumerable.prototype.$type,$$t.$ao.$type.specialize(0),$.ig.IEnumerator.prototype.$type,$$t.$ap.$type])},true);$c("Dictionary___ToEnumerable__IteratorClass$2:Dictionary___ToEnumerable__IteratorClass$2","Object",{$tKey:null,$tValue:null,g:0,f:null,a:null,h:0,b:null,i:0,e:null,c:null,j:0,__4__this:null,init:function($tKey,$tValue,a){this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);this.f=new $$t.b4(this.$tKey,this.$tValue);$.ig.$op.init.call(this);this.g=a},moveNext:function(){while(this.g>=0){switch(this.g){case 0:this.g=-1;if(this.__4__this.c){this.a=$.ig.util.getArrayOfProperties(this.__4__this.a);this.h=0;this.g=1;break}this.b=$.ig.util.getArrayOfProperties(this.__4__this.b);this.i=0;this.g=3;break;case 1:this.g=-1;if(this.h<this.a.length){this.f=new $$t.b4(this.$tKey,this.$tValue,1,this.__4__this.a[this.a[this.h]],this.__4__this.b[this.a[this.h]]);this.g=2;return true}break;case 2:this.g=-1;this.h++;this.g=1;break;case 3:this.g=-1;if(this.i<this.b.length){this.e=this.__4__this.b[this.b[this.i]];if(this.e.$isHashSetBucket){this.c=this.e;this.j=0;this.g=4;break}this.f=new $$t.b4(this.$tKey,this.$tValue,1,this.e.key,this.e.value);this.g=6;return true}break;case 4:this.g=-1;if(this.j<this.c.length){var subItem_=this.c[this.j];this.f=new $$t.b4(this.$tKey,this.$tValue,1,subItem_.key,subItem_.value);this.g=5;return true}this.g=6;break;case 5:this.g=-1;this.j++;this.g=4;break;case 6:this.g=-1;this.i++;this.g=3;break}}return false},getEnumerator:function(){var d__;if(this.g==-2){this.g=0;d__=this}else{d__=new $.ig.Dictionary___ToEnumerable__IteratorClass$2(this.$tKey,this.$tValue,0);d__.__4__this=this.__4__this}return d__},reset:function(){throw new $$t.w(1)},dispose:function(){},current:function(){return this.f},current1:function(){return this.f},$type:new $.ig.Type("Dictionary___ToEnumerable__IteratorClass$2",$.ig.$ot,[$$t.$an.$type.specialize($$t.$b4.$type.specialize(this.$tKey,this.$tValue)),$.ig.IEnumerable.prototype.$type,$$t.$ao.$type.specialize($$t.$b4.$type.specialize(this.$tKey,this.$tValue)),$.ig.IEnumerator.prototype.$type,$$t.$ap.$type])},true);$c("Enumerable___Concat__IteratorClass$1:Enumerable___Concat__IteratorClass$1","Object",{$tSource:null,j:0,g:null,e:null,h:null,f:null,i:null,c:null,__3__source1:null,d:null,__3__source2:null,init:function($tSource,a){this.$tSource=$tSource;this.$type=this.$type.specialize(this.$tSource);$.ig.$op.init.call(this);this.j=a},k:function(){this.j=-1;if(this.e!=null){this.e.dispose()}},l:function(){this.j=-1;if(this.f!=null){this.f.dispose()}},moveNext:function(){var __hasError__=false;try{while(this.j>=0){switch(this.j){case 0:this.j=1;this.e=this.c.getEnumerator();this.j=2;break;case 2:this.j=1;if(this.e.moveNext()){this.h=this.e.current();this.g=this.h;this.j=2;return true}this.k();this.j=3;this.f=this.d.getEnumerator();this.j=4;break;case 4:this.j=3;if(this.f.moveNext()){this.i=this.f.current();this.g=this.i;this.j=4;return true}this.l();break}}}catch(a){__hasError__=true;throw a}finally{if(__hasError__){this.dispose()}}return false},getEnumerator:function(){var d__;if(this.j==-2){this.j=0;d__=this}else{d__=new $.ig.Enumerable___Concat__IteratorClass$1(this.$tSource,0)}d__.c=this.__3__source1;d__.d=this.__3__source2;return d__},reset:function(){throw new $$t.w(1)},dispose:function(){switch(this.j){case 1:case 2:this.k();break;case 3:case 4:this.l();break}},current:function(){return this.g},current1:function(){return $d(this.$tSource,this.g)},$type:new $.ig.Type("Enumerable___Concat__IteratorClass$1",$.ig.$ot,[$$t.$an.$type.specialize(0),$.ig.IEnumerable.prototype.$type,$$t.$ao.$type.specialize(0),$.ig.IEnumerator.prototype.$type,$$t.$ap.$type])},true);$c("Enumerable___Empty__IteratorClass$1:Enumerable___Empty__IteratorClass$1","Object",{$tSource:null,b:0,a:null,init:function($tSource,a){this.$tSource=$tSource;this.$type=this.$type.specialize(this.$tSource);$.ig.$op.init.call(this);this.b=a},moveNext:function(){switch(this.b){case 0:this.b=-1;return false}return false},getEnumerator:function(){if(this.b==-2){this.b=0;return this}return new $.ig.Enumerable___Empty__IteratorClass$1(this.$tSource,0)},reset:function(){throw new $$t.w(1)},dispose:function(){},current:function(){return this.a},current1:function(){return $d(this.$tSource,this.a)},$type:new $.ig.Type("Enumerable___Empty__IteratorClass$1",$.ig.$ot,[$$t.$an.$type.specialize(0),$.ig.IEnumerable.prototype.$type,$$t.$ao.$type.specialize(0),$.ig.IEnumerator.prototype.$type,$$t.$ap.$type])},true);$$t.$ex.relativeOrAbsolute=0;$$t.$ex.absolute=1;$$t.$ex.relative=2;$$t.$e6.created=0;$$t.$e6.ranToCompletion=5;$$t.$e6.canceled=6;$$t.$e6.faulted=7;$$t.$d1.ascending=0;$$t.$d1.descending=1;$$t.$cp.add=0;$$t.$cp.remove=1;$$t.$cp.replace=2;$$t.$cp.reset=4;$$t.$eh.t=null;$$t.$eh.s=null;$$t.$eh.r=null;$$t.$eh.p=null;$$t.$eh.q=null})(jQuery);$.ig=$.ig||{};(function($){var $$t={};$.ig.$currDefinitions=$$t;$.ig.util.bulkDefine(["ICoreOlapElement:a","String:b","Object:c","Type:d","Boolean:e","ValueType:f","Void:g","IConvertible:h","IFormatProvider:i","Number:j","NumberStyles:k","Enum:l","Array:m","IList:n","ICollection:o","IEnumerable:p","IEnumerator:q","Number:r","IComparable:s","Number:t","Number:u","Number:v","NotSupportedException:w","Error:x","Number:y","String:z","Date:aa","Number:ab","DayOfWeek:ac","DateTimeKind:ad","Number:ae","Number:af","Number:ag","Number:ah","Number:ai","Number:aj","Assembly:ak","Stream:al","IDisposable:am","SeekOrigin:an","RuntimeTypeHandle:ao","MethodInfo:ap","MethodBase:aq","MemberInfo:ar","ParameterInfo:as","TypeCode:at","ConstructorInfo:au","PropertyInfo:av","StringComparison:aw","RegExp:ax","CultureInfo:ay","DateTimeFormatInfo:az","Calendar:a0","CalendarWeekRule:a1","NumberFormatInfo:a2","CompareInfo:a3","CompareOptions:a4","IEnumerable$1:a5","IEnumerator$1:a6","StringSplitOptions:a7","Cube:a8","CubeType:a9","Catalog:ba","Dimension:bb","DimensionType:bc","KpiDimension:bd","HierarchyOrigin:bg","AggregatorType:bh","CardinalityType:bi","MemberType:bj","Hierarchy:bk","Kpi:bl","Level:bm","Measure:bn","KpiMeasure:bo","MeasureGroup:bp","MeasureGroupDimension:bq","Member:br","Nullable$1:bs","OlapResult:bt","IList$1:bu","ICollection$1:bv","OlapResultAxis:bw","PositionResolver$2:bx","List$1:by","IArray:bz","Script:b0","IArrayList:b1","Array:b2","CompareCallback:b3","MulticastDelegate:b4","IntPtr:b5","Func$3:b6","Action$1:b7","Comparer$1:b8","IComparer:b9","IComparer$1:ca","DefaultComparer$1:cb","IComparable$1:cc","Comparison$1:cd","ReadOnlyCollection$1:ce","Predicate$1:cf","NotImplementedException:cg","IPosition$2:ch","IPositionItem$2:ci","PositionItemInfo$2:cj","Dictionary$2:ck","IDictionary$2:cl","IDictionary:cm","Func$2:cn","KeyValuePair$2:co","Enumerable:cp","Thread:cq","ThreadStart:cr","IOrderedEnumerable$1:cs","SortedList$1:ct","Math:cu","ArgumentNullException:cv","IEqualityComparer$1:cw","EqualityComparer$1:cx","IEqualityComparer:cy","DefaultEqualityComparer$1:cz","InvalidOperationException:c0","ArgumentException:c1","IHierarchicalPositionItem$2:c2","EventHandler$1:c3","AsyncCompletedEventArgs:c4","EventArgs:c5","Delegate:c6","Interlocked:c7","ListSortDirection:c8","OlapResultTuple:c9","OlapResultAxisMember:da","OlapResultCell:db","IConnection:dc","IOlapDataProviderFactory:dd","IOlapDiscoverDataProvider:de","Task$1:df","Task:dg","JQueryPromise:dh","Action:di","AggregateException:dj","TaskStatus:dk","TaskCompletionSource$1:dl","JQueryDeferred:dm","JQuery:dn","JQueryObject:dp","Element:dq","ElementAttributeCollection:dr","ElementCollection:ds","WebStyle:dt","ElementNodeType:du","Document:dv","EventListener:dw","IElementEventHandler:dx","ElementEventHandler:dy","ElementAttribute:dz","JQueryPosition:d0","JQueryCallback:d1","JQueryEvent:d2","JQueryUICallback:d3","KeyValueItem:d4","IOlapExecuteCommandProvider:d5","HeaderCellsLayoutOrientation:d6","LevelSpanManager:d7","SpanSource:d8","ITableViewHeadersFactory:d9","OlapTableViewHeaderCell:ea","TableViewHeadersFactory:eb","ArrayListCollection$1:ec","INotifyCollectionChanged:ed","NotifyCollectionChangedEventHandler:ee","NotifyCollectionChangedEventArgs:ef","NotifyCollectionChangedAction:eg","TableViewHeaderCellSource:eh","TableSuperCompactViewHeadersFactory:ei","TreeStackAttributesBehavior:ej","OlapTableViewTreeHeaderCell:ek","TreeStackNextDimensionFirstBehavior:em","TableViewTreeHeadersFactory:en","Stack$1:eo","ReverseArrayEnumerator$1:ep","TableViewImpl:eq","TableViewSettings:er","RowHeaderLayout:es","OlapTableViewResultCell:et","TupleSortDirection:eu","LevelSortDirection:ev","LevelSortBehavior:ew","ResultHeaderSorter:ex","ResultSorter$1:ey","AxisTupleVisitor:ez","AxisHeaderSortingVisitor:e0","ResultColumnValueSorter:e1","AxisValueSortingVisitor:e2","TreeLayoutTableViewSettings:e3","OlapResultView:e4","ResultViewHelper:e5","IOlapDataSource:e6","OlapMetadataTreeItem:e7","OlapMetadataTreeItemType:e8","MeasureListLocation:e9","MeasureList:fa","OlapDataSource:fb","DataSourceBaseOptions:fc","CubeMetaItemsCache:fd","MeasureGroupMetaItemsCache:fe","Tuple$2:ff","AxisElement:fg","PositionInfo:fh","TaskFactory:fi","TaskExtensions:fj","AxisDefinitionParser:fk","MetaTreeHelper:fl","HierarchyItemPosition:fm","CoreOlapElementParser:fq","HierarchyFilterView:fz","FilterMember:f0","INotifyPropertyChanged:f1","PropertyChangedEventHandler:f2","PropertyChangedEventArgs:f3","FilterMemberStateChangedEventArgs:f4","DataSourceBase:f5","jQueryUtils:f6","OlapUtilities:f7","OlapTableView:f8","AbstractEnumerable:f9","Func$1:ga","AbstractEnumerator:gb","GenericEnumerable$1:gc","GenericEnumerator$1:gd"]);var $a=$.ig.intDivide,$b=$.ig.util.cast,$c=$.ig.util.defType,$d=$.ig.util.getBoxIfEnum,$e=$.ig.util.getDefaultValue,$f=$.ig.util.getEnumValue,$g=$.ig.util.getValue,$h=$.ig.util.intSToU,$i=$.ig.util.nullableEquals,$j=$.ig.util.nullableIsNull,$k=$.ig.util.nullableNotEquals,$l=$.ig.util.toNullable,$m=$.ig.util.toString$1,$n=$.ig.util.u32BitwiseAnd,$o=$.ig.util.u32BitwiseOr,$p=$.ig.util.u32BitwiseXor,$q=$.ig.util.u32LS,$r=$.ig.util.unwrapNullable,$s=$.ig.util.wrapNullable,$t=String.fromCharCode,$u=$.ig.util.castObjTo$t,$v=$.ig.util.compare,$w=$.ig.util.replace,$x=$.ig.util.stringFormat,$y=$.ig.util.stringFormat1,$z=$.ig.util.stringFormat2,$0=$.ig.util.stringCompare1,$1=$.ig.util.stringCompare2,$2=$.ig.util.stringCompare3,$3=$.ig.util.compareSimple;$c("LevelSortBehavior:ew","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"Alphabetical";case 1:return"System";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("LevelSortBehavior",$.ig.$ep.$type)},true);$c("OlapMetadataTreeItemType:e8","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"Cube";case 1:return"Dimension";case 2:return"Group";case 3:return"UserDefinedHierarchy";case 4:return"SystemEnabledHierarchy";case 5:return"ParentChildHierarchy";case 6:return"Measure";case 7:return"Level1";case 8:return"Level2";case 9:return"Level3";case 10:return"Level4";case 11:return"Level5";case 12:return"KpiRoot";case 13:return"Kpi";case 14:return"KpiValue";case 15:return"KpiGoal";case 16:return"KpiStatus";case 17:return"KpiTrend";case 18:return"KpiWeight";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("OlapMetadataTreeItemType",$.ig.$ep.$type)},true);$c("MeasureListLocation:e9","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"Rows";case 1:return"Columns";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("MeasureListLocation",$.ig.$ep.$type)},true);$c("RowHeaderLayout:es","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"Standard";case 1:return"SuperCompact";case 2:return"Tree";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("RowHeaderLayout",$.ig.$ep.$type)},true);$c("HeaderCellsLayoutOrientation:d6","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"Horizontal";case 1:return"Vertical";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("HeaderCellsLayoutOrientation",$.ig.$ep.$type)},true);$c("MemberType:bj","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"Unknown";case 1:return"Regular";case 2:return"All";case 3:return"Measure";case 4:return"Formula";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("MemberType",$.ig.$ep.$type)},true);$c("CardinalityType:bi","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"One";case 1:return"Many";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("CardinalityType",$.ig.$ep.$type)},true);$c("AggregatorType:bh","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"Unknown";case 1:return"Sum";case 2:return"Count";case 3:return"Min";case 4:return"Max";case 5:return"Average";case 6:return"Variance";case 7:return"Std";case 8:return"DistinctCount";case 9:return"None";case 10:return"AverageOfChildren";case 13:return"FirstNonEmpty";case 14:return"LastNonEmpty";case 15:return"ByAccount";case 127:return"Calculated";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("AggregatorType",$.ig.$ep.$type)},true);$c("HierarchyOrigin:bg","Enum",{init:function(v){this._v=v},$getName:function(){function getNameSingle(v){switch(v){case 1:return"UserDefined";case 2:return"SystemEnabled";case 4:return"SystemInternal";default:return v.toString()}}return function(v){return this.getFlaggedName(v,getNameSingle)}}(),$value:function(){return this._v},$type:new $.ig.Type("HierarchyOrigin",$.ig.$ep.$type)},true);$c("DimensionType:bc","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"Unknown";case 1:return"Time";case 2:return"Measure";case 3:return"Other";case 5:return"Quantitative";case 6:return"Accounts";case 7:return"Customers";case 8:return"Products";case 9:return"Scenario";case 10:return"Utility";case 11:return"Currency";case 12:return"Rates";case 13:return"Channel";case 14:return"Promotion";case 15:return"Organization";case 16:return"BillOfMaterials";case 17:return"Geography";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("DimensionType",$.ig.$ep.$type)},true);$c("CubeType:a9","Enum",{init:function(v){this._v=v},$getName:function(v){switch(v){case 0:return"Cube";case 1:return"Dimension";case 2:return"Unknown";default:return v.toString()}},$value:function(){return this._v},$type:new $.ig.Type("CubeType",$.ig.$ep.$type)},true);$c("ICoreOlapElement:a","Object",{$type:new $.ig.Type("ICoreOlapElement",null)},true);$c("Cube:a8","Object",{init:function(){$.ig.$op.init.call(this)},_catalogName:null,catalogName:function(a){if(arguments.length===1){this._catalogName=a;return a}else{return this._catalogName}},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_cubeType:0,cubeType:function(a){if(arguments.length===1){this._cubeType=a;return a}else{return this._cubeType}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_lastProcessed:new Date,lastProcessed:function(a){if(arguments.length===1){this._lastProcessed=a;return a}else{return this._lastProcessed}},_lastUpdated:new Date,lastUpdated:function(a){if(arguments.length===1){this._lastUpdated=a;return a}else{return this._lastUpdated}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},uniqueName:function(a){if(arguments.length===1){this.name(a);return a}else{return this.name()}},$type:new $.ig.Type("Cube",$.ig.$ot,[$$t.$a.$type])},true);$c("Catalog:ba","Object",{init:function(){$.ig.$op.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},$type:new $.ig.Type("Catalog",$.ig.$ot,[$$t.$a.$type])},true);$c("Dimension:bb","Object",{init:function(){$.ig.$op.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_dimensionType:0,dimensionType:function(a){if(arguments.length===1){this._dimensionType=a;return a}else{return this._dimensionType}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_defaultHierarchy:null,defaultHierarchy:function(a){if(arguments.length===1){this._defaultHierarchy=a;return a}else{return this._defaultHierarchy}},$type:new $.ig.Type("Dimension",$.ig.$ot,[$$t.$a.$type])},true);$c("KpiDimension:bd","Object",{init:function(){$.ig.$op.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},$type:new $.ig.Type("KpiDimension",$.ig.$ot,[$$t.$a.$type])},true);$c("Hierarchy:bk","Object",{init:function(){$.ig.$op.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_defaultHierarchy:null,defaultHierarchy:function(a){if(arguments.length===1){this._defaultHierarchy=a;return a}else{return this._defaultHierarchy}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_defaultMember:null,defaultMember:function(a){if(arguments.length===1){this._defaultMember=a;return a}else{return this._defaultMember}},_allMember:null,allMember:function(a){if(arguments.length===1){this._allMember=a;return a}else{return this._allMember}},_dimensionUniqueName:null,dimensionUniqueName:function(a){if(arguments.length===1){this._dimensionUniqueName=a;return a}else{return this._dimensionUniqueName
}},_hierarchyOrigin:0,hierarchyOrigin:function(a){if(arguments.length===1){this._hierarchyOrigin=a;return a}else{return this._hierarchyOrigin}},_hierarchyDisplayFolder:null,hierarchyDisplayFolder:function(a){if(arguments.length===1){this._hierarchyDisplayFolder=a;return a}else{return this._hierarchyDisplayFolder}},$type:new $.ig.Type("Hierarchy",$.ig.$ot,[$$t.$a.$type])},true);$c("Kpi:bl","Object",{init:function(){$.ig.$op.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_measureGroupName:null,measureGroupName:function(a){if(arguments.length===1){this._measureGroupName=a;return a}else{return this._measureGroupName}},_kpiDisplayFolder:null,kpiDisplayFolder:function(a){if(arguments.length===1){this._kpiDisplayFolder=a;return a}else{return this._kpiDisplayFolder}},_kpiValue:null,kpiValue:function(a){if(arguments.length===1){this._kpiValue=a;return a}else{return this._kpiValue}},_kpiGoal:null,kpiGoal:function(a){if(arguments.length===1){this._kpiGoal=a;return a}else{return this._kpiGoal}},_kpiStatus:null,kpiStatus:function(a){if(arguments.length===1){this._kpiStatus=a;return a}else{return this._kpiStatus}},_kpiTrend:null,kpiTrend:function(a){if(arguments.length===1){this._kpiTrend=a;return a}else{return this._kpiTrend}},_kpiStatusGraphic:null,kpiStatusGraphic:function(a){if(arguments.length===1){this._kpiStatusGraphic=a;return a}else{return this._kpiStatusGraphic}},_kpiTrendGraphic:null,kpiTrendGraphic:function(a){if(arguments.length===1){this._kpiTrendGraphic=a;return a}else{return this._kpiTrendGraphic}},_kpiWeight:null,kpiWeight:function(a){if(arguments.length===1){this._kpiWeight=a;return a}else{return this._kpiWeight}},_parentKpiName:null,parentKpiName:function(a){if(arguments.length===1){this._parentKpiName=a;return a}else{return this._parentKpiName}},_currentTimeMember:null,currentTimeMember:function(a){if(arguments.length===1){this._currentTimeMember=a;return a}else{return this._currentTimeMember}},$type:new $.ig.Type("Kpi",$.ig.$ot,[$$t.$a.$type])},true);$c("Level:bm","Object",{init:function(){$.ig.$op.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_depth:0,depth:function(a){if(arguments.length===1){this._depth=a;return a}else{return this._depth}},_hierarchyUniqueName:null,hierarchyUniqueName:function(a){if(arguments.length===1){this._hierarchyUniqueName=a;return a}else{return this._hierarchyUniqueName}},_dimensionUniqueName:null,dimensionUniqueName:function(a){if(arguments.length===1){this._dimensionUniqueName=a;return a}else{return this._dimensionUniqueName}},_membersCount:0,membersCount:function(a){if(arguments.length===1){this._membersCount=a;return a}else{return this._membersCount}},_levelOrigin:0,levelOrigin:function(a){if(arguments.length===1){this._levelOrigin=a;return a}else{return this._levelOrigin}},_levelOrderingProperty:null,levelOrderingProperty:function(a){if(arguments.length===1){this._levelOrderingProperty=a;return a}else{return this._levelOrderingProperty}},$type:new $.ig.Type("Level",$.ig.$ot,[$$t.$a.$type])},true);$c("Measure:bn","Object",{init:function(){$.ig.$op.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_measureGroupName:null,measureGroupName:function(a){if(arguments.length===1){this._measureGroupName=a;return a}else{return this._measureGroupName}},_aggregatorType:0,aggregatorType:function(a){if(arguments.length===1){this._aggregatorType=a;return a}else{return this._aggregatorType}},_defaultFormatString:null,defaultFormatString:function(a){if(arguments.length===1){this._defaultFormatString=a;return a}else{return this._defaultFormatString}},_measureDisplayFolder:null,measureDisplayFolder:function(a){if(arguments.length===1){this._measureDisplayFolder=a;return a}else{return this._measureDisplayFolder}},$type:new $.ig.Type("Measure",$.ig.$ot,[$$t.$a.$type])},true);$c("KpiMeasure:bo","Measure",{init:function(a,b){$$t.$bn.init.call(this);this.uniqueName(a);this.caption(b)},_graphic:null,graphic:function(a){if(arguments.length===1){this._graphic=a;return a}else{return this._graphic}},createKpiValueMeasure:function(a){return new $$t.bo(a.kpiValue(),a.caption()+" Value")},createKpiGoalMeasure:function(a){return new $$t.bo(a.kpiGoal(),a.caption()+" Goal")},createKpiWeightMeasure:function(a){return new $$t.bo(a.kpiWeight(),a.caption()+" Weight")},createKpiStatusMeasure:function(a){var b=new $$t.bo(a.kpiStatus(),a.caption()+" Status");b.graphic(a.kpiStatusGraphic());return b},createKpiTrendMeasure:function(a){var b=new $$t.bo(a.kpiTrend(),a.caption()+" Trend");b.graphic(a.kpiTrendGraphic());return b},$type:new $.ig.Type("KpiMeasure",$$t.$bn.$type)},true);$c("MeasureGroup:bp","Object",{init:function(){$.ig.$op.init.call(this)},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_cubeName:null,cubeName:function(a){if(arguments.length===1){this._cubeName=a;return a}else{return this._cubeName}},_catalogName:null,catalogName:function(a){if(arguments.length===1){this._catalogName=a;return a}else{return this._catalogName}},uniqueName:function(a){if(arguments.length===1){this.name(a);return a}else{return this.name()}},$type:new $.ig.Type("MeasureGroup",$.ig.$ot,[$$t.$a.$type])},true);$c("MeasureGroupDimension:bq","Object",{init:function(){$.ig.$op.init.call(this)},_cubeName:null,cubeName:function(a){if(arguments.length===1){this._cubeName=a;return a}else{return this._cubeName}},_catalogName:null,catalogName:function(a){if(arguments.length===1){this._catalogName=a;return a}else{return this._catalogName}},_measureGroupName:null,measureGroupName:function(a){if(arguments.length===1){this._measureGroupName=a;return a}else{return this._measureGroupName}},_dimensionUniqueName:null,dimensionUniqueName:function(a){if(arguments.length===1){this._dimensionUniqueName=a;return a}else{return this._dimensionUniqueName}},_measureGroupCardinality:0,measureGroupCardinality:function(a){if(arguments.length===1){this._measureGroupCardinality=a;return a}else{return this._measureGroupCardinality}},_dimensionCardinality:0,dimensionCardinality:function(a){if(arguments.length===1){this._dimensionCardinality=a;return a}else{return this._dimensionCardinality}},_isDimensionVisible:false,isDimensionVisible:function(a){if(arguments.length===1){this._isDimensionVisible=a;return a}else{return this._isDimensionVisible}},_isFactDimension:false,isFactDimension:function(a){if(arguments.length===1){this._isFactDimension=a;return a}else{return this._isFactDimension}},_dimensionPath:null,dimensionPath:function(a){if(arguments.length===1){this._dimensionPath=a;return a}else{return this._dimensionPath}},_dimensionGranularity:null,dimensionGranularity:function(a){if(arguments.length===1){this._dimensionGranularity=a;return a}else{return this._dimensionGranularity}},$type:new $.ig.Type("MeasureGroupDimension",$.ig.$ot)},true);$c("Member:br","Object",{init:function(){$.ig.$op.init.call(this);var a=$l($.ig.Number.prototype.$type,null);this.scope(a)},_cubeName:null,cubeName:function(a){if(arguments.length===1){this._cubeName=a;return a}else{return this._cubeName}},_catalogName:null,catalogName:function(a){if(arguments.length===1){this._catalogName=a;return a}else{return this._catalogName}},_dimensionUniqueName:null,dimensionUniqueName:function(a){if(arguments.length===1){this._dimensionUniqueName=a;return a}else{return this._dimensionUniqueName}},_hierarchyUniqueName:null,hierarchyUniqueName:function(a){if(arguments.length===1){this._hierarchyUniqueName=a;return a}else{return this._hierarchyUniqueName}},_levelUniqueName:null,levelUniqueName:function(a){if(arguments.length===1){this._levelUniqueName=a;return a}else{return this._levelUniqueName}},_levelDepth:0,levelDepth:function(a){if(arguments.length===1){this._levelDepth=a;return a}else{return this._levelDepth}},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_memberType:0,memberType:function(a){if(arguments.length===1){this._memberType=a;return a}else{return this._memberType}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_childrenCardinality:0,childrenCardinality:function(a){if(arguments.length===1){this._childrenCardinality=a;return a}else{return this._childrenCardinality}},_parentLevel:0,parentLevel:function(a){if(arguments.length===1){this._parentLevel=a;return a}else{return this._parentLevel}},_parentUniqueName:null,parentUniqueName:function(a){if(arguments.length===1){this._parentUniqueName=a;return a}else{return this._parentUniqueName}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_scope:$l($.ig.Number.prototype.$type,null),scope:function(a){if(arguments.length===1){this._scope=a;return a}else{return this._scope}},$type:new $.ig.Type("Member",$.ig.$ot,[$$t.$a.$type])},true);$c("OlapResult:bt","Object",{init:function(){$.ig.$op.init.call(this)},_isEmpty:false,isEmpty:function(a){if(arguments.length===1){this._isEmpty=a;return a}else{return this._isEmpty}},_axes:null,axes:function(a){if(arguments.length===1){this._axes=a;return a}else{return this._axes}},_cells:null,cells:function(a){if(arguments.length===1){this._cells=a;return a}else{return this._cells}},$type:new $.ig.Type("OlapResult",$.ig.$ot)},true);$c("OlapResultAxis:bw","Object",{init:function(a,b){$.ig.$op.init.call(this);this.tuples($$t.$cp.y($$t.$c9.$type,a));this.tupleSize(b);this.positionResolver(new $$t.bx(String,$.ig.$op.$type,a,b))},_positionResolver:null,positionResolver:function(a){if(arguments.length===1){this._positionResolver=a;return a}else{return this._positionResolver}},clone:function(){var $self=this;var a=new $$t.by($$t.$c9.$type,0);var c=this.tuples().getEnumerator();while(c.moveNext()){var b=c.current();a.add(b.clone())}return function(){var $ret=new $$t.bw(a,$self.tupleSize());$ret.name($self.name());return $ret}()},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_tupleSize:0,tupleSize:function(a){if(arguments.length===1){this._tupleSize=a;return a}else{return this._tupleSize}},_tuples:null,tuples:function(a){if(arguments.length===1){this._tuples=a;return a}else{return this._tuples}},$type:new $.ig.Type("OlapResultAxis",$.ig.$ot)},true);$c("IPosition$2:ch","Object",{$type:new $.ig.Type("IPosition$2",null)},true);$c("OlapResultTuple:c9","Object",{init:function(a){$.ig.$op.init.call(this);this.members(new $$t.ce($$t.$da.$type,1,a))},_members:null,members:function(a){if(arguments.length===1){this._members=a;return a}else{return this._members}},getItems:function(){return this.members()},itemsCount:function(){return this.members().count()},indexOf:function(a){return this.members().indexOf(a)},item:function(a){return this.members().item(a)},isEmpty:function(){return false},clone:function(){var a=new $$t.by($$t.$da.$type,0);var c=this.members().getEnumerator();while(c.moveNext()){var b=c.current();a.add(b.clone())}var d=new $$t.c9(a);var f=a.getEnumerator();while(f.moveNext()){var e=f.current();e.position(d)}return d},$type:new $.ig.Type("OlapResultTuple",$.ig.$ot,[$$t.$ch.$type.specialize(String,$.ig.$op.$type)])},true);$c("IPositionItem$2:ci","Object",{$type:new $.ig.Type("IPositionItem$2",null)},true);$c("IHierarchicalPositionItem$2:c2","Object",{$type:new $.ig.Type("IHierarchicalPositionItem$2",null,[$$t.$ci.$type.specialize(0,1)])},true);$c("OlapResultAxisMember:da","Object",{init:function(){$.ig.$op.init.call(this);this.properties(new $$t.ck(String,String,0));this.ordinal(-1)},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_levelUniqueName:null,levelUniqueName:function(a){if(arguments.length===1){this._levelUniqueName=a;return a}else{return this._levelUniqueName}},_hierarchyUniqueName:null,hierarchyUniqueName:function(a){if(arguments.length===1){this._hierarchyUniqueName=a;return a}else{return this._hierarchyUniqueName}},_levelNumber:0,levelNumber:function(a){if(arguments.length===1){this._levelNumber=a;return a}else{return this._levelNumber}},_displayInfo:0,displayInfo:function(a){if(arguments.length===1){this._displayInfo=a;return a}else{return this._displayInfo}},e:function(){return $n(this.displayInfo(),~65536)&~131072},drilledDown:function(){return(this.displayInfo()&65536)==65536},parentSameAsPrev:function(){return(this.displayInfo()&131072)==131072},_properties:null,properties:function(a){if(arguments.length===1){this._properties=a;return a}else{return this._properties}},_position:null,position:function(a){if(arguments.length===1){this._position=a;return a}else{return this._position}},key:function(){return this.uniqueName()},sortKey:function(){if(this.ordinal()>-1){return this.ordinal()}if(this.caption().contains("/")){return this.caption()}var a=parseFloat(this.caption());if(!isNaN(a)){return a}return this.caption()},_ordinal:0,ordinal:function(a){if(arguments.length===1){this._ordinal=a;return a}else{return this._ordinal}},hierarchyKey:function(){return this.hierarchyUniqueName()},hierarchyLevelKey:function(){return this.levelUniqueName()},parentKey:function(){var a;var b=this.properties().tryGetValue("PARENT_UNIQUE_NAME",a);a=b.p1;return a},depth:function(){return this.levelNumber()},isExpandable:function(){return this.e()>0},clone:function(){var a=new $$t.da;a.caption(this.caption());a.displayInfo(this.displayInfo());a.hierarchyUniqueName(this.hierarchyUniqueName());a.levelNumber(this.levelNumber());a.levelUniqueName(this.levelUniqueName());a.ordinal(this.ordinal());var c=this.properties().getEnumerator();while(c.moveNext()){var b=c.current();a.properties().add(b.key(),b.value())}a.uniqueName(this.uniqueName());a.position(this.position());return a},$type:new $.ig.Type("OlapResultAxisMember",$.ig.$ot,[$$t.$c2.$type.specialize(String,$.ig.$op.$type)])},true);$c("OlapResultCell:db","Object",{init:function(){$.ig.$op.init.call(this);this.properties(new $$t.ck(String,$.ig.$op.$type,0))},_cellOrdinal:0,cellOrdinal:function(a){if(arguments.length===1){this._cellOrdinal=a;return a}else{return this._cellOrdinal}},_properties:null,properties:function(a){if(arguments.length===1){this._properties=a;return a}else{return this._properties}},clone:function(){var $self=this;var a=function(){var $ret=new $$t.db;$ret.cellOrdinal($self.cellOrdinal());return $ret}();var c=this.properties().getEnumerator();while(c.moveNext()){var b=c.current();a.properties().add(b.key(),b.value())}return a},$type:new $.ig.Type("OlapResultCell",$.ig.$ot)},true);$c("IConnection:dc","Object",{$type:new $.ig.Type("IConnection",null)},true);$c("IOlapDataProviderFactory:dd","Object",{$type:new $.ig.Type("IOlapDataProviderFactory",null)},true);$c("IOlapDiscoverDataProvider:de","Object",{$type:new $.ig.Type("IOlapDiscoverDataProvider",null)},true);$c("IOlapExecuteCommandProvider:d5","Object",{$type:new $.ig.Type("IOlapExecuteCommandProvider",null)},true);$c("LevelSpanManager:d7","Object",{a:null,init:function(a){$.ig.$op.init.call(this);this.c(a);this.a=new Array(a)},_c:0,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},b:function(a,b){var c=this.a[a];if(c==null){c=new $$t.ck($.ig.Number.prototype.$type,$$t.$d8.$type,0);this.a[a]=c}var d;if(!function(){var e=c.tryGetValue(b,d);d=e.p1;return e.ret}()){d=new $$t.d8;if(b>0){var e;if(function(){var f=c.tryGetValue(b-1,e);e=f.p1;return f.ret}()){d.a(e);e.e()}}c.add(b,d)}return d},$type:new $.ig.Type("LevelSpanManager",$.ig.$ot)},true);$c("SpanSource:d8","Object",{init:function(){$.ig.$op.init.call(this);this.c=1},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},c:0,d:function(a){if(arguments.length===1){if(this.c!=a){var b=a-this.c;if(this.a()!=null){this.a().d(this.a().d()+b)}this.c=a}return a}else{return this.c}},b:false,e:function(){if(!this.b){this.b=true;this.d(this.d()+1)}},$type:new $.ig.Type("SpanSource",$.ig.$ot)},true);$c("ITableViewHeadersFactory:d9","Object",{$type:new $.ig.Type("ITableViewHeadersFactory",null)},true);$c("TableViewHeadersFactory:eb","Object",{_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_c:0,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_d:false,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},init:function(a,b,c,d,e){$.ig.$op.init.call(this);this.b(a);this.a(b);this.c(c);this.d(d);this.e(e)},createHeaderCells:function(){var $self=this;if(this.b().positionResolver().hasUnregisterdPositions()){this.b().positionResolver().completeRegisterPositions()}var a=this.b().positionResolver().rootPositionInfo();var b=new $$t.by($$t.$bu.$type.specialize($$t.$eh.$type),0);for(var c=0;c<a.positionSize();c++){b.add(new $$t.by($$t.$eh.$type,0))}$$t.$eb.createHeaderCells2(a,a.positionItemDepthMin(),b,this.d(),this.e());var d=new $$t.ec($$t.$ea.$type);var e=0;for(var f=0;f<a.positionSize();f++){var g=b.item(f);var h=0;var i=0;var k=g.getEnumerator();while(k.moveNext()){var j=k.current();var l;var m;var n;var o;if(this.c()==0){l=h;m=j.c().d();n=j.b().positionItemDepth()+e;o=j.d().d()}else{n=h;o=j.c().d();l=j.b().positionItemDepth()+e;m=j.d().d()}var p=this.b().tuples().__inner[j.b().positionIndex()];var q=p.item(j.b().positionItemIndex());var r=this.b().tuples().__inner[j.l()];if(this.a().positionResolver().hasUnregisterdPositions()){this.a().positionResolver().completeRegisterPositions()}var s=this.a().positionResolver().getPositionIndex(r);var t=function(){var $ret=new $$t.ea;$ret.axisName($self.b().name());$ret.hierarchyNumber(j.b().positionItemIndex());$ret.levelNumber(j.b().positionItemDepth());$ret.caption(q.caption());$ret.columnIndex(l);$ret.columnSpan(m);$ret.isExpanded(j.g());$ret.isExpandable(j.f());$ret.tupleIndex(s);$ret.memberIndex(j.b().positionItemIndex());$ret.rowIndex(n);$ret.rowSpan(o);return $ret}();if(!j.h()){h=h+j.c().d()}i=Math.max(i,j.b().positionItemDepth());d.add(t)}e+=i+1}return d},createHeaderCells2:function(a,b,c,d,e){var f=new $$t.d7(a.positionSize());var h=$$t.$cp.t($$t.$cj.$type.specialize(String,$.ig.$op.$type),a.values(),function(i){return i.positionItemDepth()==b}).getEnumerator();while(h.moveNext()){var g=h.current();var i;var j;var k=$$t.$eb.createHeaderCells1(a,g,c,f,d,e,i,j);i=k.p6;j=k.p7}},h:function(a,b,c,d,e,f){var g=$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.t($$t.$cj.$type.specialize(String,$.ig.$op.$type),a.values(),function(h){return h.positionItemDepth()==a.positionItemDepthMin()}));if(g.count()>0){var i=g.getEnumerator();while(i.moveNext()){var h=i.current();var j;var k;var l=$$t.$eb.createHeaderCells1(a,h,b,c,d,f,j,k);j=l.p6;k=l.p7;e.c().d(e.c().d()+k);if(j.h()){e.c().d(e.c().d()+1)}}e.c().d(e.c().d()-1)}else{f.add(a.positionIndex())}e.l(a.positionIndex())},createHeaderCells1:function(a,b,c,d,e,f,g,h){var i=c.item(b.positionItemIndex());var j=d.b(b.positionItemIndex(),b.positionItemDepth());var k=function(){var $ret=new $$t.eh;$ret.d(j);$ret.b(b);$ret.a(a);$ret.f(b.isExpandable());return $ret}();g=k;if(e){i.add(k);$$t.$eb.h(b,c,d,true,k,f)}var l=null;if(b.isExpanded()){l=$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.t($$t.$cj.$type.specialize(String,$.ig.$op.$type),a.values(),function(m){return m.parentKey()==b.key()}))}if(l!=null&&l.count()>0){var m=function(){var $ret=new $$t.eh;$ret.h(true);$ret.b(b);$ret.f(b.isExpandable());return $ret}();i.add(m);var o=l.getEnumerator();while(o.moveNext()){var n=o.current();var p;var q;var r=$$t.$eb.createHeaderCells1(a,n,c,d,e,f,p,q);p=r.p6;q=r.p7;m.c().d(m.c().d()+q);if(p.h()){m.c().d(m.c().d()+1)}}m.c().d(m.c().d()-1);k.g(true);k.f(false);m.g(true);k.e(m);if(!e){i.add(k);$$t.$eb.h(b,c,d,false,k,f)}m.l(k.l());g=m;h=k.c().d()+m.c().d()-1}else{if(b.isExpanded()){k.f(false)}if(!e){i.add(k);$$t.$eb.h(b,c,d,false,k,f)}h=k.c().d()}return{p6:g,p7:h}},$type:new $.ig.Type("TableViewHeadersFactory",$.ig.$ot,[$$t.$d9.$type])},true);$c("TableSuperCompactViewHeadersFactory:ei","Object",{_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_c:0,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_d:false,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},init:function(a,b,c,d,e){$.ig.$op.init.call(this);this.b(a);this.a(b);this.c(c);this.d(d);this.e(e)},createHeaderCells:function(){var $self=this;if(this.b().positionResolver().hasUnregisterdPositions()){this.b().positionResolver().completeRegisterPositions()}var a=this.b().positionResolver().rootPositionInfo();var b=new $$t.by($$t.$bu.$type.specialize($$t.$eh.$type),0);for(var c=0;c<a.positionSize();c++){b.add(new $$t.by($$t.$eh.$type,0))}$$t.$ei.createHeaderCells2(a,a.positionItemDepthMin(),b,this.d(),this.e());var d=new $$t.ec($$t.$ea.$type);var e=0;for(var f=0;f<a.positionSize();f++){var g=b.item(f);var h=0;var i=0;var k=g.getEnumerator();while(k.moveNext()){var j=k.current();var l;var m;var n;var o;if(this.c()==0){l=h;m=j.c().d();n=e;o=1}else{n=h;o=j.c().d();l=e;m=1}var p=this.b().tuples().__inner[j.b().positionIndex()];var q=p.item(j.b().positionItemIndex());var r=this.b().tuples().__inner[j.l()];if(this.a().positionResolver().hasUnregisterdPositions()){this.a().positionResolver().completeRegisterPositions()}var s=this.a().positionResolver().getPositionIndex(r);var t=function(){var $ret=new $$t.ea;$ret.axisName($self.b().name());$ret.hierarchyNumber(j.b().positionItemIndex());$ret.levelNumber(j.b().positionItemDepth());$ret.caption(q.caption());$ret.columnIndex(l);$ret.columnSpan(m);$ret.isExpanded(j.g());$ret.isExpandable(j.f());$ret.tupleIndex(s);$ret.memberIndex(j.b().positionItemIndex());$ret.rowIndex(n);$ret.rowSpan(o);return $ret}();if(!j.h()){h=h+j.c().d()}d.add(t)}e+=i+1}return d},createHeaderCells2:function(a,b,c,d,e){var f=new $$t.d7(a.positionSize());var h=$$t.$cp.t($$t.$cj.$type.specialize(String,$.ig.$op.$type),a.values(),function(i){return i.positionItemDepth()==b}).getEnumerator();while(h.moveNext()){var g=h.current();var i;var j;var k=$$t.$ei.createHeaderCells1(a,g,c,f,d,e,i,j);i=k.p6;j=k.p7}},h:function(a,b,c,d,e,f){var g=$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.t($$t.$cj.$type.specialize(String,$.ig.$op.$type),a.values(),function(h){return h.positionItemDepth()==a.positionItemDepthMin()}));if(g.count()>0){var i=g.getEnumerator();while(i.moveNext()){var h=i.current();var j;var k;var l=$$t.$ei.createHeaderCells1(a,h,b,c,d,f,j,k);j=l.p6;k=l.p7;e.c().d(e.c().d()+k);if(j.e()!=null){e.c().d(e.c().d()+1)}}e.c().d(e.c().d()-1)}else{f.add(a.positionIndex())}e.l(a.positionIndex())},createHeaderCells1:function(a,b,c,d,e,f,g,h){var i=c.item(b.positionItemIndex());var j=d.b(b.positionItemIndex(),b.positionItemDepth());var k=function(){var $ret=new $$t.eh;$ret.d(j);$ret.b(b);$ret.f(b.isExpandable());return $ret}();g=k;if(e){i.add(k);$$t.$ei.h(b,c,d,true,k,f)}var l=null;if(b.isExpanded()){l=$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.t($$t.$cj.$type.specialize(String,$.ig.$op.$type),a.values(),function(m){return m.parentKey()==b.key()}))}if(l!=null&&l.count()>0){var m=function(){var $ret=new $$t.eh;$ret.h(true);$ret.b(b);$ret.f(b.isExpandable());return $ret}();var o=l.getEnumerator();while(o.moveNext()){var n=o.current();var p;var q;var r=$$t.$ei.createHeaderCells1(a,n,c,d,e,f,p,q);p=r.p6;q=r.p7;m.c().d(m.c().d()+q);if(p.e()!=null){m.c().d(m.c().d()+1)}}m.c().d(m.c().d()-1);k.g(true);k.f(true);k.e(m);if(!e){i.add(k);$$t.$ei.h(b,c,d,false,k,f)}m.l(k.l());h=k.c().d()+m.c().d()-1}else{if(b.isExpanded()){k.f(false)}if(!e){i.add(k);$$t.$ei.h(b,c,d,false,k,f)}h=k.c().d()}return{p6:g,p7:h}},$type:new $.ig.Type("TableSuperCompactViewHeadersFactory",$.ig.$ot,[$$t.$d9.$type])},true);$c("TableViewHeaderCellSource:eh","Object",{init:function(){$.ig.$op.init.call(this);this.c(new $$t.d8);this.d(new $$t.d8)},_h:false,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},_k:0,k:function(a){if(arguments.length===1){this._k=a;return a}else{return this._k}},_i:0,i:function(a){if(arguments.length===1){this._i=a;return a}else{return this._i}},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_l:0,l:function(a){if(arguments.length===1){this._l=a;return a}else{return this._l}},_j:0,j:function(a){if(arguments.length===1){this._j=a;return a}else{return this._j}},_g:false,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},_f:false,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},toString:function(){return $x("{0}-{1}",this.b().positionIndex(),this.b().positionItemIndex())},$type:new $.ig.Type("TableViewHeaderCellSource",$.ig.$ot)},true);$c("TreeStackAttributesBehavior:ej","Object",{init:function(){$.ig.$op.init.call(this)},a:function(a,b){},$type:new $.ig.Type("TreeStackAttributesBehavior",$.ig.$ot)},true);$c("TreeStackNextDimensionFirstBehavior:em","TreeStackAttributesBehavior",{init:function(a,b){$$t.$ej.init.call(this);this.b(a);this.c(b)},_b:0,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_c:0,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},a:function(a,b){if(a.memberIndex()<b.memberIndex()){return true}if(a.memberIndex()==b.memberIndex()){if(a.levelNumber()<=b.levelNumber()){return true}}if(a.memberIndex()>b.memberIndex()&&a.parentMemberLevelNumber()<b.levelNumber()){return true}return false},$type:new $.ig.Type("TreeStackNextDimensionFirstBehavior",$$t.$ej.$type)},true);$c("TableViewTreeHeadersFactory:en","Object",{_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_c:0,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_d:false,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},_f:0,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},_g:0,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},init:function(a,b,c,d,e,f){$.ig.$op.init.call(this);this.b(a);this.a(b);this.c(c);this.d(true);this.e(d);this.f(e);this.g(f)},createHeaderCells:function(){var $self=this;if(this.b().positionResolver().hasUnregisterdPositions()){this.b().positionResolver().completeRegisterPositions()}var a=this.b().positionResolver().rootPositionInfo();var b=new $$t.by($$t.$eh.$type,0);$$t.$en.createHeaderCells2(a,a.positionItemDepthMin(),b,this.e());var c=new $$t.ck(String,$$t.$ea.$type,0);var d=new $$t.eo($$t.$ek.$type);var e=new $$t.ec($$t.$ea.$type);var f=0;var h=b.getEnumerator();while(h.moveNext()){var g=h.current();if(g.h()){continue}var i=this.b().tuples().__inner[g.b().positionIndex()];var j=i.item(g.b().positionItemIndex());var k=this.b().tuples().__inner[g.l()];if(this.a().positionResolver().hasUnregisterdPositions()){this.a().positionResolver().completeRegisterPositions()}var l=this.a().positionResolver().getPositionIndex(k);var m=function(){var $ret=new $$t.ek;$ret.axisName($self.b().name());$ret.hierarchyNumber(g.b().positionItemIndex());$ret.levelNumber(g.b().positionItemDepth());$ret.parentMemberLevelNumber(g.a().positionItemDepth());$ret.caption(j.caption());$ret.columnIndex(0);$ret.columnSpan(1);$ret.isExpanded(g.g());$ret.isExpandable(g.f());$ret.tupleIndex(l);$ret.memberIndex(g.b().positionItemIndex());$ret.rowIndex(f);$ret.rowSpan(1);return $ret}();c.add($x("{0}-{1}",m.tupleIndex(),m.memberIndex()),m);var n=g.b().positionItemIndex()>0&&g.b().positionItemDepth()==0;if(!g.h()&&!n){f=f+1}if(!n){e.add(m);this.m(d,m,new $$t.em(this.f(),this.g()))}}var p=e.getEnumerator();while(p.moveNext()){var o=p.current();if(o.memberIndex()<this.b().tupleSize()){var q=$x("{0}-{1}",o.tupleIndex(),o.memberIndex()+1);var r=null;if(function(){var s=c.tryGetValue(q,r);r=s.p1;return s.ret}()){o.isItemExpanded(r.isExpanded());o.isItemExpandable(r.isExpandable())}}}return e},m:function(a,b,c){var d=null;if(a.count()==0){this.l(a,b,null);return}d=a.peek();if(c.a(b,d)){this.h(a,b,c);d=null;if(a.count()>0){d=a.peek()}}this.l(a,b,d)},l:function(a,b,c){if(c!=null){if(b.memberIndex()>c.memberIndex()){b.indent(c.indent()+this.g())}else{b.indent(c.indent()+this.f())}}a.push(b)},h:function(a,b,c){a.pop();if(a.count()>0){var d=a.peek();if(c.a(b,d)){this.h(a,b,c)}}},createHeaderCells2:function(a,b,c,d){var e=new $$t.d7(a.positionSize());var g=$$t.$cp.t($$t.$cj.$type.specialize(String,$.ig.$op.$type),a.values(),function(h){return h.positionItemDepth()==b}).getEnumerator();while(g.moveNext()){var f=g.current();var h;var i;var j=$$t.$en.createHeaderCells1(a,f,c,e,d,true,h,i);h=j.p6;i=j.p7}},k:function(a,b,c,d,e,f){var g=$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.t($$t.$cj.$type.specialize(String,$.ig.$op.$type),a.values(),function(h){return h.positionItemDepth()==a.positionItemDepthMin()}));if(g.count()>0){var i=g.getEnumerator();while(i.moveNext()){var h=i.current();var j;var k;var l=$$t.$en.createHeaderCells1(a,h,b,c,e,f,j,k);j=l.p6;k=l.p7;d.c().d(d.c().d()+k);if(j.h()){d.c().d(d.c().d()+1)}}d.c().d(d.c().d()-1)}d.l(a.positionIndex())},createHeaderCells1:function(a,b,c,d,e,f,g,h){var i=c;var j=d.b(b.positionItemIndex(),b.positionItemDepth());var k=function(){var $ret=new $$t.eh;$ret.d(j);$ret.b(b);$ret.a(a);$ret.f(b.isExpandable());return $ret}();g=k;i.add(k);if(f){f=false;e.add(b.positionIndex())}var l=null;if(b.isExpanded()){l=$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.t($$t.$cj.$type.specialize(String,$.ig.$op.$type),a.values(),function(m){return m.parentKey()==b.key()
}))}if(l!=null&&l.count()>0){var m=function(){var $ret=new $$t.eh;$ret.h(true);$ret.b(b);$ret.a(a);$ret.f(b.isExpandable());return $ret}();i.add(m);var o=l.getEnumerator();while(o.moveNext()){var n=o.current();var p;var q;var r=$$t.$en.createHeaderCells1(a,n,c,d,e,true,p,q);p=r.p6;q=r.p7;m.c().d(m.c().d()+q);if(p.h()){m.c().d(m.c().d()+1)}}m.c().d(m.c().d()-1);k.g(true);m.g(true);k.e(m);m.l(k.l());g=m;h=k.c().d()+m.c().d()-1}else{h=k.c().d()}$$t.$en.k(b,c,d,k,e,false);return{p6:g,p7:h}},$type:new $.ig.Type("TableViewTreeHeadersFactory",$.ig.$ot,[$$t.$d9.$type])},true);$c("TableViewImpl:eq","Object",{init:function(a,b,c,d){var $self=this;this.w=40;this.x=20;$.ig.$op.init.call(this);if(a==null){throw new $$t.cv(0,"result")}this.result(a);this.originalResult(a);if(d==null){this.viewSettings(new $$t.er)}else{this.viewSettings(d)}this.hasColumns(b);this.hasRows(c);this.columnSortDirections(new $$t.ec($$t.$eu.$type));var e=this.columnSortDirections();e.collectionChanged=$.ig.Delegate.prototype.combine(e.collectionChanged,function(e,f){$self.i(true)});this.levelSortDirections(new $$t.ec($$t.$ev.$type));var f=this.levelSortDirections();f.collectionChanged=$.ig.Delegate.prototype.combine(f.collectionChanged,function(f,g){$self.i(true)});this.appliedColumnSortDirections(new $$t.by($$t.$eu.$type,0));this.appliedLevelSortDirections(new $$t.by($$t.$ev.$type,0));this.appliedSortDirectionsMap(new $$t.ck(String,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$$t.$c8.$type)),0))},_viewSettings:null,viewSettings:function(a){if(arguments.length===1){this._viewSettings=a;return a}else{return this._viewSettings}},_result:null,result:function(a){if(arguments.length===1){this._result=a;return a}else{return this._result}},_originalResult:null,originalResult:function(a){if(arguments.length===1){this._originalResult=a;return a}else{return this._originalResult}},_hasRows:false,hasRows:function(a){if(arguments.length===1){this._hasRows=a;return a}else{return this._hasRows}},_hasColumns:false,hasColumns:function(a){if(arguments.length===1){this._hasColumns=a;return a}else{return this._hasColumns}},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_h:false,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},_i:false,i:function(a){if(arguments.length===1){this._i=a;return a}else{return this._i}},m:null,k:null,l:null,rowHeaders:function(a){if(arguments.length===1){this.m=a;return a}else{if(!this.h()||this.i()){this.initialize()}return this.m}},columnHeaders:function(a){if(arguments.length===1){this.k=a;return a}else{if(!this.h()||this.i()){this.initialize()}return this.k}},resultCells:function(a){if(arguments.length===1){this.l=a;return a}else{if(!this.h()||this.i()){this.initialize()}return this.l}},_columnSortDirections:null,columnSortDirections:function(a){if(arguments.length===1){this._columnSortDirections=a;return a}else{return this._columnSortDirections}},_levelSortDirections:null,levelSortDirections:function(a){if(arguments.length===1){this._levelSortDirections=a;return a}else{return this._levelSortDirections}},_appliedColumnSortDirections:null,appliedColumnSortDirections:function(a){if(arguments.length===1){this._appliedColumnSortDirections=a;return a}else{return this._appliedColumnSortDirections}},_appliedLevelSortDirections:null,appliedLevelSortDirections:function(a){if(arguments.length===1){this._appliedLevelSortDirections=a;return a}else{return this._appliedLevelSortDirections}},_appliedSortDirectionsMap:null,appliedSortDirectionsMap:function(a){if(arguments.length===1){this._appliedSortDirectionsMap=a;return a}else{return this._appliedSortDirectionsMap}},initialize:function(){this.d(null);this.c(null);this.rowHeaders(null);this.columnHeaders(null);this.resultCells(null);this.result(this.originalResult());if(this.result().isEmpty()){this.i(false);this.h(true);return}if(this.levelSortDirections().count()>0){var a=new $$t.ex(this.result(),this.hasRows(),this.hasColumns(),this.levelSortDirections());this.result(a.b());this.appliedLevelSortDirections(a.h());this.appliedSortDirectionsMap(a.g())}else{this.appliedLevelSortDirections(new $$t.by($$t.$ev.$type,0));this.appliedSortDirectionsMap(new $$t.ck(String,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$$t.$c8.$type)),0))}if(this.hasRows()&&this.columnSortDirections().count()>0){if(this.appliedLevelSortDirections().count()>0){if(this.originalResult().axes().item(0).positionResolver().hasUnregisterdPositions()){this.originalResult().axes().item(0).positionResolver().completeRegisterPositions()}if(this.result().axes().item(0).positionResolver().hasUnregisterdPositions()){this.result().axes().item(0).positionResolver().completeRegisterPositions()}var b=new $$t.by($$t.$eu.$type,2,this.columnSortDirections().count());var c=new $$t.ck($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,1,this.appliedColumnSortDirections().count());var e=this.columnSortDirections().getEnumerator();while(e.moveNext()){var d=e.current();var f=this.originalResult().axes().item(0).tuples().__inner[d.tupleIndex()];var g=this.result().axes().item(0).positionResolver().getPositionIndex(f);var h=new $$t.eu;h.sortDirection(d.sortDirection());h.tupleIndex(g);h.comparer(d.comparer());b.add(h);c.item(g,d.tupleIndex())}var i=new $$t.e1(this.result(),this.hasRows(),this.hasColumns(),b);this.result(i.b());var k=i.g().getEnumerator();while(k.moveNext()){var j=k.current();j.tupleIndex(c.item(j.tupleIndex()))}this.appliedColumnSortDirections(i.g())}else{var l=new $$t.e1(this.result(),this.hasRows(),this.hasColumns(),this.columnSortDirections());this.result(l.b());this.appliedColumnSortDirections(l.g())}}else{this.appliedColumnSortDirections(new $$t.by($$t.$eu.$type,0))}var m=0;var n=new $$t.ck($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);var o=1;if(this.hasColumns()){var p=this.result().axes().item(m);var q=this.originalResult().axes().item(m);var r=this.r(p,q);for(var s=0;s<r.count();s++){var t=r.item(s);n.add(t,s)}m++;o=p.tuples().count()}var u=new $$t.ck($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);if(this.hasRows()){var v=this.result().axes().item(m);var w=this.originalResult().axes().item(m);var x=this.s(v,w);for(var y=0;y<x.count();y++){var z=x.item(y);u.add(z,y)}}var aa=new $$t.ec($$t.$et.$type);for(var ab=0;ab<this.result().cells().count();ab++){var ac=this.result().cells().item(ab);var ad;var ae=ac.properties().tryGetValue("Value",ad);ad=ae.p1;var af;var ag=ac.properties().tryGetValue("FmtValue",af);af=ag.p1;var ah=ac.cellOrdinal();if(this.hasColumns()){var ai=ah%o;var aj=n.item(ai);if(ai!=aj){var ak=$a(ah,o);ah=ak*o+aj}}if(this.hasRows()){var al=$a(ah,o);var am=u.item(al);if(al!=am){var an=ah%o;ah=am*o+an}}aa.add(function(){var $ret=new $$t.et;$ret.value(ad);$ret.formattedValue(af);$ret.cellOrdinal(ah);$ret.resultCellIndex(ab);return $ret}());this.resultCells(aa)}this.i(false);this.h(true)},r:function(a,b){var c=new $$t.by($.ig.Number.prototype.$type,0);if(this.viewSettings().b()){this.c(new $$t.ei(a,b,0,this.viewSettings().c(),c))}else{this.c(new $$t.eb(a,b,0,this.viewSettings().c(),c))}this.columnHeaders(this.c().createHeaderCells());return c},w:0,x:0,s:function(a,b){var c=new $$t.by($.ig.Number.prototype.$type,0);var d=this.viewSettings().a();var e=this.viewSettings().d();switch(d){case 0:this.d(new $$t.eb(a,b,1,e,c));break;case 1:this.d(new $$t.ei(a,b,1,e,c));break;case 2:var f=this.w;var g=this.x;var h=$b($$t.$e3.$type,this.viewSettings());if(h!=null){f=h.e();g=h.f()}this.d(new $$t.en(a,b,1,c,f,g));break}this.rowHeaders(this.d().createHeaderCells());return c},$type:new $.ig.Type("TableViewImpl",$.ig.$ot)},true);$c("OlapResultView:e4","Object",{init:function(a,b,c,d){$.ig.$op.init.call(this);if(a==null){throw new $$t.cv(0,"result")}this.result(a);this.visibleResult(b);this.hasColumns(c);this.hasRows(d)},_result:null,result:function(a){if(arguments.length===1){this._result=a;return a}else{return this._result}},_visibleResult:null,visibleResult:function(a){if(arguments.length===1){this._visibleResult=a;return a}else{return this._visibleResult}},_hasRows:false,hasRows:function(a){if(arguments.length===1){this._hasRows=a;return a}else{return this._hasRows}},_hasColumns:false,hasColumns:function(a){if(arguments.length===1){this._hasColumns=a;return a}else{return this._hasColumns}},c:function(a,b,c,d,e){var f=0;var g=null;var h=1;if(e){g=a.axes().item(f);h=g.tuples().count();f++}var i=null;var j=1;if(d){i=a.axes().item(f);j=i.tuples().count()}var k=1;if(b!=null){k=b.tuples().count()}var l=1;if(c!=null){l=c.tuples().count()}var m=new Array(k*l);if(a.cells().count()>0){var n=0;var o=a.cells().item(n);for(var p=0;p<j;p++){var q=$a(o.cellOrdinal(),h);if(q!=p){continue}var r=0;if(b!=null&&i!=null){var s=i.tuples().__inner[p];r=b.positionResolver().getPositionIndex(s)}if(r==-1){while(q==p){n++;if(n<a.cells().count()){o=a.cells().item(n);q=$a(o.cellOrdinal(),h)}else{break}}continue}var t=o.cellOrdinal()%h;for(var u=0;u<h;u++){if(t!=u){continue}var v=-1;if(c==null||g==null){v=0}else{var w=g.tuples().__inner[u];v=c.positionResolver().getPositionIndex(w)}if(v==-1){n++;if(n<a.cells().count()){o=a.cells().item(n);q=$a(o.cellOrdinal(),h);if(q>p){break}t=o.cellOrdinal()%h}continue}var x=o.clone();x.cellOrdinal(r*l+v);m[x.cellOrdinal()]=x;n++;if(n<a.cells().count()){o=a.cells().item(n);q=$a(o.cellOrdinal(),h);if(q>p){break}t=o.cellOrdinal()%h}}}}var y=new $$t.by($$t.$db.$type,0);for(var aa=0;aa<m.length;aa++){var z=m[aa];if(z!=null){y.add(z)}}var ab=new $$t.by($$t.$bw.$type,0);if(e){ab.add(c)}if(d){ab.add(b)}return function(){var $ret=new $$t.bt;$ret.axes(ab);$ret.cells(y);$ret.isEmpty(!d&&!e&&y.count()==0);return $ret}()},a:function(a,b,c){var d=new $$t.by($$t.$c9.$type,0);if(c){for(var e=0;e<b.count();e++){var f=b.item(e);d.add(a.tuples().__inner[f].clone())}}else{var g=0;var h=b.item(g);for(var i=0;i<a.tuples().count();i++){if(i==h){g++;if(g<b.count()){h=b.item(g)}}else{d.add(a.tuples().__inner[i].clone())}}}var j=function(){var $ret=new $$t.bw(d,a.tupleSize());$ret.name(a.name());return $ret}();return j},expandTupleMember:function(a,b,c){var d=this.f(a,b,c,this.visibleResult());if(d==null){return null}if(!d.isExpandable()){throw new $$t.c0(1,"The position is not expandable.")}if(d.isExpanded()){return this}var e=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,this.visibleResult().axes(),function(f){return f.name()==a}));var f=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,this.result().axes(),function(g){return g.name()==a}));var g=a=="Axis0"&&!this.hasColumns()||a=="Axis1"&&this.hasRows();var h=e.tuples().__inner[b];var i=f.positionResolver().getPositionIndex(h);var j=this.l(a,i,c,this.result());if(j.count()==0){return null}var k=null;var l=null;if(g){k=this.a(f,j,true);if(this.hasColumns()){l=this.visibleResult().axes().item(0)}}else{l=this.a(f,j,true);if(this.hasRows()){k=this.visibleResult().axes().item(1)}}var m=this.c(this.result(),k,l,this.hasRows(),this.hasColumns());var n=this.b(this.visibleResult(),m,f.name());return new $$t.e4(this.result(),n,this.hasColumns(),this.hasRows())},collapseTupleMember:function(a,b,c){var d=this.f(a,b,c,this.visibleResult());if(d==null){return null}if(!d.isExpandable()){throw new $$t.c0(1,"The position is not expandable.")}if(!d.isExpanded()){return this}var e=this.l(a,b,c,this.visibleResult());if(e.count()==0){return null}var f=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,this.visibleResult().axes(),function(g){return g.name()==a}));var g=a=="Axis0"&&!this.hasColumns()||a=="Axis1"&&this.hasRows();var h=null;var i=null;if(g){h=this.a(f,e,false);if(this.hasColumns()){i=this.visibleResult().axes().item(0)}}else{i=this.a(f,e,false);if(this.hasRows()){h=this.visibleResult().axes().item(1)}}var j=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,this.result().axes(),function(k){return k.name()==a}));var k=j.tuples().__inner[b];if(j.positionResolver().hasUnregisterdPositions()){j.positionResolver().completeRegisterPositions()}var l=j.positionResolver().getHostPositionItemInfo(k,c);var m=l.item(k.item(c).key());m.isExpanded(false);var n=this.c(this.visibleResult(),h,i,this.hasRows(),this.hasColumns());return new $$t.e4(this.result(),n,this.hasColumns(),this.hasRows())},extend:function(a,b){var c=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,this.visibleResult().axes(),function(d){return d.name()==b}));var d=b=="Axis0"&&!this.hasColumns()||b=="Axis1"&&this.hasRows();var e=null;var f=null;var g=null;var h=false;if(d){e=c;if(this.hasColumns()){f=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,this.visibleResult().axes(),function(i){return i.name()!=b}));g=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,this.result().axes(),function(i){return i.name()!=b}));h=f.tuples().count()!=g.tuples().count()}}else{f=c;if(this.hasRows()){e=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,this.visibleResult().axes(),function(i){return i.name()!=b}));g=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,this.result().axes(),function(i){return i.name()!=b}));h=e.tuples().count()!=g.tuples().count()}}var i=null;var j=null;if(g!=null&&h){var k=this.c(this.result(),e,f,this.hasRows(),this.hasColumns());i=this.b(k,a,b);j=this.b(k,a,b)}else{i=this.b(this.result(),a,b);j=this.b(this.visibleResult(),a,b)}return new $$t.e4(i,j,this.hasColumns(),this.hasRows())},b:function(a,b,c){var d=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,a.axes(),function(e){return e.name()==c}));if(d==null){return null}var e=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,b.axes(),function(f){return f.name()==c}));var f=c=="Axis0"&&!this.hasColumns()||c=="Axis1"&&this.hasRows();var g=null;var h=null;if(f){if(this.hasColumns()){g=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,a.axes(),function(i){return i.name()!=c}));h=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,b.axes(),function(i){return i.name()!=c}))}}else{if(this.hasRows()){g=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,a.axes(),function(i){return i.name()!=c}));h=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,b.axes(),function(i){return i.name()!=c}))}}var i=new $$t.by($$t.$c9.$type,0);var k=d.tuples().getEnumerator();while(k.moveNext()){var j=k.current();i.add(j.clone())}var m=e.tuples().getEnumerator();while(m.moveNext()){var l=m.current();i.add(l)}var n=e.tuples().count();var o=h!=null&&h.tuples().count()>0?h.tuples().count():1;var p=d.tuples().count()>0?d.tuples().count():1;var q=g!=null&&g.tuples().count()>0?g.tuples().count():1;var r=p*q;var s=new $$t.by($$t.$db.$type,0);if(f){var u=a.cells().getEnumerator();while(u.moveNext()){var t=u.current();s.add(t.clone())}var v=new Array(n*q);var w=p*q;var y=b.cells().getEnumerator();while(y.moveNext()){var x=y.current();var z=x.clone();var aa=this.m(z.cellOrdinal(),g,h);var ab=$a(z.cellOrdinal(),o);z.cellOrdinal(ab*q+aa);z.cellOrdinal(z.cellOrdinal()+r);v[z.cellOrdinal()-w]=z}for(var ac=0;ac<v.length;ac++){var ad=v[ac];if(ad!=null){s.add(ad)}}}else{var ae=new Array(q*(p+n));var ag=a.cells().getEnumerator();while(ag.moveNext()){var af=ag.current();var ah=af.clone();var ai=$a(ah.cellOrdinal(),p);ah.cellOrdinal(ah.cellOrdinal()+ai*n);ae[ah.cellOrdinal()]=ah}var ak=b.cells().getEnumerator();while(ak.moveNext()){var aj=ak.current();var al=aj.clone();var am=this.n(al.cellOrdinal(),g,h,n);var an=$a(aj.cellOrdinal(),n);if(am!=an){}var ao=al.cellOrdinal()%n;al.cellOrdinal(am*n+ao);al.cellOrdinal(al.cellOrdinal()+(am+1)*p);ae[al.cellOrdinal()]=al}for(var aq=0;aq<ae.length;aq++){var ap=ae[aq];if(ap!=null){s.add(ap)}}}var ar=new $$t.bt;ar.axes(new $$t.by($$t.$bw.$type,0));var as=function(){var $ret=new $$t.bw(i,d.tupleSize());$ret.name(d.name());return $ret}();if(f){if(g!=null){ar.axes().add(g)}ar.axes().add(as)}else{ar.axes().add(as);if(g!=null){ar.axes().add(g)}}ar.cells(s);ar.isEmpty(!this.hasColumns()&&!this.hasRows()&&s.count()==0);return ar},m:function(a,b,c){if(c==null){return 0}var d=a%c.tuples().count();var e=c.tuples().__inner[d];var f=b.positionResolver().getPositionIndex(e);return f},n:function(a,b,c,d){if(c==null){return 0}var e=$a(a,d);var f=c.tuples().__inner[e];var g=b.positionResolver().getPositionIndex(f);return g},l:function(a,b,c,d){var e=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,d.axes(),function(f){return f.name()==a}));var f=e.tuples().__inner[b];var g=f.item(c);if(e.positionResolver().hasUnregisterdPositions()){e.positionResolver().completeRegisterPositions()}var h=e.positionResolver().i(g,0);if(h!=null){return $$t.$cp.y($.ig.Number.prototype.$type,h)}return null},f:function(a,b,c,d){var e=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,d.axes(),function(f){return f.name()==a}));var f=e.tuples().__inner[b];var g=f.item(c);if(e.positionResolver().hasUnregisterdPositions()){e.positionResolver().completeRegisterPositions()}var h=e.positionResolver().getHostPositionItemInfo(f,c);var i;var j=h.tryGetValue(g.key(),i);i=j.p1;return i},$type:new $.ig.Type("OlapResultView",$.ig.$ot)},true);$c("ResultViewHelper:e5","Object",{init:function(){$.ig.$op.init.call(this)},e:function(a,b,c,d,e){$$t.$e5.d(a,b,c,true,e.visibleResult());$$t.$e5.d(a,b,c,true,e.result())},f:function(a,b,c){var d=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,b.visibleResult().axes(),function(e){return e.name()==a}));var e=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,c.visibleResult().axes(),function(f){return f.name()==a}));$$t.$e5.b(d.positionResolver(),e.positionResolver());var f=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,b.result().axes(),function(g){return g.name()==a}));var g=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,c.result().axes(),function(h){return h.name()==a}));$$t.$e5.b(f.positionResolver(),g.positionResolver())},d:function(a,b,c,d,e){var f=$$t.$cp.ac($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,e.axes(),function(g){return g.name()==a}));if(f.positionResolver().hasUnregisterdPositions()){f.positionResolver().completeRegisterPositions()}$$t.$e5.c(b,c,d,f.positionResolver())},c:function(a,b,c,d){if(d.hasUnregisterdPositions()){d.completeRegisterPositions()}var e=d.positions().__inner[a];var f=d.getHostPositionItemInfo(e,b);var g=f.item(e.item(b).key());g.isExpanded(c)},b:function(a,b){if(a.hasUnregisterdPositions()){a.completeRegisterPositions()}if(b.hasUnregisterdPositions()){b.completeRegisterPositions()}$$t.$e5.a(a.rootPositionInfo(),b.rootPositionInfo())},a:function(a,b){var d=a.getEnumerator();while(d.moveNext()){var c=d.current();var e=c.value();var f;if(function(){var g=b.tryGetValue(c.key(),f);f=g.p1;return g.ret}()){if(e.isExpanded()!=true){f.isExpanded(false)}if(f.count()>0){$$t.$e5.a(e,f)}}}},$type:new $.ig.Type("ResultViewHelper",$.ig.$ot)},true);$c("OlapTableViewHeaderCell:ea","Object",{init:function(){$.ig.$op.init.call(this);this.columnSpan(1);this.rowSpan(1)},_id:null,id:function(a){if(arguments.length===1){this._id=a;return a}else{return this._id}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_isExpanded:false,isExpanded:function(a){if(arguments.length===1){this._isExpanded=a;return a}else{return this._isExpanded}},_isExpandable:false,isExpandable:function(a){if(arguments.length===1){this._isExpandable=a;return a}else{return this._isExpandable}},_rowIndex:0,rowIndex:function(a){if(arguments.length===1){this._rowIndex=a;return a}else{return this._rowIndex}},_rowSpan:0,rowSpan:function(a){if(arguments.length===1){this._rowSpan=a;return a}else{return this._rowSpan}},_columnIndex:0,columnIndex:function(a){if(arguments.length===1){this._columnIndex=a;return a}else{return this._columnIndex}},_columnSpan:0,columnSpan:function(a){if(arguments.length===1){this._columnSpan=a;return a}else{return this._columnSpan}},_axisName:null,axisName:function(a){if(arguments.length===1){this._axisName=a;return a}else{return this._axisName}},_tupleIndex:0,tupleIndex:function(a){if(arguments.length===1){this._tupleIndex=a;return a}else{return this._tupleIndex}},_memberIndex:0,memberIndex:function(a){if(arguments.length===1){this._memberIndex=a;return a}else{return this._memberIndex}},_levelNumber:0,levelNumber:function(a){if(arguments.length===1){this._levelNumber=a;return a}else{return this._levelNumber}},_hierarchyNumber:0,hierarchyNumber:function(a){if(arguments.length===1){this._hierarchyNumber=a;return a}else{return this._hierarchyNumber}},_headerSpan:0,headerSpan:function(a){if(arguments.length===1){this._headerSpan=a;return a}else{return this._headerSpan}},_rowOrigin:0,rowOrigin:function(a){if(arguments.length===1){this._rowOrigin=a;return a}else{return this._rowOrigin}},toString:function(){return this.caption()},$type:new $.ig.Type("OlapTableViewHeaderCell",$.ig.$ot)},true);$c("OlapTableViewResultCell:et","Object",{init:function(){$.ig.$op.init.call(this)},_value:null,value:function(a){if(arguments.length===1){this._value=a;return a}else{return this._value}},_formattedValue:null,formattedValue:function(a){if(arguments.length===1){this._formattedValue=a;return a}else{return this._formattedValue}},_cellOrdinal:0,cellOrdinal:function(a){if(arguments.length===1){this._cellOrdinal=a;return a}else{return this._cellOrdinal}},_resultCellIndex:0,resultCellIndex:function(a){if(arguments.length===1){this._resultCellIndex=a;return a}else{return this._resultCellIndex}},$type:new $.ig.Type("OlapTableViewResultCell",$.ig.$ot)},true);$c("TableViewSettings:er","Object",{init:function(){$.ig.$op.init.call(this)},_c:false,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_d:false,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_a:0,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_b:false,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},$type:new $.ig.Type("TableViewSettings",$.ig.$ot)},true);$c("OlapTableViewTreeHeaderCell:ek","OlapTableViewHeaderCell",{init:function(){$$t.$ea.init.call(this);this.parentMemberLevelNumber(-1)},_indent:0,indent:function(a){if(arguments.length===1){this._indent=a;return a}else{return this._indent}},_parentMemberLevelNumber:0,parentMemberLevelNumber:function(a){if(arguments.length===1){this._parentMemberLevelNumber=a;return a}else{return this._parentMemberLevelNumber}},_isItemExpanded:false,isItemExpanded:function(a){if(arguments.length===1){this._isItemExpanded=a;return a}else{return this._isItemExpanded}},_isItemExpandable:false,isItemExpandable:function(a){if(arguments.length===1){this._isItemExpandable=a;return a}else{return this._isItemExpandable}},$type:new $.ig.Type("OlapTableViewTreeHeaderCell",$$t.$ea.$type)},true);$c("TreeLayoutTableViewSettings:e3","TableViewSettings",{init:function(a,b){$$t.$er.init.call(this);this.a(2);this.e(a);this.f(b)},_e:0,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},_f:0,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},$type:new $.ig.Type("TreeLayoutTableViewSettings",$$t.$er.$type)},true);$c("ArrayListCollection$1:ec","Object",{$t:null,init:function($t){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this);this.inner(new $.ig.Array)},_inner:null,inner:function(a){if(arguments.length===1){this._inner=a;return a}else{return this._inner}},collectionChanged:null,indexOf:function(a){return this.inner().indexOf($d(this.$t,a))},insert:function(a,b){this.inner().insert(a,$d(this.$t,b));this.d(a,b)},removeAt:function(a){var b=$u(this.$t,this.inner()[a]);this.inner().removeAt(a);this.e(a,b)},item:function(a,b){if(arguments.length===2){this.inner()[a]=$d(this.$t,b);return b}else{return $u(this.$t,this.inner()[a])}},add:function(a){this.inner().add($d(this.$t,a));this.d(this.inner().length-1,a)},clear:function(){this.inner().clear();this.c()},contains:function(a){return this.inner().contains($d(this.$t,a))},copyTo:function(a,b){throw new $$t.cg(0)},count:function(){return this.inner().length},isReadOnly:function(){return false},remove:function(a){var b=this.inner().indexOf($d(this.$t,a));if(b>=0){this.inner().removeAt(b);this.e(b,a);return true}return false},b:function(){var d__=new $.ig.ArrayListCollection___Enumerate__IteratorClass$1(this.$t,-2);d__.__4__this=this;return d__},getEnumerator:function(){return this.b().getEnumerator()},d:function(a,b){if(this.collectionChanged!=null){var c=new $$t.ef(1,0,$d(this.$t,b),a);this.collectionChanged(this,c)}},e:function(a,b){if(this.collectionChanged!=null){var c=new $$t.ef(1,1,$d(this.$t,b),a);this.collectionChanged(this,c)}},c:function(){if(this.collectionChanged!=null){var a=new $$t.ef(1,4,null,-1);this.collectionChanged(this,a)}},$type:new $.ig.Type("ArrayListCollection$1",$.ig.$ot,[$$t.$bu.$type.specialize(0),$$t.$ed.$type])},true);$c("IOlapDataSource:e6","Object",{$type:new $.ig.Type("IOlapDataSource",null)},true);$c("MeasureList:fa","Object",{init:function(){$.ig.$op.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},uniqueName:function(a){if(arguments.length===1){this.name(a);return a}else{return this.name()}},_measures:null,measures:function(a){if(arguments.length===1){this._measures=a;return a}else{return this._measures}},$type:new $.ig.Type("MeasureList",$.ig.$ot,[$$t.$a.$type])},true);$c("OlapMetadataTreeItem:e7","Object",{init:function(){$.ig.$op.init.call(this)},_item:null,item:function(a){if(arguments.length===1){this._item=a;return a}else{return this._item}},_type:0,type:function(a){if(arguments.length===1){this._type=a;return a}else{return this._type}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_children:null,children:function(a){if(arguments.length===1){this._children=a;return a}else{return this._children}},e:function(a){if(this.children()==null){this.children(new Array(1));this.children()[0]=a;return}var b=new Array(this.children().length+1);$.ig.util.arrayCopy1(this.children(),0,b,0,this.children().length);b[this.children().length]=a;this.children(b)},$type:new $.ig.Type("OlapMetadataTreeItem",$.ig.$ot)},true);$c("OlapDataSource:fb","Object",{v:null,u:null,ag:null,ah:0,j:0,g:null,init:function(a){this.v=new $$t.by($$t.$fh.$type,0);this.u=new $$t.by($$t.$fh.$type,0);this.ag=new $$t.by(String,0);this.ae=new $$t.by(String,0);$.ig.$op.init.call(this);this.x(new $$t.by($$t.$fg.$type,0));this.af(new $$t.by($$t.$fg.$type,0));this.y(new $$t.by($$t.$fg.$type,0));this.o(false);this.ak(null);this.t(false);this.at(null);this.isInitialized(false);this.m(false);this.s(false);this.n(false);this.r(false);this.q(false);this.p(false);this.catalogs(new $$t.ec($$t.$ba.$type));this.cubes(new $$t.ec($$t.$a8.$type));this.measureGroups(new $$t.ec($$t.$bp.$type));this.rowAxis(new $$t.ec($$t.$a.$type));this.columnAxis(new $$t.ec($$t.$a.$type));this.filters(new $$t.ec($$t.$bk.$type));this.measures(new $$t.ec($$t.$bn.$type));this.measureListLocation(1);this.measureListIndex(-1);this.sourceOptions(a);this.result(function(){var $ret=new $$t.bt;$ret.isEmpty(true);return $ret}())},_isInitialized:false,isInitialized:function(a){if(arguments.length===1){this._isInitialized=a;return a}else{return this._isInitialized}},_catalogs:null,catalogs:function(a){if(arguments.length===1){this._catalogs=a;return a}else{return this._catalogs}},_cubes:null,cubes:function(a){if(arguments.length===1){this._cubes=a;return a}else{return this._cubes}},_cube:null,cube:function(a){if(arguments.length===1){this._cube=a;return a}else{return this._cube}},_measureGroup:null,measureGroup:function(a){if(arguments.length===1){this._measureGroup=a;return a}else{return this._measureGroup}},_measureGroups:null,measureGroups:function(a){if(arguments.length===1){this._measureGroups=a;return a}else{return this._measureGroups}},_sourceOptions:null,sourceOptions:function(a){if(arguments.length===1){this._sourceOptions=a;return a}else{return this._sourceOptions}},dataProviderFactory:function(a){if(arguments.length===1){this.g=a;return a}else{if(this.g==null){this.g=this.h()}return this.g}},_metadataTree:null,metadataTree:function(a){if(arguments.length===1){this._metadataTree=a;return a}else{return this._metadataTree}},_rowAxis:null,rowAxis:function(a){if(arguments.length===1){this._rowAxis=a;return a}else{return this._rowAxis}},_columnAxis:null,columnAxis:function(a){if(arguments.length===1){this._columnAxis=a;return a}else{return this._columnAxis}},_filters:null,filters:function(a){if(arguments.length===1){this._filters=a;return a}else{return this._filters}},_measures:null,measures:function(a){if(arguments.length===1){this._measures=a;return a}else{return this._measures}},measureListIndex:function(a){if(arguments.length===1){if(this.ah!=a){this.p(true);this.ah=a;this.a0();this.p(false)}return a}else{return this.ah}},measureListLocation:function(a){if(arguments.length===1){if(this.j!=a){this.ay();this.j=a;this.a0()}return a}else{return this.j}},_result:null,result:function(a){if(arguments.length===1){this._result=a;return a}else{return this._result}},_l:null,l:function(a){if(arguments.length===1){this._l=a;return a}else{return this._l}},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_x:null,x:function(a){if(arguments.length===1){this._x=a;return a}else{return this._x}},_af:null,af:function(a){if(arguments.length===1){this._af=a;return a}else{return this._af}},_y:null,y:function(a){if(arguments.length===1){this._y=a;return a}else{return this._y}},ae:null,_o:false,o:function(a){if(arguments.length===1){this._o=a;return a}else{return this._o}},_ak:null,ak:function(a){if(arguments.length===1){this._ak=a;return a}else{return this._ak}},_t:false,t:function(a){if(arguments.length===1){this._t=a;return a}else{return this._t}},_at:null,at:function(a){if(arguments.length===1){this._at=a;return a}else{return this._at}},_m:false,m:function(a){if(arguments.length===1){this._m=a;return a}else{return this._m}},_s:false,s:function(a){if(arguments.length===1){this._s=a;return a}else{return this._s}},_n:false,n:function(a){if(arguments.length===1){this._n=a;return a}else{return this._n}},_r:false,r:function(a){if(arguments.length===1){this._r=a;return a}else{return this._r}},_q:false,q:function(a){if(arguments.length===1){this._q=a;return a}else{return this._q}},_p:false,p:function(a){if(arguments.length===1){this._p=a;return a}else{return this._p}},getMembersOfLevel:function(a){},getMembersOfHierarchy:function(a){},getMembersOfMember:function(a){},setCube:function(a){if(!this.isInitialized()){throw new $$t.c0(1,"Data source is not initialized.")}return this.ap(a)},setMeasureGroup:function(a){if(!this.isInitialized()){throw new $$t.c0(1,"Data source is not initialized.")}return this.aq(a)},getCoreElement:function(a,b){if(b==$$t.$fa.$type){var c;if(this.measureListLocation()==1){c=this.columnAxis()}else{c=this.rowAxis()}var d=null;var f=c.getEnumerator();while(f.moveNext()){var e=f.current();d=$b($$t.$fa.$type,e);if(d!=null){break}}return d}else{return $$t.$cp.ae($$t.$a.$type,this.getCoreElements(a,b))}},getCoreElements:function(a,b){if(b==$$t.$bb.$type){return this.a($$t.$bb.$type,$$t.$cp.t($$t.$bb.$type,this.c().t(),function(c){return a(c)}))}if(b==$$t.$bk.$type){return this.a($$t.$bk.$type,$$t.$cp.t($$t.$bk.$type,this.c().u(),function(c){return a(c)}))}if(b==$$t.$bm.$type){return this.a($$t.$bm.$type,$$t.$cp.t($$t.$bm.$type,this.c().x(),function(c){return a(c)}))}if(b==$$t.$bn.$type){return this.a($$t.$bn.$type,$$t.$cp.t($$t.$bn.$type,this.c().z(),function(c){return a(c)}))}if(b==$$t.$bo.$type){return this.a($$t.$bo.$type,$$t.$cp.t($$t.$bo.$type,this.c().v(),function(c){return a(c)}))}if(b==$$t.$bl.$type){return this.a($$t.$bl.$type,$$t.$cp.t($$t.$bl.$type,this.c().w(),function(c){return a(c)
}))}throw new $$t.w(0,"Supported types are Dimension, Hierarchy, Level and Measure")},expandTupleMember:function(a,b,c){var d=this.d(a,this.result());if(d==null){throw new $$t.c0(1,"No axis found for the specified index.")}var e=$$t.$cp.ae($$t.$fh.$type,$$t.$cp.t($$t.$fh.$type,this.v,function(f){return f.c()==a&&f.b()==b&&f.a()==c}));if(e==null){e=function(){var $ret=new $$t.fh;$ret.c(a);$ret.a(c);$ret.b(b);return $ret}();this.v.add(e)}else{this.v.remove(e)}},collapseTupleMember:function(a,b,c){var d=this.d(a,this.result());if(d==null){throw new $$t.c0(1,"No axis found for the specified index.")}var e=$$t.$cp.ae($$t.$fh.$type,$$t.$cp.t($$t.$fh.$type,this.v,function(f){return f.c()==a&&f.b()==b&&f.a()==c}));if(e==null){e=function(){var $ret=new $$t.fh;$ret.c(a);$ret.a(c);$ret.b(b);return $ret}();this.u.add(e)}else{this.v.remove(e)}},clearPendingChanges:function(){this.u.clear();this.v.clear()},update:function(){var $self=this;if(this.t()){return this.at()}this.t(true);var a=null;if(this.v.count()>0){a=this.am(this.v)}if(this.ag.count()>0){var b=new $$t.dl(Array,0);var c=new Array(this.ag.count());for(var d=0;d<c.length;d++){c[d]=this.getMembersOfHierarchy(this.ag.__inner[d])}this.ag.clear();var e=new $$t.fi;e.c(c,b.e.runOn(b));if(a!=null){a=$$t.$fj.a(Array,a,function(f){return b.b()})}else{a=b.b()}}if(a!=null){a=$$t.$fj.a($$t.$bt.$type,a,function(f){return $self.ar()})}else{a=this.ar()}this.at(a);this.at().i(function(f){$self.t(false);$self.at(null)});return a},initialize:function(){var $self=this;if(this.o()){return this.ak()}this.o(true);this.ak(this.ao());var a=this.ak();this.ak().i(function(b){$self.o(false);$self.ak(null)});return a},addFilterMember:function(a,b){var $self=this;var c;var d=function(){var e=$self.b(a,c);c=e.p1;return e.ret}();if(d==null){d=new $$t.fg(a,function(){var $ret=new $$t.ec(String);$ret.add(b);return $ret}());c.add(d)}if(!d.a().contains(b)){d.a().add(b);if(this.ae.contains(b)){this.ae.remove(b)}else{this.ae.add(b)}}var e;if(!function(){var f=$self.c().h(b,e);e=f.p1;return f.ret}()&&!this.ag.contains(a)){this.ag.add(a)}},getFilterMemberNames:function(a){var $self=this;var b;var c=function(){var d=$self.b(a,b);b=d.p1;return d.ret}();if(c!=null){return this.a(String,c.a())}return new $$t.ec(String)},removeFilterMember:function(a,b){var $self=this;var c;var d=function(){var e=$self.b(a,c);c=e.p1;return e.ret}();if(d==null){return}if(d.a().remove(b)){if(this.ae.contains(b)){this.ae.remove(b)}else{this.ae.add(b)}}},removeAllFilterMembers:function(a){var $self=this;var b;var c=function(){var d=$self.b(a,b);b=d.p1;return d.ret}();if(c==null){return}for(var d=c.a().count()-1;d>=0;d--){var e=c.a().item(d);c.a().removeAt(d);if(this.ae.contains(e)){this.ae.remove(e)}else{this.ae.add(e)}}},getProviderDefaultProperties:function(){var a=new $$t.by($$t.$d4.$type,0);return a},getProviderDefaultRestrictions:function(){var a=new $$t.by($$t.$d4.$type,0);return a},tryGetMember:function(a,b){var $self=this;return{ret:function(){var c=$self.c().h(a,b);b=c.p1;return c.ret}(),p1:b}},tryGetMembersForLevel:function(a,b){var $self=this;return{ret:function(){var c=$self.c().j(a,b);b=c.p1;return c.ret}(),p1:b}},ao:function(){},ar:function(){},h:function(){},ai:function(){},ap:function(a){var $self=this;if(String.isNullOrEmpty(a)){if(a==null){throw new $$t.cv(0,"cubeName")}throw new $$t.c0(1,"cubeName cannot be empty.")}var b=new $$t.dl($$t.$e7.$type,0);if(this.cube()!=null){if(this.cube().name()==a){b.e(this.metadataTree());return b.b()}this.av()}var d=this.cubes().getEnumerator();while(d.moveNext()){var c=d.current();if(c.name()==a){this.cube(c);break}}var e=this.ai();if(!this.isInitialized()){var f=this.sourceOptions().measureGroup();if(!String.isNullOrEmpty(f)){return $$t.$fj.a($$t.$e7.$type,e,function(g){return $self.aq(f)})}}return $$t.$fj.a($$t.$e7.$type,e,function(g){return $self.aq(null)})},aj:function(){var $self=this;var a=null;var b=null;var c=null;var d=new $$t.by($$t.$fg.$type,0);if(!String.isNullOrEmpty(this.sourceOptions().columns())){var e=new $$t.fk(this.sourceOptions().columns());a=e.c()}if(!String.isNullOrEmpty(this.sourceOptions().rows())){var f=new $$t.fk(this.sourceOptions().rows());b=f.c()}if(!String.isNullOrEmpty(this.sourceOptions().filters())){var g=new $$t.fk(this.sourceOptions().filters());c=g.c()}if(a!=null&&a.count()>0){var i=a.getEnumerator();while(i.moveNext()){var h=i.current();this.au($$t.$a.$type,h.b(),this.columnAxis(),$$t.$bk.$type);this.x().add(h);if(h.a().count()>0){d.add(h);var k=h.a().getEnumerator();while(k.moveNext()){var j=k.current();this.ae.add(j)}}}}if(b!=null&&b.count()>0){var m=b.getEnumerator();while(m.moveNext()){var l=m.current();this.au($$t.$a.$type,l.b(),this.rowAxis(),$$t.$bk.$type);this.af().add(l);if(l.a().count()>0){d.add(l);var o=l.a().getEnumerator();while(o.moveNext()){var n=o.current();this.ae.add(n)}}}}if(c!=null&&c.count()>0){var q=c.getEnumerator();while(q.moveNext()){var p=q.current();this.au($$t.$bk.$type,p.b(),this.filters(),$$t.$bk.$type);this.y().add(p);if(p.a().count()>0){d.add(p);var s=p.a().getEnumerator();while(s.moveNext()){var r=s.current();this.ae.add(r)}}}}var t=null;if(!String.isNullOrEmpty(this.sourceOptions().measures())){var u=new $$t.fk(this.sourceOptions().measures());t=u.c()}if(t!=null&&t.count()>0){var w=t.getEnumerator();while(w.moveNext()){var v=w.current();this.au($$t.$bn.$type,v.b(),this.measures(),$$t.$bn.$type)}}if(this.m()||this.s()||this.n()||this.r()||this.p()){if(d.count()>0){var x=new Array(d.count());for(var y=0;y<d.count();y++){var z=d.item(y).b();x[y]=this.getMembersOfHierarchy(z)}var aa=new $$t.dl($$t.$e7.$type,0);var ab=new $$t.fi;ab.c(x,function(ac){$self.ar().i(function(ad){$self.ax();aa.e($self.metadataTree())})});return aa.b()}return $$t.$fj.b($$t.$bt.$type,$$t.$e7.$type,this.ar(),function(ac){$self.ax();var ad=new $$t.dl($$t.$e7.$type,0);ad.e($self.metadataTree());return ad.b()})}this.ax();var ac=new $$t.dl($$t.$e7.$type,0);ac.e(this.metadataTree());return ac.b()},al:function(a){var $self=this;var b=this.dataProviderFactory().createDataProvider();var c=this.getProviderDefaultRestrictions();var d=this.getProviderDefaultProperties();var e=b.discoverCubesAsync(d,c).j($$t.$bu.$type.specialize($$t.$a8.$type),function(f){$self.cubes($self.a($$t.$a8.$type,f.m()));return $self.cubes()});return e},an:function(){var $self=this;var a=this.dataProviderFactory().createDataProvider();var b=this.getProviderDefaultRestrictions();var c=this.getProviderDefaultProperties();var d=a.discoverMeasureGroupsAsync(c,b).j($$t.$bu.$type.specialize($$t.$bp.$type),function(e){$self.measureGroups($self.a($$t.$bp.$type,e.m()));return $self.measureGroups()});return d},ax:function(){this.isInitialized(true)},av:function(){this.cube(null);this.measureGroups(new $$t.ec($$t.$bp.$type));this.filters().clear();this.rowAxis().clear();this.columnAxis().clear();this.measures().clear();this.c(null);this.aw()},aw:function(){this.measureGroup(null);this.metadataTree(null)},aq:function(a){var $self=this;if(this.cube()==null){throw new $$t.c0(1,"Data source has no Cube set.")}var b=new $$t.dl($$t.$e7.$type,0);if(this.measureGroup()!=null){if(this.measureGroup().name()==a){b.e(this.metadataTree());return b.b()}this.aw()}if(!String.isNullOrEmpty(a)&&this.measureGroups().count()==0){var c=$$t.$fj.b($$t.$bu.$type.specialize($$t.$bp.$type),$$t.$e7.$type,this.an(),function(d){if($self.measureGroups().count()==0){return $self.aq(null)}return $self.aq(a)});return c}var e=this.measureGroups().getEnumerator();while(e.moveNext()){var d=e.current();if(d.name()==a){this.measureGroup(d);break}}this.metadataTree(this.k(a));b.e(this.metadataTree());return b.b()},k:function(a){var $self=this;var b=function(){var $ret=new $$t.e7;$ret.type(0);$ret.caption($self.cube().caption());$ret.item($self.cube());return $ret}();var c;var d;var e;var f=true;if(String.isNullOrEmpty(a)||this.measureGroups()==null){c=this.c().t();d=this.c().z();e=this.c().w()}else{f=false;c=this.c().a().getMeasureGroupDimensions(a);d=this.c().a().getMeasureGroupMeasures(a);e=this.c().a().getMeasureGroupKpis(a)}var g=$$t.$fl.getDimensionMetaItems(c,d,e,this.c().u(),this.c().x(),f,this.c());$$t.$fl.setMetaItemChildren(b,g);return b},d:function(a,b){if(b!=null&&b.axes().count()>0){return $$t.$cp.ae($$t.$bw.$type,$$t.$cp.t($$t.$bw.$type,b.axes(),function(c){return c.name()==a}))}return null},az:function(a,b){switch(a.action()){case 0:var d=a.newItems().getEnumerator();while(d.moveNext()){var c=d.current();var e=$b($$t.$bk.$type,c);if(e!=null){if(this.isInitialized()){b.add(new $$t.fg(e.uniqueName(),new $$t.ec(String)))}}}break;case 1:var g=a.oldItems().getEnumerator();while(g.moveNext()){var f=g.current();var h=$b($$t.$bk.$type,f);if(h!=null){var i=$$t.$cp.ae($$t.$fg.$type,$$t.$cp.t($$t.$fg.$type,b,function(j){return j.b()==h.uniqueName()}));if(i!=null){var j=new $$t.by(String,0);for(var k=0;k<i.a().count();k++){j.add(i.a().item(k))}for(var l=0;l<j.count();l++){var m=j.item(l);this.removeFilterMember(i.b(),m)}b.remove(i)}}else{var n=$b($$t.$fa.$type,f);if(n!=null){if(!this.r()&&!this.q()&&!this.p()){this.measures().clear()}}}}break}},a1:function(a,b){switch(a.action()){case 0:var d=a.newItems().getEnumerator();while(d.moveNext()){var c=d.current();var e=$b($$t.$bk.$type,c);if(e!=null){var f=$b($$t.$fa.$type,$$t.$cp.ae($$t.$a.$type,$$t.$cp.t($$t.$a.$type,b,function(g){return $b($$t.$fa.$type,g)!==null})));if(f!=null&&this.measureListIndex()>=a.newStartingIndex()){this.measureListIndex(this.measureListIndex()+1)}}}break;case 1:var h=a.oldItems().getEnumerator();while(h.moveNext()){var g=h.current();var i=$b($$t.$bk.$type,g);if(i!=null){var j=$b($$t.$fa.$type,$$t.$cp.ae($$t.$a.$type,$$t.$cp.t($$t.$a.$type,b,function(k){return $b($$t.$fa.$type,k)!==null})));if(j!=null&&this.measureListIndex()>a.oldStartingIndex()){this.measureListIndex(this.measureListIndex()-1)}}}break}},a0:function(){var $self=this;var a;if(this.measureListLocation()==1){a=this.columnAxis()}else{a=this.rowAxis()}var b=null;var c=0;var e=a.getEnumerator();while(e.moveNext()){var d=e.current();b=$b($$t.$fa.$type,d);if(b!=null){break}c++}if(this.measures().count()>1){if(b==null){b=function(){var $ret=new $$t.fa;$ret.measures($self.measures());return $ret}();if(this.measureListIndex()<0||this.measureListIndex()>a.count()){this.ah=a.count();a.add(b)}else{a.insert(this.measureListIndex(),b)}}else{if(c!=this.measureListIndex()){a.removeAt(c);if(this.measureListIndex()>a.count()){this.ah=a.count();a.add(b)}else{a.insert(this.measureListIndex(),b)}}}}else{if(b!=null){a.removeAt(c)}}},aa:function(){return this.v},z:function(){return this.u},au:function($tItem,a,b,c){var d=function(e){return $u($tItem,e).uniqueName()==a};var e=this.getCoreElement(d,c);if(e!=null&&!$$t.$cp.e($.ig.$op.$type,b,e)){b.add($u($tItem,e))}},am:function(a){var b=new $$t.by(String,0);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();var e=this.d(c.c(),this.result()).tuples().__inner[c.b()].members().item(c.a());var f=this.getCoreElement(function(g){return g.hierarchyUniqueName()==e.hierarchyUniqueName()&&g.depth()==e.levelNumber()+1},$$t.$bm.$type);if(f!=null&&!this.c().c(f.uniqueName())&&!b.contains(f.uniqueName())){b.add(f.uniqueName())}}if(b.count()>0){var g=new Array(b.count());for(var h=0;h<b.count();h++){g[h]=this.getMembersOfLevel(b.item(h))}return(new $$t.fi).d(Array,g,function(i){return i})}var i=new $$t.dl(Array,0);i.e(new Array(0));return i.b()},ay:function(){var a;if(this.measureListLocation()==1){a=this.columnAxis()}else{a=this.rowAxis()}if(a==null){return}var b=null;var c=0;var e=a.getEnumerator();while(e.moveNext()){var d=e.current();b=$b($$t.$fa.$type,d);if(b!=null){break}c++}if(b!=null){this.q(true);a.removeAt(c)}},a:function($t,a){var b=new $$t.ec($t);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b.add(c)}return b},b:function(a,b){var c=$$t.$cp.ae($$t.$fg.$type,$$t.$cp.t($$t.$fg.$type,this.x(),function(d){return d.b()==a}));if(c!=null){b=this.x();return{ret:c,p1:b}}c=$$t.$cp.ae($$t.$fg.$type,$$t.$cp.t($$t.$fg.$type,this.af(),function(d){return d.b()==a}));if(c!=null){b=this.af();return{ret:c,p1:b}}c=$$t.$cp.ae($$t.$fg.$type,$$t.$cp.t($$t.$fg.$type,this.y(),function(d){return d.b()==a}));if(c!=null){b=this.y();return{ret:c,p1:b}}b=null;return{ret:null,p1:b}},$type:new $.ig.Type("OlapDataSource",$.ig.$ot,[$$t.$e6.$type])},true);$c("PositionInfo:fh","Object",{init:function(){$.ig.$op.init.call(this)},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_b:0,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_a:0,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},$type:new $.ig.Type("PositionInfo",$.ig.$ot)},true);$c("CubeMetaItemsCache:fd","Object",{init:function(){this.p=new $$t.ck(String,$$t.$ff.$type.specialize($.ig.Number.prototype.$type,$$t.$br.$type),0);this.s=new $$t.ck($.ig.Number.prototype.$type,$$t.$br.$type,0);this.q=new $$t.ck(String,$$t.$bu.$type.specialize($$t.$br.$type),0);this.r=new $$t.ck(String,$$t.$bu.$type.specialize($$t.$br.$type),0);this.o=new $$t.ck(String,$$t.$bn.$type,0);this.l=new $$t.ck(String,$$t.$bo.$type,0);this.n=new $$t.ck(String,$$t.$e.$type,0);this.m=new $$t.ck(String,$$t.$e.$type,0);$.ig.$op.init.call(this)},p:null,s:null,q:null,r:null,o:null,l:null,n:null,m:null,_z:null,z:function(a){if(arguments.length===1){this._z=a;return a}else{return this._z}},_v:null,v:function(a){if(arguments.length===1){this._v=a;return a}else{return this._v}},_t:null,t:function(a){if(arguments.length===1){this._t=a;return a}else{return this._t}},_u:null,u:function(a){if(arguments.length===1){this._u=a;return a}else{return this._u}},_x:null,x:function(a){if(arguments.length===1){this._x=a;return a}else{return this._x}},_w:null,w:function(a){if(arguments.length===1){this._w=a;return a}else{return this._w}},_y:null,y:function(a){if(arguments.length===1){this._y=a;return a}else{return this._y}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},c:function(a){var $self=this;var b;if(!function(){var c=$self.n.tryGetValue(a,b);b=c.p1;return c.ret}()){return false}return b},ac:function(a){this.n.item(a,true)},b:function(a){var $self=this;var b;if(!function(){var c=$self.m.tryGetValue(a,b);b=c.p1;return c.ret}()){return false}return b},ab:function(a){this.m.item(a,true);var c=$$t.$cp.t($$t.$bm.$type,this.x(),function(d){return d.hierarchyUniqueName()==a}).getEnumerator();while(c.moveNext()){var b=c.current();this.ac(b.uniqueName())}},d:function(a){return this.r.containsKey(a)},aa:function(a){var $self=this;var b;if(!function(){var c=$self.p.tryGetValue(a.uniqueName(),b);b=c.p1;return c.ret}()){var c=this.p.count();b=new $$t.ff($.ig.Number.prototype.$type,$$t.$br.$type,c,a);this.p.item(a.uniqueName(),b);this.s.item(c,a);var d;if(!function(){var e=$self.q.tryGetValue(a.levelUniqueName(),d);d=e.p1;return e.ret}()){d=new $$t.ec($$t.$br.$type);this.q.item(a.levelUniqueName(),d)}if(!String.isNullOrEmpty(a.parentUniqueName())){var e;if(!function(){var f=$self.r.tryGetValue(a.parentUniqueName(),e);e=f.p1;return f.ret}()){e=new $$t.by($$t.$br.$type,0);this.r.item(a.parentUniqueName(),e)}e.add(a)}d.add(a)}return b.a()},i:function(a,b){var $self=this;var c;if(function(){var d=$self.p.tryGetValue(a,c);c=d.p1;return d.ret}()){b=c.a();return{ret:true,p1:b}}b=-1;return{ret:false,p1:b}},h:function(a,b){var $self=this;var c;if(function(){var d=$self.p.tryGetValue(a,c);c=d.p1;return d.ret}()){b=c.b();return{ret:true,p1:b}}b=null;return{ret:false,p1:b}},g:function(a,b){var $self=this;return{ret:function(){var c=$self.s.tryGetValue(a,b);b=c.p1;return c.ret}(),p1:b}},k:function(a,b){var $self=this;return{ret:function(){var c=$self.r.tryGetValue(a,b);b=c.p1;return c.ret}(),p1:b}},j:function(a,b){var $self=this;return{ret:function(){var c=$self.q.tryGetValue(a,b);b=c.p1;return c.ret}(),p1:b}},f:function(a,b){var $self=this;if(!function(){var c=$self.o.tryGetValue(a,b);b=c.p1;return c.ret}()){b=$$t.$cp.ae($$t.$bn.$type,$$t.$cp.t($$t.$bn.$type,this.z(),function(c){return c.uniqueName()==a}));if(b==null){return{ret:false,p1:b}}this.o.add(a,b)}return{ret:true,p1:b}},e:function(a,b){var $self=this;if(!function(){var c=$self.l.tryGetValue(a,b);b=c.p1;return c.ret}()){b=$$t.$cp.ae($$t.$bo.$type,$$t.$cp.t($$t.$bo.$type,this.v(),function(c){return c.uniqueName()==a}));if(b==null){return{ret:false,p1:b}}this.l.add(a,b)}return{ret:true,p1:b}},$type:new $.ig.Type("CubeMetaItemsCache",$.ig.$ot)},true);$c("MetaTreeHelper:fl","Object",{init:function(){$.ig.$op.init.call(this)},getDimensionMetaItems:function(a,b,c,d,e,f,g){var h=new $$t.by($$t.$e7.$type,0);var i=new $$t.fm;i.a(0);i.b(0);var j=new $$t.by($$t.$bk.$type,0);var l=d.getEnumerator();while(l.moveNext()){var k=l.current();j.add(k)}var m=new $$t.by($$t.$bm.$type,0);var o=e.getEnumerator();while(o.moveNext()){var n=o.current();m.add(n)}var q=a.getEnumerator();while(q.moveNext()){var p=q.current();var r=$$t.$fl.e(j,m,p,i);if(p.dimensionType()!=2){var s=function(){var $ret=new $$t.e7;$ret.type(1);$ret.caption(p.caption());$ret.item(p);return $ret}();$$t.$fl.setMetaItemChildren(s,r);h.add(s)}else{var t=$$t.$fl.c(b,p);h.insert(0,t);if($$t.$cp.ai($$t.$bl.$type,c)>0){var u=function(){var $ret=new $$t.bd;$ret.caption("Kpis");return $ret}();var v=$$t.$fl.b(c,u,g);v.type(12);h.insert(1,v)}}}return h},setMetaItemChildren:function(a,b){if(b.count()>0){var c=$$t.$cp.a($$t.$e7.$type,$$t.$cp.w($$t.$e7.$type,String,$$t.$cp.t($$t.$e7.$type,b,function(d){return d.type()==2}),function(d){return d.caption()}));var d=$$t.$cp.a($$t.$e7.$type,$$t.$cp.t($$t.$e7.$type,b,function(e){return e.type()!=2}));var e=new Array(c.length+d.length);for(var f=0;f<c.length;f++){e[f]=c[f]}for(var g=0;g<d.length;g++){e[c.length+g]=d[g]}a.children(e)}},e:function(a,b,c,d){var e=new $$t.ck(String,$$t.$ff.$type.specialize($$t.$e7.$type,$$t.$bu.$type.specialize($$t.$e7.$type)),0);var f=new $$t.by($$t.$e7.$type,0);var g=a.item(d.a());while(g.dimensionUniqueName()!=c.uniqueName()){d.a(d.a()+1);g=a.item(d.a())}while(g.dimensionUniqueName()==c.uniqueName()){var h=null;if(!String.isNullOrEmpty(g.hierarchyDisplayFolder())){var i=String.empty();var j=$$t.$fl.a(g.hierarchyDisplayFolder());for(var k=0;k<j.length;k++){var l=j[k];i+=l+"\\";var m;if(!function(){var n=e.tryGetValue(i,m);m=n.p1;return n.ret}()){var n=function(){var $ret=new $$t.e7;$ret.type(2);$ret.caption(l);return $ret}();m=new $$t.ff($$t.$e7.$type,$$t.$bu.$type.specialize($$t.$e7.$type),n,new $$t.by($$t.$e7.$type,0));e.add(i,m);if(h!=null){h.b().add(n)}else{f.add(n)}}h=m}}var o;switch(g.hierarchyOrigin()){case 2:o=4;break;case 1:o=3;break;default:o=5;break}var p=$$t.$fl.f(b,g,d);var q=function(){var $ret=new $$t.e7;$ret.type(o);$ret.caption(g.caption());$ret.item(g);return $ret}();$$t.$fl.setMetaItemChildren(q,p);if(h!=null){h.b().add(q)}else{f.add(q)}if(d.a()+1>=a.count()){break}d.a(d.a()+1);g=a.item(d.a())}var s=e.values().getEnumerator();while(s.moveNext()){var r=s.current();var t=r.a();$$t.$fl.setMetaItemChildren(t,r.b())}return f},f:function(a,b,c){var d=new $$t.by($$t.$e7.$type,0);if(a==null||a.count()==0){return d}var e=a.item(c.b());while(e.hierarchyUniqueName()!=b.uniqueName()){c.b(c.b()+1);e=a.item(c.b())}while(e.hierarchyUniqueName()==b.uniqueName()){var f;switch(e.depth()){case 0:case 1:f=7;break;case 2:f=8;break;case 3:f=9;break;case 4:f=10;break;default:f=11;break}var g=function(){var $ret=new $$t.e7;$ret.type(f);$ret.caption(e.caption());$ret.item(e);return $ret}();d.add(g);if(c.b()+1>=a.count()){break}c.b(c.b()+1);e=a.item(c.b())}return d},c:function(a,b){var c=new $$t.ck(String,$$t.$ff.$type.specialize($$t.$e7.$type,$$t.$bu.$type.specialize($$t.$e7.$type)),0);var d=function(){var $ret=new $$t.e7;$ret.type(6);$ret.caption(b.caption());$ret.item(b);return $ret}();var e=new $$t.ff($$t.$e7.$type,$$t.$bu.$type.specialize($$t.$e7.$type),d,new $$t.by($$t.$e7.$type,0));var g=a.getEnumerator();while(g.moveNext()){var f=g.current();if($b($$t.$bo.$type,f)!==null){continue}var h=e;if(!String.isNullOrEmpty(f.measureGroupName())){if(!function(){var i=c.tryGetValue(f.measureGroupName(),h);h=i.p1;return i.ret}()){var i=function(){var $ret=new $$t.e7;$ret.type(2);$ret.caption(f.measureGroupName());return $ret}();h=new $$t.ff($$t.$e7.$type,$$t.$bu.$type.specialize($$t.$e7.$type),i,new $$t.by($$t.$e7.$type,0));c.add(f.measureGroupName(),h);e.b().add(h.a())}}var j=h;if(!String.isNullOrEmpty(f.measureDisplayFolder())){var k=f.measureGroupName();var l=$$t.$fl.a(f.measureDisplayFolder());for(var m=0;m<l.length;m++){var n=l[m];k+="\\"+n;var o;if(!function(){var p=c.tryGetValue(k,o);o=p.p1;return p.ret}()){var p=function(){var $ret=new $$t.e7;$ret.type(2);$ret.caption(n);return $ret}();o=new $$t.ff($$t.$e7.$type,$$t.$bu.$type.specialize($$t.$e7.$type),p,new $$t.by($$t.$e7.$type,0));c.add(k,o);j.b().add(p)}j=o}}var q=function(){var $ret=new $$t.e7;$ret.type(6);$ret.caption(f.caption());$ret.item(f);return $ret}();j.b().add(q)}var r=new $$t.by($$t.$e7.$type,0);var t=$$t.$cp.w($$t.$e7.$type,String,$$t.$cp.t($$t.$e7.$type,e.b(),function(u){return u.type()==2}),function(u){return u.caption()}).getEnumerator();while(t.moveNext()){var s=t.current();r.add(s)}var v=$$t.$cp.w($$t.$e7.$type,String,$$t.$cp.t($$t.$e7.$type,e.b(),function(w){return w.type()!=2}),function(w){return w.caption()}).getEnumerator();while(v.moveNext()){var u=v.current();r.add(u)}$$t.$fl.setMetaItemChildren(d,r);var x=c.values().getEnumerator();while(x.moveNext()){var w=x.current();var y=w.b();var z=$$t.$cp.y($$t.$e7.$type,$$t.$cp.w($$t.$e7.$type,String,$$t.$cp.t($$t.$e7.$type,y,function(aa){return aa.type()==2}),function(aa){return aa.caption()}));var aa=$$t.$cp.y($$t.$e7.$type,$$t.$cp.w($$t.$e7.$type,String,$$t.$cp.t($$t.$e7.$type,y,function(ab){return ab.type()!=2}),function(ab){return ab.caption()}));var ab=new $$t.by($$t.$e7.$type,0);for(var ac=0;ac<z.count();ac++){ab.add(z.item(ac))}for(var ad=0;ad<aa.count();ad++){ab.add(aa.item(ad))}var ae=w.a();$$t.$fl.setMetaItemChildren(ae,ab)}return d},b:function(a,b,c){var d=new $$t.ck(String,$$t.$ff.$type.specialize($$t.$e7.$type,$$t.$bu.$type.specialize($$t.$e7.$type)),0);var e=$$t.$cp.y($$t.$bn.$type,c.z());c.z(e);var f=new $$t.by($$t.$bo.$type,0);c.v(f);var g=function(){var $ret=new $$t.e7;$ret.type(12);$ret.caption(b.caption());$ret.item(b);return $ret}();var h=new $$t.ff($$t.$e7.$type,$$t.$bu.$type.specialize($$t.$e7.$type),g,new $$t.by($$t.$e7.$type,0));var j=a.getEnumerator();while(j.moveNext()){var i=j.current();var k=h;if(!String.isNullOrEmpty(i.kpiDisplayFolder())){var l=String.empty();var m=$$t.$fl.a(i.kpiDisplayFolder());for(var n=0;n<m.length;n++){var o=m[n];l+="\\"+o;var p;if(!function(){var q=d.tryGetValue(l,p);p=q.p1;return q.ret}()){var q=function(){var $ret=new $$t.e7;$ret.type(2);$ret.caption(o);return $ret}();p=new $$t.ff($$t.$e7.$type,$$t.$bu.$type.specialize($$t.$e7.$type),q,new $$t.by($$t.$e7.$type,0));d.add(l,p);k.b().add(q)}k=p}}var r=function(){var $ret=new $$t.e7;$ret.type(13);$ret.caption(i.caption());$ret.item(i);return $ret}();if(!String.isNullOrEmpty(i.kpiValue())){var s=null;var t=6;var u="Value";if(!function(){var v=c.f(i.kpiValue(),s);s=v.p1;return v.ret}()){t=14;s=$$t.$bo.createKpiValueMeasure(i);e.add(s);f.add(s)}else{u+=" ("+s.caption()+")"}r.e(function(){var $ret=new $$t.e7;$ret.caption(u);$ret.item(s);$ret.type(t);return $ret}())}if(!String.isNullOrEmpty(i.kpiGoal())){var v=null;var w=6;var x="Goal";if(!function(){var y=c.f(i.kpiGoal(),v);v=y.p1;return y.ret}()){w=15;v=$$t.$bo.createKpiGoalMeasure(i);e.add(v);f.add(v)}else{x+=" ("+v.caption()+")"}r.e(function(){var $ret=new $$t.e7;$ret.caption(x);$ret.item(v);$ret.type(w);return $ret}())}if(!String.isNullOrEmpty(i.kpiStatus())){var y=$$t.$bo.createKpiStatusMeasure(i);e.add(y);f.add(y);r.e(function(){var $ret=new $$t.e7;$ret.caption("Status");$ret.item(y);$ret.type(16);return $ret}())}if(!String.isNullOrEmpty(i.kpiTrend())){var z=$$t.$bo.createKpiTrendMeasure(i);e.add(z);f.add(z);r.e(function(){var $ret=new $$t.e7;$ret.caption("Trend");$ret.item(z);$ret.type(17);return $ret}())}if(!String.isNullOrEmpty(i.kpiWeight())){var aa=$$t.$bo.createKpiWeightMeasure(i);e.add(aa);f.add(aa);r.e(function(){var $ret=new $$t.e7;$ret.caption("Weight");$ret.item(aa);$ret.type(18);return $ret}())}k.b().add(r)}var ab=new $$t.by($$t.$e7.$type,0);var ad=$$t.$cp.w($$t.$e7.$type,String,$$t.$cp.t($$t.$e7.$type,h.b(),function(ae){return ae.type()==2}),function(ae){return ae.caption()}).getEnumerator();while(ad.moveNext()){var ac=ad.current();ab.add(ac)}var af=$$t.$cp.w($$t.$e7.$type,String,$$t.$cp.t($$t.$e7.$type,h.b(),function(ag){return ag.type()!=2}),function(ag){return ag.caption()}).getEnumerator();while(af.moveNext()){var ae=af.current();ab.add(ae)}$$t.$fl.setMetaItemChildren(g,ab);var ah=d.values().getEnumerator();while(ah.moveNext()){var ag=ah.current();var ai=ag.b();var aj=$$t.$cp.y($$t.$e7.$type,$$t.$cp.w($$t.$e7.$type,String,$$t.$cp.t($$t.$e7.$type,ai,function(ak){return ak.type()==2}),function(ak){return ak.caption()}));var ak=$$t.$cp.y($$t.$e7.$type,$$t.$cp.w($$t.$e7.$type,String,$$t.$cp.t($$t.$e7.$type,ai,function(al){return al.type()!=2}),function(al){return al.caption()}));var al=new $$t.by($$t.$e7.$type,0);for(var am=0;am<aj.count();am++){al.add(aj.item(am))}for(var an=0;an<ak.count();an++){al.add(ak.item(an))}var ao=ag.a();$$t.$fl.setMetaItemChildren(ao,al)}return g},a:function(a){var b=a.split("\\");return b},$type:new $.ig.Type("MetaTreeHelper",$.ig.$ot)},true);$c("HierarchyItemPosition:fm","Object",{init:function(){$.ig.$op.init.call(this)},_a:0,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_b:0,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},$type:new $.ig.Type("HierarchyItemPosition",$.ig.$ot)},true);$c("DataSourceBaseOptions:fc","Object",{init:function(){$.ig.$op.init.call(this)},_cube:null,cube:function(a){if(arguments.length===1){this._cube=a;return a}else{return this._cube}},_measureGroup:null,measureGroup:function(a){if(arguments.length===1){this._measureGroup=a;return a}else{return this._measureGroup}},_measures:null,measures:function(a){if(arguments.length===1){this._measures=a;return a}else{return this._measures}},_filters:null,filters:function(a){if(arguments.length===1){this._filters=a;return a}else{return this._filters}},_columns:null,columns:function(a){if(arguments.length===1){this._columns=a;return a}else{return this._columns}},_rows:null,rows:function(a){if(arguments.length===1){this._rows=a;return a}else{return this._rows}},$type:new $.ig.Type("DataSourceBaseOptions",$.ig.$ot)},true);$c("AxisDefinitionParser:fk","Object",{init:function(a){$.ig.$op.init.call(this);this.d(-1);this.k(a)},_a:false,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},_d:0,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_k:null,k:function(a){if(arguments.length===1){this._k=a;return a}else{return this._k}},b:function(){if(this.d()==this.k().length-1){return false}var a=-1;var b=-1;var c=false;while(this.d()+1<this.k().length){this.d(this.d()+1);var d=this.k().substr(this.d(),1);switch(d){case"[":if(a==-1){a=this.d()}break;case"]":b=this.d();while(this.d()+1<this.k().length){d=this.k().substr(this.d()+1,1);switch(d){case"]":b=this.d()+1;break;case",":if("]"==this.k().substr(this.d(),1)){c=true}break;case"{":case"}":c=true;break}if(c){break}this.d(this.d()+1)}c=true;break;case",":c=true;break;case"{":this.a(true);break;case"}":c=true;this.a(false);break}if(c){c=false;if(a>-1&&b>-1){break}}}if(this.d()==this.k().length-1){if(b==-1||a==-1){return false}}var e=this.k().substr(a,b-a+1).trim([]);this.g(e);return true},c:function(){var a=new $$t.by($$t.$fg.$type,0);var b=null;while(this.b()){if(!this.a()){b=new $$t.ec(String);var c=new $$t.fg(this.g(),b);a.add(c)}else if(b!=null){b.add(this.g())}}return a},$type:new $.ig.Type("AxisDefinitionParser",$.ig.$ot)},true);$c("CoreOlapElementParser:fq","Object",{init:function(a){$.ig.$op.init.call(this);this.c(-1);this.h(a)},_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},_c:0,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_h:null,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},a:function(){if(this.c()==this.h().length-1){return false}var a=-1;var b=-1;var c=false;while(this.c()+1<this.h().length){this.c(this.c()+1);var d=this.h().substr(this.c(),1);switch(d){case"[":if(a==-1){a=this.c()}break;case"]":b=this.c();while(this.c()+1<this.h().length){d=this.h().substr(this.c()+1,1);switch(d){case"]":b=this.c()+1;break;case".":c=true;break}if(c){break}this.c(this.c()+1)}break;case".":c=true;break}if(c){c=false;if(a>-1&&b>-1){break}}}if(this.c()==this.h().length-1){if(b==-1||a==-1){return false}}var e=this.h().substr(a,b-a+1).trim([]);this.f(e);return true},b:function(){var a=new $$t.by(String,0);while(this.a()){a.add(this.f())}return a},$type:new $.ig.Type("CoreOlapElementParser",$.ig.$ot)},true);$c("KeyValueItem:d4","Object",{init:function(){$.ig.$op.init.call(this)},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},$type:new $.ig.Type("KeyValueItem",$.ig.$ot)},true);$c("AxisElement:fg","Object",{init:function(a,b){$.ig.$op.init.call(this);this.b(a);this.a(b)},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},$type:new $.ig.Type("AxisElement",$.ig.$ot)},true);$c("MeasureGroupMetaItemsCache:fe","Object",{a:null,c:null,b:null,f:null,d:null,g:null,e:null,init:function(a,b,c,d){$.ig.$op.init.call(this);this.a=new $$t.ck(String,$$t.$a5.$type.specialize($$t.$bb.$type),0);this.c=new $$t.ck(String,$$t.$a5.$type.specialize($$t.$bn.$type),0);this.b=new $$t.ck(String,$$t.$a5.$type.specialize($$t.$bl.$type),0);this.f=d;this.d=a;this.g=b;this.e=c},getMeasureGroupDimensions:function(a){var $self=this;var b;if(!function(){var c=$self.a.tryGetValue(a,b);b=c.p1;return c.ret}()){var c=new $$t.by(String,0);var e=this.f.getEnumerator();while(e.moveNext()){var d=e.current();if(d.measureGroupName()==a){c.add(d.dimensionUniqueName())}}var f=new $$t.by($$t.$bb.$type,0);var h=this.d.getEnumerator();while(h.moveNext()){var g=h.current();if(c.contains(g.uniqueName())||g.dimensionType()==2){f.add(g)}}this.a.add(a,f);b=f}return b},getMeasureGroupMeasures:function(a){var $self=this;var b;if(!function(){var c=$self.c.tryGetValue(a,b);b=c.p1;return c.ret}()){var c=new $$t.by($$t.$bn.$type,0);var e=this.g.getEnumerator();while(e.moveNext()){var d=e.current();if(d.measureGroupName()==a){c.add(d)}}this.c.add(a,c);b=c}return b},getMeasureGroupKpis:function(a){var $self=this;var b;if(!function(){var c=$self.b.tryGetValue(a,b);b=c.p1;return c.ret}()){var c=new $$t.by($$t.$bl.$type,0);var e=this.e.getEnumerator();while(e.moveNext()){var d=e.current();if(d.measureGroupName()==a){c.add(d)}}this.b.add(a,c);b=c}return b},$type:new $.ig.Type("MeasureGroupMetaItemsCache",$.ig.$ot)},true);$c("PositionItemInfo$2:cj","Dictionary$2",{$tKey:null,$tSortKey:null,init:function($tKey,$tSortKey,a,b,c,d){this.$tKey=$tKey;this.$tSortKey=$tSortKey;this.$type=this.$type.specialize(this.$tKey,this.$tSortKey);$$t.$ck.init.call(this,this.$tKey,$$t.$cj.$type.specialize(this.$tKey,this.$tSortKey),0);this.x=new $$t.ck(this.$tKey,$.ig.$op.$type,0);this.positionItem(a);this.positionIndex(b);this.positionItemIndex(c);this.positionItemDepth(0);this.positionItemDepthMin(-1);this.positionItemDepthMax(2147483647);this.positionSize(d);if(a!=null){this.positionItemDepth(this.positionItem().depth());this.key(this.positionItem().key());this.parentKey(this.positionItem().parentKey());this.hierarchyKey(this.positionItem().hierarchyKey());this.hierarchyLevelKey(this.positionItem().hierarchyLevelKey());
this.sortKey(this.positionItem().sortKey());this.caption(this.positionItem().caption())}},n:function(a,b,c,d){return new $$t.cj(this.$tKey,this.$tSortKey,a,b,c,d)},_positionItemDepthMin:0,positionItemDepthMin:function(a){if(arguments.length===1){this._positionItemDepthMin=a;return a}else{return this._positionItemDepthMin}},_positionItemDepthMax:0,positionItemDepthMax:function(a){if(arguments.length===1){this._positionItemDepthMax=a;return a}else{return this._positionItemDepthMax}},_positionItem:null,positionItem:function(a){if(arguments.length===1){this._positionItem=a;return a}else{return this._positionItem}},_positionIndex:0,positionIndex:function(a){if(arguments.length===1){this._positionIndex=a;return a}else{return this._positionIndex}},_positionItemDepth:0,positionItemDepth:function(a){if(arguments.length===1){this._positionItemDepth=a;return a}else{return this._positionItemDepth}},_positionItemIndex:0,positionItemIndex:function(a){if(arguments.length===1){this._positionItemIndex=a;return a}else{return this._positionItemIndex}},_positionSize:0,positionSize:function(a){if(arguments.length===1){this._positionSize=a;return a}else{return this._positionSize}},_key:null,key:function(a){if(arguments.length===1){this._key=a;return a}else{return this._key}},_parentKey:null,parentKey:function(a){if(arguments.length===1){this._parentKey=a;return a}else{return this._parentKey}},_hierarchyKey:null,hierarchyKey:function(a){if(arguments.length===1){this._hierarchyKey=a;return a}else{return this._hierarchyKey}},_hierarchyLevelKey:null,hierarchyLevelKey:function(a){if(arguments.length===1){this._hierarchyLevelKey=a;return a}else{return this._hierarchyLevelKey}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_sortKey:null,sortKey:function(a){if(arguments.length===1){this._sortKey=a;return a}else{return this._sortKey}},_isExpandable:false,isExpandable:function(a){if(arguments.length===1){this._isExpandable=a;return a}else{return this._isExpandable}},_isExpanded:false,isExpanded:function(a){if(arguments.length===1){this._isExpanded=a;return a}else{return this._isExpanded}},t:function(a,b,c){var d=false;if(this.positionItemIndex()==-1){d=true}else{if(c!=null){if($d(this.$tKey,a.item(this.positionItemIndex()).key())!=null){var e=c.item(this.positionItemIndex());d=a.item(this.positionItemIndex()).key().equals($d(this.$tKey,e.key()))}}}if(this.positionItemIndex()+1==this.positionSize()){return d}var f=this.u(a,b,this.positionItemIndex()+1,c);return d&&f},ai:function(a,b){},x:null,u:function(a,b,c,d){var $self=this;var e;var f=a.item(c);if(!this.containsKey(f.key())){var g=this.n(f,b,c,this.positionSize());g.isExpandable(f.isExpandable());if(this.x.containsKey(g.key())){this.x.remove(g.key());g.isExpanded(true)}if($d(this.$tKey,f.parentKey())!=null){var h=null;if(function(){var i=$self.tryGetValue(f.parentKey(),h);h=i.p1;return i.ret}()){h.isExpanded(true)}else{if(!this.x.containsKey(f.parentKey())){this.x.add(f.parentKey(),null)}}}e=g.t(a,b,d);this.add(f.key(),g);if(this.positionItemDepthMin()==-1){this.positionItemDepthMin(f.depth())}else{this.positionItemDepthMin(Math.min(this.positionItemDepthMin(),f.depth()))}if(this.positionItemDepthMax()==2147483647){this.positionItemDepthMax(f.depth())}else{this.positionItemDepthMax(Math.max(this.positionItemDepthMax(),f.depth()))}this.ai(a,g)}else{var i=this.item(f.key());e=i.t(a,b,d)}return e},getIndex2:function(a){var b=new Array(a.count());for(var c=0;c<b.length;c++){b[c]=a.item(c).key()}return this.getIndex(b)},getIndex:function(a){return this.z(a,a.length)},z:function(a,b){var $self=this;if(this.positionItemIndex()==b-1){return this.positionIndex()}var c;if(!function(){var d=$self.tryGetValue(a[$self.positionItemIndex()+1],c);c=d.p1;return d.ret}()){return-1}if(c.count()==0){return c.positionIndex()}return c.z(a,b)},$type:new $.ig.Type("PositionItemInfo$2",$$t.$ck.$type.specialize(0,1))},true);$c("PositionResolver$2:bx","Object",{$tKey:null,$tSortKey:null,m:0,b:null,f:null,g:null,init:function($tKey,$tSortKey,a,b){this.$tKey=$tKey;this.$tSortKey=$tSortKey;this.$type=this.$type.specialize(this.$tKey,this.$tSortKey);this.m=0;$.ig.$op.init.call(this);this.positions($$t.$cp.y($$t.$ch.$type.specialize(this.$tKey,this.$tSortKey),a));this.positionSize(b)},getPositionIndexCompleted:null,_positions:null,positions:function(a){if(arguments.length===1){this._positions=a;return a}else{return this._positions}},_positionSize:0,positionSize:function(a){if(arguments.length===1){this._positionSize=a;return a}else{return this._positionSize}},rootPositionInfo:function(){if(this.b==null){this.b=this.d(this.positionSize())}return this.b},d:function(a){return new $$t.cj(this.$tKey,this.$tSortKey,null,-1,-1,a)},hasUnregisterdPositions:function(){return this.m<this.positions().count()},completeRegisterPositions:function(){if(this.hasUnregisterdPositions()){this.q(null)}},resolveParentPositionItem:function(a,b){b=-1;var c=$b($$t.$c2.$type.specialize(this.$tKey,this.$tSortKey),a);if(c==null||$d(this.$tKey,c.parentKey())==null){return{ret:null,p1:b}}var d=c.position().indexOf(c);var e=new Array(c.position().itemsCount());for(var f=0;f<c.position().itemsCount();f++){e[f]=c.position().item(f).key()}e[d]=c.parentKey();b=this.rootPositionInfo().getIndex(e);if(b==-1){return{ret:null,p1:b}}var g=this.positions().__inner[b];var h=g.item(d);return{ret:h,p1:b}},getHostPositionItemInfo:function(a,b){var c=this.rootPositionInfo();var d=a.item(b);for(var e=0;e<b;e++){var f;if(function(){var g=c.tryGetValue(a.item(e).key(),f);f=g.p1;return g.ret}()){c=f}else{c=null;break}}if(c==null){return null}if(!c.containsKey(d.key())){return null}return c},i:function(a,b){if(this.rootPositionInfo().count()==0){return null}var c=this.rootPositionInfo();var d=a.position().indexOf(a);for(var e=0;e<d;e++){var f;if(function(){var g=c.tryGetValue(a.position().item(e).key(),f);f=g.p1;return g.ret}()){c=f}else{c=null;break}}if(c==null){return null}if(!c.containsKey(a.key())){return null}var g=new $$t.by($.ig.Number.prototype.$type,0);this.u(a.key(),c,g);if(b==1){g.sort2(function(h,i){if(h==i){return 0}if(h>i){return-1}return 1});return g}g.sort2(function(h,i){if(h==i){return 0}if(h>i){return 1}return-1});return g},u:function(a,b,c){var $self=this;var e=$$t.$cp.t($$t.$cj.$type.specialize(this.$tKey,this.$tSortKey),b.values(),function(f){return a.equals($d($self.$tKey,f.parentKey()))}).getEnumerator();while(e.moveNext()){var d=e.current();if(d.count()==0){c.add(d.positionIndex())}else{this.t(d,c)}if(!d.isExpanded()){continue}if(d.positionItemDepth()<b.positionItemDepthMax()){this.u(d.key(),b,c)}}},t:function(a,b){var $self=this;var d=$$t.$cp.t($$t.$cj.$type.specialize(this.$tKey,this.$tSortKey),a.values(),function(e){return $d($self.$tKey,e.parentKey())==null}).getEnumerator();while(d.moveNext()){var c=d.current();if(c.count()==0){b.add(c.positionIndex())}else{this.t(c,b)}if(!c.isExpanded()){continue}if(c.positionItemDepth()<a.positionItemDepthMax()){this.u(c.key(),a,b)}}},getChildren:function(a,b){var $self=this;if(this.hasUnregisterdPositions()){this.completeRegisterPositions()}var c=this.getHostPositionItemInfo(a,b);var d=a.item(b);return $$t.$cp.t($$t.$cj.$type.specialize(this.$tKey,this.$tSortKey),c.values(),function(e){return d.key().equals($d($self.$tKey,e.parentKey()))})},isMemberExpanded:function(a){if(this.hasUnregisterdPositions()){this.completeRegisterPositions()}var b=this.getPositionIndex(a.position());if(b==-1||this.rootPositionInfo().count()==0){return $l($$t.$e.$type,null)}var c=a.position().indexOf(a);var d=this.rootPositionInfo();for(var e=0;e<c;e++){var f;if(function(){var g=d.tryGetValue(a.position().item(e).key(),f);f=g.p1;return g.ret}()){d=f}else{d=null;break}}if(d==null){return $l($$t.$e.$type,null)}if(!d.containsKey(a.key())){return $l($$t.$e.$type,null)}var g=null;var h=d.values().getEnumerator();while(h.moveNext()){if(a.key().equals($d(this.$tKey,h.current().parentKey()))){g=h.current();break}}return $l($$t.$e.$type,g!=null)},getPositionIndex:function(a){if(a==null){return-1}if(a.itemsCount()!=this.positionSize()){return-1}if(a.isEmpty()&&this.positions().count()==1&&this.positions().__inner[0].isEmpty()){return 0}if(this.m>0){var b=this.o(a);if(b>-1){return b}if(this.m==this.positions().count()){return-1}}return this.q(a)},o:function(a){if(a.isEmpty()&&this.positions().count()==1&&this.positions().__inner[0].isEmpty()){return 0}return this.rootPositionInfo().getIndex2($$t.$cp.y($$t.$ci.$type.specialize(this.$tKey,this.$tSortKey),a.getItems()))},q:function(a){var b=a==null;var c=-1;for(var d=this.m;d<this.positions().count();d++){var e=this.positions().__inner[d];var f=this.rootPositionInfo().t(e,d,a);this.m++;if(c==-1&&f){c=d;if(!b){break}}}return c},$type:new $.ig.Type("PositionResolver$2",$.ig.$ot)},true);$c("LevelSortDirection:ev","Object",{init:function(){$.ig.$op.init.call(this);this.sortBehavior(1)},_levelUniqueName:null,levelUniqueName:function(a){if(arguments.length===1){this._levelUniqueName=a;return a}else{return this._levelUniqueName}},_sortDirection:0,sortDirection:function(a){if(arguments.length===1){this._sortDirection=a;return a}else{return this._sortDirection}},_sortBehavior:0,sortBehavior:function(a){if(arguments.length===1){this._sortBehavior=a;return a}else{return this._sortBehavior}},$type:new $.ig.Type("LevelSortDirection",$.ig.$ot)},true);$c("TaskExtensions:fj","Object",{init:function(){$.ig.$op.init.call(this)},a:function($tResult,a,b){var c=new $$t.dl($tResult,0);a.e(function(d){if(d.a()==null){try{b(d).i(function(e){if(e.a()==null){c.e(e.m());return}c.d(e.a())})}catch(e_){var e;e=e_;console.log(e_);c.d(e)}}else{c.d(d.a())}});return c.b()},b:function($tResult1,$tResult2,a,b){return $$t.$fj.a($tResult2,a,function(c){return b(c)})},$type:new $.ig.Type("TaskExtensions",$.ig.$ot)},true);$c("HierarchyFilterView:fz","Object",{c:null,d:null,e:null,init:function(a){this.e=new $$t.ck(String,$$t.$f0.$type,0);$.ig.$op.init.call(this);this.hierarchy(a);this.d=new $$t.ck($.ig.Number.prototype.$type,$$t.$bu.$type.specialize($$t.$f0.$type),0);this.c=new $$t.ck(String,$$t.$f0.$type,0)},filterMemberExpansionChanged:null,filterMemberSelectionChanged:null,_hierarchy:null,hierarchy:function(a){if(arguments.length===1){this._hierarchy=a;return a}else{return this._hierarchy}},addFiltersForMembers:function(a){var c=a.getEnumerator();while(c.moveNext()){var b=c.current();this.addFilterForMember(b)}},addFilterForMember:function(a){var $self=this;if(!this.c.containsKey(a.uniqueName())){var b=new $$t.f0(a);b.propertyChanged=$.ig.Delegate.prototype.combine(b.propertyChanged,this.o.runOn(this));b.selectionChanged=$.ig.Delegate.prototype.combine(b.selectionChanged,this.p.runOn(this));var c;if(!function(){var d=$self.d.tryGetValue(a.levelDepth(),c);c=d.p1;return d.ret}()){c=new $$t.by($$t.$f0.$type,0);this.d.add(a.levelDepth(),c)}this.c.add(a.uniqueName(),b);this.e.add(a.uniqueName(),b);c.add(b);this.j(b);this.m(b)}},tryGetFilterMember:function(a){if(this.c.containsKey(a)){return this.c.item(a)}return null},getRootFilterMembers:function(){var a=-1;var c=this.d.keys().getEnumerator();while(c.moveNext()){var b=c.current();if(a==-1){a=b}else{a=Math.min(b,a)}}if(a==-1){return null}return this.d.item(a)},getSelectedFilterItems:function(){var a=this.getRootFilterMembers();var b=new $$t.by($$t.$f0.$type,0);var c=0;var e=a.getEnumerator();while(e.moveNext()){var d=e.current();if(d.isSelected().hasValue()==true&&d.isSelected().value()==true){c++}}if(c==a.count()){return b}var g=a.getEnumerator();while(g.moveNext()){var f=g.current();if(f.isSelected().hasValue()==false){this.n(f,b)}else if(f.isSelected().hasValue()==true&&f.isSelected().value()==true){b.add(f)}}return b},p:function(a,b){if(this.filterMemberSelectionChanged!=null){this.filterMemberSelectionChanged(this,new $$t.f4(a))}},o:function(a,b){if(b.propertyName()=="IsExpanded"){if(this.filterMemberExpansionChanged!=null){this.filterMemberExpansionChanged(this,new $$t.f4(a))}}},n:function(a,b){if(a.isSelected().hasValue()==true&&a.isSelected().value()==true){b.add(a)}else{if(a.children()==null){return}var d=a.children().getEnumerator();while(d.moveNext()){var c=d.current();this.n(c,b)}}},m:function(a){var $self=this;var b=a.member().parentUniqueName();if(String.isNullOrEmpty(b)){return}var c;if(function(){var d=$self.c.tryGetValue(b,c);c=d.p1;return d.ret}()){c.n(a);if(c.isSelected().hasValue()==true&&c.isSelected().value()==false){a.isSelected($l($$t.$e.$type,false))}}},j:function(a){var $self=this;var b=a.member().levelDepth();var c;if(function(){var d=$self.d.tryGetValue(b+1,c);c=d.p1;return d.ret}()){var e=c.getEnumerator();while(e.moveNext()){var d=e.current();if(d.member().parentUniqueName()==a.member().uniqueName()){a.n(d)}}}},$type:new $.ig.Type("HierarchyFilterView",$.ig.$ot)},true);$c("FilterMember:f0","Object",{l:$l($$t.$e.$type,null),c:false,e:false,d:false,init:function(a){this.e=false;this.d=false;$.ig.$op.init.call(this);var b=$l($$t.$e.$type,true);this.l=b;this.member(a);this.k(0);this.j(0)},selectionChanged:null,propertyChanged:null,_parent:null,parent:function(a){if(arguments.length===1){this._parent=a;return a}else{return this._parent}},_member:null,member:function(a){if(arguments.length===1){this._member=a;return a}else{return this._member}},isExpandable:function(){return this.member().childrenCardinality()>0},isExpanded:function(a){if(arguments.length===1){if(this.c!=a){this.c=a;this.o("IsExpanded")}return a}else{return this.c}},isSelected:function(a){if(arguments.length===1){var b=a;var c=$l($$t.$e.$type,null);if($i(this.l,b)==false){var d=this.l;this.l=a;if(!this.d){if(this.l.hasValue()==true){if(this.children()!=null){var f=this.children().getEnumerator();while(f.moveNext()){var e=f.current();e.e=true;e.isSelected(this.l);e.e=false}}}}if(this.parent()!=null){if(d.hasValue()==true&&d.value()==false){if(this.l.hasValue()==false){this.p(true)}this.q(false)}else if(d.hasValue()==false){if(this.l.hasValue()==true&&this.l.value()==false){this.q(true)}this.p(false)}else{if(this.l.hasValue()==true&&this.l.value()==false){this.q(true)}else if(this.l.hasValue()==false){this.p(true)}}if(!this.e){this.parent().d=true;var g=this.parent().k();var h=this.parent().j();var i=this.parent().children().count();if(h==0){if(g==0){this.parent().isSelected($l($$t.$e.$type,true))}else if(g==i){this.parent().isSelected($l($$t.$e.$type,false))}else{this.parent().isSelected(c)}}else{this.parent().isSelected(c)}this.parent().d=false}}this.o("IsSelected");if(!this.e&&!this.d){if(this.selectionChanged!=null){this.selectionChanged(this,$$t.$c5.empty)}}}return a}else{return this.l}},q:function(a){if(a){this.parent().k(this.parent().k()+1)}else{this.parent().k(this.parent().k()-1)}},p:function(a){if(a){this.parent().j(this.parent().j()+1)}else{this.parent().j(this.parent().j()-1)}},_children:null,children:function(a){if(arguments.length===1){this._children=a;return a}else{return this._children}},n:function(a){if(this.children()==null){this.children(new $$t.by($$t.$f0.$type,0))}a.parent(this);this.children().add(a);this.o("Children")},_k:0,k:function(a){if(arguments.length===1){this._k=a;return a}else{return this._k}},_j:0,j:function(a){if(arguments.length===1){this._j=a;return a}else{return this._j}},o:function(a){if(this.propertyChanged!=null){this.propertyChanged(this,new $$t.f3(a))}},$type:new $.ig.Type("FilterMember",$.ig.$ot,[$$t.$f1.$type])},true);$c("FilterMemberStateChangedEventArgs:f4","EventArgs",{init:function(a){$$t.$c5.init.call(this);this.filterMember(a)},_filterMember:null,filterMember:function(a){if(arguments.length===1){this._filterMember=a;return a}else{return this._filterMember}},$type:new $.ig.Type("FilterMemberStateChangedEventArgs",$$t.$c5.$type)},true);$c("ResultSorter$1:ey","Object",{$t:null,_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_d:false,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_c:false,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},init:function($t,a,b,c){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this);this.a(a);this.d(b);this.c(c)},b:function(){},e:function(a,b,c){a.e();var d=a.d();var e=new Array(d.count());for(var f=0;f<d.count();f++){var g=d.item(f);c.add(g,f)}for(var h=0;h<d.count();h++){var i=d.item(h);var j=b.tuples().__inner[i];e[h]=j}return new $$t.by($$t.$c9.$type,1,e)},$type:new $.ig.Type("ResultSorter$1",$.ig.$ot)},true);$c("AxisTupleVisitor:ez","Object",{_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},init:function(a){$.ig.$op.init.call(this);this.a(a)},e:function(){if(this.a().positionResolver().hasUnregisterdPositions()){this.a().positionResolver().completeRegisterPositions()}this.d(new $$t.by($.ig.Number.prototype.$type,2,this.a().tuples().count()));var a=this.a().positionResolver().rootPositionInfo();var b=$$t.$cp.t($$t.$cj.$type.specialize(String,$.ig.$op.$type),a.values(),function(c){return c.positionItemDepth()==a.positionItemDepthMin()});var d=this.c(a,b).getEnumerator();while(d.moveNext()){var c=d.current();this.f(a,c)}},b:function(a,b){},c:function(a,b){},f:function(a,b){var c=$$t.$cp.t($$t.$cj.$type.specialize(String,$.ig.$op.$type),b.values(),function(d){return d.positionItemDepth()==b.positionItemDepthMin()});if($$t.$cp.ai($$t.$cj.$type.specialize(String,$.ig.$op.$type),c)>0){var e=c.getEnumerator();while(e.moveNext()){var d=e.current();this.f(b,d)}}else{this.d().add(b.positionIndex())}var f=this.b(a,b);var h=f.getEnumerator();while(h.moveNext()){var g=h.current();this.f(a,g)}},$type:new $.ig.Type("AxisTupleVisitor",$.ig.$ot)},true);$c("AxisHeaderSortingVisitor:e0","AxisTupleVisitor",{h:null,i:null,g:null,init:function(a,b,c,d){$$t.$ez.init.call(this,a);this.h=b;this.i=c;this.g=d},b:function(a,b){var $self=this;var c=$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.t($$t.$cj.$type.specialize(String,$.ig.$op.$type),a.values(),function(d){return d.parentKey()==b.key()}));if(c.count()>0){var d=c.item(0);var e;if(function(){var f=$self.h.tryGetValue(d.hierarchyLevelKey(),e);e=f.p1;return f.ret}()){if(e.sortBehavior()==1){c=e.sortDirection()==0?$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.w($$t.$cj.$type.specialize(String,$.ig.$op.$type),$.ig.$op.$type,c,function(f){return f.sortKey()})):$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.x($$t.$cj.$type.specialize(String,$.ig.$op.$type),$.ig.$op.$type,c,function(f){return f.sortKey()}))}else{c=e.sortDirection()==0?$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.w($$t.$cj.$type.specialize(String,$.ig.$op.$type),String,c,function(f){return f.caption()})):$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.x($$t.$cj.$type.specialize(String,$.ig.$op.$type),String,c,function(f){return f.caption()}))}if(!$$t.$cp.e(String,$$t.$cp.n($$t.$ev.$type,String,this.i,function(f){return f.levelUniqueName()}),e.levelUniqueName())){this.i.add(e)}var f;if(!function(){var g=$self.g.tryGetValue(d.positionItemIndex(),f);f=g.p1;return g.ret}()){f=new $$t.ck($.ig.Number.prototype.$type,$$t.$c8.$type,0);this.g.add(b.positionItemIndex(),f)}f.item(b.positionItemDepth(),e.sortDirection())}}return c},c:function(a,b){var $self=this;var c=$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),b);if(c.count()>0){var d=c.item(0);var e;if(d.hierarchyLevelKey()!=null&&function(){var f=$self.h.tryGetValue(d.hierarchyLevelKey(),e);e=f.p1;return f.ret}()){if(e.sortBehavior()==1){c=e.sortDirection()==0?$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.w($$t.$cj.$type.specialize(String,$.ig.$op.$type),$.ig.$op.$type,c,function(f){return f.sortKey()})):$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.x($$t.$cj.$type.specialize(String,$.ig.$op.$type),$.ig.$op.$type,c,function(f){return f.sortKey()}))}else{c=e.sortDirection()==0?$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.w($$t.$cj.$type.specialize(String,$.ig.$op.$type),String,c,function(f){return f.caption()})):$$t.$cp.y($$t.$cj.$type.specialize(String,$.ig.$op.$type),$$t.$cp.x($$t.$cj.$type.specialize(String,$.ig.$op.$type),String,c,function(f){return f.caption()}))}this.i.add(e);var f;if(!function(){var g=$self.g.tryGetValue(d.positionItemIndex(),f);f=g.p1;return g.ret}()){f=new $$t.ck($.ig.Number.prototype.$type,$$t.$c8.$type,0);this.g.add(a.positionItemIndex(),f)}f.item(a.positionItemDepth(),e.sortDirection())}}return c},$type:new $.ig.Type("AxisHeaderSortingVisitor",$$t.$ez.$type)},true);$c("ResultHeaderSorter:ex","ResultSorter$1",{f:null,_h:null,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},init:function(a,b,c,d){$$t.$ey.init.call(this,$$t.$e0.$type,a,b,c);this.f=new $$t.ck(String,$$t.$ev.$type,1,d.count());var f=d.getEnumerator();while(f.moveNext()){var e=f.current();this.f.item(e.levelUniqueName(),e)}},b:function(){var $self=this;this.h(new $$t.by($$t.$ev.$type,0));this.g(new $$t.ck(String,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$$t.$c8.$type)),0));if(this.a().isEmpty()){return this.a()}var a=new $$t.by($$t.$bw.$type,0);var b=0;var c=1;var d=new $$t.ck($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);var e=new $$t.ck($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);if(this.c()){var f=this.a().axes().item(b);var g=new $$t.ck($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$$t.$c8.$type),0);var h=new $$t.e0(f,this.f,this.h(),g);var i=this.e(h,f,d);var j=function(){var $ret=new $$t.bw(i,f.tupleSize());$ret.name(f.name());return $ret}();a.add(j);this.g().item(f.name(),g);c=f.tuples().count();b++}if(this.d()){var k=this.a().axes().item(b);var l=new $$t.ck($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$$t.$c8.$type),0);var m=new $$t.e0(k,this.f,this.h(),l);var n=this.e(m,k,e);var o=function(){var $ret=new $$t.bw(n,k.tupleSize());$ret.name(k.name());return $ret}();a.add(o);this.g().item(k.name(),l)}var p=new $$t.by($$t.$db.$type,2,this.a().cells().count());var r=this.a().cells().getEnumerator();while(r.moveNext()){var q=r.current();var s=q.clone();var t=s.cellOrdinal();if(this.c()){var u=t%c;var v=d.item(u);if(u!=v){var w=$a(t,c);t=w*c+v}}if(this.d()){var x=$a(t,c);var y=e.item(x);if(x!=y){var z=t%c;t=y*c+z}}s.cellOrdinal(t);p.add(s)}var aa=function(){var $ret=new $$t.bt;$ret.isEmpty($self.a().isEmpty());$ret.axes(a);$ret.cells(p);return $ret}();return aa},$type:new $.ig.Type("ResultHeaderSorter",$$t.$ey.$type.specialize($$t.$e0.$type))},true);$c("AxisValueSortingVisitor:e2","AxisTupleVisitor",{g:null,init:function(a,b){$$t.$ez.init.call(this,a);this.g=b},b:function(a,b){var c=$$t.$cp.t($$t.$cj.$type.specialize(String,$.ig.$op.$type),a.values(),function(d){return d.parentKey()==b.key()});return this.c(a,c)},c:function(a,b){var positionItemInfos_=$$t.$cp.a($$t.$cj.$type.specialize(String,$.ig.$op.$type),b);if(positionItemInfos_.length>0){var tupleSortDirections_=$$t.$cp.a($$t.$co.$type.specialize($$t.$eu.$type,Array),this.g);var sortFunction=function(tupleSortDirections){var compareCells=function(comparer,cell1,cell2){var result=comparer(cell1,cell2);if(result<0){return-1}if(result>0){return 1}return!isNaN(parseFloat(result))&&isFinite(result)?result:0};return function(o1,o2){var i,length,tupleSortDirection,cells,direction,cell1,cell2,arr1=[],arr2=[];for(i=0;i<tupleSortDirections.length;i++){tupleSortDirection=tupleSortDirections[i].key();cells=tupleSortDirections[i].value();if(tupleSortDirection.sortDirection()===$.ig.ListSortDirection.prototype.ascending){direction=1}else{direction=-1}comparer=tupleSortDirection.comparer();cell1=cells[o1.positionIndex()];cell2=cells[o2.positionIndex()];if(tupleSortDirections.length===1){arr1=direction*compareCells(comparer,cell1,cell2);arr2=direction*compareCells(comparer,cell2,cell1)}else{arr1.push(direction*compareCells(comparer,cell1,cell2));arr2.push(direction*compareCells(comparer,cell2,cell1))}}if(arr1<arr2){return-1}if(arr1>arr2){return 1}return 0}};positionItemInfos_.sort(sortFunction(tupleSortDirections_))}return positionItemInfos_},$type:new $.ig.Type("AxisValueSortingVisitor",$$t.$ez.$type)},true);$c("ResultColumnValueSorter:e1","ResultSorter$1",{f:null,_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},init:function(a,b,c,d){$$t.$ey.init.call(this,$$t.$e2.$type,a,b,c);this.f=d},b:function(){var $self=this;this.g(new $$t.by($$t.$eu.$type,0));if(!this.d()||this.a().isEmpty()){return this.a()}var a=new $$t.by($$t.$bw.$type,0);var b=0;var c=null;var d=1;if(this.c()){c=this.a().axes().item(b);d=c.tuples().count();a.add(c.clone());b++}var e=this.a().axes().item(b);var f=this.a().axes().item(b).tuples().count();var g=new $$t.ck($.ig.Number.prototype.$type,$.ig.$op.$type,1,this.a().cells().count());var i=this.a().cells().getEnumerator();while(i.moveNext()){var h=i.current();var j=null;if(function(){var k=h.properties().tryGetValue("Value",j);j=k.p1;return k.ret}()){g.item(h.cellOrdinal(),j)}else{var k=h.properties().tryGetValue("FmtValue",j);j=k.p1;g.item(h.cellOrdinal(),j)}}var l=new $$t.by($$t.$co.$type.specialize($$t.$eu.$type,Array),2,this.f.count());var n=this.f.getEnumerator();while(n.moveNext()){var m=n.current();var o;if(c!=null&&m.memberNames()!=null){if(c.positionResolver().hasUnregisterdPositions()){c.positionResolver().completeRegisterPositions()}o=c.positionResolver().rootPositionInfo().getIndex(m.memberNames());m.tupleIndex(o)}else{o=m.tupleIndex()}if(o>-1&&o<d){var p=new Array(f);for(var q=0;q<f;q++){var r=null;var s=g.tryGetValue(q*d+o,r);r=s.p1;p[q]=r}l.add(new $$t.co($$t.$eu.$type,Array,1,m,p));this.g().add(m)}}var t=new $$t.ck($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);var u=new $$t.e2(e,l);var v=this.e(u,e,t);var w=function(){var $ret=new $$t.bw(v,e.tupleSize());$ret.name(e.name());return $ret}();a.add(w);var x=new $$t.by($$t.$db.$type,2,this.a().cells().count());var z=this.a().cells().getEnumerator();while(z.moveNext()){var y=z.current();var aa=y.clone();var ab=aa.cellOrdinal();var ac=$a(ab,d);var ad=t.item(ac);if(ac!=ad){var ae=ab%d;ab=ad*d+ae}aa.cellOrdinal(ab);x.add(aa)}var af=function(){var $ret=new $$t.bt;$ret.isEmpty($self.a().isEmpty());$ret.axes(a);$ret.cells(x);return $ret}();return af},$type:new $.ig.Type("ResultColumnValueSorter",$$t.$ey.$type.specialize($$t.$e2.$type))},true);$c("TupleSortDirection:eu","Object",{init:function(){$.ig.$op.init.call(this)},_tupleIndex:0,tupleIndex:function(a){if(arguments.length===1){this._tupleIndex=a;return a}else{return this._tupleIndex}},_memberNames:null,memberNames:function(a){if(arguments.length===1){this._memberNames=a;return a}else{return this._memberNames}},_sortDirection:0,sortDirection:function(a){if(arguments.length===1){this._sortDirection=a;return a}else{return this._sortDirection}},_comparer:null,comparer:function(a){if(arguments.length===1){this._comparer=a;return a}else{return this._comparer}},$type:new $.ig.Type("TupleSortDirection",$.ig.$ot)},true);$c("DataSourceBase:f5","Object",{init:function(){$.ig.$op.init.call(this)},_dataSource:null,dataSource:function(a){if(arguments.length===1){this._dataSource=a;return a}else{return this._dataSource}},isInitialized:function(){if(this.dataSource()==null){return false}return this.dataSource().isInitialized()},_isModified:false,isModified:function(a){if(arguments.length===1){this._isModified=a;return a}else{return this._isModified}},_isUpdating:false,isUpdating:function(a){if(arguments.length===1){this._isUpdating=a;return a}else{return this._isUpdating}},initialize:function(){var promise_=this.dataSource().initialize().c();var $this=this;if(!this._isInitializedAttached){this._isInitializedAttached=true;promise_.always(function(result){var args={error:null,metadataTreeRoot:null};if(this.state()==="rejected"){args.error=result}else{args.metadataTreeRoot=result}$($this).trigger("initialized",args);$this._isInitializedAttached=false})}return promise_},cubes:function(){return this.dataSource().cubes().inner()},cube:function(){return this.dataSource().cube()},setCube:function(a){return this.dataSource().setCube(a).j($$t.$e7.$type,function(b){return b.m()}).c()},metadataTree:function(){return this.dataSource().metadataTree()},addRowItem:function(a){if($b($$t.$bk.$type,a)!==null){this.dataSource().rowAxis().add(a);this.isModified(true)}},insertRowItem:function(a,b){if($b($$t.$bk.$type,b)!==null){this.dataSource().rowAxis().insert(a,b);this.isModified(true)}},removeRowItem:function(a){if($b($$t.$bk.$type,a)!==null||$b($$t.$fa.$type,a)!==null){this.dataSource().rowAxis().remove(a);this.isModified(true)}},addColumnItem:function(a){if($b($$t.$bk.$type,a)!==null){this.dataSource().columnAxis().add(a);this.isModified(true)}},insertColumnItem:function(a,b){if($b($$t.$bk.$type,b)!==null){this.dataSource().columnAxis().insert(a,b);this.isModified(true)}},removeColumnItem:function(a){if($b($$t.$bk.$type,a)!==null||$b($$t.$fa.$type,a)!==null){this.dataSource().columnAxis().remove(a);this.isModified(true)}},addFilterItem:function(a){if($b($$t.$bk.$type,a)!==null){this.dataSource().filters().add(a);this.isModified(true)}},insertFilterItem:function(a,b){if($b($$t.$bk.$type,b)!==null){this.dataSource().filters().insert(a,b);this.isModified(true)}},removeFilterItem:function(a){if($b($$t.$bk.$type,a)!==null){this.dataSource().filters().remove(a);this.isModified(true)}},addMeasureItem:function(a){if($b($$t.$bn.$type,a)!==null){this.dataSource().measures().add(a);this.isModified(true)}},insertMeasureItem:function(a,b){if($b($$t.$bn.$type,b)!==null){this.dataSource().measures().insert(a,b);this.isModified(true)}},removeMeasureItem:function(a){if($b($$t.$bn.$type,a)!==null){this.dataSource().measures().remove(a);this.isModified(true)}},setMeasureListIndex:function(a){this.dataSource().measureListIndex(a);this.isModified(true)},setMeasureListLocation:function(a){switch(a){case"rows":this.dataSource().measureListLocation(0);break;case"columns":this.dataSource().measureListLocation(1);break;default:break}this.isModified(true)},getMeasureListLocation:function(){switch(this.dataSource().measureListLocation()){case 0:return"rows";break;case 1:return"columns";break;default:return null;break}},expandTupleMember:function(a,b,c){this.dataSource().expandTupleMember(a,b,c)},collapseTupleMember:function(a,b,c){this.dataSource().collapseTupleMember(a,b,c)},rowAxis:function(){return this.dataSource().rowAxis().inner()},columnAxis:function(){return this.dataSource().columnAxis().inner()},filters:function(){return this.dataSource().filters().inner()},measures:function(){return this.dataSource().measures().inner()},result:function(){return this.dataSource().result()},bindCollectionChanged:function(a){var options_=a;var ds_=this.dataSource();var attachCollectionChanged=function(collection,handler){collection.collectionChanged=$.ig.Delegate.prototype.combine(collection.collectionChanged,handler)};if($.isFunction(options_["filters"])){attachCollectionChanged(ds_._filters,options_["filters"])}if($.isFunction(options_["rowAxis"])){attachCollectionChanged(ds_._rowAxis,options_["rowAxis"])}if($.isFunction(options_["columnAxis"])){attachCollectionChanged(ds_._columnAxis,options_["columnAxis"])}if($.isFunction(options_["measures"])){attachCollectionChanged(ds_._measures,options_["measures"])}},unbindCollectionChanged:function(a){var options_=a;var ds_=this.dataSource();unbindCollectionChanged=function(collection,handler){collection.collectionChanged=$.ig.Delegate.prototype.remove(collection.collectionChanged,handler)};if($.isFunction(options_["filters"])){unbindCollectionChanged(ds_._filters,options_["filters"])
}if($.isFunction(options_["rowAxis"])){unbindCollectionChanged(ds_._rowAxis,options_["rowAxis"])}if($.isFunction(options_["columnAxis"])){unbindCollectionChanged(ds_._columnAxis,options_["columnAxis"])}if($.isFunction(options_["measures"])){unbindCollectionChanged(ds_._measures,options_["measures"])}},clearPendingChanges:function(){this.dataSource().clearPendingChanges()},update:function(){var promise_=this.dataSource().update().c();var $this=this;if(!this.isUpdating()){this.isUpdating(true);promise_.always(function(result){var args={error:null,result:null};if(this.state()==="rejected"){args.error=result}else{args.result=result}$this.isUpdating(false);$this.isModified(false);$($this).trigger("updated",args)})}return promise_},getCoreElement:function(a,b){return this.dataSource().getCoreElement(a,b)},getCoreElements:function(a,b){return this.dataSource().getCoreElements(a,b).inner()},getMembersOfHierarchy:function(a){return this.dataSource().getMembersOfHierarchy(a).c()},getMembersOfLevel:function(a){return this.dataSource().getMembersOfLevel(a).c()},tryGetMember:function(a){var $self=this;var b;if(function(){var c=$self.dataSource().tryGetMember(a,b);b=c.p1;return c.ret}()){return b}return null},tryGetMembersForLevel:function(a){var $self=this;var b=new $$t.ec($$t.$br.$type);var c=function(){var d=$self.dataSource().tryGetMembersForLevel(a,b);b=d.p1;return d.ret}();return c?b.inner():new $$t.ec($$t.$br.$type).inner()},getMembersOfMember:function(a){return this.dataSource().getMembersOfMember(a).c()},addFilterMember:function(a,b){this.dataSource().addFilterMember(a,b);this.isModified(true)},removeAllFilterMembers:function(a){this.dataSource().removeAllFilterMembers(a);this.isModified(true)},getFilterMemberNames:function(a){return this.dataSource().getFilterMemberNames(a).inner()},getDimension:function(a){return this.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$$t.$bb.$type)},getHierarchy:function(a){return this.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$$t.$bk.$type)},getLevel:function(a){return this.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$$t.$bm.$type)},getMeasure:function(a){return this.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$$t.$bn.$type)},getMeasureList:function(){return this.dataSource().getCoreElement(null,$$t.$fa.$type)},$type:new $.ig.Type("DataSourceBase",$.ig.$ot)},true);$c("jQueryUtils:f6","Object",{init:function(){$.ig.$op.init.call(this)},c:function($t,a){if(a==null){return null}var jsObject_=a;var dict_=new $$t.ck(String,$t,0);(function(obj,dict){var tempDict=$.ig.Dictionary.prototype.getDictionary(obj);var keys=tempDict.keys();while(keys.moveNext()){var key=keys.current();var value=tempDict.item(key);dict.add(key,value)}})(jsObject_,dict_);return dict_},i:function($t,a){if(a==null){return null}var jsObject_=$$t.$f6.createJavascriptObject();var b=a.getEnumerator();while(b.moveNext()){var item_=b.current();jsObject_[item_.key()]=item_.value()}return jsObject_},convertToObjectDictionary:function(a){return $$t.$f6.c($.ig.$op.$type,a)},convertToStringDictionary:function(a){return $$t.$f6.c(String,a)},convertFromObjectDictionary:function(a){return $$t.$f6.i($.ig.$op.$type,a)},convertFromStringDictionary:function(a){return $$t.$f6.i(String,a)},createJavascriptObject:function(){return{}},getJavascriptObjectProperty:function(a,b){var jsObject_=a;var property_=b;return jsObject_[property_]},setJavascriptObjectProperty:function(a,b,c){var jsObject_=a;var property_=b;var value_=c;jsObject_[property_]=value_},getJavascriptObjectMethodResult:function(a,b,c){var jsObject_=a;var method_=b;var args_=c;return jsObject_[method_].call(jsObject_,args_)},$type:new $.ig.Type("jQueryUtils",$.ig.$ot)},true);$c("OlapUtilities:f7","Object",{init:function(){$.ig.$op.init.call(this)},dateMemberProvider:function(a,b,c,d){if(String.isNullOrEmpty(a)||String.isNullOrEmpty(b)){return null}var propName_=b;var datePartFormat_=d;var format_=c;var yearProvider_;var semesterProvider_;var quarterProvider_;var monthProvider_;a=a.toLowerCase();switch(a){case"year":if(datePartFormat_==null){datePartFormat_="yyyy"}if(format_==null){return function(item){return $.ig.formatter(new Date(item[propName_]),"date",datePartFormat_)}}return function(item){return format_.replace("{0}",$.ig.formatter(new Date(item[propName_]),"date",datePartFormat_))};case"semester":if(format_==null){format_="H{0}"}yearProvider_=$$t.$f7.dateMemberProvider("year",b,null,null);return function(item){var year=yearProvider_(item);return format_.replace("{0}",Math.floor(new Date(item[propName_]).getMonth()/6)+1).replace("{1}",year)};case"quarter":if(format_==null){format_="Q{0}"}yearProvider_=$$t.$f7.dateMemberProvider("year",b,null,null);semesterProvider_=$$t.$f7.dateMemberProvider("semester",b,null,null);return function(item){var year=yearProvider_(item);var semester=semesterProvider_(item);return format_.replace("{0}",Math.floor(new Date(item[propName_]).getMonth()/3)+1).replace("{1}",semester).replace("{2}",year)};case"month":if(datePartFormat_==null){datePartFormat_="MMMM"}if(format_==null){return function(item){return $.ig.formatter(new Date(item[propName_]),"date",datePartFormat_)}}yearProvider_=$$t.$f7.dateMemberProvider("year",b,null,null);semesterProvider_=$$t.$f7.dateMemberProvider("semester",b,null,null);quarterProvider_=$$t.$f7.dateMemberProvider("quarter",b,null,null);return function(item){var year=yearProvider_(item);var semester=semesterProvider_(item);var quarter=quarterProvider_(item);return format_.replace("{0}",$.ig.formatter(new Date(item[propName_]),"date",datePartFormat_)).replace("{1}",quarter).replace("{2}",semester).replace("{3}",year)};case"date":if(datePartFormat_==null){datePartFormat_="MM/dd/yyyy"}if(format_==null){return function(item){return $.ig.formatter(new Date(item[propName_]),"date",datePartFormat_)}}yearProvider_=$$t.$f7.dateMemberProvider("year",b,null,null);semesterProvider_=$$t.$f7.dateMemberProvider("semester",b,null,null);quarterProvider_=$$t.$f7.dateMemberProvider("quarter",b,null,null);monthProvider_=$$t.$f7.dateMemberProvider("month",b,null,null);return function(item){var year=yearProvider_(item);var semester=semesterProvider_(item);var quarter=quarterProvider_(item);var month=monthProvider_(item);return format_.replace("{0}",$.ig.formatter(new Date(item[propName_]),"date",datePartFormat_)).replace("{1}",month).replace("{2}",quarter).replace("{3}",semester).replace("{4}",year)}}return null},getDateHierarchy:function(a,b,c,d,e,f){if(String.isNullOrEmpty(a)){return null}if(b==null||b.length==0){b=["year","quarter","month","date"]}else{for(var g=0;g<b.length;g++){b[g]=b[g].toLowerCase()}}if(c==null){c="Dates"}if(d==null){d=c}var res_=null;var name_=c;var caption_=d;var rootCaption_=f;var dateParts_=b;if(e==null){e=new Array(b.length);for(var h=0;h<e.length;h++){var i=b[h];e[h]=i.substr(0,1).toUpperCase()+i.substr(1,i.length)+"s"}}var captions_=e;var memberProviders_=new Array(b.length);for(var j=0;j<b.length;j++){var k=b[j];memberProviders_[j]=$$t.$f7.dateMemberProvider(k,a,null,null)}var levelsMetadata=[];var levelOffset=0;if(rootCaption_!=null&&rootCaption_!=""){levelOffset=1;levelsMetadata[0]={name:rootCaption_,caption:rootCaption_,memberProvider:function(item){return rootCaption_}}}for(var i=0;i<memberProviders_.length;i++){levelsMetadata[i+levelOffset]={name:dateParts_[i],caption:captions_[i],memberProvider:memberProviders_[i]}}res_={name:name_,caption:caption_,levels:levelsMetadata};return res_},sumAggregator:function(a,b){var propName_=a;var precision_=b;return function(items,cellMetadata){var sum=0,areAllNullOrUndefined=true,value;for(var i=0;i<items.length;i++){value=items[i][propName_];if(value!==null&&value!==undefined){areAllNullOrUndefined=false;sum+=value}}if(areAllNullOrUndefined)return null;if(precision_!=null){return sum.toFixed(precision_)}return sum}},avgAggregator:function(a,b){var propName_=a;var precision_=b;return function(items,cellMetadata){if(precision_==null){precision_=2}var sum=0,count=0,areAllNullOrUndefined=true,value;for(var i=0;i<items.length;i++){value=items[i][propName_];if(value!==null&&value!==undefined){areAllNullOrUndefined=false;sum+=value;count++}}if(areAllNullOrUndefined)return null;return(sum/count).toFixed(precision_)}},minAggregator:function(a){var propName_=a;return function(items,cellMetadata){var result=items[0][propName_];for(var i=1;i<items.length;i++){result=Math.min(result,items[i][propName_])}return result}},maxAggregator:function(a){var propName_=a;return function(items,cellMetadata){var result=items[0][propName_];for(var i=1;i<items.length;i++){result=Math.max(result,items[i][propName_])}return result}},countAggregator:function(){return function(items,cellMetadata){return items.length}},$type:new $.ig.Type("OlapUtilities",$.ig.$ot)},true);$c("OlapTableView:f8","Object",{a:null,init:function(a,b,c,d){$.ig.$op.init.call(this);var e=this.b(d);this.a=new $$t.eq(a,b,c,e)},rowHeaders:function(){if(this.a.rowHeaders()==null){return null}return this.a.rowHeaders().inner()},columnHeaders:function(){if(this.a.columnHeaders()==null){return null}return this.a.columnHeaders().inner()},resultCells:function(){if(this.a.resultCells()==null){return null}return this.a.resultCells().inner()},columnSortDirections:function(a){if(arguments.length===1){this.a.columnSortDirections().clear();var c=a.getEnumerator();while(c.moveNext()){var b=c.current();var d=this.d(b);this.a.columnSortDirections().add(d)}return a}else{var a=new $.ig.Array;var c=this.a.columnSortDirections().getEnumerator();while(c.moveNext()){var b=c.current();a.add(this.n(b))}return a}},appliedColumnSortDirections:function(){var a=new $.ig.Array;var c=this.a.appliedColumnSortDirections().getEnumerator();while(c.moveNext()){var b=c.current();a.add(this.n(b))}return a},levelSortDirections:function(a){if(arguments.length===1){this.a.levelSortDirections().clear();var c=a.getEnumerator();while(c.moveNext()){var b=c.current();var d=this.c(b);this.a.levelSortDirections().add(d)}return a}else{var a=new $.ig.Array;var c=this.a.levelSortDirections().getEnumerator();while(c.moveNext()){var b=c.current();a.add(this.m(b))}return a}},appliedLevelSortDirections:function(){var a=new $.ig.Array;var c=this.a.appliedLevelSortDirections().getEnumerator();while(c.moveNext()){var b=c.current();a.add(this.m(b))}return a},appliedSortDirectionsMap:function(){var resultMap_=$$t.$f6.createJavascriptObject();var a=this.a.appliedSortDirectionsMap().getEnumerator();while(a.moveNext()){var i_=a.current();var axisMap_=$$t.$f6.createJavascriptObject();var b=i_.value().getEnumerator();while(b.moveNext()){var j_=b.current();var hierarchyMap_=$$t.$f6.createJavascriptObject();var c=j_.value().getEnumerator();while(c.moveNext()){var k_=c.current();var sortDirection_=k_.value()==0?"ascending":"descending";hierarchyMap_[k_.key()]=sortDirection_}axisMap_[j_.key()]=hierarchyMap_}resultMap_[i_.key()]=axisMap_}return resultMap_},initialize:function(){this.a.initialize()},b:function(a){var b=new $$t.er;var c=$$t.$f6.getJavascriptObjectProperty(a,"rowHeadersLayout");var d=1;if(!String.isNullOrEmpty(c)){switch(c){case"tree":d=2;var e=$$t.$f6.getJavascriptObjectProperty(a,"compactRowHeaderIndentation");var f=$$t.$f6.getJavascriptObjectProperty(a,"treeRowHeaderIndentation");b=new $$t.e3(e,f);break;case"standard":d=0;break}}var g=$$t.$f6.getJavascriptObjectProperty(a,"isParentInFrontForColumns");var h=$$t.$f6.getJavascriptObjectProperty(a,"isParentInFrontForRows");var i=$$t.$f6.getJavascriptObjectProperty(a,"compactColumnHeaders");b.c(g);b.d(h);b.b(i);b.a(d);return b},d:function(o_){var a=$$t.$f6.getJavascriptObjectProperty(o_,"memberNames");var b=$g($$t.$f6.getJavascriptObjectProperty(o_,"tupleIndex"));var c=$$t.$f6.getJavascriptObjectProperty(o_,"sortDirection");var d=0;if(!String.isNullOrEmpty(c)){c=c.toLowerCase();if(c=="descending"){d=1}}var comparer_=null;if($.isFunction(o_.comparer)){comparer_=o_.comparer}else{comparer_=function(o1,o2){return parseFloat(o1||-Infinity)-parseFloat(o2||-Infinity)}}return function(){var $ret=new $$t.eu;$ret.memberNames(a);$ret.tupleIndex(b);$ret.sortDirection(d);$ret.comparer(comparer_);return $ret}()},n:function(a){var b=$$t.$f6.createJavascriptObject();$$t.$f6.setJavascriptObjectProperty(b,"memberNames",a.memberNames());$$t.$f6.setJavascriptObjectProperty(b,"tupleIndex",a.tupleIndex());$$t.$f6.setJavascriptObjectProperty(b,"sortDirection",a.sortDirection()==0?"ascending":"descending");if(a.comparer()!=null){$$t.$f6.setJavascriptObjectProperty(b,"comparer",a.comparer())}return b},c:function(a){var b=$$t.$f6.getJavascriptObjectProperty(a,"levelUniqueName");var c=$$t.$f6.getJavascriptObjectProperty(a,"sortDirection");var d=$$t.$f6.getJavascriptObjectProperty(a,"sortBehavior");if(!String.isNullOrEmpty(b)){var e=new $$t.ev;e.sortDirection(0);e.sortBehavior(1);e.levelUniqueName(b);if(!String.isNullOrEmpty(c)){c=c.toLowerCase();if(c=="descending"){e.sortDirection(1)}}if(!String.isNullOrEmpty(d)){d=d.toLowerCase();if(d=="alphabetical"){e.sortBehavior(0)}}return e}else{return null}},m:function(a){var b=$$t.$f6.createJavascriptObject();$$t.$f6.setJavascriptObjectProperty(b,"levelUniqueName",a.levelUniqueName());$$t.$f6.setJavascriptObjectProperty(b,"sortBehavior",a.sortBehavior()==1?"system":"alphabetical");$$t.$f6.setJavascriptObjectProperty(b,"sortDirection",a.sortDirection()==0?"ascending":"descending");return b},$type:new $.ig.Type("OlapTableView",$.ig.$ot)},true);$c("ArrayListCollection___Enumerate__IteratorClass$1:ArrayListCollection___Enumerate__IteratorClass$1","Object",{$t:null,c:0,b:null,d:0,__4__this:null,init:function($t,a){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this);this.c=a},moveNext:function(){while(this.c>=0){switch(this.c){case 0:this.c=-1;this.d=0;this.c=1;break;case 1:this.c=-1;if(this.d<this.__4__this.inner().length){this.b=$u(this.$t,this.__4__this.inner()[this.d]);this.c=2;return true}break;case 2:this.c=-1;this.d++;this.c=1;break}}return false},getEnumerator:function(){var d__;if(this.c==-2){this.c=0;d__=this}else{d__=new $.ig.ArrayListCollection___Enumerate__IteratorClass$1(this.$t,0);d__.__4__this=this.__4__this}return d__},reset:function(){throw new $$t.w(1)},dispose:function(){},current:function(){return this.b},current1:function(){return $d(this.$t,this.b)},$type:new $.ig.Type("ArrayListCollection___Enumerate__IteratorClass$1",$.ig.$ot,[$$t.$a5.$type.specialize(0),$.ig.IEnumerable.prototype.$type,$$t.$a6.$type.specialize(0),$.ig.IEnumerator.prototype.$type,$$t.$am.$type])},true);$$t.$ew.alphabetical=0;$$t.$ew.system=1;$$t.$e8.cube=0;$$t.$e8.dimension=1;$$t.$e8.group=2;$$t.$e8.userDefinedHierarchy=3;$$t.$e8.systemEnabledHierarchy=4;$$t.$e8.parentChildHierarchy=5;$$t.$e8.measure=6;$$t.$e8.level1=7;$$t.$e8.level2=8;$$t.$e8.level3=9;$$t.$e8.level4=10;$$t.$e8.level5=11;$$t.$e8.kpiRoot=12;$$t.$e8.kpi=13;$$t.$e8.kpiValue=14;$$t.$e8.kpiGoal=15;$$t.$e8.kpiStatus=16;$$t.$e8.kpiTrend=17;$$t.$e8.kpiWeight=18;$$t.$e9.rows=0;$$t.$e9.columns=1;$$t.$es.standard=0;$$t.$es.superCompact=1;$$t.$es.tree=2;$$t.$d6.horizontal=0;$$t.$d6.vertical=1;$$t.$bj.unknown=0;$$t.$bj.regular=1;$$t.$bj.all=2;$$t.$bj.measure=3;$$t.$bj.formula=4;$$t.$bi.one=0;$$t.$bi.many=1;$$t.$bh.unknown=0;$$t.$bh.sum=1;$$t.$bh.count=2;$$t.$bh.min=3;$$t.$bh.max=4;$$t.$bh.average=5;$$t.$bh.variance=6;$$t.$bh.std=7;$$t.$bh.distinctCount=8;$$t.$bh.none=9;$$t.$bh.averageOfChildren=10;$$t.$bh.firstNonEmpty=13;$$t.$bh.lastNonEmpty=14;$$t.$bh.byAccount=15;$$t.$bh.calculated=127;$$t.$bg.userDefined=1;$$t.$bg.systemEnabled=2;$$t.$bg.systemInternal=4;$$t.$bc.unknown=0;$$t.$bc.time=1;$$t.$bc.measure=2;$$t.$bc.other=3;$$t.$bc.quantitative=5;$$t.$bc.accounts=6;$$t.$bc.customers=7;$$t.$bc.products=8;$$t.$bc.scenario=9;$$t.$bc.utility=10;$$t.$bc.currency=11;$$t.$bc.rates=12;$$t.$bc.channel=13;$$t.$bc.promotion=14;$$t.$bc.organization=15;$$t.$bc.billOfMaterials=16;$$t.$bc.geography=17;$$t.$a9.cube=0;$$t.$a9.dimension=1;$$t.$a9.unknown=2;$$t.$fk.e="[";$$t.$fk.f="]";$$t.$fk.i="{";$$t.$fk.j="}";$$t.$fk.h=",";$$t.$fq.d="[";$$t.$fq.e="]";$$t.$fq.g=".";$$t.$fq.i="&"})(jQuery);$.ig=$.ig||{};(function($){var $$t={};$.ig.$currDefinitions=$$t;$.ig.util.bulkDefine(["IFlatDataAxisProvider:a","OlapResultAxis:b","Object:c","Type:d","Boolean:e","ValueType:f","Void:g","IConvertible:h","IFormatProvider:i","Number:j","String:k","IComparable:l","Number:m","Number:n","Number:o","Number:p","NumberStyles:q","Enum:r","Array:s","IList:t","ICollection:u","IEnumerable:v","IEnumerator:w","NotSupportedException:x","Error:y","Number:z","String:aa","StringComparison:ab","RegExp:ac","CultureInfo:ad","DateTimeFormatInfo:ae","Calendar:af","Date:ag","Number:ah","DayOfWeek:ai","DateTimeKind:aj","CalendarWeekRule:ak","NumberFormatInfo:al","CompareInfo:am","CompareOptions:an","IEnumerable$1:ao","IEnumerator$1:ap","IDisposable:aq","StringSplitOptions:ar","Number:as","Number:at","Number:au","Number:av","Number:aw","Number:ax","Assembly:ay","Stream:az","SeekOrigin:a0","RuntimeTypeHandle:a1","MethodInfo:a2","MethodBase:a3","MemberInfo:a4","ParameterInfo:a5","TypeCode:a6","ConstructorInfo:a7","PropertyInfo:a8","PositionResolver$2:a9","List$1:ba","IList$1:bb","ICollection$1:bc","IArray:bd","Script:be","IArrayList:bf","Array:bg","CompareCallback:bh","MulticastDelegate:bi","IntPtr:bj","Func$3:bk","Action$1:bl","Comparer$1:bm","IComparer:bn","IComparer$1:bo","DefaultComparer$1:bp","IComparable$1:bq","Comparison$1:br","ReadOnlyCollection$1:bs","Predicate$1:bt","NotImplementedException:bu","IPosition$2:bv","IPositionItem$2:bw","PositionItemInfo$2:bx","Dictionary$2:by","IDictionary$2:bz","IDictionary:b0","Func$2:b1","KeyValuePair$2:b2","Enumerable:b3","Thread:b4","ThreadStart:b5","IOrderedEnumerable$1:b6","SortedList$1:b7","Math:b8","ArgumentNullException:b9","IEqualityComparer$1:ca","EqualityComparer$1:cb","IEqualityComparer:cc","DefaultEqualityComparer$1:cd","InvalidOperationException:ce","ArgumentException:cf","IHierarchicalPositionItem$2:cg","EventHandler$1:ch","AsyncCompletedEventArgs:ci","EventArgs:cj","Delegate:ck","Interlocked:cl","ListSortDirection:cm","Nullable$1:cn","OlapResultTuple:co","OlapResultAxisMember:cp","Task$1:cq","Task:cr","JQueryPromise:cs","Action:ct","AggregateException:cu","TaskStatus:cv","TaskCompletionSource$1:cw","JQueryDeferred:cx","JQuery:cy","JQueryObject:cz","Element:c0","ElementAttributeCollection:c1","ElementCollection:c2","WebStyle:c3","ElementNodeType:c4","Document:c5","EventListener:c6","IElementEventHandler:c7","ElementEventHandler:c8","ElementAttribute:c9","JQueryPosition:da","JQueryCallback:db","JQueryEvent:dc","JQueryUICallback:dd","RowMetadata:de","FlatDataAxisProvider:df","FlatDataProvider:dg","IFlatDataProvider:dh","IOlapDiscoverDataProvider:di","Catalog:dj","ICoreOlapElement:dk","KeyValueItem:dl","Cube:dm","CubeType:dn","Dimension:dp","DimensionType:dq","Hierarchy:dr","HierarchyOrigin:ds","Level:dt","Measure:du","AggregatorType:dv","MeasureGroup:dw","MeasureGroupDimension:dx","CardinalityType:dy","Member:dz","MemberType:d0","Kpi:d1","TableMetadata:d2","DataSourceMetadata:d3","CubeMetadata:d4","MeasuresDimensionMetadata:d5","ArrayListCollection$1:d6","INotifyCollectionChanged:d7","NotifyCollectionChangedEventHandler:d8","NotifyCollectionChangedEventArgs:d9","NotifyCollectionChangedAction:ea","MeasureMetadata:eb","CellMetadata:ec","DimensionMetadata:ed","HierarchyMetadata:ee","LevelMetadata:ef","DataMemberMetadata:eg","OlapResult:eh","OlapResultCell:ei","TaskFactory:ej","AxisElement:ek","KeyListPair$1:el","FlatDataAxisProviderHelper:em","CubeMetaItemsCache:en","KpiMeasure:eo","MeasureGroupMetaItemsCache:ep","Tuple$2:eq","MeasureList:er","FlatDataPartialAxisProvider:es","FlatDataSourceImpl:et","OlapDataSource:eu","IOlapDataSource:ev","OlapMetadataTreeItem:ew","OlapMetadataTreeItemType:ex","MeasureListLocation:ey","DataSourceBaseOptions:ez","IOlapDataProviderFactory:e0","OlapResultView:e1","PositionInfo:e2","TaskExtensions:e3","AxisDefinitionParser:e4","MetaTreeHelper:e5","HierarchyItemPosition:e6","KpiDimension:e7","FlatDataSourceOptions:e8","IFlatDataProviderFactory:e9","DefaultFlatDataProviderFactory:fa","ResultViewHelper:fb","CoreOlapElementParser:fc","OlapFlatDataSource:fd","DataSourceBase:fe","jQueryUtils:ff","AbstractEnumerable:fh","Func$1:fi","AbstractEnumerator:fj","GenericEnumerable$1:fk","GenericEnumerator$1:fl"]);var $a=$.ig.intDivide,$b=$.ig.util.cast,$c=$.ig.util.defType,$d=$.ig.util.getBoxIfEnum,$e=$.ig.util.getDefaultValue,$f=$.ig.util.getEnumValue,$g=$.ig.util.getValue,$h=$.ig.util.intSToU,$i=$.ig.util.nullableEquals,$j=$.ig.util.nullableIsNull,$k=$.ig.util.nullableNotEquals,$l=$.ig.util.toNullable,$m=$.ig.util.toString$1,$n=$.ig.util.u32BitwiseAnd,$o=$.ig.util.u32BitwiseOr,$p=$.ig.util.u32BitwiseXor,$q=$.ig.util.u32LS,$r=$.ig.util.unwrapNullable,$s=$.ig.util.wrapNullable,$t=String.fromCharCode,$u=$.ig.util.castObjTo$t,$v=$.ig.util.compare,$w=$.ig.util.replace,$x=$.ig.util.stringFormat,$y=$.ig.util.stringFormat1,$z=$.ig.util.stringFormat2,$0=$.ig.util.stringCompare1,$1=$.ig.util.stringCompare2,$2=$.ig.util.stringCompare3,$3=$.ig.util.compareSimple,$4=$.ig.util.numberToString,$5=$.ig.util.tryParseInt32_1,$6=$.ig.util.tryParseInt32_2,$7=$.ig.util.intToString1,$8=$.ig.util.parseInt32_1,$9=$.ig.util.parseInt32_2;$c("IFlatDataAxisProvider:a","Object",{$type:new $.ig.Type("IFlatDataAxisProvider",null)},true);$c("FlatDataAxisProvider:df","Object",{h:null,c:null,a:null,init:function(a,b,c){this.i=null;this.b=null;this.f=false;this.g=false;$.ig.$op.init.call(this);this.a=c;this.d(a);this.h=$$t.$b3.y($$t.$dk.$type,$$t.$b3.n($$t.$dk.$type,$$t.$dk.$type,b,function(d){return d}));this.c=new $$t.em(a,b.count(),c)},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_axis:null,axis:function(a){if(arguments.length===1){this._axis=a;return a}else{return this._axis}},e:function(){return this.c.c()},i:null,b:null,f:false,g:false,n:function(a){if(this.axis()!=null){this.b=this.axis();this.i=$$t.$b3.y($$t.$dk.$type,$$t.$b3.n($$t.$dk.$type,$$t.$dk.$type,a,function(b){return b}));this.f=true}else{this.c=new $$t.em(this.d(),a.count(),this.a);this.h=a}},o:function(){if(this.axis()!=null){this.g=true}},j:function(a){var $self=this;this.f=false;var b=this.i;var c=this.b;var d=new $$t.cw($$t.$b.$type,0);var e=new $$t.ba(String,0);for(var f=0;f<this.h.count();f++){var g=this.h.item(f);if($b($$t.$er.$type,g)!==null){e.add(this.d().e().a().b().c());continue}e.add(g.uniqueName())}this.h=b;var h=new $$t.ba(String,0);var i=new $$t.ba($$t.$b2.$type.specialize(String,$.ig.Number.prototype.$type),0);for(var j=0;j<this.h.count();j++){var k=this.h.item(j);if($b($$t.$er.$type,k)!==null){h.add(this.d().e().a().b().c());continue}h.add(k.uniqueName());i.add(new $$t.b2(String,$.ig.Number.prototype.$type,1,k.uniqueName(),0))}var l=new $$t.ba($$t.$b2.$type.specialize(String,$.ig.Number.prototype.$type),0);if(e.count()>0){var m=-1;for(var n=0;n<h.count();n++){if(n==e.count()||e.item(n)!=h.item(n)){break}m=n}if(m<i.count()-1){for(var o=m+1;o<i.count();o++){l.add(i.item(o))}}else{l=i}var p=new Array(this.h.count());var q=new $$t.ba($$t.$co.$type,0);this.c.l(l).i(function(r){$self.p(m,b,p,r.m(),q,c.name(),d,true)});return d.b()}return this.generateAxis(a)},generateAxis:function(a){var $self=this;if(this.g||this.f){var b=null;if(this.g){b=this.k(a)}if(this.f){b=this.j(a)}return b}var c=new $$t.cw($$t.$b.$type,0);if(this.axis()!=null){c.e(this.axis());return c.b()}var d=new Array(this.h.count());var e=new $$t.ba(String,0);var f=new $$t.ba($$t.$co.$type,0);var g=new $$t.ba($$t.$b2.$type.specialize(String,$.ig.Number.prototype.$type),0);var h=this.h;for(var i=0;i<this.h.count();i++){var j=this.h.item(i);if($b($$t.$er.$type,j)!==null){e.add(this.d().e().a().b().c());continue}e.add(j.uniqueName());g.add(new $$t.b2(String,$.ig.Number.prototype.$type,1,j.uniqueName(),0))}var k=new $$t.ba($$t.$b2.$type.specialize(String,$.ig.Number.prototype.$type),0);var l=this.d().f().e();k=g;var m=this.c.l(k);m.i(function(n){$self.c.n(h,0,d,n.m(),l,null,f);$self.axis(function(){var $ret=new $$t.b(f,h.count());$ret.name(a);return $ret}());c.e($self.axis())});return c.b()},p:function(a,b,c,d,e,f,g,h){var i=this.e();if(h){this.c=new $$t.em(this.d(),b.count(),this.a)}if(a>-1&&i.rootPositionInfo().count()>0){this.c.o(b,a,i.rootPositionInfo(),c,d,e)}else{var j=$$t.$b3.y($$t.$de.$type,$$t.$b3.t($$t.$de.$type,this.d().f().e(),function(k){return!k.a()}));this.c.n(b,0,c,d,j,null,e)}this.axis(function(){var $ret=new $$t.b(e,b.count());$ret.name(f);return $ret}());g.e(this.axis())},l:function(a){if(this.axis()==null){throw new $$t.ce(0)}var c=a.getEnumerator();while(c.moveNext()){var b=c.current();this.c.d(b.key(),b.value())}},m:function(a){var b=new $$t.ba($$t.$b2.$type.specialize($$t.$co.$type,$$t.$bb.$type.specialize($$t.$de.$type)),0);var d=a.e().getEnumerator();while(d.moveNext()){var c=d.current();var e=a.getTupleRowsMetadata(c);b.add(new $$t.b2($$t.$co.$type,$$t.$bb.$type.specialize($$t.$de.$type),1,c,e))}this.l(b)},k:function(a){var $self=this;this.g=false;var b=new $$t.cw($$t.$b.$type,0);var c=new $$t.ba($$t.$b2.$type.specialize($$t.$co.$type,$$t.$bb.$type.specialize($$t.$de.$type)),0);var d=new $$t.ba($$t.$co.$type,0);for(var e=0;e<this.c.c().positions().count();e++){var f=this.c.c().positions().__inner[e];var g=$$t.$b3.y($$t.$de.$type,$$t.$b3.t($$t.$de.$type,this.d().u($$t.$b3.a($$t.$cp.$type,f.members()),f.itemsCount()),function(h){return!h.a()}));if(g.count()>0){d.add(f)}c.add(new $$t.b2($$t.$co.$type,$$t.$bb.$type.specialize($$t.$de.$type),1,f,g))}if(c.count()>0){this.l(c)}var h=new Array(this.h.count());var i=new $$t.ba($$t.$b2.$type.specialize(String,$.ig.Number.prototype.$type),0);for(var j=0;j<this.h.count();j++){var k=this.h.item(j);if($b($$t.$er.$type,k)!==null){continue}i.add(new $$t.b2(String,$.ig.Number.prototype.$type,1,k.uniqueName(),0))}this.c.l(i).i(function(l){$self.p($self.h.count()-1,$self.h,h,l.m(),new $$t.ba($$t.$co.$type,0),a,b,false)});return b.b()},getTupleRowsMetadata:function(a){return this.c.h(a)},$type:new $.ig.Type("FlatDataAxisProvider",$.ig.$ot,[$$t.$a.$type])},true);$c("FlatDataAxisProviderHelper:em","Object",{a:null,e:null,_i:null,i:function(a){if(arguments.length===1){this._i=a;return a}else{return this._i}},init:function(a,b,c){$.ig.$op.init.call(this);this.a=c;this.b(a);this.e=new $$t.by($.ig.Number.prototype.$type,$$t.$bb.$type.specialize($$t.$de.$type),0);this.c(new $$t.a9(String,$.ig.$op.$type,new $$t.ba($$t.$bv.$type.specialize(String,$.ig.$op.$type),0),b));this.i(this.c().positions())},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},h:function(a){var b=null;var c=this.c().getPositionIndex(a);if(c>-1){var d=this.e.tryGetValue(c,b);b=d.p1}return b},d:function(a,b){var c=this.c().getPositionIndex(a);if(c==-1){this.e.add(this.i().count(),b);this.i().add(a);return true}this.e.item(c,b);return false},o:function(a,b,c,d,e,f){var g=c.positionItemDepthMin();var i=$$t.$b3.t($$t.$bx.$type.specialize(String,$.ig.$op.$type),c.values(),function(j){return j.positionItemDepth()==g}).getEnumerator();while(i.moveNext()){var h=i.current();if(h.positionItemIndex()==b||h.count()==0){if(h.count()==0){b=h.positionItemIndex()}this.m(c,h,d,a,b,e,f)}else{var j=h.positionItem();var k=j.clone();var l=new Array(a.count());$.ig.util.arrayCopy1(d,0,l,0,a.count());l[h.positionItemIndex()]=k;this.o(a,b,h,l,e,f)}}},m:function(a,b,c,d,e,f,g){var h=b.positionItem();var i=h.clone();var j=new Array(d.count());$.ig.util.arrayCopy1(c,0,j,0,d.count());j[b.positionItemIndex()]=i;var k=$$t.$b3.y($$t.$de.$type,this.b().u(j,b.positionItemIndex()+1));if(k.count()>0){if(e<d.count()-1){this.n(d,e+1,j,f,k,null,g)}else{var l=new $$t.co(j);var m=$$t.$b3.y($$t.$de.$type,$$t.$b3.t($$t.$de.$type,k,function(n){return!n.a()}));var n=this.c().getPositionIndex(l);if(n==-1){this.e.add(this.i().count(),m);this.i().add(l)}else{this.i().item(n,l)}for(var p=0;p<j.length;p++){var o=j[p];o.position(l)}if(m.count()>0){g.add(l)}}if(b.isExpanded()){var r=$$t.$b3.t($$t.$bx.$type.specialize(String,$.ig.$op.$type),a.values(),function(s){return s.parentKey()==b.key()}).getEnumerator();while(r.moveNext()){var q=r.current();this.m(a,q,c,d,e,f,g)}}}},n:function(a,b,c,d,e,f,g){var h=a.item(b);if($b($$t.$dr.$type,h)!==null){var i=d.item(h.uniqueName());if(f!=null){i=$$t.$b3.t($$t.$dz.$type,i,function(j){return j.parentUniqueName()==f})}if(i==null){return}var k=i.getEnumerator();while(k.moveNext()){var j=k.current();var l;var m=this.b().i(j.uniqueName(),l);l=m.p1;var n=$$t.$b3.y($$t.$de.$type,$$t.$b3.t($$t.$de.$type,e,function(o){return o.d(j.levelUniqueName())==l}));if(n.count()>0){var o=new Array(a.count());$.ig.util.arrayCopy1(c,0,o,0,a.count());var p=new $$t.cp;p.caption(j.caption());p.hierarchyUniqueName(j.hierarchyUniqueName());p.levelNumber(j.levelDepth());p.levelUniqueName(j.levelUniqueName());p.uniqueName(j.uniqueName());p.displayInfo($h(j.childrenCardinality()));p.properties().add("PARENT_UNIQUE_NAME",j.parentUniqueName());p.properties().add("memberId",l.toString());o[b]=p;if(b==a.count()-1){var q=$$t.$b3.y($$t.$de.$type,$$t.$b3.t($$t.$de.$type,n,function(r){return!r.a()}));var r=new $$t.co(o);var s=this.c().getPositionIndex(r);if(s==-1){this.e.add(this.i().count(),q);this.i().add(r)}else{this.i().item(s,r)}for(var u=0;u<o.length;u++){var t=o[u];t.position(r)}if(q.count()>0){g.add(r)}}else{this.n(a,b+1,o,d,n,null,g)}}}}else if($b($$t.$er.$type,h)!==null){var v=h;var x=v.measures().getEnumerator();while(x.moveNext()){var w=x.current();var y=new Array(a.count());$.ig.util.arrayCopy1(c,0,y,0,a.count());var z=new $$t.cp;z.caption(w.caption());var aa=this.j(this.b().e().a().b().c());z.hierarchyUniqueName(aa);z.levelNumber(0);z.uniqueName(w.uniqueName());y[b]=z;if(b==a.count()-1){var ab=new $$t.co(y);var ac=$$t.$b3.y($$t.$de.$type,$$t.$b3.t($$t.$de.$type,e,function(ad){return!ad.a()}));var ad=this.c().getPositionIndex(ab);if(ad==-1){this.e.add(this.i().count(),ac);this.i().add(ab)}else{this.i().item(ad,ab)}for(var af=0;af<y.length;af++){var ae=y[af];ae.position(ab)}if(ac.count()>0){g.add(ab)}}else{this.n(a,b+1,y,d,e,null,g)}}}},l:function(a){var b=this.a;if(a.count()==0){var c=new $$t.cw($.ig.IDictionary$2.prototype.$type.specialize(String,$$t.$ao.$type.specialize($$t.$dz.$type)),0);c.e(new $$t.by(String,$$t.$ao.$type.specialize($$t.$dz.$type),0));return c.b()}var d=new $$t.by(String,$$t.$dt.$type,0);for(var e=0;e<a.count();e++){var f=a.item(e).key();var g=a.item(e).value();var h=$$t.$b3.ae($$t.$dt.$type,$$t.$b3.t($$t.$dt.$type,b.x(),function(i){return i.hierarchyUniqueName()==f&&i.depth()==g}));if(!d.containsKey(f)){d.add(f,h)}}return this.k(d)},j:function(a){if(a.substr(0,1)!="["){a="["+a}if(a.substr(a.length-1,1)!="]"){a+="]"}return a},k:function(a){var $self=this;var b=this.a;var c=new $$t.by(String,$$t.$ao.$type.specialize($$t.$dz.$type),0);var d=new $$t.ba(String,0);var f=a.getEnumerator();while(f.moveNext()){var e=f.current();var g=e.value().uniqueName();var h;if(b.c(g)&&function(){var i=b.j(g,h);h=i.p1;return i.ret}()){c.add(e.key(),h)}else{d.add(e.key())}}if(d.count()==0){var i=new $$t.cw($.ig.IDictionary$2.prototype.$type.specialize(String,$$t.$ao.$type.specialize($$t.$dz.$type)),0);i.e(c);return i.b()}var j=new Array(d.count());var k=0;var m=d.getEnumerator();while(m.moveNext()){var l=m.current();var n=new $$t.ba($$t.$dl.$type,0);n.add(function(){var $ret=new $$t.dl;$ret.a("LEVEL_UNIQUE_NAME");$ret.b(a.item(l).uniqueName());return $ret}());j[k]=this.b().discoverMembersAsync(null,n);k++}var o=new $$t.ej;var p=o.d($.ig.IDictionary$2.prototype.$type.specialize(String,$$t.$ao.$type.specialize($$t.$dz.$type)),j,function(q){return $self.g(q,d,c)});return p},g:function(a,b,c){for(var d=0;d<b.count();d++){var e=b.__inner[d];if(!c.containsKey(e)){var f=a[d].m();var h=f.getEnumerator();while(h.moveNext()){var g=h.current();this.a.aa(g)}c.add(e,f)}}return c},f:function(a,b){var c=new $$t.by(String,$$t.$dt.$type,0);
for(var d=0;d<b.count();d++){var e=a[d];if(e.a()!=null||e.b()){return null}var f=b.item(d);var g=$$t.$b3.ae($$t.$dt.$type,$$t.$b3.t($$t.$dt.$type,e.m(),function(h){return h.depth()==f}));if(g!=null&&!c.containsKey(g.hierarchyUniqueName())){c.add(g.hierarchyUniqueName(),g)}}return c},$type:new $.ig.Type("FlatDataAxisProviderHelper",$.ig.$ot)},true);$c("FlatDataPartialAxisProvider:es","Object",{b:null,d:null,a:null,init:function(a,b,c,d){$.ig.$op.init.call(this);this.c(a);this.b=new $$t.em(a,b.count(),d);this.a=c;this.d=b},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_axis:null,axis:function(a){if(arguments.length===1){this._axis=a;return a}else{return this._axis}},generateAxis:function(a){var $self=this;var b=new $$t.cw($$t.$b.$type,0);if(this.axis()!=null){b.e(this.axis());return b.b()}var c=new Array(this.a.position().itemsCount());var d=new $$t.ba($$t.$co.$type,0);var e=this.a.position().indexOf(this.a);var f=this.a.position();var g=new $$t.ba($$t.$b2.$type.specialize(String,$.ig.Number.prototype.$type),0);for(var h=0;h<this.a.position().itemsCount();h++){if(h<e){c[h]=this.a.position().members().item(h).clone()}else if(h==e){if($b($$t.$er.$type,this.d.item(h))!==null){continue}var i=f.members().item(h);g.add(new $$t.b2(String,$.ig.Number.prototype.$type,1,i.hierarchyUniqueName(),i.depth()+1))}else{if($b($$t.$er.$type,this.d.item(h))!==null){continue}var j=f.members().item(h);g.add(new $$t.b2(String,$.ig.Number.prototype.$type,1,j.hierarchyUniqueName(),j.depth()))}}this.b.l(g).i(function(k){var l=$$t.$b3.y($$t.$de.$type,$self.c().u($$t.$b3.a($$t.$cp.$type,f.members()),e+1));$self.b.n($self.d,e,c,k.m(),l,$self.a.uniqueName(),d);$self.axis(function(){var $ret=new $$t.b(d,f.itemsCount());$ret.name(a);return $ret}());b.e($self.axis())});return b.b()},getTupleRowsMetadata:function(a){return this.b.h(a)},e:function(){return this.b.i()},$type:new $.ig.Type("FlatDataPartialAxisProvider",$.ig.$ot,[$$t.$a.$type])},true);$c("IFlatDataProvider:dh","Object",{$type:new $.ig.Type("IFlatDataProvider",null,[$$t.$di.$type])},true);$c("FlatDataProvider:dg","Object",{v:null,w:null,y:null,z:null,l:null,m:null,p:null,q:null,r:null,aa:null,o:null,n:null,_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},init:function(a,b){this.p=new $$t.by(String,$.ig.Number.prototype.$type,0);this.q=new $$t.by(String,$$t.$eg.$type,0);this.r=new $$t.by(String,$$t.$eg.$type,0);this.k=new $$t.by(String,$.ig.IDictionary$2.prototype.$type.specialize(String,$$t.$eg.$type),0);$.ig.$op.init.call(this);this.ah(a);this.e(b);this.f(new $$t.d2(a));if(b.a()!=null){if(b.a().b()==null){b.a().b(function(){var $ret=new $$t.d5;$ret.b("Measures");$ret.c("Measures");return $ret}())}else{if(String.isNullOrEmpty(b.a().b().b())){b.a().b().b("Measures")}if(String.isNullOrEmpty(b.a().b().c())){b.a().b().c("Measures")}}}},_ah:null,ah:function(a){if(arguments.length===1){this._ah=a;return a}else{return this._ah}},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},discoverCatalogsAsync:function(a,b){throw new $$t.bu(0)},discoverCubesAsync:function(a,b){var c=new $$t.cw($$t.$ao.$type.specialize($$t.$dm.$type),0);if(this.v==null){this.v=this.ab()}c.e(this.v);return c.b()},discoverDimensionsAsync:function(a,b){var c=new $$t.cw($$t.$ao.$type.specialize($$t.$dp.$type),0);if(this.w==null){this.w=this.ac()}c.e(this.w);return c.b()},discoverHierarchiesAsync:function(a,b){var c=new $$t.cw($$t.$ao.$type.specialize($$t.$dr.$type),0);if(this.y==null){this.y=this.ad()}c.e(this.y);return c.b()},discoverLevelsAsync:function(a,b){var c=new $$t.cw($$t.$ao.$type.specialize($$t.$dt.$type),0);var d=this.s(a,b);c.e(d);return c.b()},s:function(a,b){if(this.z==null){this.l=new $$t.by(String,$$t.$bb.$type.specialize($$t.$dt.$type),0);this.z=this.ae()}var c=null;var d=null;if(b!=null){c=$$t.$b3.ae($$t.$dl.$type,$$t.$b3.t($$t.$dl.$type,b,function(e){return e.a()=="HIERARCHY_UNIQUE_NAME"}));d=$$t.$b3.ae($$t.$dl.$type,$$t.$b3.t($$t.$dl.$type,b,function(e){return e.a()=="LEVEL_UNIQUE_NAME"}))}var e;if(c!=null){e=$$t.$b3.t($$t.$dt.$type,this.z,function(f){return f.hierarchyUniqueName()==c.b()})}else{e=$$t.$b3.y($$t.$dt.$type,this.z)}if(d!=null){e=$$t.$b3.t($$t.$dt.$type,e,function(f){return f.uniqueName()==d.b()})}return e},discoverMeasuresAsync:function(a,b){var c=new $$t.cw($$t.$ao.$type.specialize($$t.$du.$type),0);if(this.aa==null){this.o=new $$t.by(String,$$t.$bk.$type.specialize($.ig.IEnumerable.prototype.$type,$$t.$ec.$type,$.ig.$op.$type),0);this.aa=this.af(this.o)}c.e(this.aa);return c.b()},discoverMeasureGroupsAsync:function(a,b){throw new $$t.bu(0)},discoverMeasureGroupDimensionsAsync:function(a,b){throw new $$t.bu(0)},discoverMembersAsync:function(a,b){var c=new $$t.cw($$t.$ao.$type.specialize($$t.$dz.$type),0);var d=this.t(a,b);c.e(d);return c.b()},discoverKpisAsync:function(a,b){var c=new $$t.cw($$t.$ao.$type.specialize($$t.$d1.$type),0);c.e(new $$t.ba($$t.$d1.$type,0));return c.b()},t:function(a,b){var $self=this;if(this.n==null){this.n=new $$t.by(String,$.ig.IDictionary$2.prototype.$type.specialize(String,$$t.$dz.$type),0)}var c=$$t.$b3.ae($$t.$dl.$type,$$t.$b3.t($$t.$dl.$type,b,function(d){return d.a()=="HIERARCHY_UNIQUE_NAME"}));var d=$$t.$b3.ae($$t.$dl.$type,$$t.$b3.t($$t.$dl.$type,b,function(e){return e.a()=="LEVEL_UNIQUE_NAME"}));var e=$$t.$b3.ae($$t.$dl.$type,$$t.$b3.t($$t.$dl.$type,b,function(f){return f.a()=="MEMBER_UNIQUE_NAME"}));if(this.z==null){this.z=this.ae()}var f=null;var g=this.z;if(c!=null){g=$$t.$b3.y($$t.$dt.$type,$$t.$b3.t($$t.$dt.$type,g,function(h){return h.hierarchyUniqueName()==c.b()}))}if(d!=null){var h=$$t.$b3.ac($$t.$dt.$type,$$t.$b3.t($$t.$dt.$type,g,function(i){return i.uniqueName()==d.b()}));var i=h.hierarchyUniqueName();var j=h.depth();var k=0;if(e!=null){k=1}g=$$t.$b3.y($$t.$dt.$type,$$t.$b3.t($$t.$dt.$type,g,function(l){return l.hierarchyUniqueName()==i&&l.depth()<=j+k}))}else if(e!=null){throw new $$t.ce(1,"LEVEL_UNIQUE_NAME restriction is required for MEMBER_UNIQUE_NAME restriction.")}f=new Array(g.count());for(var l=0;l<g.count();l++){f[l]=g.item(l)}var m=null;if(f.length>0){var n=f[0];var o=$$t.$b3.ac($$t.$dr.$type,$$t.$b3.t($$t.$dr.$type,this.y,function(p){return p.uniqueName()==n.hierarchyUniqueName()}));var p=this.f().e();this.al(f,0,".",null,o,p);if(c!=null&&d==null&&e==null){var q=new $$t.ba($$t.$dz.$type,0);for(var r=0;r<f.length;r++){var s=f[r];var t;if(!function(){var u=$self.n.tryGetValue(s.uniqueName(),t);t=u.p1;return u.ret}()){}var v=t.values().getEnumerator();while(v.moveNext()){var u=v.current();q.add(u)}}m=q}else{n=f[f.length-1];if(e==null){var w;if(!function(){var x=$self.n.tryGetValue(n.uniqueName(),w);w=x.p1;return x.ret}()){}m=w.values()}else{var x;if(!function(){var y=$self.n.tryGetValue(n.uniqueName(),x);x=y.p1;return y.ret}()){}var y=new $$t.ba($$t.$dz.$type,0);var aa=x.values().getEnumerator();while(aa.moveNext()){var z=aa.current();if(z.parentUniqueName()==e.b()){y.add(z)}}m=y}}}else{m=new $$t.ba($$t.$dz.$type,0)}return m},ak:function(a,b,c){var $self=this;var d=new $$t.ba($$t.$cr.$type,0);if(a!=null){d.add(a.generateAxis("Axis0"))}if(b!=null){var e=a==null?"Axis0":"Axis1";d.add(b.generateAxis(e))}if(d.count()>0){var f=new Array(d.count());for(var g=0;g<d.count();g++){f[g]=d.item(g)}var h=new $$t.ej;return h.d($$t.$eh.$type,f,function(i){return $self.d(a,b,c)})}var i=new $$t.cw($$t.$eh.$type,0);var j=this.d(null,null,c);i.e(j);return i.b()},am:function(a){var $self=this;var b=new $$t.by(String,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize(String,$$t.$eg.$type)),0);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();if(c.a().count()>0){for(var e=0;e<c.a().count();e++){var f=c.a().item(e);var g;if(function(){var h=$self.q.tryGetValue(f,g);g=h.p1;return h.ret}()){var h;if(!function(){var i=b.tryGetValue(c.b(),h);h=i.p1;return i.ret}()){h=new $$t.by($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize(String,$$t.$eg.$type),0);b.add(c.b(),h)}var i;if(!function(){var j=h.tryGetValue(g.a().levelDepth(),i);i=j.p1;return j.ret}()){i=new $$t.by(String,$$t.$eg.$type,0);h.add(g.a().levelDepth(),i)}if(!i.containsKey(f)){i.add(f,g)}}}}}var j=new $$t.by(String,$.ig.IDictionary$2.prototype.$type.specialize(String,$$t.$eg.$type),0);var l=b.getEnumerator();while(l.moveNext()){var k=l.current();var m=k.value();var n=$$t.$b3.y($.ig.IDictionary$2.prototype.$type.specialize(String,$$t.$eg.$type),$$t.$b3.n($$t.$b2.$type.specialize($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize(String,$$t.$eg.$type)),$.ig.IDictionary$2.prototype.$type.specialize(String,$$t.$eg.$type),$$t.$b3.w($$t.$b2.$type.specialize($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize(String,$$t.$eg.$type)),$.ig.Number.prototype.$type,m,function(o){return o.key()}),function(o){return o.value()}));for(var o=n.count()-1;o>=0;o--){var p=$$t.$b3.y($$t.$eg.$type,$$t.$b3.n($$t.$b2.$type.specialize(String,$$t.$eg.$type),$$t.$eg.$type,n.item(o),function(q){return q.value()}));for(var q=0;q<p.count();q++){var r=p.item(q);var s=r.a().levelDepth();if(s>0){var t;if(!function(){var u=m.tryGetValue(s-1,t);t=u.p1;return u.ret}()||!t.containsKey(r.a().parentUniqueName())){var u;if(!function(){var v=j.tryGetValue(r.a().parentUniqueName(),u);u=v.p1;return v.ret}()){u=new $$t.by(String,$$t.$eg.$type,0);j.add(r.a().parentUniqueName(),u)}u.add(r.a().uniqueName(),r)}}}}var v=n.item(0);var w=$$t.$b3.ac($$t.$eg.$type,v.values());if(!String.isNullOrEmpty(w.a().parentUniqueName())){w=this.q.item(w.a().parentUniqueName())}var x=new $$t.ba($$t.$dl.$type,0);x.add(function(){var $ret=new $$t.dl;$ret.a("LEVEL_UNIQUE_NAME");$ret.b(w.a().levelUniqueName());return $ret}());var y=$$t.$b3.y($$t.$dz.$type,this.t(null,x));for(var z=0;z<y.count();z++){var aa=y.item(z);if(!v.containsKey(aa.uniqueName())&&!j.containsKey(aa.uniqueName())){j.add(aa.uniqueName(),new $$t.by(String,$$t.$eg.$type,0))}}}var ac=this.k.keys().getEnumerator();while(ac.moveNext()){var ab=ac.current();var ad;if(function(){var ae=$self.q.tryGetValue(ab,ad);ad=ae.p1;return ae.ret}()){for(var ae=0;ae<ad.d().count();ae++){var af=ad.d().item(ae);if(af.a()){af.h()}}}}this.k=j;var ah=this.k.keys().getEnumerator();while(ah.moveNext()){var ag=ah.current();var ai;if(function(){var aj=$self.q.tryGetValue(ag,ai);ai=aj.p1;return aj.ret}()){if(!this.g(ai)){for(var aj=0;aj<ai.d().count();aj++){var ak=ai.d().item(aj);ak.f()}}}}var am=this.k.keys().getEnumerator();while(am.moveNext()){var al=am.current();var an;if(function(){var ao=$self.q.tryGetValue(al,an);an=ao.p1;return ao.ret}()){var ao=$$t.$b3.y($$t.$eg.$type,this.k.item(al).values());for(var ap=0;ap<ao.count();ap++){var aq=ao.item(ap);for(var ar=0;ar<aq.d().count();ar++){var as=aq.d().item(ar);if(as.a()){as.h()}}}}}},g:function(a){var $self=this;var b=a.a().parentUniqueName();while(!String.isNullOrEmpty(b)){if(this.k.containsKey(b)){return true}var c;if(function(){var d=$self.q.tryGetValue(b,c);c=d.p1;return d.ret}()){b=c.a().parentUniqueName()}else{return false}}return false},k:null,u:function(a,b){var $self=this;var c=null;var d=-1;for(var e=0;e<b;e++){var f=a[e];var g=null;var h;if(function(){var i=$self.h(f.uniqueName(),h);h=i.p1;return i.ret}()){g=h.d()}if(g!=null){if(c==null||c.count()>g.count()){d=e;c=g}}}if(c==null){c=$$t.$b3.y($$t.$de.$type,this.f().e())}var i=c;for(var j=0;j<b;j++){if(j!=d){var k=a[j];var l;if(function(){var m=k.properties().tryGetValue("memberId",l);l=m.p1;return m.ret}()){var m=k.levelUniqueName();var n=$.ig.Number.prototype.parseInt(l);i=$$t.$b3.t($$t.$de.$type,i,function(o){return o.d(m)==n})}}}return i},i:function(a,b){var $self=this;return{ret:function(){var c=$self.p.tryGetValue(a,b);b=c.p1;return c.ret}(),p1:b}},h:function(a,b){var $self=this;return{ret:function(){var c=$self.q.tryGetValue(a,b);b=c.p1;return c.ret}(),p1:b}},b:function($t,a){var b=new $$t.d6($t);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b.add(c)}return b},d:function(a,b,c){var d=null;if(a!=null){d=a.axis()}var e=null;if(b!=null){e=b.axis()}var f=this.a(d,e,c);var g=f[0];var h=$g(f[1]);var i=null;var j=-1;var k=null;var l=new $$t.by(String,$.ig.Number.prototype.$type,0);var m=new $.ig.Array;var n=new $.ig.Array;var o=new $.ig.Array;for(var p=0;p<c.count();p++){l.add(c.item(p).uniqueName(),p);m.add(c.item(p))}if(g=="none"&&c.count()>0){i=c.item(0).uniqueName();j=l.item(i);k=this.o.item(i)}if(d==null&&e==null){var q=new $$t.ba($$t.$ei.$type,0);if(k!=null){var r=$$t.$b3.t($$t.$de.$type,this.f().e(),function(s){return!s.a()});var s=new $.ig.Array;var u=$$t.$b3.n($$t.$de.$type,$.ig.$op.$type,r,function(v){return v.e()}).getEnumerator();while(u.moveNext()){var t=u.current();s.add(t)}if(s.length>0){var v=new $$t.ec(0,0,0,j,n,o,m);var w=k(s,v);if(w!=null){var x=new $$t.ei;x.cellOrdinal(0);x.properties().add("Value",w);x.properties().add("FmtValue",w.toString());q.add(x)}}}return this.c(null,null,q)}if(e!=null){var y=e.tuples();for(var z=0;z<y.count();z++){n.add(y.__inner[z])}}if(d!=null){var aa=d.tuples();for(var ab=0;ab<aa.count();ab++){o.add(aa.__inner[ab])}}var ac=1;if(d!=null){ac=d.tuples().count()}var ad=1;if(e!=null){ad=e.tuples().count()}var ae=new $$t.ba($$t.$ei.$type,0);for(var af=0;af<ad;af++){var ag=null;var ah=null;if(e!=null){ah=e.tuples().__inner[af];ag=b.getTupleRowsMetadata(ah);if(g=="rows"){i=ah.members().item(h).uniqueName();j=l.item(i);k=this.o.item(i)}}for(var ai=0;ai<ac;ai++){var aj=ag;var ak=null;var al=null;if(d!=null){al=d.tuples().__inner[ai];ak=a.getTupleRowsMetadata(al);if(g=="columns"){i=al.members().item(h).uniqueName();j=l.item(i);k=this.o.item(i)}}if(aj!=null){if(ak!=null){aj=this.ag(aj,ak,ah,al,h)}}else{aj=ak}if(k!=null){var am=af*ac+ai;var an=new $$t.ec(af,ai,am,j,n,o,m);var ao=new $.ig.Array;var aq=$$t.$b3.n($$t.$de.$type,$.ig.$op.$type,aj,function(ar){return ar.e()}).getEnumerator();while(aq.moveNext()){var ap=aq.current();ao.add(ap)}if(ao.length>0){var ar=k(ao,an);if(ar!=null){var as=new $$t.ei;as.cellOrdinal(am);as.properties().add("Value",ar.toString());as.properties().add("FmtValue",ar.toString());ae.add(as)}}}}}var at=this.c(d,e,ae);return at},c:function(a,b,c){var d=function(){var $ret=new $$t.eh;$ret.axes(new $$t.ba($$t.$b.$type,0));return $ret}();if(a!=null){d.axes().add(a)}if(b!=null){d.axes().add(b)}d.cells(c);d.isEmpty(b==null&&a==null&&c.count()==0);return d},ag:function(a,b,c,d,e){if(b.count()<a.count()){a=b;d=c}for(var f=0;f<d.members().count();f++){if(f!=e){var g=d.members().item(f);var h;if(function(){var i=g.properties().tryGetValue("memberId",h);h=i.p1;return i.ret}()){var i=$.ig.Number.prototype.parseInt(h);a=$$t.$b3.y($$t.$de.$type,$$t.$b3.t($$t.$de.$type,a,function(j){return j.d(g.levelUniqueName())==i}))}}}return a},a:function(a,b,c){var d=this.aj(this.e().a().b().c());var e="none";var f=-1;if(c.count()>0){if(a!=null&&a.tuples().count()>0){var g=a.tuples().__inner[0];for(var h=0;h<g.members().count();h++){var i=g.members().item(h);if(i.hierarchyUniqueName()==d){e="columns";f=h;break}}}if(e=="none"){if(b!=null&&b.tuples().count()>0){var j=b.tuples().__inner[0];for(var k=0;k<j.members().count();k++){var l=j.members().item(k);if(l.hierarchyUniqueName()==d){e="rows";f=k;break}}}}}return[e,f]},al:function(a,b,c,d,e,f){var $self=this;var g=a[b];var h=this.m.item(g.uniqueName());var i=$$t.$b3.ae($$t.$dt.$type,$$t.$b3.t($$t.$dt.$type,this.z,function(j){return j.hierarchyUniqueName()==e.uniqueName()&&j.depth()==g.depth()+1}));var j=null;if(d!=null){j=d.uniqueName()}var k;if(!function(){var l=$self.n.tryGetValue(g.uniqueName(),k);k=l.p1;return l.ret}()){k=new $$t.by(String,$$t.$dz.$type,0);this.n.add(g.uniqueName(),k)}var l=new $$t.ba($$t.$el.$type.specialize($$t.$de.$type),0);var m=new $$t.by(String,$$t.$bb.$type.specialize($$t.$de.$type),0);var o=f.getEnumerator();while(o.moveNext()){var n=o.current();var p=h(n.e());if(p!=null){var q;if(!function(){var r=m.tryGetValue(p,q);q=r.p1;return r.ret}()){q=new $$t.ba($$t.$de.$type,0);m.add(p,q);l.add(new $$t.el($$t.$de.$type,1,p,q))}q.add(n)}}for(var r=0;r<l.count();r++){var s=l.item(r).b();var t=l.item(r).a();var u=c+"&"+this.aj(s);var v=g.uniqueName()+u;var w;var x;var y;if(!function(){var z=k.tryGetValue(v,w);w=z.p1;return z.ret}()){w=new $$t.dz;w.caption(s);w.dimensionUniqueName(g.dimensionUniqueName());w.hierarchyUniqueName(g.hierarchyUniqueName());w.levelDepth(g.depth());w.levelUniqueName(g.uniqueName());w.name(s);w.parentLevel(g.depth()-1);w.parentUniqueName(j);w.uniqueName(v);if(i!=null){w.childrenCardinality(1)}if(d!=null){d.childrenCardinality(d.childrenCardinality()+1)}k.add(v,w);x=this.p.count();this.p.add(w.uniqueName(),x);y=new $$t.eg(w,u,x,k.count());this.q.add(w.uniqueName(),y);this.r.add(w.uniqueName(),y);for(var z=0;z<t.count();z++){var aa=t.item(z);aa.g(g.uniqueName(),x);y.h(aa)}}if(b+1<a.length){this.al(a,b+1,u,w,e,t)}}if(d!=null){d.childrenCardinality(l.count())}},aj:function(a){if(a.substr(0,1)!="["){a="["+a}if(a.substr(a.length-1,1)!="]"){a+="]"}return a},x:null,j:null,ab:function(){var a=new $$t.ba($$t.$dm.$type,0);if(this.e()==null||this.e().a()==null){return a}var b=new $$t.dm;b.caption(this.e().a().c());b.name(this.e().a().e());b.description(this.e().a().d());a.add(b);return a},af:function(a){var b=new $$t.ba($$t.$du.$type,0);if(this.e()==null||this.e().a()==null||this.e().a().b()==null||this.e().a().b().a()==null){return b}var c=this.e().a().b().c();var e=this.e().a().b().a().getEnumerator();while(e.moveNext()){var d=e.current();var f=new $$t.du;f.caption(d.e());f.defaultFormatString(d.d());f.measureDisplayFolder(d.c());f.name(d.f());f.uniqueName(this.aj(c)+"."+this.aj(d.f()));b.add(f);a.item(f.uniqueName(),d.b())}return b},ac:function(){if(this.v==null){this.v=this.ab()}var a=new $$t.ba($$t.$dp.$type,0);if(this.e()==null||this.e().a()==null){return a}var b=new $$t.dp;b.dimensionType(2);b.caption(this.e().a().b().b());b.uniqueName(this.aj(this.e().a().b().c()));a.add(b);if(this.e().a().a()==null){return a}this.x=new $$t.ba($$t.$ed.$type,0);var d=this.e().a().a().getEnumerator();while(d.moveNext()){var c=d.current();this.x.add(c);var e=new $$t.dp;e.caption(c.b());e.defaultHierarchy(c.c());e.uniqueName(this.aj(c.e()));e.name(c.e());e.description(c.d());a.add(e)}return a},ad:function(){var $self=this;if(this.w==null){this.w=this.ac()}var a=new $$t.ba($$t.$dr.$type,0);if(this.e()==null||this.e().a()==null){return a}var b=new $$t.dr;b.uniqueName(this.aj(this.e().a().b().c()));b.dimensionUniqueName(this.aj(this.e().a().b().c()));a.add(b);if(this.e().a().a()==null){return a}this.j=new $$t.by(String,$$t.$bb.$type.specialize($$t.$ee.$type),0);for(var c=0;c<this.x.count();c++){var d=this.x.item(c);if(d.a()!=null){var e;if(!function(){var f=$self.j.tryGetValue(d.e(),e);e=f.p1;return f.ret}()){e=new $$t.ba($$t.$ee.$type,0);this.j.add(d.e(),e)}var g=d.a().getEnumerator();while(g.moveNext()){var f=g.current();e.add(f);var h=new $$t.dr;h.caption(f.b());h.description(f.c());h.dimensionUniqueName(this.aj(d.e()));h.hierarchyDisplayFolder(f.d());h.name(f.e());h.uniqueName(h.dimensionUniqueName()+"."+this.aj(h.name()));a.add(h)}}}return a},ae:function(){var $self=this;if(this.y==null){this.y=this.ad()}this.m=new $$t.by(String,$$t.$b1.$type.specialize($.ig.$op.$type,String),0);var a=new $$t.ba($$t.$dt.$type,0);if(this.e()==null||this.e().a()==null){return a}var b=new $$t.dt;b.hierarchyUniqueName(this.aj(this.e().a().b().c()));b.uniqueName(b.hierarchyUniqueName()+".[MeasuresLevel]");b.depth(-1);a.add(b);if(this.e().a().a()==null){return a}var c=new $$t.ee;c.e(this.e().a().b().c());c.b(this.e().a().b().b());var d=new $$t.ba($$t.$ee.$type,0);d.add(c);for(var e=0;e<this.x.count();e++){var f=this.x.item(e);var g;if(function(){var h=$self.j.tryGetValue(f.e(),g);g=h.p1;return h.ret}()){for(var h=0;h<g.count();h++){d.add(g.item(h))}}}for(var i=0;i<d.count();i++){var j=d.item(i);if(j.a()==null){continue}var k=this.y.item(i);for(var l=0;l<j.a().count();l++){var m=j.a().item(l);var n=new $$t.dt;n.caption(m.b());n.depth(l);n.dimensionUniqueName(k.dimensionUniqueName());n.hierarchyUniqueName(k.uniqueName());n.name(m.c());n.uniqueName(k.uniqueName()+"."+this.aj(n.name()));a.add(n);var o;if(!function(){var p=$self.l.tryGetValue(k.uniqueName(),o);o=p.p1;return p.ret}()){o=new $$t.ba($$t.$dt.$type,0);this.l.add(k.uniqueName(),o)}o.add(n);this.m.item(n.uniqueName(),m.a())}}return a},$type:new $.ig.Type("FlatDataProvider",$.ig.$ot,[$$t.$dh.$type])},true);$c("KeyListPair$1:el","Object",{$t:null,_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},init:function($t,a){this.$t=$t;this.$type=this.$type.specialize(this.$t);if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$.ig.$op.init.call(this);this.b(String.empty());this.a(new $$t.ba(this.$t,0))},init1:function($t,a,b,c){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this);this.b(b);this.a(c)},$type:new $.ig.Type("KeyListPair$1",$.ig.$ot)},true);$c("CellMetadata:ec","Object",{init:function(a,b,c,d,e,f,g){$.ig.$op.init.call(this);this.rowIndex(a);this.columnIndex(b);this.cellOrdinal(c);this.measureIndex(d);this.rowTuples(e);this.columnTuples(f);this.measures(g)},_rowIndex:0,rowIndex:function(a){if(arguments.length===1){this._rowIndex=a;return a}else{return this._rowIndex}},_columnIndex:0,columnIndex:function(a){if(arguments.length===1){this._columnIndex=a;return a}else{return this._columnIndex}},_cellOrdinal:0,cellOrdinal:function(a){if(arguments.length===1){this._cellOrdinal=a;return a}else{return this._cellOrdinal}},_measureIndex:0,measureIndex:function(a){if(arguments.length===1){this._measureIndex=a;return a}else{return this._measureIndex}},_rowTuples:null,rowTuples:function(a){if(arguments.length===1){this._rowTuples=a;return a}else{return this._rowTuples}},_columnTuples:null,columnTuples:function(a){if(arguments.length===1){this._columnTuples=a;return a}else{return this._columnTuples}},_measures:null,measures:function(a){if(arguments.length===1){this._measures=a;return a}else{return this._measures}},$type:new $.ig.Type("CellMetadata",$.ig.$ot)},true);$c("CubeMetadata:d4","Object",{init:function(){$.ig.$op.init.call(this);this.a(new $$t.d6($$t.$ed.$type))},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},$type:new $.ig.Type("CubeMetadata",$.ig.$ot)},true);$c("MeasuresDimensionMetadata:d5","Object",{init:function(){$.ig.$op.init.call(this)},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},$type:new $.ig.Type("MeasuresDimensionMetadata",$.ig.$ot)},true);$c("DataMemberMetadata:eg","Object",{init:function(a,b,c,d){$.ig.$op.init.call(this);this.a(a);this.g(b);this.e(c);this.f(d);this.d(new $$t.ba($$t.$de.$type,0))},_e:0,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},_f:0,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},c:function(){return $$t.$b3.y($$t.$de.$type,$$t.$b3.t($$t.$de.$type,this.d(),function(a){return a.a()==false}))},h:function(a){this.d().add(a)},b:function(a){if(this.d().remove(a)){return true}return false},$type:new $.ig.Type("DataMemberMetadata",$.ig.$ot)},true);$c("DataSourceMetadata:d3","Object",{init:function(){$.ig.$op.init.call(this)},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},$type:new $.ig.Type("DataSourceMetadata",$.ig.$ot)},true);$c("DimensionMetadata:ed","Object",{init:function(){$.ig.$op.init.call(this)},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},$type:new $.ig.Type("DimensionMetadata",$.ig.$ot)},true);$c("HierarchyMetadata:ee","Object",{init:function(){$.ig.$op.init.call(this)},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},$type:new $.ig.Type("HierarchyMetadata",$.ig.$ot)},true);$c("LevelMetadata:ef","Object",{init:function(){$.ig.$op.init.call(this)},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_a:null,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},$type:new $.ig.Type("LevelMetadata",$.ig.$ot)},true);$c("MeasureMetadata:eb","Object",{init:function(){$.ig.$op.init.call(this);this.a(1)},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},_a:0,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},$type:new $.ig.Type("MeasureMetadata",$.ig.$ot)},true);$c("RowMetadata:de","Object",{b:null,c:0,init:function(a){$.ig.$op.init.call(this);this.b=new $$t.by(String,$.ig.Number.prototype.$type,0);this.c=0;this.a(false);this.e(a)},g:function(a,b){if(this.b.containsKey(a)){return}this.b.item(a,b)},d:function(a){var b;var c=this.b.tryGetValue(a,b);b=c.p1;return b},f:function(){this.c++;this.a(true)},h:function(){this.c--;this.a(this.c>0)},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},_a:false,a:function(a){if(arguments.length===1){this._a=a;return a}else{return this._a}},$type:new $.ig.Type("RowMetadata",$.ig.$ot)},true);$c("TableMetadata:d2","Object",{d:null,a:null,c:null,f:0,init:function(a){$.ig.$op.init.call(this);var b=0;var c=$b($.ig.IList.prototype.$type,a);if(c!=null){b=c.count()}else{var e=a.getEnumerator();while(e.moveNext()){var d=e.current();b++}}this.c=new $$t.ba($$t.$de.$type,0);this.a=new Array(b);var g=a.getEnumerator();while(g.moveNext()){var f=g.current();var h=new $$t.de(f);this.h(h);this.c.add(h)}this.d=new $$t.ba(String,0)},e:function(){return this.c},b:function(){return this.a},g:function(){return this.f},h:function(a){if(this.f==this.a.length){this.i()}this.a[this.f++]=a},j:function(a,b){if(this.f==this.a.length){this.i()}$.ig.util.arrayCopy1(this.a,a,this.a,a+1,this.f-a);this.a[a]=b;this.f++},k:function(a){this.f--;$.ig.util.arrayCopy1(this.a,a+1,this.a,a,this.f-a);var b=$.ig.Array.prototype.resize$1($$t.$de.$type,this.a,this.f);this.a=b.p0},i:function(){var a=new Array(this.f+1);$.ig.util.arrayCopy1(this.a,0,a,0,this.f);this.a=a},$type:new $.ig.Type("TableMetadata",$.ig.$ot)},true);$c("FlatDataSourceImpl:et","OlapDataSource",{a4:null,dataProvider:function(){if(this.a4==null){this.a4=this.dataProviderFactory().createDataProvider()}return this.a4},init:function(a){this.a8=new $$t.ba($$t.$df.$type,0);$$t.$eu.init.call(this,a);this.flatDataSourceOptions(a);this.dataProviderFactory(a.dataProviderFactory())},h:function(){return new $$t.fa(this.flatDataSourceOptions().itemsSource(),this.flatDataSourceOptions().dataSourceMetadata())},_flatDataSourceOptions:null,flatDataSourceOptions:function(a){if(arguments.length===1){this._flatDataSourceOptions=a;return a}else{return this._flatDataSourceOptions}},ao:function(){var $self=this;var a=new $$t.cw($$t.$ew.$type,0);if(this.isInitialized()){a.e(this.metadataTree());return a.b()}var b=this.columnAxis();b.collectionChanged=$.ig.Delegate.prototype.combine(b.collectionChanged,this.bc.runOn(this));var c=this.rowAxis();c.collectionChanged=$.ig.Delegate.prototype.combine(c.collectionChanged,this.bg.runOn(this));var d=this.filters();d.collectionChanged=$.ig.Delegate.prototype.combine(d.collectionChanged,this.bd.runOn(this));var e=this.measures();e.collectionChanged=$.ig.Delegate.prototype.combine(e.collectionChanged,this.be.runOn(this));return $$t.$e3.b($$t.$ew.$type,$$t.$ew.$type,$$t.$e3.b($$t.$bb.$type.specialize($$t.$dm.$type),$$t.$ew.$type,this.al(null),function(f){return $self.ap($$t.$b3.ac($$t.$dm.$type,$self.cubes()).name())}),function(f){return $self.aj()})},ai:function(){var a=this.dataProvider();var b=new $$t.ba($$t.$cr.$type,0);b.add(a.discoverDimensionsAsync(null,null));b.add(a.discoverHierarchiesAsync(null,null));b.add(a.discoverLevelsAsync(null,null));b.add(a.discoverMeasuresAsync(null,null));b.add(a.discoverKpisAsync(null,null));var c=new Array(b.count());b.copyTo(c,0);var d=new $$t.en;this.c(d);var e=new $$t.ej;return e.c(c,function(f){var g=f[0];var h=f[1];var i=f[2];var j=f[3];var k=f[4];d.z(j.m());d.t(g.m());d.u(h.m());d.x(i.m());d.w(k.m())})},bi:function(a,b){var c=0;var d=this.measureListIndex();if(a){var e=this.a3(c);if(e!=null&&this.measureListLocation()==1){if(d>-1){var f=e.e().rootPositionInfo();if(f!=null){this.bf(f,d-1)}}}c++}if(b){var g=this.a3(c);if(g!=null&&this.measureListLocation()==0){if(d>-1){var h=g.e().rootPositionInfo();if(h!=null){this.bf(h,d-1)}}}}},bf:function(a,b){if(a.positionItemIndex()==b){a.clear()}else{var d=a.values().getEnumerator();while(d.moveNext()){var c=d.current();this.bf(c,b)}}},ar:function(){var a=this.a9();if(!String.isNullOrEmpty(a)){var b=new $$t.cw($$t.$eh.$type,0);b.d(new $$t.ce(1,a));return b.b()}var c=this.columnAxis().count()>0;var d=this.rowAxis().count()>0;if(!d&&!c&&this.measures().count()==0){var e=function(){var $ret=new $$t.eh;$ret.isEmpty(true);return $ret}();var f=new $$t.cw($$t.$eh.$type,0);f.e(e);this.l(new $$t.e1(e,e,false,false));this.result(e);this.clearPendingChanges();return f.b()}var g=this.m();var h=this.s();var i=this.r()||this.p();var j=this.n();var k=this.aa().count()>0;var l=this.z().count()>0;var m=this.ae.count()>0;if(!g&&!h&&!i&&!j&&!k&&!l&&!m){var n=new $$t.cw($$t.$eh.$type,0);n.e(this.result());return n.b()}if(this.r()){this.bi(c,d)}var o=null;var p=null;var q=0;var r="Axis0";var s=this.m();if(this.r()&&c&&this.measureListIndex()>-1&&this.measureListLocation()==1){s=true}o=this.a2(this.columnAxis(),s,q);this.m(false);if(o!=null){q++;r="Axis1"}var t=this.s();if(this.r()&&d&&this.measureListIndex()>-1&&this.measureListLocation()==0){t=true}p=this.a2(this.rowAxis(),t,q);this.s(false);if(p!=null){if(p.axis()!=null){p.axis().name(r)}q++}this.r(false);this.n(false);var u=new $$t.ba($$t.$ek.$type,0);var w=this.x().getEnumerator();while(w.moveNext()){var v=w.current();u.add(v)}var y=this.af().getEnumerator();while(y.moveNext()){var x=y.current();u.add(x)}var aa=this.y().getEnumerator();while(aa.moveNext()){var z=aa.current();
u.add(z)}var ab=this.ba(u,c,d,k,l,o,p);return ab},ba:function(a,b,c,d,e,f,g){var $self=this;if(this.ae.count()>0){this.dataProvider().am(a);var i=this.a8.getEnumerator();while(i.moveNext()){var h=i.current();h.o()}this.ae.clear()}this.a7(b,c);this.bb(b,c,true);if(d||e){var j=null;if(b){var k=this.aa();var l=$$t.$b3.y($$t.$e2.$type,$$t.$b3.t($$t.$e2.$type,k,function(m){return m.c()=="Axis0"}));if(l.count()>0){var m=l.item(0);k.remove(m);var n=this.result().axes().item(0).tuples().__inner[m.b()];var o=n.members().item(m.a());var p=new $$t.es(this.dataProvider(),this.columnAxis(),o,this.c());var q=p.generateAxis("Axis0");j=$$t.$e3.b($$t.$b.$type,$$t.$eh.$type,q,function(r){var s=$self.dataProvider().ak(p,g,$self.measures());return s});j=$$t.$e3.b($$t.$eh.$type,$$t.$eh.$type,j,function(r){if($self.d("Axis0",r.m()).tuples().count()==0){o.displayInfo($h(0))}var s=$self.l();$self.l($self.l().extend(r.m(),"Axis0"));$self.result($self.l().visibleResult());$$t.$fb.f("Axis0",s,$self.l());{$$t.$fb.e(m.c(),m.b(),m.a(),true,$self.l())}f.m(p);f.axis($self.d("Axis0",$self.result()));var t=new $$t.cw($$t.$eh.$type,0);t.e($self.l().visibleResult());$$t.$fb.c(m.b(),m.a(),true,f.e());return t.b()})}}if(c){var r=b?"Axis1":"Axis0";var s=this.aa();var t=$$t.$b3.y($$t.$e2.$type,$$t.$b3.t($$t.$e2.$type,s,function(u){return u.c()==r}));if(d&&t.count()>0){var u=t.item(0);s.remove(u);var v=$$t.$b3.ac($$t.$b.$type,$$t.$b3.t($$t.$b.$type,this.result().axes(),function(w){return w.name()==r})).tuples().__inner[u.b()];var w=v.members().item(u.a());var x;var y=new $$t.es(this.dataProvider(),this.rowAxis(),w,this.c());if(j!=null){x=$$t.$e3.b($$t.$eh.$type,$$t.$b.$type,j,function(z){return y.generateAxis(r)})}else{x=y.generateAxis(r)}j=$$t.$e3.b($$t.$b.$type,$$t.$eh.$type,x,function(z){var aa=$self.dataProvider().ak(f,y,$self.measures());return aa});j=$$t.$e3.b($$t.$eh.$type,$$t.$eh.$type,j,function(z){if($self.l()==null){$self.l(new $$t.e1($self.result(),$self.result(),b,c))}var aa=$self.l().hasColumns()?"Axis1":"Axis0";if($self.d(aa,z.m()).tuples().count()==0){w.displayInfo($h(0))}var ab=$self.l();$self.l($self.l().extend(z.m(),aa));$self.result($self.l().visibleResult());$$t.$fb.f(aa,ab,$self.l());{$$t.$fb.e(u.c(),u.b(),u.a(),true,$self.l())}var ac=new $$t.cw($$t.$eh.$type,0);ac.e($self.l().visibleResult());g.m(y);g.axis($self.d(aa,$self.result()));$$t.$fb.c(u.b(),u.a(),true,g.e());return ac.b()})}}if(j!=null){return j}var z=new $$t.cw($$t.$eh.$type,0);z.e(this.result());return z.b()}else{var aa=new $$t.cw($$t.$eh.$type,0);if(f==null&&g==null&&this.measures().count()==0){var ab=function(){var $ret=new $$t.eh;$ret.isEmpty(true);return $ret}();this.result(ab);aa.e(this.result());return aa.b()}var ac=this.dataProvider().ak(f,g,this.measures());return $$t.$e3.b($$t.$eh.$type,$$t.$eh.$type,ac,function(ad){$self.l(new $$t.e1(ad.m(),ad.m(),b,c));$self.result($self.l().visibleResult());$self.clearPendingChanges();aa.e($self.result());return aa.b()})}},a9:function(){var a=new $$t.by(String,String,0);for(var b=0;b<this.columnAxis().count();b++){var c=this.columnAxis().item(b);if($b($$t.$er.$type,c)!==null){continue}if(!a.containsKey(c.uniqueName())){a.add(c.uniqueName(),"columns")}else{return"the "+c.uniqueName()+" hierarchy is used twice in columns"}}for(var d=0;d<this.rowAxis().count();d++){var e=this.rowAxis().item(d);if($b($$t.$er.$type,e)!==null){continue}if(!a.containsKey(e.uniqueName())){a.add(e.uniqueName(),"rows")}else{return"the "+e.uniqueName()+" hierarchy is used in rows and in columns"}}for(var f=0;f<this.filters().count();f++){var g=this.filters().item(f);var h;if(!function(){var i=a.tryGetValue(g.uniqueName(),h);h=i.p1;return i.ret}()){a.add(g.uniqueName(),"filters")}else{return"the "+g.uniqueName()+" hierarchy is used in filters and in "+h}}for(var i=0;i<this.measures().count();i++){var j=this.measures().item(i);var k;if(!function(){var l=a.tryGetValue(j.uniqueName(),k);k=l.p1;return l.ret}()){a.add(j.uniqueName(),"measures")}else{if(k=="measures"){return"the "+j.uniqueName()+" measure is used twice in measures"}return"the "+j.uniqueName()+" measure is used in measures and in "+k}}return null},a7:function(a,b){var c=new $$t.by(String,$$t.$bb.$type.specialize($$t.$e2.$type),0);var d=this.l();var e=this.aa();for(var f=0;f<e.count();f++){var g=e.item(f);var h;if(!function(){var i=c.tryGetValue(g.c(),h);h=i.p1;return i.ret}()){h=new $$t.ba($$t.$e2.$type,0);c.add(g.c(),h)}if(this.l()==null){this.l(new $$t.e1(this.result(),this.result(),a,b))}var i=this.l().expandTupleMember(g.c(),g.b(),g.a());if(i!=null){h.add(g);this.l(i);this.result(this.l().visibleResult())}}var k=c.getEnumerator();while(k.moveNext()){var j=k.current();var m=j.value().getEnumerator();while(m.moveNext()){var l=m.current();e.remove(l)}}var n=0;var o="Axis0";if(a){var p=$$t.$b3.ae(String,$$t.$b3.t(String,c.keys(),function(q){return q==o}))!=null;var q=this.a3(n);if(q!=null&&p){var r=c.item(o);if(r.count()>0){$$t.$fb.f(o,d,this.l());var t=r.getEnumerator();while(t.moveNext()){var s=t.current();$$t.$fb.e(o,s.b(),s.a(),true,this.l());$$t.$fb.c(s.b(),s.a(),true,q.e())}var u=this.d(o,this.result());q.axis(u);$$t.$fb.b(u.positionResolver(),q.e())}}n++;o="Axis1"}if(b){var v=$$t.$b3.ae(String,$$t.$b3.t(String,c.keys(),function(w){return w==o}))!=null;var w=this.a3(n);if(w!=null&&v){var x=c.item(o);if(x.count()>0){$$t.$fb.f(o,d,this.l());var z=x.getEnumerator();while(z.moveNext()){var y=z.current();$$t.$fb.e(o,y.b(),y.a(),true,this.l());$$t.$fb.c(y.b(),y.a(),true,w.e())}var aa=this.d(o,this.result());w.axis(aa);$$t.$fb.b(aa.positionResolver(),w.e())}}}return e.count()>0},bb:function(a,b,c){if(this.result()!=null){var d=this.z();var e=new $$t.by(String,$$t.$bb.$type.specialize($$t.$e2.$type),0);var f=this.l();for(var g=0;g<d.count();g++){var h=d.item(g);var i;if(!function(){var j=e.tryGetValue(h.c(),i);i=j.p1;return j.ret}()){i=new $$t.ba($$t.$e2.$type,0);e.add(h.c(),i)}i.add(h);if(c){if(this.l()==null){this.l(new $$t.e1(this.result(),this.result(),a,b))}else{this.l(this.l().collapseTupleMember(h.c(),h.b(),h.a()));this.result(this.l().visibleResult())}}}var j=0;var k="Axis0";if(a){var l=$$t.$b3.ae(String,$$t.$b3.t(String,e.keys(),function(m){return m==k}))!=null;var m=this.a3(j);if(m!=null&&l){var n=e.item(k);if(n.count()>0){$$t.$fb.f(k,f,this.l());var p=n.getEnumerator();while(p.moveNext()){var o=p.current();$$t.$fb.c(o.b(),o.a(),false,m.e())}var q=this.d(k,this.result());m.axis(q)}}j++;k="Axis1"}if(b){var r=$$t.$b3.ae(String,$$t.$b3.t(String,e.keys(),function(s){return s==k}))!=null;var s=this.a3(j);if(s!=null&&r){var t=e.item(k);if(t.count()>0){$$t.$fb.f(k,f,this.l());var v=t.getEnumerator();while(v.moveNext()){var u=v.current();$$t.$fb.c(u.b(),u.a(),false,s.e())}var w=this.d(k,this.result());s.axis(w)}}}d.clear()}},a2:function(a,b,c){var d=null;if(a.count()>0){d=this.a3(c);if(b){if(d!=null){d.n(a)}else{d=new $$t.df(this.dataProvider(),a,this.c());this.bh(c,d)}}}return d},bh:function(a,b){this.a8.item(a,b)},a3:function(a){if(a<this.a8.count()){return this.a8.item(a)}return null},getMembersOfLevel:function(a){var $self=this;var b=new $$t.ba($$t.$dl.$type,0);var c=a;b.add(function(){var $ret=new $$t.dl;$ret.a("LEVEL_UNIQUE_NAME");$ret.b(a);return $ret}());var d=this.dataProvider().discoverMembersAsync(null,b);d.i(function(e){var g=e.m().getEnumerator();while(g.moveNext()){var f=g.current();$self.c().aa(f)}$self.c().ac(c)});return d},getMembersOfHierarchy:function(a){var $self=this;var b=a;var c=new $$t.fc(a);var d=c.b();if(d.count()<2){throw new $$t.cf(2,"Specified value: "+a+" is not valid.",a)}var e=new $$t.dl;e.a("HIERARCHY_UNIQUE_NAME");e.b(d.item(0)+"."+d.item(1));var f=new $$t.ba($$t.$dl.$type,0);f.add(e);var g=this.dataProvider().discoverMembersAsync(null,f);g.i(function(h){var j=h.m().getEnumerator();while(j.moveNext()){var i=j.current();$self.c().aa(i)}$self.c().ab(b)});return g},getMembersOfMember:function(a){var $self=this;var b=new $$t.fc(a);var c=b.b();var d=new $$t.dl;if(c.count()<3){throw new $$t.cf(2,"Specified value: "+a+" is not valid.",a)}switch(c.count()){case 1:d.a("DIMENSION_UNIQUE_NAME");d.b(c.item(0));break;case 2:d.a("HIERARCHY_UNIQUE_NAME");d.b(c.item(0)+"."+c.item(1));break;default:d.a("LEVEL_UNIQUE_NAME");d.b(c.item(0)+"."+c.item(1)+"."+c.item(2));break}var e=new $$t.ba($$t.$dl.$type,0);e.add(d);e.add(function(){var $ret=new $$t.dl;$ret.a("MEMBER_UNIQUE_NAME");$ret.b(a);return $ret}());var f=this.dataProvider().discoverMembersAsync(null,e);f.i(function(g){var i=g.m().getEnumerator();while(i.moveNext()){var h=i.current();$self.c().aa(h)}});return f},bc:function(a,b){this.m(true);this.bj(0,this.columnAxis(),this.rowAxis());this.az(b,this.x());this.a1(b,this.columnAxis());if(b.action()!=4&&this.columnAxis()!=null){var c=Math.max(b.newStartingIndex(),b.oldStartingIndex());this.bk("Axis0",c)}},bg:function(a,b){this.s(true);this.bj(1,this.rowAxis(),this.columnAxis());this.az(b,this.af());this.a1(b,this.rowAxis());if(b.action()!=4&&this.rowAxis()!=null){var c=this.columnAxis()==null?"Axis0":"Axis1";var d=Math.max(b.newStartingIndex(),b.oldStartingIndex());this.bk(c,d)}},a8:null,bj:function(a,b,c){if(b.count()>0){if(c.count()>0){if(this.a8.count()<2){this.a8.insert(a,null)}}else{if(this.a8.count()==0){this.a8.insert(0,null)}}}else{if(this.a8.count()>0){if(this.a8.count()>1){this.a8.removeAt(a)}else{this.a8.removeAt(0)}}}},bk:function(a,b){var c=this.aa();var d=this.z();for(var e=d.count()-1;e>=0;e--){var f=d.item(e);if(f.c()==a&&f.a()>=b){d.removeAt(e)}}for(var g=c.count()-1;g>=0;g--){var h=c.item(g);if(h.c()==a&&h.a()>=b){c.removeAt(g)}}},bd:function(a,b){this.n(true);this.az(b,this.y())},be:function(a,b){this.r(true);this.a0()},$type:new $.ig.Type("FlatDataSourceImpl",$$t.$eu.$type)},true);$c("IFlatDataProviderFactory:e9","Object",{$type:new $.ig.Type("IFlatDataProviderFactory",null,[$$t.$e0.$type])},true);$c("DefaultFlatDataProviderFactory:fa","Object",{b:null,a:null,init:function(a,b){$.ig.$op.init.call(this);this.b=a;this.a=b},createDataProvider:function(){return new $$t.dg(this.b,this.a)},$type:new $.ig.Type("DefaultFlatDataProviderFactory",$.ig.$ot,[$$t.$e9.$type])},true);$c("FlatDataSourceOptions:e8","DataSourceBaseOptions",{init:function(){$$t.$ez.init.call(this)},_itemsSource:null,itemsSource:function(a){if(arguments.length===1){this._itemsSource=a;return a}else{return this._itemsSource}},_dataSourceMetadata:null,dataSourceMetadata:function(a){if(arguments.length===1){this._dataSourceMetadata=a;return a}else{return this._dataSourceMetadata}},_dataProviderFactory:null,dataProviderFactory:function(a){if(arguments.length===1){this._dataProviderFactory=a;return a}else{return this._dataProviderFactory}},$type:new $.ig.Type("FlatDataSourceOptions",$$t.$ez.$type)},true);$c("OlapFlatDataSource:fd","DataSourceBase",{a6:null,init:function(a){this.a6=null;this.a5=false;$$t.$fe.init.call(this);if(a==null){throw new $$t.b9(0,"options")}this.a6=a;this.a9(this.a6)},a3:function(a){var b=$$t.$ff.getJavascriptObjectProperty(a,"metadata");if(b==null){throw new $$t.ce(1,"metadata is null or undefined.")}var c=new $$t.d3;var d=this.a2(b);c.a(d);return c},a2:function(a){var b=$$t.$ff.getJavascriptObjectProperty(a,"cube");if(b==null){throw new $$t.ce(1,"metadata.cube is null or undefined.")}var c=new $$t.d4;c.e($$t.$ff.getJavascriptObjectProperty(b,"name"));if(String.isNullOrEmpty(c.e())){throw new $$t.ce(1,"cube.name is null, empty or undefined")}c.c($$t.$ff.getJavascriptObjectProperty(b,"caption"));if(String.isNullOrEmpty(c.c())){c.c(c.e())}c.b(this.a4(b));c.d($$t.$ff.getJavascriptObjectProperty(b,"description"));c.a(this.ay(b));return c},a4:function(a){var b=$$t.$ff.getJavascriptObjectProperty(a,"measuresDimension");if(b==null){return null}var c=$$t.$ff.getJavascriptObjectProperty(b,"caption");var d=$$t.$ff.getJavascriptObjectProperty(b,"name");var e=function(){var $ret=new $$t.d5;$ret.b(c);$ret.c(d);return $ret}();e.a(this.a1(b));return e},ay:function(a){var b=$$t.$ff.getJavascriptObjectProperty(a,"dimensions");if(b==null){return null}var c=new $$t.d6($$t.$ed.$type);for(var d=0;d<b.length;d++){var e=new $$t.ed;c.add(e);var f=b[d];e.e($$t.$ff.getJavascriptObjectProperty(f,"name"));if(String.isNullOrEmpty(e.e())){throw new $$t.ce(1,"dimension.name is null, empty or undefined")}e.b($$t.$ff.getJavascriptObjectProperty(f,"caption"));if(String.isNullOrEmpty(e.b())){e.b(e.e())}e.c($$t.$ff.getJavascriptObjectProperty(f,"defaultHierarchy"));e.a(this.az(f));e.d($$t.$ff.getJavascriptObjectProperty(f,"description"))}return c},a1:function(a){var b=$$t.$ff.getJavascriptObjectProperty(a,"measures");if(b==null){return null}var c=new $$t.d6($$t.$eb.$type);for(var d=0;d<b.length;d++){var e=new $$t.eb;c.add(e);var f=b[d];e.f($$t.$ff.getJavascriptObjectProperty(f,"name"));if(String.isNullOrEmpty(e.f())){throw new $$t.ce(1,"measure.name is null, empty or undefined")}e.e($$t.$ff.getJavascriptObjectProperty(f,"caption"));if(String.isNullOrEmpty(e.e())){e.e(e.f())}e.d($$t.$ff.getJavascriptObjectProperty(f,"displayFormat"));e.c($$t.$ff.getJavascriptObjectProperty(f,"displayFolder"));e.b($$t.$ff.getJavascriptObjectProperty(f,"aggregator"));if(e.b()==null){throw new $$t.ce(1,"aggregator is null or undefined for measureMetadata: "+e.f())}}return c},az:function(a){var b=$$t.$ff.getJavascriptObjectProperty(a,"hierarchies");if(b==null){return null}var c=new $$t.d6($$t.$ee.$type);for(var d=0;d<b.length;d++){var e=new $$t.ee;c.add(e);var f=b[d];e.e($$t.$ff.getJavascriptObjectProperty(f,"name"));if(String.isNullOrEmpty(e.e())){throw new $$t.ce(1,"hierarchy.hierarchyName is null, empty or undefined")}e.b($$t.$ff.getJavascriptObjectProperty(f,"caption"));if(String.isNullOrEmpty(e.b())){e.b(e.e())}e.d($$t.$ff.getJavascriptObjectProperty(f,"displayFolder"));e.a(this.a0(f));if(e.a()==null||e.a().count()==0){throw new $$t.ce(1,"levelKeys is null, empty or undefined for hierarchyMetadata: "+e.e())}}return c},a0:function(a){var b=$$t.$ff.getJavascriptObjectProperty(a,"levels");if(b==null){return null}var c=new $$t.d6($$t.$ef.$type);for(var d=0;d<b.length;d++){var e=new $$t.ef;c.add(e);var f=b[d];e.c($$t.$ff.getJavascriptObjectProperty(f,"name"));if(String.isNullOrEmpty(e.c())){throw new $$t.ce(1,"level.name is null, empty or undefined")}e.b($$t.$ff.getJavascriptObjectProperty(f,"caption"));if(String.isNullOrEmpty(e.b())){e.b(e.c())}e.a($$t.$ff.getJavascriptObjectProperty(f,"memberProvider"));if(e.a()==null){throw new $$t.ce(1,"levelMetadata.memberProvider is null or undefined")}}return c},a9:function(a){var options_=a;var schema_=this.a7(a);var dataSource=options_.dataSource;if(!options_.dataSource&&options_.dataSourceUrl){options_.dataSource=options_.dataSourceUrl}var dataOptions={callback:this.dataSourceDataResolved,callee:this,dataSource:options_.dataSource,defaultChildrenDataProperty:options_.bindings.childDataProperty,responseDataType:options_.responseDataType,localSchemaTransform:options_.dataSourceType&&options_.dataSourceType==="xml"?true:false,schema:schema_};if(options_.dataSourceType){dataOptions.type=options_.dataSourceType}if(options_.responseDataKey){dataOptions.responseDataKey=options_.responseDataKey}if(!(options_.dataSource instanceof $.ig.DataSource)){options_.dataSource=new $.ig.DataSource(dataOptions)}options_.dataSource.dataBind(this.dataSourceDataResolved,this)},dataSourceDataResolved:function(){var a=$$t.$ff.getJavascriptObjectProperty(this.a6,"dataSource");if(a==null){throw new $$t.ce(1,"dataSource is null or undefined")}var b=this.a3(this.a6);var c=$$t.$ff.getJavascriptObjectProperty(this.a6,"measures");var d=$$t.$ff.getJavascriptObjectProperty(this.a6,"filters");var e=$$t.$ff.getJavascriptObjectProperty(this.a6,"columns");var f=$$t.$ff.getJavascriptObjectProperty(this.a6,"rows");var g=$$t.$ff.getJavascriptObjectMethodResult(a,"data",[]);var h=function(){var $ret=new $$t.e8;$ret.measures(c);$ret.filters(d);$ret.columns(e);$ret.rows(f);$ret.itemsSource(g);$ret.dataSourceMetadata(b);return $ret}();this.dataSource(new $$t.et(h));this.initDataSource()},initDataSource:function(){var $self=this;if(this.a5){this.a5=false;var a=this.dataSource().initialize();var promise_=a.c();a.i(function(b){$self.a8.e(b.m())});var $this=this;if(!this._isInitializedAttached){this._isInitializedAttached=true;promise_.always(function(result){var args={error:null,metadataTreeRoot:null};if(this.state()==="rejected"){args.error=result}else{args.metadataTreeRoot=result}$($this).trigger("initialized",args);$this._isInitializedAttached=false})}}},a5:false,a8:null,initialize:function(){if(this.dataSource()!=null){return $$t.$fe.initialize.call(this)}this.a5=true;this.a8=new $$t.cw($$t.$ew.$type,0);return this.a8.a().promise()},a7:function(a){var options_=a;var schema_=null;var schema={},opt=options_,bindings=options_.bindings;if(bindings==null){opt.bindings={};schema.text={name:"Text",type:"string"};opt.bindings.textKey="Text";schema.value={name:"Value",type:"string"};opt.bindings.valueKey="Value";schema.imageUrl={name:"ImageUrl",type:"string"};opt.bindings.imageUrlKey="ImageUrl";schema.navigateUrl={name:"NavigateUrl",type:"string"};opt.bindings.navigateUrlKey="NavigateUrl";schema.childData={name:"Nodes",type:"object"};opt.bindings.childDataProperty="Nodes";schema.target={name:"Target",type:"string"};opt.bindings.targetKey="Target";bindings=opt.bindings}else if(opt.dataSourceType==="xml"){if(bindings.searchFieldXPath){schema.searchField=bindings.searchFieldXPath}}schema.fields=[];if(bindings.textKey){schema.fields.push({name:bindings.textKey,type:"string",xpath:bindings.textXPath});schema.textKey=bindings.textKey}if(bindings.valueKey){schema.fields.push({name:bindings.valueKey,type:"string",xpath:bindings.valueXPath});schema.valueKey=bindings.valueKey}if(bindings.navigateUrlKey){schema.fields.push({name:bindings.navigateUrlKey,type:"string",xpath:bindings.navigateUrlXPath});schema.navigateUrlKey=bindings.navigateUrlKey}if(bindings.imageUrlKey){schema.fields.push({name:bindings.imageUrlKey,type:"string",xpath:bindings.imageUrlXPath});schema.imageUrlKey=bindings.imageUrlKey}if(bindings.targetKey){schema.fields.push({name:bindings.targetKey,type:"string"});schema.targetKey=bindings.targetKey}if(bindings.expandedKey){schema.fields.push({name:"Expanded",type:"boolean"});schema.expandedKey=bindings.expandedKey}if(bindings.primaryKey){schema.fields.push({name:bindings.primaryKey,type:"string"});schema.primaryKey=bindings.primaryKey}if(bindings.childDataProperty){schema.fields.push({name:bindings.childDataProperty,type:"object",xpath:bindings.childDataXPath});schema.childDataProperty=bindings.childDataProperty}if(!schema.searchField&&opt.responseDataKey){schema.searchField=opt.responseDataKey}schema_=schema;return schema_},$type:new $.ig.Type("OlapFlatDataSource",$$t.$fe.$type)},true);$$t.$dg.ai="(All)"})(jQuery);/*!@license
* Infragistics.Web.ClientUI Pivot Shared 15.2.20152.1027
*
* Copyright (c) 2011-2012 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on: 
*   jquery-1.4.4.js
*   jquery.ui.core.js
*   jquery.ui.widget.js
*   jquery.ui.mouse.js
*   jquery.ui.draggable.js
*   jquery.ui.droppable.js
*   modernizr.js (Optional)
*   infragistics.util.js
*   infragistics.datasource.js
*   infragistics.olapxmladatasource.js
*   infragistics.olapflatdatasource.js
*   infragistics.templating.js
*   infragistics.ui.shared.js
*   infragistics.ui.scroll.js
*   infragistics.ui.tree.js
*/
(function($){var _aNull=function(val){return val===null||val===undefined},_draggable=$.ui.draggable.prototype.widgetFullName||$.ui.draggable.prototype.widgetName,_tree=$.ui.igTree.prototype.widgetFullName||$.ui.igTree.prototype.widgetName;$.ig=$.ig||{};$.ig.Pivot=$.ig.Pivot||{};$.ig.Pivot._pivotShared=$.ig.Pivot._pivotShared||{_isInstance:function(object,typeName){return typeName!==undefined&&!_aNull(object)&&object.$type&&object.$type.name===typeName},_const:{index:0,dragCursorAt:{top:-10,left:10},dragHelperMarkup:"<div class='ui-widget ui-corner-all ui-igpivot-draghelper'><p><span></span><strong>{0}</strong></p></div>",touchEvents:{mousedown:"touchstart",mouseover:"mouseover",mouseout:"mouseover"},ie:!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase())},_insertIndex:0,_showLastLevelExpanders:true,_createDataSource:function(dataSource,dataSourceOptions){var ds=null,dsOptions;if(!_aNull(dataSource)&&(this._isInstance(dataSource,"OlapXmlaDataSource")||this._isInstance(dataSource,"OlapFlatDataSource"))){ds=dataSource}else if(!_aNull(dataSourceOptions)){dsOptions=$.extend({},dataSourceOptions);delete dsOptions.xmlaOptions;delete dsOptions.flatDataOptions;if(!_aNull(dataSourceOptions.xmlaOptions)&&!_aNull(dataSourceOptions.xmlaOptions.serverUrl)){dsOptions=$.extend(dsOptions,dataSourceOptions.xmlaOptions);ds=new $.ig.OlapXmlaDataSource(dsOptions)}else if(!_aNull(dataSourceOptions.flatDataOptions)&&(!_aNull(dataSourceOptions.flatDataOptions.dataSource)||!_aNull(dataSourceOptions.flatDataOptions.dataSourceUrl))){dsOptions=$.extend(dsOptions,dataSourceOptions.flatDataOptions);ds=new $.ig.OlapFlatDataSource(dsOptions)}}return ds},_addingKpiMetadataItems:function(dataSource,name){var kpi,kpiMeasure,kpiValue,kpiGoal,kpiStatus,kpiTrend,kpiWeight,item;kpi=dataSource.getCoreElement(function(el){return el.uniqueName()===name},$.ig.Kpi.prototype.getType());item=[];kpiValue=kpi.kpiValue();kpiGoal=kpi.kpiGoal();kpiStatus=kpi.kpiStatus();kpiTrend=kpi.kpiTrend();kpiWeight=kpi.kpiWeight();if(null!==kpiValue&&""!==kpiValue){kpiMeasure=dataSource.getCoreElement(function(el){return el.uniqueName()===kpiValue},$.ig.Measure.prototype.getType());if(null===kpiMeasure){kpiMeasure=dataSource.getCoreElement(function(el){return el.uniqueName()===kpiValue},$.ig.KpiMeasure.prototype.getType())}item.push(kpiMeasure)}if(null!==kpiGoal&&""!==kpiGoal){kpiMeasure=dataSource.getCoreElement(function(el){return el.uniqueName()===kpiGoal},$.ig.Measure.prototype.getType());if(null===kpiMeasure){kpiMeasure=dataSource.getCoreElement(function(el){return el.uniqueName()===kpiGoal},$.ig.KpiMeasure.prototype.getType())}item.push(kpiMeasure)}if(null!==kpiStatus&&""!==kpiStatus){kpiMeasure=dataSource.getCoreElement(function(el){return el.uniqueName()===kpiStatus},$.ig.KpiMeasure.prototype.getType());item.push(kpiMeasure)}if(null!==kpiTrend&&""!==kpiTrend){kpiMeasure=dataSource.getCoreElement(function(el){return el.uniqueName()===kpiTrend},$.ig.KpiMeasure.prototype.getType());item.push(kpiMeasure)}if(null!==kpiWeight&&""!==kpiWeight){kpiMeasure=dataSource.getCoreElement(function(el){return el.uniqueName()===kpiWeight},$.ig.KpiMeasure.prototype.getType());item.push(kpiMeasure)}return item},_getEvent:function(event){if($.ig.util.isTouchDevice()){return this._const.touchEvents[event]}return event},_makeDroppable:function(droppable){var $this=this;if(!$.ig.util.isTouchDevice()){droppable.droppable({tolerance:"pointer",accept:function(draggable){return draggable.hasClass("ui-igpivot-dragover")===false&&draggable.closest("li.ui-igtree-node").length===0&&(draggable.hasClass("ui-igpivot-metadataitem")||draggable.find(".ui-igpivot-metadataitem:first").length>0)},over:function(event,ui){var isValid=true,markup=$(ui.helper.html()),element=ui.draggable,typeName,name;if(!element.hasClass("ui-igpivot-metadataitem")){element=element.find(".ui-igpivot-metadataitem:first")}if(element.length>0){typeName=element.attr("data-type");name=element.attr("data-name")}else{return false}if($.isFunction($this.options.customMoveValidation)){isValid=$this.options.customMoveValidation.call($this.element,$this.widgetName,typeName,name)}if(ui.helper.hasClass("ui-igpivot-draghelper")){if(isValid){markup.find("span").removeClass("ui-icon-plus ui-icon-cancel").addClass("ui-icon-close").siblings("strong");ui.helper.removeClass($this.css.dropIndicator).addClass($this.css.invalidDropIndicator).html(markup)}else{markup.find("span").removeClass("ui-icon-plus ui-icon-close").addClass("ui-icon-cancel").siblings("strong");ui.helper.removeClass($this.css.dropIndicator).addClass($this.css.invalidDropIndicator).html(markup)}}},out:function(event,ui){var markup=$(ui.helper.html());if(ui.helper.hasClass("ui-igpivot-draghelper")){markup.find("span").removeClass("ui-icon-close ui-icon-plus").addClass("ui-icon-cancel").siblings("strong");ui.helper.removeClass($this.css.dropIndicator).addClass($this.css.invalidDropIndicator).html(markup)}},drop:function(event,ui){var element=ui.draggable,isValid=true,typeName,type,name,item,noCancel,location,dataRole;ui.draggable.unbind("."+$this.widgetName);if(!element.hasClass("ui-igpivot-metadataitem")){element=element.find(".ui-igpivot-metadataitem:first")}if(element.length>0){typeName=element.attr("data-type");name=element.attr("data-name")}else{return false}if($.isFunction($this.options.customMoveValidation)){dataRole=$(this).attr("data-role");location=dataRole===undefined?$this.widgetName:dataRole;isValid=$this.options.customMoveValidation.call($this.element,location,typeName,name)}if(!isValid){return false}switch(typeName){case $.ig.Dimension.prototype.getType().typeName():type=$.ig.Dimension.prototype.getType();break;case $.ig.Hierarchy.prototype.getType().typeName():type=$.ig.Hierarchy.prototype.getType();break;case $.ig.Measure.prototype.getType().typeName():type=$.ig.Measure.prototype.getType();break;case $.ig.MeasureList.prototype.getType().typeName():type=$.ig.MeasureList.prototype.getType();break;case $.ig.Kpi.prototype.getType().typeName():type=$.ig.Kpi.prototype.getType();break;case $.ig.KpiMeasure.prototype.getType().typeName():type=$.ig.KpiMeasure.prototype.getType();break;default:return false}item=$this._ds.getCoreElement(function(el){return el.uniqueName()===name},type);if(item){noCancel=$this._triggerMetadataRemoving(event,element,item);if(noCancel){$this._ds.removeFilterItem(item);$this._ds.removeRowItem(item);$this._ds.removeColumnItem(item);$this._ds.removeMeasureItem(item);$this._triggerMetadataRemoved(event,item);$this._updateDataSource();return true}}return false}})}},_createDropAreaOptions:function(){var $this=this,dropAreaOptions={greedy:true,tolerance:"pointer",activeClass:this.css.activeDropArea,accept:function(draggable){return $this._accept($(this),draggable)},over:function(event,ui){$this._onDraggableOver(event,ui)},out:function(event,ui){$this._onDraggableOut(event,ui)},drop:function(event,ui){var element=ui.draggable,type,name;if(!element.hasClass("ui-igpivot-metadataitem")){element=element.find(".ui-igpivot-metadataitem:first")}if(element.length>0){type=element.attr("data-type");name=element.attr("data-name");if(!name){name="null"}return $this._onDrop(event,ui,$(this),element,type,name)}return false}};return dropAreaOptions},_onDataSourceCollectionChanged:function(collection,collectionChangedArgs,dropArea,isDisabled){var action,items,i,length,name,filter,startingIndex,previousItem,destroyDraggable;action=collectionChangedArgs.action();switch(action){case $.ig.NotifyCollectionChangedAction.prototype.add:items=collectionChangedArgs.newItems().__inner;startingIndex=collectionChangedArgs.newStartingIndex();if(startingIndex===0){this._createMetadataElement(items[0],isDisabled,"prependTo",dropArea)}else{previousItem=dropArea.find(".ui-igpivot-metadataitem")[startingIndex-1];this._createMetadataElement(items[0],isDisabled,"insertAfter",previousItem)}break;case $.ig.NotifyCollectionChangedAction.prototype.remove:items=collectionChangedArgs.oldItems().__inner;filter=function(ind,itemElement){return $(itemElement).attr("data-name")===name};destroyDraggable=function(ind,el){var draggable=$(el).data(_draggable);if(draggable){draggable.destroy()}};for(i=0,length=items.length;i<length;i++){if(this._isInstance(items[i],"MeasureList")){dropArea.find(".ui-igpivot-metadataitem[data-type="+$.ig.MeasureList.prototype.getType().typeName()+"]").each(destroyDraggable).remove()}else{name=items[i].uniqueName();dropArea.find(".ui-igpivot-metadataitem").filter(filter).each(destroyDraggable).remove()}}break;case $.ig.NotifyCollectionChangedAction.prototype.reset:destroyDraggable=function(ind,el){var draggable=$(el).data(_draggable);if(draggable){draggable.destroy()}};dropArea.find(".ui-igpivot-metadataitem").each(destroyDraggable).remove();break}},_createMetadataElement:function(item,isDisabled,appendFunc,target){var $this=this,dragAndDropSettings=this.options.dragAndDropSettings,metadataElement,metadataElementMarkup;metadataElementMarkup="<li ";if(this._isInstance(item,"MeasureList")&&item.caption()===null){item.caption($.ig.PivotShared.locale.measureList)}else{metadataElementMarkup+="data-name='"+item.uniqueName()+"' "}metadataElementMarkup+="title='"+item.caption()+"' data-type='"+item.getType().typeName()+"'>";if(this._isInstance(item,"Hierarchy")&&!isDisabled){metadataElementMarkup+="<span style='display:block; float:left;' class='ui-icon "+this.css.filterIcon+"'></span>"}if(this.widget()[0].className.indexOf("ui-igpivotdataselector ui-droppable")!==-1&&target!==undefined){metadataElementMarkup+="<div style='float:left; display:block; width: calc(100%";if("Hierarchy"===item.getType().typeName()){metadataElementMarkup+=" - 28px"}else{metadataElementMarkup+=" - 16px"}metadataElementMarkup+=");overflow-x:hidden !important; text-overflow:ellipsis !important;'>";metadataElementMarkup+="<span data-role='caption'>";metadataElementMarkup+=item.caption();metadataElementMarkup+="</span>";metadataElementMarkup+="</div>"}else{metadataElementMarkup+="<span data-role='caption'>"+item.caption()+"</span>"}if(!isDisabled){metadataElementMarkup+="<span class='ui-icon ui-icon-close'></span>"}metadataElementMarkup+="</li>";metadataElement=$(metadataElementMarkup).addClass(this.css.metadataItem);metadataElement[appendFunc](target);if(!isDisabled){metadataElement.find("span.ui-icon-pivot-smallfilter").click(function(event){$this._createFilterDropDown(event,this,item);return false});metadataElement.find("span.ui-icon-close").click(function(event){var noCancel=$this._triggerMetadataRemoving(event,metadataElement,item);if(noCancel){$this._ds.removeFilterItem(item);$this._ds.removeRowItem(item);$this._ds.removeColumnItem(item);$this._ds.removeMeasureItem(item);$this._triggerMetadataRemoved(event,item);$this._updateDataSource();return false}return false});if(!$.ig.util.isTouchDevice()){metadataElement.draggable({appendTo:dragAndDropSettings.appendTo,containment:dragAndDropSettings.containment,opacity:dragAndDropSettings.dragOpacity,zIndex:dragAndDropSettings.zIndex,cursorAt:this._const.dragCursorAt,revert:false,cancel:".ui-icon",helper:function(event){var target=$(event.target).closest(".ui-igpivot-metadataitem").find("span[data-role='caption']"),markup=$($this._const.dragHelperMarkup.replace("{0}",target.text()));markup.addClass($this.css.invalidDropIndicator).find("span").addClass("ui-icon");return markup},start:function(event,ui){return $this._triggerDragStart(event,ui,item)},drag:function(event,ui){return $this._triggerDrag(event,ui,item)},over:function(event,ui){$this._onDraggableOver(event,ui)},out:function(event,ui){$this._onDraggableOut(event,ui)},stop:function(event,ui){$this._triggerDragStop(event,ui)}})}metadataElement.click(function(event){$this._createMetadataItemDropDown(event,this,item)})}return metadataElement},_accept:function(targetElement,draggable){var target,typeName,isValid=false,isMeasureDimension,dimension,dataSource=this._ds;if(!draggable.hasClass("ui-igpivot-metadataitem")){draggable=draggable.find(".ui-igpivot-metadataitem:first")}typeName=draggable.attr("data-type");target=targetElement.attr("data-role");$(".ui-igpivot-overlaydroparea").css("display","block");dimension=dataSource.getCoreElement(function(el){return el.dimensionType()===$.ig.DimensionType.prototype.measure},$.ig.Dimension.prototype.getType());isMeasureDimension=draggable.text()===dimension.name()||draggable.text()===dimension.caption();if(typeName){switch(target){case"rows":case"columns":isValid=typeName===$.ig.Hierarchy.prototype.getType().typeName()||typeName===$.ig.Dimension.prototype.getType().typeName()&&!isMeasureDimension||typeName===$.ig.MeasureList.prototype.getType().typeName();break;case"filters":isValid=typeName===$.ig.Hierarchy.prototype.getType().typeName()||typeName===$.ig.Dimension.prototype.getType().typeName()&&!isMeasureDimension;break;case"measures":isValid=(typeName===$.ig.Measure.prototype.getType().typeName()||typeName===$.ig.Kpi.prototype.getType().typeName()||typeName===$.ig.KpiMeasure.prototype.getType().typeName()||isMeasureDimension)&&"MeasureList"!==draggable.attr("data-type");break}}return isValid},_onDraggableOver:function(event,ui){var $this=this,isValid=true,markup=$(ui.helper.html()),element=ui.draggable,typeName,name;ui.draggable.addClass("ui-igpivot-dragover");$(".ui-igpivot-overlaydroparea").css("display","none");if(!element.hasClass("ui-igpivot-metadataitem")){element=element.find(".ui-igpivot-metadataitem:first")}if(element.length>0){typeName=element.attr("data-type");name=element.attr("data-name")}else{return false}if($.isFunction(this.options.customMoveValidation)){isValid=this.options.customMoveValidation.call(this.element,$(event.target).attr("data-role"),typeName,name)}if(ui.helper.hasClass("ui-igpivot-draghelper")){if(isValid){markup.find("span").removeClass("ui-icon-cancel ui-icon-close").addClass("ui-icon-plus").siblings("strong");ui.helper.removeClass(this.css.invalidDropIndicator).addClass(this.css.dropIndicator).html(markup)}else{markup.find("span").removeClass("ui-icon-plus ui-icon-close").addClass("ui-icon-cancel").siblings("strong");ui.helper.removeClass(this.css.dropIndicator).addClass(this.css.invalidDropIndicator).html(markup)}}if(!isValid){return false}ui.draggable.bind("drag."+this.widgetName,function(event1,ui1){$this._onDraggableDrag(event1,ui1)})},_onDraggableDrag:function(event,ui){var target=$(event.originalEvent.target),insertItem="<li class='"+this.css.insertItem+"'></li>";if(target.hasClass("ui-igpivot-insertitem")){if(!this._const.ie||this._const.ie&&document.documentMode!==8){return}}$(document).find(".ui-igpivot-insertitem").remove();if(target.is("span")){target=target.closest(".ui-igpivot-metadataitem")}if(!(target.parent().hasClass("ui-igpivot-droparea")||target.hasClass("ui-igpivot-droparea"))){return}if(target.is(".ui-igpivot-metadataitem")){if(this._shouldAppendToTarget(target,ui)){this._insertIndex=target.index()+1;$(insertItem).insertAfter(target)}else{if(target.index()===0){this._insertIndex=0;$(insertItem).insertBefore(target)}else{this._insertIndex=target.index();$(insertItem).insertBefore(target)}}}else if(target.is(".ui-igpivot-droparea")){target=target.find(".ui-igpivot-metadataitem:last");this._insertIndex=target.index()+1;$(insertItem).insertAfter(target)}},_onDraggableOut:function(event,ui){var markup=$(ui.helper.html()),invalidIcon;ui.draggable.removeClass("ui-igpivot-dragover");invalidIcon=ui.draggable.closest("li.ui-igtree-node").length===0?"ui-icon-close":"ui-icon-cancel";if(ui.helper.hasClass("ui-igpivot-draghelper")){markup.find("span").removeClass("ui-icon-plus").addClass(invalidIcon).siblings("strong");ui.helper.removeClass(this.css.dropIndicator).addClass(this.css.invalidDropIndicator).html(markup)}ui.draggable.unbind("drag."+this.widgetName);$(document).find(".ui-igpivot-insertitem").remove();this._insertIndex=0},_getDefaultHierarchy:function(dimensionName,name,dataSource,typeName){var i,firstHierarchy,returnValue;dimensionName=name.substr(1,name.length-2);if(null!==dataSource.getDimension(name)&&$.ig.DimensionType.prototype.measure===dataSource.getDimension(name).dimensionType()){for(i=dataSource.metadataTree().children().length-1;i>=0;i--){if(name===dataSource.metadataTree().children()[i].item().uniqueName()){firstHierarchy=dataSource.metadataTree().children()[i];while(null!==firstHierarchy.children()){firstHierarchy=firstHierarchy.children()[0]}name=firstHierarchy.item().uniqueName();returnValue=dataSource.getMeasure(name)}}}else if(typeName===$.ig.Dimension.prototype.getType().typeName()){for(i=dataSource.metadataTree().children().length-1;i>=0;i--){if(dimensionName===dataSource.metadataTree().children()[i].item().name()||dimensionName===dataSource.metadataTree().children()[i].item().name().replace(" ","")){if(typeof dataSource.metadataTree().children()[i].item().defaultHierarchy==="function"&&dataSource.metadataTree().children()[i].item().defaultHierarchy()){name=dataSource.metadataTree().children()[i].item().defaultHierarchy()}else if(null!==dataSource.metadataTree().children()[i].children()[0].item()){name=dataSource.metadataTree().children()[i].children()[0].item().uniqueName()}else{firstHierarchy=dataSource.metadataTree().children()[i].children()[0];while(null===firstHierarchy.item()){firstHierarchy=firstHierarchy.children()[0]}name=firstHierarchy.item().uniqueName()}break}}returnValue=dataSource.getHierarchy(name)}else{returnValue=null}return returnValue},_addDroppedMeasure:function(item,dataSource,targetIndex){var i;if(item instanceof Array){for(i=0;i<item.length;i++){dataSource.addMeasureItem(item[i])}}else if(item instanceof $.ig.Kpi){item=this._addingKpiMetadataItems(dataSource,item.name());for(i=0;i<item.length;i++){dataSource.removeMeasureItem(item[i]);dataSource.addMeasureItem(item[i])}}else{dataSource.insertMeasureItem(targetIndex,item)}},_onDrop:function(event,ui,targetElement,draggedElement,typeName,name){var dataSource=this._ds,isValid=true,targetRole=$(targetElement).attr("data-role"),targetIndex=this._insertIndex,item,type,sourceRole,sourceIndex,filterMembers,i,isTreeLayout,noCancel,dimensionName;ui.draggable.unbind("."+this.widgetName);$(document).find(".ui-igpivot-insertitem").remove();if($.isFunction(this.options.customMoveValidation)){isValid=this.options.customMoveValidation.call(this.element,$(event.target).attr("data-role"),typeName,name)}if(!isValid){return false}switch(typeName){case $.ig.Dimension.prototype.getType().typeName():type=$.ig.Dimension.prototype.getType();break;case $.ig.Hierarchy.prototype.getType().typeName():type=$.ig.Hierarchy.prototype.getType();break;case $.ig.Measure.prototype.getType().typeName():type=$.ig.Measure.prototype.getType();break;case $.ig.Kpi.prototype.getType().typeName():type=$.ig.Kpi.prototype.getType();break;case $.ig.KpiMeasure.prototype.getType().typeName():type=$.ig.KpiMeasure.prototype.getType();break;case $.ig.MeasureList.prototype.getType().typeName():type=$.ig.MeasureList.prototype.getType();break;default:return false}item=this._getDefaultHierarchy(dimensionName,name,dataSource,typeName);if(null===item){item=dataSource.getCoreElement(function(el){return el.uniqueName()===name},type)}if(!item){return false}noCancel=this._triggerMetadataDropping(event,ui,targetElement,draggedElement,item,targetIndex);if(noCancel){if((sourceIndex=$.inArray(item,dataSource.filters()))>-1){sourceRole="filters"}else if((sourceIndex=$.inArray(item,dataSource.rowAxis()))>-1){sourceRole="rows"}else if((sourceIndex=$.inArray(item,dataSource.columnAxis()))>-1){sourceRole="columns"}else if((sourceIndex=$.inArray(item,dataSource.measures()))>-1||item instanceof Array){sourceRole="measures"}else{sourceRole=null}if(sourceRole!==null&&sourceRole===targetRole&&sourceIndex<targetIndex){targetIndex--}isTreeLayout=false;$(".ui-igpivotgrid").each(function(){if($(this).data("igPivotGrid")&&$(this).igPivotGrid("option","rowHeadersLayout")==="tree"){isTreeLayout=true;return false}});if(this._isInstance(item,"MeasureList")){dataSource.setMeasureListLocation(targetRole);dataSource.setMeasureListIndex(isTreeLayout&&targetRole==="rows"?0:targetIndex)}else if(isTreeLayout&&this._isInstance(item,"Measure")&&dataSource.measures().length>0&&dataSource.dataSource().measureListLocation()===0){dataSource.setMeasureListIndex(0);this._addDroppedMeasure(item,dataSource,targetIndex)}else{if(this._isInstance(item,"Hierarchy")){filterMembers=dataSource.getFilterMemberNames(name)}if(isTreeLayout&&typeof dataSource.rowAxis().item(0)!=="undefined"&&typeof dataSource.rowAxis().item(0).measures==="function"&&targetIndex===0){targetIndex=1}switch(sourceRole){case"filters":dataSource.removeFilterItem(item);break;case"rows":dataSource.removeRowItem(item);break;case"columns":dataSource.removeColumnItem(item);break;case"measures":if(item instanceof Array){for(i=0;i<item.length;i++){dataSource.removeMeasureItem(item[i])}}else{dataSource.removeMeasureItem(item)}break}switch(targetRole){case"filters":dataSource.insertFilterItem(targetIndex,item);break;case"rows":dataSource.insertRowItem(targetIndex,item);break;case"columns":dataSource.insertColumnItem(targetIndex,item);break;case"measures":this._addDroppedMeasure(item,dataSource,targetIndex);break}if(this._isInstance(item,"Hierarchy")){for(i=0;i<filterMembers.length;i++){dataSource.addFilterMember(name,filterMembers[i])}}}if(this.widgetName==="igPivotGrid"&&ui.draggable.data(_draggable)){delete ui.draggable.data(_draggable).plugins.stop}this._updateDataSource();this._triggerMetadataDropped(event,ui,targetElement,draggedElement,item,targetIndex);return true}return false},_createMetadataItemDropDown:function(event,targetElement,metadataItem){var $this=this,options=this.options,dataSource=this._ds,closestDropArea,dropDownParent,dropDownElement,menu,addMeasureList,addHierarchy,items,item,customValidation,dimensionName,defaultHierarchy,defaultHierarchyElement,i;closestDropArea=$(targetElement).closest(".ui-igpivot-droparea").attr("data-role");if($.isFunction(this.options.customMoveValidation)){customValidation=function(location){return $this.options.customMoveValidation.call($this.element,location,metadataItem.getType().name,metadataItem.uniqueName()||undefined)}}else{customValidation=function(){return true}}dropDownParent=$(this.options.dropDownParent).first();dropDownElement=$("<div class='"+this.css.metadataItemDropDown+"'></div>");dropDownElement.data("efh","1");dropDownElement.appendTo(dropDownParent).bind(this._getEvent("mousedown"),function(event1){event1.stopPropagation()});menu=$("<ul class='ui-widget'></ul>").appendTo(dropDownElement);defaultHierarchy=this._getDefaultHierarchy(dimensionName,metadataItem.uniqueName(),dataSource,metadataItem.getType().typeName());if(defaultHierarchy){metadataItem=defaultHierarchy}defaultHierarchyElement=$("li[data-name='"+metadataItem.uniqueName()+"']");if(0<defaultHierarchyElement.length){closestDropArea=defaultHierarchyElement.parent().attr("data-role")}if(this._isInstance(metadataItem,"Measure")||this._isInstance(metadataItem,"Kpi")){if(!options.disableMeasuresDropArea&&closestDropArea!=="measures"&&customValidation("measures")){$("<li><span class='ui-icon ui-icon-pivot-measures'></span>"+$.ig.PivotShared.locale.addToMeasures+"</li>").appendTo(menu).click(function(){if($this._isInstance(metadataItem,"Kpi")){item=$this._addingKpiMetadataItems($this._ds,$(targetElement).attr("data-name"));for(i=0;i<item.length;i++){$this._ds.removeMeasureItem(item[i]);$this._ds.addMeasureItem(item[i])}dropDownElement.remove();$this._updateDataSource()}else{$this._ds.removeMeasureItem(metadataItem);$this._ds.addMeasureItem(metadataItem);dropDownElement.remove();$this._updateDataSource()}})}}else if(this._isInstance(metadataItem,"MeasureList")){addMeasureList=function(location,index){$this._ds.setMeasureListLocation(location);$this._ds.setMeasureListIndex(index);dropDownElement.remove();$this._updateDataSource()};if(!options.disableColumnsDropArea&&closestDropArea!=="columns"&&customValidation("columns")){$("<li><span class='ui-icon ui-icon-pivot-clumns'></span>"+$.ig.PivotShared.locale.addToColumns+"</li>").appendTo(menu).click(function(){addMeasureList("columns",$this._ds.columnAxis().length)})}if(!options.disableRowsDropArea&&closestDropArea!=="rows"&&customValidation("rows")){$("<li><span class='ui-icon ui-icon-pivot-rows'></span>"+$.ig.PivotShared.locale.addToRows+"</li>").appendTo(menu).click(function(){addMeasureList("rows",$this._ds.rowAxis().length)})}}else{addHierarchy=function(addMethod){var i,name=metadataItem.uniqueName(),filterMembers=$this._ds.getFilterMemberNames(name);$this._ds.removeFilterItem(metadataItem);$this._ds.removeColumnItem(metadataItem);$this._ds.removeRowItem(metadataItem);$this._ds[addMethod](metadataItem);for(i=0;i<filterMembers.length;i++){$this._ds.addFilterMember(name,filterMembers[i])}dropDownElement.remove();$this._updateDataSource()};if(!options.disableFiltersDropArea&&closestDropArea!=="filters"&&customValidation("filters")){$("<li><span class='ui-icon ui-icon-pivot-filters'></span>"+$.ig.PivotShared.locale.addToFilters+"</li>").appendTo(menu).click(function(){addHierarchy("addFilterItem")})}if(!options.disableColumnsDropArea&&closestDropArea!=="columns"&&customValidation("columns")){$("<li><span class='ui-icon ui-icon-pivot-columns'></span>"+$.ig.PivotShared.locale.addToColumns+"</li>").appendTo(menu).click(function(){addHierarchy("addColumnItem")})}if(!options.disableRowsDropArea&&closestDropArea!=="rows"&&customValidation("rows")){$("<li><span class='ui-icon ui-icon-pivot-rows'></span>"+$.ig.PivotShared.locale.addToRows+"</li>").appendTo(menu).click(function(){addHierarchy("addRowItem")})}}items=dropDownElement.find("li");if(items.length===0){dropDownElement.remove();return}dropDownElement.css("position","absolute").position({of:targetElement,my:"left top",at:"left bottom"});items.bind(this._getEvent("mouseover"),function(){$(this).addClass("ui-state-hover")}).bind(this._getEvent("mouseout"),function(){$(this).removeClass("ui-state-hover")});$(document).bind(this._getEvent("mousedown")+"."+this.widgetName,function(){dropDownElement.remove();$(document).unbind("."+$this.widgetName)})},_createFilterDropDown:function(event,targetElement,hierarchy){var $this=this,hierarchyName,hierarchyFilterView,dropDownParent,dropDownElement,filterMembersTree,buttonContainer,removeFilterDropDown,noCancel;noCancel=this._triggerFilterDropDownOpening(event,hierarchy);if(noCancel){hierarchyName=hierarchy.uniqueName();hierarchyFilterView=new $.ig.HierarchyFilterView(hierarchy);dropDownParent=$(this.options.dropDownParent).first();dropDownElement=$("<div class='"+this.css.filterDropDown+"'></div>");dropDownElement.data("efh","1");dropDownElement.css("position","absolute").attr("data-hierarchy",hierarchyName).appendTo(dropDownParent).position({of:targetElement,my:"left top",at:"left bottom"}).bind(this._getEvent("mousedown"),function(event1){event1.stopPropagation()});filterMembersTree=$("<div class='"+this.css.filterMembers+"'></div>").appendTo(dropDownElement);buttonContainer=$("<div class='ui-igpivot-filterdropdown-buttoncontainer'></div>").appendTo(dropDownElement);removeFilterDropDown=function(event1){$this._removeFilterDropDown(event1,dropDownElement,hierarchy)};$("<button></button>").attr("data-role","ok").text($.ig.PivotShared.locale.ok).appendTo(buttonContainer).igButton().igButton("disable").click(function(event1){$this._onFilterOk(event1,dropDownElement,hierarchyFilterView,hierarchy)});$("<button></button>").attr("data-role","cancel").text($.ig.PivotShared.locale.cancel).appendTo(buttonContainer).igButton().click(removeFilterDropDown);$(document).bind(this._getEvent("mousedown")+"."+this.widgetName,removeFilterDropDown);this._loadFilterMembers(hierarchyFilterView,hierarchy,removeFilterDropDown);this._triggerFilterDropDownOpened(event,dropDownElement,hierarchy)}},_loadFilterMembers:function(hierarchyFilterView,hierarchy,removeFilterDropDown){var $this=this,dataSource,hierarchyName,rootFilterMembers,filterMembers,filterMember,member,members,maxLevel,levels,levelMembers,rootLevel,i;dataSource=this._ds;hierarchyName=hierarchy.uniqueName();filterMembers=dataSource.getFilterMemberNames(hierarchyName);if(filterMembers.length>0){members=[];maxLevel=0;for(i=0;i<filterMembers.length;i++){member=dataSource.tryGetMember(filterMembers[i]);if(member){members.push(member);if(member.levelDepth()>maxLevel){maxLevel=member.levelDepth()}}}levels=dataSource.getCoreElements(function(el){return el.hierarchyUniqueName()===hierarchyName&&el.depth()<=maxLevel},$.ig.Level.prototype.getType());for(i=0;i<levels.length;i++){levelMembers=dataSource.tryGetMembersForLevel(levels[i].uniqueName());hierarchyFilterView.addFiltersForMembers(levelMembers)}rootFilterMembers=hierarchyFilterView.getRootFilterMembers();rootFilterMembers=rootFilterMembers?rootFilterMembers.__inner:[];for(i=0;i<rootFilterMembers.length;i++){rootFilterMembers[i].isSelected($.ig.util.toNullable($.ig.Boolean.prototype.$type,false))}for(i=0;i<members.length;i++){filterMember=hierarchyFilterView.tryGetFilterMember(members[i].uniqueName());if(filterMember){filterMember.isSelected($.ig.util.toNullable($.ig.Boolean.prototype.$type,true))}}}rootLevel=dataSource.getCoreElement(function(el){return el.depth()===0&&el.hierarchyUniqueName()===hierarchyName},$.ig.Level.prototype.getType());this._ds.getMembersOfLevel(rootLevel.uniqueName()).done(function(m){$this._onFilterMembersLoaded(hierarchyFilterView,m,hierarchy)}).fail(removeFilterDropDown)},_onFilterMembersLoaded:function(hierarchyFilterView,members,hierarchy){var hierarchyName,dropDownElement,filterMembersTree;hierarchyName=hierarchy.uniqueName();hierarchyFilterView.addFiltersForMembers(members);dropDownElement=$(".ui-igpivot-filterdropdown").filter(function(){return $(this).attr("data-hierarchy")===hierarchyName});if(dropDownElement.length>0){filterMembersTree=$(dropDownElement[0]).find(".ui-igpivot-filtermembers");this._initTree(filterMembersTree,hierarchyFilterView)}},_getScrollBarWidth:function(){var el=$('<div style="width: 100px; height: 100px; position: absolute; top: -10000px; left: -10000px; overflow: scroll"></div>').appendTo($(document.body)),scrollWidth;scrollWidth=el[0].offsetWidth-el[0].clientWidth;el.remove();return scrollWidth},_getElementSize:function(element){var el=$('<div style="width: 5000px; height: 5000px; position: absolute; top: -10000px; left: -10000px;"></div>').appendTo($(document.body)),result,position,float;position=element.css("position");float=element.css("float");element.css({position:"relative","float":"left"});element.appendTo(el);result=[element.width(),element.height()];element.css("position",position);element.css("float",float);element.detach();el.remove();return result},_arrangeDropDown:function(onExpand){var $this=this,fdd,fm,fmHeight,bcHeight,ddTop,bTop,bHeight,bBottom,fmBottom,fmMaxHeight,ddLeft,bLeft,bWidth,bRight,fmRight,fddMaxWidth,windowHeight,windowInnerHeight,parentOffset,elementSize,fddWidth,scrollTop,dropDownOffsetBottom;dropDownOffsetBottom=30;fdd=$(".ui-igpivot-filterdropdown");fm=$(".ui-igpivot-filterdropdown .ui-igpivot-filtermembers");fmHeight=fm.height();bcHeight=$(".ui-igpivot-filterdropdown-buttoncontainer").innerHeight();ddTop=parseInt(fdd.css("top").replace("px",""),10);bTop=$(document).scrollTop();windowHeight=$(window).height();windowInnerHeight=window.innerHeight;bHeight=windowHeight>windowInnerHeight?windowHeight:windowInnerHeight;bBottom=bTop+bHeight;fmBottom=bBottom-bcHeight-dropDownOffsetBottom;fmMaxHeight=Math.floor(fmBottom-ddTop);ddLeft=parseInt(fdd.css("left").replace("px",""),10);bLeft=$("body").css("left");if(bLeft==="auto"){bLeft=0}else{bLeft=parseInt(bLeft.replace("px",""),10)}bWidth=$("body").width();bRight=bLeft+bWidth;fmRight=bRight;fddMaxWidth=Math.floor(fmRight-ddLeft);fm.css("max-height",fmMaxHeight);fdd.css("max-width",fddMaxWidth);parentOffset=parseInt(fdd.css("padding-left").replace("px",""),10)+parseInt(fdd.css("padding-right").replace("px",""),10)+parseInt(fdd.css("border-left-width").replace("px",""),10)+parseInt(fdd.css("border-right-width").replace("px",""),10);
scrollTop=fm[0].scrollTop;fm.detach();elementSize=$this._getElementSize(fm);fdd.prepend(fm);fm[0].scrollTop=scrollTop;fddWidth=elementSize[0]+$this._getScrollBarWidth()+parseInt(fm.css("padding-right").replace("px",""),10)+parentOffset;fddWidth=Math.max(fddWidth,parseInt(fdd.css("min-width").replace("px",""),10));fdd.css("width",fddWidth);if(fmHeight>fmMaxHeight||onExpand===false){if(fddWidth<=fddMaxWidth){fm.css("overflow-x","hidden")}else{fm.css("overflow-x","auto")}}},_initTree:function(filterMembersTree,hierarchyFilterView){var $this=this,dataSource=this._ds,checkChildNodes,parsedFilterMembers;$(filterMembersTree).siblings(".ui-igpivot-filterdropdown-buttoncontainer").children(".ui-igbutton[data-role=ok]").igButton("enable");checkChildNodes=function(nodeElement,filterMembers){var isSelected,state,i,filterMember;for(i=0;i<filterMembers.length;i++){filterMember=filterMembers[i].filterMember;isSelected=filterMember.isSelected();if(isSelected.hasValue()){if(isSelected.value()){state="on"}else{state="off"}}else{state="partial"}$(nodeElement).find(".ui-igtree-node[data-value='"+filterMembers[i].uniqueName+"']").children("[data-role=checkbox]").attr("data-chk",state).children("span").removeClass("ui-state-disabled ui-igcheckbox-normal-on ui-igcheckbox-normal-partial ui-igcheckbox-normal-off").addClass("ui-igcheckbox-normal-"+state+(state==="partial"?" ui-igcheckbox-normal-on ui-state-disabled":""))}};parsedFilterMembers=this._parseFilterMembers(hierarchyFilterView.getRootFilterMembers());filterMembersTree.igTree({dataSource:parsedFilterMembers,loadOnDemand:true,checkboxMode:"triState",bindings:{textKey:"caption",valueKey:"uniqueName",childDataProperty:"children"},nodeCollapsed:function(){$this._arrangeDropDown(false)},nodeCheckstateChanged:function(event,ui){var okButton,isSelected;okButton=$(this).siblings(".ui-igpivot-filterdropdown-buttoncontainer").children(".ui-igbutton[data-role=ok]");if(ui.newCheckedNodes&&ui.newCheckedNodes.length>0){okButton.igButton("enable")}else{okButton.igButton("disable")}isSelected=$(ui.node.element).children("[data-role=checkbox]").attr("data-chk");isSelected=isSelected==="partial"?null:isSelected==="on"?true:false;ui.node.data.filterMember.isSelected($.ig.util.toNullable($.ig.Boolean.prototype.$type,isSelected))},nodeExpanded:function(ect,ui){$this._arrangeDropDown(true);var i,collection,element;if(!$.ig.Pivot._pivotShared._showLastLevelExpanders){element=ui.node.element;collection=ui.node.data.children;if(collection!==null&&0<collection.length){for(i=0;i<collection.length;i++){if(null!==collection[i].children&&0===collection[i].children.length){element.find(".ui-igtree-node").eq(i).find("span:first").css("display","none")}}}}}}).css("overflow-x","hidden").data(_tree)._executeUrlRequest=function(node){var $$this=this,nodeData=this.nodeDataFor(node.attr("data-path")),ul,indicator,levels;ul=node.children("ul");$("<li style='width:20px; height:20px;' data-role='loading'>&nbsp;</li>").appendTo(ul);ul.show();indicator=ul.children("li").igLoading({includeVerticalOffset:true,cssClass:"ui-igpivotgrid-tree-blockarea"}).data("igLoading").indicator();indicator.show();this._populatingNode={ul:ul,node:node,indicator:indicator};levels=dataSource.getCoreElements(function(el){return el.hierarchyUniqueName()===nodeData.member.hierarchyUniqueName()},$.ig.Level.prototype.$type);$.ig.Pivot._pivotShared._showLastLevelExpanders=true;dataSource.getMembersOfMember(nodeData.member.uniqueName()).done(function(members){var parsedFilterMembers1;if(members.item(0)&&levels.length-1===members.item(0).levelDepth()){$.ig.Pivot._pivotShared._showLastLevelExpanders=false}hierarchyFilterView.addFiltersForMembers(members);parsedFilterMembers1=$this._parseFilterMembers(nodeData.filterMember.children());$$this._populateNodeData(true,"",{data:function(){return parsedFilterMembers1}});$$this._updateParentState(node);checkChildNodes(node,nodeData.children);$this._triggerFilterMembersLoaded(node,parsedFilterMembers,parsedFilterMembers1)})};checkChildNodes(filterMembersTree,parsedFilterMembers);this._triggerFilterMembersLoaded(filterMembersTree,parsedFilterMembers,parsedFilterMembers)},_parseFilterMembers:function(filterMembers){var parsedFilterMembers,parsedFilterMember,filterMember,member,i;if(filterMembers===null){return[]}filterMembers=filterMembers.__inner;parsedFilterMembers=[];for(i=0;i<filterMembers.length;i++){filterMember=filterMembers[i];member=filterMember.member();parsedFilterMember={};parsedFilterMember.filterMember=filterMember;parsedFilterMember.member=member;parsedFilterMember.caption=member.caption();parsedFilterMember.uniqueName=member.uniqueName();parsedFilterMember.children=[];parsedFilterMembers.push(parsedFilterMember)}return parsedFilterMembers},_onFilterOk:function(event,dropDownElement,hierarchyFilterView,hierarchy){var dataSource=this._ds,hierarchyName=hierarchy.uniqueName(),filterMembers,checkedFilterMembers,i,noCancel;filterMembers=hierarchyFilterView.getSelectedFilterItems().__inner;checkedFilterMembers=[];for(i=0;i<filterMembers.length;i++){checkedFilterMembers.push(filterMembers[i].member().uniqueName())}noCancel=this._triggerFilterDropDownOk(event,dropDownElement,hierarchy,checkedFilterMembers);if(noCancel){dataSource.removeAllFilterMembers(hierarchyName);for(i=0;i<checkedFilterMembers.length;i++){dataSource.addFilterMember(hierarchyName,checkedFilterMembers[i])}this._updateDataSource();this._removeFilterDropDown(event,dropDownElement,hierarchy)}},_removeFilterDropDown:function(event,dropDownElement,hierarchy){var noCancel;noCancel=this._triggerFilterDropDownClosing(event,dropDownElement,hierarchy);if(noCancel){dropDownElement.find(".ui-igtree").igTree("destroy");dropDownElement.find(".ui-button").igButton("destroy");dropDownElement.remove();$(document).unbind("."+this.widgetName);this._triggerFilterDropDownClosed(event,hierarchy)}},_triggerDataSourceInitialized:function(evt,args){this._trigger("dataSourceInitialized",evt,args)},_triggerDataSourceUpdated:function(evt,args){this._trigger("dataSourceUpdated",evt,args)},_triggerDragStart:function(event,ui,item){var args={helper:ui.helper,offset:ui.offset,originalPosition:ui.originalPosition,position:ui.position,metadata:item};$(".ui-igpivot-overlaydroparea").css("display","block");return this._trigger("dragStart",event,args)},_triggerDrag:function(event,ui,item){var args={helper:ui.helper,offset:ui.offset,originalPosition:ui.originalPosition,position:ui.position,metadata:item};return this._trigger("drag",event,args)},_triggerDragStop:function(event,ui){$(".ui-igpivot-overlaydroparea").css("display","none");this._trigger("dragStop",event,ui)},_triggerMetadataDropping:function(event,ui,targetElement,item,itemIndex){var args={helper:ui.helper,offset:ui.offset,position:ui.position,targetElement:targetElement,metadata:item,metadataIndex:itemIndex};return this._trigger("metadataDropping",event,args)},_triggerMetadataDropped:function(event,ui,targetElement,draggedElement,item,itemIndex){var args={helper:ui.helper,offset:ui.offset,position:ui.position,targetElement:targetElement,draggedElement:draggedElement,metadata:item,metadataIndex:itemIndex};this._trigger("metadataDropped",event,args)},_triggerMetadataRemoving:function(event,targetElement,item){var args={targetElement:targetElement,metadata:item};return this._trigger("metadataRemoving",event,args)},_triggerMetadataRemoved:function(event,item){var args={metadata:item};this._trigger("metadataRemoved",event,args)},_triggerFilterDropDownOpening:function(event,hierarchy){var args={hierarchy:hierarchy};return this._trigger("filterDropDownOpening",event,args)},_triggerFilterDropDownOpened:function(event,dropDownElement,hierarchy){var args={dropDownElement:dropDownElement,hierarchy:hierarchy};this._trigger("filterDropDownOpened",event,args)},_triggerFilterMembersLoaded:function(parent,rootFilterMembers,filterMembers){var args={parent:parent,rootFilterMembers:rootFilterMembers,filterMembers:filterMembers};this._trigger("filterMembersLoaded",null,args)},_triggerFilterDropDownOk:function(event,dropDownElement,hierarchy,filterMembers){var args={dropDownElement:dropDownElement,hierarchy:hierarchy,filterMembers:filterMembers};return this._trigger("filterDropDownOk",event,args)},_triggerFilterDropDownClosing:function(event,dropDownElement,hierarchy){var args={dropDownElement:dropDownElement,hierarchy:hierarchy};return this._trigger("filterDropDownClosing",event,args)},_triggerFilterDropDownClosed:function(event,hierarchy){var args={hierarchy:hierarchy};this._trigger("filterDropDownClosed",event,args)}};$.widget("ui.igOlapDataSourceWidget",{_create:function(){this._ds=$.ig.Pivot._pivotShared._createDataSource(null,this.options.dataSourceOptions)},dataSource:function(){return this._ds}})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Pivot Data Selector 15.2.20152.1027
*
* Copyright (c) 2011-2012 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on: 
*	jquery-1.4.4.js
*	jquery.ui.core.js
*	jquery.ui.widget.js
*	jquery.ui.mouse.js
*	jquery.ui.draggable.js
*	jquery.ui.droppable.js
*	modernizr.js (Optional)
*	infragistics.util.js
*	infragistics.datasource.js
*	infragistics.olapxmladatasource.js
*	infragistics.olapflatdatasource.js
*	infragistics.templating.js
*	infragistics.ui.shared.js
*   infragistics.ui.scroll.js
*	infragistics.ui.combo.js
*	infragistics.ui.tree.js
*	infragistics.ui.pivot.shared.js
*/
(function($){var _droppable=$.ui.droppable.prototype.widgetFullName||$.ui.droppable.prototype.widgetName;$.widget("ui.igPivotDataSelector",{css:{dataSelector:"ui-igpivotdataselector",dataSelectorRoot:"ui-igpivotdataselector-root",catalog:"ui-igpivotdataselector-catalog",cube:"ui-igpivotdataselector-cube",measureGroup:"ui-igpivotdataselector-measuregroup",metadata:"ui-igpivotdataselector-metadata ui-widget-content",metadataItem:"ui-igpivot-metadataitem ui-widget ui-corner-all ui-state-default",dropAreasTable:"ui-igpivotdataselector-dropareas",dropArea:"ui-igpivot-droparea ui-widget-content",activeDropArea:"active",filtersIcon:"ui-icon ui-icon-pivot-filters",columnsIcon:"ui-icon ui-icon-pivot-columns",rowsIcon:"ui-icon ui-icon-pivot-rows",measuresIcon:"ui-icon ui-icon-pivot-measures",updateLayout:"ui-igpivotdataselector-updatelayout",dropIndicator:"ui-state-highlight",invalidDropIndicator:"ui-state-error",insertItem:"ui-igpivot-insertitem ui-state-highlight ui-corner-all",metadataItemDropDown:"ui-igpivot-metadatadropdown ui-widget ui-widget-content",filterIcon:"ui-icon ui-icon-pivot-smallfilter",filterDropDown:"ui-igpivot-filterdropdown ui-widget ui-widget-content",filterMembers:"ui-igpivot-filtermembers"},options:{width:250,height:null,dataSource:null,dataSourceOptions:{xmlaOptions:{serverUrl:null,catalog:null,cube:null,measureGroup:null,requestOptions:{withCredentials:false,beforeSend:null},enableResultCache:true,discoverProperties:null,executeProperties:null,mdxSettings:{nonEmptyOnRows:true,nonEmptyOnColumns:true,addCalculatedMembersOnRows:true,addCalculatedMembersOnColumns:true,dimensionPropertiesOnRows:[],dimensionPropertiesOnColumns:[]}},flatDataOptions:{dataSource:null,dataSourceUrl:null,dataSourceType:null,responseDataKey:null,responseDataType:null,metadata:{cube:{name:null,caption:null,measuresDimension:{name:null,caption:null,measures:[{name:null,caption:null,aggregator:null,displayFolder:null}]},dimensions:[{name:null,caption:null,hierarchies:[{name:null,caption:null,displayFolder:null,levels:[{name:null,caption:null,memberProvider:null}]}]}]}}},measures:null,filters:null,rows:null,columns:null},deferUpdate:false,dragAndDropSettings:{appendTo:"body",containment:false,zIndex:10},dropDownParent:"body",disableRowsDropArea:false,disableColumnsDropArea:false,disableMeasuresDropArea:false,disableFiltersDropArea:false,customMoveValidation:null},events:{dataSelectorRendered:null,dataSourceInitialized:null,dataSourceUpdated:null,deferUpdateChanged:null,dragStart:null,drag:null,dragStop:null,metadataDropping:null,metadataDropped:null,metadataRemoving:null,metadataRemoved:null,filterDropDownOpening:null,filterDropDownOpened:null,filterMembersLoaded:null,filterDropDownOk:null,filterDropDownClosing:null,filterDropDownClosed:null},_deferUpdate:false,_create:function(){var $this=this,elementName=this.element[0].nodeName.toUpperCase();if(elementName!=="DIV"){throw new Error(elementName+$.ig.PivotDataSelector.locale.invalidBaseElement)}this.element.addClass(this.css.dataSelector);this._onFiltersChanged=function(collection,collectionChangedArgs){var dropArea=$this.element.find(".ui-igpivot-droparea[data-role=filters]");$this._onDataSourceCollectionChanged(collection,collectionChangedArgs,dropArea,$this.options.disableFiltersDropArea)};this._onRowAxisChanged=function(collection,collectionChangedArgs){var dropArea=$this.element.find(".ui-igpivot-droparea[data-role=rows]");$this._onDataSourceCollectionChanged(collection,collectionChangedArgs,dropArea,$this.options.disableRowsDropArea)};this._onColumnAxisChanged=function(collection,collectionChangedArgs){var dropArea=$this.element.find(".ui-igpivot-droparea[data-role=columns]");$this._onDataSourceCollectionChanged(collection,collectionChangedArgs,dropArea,$this.options.disableColumnsDropArea)};this._onMeasuresChanged=function(collection,collectionChangedArgs){var dropArea=$this.element.find(".ui-igpivot-droparea[data-role=measures]");$this._onDataSourceCollectionChanged(collection,collectionChangedArgs,dropArea,$this.options.disableMeasuresDropArea)};this._setDataSource();this._makeDroppable(this.element)},_setOption:function(key,value){var dropArea,droppable;switch(key){case"dataSource":this._clearDataSource();this.options.dataSourceOptions=null;this.options.dataSource=this._createDataSource(value,null);this._setDataSource();break;case"dataSourceOptions":this._clearDataSource();this.options.dataSourceOptions=value;this.options.dataSource=this._createDataSource(null,value);this._setDataSource();break;case"deferUpdate":$.Widget.prototype._setOption.apply(this,arguments);this._deferUpdate=value;this.element.find(".ui-igpivotdataselector-deferupdate").attr("checked",value);this.element.find(".ui-igpivotdataselector-updatelayout").igButton(value?"enable":"disable");break;case"width":$.Widget.prototype._setOption.apply(this,arguments);this.element.width(value);this.element.find(".ui-igpivotdataselector-catalog, .ui-igpivotdataselector-cube, .ui-igpivotdataselector-measuregroup").igCombo("option","width",this.element.children(".ui-igpivotdataselector-root").width());break;case"height":$.Widget.prototype._setOption.apply(this,arguments);this.element.height(value);break;case"dragAndDropSettings":$.Widget.prototype._setOption.apply(this,arguments);this.element.find(":ui-draggable").each(function(ind,el){var draggable=$(el);draggable.draggable("option","appendTo",value.appendTo);draggable.draggable("option","containment",value.containment);draggable.draggable("option","zIndex",value.zIndex)});break;case"disableRowsDropArea":$.Widget.prototype._setOption.apply(this,arguments);dropArea=this.element.find(".ui-igpivot-droparea[data-role=rows]");if(value){droppable=dropArea.data(_droppable);if(droppable){droppable.destroy()}}else if(!$.ig.util.isTouchDevice()){dropArea.droppable(this._createDropAreaOptions())}this._fillDropArea(dropArea,this._ds.rowAxis(),this.options.disableRowsDropArea);break;case"disableColumnsDropArea":$.Widget.prototype._setOption.apply(this,arguments);dropArea=this.element.find(".ui-igpivot-droparea[data-role=columns]");if(value){droppable=dropArea.data(_droppable);if(droppable){droppable.destroy()}}else if(!$.ig.util.isTouchDevice()){dropArea.droppable(this._createDropAreaOptions())}this._fillDropArea(dropArea,this._ds.columnAxis(),this.options.disableColumnsDropArea);break;case"disableMeasuresDropArea":$.Widget.prototype._setOption.apply(this,arguments);dropArea=this.element.find(".ui-igpivot-droparea[data-role=measures]");if(value){droppable=dropArea.data(_droppable);if(droppable){droppable.destroy()}}else if(!$.ig.util.isTouchDevice()){dropArea.droppable(this._createDropAreaOptions())}this._fillDropArea(dropArea,this._ds.measures(),this.options.disableMeasuresDropArea);break;case"disableFiltersDropArea":$.Widget.prototype._setOption.apply(this,arguments);dropArea=this.element.find(".ui-igpivot-droparea[data-role=filters]");if(value){droppable=dropArea.data(_droppable);if(droppable){droppable.destroy()}}else if(!$.ig.util.isTouchDevice()){dropArea.droppable(this._createDropAreaOptions())}this._fillDropArea(dropArea,this._ds.filters(),this.options.disableFiltersDropArea);break}},_initUI:function(){var $this=this,dataSource=this._ds,rootDiv,comboOptions,droppableOptions,dropAreasTable,tableRow,tableHeader,tableColumn,dropArea,deferUpdateCheck,deferUpdateLabel;if(this.options.width){this.element.width(this.options.width)}if(this.options.height){this.element.height(this.options.height)}rootDiv=$("<div class='ui-widget "+this.css.dataSelectorRoot+"'></div>").appendTo(this.element);if(this._isInstance(dataSource,"OlapXmlaDataSource")){comboOptions={textKey:"_caption",valueKey:"_name",mode:"dropdown",enableClearButton:false,width:rootDiv.width()};$("<input class='"+this.css.catalog+"' />").appendTo(rootDiv).igCombo($.extend({placeHolder:$.ig.PivotDataSelector.locale.catalog,selectionChanged:function(evt,ui){$this._onCatalogSelected(ui.items[0].data.caption())}},comboOptions));$("<input class='"+this.css.cube+"' />").appendTo(rootDiv).igCombo($.extend({placeHolder:$.ig.PivotDataSelector.locale.cube,selectionChanged:function(evt,ui){$this._onCubeSelected(ui.items[0].data.caption())}},comboOptions));$("<input class='"+this.css.measureGroup+"' />").appendTo(rootDiv).igCombo($.extend({placeHolder:$.ig.PivotDataSelector.locale.measureGroup,selectionChanged:function(evt,ui){$this._onMeasureGroupSelected(ui.items[0].data.caption())}},comboOptions))}$("<div class='"+this.css.metadata+"'></div>").appendTo(rootDiv).addClass().igTree({initialExpandDepth:0,bindings:{nodeContentTemplate:"<span class='ui-igpivot-metadataitem' data-name='${name}' data-type='${type}'><span class='${image}'/>${caption}</span>",childDataProperty:"children"},rendered:function(evt,ui){ui.owner.element.removeAttr("data-scroll")}});droppableOptions=this._createDropAreaOptions();dropAreasTable=$("<table class='"+this.css.dropAreasTable+"'></table>").appendTo(rootDiv);tableRow=$("<tr></tr>").appendTo(dropAreasTable);tableHeader=$("<th></th>").appendTo(tableRow);$("<span class='"+this.css.filtersIcon+"'></span>").appendTo(tableHeader);$("<span></span>").text($.ig.PivotDataSelector.locale.filters).appendTo(tableHeader);tableHeader=$("<th></th>").appendTo(tableRow);$("<span class='"+this.css.columnsIcon+"'></span>").appendTo(tableHeader);$("<span></span>").text($.ig.PivotDataSelector.locale.columns).appendTo(tableHeader);tableRow=$("<tr></tr>").appendTo(dropAreasTable);tableColumn=$("<td></td>").appendTo(tableRow);dropArea=$("<ul class='"+this.css.dropArea+"' data-role='filters'></ul>").appendTo(tableColumn);if(!this.options.disableFiltersDropArea&&!$.ig.util.isTouchDevice()){dropArea.droppable(droppableOptions)}tableColumn=$("<td></td>").appendTo(tableRow);dropArea=$("<ul class='"+this.css.dropArea+"' data-role='columns'></ul>").appendTo(tableColumn);if(!this.options.disableColumnsDropArea&&!$.ig.util.isTouchDevice()){dropArea.droppable(droppableOptions)}tableRow=$("<tr></tr>").appendTo(dropAreasTable);tableHeader=$("<th></th>").appendTo(tableRow);$("<span class='"+this.css.rowsIcon+"'></span>").appendTo(tableHeader);$("<span></span>").text($.ig.PivotDataSelector.locale.rows).appendTo(tableHeader);tableHeader=$("<th></th>").appendTo(tableRow);$("<span class='"+this.css.measuresIcon+"'></span>").appendTo(tableHeader);$("<span></span>").text($.ig.PivotDataSelector.locale.measures).appendTo(tableHeader);tableRow=$("<tr></tr>").appendTo(dropAreasTable);tableColumn=$("<td></td>").appendTo(tableRow);dropArea=$("<ul class='"+this.css.dropArea+"' data-role='rows'></ul>").appendTo(tableColumn);if(!this.options.disableRowsDropArea&&!$.ig.util.isTouchDevice()){dropArea.droppable(droppableOptions)}tableColumn=$("<td></td>").appendTo(tableRow);dropArea=$("<ul class='"+this.css.dropArea+"' data-role='measures'></ul>").appendTo(tableColumn);if(!this.options.disableMeasuresDropArea&&!$.ig.util.isTouchDevice()){dropArea.droppable(droppableOptions)}if($.ig.util.isTouchDevice()){dropAreasTable.find(".ui-igpivot-droparea").igScroll()}this._deferUpdate=this.options.deferUpdate;deferUpdateLabel=$("<label></label>").appendTo(rootDiv).text($.ig.PivotDataSelector.locale.deferUpdate);deferUpdateCheck=$("<input class='ui-igpivotdataselector-deferupdate' type='checkbox' />").prependTo(deferUpdateLabel).change(function(event){$this._deferUpdate=$(event.target).is(":checked");if($this._deferUpdate){$this.element.find(".ui-igpivotdataselector-updatelayout").igButton("enable")}else{$this.element.find(".ui-igpivotdataselector-updatelayout").igButton("disable");$this._updateDataSource()}$this._triggerDeferUpdateChanged($this._deferUpdate)});$("<button class='"+this.css.updateLayout+"'></button>").attr("title",$.ig.PivotDataSelector.locale.updateLayout).appendTo(rootDiv).igButton({text:false,icons:{primary:"ui-icon-refresh"}}).igButton(this._deferUpdate?"enable":"disable").click(function(){$this._updateDataSource(true)});this._triggerDataSelectorRendered()},_clearUI:function(){this.element.find(".ui-igpivotdataselector-catalog, .ui-igpivotdataselector-cube, .ui-igpivotdataselector-measuregroup").igCombo("destroy");this.element.find(".ui-igpivotdataselector-metadata").igTree("destroy");this.element.find(".ui-igpivot-droparea .ui-igpivot-metadataitem.ui-draggable").draggable("destroy").remove();this.element.empty()},_setDataSource:function(){var $this=this,dataSource;this._ds=dataSource=this._createDataSource(this.options.dataSource,this.options.dataSourceOptions);this._initUI();if(!dataSource){return}this.timestamp=(new Date).getTime();$(dataSource).bind("initialized.dataselector"+this.timestamp,function(evt,args){$this._onDataSourceInitialized(evt,args)});$(dataSource).bind("updated.dataselector"+this.timestamp,function(evt,args){$this._onDataSourceUpdated(evt,args)});if(dataSource.isInitialized()){if(this._isInstance(dataSource,"OlapXmlaDataSource")){this._onCatalogSelected(this._getItemName(dataSource.catalog()),true)}else{this._fillMetadata(dataSource.metadataTree())}dataSource.bindCollectionChanged({filters:this._onFiltersChanged,rowAxis:this._onRowAxisChanged,columnAxis:this._onColumnAxisChanged,measures:this._onMeasuresChanged})}else{dataSource.initialize()}},_clearDataSource:function(){if(this._ds){$(this._ds).unbind("updated.dataselector");this._ds.unbindCollectionChanged({filters:this._onFiltersChanged,rowAxis:this._onRowAxisChanged,columnAxis:this._onColumnAxisChanged,measures:this._onMeasuresChanged})}this._filterMembersCache=[];this._clearUI()},_onDataSourceInitialized:function(evt,evtArgs){var dataSource=this._ds,args=$.extend({owner:this,dataSource:dataSource},evtArgs);dataSource.bindCollectionChanged({filters:this._onFiltersChanged,rowAxis:this._onRowAxisChanged,columnAxis:this._onColumnAxisChanged,measures:this._onMeasuresChanged});this._triggerDataSourceInitialized(evt,args);if(!evtArgs.error){if(this._isInstance(dataSource,"OlapXmlaDataSource")){this._onCatalogSelected(this._getItemName(dataSource.catalog()),true)}else{this._fillMetadata(dataSource.metadataTree())}}},_updateDataSource:function(deferUpdateOverride){var dataSource=this._ds,shouldUpdate=deferUpdateOverride||this._deferUpdate===false;if(shouldUpdate&&dataSource.cube()!==null){dataSource.update()}},_onDataSourceUpdated:function(evt,evtArgs){var dataSource=this._ds,args=$.extend({owner:this,dataSource:dataSource},evtArgs);this._triggerDataSourceUpdated(evt,args)},_getItemName:function(item){return item&&item.name()},_fillCombo:function(comboSelector,items,selectedItem){var t=typeof selectedItem;this.element.find(comboSelector).igCombo("option","dataSource",items);if(t==="number"&&selectedItem!==null){this.element.find(comboSelector).igCombo("index",selectedItem)}else if(t==="object"&&selectedItem!==null&&$.isFunction(selectedItem.name)){this.element.find(comboSelector).igCombo("value",selectedItem.name())}},_clearCombo:function(comboSelector){this.element.find(comboSelector).igCombo("deselectAll").igCombo("option","dataSource",null)},_fillMetadata:function(metadata){var $this=this,parseMetadata=function(m){var metadataItem={},hasItem=true,item,imgClass,children,i;switch(m.type()){case $.ig.OlapMetadataTreeItemType.prototype.cube:imgClass="cube";break;case $.ig.OlapMetadataTreeItemType.prototype.dimension:imgClass="dimension";break;case $.ig.OlapMetadataTreeItemType.prototype.group:imgClass="folder";hasItem=false;break;case $.ig.OlapMetadataTreeItemType.prototype.userDefinedHierarchy:imgClass="hierarchymultiple";break;case $.ig.OlapMetadataTreeItemType.prototype.systemEnabledHierarchy:imgClass="hierarchysingle";break;case $.ig.OlapMetadataTreeItemType.prototype.parentChildHierarchy:imgClass="hierarchydirect";break;case $.ig.OlapMetadataTreeItemType.prototype.measure:imgClass="measure";break;case $.ig.OlapMetadataTreeItemType.prototype.level1:imgClass="level1";break;case $.ig.OlapMetadataTreeItemType.prototype.level2:imgClass="level2";break;case $.ig.OlapMetadataTreeItemType.prototype.level3:imgClass="level3";break;case $.ig.OlapMetadataTreeItemType.prototype.level4:imgClass="level4";break;case $.ig.OlapMetadataTreeItemType.prototype.level5:imgClass="level5";break;case $.ig.OlapMetadataTreeItemType.prototype.kpiRoot:case $.ig.OlapMetadataTreeItemType.prototype.kpi:imgClass="kpi";break;case $.ig.OlapMetadataTreeItemType.prototype.kpiValue:imgClass="kpi value";break;case $.ig.OlapMetadataTreeItemType.prototype.kpiGoal:imgClass="kpi goal";break;case $.ig.OlapMetadataTreeItemType.prototype.kpiStatus:imgClass="kpi status";break;case $.ig.OlapMetadataTreeItemType.prototype.kpiTrend:imgClass="kpi trend";break;case $.ig.OlapMetadataTreeItemType.prototype.kpiWeight:imgClass="kpi weight";break;default:imgClass="folder";break}metadataItem.caption=m.caption();metadataItem.image=imgClass;if(hasItem){item=m.item();metadataItem.name=item.uniqueName();metadataItem.type=item.getType().typeName()}children=m.children();if(children){metadataItem.children=[];for(i=0;i<children.length;i++){metadataItem.children[i]=parseMetadata(children[i])}}return metadataItem},parsedMetadata=metadata===null?[]:[parseMetadata(metadata)],dragAndDropSettings=this.options.dragAndDropSettings,tree,items;tree=this.element.find(".ui-igpivotdataselector-metadata").igTree("option","dataSource",parsedMetadata);items=tree.find(".ui-igpivot-metadataitem[data-type='Kpi'],.ui-igpivot-metadataitem[data-type='Measure'],.ui-igpivot-metadataitem[data-type='Dimension'],.ui-igpivot-metadataitem[data-type='Hierarchy'],.ui-igpivot-metadataitem[data-type='KpiMeasure']");if(!$.ig.util.isTouchDevice()){items.draggable({appendTo:dragAndDropSettings.appendTo,containment:dragAndDropSettings.containment,zIndex:dragAndDropSettings.zIndex,cursorAt:this._const.dragCursorAt,revert:false,helper:function(){var markup;markup=$($this._const.dragHelperMarkup.replace("{0}",$(this).text()));markup.addClass($this.css.invalidDropIndicator).find("span").addClass("ui-icon  ui-icon-cancel");return markup},start:function(event,ui){return $this._triggerDragStart(event,ui,tree.igTree("nodeDataFor",$(this).attr("data-path")))},drag:function(event,ui){return $this._triggerDrag(event,ui,tree.igTree("nodeDataFor",$(this).attr("data-path")))},over:function(event,ui){$this._onDraggableOver(event,ui)},out:function(event,ui){$this._onDraggableOut(event,ui)},stop:function(event,ui){$this._triggerDragStop(event,ui)}})}items.click(function(event){var item=tree.igTree("nodeDataFor",$(this).closest("li").attr("data-path")),name=item.name,type=$.ig[item.type].prototype.getType(),metadataItem;metadataItem=$this._ds.getCoreElement(function(el){return el.uniqueName()===name},type);if(metadataItem){$this._createMetadataItemDropDown(event,this,metadataItem)}});this._fillDropArea(".ui-igpivot-droparea[data-role=filters]",this._ds.filters(),this.options.disableFiltersDropArea);this._fillDropArea(".ui-igpivot-droparea[data-role=rows]",this._ds.rowAxis(),this.options.disableRowsDropArea);this._fillDropArea(".ui-igpivot-droparea[data-role=columns]",this._ds.columnAxis(),this.options.disableColumnsDropArea);this._fillDropArea(".ui-igpivot-droparea[data-role=measures]",this._ds.measures(),this.options.disableMeasuresDropArea)},_fillDropArea:function(dropArea,items,isDisabled){var i,length;dropArea=dropArea.jquery?dropArea:this.element.find(dropArea);dropArea.empty();for(i=0,length=items.length;i<length;i++){this._createMetadataElement(items[i],isDisabled,"appendTo",dropArea)}},_clearMetadata:function(){this.element.find(".ui-igpivotdataselector-metadata").igTree("option","dataSource",[])},_onCatalogSelected:function(catalog,isInit){var $this=this,dataSource=this._ds,callback=function(){$this._fillCombo(".ui-igpivotdataselector-catalog",dataSource.catalogs(),dataSource.catalog());$this._fillCombo(".ui-igpivotdataselector-cube",dataSource.cubes(),dataSource.cube());$this._onCubeSelected($this._getItemName(dataSource.cube()),isInit)};this._clearCombo(".ui-igpivotdataselector-cube");if(catalog===null){callback()}else{dataSource.setCatalog(catalog).done(callback)}},_onCubeSelected:function(cube,isInit){var $this=this,dataSource=this._ds,callback=function(){var measureGroup=dataSource.cube()&&(dataSource.measureGroup()||0),measureGroups=dataSource.measureGroups().slice();measureGroups.splice(0,0,{_caption:$.ig.PivotDataSelector.locale.measureGroupAll,_name:$.ig.PivotDataSelector.locale.measureGroupAll});$this._fillCombo(".ui-igpivotdataselector-measuregroup",measureGroups,measureGroup);$this._onMeasureGroupSelected($this._getItemName(dataSource.measureGroup()),isInit)};this._clearCombo(".ui-igpivotdataselector-measuregroup");if(cube===null){callback()}else{dataSource.setCube(cube).done(callback)}},_onMeasureGroupSelected:function(measureGroup,isInit){var $this=this,dataSource=this._ds,callback=function(){$this._fillMetadata(dataSource.metadataTree());if(!isInit){$this._updateDataSource()}};this._clearMetadata();if(measureGroup===null){callback()}else{dataSource.setMeasureGroup(measureGroup).done(callback)}},_shouldAppendToTarget:function(target,dragged){return target.offset().top+target.height()/2<dragged.offset.top+this._const.dragCursorAt.top},update:function(){this._ds.update()},destroy:function(){this._clearDataSource();this.element.removeClass(this.css.dataSelector);$(this._ds).unbind("updated.dataselector"+this.timestamp);$(this._ds).unbind("initialized.dataselector"+this.timestamp);$.Widget.prototype.destroy.apply(this);return this},_triggerDataSelectorRendered:function(){var args={owner:this};this._trigger("dataSelectorRendered",null,args)},_triggerDeferUpdateChanged:function(deferUpdate){var args={owner:this,deferUpdate:deferUpdate};this._trigger("deferUpdateChanged",null,args)}});$.extend(true,$.ui.igPivotDataSelector.prototype,$.ig.Pivot._pivotShared);$.extend($.ui.igPivotDataSelector,{version:"15.2.20152.1027"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Pivot Grid 15.2.20152.1027
*
* Copyright (c) 2011-2012 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on: 
*	jquery-1.4.4.js
*	jquery.ui.core.js
*	jquery.ui.widget.js
*	jquery.ui.mouse.js
*	jquery.ui.draggable.js
*	jquery.ui.droppable.js
*	modernizr.js (Optional)
*	infragistics.util.js
*	infragistics.datasource.js
*	infragistics.olapxmladatasource.js
*	infragistics.olapflatdatasource.js
*	infragistics.ui.shared.js
*   infragistics.ui.scroll.js
*	infragistics.ui.tree.js
*	infragistics.ui.grid.framework.js
*	infragistics.ui.grid.multicolumnheaders.js
*	infragistics.ui.pivot.shared.js
*/
(function($){function Matrix(){this[0]=[]}Matrix.prototype=[];Matrix.prototype.set=function(row,column,value){if(this.length<row+1){this.setRowCount(row+1)}if(this[0].length<column+1){this.setColumnCount(column+1)}this[row][column]=value};Matrix.prototype.setRowCount=function(rowCount){var i,oldRowCount=this.length;this.length=rowCount;for(i=oldRowCount;i<rowCount;i++){this[i]=[];this[i].length=this[0].length}};Matrix.prototype.setColumnCount=function(columnCount){var i;for(i=0;i<this.length;i++){this[i].length=columnCount}};var _aNull=function(val){return val===null||val===undefined},_igGrid=$.ui.igGrid.prototype.widgetFullName||$.ui.igGrid.prototype.widgetName;$.widget("ui.igPivotGrid",{css:{pivotGrid:"ui-igpivotgrid",pivotGridHeader:"ui-igpivotgrid-header",expandButton:"ui-iggrid-headerbutton ui-icon ui-icon-plus",collapseButton:"ui-iggrid-headerbutton ui-iggrid-headerbuttonexpanded ui-icon ui-icon-minus",rowsAscending:"ui-iggrid-sortindicator ui-icon ui-icon-triangle-1-n",rowsDescending:"ui-iggrid-sortindicator ui-icon ui-icon-triangle-1-s",headerRowsAscending:"ui-iggrid-sortindicator ui-icon ui-icon-triangle-1-n",headerRowsDescending:"ui-iggrid-sortindicator ui-icon ui-icon-triangle-1-s",headerColumnsAscending:"ui-iggrid-sortindicator ui-icon ui-icon-triangle-1-n",headerColumnsDescending:"ui-iggrid-sortindicator ui-icon ui-icon-triangle-1-s",blockArea:"ui-igpivotgrid-blockarea",metadataItem:"ui-igpivot-metadataitem ui-widget ui-corner-all ui-state-default",dropAreaHeader:"ui-igpivot-dropareaheader ui-iggrid-header ui-widget-header",scrollButton:"ui-iggrid-headerbutton",scrollLeft:"ui-icon ui-icon-triangle-1-w",scrollRight:"ui-icon ui-icon-triangle-1-e",dropArea:"ui-igpivot-droparea",overlayDropArea:"ui-igpivot-overlaydroparea",activeDropArea:"active",dropIndicator:"ui-state-highlight",invalidDropIndicator:"ui-state-error",insertItem:"ui-igpivot-insertitem ui-state-highlight ui-corner-all",metadataItemDropDown:"ui-igpivot-metadatadropdown ui-widget ui-widget-content",filterIcon:"ui-icon ui-icon-pivot-smallfilter",filterDropDown:"ui-igpivot-filterdropdown ui-widget ui-widget-content",filterMembers:"ui-igpivot-filtermembers"},options:{width:null,height:null,dataSource:null,dataSourceOptions:{xmlaOptions:{serverUrl:null,catalog:null,cube:null,measureGroup:null,requestOptions:{withCredentials:false,beforeSend:null},enableResultCache:true,discoverProperties:null,executeProperties:null,mdxSettings:{nonEmptyOnRows:true,nonEmptyOnColumns:true,addCalculatedMembersOnRows:true,addCalculatedMembersOnColumns:true,dimensionPropertiesOnRows:[],dimensionPropertiesOnColumns:[]}},flatDataOptions:{dataSource:null,dataSourceUrl:null,dataSourceType:null,responseDataKey:null,responseDataType:null,metadata:{cube:{name:null,caption:null,measuresDimension:{name:null,caption:null,measures:[{name:null,caption:null,aggregator:null,displayFolder:null}]},dimensions:[{name:null,caption:null,hierarchies:[{name:null,caption:null,displayFolder:null,levels:[{name:null,caption:null,memberProvider:null}]}]}]}}},measures:null,filters:null,rows:null,columns:null},deferUpdate:false,isParentInFrontForColumns:false,isParentInFrontForRows:true,compactColumnHeaders:false,compactRowHeaders:true,rowHeadersLayout:null,compactColumnHeaderIndentation:30,compactRowHeaderIndentation:20,rowHeaderLinkGroupIndentation:5,treeRowHeaderIndentation:10,defaultRowHeaderWidth:200,allowSorting:false,firstSortDirection:"ascending",allowHeaderRowsSorting:false,allowHeaderColumnsSorting:false,levelSortDirections:[{levelUniqueName:null,sortDirection:null,sortBehavior:null}],defaultLevelSortBehavior:"alphabetical",firstLevelSortDirection:"ascending",gridOptions:{defaultColumnWidth:null,fixedHeaders:true,caption:null,features:[],tabIndex:0,alternateRowStyles:true,enableHoverStyles:false},dragAndDropSettings:{appendTo:"body",containment:false,zIndex:10},dropDownParent:"body",disableRowsDropArea:false,disableColumnsDropArea:false,disableMeasuresDropArea:false,disableFiltersDropArea:false,hideRowsDropArea:false,hideColumnsDropArea:false,hideMeasuresDropArea:false,hideFiltersDropArea:false,customMoveValidation:null},events:{dataSourceInitialized:null,dataSourceUpdated:null,pivotGridHeadersRendered:null,pivotGridRendered:null,tupleMemberExpanding:null,tupleMemberExpanded:null,tupleMemberCollapsing:null,tupleMemberCollapsed:null,sorting:null,sorted:null,headersSorting:null,headersSorted:null,dragStart:null,drag:null,dragStop:null,metadataDropping:null,metadataDropped:null,metadataRemoving:null,metadataRemoved:null,filterDropDownOpening:null,filterDropDownOpened:null,filterMembersLoaded:null,filterDropDownOk:null,filterDropDownClosing:null,filterDropDownClosed:null},_const:{emptyCell:{headerText:"&nbsp;",key:"empty_cell",axisName:"empty_axis",memberIndex:0,tupleIndex:0},hoverScrollOffset:5,hoverScrollInterval:50},_headerScrollOffsets:{},_gridScrollOffsets:{top:0,left:0},_create:function(){var $this=this;this._onFiltersChanged=function(collection,collectionChangedArgs){var dropArea=$("#"+$this.element.attr("id")+"_filters .ui-igpivot-droparea");$this._onDataSourceCollectionChanged(collection,collectionChangedArgs,dropArea,$this.options.disableFiltersDropArea);$this._updateDropArea(dropArea,$this._ds.filters(),$this.options.disableFiltersDropArea,$this.options.disableFiltersDropArea?$.ig.PivotGrid.locale.disabledFiltersHeader:$.ig.PivotGrid.locale.filtersHeader)};this._onRowAxisChanged=function(collection,collectionChangedArgs){var dropArea=$("#"+$this.element.attr("id")+"_rows .ui-igpivot-droparea");$this._onDataSourceCollectionChanged(collection,collectionChangedArgs,dropArea,$this.options.disableRowsDropArea);$this._updateDropArea(dropArea,$this._ds.rowAxis(),$this.options.disableRowsDropArea,$this.options.disableRowsDropArea?$.ig.PivotGrid.locale.disabledRowsHeader:$.ig.PivotGrid.locale.rowsHeader)};this._onColumnAxisChanged=function(collection,collectionChangedArgs){var dropArea=$("#"+$this.element.attr("id")+"_columns .ui-igpivot-droparea");$this._onDataSourceCollectionChanged(collection,collectionChangedArgs,dropArea,$this.options.disableColumnsDropArea);$this._updateDropArea(dropArea,$this._ds.columnAxis(),$this.options.disableColumnsDropArea,$this.options.disableColumnsDropArea?$.ig.PivotGrid.locale.disabledColumnsHeader:$.ig.PivotGrid.locale.columnsHeader);$this._columnsChanged=true};this._onMeasuresChanged=function(collection,collectionChangedArgs){var dropArea=$("#"+$this.element.attr("id")+"_measures .ui-igpivot-droparea");$this._onDataSourceCollectionChanged(collection,collectionChangedArgs,dropArea,$this.options.disableMeasuresDropArea);$this._updateDropArea(dropArea,$this._ds.measures(),$this.options.disableMeasuresDropArea,$this.options.disableMeasuresDropArea?$.ig.PivotGrid.locale.disabledMeasuresHeader:$.ig.PivotGrid.locale.measuresHeader)};this.element.addClass(this.css.pivotGrid);this._setDataSource()},_setOption:function(key,value){var grid;switch(key){case"dataSource":this._clearDataSource();this.options.dataSourceOptions=null;this.options.dataSource=this._createDataSource(value,null);this._setDataSource();break;case"dataSourceOptions":this._clearDataSource();this.options.dataSourceOptions=value;this.options.dataSource=this._createDataSource(null,value);this._setDataSource();break;case"deferUpdate":$.Widget.prototype._setOption.apply(this,arguments);if(value===false){this.updateGrid()}break;case"width":case"height":$.Widget.prototype._setOption.apply(this,arguments);grid=this.grid();if(grid){grid.option(key,value)}break;case"levelSortDirections":case"isParentInFrontForColumns":case"isParentInFrontForRows":case"compactColumnHeaders":case"compactRowHeaders":case"rowHeadersLayout":$.Widget.prototype._setOption.apply(this,arguments);this._createTableView(this._ds);this._onGridUpdated();break;case"dragAndDropSettings":$.Widget.prototype._setOption.apply(this,arguments);this.element.find(":ui-draggable").each(function(ind,el){var draggable=$(el);draggable.draggable("option","appendTo",value.appendTo);draggable.draggable("option","containment",value.containment);draggable.draggable("option","zIndex",value.zIndex)});break;default:$.Widget.prototype._setOption.apply(this,arguments);this._onGridUpdated();break}},_setDataSource:function(){var $this=this,dataSource;this._renderEmptyGrid();this._ds=dataSource=this._createDataSource(this.options.dataSource,this.options.dataSourceOptions);if(!dataSource){return}if(this.options.rowHeadersLayout==="tree"&&dataSource.dataSource().measureListLocation()===0&&dataSource.dataSource().sourceOptions().measures()&&dataSource.dataSource().sourceOptions().measures().contains(",")){this._ds.setMeasureListIndex(0)}this.timestamp=(new Date).getTime();$(dataSource).bind("initialized.pivotgrid"+this.timestamp,function(evt,evtArgs){var args=$.extend({owner:$this,dataSource:$this._ds},evtArgs);$this._triggerDataSourceInitialized(evt,args);$this._onGridUpdated()});$(dataSource).bind("updated.pivotgrid"+this.timestamp,function(evt,evtArgs){var args=$.extend({owner:$this,dataSource:$this._ds},evtArgs);$this._triggerDataSourceUpdated(evt,args);$this._onGridUpdated()});if(dataSource.isInitialized()){dataSource.bindCollectionChanged({filters:this._onFiltersChanged,rowAxis:this._onRowAxisChanged,columnAxis:this._onColumnAxisChanged,measures:this._onMeasuresChanged});this._onGridUpdated()}else{this._updateGrid(true).always(function(){dataSource.bindCollectionChanged({filters:$this._onFiltersChanged,rowAxis:$this._onRowAxisChanged,columnAxis:$this._onColumnAxisChanged,measures:$this._onMeasuresChanged})})}},_updateDropArea:function(dropArea,items,isDisabled,emptyMessage){if(!this._ds.isUpdating()&&!$.ig.util.isTouchDevice()){dropArea.empty().css({display:"",overflow:"",margin:"",padding:""}).siblings().remove();this._fillDropArea(dropArea,items,isDisabled,emptyMessage);this._measureDropArea(dropArea)}},_clearDataSource:function(){var grid=this.grid();if(this._ds){$(this._ds).unbind("updated.pivotgrid");this._ds.unbindCollectionChanged({filters:this._onFiltersChanged,rowAxis:this._onRowAxisChanged,columnAxis:this._onColumnAxisChanged,measures:this._onMeasuresChanged})}if(grid){grid.destroy();this.element.empty()}},_createTableView:function(dataSource){var viewSettings,hasColumns,hasRows,rowHeadersLayout,map,appliedColumnSortDirections,appliedLevelSortDirections,userLevelSortDirections,mergedLevelSortDirections;appliedColumnSortDirections=this._columnsChanged?[]:this.appliedColumnSortDirections();map=function(array){var i,m={};if($.isArray(array)){for(i=0;i<array.length;i++){if(!_aNull(array[i].levelUniqueName)){m[array[i].levelUniqueName]=array[i]}}}return m};appliedLevelSortDirections=map(this.appliedLevelSortDirections());userLevelSortDirections=map(this.options.levelSortDirections);mergedLevelSortDirections=$.extend(userLevelSortDirections,appliedLevelSortDirections);mergedLevelSortDirections=$.map(mergedLevelSortDirections,function(sd){return sd});rowHeadersLayout=this._resolveRowHeadersLayout();viewSettings={compactRowHeaderIndentation:this.options.compactRowHeaderIndentation,isParentInFrontForColumns:this.options.isParentInFrontForColumns,treeRowHeaderIndentation:this.options.treeRowHeaderIndentation,isParentInFrontForRows:this.options.isParentInFrontForRows,compactColumnHeaders:this.options.compactColumnHeaders,rowHeadersLayout:rowHeadersLayout};hasColumns=dataSource.columnAxis().length>0;hasRows=dataSource.rowAxis().length>0;this._tableView=new $.ig.OlapTableView(dataSource.result(),hasColumns,hasRows,viewSettings);this._tableView.columnSortDirections(appliedColumnSortDirections);this._tableView.levelSortDirections(mergedLevelSortDirections);this._tableView.initialize();this._columnsChanged=false},_resolveRowHeadersLayout:function(){if(this.options.rowHeadersLayout!==undefined&&this.options.rowHeadersLayout!==null){return this.options.rowHeadersLayout}if(this.options.compactRowHeaders===true){return"superCompact"}return"standard"},_configureOptions:function(dataSource){var $this=this,cols,dataCols,data,settings,gridDataSource,options;this._rowsMatrix=new Matrix;this._fillMatrixWithHeaderCells(this._rowsMatrix,this._tableView.rowHeaders());this._maxMemberIndex=dataSource.columnAxis().length-1;cols=this._generateAllGridColumns(this._tableView.columnHeaders());dataCols=this._generateDataColumns(this._tableView.columnHeaders());data=this._transformGridData(this._tableView.resultCells(),dataCols,dataCols.length,this._rowsMatrix.length);settings={dataSource:data};gridDataSource=new $.ig.DataSource(settings);options={headerRendered:function(event,ui){if($this._ds){$this._onGridHeadersRendered(event,ui)}},dataRendered:function(event,ui){if($this._ds){$this._onDataRendered(event,ui)}}};$.extend(true,options,this.options.gridOptions);options.dataSource=gridDataSource;options.columns=cols;options.autoGenerateColumns=false;options.virtualization=false;options.fixedFooters=false;options.autoFormat=false;options.renderCheckBoxes=false;options.autoFitLastColumn=false;options.autoAdjustHeight=true;options.width=this.options.width;options.height=this.options.height;$.merge(options.features,[{name:"MultiColumnHeaders"}]);return options},_addSortingMarkup:function(sortingMarkupSettings){var sortMap=sortingMarkupSettings.sortMap,stringTemplate=sortingMarkupSettings.stringTemplate,sortDirection,replaceString=sortingMarkupSettings.replaceString,markup=sortingMarkupSettings.markup;if(sortingMarkupSettings.condition){sortDirection=sortMap[sortingMarkupSettings.axisName];if(sortDirection){sortDirection=sortDirection[sortingMarkupSettings.hierarchyOffset];if(sortDirection){sortDirection=sortDirection[sortingMarkupSettings.levelNumber]}}if(sortDirection==="ascending"){markup=markup.replace(stringTemplate,replaceString+"='ascending'");markup+=sortingMarkupSettings.ascIcon}else if(sortDirection==="descending"){markup=markup.replace(stringTemplate,replaceString+"='descending'");markup+=sortingMarkupSettings.descIcon}else if(this.options.allowHeaderRowsSorting){markup=markup.replace(stringTemplate,replaceString+"=''")}}else{markup=markup.replace(stringTemplate,"")}return markup},_fillMatrixWithHeaderCells:function(matrix,headerCells){var expandIcon,expandItemIcon,collapseIcon,collapseItemIcon,sortHeaderRowsAscendingIcon,sortHeaderRowsDescendingIcon,itemSortHeaderRowsAscendingIcon,itemSortHeaderRowsDescendingIcon,headerCell,levelSortDirectionsMap,headerMarkup,text,rowSpan,columnSpan,rowIndex,columnIndex,hierarchy,endNodeIndent,headerCellIndent,headerCellLinkIndent,axisName,tupleIndex,memberIndex,css,applyIndent,isExpandable,isItemExpandable,isExpanded,isItemExpanded,isTreeLayout,expandButtonMarkup,itemExpandButtonMarkup,indent,i,linkText,dataSource=this._ds,$this=this,expandedItems,sortingMarkupSettings;if(!headerCells||headerCells.length===0){matrix.set(0,0,"<th class='ui-iggrid-header ui-widget-header'></th>");return}expandIcon="<span data-expand='true' class='"+this.css.expandButton+"' style='margin-left: $$margin$$px;'></span>";collapseIcon="<span data-expand='false' class='"+this.css.collapseButton+"' style='margin-left: $$margin$$px;'></span>";expandItemIcon="<span data-item-expand='true' class='"+this.css.expandButton+"' style='margin-left: $$margin$$px;'></span>";collapseItemIcon="<span data-item-expand='false' class='"+this.css.collapseButton+"' style='margin-left: $$margin$$px;'></span>";sortHeaderRowsAscendingIcon="<span data-sortheader='asc' class='"+this.css.headerRowsAscending+"'></span>";sortHeaderRowsDescendingIcon="<span data-sortheader='desc' class='"+this.css.headerRowsDescending+"'></span>";itemSortHeaderRowsAscendingIcon="<span data-item-sortheader='asc' class='"+this.css.headerRowsAscending+"'></span>";itemSortHeaderRowsDescendingIcon="<span data-item-sortheader='desc' class='"+this.css.headerRowsDescending+"'></span>";isTreeLayout=this.options.rowHeadersLayout==="tree";if(isTreeLayout){expandedItems={};for(i=0;i<headerCells.length;i++){if(headerCells[i].isItemExpanded()){expandedItems[i]=headerCells[i].levelNumber()}}}levelSortDirectionsMap=this._tableView.appliedSortDirectionsMap();applyIndent=!(this.options.rowHeadersLayout==="standard"||this.options.rowHeadersLayout===null&&this.options.compactRowHeaders===false);for(i=0;i<headerCells.length;i++){headerCell=headerCells[i];text=headerCell.caption();rowSpan=headerCell.rowSpan();columnSpan=headerCell.columnSpan();rowIndex=headerCell.rowIndex();columnIndex=headerCell.columnIndex();axisName=headerCell.axisName();tupleIndex=headerCell.tupleIndex();memberIndex=headerCell.memberIndex();isExpandable=headerCell.isExpandable();isExpanded=headerCell.isExpanded();headerCellIndent=isTreeLayout?headerCell.indent():this.options.compactRowHeaderIndentation*headerCell.levelNumber();if(this.options.rowHeaderLinkGroupIndentation){headerCellLinkIndent=this.options.rowHeaderLinkGroupIndentation}if(isTreeLayout){isItemExpandable=headerCell.isItemExpandable();isItemExpanded=headerCell.isItemExpanded()}css="ui-iggrid-header ui-widget-header "+this.css.pivotGridHeader;headerMarkup="<th $$data-sortheader$$ $$data-item-sortheader$$ "+"class='"+css+"' "+"title='"+text+"' "+"data-skip='true' "+"rowspan='"+rowSpan+"' "+"colspan='"+columnSpan+"' "+"data-axis='"+axisName+"' "+"data-tuple='"+tupleIndex+"' "+"data-member='"+memberIndex+"'>";if(isItemExpandable){indent=applyIndent?headerCell.indent():0;itemExpandButtonMarkup=isItemExpanded?collapseItemIcon:expandItemIcon;itemExpandButtonMarkup=itemExpandButtonMarkup.replace("$$margin$$",indent);headerMarkup+=itemExpandButtonMarkup}if(isExpandable){if(isTreeLayout){headerMarkup+="<span class='ui-iggrid-headertext'>"+text+"</span>";sortingMarkupSettings={condition:isItemExpanded,sortMap:levelSortDirectionsMap,axisName:headerCell.axisName(),hierarchyOffset:headerCell.hierarchyNumber()+1,levelNumber:headerCell.levelNumber()-expandedItems[i],replaceString:"data-sortheader",stringTemplate:"$$data-sortheader$$",markup:headerMarkup,ascIcon:sortHeaderRowsAscendingIcon,descIcon:sortHeaderRowsDescendingIcon};headerMarkup=$this._addSortingMarkup(sortingMarkupSettings);expandButtonMarkup=isExpanded?collapseIcon:expandIcon;expandButtonMarkup=expandButtonMarkup.replace("$$margin$$",headerCellLinkIndent);headerMarkup+=expandButtonMarkup;hierarchy=dataSource.rowAxis()[headerCell.memberIndex()];linkText=dataSource.getCoreElement(function(element){return element.hierarchyUniqueName()===hierarchy.uniqueName()&&element.depth()===headerCell.levelNumber()+1},$.ig.Level.prototype.getType());if(linkText){headerMarkup+="<span class='ui-igpivot-rowheaderlink'>"+linkText.caption()+"</span>"}sortingMarkupSettings={condition:isExpanded,sortMap:levelSortDirectionsMap,axisName:headerCell.axisName(),hierarchyOffset:headerCell.hierarchyNumber(),levelNumber:headerCell.levelNumber(),replaceString:"data-item-sortheader",stringTemplate:"$$data-item-sortheader$$",markup:headerMarkup,ascIcon:itemSortHeaderRowsAscendingIcon,descIcon:itemSortHeaderRowsDescendingIcon};headerMarkup=$this._addSortingMarkup(sortingMarkupSettings)}else{indent=applyIndent?headerCellIndent:0;expandButtonMarkup=isExpanded?collapseIcon:expandIcon;expandButtonMarkup=expandButtonMarkup.replace("$$margin$$",indent);headerMarkup+=expandButtonMarkup;headerMarkup+="<span class='ui-iggrid-headertext' style='display:inline;'>"+text+"</span>";sortingMarkupSettings={condition:isExpanded,sortMap:levelSortDirectionsMap,axisName:headerCell.axisName(),hierarchyOffset:headerCell.hierarchyNumber(),levelNumber:headerCell.levelNumber(),replaceString:"data-sortheader",stringTemplate:"$$data-sortheader$$",markup:headerMarkup,ascIcon:sortHeaderRowsAscendingIcon,descIcon:sortHeaderRowsDescendingIcon};headerMarkup=$this._addSortingMarkup(sortingMarkupSettings)}}else if(!isTreeLayout||isTreeLayout&&itemExpandButtonMarkup&&itemExpandButtonMarkup.contains("$$margin$$")){indent=applyIndent?headerCellIndent:0;text="<span class='ui-iggrid-headertext' style='margin-left:"+indent+"px;'>"+text+"</span>";headerMarkup+=text}else{headerMarkup+="<span class='ui-iggrid-headertext'>"+text+"</span>"}if(isTreeLayout&&(isExpandable&&!isItemExpandable||!isExpandable&&!isItemExpandable)){indent=applyIndent?headerCellIndent:0;endNodeIndent=$(".ui-iggrid-headerbutton.ui-icon").eq(0).width()+indent;headerMarkup=headerMarkup.replace("class='ui-iggrid-headertext'","class='ui-iggrid-headertext' style='margin-left:"+endNodeIndent+"px;'")}sortingMarkupSettings={condition:isTreeLayout&&isItemExpanded&&headerMarkup.contains("$$data-item-sortheader$$"),sortMap:levelSortDirectionsMap,axisName:headerCell.axisName(),hierarchyOffset:headerCell.hierarchyNumber()+1,levelNumber:headerCell.levelNumber()-1>0?headerCell.levelNumber()-1:0,replaceString:"data-sortheader",stringTemplate:"$$data-item-sortheader$$",markup:headerMarkup,ascIcon:sortHeaderRowsAscendingIcon,descIcon:sortHeaderRowsDescendingIcon};headerMarkup=$this._addSortingMarkup(sortingMarkupSettings);sortingMarkupSettings={condition:isTreeLayout&&isItemExpanded&&headerMarkup.contains("$$data-item-sortheader$$"),sortMap:levelSortDirectionsMap,axisName:headerCell.axisName(),hierarchyOffset:headerCell.hierarchyNumber()+1,levelNumber:headerCell.levelNumber()-1>0?headerCell.levelNumber()-1:0,replaceString:"data-item-sortheader",stringTemplate:"$$data-item-sortheader$$",markup:headerMarkup,ascIcon:itemSortHeaderRowsAscendingIcon,descIcon:itemSortHeaderRowsDescendingIcon};headerMarkup=$this._addSortingMarkup(sortingMarkupSettings);headerMarkup+="</th>";matrix.set(rowIndex+rowSpan-1,columnIndex+columnSpan-1,undefined);matrix.set(rowIndex,columnIndex,headerMarkup)}},_generateAllGridColumns:function(headers){var cols,levels=[],i;if(!headers||headers.length===0){return[this._const.emptyCell]}for(i=0;i<headers.length;i++){if(!levels[headers[i].rowIndex()]){levels[headers[i].rowIndex()]=[]}levels[headers[i].rowIndex()].push(headers[i])}this._maxLevel=levels.length;cols=this._processHeadersTree(levels);return cols},_generateDataColumns:function(headers){var cols=[],i;if(!headers||headers.length===0){return[this._const.emptyCell]}for(i=0;i<headers.length;i++){if(headers[i].memberIndex()!==this._maxMemberIndex){continue}if(headers[i].columnSpan()===1&&(headers[i].isExpandable()===false||!headers[i].isExpanded())){cols.push({headerText:headers[i].caption(),key:headers[i].axisName()+"_"+headers[i].tupleIndex()+"_"+headers[i].memberIndex()+"_"+headers[i].isExpandable()})}else if(this.options.compactColumnHeaders){cols.push({headerText:headers[i].caption(),key:headers[i].axisName()+"_"+headers[i].tupleIndex()+"_"+headers[i].memberIndex()+"_"+headers[i].isExpandable()})}}return cols},_transformGridData:function(cells,columns,columnsCount,maxRowCount){var data=[],cellOrdinal,i,colIndex;if(!cells||cells.length===0){if(maxRowCount>0){for(i=0;i<maxRowCount;i++){data.push({})}return data}return[{}]}for(i=0;i<maxRowCount;i++){data.push({})}for(i=0;i<cells.length;i++){cellOrdinal=cells[i].cellOrdinal();colIndex=cellOrdinal%columnsCount;data[Math.floor(cellOrdinal/columnsCount)][columns[colIndex].key]=cells[i].formattedValue()}return data},_processHeadersTree:function(tree){var cols=[],i,j,parent,parents;for(i=0;tree.length>=1&&i<tree[0].length;i++){this._createHeader(cols,tree[0][i])}for(i=1;i<tree.length;i++){parents=this._parentsForLevel(i,cols);for(j=0;j<tree[i].length;j++){parent=this._findParent(parents,tree[i][j]);if(parent){this._createHeader(parent,tree[i][j])}else{if(i-1>=1){this._findAndCreateUp(i-1,i,cols,tree,tree[i][j])}}}}return cols},_findAndCreateUp:function(level,itemsLevel,cols,tree,item){var parents,j,currentItem,parent;parents=this._parentsForLevel(level,cols);for(j=0;j<tree[itemsLevel].length;j++){currentItem=tree[itemsLevel][j];if(currentItem.axisName()===item.axisName()&&currentItem.columnIndex()===item.columnIndex()&&currentItem.memberIndex()===item.memberIndex()&&currentItem.tupleIndex()===item.tupleIndex()&&currentItem.caption()===item.caption()){parent=this._findParent(parents,currentItem,itemsLevel-level+1);if(parent){this._createHeader(parent,currentItem)}else{if(level-1>=1){this._findAndCreateUp(level-1,itemsLevel,cols,tree,item)}}}}},_parentsForLevel:function(level,root){var parents=[],i;for(i=0;i<root.length;i++){this._parentsForLevelRecursive(parents,root[i],1,level)}return parents},_parentsForLevelRecursive:function(parents,currentParent,currentLevel,level){var extraLevel=currentParent.rowspan>1?currentParent.rowspan-1:0,i;if(currentLevel===level){parents.push(currentParent)}else if(currentLevel<level&&currentParent.group!==null&&currentParent.group!==undefined){for(i=0;i<currentParent.group.length;i++){this._parentsForLevelRecursive(parents,currentParent.group[i],currentLevel+1+extraLevel,level)}}},_createHeader:function(parent,col){var column={headerText:col.caption(),key:col.axisName()+"_"+col.tupleIndex()+"_"+col.memberIndex()+"_"+col.isExpandable(),rowspan:col.rowSpan(),colSpan:col.columnSpan(),colIndex:col.columnIndex(),axisName:col.axisName(),tupleIndex:col.tupleIndex(),memberIndex:col.memberIndex(),expandable:col.isExpandable(),expanded:col.isExpanded(),hierarchyNumber:col.hierarchyNumber(),levelNumber:col.levelNumber()};if(!this.options.compactColumnHeaders&&(col.columnSpan()>1||col.columnSpan()===1&&col.isExpanded()&&col.isExpandable())){column.group=[]}parent.push(column)},_findParent:function(cols,header,rowSpan){var i;if(!cols||cols.length===undefined||cols.length===null){return null}for(i=0;i<cols.length;i++){if(rowSpan===undefined||rowSpan!==undefined&&cols[i].rowspan===rowSpan){if(cols[i].colSpan+cols[i].colIndex>=header.columnSpan()+header.columnIndex()&&cols[i].colIndex<=header.columnIndex()){if(!cols[i].group){cols[i].group=[]}return cols[i].group}}}return null},grid:function(){return this.element.data(_igGrid)},updateGrid:function(){this._updateGrid(false,true)},_updateGrid:function(init,deferUpdateOverride){var dataSource=this._ds,container,shouldUpdate=deferUpdateOverride||this.options.deferUpdate===false,promise;if(!init&&!shouldUpdate){return}if(this.element.data(_igGrid)){container=this.grid().container();$("#"+this.grid().element.attr("id")+"_columns_overlay").css("display","none");$("#"+this.grid().element.attr("id")+"_measures_overlay").css("display","none");container.css("position","relative");$("<div class='"+this.css.blockArea+"'></div>").appendTo(container).data("efh","1")}if(init){promise=dataSource.initialize()}else{promise=dataSource.update()}return promise},_onGridUpdated:function(){var dataSource=this._ds,options;this._createTableView(dataSource);options=this._configureOptions(dataSource);this._renderGrid(options)},_renderEmptyGrid:function(){var options;options=$.extend(true,{},this.options.gridOptions);options.width=this.options.width;options.height=this.options.height;this.element.igGrid(options)},_renderGrid:function(options){var id=this.element.attr("id"),grid,container;grid=this.grid();if(grid){this._gridScrollOffsets.top=grid.scrollContainer().scrollTop();this._gridScrollOffsets.left=$("#"+id+"_hscroller").scrollLeft();this.element.igGrid("destroy");this.element.empty()}this.element.igGrid(options);container=this.grid().container();container.addClass(this.css.pivotGrid);this._makeDroppable(container)},_onGridHeadersRendered:function(event,ui){var $this=this,headers=ui.owner._oldCols,table=ui.table,id=this.element.attr("id"),appliedColumnSortDirectionsMap,first,firstParent,rowsCellColSpan,rowsCellRowSpan,columnsCellColSpan,filtersCellColSpan,row,droppableOptions,dropArea,header,dataSource=this._ds,extraColsCount,colgroup,col,i,length,sortableHeaders;table.addClass(this.css.pivotGrid);ui.owner._renderRecord=function(data,rowIndex){return $this._renderPivotRecord.call(this,$this._rowsMatrix,data,rowIndex)};if(headers===null||headers===undefined){headers=ui.owner.options.columns}appliedColumnSortDirectionsMap={};$.each(this._tableView.appliedColumnSortDirections(),function(ind,csd){appliedColumnSortDirectionsMap[csd.tupleIndex]=csd.sortDirection});this._processHeaderMarkupRecursive(this.grid().element[0].id,headers,appliedColumnSortDirectionsMap,this._tableView.appliedSortDirectionsMap());first=table.find("tr").first();firstParent=first.parent();rowsCellColSpan=this._rowsMatrix.length>0?this._rowsMatrix[0].length:1;rowsCellRowSpan=this._maxLevel;columnsCellColSpan=ui.owner.options.columns.length;filtersCellColSpan=rowsCellColSpan+columnsCellColSpan;if(table.find(".ui-igpivot-droparea[data-role=rows], .ui-igpivot-droparea[data-role=columns], .ui-igpivot-droparea[data-role=measures], .ui-igpivot-droparea[data-role=filters]").length===0){droppableOptions=this._createDropAreaOptions();if(!this.options.hideRowsDropArea){header=$("<th id='"+id+"_rows' rowSpan='"+rowsCellRowSpan+"' colSpan='"+rowsCellColSpan+"' data-skip='true' class='"+this.css.dropAreaHeader+"'></th>").prependTo(first);header.height(header.height());dropArea=$("<ul data-role='rows' class='"+this.css.dropArea+"'></ul>").appendTo(header);if(!this.options.disableRowsDropArea&&!$.ig.util.isTouchDevice()){dropArea.droppable(droppableOptions)}}else{$("<th rowSpan='"+rowsCellRowSpan+"' colSpan='"+rowsCellColSpan+"' data-skip='true' class='ui-iggrid-header ui-widget-header'></th>").prependTo(first)}if(!this.options.hideColumnsDropArea||!this.options.hideMeasuresDropArea){row=$("<tr></tr>").prependTo(firstParent)}if(!this.options.hideColumnsDropArea){header=$("<th id='"+id+"_columns' rowSpan='1' colSpan='"+columnsCellColSpan+"' data-skip='true' class='"+this.css.dropAreaHeader+"'></th>").prependTo(row);dropArea=$("<ul data-role='columns' class='"+this.css.dropArea+"'></ul>").appendTo(header);if(!this.options.disableColumnsDropArea&&!$.ig.util.isTouchDevice()){dropArea.droppable(droppableOptions);if($("#"+id+"_columns_overlay").length<1){$("<div id='"+id+"_columns_overlay' data-role='columns' class='"+this.css.overlayDropArea+" ui-igpivot-droparea ui-droppable'></div>").appendTo(this.element).droppable(droppableOptions)}}}else if(!this.options.hideMeasuresDropArea){$("<th rowSpan='1' colSpan='"+columnsCellColSpan+"' data-skip='true' class='ui-iggrid-header ui-widget-header'></th>").prependTo(row)}if(!this.options.hideMeasuresDropArea){header=$("<th id='"+id+"_measures' rowSpan='1' colSpan='"+rowsCellColSpan+"' data-skip='true' class='"+this.css.dropAreaHeader+"'></th>").prependTo(row);dropArea=$("<ul data-role='measures' class='"+this.css.dropArea+"'></ul>").appendTo(header);if(!this.options.disableMeasuresDropArea&&!$.ig.util.isTouchDevice()){dropArea.droppable(droppableOptions)}}else if(!this.options.hideColumnsDropArea){$("<th rowSpan='1' colSpan='"+rowsCellColSpan+"' data-skip='true' class='ui-iggrid-header ui-widget-header'></th>").prependTo(row)}if(!this.options.hideFiltersDropArea){row=$("<tr></tr>").prependTo(firstParent);header=$("<th id='"+id+"_filters' rowSpan='1' colSpan='"+filtersCellColSpan+"' data-skip='true' class='"+this.css.dropAreaHeader+"'></th>").prependTo(row);dropArea=$("<ul data-role='filters' class='"+this.css.dropArea+"'></ul>").appendTo(header);if(!this.options.disableFiltersDropArea&&!$.ig.util.isTouchDevice()){dropArea.droppable(droppableOptions)}}}else{$("#"+id+"_rows").attr("rowSpan",rowsCellRowSpan).attr("colSpan",rowsCellColSpan);$("#"+id+"_columns").attr("rowSpan",1).attr("colSpan",columnsCellColSpan);$("#"+id+"_measures").attr("rowSpan",1).attr("colSpan",rowsCellColSpan);$("#"+id+"_fiters").attr("rowSpan",1).attr("colSpan",filtersCellColSpan)}colgroup=table.find("colgroup");if(colgroup.length===0){if(this.grid()._isMultiColumnGrid){length=table.find("th[data-isheadercell]").length}else{length=headers.length}colgroup="<colgroup>";for(i=0;i<length;i++){colgroup+="<col></col>"}colgroup+="</colgroup>";colgroup=$(colgroup).prependTo(table)}extraColsCount=this._rowsMatrix.length>0?this._rowsMatrix[0].length:1;for(i=0;i<extraColsCount;i++){col=$("<col></col>").prependTo(colgroup).attr("data-skip","true")}if(extraColsCount){colgroup.attr("data-cols-injected","true")}if(this.options.allowSorting){sortableHeaders=table.find(".ui-igpivotgrid-header[data-sort]");sortableHeaders.children(".ui-iggrid-headertext,.ui-iggrid-sortindicator").bind("click",function(evt){$this._onSort(evt)
});sortableHeaders.filter("[data-axis='empty_axis']").bind("click",function(evt){$this._onSort(evt)})}if(this.options.allowHeaderColumnsSorting){table.find(".ui-igpivotgrid-header[data-sortheader]").children(".ui-iggrid-headertext,.ui-iggrid-sortindicator").bind("click",function(evt){$this._onSortHeader(evt)})}if(!this.options.hideFiltersDropArea){this._fillDropArea("#"+id+"_filters .ui-igpivot-droparea",dataSource.filters(),this.options.disableFiltersDropArea,this.options.disableFiltersDropArea?$.ig.PivotGrid.locale.disabledFiltersHeader:$.ig.PivotGrid.locale.filtersHeader)}if(!this.options.hideRowsDropArea){this._fillDropArea("#"+id+"_rows .ui-igpivot-droparea",dataSource.rowAxis(),this.options.disableRowsDropArea,this.options.disableRowsDropArea?$.ig.PivotGrid.locale.disabledRowsHeader:$.ig.PivotGrid.locale.rowsHeader)}if(!this.options.hideColumnsDropArea){this._fillDropArea("#"+id+"_columns .ui-igpivot-droparea",dataSource.columnAxis(),this.options.disableColumnsDropArea,this.options.disableColumnsDropArea?$.ig.PivotGrid.locale.disabledColumnsHeader:$.ig.PivotGrid.locale.columnsHeader)}if(!this.options.hideMeasuresDropArea){this._fillDropArea("#"+id+"_measures .ui-igpivot-droparea",dataSource.measures(),this.options.disableMeasuresDropArea,this.options.disableMeasuresDropArea?$.ig.PivotGrid.locale.disabledMeasuresHeader:$.ig.PivotGrid.locale.measuresHeader)}this._measureHeaders(headers);table.find("thead span.ui-iggrid-headerbutton.ui-icon").bind("click",function(evt){$this._onToggleTupleMember(evt);return false});this._triggerPivotGridHeadersRendered(event,ui)},_renderPivotRecord:function(matrix,data,rowIndex){var i,key=this.options.primaryKey,temp,grid=this,dstr="",cols=this.options.columns,noVisibleColumns,str="";dstr+="<tr";if(rowIndex%2!==0&&this.options.alternateRowStyles){dstr+=" class='"+grid.css.recordAltClass+"'"}if(!_aNull(key)){dstr+=" data-id='"+this._kval_from_key(key,data)+"'"}else if(!_aNull(data.ig_pk)){dstr+=" data-id='"+data.ig_pk+"'"}if(this.options.virtualization&&this.options.virtualizationMode==="continuous"){dstr+=" data-row-idx='"+rowIndex+"'"}dstr+=" role='row'>";for(i=0;i<matrix[rowIndex].length;i++){if(matrix[rowIndex][i]){str+=matrix[rowIndex][i]}}if(str!==""){dstr+=str}noVisibleColumns=true;$(cols).each(function(colIndex){if(cols[colIndex].hidden||cols[colIndex].fixed===true){return}noVisibleColumns=false;dstr+='<td role="gridcell" aria-describedby="'+grid.id()+"_"+this.key+'" tabindex="'+grid.options.tabIndex+'"';if(cols[colIndex].template&&cols[colIndex].template.length){temp=grid._renderTemplatedCell(data,this);if(temp.indexOf("<td")===0){dstr+=temp.substring(3)}else{dstr+=">"+temp}dstr=grid._editCellStyle(dstr,data,this.key)}else{dstr+=grid._addCellStyle(data,this.key?this.key:colIndex,cols[colIndex])+">"+grid._renderCell(data[this.key?this.key:colIndex],this,data)}dstr+="</td>"});if(noVisibleColumns){dstr+="<td role='gridcell'></td>"}dstr+="</tr>";return dstr},_processHeaderMarkupRecursive:function(tableId,headers,columnSortDirectionsMap,levelSortDirectionsMap){var i,headerCell,expanded,expandable,sortDirection,expandIcon,collapseIcon,allowSorting,allowHeaderColumnsSorting,sortRowsAscendingIcon,sortRowsDescendingIcon,sortHeaderColumnsAscendingIcon,sortHeaderColumnsDescendingIcon;allowSorting=this.options.allowSorting;allowHeaderColumnsSorting=this.options.allowHeaderColumnsSorting;expandIcon="<span data-expand='true' class='"+this.css.expandButton+"'/>";collapseIcon="<span data-expand='false' class='"+this.css.collapseButton+"'/>";sortRowsAscendingIcon="<span data-sort='asc' class='"+this.css.rowsAscending+"'/>";sortRowsDescendingIcon="<span data-sort='desc' class='"+this.css.rowsDescending+"'/>";sortHeaderColumnsAscendingIcon="<span data-sortheader='asc' class='"+this.css.headerColumnsAscending+"'></span>";sortHeaderColumnsDescendingIcon="<span data-sortheader='desc' class='"+this.css.headerColumnsDescending+"'></span>";for(i=0;i<headers.length;i++){headerCell=$("#"+tableId+"_"+headers[i].key);headerCell.addClass(this.css.pivotGridHeader).attr("data-axis",headers[i].axisName).attr("data-member",headers[i].memberIndex).attr("data-tuple",headers[i].tupleIndex);if(headers[i].axisName!==this._const.emptyCell.axisName){headerCell.attr("title",headers[i].headerText)}if(this.options.compactColumnHeaders&&headers[i].levelNumber>0){headerCell.css("padding-top",this.options.compactColumnHeaderIndentation*headers[i].levelNumber)}expandable=headers[i].expandable;expanded=headers[i].expanded;if(expandable&&!expanded){$(expandIcon).insertBefore(headerCell.children(".ui-iggrid-headertext"))}else if(expandable&&expanded){$(collapseIcon).insertBefore(headerCell.children(".ui-iggrid-headertext"));sortDirection=levelSortDirectionsMap[headers[i].axisName];if(sortDirection){sortDirection=sortDirection[headers[i].hierarchyNumber];if(sortDirection){sortDirection=sortDirection[headers[i].levelNumber]}}if(sortDirection==="ascending"){headerCell.attr("data-sortheader","ascending");$(sortHeaderColumnsAscendingIcon).appendTo(headerCell)}else if(sortDirection==="descending"){headerCell.attr("data-sortheader","descending");$(sortHeaderColumnsDescendingIcon).appendTo(headerCell)}else if(allowHeaderColumnsSorting){headerCell.attr("data-sortheader","")}}if(!expandable||expandable&&!expanded){sortDirection=columnSortDirectionsMap[headers[i].tupleIndex];if(sortDirection==="ascending"){headerCell.attr("data-sort","ascending");$(sortRowsAscendingIcon).appendTo(headerCell)}else if(sortDirection==="descending"){headerCell.attr("data-sort","descending");$(sortRowsDescendingIcon).appendTo(headerCell)}else if(allowSorting){headerCell.attr("data-sort","")}}if(headers[i].group){this._processHeaderMarkupRecursive(tableId,headers[i].group,columnSortDirectionsMap,levelSortDirectionsMap)}}},_fillDropArea:function(dropAreaSelector,items,isDisabled,emptyMessage){var dropArea=$(dropAreaSelector),i,length;dropArea.empty();if(items.length>0){for(i=0,length=items.length;i<length;i++){this._createMetadataElement(items[i],isDisabled,"appendTo",dropArea)}}else{dropArea.text(emptyMessage)}},_measureHeaders:function(headers){var $this=this,id=this.element.attr("id"),grid=this.grid(),table=grid.headersTable(),extraColsCount,extraColsWidth,maxWidth,header,measureTh,colsWidth;extraColsCount=this._rowsMatrix.length>0?this._rowsMatrix[0].length:1;if(this.options.defaultRowHeaderWidth){table.find("col:lt("+extraColsCount+")").width(this.options.defaultRowHeaderWidth);if(!$.ig.util.isTouchDevice()){table.find(".ui-igpivot-droparea[data-role=rows], .ui-igpivot-droparea[data-role=columns], .ui-igpivot-droparea[data-role=measures], .ui-igpivot-droparea[data-role=filters]").each(function(){$this._measureDropArea($(this))})}else{table.find(".ui-igpivot-droparea[data-role=rows], .ui-igpivot-droparea[data-role=columns], .ui-igpivot-droparea[data-role=measures], .ui-igpivot-droparea[data-role=filters]").each(function(ind,el){$(el).wrap($("<div style='overflow: hidden;'></div>")).parent("div").igScroll()})}extraColsWidth=this.options.defaultRowHeaderWidth*extraColsCount}else{maxWidth=0;table.find("#"+id+"_measures, #"+id+"_rows").each(function(ind,el){var clone,parent;clone=$(el).clone(false);clone.children(".ui-igpivot-droparea").append("<li class='"+$this.css.insertItem+"'></li>");parent=$("<div class='ui-widget ui-widget-header ui-iggrid ui-igpivotgrid'></div>").append(clone).css({position:"absolute",visibility:"hidden",height:"auto",width:"auto",overflow:"visible","text-overflow":"clip",left:"-1000px",top:"-1000px"}).appendTo(document.body);maxWidth=Math.max(maxWidth,parent.outerWidth(true));parent.remove()});table.find("col:lt("+extraColsCount+")").width(Math.ceil(maxWidth/extraColsCount));extraColsWidth=maxWidth}if(grid.options.defaultColumnWidth){table.find("col:gt("+extraColsCount+")").width(grid.options.defaultColumnWidth)}else{header=table.find("th:not(.ui-igpivot-dropareaheader):first");measureTh=$("<th class='"+header.attr("class")+"' style='position:absolute;visibility:hidden;height:auto;width:auto;overflow:visible;text-overflow:clip;left:-1000px;top:-1000px;'></th>").css({"font-family":header.css("fontFamily"),"font-size":header.css("fontSize"),"font-size-adjust":header.css("fontSizeAdjust"),"font-stretch":header.css("fontStretch"),"font-style":header.css("fontStyle"),"font-variant":header.css("fontVariant"),"font-weight":header.css("fontWeight")}).appendTo(document.body);colsWidth=this._measureHeadersRecursive(this.grid().element[0].id,headers,measureTh,extraColsCount);measureTh.remove()}if(table.find("col").length-extraColsCount===1||extraColsWidth+colsWidth<table.width()){table.find("col:last").width("auto")}},_measureHeadersRecursive:function(tableId,headers,measureTh,extraColsCount){var i,headerCell,totalWidth,width;totalWidth=0;for(i=0;i<headers.length;i++){if(headers[i].axisName===this._const.emptyCell.axisName){break}headerCell=$("#"+tableId+"_"+headers[i].key);if(headers[i].group){totalWidth+=this._measureHeadersRecursive(tableId,headers[i].group,measureTh,extraColsCount)}else{width=measureTh.html(headerCell[0].innerHTML)[0].offsetWidth+10;totalWidth+=width;this.grid().headersTable().find("col:eq("+(headerCell.data("columnIndex")+extraColsCount)+")").width(width);headers[i].width=width}}return totalWidth},_measureDropArea:function(dropArea){var $this=this,id,parent,parentClone,parentContainer,parentWidth,left,minLeft,maxLeft,scrollLeft,scrollRight,scrollToLeft,timer,mouseover,mouseout;parent=dropArea.parent("th");id=parent.attr("id");parentClone=$(parent).clone(false);parentClone.children(".ui-igpivot-droparea").append("<li class='"+$this.css.insertItem+"'></li>");parentContainer=$("<div class='ui-widget ui-widget-header ui-iggrid ui-igpivotgrid'></div>").append(parentClone).css({position:"absolute",visibility:"hidden",height:"auto",width:"auto",overflow:"visible","text-overflow":"clip",left:"-1000px",top:"-1000px"}).appendTo(document.body);parentWidth=parent.width();if(parentContainer.find(".ui-igpivot-droparea").outerWidth(true)>parentWidth){dropArea.css({display:"inline-block",overflow:"hidden",margin:0,padding:0});scrollLeft=$("<span class='"+this.css.scrollButton+"'><a class='"+this.css.scrollLeft+"' /></span>").insertBefore(dropArea);scrollRight=$("<span class='"+this.css.scrollButton+"'><a class='"+this.css.scrollRight+"' /></span>").insertAfter(dropArea);if(0===parentWidth){dropArea.width("auto")}else{dropArea.width(parentWidth-scrollLeft.outerWidth(true)-scrollRight.outerWidth(true))}left=this._headerScrollOffsets[id]||0;minLeft=0;maxLeft=dropArea[0].scrollWidth;scrollToLeft=function(){if(left<minLeft){left=minLeft}if(left>maxLeft){left=maxLeft}dropArea.scrollLeft(left);$this._headerScrollOffsets[id]=left};scrollToLeft();mouseover=this._getEvent("mouseover");mouseout=this._getEvent("mouseout");scrollLeft.bind(mouseover,function(){timer=setInterval(function(){left-=$this._const.hoverScrollOffset;scrollToLeft()},$this._const.hoverScrollInterval)}).bind(mouseout,function(){clearInterval(timer)});scrollRight.bind(mouseover,function(){timer=setInterval(function(){left+=$this._const.hoverScrollOffset;scrollToLeft()},$this._const.hoverScrollInterval)}).bind(mouseout,function(){clearInterval(timer)})}else{delete this._headerScrollOffsets[id]}parentContainer.remove()},_getKPIs:function(dataSource){var measures,kpi,kpiObject,KPIs=[],i;measures=dataSource.measures();for(i=measures.length-1;i>=0;i--){kpiObject={};if("KpiMeasure"===measures[i].getType().typeName()){kpi=dataSource.getCoreElements(function(el){return el.uniqueName()===measures[i].uniqueName()},$.ig.KpiMeasure.prototype.getType())}if(undefined!==kpi&&1===kpi.length){if(null!==kpi[0].graphic()){kpiObject.name=kpi[0].caption();kpiObject.graphic=kpi[0].graphic();KPIs.push(kpiObject)}}}return KPIs},_getKPICells:function(KPIs,dataSource){var headers,allColumns,columnIndexes,rowCells,allRows,i,j,k,m,rowspan,colspan,colspanValue,colspanOffset,rows;if(0!==KPIs.length){if(1===dataSource.measures().length){KPIs[0].cells=$("."+this.css.pivotGrid+" td")}else{for(m=KPIs.length-1;m>=0;m--){KPIs[m].cells=$();headers=$();headers=headers.add("th.ui-igpivotgrid-header[title='"+KPIs[m].name+"']");switch(dataSource.getMeasureListLocation()){case"rows":for(k=0;k<headers.length;k++){rowspan=parseInt(headers.eq(k).attr("rowspan"),10);rows=headers.eq(k).parent();for(i=0;i<rowspan;i++){for(j=0;j<rows.find("td").length;j++){KPIs[m].cells=KPIs[m].cells.add(rows.find("td").eq(j)[0])}rows=rows.next()}}break;case"columns":colspanOffset=0;columnIndexes=[];allColumns=headers.parent().find("th[data-skip!=true]");for(i=0,j=0;i<allColumns.length;i++){colspanValue=parseInt(allColumns.eq(i).attr("colspan"),10);colspan=isNaN(colspanValue)?1:colspanValue;if(allColumns.eq(i)[0]===headers.eq(j)[0]){for(k=0;k<colspan;k++){columnIndexes.push(i+k+colspanOffset)}j++}colspanOffset+=colspan>1?colspan-1:0}allRows=$("."+this.css.pivotGrid+" tbody tr");rowCells=allRows.find("td");for(i=0;i<allRows.length;i++){for(j=0,k=0;j<rowCells.length;j++){if(j===columnIndexes[k]){KPIs[m].cells=KPIs[m].cells.add(allRows.eq(i).find("td").eq(j)[0]);k++}}}break}}}return KPIs}return[]},_addKPIImages:function(KPIs){var i,j,imgString,currentCell,val,x,y;for(i=0;i<KPIs.length;i++){for(j=0;j<KPIs[i].cells.length;j++){currentCell=KPIs[i].cells.eq(j);if(!isNaN(currentCell.text())){imgString="<div class='ui-igpivotgrid-kpis'";imgString+=" title='"+currentCell.text()+"'";imgString+=" style='background-position: ";val=parseFloat(currentCell.text());if(0<val){x=0}else if(0>val){x=32}else{x=16}switch(KPIs[i].graphic.toLowerCase()){case"road signs":y=0;break;case"traffic light":y=16;break;case"variance arrow":y=32;break;case"standart arrow":y=48;break;case"status arrow - ascending":y=64;break;case"status arrow - descending":y=80;break;case"faces":y=96;break;case"shapes":y=112;break;case"cylinder":y=128;break;case"gauge - ascending":y=144;break;case"gauge - descending":y=160;break;case"thermometer":y=176;break}imgString+="-"+x+"px -"+y+"px";imgString+="'></div>";KPIs[i].cells.eq(j)[0].innerHTML=imgString}}}},_adjustRowHeadersWidth:function(grid){var maxWidth=0,childrenWidth,headers,headerChildren,rowsDropAreaWidth,row;if(this.options.height!==null){headers=grid.element.find("th")}else{headers=grid.headersTable().find("tbody th")}headers.each(function(){childrenWidth=parseInt($(this).css("border-right-width").replace("px",""),10);headerChildren=$(this).children();headerChildren.each(function(){childrenWidth+=parseInt($(this).css("margin-left").replace("px",""),10);childrenWidth+=$(this).width()});maxWidth=maxWidth<childrenWidth?childrenWidth:maxWidth});grid.headersTable().find("col").eq(0).width(maxWidth+headers.outerWidth()-headers.width());row="#"+this.element[0].id+"_rows";rowsDropAreaWidth=$(row).width()-2*$(row+" span").width();$(row+" ul").width(rowsDropAreaWidth)},_onDataRendered:function(event,ui){var $this=this,id=this.element.attr("id"),table=ui.owner.element,grid=this.grid(),overlayDropAreaOptions=this._createDropAreaOptions(),dataSource=this._ds,headersCols,colgroup,i,j,colAttributes,KPIs,headerCell,sortableItems,headerCells,headerItemCells;if($this.options.rowHeadersLayout==="tree"&&!$this.options.defaultRowHeaderWidth&&this._ds.rowAxis().length!==0){$this._adjustRowHeadersWidth(grid)}if("OlapXmlaDataSource"===dataSource.getType().typeName()){KPIs=this._getKPIs(dataSource);KPIs=this._getKPICells(KPIs,dataSource);this._addKPIImages(KPIs,dataSource)}table.addClass(this.css.pivotGrid);table.find("tbody th > span[data-expand]").bind("click",function(evt){$this._onToggleTupleMember(evt);return false});table.find("tbody th > span[data-item-expand]").bind("click",function(evt){$this._onToggleTupleMember(evt);return false});if(this.options.allowHeaderRowsSorting){if(this.options.rowHeadersLayout==="tree"){headerCell="tbody th.ui-igpivotgrid-header[data-item-sortheader],tbody th.ui-igpivotgrid-header[data-sortheader]";sortableItems=".ui-iggrid-sortindicator";headerItemCells=table.find(headerCell).find("span[data-item-expand]");for(i=0;i<headerItemCells.length;i++){if($(headerItemCells[i]).data().itemExpand===false){sortableItems+=",.ui-iggrid-headertext:eq("+i+")"}}headerCells=table.find(headerCell).find("span[data-expand]");for(i=0;i<headerCells.length;i++){if($(headerCells[i]).data().expand===false){sortableItems+=",.ui-igpivot-rowheaderlink:eq("+i+")"}}}else{headerCell="tbody th.ui-igpivotgrid-header[data-sortheader]";sortableItems=".ui-iggrid-headertext,.ui-iggrid-sortindicator"}table.find(headerCell).children(sortableItems).bind("click",function(evt){$this._onSortHeader(evt)})}if(grid.options.fixedHeaders){headersCols=grid.headersTable().find("colgroup").find("col");colgroup=table.find("colgroup");colgroup.empty();for(i=0;i<headersCols.length;i++){colgroup.append($("<col></col>"));colAttributes=headersCols.eq(i)[0].attributes;for(j=0;j<colAttributes.length;j++){colgroup.find("col").eq(i).attr(colAttributes.item(j).name,colAttributes.item(j).value)}}grid._setGridContentWidth(grid.headersTable().width());grid.scrollContainer().scrollTop(this._gridScrollOffsets.top);$("#"+id+"_hscroller").scrollLeft(this._gridScrollOffsets.left)}if(!this.options.disableRowsDropArea&&!$.ig.util.isTouchDevice()){if($("#"+id+"_rows_overlay").length<1){$("<div id='"+id+"_rows_overlay' data-role='rows' class='"+this.css.overlayDropArea+" ui-igpivot-droparea ui-droppable'></div>").appendTo(this.element).droppable(overlayDropAreaOptions)}}if(!this.options.disableMeasuresDropArea&&!$.ig.util.isTouchDevice()){if($("#"+id+"_measures_overlay").length<1){$("<div id='"+id+"_measures_overlay' data-role='measures' class='"+this.css.overlayDropArea+" ui-igpivot-droparea ui-droppable'></div>").appendTo(this.element).droppable(overlayDropAreaOptions)}}this._positionOverlayDropAreas();this._triggerPivotGridRendered(event,ui)},_positionOverlayDropAreas:function(){var id=this.element.attr("id"),headersTable=this.grid().headersTable().find("thead"),dataTable=this.grid().element.find("tbody"),firstColumnHeaderPosition,firstRowHeaderPosition,columnHeadersHeight,rowHeadersWidth,measuresArea,container,containerParent,containerPosition,columnsOverlayTop,columnsOverlayLeft,columnHeadersWidth,measuresHeadersWidth,dataTableHeight,rowsOverlayTop,rowsOverlayLeft,containerId,rowHeight,ht,firstRow,rowsProps,columnsProps,measuresProps,absoluteOffset;firstColumnHeaderPosition=headersTable.find("th[data-axis]:first").position();columnHeadersHeight=0;if($.ig.util.isFF){columnHeadersHeight=headersTable.find("tr[data-header-row], tr[data-mch-level]")[0].scrollHeight}else{headersTable.find("tr[data-header-row], tr[data-mch-level]").each(function(ind,el){columnHeadersHeight+=el.scrollHeight})}if(this.options.height!==null||this.options.width!==null){containerId=this.element.attr("id");container=$("#"+containerId+"_container").length===1?$("#"+containerId+"_container"):$("#"+containerId+"_table_container");containerParent=container.parent();containerPosition=container.position()}if(this.options.height!==null){firstRowHeaderPosition={top:this.grid().headersTable().height()+containerPosition.top,left:containerPosition.left}}else if(this.options.width!==null){rowHeight=this.grid().headersTable().find("tr").eq(0).height();if(this.grid().headersTable().find("tr[data-mch-level]").length===0){firstRowHeaderPosition={top:3*rowHeight+containerPosition.top,left:containerPosition.left}}else{firstRowHeaderPosition={top:2*rowHeight+this.grid().headersTable().find("tr[data-mch-level]").length*this.grid().headersTable().find("tr[data-mch-level]").eq(0).height()+containerPosition.top,left:containerPosition.left}}}if(this.options.height!==null||this.options.width!==null){columnsOverlayTop=firstColumnHeaderPosition.top+containerPosition.top+2*parseInt(containerParent.css("paddingTop")[0].replace("px",""),10);columnsOverlayLeft=firstColumnHeaderPosition.left+containerPosition.left;rowsOverlayTop=firstRowHeaderPosition.top+2*parseInt(containerParent.css("paddingTop")[0].replace("px",""),10);rowsOverlayLeft=firstRowHeaderPosition.left}else{firstRowHeaderPosition=this.grid().headersTable().find("tbody tr:first").position();columnsOverlayTop=firstColumnHeaderPosition.top+headersTable.parent().parent().position().top;columnsOverlayLeft=firstColumnHeaderPosition.left+headersTable.parent().parent().position().left;rowsOverlayTop=firstRowHeaderPosition.top+headersTable.parent().parent().position().top;rowsOverlayLeft=firstRowHeaderPosition.left+headersTable.parent().parent().position().left}if(this.options.hideRowsDropArea&&this.options.hideColumnsDropArea&&this.options.hideMeasuresDropArea&&this.options.hideFiltersDropArea){firstRow=headersTable.find("tr").eq(0).find("th")}else{firstRow=headersTable.find("tr").eq(1).find("th")}ht=firstRow.eq(1);if(headersTable[0].scrollWidth<=this.element.width()){columnHeadersWidth=ht.width()+2*(parseInt(ht.css("paddingLeft")[0].substr(0),10)+parseInt(ht.css("borderLeftWidth")[0].substr(0),10))}else{columnHeadersWidth=ht.width()+2*(parseInt(ht.css("paddingLeft")[0].substr(0),10)+parseInt(ht.css("borderLeftWidth")[0].substr(0),10))-(headersTable[0].scrollWidth-this.element.width())}measuresArea=firstRow.eq(0);dataTableHeight=this.element.height()-rowsOverlayTop>dataTable[0].scrollHeight?dataTable[0].scrollHeight:this.element.height()-headersTable.height();rowHeadersWidth=measuresArea.width()+2*(parseInt(measuresArea.css("paddingLeft")[0].replace("px",""),10)+parseInt(measuresArea.css("borderLeftWidth")[0].replace("px",""),10));if(headersTable[0].scrollWidth<=this.element.width()){measuresHeadersWidth=dataTable[0].scrollWidth-rowHeadersWidth}else{measuresHeadersWidth=dataTable[0].scrollWidth-rowHeadersWidth-(headersTable[0].scrollWidth-this.element.width())}absoluteOffset=this._calculateOffset(this.element);rowsProps={top:rowsOverlayTop+absoluteOffset.top,left:absoluteOffset.left,width:rowHeadersWidth,height:dataTableHeight};columnsProps={top:columnsOverlayTop+absoluteOffset.top,left:rowHeadersWidth+absoluteOffset.left,width:columnHeadersWidth,height:columnHeadersHeight};measuresProps={top:rowsOverlayTop+absoluteOffset.top,left:rowHeadersWidth+absoluteOffset.left,width:measuresHeadersWidth,height:dataTableHeight};$("#"+id+"_rows_overlay").css(rowsProps);$("#"+id+"_columns_overlay").css(columnsProps);$("#"+id+"_measures_overlay").css(measuresProps);headersTable.parent().parent().on("scroll",{table:headersTable,id:id,rowHeadersWidth:rowHeadersWidth,columnHeadersWidth:columnHeadersWidth,rowsOverlayLeft:rowsOverlayLeft,measuresHeadersWidth:measuresHeadersWidth,columnsOverlayLeft:columnsOverlayLeft},this._handlePivotGridScrolling)},_calculateOffset:function(jQueryObj){var el=jQueryObj,offset={top:0,left:el.offset().left};while(el[0].tagName&&el.scrollParent()[0].firstChild.name!=="html"){offset.top+=el.scrollParent().scrollTop();offset.left+=el.scrollParent().scrollLeft();el=el.scrollParent()}return offset},_handlePivotGridScrolling:function(evt){var scrollTable=evt.data.table.parent().parent(),id=evt.data.id,offset=scrollTable.scrollLeft(),rowHeadersWidth=evt.data.rowHeadersWidth,columnHeadersWidth=evt.data.columnHeadersWidth,rowsOverlayLeft=evt.data.rowsOverlayLeft,measuresHeadersWidth=evt.data.measuresHeadersWidth,columnsOverlayLeft=evt.data.columnsOverlayLeft;$("#"+id+"_columns_overlay").css({left:columnsOverlayLeft-(rowHeadersWidth>offset?offset:rowHeadersWidth),width:rowHeadersWidth>offset?columnHeadersWidth+offset:scrollTable.width()});$("#"+id+"_rows_overlay").css({width:rowHeadersWidth-offset});$("#"+id+"_measures_overlay").css({left:rowsOverlayLeft+rowHeadersWidth-(rowHeadersWidth>offset?offset:rowHeadersWidth),width:rowHeadersWidth>offset?measuresHeadersWidth+offset:scrollTable.width()})},_updateDataSource:function(deferUpdateOverride){this._updateGrid(false,deferUpdateOverride)},_shouldAppendToTarget:function(target,dragged){return target.offset().left+target.width()/2<dragged.offset.left+this._const.dragCursorAt.left},_onToggleTupleMember:function(evt){var $this=this,target=$(evt.target),header=target.closest("th"),axisName,memberIndex,tupleIndex,expand,noCancel;if(!(this._ds.dataSource().measures().inner().count()>1&&this.options.rowHeadersLayout==="tree"&&this._ds.dataSource().measureListLocation()===0)&&(this._performsToggle||this._ds.isModified())){return}axisName=header.attr("data-axis");memberIndex=parseInt(header.attr("data-member"),10);tupleIndex=parseInt(header.attr("data-tuple"),10);expand=target.attr("data-expand")==="true";if($this.options.rowHeadersLayout==="tree"&&target.attr("data-item-expand")){expand=target.attr("data-item-expand")==="true";memberIndex+=1}if(expand){noCancel=this._triggerTupleMemberExpanding(evt,axisName,memberIndex,tupleIndex);if(noCancel){this._ds.expandTupleMember(axisName,tupleIndex,memberIndex);this._performsToggle=true;this._updateGrid(false,true).done(function(){$this._triggerTupleMemberExpanded(null,axisName,memberIndex,tupleIndex)}).always(function(){$this._performsToggle=false})}}else{noCancel=this._triggerTupleMemberCollapsing(evt,axisName,memberIndex,tupleIndex);if(noCancel){this._ds.collapseTupleMember(axisName,tupleIndex,memberIndex);this._performsToggle=true;this._updateGrid(false,true).done(function(){$this._triggerTupleMemberCollapsed(evt,axisName,memberIndex,tupleIndex)}).always(function(){$this._performsToggle=false})}}},_onSort:function(evt){var $this=this,header=$(evt.target).closest("th"),axisName,tupleIndex,tupleIdentifier,axis,axes,tuple,memberNames,columnSortDirections,columnSortDirection,levelSortDirections,options,i,noCancel,en;if(this._ds.isModified()){return}axisName=header.attr("data-axis");tupleIndex=parseInt(header.attr("data-tuple"),10);if(axisName!==this._const.emptyCell.axisName){axes=this._ds.result().axes().__inner;for(i=0;i<axes.length;i++){if(axisName===axes[i].name()){axis=axes[i];break}}if(!axis){return}tuple=axis.tuples().item(tupleIndex);memberNames=[];en=tuple.members().getEnumerator();while(en.moveNext()){memberNames.push(en.current().uniqueName())}tupleIdentifier=memberNames.join("|")}else{memberNames=null;tupleIdentifier=""}columnSortDirections=this._tableView.columnSortDirections();for(i=0;i<columnSortDirections.length;i++){if(columnSortDirections[i].memberNames&&columnSortDirections[i].memberNames.join("|")===tupleIdentifier||columnSortDirections[i].tupleIndex===tupleIndex){columnSortDirection=columnSortDirections[i];break}}if(!evt.ctrlKey){columnSortDirections=[]}if(columnSortDirection){columnSortDirection.sortDirection=columnSortDirection.sortDirection==="ascending"?"descending":"ascending";if(!evt.ctrlKey){columnSortDirections.push(columnSortDirection)}}else{columnSortDirection={memberNames:memberNames,tupleIndex:tupleIndex,sortDirection:this.options.firstSortDirection};columnSortDirections.push(columnSortDirection)}noCancel=this._triggerSorting(evt,columnSortDirections);if(noCancel){levelSortDirections=$.grep(this._tableView.levelSortDirections(),function(sortDirection){var level,hierarchyName;level=$this._ds.getCoreElement(function(l){return l.uniqueName()===sortDirection.levelUniqueName},$.ig.Level.prototype.getType());if(level){hierarchyName=level.hierarchyUniqueName();return $.grep($this._ds.rowAxis(),function(h){return h.uniqueName()===hierarchyName}).length===0}return false});this._tableView.levelSortDirections(levelSortDirections);this._tableView.columnSortDirections(columnSortDirections);this._tableView.initialize();options=this._configureOptions(this._ds);this._renderGrid(options);this._triggerSorted(evt,columnSortDirections,this._tableView.appliedColumnSortDirections())}},_onSortHeader:function(evt){var header=$(evt.target).closest("th"),axisName,tupleIndex,memberIndex,axis,axes,tuple,member,level,levelName,hierarchyName,levelSortDirections,levelSortDirection,options,i,noCancel;if(this._ds.isModified()){return}axisName=header.attr("data-axis");tupleIndex=parseInt(header.attr("data-tuple"),10);memberIndex=parseInt(header.attr("data-member"),10);if(!header.hasClass("ui-iggrid-multiheader-cell")&&this.options.rowHeadersLayout==="tree"&&($(evt.target).hasClass("ui-iggrid-headertext")||$(evt.target).attr("data-sortheader"))){memberIndex+=1}axes=this._ds.result().axes().__inner;for(i=0;i<axes.length;i++){if(axisName===axes[i].name()){axis=axes[i];break}}if(!axis){return}tuple=axis.tuples().item(tupleIndex);member=tuple.members().item(memberIndex);level=this._ds.getCoreElement(function(l){return l.hierarchyUniqueName()===member.hierarchyUniqueName()&&l.depth()===member.depth()+1},$.ig.Level.prototype.getType());if(!level){return}levelName=level.uniqueName();levelSortDirections=this._tableView.appliedLevelSortDirections();for(i=0;i<levelSortDirections.length;i++){if(levelSortDirections[i].levelUniqueName===levelName){levelSortDirection=levelSortDirections[i];break}}if(levelSortDirection){levelSortDirection.sortDirection=levelSortDirection.sortDirection==="ascending"?"descending":"ascending"}else{levelSortDirection={levelUniqueName:levelName,sortBehavior:this.options.defaultLevelSortBehavior,sortDirection:this.options.firstLevelSortDirection};levelSortDirections.push(levelSortDirection)}noCancel=this._triggerHeadersSorting(evt,levelSortDirections);if(noCancel){hierarchyName=level.hierarchyUniqueName();if($.grep(this._ds.rowAxis(),function(h){return h.uniqueName()===hierarchyName}).length>0){this._tableView.columnSortDirections([])}this._tableView.levelSortDirections(levelSortDirections);this._tableView.initialize();options=this._configureOptions(this._ds);this._renderGrid(options);this._triggerHeadersSorted(evt,levelSortDirections,this._tableView.appliedLevelSortDirections())}},expandTupleMember:function(tupleLocation,tupleIndex,memberIndex,shouldUpdate){var dataSource=this._ds,hasColumns,hasRows,axisName;hasColumns=dataSource.columnAxis().length>0;hasRows=dataSource.rowAxis().length>0;if(this._ds.isModified()){return false}if(tupleLocation==="columnAxis"&&hasColumns){if(hasColumns){axisName="Axis0"}}else if(tupleLocation==="rowAxis"&&hasRows){if(hasColumns){axisName="Axis1"}else{axisName="Axis0"}}if(!axisName){throw new Error($.ig.PivotGrid.locale.noSuchAxis)}this._ds.expandTupleMember(axisName,tupleIndex,memberIndex);if(shouldUpdate){this._updateGrid(null,true)}},collapseTupleMember:function(tupleLocation,tupleIndex,memberIndex,shouldUpdate){var dataSource=this._ds,hasColumns,hasRows,axisName;hasColumns=dataSource.columnAxis().length>0;hasRows=dataSource.rowAxis().length>0;if(this._ds.isModified()){return false}if(tupleLocation==="columnAxis"&&hasColumns){if(hasColumns){axisName="Axis0"}}else if(tupleLocation==="rowAxis"&&hasRows){if(hasColumns){axisName="Axis1"}else{axisName="Axis0"}}if(!axisName){throw new Error($.ig.PivotGrid.locale.noSuchAxis)}this._ds.collapseTupleMember(axisName,tupleIndex,memberIndex);if(shouldUpdate){this._updateGrid()}},appliedColumnSortDirections:function(){return this._tableView?this._tableView.appliedColumnSortDirections():[]},appliedLevelSortDirections:function(){return this._tableView?this._tableView.appliedLevelSortDirections():[]},destroy:function(){var grid=this.grid();if(grid){grid.destroy()}$("#"+this.element.attr("id")+"_container_block").remove();this.element.removeClass(this.css.pivotGrid);$(this._ds).unbind("initialized.pivotgrid"+this.timestamp);$(this._ds).unbind("updated.pivotgrid"+this.timestamp);$.Widget.prototype.destroy.call(this)},_triggerPivotGridHeadersRendered:function(evt,ui){var args={owner:this,grid:ui.owner,table:ui.table};this._trigger("pivotGridHeadersRendered",evt,args)},_triggerPivotGridRendered:function(evt,ui){var args={owner:this,grid:ui.owner};this._trigger("pivotGridRendered",evt,args)},_triggerTupleMemberExpanding:function(evt,axisName,memberIndex,tupleIndex){var args={owner:this,dataSource:this._ds,axisName:axisName,memberIndex:memberIndex,tupleIndex:tupleIndex};return this._trigger("tupleMemberExpanding",evt,args)},_triggerTupleMemberExpanded:function(evt,axisName,memberIndex,tupleIndex){var args={owner:this,dataSource:this._ds,axisName:axisName,memberIndex:memberIndex,tupleIndex:tupleIndex};this._trigger("tupleMemberExpanded",evt,args)
},_triggerTupleMemberCollapsing:function(evt,axisName,memberIndex,tupleIndex){var args={owner:this,dataSource:this._ds,axisName:axisName,memberIndex:memberIndex,tupleIndex:tupleIndex};return this._trigger("tupleMemberCollapsing",evt,args)},_triggerTupleMemberCollapsed:function(evt,axisName,memberIndex,tupleIndex){var args={owner:this,dataSource:this._ds,axisName:axisName,memberIndex:memberIndex,tupleIndex:tupleIndex};this._trigger("tupleMemberCollapsed",evt,args)},_triggerSorting:function(evt,columnSortDirections){var args={owner:this,sortDirections:columnSortDirections};return this._trigger("sorting",evt,args)},_triggerSorted:function(evt,columnSortDirections,appliedColumnSortDirections){var args={owner:this,sortDirections:columnSortDirections,appliedSortDirections:appliedColumnSortDirections};this._trigger("sorted",evt,args)},_triggerHeadersSorting:function(evt,levelSortDirections){var args={owner:this,levelSortDirections:levelSortDirections};return this._trigger("headersSorting",evt,args)},_triggerHeadersSorted:function(evt,levelSortDirections,appliedLevelSortDirections){var args={owner:this,levelSortDirections:levelSortDirections,appliedLevelSortDirections:appliedLevelSortDirections};this._trigger("headersSorted",evt,args)}});$.extend(true,$.ui.igPivotGrid.prototype,$.ig.Pivot._pivotShared);$.extend($.ui.igPivotGrid,{version:"15.2.20152.1027"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Pivot View 15.2.20152.1027
*
* Copyright (c) 2011-2012 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on: 
*	jquery-1.4.4.js
*	jquery.ui.core.js
*	jquery.ui.widget.js
*	jquery.ui.mouse.js
*	jquery.ui.draggable.js
*	jquery.ui.droppable.js
*	modernizr.js (Optional)
*	infragistics.util.js
*	infragistics.datasource.js
*	infragistics.olapxmladatasource.js
*	infragistics.olapflatdatasource.js
*	infragistics.ui.shared.js
*	infragistics.ui.scroll.js
*	infragistics.ui.splitter.js
*	infragistics.ui.tree.js
*	infragistics.ui.grid.framework.js
*	infragistics.ui.grid.multicolumnheaders.js
*	infragistics.ui.pivot.shared.js
*	infragistics.ui.pivotdataselector.js
*	infragistics.ui.pivotgrid.js
*/
(function($){var _igPivotGrid=$.ui.igPivotGrid.prototype.widgetFullName||$.ui.igPivotGrid.prototype.widgetName,_igPivotDataSelector=$.ui.igPivotDataSelector.prototype.widgetFullName||$.ui.igPivotDataSelector.prototype.widgetName,_igSplitter=$.ui.igSplitter.prototype.widgetFullName||$.ui.igSplitter.prototype.widgetName;$.widget("ui.igPivotView",{options:{width:null,height:null,dataSource:null,dataSourceOptions:{xmlaOptions:{serverUrl:null,catalog:null,cube:null,measureGroup:null,requestOptions:{withCredentials:false,beforeSend:null},enableResultCache:true,discoverProperties:null,executeProperties:null,mdxSettings:{nonEmptyOnRows:true,nonEmptyOnColumns:true,addCalculatedMembersOnRows:true,addCalculatedMembersOnColumns:true,dimensionPropertiesOnRows:[],dimensionPropertiesOnColumns:[]}},flatDataOptions:{dataSource:null,dataSourceUrl:null,dataSourceType:null,responseDataKey:null,responseDataType:null,metadata:{cube:{name:null,caption:null,measuresDimension:{name:null,caption:null,measures:[{name:null,caption:null,aggregator:null,displayFolder:null}]},dimensions:[{name:null,caption:null,hierarchies:[{name:null,caption:null,displayFolder:null,levels:[{name:null,caption:null,memberProvider:null}]}]}]}}},measures:null,filters:null,rows:null,columns:null},pivotGridOptions:{isParentInFrontForColumns:false,isParentInFrontForRows:true,compactColumnHeaders:false,rowHeadersLayout:"compact",compactColumnHeaderIndentation:30,compactRowHeaderIndentation:20,defaultRowHeaderWidth:200,allowSorting:false,firstSortDirection:"ascending",allowHeaderRowsSorting:false,allowHeaderColumnsSorting:false,levelSortDirections:[{levelUniqueName:null,sortDirection:null}],firstLevelSortDirection:"ascending",gridOptions:{defaultColumnWidth:null,fixedHeaders:true,caption:null,features:[],tabIndex:0,alternateRowStyles:true,enableHoverStyles:false},dragAndDropSettings:{appendTo:"body",containment:false,zIndex:10},dropDownParent:"body",disableRowsDropArea:false,disableColumnsDropArea:false,disableMeasuresDropArea:false,disableFiltersDropArea:false,hideRowsDropArea:false,hideColumnsDropArea:false,hideMeasuresDropArea:false,hideFiltersDropArea:false,customMoveValidation:null},dataSelectorOptions:{dragAndDropSettings:{appendTo:"body",containment:false,zIndex:10},dropDownParent:"body",customMoveValidation:null},pivotGridPanel:{resizable:true,collapsible:false,collapsed:false,size:null},dataSelectorPanel:{location:"right",resizable:true,collapsible:true,collapsed:false,size:250}},_create:function(){var $this=this,elementName,splitter,panel,pivotGrid,dataSelector,panels,dataSelectorLocation,dataSource;elementName=this.element[0].nodeName.toUpperCase();if(elementName!=="DIV"){throw new Error(elementName+$.ig.PivotDataSelector.locale.invalidBaseElement)}this.element.addClass("ui-igpivotview");if(this.options.width){this.element.width(this.options.width)}if(this.options.height){this.element.height(this.options.height)}dataSelectorLocation=this.options.dataSelectorPanel.location;splitter=$("<div></div>").appendTo(this.element);panel=$("<div></div>").appendTo(splitter);pivotGrid=$("<table></table>").attr("id",this.element.attr("id")+"_pivotGrid").appendTo(panel);panel=$("<div></div>")[dataSelectorLocation==="right"?"appendTo":"prependTo"](splitter);dataSelector=$("<div></div>").attr("id",this.element.attr("id")+"_dataSelector").appendTo(panel);panels=[this.options.pivotGridPanel,this.options.dataSelectorPanel];if(dataSelectorLocation!=="right"){panels.reverse()}dataSource=$.ig.Pivot._pivotShared._createDataSource(this.options.dataSource,this.options.dataSourceOptions);dataSelector.igPivotDataSelector($.extend(true,this.options.dataSelectorOptions,{dataSource:dataSource}));splitter.igSplitter({width:this.options.width||this.element.width(),height:this.options.height||this.element.height(),panels:panels}).bind("igsplitterresizeended igsplitterexpanded igsplittercollapsed",function(){$this._setSize()}).bind("igsplitterresizestarted",function(){$(".ui-igpivot-metadatadropdown,.ui-igpivot-filterdropdown").remove()});if($.ui.igSplitter.prototype.css.verticalPanel){$($.ui.igSplitter.prototype.css.verticalPanel.replace(/ui-/g,".ui-").replace(/ /g,"")).css("overflow","hidden")}pivotGrid.igPivotGrid($.extend(true,this.options.pivotGridOptions,{dataSource:dataSource,width:(dataSelectorLocation==="right"?splitter.igSplitter("firstPanel"):splitter.igSplitter("secondPanel")).width(),height:splitter.igSplitter("option","height")}));splitter.igSplitter("refreshLayout");this._setSize();dataSelector.bind("igpivotdataselectordeferupdatechanged",function(evt,ui){pivotGrid.igPivotGrid("option","deferUpdate",ui.deferUpdate)})},_setOption:function(key,value){switch(key){case"dataSource":this.options.dataSourceOptions=null;this.options.dataSource=$.ig.Pivot._pivotShared._createDataSource(value,null);this.dataSelector().option("dataSource",this.options.dataSource);this.pivotGrid().option("dataSource",this.options.dataSource);break;case"dataSourceOptions":this.options.dataSourceOptions=value;this.options.dataSource=$.ig.Pivot._pivotShared._createDataSource(null,value);this.dataSelector().option("dataSource",this.options.dataSource);this.pivotGrid().option("dataSource",this.options.dataSource);break;case"width":case"height":$.Widget.prototype._setOption.call(this,arguments);this.splitter().element[key](value);this._setSize();break}},_setSize:function(){var splitter=this.splitter(),pivotGrid=this.pivotGrid(),dataSelector=this.dataSelector(),height=this.element.height(),dataSelectorLocation,pivotGridPanelWidth,dataSelectorPanelWidth;dataSelectorLocation=this.options.dataSelectorPanel.location;if(dataSelectorLocation==="right"){pivotGridPanelWidth=splitter.firstPanel().width();dataSelectorPanelWidth=splitter.secondPanel().width()}else{pivotGridPanelWidth=splitter.secondPanel().width();dataSelectorPanelWidth=splitter.firstPanel().width()}pivotGrid.option("width",pivotGridPanelWidth);pivotGrid.option("height",height);dataSelector.option("width",dataSelectorPanelWidth);dataSelector.option("height",height)},pivotGrid:function(){try{return this.element.find(":ui-igPivotGrid").data(_igPivotGrid)}catch(e){if(e==="Syntax error, unrecognized expression: Syntax error, unrecognized expression: ui-igPivotGrid"||e.message==="Syntax error, unrecognized expression: ui-igPivotGrid"){return this.element.find(":ui-igpivotgrid").data(_igPivotGrid)}throw e}},dataSelector:function(){try{return this.element.find(":ui-igPivotDataSelector").data(_igPivotDataSelector)}catch(e){if(e==="Syntax error, unrecognized expression: Syntax error, unrecognized expression: ui-igPivotDataSelector"||e.message==="Syntax error, unrecognized expression: ui-igPivotDataSelector"){return this.element.find(":ui-igpivotdataselector").data(_igPivotDataSelector)}throw e}},splitter:function(){try{return this.element.find(":ui-igSplitter").data(_igSplitter)}catch(e){if(e==="Syntax error, unrecognized expression: Syntax error, unrecognized expression: ui-igSplitter"||e.message==="Syntax error, unrecognized expression: ui-igSplitter"){return this.element.find(":ui-igsplitter").data(_igSplitter)}throw e}},destroy:function(){this.element.removeClass("ui-igpivotview");try{this.element.find(":ui-igPivotGrid").igPivotGrid("destroy");this.element.find(":ui-igPivotDataSelector").igPivotDataSelector("destroy");this.element.find(":ui-igSplitter").igSplitter("destroy").remove()}catch(e){if(typeof e==="string"){if(e.indexOf("unrecognized expression: ui-ig")!==-1){this.element.find(":ui-igpivotgrid").igPivotGrid("destroy");this.element.find(":ui-igpivotdataselector").igPivotDataSelector("destroy");this.element.find(":ui-igsplitter").igSplitter("destroy").remove();$.Widget.prototype.destroy.call(this);return}}else{if(e.message.indexOf("unrecognized expression: ui-ig")!==-1){this.element.find(":ui-igpivotgrid").igPivotGrid("destroy");this.element.find(":ui-igpivotdataselector").igPivotDataSelector("destroy");this.element.find(":ui-igsplitter").igSplitter("destroy").remove();$.Widget.prototype.destroy.call(this);return}}throw e}}});$.extend($.ui.igPivotView,{version:"15.2.20152.1027"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Editors 15.2.20152.1027
*
* Copyright (c) 2011-2015 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
* jquery-1.4.4.js
* jquery.ui.core.js
* jquery.ui.widget.js
* infragistics.ui.rating-en.js
*
* Example to use:
*	<script type="text/javascript">
*	$(function () {
*		$('#rating1').igRating({ voteCount:3, value:0.5, vertical:true });
*	});
*	</script>
*	<div id="rating1"></div>
*/
(function($){var _aNull=function(v){return v===null||v===undefined||typeof v==="number"&&isNaN(v)};$.widget("ui.igRating",{options:{vertical:false,value:null,valueHover:null,voteCount:5,voteWidth:0,voteHeight:0,swapDirection:false,valueAsPercent:true,focusable:true,precision:"whole",precisionZeroVote:.25,roundedDecimalPlaces:3,theme:null,validatorOptions:null,cssVotes:null},css:{normal:"ui-igrating ui-state-default ui-widget-content",active:"ui-igrating-active",selected:"ui-igrating-selected ui-state-highlight",hover:"ui-igrating-hover ui-state-hover",vote:"ui-igrating-vote ui-icon ui-icon-star",voteSelected:"ui-igrating-voteselected",voteDisabled:"ui-igrating-votedisabled ui-state-disabled",voteHover:"ui-igrating-votehover",voteDisabledSelected:"ui-igrating-votedisabledselected ui-state-disabled"},events:{hoverChange:null,valueChange:null},_create:function(){var inp,cont,elem,sto={fontSize:"1px",width:"100%",height:"100%",position:"relative",overflow:"hidden"},o=this.options,elem0=this.element,me=this,css=this.css,count=this._count(o),v=elem0[0].style,id=o.inputName;me._old={width:v.width,height:v.height,html:elem0[0].innerHTML};if(!id){elem0[0].innerHTML=""}if(o.theme){elem0.addClass(o.theme)}me._swap=o.swapDirection;me._rtl=elem0.css("direction")==="rtl";if(me._rtl){me._swap=!me._swap;elem0.css("direction","ltr")}me._hasHov=0;elem=me._elem=$("<div/>").css(sto).addClass(css.normal).appendTo(elem0).bind(me._evts={mousedown:function(e){me._doEvt(e,1)},mousemove:function(e){me._doEvt(e,2)},mouseleave:function(e){me._doEvt(e,3)}});cont=$("<div/>").css(sto).appendTo(elem);if(o.focusable){v={left:"5px",top:"5px",opacity:.1,position:"absolute",width:"1px",height:"1px",padding:"0px",zIndex:-1,border:"0px",outline:0};me._foc=$('<input type="button"/>').css(v).appendTo(cont).focus(function(evt){if(o.disabled||me._fcs){return}me._fcs=1;if(me._hasHov<2){me._hasHov+=2}if(me._hov){me._doVal(me._valH,1,evt);me._hov.css("visibility","visible")}me._elem.addClass(css.active)}).blur(function(e){if(o.disabled||!me._fcs){return}me._fcs=null;me._hasHov%=2;if(me._hov&&me._hasHov===0){me._hov.css("visibility","hidden")}me._elem.removeClass(css.active);if(me._validator){me._validator._validateInternal(me.element,e,true)}}).keydown(function(evt){var old,arrow=0,k=evt.keyCode,kc=$.ui.keyCode,val=me._valH,swap=me._swap?-1:1,vertical=o.vertical,d=1/me._count(o);if(o.disabled){return}old=val;d/=me._prec(o);if(k===kc.SPACE||k===kc.ENTER){me._doVal(val,false,evt);return}if(k===kc.HOME){val=0}else if(k===kc.END){val=1}else if(k===kc.PAGE_DOWN){val+=d*4}else if(k===kc.PAGE_UP){val-=d*4}else if(k===kc.UP&&vertical){val+=arrow=-d*swap}else if(k===kc.DOWN&&vertical){val+=arrow=d*swap}else if(k===kc.LEFT&&!vertical){val+=arrow=-d*swap}else if(k===kc.RIGHT&&!vertical){val+=arrow=d*swap}if(k>32&&k<41){try{evt.preventDefault();evt.stopPropagation()}catch(ex){}}for(k=0;k<3;k++){if(old!==(val=Math.max(Math.min(val,1),0))&&me._doVal(val,1,evt)&&arrow){val+=arrow}else{break}}})}me._doVotes(o,cont);if(id){inp=$('input[name="'+id+'"]');if(inp.length<=0){inp=$("#"+id)}v=inp[0]?inp[0].value:null;if(v){o.value=me._toNum(v,o)}}me._val=me._toNum(o.value,o);v=o.valueHover;me._valH=_aNull(v)?me._val:me._toNum(v,o);if(!o.valueAsPercent){me._val/=count;me._valH/=count}me.validator();me._set=true;me._doVal(me._val,null,inp?2:inp);me._doVal(me._valH,1);delete me._set},_toNum:function(v,o){if(!v){return 0}o=o._vsFormat;if(typeof v==="string"){v=parseFloat(o?v.replace(o,"_").replace(/[`,\. \':]/g,"").replace("_","."):v)}return isNaN(v)||v<0?0:v},_count:function(o){o=parseInt(o.voteCount,10);return isNaN(o)?5:Math.max(o,1)},_doVotes:function(o,cont){var hov,sel,cssV,height,width,div,span,cssi,val=cont,count=this._count(o),sto={width:"100%",height:"100%"},abs={left:"0px",top:"0px",position:"absolute",overflow:"hidden",border:"none",background:"none"},i=-1,me=this,css=this.css,elem=this._elem,elem0=this.element,touch={touchstart:function(e){e.preventDefault();$(this).trigger("mousedown")}};if(!cont){cont=me._div.parent();me._div.remove();me._hov.remove();me._sel.remove();me._selSwap=me._hovSwap=null}div=me._div=$("<div/>").addClass(css.vote).css(abs).appendTo(cont);if(!o.vertical){div.css("whiteSpace","nowrap")}height=parseInt(o.voteHeight,10);width=parseInt(o.voteWidth,10);if(isNaN(height)||height<2){height=div.css("height");height=!height||height.indexOf("px")<1?16:parseInt(height,10)}if(isNaN(width)||width<2){width=div.css("width");width=!width||width.indexOf("px")<1?16:parseInt(width,10)}div.removeClass(css.vote);sel=me._sel=$("<div/>").addClass(css.selected).css(sto).css(abs).appendTo(cont);if(!o.vertical){sel.css("whiteSpace","nowrap")}hov=me._hov=$("<div/>").addClass(css.hover).css(sto).css(abs).css("visibility","hidden").appendTo(cont);if(!o.vertical){hov.css("whiteSpace","nowrap")}if(me._swap&&!o.vertical){me._hovSwap=hov=$("<div/>").css(sto).appendTo(me._hov);me._selSwap=sel=$("<div/>").css(sto).appendTo(me._sel)}cssV={display:o.vertical?"block":"inline-block",width:width,height:height,textIndent:"0px",overflow:"visible"};while(++i<count){span=$("<span />").addClass(css.vote).css(cssV).appendTo(div).bind(touch);if(o.disabled){span.addClass(css.voteDisabled)}cssi=o.cssVotes?o.cssVotes[i]:null;if(cssi&&cssi[0]){span.addClass(cssi[0])}span[0]._i=i;span=$("<span />").addClass(css.vote).addClass(css.voteSelected).css(cssV).appendTo(sel).bind(touch);if(o.disabled){span.addClass(css.voteDisabledSelected)}if(cssi&&cssi[1]){span.addClass(cssi[1])}span[0]._i=i;if(me._swap&&!me._selSwap){me._selSwap=span}span=$("<span />").addClass(css.vote).addClass(css.voteHover).css(cssV).appendTo(hov).bind(touch);if(cssi&&cssi[2]){span.addClass(cssi[2])}span[0]._i=i;if(me._swap&&!me._hovSwap){me._hovSwap=span}}if(o.vertical){me._size=height;height*=count}else{me._size=width;width*=count}elem.css({height:height+"px",width:width+"px"});try{height+=(i=Math.max(elem.outerHeight()-elem.innerHeight(),0))>10?2:i;width+=(i=Math.max(elem.outerWidth()-elem.innerWidth(),0))>10?2:i}catch(ex){}elem0.css({height:height+"px",width:width+"px"});div.css(sto);if(!val){me.value(me.value())}},validator:function(destroy){var o=this.options.validatorOptions,v=this._validator;if(v&&v.owner===this&&(destroy||!o)){v.destroy();delete this._validator}else if(!v&&!destroy&&o&&this.element.igValidator){this._validator=this.element.igValidator(o).data("igValidator");this._validator.owner=this}else if(v&&!destroy&&o&&this.element.igValidator){this._validator=this.element.igValidator(o).data("igValidator")}return this._validator},validate:function(){return this._validator?this._validator.validate():null},_doEvt:function(evt,type){var val,me=this,o=this.options;if(o.disabled){return}if(type===3){me._hasHov-=me._hasHov%2;if(me._hov&&me._hasHov===0){me._hov[0].style.visibility="hidden"}return}val=me._valFromEvt(evt);if(val<0){return}if(type===1){if(!me._sel){return}val=me._lastHov||val;me._doVal(val,false,evt);me._doVal(val,1,evt);if(me._foc&&document.hasFocus&&!document.hasFocus()){return setTimeout(function(){me.focus()},0)}me.focus()}if(type===2){me._lastHov=val;if(!me._hov){return}if(me._hasHov%2===0){me._hasHov++}me._hov[0].style.visibility="visible";me._doVal(val,1,evt)}evt.preventDefault()},_setOption:function(key,val){var spans,count,css,o=this.options;if(o[key]===val){return this}if(key==="swapDirection"||key==="vertical"||key==="focusable"){throw new Error($.ig.Rating.locale.setOptionError+key)}count=this._count(o);if(key==="disabled"){spans=$("SPAN",this._div);css=this.css.voteDisabled;if(spans.length!==count){return this}if(val){spans.addClass(css)}else{spans.removeClass(css)}spans=$("SPAN",this._sel);css=this.css.voteDisabledSelected;if(spans.length!==count&&this._selSwap){spans=$("SPAN",this._selSwap)}if(spans.length===count){if(val){spans.addClass(css)}else{spans.removeClass(css)}}}if(key==="theme"){if(o.theme){this.element.removeClass(o.theme)}if(val){this.element.addClass(val)}}o[key]=val;if(typeof val==="function"){return this}this._set=true;if(key==="precision"||key==="valueAsPercent"){this._doVal(this._val,false,1);this._doVal(this._valH,1,1)}if(key.indexOf("vote")===0||key==="theme"||key==="cssVotes"){this._doVotes(o)}if(key.indexOf("value")>=0){this._doVal(val,key.length>6,1,1)}if(key==="validatorOptions"){this.validator()}delete this._set;return this},_evtOffset:function(evt,xy){var val,oEvt=evt.originalEvent||evt,offset="offset"+xy;if(_aNull(val=evt[offset])){if(_aNull(val=oEvt[offset])){if(_aNull(val=evt[offset="layer"+xy])){val=oEvt[offset]}}}return val||1},_valFromEvt:function(evt){var plus,fix,val,offset,i,o=this.options,targ=evt?evt.target:null;i=targ&&targ.nodeName==="SPAN"?targ._i:null;if(_aNull(i)){return-1}if(!targ.unselectable){targ.unselectable="on"}offset=this._evtOffset(evt,o.vertical?"Y":"X");plus=this._size;fix=-(o.vertical?targ.offsetTop:targ.offsetLeft);if(this._swap&&$.ig.util.isFF&&fix<plus){offset+=fix}plus*=i;if(plus>offset){offset+=plus}val=offset/this._count(o)/this._size;if(this._swap){val=1-val}return Math.max(Math.min(val,1),0)},_doVal:function(val,hov,evt,v0){var id,inp,v1,count,o=this.options,style=hov?this._hov:this._sel,size=this._size,swap=this._swap?hov?this._hovSwap:this._selSwap:null;if(style){style=style[0];if(style){style=style.style}}if(!style){return}count=this._count(o);if(v0){val=parseFloat(val)}if(isNaN(val)){val=-1}else if(v0&&!o.valueAsPercent){val/=count}if(evt&&evt.type&&val>=0){v0=this._fixVal(hov?this._valH:this._val,1);v1=this._fixVal(val,1);if(v0===v1){return 1}if(!this._trigger(hov?"hoverChange":"valueChange",evt,{value:v1,oldValue:v0})){return}}if(val<0&&hov){val=this._val}val=this._fixVal(val);if(evt){v0=this._round(o.valueAsPercent?val:val*count,o);if(hov){this._valH=val;o.valueHover=v0}else{if(evt!==2){this._val=val;o.value=v0;if(this._validator){this._validator._validateInternal(this.element,evt)}}id=o.inputName;if(id){inp=$('input[name="'+id+'"]');if(inp.length===0){inp=$('<input type="hidden" name="'+id+'" />').appendTo(this.element.parent())}v1=o._vsFormat;inp.val(v1?v0.toString().replace(".",v1):v0)}}}if(!hov&&this._foc){this._foc.val(this._fixVal(val,1))}if(swap){val=1-val}val=Math.floor(val*size*count+.3);val+="px";if(swap){swap=swap[0];if(swap){swap=swap.style}}if(o.vertical){if(swap){style.top=val;swap.marginTop="-"+val}else{style.height=val}}else{if(swap){style.left=val;swap.marginLeft="-"+val}else{style.width=val}}},_prec:function(o){o=this._set?null:o.precision;if(o){o=o.toLowerCase()}return o==="half"?2:o==="whole"?1:4},_fixVal:function(val,full,prec){var fix,count,o=this.options;prec=prec||this._prec(o);count=this._count(o);val=Math.max(Math.min(val,1),0);if(prec<4){fix=count*prec;val*=fix;val=val<o.precisionZeroVote?0:Math.floor(Math.floor(val+.99)+.499*prec)/fix}if(!full){return val}if(!o.valueAsPercent){val*=count;val=prec>1?val:Math.floor(val+.1)}return this._round(val,o)},_round:function(val,o){var pow=1,fix=parseInt(o.roundedDecimalPlaces,10);if(isNaN(fix)||fix<0){return val}fix=Math.min(15,Math.max(fix,this._prec(o)<4?3:o.valueAsPercent?1:0));while(fix-->0){pow*=10}return Math.round(val*pow)/pow},value:function(val){if(typeof val!=="number"){return this._fixVal(this._val,1,4)}this._set=true;this._doVal(val,false,1,1);delete this._set;return this},valueHover:function(val){if(typeof val!=="number"){return this._fixVal(this._valH,1,4)}this._set=true;this._doVal(val,1,1,1);delete this._set;return this},hasFocus:function(){return this._fcs===1},focus:function(){if(this._foc){try{this._foc[0].focus()}catch(ex){}}return this},destroy:function(){var o=this.options,old=this._old,e=this.element;if(!this._elem){return this}this.validator(1);if(this._foc){this._foc.unbind().remove()}this._elem.remove();if(o.theme){e.removeClass(o.theme)}e[0].style.width=old.width;e[0].style.height=old.height;if(!o.inputName){e[0].innerHTML=old.html}if(this._rtl){e.css("direction","rtl")}$.Widget.prototype.destroy.apply(this,arguments);this._elem=this._hov=this._sel=this._selSwap=this._hovSwap=this._foc=this._evts=null;return this}});$.extend($.ui.igRating,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI ToolbarButton 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.util.js
 *	infragistics.ui.shared.js
 */
(function($){$.widget("ui.igToolbarButton",$.ui.igButton,{options:{allowToggling:true,isSelected:false},css:{toolbarButtonWidget:"ui-igtoolbarbutton"},events:{activating:"activating",activated:"activated",deactivating:"deactivating",deactivated:"deactivated"},_setOption:function(option,value){if(this.options[option]===value){return}$.ui.igButton.prototype._setOption.apply(this,arguments)},_create:function(){$.ui.igButton.prototype._create.apply(this);this._setupElement();this._attachToolbarBtnEvents()},_setupElement:function(){this.element.addClass(this.css.toolbarButtonWidget).attr("tabindex","1");if(this.options.isSelected){this.element.addClass(this.options.css.buttonActiveClasses)}},_onBlur:function(event){var noCancel,o=this.options;if(!o.disabled){noCancel=this._trigger("blur",event);if(noCancel){this.element.removeClass(o.css.buttonFocusClasses);if(!o.allowToggling){this.element.removeClass(o.css.buttonActiveClasses)}}}},_onMouseDown:function(event){var noCancel,e=this.element,o=this.options;if(!o.disabled){noCancel=this._trigger("mousedown",event);if(noCancel){e.removeClass(o.css.buttonHoverClasses);if(!o.allowToggling){e.addClass(o.css.buttonActiveClasses)}}}},_onMouseUp:function(event){var noCancel,o=this.options;if(!o.disabled){noCancel=this._trigger("mouseup",event);if(noCancel){this.element.removeClass(o.css.buttonHoverClasses);if(!o.allowToggling){this.element.removeClass(o.css.buttonActiveClasses)}}}},_onEnterKey:function(e){if(e.keyCode!==$.ui.keyCode.ENTER){return}this.element.mousedown()},_triggerActivating:function(event){var args={owner:this};return this._trigger(this.events.activating,event,args)},_triggerActivated:function(event){var args={owner:this};return this._trigger(this.events.activated,event,args)},_triggerDeactivating:function(event){var args={owner:this};return this._trigger(this.events.deactivating,event,args)},_triggerDeactivated:function(event){var args={owner:this};return this._trigger(this.events.deactivated,event,args)},_attachToolbarBtnEvents:function(){var noCancel,o=this.options,self=this;this.element.click(function(e){if(o.allowToggling){if(o.isSelected){noCancel=self._triggerDeactivating(e);if(noCancel){self.deactivate(e);self.element.addClass(o.css.buttonHoverClasses)}}else{noCancel=self._triggerActivating(e);if(noCancel){self.activate(e)}}}});this.element.on("keypress",$.proxy(this._onEnterKey,this))},toggle:function(){var o=this.options;if(o.disabled===true||o.allowToggling===false){return}o.isSelected=!o.isSelected;this.element.toggleClass(o.css.buttonActiveClasses)},activate:function(event){var o=this.options;if(o.disabled===true||o.allowToggling===false){return}o.isSelected=true;this.element.addClass(o.css.buttonActiveClasses);if(event){this._triggerActivated(event)}},deactivate:function(event){var o=this.options;if(o.disabled===true||o.allowToggling===false){return}o.isSelected=false;this.element.removeClass(o.css.buttonActiveClasses).removeClass(o.css.buttonFocusClasses);if(event){this._triggerDeactivated(event)}},widget:function(){return this.element},destroy:function(){$.ui.igButton.prototype.destroy.call(this);this.element.off().removeClass("")}});$.extend($.ui.igToolbarButton,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI ColorPicker 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 * <Licensing info>
 *
 * http://www.infragistics.com/
 * 
 * Depends on: 
 *   jquery-1.9.1.js
 *   jquery.ui.core.js
 *   jquery.ui.widget.js
 *   infragistics.util.js
 *   infragistics.ui.shared.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igColorPicker",{options:{colors:[["#ffffff","#000000","#EEECE1","#1F497D","#4F81BD","#C0504D","#9BBB59","#8064A2","#4BACC6","#F79646"],["#F2F2F2","#7F7F7F","#DDD9C3","#C6D9F0","#DBE5F1","#F2DCDB","#EBF1DD","#E5E0EC","#DBEEF3","#FDEADA"],["#D8D8D8","#595959","#C4BD97","#8DB3E2","#B8CCE4","#E5B9B7","#D7E3BC","#CCC1D9","#B7DDE8","#FAC08F"],["#BFBFBF","#3F3F3F","#938953","#548DD4","#95B3D7","#D99694","#C3D69B","#B2A1C7","#92CDDC","#FAC08F"],["#A5A5A5","#262626","#494429","#17365D","#366092","#953734","#76923C","#5F497A","#31859B","#E36C09"],["#7F7F7F","#0C0C0C","#1D1B10","#0F243E","#244061","#632423","#4F6128","#3F3151","#205867","#974806"]],standardColors:["#C00000","#FF0000","#FFC000","#FFFF00","#92D050","#00B050","#00B0F0","#0070C0","#002060","#7030A0"]},events:{colorSelected:"colorSelected"},css:{standardColorsRow:"ui-colorpicker-standardcolors",baseClass:"ui-igColorPicker",colorTable:"igColorPicker-table",customColors:"igColorPicker-customColors",defaultColors:"ui-colorpicker-standardcolors",colorsRow:"igColorPicker-row",colorsCol:"igColorPicker-col",colorpickerColor:"igColorPicker-color"},_create:function(){this._colorTable=$("<div>");this._colorTable.addClass(this.css.colorTable);this._colorTable.appendTo(this.element);this._addOrChangeColors(this.options.colors);this._addOrChangeStandardColors(this.options.standardColors)},_addOrChangeColors:function(colors){var colsLength,row,col,rowsLength=colors.length,customColorsHtml="";if(this._customColors&&this._customColors.length>0){this._customColors.html("")}else{this._customColors=$("<div>").addClass(this.css.customColors);this._customColors.appendTo(this._colorTable)}for(row=0;row<rowsLength;row++){customColorsHtml+="<div class= "+this.css.colorsRow+">";colsLength=colors[row].length;for(col=0;col<colsLength;col++){customColorsHtml+="<div class="+this.css.colorpickerColor+' style="background-color: '+colors[row][col]+';"></div>'}customColorsHtml+="</div>"}this._customColors.html(customColorsHtml)},_addOrChangeStandardColors:function(colors){var item,defaultColorsHtml="";if(this._defaultColors&&this._defaultColors.length>0){this._defaultColors.html("")}else{this._defaultColors=$("<div>").addClass(this.css.defaultColors);this._defaultColors.appendTo(this._colorTable)}for(item=0;item<colors.length;item++){defaultColorsHtml+="<div class="+this.css.colorpickerColor+' style="background-color: '+colors[item]+';"></div>'}this._defaultColors.html(defaultColorsHtml)},_getColor:function($element){return $element.css("background-color")},_init:function(){this.element.addClass(this.css.baseClass);this._bindEvents()},_bindEvents:function(){var self=this;this._colorTable.delegate("."+this.css.colorpickerColor,"click",function(e){var target=$(e.target);e.preventDefault();self._changeSelectedColor(target);self._trigger(self.events.colorSelected,e,{color:self._getColor(target)})})},_changeSelectedColor:function(target){this._colorTable.find("div.selected-color").removeClass("selected-color");target.addClass("selected-color")},_setOption:function(key,value){var options=this.options;if(options[key]===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(key){case"standardColors":this._addOrChangeStandardColors(value);break;case"colors":this._addOrChangeColors(value);break}},_rgbToHex:function(color){var r,g,b,colHex;if(color.charAt(0)==="r"){color=color.replace("rgb(","").replace(")","").split(",");r=parseInt(color[0],10).toString(16);g=parseInt(color[1],10).toString(16);b=parseInt(color[2],10).toString(16);r=r.length===1?"0"+r:r;g=g.length===1?"0"+g:g;b=b.length===1?"0"+b:b;colHex="#"+r+g+b;return colHex}},selectColor:function(color){var self=this;this._colorTable.find("div.selected-color").removeClass("selected-color");var matching=this._colorTable.find("div").filter(function(index,item){var hexColor=self._rgbToHex(item.style.backgroundColor);return hexColor&&hexColor===color.toLowerCase()});if(matching.length>0){matching.addClass("selected-color")}}});$.extend($.ui.igColorPicker,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI ColorPickerSplitButton 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 * <Licensing info>
 *
 * http://www.infragistics.com/
 * 
 * Depends on: 
 *   jquery-1.9.1.js
 *   jquery.ui.core.js
 *   jquery.ui.widget.js
 *   infragistics.util.js
 *   infragistics.ui.shared.js
 *   infragistics.ui.popover.js
 *   infragistics.ui.toolbarbutton.js
 *   infragistics.ui.splitbutton.js
 *   infragistics.ui.colorpicker.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igColorPickerSplitButton",$.ui.igSplitButton,{options:{items:[],defaultColor:"#000",hasDefaultIcon:true},_create:function(){$.ui.igSplitButton.prototype._create.call(this);this._setButtonColorIndicator(this.options.defaultColor)},_createItemsList:function(){var popoverCont,popoverOptions;this._options.popover=$('<div id="'+this._id("_popover")+'"></div>').appendTo(this.element);if($.ig.util.isTouchDevice()){popoverOptions={direction:"bottom",closeOnBlur:false,width:480,height:360,maxWidth:480,maxHeight:360,defaultMaxWidth:null}}else{popoverOptions={direction:"bottom",closeOnBlur:false,width:220,defaultMaxWidth:null}}this._options.popover.igPopover(popoverOptions);popoverCont=this._options.popover.igPopover("container");this._options.itemsList=popoverCont.igColorPicker()},_attachEvents:function(){$.ui.igSplitButton.prototype._attachEvents.call(this);this._options.itemsList.on("igcolorpickercolorselected",$.proxy(this._onColorSelect,this));this._options.defaultButton.on("igtoolbarbuttonclick",$.proxy(this._onDefaultButtonClick,this));this._options.itemsList.parent().parent().on("mousedown",$.proxy(this._preventCollapsing,this))},collapse:function(e){var _opt=this._options;_opt.popover.igPopover("hide");this.element.removeClass(this.css.active);_opt.expandButton.removeClass(this.css.focus);_opt.isExpanded=false;if(e){this._triggerCollapsed(e)}},expand:function(e){var _opt=this._options;_opt.popover.igPopover("show",this.element);this.element.addClass(this.css.active);_opt.isExpanded=true;if(e){this._triggerExpanded(e)}},_onItemClick:function(){return false},_onColorSelect:function(e,ui){this._setButtonColorIndicator(ui.color);this.options.defaultColor=ui.color;this._trigger("colorSelected",e,{value:ui.color,item:this.element});this.collapse()},setColor:function(color){this._options.itemsList.igColorPicker("selectColor",color);this._setButtonColorIndicator(color);this.options.defaultColor=color;this.collapse()},_onDefaultButtonClick:function(e){e.stopPropagation();this._trigger("colorSelected",e,{value:this.options.defaultColor,item:this.element})},_setButtonColorIndicator:function(color){this._options.defaultButton.children(":first").css("border-bottom-color",color);if(!this.options.hasDefaultIcon){this._options.defaultButton.children(":first").css("background-color",color);this._options.defaultButton.children(":first").css("background-image","none")}},_preventCollapsing:function(){return false},_setOption:function(key,value){var options=this.options,self=this;if(options[key]===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(key){case"defaultColor":self.setColor(value);break}},destroy:function(){$.ui.igSplitButton.prototype.destroy.apply(this,arguments)}});$.extend($.ui.igColorPickerSplitButton,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Toolbar 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 * <Licensing info>
 *
 * http://www.infragistics.com/
 * 
 * Depends on: 
 *   jquery-1.9.1.js
 *   jquery.ui.core.js
 *   jquery.ui.widget.js
 *   infragistics.util.js
 *   infragistics.ui.shared.js
 *   infragistics.ui.popover.js
 *   infragistics.ui.toolbarbutton.js
 *   infragistics.ui.splitbutton.js
 *   infragistics.ui.colorpicker.js
 *   infragistics.ui.colorpickersplitbutton.js
 *   infragistics.ui.combo.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.ig=$.ig||{};$.ig.igToolbarItemBaseDescriptor=Class.extend({settings:{width:null,height:null,props:{scope:{value:null}}},_updatedProperties:[],init:function(item){this.settings=$.extend(true,{},this.settings,item);this.name=item.name;this.type=item.type;if(this.settings.scope){this.settings.props.scope=this.settings.scope}},updateProperty:function(name,value){this.settings.props[name].value=value;this._updatedProperties.push(this.settings.props[name])},getProperty:function(name){return this.settings.props[name]},getUpdatedProperties:function(){return this._updatedProperties},getProperties:function(){return this.settings.props},callbackRenderer:function(){if(this.settings.callbackRenderer&&$.isFunction(this.settings.callbackRenderer)){return this.settings.callbackRenderer()}},handler:function(){return this.settings.handler}});$.ig.igToolbarButtonDescriptor=$.ig.igToolbarItemBaseDescriptor.extend({settings:{props:{onlyIcons:{value:true},labelText:{value:"&nbsp;"}}},init:function(item){this._super(item)}});$.ig.igToolbarSplitButtonDescriptor=$.ig.igToolbarItemBaseDescriptor.extend({settings:{props:{items:[]}},init:function(item){this._super(item)}});$.ig.igToolbarComboDescriptor=$.ig.igToolbarItemBaseDescriptor.extend({settings:{props:{valueKey:{value:"text"},textKey:{value:"value"},dropDownOnFocus:{value:true},enableClearButton:{value:false},dataSource:{value:null},mode:{value:"dropdown"},inputName:{value:null}}},init:function(item){this._super(item);if(this.settings.dataSource){this.settings.props.dataSource.value=this.settings.dataSource}}});$.widget("ui.igToolbar",{options:{height:null,width:null,allowCollapsing:true,collapseButtonIcon:"ui-igbutton-collapsed",expandButtonIcon:"ui-igbutton-expanded",name:"",displayName:"",items:[],isExpanded:true},events:{toolbarButtonClick:"toolbarButtonClick",toolbarComboOpening:"toolbarComboOpening",toolbarComboSelected:"toolbarComboSelected",toolbarCustomItemClick:"toolbarCustomItemClick",itemRemoved:"itemRemoved",itemAdded:"itemAdded",collapsing:"collapsing",collapsed:"collapsed",expanding:"expanding",expanded:"expanded",itemDisable:"itemDisable",itemEnabled:"itemEnabled",windowResized:"windowResized"},css:{toolbarWidget:"ui-widget ui-widget-content ui-igtoolbar ui-corner-all",toolbarWrapperConteiner:"ui-widget ui-widget-content ui-igtoolbar ui-corner-all",toolbarCollapsedButton:"ui-state-default ui-igbutton-all-caps",igToolbarSeparator:"ig-toolbar-separator ui-widget-content",igToolbarButtonsHolder:"ig-toolbar-buttons-holder"},_id:function(id){return this.element[0].id+id},widget:function(){return this.element},_create:function(){var itemDescriptor,i,toolbar=this.options;for(i=0;i<toolbar.items.length;i++){if(!toolbar.items[i].type){toolbar.items[i].type="custom"}itemDescriptor=toolbar.items[i]=this._getToolbarItemDescriptor(toolbar.items[i])}this._render();this._createItems();this._onResize()},_getToolbarItemDescriptor:function(item){return new this._toolbarItemsDescriptors[item.type](item)},_toolbarItemsDescriptors:{button:$.ig.igToolbarButtonDescriptor,0:$.ig.igToolbarButtonDescriptor,combo:$.ig.igToolbarComboDescriptor,1:$.ig.igToolbarComboDescriptor,splitButton:$.ig.igToolbarSplitButtonDescriptor,2:$.ig.igToolbarSplitButtonDescriptor,splitButtonColor:$.ig.igToolbarSplitButtonDescriptor,3:$.ig.igToolbarSplitButtonDescriptor,custom:$.ig.igToolbarItemBaseDescriptor},_init:function(){this._attachEvents();if(!this.options.isExpanded){this.buttonsList.hide();this.collapseBtn.igToolbarButton("toggle").children(":first").switchClass(this.options.collapseButtonIcon,this.options.expandButtonIcon)}this._width=this.collapseBtn.outerWidth(true)+this.buttonsList.width();this._height=this.element.height()},_render:function(){var o=this.options;this.element.addClass(this.css.toolbarWidget).width(this.options.width).height(this.options.height);this.collapseBtn=$('<div tabIndex="0" id="'+this._id("_collapseButton")+'"></div>').appendTo(this.element).igToolbarButton({onlyIcons:true,labelText:"&nbsp;",title:$.ig.Toolbar.locale.collapseButtonTitle+" "+this.options.displayName,icons:{primary:o.collapseButtonIcon}});this.toolbarBody=this.element.find("#"+this._id("_toolbar"));this.buttonsList=$('<div id="'+this._id("_toolbar_buttons")+'" class="'+this.css.igToolbarButtonsHolder+'"></div>').appendTo(this.element)},_onCollapse:function(e){var noCancel,event,cancelableEvent,options=this.options,width,self=this;if(!options.allowCollapsing){return}e.stopPropagation();if(options.isExpanded){event="collapsed";cancelableEvent="collapsing";noCancel=this._trigger(this.events[cancelableEvent],e,{owner:this,toolbarElement:this.element,toolbar:{}});if(noCancel){options.isExpanded=false;width=this.element.height();this._oldWidth=this._width;this.collapseBtn.attr("title",$.ig.Toolbar.locale.expandButtonTitle+" "+this.options.displayName).children(":first").switchClass(this.options.collapseButtonIcon,this.options.expandButtonIcon)}}else{event="expanded";cancelableEvent="expanding";noCancel=this._trigger(this.events[cancelableEvent],e,{owner:this,toolbarElement:this.element,toolbar:{}});if(noCancel){options.isExpanded=true;this.buttonsList.show();width=this._getAdjustedWidth();this.collapseBtn.attr("title",$.ig.Toolbar.locale.collapseButtonTitle+" "+this.options.displayName).children(":first").switchClass(this.options.expandButtonIcon,this.options.collapseButtonIcon)}}if(noCancel){this.element.css({overflow:"hidden"});this.element.animate({width:width},300,null,function(){if(!options.isExpanded){self.buttonsList.hide()}else{self.element.css("width","")}self._trigger(self.events[event],e,{owner:self,toolbarElement:self.element,toolbar:{}})})}},_getAdjustedWidth:function(){var width;if(!this.options.isExpanded){width=this.element.height()}else{width=this.buttonsList.outerWidth(true)+this.collapseBtn.outerWidth(true)}return width},_setOption:function(name,value){$.Widget.prototype._setOption.apply(this,arguments);var options=this.options;switch(name){case"allowCollapsing":this.options.allowCollapsing=value;break;case"items":this._updateItems(value);break;case"width":this.element.width(value);break;case"height":this.element.height(value);break;case"isExpanded":if(options.allowCollapsing){this._expandOrCollapse()}break}},_expandOrCollapse:function(){var self=this;if(self.options.isExpanded){self.buttonsList.show();this._oldWidth=this._width;self.collapseBtn.attr("title",$.ig.Toolbar.locale.collapseButtonTitle+" "+self.options.displayName).children(":first").switchClass(self.options.expandButtonIcon,self.options.collapseButtonIcon)}else{if(typeof self._oldWidth!=="undefined"){self.element.width(self._oldWidth)}this._oldWidth=this._width;self.buttonsList.hide();self.collapseBtn.attr("title",$.ig.Toolbar.locale.expandButtonTitle+" "+self.options.displayName).children(":first").switchClass(self.options.collapseButtonIcon,self.options.expandButtonIcon)}this._onResize()},_isSelectedAction:function(el,props){if(props.value){el.addClass("ui-state-active")}},_createItems:function(){var o=this.options,i,self=this,itemProps={},newItem,tbItemsHash={button:"igToolbarButton",combo:"igCombo",splitButton:"igSplitButton",splitButtonColor:"igColorPickerSplitButton"},tbItemsPropsTraversing=function(key,property){var scope=o.items[i].scope||self;if(property.action!==undefined&&$.isFunction(scope[property.action])){scope[property.action](newItem,property,itemProps);return}itemProps[key]=property.value};this.buttonsList.empty();for(i=0;i<o.items.length;i++){itemProps={};newItem=(o.items[i].callbackRenderer()||$('<div tabIndex="0"></div>')).attr("id",this._id("_item_"+o.items[i].name)).appendTo(this.buttonsList);$.each(o.items[i].getProperties(),tbItemsPropsTraversing);if(tbItemsHash.hasOwnProperty(o.items[i].type)){newItem[tbItemsHash[o.items[i].type]](itemProps)}}},_updateItems:function(items){var options=this.options,updProps,scope,el,key,i,j;for(i=0;i<items.length;i++){updProps=items[i].getUpdatedProperties();el=this.getItem(items[i].name);scope=options.items[i].scope||this;for(j=0;j<updProps.length;j++){if(updProps[j].action!==undefined&&$.isFunction(scope[updProps[j].action])){scope[updProps[j].action](el,updProps[j])}else{if(items[i]instanceof $.ig.igToolbarButtonDescriptor){el.igToolbarButton("option",key,updProps[j])}if(options.items[i]instanceof $.ig.igToolbarComboDescriptor){el.igCombo("option",key,updProps[j])}}}}},_tooltipAction:function(el,props,itemOptionObj){if(itemOptionObj!==undefined){itemOptionObj.title=props.value}else{el.igToolbarButton("option","title",props.value)}},_buttonIconAction:function(el,props,itemOptionObj){if(itemOptionObj!==undefined){itemOptionObj.icons={primary:props.value}}else{el.igToolbarButton("option","icons",{primary:props.value})}},_comboDataSourceAction:function(el,props,itemOptionObj){if(itemOptionObj!==undefined){itemOptionObj.dataSource=props.value}else{el.igCombo("option","dataSource",props.value)}},_comboWidthAction:function(el,props,itemOptionObj){if(itemOptionObj!==undefined){itemOptionObj.width=props.value}else{el.igCombo("option","width",props.value)}},_comboHeightAction:function(el,props,itemOptionObj){if(itemOptionObj!==undefined){itemOptionObj.height=props.value}else{el.igCombo("option","height",props.value)}},_comboSelectedItem:function(el,props,itemOptionObj){if(itemOptionObj!==undefined){itemOptionObj.initialSelectedItems=[{value:props.value}]}else{el.igCombo("value",props.value)}},_spltButtonColorAction:function(el,props,itemOptionObj){if(itemOptionObj!==undefined){itemOptionObj.defaultColor=props.value}else{el.igColorPickerSplitButton("option","defaultColor",props.value)}},_comboDropDownListWidth:function(el,props,itemOptionObj){if(itemOptionObj!==undefined){itemOptionObj.dropDownWidth=props.value}else{el.igCombo("option","dropDownWidth",props.value)}},_getWidgetType:function(el){var data,i;if(el!==undefined){data=el.data();for(i in data){if(data.hasOwnProperty(i)&&data[i].widgetName){return data[i].widgetName}}}},_isWidgetSupported:function(name){var i;for(i=0;i<this.supportedWidgets.length;i++){if(this.supportedWidgets[i].name===name){return true}}},_attachEvents:function(){var toolbarItemsEvents="igtoolbarbuttonclick igsplitbuttonclick igcolorpickersplitbuttoncolorselected";this.element.delegate(".ui-widget",toolbarItemsEvents,$.proxy(this._onToolbarItemInteraction,this));this.element.delegate(":ui-igCombo","igcomboselectionchanged",$.proxy(this._onComboListItemClick,this)).delegate(":ui-igCombo","igcombodropdownclosed",$.proxy(this._onComboDropDownClose,this));this.collapseBtn.bind("igtoolbarbuttonclick",$.proxy(this._onCollapse,this));$(window).on("resize",$.proxy(this._onResize,this))},_onToolbarItemInteraction:function(e,ui){var selectedItemValue,selectedItemIndex,triggeredEvent,targetWidget=$(e.target).parentsUntil(":ui-igToolbar").eq(-2),o=this.options;if(targetWidget.length===0){targetWidget=$(e.target)}selectedItemIndex=this.buttonsList.children().index(targetWidget);switch(e.type){case"igtoolbarbuttonclick":triggeredEvent=this.events.toolbarButtonClick;break;default:triggeredEvent=this.events.toolbarCustomItemClick;selectedItemValue=ui.data?ui.data.text:ui.value;break}this._trigger(triggeredEvent,e,{name:ui.name||o.items[selectedItemIndex].name,value:selectedItemValue,handler:o.items[selectedItemIndex].handler(),scope:o.items[selectedItemIndex].getProperty("scope"),itemProperties:o.items[selectedItemIndex].getProperties(),toolbarItem:targetWidget,toolbarName:o.name})},_onComboDropDownClose:function(e,data){if(this._delayComboSelectionChanged){this._delayComboSelectionChanged=false;data.items=$(e.currentTarget).igCombo("selectedItems");this._onComboListItemClick(e,data)}},_onComboListItemClick:function(e,data){var toolbarItemIndex,toolbarItem;if(e.which>=37&&e.which<=40){this._delayComboSelectionChanged=true;return}else{this._delayComboSelectionChanged=false}toolbarItemIndex=this.buttonsList.children().index($(e.currentTarget));toolbarItem=this.options.items[toolbarItemIndex];this._trigger(this.events.toolbarComboSelected,e,{name:toolbarItem.name,value:data.items[0].data?data.items[0].data.text:data.items[0].value,handler:toolbarItem.handler(),scope:toolbarItem.getProperty("scope"),itemProperties:toolbarItem.getProperties(),toolbarItem:data.owner,toolbarName:this.options.name})},_onResize:function(){var isVisible=this.element.is(":visible"),parentWidth=this.element.parent().width();while(isVisible&&this.options.isExpanded&&this.element.outerWidth()>parentWidth){this._hideButtonFromToolbar()}while(this._hiddenButtons&&this._hiddenButtons.length>0&&parentWidth>this.element.outerWidth()+this._hiddenButtons[this._hiddenButtons.length-1].width()){this._showHiddenButtonFromToolbar()}this._trigger(this.events.windowResized)},_hideButtonFromToolbar:function(){var buttonToHide,notHiddenButtons=this.buttonsList.children().filter(function(){return $(this).css("display")!=="none"});if(this._hiddenButtons===undefined){this._hiddenButtons=[]}buttonToHide=$(notHiddenButtons[notHiddenButtons.length-1]);if(typeof buttonToHide.length!=="undefined"){buttonToHide.hide();this._hiddenButtons.push(buttonToHide)}},_showHiddenButtonFromToolbar:function(){this._hiddenButtons[this._hiddenButtons.length-1].show();this._hiddenButtons.pop()},getItem:function(index){var result;if(!isNaN(parseInt(index,10))){return this.buttonsList.children().eq(index)}if(typeof index==="string"){result=this.buttonsList.find("#"+this._id("_item_"+index));if(result.length){return result}}},addItem:function(item){if(this._isWidgetSupported(item.type)){this.options.items.push(item);this._createItems();this._trigger(this.events.itemAdded)}},removeItem:function(index){this.buttonsList.children().eq(index).remove();this._trigger(this.events.itemremoved)},disableItem:function(index,disabled){var item=this.getItem(index),widgetType=this._getWidgetType(item);if(widgetType){item[this._getWidgetType(item)]("option","disabled",disabled);this._trigger(this.events.itemDisable,{isDisabled:disabled})}},activateItem:function(index,activated){var item=this.getItem(index),action=activated?item.addClass:item.removeClass;action.call(item,"ui-state-active");item.igToolbarButton("option","isSelected",activated);this._trigger(this.events.itemEnabled,{isActivated:activated})},deactivateAll:function(){this.buttonsList.find(".ui-igbutton.ui-state-active").igToolbarButton("deactivate")},_setCollapseExpandButtonIcon:function(){if(this.options.collapseButtonIcon){this.collapseBtn.switchClass("ui-icon-triangle-1-w",this.options.collapseButtonIcon)}},destroy:function(){this.element.undelegate().unbind();this.collapseBtn.igToolbarButton("destroy").remove();this.buttonsList.remove();this.element.removeClass();$.Widget.prototype.destroy.apply(this,arguments)}});$.extend($.ui.igToolbar,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Tile Manager 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *  jquery-1.8.0.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	modernizr.js (Optional)
 *	infragistics.templating.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 *  infragistics.ui.splitter.js
 *	infragistics.ui.layoutmanager.js
 *	infragistics.ui.tilemanager-en.js
 */
(function($){$.widget("ui.igTileManager",{css:{container:"ui-widget ui-igtilemanager ui-widget-content",leftPanel:"ui-igtilemanager-left",rightPanel:"ui-igtilemanager-right",header:"ui-widget-header ui-igtile-header",content:"ui-widget-content ui-igtile",innerContainer:"ui-igtile-inner-container",minimized:"ui-igtile-minimized",maximized:"ui-igtile-maximized",minimizeButton:"ig-button ig-tile-minimize-button",minimizeIcon:"ui-icon ig-tile-minimize-icon",hoverClass:"ui-state-hover",hidden:"ui-helper-hidden",overflowHidden:"ui-helper-overflow-hidden",overflowVisible:"ui-helper-overflow-visible",visibilityHidden:"ui-helper-visibility-hidden",splitterNoScroll:"ui-igsplitter-no-scroll"},options:{width:null,height:null,columnWidth:null,columnHeight:null,cols:null,rows:null,marginLeft:0,marginTop:0,rearrangeItems:true,items:null,dataSource:null,minimizedState:null,maximizedState:null,maximizedTileIndex:null,rightPanelCols:1,rightPanelTilesWidth:null,rightPanelTilesHeight:null,showRightPanelScroll:true,showSplitter:true,preventMaximizingSelector:"a, input",animationDuration:500,dataSourceUrl:null,responseDataKey:null,responseDataType:null,dataSourceType:null,requestType:"GET",responseContentType:null},events:{dataBinding:"dataBinding",dataBound:"dataBound",rendering:"rendering",rendered:"rendered",tileRendering:"tileRendering",tileRendered:"tileRendered",tileMaximizing:"tileMaximizing",tileMaximized:"tileMaximized",tileMinimizing:"tileMinimizing",tileMinimized:"tileMinimized"},_selectors:{tileSelector:".ui-igtile",minimizedTileSelector:".ui-igtile-minimized",minimizeBtnSelector:".ig-tile-minimize-button",minimizeIconSelector:".ig-tile-minimize-icon",leftPanelSelector:".ui-igtilemanager-left",rightPanelSelector:".ui-igtilemanager-right",splitbarSelector:".ui-igsplitter-splitbar-vertical",innerContainerSelector:".ui-igtile-inner-container"},_createWidget:function(){$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){var opt=this.options;this._options={$tiles:null,$maximizedTile:null,$leftPanel:null,$rightPanel:null,$layoutManagerElement:null,fromMarkup:false,animating:false,useMaximizedTileIndex:false,rightPanelWidth:0,gridLayout:null,elementHandlers:{},windowHandlers:{}};this.element.addClass(this.css.container);if(opt.width){this.element.css("width",opt.width)}if(opt.height){this.element.css("height",opt.height)}this.options.tileSelector=this.options.tileSelector||this._selectors.tileSelector;if(opt.dataSource!==null){this.dataBind()}else{this._options.fromMarkup=true;this._initFromMarkup()}if(this.options.disabled){this.options.disabled=false;this._setOption("disabled",true)}this._attachEvents()},_setOption:function(option,value){if(this.options[option]===value){return}var i,len,itemsMerged,items,glOption,self=this,_opt=this._options;$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"dataSource":this.dataBind();break;case"dataSourceUrl":this.dataBind();break;case"width":if(!_opt.useMaximizedTileIndex){this.minimize(0)}this.element.width(this.options.width);this.reflow(true,0);break;case"height":if(!_opt.useMaximizedTileIndex){this.minimize(0)}this.element.height(this.options.height);this.reflow(true,0);break;case"columnWidth":case"columnHeight":case"cols":case"rows":case"marginLeft":case"marginTop":case"rearrangeItems":if(!_opt.useMaximizedTileIndex){this.minimize(0)}glOption={};glOption[option]=value;_opt.$layoutManagerElement.igLayoutManager("option","gridLayout",glOption);_opt.gridLayout=this.layoutManager()._opt.gridLayout;break;case"items":if(value.length!==_opt.$tiles.length){throw new Error($.ig.TileManager.locale.setOptionItemsLengthError)}if(_opt.useMaximizedTileIndex){itemsMerged=$.extend(true,[],this._options.$layoutManagerElement.igLayoutManager("option","items"),value)}else{this.minimize(0)}_opt.$layoutManagerElement.igLayoutManager("option","items",value);_opt.gridLayout=this.layoutManager()._opt.gridLayout;if(_opt.useMaximizedTileIndex){items=this._options.$layoutManagerElement.igLayoutManager("option","items");len=items.length;for(i=0;i<len;i++){$.extend(true,items[i],itemsMerged[i])}this.layoutManager()._glSortItemsByPositionOrder();_opt.gridLayout.initialItems=$.extend(true,[],this._options.$layoutManagerElement.igLayoutManager("option","items"))}this.reflow(true,0);break;case"minimizedState":_opt.$tiles.not(_opt.$maximizedTile).each(function(){self._toMinimizedState($(this))});break;case"maximizedState":if(_opt.$maximizedTile){this._toMaximizedState(_opt.$maximizedTile)}break;case"maximizedTileIndex":this._toMinimizedState(_opt.$maximizedTile);_opt.$maximizedTile=_opt.$tiles.filter("[data-index="+this.options.maximizedTileIndex+"]");this._toMaximizedState(_opt.$maximizedTile);break;case"rightPanelCols":if(_opt.$maximizedTile&&!_opt.useMaximizedTileIndex){this._setRightPanelSize();this._positionRightPanelTiles(_opt.$tiles.not(_opt.$maximizedTile),parseInt(_opt.$maximizedTile.attr("data-index"),10),false,false)}break;case"rightPanelTilesWidth":if(_opt.$maximizedTile&&!_opt.useMaximizedTileIndex){this._setRightPanelSize();this._positionRightPanelTiles(_opt.$tiles.not(_opt.$maximizedTile),parseInt(_opt.$maximizedTile.attr("data-index"),10),false,true)}break;case"rightPanelTilesHeight":if(_opt.$maximizedTile&&!_opt.useMaximizedTileIndex){this._setRightPanelSize();this._positionRightPanelTiles(_opt.$tiles.not(_opt.$maximizedTile),parseInt(_opt.$maximizedTile.attr("data-index"),10),false,true)}break;case"showRightPanelScroll":if(!_opt.useMaximizedTileIndex){if(value){_opt.$rightPanel.removeClass(this.css.overflowHidden)}else{_opt.$rightPanel.addClass(this.css.overflowHidden)}if(_opt.$maximizedTile){this._setRightPanelSize()}}break;case"showSplitter":if(this.options.showSplitter){this.element.children(this._selectors.splitbarSelector).removeClass(this.css.visibilityHidden)}else{this.element.children(this._selectors.splitbarSelector).addClass(this.css.visibilityHidden)}break;case"animationDuration":this.layoutManager().options.gridLayout.animationDuration=value;break;case"disabled":this._toggleDisbaled(value);break;default:break}},_initFromMarkup:function(){var $tiles,$children=this.element.children(),$filtered=$children.filter(this.options.tileSelector);if($filtered.length){$tiles=$filtered;$children.not($tiles).addClass(this.css.hidden)}else{$tiles=this.element.children()}$tiles.wrap("<div>");this._initLayoutManager($tiles)},_renderData:function(success,msg,data){var _opt=this._options;this._triggerDataBound(success,msg,data._data);if(success){if(_opt.$layoutManagerElement){_opt.$layoutManagerElement.igLayoutManager("destroy");if(!_opt.useMaximizedTileIndex){this.element.igSplitter("destroy")}this._resetInternalOptions()}this.element.empty();this._initLayoutManager(data._data)}else{throw new Error($.ig.TileManager.locale.renderDataError)}},_resetInternalOptions:function(){var _opt=this._options;_opt.gridLayout=null;_opt.$layoutManagerElement=null;_opt.$leftPanel=null;_opt.$rightPanel=null;_opt.$maximizedTile=null;_opt.$tiles=null;_opt.animating=false},_initDataSource:function(){var opt=this.options,dataOpt;if(!opt.dataSource&&opt.dataSourceUrl){opt.dataSource=opt.dataSourceUrl}if(!(opt.dataSource instanceof $.ig.DataSource)){dataOpt={callback:this._renderData,callee:this,dataSource:opt.dataSource,requestType:opt.requestType,responseContentType:opt.responseContentType,responseDataType:opt.responseDataType,localSchemaTransform:false};if(opt.responseDataKey){dataOpt.responseDataKey=opt.responseDataKey}if(opt.dataSourceType){dataOpt.dataSourceType=opt.dataSourceType}opt.dataSource=new $.ig.DataSource(dataOpt)}},_tileRendered:function(event,ui){var _opt=this._options,$tile=ui.item,renderMaximizedState=_opt.useMaximizedTileIndex&&this.options.maximizedTileIndex===ui.index,$innerContainer;if(_opt.fromMarkup){$innerContainer=$tile.children();if(!_opt.useMaximizedTileIndex){$innerContainer.prepend(this._renderMinimizeButton())}if(renderMaximizedState){if(this.options.maximizedState){$innerContainer.children().not(this.options.maximizedState).addClass(this.css.hidden)}}else if(this.options.minimizedState){$innerContainer.children().not(this.options.minimizedState).addClass(this.css.hidden)}}else{$innerContainer=$("<div/>").appendTo($tile);if(renderMaximizedState){$innerContainer.html(this._renderMaximizedState(ui.index))}else{$innerContainer.html(this._renderMinimizedState(ui.index))}}$innerContainer.addClass(this.css.innerContainer);$tile.addClass(this.css.content).addClass(renderMaximizedState?this.css.maximized:this.css.minimized);this._triggerTileRendered(event,ui)},_initLayoutManager:function($tiles){var self=this,opt=this.options,_opt=this._options,items=[],lengthDiff,noCancel,i;if(opt.items){$.extend(items,opt.items)}if($tiles.length>items.length){lengthDiff=$tiles.length-items.length;for(i=0;i<lengthDiff;i++){items.push({})}}else{items.splice($tiles.length)}noCancel=this._triggerRendering($tiles,items);if(noCancel){if(!(typeof opt.maximizedTileIndex==="number"&&$tiles.length>=opt.maximizedTileIndex)){this._addPanels();_opt.$leftPanel.addClass(this.css.overflowHidden);this._renderSplitter();_opt.$layoutManagerElement=_opt.$leftPanel;_opt.$leftPanel.igLayoutManager($.extend(true,{},{layoutMode:"grid",items:items,gridLayout:{columnWidth:opt.columnWidth,columnHeight:opt.columnHeight,cols:opt.cols,rows:opt.rows,marginLeft:opt.marginLeft,marginTop:opt.marginTop,rearrangeItems:opt.rearrangeItems,animationDuration:opt.animationDuration,overrideConfigOnSetOption:false,useOffset:false},itemRendered:function(event,ui){noCancel=self._triggerTileRendering(event,ui);if(noCancel){self._tileRendered(event,ui)}},rendered:function(){_opt.gridLayout=self.layoutManager()._opt.gridLayout;_opt.$leftPanel.removeClass(self.css.overflowHidden);_opt.$tiles=$(this).data("igLayoutManager")._opt.gridLayout.elements;self._triggerRendered()},internalResizing:function(){if(_opt.$maximizedTile){return false}},internalResized:function(event){self.options.items=self.layoutManager().options.items;if(_opt.$maximizedTile){_opt.animating=false;if(event){self._triggerTileMinimized(event,_opt.$maximizedTile)}_opt.$maximizedTile=null}}}))}else{_opt.useMaximizedTileIndex=true;this.element.addClass(this.css.overflowHidden);_opt.$layoutManagerElement=this.element;this.element.igLayoutManager($.extend(true,{},{layoutMode:"grid",items:items,gridLayout:{columnWidth:opt.columnWidth,columnHeight:opt.columnHeight,cols:opt.cols,rows:opt.rows,marginLeft:opt.marginLeft,marginTop:opt.marginTop,rearrangeItems:opt.rearrangeItems,animationDuration:opt.animationDuration,overrideConfigOnSetOption:false,useOffset:false},itemRendered:function(event,ui){noCancel=self._triggerTileRendering(event,ui);if(noCancel){self._tileRendered(event,ui)}},rendered:function(){_opt.gridLayout=self.layoutManager()._opt.gridLayout;self.element.removeClass(self.css.overflowHidden);_opt.$tiles=$(this).data("igLayoutManager")._opt.gridLayout.elements;self._triggerRendered()},internalResized:function(){self.options.items=self.layoutManager().options.items}}));_opt.$maximizedTile=_opt.$tiles.filter("[data-index="+opt.maximizedTileIndex+"]")}this.options.items=this.layoutManager().options.items}},_toMaximizedState:function($tile){var $innerContChildren,$innerContainer=$tile.children(this._selectors.innerContainerSelector);$tile.removeClass(this.css.minimized).addClass(this.css.maximized);if(!this._options.fromMarkup){$innerContainer.html((this._options.useMaximizedTileIndex?"":this._renderMinimizeButton())+this._renderMaximizedState($tile.attr("data-index")))}else{$innerContChildren=$innerContainer.children();if(this.options.maximizedState){$innerContChildren.not(this.options.maximizedState).addClass(this.css.hidden);$innerContChildren.filter(this.options.maximizedState+", "+this._selectors.minimizeBtnSelector).removeClass(this.css.hidden)}else{$innerContChildren.removeClass(this.css.hidden)}}},_toMinimizedState:function($tile){var $innerContainer=$tile.children(this._selectors.innerContainerSelector),$minimizedState,$children;$tile.removeClass(this.css.maximized).addClass(this.css.minimized);if(!this._options.fromMarkup){$innerContainer.html(this._renderMinimizedState($tile.attr("data-index")))}else{$children=$innerContainer.children();if(this.options.minimizedState){$minimizedState=$children.filter(this.options.minimizedState);$children.not($minimizedState).addClass(this.css.hidden);$minimizedState.removeClass(this.css.hidden)}else{$children.removeClass(this.css.hidden)}}},_renderMaximizedState:function(index){return this.options.maximizedState?$.ig.tmpl(this.options.maximizedState,this.options.dataSource.data()[index]):this._renderMinimizedState(index)},_renderMinimizedState:function(index){return this.options.minimizedState?$.ig.tmpl(this.options.minimizedState,this.options.dataSource.data()[index]):""},_renderMinimizeButton:function(){return'<span class="'+this.css.minimizeButton+'">'+'<span class="'+this.css.minimizeIcon+'"></span></span>'},_addPanels:function(){var _opt=this._options,markup=this.element.children(),$leftPanel=$("<div/>").addClass(this.css.leftPanel),$rightPanel=$("<div/>").addClass(this.css.rightPanel+" "+this.css.hidden);$leftPanel.appendTo(this.element);$rightPanel.appendTo(this.element);_opt.$leftPanel=$leftPanel;_opt.$rightPanel=$rightPanel;if(!this.options.showRightPanelScroll){_opt.$rightPanel.addClass(this.css.overflowHidden)}markup.appendTo(_opt.$leftPanel)},_removePanels:function(){this.element.children(this._selectors.leftPanelSelector).children().appendTo(this.element);this.element.children(this._selectors.leftPanelSelector+", "+this._selectors.rightPanelSelector).remove();this._options.$leftPanel=null;this._options.$rightPanel=null},_renderSplitter:function(){var self=this,_opt=this._options;this.element.igSplitter({panels:[{size:"100%"}],resizeOtherSplitters:false,layoutRefreshing:function(){return false},resizeStarted:function(){_opt.rightPanelWidth=_opt.$rightPanel.width()},resizeEnded:function(){var gl=_opt.gridLayout,rightPanelWidth=_opt.$rightPanel.width(),rightPanelTilesWidth=self._getRightPanelTilesWidth(),rightPanelTilesHeight=self._getRightPanelTilesHeight(),$tiles=_opt.$tiles.not(_opt.$maximizedTile),rightPanelCols,oldRightPanelCols,rightPanelHasScroll;if(_opt.rightPanelWidth>rightPanelWidth){rightPanelCols=Math.floor(rightPanelWidth/(rightPanelTilesWidth+gl.marginLeft))}else{rightPanelCols=Math.ceil(rightPanelWidth/(rightPanelTilesWidth+gl.marginLeft))}rightPanelHasScroll=self.options.showRightPanelScroll&&Math.ceil($tiles.length/rightPanelCols)*(rightPanelTilesHeight+gl.marginTop)>_opt.$rightPanel.height();if(rightPanelHasScroll){if(_opt.rightPanelWidth>rightPanelWidth){rightPanelCols=Math.floor((rightPanelWidth-$.ig.util.getScrollWidth())/(rightPanelTilesWidth+gl.marginLeft))}else{rightPanelCols=Math.ceil((rightPanelWidth-$.ig.util.getScrollWidth())/(rightPanelTilesWidth+gl.marginLeft))}}oldRightPanelCols=self.options.rightPanelCols;self.options.rightPanelCols=rightPanelCols;self._setRightPanelSize();if(oldRightPanelCols!==self.options.rightPanelCols){self._positionRightPanelTiles($tiles,parseInt(_opt.$maximizedTile.attr("data-index"),10),false,false)}_opt.rightPanelWidth=rightPanelWidth}});this._hideSplitterElements()},_attachEvents:function(){var self=this,_opt=this._options,minimizeBtnSelector=this._selectors.minimizeBtnSelector,minimizedTileSelector=this._selectors.minimizedTileSelector,splitter=this.splitter(),elHandlers=_opt.elementHandlers,noCancel;elHandlers.minimizedTileClick=function(event){var $target=$(event.target),$tileToMaximize=$(this);self._stopEventPropagation(event);if(self.options.disabled){return}if($target.is(self.options.preventMaximizingSelector)){return}if(!_opt.animating){_opt.animating=true;$tileToMaximize.removeClass(self.css.hoverClass);noCancel=self._triggerTileMaximizing(event,$tileToMaximize);if(_opt.$maximizedTile){self._triggerTileMinimizing(event,_opt.$maximizedTile,$tileToMaximize)}if(noCancel){self.maximize($tileToMaximize,self.options.animationDuration,event)}else{_opt.animating=false}}};elHandlers.miminimizedTileMouseOver=function(event){self._stopEventPropagation(event);if(self.options.disabled){return}if(!(_opt.animating||splitter&&splitter._isDrag)){$(this).addClass(self.css.hoverClass)}};elHandlers.minimizedTileMouseOut=function(event){self._stopEventPropagation(event);if(self.options.disabled){return}$(this).removeClass(self.css.hoverClass)};elHandlers.minimizeBtnClick=function(event){self._stopEventPropagation(event);if(self.options.disabled){return}if(!_opt.animating){_opt.animating=true;noCancel=self._triggerTileMinimizing(event,_opt.$maximizedTile);if(noCancel){self.minimize(null,event)}else{_opt.animating=false}}};elHandlers.minimizeBtnMouseOver=function(event){self._stopEventPropagation(event);if(self.options.disabled){return}if(!(_opt.animating||splitter&&splitter._isDrag)){$(this).children(self._selectors.minimizeIconSelector).addClass(self.css.hoverClass)}};elHandlers.minimizeBtnMouseOut=function(event){self._stopEventPropagation(event);if(self.options.disabled){return}$(this).children(self._selectors.minimizeIconSelector).removeClass(self.css.hoverClass)};this.element.on("click",minimizedTileSelector,elHandlers.minimizedTileClick).on("mouseover",minimizedTileSelector,elHandlers.miminimizedTileMouseOver).on("mouseout",minimizedTileSelector,elHandlers.minimizedTileMouseOut).on("click",minimizeBtnSelector,elHandlers.minimizeBtnClick).on("mouseover",minimizeBtnSelector,elHandlers.minimizeBtnMouseOver).on("mouseout",minimizeBtnSelector,elHandlers.minimizeBtnMouseOut);_opt.windowHandlers.resize=function(){if(_opt.$maximizedTile&&!_opt.useMaximizedTileIndex){self._setRightPanelSize()}};$(window).on("resize",_opt.windowHandlers.resize)},_stopEventPropagation:function(event){if(event.stopPropagation){event.stopPropagation()}if(event.cancelBubble!==null||event.cancelBubble!==undefined){event.cancelBubble=true}},_getRightPanelTilesWidth:function(){return parseInt(this.options.rightPanelTilesWidth,10)||this._options.gridLayout.columnWidth},_getRightPanelTilesHeight:function(){return parseInt(this.options.rightPanelTilesHeight,10)||this._options.gridLayout.columnHeight},_setRightPanelSize:function(){var self=this,opt=this.options,_opt=this._options,gl=_opt.gridLayout,minMaximizedTileWidth=gl.columnWidth+2*gl.marginLeft,rightTilesTotalWidth=this._getRightPanelTilesWidth()+gl.marginLeft,rightTilesTotalHeight=this._getRightPanelTilesHeight()+gl.marginTop,rightPanelHeight=_opt.$rightPanel.height(),splitterWidth=this.element.children(this._selectors.splitbarSelector).outerWidth(true),scrollWidth=$.ig.util.getScrollWidth(),maxCols,minWidth,rightPanelWidth,leftPanelWidth,rightPanelHasScroll=function(){return self.options.showRightPanelScroll&&Math.ceil((_opt.$tiles.length-1)/self.options.rightPanelCols)*rightTilesTotalHeight>rightPanelHeight};if(opt.rightPanelCols<1){opt.rightPanelCols=1}maxCols=Math.max(Math.floor((this.element.width()-minMaximizedTileWidth-splitterWidth-(rightPanelHasScroll()?scrollWidth:0))/rightTilesTotalWidth),1);if(opt.rightPanelCols>maxCols){opt.rightPanelCols=maxCols}rightPanelWidth=opt.rightPanelCols*rightTilesTotalWidth+(rightPanelHasScroll()?scrollWidth:0);minWidth=rightPanelWidth+minMaximizedTileWidth+splitterWidth;this.element.css("min-width",minWidth);leftPanelWidth=this.element.width()-rightPanelWidth-2*gl.marginLeft-splitterWidth;this.element.igSplitter("setFirstPanelSize",leftPanelWidth)},_positionRightPanelTiles:function($tiles,maximizingTileIndex,containerSwap,animateSize,animDuration,callback){var opt=this.options,_opt=this._options,gl=_opt.gridLayout,rightPanelTilesWidth=this._getRightPanelTilesWidth(),rightPanelTilesHeight=this._getRightPanelTilesHeight(),leftAdjustment=containerSwap?_opt.$rightPanel.position().left-gl.marginLeft:0,topAdjustment=containerSwap?_opt.$rightPanel.scrollTop():0,rightPanelCols=opt.rightPanelCols;animDuration=typeof animDuration==="number"?animDuration:this.options.animationDuration;$tiles.each(function(){var $tile=$(this),tileIndex=parseInt($tile.attr("data-index"),10),tileLeft,tileTop,newDim;if(tileIndex>maximizingTileIndex){tileTop=Math.floor((tileIndex-1)/rightPanelCols)*(rightPanelTilesHeight+gl.marginTop)+gl.marginTop;tileLeft=(tileIndex-1)%rightPanelCols*(rightPanelTilesWidth+gl.marginLeft)+gl.marginLeft/2}else{tileTop=Math.floor(tileIndex/rightPanelCols)*(rightPanelTilesHeight+gl.marginTop)+gl.marginTop;tileLeft=tileIndex%rightPanelCols*(rightPanelTilesWidth+gl.marginLeft)+gl.marginLeft/2}newDim={top:tileTop-topAdjustment,left:tileLeft+leftAdjustment};if(animateSize){newDim.width=rightPanelTilesWidth;newDim.height=rightPanelTilesHeight}$tile.animate(newDim,animDuration,function(){if(containerSwap){$tile.css({left:tileLeft,top:tileTop}).appendTo(_opt.$rightPanel)}if(callback){callback.apply(this)}})})},_hideSplitterElements:function(){var _opt=this._options,$splitBar=this.element.children(this._selectors.splitbarSelector);_opt.$rightPanel.addClass(this.css.hidden).addClass(this.css.splitterNoScroll);$splitBar.addClass(this.css.hidden);_opt.$leftPanel.width("100%");if(!this.options.showSplitter){$splitBar.addClass(this.css.visibilityHidden)}},_showSplitterElements:function(){this._options.$rightPanel.removeClass(this.css.hidden+" "+this.css.splitterNoScroll);this.element.children(this._selectors.splitbarSelector).removeClass(this.css.hidden)},_toMaximizedView:function($tileToMaximize,animDuration,event){var _opt=this._options,marginLeft=_opt.gridLayout.marginLeft;_opt.$tiles.css({left:"-="+marginLeft});_opt.$leftPanel.css({marginLeft:marginLeft,marginRight:marginLeft});this._setRightPanelSize();this._showSplitterElements();this._positionRightPanelTiles(_opt.$tiles.not($tileToMaximize),parseInt($tileToMaximize.attr("data-index"),10),true,true,animDuration);this._maximizeTile($tileToMaximize,animDuration,event)},_maximizedTileSwap:function($tileToMaximize,animDuration,event){var self=this,_opt=this._options,gl=_opt.gridLayout,minimizedTiles=_opt.$tiles.not(_opt.$maximizedTile),$tileToMinimize=_opt.$maximizedTile,tileToMinimizeIndex=parseInt($tileToMinimize.attr("data-index"),10),tileToMaximizeIndex=parseInt($tileToMaximize.attr("data-index"),10),rightPanelOffset=_opt.$rightPanel.position().left-gl.marginLeft;this._toMinimizedState($tileToMinimize);this._positionRightPanelTiles($tileToMinimize,tileToMaximizeIndex,true,true,animDuration,function(){var prevIndex=tileToMinimizeIndex-1,prevTile;if(prevIndex===tileToMaximizeIndex){prevIndex-=1}prevTile=_opt.$tiles.filter("[data-index="+prevIndex+"]");if(prevTile.length>0){$tileToMinimize.insertAfter(prevTile)}else{$tileToMinimize.prependTo(_opt.$rightPanel)}if(event){self._triggerTileMinimized(event,$tileToMinimize)}});this._positionRightPanelTiles(minimizedTiles.not($tileToMaximize),tileToMaximizeIndex,false,false,animDuration);$tileToMaximize.css({left:"+="+rightPanelOffset,top:"-="+_opt.$rightPanel.scrollTop()}).appendTo(_opt.$leftPanel);this._maximizeTile($tileToMaximize,animDuration,event)},_maximizeTile:function($tileToMaximize,animDuration,event){var self=this,_opt=this._options,mt=_opt.gridLayout.marginTop,innerContainer=$tileToMaximize.children(this._selectors.innerContainerSelector);animDuration=typeof animDuration==="number"?animDuration:this.options.animationDuration;this._toMaximizedState($tileToMaximize);innerContainer.addClass(this.css.overflowHidden);$tileToMaximize.animate({width:"100%",height:this.element.height()-2*mt,top:mt,left:0},animDuration,function(){_opt.$leftPanel.removeClass(self.css.overflowVisible);innerContainer.removeClass(self.css.overflowHidden);_opt.$maximizedTile=$tileToMaximize;_opt.animating=false;if(event){self._triggerTileMaximized(event,$tileToMaximize)}})},_maximizeTileWithCustomIndex:function($tileToMaximize,animDuration,event){var itemData,i,self=this,_opt=this._options,$tileToMinimize=_opt.$maximizedTile,tileToMinimizeNewDim={width:$tileToMaximize.outerWidth(),height:$tileToMaximize.outerHeight(),top:$tileToMaximize.css("top"),left:$tileToMaximize.css("left")},tileToMaximizeNewDim={width:$tileToMinimize.outerWidth(),height:$tileToMinimize.outerHeight(),top:$tileToMinimize.css("top"),left:$tileToMinimize.css("left")},swapTilesInConfig=function(itemsConfig){for(i=0;i<itemsConfig.length;i++){itemData=itemsConfig[i];if(itemData.item.is($tileToMinimize)){itemData.item=$tileToMaximize}else if(itemData.item.is($tileToMaximize)){itemData.item=$tileToMinimize}}};this._toMaximizedState($tileToMaximize);this._toMinimizedState($tileToMinimize);$tileToMinimize.animate(tileToMinimizeNewDim,animDuration,function(){if(event){self._triggerTileMinimized(event,$tileToMinimize)}});$tileToMaximize.animate(tileToMaximizeNewDim,animDuration,function(){swapTilesInConfig(self._options.$layoutManagerElement.igLayoutManager("option","items"));swapTilesInConfig(_opt.gridLayout.initialItems);_opt.$maximizedTile=$tileToMaximize;_opt.animating=false;if(event){self._triggerTileMaximized(event,$tileToMaximize)}})},maximize:function($tileToMaximize,animDuration,event){var _opt=this._options;animDuration=typeof animDuration==="number"?animDuration:this.options.animationDuration;if(!$tileToMaximize){return}if(_opt.$maximizedTile&&_opt.$maximizedTile.attr("data-index")===$tileToMaximize.attr("data-index")){return}if(!_opt.useMaximizedTileIndex){_opt.$leftPanel.addClass(this.css.overflowVisible).removeClass(this.css.overflowHidden);if(!_opt.$maximizedTile){this._toMaximizedView($tileToMaximize,animDuration,event)}else{this._maximizedTileSwap($tileToMaximize,animDuration,event)}}else{this._maximizeTileWithCustomIndex($tileToMaximize,animDuration,event)}},minimize:function(animDuration,event){var _opt=this._options,$tileToMinimize=_opt.$maximizedTile,gl=_opt.gridLayout,rightTilesOffset=_opt.$rightPanel.position().left,tileToMinimizeIndex;if(!$tileToMinimize){return}this.element.css("min-width",0);tileToMinimizeIndex=parseInt($tileToMinimize.attr("data-index"),10);_opt.$leftPanel.width(_opt.$leftPanel.outerWidth(true)).height(_opt.$leftPanel.outerHeight(true)).css({margin:0});this._toMinimizedState($tileToMinimize);$tileToMinimize.css({width:$tileToMinimize.outerWidth(),height:$tileToMinimize.outerHeight(),top:gl.marginTop,left:gl.marginLeft});_opt.$tiles.not($tileToMinimize).each(function(){var $tile=$(this);$tile.css({left:"+="+rightTilesOffset,top:"-="+_opt.$rightPanel.scrollTop()});if(parseInt($tile.attr("data-index"),10)>tileToMinimizeIndex){$tile.appendTo(_opt.$leftPanel)}else{$tile.insertBefore($tileToMinimize)}});this._hideSplitterElements();this.reflow(true,animDuration,event)},maximizedTile:function(){return this._options.$maximizedTile||null},minimizedTiles:function(){var minimizedTiles=this._options.$tiles.not(this._options.$maximizedTile);return minimizedTiles.length>0?minimizedTiles:null},splitter:function(){return this._options.useMaximizedTileIndex?null:this.element.data("igSplitter")},layoutManager:function(){return this._options.$layoutManagerElement.data("igLayoutManager")},reflow:function(forceReflow,animationDuration,event){this.layoutManager().reflow(forceReflow,animationDuration,event)},widget:function(){return this.element},_triggerDataBinding:function(){var args={owner:this,dataSource:this.options.dataSource};return this._trigger(this.events.dataBinding,null,args)},_triggerDataBound:function(success,msg,dataView){var args={owner:this,success:success,errorMessage:msg,dataView:dataView};this._trigger(this.events.dataBound,null,args)},_triggerRendering:function(tiles,items){var args={owner:this,tiles:tiles,items:items};return this._trigger(this.events.rendering,null,args)},_triggerRendered:function(){this._trigger(this.events.rendered,null,{owner:this})},_triggerTileRendering:function(event,ui){var args={owner:this,tile:ui.item};return this._trigger(this.events.tileRendering,event,args)},_triggerTileRendered:function(event,ui){var args={owner:this,tile:ui.item};return this._trigger(this.events.tileRendered,event,args)},_triggerTileMaximizing:function(event,tile){var args={owner:this,tile:tile,minimizingTile:this._options.$maximizedTile||null};return this._trigger(this.events.tileMaximizing,event,args)},_triggerTileMaximized:function(event,tile){var args={owner:this,tile:tile};this._trigger(this.events.tileMaximized,event,args)},_triggerTileMinimizing:function(event,tile,maximizingTile){var args={owner:this,tile:tile,maximizingTile:maximizingTile||null};return this._trigger(this.events.tileMinimizing,event,args)},_triggerTileMinimized:function(event,tile){var args={owner:this,tile:tile};this._trigger(this.events.tileMinimized,event,args)},dataBind:function(){var noCancel;this._initDataSource();noCancel=this._triggerDataBinding();if(noCancel){this.options.dataSource.dataBind(this._renderData,this)}},_destroyTiles:function(){var self=this,_opt=this._options;_opt.$layoutManagerElement.igLayoutManager("destroy");if(!_opt.useMaximizedTileIndex){this.element.igSplitter("destroy")}if(_opt.fromMarkup){if(_opt.useMaximizedTileIndex){_opt.$tiles.each(function(){var $tile=$(this);$tile.children().removeClass(self.css.innerContainer).appendTo(self.element).children("."+self.css.hidden).removeClass(self.css.hidden);$tile.remove()})}else{this._removePanels();this.element.children().children().unwrap()}}else{this.element.empty()}},_removeEventHandlers:function(){var _opt=this._options,elHandlers=_opt.elementHandlers,minimizeBtnSelector=this._selectors.minimizeBtnSelector,minimizedTileSelector=this._selectors.minimizedTileSelector;this.element.off("click",minimizedTileSelector,elHandlers.minimizedTileClick).off("mouseover",minimizedTileSelector,elHandlers.miminimizedTileMouseOver).off("mouseout",minimizedTileSelector,elHandlers.minimizedTileMouseOut).off("click",minimizeBtnSelector,elHandlers.minimizeBtnClick).off("mouseover",minimizeBtnSelector,elHandlers.minimizeBtnMouseOver).off("mouseout",minimizeBtnSelector,elHandlers.minimizeBtnMouseOut);$(window).off("resize",_opt.windowHandlers.resize)},_toggleDisbaled:function(value){var splitter=this.splitter(),layoutManager=this._options.$layoutManagerElement.data().igLayoutManager;if(splitter){splitter.options.disabled=value}if(layoutManager){layoutManager.options.disabled=value}},destroy:function(){$.Widget.prototype.destroy.apply(this,arguments);this.element.removeClass(this.css.container);this._destroyTiles();this._removeEventHandlers();return this}});$.extend($.ui.igTileManager,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI jQuery File Upload 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *  jquery-1.4.2.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *  infragistics.util.js
 *  infragistics.ui.shared.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igBrowseButton",$.ui.igButton,{_const:{filePickerWidth:"220px",filePickerHeight:"30px"},css:{filePickerClass:"ui-igbrowsebutton-filepicker"},options:{autoselect:true,multipleFiles:false,container:null},_id:function(id){return this.element[0].id+id},_create:function(){var filepickerId=this._id("_fp"),self=this;$.extend($.ui.igBrowseButton.prototype.options,$.ui.igButton.prototype.options);$.extend($.ui.igBrowseButton.prototype.css,$.ui.igButton.prototype.css);$.ui.igButton.prototype._create.apply(this);this._createFilePicker(filepickerId);this._attachBrowseButtonEvents();if(this.options.disabled===true){this._enableFilePicker(true)}else{this.element.bind({click:function(e){e.preventDefault()},drop:function(e){var files=e.originalEvent.dataTransfer.files;e.stopPropagation();e.preventDefault();if(files===null||files===undefined){return false}if(!self._trigger("fileselect",e,{files:files,multiple:true})){return}return false}})}},_createFilePicker:function(filepickerId){$("#"+filepickerId).remove();var multiple="",container=this.options.container;if(this.options.multipleFiles===true){multiple=' multiple=""'}if(!container){container=$(document.body)}this.filePicker=$('<input type="file" id="'+filepickerId+'"'+multiple+"/>").appendTo(container);this.filePicker.css({position:"absolute",margin:"-5px 0 0 -175px",padding:"0",width:"1px",height:"1px",fontSize:"14px",opacity:"0",cursor:"pointer",display:"block",zIndex:"1000000",filter:"alpha(opacity=0)"});this._setTitle(this.options.title)},_setTitle:function(title){var filePicker=$("#"+this._id("_fp"));if(title===false){filePicker.removeAttr("title")}else{filePicker.attr("title",title)}},_attachBrowseButtonEvents:function(){var self=this;this.mouseMoveEvent={mousemove:function(event){self._mousemove(event)}};this._internalEvents={mouseover:function(event){self._mousemove(event);self._attachMouseMove(true)}};self.element.bind(this._internalEvents);self._filePickerBindChange()},_filePickerBindChange:function(){var self=this,filePath,filePicker=$("#"+this._id("_fp"));self.tempClicked=false;self._filePickerEvents={change:function(event){var files=null,multiple=false;filePath=self._fileFromPath(filePicker.val());if(filePicker[0].files){files=filePicker[0].files;multiple=true}self._mousemove(event);if(!self._trigger("fileselect",event,{filePath:filePath,files:files,multiple:multiple})){return}},click:function(event){if(!self._trigger("click",event)){return false}}};filePicker.bind(self._filePickerEvents)},attachFilePicker:function(e,isHidden){var self=this,right,bottom,t,l,relativeOffset,fileUploadButton=self.element,filePicker=this.filePicker,offset=fileUploadButton.offset(),left=parseInt(offset.left,10),top=parseInt(offset.top,10),filePickerDOM=filePicker[0];right=parseInt(left+fileUploadButton[0].offsetWidth,10);bottom=parseInt(top+fileUploadButton[0].offsetHeight,10);if(e.pageX>=left&&e.pageX<=right&&e.pageY>=top&&e.pageY<=bottom){relativeOffset=$.ig.util.getRelativeOffset(filePicker);t=e.pageY;l=e.pageX;t-=relativeOffset.top;l-=relativeOffset.left;filePickerDOM.style.top=t+"px";filePickerDOM.style.left=l+"px";if(isHidden===true){filePicker.css({width:"1px",height:"1px"})}else{self.isVisibleFilePicker=true;filePicker.css({width:self._const.filePickerWidth,height:self._const.filePickerHeight})}filePickerDOM.style.display="block";self._onMouseOver(e)}},getFilePicker:function(){var filepickerId=this._id("_fp"),filePicker=$("#"+filepickerId);filePicker.attr("id","").css({display:"none"});this._createFilePicker(filepickerId);this._filePickerBindChange();return filePicker},_mousemove:function(e){var self=this,right,bottom,t,l,fileUploadButton=self.element,filePicker=this.filePicker,relativeOffset,left=$.ig.util.offset(fileUploadButton).left,top=$.ig.util.offset(fileUploadButton).top,filePickerDOM=filePicker[0];right=parseInt(left+fileUploadButton[0].offsetWidth,10);bottom=parseInt(top+fileUploadButton[0].offsetHeight,10);if(e.pageX>=left&&e.pageX<=right&&e.pageY>=top&&e.pageY<=bottom){relativeOffset=$.ig.util.getRelativeOffset(filePicker);t=e.pageY;l=e.pageX;t-=relativeOffset.top;l-=relativeOffset.left;filePickerDOM.style.top=t+"px";filePickerDOM.style.left=l+"px";if(!self.isVisibleFilePicker){filePicker.css({width:self._const.filePickerWidth,height:self._const.filePickerHeight});self.isVisibleFilePicker=true}filePickerDOM.style.display="block";self._onMouseOver(e)}else{if(self.isVisibleFilePicker){filePicker.css({width:"1px",height:"1px"});self.isVisibleFilePicker=false}self._attachMouseMove(false);self._onMouseOut(e)}},_attachMouseMove:function(isToAttach){if(isToAttach){$(document).bind(this.mouseMoveEvent)}else{$(document).unbind(this.mouseMoveEvent)}},_setOption:function(key,value){$.ui.igButton.prototype._setOption.apply(this,arguments);$.Widget.prototype._setOption.apply(this,arguments);switch(key){case"disabled":this._enableFilePicker(value);$.ui.igButton.prototype._setOption.apply(this,arguments);break;case"title":this._setTitle(value);break;default:break}},_enableFilePicker:function(isDisabled){var filePicker=$("#"+this._id("_fp"));if(isDisabled===false){this.isVisibleFilePicker=false;this._attachMouseMove(true);this.element.bind(this._internalEvents).mouseover()}else{this._attachMouseMove(false);filePicker.css({width:"1px",height:"1px"});this.element.unbind(this._internalEvents)}},destroy:function(){this.element.unbind(this._internalEvents);this.element.unbind(this.mouseMoveEvent);$.Widget.prototype.destroy.apply(this,arguments);$.ui.igButton.prototype.destroy.apply(this);$("#"+this._id("_fp")).remove()},_fileFromPath:function(file){return file.replace(/(\/|\\)$/,"")}});$.extend($.ui.igBrowseButton,{version:"15.2.20152.1027"});$.widget("ui.igUpload",{_const:{fileNameLimit:100,AjaxQueueName:"uploadrequestsqueue",debug:true,isProgressBarAnimationEnabled:true,isProgressBarRange:false,timeoutGetFileSize:1e3,status:{NotStarted:0,Started:1,Finished:2,NoSuchFile:3,Canceled:4},errorCode:{MimeTypeValidation:1,FileSizeExceeded:2},clientSideErrorCode:{maxAllowedUploadingFiles:1,extensionValidation:2,startUpload:3,ajaxErrorGetFileStatus:4,ajaxErrorCancelUpload:5,removeFileUpload:6,ajaxErrorRequestFileSize:7,checkCanUpload:8,maxFileSizeExcceeded:9,dropMultipleFilesWhenSingleMode:10},fileStatusNoError:-1,progressUpdateInterval:800,animateProgressBarInterval:10,showHideDetailsAnimationTimeout:500,doubleCheckRequestInterval:1e3,removeSingleUploadAnimationTimeout:300,maxUploadFilesDefault:-1},defaultFileExtensionIcons:[{ext:[],css:"ui-icon ui-icon-document ui-igupload-progressbar-icon ui-igupload-progressbar-icon-default",def:true},{ext:["exe","app"],css:"ui-icon ui-icon-gear ui-igupload-progressbar-icon ui-igupload-progressbar-icon-exe",def:false},{ext:["gif","jpg","jpeg","png","bmp","yuv","tif","thm","psd"],css:"ui-icon ui-icon-image ui-igupload-progressbar-icon ui-igupload-progressbar-icon-images",def:false},{ext:["mp3","wav","mp4","aac","mid","wma","ra","iff","aif","m3u","mpa"],css:"ui-icon ui-icon-volume-on ui-icon ui-icon-image ui-igupload-progressbar-icon ui-igupload-progressbar-icon-music",def:false},{ext:["doc","docx","xls","xlsx","txt","ppt","pptx","pdf"],css:"ui-icon ui-icon-document ui-igupload-progressbar-icon ui-igupload-progressbar-icon-docs",def:false},{ext:["3gp","asf","asx","avi","flv","mov","mp4","mpg","rm","swf","vob","wmv"],css:"ui-icon ui-icon-video ui-igupload-progressbar-icon ui-igupload-progressbar-icon-video",def:false}],css:{clearClass:"ui-helper-clearfix",hiddenClass:"ui-helper-hidden",baseClassIE6:"ui-ie6",baseClassIE7:"ui-ie7",baseClassMoz:"ui-moz",baseClassOpera:"ui-opera",baseClassWebkit:"ui-webkit",startupBrowseButtonClasses:"ui-igstartupbrowsebutton",baseClass:"ui-widget ui-widget ui-widget-content ui-corner-all ui-igupload",baseMainContainerClass:"ui-igupload-basemaincontainer",multipleDialogClasses:"ui-iguploadmultiple",singleDialogClass:"ui-iguploadsingle",browseButtonClass:"ui-igupload-browsebutton",containerClass:"ui-igupload-container ui-widget-content",uploadProgressClass:"ui-igupload-uploadprogress",fileInfoMainContainer:"ui-igupload-fimaincontainer",progressContainer:"ui-helper-clearfix",progressBarUploadClass:"ui-igupload-progressbar-upload ui-igupload-progressbar-upload-single ui-helper-clearfix",progressBarFileNameClass:"ui-igupload-progressbar-filename",progressBarFileSizeClass:"ui-igupload-progressbar-filesize",progressBarInnerHTMLContainerClass:"ui-igupload-progressbar-container ui-helper-clearfix",containerButtonCancelClass:"ui-container-button-cancel-class  ui-helper-clearfix",summaryProgressBarClass:"ui-igupload-summaryprogressbar",summaryProgressContainerClass:"ui-igupload-summaryprogresscontainer",summaryProgressbarLabelClass:"ui-igupload-summaryprogress-label",summaryInformationContainerClass:"ui-igupload-summaryinformation-container ui-helper-clearfix",summaryUploadedFilesLabelClass:"ui-igupload-summaryuploadedfiles-label",summaryShowHideDetailsButtonClass:"ui-igupload-showhidedetails-button",summaryButtonClass:"ui-igupload-summary-button",summaryProgressBarInnerProgress:"ui-igupload-summaryprogres_summpbar_progress",summaryProgressBarSecondaryLabel:"ui-igupload-summaryprogress-label ui-igupload-summaryprogress-secondary-label",containerFUS:"ui-widget-content ui-igupload-progress-container ui-corner-all ui-helper-clearfix"},options:{width:"",height:"",autostartupload:false,labelUploadButton:$.ig.Upload.locale.labelUploadButton,labelAddButton:$.ig.Upload.locale.labelAddButton,labelClearAllButton:$.ig.Upload.locale.labelClearAllButton,labelSummaryTemplate:$.ig.Upload.locale.labelSummaryTemplate,labelSummaryProgressBarTemplate:$.ig.Upload.locale.labelSummaryProgressBarTemplate,labelShowDetails:$.ig.Upload.locale.labelShowDetails,labelHideDetails:$.ig.Upload.locale.labelHideDetails,labelSummaryProgressButtonCancel:$.ig.Upload.locale.labelSummaryProgressButtonCancel,labelSummaryProgressButtonContinue:$.ig.Upload.locale.labelSummaryProgressButtonContinue,labelSummaryProgressButtonDone:$.ig.Upload.locale.labelSummaryProgressButtonDone,labelProgressBarFileNameContinue:$.ig.Upload.locale.labelProgressBarFileNameContinue,errorMessageMaxFileSizeExceeded:$.ig.Upload.locale.errorMessageFileSizeExceeded,errorMessageGetFileStatus:$.ig.Upload.locale.errorMessageGetFileStatus,errorMessageCancelUpload:$.ig.Upload.locale.errorMessageCancelUpload,errorMessageNoSuchFile:$.ig.Upload.locale.errorMessageNoSuchFile,errorMessageOther:$.ig.Upload.locale.errorMessageOther,errorMessageValidatingFileExtension:$.ig.Upload.locale.errorMessageValidatingFileExtension,errorMessageAJAXRequestFileSize:$.ig.Upload.locale.errorMessageAJAXRequestFileSize,errorMessageTryToRemoveNonExistingFile:$.ig.Upload.locale.errorMessageTryToRemoveNonExistingFile,errorMessageTryToStartNonExistingFile:$.ig.Upload.locale.errorMessageTryToStartNonExistingFile,errorMessageMaxUploadedFiles:$.ig.Upload.locale.errorMessageMaxUploadedFiles,errorMessageMaxSimultaneousFiles:$.ig.Upload.locale.errorMessageMaxSimultaneousFiles,errorMessageDropMultipleFilesWhenSingleModel:$.ig.Upload.locale.errorMessageDropMultipleFilesWhenSingleModel,uploadUrl:"ig_fua34sf345sdf13sdf3454erdsf2345asd3425df5235d54df345.aspx",progressUrl:"IGUploadStatusHandler.ashx",allowedExtensions:[],showFileExtensionIcon:true,css:null,fileExtensionIcons:[{ext:[],css:"",def:false}],mode:"single",multipleFiles:false,maxUploadedFiles:-1,maxSimultaneousFilesUploads:1,fileSizeMetric:"auto",controlId:"",fileSizeDecimalDisplay:2,maxFileSize:null},events:{fileSelecting:"fileSelecting",fileSelected:"fileSelected",fileUploading:"fileUploading",fileUploaded:"fileUploaded",fileUploadAborted:"fileUploadAborted",cancelAllClicked:"cancelAllClicked",onError:"onError",fileExtensionsValidating:"fileExtensionsValidating",onXHRLoad:"onXHRLoad",onFormDataSubmit:"onFormDataSubmit"},summaryButtonModes:{cancel:1,startupload:2,done:3},container:function(){if(this._isDivElement){return this.element}return $("#"+this.element[0].id+"_wrprinit")},widget:function(){return this.element},_id:function(suffix,formNumber){var id=this.element[0].id;if(formNumber!==undefined){return id+"_"+formNumber+"_"+suffix}return id+suffix},_create:function(){var data={formNumber:0,iframe:{ids:[]},pendingQueueIDs:[],uploadingIDs:[],batch:[],lastId:-1,filesInfo:[],countUploadingFiles:0,countTotalFiles:0,fileSizeUploaded:0,fileSizeTotal:0};this.css=$.extend({},this.css,this.options.css);this.allCancelled=false;this.fileInfoData=data;this._renderStartupBrowseButton();this.container().bind("drop",$.proxy(this._dropFiles,this)).width(this.options.width).height(this.options.height);this._attachFakeIframe();this._analyzeFileExtensionIcons();$(document).bind("dragenter."+this.element[0].id,$.proxy(this._docEnter,this));$(document).bind("dragover."+this.element[0].id,$.proxy(this._docOver,this));$(document).bind("dragleave."+this.element[0].id,$.proxy(this._docLeave,this))},_dropFiles:function(e){var isInit=$("#"+this._id("_ibb")).is(":visible"),data={files:e.originalEvent.dataTransfer.files,multiple:true};e.preventDefault();if(isInit){this._initBrowserFileSelect(e,data)}else{this._onBrowseButtonFileSelected(e,false,data)}return false},_docEnter:function(e){e.preventDefault();return false},_docOver:function(e){e.preventDefault();return false},_docLeave:function(e){e.preventDefault();return false},_analyzeFileExtensionIcons:function(){var i,j,arrIconExtensions=this.options.fileExtensionIcons,lengthIconExtensions,defIconExtensions=$.extend(true,[],this.defaultFileExtensionIcons),lengthDefaultIconExtensions=defIconExtensions.length,resArr=[],isDefaultDefined=false;if(arrIconExtensions===undefined||arrIconExtensions===null){this.options.fileExtensionIcons=defIconExtensions;return}lengthIconExtensions=arrIconExtensions.length;if(lengthIconExtensions===1&&arrIconExtensions[0].css===""){this.options.fileExtensionIcons=defIconExtensions;return}for(j=0;j<lengthIconExtensions;j++){for(i=0;i<lengthDefaultIconExtensions;i++){defIconExtensions[i].ext=this._removeCommonElementsInArrays(defIconExtensions[i].ext,arrIconExtensions[j].ext)}if(arrIconExtensions[j].def===true){isDefaultDefined=true}resArr.push(arrIconExtensions[j])}for(i=0;i<lengthDefaultIconExtensions;i++){if(defIconExtensions[i].ext.length>0||isDefaultDefined===false&&defIconExtensions[i].def===true){resArr.push(defIconExtensions[i])}}this.options.fileExtensionIcons=resArr},_removeCommonElementsInArrays:function(arr1,arr2){return $.grep(arr1,function(n){return $.inArray(n,arr2)===-1})},_attachFakeIframe:function(){var idTempIframe=this._id("_tempIframe");if($.ig.util.isIE7||$.ig.util.isIE8||$.ig.util.isIEQuircks){$("#"+idTempIframe).remove();setTimeout($('<iframe src="javascript:false;" id="'+idTempIframe+'" style="display: none;"></iframe>').appendTo($("#"+this._id("_fu"))),300)}},_renderStartupBrowseButton:function(){var self=this,attr,i,css=self.css,e=self.element,o=self.options,bbId=this._id("_ibb"),isMultipleFiles=o.mode==="multiple"&&o.multipleFiles,wrapperElementId=this._id("_wrprinit"),containerDiv,button;if(this.element.is("div")){this._isDivElement=true;this.originalElement=e;containerDiv=e;this._initialAttributes=[];attr=this.element[0].attributes;for(i=0;i<attr.length;i++){if(attr[i].name!=="id"){this._initialAttributes.push({name:attr[i].name,value:attr[i].value})}}this._initialHTML=this.element.html();this.element.empty()}else{this.originalElement=e;containerDiv='<div id="'+wrapperElementId+'" class="ig-upload-container"></div>';e.wrap(containerDiv);e.hide();e=$("#"+wrapperElementId)}bbId=this._id("_ibb");if($.ig.util.isIE7){e.addClass(css.baseClassIE7)}else if($.ig.util.isOpera){e.addClass(css.baseClassOpera)}else if($.ig.util.isOpera){e.addClass(css.baseClassMoz)}else if($.ig.util.isOpera){e.addClass(css.baseClassWebkit)}button=$("<button></button>").appendTo(e).attr("id",bbId).addClass(css.startupBrowseButtonClasses);button.igBrowseButton({multipleFiles:isMultipleFiles,labelText:o.labelUploadButton,container:this.container(),title:$.ig.Upload.locale.titleUploadFileButtonInit,fileselect:function(event,data){self._initBrowserFileSelect(event,data)},disabled:o.disabled,click:function(event){var isCancelEvent=false;if(self._trigger(self.events.fileSelecting,event,{owner:self})===false){isCancelEvent=true}return!isCancelEvent}})},_initBrowserFileSelect:function(event,data){var countFiles=1,filePicker,o=this.options;if(!data||!data.files||data.files.length===0){filePicker=$("#"+this._id("_ibb_fp"));if(this._validateFileExtension(filePicker[0].value,true)===false){return}}else if(o.mode==="single"&&data.files.length>1){this._setError(o.errorMessageDropMultipleFilesWhenSingleModel,this._const.clientSideErrorCode.dropMultipleFilesWhenSingleMode,"clientside");return}if(this._checkMaxUploadingFilesCount(countFiles,true)===true){$("#"+this._id("_ibb")).css({display:"none"});this._HTMLUpload();this._onBrowseButtonFileSelected(event,true,data)}},_HTMLUpload:function(){var uploaderId=this._id("_fu"),baseMainContainerId=this._id("_bmncntr"),o=this.options,e=this.container(),self=this,css=self.css,fileContainerId=this._id("_fc"),browseButtonId=this._id("_bb"),clearAllButtonId=this._id("_clrabtn"),uploaderContainerId=this._id("_fi_main_cntnr"),clearAllButton,html="";if(o.mode==="single"){html+='<div  class="'+css.singleDialogClass+'" id="$baseMainContainerId">';html+='   <div id="$uploaderId$" class="$baseMainContainerClass">';html+='		<div id="$fileContainerId$"></div>';html+='		<button id="$browseButtonId$" class="$browseButtonClass$"></button>';html+="	</div>";html+="</div>"}else if(o.mode==="multiple"){html='<div class="'+css.multipleDialogClasses+'" id="$baseMainContainerId">';html+='   <div  id="$uploaderId$" class="$baseMainContainerClass">';html+='		<div id="$uploaderFilesContainer" class="$fuMainContainerClass">';html+='			<button id="$browseButtonId$" class="$browseButtonClass$"></button>';html+='			<button id="$clearAllButtonId$"></button>';html+='			<div id="$fileContainerId$"></div>';html+="		</div>";html+="   </div>";html+="</div>"}html=html.replace("$uploaderId$",uploaderId).replace("$browseButtonId$",browseButtonId).replace("$baseMainContainerId",baseMainContainerId).replace("$browseButtonClass$",css.browseButtonClass).replace("$fileContainerId$",fileContainerId).replace("$clearAllButtonId$",clearAllButtonId).replace("$uploaderFilesContainer",uploaderContainerId).replace("$fuMainContainerClass",css.fileInfoMainContainer).replace("$baseMainContainerClass",css.baseMainContainerClass);$(html).appendTo(e).css({width:o.width,height:o.height}).addClass(css.baseClass);clearAllButton=$("#"+clearAllButtonId);if(clearAllButton.length>0){clearAllButton.igButton({title:$.ig.Upload.locale.titleClearAllButton,labelText:o.labelClearAllButton,disabled:true,click:function(event){event.preventDefault();self.clearAll()},css:{buttonClasses:"ui-igbutton ui-igupload-button-clear-all",buttonHoverClasses:"",buttonActiveClasses:"",buttonFocusClasses:"",buttonLabelClass:""}})}$("#"+browseButtonId).igBrowseButton({multipleFiles:o.mode==="multiple"&&o.multipleFiles,labelText:this.options.labelAddButton,container:this.container(),title:$.ig.Upload.locale.titleAddFileButton,fileselect:function(event,data){self._onBrowseButtonFileSelected(event,false,data)},click:function(event){var isCancelEvent=false;if(self._trigger(self.events.fileSelecting,event,{owner:self})===false){isCancelEvent=true}return!isCancelEvent}});$("#"+fileContainerId).addClass(css.containerClass);if(o.mode==="multiple"){self._spbRenderInit()}},_disableBrowseButton:function(isToDisable){$("#"+this._id("_bb")).igBrowseButton("option","disabled",isToDisable);$("#"+this._id("_ibb")).igBrowseButton("option","disabled",isToDisable)},_checkMaxUploadingFilesCount:function(count,callEvent){if(count===null||count===undefined){count=1}var o=this.options,allowUpload=true,totalFiles=this.fileInfoData.countTotalFiles+count;if(o.maxUploadedFiles!==this._const.maxUploadFilesDefault&&o.maxUploadedFiles!==null&&totalFiles>o.maxUploadedFiles){allowUpload=false;if(callEvent===true){this._setError(o.errorMessageMaxUploadedFiles,this._const.clientSideErrorCode.maxAllowedUploadingFiles,"clientside")}}return allowUpload},_onBrowseButtonFileSelected:function(event,isInitBrowseButton,data){var self=this,allFilesData=this.fileInfoData,o=self.options,fileData,countFiles=1;if(data&&data.files&&data.files.length>=1){countFiles=data.files.length;if(o.mode==="single"){if(countFiles>1){self._setError(o.errorMessageDropMultipleFilesWhenSingleModel,self._const.clientSideErrorCode.dropMultipleFilesWhenSingleMode,"clientside");return}}}if(self._checkMaxUploadingFilesCount(countFiles,true)===false){if(data.multiple===true){return}self._disableBrowseButton(true);return}if(o.maxUploadedFiles!==null&&o.maxUploadedFiles!==this._const.maxUploadFilesDefault&&o.maxUploadedFiles===allFilesData.countTotalFiles+countFiles){self._disableBrowseButton(true)}if(o.mode==="single"){if(allFilesData.iframe.ids.length===0){self._removeSingleUpload(allFilesData.lastId);fileData=allFilesData.files||data;if(self._attachIframe(event,isInitBrowseButton,fileData)===true){self._disableBrowseButton(true)}}}else if(o.mode==="multiple"){if(self._attachIframe(event,isInitBrowseButton,data)===false){self._disableBrowseButton(false)}}},clearAll:function(){var e=this.container(),arr=e.data("finishedIDs"),id,l;if(arr===undefined){return}l=arr.length;for(id=0;id<l;id++){this._removeSingleUpload(arr[id])}arr=[];e.data("finishedIDs",arr);this._disableClearAllButton()},_enableClearAllButton:function(){$("#"+this._id("_clrabtn")).igButton({disabled:false})},_disableClearAllButton:function(){$("#"+this._id("_clrabtn")).igButton("option","disabled",true)},_attachIframe:function(event,isInitBrowseButton,data){var res,files,filePicker,browse=$("#"+this._id("_bb"));if(data&&data.files){files=data.files}if(isInitBrowseButton===true){filePicker=$("#"+this._id("_ibb")).igBrowseButton("getFilePicker")}else{filePicker=browse.igBrowseButton("getFilePicker")}if(filePicker[0].files&&(files===null||files===undefined)){files=filePicker[0].files}if(files&&files.length>=1){res=this._uploadMultiple(files);filePicker.remove()}else{res=this._createForm(filePicker)}return res},_uploadMultiple:function(files){var res,i,filesLength=files.length,data=this.fileInfoData,fileId=data.formNumber;for(i=0;i<filesLength;i++){res=this._html5createForm(files[i],i,fileId)}return res},_html5upload:function(fileId){var xhr=new XMLHttpRequest,formData=new FormData,o=this.options,self=this,fileInfo=this.fileInfoData.filesInfo[fileId],file=fileInfo.file,key=fileInfo.key,cid=o.controlId,upload=xhr.upload,uploadUrl=o.uploadUrl+"?key="+key+"&cid="+cid+"&multiple=true";xhr.open("POST",uploadUrl);xhr.withCredentials="true";self._trigger(self.events.onFormDataSubmit,null,{formData:formData,fileId:fileId,fileInfo:fileInfo,xhr:xhr,owner:self});formData.append(this._id("_frm",fileId)+"_if",file);upload.addEventListener("progress",function(e){self._html5progress(e,fileId)},false);upload.addEventListener("error",function(){self._getFileStatus(fileId,true)},false);this.fileInfoData.filesInfo[fileId].xhr=xhr;xhr.onload=function(e){var response,error,msg,$xml;self._trigger(self.events.onXHRLoad,e,{fileId:fileId,xhr:xhr,fileInfo:fileInfo,owner:self});if(xhr.status>=200&&xhr.status<=299){response=xhr.responseText;if(response){$xml=$(response);if($xml.length){error=parseInt($xml.find("error").text(),10);msg=$xml.find("serverMessage").text();fileInfo.serverMessage=msg;if(!isNaN(error)){if(msg){self._setFileStatus(fileId,true,{error:error,serverMessage:msg})}else{self._getFileStatus(fileId,true)}return}}self._html5progress(e,fileId,true)}}else{self._getFileStatus(fileId,true)}};xhr.send(formData)},_html5progress:function(e,formNumber,isFinish){var self=this,singleFileData,data={};if(e.lengthComputable||isFinish){data.bytesUploaded=e.loaded;if(isNaN(data.bytesUploaded)){data.bytesUploaded=0}if(isNaN(e.total)){e.total=0}singleFileData=this.getFileInfo(formNumber);if(singleFileData&&singleFileData.innerStatus===self._const.status.Canceled){return}if(isFinish){data.total=data.bytesUploaded=singleFileData.sizeBytes;data.status=self._const.status.Finished}else{data.status=self._const.status.Started}data.size=e.total;self._setFileStatus(formNumber,true,data)}else{self.cancelUpload(formNumber)}},addDataField:function(formData,field){if(!field||$.type(field)!=="object"){return}this.addDataFields(formData,[field])},addDataFields:function(formData,fields){if(!formData||$.type(fields)!=="array"||!fields.length){return}var i,len=fields.length,f,isHTMLForm;isHTMLForm=formData.length&&formData.is("form");if(!isHTMLForm){if(!(formData instanceof FormData)){return}}for(i=0;i<len;i++){f=fields[i];if(!f.name||$.type(f.value)!=="string"){continue}if(isHTMLForm){$("<input />").attr({type:"hidden",name:f.name,value:f.value}).appendTo(formData)}else{formData.append(f.name,f.value)}}},_html5createForm:function(fileInfo,ind,formNumber){var self=this,o=self.options,fileName=fileInfo.name,fileSize=fileInfo.size,data=this.fileInfoData,fileId=data.formNumber++,key=self._randomString(30),status=self._const.status.Started;if(self._validateFileExtension(fileInfo.name,true)===false){if(o.mode==="multiple"){self._spbRenderProgress()}if(o.maxUploadedFiles!==null&&o.maxUploadedFiles>=data.countTotalFiles+1){self._disableBrowseButton(false)}return false}if(isNaN(fileSize)){fileSize=0}data.filesInfo[fileId]={path:fileName,key:key,sizeBytes:fileSize,uploadedBytes:0,status:self._const.status.NotStarted,checksNoSuchFile:0,innerStatus:self._const.status.NotStarted,multipleFiles:true,file:fileInfo,formNumber:formNumber};data.countTotalFiles++;self._spbRenderProgress();self._HTMLSingleUpload(fileId);this._saveFileSize(fileSize,fileId);if(o.autostartupload===true){if(self._checkCanUpload()===true){self.startUpload(fileId)}else{self._addPendingId(fileId);status=self._const.status.NotStarted}}else{if(o.mode==="single"){self._showSingleUploadStartUpload(true,fileId)}else{self._addIDBatch(fileId);status=self._const.status.NotStarted}}data.iframe.ids[data.iframe.ids.fileId]={id:fileId,status:status};if(o.mode==="multiple"){self._spbCheckModeButton()}self._trigger(self.events.fileSelected,null,{owner:self,fileId:fileId,filePath:self._getOnlyFileName(fileName)});return true},_createForm:function(filePicker){var self=this,o=self.options,data=this.fileInfoData,fileId=data.formNumber++,iframeId=this._id("_ifrm",fileId),formId=this._id("_frm",fileId),form,key=self._randomString(30),status=self._const.status.Started,cid=o.controlId,uploadUrl=o.uploadUrl+"?key="+key+"&cid="+cid;if(self._validateFileExtension(filePicker[0].value,true)===false){filePicker.remove();if(o.mode==="multiple"){self._spbRenderProgress()}if(o.maxUploadedFiles!==null&&o.maxUploadedFiles>=data.countTotalFiles+1){self._disableBrowseButton(false)}return false}data.filesInfo[fileId]={path:filePicker.val(),key:key,sizeBytes:0,uploadedBytes:0,status:self._const.status.NotStarted,checksNoSuchFile:0,innerStatus:self._const.status.NotStarted};data.countTotalFiles++;self._spbRenderProgress();$('<iframe src="javascript:false;" id="'+iframeId+'" name="'+iframeId+'"></iframe>').appendTo($(document.body)).css({display:"none"});form=$('<form method="post" enctype="multipart/form-data"></form>').attr("id",formId).attr("target",iframeId).attr("action",uploadUrl).appendTo($(document.body));filePicker.attr("name",formId+"_if").attr("id",formId+"_if").appendTo(form);self._trigger(self.events.onFormDataSubmit,null,{formData:form,fileId:fileId,fileInfo:data.filesInfo[fileId],owner:self});self._HTMLSingleUpload(fileId);if(o.autostartupload===true){if(self._checkCanUpload()===true){self.startUpload(fileId)}else{self._addPendingId(fileId);status=self._const.status.NotStarted;self._getFileSize(fileId,key)}}else{if(o.mode==="single"){self._showSingleUploadStartUpload(true,fileId);self._getFileSize(fileId,key)}else{self._addIDBatch(fileId);status=self._const.status.NotStarted;self._getFileSize(fileId,key)}}data.iframe.ids[data.iframe.ids.fileId]={id:fileId,status:status};if(o.mode==="multiple"){self._spbCheckModeButton()}self._trigger(self.events.fileSelected,event,{owner:self,fileId:fileId,filePath:self._getOnlyFileName(filePicker.val())});return true},_showSingleUploadStartUpload:function(){var self=this,o=self.options,startUploadButtonId="_strtuplbtn",startUploadButton=$("#"+this._id(startUploadButtonId)),browseButton=$("#"+this._id("_bb"));if(startUploadButton.length===0){$('<button id="'+self._id(startUploadButtonId)+'"></button>').appendTo($("#"+self._id("_fu"))).igButton({labelText:o.labelSummaryProgressButtonContinue,title:$.ig.Upload.locale.titleSingleUploadButtonContinue,click:function(e){e.preventDefault();self.startUpload(self.fileInfoData.formNumber-1,e);browseButton.igBrowseButton("attachFilePicker",e,true)}});startUploadButton=$("#"+this._id(startUploadButtonId))}browseButton.hide();startUploadButton.show()},_removeIframe:function(iframeNumber){var self=this,data=this.fileInfoData,iframeId=this._id("_ifrm",iframeNumber),formId=this._id("_frm",iframeNumber),browseButton=$("#"+self._id("_bb"));$("#"+iframeId).remove();$("#"+formId).remove();data.iframe.ids=self._removeElementArrayById(data.iframe.ids,iframeNumber);if(self.options.mode==="single"){browseButton.igBrowseButton("option","disabled",false);data.lastId=iframeNumber}this._attachFakeIframe()},_HTMLSingleUpload:function(formNumber){var self=this,o=this.options,css=self.css,fileContainerId=self._id("_fc"),fileUploadStatusId=self._id("_fus",formNumber),singleProgressBarId=self._id("_snglpbar",formNumber),iconId=self._id("_icn",formNumber),cancelButtonId=self._id("_cbtn",formNumber),fileContainer=$("#"+fileContainerId),fileName=this.fileInfoData.filesInfo[formNumber].path,html,progressBarFileNameId=self._id("_pbrflnm",formNumber),progressBarFileSizeId=self._id("_pbrflsz",formNumber),progressBarFileName,singleProgressBar,iconClass=self._getFileExtensionIconPath(self._getFileExtension(fileName));html='<div id="'+fileUploadStatusId+'">';html+='	<div class="'+css.containerFUS+'">';html+='		<div class="'+css.containerButtonCancelClass+'">';html+='			<button id="'+cancelButtonId+'"></button>';html+="		</div>";html+='		<div class="'+css.progressContainer+'">';html+='			<div class="'+css.progressBarInnerHTMLContainerClass+'" title="'+fileName+'">';html+='				<span id="'+iconId+'" class="'+iconClass+'"></span>';html+='				<span class="'+css.progressBarFileNameClass+'" id="'+progressBarFileNameId+'"></span>';html+='				<span class="'+css.progressBarFileSizeClass+'" id="'+progressBarFileSizeId+'"></span>';html+="			</div>";html+='			<div id="'+singleProgressBarId+'" class="'+css.progressBarUploadClass+'"></div>';html+="		</div>";html+="	</div>";html+="</div>";$(html).appendTo(fileContainer);$("#"+fileUploadStatusId).addClass(css.uploadProgressClass+" "+css.clearClass);singleProgressBar=$("#"+singleProgressBarId);$("#"+cancelButtonId).igButton({onlyIcons:true,icons:{primary:"ui-icon-closethick"},title:$.ig.Upload.locale.titleCancelUploadButton,click:function(event){event.preventDefault();self.cancelUpload(formNumber);$("#"+cancelButtonId).igButton("option",{disabled:true,icons:{primary:"ui-icon-check",secondary:null}})},css:{buttonClasses:"ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only ui-igbutton ui-igupload-cancel-button",buttonHoverClasses:"ui-state-hover",buttonActiveClasses:"ui-state-active",buttonFocusClasses:"ui-state-focus",buttonLabelClass:"ui-button-text",buttonDisabledClass:"ui-state-disabled",buttonPrimaryIconClass:"ui-button-icon-primary ui-icon",buttonMainElementPrimaryIconClass:" ui-button-text-icon-primary",buttonMainElementSecondaryIconClass:" ui-button-text-icon-secondary",buttonSecondaryIconClass:"ui-button-icon-secondary ui-icon",buttonIconsOnly:"ui-button-icons-only",buttonIconOnly:"ui-button-icon-only",buttonIcons:"ui-button-text-icons",buttonTextOnlyClass:"ui-button-text-only"}});singleProgressBar.igProgressBar({animate:self._const.isProgressBarAnimationEnabled,animateTimeout:self._const.animateProgressBarInterval,range:self._const.isProgressBarRange,value:0,queue:false});
if(!o.showFileExtensionIcon){$("#"+iconId).css("display","none")}progressBarFileName=$("#"+progressBarFileNameId);fileName=self._getOnlyFileName(fileName);singleProgressBar.data("originalFileName",fileName);if(fileName.length>self._const.fileNameLimit){fileName=fileName.substr(0,self._const.fileNameLimit)}progressBarFileName.text(self._formatFilePath(fileName));self._renderFileName(formNumber,0,fileName)},_renderFileName:function(formNumber,fileSize,fn){var self=this,o=self.options,fileName=fn,previousFileName="",originalFileSize,progressBarFileName=$("#"+self._id("_pbrflnm",formNumber)),progressBarFileSize=$("#"+self._id("_pbrflsz",formNumber)),singleProgressBarWidth=$("#"+self._id("_snglpbar",formNumber)).width(),singleProgressBar=$("#"+self._id("_snglpbar",formNumber)),progressBarFileSizeWidth=progressBarFileSize.width();if(progressBarFileName.length===0){return}if(fileName===undefined||fileName===null){fileName=singleProgressBar.data("fileName")}if(singleProgressBarWidth<=0){fileName=o.labelProgressBarFileNameContinue;progressBarFileName.text(fileName)}else{if(fileSize!==0&&fileSize!==undefined&&fileSize!==null){originalFileSize=progressBarFileSize.text();progressBarFileSizeWidth=progressBarFileSize.text(self._formatFileSize(fileSize)+"/"+self._formatFileSize(fileSize)).width();progressBarFileSize.text(originalFileSize)}while(progressBarFileName.position().left+progressBarFileName.width()+progressBarFileSizeWidth>=singleProgressBarWidth&&previousFileName!==fileName){previousFileName=fileName;fileName=fileName.substr(0,fileName.length/2);if(previousFileName===fileName&&fileName.length-1>1){fileName=fileName.substr(0,(fileName.length-1)/2)}progressBarFileName.text(fileName+o.labelProgressBarFileNameContinue)}if(progressBarFileName.position().left+progressBarFileName.width()+progressBarFileSize.width()>=singleProgressBarWidth){fileName=o.labelProgressBarFileNameContinue}}singleProgressBar.data("fileName",fileName)},_removeSingleUpload:function(formNumber){var self=this,fileUploadStatusId=self._id("_fus",formNumber),fileUploadStatusTmpId=fileUploadStatusId+"_"+self._randomString(20);if(self.options.mode==="multiple"){$("#"+fileUploadStatusId).attr("id",fileUploadStatusTmpId);self._renderAnimatedRemovingUpload(fileUploadStatusTmpId)}else if(self.options.mode==="single"){$("#"+fileUploadStatusId).hide().remove()}},_renderAnimatedRemovingUpload:function(id){$("#"+id).slideUp(this._const.removeSingleUploadAnimationTimeout,function(){$(this).remove()})},startUpload:function(formNumber){var self=this,o=this.options,formId=self._id("_frm",formNumber),allFilesData=this.fileInfoData,fileInfo=allFilesData.filesInfo[formNumber],file,fileSize,isHTML5=false;if(formNumber===null||fileInfo===null||fileInfo===undefined){self._setError(self.options.errorMessageTryToStartNonExistingFile.replace("{0}",formNumber),self._const.clientSideErrorCode.startUpload,"clientside");return}file=fileInfo.file;if(file){fileSize=file.size}if($.type(o.maxFileSize)==="number"&&$.type(fileSize)==="number"&&o.maxFileSize>-1&&fileSize>o.maxFileSize){self._removeUploadSetError(formNumber,o.errorMessageMaxFileSizeExceeded,self._const.clientSideErrorCode.maxFileSizeExcceeded,"clientside");return false}if(fileInfo.status!==self._const.status.NotStarted){return}isHTML5=fileInfo.multipleFiles;if(isHTML5!==true){$("#"+formId).submit()}else{this._html5upload(formNumber)}self._addUploadingID(formNumber);self._removeIDBatch(formNumber);self._spbCheckModeButton();fileInfo.status=self._const.status.Started;fileInfo.innerStatus=self._const.status.Started;self._spbRenderProgress();if(o.mode==="single"){$("#"+self._id("_strtuplbtn")).hide();$("#"+self._id("_bb")).igBrowseButton("option","disabled",true).show()}if(isHTML5===true){return}setTimeout(function(){self._getFileStatus(formNumber,true)},self._const.progressUpdateInterval)},_setFileStatus:function(formNumber,isNewFile,data){if(!data){return}var self=this,o=self.options,eArgs,isFinishUpload=false,status="",bytesUploaded=0,fileSize=0,singleFileData=this.getFileInfo(formNumber),allFilesData=this.fileInfoData,key=self._getKey(formNumber),fileName,error,isError,serverMessage="";if(key===null||key===undefined||!singleFileData){return false}fileName=singleFileData.path;bytesUploaded=parseInt(data.bytesUploaded,10);status=parseInt(data.status,10);if(singleFileData.file){data.size=singleFileData.file.size}fileSize=parseInt(data.size,10);serverMessage=data.serverMessage;isFinishUpload=status===self._const.status.Finished;error=parseInt(data.error,10);isError=!isNaN(error)&&error!==self._const.fileStatusNoError;if(serverMessage){singleFileData.serverMessage=serverMessage}if(singleFileData.innerStatus===self._const.status.Canceled&&isError){self._setError(o.errorMessageOther.replace("{0}",error),error,"serverside",serverMessage);return false}if(isError===true&&status!==self._const.status.NoSuchFile){self._removeUploadSetError(formNumber,o.errorMessageOther.replace("{0}",error),error,"serverside",serverMessage);return false}if(singleFileData!==null&&singleFileData.status!==self._const.status.Canceled){allFilesData.fileSizeUploaded-=singleFileData.uploadedBytes;if(singleFileData.sizeBytes===0||singleFileData.sizeBytes===null){singleFileData.sizeBytes=fileSize;allFilesData.fileSizeTotal+=fileSize}else if(singleFileData.sizeBytes!==fileSize){fileSize=singleFileData.sizeBytes}if(isFinishUpload){allFilesData.countUploadingFiles++}if(bytesUploaded===0&&singleFileData.uploadedBytes>0){bytesUploaded=singleFileData.uploadedBytes}singleFileData.uploadedBytes=bytesUploaded;singleFileData.status=status;allFilesData.fileSizeUploaded+=singleFileData.uploadedBytes;self._spbRenderProgress();eArgs={fileId:formNumber,filePath:self._getOnlyFileName(fileName),totalSize:fileSize,uploadedBytes:bytesUploaded,fileStatus:status,fileInfo:singleFileData,owner:self};if(self._trigger(self.events.fileUploading,null,eArgs)===false){self.cancelUpload(formNumber)}}if(isFinishUpload||status===self._const.status.Started){if(isFinishUpload){self._removeUploadingID(formNumber);if(o.mode==="multiple"){self._spbCheckModeButton();self._submitNextPendingId()}}self._renderStatus(formNumber,bytesUploaded,fileSize,isFinishUpload,singleFileData);if(!isFinishUpload){return true}}else if(status===self._const.status.NoSuchFile){if(singleFileData!==null&&singleFileData!==undefined&&singleFileData.checksNoSuchFile===0){singleFileData.checksNoSuchFile++;return true}self._removeUploadSetError(formNumber,o.errorMessageNoSuchFile,"nosuchfilekeyid","serverside",serverMessage)}return false},_getFileStatus:function(formNumber,isNewFile){var self=this,o=self.options,key=self._getKey(formNumber);if(key===null||key===undefined){return}key=key.replace("-$#","").replace("#$-","");$.ajaxQueue("uploadrequestsqueue",{url:self._formatURL(o.progressUrl,$.param({key:key,command:"status"})),dataType:"json",cache:false,success:function(data){if(self._setFileStatus(formNumber,isNewFile,data)===true){setTimeout(function(){self._getFileStatus(formNumber,false)},self._const.progressUpdateInterval)}},error:function(){self._setError(o.errorMessageGetFileStatus,self._const.clientSideErrorCode.ajaxErrorGetFileStatus,"clientside")}})},_removeUploadSetError:function(formNumber,errorMessage,errorCode,errorType,serverMessage){var self=this,o=this.options;self._removeIframe(formNumber);self._removeFileUpload(formNumber);self._setError(errorMessage,errorCode,errorType,serverMessage);if(o.mode==="multiple"){self._spbCheckModeButton();self._submitNextPendingId()}},cancelUpload:function(formNumber){var self=this,eArgs,o=self.options,singleProgressBarId=self._id("_snglpbar",formNumber),singleProgressBar=$("#"+singleProgressBarId),filePicker=$("#"+self._id("_frm",formNumber)+"_if"),fileName=filePicker.val(),totalSize=0,bytesUploaded=0,key=this._getKey(formNumber),singleFileInfo=this.getFileInfo(formNumber);totalSize=singleProgressBar.data("totalSize");bytesUploaded=singleProgressBar.data("bytesUploaded");if(totalSize===undefined){totalSize=0}if(bytesUploaded===undefined){bytesUploaded=0}if(singleFileInfo!==null){if(singleFileInfo.status===self._const.status.Started){singleFileInfo.innerStatus=self._const.status.Canceled;if(singleFileInfo.multipleFiles===true){if(singleFileInfo.xhr){singleFileInfo.xhr.abort()}self._onCancelUpload(formNumber)}else{$.ajaxQueue("uploadrequestsqueue",{url:self._formatURL(o.progressUrl,$.param({key:key,command:"cancel"})),dataType:"json",cache:false,success:function(){self._onCancelUpload(formNumber)},error:function(){self._setError(o.errorMessageCancelUpload,self._const.clientSideErrorCode.ajaxErrorCancelUpload,"clientside");self._removeFileUpload(formNumber)}})}}else if(singleFileInfo.status===self._const.status.NotStarted){if(o.mode==="single"){$("#"+this._id("_strtuplbtn")).hide();$("#"+this._id("_bb")).igBrowseButton("option","disabled","false").show()}eArgs={fileId:formNumber,filePath:self._getOnlyFileName(fileName),uploadedBytes:0,totalSize:totalSize,status:self._const.status.NotStarted,owner:self};self._trigger(self.events.fileUploadAborted,null,eArgs);self._removeFileUpload(formNumber)}}},_onCancelUpload:function(formNumber){var eArgs,self=this,o=self.options,continueButton=null,totalSize=0,bytesUploaded=0,allIds=null,singleFileInfo=this.getFileInfo(formNumber),fileName=singleFileInfo.path;if(o.autostartupload===false&&o.mode==="multiple"){continueButton=$("#"+self._id("_spbtncncl"));allIds=continueButton.data("ids");allIds=self._removeElementFromArray(allIds,formNumber);continueButton.data("ids",allIds)}eArgs={fileId:formNumber,filePath:self._getOnlyFileName(fileName),uploadedBytes:bytesUploaded,totalSize:totalSize,status:self._const.status.Canceled,owner:self};self._trigger(self.events.fileUploadAborted,null,eArgs);self._removeFileUpload(formNumber)},_removeFileUpload:function(formNumber){var self=this,o=self.options,cancelButtonId=self._id("_cbtn",formNumber),singleProgressBarId=self._id("_snglpbar",formNumber),singleProgressBar=$("#"+singleProgressBarId),totalSize=0,bytesUploaded=0,allFilesData=this.fileInfoData,singleFileInfo=this.getFileInfo(formNumber);if(singleFileInfo===null){self._setError(o.errorMessageTryToRemoveNonExistingFile.replace("{0}",formNumber),self._const.clientSideErrorCode.removeFileUpload,"clientside");return}totalSize=singleProgressBar.data("totalSize");bytesUploaded=singleProgressBar.data("bytesUploaded");if(totalSize===undefined){totalSize=0}if(bytesUploaded===undefined){bytesUploaded=0}allFilesData.countTotalFiles--;singleFileInfo.status=self._const.status.Canceled;allFilesData.fileSizeUploaded-=singleFileInfo.uploadedBytes;allFilesData.fileSizeTotal-=singleFileInfo.sizeBytes;self._spbRenderProgress();self._removeUploadingID(formNumber);if(o.mode==="multiple"){self._removePendingId(formNumber);self._removeIDBatch(formNumber);if(this.allCancelled===false){self._submitNextPendingId()}self._spbCheckModeButton()}$("#"+cancelButtonId).remove();self._removeIframe(formNumber);self._removeSingleUpload(formNumber);self._disableBrowseButton(!self._checkMaxUploadingFilesCount())},_getKey:function(formNumber){var a=this.fileInfoData.filesInfo[formNumber];if(a!==null&&a!==undefined){return a.key}return null},_singleFileUploadFinished:function(formNumber){var e=this.container(),self=this,arr;$("#"+self._id("_cbtn",formNumber)).igButton("option",{disabled:true,icons:{primary:"ui-icon-check",secondary:null}});self._removeIframe(formNumber);if(self.options.mode==="multiple"){self._enableClearAllButton();arr=e.data("finishedIDs");if(arr===undefined){arr=[]}arr.push(formNumber);e.data("finishedIDs",arr)}},_renderStatus:function(formNumber,bytesUploaded,fileSize,isFinished,fileInfo){var self=this,eArgs,originalFileName,statusLabel=$("#"+self._id("_pbrflsz",formNumber)),singleProgressBarId=self._id("_snglpbar",formNumber),singleProgressBar=$("#"+singleProgressBarId),percentUploaded=0,fileNameRendered;if(isFinished){bytesUploaded=fileSize;self._singleFileUploadFinished(formNumber)}if(fileSize!==0&&isNaN(bytesUploaded)===false&&isNaN(fileSize)===false){percentUploaded=bytesUploaded/fileSize*100}else if(isFinished){percentUploaded=100}singleProgressBar.data("totalSize",fileSize);singleProgressBar.data("bytesUploaded",bytesUploaded);fileNameRendered=singleProgressBar.data("isFileNameRendered");originalFileName=singleProgressBar.data("originalFileName");singleProgressBar.igProgressBar("option","value",percentUploaded);statusLabel.text(self._formatFileSize(bytesUploaded)+"/"+self._formatFileSize(fileSize));if(fileNameRendered!==true){singleProgressBar.data("isFileNameRendered",true);self._renderFileName(formNumber,fileSize)}if(isFinished){eArgs={fileId:formNumber,filePath:originalFileName,totalSize:bytesUploaded,fileInfo:fileInfo,owner:self};self._trigger(self.events.fileUploaded,null,eArgs);if(self._checkMaxUploadingFilesCount()===false){self._disableBrowseButton(true);return}}},_formatURL:function(url,args){if(url.indexOf("?")===-1){url+="?"}url+=args;return url},_showHideIcons:function(properties){var files=this.fileInfoData.filesInfo,i;for(i in files){if(files[i]!==undefined){$("#"+this._id("_icn",i)).css(properties)}}},_setWidthHeightAllUploads:function(value,isHeight){var files=this.fileInfoData.filesInfo,option=isHeight?"height":"width",i;for(i in files){if(files[i]!==undefined){$("#"+this._id("_snglpbar",i)).igProgressBar("option",option,value)}}},_setOption:function(key,value){var originalMode=this.options.mode,originalAutoStartUpload=this.options.autostartupload;$.Widget.prototype._setOption.apply(this,arguments);switch(key){case"width":this.container().width(value);$("#"+this._id("_bmncntr")).width(value);this._reRenderFileSizeMetrics();this._reRenderFileNames();break;case"height":this.container().height(value);$("#"+this._id("_bmncntr")).height(value);break;case"labelUploadButton":$("#"+this._id("_ibb")).igBrowseButton("option","labelText",value);break;case"labelAddButton":$("#"+this._id("_bb")).igBrowseButton("option","labelText",value);break;case"labelClearAllButton":$("#"+this._id("_clrabtn")).igButton("option","labelText",value);break;case"labelSummaryTemplate":case"labelSummaryProgressBarTemplate":this._spbRenderProgress();break;case"labelShowDetails":case"labelHideDetails":this._setShowHideDetailsButtonText($("#"+this._id("_shdbtn")).is("hidden"));$("#"+this._id("_shdbtn")).text(value);break;case"labelSummaryProgressButtonCancel":if(this.spbButtonMode===this.summaryButtonModes.cancel){$("#"+this._id("_spbtncncl")).igButton("option","labelText",value)}break;case"labelSummaryProgressButtonContinue":if(this.spbButtonMode===this.summaryButtonModes.startupload){$("#"+this._id("_spbtncncl")).igButton("option","labelText",value)}break;case"labelSummaryProgressButtonDone":if(this.spbButtonMode===this.summaryButtonModes.done){$("#"+this._id("_spbtncncl")).igButton("option","labelText",value)}break;case"showFileExtensionIcon":this._showHideIcons({display:!value?"none":"block"});break;case"fileSizeMetric":this._reRenderFileSizeMetrics();break;case"fileSizeDecimalDisplay":this._reRenderFileSizeMetrics();break;case"maxUploadedFiles":this._disableBrowseButton(!this._checkMaxUploadingFilesCount());break;case"mode":if(originalMode!==value){this._destroyMarkup();this._create()}break;case"disabled":this._disableBrowseButton(value);break;case"autostartupload":if(value===true&&value!==originalAutoStartUpload){this._spbSubmitAllButton()}break}},_reRenderFileSizeMetrics:function(){var data=this.fileInfoData.filesInfo,l=data.length,i,bytesUploaded=0,self=this,fileSize,statusLabel,singleProgressBar;for(i=0;i<l;i++){statusLabel=$("#"+self._id("_pbrflsz",i));if(statusLabel.length===0){continue}fileSize=data[i].sizeBytes;bytesUploaded=data[i].uploadedBytes;singleProgressBar=$("#"+self._id("_snglpbar",i));statusLabel.text(self._formatFileSize(bytesUploaded)+"/"+self._formatFileSize(fileSize));singleProgressBar.data("isFileNameRendered",true);self._renderFileName(i,fileSize);$("#"+self._id("_summpbrlbl_1")).width($("#"+this._id("_summpbar")).width())}this._spbRenderProgress()},_destroyMarkup:function(){var i,attr,startupButton=$("#"+this._id("_ibb")),browseButton=$("#"+this._id("_bb")),baseMainContainer=$("#"+this._id("_bmncntr"));if(!this._isDivElement){this.originalElement.show().unwrap()}startupButton.igBrowseButton("destroy");browseButton.igBrowseButton("destroy");startupButton.remove();baseMainContainer.remove();if(!this._isDivElement){this.container().remove()}else{this.element.empty();attr=this.element[0].attributes;for(i=0;i<attr.length;i++){if(attr[i].name!=="id"){this.element.removeAttr(attr[i].name)}}for(i=0;i<this._initialAttributes.length;i++){if(this._initialAttributes[i].name!=="id"){this.element.attr(this._initialAttributes[i].name,this._initialAttributes[i].value)}}this.element.html(this._initialHTML)}},destroy:function(){this._destroyMarkup();$.Widget.prototype.destroy.apply(this,arguments)},_getFileSize:function(formNumber,key){var self=this,o=this.options,formId=this._id("_fszfrm",formNumber),filePicker=$("#"+self._id("_frm",formNumber)+"_if"),iframeId=this._id("_fszifrm",formNumber),form,url=self._formatURL(o.uploadUrl,$.param({key:key,command:"fileSize"}));$('<iframe src="javascript:false;" id="'+iframeId+'" name="'+iframeId+'"></iframe>').appendTo($(document.body)).css({display:"none"});$('<form method="post" id="'+formId+'" target="'+iframeId+'" enctype="multipart/form-data"></form>').appendTo($(document.body)).css({display:"none"}).attr("action",url);form=$("#"+formId);filePicker.appendTo(form);form.submit();form.remove();$("#"+iframeId).ready(function(){setTimeout(function(){self._sendRequestFileSize(formNumber,key)},self._const.timeoutGetFileSize)});filePicker.appendTo($("#"+self._id("_frm",formNumber)))},_removeGetFileSizeHTML:function(formNumber){var iframeGetFileSize=$("#"+this._id("_fszifrm",formNumber)),formGetFileSize=$("#"+this._id("_fszfrm",formNumber));iframeGetFileSize.remove();formGetFileSize.remove()},_sendRequestFileSize:function(formNumber,key){var self=this,o=this.options,singleFileData=this.getFileInfo(formNumber);if(singleFileData.sizeBytes!==0){return}$.ajaxQueue("uploadrequestsqueue",{url:self._formatURL(o.progressUrl,$.param({key:key,command:"fileSize"})),dataType:"json",cache:false,success:function(data){var fileSize=parseInt(data.fileSize,10);self._saveFileSize(fileSize,formNumber);self._removeGetFileSizeHTML(formNumber)},error:function(){self._setError(o.errorMessageAJAXRequestFileSize,self._const.clientSideErrorCode.ajaxErrorRequestFileSize,"clientside");self._removeGetFileSizeHTML(formNumber)}})},_saveFileSize:function(fileSize,formNumber){var self=this,singleProgressBarId=self._id("_snglpbar",formNumber),singleProgressBar=$("#"+singleProgressBarId),allFilesData=this.fileInfoData,singleFileData=this.getFileInfo(formNumber);if(isNaN(fileSize)===true){return}singleProgressBar.data("totalSize",fileSize);if(singleFileData!==null){singleFileData.sizeBytes=fileSize;allFilesData.fileSizeTotal+=fileSize;self._spbRenderProgress()}self._renderStatus(formNumber,0,fileSize,false,singleFileData)},_onShowHideDetailsClick:function(){var self=this,fileContainer=$("#"+self._id("_fc")),marginTop=fileContainer.css("margin-top"),marginBottom=fileContainer.css("margin-bottom");if($.ig.util.isIE7||$.ig.util.isIEQuircks){self._setShowHideDetailsButtonText(fileContainer.is(":hidden"));if(fileContainer.is(":hidden")){fileContainer.show();self._reRenderFileNames()}else{fileContainer.hide()}self._setShowHideDetailsButtonText(fileContainer.is(":hidden"))}else{fileContainer.css({"margin-top":0,"margin-bottom":0});fileContainer.slideToggle(self._const.showHideDetailsAnimationTimeout,function(){fileContainer.css({"margin-top":marginTop,"margin-bottom":marginBottom});self._setShowHideDetailsButtonText(fileContainer.is(":hidden"));if(fileContainer.is(":hidden")===false){self._reRenderFileNames()}})}},_reRenderFileNames:function(){var data=this.fileInfoData.filesInfo,l=data.length,i,originalFileName;for(i=0;i<l;i++){originalFileName=$("#"+this._id("_snglpbar",i)).data("originalFileName");$("#"+this._id("_pbrflnm",i)).text(originalFileName);this._renderFileName(i,0,originalFileName)}},_setShowHideDetailsButtonText:function(isHidden){var o=this.options,showHideDetailsButton=$("#"+this._id("_shdbtn"));if(isHidden){showHideDetailsButton.text(o.labelShowDetails);showHideDetailsButton.attr("title",$.ig.Upload.locale.titleShowDetailsButton)}else{showHideDetailsButton.text(o.labelHideDetails);showHideDetailsButton.attr("title",$.ig.Upload.locale.titleHideDetailsButton)}},getFileInfoData:function(){return this.fileInfoData},cancelAll:function(){var i,data=this.fileInfoData,uploadingIDs=data.uploadingIDs,luploadingIDs=uploadingIDs.length,pendingIDs=data.pendingQueueIDs,lpendingIDs=pendingIDs.length,batch=data.batch,lbatch=batch.length;this.allCancelled=true;for(i=0;i<luploadingIDs;i++){if(uploadingIDs[i]!==undefined){this.cancelUpload(uploadingIDs[i])}}for(i=0;i<lpendingIDs;i++){if(pendingIDs[i]!==undefined){this.cancelUpload(pendingIDs[i])}}for(i=0;i<lbatch;i++){if(batch[i]!==undefined){this.cancelUpload(batch[i])}}uploadingIDs=[];pendingIDs=[];batch=[];$("#"+this._id("_spbtncncl")).data("ids",[]);this.allCancelled=false},_submitAllFormsUpload:function(){var self=this,i,id,idsToSubmit=this.fileInfoData.batch,l=idsToSubmit.length,pendingIDs=[];for(i=0;i<l;i++){id=idsToSubmit[i];if(self._checkCanUpload()){self.startUpload(id)}else{self._addPendingId(id);pendingIDs.push(id)}}this.fileInfoData.batch=[]},_spbRenderInit:function(){var self=this,o=this.options,css=self.css,uploaderId=this._id("_fu"),labelSummaryButton=o.labelSummaryProgressButtonContinue,summaryProgressContainerId=this._id("_spbcntr"),summaryProgressBarLabelId=this._id("_summpbrlbl"),summaryProgressBarId=this._id("_summpbar"),summaryProgressLabelId=this._id("_summplbl"),showHideDetailsId=this._id("_shdbtn"),summaryProgressButtonCancelId=this._id("_spbtncncl"),summaryProgressDetailsButtonId=this._id("_spdtlbtn"),summaryProgressBar,html="",data,progressData="progressData",titleSummaryButton=$.ig.Upload.locale.titleSummaryProgressButtonContinue;html+='<div id="$summaryProgressContainerId$">';html+='	<div  class="'+css.summaryInformationContainerClass+'">';html+='		<span id="$summaryProgressLabelId$" class="'+css.summaryUploadedFilesLabelClass+'"></span><a href="javascript:void(0);" id="$showHideDetailsId$" class="'+css.summaryShowHideDetailsButtonClass+'">$labelShowHideDetails$</a>';html+="	</div>";html+='	<div class="'+css.clearClass+'">';html+='		<button id="$summaryProgressButtonCancelId$"></button>';html+='		<div id="$summaryProgressBarId$"></div>';html+="	</div>";html+="</div>";html=html.replace("$summaryProgressContainerId$",summaryProgressContainerId).replace("$summaryProgressLabelId$",summaryProgressLabelId).replace("$summaryProgressDetailsButtonId$",summaryProgressDetailsButtonId).replace("$summaryProgressBarId$",summaryProgressBarId).replace("$showHideDetailsId$",showHideDetailsId).replace("$labelShowHideDetails$",o.labelHideDetails).replace("$labelSummaryProgressButtonCancel$",o.labelSummaryProgressButtonCancel).replace("$summaryProgressButtonCancelId$",summaryProgressButtonCancelId);$(html).appendTo($("#"+uploaderId));data={IDs:{},CurrentUploadedFiles:0,CurrentUploadedSize:0,TotalFileSize:0,TotalFiles:0,UploadingFiles:0};$("#"+summaryProgressContainerId).data(progressData,data).addClass(css.summaryProgressContainerClass+" "+css.clearClass);summaryProgressBar=$("#"+summaryProgressBarId);$('<span id="'+summaryProgressBarLabelId+'"></span>').addClass(css.summaryProgressbarLabelClass).appendTo(summaryProgressBar.igProgressBar({animate:self._const.isProgressBarAnimationEnabled,animateTimeout:self._const.animateProgressBarInterval,range:self._const.isProgressBarRange,value:0,queue:false}).addClass(css.summaryProgressBarClass));$('<div id="'+summaryProgressBarLabelId+'_1"></div>').width(summaryProgressBar.width()).addClass(css.summaryProgressBarSecondaryLabel).appendTo($("#"+this._id("_summpbar_progress")).addClass(css.summaryProgressBarInnerProgress));$("#"+showHideDetailsId).bind({click:function(event){event.preventDefault();self._onShowHideDetailsClick()}});if($.ig.Upload.locale.titleHideDetailsButton!==false){$("#"+showHideDetailsId).attr("title",$.ig.Upload.locale.titleHideDetailsButton)}if(o.autostartupload){labelSummaryButton=o.labelSummaryProgressButtonCancel;titleSummaryButton=$.ig.Upload.locale.titleSummaryProgressButtonCancel;this.spbButtonMode=this.summaryButtonModes.cancel}$("#"+summaryProgressButtonCancelId).igButton({labelText:labelSummaryButton,title:titleSummaryButton,disabled:false,click:function(event){event.preventDefault();self._spbOnClickButton(event)}}).addClass(css.summaryButtonClass)},_spbRenderProgress:function(){var o=this.options,summaryProgressBar=$("#"+this._id("_summpbar")),summaryProgressLabel=$("#"+this._id("_summplbl")),summaryProgressBarLabel=$("#"+this._id("_summpbrlbl")),summaryProgressBarLabel1=$("#"+this._id("_summpbrlbl_1")),textSummaryProgressBarLabel="",value=0,data=this.fileInfoData,fileSizeTotal=data.fileSizeTotal,fileSizeUploaded=data.fileSizeUploaded;if(fileSizeTotal!==0&&isNaN(fileSizeTotal)===false){value=fileSizeUploaded/fileSizeTotal*100}else if(fileSizeTotal===0){value=0}if(data.countUploadingFiles===data.countTotalFiles){if(data.countTotalFiles===0){value=0}else{value=100}data.fileSizeUploaded=fileSizeTotal;fileSizeUploaded=fileSizeTotal}summaryProgressBar.igProgressBar("option","value",value);textSummaryProgressBarLabel=o.labelSummaryProgressBarTemplate.replace("{0}",this._formatFileSize(fileSizeUploaded)).replace("{1}",this._formatFileSize(fileSizeTotal)).replace("{2}",value);summaryProgressLabel.html(o.labelSummaryTemplate.replace("{0}",data.countUploadingFiles).replace("{1}",data.countTotalFiles));summaryProgressBarLabel.text(textSummaryProgressBarLabel);summaryProgressBarLabel1.text(textSummaryProgressBarLabel)},_spbOnClickButton:function(event){var modes=this.summaryButtonModes,m=this.spbButtonMode;event.preventDefault();if(m===modes.cancel){this._trigger(this.events.cancelAllClicked,event,{owner:this});this.cancelAll()}else if(m===modes.startupload){this._spbSubmitAllButton()}},_spbSubmitAllButton:function(){this._submitAllFormsUpload();this._spbCheckModeButton()},_spbCheckModeButton:function(){var allFilesData=this.fileInfoData;if(this.options.autostartupload){if(allFilesData.pendingQueueIDs.length>0||allFilesData.uploadingIDs.length>0){this._spbSetCancelButton()}else{this._spbSetButtonDone()}}else{if(allFilesData.pendingQueueIDs.length===0&&allFilesData.uploadingIDs.length===0){if(allFilesData.batch.length>0){this._spbSetContinueButton()}else{this._spbSetButtonDone()}}else{this._spbSetCancelButton()}}},_spbSetButtonDone:function(){var o=this.options,button=$("#"+this._id("_spbtncncl"));this.spbButtonMode=this.summaryButtonModes.done;button.igButton("option",{labelText:o.labelSummaryProgressButtonDone,title:$.ig.Upload.locale.titleSummaryProgressButtonDone,disabled:true})},_spbSetContinueButton:function(){var o=this.options,button=$("#"+this._id("_spbtncncl"));this.spbButtonMode=this.summaryButtonModes.startupload;button.igButton({title:$.ig.Upload.locale.titleSummaryProgressButtonContinue,labelText:o.labelSummaryProgressButtonContinue,disabled:false})},_spbSetCancelButton:function(){var cancelButton=$("#"+this._id("_spbtncncl"));this.spbButtonMode=this.summaryButtonModes.cancel;cancelButton.igButton("option",{labelText:this.options.labelSummaryProgressButtonCancel,title:$.ig.Upload.locale.titleSummaryProgressButtonCancel,disabled:false})},getFileInfo:function(fileIndex){var fid=this.fileInfoData.filesInfo[fileIndex];if(fid===undefined||fid===null){return null}return fid},_formatFilePath:function(file){var ind=file.lastIndexOf("/");file=file.replace(/(\/|\\)$/,"");if(ind===-1){ind=file.lastIndexOf("\\")}return file.substring(ind+1)},_checkCanUpload:function(){var o=this.options,data=this.fileInfoData,canUpload=true,maxSimultaneousFilesUploads=o.maxSimultaneousFilesUploads;if(o.mode==="multiple"&&maxSimultaneousFilesUploads!==null&&data.uploadingIDs.length>=maxSimultaneousFilesUploads){canUpload=false;if(maxSimultaneousFilesUploads<=0){this._setError(o.errorMessageMaxSimultaneousFiles,this._const.clientSideErrorCode.checkCanUpload,"clientside")}}return canUpload},_addPendingId:function(id){this.fileInfoData.pendingQueueIDs.push(id)},_removePendingId:function(formNumber){var pendingIDs=this.fileInfoData.pendingQueueIDs,id;if(formNumber!==undefined&&formNumber!==null){id=formNumber;this.fileInfoData.pendingQueueIDs=this._removeElementFromArray(pendingIDs,id)}else{id=pendingIDs.shift();if(id===undefined){id=null}}return id},_addUploadingID:function(id){this.fileInfoData.uploadingIDs.push(id)},_removeUploadingID:function(id){this.fileInfoData.uploadingIDs=this._removeElementFromArray(this.fileInfoData.uploadingIDs,id)},_addIDBatch:function(id){this.fileInfoData.batch.push(id)},_removeIDBatch:function(id){this.fileInfoData.batch=this._removeElementFromArray(this.fileInfoData.batch,id)},_submitNextPendingId:function(){var self=this,nextFormToSubmitId;if(self._checkCanUpload()===true){nextFormToSubmitId=self._removePendingId();if(nextFormToSubmitId!==null){self.startUpload(nextFormToSubmitId)}}},_randomString:function(stringLength){var chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",randomstring="",i,rnum;for(i=0;i<stringLength;i++){rnum=Math.floor(Math.random()*chars.length);randomstring+=chars.substring(rnum,rnum+1)}return randomstring},_cutFilePath:function(fileName,length){var fileNameSize=fileName.length;if(fileNameSize<=length){return fileName}},_getOnlyFileName:function(fileName){var delimeter="";if(fileName===null||fileName===undefined){return""}if(fileName.indexOf("/")!==-1){delimeter="/"}else if(fileName.indexOf("\\")!==-1){delimeter="\\"}if(delimeter!==""){fileName=fileName.substr(fileName.lastIndexOf(delimeter)+1)}return fileName},_getFileExtension:function(fileName){return fileName.substring(fileName.lastIndexOf(".")+1)},_validateFileExtension:function(fileName,callEvent){var ext="",arrE=this.options.allowedExtensions,res,noCancel;if(arrE.length===0){return true}ext=fileName.substring(fileName.lastIndexOf(".")+1);noCancel=this._trigger(this.events.fileExtensionsValidating,this,{fileName:fileName,fileExtension:ext,owner:this});ext=ext.toLowerCase();res=$.inArray(ext,arrE)>=0;if(callEvent===true&&res===false||!noCancel){res=false;this._setError(this.options.errorMessageValidatingFileExtension,this._const.clientSideErrorCode.extensionValidation,"clientside")}return res},_getFileExtensionIconPath:function(ext){var arrIE=this.options.fileExtensionIcons,i,icon="",l=arrIE.length;ext=String(ext).toLowerCase();for(i=0;i<l;i++){if(arrIE[i].ext!==undefined&&(arrIE[i].ext===ext||$.inArray(ext,arrIE[i].ext)!==-1)){icon=arrIE[i].css;break}if(icon===""&&(arrIE[i].def===true||$.isArray(arrIE[i].ext)&&arrIE[i].ext.length===0)){icon=arrIE[i].css}}return icon},_setError:function(message,errorCode,errorType,serverMessage){var eArgs,o=this.options,errC=this._const.errorCode;if(serverMessage===undefined){serverMessage=""}if(errorType==="serverside"){switch(errorCode){case errC.MimeTypeValidation:message=o.errorMessageValidatingFileExtension;break;case errC.FileSizeExceeded:message=o.errorMessageMaxFileSizeExceeded;break}}this._spbCheckModeButton();eArgs={errorCode:errorCode,errorMessage:message,errorType:errorType,serverMessage:serverMessage,owner:this};this._trigger(this.events.onError,null,eArgs)},_formatFileSize:function(val){var fsm=this.options.fileSizeMetric,res=val;switch(fsm){case"bytes":res=val+"B";break;case"kbytes":res=this._convertToKBytes(val);break;case"mbytes":res=this._convertToMBytes(val);break;case"gbytes":res=this._convertToGBytes(val);break;case"auto":if(val<1024){res=val+"B"}else if(val<1024*1024){res=this._convertToKBytes(val)}else if(val<1024*1024*1024){res=this._convertToMBytes(val)}else{res=this._convertToGBytes(val)}break;default:break}return res},_convertToKBytes:function(val){var res=val/1024;
return res.toFixed(this.options.fileSizeDecimalDisplay)+"KB"},_convertToMBytes:function(val){var res=val/(1024*1024);return res.toFixed(this.options.fileSizeDecimalDisplay)+"MB"},_convertToGBytes:function(val){var res=val/(1024*1024*1024);return res.toFixed(this.options.fileSizeDecimalDisplay)+"GB"},_removeElementArrayById:function(array,keyValue){if(array===undefined||array===null){return[]}return $.grep(array,function(n){return n.id!==keyValue})},_removeElementFromArray:function(array,keyValue){if(array===undefined||array===null){return[]}return $.grep(array,function(n){return n!==keyValue})}});$.extend($.ui.igUpload,{version:"15.2.20152.1027"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Editors 15.2.20152.1027
*
* Copyright (c) 2011-2015 Infragistics Inc.
*
* http://www.infragistics.com/
* Depends on:
* jquery-1.4.4.js
* jquery.ui.core.js
* jquery.ui.widget.js
* infragistics.util.js
* infragistics.ui.popover.js
* infragistics.ui.notifier.js

* Example to use:
*	<script type="text/javascript">
*	$(function () {
*		$('#text1').igValidator({ minLength: 3 });
*	});
*	</script>
*	<input id="text1" type="text" />
*/
(function($){$.widget("ui.igValidator",{options:{onchange:false,onblur:true,onsubmit:true,required:false,number:false,date:false,email:false,lengthRange:null,valueRange:null,pattern:null,messageTarget:null,errorMessage:null,successMessage:null,threshold:-1,equalTo:null,custom:null,fields:[{selector:null}],notificationOptions:null,requiredIndication:false,optionalIndication:false},css:{target:"ui-igvalidator-target",requiredIndication:"ui-igvalidator-required-indication",optionalIndication:"ui-igvalidator-optional-indication"},events:{validating:"validating",validated:"validated",success:"success",error:"error",errorShowing:"errorShowing",errorHiding:"errorHiding",errorShown:"errorShown",errorHidden:"errorHidden",successShowing:"successShowing",successHiding:"successHiding",successShown:"successShown",successHidden:"successHidden",formValidating:"formValidating",formValidated:"formValidated",formError:"formError",formSuccess:"formSuccess"},locale:{defaultMessage:"Please fix this field",selectMessage:"Please select a value",rangeSelectMessage:"Please select no more than {1} and not less than {0} items",minSelectMessage:"Please select at least {0} items",maxSelectMessage:"Please select no more than {0} items",rangeLengthMessage:"Please enter a value between {0} and {1} characters long",minLengthMessage:"Please enter at least {0} characters",maxLengthMessage:"Please enter no more than {0} characters",requiredMessage:"This field is required",patternMessage:"Please fix pattern of this field",maskMessage:"Please fill all required positions",dateFieldsMessage:"Please enter values in date fields",invalidDayMessage:"Invalid day of month. Please enter correct day",dateMessage:"Please enter a valid date",numberMessage:"Please enter a valid number",rangeValueMessage:"Please enter a value between {0} and {1}",minValueMessage:"Please enter a value greater than or equal to {0}",maxValueMessage:"Please enter a value less than or equal to {0}",emailMessage:"Please enter a valid email address",equalToMessage:"Values don't match",optionalString:"(optional)"},emailRegEx:/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,numberRegEx:"^[\\d]+({0}[\\d]+)?$",notifierDefaults:{state:"error"},_createWidget:function(){delete this.options.fields;$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){this._decimalSeparator=".";this._thousandsSeparator=",";this._formHandleCounter=0;this._fieldOptions=this.options.fields?$.extend([],this.options.fields):null;var shouldHandleForm=false;if(this.options.fields){for(var i=0;i<this.options.fields.length;i++){var options=this.options.fields[i];this._initializeField($(options.selector),options);if(options.onsubmit||this.options.onsubmit){shouldHandleForm=true;this._formHandleCounter++}}}else{this._initializeField(this.element,this.options)}this._attachToForm(shouldHandleForm||this.options.onsubmit)},_setOption:function(option,value){switch(option){case"notificationOptions":this.options.notificationOptions=value;this._updateNotifiers();break;case"onchange":case"onblur":case"onsubmit":if(!this.options.fields&&!this.options._control){this._cleanupField(this.options);this._attachFieldEvents(this.element)}break;case"messageTarget":this._evalMessageTarget(this.options);break;case"errorMessage":case"successMessage":this._hideError(this.options);this._hideSuccess(this.options);break;case"requiredIndication":case"optionalIndication":this._removeFieldIndications(this.options);this._addFieldIndications(this.options,this.element);break;case"fields":return;default:break}$.Widget.prototype._setOption.apply(this,arguments)},_initializeField:function(element,options){if(!element.length){return}element.addClass(this.css.target);options._control=this._getEditor(element);if(options._control){this._form=this._form||element.closest("form").get(0);if(options._control.widgetName==="igCombo"){options._type="selectrange"}else if(options._control.widgetName==="igRating"){options._type="select"}if(options._control._options){options._control._options.validator=this}else{options._control._validator=this}}else{var elemType=element[0].tagName;switch(elemType){case undefined:return;case"INPUT":if(element[0].type==="checkbox"){options._group=$("[name="+element[0].name+"]",element[0].form||document);options._type=options._group.length>1?"checkboxrange":"checkbox"}else if(element[0].type==="radio"){options._type="radio";options._group=$("[name="+element[0].name+"]",element[0].form||document)}else{options._type="input"}break;case"TEXTAREA":options._type="textarea";break;case"SELECT":if(element[0].multiple){options._type="selectrange"}else{options._type="select"}break;case"FORM":this._form=this._form||element[0];return;default:this._form=this._form||element.closest("form").get(0);return}this._attachFieldEvents(element)}element.data("igValidatorField",options);options.notifyTarget=this._targetFromOptions(options,true);this._evalMessageTarget(options);this._ensureNotifier(options,true);this._addFieldIndications(element,options)},_attachFieldEvents:function(element){var self=this,evts={"keyup.validator":function(e){if(e.keyCode!==9&&e.keyCode<15||e.keyCode>20){self._validateInternal(element,e)}},"change.validator":function(e){self._validateInternal(element,e)},"cut.validator":function(e){setTimeout(function(){self._validateInternal(element,e)},10)},"paste.validator":function(e){setTimeout(function(){self._validateInternal(element,e)},10)},"drop.validator":function(e){setTimeout(function(){self._validateInternal(element,e)},10)},"dragend.validator":function(e){setTimeout(function(){self._validateInternal(element,e)},10)},"blur.validator":function(e){self._validateInternal(element,e,true)}};element.bind(evts)},_ensureNotifier:function(options,reinit){if(reinit&&options.notifyTarget.data("igNotifier")){options.notifyTarget.igNotifier("destroy").unbind(".validator")}if(!options.notifyTarget.data("igNotifier")){var args={owner:this,target:options.notifyTarget};options.notifyTarget.igNotifier(options.notificationOptions||this.notifierDefaults).bind({"ignotifiershowing.validator":function(evt,ui){return args.owner._handleNotifierEvent(evt,ui,"Showing",args)},"ignotifiershown.validator":function(evt,ui){return args.owner._handleNotifierEvent(evt,ui,"Shown",args)},"ignotifierhiding.validator":function(evt,ui){return args.owner._handleNotifierEvent(evt,ui,"Hiding",args)},"ignotifierhidden.validator":function(evt,ui){return args.owner._handleNotifierEvent(evt,ui,"Hidden",args)}})}},_updateNotifiers:function(){if(this.options.fields){for(var i=0;i<this.options.fields;i++){this._ensureNotifier(this.options.fields[i],true)}}else{this._ensureNotifier(this.options,true)}},_evalMessageTarget:function(options){if(typeof options.messageTarget==="string"){var target=$('[data-valmsg-for="'+options.messageTarget+'"]');options.messageTarget=target.length?target:$(options.messageTarget)}if(options.messageTarget instanceof $&&!options.messageTarget.length){options.messageTarget=null}},_addFieldIndications:function(element,options){if(options._group&&options._group.length>1||options._control&&options._control.widgetName==="igRating"){return}if(options.required&&options.requiredIndication){options._$indicator=element.after('<span title="'+this._getLocalizedMessage("required")+'" class="'+this.css.requiredIndication+'">*</span>').next()}if(!options.required&&options.optionalIndication){options._$indicator=element.after('<span class="'+this.css.optionalIndication+'">'+this._getLocalizedMessage("optional","String")+"</span>").next()}},_removeFieldIndications:function(options){if(options._$indicator){options._$indicator.hide();options._$indicator.remove();delete options._$indicator}},_attachToForm:function(shouldHandleForm){this._form=this._form||this.element[0].form||this.element.closest("form").get(0);if(!this._form||!shouldHandleForm){return}if(!this._form._igValidators||!this._form._igValidators.length){this._form._igValidators=[];$(this._form).bind("submit.validator",function(e){this._igErrorShown=false;var summaryResult=true,current;for(var i=0;i<this._igValidators.length;i++){current=this._igValidators[i]._validateForm(e);summaryResult=summaryResult?current:summaryResult}if(!summaryResult){e.preventDefault();e.stopPropagation()}})}this._form._igValidators.push(this)},_detachFromForm:function(){var index;if(this._form&&(index=$.inArray(this,this._form._igValidators))>-1){this._form._igValidators.splice(index,1);if(!this._form._igValidators.length){$(this._form).unbind("submit.validator")}}},_validate:function(field,evt,isSubmitting){var current,i,valid=true;if(this.options.fields){if(field!==undefined&&(i=this._fieldIndexOf(field))>-1){field=this.options.fields[i];valid=field.isValid=this._validateField(field,evt,isSubmitting)}else{for(i=0;i<this.options.fields.length;i++){field=this.options.fields[i];current=field.isValid=this._validateField(field,evt,isSubmitting);valid=valid?current:valid}}}else{valid=this._validateField(this.options,evt,isSubmitting);this.options.isValid=valid}return valid},_validateForm:function(evt){var valid=true,args={owner:this,target:$(evt.target)};if(this._trigger(this.events.formValidating,evt,args)){if(!$.ui.igValidator.defaults.showAllErrorsOnSubmit&&this._form&&this._form._igErrorShown){this._skipMessages=true}args.valid=valid=this._validate(null,evt,true);this._trigger(this.events.formValidated,evt,args);this._trigger(valid?this.events.formSuccess:this.events.formError,window.event,args)}return valid},_validateInternal:function(element,evt,blur,value){element=element||evt&&$(evt.target).closest("."+this.css.target);var field=element.data("igValidatorField");if(field){field.isValid=this._validateField(field,evt||{},false,value,blur);return field.isValid}if(value!==undefined){this.options.isValid=this._validateField(this.options,evt||{},false,value,blur);return field.isValid}else{return this._validate(null,evt||{})}},_validateField:function(opts,evt,isSubmitting,value,blur){var options=this._addGlobalSettings(opts);value=value!==undefined?value:this._getTargetValue(options);var min,max,isNumber=this._isNumber(options,value),isDateParsable=!isNaN(new Date(value).getSeconds()),isDate=value instanceof Date,hasLength=value!==undefined&&value!==null&&value.length!==undefined,internalValue=isNumber?value.toString():value;if(isSubmitting&&!options.onsubmit){return true}if(!this._forceValidation&&!isSubmitting){if(blur&&!options.onblur||!blur&&!options.onchange){return true}if(options.hasOwnProperty("threshold")&&hasLength&&value.length<=options.threshold){return true}}var args={value:value,owner:this,fieldOptions:options===this.options?null:opts};if(evt&&!this._trigger(this.events.validating,evt,args)){return true}if(options.required&&(!internalValue||value.length===0)){if(options.errorMessage){args.message=opts._currentMessage=options.errorMessage}else{switch(options._type){case"checkboxrange":case"radio":case"select":case"selectrange":args.message=opts._currentMessage=options.required.errorMessage||options.errorMessage||this._getLocalizedMessage("select");break;default:args.message=opts._currentMessage=options.required.errorMessage||options.errorMessage||this._getLocalizedMessage("required")}}args.rule="required";this._showError(options,args,evt);return false}else if(!options.required&&!internalValue){args.message=opts._currentMessage=options.successMessage;this._success(options,args,evt,isSubmitting);return true}if(options._control&&typeof options._control.isValid==="function"){var result=options._control.isValid();if(!result){args.message=opts._currentMessage=options.errorMessage||options._control._currentMessage||this._getLocalizedMessage("default");args.rule="control";this._showError(options,args,evt);return false}}if(options.number&&!isNumber&&internalValue){args.message=opts._currentMessage=options.number.errorMessage||options.errorMessage||this._getLocalizedMessage("number");args.rule="number";this._showError(options,args,evt);return false}if(options.date&&!isDateParsable&&internalValue){args.message=opts._currentMessage=options.date.errorMessage||options.errorMessage||this._getLocalizedMessage("date");args.rule="date";this._showError(options,args,evt);return false}if(hasLength&&value.length&&options.lengthRange){var messageType=value.push?"Select":"Length",minLength=options.lengthRange.push?options.lengthRange[0]:options.lengthRange.min,maxLength=options.lengthRange.push?options.lengthRange[1]:options.lengthRange.max;min=minLength&&value.length<minLength;max=maxLength&&value.length>maxLength;if(minLength&&maxLength&&(min||max)){args.message=options.lengthRange.errorMessage||options.errorMessage||this._getLocalizedMessage("range"+messageType);args.message=opts._currentMessage=args.message.replace("{0}",minLength).replace("{1}",maxLength)}else if(min){args.message=options.lengthRange.errorMessage||options.errorMessage||this._getLocalizedMessage("min"+messageType);args.message=opts._currentMessage=args.message.replace("{0}",minLength)}else if(max){args.message=options.lengthRange.errorMessage||options.errorMessage||this._getLocalizedMessage("max"+messageType);args.message=opts._currentMessage=args.message.replace("{0}",maxLength)}if(args.message){args.rule="lengthRange";this._showError(options,args,evt);return false}}if(options.valueRange&&(isDateParsable||isNumber)){var minValue=options.valueRange.push?options.valueRange[0]:options.valueRange.min,maxValue=options.valueRange.push?options.valueRange[1]:options.valueRange.max,hasMin=typeof minValue==="number"||minValue,hasMax=typeof maxValue==="number"||maxValue;if(hasMin||hasMax){if(isNumber&&!options.date){value=parseFloat(value);min=hasMin&&minValue;min=value<min?min.toString():null;max=hasMax&&maxValue;max=value>max?max.toString():null}if(isDateParsable&&(options.date||isDate)){value=new Date(value);min=hasMin&&new Date(minValue);min=value<min?min.toLocaleDateString():null;max=hasMax&&new Date(maxValue);max=value>max?max.toLocaleDateString():null}if(hasMin&&hasMax&&(min||max)){args.message=options.valueRange.errorMessage||options.errorMessage||this._getLocalizedMessage("rangeValue");args.message=opts._currentMessage=args.message.replace("{0}",min||minValue).replace("{1}",max||maxValue)}else if(min){args.message=options.valueRange.errorMessage||options.errorMessage||this._getLocalizedMessage("minValue");args.message=opts._currentMessage=args.message.replace("{0}",min)}else if(max){args.message=options.valueRange.errorMessage||options.errorMessage||this._getLocalizedMessage("maxValue");args.message=opts._currentMessage=args.message.replace("{0}",max)}if(args.message){args.rule="valueRange";this._showError(options,args,evt);return false}}}if(options.equalTo){var selector=options.equalTo.selector||options.equalTo,targetValue=this._getTargetValue({_control:this._getEditor($(selector)),selector:selector});if($.ig.util.compare(value,targetValue)){args.message=opts._currentMessage=options.equalTo.errorMessage||options.errorMessage||this._getLocalizedMessage("equalTo");args.rule="equalTo";this._showError(options,args,evt);return false}}if(options.email){if(!this.emailRegEx.test(value)){args.message=opts._currentMessage=options.email.errorMessage||options.errorMessage||this._getLocalizedMessage("email");args.rule="email";this._showError(options,args,evt);return false}}if(options.pattern){var regEx=options.pattern.expresion||options.pattern;regEx=regEx.test?regEx:new RegExp(regEx.toString());if(!regEx.test(value)){args.message=opts._currentMessage=options.pattern.errorMessage||options.errorMessage||this._getLocalizedMessage("pattern");args.rule="pattern";this._showError(options,args,evt);return false}}if(options.custom){var func=options.custom.method||options.custom;if(typeof func==="string"){func=window[func]}if(typeof func==="function"&&!func.apply(this,[value,args.fieldOptions])){args.message=opts._currentMessage=options.custom.errorMessage||options.errorMessage||this._getLocalizedMessage("default");args.rule="custom";this._showError(options,args,evt);return false}}args.message=opts._currentMessage=options.successMessage;this._success(options,args,evt,isSubmitting);return true},_success:function(options,args,evt,isSubmitting){this._hideError(options);args.valid=true;if(evt){this._trigger(this.events.validated,evt,args);this._trigger(this.events.success,evt,args)}if(!isSubmitting){this._showSuccess(options,args,evt)}},_isNumber:function(options,value){if(typeof value==="number"){return true}else if(typeof value==="string"){var decimalSeparator=options.number?options.number.decimalSeparator:this._decimalSeparator,thousandsRegEx=new RegExp("\\"+(options.number?options.number.thousandsSeparator:this._thousandsSeparator),"g"),regEx=new RegExp(this.numberRegEx.replace("{0}","\\"+decimalSeparator));if(regEx.test(value.replace(thousandsRegEx,""))&&this._parseNumber(options,value)!==null){return true}}return false},_parseNumber:function(options,value){var decimalSeparator=options.number?options.number.decimalSeparator:this._decimalSeparator,thousandsRegEx=new RegExp("\\"+(options.number?options.number.thousandsSeparator:this._thousandsSeparator),"g"),result=value.replace(thousandsRegEx,"").replace(decimalSeparator,this._decimalSeparator);result=parseFloat(result);if(isNaN(result)){return null}return result},_showError:function(options,args,evt){args.valid=false;if(evt){this._trigger(this.events.validated,evt,args);this._trigger(this.events.error,evt,args)}if(this._skipMessages){return}if(evt&&!this._trigger(this.events.errorShowing,evt,args)){return}this._ensureNotifier(options);if(options.messageTarget&&options.messageTarget.length){options.messageTarget.removeClass("field-validation-valid").addClass("field-validation-error");options.messageTarget.html(args.message).show();options.notifyTarget.data("igNotifier")._setOption("state","error");options.notifyTarget.data("igNotifier")._setTargetState()}else{options.notifyTarget.igNotifier("notify","error",args.message);if(this._form){this._form._igErrorShown=true}}this._trigger(this.events.errorShown,evt,args)},_hideError:function(options,evt){var notifier=options.messageTarget&&options.messageTarget.length?options.messageTarget:options.notifyTarget.data("igNotifier"),args={owner:this,target:options.messageTarget&&options.messageTarget.length?options.messageTarget:options.notifyTarget,message:notifier._currentText||options.messageTarget&&options.messageTarget.length&&options.messageTarget.text()};if(options.messageTarget||notifier.options&&notifier.options.state==="error"){if(evt&&!this._trigger(this.events.errorHiding,evt,args)){return}notifier.hide();options.notifyTarget.data("igNotifier")._setTargetState(true);this._trigger(this.events.errorHidden)}},_showSuccess:function(options,args,evt){if(this._skipMessages){return}args.target=options.messageTarget&&options.messageTarget.length?options.messageTarget:options.notifyTarget;var cancel=evt&&!this._trigger(this.events.successShowing,evt,args);if(args.message&&!cancel){this._ensureNotifier(options);if(options.messageTarget&&options.messageTarget.length){options.messageTarget.removeClass("field-validation-error").addClass("field-validation-valid");options.messageTarget.html(args.message).show();options.notifyTarget.data("igNotifier")._setOption("state","success");options.notifyTarget.data("igNotifier")._setTargetState()}else{options.notifyTarget.igNotifier("notify","success",args.message)}this._trigger(this.events.successShown,evt,args)}},_hideSuccess:function(options,evt){var notifier=options.messageTarget&&options.messageTarget.length?options.messageTarget:options.notifyTarget.data("igNotifier"),args={owner:this,target:options.messageTarget&&options.messageTarget.length?options.messageTarget:options.notifyTarget,message:notifier._currentText||options.messageTarget&&options.messageTarget.length&&options.messageTarget.text()};if(options.messageTarget||notifier.options&&notifier.options.state==="success"){if(evt&&!this._trigger(this.events.successHiding,evt,args)){return}notifier.hide();this._trigger(this.events.successHidden)}},_handleNotifierEvent:function(evt,ui,type,args){var state=ui.owner.options.state;args.message=ui.message;if(state==="error"){return args.owner._trigger(this.events["error"+type],evt,args)}else if(state==="success"){return args.owner._trigger(this.events["success"+type],evt,args)}return true},_getTargetValue:function(options){if(options._control){if(options._control.options.checked!==undefined){return options._control.options.checked}else if(options._control.refreshValue&&options._control.options.allowCustomValue){options._control.refreshValue()}return options._control.value()}var target=this._targetFromOptions(options);switch(options._type){case"textarea":return $(target).val().replace(/\r?\n/g,"\r\n");case"checkbox":return target[0].checked;case"radio":case"checkboxrange":return options._group.filter(":checked").map(function(){return this.value}).get();case"input":case"select":case"selectrange":return $(target).val();default:}},_getLocalizedMessage:function(key,postfix){key+=postfix||"Message";var message=this.options.locale?this.options.locale[key]:null;message=message||($.ig&&$.ig.Validator&&$.ig.Validator.locale?$.ig.Validator.locale[key]:null);return message||this.locale[key]},_targetFromOptions:function(options,outer){if(outer&&options._control){if(options._control.editorContainer){return options._control.editorContainer()}else if(options._control.comboWrapper){return options._control.comboWrapper().children().first()}}if(options.selector){return options.selector instanceof $?options.selector:$(options.selector)}else{return this.element}},_getEditor:function(elem){var widgets=elem.data(),controls=["Editor","Combo","Rating","DatePicker"],regEx=new RegExp("ig.*?("+controls.join("|")+")");for(var i in widgets){if(widgets[i].widgetName&&regEx.test(widgets[i].widgetName)){return widgets[i]}}return null},_cleanupField:function(options){var element=this._targetFromOptions(options||this.options);element.unbind(".validator");if(options.notifyTarget.data("igNotifier")){options.notifyTarget.igNotifier("destroy").unbind(".validator")}if(element.data("igValidatorField")){element.removeData("igValidatorField")}this._removeFieldIndications(options);if(options._control){if(options._control._options){options._control._options.validator=null}else{options._control._validator=null}}element.removeClass(this.css.target)},_addGlobalSettings:function(options){if(options===this.options){return options}var properties=["required","threshold","lengthRange","number","date","valueRange","email","triggers","onblur","onchange","onsubmit","successMessage","errorMessage"],extendedOptions=$.extend({},options);for(var i=0;i<properties.length;i++){if(!options.hasOwnProperty(properties[i])&&this.options[properties[i]]!==null){extendedOptions[properties[i]]=this.options[properties[i]]}}return extendedOptions},_indexOfByProerty:function(property,value,array){for(var i=0;i<array.length;i++){if(array[i][property]===value){return i}}return-1},_fieldMessageVisible:function(options){if(options.messageTarget&&options.messageTarget.length){return options.messageTarget.is(":visible")}if(options.notifyTarget.data("igNotifier")){return options.notifyTarget.data("igNotifier").isVisible()}return false},_fieldIndexOf:function(fieldParam){var index;if(typeof fieldParam==="number"&&fieldParam<this.options.fields.length){return fieldParam}if(typeof fieldParam==="string"){fieldParam=$.grep(this.options.fields,function(o){return o.selector===fieldParam})[0]||fieldParam}if(typeof fieldParam==="object"){index=$.inArray(fieldParam,this.options.fields)}if(index>=this.options.fields.length){return-1}return index},validate:function(field){var valid;this._forceValidation=true;valid=this._validate(field);this._forceValidation=false;return valid},isValid:function(field){this._skipMessages=true;var valid=this.validate(field);this._skipMessages=false;return valid},hide:function(field){var result=[],i;if(this.options.fields){if(field!==undefined&&(i=this._fieldIndexOf(field))>-1){this._hideError(this.options.fields[i]);this._hideSuccess(this.options.fields[i]);return result}for(i=0;i<this.options.fields.length;i++){if(this.options.fields[i].isValid!==undefined){this._hideError(this.options.fields[i]);this._hideSuccess(this.options.fields[i])}}}else{this._hideError(this.options);this._hideSuccess(this.options)}},getErrorMessages:function(field){var result=[],i;if(this.options.fields){if(field!==undefined&&(i=this._fieldIndexOf(field))>-1&&!this.options.fields[i].isValid){result.push(this.options.fields[i]._currentMessage);return result}for(i=0;i<this.options.fields.length;i++){if(this.options.fields[i].isValid!==undefined&&!this.options.fields[i].isValid){result.push(this.options.fields[i]._currentMessage)}}}else if(!this.options.isValid){result.push(this.options._currentMessage)}return result},isMessageDisplayed:function(field){var result=false,i;if(this.options.fields){if(field!==undefined&&(i=this._fieldIndexOf(field))>-1){result=!result?this._fieldMessageVisible(this.options.fields[i]):result;return result}for(i=0;i<this.options.fields.length;i++){result=!result?this._fieldMessageVisible(this.options.fields[i]):result}}else{result=this._fieldMessageVisible(this.options.fields[i])}return result},notifier:function(field){var i,notifier;if(field!==undefined&&this.options.fields&&(i=this._fieldIndexOf(field))>-1){notifier=this.options.fields[i].notifyTarget&&this.options.fields[i].notifyTarget.data("igNotifier")}else{notifier=this.options.notifyTarget&&this.options.notifyTarget.data("igNotifier")}return notifier||null},addField:function(field){if(!this.options.fields){return}this.options.fields.push(field);this._initializeField($(field.selector),field);var options=this._addGlobalSettings(field);if(options.onsubmit){if(!this._formHandleCounter){this._attachToForm(true)}this._formHandleCounter++}},removeField:function(field){if(!this.options.fields){return}var index=this._fieldIndexOf(field);if(index>-1){var removed=this.options.fields.splice(index,1)[0],options=this._addGlobalSettings(removed);this._cleanupField(removed);if(options.onsubmit&&!--this._formHandleCounter){this._detachFromForm()}}},updateField:function(oldField,newField){if(!this.options.fields){return}var index=this._fieldIndexOf(oldField);if(index>-1){if(!newField){this._cleanupField(this.options.fields[index]);this._initializeField($(this.options.fields[index].selector),this.options.fields[index]);return}var current=this._addGlobalSettings(this.options.fields[index]),options=this._addGlobalSettings(newField);this._cleanupField(current);this._initializeField($(newField.selector),newField);if(current.onsubmit&&!--this._formHandleCounter){this._detachFromForm()}if(options.onsubmit){if(!this._formHandleCounter){this._attachToForm(true)}this._formHandleCounter++}this.options.fields.splice(index,1,newField)}},destroy:function(){if(!this.options.fields){this._cleanupField(this.options)}else{for(var i=0;i<this.options.fields.length;i++){this._cleanupField(this.options.fields[i])}}this._detachFromForm();$.Widget.prototype.destroy.apply(this,arguments)}});$.extend($.ui.igValidator,{version:"15.2.20152.1027"});$.ui.igValidator.defaults={showAllErrorsOnSubmit:true}})(jQuery);/*!@license
 * Infragistics.Web.ClientUI HtmlEditor 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 * <Licensing info>
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *   jquery-1.9.1.js
 *   jquery.ui.core.js
 *   jquery.ui.widget.js
 *   infragistics.util.js
 *   infragistics.ui.shared.js
 *   infragistics.ui.toolbarbutton.js
 *   infragistics.ui.toolbar.js   
 *   infragistics.ui.popover.js
 *   infragistics.ui.splitbutton.js
 *   infragistics.ui.colorpicker.js
 *   infragistics.ui.colorpickersplitbutton.js
 *   infragistics.dataSource.js
 *   infragistics.ui.combo.js
 *   infragistics.ui.dialog.js
 *   infragistics.ui.htmleditor-en.js
 *   infragistics.ui.toolbar-en.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igHtmlEditor",{options:{showFormattingToolbar:true,showTextToolbar:true,showInsertObjectToolbar:true,showCopyPasteToolbar:true,width:725,height:350,toolbarSettings:[],customToolbars:[],inputName:"source",value:""},events:{rendered:"rendered",rendering:"rendering",actionExecuting:"actionExecuting",actionExecuted:"actionExecuted",toolbarCollapsing:"toolbarCollapsing",toolbarCollapsed:"toolbarCollapsed",toolbarExpanding:"toolbarExpanding",toolbarExpanded:"toolbarExpanded",cut:"cut",copy:"copy",paste:"paste",undo:"undo",redo:"redo",workspaceResized:"workspaceResized"},css:{htmlEditor:"ui-widget ui-widget-content ui-corner-all ui-ightmleditor ui-helper-clearfix",htmlEditorContent:"ui-ightmleditor-content",toolbarsContainer:"ui-igtoolbars-holder",pathFinder:"ui-igPathFinder",workspaceIframe:"ui-widget-content"},defaultToolbars:[{name:"textToolbar",displayName:$.ig.HtmlEditor.locale.defaultToolbars.textToolbar,isExpanded:true,collapseButtonIcon:"ui-igbutton-collapse",expandButtonIcon:"ui-igbutton-expand",items:[{name:"Bold",type:"button",scope:null,props:{allowToggling:{value:true},isBold:{value:false,action:"_isSelectedAction"},boldButtonTooltip:{value:$.ig.HtmlEditor.locale.boldButtonTitle,action:"_tooltipAction"},boldButtonIcon:{value:"ui-igbutton-bold",action:"_buttonIconAction"}}},{name:"Italic",type:"button",props:{isItalic:{value:false,action:"_isSelectedAction"},italicButtonTooltip:{value:$.ig.HtmlEditor.locale.italicButtonTitle,action:"_tooltipAction"},italicButtonIcon:{value:"ui-igbutton-italic",action:"_buttonIconAction"}}},{name:"Underline",type:"button",props:{isUnderline:{value:false,action:"_isSelectedAction"},underlineButtonTooltip:{value:$.ig.HtmlEditor.locale.underlineButtonTitle,action:"_tooltipAction"},underlineButtonIcon:{value:"ui-igbutton-underline",action:"_buttonIconAction"}}},{name:"Strikethrough",type:"button",props:{isStrikethrough:{value:false,action:"_isSelectedAction"},strikethroughButtonTooltip:{value:$.ig.HtmlEditor.locale.strikethroughButtonTitle,action:"_tooltipAction"},strikethroughButtonIcon:{value:"ui-igbutton-strikethrough",action:"_buttonIconAction"}}},{name:"fontFamily",type:"combo",scope:null,handler:"_fontNamePlg",props:{fontFamilyComboWidth:{value:180,action:"_comboWidthAction"},fontFamilyComboHeight:{value:"",action:"_comboHeightAction"},fontFamilies:{value:$.ig.HtmlEditor.locale.fontNames[/^win/gi.test(navigator.platform)?"win":"mac"],action:"_comboDataSourceAction"},selectedFontFamily:{value:"Times New Roman",action:"_comboSelectedItem"}}},{type:"combo",name:"fontSize",scope:null,handler:"_fontSizePlg",props:{fontSizeComboWidth:{value:75,action:"_comboWidthAction"},fontSizeComboHeight:{value:"",action:"_comboHeightAction"},fontSizes:{value:$.ig.HtmlEditor.locale.fontSizes,action:"_comboDataSourceAction"},selectedFontSize:{value:"3",action:"_comboSelectedItem"},fontSizeItemsListWidth:{value:100,action:"_comboDropDownListWidth"}}},{type:"combo",name:"formatsList",scope:null,handler:"_formatsListPlg",props:{formatsListComboWidth:{value:170,action:"_comboWidthAction"},formatsListComboHeight:{value:"",action:"_comboHeightAction"},formatsList:{value:$.ig.HtmlEditor.locale.formatsList,action:"_comboDataSourceAction"},selectedFormat:{value:"p",action:"_comboSelectedItem"}}}]},{name:"formattingToolbar",displayName:$.ig.HtmlEditor.locale.defaultToolbars.formattingToolbar,isExpanded:true,collapseButtonIcon:"ui-igbutton-collapse",expandButtonIcon:"ui-igbutton-expand",items:[{name:"justifyleft",type:"button",props:{isJustifyLeft:{value:true,action:"_isSelectedAction"},justifyLeftButtonTooltip:{value:$.ig.HtmlEditor.locale.alignTextLeftButtonTitle,action:"_tooltipAction"},justifyLeftButtonIcon:{value:"ui-igbutton-justifyleft",action:"_buttonIconAction"}}},{name:"justifycenter",type:"button",props:{isJustifyCenter:{value:false,action:"_isSelectedAction"},justifyCenterButtonTooltip:{value:$.ig.HtmlEditor.locale.alignTextCenterButtonTitle,action:"_tooltipAction"},justifyCenterButtonIcon:{value:"ui-igbutton-justifycenter",action:"_buttonIconAction"}}},{name:"justifyright",type:"button",props:{isJustifyRight:{value:false,action:"_isSelectedAction"},justifyRightButtonTooltip:{value:$.ig.HtmlEditor.locale.alignTextRightButtonTitle,action:"_tooltipAction"},justifyRightButtonIcon:{value:"ui-igbutton-justifyright",action:"_buttonIconAction"}}},{name:"justifyfull",type:"button",props:{isJustifyFull:{value:false,action:"_isSelectedAction"},justifyFullButtonTooltip:{value:$.ig.HtmlEditor.locale.justifyButtonTitle,action:"_tooltipAction"},justifyFullButtonIcon:{value:"ui-igbutton-justifyfull",action:"_buttonIconAction"}}},{name:"InsertUnorderedList",type:"button",props:{isUnorderedList:{value:false,action:"_isSelectedAction"},insertUnorderedListTooltip:{value:$.ig.HtmlEditor.locale.bulletsButtonTitle,action:"_tooltipAction"},insertUnorderedListButtonIcon:{value:"ui-igbutton-unorderedlist",action:"_buttonIconAction"}}},{name:"InsertOrderedList",type:"button",props:{isOrderedList:{value:false,action:"_isSelectedAction"},insertOrderedListTooltip:{value:$.ig.HtmlEditor.locale.numberingButtonTitle,action:"_tooltipAction"},insertOrderedListButtonIcon:{value:"ui-igbutton-orderedlist",action:"_buttonIconAction"}}},{name:"outdent",type:"button",props:{outdentButtonTooltip:{value:$.ig.HtmlEditor.locale.decreaseIndentButtonTitle,action:"_tooltipAction"},outdentButtonIcon:{value:"ui-igbutton-removeindent",action:"_buttonIconAction"}}},{name:"indent",type:"button",props:{indentTooltip:{value:$.ig.HtmlEditor.locale.increaseIndentButtonTitle,action:"_tooltipAction"},indentButtonIcon:{value:"ui-igbutton-indent",action:"_buttonIconAction"}}},{name:"textColor",type:"splitButtonColor",handler:"_fontColorPlg",props:{items:{value:[{name:"textColor",label:$.ig.HtmlEditor.locale.fontColorButtonTitle,iconClass:"ui-igbutton-forecolor"}]},defaultItemName:{value:"textColor"},selectedTextColor:{value:"red",action:"_spltButtonColorAction"}}},{name:"backgroundTextColor",type:"splitButtonColor",handler:"_fontBackgroundColorPlg",props:{items:{value:[{name:"backgroundTextColor",label:$.ig.HtmlEditor.locale.textHighlightButtonTitle,iconClass:"ui-igbutton-backcolor"}]},defaultItemName:{value:"backgroundTextColor"},selectedTextBackgroundColor:{value:"",action:"_spltButtonColorAction"}}}]},{name:"insertObjectToolbar",displayName:$.ig.HtmlEditor.locale.defaultToolbars.insertObjectToolbar,isExpanded:true,collapseButtonIcon:"ui-igbutton-collapse",expandButtonIcon:"ui-igbutton-expand",items:[{name:"image",type:"button",handler:"_insertImageDialogPlg",props:{isImage:{value:false,action:"_isSelectedAction"},imageButtonTooltip:{value:$.ig.HtmlEditor.locale.insertPictureButtonTitle,action:"_tooltipAction"},imageButtonIcon:{value:"ui-igbutton-addimage",action:"_buttonIconAction"}}},{name:"link",type:"button",handler:"_insertLinkPlg",props:{isLink:{value:false,action:"_isSelectedAction"},linkButtonTooltip:{value:$.ig.HtmlEditor.locale.insertLinkButtonTitle,action:"_tooltipAction"},linkButtonIcon:{value:"ui-igbutton-addlink",action:"_buttonIconAction"}}},{name:"table",type:"button",handler:"_insertTablePlg",props:{isTable:{value:false,action:"_isSelectedAction"},tableButtonTooltip:{value:$.ig.HtmlEditor.locale.insertTableButtonTitle,action:"_tooltipAction"},tableButtonIcon:{value:"ui-igbutton-table",action:"_buttonIconAction"}}},{name:"addRow",type:"button",handler:"_addTableRowPlg",props:{allowToggling:{value:false},isAddRow:{value:false,action:"_isSelectedAction"},addRowButtonTooltip:{value:$.ig.HtmlEditor.locale.addRowButtonTitle,action:"_tooltipAction"},addRowButtonIcon:{value:"ui-igbutton-addrow",action:"_buttonIconAction"}}},{name:"addColumn",type:"button",handler:"_addTableColumnPlg",props:{allowToggling:{value:false},isAddColumn:{value:false,action:"_isSelectedAction"},addColumnButtonTooltip:{value:$.ig.HtmlEditor.locale.addColumnButtonTitle,action:"_tooltipAction"},addColumnButtonIcon:{value:"ui-igbutton-addcolumn",action:"_buttonIconAction"}}},{name:"removeRow",type:"button",handler:"_removeTableRowPlg",props:{allowToggling:{value:false},isRemoveRow:{value:false,action:"_isSelectedAction"},removeRowButtonTooltip:{value:$.ig.HtmlEditor.locale.removeRowButtonTitle,action:"_tooltipAction"},removeRowButtonIcon:{value:"ui-igbutton-removerow",action:"_buttonIconAction"}}},{name:"removeColumn",type:"button",handler:"_removeTableColumnPlg",props:{allowToggling:{value:false},isRemoveColumn:{value:false,action:"_isSelectedAction"},removeColumnButtonTooltip:{value:$.ig.HtmlEditor.locale.removeColumnButtonTitle,action:"_tooltipAction"},removeColumnButtonIcon:{value:"ui-igbutton-removecolumn",action:"_buttonIconAction"}}}]},{name:"copyPasteToolbar",displayName:$.ig.HtmlEditor.locale.defaultToolbars.copyPasteToolbar,isExpanded:true,collapseButtonIcon:"ui-igbutton-collapse",expandButtonIcon:"ui-igbutton-expand",items:[{name:"copy",type:"button",scope:null,props:{isCopy:{value:false,action:"_isSelectedAction"},copyButtonTooltip:{value:$.ig.HtmlEditor.locale.copyButtonTitle,action:"_tooltipAction"},copyButtonIcon:{value:"ui-igbutton-copy",action:"_buttonIconAction"}}},{name:"cut",type:"button",scope:null,props:{isCut:{value:false,action:"_isSelectedAction"},cutButtonTooltip:{value:$.ig.HtmlEditor.locale.cutButtonTitle,action:"_tooltipAction"},cutButtonIcon:{value:"ui-igbutton-cut",action:"_buttonIconAction"}}},{name:"paste",type:"button",scope:null,props:{isPaste:{value:false,action:"_isSelectedAction"},pasteButtonTooltip:{value:$.ig.HtmlEditor.locale.pasteButtonTitle,action:"_tooltipAction"},pasteButtonIcon:{value:"ui-igbutton-paste",action:"_buttonIconAction"}}},{name:"undo",type:"button",scope:null,props:{allowToggling:{value:false},isUndo:{value:false,action:"_isSelectedAction"},undoButtonTooltip:{value:$.ig.HtmlEditor.locale.undoButtonTitle,action:"_tooltipAction"},undoButtonIcon:{value:"ui-igbutton-undo",action:"_buttonIconAction"}}},{name:"redo",type:"button",scope:null,props:{allowToggling:{value:false},isRedo:{value:false,action:"_isSelectedAction"},redoButtonTooltip:{value:$.ig.HtmlEditor.locale.redoButtonTitle,action:"_tooltipAction"},redoButtonIcon:{value:"ui-igbutton-redo",action:"_buttonIconAction"}}}]}],NODE:new $.ig.XmlNodeType,_toolbarsActiveState:{},_isDirty:false,_createWidget:function(){this._allToolbars=[];$.Widget.prototype._createWidget.apply(this,arguments)},_id:function(id){return this.element[0].id+id},widget:function(){return this.element},_render:function(){var html="",inputName=this.options.inputName;this.element.addClass(this.css.htmlEditor);html+='<div id="'+this._id("_toolbars")+'" class="'+this.css.toolbarsContainer+'"></div>';html+='<div id="'+this._id("_content")+'" class="'+this.css.htmlEditorContent+'">';html+='<iframe class="'+this.css.workspaceIframe+'" id="'+this._id("_editor")+'"></iframe>';html+='<textarea name="'+inputName+'" id="'+this._id("_source")+'"></textarea>';html+="</div>";$(html).appendTo(this.element);$("#"+this._id("_source")).hide();this.element.height(this.options.height);this.element.width(this.options.width)},_createWorkspace:function(content){var iFrameContent="<"+"!"+"DOCTYPE html"+">"+"<html>"+"<head>"+"<title>igHtmlEditor</title>"+"</head>"+'<body contentEditable="true" spellcheck="false" style="-webkit-tap-highlight-color: rgba(255, 255, 255, 0);">'+"<p>";if(!document.all){iFrameContent+="<br />"}iFrameContent+="</p></body></html>";this.workspace=this.element.find("#"+this._id("_editor"))[0];this.workspace.contentWindow.document.open("text/html","replace");this.workspace.contentWindow.document.write(iFrameContent);this.workspace.contentWindow.document.close();if(content&&content.length>0){$(this.workspace).contents().find("body").html(content)}if($.ig.util.isWebKit){this.workspace.contentWindow.document.body.contentEditable=true}if(!document.all){var showUI=false,comandValue=true;this.workspace.contentWindow.document.execCommand("styleWithCSS",showUI,comandValue)}},_getToolbar:function(index){if(!isNaN(parseInt(index,10))){return this._toolbars.eq(index)}if(typeof index==="string"){return this._toolbars.find("#"+this._id("_toolbars_"+index))}},_getToolbarSettings:function(name){var curToolbar,result,i;for(i=0;i<this._allToolbars.length&&!result;i++){curToolbar=this._allToolbars[i];if(curToolbar.name===name){result=curToolbar}}return result},_getFirefoxVersion:function(){if($.ig.util.isFF){return parseInt(window.navigator.userAgent.match(/\bFirefox\/[0-9\.]+\b/)[0].split("/").reverse()[0],10)}},_create:function(){var noCancel=this._trigger(this.events.rendering,null,{owner:this}),content=this.options.value||this.element.html();this.element.empty();if(noCancel){this._render();this._initToolbars();this._createWorkspace(content);this._domPathToolbar();this.resizeWorkspace();this._trigger(this.events.rendered,null,{owner:this})}},_resizeWorkspaceHandler:function(){var args={owner:this};this.resizeWorkspace();return this._trigger(this.events.workspaceResized,null,args)},_init:function(){this._comboHeight=24;this._bindToToolbarEvents();this._bindWorkspaceEvents();this.sourceWindow=this.element.find("#"+this._id("_source"));this._initFontsCombos();this._initFormatsListCombo();this._initFontSizeCombo();this._analyser=new $.ig.ToolbarHelper(this.workspace.contentWindow,this._toolbars.children());var self=this;this._onSelectionChange(function(){self._initialWorkspaceFormatting()})},_initFontsCombos:function(){var fontFamiliesCombo=this._getToolbar("textToolbar").igToolbar("getItem","fontFamily").addClass("ui-combo-fontfamily");fontFamiliesCombo.igCombo("option",{itemTemplate:'<span style="font-family: ${value}" unselectable="on">${text}</span>',height:this._comboHeight,dropDownOrientation:"bottom"})},_initFormatsListCombo:function(){var formatsListCombo=this._getToolbar("textToolbar").igToolbar("getItem","formatsList");formatsListCombo.igCombo("option",{itemTemplate:'<${text} unselectable="on">${value}</${text}>',height:this._comboHeight,dropDownOrientation:"bottom"})},_initFontSizeCombo:function(){var fontSizesCombo=this._getToolbar("textToolbar").igToolbar("getItem","fontSize");fontSizesCombo.igCombo("option",{itemTemplate:'<span unselectable="on">${value}</span>',height:this._comboHeight,dropDownOrientation:"bottom"})},_setOption:function(name,value){var self=this,updatedItems=[];if(name===undefined||value===undefined){return}if(name==="toolbarSettings"){$.each(value,function(index,toolbar){$.each(toolbar,function(tbPropName,tbPropVal){if(tbPropName!=="name"){self._tbHash[toolbar.name][tbPropName].updateProperty(tbPropName,tbPropVal);updatedItems.push(self._tbHash[toolbar.name][tbPropName])}});self._getToolbar(self._allToolbars[index].name).igToolbar("option","items",updatedItems)})}else if(this._toolbarsActiveState[name]){this._showToolbar(this._toolbarsActiveState[name].name,value)}else if(name==="width"){this.element.width(value)}else if(name==="height"){this.element.find("#"+this._id("_editor")).height(value)}else if(name==="value"){this.setContent(value,"text")}$.Widget.prototype._setOption.apply(this,arguments)},_showToolbar:function(name,show){if(show){this._getToolbar(name).removeClass("hidden").show()}else{this._getToolbar(name).addClass("hidden").hide()}},_initToolbars:function(){this._allToolbars=$.extend(true,[],this.defaultToolbars.concat(this.options.customToolbars));this._toolbars=this.element.find("#"+this._id("_toolbars"));this._mergeToolbarSettings();this._createToolbars()},_mergeToolbarSettings:function(){var customSettings=this.options.toolbarSettings,curSettings,curCustomSettings,curName,items,curItem,curItemProps,propFound,property,i,j;for(i=0;i<customSettings.length;i++){curCustomSettings=customSettings[i];curName=curCustomSettings.name;if(typeof curName==="string"){curSettings=this._getToolbarSettings(curName);if(curSettings){for(property in curCustomSettings){if(property!=="name"){propFound=false;if(curSettings.hasOwnProperty(property)){curSettings[property]=curCustomSettings[property]}else{items=curSettings.items;for(j=0;j<items.length&&!propFound;j++){curItem=items[j];curItemProps=curItem.props;if(curItemProps.hasOwnProperty(property)){curItemProps[property].value=curCustomSettings[property];propFound=true}}}}}}}}},_createToolbars:function(){var options=this.options,curSettings,curName,showToolbarOption,showToolbar,i;this._toolbars=this.element.find("#"+this._id("_toolbars"));for(i=0;i<this._allToolbars.length;i++){curSettings=this._allToolbars[i];curName=curSettings.name;showToolbarOption=$.camelCase("show-"+curName);showToolbar=true;$("<span>").attr("id",this._id("_toolbars")+"_"+curName).appendTo(this._toolbars).igToolbar(curSettings);if(options[showToolbarOption]!==undefined){showToolbar=options[showToolbarOption]}this._toolbarsActiveState[showToolbarOption]={name:curName,value:showToolbar};this._showToolbar(curName,showToolbar)}if($.ig.util.isIE){this._toolbars.find("*").attr("unselectable","on")}},_initialWorkspaceFormatting:function(){var i,curSettings,property,command,args,toolbarSettings=this.options.toolbarSettings,commands={isBold:"bold",isItalic:"italic",isUnderline:"underline",isStrikethrough:"strikethrough",isJustifyLeft:"justifyleft",isJustifyRight:"justifyright",isJustifyCenter:"justifycenter",isJustifyFull:"justifyfull",isUnorderedList:"InsertUnorderedList",isOrderedList:"InsertOrderedList"},argsCommands={selectedFontFamily:"fontName",selectedFontSize:"fontSize",selectedFormat:"formatBlock",selectedTextColor:"forecolor",selectedTextBackgroundColor:"backcolor"};for(i=0;i<toolbarSettings.length;i++){curSettings=toolbarSettings[i];for(property in curSettings){if(curSettings.hasOwnProperty(property)){if(commands.hasOwnProperty(property)){command=commands[property]}else if(argsCommands.hasOwnProperty(property)){command=argsCommands[property];args=curSettings[property]}else{command=null}if(command){if(command===argsCommands.selectedFormat){args="<"+args+">"}this._initialSelectionSetup();this._execCommand(command,args,true);this._emptyAndCollapseSelection()}}}}},_initialSelectionSetup:function(){var lastNode=$(this.contentDocument()).find(":not(br)").last(),sel=this._selectionWrapperSaved._getSelection(),range=this._selectionWrapperSaved._getRange();lastNode.html("&nbsp;");if($.ig.util.isIEOld){range.moveToElementText(lastNode[0]);range.select()}else{range.selectNode(lastNode[0]);sel.removeAllRanges();sel.addRange(range)}},_emptyAndCollapseSelection:function(){var lastNode=$(this.contentDocument()).find(":not(br)").last(),sel=this._selectionWrapperSaved._getSelection(),range=this._selectionWrapperSaved._getRange();lastNode.html("<br>");if(lastNode.length>0){if($.ig.util.isIEOld){range.collapse(true);range.select()}else{range.setStart(lastNode[0],0);range.setEnd(lastNode[0],0);range.collapse(true);sel.removeAllRanges();sel.addRange(range)}}},_isToolbarActive:function(tbName){var key;for(key in this._toolbarsActiveState){if(this._toolbarsActiveState.hasOwnProperty(key)){if(this._toolbarsActiveState[key].name===tbName){return this._toolbarsActiveState[key].value}}}},_execCommand:function(name,args,skipIETimeout){var self=this;function execute(){self._selectionWrapperSaved.focus();self._selectionWrapperSaved.execCommand(name.toLowerCase(),args);self._onSelectionChange()}if($.ig.util.isIE&&!skipIETimeout){setTimeout(function(){execute()},0)}else{execute()}},_hideDialogs:function(){this.element.find(":ui-igLinkPropertiesDialog").igLinkPropertiesDialog("hide");this.element.find(":ui-igTablePropertiesDialog").igTablePropertiesDialog("hide");this.element.find(":ui-igImagePropertiesDialog").igImagePropertiesDialog("hide")},_bindToToolbarEvents:function(){var self=this,events="igtoolbartoolbarbuttonclick igtoolbartoolbarcomboselected igtoolbartoolbarcustomitemclick "+"igtoolbarcollapsing igtoolbarcollapsed igtoolbarexpanding igtoolbarexpanded",splitBtnArrowSelector=".ui-splitbutton-arrow",toolbarEvents={igtoolbarcollapsing:this.events.toolbarCollapsing,igtoolbarcollapsed:this.events.toolbarCollapsed,igtoolbarexpanding:this.events.toolbarExpanding,igtoolbarexpanded:this.events.toolbarExpanded};this._toolbars.delegate(":ui-igToolbar",events,function _onToolbarItemClick(e,ui){var scope=ui.scope,handler=ui.handler,$eTarget=$(e.originalEvent.currentTarget),noCancel;delete ui.scope;delete ui.handler;self._hideDialogs();if($eTarget.is(splitBtnArrowSelector)){e.stopImmediatePropagation();return}if(toolbarEvents.hasOwnProperty(e.type)){self.resizeWorkspace();self._trigger(toolbarEvents[e.type],e,ui);return}ui.selectedItem=self._selectionWrapperSaved&&self._selectionWrapperSaved.getSelectedItem();noCancel=self._trigger(self.events.actionExecuting,e,{owner:self,toolbar:ui.toolbarName,actionName:ui.name});if(noCancel){if(!handler&&!scope){self._execCommand(ui.name,ui.value)}else if(handler&&!scope){self[handler](self.workspace.contentWindow.document,ui)}else if(handler&&scope){handler.call(ui.scope,self.workspace.contentWindow.document,ui)}self._trigger(self.events.actionExecuted,e,{owner:self,toolbar:ui.toolbarName,actionName:ui.name});e.stopImmediatePropagation()}})},_bindWorkspaceEvents:function(){var self=this,$workspaceDocument=$(this.contentDocument()),$workspaceBody=$(this.contentEditable()),KEYS={webKitIE:{CTRLZ:90,CTRLY:89},moz:{CTRLZ:90,CTRLY:89}};$workspaceDocument.find("html").bind("click",function(e){var target=$(e.target);if(target.is("html")){self.workspace.contentWindow.document.body.focus()}self._isDirty=true;self._hideDialogs();e.stopPropagation()}).bind("mouseup",function(){self._onSelectionChange()});$workspaceDocument.bind("keydown",function(e){var $children,$firstChild;self._isDirty=true;if(e.ctrlKey&&(e.which===KEYS.webKitIE.CTRLZ||e.which===KEYS.moz.CTRLZ)){self._trigger(self.events.undo,e,{owner:self})}if(e.ctrlKey&&(e.which===KEYS.webKitIE.CTRLY||e.which===KEYS.moz.CTRLY)){self._trigger(self.events.redo,e,{owner:self})}if(e.keyCode===8||e.keyCode===46){$children=$workspaceBody.children();$firstChild=$children.first();if($children.length===1&&$firstChild.html()==="<br>"){e.preventDefault()}}self._onSelectionChange()});$workspaceDocument.bind("cut copy paste",function(e){self._trigger(e.type,e,{owner:self})});this.element.bind("ightmleditoractionexecuted",function(e,ui){if(ui.actionName.toLowerCase()===self.events.undo||ui.actionName.toLowerCase()===self.events.redo){self._trigger(ui.actionName.toLowerCase(),e,{owner:self});e.stopImmediatePropagation()}});$(document).click(function(e){var $tarParents=$(e.target).parents();if(!$tarParents.is(".ui-igpopover")&&!$tarParents.is(".ui-igcombo-list")){self._hideDialogs()}});$(window).on("resize",$.proxy(this._resizeWorkspaceHandler,this))},_viewSource:function(){var workspace=$(this.workspace),workSpaceBody=workspace.contents().find("body");if(workspace.is(":visible")){workSpaceBody.attr("contentEditable",false);this.sourceWindow.val($.trim(workSpaceBody.html()));workspace.hide();this.sourceWindow.show()}else{workSpaceBody.attr("contentEditable",true);workSpaceBody.html($.trim(this.sourceWindow.val()));workspace.show();this.sourceWindow.hide();this.sourceWindow.val(encodeURIComponent(this.sourceWindow.val()))}},_viewSourcePlg:function(){this._viewSource()},_insertImageDialogPlg:function(workspace,plgUI){var image=$("<img>",this.workspace.contentWindow.document),self=this;if(plgUI.selectedItem.is("img")){image=plgUI.selectedItem}this._imageDialog=$("#"+this._id("_imageDialog"));if(!this._imageDialog.length){this._imageDialog=$('<div id="'+this._id("_imageDialog")+'"></div>').appendTo(this.element).igImagePropertiesDialog({item:image,target:plgUI.toolbarItem,applyform:function(e,ui){self._selectionWrapperSaved.focus();self._selectionWrapperSaved.replaceNode(ui.image)}})}else{if(this._imageDialog.igImagePropertiesDialog("option","isHidden")){this._imageDialog.igImagePropertiesDialog("show",image)}else{this._imageDialog.igImagePropertiesDialog("hide",image)}}},_insertLinkPlg:function(workspace,ui){var self=this,selectedItem=this._selectionWrapperSaved.getSelectedItem(),selectedItemNodeType=selectedItem[0].nodeType,anchor=$("<a></a>",this.workspace.contentWindow.document);if(selectedItem.parent().is("a")){anchor=selectedItem.parent()}else if(selectedItemNodeType===this.NODE._Text||selectedItemNodeType===this.NODE._Element){anchor.html(this._selectionWrapperSaved.getSelectionAsText())}if(!this._insertLinkDialog){this._insertLinkDialog=$('<div id="'+this._id("_linkDialog")+'"></div>').appendTo(this.element).igLinkPropertiesDialog({item:anchor,target:ui.toolbarItem,applyform:function(e,ui){self._selectionWrapperSaved.focus();self._selectionWrapperSaved.replaceNode(ui.anchor)}})}else{if(this._insertLinkDialog.igLinkPropertiesDialog("option","isHidden")){this._insertLinkDialog.igLinkPropertiesDialog("show",anchor)}else{this._insertLinkDialog.igLinkPropertiesDialog("hide",anchor)}}},_fontNamePlg:function(workspace,ui){this._execCommand("fontname",ui.value)},_fontSizePlg:function(workspace,ui){this._execCommand("fontsize",ui.value)},_formatsListPlg:function(workspace,ui){this._execCommand("formatBlock","<"+ui.value+">")},_insertTablePlg:function(workspace,plgUI){var table=$("<table></table>",this.workspace.contentWindow.document),self=this;if(plgUI.selectedItem.is("table")){table=plgUI.selectedItem}if(!this.insertTableDialog){this.insertTableDialog=$("<div id='"+this._id("_tableDialog")+"'</div>").appendTo(this.element).igTablePropertiesDialog({item:table,target:plgUI.toolbarItem,applyform:function(e,ui){self._selectionWrapperSaved.insertTable(ui.table)}});return}if(this.insertTableDialog.igTablePropertiesDialog("option","isHidden")){this.insertTableDialog.igTablePropertiesDialog("show",table);return}if(!this.insertTableDialog.igTablePropertiesDialog("option","isHidden")){this.insertTableDialog.igTablePropertiesDialog("hide")}},_addTableRowPlg:function(){var selectedItem=this._selectionWrapperSaved.getSelectedItem();if(selectedItem.is("table")){selectedItem.tableManipulator("addRow")}else if(selectedItem.is("td")){selectedItem.parents("table").first().tableManipulator("addRow",selectedItem.parent().index())}},_removeTableRowPlg:function(){var selectedItem=this._selectionWrapperSaved.getSelectedItem();if(selectedItem.is("table")){selectedItem.tableManipulator("removeRow")}else if(selectedItem.is("td")){selectedItem.parents("table").first().tableManipulator("removeRow",selectedItem.parent().index())}},_addTableColumnPlg:function(){var selectedItem=this._selectionWrapperSaved.getSelectedItem();if(selectedItem.is("table")){selectedItem.tableManipulator("addColumn")}else if(selectedItem.is("td")){selectedItem.parents("table").first().tableManipulator("addColumn",selectedItem.index())}},_removeTableColumnPlg:function(){var selectedItem=this._selectionWrapperSaved.getSelectedItem();if(selectedItem.is("table")){selectedItem.tableManipulator("removeColumn")}else if(selectedItem.is("td")){selectedItem.parents("table").first().tableManipulator("removeColumn",selectedItem.index())}},_fontColorPlg:function(workspace,ui){this._execCommand("forecolor",ui.value)},_fontBackgroundColorPlg:function(workspace,ui){var command=this._getFirefoxVersion()?"hilitecolor":"backcolor";this._execCommand(command,ui.value)},_domPathToolbar:function(){var self=this,tableItemPref="#"+this._id("_toolbars_insertObjectToolbar_item_"),tableItemAddRowID=tableItemPref+"addRow",tableItemAddColID=tableItemPref+"addColumn",tableItemRemRowID=tableItemPref+"removeRow",tableItemRemColID=tableItemPref+"removeColumn",doNotEnableToolbarButtonsSelector=tableItemAddRowID+", "+tableItemAddColID+", "+tableItemRemRowID+", "+tableItemRemColID;this._viewSourceBtn=$('<div class="ui-igbutton-viewsource"></div>').appendTo(this.element).igButton({labelText:"&nbsp;",title:$.ig.HtmlEditor.locale.viewSourceButtonTitle,icons:{primary:"ui-igbutton-viewsource-icon"},onlyIcons:true,click:function(){self._viewSourcePlg();if(self._domPathToolbar.igPathFinder("option","disabled")){self._domPathToolbar.igPathFinder("option","disabled",false);self._toolbars.find(":ui-igToolbarButton").not(doNotEnableToolbarButtonsSelector).igToolbarButton("option","disabled",false).end().end().find(":ui-igCombo").igCombo("enable");self._analyser._disableUnsupportedItems();self._onSelectionChange()}else{self._domPathToolbar.igPathFinder("option","disabled",true);self._toolbars.find(":ui-igToolbarButton").igToolbarButton("option","disabled",true).end().find(":ui-igCombo").igCombo("disable")}}});this._domPathToolbar=$('<div id="'+this._id("_domPathToolbar")+'"></div>').appendTo(this.element).igPathFinder({click:function(e,ui){var selectionWrapper=self._selectionWrapperSaved;self.workspace.contentWindow.document.body.focus();if(self._domPathToolbar.igPathFinder("option","disabled")){return}e.preventDefault();if(ui.item.is("html")){selectionWrapper.select(ui.item.children("body"))}else if(ui.item.is("body")){selectionWrapper.select(ui.item)}else{selectionWrapper.select(ui.item)}}})},_cutPlg:function(){this._execCommand("cut")},_copyPlg:function(){this._execCommand("copy")},_pastePlg:function(){this._execCommand("paste")},_onSelectionChange:function(callback){var self=this,selectionWrapper,workSpaceBody=$(this.workspace).contents().find("body"),selectionCallback=callback||function(){var selectedItem=this.getSelectedItem();if(selectedItem&&(selectedItem.is("p")||selectedItem.is(":header"))&&selectedItem.children("span").length>0){selectedItem=selectedItem.children("span").first()}else if(selectedItem&&(selectedItem.is("p")||selectedItem.is(":header"))&&selectedItem.children("font").length>0){selectedItem=selectedItem.children("font").first()}if(selectedItem[0].nodeType===self.NODE._Text){selectedItem=selectedItem.parent()}self._analyser.analyse(selectedItem);if(selectedItem.length){self._domPathToolbar.igPathFinder("option","items",$.merge(selectedItem,selectedItem.parents()))}};selectionWrapper=new $.ig.SelectionWrapper(this.workspace.contentWindow,function(){self._selectionWrapperSaved=this;self.sourceWindow.val(encodeURIComponent(workSpaceBody.html()));selectionCallback.call(this)})},_destroyPopovers:function(){var el=this.element[0];$(':data("igPopover")').each(function(){if($.contains(el,this)){$(this).igPopover("destroy")}})},resizeWorkspace:function(){var height=this.element.height(),$editor=$("#"+this._id("_editor"));height-=$("#"+this._id("_toolbars")).outerHeight(true);height-=$(".ui-igbutton-viewsource").outerHeight(true);height-=$editor.outerHeight(true)-$editor.height();$editor.height(height);$("#"+this._id("_source")).height(height)},getContent:function(format){if(format==="text"){return $(this.workspace).contents().find("body").text()}if(format==="html"){return $(this.workspace).contents().find("body").html()}},setContent:function(content,format){if(format==="text"){$(this.workspace).contents().find("body").text(content)}else if(format==="html"){$(this.workspace).contents().find("body").html(content)}this.sourceWindow.val(encodeURIComponent(content))},destroy:function(){$.Widget.prototype.destroy.apply(this,arguments);$(this.workspace.contentWindow).undelegate();this._destroyPopovers();this._viewSourceBtn.igButton("destroy");this.element.removeClass(this.css.htmlEditor).find("#"+this._id("_content")).removeClass(this.css.htmlEditorContent).end().find("#"+this._id("_domPathToolbar")).removeClass(this.css.pathFinder).end().find("#"+this._id("_toolbars")).removeClass(this.css.toolbarsContainer).end().find(":ui-igToolbar").igToolbar("destroy").end().empty()},executeAction:function(actionName,args){this._selectionWrapperSaved.execCommand(actionName.toLowerCase(),args);this._onSelectionChange()},isDirty:function(){return this._isDirty},contentWindow:function(){return this.workspace.contentWindow},contentDocument:function(){return this.contentWindow().document},contentEditable:function(){return this.contentDocument().body},selection:function(){return this._selectionWrapperSaved._getSelection()},range:function(){return this._selectionWrapperSaved._getRange()},insertAtCaret:function(element){var el,range;
if($.ig.util.isDomElement(element)){element=$(element)}if(element instanceof $){element=$("<div />").append(element).html()}else if(typeof element!=="string"){return}el=$(element,this._selectionWrapperSaved._document)[0];range=this.range();if(this._selectionWrapperSaved._isIeOld){range.pasteHTML(element)}else{range.insertNode(el)}}});$.widget("ui.igPathFinder",{options:{items:null},css:{button:"ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only ui-igbutton ui-widget-content",buttonLabel:"ui-button-text",stateDefault:"ui-state-default",firstButton:"ui-first-button",overflowMarker:"ui-igpathfinder-overflowMarker"},_create:function(){this._addStyles()},_addStyles:function(){this.element.addClass("ui-igPathFinder")},_setOption:function(name,value){$.Widget.prototype._setOption.apply(this,arguments);switch(name){case"items":this._updateToolbar();break;case"disabled":this.element.find("button").attr("disabled",value).attr("aria-disabled",value);break;default:break}},_addOverflowMarker:function(){var overflowMarker=$("<div>...</div>").addClass(this.css.overflowMarker).addClass(this.css.stateDefault);overflowMarker.prependTo(this.element)},_updateToolbar:function(){var i,parents,btn,buttonsList,self=this,o=this.options,path=[],html="",viewSrcBtn=$(".ui-igbutton-viewsource"),overflowMarkerWidth=20,maxWidth=viewSrcBtn.parent().width()-viewSrcBtn.outerWidth(true)-overflowMarkerWidth,maxWidthReached=false;if(o.items.length){o.items.each(function(index,element){html='<div aria-disabled="false" style="z-index:'+index+'" class="'+self.css.button+'">'+'<span class="'+self.css.buttonLabel+'">'+element.nodeName+"</span>"+"</div>";path.push(html)});this.element.empty();parents=$(o.items.toArray().reverse());buttonsList=$(path.reverse().join(""));for(i=buttonsList.length-1;i>=0&&!maxWidthReached;i--){buttonsList.removeClass(this.css.firstButton);btn=buttonsList.eq(i).addClass(this.css.firstButton).prependTo(this.element);if(i===0){maxWidth+=overflowMarkerWidth}if(this.element.outerWidth(true)>maxWidth){btn.remove();buttonsList.eq(i+1).addClass(this.css.firstButton);this._addOverflowMarker();maxWidthReached=true}}buttonsList.attr("disabled",o.disabled).attr("aria-disabled",o.disabled).mouseover(function(){if(!o.disabled){$(this).addClass("ui-state-hover")}}).mouseleave(function(){if(!o.disabled){$(this).removeClass("ui-state-hover")}}).click(function(e){if(!o.disabled){$(this).siblings(".ui-state-active").removeClass("ui-state-active");$(this).addClass("ui-state-active");self._trigger("click",e,{item:parents.eq(buttonsList.index(this))})}})}}});$.widget("ui.igHtmlEditorPopover",{options:{item:null,target:null,isHidden:true},css:{igHtmlEditorPropertiesDialog:"ui-ightmleditor-dialog",igHtmlEditorPropertiesDialogContainer:"ui-ightmleditor-dialog-container"},events:{apply:"applyform",cancel:"cancelform",show:"show",hide:"hide"},_id:function(id){return this.element[0].id+id},_create:function(){this.element.igPopover({closeOnBlur:false,position:"balanced",direction:"bottom",renderCloseButton:false,showOn:null,maxWidth:"90%",width:"95%",maxHeight:"300px",minWidth:"160px"});this.poContent=this.element.igPopover("container");this._createForm()},_init:function(){this._item=this.options.item;this.poContent.addClass(this.css.igHtmlEditorPropertiesDialog);this.element.addClass(this.css.igHtmlEditorPropertiesDialogContainer);this._attachFormEvents();this.show(this._item)},_createForm:function(){},_attachFormEvents:function(){},_dataBind:function(){},show:function(item){this._item=item;this._dataBind(item);this.options.isHidden=false;this.element.igPopover("show",this.options.target);this._trigger(this.events.show)},hide:function(){this.options.isHidden=true;if(this.options.target.igToolbarButton("option","isSelected")){this.options.target.igToolbarButton("toggle")}this.element.igPopover("hide");this._trigger(this.events.hide)}});$.widget("ui.igLinkPropertiesDialog",$.ui.igHtmlEditorPopover,{_txtUrl:"",_cbTarget:"",_attachFormEvents:function(){var self=this;this.poContent.find("#"+this._id("_cmbOpenIn")).igCombo({initialSelectedItems:[{index:0}],enableClearButton:false,width:"100%",mode:"dropdown"});this.poContent.find("#"+this._id("_btnCancel")).igButton({click:function(){self.hide()}});this.poContent.find("#"+this._id("_btnApply")).igButton({click:function(e){e.stopImmediatePropagation();self._item.attr({href:self._txtUrl.val(),target:self._cbTarget.igCombo("value")}).html(self._displayText.val().length>0?self._displayText.val():self._txtUrl.val());self._trigger(self.events.apply,e,{anchor:self._item});self.hide()}});this.poContent.bind("keypress",function(e){if(e.keyCode===$.ui.keyCode.ESCAPE){self.hide()}});this.element.bind("igpopovershown",function(){self.poContent.find("#"+self._id("_linkHref")).focus()})},_createForm:function(){var html="";html+="<div>"+'<ol class="layoutList">'+"<li>"+'<label for="'+this._id("_linkHref")+'">'+$.ig.HtmlEditor.locale.linkNavigateToUrlDialogText+"</label>"+'<input autocomplete="off" id="'+this._id("_linkHref")+'" name="href" type="text" value="" />'+"</li>"+"<li>"+'<label for="'+this._id("_linkDisplayText")+'">'+$.ig.HtmlEditor.locale.linkDisplayTextDialogText+"</label>"+'<input autocomplete="off" id="'+this._id("_linkDisplayText")+'" name="href" type="text" value="" />'+"</li>"+"<li>"+'<label for="'+this._id("_cmbOpenIn")+'">'+$.ig.HtmlEditor.locale.linkOpenInDialogText+"</label>"+'<select id="'+this._id("_cmbOpenIn")+'" name="target">'+'<option value="_blank">'+$.ig.HtmlEditor.locale.linkTargetNewWindowDialogText+"</option>"+'<option value="_self">'+$.ig.HtmlEditor.locale.linkTargetSameWindowDialogText+"</option>"+'<option value="_parent">'+$.ig.HtmlEditor.locale.linkTargetParentWindowDialogText+"</option>"+'<option value="_top">'+$.ig.HtmlEditor.locale.linkTargetTopmostWindowDialogText+"</option>"+"</select>"+"</li>"+'<li style="text-align:right">'+'<button aria-disabled="false" id="'+this._id("_btnApply")+'" name="insertLink" role="button" title="'+$.ig.HtmlEditor.locale.applyButtonTitle+'" type="button">'+$.ig.HtmlEditor.locale.applyButtonTitle+"</button>"+'<button aria-disabled="false" id="'+this._id("_btnCancel")+'" role="button" title="'+$.ig.HtmlEditor.locale.cancelButtonTitle+'" type="button">'+$.ig.HtmlEditor.locale.cancelButtonTitle+"</button>"+"</li>"+"</ol>"+"</div>";$(html).appendTo(this.poContent)},_dataBind:function(anchor){this._txtUrl=this.poContent.find("#"+this._id("_linkHref")).val(anchor.attr("href"));this._cbTarget=this.poContent.find("#"+this._id("_cmbOpenIn")).val(anchor.attr("target"));this._displayText=this.poContent.find("#"+this._id("_linkDisplayText")).val(anchor.html())}});$.widget("ui.igTablePropertiesDialog",$.ui.igHtmlEditorPopover,{_init:function(){this.rowsNumField=this.element.find("#"+this._id("_tableRows"));this.columnsNumField=this.element.find("#"+this._id("_tableColumns"));$.ui.igHtmlEditorPopover.prototype._init.apply(this,arguments)},_createForm:function(){var html="<div>"+'<ol class="layoutList">'+"<li>"+"</li>"+"<li>"+'<div class="ui-igtablepropertiesdialog-cols-rows-num">'+'<input type="hidden" id="'+this._id("_tableRows")+'" name="tableRows" readonly="readonly" value="">'+'<input type="hidden" id="'+this._id("_tableColumns")+'" name="tableColumns" readonly="readonly" value="">'+"</div>"+"</li>"+"</ol>"+"</div>";$(html).appendTo(this.poContent);this._sampleTable=$('<table "'+this._id("_tableModel")+'" class="ui-igtablepropertiesdialog-sample-table"></table>').tableManipulator({rows:8,columns:6}).appendTo(this.poContent.find(".layoutList li:first"))},_attachFormEvents:function(){var tablePreview=this.poContent.find("table"),cells=tablePreview.find("td").addClass("ui-state-default"),rows=tablePreview.find("tr"),self=this;tablePreview.delegate("td","mouseover",function(e){var target=$(e.target),currentRowNumber=target.parent().index()+1,currentColumnNumber=$(this).index()+1,i;cells.removeClass("ui-state-hover");for(i=0;i<currentRowNumber;i++){$(rows.get(i)).find("td:lt("+currentColumnNumber+")").addClass("ui-state-hover")}self.rowsNumField.val(currentRowNumber);self.columnsNumField.val(currentColumnNumber)});tablePreview.delegate("td","click",function(e){var target=$(e.target),currentRowNumber=target.parent().index()+1,currentColumnNumber=$(this).index()+1;self._item.tableManipulator({rows:currentRowNumber,columns:currentColumnNumber,addSpacingChar:true});self._trigger(self.events.apply,e,{table:self._item.attr("border",1)});self.hide()});tablePreview.bind("mouseout",function(){cells.removeClass("ui-state-hover");self.rowsNumField.val(null);self.columnsNumField.val(null)})},_dataBind:function(){this.rowsNumField.val();this.columnsNumField.val()}});$.widget("ui.igImagePropertiesDialog",$.ui.igHtmlEditorPopover,{_init:function(){this._imgSrcFld=this.poContent.find("#"+this._id("_imgSrc"));this._imgAltFld=this.poContent.find("#"+this._id("_imgAlt"));$.ui.igHtmlEditorPopover.prototype._init.apply(this,arguments)},_createForm:function(){var html="";html+='<div class="'+this.css.igImagePropertiesDialogContent+'">';html+="	<div>";html+='		<ol class="layoutList">';html+="			<li>";html+='				<label for="'+this._id("_imgSrc")+'">'+$.ig.HtmlEditor.locale.imageUrlDialogText+"</label>";html+='				<input autocomplete="off" id="'+this._id("_imgSrc")+'" name="src" type="text" value="" />';html+="			</li>";html+="			<li>";html+='				<label for="'+this._id("_imgAlt")+'">'+$.ig.HtmlEditor.locale.imageAlternativeTextDialogText+"</label>";html+='				<input autocomplete="off" id="'+this._id("_imgAlt")+'" name="altText" type="text" value="" />';html+="			</li>";html+='			<li style="text-align:right">';html+='				<button aria-disabled="false" id="'+this._id("_btnApply")+'" name="insertLink" role="button" title="'+$.ig.HtmlEditor.locale.applyButtonTitle+'" type="button">'+$.ig.HtmlEditor.locale.applyButtonTitle+"</button>";html+='				<button aria-disabled="false" id="'+this._id("_btnCancel")+'" role="button" title="'+$.ig.HtmlEditor.locale.cancelButtonTitle+'" type="button">'+$.ig.HtmlEditor.locale.cancelButtonTitle+"</button>";html+="			</li>";html+="		</ol>";html+="	</div>";html+="</div>";this.poContent.append(html)},_attachFormEvents:function(){var self=this;this.poContent.find("#"+this._id("_btnApply")).igButton({click:function(e){self._item.attr({src:self._imgSrcFld.val(),alt:self._imgAltFld.val()});self._trigger(self.events.apply,e,{image:self._item});self.hide()}}).end().find("#"+this._id("_btnCancel")).igButton({click:function(e){self._trigger(self.events.cancel,e);self.hide()}})},_dataBind:function(image){this._imgSrcFld.val(image.attr("src"));this._imgAltFld.val(image.attr("alt"))}});var table,tableNumRows=0,tableNumCols=0,settings={document:document,rows:0,columns:0,addSpacingChar:false},spacingChar="",methods={init:function(options){return this.each(function(){var tRows;$.extend(settings,options);if(this.nodeName.toLowerCase()!=="table"){return}if(settings.addSpacingChar){spacingChar="&nbsp;"}table=$(this);tRows=methods.getTableRows();if(settings.rows&&settings.rows>0){tableNumRows=settings.rows}else{tableNumRows=tRows.length}if(settings.columns&&settings.columns>0){tableNumCols=settings.columns}else if(tRows[0]){tableNumCols=tRows[0].cells.length}if(!table.children().length){methods.create()}})},create:function(){var newRow,i,j;table.empty();for(i=0;i<tableNumRows;i++){newRow=$("<tr></tr>",settings.document).appendTo(table);for(j=0;j<tableNumCols;j++){$("<td>"+spacingChar+"</td>",settings.document).appendTo(newRow)}}},addRow:function(position){var newRow=$("<tr></tr>",settings.document),j;if(position){newRow.insertAfter(methods.getTableRows().eq(position))}else{newRow.appendTo(table)}for(j=0;j<methods.getColumnsNum();j++){$("<td>"+spacingChar+"</td>",settings.document).appendTo(newRow)}return newRow},removeRow:function(position){var rows=methods.getTableRows(),removedRow;if(position){removedRow=rows.eq(position).remove()}else{removedRow=rows.last().remove()}return removedRow},addColumn:function(position){var columnCellsArr=[];methods.getTableRows().each(function(idx,el){var row=$(el),columns=row.children("td"),newColumn=$("<td>"+spacingChar+"</td>",settings.document);if(position&&columns.length){columnCellsArr.push(newColumn.insertAfter(columns.eq(position))[0]);return true}columnCellsArr.push(newColumn.appendTo(row)[0])});return $([]).pushStack(columnCellsArr)},removeColumn:function(position){var removedRowsArr=[];methods.getTableRows().each(function(idx,el){var row=$(el);if(position){removedRowsArr.push(row.children("td").eq(position).remove());return true}removedRowsArr.push(row.children("td:last").remove())});return $([]).pushStack(removedRowsArr)},getRowsNum:function(){return methods.getTableRows().length},getColumnsNum:function(){return methods.getTableCols().length},getTableRows:function(){return table.children("tbody").children("tr")},getTableCols:function(){return table.children("tbody").children("tr").first().children("td")}};$.fn.tableManipulator=function(method){if(methods[method]){if(this!==table[0]){table=$(this)}return methods[method].apply(this,Array.prototype.slice.call(arguments,1))}if(typeof method==="object"||!method){return methods.init.apply(this,arguments)}$.error("Method "+method+" does not exist on jQuery.tableManipulator")};$.ig.SelectionWrapper=$.ig.SelectionWrapper||Class.extend({_selection:null,_range:null,_isIeOld:false,_window:null,_document:null,_commands:{insertunorderedlist:{name:"_insertList",browsers:null,args:["insertunorderedlist"]},insertorderedlist:{name:"_insertList",browsers:null,args:["insertorderedlist"]}},_css:{larger:"ui-ightmleditor-larger",smaller:"ui-ightmleditor-smaller"},NODE:new $.ig.XmlNodeType,init:function(window,callback){var self=this;this._window=window;this._document=this._window.document;if(!this._document.getSelection){this._isIeOld=true}if(this._isIeOld){this.focus();this._selection=this._document.selection;this._window.setTimeout(function(){self._range=self._selection.createRange();if($.isFunction(callback)){callback.call(self)}},50)}else{this._selection=this._window.getSelection();this._window.setTimeout(function(){self._range=self._getSelection().rangeCount===0?self._document.createRange():self._selection.getRangeAt(0);self._selectClosestTextNode();if($.isFunction(callback)){callback.call(self)}},50)}},_getSelection:function(){return this._selection},_getRange:function(){return this._range},_isCommandSupportedByBrowser:function(command){var supportedBrowsers,i;if(command===null||!this._commands.hasOwnProperty(command.toLowerCase())){return}if(this._commands[command].browsers===null){return}supportedBrowsers=this._commands[command].browsers;for(i=0;i<supportedBrowsers.length;i++){if($.browser&&$.browser.hasOwnProperty(supportedBrowsers[i])){return true}if(!$.browser){if($.ig.util.isIE||$.ig.util.isSafari||$.ig.util.isChrome){return true}}}},_findTextNodes:function(node,allTextNodes){var self=this,$nodeContents=$(node).contents();if($nodeContents.length>0){$nodeContents.each(function(){if(this.nodeType===3){allTextNodes.push(this)}else{self._findTextNodes(this,allTextNodes)}})}},_findAllTextNodes:function(node){var allTextNodes=[];this._findTextNodes(node,allTextNodes);return allTextNodes},_selectClosestTextNode:function(){var children,closestToCaretNode,allTextNodes,textNodeToFocus,range=this._range;if(($.ig.util.isIE||$.ig.util.isFF)&&range.collapsed&&range.startOffset>0&&range.startContainer.nodeType===this.NODE._Element){children=range.startContainer.childNodes;if(children.length>0){closestToCaretNode=children[range.startOffset-1];if(closestToCaretNode.nodeType===3){textNodeToFocus=closestToCaretNode}else{allTextNodes=this._findAllTextNodes($(closestToCaretNode));textNodeToFocus=allTextNodes[allTextNodes.length-1]}if(textNodeToFocus&&!$(textNodeToFocus).parent().is("a")){range.setStart(textNodeToFocus,textNodeToFocus.length);range.collapse(true);this._updateSelection(range)}}}},surroundContents:function(wrapEl){var range=this._getRange();if(this._isIeOld){range.pasteHTML(wrapEl.html(range.text).get(0).outerHTML)}else{this._surroundContents($(range.commonAncestorContainer),$(range.startContainer),$(range.endContainer),wrapEl)}return wrapEl},getSelectedItem:function(){var range=this._getRange(),rangeParent=$(range.commonAncestorContainer);if(!this._isIeOld){if(range.collapsed&&range.endContainer.nodeType===this.NODE._Text){if(rangeParent.parent().is("img")||rangeParent.parent().is("td")){return rangeParent.parent()}return $(range.startContainer)}if(range.collapsed){return $(range.commonAncestorContainer)}if(range.collapsed&&range.endContainer.nodeType===this.NODE._Element){return $(range.commonAncestorContainer.childNodes[range.endOffset-range.startOffset])}return $(range.commonAncestorContainer)}if(range.parentElement!==undefined){return $(range.parentElement())}if(range.commonParentElement!==undefined){return $(range.commonParentElement())}},getSelectionAsText:function(){if(this._getRange().text!==undefined){return this._getRange().text}return this._getRange().toString()},select:function(element){var selectedItem=element||this.getSelectedItem(),newRange;if(!this._isIeOld){this._range.selectNodeContents(selectedItem[0]);this._selection.removeAllRanges();this._selection.addRange(this._range)}else{newRange=this._document.body.createTextRange();if(selectedItem.length===1){newRange.moveToElementText(selectedItem[0])}newRange.select()}},insertElement:function(element){if(!this._isIeOld){this._getRange().insertNode(element.get(0))}else{this._getRange().pasteHTML(element.get(0).outerHTML)}},execCommand:function(name,args){var startEl,endEl,p,range=this._getRange(),customCommand=this._commands[name]?this[this._commands[name].name]:null,customCommandArgs=this._commands[name]?this._commands[name].args:null,browser=this._commands[name]?this._commands[name].browsers:null,isCommandSupported=this._isCommandSupportedByBrowser(name);if(this._isIeOld){range.select();this._document.execCommand(name,false,args)}else{if(this._selection.isCollapsed&&range.collapsed){if($(range.startContainer).is("body")){startEl=$(range.startContainer).find(":first");if(!startEl.length){startEl=$(range.startContainer)}range.selectNodeContents(startEl[0])}else if(range.startContainer.nodeType===this.NODE._Document){startEl=$(range.startContainer.body).find(":first");if(!startEl.length){startEl=$(range.startContainer.body)}range.selectNodeContents(startEl[0])}else if(range.startContainer.nodeType===this.NODE._Text){this._document.execCommand(name,false,args);return}else{startEl=$(range.startContainer)}if(startEl&&startEl.is("br")&&endEl&&endEl.is("br")){p=$("<p><br /></p>",this._document);startEl.replaceWith(p);range.selectNodeContents(p[0]);this._updateSelection(range)}}if($.ig.util.isIE&&$.ig.util.browserVersion>=9||$.ig.util.isOpera){this._updateSelection(range)}if($.isFunction(customCommand)&&browser===null){customCommand.call(this,name,args)}else if($.isFunction(customCommand)&&isCommandSupported){customCommand.apply(this,customCommandArgs)}else{this._document.execCommand(name,false,args)}}},_insertList:function(listType,args){var self=this,textNodes;this._document.execCommand(listType,false,args);if(!this._document.queryCommandState(listType)){if(this._selection.anchorNode&&this._selection.anchorNode.nodeType===this.NODE._Text&&$(this._selection.focusNode).is("body")){textNodes=$(this._selection.focusNode).contents().filter(function(){if($(this).is("br")){$(this).remove();return false}return this.nodeType===self.NODE._Text})}}},_getTextNodesOnlyCallback:function(){return this.nodeType===this.NODE._Text},_wrapPartialString:function(string,start,end,wrapElName){var stack=[];stack.push(this._document.createTextNode(string.slice(0,start)));stack.push(wrapElName.text(string.substring(start,end))[0]);stack.push(this._document.createTextNode(string.slice(end)));return $(stack)},_updateSelection:function(range){this._selection.removeAllRanges();this._selection.addRange(range)},_surroundContents:function(commonParrent,startEl,endEl,wrapEl){var self=this,startOffset,endOffset,rangeStart,rangeEnd,startElPar,endElPar,selection=this._getSelection(),range=this._getRange(),startElSiblings;if(startEl[0]===endEl[0]){range.surroundContents(wrapEl.get(0));return wrapEl}startOffset=range.startOffset;endOffset=range.endOffset;rangeStart=this._document.createRange();rangeStart.setStart(startEl.get(0),startOffset);rangeStart.setEnd(startEl.get(0),startEl.text().length);rangeStart.surroundContents(wrapEl.clone().get(0));selection.addRange(rangeStart);startElPar=this._getLastParentUntil(startEl,commonParrent);endElPar=this._getLastParentUntil(endEl,commonParrent);startElSiblings=startElPar.siblings();startElPar.siblings().each(function(i,el){if(startElPar[0]===endElPar[0]){return}var rangeClone=self._document.createRange();rangeClone.setStartBefore(el);rangeClone.setEndAfter(el);rangeClone.surroundContents(wrapEl.clone().get(0));selection.addRange(rangeClone)});rangeEnd=this._document.createRange();rangeEnd.setStart(endEl.get(0),0);rangeEnd.setEnd(endEl.get(0),endOffset);rangeEnd.surroundContents(wrapEl.clone().get(0));selection.addRange(rangeEnd)},_getLastParentUntil:function(root,target){while(root.parent().length){if(root.parent()[0]===target[0]){return root}root=root.parent()}},replaceNode:function(newNode){var range=this._getRange(),selItem=this.getSelectedItem();if(range.startOffset!==range.endOffset){range.deleteContents()}if(range.insertNode!==undefined&&!selItem.parent().is("a")){range.insertNode(newNode[0])}else if(range.pasteHTML!==undefined){range.pasteHTML(newNode[0].outerHTML)}},insertTable:function(table){var $body,$firstP,selItem=this.getSelectedItem(),br=$("<br>",this._document);if(selItem[0].nodeType===this.NODE._Document){$body=selItem.find("body");$firstP=$body.children("p").first();if($firstP.length>0){this._range.selectNodeContents($firstP[0])}else{this._range.selectNodeContents($body[0])}this._range.insertNode(table[0])}else if(selItem.is("td")){table.appendTo(selItem)}else if(selItem.is("table")){selItem.replaceWith(table)}else if(selItem.is("br")){selItem.replaceWith(table)}else{if(this._range.insertNode!==undefined){this._range.insertNode(table[0])}else if(this._range.pasteHTML!==undefined){this._range.select();this._range.pasteHTML(table[0].outerHTML)}}if(this._range.selectNodeContents!==undefined){this._range.selectNodeContents(br.insertAfter(table)[0])}},focus:function(){var focusTarget;if(this._isIeOld){this._document.body.focus()}else if((this._range.startContainer.nodeType===this.NODE._Document||$(this._range.startContainer).is("body"))&&this._range.collapsed){focusTarget=$(this._document.body).find(":not(br):first");if(focusTarget.length>0){this._range.setStart(focusTarget[0],0);this._range.setEnd(focusTarget[0],0);this._document.body.focus()}}else{if($.ig.util.isIE){this._updateSelection(this._range)}else{this._document.body.focus()}}}});$.ig.ToolbarHelper=$.ig.ToolbarHelper||Class.extend({_toolbarsItemsLocation:{textToolbar:{name:"textToolbar",bold:{name:"bold"},italic:{name:"Italic"},underline:{name:"Underline"},strikethrough:{name:"Strikethrough"},fontFamily:{name:"fontFamily"},fontSize:{name:"fontSize"},formatsList:{name:"formatsList"}},formattingToolbar:{name:"formattingToolbar",justifyleft:{name:"justifyleft"},justifycenter:{name:"justifycenter"},justifyright:{name:"justifyright"},justifyfull:{name:"justifyfull"},bullets:{name:"bullets"},indent:{name:"indent"},outdent:{name:"outdent"},textColor:{name:"textColor"},backgroundTextColor:{name:"backgroundTextColor"}},insertObjectToolbar:{name:"insertObjectToolbar",image:{name:"image"},link:{name:"link"},table:{name:"table"},addRow:{name:"addRow"},addColumn:{name:"addColumn"},removeRow:{name:"removeRow"},removeColumn:{name:"removeColumn"}},copyPasteToolbar:{name:"copyPasteToolbar",copy:{name:"copy"},cut:{name:"cut"},paste:{name:"paste"},undo:{name:"undo"},redo:{name:"redo"}}},init:function(window,toolbars){this._toolbars={};this._w=window;this._d=window.document;var self=this;toolbars.each(function(idx,el){var igToolbarName=$(el).igToolbar("option","name");self._toolbars[igToolbarName]=$(el)});this._initAlignButtons(toolbars);this._disableUnsupportedItems();this._disableTableControls(true)},_initAlignButtons:function(toolbars){var alignButtonsToolbar=this._toolbars.formattingToolbar,alignButtons={justifyleft:alignButtonsToolbar.igToolbar("getItem","justifyleft"),justifycenter:alignButtonsToolbar.igToolbar("getItem","justifycenter"),justifyright:alignButtonsToolbar.igToolbar("getItem","justifyright"),justifyfull:alignButtonsToolbar.igToolbar("getItem","justifyfull")};toolbars.bind("igtoolbartoolbarbuttonclick",function(e,ui){if(alignButtons.hasOwnProperty(ui.name)){$.each(alignButtons,function(buttonName,button){if(buttonName!==ui.name&&button.igToolbarButton("option","isSelected")){button.igToolbarButton("toggle");return}})}})},_disableUnsupportedItems:function(){var copyPasteToolbar=this._toolbars.copyPasteToolbar;if(!$.ig.util.isIE){copyPasteToolbar.igToolbar("disableItem","cut",true);copyPasteToolbar.igToolbar("disableItem","copy",true);copyPasteToolbar.igToolbar("disableItem","paste",true)}},_disableTableControls:function(toDisable){var insertObjectToolbar=this._toolbars.insertObjectToolbar;if(!toDisable&&this._isTableControlsDisabled){insertObjectToolbar.igToolbar("disableItem","addColumn",false);insertObjectToolbar.igToolbar("disableItem","removeColumn",false);insertObjectToolbar.igToolbar("disableItem","addRow",false);insertObjectToolbar.igToolbar("disableItem","removeRow",false);this._isTableControlsDisabled=false}else if(toDisable&&!this._isTableControlsDisabled){insertObjectToolbar.igToolbar("disableItem","addColumn",true);insertObjectToolbar.igToolbar("disableItem","removeColumn",true);insertObjectToolbar.igToolbar("disableItem","addRow",true);insertObjectToolbar.igToolbar("disableItem","removeRow",true);this._isTableControlsDisabled=true}},_callbackMap:{_isBold:"_onBold",_isItalic:"_onItalic",_isUnderlined:"_onUnderlined",_isLineThrough:"_onLineThrough",_isJustifyCenter:"_onAlign",_isJustifyFull:"_onAlign",_isJustifyLeft:"_onAlign",_isJustifyRight:"_onAlign",_isOrderedList:"_onList",_isUnorderedList:"_onList",_hasFontName:"_onFontName",_hasFontSize:"_onFontSize",_isTable:"_onTable"},analyse:function(el){var self=this,justify;this._resetToolbars();if(el[0].nodeType===9){this._computedStyles=this._w.getComputedStyle&&this._w.getComputedStyle(this._d.body)||this._d.body.currentStyle}else{this._computedStyles=this._w.getComputedStyle&&this._w.getComputedStyle(el[0])||el[0].currentStyle}if(el.is(":header")){this._onHeader(el)}$.each(this._callbackMap,function(isTrueFunc,callback){var isTrueRes=self[isTrueFunc](el);if($.isFunction(self[isTrueFunc])&&isTrueRes&&$.isFunction(self[callback])){self[callback](el,isTrueRes);if(callback==="_onAlign"){justify=true}}});if(!justify){this._onAlign(el,"justifyleft")}if(!el.is("table")&&!el.is("td")){this._disableTableControls(true)}},_isBold:function(){return this._d.queryCommandState("bold")},_isItalic:function(){return this._d.queryCommandState("italic")},_isUnderlined:function(){return this._d.queryCommandState("underline")},_isLineThrough:function(){return this._d.queryCommandState("strikethrough")},_isJustifyCenter:function(){if(this._d.queryCommandState("justifycenter")){return"justifycenter"}},_isJustifyFull:function(){if(this._d.queryCommandState("justifyfull")){return"justifyfull"}},_isJustifyLeft:function(){if(this._d.queryCommandState("justifyleft")){return"justifyleft"}},_isJustifyRight:function(){if(this._d.queryCommandState("justifyright")){return"justifyright"}},_isOrderedList:function(){if(this._d.queryCommandState("insertorderedlist")){return"InsertOrderedList"}},_isUnorderedList:function(){if(this._d.queryCommandState("insertunorderedlist")){return"InsertUnorderedList"}},_isTable:function(el){if(el.is("table")||el.is("td")){return true}},_checkParents:function(el,wanted){while(el.parent()){if(el.parent().is(wanted)){return true}if(el.is("body")){return}el=el.parent()}},_hasFontName:function(){var fontName=this._getFontFamily();if(fontName==="serif"){fontName="Times New Roman"}return fontName},_getFontFamily:function(){var fontName=this._d.queryCommandValue("FontName");if(fontName===""){fontName=this._computedStyles.fontFamily}return fontName},_hasFontSize:function(){return this._computedStyles.fontSize},_onBold:function(){this._toolbars.textToolbar.igToolbar("getItem","Bold").igToolbarButton("toggle")},_onItalic:function(){this._toolbars.textToolbar.igToolbar("getItem","Italic").igToolbarButton("toggle")},_onUnderlined:function(){this._toolbars.textToolbar.igToolbar("getItem","Underline").igToolbarButton("toggle")},_onLineThrough:function(){this._toolbars.textToolbar.igToolbar("getItem","Strikethrough").igToolbarButton("toggle")},_onAlign:function(el,dir){this._toolbars.formattingToolbar.igToolbar("getItem",dir).igToolbarButton("toggle")},_onList:function(el,listType){this._toolbars.formattingToolbar.igToolbar("getItem",listType).igToolbarButton("toggle")},_onFontName:function(el,fontName){var combo=this._toolbars.textToolbar.igToolbar("getItem","fontFamily");fontName=fontName.replace(/'|"/g,"");this._setComboValue(combo,$.ig.HtmlEditor.locale.fontNames[/^win/gi.test(navigator.platform)?"win":"mac"],fontName)},_onFontSize:function(){var pxTbl={11:1,13:2,16:3,19:4,24:5,32:6},fontSizeUnits=this._d.queryCommandValue("fontsize")||pxTbl[Math.round(parseFloat(this._computedStyles.fontSize))],fontSizeUnitsStr=fontSizeUnits?fontSizeUnits.toString():"",combo=this._toolbars.textToolbar.igToolbar("getItem","fontSize");this._setComboValue(combo,$.ig.HtmlEditor.locale.fontSizes,fontSizeUnitsStr)},_onHeader:function(element){var combo=this._toolbars.textToolbar.igToolbar("getItem","formatsList");this._setComboValue(combo,$.ig.HtmlEditor.locale.formatsList,element[0].nodeName.toLowerCase())},_onTable:function(){this._disableTableControls(false)},_setComboValue:function(combo,values,newValue,valueKey){var i,dsValueKey=valueKey||valueKey===undefined?"text":valueKey,currentValue=values[combo.igCombo("index")][dsValueKey],dataSourceValue;if(newValue===currentValue){return}for(i=0;i<values.length;i++){dataSourceValue=values[i][dsValueKey];if(newValue===dataSourceValue){combo.igCombo("index",i);break}}},_resetToolbars:function(){$.each(this._toolbars,function(idx,el){$(el).igToolbar("deactivateAll")})}});$.extend($.ui.igHtmlEditor,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI jQuery HTML5 Video Player 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *  jquery-1.4.2.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	modernizr.js (Optional)
 *  infragistics.util.js
 *  infragistics.ui.shared.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igVideoPlayer",{_const:{VOLUME_MAX:1,VOLUME_MIN:0,VIDEO_STATE_TIMEOUT:200,SCROLL_TIMEOUT:100,COMMERCIAL_SEEK_DELTA:2,SLIDE_SEEK_TIMEOUT:500,HREF:"#"},_id:function(id){return this.element[0].id+id},options:{sources:[],width:null,height:null,posterUrl:"",preload:false,autoplay:false,autohide:true,volumeAutohideDelay:1e3,centerButtonHideDelay:1200,loop:false,browserControls:false,fullscreen:false,volume:.5,muted:false,title:"",showSeekTime:true,progressLabelFormat:"${currentTime} / ${duration}",bookmarks:[{time:0,title:"",disabled:false}],relatedVideos:[{imageUrl:"",title:"",width:null,height:null,link:"",sources:[],css:null}],banners:[{imageUrl:"",times:[],closeBanner:true,animate:true,visible:true,duration:1e3,autohide:false,hidedelay:1e4,link:null,width:null,height:null,css:null}],commercials:{linkedCommercials:[{sources:[],startTime:10,link:"",title:""}],embeddedCommercials:[{startTime:20,endTime:30,link:"",title:""}],alwaysPlayCommercials:false,showBookmarks:true,adMessage:{animate:true,autoHide:true,hideDelay:2e4,animationDuration:1e3}}},events:{ended:"ended",playing:"playing",paused:"paused",buffering:"buffering",progress:"progress",waiting:"waiting",bookmarkHit:"bookmarkHit",bookmarkClick:"bookmarkClick",enterFullScreen:"enterFullScreen",exitFullScreen:"exitFullScreen",relatedVideoClick:"relatedVideoClick",bannerVisible:"bannerVisible",bannerHidden:"bannerHidden",bannerClick:"bannerClick",browserNotSupported:"browserNotSupported"},css:{baseClasses:"ui-widget ui-igplayer",controlsClass:"ui-widget-header ui-igplayer-controls ui-igplayer-grid ui-igplayer-autohide ui-corner-all",controlsHideClass:"ui-igplayer-controls-hide",videoClass:"ui-igplayer-video",unsupportedBrowserClass:"ui-html5-non-html5-supported-message ui-helper-clearfix",activeVideoClass:"ui-igplayer-active-video",playButtonClass:"ui-igplayer-playbutton",progressBarClass:"ui-igplayer-progressbar ui-corner-all",fullScreenClass:"ui-igplayer-fullscreen-button",fullScreenIconClass:"ui-icon ui-igbutton-icon ui-icon-arrow-4-diag",volumeControlClass:"ui-igplayer-volumecontrol",volumeSliderClass:"ui-igplayer-volumeslider",progressLabelClass:"ui-igplayer-progresslabel",bookmarkContainerClass:"ui-widget ui-igplayer-bookmark-container",bookmarkContainerHeaderClass:"ui-widget-header ui-igplayer-bookmark-header",bookmarkListClass:"ui-widget-content ui-igplayer-bookmark-list",bookmarkItemDisabledClass:"ui-igplayer-bookmark-item-disabled",bookmarkItemTimeClass:"ui-igplayer-bookmark-item-time",bookmarkItemTitleClass:"ui-igplayer-bookmark-item-title",bookmarkActiveItemClass:"ui-igplayer-bookmark-active-item",relatedVideosContainerClass:"ui-igplayer-related-video-container",relatedVideosOuterContainerClass:"ui-igplayer-related-video-outer-container",relatedVideoClass:"ui-igplayer-related-video",relatedVideoFirstClass:"ui-igplayer-related-video-first",relatedVideoLastClass:"ui-igplayer-related-video-last",relatedVideoHoverClass:"ui-igplayer-related-video-hover",relatedVideoScrollLeftClass:"ui-igplayer-related-scroller-left",relatedVideoScrollLeftIconClass:"ui-icon-triangle-1-w",relatedVideoScrollRightClass:"ui-igplayer-related-scroller-right",relatedVideoScrollRightIconClass:"ui-icon-triangle-1-e",relatedVideoScrollListClass:"ui-igplayer-related-list",relatedVideosHeaderClass:"ui-igplayer-related-video-header",relatedVideoBarClass:"ui-igplayer-related-video-bar",relatedVideoReplayClass:"ui-igplayer-related-video-replay",relatedVideoReplayIconClass:"ui-icon-arrowrefresh-1-s",bannerContainerClass:"ui-igplayer-banner-container",bannerClass:"ui-igplayer-banner ui-corner-all",bannerCloseClass:"ui-igplayer-banner-close",bannerCloseIconClass:"ui-icon-close",adMsgContainerClass:"ui-igplayer-ad-msg-container",adMsgClass:"ui-igplayer-ad-msg",adMsgCloseClass:"ui-igplayer-ad-msg-close",adMsgCloseIconClass:"ui-icon-close",linkedBookmarkClass:"ui-igplayer-linked-bookmark",adBookmarkClass:"ui-igplayer-ad-bookmark",unsupportedVideoSourceClass:"ui-igplayer-not-supported-video-source",unsupportedVideoSourceIconClass:"ui-igplayer-not-supported-video-source-icon",centerPlayButtonClass:"ui-igplayer-centerplaybutton-play",centerPauseButtonClass:"ui-igplayer-centerplaybutton-pause",centerPlayButtonIconClass:"ui-igplayer-centerplaybutton-icon",waitingIndicatorClass:"ui-igplayer-waiting",waitingIndicatorIconClass:"ui-igplayer-waiting-icon",seekTooltipClass:"ui-igplayer-seektooltip"},widget:function(){return this.element},_createWidget:function(){var o=this.options;o.bookmarks=[];o.relatedVideos=[];o.banners=[];o.commercials.linkedCommercials=[];o.commercials.embeddedCommercials=[];$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){if(typeof Modernizr==="object"&&Modernizr.touch){this.options.browserControls=true}if(this.element.is("div")){this.container=this.element}else if(this.element.is("video")){this.container=$("<div></div>").attr("id",this._id("_container")).insertBefore(this.element);this.element.appendTo(this.container)}else{throw new Error($.ig.VideoPlayer.locale.nonDivException)}this._oldWidth=this.element.css("width");this._oldHeight=this.element.css("height");this._renderControl()},_renderControl:function(){var o=this.options,video,css=this.css;this._prevReadyState=0;this._bookmarksRendered=false;if(this.supportsVideo()){this._renderBanners()}this.currentVideo=video=this._createMainVideoElement().addClass(css.videoClass);if(o.disabled){this.container.addClass("ui-state-disabled")}if(o.width){video.css("width",o.width);this.container.css("width",o.width)}if(o.height){video.css("height",o.height);this.container.css("height",o.height)}if(this.supportsVideo()){this._baseZIndex=parseInt(this.container.css("z-index"),10)||0;this._attachEvents(video);this._renderSources(o.sources,video);this._analyzeSource(video);setTimeout($.proxy(this._onVideoStateChange,this),this._const.VIDEO_STATE_TIMEOUT);this._createBigPlayButton();this._createWaitingIndicator();this._renderEmbeddedCommercials();this._renderCommercials();video[0].muted=o.muted;if(o.muted&&$.ig.util.isWebKit){video[0].volume=0}else if(o.volume>=this._const.VOLUME_MIN&&o.volume<=this._const.VOLUME_MAX){video[0].volume=o.volume}if(!o.browserControls){this._renderControls()}this._lastPausedState=video[0].paused;if(o.fullscreen){this._setOption("fullscreen",true,true)}this._renderRelatedVideos()}else{this.currentVideo.hide();$.ig.util._renderUnsupportedBrowser(this,$.ig.VideoPlayer.locale)}$("#"+this._id("_detectError")).appendTo(this.container).bind({click:function(event){event.preventDefault()}});this.container.addClass(css.baseClasses)},_createVideoElement:function(id){var video=$("<video></video>").attr("id",id);return video},_saveExistingVideoProperties:function(video){this._oldAutoPlay=this._getVideoProperty(video,"autoplay");this._oldPreload=this._getVideoProperty(video,"preload");this._oldLoop=this._getVideoProperty(video,"loop");this._oldPoster=this._getVideoProperty(video,"poster");this._oldControls=this._getVideoProperty(video,"controls");this._oldSrc=this._getVideoProperty(video,"src");this._oldMuted=video[0].muted;this._oldVolume=video[0].volume;this._removeVideoProperty(video,"autoplay");this._removeVideoProperty(video,"preload");this._removeVideoProperty(video,"loop");this._removeVideoProperty(video,"poster");this._removeVideoProperty(video,"controls");this._removeVideoProperty(video,"src")},_restoreExistingVideoProperties:function(video){this._setVideoProperty(video,"autoplay",this._oldAutoPlay);this._setVideoProperty(video,"preload",this._oldPreload);this._setVideoProperty(video,"loop",this._oldLoop);this._setVideoProperty(video,"poster",this._oldPoster);this._setVideoProperty(video,"controls",this._oldControls);this._setVideoProperty(video,"src",this._oldSrc);video[0].muted=this._oldMuted;video[0].volume=this._oldVolume},_createMainVideoElement:function(){var o=this.options,isVideoExisting=this.element.is("video"),video=isVideoExisting?this.element:this._createVideoElement(this._id("_video"));if(isVideoExisting){this._saveExistingVideoProperties(video)}if(o.autoplay){this._setVideoProperty(video,"autoplay",true)}this._setVideoProperty(video,"preload","metadata");if(o.preload){this._setVideoProperty(video,"preload","auto")}if(o.browserControls){this._setVideoProperty(video,"controls",true)}if(o.loop){this._setVideoProperty(video,"loop",true)}if(o.posterUrl.length>0){this._setVideoProperty(video,"poster",o.posterUrl)}return video.appendTo(this.container)},_setVideoProperty:function(video,prop,value){if(video.prop){video.prop(prop,value)}else{video.attr(prop,value)}},_getVideoProperty:function(video,prop){if(video.prop){return video.prop(prop)}else{return video.attr(prop)}},_removeVideoProperty:function(video,prop){if(video.prop){return video.removeProp(prop)}else{return video.removeAttr(prop)}},_renderUnsupportedBrowser:function(){if(this._trigger(this.events.browserNotSupported)){var container=$("<div></div>").addClass(this.css.unsupportedBrowserClass).appendTo(this.container),ul,browserUnsupported;if($.ig.util.isIE){browserUnsupported="Internet Explorer "+$.ig.util.browserVersion}else if($.ig.util.isOpera){browserUnsupported="Opera "+$.ig.util.browserVersion}else if($.ig.util.isWebKit){browserUnsupported="Webkit "+$.ig.util.browserVersion}else if($.ig.util.isFF){browserUnsupported="Mozilla Firefox "+$.ig.util.browserVersion}else{browserUnsupported=$.ig.util.browserVersion}$("<div></div>").addClass("ui-igvideoplayer-current-browser-label").html($.ig.VideoPlayer.locale.currentBrowser.replace("{0}",browserUnsupported)).appendTo(container);$("<div></div>").addClass("ui-igvideoplayer-non-html5-text").html($.ig.VideoPlayer.locale.unsupportedBrowser).appendTo(container);ul=$("<ul></ul>").addClass("ui-igplayer-browsers-list").appendTo(container);$("<a></a>").attr("href",$.ig.VideoPlayer.locale.chromeDownload).attr("target","_blank").addClass("ui-igplayer-chrome-icon").html($.ig.VideoPlayer.locale.chrome8).appendTo($("<li></li>").addClass("ui-corner-all").appendTo(ul));$("<a></a>").attr("href",$.ig.VideoPlayer.locale.firefoxDownload).attr("target","_blank").addClass("ui-igplayer-firefox-icon").html($.ig.VideoPlayer.locale.firefox36).appendTo($("<li></li>").addClass("ui-corner-all").appendTo(ul));$("<a></a>").attr("href",$.ig.VideoPlayer.locale.operaDownload).attr("target","_blank").addClass("ui-igplayer-Opera-icon").html($.ig.VideoPlayer.locale.opera11).appendTo($("<li></li>").addClass("ui-corner-all").appendTo(ul));$("<a></a>").attr("href",$.ig.VideoPlayer.locale.safariDownload).attr("target","_blank").addClass("ui-igplayer-safari-icon").html($.ig.VideoPlayer.locale.safari5).appendTo($("<li></li>").addClass("ui-corner-all").appendTo(ul));$("<a></a>").attr("href",$.ig.VideoPlayer.locale.ieDownload).attr("target","_blank").addClass("ui-igplayer-ie-icon").html($.ig.VideoPlayer.locale.ie9).appendTo($("<li></li>").addClass("ui-corner-all").appendTo(ul));this.container.addClass("ui-igvideoplayer-non-html5")}},_renderRelatedVideoBar:function(container){var css=this.css,control=this,relatedVideoBar=$("<div></div>").attr("id",this._id("_rv_bar")).addClass(css.relatedVideoBarClass).appendTo(container);$("<a></a>").attr("id",this._id("_rv_bar_fs")).appendTo($("<div></div>").css({position:"absolute",top:0,left:0,"text-align":"right",width:"100%",height:"100%"}).appendTo(relatedVideoBar)).igButton({link:{href:this._const.HREF},css:{buttonLabelClass:css.fullScreenIconClass}}).attr("title",$.ig.VideoPlayer.locale.enterFullscreen).addClass(css.fullScreenClass).bind({click:function(event){event.preventDefault();control._setOption("fullscreen",!control.options.fullscreen)}});$("<a></a>").attr("id",this._id("_rv_bar_replay")).appendTo(relatedVideoBar).igButton({onlyIcons:false,labelText:$.ig.VideoPlayer.locale.replayButton,icons:{primary:css.relatedVideoReplayIconClass},link:{href:this._const.HREF}}).attr("title",$.ig.VideoPlayer.locale.replayTooltip).bind({click:function(event){event.preventDefault();if(!$(this).igButton("option","disabled")){control.togglePlay()}}}).addClass(css.relatedVideoReplayClass)},_renderScrollButtons:function(container){var css=this.css,ul;$("<a></a>").attr("id",this._id("_rv_left")).appendTo(container).igButton({onlyIcons:true,icons:{primary:css.relatedVideoScrollLeftIconClass},link:{href:this._const.HREF}}).addClass(css.relatedVideoScrollLeftClass).css("position","absolute").hide();ul=$("<ul></ul>").addClass(css.relatedVideoScrollListClass).appendTo(container);$("<a></a>").attr("id",this._id("_rv_right")).appendTo(container).igButton({onlyIcons:true,icons:{primary:css.relatedVideoScrollRightIconClass},link:{href:this._const.HREF}}).addClass(css.relatedVideoScrollRightClass).css("position","absolute");return ul},_renderRelatedVideos:function(){var o=this.options,related=o.relatedVideos||[],len=related.length,i=0,css=this.css,container,scrollContainer,ulContainer,ulContainerWidth=10,currentVideo,control=this;if(len>0){container=$("<div></div>").attr("id",this._id("_rvcc")).addClass(css.relatedVideosOuterContainerClass).appendTo(this.container).hide();$("<div><div>").html($.ig.VideoPlayer.locale.relatedVideos).addClass(css.relatedVideosHeaderClass).appendTo(container);scrollContainer=$("<div></div>").attr("id",this._id("_rvc")).appendTo(container).addClass(css.relatedVideosContainerClass);ulContainer=this._renderScrollButtons(scrollContainer);this._renderRelatedVideoBar(container);this._rvUlWidth=0;this._rvImagesToLoad=0;this._rvImagesLoaded=0;for(i;i<len;i++){if(related[i].imageUrl&&related[i].imageUrl!==""){currentVideo=this._renderRelatedVideo(related[i],ulContainer,i===0,i===len-1);this._rvImagesToLoad++;ulContainerWidth+=currentVideo.outerWidth(true)}}if(ulContainerWidth>container.width()&&ulContainerWidth>ulContainer.width()){ulContainer.width(ulContainerWidth)}this.relatedScrollers=$("a",scrollContainer).bind({mouseover:function(){if(!control._isScrolling){control._isScrolling=true;control._leftDirection=$(this).hasClass(control.css.relatedVideoScrollLeftClass);control._rvDoScroll()}},mouseout:function(){control._rvStopScroll()}});this.relatedVideoElements=$("."+this.css.relatedVideoClass.split(" ")[0],ulContainer).each(function(i){$(this).data("related-index",i)}).bind({mouseover:function(){$(this).addClass(control.css.relatedVideoHoverClass).children().filter("div").show()},mouseout:function(){$(this).removeClass(control.css.relatedVideoHoverClass).children().filter("div").hide()},click:function(event){var relatedVideo=control.options.relatedVideos[$(this).data("related-index")];if(control._relatedVideoClick(relatedVideo,$(this),event)){if(relatedVideo.link&&relatedVideo.link.length>0){window.open(relatedVideo.link,"_blank")}else if(relatedVideo.sources){control._renderSources(relatedVideo.sources,control.currentVideo);control._analyzeSource(control.currentVideo,true);control.play()}}}})}},_rvScrollOnce:function(){var container=$("#"+this._id("_rvc")),ul=$("ul",container),currentLeftStr=ul[0].style.left,currentLeft=parseInt(currentLeftStr===""||currentLeftStr==="auto"?"0px":currentLeftStr,10),pixelsToScroll=10,newLeft=this._leftDirection?currentLeft+pixelsToScroll:currentLeft-pixelsToScroll,left=$("#"+this._id("_rv_left")),right=$("#"+this._id("_rv_right")),ulWidth=ul.width(),scrollContainerWidth=container.width(),continueScrolling=true;ul[0].style.left=newLeft+"px";if(currentLeft===0&&newLeft<0){left.show()}if(newLeft>=0&&currentLeft!==0&&left[0].style.display!=="none"){left.hide();continueScrolling=false}if(scrollContainerWidth-newLeft>=ulWidth&&right[0].style.display!=="none"){continueScrolling=false;right.hide()}else if(right[0].style.display==="none"){right.show()}return continueScrolling},_rvDoScroll:function(){var continueScrolling=this._isScrolling&&this._rvScrollOnce();if(continueScrolling){this._scrollingTimoutId=setTimeout($.proxy(this._rvDoScroll,this),this._const.SCROLL_TIMEOUT)}else{this._rvStopScroll()}},_rvStopScroll:function(){if(this._isScrolling){clearTimeout(this._scrollingTimoutId);this._isScrolling=false}},_relatedVideoClick:function(relatedVideo,relatedElement,event){var args={relatedVideo:relatedVideo,relatedVideoElement:relatedElement};return this._trigger(this.events.relatedVideoClick,event,args)},_renderRelatedVideo:function(related,container,isFirst,isLast){var rv=$("<li></li>").appendTo(container).addClass(this.css.relatedVideoClass),relatedImg=$("<img/>").appendTo(rv),self=this;if(isFirst||isLast){rv.addClass(isFirst?this.css.relatedVideoFirstClass:this.css.relatedVideoLastClass)}if(related.imageUrl&&related.imageUrl!==""){relatedImg.attr("src",related.imageUrl)}if(related.title&&related.title!==""){relatedImg.attr("title",related.title)}if(related.css&&related.css!==""){relatedImg.addClass(related.css)}if(related.width&&related.width!==""){relatedImg.css("width",related.width)}if(related.height&&related.height!==""){relatedImg.css("height",related.height)}$("<div></div>").appendTo(relatedImg.parent()).css("position","absolute").hide();relatedImg.bind({load:function(){self._imageLoaded(this)},error:function(){self._rvImagesLoaded++;self._onImagesLoaded()},readystatechange:function(){self._imageLoaded(this)}});return rv},_imageLoaded:function(img){var rs=img.readyState,width=parseInt(img.style.width,10),height=parseInt(img.style.height,10),spanSize;if(!rs||new RegExp("loaded|complete").test(rs)){this._rvUlWidth+=width+parseInt($(img).parent().css("marginRight"),10)+parseInt($(img).parent().css("marginLeft"),10);this._rvImagesLoaded++;if(width>24&&height>24){if(width>50&&height>50){spanSize=48}else if(width>34&&height>34){spanSize=32}else{spanSize=24}$(img).parent().children().filter("div").addClass("ui-igplayer-related-video-hover-x"+spanSize).css({width:spanSize,height:spanSize,top:height/2-spanSize/2,left:width/2-spanSize/2})}}this._onImagesLoaded()},_onImagesLoaded:function(){if(this._rvImagesLoaded===this._rvImagesToLoad){var container=$("#"+this._id("_rvc"));$("ul",container).css("width",this._rvUlWidth+4);container.parent().show();if(this._rvUlWidth<container.width()){this.relatedScrollers.hide()}else{$(this.relatedScrollers[1]).show()}container.parent().hide();delete this._rvUlWidth;delete this._rvImagesLoaded;delete this._rvImagesToLoad}},_renderEmbeddedCommercials:function(){var ec=this.options.commercials.embeddedCommercials||[],i=0,len=ec.length,filtered=[],val;for(i;i<len;i++){val=ec[i];if(val&&val.startTime&&val.endTime&&val.startTime<val.endTime){filtered.push(val)}}ec=filtered;len=ec.length;if(ec&&len>0){this._embeddedCommercialsShow=$.extend(true,[],ec);this._embeddedCommercialIndex=0;this._renderAdMessage()}},_renderCommercials:function(){var o=this.options,com=o.commercials.linkedCommercials||[],control=this,video;if(com.length>0){video=this._createVideoElement(this._id("_com_video")).attr("preload","auto").appendTo(this.container).addClass(this.css.videoClass).bind({ended:function(){var slider=$("#"+control._id("_ctrls_s")),bookmarks=slider.data("igSlider").bookmarks;control._hideWaitingIndicator();control._commercialIndex++;control._commercialsShow.shift();control._commercialPlaying=false;control.currentVideo=control._getMainVideo();control.currentVideo.show();$(this).hide();slider.igSlider("option","disabled",false);if(bookmarks){bookmarks.show()}control.currentVideo[0].muted=this.muted;control.currentVideo[0].play();control.currentVideo.addClass(control.css.videoClass);control.controls[control._activeControlsIndex].css("z-index","");$("#"+control._id("_seek_tooltip")).css("z-index","");$("#"+control._id("_play")).css("z-index","")},waiting:function(event){control._onVideoWaiting(event);control._waiting(this.currentSrc,this.currentTime,this.duration,event)},timeupdate:function(event){control._changeCurrentTime(event)},playing:function(event){control._hideWaitingIndicator();$("span",$("#"+control._id("_ctrls_play"))).addClass("ui-icon-pause").removeClass("ui-icon-play");control._playing(this.currentSrc,this.duration,event)},pause:function(event){$("span",$("#"+control._id("_ctrls_play"))).addClass("ui-icon-play").removeClass("ui-icon-pause");control._paused(this.currentSrc,this.duration,event)},click:function(event){event.preventDefault();var link=control.options.commercials.linkedCommercials[control._commercialIndex].link;if(link&&link.length>0){window.open(link,"_blank")}}}).hide();if(video.prop&&video.prop("preload")!=="auto"){video.prop("preload","auto")}this._buildCommercialsShow();this._renderAdMessage()}},_renderAdClose:function(container){var control=this;$("<a></a>").attr("id",this._id("_ad_msg_close")).appendTo(container).igButton({onlyIcons:true,icons:{primary:this.css.adMsgCloseIconClass},link:{href:this._const.HREF}}).addClass(this.css.adMsgCloseClass).bind("click",function(event){event.preventDefault();event.stopPropagation();control.hideAdMessage()})},_renderAdMessage:function(){if($("#"+this._id("_ad_msg_c")).length===0){var css=this.css,container;container=$("<div></div>").attr("id",this._id("_ad_msg_c")).addClass(css.adMsgContainerClass).prependTo(this.container).bind({mouseover:function(){$(this).addClass("ui-state-hover")},mouseout:function(){$(this).removeClass("ui-state-hover")}}).hide();$("<span></span>").attr("id",this._id("_ad_msg")).appendTo(container).addClass(css.adMsgClass).html($.ig.VideoPlayer.locale.adMessage);this._renderAdClose(container)}},_showAdMessage:function(seconds){var adMsgContainer=$("#"+this._id("_ad_msg_c")),msgOpt=this.options.commercials.adMessage;this._updateAdMessage(seconds,true);adMsgContainer.css("width",this.container.css("width"));if(msgOpt.animate){adMsgContainer.slideToggle(msgOpt.animationDuration)}else{adMsgContainer.show()}if(msgOpt.autoHide){this._adHideTimeout=setTimeout($.proxy(this.hideAdMessage,this),msgOpt.hideDelay)}},_updateAdMessage:function(seconds,force){var msg=$("#"+this._id("_ad_msg"));if(msg.is(":visible")||force){if(isNaN(seconds)){msg.html($.ig.VideoPlayer.locale.adMessageNoDuration)}else{seconds=parseInt(seconds,10);if(seconds>60){msg.html($.ig.VideoPlayer.locale.adMessageLong.replace("$duration$",this._toTimeString(seconds)))}else{msg.html($.ig.VideoPlayer.locale.adMessage.replace("$duration$",seconds))}}this._isHiddenAdMessage=false}else if(!this._isHiddenAdMessage){this._showAdMessage(seconds)}},hideAdMessage:function(){clearTimeout(this._adHideTimeout);var msg=$("#"+this._id("_ad_msg_c")),msgOpt=this.options.commercials.adMessage;if(msg.is(":visible")){if(msgOpt.animate){msg.slideToggle(msgOpt.animationDuration)}else{msg.hide()}this._isHiddenAdMessage=true}},_buildCommercialsShow:function(){var com=this.options.commercials.linkedCommercials||[],len=com.length,i=0;this._commercialsShow=[];this._commercialIndex=0;for(i;i<len;i++){this._commercialsShow.push(com[i].startTime)}this._commercialsShow=$.extend(true,[],this._commercialsShow)},playCommercial:function(commercial){if(!commercial||!commercial.sources){return}var comVideo=$("#"+this._id("_com_video")),videoOffset=this.currentVideo.offset(),slider=$("#"+this._id("_ctrls_s")),bookmarks=slider.data("igSlider").bookmarks,bookmarkTitle=$("#"+this._id("_ctrls_s_tooltip"));this._commercialPlaying=true;$("source",comVideo).remove();this._renderSources(commercial.sources,comVideo);this._analyzeSource(comVideo);this.currentVideo[0].pause();this.currentVideo.removeClass(this.css.videoClass);this.controls[this._activeControlsIndex].css("z-index",this._baseZIndex+5e3);$("#"+this._id("_seek_tooltip")).css("z-index",this._baseZIndex+5e3);$("#"+this._id("_play")).css("z-index",this._baseZIndex+5e3);slider.igSlider("option","disabled",true);if(bookmarks&&bookmarkTitle){bookmarks.hide();bookmarkTitle.hide()}comVideo[0].muted=this.currentVideo[0].muted;comVideo[0].play();if(commercial.link&&commercial.link.length>0){comVideo.attr("title",$.ig.VideoPlayer.locale.adNewWindowTip)}else{comVideo.removeAttr("title")}comVideo.css("top",videoOffset.top).css("left",videoOffset.left).css("width",this.currentVideo.css("width")).css("height",this.currentVideo.css("height")).show();this.currentVideo.hide();this.currentVideo=comVideo},_renderBanners:function(){var banners=this.options.banners||[],len=banners.length,i=0,parent=$("<div></div>").appendTo(this.container).addClass(this.css.bannerContainerClass),banner;this._bannerShow=[];for(i;i<len;i++){banner=banners[i];if(banner.imageUrl&&banner.imageUrl.length>0){this._renderBannerContainer(banner,this._id("_banner_grid"+i),parent).data("banner-index",i)}this._bannerShow.push($.extend(true,[],banner.times))}},_buildBannersShow:function(){var banners=this.options.banners||[],len=banners.length,i=0;if(len>0){this._bannerShow=[]}for(i;i<len;i++){this._bannerShow.push($.extend(true,[],banners[i].times))}},_renderBannerClose:function(container,id){var css=this.css,control=this;$("<a></a>").attr("id",id+"_banner_close").appendTo($("<div></div>").css({position:"absolute",top:0,left:0,"text-align":"right",width:"100%",height:"100%"}).appendTo(container)).addClass(css.bannerCloseClass).igButton({onlyIcons:true,icons:{primary:css.bannerCloseIconClass},link:{href:this._const.HREF}}).bind("click",function(event){event.preventDefault();event.stopPropagation();control.hideBanner($(this).parent().parent().data("banner-index"))})},_renderBannerContainer:function(banner,id,parent){var css=this.css,control=this,container=$("<div></div>").attr("id",id).appendTo(parent),img=$("<img></img>").attr("id",id+"_img").attr("src",banner.imageUrl).appendTo(container);this.banner=container.addClass(css.bannerClass);if(!banner.visible){container.hide()}if(banner.closeBanner){this._renderBannerClose(container,id)}if(banner.width){container.css("width",banner.width);img.attr("width",parseInt(banner.width,10))}if(banner.height){container.css("height",banner.height);img.attr("height",parseInt(banner.height,10))}if(banner.css){container.addClass(banner.css)}container.bind("click",function(event){var noCancel=true,args={bannerElement:$(event.currentTarget)};noCancel=control._trigger(control.events.bannerClick,event,args);if(banner.link&&banner.link.length>0&&noCancel){window.open(banner.link,"_blank")}});return container},showBanner:function(index){if(this.options.banners&&index>=0&&index<this.options.banners.length){var banner=this.options.banners[index],id=this._id("_banner_grid"+index),container=$("#"+id);if(banner.animate){container.fadeIn(banner.duration)}else{container.show()}this._bannerVisible(index,container);if(banner.autohide){this._bannerHideTimeout=setTimeout(this._createDelegate(this,this.hideBanner,[index]),banner.hidedelay)}}},_createDelegate:function(instance,method,args){return function(){return method.apply(instance,args)}},hideBanner:function(index){if(this.options.banners&&index>=0&&index<this.options.banners.length){clearTimeout(this._bannerHideTimeout);var banner=this.options.banners[index],container=$("#"+this._id("_banner_grid"+index));if(banner.animate){container.fadeOut(banner.duration)}else{container.hide()}this._bannerHidden(index,container)}},_renderSources:function(sources,video){var control=this;$(sources).each(function(){control._renderSource(this,video)})},_renderSource:function(source,video){var qmIndex=source.indexOf("?"),extStartIndex=source.lastIndexOf(".")+1,extEndIndex=qmIndex>-1?qmIndex:source.length,extension=source.substring(extStartIndex,extEndIndex);$("<source></source>").attr("src",source).attr("type",("video/"+source.substring(source.lastIndexOf(".")+1,source.length)).replace("/ogv","/ogg")).appendTo(video);video.data(extension,source)},_getMainVideo:function(){return this.element.is("video")?this.element:$("#"+this._id("_video"))},_setOption:function(key,value,force){var video=this.currentVideo,videoElem=video[0],mainVideo=this._getMainVideo(),videoOffset=video.offset(),options=this.options,noCancel=true,fsVideoH=0;if(this.options[key]===value){return}switch(key){case"disabled":if(value){this.container.addClass("ui-state-disabled")}else{this.container.removeClass("ui-state-disabled")}break;case"sources":$("source",mainVideo).remove();this._renderSources(value,mainVideo);this._analyzeSource(mainVideo);break;case"width":if(value!==options.width){video.css("width",value);this.container.css("width",value);if(!options.browserControls){$("#"+this._id("_ctrls")).parent().css("width",value);$("#"+this._id("_title_ctrls")).parent().css("width",value)}options.width=value}break;case"height":if(value!==options.height){video.css("height",value);this.container.css("height",value);options.height=value}break;case"posterUrl":if(value!==options.posterUrl){this._setVideoProperty(video,"poster",value);options.posterUrl=value}break;case"loop":if(value!==options.loop){videoElem.loop=value;options.loop=value}break;case"browserControls":if(typeof Modernizr==="object"&&Modernizr.touch){return}if(value!==options.browserControls){if(!value){videoElem.controls=false;this._ensureVolume();this._renderControls();this._detectBuffered()}else{videoElem.controls=true;this._destroyControls()}options.browserControls=value}break;case"autohide":if(!options.browserControls){if(value){this._onControlMouseOut()}else{this._onControlMouseOver()}}options.autohide=value;break;case"fullscreen":if(value!==options.fullscreen||force){if(value){noCancel=this._enterFullScreen(videoElem.currentSrc);if(noCancel){this.container.data("style.position",this.container.css("position"));this.container.data("document.scrollTop",$(document).scrollTop());this.container.data("document.scrollLeft",$(document).scrollLeft());this.container.data("style.left",this.container.css("left"));this.container.data("style.top",this.container.css("top"));this.container.css("z-index",this._baseZIndex+1e4);$(document).scrollTop(0);$(document).scrollLeft(0);this.container.css("position","fixed").css("height","100%").css("width","100%").css("left","0px").css("top","0px");$("#"+this._id("_ctrls")).parent().css("width","100%");if(this._commercialPlaying){video.css("top",0).css("left",0);mainVideo.css("height","100%").css("width","100%")}video.css("height","100%").css("width","100%");if(!options.browserControls){$("span",$("#"+this._id("_ctrls_fs_btn"))).removeClass("ui-icon-arrow-4-diag").addClass("ui-icon-closethick")}if($("#"+this._id("_rv_bar_fs")).is(":visible")){$("span",$("#"+this._id("_rv_bar_fs"))).removeClass("ui-icon-arrow-4-diag").addClass("ui-icon-closethick")}if(options.bookmarks&&options.bookmarks.length>0){$("#"+this._id("_bookmarks")).hide()}}}else{noCancel=this._exitFullScreen(videoElem.currentSrc);if(noCancel){this.container.css("position",this.container.data("style.position")).css("left",this.container.data("style.left")).css("top",this.container.data("style.top"));this.container.css("z-index",this._baseZIndex);$(document).scrollTop(this.container.data("document.scrollTop"));$(document).scrollLeft(this.container.data("document.scrollLeft"));if(options.height){if(options.bookmarks&&options.bookmarks.length>0){fsVideoH=parseInt(options.height,10)-parseInt($("#"+this._id("_bookmarks")).css("height"),10);if(this._commercialPlaying){mainVideo.css("height",fsVideoH)}video.css("height",fsVideoH)}else{if(this._commercialPlaying){mainVideo.css("height",options.height)}video.css("height",options.height)}this.container.css("height",options.height)}else{if(this._commercialPlaying){mainVideo.css("height","")}video.css("height","");this.container.css("height","")}if(options.width){if(this._commercialPlaying){mainVideo.css("width",options.width)}video.css("width",options.width);$("#"+this._id("_ctrls")).parent().css("width",options.width);this.container.css("width",options.width)}else{if(this._commercialPlaying){mainVideo.css("width","")}video.css("width","");$("#"+this._id("_ctrls")).parent().css("width","");this.container.css("width","")}if(this._commercialPlaying){video.css("top",videoOffset.top).css("left",videoOffset.left)}if(!options.browserControls){$("span",$("#"+this._id("_ctrls_fs_btn"))).removeClass("ui-icon-closethick").addClass("ui-icon-arrow-4-diag")}if($("#"+this._id("_rv_bar_fs")).is(":visible")){$("span",$("#"+this._id("_rv_bar_fs"))).removeClass("ui-icon-closethick").addClass("ui-icon-arrow-4-diag")
}if(options.bookmarks&&options.bookmarks.length>0){$("#"+this._id("_bookmarks")).show()}}}if(!noCancel){return}if($("#"+this._id("_waiting")).is(":visible")){this._showWaitingIndicator()}if($("#"+this._id("_play")).is(":visible")){this._showCenterPlayButton()}if($("#"+this._id("_ad_msg_c")).is(":visible")){$("#"+this._id("_ad_msg_c")).css("width",this.container.css("width"))}if($("#"+this._id("_ctrls_vs")).is(":visible")){this._hideVolumeSlider()}if($("#"+this._id("_detectError")).is(":visible")){this._showUnsupportedVideoSourceMsg()}$("body").toggleClass("ui-igplayer-full-screen-mode");if(!options.browserControls){$("#"+this._id("_ctrls_fs_btn")).attr("title",value?$.ig.VideoPlayer.locale.exitFullscreen:$.ig.VideoPlayer.locale.enterFullscreen)}if($("#"+this._id("_rv_bar_fs")).is(":visible")){$("#"+this._id("_rv_bar_fs")).attr("title",value?$.ig.VideoPlayer.locale.exitFullscreen:$.ig.VideoPlayer.locale.enterFullscreen)}options.fullscreen=value}break;case"volume":if(value!==options.volume&&value>=this._const.VOLUME_MIN&&value<=this._const.VOLUME_MAX){options.volume=videoElem.volume=value;if(value>0&&videoElem.muted){options.muted=videoElem.muted=false}else if(value===0&&!videoElem.muted){options.muted=videoElem.muted=true}if(!options.browserControls){this._adjustVolumeButton(value);$("#"+this._id("_ctrls_vs")).igSlider("option","value",value*100)}}break;case"muted":if(value!==options.muted){options.muted=videoElem.muted=value;$("#"+this._id("_ctrls_vs")).igSlider("option","value",value?0:(options.volume!==0?options.volume:.3)*100);if(options.volume===0){options.volume=.3}if(!value&&videoElem.volume===0){videoElem.volume=options.volume}if(!options.browserControls){this._adjustVolumeButton($("#"+this._id("_ctrls_vs")).igSlider("option","value"))}}break;case"title":$("#"+this._id("_title_ctrls_t")).html(value);break;case"progressLabelFormat":options.progressLabelFormat=value;this._updateProgressLabel();break;case"alwaysPlayCommercials":if(value!==options.commercials.alwaysPlayCommercials){options.commercials.alwaysPlayCommercials=value;if(value){this.resetCommercialsShow()}}break;case"bookmarks":this._destroyBookmarks();options.bookmarks=value;this._renderBookmarks();break;case"relatedVideos":this._destroyRelatedVideos();options.relatedVideos=value;this._renderRelatedVideos();break;default:break}$.Widget.prototype._setOption.apply(this,arguments)},_onVideoStateChange:function(){var video=this.currentVideo,videoElem=video[0],o=this.options,prevReadyState=this._prevReadyState,readyState=videoElem.readyState;if(prevReadyState>=videoElem.HAVE_FUTURE_DATA&&readyState<=videoElem.HAVE_CURRENT_DATA){if(!videoElem.ended){this._showWaitingIndicator()}}else if(prevReadyState<=videoElem.HAVE_CURRENT_DATA&&readyState===videoElem.HAVE_FUTURE_DATA){this._hideWaitingIndicator()}else if(readyState===videoElem.HAVE_ENOUGH_DATA){if(prevReadyState<=videoElem.HAVE_CURRENT_DATA){this._hideWaitingIndicator()}else{return}}this._prevReadyState=readyState;this._detectBuffered();if(this._lastPausedState!==videoElem.paused){if(this._lastPausedState){this._showCenterPlayButton().removeClass(this.css.centerPauseButtonClass).addClass(this.css.centerPlayButtonClass)}else{this._showCenterPlayButton().removeClass(this.css.centerPlayButtonClass).addClass(this.css.centerPauseButtonClass)}setTimeout($.proxy(this._hideCenterPlayButton,this),o.centerButtonHideDelay);this._prepareForPlay();this._lastPausedState=videoElem.paused}this._setOption("muted",videoElem.muted);this._refreshDuration();this._onVideoStateChangeId=setTimeout($.proxy(this._onVideoStateChange,this),this._const.VIDEO_STATE_TIMEOUT)},_updateTitleControlsTimeString:function(timeString,title){if(this._activeControlsIndex===1&&timeString){if(!title){title=timeString}$("span.ui-igplayer-playbutton-text",$("#"+this._id("_title_ctrls"))).attr("title",title).html(timeString)}},_analyzeSource:function(video,doNotShowError){var detected=false;if(this.supportsH264BaselineVideo()&&video.data("mp4")!==undefined){video.attr("src",video.data("mp4"));detected=true}else if(this.supportsWebmVideo()&&video.data("webm")!==undefined){video.attr("src",video.data("webm"));detected=true}else if(this.supportsOggTheoraVideo()){if(video.data("ogv")!==undefined){video.attr("src",video.data("ogv"));detected=true}else if(video.data("ogg")!==undefined){video.attr("src",video.data("ogg"));detected=true}}video.data("sourceDetected",detected);if(!detected&&!doNotShowError){this._showUnsupportedVideoSourceMsg();if(!this.options.browserControls){if(this._activeControlsIndex===0){$("#"+this._id("_ctrls_play")).igButton("option","disabled",true)}}}else{this._hideUnsupportedVideoSourceMsg();if(!this.options.browserControls){if(this._activeControlsIndex===0){$("#"+this._id("_ctrls_play")).igButton("option","disabled",false)}}}},resetCommercialsShow:function(){this._buildCommercialsShow();this._embeddedCommercialsShow=$.extend(true,[],this.options.commercials.embeddedCommercials);this._embeddedCommercialIndex=0},_attachVideoEvents:function(video){var control=this;this._videoEvents={error:function(event){control._onVideoError(event)},progress:function(event){control._onVideoLoading(event)},waiting:function(event){control._onVideoWaiting(event);control._waiting(this.currentSrc,this.currentTime,this.duration,event)},seeking:function(){control._showWaitingIndicator()},seeked:function(){control._hideWaitingIndicator()},timeupdate:function(event){control._changeCurrentTime(event)},ended:function(event){control._showCenterPlayButton().removeClass("ui-igplayer-centerplaybutton-pause").addClass("ui-igplayer-centerplaybutton-play");control._hideWaitingIndicator();if(!control.options.browserControls){$("span",$("#"+control._id("_ctrls_play"))).addClass("ui-icon-play").removeClass("ui-icon-pause")}$("#"+control._id("_ctrls_pb")).igProgressBar("option","value",0);if(control.options.relatedVideos.length>0){control._onControlMouseOut(null);$("#"+control._id("_rvcc")).show()}control._buildBannersShow();if(control.options.commercials.alwaysPlayCommercials){control.resetCommercialsShow()}control._ended(this.currentSrc,this.duration,event)},playing:function(event){control._hideWaitingIndicator();$("span",$("#"+control._id("_ctrls_play"))).addClass("ui-icon-pause").removeClass("ui-icon-play");control._playing(this.currentSrc,this.duration,event)},pause:function(event){$("span",$("#"+control._id("_ctrls_play"))).addClass("ui-icon-play").removeClass("ui-icon-pause");control._paused(this.currentSrc,this.duration,event)},click:function(event){var o=control.options;if(!o.browserControls){event.preventDefault()}if(event.button===0&&!o.disabled){control._onVideoClick(!o.browserControls)}},dblclick:function(event){event.preventDefault();if(event.button===0&&!control.options.disabled){control._onVideoDblClick()}},selectstart:function(){return false},loadedmetadata:function(){control._refreshDuration()}};video.bind(this._videoEvents)},_onVideoClick:function(allowPlay){if(this._embeddedCommercialPlaying){var link=this.options.commercials.embeddedCommercials[this._embeddedCommercialIndex].link;if(link&&link.length>0){window.open(link,"_blank")}}else if(allowPlay){this.togglePlay()}},_onVideoDblClick:function(){var o=this.options;this._setOption("fullscreen",!o.fullscreen);if(!o.browserControls){this._toggleCenterPlayButton()}},_attachEvents:function(video){var control=this;this._attachVideoEvents(video);this._generalEvts={keydown:function(event){if(event.keyCode===$.ui.keyCode.ESCAPE){if(control.options.fullscreen){control._setOption("fullscreen",false);event.preventDefault();event.stopPropagation()}}else if(event.keyCode===$.ui.keyCode.SPACE){event.preventDefault();event.stopPropagation();control.togglePlay()}}};this._documentEvts={contextmenu:function(e){if($(e.target).is("video")&&control.options.disabled){e.preventDefault();e.stopPropagation()}}};$(document).bind(this._documentEvts);if(!this.options.browserControls){this._controlsEvts={mouseover:function(event){control._onControlMouseOver(event)},mouseout:function(event){control._onControlMouseOut(event)}};this.container.bind(this._controlsEvts)}this.container.bind(this._generalEvts)},_handleKbNavigation:function(event){if(event.keyCode===$.ui.keyCode.HOME){$(this.controlButtons[0]).focus();event.stopPropagation();event.preventDefault()}else if(event.keyCode===$.ui.keyCode.END){$(this.controlButtons[this.controlButtons.length-1]).focus();event.stopPropagation();event.preventDefault()}},_handleBlurKb:function(){this.currentVideo.removeClass(this.css.activeVideoClass)},_handleFocusKb:function(){this.currentVideo.addClass(this.css.activeVideoClass)},_onVideoLoading:function(event){this._detectBuffered(event)},_detectBuffered:function(event){var videoElem=this.currentVideo[0],buffered=videoElem.buffered,duration=parseInt(videoElem.duration,10),len=buffered?buffered.length:0,firstBuffered=len>0?parseInt(buffered.start(len-1),10):0,lastBuffered=len>0?parseInt(buffered.end(len-1),10):0,bufferSize=lastBuffered/duration*100;if(len>0&&this._previouslyBuffered!==bufferSize){if(this._previousBuffer&&lastBuffered<parseInt(this._previousBuffer.end(0),10)){$("#"+this._id("_ctrls_pb")).igProgressBar("option","value",firstBuffered)}$("#"+this._id("_ctrls_pb")).igProgressBar("option","endValue",lastBuffered/duration*100);this._buffering(videoElem.currentSrc,bufferSize,event);this._previouslyBuffered=bufferSize;this._previousBuffer=buffered}},_getActiveControls:function(){var ai=this._activeControlsIndex;if(ai!==undefined&&this.controls&&ai>=0&&ai<this.controls.length){return this.controls[ai].parent()}return null},_onControlMouseOver:function(){var controlsDiv=this._getActiveControls(),o=this.options;if(controlsDiv&&!o.browserControls&&o.autohide&&!$("#"+this._id("_rvcc")).is(":visible")){controlsDiv.show().removeClass(this.css.controlsHideClass)}},_onControlMouseOut:function(){var o=this.options,controlsDiv=this._getActiveControls();if(controlsDiv&&!o.browserControls&&o.autohide){controlsDiv.addClass(this.css.controlsHideClass).hide()}},_onVideoError:function(e){var error=e.target.error;switch(error.code){case error.MEDIA_ERR_ABORTED:break;case error.MEDIA_ERR_NETWORK:this.play();break;case error.MEDIA_ERR_DECODE:case error.MEDIA_ERR_SRC_NOT_SUPPORTED:this._showUnsupportedVideoSourceMsg();break;default:break}},_changeCurrentTime:function(event){var videoElem=this.currentVideo[0],rawDuration=videoElem.duration,currentTime;if(rawDuration===Infinity){this._updateProgressLabel()}else if(!isNaN(rawDuration)){currentTime=parseInt(videoElem.currentTime,10);if(!this._userSliding){$("#"+this._id("_ctrls_s")).igSlider("option","value",currentTime/rawDuration*100)}this._updateProgressLabel();if(this._embeddedCommercialPlaying){this._updateAdMessage(this.options.commercials.embeddedCommercials[this._embeddedCommercialIndex].endTime-currentTime);this._checkEmbeddedCommercialShow(currentTime)}else if(!this._commercialPlaying){this._checkBannerShow(currentTime);this._checkCommercialsShow(currentTime);this._checkEmbeddedCommercialShow(currentTime)}else{this._updateAdMessage(rawDuration-currentTime)}}this._progress(videoElem.currentSrc,currentTime,rawDuration,event)},_checkBannerShow:function(currentTime){var show=this._bannerShow||[],len=show.length,i=0;for(i;i<len;i++){if(show[i].length>0&&currentTime>=show[i][0]){show[i].shift();this.showBanner(i)}}},_checkCommercialsShow:function(currentTime){if(this._commercialsShow&&this._commercialsShow.length>0&&currentTime>=this._commercialsShow[0]&&!this._commercialPlaying){this._commercialPlaying=true;if(currentTime-this._commercialsShow[0]>this._const.COMMERCIAL_SEEK_DELTA){this.currentTime(this._commercialsShow[0])}this.playCommercial(this.options.commercials.linkedCommercials[this._commercialIndex])}},_checkEmbeddedCommercialShow:function(currentTime){if(this._embeddedCommercialsShow&&this._embeddedCommercialsShow.length>0&&!this.currentVideo[0].seeking){var currentCommercial=this._embeddedCommercialsShow[0];if(currentTime>=currentCommercial.startTime&&!this._embeddedCommercialPlaying){this._embeddedCommercialPlaying=true;if(currentTime-currentCommercial.startTime>this._const.COMMERCIAL_SEEK_DELTA){this.currentTime(currentCommercial.startTime)}$("#"+this._id("_ctrls_s")).igSlider("option","disabled",true);this._showAdMessage(currentCommercial.endTime-currentCommercial.startTime);if(currentCommercial.link&&currentCommercial.link.length>0){this.currentVideo.attr("title",$.ig.VideoPlayer.locale.adNewWindowTip)}}else if(currentTime>=currentCommercial.endTime&&this._embeddedCommercialPlaying){this._embeddedCommercialsShow.shift();this._embeddedCommercialIndex++;this._embeddedCommercialPlaying=false;this.hideAdMessage();$("#"+this._id("_ctrls_s")).igSlider("option","disabled",false);if(currentCommercial.link&&currentCommercial.link.length>0){this.currentVideo.removeAttr("title")}}}},_updateProgressLabel:function(){var videoElem=this.currentVideo[0],progressLabel=$("#"+this._id("_ctrls_pl")),rawDuration=videoElem.duration,duration=parseInt(rawDuration,10),currentTime=parseInt(videoElem.currentTime,10),progressString=this.options.progressLabelFormat;progressString=progressString.replace("${currentTime}",this._toTimeString(currentTime)).replace("${duration}",rawDuration===Infinity?$.ig.VideoPlayer.locale.liveStream:this._toTimeString(duration));progressLabel.html(progressString)},_toTimeString:function(val){if(typeof val==="number"){var secs=parseInt(val%60,10),mins=parseInt(val/60,10),hours=parseInt(mins/60,10),days=parseInt(hours/24,10),timeFormat="{0}d {1}:{2}:{3}";mins=parseInt(mins%60,10);hours=parseInt(hours%60,10);timeFormat=timeFormat.replace("{3}",secs<10?"0"+secs:secs).replace("{2}",mins);if(hours>0){timeFormat=timeFormat.replace("{1}",hours);if(days>0){timeFormat=timeFormat.replace("{0}",days)}else{timeFormat=timeFormat.replace("{0}d ","")}}else{timeFormat=timeFormat.replace("{0}d {1}:","")}return timeFormat}return"NaN"},_onVideoWaiting:function(){this._showWaitingIndicator()},_createUnsupportedVideoSourceMsg:function(){var css=this.css;return this._createButton(this._id("_detectError"),css.unsupportedVideoSourceClass,css.unsupportedVideoSourceIconClass,$.ig.VideoPlayer.locale.missingVideoSource).attr("title",$.ig.VideoPlayer.locale.unsupportedVideoSource)},_showUnsupportedVideoSourceMsg:function(){var error=$("#"+this._id("_detectError"));if(error.length===0){error=this._createUnsupportedVideoSourceMsg()}return error.show()},_hideUnsupportedVideoSourceMsg:function(){$("#"+this._id("_detectError")).hide()},_createBigPlayButton:function(){var control=this,css=this.css;this._createButton(this._id("_play"),css.centerPlayButtonClass,css.centerPlayButtonIconClass,"").bind({click:function(event){event.preventDefault();if(event.button===0){control._onVideoClick(true)}},dblclick:function(event){event.preventDefault();if(event.button===0){control._onVideoDblClick()}}})},_createButton:function(buttonId,buttonClass,spanClass,text){$("<span></span>").html(text).addClass(spanClass).appendTo($("<a></a>").attr("id",buttonId).attr("href",this._const.HREF).attr("tabIndex",-1).addClass("ui-state-default").addClass(buttonClass).appendTo(this.container));return $("#"+buttonId).bind({mouseover:function(){$(this).addClass("ui-state-hover")},mouseout:function(){$(this).removeClass("ui-state-hover")}}).hide()},_showCenterPlayButton:function(){var video=this.currentVideo,button=$("#"+this._id("_play")),videoCenterTop=Math.floor(video.height()/2),videoCenterLeft=Math.floor(video.width()/2),top=videoCenterTop-Math.floor(button.innerHeight()/2),left=videoCenterLeft-Math.floor(button.innerWidth()/2);button.css("position","absolute").css("left",left).css("top",top);return button.show()},_toggleCenterPlayButton:function(){var videoElem=this.currentVideo[0],o=this.options,css=this.css;if(videoElem.paused||videoElem.ended){this._showCenterPlayButton().removeClass(css.centerPauseButtonClass).addClass(css.centerPlayButtonClass)}else{this._showCenterPlayButton().removeClass(css.centerPlayButtonClass).addClass(css.centerPauseButtonClass)}setTimeout($.proxy(this._hideCenterPlayButton,this),o.centerButtonHideDelay)},_hideCenterPlayButton:function(){return $("#"+this._id("_play")).hide()},_createWaitingIndicator:function(){var css=this.css;this._createButton(this._id("_waiting"),css.waitingIndicatorClass,css.waitingIndicatorIconClass,$.ig.VideoPlayer.locale.buffering)},_createSeekTimeToolTip:function(){$("<div></div>").attr("id",this._id("_seek_tooltip")).hide().igTooltip({text:"00:00",arrowLocation:"bottom"}).appendTo(this.container).addClass(this.css.seekTooltipClass)},_showSeekTimeToolTip:function(x,y,seconds){var toolTip=$("#"+this._id("_seek_tooltip"));toolTip.css("top",y-toolTip.outerHeight()).css("left",x-toolTip.width()/2).igTooltip("option","text",this._toTimeString(seconds)).show()},_showWaitingIndicator:function(){if($("#"+this._id("_detectError")).is(":visible")){return}var video=this.currentVideo,button=$("#"+this._id("_waiting")),videoCenterTop=Math.floor(video.height()/2),videoCenterLeft=Math.floor(video.width()/2),top=videoCenterTop-Math.floor(button.innerHeight()/2),left=videoCenterLeft-Math.floor(button.innerWidth()/2);button.css("position","absolute").css("left",left).css("top",top).show()},_hideWaitingIndicator:function(){$("#"+this._id("_waiting")).hide()},_renderTitleControls:function(){var title=this.options.title,control=this,controlsDiv,html='<div id="'+this._id("_title_ctrls")+'" class="ui-widget-header ui-igplayer-controls ui-igplayer-grid ui-igplayer-title-controls ui-corner-all">';html+='<div class="ui-igplayer-row">';html+='<div class="ui-igplayer-container ui-igplayer-cell ui-igplayer-playback-alone">';html+='		<a id="'+this._id("_title_ctrls_play")+'" class="ui-button ui-igplayer-playbutton ui-igplayer-playback-with-time ui-state-default ui-corner-all ui-priority-primary" href="'+this._const.HREF+'">';html+='			<span title="'+$.ig.VideoPlayer.locale.play+'" class="ui-icon ui-icon-play ui-igplayer-playbutton-icon"></span>';html+='			<span title="00:00" class="ui-button-text ui-igplayer-playbutton-text">00:00</span>';html+="		</a>";html+="</div>";html+='<div id="'+this._id("_title_ctrls_t")+'" class="ui-igplayer-container ui-igplayer-cell ui-igplayer-video-title">';if(title&&title.length>0){html+=title}html+="</div></div></div>";controlsDiv=$(html).appendTo(this.container).wrap('<div style="position:absolute; width: 100%;"></div>');if(this.options.width){controlsDiv.parent().css("width",this.options.width)}$("#"+this._id("_title_ctrls_play")).bind({click:function(event){event.preventDefault();if(event.button===0&&!control.options.disabled){control.togglePlay()}}});return controlsDiv},_hideTitleControls:function(){if(this._activeControlsIndex!==0){this._activeControlsIndex=0;$("#"+this._id("_title_ctrls")).addClass(this.css.controlsHideClass).parent().remove();$("#"+this._id("_ctrls")).parent().show()}},_convertBookmarks:function(prop,bookmarks,duration,css){var len=bookmarks.length,newBookmarks=[],i=0,mark,newMark,value;for(i;i<len;i++){mark=bookmarks[i];if(mark[prop]>0&&mark[prop]<duration){value=parseInt(mark[prop]/duration*100,10);newMark={value:value,secondsValue:mark[prop],displayTime:this._toTimeString(mark[prop]),index:i,title:mark.title,disabled:mark.disabled};if(css&&css.length>0){newMark.css=css}newBookmarks.push(newMark)}}return newBookmarks},_renderBookmarks:function(){var o=this.options,bookmarks=o.bookmarks||[],com=o.commercials,ads=com.linkedCommercials||[],eads=com.embeddedCommercials||[],duration=this.currentVideo[0].duration,newBookmarks=[],newAdBookmarks=[],newEAdBookmarks=[];if(com.showBookmarks){if(ads.length>0){newAdBookmarks=this._convertBookmarks("startTime",ads,duration,this.css.linkedBookmarkClass)}if(eads.length>0){newEAdBookmarks=this._convertBookmarks("startTime",eads,duration,this.css.adBookmarkClass)}}if(bookmarks.length>0){newBookmarks=this._convertBookmarks("time",bookmarks,duration);if(newBookmarks.length>0){this._renderBookmarkArea(newBookmarks)}}if(newAdBookmarks.length>0){$.merge(newBookmarks,newAdBookmarks)}if(newEAdBookmarks.length>0){$.merge(newBookmarks,newEAdBookmarks)}if(newBookmarks.length>0){$("#"+this._id("_ctrls_s")).igSlider("option","bookmarks",newBookmarks)}this._bookmarksRendered=true},_renderBookmarkArea:function(bookmarks){if(bookmarks&&bookmarks.length>0){var css=this.css,bookmarkStr='<li class="ui-corner-all $class$"><span class="'+css.bookmarkItemTimeClass+'">$time$</span><span class="'+css.bookmarkItemTitleClass+'" title="$titleAttr$">$title$</span></li>',bookmarkAreaStr='<div id="$id$" class="$bookmarkContainerClass$"><div class="$headerClass$">$headerText$</div><ul class="$bookmarkListClass$">$list$</ul></div>',bookmarkList="",bookmarkArea,mark,i=0,len=bookmarks.length,control=this;for(i;i<len;i++){mark=bookmarks[i];bookmarkList+=bookmarkStr.replace("$time$",mark.displayTime).replace("$titleAttr$",mark.title).replace("$title$",mark.title).replace("$class$",mark.disabled?css.bookmarkItemDisabledClass:"")}bookmarkAreaStr=bookmarkAreaStr.replace("$id$",this._id("_bookmarks")).replace("$bookmarkContainerClass$",css.bookmarkContainerClass).replace("$headerClass$",css.bookmarkContainerHeaderClass).replace("$bookmarkListClass$",css.bookmarkListClass).replace("$headerText$",$.ig.VideoPlayer.locale.skipTo).replace("$list$",bookmarkList);bookmarkArea=$(bookmarkAreaStr).appendTo(this.container);this.bookmarkElements=$("li",$("#"+this._id("_bookmarks")));this.bookmarkElements.each(function(i){$(this).data("bookmark-index",bookmarks[i].index);$(this).data("bookmark-sec-value",bookmarks[i].secondsValue)});this.bookmarkElements.bind({click:function(event){var index=$(this).data("bookmark-index"),mark=control.options.bookmarks[index];event.stopPropagation();event.preventDefault();if(!mark.disabled){if(control.paused()){control.togglePlay()}control.currentTime($(this).data("bookmark-sec-value"));control._changeActiveBookmark(index);control._bookmarkClick(mark,bookmarks[index],event)}}});if(this.options.height){this.currentVideo.css("height",this.container.height()-bookmarkArea.height());this._resizeBookmarkAreaTimeoutId=setTimeout($.proxy(this._onPlayerResize,this),500)}}},_onPlayerResize:function(){var o=this.options,containerH=this.container.height(),containerW=this.container.width(),bookmarkArea=$("#"+this._id("_bookmarks"));if((o.height||o.width)&&(this._oldContainerHeight!==containerH||this._oldContainerWidth!==containerW)){this.currentVideo.css("height",containerH-bookmarkArea.height());this._oldContainerHeight=containerH;this._oldContainerWidth=containerW}this._resizeBookmarkAreaTimeoutId=setTimeout($.proxy(this._onPlayerResize,this),250)},_ensureVolume:function(){this.options.volume=this.currentVideo[0].volume},_renderControls:function(){$("body").addClass("ui-igplayer-normal-screen-mode");if(this.options.showSeekTime){this._createSeekTimeToolTip()}var videoElem=this.currentVideo[0],control=this,controlsDiv,controlsArray=[],autoPlay=this.options.autoplay,href=this._const.HREF,html='<div id="'+this._id("_ctrls")+'" class="$controlsClass$">',cachedTime;html+='			<div class="ui-igplayer-row">';html+='				<div class="ui-igplayer-container ui-igplayer-cell ui-igplayer-playback">';html+='					<a id="$playButtonId$" class="$playButtonClass$" href="'+href+'"></a>';html+="				</div>";html+='				<div class="ui-igplayer-container ui-igplayer-cell ui-igplayer-progress-bar">';html+='					<div id="$progressBarId$" class="$progressBarClass$"></div>';html+="				</div>";html+='				<div class="ui-igplayer-container ui-igplayer-extra">';html+='					<div class="ui-igplayer-grid">';html+='						<div class="ui-igplayer-row">';html+='							<div class="ui-igplayer-cell">';html+='								<a id="$progressLabelId$" class="$progressLabelClass$" href="'+href+'"></a>';html+="							</div>";html+='							<div class="ui-igplayer-cell">';html+="								<div>";html+='									<div id="$volumeSliderId$" class="$volumeSliderClass$"></div>';html+="									<div>";html+='										<a id="$volumeControlId$" class="$volumeControlClass$" href="'+href+'"></a>';html+="									</div>";html+="								</div>";html+="							</div>";html+='							<div class="ui-igplayer-cell">';html+='								<a id="$fullScreenId$" class="$fullScreenClass$" href="'+href+'"></a>';html+="							</div>";html+="						</div>";html+="					</div>";html+="				</div>";html+="			</div>";html+="		</div>";html=html.replace("$playButtonClass$",this.css.playButtonClass).replace("$progressBarClass$",this.css.progressBarClass).replace("$fullScreenClass$",this.css.fullScreenClass).replace("$controlsClass$",this.css.controlsClass).replace("$volumeControlClass$",this.css.volumeControlClass).replace("$volumeSliderClass$",this.css.volumeSliderClass).replace("$progressLabelClass$",this.css.progressLabelClass);html=html.replace("$playButtonId$",this._id("_ctrls_play")).replace("$progressBarId$",this._id("_ctrls_s")).replace("$fullScreenId$",this._id("_ctrls_fs_btn")).replace("$volumeControlId$",this._id("_ctrls_vc_btn")).replace("$volumeSliderId$",this._id("_ctrls_vs")).replace("$progressLabelId$",this._id("_ctrls_pl"));controlsDiv=$(html).appendTo(this.container).wrap('<div style="position:absolute; width: 100%;"></div>');if(this.options.width){controlsDiv.parent().css("width",this.options.width)}controlsArray.push(controlsDiv);if(!autoPlay&&videoElem.currentTime===0){controlsDiv.parent().hide();this._activeControlsIndex=1;controlsArray.push(this._renderTitleControls())}else{this._activeControlsIndex=0}this.controls=$(controlsArray);$("#"+this._id("_ctrls_play")).bind({click:function(event){event.preventDefault();if(!$(this).igButton("option","disabled")){control.togglePlay()}}}).igButton({link:{href:this._const.HREF},css:{buttonLabelClass:"ui-icon "+(autoPlay?"ui-icon-pause ":"ui-icon-play ")+"ui-igplayer-playbutton-icon "}}).addClass("ui-priority-primary").attr("title",autoPlay?$.ig.VideoPlayer.locale.playing:$.ig.VideoPlayer.locale.paused);$("#"+this._id("_ctrls_fs_btn")).bind({click:function(event){event.preventDefault();control._setOption("fullscreen",!control.options.fullscreen)}}).igButton({link:{href:this._const.HREF},css:{buttonLabelClass:this.css.fullScreenIconClass}}).attr("title",$.ig.VideoPlayer.locale.enterFullscreen);$('<div id="'+this._id("_ctrls_pb")+'"></div>').appendTo($("#"+this._id("_ctrls_s")).igSlider({slide:function(event,ui){if(event.originalEvent===undefined){return false}clearTimeout(control._slideTimeout);control._slideTimeout=setTimeout(control._createDelegate(control,control._slide,[ui]),control._const.SLIDE_SEEK_TIMEOUT)},start:function(){control._userSliding=true},stop:function(){control._userSliding=false},bookmarkhit:function(event,ui){var index=ui.bookmark.index,elems=control.bookmarkElements;if(elems&&elems.length>0){control._changeActiveBookmark(index);control._bookmarkHit(control.currentVideo[0].currentSrc,control.options.bookmarks[index],elems[index],event)}},bookmarkclick:function(event,ui){var mark;if($(ui.bookmarkElement).hasClass("ui-igplayer-linked-bookmark")){mark=control.options.commercials.linkedCommercials[ui.bookmark.index]}else if($(ui.bookmarkElement).hasClass("ui-igplayer-ad-bookmark")){mark=control.options.commercials.embeddedCommercials[ui.bookmark.index]}else{mark=control.options.bookmarks[ui.bookmark.index];control._changeActiveBookmark(ui.bookmark.index)}if(mark.time){cachedTime=mark.time}else{cachedTime=mark.startTime}control.currentTime(cachedTime);control._bookmarkClick(mark,ui.bookmarkElement,event);return false},min:0,max:100,animate:true}).css("display","block")).igProgressBar({range:true,endValue:0});$("#"+this._id("_ctrls_pb")).bind({mousemove:function(e){if(control.options.showSeekTime&&this.offsetWidth>0){var relativeX=e.pageX-this.offsetLeft-$(this).offset().left,percentLocation=parseInt(relativeX/this.offsetWidth*100,10),duration=videoElem.duration,seconds,controlOffset=control.container.offset();if(!isNaN(duration)&&duration!==Infinity&&!control._commercialPlaying){seconds=parseInt(percentLocation*duration/100,10);control._showSeekTimeToolTip(e.pageX-controlOffset.left,e.pageY-controlOffset.top,seconds)}}},mouseout:function(){$("#"+control._id("_seek_tooltip")).hide()}});$("#"+this._id("_ctrls_pl")).bind({click:function(event){event.preventDefault()}});$("#"+this._id("_ctrls_vc_btn")).bind({mouseover:function(){control._showVolumeSlider()},mouseout:function(event){if(!jQuery.contains(event.currentTarget,event.relatedTarget)&&event.currentTarget!==event.relatedTarget){control._volumeSliderTimeoutId=setTimeout($.proxy(control._hideVolumeSlider,control),control.options.volumeAutohideDelay)}},click:function(event){event.preventDefault();control._setOption("muted",!control.options.muted)}}).igButton({link:{href:this._const.HREF},css:{buttonLabelClass:"ui-icon "+(this.options.muted?"ui-icon-volume-off ":"ui-icon-volume-on ")+"ui-igbutton-icon"}}).attr("title",$.ig.VideoPlayer.locale.volume);$("#"+this._id("_ctrls_vs")).hide().bind({mouseover:function(){control._volumeSliderMouseOut=false;clearTimeout(control._volumeSliderTimeoutId)},mouseout:function(){if(!control._userSlidingVolume){control._volumeSliderTimeoutId=setTimeout($.proxy(control._hideVolumeSlider,control),control.options.volumeAutohideDelay)}control._volumeSliderMouseOut=true}}).igSlider({slide:function(event,ui){if(event.originalEvent===undefined){return}control._setOption("volume",parseFloat(parseInt(ui.value,10)/100))},start:function(){control._userSlidingVolume=true},stop:function(){control._userSlidingVolume=false},min:0,max:100,step:10,orientation:"vertical",value:this.options.muted?0:this.options.volume*100});$("#"+this._id("_ctrls_vs")).data("igSlider").handle.attr("tabIndex",-1).bind({blur:function(){control._volumeSliderTimeoutId=setTimeout($.proxy(control._hideVolumeSlider,control),control.options.volumeAutohideDelay)}});this.controlButtons=$([document.getElementById(this._id("_ctrls_play")),$("a.ui-state-default",$("#"+this._id("_ctrls_s")))[0],document.getElementById(this._id("_ctrls_vc_btn")),document.getElementById(this._id("_ctrls_fs_btn"))]);this.controlButtons.each(function(i){$(this).data("index.control-button",i)});this.controlButtons.bind({keydown:function(event){control._handleKbNavigation(event)},focus:function(event){control._handleFocusKb(event)},blur:function(event){control._handleBlurKb(event)}});$("#"+this._id("_ctrls_vc_btn")).bind({focus:function(){control._showVolumeSlider()},blur:function(){if(!control._transferFocusFromVolumeButtonToVolumeSlider){control._hideVolumeSlider()}control._transferFocusFromVolumeButtonToVolumeSlider=false},keydown:function(event){if(event.keyCode===$.ui.keyCode.TAB){event.preventDefault();event.stopPropagation();control._transferFocusFromVolumeButtonToVolumeSlider=true;$("#"+control._id("_ctrls_vs")).data("igSlider").handle.focus()}}});$("#"+control._id("_ctrls_vs")).data("igSlider").handle.bind({keydown:function(event){if(event.keyCode===$.ui.keyCode.TAB){event.preventDefault();event.stopPropagation();$("#"+control._id("_ctrls_fs_btn")).focus()}}})},_slide:function(ui){var value=ui.value,rawDuration=this.currentVideo[0].duration,currentTime=rawDuration*(value/100);if(!isNaN(rawDuration)&&rawDuration!==Infinity){this.currentTime(currentTime)}this._userSliding=false},_changeActiveBookmark:function(index){var activeBookmarkIndex=this._activeBookmarkIndex,bkElems=this.bookmarkElements;if(bkElems&&bkElems.length>0&&index!==activeBookmarkIndex){if(activeBookmarkIndex>=0&&activeBookmarkIndex<bkElems.length){$(bkElems[activeBookmarkIndex]).removeClass(this.css.bookmarkActiveItemClass)}if(index>=0&&index<bkElems.length){$(bkElems[index]).addClass(this.css.bookmarkActiveItemClass);this._activeBookmarkIndex=index}}},_adjustVolumeButton:function(value){var volumeButton=$("#"+this._id("_ctrls_vc_btn"));if(value===0){$("span",volumeButton).removeClass("ui-icon-volume-on").addClass("ui-icon-volume-off")}else{$("span",volumeButton).removeClass("ui-icon-volume-off").addClass("ui-icon-volume-on")}},_hideVolumeSlider:function(){var slider=$("#"+this._id("_ctrls_vs"));
slider.data("igSlider").handle.attr("tabIndex",-1);slider.hide()},_showVolumeSlider:function(){clearTimeout(this._volumeSliderTimeoutId);var slider=$("#"+this._id("_ctrls_vs"));slider.data("igSlider").handle.removeAttr("tabIndex");slider.show()},_ended:function(source,duration,event){var args={source:source,duration:duration};return this._trigger(this.events.ended,event,args)},_playing:function(source,duration,event){var args={source:source,duration:duration,currentTime:this.currentVideo[0].currentTime};return this._trigger(this.events.playing,event,args)},_paused:function(source,duration,event){var args={source:source,duration:duration,currentTime:this.currentVideo[0].currentTime};return this._trigger(this.events.paused,event,args)},_buffering:function(source,bufferedPercent,event){var args={source:source,buffered:bufferedPercent};return this._trigger(this.events.buffering,event,args)},_progress:function(source,currentTime,duration,event){var args={source:source,currentTime:currentTime,duration:duration};return this._trigger(this.events.progress,event,args)},_waiting:function(source,currentTime,duration,event){var args={source:source,currentTime:currentTime,duration:duration};return this._trigger(this.events.waiting,event,args)},_bookmarkHit:function(source,bookmark,bookmarkElement,event){var args={source:source,bookmark:bookmark,bookmarkElement:bookmarkElement};return this._trigger(this.events.bookmarkHit,event,args)},_bookmarkClick:function(bookmark,bookmarkElement,event){var args={bookmark:bookmark,bookmarkElement:bookmarkElement};return this._trigger(this.events.bookmarkClick,event,args)},_enterFullScreen:function(source){var args={source:source};return this._trigger(this.events.enterFullScreen,null,args)},_exitFullScreen:function(source){var args={source:source};return this._trigger(this.events.exitFullScreen,null,args)},_bannerVisible:function(index,element){var args={index:index,banner:this.options.banners[index],bannerElement:element};return this._trigger(this.events.bannerVisible,null,args)},_bannerHidden:function(index,element){var args={index:index,banner:this.options.banners[index],bannerElement:element};return this._trigger(this.events.bannerHidden,null,args)},_prepareForPlay:function(){var o=this.options,video=this.currentVideo;if($("source",video).length===0){this._renderSources(o.sources,video)}if(!video.data("sourceDetected")){this._analyzeSource(video)}this._hideTitleControls();if(o.relatedVideos&&o.relatedVideos.length>0){$("#"+this._id("_rvcc")).hide()}},togglePlay:function(){var videoElem=this.currentVideo[0];this._prepareForPlay();this._toggleCenterPlayButton();if(videoElem.paused||videoElem.ended){if(!this.options.browserControls){$("#"+this._id("_ctrls_play")).attr("title",$.ig.VideoPlayer.locale.playing)}videoElem.play()}else{if(!this.options.browserControls){$("#"+this._id("_ctrls_play")).attr("title",$.ig.VideoPlayer.locale.paused)}videoElem.pause()}},play:function(){var videoElem=this.currentVideo[0];if(videoElem.paused||videoElem.ended){this._prepareForPlay();this._toggleCenterPlayButton();if(!this.options.browserControls){$("#"+this._id("_ctrls_play")).attr("title",$.ig.VideoPlayer.locale.playing)}videoElem.play()}},pause:function(){var videoElem=this.currentVideo[0];if(!videoElem.paused){this._toggleCenterPlayButton();if(!this.options.browserControls){$("#"+this._id("_ctrls_play")).attr("title",$.ig.VideoPlayer.locale.paused)}videoElem.pause()}},currentTime:function(val){var videoElem=this.currentVideo[0],rawDuration=videoElem.duration;if(val!==null&&val!==undefined){try{videoElem.currentTime=val;$("#"+this._id("_ctrls_pb")).igProgressBar("option","value",(val/rawDuration).toFixed(2)*100);this._checkCommercialsShow(val);this._checkEmbeddedCommercialShow(val)}catch(ex){}if(videoElem.paused&&!isNaN(rawDuration)){$("#"+this._id("_ctrls_s")).igSlider("option","value",(val/rawDuration).toFixed(2)*100)}}return parseInt(videoElem.currentTime,10)},screenshot:function(scaleFactor){if(!scaleFactor||$.type(scaleFactor)!=="number"){scaleFactor=1}var videoElem=this.currentVideo[0],w=videoElem.videoWidth*scaleFactor,h=videoElem.videoHeight*scaleFactor,canvas=document.createElement("canvas"),ctx;if(canvas.getContext){canvas.width=w;canvas.height=h;ctx=canvas.getContext("2d");ctx.drawImage(videoElem,0,0,w,h)}return canvas},supportsVideo:function(){return!!document.createElement("video").canPlayType},supportsH264BaselineVideo:function(){if(!this.supportsVideo()){return false}var v=document.createElement("video");return v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')!==""},supportsOggTheoraVideo:function(){if(!this.supportsVideo()){return false}var v=document.createElement("video");return v.canPlayType('video/ogg; codecs="theora, vorbis"')!==""},supportsWebmVideo:function(){if(!this.supportsVideo()){return false}var v=document.createElement("video");return v.canPlayType('video/webm; codecs="vp8, vorbis"')!==""},paused:function(){return this.currentVideo[0].paused},ended:function(){return this._getMainVideo()[0].ended},duration:function(){this._refreshDuration();return this._duration},_refreshDuration:function(){var duration=this.currentVideo[0].duration;if(duration!==this._duration){this._duration=duration;if(duration===Infinity){this._updateTitleControlsTimeString($.ig.VideoPlayer.locale.live,$.ig.VideoPlayer.locale.liveStream);$("#"+this._id("_ctrls_s")).data("igSlider").handle.hide();$("#"+this._id("_ctrls_s")).igSlider("option","disabled",true)}else if(!isNaN(duration)){if(this._commercialPlaying){this._showAdMessage(parseInt(duration,10))}else{this._updateTitleControlsTimeString(this._toTimeString(duration));if(!this._bookmarksRendered&&duration>0){this._renderBookmarks()}}}}},seeking:function(){return this.currentVideo[0].seeking},destroy:function(){var css=this.css;clearTimeout(this._scrollingTimoutId);clearTimeout(this._volumeSliderTimeoutId);clearTimeout(this._onVideoStateChangeId);clearTimeout(this._resizeBookmarkAreaTimeoutId);if(this._oldWidth){this.element.css("width",this._oldWidth)}if(this._oldHeight){this.element.css("height",this._oldHeight)}this.container.unbind(this._generalEvts);$(document).unbind(this._documentEvts);if(this._controlsEvts){this.container.unbind(this._controlsEvts)}this.container.removeClass(css.baseClasses);$("#"+this._id("_ctrls_s")).igSlider("destroy");$("#"+this._id("_ctrls_pb")).igProgressBar("destroy");$("#"+this._id("_ctrls_vs")).igSlider("destroy");$("#"+this._id("_seek_tooltip")).igTooltip("destroy");if(this._commercialsShow){delete this._commercialsShow;delete this._commercialIndex;delete this._commercialPlaying}if(this._embeddedCommercialsShow){delete this._embeddedCommercialPlaying;delete this._embeddedCommercialIndex;delete this._embeddedCommercialsShow}delete this.bookmarkElements;delete this.relatedVideoElements;delete this.controlButtons;delete this._bannerShow;delete this.banner;if(this.element.is("video")){this.element.unbind(this._videoEvents);this.element.removeClass(css.videoClass);this._restoreExistingVideoProperties(this.element);$(":not(video)",this.container).remove();this.element.unwrap()}else{this.container.children().remove()}$.Widget.prototype.destroy.apply(this,arguments)},_destroyBookmarks:function(){if(this.bookmarkElements&&this.bookmarkElements.length>0){this.bookmarkElements.unbind();this.bookmarkElements.removeData();delete this.bookmarkElements;$("#"+this._id("_bookmarks")).remove();$("#"+this._id("_ctrls_s")).igSlider("clearBookmarks");this._bookmarksRendered=false}},_destroyRelatedVideos:function(){var related=this.options.relatedVideos;if(related&&related.length>0){$("#"+this._id("_rvcc")).remove();delete this.relatedVideoElements;related=[]}},_destroyControls:function(){var controls=this.options.browserControls;if(!controls){$("#"+this._id("_ctrls_play")).igButton("destroy");$("#"+this._id("_ctrls_vc_btn")).igButton("destroy");$("#"+this._id("_ctrls_fs_btn")).igButton("destroy");$("#"+this._id("_ctrls_pb")).igProgressBar("destroy");$("#"+this._id("_ctrls_s")).igSlider("destroy");$("#"+this._id("_ctrls_vs")).igSlider("destroy");this.controls.each(function(){$(this).parent().remove()});delete this.controls;delete this.controlButtons;delete this._activeControlsIndex}}});$.extend($.ui.igVideoPlayer,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Tree Grid 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.7.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.shared.js
 *	infragistics.util.js
 *	infragistics.ui.grid.framework.js
 */
(function($){var _aNull=function(val){return val===null||val===undefined};$.widget("ui.igTreeGrid",$.ui.igGrid,{css:{containerClasses:"ui-igtreegrid",expandCellExpanded:"ui-icon ui-igtreegrid-expansion-indicator ui-icon-minus",expandCellCollapsed:"ui-icon ui-igtreegrid-expansion-indicator ui-icon-plus",dataSkipCell:"ui-igtreegrid-non-data-column",expandColumn:"ui-igtreegrid-expansion-indicator-cell",dataColumnExpandContainer:"ui-igtreegrid-expansion-indicator-container",expandColumnContainer:"ui-igtreegrid-expansion-column-container",expandContainer:"ui-igtreegrid-expandcell",expandHeaderCell:"ui-igtreegrid-expansion-indicator-header-cell ui-iggrid-header ui-widget-header",rowLevel:"ui-igtreegrid-rowlevel"},options:{indentation:30,initialIndentationLevel:-1,showExpansionIndicator:true,expandTooltipText:$.ig.Grid.locale.expandTooltip,collapseTooltipText:$.ig.Grid.locale.collapseTooltip,foreignKey:null,initialExpandDepth:-1,foreignKeyRootValue:-1,renderExpansionIndicatorColumn:false,renderFirstDataCellFunction:null,childDataKey:"childData",renderExpansionCellFunction:null,enableRemoteLoadOnDemand:false,dataSourceSettings:{propertyExpanded:"__ig_options.expanded",propertyDataLevel:"__ig_options.dataLevel",initialFlatDataView:false}},events:{rowExpanding:"rowExpanding",rowExpanded:"rowExpanded",rowCollapsing:"rowCollapsing",rowCollapsed:"rowCollapsed"},_isHierarchicalDataSource:true,_create:function(){this._checkForUnsoppertedScenarios();var func=this.options.renderFirstDataCellFunction;if(func&&$.type(func)!=="function"){if(window[func]&&typeof window[func]==="function"){func=window[func]}}if(func&&$.type(func)==="function"){this._renderFirstDataCellHandler=func}else{this._renderFirstDataCellHandler=$.proxy(this._renderFirstDataCell,this)}func=this.options.renderExpansionCellFunction;if(func&&$.type(func)!=="function"){if(window[func]&&typeof window[func]==="function"){func=window[func]}}if(func&&$.type(func)==="function"){this._renderExpandCellHandler=func}else{this._renderExpandCellHandler=$.proxy(this._renderExpandCell,this)}this._overrideFunction("bind");this._overrideFunction("unbind");this._overrideFunction("on");this._overrideFunction("off");this._attachEvents();this.element.data($.ui.igGrid.prototype.widgetName,this.element.data($.ui.igTreeGrid.prototype.widgetName));$.ui.igGrid.prototype._create.apply(this,arguments);this.element.attr("role","treegrid")},_checkForUnsoppertedScenarios:function(){if(this._rowVirtualizationEnabled()&&this.options.virtualizationMode==="fixed"){throw new Error($.ig.TreeGrid.locale.fixedVirtualizationNotSupported)}},_wrapElementDiv:function(){$.ui.igGrid.prototype._wrapElementDiv.apply(this,arguments);this.element.data($.ui.igTreeGrid.prototype.widgetName,this);this._overrideFunction("bind");this._overrideFunction("unbind")},_removeOverridenFunction:function(){if(!this._functionsOverriden){return}var f,funcs=this._functionsOverriden;for(f in funcs){if(funcs.hasOwnProperty(f)){this.element[f]=funcs[f]}}delete this._functionsOverriden},_overrideFunction:function(functionName){var e=this.element,func;if($.type(e[functionName])!=="function"){return}if(!this._functionsOverriden){this._functionsOverriden={}}func=e[functionName];if(!this._functionsOverriden[functionName]){this._functionsOverriden[functionName]=func}e[functionName]=function(name,arg1,arg2){var strIgGrid="iggrid",argsLen=arguments.length,evtName,oEvtName;if($.type(name)==="string"&&name.indexOf(strIgGrid)===0&&name.length>strIgGrid.length&&(argsLen===2||argsLen===3)){name="igtreegrid"+name.substr(strIgGrid.length);if(argsLen===2){return func.call(e,name,arg1)}return func.call(e,name,arg1,arg2)}else if($.type(name)==="object"){for(evtName in name){if(name.hasOwnProperty(evtName)){if($.type(evtName)==="string"&&evtName.indexOf(strIgGrid)===0){oEvtName=evtName;evtName="igtreegrid"+evtName.substr(strIgGrid.length);name[evtName]=name[oEvtName]}}}}return func.apply(e,arguments)}},dataBind:function(){if(!this._initialized){this._renderExtraHeaderCellHandler=$.proxy(this._renderExtraHeaderCells,this);this._renderExtraFooterCellHandler=$.proxy(this._renderExtraFooterCells,this);this._headerInitCallbacks.push({type:"TreeGrid",func:this._renderExtraHeaderCellHandler});this._footerInitCallbacks.push({type:"TreeGrid",func:this._renderExtraFooterCellHandler})}$.ui.igGrid.prototype.dataBind.apply(this,arguments)},_generateDataSourceOptions:function(){var o=this.options,ds=o.dataSource,instanceOfDs,tds,opts=$.ui.igGrid.prototype._generateDataSourceOptions.apply(this,arguments);opts.treeDS={childDataKey:o.childDataKey,initialExpandDepth:o.initialExpandDepth,foreignKey:o.foreignKey,key:o.primaryKey,foreignKeyRootValue:o.foreignKeyRootValue};opts.treeDS=$.extend(opts.treeDS,o.dataSourceSettings);opts.treeDS.enableRemoteLoadOnDemand=o.enableRemoteLoadOnDemand;opts.treeDS.dataSourceUrl=o.dataSourceUrl;if(o.dataSourceUrl===null&&typeof ds==="string"){opts.treeDS.dataSourceUrl=ds}instanceOfDs=ds&&typeof ds._xmlToArray==="function"&&typeof ds._encodePkParams==="function";if(instanceOfDs){if(ds._isHierarchicalDataSource!==undefined){ds.settings.treeDS=ds.settings.treeDS||{};ds.settings.treeDS=$.extend(ds.settings.treeDS,opts.treeDS)}else{if($.type(ds.settings.dataSource)==="array"||$.type(ds.settings.dataSource)==="object"){tds=ds.settings.dataSource}else if($.type(ds.settings.dataSource)!=="string"){tds=ds.data()}else{tds=[]}ds.settings.dataSource=null;ds.settings.data=null;if(opts&&opts.dataSource){opts.dataSource=null}opts=$.extend(true,{},ds.settings,opts);opts.dataSource=tds;tds=null;o.dataSource=new $.ig.TreeHierarchicalDataSource(opts)}}else{opts.dataSource=ds}if(o.dataSourceType!==null){opts.type=o.dataSourceType}return opts},_getDataColumns:function(cols){var i,j,res=[],colsLength=cols.length,dCols;for(i=0;i<colsLength;i++){if(cols[i].group!==undefined&&cols[i].group!==null){dCols=this._getDataColumns(this._getDataColumns(cols[i].group));for(j=0;j<dCols.length;j++){res.push(dCols[j])}}else{res.push(cols[i])}}return res},_generateDataSourceSchema:function(){var schema,i,j,rec,prop,cols=this._getDataColumns(this.options.columns),k,c,ds=this.options.dataSource;if(cols.length>0&&!this.options.autoGenerateColumns){schema={};schema.fields=[];j=0;for(i=0;i<cols.length;i++){if(cols[i].unbound===true){continue}schema.fields[j]={};schema.fields[j].name=cols[i].key;schema.fields[j].type=cols[i].dataType;j++}schema.searchField=this.options.responseDataKey}else if(this.options.autoGenerateColumns){schema={};schema.fields=[];if(this.options.dataSource&&this.options.dataSource.length&&this.options.dataSource.length>0&&$.type(this.options.dataSource)==="array"){rec=this.options.dataSource[0];for(prop in rec){if(rec.hasOwnProperty(prop)){for(k=0;k<cols;k++){if(cols[k].key===prop){c=cols[k];break}}if(_aNull(c)){schema.fields.push({name:prop,type:$.ig.getColType(rec[prop])})}else{if(c.unbound===true){continue}schema.fields.push({name:prop,type:c.dataType})}}}}}this._trigger(this.events.schemaGenerated,null,{owner:this,schema:schema,dataSource:ds});return schema},_createDataSource:function(dataOptions){var ds=this.options.dataSource,currentDataSource;if(!ds||typeof ds._xmlToArray!=="function"||typeof ds._encodePkParams!=="function"){currentDataSource=new $.ig.TreeHierarchicalDataSource(dataOptions)}else{currentDataSource=$.ui.igGrid.prototype._createDataSource.apply(this,arguments)}return currentDataSource},_renderRecords:function(start,end){var tbody=this.element.children("tbody"),html,ds,ph,noCancelInternal=true,noCancel=true,tbodytmp,fh=false;noCancelInternal=this._trigger("_rowsRendering",null,{owner:this,tbody:tbody,vrtWnd:{start:start,end:end}});if(noCancelInternal){noCancel=this._trigger(this.events.rowsRendering,null,{owner:this,tbody:tbody,vrtWnd:{start:start,end:end}});if(noCancel){this._indent=parseInt(this.options.indentation,10);if(this._isMultiColumnGrid){this._colspan=this.container().find("#"+this.id()+" colgroup:first>col").length-1}else{if(this.options.showHeader){this._colspan=this.container().find("#"+this.id()+(fh===true?"_headers":"")+" thead>tr:first").children("th:not(.ui-iggrid-expandheadercellgb)").length}else{this._colspan=this.container().find("#"+this.id()+" colgroup:first>col").length-1}}if(_aNull(this._dataBoundDepth)){this._dataBoundDepth=this.dataSource.getDataBoundDepth()}ds=this.dataSource.flatDataView();html=this._renderRecordsByFlatDataView(ds,false,start,end);if(this.options.renderExpansionIndicatorColumn){this._addDataSkipColumn()}if(!this._canreplaceinner||$.ig.util.isWebKit){ph=document.createElement("div");ph.innerHTML="<table><tbody role='rowgroup'>"+html+"</tbody></table>";tbodytmp=ph.firstChild.firstChild;this.element[0].replaceChild(tbodytmp,tbody[0])}else if(this._canreplaceinner){MSApp.execUnsafeLocalFunction(function(){tbody[0].innerHTML=html})}html="";this._buildVirtualDomForContinuousVirtualization();if(!this._initialized){this._bindEvtsToExpIndicators()}this._trigger(this.events.rowsRendered,null,{owner:this,tbody:tbody})}}},_bindEvtsToExpIndicators:function(){var $cont=this.container(),selector;if(!this.options.renderExpansionIndicatorColumn){selector="tbody>tr>td>span[data-expandcell-indicator]"}else{selector="td[data-expand-cell=1]"}$cont.off(".toggleTreegrid");$cont.on({"mouseup.toggleTreegrid":$.proxy(this._onMouseUpExpander,this),"keydown.toggleTreegrid":$.proxy(this._onKeyDownExpander,this),"click.toggleTreegrid":function(e){e.stopPropagation()}},selector)},_stopPropagationgForExpandCellIndicators:function(){var $exp=this.container().find("span[data-expandcell-indicator]");$exp.unbind("click.expanders").bind("click.expanders",function(e){e.stopPropagation()})},_getTotalRowCount:function(){return this._getDataView().length},_getDataView:function(){return this.dataSource.flatDataView()},_renderVirtualRecordsContinuous:function(from){var to,$scrollContainer,scrllToBttm=false,$ae,$cell,$row,rowId,cellInd,$tr;if(_aNull(from)){$.ui.igGrid.prototype._renderVirtualRecordsContinuous.apply(this,arguments)}else{this._totalRowCount=this._getTotalRowCount();if(from>this._totalRowCount){return $.ui.igGrid.prototype._renderVirtualRecordsContinuous.apply(this,arguments)}this._virtualRowCount=this._determineVirtualRowCount();if(this._virtualRowCount>this._totalRowCount){this._virtualRowCount=this._totalRowCount}to=from+parseInt(this._virtualRowCount,0);if(to>this._totalRowCount){to=this._totalRowCount-1;from=to-this._virtualRowCount;scrllToBttm=true;if(from<0){from=0}}$ae=$(document.activeElement);$cell=$ae.closest("td");$row=$ae.closest("tr");cellInd=$cell.index();rowId=$row.attr("id");this._renderRecords(from,to);this._avgRowHeight=this._calculateAvgRowHeight();this._setScrollContainerHeight(this._totalRowCount*this._avgRowHeight);if(scrllToBttm){$scrollContainer=this._scrollContainer();$scrollContainer[0].scrollTop=this._totalRowCount*this._avgRowHeight+1}if(rowId){$tr=$("#"+rowId);if($tr.length){if($ae.is("tr")){$ae=$tr;$tr.focus()}else if($ae.is("td")){$ae=$tr.children("td:nth-child("+(cellInd+1)+")");$ae.focus()}else if($ae.attr("data-expand-button")!==undefined){$ae=$tr.find("[data-expand-button]");$ae.focus()}this._fireInternalEvent("_virtualRecordsRendered",{row:$tr,activeElement:$ae,cellInd:cellInd})}}}},_addDataSkipColumn:function(){if(!this.options.renderExpansionIndicatorColumn){return}var indent=0,indentation=parseInt(this.options.indentation,10),$thDataSkip,$gridColgroup,$headersTbl,$footersTbl,cf;if(this.options.initialIndentationLevel>0){this._dataBoundDepth=this.options.initialIndentationLevel}else{this._dataBoundDepth=this.dataSource.getDataBoundDepth()}if(this._dataBoundDepth>=0){indent+=indentation*this._dataBoundDepth;if(this.options.indentation&&this.options.indentation.indexOf&&this.options.indentation.indexOf("%")>=0){indent=indent+"%"}cf=this.hasFixedColumns()&&this.fixingDirection()==="left";if(cf){$gridColgroup=this.fixedBodyContainer().find("colgroup:first")}else{$gridColgroup=this.element.find("colgroup:first")}this._addColHelper($gridColgroup,indent);if(cf){$headersTbl=this.fixedHeadersTable()}else{$headersTbl=this.headersTable()}if($headersTbl.attr("id")!==this.element.attr("id")){this._addColHelper($headersTbl.find("colgroup:first"),indent)}if(cf){$footersTbl=this.fixedFootersTable()}else{$footersTbl=this.footersTable()}if($footersTbl.attr("id")!==this.element.attr("id")){this._addColHelper($footersTbl.find("colgroup"),indent)}if(!$headersTbl.find("> thead th[data-treegrid-th]").length){if(!$headersTbl.find("> thead th.ui-iggrid-rowselector-header").length){$thDataSkip=$("<th></th>").prependTo($headersTbl.find("> thead tr:nth-child(1)"))}else{$thDataSkip=$("<th></th>").insertAfter($headersTbl.find("> thead th.ui-iggrid-rowselector-header"))}$thDataSkip.addClass(this.css.expandHeaderCell).attr("data-skip",true).attr("data-treegrid-th",true);if(this._isMultiColumnGrid){$thDataSkip.attr("rowspan",this._maxLevel+1)}}}},_addColHelper:function($colgroup,width){var $col=$colgroup.find("col[data-treegrid-col]");if($col.length===0){$col=$("<col />").prependTo($colgroup).attr("data-skip","true").attr("data-treegrid-col","true")}if(width){$col.width(width)}},_renderHeader:function(){$.ui.igGrid.prototype._renderHeader.apply(this,arguments);this.container().addClass(this.css.containerClasses)},_renderRecordsByFlatDataView:function(ds,isFixed,start,end){var i,data,rowData,hasChildren,children,o=this.options,propertyDataLevel=o.dataSourceSettings.propertyDataLevel,propertyExpanded=o.dataSourceSettings.propertyExpanded,childDataKey=o.childDataKey,html="";if(start===undefined){start=0;end=ds.length-1}if(start!==undefined&&end===undefined){end=start;if(end>ds.length-1){end=ds.length-1}start=0}if(start<0){start=0}if(end>ds.length-1){end=ds.length-1}for(i=start;i<=end;i++){data=ds[i];hasChildren=false;children=data[childDataKey];if(children&&($.type(children)==="array"&&(o.enableRemoteLoadOnDemand||children.length>0)||children===true)){hasChildren=true}rowData={dataBoundDepth:data[propertyDataLevel],parentCollapsed:false,hasExpandCell:hasChildren,children:children,expand:data[propertyExpanded]};html+=this._renderRecordInternal(i,data,rowData,isFixed)}return html},_determineVirtualRowCount:function(){var div,rowNumber=10,ds,rows="",html,height,avgRowHeight,displayContainerHeight,rowsPerPage,result;ds=this.dataSource.flatDataView();if(rowNumber>ds.length){rowNumber=ds.length}div=$("<div></div>)").appendTo("body").css({position:"absolute",top:-1800,left:-1800,visibility:"hidden"});rows=this._renderRecordsByFlatDataView(ds,false,0,rowNumber);html='<table class="'+this.css.gridTableClass+'"><tbody role="rowgroup">'+rows+"</tbody></table>";div.html(html);height=div.height();avgRowHeight=height/rowNumber;displayContainerHeight=this._getDisplayContainerHeight();rowsPerPage=displayContainerHeight/avgRowHeight;result=Math.ceil(rowsPerPage*3);div.remove();this._fireInternalEvent("_virtRowCountDetermined",result);return result},_renderRecord:function(data,rowIndex,isFixed){return this._renderRecordInternal(rowIndex,data,{dataBoundDepth:0,parentCollapsed:false},isFixed)},_renderRecordInternal:function(rowIndex,data,rowData,isFixed){var html="",markup,isContainerOnTheLeft,idxStart,key=this.options.primaryKey,dataBoundDepth=rowData.dataBoundDepth,cssClass=this.css.rowLevel+dataBoundDepth,id=$(this.element).attr("id"),owns="";html+="<tr";if(rowIndex%2!==0&&this.options.alternateRowStyles){cssClass+=" "+this.css.recordAltClass}if(this._transformCssCallback){cssClass=this._transformCssCallback(cssClass,data)}html+=' class="'+cssClass+'" data-row-idx="'+rowIndex+'" aria-level="'+dataBoundDepth+'"';if(!_aNull(key)){html+=' data-id="'+this._kval_from_key(key,data)+'" id="'+id+"_"+this._kval_from_key(key,data)+'"'}else if(!_aNull(data.ig_pk)){html+=' data-id="'+data.ig_pk+'" id="'+id+"_"+data.ig_pk+'"'}if(rowData.parentCollapsed&&dataBoundDepth>0){html+=' style="display: none;"'}if(rowData.hasExpandCell){$(rowData.children).each(function(){owns+=id+"_"+this[key]+" "});owns=owns.trimEnd();if(owns!==""){html+=' aria-owns="'+owns}html+='" aria-expanded="'+rowData.expand+'"'}html+=' role="row" tabIndex="'+this.options.tabIndex+'">';isContainerOnTheLeft=this._isDataContainerOnTheLeft(isFixed);if(this._shouldRenderDataSkipColumn(isFixed)){if(this._selection&&this._selection instanceof $.ig.SelectedRowsCollection){html+=this._editCellStyle(this._renderExpandCellHandler(rowData),data,key)}else{html+=this._renderExpandCellHandler(rowData)}}markup=$.ui.igGrid.prototype._renderRecord.call(this,data,rowIndex,isFixed);if(isFixed){markup=markup.replace('<td role="gridcell"></td>',"")}if(isContainerOnTheLeft){html+=this._renderFirstDataCellHandler(markup,rowData)}else{idxStart=markup.indexOf("<td");html+=markup.substring(idxStart)}return html},_shouldRenderDataSkipColumn:function(isFixed){var fdLeft;if(!this.options.renderExpansionIndicatorColumn){return false}if(!this.hasFixedColumns()){return true}fdLeft=this.fixingDirection()==="left";if(!isFixed&&fdLeft&&this._isFixedNonDataColumnsOnly()){return false}return this._isDataContainerOnTheLeft(isFixed)},_renderFirstDataCell:function(markup,rowData){var newTDSmarkup="",idxStart,TDSmarkup,tdContentFirstInd,otherTDSmarkup;idxStart=markup.indexOf("<td");if(idxStart===-1){return""}TDSmarkup=markup.substring(idxStart);tdContentFirstInd=TDSmarkup.indexOf(">",2);otherTDSmarkup=TDSmarkup.substring(tdContentFirstInd+1);newTDSmarkup=TDSmarkup.substring(0,tdContentFirstInd);if(this.options.renderExpansionIndicatorColumn){newTDSmarkup+=' data-cell-shift-container="1">'}else{newTDSmarkup+=' class="'+this.css.expandColumn+'" data-expand-cell="1">'}newTDSmarkup+=this._renderExpandCellContainer(rowData);newTDSmarkup+=otherTDSmarkup;return newTDSmarkup},_renderExpandCellContainer:function(rowData){var span="",margin,dataBoundDepth=rowData.dataBoundDepth;margin=dataBoundDepth>0?parseInt(this.options.indentation,10)*dataBoundDepth:0;if(this.options.renderExpansionIndicatorColumn){span='<span class="'+this.css.dataColumnExpandContainer+'" data-shift-container="1" style="display: inline-block; margin-left:'+margin+'px;"></span>'}else{span=this._renderExpandCellContainerHelper(rowData)}return span},_renderExpandCellContainerHelper:function(rowData){var span="",css,title,margin,dataBoundDepth=rowData.dataBoundDepth,cssEC=this.css.expandContainer,renderExpandButton=rowData.hasExpandCell;if(this.options.renderExpansionIndicatorColumn){cssEC=this.css.expandColumnContainer}margin=dataBoundDepth>0?parseInt(this.options.indentation,10)*dataBoundDepth:0;if($.type(this.options.indentation)==="string"&&this.options.indentation.indexOf("%")>0){margin+="%"}else{margin+="px"}span='<span data-expandcell-indicator="1" class="'+cssEC+'" style="padding-left:'+margin+';">';if(renderExpandButton&&this.options.showExpansionIndicator){if(rowData.expand){css=this.css.expandCellExpanded;title=this.options.collapseTooltipText}else{css=this.css.expandCellCollapsed;title=this.options.expandTooltipText}span+='<span data-expand-button class="'+css+'" title="'+title+'" tabIndex="'+this.options.tabIndex+'"></span>'}span+="</span>";return span},_renderExpandCell:function(rowData){if(!rowData.hasExpandCell){return this._renderDataSkipCell()}var html,css;css=(this.css.expandColumn+" "+this.css.dataSkipCell).trim();html='<td class="'+css+'" data-expand-cell="1" data-skip="true" tabIndex="'+this.options.tabIndex+'">';if(this.options.showExpansionIndicator){html+=this._renderExpandCellContainerHelper(rowData)}return html+"</td>"},_renderDataSkipCell:function(){return'<td class="'+this.css.dataSkipCell+'" data-skip="true" tabIndex="'+this.options.tabIndex+'"></td>'},_rerenderColgroups:function(){$.ui.igGrid.prototype._rerenderColgroups.apply(this,arguments);this._addDataSkipColumn()},_columnsGenerated:function(){var cols=this.options.columns,key,i,sDS=this.options.dataSourceSettings,arrSkipColumns=[this.options.childDataKey,sDS.propertyExpanded,sDS.propertyDataLevel];for(i=0;i<cols.length;i++){key=cols[i].key;if($.inArray(key,arrSkipColumns)!==-1){$.ig.removeFromArray(cols,i);i--}}},_rowVirtualizationEnabled:function(){return this.options.rowVirtualization||this.options.virtualization},_rerenderGridRowsOnToggle:function(){var virtualizationEnabled=this._rowVirtualizationEnabled(),dsSettings=this.dataSource.settings;return dsSettings.paging.enabled&&dsSettings.treeDS.paging.mode!=="rootLevelOnly"||virtualizationEnabled},_onDataRecordToggled:function(rec,expand,res,args){if(!res||!args){return}var flatData,html,level,dataIdx,diff,triggerEvents,$row,callAsync=false,rows,$fRow,$ufRow,$curRow,offsetTop,customCallback,$this=this,fRows,ufRows,eArgs,$scrollContainer,owner=this,id=$(this.element).attr("id"),ariaOwns="";$row=args.row;triggerEvents=args.triggerEvents;customCallback=args.customCallback;rows=this._getRows($row);$fRow=rows.fixedRow;$ufRow=rows.unfixedRow;level=parseInt($row.attr("aria-level"),10);eArgs={owner:this,row:$ufRow,fixedRow:$fRow,dataLevel:level,dataRecord:rec};this._loadingIndicator.hide();if(!this._rerenderGridRowsOnToggle()){if(expand&&!$row.attr("data-populated")){if(rec){this._toggleRowSuccessors($ufRow);$ufRow.add($fRow).attr("data-populated","1");flatData=this.dataSource.getFlatDataForRecord(rec,level+1);$(rec[this.options.childDataKey]).each(function(){ariaOwns+=id+"_"+this[owner.options.primaryKey]+" "});ariaOwns=ariaOwns.trimEnd();if(flatData&&flatData.flatVisibleData){html=this._renderRecordsByFlatDataView(flatData.flatVisibleData,false);ufRows=$(html).insertAfter($ufRow);$ufRow.attr("aria-owns",ariaOwns);if($fRow){html=this._renderRecordsByFlatDataView(flatData.flatVisibleData,true);fRows=$(html).insertAfter($fRow);$fRow.attr("aria-owns",ariaOwns)}this._trigger("_buildDOMOnToggle",this,{fRows:fRows,ufRows:ufRows})}}}else{this._toggleRowSuccessors($row)}}else{if(this._rowVirtualizationEnabled()&&this.options.virtualizationMode==="continuous"){if($row.length){dataIdx=$row.closest("tbody").children("tr[data-row-idx]:first").attr("data-row-idx");offsetTop=$row.offset().top;this._renderVirtualRecordsContinuous(parseInt(dataIdx,10));this._trigger("virtualrecordsrender",null,{owner:this,dom:this._virtualDom});if(!expand){$curRow=$("#"+this.id()+" > tbody > tr[data-row-idx="+$row.attr("data-row-idx")+"]");diff=$curRow.offset().top-offsetTop;if(Math.abs(diff)>1){$scrollContainer=this._scrollContainer();callAsync=true;setTimeout(function(){$scrollContainer[0].scrollTop=$scrollContainer.scrollTop()+diff},50)}}}else{callAsync=true;this._updateVirtualScrollContainer()}}}if(callAsync){setTimeout(function(){$this._callDataToggledEventsAndCallbacks(customCallback,expand,eArgs,triggerEvents)},55)}else{this._callDataToggledEventsAndCallbacks(customCallback,expand,eArgs,triggerEvents)}},_callDataToggledEventsAndCallbacks:function(customCallback,expand,eArgs,triggerEvents){var hasHeight=this.options.height&&parseInt(this.options.height,10)>0,isVirt=this.options.virtualization===true||this.options.columnVirtualization===true||this.options.rowVirtualization===true;if(customCallback){$.ig.util.invokeCallback(customCallback,[this,{unfixedRow:eArgs.row,fixedRow:eArgs.fixedRow},eArgs.dataRecord,expand])}if(hasHeight&&!isVirt&&this._hasVerticalScrollbar!==this.hasVerticalScrollbar()){this._adjustLastColumnWidth()}if(expand){this._fireInternalEvent("_rowExpanded",eArgs)}else{this._fireInternalEvent("_rowCollapsed",eArgs)}if(triggerEvents){if(expand){this._trigger(this.events.rowExpanded,null,eArgs)}else{this._trigger(this.events.rowCollapsed,null,eArgs)}}},toggleRow:function(row,callback){var $row,state,expand,ds=this.dataSource;if(row instanceof jQuery){$row=row}else{$row=this.element.find("tr[data-id="+row+"]")}state=$row.attr("aria-expanded");if(!$row.length){expand=!ds.getExpandStateById(row)}else{expand=state==="false"}this._expandCollapseRow(row,expand,false,callback)},expandRow:function(row,callback){this._expandCollapseRow(row,true,false,callback)},collapseRow:function(row,callback){this._expandCollapseRow(row,false,false,callback)},_onMouseUpExpander:function(event){this._toggleRow($(event.target).closest("tr"))},_onKeyDownExpander:function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){this._toggleRow($(event.target).closest("tr"));event.preventDefault();event.stopPropagation()}},_toggleRow:function($row){if(!$row.length){return}var state=$row.attr("aria-expanded"),expand;if(state===undefined){return}expand=state==="false"||state==="0";this._expandCollapseRow($row,expand,true)},_expandCollapseRow:function(row,expand,triggerEvents,callback){var primaryKeyCol,noCancel=true,func,args,callbackArgs,rowId,$row,me=this,rows,$fRow,$ufRow,isExpanded=expand,$ae,$cell,$tr,cellInd;if(row instanceof jQuery){$row=row;if(!_aNull(this.options.primaryKey)){primaryKeyCol=this.columnByKey(this.options.primaryKey);rowId=$row.attr("data-id");if(primaryKeyCol&&(primaryKeyCol.dataType==="number"||primaryKeyCol.dataType==="numeric")){rowId=parseInt(rowId,10)}}else{rowId=$row.index()}}else{rowId=row;$row=this.element.find("tr[data-id="+row+"]")}if($row.length===1&&$row.attr("aria-expanded")===isExpanded.toString()){return}func=$.proxy(this._onDataRecordToggled,this);callbackArgs={callback:func,args:{row:$row,triggerEvents:triggerEvents}};if(callback){callbackArgs.args.customCallback=callback}rows=this._getRows($row);$fRow=rows.fixedRow;$ufRow=rows.unfixedRow;args={owner:this,row:$ufRow,fixedRow:$fRow,dataLevel:parseInt($row.attr("aria-level"),10)};if(triggerEvents){if(expand){noCancel=this._trigger(this.events.rowExpanding,null,args)}else{noCancel=this._trigger(this.events.rowCollapsing,null,args)}}if(noCancel){this._loadingIndicator.show();setTimeout(function(){$ae=$(document.activeElement);$cell=$ae.closest("td");cellInd=$cell.index();me.dataSource.setExpandedStateByPrimaryKey(rowId,expand,callbackArgs);if(me._rerenderGridRowsOnToggle()){$tr=$('[data-id="'+rowId+'"]');if($tr.length){if($ae.is("tr")){$ae=$tr;$tr.focus()}if($ae.is("td")){$ae=$tr.children("td:nth-child("+(cellInd+1)+")");$ae.focus()}else if($ae.attr("data-expand-button")!==undefined){$ae=$tr.find("[data-expand-button]");$ae.focus()}}}},0)}},_toggleRowSuccessors:function($row){var $nextRow=$row,foundUpperLevel=false,dL,$fRow,$ufRow=$row,levelCollapsed=null,$container,dataBoundDepth=parseInt($row.attr("aria-level"),10),isExpanded=$row.attr("aria-expanded"),styleDisplay="",expanded=isExpanded==="true";if(expanded){styleDisplay="none"}if(this.hasFixedColumns()){if(this._isFixedElement($row)){$fRow=$row;if(this._rowVirtualizationEnabled()){$container=this._vdisplaycontainer()}else{$container=this.scrollContainer()}$ufRow=$container.find("tbody > tr").eq($row.index())}else{$fRow=this.fixedBodyContainer().find("tbody > tr").eq($row.index())}}while($nextRow.length===1&&!foundUpperLevel){$nextRow=$nextRow.next("tr[aria-level]");dL=parseInt($nextRow.attr("aria-level"),10);if(isNaN(dL)||dL<=dataBoundDepth){foundUpperLevel=true;break}if(!expanded){if(levelCollapsed!==null){if(dL<=levelCollapsed){levelCollapsed=null}else{continue}}if($nextRow.attr("aria-expanded")==="false"){levelCollapsed=dL}}this._showHideRow($nextRow,styleDisplay)}if(expanded){$ufRow.add($fRow).attr("data-populated","1").attr("aria-expanded",false).find("[data-expand-button]").attr("title",this.options.expandTooltipText).removeClass(this.css.expandCellExpanded).addClass(this.css.expandCellCollapsed)}else{$ufRow.add($fRow).attr("aria-expanded",true).find("[data-expand-button]").attr("title",this.options.collapseTooltipText).removeClass(this.css.expandCellCollapsed).addClass(this.css.expandCellExpanded)}},_showHideRow:function($row,styleDisplay){var rows,$ufRow=$row,$fRow,fixedColumns=this.hasFixedColumns();if(fixedColumns){rows=this._getRows($row);$fRow=rows.fixedRow;$ufRow=rows.unfixedRow}$ufRow.css("display",styleDisplay);if($fRow){$fRow.css("display",styleDisplay)}if(styleDisplay===""){this._trigger("_rowShown",this,{fRow:$fRow,ufRow:$ufRow})}else{this._trigger("_rowHidden",this,{fRow:$fRow,ufRow:$ufRow})}},_renderExtraHeaderCells:function(row,colgroup,prepend){if(!this.options.renderExpansionIndicatorColumn){return}if(prepend===true){$("<td></td>").prependTo(row).css("border-width",0).attr("data-skip",true);if(colgroup){$("<col />").prependTo(colgroup).attr("data-skip",true).css("width",this.options.indentation)}}else{$("<td></td>").appendTo(row).css("border-width",0).attr("data-skip",true);if(colgroup){$("<col />").appendTo(colgroup).attr("data-skip",true).css("width",this.options.indentation)}}},_isFixedNonDataColumnsOnly:function(){if(this.hasFixedColumns()&&(!this._fixedColumns||!this._fixedColumns.length)){return true}return false},_isDataContainerOnTheLeft:function(isFixed){var fdLeft=this.fixingDirection()==="left";if(!this.hasFixedColumns()){return true}if($.type(this._fixedColumns)==="array"&&!this._fixedColumns.length){return true}if(isFixed){return fdLeft}return!fdLeft},_getRows:function($row){var index,$fRow,$ufRow=$row;if(this.hasFixedColumns()){index=$row.index();if(this._isFixedElement($row)){$fRow=$row;$ufRow=$(this.rowAt(index))}else{$fRow=$(this.fixedRowAt(index))}}return{fixedRow:$fRow,unfixedRow:$ufRow}},_renderRow:function(rec,tr){var funcCallbak;funcCallbak=function(rec,tr){return $.ui.igGrid.prototype._renderRow.call(this,rec,tr)};return this._persistExpansionIndicator(rec,tr,funcCallbak,this)},_persistExpansionIndicator:function(rec,tr,funcCallback,funcCallee){var $td,trRes=tr,$tr=$(tr),$span,renderEC=this.options.renderExpansionIndicatorColumn;if(renderEC){$span=$tr.find("span[data-shift-container]");$td=$span.closest("td")}else{$span=$tr.find("[data-expandcell-indicator]");$td=$span.closest("td");$span.detach()}if(funcCallback&&funcCallee){trRes=funcCallback.call(funcCallee,rec,tr);$tr=$(trRes)}if($span.length>0){$span.prependTo($td)}return trRes},_detachEvents:function(){if(this._columnsGeneratedHandler){this.element.unbind("igtreegrid_columnsgenerated",this._columnsGeneratedHandler)}},_attachEvents:function(){this._columnsGeneratedHandler=$.proxy(this._columnsGenerated,this);this.element.bind("igtreegrid_columnsgenerated",this._columnsGeneratedHandler)},_initFeature:function(featureObject){if(!featureObject){return}if(featureObject.name===undefined){return}var widgetTreeGrid="igTreeGrid"+featureObject.name;if($.type(this.element[widgetTreeGrid])==="function"){if(this.element.data(widgetTreeGrid)){this.element[widgetTreeGrid]("destroy")}this.element[widgetTreeGrid](featureObject);this.element.data(widgetTreeGrid)._injectGrid(this)}else{return $.ui.igGrid.prototype._initFeature.apply(this,arguments)}},_destroyFeatures:function(){var i,features=this.options.features,e=this.element;for(i=0;i<features.length;i++){if(e.data("igTreeGrid"+features[i].name)){e["igTreeGrid"+features[i].name]("destroy")}else if(e.data("igGrid"+features[i].name)){e["igGrid"+features[i].name]("destroy")}}},destroy:function(){this._detachEvents();$.ui.igGrid.prototype.destroy.apply(this,arguments);this.element.removeData($.ui.igGrid.prototype.widgetName);this._removeOverridenFunction();return this}});$.extend($.ui.igTreeGrid,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Tree Grid 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.shared.js
 *	infragistics.ui.treegrid.js
 *	infragistics.util.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.grid.columnfixing.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igTreeGridColumnFixing",$.ui.igGridColumnFixing,{_create:function(){this.element.data($.ui.igGridColumnFixing.prototype.widgetName,this.element.data($.ui.igTreeGridColumnFixing.prototype.widgetName));$.ui.igGridColumnFixing.prototype._create.apply(this,arguments)},_renderFixedRecords:function($table,start,end,onlyRows,$trsUnfixed){if(onlyRows===true){$.ui.igGridColumnFixing.prototype._renderFixedRecords.apply(this,arguments);return}var ds,d="",grid=this.grid;ds=grid.dataSource.flatDataView();d=grid._renderRecordsByFlatDataView(ds,true,start,end);$table.find("tbody").html(d)},_syncHeigthsOnToggle:function(){if(!this.grid.hasFixedColumns()){return}this._syncHScrollbarHeight();this._syncContainersHeights();if($.ig.util.isIE&&$.ig.util.browserVersion>=9){this._syncTableHeights()}},_rowExpanded:function(){this._syncHeigthsOnToggle()},_rowCollapsed:function(){this._syncHeigthsOnToggle()},_renderFixedRecord:function(data,rowIndex,onlyRows,tr){if(onlyRows){return $.ui.igGridColumnFixing.prototype._renderFixedRecord.apply(this,arguments)}return this.grid._renderRecord(data,rowIndex,true)},_rowShown:function(e,args){if(!this.options.syncRowHeights){return}var fRow=args.fRow,ufRow=args.ufRow;if(this.grid.hasFixedColumns()){this.syncRowsHeights(fRow,ufRow)}},_syncContainersHeights:function(){if(!this.grid.hasFixedColumns()){return}var grid=this.grid,id=grid.id(),scrollContainer;$("#"+id+"_fixedBodyContainer").find("table")[0].style.height="";if(grid._rowVirtualizationEnabled()){scrollContainer=grid._vdisplaycontainer()}else{scrollContainer=grid.scrollContainer()}if(scrollContainer.length===0){scrollContainer=grid.element}scrollContainer.find("table")[0].style.height=""},_renderRow:function(rec,tr,rowId){if(!this.grid.hasFixedColumns()){return $.ui.igGridColumnFixing.prototype._renderRow.apply(this,arguments)}var rows,$fRow,$ufRow,$tr=$(tr),col,funcCallback;rows=this.grid._getRows($tr);$fRow=rows.fixedRow;$ufRow=rows.unfixedRow;funcCallback=function(rec,tr){return this._updateRowContent(rec,tr)};this.grid._persistExpansionIndicator(rec,$fRow[0],funcCallback,this);this.grid._persistExpansionIndicator(rec,$ufRow[0],funcCallback,this)},_buildDOMOnToggle:function(e,args){if(!this.grid.hasFixedColumns()||!this.options.syncRowHeights){return}var $fRows=args.fRows,me=this,$ufRows=args.ufRows;if(!$fRows||!$ufRows||$fRows.length!==$ufRows.length){return}$fRows.each(function(ind){var $fRow=$($fRows[ind]),$ufRow=$($ufRows[ind]);me.syncRowsHeights($fRow,$ufRow)});this._syncHeigthsOnToggle()},_updateRowContent:function(rec,tr){var $this=this,grid=this.grid,$tr=$(tr),cells=$tr.children(":visible:not([data-skip])");cells.each(function(ind){var $td=$(this),content,col=grid._getColumnByTD($td);if(!col){return true}col=col.column;if(col.template&&col.template.length){content=grid._renderTemplatedCell(rec,col);if(content.indexOf("<td")===0){$td.html($(content).html())}else{$td.html(content)}}else{$td.html(String(grid._renderCell(rec[col.key],col,rec)))}});return tr},_onColumnFixed:function(isFixed,args){this._onColumnFixedUnfixed(true,args)},_onColumnUnfixed:function(isFixed,args){this._onColumnFixedUnfixed(false,args)},_onColumnFixedUnfixed:function(isFixed,args){if(args.columnIdentifier===undefined){return}var $td,$span,rerender=false,$container,hasVirtualization=this._isContinuousVirtualization();if(this.options.fixingDirection==="left"){$container=this.grid.fixedBodyContainer();if(!$container.length||!this.grid._fixedColumns||!this.grid._fixedColumns.length){$container=this.grid.element}}else{$container=this.grid.element}$td=$container.find("tbody>tr:first>td:not([data-skip])").eq(0);$span=$td.find("[data-shift-container],[data-expand-cell]");if($span.length===1){return}if(hasVirtualization){this.grid._renderVirtualRecords()}else{this.grid._renderRecords();this.grid._fireInternalEvent("_dataRendered")}},_detachEvents:function(){$.ui.igGridColumnFixing.prototype._detachEvents.apply(this,arguments);if(this._rowShownHandler){this.grid.element.unbind("igtreegrid_rowshown",this._rowShownHandler)}if(this._onColumnFixedHandler){this.grid.element.unbind("igtreegridcolumnfixing_columnfixed",this._onColumnFixedHandler)}if(this._onColumnUnfixedHandler){this.grid.element.unbind("igtreegridcolumnfixing_columnunfixed",this._onColumnUnfixedHandler)}if(this._buildDOMOnToggleHandler){this.grid.element.unbind("igtreegrid_builddomontoggle",this._buildDOMOnToggleHandler)}},_attachEvents:function(){this._rowShownHandler=$.proxy(this._rowShown,this);this.grid.element.bind("igtreegrid_rowshown",this._rowShownHandler);this._onColumnFixedHandler=$.proxy(this._onColumnFixed,this);this._onColumnUnfixedHandler=$.proxy(this._onColumnUnfixed,this);this.grid.element.bind("igtreegridcolumnfixing_columnfixed",this._onColumnFixedHandler);this.grid.element.bind("igtreegridcolumnfixing_columnunfixed",this._onColumnUnfixedHandler);this._buildDOMOnToggleHandler=$.proxy(this._buildDOMOnToggle,this);this.grid.element.bind("igtreegrid_builddomontoggle",this._buildDOMOnToggleHandler)},destroy:function(){$.ui.igGridColumnFixing.prototype.destroy.apply(this,arguments);this.element.removeData($.ui.igGridColumnFixing.prototype.widgetName)},_injectGrid:function(grid,isRebind){$.ui.igGridColumnFixing.prototype._injectGrid.apply(this,arguments);this._attachEvents()}});$.extend($.ui.igTreeGridColumnFixing,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Tree Grid 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.shared.js
 *	infragistics.ui.treegrid.js
 *	infragistics.util.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.grid.filtering.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){var _aNull=function(val){return val===null||val===undefined};$.widget("ui.igTreeGridFiltering",$.ui.igGridFiltering,{css:{recordMatchFiltering:"ig-igtreegrid-filter-matching-row",cellMatchFiltering:"ig-igtreegrid-filter-matching-cell",recordNotMatchFiltering:"ui-igtreegrid-record-not-matchfiltering"},options:{recordCountKey:null,fromLevel:0,toLevel:-1,displayMode:"showWithAncestors",matchFiltering:"__matchFiltering",filterSummaryInPagerTemplate:$.ig.TreeGridFiltering.locale.filterSummaryInPagerTemplate},_create:function(){this.element.data($.ui.igGridFiltering.prototype.widgetName,this.element.data($.ui.igTreeGridFiltering.prototype.widgetName));$.ui.igGridFiltering.prototype._create.apply(this,arguments)},_getFilterSummaryPagerTemplate:function(){var template=this.options.filterSummaryInPagerTemplate,matchesCount,countMatchesPerPage=0;if(!template){return null}if(template.indexOf("${currentPageMatches}")>-1){countMatchesPerPage=this.grid.dataSource.getFilteredRecordsCountFromDataView();template=template.replace("${currentPageMatches}",countMatchesPerPage)}if(template.indexOf("${totalMatches}")>-1){matchesCount=this.getFilteringMatchesCount();template=template.replace("${totalMatches}",matchesCount)}return template},_transformCss:function(cssClass,dataRow){var matchFiltering,grid=this.grid,ds=grid.dataSource;if(this._gridTransformCssCallback){cssClass=this._gridTransformCssCallback.apply(grid,arguments)}if(this._filteringApplied()){matchFiltering=ds.settings.treeDS.filtering.matchFiltering;if(cssClass!==""){cssClass+=" "}if(!_aNull(matchFiltering)){if(dataRow[matchFiltering]){cssClass+=this.css.recordMatchFiltering}else{cssClass+=this.css.recordNotMatchFiltering}}}return cssClass},_filteringApplied:function(){var ds=this.grid.dataSource,expr=ds.settings.filtering.expressions;if(this.options.type==="local"){return ds._filter}return expr&&expr.length},getFilteringMatchesCount:function(){var o=this.options,ds=this.grid.dataSource,matches;if(o.type==="local"||o.type==="remote"&&ds.hasTotalRecordsCount()===false){if(ds._filter){matches=ds.getFilteredRecordsCount()}else{matches=ds.flatDataView().length}}else{matches=ds.getFilteringMatchRecordsCount()}return matches},destroy:function(){$.ui.igGridFiltering.prototype.destroy.apply(this,arguments);this.element.removeData($.ui.igGridFiltering.prototype.widgetName)},_injectGrid:function(gridInstance,isRebind){var ds,o=this.options;$.ui.igGridFiltering.prototype._injectGrid.apply(this,arguments);if(!isRebind){if(this.grid._transformCssCallback){this._gridTransformCssCallback=this.grid._transformCssCallback}this.grid._transformCssCallback=$.proxy(this._transformCss,this)}ds=this.grid.dataSource;if(ds&&ds.settings&&ds.settings.treeDS){ds.settings.filtering.enabled=true;ds.settings.treeDS.filtering.fromLevel=o.fromLevel;ds.settings.treeDS.filtering.toLevel=o.toLevel;ds.settings.treeDS.filtering.displayMode=o.displayMode;ds.settings.treeDS.filtering.matchFiltering=o.matchFiltering}if(o.recordCountKey!==null){ds.settings.responseTotalRecCountKey=o.recordCountKey}}});$.extend($.ui.igTreeGridFiltering,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Tree Grid 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.shared.js
 *	infragistics.ui.treegrid.js
 *	infragistics.util.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.grid.hiding.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igTreeGridHiding",$.ui.igGridHiding,{css:{},options:{},_create:function(){this.element.data($.ui.igGridHiding.prototype.widgetName,this.element.data($.ui.igTreeGridHiding.prototype.widgetName));$.ui.igGridHiding.prototype._create.apply(this,arguments)},destroy:function(){$.ui.igGridHiding.prototype.destroy.apply(this,arguments);this.element.removeData($.ui.igGridHiding.prototype.widgetName)},_injectGrid:function(){$.ui.igGridHiding.prototype._injectGrid.apply(this,arguments)}});$.extend($.ui.igTreeGridHiding,{version:"15.2.20152.1027"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Tree Grid 15.2.20152.1027
*
* Copyright (c) 2011-2015 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
*	jquery-1.4.4.js
*	jquery.ui.core.js
*	jquery.ui.widget.js
*	infragistics.dataSource.js
*	infragistics.ui.shared.js
*	infragistics.ui.treegrid.js
*	infragistics.util.js
*	infragistics.ui.grid.framework.js
*	infragistics.ui.grid.multicolumnheaders.js
*/
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igTreeGridMultiColumnHeaders",$.ui.igGridMultiColumnHeaders,{css:{},options:{},_create:function(){this.element.data($.ui.igGridMultiColumnHeaders.prototype.widgetName,this.element.data($.ui.igTreeGridMultiColumnHeaders.prototype.widgetName));$.ui.igGridMultiColumnHeaders.prototype._create.apply(this,arguments)},destroy:function(){$.ui.igGridMultiColumnHeaders.prototype.destroy.apply(this,arguments);this.element.removeData($.ui.igGridMultiColumnHeaders.prototype.widgetName)},_injectGrid:function(){$.ui.igGridMultiColumnHeaders.prototype._injectGrid.apply(this,arguments)}});$.extend($.ui.igTreeGridMultiColumnHeaders,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Tree Grid 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.shared.js
 *	infragistics.ui.treegrid.js
 *	infragistics.util.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.grid.paging.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igTreeGridPaging",$.ui.igGridPaging,{css:{contextRow:"ui-igtreegrid-contextrow",contextRowIcon:"ui-igtreegrid-contextrow-icon ui-icon ui-icon-bookmark",contextRowContent:"ui-igtreegrid-contextrow-content",contextRowTextContainer:"ui-igtreegrid-contextrow-container"},rowsToShowLoadingMessage:3e5,events:{contextRowRendering:"contextRowRendering",contextRowRendered:"contextRowRendered"},options:{mode:"rootLevelOnly",contextRowMode:"none",contextRowLoadingText:$.ig.TreeGridPaging.locale.contextRowLoadingText,contextRowRootText:$.ig.TreeGridPaging.locale.contextRowRootText,breadcrumbKey:null,breadcrumbDelimiter:" &gt; ",renderContextRowFunc:null},_create:function(){this.element.data($.ui.igGridPaging.prototype.widgetName,this.element.data($.ui.igTreeGridPaging.prototype.widgetName));$.ui.igGridPaging.prototype._create.apply(this,arguments)},_getDSLocalRecordsCount:function(){if(this.grid.dataSource._filter&&this.options.mode==="allLevels"){return this.grid.dataSource.totalLocalRecordsCount()}return $.ui.igGridPaging.prototype._getDSLocalRecordsCount.apply(this,arguments)},destroy:function(){$.ui.igGridPaging.prototype.destroy.apply(this,arguments);this.element.removeData($.ui.igGridPaging.prototype.widgetName)},_dataRendered:function(){var $tr;$.ui.igGridPaging.prototype._dataRendered.apply(this,arguments);switch(this.options.contextRowMode){case"breadcrumb":case"parent":this._renderContextRow(this.options.contextRowMode);break;default:$tr=this.getContextRow();if($tr.length){$tr.remove();this.grid._initializeHeights()}break}},_renderContextRow:function(mode){var grid=this.grid,dv=grid.dataSource.flatDataView(),dataRow,noCancel,eArgs,self=this;if(dv&&dv[0]){dataRow=dv[0]}eArgs={owner:this,dataRow:dataRow,currentPageIndex:this.options.currentPageIndex,contextRowMode:mode};noCancel=this._trigger(this.events.contextRowRendering,null,eArgs);if(noCancel){this._renderLoading(dataRow);setTimeout(function(){if(mode==="breadcrumb"){self._renderBreadcrumb(dataRow)}else if(mode==="parent"){self._renderParentRow(dataRow)}},10)}},getContextRow:function(){var $thead=this.grid.headersTable().children("thead"),$row=this.grid.headersTable().find(">thead>tr[data-treegrid-contextrow]");if($row.length){return $row}$row=$('<tr data-treegrid-contextrow="true" data-skip="true"></tr>').appendTo($thead);$row.addClass(this.css.contextRow);return $row},getContextRowTextArea:function(){var $thead=this.grid.headersTable().children("thead"),$tr,$td,$container,$colspan,colspan=0;$container=$thead.find("[data-treegrid-contextrow-content]");if($container.length){return $container}$tr=this.getContextRow();$tr.empty();$colspan=$thead.closest("table").children("colgroup");$colspan.find("col").each(function(){var $col=$(this),cs;cs=parseInt($col.attr("colspan"),10);if(isNaN(cs)){cs=1}colspan+=cs});$td=$("<td></td>").attr("colspan",colspan).appendTo($tr);$container=$('<div class="'+this.css.contextRowTextContainer+'" data-treegrid-contextrow-container="1">'+'<span class="'+this.css.contextRowIcon+'"></span>'+'<span class="'+this.css.contextRowContent+'" data-treegrid-contextrow-content></span>'+"</div>").appendTo($td);return this.getContextRowTextArea()},_callRenderContextRowFunc:function(dataRow,$textArea,parents,mode){var func=this.options.renderContextRowFunc,f;if($.type(func)==="function"){f=func}else if(window[func]&&typeof window[func]==="function"){f=window[func]}if(f){return f(dataRow,$textArea,parents,mode)}},_renderLoading:function(dataRow){var self=this,$textArea,o=this.options,grid=this.grid,html;if(o.renderContextRowFunc){$textArea=self.getContextRowTextArea();html=self._callRenderContextRowFunc(dataRow,$textArea,null,"loading");if(!html){return}}if(grid.dataSource._flatVisibleData&&grid.dataSource._flatVisibleData.length>=this.rowsToShowLoadingMessage){if(!html){if(!$textArea){$textArea=self.getContextRowTextArea()}$textArea.html(o.contextRowLoadingText)}self.grid._initializeHeights()}},_renderRootRecord:function(){this.getContextRowTextArea().html(this.options.contextRowRootText)},_renderBreadcrumb:function(dataRow){var i,$text,ds=this.grid.dataSource,parents,parentsLen,row,o=this.options,eArgs,breadcrumbKey=o.breadcrumbKey,html="";parents=ds.getParentRowsForRow(dataRow);$text=this.getContextRowTextArea();if(o.renderContextRowFunc){html=this._callRenderContextRowFunc(dataRow,$text,parents,"breadcrumb");if(!html){return}}if(html){$text.html(html)}else{if($.type(parents)==="array"){parentsLen=parents.length;if(breadcrumbKey===null||breadcrumbKey===undefined){breadcrumbKey=this.grid.options.primaryKey}if(parentsLen<=1){this._renderRootRecord()}else{for(i=0;i<parentsLen;i++){row=parents[i].row;if(row[breadcrumbKey]===undefined){continue}if(i){html+=o.breadcrumbDelimiter}html+=row[breadcrumbKey]}$text.html(html)}}else{this._renderRootRecord()}}eArgs={owner:this,dataRow:dataRow,currentPageIndex:this.options.currentPageIndex,parentRows:parents,contextRowMode:"breadcrumb"};this.grid._initializeHeights();this._trigger(this.events.contextRowRendered,null,eArgs)},_renderParentRow:function(dataRow){var parentsLen,$span,eArgs,html,parents,lastRec,$tr=this.getContextRow(),ds=this.grid.dataSource,o=this.options;parents=ds.getParentRowsForRow(dataRow);if(o.renderContextRowFunc){html=this._callRenderContextRowFunc(dataRow,$tr,parents,"parent");if(!html){return}}if(html){$tr.html(html)}else{if($.type(parents)==="array"||!parents.length){parentsLen=parents.length;if(parentsLen===1){this._renderRootRecord()}else{lastRec=parents[parentsLen-2];if(lastRec&&lastRec.row){html=this.grid._renderRecord(lastRec.row);html=html.substr(html.indexOf(">")+1);html=html.substr(0,html.lastIndexOf("</tr"));$tr.html(html);$span=$tr.find("[data-expandcell-indicator],[data-shift-container]");if($span.length){$span.attr("class",this.css.contextRowIcon)}}}}else{this._renderRootRecord()}}eArgs={owner:this,dataRow:dataRow,currentPageIndex:this.options.currentPageIndex,parentRows:parents,contextRowMode:"parent"};this.grid._initializeHeights();this._trigger(this.events.contextRowRendered,null,eArgs)},_injectGrid:function(){var ds,i;$.ui.igGridPaging.prototype._injectGrid.apply(this,arguments);ds=this.grid.dataSource;if(ds&&ds.settings&&ds.settings.treeDS){ds.settings.treeDS.paging.mode=this.options.mode;ds.settings.treeDS.paging.contextRowMode=this.options.contextRowMode;if(this.options.type==="remote"&&this.options.mode==="allLevels"){ds.settings.treeDS.persistExpansionStates=true}}if(this.options.contextRowMode!=="none"){for(i=0;i<this.grid.options.features.length;i++){if(this.grid.options.features[i].name==="ColumnFixing"){throw new Error($.ig.TreeGridPaging.locale.columnFixingWithContextRowNotSupported)}}}}});$.extend($.ui.igTreeGridPaging,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Tree Grid 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.shared.js
 *	infragistics.ui.treegrid.js
 *	infragistics.util.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.grid.selection.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igTreeGridSelection",$.ui.igGridSelection,{css:{},options:{},_create:function(){this.element.data($.ui.igGridSelection.prototype.widgetName,this.element.data($.ui.igTreeGridSelection.prototype.widgetName));$.ui.igGridSelection.prototype._create.apply(this,arguments)},_getDataView:function(){return this.grid.dataSource.flatDataView()},destroy:function(){$.ui.igGridSelection.prototype.destroy.apply(this,arguments);this.element.removeData($.ui.igGridSelection.prototype.widgetName)},_keyDown:function(event){var target;if(this.options.mode==="row"){if(this._keyDownRowMode(event)){return}}else if(this.options.mode==="cell"){if(this._keyDownCellMode(event)){return}}target=event&&event.target?$(event.target):null;if(!target.is("[data-expand-button]")){$.ui.igGridSelection.prototype._keyDown.apply(this,arguments)}},_keyDownRowMode:function(event){var tr=$(event.target),keyCode=event.keyCode,state;if(keyCode===$.ui.keyCode.LEFT||keyCode===$.ui.keyCode.RIGHT){if(!tr.is("tr")){return}state=tr.attr("aria-expanded");if(state==="undefined"||state===undefined){return}this.grid._expandCollapseRow(tr,keyCode===$.ui.keyCode.RIGHT,true);return true}else if(keyCode===$.ui.keyCode.HOME){if(this._navigateRow(event,"top")){event.preventDefault();return true}}else if(keyCode===$.ui.keyCode.END){if(this._navigateRow(event,"bottom")){event.preventDefault();return true}}if(tr.is("td.ui-igtreegrid-non-data-column")&&(keyCode===$.ui.keyCode.SPACE||keyCode===$.ui.keyCode.ENTER)){return true}},_keyDownCellMode:function(event){var keyCode=event.keyCode,updating;if(keyCode===$.ui.keyCode.ENTER){updating=this.grid.element.data("igGridUpdating");if(!updating&&this._expandCollapseRowByCell()){event.preventDefault();event.stopPropagation();return true}}else if(event.altKey&&(keyCode===$.ui.keyCode.UP||keyCode===$.ui.keyCode.DOWN)){if(this._expandCollapseRowByCell(null,keyCode===$.ui.keyCode.DOWN)){event.preventDefault();return true}}else if(keyCode===$.ui.keyCode.HOME){if(event.ctrlKey){if(this._navigateCell(event,"topLeft")){event.preventDefault();return true}}if(this._navigateCell(event,"left")){event.preventDefault();return true}}else if(keyCode===$.ui.keyCode.END){if(event.ctrlKey){if(this._navigateCell(event,"bottomRight")){event.preventDefault();return true}}if(this._navigateCell(event,"right")){event.preventDefault();return true}}else if(keyCode===$.ui.keyCode.SPACE&&this.grid.options.renderExpansionIndicatorColumn){if(this._expandCollapseRowByCell()){event.preventDefault();event.stopPropagation();return true}}},_navigateCell:function(event,dir){var $cell=this._getActiveCell(),funcNav,$nextActiveCell,self=this,$tr;if(!$cell||!$cell.length){return}$tr=$cell.closest("tr");if(dir==="left"){$nextActiveCell=$tr.children("td:not([data-skip]):visible").first()}else if(dir==="right"){$nextActiveCell=$tr.children("td:not([data-skip]):visible").last()}if($nextActiveCell){this._storedActiveIndex=null;this._navigateOwn($nextActiveCell,this._selection.activeElement,event.keyCode,false,event.shiftKey);return true}funcNav=function($tbody,e){var $tr,$nextEl;if(e.ctrlKey){this.clearSelection()}if(dir==="topLeft"){$tr=$tbody.children("tr:visible:not([data-skip])").first();$nextEl=$tr.children("td:visible:not([data-skip])").first()}else{$tr=$tbody.children("tr:visible:not([data-skip])").last();$nextEl=$tr.children("td:visible:not([data-skip])").last()}self._storedActiveIndex=null;self._navigateOwn($nextEl,this._selection.activeElement,e.keyCode,false,e.shiftKey)};return this._navigateTo(event,dir,funcNav)},_navigateRow:function(event,dir){var funcNav=function($tbody,ev,direction){var $nextEl,prevActiveElement=this._selection.activeElement;if(direction==="top"){$nextEl=$tbody.children("tr:visible:not([data-skip])").first()}else{$nextEl=$tbody.children("tr:visible:not([data-skip])").last()}if(ev.shiftKey&&this.options.multipleSelection){this._shiftSelectChange($nextEl)}else{this._navigateOwn($nextEl,prevActiveElement,ev.keyCode,false,ev.shiftKey)}};return this._navigateTo(event,dir,funcNav)},_navigateTo:function(event,dir,funcNavigate){var $scrollContainer,go=this.grid.options,self=this,scrTop;if(go.virtualization===true&&go.virtualizationMode==="continuous"){$scrollContainer=this.grid._scrollContainer();if(dir==="topLeft"||dir==="top"){scrTop=0}else{scrTop=$scrollContainer.children(":first-child").height()}$scrollContainer.scrollTop(scrTop);if(self._loadingIndicator===undefined){self._initLoadingIndicator()}self._loadingIndicator.show();setTimeout(function(){if(self._loadingIndicator){self._loadingIndicator.hide()}funcNavigate.call(self,self.grid.element.children("tbody"),event,dir)},300)}else{funcNavigate.call(self,this.grid.element.children("tbody"),event,dir)}return true},_getActiveCell:function(){var activeEl=this._selection.activeElement;if(!activeEl){return}return this._getCellByIdentifier(activeEl)},_expandCollapseRowByCell:function($cell,expand){var $tr;if(!$cell){$cell=this._getActiveCell();if(!$cell){return}}if($cell.length&&$cell.attr("data-expand-cell")&&$cell.find("[data-expand-button]").length){$tr=$cell.closest("tr");if(expand===undefined){this.grid._toggleRow($tr)}else{this.grid._expandCollapseRow($tr,expand,true)}return true}},_initLoadingIndicator:function(){this._loadingIndicator=this.grid.container().length>0?this.grid.container().igLoading().data("igLoading"):this.grid.element.igLoading().data("igLoading").indicator()},_mouseUp:function(event){var target=event&&event.target?$(event.target):null;if(!target.is("[data-expand-button]")&&(!target.is("td[data-expand-cell]")||!this.grid.options.renderExpansionIndicatorColumn)){$.ui.igGridSelection.prototype._mouseUp.apply(this,arguments)}},_virtualRecordsRendered:function(info){var $ae=info.activeElement;if($ae.is("tr")||$ae.is("td")){this._selection.activate(this._identifierForTarget($ae),$ae,true)}},selectRowById:function(id){if(this.options.mode==="cell"){return}if(!this._selection.isSelected(id,this.grid)){if(this._selection.settings.owner!==this.grid){this._selection.changeOwner(this.grid)}this._selection.select(id,true,{element:this._getRowsByIdentifier(id),id:id},true)}},_select:function(info){var element=info.element||this._selection.elementFromIdentifier(info.id);if(element.is("tr")&&this.grid.options.renderExpansionIndicatorColumn){element.children("td.ui-igtreegrid-non-data-column").addClass(this.css.selectedCell)}$.ui.igGridSelection.prototype._select.apply(this,arguments)},_preventDefault:function(event){var target=$(event.target);if(target.is("td")&&(!target.is("td[data-expand-cell]")||!this.grid.options.renderExpansionIndicatorColumn)){event.preventDefault()}}});$.extend($.ui.igTreeGridSelection,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Tree Grid 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.shared.js
 *	infragistics.ui.treegrid.js
 *	infragistics.util.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.grid.sorting.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igTreeGridSorting",$.ui.igGridSorting,{css:{},options:{fromLevel:0,toLevel:-1},_create:function(){this.element.data($.ui.igGridSorting.prototype.widgetName,this.element.data($.ui.igTreeGridSorting.prototype.widgetName));$.ui.igGridSorting.prototype._create.apply(this,arguments)},isColumnSorted:function(columnKey){var i,se=this.grid.dataSource.settings.sorting.expressions;if(!se||!columnKey||!se.length){return false}for(i=0;i<se.length;i++){if(se[i].fieldName===columnKey){return se[i].isSorting}}return false},_rowExpanded:function(){var i,j,colKey,cs,col,found;for(i=0;i<this.options.columnSettings.length;i++){j=0;found=false;cs=this.options.columnSettings[i];colKey=cs.columnKey;for(j=0;j<this.grid._visibleColumns().length;j++){if(this.grid._visibleColumns()[j].key===colKey){col=$("#"+this.grid.element[0].id+"_"+colKey);if(this.isColumnSorted(colKey)&&this.options.applySortedColumnCss!==false){this._applySortStyles(col,col.data("columnIndex"),colKey)}break}}}},destroy:function(){$.ui.igGridSorting.prototype.destroy.apply(this,arguments);this.element.removeData($.ui.igGridSorting.prototype.widgetName)},_injectGrid:function(){var ds;$.ui.igGridSorting.prototype._injectGrid.apply(this,arguments);ds=this.grid.dataSource;if(ds&&ds.settings&&ds.settings.treeDS){ds.settings.treeDS.sorting.fromLevel=this.options.fromLevel;ds.settings.treeDS.sorting.toLevel=this.options.toLevel}}});$.extend($.ui.igTreeGridSorting,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Tree Grid 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.shared.js
 *	infragistics.ui.treegrid.js
 *	infragistics.util.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.grid.tooltips.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igTreeGridTooltips",$.ui.igGridTooltips,{_create:function(){this.element.data($.ui.igGridTooltips.prototype.widgetName,this.element.data($.ui.igTreeGridTooltips.prototype.widgetName));$.ui.igGridTooltips.prototype._create.apply(this,arguments)},_getDataView:function(){return this.grid.dataSource.flatDataView()},_getRowIndex:function(element,row){return element.closest("tbody").children("tr:visible:not([data-container='true'],[data-grouprow='true'])").index(row)},destroy:function(){$.ui.igGridTooltips.prototype.destroy.apply(this,arguments);this.element.removeData($.ui.igGridTooltips.prototype.widgetName)}});$.extend($.ui.igTreeGridTooltips,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Tree Grid 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.shared.js
 *	infragistics.ui.treegrid.js
 *	infragistics.util.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.grid.updating.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igTreeGridUpdating",$.ui.igGridUpdating,{options:{enableAddRow:false},_removeChildrenFromUI:function($row,dataLevel){if(!$row||!$row.length){return}var dl,$tmp,rowId,$fRow,fixedCols=this.grid.hasFixedColumns();if(isNaN(dataLevel)){return}while($row.length===1){dl=parseInt($row.attr("aria-level"),10);if(isNaN(dl)){break}if(dl<=dataLevel){break}$tmp=$row;rowId=$row.attr("data-id");$row=$row.next("tr");if(fixedCols){$fRow=this.container().find("tr[data-id="+rowId+"]");$fRow.remove()}$tmp.remove()}},_updateParentRowAfterDelete:function($pRow,dataLevel){var dl,found,rowId,children,ds=this.grid.dataSource,primaryKeyCol,rec;if(isNaN(dataLevel)||dataLevel<=0){return}while($pRow.length===1){dl=parseInt($pRow.attr("aria-level"),10);if(isNaN(dl)){break}if(dl<dataLevel){found=true;break}$pRow=$pRow.prev("tr")}if(found){rowId=$pRow.attr("data-id");primaryKeyCol=this.grid.columnByKey(this.grid.options.primaryKey);if(primaryKeyCol.dataType==="number"||primaryKeyCol.dataType==="numeric"){rec=ds.findRecordByKey(parseInt(rowId,10))}else{rec=ds.findRecordByKey(rowId)}if(rec){children=rec[this.grid.options.childDataKey];if(children&&children.length===0){if(this.grid.hasFixedColumns()){$pRow=this.container().find("tr[data-id="+rowId+"]")}$pRow.find("span[data-expandcell-indicator]").empty();$pRow.find("td[data-expand-cell]").removeAttr("data-expand-cell")}}}},_generatePrimaryKeyValue:function(e,col){var value,ds=this.grid.dataSource;if(col){value=Math.max(this._recCount||1,ds._totalRecordsCount||1,ds._data.length);if(this.element.find("tr[data-id="+value+"]").length){value++}this._recCount=value;col.value=value}},_attachEvents:function(){this._generatePrimaryKeyValueHandler=$.proxy(this._generatePrimaryKeyValue,this);this.element.bind("igtreegridupdatinggenerateprimarykeyvalue",this._generatePrimaryKeyValueHandler)},_detachEvents:function(){if(this._generatePrimaryKeyValueHandler){this.element.unbind("igtreegridupdatinggenerateprimarykeyvalue",this._generatePrimaryKeyValueHandler);delete this._generatePrimaryKeyValueHandler}},_create:function(){this.element.data($.ui.igGridUpdating.prototype.widgetName,this.element.data($.ui.igTreeGridUpdating.prototype.widgetName));$.ui.igGridUpdating.prototype._create.apply(this,arguments)},_deleteRow:function(evt,rowId,suppress){var res,$prevRow,$nextRow,$row=this.grid.rowById(rowId),dataLevel;if($row&&$row.length){$nextRow=$row.next("tr");$prevRow=$row.prev("tr");dataLevel=parseInt($row.attr("aria-level"),10)}res=this._super(evt,rowId,suppress);if(res&&!isNaN(dataLevel)){this._removeChildrenFromUI($nextRow,dataLevel);this._updateParentRowAfterDelete($prevRow,dataLevel)}return res},destroy:function(){this._detachEvents();$.ui.igGridUpdating.prototype.destroy.apply(this,arguments);this.element.removeData($.ui.igGridUpdating.prototype.widgetName)},_injectGrid:function(grid,isRebind){$.ui.igGridUpdating.prototype._injectGrid.apply(this,arguments);if(!isRebind){this._detachEvents();this._attachEvents()}}});$.extend($.ui.igTreeGridUpdating,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Tree Grid 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.editors.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 *	infragistics.ui.treegrid.js
 *	infragistics.ui.grid.rowselectors.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){"use strict";$.widget("ui.igTreeGridRowSelectors",$.ui.igGridRowSelectors,{options:{rowSelectorNumberingMode:"sequential",checkBoxMode:"biState"},css:{rowSelectorChecked:"ui-state-checked",checkBoxP:"ui-icon ui-icon-check-p ui-igcheckbox-normal-on",checkBoxF:"ui-icon ui-icon-check-f ui-igcheckbox-normal-on"},_create:function(){this.element.data($.ui.igGridRowSelectors.prototype.widgetName,this.element.data($.ui.igTreeGridRowSelectors.prototype.widgetName));$.ui.igGridRowSelectors.prototype._create.apply(this,arguments);this._cIndexes={};this._path="";this._pathBuild=false;this._includedParentRecordNumbers={};this._recordNumbers={};this._checkboxStates={}},destroy:function(){$.ui.igGridRowSelectors.prototype.destroy.apply(this,arguments);this.element.removeData($.ui.igGridRowSelectors.prototype.widgetName)},_recordsRendering:function(){$.ui.igGridRowSelectors.prototype._recordsRendering.apply(this,arguments);if(this.options.rowSelectorNumberingMode==="sequential"){if(this._cIdx===this.options.rowNumberingSeed){this._numberRecords(this.grid.dataSource.data())}return}if(!this.grid._rerenderGridRowsOnToggle()){this._cIndexes={};this._pathBuild=false}else{if($.isEmptyObject(this._includedParentRecordNumbers)){this._numberRecordsWithParents(this.grid.dataSource.data(),"")}}},_rsRenderRecordInternal:function(i,data,rowData,isFixed){var markup=this._gridRenderRecordInternal(i,data,rowData,isFixed),pre,app,idx,rs;if(!isFixed&&this.grid.hasFixedColumns()){return markup}rs=this._getRowSelectorCellMarkup(false,this._rowHasSelection(data),data);idx=markup.indexOf(">")+1;pre=markup.substring(0,idx);app=markup.substring(idx);markup=pre+rs+app;return markup},_rsExpandCollapseRow:function(row,expand){if(expand){this._cIndexes={};this._path=(row instanceof jQuery?row.find("span.ui-iggrid-rowselector-row-number").html():this.element.find("[data-id='"+row+"']").find("span.ui-iggrid-rowselector-row-number").html())+".";this._pathBuild=true}$.ui.igTreeGrid.prototype._expandCollapseRow.apply(this.grid,arguments)},_redirectFunctions:function(){if(this._functionsRedirected===false){this._renderRecordInternalHandler=$.proxy(this._rsRenderRecordInternal,this);this._gridRenderRecordHandler=$.proxy(this.grid._renderRecordInternal,this.grid);this._expandCollapseRowHandler=$.proxy(this._rsExpandCollapseRow,this);this._gridRenderRecordInternal=this._gridRenderRecordHandler;this.grid._renderRecordInternal=this._renderRecordInternalHandler;if(this.options.rowSelectorNumberingMode!=="sequential"){this.grid._expandCollapseRow=this._expandCollapseRowHandler}if(this.options.checkBoxMode!=="biState"){this._select=$.proxy(this._selectHandler,this);this._deselect=$.proxy(this._deselectHandler,this);this._handleCheck=$.proxy(this._handleTriStateCheck,this);this._handleHeaderCheck=$.proxy(this._handleTriStateHeaderCheck,this)}}$.ui.igGridRowSelectors.prototype._redirectFunctions.apply(this,arguments)},_injectGrid:function(){var i;$.ui.igGridRowSelectors.prototype._injectGrid.apply(this,arguments);for(i=0;i<this.grid.options.features.length;i++){if(this.grid.options.features[i].name==="Selection"){if(this.grid.options.features[i].multipleSelection&&this.options.enableCheckBoxes&&this.options.checkBoxMode==="triState"){throw new Error($.ig.TreeGridRowSelectors.locale.multipleSelectionWithTriStateCheckboxesNotSupported)}break}}},_shouldRenderHeaderCheckBoxes:function(){var o=this.options;return o.enableCheckBoxes===true&&o.checkBoxMode==="triState"||o.enableCheckBoxes===true&&o.checkBoxMode==="biState"&&this._ms},_updateHeader:function(){var dvl,sl,checkboxes,check=true,i;if(this.grid.element.data("igGridPaging")){checkboxes=this._allCheckboxes();if(checkboxes.length===0){check=false}else{for(i=0;i<checkboxes.length;i++){if(checkboxes.eq(i).attr("data-chk")==="off"){check=false;break}}}}else{dvl=this.grid.dataSource._totalRecordsCount;sl=this.grid._selection?this.grid._selection.selectionLength():0;if(this.options.checkBoxMode==="triState"){check=this._areAllRecordsChecked(sl,dvl)}else{check=sl===dvl&&this._isFirstRowSelected()}}this._alterCheckbox(this._headerCheckbox(),check)},_rowExpanded:function(ui){if(this.options.rowSelectorNumberingMode==="sequential"){this._reapplyNumbering(ui)}this._unregisterCellEvents();this._registerCellEvents();if(this.options.enableCheckBoxes===true){this._registerCheckBoxEvents();if(this._ms){this._updateHeader()}}},_rowCollapsed:function(ui){if(this.options.rowSelectorNumberingMode==="sequential"){this._reapplyNumbering(ui)}},_buildPath:function(rowData){var dataLevel=this.grid.options.dataSourceSettings.propertyDataLevel,dbDepth=rowData[dataLevel],startingIndex;if(!this._pathBuild){this._path="";while(dbDepth>0){startingIndex=dbDepth===1&&!this.grid._rerenderGridRowsOnToggle()?this._getStartingIndexForPage():0;this._path=this._cIndexes[dbDepth-1]+this.options.rowNumberingSeed+startingIndex+"."+this._path;dbDepth--}}},_getCurrentNumber:function(rowData){var pKey=this.grid.options.primaryKey,dataLevel=this.grid.options.dataSourceSettings.propertyDataLevel,expanded=this.grid.options.dataSourceSettings.propertyExpanded,seed,startingIndex;if(this.options.rowSelectorNumberingMode==="sequential"&&!$.isEmptyObject(this._recordNumbers)){return'<span class="ui-iggrid-rowselector-row-number">'+(this._recordNumbers[rowData[pKey]]||"")+"</span>"}if(!$.isEmptyObject(this._includedParentRecordNumbers)){return'<span class="ui-iggrid-rowselector-row-number">'+this._includedParentRecordNumbers[rowData[pKey]]+"</span>"}if(!this._cIndexes[rowData[dataLevel]]){this._cIndexes[rowData[dataLevel]]=0}if(rowData[expanded]){this._cIndexes[rowData[dataLevel]+1]=0}seed=++this._cIndexes[rowData[dataLevel]];startingIndex=this.grid._rerenderGridRowsOnToggle()?0:this._getStartingIndexForPage();this._buildPath(rowData);return'<span class="ui-iggrid-rowselector-row-number">'+(this._path===""?seed+this.options.rowNumberingSeed+startingIndex:this._path+seed)+"</span>"},_getRowSelectorCellMarkup:function(template,selected,rowData){var markup="",o=this.options,go=this.grid.options,pKey=go.primaryKey,rowId=rowData[pKey],checkStateDefined=this._checkboxStates[rowId]!==undefined&&this._checkboxStates[rowId]!==null;markup+='<th role="rowheader" tabindex="'+go.tabIndex+'" class="'+this.css.rowSelector;if(selected){markup+=" "+this.css.rowSelectorSelected}else if(checkStateDefined){markup+=" "+this.css.rowSelectorChecked}if(template){markup+=" "+this._sTmpl}markup+='"><span class="ui-icon ui-icon-triangle-1-e" style="margin-left: -5px"></span>';if(o.enableRowNumbering){markup+=template===true?this._nTmpl:this._getCurrentNumber(rowData)}if(o.enableCheckBoxes){markup+=this._getTriStateCheckBox(rowData,selected&&o.checkBoxMode!=="triState"||checkStateDefined)}markup+="</th>";return markup},_getTriStateCheckBox:function(rowData,checked){var markup="",dataChk="off",checkBoxState=this.css.checkBoxOff,pKey=this.grid.options.primaryKey;if(checked){dataChk="on";checkBoxState=this._checkboxStates[rowData[pKey]]===0?this.css.checkBoxP:this.css.checkBoxF}markup+='<span name="'+"chk"+'" ';markup+='data-chk="'+dataChk+'" ';markup+='data-role="checkbox" class="'+this.css.checkBox+' "';markup+='tabindex="'+this.grid.options.tabIndex+' "';if(this.options.showCheckBoxesOnFocus===true&&this._checkBoxesShown===false){markup+=' style="visibility: hidden;"'}markup+='><span class="'+checkBoxState+'">';markup+="</span></span>";return markup},_numberRecordsWithParents:function(data,currentPath){var pKey=this.grid.options.primaryKey,childDataKey=this.grid.options.childDataKey,counter=1,cPath,rs=this,dataLen,i,dataRow;if($.type(data)==="array"){dataLen=data.length;for(i=0;i<dataLen;i++,counter++){dataRow=data[i];cPath=(currentPath===""?"":currentPath+".")+counter.toString();if(rs._includedParentRecordNumbers===undefined||rs._includedParentRecordNumbers===null){rs._includedParentRecordNumbers={}}rs._includedParentRecordNumbers[dataRow[pKey]]=cPath;if(dataRow[childDataKey]!==undefined&&dataRow[childDataKey]!==null){rs._numberRecordsWithParents(dataRow[childDataKey],cPath)}}}},_numberRecords:function(data){var pKey=this.grid.options.primaryKey,childDataKey=this.grid.options.childDataKey,expanded=this.grid.options.dataSourceSettings.propertyExpanded,dataLen,i,dataRow;if($.type(data)==="array"){dataLen=data.length;for(i=0;i<dataLen;i++){dataRow=data[i];if(this._recordNumbers===undefined||this._recordNumbers===0){this._cIdx=this.options.rowNumberingSeed;this._recordNumbers={}}this._recordNumbers[dataRow[pKey]]=++this._cIdx;if(dataRow[expanded]&&dataRow[childDataKey]!==undefined&&dataRow[childDataKey]!==null){this._numberRecords(dataRow[childDataKey])}}}},_reapplyNumbering:function(ui){var nextRowId,nextRow=ui.fixedRow||ui.row,rsSelector="span.ui-iggrid-rowselector-row-number";this._cIdx=this.options.rowNumberingSeed;this._numberRecords(this.grid.dataSource.data());while(nextRow.length===1){nextRowId=nextRow.attr("data-id");nextRow.find(rsSelector).text(this._recordNumbers[nextRowId]);nextRow=nextRow.next("tr[aria-level]")}},_selectHandler:function(info){var res;info.element=info.element||this._getRowById(info.id);res=this._rowSelectorFromSelection(info);if(!res){return}res.rowSelector.addClass(this.css.rowSelectorSelected)},_deselectHandler:function(info){var res,shouldDeselect;info.element=info.element||this._getRowById(info.id);res=this._rowSelectorFromSelection(info);if(!res){return}shouldDeselect=this.grid._selection instanceof $.ig.SelectedRowsCollection||!this.grid._selection.atLeastOneSelected(this.grid._fixPKValue(info.element.parent().attr("data-id")));if(shouldDeselect){res.rowSelector.removeClass(this.css.rowSelectorSelected)}},_changeParentsCheckState:function(rowId,toCheck){var grid=this.grid,pKey=grid.options.primaryKey,action=$.proxy(toCheck?this._checkParent:this._uncheckParent,this),parents,res,i,element,parentRow;parents=grid.dataSource.getParentRowsForRow(rowId);for(i=parents.length-1;i>=0;i--){parentRow=parents[i].row;element=this._getRowById(parentRow[pKey]);res=this._rowSelectorFromSelection({element:element});action(parentRow,res)}},_checkParent:function(parentRow,res){var pKey=this.grid.options.primaryKey,childDataKey=this.grid.options.childDataKey,parentRowId=parentRow[pKey];if(this._areAllChildrenChecked(parentRow[childDataKey])){this._checkboxStates[parentRowId]=1;res.checkbox.parent().addClass(this.css.rowSelectorChecked)}else{this._checkboxStates[parentRowId]=0;res.checkbox.parent().addClass(this.css.rowSelectorChecked)}this._alterTriStateCheckbox(res.checkbox,this._checkboxStates[parentRowId])},_uncheckParent:function(parentRow,res){var pKey=this.grid.options.primaryKey,childDataKey=this.grid.options.childDataKey,parentRowId=parentRow[pKey];if(this._hasCheckedChildren(parentRow[childDataKey])){this._checkboxStates[parentRowId]=0;this._alterTriStateCheckbox(res.checkbox,0)}else{delete this._checkboxStates[parentRowId];res.checkbox.parent().removeClass(this.css.rowSelectorChecked);this._alterTriStateCheckbox(res.checkbox)}},_changeChildrenCheckState:function(rowId,toCheck){var grid=this.grid,children=grid.dataSource.getChildrenByKey(rowId,grid.dataSource._data)||[],pKey=grid.options.primaryKey,childDataKey=grid.options.childDataKey,i,childId,child,element,res;for(i=0;i<children.length;i++){child=children[i];childId=child[pKey];element=this._getRowById(childId);res=this._rowSelectorFromSelection({element:element});if(toCheck){this._checkboxStates[childId]=1;res.checkbox.parent().addClass(this.css.rowSelectorChecked);this._alterTriStateCheckbox(res.checkbox,1)}else{delete this._checkboxStates[childId];res.checkbox.parent().removeClass(this.css.rowSelectorChecked);this._alterTriStateCheckbox(res.checkbox)}if($.type(child[childDataKey])==="array"){this._changeChildrenCheckState(childId,toCheck)}}},_areAllChildrenChecked:function(children){var i,childrenLen=children?children.length:0,pKey=this.grid.options.primaryKey,childId,state;for(i=0;i<childrenLen;i++){childId=children[i][pKey];state=this._checkboxStates[childId];if(state===null||state===undefined||state===0){return false}}return true},_hasCheckedChildren:function(children){var i,childrenLen=children?children.length:0,pKey=this.grid.options.primaryKey,childId,state;for(i=0;i<childrenLen;i++){childId=children[i][pKey];state=this._checkboxStates[childId];if(state!==undefined&&state!==null){return true}}return false},_rrn:function(){var rs=this._allRowSelectorCells(),cb=this._allCheckboxes(),cbx,i=0,self=this,sri=this.grid._startRowIndex||0,row,rowId,state;if(this.grid.options.virtualization===true&&this.grid.options.virtualizationMode==="continuous"){this._unregisterCellEvents();this._registerCellEvents()}if(!this._skipRefresh){rs.removeClass(this.css.rowSelectorSelected);cb.map(function(){self._alterCheckbox($(this),false)});for(i=0;i<rs.length;i++){row=rs.eq(i).closest("tr");rowId=this.grid._fixPKValue(row.attr("data-id"));state=this._checkboxStates[rowId];if(rowId===null||rowId===undefined){rowId=i+sri}if(this.grid._selection.selection[rowId]!==undefined||state!==undefined&&state!==null){if(this.grid._selection.selection[rowId]){rs.eq(i).addClass(this.css.rowSelectorSelected)}cbx=cb.eq(i);if(cbx.length===1){if(this.options.checkBoxMode!=="triState"&&(state===undefined||state===null)){this._alterCheckbox(cbx,true)}else{this._alterTriStateCheckbox(cbx,state)}}}}}},_alterTriStateCheckbox:function(checkbox,checkState){var inner=checkbox.children().first();if(checkbox.length>0&&inner.length>0){if(checkState===0){checkbox.attr("data-chk","mixed");inner.removeClass(this.css.checkBoxOff).removeClass(this.css.checkBoxF).addClass(this.css.checkBoxP)}else if(checkState===1){checkbox.attr("data-chk","on");inner.removeClass(this.css.checkBoxOff).removeClass(this.css.checkBoxP).addClass(this.css.checkBoxF)}else{checkbox.attr("data-chk","off");inner.removeClass(this.css.checkBoxP).removeClass(this.css.checkBoxF).addClass(this.css.checkBoxOff)}}},_clearSelection:function(){var rsCells,self=this;if(this.grid.hasFixedColumns()&&this.grid.fixedBodyContainer().attr("data-fixing-direction")==="left"){rsCells=this.grid.fixedBodyContainer().find("tbody").find("th.ui-iggrid-selectedcell").removeClass(this.css.rowSelectorSelected)}else{rsCells=this.grid.element.children("tbody").find("th.ui-iggrid-selectedcell").removeClass(this.css.rowSelectorSelected)}if(this.options.enableCheckBoxes&&this.options.checkBoxMode!=="triState"){$.each(rsCells,function(){self._alterCheckbox($(this).children("span:last"),false)});this._alterCheckbox(this._headerCheckbox(),false)}},_areAllRecordsChecked:function(sl,dvl){var size=0;for(var key in this._checkboxStates){if(this._checkboxStates.hasOwnProperty(key)){if(this._checkboxStates[key]===0){return false}if(this._checkboxStates[key]===1){size++}}}return sl+size===dvl},_getDataView:function(){return this.grid.dataSource.flatDataView()},_getAllData:function(){if(this._flatData){return this._flatData}else{this._flatData=this.grid.dataSource.generateFlatData().flatData;return this._flatData}},_dataRendered:function(){this._unregisterCellEvents();this._registerCellEvents();if(this.options.enableCheckBoxes===true){this._unregisterCheckBoxEvents();this._registerCheckBoxEvents()}},_handleTriStateCheck:function(checkbox){var row,rowId,upd,sel,offset;if(!checkbox){return}upd=this.grid.element.data("igGridUpdating");sel=this._getSelectionInstance();if(sel&&sel._suspend){if(upd){if(upd.findInvalid()){return}upd._endEdit(null,true)}else{return}}offset=this._v?this.grid._startRowIndex:0;row=checkbox.parent().parent();if(this.grid.hasFixedColumns()){if(this.grid.fixedBodyContainer().attr("data-fixing-direction")==="left"){row=row.add(this.grid.element.find("tbody > tr").eq(row.index()))}else{row=row.add(this.grid.fixedBodyContainer().find("tbody > tr").eq(row.index()))}}rowId=this.grid._fixPKValue(row.attr("data-id"));if(rowId===null||rowId===undefined){rowId=row.closest("tbody").children("tr:not([data-container])").index(row)+offset}this.changeCheckStateById(rowId,checkbox.attr("data-chk")==="off");if(!this._suspendHeader){this._updateHeader()}},_handleTriStateHeaderCheck:function(checkbox){var dv=this._getDataView(),elem=this.grid.element,toCheck=checkbox.attr("data-chk")==="off",templateData;this._changeCheckStateForRows(dv,toCheck);this._alterCheckbox(checkbox,toCheck);if(this.options.enableSelectAllForPaging&&elem.data("igGridPaging")){templateData=[{checked:this.checkedRows().length,totalRecordsCount:this._getAllData().length}];this._renderOverlay(templateData,toCheck)}},_selectAllFromOverlay:function(){if(this.options.checkBoxMode==="biState"){this._changeCheckStateForAllRecords(this._getSelectionInstance(),true)}else{this._changeCheckStateForRows(this._getAllData(),true)}},_deselectAllFromOverlay:function(){if(this.options.checkBoxMode==="biState"){this._changeCheckStateForAllRecords(this._getSelectionInstance(),false)}else{this._changeCheckStateForRows(this._getAllData(),false)}},_getRowById:function(identifier){var urow,frow=$();if(this.grid.hasFixedColumns()){frow=this.grid.rowById(identifier,true)}urow=this.grid.rowById(identifier,false);return urow instanceof jQuery?urow.add(frow):$()},_changeCheckStateForRows:function(dv,toCheck){var i,res,element,rowId,pKey=this.grid.options.primaryKey;for(i=0;i<dv.length;i++){rowId=dv[i][pKey];element=this._getRowById(rowId);res=this._rowSelectorFromSelection({element:element});this._alterCheckbox(res.checkbox,toCheck);this._changeChildrenCheckState(rowId,toCheck);this._changeParentsCheckState(rowId,toCheck)}},_changeTriStateById:function(rowId,toCheck){var element=this._getRowById(rowId),res=this._rowSelectorFromSelection({element:element}),checkbox=res.checkbox;if(toCheck){checkbox.parent().addClass("ui-state-checked")}else{checkbox.parent().removeClass("ui-state-checked")}this._alterCheckbox(checkbox,toCheck);this._changeChildrenCheckState(rowId,toCheck);this._changeParentsCheckState(rowId,toCheck)},changeCheckStateById:function(rowId,toCheck){if(this.options.checkBoxMode==="biState"){if(toCheck){this._selection.selectRowById(rowId);return}this._selection.deselectRowById(rowId);return}this._changeTriStateById(rowId,toCheck)},changeCheckState:function(index,toCheck){var pKey=this.grid.options.primaryKey,rowId=this._getDataView()[index][pKey];this.changeCheckStateById(rowId,toCheck)},toggleCheckStateById:function(rowId){var element=this._getRowById(rowId),res=this._rowSelectorFromSelection({element:element}),checkbox=res.checkbox;if(checkbox.attr("data-chk")==="off"){this.changeCheckStateById(rowId,true)}else{this.changeCheckStateById(rowId,false)}},toggleCheckState:function(index){var pKey=this.grid.options.primaryKey,rowId=this._getDataView()[index][pKey];this.toggleCheckStateById(rowId)},_getIndexForRow:function(row){return row.closest("tbody").children("tr:not([data-container])").index(row)+(this.grid._startRowIndex||0)},_rowObject:function(rowId){var rowInfo={};rowInfo.element=this._getRowById(rowId);rowInfo.index=this._getIndexForRow(rowInfo.element);return $.extend(true,{},rowInfo,{id:rowId})},_checkForRequireSelectionWithCheckboxes:function(){return this.options.requireSelection===false&&this.options.enableCheckBoxes===true&&this.options.checkBoxMode==="biState"},checkedRows:function(){var checkStateKey,rows=[];if(this.options.checkBoxMode==="biState"){if(this._ms){return this._selection.selectedRows()}return this._selection.selectedRow()?[this._selection.selectedRow()]:[]}for(checkStateKey in this._checkboxStates){if(this._checkboxStates.hasOwnProperty(checkStateKey)&&this._checkboxStates[checkStateKey]===1){rows.push(this._rowObject(this.grid._fixPKValue(checkStateKey)))}}return rows},partiallyCheckedRows:function(){var checkStateKey,rows=[];for(checkStateKey in this._checkboxStates){if(this._checkboxStates.hasOwnProperty(checkStateKey)&&this._checkboxStates[checkStateKey]===0){rows.push(this._rowObject(this.grid._fixPKValue(checkStateKey)))}}return rows},uncheckedRows:function(){var dv=this._getAllData(),rows=[],i,rowId,pKey=this.grid.options.primaryKey,checkedRows=this.options.checkBoxMode==="biState"?this.grid._selection.selection:this._checkboxStates;for(i=0;i<dv.length;i++){rowId=dv[i][pKey];if(checkedRows[rowId]===undefined||checkedRows[rowId]===null){rows.push(this._rowObject(this.grid._fixPKValue(rowId)))}}return rows},checkStateById:function(rowId){if(this.options.checkBoxMode==="biState"){return this.grid._selection.selection[rowId]?"on":"off"}if(this._checkboxStates[rowId]===undefined||this._checkboxStates[rowId]===null){return"off"}if(this._checkboxStates[rowId]===1){return"on"}if(this._checkboxStates[rowId]===0){return"partial"}}});$.extend($.ui.igTreeGridRowSelectors,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Tree Grid 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.shared.js
 *	infragistics.ui.treegrid.js
 *	infragistics.util.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.grid.columnmoving.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igTreeGridColumnMoving",$.ui.igGridColumnMoving,{_create:function(){this.element.data($.ui.igGridColumnMoving.prototype.widgetName,this.element.data($.ui.igTreeGridColumnMoving.prototype.widgetName));$.ui.igGridColumnMoving.prototype._create.apply(this,arguments)},destroy:function(){$.ui.igGridColumnMoving.prototype.destroy.apply(this,arguments);this.element.removeData($.ui.igGridColumnMoving.prototype.widgetName)},_injectGrid:function(grid,isRebind){$.ui.igGridColumnMoving.prototype._injectGrid.apply(this,arguments);this._unregisterEvents();this._registerEvents()},_updateLayout:function(){var cols,self=this,firstRowChanged=false;if(this._colsSave){firstRowChanged=this._colsSave[0].key!==this.grid._visibleColumns()[0].key}if(firstRowChanged&&!this.options.renderExpansionIndicatorColumn){this.grid._renderRecords();if(this.grid.element.data("igTreeGridSorting")){this.grid.element.data("igTreeGridSorting")._initDefaultSettings()}this.grid._fireInternalEvent("_dataRendered")}if(!this._gridReady()){setTimeout(function(){self._updateLayout()},50);return}if(this.grid._oldCols){cols=$.grep(this.grid._oldCols,this.grid._columnVisible)}else{cols=this.grid._visibleColumns()}this._hscroller=this.grid._hscrollbarcontent();this._hscroller=this._hscroller.length>0?this._hscroller:this.grid.scrollContainer();this._cache.columns={};this._cache.siblings={};this._cache.fixedSiblings={};this._updateLayoutPerLevel(cols,true);this._createMovingOptions();delete this._movingDirty},_registerEvents:function(){this.grid.element.bind("igtreegridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.bind("igtreegridheaderrendering",this._headerRenderingHandler);this.grid.element.bind("igtreegridheaderrendered",this._headerRenderedHandler);this.grid.element.bind("igtreegridrendered",this._gridFullyRenderedHandler);this.grid.element.bind("igtreegridresizingcolumnresized",this._columnStateChanged);this.grid.element.bind("igtreegridcolumnscollectionmodified",this._columnStateChanged);this.grid.element.bind("igtreegridpagingpagingdropdownrendered",this._columnStateChanged);this.grid.element.bind("igtreegrid_columnsmoved",this._columnStateChanged)},_unregisterEvents:function(){this.grid.element.unbind("igtreegridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.unbind("igtreegridheaderrendering",this._headerRenderingHandler);this.grid.element.unbind("igtreegridheaderrendered",this._headerRenderedHandler);this.grid.element.unbind("igtreegridrendered",this._gridFullyRenderedHandler);this.grid.element.unbind("igtreegridresizingcolumnresized",this._columnStateChanged);this.grid.element.unbind("igtreegridcolumnscollectionmodified",this._columnStateChanged);this.grid.element.unbind("igtreegridpagingpagingdropdownrendered",this._columnStateChanged);this.grid.element.unbind("igtreegrid_columnsmoved",this._columnStateChanged);this.grid.headersTable().find("th").unbind("moving")}});$.extend($.ui.igTreeGridColumnMoving,{version:"15.2.20152.1027"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Tree Grid 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.shared.js
 *	infragistics.ui.treegrid.js
 *	infragistics.util.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.grid.resizing.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igTreeGridResizing",$.ui.igGridResizing,{css:{},_create:function(){this.element.data($.ui.igGridResizing.prototype.widgetName,this.element.data($.ui.igTreeGridResizing.prototype.widgetName));$.ui.igGridResizing.prototype._create.apply(this,arguments)},destroy:function(){$.ui.igGridResizing.prototype.destroy.apply(this,arguments);this.element.removeData($.ui.igGridResizing.prototype.widgetName)}});$.extend($.ui.igTreeGridResizing,{version:"15.2.20152.1027"})})(jQuery);