/*!@license
* Infragistics.Web.ClientUI Combo 14.1.20141.1020
*
* Copyright (c) 2011-2014 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.dataSource.js
*
* Example to use:
*	<script type="text/javascript">
*	$(function () {
*		$('#combo1').igCombo();
*	});
*	</script>
*	<input id="combo1" />
*/
(function($){var _aNull=function(v,nan){return v===null||v===undefined||nan&&typeof v==="number"&&isNaN(v)},_toPx=function(val){if(!val){return 0}if(typeof val==="number"){return val}val=val.toString();val=val.match(/[e%mitc]/i)?0:parseFloat(val);return isNaN(val)?0:Math.floor(val+.5)},_px=function(elem,css){return _toPx(elem.css(css))},_notab=function(elem){return elem.attr("tabIndex",-1).css("outline",0).attr("unselectable","on")},_stop=function(e){try{e.preventDefault();e.stopPropagation()}catch(ex){}},_equals=function(o1,o2){return o1===o2||o1&&o2&&o1.getTime&&o2.getTime&&o1.getTime()===o2.getTime()},_now=function(){return(new Date).getTime()},_offset=function(e,xy){return $.ig.util?$.ig.util.offset(e,xy):xy||(e?e.offset():null)},_listIDShift=100,_cascWait;$.widget("ui.igCombo",{options:{height:null,width:null,tabIndex:null,animationShowDuration:100,animationHideDuration:50,enableDisplayBlock:false,mode:"editable",dropDownOnFocus:false,renderMatchItems:"multi",caseSensitive:false,filteringCondition:"contains",filteringType:null,filterExprUrlKey:null,autoComplete:false,format:true,selectedItems:[{index:-1,value:null,text:null}],multiSelection:null,enableActiveItem:true,allowCustomValue:false,clearSelectionOnBlur:false,selectItemBySpaceKey:false,itemSeparator:", ",dropDownWidth:0,dropDownMaxHeight:300,dropDownMinHeight:0,dropDownAsChild:false,virtualization:false,showDropDownButton:true,enableClearButton:true,noMatchFoundText:null,dropDownButtonTitle:null,clearButtonTitle:null,text:null,itemTemplate:null,headerTemplate:null,footerTemplate:null,nullText:null,dataSource:null,dataSourceType:null,dataSourceUrl:null,responseTotalRecCountKey:null,responseDataKey:null,responseContentType:null,requestType:"GET",validatorOptions:null,inputName:null,loadOnDemandSettings:{enabled:false,pageSize:null},dataBindOnOpen:false,closeDropDownOnSelect:true,closeDropDownOnBlur:true,valueKeyType:null,textKeyType:null,valueKey:null,textKey:null,parentCombo:null,cascadingDataSources:null,parentComboKey:null},events:{dropDownOpening:null,dropDownOpened:null,dropDownClosing:null,dropDownClosed:null,dataBinding:null,dataBound:null,textChanged:null,selectionChanging:null,selectionChanged:null,activeItemChanging:null,activeItemChanged:null,noMatchFound:null,filtering:null,filtered:null},css:{combo:"ui-igcombo ui-state-default ui-widget ui-corner-all",field:"ui-igcombo-field ui-corner-all",fieldHolder:"ui-igcombo-fieldholder",fieldHolderRTL:"ui-igcombo-fieldholder-rtl ui-corner-right",fieldHolderLTR:"ui-igcombo-fieldholder-ltr ui-corner-left",hover:"ui-igcombo-hover ui-state-hover",focus:"ui-igcombo-focus ui-state-focus",fieldHover:"ui-igcombo-field-hover",fieldFocus:"ui-igcombo-field-focus",disabled:"ui-igcombo-disabled ui-state-disabled",waitFiltering:"ui-igcombo-waitfiltering",nullText:"ui-igcombo-nulltext",button:"ui-igcombo-button ui-state-default",buttonRTL:"ui-igcombo-button-rtl ui-corner-left",buttonLTR:"ui-igcombo-button-ltr ui-corner-right",buttonFocus:"ui-igcombo-button-focus",buttonHover:"ui-igcombo-button-hover ui-state-hover",buttonPressed:"ui-igcombo-button-pressed ui-state-highlight",buttonIcon:"ui-igcombo-buttonicon ui-icon-triangle-1-s ui-icon",clear:"ui-igcombo-clear",clearHover:"ui-igcombo-clear-hover ui-state-hover",clearPressed:"ui-igcombo-clear-pressed ui-state-highlight",clearFocus:"ui-igcombo-clear-focus",clearIcon:"ui-igcombo-clearicon ui-icon-circle-close ui-icon",checkbox:"ui-state-default ui-corner-all ui-igcombo-checkbox ui-igcheckbox-small",checkboxHover:"ui-state-hover ui-igcombo-checkbox-hover",checkboxIconHover:"ui-state-hover ui-igcombo-checkboxicon-hover",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",list:"ui-igcombo-list ui-widget ui-widget-content ui-corner-all",listItemHolder:"ui-igcombo-listitemholder",listItem:"ui-igcombo-listitem ui-state-default",listItemHover:"ui-igcombo-listitem-hover ui-state-hover",listItemActive:"ui-igcombo-listitem-active ui-state-active",listItemSelected:"ui-igcombo-listitem-selected ui-state-highlight",listItemMatch:"ui-igcombo-listitem-match",listItemTextWithCheckbox:"ui-igcombo-listitemtextwithcheckbox",noTopCorners:"ui-igcombo-no-top-corners",noBottomCorners:"ui-igcombo-no-bottom-corners"},RECORDS_VIEW:"{0}",RECORDS_DATA:"{1}",RECORDS_SERVER:"{2}",RECORDS_SERVER_TOTAL:"{3}",_create:function(){var name,evts,inp,i,len,clear,but,sel,txt,fieldHolder,touch,me=this,o=me.options,css=me.css,elem=me.element,selItems=o.selectedItems,fl="float",field=elem,rtl=elem.css("direction")==="rtl",oldC={display:0,visibility:0,position:0},oldA={title:0};me._data=[];me._rtl=rtl;me._lastScroll=me._virtualTop=me._topID=0;me._changeID=me._activeID=me._scrollTo=-1;i=me._noMouse()?null:o.renderMatchItems;me._matchFlag=i&&i!=="none"?i:null;if(o.id!==undefined&&o.id!==null&&o.id!==""&&(elem.attr("id")===undefined||elem.attr("id").toString()==="")){elem.attr("id",o.id)}if(selItems&&selItems.length===1&&selItems[0].index===-1&&selItems[0].value===null){o.selectedItems=selItems=null}name=elem[0].nodeName;if(name){name=name.toUpperCase()}inp=name==="INPUT";me._SELECT=sel=name==="SELECT";if(!o.inputName){me._oldCss=oldC;me._oldAttr=oldA}if(inp){oldA.value=oldA.disabled=oldA.readOnly=oldA.alt=oldA.tabIndex=oldC.textAlign=oldC.position=oldC.overflow=oldC[fl]=0}else if(sel){if(!o.dataSource){sel=elem[0].options;len=sel.length;if(!selItems||selItems.length===0){clear=selItems=o.selectedItems=[]}o.dataSource=[];o.valueKey="value";o.textKey="text";for(i=0;i<len;i+=1){txt=sel[i].text||sel[i].innerHTML;o.dataSource[i]={value:sel[i].value||txt,text:txt};if(clear&&(i===elem[0].selectedIndex||sel[i].selected)){selItems.push({index:i})}}}}else{if(name!=="DIV"&&name!=="SPAN"){throw new Error(name+" is not supported as base element")}oldA.innerHTML=0}for(i in oldC){if(oldC.hasOwnProperty(i)){oldC[i]=elem.css(i)}}for(i in oldA){if(oldA.hasOwnProperty(i)){oldA[i]=elem[0][i]}}oldC.width=elem[0].style.width;o.width=o.width||oldC.width;oldC.height=elem[0].style.height;o.height=o.height||oldC.height;if(selItems&&selItems.length>0){txt=""}else if(_aNull(txt=o.text)){if(!elem[0].multiple){txt=o.inputName?"":inp?oldA.value:sel?elem.val():oldA.innerHTML}txt=txt?txt.replace(/[\x09\x0a]/g,""):"";i=txt.length;while((i-=1)>=0){if(txt.charCodeAt(i)===32){txt=txt.substring(0,i)}else{break}}}if(inp||sel){me._swap=true;elem=$("<span />").css({position:field.css("position"),left:field.css("left"),top:field.css("top")}).insertBefore(field);if(rtl){elem.css("direction","rtl")}if(sel){field.css("display","none");field=$("<input />")}}else{field=$("<input />");if(!o.inputName){elem.html("")}}me._oldTxt="";me.mainElem=elem;i=elem.css("position");me._static=!i||i==="static";elem.css("overflow","hidden");me._fieldHolder=fieldHolder=$("<span />").addClass(css.fieldHolder).addClass(rtl?css.fieldHolderRTL:css.fieldHolderLTR).css("float",rtl?"right":"left").appendTo(elem);me.fieldElem=field.appendTo(fieldHolder).addClass(css.field).css("float",rtl?"right":"left").bind(me._evts={keydown:function(e){me._onKey(e,0)},keypress:function(e){me._onKey(e,1)},keyup:function(e){me._onKey(e,2)},focus:function(e){me._onEvt(this,8,e)},blur:function(e){me._onEvt(this,9,e)},paste:function(e){me._onChange(e)},beforecut:function(e){me._onChange(e)},cut:function(e){me._onChange(e)},drop:function(e){me._onChange(e)}});if(!_aNull(i=o.tabIndex)){field.attr("tabIndex",i)}field[0].disabled=o.disabled;field[0].readOnly=this._mode(o)>0?"readonly":"";elem.addClass(css.combo).css("display","inline-block").bind(me._elemEvts={MSPointerOver:function(e){me._onEvt(this,26,e)},pointerover:function(e){me._onEvt(this,26,e)},mouseover:function(e){me._onEvt(null,6,e)},mouseleave:function(e){me._onEvt(null,7,e)}});me._mEvts=evts={mousedown:function(e){me._onEvt(this,3,e)},mouseup:function(e){me._onEvt(this,4,e)},MSPointerOver:function(e){me._onEvt(this,26,e)},pointerover:function(e){me._onEvt(this,26,e)},mouseover:function(e){me._onEvt(this,6,e)},mouseleave:function(e){me._onEvt(this,7,e)}};me._tEvts=touch={touchstart:function(e){_stop(e)},touchmove:function(e){_stop(e)},touchend:function(e){_stop(e);var el=$(this);setTimeout(function(){el.trigger("mousedown").trigger("mouseup")},350)}};me.buttonElem=but=_notab($("<span />").addClass(css.button).addClass(rtl?css.buttonRTL:css.buttonLTR).css("float",rtl?"left":"right").attr("data-id",1).appendTo(elem).bind(evts).bind(touch));_notab($("<span />").addClass(css.buttonIcon).appendTo(but).bind(touch));me.clearElem=clear=_notab($("<span />").addClass(css.clear).css("float",rtl?"left":"right").attr("data-id",2).appendTo(fieldHolder).bind(evts).bind(touch));_notab($("<span />").addClass(css.clearIcon).appendTo(clear).bind(touch));me._titles();me.validator();me._clearOn=false;me._doSize();i=me._cascade();if(i){if(i!==true){if(typeof i==="string"){i=i.replace("#","")}_cascWait=_cascWait||{};if(_cascWait[i]){_cascWait[i].push(me)}else{_cascWait[i]=[me]}}}else if(!o.dataBindOnOpen){me.dataBind()}if(txt){me.text(txt)}me._canFire=true},dropDownVisible:function(showHide,fire){if(!arguments.length){return!!this._ddOn}this._canFire=fire;this._doDrop(showHide?2:0);this._canFire=true;return this},remove:function(){var p,v=this._validator,e=this.mainElem;if(!e||!e[0]){return}if(v){v.hide()}if(this._fcs){this._onEvt(null,9)}this.fieldElem.removeClass(this.css.fieldHover);e.removeClass(this.css.hover);p=e[0].parentNode;if(p&&p.tagName){this._doDrop(0);this._fcs=0;p.removeChild(e[0])}return this},validator:function(destroy){var o=this.options.validatorOptions,field=this.fieldElem,v=this._validator;if(v&&(destroy||!o)){v.destroy();delete this._validator}else if(!v&&!destroy&&o&&field.igValidator){o.combo=o.element=this.mainElem;this._validator=field.igValidator(o).data("igValidator")}return this._validator},validate:function(){return this._validator?this._validator.validate():null},setFocus:function(delay){var me=this;if(me.fieldElem&&!me._fcs){if(delay===-1){try{me.fieldElem[0].focus()}catch(ex){}}else{setTimeout(function(){me.setFocus(-1)},delay||0)}}return this},hasFocus:function(){return this._fcs===1},isSelected:function(index){var selItems=this.options.selectedItems,len=selItems?selItems.length:0;while((len-=1)>=0){if(selItems[len].index===index){return true}}return false},selectedIndex:function(index,fire){if(index===undefined){var i,selItems=this.options.selectedItems,len=selItems?selItems.length:0;index=-1;while((len-=1)>=0){i=selItems[len].index;index=index<0?i:Math.min(i,index)}return index}this._canFire=fire!==false&&(fire||this._cascFire);this._select(index);this._updateFromList(null,1);this._fixNull();this._canFire=true;return this},activeIndex:function(index,fire){if(index===undefined){return this._activeID}this._canFire=fire;this._activate(index);this._canFire=true;return this},value:function(val,fire){if(this._noMouse()){return this.text(val,fire)}if(val===undefined){val=this.options.selectedItems;return val&&val[0]?val[0].value:null}this._canFire=fire!==false&&(fire||this._cascFire);this._valTime=_now();this._valLast=val;this._select(null,val);this._updateFromList(null,1);this._canFire=true;return this},text:function(text,fire){if(text===undefined){text=this.fieldElem.val();return this._nullT&&(!text||text===this.options.nullText)?"":text}this._canFire=fire!==false&&(fire||this._cascFire);this._select(null,text,2);this._updateFromList(null,1);if(this._custom()){this._onChange(null,null,text)}this._canFire=true;return this},values:function(vals){var o=this.options,selItems=o.selectedItems,i=selItems?selItems.length:0;if(vals===undefined){vals=[];while((i-=1)>=0){vals[i]=selItems[i].value}return vals}i=vals?vals.length:0;selItems=[];while((i-=1)>=0){selItems[i]={value:vals[i]}}o.selectedItems=selItems;this._initSel(o);return this},itemByIndex:function(id){return id<0?null:{element:this._findItem(id),index:id,value:this._item(id),text:this._item(id,2)}},itemByValue:function(val){var id=-1;while(++id<this._count){if(_equals(val,this._item(id))){return this.itemByIndex(id)}}},getFooter:function(){return this.listElem?this.listElem.find("[data-footer]"):null},getDataSource:function(){return this._dataSource},getData:function(){return this._data},getRecordsCount:function(flag){var count=this._count,ds=this._dataSource;if(flag===this.RECORDS_VIEW||flag===0){return count}if(ds){count=ds._data.length;if(flag===this.RECORDS_DATA||flag===1){return count}count=Math.max(ds.totalRecordsCount(),count);if(flag===this.RECORDS_SERVER||flag===2){return count}if(flag===this.RECORDS_SERVER_TOTAL||flag===3){count=Math.max(Math.max(count,this._totalAll||0),parseInt(this.options._totalAll||0,10))}}return count},listScrollTop:function(val){if(val!==undefined&&!this._ddOn){this.dropDownVisible(true)}var dd=this._ddScroll||this._ddCont;if(val===undefined){return dd?dd[0].scrollTop:0}if(dd){dd[0].scrollTop=val||0}return this},_cascade:function(evt,destroy,combo){var key,i,url,me=this,val=me._parentCombo,o=me.options,ds=o.cascadingDataSources,old=me._cascOpt,parent=combo||o.parentCombo;combo=evt?val:parent;if(val&&!evt){key=val._cascFire;i=key?key.length:0;while(i-->0){if(key[i]===me){key.splice(i,1);if(key.length===0){delete val._cascFire}break}}delete me._parentCombo;delete me._cascFilter;if(destroy){return}if(old){o.valueKey=old.value;o.textKey=old.text;o.dataSource=old.ds;o.dataSourceUrl=old.url;if(!combo){me.dataBind()}}}if(!combo||destroy){return}if(evt){delete me._cascSel;me.selectedIndex(-1);me.activeIndex(-1)}else{if(!ds){key=o.parentComboKey;if(!key){return}if(o.filteringType==="remote"){me._cascFilter=-1}else{o.filteringType="local";me._cascFilter=1}me._cascKey=key;url=o.dataSource?null:o.dataSourceUrl}if(typeof combo==="string"||combo.nodeName){combo=$(parent);if(combo.length!==1){combo=$("#"+parent);if(combo.length!==1){return parent}}}if(combo&&combo[0]&&typeof combo.data==="function"){parent=combo[0];combo=combo.data("igCombo")}if(!combo||combo.widgetName!=="igCombo"||combo===me||!combo._hasData){return parent}key=combo._cascFire;i=key?key.length:0;while(i-->0){if(key[i]===me){break}}if(i<0){combo._cascFire=key=key||[];key.push(me)}me._parentCombo=combo;if(!old&&ds){old=me._cascOpt={value:o.valueKey,text:o.textKey,ds:o.dataSource,url:o.dataSourceUrl}}}val=combo.options.selectedItems;val=val&&val.length>0?val[0].value:null;if(me._valTime&&_now()-me._valTime<200){me._valTime=1}if(ds){ds=val===null?null:ds[val];val=ds?ds.valueKey:null;o.valueKey=val||old.value;val=ds?ds.textKey:null;o.textKey=val||old.text;o.dataSourceUrl=url=ds?ds.dataSourceUrl:null;o.dataSource=ds?ds.dataSource||(ds.length&&!url?ds:null):null;me._hasData=false;me._urlBind=me._lod=me._totalAll=o._totalAll=me._count=0;me._cascUrl=url;if(url){val=o.selectedItems;me._cascSel=val?val[0]?val[0].value:null:null}me.dataBind();delete me._cascUrl}else{me._cascVal=val;if(me._hasData){if(_aNull(val,true)||val===""){me._dataChange()}else{me.filter()}}else{me._cascUrl=url;me.dataBind();delete me._cascUrl}}return true},_noMouse:function(){var o=this.options,ds=o.dataSource;o=o.itemTemplate;return o&&ds&&ds.length===1&&o.indexOf("{")<0&&o.indexOf("}")<0},_custom:function(){return this.options.allowCustomValue||this._noMouse()},_multi:function(o){o=o.multiSelection;return o&&o!=="off"},_checkBox:function(o){o=o.multiSelection;return o===2||o&&o.toLowerCase&&o.toLowerCase()==="onwithcheckboxes"},_mode:function(o){o=o.mode;return o===1||o==="dropdown"?1:o===2||o==="readonlylist"?2:o===3||o==="readonly"?3:0},_fixSelElem:function(elem,sel){var css=this.css,icon=css.listItemSelected,iconOut=css.checkboxOff;if(sel){elem.addClass(icon)}else{elem.removeClass(icon)}if(elem.attr("data-check")){elem[0]._check=sel;icon=css.checkboxOn;elem.find("[data-icon]").removeClass(sel?iconOut:icon).addClass(sel?icon:iconOut)}},_copyA:function(a){var len=a?a.length:0,a1=len?[]:null;while((len-=1)>=0){a1[len]=a[len]}return a1},_clearSel:function(){var elems=this._selElems,i=elems?elems.length:0;while((i-=1)>=0){this._fixSelElem(elems[i])}this._selElems=null},_selChanged:function(e){if(this._selArg){var elem,o,selItems,key=this._cascFire,i=key?key.length:0;while(i-->0){key[i]._cascade(true)}this._fire("selectionChanged",e,this._selArg);if(this._SELECT){elem=this.element[0];o=elem.options;selItems=this.options.selectedItems;i=selItems?selItems[0]:null;i=i?i.index:-1;elem.selectedIndex=i;if(o&&i>=0&&i<o.length){o[i].selected=true}if(elem.onchange){elem.onchange()}}delete this._selArg}},_selChange:function(selItems,e,clear,noReturn){var i,old=this.options.selectedItems,i0=old?old.length:0,i1=selItems?selItems.length:0;if(!i1){selItems=null}if(i0===i1){while(i0-->0){for(i=0;i<i1;i+=1){if(noReturn){if(old[i0].value===selItems[i].value&&old[i0].text===selItems[i].text){break}}else if(old[i0].index===selItems[i].index){break}}if(i===i1){break}}}old=i0>=0&&this._hasData&&!this._waitFilter?{owner:this,oldItems:old,items:selItems}:null;delete this._selArg;if(old&&!this._fire("selectionChanging",e,old)&&!noReturn){return}this._selTime=e&&this.options.focusOnSelect===false?_now():0;this._selArg=old;if(clear||!i1){this._clearSel()}this.options.selectedItems=selItems;this._noFilter=selItems&&selItems.length;return 1},_addSel:function(id,e){if(id>=0&&!this.isSelected(id)){var selItems=this._copyA(this.options.selectedItems);id=this._createSelItem(id);if(!selItems){selItems=[id]}else{selItems.push(id)}if(this._selChange(selItems,e)){this._selChanged(e)}}return this.options.selectedItems},_sepEnd:function(txt){var sep=this._sep(),len=txt.length;return len>1&&txt.lastIndexOf(sep)===len-sep.length},_select:function(id,val,flag,part,e){var vals,lenVals,txt,j,cond,ds,selItems=null,scrollID=-1,actID=-1,i=-1,o=this.options,more=1,count=this._count,act=part?o.allowCustomValue?2:1:null,sep=false,lower=!o.caseSensitive&&typeof val==="string";if(e&&part&&!this._ddOn&&e.type!=="mouseup"){this._doDrop(1,e)}if(this._noMouse()){return}if(act){this._changeID=-1}if(!_aNull(val)&&val!==""){if(flag===2){val=val.toString()}vals=typeof val==="string"?this._texts(val):val.length?val:[val];if((lenVals=vals.length)>0){j=vals[lenVals-1];if(!j&&(flag===2||_aNull(j))){if(act===1){sep=this._sepEnd(val)}vals.splice(lenVals-=1,1)}}if(lenVals===0){this._selChange(selItems,e,1,1);this._selChanged(e);return}while((i+=1)<lenVals){vals[i]={val:vals[i],id:-1,done:null}}if(!this._isStrCond(cond=this._cond(o))){cond="startsWith"}ds=this._dataSource;id=-1;while((id+=1)<count&&more){if(_aNull(txt=this._item(id,flag))){continue}if(lower){txt=txt.toString().toLowerCase()}more=null;for(i=0;i<lenVals;i+=1){if(!vals[i].done){more=1;val=vals[i].val;if(val===txt||part&&ds._findMatch(txt,val,"string",false,cond)){j=i;while((j-=1)>=0){if(vals[j].id===id){break}}if(act&&j>=0){continue}if(act&&i+1===lenVals&&!sep){if(actID<0){this._changeID=scrollID=actID=id;if(act===1&&!o.enableActiveItem){vals[i].id=id}}}else if(vals[i].id<0){vals[i].id=id}if(act!==1&&(val===txt||!part)){vals[i].id=id;vals[i].done=1}}}}}selItems=[];for(i=0;i<lenVals;i+=1){if((id=vals[i].id)>=0&&act!==2){if(scrollID<0){scrollID=id}j=selItems.length;while((j-=1)>=0){if(selItems[j].index===id){break}}if(j<0&&(this._multi(o)||selItems.length===0)){selItems.push(this._createSelItem(id))}}}}else if(typeof id==="number"&&id>=0&&id<count){selItems=[this._createSelItem(scrollID=id)]}if(this._selChange(selItems,e,1)){if(scrollID>=0){this._fixSelScroll(this._scrollTo=scrollID);if(sep){this._updateFromList(e,1,1)}}this._selChanged(e)}if(act){this._activate(actID,e)}},_createSelItem:function(id,txt,val){return{index:id,value:val||this._item(id),text:txt||this._item(id,2)}},_item:function(id,valHtmlText){var val,textValue,i,txtVal,format,tags,j,o=this.options,key=this._keyVal,row=this._data[id],mf=this._matchFlag;if(valHtmlText){key=this._key}if(!row){return valHtmlText?"":null}val=row[key];if(!valHtmlText){return val}format=format||o.format;if(format){if(_aNull(txtVal=row[i=key+"_"])){if(_aNull(val)){val=""}else if($.ig&&$.ig.formatter&&(typeof val==="number"||val&&val.getMonth)){val=$.ig.formatter(val,null,format==="auto"||format===true?null:format)}else{val=val.toString()}row[i]=val}else{val=txtVal}}else{val=_aNull(val)?"":val.toString()}if(valHtmlText!==1){return val}textValue=val;i=o.itemTemplate;if(i&&$.ig.tmpl){if(!this._it){if($.ig.util.isIE&&i.indexOf("unselectable")<0){tags=["<div","<span","<img","<a","<td","<li"];j=tags.length;while(j-->0){i=i.replace(new RegExp(tags[j],"gi"),tags[j]+' unselectable="on"')}}this._it=i}val=$.ig.tmpl(this._it,row);if(mf){val=this._replaceTextInTemplate(val,textValue,this._renderMatches(textValue,o,mf))}return val}if(val===""){return"&nbsp;"}return mf?this._renderMatches(val,o,mf):val},_replaceTextInTemplate:function(template,text,highlightedText){var parsedNode,parsedTemplate,parent,children;if(text!==highlightedText){parsedNode=$(template);parsedNode=this._replaceTextInNode(parsedNode,text,highlightedText);parsedNode=$("<div>").append(parsedNode);parsedTemplate=parsedNode.html();return parsedTemplate}return template},_replaceTextInNode:function(node,text,highlightedText){var children=node.children(),parent=node.clone().children().remove().end();parent.html(parent.text().replace(text,highlightedText));for(i=0;i<children.length;i++){parent=parent.append(this._replaceTextInNode($(children[i]),text,highlightedText))}return parent},_renderMatches:function(html,o,match){var index,i,lenMatch,len,lenIndex,val=o.caseSensitive?html:html.toLowerCase(),minIndex=0,shift=0,matches=[],txts=this._textsTemp||this._texts(1),lenTxt=txts.length;while(minIndex<99999){i=-1;minIndex=99999;len=val.length;while((i+=1)<lenTxt){index=val.indexOf(txts[i]);lenMatch=txts[i].length;if(index>=0&&index<minIndex&&(index===0||match!=="startsWith")&&!(match==="full"&&len!==lenMatch)&&lenMatch){minIndex=index;lenIndex=lenMatch}}if(minIndex<99999){matches.push({index:shift+=minIndex,len:lenIndex});val=val.substring(minIndex+lenIndex);shift+=lenIndex}if(match!=="multi"||shift>=len){break}}for(i=matches.length-1;i>=0;i-=1){index=matches[i].index;len=matches[i].len;html=html.substring(0,index)+'<span unselectable="on" class="'+this.css.listItemMatch+'">'+html.substring(index,index+len)+"</span>"+html.substring(index+len)}return html},_renderRow:function(id,repaint){var txt,elem,box,i,top,cell,me=this,itemWidth=me._itemWidth,o=me.options,checkBoxes=me._checkBox(o),cbWidth=me._cbWidth||0,html=me._html,lod=me._lodWait&&!html;if(lod){if(me._findItem(id+me._virtualTop)){return}repaint=false}if(html){repaint=false;if(!me._data[id]){return}html+='<li tabIndex="-1" class="'+me.css.listItem+'" style="width:';html+=itemWidth+"px;height:"+me._itemHeight+'px" unselectable="on" data-id="'+(id+_listIDShift)+'"'}else if(!repaint){elem=$("<li />").addClass(me.css.listItem).css({width:itemWidth,height:me._itemHeight}).attr("data-id",id+_listIDShift).attr("tabIndex",-1).attr("unselectable","on").appendTo(me._itemsHolder);if(checkBoxes){box=$("<span />").attr("data-box","x").attr("unselectable","on").css("top",(me._cbTop||0)+"px").addClass(me.css.checkbox).appendTo(elem.attr("data-check","x"));$("<span />").attr("data-icon","x").attr("unselectable","on").addClass(me.css.checkboxOff).appendTo(box);if(!cbWidth){me._cbWidth=cbWidth=box[0].offsetWidth}cell=$("<span />").attr("data-txt","x").attr("unselectable","on").addClass(me.css.listItemTextWithCheckbox).css(me._rtl?"marginRight":"marginLeft",Math.max(cbWidth,14)+3+"px").prependTo(elem)}else{elem.attr("data-txt","x")}}id+=me._virtualTop;if(repaint){elem=this._findItem(id);if(!elem){return}if(!o.virtualization&&!me._matchFlag){return elem}}txt=me._item(id,1);if(html){if(checkBoxes){html+=' data-check="x"><span unselectable="on" data-txt="x" style="'+(me._rtl?"margin-right:":"margin-left:")+(Math.max(cbWidth,14)+3)+'px;" class="'+me.css.listItemTextWithCheckbox+'">'+txt+"</span>";html+='<span unselectable="on" data-box="x" style="top:'+(me._cbTop||0)+'px" class="'+me.css.checkbox;html+='"><span unselectable="on" data-icon="x" class="'+me.css.checkboxOff+'"></span></span>'}else{html+=' data-txt="x">'+txt}me._html=html+"</li>"}else if(!me._data[id]){elem.hide();cell=me._findItem(id+1);if(cell){cell.hide()}}else if(elem[0]._old!==txt){elem[0]._old=txt;cell=elem.find("[data-txt]");if(cell.length===0){cell=elem}if(txt!==cell[0].innerHTML){cell.html(txt)}if(checkBoxes&&_aNull(me._cbTop)){box=elem.find("[data-box]");if(box[0]&&(top=elem[0].clientHeight)>0&&(i=box[0].offsetHeight)>0){if(i>=top){elem.css("height",top=i+1)}me._cbTop=Math.max((top-i-1)/2,0)}}elem.show()}if(lod){me._bindLIs(o,elem)}return elem},_isCheckBox:function(elem){return elem&&(elem.getAttribute("data-box")||elem.parentNode.getAttribute("data-box"))},_fixNull:function(clear){var txt,nullTxt=this.options.nullText;if(!nullTxt&&!this._nullT){return}txt=this.text();if(!clear&&txt===""&&nullTxt&&!this._fcs){this._nullT=true;this.fieldElem.addClass(this.css.nullText).val(nullTxt)}else if(this._nullT){this._nullT=null;this.fieldElem.removeClass(this.css.nullText).val(txt||"")}},_onScroll:function(e){var elem,selItems,selID,selLen,id,top,ds,me=this,count=me._count,itemHeight=me._itemHeightOuter,dd=me._ddScroll||me._ddCont;if(!dd||!me._ddOn||count<2||me._lodWait){return}id=Math.floor((top=dd[0].scrollTop)/itemHeight);if(e){me._lastScroll=top}top=Math.floor(me._lastScroll/itemHeight+.4);if(me._lod&&top>count-me._page*1.5){ds=me._dataSource;top=ds.pageIndex();if(top+1<ds.pageCount()){me._wait(me._lodWait=true);ds.pageIndex(top+1);return}}me._topID=top=Math.max(0,Math.min(top,count-Math.floor(dd[0].offsetHeight/itemHeight)));if(me._ddScroll){me._fixActive(me._activeID);count=me._page+1;me._virtualTop=top;selItems=me.options.selectedItems;selLen=selItems?selItems.length:0;me._selElems=[];while((count-=1)>=0){elem=me._renderRow(count,1);if(elem){for(selID=0;selID<selLen;selID+=1){if(selItems[selID].index===count+top){me._selElems.push(elem);me._fixSelElem(elem,1);break}}if(selID>=selLen){me._fixSelElem(elem)}}}me._fixActive(me._activeID,1)}},_lodLbl:function(){var i=-1,dd=this.listElem;while(i++<3&&this._lodFoot&&dd){dd.find("[data-lod"+i+"]").html(this.getRecordsCount(i))}},_touch:function(act){var scroll,dd=this._ddCont;if(dd&&dd.igScroll){scroll=dd.data("igScroll");if(!act){return scroll?scroll.barY:dd.igScroll({direction:"y",yThumb:"draggable",yScroller:this._ddScroll,cancelStart:"ms"}).attr("data-scroll","y")}if(scroll){scroll[act](true)}}},_xyCheck:function(stop){var xy=this._xy,xyE=this.mainElem;if(!xy){return}if(xyE){xyE=_offset(xyE);if(Math.abs(xyE.left-xy.x)>2||Math.abs(xyE.top-xy.y)>2){stop=true}}if(stop||!xyE){delete this._xy;clearInterval(xy.i);this._doDrop()}},_vAct:function(act){return $.ui.igValidator&&$.ui.igValidator._act(this,act)},_doDrop:function(show,e,repaint){var height,needScroll,winHeight,y,bodyElem,row1st,rowLast,max,end,step,docElem,xy,effect,width,body,i,duration,arg,listWidth,footer,me=this,lod=me._lod,lodWait=me._lodWait,up=me._listUp,extraHeight=me._extraHeight||0,ddCont=me._ddCont,o=me.options,rtl=me._rtl,virtual=o.virtualization,dd=me.listElem,itemsHolder=me._itemsHolder,ddScroll=me._ddScroll,elem=me.mainElem,dif=me._ddItemBorderFix,on=me._ddOn,count=me._count,itemHeightOuter=me._itemHeightOuter;repaint=repaint||me._listChanged;if(me._mode(o)>2){show=0}if(!elem||!show&&!on||show===2&&on){return}if(!repaint&&on&&show&&_now()-on<100){return}show=show?repaint||!on:false;if(me._vAct(show?"drop":"hide")){return}if(!itemHeightOuter&&count&&show){repaint=true}if(!me._hasData){if(show&&o.dataBindOnOpen&&!me._dataSource){me.dataBind();setTimeout(function(){me._doDrop(2,e)},0)}return}if(count<1&&me._filtering){row1st=me._noResults;if(!row1st){me._noResults=row1st=_notab($("<li />").css({width:"100%",textAlign:"center"}).addClass(me.css.listItem).html(me._locale("noMatchFoundText")||"&nbsp;"))}}if((!show||show&&!on)&&!me._fire(show?"dropDownOpening":"dropDownClosing",e,arg={owner:me,element:dd||$("<div/>")})){return}if(!lodWait&&show&&me._activeID>=0&&!me.isSelected(me._activeID)&&(i=me.selectedIndex())>=0){me._activate(me._scrollTo=i,e,1)}body=!o.dropDownAsChild;if(!dd){repaint=false}if(!dd||repaint){delete me._listChanged;if((width=parseInt(o.dropDownWidth,10))<5||isNaN(width)){if((width=elem[0].offsetWidth)<5){width=100}}if(!dd){dd=me.listElem=ddScroll=ddCont=_notab(arg.element.attr("data-id",_listIDShift-1).css("position","absolute").addClass(me.css.list).bind(me._mEvts).bind({DOMMouseScroll:function(e){me._onEvt(this,10,e)},mousewheel:function(e){me._onEvt(this,10,e)}}));footer=o.footerTemplate;if(o.headerTemplate||footer){dd.css("overflow","hidden");if(o.headerTemplate){_notab($("<div/>").attr("data-id",_listIDShift-1).css({overflow:"hidden",position:"relative"}).html(o.headerTemplate).appendTo(dd))}ddScroll=ddCont=_notab($("<div/>").attr("data-id",_listIDShift-1).css("position","relative").appendTo(dd));if(footer){i=footer;footer=footer.replace(this.RECORDS_VIEW,'<span data-lod0="x"></span>').replace(this.RECORDS_DATA,'<span data-lod1="x"></span>').replace(this.RECORDS_SERVER,'<span data-lod2="x"></span>').replace(this.RECORDS_SERVER_TOTAL,'<span data-lod3="x"></span>');me._lodFoot=i!==footer;_notab($("<div/>").attr("data-footer","x").attr("data-id",_listIDShift-1).css({overflow:"hidden",position:"relative"}).html(footer).appendTo(dd))}extraHeight=1}me._ddCont=ddCont;me._itemsHolder=itemsHolder=_notab($("<ul/>").attr("data-id",_listIDShift-1).addClass(me.css.listItemHolder).appendTo(ddCont));if(virtual){ddCont.css({overflow:"hidden"});me._ddScroll=ddScroll=_notab($("<div/>").attr("data-id",_listIDShift-1).css({width:"30px",height:"100%",overflowY:"scroll",overflowX:"hidden","float":rtl?"left":"right"}).appendTo(ddCont));me._ddScrollChild=_notab($("<div/>").attr("data-id",_listIDShift-1).css({width:"1px",height:"1px"}).appendTo(ddScroll))}ddScroll.scroll(function(e){me._onScroll(e)});if(me._rtl){dd.css("direction","rtl")}if(body){dd.css({left:"0px",top:"0px"}).appendTo($("body"))}else{dd.prependTo(elem)}me._ddBorderFix=dd.outerWidth()-dd.width();if(extraHeight){ddCont.hide();dd.css("width",width-me._ddBorderFix);me._extraHeight=extraHeight=dd[0].clientHeight;dd.css("width","auto");ddCont.show()}}dd.css({display:"block"});listWidth=width-=me._ddBorderFix;if(row1st){if(itemsHolder.has(row1st).length===0){row1st.appendTo(itemsHolder)}itemHeightOuter=Math.max(10,row1st.outerHeight());dif=0}else if(!lodWait){if(virtual){ddScroll.hide();itemsHolder.css({width:"auto",height:"auto",overflow:"visible","float":"left"})}else{me._keyFixed=1}}if(!itemHeightOuter&&count>0){me._itemWidth=width=Math.ceil(width-1);me._itemHeight="auto";row1st=me._renderRow(0);if((height=row1st.height())<5){height=16}row1st.css({height:me._itemHeight=height});me._ddItemBorderFix=dif=Math.max(0,Math.floor(row1st.outerWidth()-row1st.width()+.4));if(dif>0){me._itemWidth=width-=dif}me._itemHeightOuter=itemHeightOuter=row1st.outerHeight()+Math.max(0,itemsHolder[0].offsetHeight-row1st[0].offsetHeight);me._sameBC(row1st,dd)}itemHeightOuter=itemHeightOuter||0;me._listHeight=Math.max(10,Math.max((max=o.dropDownMinHeight)-extraHeight,itemHeightOuter*(count||1)));max=Math.min(Math.max(0,Math.max(max,o.dropDownMaxHeight)-extraHeight),me._listHeight);if(lod){max=Math.min((lod-1)*itemHeightOuter,max)}height=ddCont.css("height");height=repaint&&height&&height.indexOf("px")>0?parseFloat(height):max;dd.css("width",listWidth);needScroll=me._listHeight>max;if(virtual){me._ddScrollChild.css("height",me._listHeight+itemHeightOuter);ddCont.css("height",me._listHeight=max);dd.css("height",max+extraHeight);if(needScroll){ddScroll.show();ddScroll.css("width",width=ddScroll[0].offsetWidth-ddScroll[0].clientWidth+1);width=listWidth-width;itemsHolder.css({width:width,height:"100%",overflow:"hidden","float":rtl?"right":"left"});width-=dif;count=Math.ceil(max/itemHeightOuter+1)}else{ddScroll.hide();itemsHolder.css("width","100%")}}else{ddCont.css({overflow:needScroll?"auto":"hidden",width:listWidth,height:me._listHeight=max}).css("overflowX","hidden");dd.css("height",max+extraHeight);
if(needScroll){rowLast=$("<div/>").css({position:"absolute",top:max+100+"px",width:9,height:9}).appendTo(ddCont);width=ddCont[0].clientWidth;width=ddCont[0].clientWidth-dif;rowLast.remove()}}if(!needScroll){width=listWidth-dif}me._itemWidth=width;this._repaintList(0,count);me._page=itemHeightOuter?Math.max(2,Math.floor(max/itemHeightOuter)):1;if(repaint&&on){if(me._needsSel){me._fixSelScroll(-1);delete me._needsSel}i=me._listHeightLast;height=me._listHeight+extraHeight;dif=i-height;if(up){end=me._listTop;me._listTop+=dif}me._listHeightLast=height;if(dif){if((duration=dif<0?o.animationShowDuration:o.animationHideDuration)>5){dd.css("height",i).animate({height:height},{duration:duration,step:function(now){if(up){dd.css(body?"top":"marginTop",end+dif*(i-now)/(i-height))}}})}else if(up){dd.css(body?"top":"marginTop",end+dif)}}return}}height=me._listHeightLast=me._listHeight+extraHeight;me._ddOn=show?_now():null;duration=show?o.animationShowDuration:o.animationHideDuration;if(!duration||typeof duration==="number"&&duration<5){duration=null}else{effect=show?o.animationShowEffect:o.animationHideEffect;if(!$.effects||!$.effects[effect]){if(!show&&typeof duration!=="number"){duration=450}effect=null}}me._listHeightEnd=duration&&!effect?0:height;end=function(){if(show){dd.css("filter","");me._fixSelScroll(me._scrollTo);me._touch()}else{dd.css({display:"none"});me._touch("_hide")}me._fire(show?"dropDownOpened":"dropDownClosed",e,arg)};step=function(now,fx){if(me._listUp&&fx&&fx.prop==="height"){dd.css(body?"top":"marginTop",me._listTop+height-now)}};if(show){me._lodLbl();me.setFocus();if(me._needsPaint){me._repaintList()}if(!body&&(!me._static||me._relative)){elem.css("overflow","visible")}if(me._needsSel){me._fixSelScroll(-1);delete me._needsSel}winHeight=999;bodyElem=document.body;docElem=document.documentElement;if((i=window.innerHeight)>50&&i){winHeight=i}else if((i=docElem.clientHeight)>50&&i){winHeight=i}else if((i=bodyElem.clientHeight)>50&&i){winHeight=i}y=Math.max(window.pageYOffset||0,Math.max(bodyElem.scrollTop,docElem.scrollTop));xy=_offset(elem);me._xy=body?{x:xy.left,y:xy.top}:null;xy.height=elem[0].offsetHeight;me._listUp=null;if((up=xy.top+xy.height+height-y-winHeight)>0&&y-xy.top+height<up){me._listUp=up;if(xy.top-(up=height+2)<y&&!me._filtering){up=Math.max(xy.top-y,2)}xy.top+=(xy.height=-up)+_px(elem,"borderTopWidth");elem.addClass(me.css.noTopCorners);dd.addClass(me.css.noBottomCorners)}else{xy.top+=xy.height-_px(elem,"borderBottomWidth");elem.addClass(me.css.noBottomCorners);dd.addClass(me.css.noTopCorners)}dd.css({opacity:duration&&!effect?0:1,height:me._listHeightEnd,display:""});if(body){dd.css({left:xy.left,top:me._listTop=xy.top});me._xy.i=setInterval(function(){me._xyCheck()},300)}else{i=me._rtl?"Right":"Left";dd.css("margin"+i,-_px(elem,"border"+i+"Width")+"px");up=me._listUp?0:_px(elem,"borderTopWidth")+_px(elem,"borderBottomWidth");dd.css("marginTop",me._listTop=xy.height-up);up=_offset(dd);if((up=up.left-xy.left)>30&&up<elem[0].offsetWidth+10){dd.css("marginLeft",-up+"px")}}if(!duration){end()}else if(effect){dd.show(effect,{},duration,end)}else{dd.animate({opacity:1,height:height},{duration:duration,complete:function(){end()},step:function(now,fx){step(now,fx)}})}}else{if(!body&&(!me._static||me._relative)){elem.css("overflow","hidden")}me._xyCheck(true);elem.removeClass(me.css.noTopCorners).removeClass(me.css.noBottomCorners);dd.removeClass(me.css.noBottomCorners).removeClass(me.css.noTopCorners);if(!duration){end()}else if(effect){dd.hide(effect,{},duration,end)}else{dd.animate({opacity:0,height:me._listHeightEnd},{duration:duration,complete:function(){end()},step:function(now,fx){step(now,fx)}})}}return true},_repaintList:function(id,count){if(this._noMouse()){return}var me=this,repaint=!count;if(repaint){id=Math.max(0,this._topID-1);count=id+(this._page&&(this._ddScroll||this._matchFlag)?this._page+3:-1)}count=Math.min(count,this._count);delete this._needsPaint;this._textsTemp=this._texts(1);if(!repaint&&(!this._lodWait||this._lod&&this._filtering===-1)){this._html=" "}while(id<count){this._renderRow(id,repaint);id+=1}if(this._html){this._itemsHolder.html(this._html.substring(this._bindLI=1));delete this._html;setTimeout(function(){me._bindLIs()},600)}if(this._paintAct){this._fixActive(this._activeID,1)}delete this._textsTemp},_startOfSelTrail:function(field,txt,len){var range,sep,end=0,start=0,tr=this._tr();if(tr===1){start=field.selectionStart;end=field.selectionEnd}else if(tr){try{range=document.selection.createRange();tr=range.duplicate();tr.move("textedit",-1);try{while(tr.compareEndPoints("StartToStart",range)<0){tr.moveStart("character",1);if((start+=1)>len){break}}}catch(ex){}end=start+range.text.length}catch(e2){}}if(start===len&&len>2){sep=this._sep();if(sep.length>1&&txt.charAt(len-1)===sep.charAt(1)&&txt.charAt(len-2)===sep.charAt(0)){return start-1}}return start<end&&end===len?start:0},_tr:function(){var field=this.fieldElem[0],tr=this._trVar;if(!tr){try{if((!$.ig.util.isIE||$.ig.util.isIE11)&&!_aNull(field.selectionStart)){tr=1}}catch(ex){}if(tr!==1){try{tr=field.createTextRange?field.createTextRange():null}catch(e2){}}this._trVar=tr}return tr},_setCaret:function(start,end){var tr=this._tr();end=end||start;if(tr){try{if(tr===1){tr=this.fieldElem[0];tr.selectionStart=start;tr.selectionEnd=end;return}if(this._selTime&&_now()-this._selTime<50){return}end-=start;tr.move("textedit",-1);tr.move("character",start);if(end>0){tr.moveEnd("character",end)}tr.select()}catch(ex){}}},_autoComplete:function(filter){var len,txt,selStart,e,backKey,item,tr,txts,ii,last,i=-1,id=this._filtering?this._activeID:this._changeID,field=this.fieldElem,args=this._acArgs,sel="",selEnd=0,o=this.options,selItems=o.selectedItems,itemsLen=selItems?selItems.length:0,sep=this._sep();if(!args||this._noMouse()){return}delete this._acArgs;txt=args.txt;selStart=args.len;e=args.e;if(e&&e.keyCode===$.ui.keyCode.DELETE&&this._custom()){return}backKey=args.backKey;len=txt.length;if(itemsLen>0){if(filter){id=-1}txts=txt.split(sep);tr=selItems;selItems=[];filter=field.val();while((i+=1)<itemsLen){item=tr[i].text;for(ii=0;ii<txts.length;ii+=1){if(txts[ii]===(o.caseSensitive?item:item.toLowerCase())){selItems[ii]=item;if(filter===txts[ii]&&filter!==item){field.val(item)}break}}if(ii===txts.length&&!last){last=item}}while(i>=0){item=i<itemsLen?selItems[i]:last;if(item){if(sel.length>0){sel=sep+sel}sel=item+sel}i-=1}}filter=null;item=id>=0?this._item(id,2):null;if(item&&(!sel||sel!==item)){if(sel){sel+=sep}sel+=item}if(sel&&len>1&&selStart===len&&this._multi(o)&&!backKey&&txt.charAt(len-1)===sep.charAt(0)){if(id>=0){this._addSel(id,e);this._fixSelScroll(-1)}txt=sel+=sep;filter=selStart=i=sel.length}this._userTxt=txt;if(!sel){if(len>0&&!this._filtering){this._fire("noMatchFound",e,{owner:this,text:txt})}if(!backKey){return}}else if(selStart<(selEnd=sel.length)||i>0){field.val(this._oldTxt=sel)}else if(backKey){selEnd=selStart=len}else{return}this._setCaret(selStart,selEnd);this._userTxt=txt.substring(0,selStart);this._selLen=selEnd-selStart;if(filter&&this._multi(o)&&this._filtering){this.filter(e,null,this._noFilter)}},_onChange:function(e,flag,text,backKey){var selStart,len,txt,autoComplete,me=this,field=me.fieldElem,old=me._oldTxt,o=me.options;if(!field||!field[0]){return}txt=e?e.type:null;if(txt&&e.keyCode!==13&&txt.indexOf("blur")<0&&txt.indexOf("mouse")<0&&me._userTxt!==text){delete me._noFilter}if(me._hasData&&me._nullT&&flag===undefined&&!me._fcs){me._fixNull(1)}if(!_aNull(text)){field.val(me._userTxt=text);text=1}txt=me.text();len=txt.length;if(e&&e.type!=="blur"&&(text||flag===2)){me._setCaret(len)}if(!me._expr&&backKey===true&&o.autoComplete&&len>0&&(selStart=me._startOfSelTrail(field[0],txt,len))>0){_stop(e);return me._onChange(e,1,txt.substring(0,selStart-1),2)}if(txt!==old||me._selLen===1&&!flag&&me._userTxt&&old.length-me._userTxt.length===1){if(txt===old){me._userTxt=old}delete me._filterTxt;me._oldTxt=txt;me._fixClear();me._needsPaint=1;if(e){me._fire("textChanged",e,{owner:me,oldText:old,text:txt});if(me._validator){me._validator._evt(e)}}autoComplete=o.autoComplete&&(len>0||backKey);if(me._filtering){if(flag===2&&me._multi(o)){me._repaintList();return}me._userTxt=txt;me.filter(e,null,me._noFilter)}else{if(flag!==2){me._select(null,txt,2,1,e)}if(!autoComplete){me._userTxt=txt;me._repaintList()}}if(autoComplete){me._acArgs={txt:txt,len:len,e:e,backKey:backKey};if(me._filtering>=0){setTimeout(function(){if(!me._jpn){me._autoComplete()}me._repaintList()},0)}}}if(!flag){setTimeout(function(){me._onChange(e,1)},10)}else{me._save(o);if(e&&!me._ddOn&&me._fcs){me._doDrop(1,e)}}},_save:function(o){var item,input,select,sel,i=-1,str="",name=o.inputName;if(!name||!this._hasData||this._waitFilter){return}input=$('input[name="'+name+'"]');if(input[0]===this.element[0]){return}if(input.length===0){input=$('select[name="'+name+'"]');select=input.length;if(select){input.empty()}else{input=$('<input type="hidden" name="'+name+'" />').appendTo(this.element.parent())}}sel=o.selectedItems;while(sel&&(i+=1)<sel.length){item=this._item(sel[i].index);if(item&&item.getTime){item=item.getFullYear()+"-"+(item.getMonth()+1)+"-"+item.getDate()+" "+item.getHours()+":"+item.getMinutes()+":"+item.getSeconds()+"."+item.getMilliseconds()}if(select){$('<option value="'+item+'" selected="selected" >').appendTo(input)}else{if(i>0){str+=","}str+=item}}if(i<1&&this._custom()){str=this.text();if(select){$('<option value="'+str+'" selected="selected" >').appendTo(input)}}if(!select){input.val(str)}},_onKey:function(e,type){var k=e?e.keyCode||e.which:null,me=this,on=me._ddOn,id=me._activeID,o=me.options,kc=$.ui.keyCode,selItems=o.selectedItems,back=k===kc.BACKSPACE,count=me._count-1,mode=me._mode(o);if(type<2&&!me._fire(type===0?"keydown":"keypress",e,{owner:me,keyCode:k})){return _stop(e)}if(type<2&&k===kc.SPACE&&(mode>0||o.selectItemBySpaceKey&&id>=0&&o.enableActiveItem&&on)){_stop(e);if(mode<2&&id>=0&&type===0){me._fixSelScroll(id,e,null,null,1)}return}if(k===46){e.stopPropagation()}if(type<2&&(back||k>40||k===kc.SPACE)&&mode===0){me._jpn=k===229;me._onChange(e,null,null,back)}if(type===0){if(e.shiftKey){return}if(k===kc.ESCAPE){if(!on){setTimeout(function(){me._onChange(e,null,me._focTxt)},0)}else{_stop(e);me._doDrop(0,e)}}if((on||id>=0)&&(k===kc.ENTER||k===kc.NUMPAD_ENTER)){_stop(e);if(mode<2){if(id>=0&&o.enableActiveItem&&!me.isSelected(id)){me._fixSelScroll(id,e,null,null,1)}me._updateFromList(e)}me._doDrop(0,e)}if(k<33||k>40){return}if(e.ctrlKey){return}if(!e.altKey&&!e.metaKey){if(me._count<1){return}if(id<0){if(!on&&k!==kc.DOWN&&k!==kc.UP){return}id=count+1;back=selItems?selItems.length:0;while((back-=1)>=0){id=Math.min(selItems[back].index,id)}if(id>count){id=0}}else if(k===kc.DOWN){id+=1}else if(k===kc.UP){id-=1}else if(k===kc.HOME&&on){id=0}else if(k===kc.END&&on){id=count}else if(k===kc.PAGE_DOWN&&on){id+=me._page}else if(k===kc.PAGE_UP&&on){id-=me._page}else{return}_stop(e);if((id=Math.max(Math.min(id,count),0))!==me._activeID){if(me._activate(id,e)){if(on){me._fixSelScroll(id,e,null,1)}else{me.selectedIndex(id,true)}}}}else if(k===kc.DOWN&&!on||k===kc.UP&&on){return me._doDrop(on?0:1,e)}}},_sep:function(){var sep=this.options.itemSeparator||",";return sep.length>2?sep.substring(0,2):sep},_updateFromList:function(e,zero,addSep){var id=this._changeID,txt="",o=this.options,i=-1,sep=this._sep(),selItems=this._addSel(id===this._activeID?id:-1,e),len=selItems?selItems.length:0;delete this._jpn;if(this._noMouse()){return}this._changeID=-1;if(!this._multi(o)&&len>1){len=1}while((i+=1)<len){txt+=this._item(selItems[i].index,2);if(i+1<len||addSep){txt+=sep}}if(txt.length>0||zero){this._onChange(e,2,txt)}},_findItem:function(id){var dd=this._itemsHolder;if(dd){id-=this._virtualTop;dd=dd.find('[data-id="'+(id+_listIDShift)+'"]');if(dd.length===1){return dd}}},_fixSelScroll:function(id,e,elem,key,ctrl){if(this._fixSel(id,e,elem,key,ctrl)){return}if(e){this._updateFromList(e,ctrl);if(!ctrl&&!key&&this.options.closeDropDownOnSelect){this._doDrop(0,e)}}if(key||!e){this._fixScroll(id)}},_fixActive:function(id,on){var css=this.css.listItemActive,elem=id>=0&&this.options.enableActiveItem?this._findItem(id):null;if(elem){if(on){elem.addClass(css)}else{elem.removeClass(css)}delete this._paintAct}else if(on){this._paintAct=1}},_activate:function(id,e,noScroll){if(!this.options.enableActiveItem||this._noMouse()){this._activeID=id;return 1}var arg,old=this._activeID;if(old!==id&&this._fire("activeItemChanging",e,arg={owner:this,oldIndex:old,index:id})){this._fixActive(old);this._fixActive(this._activeID=id=arg.index,1);if(id>=0&&!noScroll&&(!e||e.type!=="mousedown")){this._fixScroll(id)}this._fire("activeItemChanged",e,arg)}},_fixSel:function(id,e,elem,key,ctrl){var item,next=0,i=id,o=this.options,selItems=this._copyA(o.selectedItems),len=selItems?selItems.length:0,oldSelElems=this._selElems,virtual=this._ddScroll,old=virtual&&id<0?null:this._selElems;if(!this._ddOn||this._noMouse()){return 1}if(id>=0&&!elem){elem=this._findItem(id);if(!elem){old=null;while(virtual&&!elem&&i>=0&&i<=this._count&&(next+=1)<4){this._fixScroll(i);this._onScroll(e);elem=this._findItem(id);i-=1}}if(!elem){return 1}}for(i=0;i<len;i+=1){item=old?old[i]:null;if(!item){item=this._findItem(selItems[i].index);if(item){if(!old){this._selElems=old=[]}this._fixSelElem(old[i]=item,1)}}if(id<0||!item||!e){continue}if(item[0]===elem[0]){if(!ctrl){if(len===1){return}}else{selItems.splice(i,1);if(this._selChange(selItems,e)){this._fixSelElem(elem);old.splice(i,1);this._selChanged(e)}else{this._selElems=oldSelElems}return}}else if(!ctrl){this._fixSelElem(item)}}if(!elem||!e){return}i=null;if(!ctrl||!selItems||!this._multi(o)){i=selItems=[];old=[]}selItems.push(this._createSelItem(id));if(this._selChange(selItems,e,i)){this._activate(id,e);old=old||[];old.push(elem);this._selElems=old;this._fixSelElem(elem,1);this._selChanged(e)}else{this._selElems=oldSelElems;for(i=0;i<this._selElems.length;i++){this._fixSelElem(this._selElems[i],true)}return 1}},_fixScroll:function(id){var scroll,top,last=this._lastScroll,dd=this._ddScroll||this._ddCont,height=this._itemHeightOuter;if(!dd||this._lodWait){return}top=scroll=dd[0].scrollTop;this._scrollTo=-1;if(id<0){if(last&&last!==top){dd[0].scrollTop=last;top=dd[0].scrollTop}if($.ig.util.isSafari&&top>20){dd[0].scrollTop=top-1}}else if((top=id*height)>scroll){if((top+=height-this._listHeight)<scroll){return}}if(top!==last){if(this._ddScroll&&top>last){top+=height-1}dd[0].scrollTop=top}},_bindLIs:function(o,li){var me=this,holder=me._itemsHolder,elem=li;if(!me.mainElem){return}if(!li){if(!this._bindLI||!holder){return}delete this._bindLI;elem=holder.find("li[data-id]")}elem.bind(me._mEvts);if(me._checkBox(o||this.options)){if(!me._evtHov){me._evtHov={MSPointerOver:function(e){me._onEvt(this,26,e)},pointerover:function(e){me._onEvt(this,26,e)},mouseover:function(e){me._onEvt(this,16,e)},mouseleave:function(e){me._onEvt(this,17,e)}}}elem=li||holder;elem.find("span[data-box]").bind(me._evtHov).bind(me._tEvts).find("span[data-icon]").bind(me._tEvts)}},_onEvt:function(el,type,e){var i,hovCss,pressCss,me=this,msOver=me._msOver,o=me.options,css=me.css,field=me.fieldElem,el$=!el||el===field[0]||e&&e.target===field[0]?field:$(el),id=el$.attr("data-id"),elem=me.mainElem,mode=me._mode(o);if(o.disabled){return}if(type===8){me._focTxt=me.text();me._fcs=1;elem.addClass(css.focus);field.addClass(css.fieldFocus);me._fixNull();if(mode<3){me.buttonElem.addClass(css.buttonFocus);me.clearElem.addClass(css.clearFocus)}if(!me._ddOn&&o.dropDownOnFocus){setTimeout(function(){if(me._fcs){me._doDrop(1,e)}},50)}return}if(type===9){i=me.text();if(e&&me._jpn&&$.ig.util.isFF&&me._userTxt!==i){me._onChange(e,null,i)}me._jpn=me._fcs=0;elem.removeClass(css.focus);field.removeClass(css.fieldFocus);me.buttonElem.removeClass(css.buttonFocus);me.clearElem.removeClass(css.clearFocus);if(!e){return}if(o.closeDropDownOnBlur){me._doDrop(0,e)}if(!me._custom()){me._updateFromList(e,1)}if(o.clearSelectionOnBlur||!o.allowCustomValue){me._changeID=-1;me._onChange(e,null)}me._fixNull();if(me._validator){me._validator._evt(e,null,1)}return}if(type===10){elem=me._ddScroll||me._ddCont;o=e.originalEvent||e;i=e.wheelDelta||o.wheelDelta||-(e.detail||o.detail);if(!_aNull(i,true)&&elem){_stop(e);elem[0].scrollTop+=i>0?-me._itemHeightOuter:me._itemHeightOuter}return}if($.ig.util&&$.ig.util.evtButton(e)){return}if(type===26){me._msOver=e.originalEvent.pointerType;return}if(msOver===2&&(type===6||type===16)){delete me._msOver;return}if(!id&&type>15){id=el$.parent().attr("data-id")}id=el$===field?0:isNaN(id=id?parseInt(id,10):-1)?-1:id;if(id>90){me._bindLIs(o)}if(id<0||id>98&&me._noMouse()){return}if(type===3){_stop(e)}if(mode>1&&(type>7||id>3)){return}if(type===16){return el$.addClass(css.checkboxHover)}if(type===17){return el$.removeClass(css.checkboxHover)}hovCss=id>=_listIDShift?me._touch()&&!(msOver&&msOver!==2)?"":css.listItemHover:id===1?css.buttonHover:css.clearHover;pressCss=id>=_listIDShift?"":id===1?css.buttonPressed:css.clearPressed;if(type===3){if(id<3){el$.addClass(pressCss)}return}if(id===_listIDShift-1){return}if(type===4){if(id>=_listIDShift){delete me._jpn;me._fixSelScroll(id-_listIDShift+me._virtualTop,e,el$,null,e.ctrlKey||e.metaKey||me._isCheckBox(e.target))}else if(el$.hasClass(pressCss)){if(id===1){if(me._vAct("drop")){return}me.setFocus();me._doDrop(1,e)}if(id===2){if(me._filtering){me._select(-1)}me._onChange(e,null,"")}el$.removeClass(pressCss)}return}if(type===6){if(id===0){field.addClass(css.fieldHover);elem.addClass(css.hover)}else{el$.addClass(hovCss)}}if(type===7){if(id===0){elem.removeClass(css.hover);field.removeClass(css.fieldHover);if(me._fcs===1){elem.addClass(css.focus)}}else{el$.removeClass(hovCss).removeClass(pressCss)}}},_fixClear:function(size){var o=this.options,show=o.enableClearButton&&this._oldTxt.length>0&&this._mode(o)<2&&!o.disabled;if(this._jpn&&$.ig.util.isFF){return}if(this._clearOn!==show){this._clearOn=show;size=1}if(size){this._doSize()}},_doTimer:function(flag){var me=this,timer=me._timer;if(flag===2){if(timer){clearInterval(timer);delete me._timer}return}if(!timer){me._timer=setInterval(function(){me._doTimer()},200)}if(flag===1){return}if(me._doSize(1)&&!me._percWidth&&!me._percHeight){me._doTimer(2)}},_doButHeight:function(height,perc){var img,imgHeight,min=this._butMinHeight,offsetHeight=height,minHolder=this._minHolderHeight;this.clearElem.css("height",perc?"100%":height-minHolder);height=Math.max(height-min,0);this.buttonElem.css("height",perc?height/offsetHeight*100+"%":height);img=this.buttonElem.children(0);imgHeight=img[0].offsetHeight||16;img.css("marginTop",Math.floor((offsetHeight-(min||0)-imgHeight)/2+.5)+"px");img=this.clearElem.children(0);img.css("marginTop",Math.floor((offsetHeight-minHolder-(img[0].offsetHeight||imgHeight))/2+.5)+"px")},_outerWidth:function(elem){return elem[0].offsetWidth+_px(elem,"marginLeft")+_px(elem,"marginRight")},_outerHeight:function(elem){return elem[0].offsetHeight+_px(elem,"marginTop")+_px(elem,"marginBottom")},_sameBC:function(src,targ){var clr=src.css("backgroundColor");targ.css("background",!clr||clr==="transparent"||clr.replace(/ /g,"").indexOf("(0,0,0,0")>0?"white":clr)},_doSize:function(timer){if(!this.mainElem){return}var fieldWidth,fix,percWidth,percHeight,butHeight,holderHeight,holderWidth,me=this,o=me.options,width=o.width,height=o.height,relative=me._relative,but=me.buttonElem,css=me.css,elem=me.mainElem,elem0=elem[0],field=me.fieldElem,fieldHolder=me._fieldHolder,clearOn=me._clearOn,minFieldHeight=me._minFieldHeight,minFieldWidth=me._minFieldWidth,minHolderWidth=me._minHolderWidth,minHolderHeight=me._minHolderHeight,butWidth=me._butWidth,clearWidth=me._clearWidth,lastHeight=me._lastHeight,clear=me.clearElem,offsetWidth=elem0.offsetWidth,offsetHeight=elem0.offsetHeight;if(offsetWidth&&!me._offsetWidth&&(!width||!height)){fix=$("<span />").css({display:"inline-block",position:"absolute"}).addClass("ui-igcombo").appendTo(me.element.parent());if(!width){width=fix[0].offsetWidth;if(width>10){o.width=width}else{width=0}}if(!height){height=fix[0].offsetHeight;if(height>10&&height!==fix.removeClass("ui-igcombo")[0].offsetHeight){o.height=height}else{height=0}}fix.remove()}width=width||150;height=height||"auto";fix=me._offsetWidth!==offsetWidth||width!==me._lastWidth||me._offsetHeight!==offsetHeight||height!==lastHeight;if(!offsetWidth||timer&&!fix){if(!offsetWidth){me._doTimer(1)}return}if(fix){me._listRemove()}me._lastWidth=width;me._lastHeight=height;me._percWidth=percWidth=typeof width==="string"&&width.indexOf("%")>0;me._percHeight=percHeight=typeof height==="string"&&height.indexOf("%")>0;if(percWidth||percHeight){me._doTimer(1)}if(!lastHeight){me._sameBC(field,fieldHolder);relative=elem.css("position")!=="static";if(!relative&&(percWidth||percHeight)){elem.css("position","relative");relative=true}me._relative=relative;field.css("position",relative?"absolute":"static")}fieldHolder.css({position:"absolute",width:"auto",height:"auto"});clear.hide();field.css({width:0,height:0});if(!lastHeight){fix=me._rtl?css.fieldHolderRTL:css.fieldHolderLTR;if(o.showDropDownButton){fieldHolder.addClass(fix)}else{fieldHolder.removeClass(fix)}fix=me._rtl?css.buttonRTL:css.buttonLTR;if(o.showDropDownButton){but.addClass(fix)}else{but.removeClass(fix)}butWidth=0;if(o.showDropDownButton){but.show();butWidth=me._outerWidth(but);fix=but.css("height");but.css("height",0);me._butMinHeight=me._outerHeight(but);but.css("height",fix)}else{but.hide()}me._butWidth=butWidth;me._minFieldWidth=minFieldWidth=me._outerWidth(field);me._minFieldHeight=minFieldHeight=me._outerHeight(field);me._minWidth=butWidth+me._outerWidth(field);if(o.enableClearButton){clear.show();me._clearWidth=clearWidth=me._outerWidth(clear);clear.hide()}field.hide();me._minHolderHeight=minHolderHeight=fieldHolder[0].offsetHeight;me._minHolderWidth=minHolderWidth=fieldHolder[0].offsetWidth;field.show()}fix=_toPx(width);if(fix){width=fix-_px(elem,"borderLeftWidth")-_px(elem,"borderRightWidth");if(width<1){width=1}}fix=_toPx(height);if(fix){height=fix-_px(elem,"borderTopWidth")-_px(elem,"borderBottomWidth");if(height<1){height=1}}elem.css({width:width,height:height,display:"inline-block",minWidth:0,minHeight:0});offsetWidth=elem0.clientWidth;offsetHeight=elem0.clientHeight;fieldHolder.css("height","auto");butHeight=o.showDropDownButton?me._outerHeight(but):0;if(!relative){fieldHolder.css("position","static")}field.css({height:"auto",position:"static"});holderHeight=me._outerHeight(fieldHolder);if(relative){field.css("position","absolute")}if(clearOn){clear.show()}if(o.height){holderHeight=Math.max(offsetHeight-minHolderHeight,0);fieldHolder.css("height",percHeight?holderHeight/offsetHeight*100+"%":holderHeight);field.css("height",percHeight?(holderHeight-minFieldHeight)/holderHeight*100+"%":holderHeight-minHolderHeight-minFieldHeight);me._doButHeight(offsetHeight,percHeight)}else if(holderHeight<butHeight){fieldHolder.css("height",butHeight-minHolderHeight);field.css("height",butHeight-minHolderHeight-minFieldHeight)}else{me._doButHeight(holderHeight,percHeight);field.css("height",holderHeight-minHolderHeight-minFieldHeight);if(relative){fieldHolder.css("height",holderHeight-minHolderHeight)}elem.css("height",height=holderHeight)}elem.css({display:o.enableDisplayBlock?"block":"inline-block",minWidth:me._minWidth+clearWidth+2});width=Math.max(offsetWidth-butWidth-minHolderWidth,0);fieldHolder.css("width",percWidth?width/offsetWidth*100+"%":width);offsetWidth=elem0.clientWidth;holderWidth=fieldHolder[0].offsetWidth;if((fix=offsetWidth-holderWidth-butWidth)!==0){width+=fix;fieldHolder.css("width",percWidth?width/offsetWidth*100+"%":width)}fieldWidth=width-minFieldWidth-1;if(clearOn){fieldWidth-=clearWidth}field.css("width",percWidth?fieldWidth/width*100+"%":fieldWidth);if((fix=fieldHolder[0].clientWidth-me._outerWidth(field)-(clearOn?clearWidth:0)-1)!==0){fieldWidth+=fix;field.css("width",percWidth?fieldWidth/width*100+"%":fieldWidth)}if(!relative){holderHeight=fieldHolder[0].offsetHeight+5;elem.css("height","auto");for(fix=0;fix<4&&width>0;fix+=1){if(elem0.offsetHeight<holderHeight){break}width-=.5;fieldHolder.css("width",percWidth?width/offsetWidth*100+"%":width)}fieldHolder.css("width",percWidth?--width/offsetWidth*100+"%":--width);elem.css("height",height)}me._offsetWidth=elem0.offsetWidth;me._offsetHeight=elem0.offsetHeight;return 1},_listRemove:function(){var me=this;if(!me.listElem){return}me._touch("destroy");me.mainElem.removeClass(me.css.noTopCorners).removeClass(me.css.noBottomCorners);me.listElem.remove();me._selElems=me.listElem=me._itemsHolder=me._ddCont=me._ddScroll=me._noResults=me._q=me._ddOn=me._extraHeight=me._listChanged=me._ddItemBorderFix=me._itemHeightOuter=me._bindLI=null;me._lastScroll=me._virtualTop=me._topID=0;me._activeID=me._scrollTo=-1},destroy:function(){var i,e,elem=this.mainElem,css=this.css,old=this._oldCss,field=this.fieldElem,elem0=this.element;e=elem?elem[0]:null;if(!e){return this}if(this._loadInd){this._loadInd.destroy()}this._doTimer(2);this._listRemove();this.validator(1);if(this._SELECT){elem.remove();elem0.css("display",old.display)}else{field.removeClass(css.nullText).removeClass(css.fieldFocus).removeClass(css.fieldHolder).unbind(this._evts);if(this._swap){field.removeClass(css.field);field.insertBefore(elem);elem.remove()}else{this.buttonElem.remove();this.clearElem.remove();elem.unbind(this._elemEvts).removeClass(css.combo).removeClass(css.hover).removeClass(css.focus).removeClass(css.disabled);field.remove()}for(i in old){if(old.hasOwnProperty(i)){elem0.css(i,old[i])}}old=this._oldAttr;for(i in old){if(old.hasOwnProperty(i)){elem0[0][i]=old[i]}}}this._cascade(false,true);delete this.mainElem;$.Widget.prototype.destroy.apply(this,arguments);return this},_getType:function(v){return v===true||v===false?"bool":v&&v.getTime?"date":typeof v==="number"?"number":"string"},dataBind:function(){var field,ds0,dataOptions,setting,binded,o=this.options,url=o.dataSourceUrl,lod=o.parentComboKey&&o.parentCombo?null:o.loadOnDemandSettings,key=o.responseDataKey,txtKey=o.textKey||o.valueKey,type=o.dataSourceType,vt=o.valueKeyType,tt=o.textKeyType,verb=o.requestType,contentType=o.responseContentType,schema={fields:[]},ds=o.dataSource,dsStr=typeof ds==="string",keys=key?key.split("."):null,len=keys?keys.length-1:-1,i=-1;vt=vt==="auto"?null:vt;if(dsStr&&!type){if($.ig.util.isJsonpUrl(ds)){ds=new $.ig.JSONPDataSource({dataSource:ds})}else{ds=new $.ig.DataSource({dataSource:ds})}}ds0=ds;while(ds0&&i++<len){ds0=ds0[keys[i]]}if(!ds0){ds0=ds;keys=null}else if(keys){schema.searchField=key}field=ds0?ds0[0]:null;if(typeof field==="string"||typeof field==="number"||field&&field.getTime){i=ds0.length;field=ds0;ds0=[];txtKey=txtKey||"x";while(i-->0){ds0[i]={};ds0[i][txtKey]=field[i]}if(keys){field=ds;i=-1;while(++i<len){field=field[keys[i]]}field[keys[len]]=ds0}else{ds=ds0}}dataOptions={callback:this._dataChange,dataSource:ds,requestType:verb,responseContentType:contentType,type:type||undefined,responseDataKey:key,responseTotalRecCountKey:o.responseTotalRecCountKey};field=this._noMouse()||this._cascFilter?null:o.filteringType;this._filtering=field==="local"?1:field==="remote"?-1:0;if(ds0){ds0=ds0[0];for(field in ds0){if(ds0.hasOwnProperty(field)){if(!txtKey){txtKey=o.valueKey=o.textKey=field}i=this._getType(ds0[field]);if(!vt&&field===o.valueKey){o.valueKeyType=vt=i}schema.fields.push({name:field,type:i});if(txtKey!==field&&o.valueKey!==field){o._all=1}}}}if(ds instanceof $.ig.DataSource&&!ds.settings.schema||!(ds instanceof $.ig.DataSource)){dataOptions=$.extend(dataOptions,{schema:schema})}if(ds instanceof $.ig.DataSource){binded=ds._data&&ds._data.length;dataOptions.dataSource=ds.settings.dataSource;ds.settings=$.extend(true,{},ds.settings,dataOptions);ds.settings.callee=this;if(dataOptions.schema){ds._initSchema()}}else{ds=new $.ig.DataSource(dataOptions);ds.settings.callee=this}tt=tt==="auto"?null:tt;schema=vt||tt?ds.schema():null;schema=schema?schema.fields():null;i=schema?schema.length:0;while((i-=1)>=0){field=schema[i];if(vt&&field.name===o.valueKey){field.type=vt}if(tt&&field.name===o.textKey){field.type=tt}}ds._response_data=function(data){var len=data?data.length:0,count=len>0?data[len-1][":totals:"]:null;if(count){data.pop();count=count.split(":");ds.totalRecordsCount(_aNull(len=parseInt(count[0],10),true)?0:len);len=_aNull(len=parseInt(count[1],10),true)?0:len;if(len){o._totalAll=len}}};delete this._lod;if(lod&&lod.enabled&&(url||dsStr)){setting=ds.settings.paging;setting.type="remote";setting.appendPage=setting.enabled=true;setting.pageSizeUrlKey=lod.pageSizeUrlKey||null;setting.pageIndexUrlKey=lod.pageIndexUrlKey||null;if(!_aNull(i=parseInt(o._total,10),true)){ds.totalRecordsCount(i)}lod=parseInt(lod.pageSize||30,10);setting.pageSize=this._lod=_aNull(lod,true)?30:Math.max(lod,5);setting.pageIndex=0}if(this._fire("dataBinding",null,{owner:this,dataSource:ds},1)){this._dataSource=ds;this._keyVal=this._hasData=this._key_=null;this._listRemove();if(binded){this._dataChange()}else{ds.dataBind()}}if(url&&!this._urlBind){setting=ds.settings;setting.dataSource=url;setting.type="remoteUrl";ds._runtimeType=ds.analyzeDataSource();setting.urlParamsEncoded=$.proxy(function(data,params){params=params?params.filteringParams:null;if(params){params.textKey=o.textKey||o.valueKey;params.valueKey=o.valueKey;if(!o.caseSensitive){params.toLower="1"}if(!o._all){params.compact="1"}if(o.parentComboKey){params.cascade=o.parentComboKey}}},this);this._urlBind=1;if(!o.dataSource){ds.dataBind()}}},_cond:function(o,paint){return o.autoComplete?"startsWith":paint||!this._filtering?o.renderMatchItems:o.filteringCondition},_isStrCond:function(cond){return cond==="startsWith"||cond==="endsWith"||cond==="contains"||cond==="doesNotContain"||cond==="empty"||cond==="notEmpty"},_texts:function(txt){var i,len,sepLen,render=txt===1,o=this.options,sep=this._multi(o)?this._sep():null;if(render||_aNull(txt)){txt=this._userTxt||this._oldTxt}else if(typeof txt!=="string"){return[txt]}if(!o.caseSensitive){txt=txt.toLowerCase()}if(!sep){return txt?[txt]:[]}while(txt.indexOf(sep+sep)>0){txt=txt.replace(sep+sep,sep)}sepLen=sep.length;len=txt.length;if(render){if((i=txt.lastIndexOf(sep.charAt(0)))>0&&i===len-1){txt=txt.substring(0,len-=1)}if((i=txt.lastIndexOf(sep))>0&&i===(len-=sepLen)){txt=txt.substring(0,len)}}else if((i=txt.lastIndexOf(sep.charAt(0)))>0&&i===len-1&&sepLen>1){txt+=sep.charAt(1)}if(txt.indexOf(sep)===0){txt=txt.substring(sepLen)}return txt?txt.split(sep):[]},_fillKeys:function(fix){if((fix||!this._keyFixed)&&this._key!==this._key_){var count=this._count;while((count-=1)>=0){this._item(count,2)}}this._keyFixed=1},_wait:function(on){var css=this.css.waitFiltering,load=this._loadInd,elem=this.mainElem,holder=this._itemsHolder;if(on){elem.addClass(css);if(holder){holder.addClass(css)}if(!load&&elem.igLoading){load=elem.igLoading().data("igLoading");if(load){this._loadInd=load=load.indicator()}}if(load){load.show()}}else if(elem){elem.removeClass(css);if(holder){holder.removeClass(css)}if(load){load.hide()}}},filter:function(e,txtNew,noFilter){var filter,key,i=-1,casc=this._cascFilter,txt=casc?this._cascVal:typeof txtNew==="string"?[txtNew]:txtNew instanceof Array?txtNew:this._texts(),len=casc?0:txt.length,cond=len?txt.toString():null,ds=this._dataSource,o=this.options,expr=[],remote=casc===-1||this._filtering<0;if(noFilter||this._hasData&&cond&&this._filterTxt===cond){return}if(this._expr){this._filterNew={txt:txt,e:e};return}this._filterTxt=cond;delete this._filterNew;if(remote&&len>1&&!txt[len-1]){len=0}if(casc){cond="equals";key=this._cascKey;expr.push({fieldName:key,cond:cond,expr:txt})}else{cond=this._cond(o);key=remote||!this._isStrCond(cond)?this._key:this._key_;while((i+=1)<len){expr.push({fieldName:key,cond:cond,expr:txt[i]})}}if(expr.length===0&&!e){return}if(!this._fire("filtering",e,this._expr={owner:this,expression:expr},1)){delete this._expr;
return}if(remote&&this._hasData&&!this._fire("dataBinding",null,{owner:this,dataSource:ds},1)){delete this._expr;return}if(!casc){this._needsSel=txt;this._needsSelEnd=this._multi(o)&&this._sepEnd(this.text())}filter=ds.settings.filtering;filter.caseSensitive=o.caseSensitive;filter.type=o.filteringType;if(remote){this._wait(true);key=o.filterExprUrlKey;if(key){filter.filterExprUrlKey=key}filter.expressions=expr;this._waitFilter=!this._hasData;if(this._lod){txt=txtNew!==null&&txtNew!==undefined?txtNew:this.text();if(this._lodTxt!==txt){this._lodTxt=txt;ds._data=[];ds._dataView=[];ds._filteredDataView=[];ds._cachedDataView=null;ds.settings.paging.pageIndex=0;ds.pageSizeDirty(true)}}ds.dataBind();return}if(expr.length===0||!this._hasData&&!casc){ds.clearLocalFilter()}else{this._fillKeys();ds.filter(expr,"OR",this._noFilter)}this._dataChange(e,true)},_checkExpr:function(){var change,filterNew=this._filterNew,expr=this._expr,len=filterNew&&filterNew.txt?filterNew.txt.length||0:0;if(!filterNew){return}if(expr){expr=expr.expression}if(len!==(expr?expr.length:0)){change=1}while(!change&&(len-=1)>=0){change=filterNew.txt[len]!==expr[len].expr}if(change){delete this._expr;this.filter(filterNew.e,filterNew.txt,this._noFilter);return 1}delete this._filterNew},_fixType:function(val){var fields,type=this.options.valueKeyType;if(!_aNull(val)){if(type==="number"){return typeof val==="number"?val:parseFloat(val)}if(type==="bool"){return val==="true"||val===true}if(type==="date"&&!val.getTime){val=val.toString();fields=val.replace(/[\. :]/g,"-").split("-");return fields.length===7?new Date(parseInt(fields[0],10),parseInt(fields[1],10)-1,parseInt(fields[2],10),parseInt(fields[3],10),parseInt(fields[4],10),parseInt(fields[5],10),parseInt(fields[6],10)):Date.parse(val)}}return val},_initSel:function(o){var item,val,id,ii,custom,more=1,selItems=o.selectedItems,len=selItems?selItems.length:0,i=-1;while(!this._multi(o)&&len>1){selItems.splice(len-=1,1)}id=len;while(id-->0){item=selItems[id];item.value=this._fixType(val=item.value)}custom=o.text||(len===1&&this._custom(o)?val:null);o.text=null;while((i+=1)<this._count&&more){val=this._item(i);more=null;id=len;while((id-=1)>=0){item=selItems[id];if(_aNull(ii=item.index)||ii<0){if(_equals(item.value,val)){if(this.isSelected(i)){selItems.splice(id,1);len-=1}else{item.index=i;item.text=this._item(i,2)}}else{more=1;if(i===this._count-1){selItems.splice(id,1)}}}else{item.value=item.value||this._item(ii);item.text=item.text||this._item(ii,2)}}}if(custom&&(!selItems||!selItems.length)){this.text(custom)}else if(!this.text()||!this._custom(o)){this._updateFromList(null,1)}},_dataChange:function(e,local){var count,txt,selLen,selItems,data,top,firstMatch,fullMatch,firstFullMatch,item,cond,lod=this._lodWait,casc=this._cascFilter,more=!casc,i=-1,actID=-1,sel=this._needsSel,id=-1,keyVal=this._keyVal,key=this._key,dd=this._itemsHolder,ds=this._dataSource,filter=casc||this._filtering,o=this.options;if(!o||!this._multi||this._cascUrl){return}selItems=o.selectedItems;if(casc&&(_aNull(this._cascVal,true)||this._cascVal==="")){filter=false}else{data=ds.dataView()}this._data=data=data||[];this._count=count=top=data.length;if(!this._hasData&&!count&&o.dataSourceUrl&&o.selectedItems){this._urlSel=1}if(!keyVal){keyVal=o.valueKey;if(!keyVal&&data[0]){for(keyVal in data[0]){if(data[0].hasOwnProperty(keyVal)){break}}}this._keyVal=keyVal;key=o.textKey||keyVal;this._key_=this._key=key;this._keyFixed=!o.format;if(!this._keyFixed){this._key_+="_"}}if(count&&!o.valueKeyType){while(++i<count){if(!_aNull(item=this._item(i))){o.valueKeyType=item===true||item===false?"bool":typeof item==="number"?"number":item.getTime?"date":"string";break}}i=selItems?selItems.length:0;while(i-->0){selItems[i].value=this._fixType(selItems[i].value)}this._cascSel=this._fixType(this._cascSel)}if(this._hasData){if(this._checkExpr()){return}if(this._urlSel===1){this._initSel(o);this._urlSel=2}else{if(this._urlSel||lod&&this.selectedIndex()<0&&!o.autoComplete){txt=this.text()}if(!lod){this._activate(-1,e);this._clearSel();this._lastScroll=this._virtualTop=this._topID=0;this._scrollTo=-1}if(dd){if(!lod){dd.empty()}this._listChanged=1}if(txt){this._select(null,txt,2)}}}if(this._expr){if(filter<0){this._fire("dataBound",null,{owner:this,dataSource:ds},1)}if(!this._isStrCond(cond=this._cond(o))){cond="startsWith"}if(this._ddOn||e&&e.type==="keydown"){this._doDrop(1,e)}this._fillKeys(1);selLen=sel&&!casc?sel.length:0;if(casc){this._initSel(o);item=selItems?selItems[0]:null;if(item){while(++id<count){if(item.value===this._item(id)){item.index=id;break}}if(id===count){o.selectedItems=null;this.fieldElem.val("")}}}selItems=[];while((id+=1)<count&&more){txt=this._item(id,2);i=-1;more=null;while((i+=1)<selLen){if(sel[i]){more=1;if(txt&&ds._findMatch(txt,sel[i],"string",!o.caseSensitive,cond)){item=null;if(!selItems[i]){selItems[i]=item=this._createSelItem(id,txt)}fullMatch=txt.length===sel[i].length;if(!firstMatch||fullMatch){firstMatch=1;top=Math.min(top,id);if(fullMatch){if(!firstFullMatch){top=id}firstFullMatch=1;selItems[i]=item||this._createSelItem(id,txt);sel[i]=null;if(!this._multi(o)){id=count+1}break}}}}}}if(selItems[0]){txt=selItems[0].text}while((selLen-=1)>=0){item=selItems[selLen];if(!item||actID<0&&!this._needsSelEnd){if(item){actID=item.index}if(!item||item.text!==txt){selItems.splice(selLen,1)}}}if(!casc){if(this._selChange(selItems,e)){this._selChanged(e);if(this._needsSelEnd){this._updateFromList(e,1,1)}}}if(actID<0&&count){item=this._item(0,2);txt=this.text();if(item&&txt){if(!o.caseSensitive){item=item.toLowerCase();txt=txt.toLowerCase()}if(item.indexOf(txt)===0){actID=0}}}if(actID>=0){this._activate(top=actID,e,1)}this._fixSelScroll(this._scrollTo=top===count?0:top);this._fire("filtered",e,this._expr,1);this._autoComplete(1);this._wait();delete this._waitFilter;delete this._expr}else{if(this._urlSel!==2){txt=this.text();sel=this.selectedIndex();if(txt&&!this._custom(o)&&sel<0){if(!this._hasData||!o.autoComplete){this._select(null,txt,2)}}else{if(e===true&&!_aNull(sel=sel<0?this._cascSel:null)){selItems=null;while(!selItems&&++id<count){if(this._item(id)===sel){selItems=[this._createSelItem(id,null,sel)]}}o.selectedItems=selItems;if(!selItems){this.fieldElem.val("")}delete this._cascSel}if(!casc){this._initSel(o)}}}this._fire("dataBound",null,{owner:this,dataSource:ds},1);if(this._urlSel===2&&!casc){this._noFilter=1;this._updateFromList(null,1);delete this._noFilter;delete this._urlSel}else if(filter){this.filter(null,null,this._noFilter)}if(this._ddOn){this._doDrop(1,e,1)}}if(this._mode(o)>1&&this.selectedIndex()<0&&this.value()===null){this.selectedIndex(0)}if(data.length<1){this._fire("noMatchFound",e,{owner:this,text:this.text()})}this._hasData=1;this._fixClear();this._fixNull();this._save(o);if(this._lodWait&&!local){this._wait();this._fixSel();delete this._lodWait}this._lodLbl();if(_cascWait){more=_cascWait[id=e=this.element[0]];if(!more){more=_cascWait[id=e.id]}count=more?more.length:0;while(count-->0){item=more[count];i=casc=item.options.parentCombo;if(i===id||i==="#"+id){casc=e}else{if(casc&&typeof casc==="string"){casc=$(casc);if(casc.length!==1){casc=$("#"+i)}}if(casc&&casc.element){casc=casc.element[0]}else if(casc&&casc.length===1){casc=casc[0]}}if(casc===e){if(_cascWait){delete _cascWait[id];for(key in _cascWait){if(_cascWait.hasOwnProperty(key)){casc=null;break}}if(casc){_cascWait=undefined}}item._cascade(false,false,this)}}}if(this._valTime===1){delete this._valTime;this.value(this._valLast,true)}},_locale:function(key){var val=this.options[key];if(_aNull(val)){val=$.ig.Combo&&$.ig.Combo.locale?$.ig.Combo.locale[key]:null}return val||""},_titles:function(){var val=this._locale("clearButtonTitle");this.clearElem.attr("title",val).attr("longdesc",val);val=this._locale("dropDownButtonTitle");this.buttonElem.attr("title",val).attr("longdesc",val)},_fire:function(t,e,a,fire){return this._canFire||fire?this._trigger(t,e,a):true},_same:function(old,val){if(old===val){return true}if(!old||!val||typeof val==="string"){return}var p1,p2,item,key,i=val.length;if(i!==old.length||_aNull(i)){return}while(i-->0){item=val[i];if(item&&!old[i]||!item&&old[i]){return}for(key in item){if(item.hasOwnProperty(key)){p1=item[key];p2=old[i][key];if(p1!==p2&&(p1&&!p2||!p1&&p2||!p1.getTime||!p2.getTime||p1.getTime()!==p2.getTime())){return}}}}return true},_setOption:function(key,val){var o=this.options,field=this.fieldElem,elem=this.mainElem;if(this._same(o[key],val)){return this}if(key==="selectedItems"){this._clearSel()}if(key.indexOf("virt")===0||key.indexOf("Match")>0||key.indexOf("empl")>0||key.indexOf("drop")===0||key==="caseSensitive"||key==="format"||key==="enableActiveItem"){o=null;delete this._it}if(key==="multiSelection"||!o){this._listRemove()}$.Widget.prototype._setOption.apply(this,arguments);if(key.indexOf("par")===0||key.indexOf("casc")===0||key.indexOf("useT")===0){this._cascade();return this}if(typeof val==="function"||!o){return this}if(key==="width"||key==="height"||key==="showDropDownButton"){this._lastHeight=null;this._doSize()}else if(key==="selectedItems"||key==="multiSelection"){this._initSel(o);this._updateFromList(null,1);this._fixNull()}else if(key.indexOf("Title")>0){this._titles()}else if(key.indexOf("dataS")===0||key.indexOf("fil")===0||key.indexOf("Key")>0||key.indexOf("OnDem")>0){this._hasData=false;this._lod=this._totalAll=o._totalAll=this._count=0;this.selectedIndex(-1);this.activeIndex(-1);this.dataBind()}else if(key==="enableClearButton"){this._fixClear(1)}else if(key==="tabIndex"||key==="disabled"){field.attr(key,val);this._fixClear()}else if(key==="mode"){field.attr("readOnly",this._mode(o)>0);this._fixClear()}else if(key==="enableDisplayBlock"){elem.css("display",val?"block":"inline-block")}else if(key==="itemSeparator"){this._updateFromList()}else if(key==="text"){this.text(val)}else if(key==="nullText"){this._fixNull()}else if(key==="validatorOptions"){this.validator()}return this}});$.extend($.ui.igCombo,{version:"14.1.20141.1020"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Dialog 14.1.20141.1020
*
* Copyright (c) 2011-2014 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
* jquery-1.6.1.js
* jqueryui/1.8.11/jquery-ui.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);self._elem=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);delete this._elem;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);this.element.draggable("destroy");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._elem},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._elem,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._elem.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},_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._elem.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._elem,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._elem.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._elem)).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(e){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._elem))}},_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()}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._elem;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._elem,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(!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._elem;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)}},_setFocus:function(elem){var self=this;setTimeout(function(){try{if(!self._hasFocus){if(!self.options.trackFocus){self._hasFocus=true}elem=elem||self._elem[0];elem.focus()}}catch(ex){}},100)},_restoreHtml:function(){var html,old=this._oldHtml;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._elem.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._elem;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._elem,pos;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(event,ui){$(this).addClass(self.css.resizing);pos=ui.originalPosition;if(o.pinned&&self._pinPos){elem.css(self._pinPos)}},resize:function(){self._fixCaption();elem.css(pos);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._elem,parent,position,offset,i,isRelative=false;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){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)}if(max){parents=this.element.parents();for(i=0;i<parents.length;i++){parent=$(parents[i]);position=parent.css("position");if(parent.is("body")){break}if(!parent.is("body")&&(position==="absolute"||position==="relative")){offset=parent.offset();elem.css({top:-offset.top,left:-offset.left});isRelative=true;break}}if(!isRelative){elem.css({top:0,left:0}).position(pos||_pos)}}else{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 ie7,zeroHeight=elem.css({width:width,height:"auto",display:"block"}).height(),nodeName=elem0[0].nodeName;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}if(nodeName!=="DIV"){if(nodeName==="IFRAME"){width-=_getPadding(elem0);ie7=$.ig.util.isIE7;if(!ie7||isNaN(ie7)||ie7>7){height+=5}}elem0.width(width-_getPadding(elem0,false,"margin"))}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._elem)}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,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,container=this.options.container,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._elem,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._elem,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);var isFocBind=this._focBind?true:false;if(key==="trackFocus"&&val!==isFocBind){if(this._opened){this._doClose();this._open()}else{this._open();this._doClose()}}}return this}});$.extend($.ui.igDialog,{version:"14.1.20141.1020"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Editors localization resources 14.1.20141.301
/*!@license
* Infragistics.Web.ClientUI Editors 14.1.20141.1020
*
* Copyright (c) 2011-2014 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
* jquery-1.4.4.js
* jquery.ui.core.js
* jquery.ui.widget.js
* jquery.ui.datepicker.js
* infragistics.util.js
*
* Example to use:
*	<script type="text/javascript">
*	$(function () {
*		$('#editor1').igEditor();
*	});
*	</script>
*	<input id="editor1" type="text" />
*/
(function($){var _aNull=function(v,nan){return v===null||v===undefined||nan&&typeof v==="number"&&isNaN(v)},_int=function(val,nan){val=parseInt(val,10);if(isNaN(val)){val=nan||0}return val},_pad_bdr=function(elem,horiz){var v1=horiz?"Left":"Top",v2=horiz?"Right":"Bottom";return _int(elem.css("padding"+v1))+_int(elem.css("padding"+v2))+_int(elem.css("border"+v1+"Width"))+_int(elem.css("border"+v2+"Width"))},_str=function(v){return _aNull(v)?"":v.toString()},_now=function(){return(new Date).getTime()},_offset=function(e,xy){return $.ig.util?$.ig.util.offset(e,xy):xy||(e?e.offset():null)},_stop=function(e){try{e.preventDefault();e.stopPropagation()}catch(ignore){}};$.ig=$.ig||{};$.widget("ui.igEditor",{options:{value:null,tabIndex:null,nullText:null,button:"none",textAlign:null,listItems:null,theme:null,type:null,locale:null,width:null,height:null,validatorOptions:null,required:false,display:"inline-block",renderInContainer:false,selectionOnFocus:-1,readOnly:false,spinOnReadOnly:false,focusOnSpin:false,spinWrapAround:false,hideEnterKey:true,dropDownOnReadOnly:false,dropDownTriggers:"button,ctrl+arrow,alt+arrow",listDropDownAsChild:false,listWidth:0,listMaxHeight:300,listColumns:1,animationShowDuration:200,animationHideDuration:200,inputName:null},events:{keydown:0,keypress:1,keyup:2,mousedown:3,mouseup:4,mousemove:5,mouseover:6,mouseleave:7,focus:8,blur:9,valueChanging:10,valueChanged:11,textChanged:12,invalidValue:13,spin:14,buttonClick:15,showDropDown:16,hideDropDown:17,listSelecting:18,listSelected:19},css:{editor:"ui-igedit ui-state-default ui-widget ui-corner-all",container:"ui-igedit-container",field:"ui-igedit-field",fieldRtl:"ui-igedit-rtl",textArea:"ui-igedit-textarea",hover:"ui-igedit-hover ui-state-hover",focus:"ui-igedit-focus ui-state-focus",buttonsImageStateOverride:"ui-igedit-buttonsimagestateoverride",disabled:"ui-igedit-disabled ui-state-disabled",negative:"ui-igedit-negative",nullValue:"ui-igedit-nullvalue",button:"ui-igedit-button",buttonRtl:"ui-igedit-button-rtl",buttonFocus:"ui-igedit-buttonfocus",buttonDefault:"ui-igedit-buttondefault ui-state-default",buttonHover:"ui-igedit-buttonhover ui-state-hover",buttonPressed:"ui-igedit-buttonpressed ui-state-highlight",buttonDisabled:"ui-igedit-buttondisabled ui-state-disabled",buttonImage:"ui-igedit-buttonimage ui-icon-triangle-1-s ui-icon",buttonClear:"ui-igedit-buttonclear",buttonClearImage:"ui-igedit-buttonimage ui-icon-circle-close ui-icon",buttonImageHover:"ui-igedit-buttonimagehover",buttonImagePressed:"ui-igedit-buttonimagepressed",buttonImageDisabled:"ui-igedit-buttonimagedisabled",spinButton:"ui-igedit-spinbutton",spinButtonImage:"ui-igedit-buttonimage ui-igedit-spinbuttonimage",spinLowerImage:"ui-igedit-spinlowerimage ui-icon-carat-1-s ui-icon",spinLowerImageHover:"ui-igedit-spinlowerimagehover",spinLowerImagePressed:"ui-igedit-spinlowerimagepressed",spinLowerImageDisabled:"ui-igedit-spinlowerimagedisabled",spinUpperImage:"ui-igedit-spinupperimage ui-icon-carat-1-n ui-icon",spinUpperImageHover:"ui-igedit-spinupperimagehover",spinUpperImagePressed:"ui-igedit-spinupperimagepressed",spinUpperImageDisabled:"ui-igedit-spinupperimagedisabled",dropDown:"ui-igedit-dropdown",list:"ui-igedit-list ui-widget ui-widget-content ui-corner-all",listItem:"ui-igedit-listitem ui-state-default",listItemHover:"ui-igedit-listitemhover ui-state-hover",listItemSelected:"ui-igedit-listitemselected ui-state-highlight",listItemColumnBorder:"ui-igedit-listitemcolumnborder",noTopCorners:"ui-igedit-no-top-corners",noBottomCorners:"ui-igedit-no-bottom-corners"},regional:$.ig._regional||{},_create:function(type){var v,css=this.css,elem,field,align,oldCss,o=this.options,me=this,val=o.value;type=this._doType(_aNull(type)?o.type:type,val);if(typeof o.maxLength!=="number"){o.maxLength=0}if(typeof o.spinDelta!=="number"){o.spinDelta=1}o.nullable=o.nullable!==false;this._listID=-1;this._css=css.field;elem=this._element=this._render(this.element,o,css);if(o.display){elem.css("display",o.display)}if(type===3&&(!$.datepicker||this._ta)){throw new Error("The ui.igDatePicker depends on jquery.ui.datepicker and TEXTAREA/multiline is not supported")}if(this._ta){this._css+=" "+css.textArea}field=this._field;this._box=field[0].type==="checkbox";this._1e=field===elem;if(o.readOnly){field[0].readOnly="readonly"}align=o.textAlign;if(!align&&type>3){align="right"}if(align){field.css("textAlign",align)}field[0]._id=-1;field[0].disabled=o.disabled;this._hover=this._mouseDown=0;this._fix=1;this._fcs=-1;this._bad=0;this._k0=this._sel0=0;this._noPaste=0;this._fixMode(1);this._clearHide=false;me._evts=v={keydown:function(e){me._onEvt(e,0)},keypress:function(e){me._onEvt(e,1)},keyup:function(e){me._onEvt(e,2)},paste:function(e){me._onEvt(e,11)},beforecut:function(e){me._onEvt(e,11)},cut:function(e){me._onEvt(e,11)},drop:function(e){me._onEvt(e,11)},focus:function(e){me._onEvt(e,8)},blur:function(e){me._onEvt(e,9)}};field.bind(v);me._mEvts=v={mousedown:function(e){me._onEvt(e,3)},mouseup:function(e){me._onEvt(e,4)},mousemove:function(e){me._onEvt(e,5)},MSPointerOver:function(e){me._onEvt(e,26)},pointerover:function(e){me._onEvt(e,26)},mouseover:function(e){me._onEvt(e,6)},mouseleave:function(e){me._onEvt(e,7)}};if(this._buttons&&this._buttons[1]){v.DOMMouseScroll=function(e){me._onEvt(e,10)};v.mousewheel=function(e){me._onEvt(e,10)}}elem.bind(v);this._fcs=0;v=o.maxLength;if(v&&v>0){field[0].maxLength=v}v=o.tabIndex;if(!_aNull(v)){field[0].tabIndex=v}v=o._vsFormat;if(v&&val&&type>3&&typeof val!=="number"){val=parseFloat(this._txtAsNum(val.toString(),v,"-"))}this._setVal(_aNull(val)?this._value:val);if(this._val()===""){this._text=this._field[0].value=this._focTxt("",false,"")}this._fixCss();oldCss=this._oldCss;val=o.height;if(!val&&!this._1e){val=oldCss.height;if(val){val=val.indexOf("px")>0?_int(val):this.element.height()}}this._height(val);if(this._box){this._fixBC(field,field)}val=o.width;if(!val&&!this._1e){val=oldCss.width;if(val){val=val.indexOf("px")>0?_int(val):this.element.width()}}if(this._selElem){delete oldCss.width;delete oldCss.height}this._width(val);this._lastText=this._val();this._initValidator();this._doClear(o.value)},_doType:function(type,val){if(type==="text"){type=0}if(type==="mask"){type=1}if(type==="date"){type=2}if(type==="datepicker"){type=3}if(type==="numeric"){type=4}if(type==="currency"){type=5}if(type==="percent"){type=6}if(typeof type!=="number"||type<0||type>6){if(typeof val==="number"){type=4}else if(val&&val.getMonth){type=2}else{type=0}}this._type=type;return type},_render:function(elem,o,css){var spin,name,par,csso,inp,cont,oldC,oldA,i,obj,img,clear,buts,butCss,left=elem.css("direction")==="rtl",but=o.button,field=elem,sel=null;name=elem[0].nodeName;par=elem[0].parentNode;if(name){name=name.toUpperCase()}this._ta=name==="TEXTAREA";this._td=name==="TD";this._left=left;inp=name==="INPUT";sel=this._selElem=name==="SELECT";spin=but&&but.indexOf("spin")>=0;clear=but&&but.indexOf("clear")>=0;but=but&&but.indexOf("dropdown")>=0||sel&&!spin;if(clear||but||spin){buts=this._buttons=[]}cont=buts||o.renderInContainer||o.theme;oldC=this._oldCss={display:0};oldA=this._oldAttr={className:0,title:0};if(inp){oldA.value=0;inp=elem[0].type||"text";if(inp==="date"||inp==="number"){elem[0].type="text";oldA.type=inp}}else if(sel){sel=o.listItems;if(!sel){o.listItems=[];sel=elem[0].options;i=sel?sel.length:0;if(i>0){while(i-->0){obj=sel[i].value;img=sel[i].text;o.listItems[i]={value:obj,text:_aNull(img)?obj:img}}this._listID=elem[0].selectedIndex}sel=1}}else{oldA.innerHTML=0}if(inp||this._ta){oldA.disabled=oldA.readOnly=oldA.alt=oldC.textAlign=0}for(i in oldC){if(oldC.hasOwnProperty(i)){oldC[i]=elem.css(i)}}for(i in oldA){if(oldA.hasOwnProperty(i)){oldA[i]=elem[0][i]}}oldC.width=elem[0].style.width;oldC.height=elem[0].style.height;i=inp?oldA.value:sel?elem.val():oldA.innerHTML;if(i===o.nullText){i=""}if(!this._ta&&i){i=i.replace(/[\x09\x0a]/g,"")}this._value=i;if(inp||this._ta||sel){if(oldA.className){this._css+=" "+oldA.className}if(cont){this._swap=true;elem.css("display",sel?"none":"");elem=$("<span />");par.insertBefore(elem[0],field[0]);if(sel){field=$("<input />")}else{par.removeChild(field[0])}elem.css("display",oldC.display)}else{this._css+=" "+css.editor;this._field=elem;return this._field}}else{if(o.textMode==="textarea"||o.textMode==="multiline"){field=$("<textarea />");this._ta=1}else{field=$(o.textMode?'<input type="'+o.textMode+'"/>':"<input />")}elem[0].innerHTML=""}elem.addClass(css.editor+" "+css.container);if(o.theme){elem.addClass(o.theme)}this._field=field;butCss=css.button+" "+css.buttonDefault;if(left){butCss+=" "+css.buttonRtl;this._css+=" "+css.fieldRtl}i=buts?-1:6;inp=this;this._touchEvts={touchstart:function(e){inp.__touch=1;this._drag=null;_stop(e)},touchmove:function(e){this._drag=1;_stop(e)},touchend:function(){if(!this._drag){$(this).trigger("mousedown").trigger("mouseup")}}};while(i++<4){if(but&&i===0||clear&&i===3||spin&&(i===1||i===2)){if(i===0){csso=[butCss,css.buttonHover,css.buttonPressed,css.buttonDisabled,css.buttonImage,css.buttonImageHover,css.buttonImagePressed,css.buttonImageDisabled];sel="button"}else if(i===1){csso=[butCss+" "+css.spinButton,css.buttonHover,css.buttonPressed,css.buttonDisabled,css.spinButtonImage+" "+css.spinUpperImage,css.spinUpperImageHover,css.spinUpperImagePressed,css.spinUpperImageDisabled];sel="spinUpper"}else if(i===2){csso=[butCss+" "+css.spinButton,css.buttonHover,css.buttonPressed,css.buttonDisabled,css.spinButtonImage+" "+css.spinLowerImage,css.spinLowerImageHover,css.spinLowerImagePressed,css.spinLowerImageDisabled];sel="spinLower"}else{csso=[butCss+" "+this.css.buttonClear,css.buttonHover,css.buttonPressed,css.buttonDisabled,css.buttonClearImage,css.buttonImageHover,css.buttonImagePressed,css.buttonImageDisabled];sel="clear"}obj=buts[i]=$("<span />").addClass(csso[0]).appendTo(elem).bind(this._touchEvts);obj[0]._css=csso;obj[0].longdesc=obj[0].title=this._optVal(sel+"Title",1);img=$("<span />").addClass(csso[4]).appendTo(obj);img[0]._id=i+5;obj[0]._id=i+1}}field.appendTo(elem);return elem},_leftShift:function(){var left=0,buts=this._buttons,i=this._left&&buts?4:0;while(i-->0){if(buts[i]){left+=buts[i][0].offsetWidth}}return left},_val:function(){var field=this._field;return field?this._box?field[0].checked:this._nullT?"":field[0].value:""},_fixNull:function(){var txt,nullTxt=this.options.nullText;if(!this._field||!nullTxt&&!this._nullT){return}txt=this._val();this._nullT=null;if(txt===""&&nullTxt&&this._fcs<2){this._nullT=true;this._field[0].value=nullTxt}this._fixCss()},_focTxt:function(txt,foc,e){var nt=this.options.nullText;this._nullT=null;if(!foc&&txt===""&&nt&&(!_aNull(e)||this.options.readOnly)){txt=nt;this._nullT=true}return txt},validate:function(noLabel){return!this.options.validatorOptions||!this._doInvalid(null,noLabel?2:1)},isValid:function(){return!this._doInvalid(null,9)},_doInvalid:function(e,flag){if(!this._field){return}var ch,i,old,fixVal,val=this._val(),cancel=false,fac=1,inv=this._invPlus,o=this.options,type=this._type;this._inv=null;if(inv){i=0;fixVal=type}else if(o.required&&(!val||type===1&&!this.getValueByMode(0,"",1))){inv=1;fixVal=type}else if(type===0){if(!o.nullable&&!val){inv=1}}else if(type===1){val=this._txt;i=val.length;while(i-->0&&!inv){ch=val.charCodeAt(i);if(ch<21&&ch%2===1){val=this._getVal();inv={value:val,message:this._optVal("mask",2)}}}}else if(type<4){val=this._toDate(val,e==="",true,true);inv=this._inv}else{val=this._toNum(val,true,true);inv=this._inv;fac=this._prop(7);if(inv&&val&&fac>1){old=val;val/=fac;inv.value=val}}if(fixVal===1){val=this._txt}else if(fixVal){val=fixVal<4?this._toDate(val,e==="",true,true):this._toNum(val,true,true)}if(inv===1){val=null;inv={value:val,message:this._optVal("required",2)}}if(typeof inv==="string"){inv={value:val,message:inv}}if(flag===9){return inv}if(inv){cancel=this._fire(13,null,inv);if(val!==inv.value){val=inv.value;inv=null}if(old){if(inv){val=old}else{if(_aNull(val,1)){val=null}else if(val){val*=fac}}}if(type<=1&&!inv){this._setVal(val);return}}if(type>1&&type<4){this._isNull=_aNull(val);if(!this._isNull){this._date=val}if(val&&o.useLastGoodDate){this._goodD=val}}this._value=val;if(flag&&!cancel&&!this._setOpt){return this._doError(flag,null,inv?inv.message:null)}},_focusTxt:function(foc,e,txt0){var e0=e,txt="",o=this.options,type=this._type,d=null,prompt="";if(type===1){txt0=null;if(!_aNull(e)&&!foc){e=e!=="";if(e&&this._bad!==0){this._txt=this._setTxt(this._val(),5,true)}txt0=this._txt;if(!e){this._doInvalid(e0)}}txt=this._getTxt(foc?5:4,foc?o.promptChar:o.padChar,txt0)}else if(type===2||type===3){if(_aNull(txt0)){prompt=o.promptChar;if(_aNull(e)&&foc){return this._getTxt(5,prompt)}if(!_aNull(e)&&!foc){this._doInvalid(e);d=this._value}else if(!this._isNull){d=this._date}}else{d=this._toDate(txt0,foc,true)}txt=this._toTxt(d,foc,prompt,!_aNull(e))}else if(type>3){if(!_aNull(e)&&!foc){this._doInvalid()}txt=this._toTxtNum(this._value,foc)}else{txt=this._val();if(!_aNull(e)&&!foc){this._doInvalid(e)}}return this._focTxt(txt,foc,e)},_repaint:function(){if(this._field&&this._val()!==this._text){this._field[0].value=this._text}},_instant:function(p1,limit,f){var val,type=this._type,mode=this._dataMode;if(this._box){return this._val()}if(type===1){return this.getValueByMode(mode,p1,limit)}if(type===2||type===3){return this.getValueByMode(p1?0:mode,limit)}if(type>3){val=this._toNum(this._val(),limit);if(val&&(limit||f)&&!isNaN(val)&&mode>0){val/=this._prop(7)}return p1||mode>0?val:this._toTxtNum(val,mode===0)}return this._val()},_optVal:function(key,flag){var val=this._validator,o=this.options;if(flag===2){return val?val._loc(key):""}val=o[key];if(!_aNull(val)){return val}if(flag===3||flag===1){if(flag===1&&this._type===3){key="datePickerButtonTitle"}val=o.locale?o.locale[key]:null;return val||($.ig&&$.ig.Editor&&$.ig.Editor.locale?$.ig.Editor.locale[key]:null)||""}o=o.regional;if(typeof o==="string"){o=$.ig.regional[o]}if(o){val=o[key]}if(!o||_aNull(val)){val=$.ig.regional.defaults[key]}return _aNull(val)?this.regional[key]:val},_setOption:function(key,val){var v,old=val,dp=null,o=this.options,loc=key==="locale",reg=key==="regional",buts=this._buttons,field=this._field;if(o[key]===val||key==="textMode"||!field){return this}if(key==="buttonHidden"){this._butVis(null,val);return this}if(key==="theme"){if(this._1e){return this}for(v=0;v<3;v++){if(buts&&buts[v]){buts[v].css("height","")}}if(o.theme){this._element.removeClass(o.theme)}if(val){this._element.addClass(val)}this._listRemove();this._height(o.height);this._width(o.width)}if(key==="inputMask"&&this._type===1){old=this.getValueByMode(0," ",1);this._setMask(val);this._setTxt(old,0)}o[key]=val;if(typeof val==="function"){return this}if(reg&&this._dp){dp=this._dpRegion();if(dp){v=o.datepickerOptions=$.extend(o.datepickerOptions,dp);this._dpOption(v)}}v="buttonTitle";if((loc||key===v)&&buts&&buts[0]){buts[0][0].title=this._optVal(v,1)}v="spinUpperTitle";if((loc||key===v)&&buts&&buts[1]){buts[1][0].title=this._optVal(v,3)}v="spinLowerTitle";if((loc||key===v)&&buts&&buts[2]){buts[2][0].title=this._optVal(v,3)}v="clearTitle";if((loc||key===v)&&buts&&buts[3]){buts[3][0].title=this._optVal(v,3)}if(key==="disabled"){field[0].disabled=val;this._fixCss()}if(key==="display"){this._element.css(key,val)}if(key==="textAlign"){field.css(key,val)}if(key==="readOnly"){field[0].readOnly=val?"readonly":""}if(key==="maxLength"||key==="tabIndex"){field[0][key]=val}if(key==="value"){this.value(val)}if(key==="width"){this._width(val)}if(key==="height"){this._height(val)}v=key==="required";if(key==="validatorOptions"||v){this._initValidator(false,v)}if(key==="nullText"){this._fixNull()}if(key==="type"){this._doType(val);reg=3}key=key.toLowerCase();v=key.indexOf("minv")===0?1:key.indexOf("maxv")===0?2:key.indexOf("maxd")>=0||key.indexOf("mind")>=0?-1:0;if(key.indexOf("list")===0){this._listRemove()}else if(key.indexOf("an")===0){if(this._dp&&key.indexOf("show")>7){this._dpOption(key.indexOf("eff")>7?"showAnim":"duration",val)}}else if(key.indexOf("kero")>0){if(this._dp){this._dpOption(val)}}else if(key.indexOf("data")>=0||v||reg||!_aNull(this.regional[key])||key.indexOf("date")===0||key.indexOf("pat")>=0||key.indexOf("roup")>0||key.indexOf("sep")>=0||key.indexOf("ymb")>0){if(v>0&&this._dp){dp=$.data(field[0],"datepicker");if(dp){dp.settings[v===1?"minDate":"maxDate"]=null}}this._setOpt=true;this._listRemove();this._fixMode(reg===3?3:0);this._repaint();this._lastText=this._val();this._setOpt=null}return this},_dpRegion:function(){var reg=this.options.regional;return $.datepicker&&typeof reg==="string"?$.datepicker.regional[reg==="defaults"||reg==="en-US"?"":reg]:null},_dpOption:function(val,p){var old=this._getVal(1);if(val&&val.changeYear&&$.ig.util.isOpera){val.changeYear=false}this._field.datepicker("option",val,p);this._setVal(old)},getRegionalOption:function(name){return this._optVal(name)},field:function(){return this._field},mainElement:function(){return this._element},dropDownElement:function(){var el=this._ddList;if(this._type===3){el=$.datepicker;if(el){el=el._ig_dp===this?el.dpDiv:null}}return el||null},show:function(){return this._vis(true)},hide:function(){return this._vis()},remove:function(){var p,e=this._element;p=e&&e[0]?e[0].parentNode:null;if(p&&p.tagName){this._doError();this._doDrop();this._stopTimer();this._hadFocus=null;this._vAct();this._noPaste=this._fcs=this._k0=this._hover=this._mouseDown=0;this._fixCss();p.removeChild(e[0])}return this},dropDownVisible:function(showHide){if(!arguments.length){return!!this._ddOn}if(!showHide){this._doDrop()}else if(!this._ddOn){this._doDrop(1)}return this},findListItemIndex:function(text,ignoreCase,partial,contains){var item=this._find(_str(text),0,1,ignoreCase,partial,contains);return item?item.id:-1},addListItems:function(items,index){return this._listChange(items,index,2)},addListItem:function(item,index){return this._listChange([item],index,2)},removeListItem:function(item){return this._listChange(item,-1,1)},removeListItemAt:function(index){return this._listChange(null,index,1)},clearListItems:function(){return this._listChange(null,-1,0)},selectedListIndex:function(index){if(!arguments.length){return this._listID}this._listSelect(index)},getSelectedListItem:function(){var list=this.options.listItems,id=this._listID;return list&&id>=0?list[id]:null},hasInvalidMessage:function(){return this._validator?this._validator.isMessageDisplayed():false},validator:function(){return this._validator||null},text:function(val,flag){if(val===undefined){return this._val()}if(this._type>0){this._sTxt=1;if(this._type===1){this._setTxt(val,_aNull(flag)?5:1e3+flag)}else{this._setVal(val,true)}this._sTxt=0}else{if(val){this._nullT=null}this._text=val;this._repaint()}if(this._fix===1){this._old=this._instant(1,null,1)}return this},_df:function(date,f,val,h,m,s,ms){var utc=this.options.enableUTCDates;if(f===-1){return date&&utc?new Date(date.getTime()+date.getTimezoneOffset()*6e4):date}if(!date){date=new Date;if(utc){date.setUTCMinutes(date.getUTCMinutes()-date.getTimezoneOffset())}return date}if(!_aNull(h)){return utc?new Date(Date.UTC(date,f,val,h,m,s,ms)):new Date(date,f,val,h,m,s,ms)}if(_aNull(val)){if(f===0){return utc?date.getUTCFullYear():date.getFullYear()}if(f===1){return utc?date.getUTCMonth():date.getMonth()}if(f===2){return utc?date.getUTCDate():date.getDate()}if(f===3){return utc?date.getUTCHours():date.getHours()}if(f===4){return utc?date.getUTCMinutes():date.getMinutes()}if(f===5){return utc?date.getUTCSeconds():date.getSeconds()}return utc?date.getUTCMilliseconds():date.getMilliseconds()}if(f===0){if(utc){date.setUTCFullYear(val)}else{date.setFullYear(val)}}if(f===1){if(utc){date.setUTCMonth(val)}else{date.setMonth(val)}}if(f===2){if(utc){date.setUTCDate(val)}else{date.setDate(val)}}if(f===3){if(utc){date.setUTCHours(val)}else{date.setHours(val)}}if(f===4){if(utc){date.setUTCMinutes(val)}else{date.setMinutes(val)}}if(f===5){if(utc){date.setUTCSeconds(val)}else{date.setSeconds(val)}}if(f===6){if(utc){date.setUTCMilliseconds(val)}else{date.setMilliseconds(val)}}},value:function(val){if(val===undefined){val=this._getVal();return val===undefined?null:val}this._setVal(val,true);this._lastText=this._val();return this},_getVal:function(numDate){var o=this.options,val=this._instant(numDate,1);if(this._type>3){if(_aNull(val)){val=o.nullValue;if(this._dataMode<=0){return _str(val)}return o.nullable||!_aNull(val)?val:NaN}}return val},_set_val:function(val,obj){this._fix=0;this._setVal(val,obj);this._fix=1},_setVal:function(val,obj){var txt,max,type=this._type;if(!this._field){return}if(this._box){if(val!==true){val=val==="true"}this._field[0].checked=val}else if(type===1){this._setTxt(_str(val),this._dataMode)}else if(type===2||type===3){if(!_aNull(val)&&!val.getTime){val=val.toString();val=obj=this._toDate(val,this._dataMode<2)||this._toDate(val,true)}obj=val;val=this._limits(val);if(_aNull(val)){val=obj}this._txt=this._mask;this._isNull=_aNull(val);if(!this._isNull){this._toTxt(val,true,"",true)}else{val=this._df()}this._date=val;if(this.options.useLastGoodDate){this._goodD=val}this._text=this._focusTxt(this._fcs>1);this._repaint()}else if(type>3){if(_aNull(val,1)){val=null}if(val&&typeof val==="number"&&this._fix!==0){val*=this._prop(7)}val=this._toNum(val,true);txt=this._toTxtNum(val,this._fcs===2);max=this._prop(12);if(obj===2&&max>0&&txt.length>max){return}this._focTxt(txt);this._text=txt;this._value=val;this._repaint();this._fixCss()}else{this.text(_str(val))}if(this._fix===1&&type>0){this._old=this._instant(1,null,1)}txt=this.options.value=this._getVal();this._doClear(txt);this._fixNull();this._dtt();this._fixList(txt)},_fixList:function(val){var i=-1,list=this.options.listItems,len=list?list.length:0;if(len<1||!this._fix||_aNull(this._lastText)){return}if(!_aNull(val)){while(++i<len){if(list[i]===val){break}}if(i>=len){list=this._findItem(this._val(),-1);i=list?list.id:-1}}this._listSelect(i)},_doClear:function(val){if(this._buttons&&this._buttons[3]){this._butVis(!val||this._type<4&&!this.getValueByMode(0,val))}},_vis:function(show){var e=this._element;e.css("display",show?this.options.display:"none");this._fixHeight();this._doError();return this},_elemWidth:function(elem,val){if(elem&&val>1&&elem[0]._wd!==val){elem[0]._wd=val;val=Math.max(1,val-_pad_bdr(elem,1));elem.css("width",val);return true}},_elemHeight:function(elem,val,but){if(elem&&val>1&&elem[0]._ht!==val){elem[0]._ht=val;val=Math.max(1,val-_pad_bdr(elem));elem.css("height",val);if(but){elem.find("SPAN").css("marginTop",Math.floor((val-16)/2))}}},_fixSize:function(){var o=this.options,elem=this._element,width=elem?elem[0].offsetWidth:0,height=elem?elem[0].offsetHeight:0;if(width||height){if(this._oWidth!==width){this._fixWidth(!this._oWidth&&!o.width)}if(this._oHeight!==height){this._fixHeight(!this._oHeight&&!o.height)}this._oWidth=width;this._oHeight=height}this._doTimer()},_doTimer:function(){var me=this,timer=me._timer1,ok=me._heightOk&&!me._heightPerc&&me._widthOk&&!me._widthPerc;if(ok&&timer){clearInterval(timer);delete me._timer1}else if(!timer){me._timer1=setInterval(function(){me._fixSize()},200)}},_fixHeight:function(zero){if(!this._field||this._1e||this._heightOk&&!this._heightPerc){return 1}var field=this._field,elem=this._element,i=4,height=this._td||zero?0:Math.max(elem[0].offsetHeight-_pad_bdr(elem),0),buts=this._buttons;height=height||field[0].offsetHeight;if(height>1){if(this._heightPerc){height++}this._elemHeight(field,height);if(buts){while(i-->0){this._elemHeight(buts[i],height,1)}}this._heightOk=1}this._doTimer()},_fixWidth:function(zero){if(!this._field||this._1e||this._widthOk&&!this._widthPerc){return 1}var v,left,but,field=this._field,clearHide=this._clearHide,buttonHide=this.options.buttonHidden,elem=this._element,i=4,width=this._td||zero?0:Math.max(elem[0].offsetWidth-_pad_bdr(elem,1),0),minWidth=width,minField=3,buts=this._buttons;width=width||field[0].offsetWidth;if(width>0){if(buts){zero=this._td||zero?Math.max(width,100):0;width=zero||width;if(this._widthPerc||this._td){width--}while(i-->0){but=buts[i];if(but){if(i===0&&buttonHide||i===3&&clearHide){but.show()}but[0]._w=v=but[0].offsetWidth;if(zero&&!left){width-=v;left=zero=zero-v}width-=v;if(width<minField&&!zero){minWidth+=minField-width;left=width=minField}if(i===0&&buttonHide||i===3&&clearHide){but.hide()}}}if(zero||left){elem.css("width",zero||minWidth+minField)}}else if(zero&&elem[0].offsetWidth>width+4){elem.css("width",width)}this._wF=width;if(this._elemWidth(field,width)){this._listRemove()}i=v=buts?Math.min(width,9):0;while(v-->1&&i>3){left=field[0].offsetTop;for(i=0;i<4;i++){if(buts[i]&&Math.abs(buts[i][0].offsetTop-left)>10){this._elemWidth(field,--this._wF);break}}}if(buts){v=$.ig.util.isFF||$.ig.util.isIE&&($.ig.util.browserVersion!==9||parseFloat(document.documentMode)<9)?3:1;this._wF-=v;this._elemWidth(field,this._wF)}this._widthOk=1;this._butVis(clearHide,buttonHide)}this._doTimer()},_butVis:function(clear,dropdown){var but,i=-1,o=this.options,width=this._wF,buts=this._buttons,field=this._field;if(_aNull(clear)){but=1;clear=this._clearHide}if(_aNull(dropdown)){but=1;dropdown=o.buttonHidden}if(!buts||but&&clear===this._clearHide&&dropdown===o.buttonHidden){return}o.buttonHidden=dropdown;this._clearHide=clear;while(++i<2){but=buts[i*3];if(but){if(!i&&dropdown||i&&clear){but.hide();width+=but[0]._w}else{but.show();width-=but[0]._w}}}this._elemWidth(field,width)},_width:function(width){var field=this._field,elem=this._1e||this._td?field:this._element,buts=this._buttons,i=buts?4:0,val=_int(width);if(!field){return}if(this._widthOk){delete this._widthOk;delete this._widthPerc;elem[0]._wd=null;field[0]._wd=null;elem.css("width","");field.css("width","");while(i-->0){if(buts[i]){buts[i][0]._wd=null;buts[i].css("width","")}}}if(width){if(width.indexOf&&width.indexOf("px")<0&&width!==val.toString()){elem.css("width",width);this._widthPerc=!this._td&&width.indexOf("%")>0}else{this._elemWidth(elem,val)}}this._fixWidth(!width)},_height:function(height){var field=this._field,elem=this._1e||this._td?field:this._element,buts=this._buttons,i=buts?4:0,val=_int(height);if(!field){return}if(this._heightOk){delete this._heightOk;delete this._heightPerc;elem[0]._ht=null;field[0]._ht=null;elem.css("height","");field.css("height","");while(i-->0){if(buts[i]){buts[i][0]._ht=null;buts[i].css("height","")}}}if(height){if(height.indexOf&&height.indexOf("px")<0&&height!==val.toString()){elem.css("height",height);this._heightPerc=!this._td&&height.indexOf("%")>0}else{this._elemHeight(elem,val)}}this._fixHeight(!height)},_spin:function(delta){var sel,fac,txt,nul=this._nullT,o=this.options;if(this._box||!this._field){return}if(this._fcs<1&&o.focusOnSpin){this.setFocus();if(this._fcs<1){this._focSpin=delta;return}}if(this._fire(14,null,delta)){return}if(nul){this._nullT=null;this._fixCss()}txt=this._val();this.spin(delta);if(this._val()===txt){if(nul){this._nullT=nul;this._fixCss();return}if(this._type>3&&o.spinWrapAround&&!_aNull(this._prop(10))&&!_aNull(this._prop(11))){sel=this._sel0;fac=this._prop(7);if(!fac){fac=1}delta=this._limits(this._getVal(true)*fac,true);this._setVal(delta/fac,this._fcs);this.select(sel)}}if(this._val()!==txt){this._fire(12)}},_item:function(item){if(item&&!_aNull(item.text)){item=item.text}if(typeof item==="function"){item=item()}return _aNull(item)?"":item},_spinList:function(delta){var val,id,roll,len,list,o=this.options;list=o.listItems;len=list?list.length:0;if(len<1){return 1}delta=delta<0?1:-1;id=this._listID+delta;roll=o.spinWrapAround;if(id>=len){if(!roll){return}id=0}if(id<0){if(!roll){return}id=len-1}val=this._instant(1,null,1);if(val===this._item(list[id])){id+=delta;if(id<0){if(!roll){return}id=len-1}if(id>=len){if(!roll){return}id=0}}val=this._item(list[id]);if(!this._listSelect(id)){delete this._lastY;this._set_val(val)}},_doKey:function(k,ch,txt,len,sel0,sel1,bad,e){var maxDec,iDot,d09,ok,dot,min,decSep,minus,mask,ePow,maxLen=this._prop(12),type=this._type;if(type>0&&type<4){mask=this._mask;len=mask?mask.length:0;if(len<1||k<7||k>8&&k<32){k=0}if(bad){if(k===0||!(mask.indexOf(ch)>0||this._optVal("am").indexOf(ch)>=0||this._optVal("pm").indexOf(ch)>=0||k>=48&&k<=57)){_stop(e)}return}if(k===0){return}txt=this._txt;if(sel0!==sel1){while(--sel1>=sel0){txt=txt.substring(0,sel1)+mask.charAt(sel1)+txt.substring(sel1+1)}sel1++}else if(k===7){while(sel1<len&&mask.charCodeAt(sel1)>=22){sel1++}if(sel1>=len){return}txt=txt.substring(0,sel1)+mask.charAt(sel1)+txt.substring(sel1+1);sel1++}else if(k===8){while(sel1>0&&mask.charCodeAt(sel1-1)>=22){sel1--}if(sel1--<1){return}txt=txt.substring(0,sel1)+mask.charAt(sel1)+txt.substring(sel1+1)}if(k>8&&sel1<len){if(sel1>=len){return}sel0=this._maskKey(k,ch,txt,len,sel1,mask);if(sel0>=0){txt=this._txt;sel1=sel0}else{if(sel0===-1){return}while(mask.charCodeAt(sel1)>=22){if(++sel1>=len){return}}ch=this._maskFilter(mask.charCodeAt(sel1),ch,0);if(_aNull(ch)){return}txt=txt.substring(0,sel1)+ch+txt.substring(sel1+1);sel1++}}this._txt=txt;this._selKey=sel1;txt=this._focusTxt(true);this.select(this._selKey,0,txt);this._selKey=99999;this._listSelect(-1);return}if(type>3){decSep=this._prop(4);minus=this._isMinus(k);d09=k>=48&&k<=57;if(minus&&sel0===0){min=this._prop(10);if(!_aNull(min)&&min>=0){return _stop(e)}}if(bad){if(!(k<9||minus||d09||k===decSep.charCodeAt(0))){_stop(e)}return}if(sel0!==sel1){txt=txt.substring(0,sel0)+txt.substring(sel1);sel1=sel0;len=txt.length}else if(k===7){if(sel1++>=len||len<1){return}}else if(k===8){if(sel0--<1){return}}if(k<9||maxLen===0||maxLen>len){dot=k===decSep.charCodeAt(0);iDot=txt.indexOf(decSep);maxDec=this._prop(8);ok=d09||sel0===0&&minus||dot&&maxDec>0;ePow=this._ePow();mask=ePow?txt.indexOf(ePow):-1;if(ePow&&sel0>0){if((k===69||k===101)&&mask<0){ok=ch=ePow}if(dot&&mask>=0&&mask<sel0){ok=false}}if(mask<0&&d09&&iDot>=0&&sel0>iDot&&iDot+maxDec<len){if(sel0===len){ok=false}else{txt=txt.substring(0,--len)}}if(sel0>0&&minus&&txt.charAt(sel0-1).toUpperCase()==="E"&&txt.substring(sel0-1).indexOf("-")<0){ok=true}if(len>0&&sel0===0){if(this._isMinus(txt.charCodeAt(0))){ok=false}}if(k>8&&!ok){return}if(dot){if(iDot>=0){if(iDot===sel0||iDot===sel0-1){return}len--;if(iDot<sel0){sel0=--sel1}txt=txt.substring(0,iDot)+txt.substring(iDot+1)}if(mask<0&&sel0+maxDec<len){len=sel0+maxDec;txt=txt.substring(0,len)}}if(k>8&&sel1>=len){txt+=ch}else{txt=txt.substring(0,sel0)+ch+txt.substring(sel1)}}else{k=0}this.select(k>10?sel1+1:sel0,0,txt);this._listSelect(-1);return}if(sel0!==sel1){txt=txt.substring(0,sel0)+txt.substring(sel1);sel1=sel0;len=txt.length}else if(k===7){if(sel1++>=len||len===0){return}if(this._ta&&txt.charCodeAt(sel1-1)===13&&txt.charCodeAt(sel1)===10){sel1++}}else if(k===8){if(sel0--<1){return}if(this._ta&&txt.charCodeAt(sel0)===10&&txt.charCodeAt(sel0-1)===13){sel0--}}if(k<9||maxLen===0||maxLen>len){if(k>8&&sel1>=len){txt+=ch}else{txt=txt.substring(0,sel0)+ch+txt.substring(sel1)}}else{k=0}this._matchList(txt,k,k>10?sel1+1:sel0)},_matchList:function(txt,key,sel){var item;if(!this._field||this._type>0||key<0&&!this.options.listAutoComplete){return txt}item=this._findItem(txt,key,sel);if(!item){return null}this._listSelect(item.id);txt=item.text;if(key>=0){this.select(item.sel,0,txt)}else{this._field[0].value=txt}return txt},_findItem:function(txt,key,sel){var o=this.options;return this._find(txt,key,o.listMatchOnly,o.listMatchIgnoreCase,true,o.listMatchContains,sel)},_find:function(txt,key,matchOnly,noCase,partial,contains,sel){var item,up,part,inside=null,i=-1,many=0,shift=0,id=-1,str=txt,len=txt.length,items=this.options.listItems,match=key>=0&&matchOnly;if(len>0&&items&&(match||key<0)){part=match=-1;up=noCase;if(up){str=str.toUpperCase()}while(++i<items.length){item=this._item(items[i]);if(_aNull(item)){continue}item=item.toString();if(up){item=item.toUpperCase()}shift=item.indexOf(str);if(shift===0){if(item===str){match=i;break}many++;if(part<0){part=i}}else if(shift>0&&contains){if(!inside){inside={i:i,shift:shift}
}many++}}shift=0;if(part<0&&inside){part=inside.i;shift=inside.shift}if(match<0){if(!partial){return null}if(key<0){match=part}else if(part<0){return key>10&&len===sel?null:this._find(txt.substring(0,--len),key,matchOnly,noCase,contains,sel)}if(key>10&&many===1){match=part}else if(key>=0){txt=this._item(items[part]).toString().substring(0,len+shift)}}if(match>=0){txt=this._item(items[match]).toString();if(match===part){sel=txt.length}}id=match>=0?match:part}return{text:txt,id:id,sel:(_aNull(sel,1)?len:sel)+shift}},_undo:function(redo){var old,val=this._old;if(redo){if(!this._canRedo){return}val=this._redo;this._canRedo=false}else{old=this._instant(1,null,1);if(old===val){return}this._canRedo=true;this._redo=old}this._set_val(val);this._text=this._focusTxt(false);this._doError(1,this._evt)},_doKey0:function(e,a){var ch,up,len,excl,incl,bad=this._validator,me=this,t0=this._text,t1=this._val(),k=this._key,o=this.options;if(o.excelNavigationMode&&a!==1&&(k===38||k===40)){return}if(!this._field){return}if(!e){if(t0!==t1){this.paste(t1)}return}if(a===1&&k===192&&e.altKey&&!e.ctrlKey){return}if(a===1&&this._bad&&this._k0===229){this.getSelectedText();this._bad=0}if(this._type>0&&$.ig.util.isOpera&&k>41&&k<48){if(a===0){this._noKey=k}else if(this._noKey===k){_stop(e)}}if(a!==1){this._noPaste=2-a}else if(this._noPaste!==2){this._noPaste=1}if(k===9){this._k0=a===2?0:9;if(a===0&&bad&&bad._lbl){bad._onTab(e)}}if(k===0||k===114&&a!==1||k===9){return}if(this._bad>2){if(a===0){this._bad=2}if(a===2){this._bad-=3}}if(a===0&&k===229){if(t0!==t1){this._bad=2}else{this._bad+=3}}if(k===13&&this._k0===229&&this._type===1){this._txt=this._setTxt(this._val(),5,true)}if(a===0&&e.ctrlKey&&!e.altKey&&(k===90||k===89)){this._undo(k===89);return}if(this._bad===2||a===1&&e.ctrlKey){return}if(a===0&&!e.ctrlKey&&!e.altKey&&!e.shiftKey){if(this._listKey(e,k)){this._kBad=k;return _stop(e)}}if(this._box){return}if(a===1&&k===this._kBad){return _stop(e)}this._kBad=null;if(a===0&&(e.ctrlKey&&(k===86||k===88)||e.shiftKey&&k===45)){setTimeout(function(){me._doKey0()},1)}if(a!==1&&(e.ctrlKey||e.altKey||k===17)){if(e.altKey){this._k0=-1}else if(t0!==t1&&(k===86||k===17&&a===2)){this.paste(t1);this._noPaste=1}else if(k===17){this.getSelectedText()}return}if(a===0){this._k0=k}if(a===2){if(this._k0>0){this._k0=0}this._spinField=-1}len=t1.length;bad=this._bad!==0;if(k<=46){switch(k){case 8:case 46:if(this._k0===k&&a===1){a=2}if(a===0){a=1;if(k===46){k=7}}break;case 27:_stop(e);if(a===0){this._undo();if(!this._escFix){this._escTxt=this._field[0].value}}else{if(this._escFix&&this._escTxt!==t1&&!_aNull(this._escTxt)){this._field[0].value=this._escTxt;delete this._escTxt}if(a===1){this._escFix=1}else{delete this._escFix}}return;case 13:if(o.hideEnterKey){if(!this._ta||!e.shiftKey||this._type>0&&this._ta&&e.shiftKey){_stop(e)}}else{me._update()}return;case 38:case 40:if(this._ta){break}if(a===0&&!e.shiftKey){this._spin(k===38?o.spinDelta:-o.spinDelta)}if(this._k0===k){a=2}break}}if(a===1&&k===this._k0&&(k<48&&k>9&&k!==32||k>90)){return}if(!bad){if(a!==0&&k!==9){_stop(e)}if(a===1&&this._k0===-1){this._k0=0;this.getSelectedText()}if(a===0||k<9){this.getSelectedText()}}if(a===1&&k>6){if(k>31){if(this._fire(1,e)){if(bad){_stop(e)}return}k=this._key;excl=o.excludeKeys;incl=o.includeKeys;if(o.toUpper||o.toLower||excl||incl){ch=String.fromCharCode(k);up=ch.toUpperCase();if(excl&&excl.toUpperCase().indexOf(up)>=0||incl&&incl.toUpperCase().indexOf(up)<0){return _stop(e)}if(o.toUpper){k=up.charCodeAt(0)}else if(o.toLower){k=ch.toLowerCase().charCodeAt(0)}this._key=k}}this._doKey(k,k<10?"":String.fromCharCode(k),t1,len,this._sel0,this._sel1,bad,e)}},paste:function(txt,flag){var prop,last=this._pasted,o=this.options;if(last&&_now()-last.now<10&&(last.txt===txt||last.val===txt)){return this}this._pasted=last=last||{};last.now=_now();last.txt=txt;if(this._nullT&&!flag||this._noPaste===1){return this}prop=this._prop(12);if(prop>0&&prop<txt.length){txt=txt.substring(0,prop)}prop=o.includeKeys;if(prop){prop=prop.toUpperCase().replace(/\[/gm,"\\[").replace(/\]/gm,"\\]").replace(/\^/gm,"\\^").replace(/\-/gm,"\\-");txt=txt.replace(new RegExp("[^"+prop+"]","igm"),"")}prop=o.excludeKeys;if(prop){prop=prop.toUpperCase().replace(/\[/gm,"\\[").replace(/\]/gm,"\\]").replace(/\^/gm,"\\^").replace(/\-/gm,"\\-");txt=txt.replace(new RegExp("["+prop+"]","igm"),"")}if(o.toUpper){txt=txt.toUpperCase()}else if(o.toLower){txt=txt.toLowerCase()}txt=this._matchList(txt,0);if(_aNull(txt)){txt=this._text}this._text="";this._fix=0;this.text(txt,flag?null:this._sel0);this._fix=1;this._fire(12);last.val=this._field[0].value;return this},_touch:function(act){var scroll,dd=this._ddList;if(dd&&dd.igScroll){scroll=dd.data("igScroll");if(!act){return scroll?scroll.barY:dd.igScroll({direction:"y",yThumb:"draggable",yScroller:this._ddScroll,cancelStart:"ms"}).attr("data-scroll","y")}if(scroll){scroll[act](true)}}},_fixCss:function(){var but,i,dis,csso,elem=this._element,old=this._hoverOld,hov=this._hover,down=this._mouseDown,foc=this._fcs>0,o=this.options,dd=this._ddList,css=this._css,border="";if(!this._field){return}dis=o.disabled;csso=this.css;if(foc){elem.addClass(csso.focus)}else{elem.removeClass(csso.focus)}if(hov){elem.addClass(csso.hover)}else{elem.removeClass(csso.hover)}this._hoverOld=hov;if(!old||old===hov){old=0}if(old>99){if(!dd){return}this._listCss(dd,old,csso.listItemHover)}if(hov>99&&!this._touch()){this._listCss(dd,hov,csso.listItemHover,1)}if(dis){css+=" "+csso.disabled}if(this._nullT){css+=" "+csso.nullValue}if(this._type>3&&csso.negative&&!this._nullT){if(this._instant(1)<0){css+=" "+csso.negative}}this._setCss(this._field,css);i=this._buttons?4:0;while(i-->0){but=this._buttons[i];if(!but){continue}csso=but[0]._css;css=csso[0];if(dis){css+=" "+csso[3]}if(hov===i+1){css+=" "+csso[1]}if(foc){css+=" "+this.css.buttonFocus}if(down===i+1){css+=" "+csso[2]}this._setCss(but,css+border);css=csso[4];if(dis){css+=" "+csso[7]}if(down===i+1){css+=" "+csso[6]}else if(hov===i+1){css+=" "+csso[5]}else if(hov||foc){css+=" "+this.css.buttonsImageStateOverride}this._setCss(but.find("SPAN"),css)}},_setCss:function(obj,css){var cur=obj[0].className,old=obj[0]._ig_oldCss;obj[0]._ig_oldCss=css;if(css===old){return}if(old&&cur&&old!==cur&&cur.indexOf(old)>=0){cur=cur.replace(old,"");css+=(cur.charAt(0)!==" "?" ":"")+cur}obj[0].className=css},_enterTxt:function(){var d,type=this._type;if(type===1){return this._getTxt(this._dataMode,"")}if(type===2||type===3){d=this._toDate(this._val(),true);return _aNull(d)?"":this._toTxt(d,true,"")}if(type>3){return this._toTxtNum(null,true,this._val(),"-",".")}return this._val()},_update:function(){var v,old=this._old;if(this._lock){return}this._lock=true;this._text=this._focusTxt(false,this._fcs===2||this._hadFocus?"":null);v=this._instant(1,null,1);if(!_aNull(v)&&!_aNull(old)){if(v.getTime&&v.getTime()===old.getTime()){v=old}}if(v!==old||this._bad===2){this._val10=v;if(this._fire(10,null,v,old)){this._set_val(old);this._text=this._focusTxt(false)}else{if(v!==this._val10){this._setVal(this._val10)}this._repaint();this.options.value=v=this._instant(1,null,1);this._fire(11,null,v,old);if(this._k0!==13){this._old=this.options.value}this._dtt()}}this._lock=false},_dropTrigger:function(e,k){var len,ch,acts,o=this.options,on=this._ddOn;acts=o.dropDownTriggers;if(k===0||!acts||o.readOnly&&!o.dropDownOnReadOnly||k===-2&&acts.indexOf("button")<0||k===-1&&acts.indexOf("focus")<0){return}if(k===38&&!on||k===40&&on){return}if(k>0){ch=k===38||k===40?"arrow":String.fromCharCode(k);if(e.ctrlKey){ch="ctrl+"+ch}else if(e.altKey){ch="alt+"+ch}else if(e.shiftKey){ch="shift+"+ch}len=ch.length;ch=acts.indexOf(ch);if(ch<0||ch>0&&acts.charAt(ch-1)!==","||ch+len<acts.length&&acts.charAt(ch+len)!==","){return}}if(!on||k!==-1||_now()-on>900){return this._doDrop(1,e)}},_doDP:function(act,sel){var odp,dp,field,id,o=this.options,v=o.focusOnDropDownOpen;if(!this._field||this._type!==3){return}if(!this._dp&&act!==1){return 1}if(_aNull(this._mobile)){try{this._mobile=this.__touch||window.navigator.userAgent.toLowerCase().indexOf("mobile")>0}catch(ex){}}if(_aNull(v)){this._noFocus=this._mobile}else{this._noFocus=!v}if(sel){this._set_val(sel);this._fire(12)}dp=$.datepicker;field=this._field[0];id=field.id;if(!dp._old_selectDay){dp._old_selectDay=dp._selectDay;dp._old_parseDate=dp.parseDate;dp._old_updateDatepicker=dp._updateDatepicker;dp._old_checkOffset=dp._checkOffset;dp.dpDiv.bind("mousedown",function(evt){var dp=$.datepicker._ig_dp;if(dp){if(evt.target&&evt.target.nodeName==="SELECT"){dp._ddmd=_now();dp._ddnf=$.ig.util.isFF||dp.__touch}else{_stop(evt)}}});dp._selectDay=function(id,month,year,td){var me=this._ig_dp;if(!me){return this._old_selectDay(id,month,year,td)}id=$("a",td).html()||td.firstChild.innerHTML;me._doDrop(0,{type:"mousedown"},[year,month,_int(id)],1);me._xyCheck(true)};dp._updateDatepicker=function(inst){var field,me=this._ig_dp;if(me){this._ig_css=me.css.dropDown;this.dpDiv.addClass(this._ig_css);if(me._noFocus){field=me._field[0];if(field.disabled){field=null}}}else if(this._ig_css){this.dpDiv.removeClass(this._ig_css);delete this._ig_css}if(field){field.disabled=true}this._old_updateDatepicker(inst);if(field){field.disabled=false}if(me){this.dpDiv.find("*").attr("unselectable","on")}};dp.parseDate=function(a,b,c){return this._ig_dp?this._ig_dp._df(this._ig_dp._getVal(1),-1):this._old_parseDate(a,b,c)};dp._checkOffset=function(inst,offset,isFixed){var xy,me=this._ig_dp;offset=this._old_checkOffset(inst,offset,isFixed);if(me){offset.left-=me._leftShift();_offset(null,offset);xy=_offset(me._swap?me._field:me._element);me._xy={x:xy.left,y:xy.top,i:setInterval(function(){me._xyCheck()},300)}}return offset}}if(act===1){v=dp._ig_dp;if(v&&v!==this){delete dp._ig_dp;v._doDrop()}if(id.length<1){id=this.element[0].id+"_ig_dp_id";while(document.getElementById(id)){id+=Math.floor(Math.random()*10)}field.id=id}if(!this._dp){odp=$.extend(o.datepickerOptions,this._dpRegion())||{};v=o.animationShowDuration;if(v){odp.duration=v}v=o.animationShowEffect;if(v){odp.showAnim=v}odp.showOn="";odp.onClose=function(){var me=dp._ig_dp;if(me){if(me._fcs&&me._ddnf&&me._ddnf.type){me._onEvt(me._ddnf,9)}me._dpClosed=1;me._doDrop();delete me._dpClosed;delete dp._ig_dp}};this._dp=$(field).datepicker(odp)}odp=$.data(field,"datepicker").settings;odp.minDate=odp.minDate||o.minValue;odp.maxDate=odp.maxDate||o.maxValue;if($.ig.util.isOpera){odp.changeYear=false}dp._ig_dp=this;this._css+=" "+$.datepicker.markerClassName;if(this._noFocus){field.disabled=true}else if(this._fcs<1){this.setFocus(-1)}dp._showDatepicker(field);if(this._noFocus){field.disabled=false;try{dp._dummyFocus=dp._dummyFocus||(this._mobile?$("<button />").css("position","absolute").css("top","-100px").appendTo(document.body)[0]:dp.dpDiv[0]);dp._dummyFocus.focus()}catch(ex){}}}else if(act===2){dp._doKeyUp({target:field})}else{this._xyCheck(true);if(!this._dpClosed){dp._hideDatepicker(field)}if(act===3){dp._destroyDatepicker(field)}}return 1},_fixBC:function(src,e){src=src.css("backgroundColor");e.css("backgroundColor",!src||src==="transparent"||src.replace(/ /g,"").indexOf("(0,0,0,0")>0?"white":src)},_xyCheck:function(stop){var xy=this._xy,xyE=this._swap?this._field:this._element;if(!xy){return}if(xyE){xyE=_offset(xyE);if(Math.abs(xyE.left-xy.x)>2||Math.abs(xyE.top-xy.y)>2){stop=true}}if(stop||!xyE||!this._ddOn){delete this._xy;clearInterval(xy.i);this._doDrop()}},_vAct:function(act){return $.ui.igValidator&&$.ui.igValidator._act(this,act)},_doDrop:function(act,e,sel,dp){var borderClr,widthOuter,heightOuter,height,up,ht,y,b,row,col,cols,rows,dif,cell,max,end,el,xy,effect,width,dd,elem,body,len,items,heightEnd,par=this._ddParent,i=-1,val=sel,me=this,o=this.options;items=o.listItems;act=act===1?!this._ddOn:false;if(!act&&!this._ddOn&&!dp){return}if(!me._field||me._vAct(act?"drop":"hide")){return}len=items?items.length:0;if(this._type===3){if(sel&&!isNaN(sel[2])){val=this._getVal(1);if(!val){val=this._df(sel[0],sel[1],sel[2],0,0,0,0)}else{val=this._df(sel[0],sel[1],sel[2],this._df(val,3),this._df(val,4),this._df(val,5),this._df(val,6))}}}else{if(len<1){return}if(sel){val=this._item(items[sel-100])}}if(this._fire(act?16:17,e,act?null:{value:val})&&e){return}this._ddOn=act?_now():null;if(this._type===3){return this._doDP(act?1:0,val)}dd=me._ddList;elem=me._element;body=!o.listDropDownAsChild||elem===me._field;if(!dd){dd=me._ddList=$("<div/>").addClass(me.css.dropDown+" "+me.css.list).scroll(function(){me._lazy()});dd[0]._id=99;me._ddSel=-1;me._ddLen=len;dd.css({position:"absolute",visibility:"hidden"});width=o.listWidth;if(width<5){width=elem.outerWidth();if(width<5){width=100}}if(body){me._ddParent=par=o.theme?$("<span/>").addClass(o.theme).css("position","absolute").append(dd):dd;MSApp.execUnsafeLocalFunction(function(){par.css({left:"0px",top:"0px"}).appendTo($("body"))});dd.bind(me._mEvts)}else{me._ddParent=par=dd.prependTo(elem)}borderClr=dd.css("borderRightColor");cols=Math.max(1,o.listColumns);rows=me._rows=Math.ceil(len/cols);dif=dd.outerWidth()-dd.width();width=Math.ceil((width-dif)/cols-1);me._listLazy=[];for(col=0;col<cols;col++){for(row=0;row<rows;row++){if(++i>=len){break}cell='<div style="width:'+width+"px;position:absolute;white-space:nowrap;overflow:hidden;";val=me._item(items[i]);if(typeof val!=="string"){if(me._type>=4&&typeof val==="number"){val=me._toTxtNum(val)}else if(val&&me._type===2&&val.getMonth){val=me._toTxt(val)}else{val=_str(val)}}el=items[i];if(el&&typeof el.getHtml==="function"){el=el.getHtml()||val}else{el=val}if(i>0){cell+="height:"+height+"px;left:"+col*widthOuter+"px;top:"+row*heightOuter+"px;"}if(col+1<cols){cell+="border-right-color:"+borderClr}cell+='" title="'+me._item(items[i])+'" _id="'+(i+100)+'" class="'+me.css.listItem;if(col+1<cols){cell+=" "+me.css.listItemColumnBorder}cell+='">'+(el===""?"&nbsp;":el)+"</div>";if(i===0||i+1===len){MSApp.execUnsafeLocalFunction(function(){cell=$(cell).appendTo(dd)});cell[0]._id=i+100}else{me._listLazy[i]=cell}if(i===0){height=cell.height();if(height<5){height=18}dif=cell.outerWidth()-cell.width();if(dif>0){width-=dif;cell.css("width",width)}widthOuter=cell.outerWidth()+1;me._ddWidth=widthOuter*cols;me._ddHeight0=heightOuter=cell.outerHeight();me._ddHeight=me._ddHeight0*rows;me._fixBC(cell,dd);max=Math.max(0,o.listMaxHeight);if(max>0&&me._ddHeight>max){me._ddHeight=max;max=Math.ceil(16/cols);width-=max;cell.css("width",width);widthOuter-=max}else{max=0}dd.css("overflow",max>0?"auto":"hidden");cell.css({height:height,left:col*widthOuter,top:row*heightOuter})}}}me._page=Math.max(2,Math.floor(Math.min(me._ddHeight/height),len/3)-1)}if(sel){if(!me._listSelect(sel-100)){val=this._item(items[sel-100]);me._set_val(val);me._fire(12)}}if(!act){me._lastY=dd[0].scrollTop}else if(me._lastY){dd[0].scrollTop=me._lastY}me._listSelect(null,1);val=act?o.animationShowDuration:o.animationHideDuration;if(!val||typeof val==="number"&&val<5){val=null}else{effect=act?o.animationShowEffect:o.animationHideEffect;if(!$.effects||!$.effects[effect]){if(!act&&typeof val!=="number"){val=450}effect=null}}heightEnd=val&&!effect?0:me._ddHeight;end=function(){if(act){dd.css("filter","");if(!sel&&me._lastY){dd[0].scrollTop=me._lastY}else{me._listSelect()}i=dd[0].scrollWidth-dd[0].clientWidth;if(!me._ddFixW&&i>0&&i&&i<4){me._ddFixW=++i;me._ddWidth+=i;dd.css("width",me._ddWidth)}me._touch()}else{dd.css({display:"none",visibility:"hidden"});me._touch("_hide")}};if(act){this._lazy();if(me._fcs<1){me.setFocus()}ht=999;b=document.body;el=document.documentElement;i=window.innerHeight;if(i>50&&i){ht=i}else if(el.clientHeight>50&&el.clientHeight){ht=el.clientHeight}else if(b.clientHeight>50&&b.clientHeight){ht=b.clientHeight}y=Math.max(window.pageYOffset||0,Math.max(b.scrollTop,el.scrollTop));el=me._swap?me._field:elem;xy=_offset(el);me._xy=body?{x:xy.left,y:xy.top}:null;xy.h=el[0].offsetHeight;up=xy.top+xy.h+me._ddHeight-y-ht;if(up>0&&y-xy.top+me._ddHeight<up){up=me._ddHeight+2;if(xy.top-up<y){up=Math.max(xy.top-y,2)}xy.h=-up;xy.top+=xy.h;heightEnd=me._ddHeight;elem.addClass(me.css.noTopCorners);dd.addClass(me.css.noBottomCorners)}else{xy.top+=xy.h;elem.addClass(me.css.noBottomCorners);dd.addClass(me.css.noTopCorners)}dd.css({opacity:val&&!effect?0:1,height:heightEnd,width:Math.floor(me._ddWidth/(val&&!effect?2:1)),display:"",visibility:"visible"});if(body){if(me._swap){xy.left-=me._leftShift()}xy.left-=_int(elem.css("borderLeftWidth"));par.css({left:xy.left,top:xy.top});me._xy.i=setInterval(function(){me._xyCheck()},300)}else{i=me._left?"Right":"Left";par.css("margin"+i,-_int(elem.css("border"+i+"Width"))+"px");par.css("marginTop",xy.h);up=_offset(par).left-xy.left;if(up>30&&up<elem[0].offsetWidth+10){par.css("marginLeft",-up+"px")}}if(!val){end()}else if(effect){dd.show(effect,{},val,end)}else{dd.animate({opacity:1,height:me._ddHeight,width:me._ddWidth},val,null,end)}}else{me._xyCheck(true);elem.removeClass(me.css.noTopCorners).removeClass(me.css.noBottomCorners);dd.removeClass(me.css.noBottomCorners).removeClass(me.css.noTopCorners);if(!val){end()}else if(effect){dd.hide(effect,{},val,end)}else{dd.animate({opacity:.6},Math.floor(val*.34)).animate({opacity:0,height:heightEnd,width:Math.floor(me._ddWidth/2)},Math.floor(val*.66),null,end)}}return true},_lazy:function(i){var id,j,cols=Math.max(1,this.options.listColumns),items=this._listLazy,dd=this._ddOn?this._ddList:null;if(!dd){return}if(i){if(items[i]){MSApp.execUnsafeLocalFunction(function(){$(items[i]).appendTo(dd)[0]._id=i+100;delete items[i]})}return}id=Math.floor(dd[0].scrollTop/this._ddHeight0);while(cols-->0){for(i=0;i<this._page+8;i++){j=this._rows*cols+id+i;if(items[j]){MSApp.execUnsafeLocalFunction(function(){$(items[j]).appendTo(dd)[0]._id=j+100;delete items[j]})}}}},_listCss:function(dd,id,css,add){dd=$(dd.children("[_id="+id+"]"));if(add){dd.addClass(css)}else{dd.removeClass(css)}},_listSelect:function(id,on){var top,scroll,sel,arg=null,dd=on!==2&&(on||this._ddOn)?this._ddList:null,o=this.options;if(!o.listItems){return}if(!_aNull(id)&&this._listID!==id){arg={index:id,oldIndex:this._listID,item:o.listItems[id]};if(this._fire(18,null,arg)){return 1}this._listID=id}id=this._listID;if(dd){if(on&&id<0){on=this._findItem(this.text(),-1);if(!_aNull(on)&&id!==on.id){arg={index:on.id,oldIndex:id,item:o.listItems[on.id]};if(this._fire(18,null,arg)){return 1}this._listID=id=on.id}}sel=this._ddSel;if(sel!==id){this._lazy(id);this._listCss(dd,sel+100,this.css.listItemSelected);sel=this._ddSel=id;this._listCss(dd,sel+100,this.css.listItemSelected,1)}if(sel>=0){top=sel%this._rows*this._ddHeight0;scroll=dd[0].scrollTop;if(top>scroll){top+=this._ddHeight0-this._ddHeight;if(top<scroll){top=-9}}if(top!==-9){if($.ig.util.isSafari&&top>20&&dd[0].scrollTop===top&&!on){dd[0].scrollTop=top-1}dd[0].scrollTop=top}}}if(arg){this._fire(19,null,arg)}},_listKey:function(e,k){var i,len,dd=this._ddOn?this._ddList:null,id=this._listID,kc=$.ui.keyCode;if(!dd){return}if(k===kc.ENTER||k===kc.SPACE||k===kc.ESCAPE){this._doDrop(0,e,k===kc.ESCAPE?null:id+100);return true}if(k<33||k>40){return}len=this._ddLen-1;i=id;if(i<0){i=-1e3}if(k===kc.DOWN){i++}else if(k===kc.UP){i--}else if(k===kc.PAGE_DOWN){i+=this._page}else if(k===kc.PAGE_UP){i-=this._page}else if(k===kc.HOME){i=0}else if(k===kc.END){i=len}else if(k===kc.RIGHT){i+=this._rows;if(i>len){i=id}}else if(k===kc.LEFT){i-=this._rows;if(i<0){i=id}}else{return}this._listSelect(Math.max(0,Math.min(i,len)));return true},_listChange:function(list,i,act){var len,count,j,items=this.options.listItems;len=items?items.length:0;j=count=list?list.length:0;i=_aNull(i)||i<0?-1:i;if(act<2){if(len<1){return this}if(act>0&&i<0){if(list===null){i=len-1}else{while(++i<len){if(items[i]===list){break}}}}if(i<0){items.length=0}else if(i<len){items.splice(i,1)}}else if(!items){this.options.listItems=list}else{while(j-->0){if(i>=len||i<0){items.push(list[count-j-1])}else if(i===0){items.unshift(list[j])}else{items.splice(i,0,list[j])}}}this._listRemove();return this},_listRemove:function(){if(this._ddList){this._touch("destroy");this._element.removeClass(this.css.noTopCorners).removeClass(this.css.noBottomCorners);this._ddList.unbind();this._ddParent.remove();this._ddOn=this._ddList=this._ddParent=this._listLazy=null;this._listID=-1}},_initValidator:function(end,req){if(!this._field){return}var v=this._validator,o=this.options,vo=o.validatorOptions;if(end||!vo||!this.element.igValidator){if(v){v.destroy();delete this._validator}return}vo.ctl=this;vo.required=o.required=o.required||!req&&vo.required;this._field.igValidator(vo)},_doError:function(flag,e,mes){var val=this._validator;if(val&&this._field){if(!_aNull(mes)){return val._doError(mes,null,flag)!==1}if(flag){val._evt(e,null,flag===2);if(val._lbl){val._lbl._old={t:_now(),val:this._val(),sel0:this._sel0,sel1:this._sel1,lastTxt:this._lastText,last:this._last,txt:this._text}}}else{val.hide(null)}}},_doScrl:function(field,txt){var ch,e,fox=$.ig.util.isFF&&!this._dp,width=field.clientWidth,max=field.scrollWidth,len=txt.length,f=false,sel=this._sel0;if(!this._field||this._tr!==1||len<4){return}ch=max/len*1.1;len-=sel;if(this._ta){max=field.scrollHeight;if(field.clientHeight+2>max){return}txt=txt.split("\n");if(len*15<width&&(fox||txt[txt.length-1].length*15>width)){field.scrollTop=max;return}if(!fox){return}}else if(sel*15<width){return}if(!fox){if(max>width+2){if(len*ch*1.3<width){field.scrollLeft=max}else if(sel*ch>width+field.scrollLeft){field.scrollLeft=Math.floor(sel*ch-width-3)}}return}if(this._bad>2){return}this._scrl=1;try{ch=field.maxLength;e=this._mask;if(ch>0){field.maxLength=Math.max(ch,e?e.length:0)+2}e=document.createEvent("KeyboardEvent");e.initKeyEvent("keypress",!f,!f,null,f,f,f,f,0,32);field.dispatchEvent(e);e=document.createEvent("KeyboardEvent");e.initKeyEvent("keypress",!f,!f,null,f,f,f,f,8,0);field.dispatchEvent(e);if(ch>0){field.maxLength=ch}}catch(ignore){}delete this._scrl},_onEvt:function(e,type){var old,txt,field=this._field,me=this;field=field?field[0]:null;if(!field||me._scrl){return}me._evt=e;if(type!==11){me._doEvt(e,type,field);delete me._evt}else{if(me._pasting&&_now()-me._pasting<2e3){return}old=field.value;try{if(me._nullT&&e&&e.type==="drop"){txt=e.originalEvent.dataTransfer;if(!_aNull(txt)){txt=txt.getData("Text")}}}catch(ex){txt=null}me._pasting=_now();setTimeout(function(){if(!txt){if(!me._field){return}txt=field.value}if(old!==txt){me.paste(txt)}delete me._pasting},0)}},_doEvt:function(e,eType,field){var val,foc,skip,skip0,up,time,src,v=null,k=0,me=this,o=this.options;if(me._noWidth){me._fixWidth()}if(!e||o.disabled){return}if(eType===10){v=e.wheelDelta||e.detail;if(v){_stop(e);me._spin(v>0?o.spinDelta:-o.spinDelta)}return}if($.ig.util&&$.ig.util.evtButton(e)){return}if(eType===26){me._msOver=e.originalEvent.pointerType;return}if(me._msOver===2&&eType===6){delete me._msOver;return}val=src=e.target;v=val._id;while(val&&k++<5&&_aNull(v)){val=val.parentNode;if(val){v=val._id}}if(eType===7){me._hover=me._mouseDown=0;me._fixCss();me._fire(eType,e,v);return}if(!v){return}if(eType===6){if(v>0&&!src.unselectable){src.unselectable="on"}val=field.value;if(val===me._lastText||me._pasting){val=null}if(!me._fcs&&val&&me._nullT){if(val!==o.nullText){me._fixNull()}val=null}if(val){me.paste(val,1)}}if(v>4&&v<9){v-=4}if(eType===0&&me._fcs===0){me._onEvt({target:src,type:"focus"},8)}if(_aNull(me._evt0Spin1)&&!me._box){try{if(!($.ig.util.isIE&&$.ig.util.browserVersion<11&&!me._ta)&&!_aNull(field.selectionStart)){me._tr=1}}catch(ignore){}if(me._tr!==1){me._tr=field.createTextRange?field.createTextRange():null}me._bad=_aNull(me._tr)?1:0}me._evt0Spin1=0;if(eType===5&&me._fcs===2&&e.button===1){me.getSelectedText()}time=_now();if(eType<3){me._key=k=e.keyCode||e.which||0;me._time=time}if(eType!==1&&eType<8){if(me._fire(eType,e,v)){if(eType<4){_stop(e)}return}}if(eType<3){if(eType===0&&(me._fcs===2||o.dropDownOnReadOnly)&&me._dropTrigger(e,k)){return}if(me._fcs===1&&(e.shiftKey||eType===1||!(o.spinOnReadOnly||o.dropDownOnReadOnly&&me._ddOn)||k<9||k>40)){return}if(eType===2&&me._k0===0&&k>0&&k!==13&&k!==86&&me._text!==me._val()){field.value=me._text;return}}if(eType===3&&v>0){if(v===99){me._ddmd=time}_stop(e)}if(eType===3&&me._mouseDown!==v){if(v>1&&v<4){me._stopTimer(1);if(!o.readOnly||o.spinOnReadOnly){up=v===2?o.spinDelta:-o.spinDelta;if(me._fcs<1&&o.focusOnSpin){me._evt0Spin1=1;me.setFocus()}me._spin(up);skip=skip0=5;me._spinField=-1;me._timer=setInterval(function(){if(me._mouseDown<2){return me._stopTimer(1)}if(--skip<1){me._spin(up);skip=--skip0>8?--skip0:skip0}},60)}}me._hover=me._mouseDown=v;me._fixCss()}if((eType===5||eType===6)&&me._hover!==v){me._hover=v;me._fixCss()}if(eType===4&&me._mouseDown){if((v===1||v===4)&&v===me._mouseDown){if(!me._fire(15,e)){if(v===4){me._onEvt(null,11);me._set_val(null);me.select(0)}else{me._dropTrigger(e,-2)}}}if(v>99){me._doDrop(0,e,v)}me._mouseDown=0;me._fixCss()}if(v>0){return}foc=me._focTime;if(eType===4){if(foc&&foc+500>time){me._select()}me._focTime=0}if(eType<3){me._doKey0(e,eType)}if(!me._field){return}val=me._val();if(eType===2){me._last=val;if(me._key===13&&$.ig.util.isFF&&me._text!==val){me._fire(12,e);me._update();me.text(val)}}if(eType===1&&me._keyMod){delete me._keyMod;me._doScrl(field,val)}if(eType>=8){if(me._bad>2){me._bad=2}me._spinField=-1;foc=eType===8;if(foc){delete me._ddnf}v=me._fcs>0;if(foc===v){return}if(!foc&&time-me._ddmd<500){if(me._ddnf){me._ddnf=e}else{me.setFocus(-1)}return}me._noPaste=0;if(!foc&&me._lastText!==val){me.paste(val,1)}if(!foc&&me._type<2&&!val&&!o.nullable){val=me._old||(o.listItems?o.listItems[0]:"");if(val){me._set_val(val);val=me._text=me._focusTxt(false)}else{val=""}}me._fcs=foc?o.readOnly?1:2:0;if(me._vAct(foc)){return}me._hadFocus=!foc;v=me._validator;if(foc){me._k0=0;if(me._bad>1){me._bad=0}if(!o.readOnly){if(me._nullT){val=me._last=me._text=field.value=""}me._nullT=null;v=v&&v._lbl?v._lbl._old:null;if(v&&v.t+200>_now()){field.value=me._text=v.txt;me._lastText=v.lastTxt;me._last=v.last;me.select(v.sel0,v.sel1)}else{if(val!==me._text){me.getSelectedText();me.paste(val)}me._lastText=me._last=me._text=me._focusTxt(foc,e)}}me._focTime=time;me._dropTrigger(e,-1)}else{if(v){me._doError(2,e);setTimeout(function(){if(!me._fcs&&!me._doInvalid(e,9)){me._doError()}},100)}me._doDrop(0,e);val=me._matchList(val,-1);me._canRedo=null;if(!o.readOnly){v=me._ta?o.maxLength||0:0;if(v>0&&val.length>v){val=val.substring(0,v)}if(me._last!==val||me._bad!==0){v=me._fix;me._fix=0;me._fcs=2;me.text(val);me._fcs=0;me._fix=v}me._update()}}me._repaint();me._fixCss();if(foc&&this._prop(13)<2){me.select(this._prop(13)*1e4);me._select()}me._hadFocus=false;if(foc&&me._focSpin){me._spin(me._focSpin)}me._focSpin=null;me._fire(eType,e,-1);me._lastText=me._val();return}if(!(eType>3&&me._k0===0)&&!me._nullT&&val!==me._text){me._text=val;me._fire(12,e)}},_fire:function(id,e,arg,a2){if(!this._field){return}var evt,ee=this.events,args=id===13||id>16?arg:{};for(evt in ee){if(ee.hasOwnProperty(evt)&&ee[evt]===id){break}}if(id===14){args.delta=arg;args.value=this._instant(1,null,1)}if(id===12){args.oldText=this._lastText;arg=this._val();if(args.oldText===arg){return}this._doError(1,e);this._doClear(arg);args.text=this._lastText=this._text=arg;if(this._fcs<2&&this._evt0Spin1!==1){this._update()}this._doDP(2);if(this._type>3){this._fixCss()}}if(id<3){args.key=this._key}else if(id<8){args.elementType=arg===-1?"field":arg===1||arg===5?"button":arg===2||arg===6?"spinUpper":arg===3||arg===7?"spinLower":arg===99?"dropDown":arg>99?"item"+(arg-100):"";args.id=arg}if(id===10||id===11){args.value=arg;args.oldValue=a2}if(id===11&&this._fcs===2){this._update()}args.owner=this;if(!this._trigger(evt,e||this._evt,args)){return true}if(id<3){this._key=args.key}if(id===10){this._val10=args.value}},_select:function(x){var sel1,me=this,field=this._field[0],sel0=this._prop(13);if(this._tr!==1||sel0>1){return}if(!x){setTimeout(function(){try{me._select(1)}catch(ignore){}},0);return}sel1=field.value.length;if(sel0===0){sel1=0}else if(sel0<0){sel0=0}else{sel0=sel1}if(sel0!==field.selectionStart||sel1!==field.selectionEnd){this.select(sel0,sel1)}},select:function(sel0,sel1,val){var j,i,fix0=0,fix1=0,tr=this._tr,field=this._fcs===2?this._field[0]:null;if(!field||field.offsetWidth<2||this._box){return this}if(_aNull(val)){val=field.value}else{sel1=sel0;if(field&&field.value!==val){this._keyMod=field.value=val}}i=val.length;if(_aNull(sel1,1)){sel1=sel0;if(_aNull(sel0,1)||sel0<0){sel0=0;sel1=i}}if(sel1>=i){sel1=i}else if(sel1<sel0){sel1=sel0}if(sel0>sel1){sel0=sel1}this._sel0=sel0;this._sel1=sel1;try{if(tr===1){field.selectionStart=sel0;field.selectionEnd=sel1;return this}if(!tr){if(sel0!==sel1){field.select()}return this}if(this._ta){j=sel1;while(j-->0){if(val.charCodeAt(j)===10){if(j<sel0){fix0++}fix1++}}sel0-=fix0;sel1-=fix1}sel1-=sel0;if(this._ta){tr.moveToElementText(field)}else{tr.move("textedit",-1)}tr.move("character",sel0);if(sel1>0){tr.moveEnd("character",sel1)}tr.select()}catch(ignore){}return this},getSelectedText:function(){var i,range,val,txt="",field=this._field[0],tr=this._tr,sel0=0;this._sel0=this._sel1=0;if(_aNull(tr)){return txt}if(tr===1){this._sel0=field.selectionStart;this._sel1=field.selectionEnd;if(this._sel0<this._sel1){txt=field.value.substring(this._sel0,this._sel1)}return txt}try{range=document.selection.createRange();val=field.value;i=val.length;tr=range.duplicate();if(this._ta){tr.moveToElementText(field)}else{tr.move("textedit",-1)}try{while(tr.compareEndPoints("StartToStart",range)<0){tr.moveStart("character",1);sel0++;if(this._ta&&val.charCodeAt(sel0)===10){sel0++}if(sel0>i){break}}}catch(ignore){}txt=range.text}catch(ignore){}this._sel0=sel0;this._sel1=sel0+txt.length;return txt},getSelection:function(start){this.getSelectedText();return start?this._sel0:this._sel1},setFocus:function(delay){var me=this;if(me._field){if(delay===-1){try{me._field[0].focus()}catch(ignore){}}else{setTimeout(function(){if(me._fcs<1){me.setFocus(-1)}},delay||0)}}return this},hasFocus:function(){return this._fcs>0},_jpn:function(k,str){if(str){if(k===12290||k===65294){return"."}if(k===12289){return","}}else if(!this._sTxt){return k}if(k>65295&&k<65306){k-=65248}else if(k>1631&&k<1642){k-=1584}else if(k>1775&&k<1786){k-=1728}else{return str?null:k}return str?String.fromCharCode(k):k},_dtt:function(){var v,f,input,dt=this._oldAttr.title,o=this.options,name=o.inputName;if(name){f=o._vsFormat;v=this._getVal(1);if(_aNull(v,this._type>3)){v=""}else if(this._date){v=this._df(v,0)+"-"+(this._df(v,1)+1)+"-"+this._df(v,2)+" "+this._df(v,3)+":"+this._df(v,4)+":"+this._df(v,5)+"."+this._df(v,6)}else if(f&&this._type>3){v=v.toString().replace(".",f)}input=$('input[name="'+name+'"]');if(input[0]!==this.element[0]){if(input.length===0){MSApp.execUnsafeLocalFunction(function(){input=$('<input type="hidden" name="'+name+'" />').appendTo(this._element.parent())})}input.val(v)}}if(!dt||dt.indexOf("{0}")<0){return}v=this._val();if(v===""){v=this.options.nullText}this._element[0].title=this._field[0].title=this._field[0].alt=dt.replace("{0}",v)},_stopTimer:function(evt){if(this._timer){clearInterval(this._timer)}delete this._timer;if(!evt&&this._timer1){clearInterval(this._timer1);delete this._timer1}},_maskFlag:function(ch,upLow){switch(ch){case">":return-1;case"<":return-2;case"&":ch=1;break;case"C":ch=2;break;case"A":ch=7;break;case"a":ch=8;break;case"L":ch=13;break;case"?":ch=14;break;case"0":return 19;case"9":return 20;case"#":return 21;default:return 0}return ch+upLow*2},_maskFilter:function(flag,str,i,sf){var ch,f;if(i>=str.length){return sf}ch=str.charCodeAt(i);f=Math.floor((flag-1)/6);str=str.charAt(i);if(ch<22){return sf}if((f===1||f===3)&&ch>100){ch=this._jpn(ch);if(ch<100){str=String.fromCharCode(ch)}}if(f===3){return flag===21&&(str==="-"||str==="+")||ch>47&&ch<58?str:sf}if(f===1||f===2){if(f===1&&ch>47&&ch<58){return str}if(ch<256&&str.toUpperCase()===str.toLowerCase()){return sf}}flag=Math.floor((flag-1)/2)%3;if(flag===0){return str}return flag===2?str.toLowerCase():str.toUpperCase()
},_getTxt:function(vt,prompt,txt0,getVal){var i,len,flag,iLast=this._selKey,mask=this._mask,txt="",non=!_aNull(txt0),o=this.options;if(!non){txt0=this._bad!==0&&this._fcs>1?this._val():this._txt}if(non){non=this._type===1}if(_aNull(txt0)||_aNull(mask)){return txt}len=mask.length;iLast=this._fcs>1&&!getVal&&o.hideMaskOnFocus?iLast&&iLast<len?iLast-1:-1:len;for(i=0;i<len;i++){flag=mask.charCodeAt(i);if(flag<22){if(i<txt0.length&&txt0.charCodeAt(i)>=22){txt+=txt0.charAt(i);if(i>iLast){iLast=i}non=false}else if(vt%3===2||vt%3===1&&flag%2===1){txt+=flag===21&&prompt===""?o.padChar:prompt}}else if(vt>=3){txt+=mask.charAt(i);if(i===iLast+1){if(this._selKey===i){this._selKey++}iLast++}}}if(iLast++<len){txt=txt.substring(0,iLast)}return non?"":txt},_setTxt:function(v,vt,render){var ch,flag,j=0,i=-1,mask=this._mask,txt=this._mask;if(!_aNull(v)){while(++i<mask.length){if(vt===1e3+j){vt=this._dataMode}if(j>=v.length){break}flag=mask.charCodeAt(i);if(flag<22){ch=this._maskFilter(mask.charCodeAt(i),v,j);if(!_aNull(ch)){txt=txt.substring(0,i)+ch+txt.substring(i+1)}j++}else if(vt>=3){j++}}}if(render){return txt}this._txt=txt;this._text=this._focusTxt(this._fcs>1," ");this._repaint()},_setMask:function(str){var x,ch,i,i0=0,upLow=0,mask="",txt="",t0=this._getTxt(0);for(i=0;i<str.length;i++){ch=str.charAt(i);x=this._maskFlag(ch,upLow);if(x!==0){if(x<0){upLow=upLow===-x?0:-x;continue}ch=String.fromCharCode(x);mask+=ch;ch=this._maskFilter(x,t0,i0++,ch)}else if(ch==="\\"&&i+1<str.length&&this._maskFlag(str.charAt(i+1),0)!==0){ch=str.charAt(++i);mask+=ch}else{mask+=ch}txt+=ch}this._txt=txt;this._mask=mask},_getMask:function(fields,v,foc){var x,i,i0=0,flag=-1,txt="";if(!v){v=""}if(foc){v=v.replace("dddd","ddd").replace("ddd,","").replace("ddd ","").replace(" ddd","").replace("ddd","")}v=v.replace(/\x08/g," ").replace(/\x09/g," ");v=v.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,"	");v=v.replace("fff","24").replace("ff","23").replace("f","22");v=v.replace("dddd",foc?"":"21").replace("ddd",foc?"":"20").replace("dd","09").replace("d","08").replace("ss","19").replace("s","18").replace("mm","17").replace("m","16");v=v.replace("tt","15").replace("t","14").replace("HH","13").replace("H","12").replace("hh","11").replace("h","10");v=v.replace("MMMM",foc?"MM":"07").replace("MMM",foc?"MM":"06").replace("MM","05").replace("M","04").replace("yyyy","03").replace("yy","02").replace("y","01");v=v.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;i<v.length;i++){x=v.charCodeAt(i);if(x<48||x>57){flag=v.charAt(i);if(!foc&&flag==="\\"&&i+1<v.length){x=v.charAt(++i);if(x==="\\"){continue}if(x==="0"||x==="9"){txt+=flag}txt+=x}else{txt+=v.charAt(i)}continue}flag=(x-48)*10+v.charCodeAt(++i)-48;if(!foc){fields[i0++]=flag;txt+="";continue}fields[i0++]=flag;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"}}}return txt},getValueByMode:function(mode,v,getVal){var d,type=this._type,empty=this.options.emptyChar;mode=this._mode(mode,type);if(type===0||!this._field){return this._val()}if(type>3){d=this._dataMode;this._dataMode=mode;v=this.value();this._dataMode=d;return v}if(type===1){return this._getTxt(mode,v?"":empty,null,getVal)}d=this._fcs<2?this._isNull?null:this._date:this._toDate(this._val(),true,v);return mode===0?d:d?this._toTxt(d,mode===1,empty):""},_fieldVal:function(f,d,e,ch){var v,j,i=f%2*2,o=this.options;if(f<4){v=this._df(d,0)+o.yearShift;if(f===3){i=4}else{v%=100;i=f===2?2:0}}else if(f<8){this.d_s=2;v=this._df(d,1)+1;if(f>5){f=this._optVal(f===6?"monthNamesShort":"monthNames")[v-1];if(f.length>0){return f}}}else if(f<10){v=this._df(d,2)}else if(f<16){v=this._df(d,3);if(f>13){v=this._optVal(v<12?"am":"pm");f-=13;i=v.length;if(f===i){return v}if(i<f){v+=" "}return v.substring(0,f)}if(f<12){v%=12;if(v===0){v=12}}}else if(f<18){v=this._df(d,4)}else if(f<20){v=this._df(d,5)}else if(f>21){v=this._df(d,6);j=i=f-21;while(j-->3){v*=10}while(j++<2){v=Math.floor(v/10)}}else{return this._optVal(f===20?"dayNamesShort":"dayNames")[d.getDay()]}v=_str(v);if(f<20||f>22){f=v.length;if(e){if(i===0){i=2}else{e=false}}if(i>0){if(i<f){v=v.substring(0,i)}else{while(f++<i){v=(e?ch:"0")+v}}}}return v},_limits:function(val,roll){var time,min=this._prop(10),max=this._prop(11);if(this._type>3){if(_aNull(val,1)&&!this.options.nullable){val=this.options.nullValue;if(!val&&this._dataMode>2){val=0}}if(!_aNull(val,1)){if(!_aNull(min,1)&&val<=min){return roll?max:min}if(!_aNull(max,1)&&val>=max){return roll?min:max}}return val}if(_aNull(val)){return val}time=val.getTime();if(!_aNull(min)){min=min.getTime()}if(!_aNull(max)){max=max.getTime()}if(!_aNull(min)&&(time<min||roll&&time===min)){val.setTime(roll?max:min);return val}if(!_aNull(max)&&(time>max||roll&&time===max)){val.setTime(roll?min:max);return val}return null},_date7:function(val){var i;if(val.length<13){return null}val=val.replace(/[\. :]/g,"-").split("-");i=val.length;if(i!==7){return null}while(i-->0){val[i]=_int(val[i],-1);if(val[i]<0){return null}}return this._df(val[0],val[1]-1,val[2],val[3],val[4],val[5],val[6])},_toDate:function(txt,foc,limit,fire){var v,i0,c,iLen,invMes,mis=0,n=0,i=-1,j=-1,y=-1,mo=-1,day=-1,h=-2,m=-2,s=-2,ms=-2,pm=-1,any=false,inv=null,arg={},o=this.options,d=fire?null:this._date7(txt),fields=foc&&fire?this._fields0(txt):this._fields1(txt,foc);iLen=fields.length;if(!d){while(++i<iLen){j++;v=fields[i];i0=foc?this._field0IDs[i]:this._field1IDs[i];if(i0<4){if(v>100&&v>o.yearShift){v-=o.yearShift}arg.year=y=v;if(y<0){mis++}else{n++;c=o.centuryThreshold;if(v<100){if(i0<3&&c<0){c=29}if(c>=0){y+=v>c?1900:2e3}}}}else if(i0<8){if(v<1||v>12){mis++}else{arg.month=mo=v;n++}}else if(i0<10){arg.day=day=v;if(v<1||v>31){mis++}else{n++}}else if(i0<14){if(v===24){v=0}if(i0>11){pm=-4}else{if(v===12){v=0}if(v>12){mis++}}arg.hours=h=v;if(v>23||v<0){mis++}}else{if(i0<16){j--;if(v>0){pm++}continue}if(i0<18){arg.minutes=m=v;if(v>59||v<0){mis++}}else if(i0<20){arg.seconds=s=v;if(v>59||v<0){mis++}}else{if(i0<22){j--;continue}while(i0++<24){v*=10}while(i0-->25){v=Math.floor(v/10)}arg.milliseconds=ms=v;if(v>999||v<0){mis++}}}if(v>=0){any=true}if(j<o.minNumberOfDateFields&&mis>0){if(fire&&any){invMes=this._optVal("dateFields",2);inv="numberOfFields"}mis+=9}}}if(pm===0&&h>=0&&h<12){h+=12;arg.hours=h}if(!d&&(!o.nullable||mis<9)){if(n===3){d=this._df(y,mo-1,day,0,0,0,0);if(y<100){this._df(d,0,y)}}else{d=this._df();if(this._date){d.setTime(this._date.getTime())}if(day>0){this._df(d,2,10)}if(y>=0){this._df(d,0,y)}if(mo>0){this._df(d,1,mo-1)}if(day>0){this._df(d,2,day)}}}if(fire&&day>0&&d&&day!==this._df(d,2)){invMes=this._optVal("invalidDay",2);inv="dayOfMonth"}day=o.useLastGoodDate?this._goodD:null;if(fire&&!d&&!o.nullable){d=day;if(!d||!d.getTime){d=this._df()}else{invMes=this._optVal("required",2);inv="null"}}if(d){if(h>-2){this._df(d,3,h<0?0:h)}if(m>-2){this._df(d,4,m<0?0:m)}if(s>-2){this._df(d,5,s<0?0:s)}if(ms>-2){this._df(d,6,ms<0?0:ms)}if(limit){i=d;d=this._limits(d);if(_aNull(d)){d=i}else if(fire){if(!o.minValue){invMes=this._optVal("max",2).replace("{0}",this._toTxt(o.maxValue))}else if(!o.maxValue){invMes=this._optVal("min",2).replace("{0}",this._toTxt(o.minValue))}else{invMes=this._optVal("range",2).replace("{0}",this._toTxt(o.minValue)).replace("{1}",this._toTxt(o.maxValue))}inv="limit"}}}if(fire){if(any&&!d&&txt.length>0&&day){if(!inv){invMes=this._optVal("date",2);inv="invalid"}d=day}if(!any&&o.required){invMes=this._optVal("required",2);inv="null"}arg.value=d;if(inv&&(txt||!o.nullable)){if(o.reduceDayOfInvalidDate!==false&&d&&any&&this._df(d,2)<5&&arg.day>27){this._df(d,2,0);arg.value=d}arg.text=txt;arg.reason=inv;arg.message=invMes;this._inv=arg}}return d},_toTxt:function(d,foc,prompt,txt0){var ch,k,i=-1,f0=0,txt="",mask=foc?this._mask:this._mask1,ids=foc?this._field0IDs:this._field1IDs;if(_aNull(d)){if(!foc){return""}if(txt0){this._txt=mask}return this._getTxt(5,prompt,mask)}this.d_s=6;while(++i<mask.length){ch=mask.charAt(i);k=mask.charCodeAt(i);if(k<22){txt+=this._fieldVal(ids[f0++],d,foc,ch);if(foc){while(i+1<mask.length){if(mask.charCodeAt(i+1)===k){i++}else{break}}}}else{txt+=ch}}if(!foc){return txt}if(txt0){this._txt=txt}return this._getTxt(5,prompt,txt)},_isPM:function(t,i){var pm=this._optVal("pm").toUpperCase();return pm.charAt(0)===t.charAt(i)&&(pm.length<2||t.length<=i+1||pm.charAt(1)===t.charAt(i+1))},_fields1:function(txt,foc){var m,k,j,iLen,i=-1,v=-1,field=0,fields=[],ids=foc?this._field0IDs:this._field1IDs;iLen=ids.length;while(++i<iLen){fields[i]=-1}if(_aNull(txt)){return fields}txt=txt.toUpperCase();i=-1;while(++i<txt.length&&field<iLen){k=this._jpn(txt.charCodeAt(i))-48;j=ids[field];if(j===20||j===21){j=ids[++field]}if(j===14||j===15){if(k>=0&&k<=9){v=-1;field++;i--;continue}if(this._isPM(txt,i)){fields[field++]=1;v=-1}}else{if(k>=0&&k<=9){if(v<0){v=k}else{v=v*10+k}}else{if(v>=0){fields[field++]=v;v=-1}else if(j===6||j===7){while(v-->-3){for(k=0;k<12;k++){m=this._optVal(j===6?"monthNamesShort":"monthNames")[k];m=m.toUpperCase();j=m.length;if(j<1){continue}if(v===-3){if(j<4){continue}m=m.substring(0,3)}j=txt.indexOf(m)-1;if(j>-2){if(j<0||txt.charAt(j).toLowerCase()===txt.charAt(j)){break}}}if(k<12){fields[field++]=k+1;break}}}}}}if(field<iLen){fields[field]=v}return fields},_fields0:function(txt){var x,k,j=-1,i=-1,v=-1,field=-1,n=22,mask=this._mask,fields=[];if(!txt){txt=""}while(++i<mask.length){j++;x=mask.charCodeAt(i);if(x>21&&n>21){continue}if(x>21){if(field>=0){fields[field]=v}}else{if(n>21){v=-1;field++}if(j<txt.length){if(x>18){k=this._jpn(txt.charCodeAt(j))-48;if(k>=0&&k<=9){if(v<0){v=k}else{v=v*10+k}}else if(i+1<mask.length&&txt.charAt(j)===mask.charAt(i+1)){j--}}else if(n!==x&&this._isPM(txt.toUpperCase(),j)){v=1}}}n=x}fields[field]=v;return fields},_curField:function(s,mask){var i,x,n=22,field=-1;this._n0=this._n1=-1;for(i=0;i<mask.length;i++){x=mask.charCodeAt(i);if(x>21&&n>21||x<=21&&n<=21){continue}if(x>21){if(i>=s){break}}else{this._n0=i;field++}n=x}if(this._n0>=0){this._n1=i}field=this._field0IDs[field];if(_aNull(field)){return-1}if(field<8){return field<4?0:1}if(field<20){return Math.floor((field-4)/2)}return field>21?8:-1},_maskKey:function(k,ch,txt,i,s,mask){var field,n=0,v=-1;if(this._type<2){return-2}field=this._curField(s,mask);if(s>=this._n1){if(txt.charCodeAt(--s)>21){return this._maskKey(k,ch,txt,i,s+2,mask)}}if(field<0){return-1}if(field===5){if(s<=this._n0){v=this._optVal("am");ch=ch.toUpperCase();if(v.charAt(0).toUpperCase()!==ch){v=this._optVal("pm");if(v.charAt(0).toUpperCase()!==ch){return-1}}i=v.length;if(this._n1===this._n0+1){v=v.charAt(0)}else if(i<2){v+=" "}else if(i>2){v=v.substring(0,2)}this._txt=txt.substring(0,this._n0)+v+txt.substring(this._n1)}return this._n1}if(k<48||k>57){if(s===0||k!==47&&k!==58&&(k<44||k>57)){return-1}if(mask.charCodeAt(s-1)>=22||this._n1===i){return s}while(s<i){if(mask.charCodeAt(s++)>=22){break}txt=txt.substring(0,s-1)+mask.charAt(s-1)+txt.substring(s)}this._txt=txt;return s}k-=48;if(this._n0===s){v=txt.charCodeAt(s+1)-48;if(field===2){if(k>3){n=1}else if(k===3&&v>1){n=2}}else if(field===6||field===7){if(k>5){n=1}}else if(field>0&&field<5){if(field===4){k--;v-=2}if(k>1){n=1}else if(k===1&&v>2){n=2}}}if(this._n0+1===s){v=txt.charCodeAt(s-1)-48;if(field===2){if(v>3||v===3&&k>1){n=3}}else if(field===6||field===7){if(v>6||v===6&&k>0){n=3}}else if(field>0&&field<5){if(field===4){v--;k-=2}if(v>1||v===1&&k>2){n=3}}}if(n===1){txt=txt.substring(0,s)+mask.charAt(s)+txt.substring(s+1);s++}if(n===2){txt=txt.substring(0,s+1)+mask.charAt(s+1)+txt.substring(s+2)}if(n===3){while(++s<i){if(mask.charCodeAt(s)<22){break}}if(s>=i){return-1}return this._maskKey(k+48,ch,txt,i,s,mask)}this._txt=txt.substring(0,s)+ch+txt.substring(s+1);return++s},_add:function(v0,v){var dot0,dot1,dot2,s1,s2=v.toString(),s0=v0.toString(),v1=v0+v;s1=v1.toString();dot0=s0.indexOf(".");dot1=s1.indexOf(".");if(dot0<1||dot1<1){return v1}dot2=s2.indexOf(".");if(dot2>0){dot2=s2.length-dot2}dot0=Math.max(dot2,s0.length-dot0);if(s1.length-dot1<=dot0){return v1}v=10;while(dot0-->2){v*=10}return Math.round(v1*v)/v},spin:function(delta){var val,x,i,d,o=this.options;if(!this._spinList(delta)){return this}if(this._type<2){return this}if(this._type>3){val=this._toNum(this._val())||0;val=this._add(val,delta);delta=o.maxLength;if(!delta||delta<1||val.toString().length<=delta){this._set_val(val,this._fcs)}return this}i=this._spinField;d=this._df();d.setTime(this._date.getTime());if(i<0||i>8){if(this._fcs===2){this.getSelectedText();i=this._curField(this._sel0,this._mask);d=this._toDate(this._val(),true,true);if(_aNull(d)){d=this._df()}this._spinField=i}else{this._spinField=i=this.d_s}}if(i===5){delta=delta>0?12:-12}x=o.spin1Field;switch(i){case 0:delta+=this._df(d,0);this._df(d,0,delta);if(x&&delta!==this._df(d,0)){i=-1}break;case 1:delta+=this._df(d,1);this._df(d,1,delta);if(x&&delta!==this._df(d,1)){i=-1}break;case 2:delta+=this._df(d,2);this._df(d,2,delta);if(x&&delta!==this._df(d,2)){i=-1}break;case 3:case 4:case 5:i=this._df(d,2);delta+=this._df(d,3);this._df(d,3,delta);if(x&&i!==this._df(d,2)){i=-1}break;case 6:delta+=this._df(d,4);this._df(d,4,delta);if(x&&delta!==this._df(d,4)){i=-1}break;case 7:delta+=this._df(d,5);this._df(d,5,delta);if(x&&delta!==this._df(d,5)){i=-1}break;case 8:for(i=this._n1-this._n0;i<3;i++){delta*=10}delta+=this._df(d,6);this._df(d,6,delta);if(x&&delta!==this._df(d,6)){i=-1}break}if(i<0){return this}delta=this._limits(d);if(!_aNull(delta)){d=delta}this._text=this._toTxt(d,this._fcs===2,o.promptChar,true);this._date=d;this._isNull=false;this._repaint();this.select(this._sel0);if(this._fcs===2){this._last=this._val()}return this},_mode:function(mode,t){var mods;if(!mode||t<1){mode=_aNull(mode)?t>3?1:t===1?5:0:0}else if(typeof mode!=="number"){mode=mode.toString().toLowerCase();if(t>3){mods={text:-1,editmodetext:0,"double":1,"float":2,decimal:3,"long":4,ulong:5,"int":6,uint:7,"short":8,ushort:9,sbyte:10,"byte":11}}else if(t>1){mods={date:0,editmodetext:1,text:2}}else if(t>0){mods={rawtext:0,rawtextwithrequiredprompts:1,rawtextwithallprompts:2,rawtextwithliterals:3,rawtextwithrequiredpromptsandliterals:4,alltext:5}}mode=mods[mode];if(_aNull(mode)){mode=-2}}return mode<-1?t>3?1:0:mode},_fixMode:function(init){var len,format,mask,mask1,mode,t=this._type,o=this.options,val=this._value;this._dataMode=mode=this._mode(o.dataMode,t);this._maxLen=o.maxLength;if(t>0&&t<4){if(!o.promptChar){o.promptChar="_"}if(!o.padChar){o.padChar=" "}if(!o.emptyChar){o.emptyChar=" "}if(t===1&&init){t=o.inputMask;this._setMask(t||"CCCCCCCCCC")}}if(t<2){if(init===3){this._setVal(val)}return}if(t<4){format=o.dateInputFormat=o.dateInputFormat||"date";if(!o.yearShift){o.yearShift=0}if(_aNull(o.centuryThreshold)){o.centuryThreshold=29}if(_aNull(o.minNumberOfDateFields)){o.minNumberOfDateFields=3}mask=this._optVal(format+"Pattern")||format;format=o.dateDisplayFormat||format;mask1=this._optVal(format+"Pattern")||format||mask;this._field0IDs=[];mask=this._getMask(this._field0IDs,mask,1);this._field1IDs=[];this._mask1=this._getMask(this._field1IDs,mask1);if(init===1){this._date=this._df();this._isNull=false}this._spinField=-1;this.d_s=10;this._setMask(mask);if(init!==1&&!this._isNull){this._setVal(this._date,1)}return}if(mode>3&&this._maxLen<1){len=3;if(mode<6){len=19}else if(mode<8){len=10}else if(mode<10){len=5}this._field[0].maxLength=this._maxLen=len+(mode+1)%2}if(init===3){this._setVal(val,1)}if(!init&&(val||val===0)){this._setVal(val/this._prop(7))}},_toNum:function(txt,limit,fire){var val,min=null,max=null,invMes,o=this.options,num=txt,len=0;if(typeof txt!=="number"){txt=_str(txt);len=txt.length;num=parseFloat(this._txtAsNum(txt))}if(isNaN(num)){num=null}else if(!isFinite(num)){num=num===Number.NEGATIVE_INFINITY?-Number.MAX_VALUE:Number.MAX_VALUE}val=limit?this._limits(num):num;if(fire&&(val!==num||_aNull(val,1)&&len>0)){fire=_aNull(num,1)?len===0?"null":"format":"limit";if(_aNull(num,1)){if(len===0){fire="null";invMes=this._optVal("required",2)}else{fire="format";invMes=this._optVal("number",2)}}else{fire="limit";limit=null;min=o.minValue;if(_aNull(min,1)){min=this._prop(10);if(!_aNull(min,1)){if(min!==val){min=null}}}max=o.maxValue;if(_aNull(max,1)){max=this._prop(11);if(!_aNull(max,1)){if(max!==val){max=null}}}invMes=_aNull(max,1)?this._optVal("min",2).replace("{0}",min.toString(10)):_aNull(min,1)?this._optVal("max",2).replace("{0}",max.toString(10)):this._optVal("range",2).replace("{0}",min.toString(10)).replace("{1}",max.toString(10))}this._inv={value:val,text:txt,reason:fire,message:invMes}}return val},_txtAsNum:function(txt,dec,min){var ch,len=txt.length;if(!dec){dec=this._prop(4)}if(!min){min=this._prop(3)}while(len-->0){ch=this._jpn(txt.charCodeAt(len),true);if(ch){txt=txt.replace(new RegExp(txt.charAt(len),"g"),ch)}}txt=txt.replace("(",txt.indexOf(min)<0?"-":"").replace(this._prop(2),"").replace(new RegExp(min,"g"),"-");txt=txt.replace(dec,"");ch=txt.indexOf(dec);if(ch>0){txt=txt.substring(0,ch)}txt=txt.replace(/[^0-9\-eE\x01]/gm,"").replace("",".");len=txt.length;ch=txt.indexOf("-");if(ch>=0){ch=txt.indexOf("-",ch+1);if(ch+1<len&&ch>0){if(ch>0&&txt.toUpperCase().charAt(ch-1)!=="E"){txt=txt.substring(0,ch)}}len=txt.length;if(txt.toUpperCase().indexOf("E")<0&&ch+1===len){txt="-"+txt.substring(0,len-1)}}return txt==="-"||txt==="."?"":txt},_ePow:function(plus){var pow=this.options.scientificFormat,len=pow?pow.length:0,ch=len?pow.charAt(0):null;return(ch==="e"||ch==="E")&&(len===1||len===2&&pow.charAt(1)==="+")?plus?pow:ch:null},_toTxtNum:function(val,foc,txt,minus,dec,str){var grps,gr0,gr,ch,iL,ePow=this._ePow(),ig=0,iDec=0,i=-1,neg=val,maxDec=this._prop(8);if(_aNull(txt)){if(_aNull(val,1)){return""}neg=val<0;if(neg){val=-val}try{txt=ePow?val.toString(10):val.toFixed(maxDec)}catch(ex){str=txt=_str(val)}return this._toTxtNum(neg,foc,txt.toUpperCase(),_aNull(minus)?this._prop(3):minus,_aNull(dec)?this._prop(4):dec,str)}if(str){txt=this._txtAsNum(txt,dec)}txt=txt.replace("+","");iL=txt.indexOf("E");if(iL>0){ePow=ePow?this._ePow(!foc&&txt.charAt(iL+1)!=="-")+txt.substring(iL+1):txt.substring(iL);txt=txt.substring(0,iL)}else{ePow=""}iL=txt.length;if(_aNull(neg)){if(iL===0){return foc?txt:""}neg=this._isMinus(txt.charCodeAt(0));if(neg){txt=txt.substring(1);iL--}}while(++i<iL){ch=txt.charCodeAt(i);if(ch<48||ch>57){txt=txt.substring(0,i)+txt.substring(i+1);iL--;break}}while(i<iL){if(txt.charCodeAt(iL-1)!==48){break}txt=txt.substring(0,--iL)}iL=i;if(maxDec>0&&iL<txt.length){iDec=txt.length-iL;txt=txt.substring(0,iL)+dec+txt.substring(iL);iL+=dec.length+maxDec}if(iL<txt.length){txt=txt.substring(0,iL)}gr=txt.replace(/0/g,"");if(neg&&(!gr||gr===dec)){neg=false}iL=this._prop(9);if(iL>0){if(iDec===0){txt+=dec}while(iL-->iDec){txt+="0"}}if(foc){txt+=ePow;return neg?minus+txt:txt}grps=this._prop(6);gr=gr0=grps.length>0?grps[0]:0;while(gr>0&&--i>0){if(--gr===0){txt=txt.substring(0,i)+this._prop(5)+txt.substring(i);gr=grps[++ig];if(_aNull(gr)||gr<1){gr=gr0}else{gr0=gr}}}val=this._prop(neg?1:0).replace("n",txt+ePow);return val.replace("$",this._prop(2))},_prop:function(flag){var min,val,sign,o=this.options,t=this._type,mode=this._dataMode;if(flag===13){o=o.selectionOnFocus;return o===-1||o==="select"?-1:o===0||o==="start"?0:o===1||o==="end"?1:2}if(flag===12){return o.maxLength>0?o.maxLength:this._maxLen}if(flag===0){return o.positivePattern||(t===6?this._optVal("percentPositivePattern"):t===5?this._optVal("currencyPositivePattern"):"n")}if(flag===1){val=o.negativePattern||this._optVal(t===6?"percentNegativePattern":t===5?"currencyNegativePattern":"numericNegativePattern");return val.replace("-",this._prop(3))}if(flag===2){val=o.symbol;if(!_aNull(val)){return val}return t===6?this._optVal("percentSymbol"):t===5?this._optVal("currencySymbol"):""}if(flag===3){return this._optVal("negativeSign")||"-"}if(flag===4){return o.decimalSeparator||this._optVal(t===6?"percentDecimalSeparator":t===5?"currencyDecimalSeparator":"numericDecimalSeparator")}if(flag===5){val=o.groupSeparator;if(!_aNull(val)){return val}return this._optVal(t===6?"percentGroupSeparator":t===5?"currencyGroupSeparator":"numericGroupSeparator")}if(flag===6){return o.groups||this._optVal(t===6?"percentGroups":t===5?"currencyGroups":"numericGroups")}if(flag===7){val=o.displayFactor;if(!_aNull(val)){return val}return t===6?this._optVal("percentDisplayFactor"):1}if(flag===8){if(mode>3){return 0}val=o.maxDecimals;if(!_aNull(val)){return val}return this._optVal(t===6?"percentMaxDecimals":t===5?"currencyMaxDecimals":"numericMaxDecimals")}if(flag===9){if(mode>3){return 0}val=o.minDecimals;if(!_aNull(val)){return val}return this._optVal(t===6?"percentMinDecimals":t===5?"currencyMinDecimals":"numericMinDecimals")}min=flag===10;if(min||flag===11){val=min?o.minValue:o.maxValue;if(t>3&&typeof val==="string"){val=parseFloat(val)}if(!_aNull(val,1)||t<4||mode<2||mode===3||mode>11){return val}if(mode===2){return min?-3.40282347e38:3.40282347e38}val=127;sign=mode%2===0;if(!sign&&min){return 0}if(mode<6){val=0x8000000000000000}else if(mode<8){val=2147483647}else if(mode<10){val=32767}return sign?min?-(val+1):val:val*2+1}},_isMinus:function(k){return k===this._prop(3).charCodeAt(0)||k===45||k===40&&this._prop(1).indexOf("(")>=0||k===12540||k===65293||k===65288},destroy:function(){var par,e,b,elem=this._element,field=this._field,elem0=this.element,buts=this._buttons,i=buts?buts.length:0;e=elem?elem[0]:null;if(!field||!e){return this}this._stopTimer();this._doDP(3);this._initValidator(1);this._listRemove();field.unbind(this._evts);elem.unbind(this._mEvts);while(i-->0){if(buts[i]){buts[i].unbind(this._touchEvts)}}b=buts&&buts[0]?buts[0][0]:null;if(b&&b.parentNode===e){e.removeChild(b)}b=buts&&buts[1]?buts[1][0].parentNode:null;if(b&&b.parentNode===e){e.removeChild(b)}if(field[0].parentNode===e){e.removeChild(field[0])}if(this._selElem){elem.remove()}else if(this._swap){par=e.parentNode;par.insertBefore(elem0[0],e);par.removeChild(e)}par=this._oldCss;for(i in par){if(par.hasOwnProperty(i)){elem0.css(i,par[i])}}par=this._oldAttr;for(i in par){if(par.hasOwnProperty(i)){elem0[0][i]=par[i]}}elem0[0]._ig_oldCss=null;elem0=elem=field=this._dp=this._buttons=this._field=this._element=null;this._evts=this._mEvts=this._touchEvts=this._oldAttr=this._oldCss=this._validator=null;$.Widget.prototype.destroy.apply(this,arguments);return this}});$.extend($.ui.igEditor,{version:"14.1.20141.1020"});$.ui.igEditor.setDefaultCulture=function(regional){$.ig.regional=$.ig.regional||{};$.ig.regional.defaults=$.extend($.ig._regional,typeof regional==="string"?$.ig.regional[regional]:regional);if(regional==="en"||regional==="en-US"){regional=""}if($.datepicker&&$.datepicker.regional&&$.datepicker.regional[regional]){$.datepicker.setDefaults($.datepicker.regional[regional])}};$.widget("ui.igTextEditor",$.ui.igEditor,{options:{textMode:null,maxLength:0,includeKeys:null,excludeKeys:null,toUpper:false,toLower:false,listMatchIgnoreCase:true,listMatchOnly:false,listMatchContains:false,listAutoComplete:false},_create:function(){$.ui.igEditor.prototype._create.apply(this,[0])}});$.widget("ui.igMaskEditor",$.ui.igEditor,{options:{includeKeys:null,excludeKeys:null,toUpper:false,toLower:false,listMatchIgnoreCase:true,listMatchOnly:false,listMatchContains:false,listAutoComplete:false,inputMask:"CCCCCCCCCC",promptChar:"_",padChar:" ",emptyChar:" ",dataMode:"alltext",hideMaskOnFocus:false},_create:function(){$.ui.igEditor.prototype._create.apply(this,[1])}});$.widget("ui.igDateEditor",$.ui.igEditor,{options:{regional:null,spin1Field:false,minValue:null,maxValue:null,dateDisplayFormat:null,dateInputFormat:null,promptChar:"_",dataMode:"date",minNumberOfDateFields:3,useLastGoodDate:false,reduceDayOfInvalidDate:true,hideMaskOnFocus:false,centuryThreshold:29,enableUTCDates:false,spinDelta:1,nullable:true,yearShift:0},_create:function(){$.ui.igEditor.prototype._create.apply(this,[2])}});$.widget("ui.igDatePicker",$.ui.igDateEditor,{options:{button:"dropdown",focusOnDropDownOpen:null,datepickerOptions:null},_create:function(){$.ui.igEditor.prototype._create.apply(this,[3])}});$.widget("ui.igNumericEditor",$.ui.igEditor,{options:{regional:null,negativePattern:null,negativeSign:null,decimalSeparator:null,groupSeparator:null,groups:null,maxDecimals:null,minDecimals:null,minValue:null,maxValue:null,scientificFormat:null,nullValue:null,spinDelta:1,nullable:true,maxLength:0,dataMode:"double"},_create:function(){$.ui.igEditor.prototype._create.apply(this,[4])}});$.widget("ui.igCurrencyEditor",$.ui.igNumericEditor,{options:{positivePattern:null,negativePattern:null,symbol:null},_create:function(){$.ui.igEditor.prototype._create.apply(this,[5])}});$.widget("ui.igPercentEditor",$.ui.igNumericEditor,{options:{positivePattern:null,negativePattern:null,symbol:null,displayFactor:null},_create:function(){$.ui.igEditor.prototype._create.apply(this,[6])}})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Tree 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *  jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.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",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(options,element){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"pathSeparator":throw new Error($.ig.Tree.locale.setOptionError+option);case"loadOnDemand":throw new Error($.ig.Tree.locale.setOptionError+option);case"initialExpandDepth":throw new Error($.ig.Tree.locale.setOptionError+option);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;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(index,element){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"&&!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 instanceof $.ig.HierarchicalDataSource)){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")){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{$(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(dropElem){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)===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)}return valid},_validateBindings:function(sourceBinding,destinationBinding){var valid=true;if(destinationBinding.hasOwnProperty("primaryKey")){if(!sourceBinding.hasOwnProperty("primaryKey")||sourceBinding.primaryKey!==destinationBinding.primaryKey){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(event){$(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();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);ul.html(this._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>";ul=$(ul);ul.appendTo(this.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,tempPath;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+'">'+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}if(typeof $.ig.tmpl==="function"){div.html($.ig.tmpl(template,data));if(div.children("a").length<=0){html='<a href="'+href+'" target="'+target+'">'+div.html()+"</a>"}else if(!div.children("a").attr("href")){div.children("a").attr({href:href,target:target});
html=div.html()}else{html=div.html()}}else{$.tmpl(template,data).appendTo(div);if(div.children("a").length<=0){html='<a href="'+href+'" target="'+target+'">'+div.html()+"</a>"}else if(!div.children("a").attr("href")){div.children("a").attr({href:href,target:target});html=div.html()}else{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 if(event.shiftKey&&opt.multipleSelection){opt=this.options}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 if(event.shiftKey&&opt.multipleSelection){opt=this.options}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 if(event.shiftKey&&opt.multipleSelection){opt=this.options}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 if(event.shiftKey&&opt.multipleSelection){opt=this.options}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,originalData=this.nodeDataFor(this._populatingNode.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(this._populatingNode.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,this._populatingNode.node);this._triggerRendering(newData);ul.append(this._initChildrenRecursively(this._populatingNode.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.toggle(this._populatingNode.node);this._populatingNode.indicator.hide();this._populatingNode.indicator.destroy();this._populatingNode=null;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]"),self=this;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(index,element){if($(element).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)||!originalData[binding.childDataProperty]||originalData[binding.childDataProperty].length===0){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)||!originalData[binding.childDataProperty]||originalData[binding.childDataProperty].length===0){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){this.expand(node)}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;switch(item){case binding.textKey:value=typeof data[item]==="function"?data[item]():data[item];element.children("a").text(value);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(){var dataOpt;dataOpt=this._initDataOptions();this._initDataSource(dataOpt);this._triggerDataBinding();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){this.expand(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 opt=this.options,css=this.css,nodeId=node.attr("data-path");if(!this._selectedNode){this._selectedNode=[{path:null,element:null,data:null,binding:null}]}if(opt.multipleSelection){opt=this.options}else{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(index,element){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(index,element){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(index){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(index){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(!node||node.length<=0){return}if(!nodeIndex&&typeof parent==="number"){nodeIndex=parent;parent=null}var ul,path,checked,isLi,li,isEmpty,r,binding;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){li=$(this._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){li=$(this._initChildrenRecursively(path,node,parseInt(ul.attr("data-depth"),10),checked,ul.children("li").length)).appendTo(ul)}else{li=$(this._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(index,value){r.push($(value).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(index,value){self.removeAt($(value).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(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:"14.1.20141.1020"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 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
 */
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",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}],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:null,enableResizeContainerCheck:true},events:{cellClick:"cellClick",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},_createWidget:function(options,element){this.options.columns=[];this.options.features=[];if(options&&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)},_setOption:function(key,value){var header,isScrolling,hasWidthInPercent=this._gridHasWidthInPercent(),caption;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==="accessibilityRendering"||key==="rowVirtualization"||key==="columnVirtualization"||key==="fixedHeaders"||key==="scrollbars"){throw new Error($.ig.Grid.locale.optionChangeNotSupported+" "+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){this._gridInnerWidth=this._vdisplaycontainer().width()+this._scrollbarWidth()}else{this._gridInnerWidth=this.scrollContainer().width()}}if(this.options.width!==null&&this.options.height!==null){this._updateGridContentWidth()}}else{throw new Error($.ig.Grid.locale.optionChangeNotScrollingGrid+" "+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)}}else{throw new Error($.ig.Grid.locale.optionChangeNotScrollingGrid+" "+key)}}else if(key==="dataSource"){this.options.dataSource=value;this.dataBind();this._adjustLastColumnWidth(true)}else if(key==="showHeader"){header=this.headersTable();if(header.length>0&&header.is("table")){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,_create:function(){var grid=this,i,container,attr;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.css("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._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.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._cellClickHandler=function(event){var $et=$(event.target),row=$et.closest("tr"),key=row.attr("data-id"),colKey,$td,res,colIndex=$et.closest("td").index(),dataColIndex=colIndex-row.children("td.ui-iggrid-expandcolumn,th").length;if(key===""||key===null||key===undefined){key=row.index()}if(grid.hasFixedColumns()){$td=$(event.target);if(!$td.is("td")){$td=$(event.target).closest("td")}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")){grid._trigger(grid.events.cellClick,event,{rowIndex:row.index(),rowKey:key,colIndex:colIndex,colKey:colKey,cellElement:event.target,owner:grid})}};this.element.bind({click:this._cellClickHandler});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&&$.ig.util.browserVersion<=10){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)}},hasFixedDataSkippedColumns:function(){return this._hasFixedDataSkippedColumns},hasFixedColumns:function(){if(this._hasFixedDataSkippedColumns||this._fixedColumns!==null&&this._fixedColumns!==undefined&&this._fixedColumns.length>0){return true}return false},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){var result={colInd:colInd,isFixed:isFixed,fixedColsCount:colsCount,isInit:isInit,visibleIndex:visibleIndex};this._fireInternalEvent("_columnFixed",result)},_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;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()}}},_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;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]}return this.table.rows[i].cells[x]},cellById:function(rowId,columnKey){var colIndex,i,cols,row,skippedCells,isFixed=this.isFixedColumn(columnKey);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)+")")},fixedTable:function(){if(this._fixedTable===undefined){this._fixedTable=this.element[0]}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().children("tbody").children("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},activeCell:function(){return this._activeCell},activeRow:function(){if(this._activeRow){if(this.hasFixedColumns()){if(this._activeFixedRow){this._activeRow.fixedElement=this._activeFixedRow.element}else{this._activeRow.fixedElement=this.fixedBodyContainer().find("tbody tr:nth-child("+(this._activeRow.index+1)+")")}}else if(this._activeRow.fixedElement){this._activeRow.fixedElement=null}}return this._activeRow},selectedCell:function(){return this._selectedCell},selectedRow:function(){return this._selectedRow},selectedCells:function(){return this._selectedCells},selectedRows:function(){return this._selectedRows},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+" "+rowId)}return rec[colKey]}if(id>=this.dataSource.dataView().length){throw new Error($.ig.Grid.locale.indexOutOfRange)}if($.type(colKey)==="string"){return this.dataSource.dataView()[id][colKey]}if(cols.length<=colKey){throw new Error($.ig.Grid.locale.columnIndexOutOfRange)}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+" "+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(id){var key;key=this._normalizedKey(id);this.dataSource.commit(key);if(this.options.virtualization||this.options.rowVirtualization||this.options.columnVirtualization){this._renderVirtualRecords()}else{this._renderData()}},rollback:function(id,updateUI){var rec,tr,key;key=this._normalizedKey(id);this.dataSource.rollback(key);if(updateUI===true&&id!==null&&id!==undefined){if(this.options.primaryKey!==null){rec=this.dataSource.findRecordByKey(key);if(rec===undefined||rec===null){throw new Error($.ig.Grid.locale.recordNotFound+" "+id)}tr=this.element.find("tr[data-id='"+id+"']")[0]}else{if(key>=this.dataSource.dataView().length){throw new Error($.ig.Grid.locale.indexOutOfRange)}rec=this.dataSource.dataView()[key];tr=this.rowAt(key)}$(tr).removeClass(this.css.deletedRecord);tr._deleted=null;this._renderRow(rec,tr)}else if(id===true||updateUI===true){this.dataBind()}if((updateUI===true||updateUI===undefined)&&(id===undefined||id===null)){this._renderData()}},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,rowId){var i,td,col,id=0,css,cols=this.options.columns,content,index;for(i=0;i<tr.cells.length;i++){td=$(tr.cells[i]);css=td[0].className;if(id>0||!(td.attr("data-skip")||css&&(css.indexOf("-expandcolumn")>0||css.indexOf("-rowselector")>0))){while(true){col=cols[id];if(!col){return tr}if(!col.hidden){break}id++}if(col.template&&col.template.length){content=this._renderTemplatedCell(rec,col);if(content.indexOf("<td")===0){td.html($(content).html())}else{td.html(content)}}else{td.html(this._renderCell(rec[col.key],col,rec))}id++}}return tr},renderNewRow:function(rec,key){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+" "+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()},dataBind:function(internal){var dataOptions,i,noCancel=true,noCancelRendering=true;if(!this._initialized){noCancelRendering=this._trigger(this.events.rendering,null,{owner:this})}if(noCancelRendering){noCancel=this._trigger(this.events.dataBinding,null,{owner:this});if(internal===undefined){this.options.requiresDataBinding=true}if(noCancel){if(this.options.requiresDataBinding){if(this._hasUnboundColumns){this._rebindUnboundColumns=true}dataOptions=this._generateDataSourceOptions(this.options);this._setupDataSource(dataOptions);this._dataOptions=dataOptions;if(!this._initialized){if(this.element.is("div")){this._isWrapped=true;this.element=$("<table></table>").appendTo(this.element).attr("id",this.id()+"_table");this.element.data("igGrid",this)}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._trigger("headerExtraCellsModified",null,{owner:this})}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.setUnboundValues(key,metadataUC)}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}}}}},_generateDataSourceOptions:function(options){var schema,dataOptions,t,headers,i;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&&this.options.dataSource.tagName&&this.options.dataSource.nodeType){t=$(this.options.dataSource);if(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};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()}if(this.options.dataSource instanceof $.ig.DataSource&&(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)||!(this.options.dataSource instanceof $.ig.DataSource)){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,i,rec,prop,count=0,cols=this.options.columns,ds=this.options.dataSource,cl,counter=0;if(ds instanceof $.ig.DataSource){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;if(cols.length>0&&!this.options.autoGenerateColumns){if(this.options.dataSource&&this.options.dataSource.schema&&this.options.dataSource.schema()&&this.options.dataSource.schema()instanceof $.ig.DataSchema&&this.options.dataSource.schema()&&this.options.dataSource.schema().schema){schema=this.options.dataSource.schema().schema}else{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}}}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++){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},_setupDataSource:function(dataOptions){var callee;if(!(this.options.dataSource instanceof $.ig.DataSource)){if($.type(dataOptions.dataSource)==="string"&&(this.options.jsonpRequest||$.ig.util.isJsonpUrl(dataOptions.dataSource))){this.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){this.dataSource=new $.ig.RESTDataSource(dataOptions)}else{this.dataSource=new $.ig.DataSource(dataOptions)}}else{this.dataSource=this.options.dataSource;if(this.dataSource.settings.responseDataKey!==null){delete dataOptions.responseDataKey;if(dataOptions.schema){dataOptions.schema.searchField=this.dataSource.settings.responseDataKey}}this._tds=this.dataSource.settings.dataSource;this.dataSource.settings.dataSource=null;if($.ig.util.isIE8&&dataOptions.callee){callee=dataOptions.callee;dataOptions.callee=null}this.dataSource.settings=$.extend(true,{},this.dataSource.settings,dataOptions);if($.ig.util.isIE8&&callee){this.dataSource.settings.callee=callee}this.dataSource.settings.dataSource=this._tds;this._tds=null;if(dataOptions.schema){this.dataSource._initSchema()}}},_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;if(ds instanceof $.ig.DataSource){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:i+1,dataType:$.ig.getColType(r[i]),hidden:false};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}}}}}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"),ar=this.options.accessibilityRendering;this._cancelRendering=false;if(!this._initialized){if($.type(this.options.virtualization)==="number"&&this.dataSource.dataView().length>this.options.virtualization&&this.options.height!==null){this.options.virtualization=true}if(ar){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)}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);if(ar){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></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.empty()}},_setContainerWidth:function(element,rendered){var cols=this._visibleColumns(),width=0;if(cols.length>0){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&&(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,containerWidth,totalWidth,scrollbarWidth=this._scrollbarWidth(),id=this.id()+"_scroll",dataContainer,scrollDiv='<div id="'+id+'"></div>';this.element.wrap(scrollDiv);dataContainer=this.element.parent();if(this.options.accessibilityRendering){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");containerWidth=dataContainer.width();totalWidth=this._getHScrollContainerInner().width();dataContainer.bind("scroll",function(e){var container=$(this),hScroller=self._hscrollbarcontent(),containerLeft=container.scrollLeft(),hScrollerLeft=hScroller.scrollLeft();if(containerLeft!==hScrollerLeft){if(totalWidth===0){totalWidth=self._getHScrollContainerInner().width()}if(containerLeft+containerWidth>totalWidth+scrollbarWidth){container.scrollLeft(hScrollerLeft)}else{hScroller.scrollLeft(containerLeft)}}})}}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)}}},_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){div.css("overflow-y","hidden")}}},_createVirtualGrid:function(){var id=this.id(),grid,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><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().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().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());this._virtualcontainer().css("width",this.options.width).css("max-width",this.options.width);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.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(event){grid._isMouseOverVirtualTable=true},mouseleave:function(event){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()}}};$(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(event){grid._virtualScrollMouseDown=true}})}if(this.options.virtualization===true||this.options.columnVirtualization===true){this._vhorizontalcontainer().bind({scroll:function(event){grid._onVirtualHorizontalScroll(event)}})}if(this._vhorizontalcontainer().length===0&&this.options.width!==null){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;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","100%")}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){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"){this._startRowIndex=Math.ceil(scrollContainer.scrollTop()/parseInt(this.options.avgRowHeight,10));if(!isIE&&this._startRowIndex===this._oldStartRowIndex&&this._virtualScrollMouseDown){if(scrollTopDiff>0&&scrollTopDiff<parseInt(this.options.avgRowHeight,10)){this._startRowIndex++;scrollContainer.scrollTop(scrollContainer.scrollTop()-scrollTopDiff+parseInt(this.options.avgRowHeight,10))}else if(scrollTopDiff<0&&Math.abs(scrollTopDiff)<parseInt(this.options.avgRowHeight,10)){this._startRowIndex--;scrollContainer.scrollTop(scrollContainer.scrollTop()-scrollTopDiff-parseInt(this.options.avgRowHeight,10))}}if(this._startRowIndex>this._totalRowCount-this._virtualRowCount){this._startRowIndex=this._totalRowCount-this._virtualRowCount}if(this._startRowIndex<0){this._startRowIndex=0}this._oldStartRowIndex=this._startRowIndex;this._renderVirtualRecords()}else if(mode==="continuous"){this._virtualScrollToInternal(current)}this._oldScrollTop=scrollContainer.scrollTop()},_scrollContainer:function(){if(!this._scrollContainerObj||this._scrollContainerObj.length===0){this._scrollContainerObj=this.container().find("#"+this.id()+"_scrollContainer")}return this._scrollContainerObj},_onVirtualHorizontalScroll:function(event){var id=this.id(),internallyTriggered=event===undefined,horizontalScrollContainer=this._vhorizontalcontainer(),scrollLeft=horizontalScrollContainer.scrollLeft(),hiddenContentWidth=horizontalScrollContainer[0].scrollWidth-horizontalScrollContainer[0].offsetWidth,deltaScroll=scrollLeft-this._oldScrollLeft;if(!internallyTriggered&&Math.abs(deltaScroll)<5&&$.ig.util.isIE&&!$.ig.util.isIE){return}if(this.options.virtualization===true&&this.options.virtualizationMode==="continuous"){this._setDisplayContainerScrollLeft(this._getDisplayContainerScrollLeft()+deltaScroll);this._oldScrollLeft=horizontalScrollContainer.scrollLeft();this.container().find("#"+id+"_headers_v").scrollLeft(this.container().find("#"+id+"_headers_v").scrollLeft()+deltaScroll);this.container().find("#"+id+"_footer_container").scrollLeft(this.container().find("#"+id+"_footer_container").scrollLeft()+deltaScroll);return}this._isHorizontal=true;if(hiddenContentWidth>0){this._startColIndex=Math.ceil(scrollLeft*this._totalColumnCount/hiddenContentWidth);this._startColIndex=Math.min(this._startColIndex,this._totalColumnCount-this._virtualColumnCount)}else{this._startColIndex=0}if(internallyTriggered||this._oldStartColIndex!==this._startColIndex){this._renderVirtualRecords();this._trigger("virtualhorizontalscroll",null,{startColIndex:this._startColIndex,endColIndex:this._startColIndex+this._virtualColumnCount-1})}this._oldScrollLeft=horizontalScrollContainer.scrollLeft();this._oldStartColIndex=this._startColIndex},_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>").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._scrollData,this)));if(parent){sb.insertAfter(parent)}},_updateVirtualHorizontalScrollbar:function(){var horizontalScrollContainerInner,horizontalScrollContainer;horizontalScrollContainerInner=this.container().find("#"+this.id()+"_horizontalScrollContainer div");horizontalScrollContainerInner.css("width",this._calculateContainerWidth(false));horizontalScrollContainer=this._vhorizontalcontainer();if(horizontalScrollContainer.width()>horizontalScrollContainerInner.width()){horizontalScrollContainer.css("display","none")}else{horizontalScrollContainer.css("display","")}},_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){var grid=this,found,nColArray,movingParams,hcPreserve;nColArray=this._buildColumnLayoutArray();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)}column=movingParams.column;target=movingParams.target;after=movingParams.after;if(found===false){throw new Error($.ig.Grid.locale.movingNotAllowedOrIncompatible)}if(inDom===true){this._loadingIndicator.show();setTimeout(function(){grid._columnMovingResets();grid._performDomColumnMove(column,target,after,nColArray);grid._loadingIndicator.hide()},0)}else{this._columnMovingResets();this._performColumnMove(column,target,after,nColArray)}},_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(){var i=0,j=0,col,id,colrs,l,x=0,cCols=this._oldCols?jQuery.extend(true,[],this._oldCols):jQuery.extend(true,[],this.options.columns),nCols,level=0,width=this.container().find("#"+this.id()+" colgroup:first>col").not("[data-skip=true]").length,height=this.container().find("#"+this.id()+(this.options.fixedHeaders===true?"_headers ":" ")+"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){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){j=this._getColIdxById(subset,movingParams.target);if(typeof movingParams.target==="number"){movingParams.target=subset[j].key||subset[j].identifier;if(j<i){movingParams.after=false}else{movingParams.after=true}}if(j||j===0){success=success&&this._rearrangeArray(subset,i,1,movingParams.after===true?j+1:j);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}}}},_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){var rmil,movedColumn,targetColumn,targetIndex,targetObject,spStart,spEnd,i,j,cols,n,header;header=this.container().find("#"+this.id()+(this.options.fixedHeaders===true?"_headers ":" ")+">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){var i,j,spTrs,header,skip,ths,$tr,tar;
header=this.container().find("#"+this.id()+(this.options.fixedHeaders===true?"_headers ":" ")+"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){var rmil=this._moveColumnInHeader(column,target,after,nColArray),movedColumn=rmil[0],targetColumn=rmil[1],footer;this._moveSpecialThs(movedColumn,targetColumn,after);if(this.options.fixedHeaders===true){this._moveCols(this.container().find("#"+this.id()+"_headers>colgroup"),movedColumn,targetColumn,after)}this._moveColumnInBodyFooter(this.element.find(">tbody"),movedColumn,targetColumn,after);this._moveCols(this.element.find(">colgroup"),movedColumn,targetColumn,after);if(this.options.fixedFooters===true){footer=this.footersTable();this._moveColumnInBodyFooter(footer.children("tfoot"),movedColumn,targetColumn,after);this._moveCols(footer.children("colgroup"),movedColumn,targetColumn,after)}else{this._moveColumnInBodyFooter(this.element.find("tfoot"),movedColumn,targetColumn,after)}this._trigger("_columnsmoved",null,{owner:this,start:movedColumn.start,len:movedColumn.length,index:after===true?targetColumn.start+targetColumn.length:targetColumn.start})},_performColumnMove:function(column,target,after,nColArray){var rmil=this._moveColumnInHeader(column,target,after,nColArray),movedColumn=rmil[0],targetColumn=rmil[1];if(this.options.fixedHeaders===true){this._moveCols(this.container().find("#"+this.id()+"_headers>colgroup"),movedColumn,targetColumn,after)}this._renderData();this._renderFooter();this._rerenderColgroups()},showColumn:function(column){var grid=this;this._loadingIndicator.show();if(!this._isShowingAllowed([column])){return false}setTimeout(function(){grid._setHidden(column,false);grid._loadingIndicator.hide()},0);return true},hideColumn:function(column){var grid=this;this._loadingIndicator.show();if(!this._isHidingAllowed([column])){return false}setTimeout(function(){grid._setHidden(column,true);grid._loadingIndicator.hide()},0);return true},_setHidden:function(column,hidden){var col;if(typeof column==="number"){col=this.options.columns[column]}else{col=this.columnByKey(column)}if(col&&col.hidden!==hidden){this._setHiddenColumns([col],hidden,false)}},_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,self=this,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,visibleColumnsLength,visibleColumnsWithWidthLength,gridWidth,hasNoWidthPercentage,overflow,colgroup;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._virtualDom=null}});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)}});this._cleanupTBody();columnNumberChanged=true;if(hasVirtualization){this._renderVirtualRecords()}else{this._renderRecords()}}if(columnNumberChanged){if(!this._initialized){this._rerenderColgroups(initial);this._adjustLastColumnWidth(true)}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{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._fireInternalEvent("_hidingFinished",{columns:columns,hidden:hidden});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"){gridWidth+=this._calculateSpecialColumnsWidth();this._vdisplaycontainer().css("width",gridWidth).css("max-width",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.isFF||$.ig.util.isIE8)){hasNoWidthPercentage=false;if($.ig.util.isIE8&&typeof this.options.width==="string"&&this.options.width.indexOf("%")!==-1){this.container().hide();setTimeout(function(){self.container().show()},0)}if(this.options.fixedHeaders===true&&this.options.height!==null||this.options.showHeader===false){colgroup=this.element.children("colgroup").detach();this.element.prepend(colgroup);if(this.options.width||this.options.defaultColumnWidth&&this.options.defaultColumnWidth.indexOf("%")===-1){hasNoWidthPercentage=true}colgroup.find("col").each(function(){var w=this.style.width;if(w&&w.indexOf("%")===-1){hasNoWidthPercentage=false;return false}})}overflow=this.element[0].style.overflow;this.element[0].style.overflow="hidden";setTimeout(function(){self.element[0].style.overflow=overflow},0);if(this.options.showHeader){colgroup=this.headersTable().children("colgroup").detach();this.headersTable().prepend(colgroup);if(hasNoWidthPercentage){overflow=this.headersTable()[0].style.overflow;this.headersTable()[0].style.overflow="hidden";setTimeout(function(){self.headersTable()[0].style.overflow=overflow},0)}}if(this.options.fixedFooters===true&&this.options.height!==null){colgroup=this.footersTable().children("colgroup").detach();this.footersTable().prepend(colgroup);if(hasNoWidthPercentage){overflow=this.footersTable()[0].style.overflow;this.footersTable()[0].style.overflow="hidden";setTimeout(function(){self.footersTable()[0].style.overflow=overflow},0)}}}},_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=$("#"+this.id()+"_horizontalScrollContainer"),scrLeft=scroller.scrollLeft(),headers,displayContainer,footers;if(scroller.length===0&&horizontalScrollContainer.length===1){displayContainer=$("#"+this.id()+"_displayContainer");scrLeft=displayContainer.scrollLeft()}else{scrollContainer.scrollLeft(scrLeft);scrLeft=scrollContainer.scrollLeft();scroller.scrollLeft(scrLeft)}if(hasFixedHeaders){headers=this.headersTable().parent();headers.scrollLeft(scrLeft)}if(hasFixedFooters){footers=this._fixedfooters();footers.scrollLeft(scrLeft)}},_updateFixedGridContentWidth:function(minAllowWidth){var fixedContainerWidth=0,gridW,gridInnerWidth;$.each(this._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}});this._setGridFixedTablesWidth(fixedContainerWidth);if(this._gridHasWidthInPixels()){gridW=parseInt(this.options.width,10);gridInnerWidth=gridW-parseInt(this.fixedContainer().outerWidth(),10);this._hscrollbar().css("width",gridInnerWidth+"px");if(this.options.height!==null){this._gridInnerWidth=gridInnerWidth;this._gridInnerWidth=this.scrollContainer().width();this._updateHScrollbarVisibility()}}},_updateGridContentWidth:function(){var gridWidth=0,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){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)},_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)},_increaseLastHeaderCellVScrollbarPadding:function(table,paddingIncrement){var 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;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 scrollerContainer=this._hscrollbar(),scrollerWasHidden=scrollerContainer.css("display")==="none";scrollerContainer.css("display","");if(this._gridInnerWidth<this._gridContentWidth){if(this.options.virtualizationMode==="continuous"&&scrollerContainer.length===0&&this._getHScrollContainerInner().length===0){this._renderHorizontalScrollContainer(this._calculateContainerWidth(false));scrollerWasHidden=true}if(scrollerWasHidden){if(this.options.autoAdjustHeight){this._initializeHeights()}}}else{if(this.options.virtualizationMode==="continuous"&&scrollerContainer.length===0&&this._getHScrollContainerInner().length===1){this._vhorizontalcontainer().empty().attr("style","");scrollerWasHidden=false}scrollerContainer.css("display","none");if(!scrollerWasHidden){if(this.options.autoAdjustHeight){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.fixedHeaders?this._gridContentWidth-this._scrollbarWidth():this._gridContentWidth;this._getHScrollContainerInner().css("width",w)}this._updateHScrollbarVisibility()}if(v===false){this._setGridTablesWidth(gridContentWidth)}},_setGridFixedTablesWidth: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.fixedTable().width(width);if(hasFixedHeaders){this.fixedHeadersTable().width(width)}if(hasFixedFooters){this.fixedFootersTable().width(width)}},_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.children("th, td").not("[data-skip=true]")},position,this._detachedHeaderCells,col.key)}else{this._detachCells(headerCells,function(row){return 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></tbody>").appendTo(this.element).addClass(this.css.baseContentClass).addClass(this.css.gridTableBodyClass).addClass(this.css.recordClass)}}return tbody},_captureInitiallyHiddenColumns:function(){this._initialHiddenColumns=$.grep(this.options.columns,function(column,index){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){this._setRenderUndobundValues(values,key)},_setRenderUndobundValues: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._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){if(!(this._isDataBoundCalled===true&&success===undefined)||success!==undefined){this._trigger(this.events.dataBound,null,{owner:this});this._isDataBoundCalled=false}var gridElement=this.element,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,formula){$.each(data,function(ind,val){val[key]=formula(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._setRenderUndobundValues(cols[i].unboundValues,key,true)}}else if(cols[i].formula!==null&&cols[i].formula!==undefined){f=null;if($.type(cols[i].formula)==="function"){f=cols[i].formula}else if(window[cols[i].formula]&&typeof window[cols[i].formula]==="function"){f=window[cols[i].formula]}if(f){ucFormulaFunction(data,f)}}else if(this._unboundValues[key]&&this._unboundValues[key].length>0){colsToUnbound.push(key)}}}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.setUnboundValues(key,this._unboundValues[key])}}}if(this.options.mergeUnboundColumns===false){this._mergeUnboundValues()}}if(success===false){noCancelError=this._trigger(this.events.requestError,null,{owner:this,message:errmsg});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._virtualDom=null;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.element.find("colgroup").length===0||this.element.find("colgroup").children().length===0){this._renderColgroup(this.element[0],false,false,this.options.autofitLastColumn)}this._renderFooter()}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){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._trigger(this.events.dataRendered,null,{owner:this});this._updateVirtualScrollContainer();this._fireInternalEvent("_dataRendered");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)}})}}if(isToRefreshUI){this._refreshUI()}this._fireInternalEvent("_gridRendered",this.container())},_refreshUI:function(){var self=this;self.container().hide();setTimeout(function(){self.container().show()},0)},_updateVirtualScrollContainer:function(){var headersHeight=0;this._totalRowCount=this._getTotalRowCount();if((this.options.virtualization||this.options.rowVirtualization)&&this._totalRowCount){if(this._avgRowHeight===undefined||this._avgRowHeight===null){this._avgRowHeight=this._calculateAvgRowHeight()}if(this.options.showHeader){headersHeight=this.headersTable().height()}if(this._totalRowCount*this._avgRowHeight<=parseInt(this.options.height,10)-headersHeight){this.element.height("");if(this.options.virtualizationMode==="fixed"){this.element.find(".ui-iggrid-virtualrow").height(this._avgRowHeight)}this._setScrollContainerHeight(this._totalRowCount*this._avgRowHeight)}else{this.element.height(this._initialVirtualHeight);if(this.options.virtualizationMode==="continuous"){this._setScrollContainerHeight(this._totalRowCount*this._avgRowHeight)}}}},_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},_adjustLastColumnWidth:function(colgroupsRerendered){var grid=this,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,specialColumnsWidth;if(hasHeight&&!hasVirtualization){if(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)){this._hasVerticalScrollbar=false}else{this._hasVerticalScrollbar=true}}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){gridWidth=parseInt(grid.options.width,10)}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{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($.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);this.element.height(ch-height);this._initialVirtualHeight=ch-height;heightChanged=true}}if(heightChanged){this._trigger("_heightChanged",null,{ch:ch,h:height})}}},_registerAdditionalEvents:function(){var css="ui-state-hover",topmostGrid=this.element.closest(".ui-iggrid-root").data("igGrid")||this;if(this.options.enableHoverStyles){if(this._hovEvts){this.element.unbind(this._hovEvts)}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}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){if(!topmostGrid._cancelHoveringEffects){$("td",tr).addClass(css)}}_hovTR=tr}},mouseleave:function(e){if(_hovTR){$("td",_hovTR).removeClass(css);_hovTR=null}}};this.element.bind(this._hovEvts)}},_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){if(cols[i].oWidth){desiredColWidth=cols[i].oWidth}else{desiredColWidth=cols[i].width}}else{desiredColWidth=defWidth;cols[i].width=defWidth}if(desiredColWidth){if(!desiredColWidth.charAt||!desiredColWidth.endsWith("%")){isPercentage=false}desiredColWidthNumber=parseInt(desiredColWidth,10);if(desiredColWidthNumber<=0){desiredColWidthNumber=undefined}}else{desiredColWidthNumber=undefined;isPercentage=false}if(desiredColWidthNumber){lastCol=$("<col></col>").appendTo(colgroup).css("width",desiredColWidth);lastColWidth=desiredColWidthNumber;totalColWidth+=desiredColWidthNumber;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&&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()}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 prime,grid=this,tbody=this.element.children("tbody"),ph,ds=this.dataSource.dataView(),i,d="",noCancel=true,tbodytmp;this._trigger("_rowsRendering",null,{owner:this,tbody:tbody,vrtWnd:{start:start,end:end}});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>"+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})}},_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){var hasFixedColumns=this.hasFixedColumns(),fixedCounters,unfixedCounters,prevColumn,cols=this._visibleColumns(),index=-1;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){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}})}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 i,j,row,c,val,headersTexts,headerText,vheaderNode,iRow,tr,ds=this.dataSource,data=ds.dataView(),key=this.options.primaryKey,noVirtualDom=this._virtualDom===null||this._virtualDom===undefined,visibleCols=this._visibleColumns();this._trigger("virtualrendering",null,{isBuiltVirtualDom:!noVirtualDom});if(this._startRowIndex===undefined||this._startRowIndex===null){this._startRowIndex=0}if(this._startColIndex===undefined||this._startColIndex===null){this._startColIndex=0}if(noVirtualDom){this._buildVirtualDom();if(this.options.adjustVirtualHeights===true){this._adjustVirtualHeights()}}else{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))}else{row=$(this._renderRecord(data[this._startRowIndex+i],i))}c=row.children();for(j=0;j<this._virtualColumnCount;j++){this._virtualDom[i][j].innerHTML=c[j+this._startColIndex].innerHTML;this._virtualDom[i][j].className=""}iRow=this._startRowIndex+i;tr=this._virtualDom[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)}}}}if(this._isHorizontal){this._isHorizontal=false;if((this.options.virtualization===true||this.options.columnVirtualization===true)&&parseInt(this.options.width,10)>0){if(!this._vheaders){headersTexts=this.headersTable().find("thead > tr > th > a > span:first-child");if(headersTexts.length>0){this._vheaders=headersTexts}else{this._vheaders=this.headersTable().find("thead > tr > th > span")}}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.html(headerText)}}}this._trigger("virtualrecordsrender",null,{owner:this,tbody:this.element.children("tbody"),dom:this._virtualDom,isBuiltVirtualDom:!noVirtualDom})},_updateVirtColCounters:function(){var visibleColsLength=this._visibleColumns().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))}}},_buildVirtualDom:function(){var grid=this,markup="",row,i,j,dataLinkFn,ar=this.options.accessibilityRendering,shouldHide=false,visibleCols=this._visibleColumns(),key=this.options.primaryKey,data=this.dataSource.dataView(),temp;if(this._startRowIndex===undefined||this._startRowIndex===null){this._startRowIndex=0;this._startColIndex=0;this._oldStartRowIndex=0;this._oldStartColIndex=0}this._virtualDom=[];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();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){grid._virtualDom[i][j]=row[0].cells[j]}}};this.element.children("tbody").empty();for(i=0;i<this._virtualRowCount;i++){shouldHide=false;this._virtualDom[i]=[];markup="";for(j=this._startColIndex;j<this._virtualColumnCount+this._startColIndex;j++){if(j>=this._totalColumnCount){break}if(ar){markup+='<td role="gridcell" aria-describedby="'+visibleCols[j].key+'"'}else{markup+="<td"}if(!data[i]){shouldHide=true;markup+="></td>"}else{if(this.options.autoFormat!==false){if(visibleCols[j].template&&visibleCols[j].template.length){temp=this._renderTemplatedCell(data[i],visibleCols[j]);if(temp.indexOf("<td")===0){markup+=temp.substring(3)}else{markup+=">"+temp}markup=grid._editCellStyle(markup,data[i],visibleCols[j].key||j)}else{markup+=grid._addCellStyle(data[i],visibleCols[j].key||j)+">"+this._renderCell(data[i][visibleCols[j].key],visibleCols[j],data[i])}}else{markup+=grid._addCellStyle(data[i],visibleCols[j].key)+">"+data[i][visibleCols[j].key]}markup+="</td>"}}row=$("<tr>"+markup+"</tr>").appendTo(this.element.children("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")}if(ar){row.attr("role","row")}if(data[i]){if(!_aNull(key)){row.attr("data-id",this._kval_from_key(key,data[i]))}else if(!_aNull(data[i].ig_pk)){row.attr("data-id",data[i].ig_pk)}}dataLinkFn(row,i,this._virtualColumnCount);if(i===data.length-1){break}}this._updateVirtualScrollContainer();this._trigger("virtualdombuilt",null,{rows:this.element.children("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.DataSourceLocale.locale.columnVirtualizationRequiresWidth)}return parseInt(this.options.width,10)/count}if(width===0||width<def){return def}return width/count},_scrollData:function(){var scroller=this._hscrollbarcontent(),scrollContainer;if(this.options.virtualization===true||this.options.rowVirtualization===true){scrollContainer=this._vdisplaycontainer()}else{scrollContainer=this.scrollContainer()}scrollContainer.scrollLeft(scroller.scrollLeft())},_scrollHeader:function(){var scroller=this._hscrollbarcontent(),headers=this.headersTable().parent();headers.scrollLeft(scroller.scrollLeft())},_scrollFooter:function(){var scroller=this._hscrollbarcontent(),footers=this._fixedfooters();footers.scrollLeft(scroller.scrollLeft())},_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,ar=this.options.accessibilityRendering,headerText=$("<span>"+column.headerText+"</span>").addClass(this.css.headerTextClass),markup="<th></th>",headerCell;if(ar){headerCell=$(markup).append(headerText).attr("id",this.id()+"_"+column.key).attr("role","rowheader").addClass(headerClass).data("columnIndex",index)}else{headerCell=$(markup).append(headerText).attr("id",this.id()+"_"+column.key).addClass(headerClass).data("columnIndex",index)}return headerCell},_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 header,id,headerDom,headerMarkup="",scrollc=this.scrollContainer(),noCancel=true,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){id=this.id();headerMarkup="<thead><tr data-header-row></tr></thead>";headerParent=this.container();width=scrollc.css("width");if(this.options.showHeader&&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").css("width",width);if(this.options.expandColWidth&&!this.options.width){headerParent.css("width",parseInt(width,10)+this.options.expandColWidth+"px")}if(o.width!==null){headerParent.css("width",o.width).css("max-width",o.width).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._hscrollbarcontent().bind("scroll",$.proxy(this._scrollHeader,this));this._renderColgroup(headerParent,true,false,this.options.autofitLastColumn)}else if(this.options.fixedHeaders!==true&&this.options.showHeader){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(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.showHeader){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></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(),o=this.options,elemParent,footerId=gridId+"_footer_container",footerMarkup='<tfoot 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;$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(this.options.width).appendTo($tableGridContainer.find("td"));$table=$("<table></table>").attr("cellpadding",0).attr("cellspacing",0).attr("border",0).appendTo($footer).addClass(this.css.gridFooterTableClass).attr("id",gridId+"_footers");$table.width(o.width);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){$footer.css("width",width)}}}if(o.expandColWidth&&!o.width){$footer.css("width",parseInt($footer.width(),10)+o.expandColWidth+"px")}this._hscrollbarcontent().bind("scroll",$.proxy(this._scrollFooter,this))}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);if(o.virtualization!==true&&o.rowVirtualization!==true&&o.columnVirtualization!==true){this._hscrollbarcontent().bind("scroll",$.proxy(this._scrollFooter,this))}}else{$tableGridContainer=tableGrid;$footer=$(footerMarkup).attr("id",footerId).insertBefore($tableGridContainer.find("tbody:eq(0)"))}$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){var i,key=this.options.primaryKey,ar=this.options.accessibilityRendering,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+'"'}if(ar){dstr+=' role="row">'}else{dstr+=">"}noVisibleColumns=true;$(cols).each(function(colIndex){if(cols[colIndex].hidden||cols[colIndex].fixed===true){return}noVisibleColumns=false;if(ar){dstr+='<td role="gridcell" aria-describedby="'+this.key+'"'}else{dstr+="<td"}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)+">"+grid._renderCell(data[this.key?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,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");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,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)+" "}dstr=dstr.trim();return dstr.length>0?' class="'+dstr+'"':dstr},_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 i,key=this.options.primaryKey,ar=this.options.accessibilityRendering,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+'"')}if(ar){darr.push(' role="row">')}else{darr.push(">")}$(cols).each(function(colIndex){if(cols[colIndex].hidden){return}if(ar){darr.push('<td role="gridcell" aria-describedby="'+this.key+'" ')}else{darr.push("<td ")}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)+">"+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-1]=grid._editCellStyle(darr[darr.length-1],data,this.key)}else{darr.push(grid._addCellStyle(data,this.key)+">"+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)}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,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)}else{this._tmplWrappers[key]=this._defaultTemplateFunc}}}},_scrollbarWidth:function(){if(!this._scrollbarWidthResolved){var $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{$div.parent().css({overflow:"auto"});$div.css({width:"100%"});this._scrollbarWidthResolved=50-$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,dataOptions,destroy){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+" "+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+" "+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(){this._trigger("virtualrendering");var mode=this.options.virtualizationMode;if(mode===undefined||mode===""){mode="continuous"}if(mode==="fixed"||this.options.columnVirtualization===true){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);if($.ig.util.isIE){sc.scrollTop(sc.scrollTop()+2);sc.scrollTop(sc.scrollTop()-2)}},_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:first");lastRow=this.container().find(tableId+" > tbody > tr: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.dataSource.dataView().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.dataSource.dataView().length-1){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},_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.dataSource.dataView().length-1){endIndexToBeLoaded=this.dataSource.dataView().length-1;startIndexToBeLoaded=endIndexToBeLoaded-this._virtualRowCount+1;hasOverflow=true}tbody.empty();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._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.dataSource.dataView().length-1){endIndexToBeLoaded=this.dataSource.dataView().length-1;startIndexToBeLoaded=endIndexToBeLoaded-this._virtualRowCount+1}tbody.empty();this._renderRecords(startIndexToBeLoaded,endIndexToBeLoaded);displayContainerScrollTop=0;maxScrollPos=this._getScrollContainerHeight()-this._getDisplayContainerHeight();if(maxScrollPos-3<=virtualScrollerY&&virtualScrollerY<=maxScrollPos+3){displayContainerScrollTop=1e4}this._setDisplayContainerScrollTop(displayContainerScrollTop)}avgRowHeight=this._calculateAvgRowHeight();if(avgRowHeight>this._avgRowHeight){this._avgRowHeight=avgRowHeight}this._startRowIndex=startIndexToBeLoaded;this._startColIndex=0;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){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(index){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(index){return this.offsetTop<visibleArea.bottom}).last();return lastVisibleTR},_determineVirtualRowCount:function(){var div,rowNumber=10,ds,rows="",i,height,avgRowHeight,displayContainerHeight,rowsPerPage,result;ds=this.dataSource.dataView();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)}div.html(rows);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(){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}this._scrollTo(0,true);this._renderRecords(this._virtualRowCount-1);this._avgRowHeight=this._calculateAvgRowHeight();this._setScrollContainerHeight(this._totalRowCount*this._avgRowHeight)},_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;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']").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],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]},destroy:function(notToCallDestroy){var prev=this.container().prev(),i,prepend=false,a,attr;if(this._scrollHeader&&this._hscrollbarcontent().length>0){this._hscrollbarcontent().unbind("scroll",$.proxy(this._scrollHeader,this))}this._headerInitCallbacks=[];this._footerInitCallbacks=[];this.tmpDataSource=null;for(i=0;i<this.options.features.length;i++){if(this.element.data("igGrid"+this.options.features[i].name)){this.element["igGrid"+this.options.features[i].name]("destroy")}}if(prev.length===0){prev=this.container().parent();prepend=true}if(prepend){prev.prepend(this.element)}else{this.element.insertAfter(prev)}this.element.unbind("click",this._cellClickHandler);delete this._cellClickHandler;this.element.find("thead").empty();this.element.find("colgroup").empty();if(notToCallDestroy!==true){$.Widget.prototype.destroy.call(this)}if(this._isWrapped&&this.container().parent().data("igGrid")){this.container().parent().removeData("igGrid");if($.ui.igGrid.prototype.widgetFullName&&$.ui.igGrid.prototype.widgetFullName!=="igGrid"&&this.container().parent().data($.ui.igGrid.prototype.widgetFullName)){this.container().parent().removeData($.ui.igGrid.prototype.widgetFullName)}}this.container().remove();this._container=null;this.element.find("tbody").empty().removeClass(this.css.gridTableBodyClass).removeClass(this.css.gridRecordClass);this.element.removeClass(this.css.gridTableClass);if(this._resizeContainerHandler&&this.container().length>0){this.container()[0].detachEvent("onresize",this._resizeContainerHandler)}if(this._documentEvents){$(document).unbind(this._documentEvents)}this.element.unbind("iggriduisoftdirty",this._uiSoftDirtyHandler);this.element.trigger(this.events.destroyed,{owner:this});delete this._uiSoftDirtyHandler;if(this._resId){clearInterval(this._resId)}if(this._isWrapped){this.element.remove()}if(this._hovEvts){this.element.unbind(this._hovEvts);this._hovEvts=null}if(notToCallDestroy===true){return}if(this.dataSource){this._dataSource=null;this.dataSource=null}this._dataOptions=null;this._originalOptions=null;this._padding=null;this._originalOptions=null;this._loadingIndicator=null;this._headerParent=null;this._footerParent=null;this._footer=null;this._hovEvts=null;this._lastDataCol=null;this._lastFooterCol=null;this._lastHeaderCol=null;if(this.element.is("table")){this.element.empty();if(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)}}return this}});$.extend($.ui.igGrid,{version:"14.1.20141.1020"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Multi Headers 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 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($){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"},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:{NotValidIndex:-1,FixingRefused:-2,AlreadyFixed:-3,AlreadyHidden:-4,UnfixingRefused:-5},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},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){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);this._trigger(this.events.columnUnfixed,null,{columnIdentifier:colKey,isGroupHeader:isGroupHeader,owner:grid})}return res},unfixColumn:function(colIdentifier,isGroupHeader){var col,self=this,res,colWidth,scrollContainer,fixedContainer,$fixedTable,$unfixedTable,hasDataSkippedColumns=this._hasDataSkippedColumns(true),fc,c,children,columnKeys,columnIndex,colKey,MCHchildren,key,$th,containerBody,containerHeader,colIdentifierType=$.type(colIdentifier),containerFooter,initialFixedColsIndex,i,j,cols=this.grid.options.columns,colsLength=cols.length,grid=this.grid,initialFixedColumnsLength=this.grid._fixedColumns.length,columnIndexes=[],visibleIndex,vI,inMCHGroup,gridId=grid.id();res={error:this.internalErrors.None,result:true,col:null,columnIndex:undefined};columnKeys=[];if(!isGroupHeader){if(colIdentifierType==="number"){columnIndex=colIdentifier}else if(colIdentifierType==="string"){for(i=0;i<colsLength;i++){if(cols[i].key===colIdentifier){columnIndex=i;break}}if(i===colsLength){res.result=false;res.error=this.internalErrors.NotValidIdentifier;return res}}col=cols[columnIndex];if(col===null||col===undefined){res.result=false;res.error=this.internalErrors.NotValidIdentifier;return res}if(col.fixed===false){res.result=false;res.error=this.internalErrors.AlreadyFixed;return res}colKey=col.key;columnKeys.push(colKey);visibleIndex=this._getVisibleIndex(colKey,true);$th=this.grid.container().find("#"+gridId+"_"+colKey);res.columnIndex=columnIndex;res.col=col;columnIndexes.push({cI:columnIndex,vI:visibleIndex});children=[col]}else{c=[];$th=this.grid.fixedHeadersTable().find("th[data-mch-id="+colIdentifier+"]");colKey=colIdentifier;MCHchildren=this.grid._getMultiHeaderColumnById(colIdentifier);children=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(!this.checkUnfixingAllowed(children)){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();containerBody=this._containers.body;containerHeader=this._containers.header;containerFooter=this._containers.footer;if(!containerHeader){containerHeader=containerBody}if(!containerFooter){containerFooter=containerBody}scrollContainer=containerBody.unfixedContainer;colWidth=-colWidth;if(this._hasWidthInPercent()&&this.grid._allColumnWidthsInPercentage){colWidth="-"+col.width}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,colKey,isGroupHeader);inMCHGroup=false}col=cols.splice(columnIndexes[i].cI,1);col[0].fixed=false;cols.splice(initialFixedColsIndex-j,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)}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;this.grid._hscrollbar().css({width:scrollContainer.width()+"px",left:0});if($.ig.util.isIE10||this._hasWidthInPercent()&&!this.grid._allColumnWidthsInPercentage){this.grid._hscrollbar().width("")}if(this.grid._fixedColumns.length===0&&(!hasDataSkippedColumns||this.options.fixingDirection==="right"||hasDataSkippedColumns&&!this.options.fixNondataColumns)){if(this.options.fixingDirection==="left"){this.unfixDataSkippedColumns()}fixedContainer=this._containers.body.fixedContainer;if(this._onMouseWheelHandler){scrollContainer.unbind({keydown:this._onKeyDown,mousewheel:this._onMouseWheelHandler});fixedContainer.unbind({mousewheel:this._onMouseWheelHandler});this._onKeyDown=null;this._onMouseWheelHandler=null}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"){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","")}containerHeader.unfixedTable.find("thead").eq(0).find("tr[data-header-row]").eq(0).css("height","")}else if(this.options.syncRowHeights){$fixedTable=this._containers.body.fixedTable;$unfixedTable=this._containers.body.unfixedTable;if(Math.abs($fixedTable.outerHeight()-$unfixedTable.outerHeight())>1||Math.abs($fixedTable.find("tr:last").offset().top-$unfixedTable.find("tr:last").offset().top)>1){this._syncRowsHeights($fixedTable,$unfixedTable);$unfixedTable.height($fixedTable.height())}}grid._updateHeaderColumnIndexes();grid._columnMovingResets();this._updateGridColWidths();this.grid._hscrollbarcontent().scrollLeft(0);if(isGroupHeader){this._changeStyleHeaderButton(colIdentifier,false,isGroupHeader)}else{for(i=0;i<columnKeys.length;i++){this._changeStyleHeaderButton(columnKeys[i],false,isGroupHeader)}}if(this.grid.element.data("igGridResizing")){this.grid._updateGridContentWidth()}fc=this.grid.element.data("igGridFeatureChooser");if(fc!==undefined&&fc!==null){fc._setSelectedState("ColumnFixing",colKey,false,false)}grid._adjustLastColumnWidth(true);return res},_getKeyByVisibleIndex:function(index,isFixed){var hasDataSkippedColumns=this._hasDataSkippedColumns(),cols,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}return cols[index].key},_unfixColumnByVisibleIndex:function(visibleIndex,colWidth,isDataSkip,inMCHGroup,colIdentifier,isGroupHeader){var grid=this.grid,containerBody=this._containers.body,containerHeader=this._containers.header,containerFooter=this._containers.footer,isMCH=grid._isMultiColumnGrid;if(!containerHeader){containerHeader=containerBody}if(!containerFooter){containerFooter=containerBody}this._getElementsByDOM(visibleIndex,containerHeader.fixedTable.find("thead").eq(0),"header",false,isDataSkip);this._getElementsByDOM(visibleIndex,containerBody.fixedTable.find("tbody").eq(0),"body",false,isDataSkip);this._getElementsByDOM(visibleIndex,containerFooter.fixedTable.find("tfoot").eq(0),"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(true);this._tds.header.detach();this._tds.body.detach();this._tds.footer.detach();if(inMCHGroup||isDataSkip){this._syncWidth(colWidth)}this._attachColgroups(true);if(grid.options.showHeader){this._unfixHeaderColumn()}this._unfixBodyColumn(visibleIndex);this._unfixFooterColumn(visibleIndex);if(grid.options.showHeader&&isMCH&&inMCHGroup){this._unfixMultiColumnHeader(colIdentifier,isGroupHeader)}},_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){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");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&&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(){var i,trs,dataSkippedColsLength,$unfixedThead,tdsFirst,oTable;if(this._containers.header){oTable=this._containers.header.unfixedTable}else{oTable=this._containers.body.unfixedTable}$unfixedThead=oTable.find("thead");tdsFirst=this._tds.header;trs=$unfixedThead.find("tr:not([data-mch-level],[data-skip])");if(this._hasDataSkippedColumns(true)&&this.options.fixingDirection==="right"){dataSkippedColsLength=this._getDataSkippedColumnsLength();for(i=0;i<trs.length;i++){$(tdsFirst[i]).insertAfter(trs[i].children[dataSkippedColsLength-1])}}else{for(i=0;i<trs.length;i++){$(tdsFirst[i]).prependTo(trs[i])}}},_unfixBodyColumn:function(colInd){var i,tdsFirst,dataSkippedColsLength,trs,oTable=this._containers.body.unfixedTable,scrollContainer=this._containers.body.unfixedContainer,oTableWidth=oTable.width();tdsFirst=this._tds.body;trs=oTable.find("tbody tr");if(this._hasDataSkippedColumns(true)&&this.options.fixingDirection==="right"){dataSkippedColsLength=this._getDataSkippedColumnsLength();for(i=0;i<trs.length;i++){$(tdsFirst[i]).insertAfter(trs[i].children[dataSkippedColsLength-1])}}else{trs.each(function(ind,tr){var $td=$(tdsFirst[ind]);$td.prependTo($(tr))})}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()){trs.height("")}if(this.grid.options.width===null){if(this.grid._fixedColumns.length===1){oTable[0].style.width=""}}},_unfixFooterColumn:function(colInd){var i,container=this._containers.footer,dataSkippedColsLength,oTable,tdsFirst,trs;if(!container){container=this._containers.body}oTable=container.unfixedTable;tdsFirst=this._tds.footer;trs=oTable.find("tfoot tr");if(this._hasDataSkippedColumns(true)&&this.options.fixingDirection==="right"){dataSkippedColsLength=this._getDataSkippedColumnsLength();for(i=0;i<trs.length;i++){$(tdsFirst[i]).insertAfter(trs[i].children[dataSkippedColsLength-1])}}else{trs.each(function(ind,tr){var $td=$(tdsFirst[ind]);$td.prependTo($(tr))})}if(this._isLastColumn()){trs.height("")}},_fixColumnInternal:function(colKey,isGroupHeader){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);if(res.error===this.internalErrors.FixingRefused||res.result===false){this._trigger(this.events.columnFixingRefused,null,{columnIdentifier:colKey,isGroupHeader:isGroupHeader,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){if(this.grid._visibleColumns(false).length-columns.length<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,hasHiddenUnfixed,hasHiddenFixed,oCols=this.grid.options.columns,oColsLength=oCols.length;for(i=0;i<oColsLength;i++){if(oCols[i].hidden){if(oCols[i].fixed&&!isToFix){hasHiddenFixed=true;break}if(!oCols[i].fixed&&isToFix){hasHiddenUnfixed=true;break}}}if(i===oColsLength){return true}if(isToFix&&this.grid._visibleColumns(false).length-columnsLength<1&&hasHiddenUnfixed||!isToFix&&this.grid._visibleColumns(true).length-columnsLength<1&&hasHiddenFixed){return false}return true},fixColumn:function(colIdentifier,isGroupHeader){var col,colWidth,columnIndex,res,i,j,children,$fixedTable,$unfixedTable,fc,colIdentifierType=$.type(colIdentifier),colKey,visibleIndex,isI,containerBody,containerHeader,shoulRerendedColgroups,grid=this.grid,gridId=grid.id(),$th,vI,isGridWidthPercentage=$.type(grid.options.width)==="string"&&grid.options.width.indexOf("%")!==-1,MCHchildren,$mainFixedContainer,mainFixedContainerWidth=0,gridWidth=parseInt(grid.options.width,10),columnIndexes=[],hasDataSkippedColumns=false,initialFixedColumnsLength=this.grid._fixedColumns.length,isInit=initialFixedColumnsLength===0,inMCHGroup,cols=this.grid.options.columns,colsLength=cols.length;res={error:this.internalErrors.None,result:true,col:null,columnIndex:colIdentifier,isGroupHeader:isGroupHeader};if(!isGroupHeader){if(colIdentifierType==="number"){columnIndex=colIdentifier}else if(colIdentifierType==="string"){for(i=0;i<colsLength;i++){if(cols[i].key===colIdentifier){columnIndex=i;break}}if(i===colsLength){res.result=false;res.error=this.internalErrors.NotValidIdentifier;return res}}col=cols[columnIndex];if(col===null||col===undefined){res.result=false;res.error=this.internalErrors.NotValidIdentifier;return res}if(col.fixed===true){res.result=false;res.error=this.internalErrors.AlreadyFixed;return res}visibleIndex=this._getVisibleIndex(col.key);colKey=col.key;$th=this.grid.container().find("#"+gridId+"_"+colKey);res.columnIndex=columnIndex;res.col=col;colKey=col.key;columnIndexes.push({cI:columnIndex,vI:visibleIndex})}else{$th=this.grid.headersTable().find("th[data-mch-id="+colIdentifier+"]");colKey=colIdentifier}if(!this.checkFixingAllowed([col],isGroupHeader)){res.result=false;res.error=this.internalErrors.FixingRefused;return res}if(isNaN(gridWidth)||isGridWidthPercentage){gridWidth=this.grid.container().outerWidth()}if($th.length===1||visibleIndex===undefined){colWidth=$th.outerWidth()}else{colWidth=this.grid.container().find("#"+gridId+" tbody tr:nth-child(1) td:nth-child("+(visibleIndex+1)+")").outerWidth()}shoulRerendedColgroups=false;if(col&&this.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(!isInit){$mainFixedContainer=this.grid.fixedContainer();mainFixedContainerWidth=$mainFixedContainer.outerWidth()}if(colWidth+mainFixedContainerWidth+this.grid._scrollbarWidth()>=gridWidth-parseInt(this.options.minimalVisibleAreaWidth,10)){res.result=false;res.error=this.internalErrors.FixingRefused;return res}this._populateContainers();if(isGroupHeader){MCHchildren=this.grid._getMultiHeaderColumnById(colIdentifier);children=MCHchildren.children;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;this.grid._fixedColumns.push(children[i])}}else{col.fixed=true;this.grid._fixedColumns.push(col)}containerBody=this._containers.body;containerHeader=this._containers.header;if(!containerHeader){containerHeader=containerBody}isI=isInit;if(this._hasWidthInPercent()&&grid._allColumnWidthsInPercentage){colWidth=col.width}if(isInit&&this.options.fixingDirection==="left"){hasDataSkippedColumns=this._hasDataSkippedColumns();if(hasDataSkippedColumns){this.fixDataSkippedColumns();isI=false}}inMCHGroup=true;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,colIdentifier,isGroupHeader);inMCHGroup=false}col=cols.splice(columnIndexes[i].cI,1);cols.splice(initialFixedColumnsLength+i,0,col[0]);this.grid._onColumnFixed(columnIndexes[i].cI,true,initialFixedColumnsLength+i+1,isI,vI);if(isI&&vI!==-1){isI=false}}if(isInit){if(grid.options.height===null){this._setDataHeightCompensate();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)}}}this.grid._visibleColumnsArray=undefined;this.grid._updateHeaderColumnIndexes();if(this.grid.options.width===null&&this.grid._fixedColumns.length===1){gridWidth=grid.container().outerWidth();grid.container().width(gridWidth)}grid._columnMovingResets();this._updateGridColWidths();this.grid._hscrollbarcontent().scrollLeft(0);this._changeStyleHeaderButton(colKey,true,isGroupHeader);if(isInit&&this.options.syncRowHeights){$fixedTable=this._containers.body.fixedTable;$unfixedTable=this._containers.body.unfixedTable;if(Math.abs($fixedTable.outerHeight()-$unfixedTable.outerHeight())>1||Math.abs($fixedTable.find("tr:last").offset().top-$unfixedTable.find("tr:last").offset().top)>1){this._syncRowsHeights($fixedTable,$unfixedTable);$unfixedTable.height($fixedTable.height())}}fc=this.grid.element.data("igGridFeatureChooser");if(fc!==undefined&&fc!==null){fc._setSelectedState("ColumnFixing",colKey,true,false)}if(shoulRerendedColgroups){this.grid._rerenderColgroups();this._updateHScrollbar()}grid._adjustLastColumnWidth(true);return res},_setDataHeightCompensate:function(){var grid=this.grid,h=grid.scrollContainer().height()-grid.element.outerHeight();if(h>this.scrollContainerCheckValue&&grid.fixedContainer().find("div[data-height-compensate]").length===0){$('<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._setDataHeightCompensate()}this.grid._updateGridContentWidth()}},_fixColumnByVisibleIndex:function(visibleIndex,colWidth,isInit,isDataSkip,inMCHGroup,colIdentifier,isGroupHeader){var grid=this.grid,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(!containerHeader){containerHeader=containerBody}if(!containerFooter){containerFooter=containerBody}this._getElementsByDOM(visibleIndex,containerHeader.unfixedTable.find("thead").eq(0),"header",isInit,isDataSkip);this._getElementsByDOM(visibleIndex,containerBody.unfixedTable.find("tbody").eq(0),"body",isInit,isDataSkip);this._getElementsByDOM(visibleIndex,containerFooter.unfixedTable.find("tfoot").eq(0),"footer",isInit,isDataSkip);this._getColgroups(visibleIndex);if(isInit&&this.options.syncRowHeights){this._setHeights("header");this._setHeights("body");this._setHeights("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(!($.ig.util.isFF&&isGridWidthPercentage)){this._tds.header.detach()}this._tds.body.detach();this._tds.footer.detach();this._detachColgroups();if(isInit){this._syncUnfixedWidth(colWidth);this._renderMainFixedContainer(colWidth)}else if(inMCHGroup){this._syncWidth(colWidth)}this._attachColgroups();this._fixBodyColumn(isInit);if(isToShowFooter){this._fixFooterColumn(isInit)}if(isToShowHeader){if(isMCH&&inMCHGroup){this._fixMultiColumnHeader(colIdentifier,isInit,isGroupHeader)}this._fixHeaderColumn(isInit);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},_renderMainFixedContainer:function(colWidth){var self=this,grid=this.grid,gridId=grid.id(),diff,functionRenderContainer,fixedBodyTable,fixedHeaderContainer,fixedFooterContainer,fixingDirection,syncScrollContainers,$mainFixedContainer,fixedBodyContainer,mainFixedContainerId=grid.id()+"_mainFixedContainer",scrollContainer,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(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({click:$.proxy(this.grid._cellClickHandler,this.grid)});if(this._hasWidthInPercent()){if(this.grid._allColumnWidthsInPercentage){$mainFixedContainer.css("width",colWidth)}else{colWidth=colWidth/(scrollContainer.find("table").width()+colWidth)*100;$mainFixedContainer.css("width",colWidth+"%")}}else{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");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{$("<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");$("<tfoot />").appendTo(fixedFooterContainer.find("table"));this._containers.footer.fixedTable.css("whiteSpace",this._containers.footer.unfixedTable.css("whiteSpace"));fixedFooterContainer.appendTo($mainFixedContainer)}else{$("<tfoot />").insertBefore(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;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}syncScrollContainers(direction);if(grid.options.height===null){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($.ig.util.isIE||this.options.fixingDirection==="right"){scrollContainer.bind({keydown:this._onKeyDown,mousewheel:this._onMouseWheelHandler,DOMMouseScroll:this._DOMMouseScroll})}scrollContainer.bind({scroll:function(){var top=$(this).scrollTop();fixedBodyContainer.scrollTop(top)}});fixedBodyContainer.bind({mousewheel:this._onMouseWheelHandler,DOMMouseScroll:this._DOMMouseScroll});if(this.options.fixingDirection==="right"){fixedBodyContainer.bind({scroll:function(){var top=$(this).scrollTop();scrollContainer.scrollTop(top)},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){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);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)}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)}},_attachColgroup:function(cols,$table,isFixed){var i,dataSkippedColsLength,colsLength=cols.length,$colgroup=$table.find("colgroup");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)}}}},_setHeights: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,$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(grid.options.virtualization===true||grid.options.rowVirtualization===true){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"),this.grid.container().find("#"+gridId+"_fixedHeaderContainer"),"header")}functionPopulateContainers(scrollContainer,$fixedBodyContainer,"body");if($unfixedFooters.length>0&&$unfixedFooters[0].nodeName!=="TFOOT"){functionPopulateContainers($unfixedFooters,undefined,"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){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(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)}}},_fixHeaderColumn:function(isInit){var self=this,$fixedThead,trs,$tr,syncRowHeights=this.options.syncRowHeights===true,$fixedTable,tdsFirst,$unfixedThead,tdsLength,j,$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){trs=$fixedThead.find("tr:not([data-mch-level],[data-skip])");tdsLength=tdsFirst.length;if(tdsLength>0){for(j=0;j<tdsLength;j++){$(tdsFirst[j]).appendTo(trs[j])}}}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){var grid=this.grid,i,heights,$trsUnfixed,$trs,trsLength,tr,scroller,$fixedTable,tdsFirst,fixedControllerScrollerId=grid.id()+"_fixedContainerScroller",$unfixedTable,syncDataIds,dataId,container=this._containers.body;$unfixedTable=container.unfixedTable;$fixedTable=container.fixedTable;tdsFirst=this._tds.body;if(isInit){trsLength=$unfixedTable.find("tbody tr").length;this._renderFixedRecords($fixedTable,0,trsLength-1,true);$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{$trs=$fixedTable.find("tbody tr");trsLength=$trs.length;for(i=0;i<trsLength;i++){tr=$trs[i];$(tdsFirst[i]).appendTo(tr)}}this._updateHScrollbar();if(grid.options.width===null&&$unfixedTable[0].style.width===""){$unfixedTable[0].style.width=$unfixedTable.outerWidth()+"px"}if(isInit){scroller=this.grid._hscrollbarcontent();if(scroller.length===1&&this.grid.container().find("#"+fixedControllerScrollerId).length===0){$('<div style="height:'+this.grid._hscrollbar().height()+'px" id="'+fixedControllerScrollerId+'"></div>').appendTo(container.fixedContainer)}}},_fixFooterColumn:function(isInit){var trs,heights,$fixedTable,tdsFirst,$tfoot,tdsLength,j,$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){trs=$fixedTable.find("tfoot tr");tdsLength=tdsFirst.length;if(tdsLength>0){for(j=0;j<tdsLength;j++){$(tdsFirst[j]).appendTo(trs[j])}}}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)});$fixedTable.find("tr").each(function(ind,$row){$(tdsFirst[ind]).appendTo($row)});if(this._hasDataSkippedColumns()&&this.grid._fixedColumns.length<=1){this._syncRowsHeights(this.grid.footersTable().find("tfoot"),this.grid.fixedFootersTable().find("tfoot"))}}},_syncRowsHeights:function($container,$containerToSync){var $trs=$container.find("tr"),$trsToSync=$containerToSync.find("tr");$trs.each(function(ind,tr){var h=$(tr).outerHeight(),hToSync=$($trsToSync[ind]).outerHeight();if(h>hToSync){hToSync=h}$($trsToSync[ind]).height(hToSync);$(tr).height(hToSync)})},_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){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)}},_syncUnfixedWidthByContainer:function(colWidth,$unfixedTable,scrollContainer){if($unfixedTable.length===0){return}var oTableWidth=parseInt($unfixedTable[0].style.width,10);if(isNaN(oTableWidth)){oTableWidth=$unfixedTable.outerWidth()}oTableWidth-=colWidth;$unfixedTable.width(oTableWidth)},_syncWidth:function(colWidth){var grid=this.grid,gridId=grid.id(),w,totalW,scrollContainer,$mainFixedContainer,$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(this._hasWidthInPercent()){updateFixedTable=false;$mainFixedContainer=grid.fixedContainer();w=parseFloat($mainFixedContainer[0].style.width);if(isNaN(w)){w=0}if(!grid._allColumnWidthsInPercentage){totalW=scrollContainer.find("table").width()/((100-w)/100);if(colWidth<0){colWidth=colWidth/$mainFixedContainer.width()*w/100*totalW}w+=colWidth/totalW*100;$mainFixedContainer.css("width",w+"%")}else{if($.type(colWidth)==="string"&&colWidth.indexOf("%")!==-1){colWidth=parseInt(colWidth,10);w+=colWidth;$mainFixedContainer.css("width",w+"%")}return}}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)}}},_updateHScrollbar:function(){var scrollContainer,grid=this.grid,$hScrollerContainer,oTableWidth=this._containers.body.unfixedTable.outerWidth();scrollContainer=this._containers.body.unfixedContainer;if(oTableWidth>0){scrollContainer.scrollTop(0);$hScrollerContainer=grid._hscrollbar();$hScrollerContainer.css({width:scrollContainer.width()-1+"px",left:0});if($.ig.util.isIE10||this._hasWidthInPercent()&&!grid._allColumnWidthsInPercentage){$hScrollerContainer.width("")}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;width=!width?0:parseInt(width,10);this._populateContainers();if(fixed){$bodyTbl=this._containers.body.fixedTable;if(this._containers.header){$headerTbl=this._containers.header.fixedTable}if(this._containers.footer){$footerTbl=this._containers.footer.fixedTable}}else{$bodyTbl=this._containers.body.unfixedTable;if(this._containers.header){$headerTbl=this._containers.header.unfixedTable}if(this._containers.footer){$footerTbl=this._containers.footer.unfixedTable}}funcUpdateTbl=function(nW,$tbl){var 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)}},_updateContainersWidth:function(colWidth,$unfixedContainer,$fixedContainer,updateFixedTable){var oTableWidth,width=0,$unfixedTable=$unfixedContainer.find("table"),$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()}oTableWidth=parseInt($unfixedTable[0].style.width,10);if(isNaN(oTableWidth)){oTableWidth=$unfixedTable.outerWidth()}oTableWidth-=colWidth;$unfixedTable.width(oTableWidth);if(updateFixedTable){width+=colWidth;$fixedTable.width(width)}},_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(event,ui){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("igGridGroupBy");break}}},_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(event){$(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,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)},_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.options.height===null&&$.ig.util.isIE&&$.ig.util.browserVersion>=9&&this.grid.hasFixedColumns()){this._syncTableHeights()}},_syncTableHeights:function(){$("#"+this.grid.id()+"_fixed").height(this.grid.element.height())},_gridInternalRendered:function(event,ui){var i,j,cs=this.options.columnSettings,csLength=cs.length,columnKeys=[],hasColumnKey,hasColumnIndex,cols=this.grid.options.columns,col,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++){this.fixColumn(columnKeys[j])}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()}},_preventDefaultEvent:function(event){event.preventDefault();event.stopPropagation()},_detachEvents:function(){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.unbind("iggridrendered",this._gridRenderedHandler);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)}},destroy:function(){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}$.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()}},_gridHeightChanging:function(e,arg){if(!this._containers.body){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){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,isSelected){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},_hasWidthInPercent:function(){var grid=this.grid,defaultColumnWidth=grid.options.defaultColumnWidth;if(grid._gridHasWidthInPercent()||grid._allColumnWidthsInPercentage){return true}if(defaultColumnWidth&&$.type(defaultColumnWidth)==="string"&&defaultColumnWidth.indexOf("%")!==-1){return true}return false},_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,index,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(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=[],$sc,$scTable,$trsFixedTable,$trsUnfixedTable,grid=this.grid,refreshHeight=$.ig.util.isIE&&grid.options.height!==null;if(refreshHeight){if(grid.options.virtualization===true||grid.options.rowVirtualization===true){$sc=this.grid._vdisplaycontainer()}else{$sc=this.grid.scrollContainer()}if($sc.length===0){$sc=this.grid.element}$scTable=$sc.find("table");if($scTable.length>0&&$scTable[0].style.height===""){this.grid.fixedBodyContainer().find("table").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(refreshHeight){this.grid.fixedBodyContainer().find("table").css("height",$scTable.height())}},_renderFixedRecords:function($table,start,end,onlyRows){var prime,grid=this.grid,tmpl,rs,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++){d+=this._renderFixedRecord(ds[i],i,onlyRows)}$table.find("tbody").html(d)}},_renderFixedRecord:function(data,rowIndex,onlyRows){var i,grid=this.grid,o=grid.options,key=o.primaryKey,ar=o.accessibilityRendering,dstr="",cols=grid._fixedColumns,noVisibleColumns;dstr+="<tr";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+'"'}if(ar){dstr+=' role="row">'}else{dstr+=">"}if(onlyRows===true){dstr+="</tr>";return dstr}noVisibleColumns=true;$(cols).each(function(colIndex){if(cols[colIndex].hidden||cols[colIndex].fixed!==true){return}noVisibleColumns=false;if(ar){dstr+='<td role="gridcell" aria-describedby="'+this.key+'"'}else{dstr+="<td"}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{dstr+=grid._addCellStyle(data,this.key?this.key:colIndex,true)+">"+grid._renderCell(data[this.key?this.key:colIndex],this,data)}dstr+="</td>"});if(noVisibleColumns){dstr+='<td role="gridcell"></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.children("th, td").not("[data-skip=true]")},position,grid._detachedHeaderCells,col.key)}else{grid._detachCells(headerCells,function(row){return 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,autofitLastColumn){var i,table,colgroup,w,totalWidth=0,cols=this.grid._visibleColumns(true);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},_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._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()}},_checkGridNotSupportedFeatures:function(){if(this.grid.options._isHierarchicalGrid){throw new Error($.ig.ColumnFixing.locale.hierarchicalGridNotSupported)}if((this.grid.options.width===null||this.grid.options.width==="")&&(this.grid.options.height===null||this.grid.options.height==="")){throw new Error($.ig.ColumnFixing.locale.noGridWidthHeightNotSupported)}var i,featureName,gridOptions=this.grid.options,features=gridOptions.features,featuresLength=features.length;if(featuresLength===1){return}if(gridOptions.virtualization===true||gridOptions.rowVirtualization===true&&gridOptions.height!==null||gridOptions.columnVirtualization===true&&gridOptions.width!==null){throw new Error($.ig.ColumnFixing.locale.virtualizationNotSupported)}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"columnmoving":throw new Error($.ig.ColumnFixing.locale.columnMovingNotSupported);case"responsive":throw new Error($.ig.ColumnFixing.locale.responsiveNotSupported)}}},_hidingFinishing:function(args){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})}}else{for(i=0;i<cols.length;i++){cols[i].hidden=false}this.grid._visibleColumnsArray=undefined;this.grid._rerenderColgroups()}},_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._applySyncRowHeights=true},_columnShown:function(event,ui){var i,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){this._updateSingleContainerWidth(col.width,true);if(this.grid.options.autofitLastColumn){this._updateSingleContainerWidth(-col.width,false);this.grid._rerenderColgroups();this.grid._adjustLastColumnWidth(false)}}this._populateContainers();this._updateHScrollbar();this.grid._columnMovingResets()},_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._updateHScrollbar()},_injectGrid:function(gridInstance,isRebind){this.grid=gridInstance;this._checkGridNotSupportedFeatures();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._headerRenderingHandler!==null&&this._headerRenderingHandler!==undefined){this.grid.element.unbind("iggridheaderrendering",this._headerRenderingHandler)}this._headerRenderingHandler=$.proxy(this._headerRendering,this);this.grid.element.bind("iggridheaderrendering",this._headerRenderingHandler);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._gridRenderedHandler!==null&&this._gridRenderedHandler!==undefined){this.grid.element.unbind("iggridrendered",this._gridRenderedHandler)}this._gridRenderedHandler=$.proxy(this._gridInternalRendered,this);this.grid.element.bind("iggridrendered",this._gridRenderedHandler);if(this.grid._fixedColumns===undefined){this.grid._fixedColumns=[]}if(this.grid.options.height===null&&$.ig.util.isIE&&$.ig.util.browserVersion>=9){if(this._dataRenderingHandler!==null&&this._dataRenderingHandler!==undefined){this.grid.element.unbind("iggriddatarendering",this._dataRenderingHandler)}this._dataRenderingHandler=$.proxy(this._dataRendering,this);this.grid.element.bind("iggriddatarendering",this._dataRenderingHandler);if(this._dataRenderedHandler!==null&&this._dataRenderedHandler!==undefined){this.grid.element.unbind("iggriddatarendered",this._dataRenderedHandler)}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:"14.1.20141.1020"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Column Moving 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 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($){$.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,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},css:{headerCellMouseOver:"ui-state-hover",dropDownButton:"ui-iggrid-moving-indicator",dropDownIndicatorContainer:"ui-iggrid-indicatorcontainer",dragIndicatorTop:"ui-iggrid-columnmoving-dragtop",dragIndicatorBottom:"ui-iggrid-columnmoving-dragbottom",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(options,element){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,value){if(key==="mode"||key==="columnSettings"||key==="addMovingDropdown"){throw new Error($.ig.Grid.locale.optionChangeNotSupported+" "+key)}$.Widget.prototype._setOption.apply(this,arguments)},destroy:function(){this._unregisterEvents();this._removeMoving();$.Widget.prototype.destroy.call(this);return this},moveColumn:function(column,target,after,inDom){this._moveColumn(column,target,after,inDom,true)},_headerCellRendered:function(event,args){if(this.grid.id()!==args.owner.id()){return}this._thRendered(args.th)},_headerRendering:function(event,args){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(event,args){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._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,args){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;a={owner:this,movingDialog:this._movingDialog,columnKey:col,columnIndex:idx,targetIndex:idx===0?parent.children().length-1:idx-1};if(idx===0){item.detach().insertAfter(parent.children("li:last"))}else{item.detach().insertBefore(parent.children("li:eq("+(idx-1)+")"))}this._cKey=col;this._cIdx=a.columnIndex;this._tIdx=a.targetIndex;this._moveColumn(col,iItem,iDir,this.options.moveType==="dom",false);this._trigger(this.events.movingDialogMoveUpButtonPressed,null,a)},_dialogDownPressed:function(event,args){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;a={owner:this,movingDialog:this._movingDialog,columnKey:col,columnIndex:idx,targetIndex:idx===parent.children().length-1?0:idx+1};if(idx===item.parent().children().length-1){item.detach().insertBefore(parent.children("li:first"))}else{item.detach().insertAfter(parent.children("li:eq("+idx+")"))}this._cKey=col;this._cIdx=a.columnIndex;this._tIdx=a.targetIndex;this._moveColumn(col,iItem,iDir,this.options.moveType==="dom",false);this._trigger(this.events.movingDialogMoveDownButtonPressed,null,a)},_dialogRearranging:function(event,args){var noCancel,a,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};noCancel=this._trigger(this.events.movingDialogDragColumnMoving,null,a);if(noCancel){this._cKey=cid;this._cIdx=a.columnIndex;this._tIdx=a.targetIndex;this._moveColumn(cid,tid,aft,this.options.moveType==="dom",false);a.movingDialog.find("div.ui-state-highlight").remove();this._trigger(this.events.movingDialogDragColumnMoved,null,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,args){return this._trigger(this.events.movingDialogClosing,null,{movingDialogElement:event.target,owner:this})},_dialogClosed:function(event,args){this._trigger(this.events.movingDialogClosed,null,{movingDialogElement:event.target,owner:this})},_dropDownMouseDown:function(event,args){var ind=$(event.target);this._toggleDropDown(ind,$("div[data-moving-inddropdown='"+this.grid.id()+"']"));this._cancelEvent(event)},_dropDownKeyDown:function(event,args){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,args){$(event.currentTarget).addClass(this.css.columnMovingDropDownItemHover)},_dropDownButtonMouseOut:function(event,args){$(event.currentTarget).removeClass(this.css.columnMovingDropDownItemHover)},_moveLeft:function(event,args){var sib=this._cache.siblings[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._cache.siblings[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._cache.siblings[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._cache.siblings[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,args){$(event.target).closest("th").addClass(this.css.headerCellMouseOver)},_headerMouseOut:function(event,args){$(event.target).closest("th").removeClass(this.css.headerCellMouseOver)},_renderHelpers:function(){this._cmib=$("<div>&nbsp;</div>").attr("id",this.grid.id()+"_moving_indicator_bottom").addClass(this.css.dragIndicatorTop).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.dragIndicatorBottom).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){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;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,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 o=this.options,$captionButtonContainer,$closeButton,movingDialog=$("<div></div>").appendTo(this.grid._rootContainer()).attr("id",this.grid.id()+"_moving_movingDialog");this._movingDialog=movingDialog;movingDialog.igGridModalDialog({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,self=this;if(dropDown.data("isAnimating")===true||isVisible===false&&isCalledFromBlur===true){return}if(!isVisible){th=element.closest("th");isLast=th.parent().children().length-th.index()<=2;offset=th.offset();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);$.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()})})}else{$.each(this._ddButtons,function(key,value){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,args){method(e,columnKey);fnBlur($(e.target))},mouseover:function(e,args){$(this).addClass(css.featureChooserSubmenuItemMouserOver)},mouseleave:function(e,args){$(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){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);if(fromApi===false){delete args.columnIndex;delete args.targetIndex;args.oldIndex=this._cIdx;args.newIndex=this._tIdx;this._triggerColumnMovedAsync(args)}}},_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(table){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();if(this.options.mode==="immediate"){if(this.options.hideHeaderContentsDuringDrag===true){th.children().not("div[data-hiddencolindicator]").hide()}this._oTh=th}},_thDragged:function(helper,pos,left){var siblings,targetKey,targetPosition,targetLeft,scrollLeft=0,dragX,i=0,j=0,updateEvent=false;siblings=this._cache.siblings[this._cKey];if(this._hscroller.length>0){scrollLeft=this._hscroller.scrollLeft()}dragX=left===true?pos.left:pos.left+helper.width();dragX+=scrollLeft;if(!this._gridReady()||this._movingDirty){return}while(i<=siblings.length){j=i===siblings.length?i-1:i;targetKey=siblings[j].key||siblings[j].identifier;if(targetKey===this._cKey&&this.options.mode==="immediate"){i+=2;continue}targetPosition=this._cache.columns[targetKey];targetLeft=j!==i?targetPosition.offset.left+targetPosition.dimensions.width:targetPosition.offset.left;if(dragX>targetLeft-this.options.movingAcceptanceTolerance&&dragX<targetLeft+this.options.movingAcceptanceTolerance){this._tKey=targetKey;this._tIdx=this._cIdx>j||j!==i?j:j-1;if(this.options.mode==="immediate"){this._moveColumn(this._cKey,targetKey,j!==i?true:false,true,false);updateEvent=true}else{this._last=i===siblings.length;this._showIndicators(targetLeft-scrollLeft,targetPosition.element.offset().top,targetPosition.dimensions)}break}i++}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()}return}this._hideIndicators();if(this._tKey&&this._cKey!==this._tKey){this._moveColumn(this._cKey,this._tKey,this._last,this.options.moveType==="dom",false)}delete this._cKey;delete this._tKey;$(".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){var newl=parseInt(this._cmib.css("left"),10)-delta;this._cmib.css("left",newl);this._cmit.css("left",newl)},_showIndicators:function(left,top,dim){this._cmib.css("left",left-8-$.ig.util.getRelativeOffset(this._cmib).left).show();this._cmib.css("top",top-16-$.ig.util.getRelativeOffset(this._cmib).top);this._cmit.css("left",left-8-$.ig.util.getRelativeOffset(this._cmit).left).show();this._cmit.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.container(),appendTo:this.grid.container(),distance:5,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()).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._updateLayoutPerLevel(cols);delete this._movingDirty},_updateLayoutPerLevel:function(cols){var i,id,$th,os,sl=this._hscroller.length>0?this._hscroller.scrollLeft():0;for(i=0;i<cols.length;i++){id=cols[i].key||cols[i].identifier;$th=this._getThById(id);os=$th.offset();os.left=os.left+sl;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()};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))}}},_openMovingDialog:function(){this._movingDialog.igGridModalDialog("openModalDialog")},_closeMovingDialog:function(){this._movingDialog.igGridModalDialog("closeModalDialog")},_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(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,index){return{columnKey:col.key,enabled:true}})},_removeMoving:function(){var ths=this.grid.headersTable().find(">thead th"),i,th,mdl;this.grid.container().find("[id~='"+this.grid.id()+"'][id~='moving']").remove();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()}for(i=0;i<ths.length;++i){th=$(ths[i]);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.container().find("#"+this.grid.id()+(this.grid.options.fixedHeaders===true?"_headers":"")+" th").unbind("moving");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)},_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)},_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._createHandlers();this._unregisterEvents();this._registerEvents()}});$.extend($.ui.igGridColumnMoving,{version:"14.1.20141.1020"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI jQuery Popover 14.1.20141.1020
 *
 * Copyright (c) 2013-2014 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,maxWidth:200,maxHeight:200,animationDuration:150,contentTemplate:null,selectors:null,headerTemplate:{closeButton:false,title:null},showOn:"mouseenter",containment:null},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"},_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"headerTemplate":case"selectors":case"width":case"height":case"closeOnBlur":case"maxWidth":case"maxHeight":case"showOn":throw new Error($.ig.Popover.locale.popoverOptionChangeNotSupported+" "+key)}},destroy:function(){this._detachEventsFromTarget();$("#"+this.id()+"_popover").remove();$.Widget.prototype.destroy.call(this);return this},id:function(){return this.element[0].id},container:function(){return $("#"+this.id()+"_popover_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)}else{this._openPopover(target)}},hide:function(){this._closePopover()},getContent:function(){return $("#"+this.id()+"_popover_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>").attr("id",this.id()+"_popover").addClass(this.css.baseClasses);if(this.options.direction!=="auto"){this._getPrioritiesIndex();$("<div></div>").attr("id",this.id()+"_popover_arrow").addClass(this.css.arrowBaseClass+this._arrowDir[this._directionIndex]).appendTo(this.popover)}this.popover.appendTo(window.document.body);this._attachEventsToTarget();this._createContentDiv()},_createContentDiv:function(){var cnt,currContent;cnt=$("<div></div>").attr("id",this.id()+"_popover_contentFrame").css("position","relative").css("max-width",this.options.maxWidth).css("max-height",this.options.maxHeight).css("width",this.options.width||"auto").css("height",this.options.height||"auto").addClass("ui-widget-content ui-corner-all").appendTo(this.popover);if(this.options.headerTemplate!==null){if(this.options.headerTemplate.closeButton){$("<div></div>").attr("id",this.id()+"_popover_closeBtn").addClass(this.css.closeButtonClass).bind("click.popover",$.proxy(this._closeBtnClick,this)).appendTo(cnt)}if(this.options.headerTemplate.title!==null){$("<div></div>").attr("id",this.id()+"_popover_title").addClass(this.css.titleClass).html(this.options.headerTemplate.title).appendTo(cnt)}}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(response){return})}var rightMargin=this.options.headerTemplate.closeButton&&(this.options.headerTemplate.title===null||this.options.headerTemplate.title==="")?$(".ui-icon").width():null;$("<div></div>").attr("id",this.id()+"_popover_contentInner").css("position","relative").css("margin-right",rightMargin).html(currContent).appendTo(cnt);$("<div></div>").css("clear","both").appendTo(cnt)},_updateArrowDiv:function(nDir,idx){var arrowDiv=$("#"+this.id()+"_popover_arrow"),conDiv=$("#"+this.id()+"_popover_contentFrame"),dims;if(arrowDiv.length===0){arrowDiv=$("<div></div>").attr("id",this.id()+"_popover_arrow").addClass(this.css.arrowBaseClass+this._arrowDir[idx]).appendTo(this.popover)}else{arrowDiv.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([arrowDiv,conDiv]);switch(nDir){case"top":conDiv.css({left:"",top:dims[0].height*-1,"float":""});arrowDiv.css({left:"",top:"","float":""});break;case"bottom":conDiv.css({left:"",top:dims[0].height,"float":""});arrowDiv.css({left:"",top:"","float":""});break;case"left":conDiv.css({left:dims[0].width*-1,top:"","float":"left"});arrowDiv.css({left:"",top:"","float":"left"});break;case"right":conDiv.css({left:dims[0].width,top:"","float":"left"});arrowDiv.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(){this._closePopover()},_closeBtnClick:function(event,ui){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){$(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.id===self.id()){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)){$(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);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);fn="_"+this.options.direction+"Position";if(!this[fn](trg)){this._forced=true;do{this._updateArrowDiv(this._priorityDir[i],i);fn="_"+this._priorityDir[i]+"Position";fnRes=this[fn](trg);i++}while(fnRes===false&&i<this._priorityDir.length);return}}},_findProperPosition:function(dir,x,trg){var i=0,fnRes,y,cDim,cPos,win=$(window),trgFDim,wScroll,tPos,boundary,countainmentBoundary,$containment;if(dir==="left"){cPos="left";cDim="outerWidth";wScroll=win.scrollLeft()}else{cPos="top";cDim="outerHeight";wScroll=win.scrollTop()}boundary=wScroll+win[0][cDim];$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{trgFDim=trg[cDim]()}if(trg[cDim]()>this.popover[cDim]()){y=trg.offset()[cPos]+trgFDim/2-this.popover[cDim]()/2;fnRes=dir==="left"?this._checkCollision(x,y,trg):this._checkCollision(y,x,trg)}else{if(this.options.position==="auto"){do{tPos=this._positions[i];y=this._getCounterPosition(trg,trgFDim,tPos,cPos,cDim);fnRes=dir==="left"?this._checkCollision(x,y,trg):this._checkCollision(y,x,trg)}while(fnRes===false&&++i<this._positions.length)}else{y=this._getCounterPosition(trg,trgFDim,this.options.position,cPos,cDim);fnRes=dir==="left"?this._checkCollision(x,y,trg):this._checkCollision(y,x,trg)}}if(fnRes===true){this._adjustArrowPosition(trg,dir,cPos,cDim)}return fnRes},_getCounterPosition:function(trg,trgFDim,tPos,cPos,cDim){var y;switch(tPos){case"balanced":y=trg.offset()[cPos]+trgFDim/2-this.popover[cDim]()/2;break;case"start":y=trg.offset()[cPos];break;case"end":y=trg.offset()[cPos]-this.popover[cDim]()+trgFDim;break}return y},_topPosition:function(trg){var top=trg.offset().top-this.popover.outerHeight();return this._findProperPosition("left",top,trg)},_bottomPosition:function(trg){var top=trg.offset().top+trg.outerHeight();return this._findProperPosition("left",top,trg)},_leftPosition:function(trg){var left=trg.offset().left-this.popover.outerWidth();return this._findProperPosition("top",left,trg)},_rightPosition:function(trg){var left=trg.offset().left+trg.outerWidth();return this._findProperPosition("top",left,trg)},_checkCollision:function(top,left,trg){var tfullw=this.popover.outerWidth(),tfullh=this.popover.outerHeight(),win=$(window),wh,ww,os,$containment,arrow,rightBoundary,bottomBoundary,leftBoundary,topBoundary;ww=win.width()+win.scrollLeft();wh=win.height()+win.scrollTop();arrow=$("#"+this.id()+"_popover_arrow");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(left<leftBoundary){if(this.options.direction==="left"){return false}else{left=leftBoundary}}if(trg.offset().left+tfullw/2>rightBoundary){left=rightBoundary-tfullw}if(trg.offset().top+tfullh+arrow.height()>bottomBoundary&&this.oDir==="bottom"||trg.offset().top-tfullh-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===true){return false}}if(!this.options.containment&&this._target){os=this._getRelativeOffset();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(response){return});this._setNewContent(args.content||"")}this._positionPopover(trg);this._currentTarget=trg;$(this.popover).data("isAnimating",false);this.popover.fadeIn(this.options.animationDuration,function(){self._trigger(self.events.shown,self,args)});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.fadeOut(this.options.animationDuration,function(){self._trigger(self.events.hidden,self,args)})}},_mouseenter:function(e){_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){var arrow=$("#"+this.id()+"_popover_arrow"),offset={left:0,top:0};if(!this.options.containment&&this._target){offset=this._getRelativeOffset()}if(dir==="top"){arrow.css({top:trg.offset()[cPos]-parseInt(this.popover.css(cPos),10)-offset.top+trg[cDim]()/2-arrow.height()/2})}else{var left=trg.offset()[cPos]-parseInt(this.popover.css(cPos),10)-offset.left+trg[cDim]()/2;left=left<parseInt(arrow.css("border-left-width"),10)?parseInt(arrow.css("border-left-width"),10):left;arrow.css({left:left})}},_getRelativeOffset:function(){var offset={left:0,top:0},elem=this.popover;if(this.options.containment){elem=this.options.containment}while(elem[0]!==null&&elem[0]!==undefined&&elem[0].nodeName!=="#document"){if(elem.css("position")==="relative"){offset.left=elem.offset().left;offset.top=elem.offset().top;break}elem=elem.parent()}return offset},_getHiddenElementsDimensions:function(elArr){var dim=[],i,elem;$("#"+this.id()+"_popover").show();for(i=0;i<elArr.length;i++){elem=elArr[i];dim.push({width:elem.outerWidth(),height:elem.outerHeight()})}$("#"+this.id()+"_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.id()+"_popover_contentInner").html(newContent)}});if(!$.fn.addBack){$.fn.addBack=function(selector){return this.add(selector===null||selector===undefined?this.prevObject:this.prevObject.filter(selector))}}$.extend($.ui.igPopover,{version:"14.1.20141.1020"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Feature Chooser 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.popover.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.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(e){setTimeout(function(){$targetButton.data("onFocus",true)},1)},blur:function(e){$targetButton.data("onFocus",false);setTimeout(function(){if(!$targetButton.data("onFocus")&&self.isShown()){self._closePopover()}},10)}};elements.bind(events)},_createWidget:function(options,element){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(events,args){self._setFCElementFocus(true)},iggridfeaturechooserpopoverhidden:function(events,args){self._setFCElementFocus(false);self.popover.width("");self.popover.css({left:""})},mousedown:function(event){setTimeout(function(){self._setFCElementFocus(true)},1)},touchstart:function(){setTimeout(function(){self._setFCElementFocus(true)},1)}};this.element.bind(this._eventsFC);this.registerElements($targetButton)}},_positionPopover:function(trg){var $popover,w=this.popover.outerWidth(),availableWidth,top,left,rOffset,mw=this.options.maxWidth,$containment=this.options.containment,$window=$(window);if(mw&&mw<w){w=mw}$popover=this.popover;if($popover){if($containment.offset().left>=$window.scrollLeft()){availableWidth=$window.width()+$window.scrollLeft()-$containment.offset().left}else{availableWidth=$window.width()}if(w>availableWidth){w=parseInt(availableWidth,10)}this.popover.width(w)}$.ui.igPopover.prototype._positionPopover.apply(this,arguments);$popover.width(w);top=parseFloat($popover.css("top"));left=parseFloat($popover.css("left"));if(this._attachedToBody){$popover.detach().appendTo($containment);this._attachedToBody=false}rOffset=$.ig.util.getRelativeOffset($popover);if(!isNaN(top)){$popover.css("top",top-rOffset.top)}if(!isNaN(left)){$popover.css("left",left-rOffset.left)}},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:"14.1.20141.1020"});$.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(options,element){$.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)},_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(key,value){$.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(){var isFullScreen=window.innerWidth===screen.width&&window.innerHeight===screen.height,errorName,supported=null;if(!isFullScreen){return false}try{supported=new ActiveXObject("")}catch(e){errorName=e.name}try{supported=new ActiveXObject("htmlfile");supported=!!supported}catch(e){supported=false}if(supported===false&&errorName!=="ReferenceError"){supported=false}else{supported=true}return!supported},_isTouchDevice:function(){if(this._isTouch===undefined){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=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}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);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>").appendTo($headerContainer).addClass(self.css.headerButtonIcon);$button.wrap('<a id="'+buttonId+'" href="#" title=""></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(event){if($button.hasClass(self.css.headerButtonIconSelected)===false){$button.addClass(self.css.headerButtonIconMouseOver)}},mouseout:function(event){$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);if($dropDown.length>0){return}$dropDown=$('<div tabindex="0"></div>').attr("id",dropDownId).appendTo(this.grid._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:this.grid.container()});popoverInstance=$dropDown.data("igGridFeatureChooserPopover");$dropDown.bind("iggridfeaturechooserpopovershown",function(events,args){self._visiblePopover=dropDownId});$dropDown.bind("iggridfeaturechooserpopoverhiding",function(events,args){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()}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()}}})},_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.toggleDropDown(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;if(selected!==undefined){isSelected=selected}for(i=0;i<colsLength;i++){columnKey=cols[i].key;$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)}},toggleDropDown:function(columnKey){var dropDownId=this._id("featureChooser_dd",columnKey),$dropDown,$targetButton,isVisible,self=this;this._renderMenu(columnKey);$dropDown=$("#"+dropDownId);isVisible=$dropDown.igGridFeatureChooserPopover("isShown");self._trigger(self.events.menuToggling,null,{isVisible:isVisible,columnKey:columnKey,owner:self});if(isVisible){$dropDown.igGridFeatureChooserPopover("hide");this.grid._focusedElement=null}else{this.grid._focusedElement=$("#"+self._id("featureChooser_headerButton",columnKey)).find("span");$targetButton=$("#"+this._id("featureChooser_headerButton",columnKey)).find("span");if(self._visiblePopover&&dropDownId!==self._visiblePopover){$("#"+self._visiblePopover).data("igGridFeatureChooserPopover")._closePopover();setTimeout(function(){$dropDown.igGridFeatureChooserPopover("show",$targetButton)},100)}else{$dropDown.igGridFeatureChooserPopover("show",$targetButton)}}},_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)},destroy:function(){var i,l,self=this,sbm=this._submenus;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)}delete this._gridRenderedHandler;delete this._headerRenderedHandler;delete this._gridDestroyedHandler;$.Widget.prototype.destroy.apply(this,arguments);return this}});$.extend($.ui.igGridFeatureChooser,{version:"14.1.20141.1020"})})(jQuery);if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igGridModalDialog",{options:{buttonApplyText:"Apply",buttonCancelText:"Cancel",modalDialogCaptionText:"Header",modalDialogWidth:250,modalDialogHeight:"",renderFooterButtons:true,animationDuration:200},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"},_createWidget:function(options,element){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)},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,modalDialogBody,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){$("#"+blockId).remove();this._setGridWidthHeight();modalDialogBody=modalDialog.find("table tbody");modalDialogBody.empty();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"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(){var noCancel=true,modalDialog=this.element,animationDuration=this._getAnimationDuration();if(!this._modalDialogOpened){return}noCancel=this._trigger(this.events.modalDialogClosing,null,{modalDialog:modalDialog,owner:this});if(noCancel){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;if(pos.top<0){pos.top=this.gridContainer.position().top}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,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});$buttonCancel=$("<button></button>").attr("id",this._id("footer_buttoncancel")).appendTo($buttonSet);$buttonCancel.igButton({labelText:o.buttonCancelText});$buttonCancel.bind({click:function(e,args){noCancel=self._trigger(self.events.buttonCancelClick,e,{modalDialog:modalDialog,owner:self});if(noCancel){self.closeModalDialog();e.preventDefault();e.stopPropagation()}}})}modalDialog.bind({keydown:function(e){if(e.keyCode===$.ui.keyCode.ESCAPE){self.closeModalDialog()}}}).draggable({containment:this.containment,handle:caption,drag:$.proxy(this._modalDialogMove,this)}).attr("role","dialog").attr("tabIndex",-1);if(typeof Modernizr==="object"&&Modernizr.touch===false){modalDialog.resizable({containment:"parent",alsoResize:modalDialogContent,minHeight:modalDialog.outerHeight()/4,minWidth:modalDialog.outerWidth()/2})}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();$.Widget.prototype.destroy.apply(this,arguments);return this}});$.extend($.ui.igGridModalDialog,{version:"14.1.20141.1020"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Sorting 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	jquery-tmpl.js (https://github.com/jquery/jquery-tmpl)
 *	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.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,defaultExpressions:[]}],type:null,filterDelay:500,mode:null,advancedModeEditorsVisible:false,advancedModeHeaderButtonLocation:"left",filterDialogWidth:370,filterDialogMaxHeight:350,filterDialogHeight:"",filterDialogFilterDropDownDefaultWidth:80,filterDialogExprInputDefaultWidth:80,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},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},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(options,element){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;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+" "+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,cols=this.grid.options.columns,block=$("#"+this.grid.id()+"_container_block"),dialog=$("#"+this.grid.id()+"_container_dialog");$("#"+this.grid.container()[0].id+" .ui-iggrid-filterrow").remove();$("#"+this.grid.container()[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();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}if(this._exitEditModeHandler){delete this._exitEditModeHandler}if(this._enterEditModeHandler){delete this._enterEditModeHandler}$.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){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.igEditor("option","nullText",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=[]},_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;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){this._shouldFireDataFiltered=false;this._trigger(this.events.dataFiltered,null,{columnKey:this._curColKey,columnIndex:this._curColIndex,owner:this})}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");summary.attr("id",this.grid.element[0].id+"_pager_label")}shouldInitHeights=true}if(this.options.type==="local"||this.options.type==="remote"&&this.grid.dataSource.hasTotalRecordsCount()===false){if(this.grid.dataSource._filter){matches=this.grid.dataSource._filteredData.length}else{matches=this.grid.dataSource._data.length}}else{matches=this.grid.dataSource.totalRecordsCount()}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();this._isFilteringRequest=false}else if(this._isFilteringRequest===false){expr=this.grid.dataSource.settings.filtering.expressions||[];if(summary.data("hideflag")!==false&&expr.length===0){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(grid.options.virtualization||grid.options.rowVirtualization){if(!shouldInitHeights){this.grid._initializeHeights()}if(grid._totalRowCount*grid._avgRowHeight<=parseInt(grid.options.height,10)){grid.element.height("");grid._avgRowHeight=grid._calculateAvgRowHeight();grid._setScrollContainerHeight(grid._totalRowCount*grid._avgRowHeight)}}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){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").first().igEditor("option","width",cellWidth)}},_headerRendered:function(sender,args){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].dataType,cols[i].key)}}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(event,ui){if(this._isInitFC!==true){this._initFC()}},_openFilterDialogFromFC:function(event,columnKey){this._openFilterDialog(event,columnKey)},toggleFilterRowByFeatureChooser:function(event,columnKey){var fc,o=this.options,isShown=this._filterRowShown,$thead=this.grid.container().find("thead"),$filterRow,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){fc=this.grid.element.data("igGridFeatureChooser");if(fc){fc._toggleSelectedItems("Filtering")}}this._filterRowShown=isShown;this.grid._initializeHeights();this.grid._adjustLastColumnWidth(true)}},_createEditor:function(parent,w,colIndex,colType,colKey){var editor,options,type=this._getEditorType(colType);editor=$("<span />").css("float","left").css("width","5px");if(this.options.filterButtonLocation==="left"){editor.appendTo(parent)}else{editor.prependTo(parent)}if(this._enterEditModeHandler===undefined||this._enterEditModeHandler===null){this._enterEditModeHandler=$.proxy(this._fireEnterEditModeEvents,this)}if(this._exitEditModeHandler===undefined||this._exitEditModeHandler===null){this._exitEditModeHandler=$.proxy(this._fireExitEditModeEvents,this)}options={textChanged:$.proxy(this._filter,this),width:w,disabled:this.grid.options.columns[colIndex].dataType==="bool"||this.grid.options.columns[colIndex].dataType==="boolean",type:type,textAlign:"left",button:type==="datepicker"?"dropdown":null,maxDecimals:6,nullText:this.options.nullTexts[this._findColumnSetting(colKey).condition],focus:this._enterEditModeHandler,blur:this._exitEditModeHandler,enableUTCDates:this.grid.options.enableUTCDates};editor.data("colIndex",colIndex).data("colKey",colKey);editor.igEditor(options);this._editors.push(editor.data("igEditor"));editor.find("input").addClass(this.css.filterCellEditor)},_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)}},_getEditorType:function(type){return type==="date"?"datepicker":type==="number"?"numeric":"text"},_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)}},_fireEnterEditModeEvents:function(evt,ui){var sel=ui&&ui.owner?ui.owner._grid_sel:null;if(sel){if(sel.time+1e3>(new Date).getTime()){ui.owner.select(sel.sel)}this.grid._synchronizeHScroll();delete ui.owner._grid_sel}},_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,expressions:exprs});if(noCancel){this.grid._isToSetUnboundColumns=true;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);if(editor){editor._grid_sel={time:(new Date).getTime(),sel:editor._sel0};editor.setFocus()}}},_filterDataSource:function(expressions,apiCall,updateUI){var exprs,i,j,button,groupBy,cols=this.grid.options.columns,found=false,defaultTooltip,noCancel;defaultTooltip=this.options.tooltipTemplate.replace("${condition}",this.options.labels.noFilter);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}",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});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})}}}}},_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()}this.grid.element.trigger("iggriduidirty",{owner:this});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,expressions:exprs});if(noCancelFiltering){noCancel=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid});if(noCancel){this.grid.dataSource.settings.paging.pageIndex=0;this._preserveSorting();this.grid._shouldResetPaging=true;this.grid._isToSetUnboundColumns=true;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})}}}},_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,addedFromAdvanced){var i,j,editor,filterList,items;if(this._editors){for(i=0;i<this._editors.length;i++){if(this.options.columnSettings[i].allowFiltering!==false){this._editors[i].value(null)}}}for(i=0;i<expressions.length;i++){filterList=$("#"+this.grid.element[0].id+"_dd_"+expressions[i].fieldName).find("ul");items=filterList.children();for(j=0;j<items.length;j++){if($(items[j]).data("cond")===expressions[i].cond){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,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}}if(isSimpleMode){button.attr("title",this.options.tooltipTemplate.replace("${condition}",expressions[i].cond));continue}if(i===0){button.attr("title",expressionFieldName+" "+expressions[i].cond+" "+tempTooltipExpr+" ")}else{button.attr("title",title+expressions[i].logic+" "+expressionFieldName+" "+expressions[i].cond+" "+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)}}},_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;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){continue}expr=this._editors[i].value();requiresEntry=this._requiresEntry(this.options.columnSettings[i].condition);if((expr===undefined||expr===null||expr==="")&&requiresEntry){continue}currentCondition=this.options.columnSettings[i].condition;if(currentCondition===undefined||currentCondition===null||currentCondition===""){continue}dt=cols[i].dataType;if(dt==="date"&&expr){if(this.options.type==="remote"){expr=Date.UTC(expr.getUTCFullYear(),expr.getUTCMonth(),expr.getUTCDate(),expr.getUTCHours(),expr.getUTCMinutes())}else if(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(this.options.columnSettings[i].condition)){if(expr!==""&&!this.options.filterExprUrlKey){isExprAdded=true;exprs.push({fieldName:cols[i].key,cond:currentCondition,expr:expr})}else if(dt==="bool"&&expr!==""||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===""&&(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}}}}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,cols=this.grid.options.columns,allowFiltering,defExpr,isToCheckUnboundColumns=this.grid._hasUnboundColumns===true&&this.options.type==="remote";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}}}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)){if(key!=="columnKey"&&key!=="columnIndex"){settings[j][key]=cs[i][key]}if(key==="defaultExpressions"&&cs[i][key]){defExpr=cs[i][key];for(k=0;k<defExpr.length;k++){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},_renderDropDown:function(type,id,colName){var ul,i,cs=this.options.columnSettings,cols=this.grid.options.columns,item,obj,conds=[],cond;if(type==="number"){ul=this._renderNumericFilterDropDown(id,colName)}else if(type==="date"){ul=this._renderDateFilterDropDown(id,colName)}else if(type==="boolean"||type==="bool"){ul=this._renderBooleanFilterDropDown(id,colName)}else{ul=this._renderStringFilterDropDown(id,colName)}if(this.options.filterDropDownItemIcons!==true){if(this.options.showEmptyConditions){$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","empty")).text(this.options.labels.empty).addClass("ui-corner-all");$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","notEmpty")).text(this.options.labels.notEmpty).addClass("ui-corner-all")}if(this.options.showNullConditions){$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","null")).text(this.options.labels.nullLabel).addClass("ui-corner-all");$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","notNull")).text(this.options.labels.notNull).addClass("ui-corner-all")}}else{obj={itemClass:this.css.filterDropDownListItemWithIcons,imgContainerClass:this.css.filterItemIconContainer,textClass:this.css.filterDropDownListItemTextContainer};if(this.options.showEmptyConditions){conds.push({text:this.options.labels.empty,imgClass:this.css.filterItemIcon,condition:"empty"});conds.push({text:this.options.labels.notEmpty,imgClass:this.css.filterItemIcon,condition:"notEmpty"})}if(this.options.showNullConditions){conds.push({text:this.options.labels.nullLabel,imgClass:this.css.filterItemIcon,condition:"null"});conds.push({text:this.options.labels.notNull,imgClass:this.css.filterItemIcon,condition:"notNull"})}for(i=0;i<conds.length;i++){cond=$("<li class='"+obj.itemClass+"'><span class='"+obj.imgContainerClass+"'>"+"<span class='"+this.css.filterItemIcon+" "+conds[i].imgClass+"'></span></span>"+"<span class='"+obj.textClass+"'> "+conds[i].text+"</span></li>");cond.appendTo(ul).data("cond",conds[i].condition)}}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)}},_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"),i,addDefault=true,rOffset,expressions=this.grid.dataSource.settings.filtering.expressions;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","window")}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));this._trigger(this.events.filterDialogOpened,null,{dialog:dialog,owner: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;noCancel=this._trigger(this.events.filterDialogClosing,null,{owner:this});if(noCancel){$("#"+this.grid.container().attr("id")+"_block").fadeToggle();$("#"+this.grid.container().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,expr,noCancelFiltering=true,cond;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 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++){type=this.grid.columnByText($(rows[i].cells[0]).find("input")[0].value).dataType;expr=$(rows[i].cells[2]).find("input").igEditor("value");if(expr&&(expr.nodeName||expr[0]&&expr[0].nodeName)){expr=$(rows[i].cells[2]).find("span").igEditor("value")}cond=$(rows[i].cells[1]).find("select")[0].value;if($.type(expr)==="date"){if(this.grid.options.enableUTCDates){expr=Date.UTC(expr.getUTCFullYear(),expr.getUTCMonth(),expr.getUTCDate(),expr.getUTCHours(),expr.getUTCMinutes())}if(cond==="after"&&this.options.type==="local"){expr.setHours(23);expr.setMinutes(59);expr.setSeconds(59);expr.setMilliseconds(999)}}expressions.push({fieldName:this.grid.columnByText($(rows[i].cells[0]).find("input")[0].value).key,cond:cond,expr:expr,logic:boolLogic,type:type});if(type===undefined&&$.type(expr)==="string"){expressions[expressions.length-1].dataType="string"}}this._closeFilterDialog(e);this._currentAdvancedExpressions=expressions;noCancelFiltering=this._trigger(this.events.dataFiltering,null,{owner:this,expressions:expressions});if(noCancelFiltering){this.filter(expressions,true,true)}}e.preventDefault();e.stopPropagation()},_filterDialogStartMove:function(e){this._isFilterDialogMouseDown=true},_filterDialogStopMove:function(e){this._isFilterDialogMouseDown=false;this._dialogClientX=undefined;this._dialogClientY=undefined},_filterDialogMove:function(e,ui){$(e.target).find(".ui-igedit-fieldincontainer").igEditor("dropDownVisible",false);if(ui.position.top<0){ui.position.top=this.grid.container().position().top}this._trigger(this.events.filterDialogMoving,null,{dialog:e.target,owner:this})},_renderFilterDialog:function(){var dialog,condObj,dropDownData,condElement,condDropDown,okCancelContainer,f=this,caption,dialogContent,noCancel=true,addClearButtons,limit;$("<div></div>").appendTo(this.grid._rootContainer()).attr("id",this.grid.container().attr("id")+"_block").css("position","absolute").addClass(this.css.blockArea).data("efh","1").hide();dialog=$("<div></div>").appendTo(this.grid._rootContainer()).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","#").attr("role","button").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").css("height",this.options.filterDialogMaxHeight);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></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({mousedown:$.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({mousedown:$.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){if(e.keyCode===$.ui.keyCode.ESCAPE){f._closeFilterDialog()}}}).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,containment:"parent",resize:$.proxy(this._resizeHandler,this)})}this._trigger(this.events.filterDialogContentsRendered,null,{dialogElement:dialog,owner:this})}},_setResizableEnv:function(){var 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();this._resizeCont=rCont;this._heightDifference=hCont.outerHeight(true)+bCont.outerHeight(true)+pad},_resizeHandler:function(event,ui){var u=ui.originalElement;this._resizeCont.css({height:u.height()-this._heightDifference+"px"})},_changeFilterCondition:function(e){var requiresEntry,editor,condition,editorObject;condition=e.target.value;editor=$(e.target).closest("td").parent().find("td:nth-child(3)").find("input");requiresEntry=this._requiresEntry(condition);if(!requiresEntry){editor.igEditor("option","disabled",true);editorObject=editor.data("igEditor");this._editorValueForCondition(condition,editorObject)}else{editor.igEditor("option","disabled",false)}},_addFilterFromDialog:function(e,expression){var tableBody=$("#"+this.grid.container().attr("id")+"_dialog table tbody"),j,cs=this.options.columnSettings,filterObj={},filterRow,colKeys,i,noCancel=true,field,type,cnd,allowed,defaultValue,condition,col;noCancel=this._trigger(this.events.filterDialogFilterAdding,null,{filtersTableBody:tableBody,owner:this});if(noCancel){if(tableBody.children().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><td><input/></td><td><select></select></td><td><input /> </td><td><span></span></td></tr>")}filterRow.appendTo(tableBody).hide();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){field=this.grid.columnByKey(this._dialogCurrentColumn).headerText;type=this._dialogCurrentType}else{col=this.grid.columnByKey(expression.fieldName);if(col!==null){field=col.headerText;type=col.dataType}condition=expression.cond;defaultValue=expression.expr;if(type==="date"&&$.type(defaultValue)==="number"&&this.grid.options.enableUTCDates){defaultValue=new Date(defaultValue)}}filterRow.find("td:first").find("input").css("width",80).igEditor({listItems:colKeys,button:"dropdown",listAutoComplete:true,listMatchOnly:true,width:this.options.filterDialogColumnDropDownDefaultWidth||120,textChanged:$.proxy(this._polulateFilterConditionDropDown,this),value:field,enableUTCDates:this.grid.options.enableUTCDates});cnd=filterRow.find("td:nth-child(2)").children().first();this._populateConditionsList(cnd,field,type);if(condition!==undefined&&cnd.length>0){cnd[0].value=condition}cnd.bind("change",$.proxy(this._changeFilterCondition,this));filterRow.find("td:nth-child(2)").children().first().css("width",this.options.filterDialogFilterDropDownDefaultWidth);filterRow.show();this._populateFilterDialogInput(filterRow.find("td:nth-child(3)").children().first(),type,defaultValue);filterRow.find("td:last").children().first().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()},_polulateFilterConditionDropDown:function(e){var selectedColKey=e.target.value,conditionList,cols=this.grid.options.columns,type,expr,i;conditionList=$(e.target).closest("tr").find("td:nth-child(2)").children().first();expr=$(e.target).closest("tr").find("td:nth-child(3)").children().first();for(i=0;i<cols.length;i++){if(cols[i].headerText===selectedColKey){type=cols[i].dataType;break}}if(type===undefined){return}this._populateConditionsList(conditionList,selectedColKey,type);this._populateFilterDialogInput(expr,type)},_populateFilterDialogInput:function(input,type,defaultValue){var options={type:this._getEditorType(type),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(!input.is("input")){input=input.find("INPUT")}input.igEditor(options)},_populateConditionsList:function(conditionList,selectedColKey,type){var conditions=[],condList="",i;if(type==="number"){conditions.push({conditionName:"equals",conditionLabel:this.options.labels.equals});conditions.push({conditionName:"doesNotEqual",conditionLabel:this.options.labels.doesNotEqual});conditions.push({conditionName:"greaterThan",conditionLabel:this.options.labels.greaterThan});conditions.push({conditionName:"lessThan",conditionLabel:this.options.labels.lessThan});conditions.push({conditionName:"greaterThanOrEqualTo",conditionLabel:this.options.labels.greaterThanOrEqualTo});conditions.push({conditionName:"lessThanOrEqualTo",conditionLabel:this.options.labels.lessThanOrEqualTo})}else if(type==="bool"||type==="boolean"){conditions.push({conditionName:"true",conditionLabel:this.options.labels.trueLabel});conditions.push({conditionName:"false",conditionLabel:this.options.labels.falseLabel})}else if(type==="date"){conditions.push({conditionName:"on",conditionLabel:this.options.labels.on});conditions.push({conditionName:"notOn",conditionLabel:this.options.labels.notOn});conditions.push({conditionName:"after",conditionLabel:this.options.labels.after});conditions.push({conditionName:"before",conditionLabel:this.options.labels.before});conditions.push({conditionName:"today",conditionLabel:this.options.labels.today});conditions.push({conditionName:"yesterday",conditionLabel:this.options.labels.yesterday});conditions.push({conditionName:"thisMonth",conditionLabel:this.options.labels.thisMonth});conditions.push({conditionName:"lastMonth",conditionLabel:this.options.labels.lastMonth});conditions.push({conditionName:"nextMonth",conditionLabel:this.options.labels.nextMonth});conditions.push({conditionName:"thisYear",conditionLabel:this.options.labels.thisYear});conditions.push({conditionName:"lastYear",conditionLabel:this.options.labels.lastYear});conditions.push({conditionName:"nextYear",conditionLabel:this.options.labels.nextYear})}else{conditions.push({conditionName:"startsWith",conditionLabel:this.options.labels.startsWith});conditions.push({conditionName:"endsWith",conditionLabel:this.options.labels.endsWith});conditions.push({conditionName:"contains",conditionLabel:this.options.labels.contains});conditions.push({conditionName:"doesNotContain",conditionLabel:this.options.labels.doesNotContain});conditions.push({conditionName:"equals",conditionLabel:this.options.labels.equals});conditions.push({conditionName:"doesNotEqual",conditionLabel:this.options.labels.doesNotEqual})}if(this.options.showEmptyConditions){conditions.push({conditionName:"empty",conditionLabel:this.options.labels.empty});conditions.push({conditionName:"notEmpty",conditionLabel:this.options.labels.notEmpty})}if(this.options.showNullConditions){conditions.push({conditionName:"null",conditionLabel:this.options.labels.nullLabel});conditions.push({conditionName:"notNull",conditionLabel:this.options.labels.notNull})}conditionList.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].conditionName+"'>"+conditions[i].conditionLabel+"</option>"}condList=$(condList)}condList.appendTo(conditionList);if($.ig.util.isIE){conditionList.parent().append(conditionList);conditionList.width(conditionList.width())}},_removeFilterFromDialog:function(e){var tableBody=$("#"+this.grid.container().attr("id")+"_dialog table tbody");$(e.target).closest("tr").remove();if(tableBody.children().length<this.options.filterDialogMaxFilterCount){$("#"+this.grid.container().attr("id")+"_dialog_error").hide()}},_renderStringFilterDropDown:function(id,colName){var ul=this._renderDropDownElement(id,colName),obj,conds=[],cond;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");$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","startsWith")).text(this.options.labels.startsWith).addClass("ui-corner-all");$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","endsWith")).text(this.options.labels.endsWith).addClass("ui-corner-all");$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","contains")).text(this.options.labels.contains).addClass("ui-corner-all");$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","doesNotContain")).text(this.options.labels.doesNotContain).addClass("ui-corner-all");$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","equals")).text(this.options.labels.equals).addClass("ui-corner-all");$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","doesNotEqual")).text(this.options.labels.doesNotEqual).addClass("ui-corner-all")}else{obj={itemClass:this.css.filterDropDownListItemWithIcons,imgContainerClass:this.css.filterItemIconContainer,textClass:this.css.filterDropDownListItemTextContainer};conds.push({text:this.options.labels.clear,imgClass:this.css.filterItemIconClear});conds.push({text:this.options.labels.startsWith,imgClass:this.css.filterItemIconStartsWith,condition:"startsWith"});conds.push({text:this.options.labels.endsWith,imgClass:this.css.filterItemIconEndsWith,condition:"endsWith"});conds.push({text:this.options.labels.contains,imgClass:this.css.filterItemIconContains,condition:"contains"});conds.push({text:this.options.labels.doesNotContain,imgClass:this.css.filterItemIconDoesNotContain,condition:"doesNotContain"});conds.push({text:this.options.labels.equals,imgClass:this.css.filterItemIconEquals,condition:"equals"});conds.push({text:this.options.labels.doesNotEqual,imgClass:this.css.filterItemIconDoesNotEqual,condition:"doesNotEqual"});this._renderDropDownToList(obj,conds,ul)}return ul},_renderNumericFilterDropDown:function(id,colName){var ul=this._renderDropDownElement(id,colName),obj,conds=[],cond;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);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","equals")).text(this.options.labels.equals);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","doesNotEqual")).text(this.options.labels.doesNotEqual);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","greaterThan")).text(this.options.labels.greaterThan);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","lessThan")).text(this.options.labels.lessThan);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","greaterThanOrEqualTo")).text(this.options.labels.greaterThanOrEqualTo);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","lessThanOrEqualTo")).text(this.options.labels.lessThanOrEqualTo)}else{obj={itemClass:this.css.filterDropDownListItemWithIcons,imgContainerClass:this.css.filterItemIconContainer,textClass:this.css.filterDropDownListItemTextContainer};conds.push({text:this.options.labels.clear,imgClass:this.css.filterItemIconClear});conds.push({text:this.options.labels.equals,imgClass:this.css.filterItemIconEquals,condition:"equals"});conds.push({text:this.options.labels.doesNotEqual,imgClass:this.css.filterItemIconDoesNotEqual,condition:"doesNotEqual"});conds.push({text:this.options.labels.greaterThan,imgClass:this.css.filterItemIconGreaterThan,condition:"greaterThan"});conds.push({text:this.options.labels.lessThan,imgClass:this.css.filterItemIconLessThan,condition:"lessThan"});conds.push({text:this.options.labels.greaterThanOrEqualTo,imgClass:this.css.filterItemIconGreaterThanOrEqualTo,condition:"greaterThanOrEqualTo"});conds.push({text:this.options.labels.lessThanOrEqualTo,imgClass:this.css.filterItemIconLessThanOrEqualTo,condition:"lessThanOrEqualTo"});this._renderDropDownToList(obj,conds,ul)}return ul},_renderDateFilterDropDown:function(id,colName){var ul=this._renderDropDownElement(id,colName),obj,conds=[],cond;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);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","on")).text(this.options.labels.on);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","notOn")).text(this.options.labels.notOn);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","after")).text(this.options.labels.after);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","before")).text(this.options.labels.before);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","today")).text(this.options.labels.today);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","yesterday")).text(this.options.labels.yesterday);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","thisMonth")).text(this.options.labels.thisMonth);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","lastMonth")).text(this.options.labels.lastMonth);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","nextMonth")).text(this.options.labels.nextMonth);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","thisYear")).text(this.options.labels.thisYear);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","lastYear")).text(this.options.labels.lastYear);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","nextYear")).text(this.options.labels.nextYear)}else{obj={itemClass:this.css.filterDropDownListItemWithIcons,imgContainerClass:this.css.filterItemIconContainer,textClass:this.css.filterDropDownListItemTextContainer};conds.push({text:this.options.labels.clear,imgClass:this.css.filterItemIconClear});conds.push({text:this.options.labels.on,imgClass:this.css.filterItemIconOn,condition:"on"});conds.push({text:this.options.labels.notOn,imgClass:this.css.filterItemIconNotOn,condition:"notOn"});conds.push({text:this.options.labels.after,imgClass:this.css.filterItemIconAfter,condition:"after"});conds.push({text:this.options.labels.before,imgClass:this.css.filterItemIconBefore,condition:"before"});conds.push({text:this.options.labels.today,imgClass:this.css.filterItemIconToday,condition:"today"});conds.push({text:this.options.labels.yesterday,imgClass:this.css.filterItemIconYesterday,condition:"yesterday"});conds.push({text:this.options.labels.thisMonth,imgClass:this.css.filterItemIconThisMonth,condition:"thisMonth"});conds.push({text:this.options.labels.lastMonth,imgClass:this.css.filterItemIconLastMonth,condition:"lastMonth"});conds.push({text:this.options.labels.nextMonth,imgClass:this.css.filterItemIconNextMonth,condition:"nextMonth"});conds.push({text:this.options.labels.thisYear,imgClass:this.css.filterItemIconThisYear,condition:"thisYear"});conds.push({text:this.options.labels.lastYear,imgClass:this.css.filterItemIconLastYear,condition:"lastYear"});conds.push({text:this.options.labels.nextYear,imgClass:this.css.filterItemIconNextYear,condition:"nextYear"});this._renderDropDownToList(obj,conds,ul)}return ul},_renderBooleanFilterDropDown:function(id,colName){var ul=this._renderDropDownElement(id,colName),obj,conds=[],cond;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);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","true")).text(this.options.labels.trueLabel);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","false")).text(this.options.labels.falseLabel)}else{obj={itemClass:this.css.filterDropDownListItemWithIcons,imgContainerClass:this.css.filterItemIconContainer,textClass:this.css.filterDropDownListItemTextContainer};conds.push({text:this.options.labels.clear,imgClass:this.css.filterItemIconClear});conds.push({text:this.options.labels.trueLabel,imgClass:this.css.filterItemIconTrue,condition:"true"});conds.push({text:this.options.labels.falseLabel,imgClass:this.css.filterItemIconFalse,condition:"false"});this._renderDropDownToList(obj,conds,ul)}return ul},_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.indexOf("_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()}}}}},_animationEnd:function(){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").indexOf("_button"))).find("ul");if(parent.data("selectedItem")){selectedItem=parent.find("li:nth-child("+(parent.data("selectedItem")+1)+")");ddVisible=$("#"+$target.attr("id").substring(0,$target.attr("id").indexOf("_button"))).is(":visible");if($(selectedItem).hasClass("ui-iggrid-filterddlistitemadvanced")&&ddVisible){this._openFilterDialog(event)}}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").indexOf("_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,button,requiresEntry,currentCond;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").indexOf("_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");if($target.data("cond")===undefined){button.attr("title",this.options.tooltipTemplate.replace("${condition}",this.options.labels.noFilter))}else{button.attr("title",this.options.tooltipTemplate.replace("${condition}",$target.text()))}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;if(filterCondition!==undefined){this.options.columnSettings[parseInt(colIndex,10)].condition=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(currentCond==="null"||this.grid.options.columns[colIndex].dataType==="date"){this._editors[colIndex].element.igEditor("option","nullText",this.options.nullTexts[this._getDefaultCondition(this.grid.options.columns[colIndex].dataType)])}}sel=$target.parent().data("selectedItem");if(sel!==undefined){$target.parent().find("li:nth-child("+(sel+1)+")").removeClass(this.css.filterDropDownListItemActive)}$target.addClass(this.css.filterDropDownListItemActive);$target.parent().data("selectedItem",$("li",$target.parent()).index($target));this._editors[colIndex].element.igEditor("option","nullText",this.options.nullTexts[filterCondition]);requiresEntry=this._requiresEntry(filterCondition);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.igEditor("option","disabled",this.grid.options.columns[colIndex].dataType==="bool")}this._editors[colIndex].value(null);this._filterDataSourceClear(this.grid.options.columns[colIndex].key,colIndex)}else{if(!requiresEntry&&!expr){this._editors[colIndex].element.igEditor("option","disabled",true);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].value(null)}if(requiresEntry){this._editors[colIndex].element.igEditor("option","disabled",false)}if(nav===undefined&&filterCondition!==undefined){this._editors[colIndex].setFocus()}}},_requiresEntry:function(filterCondition){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(filterCondition===undefined||filterCondition===null){return false}return true},_editorValueForCondition:function(filterCondition,editor){var date=new Date;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{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)}},_columnFixed:function(args){var i,colInd=args.colInd,cs,editor,fixedColumnsLength=args.fixedColsCount;cs=this.options.columnSettings[colInd];if(cs){this.options.columnSettings.splice(colInd,1);this.options.columnSettings.splice(fixedColumnsLength-1,0,cs)}editor=this._editors[colInd];if(editor){this._editors.splice(colInd,1);this._editors.splice(fixedColumnsLength-1,0,editor);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)}}},_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.container().find("thead").find("[data-role=filterrow]");filterrow.find("[data-skip=true]").remove();this.grid._headerInit(filterrow,null,true)},_injectGrid:function(gridInstance,isRebind){this.grid=gridInstance;if(this.options.type===null){this.options.type=this.grid._inferOpType()}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._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.options.width===null)&&this.grid.options.columnVirtualization===false&&this.options.mode===null){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:"14.1.20141.1020"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Outlook GroupBy feature 14.1.20141.1020
*
* Copyright (c) 2011-2014 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
*	modernizr.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-expandheadercellgb 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",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,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},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(options,element){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+" "+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}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")}this._renderGroupByDialog()},_renderGroupByDialog:function(){var $buttonOK,self=this,o=this.options,$captionButtonContainer,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,gridContainer:this.grid.container(),modalDialogOpening:function(event,args){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(event,args){return self._trigger(self.events.modalDialogClosing,null,{modalDialogElement:modalDialog,owner:self})},modalDialogClosed:function(event,args){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})}},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(e,args){$groupedColumns.slideToggle("slow");$(this).find("span:eq(0)").toggleClass(css.dialogButtonSlideUp);return false}})},_renderLayoutsDropDown:function(){var o=this.options,fn,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({click:function(e,args){clearTimeout(self._dropDownTimeout);setTimeout(function(){$buttonDD.closest("a").focus()},10)}});if(o.modalDialogDropDownWidth){$buttonDD.closest("div").width(o.modalDialogDropDownWidth)}if(modalDialogDropDownAreaWidth){$dropDown.width(modalDialogDropDownAreaWidth)}$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,args){var noCancel,o=this.options,modalDialog=$("#"+this.grid.id()+"_groupby_modalDialog"),i,j,len,tempGroupedCol,isToCallGroupedColumnsChanged=false,copy;noCancel=this._trigger(this.events.modalDialogButtonApplyClick,null,{modalDialogElement:modalDialog,owner:this,groupedColumns:this._tempGroupedColumns,groupedColumnLayouts:this._tempOptions.columnLayouts,sortingExpr:this._tempSortingExpr});if(noCancel){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._trigger(this.events.groupedColumnsChanged,e,{owner:this,groupedColumns:this._tempGroupedColumns})}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}if(o.groupedColumns.length===0&&this.grid.headersTable().find("thead tr").children().first().hasClass("ui-iggrid-expandheadercellgb")){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()}copy=this._orderedGroupedCols.slice(0);this._orderedGroupedCols=[];this._ensureLabelsOrder(copy,this._orderedGroupedCols,this.grid.options);this._rebind();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></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({click:function(e,args){self._dialogButtonAscDescClick(key,layout)}});$buttonUngroup.bind({click:function(e,args){var noCancel;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)}self._renderDialogUngroupedColumn(column,layout);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(e,args){if(!$(this).hasClass(css.dialogButtonsHover)){$(this).addClass(css.dialogButtonsHover)}},mouseout:function(e,args){if($(this).hasClass(css.dialogButtonsHover)){$(this).removeClass(css.dialogButtonsHover)}}})},_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,args){var noCancel;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();self._renderDialogGroupedColumn(column,layout);self._renderDialogButtonClearAll();self._trigger(self.events.modalDialogGroupColumn,e,{key:key,layout:layout,owner:self,groupedColumns:self._tempGroupedColumns})}e.preventDefault();e.stopPropagation()}})},_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,args){self.openGroupByDialog();e.preventDefault();e.stopPropagation()}})},_headerCellDragCancel:function(event,args){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);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",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(event,ui){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(this._getTotalRowCountHandler){this.grid._getTotalRowCount=this._getTotalRowCountHandler;this._getTotalRowCountHandler=null}if(this.options.groupedColumns.length>0){this._renderRecordsInternal()}else{return true}return false},_recordsRendered:function(ui,args){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(){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,gr,groupedRowsLength,tr,countHiddenRows;this._indent=this.options.indentation;if(this.grid.options.fixedHeaders===true){fh=true}if(this.grid._isMultiColumnGrid){this._colspan=this.grid.container().find("#"+this.grid.id()+" colgroup:first>col").length-1}else{if(this.grid.options.showHeader){this._colspan=this.grid.container().find("#"+this.grid.id()+(fh===true?"_headers":"")+" thead>tr:first").children("th:not(.ui-iggrid-expandheadercellgb)").length}else{this._colspan=this.grid.container().find("#"+this.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).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("");if(grid.options.virtualization===true){this.grid._scrollTo(0,true);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}tbodyHtml="";if(!this.options.initialExpand){if(!this._getTotalRowCountHandler){this._getTotalRowCountHandler=$.proxy(grid._getTotalRowCount,grid);grid._getTotalRowCount=$.proxy(this._getTotalRowCount,this)}this._countGroupedRows=html.match(/(data-grouprow="true")/gi).length;this._cachedGroupedRows=this._groupedRows;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)+'"');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;if(this._virtualRowCount>this._groupedRows.length){this._virtualRowCount=this._groupedRows.length}for(i=0;i<this._virtualRowCount;i++){tbodyHtml+=this._groupedRows[i]}}else{for(i=0;i<this._virtualRowCount;i++){tbodyHtml+=this._groupedRows[i]}}if(window.MSApp===undefined){tbody.html(tbodyHtml)}else{MSApp.execUnsafeLocalFunction(function(){tbody.html(tbodyHtml)})}this.grid._buildVirtualDomForContinuousVirtualization()}}else{if(window.MSApp===undefined){tbody.html(html)}else{MSApp.execUnsafeLocalFunction(function(){tbody.html(html)})}if(this.grid.options.width===null){this.grid._setContainerWidth(this.grid.container())}else{this.grid._updateGridContentWidth()}}this._avgRowHeight=this.grid._calculateAvgRowHeight();this.grid._trigger(this.grid.events.rowsRendered,null,{owner:this.grid,tbody:tbody})},_getTotalRowCount:function(){if(this.options.groupedColumns.length>0){return this._countGroupedRows}return this._getTotalRowCountHandler()},_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("__sum__",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,k_val;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"){k_val=k.toLowerCase()==="true"?true:false}else if(t==="number"&&$.type(k)==="string"){k_val=mul*k}else{k_val=k}if(idval!==null&&!idval.length&&idval===k_val*mul||k_val===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,n_val;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"){n_val=n.toLowerCase()==="true"?true:false}else if(t==="number"&&$.type(n)==="string"){n_val=mul*n}else{n_val=n}if(idval!==null&&idval!==undefined&&!idval.length&&idval===n_val*mul){tmpSum=k[n]}else if(n_val===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;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"><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("${key}",col.headerText);if(customName){text=tmpl.replace("${val}",customName).replace("${count}","__sum__")}else{text=tmpl.replace("${val}",val).replace("${count}","__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 colspan="'+this._colspan+'">'+text+"</td>";arr.push('<tr class="'+this.grid.css.recordClass+" "+this.css.groupedRow+'" data-grouprow="true" data-state="'+state+'" data-glevel="'+indent+'"'+(hide?' style="display:none;"':"")+">"+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,key){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,gcval){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,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}noCancel=this._trigger(this.events.groupedColumnsChanging,event,{owner:this,groupedColumns:this.options.groupedColumns,key:key,layout:layout,grid:cgrid});if(noCancel){this.groupByColumn(key,layout);this._trigger(this.events.groupedColumnsChanged,event,{owner:this,groupedColumns:this.options.groupedColumns,key:key,layout:layout,grid:cgrid})}},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";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()},_addSortingExpressions:function(se,expr){var i,seLength=se.length,found=-1;for(i=0;i<seLength;i++){if(se[i].isGroupBy===true){found=i}}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}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)){$.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()}}},_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}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()}}},_regroup:function(){var items=$(".ui-iggrid-groupbyarea",this.grid.container()).find("ul li"),groupby=this,copy;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=[],i;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)}if(layout){groupby._addSortingExpressions(groupby.grid.dataSource.settings.sorting.expressions,{fieldName:k,dir:direction,layout:layout,isGroupBy:true})}else{groupby.options.groupedColumns.push({key:k,dir:direction,col:c});groupby._addSortingExpressions(groupby.grid.dataSource.settings.sorting.expressions,{fieldName:k,dir:direction,isGroupBy:true})}groupby._orderedGroupedCols.push({key:k,dir:direction,col:c,layout:layout})});groupby._ensureLabelsOrder(copy,groupby._orderedGroupedCols,groupby.grid.options);
this.grid._loadingIndicator.show();this._rebindDataSource()},_rebind:function(){this._scrolltop=$(window).scrollTop();this.grid._loadingIndicator.show();this._saveSortingExpressions();this._rebindDataSource();this._groupAreaList()},_rebindDataSource:function(){if(this.options.type==="remote"){this.grid.dataSource.dataBind()}else{if(this.grid.dataSource.settings.sorting.expressions.length>0){this.grid.dataSource.sort(this.grid.dataSource.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)},_toggleGroup:function(event,args){var parentrow=$(event.target).closest("tr"),grid,i,el,currentLevel,cindex,glevel=parentrow.attr("data-glevel"),grouprow,rowPath=[],level=glevel,style;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").find(".ui-iggrid-expandbutton").attr("title",this.options.expandTooltip).removeClass(this.css.groupByExpandCellExpanded).addClass(this.css.groupByExpandCellCollapsed)}else{parentrow.attr("data-state","expanded").find(".ui-iggrid-expandbutton").attr("title",this.options.collapseTooltip).removeClass(this.css.groupByExpandCellCollapsed).addClass(this.css.groupByExpandCellExpanded);if(this._getTotalRowCountHandler){this._renderPartialRecords(parentrow)}}rowPath[glevel]=parentrow;grid.element.children("tbody").children().each(function(index,element){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(grouprow){rowPath[parseInt($this.attr("data-glevel"),10)]=$this}}});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){if(!ui.draggable.hasClass("ui-iggrid-groupedcolumnlabel")){return false}if(ui.draggable.attr("data-key")===$(this).attr("data-key")){return false}$(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;$(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");dragged=parent.find("li[data-key="+ui.draggable.attr("data-key")+"]").first();dragged.insertAfter(this);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",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,j,gc=this._orderedGroupedCols,s=this.grid.dataSource.settings.sorting.expressions,settings,lobj;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}}this._rebind();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;if(this._isDragging){return}noCancel=this._trigger(this.events.groupedColumnsChanging,event,{owner:this,groupedColumns:this.options.groupedColumns,key:key});if(noCancel){layout=$(event.target).attr("data-layout");this.ungroupByColumn(key,layout);this._trigger(this.events.groupedColumnsChanged,event,{owner:this,groupedColumns:this.options.groupedColumns,key:key})}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);this.grid.element.unbind("iggridheaderrenderedinternal",this._headerRenderedHandler);this.grid.element.unbind("iggriddataempty",this._dataRenderingHandler);this.grid.element.unbind("iggridrowsrendering",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);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}}}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).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)}}}},_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(event,args){if(this.options.persist){return}this.ungroupAll()},_saveSortingExpressions:function(){if(this.options.persist){this.grid._savePersistenceData(this.grid.dataSource.settings.sorting.expressions,"sorting",this.grid.element[0].id);this._groupedColumns=this._orderedGroupedCols;this._optionsGC=this.options.groupedColumns}},_getSortingExpressions:function(){return this.grid._getPersistenceData("sorting",this.grid.element[0].id)},_preserveGroupBy:function(){var se=this._getSortingExpressions(),col,layout,layouts,lobj;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}},_injectGrid:function(gridInstance,isRebind){var i,gc,gcsort,s,root=null,orderedGrouped=null,layoutGrouped=null;this.grid=gridInstance;if(this.options.type===null){this.options.type=this.grid._inferOpType()}root=this.element.closest(".ui-iggrid-root");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._headerRenderedHandler=$.proxy(this._headerRendered,this);this._dataRenderingHandler=$.proxy(this._dataEmpty,this);this._toggleGroupHandler=$.proxy(this._toggleGroup,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._detachEvents();this.grid.element.bind("iggridheaderrenderedinternal",this._headerRenderedHandler);this.grid.element.bind("iggriddataempty",this._dataRenderingHandler);this.grid.element.bind("iggridrowsrendering",this._rowsRenderingHandler);this.grid.element.bind("iggridrowsrendered",this._rowsRenderedHandler);this.grid.element.bind("iggridheadercellrendered",this._headerCellRenderedHandler);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)}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._preserveGroupBy()}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){if(this._getTotalRowCountHandler){return this._countGroupedRows}return this._groupedRows.length}return this.grid.dataSource.dataView().length},_rebuildVirtualRows:function(event,args){var scrollData,scrollResult,virtualScrollerY,deltaScroll,tableId,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}tbody.empty();rowsHtml="";for(i=startIndexToBeLoaded;i<=endIndexToBeLoaded;i++){rowsHtml+=this._groupedRows[i]}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&&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}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}tbody.empty();rowsHtml="";for(i=start;i<=end;i++){rowsHtml+=this._groupedRows[i]}tbody.html(rowsHtml);displayContainerScrollTop=0;maxScrollPos=this.grid._getScrollContainerHeight()-this.grid._getDisplayContainerHeight();if(maxScrollPos-3<=virtualScrollerY&&virtualScrollerY<=maxScrollPos+3){displayContainerScrollTop=1e4}this.grid._setDisplayContainerScrollTop(displayContainerScrollTop)}if(this._addScrollHeight){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}return false}});$.extend($.ui.igGridGroupBy,{version:"14.1.20141.1020"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Column Hiding 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 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
 */
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},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(options,element){this.options.columnSettings=[];$.Widget.prototype._createWidget.apply(this,arguments)},_setOption:function(key,value){throw new Error($.ig.Grid.locale.optionChangeNotSupported+" "+key)},destroy:function(){var 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.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler);this.grid.element.unbind("iggriduidirty",this._uiDirtyHandler);this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.unbind("iggrid_columnsmoved",this._columnsMovedHandler);modalDialog.igGridModalDialog("getCaptionButtonContainer");modalDialog.remove();$.Widget.prototype.destroy.call(this);return this},showColumnChooser:function(){this._openColumnChooser(false)},hideColumnChooser:function(){this._closeColumnChooser(false)},showColumn:function(column,isMultiColumnHeader){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);colToShow.hidden=false;colToShow.colspan=len}else{this.grid.showColumn(column)}},hideColumn:function(column,isMultiColumnHeader){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);colToHide.hidden=true;colToHide.colspan=0}else{this.grid.hideColumn(column)}},hideMultiColumns:function(columns){var i,columnsLength=columns.length;for(i=0;i<columnsLength;i++){this.grid.hideColumn(columns[i])}},showMultiColumns:function(columns){var i,columnsLength=columns.length;for(i=0;i<columnsLength;i++){this.grid.showColumn(columns[i])}},_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){this.grid.showColumn(column);setTimeout(function(){self._trigger(self.events.columnShown,null,{owner:self,columnKey:columnKey,columnIndex:columnIndex})},50)}return noCancel},_setHiddenMultipleColumns:function(columnsToShow,columnsToHide){var self=this,columnKey,columnIndex;self.grid._loadingIndicator.show();setTimeout(function(){var i,column,noCancel;for(i=0;i<columnsToShow.length;i++){column=columnsToShow[i];if(typeof column==="number"){columnIndex=column}else{columnKey=column}noCancel=self._trigger(self.events.columnShowing,null,{owner:self,columnKey:columnKey,columnIndex:columnIndex});if(noCancel){self.grid._setHidden(column,false)}self._trigger(self.events.columnShown,null,{owner:self,columnKey:columnKey,columnIndex:columnIndex})}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=self._trigger(self.events.columnHiding,null,{owner:self,columnKey:columnKey,columnIndex:columnIndex});if(noCancel){self.grid._setHidden(column,true);self._trigger(self.events.columnHidden,null,{owner:self,columnKey:columnKey,columnIndex:columnIndex})}}self.grid._loadingIndicator.hide()},0)},_hideMultiColumnFromUI:function(id){var i,self=this,column,children,columnKey,childrenLength,noCancel,visibleChildrenLength=0,columnKeysToHide=[],columnKeysHidden=[];if(self.grid._visibleColumns().length===1){return false}column=this.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(self.grid._visibleColumns().length-visibleChildrenLength<1){return false}for(i=0;i<childrenLength;i++){columnKeysToHide.push(children[i].key)}if(!this.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){self.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){self.grid._setHidden(columnKey,true);columnKeysHidden.push(columnKey);self._trigger(self.events.columnHidden,null,{owner:self,columnKey:columnKey,columnIndex:undefined})}}}column.hidden=true;column.colspan=0;self.grid._loadingIndicator.hide();self._trigger(self.events.multiColumnHidden,null,{owner:self,columnKeys:columnKeysHidden})},0)}},_columnFixed:function(args){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.hideColumn(column);setTimeout(function(){self._trigger(self.events.columnHidden,null,{owner:self,columnKey:columnKey,columnIndex:columnIndex})},50)}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){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,isSelected){this._closeColumnChooser(true);this._hideColumnFromUI(columnKey)},_featureChooserColumnChooser:function(event,columnKey,isSelected){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,indicatorContainer=th.find(".ui-iggrid-indicatorcontainer");if(indicatorContainer.length===0){indicatorContainer=$("<div></div>").addClass("ui-iggrid-indicatorcontainer").appendTo(th)}$("<span>&laquo;</span>").addClass(this.css.hidingHeaderIndicator).appendTo(indicatorContainer).wrap($("<a></a>").css("display","inline").attr("data-hiding-indicator","true").attr("href","#").attr("title",$.ig.GridHiding.locale.hideColumnIconTooltip)).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(index){var th=$(this);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(e){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);$("#"+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(e,args){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 true},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=$("<div></div>").appendTo(this.grid._rootContainer()).attr("id",this.grid.id()+"_hiding_modalDialog");if(this.options.columnChooserContainment!=="owner"){containment=$("body")}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){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(event,args){return self._trigger(self.events.columnChooserClosing,null,{columnChooserElement:modalDialog,owner:self})},modalDialogClosed:function(event,args){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)})}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()+"']");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(e){self._toggleDropDown(button,dropDown,true)}});button.parent().bind({mousedown:function(e){self._toggleDropDown(button,dropDown,false);e.preventDefault();e.stopPropagation()},mouseover:function(e){if(button.attr("data-indicator-selected")!=="true"){button.addClass(self.css.hiddenColumnIndicatorMouseOver)}},mouseout:function(e){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(e){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(fireEvents){var modalDialog=$("#"+this.grid.id()+"_hiding_modalDialog");modalDialog.igGridModalDialog("openModalDialog")},_closeColumnChooser:function(fireEvents){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()},_injectGrid:function(gridInstance,isRebind){var i,j,cs,col;this.grid=gridInstance;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)}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){for(j=0;j<col.children.length;j++){col.children[j].hidden=cs.hidden}}}}}}});$.extend($.ui.igGridHiding,{version:"14.1.20141.1020"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Hierarchical Grid 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 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",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+" "+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()){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.virtualizationMode="continuous"}this._eventQueue=[];this._animationQueue=[];this.dataBind();this.rootWidget()._isMultiColumnGrid=this._checkIsMultiColumnHeader(this.options)},_createWidget:function(options,element){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){this._toggleInternal({target:$(element).find(".ui-iggrid-expandcolumn")},true)},expand:function(id){if(!this.populated(id)){this._toggleInternal({target:$(id).find(".ui-iggrid-expandcolumn")},true)}else{this._expand(id,true)}},_expand:function(id,suppressEvents){var tr=$(id),c,noCancel=true,handler,emptystr="",rootgrid;if(!suppressEvents){noCancel=this._trigger(this.events.rowExpanding,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")+emptystr]===true){return}rootgrid._animationQueue[tr.attr("data-id")+emptystr]=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,handler)}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);if(!suppressEvents){this._rowExpanded({owner:this,parentrow:tr});this._trigger(this.events.rowExpanded,null,{owner:this,parentrow:tr})}}tr.attr("state","e");tr.next().children().first().removeClass(this.css.childGridAreaCollapsed).addClass(this.css.childGridArea)}},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){var expcell,expcellspan,rootgrid,$this=ctx?$(ctx):$(this),prow=$this.closest("tr[data-container]").prev(),emptystr="";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);if(rootgrid._animationQueue[prow.attr("data-id")+emptystr]===true){delete rootgrid._animationQueue[prow.attr("data-id")+emptystr]}},_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._rowExpanded({owner:rootgrid,parentrow:prow});rootgrid._trigger(rootgrid.events.rowExpanded,null,{owner:rootgrid,parentrow:prow})},_collapseendnoevents:function(ctx){var expcell,expcellspan,rootgrid,$this=ctx?$(ctx):$(this),ctd=$this.closest(".ui-iggrid-childarea"),prow=$this.closest("tr[data-container]").prev(),emptystr="";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")+emptystr]===true){delete rootgrid._animationQueue[prow.attr("data-id")+emptystr]}},_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){this._collapse(id,true)},_collapse:function(id,suppressEvents){var tr=$(id),c,noCancel=true,handler,emptystr="",rootgrid;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")+emptystr]===true){return}rootgrid._animationQueue[tr.attr("data-id")+emptystr]=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,handler)}else{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._rowCollapsed({owner:this,parentrow:tr});this._trigger(this.events.rowCollapsed,null,{owner:this,parentrow:tr})}}tr.attr("state","c")}},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)},_toggleInternal:function(event,suppressEvents){var created=$(event.target).closest("tr").attr("c"),tr=$(event.target).closest("tr"),p=tr.find(".ui-iggrid-expandcolumn"),hgrid=this,x,y,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)},expandTout)}else{setTimeout(function(){hgrid._toggleInternalAsync(event,suppressEvents)},expandTout)}if(!suppressEvents){event.stopImmediatePropagation()}},_toggleInternalAsync:function(event,suppressEvents){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,cs,popts,i,h,parentLevel=0,tmpgrid,state=parentrow.attr("state"),animatec,noCancel=true,noCancelChild=true,pid;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)}childgrids[i].attr("id",this.root()[0].id+"_"+parentrow.attr("data-id")+"_"+opts[i].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;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,{owner:this,options:opts[i],element:childgrids[i],id:rowid,path:keyspath+keyspathvar});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}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 instanceof $.ig.DataSource){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{if(this.options.odata){dsobj=ds instanceof $.ig.DataSource?ds.settings.dataSource:ds;dsString=popts.dataSource instanceof $.ig.DataSource?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(ds instanceof $.ig.DataSource){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}childgrids[i].igGrid(opts[i]);if(isHierarchical){this._regToggleEvent(childgrids[i],this)}}}}animatec.attr("id","ac");parentrow.attr("c",true);parentrow.next().hide();animatec.hide();this._expand(parentrow,suppressEvents)}else{if(state==="e"){this._collapse(parentrow,suppressEvents)}else if(state==="c"){this._expand(parentrow,suppressEvents)}}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;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();if(this.options.dataSource instanceof $.ig.HierarchicalDataSource&&this.options.dataSource.settings.schema===null||!(this.options.dataSource instanceof $.ig.HierarchicalDataSource)){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,columnLayouts=lobj.columnLayouts,cols=lobj.columns,columnLayoutsLength,colsLength;if(cols){colsLength=cols.length;for(i=0;i<colsLength;i++){if(cols[i].group!==undefined&&cols[i].group!==null){return true}}}if(columnLayouts){columnLayoutsLength=columnLayouts.length;for(i=0;i<columnLayoutsLength;i++){if(this._checkIsMultiColumnHeader(columnLayouts[i])===true){return true}}}return false},_hierarchicalRenderRecord:function(data,rowIndex){var i,key,ar=this.options.accessibilityRendering,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)+"'"}if(ar){dstr+=' role="row">'}else{dstr+=">"}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]&&data[childprop].length!==undefined&&(data[childprop].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 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;if(ar){dstr+='<td role="gridcell" aria-describedby="'+this.key+'"'}else{dstr+="<td"}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)+">"+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)+">"+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,key,ar=this.options.accessibilityRendering,grid=this,lod,hg,childprop,val,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)+"'")}if(ar){darr.push(' role="row">')}else{darr.push(">")}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++){if(data[layouts[i].key]){childprop=layouts[i].key}else{childprop=layouts[i].childrenDataProperty}childprop=childprop||this.options.defaultChildrenDataProperty;if(childprop){if(this.options.responseDataKey){if(data[childprop]&&data[childprop][this.options.responseDataKey]&&data[childprop][this.options.responseDataKey].length!==undefined&&data[childprop][this.options.responseDataKey].length>0){hasChildren=true;break}}else{if(data[childprop]&&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 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;if(ar){darr.push('<td role="gridcell" aria-describedby="'+this.key+'"')}else{darr.push("<td")}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._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._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;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._toggleInternal,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;if(grid.element[0].id!==sender.currentTarget.id){return}level=parseInt(grid.element.attr("data-level"),10);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;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)},_rowCollapsed:function(args){var rowExpansion=args.parentrow.next(),rowHeight,parentGrid,currentHeight;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)},_hierarchicalGetFirstVisibleTR:function(visibleArea){var tableId="#"+this.element[0].id,firstVisibleTR;firstVisibleTR=$(tableId+' > tbody > tr:not([data-container="true"])').filter(function(index){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(index){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:"14.1.20141.1020"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Merged Cells 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 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"},events:{cellsMerging:"cellsMerging",cellsMerged:"cellsMerged"},_create:function(){this._db=0;this._sortingRequested=false;this._v=false},destroy:function(){this._removePaint();this._unregisterEvents();$.Widget.prototype.destroy.call(this);return this},_gridPaging:function(){this._db--},_gridSorting:function(){this._sortingRequested=true},_gridSorted:function(){this._sortingRequested=false},_gridRendered:function(event,ui){var key,index,sExp=this.grid.dataSource.settings.sorting.expressions,i,j;if(this.options.initialState==="merged"&&this._db===0&&this._sortingRequested===false){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)}}}this._db++},_rrn:function(event,args){this._db--;this._gridRendered()},_rcn:function(event,args){this._db--;this._gridRendered()},_columnsCollectionModified:function(){this._gridRendered()},_paintMergedCells:function(index,key){var cells,prvCell,curCell,prvCellTxt,curCellTxt,first=true,str=false,hasFixedCols=this.grid.hasFixedColumns(),id,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._gridRenderedHandler=$.proxy(this._gridRendered,this);this._sortingInitiatedHandler=$.proxy(this._gridSorting,this);this._sortingHandler=$.proxy(this._gridSorted,this);this._pagingHandler=$.proxy(this._gridPaging,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("ig_gridrendered",this._gridRenderedHandler);this.grid.element.bind("iggridsortingcolumnsorting",this._sortingInitiatedHandler);this.grid.element.bind("iggridsortingcolumnsorted",this._sortingHandler);this.grid.element.bind("iggridpagingpageindexchanging",this._pagingHandler);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("ig_gridrendered",this._gridRenderedHandler);this.grid.element.unbind("iggridsortingcolumnsorting",this._sortingInitiatedHandler);this.grid.element.unbind("iggridsortingcolumnsorted",this._sortingHandler);this.grid.element.unbind("iggridpagingpageindexchanging",this._pagingHandler);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._registerEvents()}});$.extend($.ui.igGridCellMerging,{version:"14.1.20141.1020"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid LoadOnDemand 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 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.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.igGridLoadOnDemand",{options:{type:null,chunkSize:25,recordCountKey:null,chunkSizeUrlKey:null,chunkIndexUrlKey:null,defaultChunkIndex:0,currentChunkIndex:0,loadTrigger:"auto",loadMoreDataButtonText:$.ig.GridLoadOnDemand.locale.loadMoreDataButtonText},events:{rowsRequesting:"rowsRequesting",rowsRequested:"rowsRequested"},_loadingIndicator:null,_injectGrid:function(gridInstance,isRebind){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.chunkIndexUrlKey=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._probeForNextPage,this)}this._appendRecordsHandler=$.proxy(this._appendRecords,this);this.grid.element.bind("iggridrowsrendered",this._rowsRenderingHandler)},_dataRendered:function(){var scrollId="#"+this.grid.scrollContainer()[0].id,buttonId,container;this.grid.scrollContainer().css("background-color","white");this._originalDataSourceCallback=this.grid.dataSource.settings.callback;this._initLoadingIndicator();if(this.options.loadTrigger==="auto"){$(scrollId).unbind("scroll",this._verticalScrollHandler);$(scrollId).bind("scroll",this._verticalScrollHandler);this._probeForNextPage()}this._requestPending=false;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.GridLoadOnDemand.locale.loadOnDemandRequiresHeight)}if(this.grid.options.virtualization){throw new Error($.ig.GridLoadOnDemand.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.GridLoadOnDemand.locale.groupByNotSupported);case"paging":throw new Error($.ig.GridLoadOnDemand.locale.pagingNotSupported);case"cellmerging":throw new Error($.ig.GridLoadOnDemand.locale.cellMergingNotSupported)}}},_setOption:function(key,value){$.Widget.prototype._setOption.apply(this,arguments);if(key==="defaultChunkIndex"){throw new Error($.ig.Grid.locale.optionChangeNotSupported+" "+key)}if(key==="currentChunkIndex"||key==="chunkSize"){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.grid.dataSource.pageIndex()>=this.grid.dataSource.pageCount()-1){return}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",scrollId="#"+this.grid.scrollContainer()[0].id,container=this.grid.options.height?this.grid.scrollContainer():this.grid.container(),button=this.grid.container().find("div.ui-iggrid-loadmorebutton");$("#"+buttonId).igButton("destroy");if(button){button.remove()}this.grid.element.unbind("iggridrowsrendered",this._rowsRenderingHandler);$(scrollId).unbind("scroll",this._verticalScrollHandler);$.Widget.prototype.destroy.call(this);return this},_appendRecords:function(success,errmsg){var i,currentPage,noCancelError;if(success===true){currentPage=this.grid.dataSource.recordsForPage(this.grid.dataSource.settings.paging.pageIndex);for(i=0;i<currentPage.length;i++){this.grid.renderNewRow(currentPage[i])}}this._requestPending=false;this.grid.dataSource.settings.paging.pageSize=this.options.chunkSize*(this.options.currentChunkIndex+1);this.grid.dataSource.settings.paging.pageIndex=0;this.grid.dataSource.settings.paging.appendPage=false;this.grid.dataSource.settings.callback=this._originalDataSourceCallback;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.grid.dataSource.settings.paging.pageSize=this.options.chunkSize*(this.options.currentChunkIndex+1);this._trigger(this.events.rowsRequested,null,{owner:this,chunkIndex:this.options.currentChunkIndex,chunkSize:this.options.chunkSize,rows:currentPage})},_refreshData:function(){this._showLoading();this.grid.dataSource.settings.paging.appendPage=false;this.grid.dataSource.settings.callback=this._originalDataSourceCallback;this._requestPending=true;this.grid.dataSource.dataBind()},_probeForNextPage:function(evt,ui){var delta=(this.grid.scrollContainer().scrollTop()+this.grid.scrollContainer().height())/$(this.grid.element).height();if(delta>=1&&!this._requestPending){this._nextChunk()}},nextChunk:function(){this._nextChunk()}});$.extend($.ui.igGridLoadOnDemand,{version:"14.1.20141.1020"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Multi Headers 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 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:{},_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+'"></tr>').appendTo(headerContainer);for(i=0;i<row.length;i++){col=row[i];$headerCell=this._createHeaderColumnMarkup(col.headerText,col.colspan,col.key,col.level,col.identifier,col.rowspan);$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()}else{$container=$("<thead></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(headerText,colSpan,columnKey,level,identifier,rowspan){var grid=this.grid,id,isMultiColumnHeader=true,headerClass=grid.css.headerClass,$th=$("<th></th>"),$headerCell;$headerCell=$th.append('<span class="'+grid.css.headerTextClass+'">'+headerText+"</span>").attr("role","rowheader").addClass(headerClass);if(colSpan>1){$th.attr("colspan",colSpan)}if(rowspan>1){$headerCell.attr("rowspan",rowspan)}if(columnKey){$headerCell.attr("id",this.grid.element[0].id+"_"+columnKey)}if(level===0){id=columnKey;isMultiColumnHeader=false;$headerCell.attr("data-isheadercell",true)}else{id=identifier;$headerCell.addClass(this.css.multiHeaderCell);$headerCell.attr("data-mch-id",identifier)}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,isRebind){this.grid=gridInstance}});$.extend($.ui.igGridMultiHeaders,{version:"14.1.20141.1020"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Paging 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 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.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},events:{pageIndexChanging:"pageIndexChanging",pageIndexChanged:"pageIndexChanged",pageSizeChanging:"pageSizeChanging",pageSizeChanged:"pageSizeChanged",pagerRendering:"pagerRendering",pagerRendered:"pagerRendered"},_loadingIndicator:null,_isPaging:false,_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+" "+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.igEditor("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){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}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});if(noCancel){this._showLoading();if(this.grid._hasUnboundColumns&&this.options.type==="remote"){this.grid._rebindUnboundColumns=true}this.options.pageSize=size;this.grid.dataSource.pageSize(size)}if(this._pageSizeDD){this._pageSizeDD.igEditor("value",size)}}else{return this.grid.dataSource.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});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.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});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.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});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});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(pagerElement){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});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)}});this.grid.element.bind("iggridupdatinginternalrowadded",this._dataRenderedHandler);this.grid.element.bind("iggridupdatinginternalrowdeleted",this._rowDeletedHandler)},_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){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)},_plabel:function(){return this._pager().find(".ui-iggrid-pagerrecordslabel")},_pager:function(){return this.grid.container().find(".ui-iggrid-pager")},_dataRendered:function(){var id=this.grid.element[0].id,pageCount,i,html,pagerHtml=toStaticHTML('<div id="'+id+'_pager"></div>'),pageLinkHtml=toStaticHTML('<li class="${pageClass}"><a class="${pageLinkClass}" href="javascript:void(0);">${page}</a></li>'),pager=null,startRecord=0,endRecord=0,recordsCount=0,localRecordsCount=0,noCancel=true,pageList,pagesArray,dropDownContainer,startPageIndex=0,endPageIndex=0,template=this.options.pagerRecordsLabelTemplate,self=this,pagerRight=null,vpc=this.options.visiblePageCount,val=0,recordsLabel=null;this._deleteOld();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()}this._initLoadingIndicator();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;if(this.grid.dataSource._filter){recordsCount=this.grid.dataSource._filteredData.length;localRecordsCount=this.grid.dataSource._filteredData.length}else{localRecordsCount=this.grid.dataSource.totalLocalRecordsCount()}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){self._showLoading();self.pageIndex($(event.currentTarget).closest("li").data("pageIndex"));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 a",this._pagerEvents)}this._pager().delegate("li a",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);this._curPageDD=$("<span />").css("display","none").appendTo(dropDownContainer).addClass(this.css.pageDropDownContainer).igEditor({listItems:pagesArray,readOnly:false,listMatchOnly:true,width:this.options.defaultDropDownWidth,nullable:false,listAutoComplete:true,button:"dropdown",type:"text",value:this.options.currentPageIndex+1,dropDownTriggers:"button,focus",textChanged:$.proxy(this._onSelectDropDownPageIndex,this)}).css("display","");$("<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})}}},_onSelectDropDownPageIndex:function(event,args){var self=this;if(this._timeoutId!==undefined){clearTimeout(this._timeoutId)}if(parseInt(this.options.delayOnPageChanged,10)===0){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;noCancel=this._trigger(this.events.pageIndexChanging,null,{newPageIndex:parseInt(args.text,10)-1,currentPageIndex:this.options.currentPageIndex,owner:this});if(noCancel){noCancelBinding=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid});if(noCancelBinding){this._shouldFirePageIndexChanged=true;if(args.text){this._showLoading();this.pageIndex(parseInt(args.text,10)-1)}}this.grid.element.trigger("iggriduisoftdirty",{owner:this})}else{args.owner.value(this.options.currentPageIndex+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);"></a>'));imgspan.parent().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);"></a>'));imgspan.parent().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);"></a>'));imgspan.parent().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);"></a>'));imgspan.parent().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 editorId=this.grid.id()+"_editor",cClass,items;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).addClass(this.css.pageSizeDropDown);$("<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(",")}this._pageSizeDD=this.grid.container().find("#"+editorId).css("display","none").igEditor({width:this.options.defaultDropDownWidth,button:"dropdown",dropDownOnReadOnly:true,dropDownTriggers:"button,focus",listItems:items,listMatchOnly:true,readOnly:true,textAlign:"left",type:"numeric",value:this.pageSize(),textChanged:$.proxy(this._changePageSize,this)}).css("display","");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.igEditor("destroy");delete this._curPageDD}if(this._pageSizeDD&&this._pageSizeDD.closest("body").length>0&&(destroy||this.options.pageSizeDropDownLocation==="inpager")){this._pageSizeDD.igEditor("destroy");delete this._pageSizeDD}this.grid.element.unbind("iggridupdatinginternalrowadded",this._dataRenderedHandler);this.grid.element.unbind("iggridupdatinginternalrowdeleted",this._rowDeletedHandler)},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},_createHandlers:function(){this._dataRenderedHandler=$.proxy(this._dataRendered,this);this._rowDeletedHandler=$.proxy(this._rowDeleted,this)},_injectGrid:function(gridInstance,isRebind){this.grid=gridInstance;this._createHandlers();if(this.options.type===null){this.options.type=this.grid._inferOpType()}this.grid.dataSource.settings.paging.type=this.options.type||"remote";this.grid.dataSource.settings.paging.pageIndex=this.options.currentPageIndex;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.igEditor("option","value",this.options.pageSize)}},_empty:function(){return""}});$.extend($.ui.igGridPaging,{version:"14.1.20141.1020"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Column Resizing 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 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
 */
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}],handleTreshold:5},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(options,element){this.options.columnSettings=[];$.Widget.prototype._createWidget.apply(this,arguments)},_setOption:function(key,value){throw new Error($.ig.Grid.locale.optionChangeNotSupported+" "+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(width===undefined||width===null){this._autoResize(columnIndex,false,null)}else{this._resizeColumn(columnIndex,width,false,null)}},_headerRendered:function(event,ui){this._renderResizingHandles()},_columnsCollectionModified:function(){this._renderResizingHandles()},_columnsMoved:function(){this._populateMultiColumnHeadersLevel0()},_columnFixed:function(args){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(index){var a,th=$(this);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){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 href='#' />").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.handleTreshold+"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(event){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(event){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 rows,isFixed,columnKey,hasFixedCols=this.grid.hasFixedColumns(),rowsContainer=this.grid.element,visibleColumns,cells=[],visibleIndex=columnIndex,maxWidth=0,measureDiv,i;if(hasFixedCols){visibleColumns=this.grid._visibleColumns();isFixed=visibleColumns[columnIndex].fixed===true;columnKey=visibleColumns[columnIndex].key;visibleIndex=this.grid._getVisibleIndexByKey(columnKey);if(isFixed){rowsContainer=this.grid.fixedContainer().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 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());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,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(){this._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,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(){this._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,visibleColumns=this.grid._visibleColumns(),columnKey=visibleColumns[columnIndex].key,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(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.grid.element.igGridColumnFixing!==undefined){minimalVisibleAreaWidth=this.grid.element.data("igGridColumnFixing").options.minimalVisibleAreaWidth}if(this.grid.fixedContainer().outerWidth()-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++){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++){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;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.grid._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.grid._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.grid.element.data("igGridColumnFixing")._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 offset=this.grid.container().offset();return{top:-offset.top,left:-offset.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){var i;for(i=0;i<this.options.columnSettings.length;i++){if(this.options.columnSettings[i].columnKey===key){return this.options.columnSettings[i]}}},_initDefaultSettings:function(){var settings=[],key,cs=this.options.columnSettings,i,j;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){continue}for(key in cs[i]){if(cs[i].hasOwnProperty(key)&&key!=="columnIndex"&&key!=="columnKey"){settings[j][key]=cs[i][key]}}}this.options.columnSettings=settings},_injectGrid:function(gridInstance,isRebind){this.grid=gridInstance;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))}});$.extend($.ui.igGridResizing,{version:"14.1.20141.1020"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Responsive 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 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}},events:{responsiveColumnHiding:"responsiveColumnHiding",responsiveColumnHidden:"responsiveColumnHidden",responsiveColumnShowing:"responsiveColumnShowing",responsiveColumnShown:"responsiveColumnShown",responsiveModeChanged:"responsiveModeChanged"},css:{verticalContainerCssClass:"ui-iggrid-responsive-vertical"},_createWidget:function(options,element){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._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+" "+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._gridRenderedHandler){this.grid.element.unbind("iggridrendered",this._gridRenderedHandler);this.grid.element.unbind("iggridheaderrendering",this._gridHeaderRenderingHandler)}this.grid.element.unbind("iggrid_heightchanged",this._gridContainerHeightHandler);$("#"+this.grid.element[0].id+"_responsive_test_container").remove();$.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(removeContainer){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(definedModes){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},_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})}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},_updateGridSync:function(initial,full){var self=this;if(!this._gridReady()){setTimeout(function(){self._updateGridSync(initial,full)},50);return}self._updateGrid(initial,full)},_updateGrid:function(initial,full){var result=[],applyTemplates=false,colsToShow,colsToHide,self=this,i;if(this._hiddenByClass===true){result=this._updateColumnsByClass()}if(full===true){if(this._hiddenByClass===false){result=this._updateColumns()}applyTemplates=this._updateTemplates()}colsToShow=result[0]||[];colsToHide=result[1]||[];if(colsToShow.length===0&&colsToHide.length===0){if(applyTemplates===true&&initial===false){this.grid._renderData()}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]},_updateTemplates:function(){var i,cs=this.options.columnSettings,nt,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(col.template!==nt){col.template=nt;updated=true}}if(updated===true){if(!this.grid._tmplWrappers){this.grid._tmplWrappers=jsRndr?$.render:{}}this.grid._setTemplateDefinition(jsRndr)}return updated},_renderRecord:function(data,index){var i=0,str,tstr,alt,vc=this.grid._visibleColumns();if(!this._vr){return this._originalRenderRecord(data,index)}str="";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+="><td>";str+=vc[i].headerText+"</td>";str+="<td";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},_renderColgroup:function(table,isHeader,isFooter,autofitLastColumn){var colgroup,fcw,scw;this._vr=this._vr===null?this._shouldRenderVertically():this._vr;if(!this._vr){this._originalRenderColgroup(table,isHeader,isFooter,autofitLastColumn);return}colgroup=$(table).find("colgroup");if(colgroup.length===0){colgroup=$("<colgroup></colgroup>").prependTo(table)}colgroup.empty();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>")},_enableVerticalGrid:function(){this.grid.element.addClass(this.css.verticalContainerCssClass);if(!this.options.showHeader||!this.options.fixedHeaders||this.options.height===null){this.grid.headersTable().children("thead").css("position","absolute");this.grid.headersTable().children("thead").css("top","-100px")}else{this.grid.headersTable().css("position","absolute");this.grid.headersTable().css("top","-100px")}this._vr=true;this._modifySortingStyles();this.grid._rerenderColgroups();this.grid._renderData()},_disableVerticalGrid:function(){this.grid.element.removeClass(this.css.verticalContainerCssClass);if(!this.options.showHeader||!this.options.fixedHeaders||this.options.height===null){this.grid.headersTable().children("thead").css("position","");this.grid.headersTable().children("thead").css("top","")}else{this.grid.headersTable().css("position","");this.grid.headersTable().css("top","")}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,value){if(this.isActive()===true){env=key;return false}});return env},_containerResized:function(){var mode=this._getCurrentMode(),shouldUpdate=false;this._setMaxWidthOnGrid();if(mode&&mode!==this._mode){this._trigger(this.events.responsiveModeChanged,null,{owner:this,previousMode:this._mode,mode:mode});this._mode=mode;shouldUpdate=true}if(shouldUpdate||this._hiddenByClass){this._updateGridSync(false,shouldUpdate)}if(this._shouldRenderVertically()){if(!this._vr){this._enableVerticalGrid()}}else{if(this._vr){this._disableVerticalGrid()}}},_gridHeaderRendering:function(evt,ui){var i;if(ui.owner.id()!==this.grid.id()){return}this._renderTestElement();this._mode=this._getCurrentMode();this._defaultColumnTemplates=this._getDefaultColumnTemplates();if($.isArray(this.grid._initialHiddenColumns)){for(i=0;i<this.grid._initialHiddenColumns.length;i++){this.grid._initialHiddenColumns[i].hidden=true}}this._updateGridSync(true,true);this.grid._captureInitiallyHiddenColumns()},_gridFullyRendered:function(evt,ui){this._activateContainer();if(this._vr===true){if(!this.options.showHeader||!this.options.fixedHeaders||this.options.height===null){this.grid.headersTable().children("thead").css("position","absolute");this.grid.headersTable().children("thead").css("top","-100px")}else{this.grid.headersTable().css("position","absolute");this.grid.headersTable().css("top","-100px")}this.grid.element.addClass(this.css.verticalContainerCssClass);this._modifySortingStyles()}this._alreadyRendered=true;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(evt,ui){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._gridRenderedHandler=$.proxy(this._gridFullyRendered,this);this._gridContainerHeightHandler=$.proxy(this._heightChanged,this)},_injectGrid:function(gridInstance,isRebind){if(isRebind===true){return}this.grid=gridInstance;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._gridRenderedHandler)}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.grid._renderRecord=this._newRenderRecord;this.grid._renderColgroup=this._newRenderColgroup}});$.extend($.ui.igGridResponsive,{version:"14.1.20141.1020"});$.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 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 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($){$.widget("ui.igGridRowSelectors",{options:{enableRowNumbering:true,enableCheckBoxes:false,rowNumberingSeed:0,rowSelectorColumnWidth:null,requireSelection:true,showCheckBoxesOnFocus:false},css:{rowSelector:"ui-iggrid-rowselector-class",rowSelectorSelected:"ui-iggrid-selectedcell ui-state-active",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(options,element){$.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();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);$.Widget.prototype.destroy.call(this);return this},_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.options.enableCheckBoxes===true&&this._ms){$(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.options.enableCheckBoxes===true&&i===0&&this._ms){$(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.grid.element.igGridSelection("option","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},_recordsRendering:function(event,ui){if(this.grid.id()!==ui.owner.id()){return}this._cIdx=ui.vrtWnd.start&&ui.vrtWnd.end?ui.vrtWnd.start:0;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.grid.element.igGridSelection("option","multipleSelection")===true;this._registerCellEvents();if(this.options.enableCheckBoxes===true){this._registerCheckBoxEvents()}},_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,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},_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");if(cell.length===0){cell=row.children().first();index=0}else{index=cell.index()+1}if(prepend===true||cell.length===0){rHeader.prependTo(row);index=0}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,mouseover:this._checkboxMouseOverHandler,mouseout:this._checkboxMouseOutHandler}).bind({click:this._checkboxClickHandler,mouseover:this._checkboxMouseOverHandler,mouseout:this._checkboxMouseOutHandler});this._headerCheckbox().unbind({click:this._hCheckboxClickHandler,mouseover:this._checkboxMouseOverHandler,mouseout:this._checkboxMouseOutHandler}).bind({click:this._hCheckboxClickHandler,mouseover:this._checkboxMouseOverHandler,mouseout:this._checkboxMouseOutHandler})},_unregisterCheckBoxEvents:function(){this._allCheckboxes().unbind({click:this._checkboxClickHandler,mouseover:this._checkboxMouseOverHandler,mouseout:this._checkboxMouseOutHandler});this._headerCheckbox().unbind({click: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){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);this._updateHeader();delete args.currentState;args.state=args.newState;delete args.newState;this._triggerCheckedEvent(event,args)}event.stopPropagation()},_headerCheckBoxClicked:function(event){var trg=$(event.target).closest("span[name='hchk']"),args,noCancel,state=trg.attr("data-chk");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=checkbox.parent().parent(),idx=this._getVisibleRowIndex(row),rIdx=this._getVisibleHRowIndex(row),offset=0;if(checkbox===undefined||checkbox===null){return}if(this._v===true){offset=this.grid._startRowIndex}if(checkbox.attr("data-chk")==="off"){this._alterCheckbox(checkbox,true);if(!this._ms){this._clearRowSelectorsSelection()}this.grid.element.igGridSelection("selectRow",rIdx+offset)}else{this._alterCheckbox(checkbox,false);this.grid.element.igGridSelection("deselectRow",rIdx+offset)}},_handleHeaderCheck:function(checkbox){var checkBoxes=this._allCheckboxes(),i,vfs,sm;this.grid.element.unbind("iggridselectioninternalrowselectionchanged",this._rowSelectionChangedHandler);if(checkbox.attr("data-chk")==="off"){this._alterCheckbox(checkbox,true);for(i=0;i<checkBoxes.length;i++){if(checkBoxes.eq(i).attr("data-chk")==="off"){this._handleCheck(checkBoxes.eq(i))}}}else{this._alterCheckbox(checkbox,false);for(i=0;i<checkBoxes.length;i++){if(checkBoxes.eq(i).attr("data-chk")==="on"){this._handleCheck(checkBoxes.eq(i))}}}if(this._v===true){vfs=checkbox.attr("data-chk")==="on"?true:false;sm=vfs?"selectRow":"deselectRow";for(i=0;i<this.grid._startRowIndex;i++){this.grid.element.igGridSelection(sm,i)}for(i=this.grid._startRowIndex+this.grid._virtualRowCount;i<this.grid._totalRowCount;i++){this.grid.element.igGridSelection(sm,i)}}this.grid.element.bind("iggridselectioninternalrowselectionchanged",this._rowSelectionChangedHandler)},_updateHeader:function(){var checkboxes=this._allCheckboxes(),header=this._headerCheckbox(),check=true,i;for(i=0;i<checkboxes.length;i++){if(checkboxes.eq(i).attr("data-chk")==="off"){check=false;break}}this._alterCheckbox(header,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 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+' "';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()},_rsRenderVirtualRecords:function(event,ui){var i=0,rs;this._cIdx=0;for(i;i<ui.rows.length;i++){rs=$(this._getRowSelectorCellMarkup());rs.prependTo(ui.rows.eq(i))}this._registerCellEvents();if(this.options.enableCheckBoxes===true){this._registerCheckBoxEvents()}},_rrn:function(event,args){var rs=this._allRowSelectorCells(),cb=this._allCheckboxes(),i=0,self=this,sri=this.grid._startRowIndex||0,trc=this.grid._totalRowCount,sc,sr;if(this.options.enableRowNumbering===true){for(i=0;i<rs.length;i++){rs.eq(i).removeClass(this.css.nodeHovered).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)});if(!this._ms){sc=this.grid._selectedCell?[this.grid._selectedCell]:[];sr=this.grid._selectedRow?[this.grid._selectedRow]:[]}else{sc=this.grid._selectedCells;sr=this.grid._selectedRows}for(i=0;i<sc.length;i++){if(sc[i].rowIndex>=sri&&sc[i].rowIndex<sri+trc){rs.eq(sc[i].rowIndex-sri).addClass(this.css.rowSelectorSelected)}}for(i=0;i<sr.length;i++){if(sr[i].index>=sri&&sr[i].index<sri+trc){rs.eq(sr[i].index-sri).addClass(this.css.rowSelectorSelected);if(this.options.enableCheckBoxes===true){this._alterCheckbox(cb.eq(sr[i].index-sri),true)}}}}},_cSelectionChanged:function(event,ui){var cells,cog=false;if(ui.owner.grid.id()!==this.grid.id()){cog=true}if(!this._ms){cells=[this.grid._selectedCell]}else{cells=ui.selectedCells}this._selectionChanged(this.grid._selectedRows,cells,cog)},_rSelectionChanged:function(event,ui){var rows,cog=false;if(ui.owner.grid.id()!==this.grid.id()){cog=true}if(!this._ms){rows=[this.grid._selectedRow]}else{rows=ui.selectedRows}if(this.grid.hasFixedColumns()&&this._getColumnFixingInstance().options.fixingDirection==="left"){if(ui.selectedFixedRows.length===0){rows=[this.grid._selectedFixedRow]}else{rows=ui.selectedFixedRows}this._selectionChanged(rows,this.grid._selectedFixedCells,cog)}else{this._selectionChanged(rows,this.grid._selectedCells,cog)}},_selectionChanged:function(selRows,selCells,selectedOtherGrid){var i,row,cell,rowInRange,rowSelector,checkbox,selRow,selCell;this._clearRowSelectorsSelection();if(selectedOtherGrid===true){return}if(this._checkBoxesShown===false&&this.options.showCheckBoxesOnFocus===true){this._animateCheckboxes(true)}for(i=0;i<selRows.length;i++){selRow=selRows[i];rowInRange=true;if(this._v===true){rowInRange=this.grid._startRowIndex<=selRow.index&&selRow.index<this.grid._startRowIndex+this.grid._virtualRowCount}row=selRow.element;if(row.length>0&&rowInRange){rowSelector=row.children("th");if(!rowSelector.hasClass(this.css.rowSelectorSelected)){rowSelector.addClass(this.css.rowSelectorSelected)}if(this.options.enableCheckBoxes===true){checkbox=rowSelector.find("span[name='chk']");this._alterCheckbox(checkbox,true)}}}for(i=0;i<selCells.length;i++){selCell=selCells[i];rowInRange=true;if(this._v===true){rowInRange=this.grid._startRowIndex<=selCell.rowIndex&&selCell.rowIndex<this.grid._startRowIndex+this.grid._virtualRowCount}cell=selCell.element;if(cell.length>0&&rowInRange){rowSelector=cell.siblings("th");if(!rowSelector.hasClass(this.css.rowSelectorSelected)){rowSelector.addClass(this.css.rowSelectorSelected)}}}this._updateHeader()},_clearSelection:function(evt,ui){if(ui.owner.id()===this.grid.id()){this._clearRowSelectorsSelection()}},_clearRowSelectorsSelection:function(){var checkboxes,cb;this._allRowSelectorCells().removeClass(this.css.rowSelectorSelected);checkboxes=this.options.enableCheckBoxes?this._allCheckboxes():[];for(i=0;i<checkboxes.length;i++){cb=checkboxes.eq(i);if(cb.attr("data-chk")==="on"){this._alterCheckbox(cb,false)}}if(checkboxes.length>0){this._updateHeader()}},_cellClick:function(event,ui){var args,target=$(event.target),fRow,rCell=target.closest("th"),rRow=rCell.parent(),rIdx=this._getVisibleRowIndex(rRow),rKey=rRow.attr("data-id");if(this.options.showCheckBoxesOnFocus===true&&this._checkBoxesShown===false){this._animateCheckboxes(true)}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)){fRow=rRow;rRow=this.grid.scrollContainer().find("tbody > tr").eq(rRow.index())}else{fRow=this.grid.fixedContainer().find("tbody > tr").eq(rRow.index())}}args={row:rRow,fixedRow:fRow,rowIndex:rIdx,rowKey:rKey,rowSelector:rCell,owner:this,grid:this.grid};this._triggerClickEvent(event,args)},_mouseHoverRow:function(event,ui){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){if(this._hovTR&&$(this._hovTR).attr("data-container")!=="true"){$("th."+this.css.rowSelector,this._hovTR).removeClass(this.css.nodeHovered)}if(tr&&$(tr).attr("data-container")!=="true"){$("th."+this.css.rowSelector,tr).addClass(this.css.nodeHovered)}this._hovTR=tr}},_mouseLeaveRow:function(event,ui){if(this._hovTR){$("th",this._hovTR).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},_newRowAdded:function(event,ui){this._unregisterCellEvents();this._registerCellEvents();if(this.options.enableCheckBoxes===true){this._registerCheckBoxEvents()}},_resetIndexing:function(){this._cIdx=0},_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.fixedContainer().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=this.grid.element.children("tbody").children("tr").children("th."+this.css.rowSelector);if(rowSelectors.length===0&&this.grid.hasFixedColumns()){rowSelectors=this.grid.fixedContainer().find("tbody > tr > 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.fixedContainer().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},_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.grid._renderRecord=this._gridRenderRecordHandler;columnFixingInstance._renderFixedRecord=$.proxy(this._rsRenderFixedRecord,this)}}else{if(countFixedCols<=1&&!this.grid.hasFixedDataSkippedColumns()){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}},_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._cellSelectionChangedHandler=$.proxy(this._cSelectionChanged,this);this._rowSelectionChangedHandler=$.proxy(this._rSelectionChanged,this);this._clearSelectionHandler=$.proxy(this._clearSelection,this);this._virtualDomBuiltHandler=$.proxy(this._rsRenderVirtualRecords,this);this._virtualRowsHandler=$.proxy(this._rrn,this);this._groupedColumnsChangingHandler=$.proxy(this._resetIndexing,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._newRowAdded,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("iggridselectioncellselectionchanged",this._cellSelectionChangedHandler);this.grid.element.bind("iggridselectionrowselectionchanged",this._rowSelectionChangedHandler);this.grid.element.bind("iggridselectioninternalrowselectionchanged",this._rowSelectionChangedHandler);this.grid.element.bind("iggridselectionselectioncleared",this._clearSelectionHandler);this.grid.element.bind("iggridgroupbygroupedcolumnschanging",this._groupedColumnsChangingHandler);this.grid.element.bind("iggridupdatingrowadded",this._newRowAddedHandler);this.grid.element.bind("iggridupdatinginternalrowadded",this._newRowAddedHandler);this.grid.element.bind("iggridloadondemandrowsrequested",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("iggridselectioncellselectionchanged",this._cellSelectionChangedHandler);this.grid.element.unbind("iggridselectionrowselectionchanged",this._rowSelectionChangedHandler);this.grid.element.unbind("iggridselectioninternalrowselectionchanged",this._rowSelectionChangedHandler);this.grid.element.unbind("iggridselectioncleared",this._clearSelectionHandler);this.grid.element.unbind("iggridgroupbygroupedcolumnschanging",this._groupedColumnsChangingHandler);this.grid.element.unbind("iggridupdatingrowadded",this._newRowAddedHandler);this.grid.element.unbind("iggridupdatinginternalrowadded",this._newRowAddedHandler);this.grid.element.unbind("iggridloadondemandrowsrequested",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()}});$.extend($.ui.igGridRowSelectors,{version:"14.1.20141.1020"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Selection (and Keyboard navigation) 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 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
 *	modernizr.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.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},events:{rowSelectionChanging:"rowSelectionChanging",rowSelectionChanged:"rowSelectionChanged",cellSelectionChanging:"cellSelectionChanging",cellSelectionChanged:"cellSelectionChanged",activeCellChanging:"activeCellChanging",activeCellChanged:"activeCellChanged",activeRowChanging:"activeRowChanging",activeRowChanged:"activeRowChanged"},_create:function(){this._isMouseDown=false;this._isDrag=false;this._registeredEvents=false;this.y_exclude_current=0;this.x_exclude_current=0},_setOption:function(key,value){$.Widget.prototype._setOption.apply(this,arguments);if(key==="mode"){throw new Error($.ig.Grid.locale.optionChangeNotSupported+" "+key)}},_dataRendering:function(e,args){var tbody;if(args.owner.id()!==this.grid.id()){return}tbody=this.grid.element.find("tbody");if(this._mouseDownHandler){tbody.unbind({mousedown:this._mouseDownHandler,mousemove:this._mouseMoveHandler,mouseup:this._mouseUpHandler,selectstart:this._selectStartHandler});if(this._touchEvents){tbody.unbind({touchstart:this._touchStartHandler,touchend:this._touchEndHandler,MSPointerDown:this._touchStartHandler,MSPointerMove:this._touchMoveHandler,MSPointerUp:this._touchEndHandler,pointerdown:this._touchStartHandler,pointermove:this._touchMoveHandler,pointerup:this._touchEndHandler});tbody[0].removeEventListener("touchmove",this._touchMoveHandler)}}if(this.options.persist&&!this.grid.options.primaryKey){this._createUidForData()}this._buildSelectionCache()},_hidingFinishing:function(){this._buildSelectionCache()},_dataRendered:function(){if(!this._registeredEvents){this._registerEvents();this._registeredEvents=true}else{this._registerTbodyEvents()}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")}}if(this._hc){this._hgrid=this.grid.element.closest(".ui-iggrid-root")}if(this._groupBy===undefined){this._groupBy=this.grid.container().find(".ui-iggrid-groupbyarea").length>0}this._refresh(true);if(!this._initialSelectionInitialized){if(this.options.selectedRowIndex!==undefined&&this.options.selectedRowIndex!==null&&this.options.selectedRowIndex>=0){if(this.options.selectedCellIndex===undefined){this.selectRow(this.options.selectedRowIndex)}else if(this.options.selectedCellIndex!==undefined&&this.options.selectedRowIndex!==null&&this.options.selectedCellIndex>=0){this.selectCell(this.options.selectedRowIndex,this.options.selectedCellIndex)}}this._initialSelectionInitialized=true}this.grid._startRowIndex=this.grid._startRowIndex||0;if(this.options.persist){this._reapplySelectionParams()}},_hidingFinished:function(){if(this.options.persist){this._reapplySelectionParams()}},_virtRowCountDetermined:function(count){this._buildSelectionCache()},_refresh:function(init){if(!init||!(this._firstCell&&this._firstCell.length!==0)){this._firstCell=this.grid.element.children("tbody").children("tr:visible:nth-child(1) td:nth-child(1)");if(!this._firstCell){this._firstRow=this.grid.element.children("tbody").children("tr:visible:nth-child(1)")}}if(!init||!(this._firstRow&&this._firstRow.length!==0)||!this._rowCount){this._firstRow=this.grid.element.children("tbody").children("tr:visible:nth-child(1)");if(this.grid.options.virtualization||this.grid.options.rowVirtualization){this._rowCount=this.grid.dataSource.dataView().length}else{this._rowCount=this.grid.element.find("tbody tr").length}this._length=this._firstRow?this._firstRow.children().length:0}this.x_exclude_current=this._calcExtraCells()},_registerTbodyEvents:function(){var tbody=this.grid.element.find("tbody"),opts=this.options;if(!this._mouseDownHandler){this._mouseDownHandler=$.proxy(this._mouseDown,this);this._selectStartHandler=$.proxy(this._selectStart,this);this._mouseMoveHandler=$.proxy(this._dragSelectChange,this);this._mouseUpHandler=$.proxy(this._selectInternal,this);if((typeof Modernizr==="object"&&Modernizr.touch===true||window.navigator.msPointerEnabled||window.navigator.pointerEnabled)&&opts.multipleSelection===true&&opts.mode==="cell"&&opts.touchDragSelect===true){this._touchStartHandler=$.proxy(this._touchStart,this);this._touchEndHandler=$.proxy(this._touchEnd,this);this._touchMoveHandler=$.proxy(this._touchMove,this);this._touchEvents=true}}else{tbody.unbind({mousedown:this._mouseDownHandler,mousemove:this._mouseMoveHandler,mouseup:this._mouseUpHandler,selectstart:this._selectStartHandler});if(this._touchEvents){tbody.unbind({touchstart:this._touchStartHandler,touchend:this._touchEndHandler,MSPointerDown:this._touchStartHandler,MSPointerMove:this._touchMoveHandler,MSPointerUp:this._touchEndHandler,pointerdown:this._touchStartHandler,pointermove:this._touchMoveHandler,pointerup:this._touchEndHandler});tbody[0].removeEventListener("touchmove",this._touchMoveHandler)}}tbody.bind({mousedown:this._mouseDownHandler,mousemove:this._mouseMoveHandler,mouseup:this._mouseUpHandler,selectstart:this._selectStartHandler});if(this._touchEvents){tbody.bind({touchstart:this._touchStartHandler,touchend:this._touchEndHandler,MSPointerDown:this._touchStartHandler,MSPointerMove:this._touchMoveHandler,MSPointerUp:this._touchEndHandler,pointerdown:this._touchStartHandler,pointermove:this._touchMoveHandler,pointerup:this._touchEndHandler});tbody[0].addEventListener("touchmove",this._touchMoveHandler)}},_registerFixedTbodyEvents:function(){var tbody=this.grid.fixedContainer().find("tbody"),opts=this.options;if(!this._mouseDownFixedHandler){this._mouseDownFixedHandler=$.proxy(this._mouseDown,this);this._selectStartFixedHandler=$.proxy(this._selectStart,this);this._mouseMoveFixedHandler=$.proxy(this._dragSelectChange,this);this._mouseUpFixedHandler=$.proxy(this._selectInternal,this);if((typeof Modernizr==="object"&&Modernizr.touch===true||window.navigator.msPointerEnabled||window.navigator.pointerEnabled)&&opts.multipleSelection===true&&opts.mode==="cell"&&opts.touchDragSelect===true){this._touchStartFixedHandler=$.proxy(this._touchStart,this);this._touchEndFixedHandler=$.proxy(this._touchEnd,this);this._touchMoveFixedHandler=$.proxy(this._touchMove,this);this._touchEvents=true}}else{tbody.unbind({mousedown:this._mouseDownFixedHandler,mousemove:this._mouseMoveFixedHandler,mouseup:this._mouseUpFixedHandler,selectstart:this._selectStartFixedHandler});if(this._touchEvents){tbody.unbind({touchstart:this._touchStartFixedHandler,touchend:this._touchEndFixedHandler,MSPointerDown:this._touchStartFixedHandler,MSPointerMove:this._touchMoveFixedHandler,MSPointerUp:this._touchEndFixedHandler,pointerdown:this._touchStartHandler,pointermove:this._touchMoveHandler,pointerup:this._touchEndHandler});tbody[0].removeEventListener("touchmove",this._touchMoveFixedHandler)}}tbody.bind({mousedown:this._mouseDownFixedHandler,mousemove:this._mouseMoveFixedHandler,mouseup:this._mouseUpFixedHandler,selectstart:this._selectStartFixedHandler});if(this._touchEvents){tbody.bind({touchstart:this._touchStartFixedHandler,touchend:this._touchEndFixedHandler,MSPointerDown:this._touchStartFixedHandler,MSPointerMove:this._touchMoveFixedHandler,MSPointerUp:this._touchEndFixedHandler,pointerdown:this._touchStartHandler,pointermove:this._touchMoveHandler,pointerup:this._touchEndHandler});tbody[0].addEventListener("touchmove",this._touchMoveFixedHandler)}},_registerEvents:function(){this._registerTbodyEvents();if(this._releaseMouseHandler===null||this._releaseMouseHandler===undefined){this._releaseMouseHandler=$.proxy(this._releaseMouse,this)}$(document).bind({mouseup:this._releaseMouseHandler});if(this.grid.options.virtualization){$("#"+this.grid.element[0].id+"_scrollContainer").bind({scroll:$.proxy(this._releaseMouse,this)})}else{$("#"+this.grid.element[0].id+"_scroll").bind({scroll:$.proxy(this._releaseMouse,this)})}this._keyDownHandler=$.proxy(this._navigate,this);this._focusHandler=$.proxy(this._navigateFocus,this);this._markMouseDownHandler=$.proxy(this._markMouseDown,this);if(this.grid.options.virtualization||this.grid.options.rowVirtualization){$("#"+this.grid.element[0].id+"_displayContainer_a").bind({keydown:this._keyDownHandler,focus:this._focusHandler})}else{this.grid.container().bind({keydown:this._keyDownHandler,focus:this._focusHandler})}if(this.options.multipleSelection===true){this.grid.element.addClass("ui-iggrid-canceltextselection")}},_unregisterEvents:function(){var tbody=this.grid.element.find("tbody");this.grid.element.unbind("mousedown",this._mouseDownHandler);this.grid.element.unbind("selectstart",this._selectStartHandler);this.grid.element.unbind("mousemove",this._mouseMoveHandler);this.grid.element.unbind("mouseup",this._mouseUpHandler);this.grid.container().unbind("keydown",this._keyDownHandler);this.grid.container().unbind("focus",this._focusHandler);this.grid.container().unbind("mousedown",this._markMouseDownHandler);this.grid.element.unbind("iggriduisoftdirty",this._uiDirtyHandler);this.grid.element.unbind("ighierarchicalgridrowexpanded",this._rowExpandedHandler);this.grid.element.unbind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler);this.grid.element.unbind("iggridvirtualrecordsrender",this._virtualRecordsRendererHandler);tbody.unbind({mousedown:this._mouseDownHandler,mousemove:this._mouseMoveHandler,mouseup:this._mouseUpHandler,selectstart:this._selectStartHandler});if(this._touchEvents){tbody.unbind({touchstart:this._touchStartHandler,touchend:this._touchEndHandler,MSPointerDown:this._touchStartHandler,MSPointerMove:this._touchMoveHandler,MSPointerUp:this._touchEndHandler,pointerdown:this._touchStartHandler,pointermove:this._touchMoveHandler,pointerup:this._touchEndHandler});tbody[0].removeEventListener("touchmove",this._touchMoveHandler)}if(this._releaseMouseHandler){$(document).unbind({mouseup:this._releaseMouseHandler});delete this._releaseMouseHandler}delete this._mouseDownHandler;delete this._selectStartHandler;delete this._mouseMoveHandler;delete this._mouseUpHandler;delete this._keyDownHandler;delete this._focusHandler;delete this._markMouseDownHandler;delete this._uiDirtyHandler;delete this._rowExpandedHandler;delete this._columnsCollectionModifiedHandler;delete this._virtualRecordsRendererHandler;delete this._touchEvents;this.grid.element.removeClass("ui-iggrid-canceltextselection")},_dragSelectChange:function(event){var selectedCells=[],startRowIndex,startColIndex,endRowIndex,endColIndex,outgrid,currentCell,tmp,noCancel=true,v=this.grid.options.virtualization||this.grid.options.rowVirtualization;if(event&&this._suspend){return}if(!this._prevX&&!this._prevY){this._prevX=event.clientX;this._prevY=event.clientY}if(Math.abs(this._prevX-event.clientX)<5&&Math.abs(this._prevY-event.clientY)<5){return}this._prevX=event.clientX;this._prevY=event.clientY;if(this.options.mouseDragSelect===false||this.options.multipleSelection===false||this.options.mode==="row"){return}if(this._isMouseDown===true){this._isDrag=true}else{return}if(this._isMouseDown!==true||this.options.mode!=="cell"){return}if(this._hc&&event&&event.target){outgrid=$(event.target).closest(".ui-iggrid-table");if(outgrid.length>0&&outgrid.attr("id")!==this.grid.element.attr("id")){event.stopPropagation();event.preventDefault();return}}currentCell=this._cellFromEvent(event);if(!currentCell){return}if(currentCell&&this.activeCell()&&currentCell.index===this.activeCell().index&&currentCell.rowIndex===this.activeCell().rowIndex){return}if(this._touchEvents&&!(window.navigator.msPointerEnabled||window.navigator.pointerEnabled)){event={originalEvent:event}}noCancel=this._trigger(this.events.cellSelectionChanging,event,{cell:currentCell,selectedCells:this.grid._selectedCells,owner:this,manual:false});if(noCancel){if(this.options.activation===true){this._activateCell(currentCell,event)}startRowIndex=this._firstDragCell.rowIndex;startColIndex=this._firstDragCell.index+this._firstDragCell.element.parent().children("[data-skip=true]").length;endRowIndex=currentCell.rowIndex;endColIndex=currentCell.index+this._firstDragCell.element.parent().children("[data-skip=true]").length;if(endRowIndex<startRowIndex){tmp=startRowIndex;startRowIndex=endRowIndex;endRowIndex=tmp}if(currentCell.isFixed===this._firstDragCell.isFixed&&endColIndex<startColIndex){tmp=startColIndex;startColIndex=endColIndex;endColIndex=tmp}if(currentCell.isFixed!==this._firstDragCell.isFixed&&(this._lastSelectedIndex===undefined||this._lastSelectedIndex===null)){if(currentCell.isFixed===true){this._lastSelectedIndex=this.grid._selectedCells[this.grid._selectedCells.length-1].index}else{this._lastSelectedIndex=endColIndex}}this.clearSelection(true);if(v){startRowIndex-=this.grid._startRowIndex;endRowIndex-=this.grid._startRowIndex}this._selectCell(startRowIndex,endRowIndex,startColIndex,endColIndex,currentCell.isFixed);this._currentCells=selectedCells;this._trigger(this.events.cellSelectionChanged,event,{cell:currentCell,selectedCells:this.grid._selectedCells,owner:this,manual:false})}},_touchStart:function(event){event.clientX=event.originalEvent.touches?event.originalEvent.touches[0].pageX:event.originalEvent.clientX;event.clientY=event.originalEvent.touches?event.originalEvent.touches[0].pageY:event.originalEvent.clientY;if(this._cellFromEvent(event).element.hasClass(this.css.selectedCell)){this.grid.element.css("-ms-touch-action","none");this._touchDragStart=true}},_touchEnd:function(event){if(this._touchDragStart){this._isMouseDown=false}this._touchDragStart=false;this._isDrag=false;this.grid.element.find("tbody").css("-ms-touch-action","auto")},_touchMove:function(event){if(!this._touchDragStart){return true}event.preventDefault();event.clientX=event.touches?event.touches[0].pageX:event.originalEvent.clientX;event.clientY=event.touches?event.touches[0].pageY:event.originalEvent.clientY;this._touchDragStart=true;this._isMouseDown=true;this._dragSelectChange(event)},_selectCell:function(startRowIndex,endRowIndex,startColIndex,endColIndex,isFixed){var i,j,cell;for(i=startRowIndex;i<=endRowIndex;i++){for(j=startColIndex;j<=endColIndex;j++){cell=$(this.grid.cellAt(j,i,isFixed)).addClass(this.css.selectedCell);this.grid._selectedCells.push(this._cellFromElement(cell,i+this.grid._startRowIndex,j,isFixed))}}},_applyCellStyle:function(data,col){var sc;if(!this._scc){return""}return this._isCellSelectedByKey(data[this.grid.options.primaryKey||"ig_pk"],col,this._scc)?this.css.selectedCell:""},_applyRowStyle:function(data,col,isFixed){var sr,pk=this.grid.options.primaryKey||"ig_pk",cache=isFixed?this._srcf:this._src;if(!cache){return""}if(this._procRecord&&this._procRecord.key===data[pk]){return this._procRecord.selected?this.css.selectedCell:""}this._procRecord={key:data[pk],selected:this._isRowSelectedByKey(data[pk],cache)};return this._procRecord.selected?this.css.selectedCell:""},_cellFromEvent:function(event){var target,$target,isFixed=false;if(this._touchEvents===true){$target=$(document.elementFromPoint(event.clientX,event.clientY))}else{$target=$(event.originalEvent.originalTarget||event.originalEvent.srcElement)}target=$target.is("td,th")?$target[0]:$target.closest("td,th")[0];if(this.grid.hasFixedColumns()){isFixed=$target.closest("div").attr("data-fixed-container")!==undefined}return this._cellFromElement(target,undefined,undefined,isFixed)},_cellFromElement:function(e,row,col,isFixed){var $target,parent,parentIndex,cellIndex,key=null,tmpIndex,res;if(isFixed===null||isFixed===undefined){isFixed=false}$target=$(e);parent=$target.parent();if(row===undefined||col===undefined){cellIndex=$target.index();parentIndex=parent.index();if(this.grid.options.virtualization||this.grid.options.rowVirtualization||this.grid.options.columnVirtualization){if(this.grid._startRowIndex>0){parentIndex+=this.grid._startRowIndex}if(this.grid._startColIndex>0){cellIndex+=this.grid._startColIndex}}}else{cellIndex=col;parentIndex=row}if(cellIndex===-1){return}if(cellIndex-this.x_exclude_current<0){tmpIndex=0}else if(cellIndex-this.x_exclude_current>=this.grid._visibleColumns().length){tmpIndex=this.grid._visibleColumns().length-1}else{tmpIndex=cellIndex-this.x_exclude_current}if(this._hc===true&&cellIndex-this.x_exclude_current<this.grid._visibleColumns().length||$target.siblings("th").length>0){tmpIndex--}if(tmpIndex>=0&&this.grid._visibleColumns().length>tmpIndex){key=this.grid._visibleColumns()[tmpIndex].key}if(this.y_exclude_current!==undefined){parentIndex-=this.y_exclude_current}if(this.x_exclude_current!==undefined){cellIndex-=this.x_exclude_current}if(this.grid.hasFixedColumns()&&$target.is("td")){res=this.grid._getColumnByTD($target);if(res!==null){key=res.column.key}}return{element:$target,row:parent,rowId:parent.data()?parent.data().id:null,index:cellIndex,rowIndex:parentIndex,columnKey:key,isFixed:isFixed}},_reapplySelectionParams:function(){var ac,ar,self=this,newElement,newRow,newFixedRow,ni,nuid;ac=this.grid._activeCell;ar=this.grid._activeRow;if(ac){newElement=this._cellFromElement(this.grid.cellById(ac.rowId,ac.columnKey));if(newElement&&newElement.element instanceof jQuery){this._activateCell(newElement)}}if(ar){newElement=this.grid.rowById(ar.id);if(newElement&&newElement.length>0){nidx=newElement.index();nuid=newElement.data()?newElement.data().id:null;newRow={element:newElement,index:nidx,id:nuid};if(this.grid.hasFixedColumns()){newFixedRow=$.extend({},newRow,{element:this.grid.fixedBodyContainer().find("tbody tr:nth-child("+(nidx+1)+")")})}this._activateRow(newRow,null,newFixedRow)}}setTimeout(function(){var i=0,element;if(self.grid._selectedRows){for(i=0;i<self.grid._selectedRows.length;i++){self.grid._selectedRows[i].element=self.grid.rowById(self.grid._selectedRows[i].id);if(self.grid._selectedRows[i].element&&self.grid._selectedRows[i].element.length>0){self.grid._selectedRows[i].index=self.grid._selectedRows[i].element.index()}}}if(self.grid._selectedRow){self.grid._selectedRow.element=self.grid.rowById(self.grid._selectedRow.id);if(self.grid._selectedRow.element&&self.grid._selectedRow.element.length>0){self.grid._selectedRow.index=self.grid._selectedRow.element.index()}}if(self.grid._selectedCells){for(i=0;i<self.grid._selectedCells.length;i++){self.grid._selectedCells[i].element=self.grid.cellById(self.grid._selectedCells[i].rowId,self.grid._selectedCells[i].columnKey);if(self.grid._selectedCells[i].element&&self.grid._selectedCells[i].element.length>0){self.grid._selectedCells[i].row=self.grid._selectedCells[i].element.parent("tr");self.grid._selectedCells[i].rowIndex=self.grid._selectedCells[i].row.index()}}}if(self.grid._selectedCell){self.grid._selectedCell.element=self.grid.cellById(self.grid._selectedCell.rowId,self.grid._selectedCell.columnKey);if(self.grid._selectedCell.element&&self.grid._selectedCell.element.length>0){self.grid._selectedCell.row=self.grid._selectedCell.element.parent("tr");self.grid._selectedCell.rowIndex=self.grid._selectedCell.row.index()}}if(self.grid._selectedFixedRows){for(i=0;i<self.grid._selectedFixedRows.length;i++){self.grid._selectedFixedRows[i].element=self.grid.rowById(self.grid._selectedFixedRows[i].id,true);if(self.grid._selectedFixedRows[i].element&&self.grid._selectedFixedRows[i].element.length>0){self.grid._selectedFixedRows[i].index=self.grid._selectedFixedRows[i].element.index()}}}if(self.grid._selectedFixedRow){self.grid._selectedFixedRow.element=self.grid.rowById(self.grid._selectedFixedRow.id,true);if(self.grid._selectedFixedRow.element&&self.grid._selectedFixedRow.element.length>0){self.grid._selectedFixedRow.index=self.grid._selectedFixedRow.element.index()}}},0);this._removeSelectionCache()},_mouseDown:function(event){var v=this.grid.options.virtualization||this.grid.options.rowVirtualization||this.grid.options.columnVirtualization,outgrid,ncv=this.grid.options.virtualizationMode!=="continuous";if(event&&this._suspend){return}if(event.target&&$(event.target).hasClass("ui-iggrid-scrolldiv")){return}if(event&&event.which===0){event.which=1}if(event&&event.which!==1){return}if(this._hc&&event&&event.target){outgrid=$(event.target).closest(".ui-iggrid-table");if(outgrid.length>0&&outgrid.attr("id")!==this.grid.element.attr("id")){return}}if(event.target&&$(event.target).closest("td").attr("data-skip")==="true"){event.stopPropagation();event.preventDefault();$(event.target).trigger("iggridselectionmousedown");return}if(event.which===2){return}this._isMouseDown=true;if(this.options.multipleSelection===false&&v&&ncv){$("#"+this.grid.element[0].id+"_displayContainer_a").focus();if((this.grid.options.virtualization||this.grid.options.rowVirtualization)&&this.grid.options.virtualizationMode==="continuous"){event.preventDefault()}}if(this.options.mouseDragSelect===false||this.options.multipleSelection===false){return}this._mouseLocation={clientX:event.clientX,clientY:event.clientY};this._firstDragCell=this._cellFromEvent(event);this._lastSelectedIndex=null;if(!event.ctrlKey&&!event.shiftKey&&this.options.multipleSelection!==true){this.clearSelection(true)}this._isInternalFocus=true;if(this.options.multipleSelection===true&&v&&ncv){$("#"+this.grid.element[0].id+"_displayContainer_a").focus()}if(!$(event.target).hasClass("ui-iggrid-expandbutton")&&!$(event.target).hasClass("ui-iggrid-expandcolumn")&&!$(event.target).hasClass("ui-iggrid-expandbuttongb")){if(v){event.stopPropagation();event.preventDefault()}$(event.target).trigger("iggridselectionmousedown")}},_markMouseDown:function(event){this._isMouseDown=true},_selectStart:function(event){if(event&&this._suspend){return}if(this.options.mouseDragSelect===false||this.options.multipleSelection===false){return false}event.stopPropagation();event.preventDefault()},_releaseMouse:function(){this._isMouseDown=false;this._isDrag=false},_selectInternal:function(event,row,col,isFixed){var target,parent,$target,gridCell,gridRow,i,noCancel=true,isInternal=false,vindex,isRs,outgrid,contSelection,fixedGridRow,isRowSelection=false,parentIndex,v,excludeTmp,hasFixedColumns=this.grid.hasFixedColumns(),clickedOnFixedContainer=false,selectedRowIndex;v=this.grid.options.virtualization||this.grid.options.columnVirtualization||this.grid.options.rowVirtualization;if(!this._isMouseDown&&event){return}if(event&&event.which===0){event.which=1}if(event&&event.which!==1){return}if(event!==null&&event.target&&($(event.target).hasClass("ui-iggrid-childarea")||$(event.target).parent().hasClass("ui-iggrid-childarea")||$(event.target).hasClass("ui-widget-header"))){return}if(event===null){isInternal=true;excludeTmp=this.y_exclude_current;if(this._isContinuous||isInternal){excludeTmp=0}vindex=row-this.grid._startRowIndex<0?0:row-this.grid._startRowIndex+excludeTmp;event={originalEvent:{}};if(col===null||col===undefined){isRowSelection=true;if(v){event.originalEvent.originalTarget=this.grid.rowAt(vindex)}else{event.originalEvent.originalTarget=this.grid.rowAt(row-excludeTmp)}}else{if(v){event.originalEvent.originalTarget=this.grid.cellAt(col,vindex,isFixed)}else{event.originalEvent.originalTarget=this.grid.cellAt(col+this.x_exclude_current,row-excludeTmp,isFixed)}}event.originalEvent.srcElement=event.originalEvent.originalTarget}target=event.originalEvent.originalTarget||event.originalEvent.srcElement;$target=$(target);if(hasFixedColumns){clickedOnFixedContainer=$target.closest("div").attr("data-fixed-container")!==undefined}isRs=$target.closest("th.ui-iggrid-rowselector-class").length===1;if(event&&$target.is("span")&&($target.attr("data-chk")!==undefined||$target.parent().attr("data-chk")!==undefined)){this._mouseCtrlSelect=true;return}if(this._hc){outgrid=$target.closest(".ui-iggrid-table");if(outgrid.length>0&&outgrid.attr("id")!==this.grid.element.attr("id")){if(event&&!isInternal){event.preventDefault();this._isMouseDown=false;this._isDrag=false}return}if(this._hgrid&&this._hgrid.data("data-selectgrid")!==this.grid.element.attr("id")){this.clearSelectionAllOthers(false,true);this._hgrid.data("data-selectgrid",this.grid.element.attr("id"))}}if(this._hc&&this._hdirty){this.y_exclude_current=this._excludeRowsLt($target.closest("tr"))}else if(!this._hc){this.y_exclude_current=0}if(this.x_exclude_current===undefined){this.x_exclude_current=this._calcExtraCells()}if(event&&this._suspend){return}if(event&&event.which===2){return}if(this._isDrag===true&&event!==null){this._isDrag=false;return}parent=$target.closest("tr");if($target.closest("th").length>0&&isRs===false){return}if($target.closest("td").attr("data-skip")==="true"){return}if(event.ctrlKey){this._isContinuous=false;this._mouseCtrlSelect=true}if(this.options.multipleCellSelectOnClick===true&&this.options.mode==="cell"&&this.activeCell()){this._isContinuous=false;this._mouseCtrlSelect=true;contSelection=true}if(this.options.mode==="cell"&&isRowSelection===false){if(isRs===true){if(isInternal===true){target=$target.is("th")?$target[0]:$target.closest("th")[0]}else{target=$target.is("th")?$target.next()[0]:$target.closest("th").next()[0]}}else{target=$target.is("td")?$target[0]:$target.closest("td")[0]}gridCell=this._cellFromElement(target,undefined,undefined,clickedOnFixedContainer,isFixed);if(this.options.activation===true&&this._rangeSelect!==true&&this._singleShiftSelect!==true&&this._ctrlSelect!==true){if(this._mouseCtrlSelect!==true){this._activateCell(gridCell,event)}else{this._activateCell(gridCell,event)}}}else{if(isInternal){parent=$(target)}parentIndex=parent.index();selectedRowIndex=parentIndex+this.grid._startRowIndex-this.y_exclude_current;if(clickedOnFixedContainer){parent=this.grid.scrollContainer().find("tbody tr:nth-child("+(selectedRowIndex+1)+")")}gridRow={element:parent,index:selectedRowIndex,id:parent.data()?parent.data().id:null};if(hasFixedColumns){fixedGridRow={element:this.grid.fixedBodyContainer().find("tbody tr:nth-child("+(selectedRowIndex+1)+")"),index:selectedRowIndex,id:parent.data()?parent.data().id:null}}if(gridRow.element.attr("data-container")){return}if(this.options.activation===true&&this._rangeSelect!==true&&this._singleShiftSelect!==true&&this._ctrlSelect!==true){if(this._mouseCtrlSelect!==true){this._activateRow(gridRow,event,fixedGridRow)}else if(this.activeRow()&&gridRow.index!==this.activeRow().index){this._activateRow(gridRow,event,fixedGridRow)}}}if(isInternal===false&&this.options.mode==="cell"||isInternal===true&&isRowSelection===false){if(isInternal===false&&!event.shiftKey||this._ctrlSelect===true){noCancel=this._trigger(this.events.cellSelectionChanging,event,{cell:gridCell,selectedCells:this.grid._selectedCells,owner:this,manual:isInternal})}if(noCancel&&gridCell&&gridCell.element&&!gridCell.element.hasClass("ui-iggrid-expandcolumn")&&!gridCell.element.hasClass("ui-iggrid-rowselector-class")){if(this.options.multipleSelection!==true){if(this.grid._selectedCell!==null){if(v){$(this.grid.cellAt(this.grid._selectedCell.index,this.grid._selectedCell.rowIndex-this.grid._startRowIndex,isFixed)).removeClass(this.css.selectedCell)}else{this.grid._selectedCell.element.removeClass(this.css.selectedCell)}}if(this.grid._selectedRow!==null&&this.grid._selectedRow!==undefined){if(v){this.grid.rowAt(this.grid._selectedRow.index-this.grid._startRowIndex).children().removeClass(this.css.selectedCell)}else{this.grid._selectedRow.element.children().removeClass(this.css.selectedCell)}}if(this.grid._selectedFixedRow!==null&&this.grid._selectedFixedRow!==undefined){this.grid._selectedFixedRow.element.children().removeClass(this.css.selectedCell)}}else{if(event.ctrlKey||this._ctrlSelect===true||contSelection===true){if(gridCell.element.hasClass(this.css.selectedCell)){for(i=0;i<this.grid._selectedCells.length;i++){if(this.grid._selectedCells[i].index===gridCell.index&&this.grid._selectedCells[i].rowIndex===gridCell.rowIndex){$.ig.removeFromArray(this.grid._selectedCells,i)}}}else{this.grid._selectedCells.push(gridCell)}}else if(!event.shiftKey){if(!isInternal){this.clearSelection(true)}if(!this._isCellSelected(gridCell.rowIndex,gridCell.index)){this.grid._selectedCells.push(gridCell)}if(!isInternal){this._realActiveCell=gridCell}}else{this._shiftCellSelection(gridCell);return}}if((event.ctrlKey||this._ctrlSelect===true||contSelection===true)&&gridCell.element.hasClass(this.css.selectedCell)){gridCell.element.removeClass(this.css.selectedCell)}else{gridCell.element.addClass(this.css.selectedCell);this.grid._selectedCell=gridCell}if(isInternal===false||this._ctrlSelect===true){this._trigger(this.events.cellSelectionChanged,event,{cell:gridCell,selectedCells:this.grid._selectedCells,owner:this,manual:isInternal})}}}else if(isInternal===false&&this.options.mode==="row"||isInternal===true&&isRowSelection===true){if(isInternal===false&&!event.shiftKey||this._ctrlSelect===true){noCancel=this._trigger(this.events.rowSelectionChanging,event,{row:gridRow,selectedRows:this.grid._selectedRows,owner:this,manual:isInternal})}if(noCancel){if(this.options.multipleSelection!==true){if(this.grid._selectedRow!==null){if(v){$(this.grid.rowAt(this.grid._selectedRow.index-this.grid._startRowIndex)).children().removeClass(this.css.selectedCell)}else{$(this.grid._selectedRow.element).children().removeClass(this.css.selectedCell)}}if(this.grid._selectedFixedRow!==null&&this.grid._selectedFixedRow!==undefined){$(this.grid._selectedFixedRow.element).children().removeClass(this.css.selectedCell)}if(this.grid._selectedCell!==null&&this.grid._selectedCell!==undefined){if(v){$(this.grid.cellAt(this.grid._selectedCell.index,this.grid._selectedCell.rowIndex-this.grid._startRowIndex,isFixed)).removeClass(this.css.selectedCell)}else{this.grid._selectedCell.element.removeClass(this.css.selectedCell)}}if(this.grid._selectedFixedCell!==null&&this.grid._selectedFixedCell!==undefined){this.grid._selectedFixedCell.element.removeClass(this.css.selectedFixedCell)}}else{if(event.ctrlKey||this._ctrlSelect===true){if(gridRow.element.children().hasClass(this.css.selectedCell)){for(i=0;i<this.grid._selectedRows.length;i++){if(this.grid._selectedRows[i].index===gridRow.index){$.ig.removeFromArray(this.grid._selectedRows,i);if(hasFixedColumns&&this.grid._selectedFixedRows[i]){$.ig.removeFromArray(this.grid._selectedFixedRows,i)}}}}else{this.grid._selectedRows.push(gridRow);if(hasFixedColumns){this.grid._selectedFixedRows.push(fixedGridRow)}}}else if(!event.shiftKey){if(!isInternal){this.clearSelection(true)}this.grid._selectedRows.push(gridRow);if(hasFixedColumns){this.grid._selectedFixedRows.push(fixedGridRow)}if(!isInternal){this._realActiveRow=gridRow}}else{this._shiftRowSelection(gridRow);return}}if((event.ctrlKey||this._ctrlSelect===true)&&gridRow.element.children().hasClass(this.css.selectedCell)){gridRow.element.removeClass(this.css.selectedRow);gridRow.element.children().removeClass(this.css.selectedCell);if(hasFixedColumns&&fixedGridRow){fixedGridRow.element.removeClass(this.css.selectedRow);fixedGridRow.element.children().removeClass(this.css.selectedCell)}}else if(parent.is("tr")){parent.children(":not(.ui-iggrid-nongrouprowemptycell)").addClass(this.css.selectedCell);if(hasFixedColumns){fixedGridRow.element.children(":not(.ui-iggrid-nongrouprowemptycell)").addClass(this.css.selectedCell)}}this.grid._selectedRow=gridRow;if(hasFixedColumns){this.grid._selectedFixedRow=fixedGridRow}if(isInternal===false||this._ctrlSelect===true){this._trigger(this.events.rowSelectionChanged,event,{row:gridRow,selectedRows:this.grid._selectedRows,selectedFixedRows:this.grid._selectedFixedRows,owner:this,manual:isInternal})}else if(isInternal===true&&!this._rangeSelect){this._trigger("internalrowselectionchanged",event,{row:gridRow,selectedRows:this.grid._selectedRows,selectedFixedRows:this.grid._selectedFixedRows,owner:this})}}}this._mouseCtrlSelect=false},_shiftRowSelection:function(row,noClear,singleRowNavigate,currentRow,event){var i,startIndex,endIndex,noCancel=true;
this._isContinuous=true;if(this.grid._selectedRows.length===0){this._singleShiftSelect=true;noCancel=this._trigger(this.events.rowSelectionChanging,null,{row:row,startIndex:row.index,endIndex:row.index,selectedRows:this.grid._selectedRows,owner:this,manual:false,selectedFixedRows:this.grid._selectedFixedRows});if(noCancel){this.selectRow(row.index);this._trigger(this.events.rowSelectionChanged,null,{row:row,selectedRows:this.grid._selectedRows,owner:this,manual:false,selectedFixedRows:this.grid._selectedFixedRows})}this._singleShiftSelect=false;return}endIndex=row.index;startIndex=this.grid._selectedRows[0].index;noCancel=this._trigger(this.events.rowSelectionChanging,null,{row:row,startIndex:startIndex,endIndex:endIndex,selectedRows:this.grid._selectedRows,owner:this,manual:false,selectedFixedRows:this.grid._selectedFixedRows});if(noCancel){this._rangeSelect=true;if(!singleRowNavigate){if(this.grid._selectedRows.length>0&&this.grid._selectedRows[0].index<row.index){if(noClear!==false){this.clearSelection(true)}for(i=startIndex;i<=endIndex;i++){this.selectRow(i)}}if(this.grid._selectedRows.length>0&&this.grid._selectedRows[0].index>row.index){if(noClear!==false){this.clearSelection(true)}for(i=startIndex;i>=endIndex;i--){this.selectRow(i)}}}else{if(event){this._activateRow(row,event)}if(this._isRowSelected(this.activeRow().index)){this.deselectRow(currentRow.index)}else{this.selectRow(this.activeRow().index)}this._singleShiftSelect=false}this._rangeSelect=false;this._trigger(this.events.rowSelectionChanged,null,{row:row,selectedRows:this.grid._selectedRows,owner:this,manual:false,selectedFixedRows:this.grid._selectedFixedRows})}},_shiftCellSelection:function(cell,noClear,singleCellNavigate,currentCell,event){var firstCell,firstRowIndex,lastRowIndex,firstCellIndex,lastCellIndex,i,j,noCancel=true,lastSelRow=0,firstSelRow=Number.MAX_VALUE,lastSelCol=0,firstSelCol=Number.MAX_VALUE;this._isContinuous=true;if(this.grid._selectedCells.length===0){this._singleShiftSelect=true;noCancel=this._trigger(this.events.cellSelectionChanging,null,{cell:cell,firstRowIndex:cell.rowIndex,lastRowIndex:cell.rowIndex,firstColumnIndex:cell.index,lastColumnIndex:cell.index,selectedCells:this.grid._selectedCells,owner:this,manual:false});if(noCancel){this.selectCell(cell.rowIndex,cell.index);this._trigger(this.events.cellSelectionChanged,null,{cell:cell,selectedCells:this.grid._selectedCells,owner:this,manual:false})}this._singleShiftSelect=false;return}firstCell=this.grid._selectedCells[0];firstRowIndex=firstCell.rowIndex;lastRowIndex=cell.rowIndex;firstCellIndex=firstCell.index;lastCellIndex=cell.index;noCancel=this._trigger(this.events.cellSelectionChanging,null,{cell:cell,firstRowIndex:firstRowIndex,lastRowIndex:lastRowIndex,firstColumnIndex:firstCellIndex,lastColumnIndex:lastCellIndex,selectedCells:this.grid._selectedCells,owner:this,manual:false});if(noCancel){if(noClear!==false){this.clearSelection(true)}this._rangeSelect=true;if(!singleCellNavigate){if(firstCell.isFixed===cell.isFixed){if(firstRowIndex<=lastRowIndex){for(i=firstRowIndex;i<=lastRowIndex;i++){if(firstCellIndex<=lastCellIndex){for(j=firstCellIndex;j<=lastCellIndex;j++){this.selectCell(i,j,cell.isFixed)}}else{for(j=firstCellIndex;j>=lastCellIndex;j--){this.selectCell(i,j,cell.isFixed)}}}}else{for(i=firstRowIndex;i>=lastRowIndex;i--){if(firstCellIndex<=lastCellIndex){for(j=firstCellIndex;j<=lastCellIndex;j++){this.selectCell(i,j,cell.isFixed)}}else{for(j=firstCellIndex;j>=lastCellIndex;j--){this.selectCell(i,j,cell.isFixed)}}}}}}else{this._singleShiftSelect=true;if(event){this._activateCell(cell,event)}if(this._isCellSelected(this.activeCell().rowIndex,this.activeCell().index)){this.deselectCell(currentCell.rowIndex,currentCell.index);for(i=0;i<this.grid._selectedCells.length;i++){if(this.grid._selectedCells[i].rowIndex>lastSelRow){lastSelRow=this.grid._selectedCells[i].rowIndex}if(this.grid._selectedCells[i].rowIndex<firstSelRow){firstSelRow=this.grid._selectedCells[i].rowIndex}if(this.grid._selectedCells[i].index>lastSelCol){lastSelCol=this.grid._selectedCells[i].index}if(this.grid._selectedCells[i].index<firstSelCol){firstSelCol=this.grid._selectedCells[i].index}}if(Math.abs(firstSelRow-lastSelRow)>0&&Math.abs(this.activeCell().index-currentCell.index)>0){if(firstSelRow<=lastSelRow){for(i=firstSelRow;i<=lastSelRow;i++){this.deselectCell(i,currentCell.index)}}else{for(i=firstSelRow;i>=lastSelRow;i--){this.deselectCell(i,currentCell.index)}}}else if(Math.abs(firstSelCol-lastSelCol)>0&&Math.abs(this.activeCell().rowIndex-currentCell.rowIndex)>0){if(firstSelCol<=lastSelCol){for(i=firstSelCol;i<=lastSelCol;i++){this.deselectCell(currentCell.rowIndex,i)}}else{for(i=firstSelCol;i>=lastSelCol;i--){this.deselectCell(currentCell.rowIndex,i)}}}}else{this.selectCell(this.activeCell().rowIndex,this.activeCell().index);for(i=0;i<this.grid._selectedCells.length;i++){if(this.grid._selectedCells[i].rowIndex>lastSelRow){lastSelRow=this.grid._selectedCells[i].rowIndex}if(this.grid._selectedCells[i].rowIndex<firstSelRow){firstSelRow=this.grid._selectedCells[i].rowIndex}if(this.grid._selectedCells[i].index>lastSelCol){lastSelCol=this.grid._selectedCells[i].index}if(this.grid._selectedCells[i].index<firstSelCol){firstSelCol=this.grid._selectedCells[i].index}}if(Math.abs(firstSelRow-lastSelRow)>0&&Math.abs(this.activeCell().index-currentCell.index)>0){if(firstSelRow<=lastSelRow){for(i=firstSelRow;i<=lastSelRow;i++){this.selectCell(i,this.activeCell().index)}}else{for(i=firstSelRow;i>=lastSelRow;i--){this.selectCell(i,this.activeCell().index)}}}else if(Math.abs(firstSelCol-lastSelCol)>0&&Math.abs(this.activeCell().rowIndex-currentCell.rowIndex)>0){if(firstSelCol<=lastSelCol){for(i=firstSelCol;i<=lastSelCol;i++){this.selectCell(this.activeCell().rowIndex,i)}}else{for(i=firstSelCol;i>=lastSelCol;i--){this.selectCell(this.activeCell().rowIndex,i)}}}}this._singleShiftSelect=false}this._rangeSelect=false;this._trigger(this.events.cellSelectionChanged,null,{cell:cell,selectedCells:this.grid._selectedCells,owner:this,manual:false})}},_rowExpanded:function(event,args){this._hdirty=true},_navigate:function(event){var vcontainer=$("#"+this.grid.element[0].id+"_displayContainer_a"),active,shouldNavigate=false;if(event&&this._suspend){return}if(this._isMouseDown===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}if(this._hc){active=this.options.mode==="row"?this.activeRow():this.activeCell();if(active!==undefined&&active!==null){active=this.options.mode==="row"?active.element:active.element.closest("tr");this.y_exclude_current=this._excludeRowsLt(active)}}else{this.y_exclude_current=0}if(this.x_exclude_current===undefined){this.x_exclude_current=this._calcExtraCells()}if(this.grid.options.virtualization){if($.ig.util.isIE&&document.activeElement&&document.activeElement.id!==this.grid.id()&&!$(document.activeElement).is("td")&&$(document.activeElement).closest("table")[0].id!==this.grid.id()){return}if(!$.ig.util.isIE&&event.target.id!==vcontainer.attr("id")){return}}else{if($.ig.util.isIE&&document.activeElement&&document.activeElement.id!==this.grid.id()&&!$(document.activeElement).is("td")&&$(document.activeElement).closest("table")[0].id!==this.grid.id()){return}if(!$.ig.util.isIE&&event.target.id!==this.grid.container().attr("id")){return}}if(this.options.activation===true){if(this.options.mode==="cell"){if(this.options.multipleSelection===true){if(this.activeCell()===null||this.activeCell()===undefined){this.selectCell(0,0)}else{if(this.options.skipChildren===false&&this._hc&&this._isMovingUpDown(event)){shouldNavigate=this._activateNextGrid(event);if(!shouldNavigate){this._navigateCell(event,false)}}else{this._navigateCell(event,false)}}}else{if(this.activeCell()===null&&this.grid._selectedCell===null||this.activeCell()===undefined&&this.grid._selectedCell===undefined){this.selectCell(0,0)}else{if(this.options.skipChildren===false&&this._hc&&this._isMovingUpDown(event)){shouldNavigate=this._activateNextGrid(event);if(!shouldNavigate){this._navigateCell(event,true)}}else{this._navigateCell(event,true)}}}}else{if(this.options.multipleSelection===true){if(this.activeRow()===null||this.activeRow()===undefined){this.selectRow(0)}else{if(this.options.skipChildren===false&&this._hc&&this._isMovingUpDown(event)){shouldNavigate=this._activateNextGrid(event);if(!shouldNavigate){this._navigateRow(event,false)}}else{this._navigateRow(event,false)}}}else{if(this.activeRow()===null&&this.grid._selectedRow===null||this.activeRow()===undefined&&this.grid._selectedRow===undefined){this.selectRow(0)}else{if(this.options.skipChildren===false&&this._hc&&this._isMovingUpDown(event)){shouldNavigate=this._activateNextGrid(event);if(!shouldNavigate){this._navigateRow(event,true)}}else{this._navigateRow(event,true)}}}}}},_isMovingUpDown:function(event){if(event.keyCode===$.ui.keyCode.UP||event.keyCode===$.ui.keyCode.DOWN){return true}return false},_navigateFocus:function(event){if($.ig.util.isFF&&event.originalEvent&&$(event.originalEvent.explicitOriginalTarget).is("th")){return}if(event.which!==1){$("#"+this.grid.element[0].id+"_displayContainer_a").unbind("focus",this._focusHandler);$("#"+this.grid.element[0].id+"_displayContainer_a").focus();$("#"+this.grid.element[0].id+"_displayContainer_a").bind({focus:this._focusHandler});event.stopPropagation();return}this._navigate(event)},_navigateCell:function(event,select){var nextX,nextY,x,y,currentCell=this.activeCell(),rowCount,newCell,length,newCellObject,noCancel=true,fixingDirection,sri=this.grid._startRowIndex,sci=this.grid._startColIndex,$newCell,hgrid,ptr,indexTmp=0,cKey,parent,cb,isFixedCell=false,v=this.grid.options.virtualization||this.grid.options.rowVirtualization,c,ret=false,rs,hasFixedColumns=this.grid.hasFixedColumns();c=v&&this.grid.options.virtualizationMode==="continuous";if(currentCell===null){return}if(hasFixedColumns){if(currentCell.element.closest("div").attr("data-fixed-container")!==undefined){isFixedCell=true;fixingDirection=currentCell.element.closest("div[data-fixing-direction]").attr("data-fixing-direction")}else{fixingDirection=this.grid.container().find("div[data-fixing-direction]").eq(0).attr("data-fixing-direction")}}if(sri===undefined||sri===null){sri=0}if(sci===undefined||sri===null){sci=0}if(v){x=currentCell.index-sci;y=currentCell.rowIndex-sri}else{x=currentCell.index;y=currentCell.rowIndex}y+=this.y_exclude_current;x+=this.x_exclude_current;if(!this._rowCount||!this._length){this._refresh()}rowCount=this._rowCount;length=this._length;if(hasFixedColumns){length-=this.grid._fixedColumns.length}if(this.x_exclude_current>0){length+=this.x_exclude_current}if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){nextX=x;nextY=y;if(event.ctrlKey&&this._isCellSelected(y+sri-this.y_exclude_current,x+sci-this.x_exclude_current)){noCancel=this._trigger(this.events.cellSelectionChanging,event,{cell:currentCell,selectedCells:this.grid._selectedCells,owner:this,manual:false});if(noCancel){this.deselectCell(y+sri-this.y_exclude_current,x+sci-this.x_exclude_current);this._trigger(this.events.cellSelectionChanged,event,{cell:currentCell,selectedCells:this.grid._selectedCells,owner:this,manual:false})}}else if(event.ctrlKey||!this._isCellSelected(y-this.y_exclude_current,x)){this._ctrlSelect=true;this._selectInternal(null,y-this.y_exclude_current,x-this.x_exclude_current);this._ctrlSelect=false}}else if(event.keyCode===$.ui.keyCode.DOWN){nextX=x;nextY=y+1;if(this._realActiveCell!==null&&this._realActiveCell!==undefined&&this._isContinuous&&this.options.multipleSelection===true&&this.grid._selectedCells.length>1&&!event.shiftKey&&!event.ctrlKey){nextX=this._realActiveCell.index-sci+this.x_exclude_current;nextY=this._realActiveCell.rowIndex+1-sri+this.y_exclude_current}if(nextY-this.y_exclude_current>rowCount-1-sri&&this.options.wrapAround===true&&!v){nextY=this.y_exclude_current}else if(nextY-this.y_exclude_current>rowCount-1-sri&&this.options.wrapAround===false){if(this._hc&&!this.options.skipChildren){this._activateNextGrid(null,true)}return}}else if(event.keyCode===$.ui.keyCode.UP){nextX=x;nextY=y-1;if(this._realActiveCell!==null&&this._realActiveCell!==undefined&&this._isContinuous&&this.options.multipleSelection===true&&this.grid._selectedCells.length>1&&!event.shiftKey&&!event.ctrlKey){nextX=this._realActiveCell.index-sci+this.x_exclude_current;nextY=this._realActiveCell.rowIndex-1-sri+this.y_exclude_current}if(!v){if(nextY-this.y_exclude_current<0&&this.options.wrapAround===true){nextY=rowCount-1}else if(nextY-this.y_exclude_current<0&&this.options.wrapAround===false){if(this._hc&&!this.options.skipChildren){this._activateNextGrid(null,false)}return}}}else if(event.keyCode===$.ui.keyCode.LEFT){nextX=x-1;nextY=y;if(hasFixedColumns){if(isFixedCell){if(nextX<0){isFixedCell=false;if(fixingDirection==="left"){nextX=length-1;nextY-=1}else{nextX=length-1}}}else{if(nextX<0){isFixedCell=true;nextX=this.grid._fixedColumns.length-1;if(fixingDirection==="right"){nextY-=1;if(nextY<0){nextY=rowCount-1}}}}}if(nextX-this.x_exclude_current<0){if(this._hc&&!this.options.skipChildren){ret=this._activateNextGrid(null,false,true)}if(ret){return}nextX=length-1;nextY=y-1}if(this._realActiveCell!==null&&this._realActiveCell!==undefined&&this.options.multipleSelection===true&&this.grid._selectedCells.length>1&&!event.shiftKey&&!event.ctrlKey){nextX=this._realActiveCell.index-1-sci+this.x_exclude_current;nextY=this._realActiveCell.rowIndex-sri+this.y_exclude_current}if(!v){if(nextY<0&&this.options.wrapAround===true){nextX=length-1;nextY=rowCount-1}else if(nextY<0&&this.options.wrapAround===false){if(this._hc&&!this.options.skipChildren){this._activateNextGrid(null,false)}return}}}else if(event.keyCode===$.ui.keyCode.RIGHT){nextX=x+1;nextY=y;if(hasFixedColumns){if(isFixedCell){if(nextX>=this.grid._fixedColumns.length){isFixedCell=false;if(fixingDirection==="right"){nextY+=1}nextX=0}}else{if(nextX>=length){if(fixingDirection==="left"){nextY+=1}isFixedCell=true;nextX=0}}}if(nextX>=length){if(this._hc&&!this.options.skipChildren){ret=this._activateNextGrid(null,true,true)}if(ret){return}nextX=0;nextY=y+1}if(this._realActiveCell!==null&&this._realActiveCell!==undefined&&this.options.multipleSelection===true&&this.grid._selectedCells.length>1&&!event.shiftKey&&!event.ctrlKey){nextX=this._realActiveCell.index+1-sci+this.x_exclude_current;nextY=this._realActiveCell.rowIndex-sri+this.y_exclude_current}if(!v){if(nextY>=rowCount+this.y_exclude_current&&this.options.wrapAround===true){nextX=0;nextY=0}else if(nextY>=rowCount+this.y_exclude_current&&this.options.wrapAround===false){if(this._hc&&!this.options.skipChildren){this._activateNextGrid(null,true)}return}}}else{return}if(v&&!c&&nextY>=this.grid._virtualRowCount){this._setScrollTop(this.grid.element.parent(),newCell,nextY>y?"down":"up",nextY-this.y_exclude_current);nextY=this.grid._virtualRowCount-1}else if(v&&!c&&nextY<0&&sri>0){this._setScrollTop(this.grid.element.parent(),newCell,"up",nextY-this.y_exclude_current);nextY=0}else if(v&&!c&&nextY<0){return}if(this.x_exclude_current>0&&this.grid.rowAt(nextY).cells.length<length){nextX=this.grid.rowAt(nextY).cells.length-1}newCell=this.grid.cellAt(nextX===0?this.x_exclude_current:nextX,nextY-this.y_exclude_current,isFixedCell);if(newCell===undefined&&(event.keyCode===$.ui.keyCode.DOWN||event.keyCode===$.ui.keyCode.UP)){if(event.keyCode===$.ui.keyCode.DOWN){nextY++}else if(event.keyCode===$.ui.keyCode.UP){nextY--}newCell=this.grid.cellAt(nextX,nextY,isFixedCell)}if(!v||c){this._setScrollTop(this.grid.element.parent(),newCell,nextY>=y?"down":"up",nextY-this.y_exclude_current);if(c){if(sri!==this.grid._startRowIndex){nextY=nextY+(nextY>=y?-1:1)*Math.abs(this.grid._startRowIndex-sri);sri=this.grid._startRowIndex}newCell=this.grid.cellAt(nextX,nextY,isFixedCell)}if(this.grid.options.width!==null&&this.grid.options.height!==null){parent=$("#"+this.grid.element[0].id+"_hscroller")}else if(this.grid.scrollContainer().length>0){parent=this.grid.scrollContainer()}else{parent=this.grid.element.parent()}this._setScrollLeft(parent,newCell,nextX>=x?"right":"left",nextX-this.x_exclude_current)}if(newCell===undefined||newCell.length>1){return}$newCell=$(newCell);if(this._hc&&($newCell.hasClass("ui-iggrid-expandbutton")||$newCell.hasClass("ui-iggrid-expandcolumn"))){if(event.keyCode===$.ui.keyCode.ENTER){ptr=$newCell.closest("tr");hgrid=$newCell.closest(".ui-iggrid-root").data("igHierarchicalGrid");hgrid.toggle(ptr)}}if($newCell.hasClass("ui-iggrid-rowselector-class")&&(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE)){rs=this.grid.element.data("igGridRowSelectors");cb=$newCell.find("span[data-role='checkbox']");if(rs&&cb.length>0){rs._handleCheck(cb)}}indexTmp=nextX-this.x_exclude_current;if(event.keyCode!==$.ui.keyCode.ENTER&&event.keyCode!==$.ui.keyCode.SPACE){$(currentCell.element).removeClass(this.css.activeCell);if(nextX===0){indexTmp=this.x_exclude_current}if(nextX>=this.grid.options.columns.length){cKey=this.grid.options.columns[this.grid.options.columns.length-1].key}else{cKey=this.grid.options.columns[nextX===0?0:indexTmp-(this._hc===true?1:0)].key}if(nextX<=0&&this._hc){cKey=null}if(v){newCellObject={element:$(newCell),index:nextX===0?sci:indexTmp+sci,rowIndex:nextY+sri-this.y_exclude_current,row:$(this.grid.rowAt(nextY)),columnKey:cKey}}else{newCellObject={element:$(newCell),index:nextX===0?0:indexTmp,rowIndex:nextY-this.y_exclude_current,row:$(this.grid.rowAt(nextY)),columnKey:cKey}}if(event.ctrlKey&&this.activeCell()&&(this.activeCell().index!==newCellObject.index||this.activeCell().rowIndex!==newCellObject.rowIndex)){this._activateCell(newCellObject,event)}if(!event.ctrlKey&&event.shiftKey&&this.options.multipleSelection===true){this._shiftCellSelection(newCellObject,false,true,currentCell,event)}else if(!event.ctrlKey){noCancel=this._trigger(this.events.cellSelectionChanging,event,{cell:newCellObject,selectedCells:this.grid._selectedCells,owner:this,manual:false});if(noCancel){this.clearSelection(true);this._selectInternal(null,nextY-this.y_exclude_current,nextX===0?0:indexTmp,isFixedCell);this._trigger(this.events.cellSelectionChanged,event,{cell:newCellObject,selectedCells:this.grid._selectedCells,owner:this,manual:false})}}}event.preventDefault();event.stopPropagation()},_navigateRow:function(event,select){var nextY,y,currentRow=this.activeRow(),rowCount,newRowObject,newRow,noCancel=true,v,c,sri=this.grid._startRowIndex;v=this.grid.options.virtualization||this.grid.options.rowVirtualization;c=v&&this.grid.options.virtualizationMode==="continuous";if(!currentRow){return}if(v){y=currentRow.index-sri}else{y=currentRow.index}y+=this.y_exclude_current;rowCount=this._rowCount;if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){nextY=y;if(event.ctrlKey&&this._isRowSelected(y-this.y_exclude_current)){noCancel=this._trigger(this.events.rowSelectionChanging,event,{row:currentRow,selectedRows:this.grid._selectedRows,selectedFixedRows:this.grid._selectedFixedRows,owner:this,manual:false});if(noCancel){this.deselectRow(y-this.y_exclude_current);this._trigger(this.events.rowSelectionChanged,event,{row:currentRow,selectedRows:this.grid._selectedRows,selectedFixedRows:this.grid._selectedFixedRows,owner:this,manual:false})}noCancel=true}else{this._ctrlSelect=true;this._selectInternal(null,y-this.y_exclude_current);this._ctrlSelect=false}}else if(event.keyCode===$.ui.keyCode.DOWN){nextY=y+1;if(this._realActiveRow!==null&&this._realActiveRow!==undefined&&this.options.multipleSelection===true&&this.grid._selectedRows.length>1&&!event.shiftKey&&!event.ctrlKey&&this._isContinuous){nextY=this._realActiveRow.index+1+this.y_exclude_current}if(!v){if(nextY-this.y_exclude_current>rowCount-1&&this.options.wrapAround===true){nextY=this.y_exclude_current}else if(nextY-this.y_exclude_current>rowCount-1&&this.options.wrapAround===false){if(this._hc&&!this.options.skipChildren){this._activateNextGrid(null,true)}return}}}else if(event.keyCode===$.ui.keyCode.UP){nextY=y-1;if(this._realActiveRow!==null&&this._realActiveRow!==undefined&&this.options.multipleSelection===true&&this.grid._selectedRows.length>1&&!event.shiftKey&&!event.ctrlKey&&this._isContinuous){nextY=this._realActiveRow.index-1+this.y_exclude_current}if(!v){if(nextY-this.y_exclude_current<0&&this.options.wrapAround===true){nextY=rowCount-1}else if(nextY-this.y_exclude_current<0&&this.options.wrapAround===false){if(this._hc&&!this.options.skipChildren){this._activateNextGrid(null,false)}return}}}else{return}event.preventDefault();event.stopPropagation();if(v&&!c&&nextY>=this.grid._virtualRowCount){nextY=this.grid._virtualRowCount-1;newRow=this.grid.rowAt(nextY-this.y_exclude_current);this._setScrollTop(this.grid.element.parent(),newRow,nextY>=y?"down":"up",nextY-this.y_exclude_current)}else if(v&&!c&&nextY<0&&sri>0){nextY=-1;newRow=this.grid.rowAt(nextY);this._setScrollTop(this.grid.element.parent(),newRow,"up",nextY-this.y_exclude_current)}else if(!(v&&!c&&nextY<0)){newRow=this.grid.rowAt(nextY)}else{return}if(newRow===undefined||newRow.length>1){return}while(newRow&&!$(newRow).is(":visible")&&nextY>0&&nextY<rowCount-1){newRow=this.grid.rowAt(event.keyCode===$.ui.keyCode.UP?--nextY:++nextY)}if(!v||c){this._setScrollTop(this.grid.element.parent(),newRow,nextY>=y?"down":"up",nextY-this.y_exclude_current);if(c){if(sri!==this.grid._startRowIndex){nextY=nextY+(nextY>=y?-1:1)*Math.abs(this.grid._startRowIndex-sri);sri=this.grid._startRowIndex}newRow=this.grid.rowAt(nextY)}}if(event.keyCode!==$.ui.keyCode.ENTER&&event.keyCode!==$.ui.keyCode.SPACE){$(currentRow.element).removeClass(this.css.activeRow);if(v){newRowObject={element:$(newRow),index:nextY+sri-this.y_exclude_current}}else{newRowObject={element:$(newRow),index:nextY-this.y_exclude_current}}if(event.ctrlKey&&this.activeRow()&&this.activeRow().index!==newRowObject.index){this._activateRow(newRowObject,event)}if(!event.ctrlKey&&event.shiftKey&&this.options.multipleSelection===true){this._shiftRowSelection(newRowObject,false,true,currentRow,event)}else if(!event.ctrlKey){noCancel=this._trigger(this.events.rowSelectionChanging,event,{row:newRowObject,selectedRows:this.grid._selectedRows,selectedFixedRows:this.grid._selectedFixedRows,owner:this,manual:false});if(noCancel){this.clearSelection(true);this._selectInternal(null,nextY-this.y_exclude_current);this._trigger(this.events.rowSelectionChanged,event,{row:newRowObject,selectedRows:this.grid._selectedRows,selectedFixedRows:this.grid._selectedFixedRows,owner:this,manual:false})}}}},_activateNextGrid:function(event,goingDown,levelDown){var target,nextTarget,currentGrid=this.grid.container(),reset=true;if(this.options.mode==="row"){target=this.activeRow().element}else{target=$(this.activeCell().element).closest("tr")}if(event!==null||levelDown===true){if(!event){event={keyCode:goingDown?$.ui.keyCode.DOWN:$.ui.keyCode.UP}}if(event.keyCode===$.ui.keyCode.UP){nextTarget=target.prev();if(nextTarget.attr("data-container")&&nextTarget.is(":visible")){nextTarget=nextTarget.find(".ui-iggrid-table").last()}else{return false}}else{nextTarget=target.next();if(nextTarget.attr("data-container")&&nextTarget.is(":visible")){nextTarget=nextTarget.find(".ui-iggrid-table").first()}else{return false}}}else{if(goingDown){if(currentGrid.next().length>0){nextTarget=currentGrid.nextAll(".ui-iggrid").first().children(".ui-iggrid-table")}else{nextTarget=currentGrid.closest("tr:[data-container=true]").next();reset=false}}else{if(currentGrid.prev().length>0){nextTarget=currentGrid.prevAll(".ui-iggrid").first().children(".ui-iggrid-table")}else{nextTarget=currentGrid.closest("tr:[data-container=true]").prev();reset=false}}}this.clearSelection(false,true);if(reset){if(this.options.mode==="row"){if(goingDown!==undefined&&!goingDown){nextTarget.igGridSelection("selectRow",nextTarget.find(".ui-iggrid-tablebody > tr").last().index())}else{nextTarget.igGridSelection("selectRow",0)}}else{if(goingDown!==undefined&&!goingDown){nextTarget.igGridSelection("selectCell",nextTarget.find(".ui-iggrid-tablebody > tr").last().index(),0)}else{nextTarget.igGridSelection("selectCell",0,0)}}}else if(nextTarget&&nextTarget.length>0){if(this.options.mode==="row"){nextTarget.closest(".ui-iggrid-table").igGridSelection("selectRow",nextTarget.index())}else{nextTarget.closest(".ui-iggrid-table").igGridSelection("selectCell",nextTarget.index(),0)}}nextTarget.closest(".ui-iggrid").focus();return true},_setScrollTop:function(parent,child,direction,index){var parentOffset=parent.offset(),childOffset=$(child).offset(),childh,isDown,isUp,v,c,st;if(!child){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<parentOffset.top||c&&index<0}else{isDown=childh*(index+1)>=parseInt(this.grid.options.height,10);isUp=index<0}if(index===0){parent[0].scrollTop=0}else if(direction==="down"){if(isDown){if(c||!v){st=parent[0].scrollTop+childOffset.top+this.grid._scrollbarWidth()-(parentOffset.top+parent.outerHeight())+$(child).outerHeight();if(c){this.grid._onVirtualVerticalScroll({},childh,direction)}else{parent[0].scrollTop=st}}else{this._scrollVmanual(true)}}}else{if(isUp){if(c||!v){st=parent[0].scrollTop-$(child).outerHeight();if(c){this.grid._onVirtualVerticalScroll({},childh,direction)}else{parent[0].scrollTop=st}}else{this._scrollVmanual(false)}}}},_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},_setScrollLeft:function(parent,child,direction,index){var parentOffset=parent.offset(),childOffset=$(child).offset();if(!child){return}if(index===0){parent[0].scrollLeft=0}else if(direction==="right"){if(childOffset.left+$(child).outerWidth()>parentOffset.left+$(parent).outerWidth()){parent[0].scrollLeft=parent[0].scrollLeft+childOffset.left-(parentOffset.left+parent.outerWidth())+$(child).outerWidth()}}else{if(childOffset.left<parentOffset.left){parent[0].scrollLeft=parent[0].scrollLeft-$(child).outerWidth()}}},_isRowSelected:function(y){var i;for(i=0;i<this.grid._selectedRows.length;i++){if(this.grid._selectedRows[i].index===y){return true}}return false},_isRowSelectedByKey:function(key,cache){var del=!!cache,srows=cache||this.grid._selectedRows,i;for(i=0;i<srows.length;i++){if(srows[i].id===key){if(del){$.ig.removeFromArray(srows,i,i)}return true}}return false},_isCellSelected:function(y,x){var i;for(i=0;i<this.grid._selectedCells.length;i++){if(this.grid._selectedCells[i].index===x&&this.grid._selectedCells[i].rowIndex===y){return true}}return false},_isCellSelectedByKey:function(rowKey,colKey,cache){var del=!!cache,scells=cache||this.grid._selectedCells,i;for(i=0;i<scells.length;i++){if(scells[i].rowId===rowKey&&scells[i].columnKey===colKey||scells[i].rowId===rowKey&&scells[i].columnKey===null&&scells[i].index===0&&colKey===-1){if(del){$.ig.removeFromArray(scells,i,i)}return true}}return false},_rs:function(e,args){var dom=args.dom,i=0,j=0,ac=this.activeCell(),ar=this.activeRow(),rows=this.grid.rows(),sri=this.grid._startRowIndex,sci=this.grid._startColIndex,dataSkip=this._firstRow?this._firstRow.find("th,[data-skip='true']").length:0;if(this.grid.id()!==args.owner.id()){return}if(this.grid.options.virtualization===true&&this.grid.options.virtualizationMode==="continuous"){this._registerTbodyEvents()}if(this.grid._selectedCell){this.grid._selectedCell.element=rows.eq(this.grid._selectedCell.rowIndex-sri).children("td").eq(this.grid._selectedCell.index-dataSkip);this.grid._selectedCell.row=this.grid._selectedCell.element.parent("tr")}if(this.grid._selectedRow){this.grid._selectedRow.element=rows.eq(this.grid._selectedRow.index-sri)}if(this.grid._activeRow){this.grid._activeRow.element=rows.eq(this.grid._activeRow.index-sri)}if(this.grid._activeCell){this.grid._activeCell.element=rows.eq(this.grid._activeCell.rowIndex-sri).children("td").eq(this.grid._activeCell.index);this.grid._activeCell.row=this.grid._activeCell.element.parent("tr")}if(this.grid._selectedRows&&this.grid._selectedRows.length>0){for(i=0;i<this.grid._selectedRows.length;i++){this.grid._selectedRows[i].element=rows.eq(this.grid._selectedRows[i].index-sri)}}if(this.grid._selectedCells&&this.grid._selectedCells.length>0){for(i=0;i<this.grid._selectedCells.length;i++){this.grid._selectedCells[i].element=rows.eq(this.grid._selectedCells[i].rowIndex-sri).children("td").eq(this.grid._selectedCells[i].index-dataSkip);this.grid._selectedCells[i].row=this.grid._selectedCells[i].element.parent("tr")}}ac=this.activeCell();ar=this.activeRow();for(i=0;i<dom.length;i++){for(j=0;j<dom[i].length;j++){if(this.options.mode==="cell"){if(this.options.multipleSelection){if(this._isCellSelected(i+sri,j+sci+dataSkip)){$(dom[i][j]).addClass(this.css.selectedCell)}}else if(this.grid._selectedCell){if(i+sri===this.grid._selectedCell.rowIndex&&j+sci+dataSkip===this.grid._selectedCell.index){$(dom[i][j]).addClass(this.css.selectedCell)}}}else{if(this.options.multipleSelection){if(this._isRowSelected(i+sri)){$(dom[i][j]).addClass(this.css.selectedRow)}}else if(this.grid._selectedRow){if(i+sri===this.grid._selectedRow.index){$(dom[i][j]).addClass(this.css.selectedRow)}}}}}if(ac){if(ac.rowIndex-sri>=0&&ac.rowIndex-sri<dom.length&&ac.index-sci-dataSkip>0&&ac.index-sci-dataSkip<dom[ac.rowIndex-sri].length){$(dom[ac.rowIndex-sri][ac.index-sci-dataSkip]).addClass(this.css.activeCell)}}if(ar){if(ar.index-sri>=0&&ar.index-sri<dom.length){$(dom[ar.index-sri]).first().closest("tr").addClass(this.css.activeRow)}}},selectCell:function(row,col,isFixed){var rv=this.grid.options.virtualization||this.grid.options.rowVirtualization,cv=this.grid.options.virtualization||this.grid.options.columnVirtualization;if(rv&&(row>=this.grid._startRowIndex+this.grid._virtualRowCount||row<this.grid._startRowIndex)||cv&&(col>=this.grid._startColIndex+this.grid._virtualColumnCount||col<this.grid._startColIndex)){if(this.options.multipleSelection===true){this.grid._selectedCells.push({index:col,rowIndex:row});this.grid._selectedCell=null}else{this.clearSelection();this.grid._selectedCell={index:col,rowIndex:row}}this.grid._activeCell={index:col,rowIndex:row}}else{this._selectInternal(null,row,col,isFixed)}},deselectCell:function(row,col){var i;if(this.options.multipleSelection===true){for(i=0;i<this.selectedCells().length;i++){if(this.selectedCells()[i].index===col&&this.selectedCells()[i].rowIndex===row){this._deselectCell(this.selectedCells()[i]);$.ig.removeFromArray(this.selectedCells(),i);this.grid._selectedCell=null;break}}}else{if(this.selectedCell()!==null&&this.selectedCell()!==undefined){this._deselectCell(this.selectedCell());this.grid._selectedCell=null}}},selectRow:function(index){var v=this.grid.options.virtualization||this.grid.options.rowVirtualization;if(v&&(index>=this.grid._startRowIndex+this.grid._virtualRowCount||index<this.grid._startRowIndex)){if(this.options.multipleSelection===true){this.grid._selectedRows.push({index:index});this.grid._selectedRow=null}else{this.clearSelection();this.grid._selectedRow={index:index}}this.grid._activeRow={index:index}}else{this._selectInternal(null,index)}},deselectRow:function(index){var i,hasFixedColumns=this.grid.hasFixedColumns();if(this.options.multipleSelection===true){for(i=0;i<this.selectedRows().length;i++){if(this.selectedRows()[i].index===index||this.selectedRows()[i].element&&this.selectedRows()[i].element.index()===index){this._deselectRow(this.selectedRows()[i]);
$.ig.removeFromArray(this.selectedRows(),i);this.grid._selectedRow=null;if(hasFixedColumns&&this.grid._selectedFixedRows){if(this.grid._selectedFixedRows[i]){this._deselectRow(this.grid._selectedFixedRows[i])}$.ig.removeFromArray(this.grid._selectedFixedRows,i);this.grid._selectedFixedRow=null}break}}}else{if(this.selectedRow()!==null&&this.selectedRow()!==undefined){this._deselectRow(this.selectedRow());if(hasFixedColumns&&this.grid._selectedFixedRow){this._deselectRow(this.grid._selectedFixedRow);this.grid._selectedFixedRow=null}this.grid._selectedRow=null}}},_deselectRow:function(row){var el;if(row.element&&row.element instanceof jQuery){el=row.element}else{el=$(this.grid._virtualDom[row.index])}el.removeClass(this.css.selectedRow);el.children().removeClass(this.css.selectedCell);if(this.grid.hasFixedColumns()){el=this.grid.fixedContainer().find("tbody>tr").eq(el.index());el.removeClass(this.css.selectedRow);el.children().removeClass(this.css.selectedCell)}},_deselectCell:function(cell){var el;if(cell.element&&cell.element instanceof jQuery){el=cell.element}else{el=$(this.grid._virtualDom[cell.rowIndex][cell.index])}el.removeClass(this.css.selectedCell)},_activateCell:function(cell,event,isFixed){var noCancel=true,v=this.grid.options.virtualization||this.grid.options.rowVirtualization;noCancel=this._trigger(this.events.activeCellChanging,event,{cell:cell,owner:this});if(noCancel){if(this.activeCell()){if(v){$(this.grid.cellAt(this.grid._activeCell.index,this.grid._activeCell.rowIndex-this.grid._startRowIndex)).removeClass(this.css.activeCell)}else{$(this.activeCell().element).removeClass(this.css.activeCell)}}if(this.activeRow()){if(v){$(this.grid.rowAt(this.grid._activeRow.index-this.grid._startRowIndex)).removeClass(this.css.activeRow)}else{$(this.activeRow().element).removeClass(this.css.activeRow)}this.activeRow(null)}this.activeCell(cell);$(this.activeCell().element).addClass(this.css.activeCell);this._trigger(this.events.activeCellChanged,event,{cell:cell,owner:this})}},_activateRow:function(row,event,fixedRow){var noCancel=true,v=this.grid.options.virtualization||this.grid.options.rowVirtualization;noCancel=this._trigger(this.events.activeRowChanging,event,{row:row,owner:this});if(noCancel){if(this.activeRow()){if(v){$(this.grid.rowAt(this.grid._activeRow.index-this.grid._startRowIndex)).removeClass(this.css.activeRow)}else{$(this.activeRow().element).removeClass(this.css.activeRow)}}if(this.activeFixedRow()){$(this.activeFixedRow().element).removeClass(this.css.activeRow)}if(this.activeCell()){if(v){$(this.grid.cellAt(this.grid._activeCell.index,this.grid._activeCell.rowIndex-this.grid._startRowIndex)).removeClass(this.css.activeCell)}else{$(this.activeCell().element).removeClass(this.css.activeCell)}this.activeCell(null)}this.activeRow(row);if(fixedRow){$(fixedRow.element).addClass(this.css.activeRow);this.activeFixedRow(fixedRow)}$(this.activeRow().element).addClass(this.css.activeRow);this._trigger(this.events.activeRowChanged,event,{row:row,owner:this})}},selectedCells:function(){return this.grid._selectedCells},selectedRows:function(){return this.grid._selectedRows},selectedFixedCells:function(){return this.grid._selectedFixedCells},selectedFixedRows:function(){return this.grid._selectedFixedRows},selectedCell:function(){return this.grid._selectedCell},selectedRow:function(){return this.grid._selectedRow},selectedFixedRow:function(){return this.grid._selectedFixedRow},activeCell:function(cell){if(cell!==undefined){this.grid._activeCell=cell}else{return this.grid._activeCell}},activeRow:function(row){if(row!==undefined){this.grid._activeRow=row}else{return this.grid._activeRow}},activeFixedRow:function(row){if(row!==undefined){this.grid._activeFixedRow=row}else{return this.grid._activeFixedRow}},clearSelection:function(internal,uiDirty){var i,v=this.grid.options.virtualization||this.grid.options.rowVirtualization,hasFixedColumns=this.grid.hasFixedColumns();for(i=0;i<this.grid._selectedCells.length;i++){if(!v){this.grid._selectedCells[i].element.removeClass(this.css.selectedCell)}else if(v&&this.grid._selectedCells[i].rowIndex-this.grid._startRowIndex>=0){$(this.grid.cellAt(this.grid._selectedCells[i].index,this.grid._selectedCells[i].rowIndex-this.grid._startRowIndex)).removeClass(this.css.selectedCell)}}if(hasFixedColumns){for(i=0;i<this.grid._selectedFixedCells.length;i++){if(!v||v&&this.grid._selectedFixedCells[i].rowIndex-this.grid._startRowIndex>=0){this.grid._selectedFixedCells[i].element.removeClass(this.css.selectedCell)}}this.grid._selectedFixedCells=[];for(i=0;i<this.grid._selectedFixedRows.length;i++){if(!v||v&&this.grid._selectedFixedRows[i].index-this.grid._startRowIndex>=0){$(this.grid._selectedFixedRows[i].element.children()).removeClass(this.css.selectedCell)}}this.grid._selectedFixedRows=[];if(this.grid._selectedFixedRow!==null&&this.grid._selectedFixedRow!==undefined){if(v&&this.grid._selectedFixedRow.index-this.grid._startRowIndex>=0){$(this.grid.rowAt(this.grid._selectedFixedRow.index-this.grid._startRowIndex)).children().removeClass(this.css.selectedCell)}else{$(this.grid._selectedFixedRow.element.children()).removeClass(this.css.selectedCell)}this.grid._selectedFixedRow=null}if(this.grid._selectedFixedCell!==null&&this.grid._selectedFixedCell!==undefined){if(v&&this.grid._selectedFixedCell.rowIndex-this.grid._startRowIndex>=0){$(this.grid.cellAt(this.grid._selectedFixedCell.index,this.grid._selectedCell.rowIndex-this.grid._startRowIndex)).removeClass(this.css.selectedCell)}else{this.grid._selectedFixedCell.element.removeClass(this.css.selectedCell)}this.grid._selectedFixedCell=null}}this.grid._selectedCells=[];for(i=0;i<this.grid._selectedRows.length;i++){if(!v){$(this.grid._selectedRows[i].element.children()).removeClass(this.css.selectedCell)}else if(v&&this.grid._selectedRows[i].index-this.grid._startRowIndex>=0){$(this.grid.rowAt(this.grid._selectedRows[i].index-this.grid._startRowIndex)).children().removeClass(this.css.selectedCell)}}this.grid._selectedRows=[];if(this.grid._selectedRow!==null&&this.grid._selectedRow!==undefined){if(v&&this.grid._selectedRow.index-this.grid._startRowIndex>=0){$(this.grid.rowAt(this.grid._selectedRow.index-this.grid._startRowIndex)).children().removeClass(this.css.selectedCell)}else{$(this.grid._selectedRow.element.children()).removeClass(this.css.selectedCell)}this.grid._selectedRow=null}if(this.grid._selectedCell!==null&&this.grid._selectedCell!==undefined){if(v&&this.grid._selectedCell.rowIndex-this.grid._startRowIndex>=0){$(this.grid.cellAt(this.grid._selectedCell.index,this.grid._selectedCell.rowIndex-this.grid._startRowIndex)).removeClass(this.css.selectedCell)}else{this.grid._selectedCell.element.removeClass(this.css.selectedCell)}this.grid._selectedCell=null}if(!internal){if(this.activeCell()){if(v){$(this.grid.cellAt(this.grid._activeCell.index,this.grid._activeCell.rowIndex-this.grid._startRowIndex)).removeClass(this.css.activeCell)}else{this.activeCell().element.removeClass(this.css.activeCell)}this.activeCell(null)}if(this._realActiveCell){this._realActiveCell.element.removeClass(this.css.activeCell);this._realActiveCell=null}if(this._realActiveRow){this._realActiveRow.element.removeClass(this.css.activeRow);this._realActiveRow=null}if(this.activeRow()){if(v){$(this.grid.rowAt(this.grid._activeRow.index-this.grid._startRowIndex)).removeClass(this.css.activeRow)}else{this.activeRow().element.removeClass(this.css.activeRow)}this.activeRow(null)}}if(uiDirty){this.activeCell(null);this.activeRow(null)}this._trigger("selectioncleared",this,{owner:this.grid,uiDirty:uiDirty})},clearSelectionAllChildren:function(internal,uiDirty){var children=this.grid.children(),i,sel;for(i=0;i<children.length;i++){sel=$(children[i]).data("igGridSelection");if(sel){sel.clearSelection(internal,uiDirty)}}},clearSelectionAll:function(internal,uiDirty){this.clearSelection(internal,uiDirty);this.clearSelectionAllOthers(internal,uiDirty)},clearSelectionAllOthers:function(internal,uiDirty){var hgrid,children,i,sel,rootSel;if(!this._hgrid){if(this.grid.element.hasClass("ui-iggrid-root")){hgrid=this.grid.element.data("igHierarchicalGrid")}else{hgrid=this.grid.element.closest(".ui-iggrid-root").data("igHierarchicalGrid")}}else{hgrid=this._hgrid.data("igHierarchicalGrid")}if(hgrid){children=hgrid.allChildren();for(i=0;i<children.length;i++){sel=$(children[i]).data("igGridSelection");if(sel&&$(children[i]).attr("id")!==this.grid.element.attr("id")){sel.clearSelection(internal,uiDirty)}}}if(hgrid.element.attr("id")!==this.grid.element.attr("id")&&hgrid.element.is("table")||hgrid.element.is("div")&&$("#"+hgrid.element.attr("id")+"_table").attr("id")!==this.grid.element.attr("id")){if(!hgrid.element.is("table")){rootSel=$("#"+hgrid.element.attr("id")+"_table").data("igGridSelection")}else{rootSel=hgrid.element.data("igGridSelection")}if(rootSel){rootSel.clearSelection(internal,uiDirty)}}},_excludeRows:function(element){return this.grid.element.children("tbody").children("tr:[data-container=true]").length},_excludeRowsLt:function(element){var index=element.index();return this.grid.element.children("tbody").children("tr:lt("+index+")").filter("[data-container=true]").length},_calcExtraCells:function(){return this.grid.element.find("tbody > tr > td[data-skip=true]").first().parent().find("[data-skip=true]").length},_columnsCollectionModified:function(evt,ui){if(ui.owner.id()===this.grid.id()){this._registerTbodyEvents()}},_columnFixed:function(args){var i,rows=[],cells=[];if(args.isFixed){if(args.isInit){this._registerFixedTbodyEvents();if(this.options.mode==="row"){if(this.grid.selectedRows().length>0){rows=this.grid.selectedRows().clone()}else if(this.grid.selectedRow()!==null){rows=[this.grid.selectedRow()]}if(rows.length>0){this.clearSelection(false);for(i=0;i<rows.length;i++){this.selectRow(rows[i].index)}}}}}if(this.grid.selectedCells().length>0){cells=this.grid.selectedCells()}else if(this.grid.selectedCell()!==null){cells=[this.grid.selectedCell()]}for(i=0;i<cells.length;i++){if(this.grid.columnByKey(cells[i].columnKey).fixed!==cells[i].isFixed){cells[i].isFixed=!cells[i].isFixed}}if(this.grid._activeCell){this.grid._activeCell.index=this.grid._activeCell.element.index();this.grid._activeCell.isFixed=this.grid._isFixedElement(this.grid._activeCell.element)}},_buildSelectionCache:function(){if(this.options.persist){this._scc=[];this._src=[];this._srcf=[];if(this.options.multipleSelection===true&&(this.grid._selectedCells.length>0||this.grid._selectedRows.length>0)){jQuery.extend(this._scc,this.grid._selectedCells);jQuery.extend(this._src,this.grid._selectedRows);jQuery.extend(this._srcf,this.grid._selectedFixedRows)}if(this.grid._selectedCell&&this.grid._selectedCells.length===0){this._scc.push(this.grid._selectedCell)}if(this.grid._selectedRow&&this.grid._selectedCells.length===0){this._src.push(this.grid._selectedRow)}if(this.grid._selectedFixedRow&&this.grid._selectedFixedRows.length===0){this._srcf.push(this.grid._selectedFixedRow)}}},_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])}}},_removeSelectionCache:function(){if(this._scc){delete this._scc}if(this._src){delete this._src}if(this._srcf){delete this._srcf}},destroy:function(){this.clearSelection();this._unregisterEvents();$.Widget.prototype.destroy.call(this);return this},_onUIDirty:function(e,args){if(args.owner===this||args.owner.element[0].id!==this.element[0].id){return}if(!this.grid.options.virtualization&&!this.grid.options.rowVirtualization){this._rowCount=this.grid.dataSource.dataView().length}if(this._groupBy){this._rowCount+=this.grid.element.children("tbody").children("tr[data-grouprow=true]").length}if(!this.options.persist){this.clearSelection(true,true)}},_injectGrid:function(gridInstance,isRebind){var i;this.grid=gridInstance;if(!isRebind||!this.options.persist){this.activeCell(null);this.grid._selectedCell=null;this.grid._selectedRow=null;this.activeRow(null);this.grid._selectedCells=[];this.grid._selectedRows=[];this.grid._selectedFixedCells=[];this.grid._selectedFixedRows=[]}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.options.mode="row"}}}if(this._virtualRecordsRendererHandler!==null&&this._virtualRecordsRendererHandler!==undefined){this.grid.element.unbind("iggridvirtualrecordsrender",this._virtualRecordsRendererHandler)}this._virtualRecordsRendererHandler=$.proxy(this._rs,this);this.grid.element.bind("iggridvirtualrecordsrender",this._virtualRecordsRendererHandler);if(this._uiDirtyHandler!==null&&this._uiDirtyHandler!==undefined){this.grid.element.unbind("iggriduisoftdirty",this._uiDirtyHandler)}this._uiDirtyHandler=$.proxy(this._onUIDirty,this);this.grid.element.bind("iggriduisoftdirty",this._uiDirtyHandler);if(this._dataRenderingHandler!==null&&this._dataRenderingHandler!==undefined){this.grid.element.unbind("iggriddatarendering",this._dataRenderingHandler)}this._dataRenderingHandler=$.proxy(this._dataRendering,this);this.grid.element.bind("iggriddatarendering",this._dataRenderingHandler);if(this._rowExpandedHandler!==null&&this._rowExpandedHandler!==undefined){this.grid.element.unbind("ighierarchicalgridrowexpanded",this._rowExpandedHandler)}this._rowExpandedHandler=$.proxy(this._rowExpanded,this);this.grid.element.bind("ighierarchicalgridrowexpanded",this._rowExpandedHandler);if(this._columnsCollectionModifiedHandler!==null&&this._columnsCollectionModifiedHandler!==undefined){this.grid.element.unbind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler)}this._columnsCollectionModifiedHandler=$.proxy(this._columnsCollectionModified,this);this.grid.element.bind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler);this._hdirty=true;if(this.options.persist&&!isRebind){this.grid._cellStyleSubscribers.push(this.options.mode==="row"?$.proxy(this._applyRowStyle,this):$.proxy(this._applyCellStyle,this))}}});$.extend($.ui.igGridSelection,{version:"14.1.20141.1020"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Sorting 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 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.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},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(options,element){this.options.columnSettings=[];$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){var self=this;this._headers=[];this._clickHandler=function(event){var th,id;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")){th.find("a").focus();self._handleSort(event);if($("#"+self.grid.id()+"_hscroller").scrollLeft()>0&&self.grid.options.fixedHeaders===true){self.grid.headersTable().parent().scrollLeft($("#"+self.grid.id()+"_hscroller").scrollLeft())}}};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 a:not([th-remove-focus])",{keydown:this._keyDownHandler,focus:this._focusHandler,blur:this._blurHandler});$(document).delegate("#"+this.element[0].id+"_headers thead th a:not([th-remove-focus])",{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+" "+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){var index=$(event.currentTarget).closest("th").data("columnIndex"),id;id=$(event.target).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._currentActiveHeader){this._currentActiveHeader.removeClass(this.css.sortableColumnHeaderActive)}$(event.currentTarget).closest("th").addClass(this.css.sortableColumnHeaderActive);this._currentActiveHeader=$(event.currentTarget).closest("th");if(event.shiftKey){this.unsortColumn(index,$(event.currentTarget).closest("th"))}else{this.sortColumn(index,null,$(event.currentTarget).closest("th"));if($.ig.util.isIE){$(event.currentTarget).focus()}}event.stopPropagation();event.preventDefault()}},_handleFocusKb:function(event){var $target=$(event.currentTarget),id=$(event.target).closest(".ui-iggrid").attr("id").replace("_container","");if(this.grid.element.attr("id")!==id||$target.attr("data-fixing-indicator")!==undefined){return}$target.closest("th").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.currentTarget).closest("th").removeClass(this.css.sortableColumnHeaderFocus)},_handleSort:function(event){if(this._resizing&&this._resizing._resizing){this._resizing._resizing=false;return}var $th=$(event.currentTarget).closest("th"),index=$th.data("columnIndex"),isShiftClicked=false;if(this._currentActiveHeader){this._currentActiveHeader.removeClass(this.css.sortableColumnHeaderActive)}isShiftClicked=event.shiftKey;if(isShiftClicked){$th.removeClass(this.css.sortableColumnHeaderFocus).removeClass(this.css.sortableColumnHeaderActive);this._currentHeader=$th;this.unsortColumn(index,$th)}else{$(event.currentTarget).addClass(this.css.sortableColumnHeaderActive);this._currentActiveHeader=$th;this.sortColumn(index,null,$(event.currentTarget))}event.stopPropagation();event.preventDefault()},_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,i,visualIndex,groupby,reset=true,se,newSE=[],apiCall=header===null||header===undefined,addSE=false,isHidden=false;this._currentIdentifier=index;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}}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){s.currentSortDirection=direction}else{if(s.currentSortDirection!==undefined&&s.currentSortDirection!==null&&!s.currentSortDirection.startsWith("asc")&&!s.currentSortDirection.startsWith("desc")||s.currentSortDirection===undefined||s.currentSortDirection===null){s.currentSortDirection=s.firstSortDirection===undefined?this.options.firstSortDirection:s.firstSortDirection}else{s.currentSortDirection=s.currentSortDirection!==undefined&&s.currentSortDirection!==null&&s.currentSortDirection.indexOf("asc")!==-1?"descending":"ascending"}}if(!apiCall){noCancel=this._trigger(this.events.columnSorting,null,{columnKey:colKey,direction:s.currentSortDirection,owner:this})}if(noCancel){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{if(colKey&&this.grid.hasFixedColumns()){this._clearSortStatesByKey(header,colKey)}else{this._clearSortStates(header,index)}}for(i=0;this.grid.options.features&&i<this.grid.options.features.length;i++){if(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}}}if(isHidden&&direction!==null&&direction!==undefined){s.currentSortDirection=direction}if(reset){this.grid.dataSource.settings.sorting.expressions=[{fieldName:colKey,dir:s.currentSortDirection.startsWith("asc")?"asc":"desc"}]}else{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}newSE.push(se[i])}}if(addSE){newSE.push({fieldName:colKey,dir:s.currentSortDirection.startsWith("asc")?"asc":"desc"})}this.grid.dataSource.settings.sorting.expressions=newSE}}else{for(i=0;i<expr.length;i++){if(expr[i].fieldName===colKey){expr.splice(i,1)}}this.grid.dataSource.settings.sorting.expressions=expr.concat([{fieldName:colKey,dir:s.currentSortDirection.startsWith("asc")?"asc":"desc"}])}noCancel=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid});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._currentIndex=index;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})}}this._curColKey=colKey;this._curSortDir=s.currentSortDirection}}},sortMultiple:function(){var self=this,noCancel,expr=this.grid.dataSource.settings.sorting.expressions,header;noCancel=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid});if(noCancel){$.each(this.grid.options.columns,function(index,column){var i,cs,colKey=column.key;header=$("#"+self.grid.element[0].id+"_"+colKey);for(i=0;i<expr.length;i++){if(expr[i].fieldName===colKey){break}}cs=self._findColumnSetting(colKey);if(cs){if(i===expr.length){cs.currentSortDirection=undefined}else{cs.currentSortDirection=expr[i].dir}}self._applySortStyles(header,index)});this.grid.element.trigger("iggriduisoftdirty",{owner:this});if(this._isResetClick===true){this._isResetClick=false}if(this.options.type==="remote"){this.grid.dataSource.dataBind()}else{this.grid.dataSource.sort(this.grid.dataSource.settings.sorting.expressions);this.grid._renderData()}this._saveSortingExpressions()}},unsortColumn:function(index,header){if(this.options.mode==="single"){return}var colKey,expr,noCancel=true,s,i,apiCall=false;if($.type(index)==="number"){colKey=this.grid.options.columns[index].key}else{colKey=index;for(i=0;i<this.grid.options.columns.length;i++){if(this.grid.options.columns[i].key===colKey){index=i;break}}}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;for(i=0;i<expr.length;i++){if(expr[i].fieldName===colKey){expr.splice(i,1)}}this._currentIndex=null;this._currentHeader=null;this._applySortStyles($("#"+this.grid.element[0].id+"_"+colKey),index);noCancel=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid});if(noCancel){this.grid.element.trigger("iggriduisoftdirty",{owner:this});this._currentHeader=header;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);this.grid._trigger(this.grid.events.dataBound,null,{owner:this.grid});this.grid._renderData();if(!apiCall){this._trigger(this.events.columnSorted,null,{columnKey:colKey,direction:s.currentSortDirection,owner:this})}}this._curColKey=colKey;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,index,columnKey,ignoreActiveSelection){var oldHeight=null,span,col,indicatorContainer,visualIndex,indexResolved,i,tmpIndexResolved,currentColumnSetting,columnOption=this.grid.options.columns[index],dataSkipColumnCount=0,isFixed,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.virtualizationMode==="fixed"&&(this.grid.options.virtualization===true||this.grid.options.columnVirtualization===true)){visualIndex=index-this.grid._startColIndex}else{visualIndex=index}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);dataSkipColumnCount=header.closest("thead").find(".ui-iggrid-header[data-skip=true]").length;indexResolved=visualIndex+dataSkipColumnCount+1;tmpIndexResolved=indexResolved;for(i=0;i<this.grid.options.columns.length;i++){if(i+dataSkipColumnCount<indexResolved&&this.grid.options.columns[i].hidden){tmpIndexResolved--}}indexResolved=tmpIndexResolved;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}}}else{currentColumnSetting=this.options.columnSettings[index]}if(hasFixedColumns){if(columnOption){columnKey=columnOption.key;isFixed=columnOption.fixed===true}else if(currentColumnSetting){columnKey=currentColumnSetting.columnKey;isFixed=this.grid.columnByKey(columnKey).fixed===true}indexResolved=this._columnFixing._getVisibleIndex(columnKey,isFixed)+1}if(hasFixedColumns&&this.grid._isFixedElement(header)){col=$("#"+this.element[0].id+"_fixed tbody tr td:nth-child("+indexResolved+")")}else{if(hasFixedColumns&&!columnOption&&!currentColumnSetting){indexResolved-=this.grid._fixedColumns.length}if(this.grid.options.fixedHeaders!==true){col=header.closest("thead").parent().find("tbody tr td:nth-child("+indexResolved+")")}else if(this.options.applySortedColumnCss!==false){col=this.grid.element.find("tr td:nth-child("+indexResolved+")")}}if(currentColumnSetting!==undefined&&currentColumnSetting.currentSortDirection!==undefined&&(!columnOption||columnOption&&columnOption.hidden!==true)){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);if(this.options.applySortedColumnCss!==false&&ignoreActiveSelection!==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);if(this.options.applySortedColumnCss!==false&&ignoreActiveSelection!==true){col.removeClass(this.css.ascendingColumn).addClass(this.css.descendingColumn)}}}else{header.attr("title",this.options.unsortedColumnTooltip);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.sortableColumnHeaderActive).removeClass(this.css.sortableColumnHeaderFocus).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(){var settings=[],key,cs=this.options.columnSettings,i,j,k,colIndex=0,defaultExpressions=[],defExpLength,isToSkipGroupBySortingExpr=false,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"){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]}}}}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];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,dir:cs[i][key].startsWith("asc")?"asc":"desc"})}else{defaultExpressions.push({fieldIndex:settings[j].columnKey,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"}}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);$(ui.th).wrapInner('<a href="#"></a>');if(cs.currentSortDirection!==undefined){this._applySortStyles(ui.th,cs.columnIndex)}}else{$(ui.th).wrapInner('<a href="#"></a>')}}if(!this._featureChooserInitialized&&featureChooserInstance){this._featureChooserInitialized=true;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");if(!featureChooserInstance){return}featureChooserInstance._setSelectedState("SortingDescending",columnKey,false,false);if(isSelected){this.sortColumn(columnKey,"asc")}else{this.unsortColumn(columnKey)}},_sortDescFromFeatureChooser:function(event,columnKey,isSelected){var featureChooserInstance=this.grid.element.data("igGridFeatureChooser");featureChooserInstance._setSelectedState("SortingAscending",columnKey,false,false);if(!featureChooserInstance){return}if(isSelected){this.sortColumn(columnKey,"desc")}else{this.unsortColumn(columnKey)}},_columnFixed:function(args){var i,colInd=args.colInd,cs,fixedTable=this.grid.fixedHeadersTable(),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){this.options.columnSettings.splice(colInd,1);this.options.columnSettings.splice(fixedColumnsLength-1,0,cs)}for(i=0;i<this.options.columnSettings.length;i++){this.options.columnSettings[i].columnIndex=i}},_columnsRearranged:function(event,ui){this._initDefaultSettings()},_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});this._shouldFireColumnSorted=false}this._loadingIndicator.hide();if(this._currentIndex!==undefined&&this._currentIndex!==null&&this._currentHeader!==undefined&&this._currentHeader!==null){this._applySortStyles(this._currentHeader,this._currentIndex)}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}col=$("#"+gridId+"_"+colKey);col.addClass(this.css.sortableColumnHeaderActive);this._currentActiveHeader=col;ignoreActiveSelection=true;if(i+1===expr.length){ignoreActiveSelection=false}this._applySortStyles(col,col.data("columnIndex"),colKey,ignoreActiveSelection)}}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.element.attr("id")+"_scrollContainer").scrollTop(0)}},_onUIDirty:function(e,args){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._currentIdentifier=null;this._currentIndex=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(resetAll){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,i)}header.removeClass(this.css.sortableColumnHeaderActive).removeClass(this.css.sortableColumnHeaderHover).removeClass(this.css.sortableColumnAscending).removeClass(this.css.sortableColumnDescending).addClass(this.grid.css.headerClass);if(!header.hasClass(this.grid.css.headerCellFeatureEnabledClass)){header.addClass(this.grid.css.headerCellFeatureEnabledClass)}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).removeClass(this.css.sortableColumnAscending).removeClass(this.css.sortableColumnDescending).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,i)}}}},_columnsCollectionModified:function(event,args){if(args.owner.element.attr("id")!==this.grid.element.attr("id")){return}var i,j,found,colKey,cs,col,colApplySelection,indexApplySelection;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,col.data("columnIndex"),colKey,true)}}}if(this._currentIdentifier){if($.type(this._currentIdentifier)==="number"){if(this._currentIndex!==undefined&&this._currentIndex!==null&&this._currentHeader!==undefined&&this._currentHeader!==null){this._applySortStyles(this._currentHeader,this._currentIndex)}}else{colApplySelection=$("#"+this.grid.element[0].id+"_"+this._currentIdentifier);indexApplySelection=colApplySelection.data("columnIndex");if($.type(indexApplySelection)==="number"){this._applySortStyles(colApplySelection,indexApplySelection,this._currentIdentifier)}}}$("#"+this.element[0].id+" thead th").removeClass(this.css.sortableColumnHeaderHover)},destroy:function(){var i,a,header,span,text,modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog");if(!this.grid){return}$("#"+this.element[0].id).undelegate("thead th","dragstart",this._dragStartHandler);$("#"+this.element[0].id).undelegate("thead th","mouseover",this._mouseOverHandler);$("#"+this.element[0].id).undelegate("thead th","mouseout",this._mouseOutHandler);$("#"+this.element[0].id).undelegate("thead th","click",this._clickHandler);$(document).undelegate("#"+this.element[0].id+"_headers thead th","dragstart",this._dragStartHandler);$(document).undelegate("#"+this.element[0].id+"_headers thead th","mouseover",this._mouseOverHandler);$(document).undelegate("#"+this.element[0].id+"_headers thead th","mouseout",this._mouseOutHandler);$(document).undelegate("#"+this.element[0].id+"_headers thead th","click",this._clickHandler);$("#"+this.element[0].id).undelegate("thead th a","keydown",this._keyDownHandler);$("#"+this.element[0].id).undelegate("thead th a","focus",this._focusHandler);$("#"+this.element[0].id).undelegate("thead th a","blur",this._blurHandler);$(document).undelegate("#"+this.element[0].id+"_headers thead th a","keydown",this._keyDownHandler);$(document).undelegate("#"+this.element[0].id+"_headers thead th a","focus",this._focusHandler);$(document).undelegate("#"+this.element[0].id+"_headers thead th a","blur",this._blurHandler);$("#"+this.element[0].id).undelegate("thead th a:not([th-remove-focus])",{keydown:this._keyDownHandler,focus:this._focusHandler,blur:this._blurHandler});$(document).undelegate("#"+this.element[0].id+"_headers thead th a:not([th-remove-focus])",{keydown:this._keyDownHandler,focus:this._focusHandler,blur:this._blurHandler});this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler);this.grid.element.unbind("iggriduidirty",this._uiDirtyHandler);this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.unbind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler);this.grid.element.unbind("iggridcolumnmovingcolumnmoved",this._columnsRearangedHandler);if(this._featureChooserMenuTogglingHandler){this.grid.element.unbind("iggridfeaturechoosermenutoggling",this._featureChooserMenuTogglingHandler)}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");$("<span>"+text+"</span>").appendTo(header).addClass("ui-iggrid-headertext");a.remove()}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,self=this,o=this.options,modalDialogId=this.grid.element[0].id+"_multiplesorting_modalDialog",$captionButtonContainer,modalDialog;$("#"+modalDialogId).remove();modalDialog=$("<div></div>").appendTo(this.grid._rootContainer()).attr("id",modalDialogId);modalDialog.igGridModalDialog({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(event,args){return self._trigger(self.events.modalDialogClosing,null,{modalDialogElement:modalDialog,owner:self})},modalDialogClosed:function(event,args){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)})}},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||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(e,args){$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></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,args){self._currentIdentifier=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({click:function(e,args){var noCancel,modalDialog=$("#"+self.grid.element[0].id+"_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)}else{self._setTempExpr(columnIdentifier)}self._renderDialogUnsortedColumn(column,columnIndex,direction,columnIdentifier);if(self._checkRenderButtonReset()){self._renderDialogButtonClearAll()}else{self.removeDialogClearButton()}}e.preventDefault();e.stopPropagation()},mouseover:function(e,args){if(!$(this).hasClass(css.dialogButtonsHover)){$(this).addClass(css.dialogButtonsHover)}},mouseout:function(e,args){if($(this).hasClass(css.dialogButtonsHover)){$(this).removeClass(css.dialogButtonsHover)}}})},_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,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({click:function(e,args){var noCancel,modalDialog=$("#"+self.grid.element[0].id+"_multiplesorting_modalDialog");noCancel=self._trigger(self.events.modalDialogSortClick,e,{modalDialogElement:modalDialog,owner:self,columnKey:columnIdentifier});if(noCancel){$li.remove();self._renderDialogSortedColumn(column,columnIndex,direction,columnIdentifier);if(o.modalDialogSortOnClick){self.sortColumn(columnIdentifier,null,self._getHeaderCellByIdentifier(columnIdentifier))}else{if(self._checkRenderButtonReset()){self._renderDialogButtonClearAll()}else{self.removeDialogClearButton()}}}e.preventDefault();e.stopPropagation()}})},_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"){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"){self._tempExpr.push({fieldName:cs[i].columnKey,dir:cs[i].userSet_currentSortDirection})}}self.renderMultipleSortingDialogContent(false);self.removeDialogClearButton();self._isResetClick=true}}})}},_multiplesortingDialogButtonOKClick:function(e,args){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}},_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){this.grid=gridInstance;var restoreSortingExpr;if(this.options.type===null){this.options.type=this.grid._inferOpType()}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]}}if(this._headerCellRenderedHandler!==null&&this._headerCellRenderedHandler!==undefined){this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler)}if(this._uiDirtyHandler){this.grid.element.unbind("iggriduidirty",this._uiDirtyHandler)}if(this._headerRenderedHandler!==null&&this._headerRenderedHandler!==undefined){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler)}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("iggridcolumnmovingcolumnmoved",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._currentIndex=null;this._currentIdentifier=null;if(this.options.persist){this._preserveSorting()}}});$.extend($.ui.igGridSorting,{version:"14.1.20141.1020"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Column Summaries 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 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.igGridSummaries",{grid:null,css:{columnSummariesDropdown:"ui-iggrid-summaries-dialog",footerRowTextContainer:"ui-iggrid-summaries-footer-text-container",footerRowIconContainer:"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-corner-all ui-iggrid-filterbuttonhover ui-state-hover",footerButtonIconActive:"ui-iggrid-filterbuttonactive ui-corner-all 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,columnSettings:[{allowSummaries:true,columnKey:null,columnIndex:-1,summaryOperands:[{rowDisplayLabel:"",type:"custom",active:true,summaryCalculator:null,order:5,decimalDisplay:2,isGridFormatter: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;if(compactRenderingMode==="true"){compactRenderingMode=true}else if(compactRenderingMode==="false"){compactRenderingMode=false}this.options.compactRenderingMode=compactRenderingMode},_initColumnSettings:function(){var settings=[],i,j,k,l,cs=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}$.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;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()}$.Widget.prototype.destroy.call(this);return this},_detachEvents:function(){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.unbind("iggridfooterrendered",this._footerRenderedHandler);this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.unbind("iggridheaderextracellsmodified",this._headerFooterInitHandler);this.grid.element.unbind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler);this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler);this.grid.element.unbind("iggridupdatingeditrowended",this._rowUpdatedHandler);this.grid.element.unbind("iggridupdatinginternalrowdeleted",this._rowUpdatedHandler);this._headerRenderedHandler=null;this._footerRenderedHandler=null;this._gridRenderedHandler=null;this._headerCellRenderedHandler=null;this._columnsCollectionModifiedHandler=null;this._virtualHorizontalScrollHandler=null},_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){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()}},_rowUpdated:function(){if(this.grid.options.autoCommit&&this._isRenderedSummariesRows){this.calculateSummaries()}},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,newHeight,hasVScrollbar,oS;if(gridHeight===null||gridHeight===undefined){return}if(this._isVirtualization()===true){newHeight=parseInt(this.grid.options.height,10)-parseInt($("#"+this._id("footer","container")).height(),10);$("#"+this.grid.element[0].id).height(newHeight);$("#"+this.grid.element[0].id+"_displayContainer").height(newHeight);$("#"+this.grid.element[0].id+"_scrollContainer").height(newHeight);grid._initializeHeights();if(this.grid.options.virtualizationMode==="fixed"){oS=grid._scrollContainer().scrollTop();grid._buildVirtualDom();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();hasVScrollbar=!(grid.options.autoAdjustHeight&&grid.element.height()<=$("#"+grid.element[0].id+"_scroll").height()||!grid.options.autoAdjustHeight&&grid.options.avgRowHeight*grid.element[0].rows.length<parseInt(grid.options.height,10));if(hasVScrollbar!==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()}}if(hasFixedColumns){this._syncFixedUnfixedRowHeights()}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()}}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,$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="'+'"></a>');$button.data("columnKey",columnKey);$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(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(event,true)},_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(event,explicitClose){var $target=$(event.target),columnKey,$dialog,top,left,self,isVisible,rOffset;columnKey=$target.data("columnKey");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,true)}if(isVisible===true){self._currentOpenedColumnKey=null}else{self._currentOpenedColumnKey=columnKey}self.showHideDialog($dialog,explicitClose)},showHideDialog:function($dialog,explicitClose){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,true)},_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","#").attr("id",buttonId).attr("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;if(isToShow===true){$hScroller=$("#"+this.grid.id()+"_horizontalScrollContainer");if($hScroller.length>0){hScrollerLeft=$hScroller.scrollLeft();$hScroller.scrollLeft(0)}this.calculateSummaries();if(hScrollerLeft){setTimeout(function(){$hScroller.scrollLeft(hScrollerLeft)},0)}this.grid._scrollFooter();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=this.grid.element.data("igGridFeatureChooser");if(fc!==null&&fc!==undefined){fc._toggleSelectedItems("Summaries",!isToShow)}}},_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,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",0).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}}onClick=function(event){self.toggleCheckstate($(event.currentTarget));if(self._activeDialog){self._activeDialog.data("focussed",true);self._activeDialog.focus()}self._trigger(self.events.summariesMethodSelectionChanged,event,{columnKey:columnKey,isSelected:$(event.currentTarget).attr("data-chk").toLowerCase()==="on",methodName:$(event.currentTarget).data("methodName"),owner:this});if(o.calculateRenderMode==="onselect"){self._calculateSelectedSummaries(columnKey)}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(event){$dialog.data("focussed",false);setTimeout($.proxy(self._checkCloseDropDown,self),300)},focus:function(event){$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(event,event.keyCode===$.ui.keyCode.ESCAPE);if(self._summariesRows.length>0){$("#"+self._id("summaries","footer_row_button_dd",self._summariesRows[0].type,columnKey)).focus()}}}});onFocusLi=function(event){if(self._activeDialog){self._activeDialog.data("focussed",true)}};onBlurLi=function(e){if(self._activeDialog){self._activeDialog.data("focussed",false)}setTimeout($.proxy(self._checkCloseDropDown,self),300)};onKeydownLi=function(event){var $liFocused=$(this);if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){event.currentTarget=$("#"+$liFocused.data("checkboxId"));onClick(event);$liFocused.focus();event.stopPropagation();event.preventDefault()}};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",0);$li.bind({focus:onFocusLi,blur:onBlurLi,keydown:onKeydownLi});$('<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)).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(event){if(self._activeDialog){self._activeDialog.data("focussed",true)}},blur:function(e){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)).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(event){if(self._activeDialog){self._activeDialog.data("focussed",true)}},blur:function(e){if(self._activeDialog){self._activeDialog.data("focussed",false)}setTimeout($.proxy(self._checkCloseDropDown,self),300)}})}$dialog.data("columnKey",columnKey)},_checkCloseDropDown:function(){if(this._activeDialog===null){return}if(this._activeDialog.data("focussed")===false){setTimeout($.proxy(this._closeDropDown,this),10)}},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)},_clickCancelButton:function(columnKey){this._trigger(this.events.dropDownCancelClicked,null,{columnKey:columnKey,owner:this});this.showHideDialog($("#"+this._id("summaries","methods_dialog",columnKey)),true)},_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._renderCell(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._renderCell(methodName,columnKey,data[i])}}},_renderCell:function(methodName,columnKey,data){var resultTemplate=this.options.resultTemplate,column,autoFormat=this.grid.options.autoFormat,res=data.result,i,format,oRes=res,value,isToFixFloat=false,summaryOperand=data.type,rowDisplayLabel=data.rowDisplayLabel,isGridFormatter=data.isGridFormatter,dataType=data.dataType,defaultDecimalDisplay=this.options.defaultDecimalDisplay,decimalDisplay=data.decimalDisplay,isNumber=this._isNumber(res);if(isNumber&&dataType==="bool"){isGridFormatter=false}if(isNumber===true){if(decimalDisplay===undefined||decimalDisplay===null){if(defaultDecimalDisplay!==null&&defaultDecimalDisplay!==undefined){decimalDisplay=defaultDecimalDisplay;isToFixFloat=true}}else{isToFixFloat=true}res=parseFloat(res);if(isToFixFloat&&decimalDisplay>=0){if((autoFormat===true||autoFormat==="dateandnumber")&&dataType||autoFormat&&autoFormat===dataType){format="0.";for(i=0;i<decimalDisplay;i++){format+="0"}if(summaryOperand==="count"){dataType="number"}else{isToFixFloat=false}if(decimalDisplay===0){res=oRes}else{res=$.ig.formatter(oRes,dataType,format)}}else{res=res.toFixed(decimalDisplay);if(summaryOperand!=="count"){isToFixFloat=false}}}}value=res;if(isGridFormatter===true||isGridFormatter===undefined&&this.options.isGridFormatter===true){column=this._getGridColumnFor(columnKey);if(column!==null){if(dataType==="date"&&isNumber&&(summaryOperand==="min"||summaryOperand==="max")){value=new Date(parseInt(value,10))}if(!isToFixFloat||dataType==="date"){res=this.grid._renderCell(value,column)}value=res}}else if(value===null||value===undefined){value=""}else if(dataType==="date"&&isNumber&&(summaryOperand==="min"||summaryOperand==="max")){value=new Date(parseInt(value,10))}if(resultTemplate){res=resultTemplate.replace("{0}",rowDisplayLabel).replace("{1}",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>").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._syncFixedUnfixedRowHeights()}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])}}},_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,isRebind){this.grid=gridInstance;if(this.options.type===null){this.options.type=this.grid._inferOpType()}if(this._headerRenderedHandler!==null&&this._headerRenderedHandler!==undefined){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler)}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._rowUpdatedHandler=$.proxy(this._rowUpdated,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("iggridupdatingeditrowended",this._rowUpdatedHandler);this.grid.element.bind("iggridupdatinginternalrowdeleted",this._rowUpdatedHandler);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:"14.1.20141.1020"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Tooltips 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.3.js
 *	modernizr.js
 *	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}],fadeTimespan:150,cursorLeftOffset:10,cursorTopOffset:15},css:{tooltip:"ui-iggrid-tooltip",tooltipContent:"ui-iggrid-tooltip-content"},events:{tooltipShowing:"tooltipShowing",tooltipShown:"tooltipShown",tooltipHiding:"tooltipHiding",tooltipHidden:"tooltipHidden"},_createWidget:function(options,element){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){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("mouseenter."+this.grid.id()).unbind("mouseleave."+this.grid.id())}}if(this.ruler){if(this.ruler.data("users")===1){this.ruler.remove()}else{this.ruler.data("users",this.ruler.data("users")-1)}}$.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']");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})}this.tooltip.data("users",1)}if(this.options.style==="tooltip"){this.tooltip.children("[id$='_content']").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()},_dataRendered:function(event,ui){var $tbody,$tbodyFixed;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()){$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")}},_rowsRendering:function(evt,args){var tbody;if(args.owner.id()!==this.grid.id()){return}tbody=this.grid.element.find("tbody");tbody.unbind("mouseleave.tooltip");tbody.unbind("mousemove.tooltip")},_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)},_registerMouseEvents:function(tbody){tbody.bind("mouseleave.tooltip",this._gridMouseLeaveHandler);tbody.bind("mousemove.tooltip",this._gridMouseMoveHandler)},_gridMouseLeave:function(event,ui){clearTimeout(this.timeoutShowing);clearTimeout(this.timeoutHiding);if(this.tooltip.css("display")!=="none"){this._hideTooltip(true)}this._currentlyHovered=null},_gridMouseMove:function(event,ui){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;this.mouseY=event.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},_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=element.closest("tbody").children("tr:not([data-container='true'],[data-grouprow='true'])").index(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.grid.dataSource.dataView()[this._rowIdx]!==undefined){val=this.grid.dataSource.dataView()[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,realIdx,dataIdx,hasFixedColumns=this.grid.hasFixedColumns();switch(this.options.visibility){case"always":break;case"never":shouldShow=false;break;case"overflow":shouldShow=this._displayOverflow(element);break}if(shouldShow===false){return false}realIdx=element.index();dataIdx=element.parent().children("td:not([data-parent='true'],[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=realIdx}if(this._columnIdx<0||this._columnIdx>=this.grid.options.columns.length){return false}this._pColumnKey=this._columnKey;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._currentlyDisplayed).width());this._positionTooltip(tooltipContent.parent())},_positionTooltip:function(tooltip){var win=$(window),left,top,tfullw=tooltip.outerWidth(),tfullh=tooltip.outerHeight(),toffset;toffset=$.ig.util.getRelativeOffset(tooltip);left=this.mouseX-toffset.left+this.options.cursorLeftOffset-win.scrollLeft();top=this.mouseY-toffset.top+this.options.cursorTopOffset-win.scrollTop();if(left+tfullw>win.width()){left=win.width()-tfullw}if(top+tfullh>win.height()){top=win.height()-tfullh}tooltip.css({top:top+win.scrollTop(),left:left+win.scrollLeft()})},_columnFixed:function(args){var $tbodyFixed;if(this.grid.hasFixedColumns()){$tbodyFixed=this.grid.fixedTable().find("tbody");this._registerMouseEvents($tbodyFixed)}},_createHandlers:function(){this._dataRenderedHandler=$.proxy(this._dataRendered,this);this._rowsRenderedHandler=$.proxy(this._rowsRendered,this);this._rowsRenderingHandler=$.proxy(this._rowsRendering,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("iggrid_rowsrendering.tooltip",this._rowsRenderingHandler);this.grid.element.bind("iggridrendered.tooltip",this._dataRenderedHandler);this.grid.element.bind("iggridrowsrendered.tooltip",this._rowsRenderedHandler);this.grid.element.bind("iggridheaderrendering.tooltip",this._gridHeaderRenderingHandler)},_unregisterGridEvents:function(){this.grid.element.unbind("iggrid_rowsrendering.tooltip",this._rowsRenderingHandler);this.grid.element.unbind("iggridrendered.tooltip",this._dataRenderedHandler);this.grid.element.unbind("iggridrowsrendered.tooltip",this._rowsRenderedHandler);this.grid.element.unbind("iggridheaderrendering.tooltip",this._gridHeaderRenderingHandler)}});$.extend($.ui.igGridTooltips,{version:"14.1.20141.1020"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Grid Editing 14.1.20141.1020
*
* Copyright (c) 2011-2014 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.validator.js
* infragistics.ui.combo.js
* infragistics.ui.rating.js
* infragistics.ui.shared.js
* infragistics.dataSource.js
* infragistics.util.js
*/
(function($){var _aNull=function(v,nan){return v===null||v===undefined||v==="undefined"||nan&&isNaN(v)},_int=function(e,val){val=e?e.css(val):0;try{val=parseInt(val,10)}catch(ignore){}return val&&!isNaN(val)?val:0},_filter=function(elem,name,p1,p2){elem=elem.data("igEditorFilter");return elem?elem.options.provider[name](p1,p2):null},_now=function(){return(new Date).getTime()},_throw=function(def){var str=$.ig.GridUpdating&&$.ig.GridUpdating.locale?$.ig.GridUpdating.locale[def]:def;throw new Error(str||def)},_stop=function(e){if(e&&e!==1){try{e.preventDefault();e.stopPropagation()}catch(ignore){}}};$.widget("ui.igGridUpdating",{grid:null,options:{columnSettings:[{columnKey:null,editorType:null,editorProvider:null,editorOptions:null,required:null,readOnly:null,validation:null,defaultValue:null}],editMode:"row",showReadonlyEditors:true,enableDeleteRow:true,enableAddRow:true,validation:false,doneLabel:null,doneTooltip:null,cancelLabel:null,cancelTooltip:null,addRowLabel:null,addRowTooltip:null,deleteRowLabel:null,deleteRowTooltip:null,rowEditDialogCaptionLabel:null,showDoneCancelButtons:true,enableDataDirtyException:true,rowEditDialogContentHeight:150,rowEditDialogFieldWidth:140,rowEditDialogWidth:370,rowEditDialogHeight:"350",startEditTriggers:"click,F2,enter",rowEditDialogContainment:"owner",rowEditDialogOkCancelButtonWidth:120,rowEditDialogRowTemplate:null,rowEditDialogRowTemplateID:null,horizontalMoveOnEnter:false,excelNavigationMode:false,saveChangesSuccessHandler:null,saveChangesErrorHandler:null,swipeDistance:"100px"},events:{editRowStarting:null,editRowStarted:null,editRowEnding:null,editRowEnded:null,editCellStarting:null,editCellStarted:null,editCellEnding:null,editCellEnded:null,rowAdding:null,rowAdded:null,rowDeleting:null,rowDeleted:null,dataDirty:null,generatePrimaryKeyValue:null,rowEditDialogOpening:null,rowEditDialogOpened:null,rowEditDialogContentsRendering:null,rowEditDialogContentsRendered:null,rowEditDialogClosing:null,rowEditDialogClosed:null},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",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",rowEditDialogOkCancelButton:"ui-dialog-buttonpane ui-widget-content ui-helper-clearfix ui-iggrid-filterdialogokcancelbuttoncontainer",rowEditDialogTable:"ui-iggrid-filtertable ui-helper-reset"},setCellValue:function(rowId,colKey,value,tr){var $tr,$td,tdi;if(!_aNull(rowId)&&typeof colKey==="string"){$tr=tr?$(tr):this.grid.element.children("tbody").children('tr[data-id="'+rowId+'"]');if($tr.length!==1){$tr=1;$td=$()}else{tdi=this.grid._getCellIndexByColumnKey(colKey);$td=tdi>=0?$tr.children().eq(tdi):$();$tr=$tr[0]}if(this.isEditing()&&this._tds[colKey]&&$td.find(".ui-igedit,.ui-igcombo").length>0&&this.editorForKey(colKey)instanceof jQuery){if(this.editorForKey(colKey).data().hasOwnProperty("igCombo")){this.editorForKey(colKey).igCombo("value",value)}else{this.editorForKey(colKey).igEditor("value",value)}this._notifyChanged()}else{this._update(rowId,$tr,value,colKey,$td)}}},updateRow:function(rowId,values,tr){var key;if(!_aNull(rowId)&&values){tr=tr||this.grid.element.children("tbody").children('tr[data-id="'+rowId+'"]')[0]||1;if(this.isEditing()&&$(tr).find(".ui-igedit,.ui-igcombo").length>0){for(key in values){if(values.hasOwnProperty(key)&&this.editorForKey(key)instanceof jQuery){if(this.editorForKey(key).data().hasOwnProperty("igCombo")){this.editorForKey(key).igCombo("value",values[key])}else{this.editorForKey(key).igEditor("value",values[key])}}}this._notifyChanged()}else{this._update(rowId,tr,values)}}},addRow:function(values){values=values||{};var cols=this.options.columnSettings,i=cols?cols.length:0,key,val;while(i-->0){key=cols[i].columnKey;val=cols[i].defaultValue;if(!_aNull(val)&&!_aNull(key)){if(_aNull(values[key])){values[key]=val}}}this._update(values)},deleteRow:function(rowId,tr){if(!_aNull(rowId)){tr=tr||this.grid.element.children("tbody").children('tr[data-id="'+rowId+'"]')[0]||1;if(this.isEditing()&&$(tr).find(".ui-igedit,.ui-igcombo").length>0){this.endEdit(false)}this._update(rowId,tr)}},startEdit:function(row,col,e){var td=this.grid.cellAt(col,row),tr;if(this.options.editMode==="rowedittemplate"){tr=this.grid.rowAt(row);return this._startEditRowTemplate(e,$(tr))}if(td){td=this._startEdit($(td),e||1,1)===1}return!!td},startAddRowEdit:function(e){var tr=this._newTR,h,hasFixedColumns=this.grid.hasFixedColumns();if(this.options.editMode==="rowedittemplate"){return this._startEditRowTemplate(e,null,null,true)}if(tr){if(e&&e.target&&hasFixedColumns){if(this.grid._isFixedElement($(e.target))){tr=$(e.target).closest("thead").find("tr[data-new-row]")}}tr=this._startEdit($(tr.children()[0]),e||1,1,1,this._addTR.children()[0].offsetHeight)===1;if(this._newTR&&hasFixedColumns){if($.ig.util.isIE){h=this._addTR.outerHeight()}else{h=this._addTR.height()}this.grid.fixedContainer().find("thead tr[data-new-row]").height(h);this.grid.container().find("thead tr[data-new-row]").height(h);$(tr).height(h)}}return!!tr},endEdit:function(update,e){if(this.options.editMode==="rowedittemplate"){return update?this._rowEditDialogDoUpdate(e):this._closeRowEditDialog(e)}return!this._endEdit(e||1,update)},findInvalid:function(){var key,all=this._editors;for(key in all){if(all.hasOwnProperty(key)&&all[key]&&!_filter(all[key],"isValid")){return key}}return null},isEditing:function(){return!!this._tds},editorForKey:function(key){var e=this._editors;return e?e[key]:null},editorForCell:function(td,add){var e,key=this._key(td),edits=this._editors;if(!edits){edits=this._editors={}}e=edits[key];if(!e&&add){e=edits[key]=this._createEditor(td,key)}return e},findHiddenComboEditor:function(editor){var combos=this._hCombos,combo=combos&&editor?editor.data("igCombo"):null,hComboID=combo?combo.options._hComboID:null,obj=hComboID?combos[hComboID]:null;combo=obj?obj.combo.data("igCombo"):null;if(combo){combo._colKey=obj.key}return combo},_setOption:function(key,value){var o=this.options;if(o[key]===value){return this}this._endEdit();this._doButtons(2);o[key]=value;if(key.indexOf("ddRow")>0){this._headerRendered();this.grid._initializeHeights();if(this.grid.options.virtualization===true||this.grid.options.rowVirtualization===true){this.grid._onVirtualVerticalScroll()}}else if(key==="saveChangesSuccessHandler"){this._addDSSuccessHandler()}else if(key==="saveChangesErrorHandler"){this._addDSErrorHandler()}return this},_fire:function(name,e,a){if(a&&e&&e!==1){a.owner=this;return this._trigger(name,e,a)}return 1},_loc:function(prop,title){prop+=title?"Tooltip":"Label";title=this.options[prop];if(_aNull(title)){title=$.ig.GridUpdating&&$.ig.GridUpdating.locale?$.ig.GridUpdating.locale[prop]:null}return title||""},_div:function(){return this.grid.container()},_hscroll:function(scroller){if(!this._hscr1){var grid=this.grid.element;this._hscr1=$("#"+grid[0].id+"_hscroller");this._hscr2=this._hscr1.length?this._hscr1:grid.parent()}return scroller?this._hscr1:this._hscr2},_groupedColumnsChanged:function(args){this._groupCols=args.groupedColumns.length;this._hidingFinishing();this._headerRendered()},_headerRendered:function(i){var th,txt,title,me=this,grid=me.grid,hasFixedCols=grid.hasFixedColumns(),tr=me._addTR,o=me.options,cols=grid.options.columns,len=cols.length,fCols,ufCols;if(!o.enableAddRow||i===1){if(tr){tr.remove();me._newTR.remove();me._hierTD=me._newTR=me._addTR=null;if(this.grid.hasFixedColumns()){this.grid.fixedHeadersTable().find("thead tr[data-add-row]").remove();this.grid.fixedHeadersTable().find("thead tr[data-new-row]").remove();this.grid.element.data("igGridColumnFixing")._syncContainerHeights()}}return}txt=me._loc("addRow")||"&nbsp;";title=me._loc("addRow",1);if(tr){tr.find(".anr_t").html(txt);tr.find(".ui-iggrid-addrow").attr("title",title);tr.find(".anr_i").css("display","inline-block")}th=me._div().find("thead");if(!th||tr){return}if(hasFixedCols){fCols=[];ufCols=[];for(i=0;i<len;i++){if(cols[i].fixed===true){fCols.push(cols[i])}else{ufCols.push(cols[i])}}th=me._div().find("div[data-fixed-container]").find("thead");cols=ufCols;this._headerRenderedHelper(fCols,th,txt,title);th=me._div().find("div:not([data-fixed-container])").find("thead")}this._headerRenderedHelper(cols,th,txt,title)},_headerRenderedHelper:function(cols,th,txt,title){var i,plus,td,col,colSet,me=this,css=me.css,shift=me._addTrShift,colSpan=0,tr=me._addTR,o=me.options,grid=me.grid,len=cols.length,hiddenColumns=grid._initialHiddenColumns||[],hiddenKeys=[];plus=o.showPlusIcon;tr=me._addTR=$("<tr />").addClass(css.addRow).attr("data-skip","true").attr("data-add-row","true").appendTo(th);if(shift){for(i=0;i<shift.length;i++){$(shift[i]).appendTo(tr)}}else{me._hierOn=_now();grid._headerInit(tr);me._hierTD=tr.children().length}for(i=0;i<len;i++){if(!cols[i].hidden){colSpan++}else{hiddenKeys.push(cols[i].key)}}for(i=0;i<hiddenColumns.length;i++){if($.ig.indexInArray(hiddenKeys,hiddenColumns[i].key)===-1){hiddenKeys.push(hiddenColumns[i].key);colSpan--}}if(me._groupCols){me._groupTD1=$("<td />").addClass("ui-iggrid-rowselector-header").attr("data-skip","true").appendTo(tr)}td=$('<td colspan="'+colSpan+'"></td>').attr("title",title).addClass(css.addRow).appendTo(tr);me._addLeft=_int(td,"paddingLeft");$("<span />").css("display","inline-block").addClass(css.addRowIcon).addClass("anr_i").appendTo(td);$("<span>"+txt+"</span>").addClass("anr_t").css("outline",0).attr("tabIndex",me._ti+1).focus(function(e){me._onEvt(e,5)}).blur(function(e){me._onEvt(e,6)}).appendTo(td);tr=me._newTR=$("<tr />").attr("data-skip","true").attr("data-new-row","true").appendTo(th).hide();shift=this._newTrShift;if(shift){for(i=0;i<shift.length;i++){$(shift[i]).appendTo(tr)}}else{grid._headerInit(tr)}if(me._groupCols){me._groupTD2=$("<td />").addClass("ui-iggrid-rowselector-header").attr("data-skip","true").appendTo(tr)}for(i=0;i<len;i++){col=cols[i];if(!col.hidden&&$.ig.indexInArray(hiddenKeys,col.key)===-1){colSet=me._colSet(0,col?col.key:null);plus=colSet&&colSet.readOnly;txt=plus?colSet.defaultValue:null;txt=_aNull(txt)?"&nbsp;":grid._renderCell(txt,col);td=$("<td>"+txt+"</td>").addClass(css.editingCell).appendTo(tr);if(plus&&col&&col.key===grid.options.primaryKey){me._tdAddPrime=td}}}},_hierGridInDiv:function(){var css,kids,len,elem,extra=0,i=-1,tr=this._newTR,trA=this._addTR;kids=tr.parent().children();while(++i<kids.length){if(kids[i]!==trA[0]&&kids[i]!==tr[0]){break}}if(i>kids.length){return}kids=kids[i].childNodes;len=kids.length;for(i=0;i<len;i++){elem=kids[i];css=elem.getAttribute("data-skip")?elem.className:null;if(css&&(css.indexOf("-expand")>=0||css.indexOf("-rowselector")>=0)){extra++}else{break}}kids=tr.children();len=kids.length;for(i=0;i<len;i++){elem=kids[i];if(elem.getAttribute("data-skip")){extra--}else{break}}while(extra-->0){this.grid._headerInit(tr,null,true);this.grid._headerInit(trA,null,true)}},_hierHeaderInit:function(){var i,me=this,on=me._hierOn,tr=me._addTR;if(!tr||!on||_now()-on>200){return}if(me._hierTD){setTimeout(function(){me._hierGridInDiv()},0);setTimeout(function(){me._hierGridInDiv()},200);return}i=tr.children().length;me.grid._headerInit(tr,null,true);me.grid._headerInit(me._newTR,null,true);me._hierTD=tr.children().length-i},_dataRendered:function(){if(this._wasInit){return}this._scrollDiv();if(this._renderTouchUI&&this.options.editMode!=="row"){this._div().bind(this._tEvts);delete this._evts.mousemove;delete this._evts.mouseleave}this._div().bind(this._evts);this._wasInit=true},_findCell:function(e){var i=0,td=$(e),grid=this.grid.element[0];if(this.grid.hasFixedColumns()&&td.closest("div").attr("data-fixed-container")!==undefined){grid=$("#"+this.grid.id()+"_fixed")[0]}if(!td.is("td")){td=td.closest("td")}e=td;while(e&&i++<5){e=e.parent();if(e&&e[0]===grid){break}}return i===3&&this._col(td)>=0&&this._row(td)>=0?td:null},_td:function(from){var i,tds=this._tds;if(tds){for(i in tds){if(tds.hasOwnProperty(i)&&tds[i]&&(from?i===from:true)){return tds[i]}}}},_row:function(td){return td?td.parent().index():-1},_idForCol:function(id,shift){var last=-1,map=this._col(1),i=map?map.length:0;while(--i>=0){if(map[i]<0){continue}if(shift===-2){return i}if(map[i]===id){if(shift===1){return last}if(shift===-1){shift=-2}else{break}}last=i}return i},_keyForEditor:function(editor){var ckey;editor=editor instanceof jQuery?editor[0]:editor;for(ckey in this._editors){if(this._editors.hasOwnProperty(ckey)&&this._editors[ckey]&&this._editors[ckey][0]===editor){return ckey}}},_isAdd:function(td){return td===1?this._adding:this._isSrc(this._addTR,td)||this._isSrc(this._newTR,td)},_col:function(td){var col,shift,len,cols,id,i,add=this._isAdd(td),colInd=-1,hasFixedCols=this.grid.hasFixedColumns(),map=add?this._mapAdd:this._map;if(hasFixedCols&&td!==1){col=this.grid._getColumnByTD($(td));if(col!==null){colInd=col.index}}if(!map){shift=this._colShift(td);map=[];id=i=-1;while(shift-->0){map[++i]=-1}cols=this.grid.options.columns;len=cols.length;while(++id<len){if(cols[id]&&!cols[id].hidden){map[++i]=id}}if(add){this._mapAdd=map}else{this._map=map}}if(td===1){return map}if(hasFixedCols&&colInd!==-1){return colInd}id=td.index()+(this.grid._startColIndex||0);return td&&id<map.length?map[id]:-1},_colSet:function(td,key){var i,cols=this.options.columnSettings;if(!key){key=this._key(td)}i=cols&&key?cols.length:0;while(i-->0){if(cols[i].columnKey===key){return cols[i]}}},_isSame:function(td1,td2){return this._row(td1)===this._row(td2)&&this._col(td1)===this._col(td2)},_gridCol:function(key,id){var i=-1,cols=this.grid.options.columns;while(++i<cols.length){if(cols[i].key===key){return id?i:cols[i]}}},_prime:function(td){var key=td.parent().attr("data-id");return _aNull(key)?this._row(td):this._fixPrime(key)},_defVal:function(key,fire){var col;if(key){col=this._colSet(null,key);col=col?col.defaultValue:null;if(fire&&key===this.grid.options.primaryKey){col=this._defValue;if(!col){col={value:col||this._addRowNum};this._fire("generatePrimaryKeyValue",this._evt||{},col);this._defValue=col=col.value}}}return col},_addReadOnly:function(add){var v,key,prime,cols=this.options.columnSettings,vals={};for(key in cols){if(cols.hasOwnProperty(key)){v=cols[key];key=v.columnKey;if(v.readOnly){if(!add){vals[key]=this._getVal(this._row_,key)}else{v=this._defVal(key,1);if(!_aNull(v)){prime=key;vals[prime]=v}}}}}if(!prime&&add){this._fixPrime(vals,this.grid.dataSource)}return vals},_key:function(td){var cols,col;if(this.grid.hasFixedColumns()){col=this.grid._getColumnByTD(td);if(col!==null){return col.column.key}}cols=this.grid.options.columns;col=this._col(td);col=cols&&col>=0?cols[col]:null;return col?col.key:null},_equals:function(v1,v2){return v1===v2||v1&&v2&&v1.getTime&&v2.getTime&&v1.getTime()===v2.getTime()},_val:function(td,arg,vals){var val,add=this._adding,row=this._row_,key=this._key(td);if(add){val=this._defVal(key,vals&&_aNull(vals[key]))}else{val=this._getVal(row,key)}if(arg){if(add||!this._equals(val,arg.value)){if(vals){return arg.value}this._update(row,td.parent()[0],arg.value,key,td)}return undefined}return val},_colShift:function(td,tr){var i,add,shift=this._cShift,shiftAdd=this._cShiftAdd;if(!tr&&td){tr=td.parent()[0]}if(!tr){return shift<0?0:shift}add=this._isAdd(tr);if(add){if(shiftAdd>=0){return shiftAdd}}else if(shift>=0){return shift}tr=tr?tr.childNodes:null;if(!tr){return 0}shift=0;for(i=0;i<tr.length-1;i++){td=tr[i].className;if(td&&(td.indexOf("-expandcolumn")>=0||td.indexOf("-rowselector")>=0)||tr[i].getAttribute("data-skip")){shift++}else{break}}if(add){this._cShiftAdd=shift}else{this._cShift=shift}return shift},_cur:function(td,i){return{tbl:td.parent().parent().parent(),row:i?this._rowIndex:this._row(td),col:this._col(td)}},_nextTDFixing:function(cur,shift,row){var td=null,$fixedContainer,isLeft,tds;if(this.grid._isFixedElement(cur.td)){isLeft=cur.td.closest("div[data-fixing-direction]").attr("data-fixing-direction")==="left";if(isLeft){if(shift===1){tds=this.grid.element.find("tbody tr:nth-child("+(row+1)+")").children();if(tds.length>0){td=tds[0]}}else if(shift===-1&&row>=1){tds=this.grid.element.find("tbody tr:nth-child("+row+")").children();if(tds.length>0){td=tds[tds.length-1]}}}else{if(shift===1){tds=this.grid.element.find("tbody tr:nth-child("+(row+2)+")").children();if(tds.length>0){td=tds[0]}}else if(shift===-1){tds=this.grid.element.find("tbody tr:nth-child("+(row+1)+")").children();if(tds.length>0){td=tds[tds.length-1]}}}}else{$fixedContainer=this.grid.container().find("div[data-fixing-direction]");isLeft=$fixedContainer.attr("data-fixing-direction")==="left";if(isLeft){if(shift===1){tds=$fixedContainer.find("tbody tr:nth-child("+(row+2)+")").children();if(tds.length>0){td=tds[0]}}else if(shift===-1){tds=$fixedContainer.find("tbody tr:nth-child("+(row+1)+")").children();if(tds.length>0){td=tds[tds.length-1]}}}else{if(shift===1){tds=$fixedContainer.find("tbody tr:nth-child("+(row+1)+")").children();if(tds.length>0){td=tds[0]}}else if(shift===-1&&row>=1){tds=$fixedContainer.find("tbody tr:nth-child("+row+")").children();if(tds.length>0){td=tds[tds.length-1]}}}}return td},_nextTD:function(cur,shift,edit){var i,tds,tr,td,map,hasFixedCols=this.grid.hasFixedColumns(),tbody=cur.tbl.children("tbody")[0],rows=tbody?tbody.childNodes:0,rowsLen=rows?rows.length:0,row=cur.row;if(rowsLen<1||row<0||row>=rowsLen){return}tr=rows[row];if(!tr){return}tds=tr.childNodes;map=this._col(1);if(shift==="-tr1"||shift===-1&&cur.col===0&&cur.row===0){tr=row-1<0?rowsLen-1:row-1}else{tr=row+(shift||1);tr=tr>=rowsLen?0:tr}if(hasFixedCols&&cur.col>=0){i=cur.col;if(shift===1){i+=1}else if(shift===-1){i-=1}if(!tds[i]){i=-1}}else{i=this._idForCol(cur.col,shift)}if(shift&&shift!=="-tr1"){if(i>=0){cur.col=map[i];td=tds[i]}if(!td&&edit){if(hasFixedCols){td=this._nextTDFixing(cur,shift,row)}else if(tr>=0&&tr<rowsLen){if(shift>0){i=map[0]>=0?0:1}else{i=map.length;while(--i>=0){if(map[i]>=0){break}}}if(i>=0){cur.col=map[i];cur.row=tr;td=rows[cur.row].childNodes[i]}}}}else{if(tr<rowsLen){cur.row=tr;td=rows[cur.row].childNodes[i]}else{td=null}}cur.td=td?$(td):null;return td?cur:null},_nextEditor:function(key,shift){var e,col,ok=null,edits=this._editors,i,editors,cols,colsLength;if(this.grid.hasFixedColumns()){editors={};cols=this.grid.options.columns;colsLength=cols.length;for(i=0;i<colsLength;i++){col=cols[i].key;if(edits.hasOwnProperty(col)){editors[col]=edits[col]}}edits=this._editors=editors}for(col in edits){if(edits.hasOwnProperty(col)){if(shift&&key===col){return ok}if(col){e=edits[col];if(e&&e[0]&&e[0].offsetWidth>0){if(key===null){return e}ok=e}}if(key===col){key=null}}}},_nextEdit:function(e,shift,from){var cur,td=this._td(from);if(!td){return}cur=this._cur(td,true);cur.td=td;while(this._nextTD(cur,shift,1)){if(_aNull(this.editorForCell(cur.td))&&this.options.editMode!=="cell"){continue}if(this._startEdit(cur.td,e,this.options.editMode==="cell"?1:false)){return}}this._endEdit(e,1)},_createEditor:function(td,key,element){var v,oValid,elem,oEdit={},me=this,gridCol=me._gridCol(key)||{},format=gridCol.format,css=me.css.editor,xy=me._xy,col=me._colSet(td,key),provider=col?col.editorProvider:null,topBorder=me._tdBdrTop,retDone=$("#"+this.grid.container().attr("id")+"_igButton");if(col&&col.readOnly&&!element){return null}if(!xy&&!element){topBorder=me._tdBdrTop=_int(td,"borderTopWidth");v=$("<span />").addClass(css).prependTo(td);me._xy=xy={x:_int(v,"marginLeft"),y:_int(v,"marginTop")};xy.dx=xy.x+_int(v,"marginRight");xy.dy=xy.y+_int(v,"marginBottom");v.remove()}v=null;if(col){oEdit=col.editorOptions||oEdit;oValid=oEdit.validatorOptions;v=col.required;if(!oValid&&(col.validation||v)){oValid={}}if(v){oValid.required=oEdit.required=true}}if(me.options.validation&&!oValid){oValid={}}if(oValid){if(!me.grid.element.igValidator){_throw("igValidatorException")}if(col){col.editorOptions=oEdit}oEdit.validatorOptions=oValid;oValid.bodyAsParent=false;oValid.keepFocus=2;oValid.errorHidden=function(){me._error=null;if(me._butDone){me._butDone.removeClass(me.css.buttonDisabled)}if(retDone.length>0){retDone.igButton("option","disabled",false)}};oValid.errorShowing=function(){if(!_aNull(me._error)&&me._error!==key){return false}};oValid.errorShown=function(evt,ui){me._error=key;if(me._butDone){me._butDone.addClass(me.css.buttonDisabled)}ui=ui.owner._lbl;if(ui){ui.css("zIndex",99999)}me._scrollTo(key)}}if(!provider){if(gridCol.dataType==="bool"&&(format==="checkbox"||!format&&me.grid.options.renderCheckboxes)&&!element){provider=new $.ig.EditorProviderCheckbox}else if(col&&col.editorType==="combo"){provider=new $.ig.EditorProviderCombo}else if(col&&col.editorType==="rating"){provider=new $.ig.EditorProviderRating}else{provider=new $.ig.EditorProviderDefault}}me._hComboInit(oEdit);elem=provider.createEditor(me,key,col,me._ti,format,gridCol.dataType,me._val(td),element);if(!element){elem.addClass(css).css({marginLeft:xy.x-_int(td,"paddingLeft")+"px",marginTop:xy.y-topBorder-_int(td,"paddingTop")+"px"})}v=elem.igEditorFilter({provider:provider});return v},_notifyChanged:function(){var e=this._butDone;if(e){if(this.findInvalid()){e.addClass(this.css.buttonDisabled)}else{e.removeClass(this.css.buttonDisabled)}}e=$("#"+this.grid.container().attr("id")+"_igButton");if(e.length>0){if(this.findInvalid()){e.igButton("option","disabled",true)}else{e.igButton("option","disabled",false)}}this._modified=1},_notifyEditorKey:function(e,colKey){var but,old,val,next,cur,tar,key=e.keyCode||e.which||0,esc=key===27,o=this.options,shift;if(key!==9&&key!==13&&!esc){return}cur=this._editors[colKey];if(!cur||key===13&&(e.shiftKey||e.ctrlKey||this._13)){return}if(esc){old=cur._oldCellVal;val=_filter(cur,"getValue");if(!this._equals(old,val)){_filter(cur,"setValue",old);if(!this._equals(_filter(cur,"getValue"),val)){_filter(cur,"validate");_stop(e);return}}return this._endEdit(e,null,200)}if(key===13||!this._adding&&o.editMode==="cell"){tar=$(e.target);if(tar.length>0){tar.find("input").first().trigger("blur")}if(this.options.horizontalMoveOnEnter){shift=1}else{shift=key===9?e.shiftKey?-1:1:0}return this._nextEdit(e,shift)}next=this._nextEditor(colKey,e.shiftKey);if(!_filter(cur,"validate")){_stop(e);return}if((key===13||key===9)&&!next&&!this._adding){tar=$(e.target);if(tar.length>0){tar.find("input").first().trigger("blur")}}_stop(e);try{if(next&&this._adding&&!_aNull(this.grid._startColIndex)&&this.grid.table&&this.grid.table.rows[0]&&!this.grid.cellAt(this._col(next.parent()),0)){next=null}}catch(ex){next=null}if(next){this._scrollTo(next.parent(),next);return}but=this._butDone;if(!but||but[0].offsetWidth===0){return this._nextEdit(e,e.shiftKey?-1:0)}if(but.hasClass(this.css.buttonDisabled)){but=this._butCancel}but[0].focus();this._prevEdit=cur},_evtArg:function(td,editor,val){var arg={rowAdding:!!this._adding,columnIndex:this._col(td),rowID:this._row_,columnKey:this._key(td),editor:editor};arg.value=_aNull(val)?null:val;return arg},_checkHidden:function(vals){var col,key,colG,cols=this.grid.options.columns,i=cols.length;while(i-->0){colG=cols[i];if(colG&&colG.hidden){key=colG.key;col=this._colSet(null,key);col=col&&_aNull(vals[key])?col.defaultValue:null;if(col!==null){vals[key]=col}}}},_isToggle:function(e){e=e&&e.type&&e.type.indexOf("click")>=0?e.target:null;return e&&e.className&&e.className.indexOf("ui-icon-check")>=0},_lastTDWidth:function(td,width){var pad=_int(td,"paddingRight")>12,div=pad||!td.next()[0]?td.closest("div")[0]:null,v=div&&td[0].offsetLeft+td[0].offsetWidth>div.clientWidth+5?div.offsetWidth-div.clientWidth:0;if(v>10){div=pad?null:this._hscroll(1)[0];if(!div||div.offsetWidth<div.clientWidth+3){width-=Math.min(18,v)}}return width},_hComboInit:function(oEdit){var i,gCol,col,key,cols,combo,cell=this.options.editMode==="cell",hComboID=oEdit.parentCombo,combos=this._hCombos;if(!hComboID){return}cols=this.options.columnSettings;i=cols.length;combo=combos?combos[hComboID]:null;if(combo){oEdit._hComboID=hComboID;oEdit.parentCombo=combo.combo;i=0}while(i-->0){col=cols[i];key=col.columnKey;gCol=this._gridCol(key);combo=col.editorType==="combo"&&(cell||gCol&&gCol.hidden)?col.editorOptions:null;if(combo&&combo.id===hComboID){this._hCombos=combos=combos||{};oEdit._hComboID=hComboID;oEdit.parentCombo=combo=$('<span id="'+hComboID+'"></span>').igCombo(combo);combos[hComboID]={key:key,combo:combo};return}}},_hComboEdit:function(editor){var val,o,combo=this.findHiddenComboEditor(editor);if(!combo){return}o=combo.options;if(o.filteringType){combo.selectedIndex(-1);combo.activeIndex(-1);combo.dataBind()}val=this.grid.getCellValue(this._row_,combo._colKey);if(o.allowCustomValue){combo.text(val===null?o.nullText||"":val)}else{combo.value(val)}},_hComboRemove:function(destroy){var i,o,combo,combos=this._hCombos;if(!combos){return}for(i in combos){if(combos.hasOwnProperty(i)){combo=combos[i].combo;if(combo){combo.igCombo("destroy")}}}delete this._hCombos;combos=this.options.columnSettings;i=destroy?0:combos.length;while(i-->0){o=combos[i].editorOptions;combo=o?o._hComboID:null;if(combo){o.parentCombo=combo}}},_startEdit:function(td,e,foc,add,height,toggle){var i,tds,width,arg,editor,val,hasFixedCols=this.grid.hasFixedColumns(),funcIterator,grid=this.grid,prime=grid.options.primaryKey,me=this,fixedTDs=[],unfixedTDs=[],td0=td?td[0]:null,but=null,v=false,o=this.options;if(!td0){return}if(e){delete this._defValue;this._delHover();this._cShift=this._cShiftAdd=-1;this._map=undefined;if(this._tds){if(!add){if(hasFixedCols){i=td.index()}td=this._cur(td)}if(this._endEdit(e,1)){return 1}if(!add){if(i===undefined||!hasFixedCols){i=this._idForCol(td.col)}tds=td.row<0||td.col<0||i<0?null:td.tbl.children("tbody")[0];td=tds?tds.childNodes[td.row]:null;if(td){td=td.childNodes[i]}if(!td){return}td=$(td)}}if(!add&&!this._checkRow(td.parent())){return}this._row_=add?-1:this._prime(td);this._rowIndex=add?-1:this._row(td);if(!height){height=td[0].offsetHeight}if(add||o.editMode==="row"){arg={rowAdding:!!add,rowID:this._row_};if(!this._fire("editRowStarting",e,arg)){this._row_=null;this._rowIndex=-3;return}if(add){this._adding=add;if(this._tdAddPrime){i=this._gridCol(prime);val=this._defVal(prime,1);this._tdAddPrime.html(i?grid._renderCell(val,i):val)}this._addTR.hide();this._newTR.show();if(hasFixedCols){this.grid.fixedHeadersTable().find("thead tr[data-add-row]").hide();this.grid.fixedHeadersTable().find("thead tr[data-new-row]").show()}if(!this._addFixScroll){this._addFixScroll={scroll:function(){var cont=grid.scrollContainer()[0],left1=cont?cont.scrollLeft:-1,left2=this.scrollLeft;if(!_aNull(left2)&&left1>=0&&left1!==left2){cont.scrollLeft=left2}}}}this._addTR.closest("div").bind(this._addFixScroll)}tds=td.parent().children();this._evt=e;if(hasFixedCols){funcIterator=function(TDs){for(i=0;i<TDs.length;i++){td=$(TDs[i]);if(me._col(td)<0||TDs[i].offsetWidth<3||td.attr("data-skip")||td.is("th")){continue}td.addClass(me.css.editingCell);but=but||td;if(me._startEdit(td,null,e&&td[0]===td0,add,height,me._isToggle(e)&&td[0]===td0)){v=1;foc=null}}};if(this.grid._isFixedElement(td)){fixedTDs=tds;if(add){unfixedTDs=this.grid.headersTable().find("thead tr:nth-child("+(td.parent("tr").index()+1)+")").children()}else{unfixedTDs=this.grid.element.find("tbody tr:nth-child("+(td.parent("tr").index()+1)+")").children()}}else{unfixedTDs=tds;if(add){fixedTDs=this.grid.fixedHeadersTable().find("thead tr:nth-child("+(td.parent().index()+1)+")").children()}else{fixedTDs=$("#"+this.grid.id()+"_fixed").find("tbody tr:nth-child("+(td.parent().index()+1)+")").children()}}funcIterator(unfixedTDs);funcIterator(fixedTDs)}else{for(i=0;i<tds.length;i++){td=$(tds[i]);if(this._col(td)<0||tds[i].offsetWidth<3){continue}td.addClass(this.css.editingCell);but=but||td;if(this._startEdit(td,null,foc===1||e&&td[0]===td0,add,height,this._isToggle(e)&&td[0]===td0)){v=1;foc=null}}}delete this._evt;if(v&&but&&o.showDoneCancelButtons){this._doButtons(but)}if(this._butDelete){if(add){this._butDelete.addClass(this.css.buttonDisabled)}else{this._butDelete.removeClass(this.css.buttonDisabled)}}if(v){_stop(e);this._fire("editRowStarted",e,arg)}else{tds.removeClass(this.css.editingCell)}this._sel("act",but);if(add&&v){if(!this.grid._isFixedElement(td)){while(height-this._newTR[0].offsetHeight>0){if(v){v=null;td=$(tds[0]);add=_int(td,"paddingTop")+_int(td,"paddingBottom")+_int(td,"borderTopWidth")+_int(td,"borderBottomWidth")+1}if(--add<0){break}td.css("height",height-add)}}v=1}return v}toggle=toggle||this._isToggle(e)}editor=this.editorForCell(td,1);if(_aNull(this._row_)||!editor){return}width=td.outerWidth();if(!height){height=td[0].offsetHeight}arg=this._evtArg(td,editor,this._val(td,null,1));if(!width||!height){return}if(!this._fire("editCellStarting",e||this._evt,arg)){return"canceled"}this._hComboEdit(editor);width=this._lastTDWidth(td,width);width-=this._xy.dx+2;height-=this._xy.dy;if(e){_stop(e);td.addClass(this.css.editingCell)}editor.prependTo(td);_filter(editor,"setSize",Math.max(8,width),Math.max(10,height));if(!this._tds){this._tds={}}this._tds[this._key(td)]=td;v=_filter(editor,"validator");if(v&&v._setOption){v._setOption("bodyAsParent",grid.options.fixedHeaders!==false||!grid.options.height)}_filter(editor,"setValue",arg.value);editor._oldCellVal=_filter(editor,"getValue");this._fire("editCellStarted",e||this._evt,arg);if(foc){this._scrollTo(td,editor,false,300,toggle)}if(e){this._sel("act",td)}return 1},_endEdit:function(e,update,foc){var i,editor,val,key,td,arg,oldVals,stop,oldUpdate=update,eArg=e||"undefined",add=this._adding,tr=null,argR=null,vals=null,tds=this._tds,hasFixedCols=this.grid.hasFixedColumns(),o=this.options;if(!tds||this._skip){return}if(e&&e.type!=="mousedown"){stop=e;_stop(stop)}i=add||o.editMode==="row";if(!this._modified&&!add){update=false}if(i){for(key in tds){if(tds.hasOwnProperty(key)){td=tds[key];if(e&&!_aNull(td)){editor=this.editorForCell(td);if(oldUpdate&&!_aNull(editor)&&editor[0]&&editor[0].offsetWidth&&editor.igEditorFilter("hasInvalidMessage")){if(!stop){stop=e;_stop(stop)}this._scrollTo(td,editor,1);return 1}}}}vals=this._addReadOnly(add);oldVals={};for(key in tds){if(tds.hasOwnProperty(key)){td=tds[key];if(oldUpdate&&!_aNull(td)&&!_aNull(this.editorForCell(td))){editor=this.editorForCell(td);vals[key]=_filter(editor,"getValue");oldVals[key]=editor._oldCellVal;if(e&&editor[0]&&editor[0].offsetWidth&&!_filter(editor,"validate",!o)){if(!stop){stop=e;_stop(stop)}if(o){this._scrollTo(td,editor,1)}o=null}}}}if(e&&!o){return 1}if(add){this._checkHidden(vals)}this._skip=1;argR={oldValues:oldVals,values:vals,rowID:this._row_,keepEditing:false,update:!!update,rowAdding:!!add};if(!this._fire("editRowEnding",eArg,argR)){argR.update=update=oldUpdate=false}delete this._skip;if(e&&argR.keepEditing){return 1}}if(i){this._td().parent().children().removeClass(this.css.editingCell);if(hasFixedCols){$("#"+this.grid.id()+"_fixed").find("tbody tr:nth-child("+(this._td().parent().index()+1)+")").children().removeClass(this.css.editingCell)
}}tr=null;for(key in tds){if(tds.hasOwnProperty(key)){td=tds[key];if(!_aNull(td)&&!_aNull(this.editorForCell(td))){editor=this.editorForCell(td);if(!vals){if(e&&oldUpdate&&!_filter(editor,"validate")){if(!stop){stop=e;_stop(stop)}this._scrollTo(td,editor,1);return 1}td.removeClass(this.css.editingCell)}this._skip=1;this._doButtons(1);val=_filter(editor,"getValue");arg=this._evtArg(td,editor,val);arg.update=!!update;if(!this._adding){arg.update=arg.update&&!this._equals(this._getVal(this._row_,this._key(td)),val)}arg.oldValue=editor._oldCellVal;if(!vals){arg.keepEditing=false}if(!this._fire("editCellEnding",eArg,arg)){arg.value=editor._oldCellVal}if(oldUpdate&&!vals&&e&&arg.keepEditing){_stop(e);this._scrollTo(td,editor,1);delete this._skip;return 1}val=foc?editor.data("igEditor")||editor.data("igCombo")||editor.data("igRating"):null;if(val&&typeof val.hasFocus==="function"&&val.hasFocus()){try{editor.parent()[0].focus()}catch(ignore){}foc=null}editor.igEditorFilter("remove");val=arg.value;if(update&&vals){vals[key]=val}if(update&&this._val(td,arg,vals)!==undefined&&!tr&&!this._equals(val,editor._oldCellVal)){tr=td.parent()[0]}delete tds[key];this._fire("editCellEnded",eArg,arg);delete this._skip}}}this._skip=1;this._modified=this._prevEdit=this._tds=this._error=null;if(add){this._addTR.closest("div").unbind(this._addFixScroll);this._addTR.show();this._newTR.hide();if(hasFixedCols){this.grid.fixedHeadersTable().find("thead tr[data-add-row]").show();this.grid.fixedHeadersTable().find("thead tr[data-new-row]").hide()}this._adding=null;if(update&&this._fire("rowAdding",eArg,argR)){this._update(vals);this._sel("refresh");this._fire("rowAdded",eArg,argR)}}else if(tr){this._update(this._row_,tr,vals)}this._fire("editRowEnded",eArg,argR);this._rowIndex=-3;this._row_=null;this._sel("end",e);delete this._skip},_scrollDiv:function(){var me=this,div=me._scrl,tbl=me.grid.element;if(div&&me._sEvts){return div}me._scrl=div=tbl?tbl.parent():null;if(div&&!me._sEvts&&div.is("div")){me._scrollX=div.scrollLeft;me._sEvts={scroll:function(e){me._onEvt(e,9)}};div.bind(me._sEvts)}return div},_scrollTo:function(td,editor,checkError,delay,toggle){var cur,rect,div,x,y,lbl,xy,shift,add=this._adding,errorWidth=0,errorHeight=0,foc=editor;if(!editor&&typeof td==="string"){td=this._tds?this._tds[td]:null;if(!td){return}editor=this.editorForCell(td);if(!editor){return}checkError=1}if(foc){editor.igEditorFilter("setFocus",100,toggle);if(delay){editor.igEditorFilter("setFocus",delay)}}if(editor&&checkError){lbl=_filter(editor,"validator");lbl=lbl?lbl._lbl:null;if(lbl&&(add||td.has(lbl).length!==0)){errorWidth=lbl[0]._width0||80;errorHeight=lbl[0]._height0||18;cur=this._cur(td)}}div=this._scrollDiv();xy=td.offset();rect=div.offset();div=div[0];rect.w=div.clientWidth;rect.h=div.clientHeight;xy.w=td.outerWidth();xy.h=td.outerHeight();x=xy.left-rect.left;y=xy.top-rect.top;if(errorWidth>xy.w){delay=cur.col;shift=xy.w;errorWidth+=5;xy.w=errorWidth;while(shift<errorWidth&&this._nextTD(cur,1)){shift+=cur.td[0].offsetWidth}shift-=errorWidth;if(shift<0){xy.x+=shift;if(xy.x<0&&!add){shift-=xy.x;xy.x=0}if(this.grid._hasVerticalScrollbar){shift-=this.grid._scrollbarWidth()}lbl.css("marginLeft",shift+"px")}}if(!add&&errorHeight>1&&cur.row>1){cur.col=delay;errorHeight+=3;shift=errorHeight;while(shift>0&&this._nextTD(cur,0)){shift-=cur.td[0].offsetHeight}if(shift>0){lbl.css("marginTop","-"+errorHeight+"px");y-=errorHeight}}if(div.nodeName!=="DIV"){return}if(x>0){x=Math.max(x+xy.w-rect.w,0)}if(y>0){y=Math.max(y+errorHeight+xy.h-rect.h,0)}if(x!==0){this._hscroll()[0].scrollLeft+=x}if(!add&&y!==0){div.scrollTop+=y}},_upDown:function(td){td=td.parent();if(td.prev().length<1){return 1}if(td.next().length>0){return 0}td=this.grid.element;var par=td.parent()[0];return par&&par.clientHeight-td[0].offsetHeight>25?0:-1},_minWidth:function(td,div){var par=div[0];if(par.id.indexOf("_container")<0&&div.parents(".ui-iggrid").length>0){par=div.parent()[0]}div=Math.min(div[0].clientWidth||div[0].offsetWidth,par.clientWidth||par.offsetWidth);return td?Math.min(div,td.closest("table")[0].clientWidth):div},_doButtons:function(td){var xyTD,xyBut,htBut,htTD,txt,div,cont,scroll,down,x,oldOverflow=this._oldOverflow,add=this._adding,css=this.css,grid=this.grid.element,hasHeight=!_aNull(this.grid.options.height),buts=this._buts;if(td===1||td===2){if(oldOverflow){delete this._oldOverflow;oldOverflow.e.css("overflowX",oldOverflow.x).css("overflowY",oldOverflow.y)}if(buts){buts.hide();if(td===2){buts.remove();this._buts=null}}if(td===2&&this._delBut){this._delHover();this._delBut.remove();delete this._delBut}return}div=this._scrollDiv();if(td){cont=hasHeight?grid.parent():grid.closest(".ui-iggrid");x=cont[0]?Math.max(cont[0].scrollHeight,cont[0].offsetHeight):-1;if(x>=0&&x<20){this._oldOverflow={e:cont,x:cont.css("overflowX"),y:cont.css("overflowY")};cont.css("overflowX","visible").css("overflowY","visible")}if(!buts){buts=this._buts=$("<div />").css("position","absolute").addClass(css.buttonContainer).attr("unselectable","on");if(hasHeight){buts.prependTo(cont)}else{buts.appendTo(cont)}this._butDone=x=$("<span />").addClass("done_id").addClass(css.button).addClass(css.doneButton).attr("unselectable","on").attr("tabIndex",this._ti+1).attr("title",this._loc("done",1)).appendTo(buts).bind(this._evts);$("<span />").css("display","inline-block").addClass(css.doneIcon).attr("unselectable","on").appendTo(x);txt=this._loc("done");if(txt){$("<span />").css("display","inline-block").attr("unselectable","on").html(txt).appendTo(x)}else{x.addClass(css.buttonIconOnly)}this._butCancel=x=$("<span />").addClass(css.button).addClass(css.cancelButton).attr("unselectable","on").attr("tabIndex",this._ti+1).attr("title",this._loc("cancel",1)).appendTo(buts).bind(this._evts);$("<span />").css("display","inline-block").addClass(css.cancelIcon).attr("unselectable","on").appendTo(x);txt=this._loc("cancel");if(txt){$("<span />").css("display","inline-block").attr("unselectable","on").html(txt).appendTo(x)}else{x.addClass(css.buttonIconOnly)}if(this._renderTouchUI&&this.options.enableDeleteRow){this._butDelete=x=$("<span />").addClass(css.button).addClass(css.doneButton).attr({unselectable:"on",tabIndex:this._ti+1,title:this._loc("deleteRow",1)}).prependTo(buts);$("<span />").css("display","inline-block").addClass(css.deleteIcon).attr("unselectable","on").appendTo(x).css("left",0).bind(this._evts);txt=this._loc("deleteRow",true);$("<span />").css("display","inline-block").attr("unselectable","on").html(txt).appendTo(x);x.css("float","left");this._butCancel.css("float","right");this._butDone.css("float","right");buts.css("width",this._minWidth(td,div)-6)}buts._height=buts[0].offsetHeight;buts._width=buts[0].offsetWidth}this._tdelTR=td.parent()}if(!buts){return}if(td){x=Math.max(grid[0].offsetHeight,grid.parent()[0].offsetHeight);buts.show();if(add&&this.findInvalid()===null){this._butDone.removeClass(css.buttonDisabled)}else{this._butDone.addClass(css.buttonDisabled)}this._butsX=0;buts.css({marginLeft:this._butsX+"px",marginTop:"0px"});xyBut=buts.offset();htBut=buts[0].offsetHeight;xyTD=td.offset();htTD=td[0].offsetHeight;xyTD.top-=xyBut.top;scroll=div[0].scrollTop;down=add?1:this._upDown(td);if(!down){down=div[0].clientHeight+scroll-xyTD.top-htTD-5-htBut;if(down<1&&down>xyTD.top-htBut-scroll-5){down=1}}down=down>0?xyTD.top+htTD+5:xyTD.top-htBut-5;if(down+htBut>x){if(down+htBut<x+6){down=x-htBut-2}else{down-=10+htBut+htTD}down=Math.max(0,down)}buts.css({marginTop:down+"px"});this._butsY=add&&grid.has(this._addTR).length===1?down:0}x=this._minWidth(td,div)-(buts.offset().left+buts._width+3-div.offset().left);if(this._renderTouchUI&&this.options.enableDeleteRow){x+=1}if(x!==0){this._butsX+=x;buts.css("marginLeft",this._butsX+"px")}if(add&&this.grid.options.fixedHeaders!==false){buts.css("marginTop",this._butsY+div[0].scrollTop+2+"px")}},_isEditor:function(e){var end,el,editor,key,td,tds=this._tds,o=this.options;if(!tds||_aNull(e)){return}td=this._findCell(e);if(td&&o.editMode==="row"&&this._row(td)===this._rowIndex){return 1}end=this.grid.element[0];for(key in tds){if(tds.hasOwnProperty(key)){td=tds[key];if(td){editor=this.editorForCell(td);if(editor){el=e;editor=editor[0];while(el&&el!==end){if(el===editor){return 1}el=el.parentNode}}}}}},_aCell:function(){var td,i=-1,sel=this._sel("get");td=sel?sel.activeCell():null;if(td){return td.element}td=sel?sel.activeRow():null;if(td){td=td.element.children("td:not([data-parent='true'],[data-skip='true'])");while(++i<td.length){if(td[i].offsetWidth>0){return $(td[i])}}}},_sel:function(flag,td){var i,obj,elem,sel=this.grid.element.data("igGridSelection");if(!sel||flag==="get"){return sel}if(flag==="end"){delete sel._suspend;if(td&&td.type==="mousedown"){sel._mouseDown(td)}return}if(flag==="wait"){obj=sel.selectedRows();i=obj?obj.length:0;while(i-->0){elem=obj[i].element;if(elem&&elem.has(td).length){return}}obj=sel.selectedCells();i=obj?obj.length:0;while(i-->0){elem=obj[i].element;if(elem&&elem[0]===td[0]){return}}obj=sel.selectedRow();elem=obj?obj.element:null;if(elem&&elem.has(td).length){return}obj=sel.selectedCell();elem=obj?obj.element:null;if(elem&&elem[0]===td[0]){return}if(this.grid.hasFixedColumns()){obj=sel.selectedFixedRows();i=obj?obj.length:0;while(i-->0){elem=obj[i].element;if(elem&&elem.has(td).length){return}}obj=sel.selectedFixedCells();i=obj?obj.length:0;while(i-->0){elem=obj[i].element;if(elem&&elem[0]===td[0]){return}}obj=sel.selectedFixedRow();elem=obj?obj.element:null;if(elem&&elem.has(td).length){return}}return 1}if(flag==="refresh"){return sel._refresh()}if(flag==="act"&&sel.options.activation){sel._suspend=1;if(!td){return}if(sel.options.mode==="row"){sel._realActiveRow={element:td.parent(),index:this._row(td)+this.grid._startRowIndex||0,id:this._prime(td)};return sel._activateRow(sel._realActiveRow)}td=sel._cellFromElement(td[0],this._row(td),td.index());return sel._activateCell(td)}},_doDelete:function(e,tr){var i,sel,arg;if(!tr){sel=this._sel("get");arg=sel?sel.selectedRows():null;for(i=0;i<(arg?arg.length:0);i++){this._doDelete(e,arg[i].element)}arg=sel?sel.selectedRow():null;if(arg){this._doDelete(e,arg.element)}}arg={element:tr,rowID:this._prime($(tr.children()[0]))};if(!tr||!this._fire("rowDeleting",e,arg)){return}this._delHover();this._update(arg.rowID,tr[0]);if(e){this._sel("refresh")}this._fire("rowDeleted",e,arg);return 1},_checkRow:function(tr){var tbody;tr=tr&&tr.index()<this.grid.rows().length?tr[0]:null;if(tr&&tr.className.indexOf(this.grid.css.deletedRecord)<0&&!$(tr).attr("data-grouprow")&&$(tr).parent().is("tbody")){if(this.grid.hasFixedColumns()&&$(tr).closest("div").attr("data-fixed-container")){tbody=$("#"+this.grid.id()+"_fixed").find("tbody")}else{tbody=this.grid.element.find("tbody")}if($(tr).parent()[0]===tbody[0]){return tr}}return null},_delHover:function(src){var i,v,left,iBut,iTD,iDiv,iScroll,shift,xyBut,xyTD,div,tds,td,down,but=this._delBut,tr=this._delTR,hasFixedColumns=this.grid.hasFixedColumns(),css=this.css;if(but){this._doHov(this._isSrc(but,src)?but[0]:null,css.buttonHover)}if(src!==null&&src!==undefined&&hasFixedColumns){if(this.grid._isFixedElement($(src))){src=this.grid.element.find('tbody tr[data-id="'+$(src).closest("tr").attr("data-id")+'"]')}}src=src?this._checkRow($(src).closest("tr")):null;if(src===tr||!tr&&!src||!but&&!src){return}this._delTR=src;if(!but){this._delBut=but=$("<span />").css("position","absolute").addClass(css.deleteButton).attr("unselectable","on").attr("title",this._loc("deleteRow",1));$("<span />").css("display","inline-block").addClass(css.deleteIcon).attr("unselectable","on").appendTo(but);v=this._loc("deleteRow");if(v){$("<span />").css("display","inline-block").attr("unselectable","on").html(v).appendTo(but)}}if(tr){but.hide()}if(!src){return}i=this._colShift(null,src)-1;tds=src.childNodes;while(++i<tds.length){if(tds[i].offsetWidth>0){break}}src=tds[i];if(!src){return}td=$(src);div=this.grid.element.parent();if(hasFixedColumns&&this.grid.element.data("igGridColumnFixing").options.fixingDirection==="right"){div=this.grid.fixedBodyContainer();td=div.find("tbody tr").eq(td.closest("tr").index()).find("td:last")}v=but[0].parentNode;if(v!==div&&v!==div[0]){if(!v){but.bind(this._evts).mouseup(function(e){_stop(e)})}but.prependTo(div)}but.css({marginLeft:"0px",marginTop:"0px"}).show();xyBut=but.offset();xyTD=td.offset();iBut=but[0].offsetHeight;iTD=src.offsetHeight;shift=xyTD.top-xyBut.top;down=shift+Math.round((iTD-iBut)/2);iScroll=div[0].scrollLeft;iDiv=this._minWidth(td,div);iBut=but[0].offsetWidth;left=iDiv+iScroll-iBut-_int(td,"paddingLeft")-_int(td,"borderLeftWidth")-5;but.css({marginTop:down+"px",marginLeft:left+"px"});shift=iBut+but.offset().left-xyTD.left-iScroll-iDiv+5;if(shift>0){but.css("marginLeft",left-shift+"px")}},_isSrc:function(e,src){if(e&&src&&(e[0]===src||e[0]===src[0]||e.has(src).length>0)){return e}},_doHov:function(e,css){var hov=this._hov;if(hov&&css&&hov.e[0]===e){return 1}if(hov){hov.e.removeClass(hov.css)}if(css){e=$(e);this._hov={e:e,css:css};return e.addClass(css)}delete this._hov},_noMove:function(check){var x,y,div,id,noMove=this._nm;if(noMove===1||check&&!noMove){return}if(!noMove){id=this.grid.element[0].id;div=$("#"+id+"_scroll");if(div.length!==1){div=$("#"+id+"_displayContainer")}if(!div.length){this._nm=1;return}}noMove=this._nm=this._nm||{x:0,y:0,div:div[0]};noMove.ex=noMove.ex||$("#"+id+"_hscroller")[0]||$("#"+id+"_horizontalScrollContainer")[0]||noMove.div;x=noMove.ex.scrollLeft;noMove.ey=noMove.ey||$("#"+id+"_scrollContainer")[0]||noMove.div;y=noMove.ey.scrollTop;if(check){return Math.abs(noMove.x-x)>1||Math.abs(noMove.y-y)>1}noMove.x=x;noMove.y=y},_onEvt:function(e,type){var td,cancel,done,addTD,tbody,but,next,me=this,now=_now(),touch=me._hovTouch,src=e?e.target:null,k=e?e.keyCode:0,x=me._lastEvt,y,css=me.css,delBut=me._delBut,rdelBut=me._butDelete,newTR=me._newTR,addTR=me._addTR,tbl=me.grid.element,hasFixedCols=me.grid.hasFixedColumns(),o=me.options,editor,key,touchX,scrollLeft,scrollWidth;if(type===2&&me._skipMD&&now-me._skipMD<999){me._skipMD=now+200}if(hasFixedCols&&$(src).closest("div").attr("data-fixed-container")!==undefined){tbl=$(src).closest("table")}if(type===1&&me._skipMD&&me._skipMD-now>0||$.ig.util.evtButton(e)){return}if(o.excelNavigationMode===true&&this._isEditor(src)){td=this._findCell(src);if(td){editor=this.editorForCell(td);if(!editor){return}editor=editor.data("igEditor")||editor.data("igCombo")||editor.data("igEditorFilter");key=this._keyForEditor(editor.element);if($.ig.indexInArray([39,37],k)>=0){if(editor._old===null||editor._old===undefined||editor._old!==null&&editor._old!==undefined&&editor.value()!==null&&editor._old.toString()===editor.value().toString()){if(this.options.editMode==="row"){next=this._nextEditor(key,k===37?-1:0);if(next){this._scrollTo(next.parent(),next);return}but=this._butDone;if(!but||but[0].offsetWidth===0){this._nextEdit(e,k===37?-1:0);return}}else{if(k===37){this._nextEdit(e,-1)}if(k===39){this._nextEdit(e,1)}return}}}if(k===38){this._nextEdit(e,"-tr1",key);return}if(k===40){this._nextEdit(e,0,key);return}}}if(!tbl||!src||(type<4||k===13)&&(e.shiftKey||e.ctrlKey)||k===13&&me._13){return}if(k===8&&src.readOnly){_stop(e)}if(type!==9&&x&&x.src===src&&x.type===type&&x.x===e.pageX&&x.y===e.pageY&&now<x.now+500){return}me._lastEvt={src:src,now:now,type:type,x:e.pageX,y:e.pageY};if(type>=11&&type!==14){touchX=e.originalEvent.touches&&e.originalEvent.touches[0]?e.originalEvent.touches[0].pageX:e.originalEvent.clientX;switch(type){case 11:me._firstTouchX=touchX;me._lastTouchX=touchX;me._firstTouchRow=e.originalEvent.touches?$(e.originalEvent.touches[0].target).closest("tr"):$(e.originalEvent.target).closest("tr");break;case 12:if(Math.abs(me._lastTouchX-me._firstTouchX)>parseInt(me.options.swipeDistance,10)&&me._firstTouchRow){this._delHover();this._delHover(me._firstTouchRow)}delete me._firstTouchX;delete me._lastTouchX;delete me._firstTouchRow;break;case 13:scrollLeft=me.grid.scrollContainer().scrollLeft()||0;scrollWidth=me.grid.scrollContainer().width()||0;if(touchX>me._lastTouchX&&scrollLeft===0||touchX<me._lastTouchX&&scrollLeft>=me.grid._hscrollbarinner().width()-scrollWidth){e.preventDefault()}if(me._firstTouchRow){me._lastTouchX=touchX}break}return}if(type===8){if(touch){return}this._delHover();return this._doHov()}x=delBut?me._isSrc(delBut,src):null;y=rdelBut&&!rdelBut.hasClass(me.css.buttonDisabled)?me._isSrc(rdelBut,src):null;tbody=tbl.find("tbody");if(type===7){if(o.enableDeleteRow){if(x){delBut.addClass(me.css.buttonHover)}else{if(delBut){delBut.removeClass(me.css.buttonHover)}this._delHover(this._tds||!this._isSrc(tbody,src)||this._noMove(true)?null:src)}}return}if((x||y)&&(type<4||type===14)){if((type===2&&!($.ig.util.isIE&&$.ig.util.browserVersion>=10)||type===14)&&(this._delTR||this._tdelTR)){_stop(e);this._endEdit();if(this._doDelete(e,$(this._delTR||this._tdelTR))){delete this._delTR;delete this._tdelTR}}return}addTD=addTR?addTR.children()[addTR.children().length-1]:null;if(k===46){return o.enableDeleteRow?this._doDelete(e):null}if(type===9){if(this._nm&&!this._noMove(true)){return}this._delHover();x=src.scrollLeft;if(this._tds){this._doButtons()}if(addTR&&x!==this._scrollX){$(addTD).css("paddingLeft",this._addLeft+x+"px")}this._scrollX=x;return}if(this._isSrc(addTR,src)){if(!this._isSrc($(addTD),src)){return}this._delHover();src=addTD;if(type===5){return $(src).addClass(css.addRowActive)}if(type===6){return $(src).removeClass(css.addRowActive)}if(type===7){return this._doHov(src,css.addRowHover)}if(k===32||k===13){return this.startAddRowEdit(e)}}if(k===27){return this._endEdit(e,null,50)}done=this._isSrc(this._butDone,src);cancel=this._isSrc(this._butCancel,src);td=this._isSrc(this._buts,src);if(td||done||cancel){if(done||cancel){if(type<5){_stop(e)}src=done||cancel;if(type===2){if(src.hasClass(css.buttonDisabled)){return}this._endEdit(e,done,1)}else if(type===7&&!src.hasClass(css.buttonDisabled)){this._doHov(src[0],css.buttonHover)}else if(type===5){src.addClass(css.buttonActive)}else if(type===6){src.removeClass(css.buttonActive)}else if(k===13||k===32){this._endEdit(e,done,1)}else if(k===9){if(e.shiftKey){td=done||this._butDone.hasClass(css.buttonDisabled)?null:this._butDone}else{if(!td){return}td=this._butCancel}if(td){td[0].focus();return}src=this._lastEditor();td=src?src.parent():null;if(td){this._scrollTo(td,src)}}}return}if(newTR&&type<4){if(this._isSrc(newTR,src)){return}if(hasFixedCols&&this.grid._isFixedElement($(src))){addTR=this.grid.fixedHeadersTable().find("thead tr[data-add-row]")}if(this._isSrc(addTR,src)){if(type===2){if(o.editMode==="rowedittemplate"){this._startEditRowTemplate(e,null,td,1)}else{this.startAddRowEdit(e)}}return}}if(type<4&&!this._isSrc(tbody,src)){if(hasFixedCols&&this.grid._isFixedElement($(src))&&!$(src).is("th")&&!$(src).parent().is("th")&&$(src).closest("div").attr("data-fixed-container")===tbody.closest("div").attr("data-fixed-container")){return}if(this._tds&&src!==tbl.parent()[0]&&src!==this._div()[0]&&src!==this._hscroll(1)[0]){this._endEdit(e)}return}if(k===13){this._nextEdit(e,0);if(this._tds){return}}if(this._isEditor(src)||this._isEditor($(src).find("input")[0])){return}td=this._findCell(src);if(this._tds&&type<4&&(type>1||td)){if(this._endEdit(e,this._adding?null:1)){return}}if(type===1){if(td&&this._sel("get")){this._waitSel=this._sel("wait",td)}return}x=o.editMode==="cell";src=o.startEditTriggers;if(src&&!this._tds&&(x||o.editMode==="row"||o.editMode==="rowedittemplate")){if(!src.toLowerCase){src=src.toString()}src=src.toLowerCase();if(k===113&&src.indexOf("f2")>=0||k===13&&src.indexOf("enter")>=0){td=this._aCell()}else if(src.indexOf(e.type)<0||type===2&&src.indexOf("dbl")>=0){td=null}if(touch&&type<3&&touch!==me._delTR){return}if(td&&(this._isToggle(e)||(!this._waitSel||type===4)&&!this._sel("wait",td))){if(o.editMode==="rowedittemplate"&&td.parent().attr("data-grouprow")!=="true"){this._startEditRowTemplate(e,null,td);return}if(this._startEdit(td,e,x)){return}}}},_startEditRowTemplate:function(e,tr,td,addNewRow){var dialog=$("#"+this.grid.container().attr("id")+"_ret"),arg;tr=!_aNull(td)&&td.parent().length>0?td.parent():tr;arg={rowAdding:addNewRow?true:false,rowID:addNewRow?-1:this._prime(td||tr.children().first())};if(!this._fire("editRowStarting",e,arg)){return}if(this._checkRow(tr)||addNewRow){if(dialog[0]===undefined){this._renderRowEditDialog(e,tr)}if(this._openRowEditDialog(e,tr)){this._fire("editRowStarted",e,arg);return 1}}return 0},_calcRowDialogLeftTop:function(dialog){var left,top,pos,h,w,bh,dh,dw,bw,block=$("#"+this.grid.container().attr("id")+"_block_ret"),rootWidget,rootContainer,hScrollbar,cc,bc,tc;if(this.element.closest(".ui-iggrid-root").data("igHierarchicalGrid")){rootWidget=this.element.closest(".ui-iggrid-root").data("igHierarchicalGrid").rootWidget()}else{rootWidget=this.grid}rootContainer=rootWidget.container();hScrollbar=rootWidget.container().children("[id$='_hscroller_container']");pos=rootContainer.offset();left=pos.left;top=pos.top;if(block.outerWidth()!==rootContainer.outerWidth()||$.ig.util.isIE7===true){block.css("width",rootContainer.outerWidth())}if(block.outerHeight()!==rootContainer.outerHeight()||$.ig.util.isIE7===true){block.css("height",rootContainer.outerHeight()+($.ig.util.isIE7?hScrollbar.height():0))}$("#"+this.grid.container().attr("id")+"_dialog_error").hide();block.css({left:0,top:0}).fadeToggle();w=rootContainer.outerWidth();h=rootContainer.outerHeight();bw=$(window).width();bh=$(window).height();if(w+left>bw){w=w-(w+left-bw)}if(w<=0){w=rootContainer.outerWidth()}if(h+top>bh){h=h-(h+top-bh)}if(h<=0){h=rootContainer.outerHeight()}dh=parseInt(this.options.rowEditDialogHeight,10);dw=parseInt(this.options.rowEditDialogWidth,10);if(isNaN(dh)||dh<=0){dh=dialog.outerHeight()}if(isNaN(dw)||dw<=0){dw=dialog.outerWidth()}top=parseInt(h/2,10)-dh/2;left=parseInt(w/2,10)-dw/2;cc=dialog.children(".ui-dialog-content");tc=dialog.children(".ui-dialog-titlebar");bc=dialog.children(".ui-dialog-buttonpane");dialog.css({left:left,top:top,width:dw,height:dh});dialog.fadeToggle($.proxy(this._setResizableEnv,this));cc.css("height",dialog.height()-tc.outerHeight(true)-bc.outerHeight(true)-cc.outerHeight()+cc.height())},_getColumnSettingsByKey:function(colKey){var i;for(i=0;i<this.options.columnSettings.length;++i){if(this.options.columnSettings[i].columnKey===colKey){return this.options.columnSettings[i]}}return null},_doType:function(type,val){if(type==="text"){type=0}if(type==="mask"){type=1}if(type==="date"){type=2}if(type==="datepicker"){type=3}if(type==="numeric"){type=4}if(type==="currency"){type=5}if(type==="percent"){type=6}if(typeof type!=="number"||type<0||type>6){if(typeof val==="number"){type=4}else if(val&&val.getMonth){type=2}else{type=0}}this._type=type;return type},_fillRowEditDialogTable:function(event_tr){var tableBody,cols=this.grid.options.columns,i,tr,input,colVal,colSettings,newColSettings,colKey,templateData,rowEditDialogRowTemplate=this.options.rowEditDialogRowTemplate,rowEditDialogRowTemplateID=this.options.rowEditDialogRowTemplateID,buttonId="#"+this.grid.container().attr("id")+"_igButton",parent;tableBody=$("#"+this.grid.container().attr("id")+"_ret table tbody");tableBody.empty();this._editors=this._editors||{};if(!event_tr){this._adding=true}for(i=0;i<cols.length;++i){templateData=[];colKey=cols[i].key;colSettings=this._getColumnSettingsByKey(colKey);shouldAdd=colSettings===null?true:false;colSettings=colSettings||{};if(event_tr){colVal=this._getVal(this._fixPrime(event_tr.attr("data-id")),colKey)}else{colVal=this._defVal(colKey,true)}if(colSettings&&colSettings.readOnly&&!this.options.showReadonlyEditors||cols[i].hidden){continue}templateData.push({headerText:cols[i].headerText,dataKey:colKey});if(rowEditDialogRowTemplateID){tr=this._jsr?$($("#"+rowEditDialogRowTemplateID).render(templateData)):$($.ig.tmpl($("#"+rowEditDialogRowTemplateID).html().fullTrim(),templateData))}else if(rowEditDialogRowTemplate){tr=this._jsr?$($.render[this.grid.id()+"_rowEditDialogRowTemplate"](templateData)):$($.ig.tmpl(this.options.rowEditDialogRowTemplate,templateData))}else{tr=$("<tr><td>"+cols[i].headerText+"</td><td data-key='"+colKey+"'><input /></td></tr>")}tr.appendTo(tableBody);input=$(tr.find(">td[data-key] input")[0]);if(!input.length){input=$(tr.find(">td[data-key] textarea")[0])}if(cols[i].dataType==="bool"){$.extend(true,colSettings,{editorOptions:{listItems:[true,false],button:"dropdown"}})}if(colSettings.readOnly){$.extend(true,colSettings,{editorOptions:{readOnly:true}})}if(colSettings.editorOptions){colSettings.editorOptions.width=_aNull(colSettings.editorOptions.width)?this.options.rowEditDialogFieldWidth:colSettings.editorOptions.width}else{colSettings.editorOptions={width:this.options.rowEditDialogFieldWidth}}if(shouldAdd){this.options.columnSettings.push($.extend(true,{},colSettings,{columnKey:colKey}))}this._createEditor(event_tr?event_tr.children().eq(i):this._newTR.children().eq(i),colKey,input);this._editors[colKey]=input;_filter(input,"setValue",colVal)}$(buttonId).igButton("option","disabled",true)},_openRowEditDialog:function(event,tr){var dialog=$("#"+this.grid.container().attr("id")+"_ret"),noCancel,$this=this;noCancel=this._fire("rowEditDialogOpening",event,{dialogElement:dialog,owner:this});if(noCancel){dialog.data("tr",tr);this._fillRowEditDialogTable(tr);this._calcRowDialogLeftTop(dialog);setTimeout(function(){if(dialog.find("input")[0]){dialog.find("input")[0].focus()}dialog.focus();$this._fire("rowEditDialogOpened",event,{dialogElement:dialog,owner:$this})},100);if(event!==null&&event!==undefined){event.preventDefault();event.stopPropagation()}return 1}return 0},_renderRowEditDialog:function(e,tr){var dialog,caption,dialogContent,noCancel,limit,f=this,okCancelContainer;dialog=$("<div></div>").appendTo(this.grid._rootContainer()).attr("id",this.grid.container().attr("id")+"_ret").css("position","absolute").addClass(this.css.rowEditDialog).data("efh","1").hide();dialog.data("tr",tr);noCancel=this._fire("rowEditDialogContentsRendering",e,{dialogElement:dialog,owner:f});if(noCancel){$("<div></div>").appendTo(this.grid._rootContainer()).attr("id",this.grid.container().attr("id")+"_block_ret").css("position","absolute").addClass(this.css.blockArea).data("efh","1").hide();caption=$("<div></div>").appendTo(dialog).addClass(this.css.rowEditDialogHeaderCaption);$("<span></span>").appendTo(caption).text(this._loc("rowEditDialogCaption")).addClass(this.css.rowEditDialogHeaderCaptionTitle);$("<span></span>").appendTo($("<a></a>").appendTo(caption).attr("href","#").attr("role","button").addClass("ui-dialog-titlebar-close ui-corner-all")).bind({click:$.proxy(this._closeRowEditDialog,this)}).addClass("ui-icon ui-icon-closethick");dialogContent=$("<div></div>").appendTo(dialog).addClass("ui-dialog-content").css("overflow","auto").css("height",this.options.rowEditDialogContentHeight);$("<table><tbody></tbody></table>").appendTo(dialogContent).addClass(this.css.rowEditDialogTable);okCancelContainer=$("<div></div>").appendTo($("<div></div>").appendTo(dialog).addClass(this.css.rowEditDialogOkCancelButton)).addClass("ui-dialog-buttonset");$("<button/>").appendTo(okCancelContainer).igButton({labelText:this._loc("cancel"),width:this.options.rowEditDialogOkCancelButtonWidth}).bind({mousedown:$.proxy(this._closeRowEditDialog,this)});$("<button/>").appendTo(okCancelContainer).igButton({labelText:this._loc("done"),disabled:true,width:this.options.rowEditDialogOkCancelButtonWidth}).bind({click:$.proxy(this._rowEditDialogDoUpdate,this)}).attr("id",this.grid.container().attr("id")+"_igButton");if(this._hc===true){limit=$("#"+this.grid.element[0].id.split("_")[0]+"_container")}else if(this.options.rowEditDialogContainment==="owner"){limit=this.grid.container()}else{limit="window"}dialog.bind({keydown:function(e){if(e.keyCode===$.ui.keyCode.ESCAPE){f._closeRowEditDialog(e)}}}).draggable({containment:limit,handle:caption}).attr("role","dialog").attr("tabIndex",-1);if(typeof Modernizr!=="object"||Modernizr.touch===false){dialog.resizable({minHeight:dialog.outerHeight()/4,minWidth:dialog.outerWidth()/2,containment:"parent",resize:$.proxy(this._resizeHandler,this)})}this._fire("rowEditDialogContentsRendered",e,{dialogElement:dialog,owner:this})}},_setResizableEnv:function(){var e=$("#"+this.grid.container().attr("id")+"_ret"),rCont=e.find(">.ui-dialog-content"),hCont=e.find(">.ui-dialog-titlebar"),bCont=e.find(">.ui-dialog-buttonpane"),pad=rCont.outerHeight()-rCont.height();this._resizeCont=rCont;this._heightDifference=hCont.outerHeight(true)+bCont.outerHeight(true)+pad},_resizeHandler:function(event,ui){var u=ui.originalElement;this._resizeCont.css({height:u.height()-this._heightDifference+"px"})},_rowEditDialogDoUpdate:function(e){var ret=$("#"+this.grid.container().attr("id")+"_ret"),tds=ret.find("table tbody [data-key]"),tr=ret.data("tr"),i,vals={},oldvals={},colKey,arg,rowID,addRow;if(this.findInvalid()){return 0}for(i=0;i<tds.length;++i){colKey=tds.eq(i).attr("data-key");vals[colKey]=_filter(this._editors[colKey],"getValue");oldvals[colKey]=this._editors[colKey]._oldCellVal}addRow=!(tr!==null&&tr!==undefined&&tr.length>0);rowID=addRow?-1:this._prime(tr.children().first());arg={oldValues:oldvals,values:vals,rowID:rowID,keepEditing:false,update:true,rowAdding:addRow};if(!this._fire("editRowEnding",e,arg)){return 0}if(!addRow){this._update(tr.data().id,tr[0],vals)}else{if(this._fire("rowAdding",e,arg)){this._update(vals);this._fire("rowAdded",e,arg)}}this._fire("editRowEnded",e,arg);this._closeRowEditDialog(e);return 1},_closeRowEditDialog:function(e){var noCancel=true,dialog=$("#"+this.grid.container().attr("id")+"_ret");noCancel=this._fire("rowEditDialogClosing",e,{dialogElement:dialog,owner:this});if(noCancel){$("#"+this.grid.container().attr("id")+"_block_ret").fadeToggle();$("#"+this.grid.container().attr("id")+"_ret").data("tr",null).fadeToggle();delete this._defValue;if(e){e.preventDefault();e.stopPropagation()}delete this._editors;this._fire("rowEditDialogClosed",e,{dialogElement:dialog,owner:this});return 1}return 0},_lastEditor:function(){var key,last=this._prevEdit,all=this._editors;if(!last){for(key in all){if(all.hasOwnProperty(key)){last=all[key]||last}}}return last},_end:function(){this._delHover();this._endEdit()},destroy:function(){var div=this._div(),grid=this.grid,el=grid.element;if(!this._evts||!el||!div){return this}this._hComboRemove(true);this._doButtons(2);div.unbind(this._evts);if(this._renderTouchUI&&this.options.editMode!=="row"){div.unbind(this._tEvts)}if(this._sEvts){el.parent().unbind(this._sEvts)}el.unbind(this._gEvts);this._end();if(grid.hasFixedColumns()&&this._evts){grid.fixedContainer().unbind(this._evts)}this._headerRendered(1);this._evts=this._sEvts=this._gEvts=null;$.Widget.prototype.destroy.call(this);if(this.options.editMode==="rowedittemplate"){$("#"+this.grid.container().attr("id")+"_block_ret").remove();$("#"+this.grid.container().attr("id")+"_ret").remove()}return this},_hidingFinished:function(){this._headerRendered()},_hidingFinishing:function(){var key,shift,tr=this._addTR,grid=this.grid,edits=this._editors;if(!grid._initialized){return}this._endEdit();this._doButtons(2);if(this._groupTD1){this._groupTD1.remove();this._groupTD2.remove();delete this._groupTD1;delete this._groupTD2;this._cShift=this._cShiftAdd=-1}if(tr){shift=this._colShift(null,tr[0]);this._addTrShift=[];this._newTrShift=[];while(shift-->0){this._addTrShift[shift]=tr.children()[shift];this._newTrShift[shift]=this._newTR.children()[shift]}tr.remove();this._newTR.remove();if(this.grid.hasFixedColumns()){this.grid.fixedHeadersTable().find("thead tr[data-new-row], thead tr[data-add-row]").remove()}}for(key in edits){if(edits.hasOwnProperty(key)&&edits[key]){edits[key].remove()}}this._newTR=this._addTR=this._editors=this._mapAdd=this._map=null;this._cShiftAdd=this._cShift=-1;this._hComboRemove()},_rerender:function(args){var iTD,val,ta,row,cell,col,td,tds,key,grid=this.grid,tx=grid.pendingTransactions(),i=tx?tx.length:0,tbody=grid.element.children("tbody"),tmpl=grid.options.jQueryTemplating;
if(args&&args.owner&&args.owner.id()!==grid.id()){return}while(i-->0){ta=tx[i];cell=ta.type==="cell";row=tbody.find('[data-id="'+ta.rowId+'"]');if(ta.type==="row"||ta.type==="newrow"||cell){row.addClass(grid.css.modifiedRecord);tds=row.length&&!tmpl?row.children("td"):null;iTD=tds?tds.length:0;while(iTD-->0){td=$(tds[iTD]);key=this._key(td);val=undefined;if(ta.row){val=ta.row[key]}else if(cell&&key===ta.col){val=ta.value}if(val!==undefined){col=_aNull(key)?null:this._gridCol(key);val=col?grid._renderCell(val,col):$.ig.formatter(val);td.html(val)}}}if(ta.type==="deleterow"||ta.type==="insertrow"){row.addClass(grid.css.deletedRecord);$("#"+this.grid.id()+"_fixed").find('[data-id="'+ta.rowId+'"]').addClass(grid.css.deletedRecord)}}},_bind:function(args){var t1,t2,grid=this.grid,data=grid.dataSource._data,i=data?data.length:0,txNew=this.grid.dataSource.pendingTransactions(),len=txNew?txNew.length:0,txLast=this._txLast,lenLast=txLast?txLast.length:0;this._addRowNum=Math.max(this._addRowNum||1,i+1);this._endEdit();if(!args){if(i&&_aNull(grid.options.primaryKey)&&_aNull(data[0].ig_pk)){while(i-->0){data[i].ig_pk=i}}}else if(args.owner&&args.owner.id()!==this.grid.id()){return}if(len<1){return}if(len===lenLast){while(lenLast-->0){t1=txNew[lenLast];t2=txLast[lenLast];if(t1.tid!==t2.tid||t1.value!==t2.value||t1.row!==t2.row){break}}if(lenLast<0){return}}txLast=this._txLast=[];while(len-->0){txLast[len]={tid:txNew[len].tid,value:txNew[len].value,row:txNew[len].row}}if(this._fire("dataDirty",this._evt||{},{})&&this.options.enableDataDirtyException){_throw("dataDirtyException")}},_fixPrime:function(key,ds){var grid=this.grid,o=grid.options,prime=o.primaryKey,primeType,col=_aNull(prime)?null:this._gridCol(prime),data=grid.dataSource._data;if(ds){if(!col){key.ig_pk=ds=data.length;return ds}ds=key[prime];if(_aNull(ds)){ds=key[prime]=this._defVal(prime,1)}key=ds}primeType=data&&data.length>0&&!_aNull(data[0][prime])?typeof data[0][prime]:null;key=col&&(col.dataType==="number"||col.dataType==="numeric"||primeType==="number")?parseInt(key,10):key;if(!col&&(!data[key]||data[key].ig_pk!==key)){_throw("noPrimaryKeyException")}return key},_getRecord:function(id){var i=-1,data=this.grid.dataSource._data,len=data.length,prime=this.grid.options.primaryKey;id=this._fixPrime(id);if(_aNull(prime)){prime="ig_pk"}while(++i<len){if(data[i][prime]===id){return data[i]}}},_getVal:function(rowId,key){var val,ta,grid=this.grid,tx=grid.dataSource.pendingTransactions(),i=tx?tx.length:0;while(i-->0&&val===undefined){ta=tx[i];if(ta.rowId===rowId){if(ta.row){val=ta.row[key]}else if(ta.type==="cell"&&ta.col===key){val=ta.value}}}if(val===undefined){rowId=this._getRecord(rowId);val=rowId?rowId[key]:null}return grid._fixDate(val,this._gridCol(key))},_childrenWithAddRowEnabled:function(opts,inheritedRule){var i,j,cl,clr;if(opts.columnLayouts){for(i=0;i<opts.columnLayouts.length;i++){cl=opts.columnLayouts[i];clr=inheritedRule||false;if(cl.features&&cl.features.length>0){for(j=0;j<cl.features.length;j++){if(cl.features[j].name==="Updating"){clr=_aNull(cl.features[j].enableAddRow)?clr:cl.features[j].enableAddRow;break}}}if(clr){return true}}}return false},_update:function(rowId,tr,val,col,td){var tx,i,vDiv,vScroll,del=val===undefined,grid=this.grid,oGrid=grid.options,autoCommit=oGrid.autoCommit,ds=grid.dataSource,hasFixedCols=this.grid.hasFixedColumns(),key=this._fixPrime(rowId,tr?null:ds),virt=grid._virtualDom,cols,gridCol,nr,updateObj={},recObj,groupedGrid,layoutKeys=[],tdContent;if(col&&td){updateObj[col]=val;recObj=jQuery.extend(true,{},updateObj)}else{updateObj=jQuery.extend(true,{},val);recObj=this.grid.findRecordByKey(rowId);if(recObj){if(grid.options.columnLayouts&&grid.options.columnLayouts.length){for(i=0;i<grid.options.columnLayouts.length;++i){layoutKeys.push(grid.options.columnLayouts[i].key)}}$.each(recObj,function(prop,propVal){if(updateObj&&!updateObj.hasOwnProperty(prop)&&$.ig.indexInArray(layoutKeys,prop)===-1){updateObj[prop]=propVal}})}}if(del){this._isRowDeleted=true}i=tr?del?ds.deleteRow(rowId,autoCommit):col?ds.setCellValue(key,col,val,autoCommit):ds.updateRow(key,updateObj,autoCommit):ds.addRow(key,rowId,autoCommit);tx=ds.pendingTransactions();i=tx?tx.length:0;while(i-->0){if(rowId===tx[i].rowId){if(tx[i].row&&col){tx[i].row[col]=val}break}}if(!del&&(virt||autoCommit&&(rowId===null||rowId===undefined||recObj===null||recObj[grid.options.primaryKey]===null))){vDiv=$("#"+grid.id()+(virt?"_scrollContainer":"_scroll"))[0];vScroll=vDiv?vDiv.scrollTop:0;if(virt&&oGrid.virtualizationMode==="continuous"){grid._rerenderVirtualRecordsContinuous()}if(virt&&oGrid.virtualizationMode==="fixed"){grid._renderVirtualRecords()}if(vScroll){vDiv.scrollTop=vScroll}if(virt){grid._onVirtualVerticalScroll()}return}if(autoCommit&&grid.options.primaryKey&&recObj&&recObj[grid.options.primaryKey]){if(hasFixedCols){if(grid._isFixedElement($(tr))){this.grid.element.find('tbody tr[data-id="'+tr.getAttribute("data-id")+'"]').data("id",recObj[grid.options.primaryKey]).attr("data-id",recObj[grid.options.primaryKey])}else{$("#"+grid.id()+"_fixed").find('[data-id="'+tr.getAttribute("data-id")+'"]').data("id",recObj[grid.options.primaryKey]).attr("data-id",recObj[grid.options.primaryKey])}}$(tr).data("id",recObj[grid.options.primaryKey]);$(tr).attr("data-id",recObj[grid.options.primaryKey])}if(!tr){groupedGrid=grid.element.children("tbody").children("tr.ui-iggrid-groupedrow").length>0;tr=groupedGrid===true?grid.element.data("igGridGroupBy")._renderNewRow(rowId,key):grid.renderNewRow(rowId,key);tr=grid.element.children("tbody").children("tr");tr=tr[tr.length-1];this._addRowNum++;delete this._defValue;this._trigger("internalrowadded")}else{if(del){if(autoCommit){if(oGrid.virtualization||oGrid.rowVirtualization){if(oGrid.virtualizationMode==="continuous"){grid._rerenderVirtualRecordsContinuous()}else{if(this.grid._startRowIndex+this.grid._virtualRowCount===this.grid._totalRowCount){this.grid._startRowIndex--}this.grid._totalRowCount--;grid._renderVirtualRecords()}tr=null}else{nr=$(tr).next("tr[data-container='true']");$(tr).remove();if(nr.length===1){nr.remove()}if(hasFixedCols){$("#"+this.grid.id()+"_fixed").find('[data-id="'+$(tr).attr("data-id")+'"]').remove();this.grid.element.data("igGridColumnFixing")._syncContainerHeights()}}this._trigger("internalrowdeleted")}else if(hasFixedCols){$("#"+this.grid.id()+"_fixed").find('[data-id="'+$(tr).attr("data-id")+'"]').addClass(grid.css.deletedRecord)}return $(tr).addClass(grid.css.deletedRecord)}cols=oGrid.columns;val={};i=cols.length;while(i-->0){key=cols[i].key;val[key]=this._getVal(rowId,key)}val=tr!==1?grid._renderRow(col&&td?val:updateObj,tr,rowId):null;if(!_aNull(val)){tr=val}}if(tr&&tr!==1&&!autoCommit){if(hasFixedCols){if(grid._isFixedElement($(tr))){this.grid.element.find('tbody tr[data-id="'+tr.getAttribute("data-id")+'"]').addClass(grid.css.modifiedRecord)}else{$("#"+this.grid.id()+"_fixed").find('[data-id="'+tr.getAttribute("data-id")+'"]').addClass(grid.css.modifiedRecord)}}$(tr).addClass(grid.css.modifiedRecord)}},_columnFixed:function(args){this._cfUpdateDataSkipRows(args);if(args.isFixed){if(args.isInit){this.grid.fixedContainer().bind(this._evts);if(this.options.enableAddRow){this._newTR=this.grid.headersTable().find("thead tr[data-new-row]")}if(this._isRowDeleted){this.grid.element.data("igGridColumnFixing")._syncRowStyles()}}}this._mapAdd=null},_cfUpdateDataSkipRows:function(args){if(args.visibleIndex===-1){return}var $td,colspan,visibleIndex=args.visibleIndex,isDataSkip=args.colInd===-1,$unfixedTR=this.grid.headersTable().find("thead tr[data-new-row]"),$fixedTR=this.grid.fixedHeadersTable().find("thead tr[data-new-row]");if(args.isFixed){if(isDataSkip){$unfixedTR.find("[data-skip]:nth-child(1)").detach().appendTo($fixedTR);$unfixedTR=this.grid.headersTable().find("thead tr[data-add-row]");$fixedTR=this.grid.fixedHeadersTable().find("thead tr[data-add-row]");$unfixedTR.find("[data-skip]:nth-child(1)").detach().appendTo($fixedTR)}else{$td=$unfixedTR.find("td:nth-child("+visibleIndex+")");$td.detach().appendTo($fixedTR);$unfixedTR=this.grid.headersTable().find("thead tr[data-add-row]");$fixedTR=this.grid.fixedHeadersTable().find("thead tr[data-add-row]");$td=$unfixedTR.find("td[colspan]").eq(0);colspan=parseInt($td.attr("colspan"),10);$td.attr("colspan",colspan-1);if($fixedTR.find("td[colspan]").length===0){$td.clone().appendTo($fixedTR).attr("colspan",1)}else{$td=$fixedTR.find("td[colspan]");colspan=parseInt($td.attr("colspan"),10);$td.attr("colspan",colspan+1)}}}else{if(isDataSkip){$fixedTR.find("[data-skip]:last-child").detach().prependTo($unfixedTR);$unfixedTR=this.grid.headersTable().find("thead tr[data-add-row]");$fixedTR=this.grid.fixedHeadersTable().find("thead tr[data-add-row]");$fixedTR.find("[data-skip]:last-child").detach().prependTo($unfixedTR)}else{$td=$fixedTR.find("td:nth-child("+visibleIndex+")");$td.detach().prependTo($unfixedTR);$unfixedTR=this.grid.headersTable().find("thead tr[data-add-row]");$fixedTR=this.grid.fixedHeadersTable().find("thead tr[data-add-row]");$td=$fixedTR.find("td[colspan]").eq(0);colspan=parseInt($td.attr("colspan"),10);if(colspan-1===0){$td.remove()}else{$td.attr("colspan",colspan-1)}$td=$unfixedTR.find("td[colspan]");colspan=parseInt($td.attr("colspan"),10);$td.attr("colspan",colspan+1)}}},_addDSSuccessHandler:function(){var me=this,fS,grid=me.grid;if(me._addChangesSuccessHandler!==null&&me._addChangesSuccessHandler!==undefined){grid.dataSource._removeChangesSuccessHandler(me._addChangesSuccessHandler)}fS=me.options.saveChangesSuccessHandler;if(fS){if($.type(fS)==="string"&&window[fS]&&$.type(window[fS])==="function"){fS=window[fS]}}if($.type(fS)!=="function"){fS=null}me._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(me._addChangesSuccessHandler)},_addDSErrorHandler:function(){var me=this,fE,grid=me.grid;if(me._addChangesErrorHandler!==null&&me._addChangesErrorHandler!==undefined){grid.dataSource._removeChangesErrorHandler(me._addChangesErrorHandler)}if(me.options.saveChangesErrorHandler){fE=me.options.saveChangesErrorHandler;if($.type(fE)==="string"&&window[fE]&&$.type(window[fE])==="function"){fE=window[fE]}if($.type(fE)==="function"){me._addChangesErrorHandler=function(jqXHR,textStatus,errorThrown){fE(jqXHR,textStatus,errorThrown)};grid.dataSource._addChangesErrorHandler(me._addChangesErrorHandler)}}},_injectGrid:function(grid){var me=this,hg,cl,opts=me.options;me.grid=grid;me._cShiftAdd=me._cShift=-1;if(me._gEvts!==undefined&&me._gEvts!==null){grid.element.unbind(this._gEvts)}me._gEvts={iggridvirtualrendering:function(){me._end()},ighierarchicalgridrowexpanded:function(){me._end()},iggriddatabinding:function(e,args){me._bind(args)},iggriddatarendering:function(e,args){me._bind(args)},iggridrowsrendering:function(e,args){me._bind(args)},iggriduidirty:function(){me._end()},iggridresizingcolumnresizing:function(){me._end()},iggridvirtualrecordsrender:function(e,args){me._rerender(args)},iggridrowsrendered:function(e,args){me._rerender(args)}};if(this.options.enableAddRow){me._gEvts.iggridheaderrenderedinternal=function(){me._headerRendered()};me._gEvts.iggridheaderextracellsmodified=function(){me._hierHeaderInit()}}me._gEvts.iggridgroupbygroupedcolumnschanged=function(e,args){me._groupedColumnsChanged(args)};grid.element.bind(this._gEvts);me._ti=parseInt(grid.options.tabIndex||1,10);me._evts={iggridselectionmousedown:function(e){me._onEvt(e,1)},mousedown:function(e){var origEvt;if($.ig.util.isIE7===true||$.ig.util.isIE8===true){origEvt=$.extend(true,{},e)}else{origEvt=e}setTimeout(function(){me._onEvt(origEvt,1)},0)},click:function(e){me._onEvt(e,2)},dblclick:function(e){me._onEvt(e,3)},keydown:function(e){me._onEvt(e,4)},focus:function(e){me._onEvt(e,5)},blur:function(e){me._onEvt(e,6)},mousemove:function(e){me._onEvt(e,7)},mouseleave:function(e){me._onEvt(e,8)},MSPointerUp:function(e){me._onEvt(e,14)},pointerup:function(e){me._onEvt(e,14)}};me._tEvts={touchstart:function(e){me._onEvt(e,11)},touchend:function(e){me._onEvt(e,12)},touchmove:function(e){me._onEvt(e,13)}};me._addDSSuccessHandler();me._addDSErrorHandler();if(me.grid.options._isHierarchicalGrid&&me.grid._originalOptions){if(opts.inherit){me.grid._shouldAlwaysRenderChildIndicator=me._childrenWithAddRowEnabled(me.grid.options,opts.enableAddRow)}else{me.grid._shouldAlwaysRenderChildIndicator=me._childrenWithAddRowEnabled(me.grid.options)}if(!me.grid.dataSource.settings.schema.layouts){hg=me.grid.element.closest(".ui-iggrid-root").data("igHierarchicalGrid");cl=[];hg._parseLayouts(cl,"",me.grid._originalOptions);me.grid.dataSource.settings.schema.layouts=cl}}this._renderTouchUI=typeof Modernizr==="object"&&Modernizr.touch===true;if(window.navigator.msPointerEnabled||window.navigator.pointerEnabled){me.grid.element.css("-ms-touch-action","none")}if(String(grid.options.templatingEngine).toLowerCase()==="jsrender"){this._jsr=true;if(opts.rowEditDialogRowTemplate&&typeof opts.rowEditDialogRowTemplate==="string"){$.templates(this.grid.id()+"_rowEditDialogRowTemplate",opts.rowEditDialogRowTemplate)}}}});$.extend($.ui.igGridUpdating,{version:"14.1.20141.1020"});$.widget("ui.igEditorFilter",{setFocus:function(delay,toggle){var provider=this.options.provider;setTimeout(function(){provider.setFocus(toggle)},delay)},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.isMessageDisplayed():false},destroy:function(){this.options.provider.destroy()}});$.extend($.ui.igEditorFilter,{version:"14.1.20141.1020"});$.ig.EditorProvider=$.ig.EditorProvider||Class.extend({createEditor:function(updating,key,columnSetting,tabIndex,format,dataType,cellValue,element){return null},getValue:function(){return""},setValue:function(val,updating){return false},setFocus:function(toggle){return null},setSize:function(width,height){return null},removeFromParent:function(){return false},destroy:function(){return this},validator:function(){return null},validate:function(noLabel){var validator=this.validator();return validator?!validator.validate():true},isValid:function(){var validator=this.validator();return validator?validator.isValidState():true}});$.ig.EditorProviderDefault=$.ig.EditorProviderDefault||$.ig.EditorProvider.extend({createEditor:function(updating,key,columnSetting,tabIndex,format,dataType,cellValue,element){var v,o={};if(columnSetting){o=columnSetting.editorOptions||o;o.type=columnSetting.editorType||o.type}v=o.type;if(o.enableUTCDates!==false&&updating.grid.options.enableUTCDates){o.enableUTCDates=true}if(!v){if(dataType==="bool"){o.listItems=["true","false"];o.button="dropdown";this._bool=o.readOnly=o.dropDownOnReadOnly=o.spinOnReadOnly=o.spinWrapAround=true}else if(format==="currency"||format==="percent"||format==="date"){v=format;o.displayFactor=o.displayFactor||1}else if(dataType==="number"){v="numeric"}else if(dataType==="date"){v="date"}else if(!dataType){v=cellValue;v=typeof v==="number"?"numeric":v&&v.getTime?"date":null}o.type=v}if(format==="int"){o.maxDecimals=0}else if(format==="double"&&!o.maxDecimals){o.maxDecimals=100}else if(format&&v&&v.toString().indexOf("date")===0&&!o.dateInputFormat){o.dateInputFormat=format}if((v==="datepicker"||v===3)&&!o.button){o.button="dropdown"}o.tabIndex=tabIndex;o._eo=o._eo||{tc:o.textChanged,kd:o.keydown};o.textChanged=function(e,ui){updating._notifyChanged();if(o._eo.tc){o._eo.tc(e,ui)}};o.keydown=function(e,ui){updating._13=o.textMode&&!o.hideEnterKey;updating._notifyEditorKey(e,key);if(o._eo.kd){o._eo.kd(e,ui)}};v=element||$("<span />");if(!v.igEditor){_throw("igEditorException")}if(o.id){v.attr("id",o.id)}o.excelNavigationMode=updating.options.excelNavigationMode;v=v.igEditor(o);this.editor=v.data("igEditor");return v},getValue:function(){var val=this.editor.value();return this._bool?val==="true":val},setValue:function(val){return this.editor.value(this._bool?val&&val!=="false"?"true":"false":val)},setSize:function(width,height){this.editor._listRemove();this.editor._width(width);this.editor._height(height)},setFocus:function(){this.editor.setFocus(-1)},removeFromParent:function(){return this.editor.remove()},destroy:function(){this.editor.destroy()},validator:function(){return this.editor.validator()},validate:function(noLabel){return this.editor.validate(noLabel)},isValid:function(){return this.editor.isValid()}});$.ig.EditorProviderCombo=$.ig.EditorProviderCombo||$.ig.EditorProvider.extend({createEditor:function(updating,key,columnSetting,tabIndex,format,dataType,cellValue,element){var v,o={};if(columnSetting){o=columnSetting.editorOptions||o}o.tabIndex=tabIndex;o._eo=o._eo||{tc:o.textChanged,kd:o.keydown};o.textChanged=function(e,ui){updating._notifyChanged();if(o._eo.tc){o._eo.tc(e,ui)}};o.keydown=function(e,ui){if(!ui||ui.keyCode===9||!ui.owner||!ui.owner._ddOn){updating._notifyEditorKey(e,key)}if(o._eo.kd){return o._eo.kd(e,ui)}};v=element||$("<span />");if(!v.igCombo){_throw("igComboException")}if(o.id){v.attr("id",o.id)}v=v.igCombo(o);this.editor=v.data("igCombo");return v},getValue:function(){return this.editor.options.allowCustomValue?this.editor.text():this.editor.value()},setValue:function(val){var combo=this.editor,o=combo.options;if(o.filteringType){combo.selectedIndex(-1);combo.activeIndex(-1);if(!o.parentCombo){combo.dataBind()}}return o.allowCustomValue?combo.text(val===null?o.nullText||"":val):combo.value(val)},setSize:function(width,height){this.editor.options.width=width;this.editor.options.height=height;this.editor._doSize()},setFocus:function(){this.editor.setFocus(-1);this.editor.fieldElem[0].select()},removeFromParent:function(){return this.editor.remove()},validator:function(){return this.editor.validator()},destroy:function(){this.editor.destroy()}});$.ig.EditorProviderRating=$.ig.EditorProviderRating||$.ig.EditorProvider.extend({createEditor:function(updating,key,columnSetting,tabIndex,format,dataType,cellValue,element){var foc,v,o={};if(columnSetting){o=columnSetting.editorOptions||o}o._eo=o._eo||{vc:o.valueChange};o.valueChange=function(e,ui){updating._notifyChanged();if(o._eo.vc){return o._eo.vc(e,ui)}};v=element||$("<div />");if(!v.igRating){_throw("igRatingException")}if(o.id){v.attr("id",o.id)}v=v.igRating(o);this.editor=v.data("igRating");foc=this.editor._foc;if(foc){foc.attr("tabIndex",tabIndex);foc.keydown(function(e){updating._notifyEditorKey(e,key)})}return v},getValue:function(){return this.editor.value()},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.destroy()}});$.ig.EditorProviderCheckbox=$.ig.EditorProviderCheckbox||$.ig.EditorProvider.extend({createEditor:function(updating,key,columnSetting,tabIndex,format,dataType){var elem,me=this,o=columnSetting;me.updating=updating;me.none=dataType==="bool"?false:null;me.element=elem=$('<span tabindex="'+tabIndex+'"/>').addClass("ui-igedit-field ui-state-default ui-corner-all").css({overflow:"hidden",textAlign:"center",outline:0,background:"#ffffff",display:"block"}).click(function(){me.setValue(0,updating)}).focus(function(){me.css(true,true)}).blur(function(){me.css(true)}).mouseover(function(){me.css(null,true)}).mouseleave(function(){me.css()}).keydown(function(e){updating._notifyEditorKey(e,key);if(e&&e.keyCode===32){_stop(e);me.setValue(0,updating)}});o=o?o.editorOptions:null;if(o&&o.id){elem.attr("id",o.id)}elem=$('<span class="ui-state-default ui-corner-all ui-igcheckbox-small" />').css("display","inline-block").appendTo(elem);$('<span class="ui-icon ui-icon-check ui-igcheckbox-small-on" />').css("display","block").appendTo(elem);return this.element},el:function(depth){var e=this.element;while(depth-->0){e=$(e.children()[0])}return e},getValue:function(){return this.value},setValue:function(val,updating){var css="ui-igcheckbox-small-off";if(updating){val=!this.value}this.value=val||val===false?val:this.none;if(val){this.el(2).removeClass(css)}else{this.el(2).addClass(css)}if(updating){updating._notifyChanged()}},css:function(foc,on){var i=2,css=foc?"ui-state-focus":"ui-state-hover";while(i-->0){if(on){this.el(i).addClass(css)}else{this.el(i).removeClass(css)}}},setSize:function(width,height){var elem=this.el(0);this.el(1).css("marginTop",Math.floor((height-15)/2)+"px");this.css();this.css(true);elem.css({width:width-_int(elem,"borderLeftWidth")-_int(elem,"borderRightWidth"),height:height-_int(elem,"borderTopWidth")-_int(elem,"borderBottomWidth")})},setFocus:function(toggle){this.el(0).focus();if(toggle){this.setValue(0,this.updating)}}})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Layout Manager 14.1.20141.1020
*
* Copyright (c) 2011-2014 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
*	jquery-1.7.0.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.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,element){this.options.items=[];this.options.gridLayout.useOffset=true;this._opt={eventHandlers:{},gridLayout:null,borderLayout:null,scrollBarWidth:$.ig.util.getScrollWidth(),scrollBarHeight:$.ig.util.getScrollHeight(),setOptionCall:false};if(options&&options.items){options.items=$.extend(true,[],options.items)}$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){var self=this;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)}this._opt.eventHandlers.elementResizeHandler=function(e){var noCancel=self._triggerInternalResizing(e);if(noCancel){self.reflow(false,e)}};this.element.on("resize",this._opt.eventHandlers.elementResizeHandler);this._opt.eventHandlers.windowResizeHandler=function(e){var noCancel=self._triggerInternalResizing(e);if(noCancel){self.reflow(false,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||value.marginLeft||value.marginTop||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._opt.setOptionCall=true;this._initGridLayout();this._opt.setOptionCall=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._updateGLItemsConfig();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,event){if(this.options.layoutMode==="grid"){this._reflowGlConfiguration(forceReflow,this.options.gridLayout.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){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)}},_initGridLayout:function(){var e=this.element,offset=e.offset(),top=0,left=0,gl,items,ml,mt,col,row,colSpan,iw,ih,rowSpan,item,itemData,width,height,elements,i,j;if(this._opt.setOptionCall){elements=this._opt.gridLayout.elements}this._opt.gridLayout=$.extend(true,{},this.options.gridLayout,{items:$.extend(true,[],this.options.items),sortedItems:[],elements:elements||$(),minColCount:1,columnWidthRatio:null,columnHeightRatio:null,containerWidthNoScroll:e.width(),containerHeightNoScroll:e.height(),resizeItems:false,animating:false,autoAdjustColumnWidth:false,autoAdjustColumnHeight:false,useOffset:(this.element.css("position")==="static"||this.element.css("position")==="fixed")&&this.options.gridLayout.useOffset?true:false});gl=this._opt.gridLayout;items=gl.items;ml=gl.marginLeft;mt=gl.marginTop;this._analyzeGlConfiguration();this._opt.gridLayout.resizeItems=!!(this._opt.gridLayout.columnWidthRatio||this._opt.gridLayout.columnHeightRatio);iw=gl.columnWidth;ih=gl.columnHeight;if(items&&items.length>0){for(i=0;i<items.length;i++){itemData=items[i];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(!this._opt.setOptionCall){this._trigger(this.events.itemRendering,null,{itemData:itemData,index:i});if(this.element.children(":eq("+i+")").length>0){item=this.element.children(":eq("+i+")")}else{item=$("<div></div>").appendTo(this.element)}item.addClass(this.css.item).addClass(this.css.gridItemAbs).attr("data-index",i);gl.elements=gl.elements.add(item)}else{item=gl.elements.eq(i)}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.css({top:top,left:left,width:width,height:height});itemData.item=item;if(colSpan>gl.minColCount){gl.minColCount=colSpan}if(!this._opt.setOptionCall){this._trigger(this.events.itemRendered,null,{item:item,itemData:itemData,index:i})}}}else{if(e.children().length===0){for(i=0;i<gl.rows;i++){for(j=0;j<gl.cols;j++){item=$("<div></div>").appendTo(this.element).addClass(this.css.item).attr("data-index",i*gl.cols+j).width(iw).height(ih);this._trigger("itemrendered",null,{item:item});item.addClass(this.css.gridItemAbs);left=j*iw+(j+1)*ml;top=i*ih+(i+1)*mt;left+=j===0?ml:0;item.css({top:top,left:left})}}}}gl.sortedItems=$.extend(true,[],items).sort(this._glSortItemsByPositionOrder);this._trigger(this.events.rendered,null,{items:this.options.items});this._reflowGlConfiguration(false,0,null)},_updateGLItemsConfig:function(){var gl=this._opt.gridLayout,glItems=gl.items,items=this.options.items,currEl,glItem,item,itemData,i;for(i=0;i<items.length;i++){glItem=glItems[i];currEl=glItem&&glItem.item;itemData=items[i];itemData.colSpan=typeof itemData.colSpan==="number"?itemData.colSpan:1;itemData.rowSpan=typeof itemData.rowSpan==="number"?itemData.rowSpan:1;itemData.rowIndex=typeof itemData.rowIndex==="number"?itemData.rowIndex:Math.floor(i/gl.cols);itemData.colIndex=typeof itemData.colIndex==="number"?itemData.colIndex:i%gl.cols;if(currEl.length>0){itemData.item=currEl}else{this._trigger(this.events.itemRendering,null,{itemData:itemData,index:i});if(this.element.children(":eq("+i+")").length>0){item=this.element.children(":eq("+i+")")}else{item=$("<div></div>").appendTo(this.element)}item.addClass(this.css.item).addClass(this.css.gridItemAbs).attr("data-index",i);itemData.item=item;gl.elements=gl.elements.add(item);this._trigger(this.events.itemRendered,null,{item:item,itemData:itemData,index:i})}if(itemData.colSpan>gl.minColCount){gl.minColCount=itemData.colSpan}}while(gl.elements.length>items.length){Array.prototype.pop.call(gl.elements).remove()}gl.items=$.extend(true,[],items);gl.sortedItems=$.extend(true,[],items).sort(this._glSortItemsByPositionOrder);this._reflowGlConfiguration(true,0)},_glReflowNeeded:function(){var e=this.element,gl=this._opt.gridLayout,newContainerWidthNoScroll=e.width()-($.ig.util.hasVerticalScroll(e)?this._opt.scrollBarWidth:0),newContainerHeightNoScroll=e.height()-($.ig.util.hasHorizontalScroll(e)?this._opt.scrollBarHeight:0);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=gl.sortedItems,newContainerWidthNoScroll=e.width()-($.ig.util.hasVerticalScroll(e)?this._opt.scrollBarWidth:0),newContainerHeightNoScroll=e.height()-($.ig.util.hasHorizontalScroll(e)?this._opt.scrollBarHeight:0),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._reflowGlConfiguration(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){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._reflowGlConfiguration(false,animationDuration,event)}else{this._triggerInternalResized(event)}}}}},_analyzeGlItems:function(){var config=this._opt.gridLayout,items=config.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){config.cols=cols}if(rows>0){config.rows=rows}},_analyzeGlWidth:function(){var config=this._opt.gridLayout,elWidth=this.element.width(),units;if(config.columnWidth){if(typeof config.columnWidth==="string"){if(config.columnWidth.indexOf("%")!==-1){units=config.columnWidth.substring(0,config.columnWidth.length-1);units=parseInt(units,10)/100;if(!isNaN(units)&&units>0){this._opt.gridLayout.columnWidthRatio=units;config.columnWidth=Math.floor(elWidth*units-config.marginLeft)}}else{units=parseInt(config.columnWidth,10);if(!isNaN(units)&&units>0){config.columnWidth=units}}}}},_analyzeGlHeight:function(){var config=this._opt.gridLayout,elHeight=this.element.height(),units;if(config.columnHeight){if(typeof config.columnHeight==="string"){if(config.columnHeight.indexOf("%")!==-1){units=config.columnHeight.substring(0,config.columnHeight.length-1);units=parseInt(units,10)/100;if(!isNaN(units)&&units>0){this._opt.gridLayout.columnHeightRatio=units;config.columnHeight=Math.floor(elHeight*units-config.marginTop)}}else{units=parseInt(config.columnHeight,10);if(!isNaN(units)&&units>0){config.columnHeight=units}}}}},_analyzeGlNotSetOptions:function(){var config=this._opt.gridLayout,elWidth=this.element.width(),elHeight=this.element.height(),itemsLength=config.items.length,columnWidthOption=typeof config.columnWidth==="number"&&config.columnWidth>0,columnHeightOption=typeof config.columnHeight==="number"&&config.columnHeight>0,colsOption=typeof config.cols==="number"&&config.cols>0,rowsOption=typeof config.rows==="number"&&config.rows>0;if(!colsOption){if(rowsOption){config.cols=Math.ceil(itemsLength/config.rows)}else{if(columnWidthOption){config.cols=Math.floor(elWidth/(config.columnWidth+config.marginLeft));config.rows=Math.ceil(itemsLength/config.cols)}else if(columnHeightOption){config.rows=Math.floor(elHeight/(config.columnHeight+config.marginTop));config.cols=Math.ceil(itemsLength/config.rows)}else{config.cols=Math.ceil(Math.sqrt(itemsLength));config.rows=Math.ceil(itemsLength/config.cols)}}}else if(!rowsOption){config.rows=Math.ceil(itemsLength/config.cols)}if(!columnWidthOption){config.columnWidth=Math.floor(elWidth*(1/config.cols)-config.marginLeft);config.columnWidthRatio=1/config.cols}if(!columnHeightOption){config.columnHeight=Math.floor(elHeight*(1/config.rows)-config.marginTop);config.columnHeightRatio=1/config.rows}if(!columnHeightOption&&!colsOption&&!config.columnWidthRatio){config.autoAdjustColumnHeight=true}if(!columnWidthOption&&!rowsOption&&!config.columnHeightRatio){config.autoAdjustColumnWidth=true}},_analyzeGlConfiguration:function(){this._analyzeGlWidth();this._analyzeGlHeight();this._analyzeGlItems();this._analyzeGlNotSetOptions()},_glSortItemsByPositionOrder:function(item1,item2){return item1.rowIndex!==item2.rowIndex?item1.rowIndex-item2.rowIndex:item1.colIndex-item2.colIndex},_initBorderLayout:function(){var left,right,center,header,footer,rwidth,lwidth,container,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();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){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(){if(this.options.destroyItems){this.element.empty()}else{this.element.children().removeClass(this.css.item).removeClass(this.css.gridItemAbs).removeClass(this.css.gridItemRel).removeAttr("data-index")}this.element.off("resize",this._opt.eventHandlers.elementResizeHandler)},_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}$(window).off("resize",this._opt.eventHandlers.windowResizeHandler);return this}});$.extend($.ui.igLayoutManager,{version:"14.1.20141.1020"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Splitter 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *  jquery-1.4.4.js
 *	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},_opt:null,widget:function(){return this.element},_createWidget:function(options,element){this._opt={eventHandlers:{}};$.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._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;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;reducedSize=this._reducedSize();if(this.options[this._getOrientation("size")]){defaultSize=this.options[this._getOrientation("size")]-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)}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(/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}size=this.options.panels[i].size;reducedSize.length+=1}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 this._const.touchEvents[event]}return event},_isTouch:function(){var isTouch=typeof window.Modernizr==="object"&&window.Modernizr.touch===true;return isTouch},_createSplitter:function(){var collapseButtons=$("<div><span></span></div><div><span></span></div>"),bar=$("<div></div>").attr("tabindex",0),div;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)},_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;self.autoResize=true;this._opt.eventHandlers.documentMouseUp=function(){self.autoResize=false;self._stopDrag(self);self.autoResize=true;self._lastMove=null};$(document).bind(this._getEvent("mouseup")+"."+this.element.attr("id"),this._opt.eventHandlers.documentMouseUp);this._opt.eventHandlers.documentMouseMove=function(ev){var noCancel=true;self._currentMove=self._isTouch()?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}};$(document).bind(this._getEvent("mousemove")+"."+this.element.attr("id"),this._opt.eventHandlers.documentMouseMove);this._opt.eventHandlers.windowResize=function(ev){var noCancel=self._triggerLayoutRefreshing();if(noCancel){self._panelsLayout();self._triggerLayoutRefreshed()}};$(window).bind("resize."+this.element.attr("id"),this._opt.eventHandlers.windowResize);this._addBarHandlers(this._splitter);this._addCollapseButtonHandlers($(this._splitter.bar.children()[0]),0);this._addCollapseButtonHandlers($(this._splitter.bar.children()[1]),1)},_isDragging:function(){return Math.abs(this._currentMove-this._lastMove)>this.options.dragDelta},_addBarHandlers:function(splitter){var self=this;splitter.bar.bind(this._getEvent("mousedown"),{self:this},this._startDrag);$(splitter.bar.children()[2]).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(){$(this).addClass(self.css.barHover)});splitter.bar.bind(this._getEvent("mouseleave"),function(){$(this).removeClass(self.css.barHover)})}splitter.bar.bind(this._getEvent("focus"),function(){$(this).addClass(self.css.barActive)});splitter.bar.bind(this._getEvent("blur"),function(){$(this).removeClass(self.css.barActive)})},_kbNavigation:function(event){var splitter=event.data.self,noCancel=true;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 splitter=event.data.self,left,right;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.originalEvent.touches[0][splitter._getOrientation("page")]:event[splitter._getOrientation("page")];if($(event.target).is("span")){splitter._capturedElement=splitter._clone($($(event.target).parent()).parent())}else{splitter._capturedElement=splitter._clone(event.target)}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.originalEvent.touches[0].pageX:event.pageX;splitter._mouseStartY=splitter._isTouch()?event.originalEvent.touches[0].pageY:event.pageY}}}return false}return false},_clone:function(bar){var clonedBar=$(bar).clone();clonedBar.css({position:"absolute",top:$(bar).offset().top,left:$(bar).offset().left,"z-index":9999}).fadeTo(0,.7);$(document.body).append(clonedBar);return clonedBar},_addCollapseButtonHandlers:function(button,index){var self=this;button.bind(this._getEvent("mouseenter"),function(e){$($(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(e){$($(this).parent()).addClass(self.css.barHover);$(this).removeClass(self.css.collapseButtonHover)});button.bind("mousedown touchstart",function(e){$(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.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")||[],i;for(i=0;i<splitters.length;i++){if(splitters[i][0]!==this.element){$(splitters[i]).data("igSplitter")._panelsLayout()}}},_panelsLayout:function(){var i,outerSize=(this._panels.length-1)*this._splitter.bar[this._getOrientation("outerSize")](true),size=this._getSize(this._getOrientation("size"));for(i=0;i<this._panels.length;i++){if(!this._panels[i].options.collapsed){outerSize+=this._handlerPanelSize(this._panels[i],outerSize,size)}else{this._handlerPanelSize(this._panels[i],outerSize,size);$(this._splitter.bar.children()[(i+1)%2]).hide();$(this._splitter.bar.children()[i]).removeClass(this.css[this.options.orientation+"CollapseButton"+(i%2===0?"Left":"Right")+"Expanded"]);$($(this._splitter.bar.children()[i]).children()).removeClass(this.css[this.options.orientation+"CollapseButton"+(i%2===0?"Left":"Right")+"ExpandedIcon"]);$(this._splitter.bar.children()[i]).addClass(this.css[this.options.orientation+"CollapseButton"+(i%2===0?"Left":"Right")+"Collapsed"]);$($(this._splitter.bar.children()[i]).children()).addClass(this.css[this.options.orientation+"CollapseButton"+(i%2===0?"Left":"Right")+"CollapsedIcon"])}}if(outerSize<size){this._createPanel(size,outerSize,this._panels.length-1)}this._splitter.bar[this._getOrientation("oppositeSize")](this.element[this._getOrientation("oppositeSize")]()-2);$(this._splitter.bar.children()[2]).find("span")[this._getOrientation("oppositeSize")](this.element[this._getOrientation("oppositeSize")]())},_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)}},_createPanel:function(size,outerSize,index){if(index===undefined){index=0}var 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){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}return}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};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};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()},destroy:function(){var evtHandlers=this._opt.eventHandlers,i,splitters,index;this._removeEventHandlers();this._removeClasses();this.element.empty();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);return this}});$.extend($.ui.igSplitter,{version:"14.1.20141.1020"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI SplitButton 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 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.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(){var _opt,options=this.options,defaultItem=this._getDefaultItem(options.defaultItemName);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 noCancel,_options=this._options;if(!_options.expandButton.is(":focus")){if(!_options.isExpanded){_options.expandButton.focus()}return}if(_options.justFocused){_options.justFocused=false}else{if(_options.isExpanded){noCancel=this._triggerCollapsing(e);if(noCancel){this.collapse(e)}}else{noCancel=this._triggerExpanding(e);if(noCancel){this.expand(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,ui){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._options.expandButton.trigger("igtoolbarbuttonclick")}},_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(event){var args={owner:this};return this._trigger(this.events.collapsing,null,args)},_triggerCollapsed:function(event){var args={owner:this};return this._trigger(this.events.collapsed,null,args)},_triggerExpanding:function(event){var args={owner:this};return this._trigger(this.events.expanding,null,args)},_triggerExpanded:function(event){var args={owner:this};return this._trigger(this.events.expanded,null,args)},widget:function(){return this.element},collapse:function(e){var self=this,_opt=this._options;_opt.itemsList.hide(0,function(){self.element.removeClass(self.css.active);_opt.expandButton.removeClass(self.css.focus);_opt.isExpanded=false;if(e){self._triggerCollapsed(e)}})},expand:function(e){var self=this,_opt=this._options;_opt.itemsList.show(0,function(){self.element.addClass(self.css.active);_opt.isExpanded=true;if(e){self._triggerExpanded(e)}})},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).empty();delete _opt.expandButton;delete _opt.itemsList}});$.extend($.ui.igSplitButton,{version:"14.1.20141.1020"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI infragistics.olapxmladatasource.js 14.1.20141.1020
*
* Copyright (c) 2011-2014 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","String:g","IComparable:h","Number:i","Number:j","Single:k","Number:l","String:m","Array:n","RegExp:o","RuntimeTypeHandle:p","MethodInfo:q","MethodBase:r","MemberInfo:s","ParameterInfo:t","TypeCode:u","Enum:v","ConstructorInfo:w","IEnumerable:x","IEnumerator:y","Func$1:z","MulticastDelegate:aa","IntPtr:ab","AbstractEnumerator:ac","IEnumerable$1:ad","IEnumerator$1:ae","ICollection$1:af","IList$1:ag","IArrayList:ah","Array:ai","ICollection:aj","CompareCallback:ak","List$1:al","IList:am","IDisposable:an","IArray:ao","Script:ap","Date:aq","Date:ar","Number:as","Func$3:at","Action$1:au","IDictionary$2:aw","Dictionary$2:ax","IDictionary:ay","Dictionary:az","IEqualityComparer$1:a0","KeyValuePair$2:a1","NotImplementedException:a2","Error:a3","GenericEnumerable$1:a4","GenericEnumerator$1:a5","INotifyCollectionChanged:a6","NotifyCollectionChangedEventHandler:a7","NotifyCollectionChangedEventArgs:a8","EventArgs:a9","NotifyCollectionChangedAction:ba","ObservableCollection$1:bd","INotifyPropertyChanged:be","PropertyChangedEventHandler:bf","PropertyChangedEventArgs:bg","Delegate:bh","ReadOnlyCollection$1:bj","NameValueCollection:bl","IOrderedEnumerable$1:bu","Enumerable:bz","Func$2:b0","SortedList$1:b1","Math:b2","Number:b3","Number:b4","Number:b5","Number:b6","Number:b7","Number:b8","Number:b9","ArgumentNullException:ca","AggregateException:cn","ArgumentException:co","AsyncCompletedEventArgs:cq","ListSortDirection:cs","Environment:cu","InvalidOperationException:cv","Debug:cw","ICredentials:cz","NetworkCredential:c0","Uri:c1","UploadStringCompletedEventHandler:c2","UploadStringCompletedEventArgs:c3","WebClient:c4","Encoding:c5","UTF8Encoding:c6","UnicodeEncoding:c7","WebHeaderCollection:c8","Task$1:c9","Task:da","JQueryPromise:db","Action:dc","TaskStatus:dd","TaskCompletionSource$1:de","JQueryDeferred:df","JQuery:dg","JQueryObject:dh","Element:di","ElementAttributeCollection:dj","ElementCollection:dk","WebStyle:dl","ElementNodeType:dm","Document:dn","EventListener:dp","IElementEventHandler:dq","ElementEventHandler:dr","ElementAttribute:ds","JQueryPosition:dt","JQueryCallback:du","JQueryEvent:dv","JQueryUICallback:dw","FaultCode:dx","FaultException:dy","FaultReason:dz","FaultException$1:d0","StringBuilder:d1","TaskFactory:d4","Tuple$2:d5","JavaScriptSerializer:d6","XObject:f9","XmlNode:ga","XmlNodeList:gb","XmlNamedNodeMap:gc","XmlNodeType:gd","XmlDocument:ge","XmlElement:gf","XmlLinkedNode:gg","XmlAttribute:gh","XmlUtils:gi","XAttribute:gj","XNode:gk","XContainer:gl","XElement:gm","XName:gn","XNamespace:go","XDocument:gp"]);$.ig.util.defType("TaskStatus:dd","Enum",{init:function(){$.ig.$ep.init.call(this)},$type:new $.ig.Type("TaskStatus",$.ig.$ep.$type)},true);$.ig.util.defType("ListSortDirection:cs","Enum",{init:function(){$.ig.$ep.init.call(this)},$type:new $.ig.Type("ListSortDirection",$.ig.$ep.$type)},true);$.ig.util.defType("NotifyCollectionChangedAction:ba","Enum",{init:function(){$.ig.$ep.init.call(this)},$type:new $.ig.Type("NotifyCollectionChangedAction",$.ig.$ep.$type)},true);$.ig.util.defType("AbstractEnumerable:a","Object",{a:null,init:function(a){$.ig.$op.init.call(this);this.a=a},getEnumerator:function(){return new $$t.ac(this.a().getEnumerator())},$type:new $.ig.Type("AbstractEnumerable",$.ig.$ot,[$.ig.IEnumerable.prototype.$type])},true);$.ig.util.defType("AbstractEnumerator:ac","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);$.ig.util.defType("IEnumerable$1:ad","Object",{$type:new $.ig.Type("IEnumerable$1",null,[$.ig.IEnumerable.prototype.$type])},true);$.ig.util.defType("ICollection$1:af","Object",{$type:new $.ig.Type("ICollection$1",null,[$$t.$ad.$type.specialize(0),$.ig.IEnumerable.prototype.$type])},true);$.ig.util.defType("IList$1:ag","Object",{$type:new $.ig.Type("IList$1",null,[$$t.$af.$type.specialize(0),$$t.$ad.$type.specialize(0),$.ig.IEnumerable.prototype.$type])},true);$.ig.util.defType("IArrayList:ah","Object",{$type:new $.ig.Type("IArrayList",null)},true);$.ig.util.defType("List$1:al","Object",{$t:null,__inner:null,init:function($t,initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}this.e={};this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this);this.__inner=new $.ig.Array},init1:function($t,initNumber,a){this.e={};this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this);this.__inner=new $.ig.Array;if(this.b(0,a)){return}var c=a.getEnumerator();while(c.moveNext()){var b=c.current();this.add1(b)}},init2:function($t,initNumber,a){this.e={};this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this);this.__inner=new $.ig.Array},o:function(a,b){this.__inner[a]=b},j:function(a,b){this.__inner.insert(a,b)},f:function(a){this.__inner.add(a)},m:function(a){this.__inner.removeAt(a)},h:function(){this.__inner.clear()},item:function(a,b){if(arguments.length===2){this.o(a,b);return b}else{return this.__inner[a]}},indexOf:function(a){return this.__inner.indexOf(a)},insert:function(a,b){this.j(a,b)},removeAt:function(a){this.m(a)},count:function(){return this.__inner.length},isReadOnly:function(){return false},add1:function(a){this.f(a)},clear:function(){this.h()},contains1:function(a){return this.__inner.contains(a)},copyTo:function(a,b){for(var c=0;c<this.__inner.length;c++){a[b+c]=this.__inner[c]}},remove1:function(a){var b=this.indexOf(a);if(b<0){return false}this.m(b);return true},getEnumerator:function(){var $self=this;var $iter=function(){return function(){return{$state:0,$this:$self,$current:null,$a:null,$b:null,current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$b=this.$this.__inner.getEnumerator();this.$state=4;break;case 2:this.$a=this.$b.current();this.$current=this.$a;this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$b.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}()};return new $.ig.GenericEnumerator$1(this.$t,$iter())},asArrayList:function(){return this.__inner},b:function(a,collection_){var b=$.ig.util.cast($$t.$ah.$type,collection_);if(b!=null){this.__inner.insertRange1(a,b.asArrayList());return true}var c=$.ig.util.cast($$t.$ao.$type,collection_);if(c!=null){this.__inner.insertRange(a,c.asArray());return true}var d=$.ig.util.cast($$t.$ag.$type.specialize(this.$t),collection_);if(d!=null){for(var e=0;e<d.count();e++){this.__inner.insert(a+e,d.item(e))}return true}var f=$.isArray(collection_)?collection_:null;if(f!=null){this.__inner.insertRange(a,f);return true}return false},insertRange1:function(a,b){if(this.b(a,b)){return}var c=0;var e=b.getEnumerator();while(e.moveNext()){var d=e.current();this.__inner.insert(a+c,d);c++}},insertRange:function(a,b){if(this.b(a,b)){return}var c=0;var e=b.getEnumerator();while(e.moveNext()){var d=e.current();this.__inner.insert(a+c,d);c++}},removeRange:function(a,b){this.__inner.splice(a,b)},copyTo1:function(a,b){this.__inner.copyTo(a,b)},isFixedSize:function(){return false},add:function(a){this.f(a);return this.__inner.length-1},contains:function(a){return this.__inner.contains(a)},indexOf1:function(a){return this.__inner.indexOf(a)},insert1:function(a,b){this.j(a,b)},remove:function(a){var b=this.indexOf1(a);this.m(b)},sort:function(){var $self=this;var a=null;if($self.$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($self.$t==$.ig.Single.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($self.$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($self.$t==$$t.$aq.$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)}}$self.r(a)},r:function(a){this.__inner.sort(a)},sort1:function(a){var $self=this;$self.__inner.sort(function(b,c){var d=b;var e=c;return a(d,e)})},_capacity:0,capacity:function(value){if(arguments.length===1){this._capacity=value;return value}else{return this._capacity}},addRange:function(a){var c=a.getEnumerator();while(c.moveNext()){var b=c.current();this.__inner.add(b)}},toArray:function(){return this.__inner.slice(0)},forEach:function(a){},isSynchronized:function(){return true},e:null,syncRoot:function(){return this.e},$type:new $.ig.Type("List$1",$.ig.$ot,[$$t.$ag.$type.specialize(0),$$t.$ah.$type,$.ig.IList.prototype.$type])},true);$.ig.util.defType("KeyValuePair$2:a1","ValueType",{$tKey:null,$tValue:null,init:function($tKey,$tValue,initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$.ig.ValueType.prototype.init.call(this)},a:null,c:null,init1:function($tKey,$tValue,initNumber,a,b){this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$.ig.ValueType.prototype.init.call(this);this.a=a;this.c=b},key:function(){return this.a},value:function(){return this.c},$type:new $.ig.Type("KeyValuePair$2",$.ig.ValueType.prototype.$type)},true);$.ig.util.defType("IDictionary$2:aw","Object",{$type:new $.ig.Type("IDictionary$2",null,[$$t.$af.$type.specialize($$t.$a1.$type.specialize(this.$tKey,this.$tValue)),$$t.$ad.$type.specialize($$t.$a1.$type.specialize(this.$tKey,this.$tValue)),$.ig.IEnumerable.prototype.$type])},true);$.ig.util.defType("Dictionary$2:ax","Object",{$tKey:null,$tValue:null,__inner:null,__keys:null,init:function($tKey,$tValue,initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}this.g=null;this._useToString=false;this.a=false;this._needsEnsure=false;this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$.ig.$op.init.call(this);this.__inner=new $.ig.Dictionary(0);this.__keys=new $.ig.Dictionary(0)},init1:function($tKey,$tValue,initNumber,a){this.g=null;this._useToString=false;this.a=false;this._needsEnsure=false;this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$.ig.$op.init.call(this);this.__inner=new $.ig.Dictionary(1,a);this.__keys=new $.ig.Dictionary(0)},g:null,init2:function($tKey,$tValue,initNumber,a){this.g=null;this._useToString=false;this.a=false;this._needsEnsure=false;this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$.ig.$op.init.call(this);this.__inner=new $.ig.Dictionary(0);this.__keys=new $.ig.Dictionary(0);this.g=a},count:function(){return this.__inner.count()},item:function(a,b){if(arguments.length===2){this.__inner.item(this.i(a),b);this.__keys.item(this.i(a),a);return b}else{return this.__inner.item(this.i(a))}},length:function(){return this.__inner.length()},containsKey:function(a){return this.__inner.containsKey(this.i(a))},remove:function(a){var b=this.i(a);if(!this.__keys.containsKey(b)){return false}this.__inner.remove(b);this.__keys.remove(b);return true},clear:function(){this.__inner.clear();this.__keys.clear()},_useToString:false,a:false,_needsEnsure:false,j:function(key_){if(!this.a){this.a=true;this._needsEnsure=typeof key_=="object";if(!this._needsEnsure){this._useToString=!key_.getHashCode}}},i:function(key_){this.j(key_);if(this._needsEnsure){$.ig.util.ensureUniqueId(key_)}if(this.g!=null){return this.g.getHashCode(key_).toString()}if(this._useToString){return key_.toString()}else{return key_.getHashCode().toString()}},add:function(a,b){this.__inner.item(this.i(a),b);this.__keys.item(this.i(a),a)},tryGetValue:function(a,b){if(!this.__inner.containsKey(this.i(a))){b=null;return{ret:false,value:b}}b=this.__inner.item(this.i(a));return{ret:true,value:b};return{value:b}},keys:function(){var $self=this;var $iter=function(){return function(){return{$state:0,$this:$self,$current:null,$a:null,$b:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$b=this.$this.__keys.values().getEnumerator();this.$state=4;break;case 2:this.$a=this.$b.current();this.$current=this.$a;this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$b.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}()};return new $.ig.GenericEnumerable$1(this.$tKey,$iter)},values:function(){var $self=this;var $iter=function(){return function(){return{$state:0,$this:$self,$current:null,$a:null,$b:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$b=this.$this.__inner.values().getEnumerator();this.$state=4;break;case 2:this.$a=this.$b.current();this.$current=this.$a;this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$b.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}()};return new $.ig.GenericEnumerable$1(this.$tValue,$iter)},isReadOnly:function(){return false},add1:function(a){this.add(a.key(),a.value())},contains:function(a){return this.containsKey(a.key())},copyTo:function(a,b){throw new $$t.a2},remove1:function(a){this.remove(a.key());return true},f:function(){var $self=this;var $iter=function(){return function(){return{$state:0,$this:$self,$current:null,$a:null,$b:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$b=this.$this.__keys.values().getEnumerator();this.$state=4;break;case 2:this.$a=this.$b.current();this.$current=new $$t.a1(this.$tKey,this.$tValue,1,this.$a,this.$this.__inner.item(this.$this.i(this.$a)));this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$b.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}()};return new $.ig.GenericEnumerable$1($$t.$a1.$type.specialize(this.$tKey,this.$tValue),$iter)},getEnumerator:function(){return this.f().getEnumerator()},$type:new $.ig.Type("Dictionary$2",$.ig.$ot,[$.ig.IDictionary$2.prototype.$type.specialize(0,1),$.ig.IDictionary.prototype.$type])},true);$.ig.util.defType("GenericEnumerable$1:a4","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.a5(this.$t,this.a().getEnumerator())},$type:new $.ig.Type("GenericEnumerable$1",$.ig.$ot,[$$t.$ad.$type.specialize(0)])},true);$.ig.util.defType("IEnumerator$1:ae","Object",{$type:new $.ig.Type("IEnumerator$1",null,[$.ig.IEnumerator.prototype.$type])},true);$.ig.util.defType("GenericEnumerator$1:a5","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()},$type:new $.ig.Type("GenericEnumerator$1",$.ig.$ot,[$$t.$ae.$type.specialize(0)])},true);$.ig.util.defType("INotifyCollectionChanged:a6","Object",{$type:new $.ig.Type("INotifyCollectionChanged",null)},true);$.ig.util.defType("NotifyCollectionChangedEventArgs:a8","EventArgs",{init:function(initNumber,a){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$$t.$a9.init.call(this);this.f=a;this.c=new $$t.al($.ig.$op.$type,0);this.b=new $$t.al($.ig.$op.$type,0)},init1:function(initNumber,a,b,c){var $self=this;$$t.$a9.init.call(this);this.f=a;this.c=new $$t.al($.ig.$op.$type,0);if(this.f==1||this.f==2){this.c.add(b);this.i=c}if(this.f!=1){this.b=function(){var $ret=new $$t.al($.ig.$op.$type,0);$ret.add(b);return $ret}()}else{this.b=new $$t.al($.ig.$op.$type,0)}this.h=c},init2:function(initNumber,a,b,c,d){var $self=this;$$t.$a9.init.call(this);this.f=a;this.h=d;this.i=d;this.b=function(){var $ret=new $$t.al($.ig.$op.$type,0);$ret.add(b);return $ret}();this.c=function(){var $ret=new $$t.al($.ig.$op.$type,0);$ret.add(c);return $ret}()},f:null,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.$a9.$type)},true);$.ig.util.defType("ObservableCollection$1:bd","List$1",{$t:null,init:function($t,initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}this.$t=$t;this.$type=this.$type.specialize(this.$t);$$t.$al.init.call(this,this.$t)},init1:function($t,initNumber,a){this.$t=$t;this.$type=this.$type.specialize(this.$t);$$t.$al.init1.call(this,this.$t,1,a)},init2:function($t,initNumber,a){this.$t=$t;this.$type=this.$type.specialize(this.$t);$$t.$al.init2.call(this,this.$t,2,a)},o:function(a,b){var c=this.__inner[a];$$t.$al.o.call(this,a,b);if(this.propertyChanged!=null){this.t(new $$t.bg("Item[]"))}if(this.collectionChanged!=null){var d=new $$t.a8(2,2,b,c,a);this.s(d)}},h:function(){$$t.$al.h.call(this);if(this.propertyChanged!=null){this.t(new $$t.bg("Count"));this.t(new $$t.bg("Item[]"))}if(this.collectionChanged!=null){var a=new $$t.a8(0,4);this.s(a)}},j:function(a,b){$$t.$al.j.call(this,a,b);if(this.propertyChanged!=null){this.t(new $$t.bg("Count"));this.t(new $$t.bg("Item[]"))}if(this.collectionChanged!=null){var c=new $$t.a8(1,0,b,a);this.s(c)}},f:function(a){$$t.$al.f.call(this,a);if(this.propertyChanged!=null){this.t(new $$t.bg("Count"));this.t(new $$t.bg("Item[]"))}if(this.collectionChanged!=null){var b=new $$t.a8(1,0,a,this.count()-1);this.s(b)}},m:function(a){var b=this.__inner[a];$$t.$al.m.call(this,a);if(this.propertyChanged!=null){this.t(new $$t.bg("Count"));this.t(new $$t.bg("Item[]"))}if(this.collectionChanged!=null){var c=new $$t.a8(1,1,b,a);this.s(c)}},collectionChanged:null,propertyChanged:null,t:function(a){if(this.propertyChanged!=null){this.propertyChanged(this,a)}},s:function(a){if(this.collectionChanged!=null){this.collectionChanged(this,a)}},$type:new $.ig.Type("ObservableCollection$1",$$t.$al.$type.specialize(0),[$$t.$a6.$type,$$t.$be.$type])},true);$.ig.util.defType("ReadOnlyCollection$1:bj","Object",{$t:null,init:function($t,initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}this.c={};this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this)},init1:function($t,initNumber,a){this.c={};this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this);this.a=a},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},add1:function(a){},clear:function(){},contains1:function(a){return this.a.contains(a)},copyTo:function(a,b){this.a.copyTo(a,b)},remove1:function(a){return false},getEnumerator:function(){return this.a.getEnumerator()},isFixedSize:function(){return true},add:function(a){return-1},contains:function(a){return this.a.contains(a)},indexOf1:function(a){return this.a.indexOf(a)},insert1:function(a,b){},remove: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.$ag.$type.specialize(0),$.ig.IList.prototype.$type])},true);$.ig.util.defType("NameValueCollection:bl","Object",{a:null,init:function(){$.ig.$op.init.call(this);this.a=new $$t.ax(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);$.ig.util.defType("IOrderedEnumerable$1:bu","Object",{$type:new $.ig.Type("IOrderedEnumerable$1",null,[$$t.$ad.$type.specialize(0),$.ig.IEnumerable.prototype.$type])},true);$.ig.util.defType("Enumerable:bz","Object",{init:function(){$.ig.$op.init.call(this)},where$1:function($tSource,a){var $self=this;var $iter=function(){return function($tSource,a){return{$state:0,$this:$self,$current:null,$b:null,$c:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$c=this.$this.getEnumerator();this.$state=7;break;case 2:this.$b=this.$c.current();this.$state=3;break;case 3:if(a(this.$b)){this.$state=4}else{this.$state=6}break;case 4:this.$current=this.$b;this.$state=5;return true;case 5:this.$state=6;break;case 6:this.$state=7;break;case 7:if(this.$c.moveNext()){this.$state=2}else{this.$state=8}break;case 8:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,a)};return new $.ig.GenericEnumerable$1($tSource,$iter)},where$11:function($tSource,a){var $self=this;var $iter=function(){return function($tSource,a){return{$state:0,$this:$self,$current:null,$b:0,$c:null,$d:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$b=0;this.$state=1;break;case 1:this.$d=this.$this.getEnumerator();this.$state=7;break;case 2:this.$c=this.$d.current();this.$state=3;break;case 3:if(a(this.$c,this.$b)){this.$state=4}else{this.$state=6}break;case 4:this.$current=this.$c;this.$state=5;return true;case 5:this.$state=6;break;case 6:this.$b++;this.$state=7;break;case 7:if(this.$d.moveNext()){this.$state=2}else{this.$state=8}break;case 8:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,a)};return new $.ig.GenericEnumerable$1($tSource,$iter)},select$2:function($tSource,$tResult,a){var $self=this;var $iter=function(){return function($tSource,$tResult,a){return{$state:0,$this:$self,$current:null,$b:null,$c:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$c=this.$this.getEnumerator();this.$state=4;break;case 2:this.$b=this.$c.current();this.$current=a(this.$b);this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$c.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,$tResult,a)};return new $.ig.GenericEnumerable$1($tResult,$iter)},selectMany$2:function($tSource,$tResult,a){var $self=this;var $iter=function(){return function($tSource,$tResult,a){return{$state:0,$this:$self,$current:null,$b:null,$c:null,$d:null,$e:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$c=this.$this.getEnumerator();this.$state=8;break;case 2:this.$b=this.$c.current();this.$state=3;break;case 3:this.$e=a(this.$b).getEnumerator();this.$state=6;break;case 4:this.$d=this.$e.current();this.$current=this.$d;this.$state=5;return true;case 5:this.$state=6;break;case 6:if(this.$e.moveNext()){this.$state=4}else{this.$state=7}break;case 7:this.$state=8;break;case 8:if(this.$c.moveNext()){this.$state=2}else{this.$state=9}break;case 9:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,$tResult,a)};return new $.ig.GenericEnumerable$1($tResult,$iter)},ofType$1:function($tResult){var $self=this;var $iter=function(){return function($tResult){return{$state:0,$this:$self,$current:null,$a:null,$b:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$b=this.$this.getEnumerator();this.$state=7;break;case 2:this.$a=this.$b.current();this.$state=3;break;case 3:if($.ig.util.cast($tResult,this.$a)!==null){this.$state=4}else{this.$state=6}break;case 4:this.$current=this.$a;this.$state=5;return true;case 5:this.$state=6;break;case 6:this.$state=7;break;case 7:if(this.$b.moveNext()){this.$state=2}else{this.$state=8}break;case 8:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tResult)};return new $.ig.GenericEnumerable$1($tResult,$iter)},last$1:function($tSource){var a=$.ig.util.cast($$t.$ag.$type.specialize($tSource),this);if(a!=null){return a.item(a.count()-1)}var b=null;var d=this.getEnumerator();while(d.moveNext()){var c=d.current();b=c}return b},first$1:function($tSource){var b=this.getEnumerator();while(b.moveNext()){var a=b.current();return a}return null},firstOrDefault$1:function($tSource){var b=this.getEnumerator();while(b.moveNext()){var a=b.current();return a}return null},orderBy$2:function($tSource,$tKey,a){var $self=this;var b=new $$t.b1($tSource,$self);b.sort1(function(c,d){var e=c;var f=d;var g=a(e);var h=a(f);if($.ig.util.cast($$t.$h.$type,g)!==null){return $.ig.util.cast($$t.$h.$type,g).compareTo(h)}else{return g.toString().compareTo(h.toString())}});return b},orderByDescending$2:function($tSource,$tKey,a){var $self=this;var b=new $$t.b1($tSource,$self);b.sort1(function(c,d){var e=d;var f=c;var g=a(e);var h=a(f);if($.ig.util.cast($$t.$h.$type,g)!==null){return $.ig.util.cast($$t.$h.$type,g).compareTo(h)}else{return g.toString().compareTo(h.toString())}});return b},toList$1:function($tSource){var a=new $$t.al($tSource,1,this);return a},d:function(a,b){var $self=this;var $iter=function(){return function(a,b){return{$state:0,$this:$self,$current:null,$c:0,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$c=a;this.$state=5;break;case 2:this.$current=this.$c;this.$state=3;return true;case 3:this.$state=4;break;case 4:this.$c++;this.$state=5;break;case 5:if(this.$c<b){this.$state=2}else{this.$state=6}break;case 6:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}(a,b)};return new $.ig.GenericEnumerable$1($.ig.Number.prototype.$type,$iter)},concat$1:function($tSource,a){var $self=this;var $iter=function(){return function($tSource,a){return{$state:0,$this:$self,$current:null,$b:null,$c:null,$d:null,$e:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$c=this.$this.getEnumerator();this.$state=4;break;case 2:this.$b=this.$c.current();this.$current=this.$b;this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$c.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=6;break;case 6:this.$e=a.getEnumerator();this.$state=9;break;case 7:this.$d=this.$e.current();this.$current=this.$d;this.$state=8;return true;case 8:this.$state=9;break;case 9:if(this.$e.moveNext()){this.$state=7}else{this.$state=10}break;case 10:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,a)};return new $.ig.GenericEnumerable$1($tSource,$iter)},max:function(){var a=true;var b=0;var d=this.getEnumerator();while(d.moveNext()){var c=d.current();if(a){a=false;b=c}else{b=Math.max(b,c)}}return b},max$1:function($tSource,a){return this.select$2($tSource,$.ig.Number.prototype.$type,a).max()},min:function(){var a=true;var b=0;var d=this.getEnumerator();while(d.moveNext()){var c=d.current();if(a){a=false;b=c}else{b=Math.min(b,c)}}return b},min$1:function($tSource,a){return this.select$2($tSource,$.ig.Number.prototype.$type,a).max()},count$1:function($tSource){var a=0;var c=this.getEnumerator();while(c.moveNext()){var b=c.current();a++}return a},reverse$1:function($tSource){var $self=this;var $iter=function(){return function($tSource){return{$state:0,$this:$self,$current:null,$a:null,$b:0,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$a=new $$t.al($tSource,1,this.$this);this.$state=1;break;case 1:this.$b=this.$a.count()-1;this.$state=5;break;case 2:this.$current=this.$a.__inner[this.$b];this.$state=3;return true;case 3:this.$state=4;break;case 4:this.$b--;this.$state=5;break;case 5:if(this.$b>0){this.$state=2}else{this.$state=6}break;case 6:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource)};return new $.ig.GenericEnumerable$1($tSource,$iter)},cast$1:function($tResult){if(this==null){throw new $$t.ca("source")}var a=$.ig.util.cast($$t.$ad.$type.specialize($tResult),this);if(a!=null){return a}var b=new $$t.al($tResult,0);var d=this.getEnumerator();while(d.moveNext()){var c=d.current();if($.ig.util.cast($tResult,c)!==null){b.add1(c)}else{b.add1(null)}}return b},take$1:function($tSource,a){var $self=this;var $iter=function(){return function($tSource,a){return{$state:0,$this:$self,$current:null,$b:null,$c:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$c=this.$this.getEnumerator();this.$state=9;break;case 2:this.$b=this.$c.current();this.$state=3;break;case 3:if(a>0){this.$state=4}else{this.$state=6}break;case 4:a--;this.$current=this.$b;this.$state=5;return true;case 5:this.$state=8;break;case 6:this.$state=-2;return false;case 7:this.$state=8;break;case 8:this.$state=9;break;case 9:if(this.$c.moveNext()){this.$state=2}else{this.$state=10}break;case 10:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,a)};return new $.ig.GenericEnumerable$1($tSource,$iter)},skip$1:function($tSource,a){var $self=this;var $iter=function(){return function($tSource,a){return{$state:0,$this:$self,$current:null,$b:null,$c:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$c=this.$this.getEnumerator();this.$state=8;break;case 2:this.$b=this.$c.current();this.$state=3;break;case 3:if(a<=0){this.$state=4}else{this.$state=6}break;case 4:this.$current=this.$b;this.$state=5;return true;case 5:this.$state=7;break;case 6:a--;this.$state=7;break;case 7:this.$state=8;break;case 8:if(this.$c.moveNext()){this.$state=2}else{this.$state=9}break;case 9:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,a)};return new $.ig.GenericEnumerable$1($tSource,$iter)},any$1:function($tSource){var b=this.getEnumerator();while(b.moveNext()){var a=b.current();return true}return false},contains$1:function($tSource,value_){var a=this.getEnumerator();while(a.moveNext()){var item_=a.current();if(item_===value_){return true}}return false},union$1:function($tSource,a){return null},toArray$1:function($tSource){var a=new $$t.al($tSource,1,this);return a.asArrayList()},elementAt$1:function($tSource,a){var b=$.ig.util.cast($$t.$ag.$type.specialize($tSource),this);if(b!=null){return b.item(a)
}return this.skip$1($tSource,a).first$1($tSource)},sum:function(){var a=0;var c=this.getEnumerator();while(c.moveNext()){var b=c.current();a+=b}return a},sum$1:function($tSource,a){return this.select$2($tSource,Number,a).sum()},$type:new $.ig.Type("Enumerable",$.ig.$ot)},true);$.ig.util.defType("SortedList$1:b1","List$1",{$tElement:null,init:function($tElement,a){this.$tElement=$tElement;this.$type=this.$type.specialize(this.$tElement);$$t.$al.init1.call(this,this.$tElement,1,a)},getEnumerator:function(){return $$t.$al.getEnumerator.call(this)},$type:new $.ig.Type("SortedList$1",$$t.$al.$type.specialize(0),[$$t.$bu.$type.specialize(0)])},true);$.ig.util.defType("IArray:ao","Object",{$type:new $.ig.Type("IArray",null)},true);$.ig.util.defType("AggregateException:cn","Error",{init:function(initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$$t.$a3.init.call(this)},init1:function(initNumber,a){$$t.$a3.init1.call(this,1,a)},init2:function(initNumber,a,b){$$t.$a3.init2.call(this,2,a,b)},$type:new $.ig.Type("AggregateException",$$t.$a3.$type)},true);$.ig.util.defType("ArgumentException:co","Error",{init:function(initNumber,a){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$$t.$a3.init1.call(this,1,a)},init1:function(initNumber,a,b){$$t.$a3.init1.call(this,1,a)},$type:new $.ig.Type("ArgumentException",$$t.$a3.$type)},true);$.ig.util.defType("ArgumentNullException:ca","Error",{init:function(a){$$t.$a3.init1.call(this,1,a+" cannot be null.")},$type:new $.ig.Type("ArgumentNullException",$$t.$a3.$type)},true);$.ig.util.defType("AsyncCompletedEventArgs:cq","EventArgs",{d:null,b:false,f:null,init:function(a,b,c){$$t.$a9.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.$a9.$type)},true);$.ig.util.defType("Environment:cu","Object",{init:function(){$.ig.$op.init.call(this)},a:function(){return"\n"},$type:new $.ig.Type("Environment",$.ig.$ot)},true);$.ig.util.defType("InvalidOperationException:cv","Error",{init:function(initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$$t.$a3.init1.call(this,1,"Invalid operation")},init1:function(initNumber,a){$$t.$a3.init1.call(this,1,a)},$type:new $.ig.Type("InvalidOperationException",$$t.$a3.$type)},true);$.ig.util.defType("Debug:cw","Object",{init:function(){$.ig.$op.init.call(this)},b:function(a,b){},c:function(a){},a:function(a){},$type:new $.ig.Type("Debug",$.ig.$ot)},true);$.ig.util.defType("ICredentials:cz","Object",{$type:new $.ig.Type("ICredentials",null)},true);$.ig.util.defType("NetworkCredential:c0","Object",{init:function(initNumber,a,b){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$$t.$c0.init1.call(this,1,a,b,String.empty())},init1:function(initNumber,a,b,c){$.ig.$op.init.call(this);this.c(a);this.b(b);this.a(c)},getCredential:function(a,b){return this},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},$type:new $.ig.Type("NetworkCredential",$.ig.$ot,[$$t.$cz.$type])},true);$.ig.util.defType("UploadStringCompletedEventArgs:c3","AsyncCompletedEventArgs",{i:null,init:function(a,b,c,d){$$t.$cq.init.call(this,b,c,d);this.i=a},result:function(){this.h();return this.i},$type:new $.ig.Type("UploadStringCompletedEventArgs",$$t.$cq.$type)},true);$.ig.util.defType("WebClient:c4","Object",{init:function(){$.ig.$op.init.call(this);this.c(new $$t.c8)},_d:null,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},uploadStringCompleted:null,h:function(a,b,c,d){var $self=this;$self.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.c3(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.c9(String,d,null)},g:function(a,b,c,d){a.e(b)},f:function(a,b,c,d){a.d(new $$t.a3(1,d))},$type:new $.ig.Type("WebClient",$.ig.$ot)},true);$.ig.util.defType("WebHeaderCollection:c8","NameValueCollection",{init:function(){$$t.$bl.init.call(this)},$type:new $.ig.Type("WebHeaderCollection",$$t.$bl.$type)},true);$.ig.util.defType("FaultCode:dx","Object",{init:function(a){$.ig.$op.init.call(this);this.a(a)},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},$type:new $.ig.Type("FaultCode",$.ig.$ot)},true);$.ig.util.defType("FaultException:dy","Error",{init:function(a,b,c){$$t.$a3.init.call(this);this.reason(a);this.code(b);this.action(c)},_action:null,action:function(value){if(arguments.length===1){this._action=value;return value}else{return this._action}},_code:null,code:function(value){if(arguments.length===1){this._code=value;return value}else{return this._code}},_reason:null,reason:function(value){if(arguments.length===1){this._reason=value;return value}else{return this._reason}},$type:new $.ig.Type("FaultException",$$t.$a3.$type)},true);$.ig.util.defType("FaultException$1:d0","FaultException",{$tDetail:null,init:function($tDetail,a,b,c,d){this.$tDetail=$tDetail;this.$type=this.$type.specialize(this.$tDetail);$$t.$dy.init.call(this,b,c,d);this.detail(a)},_detail:null,detail:function(value){if(arguments.length===1){this._detail=value;return value}else{return this._detail}},$type:new $.ig.Type("FaultException$1",$$t.$dy.$type)},true);$.ig.util.defType("FaultReason:dz","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);$.ig.util.defType("StringBuilder:d1","Object",{_internal:null,internal:function(value){if(arguments.length===1){this._internal=value;return value}else{return this._internal}},init:function(){$.ig.$op.init.call(this);this._internal=[]},d:function(str_){this._internal.push(str_);return this},e:function(a){var str_=a.b();this._internal.push(str_);return this},c:function(chr_){this._internal.push(chr_);return this},f:function(str_){this._internal.push(str_+String.fromCharCode(10));return this},g:function(index_,chr_){this._internal.splice(index_,0,chr_);return this},h:function(index_,str_){this._internal.splice(index_,0,str_);return this},i:function(startIndex_,length_){this._internal.splice(startIndex_,length_);return this},b:function(){return this._internal.join("")},$type:new $.ig.Type("StringBuilder",$.ig.$ot)},true);$.ig.util.defType("NotImplementedException:a2","Error",{init:function(){$$t.$a3.init1.call(this,1,"not implemented")},$type:new $.ig.Type("NotImplementedException",$$t.$a3.$type)},true);$.ig.util.defType("Encoding:c5","Object",{init:function(){$.ig.$op.init.call(this)},uTF8:function(){if($$t.$c5.g==null){$$t.$c5.g=new $$t.c6}return $$t.$c5.g},unicode:function(){if($$t.$c5.f==null){$$t.$c5.f=new $$t.c7}return $$t.$c5.f},getString: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.ca("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){},$type:new $.ig.Type("Encoding",$.ig.$ot)},true);$.ig.util.defType("UnicodeEncoding:c7","Encoding",{init:function(){$$t.$c5.init.call(this)},getString:function(bytes_,a,b){var c="";for(var i_=a;i_<b;i_=i_+2){if(bytes_[i_]==0){break}if(i_+1>=b){c=c+"�"}else{var d=bytes_[i_].toString(16);var e=bytes_[i_+1].toString(16);var f=$.ig.Number.prototype.parseInt(e+d,16);c=c+String.fromCharCode(f)}}return c},getByteCount:function(a,b,c){return 0},getBytes2:function(a,b,c,d,e){return 0},getBytes:function(a,b,c){return $$t.$c5.getBytes.call(this,a,b,c)},getBytes1:function(input_){var a=new Array(input_.length*2);for(var i_=0;i_<input_.length;i_++){var hex_=input_.charCodeAt(i_).toString(16).padLeft(4,"0");a[2*i_]=$.ig.Number.prototype.parseInt(hex_.substr(2),16);a[2*i_+1]=$.ig.Number.prototype.parseInt(hex_.substr(0,2),16)}return a},$type:new $.ig.Type("UnicodeEncoding",$$t.$c5.$type)},true);$.ig.util.defType("UTF8Encoding:c6","Encoding",{init:function(){$$t.$c5.init.call(this)},getString:function(bytes_,a,b){var ret_="";for(var i_=a;i_<b;i_++){if(bytes_[i_]==0){break}ret_=ret_+String.fromCharCode(bytes_[i_])}ret_=decodeURIComponent(escape(ret_));return ret_},getByteCount:function(a,b,c){return 0},getBytes2:function(a,b,c,d,e){return 0},getBytes:function(a,b,c){return $$t.$c5.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},$type:new $.ig.Type("UTF8Encoding",$$t.$c5.$type)},true);$.ig.util.defType("Task:da","Object",{_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_b:false,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},init:function(initNumber,a){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$$t.$da.init1.call(this,1,a,null)},init1:function(initNumber,a,b){var $self=this;$.ig.$op.init.call(this);var c=function(){};var d=function(e){if(e==null){$self.b(true)}else{$self.a(new $$t.cn(2,"Exception occurred during task execution",e))}};this.c(a.done(c).fail(d));this.d(b)},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(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},e:function(a){var $self=this;var b=function(){return a($self)};var c=function(d){return a($self)};var d=$self.c().done(b).fail(c);return new $$t.da(0,d)},f:function($tNewResult,a){var $self=this;var b=new $$t.de($tNewResult,0);var c=function(){try{var d=a($self);b.e(d)}catch(e_){b.d(e_)}};var d=function(e){return c()};var e=function(f){return c()};$self.c().done(d).fail(e);return b.b()},$type:new $.ig.Type("Task",$.ig.$ot)},true);$.ig.util.defType("Task$1:c9","Task",{$tResult:null,init:function($tResult,a,b){var $self=this;this.h=false;this.$tResult=$tResult;this.$type=this.$type.specialize(this.$tResult);$$t.$da.init1.call(this,1,a,b);var c=function(d){var e=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){var $self=this;return $$t.$da.e.call($self,function(b){return a(b)})},j:function($tNewResult,a){var $self=this;var b=function(c){return a(c)};return $self.k($.ig.$op.$type,b).k($tNewResult,function(c){return c.m()})},k:function($tNewResult,a){return $$t.$da.f.call(this,$tNewResult,a)},$type:new $.ig.Type("Task$1",$$t.$da.$type)},true);$.ig.util.defType("TaskCompletionSource$1:de","Object",{$tResult:null,_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},init:function($tResult,initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}this.$tResult=$tResult;this.$type=this.$type.specialize(this.$tResult);$$t.$de.init1.call(this,this.$tResult,1,null)},init1:function($tResult,initNumber,a){this.$tResult=$tResult;this.$type=this.$type.specialize(this.$tResult);$.ig.$op.init.call(this);this.a($.ig.util.deferred());this.b(new $$t.c9(this.$tResult,this.a().promise(),a))},c:function(){this.a().reject(null)},d:function(a){this.a().reject(a)},e:function(a){this.a().resolve(a)},_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},$type:new $.ig.Type("TaskCompletionSource$1",$.ig.$ot)},true);$.ig.util.defType("TaskFactory:d4","Object",{init:function(){$.ig.$op.init.call(this)},c:function(a,b){var $self=this;return new $$t.da(0,$self.b($self.a(a)).always(function(){return b(a)}))},d:function($tResult,a,b){var $self=this;var c=new $$t.de($tResult,0);$self.b($self.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 $self=this;var c=function(d){return b(d)};return $self.d($.ig.$op.$type,a,c).j($tResult,function(d){return 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);$.ig.util.defType("Tuple$2:d5","Object",{$t1:null,$t2:null,_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}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);$.ig.util.defType("Uri:c1","Object",{init:function(a){$.ig.$op.init.call(this);this.value(a)},_value:null,value:function(value){if(arguments.length===1){this._value=value;return value}else{return this._value}},$type:new $.ig.Type("Uri",$.ig.$ot)},true);$.ig.util.defType("JavaScriptSerializer:d6","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);$.ig.util.defType("XObject:f9","Object",{init:function(a){$.ig.$op.init.call(this);this.backingNode(a)},_backingNode:null,backingNode:function(value){if(arguments.length===1){this._backingNode=value;return value}else{return this._backingNode}},c:function(){},toString:function(){if(this.backingNode()!=null){return $$t.$gi.xmlNodeToString(this.backingNode())}else{return""}},$type:new $.ig.Type("XObject",$.ig.$ot)},true);$.ig.util.defType("XAttribute:gj","XObject",{init:function(a){$$t.$f9.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.$gi.b(this.backingNode())},$type:new $.ig.Type("XAttribute",$$t.$f9.$type)},true);$.ig.util.defType("XNode:gk","XObject",{init:function(a){$$t.$f9.init.call(this,a)},$type:new $.ig.Type("XNode",$$t.$f9.$type)},true);$.ig.util.defType("XContainer:gl","XNode",{init:function(a){$$t.$gk.init.call(this,a)},h:function(a){var b=null;for(var c=0;c<this.backingNode().childNodes.length;c++){var d=this.backingNode().childNodes.item(c);if(d.nodeType==1&&$$t.$gi.d(d)==a.c()&&d.namespaceURI==a.d()){b=d}}if(b==null){return null}else{return new $$t.gm(0,b)}},d:function(){return this.f(null)},e:function(a){return this.f(a)},f:function(a){var b=new $$t.al($$t.$gm.$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.$gi.d(d)==a.c()&&d.namespaceURI==a.d()){e=true}}else{e=true}if(e){b.add1(new $$t.gm(0,d))}}}return b},g:function(a){var b=this.backingNode();var c;if($.ig.util.cast($$t.$gp.$type,this)!==null){c=this.backingNode()}else{c=this.backingNode().ownerDocument}if($.ig.util.cast($$t.$gj.$type,a)!==null){a.e(b)}else if($.ig.util.cast($$t.$gm.$type,a)!==null){a.j(b,c)}},$type:new $.ig.Type("XContainer",$$t.$gk.$type)},true);$.ig.util.defType("XDocument:gp","XContainer",{init:function(initNumber,a){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$$t.$gl.init.call(this,a)},init1:function(initNumber){$$t.$gl.init.call(this,$$t.$gi.j())},c:function(){return 9},i:function(a){return new $$t.gp(0,$$t.$gi.n(a))},$type:new $.ig.Type("XDocument",$$t.$gl.$type)},true);$.ig.util.defType("XElement:gm","XContainer",{init:function(initNumber,a){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$$t.$gl.init.call(this,a)},init1:function(initNumber,a){$$t.$gm.init2.call(this,2,a,null)},init2:function(initNumber,a,b){$$t.$gl.init.call(this,$$t.$gi.o(a.c(),a.d()));var c=b==null?"":b.toString();this.i(c)},i:function(a){if(arguments.length===1){$$t.$gi.h(this.backingNode(),a);return a}else{return $$t.$gi.c(this.backingNode())}},c:function(){return 1},l:function(){return $$t.$gn.e($$t.$gi.d(this.backingNode()),this.backingNode().namespaceURI)},k:function(a){return new $$t.gj($$t.$gi.i(this.backingNode(),a.c(),a.d()))},j:function(a,b){if(this.backingNode().ownerDocument!=b){this.backingNode($$t.$gi.p(b,this.backingNode()))}a.appendChild(this.backingNode())},$type:new $.ig.Type("XElement",$$t.$gl.$type)},true);$.ig.util.defType("XmlUtils:gi","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.$gi.a()){return $$t.$gi.m(a)}else{return $$t.$gi.l(a)}},xmlNodeToString:function(a){if($$t.$gi.a()){return $$t.$gi.f(a)}else{return $$t.$gi.e(a)}},j:function(){var a;if($$t.$gi.a()){a=$$t.$gi.m("<dummy/>");a.removeChild(a.documentElement)}else{a=$$t.$gi.k()}return a},o:function(a,b){var doc_=$$t.$gi.j();if($$t.$gi.a()){return doc_.createElementNS(b,a)}else{var name_=a;var namespaceURI_=b;return doc_.createNode(1,name_,namespaceURI_)}},c:function(a){if($$t.$gi.a()){return a.textContent}else{var node_=a;return node_.text}},h:function(a,b){if($$t.$gi.a()){a.textContent=b}else{var node_=a;var text_=b;node_.text=text_}},p:function(a,b){if($$t.$gi.a()){return a.importNode(b,true)}else{return b}},d:function(a){if($$t.$gi.a()){return a.localName}else{var node_=a;return node_.baseName}},i:function(a,b,c){if($$t.$gi.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.$gi.a()){return a.nodeValue}else{var attr_=a;return attr_.value}},$type:new $.ig.Type("XmlUtils",$.ig.$ot)},true);$.ig.util.defType("XName:gn","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.$go.c(this.b)},e:function(a,b){return new $$t.gn(a,b)},$type:new $.ig.Type("XName",$.ig.$ot)},true);$.ig.util.defType("XNamespace:go","Object",{a:null,init:function(a){$.ig.$op.init.call(this);this.a=a},c:function(a){return new $$t.go(a)},d:function(){return $$t.$go.c("http://www.w3.org/2000/xmlns/")},b:function(){return this.a},$type:new $.ig.Type("XNamespace",$.ig.$ot)},true);$$t.$dd.created=0;$$t.$dd.ranToCompletion=5;$$t.$dd.canceled=6;$$t.$dd.faulted=7;$$t.$cs.ascending=0;$$t.$cs.descending=1;$$t.$ba.add=0;$$t.$ba.remove=1;$$t.$ba.replace=2;$$t.$ba.reset=4;$$t.$c5.g=null;$$t.$c5.f=null;$.ig.util.extCopy($.ig.Queryable,[[[$.ig.SortedList$1,$.ig.IGrouping$2,$.ig.ICollection$1,$.ig.IEnumerable$1,$.ig.IList$1,$.ig.List$1,$.ig.IEnumerable,$.ig.ICollection,$.ig.IList,$.ig.Array,$.ig.Dictionary,$.ig.XmlNodeList,$.ig.XmlNamedNodeMap,$.ig.AbstractEnumerable,$.ig.IDictionary$2,$.ig.Dictionary$2,$.ig.GenericEnumerable$1,$.ig.ReadOnlyCollection$1,$.ig.Stack$1,$.ig.IOrderedEnumerable$1],["asQueryable"]]]);$.ig.util.extCopy($.ig.Enumerable,[[[$.ig.SortedList$1,$.ig.IGrouping$2,$.ig.ICollection$1,$.ig.IEnumerable$1,$.ig.IList$1,$.ig.List$1,$.ig.IDictionary$2,$.ig.Dictionary$2,$.ig.GenericEnumerable$1,$.ig.ReadOnlyCollection$1,$.ig.Stack$1,$.ig.IOrderedEnumerable$1],["where$1","where$11","select$2","selectMany$2","last$1","first$1","firstOrDefault$1","orderBy$2","orderByDescending$2","toList$1","concat$1","max","max$1","min","min$1","count$1","reverse$1","take$1","skip$1","any$1","contains$1","union$1","toArray$1","elementAt$1","sum","sum$1"]],[[$.ig.SortedList$1,$.ig.IGrouping$2,$.ig.ICollection$1,$.ig.IEnumerable$1,$.ig.IList$1,$.ig.List$1,$.ig.IEnumerable,$.ig.ICollection,$.ig.IList,$.ig.Array,$.ig.Dictionary,$.ig.XmlNodeList,$.ig.XmlNamedNodeMap,$.ig.AbstractEnumerable,$.ig.IDictionary$2,$.ig.Dictionary$2,$.ig.GenericEnumerable$1,$.ig.ReadOnlyCollection$1,$.ig.Stack$1,$.ig.IOrderedEnumerable$1],["ofType$1","cast$1"]]])})(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","RuntimeTypeHandle:h","MethodInfo:i","MethodBase:j","MemberInfo:k","ParameterInfo:l","TypeCode:m","Enum:n","Number:o","IComparable:p","Number:q","Single:r","Number:s","ConstructorInfo:t","String:u","Array:v","RegExp:w","Cube:x","CubeType:y","Date:z","Date:aa","Number:ab","Catalog:ac","Dimension:ad","DimensionType:ae","KpiDimension:af","HierarchyOrigin:ai","AggregatorType:aj","CardinalityType:ak","MemberType:al","Hierarchy:am","Kpi:an","Level:ao","Measure:ap","KpiMeasure:aq","MeasureGroup:ar","MeasureGroupDimension:as","Member:at","Nullable$1:au","OlapResult:av","IList$1:aw","ICollection$1:ax","IEnumerable$1:ay","IEnumerable:az","IEnumerator:a0","IEnumerator$1:a1","OlapResultAxis:a2","PositionResolver$2:a3","List$1:a4","IArrayList:a5","Array:a6","ICollection:a7","CompareCallback:a8","MulticastDelegate:a9","IntPtr:ba","IList:bb","IDisposable:bc","IArray:bd","Script:be","Func$3:bf","Action$1:bg","PositionItemInfo$2:bh","Dictionary$2:bi","IDictionary$2:bj","IDictionary:bk","Dictionary:bl","IEqualityComparer$1:bm","KeyValuePair$2:bn","NotImplementedException:bo","Error:bp","IHierarchicalPositionItem$2:bq","IPositionItem$2:br","IPosition$2:bs","Math:bt","Number:bu","Number:bv","Number:bw","Number:bx","Number:by","Number:bz","Number:b0","Enumerable:b1","Func$2:b2","IOrderedEnumerable$1:b3","SortedList$1:b4","ArgumentNullException:b5","EventHandler$1:b6","Delegate:b7","ListSortDirection:b8","OlapResultTuple:b9","ReadOnlyCollection$1:ca","OlapResultAxisMember:cb","OlapResultCell:cc","IConnection:cd","IOlapDataProviderFactory:ce","IOlapDiscoverDataProvider:cf","Task$1:cg","Task:ch","JQueryPromise:ci","Action:cj","AggregateException:ck","TaskStatus:cl","TaskCompletionSource$1:cm","JQueryDeferred:cn","JQuery:co","JQueryObject:cp","Element:cq","ElementAttributeCollection:cr","ElementCollection:cs","WebStyle:ct","ElementNodeType:cu","Document:cv","EventListener:cw","IElementEventHandler:cx","ElementEventHandler:cy","ElementAttribute:cz","JQueryPosition:c0","JQueryCallback:c1","JQueryEvent:c2","JQueryUICallback:c3","IOlapExecuteCommandProvider:c4","HeaderCellsLayoutOrientation:c5","LevelSpanManager:c6","SpanSource:c7","ITableViewHeadersFactory:c8","TableViewHeadersFactory:c9","ArrayListCollection$1:da","INotifyCollectionChanged:db","NotifyCollectionChangedEventHandler:dc","NotifyCollectionChangedEventArgs:dd","EventArgs:de","NotifyCollectionChangedAction:df","TableViewHeaderCellSource:dg","OlapTableViewHeaderCell:dh","TableCompactViewHeadersFactory:di","TableViewImpl:dj","TableViewSettings:dk","ResultHeaderSorter:dl","ResultSorter$1:dm","AxisTupleVisitor:dn","LevelSortDirection:dp","LevelSortBehavior:dq","AxisHeaderSortingVisitor:dr","TupleSortDirection:ds","ResultColumnValueSorter:dt","AxisValueSortingVisitor:du","OlapTableViewResultCell:dv","OlapResultView:dw","InvalidOperationException:dx","ResultViewHelper:dy","IOlapDataSource:dz","OlapMetadataTreeItem:d0","OlapMetadataTreeItemType:d1","MeasureListLocation:d2","MeasureList:d3","OlapDataSource:d4","DataSourceBaseOptions:d5","CubeMetaItemsCache:d6","MeasureGroupMetaItemsCache:d7","Tuple$2:d8","NotSupportedException:d9","PositionInfo:ea","TaskExtensions:eb","AxisElement:ec","AxisDefinitionParser:ed","Debug:ee","TaskFactory:ef","MetaTreeHelper:eg","HierarchyItemPosition:eh","CoreOlapElementParser:el","KeyValueItem:eu","HierarchyFilterView:ev","FilterMember:ew","INotifyPropertyChanged:ex","PropertyChangedEventHandler:ey","PropertyChangedEventArgs:ez","FilterMemberStateChangedEventArgs:e0","DataSourceBase:e1","jQueryUtils:e2","OlapUtilities:e3","OlapTableView:e4","AbstractEnumerable:e5","Func$1:e6","AbstractEnumerator:e7","GenericEnumerable$1:e8","GenericEnumerator$1:e9"]);$.ig.util.defType("LevelSortBehavior","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("LevelSortBehavior",$.ig.Enum.prototype.$type)},true);$.ig.util.defType("OlapMetadataTreeItemType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("OlapMetadataTreeItemType",$.ig.Enum.prototype.$type)},true);$.ig.util.defType("MeasureListLocation","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("MeasureListLocation",$.ig.Enum.prototype.$type)},true);$.ig.util.defType("HeaderCellsLayoutOrientation","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("HeaderCellsLayoutOrientation",$.ig.Enum.prototype.$type)},true);$.ig.util.defType("MemberType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("MemberType",$.ig.Enum.prototype.$type)},true);$.ig.util.defType("CardinalityType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("CardinalityType",$.ig.Enum.prototype.$type)},true);$.ig.util.defType("AggregatorType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("AggregatorType",$.ig.Enum.prototype.$type)},true);$.ig.util.defType("HierarchyOrigin","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("HierarchyOrigin",$.ig.Enum.prototype.$type)},true);$.ig.util.defType("DimensionType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("DimensionType",$.ig.Enum.prototype.$type)},true);$.ig.util.defType("CubeType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("CubeType",$.ig.Enum.prototype.$type)},true);$.ig.util.defType("ICoreOlapElement","Object",{$type:new $.ig.Type("ICoreOlapElement",null)},true);$.ig.util.defType("Cube","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_catalogName:null,catalogName:function(value){if(arguments.length===1){this._catalogName=value;return value}else{return this._catalogName}},_name:null,name:function(value){if(arguments.length===1){this._name=value;return value}else{return this._name}},_cubeType:null,cubeType:function(value){if(arguments.length===1){this._cubeType=value;return value}else{return this._cubeType}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},_lastProcessed:null,lastProcessed:function(value){if(arguments.length===1){this._lastProcessed=value;return value}else{return this._lastProcessed}},_lastUpdated:null,lastUpdated:function(value){if(arguments.length===1){this._lastUpdated=value;return value}else{return this._lastUpdated}},_description:null,description:function(value){if(arguments.length===1){this._description=value;return value}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.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("Catalog","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(value){if(arguments.length===1){this._name=value;return value}else{return this._name}},_uniqueName:null,uniqueName:function(value){if(arguments.length===1){this._uniqueName=value;return value}else{return this._uniqueName}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},_description:null,description:function(value){if(arguments.length===1){this._description=value;return value}else{return this._description}},$type:new $.ig.Type("Catalog",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("Dimension","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(value){if(arguments.length===1){this._name=value;return value}else{return this._name}},_uniqueName:null,uniqueName:function(value){if(arguments.length===1){this._uniqueName=value;return value}else{return this._uniqueName}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},_dimensionType:null,dimensionType:function(value){if(arguments.length===1){this._dimensionType=value;return value}else{return this._dimensionType}},_description:null,description:function(value){if(arguments.length===1){this._description=value;return value}else{return this._description}},_defaultHierarchy:null,defaultHierarchy:function(value){if(arguments.length===1){this._defaultHierarchy=value;return value}else{return this._defaultHierarchy}},$type:new $.ig.Type("Dimension",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("KpiDimension","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(value){if(arguments.length===1){this._name=value;return value}else{return this._name}},_uniqueName:null,uniqueName:function(value){if(arguments.length===1){this._uniqueName=value;return value}else{return this._uniqueName}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},$type:new $.ig.Type("KpiDimension",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("Hierarchy","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(value){if(arguments.length===1){this._name=value;return value}else{return this._name}},_uniqueName:null,uniqueName:function(value){if(arguments.length===1){this._uniqueName=value;return value}else{return this._uniqueName}},_defaultHierarchy:null,defaultHierarchy:function(value){if(arguments.length===1){this._defaultHierarchy=value;return value}else{return this._defaultHierarchy}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},_description:null,description:function(value){if(arguments.length===1){this._description=value;return value}else{return this._description}},_defaultMember:null,defaultMember:function(value){if(arguments.length===1){this._defaultMember=value;return value}else{return this._defaultMember}},_allMember:null,allMember:function(value){if(arguments.length===1){this._allMember=value;
return value}else{return this._allMember}},_dimensionUniqueName:null,dimensionUniqueName:function(value){if(arguments.length===1){this._dimensionUniqueName=value;return value}else{return this._dimensionUniqueName}},_hierarchyOrigin:null,hierarchyOrigin:function(value){if(arguments.length===1){this._hierarchyOrigin=value;return value}else{return this._hierarchyOrigin}},_hierarchyDisplayFolder:null,hierarchyDisplayFolder:function(value){if(arguments.length===1){this._hierarchyDisplayFolder=value;return value}else{return this._hierarchyDisplayFolder}},$type:new $.ig.Type("Hierarchy",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("Kpi","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(value){if(arguments.length===1){this._name=value;return value}else{return this._name}},_uniqueName:null,uniqueName:function(value){if(arguments.length===1){this._uniqueName=value;return value}else{return this._uniqueName}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},_description:null,description:function(value){if(arguments.length===1){this._description=value;return value}else{return this._description}},_measureGroupName:null,measureGroupName:function(value){if(arguments.length===1){this._measureGroupName=value;return value}else{return this._measureGroupName}},_kpiDisplayFolder:null,kpiDisplayFolder:function(value){if(arguments.length===1){this._kpiDisplayFolder=value;return value}else{return this._kpiDisplayFolder}},_kpiValue:null,kpiValue:function(value){if(arguments.length===1){this._kpiValue=value;return value}else{return this._kpiValue}},_kpiGoal:null,kpiGoal:function(value){if(arguments.length===1){this._kpiGoal=value;return value}else{return this._kpiGoal}},_kpiStatus:null,kpiStatus:function(value){if(arguments.length===1){this._kpiStatus=value;return value}else{return this._kpiStatus}},_kpiTrend:null,kpiTrend:function(value){if(arguments.length===1){this._kpiTrend=value;return value}else{return this._kpiTrend}},_kpiStatusGraphic:null,kpiStatusGraphic:function(value){if(arguments.length===1){this._kpiStatusGraphic=value;return value}else{return this._kpiStatusGraphic}},_kpiTrendGraphic:null,kpiTrendGraphic:function(value){if(arguments.length===1){this._kpiTrendGraphic=value;return value}else{return this._kpiTrendGraphic}},_kpiWeight:null,kpiWeight:function(value){if(arguments.length===1){this._kpiWeight=value;return value}else{return this._kpiWeight}},_parentKpiName:null,parentKpiName:function(value){if(arguments.length===1){this._parentKpiName=value;return value}else{return this._parentKpiName}},_currentTimeMember:null,currentTimeMember:function(value){if(arguments.length===1){this._currentTimeMember=value;return value}else{return this._currentTimeMember}},$type:new $.ig.Type("Kpi",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("Level","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(value){if(arguments.length===1){this._name=value;return value}else{return this._name}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},_uniqueName:null,uniqueName:function(value){if(arguments.length===1){this._uniqueName=value;return value}else{return this._uniqueName}},_description:null,description:function(value){if(arguments.length===1){this._description=value;return value}else{return this._description}},_depth:0,depth:function(value){if(arguments.length===1){this._depth=value;return value}else{return this._depth}},_hierarchyUniqueName:null,hierarchyUniqueName:function(value){if(arguments.length===1){this._hierarchyUniqueName=value;return value}else{return this._hierarchyUniqueName}},_dimensionUniqueName:null,dimensionUniqueName:function(value){if(arguments.length===1){this._dimensionUniqueName=value;return value}else{return this._dimensionUniqueName}},_membersCount:0,membersCount:function(value){if(arguments.length===1){this._membersCount=value;return value}else{return this._membersCount}},_levelOrigin:0,levelOrigin:function(value){if(arguments.length===1){this._levelOrigin=value;return value}else{return this._levelOrigin}},_levelOrderingProperty:null,levelOrderingProperty:function(value){if(arguments.length===1){this._levelOrderingProperty=value;return value}else{return this._levelOrderingProperty}},$type:new $.ig.Type("Level",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("Measure","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(value){if(arguments.length===1){this._name=value;return value}else{return this._name}},_uniqueName:null,uniqueName:function(value){if(arguments.length===1){this._uniqueName=value;return value}else{return this._uniqueName}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},_description:null,description:function(value){if(arguments.length===1){this._description=value;return value}else{return this._description}},_measureGroupName:null,measureGroupName:function(value){if(arguments.length===1){this._measureGroupName=value;return value}else{return this._measureGroupName}},_aggregatorType:null,aggregatorType:function(value){if(arguments.length===1){this._aggregatorType=value;return value}else{return this._aggregatorType}},_defaultFormatString:null,defaultFormatString:function(value){if(arguments.length===1){this._defaultFormatString=value;return value}else{return this._defaultFormatString}},_measureDisplayFolder:null,measureDisplayFolder:function(value){if(arguments.length===1){this._measureDisplayFolder=value;return value}else{return this._measureDisplayFolder}},$type:new $.ig.Type("Measure",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("KpiMeasure","Measure",{init:function(a,b){$.ig.Measure.prototype.init.call(this);this.uniqueName(a);this.caption(b)},_graphic:null,graphic:function(value){if(arguments.length===1){this._graphic=value;return value}else{return this._graphic}},createKpiValueMeasure:function(a){return new $.ig.KpiMeasure(a.kpiValue(),a.caption()+" Value")},createKpiGoalMeasure:function(a){return new $.ig.KpiMeasure(a.kpiGoal(),a.caption()+" Goal")},createKpiWeightMeasure:function(a){return new $.ig.KpiMeasure(a.kpiWeight(),a.caption()+" Weight")},createKpiStatusMeasure:function(a){var b=new $.ig.KpiMeasure(a.kpiStatus(),a.caption()+" Status");b.graphic(a.kpiStatusGraphic());return b},createKpiTrendMeasure:function(a){var b=new $.ig.KpiMeasure(a.kpiTrend(),a.caption()+" Trend");b.graphic(a.kpiTrendGraphic());return b},$type:new $.ig.Type("KpiMeasure",$.ig.Measure.prototype.$type)},true);$.ig.util.defType("MeasureGroup","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_description:null,description:function(value){if(arguments.length===1){this._description=value;return value}else{return this._description}},_name:null,name:function(value){if(arguments.length===1){this._name=value;return value}else{return this._name}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},_cubeName:null,cubeName:function(value){if(arguments.length===1){this._cubeName=value;return value}else{return this._cubeName}},_catalogName:null,catalogName:function(value){if(arguments.length===1){this._catalogName=value;return value}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.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("MeasureGroupDimension","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_cubeName:null,cubeName:function(value){if(arguments.length===1){this._cubeName=value;return value}else{return this._cubeName}},_catalogName:null,catalogName:function(value){if(arguments.length===1){this._catalogName=value;return value}else{return this._catalogName}},_measureGroupName:null,measureGroupName:function(value){if(arguments.length===1){this._measureGroupName=value;return value}else{return this._measureGroupName}},_dimensionUniqueName:null,dimensionUniqueName:function(value){if(arguments.length===1){this._dimensionUniqueName=value;return value}else{return this._dimensionUniqueName}},_measureGroupCardinality:null,measureGroupCardinality:function(value){if(arguments.length===1){this._measureGroupCardinality=value;return value}else{return this._measureGroupCardinality}},_dimensionCardinality:null,dimensionCardinality:function(value){if(arguments.length===1){this._dimensionCardinality=value;return value}else{return this._dimensionCardinality}},_isDimensionVisible:false,isDimensionVisible:function(value){if(arguments.length===1){this._isDimensionVisible=value;return value}else{return this._isDimensionVisible}},_isFactDimension:false,isFactDimension:function(value){if(arguments.length===1){this._isFactDimension=value;return value}else{return this._isFactDimension}},_dimensionPath:null,dimensionPath:function(value){if(arguments.length===1){this._dimensionPath=value;return value}else{return this._dimensionPath}},_dimensionGranularity:null,dimensionGranularity:function(value){if(arguments.length===1){this._dimensionGranularity=value;return value}else{return this._dimensionGranularity}},$type:new $.ig.Type("MeasureGroupDimension",$.ig.Object.prototype.$type)},true);$.ig.util.defType("Member","Object",{init:function(){$.ig.Object.prototype.init.call(this);var a=$.ig.util.toNullable($.ig.Number.prototype.$type,null);this.scope(a)},_cubeName:null,cubeName:function(value){if(arguments.length===1){this._cubeName=value;return value}else{return this._cubeName}},_catalogName:null,catalogName:function(value){if(arguments.length===1){this._catalogName=value;return value}else{return this._catalogName}},_dimensionUniqueName:null,dimensionUniqueName:function(value){if(arguments.length===1){this._dimensionUniqueName=value;return value}else{return this._dimensionUniqueName}},_hierarchyUniqueName:null,hierarchyUniqueName:function(value){if(arguments.length===1){this._hierarchyUniqueName=value;return value}else{return this._hierarchyUniqueName}},_levelUniqueName:null,levelUniqueName:function(value){if(arguments.length===1){this._levelUniqueName=value;return value}else{return this._levelUniqueName}},_levelDepth:0,levelDepth:function(value){if(arguments.length===1){this._levelDepth=value;return value}else{return this._levelDepth}},_name:null,name:function(value){if(arguments.length===1){this._name=value;return value}else{return this._name}},_uniqueName:null,uniqueName:function(value){if(arguments.length===1){this._uniqueName=value;return value}else{return this._uniqueName}},_memberType:null,memberType:function(value){if(arguments.length===1){this._memberType=value;return value}else{return this._memberType}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},_childrenCardinality:0,childrenCardinality:function(value){if(arguments.length===1){this._childrenCardinality=value;return value}else{return this._childrenCardinality}},_parentLevel:0,parentLevel:function(value){if(arguments.length===1){this._parentLevel=value;return value}else{return this._parentLevel}},_parentUniqueName:null,parentUniqueName:function(value){if(arguments.length===1){this._parentUniqueName=value;return value}else{return this._parentUniqueName}},_description:null,description:function(value){if(arguments.length===1){this._description=value;return value}else{return this._description}},_scope:$.ig.util.toNullable($.ig.Number.prototype.$type,null),scope:function(value){if(arguments.length===1){this._scope=value;return value}else{return this._scope}},$type:new $.ig.Type("Member",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("OlapResult","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_isEmpty:false,isEmpty:function(value){if(arguments.length===1){this._isEmpty=value;return value}else{return this._isEmpty}},_axes:null,axes:function(value){if(arguments.length===1){this._axes=value;return value}else{return this._axes}},_cells:null,cells:function(value){if(arguments.length===1){this._cells=value;return value}else{return this._cells}},$type:new $.ig.Type("OlapResult",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapResultAxis","Object",{init:function(a,b){$.ig.Object.prototype.init.call(this);this.tuples(a.toList$1($.ig.OlapResultTuple.prototype.$type));this.tupleSize(b);this.positionResolver(new $.ig.PositionResolver$2(String,$.ig.Object.prototype.$type,a,b))},_positionResolver:null,positionResolver:function(value){if(arguments.length===1){this._positionResolver=value;return value}else{return this._positionResolver}},clone:function(){var $self=this;var a=new $.ig.List$1($.ig.OlapResultTuple.prototype.$type,0);var c=$self.tuples().getEnumerator();while(c.moveNext()){var b=c.current();a.add(b.clone())}return function(){var $ret=new $.ig.OlapResultAxis(a,$self.tupleSize());$ret.name($self.name());return $ret}()},_name:null,name:function(value){if(arguments.length===1){this._name=value;return value}else{return this._name}},_tupleSize:0,tupleSize:function(value){if(arguments.length===1){this._tupleSize=value;return value}else{return this._tupleSize}},_tuples:null,tuples:function(value){if(arguments.length===1){this._tuples=value;return value}else{return this._tuples}},$type:new $.ig.Type("OlapResultAxis",$.ig.Object.prototype.$type)},true);$.ig.util.defType("IPosition$2","Object",{$type:new $.ig.Type("IPosition$2",null)},true);$.ig.util.defType("OlapResultTuple","Object",{init:function(a){$.ig.Object.prototype.init.call(this);this.members(new $.ig.ReadOnlyCollection$1($.ig.OlapResultAxisMember.prototype.$type,1,a))},_members:null,members:function(value){if(arguments.length===1){this._members=value;return value}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 $.ig.List$1($.ig.OlapResultAxisMember.prototype.$type,0);var c=this.members().getEnumerator();while(c.moveNext()){var b=c.current();a.add(b.clone())}var d=new $.ig.OlapResultTuple(a);var f=a.getEnumerator();while(f.moveNext()){var e=f.current();e.position(d)}return d},$type:new $.ig.Type("OlapResultTuple",$.ig.Object.prototype.$type,[$.ig.IPosition$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type)])},true);$.ig.util.defType("IPositionItem$2","Object",{$type:new $.ig.Type("IPositionItem$2",null)},true);$.ig.util.defType("IHierarchicalPositionItem$2","Object",{$type:new $.ig.Type("IHierarchicalPositionItem$2",null,[$.ig.IPositionItem$2.prototype.$type.specialize(0,1)])},true);$.ig.util.defType("OlapResultAxisMember","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.properties(new $.ig.Dictionary$2(String,String,0));this.ordinal(-1)},_uniqueName:null,uniqueName:function(value){if(arguments.length===1){this._uniqueName=value;return value}else{return this._uniqueName}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},_levelUniqueName:null,levelUniqueName:function(value){if(arguments.length===1){this._levelUniqueName=value;return value}else{return this._levelUniqueName}},_hierarchyUniqueName:null,hierarchyUniqueName:function(value){if(arguments.length===1){this._hierarchyUniqueName=value;return value}else{return this._hierarchyUniqueName}},_levelNumber:0,levelNumber:function(value){if(arguments.length===1){this._levelNumber=value;return value}else{return this._levelNumber}},_displayInfo:null,displayInfo:function(value){if(arguments.length===1){this._displayInfo=value;return value}else{return this._displayInfo}},e:function(){return this.displayInfo()&~65536&~131072},drilledDown:function(){return(this.displayInfo()&65536)==65536},parentSameAsPrev:function(){return(this.displayInfo()&131072)==131072},_properties:null,properties:function(value){if(arguments.length===1){this._properties=value;return value}else{return this._properties}},_position:null,position:function(value){if(arguments.length===1){this._position=value;return value}else{return this._position}},key:function(){return this.uniqueName()},sortKey:function(){if(this.ordinal()>-1){return this.ordinal()}var a=parseFloat(this.caption());if(!isNaN(a)){return a}return this.caption()},_ordinal:0,ordinal:function(value){if(arguments.length===1){this._ordinal=value;return value}else{return this._ordinal}},hierarchyKey:function(){return this.hierarchyUniqueName()},hierarchyLevelKey:function(){return this.levelUniqueName()},parentKey:function(){var $self=this;var a;(function(){var $ret=$self.properties().tryGetValue("PARENT_UNIQUE_NAME",a);a=$ret.value;return $ret.ret})();return a},depth:function(){return this.levelNumber()},isExpandable:function(){return this.e()>0},clone:function(){var a=new $.ig.OlapResultAxisMember;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.Object.prototype.$type,[$.ig.IHierarchicalPositionItem$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type)])},true);$.ig.util.defType("OlapResultCell","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.properties(new $.ig.Dictionary$2(String,$.ig.Object.prototype.$type,0))},_cellOrdinal:0,cellOrdinal:function(value){if(arguments.length===1){this._cellOrdinal=value;return value}else{return this._cellOrdinal}},_properties:null,properties:function(value){if(arguments.length===1){this._properties=value;return value}else{return this._properties}},clone:function(){var $self=this;var a=function(){var $ret=new $.ig.OlapResultCell;$ret.cellOrdinal($self.cellOrdinal());return $ret}();var c=$self.properties().getEnumerator();while(c.moveNext()){var b=c.current();a.properties().add(b.key(),b.value())}return a},$type:new $.ig.Type("OlapResultCell",$.ig.Object.prototype.$type)},true);$.ig.util.defType("IConnection","Object",{$type:new $.ig.Type("IConnection",null)},true);$.ig.util.defType("IOlapDataProviderFactory","Object",{$type:new $.ig.Type("IOlapDataProviderFactory",null)},true);$.ig.util.defType("IOlapDiscoverDataProvider","Object",{$type:new $.ig.Type("IOlapDiscoverDataProvider",null)},true);$.ig.util.defType("IOlapExecuteCommandProvider","Object",{$type:new $.ig.Type("IOlapExecuteCommandProvider",null)},true);$.ig.util.defType("LevelSpanManager","Object",{b:null,init:function(a){$.ig.Object.prototype.init.call(this);this.c(a);this.b=new Array(a)},_c:0,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},a:function(a,b){var $self=this;var c=$self.b[a];if(c==null){c=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.SpanSource.prototype.$type,0);$self.b[a]=c}var d;if(!function(){var $ret=c.tryGetValue(b,d);d=$ret.value;return $ret.ret}()){d=new $.ig.SpanSource;if(b>0){var e;if(function(){var $ret=c.tryGetValue(b-1,e);e=$ret.value;return $ret.ret}()){d.a(e);e.e()}}c.add(b,d)}return d},$type:new $.ig.Type("LevelSpanManager",$.ig.Object.prototype.$type)},true);$.ig.util.defType("SpanSource","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.c=1},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}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.Object.prototype.$type)},true);$.ig.util.defType("ITableViewHeadersFactory","Object",{$type:new $.ig.Type("ITableViewHeadersFactory",null)},true);$.ig.util.defType("TableViewHeadersFactory","Object",{_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_d:false,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},_e:null,e:function(value){if(arguments.length===1){this._e=value;return value}else{return this._e}},init:function(a,b,c,d,e){$.ig.Object.prototype.init.call(this);this.b(a);this.a(b);this.c(c);this.d(d);this.e(e)},createHeaderCells:function(){var $self=this;if($self.b().positionResolver().hasUnregisterdPositions()){$self.b().positionResolver().completeRegisterPositions()}var a=$self.b().positionResolver().rootPositionInfo();var b=new $.ig.List$1($.ig.IList$1.prototype.$type.specialize($.ig.TableViewHeaderCellSource.prototype.$type),0);for(var c=0;c<a.positionSize();c++){b.add(new $.ig.List$1($.ig.TableViewHeaderCellSource.prototype.$type,0))}$.ig.TableViewHeadersFactory.prototype.createHeaderCells2(a,a.positionItemDepthMin(),b,$self.d(),$self.e());var d=new $.ig.ArrayListCollection$1($.ig.OlapTableViewHeaderCell.prototype.$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($self.c()==$.ig.HeaderCellsLayoutOrientation.prototype.horizontal){l=h;m=j.b().d();n=j.a().positionItemDepth()+e;o=j.c().d()}else{n=h;o=j.b().d();l=j.a().positionItemDepth()+e;m=j.c().d()}var p=$self.b().tuples().__inner[j.a().positionIndex()];var q=p.item(j.a().positionItemIndex());var r=$self.b().tuples().__inner[j.k()];if($self.a().positionResolver().hasUnregisterdPositions()){$self.a().positionResolver().completeRegisterPositions()}var s=$self.a().positionResolver().getPositionIndex(r);var t=function(){var $ret=new $.ig.OlapTableViewHeaderCell;$ret.axisName($self.b().name());$ret.hierarchyNumber(j.a().positionItemIndex());$ret.levelNumber(j.a().positionItemDepth());$ret.caption(q.caption());$ret.columnIndex(l);$ret.columnSpan(m);$ret.isExpanded(j.f());$ret.isExpandable(j.e());$ret.tupleIndex(s);$ret.memberIndex(j.a().positionItemIndex());$ret.rowIndex(n);$ret.rowSpan(o);return $ret}();if(!j.g()){h=h+j.b().d()}i=Math.max(i,j.a().positionItemDepth());d.add(t)}e+=i+1}return d},createHeaderCells2:function(a,b,c,d,e){var $self=this;var f=new $.ig.LevelSpanManager(a.positionSize());var h=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(i){return i.positionItemDepth()==b}).getEnumerator();while(h.moveNext()){var g=h.current();var i;var j;(function(){var $ret=$.ig.TableViewHeadersFactory.prototype.createHeaderCells1(a,g,c,f,d,e,i,j);i=$ret.headerCellSource;j=$ret.totalSpan;return $ret.ret})()}},h:function(a,b,c,d,e,f){var $self=this;var g=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(h){return h.positionItemDepth()==a.positionItemDepthMin()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type));if(g.count()>0){var i=g.getEnumerator();while(i.moveNext()){var h=i.current();var j;var k;(function(){var $ret=$.ig.TableViewHeadersFactory.prototype.createHeaderCells1(a,h,b,c,d,f,j,k);j=$ret.headerCellSource;k=$ret.totalSpan;return $ret.ret})();e.b().d(e.b().d()+k);if(j.g()){e.b().d(e.b().d()+1)}}e.b().d(e.b().d()-1)}else{f.add(a.positionIndex())}e.k(a.positionIndex())},createHeaderCells1:function(a,b,c,d,e,f,g,h){var $self=this;var i=c.item(b.positionItemIndex());var j=d.a(b.positionItemIndex(),b.positionItemDepth());var k=function(){var $ret=new $.ig.TableViewHeaderCellSource;$ret.c(j);$ret.a(b);$ret.e(b.isExpandable());return $ret}();g=k;if(e){i.add(k);$.ig.TableViewHeadersFactory.prototype.h(b,c,d,true,k,f)}var l=null;if(b.isExpanded()){l=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(m){return m.parentKey()==b.key()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type))}if(l!=null&&l.count()>0){var m=function(){var $ret=new $.ig.TableViewHeaderCellSource;$ret.g(true);$ret.a(b);$ret.e(b.isExpandable());return $ret}();i.add(m);var o=l.getEnumerator();while(o.moveNext()){var n=o.current();var p;var q;(function(){var $ret=$.ig.TableViewHeadersFactory.prototype.createHeaderCells1(a,n,c,d,e,f,p,q);p=$ret.headerCellSource;q=$ret.totalSpan;return $ret.ret})();m.b().d(m.b().d()+q);if(p.g()){m.b().d(m.b().d()+1)}}m.b().d(m.b().d()-1);k.f(true);k.e(false);m.f(true);k.d(m);if(!e){i.add(k);$.ig.TableViewHeadersFactory.prototype.h(b,c,d,false,k,f)}m.k(k.k());g=m;h=k.b().d()+m.b().d()-1}else{if(b.isExpanded()){k.e(false)}if(!e){i.add(k);$.ig.TableViewHeadersFactory.prototype.h(b,c,d,false,k,f)}h=k.b().d()}return{headerCellSource:g,totalSpan:h}},$type:new $.ig.Type("TableViewHeadersFactory",$.ig.Object.prototype.$type,[$.ig.ITableViewHeadersFactory.prototype.$type])},true);$.ig.util.defType("TableCompactViewHeadersFactory","Object",{_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_d:false,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},_e:null,e:function(value){if(arguments.length===1){this._e=value;return value}else{return this._e}},init:function(a,b,c,d,e){$.ig.Object.prototype.init.call(this);this.b(a);this.a(b);this.c(c);this.d(d);this.e(e)},createHeaderCells:function(){var $self=this;if($self.b().positionResolver().hasUnregisterdPositions()){$self.b().positionResolver().completeRegisterPositions()}var a=$self.b().positionResolver().rootPositionInfo();var b=new $.ig.List$1($.ig.IList$1.prototype.$type.specialize($.ig.TableViewHeaderCellSource.prototype.$type),0);for(var c=0;c<a.positionSize();c++){b.add(new $.ig.List$1($.ig.TableViewHeaderCellSource.prototype.$type,0))}$.ig.TableCompactViewHeadersFactory.prototype.createHeaderCells2(a,a.positionItemDepthMin(),b,$self.d(),$self.e());var d=new $.ig.ArrayListCollection$1($.ig.OlapTableViewHeaderCell.prototype.$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($self.c()==$.ig.HeaderCellsLayoutOrientation.prototype.horizontal){l=h;m=j.b().d();n=e;o=1}else{n=h;o=j.b().d();l=e;m=1}var p=$self.b().tuples().__inner[j.a().positionIndex()];var q=p.item(j.a().positionItemIndex());var r=$self.b().tuples().__inner[j.k()];if($self.a().positionResolver().hasUnregisterdPositions()){$self.a().positionResolver().completeRegisterPositions()}var s=$self.a().positionResolver().getPositionIndex(r);var t=function(){var $ret=new $.ig.OlapTableViewHeaderCell;$ret.axisName($self.b().name());$ret.hierarchyNumber(j.a().positionItemIndex());$ret.levelNumber(j.a().positionItemDepth());$ret.caption(q.caption());$ret.columnIndex(l);$ret.columnSpan(m);$ret.isExpanded(j.f());$ret.isExpandable(j.e());$ret.tupleIndex(s);$ret.memberIndex(j.a().positionItemIndex());$ret.rowIndex(n);$ret.rowSpan(o);return $ret}();if(!j.g()){h=h+j.b().d()}d.add(t)}e+=i+1}return d},createHeaderCells2:function(a,b,c,d,e){var $self=this;var f=new $.ig.LevelSpanManager(a.positionSize());var h=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(i){return i.positionItemDepth()==b}).getEnumerator();while(h.moveNext()){var g=h.current();var i;var j;(function(){var $ret=$.ig.TableCompactViewHeadersFactory.prototype.createHeaderCells1(a,g,c,f,d,e,i,j);i=$ret.headerCellSource;j=$ret.totalSpan;return $ret.ret})()}},h:function(a,b,c,d,e,f){var $self=this;var g=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(h){return h.positionItemDepth()==a.positionItemDepthMin()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type));if(g.count()>0){var i=g.getEnumerator();while(i.moveNext()){var h=i.current();var j;var k;(function(){var $ret=$.ig.TableCompactViewHeadersFactory.prototype.createHeaderCells1(a,h,b,c,d,f,j,k);j=$ret.headerCellSource;k=$ret.totalSpan;return $ret.ret})();e.b().d(e.b().d()+k);if(j.d()!=null){e.b().d(e.b().d()+1)}}e.b().d(e.b().d()-1)}else{f.add(a.positionIndex())}e.k(a.positionIndex())},createHeaderCells1:function(a,b,c,d,e,f,g,h){var $self=this;var i=c.item(b.positionItemIndex());var j=d.a(b.positionItemIndex(),b.positionItemDepth());var k=function(){var $ret=new $.ig.TableViewHeaderCellSource;$ret.c(j);$ret.a(b);$ret.e(b.isExpandable());return $ret}();g=k;if(e){i.add(k);$.ig.TableCompactViewHeadersFactory.prototype.h(b,c,d,true,k,f)}var l=null;if(b.isExpanded()){l=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(m){return m.parentKey()==b.key()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type))}if(l!=null&&l.count()>0){var m=function(){var $ret=new $.ig.TableViewHeaderCellSource;$ret.g(true);$ret.a(b);$ret.e(b.isExpandable());return $ret}();var o=l.getEnumerator();while(o.moveNext()){var n=o.current();var p;var q;(function(){var $ret=$.ig.TableCompactViewHeadersFactory.prototype.createHeaderCells1(a,n,c,d,e,f,p,q);p=$ret.headerCellSource;q=$ret.totalSpan;return $ret.ret})();m.b().d(m.b().d()+q);if(p.d()!=null){m.b().d(m.b().d()+1)}}m.b().d(m.b().d()-1);k.f(true);k.e(true);k.d(m);if(!e){i.add(k);$.ig.TableCompactViewHeadersFactory.prototype.h(b,c,d,false,k,f)}m.k(k.k());h=k.b().d()+m.b().d()-1}else{if(b.isExpanded()){k.e(false)}if(!e){i.add(k);$.ig.TableCompactViewHeadersFactory.prototype.h(b,c,d,false,k,f)}h=k.b().d()}return{headerCellSource:g,totalSpan:h}},$type:new $.ig.Type("TableCompactViewHeadersFactory",$.ig.Object.prototype.$type,[$.ig.ITableViewHeadersFactory.prototype.$type])},true);$.ig.util.defType("TableViewHeaderCellSource","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.b(new $.ig.SpanSource);this.c(new $.ig.SpanSource)},_g:false,g:function(value){if(arguments.length===1){this._g=value;return value}else{return this._g}},_j:0,j:function(value){if(arguments.length===1){this._j=value;return value}else{return this._j}},_h:0,h:function(value){if(arguments.length===1){this._h=value;return value}else{return this._h}},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_d:null,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},_k:0,k:function(value){if(arguments.length===1){this._k=value;return value}else{return this._k}},_i:0,i:function(value){if(arguments.length===1){this._i=value;return value}else{return this._i}},_f:false,f:function(value){if(arguments.length===1){this._f=value;return value}else{return this._f}},_e:false,e:function(value){if(arguments.length===1){this._e=value;return value}else{return this._e}},$type:new $.ig.Type("TableViewHeaderCellSource",$.ig.Object.prototype.$type)},true);
$.ig.util.defType("TableViewImpl","Object",{init:function(a,b,c,d){var $self=this;$.ig.Object.prototype.init.call(this);if(a==null){throw new $.ig.ArgumentNullException("result")}this.result(a);this.originalResult(a);if(d==null){this.viewSettings(new $.ig.TableViewSettings)}else{this.viewSettings(d)}this.hasColumns(b);this.hasRows(c);this.columnSortDirections(new $.ig.ArrayListCollection$1($.ig.TupleSortDirection.prototype.$type));this.columnSortDirections().collectionChanged=$.ig.Delegate.prototype.combine(this.columnSortDirections().collectionChanged,function(e,f){$self.i(true)});this.levelSortDirections(new $.ig.ArrayListCollection$1($.ig.LevelSortDirection.prototype.$type));this.levelSortDirections().collectionChanged=$.ig.Delegate.prototype.combine(this.levelSortDirections().collectionChanged,function(e,f){$self.i(true)});this.appliedColumnSortDirections(new $.ig.List$1($.ig.TupleSortDirection.prototype.$type,0));this.appliedLevelSortDirections(new $.ig.List$1($.ig.LevelSortDirection.prototype.$type,0));this.appliedSortDirectionsMap(new $.ig.Dictionary$2(String,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type)),0))},_viewSettings:null,viewSettings:function(value){if(arguments.length===1){this._viewSettings=value;return value}else{return this._viewSettings}},_result:null,result:function(value){if(arguments.length===1){this._result=value;return value}else{return this._result}},_originalResult:null,originalResult:function(value){if(arguments.length===1){this._originalResult=value;return value}else{return this._originalResult}},_hasRows:false,hasRows:function(value){if(arguments.length===1){this._hasRows=value;return value}else{return this._hasRows}},_hasColumns:false,hasColumns:function(value){if(arguments.length===1){this._hasColumns=value;return value}else{return this._hasColumns}},_d:null,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_h:false,h:function(value){if(arguments.length===1){this._h=value;return value}else{return this._h}},_i:false,i:function(value){if(arguments.length===1){this._i=value;return value}else{return this._i}},l:null,k:null,o:null,rowHeaders:function(a){if(arguments.length===1){this.l=a;return a}else{if(!this.h()||this.i()){this.initialize()}return this.l}},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.o=a;return a}else{if(!this.h()||this.i()){this.initialize()}return this.o}},_columnSortDirections:null,columnSortDirections:function(value){if(arguments.length===1){this._columnSortDirections=value;return value}else{return this._columnSortDirections}},_levelSortDirections:null,levelSortDirections:function(value){if(arguments.length===1){this._levelSortDirections=value;return value}else{return this._levelSortDirections}},_appliedColumnSortDirections:null,appliedColumnSortDirections:function(value){if(arguments.length===1){this._appliedColumnSortDirections=value;return value}else{return this._appliedColumnSortDirections}},_appliedLevelSortDirections:null,appliedLevelSortDirections:function(value){if(arguments.length===1){this._appliedLevelSortDirections=value;return value}else{return this._appliedLevelSortDirections}},_appliedSortDirectionsMap:null,appliedSortDirectionsMap:function(value){if(arguments.length===1){this._appliedSortDirectionsMap=value;return value}else{return this._appliedSortDirectionsMap}},initialize:function(){var $self=this;$self.d(null);$self.c(null);$self.rowHeaders(null);$self.columnHeaders(null);$self.resultCells(null);$self.result($self.originalResult());if($self.result().isEmpty()){$self.i(false);$self.h(true);return}if($self.levelSortDirections().count()>0){var a=new $.ig.ResultHeaderSorter($self.result(),$self.hasRows(),$self.hasColumns(),$self.levelSortDirections());$self.result(a.b());$self.appliedLevelSortDirections(a.h());$self.appliedSortDirectionsMap(a.g())}else{$self.appliedLevelSortDirections(new $.ig.List$1($.ig.LevelSortDirection.prototype.$type,0));$self.appliedSortDirectionsMap(new $.ig.Dictionary$2(String,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type)),0))}if($self.hasRows()&&$self.columnSortDirections().count()>0){if($self.appliedLevelSortDirections().count()>0){if($self.originalResult().axes().item(0).positionResolver().hasUnregisterdPositions()){$self.originalResult().axes().item(0).positionResolver().completeRegisterPositions()}if($self.result().axes().item(0).positionResolver().hasUnregisterdPositions()){$self.result().axes().item(0).positionResolver().completeRegisterPositions()}var b=new $.ig.List$1($.ig.TupleSortDirection.prototype.$type,2,$self.columnSortDirections().count());var c=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,1,$self.appliedColumnSortDirections().count());var e=$self.columnSortDirections().getEnumerator();while(e.moveNext()){var d=e.current();var f=$self.originalResult().axes().item(0).tuples().__inner[d.tupleIndex()];var g=$self.result().axes().item(0).positionResolver().getPositionIndex(f);var h=new $.ig.TupleSortDirection;h.sortDirection(d.sortDirection());h.tupleIndex(g);h.comparer(d.comparer());b.add(h);c.item(g,d.tupleIndex())}var i=new $.ig.ResultColumnValueSorter($self.result(),$self.hasRows(),$self.hasColumns(),b);$self.result(i.b());var k=i.g().getEnumerator();while(k.moveNext()){var j=k.current();j.tupleIndex(c.item(j.tupleIndex()))}$self.appliedColumnSortDirections(i.g())}else{var l=new $.ig.ResultColumnValueSorter($self.result(),$self.hasRows(),$self.hasColumns(),$self.columnSortDirections());$self.result(l.b());$self.appliedColumnSortDirections(l.g())}}else{$self.appliedColumnSortDirections(new $.ig.List$1($.ig.TupleSortDirection.prototype.$type,0))}var m=0;var n=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);var o=1;if($self.hasColumns()){var p=$self.result().axes().item(m);var q=$self.originalResult().axes().item(m);var r=$self.u(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 $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);if($self.hasRows()){var v=$self.result().axes().item(m);var w=$self.originalResult().axes().item(m);var x=$self.v(v,w);for(var y=0;y<x.count();y++){var z=x.item(y);u.add(z,y)}}var aa=new $.ig.ArrayListCollection$1($.ig.OlapTableViewResultCell.prototype.$type);for(var ab=0;ab<$self.result().cells().count();ab++){var ac=$self.result().cells().item(ab);var ad;(function(){var $ret=ac.properties().tryGetValue("Value",ad);ad=$ret.value;return $ret.ret})();var ae;(function(){var $ret=ac.properties().tryGetValue("FmtValue",ae);ae=$ret.value;return $ret.ret})();var af=ac.cellOrdinal();if($self.hasColumns()){var ag=af%o;var ah=n.item(ag);if(ag!=ah){var ai=$.ig.intDivide(af,o);af=ai*o+ah}}if($self.hasRows()){var aj=$.ig.intDivide(af,o);var ak=u.item(aj);if(aj!=ak){var al=af%o;af=ak*o+al}}aa.add(function(){var $ret=new $.ig.OlapTableViewResultCell;$ret.value(ad);$ret.formattedValue(ae);$ret.cellOrdinal(af);$ret.resultCellIndex(ab);return $ret}());$self.resultCells(aa)}$self.i(false);$self.h(true)},u:function(a,b){var c=new $.ig.List$1($.ig.Number.prototype.$type,0);if(this.viewSettings().a()){this.c(new $.ig.TableCompactViewHeadersFactory(a,b,$.ig.HeaderCellsLayoutOrientation.prototype.horizontal,this.viewSettings().c(),c))}else{this.c(new $.ig.TableViewHeadersFactory(a,b,$.ig.HeaderCellsLayoutOrientation.prototype.horizontal,this.viewSettings().c(),c))}this.columnHeaders(this.c().createHeaderCells());return c},v:function(a,b){var c=new $.ig.List$1($.ig.Number.prototype.$type,0);if(this.viewSettings().b()){this.d(new $.ig.TableCompactViewHeadersFactory(a,b,$.ig.HeaderCellsLayoutOrientation.prototype.vertical,this.viewSettings().d(),c))}else{this.d(new $.ig.TableViewHeadersFactory(a,b,$.ig.HeaderCellsLayoutOrientation.prototype.vertical,this.viewSettings().d(),c))}this.rowHeaders(this.d().createHeaderCells());return c},$type:new $.ig.Type("TableViewImpl",$.ig.Object.prototype.$type)},true);$.ig.util.defType("TableViewSettings","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_c:false,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_d:false,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},_b:false,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_a:false,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},$type:new $.ig.Type("TableViewSettings",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapResultView","Object",{init:function(a,b,c,d){$.ig.Object.prototype.init.call(this);if(a==null){throw new $.ig.ArgumentNullException("result")}this.result(a);this.visibleResult(b);this.hasColumns(c);this.hasRows(d)},_result:null,result:function(value){if(arguments.length===1){this._result=value;return value}else{return this._result}},_visibleResult:null,visibleResult:function(value){if(arguments.length===1){this._visibleResult=value;return value}else{return this._visibleResult}},_hasRows:false,hasRows:function(value){if(arguments.length===1){this._hasRows=value;return value}else{return this._hasRows}},_hasColumns:false,hasColumns:function(value){if(arguments.length===1){this._hasColumns=value;return value}else{return this._hasColumns}},c:function(a,b,c,d,e){var $self=this;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=$.ig.intDivide(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=$.ig.intDivide(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=$.ig.intDivide(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=$.ig.intDivide(o.cellOrdinal(),h);if(q>p){break}t=o.cellOrdinal()%h}}}}var y=new $.ig.List$1($.ig.OlapResultCell.prototype.$type,0);for(var aa=0;aa<m.length;aa++){var z=m[aa];if(z!=null){y.add(z)}}var ab=new $.ig.List$1($.ig.OlapResultAxis.prototype.$type,0);if(e){ab.add(c)}if(d){ab.add(b)}return function(){var $ret=new $.ig.OlapResult;$ret.axes(ab);$ret.cells(y);$ret.isEmpty(!d&&!e&&y.count()==0);return $ret}()},a:function(a,b,c){var $self=this;var d=new $.ig.List$1($.ig.OlapResultTuple.prototype.$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 $.ig.OlapResultAxis(d,a.tupleSize());$ret.name(a.name());return $ret}();return j},expandTupleMember:function(a,b,c){var $self=this;var d=$self.f(a,b,c,$self.visibleResult());if(d==null){return null}if(!d.isExpandable()){throw new $.ig.InvalidOperationException(1,"The position is not expandable.")}if(d.isExpanded()){return $self}var e=$self.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(f){return f.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var f=$self.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(g){return g.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var g=a=="Axis0"&&!$self.hasColumns()||a=="Axis1"&&$self.hasRows();var h=e.tuples().__inner[b];var i=f.positionResolver().getPositionIndex(h);var j=$self.l(a,i,c,$self.result());if(j.count()==0){return null}var k=null;var l=null;if(g){k=$self.a(f,j,true);if($self.hasColumns()){l=$self.visibleResult().axes().item(0)}}else{l=$self.a(f,j,true);if($self.hasRows()){k=$self.visibleResult().axes().item(1)}}var m=$self.c($self.result(),k,l,$self.hasRows(),$self.hasColumns());var n=$self.b($self.visibleResult(),m,f.name());return new $.ig.OlapResultView($self.result(),n,$self.hasColumns(),$self.hasRows())},collapseTupleMember:function(a,b,c){var $self=this;var d=$self.f(a,b,c,$self.visibleResult());if(d==null){return null}if(!d.isExpandable()){throw new $.ig.InvalidOperationException(1,"The position is not expandable.")}if(!d.isExpanded()){return $self}var e=$self.l(a,b,c,$self.visibleResult());if(e.count()==0){return null}var f=$self.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(g){return g.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var g=a=="Axis0"&&!$self.hasColumns()||a=="Axis1"&&$self.hasRows();var h=null;var i=null;if(g){h=$self.a(f,e,false);if($self.hasColumns()){i=$self.visibleResult().axes().item(0)}}else{i=$self.a(f,e,false);if($self.hasRows()){h=$self.visibleResult().axes().item(1)}}var j=$self.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(k){return k.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);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=$self.c($self.visibleResult(),h,i,$self.hasRows(),$self.hasColumns());return new $.ig.OlapResultView($self.result(),n,$self.hasColumns(),$self.hasRows())},extend:function(a,b){var $self=this;var c=$self.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(d){return d.name()==b}).first$1($.ig.OlapResultAxis.prototype.$type);var d=b=="Axis0"&&!$self.hasColumns()||b=="Axis1"&&$self.hasRows();var e=null;var f=null;var g=null;var h=false;if(d){e=c;if($self.hasColumns()){f=$self.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(i){return i.name()!=b}).first$1($.ig.OlapResultAxis.prototype.$type);g=$self.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(i){return i.name()!=b}).first$1($.ig.OlapResultAxis.prototype.$type);h=f.tuples().count()!=g.tuples().count()}}else{f=c;if($self.hasRows()){e=$self.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(i){return i.name()!=b}).first$1($.ig.OlapResultAxis.prototype.$type);g=$self.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(i){return i.name()!=b}).first$1($.ig.OlapResultAxis.prototype.$type);h=e.tuples().count()!=g.tuples().count()}}var i=null;var j=null;if(g!=null&&h){var k=$self.c($self.result(),e,f,$self.hasRows(),$self.hasColumns());i=$self.b(k,a,b);j=$self.b(k,a,b)}else{i=$self.b($self.result(),a,b);j=$self.b($self.visibleResult(),a,b)}return new $.ig.OlapResultView(i,j,$self.hasColumns(),$self.hasRows())},b:function(a,b,c){var $self=this;var d=a.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(e){return e.name()==c}).first$1($.ig.OlapResultAxis.prototype.$type);if(d==null){return null}var e=b.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(f){return f.name()==c}).first$1($.ig.OlapResultAxis.prototype.$type);var f=c=="Axis0"&&!$self.hasColumns()||c=="Axis1"&&$self.hasRows();var g=null;var h=null;if(f){if($self.hasColumns()){g=a.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(i){return i.name()!=c}).first$1($.ig.OlapResultAxis.prototype.$type);h=b.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(i){return i.name()!=c}).first$1($.ig.OlapResultAxis.prototype.$type)}}else{if($self.hasRows()){g=a.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(i){return i.name()!=c}).first$1($.ig.OlapResultAxis.prototype.$type);h=b.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(i){return i.name()!=c}).first$1($.ig.OlapResultAxis.prototype.$type)}}var i=new $.ig.List$1($.ig.OlapResultTuple.prototype.$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 $.ig.List$1($.ig.OlapResultCell.prototype.$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=$self.m(z.cellOrdinal(),g,h);var ab=$.ig.intDivide(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=$.ig.intDivide(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=$self.n(al.cellOrdinal(),g,h,n);var an=$.ig.intDivide(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 $.ig.OlapResult;ar.axes(new $.ig.List$1($.ig.OlapResultAxis.prototype.$type,0));var as=function(){var $ret=new $.ig.OlapResultAxis(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(!$self.hasColumns()&&!$self.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=$.ig.intDivide(a,d);var f=c.tuples().__inner[e];var g=b.positionResolver().getPositionIndex(f);return g},l:function(a,b,c,d){var $self=this;var e=d.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(f){return f.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var f=e.tuples().__inner[b];var g=f.item(c);if(e.positionResolver().hasUnregisterdPositions()){e.positionResolver().completeRegisterPositions()}var h=e.positionResolver().h(g,$.ig.ListSortDirection.prototype.ascending);if(h!=null){return h.toList$1($.ig.Number.prototype.$type)}return null},f:function(a,b,c,d){var $self=this;var e=d.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(f){return f.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);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;(function(){var $ret=h.tryGetValue(g.key(),i);i=$ret.value;return $ret.ret})();return i},$type:new $.ig.Type("OlapResultView",$.ig.Object.prototype.$type)},true);$.ig.util.defType("ResultViewHelper","Object",{init:function(){$.ig.Object.prototype.init.call(this)},e:function(a,b,c,d,e){$.ig.ResultViewHelper.prototype.d(a,b,c,true,e.visibleResult());$.ig.ResultViewHelper.prototype.d(a,b,c,true,e.result())},f:function(a,b,c){var $self=this;var d=b.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(e){return e.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var e=c.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(f){return f.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);$.ig.ResultViewHelper.prototype.b(d.positionResolver(),e.positionResolver());var f=b.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(g){return g.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var g=c.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(h){return h.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);$.ig.ResultViewHelper.prototype.b(f.positionResolver(),g.positionResolver())},d:function(a,b,c,d,e){var $self=this;var f=e.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(g){return g.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);if(f.positionResolver().hasUnregisterdPositions()){f.positionResolver().completeRegisterPositions()}$.ig.ResultViewHelper.prototype.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()}$.ig.ResultViewHelper.prototype.a(a.rootPositionInfo(),b.rootPositionInfo())},a:function(a,b){var $self=this;var d=a.getEnumerator();while(d.moveNext()){var c=d.current();var e=c.value();var f;if(function(){var $ret=b.tryGetValue(c.key(),f);f=$ret.value;return $ret.ret}()){if(e.isExpanded()!=true){f.isExpanded(false)}if(f.count()>0){$.ig.ResultViewHelper.prototype.a(e,f)}}}},$type:new $.ig.Type("ResultViewHelper",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapTableViewHeaderCell","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.columnSpan(1);this.rowSpan(1)},_id:null,id:function(value){if(arguments.length===1){this._id=value;return value}else{return this._id}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},_isExpanded:false,isExpanded:function(value){if(arguments.length===1){this._isExpanded=value;return value}else{return this._isExpanded}},_isExpandable:false,isExpandable:function(value){if(arguments.length===1){this._isExpandable=value;return value}else{return this._isExpandable}},_rowIndex:0,rowIndex:function(value){if(arguments.length===1){this._rowIndex=value;return value}else{return this._rowIndex}},_rowSpan:0,rowSpan:function(value){if(arguments.length===1){this._rowSpan=value;return value}else{return this._rowSpan}},_columnIndex:0,columnIndex:function(value){if(arguments.length===1){this._columnIndex=value;return value}else{return this._columnIndex}},_columnSpan:0,columnSpan:function(value){if(arguments.length===1){this._columnSpan=value;return value}else{return this._columnSpan}},_axisName:null,axisName:function(value){if(arguments.length===1){this._axisName=value;return value}else{return this._axisName}},_tupleIndex:0,tupleIndex:function(value){if(arguments.length===1){this._tupleIndex=value;return value}else{return this._tupleIndex}},_memberIndex:0,memberIndex:function(value){if(arguments.length===1){this._memberIndex=value;return value}else{return this._memberIndex}},_levelNumber:0,levelNumber:function(value){if(arguments.length===1){this._levelNumber=value;return value}else{return this._levelNumber}},_hierarchyNumber:0,hierarchyNumber:function(value){if(arguments.length===1){this._hierarchyNumber=value;return value}else{return this._hierarchyNumber}},toString:function(){return this.caption()},$type:new $.ig.Type("OlapTableViewHeaderCell",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapTableViewResultCell","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_value:null,value:function(value){if(arguments.length===1){this._value=value;return value}else{return this._value}},_formattedValue:null,formattedValue:function(value){if(arguments.length===1){this._formattedValue=value;return value}else{return this._formattedValue}},_cellOrdinal:0,cellOrdinal:function(value){if(arguments.length===1){this._cellOrdinal=value;return value}else{return this._cellOrdinal}},_resultCellIndex:0,resultCellIndex:function(value){if(arguments.length===1){this._resultCellIndex=value;return value}else{return this._resultCellIndex}},$type:new $.ig.Type("OlapTableViewResultCell",$.ig.Object.prototype.$type)},true);$.ig.util.defType("ArrayListCollection$1","Object",{$t:null,init:function($t){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.init.call(this);this.inner(new $.ig.Array)},_inner:null,inner:function(value){if(arguments.length===1){this._inner=value;return value}else{return this._inner}},collectionChanged:null,indexOf:function(a){return this.inner().indexOf(a)},insert:function(a,b){this.inner().insert(a,b);this.d(a,b)},removeAt:function(a){var b=this.inner()[a];this.inner().removeAt(a);this.e(a,b)},item:function(a,b){if(arguments.length===2){this.inner()[a]=b;return b}else{return this.inner()[a]}},add:function(a){this.inner().add(a);this.d(this.inner().length-1,a)},clear:function(){this.inner().clear();this.c()},contains:function(a){return this.inner().contains(a)},copyTo:function(a,b){throw new $.ig.NotImplementedException},count:function(){return this.inner().length},isReadOnly:function(){return false},remove:function(a){var b=this.inner().indexOf(a);if(b>=0){this.inner().removeAt(b);this.e(b,a);return true}return false},b:function(){var $self=this;var $iter=function(){return function(){return{$state:0,$this:$self,$current:null,$a:0,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$a=0;this.$state=5;break;case 2:this.$current=this.$this.inner()[this.$a];this.$state=3;return true;case 3:this.$state=4;break;case 4:this.$a++;this.$state=5;break;case 5:if(this.$a<this.$this.inner().length){this.$state=2}else{this.$state=6}break;case 6:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}()};return new $.ig.GenericEnumerable$1(this.$t,$iter)},getEnumerator:function(){return this.b().getEnumerator()},d:function(a,b){if(this.collectionChanged!=null){var c=new $.ig.NotifyCollectionChangedEventArgs(1,$.ig.NotifyCollectionChangedAction.prototype.add,b,a);this.collectionChanged(this,c)}},e:function(a,b){if(this.collectionChanged!=null){var c=new $.ig.NotifyCollectionChangedEventArgs(1,$.ig.NotifyCollectionChangedAction.prototype.remove,b,a);this.collectionChanged(this,c)}},c:function(){if(this.collectionChanged!=null){var a=new $.ig.NotifyCollectionChangedEventArgs(1,$.ig.NotifyCollectionChangedAction.prototype.reset,null,-1);this.collectionChanged(this,a)}},$type:new $.ig.Type("ArrayListCollection$1",$.ig.Object.prototype.$type,[$.ig.IList$1.prototype.$type.specialize(0),$.ig.INotifyCollectionChanged.prototype.$type])},true);$.ig.util.defType("IOlapDataSource","Object",{$type:new $.ig.Type("IOlapDataSource",null)},true);$.ig.util.defType("MeasureList","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(value){if(arguments.length===1){this._name=value;return value}else{return this._name}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},uniqueName:function(a){if(arguments.length===1){this.name(a);return a}else{return this.name()}},_measures:null,measures:function(value){if(arguments.length===1){this._measures=value;return value}else{return this._measures}},$type:new $.ig.Type("MeasureList",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("OlapMetadataTreeItem","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_item:null,item:function(value){if(arguments.length===1){this._item=value;return value}else{return this._item}},_type:null,type:function(value){if(arguments.length===1){this._type=value;return value}else{return this._type}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},_children:null,children:function(value){if(arguments.length===1){this._children=value;return value}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.Array.prototype.copy(this.children(),0,b,0,this.children().length);b[this.children().length]=a;this.children(b)},$type:new $.ig.Type("OlapMetadataTreeItem",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapDataSource","Object",{ac:null,ab:null,ag:0,j:null,g:null,init:function(a){var $self=this;this.ac=new $.ig.List$1($.ig.PositionInfo.prototype.$type,0);this.ab=new $.ig.List$1($.ig.PositionInfo.prototype.$type,0);this.af=new $.ig.List$1(String,0);$.ig.Object.prototype.init.call(this);this.u(new $.ig.List$1($.ig.AxisElement.prototype.$type,0));this.w(new $.ig.List$1($.ig.AxisElement.prototype.$type,0));this.v(new $.ig.List$1($.ig.AxisElement.prototype.$type,0));this.o(false);this.al(null);this.t(false);this.aj(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 $.ig.ArrayListCollection$1($.ig.Catalog.prototype.$type));this.cubes(new $.ig.ArrayListCollection$1($.ig.Cube.prototype.$type));this.measureGroups(new $.ig.ArrayListCollection$1($.ig.MeasureGroup.prototype.$type));this.rowAxis(new $.ig.ArrayListCollection$1($.ig.ICoreOlapElement.prototype.$type));this.columnAxis(new $.ig.ArrayListCollection$1($.ig.ICoreOlapElement.prototype.$type));this.filters(new $.ig.ArrayListCollection$1($.ig.Hierarchy.prototype.$type));this.measures(new $.ig.ArrayListCollection$1($.ig.Measure.prototype.$type));this.measureListLocation($.ig.MeasureListLocation.prototype.columns);this.measureListIndex(-1);this.sourceOptions(a);this.result(function(){var $ret=new $.ig.OlapResult;$ret.isEmpty(true);return $ret}())},_isInitialized:false,isInitialized:function(value){if(arguments.length===1){this._isInitialized=value;return value}else{return this._isInitialized}},_catalogs:null,catalogs:function(value){if(arguments.length===1){this._catalogs=value;return value}else{return this._catalogs}},_cubes:null,cubes:function(value){if(arguments.length===1){this._cubes=value;return value}else{return this._cubes}},_cube:null,cube:function(value){if(arguments.length===1){this._cube=value;return value}else{return this._cube}},_measureGroup:null,measureGroup:function(value){if(arguments.length===1){this._measureGroup=value;return value}else{return this._measureGroup}},_measureGroups:null,measureGroups:function(value){if(arguments.length===1){this._measureGroups=value;return value}else{return this._measureGroups}},_sourceOptions:null,sourceOptions:function(value){if(arguments.length===1){this._sourceOptions=value;return value}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(value){if(arguments.length===1){this._metadataTree=value;return value}else{return this._metadataTree}},_rowAxis:null,rowAxis:function(value){if(arguments.length===1){this._rowAxis=value;return value}else{return this._rowAxis}},_columnAxis:null,columnAxis:function(value){if(arguments.length===1){this._columnAxis=value;return value}else{return this._columnAxis}},_filters:null,filters:function(value){if(arguments.length===1){this._filters=value;return value}else{return this._filters}},_measures:null,measures:function(value){if(arguments.length===1){this._measures=value;return value}else{return this._measures}},measureListIndex:function(a){if(arguments.length===1){if(this.ag!=a){this.p(true);
this.ag=a;this.az();this.p(false)}return a}else{return this.ag}},measureListLocation:function(a){if(arguments.length===1){if(this.j!=a){this.ax();this.j=a;this.az()}return a}else{return this.j}},_result:null,result:function(value){if(arguments.length===1){this._result=value;return value}else{return this._result}},_l:null,l:function(value){if(arguments.length===1){this._l=value;return value}else{return this._l}},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_u:null,u:function(value){if(arguments.length===1){this._u=value;return value}else{return this._u}},_w:null,w:function(value){if(arguments.length===1){this._w=value;return value}else{return this._w}},_v:null,v:function(value){if(arguments.length===1){this._v=value;return value}else{return this._v}},af:null,_o:false,o:function(value){if(arguments.length===1){this._o=value;return value}else{return this._o}},_al:null,al:function(value){if(arguments.length===1){this._al=value;return value}else{return this._al}},_t:false,t:function(value){if(arguments.length===1){this._t=value;return value}else{return this._t}},_aj:null,aj:function(value){if(arguments.length===1){this._aj=value;return value}else{return this._aj}},_m:false,m:function(value){if(arguments.length===1){this._m=value;return value}else{return this._m}},_s:false,s:function(value){if(arguments.length===1){this._s=value;return value}else{return this._s}},_n:false,n:function(value){if(arguments.length===1){this._n=value;return value}else{return this._n}},_r:false,r:function(value){if(arguments.length===1){this._r=value;return value}else{return this._r}},_q:false,q:function(value){if(arguments.length===1){this._q=value;return value}else{return this._q}},_p:false,p:function(value){if(arguments.length===1){this._p=value;return value}else{return this._p}},getMembersOfLevel:function(a){},getMembersOfHierarchy:function(a){},getMembersOfMember:function(a){},setCube:function(a){if(!this.isInitialized()){throw new $.ig.InvalidOperationException(1,"Data source is not initialized.")}return this.an(a)},setMeasureGroup:function(a){if(!this.isInitialized()){throw new $.ig.InvalidOperationException(1,"Data source is not initialized.")}return this.ao(a)},getCoreElement:function(a,b){if(b==$.ig.MeasureList.prototype.$type){var c;if(this.measureListLocation()==$.ig.MeasureListLocation.prototype.columns){c=this.columnAxis()}else{c=this.rowAxis()}var d=null;var f=c.getEnumerator();while(f.moveNext()){var e=f.current();d=$.ig.util.cast($.ig.MeasureList.prototype.$type,e);if(d!=null){break}}return d}else{return this.getCoreElements(a,b).firstOrDefault$1($.ig.ICoreOlapElement.prototype.$type)}},getCoreElements:function(a,b){var $self=this;if(b==$.ig.Dimension.prototype.$type){return $self.a($.ig.Dimension.prototype.$type,$self.c().n().where$1($.ig.Dimension.prototype.$type,function(c){return a(c)}))}if(b==$.ig.Hierarchy.prototype.$type){return $self.a($.ig.Hierarchy.prototype.$type,$self.c().o().where$1($.ig.Hierarchy.prototype.$type,function(c){return a(c)}))}if(b==$.ig.Level.prototype.$type){return $self.a($.ig.Level.prototype.$type,$self.c().r().where$1($.ig.Level.prototype.$type,function(c){return a(c)}))}if(b==$.ig.Measure.prototype.$type){return $self.a($.ig.Measure.prototype.$type,$self.c().s().where$1($.ig.Measure.prototype.$type,function(c){return a(c)}))}if(b==$.ig.KpiMeasure.prototype.$type){return $self.a($.ig.KpiMeasure.prototype.$type,$self.c().q().where$1($.ig.KpiMeasure.prototype.$type,function(c){return a(c)}))}if(b==$.ig.Kpi.prototype.$type){return $self.a($.ig.Kpi.prototype.$type,$self.c().p().where$1($.ig.Kpi.prototype.$type,function(c){return a(c)}))}throw new $.ig.NotSupportedException(0,"Supported types are Dimension, Hierarchy, Level and Measure")},expandTupleMember:function(a,b,c){var $self=this;var d=$self.d(a,$self.result());if(d==null){throw new $.ig.InvalidOperationException(1,"No axis found for the specified index.")}var e=$self.ac.where$1($.ig.PositionInfo.prototype.$type,function(f){return f.c()==a&&f.b()==b&&f.a()==c}).firstOrDefault$1($.ig.PositionInfo.prototype.$type);if(e==null){e=function(){var $ret=new $.ig.PositionInfo;$ret.c(a);$ret.a(c);$ret.b(b);return $ret}();$self.ac.add(e)}else{$self.ac.remove(e)}},collapseTupleMember:function(a,b,c){var $self=this;var d=$self.d(a,$self.result());if(d==null){throw new $.ig.InvalidOperationException(1,"No axis found for the specified index.")}var e=$self.ac.where$1($.ig.PositionInfo.prototype.$type,function(f){return f.c()==a&&f.b()==b&&f.a()==c}).firstOrDefault$1($.ig.PositionInfo.prototype.$type);if(e==null){e=function(){var $ret=new $.ig.PositionInfo;$ret.c(a);$ret.a(c);$ret.b(b);return $ret}();$self.ab.add(e)}else{$self.ac.remove(e)}},clearPendingChanges:function(){this.ab.clear();this.ac.clear()},update:function(){var $self=this;if($self.t()){return $self.aj()}$self.t(true);if($self.ac.count()>0){var a=$self.as($self.ac);$self.aj(a.continueWithTask$1($.ig.OlapResult.prototype.$type,function(b){return $self.ai()}))}else{$self.aj($self.ai())}var b=$self.aj();$self.aj().i(function(c){$self.t(false);$self.aj(null)});return b},initialize:function(){var $self=this;if($self.o()){return $self.al()}$self.o(true);$self.al($self.am());var a=$self.al();$self.al().i(function(b){$self.o(false);$self.al(null)});return a},addFilterMember:function(a,b){var $self=this;var c;var d=function(){var $ret=$self.b(a,c);c=$ret.filtersCollection;return $ret.ret}();if(d==null){d=new $.ig.AxisElement(a,function(){var $ret=new $.ig.ArrayListCollection$1(String);$ret.add(b);return $ret}());c.add(d)}else{if(!d.a().contains(b)){d.a().add(b);if($self.af.contains(b)){$self.af.remove(b)}else{$self.af.add(b)}}}},getFilterMemberNames:function(a){var $self=this;var b;var c=function(){var $ret=$self.b(a,b);b=$ret.filtersCollection;return $ret.ret}();if(c!=null){return $self.a(String,c.a())}return new $.ig.ArrayListCollection$1(String)},removeFilterMember:function(a,b){var $self=this;var c;var d=function(){var $ret=$self.b(a,c);c=$ret.filtersCollection;return $ret.ret}();if(d==null){return}if(d.a().remove(b)){if($self.af.contains(b)){$self.af.remove(b)}else{$self.af.add(b)}}},removeAllFilterMembers:function(a){var $self=this;var b;var c=function(){var $ret=$self.b(a,b);b=$ret.filtersCollection;return $ret.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($self.af.contains(e)){$self.af.remove(e)}else{$self.af.add(e)}}},getProviderDefaultProperties:function(){var a=new $.ig.List$1($.ig.KeyValueItem.prototype.$type,0);return a},getProviderDefaultRestrictions:function(){var a=new $.ig.List$1($.ig.KeyValueItem.prototype.$type,0);return a},tryGetMember:function(a,b){var $self=this;return{ret:function(){var $ret=$self.c().f(a,b);b=$ret.member;return $ret.ret}(),member:b};return{member:b}},tryGetMembersForLevel:function(a,b){var $self=this;return{ret:function(){var $ret=$self.c().h(a,b);b=$ret.members;return $ret.ret}(),members:b};return{members:b}},am:function(){},ai:function(){},h:function(){},ah:function(){},an:function(a){var $self=this;if(String.isNullOrEmpty(a)){if(a==null){throw new $.ig.ArgumentNullException("cubeName")}throw new $.ig.InvalidOperationException(1,"cubeName cannot be empty.")}var b=new $.ig.TaskCompletionSource$1($.ig.OlapMetadataTreeItem.prototype.$type,0);if($self.cube()!=null){if($self.cube().name()==a){b.e($self.metadataTree());return b.b()}$self.au()}var d=$self.cubes().getEnumerator();while(d.moveNext()){var c=d.current();if(c.name()==a){$self.cube(c);break}}var e=$self.ah();if(!$self.isInitialized()){var f=$self.sourceOptions().measureGroup();if(!String.isNullOrEmpty(f)){return e.continueWithTask$1($.ig.OlapMetadataTreeItem.prototype.$type,function(g){return $self.ao(f)})}}return e.continueWithTask$1($.ig.OlapMetadataTreeItem.prototype.$type,function(g){return $self.ao(null)})},ak:function(){var $self=this;var a=null;var b=null;var c=null;var d=new $.ig.List$1($.ig.AxisElement.prototype.$type,0);if(!String.isNullOrEmpty($self.sourceOptions().columns())){var e=new $.ig.AxisDefinitionParser($self.sourceOptions().columns());a=e.c()}if(!String.isNullOrEmpty($self.sourceOptions().rows())){var f=new $.ig.AxisDefinitionParser($self.sourceOptions().rows());b=f.c()}if(!String.isNullOrEmpty($self.sourceOptions().filters())){var g=new $.ig.AxisDefinitionParser($self.sourceOptions().filters());c=g.c()}if(a!=null&&a.count()>0){var i=a.getEnumerator();while(i.moveNext()){var h=i.current();$self.at($.ig.ICoreOlapElement.prototype.$type,h.b(),$self.columnAxis(),$.ig.Hierarchy.prototype.$type);$self.u().add(h);if(h.a().count()>0){d.add(h);var k=h.a().getEnumerator();while(k.moveNext()){var j=k.current();$self.af.add(j)}}}}if(b!=null&&b.count()>0){var m=b.getEnumerator();while(m.moveNext()){var l=m.current();$self.at($.ig.ICoreOlapElement.prototype.$type,l.b(),$self.rowAxis(),$.ig.Hierarchy.prototype.$type);$self.w().add(l);if(l.a().count()>0){d.add(l);var o=l.a().getEnumerator();while(o.moveNext()){var n=o.current();$self.af.add(n)}}}}if(c!=null&&c.count()>0){var q=c.getEnumerator();while(q.moveNext()){var p=q.current();$self.at($.ig.Hierarchy.prototype.$type,p.b(),$self.filters(),$.ig.Hierarchy.prototype.$type);$self.v().add(p);if(p.a().count()>0){d.add(p);var s=p.a().getEnumerator();while(s.moveNext()){var r=s.current();$self.af.add(r)}}}}var t=null;if(!String.isNullOrEmpty($self.sourceOptions().measures())){var u=new $.ig.AxisDefinitionParser($self.sourceOptions().measures());t=u.c()}if(t!=null&&t.count()>0){var w=t.getEnumerator();while(w.moveNext()){var v=w.current();$self.at($.ig.Measure.prototype.$type,v.b(),$self.measures(),$.ig.Measure.prototype.$type)}}if($self.m()||$self.s()||$self.n()||$self.r()||$self.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]=$self.getMembersOfHierarchy(z)}var aa=new $.ig.TaskCompletionSource$1($.ig.OlapMetadataTreeItem.prototype.$type,0);var ab=new $.ig.TaskFactory;ab.c(x,function(ac){$self.ai().i(function(ad){$self.aw();aa.e($self.metadataTree())})});return aa.b()}return $self.ai().continueWithTask$1($.ig.OlapMetadataTreeItem.prototype.$type,function(ac){$self.aw();var ad=new $.ig.TaskCompletionSource$1($.ig.OlapMetadataTreeItem.prototype.$type,0);ad.e($self.metadataTree());return ad.b()})}$self.aw();var ac=new $.ig.TaskCompletionSource$1($.ig.OlapMetadataTreeItem.prototype.$type,0);ac.e($self.metadataTree());return ac.b()},aq:function(a){var $self=this;var b=$self.dataProviderFactory().createDataProvider();var c=$self.getProviderDefaultRestrictions();var d=$self.getProviderDefaultProperties();var e=b.discoverCubesAsync(d,c).j($.ig.IList$1.prototype.$type.specialize($.ig.Cube.prototype.$type),function(f){$self.cubes($self.a($.ig.Cube.prototype.$type,f.m()));return $self.cubes()});return e},ar:function(){var $self=this;var a=$self.dataProviderFactory().createDataProvider();var b=$self.getProviderDefaultRestrictions();var c=$self.getProviderDefaultProperties();var d=a.discoverMeasureGroupsAsync(c,b).j($.ig.IList$1.prototype.$type.specialize($.ig.MeasureGroup.prototype.$type),function(e){$self.measureGroups($self.a($.ig.MeasureGroup.prototype.$type,e.m()));return $self.measureGroups()});return d},aw:function(){this.isInitialized(true)},au:function(){this.cube(null);this.measureGroups(new $.ig.ArrayListCollection$1($.ig.MeasureGroup.prototype.$type));this.filters().clear();this.rowAxis().clear();this.columnAxis().clear();this.measures().clear();this.c(null);this.av()},av:function(){this.measureGroup(null);this.metadataTree(null)},ao:function(a){var $self=this;if($self.cube()==null){throw new $.ig.InvalidOperationException(1,"Data source has no Cube set.")}var b=new $.ig.TaskCompletionSource$1($.ig.OlapMetadataTreeItem.prototype.$type,0);if($self.measureGroup()!=null){if($self.measureGroup().name()==a){b.e($self.metadataTree());return b.b()}$self.av()}if(!String.isNullOrEmpty(a)&&$self.measureGroups().count()==0){var c=$self.ar().continueWithTask$1($.ig.OlapMetadataTreeItem.prototype.$type,function(d){if($self.measureGroups().count()==0){return $self.ao(null)}return $self.ao(a)});return c}var e=$self.measureGroups().getEnumerator();while(e.moveNext()){var d=e.current();if(d.name()==a){$self.measureGroup(d);break}}$self.metadataTree($self.k(a));b.e($self.metadataTree());return b.b()},k:function(a){var $self=this;var b=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.cube);$ret.caption($self.cube().caption());$ret.item($self.cube());return $ret}();var c;var d;var e;var f=true;if(String.isNullOrEmpty(a)||$self.measureGroups()==null){c=$self.c().n();d=$self.c().s();e=$self.c().p()}else{f=false;c=$self.c().a().getMeasureGroupDimensions(a);d=$self.c().a().getMeasureGroupMeasures(a);e=$self.c().a().getMeasureGroupKpis(a)}var g=$.ig.MetaTreeHelper.prototype.getDimensionMetaItems(c,d,e,$self.c().o(),$self.c().r(),f,$self.c());$.ig.MetaTreeHelper.prototype.setMetaItemChildren(b,g);return b},d:function(a,b){var $self=this;if(b!=null&&b.axes().count()>0){return b.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(c){return c.name()==a}).firstOrDefault$1($.ig.OlapResultAxis.prototype.$type)}return null},ay:function(a,b){var $self=this;switch(a.action()){case $.ig.NotifyCollectionChangedAction.prototype.add:var d=a.newItems().getEnumerator();while(d.moveNext()){var c=d.current();var e=$.ig.util.cast($.ig.Hierarchy.prototype.$type,c);if(e!=null){if($self.isInitialized()){b.add(new $.ig.AxisElement(e.uniqueName(),new $.ig.ArrayListCollection$1(String)))}}}break;case $.ig.NotifyCollectionChangedAction.prototype.remove:var g=a.oldItems().getEnumerator();while(g.moveNext()){var f=g.current();var h=$.ig.util.cast($.ig.Hierarchy.prototype.$type,f);if(h!=null){var i=b.where$1($.ig.AxisElement.prototype.$type,function(j){return j.b()==h.uniqueName()}).firstOrDefault$1($.ig.AxisElement.prototype.$type);if(i!=null){var j=new $.ig.List$1(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);$self.removeFilterMember(i.b(),m)}b.remove(i)}}else{var n=$.ig.util.cast($.ig.MeasureList.prototype.$type,f);if(n!=null){if(!$self.r()&&!$self.q()&&!$self.p()){$self.measures().clear()}}}}break}},a0:function(a,b){var $self=this;switch(a.action()){case $.ig.NotifyCollectionChangedAction.prototype.add:var d=a.newItems().getEnumerator();while(d.moveNext()){var c=d.current();var e=$.ig.util.cast($.ig.Hierarchy.prototype.$type,c);if(e!=null){var f=$.ig.util.cast($.ig.MeasureList.prototype.$type,b.where$1($.ig.ICoreOlapElement.prototype.$type,function(g){return $.ig.util.cast($.ig.MeasureList.prototype.$type,g)!==null}).firstOrDefault$1($.ig.ICoreOlapElement.prototype.$type));if(f!=null&&$self.measureListIndex()>=a.newStartingIndex()){$self.measureListIndex($self.measureListIndex()+1)}}}break;case $.ig.NotifyCollectionChangedAction.prototype.remove:var h=a.oldItems().getEnumerator();while(h.moveNext()){var g=h.current();var i=$.ig.util.cast($.ig.Hierarchy.prototype.$type,g);if(i!=null){var j=$.ig.util.cast($.ig.MeasureList.prototype.$type,b.where$1($.ig.ICoreOlapElement.prototype.$type,function(k){return $.ig.util.cast($.ig.MeasureList.prototype.$type,k)!==null}).firstOrDefault$1($.ig.ICoreOlapElement.prototype.$type));if(j!=null&&$self.measureListIndex()>a.oldStartingIndex()){$self.measureListIndex($self.measureListIndex()-1)}}}break}},az:function(){var $self=this;var a;if($self.measureListLocation()==$.ig.MeasureListLocation.prototype.columns){a=$self.columnAxis()}else{a=$self.rowAxis()}var b=null;var c=0;var e=a.getEnumerator();while(e.moveNext()){var d=e.current();b=$.ig.util.cast($.ig.MeasureList.prototype.$type,d);if(b!=null){break}c++}if($self.measures().count()>1){if(b==null){b=function(){var $ret=new $.ig.MeasureList;$ret.measures($self.measures());return $ret}();if($self.measureListIndex()<0||$self.measureListIndex()>a.count()){$self.ag=a.count();a.add(b)}else{a.insert($self.measureListIndex(),b)}}else{if(c!=$self.measureListIndex()){a.removeAt(c);if($self.measureListIndex()>a.count()){$self.ag=a.count();a.add(b)}else{a.insert($self.measureListIndex(),b)}}}}else{if(b!=null){a.removeAt(c)}}},ae:function(){return this.ac},ad:function(){return this.ab},at:function($tItem,a,b,c){var $self=this;var d=function(e){return e.uniqueName()==a};var e=$self.getCoreElement(d,c);if(e!=null&&!b.contains($.ig.Object.prototype.$type,e)){b.add(e)}},as:function(a){var $self=this;var b=new $.ig.List$1(String,0);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();var e=$self.d(c.c(),$self.result()).tuples().__inner[c.b()].members().item(c.a());var f=$self.getCoreElement(function(g){return g.hierarchyUniqueName()==e.hierarchyUniqueName()&&g.depth()==e.levelNumber()+1},$.ig.Level.prototype.$type);if(f!=null&&!$self.c().b(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]=$self.getMembersOfLevel(b.item(h))}return(new $.ig.TaskFactory).d($.ig.Array.prototype.$type,g,function(i){return i})}var i=new $.ig.TaskCompletionSource$1($.ig.Array.prototype.$type,0);i.e(new Array(0));return i.b()},ax:function(){var a;if(this.measureListLocation()==$.ig.MeasureListLocation.prototype.columns){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=$.ig.util.cast($.ig.MeasureList.prototype.$type,d);if(b!=null){break}c++}if(b!=null){this.q(true);a.removeAt(c)}},a:function($t,a){var b=new $.ig.ArrayListCollection$1($t);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b.add(c)}return b},b:function(a,b){var $self=this;var c=$self.u().where$1($.ig.AxisElement.prototype.$type,function(d){return d.b()==a}).firstOrDefault$1($.ig.AxisElement.prototype.$type);if(c!=null){b=$self.u();return{ret:c,filtersCollection:b}}c=$self.w().where$1($.ig.AxisElement.prototype.$type,function(d){return d.b()==a}).firstOrDefault$1($.ig.AxisElement.prototype.$type);if(c!=null){b=$self.w();return{ret:c,filtersCollection:b}}c=$self.v().where$1($.ig.AxisElement.prototype.$type,function(d){return d.b()==a}).firstOrDefault$1($.ig.AxisElement.prototype.$type);if(c!=null){b=$self.v();return{ret:c,filtersCollection:b}}b=null;return{ret:null,filtersCollection:b};return{filtersCollection:b}},$type:new $.ig.Type("OlapDataSource",$.ig.Object.prototype.$type,[$.ig.IOlapDataSource.prototype.$type])},true);$.ig.util.defType("PositionInfo","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_b:0,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_a:0,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},$type:new $.ig.Type("PositionInfo",$.ig.Object.prototype.$type)},true);$.ig.util.defType("CubeMetaItemsCache","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.m=new $.ig.Dictionary$2(String,$.ig.Tuple$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.Member.prototype.$type),0);this.i=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Member.prototype.$type,0);this.l=new $.ig.Dictionary$2(String,$.ig.IList$1.prototype.$type.specialize($.ig.Member.prototype.$type),0);this.k=new $.ig.Dictionary$2(String,$.ig.Measure.prototype.$type,0);this.j=new $.ig.Dictionary$2(String,$.ig.KpiMeasure.prototype.$type,0)},m:null,i:null,l:null,k:null,j:null,_s:null,s:function(value){if(arguments.length===1){this._s=value;return value}else{return this._s}},_q:null,q:function(value){if(arguments.length===1){this._q=value;return value}else{return this._q}},_n:null,n:function(value){if(arguments.length===1){this._n=value;return value}else{return this._n}},_o:null,o:function(value){if(arguments.length===1){this._o=value;return value}else{return this._o}},_r:null,r:function(value){if(arguments.length===1){this._r=value;return value}else{return this._r}},_p:null,p:function(value){if(arguments.length===1){this._p=value;return value}else{return this._p}},_t:null,t:function(value){if(arguments.length===1){this._t=value;return value}else{return this._t}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},b:function(a){return this.l.containsKey(a)},u:function(a){var $self=this;var b;if(!function(){var $ret=$self.m.tryGetValue(a.uniqueName(),b);b=$ret.value;return $ret.ret}()){var c=$self.m.count();b=new $.ig.Tuple$2($.ig.Number.prototype.$type,$.ig.Member.prototype.$type,c,a);$self.m.item(a.uniqueName(),b);$self.i.item(c,a);var d;if(!function(){var $ret=$self.l.tryGetValue(a.levelUniqueName(),d);d=$ret.value;return $ret.ret}()){d=new $.ig.ArrayListCollection$1($.ig.Member.prototype.$type);$self.l.item(a.levelUniqueName(),d)}d.add(a)}return b.a()},g:function(a,b){var $self=this;var c;if(function(){var $ret=$self.m.tryGetValue(a,c);c=$ret.value;return $ret.ret}()){b=c.a();return{ret:true,memberOrdinal:b}}b=-1;return{ret:false,memberOrdinal:b};return{memberOrdinal:b}},f:function(a,b){var $self=this;var c;if(function(){var $ret=$self.m.tryGetValue(a,c);c=$ret.value;return $ret.ret}()){b=c.b();return{ret:true,member:b}}b=null;return{ret:false,member:b};return{member:b}},e:function(a,b){var $self=this;return{ret:function(){var $ret=$self.i.tryGetValue(a,b);b=$ret.value;return $ret.ret}(),member:b};return{member:b}},h:function(a,b){var $self=this;return{ret:function(){var $ret=$self.l.tryGetValue(a,b);b=$ret.value;return $ret.ret}(),members:b};return{members:b}},d:function(a,b){var $self=this;if(!function(){var $ret=$self.k.tryGetValue(a,b);b=$ret.value;return $ret.ret}()){b=$self.s().where$1($.ig.Measure.prototype.$type,function(c){return c.uniqueName()==a}).firstOrDefault$1($.ig.Measure.prototype.$type);if(b==null){return{ret:false,measure:b}}$self.k.add(a,b)}return{ret:true,measure:b};return{measure:b}},c:function(a,b){var $self=this;if(!function(){var $ret=$self.j.tryGetValue(a,b);b=$ret.value;return $ret.ret}()){b=$self.q().where$1($.ig.KpiMeasure.prototype.$type,function(c){return c.uniqueName()==a}).firstOrDefault$1($.ig.KpiMeasure.prototype.$type);if(b==null){return{ret:false,measure:b}}$self.j.add(a,b)}return{ret:true,measure:b};return{measure:b}},$type:new $.ig.Type("CubeMetaItemsCache",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MetaTreeHelper","Object",{init:function(){$.ig.Object.prototype.init.call(this)},getDimensionMetaItems:function(a,b,c,d,e,f,g){var $self=this;var h=new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0);var i=new $.ig.HierarchyItemPosition;i.a(0);i.b(0);var j=new $.ig.List$1($.ig.Hierarchy.prototype.$type,0);var l=d.getEnumerator();while(l.moveNext()){var k=l.current();j.add(k)}var m=new $.ig.List$1($.ig.Level.prototype.$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=$.ig.MetaTreeHelper.prototype.e(j,m,p,i);if(p.dimensionType()!=$.ig.DimensionType.prototype.measure){var s=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.dimension);$ret.caption(p.caption());$ret.item(p);return $ret}();$.ig.MetaTreeHelper.prototype.setMetaItemChildren(s,r);h.add(s)}else{var t=$.ig.MetaTreeHelper.prototype.b(b,p);h.insert(0,t);if(c.count$1($.ig.Kpi.prototype.$type)>0){var u=function(){var $ret=new $.ig.KpiDimension;$ret.caption("Kpis");return $ret}();var v=$.ig.MetaTreeHelper.prototype.a(c,u,g);v.type($.ig.OlapMetadataTreeItemType.prototype.kpiRoot);h.insert(1,v)}}}return h},setMetaItemChildren:function(a,b){if(b.count()>0){var c=new Array(b.count());for(var d=0;d<b.count();d++){c[d]=b.item(d)}a.children(c)}},e:function(a,b,c,d){var $self=this;var e=new $.ig.Dictionary$2(String,$.ig.Tuple$2.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type)),0);var f=new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$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=$.ig.MetaTreeHelper.prototype.c(g.hierarchyDisplayFolder());for(var k=0;k<j.length;k++){var l=j[k];i+=l+"\\";var m;if(!function(){var $ret=e.tryGetValue(i,m);m=$ret.value;return $ret.ret}()){var n=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.group);$ret.caption(l);return $ret}();m=new $.ig.Tuple$2($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type),n,new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$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 $.ig.HierarchyOrigin.prototype.systemEnabled:o=$.ig.OlapMetadataTreeItemType.prototype.systemEnabledHierarchy;break;case $.ig.HierarchyOrigin.prototype.userDefined:o=$.ig.OlapMetadataTreeItemType.prototype.userDefinedHierarchy;break;default:o=$.ig.OlapMetadataTreeItemType.prototype.parentChildHierarchy;break}var p=$.ig.MetaTreeHelper.prototype.f(b,g,d);var q=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type(o);$ret.caption(g.caption());$ret.item(g);return $ret}();$.ig.MetaTreeHelper.prototype.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();$.ig.MetaTreeHelper.prototype.setMetaItemChildren(t,r.b())}return f},f:function(a,b,c){var $self=this;var d=new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$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=$.ig.OlapMetadataTreeItemType.prototype.level1;break;case 2:f=$.ig.OlapMetadataTreeItemType.prototype.level2;break;case 3:f=$.ig.OlapMetadataTreeItemType.prototype.level3;break;case 4:f=$.ig.OlapMetadataTreeItemType.prototype.level4;break;default:f=$.ig.OlapMetadataTreeItemType.prototype.level5;break}var g=function(){var $ret=new $.ig.OlapMetadataTreeItem;$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},b:function(a,b){var $self=this;var c=new $.ig.Dictionary$2(String,$.ig.Tuple$2.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type)),0);var d=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.measure);$ret.caption(b.caption());$ret.item(b);return $ret}();var e=new $.ig.Tuple$2($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type),d,new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0));var g=a.getEnumerator();while(g.moveNext()){var f=g.current();if($.ig.util.cast($.ig.KpiMeasure.prototype.$type,f)!==null){continue}var h=e;if(!String.isNullOrEmpty(f.measureGroupName())){if(!function(){var $ret=c.tryGetValue(f.measureGroupName(),h);h=$ret.value;return $ret.ret}()){var i=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.group);$ret.caption(f.measureGroupName());return $ret}();h=new $.ig.Tuple$2($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type),i,new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$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=$.ig.MetaTreeHelper.prototype.c(f.measureDisplayFolder());for(var m=0;m<l.length;m++){var n=l[m];k+="\\"+n;var o;if(!function(){var $ret=c.tryGetValue(k,o);o=$ret.value;return $ret.ret}()){var p=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.group);$ret.caption(n);return $ret}();o=new $.ig.Tuple$2($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type),p,new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0));c.add(k,o);j.b().add(p)}j=o}}var q=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.measure);$ret.caption(f.caption());$ret.item(f);return $ret}();j.b().add(q)}var r=new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0);var t=e.b().where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(u){return u.type()==$.ig.OlapMetadataTreeItemType.prototype.group}).orderBy$2($.ig.OlapMetadataTreeItem.prototype.$type,String,function(u){return u.caption()}).getEnumerator();while(t.moveNext()){var s=t.current();r.add(s)}var v=e.b().where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(w){return w.type()!=$.ig.OlapMetadataTreeItemType.prototype.group}).orderBy$2($.ig.OlapMetadataTreeItem.prototype.$type,String,function(w){return w.caption()}).getEnumerator();while(v.moveNext()){var u=v.current();r.add(u)}$.ig.MetaTreeHelper.prototype.setMetaItemChildren(d,r);var x=c.values().getEnumerator();while(x.moveNext()){var w=x.current();var y=w.b();var z=y.where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(aa){return aa.type()==$.ig.OlapMetadataTreeItemType.prototype.group}).orderBy$2($.ig.OlapMetadataTreeItem.prototype.$type,String,function(aa){return aa.caption()}).toList$1($.ig.OlapMetadataTreeItem.prototype.$type);var aa=y.where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(ab){return ab.type()!=$.ig.OlapMetadataTreeItemType.prototype.group}).orderBy$2($.ig.OlapMetadataTreeItem.prototype.$type,String,function(ab){return ab.caption()}).toList$1($.ig.OlapMetadataTreeItem.prototype.$type);var ab=new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$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();$.ig.MetaTreeHelper.prototype.setMetaItemChildren(ae,ab)}return d},a:function(a,b,c){var $self=this;var d=new $.ig.Dictionary$2(String,$.ig.Tuple$2.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type)),0);var e=c.s().toList$1($.ig.Measure.prototype.$type);c.s(e);var f=new $.ig.List$1($.ig.KpiMeasure.prototype.$type,0);c.q(f);var g=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.kpiRoot);$ret.caption(b.caption());$ret.item(b);return $ret}();var h=new $.ig.Tuple$2($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type),g,new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$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=$.ig.MetaTreeHelper.prototype.c(i.kpiDisplayFolder());for(var n=0;n<m.length;n++){var o=m[n];l+="\\"+o;var p;if(!function(){var $ret=d.tryGetValue(l,p);p=$ret.value;return $ret.ret}()){var q=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.group);$ret.caption(o);return $ret}();p=new $.ig.Tuple$2($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type),q,new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0));d.add(l,p);k.b().add(q)}k=p}}var r=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.kpi);$ret.caption(i.caption());$ret.item(i);return $ret}();if(!String.isNullOrEmpty(i.kpiValue())){var s=null;
var t=$.ig.OlapMetadataTreeItemType.prototype.measure;var u="Value";if(!function(){var $ret=c.d(i.kpiValue(),s);s=$ret.measure;return $ret.ret}()){t=$.ig.OlapMetadataTreeItemType.prototype.kpiValue;s=$.ig.KpiMeasure.prototype.createKpiValueMeasure(i);e.add(s);f.add(s)}else{u+=" ("+s.caption()+")"}r.e(function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.caption(u);$ret.item(s);$ret.type(t);return $ret}())}if(!String.isNullOrEmpty(i.kpiGoal())){var v=null;var w=$.ig.OlapMetadataTreeItemType.prototype.measure;var x="Goal";if(!function(){var $ret=c.d(i.kpiGoal(),v);v=$ret.measure;return $ret.ret}()){w=$.ig.OlapMetadataTreeItemType.prototype.kpiGoal;v=$.ig.KpiMeasure.prototype.createKpiGoalMeasure(i);e.add(v);f.add(v)}else{x+=" ("+v.caption()+")"}r.e(function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.caption(x);$ret.item(v);$ret.type(w);return $ret}())}if(!String.isNullOrEmpty(i.kpiStatus())){var y=$.ig.KpiMeasure.prototype.createKpiStatusMeasure(i);e.add(y);f.add(y);r.e(function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.caption("Status");$ret.item(y);$ret.type($.ig.OlapMetadataTreeItemType.prototype.kpiStatus);return $ret}())}if(!String.isNullOrEmpty(i.kpiTrend())){var z=$.ig.KpiMeasure.prototype.createKpiTrendMeasure(i);e.add(z);f.add(z);r.e(function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.caption("Trend");$ret.item(z);$ret.type($.ig.OlapMetadataTreeItemType.prototype.kpiTrend);return $ret}())}if(!String.isNullOrEmpty(i.kpiWeight())){var aa=$.ig.KpiMeasure.prototype.createKpiWeightMeasure(i);e.add(aa);f.add(aa);r.e(function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.caption("Weight");$ret.item(aa);$ret.type($.ig.OlapMetadataTreeItemType.prototype.kpiWeight);return $ret}())}k.b().add(r)}var ab=new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0);var ad=h.b().where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(ae){return ae.type()==$.ig.OlapMetadataTreeItemType.prototype.group}).orderBy$2($.ig.OlapMetadataTreeItem.prototype.$type,String,function(ae){return ae.caption()}).getEnumerator();while(ad.moveNext()){var ac=ad.current();ab.add(ac)}var af=h.b().where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(ag){return ag.type()!=$.ig.OlapMetadataTreeItemType.prototype.group}).orderBy$2($.ig.OlapMetadataTreeItem.prototype.$type,String,function(ag){return ag.caption()}).getEnumerator();while(af.moveNext()){var ae=af.current();ab.add(ae)}$.ig.MetaTreeHelper.prototype.setMetaItemChildren(g,ab);var ah=d.values().getEnumerator();while(ah.moveNext()){var ag=ah.current();var ai=ag.b();var aj=ai.where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(ak){return ak.type()==$.ig.OlapMetadataTreeItemType.prototype.group}).orderBy$2($.ig.OlapMetadataTreeItem.prototype.$type,String,function(ak){return ak.caption()}).toList$1($.ig.OlapMetadataTreeItem.prototype.$type);var ak=ai.where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(al){return al.type()!=$.ig.OlapMetadataTreeItemType.prototype.group}).orderBy$2($.ig.OlapMetadataTreeItem.prototype.$type,String,function(al){return al.caption()}).toList$1($.ig.OlapMetadataTreeItem.prototype.$type);var al=new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$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();$.ig.MetaTreeHelper.prototype.setMetaItemChildren(ao,al)}return g},c:function(a){var b=a.split("\\");return b},$type:new $.ig.Type("MetaTreeHelper",$.ig.Object.prototype.$type)},true);$.ig.util.defType("HierarchyItemPosition","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_a:0,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},_b:0,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},$type:new $.ig.Type("HierarchyItemPosition",$.ig.Object.prototype.$type)},true);$.ig.util.defType("DataSourceBaseOptions","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_cube:null,cube:function(value){if(arguments.length===1){this._cube=value;return value}else{return this._cube}},_measureGroup:null,measureGroup:function(value){if(arguments.length===1){this._measureGroup=value;return value}else{return this._measureGroup}},_measures:null,measures:function(value){if(arguments.length===1){this._measures=value;return value}else{return this._measures}},_filters:null,filters:function(value){if(arguments.length===1){this._filters=value;return value}else{return this._filters}},_columns:null,columns:function(value){if(arguments.length===1){this._columns=value;return value}else{return this._columns}},_rows:null,rows:function(value){if(arguments.length===1){this._rows=value;return value}else{return this._rows}},$type:new $.ig.Type("DataSourceBaseOptions",$.ig.Object.prototype.$type)},true);$.ig.util.defType("AxisDefinitionParser","Object",{init:function(a){$.ig.Object.prototype.init.call(this);this.d(-1);this.k(a)},_a:false,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},_g:null,g:function(value){if(arguments.length===1){this._g=value;return value}else{return this._g}},_d:0,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},_k:null,k:function(value){if(arguments.length===1){this._k=value;return value}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 $.ig.AxisDefinitionParser.prototype.e:if(a==-1){a=this.d()}break;case $.ig.AxisDefinitionParser.prototype.f:b=this.d();while(this.d()+1<this.k().length){d=this.k().substr(this.d()+1,1);switch(d){case $.ig.AxisDefinitionParser.prototype.f:b=this.d()+1;break;case $.ig.AxisDefinitionParser.prototype.h:if($.ig.AxisDefinitionParser.prototype.f==this.k().substr(this.d(),1)){c=true}break;case $.ig.AxisDefinitionParser.prototype.i:case $.ig.AxisDefinitionParser.prototype.j:c=true;break}if(c){break}this.d(this.d()+1)}c=true;break;case $.ig.AxisDefinitionParser.prototype.h:c=true;break;case $.ig.AxisDefinitionParser.prototype.i:this.a(true);break;case $.ig.AxisDefinitionParser.prototype.j:$.ig.Debug.prototype.a(this.a());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 $.ig.List$1($.ig.AxisElement.prototype.$type,0);var b=null;while(this.b()){if(!this.a()){b=new $.ig.ArrayListCollection$1(String);var c=new $.ig.AxisElement(this.g(),b);a.add(c)}else if(b!=null){b.add(this.g())}}return a},$type:new $.ig.Type("AxisDefinitionParser",$.ig.Object.prototype.$type)},true);$.ig.util.defType("CoreOlapElementParser","Object",{init:function(a){$.ig.Object.prototype.init.call(this);this.c(-1);this.h(a)},_f:null,f:function(value){if(arguments.length===1){this._f=value;return value}else{return this._f}},_c:0,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_h:null,h:function(value){if(arguments.length===1){this._h=value;return value}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 $.ig.CoreOlapElementParser.prototype.d:if(a==-1){a=this.c()}break;case $.ig.CoreOlapElementParser.prototype.e:b=this.c();while(this.c()+1<this.h().length){d=this.h().substr(this.c()+1,1);switch(d){case $.ig.CoreOlapElementParser.prototype.e:b=this.c()+1;break;case $.ig.CoreOlapElementParser.prototype.g:c=true;break}if(c){break}this.c(this.c()+1)}break;case $.ig.CoreOlapElementParser.prototype.g: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 $.ig.List$1(String,0);while(this.a()){a.add(this.f())}return a},$type:new $.ig.Type("CoreOlapElementParser",$.ig.Object.prototype.$type)},true);$.ig.util.defType("KeyValueItem","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},$type:new $.ig.Type("KeyValueItem",$.ig.Object.prototype.$type)},true);$.ig.util.defType("AxisElement","Object",{init:function(a,b){$.ig.Object.prototype.init.call(this);this.b(a);this.a(b)},_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},$type:new $.ig.Type("AxisElement",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MeasureGroupMetaItemsCache","Object",{a:null,c:null,b:null,j:null,d:null,h:null,f:null,init:function(a,b,c,d){$.ig.Object.prototype.init.call(this);this.a=new $.ig.Dictionary$2(String,$.ig.IEnumerable$1.prototype.$type.specialize($.ig.Dimension.prototype.$type),0);this.c=new $.ig.Dictionary$2(String,$.ig.IEnumerable$1.prototype.$type.specialize($.ig.Measure.prototype.$type),0);this.b=new $.ig.Dictionary$2(String,$.ig.IEnumerable$1.prototype.$type.specialize($.ig.Kpi.prototype.$type),0);this.j=d;this.d=a;this.h=b;this.f=c},getMeasureGroupDimensions:function(a){var $self=this;var b;if(!function(){var $ret=$self.a.tryGetValue(a,b);b=$ret.value;return $ret.ret}()){var c=new $.ig.List$1(String,0);var e=$self.j.getEnumerator();while(e.moveNext()){var d=e.current();if(d.measureGroupName()==a){c.add(d.dimensionUniqueName())}}var f=new $.ig.List$1($.ig.Dimension.prototype.$type,0);var h=$self.d.getEnumerator();while(h.moveNext()){var g=h.current();if(c.contains(g.uniqueName())||g.dimensionType()==$.ig.DimensionType.prototype.measure){f.add(g)}}$self.a.add(a,f);b=f}return b},getMeasureGroupMeasures:function(a){var $self=this;var b;if(!function(){var $ret=$self.c.tryGetValue(a,b);b=$ret.value;return $ret.ret}()){var c=new $.ig.List$1($.ig.Measure.prototype.$type,0);var e=$self.h.getEnumerator();while(e.moveNext()){var d=e.current();if(d.measureGroupName()==a){c.add(d)}}$self.c.add(a,c);b=c}return b},getMeasureGroupKpis:function(a){var $self=this;var b;if(!function(){var $ret=$self.b.tryGetValue(a,b);b=$ret.value;return $ret.ret}()){var c=new $.ig.List$1($.ig.Kpi.prototype.$type,0);var e=$self.f.getEnumerator();while(e.moveNext()){var d=e.current();if(d.measureGroupName()==a){c.add(d)}}$self.b.add(a,c);b=c}return b},$type:new $.ig.Type("MeasureGroupMetaItemsCache",$.ig.Object.prototype.$type)},true);$.ig.util.defType("PositionItemInfo$2","Dictionary$2",{$tKey:null,$tSortKey:null,init:function($tKey,$tSortKey,a,b,c,d){this.q=new $.ig.Dictionary$2(this.$tKey,$.ig.Object.prototype.$type,0);this.$tKey=$tKey;this.$tSortKey=$tSortKey;this.$type=this.$type.specialize(this.$tKey,this.$tSortKey);$.ig.Dictionary$2.prototype.init.call(this,this.$tKey,$.ig.PositionItemInfo$2.prototype.$type.specialize(this.$tKey,this.$tSortKey));this.positionItem(a);this.positionIndex(b);this.positionItemIndex(c);this.positionItemDepth(0);this.positionItemDepthMin(-1);this.positionItemDepthMax(Number.MAX_VALUE);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())}},l:function(a,b,c,d){return new $.ig.PositionItemInfo$2(this.$tKey,this.$tSortKey,a,b,c,d)},_positionItemDepthMin:0,positionItemDepthMin:function(value){if(arguments.length===1){this._positionItemDepthMin=value;return value}else{return this._positionItemDepthMin}},_positionItemDepthMax:0,positionItemDepthMax:function(value){if(arguments.length===1){this._positionItemDepthMax=value;return value}else{return this._positionItemDepthMax}},_positionItem:null,positionItem:function(value){if(arguments.length===1){this._positionItem=value;return value}else{return this._positionItem}},_positionIndex:0,positionIndex:function(value){if(arguments.length===1){this._positionIndex=value;return value}else{return this._positionIndex}},_positionItemDepth:0,positionItemDepth:function(value){if(arguments.length===1){this._positionItemDepth=value;return value}else{return this._positionItemDepth}},_positionItemIndex:0,positionItemIndex:function(value){if(arguments.length===1){this._positionItemIndex=value;return value}else{return this._positionItemIndex}},_positionSize:0,positionSize:function(value){if(arguments.length===1){this._positionSize=value;return value}else{return this._positionSize}},_key:null,key:function(value){if(arguments.length===1){this._key=value;return value}else{return this._key}},_parentKey:null,parentKey:function(value){if(arguments.length===1){this._parentKey=value;return value}else{return this._parentKey}},_hierarchyKey:null,hierarchyKey:function(value){if(arguments.length===1){this._hierarchyKey=value;return value}else{return this._hierarchyKey}},_hierarchyLevelKey:null,hierarchyLevelKey:function(value){if(arguments.length===1){this._hierarchyLevelKey=value;return value}else{return this._hierarchyLevelKey}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},_sortKey:null,sortKey:function(value){if(arguments.length===1){this._sortKey=value;return value}else{return this._sortKey}},_isExpandable:false,isExpandable:function(value){if(arguments.length===1){this._isExpandable=value;return value}else{return this._isExpandable}},_isExpanded:false,isExpanded:function(value){if(arguments.length===1){this._isExpanded=value;return value}else{return this._isExpanded}},m:function(a,b,c){var d=false;if(this.positionItemIndex()==-1){d=true}else{if(c!=null){if(a.item(this.positionItemIndex()).key()!=null){var e=c.item(this.positionItemIndex());d=a.item(this.positionItemIndex()).key().equals(e.key())}}}if(this.positionItemIndex()+1==this.positionSize()){return d}var f=this.n(a,b,this.positionItemIndex()+1,c);return d&&f},ab:function(a,b){},q:null,n:function(a,b,c,d){var $self=this;var e;var f=a.item(c);if(!$self.containsKey(f.key())){var g=$self.l(f,b,c,$self.positionSize());g.isExpandable(f.isExpandable());if($self.q.containsKey(g.key())){$self.q.remove(g.key());g.isExpanded(true)}if(f.parentKey()!=null){var h=null;if(function(){var $ret=$self.tryGetValue(f.parentKey(),h);h=$ret.value;return $ret.ret}()){h.isExpanded(true)}else{if(!$self.q.containsKey(f.parentKey())){$self.q.add(f.parentKey(),null)}}}e=g.m(a,b,d);$self.add(f.key(),g);if($self.positionItemDepthMin()==-1){$self.positionItemDepthMin(f.depth())}else{$self.positionItemDepthMin(Math.min($self.positionItemDepthMin(),f.depth()))}if($self.positionItemDepthMax()==Number.MAX_VALUE){$self.positionItemDepthMax(f.depth())}else{$self.positionItemDepthMax(Math.max($self.positionItemDepthMax(),f.depth()))}$self.ab(a,g)}else{var i=$self.item(f.key());e=i.m(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.s(a,a.length)},s:function(a,b){var $self=this;if($self.positionItemIndex()==b-1){return $self.positionIndex()}var c;if(!function(){var $ret=$self.tryGetValue(a[$self.positionItemIndex()+1],c);c=$ret.value;return $ret.ret}()){return-1}if(c.count()==0){return c.positionIndex()}return c.s(a,b)},$type:new $.ig.Type("PositionItemInfo$2",$.ig.Dictionary$2.prototype.$type.specialize(0,1))},true);$.ig.util.defType("PositionResolver$2","Object",{$tKey:null,$tSortKey:null,k:0,b:null,t:null,u:null,init:function($tKey,$tSortKey,a,b){this.k=0;this.$tKey=$tKey;this.$tSortKey=$tSortKey;this.$type=this.$type.specialize(this.$tKey,this.$tSortKey);$.ig.Object.prototype.init.call(this);this.positions(a.toList$1($.ig.IPosition$2.prototype.$type.specialize(this.$tKey,this.$tSortKey)));this.positionSize(b)},getPositionIndexCompleted:null,_positions:null,positions:function(value){if(arguments.length===1){this._positions=value;return value}else{return this._positions}},_positionSize:0,positionSize:function(value){if(arguments.length===1){this._positionSize=value;return value}else{return this._positionSize}},rootPositionInfo:function(){if(this.b==null){this.b=this.d(this.positionSize())}return this.b},d:function(a){return new $.ig.PositionItemInfo$2(this.$tKey,this.$tSortKey,null,-1,-1,a)},hasUnregisterdPositions:function(){return this.k<this.positions().count()},completeRegisterPositions:function(){if(this.hasUnregisterdPositions()){this.o(null)}},resolveParentPositionItem:function(a,b){b=-1;var c=$.ig.util.cast($.ig.IHierarchicalPositionItem$2.prototype.$type.specialize(this.$tKey,this.$tSortKey),a);if(c==null||c.parentKey()==null){return{ret:null,parentPositionIndex: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,parentPositionIndex:b}}var g=this.positions().__inner[b];var h=g.item(d);return{ret:h,parentPositionIndex:b};return{parentPositionIndex:b}},getHostPositionItemInfo:function(a,b){var $self=this;var c=$self.rootPositionInfo();var d=a.item(b);for(var e=0;e<b;e++){var f;if(function(){var $ret=c.tryGetValue(a.item(e).key(),f);f=$ret.value;return $ret.ret}()){c=f}else{c=null;break}}if(c==null){return null}if(!c.containsKey(d.key())){return null}return c},h:function(a,b){var $self=this;if($self.rootPositionInfo().count()==0){return null}var c=$self.rootPositionInfo();var d=a.position().indexOf(a);for(var e=0;e<d;e++){var f;if(function(){var $ret=c.tryGetValue(a.position().item(e).key(),f);f=$ret.value;return $ret.ret}()){c=f}else{c=null;break}}if(c==null){return null}if(!c.containsKey(a.key())){return null}var g=new $.ig.List$1($.ig.Number.prototype.$type,0);$self.s(a.key(),c,g);if(b==$.ig.ListSortDirection.prototype.descending){g.sort1(function(h,i){if(h==i){return 0}if(h>i){return-1}return 1});return g}g.sort1(function(h,i){if(h==i){return 0}if(h>i){return 1}return-1});return g},s:function(a,b,c){var $self=this;var e=b.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize($self.$tKey,$self.$tSortKey),function(f){return a.equals(f.parentKey())}).getEnumerator();while(e.moveNext()){var d=e.current();if(d.count()==0){c.add(d.positionIndex())}else{$self.r(d,c)}if(!d.isExpanded()){continue}if(d.positionItemDepth()<b.positionItemDepthMax()){$self.s(d.key(),b,c)}}},r:function(a,b){var $self=this;var d=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize($self.$tKey,$self.$tSortKey),function(e){return e.parentKey()==null}).getEnumerator();while(d.moveNext()){var c=d.current();if(c.count()==0){b.add(c.positionIndex())}else{$self.r(c,b)}if(!c.isExpanded()){continue}if(c.positionItemDepth()<a.positionItemDepthMax()){$self.s(c.key(),a,b)}}},getChildren:function(a,b){var $self=this;if($self.hasUnregisterdPositions()){$self.completeRegisterPositions()}var c=$self.getHostPositionItemInfo(a,b);var d=a.item(b);return c.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize($self.$tKey,$self.$tSortKey),function(e){return d.key().equals(e.parentKey())})},isMemberExpanded:function(a){var $self=this;if($self.hasUnregisterdPositions()){$self.completeRegisterPositions()}var b=$self.getPositionIndex(a.position());if(b==-1||$self.rootPositionInfo().count()==0){return $.ig.util.toNullable(Boolean,null)}var c=a.position().indexOf(a);var d=$self.rootPositionInfo();for(var e=0;e<c;e++){var f;if(function(){var $ret=d.tryGetValue(a.position().item(e).key(),f);f=$ret.value;return $ret.ret}()){d=f}else{d=null;break}}if(d==null){return $.ig.util.toNullable(Boolean,null)}if(!d.containsKey(a.key())){return $.ig.util.toNullable(Boolean,null)}var g=null;var h=d.values().getEnumerator();while(h.moveNext()){if(a.key().equals(h.current().parentKey())){g=h.current();break}}return $.ig.util.toNullable(Boolean,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.k>0){var b=this.m(a);if(b>-1){return b}if(this.k==this.positions().count()){return-1}}return this.o(a)},m:function(a){if(a.isEmpty()&&this.positions().count()==1&&this.positions().__inner[0].isEmpty()){return 0}return this.rootPositionInfo().getIndex2(a.getItems().toList$1($.ig.IPositionItem$2.prototype.$type.specialize(this.$tKey,this.$tSortKey)))},o:function(a){var b=a==null;var c=-1;for(var d=this.k;d<this.positions().count();d++){var e=this.positions().__inner[d];var f=this.rootPositionInfo().m(e,d,a);this.k++;if(c==-1&&f){c=d;if(!b){break}}}return c},$type:new $.ig.Type("PositionResolver$2",$.ig.Object.prototype.$type)},true);$.ig.util.defType("LevelSortDirection","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.sortBehavior($.ig.LevelSortBehavior.prototype.system)},_levelUniqueName:null,levelUniqueName:function(value){if(arguments.length===1){this._levelUniqueName=value;return value}else{return this._levelUniqueName}},_sortDirection:null,sortDirection:function(value){if(arguments.length===1){this._sortDirection=value;return value}else{return this._sortDirection}},_sortBehavior:null,sortBehavior:function(value){if(arguments.length===1){this._sortBehavior=value;return value}else{return this._sortBehavior}},$type:new $.ig.Type("LevelSortDirection",$.ig.Object.prototype.$type)},true);$.ig.util.defType("TaskExtensions","Object",{init:function(){$.ig.Object.prototype.init.call(this)},continueWithTask$1:function($tResult,a){var $self=this;var b=new $.ig.TaskCompletionSource$1($tResult,0);$self.e(function(c){if(c.a()==null){try{a(c).i(function(d){if(d.a()==null){b.e(d.m());return}b.d(d.a())})}catch(e_){var d;d=e_;b.d(d)}}else{b.d(c.a())}});return b.b()},continueWithTask$2:function($tResult1,$tResult2,a){var $self=this;return $self.continueWithTask$1($tResult2,function(b){return a(b)})},$type:new $.ig.Type("TaskExtensions",$.ig.Object.prototype.$type)},true);$.ig.util.defType("HierarchyFilterView","Object",{d:null,c:null,e:null,init:function(a){this.e=new $.ig.Dictionary$2(String,$.ig.FilterMember.prototype.$type,0);$.ig.Object.prototype.init.call(this);this.hierarchy(a);this.c=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.FilterMember.prototype.$type),0);this.d=new $.ig.Dictionary$2(String,$.ig.FilterMember.prototype.$type,0)},filterMemberExpansionChanged:null,filterMemberSelectionChanged:null,_hierarchy:null,hierarchy:function(value){if(arguments.length===1){this._hierarchy=value;return value}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(!$self.d.containsKey(a.uniqueName())){var b=new $.ig.FilterMember(a);b.propertyChanged=$.ig.Delegate.prototype.combine(b.propertyChanged,$self.o.runOn($self));b.selectionChanged=$.ig.Delegate.prototype.combine(b.selectionChanged,$self.p.runOn($self));var c;if(!function(){var $ret=$self.c.tryGetValue(a.levelDepth(),c);c=$ret.value;return $ret.ret}()){c=new $.ig.List$1($.ig.FilterMember.prototype.$type,0);$self.c.add(a.levelDepth(),c)}$self.d.add(a.uniqueName(),b);$self.e.add(a.uniqueName(),b);c.add(b);$self.j(b);$self.m(b)}},tryGetFilterMember:function(a,b){var $self=this;return{ret:function(){var $ret=$self.d.tryGetValue(a,b);b=$ret.value;return $ret.ret}(),filterMember:b};return{filterMember:b}},getRootFilterMembers:function(){var a=-1;var c=this.c.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.c.item(a)},getSelectedFilterItems:function(){var a=this.getRootFilterMembers();var b=new $.ig.List$1($.ig.FilterMember.prototype.$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 $.ig.FilterMemberStateChangedEventArgs(a))}},o:function(a,b){if(b.propertyName()=="IsExpanded"){if(this.filterMemberExpansionChanged!=null){this.filterMemberExpansionChanged(this,new $.ig.FilterMemberStateChangedEventArgs(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 $ret=$self.d.tryGetValue(b,c);c=$ret.value;return $ret.ret}()){c.n(a);if(c.isSelected().hasValue()==true&&c.isSelected().value()==false){a.isSelected($.ig.util.toNullable($.ig.Boolean.prototype.$type,false))}}},j:function(a){var $self=this;var b=a.member().levelDepth();var c;if(function(){var $ret=$self.c.tryGetValue(b+1,c);c=$ret.value;return $ret.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.Object.prototype.$type)},true);$.ig.util.defType("FilterMember","Object",{l:$.ig.util.toNullable($.ig.Boolean.prototype.$type,null),c:false,e:false,d:false,init:function(a){this.e=false;this.d=false;$.ig.Object.prototype.init.call(this);var b=$.ig.util.toNullable($.ig.Boolean.prototype.$type,true);this.l=b;this.member(a);this.k(0);this.j(0)},selectionChanged:null,propertyChanged:null,_parent:null,parent:function(value){if(arguments.length===1){this._parent=value;return value}else{return this._parent}},_member:null,member:function(value){if(arguments.length===1){this._member=value;return value}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=$.ig.util.toNullable($.ig.Boolean.prototype.$type,null);if($.ig.util.nullableEquals(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($.ig.util.toNullable($.ig.Boolean.prototype.$type,true))}else if(g==i){this.parent().isSelected($.ig.util.toNullable($.ig.Boolean.prototype.$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,$.ig.EventArgs.prototype.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(value){if(arguments.length===1){this._children=value;return value}else{return this._children}},n:function(a){if(this.children()==null){this.children(new $.ig.List$1($.ig.FilterMember.prototype.$type,0))}a.parent(this);this.children().add(a);this.o("Children")},_k:0,k:function(value){if(arguments.length===1){this._k=value;return value}else{return this._k}},_j:0,j:function(value){if(arguments.length===1){this._j=value;return value}else{return this._j}},o:function(a){if(this.propertyChanged!=null){this.propertyChanged(this,new $.ig.PropertyChangedEventArgs(a))}},$type:new $.ig.Type("FilterMember",$.ig.Object.prototype.$type,[$.ig.INotifyPropertyChanged.prototype.$type])},true);$.ig.util.defType("FilterMemberStateChangedEventArgs","EventArgs",{init:function(a){$.ig.EventArgs.prototype.init.call(this);this.filterMember(a)},_filterMember:null,filterMember:function(value){if(arguments.length===1){this._filterMember=value;return value}else{return this._filterMember}},$type:new $.ig.Type("FilterMemberStateChangedEventArgs",$.ig.EventArgs.prototype.$type)},true);$.ig.util.defType("ResultSorter$1","Object",{$t:null,_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},_d:false,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},_c:false,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},init:function($t,a,b,c){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.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 $.ig.List$1($.ig.OlapResultTuple.prototype.$type,1,e)},$type:new $.ig.Type("ResultSorter$1",$.ig.Object.prototype.$type)},true);$.ig.util.defType("ResultHeaderSorter","ResultSorter$1",{f:null,_h:null,h:function(value){if(arguments.length===1){this._h=value;return value}else{return this._h}},_g:null,g:function(value){if(arguments.length===1){this._g=value;return value}else{return this._g}},init:function(a,b,c,d){$.ig.ResultSorter$1.prototype.init.call(this,$.ig.AxisHeaderSortingVisitor.prototype.$type,a,b,c);this.f=new $.ig.Dictionary$2(String,$.ig.LevelSortDirection.prototype.$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;$self.h(new $.ig.List$1($.ig.LevelSortDirection.prototype.$type,0));$self.g(new $.ig.Dictionary$2(String,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type)),0));if($self.a().isEmpty()){return $self.a()}var a=new $.ig.List$1($.ig.OlapResultAxis.prototype.$type,0);var b=0;var c=1;var d=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);var e=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);if($self.c()){var f=$self.a().axes().item(b);var g=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type),0);var h=new $.ig.AxisHeaderSortingVisitor(f,$self.f,$self.h(),g);var i=$self.e(h,f,d);var j=function(){var $ret=new $.ig.OlapResultAxis(i,f.tupleSize());$ret.name(f.name());return $ret}();a.add(j);$self.g().item(f.name(),g);c=f.tuples().count();b++}if($self.d()){var k=$self.a().axes().item(b);var l=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type),0);var m=new $.ig.AxisHeaderSortingVisitor(k,$self.f,$self.h(),l);var n=$self.e(m,k,e);var o=function(){var $ret=new $.ig.OlapResultAxis(n,k.tupleSize());
$ret.name(k.name());return $ret}();a.add(o);$self.g().item(k.name(),l)}var p=new $.ig.List$1($.ig.OlapResultCell.prototype.$type,2,$self.a().cells().count());var r=$self.a().cells().getEnumerator();while(r.moveNext()){var q=r.current();var s=q.clone();var t=s.cellOrdinal();if($self.c()){var u=t%c;var v=d.item(u);if(u!=v){var w=$.ig.intDivide(t,c);t=w*c+v}}if($self.d()){var x=$.ig.intDivide(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 $.ig.OlapResult;$ret.isEmpty($self.a().isEmpty());$ret.axes(a);$ret.cells(p);return $ret}();return aa},$type:new $.ig.Type("ResultHeaderSorter",$.ig.ResultSorter$1.prototype.$type.specialize($.ig.AxisHeaderSortingVisitor.prototype.$type))},true);$.ig.util.defType("AxisTupleVisitor","Object",{_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},_d:null,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},init:function(a){$.ig.Object.prototype.init.call(this);this.a(a)},e:function(){var $self=this;if($self.a().positionResolver().hasUnregisterdPositions()){$self.a().positionResolver().completeRegisterPositions()}$self.d(new $.ig.List$1($.ig.Number.prototype.$type,2,$self.a().tuples().count()));var a=$self.a().positionResolver().rootPositionInfo();var b=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(c){return c.positionItemDepth()==a.positionItemDepthMin()});var d=$self.c(a,b).getEnumerator();while(d.moveNext()){var c=d.current();$self.f(a,c)}},b:function(a,b){},c:function(a,b){},f:function(a,b){var $self=this;var c=b.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(d){return d.positionItemDepth()==b.positionItemDepthMin()});if(c.count$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type))>0){var e=c.getEnumerator();while(e.moveNext()){var d=e.current();$self.f(b,d)}}else{$self.d().add(b.positionIndex())}var f=$self.b(a,b);var h=f.getEnumerator();while(h.moveNext()){var g=h.current();$self.f(a,g)}},$type:new $.ig.Type("AxisTupleVisitor",$.ig.Object.prototype.$type)},true);$.ig.util.defType("AxisHeaderSortingVisitor","AxisTupleVisitor",{h:null,i:null,g:null,init:function(a,b,c,d){$.ig.AxisTupleVisitor.prototype.init.call(this,a);this.h=b;this.i=c;this.g=d},b:function(a,b){var $self=this;var c=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(d){return d.parentKey()==b.key()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type));if(c.count()>0){var d=c.item(0);var e;if(function(){var $ret=$self.h.tryGetValue(d.hierarchyLevelKey(),e);e=$ret.value;return $ret.ret}()){if(e.sortBehavior()==$.ig.LevelSortBehavior.prototype.system){c=e.sortDirection()==$.ig.ListSortDirection.prototype.ascending?c.orderBy$2($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),$.ig.Object.prototype.$type,function(f){return f.sortKey()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type)):c.orderByDescending$2($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),$.ig.Object.prototype.$type,function(f){return f.sortKey()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type))}else{c=e.sortDirection()==$.ig.ListSortDirection.prototype.ascending?c.orderBy$2($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),String,function(f){return f.caption()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type)):c.orderByDescending$2($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),String,function(f){return f.caption()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type))}if(!$self.i.select$2($.ig.LevelSortDirection.prototype.$type,String,function(f){return f.levelUniqueName()}).contains$1(String,e.levelUniqueName())){$self.i.add(e)}var f;if(!function(){var $ret=$self.g.tryGetValue(d.positionItemIndex(),f);f=$ret.value;return $ret.ret}()){f=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type,0);$self.g.add(b.positionItemIndex(),f)}f.item(b.positionItemDepth(),e.sortDirection())}}return c},c:function(a,b){var $self=this;var c=b.toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type));if(c.count()>0){var d=c.item(0);var e;if(d.hierarchyLevelKey()!=null&&function(){var $ret=$self.h.tryGetValue(d.hierarchyLevelKey(),e);e=$ret.value;return $ret.ret}()){if(e.sortBehavior()==$.ig.LevelSortBehavior.prototype.system){c=e.sortDirection()==$.ig.ListSortDirection.prototype.ascending?c.orderBy$2($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),$.ig.Object.prototype.$type,function(f){return f.sortKey()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type)):c.orderByDescending$2($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),$.ig.Object.prototype.$type,function(f){return f.sortKey()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type))}else{c=e.sortDirection()==$.ig.ListSortDirection.prototype.ascending?c.orderBy$2($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),String,function(f){return f.caption()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type)):c.orderByDescending$2($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),String,function(f){return f.caption()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type))}$self.i.add(e);var f;if(!function(){var $ret=$self.g.tryGetValue(d.positionItemIndex(),f);f=$ret.value;return $ret.ret}()){f=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type,0);$self.g.add(a.positionItemIndex(),f)}f.item(a.positionItemDepth(),e.sortDirection())}}return c},$type:new $.ig.Type("AxisHeaderSortingVisitor",$.ig.AxisTupleVisitor.prototype.$type)},true);$.ig.util.defType("ResultColumnValueSorter","ResultSorter$1",{f:null,_g:null,g:function(value){if(arguments.length===1){this._g=value;return value}else{return this._g}},init:function(a,b,c,d){$.ig.ResultSorter$1.prototype.init.call(this,$.ig.AxisValueSortingVisitor.prototype.$type,a,b,c);this.f=d},b:function(){var $self=this;$self.g(new $.ig.List$1($.ig.TupleSortDirection.prototype.$type,0));if(!$self.d()||$self.a().isEmpty()){return $self.a()}var a=new $.ig.List$1($.ig.OlapResultAxis.prototype.$type,0);var b=0;var c=null;var d=1;if($self.c()){c=$self.a().axes().item(b);d=c.tuples().count();a.add(c.clone());b++}var e=$self.a().axes().item(b);var f=$self.a().axes().item(b).tuples().count();var g=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Object.prototype.$type,1,$self.a().cells().count());var i=$self.a().cells().getEnumerator();while(i.moveNext()){var h=i.current();var j=null;if(function(){var $ret=h.properties().tryGetValue("Value",j);j=$ret.value;return $ret.ret}()){g.item(h.cellOrdinal(),j)}else{(function(){var $ret=h.properties().tryGetValue("FmtValue",j);j=$ret.value;return $ret.ret})();g.item(h.cellOrdinal(),j)}}var k=new $.ig.List$1($.ig.KeyValuePair$2.prototype.$type.specialize($.ig.TupleSortDirection.prototype.$type,$.ig.Array.prototype.$type),2,$self.f.count());var m=$self.f.getEnumerator();while(m.moveNext()){var l=m.current();var n;if(c!=null&&l.memberNames()!=null){if(c.positionResolver().hasUnregisterdPositions()){c.positionResolver().completeRegisterPositions()}n=c.positionResolver().rootPositionInfo().getIndex(l.memberNames());l.tupleIndex(n)}else{n=l.tupleIndex()}if(n>-1&&n<d){var o=new Array(f);for(var p=0;p<f;p++){var q=null;(function(){var $ret=g.tryGetValue(p*d+n,q);q=$ret.value;return $ret.ret})();o[p]=q}k.add(new $.ig.KeyValuePair$2($.ig.TupleSortDirection.prototype.$type,$.ig.Array.prototype.$type,1,l,o));$self.g().add(l)}}var r=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);var s=new $.ig.AxisValueSortingVisitor(e,k);var t=$self.e(s,e,r);var u=function(){var $ret=new $.ig.OlapResultAxis(t,e.tupleSize());$ret.name(e.name());return $ret}();a.add(u);var v=new $.ig.List$1($.ig.OlapResultCell.prototype.$type,2,$self.a().cells().count());var x=$self.a().cells().getEnumerator();while(x.moveNext()){var w=x.current();var y=w.clone();var z=y.cellOrdinal();var aa=$.ig.intDivide(z,d);var ab=r.item(aa);if(aa!=ab){var ac=z%d;z=ab*d+ac}y.cellOrdinal(z);v.add(y)}var ad=function(){var $ret=new $.ig.OlapResult;$ret.isEmpty($self.a().isEmpty());$ret.axes(a);$ret.cells(v);return $ret}();return ad},$type:new $.ig.Type("ResultColumnValueSorter",$.ig.ResultSorter$1.prototype.$type.specialize($.ig.AxisValueSortingVisitor.prototype.$type))},true);$.ig.util.defType("AxisValueSortingVisitor","AxisTupleVisitor",{g:null,init:function(a,b){$.ig.AxisTupleVisitor.prototype.init.call(this,a);this.g=b},b:function(a,b){var $self=this;var c=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(d){return d.parentKey()==b.key()});return $self.c(a,c)},c:function(a,b){var positionItemInfos_=b.toArray$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type));if(positionItemInfos_.length>0){var tupleSortDirections_=this.g.toArray$1($.ig.KeyValuePair$2.prototype.$type.specialize($.ig.TupleSortDirection.prototype.$type,$.ig.Array.prototype.$type));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",$.ig.AxisTupleVisitor.prototype.$type)},true);$.ig.util.defType("TupleSortDirection","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_tupleIndex:0,tupleIndex:function(value){if(arguments.length===1){this._tupleIndex=value;return value}else{return this._tupleIndex}},_memberNames:null,memberNames:function(value){if(arguments.length===1){this._memberNames=value;return value}else{return this._memberNames}},_sortDirection:null,sortDirection:function(value){if(arguments.length===1){this._sortDirection=value;return value}else{return this._sortDirection}},_comparer:null,comparer:function(value){if(arguments.length===1){this._comparer=value;return value}else{return this._comparer}},$type:new $.ig.Type("TupleSortDirection",$.ig.Object.prototype.$type)},true);$.ig.util.defType("DataSourceBase","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_dataSource:null,dataSource:function(value){if(arguments.length===1){this._dataSource=value;return value}else{return this._dataSource}},isInitialized:function(){return this.dataSource().isInitialized()},_isModified:false,isModified:function(value){if(arguments.length===1){this._isModified=value;return value}else{return this._isModified}},_isUpdating:false,isUpdating:function(value){if(arguments.length===1){this._isUpdating=value;return value}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){var $self=this;return $self.dataSource().setCube(a).j($.ig.OlapMetadataTreeItem.prototype.$type,function(b){return b.m()}).c()},metadataTree:function(){return this.dataSource().metadataTree()},addRowItem:function(a){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,a)!==null){this.dataSource().rowAxis().add(a);this.isModified(true)}},insertRowItem:function(a,b){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,b)!==null){this.dataSource().rowAxis().insert(a,b);this.isModified(true)}},removeRowItem:function(a){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,a)!==null||$.ig.util.cast($.ig.MeasureList.prototype.$type,a)!==null){this.dataSource().rowAxis().remove(a);this.isModified(true)}},addColumnItem:function(a){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,a)!==null){this.dataSource().columnAxis().add(a);this.isModified(true)}},insertColumnItem:function(a,b){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,b)!==null){this.dataSource().columnAxis().insert(a,b);this.isModified(true)}},removeColumnItem:function(a){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,a)!==null||$.ig.util.cast($.ig.MeasureList.prototype.$type,a)!==null){this.dataSource().columnAxis().remove(a);this.isModified(true)}},addFilterItem:function(a){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,a)!==null){this.dataSource().filters().add(a);this.isModified(true)}},insertFilterItem:function(a,b){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,b)!==null){this.dataSource().filters().insert(a,b);this.isModified(true)}},removeFilterItem:function(a){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,a)!==null){this.dataSource().filters().remove(a);this.isModified(true)}},addMeasureItem:function(a){if($.ig.util.cast($.ig.Measure.prototype.$type,a)!==null){this.dataSource().measures().add(a);this.isModified(true)}},insertMeasureItem:function(a,b){if($.ig.util.cast($.ig.Measure.prototype.$type,b)!==null){this.dataSource().measures().insert(a,b);this.isModified(true)}},removeMeasureItem:function(a){if($.ig.util.cast($.ig.Measure.prototype.$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($.ig.MeasureListLocation.prototype.rows);break;case"columns":this.dataSource().measureListLocation($.ig.MeasureListLocation.prototype.columns);break;default:break}this.isModified(true)},getMeasureListLocation:function(){switch(this.dataSource().measureListLocation()){case $.ig.MeasureListLocation.prototype.rows:return"rows";break;case $.ig.MeasureListLocation.prototype.columns: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 $ret=$self.dataSource().tryGetMember(a,b);b=$ret.member;return $ret.ret}()){return b}return null},tryGetMembersForLevel:function(a){var $self=this;var b=new $.ig.ArrayListCollection$1($.ig.Member.prototype.$type);var c=function(){var $ret=$self.dataSource().tryGetMembersForLevel(a,b);b=$ret.members;return $ret.ret}();return c?b.inner():new $.ig.ArrayListCollection$1($.ig.Member.prototype.$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){var $self=this;return $self.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$.ig.Dimension.prototype.$type)},getHierarchy:function(a){var $self=this;return $self.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$.ig.Hierarchy.prototype.$type)},getLevel:function(a){var $self=this;return $self.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$.ig.Level.prototype.$type)},getMeasure:function(a){var $self=this;return $self.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$.ig.Measure.prototype.$type)},getMeasureList:function(){return this.dataSource().getCoreElement(null,$.ig.MeasureList.prototype.$type)},$type:new $.ig.Type("DataSourceBase",$.ig.Object.prototype.$type)},true);$.ig.util.defType("jQueryUtils","Object",{init:function(){$.ig.Object.prototype.init.call(this)},c:function($t,a){if(a==null){return null}var jsObject_=a;var dict_=new $.ig.Dictionary$2(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 dict_=a;return dict_.__inner.proxy},convertToObjectDictionary:function(a){return $.ig.jQueryUtils.prototype.c($.ig.Object.prototype.$type,a)},convertToStringDictionary:function(a){return $.ig.jQueryUtils.prototype.c(String,a)},convertFromObjectDictionary:function(a){return $.ig.jQueryUtils.prototype.i($.ig.Object.prototype.$type,a)},convertFromStringDictionary:function(a){return $.ig.jQueryUtils.prototype.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){c=Array.prototype.slice.call(arguments,2);var jsObject_=a;var method_=b;var args_=c;return jsObject_[method_].call(jsObject_,args_)},$type:new $.ig.Type("jQueryUtils",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapUtilities","Object",{init:function(){$.ig.Object.prototype.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_=$.ig.OlapUtilities.prototype.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_=$.ig.OlapUtilities.prototype.dateMemberProvider("year",b,null,null);semesterProvider_=$.ig.OlapUtilities.prototype.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_=$.ig.OlapUtilities.prototype.dateMemberProvider("year",b,null,null);semesterProvider_=$.ig.OlapUtilities.prototype.dateMemberProvider("semester",b,null,null);quarterProvider_=$.ig.OlapUtilities.prototype.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_=$.ig.OlapUtilities.prototype.dateMemberProvider("year",b,null,null);semesterProvider_=$.ig.OlapUtilities.prototype.dateMemberProvider("semester",b,null,null);quarterProvider_=$.ig.OlapUtilities.prototype.dateMemberProvider("quarter",b,null,null);monthProvider_=$.ig.OlapUtilities.prototype.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){var $self=this;if(String.isNullOrEmpty(a)){return null}if(b==null||b.length==0){b=function(){var $ret=new Array;$ret.add("year");$ret.add("quarter");$ret.add("month");$ret.add("date");return $ret}()}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]=$.ig.OlapUtilities.prototype.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.Object.prototype.$type)},true);$.ig.util.defType("OlapTableView","Object",{a:null,init:function(a,b,c,d){$.ig.Object.prototype.init.call(this);var e=this.b(d);this.a=new $.ig.TableViewImpl(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_=$.ig.jQueryUtils.prototype.createJavascriptObject();var a=this.a.appliedSortDirectionsMap().getEnumerator();while(a.moveNext()){var i_=a.current();var axisMap_=$.ig.jQueryUtils.prototype.createJavascriptObject();var b=i_.value().getEnumerator();while(b.moveNext()){var j_=b.current();var hierarchyMap_=$.ig.jQueryUtils.prototype.createJavascriptObject();var c=j_.value().getEnumerator();while(c.moveNext()){var k_=c.current();var sortDirection_=k_.value()==$.ig.ListSortDirection.prototype.ascending?"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 $self=this;var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"isParentInFrontForColumns");var c=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"isParentInFrontForRows");var d=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"compactColumnHeaders");var e=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"compactRowHeaders");return function(){var $ret=new $.ig.TableViewSettings;$ret.c(b);$ret.d(c);$ret.a(d);$ret.b(e);return $ret}()},d:function(o_){var $self=this;var a=$.ig.util.cast($.ig.Array.prototype.$type,$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(o_,"memberNames"));var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(o_,"tupleIndex");var c=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(o_,"sortDirection");var d=$.ig.ListSortDirection.prototype.ascending;if(!String.isNullOrEmpty(c)){c=c.toLowerCase();if(c=="descending"){d=$.ig.ListSortDirection.prototype.descending}}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 $.ig.TupleSortDirection;$ret.memberNames(a);$ret.tupleIndex(b);$ret.sortDirection(d);$ret.comparer(comparer_);return $ret}()},n:function(a){var b=$.ig.jQueryUtils.prototype.createJavascriptObject();$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(b,"memberNames",a.memberNames());$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(b,"tupleIndex",a.tupleIndex());$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(b,"sortDirection",a.sortDirection()==$.ig.ListSortDirection.prototype.ascending?"ascending":"descending");if(a.comparer()!=null){$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(b,"comparer",a.comparer())}return b},c:function(a){var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"levelUniqueName");var c=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"sortDirection");var d=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"sortBehavior");if(!String.isNullOrEmpty(b)){var e=new $.ig.LevelSortDirection;e.sortDirection($.ig.ListSortDirection.prototype.ascending);e.sortBehavior($.ig.LevelSortBehavior.prototype.system);e.levelUniqueName(b);if(!String.isNullOrEmpty(c)){c=c.toLowerCase();if(c=="descending"){e.sortDirection($.ig.ListSortDirection.prototype.descending)}}if(!String.isNullOrEmpty(d)){d=d.toLowerCase();if(d=="alphabetical"){e.sortBehavior($.ig.LevelSortBehavior.prototype.alphabetical)}}return e}else{return null}},m:function(a){var b=$.ig.jQueryUtils.prototype.createJavascriptObject();$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(b,"levelUniqueName",a.levelUniqueName());$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(b,"sortDirection",a.sortDirection()==$.ig.ListSortDirection.prototype.ascending?"ascending":"descending");return b},$type:new $.ig.Type("OlapTableView",$.ig.Object.prototype.$type)},true);$.ig.LevelSortBehavior.prototype.alphabetical=0;$.ig.LevelSortBehavior.prototype.system=1;$.ig.OlapMetadataTreeItemType.prototype.cube=0;$.ig.OlapMetadataTreeItemType.prototype.dimension=1;
$.ig.OlapMetadataTreeItemType.prototype.group=2;$.ig.OlapMetadataTreeItemType.prototype.userDefinedHierarchy=3;$.ig.OlapMetadataTreeItemType.prototype.systemEnabledHierarchy=4;$.ig.OlapMetadataTreeItemType.prototype.parentChildHierarchy=5;$.ig.OlapMetadataTreeItemType.prototype.measure=6;$.ig.OlapMetadataTreeItemType.prototype.level1=7;$.ig.OlapMetadataTreeItemType.prototype.level2=8;$.ig.OlapMetadataTreeItemType.prototype.level3=9;$.ig.OlapMetadataTreeItemType.prototype.level4=10;$.ig.OlapMetadataTreeItemType.prototype.level5=11;$.ig.OlapMetadataTreeItemType.prototype.kpiRoot=12;$.ig.OlapMetadataTreeItemType.prototype.kpi=13;$.ig.OlapMetadataTreeItemType.prototype.kpiValue=14;$.ig.OlapMetadataTreeItemType.prototype.kpiGoal=15;$.ig.OlapMetadataTreeItemType.prototype.kpiStatus=16;$.ig.OlapMetadataTreeItemType.prototype.kpiTrend=17;$.ig.OlapMetadataTreeItemType.prototype.kpiWeight=18;$.ig.MeasureListLocation.prototype.rows=0;$.ig.MeasureListLocation.prototype.columns=1;$.ig.HeaderCellsLayoutOrientation.prototype.horizontal=0;$.ig.HeaderCellsLayoutOrientation.prototype.vertical=1;$.ig.MemberType.prototype.unknown=0;$.ig.MemberType.prototype.regular=1;$.ig.MemberType.prototype.all=2;$.ig.MemberType.prototype.measure=3;$.ig.MemberType.prototype.formula=4;$.ig.CardinalityType.prototype.one=0;$.ig.CardinalityType.prototype.many=1;$.ig.AggregatorType.prototype.unknown=0;$.ig.AggregatorType.prototype.sum=1;$.ig.AggregatorType.prototype.count=2;$.ig.AggregatorType.prototype.min=3;$.ig.AggregatorType.prototype.max=4;$.ig.AggregatorType.prototype.average=5;$.ig.AggregatorType.prototype.variance=6;$.ig.AggregatorType.prototype.std=7;$.ig.AggregatorType.prototype.distinctCount=8;$.ig.AggregatorType.prototype.none=9;$.ig.AggregatorType.prototype.averageOfChildren=10;$.ig.AggregatorType.prototype.firstNonEmpty=13;$.ig.AggregatorType.prototype.lastNonEmpty=14;$.ig.AggregatorType.prototype.byAccount=15;$.ig.AggregatorType.prototype.calculated=127;$.ig.HierarchyOrigin.prototype.userDefined=1;$.ig.HierarchyOrigin.prototype.systemEnabled=2;$.ig.HierarchyOrigin.prototype.systemInternal=4;$.ig.DimensionType.prototype.unknown=0;$.ig.DimensionType.prototype.time=1;$.ig.DimensionType.prototype.measure=2;$.ig.DimensionType.prototype.other=3;$.ig.DimensionType.prototype.quantitative=5;$.ig.DimensionType.prototype.accounts=6;$.ig.DimensionType.prototype.customers=7;$.ig.DimensionType.prototype.products=8;$.ig.DimensionType.prototype.scenario=9;$.ig.DimensionType.prototype.utility=10;$.ig.DimensionType.prototype.currency=11;$.ig.DimensionType.prototype.rates=12;$.ig.DimensionType.prototype.channel=13;$.ig.DimensionType.prototype.promotion=14;$.ig.DimensionType.prototype.organization=15;$.ig.DimensionType.prototype.billOfMaterials=16;$.ig.DimensionType.prototype.geography=17;$.ig.CubeType.prototype.cube=0;$.ig.CubeType.prototype.dimension=1;$.ig.CubeType.prototype.unknown=2;$.ig.AxisDefinitionParser.prototype.e="[";$.ig.AxisDefinitionParser.prototype.f="]";$.ig.AxisDefinitionParser.prototype.i="{";$.ig.AxisDefinitionParser.prototype.j="}";$.ig.AxisDefinitionParser.prototype.h=",";$.ig.CoreOlapElementParser.prototype.d="[";$.ig.CoreOlapElementParser.prototype.e="]";$.ig.CoreOlapElementParser.prototype.g=".";$.ig.CoreOlapElementParser.prototype.i="&";$.ig.util.extCopy($.ig.TaskExtensions,[[[$.ig.Task,$.ig.Task$1],["continueWithTask$1","continueWithTask$2"]]]);$.ig.util.extCopy($.ig.Queryable,[[[$.ig.SortedList$1,$.ig.IGrouping$2,$.ig.ArrayListCollection$1],["asQueryable"]]]);$.ig.util.extCopy($.ig.Enumerable,[[[$.ig.SortedList$1,$.ig.IGrouping$2,$.ig.ArrayListCollection$1],["where$1","where$11","select$2","selectMany$2","last$1","first$1","firstOrDefault$1","orderBy$2","orderByDescending$2","toList$1","concat$1","max","max$1","min","min$1","count$1","reverse$1","take$1","skip$1","any$1","contains$1","union$1","toArray$1","elementAt$1","sum","sum$1"]],[[$.ig.SortedList$1,$.ig.IGrouping$2,$.ig.ArrayListCollection$1],["ofType$1","cast$1"]]])})(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","String:j","IComparable:k","Number:l","Number:m","Single:n","Number:o","String:p","Array:q","RegExp:r","RuntimeTypeHandle:s","MethodInfo:t","MethodBase:u","MemberInfo:v","ParameterInfo:w","TypeCode:x","Enum:y","ConstructorInfo:z","JQueryPromise:aa","Action:ab","MulticastDelegate:ac","IntPtr:ad","Action$1:ae","AggregateException:af","Error:ag","TaskStatus:ah","Func$2:ai","TaskCompletionSource$1:aj","JQueryDeferred:ak","JQuery:al","JQueryObject:am","Element:an","ElementAttributeCollection:ao","ElementCollection:ap","WebStyle:aq","ElementNodeType:ar","Document:as","EventListener:at","IElementEventHandler:au","ElementEventHandler:av","ElementAttribute:aw","JQueryPosition:ax","JQueryCallback:ay","JQueryEvent:az","JQueryUICallback:a0","Script:a1","IEnumerable$1:a2","IEnumerable:a3","IEnumerator:a4","IEnumerator$1:a5","IOlapExecuteCommandProvider:a6","MdxDataSourceImpl:a7","OlapDataSource:a8","IOlapDataSource:a9","OlapMetadataTreeItem:ba","ICoreOlapElement:bb","OlapMetadataTreeItemType:bc","IList$1:bd","ICollection$1:be","MeasureListLocation:bf","OlapResult:bg","ArrayListCollection$1:bh","INotifyCollectionChanged:bi","NotifyCollectionChangedEventHandler:bj","NotifyCollectionChangedEventArgs:bk","EventArgs:bl","NotifyCollectionChangedAction:bm","IList:bn","ICollection:bo","List$1:bp","IArrayList:bq","Array:br","CompareCallback:bs","IDisposable:bt","IArray:bu","Date:bv","Date:bw","Number:bx","Func$3:by","Delegate:bz","NotImplementedException:b0","Cube:b1","CubeType:b2","Member:b3","MemberType:b4","Nullable$1:b5","MeasureGroup:b6","DataSourceBaseOptions:b7","IOlapDataProviderFactory:b8","OlapResultView:b9","ArgumentNullException:ca","OlapResultAxis:cb","PositionResolver$2:cc","PositionItemInfo$2:cd","Dictionary$2:ce","IDictionary$2:cf","IDictionary:cg","Dictionary:ch","IEqualityComparer$1:ci","KeyValuePair$2:cj","IHierarchicalPositionItem$2:ck","IPositionItem$2:cl","IPosition$2:cm","Math:cn","Number:co","Number:cp","Number:cq","Number:cr","Number:cs","Number:ct","Number:cu","Enumerable:cv","IOrderedEnumerable$1:cw","SortedList$1:cx","EventHandler$1:cy","ListSortDirection:cz","OlapResultTuple:c0","ReadOnlyCollection$1:c1","OlapResultAxisMember:c2","OlapResultCell:c3","InvalidOperationException:c4","CubeMetaItemsCache:c5","MeasureGroupMetaItemsCache:c6","MeasureGroupDimension:c7","CardinalityType:c8","Dimension:c9","DimensionType:da","Measure:db","AggregatorType:dc","Kpi:dd","Tuple$2:de","KpiMeasure:df","MeasureList:dg","Hierarchy:dh","HierarchyOrigin:di","Level:dj","NotSupportedException:dk","PositionInfo:dl","TaskExtensions:dm","AxisElement:dn","AxisDefinitionParser:dp","Debug:dq","TaskFactory:dr","MetaTreeHelper:ds","HierarchyItemPosition:dt","KpiDimension:du","MdxDataSourceOptions:dv","MdxSettings:dw","MdxDimensionAxisSettings:dx","MdxAxisSettings:dy","MdxSetSettings:dz","MdxSlicerAxisSettings:d0","ObservableCollection$1:d1","INotifyPropertyChanged:d2","PropertyChangedEventHandler:d3","PropertyChangedEventArgs:d4","Catalog:d5","MdxSlicerAxisProvider:d6","IMdxAxisProvider:d7","IMdxAxis:d8","IMdxExpression:d9","IMdxSet:ea","IMdxElement:eb","MdxElementType:ec","MdxSlicerAxis:ed","MdxAxis:ee","StringBuilder:ef","Environment:eg","IMdxSlicerAxis:eh","IMdxExtendedFilterInfo:ei","IMdxFilterInfo:ej","IAxisFilterElement:ek","IMdxCollectionElement:el","MdxSlicerAxisBuilder:em","MdxAxisFilterElement:en","MdxElementCollectionElement:eo","MdxSingleElement:ep","MdxElement:eq","IMdxItemElement:er","ArgumentException:es","MdxSlicerSet:et","MdxSet:eu","MdxLevelMembersElement:ev","MdxChildrenCollectionElement:ew","MdxDimensionMember:ex","KeyValueItem:ey","MdxDimensionAxisProvider:ez","IMdxDimensionAxisProvider:e0","ResultViewHelper:e1","MdxQueryBuilder:e2","MdxCalculatedMembersCache:e3","XmlaDataProvider:e4","ICoreXmlaConnection:e5","IConnection:e6","XmlaSoapWebClient$1:e7","XmlaSoapWebClient:e8","ICredentials:e9","NetworkCredential:fa","Uri:fb","Encoding:fc","UTF8Encoding:fd","UnicodeEncoding:fe","WebClient:ff","WebHeaderCollection:fg","NameValueCollection:fh","UploadStringCompletedEventHandler:fi","UploadStringCompletedEventArgs:fj","AsyncCompletedEventArgs:fk","IXmlaSoapMethod:fl","XmlaPropertiesCollection:fm","XmlaQueryProperty:fn","XNamespace:fo","XmlaSoapMessageBuilder:fp","XElement:fq","XContainer:fr","XNode:fs","XObject:ft","XmlNode:fu","XmlNodeList:fv","XmlNamedNodeMap:fw","XmlNodeType:fx","XmlDocument:fy","XmlElement:fz","XmlLinkedNode:f0","XmlAttribute:f1","XmlUtils:f2","XName:f3","XDocument:f4","XAttribute:f5","RequestCompletedEventArgs$1:f6","XmlaSoapFaultXmlTypeSerializer:f7","IXmlTypeSerializer$1:f8","XmlaSoapFault:f9","FaultDetail:ga","FaultError:gb","SerializerUtils:gc","ErrorXmlTypeSerializer:gd","FaultReason:ge","FaultCode:gf","FaultException$1:gg","FaultException:gh","DiscoverResponseResult:gi","XmlaSoapMethodResult:gj","IXmlaMethodResult:gk","ExecuteResponseResult:gl","DatabaseXmlTypeSerializer:gm","CubeXmlTypeSerializer:gn","DimensionXmlTypeSerializer:go","HierarchyXmlTypeSerializer:gp","LevelXmlTypeSerializer:gq","MeasureXmlTypeSerializer:gr","MeasureGroupXmlTypeSerializer:gs","MeasureGroupDimensionXmlTypeSerializer:gt","MemberXmlTypeSerializer:gu","KpiXmlTypeSerializer:gv","ResultXmlTypeSerializer:gw","ArraySerializer:gx","AxisXmlTypeSerializer:gy","TupleXmlTypeSerializer:gz","AxisMemberXmlTypeSerializer:g0","CellXmlTypeSerializer:g1","XmlaSoapMethodExecute:g2","XmlaSoapMethod:g3","XmlaSoapMethodDiscover:g4","XmlaSoapMessageHeader:g5","CatalogConstants:g6","DbSchemaConstants:ha","CubeConstants:hf","DimensionConstants:hg","HierarchyConstants:hh","InstanceConstants:hi","KpiConstants:hj","LevelConstants:hk","MeasureConstants:hl","MeasureGroupConstants:hm","MeasureGroupDimensionConstants:hn","MemberConstants:ho","OlapSchemaConstants:hp","CubeRestrictions:hq","DimensionRestrictions:hr","HierarchyRestrictions:hs","KpiRestrictions:ht","LevelRestrictions:hu","MeasureRestrictions:hv","MeasureGroupRestrictions:hw","MeasureGroupDimensionRestrictions:hx","MemberRestrictions:hy","XmlaConstants:hz","XmlaNamespace:h0","IXmlaDataProviderFactory:h6","DefaultXmlaDataProviderFactory:h7","XmlaConnection:h8","RemoteXmlaDataProviderFactory:h9","JsonRemoteRequestSerializer:ia","IRemoteRequestSerializer:ib","RemoteRequest:ic","RemoteRequestType:id","JavaScriptSerializer:ie","RemoteRequestJsonTypeSeriazlier:ig","JsonTypeSeriazlierBase$1:ih","IJsonTypeSerializer$1:ii","JsonSerializerUtils:ij","jQueryUtils:ik","JsonRemoteResponseSerializer:il","IRemoteResponseSerializer:im","ArrayJsonSerializer:io","CatalogJsonTypeSeriazlier:ip","CubeJsonTypeSeriazlier:iq","DimensionJsonTypeSeriazlier:ir","HierarchyJsonTypeSeriazlier:is","LevelJsonTypeSeriazlier:it","MeasureJsonTypeSeriazlier:iu","MeasureGroupJsonTypeSeriazlier:iv","MeasureGroupDimensionJsonTypeSeriazlier:iw","MemberJsonTypeSeriazlier:ix","KpiJsonTypeSeriazlier:iy","ResultJsonTypeSeriazlier:iz","AxisJsonTypeSeriazlier:i0","TupleJsonTypeSeriazlier:i1","AxisMemberJsonTypeSeriazlier:i2","CellJsonTypeSeriazlier:i3","RemoteXmlaDataProvder:i4","XmlaDataSourceImpl:i5","XmlaDataSourceOptions:i6","RequestOptions:i7","XmlaDiscoverProperties:i8","CustomRemoteXmlaRequestSerializer:ja","CustomRemoteXmlaResponseSerializer:jb","OlapXmlaDataSource:jc","DataSourceBase:jd","AbstractEnumerable:je","Func$1:jf","AbstractEnumerator:jg","GenericEnumerable$1:jh","GenericEnumerator$1:ji"]);$.ig.util.defType("RemoteRequestType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("RemoteRequestType",$.ig.Enum.prototype.$type)},true);$.ig.util.defType("MdxElementType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("MdxElementType",$.ig.Enum.prototype.$type)},true);$.ig.util.defType("XmlaSoapMessageHeader","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("XmlaSoapMessageHeader",$.ig.Enum.prototype.$type)},true);$.ig.util.defType("IXmlaDataProvider","Object",{$type:new $.ig.Type("IXmlaDataProvider",null,[$.ig.IOlapDiscoverDataProvider.prototype.$type,$.ig.IOlapExecuteCommandProvider.prototype.$type])},true);$.ig.util.defType("MdxDataSourceImpl","OlapDataSource",{bb:null,a9:false,init:function(a){this.bb=new $.ig.List$1($.ig.MdxDimensionAxisProvider.prototype.$type,0);$.ig.OlapDataSource.prototype.init.call(this,a);this.mdxSettings(a.mdxSettings());this.mdxSourceOptions(a);this.dataProviderFactory(a.dataProviderFactory());this.a9=true;if(this.mdxSourceOptions()!=null){this.a9=this.mdxSourceOptions().enableResultCache()==true}},_mdxSourceOptions:null,mdxSourceOptions:function(value){if(arguments.length===1){this._mdxSourceOptions=value;return value}else{return this._mdxSourceOptions}},_mdxSettings:null,mdxSettings:function(value){if(arguments.length===1){this._mdxSettings=value;return value}else{return this._mdxSettings}},_catalog:null,catalog:function(value){if(arguments.length===1){this._catalog=value;return value}else{return this._catalog}},setCatalog:function(a){if(!this.isInitialized()){throw new $.ig.InvalidOperationException(1,"Data source is not initialized.")}return this.be(a)},bm:function(a,b){if(a.positionItemIndex()==b){a.clear()}else{var d=a.values().getEnumerator();while(d.moveNext()){var c=d.current();this.bm(c,b)}}},a8:function(a,b,c,d){var $self=this;var e=new $.ig.List$1($.ig.AxisElement.prototype.$type,0);var g=c.getEnumerator();while(g.moveNext()){var f=g.current();var h=new $.ig.AxisElement(f.b(),new $.ig.List$1(String,0));for(var i=0;i<f.a().count();i++){var j=f.a().item(i);var k;if(function(){var $ret=$self.c().f(j,k);k=$ret.member;return $ret.ret}()){if(k.scope().hasValue()==false){h.a().add(j)}}}e.add(h)}var l=new $.ig.List$1($.ig.AxisElement.prototype.$type,0);var n=b.getEnumerator();while(n.moveNext()){var m=n.current();var o=new $.ig.AxisElement(m.b(),new $.ig.List$1(String,0));for(var p=0;p<m.a().count();p++){var q=m.a().item(p);var r;if(function(){var $ret=$self.c().f(q,r);r=$ret.member;return $ret.ret}()){if(r.scope().hasValue()==false){o.a().add(q)}}}l.add(o)}var s=new $.ig.List$1($.ig.AxisElement.prototype.$type,0);var u=a.getEnumerator();while(u.moveNext()){var t=u.current();var v=new $.ig.AxisElement(t.b(),new $.ig.List$1(String,0));for(var w=0;w<t.a().count();w++){var x=t.a().item(w);var y;if(function(){var $ret=$self.c().f(x,y);y=$ret.member;return $ret.ret}()){if(y.scope().hasValue()==false){v.a().add(x)}}}s.add(v)}return new $.ig.MdxSlicerAxisProvider($self,s,l,e,d)},getMembersOfLevel:function(a){var $self=this;var b=$self.getProviderDefaultProperties();var c=$self.getProviderDefaultRestrictions();if(c!=null){c.add(function(){var $ret=new $.ig.KeyValueItem;$ret.a($.ig.MemberRestrictions.prototype.g);$ret.b(a);return $ret}())}var d=$self.dataProviderFactory().createDataProvider();var e=d.discoverMembersAsync(b,c);e.i(function(f){var h=f.m().getEnumerator();while(h.moveNext()){var g=h.current();$self.c().u(g)}});return e},getMembersOfHierarchy:function(a){var $self=this;var b=$self.getProviderDefaultProperties();var c=$self.getProviderDefaultRestrictions();if(c!=null){c.add(function(){var $ret=new $.ig.KeyValueItem;$ret.a($.ig.MemberRestrictions.prototype.e);$ret.b(a);return $ret}())}var d=$self.dataProviderFactory().createDataProvider();var e=d.discoverMembersAsync(b,c);e.i(function(f){var h=f.m().getEnumerator();while(h.moveNext()){var g=h.current();$self.c().u(g)}});return e},getMembersOfMember:function(a){var $self=this;var b=$self.getProviderDefaultProperties();var c=$self.getProviderDefaultRestrictions();if(c!=null){c.add(function(){var $ret=new $.ig.KeyValueItem;$ret.a($.ig.MemberRestrictions.prototype.j);$ret.b(a);return $ret}());c.add(function(){var $ret=new $.ig.KeyValueItem;$ret.a($.ig.MemberRestrictions.prototype.l);$ret.b("1");return $ret}())}var d=$self.dataProviderFactory().createDataProvider();var e=d.discoverMembersAsync(b,c);e.continueWithTask$2($.ig.IEnumerable$1.prototype.$type.specialize($.ig.Member.prototype.$type),$.ig.IEnumerable$1.prototype.$type.specialize($.ig.Member.prototype.$type),function(f){return $self.bd(f.m())});return e},bd:function(a){var $self=this;var b=new $.ig.List$1($.ig.Member.prototype.$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(!$self.c().b(e)){return $self.getMembersOfLevel(e).j($.ig.IEnumerable$1.prototype.$type.specialize($.ig.Member.prototype.$type),function(f){return a})}}var f=new $.ig.TaskCompletionSource$1($.ig.IEnumerable$1.prototype.$type.specialize($.ig.Member.prototype.$type),0);f.e(a);return f.b()},bp: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 $ret=$self.c().g(h.uniqueName(),i);i=$ret.memberOrdinal;return $ret.ret}()){h.ordinal(i)}}}}},br:function(a,b){var c=0;var d=this.measureListIndex();if(a){var e=this.a6(c);if(e!=null&&this.measureListLocation()==$.ig.MeasureListLocation.prototype.columns){if(d>-1){var f=e.d();if(f!=null){this.bm(f,d-1)}}}c++}if(b){var g=this.a6(c);if(g!=null&&this.measureListLocation()==$.ig.MeasureListLocation.prototype.rows){if(d>-1){var h=g.d();if(h!=null){this.bm(h,d-1)}}}}},bq: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.a6(d):null;if(f!=null){f.d(e.positionResolver().rootPositionInfo())}d++}if(b){var g=d<a.axes().count()?a.axes().item(d):null;var h=g!=null?this.a6(d):null;if(h!=null){h.d(g.positionResolver().rootPositionInfo())}d++}},ba:function(a,b,c,d){var $self=this;d=new $.ig.Dictionary$2(String,$.ig.IList$1.prototype.$type.specialize($.ig.PositionInfo.prototype.$type),0);var e=$self.ae();for(var f=0;f<e.count();f++){var g=e.item(f);var h;if(!function(){var $ret=d.tryGetValue(g.c(),h);h=$ret.value;return $ret.ret}()){h=new $.ig.List$1($.ig.PositionInfo.prototype.$type,0);d.add(g.c(),h)}if(c){if($self.l()==null){$self.l(new $.ig.OlapResultView($self.result(),$self.result(),a,b))}var i=$self.l().expandTupleMember(g.c(),g.b(),g.a());if(i==null){h.add(g)}else{var j=$self.l();$self.l(i);$.ig.ResultViewHelper.prototype.f(g.c(),j,$self.l());$.ig.ResultViewHelper.prototype.e(g.c(),g.b(),g.a(),true,$self.l());$self.result($self.l().visibleResult());$self.bp($self.result());$self.bq($self.l().visibleResult(),b,a)}}else{h.add(g)}}$self.bh(a,b,c);var k=new $.ig.List$1($.ig.IMdxAxis.prototype.$type,0);var m=d.getEnumerator();while(m.moveNext()){var l=m.current();var n=$self.a2(l.key());if(n==null){continue}if(n.positionResolver().hasUnregisterdPositions()){n.positionResolver().completeRegisterPositions()}var o=$self.result().axes().indexOf(n);var p=$self.a6(o);var q=p.createAxis(o);var r=new $.ig.List$1($.ig.IPositionItem$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),0);var t=l.value().getEnumerator();while(t.moveNext()){var s=t.current();if(s.b()<n.tuples().count()){var u=n.tuples().__inner[s.b()];var v=u.item(s.a());r.add(v)}}if(r.count()>0){p=new $.ig.MdxDimensionAxisProvider(1,n,p.g(),r);var w=p.extendAxis(q,q.axisIndex());k.add(w)}}$self.ae().clear();return{ret:k,axisPositionsMap:d};return{axisPositionsMap:d}},a4:function(a,b,c){var d=null;if(a.count()>0){d=this.a6(c);if(b){var e=null;if(d!=null){e=d.d()}var f=c==0?this.mdxSettings().a():this.mdxSettings().b();d=new $.ig.MdxDimensionAxisProvider(0,this,f,a,e);this.bo(c,d)}}if(d!=null){return d.createAxis(c)}return null},bh:function(a,b,c){var $self=this;if($self.result()!=null){var d=new $.ig.Dictionary$2(String,$.ig.IList$1.prototype.$type.specialize($.ig.PositionInfo.prototype.$type),0);var e=$self.ad();for(var f=0;f<e.count();f++){var g=e.item(f);var h;if(!function(){var $ret=d.tryGetValue(g.c(),h);h=$ret.value;return $ret.ret}()){h=new $.ig.List$1($.ig.PositionInfo.prototype.$type,0);d.add(g.c(),h)}h.add(g);if(c){if($self.l()==null){$self.l(new $.ig.OlapResultView($self.result(),$self.result(),a,b))}else{$self.l($self.l().collapseTupleMember(g.c(),g.b(),g.a()));$self.result($self.l().visibleResult());$self.bp($self.result());$self.bq($self.l().visibleResult(),b,a)}}}var i=new $.ig.List$1($.ig.OlapResultAxis.prototype.$type,0);var k=d.getEnumerator();while(k.moveNext()){var j=k.current();var l=$self.a2(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=q.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(s){return s.key()==p.key()}).firstOrDefault$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type));if(r!=null){r.isExpanded(false)}}}}}if(!c&&!$self.result().isEmpty()){$self.bq($self.result(),b,a)}$self.ad().clear()}},bg:function(){this.catalog(null);this.cubes(new $.ig.ArrayListCollection$1($.ig.Cube.prototype.$type));this.au()},bc:function(){var $self=this;var a=$self.dataProviderFactory().createDataProvider();var b=$self.getProviderDefaultProperties();var c=a.discoverCatalogsAsync(b,null).continueWithTask$2($.ig.IEnumerable$1.prototype.$type.specialize($.ig.Catalog.prototype.$type),$.ig.IEnumerable$1.prototype.$type.specialize($.ig.Catalog.prototype.$type),function(d){$self.catalogs($self.a1($.ig.Catalog.prototype.$type,d.m()));return d});return c},be:function(a){var $self=this;if(String.isNullOrEmpty(a)){if(a==null){throw new $.ig.ArgumentNullException("catalogName")}throw new $.ig.InvalidOperationException(1,"catalogName cannot be empty.")}var b=new $.ig.TaskCompletionSource$1($.ig.IList$1.prototype.$type.specialize($.ig.Cube.prototype.$type),0);if($self.catalog()!=null){if($self.catalog().name()==a){b.e($self.cubes());return b.b()}$self.bg()}var d=$self.catalogs().getEnumerator();while(d.moveNext()){var c=d.current();if(c.name()==a){$self.catalog(c);break}}if($self.cubes()==null||$self.cubes().count()==0){$self.aq(a).i(function(e){if(e.a()==null){b.e(e.m());return}b.d(e.a())})}else{b.e($self.cubes())}return b.b()},am:function(){var $self=this;var a=new $.ig.TaskCompletionSource$1($.ig.OlapMetadataTreeItem.prototype.$type,0);if($self.isInitialized()){a.e($self.metadataTree());return a.b()}var b=$self.mdxSourceOptions().catalog();var c=$self.mdxSourceOptions().cube();$self.columnAxis().collectionChanged=$.ig.Delegate.prototype.combine($self.columnAxis().collectionChanged,$self.bi.runOn($self));$self.rowAxis().collectionChanged=$.ig.Delegate.prototype.combine($self.rowAxis().collectionChanged,$self.bn.runOn($self));$self.filters().collectionChanged=$.ig.Delegate.prototype.combine($self.filters().collectionChanged,$self.bk.runOn($self));$self.measures().collectionChanged=$.ig.Delegate.prototype.combine($self.measures().collectionChanged,$self.bl.runOn($self));var d=$self.bc();if(String.isNullOrEmpty(b)){d.i(function(e){if(e.a()==null){$self.aw();var f=function(){var $ret=new $.ig.OlapResult;$ret.isEmpty(true);return $ret}();$self.l(new $.ig.OlapResultView(f,f,false,false));$self.result(f);a.e(null);return}a.d(e.a())});return a.b()}var e=d.continueWithTask$1($.ig.IList$1.prototype.$type.specialize($.ig.Cube.prototype.$type),function(f){if(f.a()==null){return $self.be(b)}var g=new $.ig.TaskCompletionSource$1($.ig.IList$1.prototype.$type.specialize($.ig.Cube.prototype.$type),0);g.d(f.a());return g.b()});if(String.isNullOrEmpty(c)){e.i(function(f){if(f.a()==null){$self.aw();var g=function(){var $ret=new $.ig.OlapResult;$ret.isEmpty(true);return $ret}();$self.l(new $.ig.OlapResultView(g,g,false,false));$self.result(g);a.e(null);return}a.d(f.a())});return a.b()}var f=e.continueWithTask$1($.ig.OlapMetadataTreeItem.prototype.$type,function(g){return $self.an(c)}).continueWithTask$1($.ig.OlapMetadataTreeItem.prototype.$type,function(g){return $self.ak()});return f},ai:function(){var $self=this;var a=$self.m();var b=$self.s();var c=$self.r();var d=$self.n();var e=$self.ae().count()>0;var f=$self.ad().count()>0;var g=$self.af.count()>0;if(!a&&!b&&!c&&!d&&!e&&!f&&!g){var h=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);h.e($self.result());return h.b()}var i=$self.columnAxis().count()>0;var j=$self.rowAxis().count()>0;if($self.rowAxis().count()==0&&$self.columnAxis().count()==0&&$self.measures().count()==0){var k=function(){var $ret=new $.ig.OlapResult;$ret.isEmpty(true);return $ret}();var l=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);l.e(k);$self.l(new $.ig.OlapResultView(k,k,false,false));$self.result(k);$self.bp(k);$self.bq($self.l().visibleResult(),j,i);$self.clearPendingChanges();return l.b()}if($self.r()){$self.br(i,j)}$self.r(false);$self.n(false);$self.q(false);var m=false;if($self.a9&&!$self.m()&&!$self.s()){m=true}var n=null;var o=null;var p=0;n=$self.a4($self.columnAxis(),$self.m(),p);$self.m(false);if(n!=null){p++}o=$self.a4($self.rowAxis(),$self.s(),p);$self.s(false);if(o!=null){o.axisIndex(p);p++}var q;var r=function(){var $ret=$self.ba(i,j,m,q);q=$ret.axisPositionsMap;return $ret.ret}();var s=$self.a8($self.u(),$self.w(),$self.v(),$self.mdxSettings());var t=s.createAxis(p);var u=new $.ig.MdxQueryBuilder(1,$self.mdxSettings());var v=$self.getProviderDefaultProperties();var w=$self.getProviderDefaultRestrictions();var x=$self.dataProviderFactory().createDataProvider();if(m&&!g&&(e||f)){var y=null;if(n!=null){var z=r.where$1($.ig.IMdxAxis.prototype.$type,function(aa){return aa.axisIndex()==n.axisIndex()}).firstOrDefault$1($.ig.IMdxAxis.prototype.$type);var aa;(function(){var $ret=q.tryGetValue("Axis0",aa);aa=$ret.value;return $ret.ret})();if(z!=null){var ab=u.c(z,o,t,new $.ig.MdxCalculatedMembersCache,$self.cube().name());y=x.executeStatementAsync(ab,v,w);y=y.continueWithTask$2($.ig.OlapResult.prototype.$type,$.ig.OlapResult.prototype.$type,function(ac){if($self.l()==null){$self.l(new $.ig.OlapResultView($self.result(),$self.result(),i,j))}var ad=$self.l();$self.l($self.l().extend(ac.m(),"Axis0"));$self.result($self.l().visibleResult());$self.bp($self.result());$.ig.ResultViewHelper.prototype.f("Axis0",ad,$self.l());var af=aa.getEnumerator();while(af.moveNext()){var ae=af.current();$.ig.ResultViewHelper.prototype.e(ae.c(),ae.b(),ae.a(),true,$self.l())}var ag=j;var ah=i;$self.bq($self.l().visibleResult(),ag,ah);var ai=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);ai.e($self.l().visibleResult());return ai.b()})}}if(o!=null){var ac=r.where$1($.ig.IMdxAxis.prototype.$type,function(ad){return ad.axisIndex()==o.axisIndex()}).firstOrDefault$1($.ig.IMdxAxis.prototype.$type);var ad=$self.l().hasColumns()?"Axis1":"Axis0";var ae;(function(){var $ret=q.tryGetValue(ad,ae);ae=$ret.value;return $ret.ret})();if(ac!=null){if(y!=null){y=y.continueWithTask$1($.ig.OlapResult.prototype.$type,function(af){n=$self.a4($self.columnAxis(),false,0);var ag=u.c(n,ac,t,new $.ig.MdxCalculatedMembersCache,$self.cube().name());return x.executeStatementAsync(ag,v,w)})}else{var af=u.c(n,ac,t,new $.ig.MdxCalculatedMembersCache,$self.cube().name());y=x.executeStatementAsync(af,v,w)}y=y.continueWithTask$2($.ig.OlapResult.prototype.$type,$.ig.OlapResult.prototype.$type,function(ag){if($self.l()==null){$self.l(new $.ig.OlapResultView($self.result(),$self.result(),i,j))}var ah=$self.l();$self.l($self.l().extend(ag.m(),ad));$self.result($self.l().visibleResult());$self.bp($self.result());$.ig.ResultViewHelper.prototype.f(ad,ah,$self.l());var aj=ae.getEnumerator();while(aj.moveNext()){var ai=aj.current();$.ig.ResultViewHelper.prototype.e(ai.c(),ai.b(),ai.a(),true,$self.l())}var ak=j;var al=i;$self.bq($self.l().visibleResult(),ak,al);var am=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);am.e($self.l().visibleResult());return am.b()})}}if(y!=null){return y}var ag=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);ag.e($self.result());return ag.b()}else{if(g){$self.af.clear()}var ah=u.c(n,o,t,new $.ig.MdxCalculatedMembersCache,$self.cube().name());return x.executeStatementAsync(ah,v,w).j($.ig.OlapResult.prototype.$type,function(ai){$self.l(new $.ig.OlapResultView(ai.m(),ai.m(),i,j));$self.result($self.l().visibleResult());$self.bp($self.result());var aj=j;var ak=i;$self.bq($self.l().visibleResult(),aj,ak);$self.clearPendingChanges();return $self.result()})}},an:function(a){if(this.catalog()==null){throw new $.ig.InvalidOperationException(1,"Data source has no Catalog set.")}return $.ig.OlapDataSource.prototype.an.call(this,a)},ao:function(a){if(this.catalog()==null){throw new $.ig.InvalidOperationException(1,"Data source has no Catalog set.")}return $.ig.OlapDataSource.prototype.ao.call(this,a)},ah:function(){var $self=this;var a=new $.ig.List$1($.ig.Task.prototype.$type,0);var b=$self.getProviderDefaultProperties();var c=$self.getProviderDefaultRestrictions();var d=$self.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($self.ar());var e=new Array(a.count());a.copyTo(e,0);var f=new $.ig.TaskFactory;var g=new $.ig.CubeMetaItemsCache;$self.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.s(i.m());g.n(k.m());g.o(l.m());g.r(m.m());g.p(j.m());if($self.measureGroups()!=null){g.t(n.m());g.a(new $.ig.MeasureGroupMetaItemsCache(g.n(),g.s(),g.p(),g.t()))}})},a1:function($t,a){var b=new $.ig.ArrayListCollection$1($t);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b.add(c)}return b},getProviderDefaultRestrictions:function(){var $self=this;var a=$.ig.OlapDataSource.prototype.getProviderDefaultRestrictions.call($self);if($self.catalog()!=null){a.add(function(){var $ret=new $.ig.KeyValueItem;$ret.a($.ig.CubeRestrictions.prototype.a);$ret.b($self.catalog().name());return $ret}());if($self.cube()!=null){a.add(function(){var $ret=new $.ig.KeyValueItem;$ret.a($.ig.CubeRestrictions.prototype.b);$ret.b($self.cube().name());return $ret}())}}return a},bi:function(a,b){this.m(true);this.bt(0,this.columnAxis(),this.rowAxis());this.ay(b,this.u());this.a0(b,this.columnAxis());if(b.action()!=$.ig.NotifyCollectionChangedAction.prototype.reset&&this.columnAxis()!=null){var c=Math.max(b.newStartingIndex(),b.oldStartingIndex());this.bs("Axis0",c)}},bn:function(a,b){this.s(true);this.bt(1,this.rowAxis(),this.columnAxis());this.ay(b,this.w());this.a0(b,this.rowAxis());if(b.action()!=$.ig.NotifyCollectionChangedAction.prototype.reset&&this.rowAxis()!=null){var c=this.columnAxis()==null?"Axis0":"Axis1";var d=Math.max(b.newStartingIndex(),b.oldStartingIndex());this.bs(c,d)}},bs:function(a,b){var c=this.ad();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.ae();for(var g=f.count()-1;g>=0;g--){var h=f.item(g);if(h.c()==a&&h.a()>=b){f.removeAt(g)}}},bt: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)}}}},bk:function(a,b){this.n(true);this.ay(b,this.v())},bl:function(a,b){this.r(true);this.az()},bj:function(a,b,c){var $self=this;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 $.ig.KeyValueItem;$ret.a(b);$ret.b(c);return $ret}())}},a2:function(a){var $self=this;if($self.result()!=null&&$self.result().axes().count()>0){return $self.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(b){return b.name()==a
}).firstOrDefault$1($.ig.OlapResultAxis.prototype.$type)}return null},a6:function(a){if(a<this.bb.count()){return this.bb.item(a)}return null},bo:function(a,b){this.bb.item(a,b)},$type:new $.ig.Type("MdxDataSourceImpl",$.ig.OlapDataSource.prototype.$type)},true);$.ig.util.defType("MdxDataSourceOptions","DataSourceBaseOptions",{init:function(){$.ig.DataSourceBaseOptions.prototype.init.call(this)},_catalog:null,catalog:function(value){if(arguments.length===1){this._catalog=value;return value}else{return this._catalog}},_discoverProperties:null,discoverProperties:function(value){if(arguments.length===1){this._discoverProperties=value;return value}else{return this._discoverProperties}},_executeProperties:null,executeProperties:function(value){if(arguments.length===1){this._executeProperties=value;return value}else{return this._executeProperties}},_dataProviderFactory:null,dataProviderFactory:function(value){if(arguments.length===1){this._dataProviderFactory=value;return value}else{return this._dataProviderFactory}},_enableResultCache:false,enableResultCache:function(value){if(arguments.length===1){this._enableResultCache=value;return value}else{return this._enableResultCache}},_mdxSettings:null,mdxSettings:function(value){if(arguments.length===1){this._mdxSettings=value;return value}else{return this._mdxSettings}},$type:new $.ig.Type("MdxDataSourceOptions",$.ig.DataSourceBaseOptions.prototype.$type)},true);$.ig.util.defType("XmlaDataProvider","Object",{a:null,b:null,init:function(a,b){$.ig.Object.prototype.init.call(this);this.a=a;this.b=b},discoverCatalogsAsync:function(a,b){return this.c($.ig.Catalog.prototype.$type,new $.ig.DatabaseXmlTypeSerializer,$.ig.DbSchemaConstants.prototype.a,a,b)},discoverCubesAsync:function(a,b){return this.c($.ig.Cube.prototype.$type,new $.ig.CubeXmlTypeSerializer,$.ig.OlapSchemaConstants.prototype.a,a,b)},discoverDimensionsAsync:function(a,b){return this.c($.ig.Dimension.prototype.$type,new $.ig.DimensionXmlTypeSerializer,$.ig.OlapSchemaConstants.prototype.b,a,b)},discoverHierarchiesAsync:function(a,b){return this.c($.ig.Hierarchy.prototype.$type,new $.ig.HierarchyXmlTypeSerializer,$.ig.OlapSchemaConstants.prototype.c,a,b)},discoverLevelsAsync:function(a,b){return this.c($.ig.Level.prototype.$type,new $.ig.LevelXmlTypeSerializer,$.ig.OlapSchemaConstants.prototype.e,a,b)},discoverMeasuresAsync:function(a,b){return this.c($.ig.Measure.prototype.$type,new $.ig.MeasureXmlTypeSerializer,$.ig.OlapSchemaConstants.prototype.h,a,b)},discoverMeasureGroupsAsync:function(a,b){return this.c($.ig.MeasureGroup.prototype.$type,new $.ig.MeasureGroupXmlTypeSerializer,$.ig.OlapSchemaConstants.prototype.g,a,b)},discoverMeasureGroupDimensionsAsync:function(a,b){return this.c($.ig.MeasureGroupDimension.prototype.$type,new $.ig.MeasureGroupDimensionXmlTypeSerializer,$.ig.OlapSchemaConstants.prototype.f,a,b)},discoverMembersAsync:function(a,b){return this.c($.ig.Member.prototype.$type,new $.ig.MemberXmlTypeSerializer,$.ig.OlapSchemaConstants.prototype.i,a,b)},discoverKpisAsync:function(a,b){return this.c($.ig.Kpi.prototype.$type,new $.ig.KpiXmlTypeSerializer,$.ig.OlapSchemaConstants.prototype.d,a,b)},executeStatementAsync:function(a,b,c){var $self=this;var d=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);var e=$self.a.getXmlaSoapWebClient$1($.ig.ExecuteResponseResult.prototype.$type);var f=new $.ig.ResultXmlTypeSerializer;e.requestCompleted=$.ig.Delegate.prototype.combine(e.requestCompleted,function(g,h){return $self.e($.ig.OlapResult.prototype.$type,f,h,d)});var g=new $.ig.XmlaSoapMethodExecute(a);$self.g(g,b,c);e.j(g);return d.b()},c:function($t,a,b,c,d){var $self=this;var e=new $.ig.TaskCompletionSource$1($.ig.IEnumerable$1.prototype.$type.specialize($t),0);var f=$self.a.getXmlaSoapWebClient$1($.ig.DiscoverResponseResult.prototype.$type);f.requestCompleted=$.ig.Delegate.prototype.combine(f.requestCompleted,function(g,h){return $self.d($t,a,h,e)});var g=new $.ig.XmlaSoapMethodDiscover(b);$self.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(new $.ig.XmlaQueryProperty(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(new $.ig.XmlaQueryProperty(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 $.ig.ArraySerializer;var f=e.a($t,b.result().returnElement(),$.ig.XName.prototype.e("row",$.ig.XmlaNamespace.prototype.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.Object.prototype.$type,[$.ig.IXmlaDataProvider.prototype.$type])},true);$.ig.util.defType("CatalogConstants","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("CatalogConstants",$.ig.Object.prototype.$type)},true);$.ig.util.defType("DbSchemaConstants","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("DbSchemaConstants",$.ig.Object.prototype.$type)},true);$.ig.util.defType("CubeConstants","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("CubeConstants",$.ig.Object.prototype.$type)},true);$.ig.util.defType("DimensionConstants","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("DimensionConstants",$.ig.Object.prototype.$type)},true);$.ig.util.defType("HierarchyConstants","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("HierarchyConstants",$.ig.Object.prototype.$type)},true);$.ig.util.defType("InstanceConstants","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("InstanceConstants",$.ig.Object.prototype.$type)},true);$.ig.util.defType("KpiConstants","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("KpiConstants",$.ig.Object.prototype.$type)},true);$.ig.util.defType("LevelConstants","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("LevelConstants",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MeasureConstants","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("MeasureConstants",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MeasureGroupConstants","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("MeasureGroupConstants",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MeasureGroupDimensionConstants","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("MeasureGroupDimensionConstants",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MemberConstants","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("MemberConstants",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapSchemaConstants","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("OlapSchemaConstants",$.ig.Object.prototype.$type)},true);$.ig.util.defType("CubeRestrictions","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("CubeRestrictions",$.ig.Object.prototype.$type)},true);$.ig.util.defType("DimensionRestrictions","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("DimensionRestrictions",$.ig.Object.prototype.$type)},true);$.ig.util.defType("HierarchyRestrictions","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("HierarchyRestrictions",$.ig.Object.prototype.$type)},true);$.ig.util.defType("KpiRestrictions","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("KpiRestrictions",$.ig.Object.prototype.$type)},true);$.ig.util.defType("LevelRestrictions","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("LevelRestrictions",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MeasureRestrictions","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("MeasureRestrictions",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MeasureGroupRestrictions","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("MeasureGroupRestrictions",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MeasureGroupDimensionRestrictions","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("MeasureGroupDimensionRestrictions",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MemberRestrictions","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("MemberRestrictions",$.ig.Object.prototype.$type)},true);$.ig.util.defType("ICoreXmlaConnection","Object",{$type:new $.ig.Type("ICoreXmlaConnection",null,[$.ig.IConnection.prototype.$type])},true);$.ig.util.defType("ArraySerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},a:function($t,a,b,c){var d=new $.ig.List$1($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.Object.prototype.$type)},true);$.ig.util.defType("IXmlTypeSerializer$1","Object",{$type:new $.ig.Type("IXmlTypeSerializer$1",null)},true);$.ig.util.defType("AxisXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},deserialize:function(a){var $self=this;if(a.c()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=$.ig.SerializerUtils.prototype.e(b.k($.ig.XName.prototype.e("name","")));var d=b.h($.ig.XName.prototype.e("Tuples",$.ig.XmlaNamespace.prototype.d));var e=new $.ig.ArraySerializer;var f=e.a($.ig.OlapResultTuple.prototype.$type,d,$.ig.XName.prototype.e("Tuple",$.ig.XmlaNamespace.prototype.d),new $.ig.TupleXmlTypeSerializer);var g=0;if(f.count()>0){g=f.__inner[0].members().count()}return function(){var $ret=new $.ig.OlapResultAxis(f,g);$ret.name(c);return $ret}()},$type:new $.ig.Type("AxisXmlTypeSerializer",$.ig.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.OlapResultAxis.prototype.$type)])},true);$.ig.util.defType("TupleXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},deserialize:function(a){if(a.c()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=new $.ig.ArraySerializer;var d=c.a($.ig.OlapResultAxisMember.prototype.$type,b,$.ig.XName.prototype.e("Member",$.ig.XmlaNamespace.prototype.d),new $.ig.AxisMemberXmlTypeSerializer);var e=new $.ig.OlapResultTuple(d);var g=d.getEnumerator();while(g.moveNext()){var f=g.current();f.position(e)}return e},$type:new $.ig.Type("TupleXmlTypeSerializer",$.ig.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.OlapResultTuple.prototype.$type)])},true);$.ig.util.defType("AxisMemberXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},deserialize:function(a){var $self=this;if(a.c()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e("UName",$.ig.XmlaNamespace.prototype.d)));var d=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e("LName",$.ig.XmlaNamespace.prototype.d)));var e=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e("Caption",$.ig.XmlaNamespace.prototype.d)));var f=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e("LNum",$.ig.XmlaNamespace.prototype.d)));var g=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e("DisplayInfo",$.ig.XmlaNamespace.prototype.d)));var h=b.k($.ig.XName.prototype.e("Hierarchy","")).d();var i=function(){var $ret=new $.ig.OlapResultAxisMember;$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:$.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.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.OlapResultAxisMember.prototype.$type)])},true);$.ig.util.defType("CellXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},deserialize:function(a){var $self=this;if(a.c()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=b.k($.ig.XName.prototype.e("CellOrdinal","")).d();var d=function(){var $ret=new $.ig.OlapResultCell;$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.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.OlapResultCell.prototype.$type)])},true);$.ig.util.defType("CubeXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},deserialize:function(a){var $self=this;if(a.c()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.CubeConstants.prototype.e,$.ig.XmlaNamespace.prototype.e)));var d=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.CubeConstants.prototype.d,$.ig.XmlaNamespace.prototype.e)));var e=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.CubeConstants.prototype.g,$.ig.XmlaNamespace.prototype.e)));var f;var g=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.CubeConstants.prototype.f,$.ig.XmlaNamespace.prototype.e)));switch(g){case $.ig.XmlaConstants.prototype.d:f=$.ig.CubeType.prototype.cube;break;case $.ig.XmlaConstants.prototype.k:f=$.ig.CubeType.prototype.dimension;break;default:f=$.ig.CubeType.prototype.unknown;break}var h=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.CubeConstants.prototype.c,$.ig.XmlaNamespace.prototype.e)));var i=$.ig.SerializerUtils.prototype.b(b.h($.ig.XName.prototype.e($.ig.CubeConstants.prototype.l,$.ig.XmlaNamespace.prototype.e)));var j=$.ig.SerializerUtils.prototype.b(b.h($.ig.XName.prototype.e($.ig.CubeConstants.prototype.m,$.ig.XmlaNamespace.prototype.e)));return function(){var $ret=new $.ig.Cube;$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.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.Cube.prototype.$type)])},true);$.ig.util.defType("DatabaseXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},deserialize:function(a){var $self=this;if(a.c()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.CatalogConstants.prototype.a,$.ig.XmlaNamespace.prototype.e)));var d=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.CatalogConstants.prototype.c,$.ig.XmlaNamespace.prototype.e)));return function(){var $ret=new $.ig.Catalog;$ret.name(c);$ret.caption(c);$ret.uniqueName(c);$ret.description(d);return $ret}()},$type:new $.ig.Type("DatabaseXmlTypeSerializer",$.ig.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.Catalog.prototype.$type)])},true);$.ig.util.defType("DimensionXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},deserialize:function(a){var $self=this;if(a.c()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.DimensionConstants.prototype.i,$.ig.XmlaNamespace.prototype.e)));var d=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.DimensionConstants.prototype.l,$.ig.XmlaNamespace.prototype.e)));var e=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.DimensionConstants.prototype.e,$.ig.XmlaNamespace.prototype.e)));var f=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.DimensionConstants.prototype.d,$.ig.XmlaNamespace.prototype.e)));var g=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.DimensionConstants.prototype.k,$.ig.XmlaNamespace.prototype.e)));var h=$.ig.Number.prototype.parseInt(g);var i=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.DimensionConstants.prototype.c,$.ig.XmlaNamespace.prototype.e)));return function(){var $ret=new $.ig.Dimension;$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.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.Dimension.prototype.$type)])},true);$.ig.util.defType("FaultError","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_errorCode:null,errorCode:function(value){if(arguments.length===1){this._errorCode=value;return value}else{return this._errorCode}},_description:null,description:function(value){if(arguments.length===1){this._description=value;return value}else{return this._description}},_source:null,source:function(value){if(arguments.length===1){this._source=value;return value}else{return this._source}},_helpFile:null,helpFile:function(value){if(arguments.length===1){this._helpFile=value;return value}else{return this._helpFile}},_severity:null,severity:function(value){if(arguments.length===1){this._severity=value;return value}else{return this._severity}},$type:new $.ig.Type("FaultError",$.ig.Object.prototype.$type)},true);$.ig.util.defType("ErrorXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},deserialize:function(a){var b=new $.ig.FaultError;var c=a;b.errorCode($.ig.SerializerUtils.prototype.e(c.k($.ig.XName.prototype.e("ErrorCode",""))));b.description($.ig.SerializerUtils.prototype.e(c.k($.ig.XName.prototype.e("Description",""))));b.source($.ig.SerializerUtils.prototype.e(c.k($.ig.XName.prototype.e("Source",""))));b.helpFile($.ig.SerializerUtils.prototype.e(c.k($.ig.XName.prototype.e("HelpFile",""))));b.severity($.ig.SerializerUtils.prototype.e(c.k($.ig.XName.prototype.e("Severity",""))));return b},$type:new $.ig.Type("ErrorXmlTypeSerializer",$.ig.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.FaultError.prototype.$type)])},true);$.ig.util.defType("HierarchyXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},deserialize:function(a){var $self=this;if(a.c()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.HierarchyConstants.prototype.q,$.ig.XmlaNamespace.prototype.e)));var d=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.HierarchyConstants.prototype.t,$.ig.XmlaNamespace.prototype.e)));var e=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.HierarchyConstants.prototype.m,$.ig.XmlaNamespace.prototype.e)));var f=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.HierarchyConstants.prototype.e,$.ig.XmlaNamespace.prototype.e)));var g=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.HierarchyConstants.prototype.d,$.ig.XmlaNamespace.prototype.e)));var h=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.HierarchyConstants.prototype.a,$.ig.XmlaNamespace.prototype.e)));var i=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.HierarchyConstants.prototype.j,$.ig.XmlaNamespace.prototype.e)));var j=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.HierarchyConstants.prototype.o,$.ig.XmlaNamespace.prototype.e)));var k=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.HierarchyConstants.prototype.s,$.ig.XmlaNamespace.prototype.e)));var l=k==null?1:$.ig.Number.prototype.parseInt(k);return function(){var $ret=new $.ig.Hierarchy;$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.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.Hierarchy.prototype.$type)])},true);$.ig.util.defType("KpiXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},deserialize:function(a){var $self=this;if(a.c()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.KpiConstants.prototype.h,$.ig.XmlaNamespace.prototype.e)));var d=c;var e=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.KpiConstants.prototype.c,$.ig.XmlaNamespace.prototype.e)));var f=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.KpiConstants.prototype.e,$.ig.XmlaNamespace.prototype.e)));var g=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.KpiConstants.prototype.p,$.ig.XmlaNamespace.prototype.e)));var h=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.KpiConstants.prototype.f,$.ig.XmlaNamespace.prototype.e)));var i=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.KpiConstants.prototype.n,$.ig.XmlaNamespace.prototype.e)));var j=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.KpiConstants.prototype.g,$.ig.XmlaNamespace.prototype.e)));var k=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.KpiConstants.prototype.j,$.ig.XmlaNamespace.prototype.e)));var l=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.KpiConstants.prototype.l,$.ig.XmlaNamespace.prototype.e)));var m=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.KpiConstants.prototype.o,$.ig.XmlaNamespace.prototype.e)));var n=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.KpiConstants.prototype.k,$.ig.XmlaNamespace.prototype.e)));var o=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.KpiConstants.prototype.m,$.ig.XmlaNamespace.prototype.e)));var p=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.KpiConstants.prototype.i,$.ig.XmlaNamespace.prototype.e)));var q=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.KpiConstants.prototype.d,$.ig.XmlaNamespace.prototype.e)));return function(){var $ret=new $.ig.Kpi;$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.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.Kpi.prototype.$type)])},true);$.ig.util.defType("LevelXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},deserialize:function(a){var $self=this;if(a.c()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.LevelConstants.prototype.l,$.ig.XmlaNamespace.prototype.e)));var d=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.LevelConstants.prototype.q,$.ig.XmlaNamespace.prototype.e)));var e=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.LevelConstants.prototype.g,$.ig.XmlaNamespace.prototype.e)));var f=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.LevelConstants.prototype.d,$.ig.XmlaNamespace.prototype.e)));var g=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.LevelConstants.prototype.e,$.ig.XmlaNamespace.prototype.e)));var h=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.LevelConstants.prototype.f,$.ig.XmlaNamespace.prototype.e)));var i=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.LevelConstants.prototype.m,$.ig.XmlaNamespace.prototype.e)));var j=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.LevelConstants.prototype.h,$.ig.XmlaNamespace.prototype.e)));var k=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.LevelConstants.prototype.o,$.ig.XmlaNamespace.prototype.e)));var l=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.LevelConstants.prototype.n,$.ig.XmlaNamespace.prototype.e)));return function(){var $ret=new $.ig.Level;$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.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.Level.prototype.$type)])},true);$.ig.util.defType("MeasureGroupDimensionXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},deserialize:function(a){var $self=this;if(a.c()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MeasureGroupDimensionConstants.prototype.a,$.ig.XmlaNamespace.prototype.e)));var d=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MeasureGroupDimensionConstants.prototype.b,$.ig.XmlaNamespace.prototype.e)));var e=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MeasureGroupDimensionConstants.prototype.j,$.ig.XmlaNamespace.prototype.e)));var f=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MeasureGroupDimensionConstants.prototype.h,$.ig.XmlaNamespace.prototype.e)));var g=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MeasureGroupDimensionConstants.prototype.i,$.ig.XmlaNamespace.prototype.e)));var h=g=="ONE"?$.ig.CardinalityType.prototype.one:$.ig.CardinalityType.prototype.many;var i=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MeasureGroupDimensionConstants.prototype.c,$.ig.XmlaNamespace.prototype.e)));var j=i=="ONE"?$.ig.CardinalityType.prototype.one:$.ig.CardinalityType.prototype.many;var k=$.ig.SerializerUtils.prototype.a(b.h($.ig.XName.prototype.e($.ig.MeasureGroupDimensionConstants.prototype.f,$.ig.XmlaNamespace.prototype.e)));var l=$.ig.SerializerUtils.prototype.a(b.h($.ig.XName.prototype.e($.ig.MeasureGroupDimensionConstants.prototype.e,$.ig.XmlaNamespace.prototype.e)));var m=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MeasureGroupDimensionConstants.prototype.g,$.ig.XmlaNamespace.prototype.e)));var n=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MeasureGroupDimensionConstants.prototype.d,$.ig.XmlaNamespace.prototype.e)));return function(){var $ret=new $.ig.MeasureGroupDimension;$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.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.MeasureGroupDimension.prototype.$type)])},true);$.ig.util.defType("MeasureGroupXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},deserialize:function(a){var $self=this;if(a.c()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MeasureGroupConstants.prototype.a,$.ig.XmlaNamespace.prototype.e)));var d=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MeasureGroupConstants.prototype.b,$.ig.XmlaNamespace.prototype.e)));var e=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MeasureGroupConstants.prototype.e,$.ig.XmlaNamespace.prototype.e)));var f=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MeasureGroupConstants.prototype.d,$.ig.XmlaNamespace.prototype.e)));var g=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MeasureGroupConstants.prototype.c,$.ig.XmlaNamespace.prototype.e)));return function(){var $ret=new $.ig.MeasureGroup;$ret.catalogName(c);$ret.cubeName(d);$ret.name(e);$ret.caption(f);$ret.description(g);return $ret}()},$type:new $.ig.Type("MeasureGroupXmlTypeSerializer",$.ig.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.MeasureGroup.prototype.$type)])},true);$.ig.util.defType("MeasureXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},deserialize:function(a){var $self=this;if(a.c()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MeasureConstants.prototype.l,$.ig.XmlaNamespace.prototype.e)));var d=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MeasureConstants.prototype.n,$.ig.XmlaNamespace.prototype.e)));var e=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MeasureConstants.prototype.h,$.ig.XmlaNamespace.prototype.e)));var f=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MeasureConstants.prototype.e,$.ig.XmlaNamespace.prototype.e)));var g=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MeasureConstants.prototype.d,$.ig.XmlaNamespace.prototype.e)));var h=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MeasureConstants.prototype.j,$.ig.XmlaNamespace.prototype.e)));var i=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MeasureConstants.prototype.g,$.ig.XmlaNamespace.prototype.e)));var j=$.ig.Number.prototype.parseInt(i);var k=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MeasureConstants.prototype.i,$.ig.XmlaNamespace.prototype.e)));return function(){var $ret=new $.ig.Measure;$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.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.Measure.prototype.$type)])},true);$.ig.util.defType("MemberXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},deserialize:function(a){var $self=this;if(a.c()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MemberConstants.prototype.a,$.ig.XmlaNamespace.prototype.e)));var d=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MemberConstants.prototype.c,$.ig.XmlaNamespace.prototype.e)));var e=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MemberConstants.prototype.o,$.ig.XmlaNamespace.prototype.e)));var f=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MemberConstants.prototype.q,$.ig.XmlaNamespace.prototype.e)));var g=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MemberConstants.prototype.p,$.ig.XmlaNamespace.prototype.e)));var h=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MemberConstants.prototype.e,$.ig.XmlaNamespace.prototype.e)));var i=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MemberConstants.prototype.g,$.ig.XmlaNamespace.prototype.e)));var j=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MemberConstants.prototype.k,$.ig.XmlaNamespace.prototype.e)));
var k=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MemberConstants.prototype.l,$.ig.XmlaNamespace.prototype.e)));var l=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MemberConstants.prototype.d,$.ig.XmlaNamespace.prototype.e)));var m=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MemberConstants.prototype.j,$.ig.XmlaNamespace.prototype.e)));var n=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MemberConstants.prototype.b,$.ig.XmlaNamespace.prototype.e)));var o=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MemberConstants.prototype.t,$.ig.XmlaNamespace.prototype.e)));var p=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MemberConstants.prototype.v,$.ig.XmlaNamespace.prototype.e)));var q=$.ig.SerializerUtils.prototype.f(b.h($.ig.XName.prototype.e($.ig.MemberConstants.prototype.s,$.ig.XmlaNamespace.prototype.e)));var r=$.ig.util.toNullable($.ig.Number.prototype.$type,null);return function(){var $ret=new $.ig.Member;$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:$.ig.Number.prototype.parseInt(p));$ret.parentLevel(String.isNullOrEmpty(q)?0:$.ig.Number.prototype.parseInt(q));return $ret}()},$type:new $.ig.Type("MemberXmlTypeSerializer",$.ig.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.Member.prototype.$type)])},true);$.ig.util.defType("ResultXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},deserialize:function(a){var $self=this;if(a.c()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=b.l().d();switch(c){case $.ig.XmlaNamespace.prototype.b:return function(){var $ret=new $.ig.OlapResult;$ret.isEmpty(true);return $ret}();case $.ig.XmlaNamespace.prototype.d:var d=b.h($.ig.XName.prototype.e("OlapInfo",$.ig.XmlaNamespace.prototype.d));var e=b.h($.ig.XName.prototype.e("Axes",$.ig.XmlaNamespace.prototype.d));var f=new $.ig.ArraySerializer;var g=f.a($.ig.OlapResultAxis.prototype.$type,e,$.ig.XName.prototype.e("Axis",$.ig.XmlaNamespace.prototype.d),new $.ig.AxisXmlTypeSerializer);var h=b.h($.ig.XName.prototype.e("CellData",$.ig.XmlaNamespace.prototype.d));var i=f.a($.ig.OlapResultCell.prototype.$type,h,$.ig.XName.prototype.e("Cell",$.ig.XmlaNamespace.prototype.d),new $.ig.CellXmlTypeSerializer);return function(){var $ret=new $.ig.OlapResult;$ret.axes(g);$ret.cells(i);return $ret}()}return null},$type:new $.ig.Type("ResultXmlTypeSerializer",$.ig.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.OlapResult.prototype.$type)])},true);$.ig.util.defType("SerializerUtils","Object",{init:function(){$.ig.Object.prototype.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=$.ig.SerializerUtils.prototype.f(a).toLowerCase();return b=="true"},b:function(a){if(a!=null&&!String.isNullOrEmpty(a.i())){return $.ig.SerializerUtils.prototype.d(a.i())}else{return $.ig.SerializerUtils.prototype.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.Object.prototype.$type)},true);$.ig.util.defType("XmlaConstants","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("XmlaConstants",$.ig.Object.prototype.$type)},true);$.ig.util.defType("XmlaSoapFault","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_d:null,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},$type:new $.ig.Type("XmlaSoapFault",$.ig.Object.prototype.$type)},true);$.ig.util.defType("XmlaSoapFaultXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},deserialize:function(a){var $self=this;var b=a;var c=new $.ig.XmlaSoapFault;var e=b.d().getEnumerator();while(e.moveNext()){var d=e.current();switch(d.l().c()){case"faultcode":c.c($.ig.SerializerUtils.prototype.f(d));break;case"faultstring":c.d($.ig.SerializerUtils.prototype.f(d));break;case"faultactor":c.b($.ig.SerializerUtils.prototype.f(d));break}}var f=b.h($.ig.XName.prototype.e("detail",""));if(f!=null){var g=f.e($.ig.XName.prototype.e("Error",""));var h=new $.ig.List$1($.ig.FaultError.prototype.$type,0);var i=new $.ig.ErrorXmlTypeSerializer;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 $.ig.FaultDetail;$ret.a(h.toArray());return $ret}())}return c},$type:new $.ig.Type("XmlaSoapFaultXmlTypeSerializer",$.ig.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.XmlaSoapFault.prototype.$type)])},true);$.ig.util.defType("IXmlaMethodResult","Object",{$type:new $.ig.Type("IXmlaMethodResult",null)},true);$.ig.util.defType("XmlaSoapMethodResult","Object",{init:function(){$.ig.Object.prototype.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(value){if(arguments.length===1){this._sessionId=value;return value}else{return this._sessionId}},$type:new $.ig.Type("XmlaSoapMethodResult",$.ig.Object.prototype.$type,[$.ig.IXmlaMethodResult.prototype.$type])},true);$.ig.util.defType("DiscoverResponseResult","XmlaSoapMethodResult",{init:function(){$.ig.XmlaSoapMethodResult.prototype.init.call(this)},$type:new $.ig.Type("DiscoverResponseResult",$.ig.XmlaSoapMethodResult.prototype.$type)},true);$.ig.util.defType("RequestCompletedEventArgs$1","AsyncCompletedEventArgs",{$t:null,i:null,init:function($t,a,b,c,d){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.AsyncCompletedEventArgs.prototype.init.call(this,b,c,d);this.i=a},result:function(){$.ig.AsyncCompletedEventArgs.prototype.h.call(this);return this.i},$type:new $.ig.Type("RequestCompletedEventArgs$1",$.ig.AsyncCompletedEventArgs.prototype.$type)},true);$.ig.util.defType("ExecuteResponseResult","XmlaSoapMethodResult",{init:function(){$.ig.XmlaSoapMethodResult.prototype.init.call(this)},$type:new $.ig.Type("ExecuteResponseResult",$.ig.XmlaSoapMethodResult.prototype.$type)},true);$.ig.util.defType("FaultDetail","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},$type:new $.ig.Type("FaultDetail",$.ig.Object.prototype.$type)},true);$.ig.util.defType("IXmlaSoapMethod","Object",{$type:new $.ig.Type("IXmlaSoapMethod",null)},true);$.ig.util.defType("XmlaNamespace","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("XmlaNamespace",$.ig.Object.prototype.$type)},true);$.ig.util.defType("XmlaQueryProperty","Object",{init:function(initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$.ig.Object.prototype.init.call(this)},init1:function(initNumber,a,b){$.ig.Object.prototype.init.call(this);this.a(a);this.c(b)},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},toString:function(){return String.concat(this.a()," = ",this.c())},$type:new $.ig.Type("XmlaQueryProperty",$.ig.Object.prototype.$type)},true);$.ig.util.defType("XmlaPropertiesCollection","Object",{c:null,d:null,e:null,init:function(){$.ig.Object.prototype.init.call(this);this.c=new $.ig.Dictionary$2(String,$.ig.XmlaQueryProperty.prototype.$type,0);this.d=new $.ig.Dictionary$2(String,$.ig.Number.prototype.$type,0);this.e=new $.ig.List$1($.ig.XmlaQueryProperty.prototype.$type,0)},tryGetValue:function(a,b){var $self=this;return{ret:function(){var $ret=$self.c.tryGetValue(a,b);b=$ret.value;return $ret.ret}(),value:b};return{value: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: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: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()},isFixedSize:function(){return false},isSynchronized:function(){return this.e.isSynchronized()},syncRoot:function(){return this.e.syncRoot()},$type:new $.ig.Type("XmlaPropertiesCollection",$.ig.Object.prototype.$type,[$.ig.IList$1.prototype.$type.specialize($.ig.XmlaQueryProperty.prototype.$type),$.ig.IList.prototype.$type])},true);$.ig.util.defType("XmlaSoapMessageBuilder","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},c:function(){if(this.a()==null){throw new $.ig.InvalidOperationException(1,"XmlaMethod is not specified.")}var a=$.ig.XNamespace.prototype.c($.ig.XmlaSoapMessageBuilder.prototype.g);this.a().construct(a);var b=this.j();return b.toString()},j:function(){var a=new $.ig.XElement(1,$.ig.XName.prototype.e($.ig.XmlaSoapMessageBuilder.prototype.d,$.ig.XmlaSoapMessageBuilder.prototype.g));this.i(a);this.h(a);return a},i:function(a){var b=new $.ig.XElement(1,$.ig.XName.prototype.e($.ig.XmlaSoapMessageBuilder.prototype.e,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 $.ig.XElement(1,$.ig.XName.prototype.e($.ig.XmlaSoapMessageBuilder.prototype.b,a.l().f().b()));a.g(b);var c=new $.ig.XElement(1,$.ig.XName.prototype.e(this.a().name(),$.ig.XmlaNamespace.prototype.a));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.Object.prototype.$type)},true);$.ig.util.defType("XmlaSoapMethod","Object",{g:null,f:null,c:null,b:null,a:null,init:function(){$.ig.Object.prototype.init.call(this);this.c=new $.ig.List$1($.ig.XElement.prototype.$type,0);this.b=new $.ig.List$1($.ig.XElement.prototype.$type,0);this.g=new $.ig.ReadOnlyCollection$1($.ig.XElement.prototype.$type,1,this.c);this.f=new $.ig.ReadOnlyCollection$1($.ig.XElement.prototype.$type,1,this.b);this.a=new $.ig.XmlaPropertiesCollection},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 $ret=$self.properties().tryGetValue(b.a(),d);d=$ret.value;return $ret.ret}()){d.c(b.c())}else{$self.properties().add(b)}}},$type:new $.ig.Type("XmlaSoapMethod",$.ig.Object.prototype.$type,[$.ig.IXmlaSoapMethod.prototype.$type])},true);$.ig.util.defType("XmlaSoapMethodDiscover","XmlaSoapMethod",{k:null,init:function(a){$.ig.XmlaSoapMethod.prototype.init.call(this);this.j($.ig.XmlaSoapMessageHeader.prototype.none);this.n(a);this.k=new $.ig.Dictionary$2(String,$.ig.Object.prototype.$type,0)},l:function(){return this.k},_n:null,n:function(value){if(arguments.length===1){this._n=value;return value}else{return this._n}},name:function(){return $.ig.XmlaSoapMethodDiscover.prototype.m},_j:null,j:function(value){if(arguments.length===1){this._j=value;return value}else{return this._j}},_r:null,r:function(value){if(arguments.length===1){this._r=value;return value}else{return this._r}},construct:function(a){var b=$.ig.XNamespace.prototype.c($.ig.XmlaNamespace.prototype.a);var c=new $.ig.XElement(1,$.ig.XName.prototype.e($.ig.XmlaSoapMethodDiscover.prototype.o,b.b()));c.i(this.n());var d=new $.ig.XElement(1,$.ig.XName.prototype.e($.ig.XmlaSoapMethod.prototype.h,$.ig.XmlaNamespace.prototype.a));var e=new $.ig.XElement(1,$.ig.XName.prototype.e($.ig.XmlaSoapMethod.prototype.i,d.l().f().b()));d.g(e);var f=new $.ig.XElement(1,$.ig.XName.prototype.e($.ig.XmlaSoapMethodDiscover.prototype.q,$.ig.XmlaNamespace.prototype.a));var g=new $.ig.XElement(1,$.ig.XName.prototype.e($.ig.XmlaSoapMethodDiscover.prototype.p,f.l().f().b()));f.g(g);var i=this.properties().getEnumerator();while(i.moveNext()){var h=i.current();e.g(new $.ig.XElement(2,$.ig.XName.prototype.e(h.a(),$.ig.XmlaNamespace.prototype.a),h.c()))}var k=this.k.getEnumerator();while(k.moveNext()){var j=k.current();g.g(new $.ig.XElement(2,$.ig.XName.prototype.e(j.key(),""),j.value()))}this.e().add(c);this.e().add(f);this.e().add(d)},$type:new $.ig.Type("XmlaSoapMethodDiscover",$.ig.XmlaSoapMethod.prototype.$type)},true);$.ig.util.defType("XmlaSoapMethodExecute","XmlaSoapMethod",{init:function(a){$.ig.XmlaSoapMethod.prototype.init.call(this);this.l(a)},name:function(){return $.ig.XmlaSoapMethodExecute.prototype.k},_l:null,l:function(value){if(arguments.length===1){this._l=value;return value}else{return this._l}},construct:function(a){var b=$.ig.XNamespace.prototype.c($.ig.XmlaNamespace.prototype.a);var c=new $.ig.XElement(1,$.ig.XName.prototype.e($.ig.XmlaSoapMethodExecute.prototype.j,b.b()));var d=new $.ig.XElement(1,$.ig.XName.prototype.e($.ig.XmlaSoapMethodExecute.prototype.m,b.b()));d.i(this.l());c.g(d);var e=new $.ig.XElement(1,$.ig.XName.prototype.e($.ig.XmlaSoapMethod.prototype.h,$.ig.XmlaNamespace.prototype.a));var f=new $.ig.XElement(1,$.ig.XName.prototype.e($.ig.XmlaSoapMethod.prototype.i,e.l().f().b()));e.g(f);var h=this.properties().getEnumerator();while(h.moveNext()){var g=h.current();f.g(new $.ig.XElement(2,$.ig.XName.prototype.e(g.a(),$.ig.XmlaNamespace.prototype.a),g.c()))}this.e().add(c);this.e().add(e)},$type:new $.ig.Type("XmlaSoapMethodExecute",$.ig.XmlaSoapMethod.prototype.$type)},true);$.ig.util.defType("XmlaSoapWebClient","Object",{staticInit:function(){$.ig.XmlaSoapWebClient.prototype.a=new $.ig.List$1(String,0)},$type:new $.ig.Type("XmlaSoapWebClient",$.ig.Object.prototype.$type)},true);$.ig.util.defType("XmlaSoapWebClient$1","XmlaSoapWebClient",{$t:null,f:null,b:false,init:function($t,a,b){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.XmlaSoapWebClient.prototype.init.call(this);this.f=new $.ig.WebClient;this.f.d(b);this.f.uploadStringCompleted=$.ig.Delegate.prototype.combine(this.f.uploadStringCompleted,this.l.runOn(this));this.g(a)},requestCompleted:null,_e:null,e:function(value){if(arguments.length===1){this._e=value;return value}else{return this._e}},_g:null,g:function(value){if(arguments.length===1){this._g=value;return value}else{return this._g}},c:function(){return this.b},j:function(a){this.k(a,null)},k:function(a,b){var c=new $.ig.XmlaSoapMessageBuilder;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=$.ig.XDocument.prototype.i(a.result());var f=e.h($.ig.XName.prototype.e("Envelope","http://schemas.xmlsoap.org/soap/envelope/"));var g=f.h($.ig.XName.prototype.e("Body","http://schemas.xmlsoap.org/soap/envelope/"));var h=g.h($.ig.XName.prototype.e("Fault","http://schemas.xmlsoap.org/soap/envelope/"));if(h!=null){var i=new $.ig.XmlaSoapFaultXmlTypeSerializer;var j=i.deserialize(h);c=new $.ig.FaultException$1($.ig.XmlaSoapFault.prototype.$type,j,new $.ig.FaultReason(j.d()),new $.ig.FaultCode(j.c()),null)}else{if(this.$t==$.ig.DiscoverResponseResult.prototype.$type){var k=g.h($.ig.XName.prototype.e("DiscoverResponse",$.ig.XmlaNamespace.prototype.a));var l=k.h($.ig.XName.prototype.e("return",$.ig.XmlaNamespace.prototype.a));var m=l.h($.ig.XName.prototype.e("root",$.ig.XmlaNamespace.prototype.e));var n=new $.ig.DiscoverResponseResult;n.returnElement(m);b=n}if(this.$t==$.ig.ExecuteResponseResult.prototype.$type){var o=g.h($.ig.XName.prototype.e("ExecuteResponse",$.ig.XmlaNamespace.prototype.a));var p=o.h($.ig.XName.prototype.e("return",$.ig.XmlaNamespace.prototype.a));var q=p.h($.ig.XName.prototype.e("root",$.ig.XmlaNamespace.prototype.d));var r=new $.ig.ExecuteResponseResult;r.returnElement(q);b=r}}}catch(e_){d=e_}}if(d==null){d=a.error()!=null?a.error():c}var s=new $.ig.RequestCompletedEventArgs$1(this.$t,b,d,a.cancelled(),a.userState());this.h(s)},$type:new $.ig.Type("XmlaSoapWebClient$1",$.ig.XmlaSoapWebClient.prototype.$type)},true);$.ig.util.defType("XmlaSoapWebClient","Object",{staticInit:function(){$.ig.XmlaSoapWebClient.prototype.a=new $.ig.List$1(String,0)},$type:new $.ig.Type("XmlaSoapWebClient",$.ig.Object.prototype.$type)},true);$.ig.util.defType("XmlaSoapWebClient$1","XmlaSoapWebClient",{$t:null,f:null,b:false,init:function($t,a,b){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.XmlaSoapWebClient.prototype.init.call(this);this.f=new $.ig.WebClient;this.f.d(b);this.f.uploadStringCompleted=$.ig.Delegate.prototype.combine(this.f.uploadStringCompleted,this.l.runOn(this));this.g(a)},requestCompleted:null,_e:null,e:function(value){if(arguments.length===1){this._e=value;return value}else{return this._e}},_g:null,g:function(value){if(arguments.length===1){this._g=value;return value}else{return this._g}},c:function(){return this.b},j:function(a){this.k(a,null)},k:function(a,b){var c=new $.ig.XmlaSoapMessageBuilder;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=$.ig.XDocument.prototype.i(a.result());var f=e.h($.ig.XName.prototype.e("Envelope","http://schemas.xmlsoap.org/soap/envelope/"));var g=f.h($.ig.XName.prototype.e("Body","http://schemas.xmlsoap.org/soap/envelope/"));var h=g.h($.ig.XName.prototype.e("Fault","http://schemas.xmlsoap.org/soap/envelope/"));if(h!=null){var i=new $.ig.XmlaSoapFaultXmlTypeSerializer;var j=i.deserialize(h);c=new $.ig.FaultException$1($.ig.XmlaSoapFault.prototype.$type,j,new $.ig.FaultReason(j.d()),new $.ig.FaultCode(j.c()),null)}else{if(this.$t==$.ig.DiscoverResponseResult.prototype.$type){var k=g.h($.ig.XName.prototype.e("DiscoverResponse",$.ig.XmlaNamespace.prototype.a));var l=k.h($.ig.XName.prototype.e("return",$.ig.XmlaNamespace.prototype.a));var m=l.h($.ig.XName.prototype.e("root",$.ig.XmlaNamespace.prototype.e));var n=new $.ig.DiscoverResponseResult;n.returnElement(m);b=n}if(this.$t==$.ig.ExecuteResponseResult.prototype.$type){var o=g.h($.ig.XName.prototype.e("ExecuteResponse",$.ig.XmlaNamespace.prototype.a));var p=o.h($.ig.XName.prototype.e("return",$.ig.XmlaNamespace.prototype.a));var q=p.h($.ig.XName.prototype.e("root",$.ig.XmlaNamespace.prototype.d));var r=new $.ig.ExecuteResponseResult;r.returnElement(q);b=r}}}catch(e_){d=e_}}if(d==null){d=a.error()!=null?a.error():c}var s=new $.ig.RequestCompletedEventArgs$1(this.$t,b,d,a.cancelled(),a.userState());this.h(s)},$type:new $.ig.Type("XmlaSoapWebClient$1",$.ig.XmlaSoapWebClient.prototype.$type)},true);$.ig.util.defType("IMdxExpression","Object",{$type:new $.ig.Type("IMdxExpression",null)},true);$.ig.util.defType("IMdxElement","Object",{$type:new $.ig.Type("IMdxElement",null,[$.ig.IMdxExpression.prototype.$type])},true);$.ig.util.defType("IAxisFilterElement","Object",{$type:new $.ig.Type("IAxisFilterElement",null,[$.ig.IMdxElement.prototype.$type])},true);$.ig.util.defType("IMdxAxis","Object",{$type:new $.ig.Type("IMdxAxis",null,[$.ig.IMdxExpression.prototype.$type])},true);$.ig.util.defType("IMdxAxisProvider","Object",{$type:new $.ig.Type("IMdxAxisProvider",null)},true);$.ig.util.defType("IMdxCollectionElement","Object",{$type:new $.ig.Type("IMdxCollectionElement",null,[$.ig.IMdxElement.prototype.$type])},true);$.ig.util.defType("IMdxDimensionAxisProvider","Object",{$type:new $.ig.Type("IMdxDimensionAxisProvider",null,[$.ig.IMdxAxisProvider.prototype.$type])},true);$.ig.util.defType("IMdxFilterInfo","Object",{$type:new $.ig.Type("IMdxFilterInfo",null)},true);$.ig.util.defType("IMdxExtendedFilterInfo","Object",{$type:new $.ig.Type("IMdxExtendedFilterInfo",null,[$.ig.IMdxFilterInfo.prototype.$type])},true);$.ig.util.defType("IMdxItemElement","Object",{$type:new $.ig.Type("IMdxItemElement",null,[$.ig.IMdxElement.prototype.$type])},true);$.ig.util.defType("IMdxSet","Object",{$type:new $.ig.Type("IMdxSet",null,[$.ig.IMdxExpression.prototype.$type])},true);$.ig.util.defType("MdxAxis","Object",{e:null,f:null,d:false,i:null,h:0,c:null,init:function(initNumber,a){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}this.c=function(){var $ret=new Array;$ret.add("COLUMNS");$ret.add("ROWS");$ret.add("PAGES");return $ret}();$.ig.MdxAxis.prototype.init1.call(this,1,a,new $.ig.MdxDimensionAxisSettings)},init1:function(initNumber,a,b){this.c=function(){var $ret=new Array;$ret.add("COLUMNS");$ret.add("ROWS");$ret.add("PAGES");return $ret}();$.ig.Object.prototype.init.call(this);this.axisIndex(a);this.a(b!=null?b:new $.ig.MdxDimensionAxisSettings);this.e=new $.ig.List$1($.ig.IMdxSet.prototype.$type,0);this.f=new $.ig.ReadOnlyCollection$1($.ig.IMdxSet.prototype.$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}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},b:function(){return $.ig.util.cast($.ig.MdxDimensionAxisSettings.prototype.$type,this.a())},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 $self=this;var $iter=function(){return function(){return{$state:0,$this:$self,$current:null,$a:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$a=this.$this.f.getEnumerator();this.$state=1;break;case 1:this.$state=4;break;case 2:this.$current=this.$a.current();this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$a.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}()};return new $.ig.GenericEnumerable$1($.ig.IMdxSet.prototype.$type,$iter)},addSet:function(a){this.e.add(a);this.d=false},j:function(){var a=new $.ig.StringBuilder;var b=false;var d=this.g().getEnumerator();while(d.moveNext()){var c=d.current();if(!c.isEnabled()){continue}if(b){a.d(",");a.d($.ig.Environment.prototype.a())}a.d(c.mdxExpression());b=true}if(this.g().count()>1){a.h(0,"{");a.d("}")}this.m(a,this.b());this.n(a,this.b());this.l(a,this.b());this.k(a);return a.b()},m:function(a,b){if(b.f()){a.h(0,"Distinct(");a.d(")")}},n:function(a,b){if(b.h()){a.h(0,$.ig.Environment.prototype.a());a.h(0,"NON EMPTY")}},l:function(a,b){if(b.e()){a.d($.ig.Environment.prototype.a());a.d("DIMENSION PROPERTIES");var c=b.j();var d=false;var f=c.getEnumerator();while(f.moveNext()){var e=f.current();a.d($.ig.Environment.prototype.a());if(d){a.d(",")}a.d(e);d=true}}},k:function(a){if(this.axisIndex()<2){a.d($.ig.Environment.prototype.a());a.d(String.concat("ON ",this.c[this.axisIndex()]))}},$type:new $.ig.Type("MdxAxis",$.ig.Object.prototype.$type,[$.ig.IMdxAxis.prototype.$type])},true);$.ig.util.defType("MdxAxisFilterElement","Object",{a:null,b:null,init:function(){$.ig.Object.prototype.init.call(this);this.b=new $.ig.List$1($.ig.IMdxElement.prototype.$type,0);this.singleFilterElements(new $.ig.ReadOnlyCollection$1($.ig.IMdxElement.prototype.$type,1,this.b));this.a=new $.ig.MdxElementCollectionElement},mdxExpression:function(){var $self=this;if($self.a.collectionElements().count()>1){$self.a.b(function(){var $ret=new Array;$ret.add("(");$ret.add(")");return $ret}())}return $self.a.mdxExpression()},_singleFilterElements:null,singleFilterElements:function(value){if(arguments.length===1){this._singleFilterElements=value;return value}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 $.ig.MdxElementType.prototype.filter},$type:new $.ig.Type("MdxAxisFilterElement",$.ig.Object.prototype.$type,[$.ig.IAxisFilterElement.prototype.$type])},true);$.ig.util.defType("MdxCalculatedMembersCache","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.d=new $.ig.List$1(String,0);this.b=new $.ig.Dictionary$2(String,String,0)},d:null,b:null,e:function(a){var b=new $.ig.StringBuilder;var d=a.c().getEnumerator();while(d.moveNext()){var c=d.current();$.ig.MdxCalculatedMembersCache.prototype.f(b,c.key(),c.value())}return b.b()},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 $self=this;var $iter=function(){return function(){return{$state:0,$this:$self,$current:null,$a:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$a=this.$this.b.getEnumerator();this.$state=1;break;case 1:this.$state=4;break;case 2:this.$current=this.$a.current();this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$a.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}()};return new $.ig.GenericEnumerable$1($.ig.KeyValuePair$2.prototype.$type.specialize(String,String),$iter)},a:function(a){return this.d.contains(a)},f:function(a,b,c){a.d(String.concat("MEMBER ",b," AS",$.ig.Environment.prototype.a()));a.d(c);a.d($.ig.Environment.prototype.a())},$type:new $.ig.Type("MdxCalculatedMembersCache",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MdxElement","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.elementType($.ig.MdxElementType.prototype.userDefined)},mdxExpression:function(){},_elementType:null,elementType:function(value){if(arguments.length===1){this._elementType=value;return value}else{return this._elementType}},_sourceItemExpression:null,sourceItemExpression:function(value){if(arguments.length===1){this._sourceItemExpression=value;return value}else{return this._sourceItemExpression}},rebuildExpression:function(){},$type:new $.ig.Type("MdxElement",$.ig.Object.prototype.$type,[$.ig.IMdxItemElement.prototype.$type])},true);$.ig.util.defType("MdxSingleElement","MdxElement",{init:function(initNumber,a,b,c){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$.ig.MdxSingleElement.prototype.init1.call(this,1,a,b,c,$.ig.MdxElementType.prototype.member)},init1:function(initNumber,a,b,c,d){$.ig.MdxElement.prototype.init.call(this);this.a(c);switch(d){case $.ig.MdxElementType.prototype.member:case $.ig.MdxElementType.prototype.calculated:this.sourceItemExpression(a);this.b(b);this.elementType(d);break;default:throw new $.ig.ArgumentException(1,"Element type could be MdxElementType.Member or MdxElementType.Calculated","elementType")}},mdxExpression:function(){return this.sourceItemExpression()},_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_a:0,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},$type:new $.ig.Type("MdxSingleElement",$.ig.MdxElement.prototype.$type)},true);$.ig.util.defType("MdxDimensionMember","MdxSingleElement",{init:function(a,b,c,d,e){$.ig.MdxSingleElement.prototype.init.call(this,a,b,c);this.d(d);this.c(e)},_d:null,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},$type:new $.ig.Type("MdxDimensionMember",$.ig.MdxSingleElement.prototype.$type)},true);$.ig.util.defType("MdxChildrenCollectionElement","MdxDimensionMember",{init:function(a,b,c,d,e){$.ig.MdxDimensionMember.prototype.init.call(this,a,b,c,d,e)},mdxExpression:function(){return String.concat(this.sourceItemExpression(),".Children")},$type:new $.ig.Type("MdxChildrenCollectionElement",$.ig.MdxDimensionMember.prototype.$type)},true);$.ig.util.defType("MdxElementCollectionElement","Object",{d:null,c:false,e:null,a:null,init:function(){$.ig.Object.prototype.init.call(this);this.d=new $.ig.List$1($.ig.IMdxElement.prototype.$type,0);this.collectionElements(new $.ig.ReadOnlyCollection$1($.ig.IMdxElement.prototype.$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(value){if(arguments.length===1){this._collectionElements=value;return value}else{return this._collectionElements}},elementType:function(){return $.ig.MdxElementType.prototype.collection},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){var $self=this;$self.d.add(a);if($self.collectionElements().count()>1){$self.b(function(){var $ret=new Array;$ret.add("{");$ret.add("}");return $ret}())}$self.c=false},f:function(){if(this.collectionElements().count()==0){return String.empty()}var a=new $.ig.StringBuilder;var b=false;var d=this.collectionElements().getEnumerator();while(d.moveNext()){var c=d.current();if(b){a.d(",");a.d($.ig.Environment.prototype.a())}a.d(c.mdxExpression());b=true}if(this.b()!=null&&this.b().length==2){a.h(0,this.b()[0]);a.d(this.b()[1])}return a.b()},$type:new $.ig.Type("MdxElementCollectionElement",$.ig.Object.prototype.$type,[$.ig.IMdxCollectionElement.prototype.$type])},true);$.ig.util.defType("MdxLevelMembersElement","MdxSingleElement",{init:function(a,b,c){$.ig.MdxSingleElement.prototype.init.call(this,a,b,c)},mdxExpression:function(){return String.concat(this.sourceItemExpression(),".MEMBERS")},$type:new $.ig.Type("MdxLevelMembersElement",$.ig.MdxSingleElement.prototype.$type)},true);$.ig.util.defType("MdxQueryBuilder","Object",{a:null,init:function(initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$.ig.MdxQueryBuilder.prototype.init1.call(this,1,new $.ig.MdxSettings)
},init1:function(initNumber,a){$.ig.Object.prototype.init.call(this);this.b(a)},b:function(a){if(arguments.length===1){this.a=a;return a}else{if(this.a==null){this.a=new $.ig.MdxSettings}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 $.ig.StringBuilder;if(!String.isNullOrEmpty(g)){j.d(String.concat("WITH",$.ig.Environment.prototype.a()))}j.d(g);j.d("SELECT");j.d($.ig.Environment.prototype.a());if(a!=null){j.d(a.mdxExpression())}if(b!=null){if(a==null){b.axisIndex(0)}else{j.d(String.concat(",",$.ig.Environment.prototype.a()))}j.d(b.mdxExpression())}j.d($.ig.Environment.prototype.a());j.d(i);if(!String.isNullOrEmpty(h)){j.d($.ig.Environment.prototype.a());j.d(h)}var k=j.b();return k},d:function(a,b,c,d){return $.ig.MdxCalculatedMembersCache.prototype.e(d)},g:function(a,b){var c=String.concat("FROM ","[",b,"]");var d=$.ig.util.cast($.ig.IMdxExtendedFilterInfo.prototype.$type,a);c=this.f(c,a.filtersFilter());if(a.columnsFilter()!=null){c=this.f(c,a.columnsFilter(),a.rowsFilter())}else{c=this.f(c,a.rowsFilter())}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 $.ig.StringBuilder;e.h(0,String.concat("FROM",$.ig.Environment.prototype.a(),"(",$.ig.Environment.prototype.a(),"SELECT",$.ig.Environment.prototype.a()));e.d(String.concat(c.mdxExpression()," ON COLUMNS",$.ig.Environment.prototype.a()));e.d(a);e.d(this.h(b));e.d(String.concat(")",$.ig.Environment.prototype.a()));a=e.b()}}return a},f:function(a,b,c){if(b==null||b.filterCollection().count()==0){return a}var d=new $.ig.StringBuilder;d.d("FROM");d.d($.ig.Environment.prototype.a());d.d("(");d.d($.ig.Environment.prototype.a());d.d("SELECT");d.d($.ig.Environment.prototype.a());d.d(b.mdxExpression());d.d(" ON COLUMNS");if(c!=null&&c.filterCollection().count()>0){d.d($.ig.Environment.prototype.a());d.d(", ");d.d(c.mdxExpression());d.d(" ON ROWS")}d.d($.ig.Environment.prototype.a());d.d(a);d.d($.ig.Environment.prototype.a());d.d(")");return d.b()},h:function(a){var $self=this;var b=new $.ig.MdxElementCollectionElement;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(function(){var $ret=new Array;$ret.add("(");$ret.add(")");return $ret}());return String.concat("WHERE ",b.mdxExpression())},$type:new $.ig.Type("MdxQueryBuilder",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MdxSet","Object",{d:null,e:null,b:false,g:null,init:function(initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$.ig.MdxSet.prototype.init1.call(this,1,new $.ig.MdxSetSettings);this.d=new $.ig.List$1($.ig.IMdxElement.prototype.$type,0);this.e=new $.ig.ReadOnlyCollection$1($.ig.IMdxElement.prototype.$type,1,this.d);this.isEnabled(true)},init1:function(initNumber,a){$.ig.Object.prototype.init.call(this);this.d=new $.ig.List$1($.ig.IMdxElement.prototype.$type,0);this.e=new $.ig.ReadOnlyCollection$1($.ig.IMdxElement.prototype.$type,1,this.d);this.isEnabled(true);this.a(a!=null?a:new $.ig.MdxSetSettings)},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},_isEnabled:false,isEnabled:function(value){if(arguments.length===1){this._isEnabled=value;return value}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 $self=this;var $iter=function(){return function(){return{$state:0,$this:$self,$current:null,$a:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$a=this.$this.d.getEnumerator();this.$state=1;break;case 1:this.$state=4;break;case 2:this.$current=this.$a.current();this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$a.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}()};return new $.ig.GenericEnumerable$1($.ig.IMdxElement.prototype.$type,$iter)},c:function(a){switch(a.elementType()){case $.ig.MdxElementType.prototype.memberTree:case $.ig.MdxElementType.prototype.member:case $.ig.MdxElementType.prototype.calculated:case $.ig.MdxElementType.prototype.collection:return true}return false},h:function(){$.ig.Debug.prototype.b(this.f().count()>0,"MdxSet.Elements collection is empty.");var a=new $.ig.StringBuilder;var b=this.f().item(0);this.j(a,b);for(var c=1;c<this.f().count();c++){a.h(0,"CrossJoin(");a.h(10,$.ig.Environment.prototype.a());a.d(",");a.d($.ig.Environment.prototype.a());var d=this.f().item(c);this.j(a,d);a.d(")")}return a.b()},j:function(a,b){var c=new $.ig.StringBuilder;switch(b.elementType()){case $.ig.MdxElementType.prototype.calculated:var d=b;var e=d.b();c.d("{");c.d(e);c.d("}");break;case $.ig.MdxElementType.prototype.member:c.d("{");c.d(b.mdxExpression());c.d("}");break;case $.ig.MdxElementType.prototype.collection:case $.ig.MdxElementType.prototype.memberTree:c.d(b.mdxExpression());break}if($.ig.util.cast($.ig.MdxLevelMembersElement.prototype.$type,b)!==null||$.ig.util.cast($.ig.MdxChildrenCollectionElement.prototype.$type,b)!==null){this.i(c,b)}switch(b.elementType()){case $.ig.MdxElementType.prototype.memberTree:case $.ig.MdxElementType.prototype.member:this.k(c,b);break}a.e(c)},k:function(a,b){},i:function(a,b){if(this.a().a()){a.h(0,"AddCalculatedMembers(");a.d(")")}},clone:function(){var a=new $.ig.MdxSet(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.Object.prototype.$type,[$.ig.IMdxSet.prototype.$type])},true);$.ig.util.defType("MdxSettings","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.Object.prototype.init.call(this);this.a(new $.ig.MdxDimensionAxisSettings);this.b(new $.ig.MdxDimensionAxisSettings);this.c(new $.ig.MdxSlicerAxisSettings);this.y(true);this.x(true);var a=new $.ig.ObservableCollection$1(String,0);a.collectionChanged=$.ig.Delegate.prototype.combine(a.collectionChanged,this.ae.runOn(this));this.ac(a);var b=new $.ig.ObservableCollection$1(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(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}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(value){if(arguments.length===1){this._ac=value;return value}else{return this._ac}},_ab:null,ab:function(value){if(arguments.length===1){this._ab=value;return value}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.Object.prototype.$type)},true);$.ig.util.defType("MdxAxisSettings","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("MdxAxisSettings",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MdxSlicerAxisSettings","MdxAxisSettings",{init:function(){$.ig.MdxAxisSettings.prototype.init.call(this)},$type:new $.ig.Type("MdxSlicerAxisSettings",$.ig.MdxAxisSettings.prototype.$type)},true);$.ig.util.defType("MdxDimensionAxisSettings","MdxAxisSettings",{c:false,b:false,init:function(){$.ig.MdxAxisSettings.prototype.init.call(this);this.j(new $.ig.List$1(String,0));this.a(new $.ig.MdxSetSettings)},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},_g:false,g:function(value){if(arguments.length===1){this._g=value;return value}else{return this._g}},_f:false,f:function(value){if(arguments.length===1){this._f=value;return value}else{return this._f}},_h:false,h:function(value){if(arguments.length===1){this._h=value;return value}else{return this._h}},_e:false,e:function(value){if(arguments.length===1){this._e=value;return value}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(value){if(arguments.length===1){this._j=value;return value}else{return this._j}},$type:new $.ig.Type("MdxDimensionAxisSettings",$.ig.MdxAxisSettings.prototype.$type)},true);$.ig.util.defType("MdxSetSettings","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_b:false,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_a:false,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},$type:new $.ig.Type("MdxSetSettings",$.ig.Object.prototype.$type)},true);$.ig.util.defType("IMdxSlicerAxis","Object",{$type:new $.ig.Type("IMdxSlicerAxis",null,[$.ig.IMdxExtendedFilterInfo.prototype.$type])},true);$.ig.util.defType("MdxSlicerAxis","MdxAxis",{init:function(a){$.ig.MdxAxis.prototype.init1.call(this,1,2,a)},_columnsFilter:null,columnsFilter:function(value){if(arguments.length===1){this._columnsFilter=value;return value}else{return this._columnsFilter}},_rowsFilter:null,rowsFilter:function(value){if(arguments.length===1){this._rowsFilter=value;return value}else{return this._rowsFilter}},_filtersFilter:null,filtersFilter:function(value){if(arguments.length===1){this._filtersFilter=value;return value}else{return this._filtersFilter}},_measureFilter:null,measureFilter:function(value){if(arguments.length===1){this._measureFilter=value;return value}else{return this._measureFilter}},_filterElements:null,filterElements:function(value){if(arguments.length===1){this._filterElements=value;return value}else{return this._filterElements}},$type:new $.ig.Type("MdxSlicerAxis",$.ig.MdxAxis.prototype.$type,[$.ig.IMdxSlicerAxis.prototype.$type])},true);$.ig.util.defType("MdxSlicerSet","MdxSet",{init:function(){$.ig.MdxSet.prototype.init.call(this)},c:function(a){return $.ig.util.cast($.ig.IAxisFilterElement.prototype.$type,a)!==null},$type:new $.ig.Type("MdxSlicerSet",$.ig.MdxSet.prototype.$type)},true);$.ig.util.defType("MdxDimensionAxisProvider","Object",{h:null,k:null,l:0,init:function(initNumber,a,b,c,d){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}this.h=new $.ig.Dictionary$2(String,$.ig.MdxElementCollectionElement.prototype.$type,0);this.k=new $.ig.List$1(String,0);this.l=-1;$.ig.Object.prototype.init.call(this);if(a==null){throw new $.ig.ArgumentNullException("xmlaDataSource")}this.b(a);this.g(b);this.i(c);this.d(d)},init1:function(initNumber,a,b,c){this.h=new $.ig.Dictionary$2(String,$.ig.MdxElementCollectionElement.prototype.$type,0);this.k=new $.ig.List$1(String,0);this.l=-1;$.ig.Object.prototype.init.call(this);this.g(b);this.a(a);this.j(c)},_e:null,e:function(value){if(arguments.length===1){this._e=value;return value}else{return this._e}},_g:null,g:function(value){if(arguments.length===1){this._g=value;return value}else{return this._g}},_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_i:null,i:function(value){if(arguments.length===1){this._i=value;return value}else{return this._i}},c:null,d:function(a){if(arguments.length===1){this.c=a;this.e(null);return a}else{return this.c}},_j:null,j:function(value){if(arguments.length===1){this._j=value;return value}else{return this._j}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},extendAxis:function(a,b){var $self=this;var c=a;var d=$self.j();var e=$self.a().positionResolver();var f=new $.ig.MdxAxis(1,a.axisIndex(),$self.g());var h=d.getEnumerator();while(h.moveNext()){var g=h.current();var i=new $.ig.MdxSet(1,c.a().a());var j=new $.ig.List$1($.ig.IMdxSet.prototype.$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 $.ig.MdxChildrenCollectionElement(l.key(),l.key(),-1,null,null);i.addElement(n);break}n=new $.ig.MdxSingleElement(0,l.key(),l.key(),l.depth());i.addElement(n)}var o=k.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(p){return p.key()==g.key()}).firstOrDefault$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type));if(o!=null){if(o.count()==0){j.add(i)}else{$self.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},s:function(a,b){if(this.l!=0){var c=new $.ig.MdxSet(1,this.g().a());if(this.l==-1){b.add(c)}this.r(a,c,b);this.p(a,new $.ig.MdxSet(1,this.g().a()),b,true,false,true)}else{this.p(a,new $.ig.MdxSet(1,this.g().a()),b,false,false,true)}},r:function(a,b,c){var $self=this;var d=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(e){return e.positionItemDepth()==a.positionItemDepthMin()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type));if(d.count()==0){return}if($self.l==a.positionItemIndex()+1){var f=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(g){return g.positionItemDepth()==0}).getEnumerator();while(f.moveNext()){var e=f.current();var g=b.clone();var h=new $.ig.MdxSingleElement(0,e.positionItem().key(),e.positionItem().key(),0);g.addElement(h);c.add(g);$self.t(e);if(e.count()==0){$self.n($self.i(),e.positionItemIndex()+1,g)}else{$self.r(e,g,c)}}}else{var i=d.item(0);var j=new $.ig.MdxLevelMembersElement(i.hierarchyLevelKey(),i.hierarchyLevelKey(),a.positionItemDepthMin());b.addElement(j);$self.t(i);if(i.count()==0){if($self.l!=-1){c.add(b)}$self.n($self.i(),i.positionItemIndex()+1,b)}else{$self.r(i,b,c)}}},createAxis:function(a){if(this.e()!=null){return this.e()}if(this.d()==null){this.e(this.createAxis1(a,this.i()));return this.e()}this.q(a);this.t(this.d());if(this.d().count()==0){this.e(this.createAxis1(a,this.i()));return this.e()}var b=new $.ig.List$1($.ig.IMdxSet.prototype.$type,0);this.s(this.d(),b);var c=new $.ig.MdxAxis(1,a,this.g());var e=b.getEnumerator();while(e.moveNext()){var d=e.current();c.addSet(d)}this.e(c);return c},q: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()==$.ig.MeasureListLocation.prototype.columns){this.l=this.b().measureListIndex()}}else if(c&&this.b().measureListLocation()==$.ig.MeasureListLocation.prototype.rows){this.l=this.b().measureListIndex()}}else if(a==1&&c&&this.b().measureListLocation()==$.ig.MeasureListLocation.prototype.rows){this.l=this.b().measureListIndex()}}var f=this.b().measures().getEnumerator();while(f.moveNext()){var e=f.current();this.k.add(e.uniqueName())}},t:function(a){if(this.i()!=null){var b=a.positionItemIndex()+1;if(b<this.i().count()){var c=this.i().item(b);var d=$.ig.util.cast($.ig.MeasureList.prototype.$type,c);if(d!=null){var e=a.values().toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type));var g=e.getEnumerator();while(g.moveNext()){var f=g.current();if(!this.k.contains(f.key())){a.remove(f.key())}}}var h=$.ig.util.cast($.ig.Hierarchy.prototype.$type,c);if(h!=null){var i=a.values().firstOrDefault$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type));if(i!=null){if(i.hierarchyKey()!=h.uniqueName()){a.clear()}}}}else{a.clear()}}},createAxis1:function(a,b){var c=new $.ig.MdxSet(1,this.g().a());this.n(b,0,c);var d=new $.ig.MdxAxis(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=$.ig.util.cast($.ig.Hierarchy.prototype.$type,e);if(f!=null){if(f.allMember()==null){var g=$self.b().getCoreElements(function(h){return h.hierarchyUniqueName()==f.uniqueName()},$.ig.Level.prototype.$type).toList$1($.ig.ICoreOlapElement.prototype.$type);var h=g.item(0);c.addElement(new $.ig.MdxLevelMembersElement(h.uniqueName(),h.uniqueName(),0))}else{c.addElement(new $.ig.MdxSingleElement(0,f.defaultMember(),f.defaultMember(),0))}continue}var i=$.ig.util.cast($.ig.Level.prototype.$type,e);if(i!=null){var j;if(!function(){var $ret=$self.h.tryGetValue(i.hierarchyUniqueName(),j);j=$ret.value;return $ret.ret}()){j=new $.ig.MdxElementCollectionElement;c.addElement(j);$self.h.add(i.hierarchyUniqueName(),j)}j.addElement(new $.ig.MdxLevelMembersElement(i.uniqueName(),i.uniqueName(),i.depth()));continue}var k=$.ig.util.cast($.ig.MeasureList.prototype.$type,e);if(k!=null){var l=new $.ig.MdxElementCollectionElement;var n=k.measures().getEnumerator();while(n.moveNext()){var m=n.current();l.addElement(new $.ig.MdxSingleElement(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 $.ig.MdxSingleElement(0,b.key(),b.key(),b.positionItemDepth()));this.t(b);if(b.count()==0){if(e){if(f){d.add(h);this.n(this.i(),b.positionItemIndex()+1,h)}}else{d.add(h);this.n(this.i(),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 $self=this;var e=c.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(f){return f.parentKey()==a.key()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type));if(e.count()>0){var f=d.clone();f.addElement(new $.ig.MdxChildrenCollectionElement(a.key(),a.key(),a.positionItemDepth(),null,null));$self.t(a);if(a.count()==0){b.add(f);$self.n($self.i(),a.positionItemIndex()+1,f)}else{$self.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 $.ig.MdxSingleElement(0,g.key(),g.key(),g.positionItemDepth()));$self.t(g);if(g.isExpanded()){$self.m(g,b,c,d)}$self.p(g,i,b,true,false,true)}},p:function(a,b,c,d,e,f){var $self=this;var g=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(h){return h.positionItemDepth()==a.positionItemDepthMin()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type));if(g.count()==0){return}var i=g.getEnumerator();while(i.moveNext()){var h=i.current();$self.o(a,h,b,c,d,e,f)}},$type:new $.ig.Type("MdxDimensionAxisProvider",$.ig.Object.prototype.$type,[$.ig.IMdxDimensionAxisProvider.prototype.$type])},true);$.ig.util.defType("MdxSlicerAxisProvider","Object",{c:null,e:null,d:null,init:function(a,b,c,d,e){this.c=new $.ig.List$1($.ig.AxisElement.prototype.$type,0);this.e=new $.ig.List$1($.ig.AxisElement.prototype.$type,0);this.d=new $.ig.List$1($.ig.AxisElement.prototype.$type,0);$.ig.Object.prototype.init.call(this);this.a(a);this.b(e);this.c=b;this.e=c;this.d=d},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},createAxis:function(a){var b=new $.ig.MdxSlicerAxis(this.b().c());b.axisIndex(a);b.columnsFilter($.ig.MdxSlicerAxisBuilder.prototype.a(this.c,b));b.rowsFilter($.ig.MdxSlicerAxisBuilder.prototype.a(this.e,b));b.filtersFilter($.ig.MdxSlicerAxisBuilder.prototype.a(this.d,b));b.measureFilter($.ig.MdxSlicerAxisBuilder.prototype.b(this.a().measures(),b));return b},$type:new $.ig.Type("MdxSlicerAxisProvider",$.ig.Object.prototype.$type,[$.ig.IMdxAxisProvider.prototype.$type])},true);$.ig.util.defType("MdxSlicerAxisBuilder","Object",{init:function(){$.ig.Object.prototype.init.call(this)},b:function(a,b){if(a.count$1($.ig.Measure.prototype.$type)==0){return null}var c=new $.ig.MdxAxisFilterElement;var d=new $.ig.MdxElementCollectionElement;var f=a.getEnumerator();while(f.moveNext()){var e=f.current();var g=new $.ig.MdxSingleElement(0,e.uniqueName(),e.uniqueName(),0);d.addElement(g)}var h=new $.ig.MdxSlicerSet;h.addElement(c);b.addSet(h);c.addFilterPart(d,true);return c},a:function(a,b){var $self=this;var c=new $.ig.MdxAxisFilterElement;for(var d=0;d<a.count();d++){var e=a.item(d);var f=new $.ig.MdxElementCollectionElement;var g=new $.ig.Dictionary$2(String,$.ig.MdxSingleElement.prototype.$type,0);var i=e.a().getEnumerator();while(i.moveNext()){var h=i.current();var j;if(!function(){var $ret=g.tryGetValue(h,j);j=$ret.value;return $ret.ret}()){j=new $.ig.MdxSingleElement(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 $.ig.MdxSlicerSet;k.addElement(c);b.addSet(k);return c},$type:new $.ig.Type("MdxSlicerAxisBuilder",$.ig.Object.prototype.$type)},true);$.ig.util.defType("IXmlaDataProviderFactory","Object",{$type:new $.ig.Type("IXmlaDataProviderFactory",null,[$.ig.IOlapDataProviderFactory.prototype.$type])},true);$.ig.util.defType("DefaultXmlaDataProviderFactory","Object",{b:null,a:null,init:function(a,b){$.ig.Object.prototype.init.call(this);this.b=a;this.a=b},createDataProvider:function(){return new $.ig.XmlaDataProvider(new $.ig.XmlaConnection(new $.ig.Uri(this.b),this.a),null)},$type:new $.ig.Type("DefaultXmlaDataProviderFactory",$.ig.Object.prototype.$type,[$.ig.IXmlaDataProviderFactory.prototype.$type])},true);$.ig.util.defType("RemoteXmlaDataProviderFactory","Object",{a:null,b:null,d:null,c:null,init:function(initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$.ig.Object.prototype.init.call(this);this.a=new $.ig.JsonRemoteRequestSerializer;this.b=new $.ig.JsonRemoteResponseSerializer},init1:function(initNumber,a,b){$.ig.Object.prototype.init.call(this);this.a=new $.ig.JsonRemoteRequestSerializer;this.b=new $.ig.JsonRemoteResponseSerializer;this.d=a;this.c=b},init2:function(initNumber,a,b){$.ig.Object.prototype.init.call(this);this.a=a;this.b=b},createDataProvider:function(){return new $.ig.RemoteXmlaDataProvder(this.d,this.c,this.a,this.b)},$type:new $.ig.Type("RemoteXmlaDataProviderFactory",$.ig.Object.prototype.$type,[$.ig.IXmlaDataProviderFactory.prototype.$type])},true);$.ig.util.defType("IRemoteRequestSerializer","Object",{$type:new $.ig.Type("IRemoteRequestSerializer",null)},true);$.ig.util.defType("IRemoteResponseSerializer","Object",{$type:new $.ig.Type("IRemoteResponseSerializer",null)},true);$.ig.util.defType("JsonRemoteRequestSerializer","Object",{a:null,init:function(){$.ig.Object.prototype.init.call(this);this.a=new $.ig.JavaScriptSerializer},serializeRequest:function(a){return $.ig.RemoteRequestJsonTypeSeriazlier.prototype.b().serialize(a,this.a)},deserializeRequest:function(a){return $.ig.RemoteRequestJsonTypeSeriazlier.prototype.b().deserialize(a,this.a)},$type:new $.ig.Type("JsonRemoteRequestSerializer",$.ig.Object.prototype.$type,[$.ig.IRemoteRequestSerializer.prototype.$type])},true);$.ig.util.defType("JsonRemoteResponseSerializer","Object",{a:null,init:function(){$.ig.Object.prototype.init.call(this);this.a=new $.ig.JavaScriptSerializer},serializeResponse:function(a,b){switch(b){case $.ig.RemoteRequestType.prototype.discoverCatalogs:return $.ig.ArrayJsonSerializer.prototype.b().f($.ig.Catalog.prototype.$type,a,$.ig.CatalogJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteRequestType.prototype.discoverCubes:return $.ig.ArrayJsonSerializer.prototype.b().f($.ig.Cube.prototype.$type,a,$.ig.CubeJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteRequestType.prototype.discoverDimensions:return $.ig.ArrayJsonSerializer.prototype.b().f($.ig.Dimension.prototype.$type,a,$.ig.DimensionJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteRequestType.prototype.discoverHierarchies:return $.ig.ArrayJsonSerializer.prototype.b().f($.ig.Hierarchy.prototype.$type,a,$.ig.HierarchyJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteRequestType.prototype.discoverLevels:return $.ig.ArrayJsonSerializer.prototype.b().f($.ig.Level.prototype.$type,a,$.ig.LevelJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteRequestType.prototype.discoverMeasures:return $.ig.ArrayJsonSerializer.prototype.b().f($.ig.Measure.prototype.$type,a,$.ig.MeasureJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteRequestType.prototype.discoverMeasureGroups:return $.ig.ArrayJsonSerializer.prototype.b().f($.ig.MeasureGroup.prototype.$type,a,$.ig.MeasureGroupJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteRequestType.prototype.discoverMeasureGroupDimensions:return $.ig.ArrayJsonSerializer.prototype.b().f($.ig.MeasureGroupDimension.prototype.$type,a,$.ig.MeasureGroupDimensionJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteRequestType.prototype.discoverMembers:return $.ig.ArrayJsonSerializer.prototype.b().f($.ig.Member.prototype.$type,a,$.ig.MemberJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteRequestType.prototype.discoverKpis:return $.ig.ArrayJsonSerializer.prototype.b().f($.ig.Kpi.prototype.$type,a,$.ig.KpiJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteRequestType.prototype.executeStatement:return $.ig.ResultJsonTypeSeriazlier.prototype.b().serialize(a,this.a);default:throw new $.ig.Error(1,"Unknown RemoteXmlaRequestType.")}},deserializeResponse:function(a,b){switch(b){case $.ig.RemoteRequestType.prototype.discoverCatalogs:return $.ig.ArrayJsonSerializer.prototype.b().d($.ig.Catalog.prototype.$type,a,$.ig.CatalogJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteRequestType.prototype.discoverCubes:return $.ig.ArrayJsonSerializer.prototype.b().d($.ig.Cube.prototype.$type,a,$.ig.CubeJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteRequestType.prototype.discoverDimensions:return $.ig.ArrayJsonSerializer.prototype.b().d($.ig.Dimension.prototype.$type,a,$.ig.DimensionJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteRequestType.prototype.discoverHierarchies:return $.ig.ArrayJsonSerializer.prototype.b().d($.ig.Hierarchy.prototype.$type,a,$.ig.HierarchyJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteRequestType.prototype.discoverLevels:return $.ig.ArrayJsonSerializer.prototype.b().d($.ig.Level.prototype.$type,a,$.ig.LevelJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteRequestType.prototype.discoverMeasures:return $.ig.ArrayJsonSerializer.prototype.b().d($.ig.Measure.prototype.$type,a,$.ig.MeasureJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteRequestType.prototype.discoverMeasureGroups:return $.ig.ArrayJsonSerializer.prototype.b().d($.ig.MeasureGroup.prototype.$type,a,$.ig.MeasureGroupJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteRequestType.prototype.discoverMeasureGroupDimensions:return $.ig.ArrayJsonSerializer.prototype.b().d($.ig.MeasureGroupDimension.prototype.$type,a,$.ig.MeasureGroupDimensionJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteRequestType.prototype.discoverMembers:return $.ig.ArrayJsonSerializer.prototype.b().d($.ig.Member.prototype.$type,a,$.ig.MemberJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteRequestType.prototype.discoverKpis:return $.ig.ArrayJsonSerializer.prototype.b().d($.ig.Kpi.prototype.$type,a,$.ig.KpiJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteRequestType.prototype.executeStatement:return $.ig.ResultJsonTypeSeriazlier.prototype.b().deserialize(a,this.a);default:throw new $.ig.Error(1,"Unknown RemoteXmlaRequestType.")}},$type:new $.ig.Type("JsonRemoteResponseSerializer",$.ig.Object.prototype.$type,[$.ig.IRemoteResponseSerializer.prototype.$type])},true);$.ig.util.defType("ArrayJsonSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},b:function(){return $.ig.ArrayJsonSerializer.prototype.a},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.c($t,a,b);return c.b(d)},e:function($t,a,b){var c=new $.ig.List$1($t,0);for(var d=0;d<a.length;d++){var e=a[d];c.add(b.fromJsonObject(e))}return c},c:function($t,a,b){var c=a.toArray$1($t);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.Object.prototype.$type)},true);$.ig.util.defType("IJsonTypeSerializer$1","Object",{$type:new $.ig.Type("IJsonTypeSerializer$1",null)},true);$.ig.util.defType("JsonTypeSeriazlierBase$1","Object",{$t:null,init:function($t){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.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.Object.prototype.$type,[$.ig.IJsonTypeSerializer$1.prototype.$type.specialize(0)])},true);$.ig.util.defType("AxisJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.OlapResultAxis.prototype.$type)},b:function(){return $.ig.AxisJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;var b=$.ig.JsonSerializerUtils.prototype.d(a,"n");var c=$.ig.ArrayJsonSerializer.prototype.b().e($.ig.OlapResultTuple.prototype.$type,$.ig.JsonSerializerUtils.prototype.d(a,"t"),$.ig.TupleJsonTypeSeriazlier.prototype.b());var d=0;if(c.count()>0){d=c.item(0).members().count()}return function(){var $ret=new $.ig.OlapResultAxis(c,d);$ret.name(b);return $ret}()},toJsonObject:function(a){var b=$.ig.ArrayJsonSerializer.prototype.b().c($.ig.OlapResultTuple.prototype.$type,a.tuples(),$.ig.TupleJsonTypeSeriazlier.prototype.b());var c=$.ig.JsonSerializerUtils.prototype.c();$.ig.JsonSerializerUtils.prototype.f(c,"n",a.name());
$.ig.JsonSerializerUtils.prototype.f(c,"t",b);return c},$type:new $.ig.Type("AxisJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.OlapResultAxis.prototype.$type))},true);$.ig.util.defType("AxisMemberJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.OlapResultAxisMember.prototype.$type)},b:function(){return $.ig.AxisMemberJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;return function(){var $ret=new $.ig.OlapResultAxisMember;$ret.hierarchyUniqueName($.ig.JsonSerializerUtils.prototype.d(a,"hun"));$ret.uniqueName($.ig.JsonSerializerUtils.prototype.d(a,"un"));$ret.levelUniqueName($.ig.JsonSerializerUtils.prototype.d(a,"lun"));$ret.caption($.ig.JsonSerializerUtils.prototype.d(a,"c"));$ret.levelNumber($.ig.JsonSerializerUtils.prototype.d(a,"ln"));$ret.displayInfo($.ig.JsonSerializerUtils.prototype.d(a,"di"));$ret.properties($.ig.JsonSerializerUtils.prototype.b(a,"p"));return $ret}()},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.c();$.ig.JsonSerializerUtils.prototype.f(b,"hun",a.hierarchyUniqueName());$.ig.JsonSerializerUtils.prototype.f(b,"un",a.uniqueName());$.ig.JsonSerializerUtils.prototype.f(b,"lun",a.levelUniqueName());$.ig.JsonSerializerUtils.prototype.f(b,"c",a.caption());$.ig.JsonSerializerUtils.prototype.f(b,"ln",a.levelNumber());$.ig.JsonSerializerUtils.prototype.f(b,"di",a.displayInfo());$.ig.JsonSerializerUtils.prototype.g(b,"p",a.properties());return b},$type:new $.ig.Type("AxisMemberJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.OlapResultAxisMember.prototype.$type))},true);$.ig.util.defType("CatalogJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.Catalog.prototype.$type)},b:function(){return $.ig.CatalogJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;return function(){var $ret=new $.ig.Catalog;$ret.caption($.ig.JsonSerializerUtils.prototype.d(a,"c"));$ret.description($.ig.JsonSerializerUtils.prototype.d(a,"d"));$ret.name($.ig.JsonSerializerUtils.prototype.d(a,"n"));$ret.uniqueName($.ig.JsonSerializerUtils.prototype.d(a,"un"));return $ret}()},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.c();$.ig.JsonSerializerUtils.prototype.f(b,"c",a.caption());$.ig.JsonSerializerUtils.prototype.f(b,"d",a.description());$.ig.JsonSerializerUtils.prototype.f(b,"n",a.name());$.ig.JsonSerializerUtils.prototype.f(b,"un",a.uniqueName());return b},$type:new $.ig.Type("CatalogJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.Catalog.prototype.$type))},true);$.ig.util.defType("CellJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.OlapResultCell.prototype.$type)},b:function(){return $.ig.CellJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;return function(){var $ret=new $.ig.OlapResultCell;$ret.cellOrdinal($.ig.JsonSerializerUtils.prototype.d(a,"co"));$ret.properties($.ig.JsonSerializerUtils.prototype.a(a,"p"));return $ret}()},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.c();$.ig.JsonSerializerUtils.prototype.f(b,"co",a.cellOrdinal());$.ig.JsonSerializerUtils.prototype.e(b,"p",a.properties());return b},$type:new $.ig.Type("CellJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.OlapResultCell.prototype.$type))},true);$.ig.util.defType("CubeJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.Cube.prototype.$type)},b:function(){return $.ig.CubeJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;return function(){var $ret=new $.ig.Cube;$ret.caption($.ig.JsonSerializerUtils.prototype.d(a,"c"));$ret.description($.ig.JsonSerializerUtils.prototype.d(a,"d"));$ret.name($.ig.JsonSerializerUtils.prototype.d(a,"n"));$ret.catalogName($.ig.JsonSerializerUtils.prototype.d(a,"cn"));$ret.cubeType($.ig.JsonSerializerUtils.prototype.d(a,"ct"));$ret.lastProcessed($.ig.JsonSerializerUtils.prototype.d(a,"lp"));$ret.lastUpdated($.ig.JsonSerializerUtils.prototype.d(a,"lu"));return $ret}()},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.c();$.ig.JsonSerializerUtils.prototype.f(b,"c",a.caption());$.ig.JsonSerializerUtils.prototype.f(b,"d",a.description());$.ig.JsonSerializerUtils.prototype.f(b,"n",a.name());$.ig.JsonSerializerUtils.prototype.f(b,"cn",a.catalogName());$.ig.JsonSerializerUtils.prototype.f(b,"ct",a.cubeType());$.ig.JsonSerializerUtils.prototype.f(b,"lp",a.lastProcessed());$.ig.JsonSerializerUtils.prototype.f(b,"lu",a.lastUpdated());return b},$type:new $.ig.Type("CubeJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.Cube.prototype.$type))},true);$.ig.util.defType("DimensionJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.Dimension.prototype.$type)},b:function(){return $.ig.DimensionJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;return function(){var $ret=new $.ig.Dimension;$ret.caption($.ig.JsonSerializerUtils.prototype.d(a,"c"));$ret.description($.ig.JsonSerializerUtils.prototype.d(a,"d"));$ret.name($.ig.JsonSerializerUtils.prototype.d(a,"n"));$ret.uniqueName($.ig.JsonSerializerUtils.prototype.d(a,"un"));$ret.dimensionType($.ig.JsonSerializerUtils.prototype.d(a,"dt"));return $ret}()},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.c();$.ig.JsonSerializerUtils.prototype.f(b,"c",a.caption());$.ig.JsonSerializerUtils.prototype.f(b,"d",a.description());$.ig.JsonSerializerUtils.prototype.f(b,"n",a.name());$.ig.JsonSerializerUtils.prototype.f(b,"un",a.uniqueName());$.ig.JsonSerializerUtils.prototype.f(b,"dt",a.dimensionType());return b},$type:new $.ig.Type("DimensionJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.Dimension.prototype.$type))},true);$.ig.util.defType("HierarchyJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.Hierarchy.prototype.$type)},b:function(){return $.ig.HierarchyJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;return function(){var $ret=new $.ig.Hierarchy;$ret.caption($.ig.JsonSerializerUtils.prototype.d(a,"c"));$ret.description($.ig.JsonSerializerUtils.prototype.d(a,"d"));$ret.name($.ig.JsonSerializerUtils.prototype.d(a,"n"));$ret.uniqueName($.ig.JsonSerializerUtils.prototype.d(a,"un"));$ret.allMember($.ig.JsonSerializerUtils.prototype.d(a,"am"));$ret.defaultMember($.ig.JsonSerializerUtils.prototype.d(a,"dm"));$ret.dimensionUniqueName($.ig.JsonSerializerUtils.prototype.d(a,"dun"));$ret.hierarchyDisplayFolder($.ig.JsonSerializerUtils.prototype.d(a,"hdf"));$ret.hierarchyOrigin($.ig.JsonSerializerUtils.prototype.d(a,"ho"));return $ret}()},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.c();$.ig.JsonSerializerUtils.prototype.f(b,"c",a.caption());$.ig.JsonSerializerUtils.prototype.f(b,"d",a.description());$.ig.JsonSerializerUtils.prototype.f(b,"n",a.name());$.ig.JsonSerializerUtils.prototype.f(b,"un",a.uniqueName());$.ig.JsonSerializerUtils.prototype.f(b,"am",a.allMember());$.ig.JsonSerializerUtils.prototype.f(b,"dm",a.defaultMember());$.ig.JsonSerializerUtils.prototype.f(b,"dun",a.dimensionUniqueName());$.ig.JsonSerializerUtils.prototype.f(b,"hdf",a.hierarchyDisplayFolder());$.ig.JsonSerializerUtils.prototype.f(b,"ho",a.hierarchyOrigin());return b},$type:new $.ig.Type("HierarchyJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.Hierarchy.prototype.$type))},true);$.ig.util.defType("JsonSerializerUtils","Object",{init:function(){$.ig.Object.prototype.init.call(this)},c:function(){return $.ig.jQueryUtils.prototype.createJavascriptObject()},d:function(a,b){return $.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,b)},f:function(a,b,c){$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(a,b,c)},a:function(a,b){return $.ig.jQueryUtils.prototype.convertToObjectDictionary($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,b))},e:function(a,b,c){var d=$.ig.jQueryUtils.prototype.convertFromObjectDictionary(c);$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(a,b,d)},b:function(a,b){return $.ig.jQueryUtils.prototype.convertToStringDictionary($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,b))},g:function(a,b,c){var d=$.ig.jQueryUtils.prototype.convertFromStringDictionary(c);$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(a,b,d)},$type:new $.ig.Type("JsonSerializerUtils",$.ig.Object.prototype.$type)},true);$.ig.util.defType("KpiJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.Kpi.prototype.$type)},b:function(){return $.ig.KpiJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;return function(){var $ret=new $.ig.Kpi;$ret.caption($.ig.JsonSerializerUtils.prototype.d(a,"c"));$ret.description($.ig.JsonSerializerUtils.prototype.d(a,"d"));$ret.name($.ig.JsonSerializerUtils.prototype.d(a,"n"));$ret.uniqueName($.ig.JsonSerializerUtils.prototype.d(a,"un"));$ret.kpiDisplayFolder($.ig.JsonSerializerUtils.prototype.d(a,"kdf"));$ret.measureGroupName($.ig.JsonSerializerUtils.prototype.d(a,"mgn"));$ret.kpiStatusGraphic($.ig.JsonSerializerUtils.prototype.d(a,"ksg"));$ret.kpiTrendGraphic($.ig.JsonSerializerUtils.prototype.d(a,"ktg"));$ret.parentKpiName($.ig.JsonSerializerUtils.prototype.d(a,"pkn"));$ret.kpiGoal($.ig.JsonSerializerUtils.prototype.d(a,"kg"));$ret.kpiStatus($.ig.JsonSerializerUtils.prototype.d(a,"ks"));$ret.kpiTrend($.ig.JsonSerializerUtils.prototype.d(a,"kt"));$ret.kpiValue($.ig.JsonSerializerUtils.prototype.d(a,"kv"));$ret.kpiWeight($.ig.JsonSerializerUtils.prototype.d(a,"kw"));return $ret}()},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.c();$.ig.JsonSerializerUtils.prototype.f(b,"c",a.caption());$.ig.JsonSerializerUtils.prototype.f(b,"d",a.description());$.ig.JsonSerializerUtils.prototype.f(b,"n",a.name());$.ig.JsonSerializerUtils.prototype.f(b,"un",a.uniqueName());$.ig.JsonSerializerUtils.prototype.f(b,"kdf",a.kpiDisplayFolder());$.ig.JsonSerializerUtils.prototype.f(b,"mgn",a.measureGroupName());$.ig.JsonSerializerUtils.prototype.f(b,"ksg",a.kpiStatusGraphic());$.ig.JsonSerializerUtils.prototype.f(b,"ktg",a.kpiTrendGraphic());$.ig.JsonSerializerUtils.prototype.f(b,"pkn",a.parentKpiName());$.ig.JsonSerializerUtils.prototype.f(b,"kg",a.kpiGoal());$.ig.JsonSerializerUtils.prototype.f(b,"ks",a.kpiStatus());$.ig.JsonSerializerUtils.prototype.f(b,"kt",a.kpiTrend());$.ig.JsonSerializerUtils.prototype.f(b,"kv",a.kpiValue());$.ig.JsonSerializerUtils.prototype.f(b,"kw",a.kpiWeight());return b},$type:new $.ig.Type("KpiJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.Kpi.prototype.$type))},true);$.ig.util.defType("LevelJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.Level.prototype.$type)},b:function(){return $.ig.LevelJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;return function(){var $ret=new $.ig.Level;$ret.caption($.ig.JsonSerializerUtils.prototype.d(a,"c"));$ret.description($.ig.JsonSerializerUtils.prototype.d(a,"d"));$ret.name($.ig.JsonSerializerUtils.prototype.d(a,"n"));$ret.uniqueName($.ig.JsonSerializerUtils.prototype.d(a,"un"));$ret.depth($.ig.JsonSerializerUtils.prototype.d(a,"d"));$ret.dimensionUniqueName($.ig.JsonSerializerUtils.prototype.d(a,"dun"));$ret.hierarchyUniqueName($.ig.JsonSerializerUtils.prototype.d(a,"hun"));$ret.levelOrderingProperty($.ig.JsonSerializerUtils.prototype.d(a,"lop"));$ret.levelOrigin($.ig.JsonSerializerUtils.prototype.d(a,"lo"));$ret.membersCount($.ig.JsonSerializerUtils.prototype.d(a,"mc"));return $ret}()},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.c();$.ig.JsonSerializerUtils.prototype.f(b,"c",a.caption());$.ig.JsonSerializerUtils.prototype.f(b,"d",a.description());$.ig.JsonSerializerUtils.prototype.f(b,"n",a.name());$.ig.JsonSerializerUtils.prototype.f(b,"un",a.uniqueName());$.ig.JsonSerializerUtils.prototype.f(b,"d",a.depth());$.ig.JsonSerializerUtils.prototype.f(b,"dun",a.dimensionUniqueName());$.ig.JsonSerializerUtils.prototype.f(b,"hun",a.hierarchyUniqueName());$.ig.JsonSerializerUtils.prototype.f(b,"lop",a.levelOrderingProperty());$.ig.JsonSerializerUtils.prototype.f(b,"lo",a.levelOrigin());$.ig.JsonSerializerUtils.prototype.f(b,"mc",a.membersCount());return b},$type:new $.ig.Type("LevelJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.Level.prototype.$type))},true);$.ig.util.defType("MeasureGroupDimensionJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.MeasureGroupDimension.prototype.$type)},b:function(){return $.ig.MeasureGroupDimensionJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;return function(){var $ret=new $.ig.MeasureGroupDimension;$ret.catalogName($.ig.JsonSerializerUtils.prototype.d(a,"cn"));$ret.cubeName($.ig.JsonSerializerUtils.prototype.d(a,"cbn"));$ret.dimensionCardinality($.ig.JsonSerializerUtils.prototype.d(a,"dc"));$ret.dimensionGranularity($.ig.JsonSerializerUtils.prototype.d(a,"dg"));$ret.dimensionPath($.ig.JsonSerializerUtils.prototype.d(a,"dap"));$ret.dimensionUniqueName($.ig.JsonSerializerUtils.prototype.d(a,"dun"));$ret.isDimensionVisible($.ig.JsonSerializerUtils.prototype.d(a,"idv"));$ret.isFactDimension($.ig.JsonSerializerUtils.prototype.d(a,"iafd"));$ret.measureGroupCardinality($.ig.JsonSerializerUtils.prototype.d(a,"mgc"));$ret.measureGroupName($.ig.JsonSerializerUtils.prototype.d(a,"mgn"));return $ret}()},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.c();$.ig.JsonSerializerUtils.prototype.f(b,"cn",a.catalogName());$.ig.JsonSerializerUtils.prototype.f(b,"cbn",a.cubeName());$.ig.JsonSerializerUtils.prototype.f(b,"dc",a.dimensionCardinality());$.ig.JsonSerializerUtils.prototype.f(b,"dg",a.dimensionGranularity());$.ig.JsonSerializerUtils.prototype.f(b,"dap",a.dimensionPath());$.ig.JsonSerializerUtils.prototype.f(b,"dun",a.dimensionUniqueName());$.ig.JsonSerializerUtils.prototype.f(b,"idv",a.isDimensionVisible());$.ig.JsonSerializerUtils.prototype.f(b,"iafd",a.isFactDimension());$.ig.JsonSerializerUtils.prototype.f(b,"mgc",a.measureGroupCardinality());$.ig.JsonSerializerUtils.prototype.f(b,"mgn",a.measureGroupName());return b},$type:new $.ig.Type("MeasureGroupDimensionJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.MeasureGroupDimension.prototype.$type))},true);$.ig.util.defType("MeasureGroupJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.MeasureGroup.prototype.$type)},b:function(){return $.ig.MeasureGroupJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;return function(){var $ret=new $.ig.MeasureGroup;$ret.caption($.ig.JsonSerializerUtils.prototype.d(a,"c"));$ret.description($.ig.JsonSerializerUtils.prototype.d(a,"d"));$ret.name($.ig.JsonSerializerUtils.prototype.d(a,"n"));$ret.catalogName($.ig.JsonSerializerUtils.prototype.d(a,"cn"));$ret.cubeName($.ig.JsonSerializerUtils.prototype.d(a,"cbn"));return $ret}()},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.c();$.ig.JsonSerializerUtils.prototype.f(b,"c",a.caption());$.ig.JsonSerializerUtils.prototype.f(b,"d",a.description());$.ig.JsonSerializerUtils.prototype.f(b,"n",a.name());$.ig.JsonSerializerUtils.prototype.f(b,"cn",a.catalogName());$.ig.JsonSerializerUtils.prototype.f(b,"cbn",a.cubeName());return b},$type:new $.ig.Type("MeasureGroupJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.MeasureGroup.prototype.$type))},true);$.ig.util.defType("MeasureJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.Measure.prototype.$type)},b:function(){return $.ig.MeasureJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;return function(){var $ret=new $.ig.Measure;$ret.caption($.ig.JsonSerializerUtils.prototype.d(a,"c"));$ret.description($.ig.JsonSerializerUtils.prototype.d(a,"d"));$ret.name($.ig.JsonSerializerUtils.prototype.d(a,"n"));$ret.uniqueName($.ig.JsonSerializerUtils.prototype.d(a,"un"));$ret.aggregatorType($.ig.JsonSerializerUtils.prototype.d(a,"at"));$ret.defaultFormatString($.ig.JsonSerializerUtils.prototype.d(a,"dfs"));$ret.measureDisplayFolder($.ig.JsonSerializerUtils.prototype.d(a,"mdf"));$ret.measureGroupName($.ig.JsonSerializerUtils.prototype.d(a,"mgn"));return $ret}()},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.c();$.ig.JsonSerializerUtils.prototype.f(b,"c",a.caption());$.ig.JsonSerializerUtils.prototype.f(b,"d",a.description());$.ig.JsonSerializerUtils.prototype.f(b,"n",a.name());$.ig.JsonSerializerUtils.prototype.f(b,"un",a.uniqueName());$.ig.JsonSerializerUtils.prototype.f(b,"at",a.aggregatorType());$.ig.JsonSerializerUtils.prototype.f(b,"dfs",a.defaultFormatString());$.ig.JsonSerializerUtils.prototype.f(b,"mdf",a.measureDisplayFolder());$.ig.JsonSerializerUtils.prototype.f(b,"mgn",a.measureGroupName());return b},$type:new $.ig.Type("MeasureJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.Measure.prototype.$type))},true);$.ig.util.defType("MemberJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.Member.prototype.$type)},b:function(){return $.ig.MemberJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;var b=$.ig.util.toNullable($.ig.Number.prototype.$type,null);var c=$.ig.JsonSerializerUtils.prototype.d(a,"s");return function(){var $ret=new $.ig.Member;$ret.caption($.ig.JsonSerializerUtils.prototype.d(a,"c"));$ret.description($.ig.JsonSerializerUtils.prototype.d(a,"d"));$ret.name($.ig.JsonSerializerUtils.prototype.d(a,"n"));$ret.uniqueName($.ig.JsonSerializerUtils.prototype.d(a,"un"));$ret.catalogName($.ig.JsonSerializerUtils.prototype.d(a,"cn"));$ret.childrenCardinality($.ig.JsonSerializerUtils.prototype.d(a,"cc"));$ret.cubeName($.ig.JsonSerializerUtils.prototype.d(a,"cbn"));$ret.dimensionUniqueName($.ig.JsonSerializerUtils.prototype.d(a,"dun"));$ret.hierarchyUniqueName($.ig.JsonSerializerUtils.prototype.d(a,"hun"));$ret.levelDepth($.ig.JsonSerializerUtils.prototype.d(a,"ld"));$ret.levelUniqueName($.ig.JsonSerializerUtils.prototype.d(a,"lun"));$ret.memberType($.ig.JsonSerializerUtils.prototype.d(a,"mt"));$ret.parentLevel($.ig.JsonSerializerUtils.prototype.d(a,"pl"));$ret.parentUniqueName($.ig.JsonSerializerUtils.prototype.d(a,"pun"));$ret.scope(c==null?b:$.ig.Number.prototype.parseInt(c));return $ret}()},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.c();$.ig.JsonSerializerUtils.prototype.f(b,"c",a.caption());$.ig.JsonSerializerUtils.prototype.f(b,"d",a.description());$.ig.JsonSerializerUtils.prototype.f(b,"n",a.name());$.ig.JsonSerializerUtils.prototype.f(b,"un",a.uniqueName());$.ig.JsonSerializerUtils.prototype.f(b,"cn",a.catalogName());$.ig.JsonSerializerUtils.prototype.f(b,"cc",a.childrenCardinality());$.ig.JsonSerializerUtils.prototype.f(b,"cbn",a.cubeName());$.ig.JsonSerializerUtils.prototype.f(b,"dun",a.dimensionUniqueName());$.ig.JsonSerializerUtils.prototype.f(b,"hun",a.hierarchyUniqueName());$.ig.JsonSerializerUtils.prototype.f(b,"ld",a.levelDepth());$.ig.JsonSerializerUtils.prototype.f(b,"lun",a.levelUniqueName());$.ig.JsonSerializerUtils.prototype.f(b,"mt",a.memberType());$.ig.JsonSerializerUtils.prototype.f(b,"pl",a.parentLevel());$.ig.JsonSerializerUtils.prototype.f(b,"pun",a.parentUniqueName());$.ig.JsonSerializerUtils.prototype.f(b,"s",a.scope());return b},$type:new $.ig.Type("MemberJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.Member.prototype.$type))},true);$.ig.util.defType("RemoteRequest","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_d:null,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_e:null,e:function(value){if(arguments.length===1){this._e=value;return value}else{return this._e}},$type:new $.ig.Type("RemoteRequest",$.ig.Object.prototype.$type)},true);$.ig.util.defType("RemoteRequestJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.RemoteRequest.prototype.$type)},b:function(){return $.ig.RemoteRequestJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;return function(){var $ret=new $.ig.RemoteRequest;$ret.a($.ig.JsonSerializerUtils.prototype.d(a,"t"));$ret.c($.ig.JsonSerializerUtils.prototype.b(a,"p"));$ret.d($.ig.JsonSerializerUtils.prototype.b(a,"r"));$ret.b($.ig.JsonSerializerUtils.prototype.b(a,"par"));$ret.e($.ig.JsonSerializerUtils.prototype.d(a,"s"));return $ret}()},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.c();$.ig.JsonSerializerUtils.prototype.f(b,"t",a.a());$.ig.JsonSerializerUtils.prototype.g(b,"p",a.c());$.ig.JsonSerializerUtils.prototype.g(b,"r",a.d());$.ig.JsonSerializerUtils.prototype.g(b,"par",a.b());$.ig.JsonSerializerUtils.prototype.f(b,"s",a.e());return b},$type:new $.ig.Type("RemoteRequestJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.RemoteRequest.prototype.$type))},true);$.ig.util.defType("ResultJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.OlapResult.prototype.$type)},b:function(){return $.ig.ResultJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;var b=$.ig.JsonSerializerUtils.prototype.d(a,"ie");if(b){return function(){var $ret=new $.ig.OlapResult;$ret.isEmpty(true);return $ret}()}else{var c=$.ig.ArrayJsonSerializer.prototype.b().e($.ig.OlapResultAxis.prototype.$type,$.ig.JsonSerializerUtils.prototype.d(a,"a"),$.ig.AxisJsonTypeSeriazlier.prototype.b());var d=$.ig.ArrayJsonSerializer.prototype.b().e($.ig.OlapResultCell.prototype.$type,$.ig.JsonSerializerUtils.prototype.d(a,"c"),$.ig.CellJsonTypeSeriazlier.prototype.b());return function(){var $ret=new $.ig.OlapResult;$ret.axes(c);$ret.cells(d);return $ret}()}},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.c();$.ig.JsonSerializerUtils.prototype.f(b,"ie",a.isEmpty());if(!a.isEmpty()){var c=$.ig.ArrayJsonSerializer.prototype.b().c($.ig.OlapResultAxis.prototype.$type,a.axes(),$.ig.AxisJsonTypeSeriazlier.prototype.b());var d=$.ig.ArrayJsonSerializer.prototype.b().c($.ig.OlapResultCell.prototype.$type,a.cells(),$.ig.CellJsonTypeSeriazlier.prototype.b());$.ig.JsonSerializerUtils.prototype.f(b,"a",c);$.ig.JsonSerializerUtils.prototype.f(b,"c",d)}return b},$type:new $.ig.Type("ResultJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.OlapResult.prototype.$type))},true);$.ig.util.defType("TupleJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.OlapResultTuple.prototype.$type)},b:function(){return $.ig.TupleJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var b=$.ig.ArrayJsonSerializer.prototype.b().e($.ig.OlapResultAxisMember.prototype.$type,$.ig.JsonSerializerUtils.prototype.d(a,"m"),$.ig.AxisMemberJsonTypeSeriazlier.prototype.b());var c=new $.ig.OlapResultTuple(b);var e=b.getEnumerator();while(e.moveNext()){var d=e.current();d.position(c)}return c},toJsonObject:function(a){var b=$.ig.ArrayJsonSerializer.prototype.b().c($.ig.OlapResultAxisMember.prototype.$type,a.members(),$.ig.AxisMemberJsonTypeSeriazlier.prototype.b());var c=$.ig.JsonSerializerUtils.prototype.c();$.ig.JsonSerializerUtils.prototype.f(c,"m",b);return c},$type:new $.ig.Type("TupleJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.OlapResultTuple.prototype.$type))},true);$.ig.util.defType("RemoteXmlaDataProvder","Object",{e:null,d:null,a:null,b:null,init:function(a,b,c,d){$.ig.Object.prototype.init.call(this);this.e=a;this.d=b;this.a=c;this.b=d},discoverCatalogsAsync:function(a,b){var $self=this;var c=$self.b;return $self.f($.ig.RemoteRequestType.prototype.discoverCatalogs,a,b,null,null).j($.ig.IEnumerable$1.prototype.$type.specialize($.ig.Catalog.prototype.$type),function(d){return c.deserializeResponse(d.m(),$.ig.RemoteRequestType.prototype.discoverCatalogs)})},discoverCubesAsync:function(a,b){var $self=this;var c=$self.b;return $self.f($.ig.RemoteRequestType.prototype.discoverCubes,a,b,null,null).j($.ig.IEnumerable$1.prototype.$type.specialize($.ig.Cube.prototype.$type),function(d){return c.deserializeResponse(d.m(),$.ig.RemoteRequestType.prototype.discoverCubes)})},discoverDimensionsAsync:function(a,b){var $self=this;var c=$self.b;return $self.f($.ig.RemoteRequestType.prototype.discoverDimensions,a,b,null,null).j($.ig.IEnumerable$1.prototype.$type.specialize($.ig.Dimension.prototype.$type),function(d){return c.deserializeResponse(d.m(),$.ig.RemoteRequestType.prototype.discoverDimensions)})},discoverHierarchiesAsync:function(a,b){var $self=this;var c=$self.b;return $self.f($.ig.RemoteRequestType.prototype.discoverHierarchies,a,b,null,null).j($.ig.IEnumerable$1.prototype.$type.specialize($.ig.Hierarchy.prototype.$type),function(d){return c.deserializeResponse(d.m(),$.ig.RemoteRequestType.prototype.discoverHierarchies)})},discoverLevelsAsync:function(a,b){var $self=this;var c=$self.b;return $self.f($.ig.RemoteRequestType.prototype.discoverLevels,a,b,null,null).j($.ig.IEnumerable$1.prototype.$type.specialize($.ig.Level.prototype.$type),function(d){return c.deserializeResponse(d.m(),$.ig.RemoteRequestType.prototype.discoverLevels)})},discoverMeasuresAsync:function(a,b){var $self=this;var c=$self.b;return $self.f($.ig.RemoteRequestType.prototype.discoverMeasures,a,b,null,null).j($.ig.IEnumerable$1.prototype.$type.specialize($.ig.Measure.prototype.$type),function(d){return c.deserializeResponse(d.m(),$.ig.RemoteRequestType.prototype.discoverMeasures)})},discoverMeasureGroupsAsync:function(a,b){var $self=this;var c=$self.b;return $self.f($.ig.RemoteRequestType.prototype.discoverMeasureGroups,a,b,null,null).j($.ig.IEnumerable$1.prototype.$type.specialize($.ig.MeasureGroup.prototype.$type),function(d){return c.deserializeResponse(d.m(),$.ig.RemoteRequestType.prototype.discoverMeasureGroups)})},discoverMeasureGroupDimensionsAsync:function(a,b){var $self=this;var c=$self.b;return $self.f($.ig.RemoteRequestType.prototype.discoverMeasureGroupDimensions,a,b,null,null).j($.ig.IEnumerable$1.prototype.$type.specialize($.ig.MeasureGroupDimension.prototype.$type),function(d){return c.deserializeResponse(d.m(),$.ig.RemoteRequestType.prototype.discoverMeasureGroupDimensions)})},discoverMembersAsync:function(a,b){var $self=this;var c=$self.b;return $self.f($.ig.RemoteRequestType.prototype.discoverMembers,a,b,null,null).j($.ig.IEnumerable$1.prototype.$type.specialize($.ig.Member.prototype.$type),function(d){return c.deserializeResponse(d.m(),$.ig.RemoteRequestType.prototype.discoverMembers)})},discoverKpisAsync:function(a,b){var $self=this;var c=$self.b;return $self.f($.ig.RemoteRequestType.prototype.discoverKpis,a,b,null,null).j($.ig.IEnumerable$1.prototype.$type.specialize($.ig.Kpi.prototype.$type),function(d){return c.deserializeResponse(d.m(),$.ig.RemoteRequestType.prototype.discoverKpis)})},executeStatementAsync:function(a,b,c){var $self=this;var d=$self.b;return $self.f($.ig.RemoteRequestType.prototype.executeStatement,b,null,c,a).j($.ig.OlapResult.prototype.$type,function(e){return d.deserializeResponse(e.m(),$.ig.RemoteRequestType.prototype.executeStatement)})},f:function(a,b,c,d,e){var $self=this;var f=function(){var $ret=new $.ig.WebClient;$ret.a($self.d);return $ret}();var g=$self.a.serializeRequest(function(){var $ret=new $.ig.RemoteRequest;$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 $.ig.TaskCompletionSource$1(String,0);f.uploadStringCompleted=$.ig.Delegate.prototype.combine(f.uploadStringCompleted,$self.g.runOn($self));f.h(new $.ig.Uri($self.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 $.ig.Dictionary$2(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.Object.prototype.$type,[$.ig.IXmlaDataProvider.prototype.$type])},true);$.ig.util.defType("XmlaConnection","Object",{b:null,a:null,init:function(a,b){$.ig.Object.prototype.init.call(this);this.b=a;this.a=b},getXmlaSoapWebClient$1:function($t){var a=new $.ig.XmlaSoapWebClient$1($t,this.b,$.ig.Encoding.prototype.uTF8());a.e(this.a);return a},$type:new $.ig.Type("XmlaConnection",$.ig.Object.prototype.$type,[$.ig.ICoreXmlaConnection.prototype.$type])},true);$.ig.util.defType("XmlaDataSourceImpl","MdxDataSourceImpl",{init:function(a){$.ig.MdxDataSourceImpl.prototype.init.call(this,a);this.xmlaSourceOptions(a)},_xmlaSourceOptions:null,xmlaSourceOptions:function(value){if(arguments.length===1){this._xmlaSourceOptions=value;return value}else{return this._xmlaSourceOptions}},aq:function(a){var $self=this;var b=$self.dataProviderFactory().createDataProvider();var c=$self.getProviderDefaultRestrictions();$self.bj(c,$.ig.CubeRestrictions.prototype.a,a);var d=$self.getProviderDefaultProperties();$self.bj(d,$.ig.XmlaDiscoverProperties.prototype.a,a);var e=b.discoverCubesAsync(d,c).j($.ig.IList$1.prototype.$type.specialize($.ig.Cube.prototype.$type),function(f){$self.cubes($self.a1($.ig.Cube.prototype.$type,f.m()));return $self.cubes()});return e},ar:function(){var $self=this;var a=$self.catalog().name();var b=$self.cube().name();var c=$self.dataProviderFactory().createDataProvider();var d=$self.getProviderDefaultRestrictions();$self.bj(d,$.ig.MeasureGroupRestrictions.prototype.a,a);$self.bj(d,$.ig.MeasureGroupRestrictions.prototype.b,b);var e=$self.getProviderDefaultProperties();$self.bj(e,$.ig.XmlaDiscoverProperties.prototype.a,a);var f=c.discoverMeasureGroupsAsync(e,d).j($.ig.IList$1.prototype.$type.specialize($.ig.MeasureGroup.prototype.$type),function(g){$self.measureGroups($self.a1($.ig.MeasureGroup.prototype.$type,g.m()));return $self.measureGroups()});return f},h:function(){return new $.ig.DefaultXmlaDataProviderFactory(this.xmlaSourceOptions().serverUrl(),this.xmlaSourceOptions().requestOptions())},getProviderDefaultProperties:function(){var $self=this;var a=new $.ig.List$1($.ig.KeyValueItem.prototype.$type,0);if($self.mdxSourceOptions().discoverProperties()!=null){var c=$self.mdxSourceOptions().discoverProperties().getEnumerator();while(c.moveNext()){var b=c.current();var d=new $.ig.XmlaQueryProperty(1,b.key(),b.value());a.add(function(){var $ret=new $.ig.KeyValueItem;$ret.a(d.a());$ret.b(d.c());return $ret}())}}if($self.catalog()!=null){$self.bj(a,$.ig.XmlaDiscoverProperties.prototype.a,$self.catalog().name())}return a},$type:new $.ig.Type("XmlaDataSourceImpl",$.ig.MdxDataSourceImpl.prototype.$type)},true);$.ig.util.defType("XmlaDiscoverProperties","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("XmlaDiscoverProperties",$.ig.Object.prototype.$type)},true);$.ig.util.defType("XmlaDataSourceOptions","MdxDataSourceOptions",{init:function(){$.ig.MdxDataSourceOptions.prototype.init.call(this)
},_serverUrl:null,serverUrl:function(value){if(arguments.length===1){this._serverUrl=value;return value}else{return this._serverUrl}},_requestOptions:null,requestOptions:function(value){if(arguments.length===1){this._requestOptions=value;return value}else{return this._requestOptions}},$type:new $.ig.Type("XmlaDataSourceOptions",$.ig.MdxDataSourceOptions.prototype.$type)},true);$.ig.util.defType("RequestOptions","NetworkCredential",{init:function(initNumber,a,b){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$.ig.RequestOptions.prototype.init1.call(this,1,a,b,String.empty())},init1:function(initNumber,a,b,c){$.ig.NetworkCredential.prototype.init1.call(this,1,a,b,c)},$type:new $.ig.Type("RequestOptions",$.ig.NetworkCredential.prototype.$type)},true);$.ig.util.defType("CustomRemoteXmlaRequestSerializer","Object",{a:null,init:function(a){$.ig.Object.prototype.init.call(this);this.a=a},serializeRequest:function(a){return this.a(a)},deserializeRequest:function(a){throw new $.ig.NotSupportedException(1)},$type:new $.ig.Type("CustomRemoteXmlaRequestSerializer",$.ig.Object.prototype.$type,[$.ig.IRemoteRequestSerializer.prototype.$type])},true);$.ig.util.defType("CustomRemoteXmlaResponseSerializer","Object",{a:null,init:function(a){$.ig.Object.prototype.init.call(this);this.a=a},serializeResponse:function(a,b){throw new $.ig.NotSupportedException(1)},deserializeResponse:function(a,b){return this.a(a,b)},$type:new $.ig.Type("CustomRemoteXmlaResponseSerializer",$.ig.Object.prototype.$type,[$.ig.IRemoteResponseSerializer.prototype.$type])},true);$.ig.util.defType("OlapXmlaDataSource","DataSourceBase",{staticInit:function(){$.ig.OlapXmlaDataSource.prototype.a5()},init:function(a){var $self=this;$.ig.DataSourceBase.prototype.init.call(this);var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"serverUrl");var c=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"catalog");var d=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"cube");var e=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"measures");var f=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"measureGroup");var g=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"filters");var h=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"columns");var i=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"rows");var j=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"requestOptions");var k=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"enableResultCache");var l=true;if(k!=null){l=k}var m=$.ig.jQueryUtils.prototype.convertToStringDictionary($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"discoverProperties"));var n=$.ig.jQueryUtils.prototype.convertToStringDictionary($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"executeProperties"));var o=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"isRemote");if(o){if(j==null){j={}}var ro_=j;ro_.isCrossDomain=false}var p=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"serializeRequest");var q=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"deserializeResponse");var r=this.a0(a);var s=function(){var $ret=new $.ig.XmlaDataSourceOptions;$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 $.ig.CustomRemoteXmlaRequestSerializer(p)}if(q!=null){u=new $.ig.CustomRemoteXmlaResponseSerializer(q)}var v=new $.ig.RemoteXmlaDataProviderFactory(1,b,j);s.dataProviderFactory(v)}this.dataSource(new $.ig.XmlaDataSourceImpl(s))},catalogs:function(){return this.dataSource().catalogs().inner()},catalog:function(){return this.dataSource().catalog()},setCatalog:function(a){var $self=this;return $self.dataSource().setCatalog(a).j($.ig.Array.prototype.$type,function(b){return b.m().inner()}).c()},measureGroups:function(){return this.dataSource().measureGroups().inner()},measureGroup:function(){return this.dataSource().measureGroup()},setMeasureGroup:function(a){var $self=this;return $self.dataSource().setMeasureGroup(a).j($.ig.OlapMetadataTreeItem.prototype.$type,function(b){return b.m()}).c()},a0:function(a){var b=new $.ig.MdxSettings;var c=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"mdxSettings");if(c==null){return b}var d=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(c,"nonEmptyOnRows");if(d!=null){b.y(d)}var e=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(c,"nonEmptyOnColumns");if(e!=null){b.x(e)}var f=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(c,"addCalculatedMembersOnRows");if(f!=null){b.q(f)}var g=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(c,"addCalculatedMembersOnColumns");if(g!=null){b.p(g)}var h=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(c,"dimensionPropertiesOnRows");if(h!=null){for(var i=0;i<h.count();i++){b.ac().add(h.item(i))}}var j=$.ig.jQueryUtils.prototype.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",$.ig.DataSourceBase.prototype.$type)},true);$.ig.RemoteRequestType.prototype.discoverCatalogs=0;$.ig.RemoteRequestType.prototype.discoverCubes=1;$.ig.RemoteRequestType.prototype.discoverDimensions=2;$.ig.RemoteRequestType.prototype.discoverHierarchies=3;$.ig.RemoteRequestType.prototype.discoverLevels=4;$.ig.RemoteRequestType.prototype.discoverMeasures=5;$.ig.RemoteRequestType.prototype.discoverMeasureGroups=6;$.ig.RemoteRequestType.prototype.discoverMeasureGroupDimensions=7;$.ig.RemoteRequestType.prototype.discoverMembers=8;$.ig.RemoteRequestType.prototype.discoverKpis=9;$.ig.RemoteRequestType.prototype.executeStatement=10;$.ig.MdxElementType.prototype.member=0;$.ig.MdxElementType.prototype.memberTree=1;$.ig.MdxElementType.prototype.calculated=2;$.ig.MdxElementType.prototype.filter=3;$.ig.MdxElementType.prototype.collection=4;$.ig.MdxElementType.prototype.userDefined=5;$.ig.XmlaSoapMessageHeader.prototype.none=0;$.ig.XmlaSoapMessageHeader.prototype.session=1;$.ig.XmlaSoapMessageHeader.prototype.beginSession=2;$.ig.XmlaSoapMessageHeader.prototype.endSession=3;$.ig.CatalogConstants.prototype.a="CATALOG_NAME";$.ig.CatalogConstants.prototype.c="DESCRIPTION";$.ig.CatalogConstants.prototype.d="ROLES";$.ig.CatalogConstants.prototype.b="DATE_MODIFIED";$.ig.DbSchemaConstants.prototype.a="DBSCHEMA_CATALOGS";$.ig.DbSchemaConstants.prototype.b="DBSCHEMA_COLUMNS";$.ig.DbSchemaConstants.prototype.d="DBSCHEMA_TABLES";$.ig.DbSchemaConstants.prototype.c="DBSCHEMA_PROVIDER_TYPES";$.ig.CubeConstants.prototype.c="CATALOG_NAME";$.ig.CubeConstants.prototype.n="SCHEMA_NAME";$.ig.CubeConstants.prototype.e="CUBE_NAME";$.ig.CubeConstants.prototype.f="CUBE_TYPE";$.ig.CubeConstants.prototype.m="LAST_SCHEMA_UPDATE";$.ig.CubeConstants.prototype.l="LAST_DATA_UPDATE";$.ig.CubeConstants.prototype.g="DESCRIPTION";$.ig.CubeConstants.prototype.h="IS_DRILLTHROUGH_ENABLED";$.ig.CubeConstants.prototype.i="IS_LINKABLE";$.ig.CubeConstants.prototype.k="IS_WRITE_ENABLED";$.ig.CubeConstants.prototype.j="IS_SQL_ENABLED";$.ig.CubeConstants.prototype.d="CUBE_CAPTION";$.ig.CubeConstants.prototype.b="BASE_CUBE_NAME";$.ig.CubeConstants.prototype.a="ANNOTATIONS";$.ig.DimensionConstants.prototype.a="CATALOG_NAME";$.ig.DimensionConstants.prototype.p="SCHEMA_NAME";$.ig.DimensionConstants.prototype.b="CUBE_NAME";$.ig.DimensionConstants.prototype.i="DIMENSION_NAME";$.ig.DimensionConstants.prototype.l="DIMENSION_UNIQUE_NAME";$.ig.DimensionConstants.prototype.e="DIMENSION_CAPTION";$.ig.DimensionConstants.prototype.j="DIMENSION_ORDINAL";$.ig.DimensionConstants.prototype.k="DIMENSION_TYPE";$.ig.DimensionConstants.prototype.f="DIMENSION_CARDINALITY";$.ig.DimensionConstants.prototype.c="DEFAULT_HIERARCHY";$.ig.DimensionConstants.prototype.d="DESCRIPTION";$.ig.DimensionConstants.prototype.o="IS_VIRTUAL";$.ig.DimensionConstants.prototype.n="IS_READWRITE";$.ig.DimensionConstants.prototype.m="DIMENSION_UNIQUE_SETTINGS";$.ig.DimensionConstants.prototype.h="DIMENSION_MASTER_NAME";$.ig.DimensionConstants.prototype.g="DIMENSION_IS_VISIBLE";$.ig.HierarchyConstants.prototype.b="CATALOG_NAME";$.ig.HierarchyConstants.prototype.c="CUBE_NAME";$.ig.HierarchyConstants.prototype.j="DIMENSION_UNIQUE_NAME";$.ig.HierarchyConstants.prototype.q="HIERARCHY_NAME";$.ig.HierarchyConstants.prototype.t="HIERARCHY_UNIQUE_NAME";$.ig.HierarchyConstants.prototype.m="HIERARCHY_CAPTION";$.ig.HierarchyConstants.prototype.i="DIMENSION_TYPE";$.ig.HierarchyConstants.prototype.n="HIERARCHY_CARDINALITY";$.ig.HierarchyConstants.prototype.d="DEFAULT_MEMBER";$.ig.HierarchyConstants.prototype.a="ALL_MEMBER";$.ig.HierarchyConstants.prototype.e="DESCRIPTION";$.ig.HierarchyConstants.prototype.w="IS_VIRTUAL";$.ig.HierarchyConstants.prototype.v="IS_READWRITE";$.ig.HierarchyConstants.prototype.k="DIMENSION_UNIQUE_SETTINGS";$.ig.HierarchyConstants.prototype.g="DIMENSION_IS_VISIBLE";$.ig.HierarchyConstants.prototype.h="DIMENSION_MASTER_UNIQUE_NAME";$.ig.HierarchyConstants.prototype.r="HIERARCHY_ORDINAL";$.ig.HierarchyConstants.prototype.f="DIMENSION_IS_SHARED";$.ig.HierarchyConstants.prototype.p="HIERARCHY_IS_VISIBLE";$.ig.HierarchyConstants.prototype.s="HIERARCHY_ORIGIN";$.ig.HierarchyConstants.prototype.o="HIERARCHY_DISPLAY_FOLDER";$.ig.HierarchyConstants.prototype.u="INSTANCE_SELECTION";$.ig.HierarchyConstants.prototype.l="GROUPING_BEHAVIOR";$.ig.HierarchyConstants.prototype.x="STRUCTURE_TYPE";$.ig.InstanceConstants.prototype.a="INSTANCE_NAME";$.ig.InstanceConstants.prototype.b="INSTANCE_PORT_NUMBER";$.ig.InstanceConstants.prototype.c="INSTANCE_STATE";$.ig.KpiConstants.prototype.a="CATALOG_NAME";$.ig.KpiConstants.prototype.q="SCHEMA_NAME";$.ig.KpiConstants.prototype.b="CUBE_NAME";$.ig.KpiConstants.prototype.p="MEASUREGROUP_NAME";$.ig.KpiConstants.prototype.h="KPI_NAME";$.ig.KpiConstants.prototype.c="KPI_CAPTION";$.ig.KpiConstants.prototype.e="KPI_DESCRIPTION";$.ig.KpiConstants.prototype.f="KPI_DISPLAY_FOLDER";$.ig.KpiConstants.prototype.n="KPI_VALUE";$.ig.KpiConstants.prototype.g="KPI_GOAL";$.ig.KpiConstants.prototype.j="KPI_STATUS";$.ig.KpiConstants.prototype.l="KPI_TREND";$.ig.KpiConstants.prototype.k="KPI_STATUS_GRAPHIC";$.ig.KpiConstants.prototype.m="KPI_TREND_GRAPHIC";$.ig.KpiConstants.prototype.o="KPI_WEIGHT";$.ig.KpiConstants.prototype.d="KPI_CURRENT_TIME_MEMBER";$.ig.KpiConstants.prototype.i="KPI_PARENT_KPI_NAME";$.ig.LevelConstants.prototype.a="CATALOG_NAME";$.ig.LevelConstants.prototype.b="CUBE_NAME";$.ig.LevelConstants.prototype.e="DIMENSION_UNIQUE_NAME";$.ig.LevelConstants.prototype.f="HIERARCHY_UNIQUE_NAME";$.ig.LevelConstants.prototype.l="LEVEL_NAME";$.ig.LevelConstants.prototype.q="LEVEL_UNIQUE_NAME";$.ig.LevelConstants.prototype.g="LEVEL_CAPTION";$.ig.LevelConstants.prototype.m="LEVEL_NUMBER";$.ig.LevelConstants.prototype.h="LEVEL_CARDINALITY";$.ig.LevelConstants.prototype.p="LEVEL_TYPE";$.ig.LevelConstants.prototype.d="DESCRIPTION";$.ig.LevelConstants.prototype.c="CUSTOM_ROLLUP_SETTINGS";$.ig.LevelConstants.prototype.r="LEVEL_UNIQUE_SETTINGS";$.ig.LevelConstants.prototype.j="LEVEL_IS_VISIBLE";$.ig.LevelConstants.prototype.n="LEVEL_ORDERING_PROPERTY";$.ig.LevelConstants.prototype.i="LEVEL_DBTYPE";$.ig.LevelConstants.prototype.k="LEVEL_KEY_CARDINALITY";$.ig.LevelConstants.prototype.o="LEVEL_ORIGIN";$.ig.MeasureConstants.prototype.a="CATALOG_NAME";$.ig.MeasureConstants.prototype.r="SCHEMA_NAME";$.ig.MeasureConstants.prototype.b="CUBE_NAME";$.ig.MeasureConstants.prototype.l="MEASURE_NAME";$.ig.MeasureConstants.prototype.n="MEASURE_UNIQUE_NAME";$.ig.MeasureConstants.prototype.h="MEASURE_CAPTION";$.ig.MeasureConstants.prototype.g="MEASURE_AGGREGATOR";$.ig.MeasureConstants.prototype.c="DATA_TYPE";$.ig.MeasureConstants.prototype.p="NUMERIC_PRECISION";$.ig.MeasureConstants.prototype.q="NUMERIC_SCALE";$.ig.MeasureConstants.prototype.f="EXPRESSION";$.ig.MeasureConstants.prototype.e="DESCRIPTION";$.ig.MeasureConstants.prototype.k="MEASURE_IS_VISIBLE";$.ig.MeasureConstants.prototype.m="MEASURE_NAME_SQL_COLUMN_NAME";$.ig.MeasureConstants.prototype.o="MEASURE_UNQUALIFIED_CAPTION";$.ig.MeasureConstants.prototype.j="MEASUREGROUP_NAME";$.ig.MeasureConstants.prototype.i="MEASURE_DISPLAY_FOLDER";$.ig.MeasureConstants.prototype.d="DEFAULT_FORMAT_STRING";$.ig.MeasureGroupConstants.prototype.a="CATALOG_NAME";$.ig.MeasureGroupConstants.prototype.f="SCHEMA_NAME";$.ig.MeasureGroupConstants.prototype.b="CUBE_NAME";$.ig.MeasureGroupConstants.prototype.e="MEASUREGROUP_NAME";$.ig.MeasureGroupConstants.prototype.c="DESCRIPTION";$.ig.MeasureGroupConstants.prototype.d="MEASUREGROUP_CAPTION";$.ig.MeasureGroupDimensionConstants.prototype.a="CATALOG_NAME";$.ig.MeasureGroupDimensionConstants.prototype.k="SCHEMA_NAME";$.ig.MeasureGroupDimensionConstants.prototype.b="CUBE_NAME";$.ig.MeasureGroupDimensionConstants.prototype.j="MEASUREGROUP_NAME";$.ig.MeasureGroupDimensionConstants.prototype.i="MEASUREGROUP_CARDINALITY";$.ig.MeasureGroupDimensionConstants.prototype.h="DIMENSION_UNIQUE_NAME";$.ig.MeasureGroupDimensionConstants.prototype.c="DIMENSION_CARDINALITY";$.ig.MeasureGroupDimensionConstants.prototype.f="DIMENSION_IS_VISIBLE";$.ig.MeasureGroupDimensionConstants.prototype.e="DIMENSION_IS_FACT_DIMENSION";$.ig.MeasureGroupDimensionConstants.prototype.g="DIMENSION_PATH";$.ig.MeasureGroupDimensionConstants.prototype.d="DIMENSION_GRANULARITY";$.ig.MemberConstants.prototype.a="CATALOG_NAME";$.ig.MemberConstants.prototype.u="SCHEMA_NAME";$.ig.MemberConstants.prototype.c="CUBE_NAME";$.ig.MemberConstants.prototype.e="DIMENSION_UNIQUE_NAME";$.ig.MemberConstants.prototype.g="HIERARCHY_UNIQUE_NAME";$.ig.MemberConstants.prototype.k="LEVEL_UNIQUE_NAME";$.ig.MemberConstants.prototype.j="LEVEL_NUMBER";$.ig.MemberConstants.prototype.o="MEMBER_NAME";$.ig.MemberConstants.prototype.q="MEMBER_UNIQUE_NAME";$.ig.MemberConstants.prototype.p="MEMBER_TYPE";$.ig.MemberConstants.prototype.m="MEMBER_GUID";$.ig.MemberConstants.prototype.l="MEMBER_CAPTION";$.ig.MemberConstants.prototype.b="CHILDREN_CARDINALITY";$.ig.MemberConstants.prototype.s="PARENT_LEVEL";$.ig.MemberConstants.prototype.t="PARENT_UNIQUE_NAME";$.ig.MemberConstants.prototype.r="PARENT_COUNT";$.ig.MemberConstants.prototype.d="DESCRIPTION";$.ig.MemberConstants.prototype.f="EXPRESSION";$.ig.MemberConstants.prototype.n="MEMBER_KEY";$.ig.MemberConstants.prototype.i="IS_PLACEHOLDERMEMBER";$.ig.MemberConstants.prototype.h="IS_DATAMEMBER";$.ig.MemberConstants.prototype.v="SCOPE";$.ig.OlapSchemaConstants.prototype.a="MDSCHEMA_CUBES";$.ig.OlapSchemaConstants.prototype.b="MDSCHEMA_DIMENSIONS";$.ig.OlapSchemaConstants.prototype.g="MDSCHEMA_MEASUREGROUPS";$.ig.OlapSchemaConstants.prototype.f="MDSCHEMA_MEASUREGROUP_DIMENSIONS";$.ig.OlapSchemaConstants.prototype.h="MDSCHEMA_MEASURES";$.ig.OlapSchemaConstants.prototype.c="MDSCHEMA_HIERARCHIES";$.ig.OlapSchemaConstants.prototype.e="MDSCHEMA_LEVELS";$.ig.OlapSchemaConstants.prototype.i="MDSCHEMA_MEMBERS";$.ig.OlapSchemaConstants.prototype.d="MDSCHEMA_KPIS";$.ig.CubeRestrictions.prototype.a="CATALOG_NAME";$.ig.CubeRestrictions.prototype.d="SCHEMA_NAME";$.ig.CubeRestrictions.prototype.b="CUBE_NAME";$.ig.CubeRestrictions.prototype.c="CUBE_SOURCE";$.ig.DimensionRestrictions.prototype.a="CATALOG_NAME";$.ig.DimensionRestrictions.prototype.g="SCHEMA_NAME";$.ig.DimensionRestrictions.prototype.b="CUBE_NAME";$.ig.DimensionRestrictions.prototype.d="DIMENSION_NAME";$.ig.DimensionRestrictions.prototype.e="DIMENSION_UNIQUE_NAME";$.ig.DimensionRestrictions.prototype.c="CUBE_SOURCE";$.ig.DimensionRestrictions.prototype.f="DIMENSION_VISIBILITY";$.ig.HierarchyRestrictions.prototype.a="CATALOG_NAME";$.ig.HierarchyRestrictions.prototype.i="SCHEMA_NAME";$.ig.HierarchyRestrictions.prototype.b="CUBE_NAME";$.ig.HierarchyRestrictions.prototype.d="DIMENSION_UNIQUE_NAME";$.ig.HierarchyRestrictions.prototype.e="HIERARCHY_NAME";$.ig.HierarchyRestrictions.prototype.g="HIERARCHY_UNIQUE_NAME";$.ig.HierarchyRestrictions.prototype.f="HIERARCHY_ORIGIN";$.ig.HierarchyRestrictions.prototype.c="CUBE_SOURCE";$.ig.HierarchyRestrictions.prototype.h="HIERARCHY_VISIBILITY";$.ig.KpiRestrictions.prototype.a="CATALOG_NAME";$.ig.KpiRestrictions.prototype.e="SCHEMA_NAME";$.ig.KpiRestrictions.prototype.b="CUBE_NAME";$.ig.KpiRestrictions.prototype.d="KPI_NAME";$.ig.KpiRestrictions.prototype.c="CUBE_SOURCE";$.ig.LevelRestrictions.prototype.a="CATALOG_NAME";$.ig.LevelRestrictions.prototype.j="SCHEMA_NAME";$.ig.LevelRestrictions.prototype.b="CUBE_NAME";$.ig.LevelRestrictions.prototype.d="DIMENSION_UNIQUE_NAME";$.ig.LevelRestrictions.prototype.e="HIERARCHY_UNIQUE_NAME";$.ig.LevelRestrictions.prototype.f="LEVEL_NAME";$.ig.LevelRestrictions.prototype.h="LEVEL_UNIQUE_NAME";$.ig.LevelRestrictions.prototype.g="LEVEL_ORIGIN";$.ig.LevelRestrictions.prototype.c="CUBE_SOURCE";$.ig.LevelRestrictions.prototype.i="LEVEL_VISIBILITY";$.ig.MeasureRestrictions.prototype.a="CATALOG_NAME";$.ig.MeasureRestrictions.prototype.h="SCHEMA_NAME";$.ig.MeasureRestrictions.prototype.b="CUBE_NAME";$.ig.MeasureRestrictions.prototype.e="MEASURE_NAME";$.ig.MeasureRestrictions.prototype.f="MEASURE_UNIQUE_NAME";$.ig.MeasureRestrictions.prototype.d="MEASUREGROUP_NAME";$.ig.MeasureRestrictions.prototype.c="CUBE_SOURCE";$.ig.MeasureRestrictions.prototype.g="MEASURE_VISIBILITY";$.ig.MeasureGroupRestrictions.prototype.a="CATALOG_NAME";$.ig.MeasureGroupRestrictions.prototype.d="SCHEMA_NAME";$.ig.MeasureGroupRestrictions.prototype.b="CUBE_NAME";$.ig.MeasureGroupRestrictions.prototype.c="MEASUREGROUP_NAME";$.ig.MeasureGroupDimensionRestrictions.prototype.a="CATALOG_NAME";$.ig.MeasureGroupDimensionRestrictions.prototype.f="SCHEMA_NAME";$.ig.MeasureGroupDimensionRestrictions.prototype.b="CUBE_NAME";$.ig.MeasureGroupDimensionRestrictions.prototype.e="MEASUREGROUP_NAME";$.ig.MeasureGroupDimensionRestrictions.prototype.c="DIMENSION_UNIQUE_NAME";$.ig.MeasureGroupDimensionRestrictions.prototype.d="DIMENSION_VISIBILITY";$.ig.MemberRestrictions.prototype.a="CATALOG_NAME";$.ig.MemberRestrictions.prototype.k="SCHEMA_NAME";$.ig.MemberRestrictions.prototype.b="CUBE_NAME";$.ig.MemberRestrictions.prototype.d="DIMENSION_UNIQUE_NAME";$.ig.MemberRestrictions.prototype.e="HIERARCHY_UNIQUE_NAME";$.ig.MemberRestrictions.prototype.g="LEVEL_UNIQUE_NAME";$.ig.MemberRestrictions.prototype.f="LEVEL_NUMBER";$.ig.MemberRestrictions.prototype.h="MEMBER_NAME";$.ig.MemberRestrictions.prototype.j="MEMBER_UNIQUE_NAME";$.ig.MemberRestrictions.prototype.i="MEMBER_TYPE";$.ig.MemberRestrictions.prototype.l="TREE_OP";$.ig.MemberRestrictions.prototype.c="CUBE_SOURCE";$.ig.XmlaConstants.prototype.ak="DBSCHEMA_CATALOGS";$.ig.XmlaConstants.prototype.al="MDSCHEMA_CUBES";$.ig.XmlaConstants.prototype.ai="RestrictionList";$.ig.XmlaConstants.prototype.ah="PropertyList";$.ig.XmlaConstants.prototype.e="DataSourceInfo";$.ig.XmlaConstants.prototype.b="Catalog";$.ig.XmlaConstants.prototype.at="SCHEMA_NAME";$.ig.XmlaConstants.prototype.aj="row";$.ig.XmlaConstants.prototype.h="DESCRIPTION";$.ig.XmlaConstants.prototype.d="CUBE";$.ig.XmlaConstants.prototype.k="DIMENSION";$.ig.XmlaConstants.prototype.am="MDSCHEMA_DIMENSIONS";$.ig.XmlaConstants.prototype.aq="MDSCHEMA_MEASUREGROUPS";$.ig.XmlaConstants.prototype.aa="MEASUREGROUP_NAME";$.ig.XmlaConstants.prototype.z="MEASUREGROUP_CAPTION";$.ig.XmlaConstants.prototype.ap="MDSCHEMA_MEASUREGROUP_DIMENSIONS";$.ig.XmlaConstants.prototype.j="DIMENSION_NAME";$.ig.XmlaConstants.prototype.m="DIMENSION_UNIQUE_NAME";$.ig.XmlaConstants.prototype.i="DIMENSION_CAPTION";$.ig.XmlaConstants.prototype.ar="MDSCHEMA_MEASURES";$.ig.XmlaConstants.prototype.ab="MEASURE_NAME";$.ig.XmlaConstants.prototype.ac="MEASURE_UNIQUE_NAME";$.ig.XmlaConstants.prototype.y="MEASURE_CAPTION";$.ig.XmlaConstants.prototype.x="MEASURE_AGGREGATOR";$.ig.XmlaConstants.prototype.l="DIMENSION_TYPE";$.ig.XmlaConstants.prototype.an="MDSCHEMA_HIERARCHIES";$.ig.XmlaConstants.prototype.p="HIERARCHY_NAME";$.ig.XmlaConstants.prototype.r="HIERARCHY_UNIQUE_NAME";$.ig.XmlaConstants.prototype.n="HIERARCHY_CAPTION";$.ig.XmlaConstants.prototype.q="HIERARCHY_ORIGIN";$.ig.XmlaConstants.prototype.g="DEFAULT_MEMBER";$.ig.XmlaConstants.prototype.a="ALL_MEMBER";$.ig.XmlaConstants.prototype.u="LEVEL_NAME";$.ig.XmlaConstants.prototype.s="LEVEL_CAPTION";$.ig.XmlaConstants.prototype.w="LEVEL_UNIQUE_NAME";$.ig.XmlaConstants.prototype.v="LEVEL_NUMBER";$.ig.XmlaConstants.prototype.t="LEVEL_CARDINALITY";$.ig.XmlaConstants.prototype.ao="MDSCHEMA_LEVELS";$.ig.XmlaConstants.prototype.as="MDSCHEMA_MEMBERS";$.ig.XmlaConstants.prototype.av="TREE_OP";$.ig.XmlaConstants.prototype.ae="MEMBER_NAME";$.ig.XmlaConstants.prototype.af="MEMBER_UNIQUE_NAME";$.ig.XmlaConstants.prototype.ad="MEMBER_CAPTION";$.ig.XmlaConstants.prototype.ag="PARENT_UNIQUE_NAME";$.ig.XmlaConstants.prototype.c="CHILDREN_CARDINALITY";$.ig.XmlaConstants.prototype.f="DEFAULT_FORMAT_STRING";$.ig.XmlaConstants.prototype.o="HIERARCHY_DISPLAY_FOLDER";$.ig.XmlaConstants.prototype.au="SCOPE";$.ig.XmlaSoapMethodResult.prototype.a="return";$.ig.XmlaNamespace.prototype.f="urn:schemas-microsoft-com:xml-sql";$.ig.XmlaNamespace.prototype.a="urn:schemas-microsoft-com:xml-analysis";$.ig.XmlaNamespace.prototype.d="urn:schemas-microsoft-com:xml-analysis:mddataset";$.ig.XmlaNamespace.prototype.e="urn:schemas-microsoft-com:xml-analysis:rowset";$.ig.XmlaNamespace.prototype.b="urn:schemas-microsoft-com:xml-analysis:empty";$.ig.XmlaNamespace.prototype.c="urn:schemas-microsoft-com:xml-analysis:exception";$.ig.XmlaSoapMessageBuilder.prototype.d="Envelope";$.ig.XmlaSoapMessageBuilder.prototype.e="Header";$.ig.XmlaSoapMessageBuilder.prototype.b="Body";$.ig.XmlaSoapMessageBuilder.prototype.f="soap";$.ig.XmlaSoapMessageBuilder.prototype.g="http://schemas.xmlsoap.org/soap/envelope/";$.ig.XmlaSoapMethod.prototype.h="Properties";$.ig.XmlaSoapMethod.prototype.i="PropertyList";$.ig.XmlaSoapMethodDiscover.prototype.m="Discover";$.ig.XmlaSoapMethodDiscover.prototype.o="RequestType";$.ig.XmlaSoapMethodDiscover.prototype.q="Restrictions";$.ig.XmlaSoapMethodDiscover.prototype.p="RestrictionList";$.ig.XmlaSoapMethodDiscover.prototype.s="SessionId";$.ig.XmlaSoapMethodExecute.prototype.k="Execute";$.ig.XmlaSoapMethodExecute.prototype.j="Command";$.ig.XmlaSoapMethodExecute.prototype.m="Statement";$.ig.XmlaSoapWebClient.prototype.a=null;if($.ig.XmlaSoapWebClient.prototype.staticInit&&!$.ig.XmlaSoapWebClient.prototype.xmlaSoapWebClientStaticInitCalled){$.ig.XmlaSoapWebClient.prototype.staticInit();$.ig.XmlaSoapWebClient.prototype.xmlaSoapWebClientStaticInitCalled=true}$.ig.XmlaSoapWebClient.prototype.a=null;if($.ig.XmlaSoapWebClient.prototype.staticInit&&!$.ig.XmlaSoapWebClient.prototype.xmlaSoapWebClientStaticInitCalled){$.ig.XmlaSoapWebClient.prototype.staticInit();$.ig.XmlaSoapWebClient.prototype.xmlaSoapWebClientStaticInitCalled=true}$.ig.ArrayJsonSerializer.prototype.a=new $.ig.ArrayJsonSerializer;$.ig.AxisJsonTypeSeriazlier.prototype.a=new $.ig.AxisJsonTypeSeriazlier;$.ig.AxisMemberJsonTypeSeriazlier.prototype.a=new $.ig.AxisMemberJsonTypeSeriazlier;$.ig.CatalogJsonTypeSeriazlier.prototype.a=new $.ig.CatalogJsonTypeSeriazlier;$.ig.CellJsonTypeSeriazlier.prototype.a=new $.ig.CellJsonTypeSeriazlier;$.ig.CubeJsonTypeSeriazlier.prototype.a=new $.ig.CubeJsonTypeSeriazlier;$.ig.DimensionJsonTypeSeriazlier.prototype.a=new $.ig.DimensionJsonTypeSeriazlier;$.ig.HierarchyJsonTypeSeriazlier.prototype.a=new $.ig.HierarchyJsonTypeSeriazlier;$.ig.KpiJsonTypeSeriazlier.prototype.a=new $.ig.KpiJsonTypeSeriazlier;$.ig.LevelJsonTypeSeriazlier.prototype.a=new $.ig.LevelJsonTypeSeriazlier;$.ig.MeasureGroupDimensionJsonTypeSeriazlier.prototype.a=new $.ig.MeasureGroupDimensionJsonTypeSeriazlier;$.ig.MeasureGroupJsonTypeSeriazlier.prototype.a=new $.ig.MeasureGroupJsonTypeSeriazlier;$.ig.MeasureJsonTypeSeriazlier.prototype.a=new $.ig.MeasureJsonTypeSeriazlier;$.ig.MemberJsonTypeSeriazlier.prototype.a=new $.ig.MemberJsonTypeSeriazlier;$.ig.RemoteRequestJsonTypeSeriazlier.prototype.a=new $.ig.RemoteRequestJsonTypeSeriazlier;$.ig.ResultJsonTypeSeriazlier.prototype.a=new $.ig.ResultJsonTypeSeriazlier;$.ig.TupleJsonTypeSeriazlier.prototype.a=new $.ig.TupleJsonTypeSeriazlier;$.ig.XmlaDiscoverProperties.prototype.a="Catalog";$.ig.util.extCopy($.ig.TaskExtensions,[[[$.ig.Task,$.ig.Task$1],["continueWithTask$1","continueWithTask$2"]]]);$.ig.util.extCopy($.ig.Queryable,[[[$.ig.SortedList$1,$.ig.IGrouping$2,$.ig.IEnumerable,$.ig.ICollection,$.ig.IList,$.ig.Array,$.ig.Dictionary,$.ig.XmlNodeList,$.ig.XmlNamedNodeMap,$.ig.XmlaPropertiesCollection],["asQueryable"]]]);$.ig.util.extCopy($.ig.Enumerable,[[[$.ig.SortedList$1,$.ig.IGrouping$2,$.ig.XmlaPropertiesCollection],["where$1","where$11","select$2","selectMany$2","last$1","first$1","firstOrDefault$1","orderBy$2","orderByDescending$2","toList$1","concat$1","max","max$1","min","min$1","count$1","reverse$1","take$1","skip$1","any$1","contains$1","union$1","toArray$1","elementAt$1","sum","sum$1"]],[[$.ig.SortedList$1,$.ig.IGrouping$2,$.ig.IEnumerable,$.ig.ICollection,$.ig.IList,$.ig.Array,$.ig.Dictionary,$.ig.XmlNodeList,$.ig.XmlNamedNodeMap,$.ig.XmlaPropertiesCollection],["ofType$1","cast$1"]]])})(jQuery);/*!@license
* Infragistics.Web.ClientUI infragistics.olapflatdatasource.js 14.1.20141.1020
*
* Copyright (c) 2011-2014 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","String:g","IComparable:h","Number:i","Number:j","Single:k","Number:l","String:m","Array:n","RegExp:o","RuntimeTypeHandle:p","MethodInfo:q","MethodBase:r","MemberInfo:s","ParameterInfo:t","TypeCode:u","Enum:v","ConstructorInfo:w","IEnumerable:x","IEnumerator:y","Func$1:z","MulticastDelegate:aa","IntPtr:ab","AbstractEnumerator:ac","IEnumerable$1:ad","IEnumerator$1:ae","ICollection$1:af","IList$1:ag","IArrayList:ah","Array:ai","ICollection:aj","CompareCallback:ak","List$1:al","IList:am","IDisposable:an","IArray:ao","Script:ap","Date:aq","Date:ar","Number:as","Func$3:at","Action$1:au","IDictionary$2:aw","Dictionary$2:ax","IDictionary:ay","Dictionary:az","IEqualityComparer$1:a0","KeyValuePair$2:a1","NotImplementedException:a2","Error:a3","GenericEnumerable$1:a4","GenericEnumerator$1:a5","INotifyCollectionChanged:a6","NotifyCollectionChangedEventHandler:a7","NotifyCollectionChangedEventArgs:a8","EventArgs:a9","NotifyCollectionChangedAction:ba","ObservableCollection$1:bd","INotifyPropertyChanged:be","PropertyChangedEventHandler:bf","PropertyChangedEventArgs:bg","Delegate:bh","ReadOnlyCollection$1:bj","NameValueCollection:bl","IOrderedEnumerable$1:bu","Enumerable:bz","Func$2:b0","SortedList$1:b1","Math:b2","Number:b3","Number:b4","Number:b5","Number:b6","Number:b7","Number:b8","Number:b9","ArgumentNullException:ca","AggregateException:cn","ArgumentException:co","AsyncCompletedEventArgs:cq","ListSortDirection:cs","Environment:cu","InvalidOperationException:cv","Debug:cw","ICredentials:cz","NetworkCredential:c0","Uri:c1","UploadStringCompletedEventHandler:c2","UploadStringCompletedEventArgs:c3","WebClient:c4","Encoding:c5","UTF8Encoding:c6","UnicodeEncoding:c7","WebHeaderCollection:c8","Task$1:c9","Task:da","JQueryPromise:db","Action:dc","TaskStatus:dd","TaskCompletionSource$1:de","JQueryDeferred:df","JQuery:dg","JQueryObject:dh","Element:di","ElementAttributeCollection:dj","ElementCollection:dk","WebStyle:dl","ElementNodeType:dm","Document:dn","EventListener:dp","IElementEventHandler:dq","ElementEventHandler:dr","ElementAttribute:ds","JQueryPosition:dt","JQueryCallback:du","JQueryEvent:dv","JQueryUICallback:dw","FaultCode:dx","FaultException:dy","FaultReason:dz","FaultException$1:d0","StringBuilder:d1","TaskFactory:d4","Tuple$2:d5","JavaScriptSerializer:d6","XObject:f9","XmlNode:ga","XmlNodeList:gb","XmlNamedNodeMap:gc","XmlNodeType:gd","XmlDocument:ge","XmlElement:gf","XmlLinkedNode:gg","XmlAttribute:gh","XmlUtils:gi","XAttribute:gj","XNode:gk","XContainer:gl","XElement:gm","XName:gn","XNamespace:go","XDocument:gp"]);$.ig.util.defType("TaskStatus:dd","Enum",{init:function(){$.ig.$ep.init.call(this)},$type:new $.ig.Type("TaskStatus",$.ig.$ep.$type)},true);$.ig.util.defType("ListSortDirection:cs","Enum",{init:function(){$.ig.$ep.init.call(this)},$type:new $.ig.Type("ListSortDirection",$.ig.$ep.$type)},true);$.ig.util.defType("NotifyCollectionChangedAction:ba","Enum",{init:function(){$.ig.$ep.init.call(this)},$type:new $.ig.Type("NotifyCollectionChangedAction",$.ig.$ep.$type)},true);$.ig.util.defType("AbstractEnumerable:a","Object",{a:null,init:function(a){$.ig.$op.init.call(this);this.a=a},getEnumerator:function(){return new $$t.ac(this.a().getEnumerator())},$type:new $.ig.Type("AbstractEnumerable",$.ig.$ot,[$.ig.IEnumerable.prototype.$type])},true);$.ig.util.defType("AbstractEnumerator:ac","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);$.ig.util.defType("IEnumerable$1:ad","Object",{$type:new $.ig.Type("IEnumerable$1",null,[$.ig.IEnumerable.prototype.$type])},true);$.ig.util.defType("ICollection$1:af","Object",{$type:new $.ig.Type("ICollection$1",null,[$$t.$ad.$type.specialize(0),$.ig.IEnumerable.prototype.$type])},true);$.ig.util.defType("IList$1:ag","Object",{$type:new $.ig.Type("IList$1",null,[$$t.$af.$type.specialize(0),$$t.$ad.$type.specialize(0),$.ig.IEnumerable.prototype.$type])},true);$.ig.util.defType("IArrayList:ah","Object",{$type:new $.ig.Type("IArrayList",null)},true);$.ig.util.defType("List$1:al","Object",{$t:null,__inner:null,init:function($t,initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}this.e={};this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this);this.__inner=new $.ig.Array},init1:function($t,initNumber,a){this.e={};this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this);this.__inner=new $.ig.Array;if(this.b(0,a)){return}var c=a.getEnumerator();while(c.moveNext()){var b=c.current();this.add1(b)}},init2:function($t,initNumber,a){this.e={};this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this);this.__inner=new $.ig.Array},o:function(a,b){this.__inner[a]=b},j:function(a,b){this.__inner.insert(a,b)},f:function(a){this.__inner.add(a)},m:function(a){this.__inner.removeAt(a)},h:function(){this.__inner.clear()},item:function(a,b){if(arguments.length===2){this.o(a,b);return b}else{return this.__inner[a]}},indexOf:function(a){return this.__inner.indexOf(a)},insert:function(a,b){this.j(a,b)},removeAt:function(a){this.m(a)},count:function(){return this.__inner.length},isReadOnly:function(){return false},add1:function(a){this.f(a)},clear:function(){this.h()},contains1:function(a){return this.__inner.contains(a)},copyTo:function(a,b){for(var c=0;c<this.__inner.length;c++){a[b+c]=this.__inner[c]}},remove1:function(a){var b=this.indexOf(a);if(b<0){return false}this.m(b);return true},getEnumerator:function(){var $self=this;var $iter=function(){return function(){return{$state:0,$this:$self,$current:null,$a:null,$b:null,current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$b=this.$this.__inner.getEnumerator();this.$state=4;break;case 2:this.$a=this.$b.current();this.$current=this.$a;this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$b.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}()};return new $.ig.GenericEnumerator$1(this.$t,$iter())},asArrayList:function(){return this.__inner},b:function(a,collection_){var b=$.ig.util.cast($$t.$ah.$type,collection_);if(b!=null){this.__inner.insertRange1(a,b.asArrayList());return true}var c=$.ig.util.cast($$t.$ao.$type,collection_);if(c!=null){this.__inner.insertRange(a,c.asArray());return true}var d=$.ig.util.cast($$t.$ag.$type.specialize(this.$t),collection_);if(d!=null){for(var e=0;e<d.count();e++){this.__inner.insert(a+e,d.item(e))}return true}var f=$.isArray(collection_)?collection_:null;if(f!=null){this.__inner.insertRange(a,f);return true}return false},insertRange1:function(a,b){if(this.b(a,b)){return}var c=0;var e=b.getEnumerator();while(e.moveNext()){var d=e.current();this.__inner.insert(a+c,d);c++}},insertRange:function(a,b){if(this.b(a,b)){return}var c=0;var e=b.getEnumerator();while(e.moveNext()){var d=e.current();this.__inner.insert(a+c,d);c++}},removeRange:function(a,b){this.__inner.splice(a,b)},copyTo1:function(a,b){this.__inner.copyTo(a,b)},isFixedSize:function(){return false},add:function(a){this.f(a);return this.__inner.length-1},contains:function(a){return this.__inner.contains(a)},indexOf1:function(a){return this.__inner.indexOf(a)},insert1:function(a,b){this.j(a,b)},remove:function(a){var b=this.indexOf1(a);this.m(b)},sort:function(){var $self=this;var a=null;if($self.$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($self.$t==$.ig.Single.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($self.$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($self.$t==$$t.$aq.$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)}}$self.r(a)},r:function(a){this.__inner.sort(a)},sort1:function(a){var $self=this;$self.__inner.sort(function(b,c){var d=b;var e=c;return a(d,e)})},_capacity:0,capacity:function(value){if(arguments.length===1){this._capacity=value;return value}else{return this._capacity}},addRange:function(a){var c=a.getEnumerator();while(c.moveNext()){var b=c.current();this.__inner.add(b)}},toArray:function(){return this.__inner.slice(0)},forEach:function(a){},isSynchronized:function(){return true},e:null,syncRoot:function(){return this.e},$type:new $.ig.Type("List$1",$.ig.$ot,[$$t.$ag.$type.specialize(0),$$t.$ah.$type,$.ig.IList.prototype.$type])},true);$.ig.util.defType("KeyValuePair$2:a1","ValueType",{$tKey:null,$tValue:null,init:function($tKey,$tValue,initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$.ig.ValueType.prototype.init.call(this)},a:null,c:null,init1:function($tKey,$tValue,initNumber,a,b){this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$.ig.ValueType.prototype.init.call(this);this.a=a;this.c=b},key:function(){return this.a},value:function(){return this.c},$type:new $.ig.Type("KeyValuePair$2",$.ig.ValueType.prototype.$type)},true);$.ig.util.defType("IDictionary$2:aw","Object",{$type:new $.ig.Type("IDictionary$2",null,[$$t.$af.$type.specialize($$t.$a1.$type.specialize(this.$tKey,this.$tValue)),$$t.$ad.$type.specialize($$t.$a1.$type.specialize(this.$tKey,this.$tValue)),$.ig.IEnumerable.prototype.$type])},true);$.ig.util.defType("Dictionary$2:ax","Object",{$tKey:null,$tValue:null,__inner:null,__keys:null,init:function($tKey,$tValue,initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}this.g=null;this._useToString=false;this.a=false;this._needsEnsure=false;this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$.ig.$op.init.call(this);this.__inner=new $.ig.Dictionary(0);this.__keys=new $.ig.Dictionary(0)},init1:function($tKey,$tValue,initNumber,a){this.g=null;this._useToString=false;this.a=false;this._needsEnsure=false;this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$.ig.$op.init.call(this);this.__inner=new $.ig.Dictionary(1,a);this.__keys=new $.ig.Dictionary(0)},g:null,init2:function($tKey,$tValue,initNumber,a){this.g=null;this._useToString=false;this.a=false;this._needsEnsure=false;this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$.ig.$op.init.call(this);this.__inner=new $.ig.Dictionary(0);this.__keys=new $.ig.Dictionary(0);this.g=a},count:function(){return this.__inner.count()},item:function(a,b){if(arguments.length===2){this.__inner.item(this.i(a),b);this.__keys.item(this.i(a),a);return b}else{return this.__inner.item(this.i(a))}},length:function(){return this.__inner.length()},containsKey:function(a){return this.__inner.containsKey(this.i(a))},remove:function(a){var b=this.i(a);if(!this.__keys.containsKey(b)){return false}this.__inner.remove(b);this.__keys.remove(b);return true},clear:function(){this.__inner.clear();this.__keys.clear()},_useToString:false,a:false,_needsEnsure:false,j:function(key_){if(!this.a){this.a=true;this._needsEnsure=typeof key_=="object";if(!this._needsEnsure){this._useToString=!key_.getHashCode}}},i:function(key_){this.j(key_);if(this._needsEnsure){$.ig.util.ensureUniqueId(key_)}if(this.g!=null){return this.g.getHashCode(key_).toString()}if(this._useToString){return key_.toString()}else{return key_.getHashCode().toString()}},add:function(a,b){this.__inner.item(this.i(a),b);this.__keys.item(this.i(a),a)},tryGetValue:function(a,b){if(!this.__inner.containsKey(this.i(a))){b=null;return{ret:false,value:b}}b=this.__inner.item(this.i(a));return{ret:true,value:b};return{value:b}},keys:function(){var $self=this;var $iter=function(){return function(){return{$state:0,$this:$self,$current:null,$a:null,$b:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$b=this.$this.__keys.values().getEnumerator();this.$state=4;break;case 2:this.$a=this.$b.current();this.$current=this.$a;this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$b.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}()};return new $.ig.GenericEnumerable$1(this.$tKey,$iter)},values:function(){var $self=this;var $iter=function(){return function(){return{$state:0,$this:$self,$current:null,$a:null,$b:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$b=this.$this.__inner.values().getEnumerator();this.$state=4;break;case 2:this.$a=this.$b.current();this.$current=this.$a;this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$b.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}()};return new $.ig.GenericEnumerable$1(this.$tValue,$iter)},isReadOnly:function(){return false},add1:function(a){this.add(a.key(),a.value())},contains:function(a){return this.containsKey(a.key())},copyTo:function(a,b){throw new $$t.a2},remove1:function(a){this.remove(a.key());return true},f:function(){var $self=this;var $iter=function(){return function(){return{$state:0,$this:$self,$current:null,$a:null,$b:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$b=this.$this.__keys.values().getEnumerator();this.$state=4;break;case 2:this.$a=this.$b.current();this.$current=new $$t.a1(this.$tKey,this.$tValue,1,this.$a,this.$this.__inner.item(this.$this.i(this.$a)));this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$b.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}()};return new $.ig.GenericEnumerable$1($$t.$a1.$type.specialize(this.$tKey,this.$tValue),$iter)},getEnumerator:function(){return this.f().getEnumerator()},$type:new $.ig.Type("Dictionary$2",$.ig.$ot,[$.ig.IDictionary$2.prototype.$type.specialize(0,1),$.ig.IDictionary.prototype.$type])},true);$.ig.util.defType("GenericEnumerable$1:a4","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.a5(this.$t,this.a().getEnumerator())},$type:new $.ig.Type("GenericEnumerable$1",$.ig.$ot,[$$t.$ad.$type.specialize(0)])},true);$.ig.util.defType("IEnumerator$1:ae","Object",{$type:new $.ig.Type("IEnumerator$1",null,[$.ig.IEnumerator.prototype.$type])},true);$.ig.util.defType("GenericEnumerator$1:a5","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()},$type:new $.ig.Type("GenericEnumerator$1",$.ig.$ot,[$$t.$ae.$type.specialize(0)])},true);$.ig.util.defType("INotifyCollectionChanged:a6","Object",{$type:new $.ig.Type("INotifyCollectionChanged",null)},true);$.ig.util.defType("NotifyCollectionChangedEventArgs:a8","EventArgs",{init:function(initNumber,a){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$$t.$a9.init.call(this);this.f=a;this.c=new $$t.al($.ig.$op.$type,0);this.b=new $$t.al($.ig.$op.$type,0)},init1:function(initNumber,a,b,c){var $self=this;$$t.$a9.init.call(this);this.f=a;this.c=new $$t.al($.ig.$op.$type,0);if(this.f==1||this.f==2){this.c.add(b);this.i=c}if(this.f!=1){this.b=function(){var $ret=new $$t.al($.ig.$op.$type,0);$ret.add(b);return $ret}()}else{this.b=new $$t.al($.ig.$op.$type,0)}this.h=c},init2:function(initNumber,a,b,c,d){var $self=this;$$t.$a9.init.call(this);this.f=a;this.h=d;this.i=d;this.b=function(){var $ret=new $$t.al($.ig.$op.$type,0);$ret.add(b);return $ret}();this.c=function(){var $ret=new $$t.al($.ig.$op.$type,0);$ret.add(c);return $ret}()},f:null,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.$a9.$type)},true);$.ig.util.defType("ObservableCollection$1:bd","List$1",{$t:null,init:function($t,initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}this.$t=$t;this.$type=this.$type.specialize(this.$t);$$t.$al.init.call(this,this.$t)},init1:function($t,initNumber,a){this.$t=$t;this.$type=this.$type.specialize(this.$t);$$t.$al.init1.call(this,this.$t,1,a)},init2:function($t,initNumber,a){this.$t=$t;this.$type=this.$type.specialize(this.$t);$$t.$al.init2.call(this,this.$t,2,a)},o:function(a,b){var c=this.__inner[a];$$t.$al.o.call(this,a,b);if(this.propertyChanged!=null){this.t(new $$t.bg("Item[]"))}if(this.collectionChanged!=null){var d=new $$t.a8(2,2,b,c,a);this.s(d)}},h:function(){$$t.$al.h.call(this);if(this.propertyChanged!=null){this.t(new $$t.bg("Count"));this.t(new $$t.bg("Item[]"))}if(this.collectionChanged!=null){var a=new $$t.a8(0,4);this.s(a)}},j:function(a,b){$$t.$al.j.call(this,a,b);if(this.propertyChanged!=null){this.t(new $$t.bg("Count"));this.t(new $$t.bg("Item[]"))}if(this.collectionChanged!=null){var c=new $$t.a8(1,0,b,a);this.s(c)}},f:function(a){$$t.$al.f.call(this,a);if(this.propertyChanged!=null){this.t(new $$t.bg("Count"));this.t(new $$t.bg("Item[]"))}if(this.collectionChanged!=null){var b=new $$t.a8(1,0,a,this.count()-1);this.s(b)}},m:function(a){var b=this.__inner[a];$$t.$al.m.call(this,a);if(this.propertyChanged!=null){this.t(new $$t.bg("Count"));this.t(new $$t.bg("Item[]"))}if(this.collectionChanged!=null){var c=new $$t.a8(1,1,b,a);this.s(c)}},collectionChanged:null,propertyChanged:null,t:function(a){if(this.propertyChanged!=null){this.propertyChanged(this,a)}},s:function(a){if(this.collectionChanged!=null){this.collectionChanged(this,a)}},$type:new $.ig.Type("ObservableCollection$1",$$t.$al.$type.specialize(0),[$$t.$a6.$type,$$t.$be.$type])},true);$.ig.util.defType("ReadOnlyCollection$1:bj","Object",{$t:null,init:function($t,initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}this.c={};this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this)},init1:function($t,initNumber,a){this.c={};this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.$op.init.call(this);this.a=a},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},add1:function(a){},clear:function(){},contains1:function(a){return this.a.contains(a)},copyTo:function(a,b){this.a.copyTo(a,b)},remove1:function(a){return false},getEnumerator:function(){return this.a.getEnumerator()},isFixedSize:function(){return true},add:function(a){return-1},contains:function(a){return this.a.contains(a)},indexOf1:function(a){return this.a.indexOf(a)},insert1:function(a,b){},remove: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.$ag.$type.specialize(0),$.ig.IList.prototype.$type])},true);$.ig.util.defType("NameValueCollection:bl","Object",{a:null,init:function(){$.ig.$op.init.call(this);this.a=new $$t.ax(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);$.ig.util.defType("IOrderedEnumerable$1:bu","Object",{$type:new $.ig.Type("IOrderedEnumerable$1",null,[$$t.$ad.$type.specialize(0),$.ig.IEnumerable.prototype.$type])},true);$.ig.util.defType("Enumerable:bz","Object",{init:function(){$.ig.$op.init.call(this)},where$1:function($tSource,a){var $self=this;var $iter=function(){return function($tSource,a){return{$state:0,$this:$self,$current:null,$b:null,$c:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$c=this.$this.getEnumerator();this.$state=7;break;case 2:this.$b=this.$c.current();this.$state=3;break;case 3:if(a(this.$b)){this.$state=4}else{this.$state=6}break;case 4:this.$current=this.$b;this.$state=5;return true;case 5:this.$state=6;break;case 6:this.$state=7;break;case 7:if(this.$c.moveNext()){this.$state=2}else{this.$state=8}break;case 8:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,a)};return new $.ig.GenericEnumerable$1($tSource,$iter)},where$11:function($tSource,a){var $self=this;var $iter=function(){return function($tSource,a){return{$state:0,$this:$self,$current:null,$b:0,$c:null,$d:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$b=0;this.$state=1;break;case 1:this.$d=this.$this.getEnumerator();this.$state=7;break;case 2:this.$c=this.$d.current();this.$state=3;break;case 3:if(a(this.$c,this.$b)){this.$state=4}else{this.$state=6}break;case 4:this.$current=this.$c;this.$state=5;return true;case 5:this.$state=6;break;case 6:this.$b++;this.$state=7;break;case 7:if(this.$d.moveNext()){this.$state=2}else{this.$state=8}break;case 8:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,a)};return new $.ig.GenericEnumerable$1($tSource,$iter)},select$2:function($tSource,$tResult,a){var $self=this;var $iter=function(){return function($tSource,$tResult,a){return{$state:0,$this:$self,$current:null,$b:null,$c:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$c=this.$this.getEnumerator();this.$state=4;break;case 2:this.$b=this.$c.current();this.$current=a(this.$b);this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$c.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,$tResult,a)};return new $.ig.GenericEnumerable$1($tResult,$iter)},selectMany$2:function($tSource,$tResult,a){var $self=this;var $iter=function(){return function($tSource,$tResult,a){return{$state:0,$this:$self,$current:null,$b:null,$c:null,$d:null,$e:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$c=this.$this.getEnumerator();this.$state=8;break;case 2:this.$b=this.$c.current();this.$state=3;break;case 3:this.$e=a(this.$b).getEnumerator();this.$state=6;break;case 4:this.$d=this.$e.current();this.$current=this.$d;this.$state=5;return true;case 5:this.$state=6;break;case 6:if(this.$e.moveNext()){this.$state=4}else{this.$state=7}break;case 7:this.$state=8;break;case 8:if(this.$c.moveNext()){this.$state=2}else{this.$state=9}break;case 9:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,$tResult,a)};return new $.ig.GenericEnumerable$1($tResult,$iter)},ofType$1:function($tResult){var $self=this;var $iter=function(){return function($tResult){return{$state:0,$this:$self,$current:null,$a:null,$b:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$b=this.$this.getEnumerator();this.$state=7;break;case 2:this.$a=this.$b.current();this.$state=3;break;case 3:if($.ig.util.cast($tResult,this.$a)!==null){this.$state=4}else{this.$state=6}break;case 4:this.$current=this.$a;this.$state=5;return true;case 5:this.$state=6;break;case 6:this.$state=7;break;case 7:if(this.$b.moveNext()){this.$state=2}else{this.$state=8}break;case 8:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tResult)};return new $.ig.GenericEnumerable$1($tResult,$iter)},last$1:function($tSource){var a=$.ig.util.cast($$t.$ag.$type.specialize($tSource),this);if(a!=null){return a.item(a.count()-1)}var b=null;var d=this.getEnumerator();while(d.moveNext()){var c=d.current();b=c}return b},first$1:function($tSource){var b=this.getEnumerator();while(b.moveNext()){var a=b.current();return a}return null},firstOrDefault$1:function($tSource){var b=this.getEnumerator();while(b.moveNext()){var a=b.current();return a}return null},orderBy$2:function($tSource,$tKey,a){var $self=this;var b=new $$t.b1($tSource,$self);b.sort1(function(c,d){var e=c;var f=d;var g=a(e);var h=a(f);if($.ig.util.cast($$t.$h.$type,g)!==null){return $.ig.util.cast($$t.$h.$type,g).compareTo(h)}else{return g.toString().compareTo(h.toString())}});return b},orderByDescending$2:function($tSource,$tKey,a){var $self=this;var b=new $$t.b1($tSource,$self);b.sort1(function(c,d){var e=d;var f=c;var g=a(e);var h=a(f);if($.ig.util.cast($$t.$h.$type,g)!==null){return $.ig.util.cast($$t.$h.$type,g).compareTo(h)}else{return g.toString().compareTo(h.toString())}});return b},toList$1:function($tSource){var a=new $$t.al($tSource,1,this);return a},d:function(a,b){var $self=this;var $iter=function(){return function(a,b){return{$state:0,$this:$self,$current:null,$c:0,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$c=a;this.$state=5;break;case 2:this.$current=this.$c;this.$state=3;return true;case 3:this.$state=4;break;case 4:this.$c++;this.$state=5;break;case 5:if(this.$c<b){this.$state=2}else{this.$state=6}break;case 6:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}(a,b)};return new $.ig.GenericEnumerable$1($.ig.Number.prototype.$type,$iter)},concat$1:function($tSource,a){var $self=this;var $iter=function(){return function($tSource,a){return{$state:0,$this:$self,$current:null,$b:null,$c:null,$d:null,$e:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$c=this.$this.getEnumerator();this.$state=4;break;case 2:this.$b=this.$c.current();this.$current=this.$b;this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$c.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=6;break;case 6:this.$e=a.getEnumerator();this.$state=9;break;case 7:this.$d=this.$e.current();this.$current=this.$d;this.$state=8;return true;case 8:this.$state=9;break;case 9:if(this.$e.moveNext()){this.$state=7}else{this.$state=10}break;case 10:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,a)};return new $.ig.GenericEnumerable$1($tSource,$iter)},max:function(){var a=true;var b=0;var d=this.getEnumerator();while(d.moveNext()){var c=d.current();if(a){a=false;b=c}else{b=Math.max(b,c)}}return b},max$1:function($tSource,a){return this.select$2($tSource,$.ig.Number.prototype.$type,a).max()},min:function(){var a=true;var b=0;var d=this.getEnumerator();while(d.moveNext()){var c=d.current();if(a){a=false;b=c}else{b=Math.min(b,c)}}return b},min$1:function($tSource,a){return this.select$2($tSource,$.ig.Number.prototype.$type,a).max()},count$1:function($tSource){var a=0;var c=this.getEnumerator();while(c.moveNext()){var b=c.current();a++}return a},reverse$1:function($tSource){var $self=this;var $iter=function(){return function($tSource){return{$state:0,$this:$self,$current:null,$a:null,$b:0,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$a=new $$t.al($tSource,1,this.$this);this.$state=1;break;case 1:this.$b=this.$a.count()-1;this.$state=5;break;case 2:this.$current=this.$a.__inner[this.$b];this.$state=3;return true;case 3:this.$state=4;break;case 4:this.$b--;this.$state=5;break;case 5:if(this.$b>0){this.$state=2}else{this.$state=6}break;case 6:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource)};return new $.ig.GenericEnumerable$1($tSource,$iter)},cast$1:function($tResult){if(this==null){throw new $$t.ca("source")}var a=$.ig.util.cast($$t.$ad.$type.specialize($tResult),this);if(a!=null){return a}var b=new $$t.al($tResult,0);var d=this.getEnumerator();while(d.moveNext()){var c=d.current();if($.ig.util.cast($tResult,c)!==null){b.add1(c)}else{b.add1(null)}}return b},take$1:function($tSource,a){var $self=this;var $iter=function(){return function($tSource,a){return{$state:0,$this:$self,$current:null,$b:null,$c:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$c=this.$this.getEnumerator();this.$state=9;break;case 2:this.$b=this.$c.current();this.$state=3;break;case 3:if(a>0){this.$state=4}else{this.$state=6}break;case 4:a--;this.$current=this.$b;this.$state=5;return true;case 5:this.$state=8;break;case 6:this.$state=-2;return false;case 7:this.$state=8;break;case 8:this.$state=9;break;case 9:if(this.$c.moveNext()){this.$state=2}else{this.$state=10}break;case 10:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,a)};return new $.ig.GenericEnumerable$1($tSource,$iter)},skip$1:function($tSource,a){var $self=this;var $iter=function(){return function($tSource,a){return{$state:0,$this:$self,$current:null,$b:null,$c:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$c=this.$this.getEnumerator();this.$state=8;break;case 2:this.$b=this.$c.current();this.$state=3;break;case 3:if(a<=0){this.$state=4}else{this.$state=6}break;case 4:this.$current=this.$b;this.$state=5;return true;case 5:this.$state=7;break;case 6:a--;this.$state=7;break;case 7:this.$state=8;break;case 8:if(this.$c.moveNext()){this.$state=2}else{this.$state=9}break;case 9:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,a)};return new $.ig.GenericEnumerable$1($tSource,$iter)},any$1:function($tSource){var b=this.getEnumerator();while(b.moveNext()){var a=b.current();return true}return false},contains$1:function($tSource,value_){var a=this.getEnumerator();while(a.moveNext()){var item_=a.current();if(item_===value_){return true}}return false},union$1:function($tSource,a){return null},toArray$1:function($tSource){var a=new $$t.al($tSource,1,this);return a.asArrayList()},elementAt$1:function($tSource,a){var b=$.ig.util.cast($$t.$ag.$type.specialize($tSource),this);if(b!=null){return b.item(a)
}return this.skip$1($tSource,a).first$1($tSource)},sum:function(){var a=0;var c=this.getEnumerator();while(c.moveNext()){var b=c.current();a+=b}return a},sum$1:function($tSource,a){return this.select$2($tSource,Number,a).sum()},$type:new $.ig.Type("Enumerable",$.ig.$ot)},true);$.ig.util.defType("SortedList$1:b1","List$1",{$tElement:null,init:function($tElement,a){this.$tElement=$tElement;this.$type=this.$type.specialize(this.$tElement);$$t.$al.init1.call(this,this.$tElement,1,a)},getEnumerator:function(){return $$t.$al.getEnumerator.call(this)},$type:new $.ig.Type("SortedList$1",$$t.$al.$type.specialize(0),[$$t.$bu.$type.specialize(0)])},true);$.ig.util.defType("IArray:ao","Object",{$type:new $.ig.Type("IArray",null)},true);$.ig.util.defType("AggregateException:cn","Error",{init:function(initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$$t.$a3.init.call(this)},init1:function(initNumber,a){$$t.$a3.init1.call(this,1,a)},init2:function(initNumber,a,b){$$t.$a3.init2.call(this,2,a,b)},$type:new $.ig.Type("AggregateException",$$t.$a3.$type)},true);$.ig.util.defType("ArgumentException:co","Error",{init:function(initNumber,a){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$$t.$a3.init1.call(this,1,a)},init1:function(initNumber,a,b){$$t.$a3.init1.call(this,1,a)},$type:new $.ig.Type("ArgumentException",$$t.$a3.$type)},true);$.ig.util.defType("ArgumentNullException:ca","Error",{init:function(a){$$t.$a3.init1.call(this,1,a+" cannot be null.")},$type:new $.ig.Type("ArgumentNullException",$$t.$a3.$type)},true);$.ig.util.defType("AsyncCompletedEventArgs:cq","EventArgs",{d:null,b:false,f:null,init:function(a,b,c){$$t.$a9.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.$a9.$type)},true);$.ig.util.defType("Environment:cu","Object",{init:function(){$.ig.$op.init.call(this)},a:function(){return"\n"},$type:new $.ig.Type("Environment",$.ig.$ot)},true);$.ig.util.defType("InvalidOperationException:cv","Error",{init:function(initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$$t.$a3.init1.call(this,1,"Invalid operation")},init1:function(initNumber,a){$$t.$a3.init1.call(this,1,a)},$type:new $.ig.Type("InvalidOperationException",$$t.$a3.$type)},true);$.ig.util.defType("Debug:cw","Object",{init:function(){$.ig.$op.init.call(this)},b:function(a,b){},c:function(a){},a:function(a){},$type:new $.ig.Type("Debug",$.ig.$ot)},true);$.ig.util.defType("ICredentials:cz","Object",{$type:new $.ig.Type("ICredentials",null)},true);$.ig.util.defType("NetworkCredential:c0","Object",{init:function(initNumber,a,b){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$$t.$c0.init1.call(this,1,a,b,String.empty())},init1:function(initNumber,a,b,c){$.ig.$op.init.call(this);this.c(a);this.b(b);this.a(c)},getCredential:function(a,b){return this},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},$type:new $.ig.Type("NetworkCredential",$.ig.$ot,[$$t.$cz.$type])},true);$.ig.util.defType("UploadStringCompletedEventArgs:c3","AsyncCompletedEventArgs",{i:null,init:function(a,b,c,d){$$t.$cq.init.call(this,b,c,d);this.i=a},result:function(){this.h();return this.i},$type:new $.ig.Type("UploadStringCompletedEventArgs",$$t.$cq.$type)},true);$.ig.util.defType("WebClient:c4","Object",{init:function(){$.ig.$op.init.call(this);this.c(new $$t.c8)},_d:null,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},uploadStringCompleted:null,h:function(a,b,c,d){var $self=this;$self.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.c3(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.c9(String,d,null)},g:function(a,b,c,d){a.e(b)},f:function(a,b,c,d){a.d(new $$t.a3(1,d))},$type:new $.ig.Type("WebClient",$.ig.$ot)},true);$.ig.util.defType("WebHeaderCollection:c8","NameValueCollection",{init:function(){$$t.$bl.init.call(this)},$type:new $.ig.Type("WebHeaderCollection",$$t.$bl.$type)},true);$.ig.util.defType("FaultCode:dx","Object",{init:function(a){$.ig.$op.init.call(this);this.a(a)},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},$type:new $.ig.Type("FaultCode",$.ig.$ot)},true);$.ig.util.defType("FaultException:dy","Error",{init:function(a,b,c){$$t.$a3.init.call(this);this.reason(a);this.code(b);this.action(c)},_action:null,action:function(value){if(arguments.length===1){this._action=value;return value}else{return this._action}},_code:null,code:function(value){if(arguments.length===1){this._code=value;return value}else{return this._code}},_reason:null,reason:function(value){if(arguments.length===1){this._reason=value;return value}else{return this._reason}},$type:new $.ig.Type("FaultException",$$t.$a3.$type)},true);$.ig.util.defType("FaultException$1:d0","FaultException",{$tDetail:null,init:function($tDetail,a,b,c,d){this.$tDetail=$tDetail;this.$type=this.$type.specialize(this.$tDetail);$$t.$dy.init.call(this,b,c,d);this.detail(a)},_detail:null,detail:function(value){if(arguments.length===1){this._detail=value;return value}else{return this._detail}},$type:new $.ig.Type("FaultException$1",$$t.$dy.$type)},true);$.ig.util.defType("FaultReason:dz","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);$.ig.util.defType("StringBuilder:d1","Object",{_internal:null,internal:function(value){if(arguments.length===1){this._internal=value;return value}else{return this._internal}},init:function(){$.ig.$op.init.call(this);this._internal=[]},d:function(str_){this._internal.push(str_);return this},e:function(a){var str_=a.b();this._internal.push(str_);return this},c:function(chr_){this._internal.push(chr_);return this},f:function(str_){this._internal.push(str_+String.fromCharCode(10));return this},g:function(index_,chr_){this._internal.splice(index_,0,chr_);return this},h:function(index_,str_){this._internal.splice(index_,0,str_);return this},i:function(startIndex_,length_){this._internal.splice(startIndex_,length_);return this},b:function(){return this._internal.join("")},$type:new $.ig.Type("StringBuilder",$.ig.$ot)},true);$.ig.util.defType("NotImplementedException:a2","Error",{init:function(){$$t.$a3.init1.call(this,1,"not implemented")},$type:new $.ig.Type("NotImplementedException",$$t.$a3.$type)},true);$.ig.util.defType("Encoding:c5","Object",{init:function(){$.ig.$op.init.call(this)},uTF8:function(){if($$t.$c5.g==null){$$t.$c5.g=new $$t.c6}return $$t.$c5.g},unicode:function(){if($$t.$c5.f==null){$$t.$c5.f=new $$t.c7}return $$t.$c5.f},getString: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.ca("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){},$type:new $.ig.Type("Encoding",$.ig.$ot)},true);$.ig.util.defType("UnicodeEncoding:c7","Encoding",{init:function(){$$t.$c5.init.call(this)},getString:function(bytes_,a,b){var c="";for(var i_=a;i_<b;i_=i_+2){if(bytes_[i_]==0){break}if(i_+1>=b){c=c+"�"}else{var d=bytes_[i_].toString(16);var e=bytes_[i_+1].toString(16);var f=$.ig.Number.prototype.parseInt(e+d,16);c=c+String.fromCharCode(f)}}return c},getByteCount:function(a,b,c){return 0},getBytes2:function(a,b,c,d,e){return 0},getBytes:function(a,b,c){return $$t.$c5.getBytes.call(this,a,b,c)},getBytes1:function(input_){var a=new Array(input_.length*2);for(var i_=0;i_<input_.length;i_++){var hex_=input_.charCodeAt(i_).toString(16).padLeft(4,"0");a[2*i_]=$.ig.Number.prototype.parseInt(hex_.substr(2),16);a[2*i_+1]=$.ig.Number.prototype.parseInt(hex_.substr(0,2),16)}return a},$type:new $.ig.Type("UnicodeEncoding",$$t.$c5.$type)},true);$.ig.util.defType("UTF8Encoding:c6","Encoding",{init:function(){$$t.$c5.init.call(this)},getString:function(bytes_,a,b){var ret_="";for(var i_=a;i_<b;i_++){if(bytes_[i_]==0){break}ret_=ret_+String.fromCharCode(bytes_[i_])}ret_=decodeURIComponent(escape(ret_));return ret_},getByteCount:function(a,b,c){return 0},getBytes2:function(a,b,c,d,e){return 0},getBytes:function(a,b,c){return $$t.$c5.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},$type:new $.ig.Type("UTF8Encoding",$$t.$c5.$type)},true);$.ig.util.defType("Task:da","Object",{_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_b:false,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},init:function(initNumber,a){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$$t.$da.init1.call(this,1,a,null)},init1:function(initNumber,a,b){var $self=this;$.ig.$op.init.call(this);var c=function(){};var d=function(e){if(e==null){$self.b(true)}else{$self.a(new $$t.cn(2,"Exception occurred during task execution",e))}};this.c(a.done(c).fail(d));this.d(b)},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(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},e:function(a){var $self=this;var b=function(){return a($self)};var c=function(d){return a($self)};var d=$self.c().done(b).fail(c);return new $$t.da(0,d)},f:function($tNewResult,a){var $self=this;var b=new $$t.de($tNewResult,0);var c=function(){try{var d=a($self);b.e(d)}catch(e_){b.d(e_)}};var d=function(e){return c()};var e=function(f){return c()};$self.c().done(d).fail(e);return b.b()},$type:new $.ig.Type("Task",$.ig.$ot)},true);$.ig.util.defType("Task$1:c9","Task",{$tResult:null,init:function($tResult,a,b){var $self=this;this.h=false;this.$tResult=$tResult;this.$type=this.$type.specialize(this.$tResult);$$t.$da.init1.call(this,1,a,b);var c=function(d){var e=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){var $self=this;return $$t.$da.e.call($self,function(b){return a(b)})},j:function($tNewResult,a){var $self=this;var b=function(c){return a(c)};return $self.k($.ig.$op.$type,b).k($tNewResult,function(c){return c.m()})},k:function($tNewResult,a){return $$t.$da.f.call(this,$tNewResult,a)},$type:new $.ig.Type("Task$1",$$t.$da.$type)},true);$.ig.util.defType("TaskCompletionSource$1:de","Object",{$tResult:null,_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},init:function($tResult,initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}this.$tResult=$tResult;this.$type=this.$type.specialize(this.$tResult);$$t.$de.init1.call(this,this.$tResult,1,null)},init1:function($tResult,initNumber,a){this.$tResult=$tResult;this.$type=this.$type.specialize(this.$tResult);$.ig.$op.init.call(this);this.a($.ig.util.deferred());this.b(new $$t.c9(this.$tResult,this.a().promise(),a))},c:function(){this.a().reject(null)},d:function(a){this.a().reject(a)},e:function(a){this.a().resolve(a)},_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},$type:new $.ig.Type("TaskCompletionSource$1",$.ig.$ot)},true);$.ig.util.defType("TaskFactory:d4","Object",{init:function(){$.ig.$op.init.call(this)},c:function(a,b){var $self=this;return new $$t.da(0,$self.b($self.a(a)).always(function(){return b(a)}))},d:function($tResult,a,b){var $self=this;var c=new $$t.de($tResult,0);$self.b($self.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 $self=this;var c=function(d){return b(d)};return $self.d($.ig.$op.$type,a,c).j($tResult,function(d){return 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);$.ig.util.defType("Tuple$2:d5","Object",{$t1:null,$t2:null,_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}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);$.ig.util.defType("Uri:c1","Object",{init:function(a){$.ig.$op.init.call(this);this.value(a)},_value:null,value:function(value){if(arguments.length===1){this._value=value;return value}else{return this._value}},$type:new $.ig.Type("Uri",$.ig.$ot)},true);$.ig.util.defType("JavaScriptSerializer:d6","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);$.ig.util.defType("XObject:f9","Object",{init:function(a){$.ig.$op.init.call(this);this.backingNode(a)},_backingNode:null,backingNode:function(value){if(arguments.length===1){this._backingNode=value;return value}else{return this._backingNode}},c:function(){},toString:function(){if(this.backingNode()!=null){return $$t.$gi.xmlNodeToString(this.backingNode())}else{return""}},$type:new $.ig.Type("XObject",$.ig.$ot)},true);$.ig.util.defType("XAttribute:gj","XObject",{init:function(a){$$t.$f9.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.$gi.b(this.backingNode())},$type:new $.ig.Type("XAttribute",$$t.$f9.$type)},true);$.ig.util.defType("XNode:gk","XObject",{init:function(a){$$t.$f9.init.call(this,a)},$type:new $.ig.Type("XNode",$$t.$f9.$type)},true);$.ig.util.defType("XContainer:gl","XNode",{init:function(a){$$t.$gk.init.call(this,a)},h:function(a){var b=null;for(var c=0;c<this.backingNode().childNodes.length;c++){var d=this.backingNode().childNodes.item(c);if(d.nodeType==1&&$$t.$gi.d(d)==a.c()&&d.namespaceURI==a.d()){b=d}}if(b==null){return null}else{return new $$t.gm(0,b)}},d:function(){return this.f(null)},e:function(a){return this.f(a)},f:function(a){var b=new $$t.al($$t.$gm.$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.$gi.d(d)==a.c()&&d.namespaceURI==a.d()){e=true}}else{e=true}if(e){b.add1(new $$t.gm(0,d))}}}return b},g:function(a){var b=this.backingNode();var c;if($.ig.util.cast($$t.$gp.$type,this)!==null){c=this.backingNode()}else{c=this.backingNode().ownerDocument}if($.ig.util.cast($$t.$gj.$type,a)!==null){a.e(b)}else if($.ig.util.cast($$t.$gm.$type,a)!==null){a.j(b,c)}},$type:new $.ig.Type("XContainer",$$t.$gk.$type)},true);$.ig.util.defType("XDocument:gp","XContainer",{init:function(initNumber,a){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$$t.$gl.init.call(this,a)},init1:function(initNumber){$$t.$gl.init.call(this,$$t.$gi.j())},c:function(){return 9},i:function(a){return new $$t.gp(0,$$t.$gi.n(a))},$type:new $.ig.Type("XDocument",$$t.$gl.$type)},true);$.ig.util.defType("XElement:gm","XContainer",{init:function(initNumber,a){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$$t.$gl.init.call(this,a)},init1:function(initNumber,a){$$t.$gm.init2.call(this,2,a,null)},init2:function(initNumber,a,b){$$t.$gl.init.call(this,$$t.$gi.o(a.c(),a.d()));var c=b==null?"":b.toString();this.i(c)},i:function(a){if(arguments.length===1){$$t.$gi.h(this.backingNode(),a);return a}else{return $$t.$gi.c(this.backingNode())}},c:function(){return 1},l:function(){return $$t.$gn.e($$t.$gi.d(this.backingNode()),this.backingNode().namespaceURI)},k:function(a){return new $$t.gj($$t.$gi.i(this.backingNode(),a.c(),a.d()))},j:function(a,b){if(this.backingNode().ownerDocument!=b){this.backingNode($$t.$gi.p(b,this.backingNode()))}a.appendChild(this.backingNode())},$type:new $.ig.Type("XElement",$$t.$gl.$type)},true);$.ig.util.defType("XmlUtils:gi","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.$gi.a()){return $$t.$gi.m(a)}else{return $$t.$gi.l(a)}},xmlNodeToString:function(a){if($$t.$gi.a()){return $$t.$gi.f(a)}else{return $$t.$gi.e(a)}},j:function(){var a;if($$t.$gi.a()){a=$$t.$gi.m("<dummy/>");a.removeChild(a.documentElement)}else{a=$$t.$gi.k()}return a},o:function(a,b){var doc_=$$t.$gi.j();if($$t.$gi.a()){return doc_.createElementNS(b,a)}else{var name_=a;var namespaceURI_=b;return doc_.createNode(1,name_,namespaceURI_)}},c:function(a){if($$t.$gi.a()){return a.textContent}else{var node_=a;return node_.text}},h:function(a,b){if($$t.$gi.a()){a.textContent=b}else{var node_=a;var text_=b;node_.text=text_}},p:function(a,b){if($$t.$gi.a()){return a.importNode(b,true)}else{return b}},d:function(a){if($$t.$gi.a()){return a.localName}else{var node_=a;return node_.baseName}},i:function(a,b,c){if($$t.$gi.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.$gi.a()){return a.nodeValue}else{var attr_=a;return attr_.value}},$type:new $.ig.Type("XmlUtils",$.ig.$ot)},true);$.ig.util.defType("XName:gn","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.$go.c(this.b)},e:function(a,b){return new $$t.gn(a,b)},$type:new $.ig.Type("XName",$.ig.$ot)},true);$.ig.util.defType("XNamespace:go","Object",{a:null,init:function(a){$.ig.$op.init.call(this);this.a=a},c:function(a){return new $$t.go(a)},d:function(){return $$t.$go.c("http://www.w3.org/2000/xmlns/")},b:function(){return this.a},$type:new $.ig.Type("XNamespace",$.ig.$ot)},true);$$t.$dd.created=0;$$t.$dd.ranToCompletion=5;$$t.$dd.canceled=6;$$t.$dd.faulted=7;$$t.$cs.ascending=0;$$t.$cs.descending=1;$$t.$ba.add=0;$$t.$ba.remove=1;$$t.$ba.replace=2;$$t.$ba.reset=4;$$t.$c5.g=null;$$t.$c5.f=null;$.ig.util.extCopy($.ig.Queryable,[[[$.ig.SortedList$1,$.ig.IGrouping$2,$.ig.ICollection$1,$.ig.IEnumerable$1,$.ig.IList$1,$.ig.List$1,$.ig.IEnumerable,$.ig.ICollection,$.ig.IList,$.ig.Array,$.ig.Dictionary,$.ig.XmlNodeList,$.ig.XmlNamedNodeMap,$.ig.AbstractEnumerable,$.ig.IDictionary$2,$.ig.Dictionary$2,$.ig.GenericEnumerable$1,$.ig.ReadOnlyCollection$1,$.ig.Stack$1,$.ig.IOrderedEnumerable$1],["asQueryable"]]]);$.ig.util.extCopy($.ig.Enumerable,[[[$.ig.SortedList$1,$.ig.IGrouping$2,$.ig.ICollection$1,$.ig.IEnumerable$1,$.ig.IList$1,$.ig.List$1,$.ig.IDictionary$2,$.ig.Dictionary$2,$.ig.GenericEnumerable$1,$.ig.ReadOnlyCollection$1,$.ig.Stack$1,$.ig.IOrderedEnumerable$1],["where$1","where$11","select$2","selectMany$2","last$1","first$1","firstOrDefault$1","orderBy$2","orderByDescending$2","toList$1","concat$1","max","max$1","min","min$1","count$1","reverse$1","take$1","skip$1","any$1","contains$1","union$1","toArray$1","elementAt$1","sum","sum$1"]],[[$.ig.SortedList$1,$.ig.IGrouping$2,$.ig.ICollection$1,$.ig.IEnumerable$1,$.ig.IList$1,$.ig.List$1,$.ig.IEnumerable,$.ig.ICollection,$.ig.IList,$.ig.Array,$.ig.Dictionary,$.ig.XmlNodeList,$.ig.XmlNamedNodeMap,$.ig.AbstractEnumerable,$.ig.IDictionary$2,$.ig.Dictionary$2,$.ig.GenericEnumerable$1,$.ig.ReadOnlyCollection$1,$.ig.Stack$1,$.ig.IOrderedEnumerable$1],["ofType$1","cast$1"]]])})(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","RuntimeTypeHandle:h","MethodInfo:i","MethodBase:j","MemberInfo:k","ParameterInfo:l","TypeCode:m","Enum:n","Number:o","IComparable:p","Number:q","Single:r","Number:s","ConstructorInfo:t","String:u","Array:v","RegExp:w","Cube:x","CubeType:y","Date:z","Date:aa","Number:ab","Catalog:ac","Dimension:ad","DimensionType:ae","KpiDimension:af","HierarchyOrigin:ai","AggregatorType:aj","CardinalityType:ak","MemberType:al","Hierarchy:am","Kpi:an","Level:ao","Measure:ap","KpiMeasure:aq","MeasureGroup:ar","MeasureGroupDimension:as","Member:at","Nullable$1:au","OlapResult:av","IList$1:aw","ICollection$1:ax","IEnumerable$1:ay","IEnumerable:az","IEnumerator:a0","IEnumerator$1:a1","OlapResultAxis:a2","PositionResolver$2:a3","List$1:a4","IArrayList:a5","Array:a6","ICollection:a7","CompareCallback:a8","MulticastDelegate:a9","IntPtr:ba","IList:bb","IDisposable:bc","IArray:bd","Script:be","Func$3:bf","Action$1:bg","PositionItemInfo$2:bh","Dictionary$2:bi","IDictionary$2:bj","IDictionary:bk","Dictionary:bl","IEqualityComparer$1:bm","KeyValuePair$2:bn","NotImplementedException:bo","Error:bp","IHierarchicalPositionItem$2:bq","IPositionItem$2:br","IPosition$2:bs","Math:bt","Number:bu","Number:bv","Number:bw","Number:bx","Number:by","Number:bz","Number:b0","Enumerable:b1","Func$2:b2","IOrderedEnumerable$1:b3","SortedList$1:b4","ArgumentNullException:b5","EventHandler$1:b6","Delegate:b7","ListSortDirection:b8","OlapResultTuple:b9","ReadOnlyCollection$1:ca","OlapResultAxisMember:cb","OlapResultCell:cc","IConnection:cd","IOlapDataProviderFactory:ce","IOlapDiscoverDataProvider:cf","Task$1:cg","Task:ch","JQueryPromise:ci","Action:cj","AggregateException:ck","TaskStatus:cl","TaskCompletionSource$1:cm","JQueryDeferred:cn","JQuery:co","JQueryObject:cp","Element:cq","ElementAttributeCollection:cr","ElementCollection:cs","WebStyle:ct","ElementNodeType:cu","Document:cv","EventListener:cw","IElementEventHandler:cx","ElementEventHandler:cy","ElementAttribute:cz","JQueryPosition:c0","JQueryCallback:c1","JQueryEvent:c2","JQueryUICallback:c3","IOlapExecuteCommandProvider:c4","HeaderCellsLayoutOrientation:c5","LevelSpanManager:c6","SpanSource:c7","ITableViewHeadersFactory:c8","TableViewHeadersFactory:c9","ArrayListCollection$1:da","INotifyCollectionChanged:db","NotifyCollectionChangedEventHandler:dc","NotifyCollectionChangedEventArgs:dd","EventArgs:de","NotifyCollectionChangedAction:df","TableViewHeaderCellSource:dg","OlapTableViewHeaderCell:dh","TableCompactViewHeadersFactory:di","TableViewImpl:dj","TableViewSettings:dk","ResultHeaderSorter:dl","ResultSorter$1:dm","AxisTupleVisitor:dn","LevelSortDirection:dp","LevelSortBehavior:dq","AxisHeaderSortingVisitor:dr","TupleSortDirection:ds","ResultColumnValueSorter:dt","AxisValueSortingVisitor:du","OlapTableViewResultCell:dv","OlapResultView:dw","InvalidOperationException:dx","ResultViewHelper:dy","IOlapDataSource:dz","OlapMetadataTreeItem:d0","OlapMetadataTreeItemType:d1","MeasureListLocation:d2","MeasureList:d3","OlapDataSource:d4","DataSourceBaseOptions:d5","CubeMetaItemsCache:d6","MeasureGroupMetaItemsCache:d7","Tuple$2:d8","NotSupportedException:d9","PositionInfo:ea","TaskExtensions:eb","AxisElement:ec","AxisDefinitionParser:ed","Debug:ee","TaskFactory:ef","MetaTreeHelper:eg","HierarchyItemPosition:eh","CoreOlapElementParser:el","KeyValueItem:eu","HierarchyFilterView:ev","FilterMember:ew","INotifyPropertyChanged:ex","PropertyChangedEventHandler:ey","PropertyChangedEventArgs:ez","FilterMemberStateChangedEventArgs:e0","DataSourceBase:e1","jQueryUtils:e2","OlapUtilities:e3","OlapTableView:e4","AbstractEnumerable:e5","Func$1:e6","AbstractEnumerator:e7","GenericEnumerable$1:e8","GenericEnumerator$1:e9"]);$.ig.util.defType("LevelSortBehavior","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("LevelSortBehavior",$.ig.Enum.prototype.$type)},true);$.ig.util.defType("OlapMetadataTreeItemType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("OlapMetadataTreeItemType",$.ig.Enum.prototype.$type)},true);$.ig.util.defType("MeasureListLocation","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("MeasureListLocation",$.ig.Enum.prototype.$type)},true);$.ig.util.defType("HeaderCellsLayoutOrientation","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("HeaderCellsLayoutOrientation",$.ig.Enum.prototype.$type)},true);$.ig.util.defType("MemberType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("MemberType",$.ig.Enum.prototype.$type)},true);$.ig.util.defType("CardinalityType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("CardinalityType",$.ig.Enum.prototype.$type)},true);$.ig.util.defType("AggregatorType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("AggregatorType",$.ig.Enum.prototype.$type)},true);$.ig.util.defType("HierarchyOrigin","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("HierarchyOrigin",$.ig.Enum.prototype.$type)},true);$.ig.util.defType("DimensionType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("DimensionType",$.ig.Enum.prototype.$type)},true);$.ig.util.defType("CubeType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("CubeType",$.ig.Enum.prototype.$type)},true);$.ig.util.defType("ICoreOlapElement","Object",{$type:new $.ig.Type("ICoreOlapElement",null)},true);$.ig.util.defType("Cube","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_catalogName:null,catalogName:function(value){if(arguments.length===1){this._catalogName=value;return value}else{return this._catalogName}},_name:null,name:function(value){if(arguments.length===1){this._name=value;return value}else{return this._name}},_cubeType:null,cubeType:function(value){if(arguments.length===1){this._cubeType=value;return value}else{return this._cubeType}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},_lastProcessed:null,lastProcessed:function(value){if(arguments.length===1){this._lastProcessed=value;return value}else{return this._lastProcessed}},_lastUpdated:null,lastUpdated:function(value){if(arguments.length===1){this._lastUpdated=value;return value}else{return this._lastUpdated}},_description:null,description:function(value){if(arguments.length===1){this._description=value;return value}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.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("Catalog","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(value){if(arguments.length===1){this._name=value;return value}else{return this._name}},_uniqueName:null,uniqueName:function(value){if(arguments.length===1){this._uniqueName=value;return value}else{return this._uniqueName}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},_description:null,description:function(value){if(arguments.length===1){this._description=value;return value}else{return this._description}},$type:new $.ig.Type("Catalog",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("Dimension","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(value){if(arguments.length===1){this._name=value;return value}else{return this._name}},_uniqueName:null,uniqueName:function(value){if(arguments.length===1){this._uniqueName=value;return value}else{return this._uniqueName}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},_dimensionType:null,dimensionType:function(value){if(arguments.length===1){this._dimensionType=value;return value}else{return this._dimensionType}},_description:null,description:function(value){if(arguments.length===1){this._description=value;return value}else{return this._description}},_defaultHierarchy:null,defaultHierarchy:function(value){if(arguments.length===1){this._defaultHierarchy=value;return value}else{return this._defaultHierarchy}},$type:new $.ig.Type("Dimension",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("KpiDimension","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(value){if(arguments.length===1){this._name=value;return value}else{return this._name}},_uniqueName:null,uniqueName:function(value){if(arguments.length===1){this._uniqueName=value;return value}else{return this._uniqueName}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},$type:new $.ig.Type("KpiDimension",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("Hierarchy","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(value){if(arguments.length===1){this._name=value;return value}else{return this._name}},_uniqueName:null,uniqueName:function(value){if(arguments.length===1){this._uniqueName=value;return value}else{return this._uniqueName}},_defaultHierarchy:null,defaultHierarchy:function(value){if(arguments.length===1){this._defaultHierarchy=value;return value}else{return this._defaultHierarchy}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},_description:null,description:function(value){if(arguments.length===1){this._description=value;return value}else{return this._description}},_defaultMember:null,defaultMember:function(value){if(arguments.length===1){this._defaultMember=value;return value}else{return this._defaultMember}},_allMember:null,allMember:function(value){if(arguments.length===1){this._allMember=value;
return value}else{return this._allMember}},_dimensionUniqueName:null,dimensionUniqueName:function(value){if(arguments.length===1){this._dimensionUniqueName=value;return value}else{return this._dimensionUniqueName}},_hierarchyOrigin:null,hierarchyOrigin:function(value){if(arguments.length===1){this._hierarchyOrigin=value;return value}else{return this._hierarchyOrigin}},_hierarchyDisplayFolder:null,hierarchyDisplayFolder:function(value){if(arguments.length===1){this._hierarchyDisplayFolder=value;return value}else{return this._hierarchyDisplayFolder}},$type:new $.ig.Type("Hierarchy",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("Kpi","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(value){if(arguments.length===1){this._name=value;return value}else{return this._name}},_uniqueName:null,uniqueName:function(value){if(arguments.length===1){this._uniqueName=value;return value}else{return this._uniqueName}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},_description:null,description:function(value){if(arguments.length===1){this._description=value;return value}else{return this._description}},_measureGroupName:null,measureGroupName:function(value){if(arguments.length===1){this._measureGroupName=value;return value}else{return this._measureGroupName}},_kpiDisplayFolder:null,kpiDisplayFolder:function(value){if(arguments.length===1){this._kpiDisplayFolder=value;return value}else{return this._kpiDisplayFolder}},_kpiValue:null,kpiValue:function(value){if(arguments.length===1){this._kpiValue=value;return value}else{return this._kpiValue}},_kpiGoal:null,kpiGoal:function(value){if(arguments.length===1){this._kpiGoal=value;return value}else{return this._kpiGoal}},_kpiStatus:null,kpiStatus:function(value){if(arguments.length===1){this._kpiStatus=value;return value}else{return this._kpiStatus}},_kpiTrend:null,kpiTrend:function(value){if(arguments.length===1){this._kpiTrend=value;return value}else{return this._kpiTrend}},_kpiStatusGraphic:null,kpiStatusGraphic:function(value){if(arguments.length===1){this._kpiStatusGraphic=value;return value}else{return this._kpiStatusGraphic}},_kpiTrendGraphic:null,kpiTrendGraphic:function(value){if(arguments.length===1){this._kpiTrendGraphic=value;return value}else{return this._kpiTrendGraphic}},_kpiWeight:null,kpiWeight:function(value){if(arguments.length===1){this._kpiWeight=value;return value}else{return this._kpiWeight}},_parentKpiName:null,parentKpiName:function(value){if(arguments.length===1){this._parentKpiName=value;return value}else{return this._parentKpiName}},_currentTimeMember:null,currentTimeMember:function(value){if(arguments.length===1){this._currentTimeMember=value;return value}else{return this._currentTimeMember}},$type:new $.ig.Type("Kpi",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("Level","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(value){if(arguments.length===1){this._name=value;return value}else{return this._name}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},_uniqueName:null,uniqueName:function(value){if(arguments.length===1){this._uniqueName=value;return value}else{return this._uniqueName}},_description:null,description:function(value){if(arguments.length===1){this._description=value;return value}else{return this._description}},_depth:0,depth:function(value){if(arguments.length===1){this._depth=value;return value}else{return this._depth}},_hierarchyUniqueName:null,hierarchyUniqueName:function(value){if(arguments.length===1){this._hierarchyUniqueName=value;return value}else{return this._hierarchyUniqueName}},_dimensionUniqueName:null,dimensionUniqueName:function(value){if(arguments.length===1){this._dimensionUniqueName=value;return value}else{return this._dimensionUniqueName}},_membersCount:0,membersCount:function(value){if(arguments.length===1){this._membersCount=value;return value}else{return this._membersCount}},_levelOrigin:0,levelOrigin:function(value){if(arguments.length===1){this._levelOrigin=value;return value}else{return this._levelOrigin}},_levelOrderingProperty:null,levelOrderingProperty:function(value){if(arguments.length===1){this._levelOrderingProperty=value;return value}else{return this._levelOrderingProperty}},$type:new $.ig.Type("Level",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("Measure","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(value){if(arguments.length===1){this._name=value;return value}else{return this._name}},_uniqueName:null,uniqueName:function(value){if(arguments.length===1){this._uniqueName=value;return value}else{return this._uniqueName}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},_description:null,description:function(value){if(arguments.length===1){this._description=value;return value}else{return this._description}},_measureGroupName:null,measureGroupName:function(value){if(arguments.length===1){this._measureGroupName=value;return value}else{return this._measureGroupName}},_aggregatorType:null,aggregatorType:function(value){if(arguments.length===1){this._aggregatorType=value;return value}else{return this._aggregatorType}},_defaultFormatString:null,defaultFormatString:function(value){if(arguments.length===1){this._defaultFormatString=value;return value}else{return this._defaultFormatString}},_measureDisplayFolder:null,measureDisplayFolder:function(value){if(arguments.length===1){this._measureDisplayFolder=value;return value}else{return this._measureDisplayFolder}},$type:new $.ig.Type("Measure",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("KpiMeasure","Measure",{init:function(a,b){$.ig.Measure.prototype.init.call(this);this.uniqueName(a);this.caption(b)},_graphic:null,graphic:function(value){if(arguments.length===1){this._graphic=value;return value}else{return this._graphic}},createKpiValueMeasure:function(a){return new $.ig.KpiMeasure(a.kpiValue(),a.caption()+" Value")},createKpiGoalMeasure:function(a){return new $.ig.KpiMeasure(a.kpiGoal(),a.caption()+" Goal")},createKpiWeightMeasure:function(a){return new $.ig.KpiMeasure(a.kpiWeight(),a.caption()+" Weight")},createKpiStatusMeasure:function(a){var b=new $.ig.KpiMeasure(a.kpiStatus(),a.caption()+" Status");b.graphic(a.kpiStatusGraphic());return b},createKpiTrendMeasure:function(a){var b=new $.ig.KpiMeasure(a.kpiTrend(),a.caption()+" Trend");b.graphic(a.kpiTrendGraphic());return b},$type:new $.ig.Type("KpiMeasure",$.ig.Measure.prototype.$type)},true);$.ig.util.defType("MeasureGroup","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_description:null,description:function(value){if(arguments.length===1){this._description=value;return value}else{return this._description}},_name:null,name:function(value){if(arguments.length===1){this._name=value;return value}else{return this._name}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},_cubeName:null,cubeName:function(value){if(arguments.length===1){this._cubeName=value;return value}else{return this._cubeName}},_catalogName:null,catalogName:function(value){if(arguments.length===1){this._catalogName=value;return value}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.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("MeasureGroupDimension","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_cubeName:null,cubeName:function(value){if(arguments.length===1){this._cubeName=value;return value}else{return this._cubeName}},_catalogName:null,catalogName:function(value){if(arguments.length===1){this._catalogName=value;return value}else{return this._catalogName}},_measureGroupName:null,measureGroupName:function(value){if(arguments.length===1){this._measureGroupName=value;return value}else{return this._measureGroupName}},_dimensionUniqueName:null,dimensionUniqueName:function(value){if(arguments.length===1){this._dimensionUniqueName=value;return value}else{return this._dimensionUniqueName}},_measureGroupCardinality:null,measureGroupCardinality:function(value){if(arguments.length===1){this._measureGroupCardinality=value;return value}else{return this._measureGroupCardinality}},_dimensionCardinality:null,dimensionCardinality:function(value){if(arguments.length===1){this._dimensionCardinality=value;return value}else{return this._dimensionCardinality}},_isDimensionVisible:false,isDimensionVisible:function(value){if(arguments.length===1){this._isDimensionVisible=value;return value}else{return this._isDimensionVisible}},_isFactDimension:false,isFactDimension:function(value){if(arguments.length===1){this._isFactDimension=value;return value}else{return this._isFactDimension}},_dimensionPath:null,dimensionPath:function(value){if(arguments.length===1){this._dimensionPath=value;return value}else{return this._dimensionPath}},_dimensionGranularity:null,dimensionGranularity:function(value){if(arguments.length===1){this._dimensionGranularity=value;return value}else{return this._dimensionGranularity}},$type:new $.ig.Type("MeasureGroupDimension",$.ig.Object.prototype.$type)},true);$.ig.util.defType("Member","Object",{init:function(){$.ig.Object.prototype.init.call(this);var a=$.ig.util.toNullable($.ig.Number.prototype.$type,null);this.scope(a)},_cubeName:null,cubeName:function(value){if(arguments.length===1){this._cubeName=value;return value}else{return this._cubeName}},_catalogName:null,catalogName:function(value){if(arguments.length===1){this._catalogName=value;return value}else{return this._catalogName}},_dimensionUniqueName:null,dimensionUniqueName:function(value){if(arguments.length===1){this._dimensionUniqueName=value;return value}else{return this._dimensionUniqueName}},_hierarchyUniqueName:null,hierarchyUniqueName:function(value){if(arguments.length===1){this._hierarchyUniqueName=value;return value}else{return this._hierarchyUniqueName}},_levelUniqueName:null,levelUniqueName:function(value){if(arguments.length===1){this._levelUniqueName=value;return value}else{return this._levelUniqueName}},_levelDepth:0,levelDepth:function(value){if(arguments.length===1){this._levelDepth=value;return value}else{return this._levelDepth}},_name:null,name:function(value){if(arguments.length===1){this._name=value;return value}else{return this._name}},_uniqueName:null,uniqueName:function(value){if(arguments.length===1){this._uniqueName=value;return value}else{return this._uniqueName}},_memberType:null,memberType:function(value){if(arguments.length===1){this._memberType=value;return value}else{return this._memberType}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},_childrenCardinality:0,childrenCardinality:function(value){if(arguments.length===1){this._childrenCardinality=value;return value}else{return this._childrenCardinality}},_parentLevel:0,parentLevel:function(value){if(arguments.length===1){this._parentLevel=value;return value}else{return this._parentLevel}},_parentUniqueName:null,parentUniqueName:function(value){if(arguments.length===1){this._parentUniqueName=value;return value}else{return this._parentUniqueName}},_description:null,description:function(value){if(arguments.length===1){this._description=value;return value}else{return this._description}},_scope:$.ig.util.toNullable($.ig.Number.prototype.$type,null),scope:function(value){if(arguments.length===1){this._scope=value;return value}else{return this._scope}},$type:new $.ig.Type("Member",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("OlapResult","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_isEmpty:false,isEmpty:function(value){if(arguments.length===1){this._isEmpty=value;return value}else{return this._isEmpty}},_axes:null,axes:function(value){if(arguments.length===1){this._axes=value;return value}else{return this._axes}},_cells:null,cells:function(value){if(arguments.length===1){this._cells=value;return value}else{return this._cells}},$type:new $.ig.Type("OlapResult",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapResultAxis","Object",{init:function(a,b){$.ig.Object.prototype.init.call(this);this.tuples(a.toList$1($.ig.OlapResultTuple.prototype.$type));this.tupleSize(b);this.positionResolver(new $.ig.PositionResolver$2(String,$.ig.Object.prototype.$type,a,b))},_positionResolver:null,positionResolver:function(value){if(arguments.length===1){this._positionResolver=value;return value}else{return this._positionResolver}},clone:function(){var $self=this;var a=new $.ig.List$1($.ig.OlapResultTuple.prototype.$type,0);var c=$self.tuples().getEnumerator();while(c.moveNext()){var b=c.current();a.add(b.clone())}return function(){var $ret=new $.ig.OlapResultAxis(a,$self.tupleSize());$ret.name($self.name());return $ret}()},_name:null,name:function(value){if(arguments.length===1){this._name=value;return value}else{return this._name}},_tupleSize:0,tupleSize:function(value){if(arguments.length===1){this._tupleSize=value;return value}else{return this._tupleSize}},_tuples:null,tuples:function(value){if(arguments.length===1){this._tuples=value;return value}else{return this._tuples}},$type:new $.ig.Type("OlapResultAxis",$.ig.Object.prototype.$type)},true);$.ig.util.defType("IPosition$2","Object",{$type:new $.ig.Type("IPosition$2",null)},true);$.ig.util.defType("OlapResultTuple","Object",{init:function(a){$.ig.Object.prototype.init.call(this);this.members(new $.ig.ReadOnlyCollection$1($.ig.OlapResultAxisMember.prototype.$type,1,a))},_members:null,members:function(value){if(arguments.length===1){this._members=value;return value}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 $.ig.List$1($.ig.OlapResultAxisMember.prototype.$type,0);var c=this.members().getEnumerator();while(c.moveNext()){var b=c.current();a.add(b.clone())}var d=new $.ig.OlapResultTuple(a);var f=a.getEnumerator();while(f.moveNext()){var e=f.current();e.position(d)}return d},$type:new $.ig.Type("OlapResultTuple",$.ig.Object.prototype.$type,[$.ig.IPosition$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type)])},true);$.ig.util.defType("IPositionItem$2","Object",{$type:new $.ig.Type("IPositionItem$2",null)},true);$.ig.util.defType("IHierarchicalPositionItem$2","Object",{$type:new $.ig.Type("IHierarchicalPositionItem$2",null,[$.ig.IPositionItem$2.prototype.$type.specialize(0,1)])},true);$.ig.util.defType("OlapResultAxisMember","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.properties(new $.ig.Dictionary$2(String,String,0));this.ordinal(-1)},_uniqueName:null,uniqueName:function(value){if(arguments.length===1){this._uniqueName=value;return value}else{return this._uniqueName}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},_levelUniqueName:null,levelUniqueName:function(value){if(arguments.length===1){this._levelUniqueName=value;return value}else{return this._levelUniqueName}},_hierarchyUniqueName:null,hierarchyUniqueName:function(value){if(arguments.length===1){this._hierarchyUniqueName=value;return value}else{return this._hierarchyUniqueName}},_levelNumber:0,levelNumber:function(value){if(arguments.length===1){this._levelNumber=value;return value}else{return this._levelNumber}},_displayInfo:null,displayInfo:function(value){if(arguments.length===1){this._displayInfo=value;return value}else{return this._displayInfo}},e:function(){return this.displayInfo()&~65536&~131072},drilledDown:function(){return(this.displayInfo()&65536)==65536},parentSameAsPrev:function(){return(this.displayInfo()&131072)==131072},_properties:null,properties:function(value){if(arguments.length===1){this._properties=value;return value}else{return this._properties}},_position:null,position:function(value){if(arguments.length===1){this._position=value;return value}else{return this._position}},key:function(){return this.uniqueName()},sortKey:function(){if(this.ordinal()>-1){return this.ordinal()}var a=parseFloat(this.caption());if(!isNaN(a)){return a}return this.caption()},_ordinal:0,ordinal:function(value){if(arguments.length===1){this._ordinal=value;return value}else{return this._ordinal}},hierarchyKey:function(){return this.hierarchyUniqueName()},hierarchyLevelKey:function(){return this.levelUniqueName()},parentKey:function(){var $self=this;var a;(function(){var $ret=$self.properties().tryGetValue("PARENT_UNIQUE_NAME",a);a=$ret.value;return $ret.ret})();return a},depth:function(){return this.levelNumber()},isExpandable:function(){return this.e()>0},clone:function(){var a=new $.ig.OlapResultAxisMember;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.Object.prototype.$type,[$.ig.IHierarchicalPositionItem$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type)])},true);$.ig.util.defType("OlapResultCell","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.properties(new $.ig.Dictionary$2(String,$.ig.Object.prototype.$type,0))},_cellOrdinal:0,cellOrdinal:function(value){if(arguments.length===1){this._cellOrdinal=value;return value}else{return this._cellOrdinal}},_properties:null,properties:function(value){if(arguments.length===1){this._properties=value;return value}else{return this._properties}},clone:function(){var $self=this;var a=function(){var $ret=new $.ig.OlapResultCell;$ret.cellOrdinal($self.cellOrdinal());return $ret}();var c=$self.properties().getEnumerator();while(c.moveNext()){var b=c.current();a.properties().add(b.key(),b.value())}return a},$type:new $.ig.Type("OlapResultCell",$.ig.Object.prototype.$type)},true);$.ig.util.defType("IConnection","Object",{$type:new $.ig.Type("IConnection",null)},true);$.ig.util.defType("IOlapDataProviderFactory","Object",{$type:new $.ig.Type("IOlapDataProviderFactory",null)},true);$.ig.util.defType("IOlapDiscoverDataProvider","Object",{$type:new $.ig.Type("IOlapDiscoverDataProvider",null)},true);$.ig.util.defType("IOlapExecuteCommandProvider","Object",{$type:new $.ig.Type("IOlapExecuteCommandProvider",null)},true);$.ig.util.defType("LevelSpanManager","Object",{b:null,init:function(a){$.ig.Object.prototype.init.call(this);this.c(a);this.b=new Array(a)},_c:0,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},a:function(a,b){var $self=this;var c=$self.b[a];if(c==null){c=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.SpanSource.prototype.$type,0);$self.b[a]=c}var d;if(!function(){var $ret=c.tryGetValue(b,d);d=$ret.value;return $ret.ret}()){d=new $.ig.SpanSource;if(b>0){var e;if(function(){var $ret=c.tryGetValue(b-1,e);e=$ret.value;return $ret.ret}()){d.a(e);e.e()}}c.add(b,d)}return d},$type:new $.ig.Type("LevelSpanManager",$.ig.Object.prototype.$type)},true);$.ig.util.defType("SpanSource","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.c=1},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}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.Object.prototype.$type)},true);$.ig.util.defType("ITableViewHeadersFactory","Object",{$type:new $.ig.Type("ITableViewHeadersFactory",null)},true);$.ig.util.defType("TableViewHeadersFactory","Object",{_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_d:false,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},_e:null,e:function(value){if(arguments.length===1){this._e=value;return value}else{return this._e}},init:function(a,b,c,d,e){$.ig.Object.prototype.init.call(this);this.b(a);this.a(b);this.c(c);this.d(d);this.e(e)},createHeaderCells:function(){var $self=this;if($self.b().positionResolver().hasUnregisterdPositions()){$self.b().positionResolver().completeRegisterPositions()}var a=$self.b().positionResolver().rootPositionInfo();var b=new $.ig.List$1($.ig.IList$1.prototype.$type.specialize($.ig.TableViewHeaderCellSource.prototype.$type),0);for(var c=0;c<a.positionSize();c++){b.add(new $.ig.List$1($.ig.TableViewHeaderCellSource.prototype.$type,0))}$.ig.TableViewHeadersFactory.prototype.createHeaderCells2(a,a.positionItemDepthMin(),b,$self.d(),$self.e());var d=new $.ig.ArrayListCollection$1($.ig.OlapTableViewHeaderCell.prototype.$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($self.c()==$.ig.HeaderCellsLayoutOrientation.prototype.horizontal){l=h;m=j.b().d();n=j.a().positionItemDepth()+e;o=j.c().d()}else{n=h;o=j.b().d();l=j.a().positionItemDepth()+e;m=j.c().d()}var p=$self.b().tuples().__inner[j.a().positionIndex()];var q=p.item(j.a().positionItemIndex());var r=$self.b().tuples().__inner[j.k()];if($self.a().positionResolver().hasUnregisterdPositions()){$self.a().positionResolver().completeRegisterPositions()}var s=$self.a().positionResolver().getPositionIndex(r);var t=function(){var $ret=new $.ig.OlapTableViewHeaderCell;$ret.axisName($self.b().name());$ret.hierarchyNumber(j.a().positionItemIndex());$ret.levelNumber(j.a().positionItemDepth());$ret.caption(q.caption());$ret.columnIndex(l);$ret.columnSpan(m);$ret.isExpanded(j.f());$ret.isExpandable(j.e());$ret.tupleIndex(s);$ret.memberIndex(j.a().positionItemIndex());$ret.rowIndex(n);$ret.rowSpan(o);return $ret}();if(!j.g()){h=h+j.b().d()}i=Math.max(i,j.a().positionItemDepth());d.add(t)}e+=i+1}return d},createHeaderCells2:function(a,b,c,d,e){var $self=this;var f=new $.ig.LevelSpanManager(a.positionSize());var h=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(i){return i.positionItemDepth()==b}).getEnumerator();while(h.moveNext()){var g=h.current();var i;var j;(function(){var $ret=$.ig.TableViewHeadersFactory.prototype.createHeaderCells1(a,g,c,f,d,e,i,j);i=$ret.headerCellSource;j=$ret.totalSpan;return $ret.ret})()}},h:function(a,b,c,d,e,f){var $self=this;var g=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(h){return h.positionItemDepth()==a.positionItemDepthMin()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type));if(g.count()>0){var i=g.getEnumerator();while(i.moveNext()){var h=i.current();var j;var k;(function(){var $ret=$.ig.TableViewHeadersFactory.prototype.createHeaderCells1(a,h,b,c,d,f,j,k);j=$ret.headerCellSource;k=$ret.totalSpan;return $ret.ret})();e.b().d(e.b().d()+k);if(j.g()){e.b().d(e.b().d()+1)}}e.b().d(e.b().d()-1)}else{f.add(a.positionIndex())}e.k(a.positionIndex())},createHeaderCells1:function(a,b,c,d,e,f,g,h){var $self=this;var i=c.item(b.positionItemIndex());var j=d.a(b.positionItemIndex(),b.positionItemDepth());var k=function(){var $ret=new $.ig.TableViewHeaderCellSource;$ret.c(j);$ret.a(b);$ret.e(b.isExpandable());return $ret}();g=k;if(e){i.add(k);$.ig.TableViewHeadersFactory.prototype.h(b,c,d,true,k,f)}var l=null;if(b.isExpanded()){l=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(m){return m.parentKey()==b.key()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type))}if(l!=null&&l.count()>0){var m=function(){var $ret=new $.ig.TableViewHeaderCellSource;$ret.g(true);$ret.a(b);$ret.e(b.isExpandable());return $ret}();i.add(m);var o=l.getEnumerator();while(o.moveNext()){var n=o.current();var p;var q;(function(){var $ret=$.ig.TableViewHeadersFactory.prototype.createHeaderCells1(a,n,c,d,e,f,p,q);p=$ret.headerCellSource;q=$ret.totalSpan;return $ret.ret})();m.b().d(m.b().d()+q);if(p.g()){m.b().d(m.b().d()+1)}}m.b().d(m.b().d()-1);k.f(true);k.e(false);m.f(true);k.d(m);if(!e){i.add(k);$.ig.TableViewHeadersFactory.prototype.h(b,c,d,false,k,f)}m.k(k.k());g=m;h=k.b().d()+m.b().d()-1}else{if(b.isExpanded()){k.e(false)}if(!e){i.add(k);$.ig.TableViewHeadersFactory.prototype.h(b,c,d,false,k,f)}h=k.b().d()}return{headerCellSource:g,totalSpan:h}},$type:new $.ig.Type("TableViewHeadersFactory",$.ig.Object.prototype.$type,[$.ig.ITableViewHeadersFactory.prototype.$type])},true);$.ig.util.defType("TableCompactViewHeadersFactory","Object",{_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_d:false,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},_e:null,e:function(value){if(arguments.length===1){this._e=value;return value}else{return this._e}},init:function(a,b,c,d,e){$.ig.Object.prototype.init.call(this);this.b(a);this.a(b);this.c(c);this.d(d);this.e(e)},createHeaderCells:function(){var $self=this;if($self.b().positionResolver().hasUnregisterdPositions()){$self.b().positionResolver().completeRegisterPositions()}var a=$self.b().positionResolver().rootPositionInfo();var b=new $.ig.List$1($.ig.IList$1.prototype.$type.specialize($.ig.TableViewHeaderCellSource.prototype.$type),0);for(var c=0;c<a.positionSize();c++){b.add(new $.ig.List$1($.ig.TableViewHeaderCellSource.prototype.$type,0))}$.ig.TableCompactViewHeadersFactory.prototype.createHeaderCells2(a,a.positionItemDepthMin(),b,$self.d(),$self.e());var d=new $.ig.ArrayListCollection$1($.ig.OlapTableViewHeaderCell.prototype.$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($self.c()==$.ig.HeaderCellsLayoutOrientation.prototype.horizontal){l=h;m=j.b().d();n=e;o=1}else{n=h;o=j.b().d();l=e;m=1}var p=$self.b().tuples().__inner[j.a().positionIndex()];var q=p.item(j.a().positionItemIndex());var r=$self.b().tuples().__inner[j.k()];if($self.a().positionResolver().hasUnregisterdPositions()){$self.a().positionResolver().completeRegisterPositions()}var s=$self.a().positionResolver().getPositionIndex(r);var t=function(){var $ret=new $.ig.OlapTableViewHeaderCell;$ret.axisName($self.b().name());$ret.hierarchyNumber(j.a().positionItemIndex());$ret.levelNumber(j.a().positionItemDepth());$ret.caption(q.caption());$ret.columnIndex(l);$ret.columnSpan(m);$ret.isExpanded(j.f());$ret.isExpandable(j.e());$ret.tupleIndex(s);$ret.memberIndex(j.a().positionItemIndex());$ret.rowIndex(n);$ret.rowSpan(o);return $ret}();if(!j.g()){h=h+j.b().d()}d.add(t)}e+=i+1}return d},createHeaderCells2:function(a,b,c,d,e){var $self=this;var f=new $.ig.LevelSpanManager(a.positionSize());var h=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(i){return i.positionItemDepth()==b}).getEnumerator();while(h.moveNext()){var g=h.current();var i;var j;(function(){var $ret=$.ig.TableCompactViewHeadersFactory.prototype.createHeaderCells1(a,g,c,f,d,e,i,j);i=$ret.headerCellSource;j=$ret.totalSpan;return $ret.ret})()}},h:function(a,b,c,d,e,f){var $self=this;var g=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(h){return h.positionItemDepth()==a.positionItemDepthMin()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type));if(g.count()>0){var i=g.getEnumerator();while(i.moveNext()){var h=i.current();var j;var k;(function(){var $ret=$.ig.TableCompactViewHeadersFactory.prototype.createHeaderCells1(a,h,b,c,d,f,j,k);j=$ret.headerCellSource;k=$ret.totalSpan;return $ret.ret})();e.b().d(e.b().d()+k);if(j.d()!=null){e.b().d(e.b().d()+1)}}e.b().d(e.b().d()-1)}else{f.add(a.positionIndex())}e.k(a.positionIndex())},createHeaderCells1:function(a,b,c,d,e,f,g,h){var $self=this;var i=c.item(b.positionItemIndex());var j=d.a(b.positionItemIndex(),b.positionItemDepth());var k=function(){var $ret=new $.ig.TableViewHeaderCellSource;$ret.c(j);$ret.a(b);$ret.e(b.isExpandable());return $ret}();g=k;if(e){i.add(k);$.ig.TableCompactViewHeadersFactory.prototype.h(b,c,d,true,k,f)}var l=null;if(b.isExpanded()){l=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(m){return m.parentKey()==b.key()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type))}if(l!=null&&l.count()>0){var m=function(){var $ret=new $.ig.TableViewHeaderCellSource;$ret.g(true);$ret.a(b);$ret.e(b.isExpandable());return $ret}();var o=l.getEnumerator();while(o.moveNext()){var n=o.current();var p;var q;(function(){var $ret=$.ig.TableCompactViewHeadersFactory.prototype.createHeaderCells1(a,n,c,d,e,f,p,q);p=$ret.headerCellSource;q=$ret.totalSpan;return $ret.ret})();m.b().d(m.b().d()+q);if(p.d()!=null){m.b().d(m.b().d()+1)}}m.b().d(m.b().d()-1);k.f(true);k.e(true);k.d(m);if(!e){i.add(k);$.ig.TableCompactViewHeadersFactory.prototype.h(b,c,d,false,k,f)}m.k(k.k());h=k.b().d()+m.b().d()-1}else{if(b.isExpanded()){k.e(false)}if(!e){i.add(k);$.ig.TableCompactViewHeadersFactory.prototype.h(b,c,d,false,k,f)}h=k.b().d()}return{headerCellSource:g,totalSpan:h}},$type:new $.ig.Type("TableCompactViewHeadersFactory",$.ig.Object.prototype.$type,[$.ig.ITableViewHeadersFactory.prototype.$type])},true);$.ig.util.defType("TableViewHeaderCellSource","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.b(new $.ig.SpanSource);this.c(new $.ig.SpanSource)},_g:false,g:function(value){if(arguments.length===1){this._g=value;return value}else{return this._g}},_j:0,j:function(value){if(arguments.length===1){this._j=value;return value}else{return this._j}},_h:0,h:function(value){if(arguments.length===1){this._h=value;return value}else{return this._h}},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_d:null,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},_k:0,k:function(value){if(arguments.length===1){this._k=value;return value}else{return this._k}},_i:0,i:function(value){if(arguments.length===1){this._i=value;return value}else{return this._i}},_f:false,f:function(value){if(arguments.length===1){this._f=value;return value}else{return this._f}},_e:false,e:function(value){if(arguments.length===1){this._e=value;return value}else{return this._e}},$type:new $.ig.Type("TableViewHeaderCellSource",$.ig.Object.prototype.$type)},true);
$.ig.util.defType("TableViewImpl","Object",{init:function(a,b,c,d){var $self=this;$.ig.Object.prototype.init.call(this);if(a==null){throw new $.ig.ArgumentNullException("result")}this.result(a);this.originalResult(a);if(d==null){this.viewSettings(new $.ig.TableViewSettings)}else{this.viewSettings(d)}this.hasColumns(b);this.hasRows(c);this.columnSortDirections(new $.ig.ArrayListCollection$1($.ig.TupleSortDirection.prototype.$type));this.columnSortDirections().collectionChanged=$.ig.Delegate.prototype.combine(this.columnSortDirections().collectionChanged,function(e,f){$self.i(true)});this.levelSortDirections(new $.ig.ArrayListCollection$1($.ig.LevelSortDirection.prototype.$type));this.levelSortDirections().collectionChanged=$.ig.Delegate.prototype.combine(this.levelSortDirections().collectionChanged,function(e,f){$self.i(true)});this.appliedColumnSortDirections(new $.ig.List$1($.ig.TupleSortDirection.prototype.$type,0));this.appliedLevelSortDirections(new $.ig.List$1($.ig.LevelSortDirection.prototype.$type,0));this.appliedSortDirectionsMap(new $.ig.Dictionary$2(String,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type)),0))},_viewSettings:null,viewSettings:function(value){if(arguments.length===1){this._viewSettings=value;return value}else{return this._viewSettings}},_result:null,result:function(value){if(arguments.length===1){this._result=value;return value}else{return this._result}},_originalResult:null,originalResult:function(value){if(arguments.length===1){this._originalResult=value;return value}else{return this._originalResult}},_hasRows:false,hasRows:function(value){if(arguments.length===1){this._hasRows=value;return value}else{return this._hasRows}},_hasColumns:false,hasColumns:function(value){if(arguments.length===1){this._hasColumns=value;return value}else{return this._hasColumns}},_d:null,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_h:false,h:function(value){if(arguments.length===1){this._h=value;return value}else{return this._h}},_i:false,i:function(value){if(arguments.length===1){this._i=value;return value}else{return this._i}},l:null,k:null,o:null,rowHeaders:function(a){if(arguments.length===1){this.l=a;return a}else{if(!this.h()||this.i()){this.initialize()}return this.l}},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.o=a;return a}else{if(!this.h()||this.i()){this.initialize()}return this.o}},_columnSortDirections:null,columnSortDirections:function(value){if(arguments.length===1){this._columnSortDirections=value;return value}else{return this._columnSortDirections}},_levelSortDirections:null,levelSortDirections:function(value){if(arguments.length===1){this._levelSortDirections=value;return value}else{return this._levelSortDirections}},_appliedColumnSortDirections:null,appliedColumnSortDirections:function(value){if(arguments.length===1){this._appliedColumnSortDirections=value;return value}else{return this._appliedColumnSortDirections}},_appliedLevelSortDirections:null,appliedLevelSortDirections:function(value){if(arguments.length===1){this._appliedLevelSortDirections=value;return value}else{return this._appliedLevelSortDirections}},_appliedSortDirectionsMap:null,appliedSortDirectionsMap:function(value){if(arguments.length===1){this._appliedSortDirectionsMap=value;return value}else{return this._appliedSortDirectionsMap}},initialize:function(){var $self=this;$self.d(null);$self.c(null);$self.rowHeaders(null);$self.columnHeaders(null);$self.resultCells(null);$self.result($self.originalResult());if($self.result().isEmpty()){$self.i(false);$self.h(true);return}if($self.levelSortDirections().count()>0){var a=new $.ig.ResultHeaderSorter($self.result(),$self.hasRows(),$self.hasColumns(),$self.levelSortDirections());$self.result(a.b());$self.appliedLevelSortDirections(a.h());$self.appliedSortDirectionsMap(a.g())}else{$self.appliedLevelSortDirections(new $.ig.List$1($.ig.LevelSortDirection.prototype.$type,0));$self.appliedSortDirectionsMap(new $.ig.Dictionary$2(String,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type)),0))}if($self.hasRows()&&$self.columnSortDirections().count()>0){if($self.appliedLevelSortDirections().count()>0){if($self.originalResult().axes().item(0).positionResolver().hasUnregisterdPositions()){$self.originalResult().axes().item(0).positionResolver().completeRegisterPositions()}if($self.result().axes().item(0).positionResolver().hasUnregisterdPositions()){$self.result().axes().item(0).positionResolver().completeRegisterPositions()}var b=new $.ig.List$1($.ig.TupleSortDirection.prototype.$type,2,$self.columnSortDirections().count());var c=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,1,$self.appliedColumnSortDirections().count());var e=$self.columnSortDirections().getEnumerator();while(e.moveNext()){var d=e.current();var f=$self.originalResult().axes().item(0).tuples().__inner[d.tupleIndex()];var g=$self.result().axes().item(0).positionResolver().getPositionIndex(f);var h=new $.ig.TupleSortDirection;h.sortDirection(d.sortDirection());h.tupleIndex(g);h.comparer(d.comparer());b.add(h);c.item(g,d.tupleIndex())}var i=new $.ig.ResultColumnValueSorter($self.result(),$self.hasRows(),$self.hasColumns(),b);$self.result(i.b());var k=i.g().getEnumerator();while(k.moveNext()){var j=k.current();j.tupleIndex(c.item(j.tupleIndex()))}$self.appliedColumnSortDirections(i.g())}else{var l=new $.ig.ResultColumnValueSorter($self.result(),$self.hasRows(),$self.hasColumns(),$self.columnSortDirections());$self.result(l.b());$self.appliedColumnSortDirections(l.g())}}else{$self.appliedColumnSortDirections(new $.ig.List$1($.ig.TupleSortDirection.prototype.$type,0))}var m=0;var n=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);var o=1;if($self.hasColumns()){var p=$self.result().axes().item(m);var q=$self.originalResult().axes().item(m);var r=$self.u(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 $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);if($self.hasRows()){var v=$self.result().axes().item(m);var w=$self.originalResult().axes().item(m);var x=$self.v(v,w);for(var y=0;y<x.count();y++){var z=x.item(y);u.add(z,y)}}var aa=new $.ig.ArrayListCollection$1($.ig.OlapTableViewResultCell.prototype.$type);for(var ab=0;ab<$self.result().cells().count();ab++){var ac=$self.result().cells().item(ab);var ad;(function(){var $ret=ac.properties().tryGetValue("Value",ad);ad=$ret.value;return $ret.ret})();var ae;(function(){var $ret=ac.properties().tryGetValue("FmtValue",ae);ae=$ret.value;return $ret.ret})();var af=ac.cellOrdinal();if($self.hasColumns()){var ag=af%o;var ah=n.item(ag);if(ag!=ah){var ai=$.ig.intDivide(af,o);af=ai*o+ah}}if($self.hasRows()){var aj=$.ig.intDivide(af,o);var ak=u.item(aj);if(aj!=ak){var al=af%o;af=ak*o+al}}aa.add(function(){var $ret=new $.ig.OlapTableViewResultCell;$ret.value(ad);$ret.formattedValue(ae);$ret.cellOrdinal(af);$ret.resultCellIndex(ab);return $ret}());$self.resultCells(aa)}$self.i(false);$self.h(true)},u:function(a,b){var c=new $.ig.List$1($.ig.Number.prototype.$type,0);if(this.viewSettings().a()){this.c(new $.ig.TableCompactViewHeadersFactory(a,b,$.ig.HeaderCellsLayoutOrientation.prototype.horizontal,this.viewSettings().c(),c))}else{this.c(new $.ig.TableViewHeadersFactory(a,b,$.ig.HeaderCellsLayoutOrientation.prototype.horizontal,this.viewSettings().c(),c))}this.columnHeaders(this.c().createHeaderCells());return c},v:function(a,b){var c=new $.ig.List$1($.ig.Number.prototype.$type,0);if(this.viewSettings().b()){this.d(new $.ig.TableCompactViewHeadersFactory(a,b,$.ig.HeaderCellsLayoutOrientation.prototype.vertical,this.viewSettings().d(),c))}else{this.d(new $.ig.TableViewHeadersFactory(a,b,$.ig.HeaderCellsLayoutOrientation.prototype.vertical,this.viewSettings().d(),c))}this.rowHeaders(this.d().createHeaderCells());return c},$type:new $.ig.Type("TableViewImpl",$.ig.Object.prototype.$type)},true);$.ig.util.defType("TableViewSettings","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_c:false,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_d:false,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},_b:false,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_a:false,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},$type:new $.ig.Type("TableViewSettings",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapResultView","Object",{init:function(a,b,c,d){$.ig.Object.prototype.init.call(this);if(a==null){throw new $.ig.ArgumentNullException("result")}this.result(a);this.visibleResult(b);this.hasColumns(c);this.hasRows(d)},_result:null,result:function(value){if(arguments.length===1){this._result=value;return value}else{return this._result}},_visibleResult:null,visibleResult:function(value){if(arguments.length===1){this._visibleResult=value;return value}else{return this._visibleResult}},_hasRows:false,hasRows:function(value){if(arguments.length===1){this._hasRows=value;return value}else{return this._hasRows}},_hasColumns:false,hasColumns:function(value){if(arguments.length===1){this._hasColumns=value;return value}else{return this._hasColumns}},c:function(a,b,c,d,e){var $self=this;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=$.ig.intDivide(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=$.ig.intDivide(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=$.ig.intDivide(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=$.ig.intDivide(o.cellOrdinal(),h);if(q>p){break}t=o.cellOrdinal()%h}}}}var y=new $.ig.List$1($.ig.OlapResultCell.prototype.$type,0);for(var aa=0;aa<m.length;aa++){var z=m[aa];if(z!=null){y.add(z)}}var ab=new $.ig.List$1($.ig.OlapResultAxis.prototype.$type,0);if(e){ab.add(c)}if(d){ab.add(b)}return function(){var $ret=new $.ig.OlapResult;$ret.axes(ab);$ret.cells(y);$ret.isEmpty(!d&&!e&&y.count()==0);return $ret}()},a:function(a,b,c){var $self=this;var d=new $.ig.List$1($.ig.OlapResultTuple.prototype.$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 $.ig.OlapResultAxis(d,a.tupleSize());$ret.name(a.name());return $ret}();return j},expandTupleMember:function(a,b,c){var $self=this;var d=$self.f(a,b,c,$self.visibleResult());if(d==null){return null}if(!d.isExpandable()){throw new $.ig.InvalidOperationException(1,"The position is not expandable.")}if(d.isExpanded()){return $self}var e=$self.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(f){return f.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var f=$self.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(g){return g.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var g=a=="Axis0"&&!$self.hasColumns()||a=="Axis1"&&$self.hasRows();var h=e.tuples().__inner[b];var i=f.positionResolver().getPositionIndex(h);var j=$self.l(a,i,c,$self.result());if(j.count()==0){return null}var k=null;var l=null;if(g){k=$self.a(f,j,true);if($self.hasColumns()){l=$self.visibleResult().axes().item(0)}}else{l=$self.a(f,j,true);if($self.hasRows()){k=$self.visibleResult().axes().item(1)}}var m=$self.c($self.result(),k,l,$self.hasRows(),$self.hasColumns());var n=$self.b($self.visibleResult(),m,f.name());return new $.ig.OlapResultView($self.result(),n,$self.hasColumns(),$self.hasRows())},collapseTupleMember:function(a,b,c){var $self=this;var d=$self.f(a,b,c,$self.visibleResult());if(d==null){return null}if(!d.isExpandable()){throw new $.ig.InvalidOperationException(1,"The position is not expandable.")}if(!d.isExpanded()){return $self}var e=$self.l(a,b,c,$self.visibleResult());if(e.count()==0){return null}var f=$self.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(g){return g.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var g=a=="Axis0"&&!$self.hasColumns()||a=="Axis1"&&$self.hasRows();var h=null;var i=null;if(g){h=$self.a(f,e,false);if($self.hasColumns()){i=$self.visibleResult().axes().item(0)}}else{i=$self.a(f,e,false);if($self.hasRows()){h=$self.visibleResult().axes().item(1)}}var j=$self.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(k){return k.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);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=$self.c($self.visibleResult(),h,i,$self.hasRows(),$self.hasColumns());return new $.ig.OlapResultView($self.result(),n,$self.hasColumns(),$self.hasRows())},extend:function(a,b){var $self=this;var c=$self.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(d){return d.name()==b}).first$1($.ig.OlapResultAxis.prototype.$type);var d=b=="Axis0"&&!$self.hasColumns()||b=="Axis1"&&$self.hasRows();var e=null;var f=null;var g=null;var h=false;if(d){e=c;if($self.hasColumns()){f=$self.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(i){return i.name()!=b}).first$1($.ig.OlapResultAxis.prototype.$type);g=$self.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(i){return i.name()!=b}).first$1($.ig.OlapResultAxis.prototype.$type);h=f.tuples().count()!=g.tuples().count()}}else{f=c;if($self.hasRows()){e=$self.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(i){return i.name()!=b}).first$1($.ig.OlapResultAxis.prototype.$type);g=$self.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(i){return i.name()!=b}).first$1($.ig.OlapResultAxis.prototype.$type);h=e.tuples().count()!=g.tuples().count()}}var i=null;var j=null;if(g!=null&&h){var k=$self.c($self.result(),e,f,$self.hasRows(),$self.hasColumns());i=$self.b(k,a,b);j=$self.b(k,a,b)}else{i=$self.b($self.result(),a,b);j=$self.b($self.visibleResult(),a,b)}return new $.ig.OlapResultView(i,j,$self.hasColumns(),$self.hasRows())},b:function(a,b,c){var $self=this;var d=a.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(e){return e.name()==c}).first$1($.ig.OlapResultAxis.prototype.$type);if(d==null){return null}var e=b.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(f){return f.name()==c}).first$1($.ig.OlapResultAxis.prototype.$type);var f=c=="Axis0"&&!$self.hasColumns()||c=="Axis1"&&$self.hasRows();var g=null;var h=null;if(f){if($self.hasColumns()){g=a.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(i){return i.name()!=c}).first$1($.ig.OlapResultAxis.prototype.$type);h=b.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(i){return i.name()!=c}).first$1($.ig.OlapResultAxis.prototype.$type)}}else{if($self.hasRows()){g=a.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(i){return i.name()!=c}).first$1($.ig.OlapResultAxis.prototype.$type);h=b.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(i){return i.name()!=c}).first$1($.ig.OlapResultAxis.prototype.$type)}}var i=new $.ig.List$1($.ig.OlapResultTuple.prototype.$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 $.ig.List$1($.ig.OlapResultCell.prototype.$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=$self.m(z.cellOrdinal(),g,h);var ab=$.ig.intDivide(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=$.ig.intDivide(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=$self.n(al.cellOrdinal(),g,h,n);var an=$.ig.intDivide(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 $.ig.OlapResult;ar.axes(new $.ig.List$1($.ig.OlapResultAxis.prototype.$type,0));var as=function(){var $ret=new $.ig.OlapResultAxis(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(!$self.hasColumns()&&!$self.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=$.ig.intDivide(a,d);var f=c.tuples().__inner[e];var g=b.positionResolver().getPositionIndex(f);return g},l:function(a,b,c,d){var $self=this;var e=d.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(f){return f.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var f=e.tuples().__inner[b];var g=f.item(c);if(e.positionResolver().hasUnregisterdPositions()){e.positionResolver().completeRegisterPositions()}var h=e.positionResolver().h(g,$.ig.ListSortDirection.prototype.ascending);if(h!=null){return h.toList$1($.ig.Number.prototype.$type)}return null},f:function(a,b,c,d){var $self=this;var e=d.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(f){return f.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);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;(function(){var $ret=h.tryGetValue(g.key(),i);i=$ret.value;return $ret.ret})();return i},$type:new $.ig.Type("OlapResultView",$.ig.Object.prototype.$type)},true);$.ig.util.defType("ResultViewHelper","Object",{init:function(){$.ig.Object.prototype.init.call(this)},e:function(a,b,c,d,e){$.ig.ResultViewHelper.prototype.d(a,b,c,true,e.visibleResult());$.ig.ResultViewHelper.prototype.d(a,b,c,true,e.result())},f:function(a,b,c){var $self=this;var d=b.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(e){return e.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var e=c.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(f){return f.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);$.ig.ResultViewHelper.prototype.b(d.positionResolver(),e.positionResolver());var f=b.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(g){return g.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var g=c.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(h){return h.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);$.ig.ResultViewHelper.prototype.b(f.positionResolver(),g.positionResolver())},d:function(a,b,c,d,e){var $self=this;var f=e.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(g){return g.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);if(f.positionResolver().hasUnregisterdPositions()){f.positionResolver().completeRegisterPositions()}$.ig.ResultViewHelper.prototype.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()}$.ig.ResultViewHelper.prototype.a(a.rootPositionInfo(),b.rootPositionInfo())},a:function(a,b){var $self=this;var d=a.getEnumerator();while(d.moveNext()){var c=d.current();var e=c.value();var f;if(function(){var $ret=b.tryGetValue(c.key(),f);f=$ret.value;return $ret.ret}()){if(e.isExpanded()!=true){f.isExpanded(false)}if(f.count()>0){$.ig.ResultViewHelper.prototype.a(e,f)}}}},$type:new $.ig.Type("ResultViewHelper",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapTableViewHeaderCell","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.columnSpan(1);this.rowSpan(1)},_id:null,id:function(value){if(arguments.length===1){this._id=value;return value}else{return this._id}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},_isExpanded:false,isExpanded:function(value){if(arguments.length===1){this._isExpanded=value;return value}else{return this._isExpanded}},_isExpandable:false,isExpandable:function(value){if(arguments.length===1){this._isExpandable=value;return value}else{return this._isExpandable}},_rowIndex:0,rowIndex:function(value){if(arguments.length===1){this._rowIndex=value;return value}else{return this._rowIndex}},_rowSpan:0,rowSpan:function(value){if(arguments.length===1){this._rowSpan=value;return value}else{return this._rowSpan}},_columnIndex:0,columnIndex:function(value){if(arguments.length===1){this._columnIndex=value;return value}else{return this._columnIndex}},_columnSpan:0,columnSpan:function(value){if(arguments.length===1){this._columnSpan=value;return value}else{return this._columnSpan}},_axisName:null,axisName:function(value){if(arguments.length===1){this._axisName=value;return value}else{return this._axisName}},_tupleIndex:0,tupleIndex:function(value){if(arguments.length===1){this._tupleIndex=value;return value}else{return this._tupleIndex}},_memberIndex:0,memberIndex:function(value){if(arguments.length===1){this._memberIndex=value;return value}else{return this._memberIndex}},_levelNumber:0,levelNumber:function(value){if(arguments.length===1){this._levelNumber=value;return value}else{return this._levelNumber}},_hierarchyNumber:0,hierarchyNumber:function(value){if(arguments.length===1){this._hierarchyNumber=value;return value}else{return this._hierarchyNumber}},toString:function(){return this.caption()},$type:new $.ig.Type("OlapTableViewHeaderCell",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapTableViewResultCell","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_value:null,value:function(value){if(arguments.length===1){this._value=value;return value}else{return this._value}},_formattedValue:null,formattedValue:function(value){if(arguments.length===1){this._formattedValue=value;return value}else{return this._formattedValue}},_cellOrdinal:0,cellOrdinal:function(value){if(arguments.length===1){this._cellOrdinal=value;return value}else{return this._cellOrdinal}},_resultCellIndex:0,resultCellIndex:function(value){if(arguments.length===1){this._resultCellIndex=value;return value}else{return this._resultCellIndex}},$type:new $.ig.Type("OlapTableViewResultCell",$.ig.Object.prototype.$type)},true);$.ig.util.defType("ArrayListCollection$1","Object",{$t:null,init:function($t){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.init.call(this);this.inner(new $.ig.Array)},_inner:null,inner:function(value){if(arguments.length===1){this._inner=value;return value}else{return this._inner}},collectionChanged:null,indexOf:function(a){return this.inner().indexOf(a)},insert:function(a,b){this.inner().insert(a,b);this.d(a,b)},removeAt:function(a){var b=this.inner()[a];this.inner().removeAt(a);this.e(a,b)},item:function(a,b){if(arguments.length===2){this.inner()[a]=b;return b}else{return this.inner()[a]}},add:function(a){this.inner().add(a);this.d(this.inner().length-1,a)},clear:function(){this.inner().clear();this.c()},contains:function(a){return this.inner().contains(a)},copyTo:function(a,b){throw new $.ig.NotImplementedException},count:function(){return this.inner().length},isReadOnly:function(){return false},remove:function(a){var b=this.inner().indexOf(a);if(b>=0){this.inner().removeAt(b);this.e(b,a);return true}return false},b:function(){var $self=this;var $iter=function(){return function(){return{$state:0,$this:$self,$current:null,$a:0,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$a=0;this.$state=5;break;case 2:this.$current=this.$this.inner()[this.$a];this.$state=3;return true;case 3:this.$state=4;break;case 4:this.$a++;this.$state=5;break;case 5:if(this.$a<this.$this.inner().length){this.$state=2}else{this.$state=6}break;case 6:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}()};return new $.ig.GenericEnumerable$1(this.$t,$iter)},getEnumerator:function(){return this.b().getEnumerator()},d:function(a,b){if(this.collectionChanged!=null){var c=new $.ig.NotifyCollectionChangedEventArgs(1,$.ig.NotifyCollectionChangedAction.prototype.add,b,a);this.collectionChanged(this,c)}},e:function(a,b){if(this.collectionChanged!=null){var c=new $.ig.NotifyCollectionChangedEventArgs(1,$.ig.NotifyCollectionChangedAction.prototype.remove,b,a);this.collectionChanged(this,c)}},c:function(){if(this.collectionChanged!=null){var a=new $.ig.NotifyCollectionChangedEventArgs(1,$.ig.NotifyCollectionChangedAction.prototype.reset,null,-1);this.collectionChanged(this,a)}},$type:new $.ig.Type("ArrayListCollection$1",$.ig.Object.prototype.$type,[$.ig.IList$1.prototype.$type.specialize(0),$.ig.INotifyCollectionChanged.prototype.$type])},true);$.ig.util.defType("IOlapDataSource","Object",{$type:new $.ig.Type("IOlapDataSource",null)},true);$.ig.util.defType("MeasureList","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(value){if(arguments.length===1){this._name=value;return value}else{return this._name}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},uniqueName:function(a){if(arguments.length===1){this.name(a);return a}else{return this.name()}},_measures:null,measures:function(value){if(arguments.length===1){this._measures=value;return value}else{return this._measures}},$type:new $.ig.Type("MeasureList",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("OlapMetadataTreeItem","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_item:null,item:function(value){if(arguments.length===1){this._item=value;return value}else{return this._item}},_type:null,type:function(value){if(arguments.length===1){this._type=value;return value}else{return this._type}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},_children:null,children:function(value){if(arguments.length===1){this._children=value;return value}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.Array.prototype.copy(this.children(),0,b,0,this.children().length);b[this.children().length]=a;this.children(b)},$type:new $.ig.Type("OlapMetadataTreeItem",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapDataSource","Object",{ac:null,ab:null,ag:0,j:null,g:null,init:function(a){var $self=this;this.ac=new $.ig.List$1($.ig.PositionInfo.prototype.$type,0);this.ab=new $.ig.List$1($.ig.PositionInfo.prototype.$type,0);this.af=new $.ig.List$1(String,0);$.ig.Object.prototype.init.call(this);this.u(new $.ig.List$1($.ig.AxisElement.prototype.$type,0));this.w(new $.ig.List$1($.ig.AxisElement.prototype.$type,0));this.v(new $.ig.List$1($.ig.AxisElement.prototype.$type,0));this.o(false);this.al(null);this.t(false);this.aj(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 $.ig.ArrayListCollection$1($.ig.Catalog.prototype.$type));this.cubes(new $.ig.ArrayListCollection$1($.ig.Cube.prototype.$type));this.measureGroups(new $.ig.ArrayListCollection$1($.ig.MeasureGroup.prototype.$type));this.rowAxis(new $.ig.ArrayListCollection$1($.ig.ICoreOlapElement.prototype.$type));this.columnAxis(new $.ig.ArrayListCollection$1($.ig.ICoreOlapElement.prototype.$type));this.filters(new $.ig.ArrayListCollection$1($.ig.Hierarchy.prototype.$type));this.measures(new $.ig.ArrayListCollection$1($.ig.Measure.prototype.$type));this.measureListLocation($.ig.MeasureListLocation.prototype.columns);this.measureListIndex(-1);this.sourceOptions(a);this.result(function(){var $ret=new $.ig.OlapResult;$ret.isEmpty(true);return $ret}())},_isInitialized:false,isInitialized:function(value){if(arguments.length===1){this._isInitialized=value;return value}else{return this._isInitialized}},_catalogs:null,catalogs:function(value){if(arguments.length===1){this._catalogs=value;return value}else{return this._catalogs}},_cubes:null,cubes:function(value){if(arguments.length===1){this._cubes=value;return value}else{return this._cubes}},_cube:null,cube:function(value){if(arguments.length===1){this._cube=value;return value}else{return this._cube}},_measureGroup:null,measureGroup:function(value){if(arguments.length===1){this._measureGroup=value;return value}else{return this._measureGroup}},_measureGroups:null,measureGroups:function(value){if(arguments.length===1){this._measureGroups=value;return value}else{return this._measureGroups}},_sourceOptions:null,sourceOptions:function(value){if(arguments.length===1){this._sourceOptions=value;return value}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(value){if(arguments.length===1){this._metadataTree=value;return value}else{return this._metadataTree}},_rowAxis:null,rowAxis:function(value){if(arguments.length===1){this._rowAxis=value;return value}else{return this._rowAxis}},_columnAxis:null,columnAxis:function(value){if(arguments.length===1){this._columnAxis=value;return value}else{return this._columnAxis}},_filters:null,filters:function(value){if(arguments.length===1){this._filters=value;return value}else{return this._filters}},_measures:null,measures:function(value){if(arguments.length===1){this._measures=value;return value}else{return this._measures}},measureListIndex:function(a){if(arguments.length===1){if(this.ag!=a){this.p(true);
this.ag=a;this.az();this.p(false)}return a}else{return this.ag}},measureListLocation:function(a){if(arguments.length===1){if(this.j!=a){this.ax();this.j=a;this.az()}return a}else{return this.j}},_result:null,result:function(value){if(arguments.length===1){this._result=value;return value}else{return this._result}},_l:null,l:function(value){if(arguments.length===1){this._l=value;return value}else{return this._l}},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_u:null,u:function(value){if(arguments.length===1){this._u=value;return value}else{return this._u}},_w:null,w:function(value){if(arguments.length===1){this._w=value;return value}else{return this._w}},_v:null,v:function(value){if(arguments.length===1){this._v=value;return value}else{return this._v}},af:null,_o:false,o:function(value){if(arguments.length===1){this._o=value;return value}else{return this._o}},_al:null,al:function(value){if(arguments.length===1){this._al=value;return value}else{return this._al}},_t:false,t:function(value){if(arguments.length===1){this._t=value;return value}else{return this._t}},_aj:null,aj:function(value){if(arguments.length===1){this._aj=value;return value}else{return this._aj}},_m:false,m:function(value){if(arguments.length===1){this._m=value;return value}else{return this._m}},_s:false,s:function(value){if(arguments.length===1){this._s=value;return value}else{return this._s}},_n:false,n:function(value){if(arguments.length===1){this._n=value;return value}else{return this._n}},_r:false,r:function(value){if(arguments.length===1){this._r=value;return value}else{return this._r}},_q:false,q:function(value){if(arguments.length===1){this._q=value;return value}else{return this._q}},_p:false,p:function(value){if(arguments.length===1){this._p=value;return value}else{return this._p}},getMembersOfLevel:function(a){},getMembersOfHierarchy:function(a){},getMembersOfMember:function(a){},setCube:function(a){if(!this.isInitialized()){throw new $.ig.InvalidOperationException(1,"Data source is not initialized.")}return this.an(a)},setMeasureGroup:function(a){if(!this.isInitialized()){throw new $.ig.InvalidOperationException(1,"Data source is not initialized.")}return this.ao(a)},getCoreElement:function(a,b){if(b==$.ig.MeasureList.prototype.$type){var c;if(this.measureListLocation()==$.ig.MeasureListLocation.prototype.columns){c=this.columnAxis()}else{c=this.rowAxis()}var d=null;var f=c.getEnumerator();while(f.moveNext()){var e=f.current();d=$.ig.util.cast($.ig.MeasureList.prototype.$type,e);if(d!=null){break}}return d}else{return this.getCoreElements(a,b).firstOrDefault$1($.ig.ICoreOlapElement.prototype.$type)}},getCoreElements:function(a,b){var $self=this;if(b==$.ig.Dimension.prototype.$type){return $self.a($.ig.Dimension.prototype.$type,$self.c().n().where$1($.ig.Dimension.prototype.$type,function(c){return a(c)}))}if(b==$.ig.Hierarchy.prototype.$type){return $self.a($.ig.Hierarchy.prototype.$type,$self.c().o().where$1($.ig.Hierarchy.prototype.$type,function(c){return a(c)}))}if(b==$.ig.Level.prototype.$type){return $self.a($.ig.Level.prototype.$type,$self.c().r().where$1($.ig.Level.prototype.$type,function(c){return a(c)}))}if(b==$.ig.Measure.prototype.$type){return $self.a($.ig.Measure.prototype.$type,$self.c().s().where$1($.ig.Measure.prototype.$type,function(c){return a(c)}))}if(b==$.ig.KpiMeasure.prototype.$type){return $self.a($.ig.KpiMeasure.prototype.$type,$self.c().q().where$1($.ig.KpiMeasure.prototype.$type,function(c){return a(c)}))}if(b==$.ig.Kpi.prototype.$type){return $self.a($.ig.Kpi.prototype.$type,$self.c().p().where$1($.ig.Kpi.prototype.$type,function(c){return a(c)}))}throw new $.ig.NotSupportedException(0,"Supported types are Dimension, Hierarchy, Level and Measure")},expandTupleMember:function(a,b,c){var $self=this;var d=$self.d(a,$self.result());if(d==null){throw new $.ig.InvalidOperationException(1,"No axis found for the specified index.")}var e=$self.ac.where$1($.ig.PositionInfo.prototype.$type,function(f){return f.c()==a&&f.b()==b&&f.a()==c}).firstOrDefault$1($.ig.PositionInfo.prototype.$type);if(e==null){e=function(){var $ret=new $.ig.PositionInfo;$ret.c(a);$ret.a(c);$ret.b(b);return $ret}();$self.ac.add(e)}else{$self.ac.remove(e)}},collapseTupleMember:function(a,b,c){var $self=this;var d=$self.d(a,$self.result());if(d==null){throw new $.ig.InvalidOperationException(1,"No axis found for the specified index.")}var e=$self.ac.where$1($.ig.PositionInfo.prototype.$type,function(f){return f.c()==a&&f.b()==b&&f.a()==c}).firstOrDefault$1($.ig.PositionInfo.prototype.$type);if(e==null){e=function(){var $ret=new $.ig.PositionInfo;$ret.c(a);$ret.a(c);$ret.b(b);return $ret}();$self.ab.add(e)}else{$self.ac.remove(e)}},clearPendingChanges:function(){this.ab.clear();this.ac.clear()},update:function(){var $self=this;if($self.t()){return $self.aj()}$self.t(true);if($self.ac.count()>0){var a=$self.as($self.ac);$self.aj(a.continueWithTask$1($.ig.OlapResult.prototype.$type,function(b){return $self.ai()}))}else{$self.aj($self.ai())}var b=$self.aj();$self.aj().i(function(c){$self.t(false);$self.aj(null)});return b},initialize:function(){var $self=this;if($self.o()){return $self.al()}$self.o(true);$self.al($self.am());var a=$self.al();$self.al().i(function(b){$self.o(false);$self.al(null)});return a},addFilterMember:function(a,b){var $self=this;var c;var d=function(){var $ret=$self.b(a,c);c=$ret.filtersCollection;return $ret.ret}();if(d==null){d=new $.ig.AxisElement(a,function(){var $ret=new $.ig.ArrayListCollection$1(String);$ret.add(b);return $ret}());c.add(d)}else{if(!d.a().contains(b)){d.a().add(b);if($self.af.contains(b)){$self.af.remove(b)}else{$self.af.add(b)}}}},getFilterMemberNames:function(a){var $self=this;var b;var c=function(){var $ret=$self.b(a,b);b=$ret.filtersCollection;return $ret.ret}();if(c!=null){return $self.a(String,c.a())}return new $.ig.ArrayListCollection$1(String)},removeFilterMember:function(a,b){var $self=this;var c;var d=function(){var $ret=$self.b(a,c);c=$ret.filtersCollection;return $ret.ret}();if(d==null){return}if(d.a().remove(b)){if($self.af.contains(b)){$self.af.remove(b)}else{$self.af.add(b)}}},removeAllFilterMembers:function(a){var $self=this;var b;var c=function(){var $ret=$self.b(a,b);b=$ret.filtersCollection;return $ret.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($self.af.contains(e)){$self.af.remove(e)}else{$self.af.add(e)}}},getProviderDefaultProperties:function(){var a=new $.ig.List$1($.ig.KeyValueItem.prototype.$type,0);return a},getProviderDefaultRestrictions:function(){var a=new $.ig.List$1($.ig.KeyValueItem.prototype.$type,0);return a},tryGetMember:function(a,b){var $self=this;return{ret:function(){var $ret=$self.c().f(a,b);b=$ret.member;return $ret.ret}(),member:b};return{member:b}},tryGetMembersForLevel:function(a,b){var $self=this;return{ret:function(){var $ret=$self.c().h(a,b);b=$ret.members;return $ret.ret}(),members:b};return{members:b}},am:function(){},ai:function(){},h:function(){},ah:function(){},an:function(a){var $self=this;if(String.isNullOrEmpty(a)){if(a==null){throw new $.ig.ArgumentNullException("cubeName")}throw new $.ig.InvalidOperationException(1,"cubeName cannot be empty.")}var b=new $.ig.TaskCompletionSource$1($.ig.OlapMetadataTreeItem.prototype.$type,0);if($self.cube()!=null){if($self.cube().name()==a){b.e($self.metadataTree());return b.b()}$self.au()}var d=$self.cubes().getEnumerator();while(d.moveNext()){var c=d.current();if(c.name()==a){$self.cube(c);break}}var e=$self.ah();if(!$self.isInitialized()){var f=$self.sourceOptions().measureGroup();if(!String.isNullOrEmpty(f)){return e.continueWithTask$1($.ig.OlapMetadataTreeItem.prototype.$type,function(g){return $self.ao(f)})}}return e.continueWithTask$1($.ig.OlapMetadataTreeItem.prototype.$type,function(g){return $self.ao(null)})},ak:function(){var $self=this;var a=null;var b=null;var c=null;var d=new $.ig.List$1($.ig.AxisElement.prototype.$type,0);if(!String.isNullOrEmpty($self.sourceOptions().columns())){var e=new $.ig.AxisDefinitionParser($self.sourceOptions().columns());a=e.c()}if(!String.isNullOrEmpty($self.sourceOptions().rows())){var f=new $.ig.AxisDefinitionParser($self.sourceOptions().rows());b=f.c()}if(!String.isNullOrEmpty($self.sourceOptions().filters())){var g=new $.ig.AxisDefinitionParser($self.sourceOptions().filters());c=g.c()}if(a!=null&&a.count()>0){var i=a.getEnumerator();while(i.moveNext()){var h=i.current();$self.at($.ig.ICoreOlapElement.prototype.$type,h.b(),$self.columnAxis(),$.ig.Hierarchy.prototype.$type);$self.u().add(h);if(h.a().count()>0){d.add(h);var k=h.a().getEnumerator();while(k.moveNext()){var j=k.current();$self.af.add(j)}}}}if(b!=null&&b.count()>0){var m=b.getEnumerator();while(m.moveNext()){var l=m.current();$self.at($.ig.ICoreOlapElement.prototype.$type,l.b(),$self.rowAxis(),$.ig.Hierarchy.prototype.$type);$self.w().add(l);if(l.a().count()>0){d.add(l);var o=l.a().getEnumerator();while(o.moveNext()){var n=o.current();$self.af.add(n)}}}}if(c!=null&&c.count()>0){var q=c.getEnumerator();while(q.moveNext()){var p=q.current();$self.at($.ig.Hierarchy.prototype.$type,p.b(),$self.filters(),$.ig.Hierarchy.prototype.$type);$self.v().add(p);if(p.a().count()>0){d.add(p);var s=p.a().getEnumerator();while(s.moveNext()){var r=s.current();$self.af.add(r)}}}}var t=null;if(!String.isNullOrEmpty($self.sourceOptions().measures())){var u=new $.ig.AxisDefinitionParser($self.sourceOptions().measures());t=u.c()}if(t!=null&&t.count()>0){var w=t.getEnumerator();while(w.moveNext()){var v=w.current();$self.at($.ig.Measure.prototype.$type,v.b(),$self.measures(),$.ig.Measure.prototype.$type)}}if($self.m()||$self.s()||$self.n()||$self.r()||$self.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]=$self.getMembersOfHierarchy(z)}var aa=new $.ig.TaskCompletionSource$1($.ig.OlapMetadataTreeItem.prototype.$type,0);var ab=new $.ig.TaskFactory;ab.c(x,function(ac){$self.ai().i(function(ad){$self.aw();aa.e($self.metadataTree())})});return aa.b()}return $self.ai().continueWithTask$1($.ig.OlapMetadataTreeItem.prototype.$type,function(ac){$self.aw();var ad=new $.ig.TaskCompletionSource$1($.ig.OlapMetadataTreeItem.prototype.$type,0);ad.e($self.metadataTree());return ad.b()})}$self.aw();var ac=new $.ig.TaskCompletionSource$1($.ig.OlapMetadataTreeItem.prototype.$type,0);ac.e($self.metadataTree());return ac.b()},aq:function(a){var $self=this;var b=$self.dataProviderFactory().createDataProvider();var c=$self.getProviderDefaultRestrictions();var d=$self.getProviderDefaultProperties();var e=b.discoverCubesAsync(d,c).j($.ig.IList$1.prototype.$type.specialize($.ig.Cube.prototype.$type),function(f){$self.cubes($self.a($.ig.Cube.prototype.$type,f.m()));return $self.cubes()});return e},ar:function(){var $self=this;var a=$self.dataProviderFactory().createDataProvider();var b=$self.getProviderDefaultRestrictions();var c=$self.getProviderDefaultProperties();var d=a.discoverMeasureGroupsAsync(c,b).j($.ig.IList$1.prototype.$type.specialize($.ig.MeasureGroup.prototype.$type),function(e){$self.measureGroups($self.a($.ig.MeasureGroup.prototype.$type,e.m()));return $self.measureGroups()});return d},aw:function(){this.isInitialized(true)},au:function(){this.cube(null);this.measureGroups(new $.ig.ArrayListCollection$1($.ig.MeasureGroup.prototype.$type));this.filters().clear();this.rowAxis().clear();this.columnAxis().clear();this.measures().clear();this.c(null);this.av()},av:function(){this.measureGroup(null);this.metadataTree(null)},ao:function(a){var $self=this;if($self.cube()==null){throw new $.ig.InvalidOperationException(1,"Data source has no Cube set.")}var b=new $.ig.TaskCompletionSource$1($.ig.OlapMetadataTreeItem.prototype.$type,0);if($self.measureGroup()!=null){if($self.measureGroup().name()==a){b.e($self.metadataTree());return b.b()}$self.av()}if(!String.isNullOrEmpty(a)&&$self.measureGroups().count()==0){var c=$self.ar().continueWithTask$1($.ig.OlapMetadataTreeItem.prototype.$type,function(d){if($self.measureGroups().count()==0){return $self.ao(null)}return $self.ao(a)});return c}var e=$self.measureGroups().getEnumerator();while(e.moveNext()){var d=e.current();if(d.name()==a){$self.measureGroup(d);break}}$self.metadataTree($self.k(a));b.e($self.metadataTree());return b.b()},k:function(a){var $self=this;var b=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.cube);$ret.caption($self.cube().caption());$ret.item($self.cube());return $ret}();var c;var d;var e;var f=true;if(String.isNullOrEmpty(a)||$self.measureGroups()==null){c=$self.c().n();d=$self.c().s();e=$self.c().p()}else{f=false;c=$self.c().a().getMeasureGroupDimensions(a);d=$self.c().a().getMeasureGroupMeasures(a);e=$self.c().a().getMeasureGroupKpis(a)}var g=$.ig.MetaTreeHelper.prototype.getDimensionMetaItems(c,d,e,$self.c().o(),$self.c().r(),f,$self.c());$.ig.MetaTreeHelper.prototype.setMetaItemChildren(b,g);return b},d:function(a,b){var $self=this;if(b!=null&&b.axes().count()>0){return b.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(c){return c.name()==a}).firstOrDefault$1($.ig.OlapResultAxis.prototype.$type)}return null},ay:function(a,b){var $self=this;switch(a.action()){case $.ig.NotifyCollectionChangedAction.prototype.add:var d=a.newItems().getEnumerator();while(d.moveNext()){var c=d.current();var e=$.ig.util.cast($.ig.Hierarchy.prototype.$type,c);if(e!=null){if($self.isInitialized()){b.add(new $.ig.AxisElement(e.uniqueName(),new $.ig.ArrayListCollection$1(String)))}}}break;case $.ig.NotifyCollectionChangedAction.prototype.remove:var g=a.oldItems().getEnumerator();while(g.moveNext()){var f=g.current();var h=$.ig.util.cast($.ig.Hierarchy.prototype.$type,f);if(h!=null){var i=b.where$1($.ig.AxisElement.prototype.$type,function(j){return j.b()==h.uniqueName()}).firstOrDefault$1($.ig.AxisElement.prototype.$type);if(i!=null){var j=new $.ig.List$1(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);$self.removeFilterMember(i.b(),m)}b.remove(i)}}else{var n=$.ig.util.cast($.ig.MeasureList.prototype.$type,f);if(n!=null){if(!$self.r()&&!$self.q()&&!$self.p()){$self.measures().clear()}}}}break}},a0:function(a,b){var $self=this;switch(a.action()){case $.ig.NotifyCollectionChangedAction.prototype.add:var d=a.newItems().getEnumerator();while(d.moveNext()){var c=d.current();var e=$.ig.util.cast($.ig.Hierarchy.prototype.$type,c);if(e!=null){var f=$.ig.util.cast($.ig.MeasureList.prototype.$type,b.where$1($.ig.ICoreOlapElement.prototype.$type,function(g){return $.ig.util.cast($.ig.MeasureList.prototype.$type,g)!==null}).firstOrDefault$1($.ig.ICoreOlapElement.prototype.$type));if(f!=null&&$self.measureListIndex()>=a.newStartingIndex()){$self.measureListIndex($self.measureListIndex()+1)}}}break;case $.ig.NotifyCollectionChangedAction.prototype.remove:var h=a.oldItems().getEnumerator();while(h.moveNext()){var g=h.current();var i=$.ig.util.cast($.ig.Hierarchy.prototype.$type,g);if(i!=null){var j=$.ig.util.cast($.ig.MeasureList.prototype.$type,b.where$1($.ig.ICoreOlapElement.prototype.$type,function(k){return $.ig.util.cast($.ig.MeasureList.prototype.$type,k)!==null}).firstOrDefault$1($.ig.ICoreOlapElement.prototype.$type));if(j!=null&&$self.measureListIndex()>a.oldStartingIndex()){$self.measureListIndex($self.measureListIndex()-1)}}}break}},az:function(){var $self=this;var a;if($self.measureListLocation()==$.ig.MeasureListLocation.prototype.columns){a=$self.columnAxis()}else{a=$self.rowAxis()}var b=null;var c=0;var e=a.getEnumerator();while(e.moveNext()){var d=e.current();b=$.ig.util.cast($.ig.MeasureList.prototype.$type,d);if(b!=null){break}c++}if($self.measures().count()>1){if(b==null){b=function(){var $ret=new $.ig.MeasureList;$ret.measures($self.measures());return $ret}();if($self.measureListIndex()<0||$self.measureListIndex()>a.count()){$self.ag=a.count();a.add(b)}else{a.insert($self.measureListIndex(),b)}}else{if(c!=$self.measureListIndex()){a.removeAt(c);if($self.measureListIndex()>a.count()){$self.ag=a.count();a.add(b)}else{a.insert($self.measureListIndex(),b)}}}}else{if(b!=null){a.removeAt(c)}}},ae:function(){return this.ac},ad:function(){return this.ab},at:function($tItem,a,b,c){var $self=this;var d=function(e){return e.uniqueName()==a};var e=$self.getCoreElement(d,c);if(e!=null&&!b.contains($.ig.Object.prototype.$type,e)){b.add(e)}},as:function(a){var $self=this;var b=new $.ig.List$1(String,0);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();var e=$self.d(c.c(),$self.result()).tuples().__inner[c.b()].members().item(c.a());var f=$self.getCoreElement(function(g){return g.hierarchyUniqueName()==e.hierarchyUniqueName()&&g.depth()==e.levelNumber()+1},$.ig.Level.prototype.$type);if(f!=null&&!$self.c().b(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]=$self.getMembersOfLevel(b.item(h))}return(new $.ig.TaskFactory).d($.ig.Array.prototype.$type,g,function(i){return i})}var i=new $.ig.TaskCompletionSource$1($.ig.Array.prototype.$type,0);i.e(new Array(0));return i.b()},ax:function(){var a;if(this.measureListLocation()==$.ig.MeasureListLocation.prototype.columns){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=$.ig.util.cast($.ig.MeasureList.prototype.$type,d);if(b!=null){break}c++}if(b!=null){this.q(true);a.removeAt(c)}},a:function($t,a){var b=new $.ig.ArrayListCollection$1($t);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b.add(c)}return b},b:function(a,b){var $self=this;var c=$self.u().where$1($.ig.AxisElement.prototype.$type,function(d){return d.b()==a}).firstOrDefault$1($.ig.AxisElement.prototype.$type);if(c!=null){b=$self.u();return{ret:c,filtersCollection:b}}c=$self.w().where$1($.ig.AxisElement.prototype.$type,function(d){return d.b()==a}).firstOrDefault$1($.ig.AxisElement.prototype.$type);if(c!=null){b=$self.w();return{ret:c,filtersCollection:b}}c=$self.v().where$1($.ig.AxisElement.prototype.$type,function(d){return d.b()==a}).firstOrDefault$1($.ig.AxisElement.prototype.$type);if(c!=null){b=$self.v();return{ret:c,filtersCollection:b}}b=null;return{ret:null,filtersCollection:b};return{filtersCollection:b}},$type:new $.ig.Type("OlapDataSource",$.ig.Object.prototype.$type,[$.ig.IOlapDataSource.prototype.$type])},true);$.ig.util.defType("PositionInfo","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_b:0,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_a:0,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},$type:new $.ig.Type("PositionInfo",$.ig.Object.prototype.$type)},true);$.ig.util.defType("CubeMetaItemsCache","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.m=new $.ig.Dictionary$2(String,$.ig.Tuple$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.Member.prototype.$type),0);this.i=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Member.prototype.$type,0);this.l=new $.ig.Dictionary$2(String,$.ig.IList$1.prototype.$type.specialize($.ig.Member.prototype.$type),0);this.k=new $.ig.Dictionary$2(String,$.ig.Measure.prototype.$type,0);this.j=new $.ig.Dictionary$2(String,$.ig.KpiMeasure.prototype.$type,0)},m:null,i:null,l:null,k:null,j:null,_s:null,s:function(value){if(arguments.length===1){this._s=value;return value}else{return this._s}},_q:null,q:function(value){if(arguments.length===1){this._q=value;return value}else{return this._q}},_n:null,n:function(value){if(arguments.length===1){this._n=value;return value}else{return this._n}},_o:null,o:function(value){if(arguments.length===1){this._o=value;return value}else{return this._o}},_r:null,r:function(value){if(arguments.length===1){this._r=value;return value}else{return this._r}},_p:null,p:function(value){if(arguments.length===1){this._p=value;return value}else{return this._p}},_t:null,t:function(value){if(arguments.length===1){this._t=value;return value}else{return this._t}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},b:function(a){return this.l.containsKey(a)},u:function(a){var $self=this;var b;if(!function(){var $ret=$self.m.tryGetValue(a.uniqueName(),b);b=$ret.value;return $ret.ret}()){var c=$self.m.count();b=new $.ig.Tuple$2($.ig.Number.prototype.$type,$.ig.Member.prototype.$type,c,a);$self.m.item(a.uniqueName(),b);$self.i.item(c,a);var d;if(!function(){var $ret=$self.l.tryGetValue(a.levelUniqueName(),d);d=$ret.value;return $ret.ret}()){d=new $.ig.ArrayListCollection$1($.ig.Member.prototype.$type);$self.l.item(a.levelUniqueName(),d)}d.add(a)}return b.a()},g:function(a,b){var $self=this;var c;if(function(){var $ret=$self.m.tryGetValue(a,c);c=$ret.value;return $ret.ret}()){b=c.a();return{ret:true,memberOrdinal:b}}b=-1;return{ret:false,memberOrdinal:b};return{memberOrdinal:b}},f:function(a,b){var $self=this;var c;if(function(){var $ret=$self.m.tryGetValue(a,c);c=$ret.value;return $ret.ret}()){b=c.b();return{ret:true,member:b}}b=null;return{ret:false,member:b};return{member:b}},e:function(a,b){var $self=this;return{ret:function(){var $ret=$self.i.tryGetValue(a,b);b=$ret.value;return $ret.ret}(),member:b};return{member:b}},h:function(a,b){var $self=this;return{ret:function(){var $ret=$self.l.tryGetValue(a,b);b=$ret.value;return $ret.ret}(),members:b};return{members:b}},d:function(a,b){var $self=this;if(!function(){var $ret=$self.k.tryGetValue(a,b);b=$ret.value;return $ret.ret}()){b=$self.s().where$1($.ig.Measure.prototype.$type,function(c){return c.uniqueName()==a}).firstOrDefault$1($.ig.Measure.prototype.$type);if(b==null){return{ret:false,measure:b}}$self.k.add(a,b)}return{ret:true,measure:b};return{measure:b}},c:function(a,b){var $self=this;if(!function(){var $ret=$self.j.tryGetValue(a,b);b=$ret.value;return $ret.ret}()){b=$self.q().where$1($.ig.KpiMeasure.prototype.$type,function(c){return c.uniqueName()==a}).firstOrDefault$1($.ig.KpiMeasure.prototype.$type);if(b==null){return{ret:false,measure:b}}$self.j.add(a,b)}return{ret:true,measure:b};return{measure:b}},$type:new $.ig.Type("CubeMetaItemsCache",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MetaTreeHelper","Object",{init:function(){$.ig.Object.prototype.init.call(this)},getDimensionMetaItems:function(a,b,c,d,e,f,g){var $self=this;var h=new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0);var i=new $.ig.HierarchyItemPosition;i.a(0);i.b(0);var j=new $.ig.List$1($.ig.Hierarchy.prototype.$type,0);var l=d.getEnumerator();while(l.moveNext()){var k=l.current();j.add(k)}var m=new $.ig.List$1($.ig.Level.prototype.$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=$.ig.MetaTreeHelper.prototype.e(j,m,p,i);if(p.dimensionType()!=$.ig.DimensionType.prototype.measure){var s=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.dimension);$ret.caption(p.caption());$ret.item(p);return $ret}();$.ig.MetaTreeHelper.prototype.setMetaItemChildren(s,r);h.add(s)}else{var t=$.ig.MetaTreeHelper.prototype.b(b,p);h.insert(0,t);if(c.count$1($.ig.Kpi.prototype.$type)>0){var u=function(){var $ret=new $.ig.KpiDimension;$ret.caption("Kpis");return $ret}();var v=$.ig.MetaTreeHelper.prototype.a(c,u,g);v.type($.ig.OlapMetadataTreeItemType.prototype.kpiRoot);h.insert(1,v)}}}return h},setMetaItemChildren:function(a,b){if(b.count()>0){var c=new Array(b.count());for(var d=0;d<b.count();d++){c[d]=b.item(d)}a.children(c)}},e:function(a,b,c,d){var $self=this;var e=new $.ig.Dictionary$2(String,$.ig.Tuple$2.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type)),0);var f=new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$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=$.ig.MetaTreeHelper.prototype.c(g.hierarchyDisplayFolder());for(var k=0;k<j.length;k++){var l=j[k];i+=l+"\\";var m;if(!function(){var $ret=e.tryGetValue(i,m);m=$ret.value;return $ret.ret}()){var n=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.group);$ret.caption(l);return $ret}();m=new $.ig.Tuple$2($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type),n,new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$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 $.ig.HierarchyOrigin.prototype.systemEnabled:o=$.ig.OlapMetadataTreeItemType.prototype.systemEnabledHierarchy;break;case $.ig.HierarchyOrigin.prototype.userDefined:o=$.ig.OlapMetadataTreeItemType.prototype.userDefinedHierarchy;break;default:o=$.ig.OlapMetadataTreeItemType.prototype.parentChildHierarchy;break}var p=$.ig.MetaTreeHelper.prototype.f(b,g,d);var q=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type(o);$ret.caption(g.caption());$ret.item(g);return $ret}();$.ig.MetaTreeHelper.prototype.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();$.ig.MetaTreeHelper.prototype.setMetaItemChildren(t,r.b())}return f},f:function(a,b,c){var $self=this;var d=new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$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=$.ig.OlapMetadataTreeItemType.prototype.level1;break;case 2:f=$.ig.OlapMetadataTreeItemType.prototype.level2;break;case 3:f=$.ig.OlapMetadataTreeItemType.prototype.level3;break;case 4:f=$.ig.OlapMetadataTreeItemType.prototype.level4;break;default:f=$.ig.OlapMetadataTreeItemType.prototype.level5;break}var g=function(){var $ret=new $.ig.OlapMetadataTreeItem;$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},b:function(a,b){var $self=this;var c=new $.ig.Dictionary$2(String,$.ig.Tuple$2.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type)),0);var d=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.measure);$ret.caption(b.caption());$ret.item(b);return $ret}();var e=new $.ig.Tuple$2($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type),d,new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0));var g=a.getEnumerator();while(g.moveNext()){var f=g.current();if($.ig.util.cast($.ig.KpiMeasure.prototype.$type,f)!==null){continue}var h=e;if(!String.isNullOrEmpty(f.measureGroupName())){if(!function(){var $ret=c.tryGetValue(f.measureGroupName(),h);h=$ret.value;return $ret.ret}()){var i=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.group);$ret.caption(f.measureGroupName());return $ret}();h=new $.ig.Tuple$2($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type),i,new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$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=$.ig.MetaTreeHelper.prototype.c(f.measureDisplayFolder());for(var m=0;m<l.length;m++){var n=l[m];k+="\\"+n;var o;if(!function(){var $ret=c.tryGetValue(k,o);o=$ret.value;return $ret.ret}()){var p=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.group);$ret.caption(n);return $ret}();o=new $.ig.Tuple$2($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type),p,new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0));c.add(k,o);j.b().add(p)}j=o}}var q=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.measure);$ret.caption(f.caption());$ret.item(f);return $ret}();j.b().add(q)}var r=new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0);var t=e.b().where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(u){return u.type()==$.ig.OlapMetadataTreeItemType.prototype.group}).orderBy$2($.ig.OlapMetadataTreeItem.prototype.$type,String,function(u){return u.caption()}).getEnumerator();while(t.moveNext()){var s=t.current();r.add(s)}var v=e.b().where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(w){return w.type()!=$.ig.OlapMetadataTreeItemType.prototype.group}).orderBy$2($.ig.OlapMetadataTreeItem.prototype.$type,String,function(w){return w.caption()}).getEnumerator();while(v.moveNext()){var u=v.current();r.add(u)}$.ig.MetaTreeHelper.prototype.setMetaItemChildren(d,r);var x=c.values().getEnumerator();while(x.moveNext()){var w=x.current();var y=w.b();var z=y.where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(aa){return aa.type()==$.ig.OlapMetadataTreeItemType.prototype.group}).orderBy$2($.ig.OlapMetadataTreeItem.prototype.$type,String,function(aa){return aa.caption()}).toList$1($.ig.OlapMetadataTreeItem.prototype.$type);var aa=y.where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(ab){return ab.type()!=$.ig.OlapMetadataTreeItemType.prototype.group}).orderBy$2($.ig.OlapMetadataTreeItem.prototype.$type,String,function(ab){return ab.caption()}).toList$1($.ig.OlapMetadataTreeItem.prototype.$type);var ab=new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$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();$.ig.MetaTreeHelper.prototype.setMetaItemChildren(ae,ab)}return d},a:function(a,b,c){var $self=this;var d=new $.ig.Dictionary$2(String,$.ig.Tuple$2.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type)),0);var e=c.s().toList$1($.ig.Measure.prototype.$type);c.s(e);var f=new $.ig.List$1($.ig.KpiMeasure.prototype.$type,0);c.q(f);var g=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.kpiRoot);$ret.caption(b.caption());$ret.item(b);return $ret}();var h=new $.ig.Tuple$2($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type),g,new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$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=$.ig.MetaTreeHelper.prototype.c(i.kpiDisplayFolder());for(var n=0;n<m.length;n++){var o=m[n];l+="\\"+o;var p;if(!function(){var $ret=d.tryGetValue(l,p);p=$ret.value;return $ret.ret}()){var q=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.group);$ret.caption(o);return $ret}();p=new $.ig.Tuple$2($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type),q,new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0));d.add(l,p);k.b().add(q)}k=p}}var r=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.kpi);$ret.caption(i.caption());$ret.item(i);return $ret}();if(!String.isNullOrEmpty(i.kpiValue())){var s=null;
var t=$.ig.OlapMetadataTreeItemType.prototype.measure;var u="Value";if(!function(){var $ret=c.d(i.kpiValue(),s);s=$ret.measure;return $ret.ret}()){t=$.ig.OlapMetadataTreeItemType.prototype.kpiValue;s=$.ig.KpiMeasure.prototype.createKpiValueMeasure(i);e.add(s);f.add(s)}else{u+=" ("+s.caption()+")"}r.e(function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.caption(u);$ret.item(s);$ret.type(t);return $ret}())}if(!String.isNullOrEmpty(i.kpiGoal())){var v=null;var w=$.ig.OlapMetadataTreeItemType.prototype.measure;var x="Goal";if(!function(){var $ret=c.d(i.kpiGoal(),v);v=$ret.measure;return $ret.ret}()){w=$.ig.OlapMetadataTreeItemType.prototype.kpiGoal;v=$.ig.KpiMeasure.prototype.createKpiGoalMeasure(i);e.add(v);f.add(v)}else{x+=" ("+v.caption()+")"}r.e(function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.caption(x);$ret.item(v);$ret.type(w);return $ret}())}if(!String.isNullOrEmpty(i.kpiStatus())){var y=$.ig.KpiMeasure.prototype.createKpiStatusMeasure(i);e.add(y);f.add(y);r.e(function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.caption("Status");$ret.item(y);$ret.type($.ig.OlapMetadataTreeItemType.prototype.kpiStatus);return $ret}())}if(!String.isNullOrEmpty(i.kpiTrend())){var z=$.ig.KpiMeasure.prototype.createKpiTrendMeasure(i);e.add(z);f.add(z);r.e(function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.caption("Trend");$ret.item(z);$ret.type($.ig.OlapMetadataTreeItemType.prototype.kpiTrend);return $ret}())}if(!String.isNullOrEmpty(i.kpiWeight())){var aa=$.ig.KpiMeasure.prototype.createKpiWeightMeasure(i);e.add(aa);f.add(aa);r.e(function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.caption("Weight");$ret.item(aa);$ret.type($.ig.OlapMetadataTreeItemType.prototype.kpiWeight);return $ret}())}k.b().add(r)}var ab=new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0);var ad=h.b().where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(ae){return ae.type()==$.ig.OlapMetadataTreeItemType.prototype.group}).orderBy$2($.ig.OlapMetadataTreeItem.prototype.$type,String,function(ae){return ae.caption()}).getEnumerator();while(ad.moveNext()){var ac=ad.current();ab.add(ac)}var af=h.b().where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(ag){return ag.type()!=$.ig.OlapMetadataTreeItemType.prototype.group}).orderBy$2($.ig.OlapMetadataTreeItem.prototype.$type,String,function(ag){return ag.caption()}).getEnumerator();while(af.moveNext()){var ae=af.current();ab.add(ae)}$.ig.MetaTreeHelper.prototype.setMetaItemChildren(g,ab);var ah=d.values().getEnumerator();while(ah.moveNext()){var ag=ah.current();var ai=ag.b();var aj=ai.where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(ak){return ak.type()==$.ig.OlapMetadataTreeItemType.prototype.group}).orderBy$2($.ig.OlapMetadataTreeItem.prototype.$type,String,function(ak){return ak.caption()}).toList$1($.ig.OlapMetadataTreeItem.prototype.$type);var ak=ai.where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(al){return al.type()!=$.ig.OlapMetadataTreeItemType.prototype.group}).orderBy$2($.ig.OlapMetadataTreeItem.prototype.$type,String,function(al){return al.caption()}).toList$1($.ig.OlapMetadataTreeItem.prototype.$type);var al=new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$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();$.ig.MetaTreeHelper.prototype.setMetaItemChildren(ao,al)}return g},c:function(a){var b=a.split("\\");return b},$type:new $.ig.Type("MetaTreeHelper",$.ig.Object.prototype.$type)},true);$.ig.util.defType("HierarchyItemPosition","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_a:0,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},_b:0,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},$type:new $.ig.Type("HierarchyItemPosition",$.ig.Object.prototype.$type)},true);$.ig.util.defType("DataSourceBaseOptions","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_cube:null,cube:function(value){if(arguments.length===1){this._cube=value;return value}else{return this._cube}},_measureGroup:null,measureGroup:function(value){if(arguments.length===1){this._measureGroup=value;return value}else{return this._measureGroup}},_measures:null,measures:function(value){if(arguments.length===1){this._measures=value;return value}else{return this._measures}},_filters:null,filters:function(value){if(arguments.length===1){this._filters=value;return value}else{return this._filters}},_columns:null,columns:function(value){if(arguments.length===1){this._columns=value;return value}else{return this._columns}},_rows:null,rows:function(value){if(arguments.length===1){this._rows=value;return value}else{return this._rows}},$type:new $.ig.Type("DataSourceBaseOptions",$.ig.Object.prototype.$type)},true);$.ig.util.defType("AxisDefinitionParser","Object",{init:function(a){$.ig.Object.prototype.init.call(this);this.d(-1);this.k(a)},_a:false,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},_g:null,g:function(value){if(arguments.length===1){this._g=value;return value}else{return this._g}},_d:0,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},_k:null,k:function(value){if(arguments.length===1){this._k=value;return value}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 $.ig.AxisDefinitionParser.prototype.e:if(a==-1){a=this.d()}break;case $.ig.AxisDefinitionParser.prototype.f:b=this.d();while(this.d()+1<this.k().length){d=this.k().substr(this.d()+1,1);switch(d){case $.ig.AxisDefinitionParser.prototype.f:b=this.d()+1;break;case $.ig.AxisDefinitionParser.prototype.h:if($.ig.AxisDefinitionParser.prototype.f==this.k().substr(this.d(),1)){c=true}break;case $.ig.AxisDefinitionParser.prototype.i:case $.ig.AxisDefinitionParser.prototype.j:c=true;break}if(c){break}this.d(this.d()+1)}c=true;break;case $.ig.AxisDefinitionParser.prototype.h:c=true;break;case $.ig.AxisDefinitionParser.prototype.i:this.a(true);break;case $.ig.AxisDefinitionParser.prototype.j:$.ig.Debug.prototype.a(this.a());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 $.ig.List$1($.ig.AxisElement.prototype.$type,0);var b=null;while(this.b()){if(!this.a()){b=new $.ig.ArrayListCollection$1(String);var c=new $.ig.AxisElement(this.g(),b);a.add(c)}else if(b!=null){b.add(this.g())}}return a},$type:new $.ig.Type("AxisDefinitionParser",$.ig.Object.prototype.$type)},true);$.ig.util.defType("CoreOlapElementParser","Object",{init:function(a){$.ig.Object.prototype.init.call(this);this.c(-1);this.h(a)},_f:null,f:function(value){if(arguments.length===1){this._f=value;return value}else{return this._f}},_c:0,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_h:null,h:function(value){if(arguments.length===1){this._h=value;return value}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 $.ig.CoreOlapElementParser.prototype.d:if(a==-1){a=this.c()}break;case $.ig.CoreOlapElementParser.prototype.e:b=this.c();while(this.c()+1<this.h().length){d=this.h().substr(this.c()+1,1);switch(d){case $.ig.CoreOlapElementParser.prototype.e:b=this.c()+1;break;case $.ig.CoreOlapElementParser.prototype.g:c=true;break}if(c){break}this.c(this.c()+1)}break;case $.ig.CoreOlapElementParser.prototype.g: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 $.ig.List$1(String,0);while(this.a()){a.add(this.f())}return a},$type:new $.ig.Type("CoreOlapElementParser",$.ig.Object.prototype.$type)},true);$.ig.util.defType("KeyValueItem","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},$type:new $.ig.Type("KeyValueItem",$.ig.Object.prototype.$type)},true);$.ig.util.defType("AxisElement","Object",{init:function(a,b){$.ig.Object.prototype.init.call(this);this.b(a);this.a(b)},_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},$type:new $.ig.Type("AxisElement",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MeasureGroupMetaItemsCache","Object",{a:null,c:null,b:null,j:null,d:null,h:null,f:null,init:function(a,b,c,d){$.ig.Object.prototype.init.call(this);this.a=new $.ig.Dictionary$2(String,$.ig.IEnumerable$1.prototype.$type.specialize($.ig.Dimension.prototype.$type),0);this.c=new $.ig.Dictionary$2(String,$.ig.IEnumerable$1.prototype.$type.specialize($.ig.Measure.prototype.$type),0);this.b=new $.ig.Dictionary$2(String,$.ig.IEnumerable$1.prototype.$type.specialize($.ig.Kpi.prototype.$type),0);this.j=d;this.d=a;this.h=b;this.f=c},getMeasureGroupDimensions:function(a){var $self=this;var b;if(!function(){var $ret=$self.a.tryGetValue(a,b);b=$ret.value;return $ret.ret}()){var c=new $.ig.List$1(String,0);var e=$self.j.getEnumerator();while(e.moveNext()){var d=e.current();if(d.measureGroupName()==a){c.add(d.dimensionUniqueName())}}var f=new $.ig.List$1($.ig.Dimension.prototype.$type,0);var h=$self.d.getEnumerator();while(h.moveNext()){var g=h.current();if(c.contains(g.uniqueName())||g.dimensionType()==$.ig.DimensionType.prototype.measure){f.add(g)}}$self.a.add(a,f);b=f}return b},getMeasureGroupMeasures:function(a){var $self=this;var b;if(!function(){var $ret=$self.c.tryGetValue(a,b);b=$ret.value;return $ret.ret}()){var c=new $.ig.List$1($.ig.Measure.prototype.$type,0);var e=$self.h.getEnumerator();while(e.moveNext()){var d=e.current();if(d.measureGroupName()==a){c.add(d)}}$self.c.add(a,c);b=c}return b},getMeasureGroupKpis:function(a){var $self=this;var b;if(!function(){var $ret=$self.b.tryGetValue(a,b);b=$ret.value;return $ret.ret}()){var c=new $.ig.List$1($.ig.Kpi.prototype.$type,0);var e=$self.f.getEnumerator();while(e.moveNext()){var d=e.current();if(d.measureGroupName()==a){c.add(d)}}$self.b.add(a,c);b=c}return b},$type:new $.ig.Type("MeasureGroupMetaItemsCache",$.ig.Object.prototype.$type)},true);$.ig.util.defType("PositionItemInfo$2","Dictionary$2",{$tKey:null,$tSortKey:null,init:function($tKey,$tSortKey,a,b,c,d){this.q=new $.ig.Dictionary$2(this.$tKey,$.ig.Object.prototype.$type,0);this.$tKey=$tKey;this.$tSortKey=$tSortKey;this.$type=this.$type.specialize(this.$tKey,this.$tSortKey);$.ig.Dictionary$2.prototype.init.call(this,this.$tKey,$.ig.PositionItemInfo$2.prototype.$type.specialize(this.$tKey,this.$tSortKey));this.positionItem(a);this.positionIndex(b);this.positionItemIndex(c);this.positionItemDepth(0);this.positionItemDepthMin(-1);this.positionItemDepthMax(Number.MAX_VALUE);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())}},l:function(a,b,c,d){return new $.ig.PositionItemInfo$2(this.$tKey,this.$tSortKey,a,b,c,d)},_positionItemDepthMin:0,positionItemDepthMin:function(value){if(arguments.length===1){this._positionItemDepthMin=value;return value}else{return this._positionItemDepthMin}},_positionItemDepthMax:0,positionItemDepthMax:function(value){if(arguments.length===1){this._positionItemDepthMax=value;return value}else{return this._positionItemDepthMax}},_positionItem:null,positionItem:function(value){if(arguments.length===1){this._positionItem=value;return value}else{return this._positionItem}},_positionIndex:0,positionIndex:function(value){if(arguments.length===1){this._positionIndex=value;return value}else{return this._positionIndex}},_positionItemDepth:0,positionItemDepth:function(value){if(arguments.length===1){this._positionItemDepth=value;return value}else{return this._positionItemDepth}},_positionItemIndex:0,positionItemIndex:function(value){if(arguments.length===1){this._positionItemIndex=value;return value}else{return this._positionItemIndex}},_positionSize:0,positionSize:function(value){if(arguments.length===1){this._positionSize=value;return value}else{return this._positionSize}},_key:null,key:function(value){if(arguments.length===1){this._key=value;return value}else{return this._key}},_parentKey:null,parentKey:function(value){if(arguments.length===1){this._parentKey=value;return value}else{return this._parentKey}},_hierarchyKey:null,hierarchyKey:function(value){if(arguments.length===1){this._hierarchyKey=value;return value}else{return this._hierarchyKey}},_hierarchyLevelKey:null,hierarchyLevelKey:function(value){if(arguments.length===1){this._hierarchyLevelKey=value;return value}else{return this._hierarchyLevelKey}},_caption:null,caption:function(value){if(arguments.length===1){this._caption=value;return value}else{return this._caption}},_sortKey:null,sortKey:function(value){if(arguments.length===1){this._sortKey=value;return value}else{return this._sortKey}},_isExpandable:false,isExpandable:function(value){if(arguments.length===1){this._isExpandable=value;return value}else{return this._isExpandable}},_isExpanded:false,isExpanded:function(value){if(arguments.length===1){this._isExpanded=value;return value}else{return this._isExpanded}},m:function(a,b,c){var d=false;if(this.positionItemIndex()==-1){d=true}else{if(c!=null){if(a.item(this.positionItemIndex()).key()!=null){var e=c.item(this.positionItemIndex());d=a.item(this.positionItemIndex()).key().equals(e.key())}}}if(this.positionItemIndex()+1==this.positionSize()){return d}var f=this.n(a,b,this.positionItemIndex()+1,c);return d&&f},ab:function(a,b){},q:null,n:function(a,b,c,d){var $self=this;var e;var f=a.item(c);if(!$self.containsKey(f.key())){var g=$self.l(f,b,c,$self.positionSize());g.isExpandable(f.isExpandable());if($self.q.containsKey(g.key())){$self.q.remove(g.key());g.isExpanded(true)}if(f.parentKey()!=null){var h=null;if(function(){var $ret=$self.tryGetValue(f.parentKey(),h);h=$ret.value;return $ret.ret}()){h.isExpanded(true)}else{if(!$self.q.containsKey(f.parentKey())){$self.q.add(f.parentKey(),null)}}}e=g.m(a,b,d);$self.add(f.key(),g);if($self.positionItemDepthMin()==-1){$self.positionItemDepthMin(f.depth())}else{$self.positionItemDepthMin(Math.min($self.positionItemDepthMin(),f.depth()))}if($self.positionItemDepthMax()==Number.MAX_VALUE){$self.positionItemDepthMax(f.depth())}else{$self.positionItemDepthMax(Math.max($self.positionItemDepthMax(),f.depth()))}$self.ab(a,g)}else{var i=$self.item(f.key());e=i.m(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.s(a,a.length)},s:function(a,b){var $self=this;if($self.positionItemIndex()==b-1){return $self.positionIndex()}var c;if(!function(){var $ret=$self.tryGetValue(a[$self.positionItemIndex()+1],c);c=$ret.value;return $ret.ret}()){return-1}if(c.count()==0){return c.positionIndex()}return c.s(a,b)},$type:new $.ig.Type("PositionItemInfo$2",$.ig.Dictionary$2.prototype.$type.specialize(0,1))},true);$.ig.util.defType("PositionResolver$2","Object",{$tKey:null,$tSortKey:null,k:0,b:null,t:null,u:null,init:function($tKey,$tSortKey,a,b){this.k=0;this.$tKey=$tKey;this.$tSortKey=$tSortKey;this.$type=this.$type.specialize(this.$tKey,this.$tSortKey);$.ig.Object.prototype.init.call(this);this.positions(a.toList$1($.ig.IPosition$2.prototype.$type.specialize(this.$tKey,this.$tSortKey)));this.positionSize(b)},getPositionIndexCompleted:null,_positions:null,positions:function(value){if(arguments.length===1){this._positions=value;return value}else{return this._positions}},_positionSize:0,positionSize:function(value){if(arguments.length===1){this._positionSize=value;return value}else{return this._positionSize}},rootPositionInfo:function(){if(this.b==null){this.b=this.d(this.positionSize())}return this.b},d:function(a){return new $.ig.PositionItemInfo$2(this.$tKey,this.$tSortKey,null,-1,-1,a)},hasUnregisterdPositions:function(){return this.k<this.positions().count()},completeRegisterPositions:function(){if(this.hasUnregisterdPositions()){this.o(null)}},resolveParentPositionItem:function(a,b){b=-1;var c=$.ig.util.cast($.ig.IHierarchicalPositionItem$2.prototype.$type.specialize(this.$tKey,this.$tSortKey),a);if(c==null||c.parentKey()==null){return{ret:null,parentPositionIndex: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,parentPositionIndex:b}}var g=this.positions().__inner[b];var h=g.item(d);return{ret:h,parentPositionIndex:b};return{parentPositionIndex:b}},getHostPositionItemInfo:function(a,b){var $self=this;var c=$self.rootPositionInfo();var d=a.item(b);for(var e=0;e<b;e++){var f;if(function(){var $ret=c.tryGetValue(a.item(e).key(),f);f=$ret.value;return $ret.ret}()){c=f}else{c=null;break}}if(c==null){return null}if(!c.containsKey(d.key())){return null}return c},h:function(a,b){var $self=this;if($self.rootPositionInfo().count()==0){return null}var c=$self.rootPositionInfo();var d=a.position().indexOf(a);for(var e=0;e<d;e++){var f;if(function(){var $ret=c.tryGetValue(a.position().item(e).key(),f);f=$ret.value;return $ret.ret}()){c=f}else{c=null;break}}if(c==null){return null}if(!c.containsKey(a.key())){return null}var g=new $.ig.List$1($.ig.Number.prototype.$type,0);$self.s(a.key(),c,g);if(b==$.ig.ListSortDirection.prototype.descending){g.sort1(function(h,i){if(h==i){return 0}if(h>i){return-1}return 1});return g}g.sort1(function(h,i){if(h==i){return 0}if(h>i){return 1}return-1});return g},s:function(a,b,c){var $self=this;var e=b.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize($self.$tKey,$self.$tSortKey),function(f){return a.equals(f.parentKey())}).getEnumerator();while(e.moveNext()){var d=e.current();if(d.count()==0){c.add(d.positionIndex())}else{$self.r(d,c)}if(!d.isExpanded()){continue}if(d.positionItemDepth()<b.positionItemDepthMax()){$self.s(d.key(),b,c)}}},r:function(a,b){var $self=this;var d=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize($self.$tKey,$self.$tSortKey),function(e){return e.parentKey()==null}).getEnumerator();while(d.moveNext()){var c=d.current();if(c.count()==0){b.add(c.positionIndex())}else{$self.r(c,b)}if(!c.isExpanded()){continue}if(c.positionItemDepth()<a.positionItemDepthMax()){$self.s(c.key(),a,b)}}},getChildren:function(a,b){var $self=this;if($self.hasUnregisterdPositions()){$self.completeRegisterPositions()}var c=$self.getHostPositionItemInfo(a,b);var d=a.item(b);return c.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize($self.$tKey,$self.$tSortKey),function(e){return d.key().equals(e.parentKey())})},isMemberExpanded:function(a){var $self=this;if($self.hasUnregisterdPositions()){$self.completeRegisterPositions()}var b=$self.getPositionIndex(a.position());if(b==-1||$self.rootPositionInfo().count()==0){return $.ig.util.toNullable(Boolean,null)}var c=a.position().indexOf(a);var d=$self.rootPositionInfo();for(var e=0;e<c;e++){var f;if(function(){var $ret=d.tryGetValue(a.position().item(e).key(),f);f=$ret.value;return $ret.ret}()){d=f}else{d=null;break}}if(d==null){return $.ig.util.toNullable(Boolean,null)}if(!d.containsKey(a.key())){return $.ig.util.toNullable(Boolean,null)}var g=null;var h=d.values().getEnumerator();while(h.moveNext()){if(a.key().equals(h.current().parentKey())){g=h.current();break}}return $.ig.util.toNullable(Boolean,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.k>0){var b=this.m(a);if(b>-1){return b}if(this.k==this.positions().count()){return-1}}return this.o(a)},m:function(a){if(a.isEmpty()&&this.positions().count()==1&&this.positions().__inner[0].isEmpty()){return 0}return this.rootPositionInfo().getIndex2(a.getItems().toList$1($.ig.IPositionItem$2.prototype.$type.specialize(this.$tKey,this.$tSortKey)))},o:function(a){var b=a==null;var c=-1;for(var d=this.k;d<this.positions().count();d++){var e=this.positions().__inner[d];var f=this.rootPositionInfo().m(e,d,a);this.k++;if(c==-1&&f){c=d;if(!b){break}}}return c},$type:new $.ig.Type("PositionResolver$2",$.ig.Object.prototype.$type)},true);$.ig.util.defType("LevelSortDirection","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.sortBehavior($.ig.LevelSortBehavior.prototype.system)},_levelUniqueName:null,levelUniqueName:function(value){if(arguments.length===1){this._levelUniqueName=value;return value}else{return this._levelUniqueName}},_sortDirection:null,sortDirection:function(value){if(arguments.length===1){this._sortDirection=value;return value}else{return this._sortDirection}},_sortBehavior:null,sortBehavior:function(value){if(arguments.length===1){this._sortBehavior=value;return value}else{return this._sortBehavior}},$type:new $.ig.Type("LevelSortDirection",$.ig.Object.prototype.$type)},true);$.ig.util.defType("TaskExtensions","Object",{init:function(){$.ig.Object.prototype.init.call(this)},continueWithTask$1:function($tResult,a){var $self=this;var b=new $.ig.TaskCompletionSource$1($tResult,0);$self.e(function(c){if(c.a()==null){try{a(c).i(function(d){if(d.a()==null){b.e(d.m());return}b.d(d.a())})}catch(e_){var d;d=e_;b.d(d)}}else{b.d(c.a())}});return b.b()},continueWithTask$2:function($tResult1,$tResult2,a){var $self=this;return $self.continueWithTask$1($tResult2,function(b){return a(b)})},$type:new $.ig.Type("TaskExtensions",$.ig.Object.prototype.$type)},true);$.ig.util.defType("HierarchyFilterView","Object",{d:null,c:null,e:null,init:function(a){this.e=new $.ig.Dictionary$2(String,$.ig.FilterMember.prototype.$type,0);$.ig.Object.prototype.init.call(this);this.hierarchy(a);this.c=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.FilterMember.prototype.$type),0);this.d=new $.ig.Dictionary$2(String,$.ig.FilterMember.prototype.$type,0)},filterMemberExpansionChanged:null,filterMemberSelectionChanged:null,_hierarchy:null,hierarchy:function(value){if(arguments.length===1){this._hierarchy=value;return value}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(!$self.d.containsKey(a.uniqueName())){var b=new $.ig.FilterMember(a);b.propertyChanged=$.ig.Delegate.prototype.combine(b.propertyChanged,$self.o.runOn($self));b.selectionChanged=$.ig.Delegate.prototype.combine(b.selectionChanged,$self.p.runOn($self));var c;if(!function(){var $ret=$self.c.tryGetValue(a.levelDepth(),c);c=$ret.value;return $ret.ret}()){c=new $.ig.List$1($.ig.FilterMember.prototype.$type,0);$self.c.add(a.levelDepth(),c)}$self.d.add(a.uniqueName(),b);$self.e.add(a.uniqueName(),b);c.add(b);$self.j(b);$self.m(b)}},tryGetFilterMember:function(a,b){var $self=this;return{ret:function(){var $ret=$self.d.tryGetValue(a,b);b=$ret.value;return $ret.ret}(),filterMember:b};return{filterMember:b}},getRootFilterMembers:function(){var a=-1;var c=this.c.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.c.item(a)},getSelectedFilterItems:function(){var a=this.getRootFilterMembers();var b=new $.ig.List$1($.ig.FilterMember.prototype.$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 $.ig.FilterMemberStateChangedEventArgs(a))}},o:function(a,b){if(b.propertyName()=="IsExpanded"){if(this.filterMemberExpansionChanged!=null){this.filterMemberExpansionChanged(this,new $.ig.FilterMemberStateChangedEventArgs(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 $ret=$self.d.tryGetValue(b,c);c=$ret.value;return $ret.ret}()){c.n(a);if(c.isSelected().hasValue()==true&&c.isSelected().value()==false){a.isSelected($.ig.util.toNullable($.ig.Boolean.prototype.$type,false))}}},j:function(a){var $self=this;var b=a.member().levelDepth();var c;if(function(){var $ret=$self.c.tryGetValue(b+1,c);c=$ret.value;return $ret.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.Object.prototype.$type)},true);$.ig.util.defType("FilterMember","Object",{l:$.ig.util.toNullable($.ig.Boolean.prototype.$type,null),c:false,e:false,d:false,init:function(a){this.e=false;this.d=false;$.ig.Object.prototype.init.call(this);var b=$.ig.util.toNullable($.ig.Boolean.prototype.$type,true);this.l=b;this.member(a);this.k(0);this.j(0)},selectionChanged:null,propertyChanged:null,_parent:null,parent:function(value){if(arguments.length===1){this._parent=value;return value}else{return this._parent}},_member:null,member:function(value){if(arguments.length===1){this._member=value;return value}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=$.ig.util.toNullable($.ig.Boolean.prototype.$type,null);if($.ig.util.nullableEquals(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($.ig.util.toNullable($.ig.Boolean.prototype.$type,true))}else if(g==i){this.parent().isSelected($.ig.util.toNullable($.ig.Boolean.prototype.$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,$.ig.EventArgs.prototype.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(value){if(arguments.length===1){this._children=value;return value}else{return this._children}},n:function(a){if(this.children()==null){this.children(new $.ig.List$1($.ig.FilterMember.prototype.$type,0))}a.parent(this);this.children().add(a);this.o("Children")},_k:0,k:function(value){if(arguments.length===1){this._k=value;return value}else{return this._k}},_j:0,j:function(value){if(arguments.length===1){this._j=value;return value}else{return this._j}},o:function(a){if(this.propertyChanged!=null){this.propertyChanged(this,new $.ig.PropertyChangedEventArgs(a))}},$type:new $.ig.Type("FilterMember",$.ig.Object.prototype.$type,[$.ig.INotifyPropertyChanged.prototype.$type])},true);$.ig.util.defType("FilterMemberStateChangedEventArgs","EventArgs",{init:function(a){$.ig.EventArgs.prototype.init.call(this);this.filterMember(a)},_filterMember:null,filterMember:function(value){if(arguments.length===1){this._filterMember=value;return value}else{return this._filterMember}},$type:new $.ig.Type("FilterMemberStateChangedEventArgs",$.ig.EventArgs.prototype.$type)},true);$.ig.util.defType("ResultSorter$1","Object",{$t:null,_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},_d:false,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},_c:false,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},init:function($t,a,b,c){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.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 $.ig.List$1($.ig.OlapResultTuple.prototype.$type,1,e)},$type:new $.ig.Type("ResultSorter$1",$.ig.Object.prototype.$type)},true);$.ig.util.defType("ResultHeaderSorter","ResultSorter$1",{f:null,_h:null,h:function(value){if(arguments.length===1){this._h=value;return value}else{return this._h}},_g:null,g:function(value){if(arguments.length===1){this._g=value;return value}else{return this._g}},init:function(a,b,c,d){$.ig.ResultSorter$1.prototype.init.call(this,$.ig.AxisHeaderSortingVisitor.prototype.$type,a,b,c);this.f=new $.ig.Dictionary$2(String,$.ig.LevelSortDirection.prototype.$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;$self.h(new $.ig.List$1($.ig.LevelSortDirection.prototype.$type,0));$self.g(new $.ig.Dictionary$2(String,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type)),0));if($self.a().isEmpty()){return $self.a()}var a=new $.ig.List$1($.ig.OlapResultAxis.prototype.$type,0);var b=0;var c=1;var d=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);var e=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);if($self.c()){var f=$self.a().axes().item(b);var g=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type),0);var h=new $.ig.AxisHeaderSortingVisitor(f,$self.f,$self.h(),g);var i=$self.e(h,f,d);var j=function(){var $ret=new $.ig.OlapResultAxis(i,f.tupleSize());$ret.name(f.name());return $ret}();a.add(j);$self.g().item(f.name(),g);c=f.tuples().count();b++}if($self.d()){var k=$self.a().axes().item(b);var l=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type),0);var m=new $.ig.AxisHeaderSortingVisitor(k,$self.f,$self.h(),l);var n=$self.e(m,k,e);var o=function(){var $ret=new $.ig.OlapResultAxis(n,k.tupleSize());
$ret.name(k.name());return $ret}();a.add(o);$self.g().item(k.name(),l)}var p=new $.ig.List$1($.ig.OlapResultCell.prototype.$type,2,$self.a().cells().count());var r=$self.a().cells().getEnumerator();while(r.moveNext()){var q=r.current();var s=q.clone();var t=s.cellOrdinal();if($self.c()){var u=t%c;var v=d.item(u);if(u!=v){var w=$.ig.intDivide(t,c);t=w*c+v}}if($self.d()){var x=$.ig.intDivide(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 $.ig.OlapResult;$ret.isEmpty($self.a().isEmpty());$ret.axes(a);$ret.cells(p);return $ret}();return aa},$type:new $.ig.Type("ResultHeaderSorter",$.ig.ResultSorter$1.prototype.$type.specialize($.ig.AxisHeaderSortingVisitor.prototype.$type))},true);$.ig.util.defType("AxisTupleVisitor","Object",{_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},_d:null,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},init:function(a){$.ig.Object.prototype.init.call(this);this.a(a)},e:function(){var $self=this;if($self.a().positionResolver().hasUnregisterdPositions()){$self.a().positionResolver().completeRegisterPositions()}$self.d(new $.ig.List$1($.ig.Number.prototype.$type,2,$self.a().tuples().count()));var a=$self.a().positionResolver().rootPositionInfo();var b=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(c){return c.positionItemDepth()==a.positionItemDepthMin()});var d=$self.c(a,b).getEnumerator();while(d.moveNext()){var c=d.current();$self.f(a,c)}},b:function(a,b){},c:function(a,b){},f:function(a,b){var $self=this;var c=b.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(d){return d.positionItemDepth()==b.positionItemDepthMin()});if(c.count$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type))>0){var e=c.getEnumerator();while(e.moveNext()){var d=e.current();$self.f(b,d)}}else{$self.d().add(b.positionIndex())}var f=$self.b(a,b);var h=f.getEnumerator();while(h.moveNext()){var g=h.current();$self.f(a,g)}},$type:new $.ig.Type("AxisTupleVisitor",$.ig.Object.prototype.$type)},true);$.ig.util.defType("AxisHeaderSortingVisitor","AxisTupleVisitor",{h:null,i:null,g:null,init:function(a,b,c,d){$.ig.AxisTupleVisitor.prototype.init.call(this,a);this.h=b;this.i=c;this.g=d},b:function(a,b){var $self=this;var c=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(d){return d.parentKey()==b.key()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type));if(c.count()>0){var d=c.item(0);var e;if(function(){var $ret=$self.h.tryGetValue(d.hierarchyLevelKey(),e);e=$ret.value;return $ret.ret}()){if(e.sortBehavior()==$.ig.LevelSortBehavior.prototype.system){c=e.sortDirection()==$.ig.ListSortDirection.prototype.ascending?c.orderBy$2($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),$.ig.Object.prototype.$type,function(f){return f.sortKey()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type)):c.orderByDescending$2($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),$.ig.Object.prototype.$type,function(f){return f.sortKey()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type))}else{c=e.sortDirection()==$.ig.ListSortDirection.prototype.ascending?c.orderBy$2($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),String,function(f){return f.caption()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type)):c.orderByDescending$2($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),String,function(f){return f.caption()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type))}if(!$self.i.select$2($.ig.LevelSortDirection.prototype.$type,String,function(f){return f.levelUniqueName()}).contains$1(String,e.levelUniqueName())){$self.i.add(e)}var f;if(!function(){var $ret=$self.g.tryGetValue(d.positionItemIndex(),f);f=$ret.value;return $ret.ret}()){f=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type,0);$self.g.add(b.positionItemIndex(),f)}f.item(b.positionItemDepth(),e.sortDirection())}}return c},c:function(a,b){var $self=this;var c=b.toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type));if(c.count()>0){var d=c.item(0);var e;if(d.hierarchyLevelKey()!=null&&function(){var $ret=$self.h.tryGetValue(d.hierarchyLevelKey(),e);e=$ret.value;return $ret.ret}()){if(e.sortBehavior()==$.ig.LevelSortBehavior.prototype.system){c=e.sortDirection()==$.ig.ListSortDirection.prototype.ascending?c.orderBy$2($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),$.ig.Object.prototype.$type,function(f){return f.sortKey()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type)):c.orderByDescending$2($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),$.ig.Object.prototype.$type,function(f){return f.sortKey()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type))}else{c=e.sortDirection()==$.ig.ListSortDirection.prototype.ascending?c.orderBy$2($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),String,function(f){return f.caption()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type)):c.orderByDescending$2($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),String,function(f){return f.caption()}).toList$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type))}$self.i.add(e);var f;if(!function(){var $ret=$self.g.tryGetValue(d.positionItemIndex(),f);f=$ret.value;return $ret.ret}()){f=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type,0);$self.g.add(a.positionItemIndex(),f)}f.item(a.positionItemDepth(),e.sortDirection())}}return c},$type:new $.ig.Type("AxisHeaderSortingVisitor",$.ig.AxisTupleVisitor.prototype.$type)},true);$.ig.util.defType("ResultColumnValueSorter","ResultSorter$1",{f:null,_g:null,g:function(value){if(arguments.length===1){this._g=value;return value}else{return this._g}},init:function(a,b,c,d){$.ig.ResultSorter$1.prototype.init.call(this,$.ig.AxisValueSortingVisitor.prototype.$type,a,b,c);this.f=d},b:function(){var $self=this;$self.g(new $.ig.List$1($.ig.TupleSortDirection.prototype.$type,0));if(!$self.d()||$self.a().isEmpty()){return $self.a()}var a=new $.ig.List$1($.ig.OlapResultAxis.prototype.$type,0);var b=0;var c=null;var d=1;if($self.c()){c=$self.a().axes().item(b);d=c.tuples().count();a.add(c.clone());b++}var e=$self.a().axes().item(b);var f=$self.a().axes().item(b).tuples().count();var g=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Object.prototype.$type,1,$self.a().cells().count());var i=$self.a().cells().getEnumerator();while(i.moveNext()){var h=i.current();var j=null;if(function(){var $ret=h.properties().tryGetValue("Value",j);j=$ret.value;return $ret.ret}()){g.item(h.cellOrdinal(),j)}else{(function(){var $ret=h.properties().tryGetValue("FmtValue",j);j=$ret.value;return $ret.ret})();g.item(h.cellOrdinal(),j)}}var k=new $.ig.List$1($.ig.KeyValuePair$2.prototype.$type.specialize($.ig.TupleSortDirection.prototype.$type,$.ig.Array.prototype.$type),2,$self.f.count());var m=$self.f.getEnumerator();while(m.moveNext()){var l=m.current();var n;if(c!=null&&l.memberNames()!=null){if(c.positionResolver().hasUnregisterdPositions()){c.positionResolver().completeRegisterPositions()}n=c.positionResolver().rootPositionInfo().getIndex(l.memberNames());l.tupleIndex(n)}else{n=l.tupleIndex()}if(n>-1&&n<d){var o=new Array(f);for(var p=0;p<f;p++){var q=null;(function(){var $ret=g.tryGetValue(p*d+n,q);q=$ret.value;return $ret.ret})();o[p]=q}k.add(new $.ig.KeyValuePair$2($.ig.TupleSortDirection.prototype.$type,$.ig.Array.prototype.$type,1,l,o));$self.g().add(l)}}var r=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);var s=new $.ig.AxisValueSortingVisitor(e,k);var t=$self.e(s,e,r);var u=function(){var $ret=new $.ig.OlapResultAxis(t,e.tupleSize());$ret.name(e.name());return $ret}();a.add(u);var v=new $.ig.List$1($.ig.OlapResultCell.prototype.$type,2,$self.a().cells().count());var x=$self.a().cells().getEnumerator();while(x.moveNext()){var w=x.current();var y=w.clone();var z=y.cellOrdinal();var aa=$.ig.intDivide(z,d);var ab=r.item(aa);if(aa!=ab){var ac=z%d;z=ab*d+ac}y.cellOrdinal(z);v.add(y)}var ad=function(){var $ret=new $.ig.OlapResult;$ret.isEmpty($self.a().isEmpty());$ret.axes(a);$ret.cells(v);return $ret}();return ad},$type:new $.ig.Type("ResultColumnValueSorter",$.ig.ResultSorter$1.prototype.$type.specialize($.ig.AxisValueSortingVisitor.prototype.$type))},true);$.ig.util.defType("AxisValueSortingVisitor","AxisTupleVisitor",{g:null,init:function(a,b){$.ig.AxisTupleVisitor.prototype.init.call(this,a);this.g=b},b:function(a,b){var $self=this;var c=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(d){return d.parentKey()==b.key()});return $self.c(a,c)},c:function(a,b){var positionItemInfos_=b.toArray$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type));if(positionItemInfos_.length>0){var tupleSortDirections_=this.g.toArray$1($.ig.KeyValuePair$2.prototype.$type.specialize($.ig.TupleSortDirection.prototype.$type,$.ig.Array.prototype.$type));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",$.ig.AxisTupleVisitor.prototype.$type)},true);$.ig.util.defType("TupleSortDirection","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_tupleIndex:0,tupleIndex:function(value){if(arguments.length===1){this._tupleIndex=value;return value}else{return this._tupleIndex}},_memberNames:null,memberNames:function(value){if(arguments.length===1){this._memberNames=value;return value}else{return this._memberNames}},_sortDirection:null,sortDirection:function(value){if(arguments.length===1){this._sortDirection=value;return value}else{return this._sortDirection}},_comparer:null,comparer:function(value){if(arguments.length===1){this._comparer=value;return value}else{return this._comparer}},$type:new $.ig.Type("TupleSortDirection",$.ig.Object.prototype.$type)},true);$.ig.util.defType("DataSourceBase","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_dataSource:null,dataSource:function(value){if(arguments.length===1){this._dataSource=value;return value}else{return this._dataSource}},isInitialized:function(){return this.dataSource().isInitialized()},_isModified:false,isModified:function(value){if(arguments.length===1){this._isModified=value;return value}else{return this._isModified}},_isUpdating:false,isUpdating:function(value){if(arguments.length===1){this._isUpdating=value;return value}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){var $self=this;return $self.dataSource().setCube(a).j($.ig.OlapMetadataTreeItem.prototype.$type,function(b){return b.m()}).c()},metadataTree:function(){return this.dataSource().metadataTree()},addRowItem:function(a){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,a)!==null){this.dataSource().rowAxis().add(a);this.isModified(true)}},insertRowItem:function(a,b){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,b)!==null){this.dataSource().rowAxis().insert(a,b);this.isModified(true)}},removeRowItem:function(a){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,a)!==null||$.ig.util.cast($.ig.MeasureList.prototype.$type,a)!==null){this.dataSource().rowAxis().remove(a);this.isModified(true)}},addColumnItem:function(a){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,a)!==null){this.dataSource().columnAxis().add(a);this.isModified(true)}},insertColumnItem:function(a,b){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,b)!==null){this.dataSource().columnAxis().insert(a,b);this.isModified(true)}},removeColumnItem:function(a){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,a)!==null||$.ig.util.cast($.ig.MeasureList.prototype.$type,a)!==null){this.dataSource().columnAxis().remove(a);this.isModified(true)}},addFilterItem:function(a){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,a)!==null){this.dataSource().filters().add(a);this.isModified(true)}},insertFilterItem:function(a,b){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,b)!==null){this.dataSource().filters().insert(a,b);this.isModified(true)}},removeFilterItem:function(a){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,a)!==null){this.dataSource().filters().remove(a);this.isModified(true)}},addMeasureItem:function(a){if($.ig.util.cast($.ig.Measure.prototype.$type,a)!==null){this.dataSource().measures().add(a);this.isModified(true)}},insertMeasureItem:function(a,b){if($.ig.util.cast($.ig.Measure.prototype.$type,b)!==null){this.dataSource().measures().insert(a,b);this.isModified(true)}},removeMeasureItem:function(a){if($.ig.util.cast($.ig.Measure.prototype.$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($.ig.MeasureListLocation.prototype.rows);break;case"columns":this.dataSource().measureListLocation($.ig.MeasureListLocation.prototype.columns);break;default:break}this.isModified(true)},getMeasureListLocation:function(){switch(this.dataSource().measureListLocation()){case $.ig.MeasureListLocation.prototype.rows:return"rows";break;case $.ig.MeasureListLocation.prototype.columns: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 $ret=$self.dataSource().tryGetMember(a,b);b=$ret.member;return $ret.ret}()){return b}return null},tryGetMembersForLevel:function(a){var $self=this;var b=new $.ig.ArrayListCollection$1($.ig.Member.prototype.$type);var c=function(){var $ret=$self.dataSource().tryGetMembersForLevel(a,b);b=$ret.members;return $ret.ret}();return c?b.inner():new $.ig.ArrayListCollection$1($.ig.Member.prototype.$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){var $self=this;return $self.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$.ig.Dimension.prototype.$type)},getHierarchy:function(a){var $self=this;return $self.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$.ig.Hierarchy.prototype.$type)},getLevel:function(a){var $self=this;return $self.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$.ig.Level.prototype.$type)},getMeasure:function(a){var $self=this;return $self.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$.ig.Measure.prototype.$type)},getMeasureList:function(){return this.dataSource().getCoreElement(null,$.ig.MeasureList.prototype.$type)},$type:new $.ig.Type("DataSourceBase",$.ig.Object.prototype.$type)},true);$.ig.util.defType("jQueryUtils","Object",{init:function(){$.ig.Object.prototype.init.call(this)},c:function($t,a){if(a==null){return null}var jsObject_=a;var dict_=new $.ig.Dictionary$2(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 dict_=a;return dict_.__inner.proxy},convertToObjectDictionary:function(a){return $.ig.jQueryUtils.prototype.c($.ig.Object.prototype.$type,a)},convertToStringDictionary:function(a){return $.ig.jQueryUtils.prototype.c(String,a)},convertFromObjectDictionary:function(a){return $.ig.jQueryUtils.prototype.i($.ig.Object.prototype.$type,a)},convertFromStringDictionary:function(a){return $.ig.jQueryUtils.prototype.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){c=Array.prototype.slice.call(arguments,2);var jsObject_=a;var method_=b;var args_=c;return jsObject_[method_].call(jsObject_,args_)},$type:new $.ig.Type("jQueryUtils",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapUtilities","Object",{init:function(){$.ig.Object.prototype.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_=$.ig.OlapUtilities.prototype.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_=$.ig.OlapUtilities.prototype.dateMemberProvider("year",b,null,null);semesterProvider_=$.ig.OlapUtilities.prototype.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_=$.ig.OlapUtilities.prototype.dateMemberProvider("year",b,null,null);semesterProvider_=$.ig.OlapUtilities.prototype.dateMemberProvider("semester",b,null,null);quarterProvider_=$.ig.OlapUtilities.prototype.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_=$.ig.OlapUtilities.prototype.dateMemberProvider("year",b,null,null);semesterProvider_=$.ig.OlapUtilities.prototype.dateMemberProvider("semester",b,null,null);quarterProvider_=$.ig.OlapUtilities.prototype.dateMemberProvider("quarter",b,null,null);monthProvider_=$.ig.OlapUtilities.prototype.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){var $self=this;if(String.isNullOrEmpty(a)){return null}if(b==null||b.length==0){b=function(){var $ret=new Array;$ret.add("year");$ret.add("quarter");$ret.add("month");$ret.add("date");return $ret}()}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]=$.ig.OlapUtilities.prototype.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.Object.prototype.$type)},true);$.ig.util.defType("OlapTableView","Object",{a:null,init:function(a,b,c,d){$.ig.Object.prototype.init.call(this);var e=this.b(d);this.a=new $.ig.TableViewImpl(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_=$.ig.jQueryUtils.prototype.createJavascriptObject();var a=this.a.appliedSortDirectionsMap().getEnumerator();while(a.moveNext()){var i_=a.current();var axisMap_=$.ig.jQueryUtils.prototype.createJavascriptObject();var b=i_.value().getEnumerator();while(b.moveNext()){var j_=b.current();var hierarchyMap_=$.ig.jQueryUtils.prototype.createJavascriptObject();var c=j_.value().getEnumerator();while(c.moveNext()){var k_=c.current();var sortDirection_=k_.value()==$.ig.ListSortDirection.prototype.ascending?"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 $self=this;var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"isParentInFrontForColumns");var c=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"isParentInFrontForRows");var d=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"compactColumnHeaders");var e=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"compactRowHeaders");return function(){var $ret=new $.ig.TableViewSettings;$ret.c(b);$ret.d(c);$ret.a(d);$ret.b(e);return $ret}()},d:function(o_){var $self=this;var a=$.ig.util.cast($.ig.Array.prototype.$type,$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(o_,"memberNames"));var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(o_,"tupleIndex");var c=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(o_,"sortDirection");var d=$.ig.ListSortDirection.prototype.ascending;if(!String.isNullOrEmpty(c)){c=c.toLowerCase();if(c=="descending"){d=$.ig.ListSortDirection.prototype.descending}}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 $.ig.TupleSortDirection;$ret.memberNames(a);$ret.tupleIndex(b);$ret.sortDirection(d);$ret.comparer(comparer_);return $ret}()},n:function(a){var b=$.ig.jQueryUtils.prototype.createJavascriptObject();$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(b,"memberNames",a.memberNames());$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(b,"tupleIndex",a.tupleIndex());$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(b,"sortDirection",a.sortDirection()==$.ig.ListSortDirection.prototype.ascending?"ascending":"descending");if(a.comparer()!=null){$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(b,"comparer",a.comparer())}return b},c:function(a){var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"levelUniqueName");var c=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"sortDirection");var d=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"sortBehavior");if(!String.isNullOrEmpty(b)){var e=new $.ig.LevelSortDirection;e.sortDirection($.ig.ListSortDirection.prototype.ascending);e.sortBehavior($.ig.LevelSortBehavior.prototype.system);e.levelUniqueName(b);if(!String.isNullOrEmpty(c)){c=c.toLowerCase();if(c=="descending"){e.sortDirection($.ig.ListSortDirection.prototype.descending)}}if(!String.isNullOrEmpty(d)){d=d.toLowerCase();if(d=="alphabetical"){e.sortBehavior($.ig.LevelSortBehavior.prototype.alphabetical)}}return e}else{return null}},m:function(a){var b=$.ig.jQueryUtils.prototype.createJavascriptObject();$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(b,"levelUniqueName",a.levelUniqueName());$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(b,"sortDirection",a.sortDirection()==$.ig.ListSortDirection.prototype.ascending?"ascending":"descending");return b},$type:new $.ig.Type("OlapTableView",$.ig.Object.prototype.$type)},true);$.ig.LevelSortBehavior.prototype.alphabetical=0;$.ig.LevelSortBehavior.prototype.system=1;$.ig.OlapMetadataTreeItemType.prototype.cube=0;$.ig.OlapMetadataTreeItemType.prototype.dimension=1;
$.ig.OlapMetadataTreeItemType.prototype.group=2;$.ig.OlapMetadataTreeItemType.prototype.userDefinedHierarchy=3;$.ig.OlapMetadataTreeItemType.prototype.systemEnabledHierarchy=4;$.ig.OlapMetadataTreeItemType.prototype.parentChildHierarchy=5;$.ig.OlapMetadataTreeItemType.prototype.measure=6;$.ig.OlapMetadataTreeItemType.prototype.level1=7;$.ig.OlapMetadataTreeItemType.prototype.level2=8;$.ig.OlapMetadataTreeItemType.prototype.level3=9;$.ig.OlapMetadataTreeItemType.prototype.level4=10;$.ig.OlapMetadataTreeItemType.prototype.level5=11;$.ig.OlapMetadataTreeItemType.prototype.kpiRoot=12;$.ig.OlapMetadataTreeItemType.prototype.kpi=13;$.ig.OlapMetadataTreeItemType.prototype.kpiValue=14;$.ig.OlapMetadataTreeItemType.prototype.kpiGoal=15;$.ig.OlapMetadataTreeItemType.prototype.kpiStatus=16;$.ig.OlapMetadataTreeItemType.prototype.kpiTrend=17;$.ig.OlapMetadataTreeItemType.prototype.kpiWeight=18;$.ig.MeasureListLocation.prototype.rows=0;$.ig.MeasureListLocation.prototype.columns=1;$.ig.HeaderCellsLayoutOrientation.prototype.horizontal=0;$.ig.HeaderCellsLayoutOrientation.prototype.vertical=1;$.ig.MemberType.prototype.unknown=0;$.ig.MemberType.prototype.regular=1;$.ig.MemberType.prototype.all=2;$.ig.MemberType.prototype.measure=3;$.ig.MemberType.prototype.formula=4;$.ig.CardinalityType.prototype.one=0;$.ig.CardinalityType.prototype.many=1;$.ig.AggregatorType.prototype.unknown=0;$.ig.AggregatorType.prototype.sum=1;$.ig.AggregatorType.prototype.count=2;$.ig.AggregatorType.prototype.min=3;$.ig.AggregatorType.prototype.max=4;$.ig.AggregatorType.prototype.average=5;$.ig.AggregatorType.prototype.variance=6;$.ig.AggregatorType.prototype.std=7;$.ig.AggregatorType.prototype.distinctCount=8;$.ig.AggregatorType.prototype.none=9;$.ig.AggregatorType.prototype.averageOfChildren=10;$.ig.AggregatorType.prototype.firstNonEmpty=13;$.ig.AggregatorType.prototype.lastNonEmpty=14;$.ig.AggregatorType.prototype.byAccount=15;$.ig.AggregatorType.prototype.calculated=127;$.ig.HierarchyOrigin.prototype.userDefined=1;$.ig.HierarchyOrigin.prototype.systemEnabled=2;$.ig.HierarchyOrigin.prototype.systemInternal=4;$.ig.DimensionType.prototype.unknown=0;$.ig.DimensionType.prototype.time=1;$.ig.DimensionType.prototype.measure=2;$.ig.DimensionType.prototype.other=3;$.ig.DimensionType.prototype.quantitative=5;$.ig.DimensionType.prototype.accounts=6;$.ig.DimensionType.prototype.customers=7;$.ig.DimensionType.prototype.products=8;$.ig.DimensionType.prototype.scenario=9;$.ig.DimensionType.prototype.utility=10;$.ig.DimensionType.prototype.currency=11;$.ig.DimensionType.prototype.rates=12;$.ig.DimensionType.prototype.channel=13;$.ig.DimensionType.prototype.promotion=14;$.ig.DimensionType.prototype.organization=15;$.ig.DimensionType.prototype.billOfMaterials=16;$.ig.DimensionType.prototype.geography=17;$.ig.CubeType.prototype.cube=0;$.ig.CubeType.prototype.dimension=1;$.ig.CubeType.prototype.unknown=2;$.ig.AxisDefinitionParser.prototype.e="[";$.ig.AxisDefinitionParser.prototype.f="]";$.ig.AxisDefinitionParser.prototype.i="{";$.ig.AxisDefinitionParser.prototype.j="}";$.ig.AxisDefinitionParser.prototype.h=",";$.ig.CoreOlapElementParser.prototype.d="[";$.ig.CoreOlapElementParser.prototype.e="]";$.ig.CoreOlapElementParser.prototype.g=".";$.ig.CoreOlapElementParser.prototype.i="&";$.ig.util.extCopy($.ig.TaskExtensions,[[[$.ig.Task,$.ig.Task$1],["continueWithTask$1","continueWithTask$2"]]]);$.ig.util.extCopy($.ig.Queryable,[[[$.ig.SortedList$1,$.ig.IGrouping$2,$.ig.ArrayListCollection$1],["asQueryable"]]]);$.ig.util.extCopy($.ig.Enumerable,[[[$.ig.SortedList$1,$.ig.IGrouping$2,$.ig.ArrayListCollection$1],["where$1","where$11","select$2","selectMany$2","last$1","first$1","firstOrDefault$1","orderBy$2","orderByDescending$2","toList$1","concat$1","max","max$1","min","min$1","count$1","reverse$1","take$1","skip$1","any$1","contains$1","union$1","toArray$1","elementAt$1","sum","sum$1"]],[[$.ig.SortedList$1,$.ig.IGrouping$2,$.ig.ArrayListCollection$1],["ofType$1","cast$1"]]])})(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","String:h","IComparable:i","Number:j","Number:k","Single:l","Number:m","String:n","Array:o","RegExp:p","RuntimeTypeHandle:q","MethodInfo:r","MethodBase:s","MemberInfo:t","ParameterInfo:u","TypeCode:v","Enum:w","ConstructorInfo:x","PositionResolver$2:y","List$1:z","IList$1:aa","ICollection$1:ab","IEnumerable$1:ac","IEnumerable:ad","IEnumerator:ae","IEnumerator$1:af","IArrayList:ag","Array:ah","ICollection:ai","CompareCallback:aj","MulticastDelegate:ak","IntPtr:al","IList:am","IDisposable:an","IArray:ao","Script:ap","Date:aq","Date:ar","Number:as","Func$3:at","Action$1:au","PositionItemInfo$2:av","Dictionary$2:aw","IDictionary$2:ax","IDictionary:ay","Dictionary:az","IEqualityComparer$1:a0","KeyValuePair$2:a1","NotImplementedException:a2","Error:a3","IHierarchicalPositionItem$2:a4","IPositionItem$2:a5","IPosition$2:a6","Math:a7","Number:a8","Number:a9","Number:ba","Number:bb","Number:bc","Number:bd","Number:be","Enumerable:bf","Func$2:bg","IOrderedEnumerable$1:bh","SortedList$1:bi","ArgumentNullException:bj","EventHandler$1:bk","Delegate:bl","ListSortDirection:bm","Nullable$1:bn","OlapResultTuple:bo","ReadOnlyCollection$1:bp","OlapResultAxisMember:bq","Task$1:br","Task:bs","JQueryPromise:bt","Action:bu","AggregateException:bv","TaskStatus:bw","TaskCompletionSource$1:bx","JQueryDeferred:by","JQuery:bz","JQueryObject:b0","Element:b1","ElementAttributeCollection:b2","ElementCollection:b3","WebStyle:b4","ElementNodeType:b5","Document:b6","EventListener:b7","IElementEventHandler:b8","ElementEventHandler:b9","ElementAttribute:ca","JQueryPosition:cb","JQueryCallback:cc","JQueryEvent:cd","JQueryUICallback:ce","FlatDataAxisProvider:cf","FlatDataProvider:cg","IFlatDataProvider:ch","IOlapDiscoverDataProvider:ci","TableMetadata:cj","RowMetadata:ck","DataSourceMetadata:cl","CubeMetadata:cm","MeasuresDimensionMetadata:cn","ArrayListCollection$1:co","INotifyCollectionChanged:cp","NotifyCollectionChangedEventHandler:cq","NotifyCollectionChangedEventArgs:cr","EventArgs:cs","NotifyCollectionChangedAction:ct","KeyValueItem:cu","Level:cv","ICoreOlapElement:cw","InvalidOperationException:cx","Hierarchy:cy","HierarchyOrigin:cz","Member:c0","MemberType:c1","TaskFactory:c2","OlapResult:c3","AxisElement:c4","DataMemberMetadata:c5","Measure:c6","AggregatorType:c7","CellMetadata:c8","OlapResultCell:c9","KeyListPair$1:da","Cube:db","CubeType:dc","MeasureMetadata:dd","Dimension:de","DimensionType:df","DimensionMetadata:dg","HierarchyMetadata:dh","LevelMetadata:di","FlatDataAxisProviderHelper:dj","CubeMetaItemsCache:dk","MeasureGroupMetaItemsCache:dl","MeasureGroupDimension:dm","CardinalityType:dn","Kpi:dp","Tuple$2:dq","KpiMeasure:dr","MeasureList:ds","FlatDataPartialAxisProvider:dt","FlatDataSourceImpl:du","OlapDataSource:dv","IOlapDataSource:dw","OlapMetadataTreeItem:dx","OlapMetadataTreeItemType:dy","MeasureListLocation:dz","MeasureGroup:d0","DataSourceBaseOptions:d1","IOlapDataProviderFactory:d2","OlapResultView:d3","NotSupportedException:d4","PositionInfo:d5","TaskExtensions:d6","AxisDefinitionParser:d7","Debug:d8","MetaTreeHelper:d9","HierarchyItemPosition:ea","KpiDimension:eb","FlatDataSourceOptions:ec","IFlatDataProviderFactory:ed","DefaultFlatDataProviderFactory:ee","ResultViewHelper:ef","CoreOlapElementParser:eg","ArgumentException:eh","OlapFlatDataSource:ei","DataSourceBase:ej","jQueryUtils:ek","AbstractEnumerable:em","Func$1:en","AbstractEnumerator:eo","GenericEnumerable$1:ep","GenericEnumerator$1:eq"]);$.ig.util.defType("IFlatDataAxisProvider","Object",{$type:new $.ig.Type("IFlatDataAxisProvider",null)},true);$.ig.util.defType("FlatDataAxisProvider","Object",{h:null,c:null,a:null,init:function(a,b,c){var $self=this;this.i=null;this.b=null;this.f=false;this.g=false;$.ig.Object.prototype.init.call(this);this.a=c;this.d(a);this.h=b.select$2($.ig.ICoreOlapElement.prototype.$type,$.ig.ICoreOlapElement.prototype.$type,function(d){return d}).toList$1($.ig.ICoreOlapElement.prototype.$type);this.c=new $.ig.FlatDataAxisProviderHelper(a,b.count(),c)},_d:null,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},_axis:null,axis:function(value){if(arguments.length===1){this._axis=value;return value}else{return this._axis}},e:function(){return this.c.c()},i:null,b:null,f:false,g:false,n:function(a){var $self=this;if($self.axis()!=null){$self.b=$self.axis();$self.i=a.select$2($.ig.ICoreOlapElement.prototype.$type,$.ig.ICoreOlapElement.prototype.$type,function(b){return b}).toList$1($.ig.ICoreOlapElement.prototype.$type);$self.f=true}else{$self.c=new $.ig.FlatDataAxisProviderHelper($self.d(),a.count(),$self.a);$self.h=a}},o:function(){if(this.axis()!=null){this.g=true}},j:function(a){var $self=this;$self.f=false;var b=$self.i;var c=$self.b;var d=new $.ig.TaskCompletionSource$1($.ig.OlapResultAxis.prototype.$type,0);var e=new $.ig.List$1(String,0);for(var f=0;f<$self.h.count();f++){var g=$self.h.item(f);if($.ig.util.cast($.ig.MeasureList.prototype.$type,g)!==null){e.add($self.d().d().a().b().c());continue}e.add(g.uniqueName())}$self.h=b;var h=new $.ig.List$1(String,0);var i=new $.ig.List$1($.ig.KeyValuePair$2.prototype.$type.specialize(String,$.ig.Number.prototype.$type),0);for(var j=0;j<$self.h.count();j++){var k=$self.h.item(j);if($.ig.util.cast($.ig.MeasureList.prototype.$type,k)!==null){h.add($self.d().d().a().b().c());continue}h.add(k.uniqueName());i.add(new $.ig.KeyValuePair$2(String,$.ig.Number.prototype.$type,1,k.uniqueName(),0))}var l=new $.ig.List$1($.ig.KeyValuePair$2.prototype.$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($self.h.count());var q=new $.ig.List$1($.ig.OlapResultTuple.prototype.$type,0);$self.c.l(l).i(function(r){return $self.p(m,b,p,r.m(),q,c.name(),d,true)});return d.b()}return $self.generateAxis(a)},generateAxis:function(a){var $self=this;if($self.g||$self.f){var b=null;if($self.g){b=$self.k(a)}if($self.f){b=$self.j(a)}return b}var c=new $.ig.TaskCompletionSource$1($.ig.OlapResultAxis.prototype.$type,0);if($self.axis()!=null){c.e($self.axis());return c.b()}var d=new Array($self.h.count());var e=new $.ig.List$1(String,0);var f=new $.ig.List$1($.ig.OlapResultTuple.prototype.$type,0);var g=new $.ig.List$1($.ig.KeyValuePair$2.prototype.$type.specialize(String,$.ig.Number.prototype.$type),0);var h=$self.h;for(var i=0;i<$self.h.count();i++){var j=$self.h.item(i);if($.ig.util.cast($.ig.MeasureList.prototype.$type,j)!==null){e.add($self.d().d().a().b().c());continue}e.add(j.uniqueName());g.add(new $.ig.KeyValuePair$2(String,$.ig.Number.prototype.$type,1,j.uniqueName(),0))}var k=new $.ig.List$1($.ig.KeyValuePair$2.prototype.$type.specialize(String,$.ig.Number.prototype.$type),0);var l=$self.d().e().d();k=g;$self.c.l(k).i(function(m){$self.c.n(h,0,d,m.m(),l,null,f);$self.axis(function(){var $ret=new $.ig.OlapResultAxis(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 $self=this;var i=$self.e();if(h){$self.c=new $.ig.FlatDataAxisProviderHelper($self.d(),b.count(),$self.a)}if(a>-1&&i.rootPositionInfo().count()>0){$self.c.o(b,a,i.rootPositionInfo(),c,d,e)}else{var j=$self.d().e().d().where$1($.ig.RowMetadata.prototype.$type,function(k){return!k.a()}).toList$1($.ig.RowMetadata.prototype.$type);$self.c.n(b,0,c,d,j,null,e)}$self.axis(function(){var $ret=new $.ig.OlapResultAxis(e,b.count());$ret.name(f);return $ret}());g.e($self.axis())},l:function(a){if(this.axis()==null){throw new $.ig.InvalidOperationException(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 $.ig.List$1($.ig.KeyValuePair$2.prototype.$type.specialize($.ig.OlapResultTuple.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.RowMetadata.prototype.$type)),0);var d=a.e().getEnumerator();while(d.moveNext()){var c=d.current();var e=a.getTupleRowsMetadata(c);b.add(new $.ig.KeyValuePair$2($.ig.OlapResultTuple.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.RowMetadata.prototype.$type),1,c,e))}this.l(b)},k:function(a){var $self=this;$self.g=false;var b=new $.ig.TaskCompletionSource$1($.ig.OlapResultAxis.prototype.$type,0);var c=new $.ig.List$1($.ig.KeyValuePair$2.prototype.$type.specialize($.ig.OlapResultTuple.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.RowMetadata.prototype.$type)),0);var d=new $.ig.List$1($.ig.OlapResultTuple.prototype.$type,0);for(var e=0;e<$self.c.c().positions().count();e++){var f=$self.c.c().positions().__inner[e];var g=$self.d().u(f.members().toArray$1($.ig.OlapResultAxisMember.prototype.$type),f.itemsCount()).where$1($.ig.RowMetadata.prototype.$type,function(h){return!h.a()}).toList$1($.ig.RowMetadata.prototype.$type);if(g.count()>0){d.add(f)}c.add(new $.ig.KeyValuePair$2($.ig.OlapResultTuple.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.RowMetadata.prototype.$type),1,f,g))}if(c.count()>0){$self.l(c)}var h=new Array($self.h.count());var i=new $.ig.List$1($.ig.KeyValuePair$2.prototype.$type.specialize(String,$.ig.Number.prototype.$type),0);for(var j=0;j<$self.h.count();j++){var k=$self.h.item(j);if($.ig.util.cast($.ig.MeasureList.prototype.$type,k)!==null){continue}i.add(new $.ig.KeyValuePair$2(String,$.ig.Number.prototype.$type,1,k.uniqueName(),0))}$self.c.l(i).i(function(l){return $self.p($self.h.count()-1,$self.h,h,l.m(),new $.ig.List$1($.ig.OlapResultTuple.prototype.$type,0),a,b,false)});return b.b()},getTupleRowsMetadata:function(a){return this.c.i(a)},$type:new $.ig.Type("FlatDataAxisProvider",$.ig.Object.prototype.$type,[$.ig.IFlatDataAxisProvider.prototype.$type])},true);$.ig.util.defType("FlatDataAxisProviderHelper","Object",{a:null,e:null,_h:null,h:function(value){if(arguments.length===1){this._h=value;return value}else{return this._h}},init:function(a,b,c){$.ig.Object.prototype.init.call(this);this.a=c;this.b(a);this.e=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.RowMetadata.prototype.$type),0);this.c(new $.ig.PositionResolver$2(String,$.ig.Object.prototype.$type,new $.ig.List$1($.ig.IPosition$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),0),b));this.h(this.c().positions())},_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},i:function(a){var $self=this;var b=null;var c=$self.c().getPositionIndex(a);if(c>-1){(function(){var $ret=$self.e.tryGetValue(c,b);b=$ret.value;return $ret.ret})()}return b},d:function(a,b){var c=this.c().getPositionIndex(a);if(c==-1){this.e.add(this.h().count(),b);this.h().add(a);return true}this.e.item(c,b);return false},o:function(a,b,c,d,e,f){var $self=this;var g=c.positionItemDepthMin();var i=c.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),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()}$self.m(c,h,d,a,b,e,f)}else{var j=h.positionItem();var k=j.clone();var l=new Array(a.count());$.ig.Array.prototype.copy(d,0,l,0,a.count());l[h.positionItemIndex()]=k;$self.o(a,b,h,l,e,f)}}},m:function(a,b,c,d,e,f,g){var $self=this;var h=b.positionItem();var i=h.clone();var j=new Array(d.count());$.ig.Array.prototype.copy(c,0,j,0,d.count());j[b.positionItemIndex()]=i;var k=$self.b().u(j,b.positionItemIndex()+1).toList$1($.ig.RowMetadata.prototype.$type);if(k.count()>0){if(e<d.count()-1){$self.n(d,e+1,j,f,k,null,g)}else{var l=new $.ig.OlapResultTuple(j);var m=k.where$1($.ig.RowMetadata.prototype.$type,function(n){return!n.a()}).toList$1($.ig.RowMetadata.prototype.$type);var n=$self.c().getPositionIndex(l);if(n==-1){$self.e.add($self.h().count(),m);$self.h().add(l)}else{$self.h().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=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),function(s){return s.parentKey()==b.key()}).getEnumerator();while(r.moveNext()){var q=r.current();$self.m(a,q,c,d,e,f,g)}}}},n:function(a,b,c,d,e,f,g){var $self=this;var h=a.item(b);if($.ig.util.cast($.ig.Hierarchy.prototype.$type,h)!==null){var i=d.item(h.uniqueName());if(f!=null){i=i.where$1($.ig.Member.prototype.$type,function(j){return j.parentUniqueName()==f})}var k=i.getEnumerator();while(k.moveNext()){var j=k.current();var l;(function(){var $ret=$self.b().i(j.uniqueName(),l);l=$ret.memberId;return $ret.ret})();var m=e.where$1($.ig.RowMetadata.prototype.$type,function(n){return n.d(j.levelUniqueName())==l}).toList$1($.ig.RowMetadata.prototype.$type);if(m.count()>0){var n=new Array(a.count());$.ig.Array.prototype.copy(c,0,n,0,a.count());var o=new $.ig.OlapResultAxisMember;o.caption(j.caption());o.hierarchyUniqueName(j.hierarchyUniqueName());o.levelNumber(j.levelDepth());o.levelUniqueName(j.levelUniqueName());o.uniqueName(j.uniqueName());o.displayInfo(j.childrenCardinality());o.properties().add("PARENT_UNIQUE_NAME",j.parentUniqueName());o.properties().add("memberId",l.toString());n[b]=o;if(b==a.count()-1){var p=m.where$1($.ig.RowMetadata.prototype.$type,function(q){return!q.a()}).toList$1($.ig.RowMetadata.prototype.$type);var q=new $.ig.OlapResultTuple(n);var r=$self.c().getPositionIndex(q);if(r==-1){$self.e.add($self.h().count(),p);$self.h().add(q)}else{$self.h().item(r,q)}for(var t=0;t<n.length;t++){var s=n[t];s.position(q)}if(p.count()>0){g.add(q)}}else{$self.n(a,b+1,n,d,m,null,g)}}}}else if($.ig.util.cast($.ig.MeasureList.prototype.$type,h)!==null){var u=h;var w=u.measures().getEnumerator();while(w.moveNext()){var v=w.current();var x=new Array(a.count());$.ig.Array.prototype.copy(c,0,x,0,a.count());var y=new $.ig.OlapResultAxisMember;y.caption(v.caption());var z=$self.j($self.b().d().a().b().c());y.hierarchyUniqueName(z);y.levelNumber(0);y.uniqueName(v.uniqueName());x[b]=y;if(b==a.count()-1){var aa=new $.ig.OlapResultTuple(x);var ab=e.where$1($.ig.RowMetadata.prototype.$type,function(ac){return!ac.a()}).toList$1($.ig.RowMetadata.prototype.$type);var ac=$self.c().getPositionIndex(aa);if(ac==-1){$self.e.add($self.h().count(),ab);$self.h().add(aa)}else{$self.h().item(ac,aa)}for(var ae=0;ae<x.length;ae++){var ad=x[ae];ad.position(aa)}if(ab.count()>0){g.add(aa)}}else{$self.n(a,b+1,x,d,e,null,g)}}}},l:function(a){var $self=this;var b=$self.a;if(a.count()==0){var c=new $.ig.TaskCompletionSource$1($.ig.IDictionary$2.prototype.$type.specialize(String,$.ig.IEnumerable$1.prototype.$type.specialize($.ig.Member.prototype.$type)),0);c.e(new $.ig.Dictionary$2(String,$.ig.IEnumerable$1.prototype.$type.specialize($.ig.Member.prototype.$type),0));return c.b()}var d=new $.ig.Dictionary$2(String,$.ig.Level.prototype.$type,0);for(var e=0;e<a.count();e++){var f=a.item(e).key();var g=a.item(e).value();var h=b.r().where$1($.ig.Level.prototype.$type,function(i){return i.hierarchyUniqueName()==f&&i.depth()==g}).firstOrDefault$1($.ig.Level.prototype.$type);if(!d.containsKey(f)){d.add(f,h)}}return $self.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=$self.a;var c=new $.ig.Dictionary$2(String,$.ig.IEnumerable$1.prototype.$type.specialize($.ig.Member.prototype.$type),0);var d=new $.ig.List$1(String,0);var f=a.getEnumerator();while(f.moveNext()){var e=f.current();var g=e.value().uniqueName();var h;if(function(){var $ret=b.h(g,h);h=$ret.members;return $ret.ret}()){c.add(e.key(),h)}else{d.add(e.key())}}if(d.count()==0){var i=new $.ig.TaskCompletionSource$1($.ig.IDictionary$2.prototype.$type.specialize(String,$.ig.IEnumerable$1.prototype.$type.specialize($.ig.Member.prototype.$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 $.ig.List$1($.ig.KeyValueItem.prototype.$type,0);n.add(function(){var $ret=new $.ig.KeyValueItem;$ret.a("LEVEL_UNIQUE_NAME");$ret.b(a.item(l).uniqueName());return $ret}());j[k]=$self.b().discoverMembersAsync(null,n);k++}var o=new $.ig.TaskFactory;return o.d($.ig.IDictionary$2.prototype.$type.specialize(String,$.ig.IEnumerable$1.prototype.$type.specialize($.ig.Member.prototype.$type)),j,function(p){return $self.g(p,d,c)})},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.u(g)}c.add(e,f)}}return c},f:function(a,b){var $self=this;var c=new $.ig.Dictionary$2(String,$.ig.Level.prototype.$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=e.m().where$1($.ig.Level.prototype.$type,function(h){return h.depth()==f}).firstOrDefault$1($.ig.Level.prototype.$type);if(g!=null&&!c.containsKey(g.hierarchyUniqueName())){c.add(g.hierarchyUniqueName(),g)}}return c},$type:new $.ig.Type("FlatDataAxisProviderHelper",$.ig.Object.prototype.$type)},true);$.ig.util.defType("FlatDataPartialAxisProvider","Object",{b:null,d:null,a:null,init:function(a,b,c,d){$.ig.Object.prototype.init.call(this);this.c(a);this.b=new $.ig.FlatDataAxisProviderHelper(a,b.count(),d);this.a=c;this.d=b},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_axis:null,axis:function(value){if(arguments.length===1){this._axis=value;return value}else{return this._axis}},generateAxis:function(a){var $self=this;var b=new $.ig.TaskCompletionSource$1($.ig.OlapResultAxis.prototype.$type,0);if($self.axis()!=null){b.e($self.axis());return b.b()}var c=new Array($self.a.position().itemsCount());var d=new $.ig.List$1($.ig.OlapResultTuple.prototype.$type,0);var e=$self.a.position().indexOf($self.a);var f=$self.a.position();var g=new $.ig.List$1($.ig.KeyValuePair$2.prototype.$type.specialize(String,$.ig.Number.prototype.$type),0);for(var h=0;h<$self.a.position().itemsCount();h++){if(h<e){c[h]=$self.a.position().members().item(h).clone()}else if(h==e){if($.ig.util.cast($.ig.MeasureList.prototype.$type,$self.d.item(h))!==null){continue}var i=f.members().item(h);g.add(new $.ig.KeyValuePair$2(String,$.ig.Number.prototype.$type,1,i.hierarchyUniqueName(),i.depth()+1))}else{if($.ig.util.cast($.ig.MeasureList.prototype.$type,$self.d.item(h))!==null){continue}var j=f.members().item(h);g.add(new $.ig.KeyValuePair$2(String,$.ig.Number.prototype.$type,1,j.hierarchyUniqueName(),j.depth()))}}$self.b.l(g).i(function(k){var l=$self.c().u(f.members().toArray$1($.ig.OlapResultAxisMember.prototype.$type),e+1).toList$1($.ig.RowMetadata.prototype.$type);$self.b.n($self.d,e,c,k.m(),l,$self.a.uniqueName(),d);$self.axis(function(){var $ret=new $.ig.OlapResultAxis(d,f.itemsCount());$ret.name(a);return $ret}());b.e($self.axis())});return b.b()},getTupleRowsMetadata:function(a){return this.b.i(a)},e:function(){return this.b.h()},$type:new $.ig.Type("FlatDataPartialAxisProvider",$.ig.Object.prototype.$type,[$.ig.IFlatDataAxisProvider.prototype.$type])},true);$.ig.util.defType("IFlatDataProvider","Object",{$type:new $.ig.Type("IFlatDataProvider",null,[$.ig.IOlapDiscoverDataProvider.prototype.$type])},true);$.ig.util.defType("FlatDataProvider","Object",{v:null,x:null,z:null,ab:null,n:null,p:null,r:null,j:null,k:null,ad:null,q:null,l:null,_e:null,e:function(value){if(arguments.length===1){this._e=value;return value}else{return this._e}},init:function(a,b){var $self=this;this.r=new $.ig.Dictionary$2(String,$.ig.Number.prototype.$type,0);this.j=new $.ig.Dictionary$2(String,$.ig.DataMemberMetadata.prototype.$type,0);this.k=new $.ig.Dictionary$2(String,$.ig.DataMemberMetadata.prototype.$type,0);this.m=new $.ig.Dictionary$2(String,$.ig.IDictionary$2.prototype.$type.specialize(String,$.ig.DataMemberMetadata.prototype.$type),0);$.ig.Object.prototype.init.call(this);this.ah(a);this.d(b);this.e(new $.ig.TableMetadata(a));if(b.a()!=null){if(b.a().b()==null){b.a().b(function(){var $ret=new $.ig.MeasuresDimensionMetadata;$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(value){if(arguments.length===1){this._ah=value;return value}else{return this._ah}},_d:null,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},discoverCatalogsAsync:function(a,b){throw new $.ig.NotImplementedException},discoverCubesAsync:function(a,b){var c=new $.ig.TaskCompletionSource$1($.ig.IEnumerable$1.prototype.$type.specialize($.ig.Cube.prototype.$type),0);if(this.v==null){this.v=this.w()}c.e(this.v);return c.b()},discoverDimensionsAsync:function(a,b){var c=new $.ig.TaskCompletionSource$1($.ig.IEnumerable$1.prototype.$type.specialize($.ig.Dimension.prototype.$type),0);if(this.x==null){this.x=this.y()}c.e(this.x);return c.b()},discoverHierarchiesAsync:function(a,b){var c=new $.ig.TaskCompletionSource$1($.ig.IEnumerable$1.prototype.$type.specialize($.ig.Hierarchy.prototype.$type),0);if(this.z==null){this.z=this.aa()}c.e(this.z);return c.b()},discoverLevelsAsync:function(a,b){var c=new $.ig.TaskCompletionSource$1($.ig.IEnumerable$1.prototype.$type.specialize($.ig.Level.prototype.$type),0);var d=this.s(a,b);c.e(d);return c.b()},s:function(a,b){var $self=this;if($self.ab==null){$self.n=new $.ig.Dictionary$2(String,$.ig.IList$1.prototype.$type.specialize($.ig.Level.prototype.$type),0);$self.ab=$self.ac()}var c=null;var d=null;if(b!=null){c=b.where$1($.ig.KeyValueItem.prototype.$type,function(e){return e.a()=="HIERARCHY_UNIQUE_NAME"}).firstOrDefault$1($.ig.KeyValueItem.prototype.$type);d=b.where$1($.ig.KeyValueItem.prototype.$type,function(e){return e.a()=="LEVEL_UNIQUE_NAME"}).firstOrDefault$1($.ig.KeyValueItem.prototype.$type)}var e;if(c!=null){e=$self.ab.where$1($.ig.Level.prototype.$type,function(f){return f.hierarchyUniqueName()==c.b()})}else{e=$self.ab.toList$1($.ig.Level.prototype.$type)}if(d!=null){e=e.where$1($.ig.Level.prototype.$type,function(f){return f.uniqueName()==d.b()})}return e},discoverMeasuresAsync:function(a,b){var c=new $.ig.TaskCompletionSource$1($.ig.IEnumerable$1.prototype.$type.specialize($.ig.Measure.prototype.$type),0);if(this.ad==null){this.q=new $.ig.Dictionary$2(String,$.ig.Func$3.prototype.$type.specialize($.ig.IEnumerable.prototype.$type,$.ig.CellMetadata.prototype.$type,$.ig.Object.prototype.$type),0);this.ad=this.ae(this.q)}c.e(this.ad);return c.b()},discoverMeasureGroupsAsync:function(a,b){throw new $.ig.NotImplementedException},discoverMeasureGroupDimensionsAsync:function(a,b){throw new $.ig.NotImplementedException},discoverMembersAsync:function(a,b){var c=new $.ig.TaskCompletionSource$1($.ig.IEnumerable$1.prototype.$type.specialize($.ig.Member.prototype.$type),0);var d=this.t(a,b);c.e(d);return c.b()},discoverKpisAsync:function(a,b){var c=new $.ig.TaskCompletionSource$1($.ig.IEnumerable$1.prototype.$type.specialize($.ig.Kpi.prototype.$type),0);c.e(new $.ig.List$1($.ig.Kpi.prototype.$type,0));return c.b()},t:function(a,b){var $self=this;if($self.l==null){$self.l=new $.ig.Dictionary$2(String,$.ig.IDictionary$2.prototype.$type.specialize(String,$.ig.Member.prototype.$type),0)}var c=b.where$1($.ig.KeyValueItem.prototype.$type,function(d){return d.a()=="HIERARCHY_UNIQUE_NAME"}).firstOrDefault$1($.ig.KeyValueItem.prototype.$type);var d=b.where$1($.ig.KeyValueItem.prototype.$type,function(e){return e.a()=="LEVEL_UNIQUE_NAME"}).firstOrDefault$1($.ig.KeyValueItem.prototype.$type);var e=b.where$1($.ig.KeyValueItem.prototype.$type,function(f){return f.a()=="MEMBER_UNIQUE_NAME"}).firstOrDefault$1($.ig.KeyValueItem.prototype.$type);if($self.ab==null){$self.ab=$self.ac()}var f=null;var g=$self.ab;if(c!=null){g=g.where$1($.ig.Level.prototype.$type,function(h){return h.hierarchyUniqueName()==c.b()}).toList$1($.ig.Level.prototype.$type)}if(d!=null){var h=g.where$1($.ig.Level.prototype.$type,function(i){return i.uniqueName()==d.b()}).first$1($.ig.Level.prototype.$type);var i=h.hierarchyUniqueName();var j=h.depth();var k=0;if(e!=null){k=1}g=g.where$1($.ig.Level.prototype.$type,function(l){return l.hierarchyUniqueName()==i&&l.depth()<=j+k}).toList$1($.ig.Level.prototype.$type)}else if(e!=null){throw new $.ig.InvalidOperationException(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=$self.z.where$1($.ig.Hierarchy.prototype.$type,function(p){return p.uniqueName()==n.hierarchyUniqueName()}).first$1($.ig.Hierarchy.prototype.$type);var p=$self.e().d();$self.al(f,0,".",null,o,p);if(c!=null&&d==null&&e==null){var q=new $.ig.List$1($.ig.Member.prototype.$type,0);for(var r=0;r<f.length;r++){var s=f[r];var t;if(!function(){var $ret=$self.l.tryGetValue(s.uniqueName(),t);t=$ret.value;return $ret.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 $ret=$self.l.tryGetValue(n.uniqueName(),w);w=$ret.value;return $ret.ret}()){}m=w.values()}else{var x;if(!function(){var $ret=$self.l.tryGetValue(n.uniqueName(),x);x=$ret.value;return $ret.ret}()){}var y=new $.ig.List$1($.ig.Member.prototype.$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 $.ig.List$1($.ig.Member.prototype.$type,0)}return m},ak:function(a,b,c){var $self=this;var d=new $.ig.List$1($.ig.Task.prototype.$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 $.ig.TaskFactory;return h.d($.ig.OlapResult.prototype.$type,f,function(i){return $self.c(a,b,c)})}var i=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);var j=$self.c(null,null,c);i.e(j);return i.b()},am:function(a){var $self=this;var b=new $.ig.Dictionary$2(String,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize(String,$.ig.DataMemberMetadata.prototype.$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 $ret=$self.j.tryGetValue(f,g);g=$ret.value;return $ret.ret}()){var h;if(!function(){var $ret=b.tryGetValue(c.b(),h);h=$ret.value;return $ret.ret}()){h=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize(String,$.ig.DataMemberMetadata.prototype.$type),0);b.add(c.b(),h)}var i;if(!function(){var $ret=h.tryGetValue(g.a().levelDepth(),i);i=$ret.value;return $ret.ret}()){i=new $.ig.Dictionary$2(String,$.ig.DataMemberMetadata.prototype.$type,0);h.add(g.a().levelDepth(),i)}if(!i.containsKey(f)){i.add(f,g)}}}}}var j=new $.ig.Dictionary$2(String,$.ig.IDictionary$2.prototype.$type.specialize(String,$.ig.DataMemberMetadata.prototype.$type),0);var l=b.getEnumerator();while(l.moveNext()){var k=l.current();var m=k.value();var n=m.orderBy$2($.ig.KeyValuePair$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize(String,$.ig.DataMemberMetadata.prototype.$type)),$.ig.Number.prototype.$type,function(o){return o.key()}).select$2($.ig.KeyValuePair$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize(String,$.ig.DataMemberMetadata.prototype.$type)),$.ig.IDictionary$2.prototype.$type.specialize(String,$.ig.DataMemberMetadata.prototype.$type),function(o){return o.value()
}).toList$1($.ig.IDictionary$2.prototype.$type.specialize(String,$.ig.DataMemberMetadata.prototype.$type));for(var o=n.count()-1;o>=0;o--){var p=n.item(o).select$2($.ig.KeyValuePair$2.prototype.$type.specialize(String,$.ig.DataMemberMetadata.prototype.$type),$.ig.DataMemberMetadata.prototype.$type,function(q){return q.value()}).toList$1($.ig.DataMemberMetadata.prototype.$type);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 $ret=m.tryGetValue(s-1,t);t=$ret.value;return $ret.ret}()||!t.containsKey(r.a().parentUniqueName())){var u;if(!function(){var $ret=j.tryGetValue(r.a().parentUniqueName(),u);u=$ret.value;return $ret.ret}()){u=new $.ig.Dictionary$2(String,$.ig.DataMemberMetadata.prototype.$type,0);j.add(r.a().parentUniqueName(),u)}u.add(r.a().uniqueName(),r)}}}}var v=n.item(0);var w=v.values().first$1($.ig.DataMemberMetadata.prototype.$type);if(!String.isNullOrEmpty(w.a().parentUniqueName())){w=$self.j.item(w.a().parentUniqueName())}var x=new $.ig.List$1($.ig.KeyValueItem.prototype.$type,0);x.add(function(){var $ret=new $.ig.KeyValueItem;$ret.a("LEVEL_UNIQUE_NAME");$ret.b(w.a().levelUniqueName());return $ret}());var y=$self.t(null,x).toList$1($.ig.Member.prototype.$type);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 $.ig.Dictionary$2(String,$.ig.DataMemberMetadata.prototype.$type,0))}}}var ac=$self.m.keys().getEnumerator();while(ac.moveNext()){var ab=ac.current();var ad;if(function(){var $ret=$self.j.tryGetValue(ab,ad);ad=$ret.value;return $ret.ret}()){for(var ae=0;ae<ad.d().count();ae++){var af=ad.d().item(ae);if(af.a()){af.h()}}}}$self.m=j;var ah=$self.m.keys().getEnumerator();while(ah.moveNext()){var ag=ah.current();var ai;if(function(){var $ret=$self.j.tryGetValue(ag,ai);ai=$ret.value;return $ret.ret}()){if(!$self.g(ai)){for(var aj=0;aj<ai.d().count();aj++){var ak=ai.d().item(aj);ak.f()}}}}var am=$self.m.keys().getEnumerator();while(am.moveNext()){var al=am.current();var an;if(function(){var $ret=$self.j.tryGetValue(al,an);an=$ret.value;return $ret.ret}()){var ao=$self.m.item(al).values().toList$1($.ig.DataMemberMetadata.prototype.$type);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($self.m.containsKey(b)){return true}var c;if(function(){var $ret=$self.j.tryGetValue(b,c);c=$ret.value;return $ret.ret}()){b=c.a().parentUniqueName()}else{return false}}return false},m: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 $ret=$self.h(f.uniqueName(),h);h=$ret.memberMetadata;return $ret.ret}()){g=h.d()}if(g!=null){if(c==null||c.count()>g.count()){d=e;c=g}}}if(c==null){c=$self.e().d().toList$1($.ig.RowMetadata.prototype.$type)}var i=c;for(var j=0;j<b;j++){if(j!=d){var k=a[j];var l;if(function(){var $ret=k.properties().tryGetValue("memberId",l);l=$ret.value;return $ret.ret}()){var m=k.levelUniqueName();var n=$.ig.Number.prototype.parseInt(l);i=i.where$1($.ig.RowMetadata.prototype.$type,function(o){return o.d(m)==n})}}}return i},i:function(a,b){var $self=this;return{ret:function(){var $ret=$self.r.tryGetValue(a,b);b=$ret.value;return $ret.ret}(),memberId:b};return{memberId:b}},h:function(a,b){var $self=this;return{ret:function(){var $ret=$self.j.tryGetValue(a,b);b=$ret.value;return $ret.ret}(),memberMetadata:b};return{memberMetadata:b}},a:function($t,a){var b=new $.ig.ArrayListCollection$1($t);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b.add(c)}return b},c:function(a,b,c){var $self=this;var d=null;if(a!=null){d=a.axis()}var e=null;if(b!=null){e=b.axis()}var f=$self.f(d,e,c);var g=f[0];var h=f[1];var i=null;var j=-1;var k=null;var l=new $.ig.Dictionary$2(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=$self.q.item(i)}if(d==null&&e==null){var q=new $.ig.List$1($.ig.OlapResultCell.prototype.$type,0);if(k!=null){var r=$self.e().d().where$1($.ig.RowMetadata.prototype.$type,function(s){return!s.a()});var s=new $.ig.Array;var u=r.select$2($.ig.RowMetadata.prototype.$type,$.ig.Object.prototype.$type,function(v){return v.e()}).getEnumerator();while(u.moveNext()){var t=u.current();s.add(t)}if(s.length>0){var v=new $.ig.CellMetadata(0,0,0,j,n,o,m);var w=k(s,v);if(w!=null){var x=new $.ig.OlapResultCell;x.cellOrdinal(0);x.properties().add("Value",w);x.properties().add("FmtValue",w.toString());q.add(x)}}}return $self.b(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 $.ig.List$1($.ig.OlapResultCell.prototype.$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=$self.q.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=$self.q.item(i)}}if(aj!=null){if(ak!=null){aj=$self.ag(aj,ak,ah,al,h)}}else{aj=ak}if(k!=null){var am=af*ac+ai;var an=new $.ig.CellMetadata(af,ai,am,j,n,o,m);var ao=new $.ig.Array;var aq=aj.select$2($.ig.RowMetadata.prototype.$type,$.ig.Object.prototype.$type,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 $.ig.OlapResultCell;as.cellOrdinal(am);as.properties().add("Value",ar.toString());as.properties().add("FmtValue",ar.toString());ae.add(as)}}}}}var at=$self.b(d,e,ae);return at},b:function(a,b,c){var $self=this;var d=function(){var $ret=new $.ig.OlapResult;$ret.axes(new $.ig.List$1($.ig.OlapResultAxis.prototype.$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){var $self=this;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 $ret=g.properties().tryGetValue("memberId",h);h=$ret.value;return $ret.ret}()){var i=$.ig.Number.prototype.parseInt(h);a=a.where$1($.ig.RowMetadata.prototype.$type,function(j){return j.d(g.levelUniqueName())==i}).toList$1($.ig.RowMetadata.prototype.$type)}}}return a},f:function(a,b,c){var $self=this;var d=$self.aj($self.d().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 function(){var $ret=new Array;$ret.add(e);$ret.add(f);return $ret}()},al:function(a,b,c,d,e,f){var $self=this;var g=a[b];var h=$self.p.item(g.uniqueName());var i=$self.ab.where$1($.ig.Level.prototype.$type,function(j){return j.hierarchyUniqueName()==e.uniqueName()&&j.depth()==g.depth()+1}).firstOrDefault$1($.ig.Level.prototype.$type);var j=null;if(d!=null){j=d.uniqueName()}var k;if(!function(){var $ret=$self.l.tryGetValue(g.uniqueName(),k);k=$ret.value;return $ret.ret}()){k=new $.ig.Dictionary$2(String,$.ig.Member.prototype.$type,0);$self.l.add(g.uniqueName(),k)}var l=new $.ig.List$1($.ig.KeyListPair$1.prototype.$type.specialize($.ig.RowMetadata.prototype.$type),0);var m=new $.ig.Dictionary$2(String,$.ig.IList$1.prototype.$type.specialize($.ig.RowMetadata.prototype.$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 $ret=m.tryGetValue(p,q);q=$ret.value;return $ret.ret}()){q=new $.ig.List$1($.ig.RowMetadata.prototype.$type,0);m.add(p,q);l.add(new $.ig.KeyListPair$1($.ig.RowMetadata.prototype.$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+"&"+$self.aj(s);var v=g.uniqueName()+u;var w;var x;var y;if(!function(){var $ret=k.tryGetValue(v,w);w=$ret.value;return $ret.ret}()){w=new $.ig.Member;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=$self.r.count();$self.r.add(w.uniqueName(),x);y=new $.ig.DataMemberMetadata(w,u,x,k.count());$self.j.add(w.uniqueName(),y);$self.k.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){$self.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},af:null,o:null,w:function(){var a=new $.ig.List$1($.ig.Cube.prototype.$type,0);if(this.d()==null||this.d().a()==null){return a}var b=new $.ig.Cube;b.caption(this.d().a().c());b.name(this.d().a().e());b.description(this.d().a().d());a.add(b);return a},ae:function(a){var b=new $.ig.List$1($.ig.Measure.prototype.$type,0);if(this.d()==null||this.d().a()==null||this.d().a().b()==null||this.d().a().b().a()==null){return b}var c=this.d().a().b().c();var e=this.d().a().b().a().getEnumerator();while(e.moveNext()){var d=e.current();var f=new $.ig.Measure;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},y:function(){if(this.v==null){this.v=this.w()}var a=new $.ig.List$1($.ig.Dimension.prototype.$type,0);if(this.d()==null||this.d().a()==null){return a}var b=new $.ig.Dimension;b.dimensionType($.ig.DimensionType.prototype.measure);b.caption(this.d().a().b().b());b.uniqueName(this.aj(this.d().a().b().c()));a.add(b);if(this.d().a().a()==null){return a}this.af=new $.ig.List$1($.ig.DimensionMetadata.prototype.$type,0);var d=this.d().a().a().getEnumerator();while(d.moveNext()){var c=d.current();this.af.add(c);var e=new $.ig.Dimension;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},aa:function(){var $self=this;if($self.x==null){$self.x=$self.y()}var a=new $.ig.List$1($.ig.Hierarchy.prototype.$type,0);if($self.d()==null||$self.d().a()==null){return a}var b=new $.ig.Hierarchy;b.uniqueName($self.aj($self.d().a().b().c()));b.dimensionUniqueName($self.aj($self.d().a().b().c()));a.add(b);if($self.d().a().a()==null){return a}$self.o=new $.ig.Dictionary$2(String,$.ig.IList$1.prototype.$type.specialize($.ig.HierarchyMetadata.prototype.$type),0);for(var c=0;c<$self.af.count();c++){var d=$self.af.item(c);if(d.a()!=null){var e;if(!function(){var $ret=$self.o.tryGetValue(d.e(),e);e=$ret.value;return $ret.ret}()){e=new $.ig.List$1($.ig.HierarchyMetadata.prototype.$type,0);$self.o.add(d.e(),e)}var g=d.a().getEnumerator();while(g.moveNext()){var f=g.current();e.add(f);var h=new $.ig.Hierarchy;h.caption(f.b());h.description(f.c());h.dimensionUniqueName($self.aj(d.e()));h.hierarchyDisplayFolder(f.d());h.name(f.e());h.uniqueName(h.dimensionUniqueName()+"."+$self.aj(h.name()));a.add(h)}}}return a},ac:function(){var $self=this;if($self.z==null){$self.z=$self.aa()}$self.p=new $.ig.Dictionary$2(String,$.ig.Func$2.prototype.$type.specialize($.ig.Object.prototype.$type,String),0);var a=new $.ig.List$1($.ig.Level.prototype.$type,0);if($self.d()==null||$self.d().a()==null){return a}var b=new $.ig.Level;b.hierarchyUniqueName($self.aj($self.d().a().b().c()));b.uniqueName(b.hierarchyUniqueName()+".[MeasuresLevel]");b.depth(-1);a.add(b);if($self.d().a().a()==null){return a}var c=new $.ig.HierarchyMetadata;c.e($self.d().a().b().c());c.b($self.d().a().b().b());var d=new $.ig.List$1($.ig.HierarchyMetadata.prototype.$type,0);d.add(c);for(var e=0;e<$self.af.count();e++){var f=$self.af.item(e);var g;if(function(){var $ret=$self.o.tryGetValue(f.e(),g);g=$ret.value;return $ret.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=$self.z.item(i);for(var l=0;l<j.a().count();l++){var m=j.a().item(l);var n=new $.ig.Level;n.caption(m.b());n.depth(l);n.dimensionUniqueName(k.dimensionUniqueName());n.hierarchyUniqueName(k.uniqueName());n.name(m.c());n.uniqueName(k.uniqueName()+"."+$self.aj(n.name()));a.add(n);var o;if(!function(){var $ret=$self.n.tryGetValue(k.uniqueName(),o);o=$ret.value;return $ret.ret}()){o=new $.ig.List$1($.ig.Level.prototype.$type,0);$self.n.add(k.uniqueName(),o)}o.add(n);$self.p.item(n.uniqueName(),m.a())}}return a},$type:new $.ig.Type("FlatDataProvider",$.ig.Object.prototype.$type,[$.ig.IFlatDataProvider.prototype.$type])},true);$.ig.util.defType("KeyListPair$1","Object",{$t:null,_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},init:function($t,initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.init.call(this);this.b(String.empty());this.a(new $.ig.List$1(this.$t,0))},init1:function($t,initNumber,a,b){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.init.call(this);this.b(a);this.a(b)},$type:new $.ig.Type("KeyListPair$1",$.ig.Object.prototype.$type)},true);$.ig.util.defType("CellMetadata","Object",{init:function(a,b,c,d,e,f,g){$.ig.Object.prototype.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(value){if(arguments.length===1){this._rowIndex=value;return value}else{return this._rowIndex}},_columnIndex:0,columnIndex:function(value){if(arguments.length===1){this._columnIndex=value;return value}else{return this._columnIndex}},_cellOrdinal:0,cellOrdinal:function(value){if(arguments.length===1){this._cellOrdinal=value;return value}else{return this._cellOrdinal}},_measureIndex:0,measureIndex:function(value){if(arguments.length===1){this._measureIndex=value;return value}else{return this._measureIndex}},_rowTuples:null,rowTuples:function(value){if(arguments.length===1){this._rowTuples=value;return value}else{return this._rowTuples}},_columnTuples:null,columnTuples:function(value){if(arguments.length===1){this._columnTuples=value;return value}else{return this._columnTuples}},_measures:null,measures:function(value){if(arguments.length===1){this._measures=value;return value}else{return this._measures}},$type:new $.ig.Type("CellMetadata",$.ig.Object.prototype.$type)},true);$.ig.util.defType("CubeMetadata","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.a(new $.ig.ArrayListCollection$1($.ig.DimensionMetadata.prototype.$type))},_e:null,e:function(value){if(arguments.length===1){this._e=value;return value}else{return this._e}},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_d:null,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},$type:new $.ig.Type("CubeMetadata",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MeasuresDimensionMetadata","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},$type:new $.ig.Type("MeasuresDimensionMetadata",$.ig.Object.prototype.$type)},true);$.ig.util.defType("DataMemberMetadata","Object",{init:function(a,b,c,d){$.ig.Object.prototype.init.call(this);this.a(a);this.g(b);this.e(c);this.f(d);this.d(new $.ig.List$1($.ig.RowMetadata.prototype.$type,0))},_e:0,e:function(value){if(arguments.length===1){this._e=value;return value}else{return this._e}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},_g:null,g:function(value){if(arguments.length===1){this._g=value;return value}else{return this._g}},_f:0,f:function(value){if(arguments.length===1){this._f=value;return value}else{return this._f}},_d:null,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},c:function(){var $self=this;return $self.d().where$1($.ig.RowMetadata.prototype.$type,function(a){return a.a()==false}).toList$1($.ig.RowMetadata.prototype.$type)},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.Object.prototype.$type)},true);$.ig.util.defType("DataSourceMetadata","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},$type:new $.ig.Type("DataSourceMetadata",$.ig.Object.prototype.$type)},true);$.ig.util.defType("DimensionMetadata","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_e:null,e:function(value){if(arguments.length===1){this._e=value;return value}else{return this._e}},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_d:null,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},$type:new $.ig.Type("DimensionMetadata",$.ig.Object.prototype.$type)},true);$.ig.util.defType("HierarchyMetadata","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_e:null,e:function(value){if(arguments.length===1){this._e=value;return value}else{return this._e}},_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_d:null,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},$type:new $.ig.Type("HierarchyMetadata",$.ig.Object.prototype.$type)},true);$.ig.util.defType("LevelMetadata","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},$type:new $.ig.Type("LevelMetadata",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MeasureMetadata","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.a($.ig.AggregatorType.prototype.sum)},_b:null,b:function(value){if(arguments.length===1){this._b=value;return value}else{return this._b}},_a:null,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},_d:null,d:function(value){if(arguments.length===1){this._d=value;return value}else{return this._d}},_f:null,f:function(value){if(arguments.length===1){this._f=value;return value}else{return this._f}},_e:null,e:function(value){if(arguments.length===1){this._e=value;return value}else{return this._e}},_c:null,c:function(value){if(arguments.length===1){this._c=value;return value}else{return this._c}},$type:new $.ig.Type("MeasureMetadata",$.ig.Object.prototype.$type)},true);$.ig.util.defType("RowMetadata","Object",{b:null,c:0,init:function(a){$.ig.Object.prototype.init.call(this);this.b=new $.ig.Dictionary$2(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 $self=this;var b;(function(){var $ret=$self.b.tryGetValue(a,b);b=$ret.value;return $ret.ret})();return b},f:function(){this.c++;this.a(true)},h:function(){this.c--;this.a(this.c>0)},_e:null,e:function(value){if(arguments.length===1){this._e=value;return value}else{return this._e}},_a:false,a:function(value){if(arguments.length===1){this._a=value;return value}else{return this._a}},$type:new $.ig.Type("RowMetadata",$.ig.Object.prototype.$type)},true);$.ig.util.defType("TableMetadata","Object",{e:null,a:null,c:null,f:0,init:function(a){$.ig.Object.prototype.init.call(this);var b=0;var c=$.ig.util.cast($.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 $.ig.List$1($.ig.RowMetadata.prototype.$type,0);this.a=new Array(b);var g=a.getEnumerator();while(g.moveNext()){var f=g.current();var h=new $.ig.RowMetadata(f);this.h(h);this.c.add(h)}this.e=new $.ig.List$1(String,0)},d: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.Array.prototype.copy(this.a,a,this.a,a+1,this.f-a);this.a[a]=b;this.f++},k:function(a){var $self=this;$self.f--;$.ig.Array.prototype.copy($self.a,a+1,$self.a,a,$self.f-a);(function(){var $ret=$.ig.Array.prototype.resize$1($.ig.RowMetadata.prototype.$type,$self.a,$self.f);$self.a=$ret.array;return $ret.ret})()},i:function(){var a=new Array(this.f+1);$.ig.Array.prototype.copy(this.a,0,a,0,this.f);this.a=a},$type:new $.ig.Type("TableMetadata",$.ig.Object.prototype.$type)},true);$.ig.util.defType("FlatDataSourceImpl","OlapDataSource",{a3:null,dataProvider:function(){if(this.a3==null){this.a3=this.dataProviderFactory().createDataProvider()}return this.a3},init:function(a){this.a7=new $.ig.List$1($.ig.FlatDataAxisProvider.prototype.$type,0);$.ig.OlapDataSource.prototype.init.call(this,a);this.flatDataSourceOptions(a);this.dataProviderFactory(a.dataProviderFactory())},h:function(){return new $.ig.DefaultFlatDataProviderFactory(this.flatDataSourceOptions().itemsSource(),this.flatDataSourceOptions().dataSourceMetadata())},_flatDataSourceOptions:null,flatDataSourceOptions:function(value){if(arguments.length===1){this._flatDataSourceOptions=value;return value}else{return this._flatDataSourceOptions}},am:function(){var $self=this;var a=new $.ig.TaskCompletionSource$1($.ig.OlapMetadataTreeItem.prototype.$type,0);if($self.isInitialized()){a.e($self.metadataTree());return a.b()}$self.columnAxis().collectionChanged=$.ig.Delegate.prototype.combine($self.columnAxis().collectionChanged,$self.bb.runOn($self));$self.rowAxis().collectionChanged=$.ig.Delegate.prototype.combine($self.rowAxis().collectionChanged,$self.bf.runOn($self));$self.filters().collectionChanged=$.ig.Delegate.prototype.combine($self.filters().collectionChanged,$self.bc.runOn($self));$self.measures().collectionChanged=$.ig.Delegate.prototype.combine($self.measures().collectionChanged,$self.bd.runOn($self));return $self.aq(null).continueWithTask$1($.ig.OlapMetadataTreeItem.prototype.$type,function(b){return $self.an($self.cubes().first$1($.ig.Cube.prototype.$type).name())}).continueWithTask$1($.ig.OlapMetadataTreeItem.prototype.$type,function(b){return $self.ak()})},ah:function(){var $self=this;var a=$self.dataProvider();var b=new $.ig.List$1($.ig.Task.prototype.$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 $.ig.CubeMetaItemsCache;$self.c(d);var e=new $.ig.TaskFactory;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.s(j.m());d.n(g.m());d.o(h.m());d.r(i.m());d.p(k.m())})},bh:function(a,b){var c=0;var d=this.measureListIndex();if(a){var e=this.a2(c);if(e!=null&&this.measureListLocation()==$.ig.MeasureListLocation.prototype.columns){if(d>-1){var f=e.e().rootPositionInfo();if(f!=null){this.be(f,d-1)}}}c++}if(b){var g=this.a2(c);if(g!=null&&this.measureListLocation()==$.ig.MeasureListLocation.prototype.rows){if(d>-1){var h=g.e().rootPositionInfo();if(h!=null){this.be(h,d-1)}}}}},be:function(a,b){if(a.positionItemIndex()==b){a.clear()}else{var d=a.values().getEnumerator();while(d.moveNext()){var c=d.current();this.be(c,b)}}},ai:function(){var $self=this;var a=$self.a8();if(!String.isNullOrEmpty(a)){var b=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);b.d(new $.ig.InvalidOperationException(1,a));return b.b()}var c=$self.columnAxis().count()>0;var d=$self.rowAxis().count()>0;if(!d&&!c&&$self.measures().count()==0){var e=function(){var $ret=new $.ig.OlapResult;$ret.isEmpty(true);return $ret}();var f=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);f.e(e);$self.l(new $.ig.OlapResultView(e,e,false,false));$self.result(e);$self.clearPendingChanges();return f.b()}var g=$self.m();var h=$self.s();var i=$self.r()||$self.p();var j=$self.n();var k=$self.ae().count()>0;var l=$self.ad().count()>0;var m=$self.af.count()>0;if(!g&&!h&&!i&&!j&&!k&&!l&&!m){var n=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);n.e($self.result());return n.b()}if($self.r()){$self.bh(c,d)}var o=null;var p=null;var q=0;var r="Axis0";var s=$self.m();if($self.r()&&c&&$self.measureListIndex()>-1&&$self.measureListLocation()==$.ig.MeasureListLocation.prototype.columns){s=true}o=$self.a1($self.columnAxis(),s,q);$self.m(false);if(o!=null){q++;r="Axis1"}var t=$self.s();if($self.r()&&d&&$self.measureListIndex()>-1&&$self.measureListLocation()==$.ig.MeasureListLocation.prototype.rows){t=true}p=$self.a1($self.rowAxis(),t,q);$self.s(false);if(p!=null){if(p.axis()!=null){p.axis().name(r)}q++}$self.r(false);$self.n(false);var u=new $.ig.List$1($.ig.AxisElement.prototype.$type,0);var w=$self.u().getEnumerator();while(w.moveNext()){var v=w.current();u.add(v)}var y=$self.w().getEnumerator();while(y.moveNext()){var x=y.current();u.add(x)}var aa=$self.v().getEnumerator();while(aa.moveNext()){var z=aa.current();u.add(z)}var ab=$self.a9(u,c,d,k,l,o,p);return ab},a9:function(a,b,c,d,e,f,g){var $self=this;if($self.af.count()>0){$self.dataProvider().am(a);var i=$self.a7.getEnumerator();while(i.moveNext()){var h=i.current();h.o()}$self.af.clear()}$self.a6(b,c);$self.ba(b,c,true);if(d||e){var j=null;if(b){var k=$self.ae();var l=k.where$1($.ig.PositionInfo.prototype.$type,function(m){return m.c()=="Axis0"}).toList$1($.ig.PositionInfo.prototype.$type);if(l.count()>0){var m=l.item(0);k.remove(m);var n=$self.result().axes().item(0).tuples().__inner[m.b()];var o=n.members().item(m.a());var p=new $.ig.FlatDataPartialAxisProvider($self.dataProvider(),$self.columnAxis(),o,$self.c());var q=p.generateAxis("Axis0");j=q.continueWithTask$1($.ig.OlapResult.prototype.$type,function(r){var s=$self.dataProvider().ak(p,g,$self.measures());return s});j=j.continueWithTask$2($.ig.OlapResult.prototype.$type,$.ig.OlapResult.prototype.$type,function(r){if($self.d("Axis0",r.m()).tuples().count()==0){o.displayInfo(0)}var s=$self.l();$self.l($self.l().extend(r.m(),"Axis0"));$self.result($self.l().visibleResult());$.ig.ResultViewHelper.prototype.f("Axis0",s,$self.l());$.ig.ResultViewHelper.prototype.e(m.c(),m.b(),m.a(),true,$self.l());f.m(p);f.axis($self.d("Axis0",$self.result()));var t=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);t.e($self.l().visibleResult());$.ig.ResultViewHelper.prototype.c(m.b(),m.a(),true,f.e());return t.b()})}}if(c){var r=b?"Axis1":"Axis0";var s=$self.ae();var t=s.where$1($.ig.PositionInfo.prototype.$type,function(u){return u.c()==r}).toList$1($.ig.PositionInfo.prototype.$type);if(d&&t.count()>0){var u=t.item(0);s.remove(u);var v=$self.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(w){return w.name()==r}).first$1($.ig.OlapResultAxis.prototype.$type).tuples().__inner[u.b()];var w=v.members().item(u.a());var x;var y=new $.ig.FlatDataPartialAxisProvider($self.dataProvider(),$self.rowAxis(),w,$self.c());if(j!=null){x=j.continueWithTask$1($.ig.OlapResultAxis.prototype.$type,function(z){return y.generateAxis(r)})}else{x=y.generateAxis(r)}j=x.continueWithTask$1($.ig.OlapResult.prototype.$type,function(z){var aa=$self.dataProvider().ak(f,y,$self.measures());return aa});j=j.continueWithTask$2($.ig.OlapResult.prototype.$type,$.ig.OlapResult.prototype.$type,function(z){if($self.l()==null){$self.l(new $.ig.OlapResultView($self.result(),$self.result(),b,c))}var aa=$self.l().hasColumns()?"Axis1":"Axis0";if($self.d(aa,z.m()).tuples().count()==0){w.displayInfo(0)}var ab=$self.l();$self.l($self.l().extend(z.m(),aa));$self.result($self.l().visibleResult());$.ig.ResultViewHelper.prototype.f(aa,ab,$self.l());$.ig.ResultViewHelper.prototype.e(u.c(),u.b(),u.a(),true,$self.l());var ac=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);ac.e($self.l().visibleResult());g.m(y);g.axis($self.d(aa,$self.result()));$.ig.ResultViewHelper.prototype.c(u.b(),u.a(),true,g.e());return ac.b()})}}if(j!=null){return j}var z=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);z.e($self.result());return z.b()}else{var aa=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);if(f==null&&g==null&&$self.measures().count()==0){var ab=function(){var $ret=new $.ig.OlapResult;$ret.isEmpty(true);return $ret}();$self.result(ab);aa.e($self.result());return aa.b()}var ac=$self.dataProvider().ak(f,g,$self.measures());return ac.continueWithTask$2($.ig.OlapResult.prototype.$type,$.ig.OlapResult.prototype.$type,function(ad){$self.l(new $.ig.OlapResultView(ad.m(),ad.m(),b,c));$self.result($self.l().visibleResult());$self.clearPendingChanges();aa.e($self.result());return aa.b()})}},a8:function(){var $self=this;var a=new $.ig.Dictionary$2(String,String,0);for(var b=0;b<$self.columnAxis().count();b++){var c=$self.columnAxis().item(b);if($.ig.util.cast($.ig.MeasureList.prototype.$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<$self.rowAxis().count();d++){var e=$self.rowAxis().item(d);if($.ig.util.cast($.ig.MeasureList.prototype.$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<$self.filters().count();f++){var g=$self.filters().item(f);var h;if(!function(){var $ret=a.tryGetValue(g.uniqueName(),h);h=$ret.value;return $ret.ret}()){a.add(g.uniqueName(),"filters")}else{return"the "+g.uniqueName()+" hierarchy is used in filters and in "+h}}for(var i=0;i<$self.measures().count();i++){var j=$self.measures().item(i);var k;if(!function(){var $ret=a.tryGetValue(j.uniqueName(),k);k=$ret.value;return $ret.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},a6:function(a,b){var $self=this;
var c=new $.ig.Dictionary$2(String,$.ig.IList$1.prototype.$type.specialize($.ig.PositionInfo.prototype.$type),0);var d=$self.l();var e=$self.ae();for(var f=0;f<e.count();f++){var g=e.item(f);var h;if(!function(){var $ret=c.tryGetValue(g.c(),h);h=$ret.value;return $ret.ret}()){h=new $.ig.List$1($.ig.PositionInfo.prototype.$type,0);c.add(g.c(),h)}if($self.l()==null){$self.l(new $.ig.OlapResultView($self.result(),$self.result(),a,b))}var i=$self.l().expandTupleMember(g.c(),g.b(),g.a());if(i!=null){h.add(g);$self.l(i);$self.result($self.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=c.keys().where$1(String,function(q){return q==o}).firstOrDefault$1(String)!=null;var q=$self.a2(n);if(q!=null&&p){var r=c.item(o);if(r.count()>0){$.ig.ResultViewHelper.prototype.f(o,d,$self.l());var t=r.getEnumerator();while(t.moveNext()){var s=t.current();$.ig.ResultViewHelper.prototype.e(o,s.b(),s.a(),true,$self.l());$.ig.ResultViewHelper.prototype.c(s.b(),s.a(),true,q.e())}var u=$self.d(o,$self.result());q.axis(u);$.ig.ResultViewHelper.prototype.b(u.positionResolver(),q.e())}}n++;o="Axis1"}if(b){var v=c.keys().where$1(String,function(w){return w==o}).firstOrDefault$1(String)!=null;var w=$self.a2(n);if(w!=null&&v){var x=c.item(o);if(x.count()>0){$.ig.ResultViewHelper.prototype.f(o,d,$self.l());var z=x.getEnumerator();while(z.moveNext()){var y=z.current();$.ig.ResultViewHelper.prototype.e(o,y.b(),y.a(),true,$self.l());$.ig.ResultViewHelper.prototype.c(y.b(),y.a(),true,w.e())}var aa=$self.d(o,$self.result());w.axis(aa);$.ig.ResultViewHelper.prototype.b(aa.positionResolver(),w.e())}}}return e.count()>0},ba:function(a,b,c){var $self=this;if($self.result()!=null){var d=$self.ad();var e=new $.ig.Dictionary$2(String,$.ig.IList$1.prototype.$type.specialize($.ig.PositionInfo.prototype.$type),0);var f=$self.l();for(var g=0;g<d.count();g++){var h=d.item(g);var i;if(!function(){var $ret=e.tryGetValue(h.c(),i);i=$ret.value;return $ret.ret}()){i=new $.ig.List$1($.ig.PositionInfo.prototype.$type,0);e.add(h.c(),i)}i.add(h);if(c){if($self.l()==null){$self.l(new $.ig.OlapResultView($self.result(),$self.result(),a,b))}else{$self.l($self.l().collapseTupleMember(h.c(),h.b(),h.a()));$self.result($self.l().visibleResult())}}}var j=0;var k="Axis0";if(a){var l=e.keys().where$1(String,function(m){return m==k}).firstOrDefault$1(String)!=null;var m=$self.a2(j);if(m!=null&&l){var n=e.item(k);if(n.count()>0){$.ig.ResultViewHelper.prototype.f(k,f,$self.l());var p=n.getEnumerator();while(p.moveNext()){var o=p.current();$.ig.ResultViewHelper.prototype.c(o.b(),o.a(),false,m.e())}var q=$self.d(k,$self.result());m.axis(q)}}j++;k="Axis1"}if(b){var r=e.keys().where$1(String,function(s){return s==k}).firstOrDefault$1(String)!=null;var s=$self.a2(j);if(s!=null&&r){var t=e.item(k);if(t.count()>0){$.ig.ResultViewHelper.prototype.f(k,f,$self.l());var v=t.getEnumerator();while(v.moveNext()){var u=v.current();$.ig.ResultViewHelper.prototype.c(u.b(),u.a(),false,s.e())}var w=$self.d(k,$self.result());s.axis(w)}}}d.clear()}},a1:function(a,b,c){var d=null;if(a.count()>0){d=this.a2(c);if(b){if(d!=null){d.n(a)}else{d=new $.ig.FlatDataAxisProvider(this.dataProvider(),a,this.c());this.bg(c,d)}}}return d},bg:function(a,b){this.a7.item(a,b)},a2:function(a){if(a<this.a7.count()){return this.a7.item(a)}return null},getMembersOfLevel:function(a){var $self=this;var b=new $.ig.List$1($.ig.KeyValueItem.prototype.$type,0);b.add(function(){var $ret=new $.ig.KeyValueItem;$ret.a("LEVEL_UNIQUE_NAME");$ret.b(a);return $ret}());var c=$self.dataProvider().discoverMembersAsync(null,b);c.i(function(d){var f=d.m().getEnumerator();while(f.moveNext()){var e=f.current();$self.c().u(e)}});return c},getMembersOfHierarchy:function(a){var $self=this;var b=new $.ig.CoreOlapElementParser(a);var c=b.b();if(c.count()<2){throw new $.ig.ArgumentException(1,"Specified value: "+a+" is not valid.",a)}var d=new $.ig.KeyValueItem;d.a("HIERARCHY_UNIQUE_NAME");d.b(c.item(0)+"."+c.item(1));var e=new $.ig.List$1($.ig.KeyValueItem.prototype.$type,0);e.add(d);var f=$self.dataProvider().discoverMembersAsync(null,e);f.i(function(g){var i=g.m().getEnumerator();while(i.moveNext()){var h=i.current();$self.c().u(h)}});return f},getMembersOfMember:function(a){var $self=this;var b=new $.ig.CoreOlapElementParser(a);var c=b.b();var d=new $.ig.KeyValueItem;if(c.count()<3){throw new $.ig.ArgumentException(1,"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 $.ig.List$1($.ig.KeyValueItem.prototype.$type,0);e.add(d);e.add(function(){var $ret=new $.ig.KeyValueItem;$ret.a("MEMBER_UNIQUE_NAME");$ret.b(a);return $ret}());var f=$self.dataProvider().discoverMembersAsync(null,e);f.i(function(g){var i=g.m().getEnumerator();while(i.moveNext()){var h=i.current();$self.c().u(h)}});return f},bb:function(a,b){this.m(true);this.bi(0,this.columnAxis(),this.rowAxis());this.ay(b,this.u());this.a0(b,this.columnAxis());if(b.action()!=$.ig.NotifyCollectionChangedAction.prototype.reset&&this.columnAxis()!=null){var c=Math.max(b.newStartingIndex(),b.oldStartingIndex());this.bj("Axis0",c)}},bf:function(a,b){this.s(true);this.bi(1,this.rowAxis(),this.columnAxis());this.ay(b,this.w());this.a0(b,this.rowAxis());if(b.action()!=$.ig.NotifyCollectionChangedAction.prototype.reset&&this.rowAxis()!=null){var c=this.columnAxis()==null?"Axis0":"Axis1";var d=Math.max(b.newStartingIndex(),b.oldStartingIndex());this.bj(c,d)}},a7:null,bi:function(a,b,c){if(b.count()>0){if(c.count()>0){if(this.a7.count()<2){this.a7.insert(a,null)}}else{if(this.a7.count()==0){this.a7.insert(0,null)}}}else{if(this.a7.count()>0){if(this.a7.count()>1){this.a7.removeAt(a)}else{this.a7.removeAt(0)}}}},bj:function(a,b){var c=this.ae();var d=this.ad();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)}}},bc:function(a,b){this.n(true);this.ay(b,this.v())},bd:function(a,b){this.r(true);this.az()},$type:new $.ig.Type("FlatDataSourceImpl",$.ig.OlapDataSource.prototype.$type)},true);$.ig.util.defType("IFlatDataProviderFactory","Object",{$type:new $.ig.Type("IFlatDataProviderFactory",null,[$.ig.IOlapDataProviderFactory.prototype.$type])},true);$.ig.util.defType("DefaultFlatDataProviderFactory","Object",{b:null,a:null,init:function(a,b){$.ig.Object.prototype.init.call(this);this.b=a;this.a=b},createDataProvider:function(){return new $.ig.FlatDataProvider(this.b,this.a)},$type:new $.ig.Type("DefaultFlatDataProviderFactory",$.ig.Object.prototype.$type,[$.ig.IFlatDataProviderFactory.prototype.$type])},true);$.ig.util.defType("FlatDataSourceOptions","DataSourceBaseOptions",{init:function(){$.ig.DataSourceBaseOptions.prototype.init.call(this)},_itemsSource:null,itemsSource:function(value){if(arguments.length===1){this._itemsSource=value;return value}else{return this._itemsSource}},_dataSourceMetadata:null,dataSourceMetadata:function(value){if(arguments.length===1){this._dataSourceMetadata=value;return value}else{return this._dataSourceMetadata}},_dataProviderFactory:null,dataProviderFactory:function(value){if(arguments.length===1){this._dataProviderFactory=value;return value}else{return this._dataProviderFactory}},$type:new $.ig.Type("FlatDataSourceOptions",$.ig.DataSourceBaseOptions.prototype.$type)},true);$.ig.util.defType("OlapFlatDataSource","DataSourceBase",{a5:null,init:function(a){this.a5=null;$.ig.DataSourceBase.prototype.init.call(this);if(a==null){throw new $.ig.ArgumentNullException("options")}this.a5=a;this.a7(this.a5)},a3:function(a){var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"metadata");if(b==null){throw new $.ig.InvalidOperationException(1,"metadata is null or undefined.")}var c=new $.ig.DataSourceMetadata;var d=this.a2(b);c.a(d);return c},a2:function(a){var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"cube");if(b==null){throw new $.ig.InvalidOperationException(1,"metadata.cube is null or undefined.")}var c=new $.ig.CubeMetadata;c.e($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(b,"name"));if(String.isNullOrEmpty(c.e())){throw new $.ig.InvalidOperationException(1,"cube.name is null, empty or undefined")}c.c($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(b,"caption"));if(String.isNullOrEmpty(c.c())){c.c(c.e())}c.b(this.a4(b));c.d($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(b,"description"));c.a(this.ay(b));return c},a4:function(a){var $self=this;var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"measuresDimension");if(b==null){return null}var c=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(b,"caption");var d=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(b,"name");var e=function(){var $ret=new $.ig.MeasuresDimensionMetadata;$ret.b(c);$ret.c(d);return $ret}();e.a($self.a1(b));return e},ay:function(a){var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"dimensions");if(b==null){return null}var c=new $.ig.ArrayListCollection$1($.ig.DimensionMetadata.prototype.$type);for(var d=0;d<b.length;d++){var e=new $.ig.DimensionMetadata;c.add(e);var f=b[d];e.e($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"name"));if(String.isNullOrEmpty(e.e())){throw new $.ig.InvalidOperationException(1,"dimension.name is null, empty or undefined")}e.b($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"caption"));if(String.isNullOrEmpty(e.b())){e.b(e.e())}e.c($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"defaultHierarchy"));e.a(this.az(f));e.d($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"description"))}return c},a1:function(a){var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"measures");if(b==null){return null}var c=new $.ig.ArrayListCollection$1($.ig.MeasureMetadata.prototype.$type);for(var d=0;d<b.length;d++){var e=new $.ig.MeasureMetadata;c.add(e);var f=b[d];e.f($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"name"));if(String.isNullOrEmpty(e.f())){throw new $.ig.InvalidOperationException(1,"measure.name is null, empty or undefined")}e.e($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"caption"));if(String.isNullOrEmpty(e.e())){e.e(e.f())}e.d($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"displayFormat"));e.c($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"displayFolder"));e.b($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"aggregator"));if(e.b()==null){throw new $.ig.InvalidOperationException(1,"aggregator is null or undefined for measureMetadata: "+e.f())}}return c},az:function(a){var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"hierarchies");if(b==null){return null}var c=new $.ig.ArrayListCollection$1($.ig.HierarchyMetadata.prototype.$type);for(var d=0;d<b.length;d++){var e=new $.ig.HierarchyMetadata;c.add(e);var f=b[d];e.e($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"name"));if(String.isNullOrEmpty(e.e())){throw new $.ig.InvalidOperationException(1,"hierarchy.hierarchyName is null, empty or undefined")}e.b($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"caption"));if(String.isNullOrEmpty(e.b())){e.b(e.e())}e.d($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"displayFolder"));e.a(this.a0(f));if(e.a()==null||e.a().count()==0){throw new $.ig.InvalidOperationException(1,"levelKeys is null, empty or undefined for hierarchyMetadata: "+e.e())}}return c},a0:function(a){var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"levels");if(b==null){return null}var c=new $.ig.ArrayListCollection$1($.ig.LevelMetadata.prototype.$type);for(var d=0;d<b.length;d++){var e=new $.ig.LevelMetadata;c.add(e);var f=b[d];e.c($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"name"));if(String.isNullOrEmpty(e.c())){throw new $.ig.InvalidOperationException(1,"level.name is null, empty or undefined")}e.b($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"caption"));if(String.isNullOrEmpty(e.b())){e.b(e.c())}e.a($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"memberProvider"));if(e.a()==null){throw new $.ig.InvalidOperationException(1,"levelMetadata.memberProvider is null or undefined")}}return c},a7:function(a){var options_=a;var schema_=this.a6(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 $self=this;var a=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty($self.a5,"dataSource");if(a==null){throw new $.ig.InvalidOperationException(1,"dataSource is null or undefined")}var b=$self.a3($self.a5);var c=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty($self.a5,"measures");var d=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty($self.a5,"filters");var e=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty($self.a5,"columns");var f=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty($self.a5,"rows");var g=$.ig.jQueryUtils.prototype.getJavascriptObjectMethodResult(a,"data");var h=function(){var $ret=new $.ig.FlatDataSourceOptions;$ret.measures(c);$ret.filters(d);$ret.columns(e);$ret.rows(f);$ret.itemsSource(g);$ret.dataSourceMetadata(b);return $ret}();$self.dataSource(new $.ig.FlatDataSourceImpl(h))},a6: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",$.ig.DataSourceBase.prototype.$type)},true);$.ig.FlatDataProvider.prototype.ai="(All)";$.ig.util.extCopy($.ig.TaskExtensions,[[[$.ig.Task,$.ig.Task$1],["continueWithTask$1","continueWithTask$2"]]]);$.ig.util.extCopy($.ig.Queryable,[[[$.ig.SortedList$1,$.ig.IGrouping$2],["asQueryable"]]]);$.ig.util.extCopy($.ig.Enumerable,[[[$.ig.SortedList$1,$.ig.IGrouping$2],["where$1","where$11","select$2","selectMany$2","last$1","first$1","firstOrDefault$1","orderBy$2","orderByDescending$2","toList$1","concat$1","max","max$1","min","min$1","count$1","reverse$1","take$1","skip$1","any$1","contains$1","union$1","toArray$1","elementAt$1","sum","sum$1"]],[[$.ig.SortedList$1,$.ig.IGrouping$2],["ofType$1","cast$1"]]])})(jQuery);/*!@license
* Infragistics.Web.ClientUI Pivot Shared 14.1.20141.1020
*
* 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.draggable.js
*   jquery.ui.droppable.js
*   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},_isTouch:function(){var isTouch=typeof window.Modernizr==="object"&&window.Modernizr.touch===true;if(!isTouch||navigator.appVersion.indexOf("Windows")!==-1){if(navigator.appVersion.indexOf("Windows")!==-1&&navigator.appVersion.indexOf("Tablet")!==-1){return true}}return false},_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(this._isTouch()){return this._const.touchEvents[event]}return event},_makeDroppable:function(droppable){var $this=this;if(!this._isTouch()){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;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)){isValid=$this.options.customMoveValidation.call($this.element,$(this).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.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(!this._isTouch()){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");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");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(dimensionName===dataSource.metadataTree().children()[i].caption()){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},_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,noCancel,firstHierarchy,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--}if(this._isInstance(item,"MeasureList")){dataSource.setMeasureListLocation(targetRole);dataSource.setMeasureListIndex(targetIndex)}else{if(this._isInstance(item,"Hierarchy")){filterMembers=dataSource.getFilterMemberNames(name)}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":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)}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()).filterMember;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,parentOffset,elementSize,fddWidth,scrollTop;fdd=$(".ui-igpivot-filterdropdown");fm=$(".ui-igpivot-filterdropdown .ui-igpivot-filtermembers");fmHeight=fm.height();bcHeight=$(".ui-igpivot-filterdropdown-buttoncontainer").height();ddTop=parseInt(fdd.css("top").replace("px",""),10);bTop=$("body").css("top");if(bTop==="auto"){bTop=0}else{bTop=parseInt(bTop.replace("px",""),10)}bHeight=$("body").height();bBottom=bTop+bHeight;fmBottom=bBottom-bcHeight;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(event,ui){$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,binding,path,key){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};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){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 14.1.20141.1020
*
* 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.draggable.js
*	jquery.ui.droppable.js
*	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(!this._isTouch()){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(!this._isTouch()){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(!this._isTouch()){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(!this._isTouch()){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({nullText:$.ig.PivotDataSelector.locale.catalog,selectionChanged:function(evt,ui){$this._onCatalogSelected(ui.items[0].value)}},comboOptions));$("<input class='"+this.css.cube+"' />").appendTo(rootDiv).igCombo($.extend({nullText:$.ig.PivotDataSelector.locale.cube,selectionChanged:function(evt,ui){$this._onCubeSelected(ui.items[0].value)}},comboOptions));$("<input class='"+this.css.measureGroup+"' />").appendTo(rootDiv).igCombo($.extend({nullText:$.ig.PivotDataSelector.locale.measureGroup,selectionChanged:function(evt,ui){$this._onMeasureGroupSelected(ui.items[0].value)}},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&&!this._isTouch()){dropArea.droppable(droppableOptions)}tableColumn=$("<td></td>").appendTo(tableRow);dropArea=$("<ul class='"+this.css.dropArea+"' data-role='columns'></ul>").appendTo(tableColumn);if(!this.options.disableColumnsDropArea&&!this._isTouch()){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&&!this._isTouch()){dropArea.droppable(droppableOptions)}tableColumn=$("<td></td>").appendTo(tableRow);dropArea=$("<ul class='"+this.css.dropArea+"' data-role='measures'></ul>").appendTo(tableColumn);if(!this.options.disableMeasuresDropArea&&!this._isTouch()){dropArea.droppable(droppableOptions)}if(this._isTouch()){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,selected=null;if(t==="number"){selected=[{index:selectedItem}]}else if(t==="object"&&selectedItem!==null&&$.isFunction(selectedItem.name)){selected=[{value:selectedItem.name()}]}this.element.find(comboSelector).igCombo("option","dataSource",items).igCombo("option","selectedItems",selected)},_clearCombo:function(comboSelector){this.element.find(comboSelector).igCombo("option","dataSource",[])},_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(!this._isTouch()){items.draggable({appendTo:dragAndDropSettings.appendTo,containment:dragAndDropSettings.containment,zIndex:dragAndDropSettings.zIndex,cursorAt:this._const.dragCursorAt,revert:false,helper:function(event){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:null});$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:"14.1.20141.1020"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Pivot Grid 14.1.20141.1020
*
* 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.draggable.js
*	jquery.ui.droppable.js
*	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,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},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":$.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}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()&&!this._isTouch()){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,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});viewSettings={isParentInFrontForColumns:this.options.isParentInFrontForColumns,isParentInFrontForRows:this.options.isParentInFrontForRows,compactRowHeaders:this.options.compactRowHeaders,compactColumnHeaders:this.options.compactColumnHeaders};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},_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},_fillMatrixWithHeaderCells:function(matrix,headerCells){var expandIcon,collapseIcon,allowHeaderRowsSorting,sortHeaderRowsAscendingIcon,sortHeaderRowsDescendingIcon,headerCell,levelSortDirectionsMap,headerMarkup,text,rowSpan,columnSpan,rowIndex,columnIndex,axisName,tupleIndex,memberIndex,sortDirection,isExpandable,isExpanded,expandButtonMarkup,indent,i,css;if(!headerCells||headerCells.length===0){matrix.set(0,0,"<th class='ui-iggrid-header ui-widget-header'></th>");return}allowHeaderRowsSorting=this.options.allowHeaderRowsSorting;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>";sortHeaderRowsAscendingIcon="<span data-sortheader='asc' class='"+this.css.headerRowsAscending+"'></span>";sortHeaderRowsDescendingIcon="<span data-sortheader='desc' class='"+this.css.headerRowsDescending+"'></span>";levelSortDirectionsMap=this._tableView.appliedSortDirectionsMap();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();css="ui-iggrid-header ui-widget-header "+this.css.pivotGridHeader;headerMarkup="<th $$data-sortheader$$ "+"class='"+css+"' "+"title='"+text+"' "+"data-skip='true' "+"rowspan='"+rowSpan+"' "+"colspan='"+columnSpan+"' "+"data-axis='"+axisName+"' "+"data-tuple='"+tupleIndex+"' "+"data-member='"+memberIndex+"'>";if(isExpandable){indent=this.options.compactRowHeaders?this.options.compactRowHeaderIndentation*headerCell.levelNumber():0;expandButtonMarkup=isExpanded?collapseIcon:expandIcon;expandButtonMarkup=expandButtonMarkup.replace("$$margin$$",indent);headerMarkup+=expandButtonMarkup;headerMarkup+="<span class='ui-iggrid-headertext'>"+text+"</span>";if(isExpanded){sortDirection=levelSortDirectionsMap[headerCell.axisName()];if(sortDirection){sortDirection=sortDirection[headerCell.hierarchyNumber()];if(sortDirection){sortDirection=sortDirection[headerCell.levelNumber()]}}if(sortDirection==="ascending"){headerMarkup=headerMarkup.replace("$$data-sortheader$$","data-sortheader='ascending'");headerMarkup+=sortHeaderRowsAscendingIcon}else if(sortDirection==="descending"){headerMarkup=headerMarkup.replace("$$data-sortheader$$","data-sortheader='descending'");headerMarkup+=sortHeaderRowsDescendingIcon}else if(allowHeaderRowsSorting){headerMarkup=headerMarkup.replace("$$data-sortheader$$","data-sortheader=''")}}else{headerMarkup=headerMarkup.replace("$$data-sortheader$$","")}}else{indent=this.options.compactRowHeaders?this.options.compactRowHeaderIndentation*(headerCell.levelNumber()+1):0;text="<span class='ui-iggrid-headertext' style='margin-left:"+indent+"px;'>"+text+"</span>";headerMarkup+=text}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&&!this._isTouch()){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&&!this._isTouch()){dropArea.droppable(droppableOptions);if($("#"+id+"_columns_overlay").length<1){$("<div id='"+id+"_columns_overlay' data-role='columns' class='"+this.css.overlayDropArea+"'></div>").appendTo("body").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&&!this._isTouch()){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&&!this._isTouch()){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(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,ar=this.options.accessibilityRendering,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+"'"}if(ar){dstr+=" role='row'>"}else{dstr+=">"}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;if(ar){dstr+='<td role="gridcell" aria-describedby="'+this.key+'"'}else{dstr+="<td"}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)+">"+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(!this._isTouch()){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){$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,dataSource){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}}}},_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;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});if(this.options.allowHeaderRowsSorting){table.find("tbody th.ui-igpivotgrid-header[data-sortheader]").children(".ui-iggrid-headertext,.ui-iggrid-sortindicator").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&&!this._isTouch()){if($("#"+id+"_rows_overlay").length<1){$("<div id='"+id+"_rows_overlay' data-role='rows' class='"+this.css.overlayDropArea+"'></div>").appendTo("body").droppable(overlayDropAreaOptions)}}if(!this.options.disableMeasuresDropArea&&!this._isTouch()){if($("#"+id+"_measures_overlay").length<1){$("<div id='"+id+"_measures_overlay' data-role='measures' class='"+this.css.overlayDropArea+"'></div>").appendTo("body").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,rowsOverlayTop,rowsOverlayLeft,containerId,rowHeight,ht;firstColumnHeaderPosition=headersTable.find("th[data-axis]:first").position();columnHeadersHeight=0;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}ht=headersTable.find("tr").eq(1).find("th").eq(1);$("#"+id+"_columns_overlay").css({top:columnsOverlayTop,left:columnsOverlayLeft,width:ht.width()+2*(parseInt(ht.css("paddingLeft")[0].substr(0),10)+parseInt(ht.css("borderLeftWidth")[0].substr(0),10)),height:columnHeadersHeight,display:"block"});measuresArea=headersTable.find("tr").eq(1).find("th:first");rowHeadersWidth=measuresArea.width()+2*(parseInt(measuresArea.css("paddingLeft")[0].replace("px",""),10)+parseInt(measuresArea.css("borderLeftWidth")[0].replace("px",""),10));$("#"+id+"_rows_overlay").css({top:rowsOverlayTop,left:rowsOverlayLeft,width:rowHeadersWidth,height:dataTable[0].scrollHeight,display:"block"});$("#"+id+"_measures_overlay").css({top:rowsOverlayTop,left:rowsOverlayLeft+rowHeadersWidth,width:dataTable[0].scrollWidth-rowHeadersWidth,height:dataTable[0].scrollHeight,display:"block"})},_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._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(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);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,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:"14.1.20141.1020"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Pivot View 14.1.20141.1020
*
* 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.draggable.js
*	jquery.ui.droppable.js
*	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,compactRowHeaders:true,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(evt,ui){$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:"14.1.20141.1020"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Editors 14.1.20141.1020
*
* Copyright (c) 2011-2014 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
* jquery-1.4.4.js
* jquery.ui.core.js
* jquery.ui.widget.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(){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)}).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,foc=this._foc,v=this._validator;if(v&&(destroy||!o)){v.destroy();delete this._validator}else if(!v&&!destroy&&o&&foc&&foc.igValidator){o.element=this.element.find(":first-child");this._validator=foc.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||key==="swapDirection"||key==="vertical"||key==="focusable"){return this}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}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:"14.1.20141.1020"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI ToolbarButton 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 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")},_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:"14.1.20141.1020"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI ColorPicker 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 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"},_create:function(){var i,j,row,cols,rows,color,allColors=$.extend(true,[],this.options.colors),colorTableHtml='<ul class="color-table">';allColors.push(this.options.standardColors);rows=allColors.length;for(i=0;i<rows;i++){colorTableHtml+="<li><ul>";cols=allColors[i].length;for(j=0;j<cols;j++){colorTableHtml+='<li class="color-item"><a href="#"><span class="color" style="background-color: '+allColors[i][j]+';"></span></a></li>'}colorTableHtml+="</ul></li>"}colorTableHtml+="</ul>";this._colorTable=$(colorTableHtml).appendTo(this.element);$(".color-table > li:last ul").addClass(this.css.standardColorsRow)},_getColor:function($element){return $element.css("background-color")},_init:function(){this.element.addClass(this.css.baseClass);this._colorTable.children().first().addClass("color-table-first-row");this._bindEvents()},_bindEvents:function(){var self=this;this._colorTable.delegate("a","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("span.selected-color").removeClass("selected-color");if(target.is("a")){target=target.children()}target.addClass("selected-color")}});$.extend($.ui.igColorPicker,{version:"14.1.20141.1020"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI ColorPickerSplitButton 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 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"},_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))},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(e){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._setButtonColorIndicator(color);this.options.defaultColor=color;this.collapse()},_onDefaultButtonClick:function(e,ui){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)},destroy:function(){$.ui.igSplitButton.prototype.destroy.apply(this,arguments)}});$.extend($.ui.igColorPickerSplitButton,{version:"14.1.20141.1020"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Toolbar 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 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"},enableCheckboxes:{value:false},dropDownOnFocus:{value:true},selectedItems:{value:[{index:0}]},enableClearButton:{value:false},dataSource:{value:null},mode:{value:"dropdown"},dropDownAsChild:{value:true},focusOnSelect:{value:false}}},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",toolbarMouseDown:"toolbarMouseDown",toolbarCustomItemClick:"toolbarCustomItemClick",itemRemoved:"itemRemoved",itemAdded:"itemAdded",collapsing:"collapsing",collapsed:"collapsed",expanding:"expanding",expanded:"expanded",itemDisable:"itemDisable",itemEnabled:"itemEnabled"},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"},_id:function(id){return this.element[0].id+id},widget:function(){return this.element},_create:function(){var toolbar=this.options;this._tbHash={};for(j=0;j<toolbar.items.length;j++){if(!toolbar.items[j].type){toolbar.items[j].type="custom"}itemDescriptor=toolbar.items[j]=this._getToolbarItemDescriptor(toolbar.items[j]);this._tbHash={toolbarOpts:toolbar};this._tbHash.isExpanded=false;for(property in itemDescriptor.getProperties()){if(itemDescriptor.getProperties().hasOwnProperty(property)){if(this._tbHash===undefined){this._tbHash={}}this._tbHash[property]=itemDescriptor}}}this._render();this._createItems()},getToolbarHash:function(){return this._tbHash},_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);this.element.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=$('<span id="'+this._id("_toolbar_buttons")+'" style="display:inline-block"></span>').appendTo(this.element)},_onCollapse:function(e){var noCancel,event,cancelableEvent,options=this.options,width,self=this,visibility,opacity;if(!options.allowCollapsing){return}if(options.isExpanded){event="collapsed";cancelableEvent="collapsing";options.isExpanded=false;width=this.element.height();this.collapseBtn.attr("title",$.ig.Toolbar.locale.expandButtonTitle+" "+this.options.displayName).children(":first").switchClass(this.options.collapseButtonIcon,this.options.expandButtonIcon);visibility="hidden";opacity="0.0"}else{event="expanded";cancelableEvent="expanding";options.isExpanded=true;width=this._width;this.buttonsList.show();this.collapseBtn.attr("title",$.ig.Toolbar.locale.collapseButtonTitle+" "+this.options.displayName).children(":first").switchClass(this.options.expandButtonIcon,this.options.collapseButtonIcon);visibility="visible";opacity="1"}e.stopPropagation();noCancel=this._trigger(this.events[cancelableEvent],e,{owner:this,toolbarElement:this.element,toolbar:{}});if(noCancel){this.element.css({overflow:"hidden"});this.element.animate({width:width},300,null,function(){if(!options.isExpanded){self.buttonsList.hide()}self._trigger(self.events[event],e,{owner:self,toolbarElement:self.element,toolbar:{}})})}},_setOption:function(name,value){$.Widget.prototype._setOption.apply(this,arguments);switch(name){case"allowCollapsing":this.options.allowCollapsing=value;break;case"items":this._updateItems(value);break}},_isSelectedAction:function(el,props,itemOptionObj){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);continue}}},_updateItems:function(items){var options=this.options,updProps,i,j,scope,el,key;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]);continue}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)}},_spltBtnTooltipAction:function(el,props,itemOptionObj){},_comboSelectedItem:function(el,props,itemOptionObj){if(itemOptionObj!==undefined){itemOptionObj.selectedItems=[{value:props.value}]}else{el.igCombo("option","selectedItems",[{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){return}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));this.collapseBtn.bind("igtoolbarbuttonclick",$.proxy(this._onCollapse,this))},_onToolbarItemInteraction:function(e,ui){var selectedItemValue,targetWidget=$(e.target).parentsUntil(":ui-igToolbar").eq(-2),selectedItemIndex,triggeredEvent,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.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})},_onComboListItemClick:function(e,data){var toolbarItemIndex,toolbarItem;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].value,handler:toolbarItem.handler(),scope:toolbarItem.getProperty("scope"),itemProperties:toolbarItem.getProperties(),toolbarItem:data.owner,toolbarName:this.options.name})},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.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(this,"ui-state-active");item.igToolbarButton("options","isSelected",activated);this._trigger(this.events.itemActivated,{isActivated:activated})},deactivateAll:function(){this.buttonsList.find(".ui-igbutton.ui-state-active").removeClass("ui-state-active").igToolbarButton("option","isSelected",false)},_setCollapseExpandButtonIcon:function(){if(this.options.collapseButtonIcon){this.collapseBtn.switchClass("ui-icon-triangle-1-w",this.options.collapseButtonIcon)}},destroy:function(){$.Widget.prototype.destroy.apply(this,arguments);this.element.undelegate();this.element.unbind();delete this.buttonsList;delete this.collapseBtn;delete this.toolbarBody;this.element.remove()}});$.extend($.ui.igToolbar,{version:"14.1.20141.1020"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Tile Manager 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *  jquery-1.8.0.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	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",minimizedSelector:"> .ui-igtile-minimized",minimizeBtnSelector:"> .ig-tile-minimize-button",minimizeIconSelector:"> .ig-tile-minimize-icon",maximizedSelector:"> .ui-igtile-maximized",leftPanelSelector:"> .ui-igtilemanager-left",rightPanelSelector:"> .ui-igtilemanager-right",splitbarSelector:"> .ui-igsplitter-splitbar-vertical",innerContainerSelector:"> .ui-igtile-inner-container"},_createWidget:function(options,element){$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){var opt=this.options;this._options={fromMarkup:false,animating:false,useMaximizedTileIndex:false,tiles:null,maximizedTile:null,leftPanel:null,rightPanel:null,rightPanelWidth:0,gridLayout:null,layoutManagerElement: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()}this._attachEvents()},_setOption:function(option,value){if(this.options[option]===value){return}var self=this,_opt=this._options,animationDuration=this.options.animationDuration,glOption;$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"dataSource":this.dataBind();break;case"dataSourceUrl":this.dataBind();break;case"width":this.options.animationDuration=0;if(!_opt.useMaximizedTileIndex){this.minimize()}this.element.width(this.options.width);this.reflow(true);this.options.animationDuration=animationDuration;break;case"height":this.options.animationDuration=0;if(!_opt.useMaximizedTileIndex){this.minimize()}this.element.height(this.options.height);this.reflow(true);this.options.animationDuration=animationDuration;break;case"columnWidth":case"columnHeight":case"cols":case"rows":case"marginLeft":case"marginTop":case"rearrangeItems":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)}_opt.layoutManagerElement.igLayoutManager("option","items",this.options.items);_opt.gridLayout=this.layoutManager()._opt.gridLayout;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,null)}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,null)}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,null)}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.find(this._selectors.splitbarSelector).removeClass(this.css.visibilityHidden)}else{this.element.find(this._selectors.splitbarSelector).addClass(this.css.visibilityHidden)}break;case"animationDuration":this.layoutManager().options.gridLayout.animationDuration=value;break;default:break}},_initFromMarkup:function(){var tiles;if(this.element.children(this.options.tileSelector).length>0){tiles=this.element.children(this.options.tileSelector);this.element.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,destroyItems:false,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(event,ui){_opt.leftPanel.removeClass(self.css.overflowHidden);_opt.tiles=$(this).data("igLayoutManager")._opt.gridLayout.elements;self._triggerRendered()},internalResizing:function(event,ui){if(_opt.maximizedTile){return false}},internalResized:function(event,ui){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,destroyItems:false,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(event,ui){self.element.removeClass(self.css.overflowHidden);_opt.tiles=$(this).data("igLayoutManager")._opt.gridLayout.elements;self._triggerRendered()}}));_opt.maximizedTile=_opt.tiles.filter("[data-index="+opt.maximizedTileIndex+"]")}_opt.gridLayout=this.layoutManager()._opt.gridLayout}},_toMaximizedState:function(tile){var innerContainer=tile.find(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{if(this.options.maximizedState){innerContainer.children().not(this.options.maximizedState).addClass(this.css.hidden);innerContainer.find(this.options.maximizedState+", "+this._selectors.minimizeBtnSelector).removeClass(this.css.hidden)}else{innerContainer.children().removeClass(this.css.hidden)}}},_toMinimizedState:function(tile){var innerContainer=tile.find(this._selectors.innerContainerSelector);tile.removeClass(this.css.maximized).addClass(this.css.minimized);if(!this._options.fromMarkup){innerContainer.html(this._renderMinimizedState(tile.attr("data-index")))}else{if(this.options.minimizedState){innerContainer.children().not(this.options.minimizedState).addClass(this.css.hidden);innerContainer.find(this.options.minimizedState).removeClass(this.css.hidden)}else{innerContainer.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.find(this._selectors.leftPanelSelector).children().appendTo(this.element);this.element.find(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%"}],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,null)}_opt.rightPanelWidth=rightPanelWidth}});this._hideSplitterElements()},_attachEvents:function(){var self=this,_opt=this._options,minimizeBtnSelector=".ig-tile-minimize-button",minimizedTileSelector=".ui-igtile-minimized",splitter=this.splitter(),elHandlers=_opt.elementHandlers,noCancel;elHandlers.minimizedTileClick=function(event){var target=$(event.target),tileToMaximize=$(this);self._stopEventPropagation(event);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,event)}else{_opt.animating=false}}};elHandlers.miminimizedTileMouseOver=function(event){self._stopEventPropagation(event);if(!(_opt.animating||splitter&&splitter._isDrag)){$(this).addClass(self.css.hoverClass)}};elHandlers.minimizedTileMouseOut=function(event){self._stopEventPropagation(event);$(this).removeClass(self.css.hoverClass)};elHandlers.minimizeBtnClick=function(event){self._stopEventPropagation(event);if(!_opt.animating){_opt.animating=true;noCancel=self._triggerTileMinimizing(event,_opt.maximizedTile);if(noCancel){self.minimize(event)}else{_opt.animating=false}}};elHandlers.minimizeBtnMouseOver=function(event){self._stopEventPropagation(event);if(!(_opt.animating||splitter&&splitter._isDrag)){$(this).find(self._selectors.minimizeIconSelector).addClass(self.css.hoverClass)}};elHandlers.minimizeBtnMouseOut=function(event){self._stopEventPropagation(event);$(this).find(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 this.options.rightPanelTilesWidth||this._options.gridLayout.columnWidth},_getRightPanelTilesHeight:function(){return this.options.rightPanelTilesHeight||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.find(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,callback){var self=this,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;tiles.each(function(index,element){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,opt.animationDuration,function(){if(containerSwap){tile.css({left:tileLeft,top:tileTop}).appendTo(_opt.rightPanel)}if(callback){callback.apply(this)}})})},_hideSplitterElements:function(){var _opt=this._options;_opt.rightPanel.addClass(this.css.hidden+" "+this.css.splitterNoScroll);this.element.find(this._selectors.splitbarSelector).addClass(this.css.hidden);_opt.leftPanel.width("100%");if(!this.options.showSplitter){this.element.find(this._selectors.splitbarSelector).addClass(this.css.visibilityHidden)}},_showSplitterElements:function(){this._options.rightPanel.removeClass(this.css.hidden+" "+this.css.splitterNoScroll);this.element.find(this._selectors.splitbarSelector).removeClass(this.css.hidden)},_toMaximizedView:function(tileToMaximize,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,null);this._maximizeTile(tileToMaximize,event)},_maximizedTileSwap:function(tileToMaximize,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,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,null);tileToMaximize.css({left:"+="+rightPanelOffset,top:"-="+_opt.rightPanel.scrollTop()}).appendTo(_opt.leftPanel);this._maximizeTile(tileToMaximize,event)},_maximizeTile:function(tileToMaximize,event){var self=this,_opt=this._options,mt=_opt.gridLayout.marginTop,innerContainer=tileToMaximize.find(this._selectors.innerContainerSelector);this._toMaximizedState(tileToMaximize);innerContainer.addClass(this.css.overflowHidden);tileToMaximize.animate({width:"100%",height:this.element.height()-2*mt,top:mt,left:0},this.options.animationDuration,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,event){var itemData,i,self=this,_opt=this._options,animDuration=this.options.animationDuration,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(){var lmGridLayout=self.layoutManager()._opt.gridLayout;swapTilesInConfig(lmGridLayout.items);swapTilesInConfig(lmGridLayout.sortedItems);_opt.maximizedTile=tileToMaximize;_opt.animating=false;if(event){self._triggerTileMaximized(event,tileToMaximize)}})},maximize:function(tileToMaximize,event){var _opt=this._options;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,event)}else{this._maximizedTileSwap(tileToMaximize,event)}}else{this._maximizeTileWithCustomIndex(tileToMaximize,event)}},minimize:function(event){var self=this,_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(index,element){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,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,event){this.layoutManager().reflow(forceReflow,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(index){var tile=$(this);tile.children().removeClass(self.css.innerContainer).appendTo(self.element).find("."+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=".ig-tile-minimize-button",minimizedTileSelector=".ui-igtile-minimized";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)},destroy:function(){$.Widget.prototype.destroy.apply(this,arguments);this.element.removeClass(this.css.container);this._destroyTiles();this._removeEventHandlers();return this}});$.extend($.ui.igTileManager,{version:"14.1.20141.1020"})})(jQuery);/*!@license
	* Infragistics.Web.ClientUI jQuery File Upload 14.1.20141.1020
	*
	* Copyright (c) 2011-2014 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($(document.body));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:"14.1.20141.1020"});$.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},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,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},events:{fileSelecting:"fileSelecting",fileSelected:"fileSelected",fileUploading:"fileUploading",fileUploaded:"fileUploaded",fileUploadAborted:"fileUploadAborted",cancelAllClicked:"cancelAllClicked",onError:"onError"},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.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();this._docLeave(e);if(isInit){this._initBrowserFileSelect(e,data)}else{this._onBrowseButtonFileSelected(e,false,data)}return false},_docEnter:function(e){clearTimeout(this._doc_leave_timer);e.preventDefault();return false},_docOver:function(e){clearTimeout(this._doc_leave_timer);e.preventDefault();return false},_docLeave:function(e){var self=this;this._doc_leave_timer=setTimeout(function(){self._docLeave(e)},200)},_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)===false){isCancelEvent=true}return!isCancelEvent}})},_initBrowserFileSelect:function(event,data){var countFiles=1,filePicker;if(!data||!data.files||data.files.length===0){filePicker=$("#"+this._id("_ibb_fp"));if(this._validateFileExtension(filePicker[0].value,true)===false){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)===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,fileData=this.fileInfoData,o=self.options,countFiles=1;if(data&&data.files&&data.files.length>=1){countFiles=data.files.length}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===fileData.countTotalFiles+countFiles){self._disableBrowseButton(true)}if(o.mode==="single"){if(fileData.iframe.ids.length===0){self._removeSingleUpload(fileData.lastId);if(self._attachIframe(event,isInitBrowseButton,fileData.files)===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,file=this.fileInfoData.filesInfo[fileId].file,key=this.fileInfoData.filesInfo[fileId].key,cid=o.controlId,upload=xhr.upload,uploadUrl=o.uploadUrl+"?key="+key+"&cid="+cid+"&multiple=true";xhr.open("POST",uploadUrl);xhr.withCredentials="true";formData.append(this._id("_frm",fileId)+"_if",file);upload.addEventListener("progress",function(e){self._html5progress(e,fileId)},false);upload.addEventListener("error",function(e){self._getFileStatus(fileId,true)},false);this.fileInfoData.filesInfo[fileId].xhr=xhr;xhr.onload=function(e){if(xhr.status>=200&&xhr.status<=299){if(xhr.responseText){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}if(isFinish){singleFileData=this._getFileInfo(formNumber);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)}},_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,{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._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,{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).igButton("option","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});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,formId=self._id("_frm",formNumber),fileData=this.fileInfoData,isHTML5=false;if(formNumber===null||fileData.filesInfo[formNumber]===null||fileData.filesInfo[formNumber]===undefined){self._setError(self.options.errorMessageTryToStartNonExistingFile.replace("{0}",formNumber),self._const.clientSideErrorCode.startUpload,"clientside");return}if(fileData.filesInfo[formNumber].status!==self._const.status.NotStarted){return}isHTML5=fileData.filesInfo[formNumber].multipleFiles;if(isHTML5!==true){$("#"+formId).submit()}else{this._html5upload(formNumber)}self._addUploadingID(formNumber);self._removeIDBatch(formNumber);self._spbCheckModeButton();fileData.filesInfo[formNumber].status=self._const.status.Started;fileData.filesInfo[formNumber].innerStatus=self._const.status.Started;self._spbRenderProgress();if(this.options.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){var self=this,o=self.options,isFinishUpload=false,status="",bytesUploaded=0,fileSize=0,singleFileData=this._getFileInfo(formNumber),fileData=this.fileInfoData,key=self._getKey(formNumber),fileDetails=fileData.filesInfo[formNumber],fileName=fileDetails.path,error,isError,serverMessage="";if(key===null||key===undefined){return false}bytesUploaded=parseInt(data.bytesUploaded,10);status=parseInt(data.status,10);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(fileDetails.innerStatus===self._const.status.Canceled&&isError){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){fileData.fileSizeUploaded-=singleFileData.uploadedBytes;if(singleFileData.sizeBytes===0||singleFileData.sizeBytes===null){singleFileData.sizeBytes=fileSize;fileData.fileSizeTotal+=fileSize}else if(singleFileData.sizeBytes!==fileSize){fileSize=singleFileData.sizeBytes}if(isFinishUpload){fileData.countUploadingFiles++}if(bytesUploaded===0&&singleFileData.uploadedBytes>0){bytesUploaded=singleFileData.uploadedBytes}singleFileData.uploadedBytes=bytesUploaded;singleFileData.status=status;fileData.fileSizeUploaded+=singleFileData.uploadedBytes;self._spbRenderProgress();if(self._trigger(self.events.fileUploading,null,{fileId:formNumber,filePath:self._getOnlyFileName(fileName),totalSize:fileSize,uploadedBytes:bytesUploaded,fileStatus:status})===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,isNewFile);if(!isFinishUpload){return true}}else if(status===self._const.status.NoSuchFile){if(fileDetails!==null&&fileDetails!==undefined&&fileDetails.checksNoSuchFile===0){fileDetails.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,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){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()}self._trigger(self.events.fileUploadAborted,null,{fileId:formNumber,filePath:self._getOnlyFileName(fileName),uploadedBytes:0,totalSize:totalSize,status:self._const.status.NotStarted});self._removeFileUpload(formNumber)}}},_onCancelUpload:function(formNumber){var 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)}self._trigger(self.events.fileUploadAborted,null,{fileId:formNumber,filePath:self._getOnlyFileName(fileName),uploadedBytes:bytesUploaded,totalSize:totalSize,status:self._const.status.Canceled});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,fileData=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}fileData.countTotalFiles--;singleFileInfo.status=self._const.status.Canceled;fileData.fileSizeUploaded-=singleFileInfo.uploadedBytes;fileData.fileSizeTotal-=singleFileInfo.sizeBytes;self._spbRenderProgress();if(o.mode==="multiple"){self._removeUploadingID(formNumber);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).igButton("option","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){var self=this,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}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){self._trigger(self.events.fileUploaded,null,{fileId:formNumber,filePath:originalFileName,totalSize:bytesUploaded});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()}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),fileData=this.fileInfoData,singleFileData=this._getFileInfo(formNumber);if(isNaN(fileSize)===true){return}singleProgressBar.data("totalSize",fileSize);if(singleFileData!==null){singleFileData.sizeBytes=fileSize;fileData.fileSizeTotal+=fileSize;self._spbRenderProgress()}self._renderStatus(formNumber,0,fileSize,false,false)},_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}).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")),summaryProgressBarLabel_1=$("#"+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);summaryProgressBarLabel_1.text(textSummaryProgressBarLabel)},_spbOnClickButton:function(event){var modes=this.summaryButtonModes,m=this.spbButtonMode;event.preventDefault();if(m===modes.cancel){this._trigger(this.events.cancelAllClicked,event);this.cancelAll()}else if(m===modes.startupload){this._spbSubmitAllButton()}},_spbSubmitAllButton:function(){this._submitAllFormsUpload();this._spbCheckModeButton()},_spbCheckModeButton:function(){var fileData=this.fileInfoData;if(this.options.autostartupload){if(fileData.pendingQueueIDs.length>0||fileData.uploadingIDs.length>0){this._spbSetCancelButton()}else{this._spbSetButtonDone()}}else{if(fileData.pendingQueueIDs.length===0&&fileData.uploadingIDs.length===0){if(fileData.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).igButton("option","title",$.ig.Upload.locale.titleSummaryProgressButtonDone).igButton("option","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).igButton("option","title",$.ig.Upload.locale.titleSummaryProgressButtonCancel).igButton("option","disabled",false)},_getFileInfo:function(length){var fid=this.fileInfoData.filesInfo[length];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(string_length){var chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",randomstring="",i,rnum;for(i=0;i<string_length;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;if(arrE.length===0){return true}ext=fileName.substring(fileName.lastIndexOf(".")+1);res=$.inArray(ext,arrE)>=0;if(callEvent===true&&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 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();this._trigger(this.events.onError,null,{errorCode:errorCode,errorMessage:message,errorType:errorType,serverMessage:serverMessage})},_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:"14.1.20141.1020"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Editors 14.1.20141.1020
*
* Copyright (c) 2011-2014 Infragistics Inc.
*
* http://www.infragistics.com/
* Depends on:
* jquery-1.4.4.js
* jquery.ui.core.js
* jquery.ui.widget.js

* Example to use:
*	<script type="text/javascript">
*	$(function () {
*		$('#text1').igValidator({ minLength: 3 });
*	});
*	</script>
*	<input id="text1" type="text" />
*/
(function($){var _id="=id",_cur=null,_submit={},_stop=function(e){try{e.preventDefault();e.stopPropagation()}catch(ignore){}},_fid=function(form,fid){var id=form.id;if(!id&&fid){form._fid=fid}return id||form._fid};$.widget("ui.igValidator",{options:{showIcon:null,animationShow:null,animationHide:null,enableTargetErrorCss:null,alignment:null,keepFocus:null,onchange:null,onblur:null,formSubmit:null,onsubmit:null,bodyAsParent:true,required:false,minLength:-1,maxLength:-1,min:null,max:null,regExp:null,checkboxesName:false,locale:null,errorLabel:null,element:null,theme:null,errorMessage:null},css:{label:"ui-igvalidator ui-widget ui-state-error ui-corner-all",icon:"ui-igvalidator-icon ui-icon ui-icon-alert",target:"ui-igvalidator-target"},locale:{defaultMessage:"Please fix this field",selectMessage:"Please select a value",rangeSelectMessage:"Please select no more than {0} and not less than {1} 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",regExpMessage:"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",rangeMessage:"Please enter a value between {0} and {1}",minMessage:"Please enter a value greater than or equal to {0}",maxMessage:"Please enter a value less than or equal to {0}"},events:{checkValue:null,validation:null,errorShowing:null,errorHiding:null,errorShown:null,errorHidden:null},_create:function(){var v,t,elem,o=this.options,me=this,def=$.ui.igValidator.defaults;for(v in o){if(o.hasOwnProperty(v)&&o[v]===null&&def[v]!==undefined){o[v]=def[v]}}elem=me.element;me._state=3;me._focTime=0;me._init0();t=elem[0].nodeName;if(t==="SELECT"){t=5}else{t=elem[0].type;if(t==="checkbox"){t=o.checkboxesName?6:4}else if(t==="radio"){t=6}else{t=0}}me._elem=t!==6?elem:$("[name="+elem[0].name+"]").map(function(){return this.form===elem[0].form?this:null});me._t=t;if(!o.ctl&&!o.combo){me._evts={keydown:function(e){v=e.keyCode;if(v<15||v>20){me._evt(e,v===9?null:me,v===9)}},change:function(e){me._evt(e,me)},cut:function(e){me._evt(e,me)},paste:function(e){me._evt(e,me)},beforecut:function(e){me._evt(e,me)},drop:function(e){me._evt(e,me)},dragend:function(e){me._evt(e,me)},blur:function(e){me._evt(e,me,1)}};me._elem.bind(me._evts);if(o.element){me._evtsE={mousedown:function(e){me._evt(e,me)},mouseup:function(e){me._evt(e)}};o.element.bind(me._evtsE)}}},_evt:function(e,me,blur){var o=this.options;if(blur&&!o.onblur||!blur&&!o.onchange||$.ig&&$.ig.util&&$.ig.util.evtButton(e)){return}if(me){setTimeout(function(){me.validate(e)},20)}else{this.validate(e)}},_loc:function(key,m){key+=m?"":"Message";var o=this.options,v=o.errorMessage||o[key]||(o.locale?o.locale[key]:null);v=v||($.ig&&$.ig.Validator&&$.ig.Validator.locale?$.ig.Validator.locale[key]:null);return v||this.locale[key]},_foc1:function(o){o=o.keepFocus;return o&&this._t!==6&&!(o.indexOf&&o.indexOf("n")===0)?o==="once"||o===1?1:2:null},_onTab:function(e){if(e&&e.keyCode===9&&this._foc1(this.options)===2){_stop(e);return 1}},_init0:function(end){var form,fid,obj,id=this._id,o=this.options;if(end){this._doError()}else{if(o.ctl){o.ctl._validator=this}}form=this.element[0].form;if(!form){return}fid=_fid(form,"fid");if(!id){id=this.element[0].id;if(!id){_id+=_id.length;id=_id}this._id=id}obj=_submit[fid];if(!end&&(o.onsubmit||o.formSubmit)){if(!form._ig_onsubmit&&o.onsubmit){form._ig_onsubmit=1;$(form).submit(function(e){var f=_submit[_fid(this)];if(f){f.validate(e)}})}if(!form._ig_formsubmit&&o.formSubmit){form._ig_formsubmit=form.submit;form.submit=function(){var f=_submit[_fid(this)];if(f&&f.validate()){return}if(this._ig_formsubmit){this._ig_formsubmit()}}}if(!obj){obj=_submit[fid]={ctls:{},validate:function(e){var i,inv=false,lbl=1,ctls=this.ctls;for(i in ctls){if(ctls.hasOwnProperty(i)&&ctls[i].validate(e,lbl)){inv=true;if(!$.ui.igValidator.defaults.showAllErrorsOnSubmit){lbl=2}}}if(e&&inv){_stop(e)}return inv}}}obj.ctls[id]=this}else if(obj&&obj.ctls&&obj.ctls[id]){delete obj.ctls[id]}},getLocaleOption:function(name){return this._loc(name,1)},isMessageDisplayed:function(){return this._state>6},isValidState:function(){return!(this._state>=6||this.validate(null,null,1))},hide:function(keepCss){this._doError(null,null,keepCss?5:6)},validate:function(e,submit,check){var v,v2,val,txt=null,mes="Length",t=this._t,len=-1,o=this.options,el=this.element;if(!el||el.closest("body").length===0){return}if(t>3){mes="Select";len=val=t===5?el[0].multiple?$("option:selected",el[0]).length:el[0].selectedIndex:this._elem.filter(":checked").length}else{val=el.hasClass("ui-igcombo-nulltext")?"":el.val();len=val.length}if(o.ctl){delete o.ctl._invPlus}v2={owner:this,message:this._loc("default"),value:o.ctl?o.ctl.value():val};if(!this._trigger("checkValue",e,v2)){if(o.ctl&&!check){o.ctl._invPlus=v2.message}return check?2:this._doError(v2.message,e,submit)}if(len===0){if(check){if(o.required){return 2}}else if(!o.required){return this._doError(null,e,submit)}}v=o.regExp;if(v&&len>0){if(!v.test){v=new RegExp(v.toString())}txt=v.test(val)?null:this._loc("regExp");if(o.ctl){o.ctl._invPlus=txt}}if(!txt&&o.required&&(len===0||!val)){txt=this._loc(t>4?"select":"required")}if(!txt){v=o.minLength;v2=o.maxLength;if(len>=0&&(v>len||v2>0&&v2<len)){if(v>0&&v2>0){txt=this._loc("range"+mes).replace("{0}",v2).replace("{1}",v)}else{txt=this._loc((v>0?"min":"max")+mes).replace("{0}",v>0?v:v2)}if(o.ctl){o.ctl._invPlus=txt}}}if(txt){return check?txt:this._doError(txt,e,submit)}if(o.ctl){v=o.ctl._doInvalid(null,9);v=v?v.message:null;return check?v:this._doError(v,e,submit)}v=(typeof o.min==="number"?1:0)+(typeof o.max==="number"?2:0);if(!txt&&t<2&&len>0&&v>0){val=parseFloat(val);if(isNaN(val)){txt=this._loc("number")}else if(v===3&&(val<o.min||val>o.max)){txt=this._loc("range").replace("{0}",o.min).replace("{1}",o.max)}else if(v===1&&val<o.min){txt=this._loc("min").replace("{0}",o.min)}else if(v===2&&val>o.max){txt=this._loc("max").replace("{0}",o.max)}}return check?txt:this._doError(txt,e,submit)},_xyCheck:function(stop){var shift,xyE,xy=this._xy;if(!xy){return}if(this._elem&&this._elem[0].offsetWidth){xyE=xy.e.offset();shift=xyE.left-xy.x;if(shift!==xy.x0){xy.x0=shift;this._dd.css("left",xy.xDD+shift+"px")}shift=xyE.top-xy.y;if(shift!==xy.y0){xy.y0=shift;this._dd.css("top",xy.yDD+shift+"px")}}if(stop||!xyE){delete this._xy;clearInterval(xy.i)}if(!xyE){this._doError()}},_doError:function(txt,e,submit){var marg,elem0,end,xy0,xy,arg,elem,val,ctl,align,same,aLbl,x0,y0,el,zi=1,me=this,css=me.css,x="left",y="top",state=me._state,show=txt,dd=me._lbl,o=me.options;if(!submit){submit=0}ctl=o.ctl;align=o.alignment==="bottom"?0:o.alignment==="left"?-1:1;if(!txt&&dd){txt=dd[0]._txt}if(state<6&&!show){return}same=dd&&dd[0]._txt===txt&&!me._changed;this._changed=null;if(show&&me._onTab(e)&&same){return 2}if(show&&same){if(state>5){if(_cur===me){me._focus(o,submit,e)}return 2}}if(!submit&&show&&_cur&&(new Date).getTime()-_cur._focTime<100){return 2}arg={owner:me,message:txt,invalid:!!show};if(submit<5&&!me._trigger("validation",e,arg)){return}me._state=show?6:1;elem=o.element||me.element;elem0=ctl?ctl._element:elem;if(o.enableTargetErrorCss){if(show){elem0.addClass(css.target)}else if(submit!==5){elem0.removeClass(css.target)}}if(submit===2){return 2}if(!me._trigger(show?"errorShowing":"errorHiding",e,arg)){return 1}if(!show&&!dd){return}txt=arg.message;me._state++;marg=!o.bodyAsParent;if(marg){x="marginLeft";y="marginTop"}aLbl=o.errorLabel;if(typeof aLbl==="string"){aLbl=$("body").find('[data-valmsg-for="'+aLbl+'"]').removeClass("field-validation-valid").addClass("field-validation-error")}if(aLbl&&(!aLbl.length||!aLbl.find)){aLbl=null}if(aLbl){dd=aLbl}else if(!dd){dd=me.element[0].id;if(dd){dd=' for="'+dd+'"'}dd=$("<label"+dd+"/>").addClass(css.label).css({position:"absolute",visibility:"hidden"});dd[0].unselectable="on";dd.html(txt);dd[0]._id=98;me._dd=o.theme?$("<span/>").addClass(o.theme).css("position","absolute").append(dd):dd;if(marg){MSApp.execUnsafeLocalFunction(function(){me._dd.prependTo(elem0.parent())})}else{MSApp.execUnsafeLocalFunction(function(){me._dd.appendTo($("body"))})}}me._lbl=dd;if(show){dd[0]._txt=txt;if(aLbl){dd.html(txt).show()}else{me._dd.css(x,"0px").css(y,"0px");if(o.showIcon){if(txt===" "||txt==="&nbsp;"){txt=""}txt='<span class="'+css.icon+'"></span><span style="display:inline-block;width:18px;"></span>'+txt}dd.html(txt);dd.css("width","auto").css("height","auto");dd[0]._width0=dd[0].offsetWidth;dd[0]._height0=dd[0].offsetHeight;me._width=Math.max(dd.width(),5);me._height=Math.max(dd.height(),10);if(o.showIcon){me._height=Math.max(dd.children()[0].offsetHeight,me._height)}}try{elem0.parentsUntil(document.body).add(elem0).add(elem).add(dd).each(function(){val=this.style?this.style.zIndex:0;val=val?parseInt(val,10):null;if(val&&!isNaN(val)&&val>zi){zi=val}})}catch(ignore){}dd.css("zIndex",zi);me._focTime=0;_cur=me}end=function(){if(show){dd.css("filter","")}else{if(aLbl){aLbl.html(" ").hide()}else{me._dd.remove()}me._dd=me._lbl=_cur=null}me._state++};if(show){me._focus(o,submit,e);val=o.animationShow;if(val<5){val=null}if(aLbl){dd.css("opacity",0).show()}else{dd.css({opacity:val?0:1,height:(val?0:me._height)+"px",width:Math.floor(me._width/(val&&align>=0?2:1))+"px",display:"",visibility:"visible"});el=ctl&&ctl._swap?me.element:elem;xy=el.offset();if(!marg){x0=xy.left;y0=xy.top}xy.top+=align?0:el.outerHeight();if(ctl&&ctl._swap){xy.left-=ctl._leftShift()}if(align){xy.left+=align<0?-dd[0].offsetWidth:elem0[0].offsetWidth}if(marg){xy0=dd.offset();xy.left-=xy0.left;xy.top-=xy0.top}else{me._xy={x0:0,y0:0,x:x0,y:y0,e:el,xDD:xy.left,yDD:xy.top,i:setInterval(function(){me._xyCheck()},300)}}me._dd.css(x,xy.left+"px").css(y,xy.top+"px")}if(val){dd.animate(aLbl?{opacity:1}:{opacity:1,height:me._height,width:me._width},val,null,end)}else{end()}me._trigger("errorShown",e,arg);return 2}me._xyCheck(true);val=o.animationHide;if(val<5){val=null}if(val){if(aLbl){dd.animate({opacity:0},val,null,end)}else{dd.animate({opacity:.6},Math.floor(val*.34)).animate({opacity:0,height:0,width:Math.floor(me._width/(align<0?1:2))},Math.floor(val*.66),null,end)}}else{end()}me._trigger("errorHidden",e,arg)},_focus:function(o,submit,e){var el=!submit&&this._foc1(o)?this.element:null;e=e&&e.keyCode!==9?e.type:"";if(el&&!(o.ctl&&o.ctl._fcs)&&(this._foc1(o)!==1||!this._focTime)&&e.indexOf("key")<0&&e.indexOf("mouse")<0){$.ui.igValidator._keepFoc=o.ctl;e=$.ui.igValidator._dd;if(e){e._doDrop()}this._focTime=(new Date).getTime();setTimeout(function(){try{el.focus()}catch(ignore){}},0)}},_setOption:function(key,val){if(this.options[key]===val){return this}$.Widget.prototype._setOption.apply(this,arguments);if(typeof val!=="function"&&key!=="locale"){this._init0()}return this},destroy:function(){if(!this._elem){return this}var o=this.options;if(!o.ctl){this._elem.unbind(this._evts);if(this._evtsE){o.element.unbind(this._evtsE)}}this._init0(1);o.element=o.ctl=this._evts=this._evtsE=this._elem=null;$.Widget.prototype.destroy.apply(this,arguments);return this}});$.ui.igValidator._act=function(editor,act){var d,f,v=$.ui.igValidator;if(!v){return}d=v._dd;if(d&&(!d._ddOn||!(d._field||d.mainElem))){d=null;delete v._dd}f=v._keepFoc;if(f&&!f._field){f=null;delete v._keepFoc}if(act==="drop"){if(f&&f!==editor&&!f.validate()){return true}v._dd=editor;return}if(act==="hide"){if(d===editor){delete v._dd}return}if(!act&&f===editor){delete v._keepFoc}return f&&f!==editor};$.extend($.ui.igValidator,{version:"14.1.20141.1020"});$.ui.igValidator.defaults={showAllErrorsOnSubmit:false,showIcon:true,animationShow:300,animationHide:300,enableTargetErrorCss:true,alignment:"bottom",keepFocus:null,onchange:true,onblur:true,formSubmit:false,onsubmit:true}})(jQuery);/*!@license
 * Infragistics.Web.ClientUI HtmlEditor 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 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"},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:135,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:"1",action:"_comboSelectedItem"},fontSizeItemsListWidth:{value:100,action:"_comboDropDownListWidth"}}},{type:"combo",name:"formatsList",scope:null,handler:"_formatsListPlg",props:{formatsListComboWidth:{value:125,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:false,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.numbersButtonTitle,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){return $.map(this.options.toolbarSettings,function(item){if(item.name===name){return item}})[0]},_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._allToolbars=$.extend(true,[],this.defaultToolbars.concat(this.options.customToolbars));this._toolbars=this.element.find("#"+this._id("_toolbars"));this._initToolbars(this.options,this._toolbars,this._allToolbars);this._setActiveToolbars();this._createWorkspace(content);this._domPathToolbar();this._resizeWorkspace();this._trigger(this.events.rendered,null,{owner:this})}},_resizeWorkspace:function(){var height=this.element.height();height-=$("#"+this._id("_toolbars")).outerHeight(true);height-=$(".ui-igbutton-viewsource").outerHeight(true);$("#"+this._id("_editor")).height(height);$("#"+this._id("_source")).height(height)},_init:function(){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>'})},_initFormatsListCombo:function(){var formatsListCombo=this._getToolbar("textToolbar").igToolbar("getItem","formatsList");formatsListCombo.igCombo("option","itemTemplate",'<${text} unselectable="on">${value}</${text}>')},_initFontSizeCombo:function(){var fontSizesCombo=this._getToolbar("textToolbar").igToolbar("getItem","fontSize");fontSizesCombo.igCombo("option",{itemTemplate:'<span unselectable="on">${value}</span>'})},_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)}$.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()}},_setActiveToolbars:function(){var self=this,o=this.options;$.each(o,function(name,value){if(self._toolbarsActiveState[name]){self._toolbarsActiveState[name].value=value;o[name]=value}})},_initToolbars:function(options,toolbarsHolder,allToolbars){var toolbar,i,toolbarName,showToolbar,property,settings;this._tbHash=[];for(i=0;i<allToolbars.length;i++){settings=this._getToolbarSettings(allToolbars[i].name);$.extend(allToolbars[i],settings);toolbar=$('<span id="'+this._id("_toolbars")+"_"+allToolbars[i].name+'"></span>').appendTo(toolbarsHolder).igToolbar(allToolbars[i]);this._tbHash[allToolbars[i].name]=toolbar.igToolbar("getToolbarHash");showToolbar=$.camelCase("show-"+allToolbars[i].name);this._toolbarsActiveState[showToolbar]={name:allToolbars[i].name,value:true};if(!this._isToolbarActive(allToolbars[i].name)){toolbar.hide().addClass("hidden")}}for(i=0;i<options.toolbarSettings.length;i++){for(property in options.toolbarSettings[i]){if(options.toolbarSettings[i].hasOwnProperty(property)){toolbarName=options.toolbarSettings[i].name;if(this._tbHash[toolbarName].toolbarOpts[property]!==undefined&&property!=="name"){this._tbHash[toolbarName].toolbarOpts[property]=options.toolbarSettings[i][property];continue}if(this._tbHash[toolbarName][property]===undefined||this._tbHash[toolbarName]===undefined){continue}this._tbHash[toolbarName][property].getProperty(property).value=options.toolbarSettings[i][property]}}}},_initialWorkspaceFormatting:function(){var options=this.options,i,toolbar,property,commands={isBold:"bold",isItalic:"italic",isUnderline:"underline",isStrikethrough:"strikethrough"};for(i=0;i<options.toolbarSettings.length;i++){toolbar=options.toolbarSettings[i];for(property in toolbar){if(toolbar.hasOwnProperty(property)&&commands.hasOwnProperty(property)){this._execCommand(commands[property])}}}},_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){this._selectionWrapperSaved.focus();this._selectionWrapperSaved.execCommand(name.toLowerCase(),args);this._onSelectionChange()},_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,KEYS={webKitIE:{CTRLZ:90,CTRLY:89},moz:{CTRLZ:90,CTRLY:89}};$(this.workspace.contentWindow.document).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(e){self._onSelectionChange()});$(this.workspace.contentWindow.document).bind("keydown",function(e){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})}self._onSelectionChange()});$(this.workspace.contentWindow.document).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()}})},_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(encodeURI(this.sourceWindow.val()))}},_viewSourcePlg:function(ui){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(encodeURI(workSpaceBody.html()));selectionCallback.call(this)})},_destroyPopovers:function(){var el=this.element[0];$(':data("igPopover")').each(function(){if($.contains(el,this)){$(this).igPopover("destroy")}})},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(encodeURI(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},contentEditable:function(){return this.workspace},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(e){if(!o.disabled){$(this).addClass("ui-state-hover")}}).mouseleave(function(e){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});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(item){},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({selectedItems:[{index:0}],enableClearButton:false,width:155});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.val()}).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(e){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(table){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,_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);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}}}},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)}},applyStyle:function(){},execCommand:function(name,args){var 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,startEl,endEl,p,isCommandSupported=this._isCommandSupportedByBrowser(name),shouldExit=false;if(this._isIeOld){range.select();range.execCommand(name,false,args)}else{p=$("<p><br /></p>",this._document);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._updateSelection(range);this._document.execCommand(name,false,args);shouldExit=true}else{startEl=$(range.startContainer);range.selectNodeContents(startEl[0])}if(shouldExit){return}if(startEl&&startEl.is("br")&&endEl&&endEl.is("br")){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,wholeElement){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();if(range.startOffset!==range.endOffset){range.deleteContents()}if(range.insertNode!==undefined){range.insertNode(newNode[0])}else if(range.pasteHTML!==undefined){range.pasteHTML(newNode[0].outerHTML)}},insertTable:function(table){var selItem=this.getSelectedItem(),br=$("<br>",this._document);if(selItem[0].nodeType===this.NODE._Document){this._range.selectNodeContents(selItem.find("body > p:first")[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=$(this._document.body).find(":not(br):first");if(this._isIeOld){this._document.body.focus();return}if(this._range.startContainer.nodeType!==this.NODE._Document&&!$(this._range.startContainer).is("body")){return}if(this._range.startContainer.nodeType===this.NODE._Text){this._document.body.focus();return}if(focusTarget.length===0){return}this._range.setStart(focusTarget[0],0);this._range.setEnd(focusTarget[0],0);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;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(!el.is("table")&&!el.is("td")){this._disableTableControls(true)}},_isBold:function(){return this._d.queryCommandState("bold")||this._computedStyles.fontWeight>=700},_isItalic:function(){return this._d.queryCommandState("italic")||this._computedStyles.fontStyle.toLowerCase()==="italic"},_isUnderlined:function(){return this._d.queryCommandState("underline")||this._computedStyles.textDecoration.toLowerCase().indexOf("underline")!==-1},_isLineThrough:function(){return this._d.queryCommandState("strikethrough")||this._computedStyles.textDecoration.toLowerCase().indexOf("line-through")!==-1},_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(){return this._computedStyles.fontFamily},_hasFontSize:function(){return this._computedStyles.fontSize},_onBold:function(el){this._toolbars.textToolbar.igToolbar("getItem","Bold").igToolbarButton("toggle")},_onItalic:function(el){this._toolbars.textToolbar.igToolbar("getItem","Italic").igToolbarButton("toggle")},_onUnderlined:function(el){this._toolbars.textToolbar.igToolbar("getItem","Underline").igToolbarButton("toggle")},_onLineThrough:function(el){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(el){var pxTbl={"11px":1,"13px":3,"16px":4,"19px":5,"18px":7,"24px":7},fontSizeUnits=this._d.queryCommandValue("fontsize")||pxTbl[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||"text",currentValue=values[combo.igCombo("selectedIndex")][dsValueKey],dataSourceValue;if(newValue===currentValue){return}for(i=0;i<values.length;i++){dataSourceValue=values[i][dsValueKey];if(newValue===dataSourceValue){combo.igCombo("selectedIndex",i);break}}},_resetToolbars:function(){$.each(this._toolbars,function(idx,el){$(el).igToolbar("deactivateAll")})}});$.extend($.ui.igHtmlEditor,{version:"14.1.20141.1020"})})(jQuery);/*!@license
	* Infragistics.Web.ClientUI jQuery HTML5 Video Player 14.1.20141.1020
	*
	* Copyright (c) 2011-2014 Infragistics Inc.
	*
	* http://www.infragistics.com/
	*
	* Depends on:
	*  jquery-1.4.2.js
	*	jquery.ui.core.js
	*	jquery.ui.widget.js
	*	modernizr.js
	*  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(){this.supportsVideo=this.supports_video();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=video.attr("autoplay");this._oldPreload=video.attr("preload");this._oldLoop=video.attr("loop");this._oldPoster=video.attr("poster");this._oldControls=video.attr("controls");this._oldSrc=video.attr("src");this._oldMuted=video[0].muted;this._oldVolume=video[0].volume;video.removeAttr("autoplay");video.removeAttr("preload");video.removeAttr("loop");video.removeAttr("poster");video.removeAttr("controls");video.removeAttr("src")},_restoreExistingVideoProperties:function(video){video.attr("autoplay",this._oldAutoPlay);video.attr("preload",this._oldPreload);video.attr("loop",this._oldLoop);video.attr("poster",this._oldPoster);video.attr("controls",this._oldControls);video.attr("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){video.attr("autoplay",true)}video.attr("preload","metadata");if(o.preload){video.attr("preload","auto")}if(o.browserControls){video.attr("controls",true)}if(o.loop){video.attr("loop",true)}if(o.posterUrl.length>0){video.attr("poster",o.posterUrl)}return video.appendTo(this.container)},_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;if(com.length>0){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();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){video.attr("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.supports_h264_baseline_video()&&video.data("mp4")!==undefined){video.attr("src",video.data("mp4"));detected=true}else if(this.supports_webm_video()&&video.data("webm")!==undefined){video.attr("src",video.data("webm"));detected=true}else if(this.supports_ogg_theora_video()){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(event){control._showWaitingIndicator()},seeked:function(event){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(event){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},supports_video:function(){return!!document.createElement("video").canPlayType},supports_h264_baseline_video:function(){if(!this.supports_video()){return false}var v=document.createElement("video");return v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')!==""},supports_ogg_theora_video:function(){if(!this.supports_video()){return false}var v=document.createElement("video");return v.canPlayType('video/ogg; codecs="theora, vorbis"')!==""},supports_webm_video:function(){if(!this.supports_video()){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:"14.1.20141.1020"})})(jQuery);(function($){$(document).ready(function(){var wm=$("#__ig_wm__").length>0?$("#__ig_wm__"):$('<div id="__ig_wm__"></div>').appendTo(document.body);wm.css({position:"fixed",bottom:0,right:0,zIndex:1e3}).addClass("ui-igtrialwatermark")})})(jQuery);