/* * Isomorphic SmartClient * Version SNAPSHOT_v10.1d_2015-04-30 (2015-04-30) * Copyright(c) 1998 and beyond Isomorphic Software, Inc. All rights reserved. * "SmartClient" is a trademark of Isomorphic Software, Inc. * * licensing@smartclient.com * * http://smartclient.com/license */ if(window.isc&&window.isc.module_Core&&!window.isc.module_DataBinding){isc.module_DataBinding=1;isc._moduleStart=isc._DataBinding_start=(isc.timestamp?isc.timestamp():new Date().getTime());if(isc._moduleEnd&&(!isc.Log||(isc.Log&&isc.Log.logIsDebugEnabled('loadTime')))){isc._pTM={message:'DataBinding load/parse time: '+(isc._moduleStart-isc._moduleEnd)+'ms',category:'loadTime'};if(isc.Log&&isc.Log.logDebug)isc.Log.logDebug(isc._pTM.message,'loadTime');else if(isc._preLog)isc._preLog[isc._preLog.length]=isc._pTM;else isc._preLog=[isc._pTM]}isc.definingFramework=true;if(window.isc&&isc.version!="SNAPSHOT_v10.1d_2015-04-30/LGPL Development Only"){isc.logWarn("SmartClient module version mismatch detected: This application is loading the core module from SmartClient version '"+isc.version+"' and additional modules from 'SNAPSHOT_v10.1d_2015-04-30/LGPL Development Only'. Mixing resources from different SmartClient packages is not supported and may lead to unpredictable behavior. If you are deploying resources from a single package you may need to clear your browser cache, or restart your browser."+(isc.Browser.isSGWT?" SmartGWT developers may also need to clear the gwt-unitCache and run a GWT Compile.":""))} isc.ClassFactory.defineClass("TextSettings");isc.A=isc.TextSettings;isc.A.DOUBLE="double";isc.A.BACKSLASH="backslash";isc.A=isc.TextSettings.getPrototype();isc.A.fieldList=null;isc.A.fieldSeparator=",";isc.A.lineSeparator=null;isc.A.escapingMode=isc.TextSettings.BACKSLASH;isc.A=isc.TextSettings.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.getEscapingModeEscapeChar=function isc_TextSettings_getEscapingModeEscapeChar(){switch(this.escapingMode){case isc.TextSettings.DOUBLE:return"\"";break;case isc.TextSettings.BACKSLASH:return"\\";break} return""});isc.B._maxIndex=isc.C+1;isc.ClassFactory.defineClass("TextExportSettings","TextSettings");isc.A=isc.TextExportSettings;isc.A.LEADING_SPACE="leadingSpace";isc.A.FORMULA="formula";isc.A=isc.TextExportSettings.getPrototype();isc.A.lineSeparator="\n";isc.A.quoteValues=true;isc.A.nullValueText="";isc.A.useDisplayValue=false;isc.A.forceText=null;isc.A.dateFormat=null;isc.A.dateTimeFormat=null;isc.A.timeFormat=null;isc.ClassFactory.defineClass("TextImportSettings","TextSettings");isc.A=isc.TextImportSettings;isc.A.$935=false;isc.A=isc.TextImportSettings.getPrototype();isc.A.hasHeaderLine=false;isc.A.trim=false;isc.A=isc.TextImportSettings.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.getSpecialCharactersRegExp=function isc_TextImportSettings_getSpecialCharactersRegExp(_1){var _2=this.lineSeparator?"\\"+this.lineSeparator:"(\r)?\n";_2+="|\\"+this.getEscapingModeEscapeChar()+"\"";_2+="|\\"+this.fieldSeparator;_2+="|\\\"";return new RegExp(_2,_1)},isc.A.removeUnescapedQuotes=function isc_TextImportSettings_removeUnescapedQuotes(_1){var _2=this.getEscapingModeEscapeChar();var _3=new RegExp("\\"+_2+"\"","g");var _4=_2=="\""?new RegExp("([^\"]|^)\"(?!\")","g"):new RegExp("\"\"|([^\\"+_2+"]|^)\"","g");return _1.replace(_4,"$1").replace(_3,"\"")},isc.A.addFinalLineSeparatorIfNotPresent=function isc_TextImportSettings_addFinalLineSeparatorIfNotPresent(_1){var _2=this.lineSeparator||"\n";var _3=new RegExp(_2+"$");if(!_1.match(_3,_1))_1+=_2;return _1},isc.A.parseTextAndApplyFunctions=function isc_TextImportSettings_parseTextAndApplyFunctions(_1,_2,_3){var _4=this.fieldSeparator;var _5=this.getEscapingModeEscapeChar()+"\"";var _6=this.getSpecialCharactersRegExp();var _7=0,_8=false;;for(var _9,_10=_1,_11=0;null!=(_9=_10.match(_6));_10=_10.substring(_12),_11+=_12){var _12=_9[0].length+_9.index;switch(_9[0]){case _5:break;case"\"":_8=!_8;break;default:if(_8)continue;var _13=_1.substring(_7,_11+_9.index);if(this.trim)_13=_13.trim();if(_13=="\"\""&&this.escapingMode==isc.TextSettings.DOUBLE){_13=""} _13=this.removeUnescapedQuotes(_13);_7=_11+_12;_2(_13);if(_9[0]!=_4){if(_3())_10=""} break}} return _1.substring(_7)});isc.B._maxIndex=isc.C+4;if(!isc.Comm)isc.defineClass("Comm");isc.A=isc.Comm;isc.A.XML_BACKREF_PREFIX="$$BACKREF$$:";isc.A.$36r=/^([_:A-Za-z])([_:.A-Za-z0-9]|-)*$/;isc.A.serializeBackrefs=true;isc.A=isc.Comm;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.xmlSerialize=function isc_c_Comm_xmlSerialize(_1,_2,_3){return isc.Comm.$ew(_1,_2,_3?"":null)},isc.A.$ew=function isc_c_Comm__xmlSerialize(_1,_2,_3,_4){if(isc.Browser.isSGWT&&window.SmartGWT.isNativeJavaObject(_2)){if(_2==null)_2=null;else{if(window.SmartGWT.warnOnSerializeError){window.SmartGWT.throwUnconvertibleObjectException(_2,window.SmartGWT.serializeErrorMessage)} _2=String.asSource(_2+"")}} var _5=_1!=null;if(!_4||!_4.objRefs){_4=isc.addProperties({},_4);_4.objRefs={obj:[],path:[]};if(!_4.objPath){if(_2&&_2.getID)_4.objPath=_2.getID();else _4.objPath=""} if(_1==null){if(isc.isA.Class(_2))_1=_2.getClassName();else if(isc.isAn.Array(_2))_1="Array";else if(isc.isA.Object(_2))_1=_2.$schemaId||"Object";else _1="ISC_Auto"}} if(_2==null){if(isc.Comm.xmlSchemaMode||!isc.Comm.$850){return isc.Comm.$ex(_1,"")}else{return isc.Comm.$ex(_1,null,"nil")}} if(isc.isA.String(_2)){return isc.Comm.$ex(_1,isc.makeXMLSafe(_2),(isc.Comm.xmlSchemaMode?"string":null))} if(isc.isA.Function(_2)){if(_2.iscAction)return isc.StringMethod.$41u(_2.iscAction);return null} if(_2==window){this.logWarn("Serializer encountered the window object at path: "+_4.objPath+" - returning null for this slot.");return null} if(isc.RPCManager.preserveTypes){if(isc.isA.Number(_2)||isc.isA.SpecialNumber(_2)){if(_2.toString().contains(".")) return isc.Comm.$ex(_1,_2,"double");return isc.Comm.$ex(_1,_2,"long")} if(isc.isA.Boolean(_2))return isc.Comm.$ex(_1,_2,"boolean")}else{if(isc.isA.Number(_2)||isNaN(_2)){return isc.Comm.$ex(_1,_2)} if(isc.isA.Boolean(_2))return isc.Comm.$ex(_1,_2)} var _6=isc.JSONEncoder.$zl(_4.objRefs,_2);if(_6!=null&&_4.objPath.contains(_6)){var _7=_4.objPath.substring(_6.length,_6.length+1);if(_7=="."||_7=="["||_7=="]"){if(this.serializeBackrefs){return isc.Comm.$36u(_1)+isc.Comm.XML_BACKREF_PREFIX+_6+isc.Comm.$36v(_1)} return isc.emptyString}} isc.JSONEncoder.$zm(_4.objRefs,_2,_4.objPath);if(isc.isA.Function(_2.$ew)){return _2.$ew(_1,null,null,_3,_4.objRefs,_4.objPath)}else if(isc.isA.Class(_2)){this.logWarn("Attempt to serialize class of type: "+_2.getClassName()+" at path: "+_4.objPath+" - returning null for this slot.");return null} var _8=_4.isRoot==false?false:true;if(isc.isAn.Array(_2)) return isc.Comm.$36s(_1,_2,_4.objPath,_4.objRefs,_3,_8);var _9;if(_2.getSerializeableFields){_9=_2.getSerializeableFields([],[])}else{_9=_2} return isc.Comm.$36t(_1,_9,_4.objPath,_4.objRefs,_3,_8)},isc.A.$36s=function isc_c_Comm__xmlSerializeArray(_1,_2,_3,_4,_5,_6){var _7=isc.Comm.$36u(_1,"List",null,null,null,_6);for(var i=0,_9=_2.length;i<_9;i++){var _10=_2[i];var _11={objRefs:_4,objPath:isc.JSONEncoder.$zp(_3,i),isRoot:false};_7=isc.StringBuffer.concat(_7,(_5!=null?isc.StringBuffer.concat("\r",_5,"\t"):""),isc.Comm.$ew((_10!=null?_10.$schemaId:null)||"elem",_10,(_5!=null?isc.StringBuffer.concat(_5,"\t"):null),_11))} _7=isc.StringBuffer.concat(_7,(_5!=null?isc.StringBuffer.concat("\r",_5):""),isc.Comm.$36v(_1));return _7},isc.A.$36w=function isc_c_Comm__isValidXMLIdentifier(_1){return isc.Comm.xmlSchemaMode||_1.match(this.$36r)},isc.A.$36t=function isc_c_Comm__xmlSerializeObject(_1,_2,_3,_4,_5,_6){if(isc.isAn.Instance(_2))_1=_2.getClassName();else if(_2._constructor&&_2._constructor!="AdvancedCriteria"&&_2._constructor!="RelativeDate")_1=_2._constructor;var _7=isc.Comm.$36u(_1,"Object",null,null,null,_6);_2=isc.JSONEncoder.$42b(_2);for(var _8 in _2){if(_8==null)continue;if(_8==isc.gwtRef||_8==isc.gwtModule)continue;if(_8.startsWith('$'))continue;var _9=_2[_8];if(isc.isA.Function(_9)&&!_9.iscAction)continue;var _10=_8.toString();var _11={objRefs:_4,objPath:isc.JSONEncoder.$zp(_3,_8),isRoot:false};_7=isc.StringBuffer.concat(_7,(_5!=null?isc.StringBuffer.concat("\r",_5,"\t"):""),isc.Comm.$ew(_10,_9,(_5!=null?isc.StringBuffer.concat(_5,"\t"):null),_11))} _7=isc.StringBuffer.concat(_7,(_5!=null?isc.StringBuffer.concat("\r",_5):""),isc.Comm.$36v(_1));return _7},isc.A.$36x=function isc_c_Comm__getPrefix(_1,_2){if(_1[_2]!=null){return _1[_2]}else{if(_1.$36y==null)_1.$36y=0;return(_1[_2]="ns"+_1.$36y++)}},isc.A.$36u=function isc_c_Comm__xmlOpenTag(_1,_2,_3,_4,_5,_6){var _7=isc.SB.create();var _8=_3!=null;if(_3!=null&&isc.isAn.Object(_4)){_8=false;_4=this.$36x(_4,_3)} var _9='';if(!this.$36w(_1)){_9=' _isc_name="'+isc.makeXMLSafe(_1)+'"';_1="Object"} if(_3){_4=_4||"schNS";_7.append("<",_4,":",_1);if(_8)_7.append(" xmlns:",_4,"=\"",_3,"\"")}else{_7.append("<",_1)} if(_9)_7.append(_9);if(_6&&!this.omitXSI){_7.append(" xmlns:xsi=\"http://www.w3.org/2000/10/XMLSchema-instance\"")} if(_2&&!this.omitXSI){_7.append(" xsi:type=\"xsd:",isc.makeXMLSafe(_2),"\"")} if(!_5)_7.append(">");return _7.release(false)},isc.A.$36v=function isc_c_Comm__xmlCloseTag(_1,_2,_3){if(_2!=null&&isc.isAn.Object(_3)){_3=this.$36x(_3,_2)} if(!this.$36w(_1))_1="Object";if(_2){_3=_3||"schNS";return isc.SB.concat("")}else{return isc.SB.concat("")}},isc.A.$ex=function isc_c_Comm__xmlValue(_1,_2,_3,_4,_5){if(_3=="base64Binary"){_2=""} if(_3=="nil"){return isc.Comm.$36u(_1,null,_4,_5,true)+" xsi:nil=\"true\"/>"} return isc.StringBuffer.concat(isc.Comm.$36u(_1,_3,_4,_5),_2,isc.Comm.$36v(_1,_4,_5))});isc.B._maxIndex=isc.C+9;isc.defineClass("XMLDoc").addMethods({addPropertiesOnCreate:false,init:function(_1,_2){this.nativeDoc=_1;this.namespaces=_2;this.documentElement=this.nativeDoc.documentElement},hasParseError:function(){if(isc.Browser.isIE){var _1=this.nativeDoc.parseError;return _1!=null&&_1!=0} return this.nativeDoc.documentElement&&this.nativeDoc.documentElement.tagName=="parsererror"},addNamespaces:function(_1){this.namespaces=this.$363(_1);if(this.$364){var _2=isc.xml.xmlResponses.find("ID",this.$364);if(_2)_2.xmlNamespaces=this.namespaces}},$363:function(_1){if(_1==null)return this.namespaces;if(this.namespaces==null)return _1;return isc.addProperties({},this.namespaces,_1)},selectNodes:function(_1,_2,_3){return isc.xml.selectNodes(this.nativeDoc,_1,this.$363(_2),_3)},selectString:function(_1,_2){return isc.xml.selectString(this.nativeDoc,_1,this.$363(_2))},selectNumber:function(_1,_2){return isc.xml.selectNumber(this.nativeDoc,_1,this.$363(_2))},selectScalar:function(_1,_2,_3){return isc.xml.selectScalar(this.nativeDoc,_1,this.$363(_2),_3)},selectScalarList:function(_1,_2){return isc.xml.selectScalarList(this.nativeDoc,_1,this.$363(_2))},getElementById:function(_1){return this.nativeDoc.getElementById(_1)},getElementsByTagName:function(_1){return this.nativeDoc.getElementsByTagName(_1)}});isc.XMLDoc.getPrototype().toString=function(){return"[XMLDoc <"+this.documentElement.tagName+">]"};isc.defineClass("XMLTools").addClassProperties({loadXML:function(_1,_2,_3){_3=_3||{};_3.operationType=_3.operationType||"loadXML";this.getXMLResponse(isc.addProperties({actionURL:_1,httpMethod:"GET",callback:_2},_3))},getXMLResponse:function(_1){_1.$37b=_1.callback;_1.callback={target:this,methodName:"$37c"};_1.httpMethod=_1.httpMethod||"POST";this.logInfo("loading XML from: "+_1.actionURL,"xmlComm");isc.rpc.sendProxied(_1)},xmlResponses:[],$365:0,trimEmptyXMLThreshold:100,$37c:function(_1,_2,_3){if(_1.isStructured&&!_3.isRestRequest){this.fireCallback(_3.$37b,"xmlDoc,xmlText,rpcResponse,rpcRequest",[null,null,_1,_3]);return} var _4=_3.isRestRequest?_1.results:_1.httpResponseText,_5=this.parseXML(_4);if(this.logIsInfoEnabled("xmlComm")){this.logInfo("XML reply with text: "+(this.logIsDebugEnabled("xmlComm")?_4:this.echoLeaf(_4)),"xmlComm")} var _6=false;if(_4==null||(_4.length0)){_1.status=-1}else{var _7=this.xmlResponses;if(this.logIsDebugEnabled("xmlComm")||(isc.Page.isLoaded()&&isc.debugMaster)) {var _8=this.$365++;_7.add({ID:_8,text:_4});if(_5)_5.$364=_8;if(_7.length>10)_7.shift();isc.debugMaster.call("window.updateCommWatcher",[_7])}else{_7.length=0}} this.fireCallback(_3.$37b,"xmlDoc,xmlText,rpcResponse,rpcRequest",[_5,_4,_1,_3])},useIEXMLHackaround:isc.Browser.isIE,disableIEXMLHackaround:function(){this.useIEXMLHackaround=false},xmlDOMConstructors:["MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"],mozAnchorBug:isc.Browser.isMoz&&(isc.Browser.geckoVersion<20080205)&&window.location.href.indexOf("#")!=-1,$167k:/xmlns:xml=(?:"http:\/\/www.w3.org\/XML\/1998\/namespace"|'http:\/\/www.w3.org\/XML\/1998\/namespace')/g,parseXML:function(_1,_2){if(_1==null)return;_1=this.trimXMLStart(_1);if(this.useIEXMLHackaround){if(this.$167k.test(_1.substring(0,1000))){_1=_1.replace(this.$167k,"")}} var _3;if(!isc.Browser.isIE){try{if((this.mozAnchorBug||this.useAnchorWorkaround)&&this.useAnchorWorkaround!==false) {var _4="";if(!isc.Page.isLoaded()){document.write(_4)}else{isc.Element.insertAdjacentHTML(document.getElementsByTagName("body")[0],"beforeEnd",_4)} var _5=document.getElementById("isc_parseXMLFrame");var _6=_5.contentWindow;window.isc.xmlSource=_1;_6.location.href="javascript:top.isc.parsedXML=new top.isc.XMLTools.getXMLParser().parseFromString(top.isc.xmlSource, 'text/xml')";_3=window.isc.parsedXML;isc.xmlSource=isc.parsedXML=null;_5.parentNode.removeChild(_5)}else{_3=this.getXMLParser().parseFromString(_1,"text/xml")}}catch(e){if(!_2)this.$37d(this.echo(e));return null} if(!_2&&_3.documentElement&&_3.documentElement.tagName=="parsererror") {this.$37d(_3.documentElement.textContent);return null} return isc.XMLDoc.create(_3)} _3=this.getXMLParser();if(!_3){this.$37a("XMLTools.parseXML()");return} _3.loadXML(_1);if(_3.parseError!=0){var _7=_3.parseError;if(!_2){this.$37d("\rReason: "+_7.reason+"Line number: "+_7.line+", character: "+_7.linepos+"\rLine contents: "+_7.srcText+(!isc.isA.emptyString(_7.url)?"\rSource URL: "+_7.url:""))} return null} return isc.XMLDoc.create(_3)},trimXMLStart:function(_1){if(_1.indexOf(""));if(_2){_1=_1.substring(_2[0].length)}} if(isc.Browser.isIE&&_1.indexOf(""));if(_2){_1=_1.substring(_2[0].length)}} return _1},$37d:function(_1,_2){this.logWarn("Error parsing XML: "+_1+(this.logIsDebugEnabled("parseXML")?"\rXML was:\r"+_2+"\rTrace:"+this.getStackTrace():""),"parseXML")},getXMLParser:function(){if(!isc.Browser.isIE){if(!this.$37e)this.$37e=new DOMParser();return this.$37e} var _1;if(this.$37f){_1=new ActiveXObject(this.$37f)}else{for(var i=0;i0)_23=_24} if(!_3||_17==null||_17.type==null||_17.type=="any"){if(this.logIsDebugEnabled(this.$45s)){this.logDebug("applying schemaless transform at: "+(_3?_3.ID:"[schemaless]")+"."+_21,"xmlToJS")} _22=this.toJS(_23,null,null,_4,_5)}else{var _25=_3.getSchema(_17.type);if(_25!=null){var _26=_17.propertiesOnly?{propertiesOnly:true}:_5;_22=this.toJS(_23,null,_25,_4,_26);if(this.logIsDebugEnabled(this.$45s)){this.logDebug("complexType field: "+this.echoLeaf(_17)+" got value: "+this.echoLeaf(_22),"xmlToJS")}}else{if(isc.isAn.Array(_23)){_22=[];for(var j=0;j<_23.length;j++){_22.add(_3.validateFieldValue(_17,this.getElementText(_23[j])))}}else{_22=_3.validateFieldValue(_17,this.getElementText(_23))} if(this.logIsDebugEnabled(this.$45s)){this.logDebug("simpleType field: "+this.echoLeaf(_17)+" got value: "+this.echoLeaf(_22),"xmlToJS")}}} if(_17&&_17.multiple){if(_22==null||isc.isA.emptyString(_22))_22=[];else if(!isc.isAn.Array(_22))_22=[_22]} if(_8[_21]){if(!isc.isAn.Array(_8[_21]))_8[_21]=[_8[_21]];if(_17&&_17.multiple&&isc.isAn.Array(_22)){_8[_21].addList(_22)}else{_8[_21].add(_22)}}else{_8[_21]=_22}} if(!_19){var _28=this.getElementText(_1),_29=_5.textContentProperty||(_3?_3.textContentProperty:"xmlTextContent");if(_3){_17=_3.getTextContentField();if(_17)_28=_3.validateFieldValue(_17,_28)} if(_28!=null&&!isc.isAn.emptyString(_28)){_8[_29]=_28}} if(_4){if(!_8._constructor&&_3&&(_3.instanceConstructor||_3.Constructor)){_8._constructor=_3.instanceConstructor||_3.Constructor} if(!_8.scClassName&&_3&&_3.scClassName){_8.scClassName=_3.scClassName} if(_8._constructor&&(_5==null||!_5.propertiesOnly)&&isc.ClassFactory.getClass(_8._constructor)){var _30=_8._constructor;delete _8._constructor;return isc.ClassFactory.newInstance(_30,_8)}} return _8},$45t:"type",$367:"xsi:type",getExplicitType:function(_1,_2){if(_1==null||this.isTextNode(_1))return;var _3=this.getXSIAttribute(_1,this.$45t);if(_3){if(_3.contains(isc.colon))_3=_3.substring(_3.indexOf(isc.colon)+1)}else if(_2){_3=_1.getAttribute("constructor");if(_3&&!isc.DS.get(_3))_3=null} return _3},$71v:"ref",isRefElement:function(_1){if(_1==null||this.isTextNode(_1)){return false} var _2=_1.getAttribute(this.$71v);if(_2&&_1.attributes.length==1&&!this.hasElementChildren(_1))return _2},toComponents:function(_1,_2){if(isc.DS.get("Canvas")==null){this.logWarn("Can't find schema for Canvas - make sure you've loaded component schema via jsp tag or by some other mechanism")} if(isc.isA.String(_1)){var _3=this.parseXML(_1,true);if(_3.hasParseError()){this.logWarn("xml failed to parse xmlDoc, wrapping in root node");_3=this.parseXML(""+_1+"")} _1=_3} return this.toJS(_1,null,null,true,_2)},$gy:"number",getFieldValue:function(_1,_2,_3,_4,_5){if(_1.ownerDocument==null)return _1[_2];_3=_3||(_4?_4.getField(_2):isc.emptyObject);try{var _6;if(_3.valueXPath){var _7=(_4?_4.getSchema(_3.type):isc.DS.get(_3.type));if(_7){var _8=isc.xml.selectNodes(_1,_3.valueXPath,_5),_9=isc.xml.toJS(_8,null,_7);if(!_3.multiple&&_9.length==1)_9=_9[0];return _9}else{_6=isc.xml.selectScalar(_1,_3.valueXPath,_5)}}else{_6=isc.xml.getXMLFieldValue(_1,_2)} _4=_4||isc.DS.get("Object");_6=_4.validateFieldValue(_3,_6);return _6}catch(e){this.logWarn("error getting value for field: '"+_2+(_3.valueXPath?"', valueXPath: '"+_3.valueXPath:"")+"' in record: "+this.echo(_1)+"\r: "+this.echo(e)+this.getStackTrace());return null}},getXMLFieldValue:function(_1,_2){var _3=_1.getAttribute(_2);if(_3!=null)return _3;var _4=_1.getElementsByTagName(_2)[0];if(_4==null)return null;return(isc.Browser.isIE?_4.text:_4.textContent)},$37g:function(_1){for(var _2 in _1){if(_2==this.$367)continue;return true} return false},$71f:"xmlns:",getAttributes:function(_1,_2,_3,_4,_5){_3=_3||{};var _6;if(_2){if(!isc.isAn.Array(_2))_2=[_2];for(var i=0;i<_2.length;i++){var _8=_2[i];if(_4&&_3[_8]!==_6)continue;var _9=_1.getAttribute(_8);if(_9==null||isc.isAn.emptyString(_9))continue;if(_5&&_5.getField(_8)){_9=_5.validateFieldValue(_5.getField(_8),_9)} _3[_8]=_9} return _3} var _10=_1.attributes;if(_10!=null){for(var i=0;i<_10.length;i++){var _11=_10[i],_8=_11.name;if(_8=="constructor")_8="_constructor";if(_4&&_3[_8]!==_6)continue;if(isc.startsWith(_8,this.$71f)&&_5&&_5.dropNamespaceDeclarations)continue;var _9=_11.value;if(_9==null||isc.isAn.emptyString(_9))continue;if(_5&&_5.getField(_8)){_9=_5.validateFieldValue(_5.getField(_8),_9)} _3[_8]=_9}} return _3},$45u:{nil:"xsi:nil","null":"xsi:null",type:"xsi:type"},xsiNamespaces:["http://www.w3.org/2001/XMLSchema-instance","http://www.w3.org/1999/XMLSchema-instance"],getXSIAttribute:function(_1,_2){var _3;if(isc.Browser.isOpera){for(var i=0;i4000)return _1.textContent;return _3},isTextNode:function(_1){if(_1==null)return false;var _2=_1.nodeType;return(_2==3||_2==4||_2==8)},hasElementChildren:function(_1){return this.firstElementChild(_1)!=null},firstElementChild:function(_1){if(_1==null||(_1.hasChildNodes!=null&&_1.hasChildNodes()==false))return null;var _2=_1.childNodes;if(!_2)return null;var _3=_2.length;for(var i=0;i<_3;i++){var _5=_2[i];if(!this.isTextNode(_5))return _5} return null},setAttributes:function(_1,_2){var _3;for(var _4 in _2){var _5=_2[_4];if(_5==null){_1.removeAttribute(_4);continue} if(isc.Browser.isIE&&(_5===true||_5===false)){_5=isc.emptyString+_5} _1.setAttribute(_4,_2[_4])}},$37h:function(_1,_2){var _3=isc.SB.create(),_4=_1.documentElement,_2=_2||isc.emptyObject,_5;if(!_2["default"]){_5=this.$45x(_4);if(_5)_3.append('xmlns:default="',_5,'" ')} var _6=_1.documentElement.attributes;for(var i=0;i<_6.length;i++){var _8=_6[i],_9=_8.prefix;if(_9=="xmlns"&&_9!=_8.name){if(_2[_8.baseName]!=null)continue;_3.append(_8.name,'="',_8.value,'" ')}} return _3.release(false)},$45x:function(_1){var _2=this.logIsDebugEnabled("xmlSelect");if((_1.prefix==null||isc.isAn.emptyString(_1.prefix))&&_1.namespaceURI) {if(_2){this.logWarn("using docElement ns, prefix: "+_1.prefix,"xmlSelect")} return _1.namespaceURI}else if(_1.firstChild){var _3 for(var i=0;i<_1.childNodes.length;i++){var _5=_1.childNodes[i];if(_5.nodeType==3)continue;var _6=_5.namespaceURI;if(!_6)break;if(_5.prefix==null||isc.isAn.emptyString(_5.prefix)){_3=_5.namespaceURI;break}} if(_3!=null){if(_2){this.logDebug("using default namespace detected on child: "+_3,"xmlSelect")}} if(_3==null&&_1.namespaceURI){_3=_1.namespaceURI;if(_2){this.logDebug("using document element's namespace as default namespace: "+_3,"xmlSelect")}} if(!_3)_3="http://openuri.org/defaultNamespace";return _3}},$ho:"[",selectObjects:function(_1,_2,_3){if(isc.contains("|")){var _4=_2.split(/|/),_5=[];for(var i=0;i<_4.length;i++){_5.addList(this.selectObjects(_4[i],_1))} return _5} var _7=isc.isAn.Array(_1)?_1:[_1];if(_2!=isc.slash){if(isc.startsWith(_2,isc.slash)){_2=_2.substring(1);if(isc.startsWith(_2,isc.slash)){this.logWarn("Selector \"\\\\\" does not supported. It was truncated.");_2=_2.substring(1)}} var _8=_2.split(/[\/@]/);_7=this.$37i(_8,_7,isc.slash)} if(_3&&_7.length<=1)return _7[0];return _7},$37i:function(_1,_2,_3){var _4=_1[0];_1=_1.length>1?_1.slice(1):null;if(_2==null)return null;var _5,_6=_4,_7=_4.indexOf(this.$ho);if(_7!=-1){_6=_4.substring(0,_7);_5=_4.substring(_7+1,_4.length-1)} var _8=[];for(var i=0;i<_2.length;i++){var _10=_2[i];if(_6!=isc.star){_10=_10[_6]}else{var _11=isc.getValues(_10);_10=[];for(var i=0;i<_11.length;i++){if(!isc.isAn.Array(_11[i]))_10.add(_11[i]);else _10.addList(_11[i])}} if(_10==null)continue;if(!isc.isAn.Array(_10)){_8.add(_10)}else{_8.addList(_10)}} if(_5){var _12=this.$37j(_8,_5);_8=_12} if(_1==null||_1.length==0)return _8;_3+=_4+isc.slash;return this.$37i(_1,_8,_3)},$37j:function(_1,_2){var _3=parseInt(_2);if(!isNaN(_3)){return[_1[_3-1]]} if(_2=="last()")return[_1.last()];var _4=_2.match(/^([a-zA-Z_0-9:\-\.\(\)]*)\s*(<|>|!=|=|<=|>=|)\s*(.*)$/),_5,_6,_7;if(_4==null){if(!_2.match(/^[a-zA-Z_0-9:\-\.]*$/)){this.logWarn("couldn't parse predicate expression: "+_2);return null} _5=_2}else{_5=_4[1],_6=_4[2],_7=_4[3]} if(_6=="=")_6="==";if(_7=="true()")_7=true;else if(_7=="false()")_7=false;if(_5=="position()")_5="position";var _8=isc.$aq("item,position","return "+(_5!="position"?"item.":"")+_5+(_6?_6+_7:""));var _9=[];for(var i=0;i<_1.length;i++){if(_8(_1[i],i+1))_9.add(_1[i])} return _9},selectNodes:function(_1,_2,_3,_4){if(isc.isA.String(_1)){_1=this.parseXML(_1)} if(isc.Browser.isSafari&&(isc.Browser.isApollo||(isc.Browser.safariVersion<522))) {this.$37a("XPath");return this.safariSelectNodes(_1,_2,_3,_4)} if(isc.isAn.XMLDoc(_1)){return _1.selectNodes(_2,_3,_4)} var _5=isc.timestamp();var _6=this.$37k(_1,_2,_3,_4);var _7=isc.timestamp();if(this.logIsInfoEnabled("xmlSelect")){this.logInfo("selectNodes: expression: "+_2+" returned "+this.echoLeaf(_6)+": "+(_7-_5)+"ms","xmlSelect")} return _6},safariSelectNodes:function(_1,_2,_3,_4){var _5=[];if(!_2){return null} var _6=_2.substring(_2.indexOf(":")+1);var _7;if(_6.endsWith("/*")){_7=true;_6=_6.substring(0,_6.indexOf("/*"))} var _8=_1.getElementsByTagName(_6);if(_7&&_8.length>0){var _9=_8[0];_8=_9.childNodes} for(var i=0;i<_8.length;i++){if(_8[i].nodeType==3)continue;_5.add(_8[i])} if(_7&&_5.length==1)_5=_5[0];return _5},$37l:function(_1,_2,_3){if(_1==null)return isc.emptyString;if(_2==null)_2=isc.getKeys(_1);var _4=isc.SB.create(),_3=(_3!=null?"\n"+_3:"");for(var i=0;i<_2.length;i++){var _6=_2[i];_4.append(_3," xmlns:",_6,'="',_1[_6],'"')} return _4.release(false)},$53z:function(_1){var _2=_1.lookupNamespaceURI("");if(isc.Browser.isSafari&&(_2==null||_2=="")){_2=_1.getAttribute("xmlns")} if(_2==null)_2=_1.namespaceURI;if(_2==null)_2="";return _2},$37k:function(_1,_2,_3,_4){if(_1==null)return;var _5=_1.ownerDocument;if(_5==null&&_1.documentElement){_5=_1;_1=_5.documentElement} if(_5==null)return null;if(isc.Browser.isIE){if(isc.Browser.version>5.5){_5.setProperty("SelectionLanguage","XPath");var _6=this.$37h(_5,_3);if(_3)_6+=this.$37l(_3);if(this.logIsDebugEnabled("xmlSelect")){this.logDebug("selectNodes: expression: "+_2+", using namespaces: "+_6,"xmlSelect")} _5.setProperty("SelectionNamespaces",_6)} if(_4)return _1.selectSingleNode(_2);var _7=_1.selectNodes(_2);return this.$37m(_7)} var _8=_5.createNSResolver(_5.documentElement),_9=this.$53z(_5.documentElement);if(this.logIsDebugEnabled("xmlSelect")){this.logDebug("Using namespaces: "+isc.echo(_3)+", defaultNamespace: '"+_9+"'","xmlSelect")} var _10=function(_12){if(_3&&_3[_12])return _3[_12];if(_12=="default")return _9;return _8.lookupNamespaceURI(_12)};var _11=_5.evaluate(_2,_1,_10,0,null);if(_4)return _11.iterateNext();return this.$37m(_11)},$37m:function(_1){var _2=[];if(isc.Browser.isIE||_1.iterateNext==null){for(var i=0;i<_1.length;i++){_2.add(_1.item(i))} }else{var _4;while(_4=_1.iterateNext()){_2.add(_4)} } return _2},getElementChildren:function(_1){var _2=[],_3=_1.childNodes;for(var i=0;i<_3.length;i++){var _5=_3[i];if(this.isTextNode(_5))continue;_2.add(_5)} return _2},selectString:function(_1,_2,_3){return this.selectScalar(_1,_2,_3)},selectNumber:function(_1,_2,_3){return this.selectScalar(_1,_2,_3,true)},selectScalar:function(_1,_2,_3,_4){if(isc.isA.String(_1))_1=this.parseXML(_1);if(isc.isAn.XMLDoc(_1))return _1.selectScalar(_2,_3,_4);var _5;if(isc.Browser.isSafari&&isc.Browser.isApollo||(isc.Browser.safariVersion<522)){var _6=_2.substring(_2.indexOf(":")+1);_5=_1.getElementsByTagName(_6)[0]}else{_5=this.selectNodes(_1,_2,_3,true)} if(_5==null)return null;var _7=this.getElementText(_5);return _4?parseInt(_7):_7},selectScalarList:function(_1,_2,_3){if(isc.isA.String(_1))_1=this.parseXML(_1);if(isc.isAn.XMLDoc(_1))return _1.selectScalarList(_2,_3);var _4=this.selectNodes(_1,_2,_3);for(var i=0;i<_4.length;i++){_4[i]=_4[i].nodeValue} return _4},transformNodes:function(_1,_2){if(isc.isAn.XMLDoc(_1))_1=_1.nativeDoc;if(isc.isAn.XMLDoc(_2))_2=_2.nativeDoc;if(isc.Browser.isIE){if(_1){return _1.transformNode(_2)} return null} var _3=new XSLTProcessor();_3.importStylesheet(_2);if(isc.Browser.isMoz&&this.mozAnchorBug&&isc.Browser.geckoVersion<20051107){var _4=document.implementation.createDocument("","test",null);var _5=_3.transformToFragment(_1,_4);return new XMLSerializer().serializeToString(_5)} if(_1){var _6=_3.transformToDocument(_1);return new XMLSerializer().serializeToString(_6)} return null},serializeToString:function(_1){this.$37n=this.$37n||isc.xml.parseXML('\r\r\r\r \r\r');return this.transformNodes(_1,this.$37n)},loadXMLSchema:function(_1,_2,_3,_4,_5){_3=_3||{};_3.operationType=_3.operationType||"loadXMLSchema";this.loadWSDL(_1,_2,_3,_4,_5,true)},loadWSDL:function(_1,_2,_3,_4,_5,_6){if(!this.$37o){var _7=isc.Page.getIsomorphicClientDir()+"schema/schemaTranslator.xsl";_7=_7.replace(/https?:\/\/[^\/]*\//,"/");this.$37o="LOADING";isc.xml.loadXML(_7,function(_9,_10,_11){isc.xml.logDebug("schema translator loaded");if(isc.Browser.isMoz&&_11.xmlHttpRequest&&_11.xmlHttpRequest.responseXML) {isc.xml.$37o=isc.XMLDoc.create(_11.xmlHttpRequest.responseXML)}else{isc.xml.$37o=_9} isc.xml.loadWSDL(_1,_2,_3,_4,_5,_6)});return} _3=_3||{};_3.operationType=_3.operationType||"loadWSDL";var _8={location:_1,callback:_2,autoLoadImports:_4,wsProperties:_5||{},returnSchemaSet:_6 };isc.xml.loadXML(_1,function(_9,_10,_11,_12){_8.rpcResponse=_11;_8.rpcRequest=_12;isc.xml.$37p(_9,_8)},_3)},loadWSDLFromXML:function(_1,_2,_3,_4,_5){if(isc.isA.String(_1))_1=isc.xml.parseXML(_1);this.$37p(_1,{callback:_2,autoLoadImports:_3,wsProperties:_4,returnSchemaSet:_5})},useClientXML:true,$37p:function(_1,_2){if(!isc.isAn.XMLDoc(this.$37o)){this.logInfo("deferred schema translator, schema translator not loaded","xmlComm");isc.Timer.setTimeout({methodName:"$37p",target:this,args:[_1,_2]});return} this.logInfo("transforming schema: "+this.echoLeaf(_1)+" with translator "+this.echoLeaf(this.$37o),"xmlComm");var _3=this.transformNodes(_1,this.$37o);if(this.logIsDebugEnabled("xmlComm")){this.logWarn("XML service definition is: \n"+_3)} var _4=_2.wsProperties,_5=_4.initiator;if(_4.captureXML){_4.xmlSource=_3;if(_5)_5.addImportXMLSource(_3,_2.location)} if(this.useClientXML){var _1=isc.xml.parseXML(_3),_6=_1?this.$37m(_1.documentElement.childNodes):null,_7=_6?this.toJS(_6,null,null,true):null ;this.$37q(_2);return} this.logInfo("about to call serverToJS with: "+this.echoLeaf(_3)+", callback: "+this.echo(_2.callback),"xmlComm");this.serverToJS(_3,function(){isc.Log.logWarn("serverToJS returned");isc.xml.$37q(_2)})},$37q:function(_1){var _2;if(_1.returnSchemaSet){_2=isc.SchemaSet.$37r}else{_2=isc.WebService.$37r||isc.SchemaSet.$37r} isc.WebService.$37r=isc.SchemaSet.$37r=null;if(!_2&&_1.rpcRequest.willHandleError==false)return;if(_2)_2.location=_1.location;if(_1.wsProperties&&_2)_2.setProperties(_1.wsProperties);var _3=(isc.isA.WebService(_2)?"service":"schemaSet")+",rpcRequest";var _4=[_2,_1.rpcRequest];if(_1.autoLoadImports&&_2&&_2.loadImports){var _5=this;_2.loadImports(function(){_5.$41k(_1.callback,_3,_4)})}else{this.$41k(_1.callback,_3,_4)}},$41k:function(_1,_2,_3){this.fireCallback(_1,_2,_3)},getCompleteSource:function(_1,_2,_3){var _4=_1.importSources;if(!_4)return"";_4=_4.getProperty("xmlText");_4.unshift(_1.xmlSource);_4=this.map("trimXMLStart",_4);var _5=_4.join("\n");if(_3){this.fireCallback(_2,"source",[_5]);return} this.toJSCode(_5,function(_6,_7){this.fireCallback(_2,"source",[_7])})}});isc.xml=isc.XML=isc.XMLTools;isc.defineClass("DataSource");isc.DS=isc.DataSource;isc.A=isc.DataSource;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.dataSourceObjectSuffix="DS";isc.A._dataSources={};isc.A.$54v={};isc.A.$54w={};isc.A.$532="element";isc.A.$45t="type";isc.A.$99u={};isc.A.$99v={};isc.A.$163n={};isc.A.TABLE="table";isc.A.VIEW="view";isc.A.loaderURL="[ISOMORPHIC]/DataSourceLoader";isc.A.deepCloneOnEdit=true;isc.A.DS_FN={};isc.A.$37t="=0;i--){var _4=_1.criteria[i],_5=false;if(!_4)_5=true;else{if(!_4.criteria){if(isc.isA.emptyObject(_4))_5=true}else{var _6=this.checkEmptyCriteria(_4,true);if(_6)_1.criteria[i]=_6;else _5=true} } if(_5)_1.criteria.removeAt(i)} } return _1 } ,isc.A.load=function isc_c_DataSource_load(_1,_2,_3,_4){if(!isc.isAn.Array(_1))_1=[_1];if(_1.length<=0){this.logWarn("No DataSource IDs passed in.");return} var _5=[];for(var i=0;i<_1.length;i++){if(!this.isLoaded(_1[i])||_3)_5.add(_1[i])} var _7=_5.join(","),_8=isc.DataSource.loaderURL+"?"+(_4?"loadParents=true&":"")+"dataSource="+_7,_9=_1;;if(_5.length>0){isc.RPCManager.send(null,function(_10,_11,_12){if(_10.httpResponseCode==404){isc.warn("The DataSourceLoader servlet is not installed.");return null} if(_4&&!_3)isc.DataSource.$92w=true;try{eval(_11)}catch(e){isc.logWarn("Encountered problems trying to load DataSources: "+isc.echoAll(e))} delete isc.DataSource.$92w;if(_2)this.fireCallback(_2,["dsID"],[_9])},{actionURL:_8,httpMethod:"GET",willHandleError:true } )}else{this.logWarn("DataSource(s) already loaded: "+_1.join(",")+"\nUse forceReload to reload such DataSources");if(_2)this.fireCallback(_2,["dsID"],[_9])} } ,isc.A.loadWithParents=function isc_c_DataSource_loadWithParents(_1,_2,_3){this.load(_1,_2,_3,true)} ,isc.A.getSortBy=function isc_c_DataSource_getSortBy(_1){if(!isc.isA.Array(_1))_1=[_1];var _2=[];for(var i=0;i<_1.length;i++){var _4=_1.get(i);_2.add((!Array.shouldSortAscending(_4.direction)?"-":"")+_4.property)} return _2} ,isc.A.getSortSpecifiers=function isc_c_DataSource_getSortSpecifiers(_1){if(!isc.isA.Array(_1))_1=[_1];var _2=[];for(var i=0;i<_1.length;i++){var _4=_1.get(i),_5="ascending",_6=_4 ;if(_4.substring(0,1)=="-"){_5="descending";_6=_4.substring(1)} _2.add({property:_6,direction:_5}) } return _2} ,isc.A.isAdvancedCriteria=function isc_c_DataSource_isAdvancedCriteria(_1,_2){if(!_1)return false;if(!_2){return(_1&&_1._constructor=="AdvancedCriteria")} if(!isc.isA.DataSource(_2))_2=this.get(_2);if(_1._constructor=="AdvancedCriteria")return true;var _3=false,_4=_2.getSearchOperator(_1.operator) ;if(_2.getField(_1.fieldName)&&_4){_3=true} else if(_2.getField("fieldName")||_2.getField("operator"))_3=false;else if(_1.fieldName&&(_1.operator&&_4)){_3=true} else if(_1.fieldName&&_1.value!=null&&_1.operator==null){_3=true}else{var _5;if(_1.operator!=_5){var _6=_4;if(_6!=null&&(_6.isAnd||_6.isOr)){_3=true} } } this.logInfo("Criteria object:"+this.echo(_1)+" not explicitly marked as AdvancedCriteria"+(_3?" but treating as Advanced based on format.":" - treating as SimpleCriteria."),"AdvancedCriteria");return _3} ,isc.A.copyCriteria=function isc_c_DataSource_copyCriteria(_1){if(_1==null)return null;return isc.clone(_1)} ,isc.A.getCriteriaFields=function isc_c_DataSource_getCriteriaFields(_1,_2,_3){if(_2&&!isc.isA.DataSource(_2))_2=this.get(_2);if(_3||(_2?_2.isAdvancedCriteria(_1):this.isAdvancedCriteria(_1)) ) {var _4=[];this.$74s(_1,_4);return _4} return isc.getKeys(_1)} ,isc.A.$74s=function isc_c_DataSource__getAdvancedCriteriaFields(_1,_2){if(_1.criteria){for(var i=0;i<_1.criteria.length;i++){isc.DS.$74s(_1.criteria[i],_2)} }else{_2.add(_1.fieldName)} } ,isc.A.cacheResponse=function isc_c_DataSource_cacheResponse(_1,_2){if(isc.Offline){var _3=isc.Offline.serialize(isc.Offline.trimRequest(_1));var _4=this.$78d.findIndex("requestKey",_3);if(_4!=-1){this.$78d.set(_4,_2)}else{if(this.$78d.length>=this.maxResponsesToCache){this.$78d.removeAt(0)} this.$78d.add({requestKey:_3,dsResponse:_2 })} } } ,isc.A.getCachedResponse=function isc_c_DataSource_getCachedResponse(_1){if(isc.Offline){var _2=isc.Offline.serialize(isc.Offline.trimRequest(_1));return this.$78d.find("requestKey",_2)} return null} ,isc.A.getPathValue=function isc_c_DataSource_getPathValue(_1,_2,_3,_4){return isc.Canvas.$70o(_2,_3,_1,null,true,_4)} ,isc.A.setPathValue=function isc_c_DataSource_setPathValue(_1,_2,_3,_4){isc.Canvas.$70n(_2,_3,_4,_1,null,true)} ,isc.A.getCombinedDataSourceFields=function isc_c_DataSource_getCombinedDataSourceFields(_1){var _2=[];for(var i=0;i<_1.length;i++){var _4=_1[i];if(isc.isA.String(_4))_4=isc.DataSource.get(_4);if(_4==null){this.logWarn("getCombinedDataSourceFields() - unable to locate dataSource:" +_1[i]);continue} var _5=_4.getID(),_6=isc.getKeys(_4.getFields());for(var j=0;j<_6.length;j++){_2[_2.length]=_5+"."+_6[j]} } return _2} ,isc.A.getFieldFromDataSources=function isc_c_DataSource_getFieldFromDataSources(_1,_2,_3){var _4=this.getDataSourceForField(_1,_2,_3);if(_4==null){if(!_3){this.logWarn("getFieldFromDataSources() - unable to find dataSource from combined field ID "+_1)} return null} var _5=_1.split("."),_6=_5[0],_7=_5[1];return _4.getField(_7)} ,isc.A.getDataSourceForField=function isc_c_DataSource_getDataSourceForField(_1,_2,_3){var _4=_1.split("."),_5=_4[0],_6=_4[1];if(_5==null||_6==null){if(!_3){this.logWarn("getDataSourceForField() passed invalid field ID:"+_1+". Expected format is to use dot-notation to indicate the dataSource plus fieldName - for example 'countryDS.countryCode'")} return null} var _7;if(_2==null)_7=isc.DataSource.get(_5);else{if(!isc.isAn.Array(_2))_2=[_2];for(var i=0;i<_2.length;i++){if(_2[i].getID()==_5){_7=_2[i];break} } } return _7} ,isc.A.$93o=function isc_c_DataSource__getDefaultValueForFieldType(_1){var _2;switch(_1){case"date":case"datetime":case"time":_2=new Date(0);break;case"float":_2=0.0;break;case"integer":_2=0;break;case"boolean":_2=false;break;case"text":default:_2="";break} return _2} ,isc.A.$93p=function isc_c_DataSource__getTypedValueAsString(_1,_2,_3){if(_3==null)_3={};if(_1==null){var _4=_3.nullValueText;if(_4!=null)return _4;_1=this.$93o(_2)} switch(_2){case"date":var _5=_3.dateFormat;return _1.toShortDate(_5);case"datetime":var _5=_3.dateTimeFormat;return _1.toShortDateTime(_5);case"time":var _5=_3.timeFormat;return isc.Time.toShortTime(_1,_5);case"float":case"integer":case"boolean":default:return _1.toString();case"text":return _1} } ,isc.A.isFlatCriteria=function isc_c_DataSource_isFlatCriteria(_1){if(!_1)return false;if(isc.isA.emptyObject(_1)||(_1.fieldName&&_1.operator&&_1.operator!="and"&&_1.operator!="or")) {return true} if(_1._constructor=="AdvancedCriteria"&&(_1.operator=="and"||_1.operator=="or")&&_1.criteria) {var _2=_1.criteria;for(var i=0;i<_2.length;i++){var _4=_2[i];if(_4.operator&&(_4.operator=="and"||_4.operator=="or"||_4.operation=="not")) {return false} } return true} return false} ,isc.A.flattenCriteria=function isc_c_DataSource_flattenCriteria(_1){if(!_1)return null;var _2=isc.addProperties({},_1);if(_2.criteria){_2.criteria=[];this.$1241(_2.criteria,_1)} return _2} ,isc.A.$1241=function isc_c_DataSource__addSubCriteriaToList(_1,_2){if(!_2.criteria){_1.add(isc.addProperties({},_2));return} var _3=_2.criteria;for(var i=0;i<_3.length;i++){var _5=_3[i];this.$1241(_1,_5)} } ,isc.A.canFlattenCriteria=function isc_c_DataSource_canFlattenCriteria(_1){if(!_1)return false;if(isc.DataSource.isFlatCriteria(_1))return true;var _2=_1.operator;if(this.$1242(_1,_2))return true;return false} ,isc.A.$1242=function isc_c_DataSource__criteriaHasSameLogicalOperators(_1,_2){if(!_1.criteria)return true;if(_1.operator!=_2)return false;var _3=_1.criteria;for(var i=0;i<_3.length;i++){var _5=_3[i];if(!this.$1242(_5,_2))return false} return true} ,isc.A.getAdvancedCriteriaDescription=function isc_c_DataSource_getAdvancedCriteriaDescription(_1,_2){if(!isc.isAn.Array(_2)){if(!isc.isA.DataSource(_2))_2=isc.DS.getDataSource(_2);if(!_2)return"No dataSource"} var _3="";if(_1.criteria&&isc.isAn.Array(_1.criteria)){var _4=_1.operator,_5=_1.criteria;for(var i=0;i<_5.length;i++){var _7=_5[i];if(i>0)_3+=" "+_4+" ";if(_7.criteria&&isc.isAn.Array(_7.criteria)){_3+="(" _3+=isc.DataSource.getAdvancedCriteriaDescription(_7,_2);_3+=")" }else{_3+=isc.DataSource.getCriterionDescription(_7,_2)} } }else{if(_1.fieldName==null){_1=isc.DataSource.convertCriteria(_1)} _3+=isc.DataSource.getCriterionDescription(_1,_2)} return _3} ,isc.A.getCriterionDescription=function isc_c_DataSource_getCriterionDescription(_1,_2){if(_1==null)return"";var _3=_1.fieldName,_4=_1.operator,_5=_1.start,_6=_1.end,_7 ;if(isc.isAn.Array(_2)){_2=isc.DataSource.getDataSourceForField(_3,_2);_7=isc.DataSource.getFieldFromDataSources(_3,[_2])}else{if(!isc.isA.DataSource(_2))_2=isc.DS.getDataSource(_2);if(!_2)return"No DataSource";_7=_2.getField(_3);if(_7==null){_7=_2.getFieldForDataPath(_3)} } var _8=_2.getSearchOperator(_4,_7),_9=_2.getFieldOperatorMap(_7,true,_8.valueType,false),_10="" ;if(!_7){if(_1.criteria&&isc.isAn.Array(_1.criteria)){isc.logWarn("DataSource.getCriterionDescription: Passed an AdvancedCriteria - returning through getAdvancedCriteriaDescription.");return isc.DataSource.getAdvancedCriteriaDescription(_1,_2)} _10=_3+" "+isc.FilterBuilder.missingFieldPrompt+" ";isc.logWarn("DataSource.getCriterionDescription: No such field '"+_3+"' in DataSource '"+_2.ID+"'.")}else{_10=(_7.title?_7.title:_3)+" "} switch(_4) {case"lessThan":case"greaterThan":case"lessOrEqual":case"greaterOrEqual":case"between":case"notNull":_10+="is "+(_9[_4]||_4);break;case"equals":_10+="is equal to";break;case"notEqual":_10+="is not equal to";break;default:_10+=_9[_4]||_4} var _11=_1.valuePath;if(_11!=null){_10+=" value of "+_11}else{var _12=_1.value;if(isc.DateUtil.isRelativeDate(_12)){var _13=_7?_7.type:null,_14=false,_15=isc.SimpleType ;if(_15.inheritsFrom(_13,"date")&&!_15.inheritsFrom(_13,"datetime")){_14=true} _12=isc.DateUtil.getAbsoluteDate(_12,null,null,_14)} if(_8.valueType=="valueRange")_10+=" "+_5+" and "+_6;else if(_4!="notNull"){_10+=" ";if(isc.isA.Date(_12)){if(_12.isLogicalDate)_10+=_12.toShortDate();else _10+=_12.toShortDatetime()}else _10+=_12&&_12.toString?_12.toString():_12} } return _10} );isc.B._maxIndex=isc.C+54;isc.A=isc.DataSource.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.addGlobalId=true;isc.A.dataFormat="iscServer";isc.A.callbackParam="callback";isc.A.preventHTTPCaching=true;isc.A.sendExtraFields=true;isc.A.patternSingleWildcard=["?","%"];isc.A.patternMultiWildcard="*";isc.A.patternEscapeChar="\\";isc.A.translatePatternOperators=false;isc.A.transformResponseToJS=true;isc.A.supportsRequestQueuing=true;isc.A.firstGeneratedSequenceValue=0;isc.A.copyLocalResults=true;isc.A.deepCopyLocalResults=false;isc.A.criteriaPolicy="dropOnShortening";isc.A.defaultTextMatchStyle="exact";isc.A.ignoreTextMatchStyleCaseSensitive=false;isc.A.showPrompt=true;isc.A.autoDeriveTitles=true;isc.A.canMultiSort=true;isc.A.nullStringValue="";isc.A.nullIntegerValue=0;isc.A.nullFloatValue=0.0;isc.A.nullBooleanValue=false;isc.A.nullDateValue=new Date(0);isc.A.cacheAcrossOperationIds=true;isc.A.cacheMaxAge=60;isc.A.cacheLastFetchTime=0;isc.A.sendParentNode=false;isc.A.autoCacheAllData=false;isc.A.autoConvertRelativeDates=true;isc.A.showFieldsAsTree=false;isc.A.$111m={};isc.A.$111n={};isc.A.$111o={};isc.B.push(isc.A.setCacheAllData=function isc_DataSource_setCacheAllData(_1){if(!_1){if(this.cacheAllData==true){if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("setCacheAllData(false): clearing the cache and any deferred requests","cacheAllData")} this.cacheAllData=false;delete this.$85n;this.invalidateCache();this.clearDeferredRequests()} }else{if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("setCacheAllData(true): invalidate the cache","cacheAllData")} this.cacheAllData=true;this.$85n=isc.timestamp();this.invalidateCache()} } ,isc.A.cacheNeedsRefresh=function isc_DataSource_cacheNeedsRefresh(){var _1=new Date().getTime(),_2=((_1-this.cacheLastFetchTime)/1000),_3=(this.cacheLastFetchTime==0||_2>this.cacheMaxAge) ;if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("cacheNeedsRefresh returns "+_3,"cacheAllData")} return _3} ,isc.A.setCacheData=function isc_DataSource_setCacheData(_1){if(this.cacheAllData||this.clientOnly){if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("setCacheData: invalidating the cache","cacheAllData")} this.invalidateCache();this.clearDeferredRequests();this.cacheData=this.testData=_1;this.cacheLastFetchTime=new Date().getTime();if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("setCacheData: cacheData has been set","cacheAllData")} } } ,isc.A.setTestData=function isc_DataSource_setTestData(_1,_2){this.setCacheData(_1,_2)} ,isc.A.clearDeferredRequests=function isc_DataSource_clearDeferredRequests(_1){if(!this.$498)return;_1=_1||"any";if(!isc.isAn.Array(_1))_1=[_1];if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("clearDeferredRequests: "+this.$498.length+" requests, clearing those of type "+isc.echoAll(_1),"cacheAllData")} if(_1.contains("any"))delete this.$498;else{if(this.$498){var _2=this.$498;for(var i=_2.length;i>=0;i--){var _4=_2[i].operationType||"fetch";if(_1.contains(_4))this.$498.removeAt(i)} if(this.$498.length==0)delete this.$498} } } ,isc.A.processDeferredRequests=function isc_DataSource_processDeferredRequests(){if(!this.$498)return;if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("processDeferredRequests: processing "+this.$498.length+" deferred requests","cacheAllData")} var _1=this.$498;this.clearDeferredRequests();for(var i=0;i<_1.length;i++){this.sendDSRequest(_1[i])} } ,isc.A.invalidateCache=function isc_DataSource_invalidateCache(){if(!this.cacheAllData&&!this.clientOnly)return;if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("invalidateCache: invalidating client-side cache","cacheAllData")} delete this.cacheData;delete this.testData;this.cacheLastFetchTime=0;if(this.cacheResultSet){this.cacheResultSet.destroy();delete this.cacheResultSet} } ,isc.A.setClientOnly=function isc_DataSource_setClientOnly(_1){if(_1){this.clientOnly=true if(this.cacheAllData){if(this.cacheResultSet){if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("setClientOnly: sourcing from client-cache","cacheAllData")} this.cacheData=this.testData=this.cacheResultSet.getAllRows()} }else{this.clearDeferredRequests();this.invalidateCache();this.performDSOperation("fetch")} } } ,isc.A.hasAllData=function isc_DataSource_hasAllData(){if(this.cacheResultSet)return this.cacheResultSet.lengthIsKnown();else return false} ,isc.A.criteriaContainsDates=function isc_DataSource_criteriaContainsDates(_1){var _2=this.getCriteriaFields(_1);if(_2&&_2.length>0){for(var i=0;i<_2.length;i++){var _4=this.getField(_2[i]);if(!_4)continue;if(isc.SimpleType.inheritsFrom(_4.type,"date")||isc.SimpleType.inheritsFrom(_4.type,"datetime")){return true} } } return false} ,isc.A.convertRelativeDates=function isc_DataSource_convertRelativeDates(_1,_2,_3,_4){if(!_1)return null;if(!this.criteriaContainsDates(_1)){return _1} if(!this.isAdvancedCriteria(_1)&&_1.operator==null){return _1} var _5=isc.clone(_1);_4=_4||new Date();if(_3==null)_3=isc.DateChooser?isc.DateChooser.firstDayOfWeek:0;if(_5.criteria&&isc.isAn.Array(_5.criteria)){var _6=_5.criteria;for(var i=_6.length-1;i>=0;i--){var _8=_6[i];if(!_8){if(this.logIsInfoEnabled("relativeDates")){this.logInfo("Removing NULL subCriteria...","relativeDates")} _5.criteria.removeAt(i)}else{if(_8.criteria&&isc.isAn.Array(_8.criteria)){if(this.logIsInfoEnabled("relativeDates")){this.logInfo("Calling convertRelativeDates from convertRelativeDates - data is:\n\n"+isc.echoFull(_8)+"\n\ncriteria is: \n\n"+isc.echoFull(_1) ,"relativeDates" )} _5.criteria[i]=this.convertRelativeDates(_8,_2,_3,_4);if(this.logIsInfoEnabled("relativeDates")){this.logInfo("Called convertRelativeDates from convertRelativeDates - data is\n\n"+isc.echoFull(_5.criteria[i]),"relativeDates")} }else{_5.criteria[i]=this.mapRelativeDate(_8,_4)} } } }else{_5=this.mapRelativeDate(_5,_4)} if(this.logIsInfoEnabled("relativeDates")){this.logInfo("Returning from convertRelativeDates - result is:\n\n"+isc.echoFull(_5)+"\n\noriginal criteria is: \n\n"+isc.echoFull(_1) ,"relativeDates" )} return _5} ,isc.A.mapRelativeDate=function isc_DataSource_mapRelativeDate(_1,_2){var _3=isc.addProperties({},_1),_4,_5 ;_2=_2||new Date();var _6=_3.fieldName,_7=_6?this.getField(_6):null,_8=_7?_7.type:null ;var _9=isc.SimpleType.inheritsFrom(_8,"date")&&!isc.SimpleType.inheritsFrom(_8,"datetime");if(_3.value&&isc.isAn.Object(_3.value)&&_3.value._constructor=="RelativeDate") {_5=_3.value.value;var _10=isc.DateUtil.getAbsoluteDate(_5,_2,_3.value.rangePosition,_9||_3.value.logicalDate);if(!_9&&["$yesterday","$today","$tomorrow"].contains(_5)){switch(_3.operator){case"equals":_3.operator="betweenInclusive";_3.start=isc.DateUtil.getStartOf(_10,"D");_3.end=isc.DateUtil.getEndOf(_10,"D");delete _3.value;break;case"notEqual":_3._constructor="AdvancedCriteria";_3.operator="not";_3.criteria=[{operator:"betweenInclusive",fieldName:_3.fieldName,start:isc.DateUtil.getStartOf(_10,"D"),end:isc.DateUtil.getEndOf(_10,"D") } ];delete _3.value;delete _3.fieldName;break;case"lessThan":case"greaterOrEqual":_3.value=isc.DateUtil.getStartOf(_10,"D");break;case"greaterThan":case"lessOrEqual":_3.value=isc.DateUtil.getEndOf(_10,"D");break;default:_3.value=_10} }else{_3.value=_10} }else{if(_3.start&&isc.isAn.Object(_3.start)&&_3.start._constructor=="RelativeDate") {_5=_3.start.value;_3.start=_4=isc.DateUtil.getAbsoluteDate(_5,_2,"start",_9||_3.start.logicalDate)} if(_3.end&&isc.isAn.Object(_3.end)&&_3.end._constructor=="RelativeDate") {_5=_3.end.value;_3.end=isc.DateUtil.getAbsoluteDate(_5,_2,"end",_9||_3.end.logicalDate)} } return _3} );isc.B._maxIndex=isc.C+12;isc.A=isc.DataSource.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.cloneDSRequest=isc.DataSource.$159k;isc.A.cloneDSResponse=isc.DataSource.$135y;isc.A.$110l=200;isc.A.$41v="Action";isc.A.resultBatchSize=150;isc.A.$2j=[];isc.A.emptyExportMessage="You are attempting to export an empty dataset";isc.A.canExport=true;isc.A.defaultTitleFieldNames=["title","label","name","id" ];isc.A.textContentProperty="xmlTextContent";isc.A.$dq="Defaults";isc.A.$dr="Properties";isc.A.$375="name";isc.A.$45t="type";isc.A.dropUnknownCriteria=true;isc.A.$45y="startsWith";isc.A.$19q="substring";isc.A.$50i="exact";isc.A.$135s="exactCase";isc.A.$50j="iscServer";isc.B.push(isc.A.init=function isc_DataSource_init(){if(this.serverType=="sql")this.dataFormat="iscServer";if(this.dataFormat=="iscServer"&&(this.serviceNamespace!=null||this.recordXPath!=null))this.dataFormat="xml";this.canQueueRequests=(this.dataFormat=="iscServer"||this.clientOnly);if(this.testData&&!this.cacheData)this.cacheData=this.testData;else if(this.clientOnly){this.cacheData=this.testData=this.cacheData||this.testData} if(this.ID==null&&this.id!=null)this.ID=this.id;if(this.name==null)this.name=this.ID;var _1=isc.DS.get(this.ID);if(_1&&_1.builtinSchema)return _1;var _2=window[this.ID];if(this.addGlobalId&&this.addGlobalId!=isc.$ae&&(!_2||(!isc.isA.ClassObject(_2)&&isc.isA.DataSource(_2)))) {isc.ClassFactory.addGlobalID(this)} var _3=this.fields;if(isc.isAn.Array(_3)){if(isc.Canvas.validateFieldNames){isc.Canvas.$1027(_3,this)} var _4={};for(var i=0;i<_3.length;i++){var _6=_3[i];if(_6.includeFrom!=null){var _7=_6.includeFrom.split(".");if(_7==null||_7.length!=2){this.logWarn("Field has includeFrom specified as :"+_6.includeFrom +" format not understood - clearing this property");_6.includeFrom=null}else{if(_6.name==null)_6.name=_7[1]} } if(_4[_6.name]!=null){this.logWarn("field.name collision: first field: "+this.echo(_4[_6.name])+", discarded field: "+this.echo(_6));continue} _6=this.$93t(_6);if(_6.type){var _8=this.getType(_6.type);if(_8&&_8.fieldProperties){_6=_3[i]=isc.addProperties({},_8.fieldProperties,_6)} if(!_6.format&&_8&&_8.format){_6.format=_8.format} } _4[_6.name]=_6} this.fields=_4} if(this.dataSourceType==isc.DataSource.VIEW)this.initViewSources();isc.DataSource.registerDataSource(this)} ,isc.A.$93t=function isc_DataSource__prettyField(_1){if(isc.isA.String(_1.validOperators)){_1.validOperators=[_1.validOperators]} var _2;if((_1.foreignKey) &&(_1.nillable==_2)){_1.nillable=true} return _1} ,isc.A.destroy=function isc_DataSource_destroy(){var _1=this.ID,_2=isc.DS;if(this.cacheResultSet){this.cacheResultSet.destroy();this.cacheResultSet=null} if(_1&&this==window[_1])window[_1]=null;if(_2._dataSources[_1]==this)_2._dataSources[_1]=null;if(_2.$54v[_1]==this)_2.$54v[_1]=null;if(_2.$54w[_1]==this)_2.$54w[_1]=null;this.Super("destroy",arguments)} ,isc.A.getResultSet=function isc_DataSource_getResultSet(_1){var _2=isc.ClassFactory.getClass(this.resultSetClass||isc.ResultSet);if(!isc.isA.Class(_2)){this.logWarn("getResultSet(): Unrecognized 'resultSetClass' property:" +_2+", returning a standard isc.ResultSet.");_2=isc.ResultSet} return _2.create(_1,{$31k:true})} ,isc.A.dataChanged=function(dsResponse,dsRequest){} ,isc.A.updateCaches=function isc_DataSource_updateCaches(_1,_2){if(_2==null){_2={operationType:_1.operationType,dataSource:this };if(_1.clientContext!=null){_2.clientContext=_1.clientContext} if(_1.internalClientContext!=null){_2.internalClientContext=_1.internalClientContext} }else{_2.dataSource=_2.dataSource||_1.dataSource||this} var _3=_1.data,_4=_1.invalidateCache,_5=_1.httpResponseCode;if(!_3&&!_4 &&!(_5>=200&&_5<300)){this.logWarn("Empty results returned on '"+_2.operationType+"' on dataSource '"+_2.dataSource+"', unable to update resultSet(s) on DataSource "+this.ID+". Return affected records to ensure cache consistency.");return} if(!this.clientOnly&&this.cacheAllData&&this.hasAllData()&&!isc.isAn.Array(_3)) {this.invalidateCache()} this.dataChanged(_1,_2);if(_1.invalidateCache!=true&&this.clientOnly){var _6={operationType:_1.operationType,data:_1.data[0] };this.getClientOnlyResponse(_6)} } ,isc.A.getLegalChildTags=function isc_DataSource_getLegalChildTags(){var _1=this.getFieldNames(),_2=[];for(var i=0;i<_1.length;i++){if(this.fieldIsComplexType(_1[i]))_2.add(_1[i])} return _2} ,isc.A.getOperationBinding=function isc_DataSource_getOperationBinding(_1,_2){if(_1==null||this.operationBindings==null)return this;if(isc.isAn.Object(_1)){var _3=_1;_1=_3.operationType;_2=_3.operationId} var _4;if(_2){var _5=this.operationBindings.find("operationId",_2);if(_5)return _5} if(_1){var _5=this.operationBindings.find("operationType",_1);if(_5)return _5} return this} ,isc.A.getDataFormat=function isc_DataSource_getDataFormat(_1,_2){return this.getOperationBinding(_1,_2).dataFormat||this.dataFormat} ,isc.A.shouldBypassCache=function isc_DataSource_shouldBypassCache(_1,_2){var _3=this.getOperationBinding(_1,_2).preventHTTPCaching;if(_3==null)_3=this.preventHTTPCaching;return _3} ,isc.A.copyRecord=function isc_DataSource_copyRecord(_1){if(_1==null)return null;var _2={},_3=this.getFieldNames(false);for(var i=0;i<_3.length;i++){var _5=_3.get(i),_6=_1[_5],_7=this.getField(_5);if(isc.isA.Date(_6)){var _8=new Date();_8.setTime(_6.getTime());_8.logicalDate=_6.logicalDate;_8.logicalTime=_6.logicalTime;_2[_5]=_8}else if(isc.isAn.Array(_6)&&_7.multiple==true&&_7.type==null) {var _9=[];for(var j=0;j<_6.length;j++){if(isc.isA.Date(_6[j])){var _8=new Date();_8.setTime(_6[j].getTime());_8.logicalDate=_6[j].logicalDate;_8.logicalTime=_6[j].logicalTime;_9[j]=_8}else{_9[j]=_6[j]} } _2[_5]=_9}else{_2[_5]=_6} } return _2} ,isc.A.copyRecords=function isc_DataSource_copyRecords(_1){if(_1==null)return null;var _2=[];for(var i=0;i<_1.length;i++){var _4=_1[i],_5=this.copyRecord(_4);_2[i]=_5} return _2} ,isc.A.transformRequest=function isc_DataSource_transformRequest(_1){return _1.data} ,isc.A.getUpdatedData=function isc_DataSource_getUpdatedData(_1,_2,_3){var _4=_2.data;if(_3&&_2.status==0&&(_4==null||(isc.isA.Array(_4)&&_4.length==0)||isc.isAn.emptyString(_4)) ) {this.logInfo("dsResponse for successful operation of type "+_1.operationType+" did not return updated record[s]. Using submitted request data to update ResultSet cache.","ResultSet");var _5=_1.data;if(_1.data&&isc.isAn.Object(_1.data)){if(_1.operationType=="update"){_4=isc.addProperties({},_1.oldValues);if(isc.isAn.Array(_5)){_4=isc.addProperties(_4,_5[0])}else{_4=isc.addProperties(_4,_5)} _4=[_4]}else{if(!isc.isAn.Array(_5))_5=[_5];_4=[];for(var i=0;i<_5.length;i++){_4[i]=isc.addProperties({},_5[i])} } if(this.logIsDebugEnabled("ResultSet")){this.logDebug("Submitted data to be integrated into the cache:" +this.echoAll(_4),"ResultSet")} } } return _4} ,isc.A.serializeFields=function isc_DataSource_serializeFields(_1,_2){if(!_1&&_2!=null)_1=_2.data;if(!_1)return _1;if(isc.DS.isSimpleTypeValue(_1))return _1;if(isc.isAn.Array(_1)){var _3=[];for(var i=0;i<_1.length;i++){_3[i]=this.serializeFields(_1[i],_2)} return _3}else if(this.isAdvancedCriteria(_1)){return this.serializeAdvancedCriteria(_1)} _1=isc.addProperties({},_1);if(_1.__ref){delete _1.__ref;delete _1.__module} var _5=this.getFields();for(var _6 in _5){if(!isc.isAn.Object(_1[_6]))continue;var _7=_5[_6],_8=_7.type,_9=_8!=null?isc.DataSource.get(_8):null;if(_9&&_9.serializeFields){_1[_6]=_9.serializeFields(_1[_6])}else if(isc.isA.Date(_1[_6])){if(isc.SimpleType.getBaseType(_7.type)=="date"&&!isc.SimpleType.inheritsFrom(_7.type,"datetime")) {_1[_6].logicalDate=true}else if(isc.SimpleType.getBaseType(_7.type)=="time"){_1[_6].logicalTime=true} } } return _1} ,isc.A.serializeAdvancedCriteria=function isc_DataSource_serializeAdvancedCriteria(_1){_1=isc.clone(_1);if(_1.criteria){for(var i=0;i<_1.criteria.length;i++){_1.criteria[i]=this.serializeAdvancedCriteria(_1.criteria[i])} }else{if(isc.isA.Date(_1.value)||isc.isA.Date(_1.start)||isc.isA.Date(_1.end)){var _3=this.getField(_1.fieldName);if(_3!=null){if(isc.SimpleType.getBaseType(_3.type)=="date"&&!isc.SimpleType.inheritsFrom(_3.type,"datetime")) {if(_1.value)_1.value.logicalDate=true;if(_1.start)_1.start.logicalDate=true;if(_1.end)_1.end.logicalDate=true}else if(isc.SimpleType.getBaseType(_3.type)=="time"){if(_1.value)_1.value.logicalTime=true;if(_1.start)_1.start.logicalTime=true;if(_1.end)_1.end.logicalTime=true} } } } return _1} ,isc.A.getDataProtocol=function isc_DataSource_getDataProtocol(_1){if(_1.dataProtocol!=null){return _1.dataProtocol} var _2=this.getOperationBinding(_1),_3=this.getWebService(_1);return(_2.dataProtocol!=null?_2.dataProtocol:isc.isA.WebService(_3)?"soap":this.dataProtocol||"getParams")} ,isc.A.$754=function isc_DataSource__storeCustomRequest(_1){if(!this.$624)this.$624={};this.$624[_1.requestId]=_1} ,isc.A.getServiceInputs=function isc_DataSource_getServiceInputs(_1){var _2=this.getOperationBinding(_1),_3=this.getWebService(_1),_4=this.getWSOperation(_1);this.addDefaultCriteria(_1,_2);_1.originalData=_1.data;this.$754(_1);this.applySendExtraFields(_1);if(!this.clientOnly){if(this.fulfilledFromOffline(_1))return{dataProtocol:"clientCustom"};_1.unconvertedDSRequest=isc.shallowClone(_1)} if(this.autoConvertRelativeDates==true){if(this.logIsInfoEnabled("relativeDates")){this.logInfo("Calling convertRelativeDates from getServiceInputs - data is\n\n"+isc.echoFull(_6))} var _5=this.convertRelativeDates(_1.data);if(this.logIsInfoEnabled("relativeDates")){this.logInfo("Called convertRelativeDates from getServiceInputs - data is\n\n"+isc.echoFull(_6))} _1.data=_5} _1.dataProtocol=this.getDataProtocol(_1);var _6=this.transformRequest(_1);if(_6!==_1){_1.data=_6} var _7=this.getDataProtocol(_1),_8=_7=="clientCustom";if(_8){return{dataProtocol:"clientCustom"}}else{delete this.$624[_1.requestId]} if(isc.isA.WebService(_3)){if(_1.wsOperation==null&&isc.isAn.Object(_4)){_1.wsOperation=_4.name} this.logInfo("web service: "+_3+", wsOperation: "+this.echoLeaf(_4),"xmlBinding")} _1.$85o=isc.timestamp();var _9=this.getDataURL(_1);_9=_1.actionURL||_1.dataURL||_9;if(_1.useHttpProxy==null){_1.useHttpProxy=this.$du(_2.useHttpProxy,this.useHttpProxy)} var _10,_11=_2.defaultParams||this.defaultParams,_12=_1.params;if(_11||_12){_10=isc.addProperties({},_11,_12)} var _13=_7=="getParams"||_7=="postParams";if(_13){_10=isc.addProperties(_10||{},_1.data)} if(_13){if(_10)_10=this.serializeFields(_10,_1);return{actionURL:_9,httpMethod:_1.httpMethod||(_7=="getParams"?"GET":"POST"),params:_10 }} var _14={actionURL:_9,httpMethod:_1.httpMethod||"POST" };if(_10)_14.params=_10;if(_7=="postMessage"){_14.data=(_1.data||"").toString()} if(_7=="postXML"||_7=="soap"){var _15=this.getSerializeFlags(_1);var _16=_14.data=this.getXMLRequestBody(_1);_14.contentType=_1.contentType||"text/xml";this.logDebug("XML post requestBody is: "+_16,"xmlBinding")} if(_7=="soap"){var _17=this.$du(_2.soapAction,_4.soapAction);if(_17==null)_17='""';_14.httpHeaders=isc.addProperties({SOAPAction:_17},_1.httpHeaders);var _18=isc.isA.WebService(_3)&&this.$du(_2.spoofResponses,this.spoofResponses);if(_18){_14.spoofedResponse=_3.getSampleResponse(_4.name);this.logInfo("Using spoofed response:\n"+_14.spoofedResponse,"xmlBinding")} } if(this.logIsDebugEnabled("xmlBinding")){this.logDebug("serviceInputs are: "+this.echo(_14),"xmlBinding")} return _14} ,isc.A.addDefaultCriteria=function isc_DataSource_addDefaultCriteria(_1,_2){var _3=_2.defaultCriteria||this.defaultCriteria;if(!_3)return;_3=isc.addProperties({},_3);if(_3&&_1.operationType=="fetch"){if(this.isAdvancedCriteria(_1.data)){var _4=this.mineCriteriaFieldNames(_1.data);for(var _5 in _3){if(_4.contains(_5))delete _3[_5]} } if(isc.getValues(_3).length>0){_1.data=isc.DataSource.combineCriteria(_1.data,_3,"and",null)} } } ,isc.A.mineCriteriaFieldNames=function isc_DataSource_mineCriteriaFieldNames(_1){var _2=[];if(!_1.criteria)return _2;for(var i=0;i<_1.criteria.length;i++){if(_1.criteria[i].criteria){_2.addList(this.mineCriteriaFieldNames(_1.criteria[i]))}else{_2.add(_1.criteria[i].fieldName)} } return _2} ,isc.A.applySendExtraFields=function isc_DataSource_applySendExtraFields(_1){if(!this.sendExtraFields){var _2=_1.data;if(!isc.isAn.Array(_2))_2=[_2];for(var i=0;i<_2.length;i++){var _4=_2[i];if(!isc.isAn.Object(_4))continue;for(var _5 in _4){if(!this.getField(_5))delete _4[_5]} } } } ,isc.A.processResponse=function isc_DataSource_processResponse(_1,_2){var _3=this.$624[_1];if(_3==null){this.logWarn("DataSource.processResponse(): Unable to find request corresponding to ID " +_1+", taking no action.");return} delete this.$624[_1];if(_2.status==null)_2.status=0;if(_2.status==0){var _4=_2.data;if(_4==null)_2.data=_4=[];if(_2.startRow==null)_2.startRow=_3.startRow||0;if(_2.endRow==null)_2.endRow=_2.startRow+_4.length;if(_2.totalRows==null){_2.totalRows=Math.max(_2.endRow,_4.length)} } this.$38b(_4,_2,_3)} ,isc.A.$50e=function isc_DataSource__handleClientOnlyReply(_1,_2,_3){var _4=this.cacheAllData&&!this.clientOnly&&this.cacheResultSet?this.cacheResultSet.getAllRows():null,_5=_3._dsRequest;var _6=function(_7){_1.clientOnlyData=_7?_7.data:null;this.$38b(_2,_7,_5,_1,_3)};if(this.copyLocalResults&&this.getClientOnlyResponse===isc.DataSource.getInstanceProperty("getClientOnlyResponse")) {this.$110m(_5,_4,_6)}else{var _7=this.getClientOnlyResponse(_5,_4);_6.call(this,_7)} } ,isc.A.$110m=function isc_DataSource__asyncGetClientOnlyResponse(_1,_2,_3){var _4=_1.operationType,_5={status:0 };if(!(_4=="fetch"||_4=="select"||_4=="filter")){_3.apply(this,[this.getClientOnlyResponse(_1,_2)]);return} _2=_2||this.testData;var _6=this.cacheData,_7=this.testData,_8=false;if(_2&&!this.testData&&this.clientOnly){_6=_7=_2;_8=true} if(!_2||isc.isA.String(_2)){if(isc.isA.String(_2)){this.logInfo(this.ID+" datasource: using testData property as data");_6=_7=isc.eval(_2);_8=true}else if(window[this.ID+"TestData"]){this.logInfo(this.ID+" datasource: using "+this.ID+"TestData object as data");_6=_7=window[this.ID+"TestData"];_8=true}else{this.logInfo(this.ID+" datasource: testData property and "+this.ID+"TestData object not found, using empty list as data");_6=_7=[];_8=true} _2=_7} var _9=this.getClientOnlyFetchResponse(_1,_2,true);_5=_9[0];var _10=_9[1];var _11=function(){_5.data=_10;this.$109x(_5,_4);if(_8){this.cacheData=this.testData=_2} _3.call(this,_5)};if(this.copyLocalResults){this.$110n(0,_10.length,_10,_11)}else{_11.call(this)} } ,isc.A.$110n=function isc_DataSource__asyncCopyLocalResults(_1,_2,_3,_4){var _5=_2,_6=isc.Browser.isSGWT;_2=Math.min(_2,_1+this.$110l);for(var i=_1;i<_2;++i){if(this.deepCopyLocalResults){_3[i]=isc.clone(_3[i])}else{_3[i]=isc.addProperties({},_3[i])} if(_6){_3[i][isc.gwtRef]=null;_3[i][isc.gwtModule]=null} } if(_2==_5){_4.call(this)}else{this.delayCall("$110n",[_2,_5,_3,_4],0)} } ,isc.A.$38a=function isc_DataSource__handleCustomReply(_1,_2,_3){var _4={data:_2,startRow:0,endRow:0,totalRows:0,status:0 };var _5=_3._dsRequest;this.$38b(_2,_4,_5,_1,_3)} ,isc.A.$377=function isc_DataSource__handleJSONReply(_1,_2,_3){var _4=_3._dsRequest,_5=this.getOperationBinding(_4).recordXPath||this.recordXPath;if((_1.$38c||_1.$69j)&&this.logIsDebugEnabled("xmlBinding")){this.logDebug("Raw response data: "+this.echoFull(_2),"xmlBinding")} var _6=_2;if(_2){if(_5){_2=isc.xml.selectObjects(_2,_5);this.logInfo("JSON recordXPath: '"+_5+"', selected: "+this.echoLeaf(_2),"xmlBinding")} var _7=this.getOperationBinding(_4).responseDataSchema;_2=this.recordsFromObjects(_2,_7);if(this.logIsDebugEnabled("xmlBinding")){this.logDebug("Validated dsResponse.data: "+isc.echoFull(_2),"xmlBinding")} var _8={data:_2,startRow:_4.startRow||0,status:0 };_8.endRow=_8.startRow+Math.max(0,_2.length);_8.totalRows=Math.max(_8.endRow,_2.length)}else{var _9=_1.status;if(_9==0||_9==null)_9=-1;var _8={status:_9,data:_1.data };_6=_1.results} this.$38b(_6,_8,_4,_1,_3)} ,isc.A.$69k=function isc_DataSource__handleCSVTextReply(_1,_2,_3){if(_1.status!=0)return;var _4=isc.TextImportSettings.create({hasHeaderLine:true,trim:true });isc.TextImportSettings.$935=true;var _5=this.recordsFromText(_1.data,_4);isc.TextImportSettings.$935=false;_1.$69j=true;this.$377(_1,_5,_3)} ,isc.A.$379=function(rpcResponse,jsonText,rpcRequest){if(rpcRequest.isRestRequest&&!isc.isA.String(jsonText)){var jsonObjects=jsonText}else{if(rpcResponse.status>=0){var evalText=jsonText;if(rpcRequest.transport!="scriptInclude"&&evalText!=null){var re;if(this.jsonPrefix){re=new RegExp(/^\s*/);evalText=evalText.replace(re,"");if(evalText.startsWith(this.jsonPrefix)){evalText=evalText.substring(this.jsonPrefix.length)}else{this.logInfo("DataSource specifies jsonPrefix, but not present in response returned from server. Processing response anyway.")}} if(this.jsonSuffix){re=new RegExp(/\s*$/) evalText=evalText.replace(re,"");if(evalText.endsWith(this.jsonSuffix)){evalText=evalText.substring(0,(evalText.length-this.jsonSuffix.length))}else{this.logInfo("DataSource specifies jsonSuffix, but not present in response returned from server. Processing response anyway.")}}} var wasInvalid=false;try{var jsonObjects;if(rpcRequest.useStrictJSON){jsonObjects=isc.Class.parseStrictJSON(evalText,rpcRequest.jsonReviver)}else{if(evalText&&evalText.match(/^\s*\{/)){evalText="var evalText = "+evalText+";evalText;"} jsonObjects=isc.eval(evalText)}}catch(e){rpcResponse.status=-1;rpcResponse.data="Error: server returned invalid JSON response";this.logWarn("Error evaluating JSON: "+e.toString()+", JSON text:\r"+jsonText);wasInvalid=true} if(jsonObjects==null&&!wasInvalid){rpcResponse.status=-1;rpcResponse.data="Error: server returned invalid JSON response";this.logWarn("Evaluating JSON reply resulted in empty value. JSON text:\r"+this.echo(jsonText));jsonObjects=jsonText} rpcResponse.$38c=true}} this.$377(rpcResponse,jsonObjects,rpcRequest)},isc.A.recordsFromObjects=function isc_DataSource_recordsFromObjects(_1,_2){if(!isc.isAn.Array(_1))_1=[_1];if(this.skipJSONValidation)return _1;for(var i=0;i<_1.length;i++){_1[i]=this.validateJSONRecord(_1[i],null,_2)} return _1},isc.A.validateJSONRecord=function isc_DataSource_validateJSONRecord(_1,_2,_3){if(!_1){return null} if(_3==null){_3=this} var _4=this.getFieldNames(),_5={};for(var i=0;i<_4.length;i++){var _7=_4[i],_8=_3.getField(_7),_9;if(_8.valueXPath&&!_2){_9=isc.xml.selectObjects(_1,_8.valueXPath,true)}else{_9=_1[_7]} if(_8.getFieldValue){if(!isc.isA.Function(_8.getFieldValue)){isc.Func.replaceWithMethod(_8,"getFieldValue","record,value,field,fieldName")} _9=_8.getFieldValue(_1,_9,_8,_7)} var _10;if(_9!==_10){var _11=isc.DS.get(_8.type);if(_11&&!(_11.skipJSONValidation)){if(!(isc.isAn.Array(_9))){_9=_11.validateJSONRecord(_9)}else{for(var j=0;j<_9.length;j++){_9[j]=_11.validateJSONRecord(_9[j])}}} _5[_7]=this.validateFieldValue(_8,_9)}} if(_3.dropExtraFields)return _5;for(var i=0;i<_4.length;i++){var _7=_4[i];_1[_7]=_5[_7]} return _1},isc.A.getMessageSerializer=function isc_DataSource_getMessageSerializer(_1,_2){var _3=this.getOperationBinding(_1,_2);if(_3.wsOperation){var _4=this.getWebService(_1,_2);return _4.getMessageSerializer(_3.wsOperation)} return this},isc.A.getXMLRequestBody=function isc_DataSource_getXMLRequestBody(_1,_2){if(isc.$cv)arguments.$cw=this;var _3=isc.SB.create(),_4=this.getDataProtocol(_1);if(_4=="soap"){_3.append(this.getSoapStart(_1),"\r");_3.append(this.getSoapBody(_1,_2));_3.append("\r",this.getSoapEnd(_1))}else{if(this.messageStyle=="template"){_3.append(this.$38d(_1))}else{var _5=this.getMessageSerializer(_1);var _2=this.getSerializeFlags(_1,_2);_3.append(_5.xmlSerialize(_1.data,_2))}} if(this.logIsDebugEnabled("xmlComm")){this.logDebug("outbound XML message: "+_3,"xmlComm")} return _3.release(false)},isc.A.$38d=function isc_DataSource__createTemplatedRequestBody(_1){var _2=this.soapBodyTemplate,_3;_3=_2.evalDynamicString(this,_1);return _3},isc.A.getSchemaSet=function isc_DataSource_getSchemaSet(){return isc.SchemaSet.get(this.schemaNamespace)},isc.A.hasWSDLService=function isc_DataSource_hasWSDLService(_1){return isc.isA.WebService(this.getWebService(_1))},isc.A.getWebService=function isc_DataSource_getWebService(_1){var _2=this.getOperationBinding(_1),_3=(_1?_1.serviceNamespace:null)||_2.serviceNamespace||this.serviceNamespace,_4=(_1?_1.serviceName:null)||_2.serviceName||this.serviceName;var _5;if(_1&&_1.$167f){_5=_1.$167f}else if(_4)_5=isc.WebService.getByName(_4,_3);else _5=isc.WebService.get(_3);if((_3!=null||_4!=null)&&_5==null){this.logWarn("Could not find WebService definition: "+(_4?"serviceName: "+_4:"")+(_3?" serviceNamespace: "+_3:""))} return _5||this},isc.A.getWSOperation=function isc_DataSource_getWSOperation(_1){var _2=this.getOperationBinding(_1),_3=(isc.isAn.Object(_1)?_1.wsOperation:null)||_2.wsOperation||this.wsOperation,_4=this.getWebService(_1);if(_3!=null&&isc.isA.WebService(_4)){var _5=_4.getOperation(_3);if(!_5){isc.logWarn(this+": getWSOperation(): could not retrieve the operation '"+_3+"'")} return _5} return this},isc.A.getDataURL=function isc_DataSource_getDataURL(_1){var _2=this.getOperationBinding(_1);if(_2!=this&&_2.dataURL)return _2.dataURL;if(this.dataURL!=null)return this.dataURL;if(this.hasWSDLService(_1)){var _3=this.getWebService(_1);return _3.getDataURL(this.getWSOperation(_1).name)} return this.dataURL},isc.A.getGlobalNamespaces=function isc_DataSource_getGlobalNamespaces(_1){var _2=this.getWebService(_1),_3=this.globalNamespaces;if(_2&&_2.globalNamespaces){_3=isc.addProperties({},_3,_2.globalNamespaces)} return _3},isc.A.getSoapStart=function isc_DataSource_getSoapStart(_1){var _2=this.getWebService(_1);if(_2.getSoapStart)return _2.getSoapStart(_1);return isc.SB.concat(isc.DataSource.$37t,isc.xml.$37l(this.getGlobalNamespaces(_1),null," "),">",isc.DataSource.$37u,this.getSoapHeader(_1),isc.DataSource.$51y)},isc.A.getSoapHeader=function isc_DataSource_getSoapHeader(_1){var _2=this.getWebService(_1);if(_2.getSoapHeader)return _2.getSoapHeader(_1);var _3=_1.headerData||_2.getHeaderData(_1);if(!_3)return;this.logDebug("headerData is: "+this.echo(_3),"xmlBinding");var _4=_2.getInputHeaderSchema(this.getWSOperation(_1))||isc.emptyObject;var _5="",_6=_1.useFlatHeaderFields;for(var _7 in _3){var _8=_4[_7];if(_8!=null){if(isc.isA.DataSource(_8)){_5+=_8.xmlSerialize(_3[_7],{useFlatFields:_6})}else{_5+="\r "+this.$38g(_7,_8,_3[_7],_8.partNamespace)}}else{this.logWarn("headerData passed for SOAP header partName: "+_7+", no schema available, not outputting")}} return _5},isc.A.getSoapBody=function isc_DataSource_getSoapBody(_1,_2){if(isc.$cv)arguments.$cw=this;var _3=isc.SB.create(),_4=this.getWebService(_1),_5=this.getSoapStyle(_1),_6=this.getWSOperation(_1),_7=this.xmlNamespaces?isc.makeReverseMap(this.xmlNamespaces):null,_2=isc.addProperties({nsPrefixes:isc.addProperties({},_7)},_2),_8=_2.generateResponse?_4.getResponseMessage(_6.name):_4.getRequestMessage(_6.name),_9=_2.bodyPartNames||_4.getBodyPartNames(_6.name,_2.generateResponse);_2=this.getSerializeFlags(_1,_2);isc.Comm.omitXSI=_6.inputEncoding!="encoded";var _10=isc.Comm.xmlSchemaMode;isc.Comm.xmlSchemaMode=true;var _11=" ";if(_5=="rpc"){_3.append("\n",_11,isc.Comm.$36u(_6.name,null,_6.inputNamespace,"opNS",true),">");_11+=" "} this.logInfo("soap:body parts in use: '"+_9+"', soapStyle: "+_5,"xmlSerialize");if(this.logIsDebugEnabled("xmlSerialize")){this.logDebug("SOAP data is: "+this.echoFull(_1.data),"xmlSerialize")} for(var i=0;i<_9.length;i++){var _13=_9[i];var _14=_9.length<2&&_5=="document"?_1.data:(_1.data?_1.data[_13]:null);var _15=_8.getMessagePart(_13,_14,_2,_11);_3.append("\r"+_11+_15)} if(_5=="rpc"){_3.append("\n"," ",isc.Comm.$36v(_6.name,_6.inputNamespace,"opNS"))} isc.Comm.omitXSI=null;isc.Comm.xmlSchemaMode=_10;return isc.SB.concat(" ",isc.DS.$37v,this.outputNSPrefixes(_2.nsPrefixes," "),">",_3.release(false),"\r ",isc.DS.$51z)},isc.A.getMessagePart=function isc_DataSource_getMessagePart(_1,_2,_3,_4){if(isc.$cv)arguments.$cw=this;var _5=this.getPartField(_1),_6=this.getSchema(_5.type,_5.xsElementRef?"element":null),_7=this.logIsInfoEnabled("xmlSerialize");if(isc.isA.DataSource(_6)){if(_7){this.logInfo("soap:body part '"+_1+"' is complex type with schema: "+_6+" has value: "+(this.logIsDebugEnabled("xmlSerialize")?this.echo(_2):this.echoLeaf(_2)),"xmlSerialize")} var _8=_5.xsElementRef?null:_1;return _6.xmlSerialize(_2,_3,_4,_8)}else{if(_2!=null&&!isc.DS.isSimpleTypeValue(_2)){_2=_2[_5.name]||_2[_1]||_2} if(_7){this.logInfo("soap:body part '"+_1+"' is of simple type '"+_5.type+"' has value: '"+this.echoLeaf(_2)+"'","xmlSerialize")} var _9=this.getType(_5.type),_10=_5.partNamespace;if(!_10&&_9&&_9.schemaNamespace){_10=_9.schemaNamespace} return this.$38g(_5.name||_1,_5,_2,_10,_3)}},isc.A.getPartField=function isc_DataSource_getPartField(_1){var _2=isc.getValues(this.getFields()).find("partName",_1);if(_2!=null)return _2;return this.getField(_1)},isc.A.getSoapEnd=function isc_DataSource_getSoapEnd(_1){var _2=this.getWebService(_1);if(_2.getSoapEnd)return _2.getSoapEnd(_1);return isc.DataSource.$37w},isc.A.getSoapStyle=function isc_DataSource_getSoapStyle(_1){if(!this.hasWSDLService(_1))return"document";return this.getWebService(_1).getSoapStyle(this.getWSOperation(_1).name)});isc.evalBoundary;isc.B.push(isc.A.getSerializeFlags=function isc_DataSource_getSerializeFlags(_1,_2){_2=isc.addProperties({soapStyle:this.getSoapStyle(_1)},_2);var _3=this.getOperationBinding(_1);_2.flatData=this.$du(_1.useFlatFields,_3.useFlatFields,this.useFlatFields);_2.recursiveFlatFields=this.$du(_1.recursiveFlatFields,_3.recursiveFlatFields,this.recursiveFlatFields);_2.textContentProperty=this.$du(_1.textContentProperty,_3.textContentProperty);_2.dsRequest=_1;_2.startRowTag=_3.startRowTag||this.startRowTag;_2.endRowTag=_3.endRowTag||this.endRowTag;return _2},isc.A.xmlSerialize=function isc_DataSource_xmlSerialize(_1,_2,_3,_4){if(!_2)_2={};if(_2.useFlatFields)_2.flatData=true;var _5=this.getSchemaSet(),_6=(_2.qualifyAll==null);if(_5&&_5.qualifyAll){_2.qualifyAll=true} var _7;if(_2.nsPrefixes==null){var _8=this.xmlNamespaces?isc.makeReverseMap(this.xmlNamespaces):null;_2.nsPrefixes=isc.addProperties({},_8);_7=true} var _9=isc.Comm.xmlSchemaMode;isc.Comm.xmlSchemaMode=true;var _10,_11=null;if(_2.xmlExplicitType){_10=true;_11=isc.Comm.omitXSI;isc.Comm.omitXSI=false}else{if(isc.Comm.omitXSI==null){_10=isc.Comm.omitXSI=true}} var _12=this.$ew(_1,_2,_3,_4,_7);if(_6)_2.qualifyAll=null;isc.Comm.xmlSchemaMode=_9;if(_10){isc.Comm.omitXSI=_11} return _12},isc.A.$ew=function isc_DataSource__xmlSerialize(_1,_2,_3,_4,_5){if(isc.$cv)arguments.$cw=this;if(this.logIsDebugEnabled("xmlSerialize")){this.logDebug("schema: "+this+" serializing: "+this.echo(_1)+" with flags: "+this.echo(_2),"xmlSerialize")} var _6=this.mustQualify||_2.qualifyAll,_4=_4||this.tagName||this.ID;var _7=this.$151z(this.xmlExplicitTypes),_8=(_7?_7:_2.xmlExplicitType);if(!_2.ignoreConstructor){var _9;if(_1!=null&&(_1._constructor||isc.isAn.Instance(_1))){var _9=isc.isAn.Instance(_1)?_1.Class:isc.DS.getNearestSchema(_1._constructor);if(isc.isAn.Object(_9)){_9=_9.type} if(!_9&&_1._constructor)_9=_1._constructor}} if(isc.DS.isSimpleTypeValue(_1)){if(isc.isA.String(_1)&&isc.startsWith(_1,"ref:")){return"<"+_4+" ref=\""+_1.substring(4)+"\"/>"} this.logDebug("simple type value: "+this.echoLeaf(_1)+" passed to xmlSerialize on "+this,"xmlSerialize");return isc.Comm.$ew(_4||this.tagName||this.ID,_1)} if(isc.isAn.Instance(_1))_1=_1.getSerializeableFields();if(isc.isAn.Array(_1)&&!this.canBeArrayValued)return this.map("xmlSerialize",_1,_2,_3).join("\n");var _10=isc.SB.create(),_3=_3||"";_10.append("\r",_3);var _11;if(_6){_11=(this.isA("XSComplexType")?_2.parentSchemaNamespace:null)||this.schemaNamespace} var _12;if(_2.xmlExplicitType)_12=null;else _12=this.ID;_10.append(isc.Comm.$36u(_4,_12,_11,_2.nsPrefixes,true));_1=this.serializeAttributes(_1,_10,_2);if(_9&&_4!=_9){if(isc[_9]!=null){_10.append(" constructor=\"",_9,"\"")}else{_10.append(" _constructor=\"",_9,"\"")}} var _13;if(_1!=null){_13=this.xmlSerializeFields(_1,_2,_3+(!_2||_2.indent!=false?" ":""))} if(_5){_10.append(this.outputNSPrefixes(_2.nsPrefixes,_3+(!_2||_2.indent!=false?" ":""),_2))} var _14=this.$45z;this.$45z=null;if(_13==null||isc.isAn.emptyString(_13)){_10.append("/>");return _10.release(false)} _10.append(">",_13,(_14?"":"\r"+_3));_10.append(isc.Comm.$36v(_4,_11,_2.nsPrefixes));return _10.release(false)},isc.A.outputNSPrefixes=function isc_DataSource_outputNSPrefixes(_1,_2,_3){delete _1.$36y;_1=isc.makeReverseMap(_1);var _4=isc.xml.$37l(_1,null,_2+(!_3||_3.indent!=false?" ":""));return _4},isc.A.serializeAttributes=function isc_DataSource_serializeAttributes(_1,_2,_3){var _4=this.getFieldNames(),_5=true;for(var i=0;i<_4.length;i++){var _7=_4[i],_8=this.getField(_7);if(_8.xmlAttribute&&((_1&&_1[_7]!=null)||_8.xmlRequired)){if(_5){_1=isc.addProperties({},_1);_5=false} var _9=_1[_7];if(_3&&_3.spoofData)_9=this.getSpoofedData(_8);if(isc.isAn.Instance(_9)){if(_9.ID){_9=_9.ID}else{this.logWarn("Serializing attribute "+_7+" failed to replace object instance with ID")}} _2.append(" ",_7,"=\"",this.$38f(_8,_9),"\"");delete _1[_7]}} return _1},isc.A.xmlSerializeFields=function isc_DataSource_xmlSerializeFields(_1,_2,_3){var _4=isc.SB.create(),_2=_2||isc.emptyObject,_5=_2.flatData,_6=_2.spoofData,_3=_3||"",_7=this.$151z(this.xmlExplicitTypes),_8=(_7?_7:_2.xmlExplicitType);;var _1=isc.addProperties({},_1);if(_1.__ref){delete _1.__ref;delete _1.__module} var _9=this.getFields();for(var _10 in _9){var _11=this.getField(_10),_12=_1[_10],_13=this.fieldIsComplexType(_10);var _14=_1[_10];if(_2.startRowTag==_11.name&&_14==null){_14=_2.dsRequest?_2.dsRequest.startRow:null}else if(_2.endRowTag==_11.name&&_14==null){_14=_2.dsRequest?_2.dsRequest.endRow:null}else if(_13&&_5&&_14==null){_14=_1} var _15=(_11.xmlRequired&&!_11.xmlAttribute)||(_1[_10]!=null||(_6&&!_11.xmlAttribute));if(_5&&_13){var _16=this.getSchema(_11.type),_17=isc.clone(_2.nsPrefixes),_18=_16.xmlSerializeFields(_14,_2);if(_18!=null&&!isc.isAn.emptyString(_18)){_15=true} _2.nsPrefixes=_17} if(_15){if(_5&&_13&&_1[_10]!=null&&!isc.DS.isSimpleTypeValue(_1[_10])&&!_2.recursiveFlatFields) {_2=isc.addProperties({},_2);_2.flatData=false} var _19=this.$151z(_11.xmlExplicitTypes),_20=(_19?_19:_8);_2=isc.addProperties({},_2,{xmlExplicitType:_20});_4.append(this.xmlSerializeField(_10,_14,_2,_3))} if(!_5&&_1[_10]!=null)delete _1[_10]} if(!_5&&!isc.isA.Schema(this)){for(var _10 in _1){_4.append(this.xmlSerializeField(_10,_1[_10],_2,_3))}} return _4.release(false)},isc.A.xmlSerializeField=function isc_DataSource_xmlSerializeField(_1,_2,_3,_4){var _5=isc.SB.create(),_6=this.getField(_1);if(_6==null&&(_1.startsWith("_")||_1.startsWith("$")))return;var _7=(_6?_6.type:null),_8=_3&&_3.flatData,_9=_3&&_3.spoofData,_4=_4||"";if(_9)_2=this.getSpoofedData(_6);if(this.logIsDebugEnabled("xmlSerialize")){this.logDebug("serializing fieldName: "+_1+" with type: "+_7+" with value: "+this.echo(_2),"xmlSerialize")} var _10=((_6&&_6.mustQualify)||_3.qualifyAll?this.getSchemaSet().schemaNamespace:null);var _11=_3.textContentProperty||this.textContentProperty,_12=this.getTextContentField();if(_1==_11&&(_12!=null||!this.hasXMLElementFields(_11))) {this.$45z=true;return this.$38f(_12,_2)} if(_7==this.$41v&&_2!=null){if(_2.iscAction){_2=_2.iscAction}else if(isc.isA.StringMethod(_2)){_2=_2.value}} var _13=!_3.xmlExplicitType||this.shouldWriteSchemaType(_6)?this.$38h(_6?_6.type:null,_2):null;var _14,_15=null;if(_3.xmlExplicitType){_14=true;_15=isc.Comm.omitXSI;isc.Comm.omitXSI=false} var _16=isc.Comm.$36u(_1,_13,_10,_3.nsPrefixes),_17=isc.Comm.$36v(_1,_10,_3.nsPrefixes);var _18=isc.isAn.Array(_2)?_2:[_2];if(!_6&&_3.schema&&_3.schema.getField){_6=_3.schema.getField(_1)} if(this.fieldIsComplexType(_1)){var _19=_3.parentSchemaNamespace;_3.parentSchemaNamespace=this.schemaNamespace;var _20=this.getFieldDataSource(_6,_6&&_6.xsElementRef?"element":null);if(_6.multiple){_5.append("\r",_4,_16);for(var i=0;i<_18.length;i++){var _22=_20;if(_18[i]!=null&&_18[i]._constructor){_22=isc.DS.get(_18[i]._constructor)||_20} _5.append(_22.xmlSerialize(_18[i],_3,_4+(!_3||_3.indent!=false?" ":""),_18[i]==null?_6.childTagName:_18[i].$97p||_6.childTagName))} _5.append("\r",_4,_17)}else if(_20.canBeArrayValued&&isc.isAn.Array(_2)){_5.append(_20.xmlSerialize(_2,_3,_4,_1))}else if(_18.length==1&&isc.isA.String(_18[0])&&isc.startsWith(_18[0],"ref:")){_16=isc.Comm.$36u(_1,_13,_10,_3.nsPrefixes,true);_5.append("\r",_4);_5.append(_16);_5.append(" ref=\"",_2.substring(4),"\"/>")}else{for(var i=0;i<_18.length;i++){var _2=_18[i];if(_2==null){_5.append("\r",_4);_5.append(_16,_17)}else if(isc.DS.isSimpleTypeValue(_2)){if(isc.isA.String(_2)&&isc.startsWith(_2,"ref:")){_5.append("\r",_4);_5.append(_16);var _23=(_6?_6.childTagName||_6.type:"value");_5.append("<",_23," ref=\"",_2.substring(4),"\"/>");_5.append(_17)}else{this.logWarn("simple type value "+this.echoLeaf(_2)+" passed to complex field '"+_6.name+"'","xmlSerialize");_5.append("\r",_4);_5.append(isc.Comm.xmlSerialize(_1,_2))}}else{_5.append(_20.xmlSerialize(_2,_3,_4,_1))}}} _3.parentSchemaNamespace=_19}else if(_6!=null){if(_6.xsElementRef){var _24=this.getType(_6.type);if(_24&&_24.schemaNamespace) {_10=_24.schemaNamespace}} if(_6.multiple){_5.append("\r",_4,_16,"\r");for(var i=0;i<_18.length;i++){_5.append(this.$38g(_6.childTagName,_6,_18[i],_10,_3),"\r",_4)} _5.append("\r",_4,_17,"\r")}else{for(var i=0;i<_18.length;i++){_5.append("\r",_4,this.$38g(_1,_6,_18[i],_10,_3))}}}else{for(var i=0;i<_18.length;i++){if(_18[i]==null||isc.isAn.emptyObject(_18[i])){_5.append("\r",_4,_16,_17)}else{_5.append("\r",_4,isc.Comm.$ew(_1,_18[i],_4,{isRoot:false}))}}} if(_14){isc.Comm.omitXSI=_15} return _5.release(false)},isc.A.shouldWriteSchemaType=function isc_DataSource_shouldWriteSchemaType(_1){if(!_1)return true;if(_1.serializeXMLType!=null)return _1.serializeXMLType;else{return(_1.type==null||_1.type=="any")}},isc.A.$38g=function isc_DataSource__serializeSimpleTypeTag(_1,_2,_3,_4,_5){var _6=_2.type,_5=_5||{};if(isc.isAn.Object(_3)&&!isc.isA.Function(_3.$ew)){return isc.Comm.xmlSerialize(_1||null,_3)}else{var _6=!_5.xmlExplicitType||this.shouldWriteSchemaType(_2)?this.$38h(_6,_3):null;if(_3==null&&_2.nillable){var _7=_1||"value";return isc.Comm.$36u(_7,null,_4,_5.nsPrefixes,true)+" xsi:nil=\"true\"/>"} if(isc.isA.Date(_3)){_3=_3.toSchemaDate(_2.type,!!this.trimMilliseconds)}else if(_3!=null&&_3.$ew){return _3.$ew(_1,_6,_4)}else{_3=isc.makeXMLSafe(_3)} return isc.Comm.$ex(_1||"value",_3,_6,_4,_5.nsPrefixes)}},isc.A.$38f=function isc_DataSource__serializeSimpleTypeValue(_1,_2){if(isc.isA.Date(_2)){return _2.toSchemaDate(_1?_1.type:null)}else{return isc.makeXMLSafe(_2)}},isc.A.$38h=function isc_DataSource__getXMLSchemaType(_1,_2){if(_2!=null&&(_1==null||_1=="any")){if(_2==null)return null;if(isc.isA.Date(_2)){return _2.logicalDate?"date":(_2.logicalTime?"time":"datetime")}else if(isc.isA.Number(_2)){if(parseInt(_2)==_2){return"float"}else{return"integer"}}else if(isc.isA.Boolean(_2)){return"boolean"}else if(isc.isA.String(_2)){return"text"}} switch(_1){case"integer":return"int";case"number":return"long";default:return _1}},isc.A.$151z=function isc_DataSource__getXmlExplicitTypes(_1){var _2=_1;if(isc.isA.String(_2))_2=(_2=="true");return _2},isc.A.xmlSerializeSample=function isc_DataSource_xmlSerializeSample(){return this.xmlSerialize({},{spoofData:true})},isc.A.getSpoofedData=function isc_DataSource_getSpoofedData(_1){if(!_1)return"textValue";if(this.getSchema(_1.type)!=null)return{};if(_1.multiple){_1={type:_1.type};return[this.getSpoofedData(_1),this.getSpoofedData(_1)]} if(_1.valueMap){var _2=!isc.isAn.Array(_1.valueMap)?isc.getKeys(_1.valueMap):_1.valueMap;return _2[Math.round(Math.random()*(_2.length-1))]} var _3=isc.SimpleType.getBaseType(_1.type);switch(_3){case"boolean":return(Math.random()>0.5);case"integer":case"int":case"number":var _4=0,_5=10;if(_1.validators){var _6=_1.validators.find("type","integerRange")||_1.validators.find("_constructor","integerRange");if(_6){this.logWarn(_1.name+" has "+_6.type+" validator with min "+_6.min+" and max "+_6.max);_4=_6.min||0;_5=_6.max||Math.min(_4,10);if(_4>_5)_4=_5}} return Math.round(_4+(Math.random()*(_5-_4)));case"float":case"decimal":case"double":var _4=0,_5=10,_7=2;if(_1.validators){var _6=_1.validators.find("type","floatRange")||_1.validators.find("_constructor","floatRange");if(_6){this.logWarn(_1.name+" has "+_6.type+" validator with min "+_6.min+" and max "+_6.max);_4=_6.min||0;_5=_6.max||Math.min(_4,10);if(_4>_5)_4=_5} var _8=_1.validators.find("type","floatPrecision")||_1.validators.find("_constructor","floatPrecision");if(_8){_7=_8.precision||2}} return(_4+(Math.random()*(_5-_4))).toFixed(_7);case"date":case"time":case"datetime":var _9=new Date();if(_1.validators){var _6=_1.validators.find("type","dateRange")||_1.validators.find("_constructor","dateRange");if(_6){this.logWarn(_1.name+" has "+_6.type+" validator with min "+_6.min+" and max "+_6.max);if(_6.min)_9=_6.min;else if(_6.max)_9=_6.max}} return _9;default:return"textValue"}},isc.A.getSerializeableFields=function isc_DataSource_getSerializeableFields(_1,_2){var _3=this.Super("getSerializeableFields",arguments);var _4=_3.fields;_4=isc.getValues(_4);for(var i=0;i<_4.length;i++){var _6=_4[i]=isc.addProperties({},_4[i]);var _7=_6.validators;if(_7){_6.validators=_7.findAll("_generated",null);if(_6.validators==null)delete _6.validators}} _3.fields=_4;return _3},isc.A.getMethods=function isc_DataSource_getMethods(){var _1=this.methods||[];if(this.superDS()!=null){_1.addAll(this.superDS().getMethods())} return _1},isc.A.getDeclaredMethod=function isc_DataSource_getDeclaredMethod(_1){var _2=this.getMethods();for(var i=0;i<_2.length;i++){if(_2[i].name==_1){return _2[i]}}},isc.A.getStringMethod=function isc_DataSource_getStringMethod(_1,_2){var _3=this.getDeclaredMethod(_1);if(_3){var _4=isc.addProperties({},_3);_4.value=_2;return isc.StringMethod.create(_4)} var _5=isc.DataSource.getNearestSchemaClass(this),_6;if(_5&&_5._stringMethodRegistry&&_5._stringMethodRegistry[_1]!==_6) {return isc.StringMethod.create({value:_2})}},isc.A.$378=function isc_DataSource__handleXMLReply(_1,_2,_3,_4){var _5=_1,_6=_4._dsRequest,_7=this.getOperationBinding(_6),_8;if(_3.status<0){var _9=_2||_3.data;this.$38b(_9,{status:_3.status,data:_9},_6,_3,_4);return} if(_5){if(_7.wsOperation){var _10=this.getWebService(_6),_8=_10.getOutputNamespaces(_7.wsOperation);_5.addNamespaces(_8)} _5.addNamespaces(this.xmlNamespaces);_5.addNamespaces(_7.xmlNamespaces)} var _11=isc.addProperties({},_8,this.xmlNamespaces,_7.xmlNamespaces);this.dsResponseFromXML(_5,_6,_11,{target:this,methodName:"$57b",xmlData:_5,dsRequest:_6,rpcRequest:_4,rpcResponse:_3})},isc.A.$57b=function isc_DataSource__completeHandleXMLReply(_1,_2){this.$38b(_2.xmlData,_1,_2.dsRequest,_2.rpcResponse,_2.rpcRequest)},isc.A.dsResponseFromXML=function isc_DataSource_dsResponseFromXML(_1,_2,_3,_4){if(_1){this.selectRecords(_1,_2,{target:this,methodName:"$57c",dsRequest:_2,callback:_4,xmlData:_1,xmlNamespaces:_3})}else{this.$57c([],_2,_3,_4)}},isc.A.$57c=function isc_DataSource__completeDSResponseFromXML(_1,_2,_3,_4){if(!_4&&_2.callback)_4=_2.callback;if(_2.xmlNamespaces)_3=_2.xmlNamespaces;if(_2.dsRequest)_2=_2.dsRequest;if(_3==null)_3=this.xmlNamespaces;var _5={data:_1,startRow:_2.startRow||0,status:0};_5.endRow=_5.startRow+Math.max(0,_1.length);_5.totalRows=Math.max(_5.endRow,_1.length);var _6=_4.xmlData;if(_6){if(this.totalRowsXPath){_5.totalRows=isc.xml.selectNumber(_6,this.totalRowsXPath,_3,true)} if(this.startRowXPath){_5.startRow=isc.xml.selectNumber(_6,this.startRowXPath,_3,true);_5.endRow=_5.startRow+Math.max(0,_1.length)} if(this.endRowXPath){_5.endRow=isc.xml.selectNumber(_6,this.endRowXPath,_3,true);if(!this.startRowXPath){_5.startRow=_5.endRow-Math.max(0,_1.length)}} if(this.statusXPath){_5.status=parseInt(isc.xml.selectScalar(_6,this.statusXPath,_3,true))} if(this.errorSchema){_5.errors=this.errorSchema.selectRecords(_6,_2)}} if(_4)this.fireCallback(_4,"dsResponse",[_5,_4]) return _5},isc.A.selectRecords=function isc_DataSource_selectRecords(_1,_2,_3){var _4=this.selectRecordElements(_1,_2);var _5=this.getOperationBinding(_2),_6=this.getSchema(_5.responseDataSchema)||this;return _6.recordsFromXML(_4,_3)},isc.A.recordsFromXML=function isc_DataSource_recordsFromXML(_1,_2){if(_1&&!isc.isAn.Array(_1)){if(_1.length!=null)_1=isc.xml.$37m(_1);else _1=[_1]} if(_1&&this.transformResponseToJS){if(_1.length>this.resultBatchSize){var _3={startingRow:0,callback:_2,elements:_1};return this.$57d(_3)} var _4=this.dropExtraFields?this.getFieldNames():null;_1=isc.xml.toJS(_1,_4,this);if(this.logIsDebugEnabled("xmlBinding")){this.logDebug("transformed response: "+this.echoFull(_1)+"xmlBinding")}} if(_2){this.fireCallback(_2,"records",[_1,_2])} return _1},isc.A.$57d=function isc_DataSource__asyncRecordsFromXML(_1){var _2=_1.elements,_3=_1.startingRow,_4=_1.callback,_5=Math.min(_2.length,_3+this.resultBatchSize),_6=this.dropExtraFields?this.getFieldNames():null;if(!_1.$57e){_1.$57e=isc.xml.toJS(_2.slice(_3,_5+1),_6,this)}else{var _7=isc.xml.toJS(_2.slice(_3,_5+1),_6,this);_1.$57e.addList(_7)} if(_5<_2.length){_1.startingRow=_5+1;this.delayCall("$57d",[_1])}else if(_4){this.fireCallback(_4,"records",[_1.$57e,_4])}},isc.A.selectRecordElements=function isc_DataSource_selectRecordElements(_1,_2){if(isc.isA.String(_1))_1=isc.xml.parseXML(_1);var _3=this.getOperationBinding(_2);var _4=_3==this?null:_3.recordXPath,_5=_3==this?null:_3.recordName,_6=this.recordXPath,_7=this.recordName;if(_4==null&&(_5!=null||(_6==null&&_7!=null))&&this.hasWSDLService(_2)) {var _8=this.getWebService(_2);return _8.selectByType(_1,_3.wsOperation||this.wsOperation,_5||_7)} var _9=_4||_6,_10;if(_9){_10=isc.xml.selectNodes(_1,_9,this.xmlNamespaces);this.logDebug("applying XPath: "+_9+(this.xmlNamespaces?" with namespaces: "+this.echo(this.xmlNamespaces):"")+" got "+(_10?_10.length:null)+" elements","xmlBinding")}else{_10=[];var _11=_5||_7||this.ID;var _12=_1.getElementsByTagName(_11);for(var i=0;i<_12.length;i++)_10.add(_12[i]);this.logDebug("getting elements of tag name: "+_11+" got "+_10.length+" elements","xmlBinding")} return _10},isc.A.$38b=function isc_DataSource__completeResponseProcessing(_1,_2,_3,_4,_5){if(!_2){_2={status:_4.status,httpResponseCode:_4.httpResponseCode}} if(_4!=null&&_5!=null){_2.httpResponseCode=_4.httpResponseCode;_2.httpResponseText=_4.httpResponseText;_2.transactionNum=_4.transactionNum;_2.clientContext=_5.clientContext;_2.internalClientContext=_5.internalClientContext;_2.httpHeaders=_4.httpHeaders}else{_2.clientContext=_3.clientContext;_2.internalClientContext=_3.internalClientContext} if(this.logIsInfoEnabled("xmlBinding")){this.logInfo("dsResponse is: "+this.echo(_2),"xmlBinding")} _2.context=_5;var _6=this.transformResponse(_2,_3,_1);_2=_6||_2;_2.startRow=this.$52v(_2.startRow,0);var _7=_2.endRow;if(_7==null){if(_2.status<0)_7=0;else if(isc.isAn.Array(_2.data))_7=_2.data.length;else _7=1} _2.endRow=this.$52v(_7);_2.totalRows=this.$52v(_2.totalRows,_2.endRow);if(!this.cacheAllData&&this.autoCacheAllData&&_3.downloadResult!=true&&_2.operationType=="fetch"&&(_3.data==null||isc.isAn.emptyObject(_3.data))&&_2.startRow==0&&_2.endRow==_2.totalRows) {if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("Response: switching on cacheAllData","cacheAllData")} this.cacheAllData=true;this.$85n=isc.timestamp()} if(this.useOfflineStorage&&_2.status==0&&!this.clientOnly){isc.DataSource.cacheResponse(_3,_2);if(isc.Offline&&!_2.fromOfflineCache){if(_3.unconvertedDSRequest){isc.Offline.storeResponse(_3.unconvertedDSRequest,_2)}else{isc.Offline.storeResponse(_3,_2)}}} if(_3&&_3.resultSet){if(_2.status==isc.RPCResponse.STATUS_OFFLINE){_3.resultSet.$78c=true}else{_3.resultSet.$78c=false}}else if(_3&&_3.resultTree){if(_2.status==isc.RPCResponse.STATUS_OFFLINE){_3.resultTree.$78c=true}else{_3.resultTree.$78c=false}} this.fireResponseCallbacks(_2,_3,_4,_5);if(_2.relatedUpdates!=null){for(var i=0;i<_2.relatedUpdates.length;i++){if(_2.relatedUpdates[i].operationType==null){_2.relatedUpdates[i].operationType=_2.operationType} var _9=isc.DS.get(_2.relatedUpdates[i].dataSource);if(_9==null){this.logWarn("DSResponse contained relatedUpdate referencing dataSource ID:"+_2.relatedUpdates[i].dataSource+". This dataSource appears not to be present - ignoring related update.")}else{_9.updateCaches(_2.relatedUpdates[i],null)}}}},isc.A.fireResponseCallbacks=function isc_DataSource_fireResponseCallbacks(_1,_2,_3,_4){if(!_1.clientContext)_1.clientContext={};if(_1.status>=0){isc.DataSource.handleUpdate(_1,_2)}else if(!_2.willHandleError){isc.RPCManager.$a0(_1,_2)} var _5=[_2.$376,_2.afterFlowCallback],_6=[];for(var i=0;i<_5.length;i++){var _8=_5[i];if(_6.contains(_8)){this.logWarn("Suppressed duplicate callback: "+_8);continue} var _9=this.fireCallback(_8,"dsResponse,data,dsRequest",[_1,_1.data,_2]);if(_4&&_4.willHandleError&&_9===false){this.logDebug("performOperationReply: Further processing cancelled by callback");break} if(_3){var _10=isc.RPCManager.getTransaction(_3.transactionNum);if(_10&&_10.suspended)return}}},isc.A.$52v=function isc_DataSource__parseNumber(_1,_2){if(_1==null)return _2;if(!isc.isA.String(_1))return _1;var _3=parseInt(_1);if(isNaN(_3))return _2!=null?_2:_1;else return _3},isc.A.transformResponse=function isc_DataSource_transformResponse(_1,_2,_3){return _1},isc.A.getFieldValue=function isc_DataSource_getFieldValue(_1,_2,_3){var _4=isc.xml.getFieldValue(_1,_2,_3,this,this.xmlNamespaces);if(!_3.getFieldValue)return _4;if(!isc.isA.Function(_3.getFieldValue)){isc.Func.replaceWithMethod(_3,"getFieldValue","record,value,field,fieldName")} return _3.getFieldValue(_1,_4,_3,_2)},isc.A.validateFieldValue=function isc_DataSource_validateFieldValue(_1,_2){if(!isc.Validator)return _2;var _3=_1.validators;if(!_3)return _2;if(!isc.isAn.Array(_3)){this.$2j[0]=_3;_3=this.$2j} var _4=_2;for(var i=0;i<_3.length;i++){var _6=_3[i];var _7=isc.Validator.processValidator(_1,_6,_2,null,null);if(!_7){this.logWarn(this.ID+"."+_1.name+": value: "+this.echoLeaf(_2)+" failed on validator: "+this.echo(_6));return _2} var _8;if(_6.resultingValue!==_8){_2=_6.resultingValue;_6.resultingValue=_8} if(!_7&&_6.stopIfFalse)break} this.$2j.length=0;return _2},isc.A.getCriteriaFields=function isc_DataSource_getCriteriaFields(_1){return isc.DS.getCriteriaFields(_1,this)},isc.A.$74s=function isc_DataSource__getAdvancedCriteriaFields(_1,_2){return isc.DS.$74s(_1,_2)},isc.A.fetchRecord=function isc_DataSource_fetchRecord(_1,_2,_3){var _4={},_5=this.getPrimaryKeyField();if(_5==null){this.logWarn("This datasource has no primary key field. Ignoring fetchRecord call");return} var _6=_5.name;var _7;if(isc.isAn.Object(_1)&&_1[_6]!==_7){_4=_1}else{_4[_6]=_1} return this.fetchData(_4,_2,_3)},isc.A.fetchData=function isc_DataSource_fetchData(_1,_2,_3){this.performDSOperation("fetch",_1,_2,_3)},isc.A.filterData=function isc_DataSource_filterData(_1,_2,_3){if(!_3)_3={};if(_3.textMatchStyle==null)_3.textMatchStyle="substring";this.performDSOperation("fetch",_1,_2,_3)},isc.A.exportClientData=function isc_DataSource_exportClientData(_1,_2,_3){if(_2.operationId){if(!this.operationBindings){this.logWarn("exportClientData() was passed operationId '"+_2.operationId+"', but this DataSource has no operationBindings. Delegating to the static exportClientData() method");delete _2.operationId} var _4,_5;for(var i=0;i=0&&isc.isAn.Array(_5)&&_5.length>0){_5=_5[0].fileContents}else{_5=null} this.fireCallback(_2,"dsResponse,data,dsRequest",[_4,_5,_6])},isc.addProperties({willHandleError:true},_3))},isc.A.hasFile=function isc_DataSource_hasFile(_1,_2){if(isc.isA.String(_1))_1=isc.DataSource.makeFileSpec(_1);this.performDSOperation("hasFile",_1,function(_3,_4,_5){if(_3.status>=0){_4=!!(isc.isAn.Array(_4)&&_4.length>0)}else{_4=false} this.fireCallback(_2,"dsResponse,data,dsRequest",[_3,_4,_5])},{willHandleError:true})},isc.A.listFiles=function isc_DataSource_listFiles(_1,_2){if(!_1)_1={};this.performDSOperation("listFiles",_1,function(_3,_4,_5){if(_3.status<0)_4=null;this.fireCallback(_2,"dsResponse,data,dsRequest",[_3,_4,_5])},{willHandleError:true})},isc.A.saveFile=function isc_DataSource_saveFile(_1,_2,_3,_4){if(isc.isA.String(_1))_1=isc.DataSource.makeFileSpec(_1);var _5=isc.addProperties({fileContents:_2},_1);this.performDSOperation("saveFile",_5,function(_6,_7,_8){if(_6.status<0)_7=null;if(isc.isAn.Array(_7))_7=_7[0];this.fireCallback(_3,"dsResponse,data,dsRequest",[_6,_7,_8])},isc.addProperties({willHandleError:true},_4))},isc.A.renameFile=function isc_DataSource_renameFile(_1,_2,_3,_4,_5){if(isc.isA.String(_1))_1=isc.DataSource.makeFileSpec(_1);if(isc.isA.String(_2))_2=isc.DataSource.makeFileSpec(_2);if(!_2.fileType)_2.fileType=_1.fileType;if(!_2.fileFormat)_2.fileFormat=_1.fileFormat;if(!_2.fileName)_2.fileName=_1.fileName;this.performDSOperation("renameFile",_2,function(_6,_7,_8){if(_6.status<0)_7=null;this.fireCallback(_3,"dsResponse,data,dsRequest",[_6,_7,_8])},{willHandleError:true,oldValues:_1})},isc.A.removeFile=function isc_DataSource_removeFile(_1,_2,_3){if(isc.isA.String(_1))_1=isc.DataSource.makeFileSpec(_1);this.performDSOperation("removeFile",_1,function(_4,_5,_6){if(_4.status<0)_5=null;this.fireCallback(_2,"dsResponse,data,dsRequest",[_4,_5,_6])},{willHandleError:true})},isc.A.listFileVersions=function isc_DataSource_listFileVersions(_1,_2){if(isc.isA.String(_1))_1=isc.DataSource.makeFileSpec(_1);this.performDSOperation("listFileVersions",_1,function(_3,_4,_5){if(_3.status<0)_4=null;this.fireCallback(_2,"dsResponse,data,dsRequest",[_3,_4,_5])},{willHandleError:true})},isc.A.getFileVersion=function isc_DataSource_getFileVersion(_1,_2,_3){if(isc.isA.String(_1))_1=isc.DataSource.makeFileSpec(_1);_1.version=_2;this.performDSOperation("getFileVersion",_1,function(_4,_5,_6){if(_4.status>=0&&isc.isAn.Array(_5)&&_5.length>0){_5=_5[0].fileContents}else{_5=null} this.fireCallback(_3,"dsResponse,data,dsRequest",[_4,_5,_6])},{willHandleError:true})},isc.A.hasFileVersion=function isc_DataSource_hasFileVersion(_1,_2,_3){if(isc.isA.String(_1))_1=isc.DataSource.makeFileSpec(_1);_1.version=_2;this.performDSOperation("hasFileVersion",_1,function(_4,_5,_6){if(_4.status>=0){_5=!!(isc.isAn.Array(_5)&&_5.length>0)}else{_5=false} this.fireCallback(_3,"dsResponse,data,dsRequest",[_4,_5,_6])},{willHandleError:true})},isc.A.removeFileVersion=function isc_DataSource_removeFileVersion(_1,_2,_3){if(isc.isA.String(_1))_1=isc.DataSource.makeFileSpec(_1);_1.version=_2;this.performDSOperation("removeFileVersion",_1,function(_4,_5,_6){if(_4.status<0)_5=null;this.fireCallback(_3,"dsResponse,data,dsRequest",[_4,_5,_6])},{willHandleError:true})},isc.A.$625=function isc_DataSource__getNextRequestId(){if(!this.$626)this.$626=[this.getID(),"$627"];this.$626[2]=isc.DataSource.$625();return this.$626.join(isc.emptyString)},isc.A.shouldUseStrictJSON=function isc_DataSource_shouldUseStrictJSON(_1){if(_1&&_1.useStrictJSON!=null)return _1.useStrictJSON;if(this.useStrictJSON!=null)return this.useStrictJSON;if(isc.Browser.isIE&&isc.Browser.version>=9&&isc.RPCManager.useJSONParse_IE9&&this.dataFormat=="iscServer") {return true} return null},isc.A.shouldFallbackToEval=function isc_DataSource_shouldFallbackToEval(_1){if(_1==null)_1={};if(_1.fallbackToEval!=null)return _1.fallbackToEval;if(_1.useStrictJSON||this.useStrictJSON)return false;return(isc.Browser.isIE&&isc.Browser.version>=9&&isc.RPCManager.useJSONParse_IE9&&this.dataFormat=="iscServer")},isc.A.execute=function isc_DataSource_execute(_1){this.performDSOperation(_1.operationType||"fetch",_1.data,_1.callback,_1)},isc.A.performDSOperation=function isc_DataSource_performDSOperation(_1,_2,_3,_4){if(isc.$cv)arguments.$cw=this;var _5=isc.addProperties({operationType:_1,dataSource:this.ID,data:_2,callback:_3,requestId:this.$625(),$135x:_4&&_4.useStrictJSON,useStrictJSON:this.shouldUseStrictJSON(_4),$135v:_4&&_4.fallbackToEval,fallbackToEval:this.shouldFallbackToEval(_4),textMatchStyle:this.defaultTextMatchStyle},_4);isc.DataSource.recordTimingData(_5,"UI event to DSRequest creation","start",isc.EH.$117e);isc.DataSource.recordTimingData(_5,"UI event to DSRequest creation","end");isc.DataSource.recordTimingData(_5,"performDSOperation","start");_5.lastClientEventThreadCode=isc.EH.$lc;var _6=isc.EH.getLastEvent();if(_5.sortBy!=null){if(!isc.isAn.Array(_5.sortBy))_5.sortBy=[_5.sortBy];if(isc.isAn.Object(_5.sortBy[0])){_5.sortBy=isc.DS.getSortBy(_5.sortBy)} for(var i=0;i<_5.sortBy.length;i++){var _8=_5.sortBy[i];if(!isc.isA.String(_8))continue;var _9=this.getField(_8.charAt(0)=="-"?_8.substring(1):_8);if(_9&&_9.canSortClientOnly)_5.sortBy[i]=null} _5.sortBy.removeEmpty();if(_5.sortBy.length==0)delete _5.sortBy} if(this.sendParentNode==false){_5.$135w=_5.parentNode;_5.parentNode=null} return this.sendDSRequest(_5)},isc.A.translatePatternOperatorInAdvancedCriteria=function isc_DataSource_translatePatternOperatorInAdvancedCriteria(_1){if(!this.isAdvancedCriteria(_1)){return _1} var _2,_3;if(_1.criteria){if(isc.isA.Array(_1.criteria)){for(_2 in _1.criteria){_3=_1.criteria[_2];_1.criteria[_2]=this.translatePatternOperatorInAdvancedCriteria(_3)}}else{_1.criteria=this.translatePatternOperatorInAdvancedCriteria(_1.criteria)}}else{_3=_1;if(_3.operator==="matchesPattern"||_3.operator==="iMatchesPattern"||_3.operator==="containsPattern"||_3.operator==="iContainsPattern") {var _4=(_3.operator.indexOf('i')===0);var _5=(isc.isA.Array(this.patternMultiWildcard)?this.patternMultiWildcard[0]:this.patternMultiWildcard.substring(0,1));var _6=_3.fieldName;var _7=_3.value;if(isc.isA.Array(this.patternMultiWildcard)){for(var _2=1;_21){_10={_constructor:"AdvancedCriteria",operator:"and",criteria:[]};for(var _11=0;_11<_8.length;_11++){var _12=_8[_11];if(!_12||_12.length==0){continue} _9={fieldName:_6,value:_12};var _13=_11>0,_14=_8.length-1>_11;if(_13&&_14||(_3.operator==="containsPattern"||_3.operator==="iContainsPattern")){_9.operator=_4?"iContains":"contains"}if(_3.operator==='startsWithPattern'||_3.operator==='iStartsWithPattern'){_9.operator=_4?"iStartsWith":"startsWith"}if(_3.operator==='endsWithPattern'||_3.operator==='iEndsWithPattern'){_9.operator=_4?"iEndsWith":"endsWith"}else if(_13){_9.operator=_4?"iEndsWith":"endsWith"}else if(_14){_9.operator=_4?"iStartsWith":"startsWith"} _10.criteria.add(_9)}} _1=_10}} return _1},isc.A.sendDSRequest=function isc_DataSource_sendDSRequest(_1){isc.addDefaults(_1,this.getOperationBinding(_1.operationType).requestProperties);isc.addDefaults(_1,this.requestProperties);var _2=this.getDataFormat(_1);var _3=this.getDataProtocol(_1);if(_2=="iscServer"&&!(this.clientOnly||_3=="clientCustom")&&!isc.hasOptionalModule("SCServer")) {if(this.dataURL==null&&this.testFileName==null){this.logError("DataSource: "+this.ID+": attempt to use DataSource of type iscServer without SmartClient Server option. Please either set clientOnly: true for one-time fetch against dataURL/testFileName or upgrade to SmartClient Pro, Power or Enterprise");return} this.logInfo("Switching to clientOnly - no SmartClient Server installed.");this.clientOnly=true} if(_1.bypassCache==null){_1.$135u=_1.bypassCache;_1.bypassCache=this.shouldBypassCache(_1)} if(_1.showPrompt==null){_1.showPrompt=_1.downloadResult?false:this.showPrompt} if(!this.cacheAllData&&this.autoCacheAllData&&_1.downloadResult!=true&&_1.operationType=="fetch"&&_1.startRow==null&&_1.endRow==null&&(_1.data==null||isc.isAn.emptyObject(_1.data))) {if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("sendDSRequest: switching on cacheAllData","cacheAllData")} this.cacheAllData=true;this.$85n=isc.timestamp()} if(_1.operationType=="fetch"&&this.fetchingClientOnlyData(_1))return;if(this.logIsDebugEnabled()){this.logDebug("Outbound DSRequest: "+this.echo(_1))} _1.$376=_1.callback;var _4=_1.operationType;if((_4=="update"||_4=="add")&&(this.sparseUpdates||this.noNullUpdates)) {isc.DataSource.recordTimingData(_1,"Sparse updates processing","start");_1.data=this.$708(_1.data,this);this.$79c(_1.data,_1.oldValues,_4,this);isc.DataSource.recordTimingData(_1,"Sparse updates processing","end")} if(_2=="iscServer"){this.$754(_1);_1.unconvertedDSRequest=isc.shallowClone(_1);_1.jsonReviver=isc.DataSource.iscServer_strictJSONReviver;if(this.autoConvertRelativeDates==true){if(this.logIsInfoEnabled("relativeDates")){this.logInfo("Calling convertRelativeDates from sendDSRequest - data is\n\n"+isc.echoFull(_5))} var _5=this.convertRelativeDates(_1.data);if(this.logIsInfoEnabled("relativeDates")){this.logInfo("Called convertRelativeDates from sendDSRequest - data is\n\n"+isc.echoFull(_5))} _1.data=_5} if(this.translatePatternOperators===true&&this.isAdvancedCriteria(_1.data)){_1.data=this.translatePatternOperatorInAdvancedCriteria(_1.data)} _1.dataProtocol=_3;var _6=this.transformRequest(_1);if(_6!==_1){_1.data=_6} var _7=this.getDataProtocol(_1);if(_7=="clientCustom")return;delete this.$624[_1.requestId];if(_1.shouldUseCache===false||(_1.shouldUseCache!==true)&&!this.clientOnly&&(!this.cacheAllData||_1.downloadResult||_1.cachingAllData||(_1.operationType!=null&&_1.operationType!="fetch")||(_1.operationType=="fetch"&&this.cacheAllOperationId&&this.cacheAcrossOperationIds==false&&_1.operationId!=this.cacheAllOperationId))) {if(this.logIsInfoEnabled("cacheAllData")&&_1.cachingAllData){this.logInfo("sendDSRequest: processing cacheAllData request","cacheAllData")} this.addDefaultCriteria(_1,this.getOperationBinding(_1));this.applySendExtraFields(_1);var _8=this.getOperationBinding(_1);if(_8==null)_8={};var _9=_8.defaultParams||this.defaultParams;if(_9){_1.data=isc.addProperties({},_9,_1.data)} return this.performSCServerOperation(_1,_1.data)}} var _10=this.getServiceInputs(_1);var _11=_1.shouldUseCache===true||(this.cacheAllData&&_1.operationType=="fetch"&&!_1.cachingAllData&&!_1.downloadResult&&!(this.cacheAllOperationId&&this.cacheAcrossOperationIds==false&&_1.operationId!=this.cacheAllOperationId));if(_10.dataProtocol=="clientCustom"&&!_11)return;var _12=isc.addProperties({},_1,_10);_12._dsRequest=_1;if(_10.data==null)_12.data=null;if(this.clientOnly||_11){_12.clientOnly=true;_12.callback={target:this,methodName:"$50e"};isc.RPC.sendRequest(_12);return} var _13=this.getOperationBinding(_1);_12.transport=_13.dataTransport||this.dataTransport;if(_12.transport=="scriptInclude"){_12.callback={target:this,methodName:"$377"};if(!_12.callbackParam){_12.callbackParam=_13.callbackParam||this.callbackParam} isc.rpc.sendRequest(_12);return} var _2=this.getDataFormat(_1);if(_2=="xml"){var _14=_12.spoofedResponse;if(!_14){_12.callback={target:this,method:this.$378};isc.xml.getXMLResponse(_12)}else{var _15=this;isc.Timer.setTimeout(function(){_15.$378(isc.xml.parseXML(_14),_14,{status:0,httpResponseCode:200,data:_14},_12)})}}else if(_2=="json"){_12.callback={target:this,method:this.$379};isc.rpc.sendProxied(_12)}else if(_2=="csv"){_12.callback={target:this,method:this.$69k};isc.rpc.sendProxied(_12)}else{_12.serverOutputAsString=true;_12.callback={target:this,method:this.$38a};isc.rpc.sendProxied(_12)}},isc.A.$79c=function isc_DataSource__applySparseAndNoNullUpdates(_1,_2,_3,_4){var _5=_4||this;if(!_5.noNullUpdates){if(!_5.sparseUpdates)return;if(_2==null)return} var _6={__ref:true,__module:true};for(var _7 in _1){if(isc.isA.Function(_1[_7]))continue;if(_6[_7]==true)continue;if(isc.isAn.Instance(_1[_7])||isc.isA.Class(_1[_7]))continue;var _8=_1[_7];if(_5.noNullUpdates&&_8===null){if(_3=="add"&&_5.omitNullDefaultsOnAdd==true){delete _1[_7]}else{var _9=_5.getField(_7),_10;if(_9&&_9.nullReplacementValue!==_10){_1[_7]=_9.nullReplacementValue}else{var _11=isc.SimpleType.getBaseType(_9.type,_5);if(_11=="integer"){_1[_7]=_5.nullIntegerValue}else if(_11=="float"){_1[_7]=_5.nullFloatValue}else if(_11=="date"||_11=="time"){_1[_7]=_5.nullDateValue}else if(_11=="boolean"){_1[_7]=_5.nullBooleanValue}else{_1[_7]=_5.nullStringValue}}}}else if(_5.sparseUpdates&&_3=="update"){if(_2==null)continue;var _12=_2[_7];if(_12==null&&!(_8==null))continue;if(_5!=null){var _9=_5.getField(_7);if(_9&&_9.primaryKey)continue} if(isc.isA.Date(_8)&&Date.compareDates(_8,_12)==0){delete _1[_7]}else if(isc.isAn.Array(_8)){for(var i=0;i<_8.length;i++){this.$79c(_8[i],_12[i],_3,_9==null?null:isc.DataSource.get(_9.type));var _14=0;for(var _15 in _8[i])_14++;if(_14==0)delete _8[i]} var _16=false;for(var i=0;i<_8.length;i++){if(_8[i]!=null){_16=true;break}} if(!_16)delete _1[_7]}else if(isc.isAn.Object(_8)){this.$79c(_8,_12,_3,_9==null?null:isc.DataSource.get(_9.type));var _14=0;for(var _15 in _8)_14++;if(_14==0)delete _1[_7]}else if(_8==_12){delete _1[_7]}}}},isc.A.$708=function isc_DataSource__cloneValues(_1,_2,_3){if(_1==null)return;var _4=_2?_2.deepCloneOnEdit:this.deepCloneOnEdit,_5=_4==null?isc.DataSource.deepCloneOnEdit:_4;if(isc.isAn.Array(_1)){var _6=[];for(var i=0;i<_1.length;i++){var _8=_1[i];if(isc.isA.Function(_8))continue;if(isc.isAn.Instance(_1[_10])||isc.isA.Class(_1[_10]))continue;if(_8==null||isc.isA.String(_8)||isc.isA.Boolean(_8)||isc.isA.Number(_8)) {_6[_6.length]=_8}else if(isc.isA.Date(_8)){_6[_6.length]=new Date(_8.getTime())}else if(isc.isAn.Object(_8)){_6[_6.length]=this.$708(_8,_2,_3)}} return _6} var _6={};if(_1.$42c!=null){_1=isc.JSONEncoder.$42b(_1)} var _9={__ref:true,__module:true};if(isc.DataSource.cloneValuesSafely){if(!_3)_3=[];if(_3.contains(_1)){_6=_1;return} _3.add(_1)} for(var _10 in _1){if(isc.isA.Function(_1[_10]))continue;if(_9[_10]==true)continue;if(isc.isAn.Instance(_1[_10])||isc.isA.Class(_1[_10]))continue;var _11=_1[_10];if(isc.isA.Date(_11)){_6[_10]=_11.duplicate()}else if(isc.isAn.Object(_11)){var _12=_2?_2.getField(_10):null;if(!_12){_6[_10]=_1[_10]}else{if(_12.deepCloneOnEdit==true||(_12.deepCloneOnEdit==null&&_5)) {if(isc.DataSource.cloneValuesSafely){if(_3.contains(_11)){_6[_10]=_1[_10];continue} _3.add(_11)} _6[_10]=this.$708(_11,isc.DataSource.get(_12.type))}else{_6[_10]=_1[_10]}}}else{_6[_10]=_1[_10]}} return _6},isc.A.fulfilledFromOffline=function isc_DataSource_fulfilledFromOffline(_1){var _2=_1.unconvertedDSRequest?_1.unconvertedDSRequest:_1;if(this.useOfflineStorage&&isc.Offline){var _3=_1.dataSource+"."+_1.operationType;if(isc.Offline.isOffline()){var _4=isc.Offline.getResponse(_2);this.logInfo("currently offline, for request: "+_3+" found cached response: "+this.echoLeaf(_4),"offline");if(this.useOfflineResponse&&!this.useOfflineResponse(_2,_4)){this.logInfo("User-written useOfflineResponse() method returned false; not using cached response","offline");_4=null} this.processOfflineResponse(_1,_4);return true}else if(_2.useOfflineCache||_2.useOfflineCacheOnly){var _4=isc.Offline.getResponse(_2);if(_4!=null){this.logInfo("request: "+_3+", returning cached offline response","offline");if(this.useOfflineResponse&&!this.useOfflineResponse(_2,_4)){this.logInfo("User-written useOfflineResponse() method returned false; not using cached response","offline");_4=null} this.processOfflineResponse(_1,_4);return true}else if(_1.useOfflineCacheOnly){this.logInfo("request: "+_3+": useOfflineCacheOnly: no response available","offline");this.processOfflineResponse(_1);return true} this.logInfo("request: "+_3+", no cached response, proceeding with network request","offline")}} return false},isc.A.processOfflineResponse=function isc_DataSource_processOfflineResponse(_1,_2){if(!_2){_2={status:isc.RPCResponse.STATUS_OFFLINE,data:isc.DataSource.offlineMessage}} _2.clientContext=_1.clientContext;_2.internalClientContext=_1.internalClientContext;_2.isCachedResponse=true;this.fireResponseCallbacks(_2,_1)},isc.A.performSCServerOperation=function isc_DataSource_performSCServerOperation(_1,_2){this.logWarn("Attempt to perform iscServer request requires options SmartClient server support - not present in this build.\nRequest details:"+this.echo(_1));return},isc.A.getSchema=function isc_DataSource_getSchema(_1,_2){var _3=this.getSchemaSet();if(_3!=null){var _4=_3.getSchema(_1,_2);if(_4!=null)return _4} var _5=this.getWebService();if(isc.isA.WebService(_5))return _5.getSchema(_1,_2);return isc.DS.get(_1,null,null,_2)},isc.A.getTitle=function isc_DataSource_getTitle(){return this.title||this.getAutoTitle(this.ID)},isc.A.getPluralTitle=function isc_DataSource_getPluralTitle(){return this.pluralTitle||(this.getTitle()+"s")},isc.A.getTitleField=function isc_DataSource_getTitleField(){if(this.titleField==null){var _1=isc.getKeys(this.getFields());var _2=_1.map("toLowerCase");for(var i=0;i0&&isc.isAn.Object(_2.get(0))},isc.A.getFieldDataSource=function isc_DataSource_getFieldDataSource(_1,_2){if(!_1)return null;if(this.fieldIsAnonDataSource(_1)){if(!_1.$67z){var _3=isc.DataSource.create({"class":"DataSource",fields:_1.fields});_1.$67z=_3} return _1.$67z} return _1.type!=null?this.getSchema(_1.type,_2):null},isc.A.findTagOfType=function isc_DataSource_findTagOfType(_1,_2,_3){var _4=this.getFieldNames();for(var i=0;i<_4.length;i++){var _6=_4[i],_7=this.getField(_6);if(_7.type==_1)return[this,_6,_2,_3];if(this.fieldIsComplexType(_6)){var _8=this.getFieldDataSource(_7),_9=_8.findTagOfType(_1,this,_6);if(_9)return _9}}},isc.A.getTextContentField=function isc_DataSource_getTextContentField(){return this.getField(this.textContentProperty)},isc.A.hasXMLElementFields=function isc_DataSource_hasXMLElementFields(_1){_1=_1||this.textContentProperty;var _2=this.getFieldNames();for(var i=0;i<_2.length;i++){if(_2[i]==_1)continue;if(this.getField(_2[i]).xmlAttribute)continue;return true} return false},isc.A.getGroups=function isc_DataSource_getGroups(){var _1=this;while(_1.groups==null&&_1.hasSuperDS())_1=_1.superDS();return _1.groups},isc.A.getObjectField=function isc_DataSource_getObjectField(_1,_2,_3){if(!_1)return null;var _4=this.getLocalFields(),_5=isc.getKeys(_4).reverse();var _6=isc.DataSource.getNearestSchema(_1),_7=isc.DataSource.getNearestSchemaClass(_6);if(_3==null)_3={};var _8=-1,_9=null;for(var i=0;i<_5.length;i++){var _11=_5[i],_12=_4[_11],_13;if(isc.endsWith(_11,this.$dr)||isc.endsWith(_11,this.$dq))continue;if(!_2&&(_3[_11]||_12.advanced||_12.inapplicable||_12.hidden||(_12.visibility!=null&&_12.visibility=="internal"))) {_3[_11]=_11;continue} if(!_7&&_12.type==_1)return _11;if(_7&&_7.isA(_12.type)){_13=isc.DS.getInheritanceDistance(_12.type,_1);if(_9==null||_13<_8){_9=_11;_8=_13}}} if(_9!=null){if(_8==0||!this.hasSuperDS()){return _9}else{var _14=this.superDS().getObjectField(_1,_2,_3);if(_14){var _15=this.getField(_14).type,_16=isc.DS.getInheritanceDistance(_15,_1)} return(_14&&(_16<_8))?_14:_9}}else if(this.hasSuperDS()){return this.superDS().getObjectField(_1,_2,_3)} return null},isc.A.getLocalPrimaryKeyFields=function isc_DataSource_getLocalPrimaryKeyFields(){if(!this.primaryKeys){this.primaryKeys={};var _1=this.getFields();for(var _2 in _1){var _3=_1[_2];if(_3.primaryKey){this.primaryKeys[_2]=_3}}} return this.primaryKeys},isc.A.filterPrimaryKeyFields=function isc_DataSource_filterPrimaryKeyFields(_1){var _2=this.getPrimaryKeyFields();return isc.applyMask(_1,isc.getKeys(_2))},isc.A.filterDSFields=function isc_DataSource_filterDSFields(_1){var _2=this.getFields();return isc.applyMask(_1,isc.getKeys(_2))},isc.A.recordHasAllKeys=function isc_DataSource_recordHasAllKeys(_1){var _2=this.getPrimaryKeyFields();for(var _3 in _2){if(_1[_3]==null)return false} return true},isc.A.getForeignKeysByRelation=function isc_DataSource_getForeignKeysByRelation(_1,_2){var _3=this.getForeignKeyFields(_2);if(!_3)return{};var _4={};for(var _5 in _3){var _6=_3[_5];var _7=isc.DataSource.getForeignFieldName(_6);var _8=_1[_7];if(_8||_8===0)_4[_5]=_8} return _4},isc.A.getPrimaryKeyFields=function isc_DataSource_getPrimaryKeyFields(){if(!this.mergedPrimaryKeys){this.mergedPrimaryKeys={};if(this.hasSuperDS()){isc.addProperties(this.mergedPrimaryKeys,this.superDS().getPrimaryKeyFields())} isc.addProperties(this.mergedPrimaryKeys,this.getLocalPrimaryKeyFields())} return this.mergedPrimaryKeys},isc.A.getForeignKeyFields=function isc_DataSource_getForeignKeyFields(_1){if(isc.isA.DataSource(_1))_1=_1.ID;var _2=this.getFields();if(!_2)return null;var _3={};for(var _4 in _2){var _5=_2[_4];if(_5.foreignKey){if(_1){var _6=isc.DataSource.getForeignDSName(_5,(_1||this));if(_6!=_1)continue} _3[_5.name]=_5}} return _3},isc.A.getLocalPrimaryKeyFieldNames=function isc_DataSource_getLocalPrimaryKeyFieldNames(){var _1=this.getLocalPrimaryKeyFields();var _2=[];for(var _3 in _1){_2.add(_3)} return _2},isc.A.getPrimaryKeyFieldNames=function isc_DataSource_getPrimaryKeyFieldNames(){return isc.getKeys(this.getPrimaryKeyFields())},isc.A.getPrimaryKeyField=function isc_DataSource_getPrimaryKeyField(){var _1=this.getPrimaryKeyFields();for(var _2 in _1){return _1[_2]}},isc.A.getPrimaryKeyFieldName=function isc_DataSource_getPrimaryKeyFieldName(){return this.getPrimaryKeyFieldNames()[0]},isc.A.addChildDataSource=function isc_DataSource_addChildDataSource(_1){var _2=this.$38m=(this.$38m||[]);_2.add(_1)},isc.A.getChildDataSources=function isc_DataSource_getChildDataSources(){return this.$38m},isc.A.getChildDataSource=function isc_DataSource_getChildDataSource(_1){var _2=this.getChildDataSources();if(_2==null)return null;var _3;for(var i=0;i<_2.length;i++){if(!_2[i]||(_1&&_2[i]==this))continue;if(!_3){_3=_2[i]}else if(_3!=_2[i]){this.logInfo("getChildDatasource(): This DataSource has multiple child DataSources defined making getChildDataSource() ambiguous. Returning the first child dataSource only - call getChildDataSources() to retrieve a complete list.");break}} return _3},isc.A.getTreeRelationship=function isc_DataSource_getTreeRelationship(_1,_2){if(isc.isA.String(_1))_1=this.getSchema(_1);var _3=this.getFields();if(_2==null){for(var _4 in _3){var _5=_3[_4];if(_5.foreignKey!=null){if(!_1||(_1.getID()==isc.DataSource.getForeignDSName(_5,this))) {_2=_4;break}}}} var _6;if(_2==null&&_1){_2=_6=isc.getKeys(this.fields).intersect(isc.getKeys(_1.fields))[0];this.logInfo("no foreign key declaration, guessing tree relationship is on field name: "+_2+" which occurs in both DataSources")} var _7;if(_2)_7=_3[_2];if(_7==null){this.logDebug("getTreeRelationship(): Unable to find foreignKeyField.foreignKeyFieldName specified as:"+_2)} if(!_1){if(!_7)_1=this;else{var _8=isc.DataSource.getForeignDSName(_7,this);_1=this.getSchema(_8)}} if(!_6)_6=_7?isc.DataSource.getForeignFieldName(_7):null;if(_6==null){var _9=_1.getPrimaryKeyFieldNames();if(isc.isAn.Array(_9)){if(_9.length>1){this.logWarn("getTreeRelationship: dataSource '"+_1.ID+"' has multi-field primary key, which is not supported for tree viewing. Using field '"+_9[0]+"' as the only primary key field")} _9=_9[0]} _6=_9} var _10;var _11;if(this.childrenField)_11=this.childrenField;for(_4 in _3){var _7=_3[_4];if(_7.isFolderProperty)_10=_4;if(_7.childrenProperty)_11=_4;if(_11==_4&&(_7.multiple==null)){_7.multiple=true}} var _12={childDS:this,parentDS:_1,isFolderProperty:_10} if(_2){_12.parentIdField=_2;_12.idField=_6} if(_11)_12.childrenProperty=_11;if(_11==null&&_2==null){this.logInfo("getTreeRelationship(): No specified foreignKeyField or childrenProperty.")} if(_1==this){var _13=_2?this.getField(_2).rootValue:null;if(_13==null)_12.rootValue=null;else _12.rootValue=_13} return _12},isc.A.combineFieldOrders=function isc_DataSource_combineFieldOrders(_1,_2,_3){var _4=[];this.$38n(_2,0,_1,_4,_3);for(var _5 in _1){var _6=_1[_5],_7=_2.findIndex(this.$375,_5);if(_7!=-1){var _8=_2[_7],_9=this.combineFieldData(_8);if(_3==null||_3(_9,this,true))_4.add(_9);this.$38n(_2,_7+1,_1,_4,_3)}else{if(_3==null||_3(_6,this)){var _9=isc.addProperties({},_6);if(_9.hidden)delete _9.hidden;_4.add(_9)}}} return _4},isc.A.$38n=function isc_DataSource__addNonDSFields(_1,_2,_3,_4,_5){for(var i=_2;i<_1.length;i++){var _7=_1[i];if(_7.name!=null&&_3[_7.name]!=null)return;if(_5==null||!_5(_7,this,true))continue;isc.SimpleType.addTypeDefaults(_7);_4.add(_7)}},isc.A.combineFieldData=function isc_DataSource_combineFieldData(_1,_2,_3){var _4;if(isc.isAn.Object(_2))_4=_2;else _4=this.getField(_2||_1.name);return isc.DataSource.combineFieldData(_1,_4,_3)},isc.A.$38l=function isc_DataSource__addTypeDefaults(_1){if(_1==null)_1=this.fields;for(var _2 in _1){var _3=_1[_2];if(_3&&_3.required==null&&_3.xmlRequired!=null&&_3.xmlNonEmpty!=null) {_3.required=_3.xmlRequired&&_3.xmlNonEmpty} if(_3&&(_3.childrenProperty||_3.name==this.childrenField)){if(!_3.type)_3.type=this.ID} isc.SimpleType.addTypeDefaults(_3,this);this.$75f(_3)}},isc.A.$75f=function isc_DataSource__addFieldValidators(_1){var _2={type:"required"};if(_1.required){var _3=isc.addProperties({},_2),_4=_1.requiredMessage||this.requiredMessage;if(_4!=null)_3.errorMessage=_4;if(!_1.validators){_1.validators=[_3]}else{if(!isc.isAn.Array(_1.validators)){_1.validators=[_1.validators]} if(_1.validators.$69){_1.validators=_1.validators.duplicate()} _1.validators.add(_3)}}},isc.A.$63p=function isc_DataSource__autoDeriveTitles(){if(!this.autoDeriveTitles)return;for(var _1 in this.fields){var _2=this.fields[_1];if(_2.title!=null)continue;_2.title=this.getAutoTitle(_1);_2.$76s=true}},isc.A.getAutoTitle=function isc_DataSource_getAutoTitle(_1){return isc.DataSource.getAutoTitle(_1)},isc.A.getType=function isc_DataSource_getType(_1){if(this.schemaNamespace){var _2=isc.SchemaSet.get(this.schemaNamespace),_3=_2.getSimpleType(_1);if(_3)return _3} var _3=isc.SimpleType.getType(_1);if(_3!=null)return _3;if(this.types&&this.types[_1])return this.types[_1];return null},isc.A.firstCacheAllDataRequest=function isc_DataSource_firstCacheAllDataRequest(_1){if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("firstCacheAllDataRequest: refreshing cache","cacheAllData")} this.$498=[_1];if(this.$839==null){var _2=this.transformRequest,_3=this.transformResponse,_4=this.$ba;if(_4){if(_4.transformRequest){_2=this[isc.$ah+"transformRequest"]} if(_4.transformResponse){_3=this[isc.$ah+"transformResponse"]}} this.transformServerRequest=_2;this.transformServerResponse=_3;this.addMethods({transformRequest:function(_1){var _5=(_1.cachingAllData||(_1.operationType&&_1.operationType!="fetch"));if(!_5)return _1;return this.transformServerRequest(_1)},transformResponse:function(_9,_1,_10){var _5=(_1.cachingAllData||(_1.operationType&&_1.operationType!="fetch"));if(!_5){var _6=this.$85n,_7=_1.$85o;if(!_6||!_7||_7>=_6) return _9} return this.transformServerResponse(_9,_1,_10)}});this.$839=true} this.cacheResultSet=isc.ResultSet.create({dataSource:this,fetchMode:"local",fetchOperation:this.cacheAcrossOperationIds?_1.operationId:this.cacheAllOperationId,allRows:this.cacheData?this.cacheData:null,cachingAllData:true,componentId:"(cacheAllData fetch)",componentContext:"(from: "+_1.componentId+(_1.componentContext?" <"+_1.componentContext+">)":")"),dataArrived:function(_9,_10){if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("cacheAllData - cacheResultSet.dataArrived: startRow/endRow: "+_9+"/"+_10)} if(this.lengthIsKnown()){var _8=this.getDataSource();if(_8.cacheResultSet==null)return;_8.cacheLastFetchTime=new Date().getTime();if(_8.clientOnly)_8.testData=_8.cacheData=this.getAllRows();_8.processDeferredRequests()}}});if(!this.cacheData){if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("firstCacheAllDataRequest: issuing fetch","cacheAllData")} this.cacheResultSet.get(0);return true}else{if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("firstCacheAllDataRequest: updating last fetch time","cacheAllData")} this.cacheLastFetchTime=new Date().getTime();if(this.clientOnly)this.testData=this.cacheData;this.processDeferredRequests();return true}},isc.A.getCacheData=function isc_DataSource_getCacheData(){if(this.cacheResultSet!=null){if(this.cacheResultSet.allRows)return this.cacheResultSet.allRows} if(this.cacheData!=null){return this.cacheData} if(this.testData!=null){return this.testData}},isc.A.fetchingClientOnlyData=function isc_DataSource_fetchingClientOnlyData(_1){if(_1.cachingAllData){return false} if(_1.downloadResult){return false} var _2=(this.useTestDataFetch==null?this.shouldUseTestDataFetch():this.useTestDataFetch);if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("fetchingClientOnlyData: useTestDataFetch is "+_2,"cacheAllData")} if(this.clientOnly){_1.clientOnly=true;if(this.testData&&!this.cacheData)this.cacheData=this.testData;else if(this.cacheData&&!this.testData)this.testData=this.cacheData} if(this.$498){this.$498.add(_1);return true} var _3=this.cacheNeedsRefresh();if(_2==false&&this.clientOnly&&this.hasTestData()) _2=true;if(!_2&&((this.cacheAllData&&_3)||(this.clientOnly&&!this.testData&&this.hasTestData()))) {return this.firstCacheAllDataRequest(_1)}else{if(this.clientOnly&&!this.testData&&(this.testFileName||this.dataURL)||(this.cacheAllData&&_3)){if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("fetchingClientOnlyData: issuing oneTimeDS fetch","cacheAllData")} this.$498=[_1];var _4=this.dataURL||this.testFileName;var _5=this.getDataFormat(_1);if(_5=="iscServer")_5=_4.match(/\.xml$/i)?"xml":"json";var _6=this.getOperationBinding(_1);var _7=this.transformRequest,_8=this.transformResponse,_9=this.$ba;if(_9){if(_9.transformRequest){_7=this[isc.$ah+"transformRequest"]} if(_9.transformResponse){_8=this[isc.$ah+"transformResponse"]}} var _10=_6.recordName||this.recordName||(this.inheritsFrom?(isc.isA.String(this.inheritsFrom)?this.inheritsFrom:this.inheritsFrom.ID):this.ID);var _11=isc[this.Class].create({ID:this.ID+"$499",inheritsFrom:this.ID,dataURL:_4,dataFormat:_5,recordXPath:this.recordXPath,transformRequest:_7,transformResponse:_8,recordName:_10,showPrompt:this.showPrompt});this.logInfo("clientOnly datasource performing one-time "+_5+" fetch via: "+_4);this.addProperties({transformRequest:isc.DataSource.getInstanceProperty("transformRequest"),transformResponse:isc.DataSource.getInstanceProperty("transformResponse")});var _12=this;if(this.cacheAllData){_11.cacheAllData=false} _11.sendDSRequest({operationType:"fetch",willHandleError:true,componentId:_1.componentId,componentContext:_1.componentContext,callback:function(_14,_15){var _13;if(_14.status!=isc.DSResponse.STATUS_SUCCESS){_12.logWarn("one-time fetch failed with status: "+_14.status+" and messsage: "+(_15?_15:"N/A")+". Initializing an empty Array as testData.");_13=[]}else{_12.logInfo("One-time fetch complete: "+(_15?_15.length:"null")+" records");_13=_12.initializeSequenceFields(_15)} if(_12.cacheAllData){_12.cacheLastFetchTime=new Date().getTime();_12.cacheResultSet=isc.ResultSet.create({dataSource:_12.ID,fetchMode:"local",allRows:_13});_12.cacheLastFetchTime=new Date().getTime()} if(_12.clientOnly){_12.cacheData=_12.testData=_13} _12.processDeferredRequests();_11.destroy()}});return true}}},isc.A.shouldUseTestDataFetch=function isc_DataSource_shouldUseTestDataFetch(){return this.clientOnly==true&&this.cacheAllData!=true&&(this.dataURL!=null||this.testFileName!=null)},isc.A.hasTestData=function isc_DataSource_hasTestData(){return this.dataURL!=null||this.testFileName!=null},isc.A.getClientOnlyResponse=function isc_DataSource_getClientOnlyResponse(_1,_2){_2=_2||this.testData;if(_2&&!this.testData&&this.clientOnly) this.cacheData=this.testData=_2;if(!_2||isc.isA.String(_2)){if(isc.isA.String(_2)){this.logInfo(this.ID+" datasource: using testData property as data");this.cacheData=this.testData=isc.eval(_2)}else if(window[this.ID+"TestData"]){this.logInfo(this.ID+" datasource: using "+this.ID+"TestData object as data");this.cacheData=this.testData=window[this.ID+"TestData"]}else{this.logInfo(this.ID+" datasource: testData property and "+this.ID+"TestData object not found, using empty list as data");this.cacheData=this.testData=[]} _2=this.testData} var _3=_1.operationType,_4={status:0};switch(_3){case"fetch":case"select":case"filter":var _5=this.getClientOnlyFetchResponse(_1,_2,false);_4=_5[0];var _6=_5[1];if(this.copyLocalResults){var _7=isc.Browser.isSGWT;for(var i=0;i<_6.length;i++){if(this.deepCopyLocalResults){_6[i]=isc.clone(_6[i])}else{_6[i]=isc.addProperties({},_6[i])} if(_7){_6[i][isc.gwtRef]=null;_6[i][isc.gwtModule]=null}}} _4.data=_6;break;case"remove":case"delete":if(this.isMissingPrimaryKeys(_1.data)){_4.data="clientOnly remove operation failed for DataSource "+this.ID+": missing primaryKey values(s) "+this.getMissingPrimaryKeys(_1.data);_4.data="clientOnly remove operation failed: missing primaryKey value(s): "+this.getMissingPrimaryKeys(_1.data);_4.status=-1}else{var _9=this.findByKeys(_1.data,_2);if(_9==-1){this.logWarn("clientOnly remove operation: Unable to find record matching criteria:"+this.echo(_1.data));_4.data="clientOnly remove operation failed: unable to find matching record" _4.status=-1}else{_2.removeAt(_9);_4.data=isc.addProperties({},_1.data)}} break;case"add":case"insert":var _10=isc.addProperties({},_1.data);if(_10.__ref){delete _10.__ref;delete _10.__module} _10=this.applySequenceFields(_10);var _9=this.findByKeys(_10,_2);if(_9!=-1){this.logWarn("clientOnly add operation: Duplicate key: "+isc.echoAll(_10)+this.getStackTrace());_4.data="clientOnly add operation failed for DataSource "+this.ID+": Duplicate key in record "+isc.echoAll(_10)+"

"+this.getStackTrace();_4.status=-1}else{_2.add(_10);_4.data=isc.addProperties({},_10)} break;case"replace":case"update":if(this.isMissingPrimaryKeys(_1.data)){this.logWarn("clientOnly update operation: Missing primaryKey values: "+this.getMissingPrimaryKeys(_1.data));_4.data="clientOnly update operation failed for DataSource "+this.ID+": missing primaryKey values(s) "+this.getMissingPrimaryKeys(_1.data);_4.status=-1}else{var _9=this.findByKeys(_1.data,_2);if(_9==-1){this.logWarn("clientOnly update operation: Unable to find record matching criteria:"+this.echo(_1.data));_4.data="clientOnly update operation failed: unable to find matching record. Did you supply all primaryKeys?" _4.status=-1}else{var _10=_2[_9];for(var _11 in _1.data){if(_11=="__ref"||_11=="__module")continue;var _12=this.getField(_11);isc.Canvas.$70n(_11,null,_1.data[_11],_10,null,true)} _4.data=isc.addProperties({},_10)}} break;case"validate":default:break} this.$109x(_4,_3);return _4},isc.A.getClientOnlyFetchResponse=function isc_DataSource_getClientOnlyFetchResponse(_1,_2,_3){var _4=_1.data;if(isc.isAn.Array(_4))_4=_4[0];var _5=this.applyFilter(_2,_4,_1),_6=_5,_7={status:0};if(_1.startRow!=null){var _8=_1.startRow,_9=_1.endRow,_10=_5.length;var _11=isc.shallowClone(_1.sortBy);if(_11){if(!isc.isAn.Array(_11))_11=[_11];if(isc.isAn.Object(_11[0])){_11=isc.DS.getSortBy(_11)} var _12=[],_13=null;var _14=_11.length;if(_3==true){_12=new Array(_14);_13=new Array(_14)} for(var i=0;i<_14;i++){var _16=true;if(_11[i].startsWith("-")){_11[i]=_11[i].substring(1);_16=false} _12[i]=_16;if(_3==true)_13[i]=this} if(_3==true)_5.sortByProperties(_11,_12,null,_13);else _5.sortByProperties(_11,_12)} _9=Math.min(_9,_10);_6=_5.slice(_8,_9);_7.startRow=_8;_7.endRow=_9;_7.totalRows=_10} return[_7,_6]},isc.A.$109x=function isc_DataSource__trackClientOnlyChanges(_1,_2){var _3=this.getPrimaryKeyFieldName();switch(_2){case'add':if(!this.$109y){this.$109y=new Array()} this.$109y[_1.data[_3]]=_1.data;break;case'update':if(!this.$109z){this.$109z=new Array()} if(this.$109y&&this.$109y[_1.data[_3]]){this.$109y[_1.data[_3]]=_1.data}else{this.$109z[_1.data[_3]]=_1.data} break;case'remove':if(!this.$1090){this.$1090=new Array()} if(this.$109y&&this.$109y[_1.data[_3]]){this.$109y[_1.data[_3]]=null} if(this.$109z&&this.$109z[_1.data[_3]]){this.$109z[_1.data[_3]]=null} this.$1090[_1.data[_3]]=_1.data}},isc.A.getChanges=function isc_DataSource_getChanges(){var _1=new Array();var _2=this.getPrimaryKeyFieldName();if(this.$109y){for(var _3 in this.$109y){if(this.$109y[_3]!=null&&isc.isA.Object(this.$109y[_3])){this.$109y[_3][_2]=null;var _4={data:this.$109y[_3],operationType:'add'} _1.push(_4)}}} if(this.$109z){for(var _3 in this.$109z){if(this.$109z[_3]!=null&&isc.isA.Object(this.$109z[_3])){var _4={data:this.$109z[_3],operationType:'update'} _1.push(_4)}}} if(this.$1090){for(var _3 in this.$1090){if(this.$1090[_3]!=null&&isc.isA.Object(this.$1090[_3])){var _4={data:this.$1090[_3],operationType:'remove'} _1.push(_4)}}} if(this.$109y){this.$109y.splice(0,this.$109y.length)} if(this.$109z){this.$109z.splice(0,this.$109z.length)} if(this.$1090){this.$1090.splice(0,this.$1090.length)} return _1},isc.A.getNextSequenceValue=function isc_DataSource_getNextSequenceValue(_1){var _2=this.testData,_3=0;for(var i=0;i<_2.length;i++){var _5=_2[i][_1.name];if(_5!=null&&_5>_3)_3=_5} return _3+1},isc.A.applySequenceFields=function isc_DataSource_applySequenceFields(_1){if(this.contactsServer()){return _1} var _2=this.getFields();for(var _3 in _2){var _4=_2[_3];if((_4.type=="sequence"||_4.primaryKey)&&_1[_3]==null){var _5=isc.SimpleType.getType(_4.type);while(_5.inheritsFrom)_5=isc.SimpleType.getType(_5.inheritsFrom);if(_5=="date"||_5=="time"){this.logWarn("clientOnly dataSource encountered a primaryKey of date or time type for which no value was supplied for an 'add' request. Defaulting to the epoch (midnight on 1 Jan 1970)");_1[_3]=new Date(0)}else{_1[_3]=this.getNextSequenceValue(_4);if(_4.type!="sequence"){this.logWarn("clientOnly dataSource found a missing value for primaryKey field '"+_3+"' during an add request. Derived value "+_1[_3]+" from sequence processing")}}}} return _1});isc.evalBoundary;isc.B.push(isc.A.initializeSequenceFields=function isc_DataSource_initializeSequenceFields(_1){if(!isc.isAn.Array(_1))return;var _2=this.getFields();var _3=[];for(var _4 in _2){if(_2[_4].type=="sequence"||_2[_4].primaryKey)_3.add(_4)} var _5=this.firstGeneratedSequenceValue;for(var i=0;i<_1.length;i++){for(var j=0;j<_3.length;j++){var _4=_3[j];if(_1[i][_4]==null)_1[i][_4]=i+_5}} return _1},isc.A.isMissingPrimaryKeys=function isc_DataSource_isMissingPrimaryKeys(_1){return this.getMissingPrimaryKeys(_1).length>0},isc.A.getMissingPrimaryKeys=function isc_DataSource_getMissingPrimaryKeys(_1){var _2=_1;if(isc.isAn.Array(_1))_2=_1[0];var _3=this.getPrimaryKeyFieldNames(),_4=[],_5;if(!isc.isAn.Object(_2))return _3;for(var i=0;i<_3.length;i++){if(_2[_3[i]]==_5){_4.add(_3[i])}} return _4},isc.A.findByKeys=function isc_DataSource_findByKeys(_1,_2,_3,_4){var _5=_1;if(isc.isAn.Array(_1))_5=_1[0];if(_5==null||!isc.isAn.Object(_5)||_2==null)return-1;var _6=this.getPrimaryKeyFieldNames(),_7={},_8=false;if(isc.ResultSet&&isc.isA.ResultSet(_2))_2=_2.localData;for(var i=0;i<_6.length;i++){_7[_6[i]]=_5[_6[i]];if(this.getField(_6[i]).type=="date"||this.getField(_6[i]).type=="time"||this.getField(_6[i]).type=="datetime") {_8=true}} if(!_8)return _2.findByKeys(_5,this,_3,_4);var _10=this.recordIndicesMatchingFilter(_2,_7,{},_3,_4);if(!_10||_10.length==0)return-1;if(_10.length>1){this.logWarn("Searching by primaryKey, found "+_10.length+" records when there should only be one - returning the first. PrimaryKey set was: "+isc.echoAll(_7))} return _10[0]},isc.A.applyFilter=function isc_DataSource_applyFilter(_1,_2,_3){var _4=[];if(!_1||_1.length==0)return _4;if(this.isAdvancedCriteria(_2)){var _5=this.normalizeAdvancedCriteria(_2);return this.recordsMatchingAdvancedFilter(_1,_5,_3)} return this.recordsMatchingFilter(_1,_2,_3)},isc.A.recordIndicesMatchingFilter=function isc_DataSource_recordIndicesMatchingFilter(_1,_2,_3,_4,_5){return this.recordsMatchingFilter(_1,_2,_3,_4,_5,true)},isc.A.recordsMatchingFilter=function isc_DataSource_recordsMatchingFilter(_1,_2,_3,_4,_5,_6){var _7=isc.getKeys(_2),_8=_7.length,_9=[],_10,_11,_12,_13,_14,j;_4=_4||0;_5=_5||_1.length;if(_3&&_3.operation&&this.operationBindings){var _16=_3.operation;if(_16.ID==_16.dataSource+"_"+_16.type){var _17=this.operationBindings.find({operationId:null,operationType:_16.type})}else{var _17=this.operationBindings.find({operationId:_3.operation.ID,operationType:_16.type})} if(_17){var _18=_17.customCriteriaFields;if(isc.isA.String(_18)){_18=_18.split(",");for(var k=0;k<_18.length;k++){_18[k]=_18[k].replace(/^\s+|\s+$/g,'')}}}} for(var i=_4;i<_5;i++){_10=_1[i];if(_10==null)continue;_11=true;for(j=0;j<_8;j++){_12=_7[j];if(_12==null)continue;var _21=this.getField(_12,true);if(_21==null)_21=this.getFieldForDataPath(_12);if(this.dropUnknownCriteria&&!_21){continue} var _22=false;if(isc.isA.List(_18)&&_18.contains(_12)){_22=true} if(!_22&&_21&&_21.customSQL)continue;_13=isc.DataSource.getPathValue(_10,_12,_21,"filter");_14=_2[_12];if(!this.fieldMatchesFilter(_13,_14,_3,(_21?_21.ignoreTextMatchStyle:null))) {_11=false;break}} if(_11)_9.add(_6?i:_10)} return _9},isc.A.recordMatchesFilter=function isc_DataSource_recordMatchesFilter(_1,_2,_3){if(this.isAdvancedCriteria(_2)){return this.recordsMatchingAdvancedFilter([_1],_2,_3).length>0} return this.recordsMatchingFilter([_1],_2,_3).length>0},isc.A.fieldMatchesFilter=function isc_DataSource_fieldMatchesFilter(_1,_2,_3,_4){var _5;if(_4){_5=this.ignoreTextMatchStyleCaseSensitive?this.$135s:this.$50i}else if(_3){_5=_3.textMatchStyle} if(isc.isAn.Array(_2)||isc.isAn.Array(_1)){if(!isc.isAn.Array(_1)){_1=[_1]} if(!isc.isAn.Array(_2)){_2=[_2]} var _6=isc.isA.Date(_2[0]);if(_5==this.$50i||_5==this.$135s||_6){if(_6){return _2.intersectDates(_1).length>0}else if(_5==this.$135s){return _2.intersect(_1).length>0}else{return _2.intersectSubstring(_1,true,this.$50i).length>0}}else{return _2.intersectSubstring(_1,true,_5).length>0}} if(isc.isA.Date(_1)&&isc.isA.Date(_2)){if(_2.logicalDate) return(Date.compareLogicalDates(_1,_2)==0);return(Date.compareDates(_1,_2)==0)} if(!isc.isA.String(_1)&&!isc.isA.String(_2)){if(this.logIsDebugEnabled()){this.logDebug("Direct compare: "+_1+"=="+_2)} return(_1==_2)} if(_2==null)_2=isc.emptyString;if(_1==null)_1=isc.emptyString;if(!isc.isA.String(_1))_1=_1.toString();if(!isc.isA.String(_2))_2=_2.toString();if(_5!=this.$135s&&this.filterIsCaseSensitive!==true){_1=_1.toLocaleLowerCase();_2=_2.toLocaleLowerCase()} if(!this.supportsTextMatchStyle(_5)){if(!this.$63c)this.$63c={};if(!this.$63c[_5]){this.logWarn("Text match style specified as '"+_5+"': This is not supported for this dataSource - performing a substring match instead");this.$63c[_5]=true} _5=this.getTextMatchStyle(_5)} if(_5==this.$45y){return isc.startsWith(_1,_2)}else if(_5==this.$19q){return isc.contains(_1,_2)}else{return _1==_2}},isc.A.supportsTextMatchStyle=function isc_DataSource_supportsTextMatchStyle(_1,_2){if(!this.clientOnly&&(this.dataFormat!=this.$50j))return true;return(_1==null||_1==this.$19q||_1==this.$50i||_1==this.$45y||_1==this.$135s)},isc.A.getTextMatchStyle=function isc_DataSource_getTextMatchStyle(_1){if(_1==null)_1=this.$50i;if(!this.supportsTextMatchStyle(_1)){_1=this.$19q} return _1},isc.A.compareTextMatchStyle=function isc_DataSource_compareTextMatchStyle(_1,_2){_1=this.getTextMatchStyle(_1);_2=this.getTextMatchStyle(_2);if(_1==_2)return 0;if(_1==this.$135s)return 1;if(_2==this.$135s)return-1;if(_2==this.$19q)return 1;if(_1==this.$19q)return-1;if(_1==this.$50i&&_2==this.$45y)return 1;return-1},isc.A.compareCriteria=function isc_DataSource_compareCriteria(_1,_2,_3,_4){if(this.logIsInfoEnabled()){this.logInfo("Comparing criteria, oldCriteria:\n"+this.echo(_2)+"\nnewCriteria:\n"+this.echo(_1)+", policy: "+(_4||this.criteriaPolicy))} if(_2==null)return-1;var _5=this.getTextMatchStyle(_3?_3.textMatchStyle:null);if(this.isAdvancedCriteria(_1)||this.isAdvancedCriteria(_2)){var _6,_7;if(this.isAdvancedCriteria(_1)){if(this.isAdvancedCriteria(_2)){_7=this.compareAdvancedCriteria(_1,_2,_3)}else{var j=0;for(var i in _2){j++;break} if(j==0)_7=1} if(_7==_6){_2=isc.DataSource.convertCriteria(_2,_5);_7=this.compareAdvancedCriteria(_1,_2,_3)}}else{var j=0;for(var i in _1){j++;break} if(j==0){_7=-1}else{_1=isc.DataSource.convertCriteria(_1,_5);_7=this.compareAdvancedCriteria(_1,_2,_3)}} if(_7==_6)_7=-1;_4=_4||this.criteriaPolicy;if(_4=="dropOnShortening"){return _7}else{return _7==0?0:-1}} _4=_4||this.criteriaPolicy;if(_4=="dropOnShortening"){if(_5==this.$50i||_5==this.$135s){return this.dropOnFieldChange(_1,_2,_3)}else{return this.dropOnShortening(_1,_2,_3)}}else{return this.dropOnChange(_1,_2,_3)}},isc.A.getFieldCriterion=function isc_DataSource_getFieldCriterion(_1,_2){var _3;if(_1.criteria){for(var i=0;i<_1.criteria.length;i++){_3=this.getFieldCriterion(_1.criteria[i],_2);if(_3)return _3}}else{if(_1.fieldName==_2)return _1} return null},isc.A.dropOnChange=function isc_DataSource_dropOnChange(_1,_2,_3){if(isc.getKeys(_2).length!=isc.getKeys(_1).length)return-1;for(var _4 in _2){var _5=_2[_4],_6=_1[_4];if(isc.isAn.Array(_5)){if(!isc.isAn.Array(_6))return-1;if(_5.length!=_6.length)return-1;if(_5.intersect(_6).length!=_5.length) {return-1}}else if(isc.isA.Date(_5)&&isc.isA.Date(_6)) {if(_5.getTime()!=_6.getTime())return-1}else if(_5!=_6){return-1}} return 0},isc.A.dropOnFieldChange=function isc_DataSource_dropOnFieldChange(_1,_2,_3){var _4=isc.getKeys(_1),_5=isc.getKeys(_2),_6=_4.length-_5.length;if(_6<0)return-1;for(var _7 in _2){var _8=_2[_7],_9=_1[_7];if(_9==null)return-1;if(isc.isAn.Array(_8)){if(!isc.isAn.Array(_9))return-1;if(_8.length!=_9.length)return-1;if(_8.intersect(_9).length!=_8.length) {return-1}}else if(isc.isA.Date(_8)&&isc.isA.Date(_9)) {if(_8.getTime()!=_9.getTime())return-1}else if(_8!=_9){return-1}} if(_6>0){_4.removeList(_5);for(var i=0;i<_4.length;i++){if(this.getField(_4[i])==null)return-1} return 1} return 0},isc.A.dropOnShortening=function isc_DataSource_dropOnShortening(_1,_2,_3){var _4=isc.getKeys(_1),_5=isc.getKeys(_2),_6=_4.length-_5.length;if(_6<0)return-1;var _7=0;for(var _8 in _2){var _9=_2[_8],_10=_1[_8];if(_10==null)return-1;if((this.getField(_8)==null||this.getField(_8).ignoreTextMatchStyle)&&_9!=_10) {return-1} if(isc.isAn.Array(_9)){if(!isc.isAn.Array(_10))return-1;if(_9.length!=_10.length)return-1;if(_9.intersect(_10).length!=_9.length) {return-1}}else if(isc.isA.String(_9)){if(!isc.isA.String(_10))return-1;if(_10.indexOf(_9)==-1)return-1;if(_9.length>_10.length)return-1;if(_9.length<_10.length)_7=1}else if(isc.isA.Date(_9)&&isc.isA.Date(_10)) {if(_9.getTime()!=_10.getTime())return-1}else if(_9!=_10){return-1}} if(_6>0){_4.removeList(_5);for(var i=0;i<_4.length;i++){if(this.getField(_4[i])==null)return-1} return 1} return _7},isc.A.compareDates=function isc_DataSource_compareDates(_1,_2,_3,_4){var _5=this.getField(_3),_6=_4?this.getField(_4):null;if((_5&&isc.SimpleType.inheritsFrom(_5.type,"datetime"))||(_6&&isc.SimpleType.inheritsFrom(_6.type,"datetime"))) {return Date.compareDates(_1,_2)}else if((_5&&isc.SimpleType.inheritsFrom(_5.type,"time"))||(_6&&isc.SimpleType.inheritsFrom(_6.type,"time"))) {return isc.Time.compareLogicalTimes(_1,_2)}else{return Date.compareLogicalDates(_1,_2)}},isc.A.compareValues=function isc_DataSource_compareValues(_1,_2,_3,_4){if(isc.isA.Date(_1)&&isc.isA.Date(_2)){return this.compareDates(_1,_2,_3)}else{var _5=_4&&_1.toLowerCase?_1.toLowerCase():_1,_6=_4&&_2.toLowerCase?_2.toLowerCase():_2;if(_5==null&&_6!=null)return 1;if(_5!=null&&_6==null)return-1;return _5>_6?-1:(_5<_6?1:(_5==_6?0:2))}},isc.A.recordsAreEqual=function isc_DataSource_recordsAreEqual(_1,_2){var _3=this.getFieldNames();for(var i=0;i<_3.length;i++){if(this.compareValues(_1[_3[i]],_2[_3[i]],_3[i])!=0){return false}} return true},isc.A.convertDataSourceCriteria=function isc_DataSource_convertDataSourceCriteria(_1,_2){return isc.DataSource.convertCriteria(_1,_2,this)});isc.B._maxIndex=isc.C+202;isc.A=isc.DataSource;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$628=0;isc.A.$135t={exact:"equals",exactCase:"iEquals",substring:"iContains",startsWith:"iStartsWith"};isc.A.criteriaConversion_OperatorKeepNullValue={"equals":true,"notEqual":true,"iEquals":true,"iNotEqual":true};isc.A.$71l={sum:function(_1,_2,_3){var _4=0;for(var i=0;i<_2.length;i++){var _6=_1[_2[i].name],_7=parseFloat(_6);if(isc.isA.Number(_7)&&_7==_6){_4+=_7}else{if(_6!=null&&_6!=isc.emptyString){return null}}} return _4},avg:function(_1,_2,_3){var _4=0,_5=0;for(var i=0;i<_2.length;i++){var _7=_1[_2[i].name],_8=parseFloat(_7);if(isc.isA.Number(_8)&&(_8==_7)){_5+=1;_4+=_8}else{if(_7!=null&&_7!=isc.emptyString){return null}}} return _5>0?_4/_5:null},max:function(_1,_2,_3){var _4,_5;for(var i=0;i<_2.length;i++){var _7=_1[_2[i].name];if(isc.isA.Date(_7)){if(_5)return null;if(_4==null)_4=_7.duplicate();else if(_4.getTime()<_7.getTime())_4=_7.duplicate()}else{_5=true;var _8=parseFloat(_7);if(isc.isA.Number(_8)&&(_8==_7)){if(_4==null)_4=_8;else if(_4<_7)_4=_8}else{if(_7!=null&&_7!=isc.emptyString){return null}}}} return _4},min:function(_1,_2,_3){var _4,_5 for(var i=0;i<_2.length;i++){var _7=_1[_2[i].name];if(isc.isA.Date(_7)){if(_5)return null;if(_4==null)_4=_7.duplicate();if(_7.getTime()<_4.getTime())_4=_7.duplicate()}else{if(_7==null||_7==isc.emptyString)continue;_5=true;var _8=parseFloat(_7);if(isc.isA.Number(_8)&&(_8==_7)){if(_4==null)_4=_8;else if(_4>_7)_4=_8}else{return null}}} return _4},multiplier:function(_1,_2,_3){var _4=0;for(var i=0;i<_2.length;i++){var _6=_1[_2[i].name],_7=parseFloat(_6);if(isc.isA.Number(_7)&&(_7==_6)){if(i==0)_4=_7;else _4=(_4*_7)}else{return null}} return _4}};isc.A.exportFormatToFileExtensionMap={xml:"xml",json:"json",csv:"csv",xls:"xls",ooxml:"xlsx"};isc.B.push(isc.A.applyFilter=function isc_c_DataSource_applyFilter(_1,_2){var _3=[];if(!_1||_1.length==0)return _3;if(this.$901==null){this.$901=isc.DataSource.create({fields:[{name:"$902"}],dropUnknownCriteria:false,clientOnly:true})} var _4=this.$901.applyFilter(_1,_2);return _4},isc.A.addSearchOperator=function isc_c_DataSource_addSearchOperator(_1){if(!_1||!_1.ID){isc.logWarn("Attempted to add null search operator, or operator with no ID");return} if(!isc.DataSource.$57z)isc.DataSource.$57z={};var _2=isc.DataSource.$57z,_3;if(_2[_1.ID]!==_3){isc.logWarn("Attempted to add existing operator "+_1.ID+" - replacing")} if(!_1.getCriterion){_1.getCriterion=function(_4,_5){return _5&&_5.getCriterion()}} isc.DataSource.$57z[_1.ID]=_1},isc.A.getSearchOperators=function isc_c_DataSource_getSearchOperators(){return isc.DataSource.$57z},isc.A.setTypeOperators=function isc_c_DataSource_setTypeOperators(_1,_2){if(!_2)return;if(!isc.isAn.Array(_2))_2=[_2];if(!isc.DataSource.$570)isc.DataSource.$570={};isc.DataSource.$570[_1||"_all_"]=_2},isc.A.$625=function isc_c_DataSource__getNextRequestId(){return this.$628++},isc.A.getAutoTitle=function isc_c_DataSource_getAutoTitle(_1,_2){_2=_2||new RegExp("[_\$]","g");if(!_1)return"";if(!isc.isA.String(_1))_1=_1.toString();var _3;_4=_1.replace(_2," ");var _4=_4.replace(/^\s+|\s+$/g,"");if(_4==_4.toUpperCase()||_4==_4.toLowerCase()){_4=_4.toLowerCase();var _5=true;_3="";for(var i=0;i<_4.length;i++){var _7=_4.substr(i,1);if(_5){_7=_7.toUpperCase();_5=false} if(_7==' ')_5=true;_3=_3+_7}}else{_3=_4.substr(0,1).toUpperCase();var _8=_4.substr(0,1)==_4.substr(0,1).toUpperCase();var _9=false;var _10=false;for(var i=1;i<_4.length;i++){var _7=_4.substr(i,1);if(_9&&_7==_7.toLowerCase()){_9=false;_3=_3.substr(0,_3.length-1)+" "+_3.substr(_3.length-1)} if(_8&&_7==_7.toUpperCase()){_9=true} if(!_8&&_7==_7.toUpperCase()){_3=_3+" "} _8=_7==_7.toUpperCase();if(_10)_7=_7.toUpperCase();_10=_7==" ";_3=_3+_7}} return _3},isc.A.convertCriteria=function isc_c_DataSource_convertCriteria(_1,_2,_3){var _4={_constructor:"AdvancedCriteria",operator:"and"} if(!_2&&_3)_2=this.$135t[_3.defaultTextMatchStyle];var _5=[];for(var _6 in _1){var _7=_3==null?null:_3.getField(_6),_8=_3==null?null:this.$135t[_3.defaultTextMatchStyle],_9=null;if(_7!=null){if(_7.ignoreTextMatchStyle){_9=_3.ignoreTextMatchStyleCaseSensitive?"equals":"iEquals"}} if(isc.isAn.Array(_1[_6])){var _10={_constructor:"AdvancedCriteria",operator:"or",criteria:[]} for(var i=0;i<_1[_6].length;i++){var _12=_1[_6][i];var _13=_9?_9:this.getCriteriaOperator(_12,_2,_8);if(_12==null&&!this.criteriaConversion_OperatorKeepNullValue[_13]){continue} _10.criteria.add({fieldName:_6,operator:_13,value:_12})} if(_10.criteria.length>0){_5.add(_10)}}else{var _12=_1[_6],_13=_9?_9:this.getCriteriaOperator(_12,_2,_8);if(_12==null&&!this.criteriaConversion_OperatorKeepNullValue[_13]){continue} _5.add({fieldName:_6,operator:_13,value:_1[_6]})}} _4.criteria=_5;return _4},isc.A.getCriteriaOperator=function isc_c_DataSource_getCriteriaOperator(_1,_2,_3){var _4;if(isc.isA.Number(_1)||isc.isA.Date(_1)||isc.isA.Boolean(_1)){_4="equals"}else if(_2=="exactCase"){_4="equals"}else if(_2=="equals"||_2=="exact"){_4="iEquals"}else if(_2=="startsWith"){_4="iStartsWith"}else{_4=_3||"iContains"} return _4},isc.A.combineCriteria=function isc_c_DataSource_combineCriteria(_1,_2,_3,_4,_5){if(!_1)return _2;if(!_2)return _1;if(!_3)_3="and";if(_3!="and"&&_3!="or"){isc.logWarn("combineCriteria called with invalid outerOperator '"+_3+"'");return null} var _6,_7;if(!_5&&_1._constructor!="AdvancedCriteria"&&_2._constructor!="AdvancedCriteria"&&_3=="and") {for(var _8 in _1){if(_2[_8]!=_6){_7=true;break}}}else{_7=true} if(!_7){return isc.addProperties({},_1,_2)} var _9,_10;if(_5||_1._constructor=="AdvancedCriteria"){_9=_1}else{_9=isc.DataSource.convertCriteria(_1,_4)} if(_5||_2._constructor=="AdvancedCriteria"){_10=_2}else{_10=isc.DataSource.convertCriteria(_2,_4)} var _11={operator:_3};if(!_5){_11._constructor="AdvancedCriteria"} if(_9.operator==_3&&_10.operator==_3){_11.criteria=[];_11.criteria.addAll(_9.criteria);_11.criteria.addAll(_10.criteria)}else{_11.criteria=[_9,_10]} return _11},isc.A.simplifyAdvancedCriteria=function isc_c_DataSource_simplifyAdvancedCriteria(_1,_2){if(!this.isAdvancedCriteria(_1)){return _1} _1=this.$79a(_1,_2);if(_1==null)return null;_1._constructor="AdvancedCriteria";return _1},isc.A.$79a=function isc_c_DataSource__simplifyAdvancedCriteria(_1,_2){var _3=_1.operator;if(_3=="and"||_3=="or"){var _4=_1.criteria;if(_4==null||_4.length==0){if(_2)return null;return _1} if(_4.length==1){_1=_4[0];return this.$79a(_1,true)} var _5=[];for(var i=0;i<_4.length;i++){var _7=_4[i];_7=this.$79a(_7,true);if(_7!=null){if(_7.operator==_3){_5.addList(_7.criteria)}else{_5.add(_7)}}} if(_5.length==0&&_2)return null;if(_5.length==1)return _5[0];_1.criteria=_5;return _1}else{return _1}},isc.A.resolveDynamicCriteria=function isc_c_DataSource_resolveDynamicCriteria(_1,_2){if(_1==null)return null;if(!isc.DS.isAdvancedCriteria(_1)){return _1} if(!isc.DS.$167l(_1)){return _1} _1=isc.clone(_1);isc.DS.$167m(_1,_2);return _1},isc.A.$167l=function isc_c_DataSource__criteriaHasValuePath(_1){var _2=false,_3=_1.operator;if(_3=="and"||_3=="or"){var _4=_1.criteria;for(var i=0;i<_4.length;i++){var c=_4[i];if(isc.DataSource.$167l(_4[i])){_2=true;break}}}if(_1.valuePath!=null){_2=true} return _2},isc.A.$167m=function isc_c_DataSource__resolveCriteriaValuePaths(_1,_2){var _3=_1.operator;if(_3=="and"||_3=="or"){var _4=_1.criteria;for(var i=0;i<_4.length;i++){isc.DS.$167m(_4[i],_2)}}if(_1.valuePath!=null){var _6=_1.valuePath.replace(/\./g,"/");_1.value=isc.Canvas.$70o(_6,null,_2)}},isc.A.combineFieldData=function isc_c_DataSource_combineFieldData(_1,_2,_3){if(_2==null)return _1;for(var _4 in _2){if(_4=="validators"&&_1.validators!=null&&_2.validators!=_1.validators) {if(_2.validators.$69){if(isc.SimpleType.getBaseType(_1.type)!=isc.SimpleType.getBaseType(_2.type)) {continue}} for(var i=0;i<_2.validators.length;i++){var _6=_2.validators[i];if(!_1.validators.contains(_6)){if(_1.validators.$69){_1.validators=_1.validators.duplicate()} _1.validators.add(_6)}} continue} if(_1[_4]!=null)continue;if(_4=="name")continue;if(!_3&&_4=="hidden")continue;_1[_4]=_2[_4]} return _1},isc.A.applyRecordSummaryFunction=function isc_c_DataSource_applyRecordSummaryFunction(_1,_2,_3,_4){if(!_2||!_3)return;if(isc.isA.String(_1)){if(this.$71l[_1]){_1=this.$71l[_1]}else{_1=isc.Func.expressionToFunction("record,fields,summaryField",_1)}} if(isc.isA.Function(_1))return _1(_2,_3,_4)},isc.A.registerRecordSummaryFunction=function isc_c_DataSource_registerRecordSummaryFunction(_1,_2){if(isc.isA.String(_2)){_2=isc.Func.expressionToFunction("record,fields,summaryField",_2)} this.$71l[_1]=_2},isc.A.addExportFilenameExtension=function isc_c_DataSource_addExportFilenameExtension(_1,_2){if(!_2)_2="csv";if(!this.$162n){this.$162n=isc.getValues(this.exportFormatToFileExtensionMap)} var _3=this.exportFormatToFileExtensionMap[_2];if(!_3)return _1;var _4=_1.lastIndexOf(".");if(_4==-1){_1=_1+"."+_3}else{var _5=_1.substring(_4+1).toLowerCase();if(_5!=_3){if(this.$162n.contains(_5)){var _6=_1.substring(0,_4+1)+_3;this.logWarn("Extension specified in fileName: "+_1+" is incorrect for exportFormat: '"+_2+"'. Changing fileName to: "+_6);_1=_6}else{_1=_1+"."+_3}}} return _1},isc.A.exportClientData=function isc_c_DataSource_exportClientData(_1,_2,_3,_4){var _5=_2.exportContext||_2||{},_6=_5&&_5.exportAs?_5.exportAs:"csv",_7=_5&&_5.exportDisplay?_5.exportDisplay:"download",_8=_5.downloadToNewWindow!=null?_5.downloadToNewWindow:(_7=="window");var _9=_6;if(_2.operationId!=null){var _10=_4.getOperationBinding("clientExport",_2.operationId);if(_10!=null&&_10.exportAs){_9=_10.exportAs}} var _11=this.addExportFilenameExtension(_5&&_5.exportFilename?_5.exportFilename:"export",_9);var _12={showPrompt:false,transport:_5.exportToClient===false?"xmlHttpRequest":"hiddenFrame",exportResults:true,exportDisplay:_7,targetMainWindow:_5.targetMainWindow,downloadResult:!(_5.exportToClient===false),downloadToNewWindow:_8,download_filename:(_7=="window"?_11:null),params:_5.params};var _13={exportAs:_6,exportDisplay:_7,exportFilename:_11,exportPath:_5.exportPath,exportToClient:_5.exportToClient,exportToFilesystem:_5.exportToFilesystem,exportDelimiter:_5.exportDelimiter,exportFields:_5.exportFields,exportHeader:_5.exportHeader,exportHeaderless:_5.exportHeaderless,exportFooter:_5.exportFooter,exportTitleSeparatorChar:_5.exportTitleSeparatorChar,exportDefaultBGColor:_5.exportDefaultBGColor,exportAlternateRowBGColor:_5.exportAlternateRowBGColor,exportRowBGColors:_5.exportRowBGColors,exportColumnBGColors:_5.exportColumnBGColors,exportRawValues:_5.exportRawValues,exportCurrencySymbol:isc.NumberUtil.currencySymbol,lineBreakStyle:_5.lineBreakStyle};if(_5.headerSpans)_13.headerSpans=_5.headerSpans;if(_5.exportHeaderSpans)_13.exportHeaderSpans=_5.exportHeaderSpans;if(_5.exportOtherFields)_13.exportOtherFields=_5.exportOtherFields;if(_5.exportShowHeaderSpanTitles!=null){_13.exportShowHeaderSpanTitles=_5.exportShowHeaderSpanTitles} if(_5.exportSpanTitleSeparator!=null){_13.exportSpanTitleSeparator=_5.exportSpanTitleSeparator} if(_5.formulaFields)_13.formulaFields=_5.formulaFields;if(_5.formulaRemap)_13.formulaRemap=_5.formulaRemap;if(_5.exportHeaderHeight!=null){_13.exportHeaderHeight=_5.exportHeaderHeight} if(_5.exportFieldPixelWidths){_13.exportFieldPixelWidths=_5.exportFieldPixelWidths;_13.exportWidthScale=_5.exportWidthScale} _13.exportWrapHeaderTitles=_5.exportWrapHeaderTitles;if(_5.exportAlignments){_13.exportAlignments=_5.exportAlignments} if(_5.exportStreaming!=null){_13.exportStreaming=_5.exportStreaming} if(_5.exportPropertyIdentifier){_13.exportPropertyIdentifier=_5.exportPropertyIdentifier} var _14=_2.operationId;if(_4==null||_14==null){isc.DMI.callBuiltin({methodName:"downloadClientExport",arguments:[_1,_6,_11,_7,_13],requestParams:_12,callback:_3})}else{isc.addProperties(_12,{parameters:_13});_4.performClientExportOperation(_14,_1,_3,_12)}},isc.A.getSimpleErrors=function isc_c_DataSource_getSimpleErrors(_1){var _2=_1?_1.errors:null;if(isc.isAn.Array(_2)){if(_2.length>1){this.logWarn("getSimpleErrors() passed an array of error blocks - dropping all but the first set of errors.")} _2=_2[0]} if(_2==null)return null;var _3={};for(var _4 in _2){var _5=_2[_4];if(_4=="recordPath"&&!isc.isAn.Object(_5))continue;var _6=[];if(!isc.isAn.Array(_5))_5=[_5];for(var i=0;i<_5.length;i++){var _8=_5[i];if(isc.isAn.Object(_8)){_6.add(_8.errorMessage)}else if(_8!=null){_6.add(_8)}} if(_6.length>0){_3[_4]=_6}} return _3},isc.A.recordTimingData=function isc_c_DataSource_recordTimingData(_1,_2,_3,_4){if(!isc.Log.logIsInfoEnabled("RpcTabTiming")||!_1)return;if(_4==null)_4=isc.timeStamp();var _5;if(_1.clientTimingStack){_5=_1.clientTimingStack[_1.clientTimingStack.length-1]}else{_5=_1.clientTiming={name:"Client processing",start:_4,children:[]};_1.clientTimingStack=[];_1.clientTimingStack.add(_1.clientTiming)} if(!_5){isc.logWarn("Unexpected failure to find stack entry logging timing data: description: '"+_2+"', type: "+_3);return} if(_3=="start"){var _6={start:_4,name:_2,children:[]};_5.children.add(_6);_1.clientTimingStack.add(_6)}else if(_3=="end"){_5.end=_4;_1.clientTimingStack.removeAt(_1.clientTimingStack.length-1)}else{_5.children.add({millis:_4,name:_2})}});isc.B._maxIndex=isc.C+21;isc.A=isc.DataSource.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.supportsAdvancedCriteria=function isc_DataSource_supportsAdvancedCriteria(){if(this.clientOnly||this.cacheData)return true;if(this.allowAdvancedCriteria===false)return false;if(this.willHandleAdvancedCriteria===false)return false;return true},isc.A.isAdvancedCriteria=function isc_DataSource_isAdvancedCriteria(_1){return isc.DS.isAdvancedCriteria(_1,this)},isc.A.normalizeAdvancedCriteria=function isc_DataSource_normalizeAdvancedCriteria(_1,_2){var _3={};if(!_2){_3._constructor="AdvancedCriteria";if(_1.strictSQLFiltering)_3.strictSQLFiltering=true} if(_1.criteria){if(!isc.isAn.Array(_1.criteria)){_1.criteria=[_1.criteria]} _3.operator=_1.operator;_3.criteria=[];for(var i=0;i<_1.criteria.length;i++){_3.criteria.add(this.normalizeAdvancedCriteria(_1.criteria[i],true))}}else{if(!isc.isAn.Array(_1.value)){isc.addProperties(_3,_1)}else{var _5=this.getSearchOperator(_1.operator);if(!_5||!_5.canNormalize){isc.addProperties(_3,_1)}else{_3.operator=_5.negate?"and":"or";_3.criteria=[];for(var i=0;i<_1.value.length;i++){_3.criteria.add({fieldName:_1.fieldName,operator:_1.operator,value:_1.value[i]})}}}} if(!_3.operator&&_3.fieldName&&_3.value)_3.operator="equals";return _3},isc.A.addSearchOperator=function isc_DataSource_addSearchOperator(_1,_2){if(!_1||!_1.ID){isc.logWarn("Attempted to add null search operator, or operator with no ID");return} isc.DataSource.addSearchOperator(_1);if(!this.$570)this.$570={};if(!this.$570.$170k)this.$570.$170k={};if(_2){for(var _3=0;_30){if(_3.validOperators){_2=_2.intersect(_3.validOperators)} return _2}}} _4=isc.DataSource.$570;_3=isc.SimpleType.getType(_1);while(_3&&!_4[_3.name]){if(!_3||!_3.inheritsFrom)break;_3=isc.SimpleType.getType(_3.inheritsFrom,this)} if(_3&&_4[_3.name]){_2.addList(_4[_3.name])} _2.addList(_4["_all_"]);if(_3&&_3.validOperators){_2=_2.intersect(_3.validOperators)} _2=_2.getUniqueItems();return _2},isc.A.setTypeOperators=function isc_DataSource_setTypeOperators(_1,_2){if(!_2)return;if(!isc.isAn.Array(_2))_2=[_2];if(!this.$570)this.$570={};this.$570[_1||"_all_"]=_2;if(!this.$570.$170k)this.$570.$170k={};this.$570.$170k[_1]=false},isc.A.getFieldOperators=function isc_DataSource_getFieldOperators(_1){if(isc.isA.String(_1))_1=this.getField(_1);if(!_1)return[];if(_1&&_1.validOperators)return _1.validOperators;var _2=isc.SimpleType.getType(_1.type);var _3=_1.type||"text";if(!_2)_3="text";return this.getTypeOperators(_3)},isc.A.getFieldOperatorMap=function isc_DataSource_getFieldOperatorMap(_1,_2,_3,_4,_5){if(isc.isA.String(_1))_1=this.getField(_1);var _6={},_5=_5||this.getFieldOperators(_1);_2=_2||_1.validOperators!=null;for(var _7=0;_7<_5.length;_7++){var _8=_5[_7];var _9=this.getSearchOperator(_8);if(!_9)continue;if(_9.hidden&&!_2&&(!isc.isAn.Array(_1.validOperators)||!_1.validators.contains(_8)))continue;if(!_3||(_9.valueType==_3)==!_4){_6[_5[_7]]=_9.titleProperty==null?_9.title:isc.Operators[_9.titleProperty]}} return _6},isc.A.getTypeOperatorMap=function isc_DataSource_getTypeOperatorMap(_1,_2,_3,_4){var _5={},_6=this.getTypeOperators(_1);for(var _7=0;_7<_6.length;_7++){var _8=this.getSearchOperator(_6[_7]);if(_8&&(!_8.hidden||_2)){if(!_3||(_8.valueType==_3)==!_4) _5[_6[_7]]=_8.titleProperty==null?_8.title:isc.Operators[_8.titleProperty]}} return _5},isc.A.recordsAsText=function isc_DataSource_recordsAsText(_1,_2){if(!isc.isA.TextExportSettings(_2)){_2=isc.TextExportSettings.create(_2)} var i,_4;var _5=[];var _6=_2.fieldList;if(!_6)_6=this.getFieldNames();for(i=0;i<_6.length;i++){var _7=_6[i];_4=this.fields[_7];if(_4)_5.add(_4);else _5.add(_7)} var _8="";for(i=0;i<_1.length;i++){if(i>0)_8+=_2.lineSeparator;_8+=this.$93q(_1[i],_5,_2)} return _8},isc.A.$93q=function isc_DataSource__recordAsText(_1,_2,_3){var _4,_5;var _6=_3.forceText;var _7=_3.getEscapingModeEscapeChar();for(var i=0,_9="";i<_2.length;i++,_9+=_4){if(i>0)_9+=_3.fieldSeparator;var _10=_2[i];if(isc.isA.String(_10)){_4=_1[_10];_5="text"}else{_5=_10.type;_4=_1[_10.name];if(_10.exportForceText){_6=_10.exportForceText}} var _11=false;if(_3.useDisplayValue&&_10.name!=null){_4=this.getDisplayValue(_10.name,_4);if(_4!=null){_4=_4.toString();_11=true}} if(!_11){_4=isc.DataSource.$93p(_4,_5,_3)} if(_5=="text")switch(_6){case"leadingSpace":_4=" "+_4;break;case"formula":_4="="+_4} _4=_4.replace(/(\")/g,_7+"$1");if(_3.quoteValues)_4="\""+_4+"\""} return _9},isc.A.recordsFromText=function isc_DataSource_recordsFromText(_1,_2){if(!_1)return[];if(!isc.isA.TextImportSettings(_2)){_2=isc.TextImportSettings.create(_2)} _1=_2.addFinalLineSeparatorIfNotPresent(_1);var _3=_2.fieldList;if(!_3)_3=this.getFieldNames();if(_2.hasHeaderLine){_3=[];_1=this.$93u(_1,_2,_3)} if(_3.length==0)return[];var _4=this,_5=[];var _6={},_7=0;var _8=function(_10){if(_7<_3.length){_6[_3[_7++]]=_10}};var _9=function(){if(!isc.TextImportSettings.$935){isc.Validator.$93n=true;_4.validateJSONRecord(_6,true);isc.Validator.$93n=false} _5.add(_6);_6={};_7=0;return false};_2.parseTextAndApplyFunctions(_1,_8,_9);return _5},isc.A.$93u=function isc_DataSource__processAndRemoveHeaderLine(_1,_2,_3){var _4={},_5={};if(!isc.TextImportSettings.$935){var _6=this.getFieldNames();for(var i=0;i<_6.length;i++){var _8=this.getField(_6[i]);if(_8.name!=null)_5[_8.name.toUpperCase()]=_8;if(_8.title!=null)_4[_8.title.toUpperCase()]=_8}} var _9=function(_12){var _10=_12.toUpperCase().replace(/^(\s)*/,"").replace(/(\s)*$/,"");if(_4[_10])_3.add(_4[_10].name);else if(_5[_10])_3.add(_5[_10].name);else _3.add(_12)};var _11=function(){return true};return _2.parseTextAndApplyFunctions(_1,_9,_11)});isc.B._maxIndex=isc.C+14;isc.A=isc.DataSource.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.evaluateCriterion=function isc_DataSource_evaluateCriterion(_1,_2){if(_2.requiresServer==true)return true;var _3=this.getSearchOperator(_2.operator);if(_3==null){isc.logWarn("Attempted to use unknown operator "+_2.operator);return false} var _4=true;if(this.$908){for(var i=0;i=(this.inclusive?1:0)){return false}} return true};var _12=function(_53,_87,_88,_89,_90){if(isc.isA.Number(_87)){_87=""+_87} if(isc.isA.Boolean(_87)){isc.logWarn("Attempt to compare a Boolean as String, testing value "+_88.value+" with operator "+this.ID+". This is an invalid comparison, so we are returning FALSE.");return false} if(isc.isA.Date(_87)){isc.logWarn("Attempt to compare a Date as String, testing value "+_88.value+" with operator "+this.ID+". This is an invalid comparison, so we are returning FALSE.");return false} if(_87!=null&&!isc.isA.String(_87)){return true} if(_87==null){if(_89.$59v){var _13=_89.getField(_53);if(_13&&(_13.type=="number"||_13.type=="integer"||_13.type=="sequence"||_13.type=="float")){if(_88.value==null||isc.isA.Number(_88.value)||isc.isA.Date(_88.value)){return(this.negate?!_89.$59u:_89.$59u)}else{return false}}else{return(this.negate?!_89.$59u:_89.$59u)}}else{return false}} var _14=_88.value||"";if(isc.isA.Number(_14)){_14=""+_14} if(!isc.isA.String(_14)||!isc.isA.String(_87)){return false} if(this.caseInsensitive){_87=_87.toLowerCase();_14=_14.toLowerCase()} var _15=false;if(this.startsWith){_15=isc.startsWith(_87,_14)}else if(this.endsWith){_15=isc.endsWith(_87,_14)}else if(this.equals){_15=(_87==_14)}else{_15=isc.contains(_87,_14)} return _15};var _16=function(_53,_87,_88,_89,_90){return(_87==null)};var _17=function(_53,_87,_88,_89,_90){if(!_88.value){return false} if(isc.isA.Date(_88.value)||isc.isA.Date(_87)||isc.DateUtil.isRelativeDate(_88.value)) {return false} var _18;if(this.caseInsensitive){_18=new RegExp(_88.value,"i")}else{_18=new RegExp(_88.value)} return _18.test(_87)};var _19=function(_53,_87,_88,_89,_90,_73){if(!_89.patternEscapeChar||_89.patternEscapeChar.length>1){throw"dataSource.patternEscapeChar cannot be null or undefined"} var _20=isc.isA.Array(_89.patternSingleWildcard)?_89.patternSingleWildcard:[_89.patternSingleWildcard||"?","%"];var _21=isc.isA.Array(_89.patternMultiWildcard)?_89.patternMultiWildcard:[_89.patternMultiWildcard||"*"];var _22=false;var _23="";var _24=_88.value;for(var i=0;i<_24.length;i++){if(_24[i]===_89.patternEscapeChar){_22=true;continue} if(_22){_23+=_24[i].replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1");_22=false}else{if(_21.contains(_24[i])){_23+=".*";continue} if(_20.contains(_24[i])){_23+=".";continue} _23+=_24[i]}} if(_73){_88.value="^.*"+_23+".*$"}else{_88.value="^"+_23+"$"} return _17.apply(this,[_53,_87,_88,_89,_90])};var _26=function(_53,_87,_88,_89,_90,_73){if(!_89.patternEscapeChar||_89.patternEscapeChar.length>1){throw"dataSource.patternEscapeChar cannot be null or undefined"} var _20=isc.isA.Array(_89.patternSingleWildcard)?_89.patternSingleWildcard:[_89.patternSingleWildcard||"?","%"];var _21=isc.isA.Array(_89.patternMultiWildcard)?_89.patternMultiWildcard:[_89.patternMultiWildcard||"*"];var _22=false;var _23="";var _24=_88.value;for(var i=0;i<_24.length;i++){if(_24[i]===_89.patternEscapeChar){_22=true;continue} if(_22){_23+=_24[i].replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1");_22=false}else{if(_21.contains(_24[i])){_23+=".*";continue} if(_20.contains(_24[i])){_23+=".";continue} _23+=_24[i]}} _88.value="^"+_23+".*$";return _17.apply(this,[_53,_87,_88,_89,_90])};var _27=function(_53,_87,_88,_89,_90,_73){if(!_89.patternEscapeChar||_89.patternEscapeChar.length>1){throw"dataSource.patternEscapeChar cannot be null or undefined"} var _20=isc.isA.Array(_89.patternSingleWildcard)?_89.patternSingleWildcard:[_89.patternSingleWildcard||"?","%"];var _21=isc.isA.Array(_89.patternMultiWildcard)?_89.patternMultiWildcard:[_89.patternMultiWildcard||"*"];var _22=false;var _23="";var _24=_88.value;for(var i=0;i<_24.length;i++){if(_24[i]===_89.patternEscapeChar){_22=true;continue} if(_22){_23+=_24[i].replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1");_22=false}else{if(_21.contains(_24[i])){_23+=".*";continue} if(_20.contains(_24[i])){_23+=".";continue} _23+=_24[i]}} _88.value="^.*"+_23+"$";return _17.apply(this,[_53,_87,_88,_89,_90])};var _28=function(_53,_87,_88,_89,_90){return _19.apply(this,[_53,_87,_88,_89,_90,true])};var _29=function(_53,_87,_88,_89,_90){var _24=_88.value||[];if(!isc.isAn.Array(_24)){_24=[_24]} if(isc.isA.Date(_87)){for(var i=0;i<_24.length;i++){var _7=isc.isA.Date(_24[i]);if(_90&&!_7&&isc.DateUtil.isRelativeDate(_24[i])){_24[i]=isc.DateUtil.getAbsoluteDate(_24[i])} if(isc.isA.Date(_24[i])&&_89.compareDates(_24[i],_87,_53)==0) {return true}}}else{return _24.contains(_87)}};var _30=function(_53,_87,_88,_89,_90){if(_88.value==null){return true} var _31=false;if(isc.isAn.Array(_87)&&isc.isAn.Array(_88.otherValue)){_31=_87.equals(_88.otherValue)}else{_31=(_88.otherValue==_87)} if(isc.isA.Date(_88.otherValue)&&isc.isA.Date(_87)){_31=(_89.compareDates(_88.otherValue,_87,_53,_88.value)==0)} return _31};var _32=function(_53,_87,_88,_89,_90){if(_88.value==null){return true} _88.value=_88.otherValue;return _12.apply(this,[_53,_87,_88,_89,_90])};var _33=function(_53,_87,_88,_89,_90){if(_88.value==null){return true} _88.value=_88.otherValue;return _2.apply(this,[_53,_87,_88,_89,_90,true])};var _34=function(_53,_87,_88,_89,_90){var _35=_88.criterion;var _36=_88.record;var _37;if(!_35.criteria){_35.criteria=[]} if(!isc.isAn.Array(_35.criteria)){isc.logWarn("AdvancedCriteria: found boolean operator where subcriteria was not an array. Subcriteria was: "+isc.echoFull(_35.criteria));return false} if(this.isNot){_89.$59u=!_89.$59u} for(var _38=0;_38<_35.criteria.length;_38++){var _39=_89.evaluateCriterion(_36,_35.criteria[_38]);if(this.isAnd&&!_39){_37=false} if(this.isNot&&_39){_37=false} if(this.isOr&&_39){_37=true} if(_37!=null){break}} if(_37==null){_37=!this.isOr} if(this.isNot){_89.$59u=!_89.$59u} return _37};var _40=function(_87,_88,_89,_90){if(!_88.criteria)_88.criteria=[];if(!isc.isAn.Array(_88.criteria)){isc.logWarn("AdvancedCriteria: boolean compareCriteria found where old subcriteria was not an array");return-1} if(!_87.criteria)_87.criteria=[];if(!isc.isAn.Array(_87.criteria)){isc.logWarn("AdvancedCriteria: boolean compareCriteria found where new subcriteria was not an array");return-1} var _41,_42=0,_43=_88.criteria.length,_44=_87.criteria.length;if(_44>_43&&_89.isOr){return-1} var _45=isc.clone(_88.criteria);var _46=isc.clone(_87.criteria);for(var i=0;i<_43;i++){var _47=_45[i];var _48=i>_44?null:_46[i];if(!_48||(_48&&_48.fieldName!=_47.fieldName||_48.operator!=_47.operator||_48.processed==true)){_48=null;for(var j=0;j<_44;j++){if(_46[j].processed)continue;if(_46[j].fieldName==_47.fieldName&&_46[j].operator==_47.operator){_48=_46[j];break}}} if(_48&&_47){_48.processed=true;_41=_90.compareAdvancedCriteria(_48,_47)}else{if(_47&&!_48){if(_89.isOr)_41=1;if(_89.isAnd)_41=-1;if(_89.isNot)_41=-1}} if(_89.isAnd&&_41==-1)return-1;if(_89.isOr&&_41==-1)return-1;if(_89.isNot&&_41==1)return-1;if(_41!=0)_42=1} for(var i=0;i<_44;i++){if(!_46[i].processed){if(_89.isOr)return-1;if(_89.isAnd)return 1;if(_89.isNot)return-1}} return _42};var _50=function(_87,_88,_89,_90){if(_87.fieldName==_88.fieldName){var _51=_90.compareValues(_87.value,_88.value,_87.fieldName)==0;if(_51){return 0}} return-1};var _52=function(_87,_88,_89,_90){var _53=_87.fieldName;if(_87.fieldName==_88.fieldName){if(_89.upperBounds&&_89.lowerBounds){if(_90.compareValues(_87.start,_88.start,_53)==0){if(_90.compareValues(_87.end,_88.end,_53)==0){return 0}}}else{if(_90.compareValues(_87.value,_88.value,_53)==0){return 0}} var _54=_87.start==null?_87.value:_87.start,_55=_88.start==null?_88.value:_88.start,_56=_87.start==null?_87.value:_87.end,_57=_88.start==null?_88.value:_88.end;var _7,_58;var _59=true,_60=true,_61=true,_62=true;if(_55==null)_59=false;if(_57==null)_60=false;if(_54==null)_61=false;if(_56==null)_62=false;if(_89.lowerBounds&&!_89.upperBounds&&!_61&&!_59){return 0} if(_89.lowerBounds&&!_89.upperBounds){if(_61&&!_59){return 1} if(_59&&!_61){return-1} var _63=_90.compareValues(_54,_55,_53);if(_63==-1){return 1}else if(_63==0){return 0}} if(_89.upperBounds&&!_89.lowerBounds&&!_62&&!_60){return 0} if(_89.upperBounds&&!_89.lowerBounds){if(_62&&!_60){return 1} if(_60&&!_62){return-1} var _63=_90.compareValues(_54,_55,_53);if(_63==1){return 1}else if(_63==0){return 0}} if(_89.lowerBounds&&_89.upperBounds){if(_90.compareValues(_54,_55,_53)<=0&&_90.compareValues(_54,_57,_53)>=0&&_90.compareValues(_56,_57,_53)>=0&&_90.compareValues(_56,_55,_53)<=0) {return 1} if((_61&&!_59)||(_62&&!_60)){return 1} if(!_61&&!_59&&!_62&&!_59){return 0}}} return-1};var _64=function(_87,_88,_89){var _65=_88.value;var _66=_87.value;if(isc.isA.Number(_65))_65=""+_65;if(isc.isA.Number(_66))_66=""+_66;if(!isc.isA.String(_65)||!isc.isA.String(_66))return-1;if(_89.caseInsensitive){_65=_65.toLowerCase();_66=_66.toLowerCase()} if(_87.fieldName==_88.fieldName&&_87.value==_88.value&&!_89.equals) {return 0} if(_89.equals){return _65==_66?0:-1} if(_89.startsWith&&!_89.negate&&_66.length>_65.length&&isc.startsWith(_66,_65)) {return 1} if(_89.startsWith&&_89.negate&&_65.length>_66.length&&isc.startsWith(_65,_66)) {return 1} if(_89.endsWith&&!_89.negate&&_66.length>_65.length&&isc.endsWith(_66,_65)) {return 1} if(_89.endsWith&&_89.negate&&_65.length>_66.length&&isc.endsWith(_65,_66)) {return 1} if(!_89.startsWith&&!_89.endsWith&&!_89.negate&&_66.length>_65.length&&isc.contains(_66,_65)) {return 1} if(!_89.startsWith&&!_89.endsWith&&_89.negate&&_65.length>_66.length&&isc.contains(_65,_66)) {return 1} return-1};var _67=function(_87,_88,_89){if(_87.fieldName==_88.fieldName){return 0} return-1};var _68=function(_87,_88,_89){if(_87.value==_88.value&&_87.fieldName==_88.fieldName){return 0} return-1};var _69=function(_87,_88,_89){var _70=_88.value,_71=_87.value,_72=_89.ID.replace("Pattern",""),_11=_72.startsWith("i"),_73=_72.contains("ontains"),_74=!_73&&_72.contains("atches"),_75=!_73&&!_74&&_72.contains("artsWith"),_76=!_73&&!_74&&!_75,_77="*",_78=true;if(!_88.value.contains(_77)&&!_87.value.contains(_77)){if(_74){_72=_11?"iEquals":"equals"} var _79=isc.DataSource.$57z[_72];var _15=_79.compareCriteria(_87,_88,_79);if(_78){isc.logWarn(_87.value+" is "+(_15==0?"equal to":(_15>0?"more":"less")+" restrictive than")+" "+_88.value)} return _15} if(_73){if(!_70.startsWith(_77))_70=_77+_70;if(!_70.endsWith(_77))_70+=_77;if(!_71.startsWith(_77))_71=_77+_71;if(!_71.endsWith(_77))_71+=_77}else if(_75){if(!_70.endsWith(_77))_70+=_77;if(!_71.endsWith(_77))_71+=_77}else if(_76){if(!_70.startsWith(_77))_77+_70;if(!_71.startsWith(_77))_77+_71} if(_11){_70=_70.toLowerCase();_71=_71.toLowerCase()} if(_87.fieldName==_88.fieldName&&_70==_71){return 0} var _80=_70.split("*"),_81=_71.split("*");if(_74){if(_81[0]!=_80[0]&&!_81[0].startsWith(_80[0])||(_81[_81.length-1]!=_80[_80.length-1]&&!_81[_81.length-1].startsWith(_80[_80.length-1]))) {return-1}} if(_81[0]!=_80[0]){if(_81[0].startsWith(_80[0])){if(_78)isc.logWarn("More restrictive - new initial string starts with old initial string");return 1}else{if(_78)isc.logWarn("Less restrictive - different initial string");return-1}} if(!_73&&_81[_81.length-1]!=_80[_80.length-1]){if(_78)isc.logWarn("Less restrictive - different end string");return-1} if(!_73&&_80.length<3&&_81.length>_80.length){if(_78)isc.logWarn("More restrictive - old value has no inner strings but new value does end string");return 1} if(_80.length>1){var _82=_80.getRange(1,_80.length-1),_83=_81.getRange(1,_81.length-1);if(_73){if(_83[0].startsWith(_82[0])&&_83[_83.length-1].startsWith(_82[_82.length-1])) {if(_83.length>=_82.length)return 1;else return-1}}else if(_75){if(_83[_83.length-1]==_82[_82.length-1]){if(_83.length>=_82.length)return 1;else return-1}} for(var i=0;i<_82.length;i++){if(!_83[i]||!_83[i].startsWith(_82[i])){if(_78)isc.logWarn("Less restrictive - different interior strings");return-1}} if(_78){isc.logWarn("More restrictive - for each old internal string, there is a new internal string that startsWith the old string")} return 1} if(_78)isc.logWarn("Less restrictive - default return value");return-1};var _84=function(_87,_88,_89){if(_87.fieldName==_88.fieldName){if(!isc.isAn.Array(_88.value)||!isc.isAn.Array(_87.value)){return-1} if(_87.value.equals(_88.value)){return 0} if(!_89.negate&&_88.value.containsAll(_87.value)){return 1} if(_89.negate&&_87.value.containsAll(_88.value)){return 1}} return-1};var _85=function(_87,_88,_89){if(_87.value==_88.value&&_87.fieldName==_88.fieldName){return 0} return-1};var _86=[{ID:"equals",titleProperty:"equalsTitle",negate:false,valueType:"fieldType",condition:_1,compareCriteria:_50,symbol:"==",wildCard:"*",canNormalize:true,getCriterion:function(_53,_87){var _15={fieldName:_53,operator:this.ID};if(isc.isA.RelativeDateItem(_87)) _15.value=_87.getRelativeDate()||_87.getValue();else _15.value=_87.getValue();return _15}},{ID:"notEqual",titleProperty:"notEqualTitle",negate:true,valueType:"fieldType",condition:_1,compareCriteria:_50,symbol:"!",wildCard:"*",canNormalize:true,getCriterion:function(_53,_87){var _15={fieldName:_53,operator:this.ID};if(isc.isA.RelativeDateItem(_87)) _15.value=_87.getRelativeDate()||_87.getValue();else _15.value=_87.getValue();return _15}},{ID:"greaterThan",titleProperty:"greaterThanTitle",lowerBounds:true,valueType:"fieldType",condition:_2,compareCriteria:_52,symbol:">",getCriterion:function(_53,_87){var _15={fieldName:_53,operator:this.ID};if(isc.isA.RelativeDateItem(_87)) _15.value=_87.getRelativeDate()||_87.getValue();else _15.value=_87.getValue();return _15}},{ID:"lessThan",titleProperty:"lessThanTitle",upperBounds:true,valueType:"fieldType",condition:_2,compareCriteria:_52,symbol:"<",getCriterion:function(_53,_87){var _15={fieldName:_53,operator:this.ID};if(isc.isA.RelativeDateItem(_87)) _15.value=_87.getRelativeDate()||_87.getValue();else _15.value=_87.getValue();return _15}},{ID:"greaterOrEqual",titleProperty:"greaterOrEqualTitle",lowerBounds:true,inclusive:true,valueType:"fieldType",condition:_2,compareCriteria:_52,symbol:">=",getCriterion:function(_53,_87){var _15={fieldName:_53,operator:this.ID};if(isc.isA.RelativeDateItem(_87)) _15.value=_87.getRelativeDate()||_87.getValue();else _15.value=_87.getValue();return _15}},{ID:"lessOrEqual",titleProperty:"lessOrEqualTitle",upperBounds:true,inclusive:true,valueType:"fieldType",condition:_2,compareCriteria:_52,symbol:"<=",getCriterion:function(_53,_87){var _15={fieldName:_53,operator:this.ID};if(isc.isA.RelativeDateItem(_87)) _15.value=_87.getRelativeDate()||_87.getValue();else _15.value=_87.getValue();return _15}},{ID:"between",titleProperty:"betweenTitle",lowerBounds:true,upperBounds:true,hidden:true,valueType:"valueRange",condition:_2,compareCriteria:_52,getCriterion:function(_53,_87){var _15={fieldName:_53,operator:this.ID};if(isc.isA.RelativeDateItem(_87)) _15.value=_87.getRelativeDate()||_87.getValue();else _15.value=_87.getValue();return _15}},{ID:"iBetween",titleProperty:"iBetweenTitle",lowerBounds:true,upperBounds:true,hidden:true,valueType:"valueRange",condition:_2,caseInsensitive:true,compareCriteria:_52,getCriterion:function(_53,_87){var _15={fieldName:_53,operator:this.ID};if(isc.isA.RelativeDateItem(_87)) _15.value=_87.getRelativeDate()||_87.getValue();else _15.value=_87.getValue();return _15}},{ID:"betweenInclusive",titleProperty:"betweenInclusiveTitle",lowerBounds:true,upperBounds:true,valueType:"valueRange",inclusive:true,condition:_2,compareCriteria:_52,symbol:"...",getCriterion:function(_53,_87){var _15={fieldName:_53,operator:this.ID};if(isc.isA.RelativeDateItem(_87)) _15.value=_87.getRelativeDate()||_87.getValue();else _15.value=_87.getValue();return _15}},{ID:"iBetweenInclusive",titleProperty:"iBetweenInclusiveTitle",lowerBounds:true,upperBounds:true,valueType:"valueRange",inclusive:true,condition:_2,compareCriteria:_52,symbol:"...",caseInsensitive:true,getCriterion:function(_53,_87){var _15={fieldName:_53,operator:this.ID};if(isc.isA.RelativeDateItem(_87)) _15.value=_87.getRelativeDate()||_87.getValue();else _15.value=_87.getValue();return _15}},{ID:"iEquals",titleProperty:"iEqualsTitle",equals:true,caseInsensitive:true,valueType:"fieldType",condition:_12,symbol:"==",wildCard:"*",canNormalize:true,compareCriteria:_64},{ID:"iContains",titleProperty:"iContainsTitle",caseInsensitive:true,valueType:"fieldType",condition:_12,symbol:"~",canNormalize:true,compareCriteria:_64},{ID:"iStartsWith",titleProperty:"iStartsWithTitle",startsWith:true,caseInsensitive:true,valueType:"fieldType",condition:_12,symbol:"^",canNormalize:true,compareCriteria:_64},{ID:"iEndsWith",titleProperty:"iEndsWithTitle",endsWith:true,caseInsensitive:true,valueType:"fieldType",condition:_12,symbol:"|",canNormalize:true,compareCriteria:_64},{ID:"contains",titleProperty:"containsTitle",hidden:true,valueType:"fieldType",condition:_12,symbol:"~",canNormalize:true,compareCriteria:_64},{ID:"startsWith",titleProperty:"startsWithTitle",startsWith:true,hidden:true,valueType:"fieldType",condition:_12,symbol:"^",canNormalize:true,compareCriteria:_64},{ID:"endsWith",titleProperty:"endsWithTitle",endsWith:true,hidden:true,valueType:"fieldType",condition:_12,symbol:"|",canNormalize:true,compareCriteria:_64},{ID:"iNotEqual",titleProperty:"iNotEqualTitle",caseInsensitive:true,equals:true,negate:true,valueType:"fieldType",condition:_12,symbol:"!",wildCard:"*",canNormalize:true,compareCriteria:_64},{ID:"iNotContains",titleProperty:"iNotContainsTitle",caseInsensitive:true,negate:true,valueType:"fieldType",condition:_12,symbol:"!~",canNormalize:true,compareCriteria:_64},{ID:"iNotStartsWith",titleProperty:"iNotStartsWithTitle",startsWith:true,caseInsensitive:true,negate:true,valueType:"fieldType",condition:_12,symbol:"!^",canNormalize:true,compareCriteria:_64},{ID:"iNotEndsWith",titleProperty:"iNotEndsWithTitle",endsWith:true,caseInsensitive:true,negate:true,valueType:"fieldType",condition:_12,symbol:"!@",canNormalize:true,compareCriteria:_64},{ID:"notContains",titleProperty:"notContainsTitle",negate:true,hidden:true,valueType:"fieldType",condition:_12,symbol:"!~",canNormalize:true,compareCriteria:_64},{ID:"notStartsWith",titleProperty:"notStartsWithTitle",startsWith:true,negate:true,hidden:true,valueType:"fieldType",condition:_12,symbol:"!^",canNormalize:true,compareCriteria:_64},{ID:"notEndsWith",titleProperty:"notEndsWithTitle",endsWith:true,negate:true,hidden:true,valueType:"fieldType",condition:_12,symbol:"!@",canNormalize:true,compareCriteria:_64},{ID:"isNull",titleProperty:"isNullTitle",valueType:"none",condition:_16,symbol:"#",compareCriteria:_67},{ID:"notNull",titleProperty:"notNullTitle",negate:true,valueType:"none",condition:_16,symbol:"!#",compareCriteria:_67},{ID:"regexp",titleProperty:"regexpTitle",hidden:true,valueType:"custom",condition:_17,symbol:"/regex/",compareCriteria:_68},{ID:"iregexp",titleProperty:"iregexpTitle",hidden:true,caseInsensitive:true,valueType:"custom",condition:_17,symbol:"/regex/",compareCriteria:_68},{ID:"matchesPattern",titleProperty:"matchesPatternTitle",hidden:true,valueType:"custom",symbol:"==i~",wildcard:"*",condition:_19,compareCriteria:_69},{ID:"iMatchesPattern",titleProperty:"iMatchesPatternTitle",hidden:true,caseInsensitive:true,valueType:"custom",symbol:"==~",wildcard:"*",condition:_19,compareCriteria:_69},{ID:"startsWithPattern",titleProperty:"startsWithPatternTitle",hidden:true,valueType:"custom",wildcard:"*",condition:_26,compareCriteria:_69},{ID:"iStartsWithPattern",titleProperty:"iStartsWithPatternTitle",hidden:true,caseInsensitive:true,valueType:"custom",wildcard:"*",condition:_26,compareCriteria:_69},{ID:"endsWithPattern",titleProperty:"endsWithPatternTitle",hidden:true,valueType:"custom",wildcard:"*",condition:_27,compareCriteria:_69},{ID:"iEndsWithPattern",titleProperty:"iEndsWithPatternTitle",hidden:true,caseInsensitive:true,valueType:"custom",wildcard:"*",condition:_27,compareCriteria:_69},{ID:"containsPattern",titleProperty:"containsPatternTitle",hidden:true,valueType:"custom",symbol:"=i~",wildcard:"*",condition:_28,compareCriteria:_69},{ID:"iContainsPattern",titleProperty:"iContainsPatternTitle",hidden:true,caseInsensitive:true,valueType:"custom",symbol:"=~",wildcard:"*",condition:_28,compareCriteria:_69},{ID:"inSet",titleProperty:"inSetTitle",valueType:"valueSet",condition:_29,compareCriteria:_84,symbol:"=(",closingSymbol:")",valueSeparator:"|",processValue:function(_24,_87){return _24.split(this.valueSeparator)}},{ID:"notInSet",titleProperty:"notInSetTitle",negate:true,valueType:"valueSet",condition:_29,compareCriteria:_84,symbol:"!=(",closingSymbol:")",valueSeparator:"|",processValue:function(_24,_87){return _24.split(this.valueSeparator)}},{ID:"equalsField",titleProperty:"equalsFieldTitle",valueType:"fieldName",condition:_30,symbol:"=.",canNormalize:true,compareCriteria:_85,processValue:function(_24,_87){if(!_87)return _24;var _13=_87.getField(_24);if(_13)return _24;_13=_87.getFieldByTitle(_24);if(_13)return _13.name;return null}},{ID:"notEqualField",titleProperty:"notEqualFieldTitle",negate:true,valueType:"fieldName",condition:_30,canNormalize:true,compareCriteria:_85},{ID:"iEqualsField",titleProperty:"iEqualsFieldTitle",equals:true,caseInsensitive:true,valueType:"fieldName",condition:_32,canNormalize:true,compareCriteria:_85},{ID:"iNotEqualField",titleProperty:"iNotEqualFieldTitle",equals:true,caseInsensitive:true,negate:true,valueType:"fieldName",condition:_32,canNormalize:true,compareCriteria:_85},{ID:"greaterThanField",titleProperty:"greaterThanFieldTitle",lowerBounds:true,valueType:"fieldName",condition:_33,compareCriteria:_85},{ID:"lessThanField",titleProperty:"lessThanFieldTitle",upperBounds:true,valueType:"fieldName",condition:_33,compareCriteria:_85},{ID:"greaterOrEqualField",titleProperty:"greaterOrEqualFieldTitle",lowerBounds:true,inclusive:true,valueType:"fieldName",condition:_33,compareCriteria:_85},{ID:"lessOrEqualField",titleProperty:"lessOrEqualFieldTitle",upperBounds:true,inclusive:true,valueType:"fieldName",condition:_33,compareCriteria:_85},{ID:"containsField",titleProperty:"containsFieldTitle",hidden:true,valueType:"fieldName",condition:_32,canNormalize:true,compareCriteria:_85},{ID:"startsWithField",titleProperty:"startsWithTitleField",startsWith:true,hidden:true,valueType:"fieldName",condition:_32,canNormalize:true,compareCriteria:_85},{ID:"endsWithField",titleProperty:"endsWithTitleField",endsWith:true,hidden:true,valueType:"fieldName",condition:_32,canNormalize:true,compareCriteria:_85},{ID:"iContainsField",titleProperty:"iContainsFieldTitle",hidden:true,caseInsensitive:true,valueType:"fieldName",condition:_32,canNormalize:true,compareCriteria:_85},{ID:"iStartsWithField",titleProperty:"iStartsWithTitleField",startsWith:true,hidden:true,caseInsensitive:true,valueType:"fieldName",condition:_32,canNormalize:true,compareCriteria:_85},{ID:"iEndsWithField",titleProperty:"iEndsWithTitleField",endsWith:true,hidden:true,caseInsensitive:true,valueType:"fieldName",condition:_32,canNormalize:true,compareCriteria:_85},{ID:"notContainsField",titleProperty:"notContainsFieldTitle",hidden:true,negate:true,valueType:"fieldName",condition:_32,canNormalize:true,compareCriteria:_85},{ID:"notStartsWithField",titleProperty:"notStartsWithTitleField",startsWith:true,hidden:true,negate:true,valueType:"fieldName",condition:_32,canNormalize:true,compareCriteria:_85},{ID:"notEndsWithField",titleProperty:"notEndsWithTitleField",endsWith:true,hidden:true,negate:true,valueType:"fieldName",condition:_32,canNormalize:true,compareCriteria:_85},{ID:"iNotContainsField",titleProperty:"iNotContainsFieldTitle",hidden:true,caseInsensitive:true,negate:true,valueType:"fieldName",condition:_32,canNormalize:true,compareCriteria:_85},{ID:"iNotStartsWithField",titleProperty:"iNotStartsWithTitleField",startsWith:true,hidden:true,caseInsensitive:true,negate:true,valueType:"fieldName",condition:_32,canNormalize:true,compareCriteria:_85},{ID:"iNotEndsWithField",titleProperty:"iNotEndsWithTitleField",endsWith:true,hidden:true,caseInsensitive:true,negate:true,valueType:"fieldName",condition:_32,canNormalize:true,compareCriteria:_85},{ID:"and",titleProperty:"andTitle",isAnd:true,valueType:"criteria",condition:_34,symbol:" and ",compareCriteria:_40},{ID:"not",titleProperty:"notTitle",isNot:true,valueType:"criteria",condition:_34,compareCriteria:_40},{ID:"or",titleProperty:"orTitle",isOr:true,valueType:"criteria",condition:_34,symbol:" or ",compareCriteria:_40}];for(var _38=0;_38<_86.length;_38++){isc.DataSource.addSearchOperator(_86[_38])} isc.DataSource.setTypeOperators(null,["equals","notEqual","lessThan","greaterThan","lessOrEqual","greaterOrEqual","between","betweenInclusive","isNull","notNull","equalsField","notEqualField","greaterThanField","lessThanField","greaterOrEqualField","lessOrEqualField","and","or","not"]);isc.DataSource.setTypeOperators("text",["regexp","iregexp","contains","startsWith","endsWith","iEquals","iNotEqual","iBetween","iBetweenInclusive","iContains","iStartsWith","iEndsWith","notContains","notStartsWith","notEndsWith","iNotContains","iNotStartsWith","iNotEndsWith","containsField","startsWithField","endsWithField","iEqualsField","iNotEqualField","iContainsField","iStartsWithField","iEndsWithField","notContainsField","notStartsWithField","notEndsWithField","iNotContainsField","iNotStartsWithField","iNotEndsWithField","matchesPattern","iMatchesPattern","containsPattern","iContainsPattern","inSet","notInSet","iStartsWithPattern"]);isc.DataSource.setTypeOperators("integer",["iContains","iStartsWith","iEndsWith","iNotContains","iNotStartsWith","iNotEndsWith","iEqualsField","iNotEqualField","containsField","startsWithField","endsWithField","iContainsField","iStartsWithField","iEndsWithField","notContainsField","notStartsWithField","notEndsWithField","iNotContainsField","iNotStartsWithField","iNotEndsWithField","inSet","notInSet"]);isc.DataSource.setTypeOperators("float",["iContains","iStartsWith","iEndsWith","iNotContains","iNotStartsWith","iNotEndsWith","iEqualsField","iNotEqualField","containsField","startsWithField","endsWithField","iContainsField","iStartsWithField","iEndsWithField","notContainsField","notStartsWithField","notEndsWithField","iNotContainsField","iNotStartsWithField","iNotEndsWithField","inSet","notInSet"])};isc.$571();isc.DataSource.create({ID:"Object",fields:{},addGlobalId:false});isc.DataSource.create({ID:"ValueMap",addGlobalId:false,builtinSchema:true,canBeArrayValued:true,fields:{},$cp:"ID",$450:"id",xmlToJS:function(_1,_2){if(_1==null||isc.xml.elementIsNil(_1))return null;var _3=isc.xml.getElementChildren(_1),_4=isc.xml.getAttributes(_1),_5=!isc.isAn.emptyObject(_4);for(var i=0;i<_3.length;i++){var _7=_3[i],_8=_7.getAttribute(this.$cp)||_7.getAttribute(this.$450),_9=isc.xml.getElementText(_7);if(_8!=null&&_9!=null){_5=true;_4[_8]=_9}else if(_8!=null){_4[_8]=_8}else if(_9!=null){_4[_9]=_9}else{_4[isc.emptyString]=isc.emptyString}} if(_5)return _4;return isc.getValues(_4)},xmlSerializeFields:function(_1,_2,_3){if(_1==null||isc.DS.isSimpleTypeValue(_1)){return this.Super("xmlSerializeFields",arguments)} var _4=isc.SB.create(),_3=(_3||"")+(!_2||_2.indent!=false?" ":"");if(isc.isAn.Array(_1)){for(var i=0;i<_1.length;i++){var _6=_1[i];_4.append("\r",_3,"",isc.makeXMLSafe(_6),"")}}else{for(var _7 in _1){var _6=_1[_7];_4.append("\r",_3,"",isc.makeXMLSafe(_6),"")}} return _4.release(false)}});isc.DataSource.create({ID:"Point",addGlobalId:false,builtinSchema:true,canBeArrayValued:true,$135o:"x",$135p:"y",xmlToJS:function(_1,_2){if(_1==null||isc.xml.elementIsNil(_1))return null;var _3=isc.xml.getAttributes(_1);if(_3&&_3.x&&_3.y){return[parseInt(_3.x),parseInt(_3.y)]} var _4=isc.xml.getElementChildren(_1),_5=[];for(var i=0;i<_4.length;i++){var _7=_4[i],_8=isc.xml.getElementText(_7);if(_7.nodeName==this.$135o){_5[0]=(_8!=null?parseInt(_8):null)}else if(_7.nodeName==this.$135p){_5[1]=(_8!=null?parseInt(_8):null)}} return _5},serializeAttributes:function(_1,_2,_3){if(isc.isAn.Array(_1)&&_1.length==2){_2.append(" ","x=\"",this.$38f(null,_1[0]),"\"");_2.append(" ","y=\"",this.$38f(null,_1[1]),"\"");return null} return this.Super("serializeAttributes",arguments)}});isc.ClassFactory.defineInterface("DataModel");isc.DataModel.addInterfaceMethods({getDataSource:function(){if(isc.isA.String(this.dataSource))this.dataSource=isc.DS.get(this.dataSource);return this.dataSource},getOperationId:function(_1){var _2=this.getOperation(_1);return _2==null?null:(isc.isA.String(_2)?_2:_2.ID)},getOperation:function(_1){var _2=isc.rpc.getDefaultApplication(),_3,_4;var _5=_1+"Operation";if(this[_5]){_3=this[_5];if(isc.isAn.Object(_3))return _3;_4=_3} if(_4==null||isc.isA.String(_4)){var _6=this.getDataSource();if(_6==null){this.logWarn("can't getOperation for type: "+_1+", no "+_5+" specified, and no dataSource to create an auto-operation");return null} this.logInfo("creating auto-operation for operationType: "+_1);_3=isc.DataSource.makeDefaultOperation(_6,_1,_4);_4=_3.ID;this[_5]=_4} return _3}});isc.defineClass("XJSONDataSource","DataSource");isc.A=isc.XJSONDataSource.getPrototype();isc.A.dataFormat="json";isc.A.dataTransport="scriptInclude";isc.defineClass("Schema","DataSource");isc.A=isc.Schema.getPrototype();isc.A.dataFormat="xml";isc.A.dropNamespaceDeclarations=true;isc.A.addGlobalId=false;isc.defineClass("WSDLMessage","Schema");isc.A=isc.WSDLMessage.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.getWSOperation=function isc_WSDLMessage_getWSOperation(_1){var _2=this.getWebService(_1);if(_1&&_1.wsOperation)return _2.getOperation(_1.wsOperation);else return _2.getOperationForMessage(this.ID.substring(8))});isc.B._maxIndex=isc.C+1;isc.defineClass("XSElement","Schema");isc.defineClass("XSComplexType","Schema");isc.defineClass("SchemaSet").addMethods({init:function(){this.ns.ClassFactory.addGlobalID(this);var _1=this.schemaNamespace,_2=isc.SchemaSet.schemaSets,_3=_2[_1];if(_3==null||((_3.schema==null&&_3.schema.length==0)&&(this.schema!=null&&this.schema.length!=0))) {_2[_1]=this} var _4=this.serviceNamespace;if(this.schema){this.$530={};this.$531={};this.$693={};for(var i=0;i=isc.Page.getWidth()||_3+this.size>=isc.Page.getHeight()){this.hide();return} if(isNaN(_2))_2=0;if(isNaN(_3))_3=0;this.setLeft(_2);this.setTop(_3);if(!_1&&!this.isVisible())this.show()},initWidget:function(){this.Super("initWidget",arguments);this.$38x(true);this.$38y=isc.Page.setEvent("mouseMove",this.getID()+".$38x()");this.$69s=isc.Page.setEvent("mouseOut",this.getID()+".hide()");this.bringToFront()},destroy:function(){isc.Page.clearEvent("mouseMove",this.$38y);isc.Page.clearEvent("mouseOut",this.$69s);this.Super("destroy",arguments)} };isc.A.promptCursor=isc.Browser.isSafari||(isc.Browser.isMoz&&isc.Browser.geckoVersion<20051111)||(isc.Browser.isIE&&isc.Browser.minorVersion<=5.5)?"wait":"progress";isc.A.fetchDataPrompt="Finding records that match your criteria...";isc.A.getViewRecordsPrompt="Loading record...";isc.A.showPrompt=false;isc.A.promptDelay=300;isc.A.neverShowPrompt=false;isc.A.actionURL="[ISOMORPHIC]/IDACall";isc.A.screenLoaderURL="[ISOMORPHIC]/screenLoader";isc.A.ALL_GLOBALS="-ALL_GLOBALS";isc.A.defaultTransport="xmlHttpRequest";isc.A.httpProxyURL="[ISOMORPHIC]/HttpProxy";isc.A.dataEncoding="XML";isc.A.preserveTypes=true;isc.A.credentialsURL=isc.Page.getIsomorphicDir()+"login/loginSuccessMarker.html";isc.A.loginWindowSettings="WIDTH=550,HEIGHT=250";isc.A.maxLoginPageLength=1048576;isc.A.$38z=[];isc.A.$452=0;isc.A.$410=[];isc.A.pendingRpcs=0;isc.B.push(isc.A.getTransactions=function isc_c_RPCManager_getTransactions(){return this.$38z} ,isc.A.getActiveTransactions=function isc_c_RPCManager_getActiveTransactions(){return this.$410} );isc.B._maxIndex=isc.C+2;isc.A=isc.RPCManager;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.allowCrossDomainCalls=false;isc.A.$380=0;isc.A.onLine=!isc.isOffline();isc.A.$89f="text/xml";isc.A.loginStatusCodeMarker="";isc.A.$113o="return";isc.B.push(isc.A.xmlHttpRequestAvailable=function isc_c_RPCManager_xmlHttpRequestAvailable(){if(isc.Browser.isIE)return(isc.Comm.createXMLHttpRequest()!=null);return true} ,isc.A.getActionURL=function isc_c_RPCManager_getActionURL(){return isc.Page.getURL(this.actionURL)} ,isc.A.send=function isc_c_RPCManager_send(_1,_2,_3){var _4=(_3||{});isc.addProperties(_4,{data:_1,callback:_2 });return this.sendRequest(_4)} ,isc.A.$383=function isc_c_RPCManager__warnIfXmlHttpRequestUnavailable(_1){if(this.xmlHttpRequestAvailable()||!this.logIsWarnEnabled())return false;var _2="Feature "+_1+" requires the xmlHttpRequest transport which is not currently available because ActiveX is disabled. Please see the 'Features requiring ActiveX or Native support' topic in the client-side reference under Client Reference/System for more information.";this.logWarn(_2);return true} ,isc.A.sendProxied=function isc_c_RPCManager_sendProxied(_1,_2){_1.serverOutputAsString=_1.transport!="scriptInclude";if(!_1.isRestRequest)_1.sendNoQueue=true;var _3=_1.actionURL||isc.RPCManager.actionURL;var _4=(_1.useHttpProxy!=null?_1.useHttpProxy:(isc.RPCManager.useHttpProxy&&_3.startsWith("http")&&!this.isLocalURL(_3)));if(!isc.RPCManager.allowCrossDomainCalls){if(!_4&&_3.startsWith("http")&&!this.isLocalURL(_3)){isc.warn("SmartClient can't directly contact URL '"+_3+"' due to browser same-origin policy. Remove the host and port number (even if localhost) to avoid this problem, or use XJSONDataSource for JSONP protocol (which allows cross-site calls), or use the server-side HttpProxy included with SmartClient Server.
This warning may be suppressed by setting RPCManager.allowCrossDomainCalls to true.")} } if(!_4) {if(!_2)_1.useSimpleHttp=true}else{var _5=_1.httpProxyURL||isc.XMLTools.httpProxyURL||isc.RPCManager.httpProxyURL;var _6=isc.addProperties({},_1,{actionURL:_5,isProxied:true,useSimpleHttp:true,proxiedURL:_3,params:{data:null },transport:_1.transport=="scriptInclude"?"scriptInclude":"xmlHttpRequest",httpMethod:null,data:null,contentType:null });isc.Comm.$850=true;_6.params.data=isc.Comm.xmlSerialize("data",{url:_3,httpMethod:_1.httpMethod,params:_1.params,contentType:_1.contentType,requestBody:_1.data,username:_1.username,password:_1.password,httpHeaders:_1.httpHeaders,uploadFileName:_1.uploadFileName,callbackParam:_1.transport=="scriptInclude"?_1.callbackParam:null });isc.Comm.$850=null;_1=_6} return isc.rpc.sendRequest(_1)} ,isc.A.$59w=function isc_c_RPCManager__getHostAndPort(_1){var _2=isc.Page.getProtocol(_1),_3=_1.indexOf("/",_2.length),_4=_1.substring(_2.length,_3),_5 ;var _6=_4.indexOf(":");if(_6!=-1){_5=_4.substring(_6+1);_4=_4.substring(0,_6)} return[_4,_5]} ,isc.A.isLocalURL=function isc_c_RPCManager_isLocalURL(_1){var _2=this.$59w(_1),_3=_2[0],_4=_2[1] ;if(_4==null||_4=="")_4=80;var _5=this.getWindow().location,_6=_5.hostname,_7=_5.port;if(_7==null||_7=="")_7=80;return(_3=="localhost"||_3==_6) &&_4==_7 } ,isc.A.sendRequest=function isc_c_RPCManager_sendRequest(_1){if((this.$454||!this.$453)&&!_1.doNotTrackRPC){try{_1.$138k=this.getStackTrace()}catch(e){_1.$138k="N/A due to: "+e} } if(_1.useHttpProxy&&!_1.isProxied)return this.sendProxied(_1);if(_1.canDropOnDelay&&this.delayingTransactions)return;_1=isc.addProperties({},_1);if(_1.suppressAutoDraw!==false)_1.suppressAutoDraw=true;_1.actionURL=isc.Page.getURL(_1.actionURL||_1.url||_1.URL||this.getActionURL());var _2=_1.transport;if(!_2){if(_1.useXmlHttpRequest!=null||this.useXmlHttpRequest!=null){if(_1.useXmlHttpRequest==null){if(this.useXmlHttpRequest!=null){_1.transport=this.useXmlHttpRequest?"xmlHttpRequest":"hiddenFrame"}else{_1.transport=this.defaultTransport} }else{_1.transport=_2=_1.useXmlHttpRequest?"xmlHttpRequest":"hiddenFrame"} }else{_1.transport=this.defaultTransport} } this.checkTransportAvailable(_1,(_2!=null));if(_1.useSimpleHttp==null)_1.useSimpleHttp=_1.paramsOnly;isc.addDefaults(_1,{showPrompt:this.showPrompt,promptStyle:this.promptStyle,promptCursor:this.promptCursor,useCursorTracker:this.useCursorTracker,cursorTrackerConstructor:this.cursorTrackerConstructor });_1.cursorTrackerProperties=isc.addProperties({},this.cursorTrackerDefaults,this.cursorTrackerProperties,_1.cursorTrackerProperties);if(_1.cursorTrackerProperties==null) _1.cursorTrackerProperties=this.cursorTrackerProperties;if(!_1.operation){_1.operation={ID:"custom",type:"rpc" } } var _3=this.transformRequest(_1);if(_3!==_1){_1.data=_3} this.pendingRpcs++;if(_1.componentId){_1.$166l=window[_1.componentId];if(_1.$166l)_1.$166l.$166g++} if(this.canQueueRequest(_1,(_2!=null))){if(!this.currentTransaction)this.currentTransaction=this.$385(_1.doNotTrackRPC);this.$386(_1,this.currentTransaction);if(!this.queuing)return this.sendQueue();return _1}else{return this.sendNoQueue(_1)} } ,isc.A.checkTransportAvailable=function isc_c_RPCManager_checkTransportAvailable(_1,_2){var _3=this.xmlHttpRequestAvailable();var _4=_1.transport||this.defaultTransport;if(!_3){if(_4=="xmlHttpRequest"){if(_2){this.logWarn("RPC/DS request specifically requesting the xmlHttpRequest transport, but xmlHttpRequest not currently available - switching transport to hiddenFrame.")}else{this.logWarn("RPCManager.defaultTransport specifies xmlHttpRequest, but xmlHttpRequest not currently available - switching transport to hiddenFrame.")} } _1.transport="hiddenFrame"} } ,isc.A.canQueueRequest=function isc_c_RPCManager_canQueueRequest(_1,_2){if(_1.doNotTrackRPC)return false;if(_1.ignoreTimeout)_1.sendNoQueue=true;var _3=_1.transport;if(_1.containsCredentials){return false } if(_1.sendNoQueue||_1.transport=="scriptInclude")return false;var _4=(this.currentTransaction&&this.currentTransaction.requestData.operations.length>0);if(_4&&(_1.actionURL!=this.currentTransaction.URL)){this.logWarn("RPCRequest specified (or defaulted to) URL: "+_1.actionURL +" which is different than the URL for which the RPCManager is currently queuing: " +this.currentTransaction.URL+" - sending this request to server and continuing to queue");return false} if(_4&&(!!_1.useStrictJSON!=!!this.currentTransaction.useStrictJSON)) {this.logWarn("RPCManager - attempt to queue request specified 'useStrictJSON:"+_1.useStrictJSON+". This conflicts with this setting for other queued requests - sending the request to server and continuing to queue.");return false} if(_4&&(this.currentTransaction.transport!=_1.transport)) {this.logWarn("RPCRequest with conflicting transport while queuing, sending request to server and continuing to queue.");return false} return true} ,isc.A.sendNoQueue=function isc_c_RPCManager_sendNoQueue(_1){var _2=this.currentTransaction;var _3=this.queuing;this.currentTransaction=this.$385(_1.doNotTrackRPC);this.$386(_1,this.currentTransaction);var _4=this.sendQueue();this.queuing=_3;this.currentTransaction=_2;return _4} ,isc.A.$385=function isc_c_RPCManager__createTransaction(_1){var _2=this.$452++;var _3={timeout:this.defaultTimeout,transactionNum:_2,operations:[],responses:[],requestData:{transactionNum:_2,operations:[]},prompt:this.defaultPrompt,showPrompt:false,doNotTrackRPC:_1,pushedToDebugMaster:false,changed:function(){if(!this.doNotTrackRPC)isc.RPCManager.pushRPCUpdate(_3)} };this.$38z.add(_3);_3.changed();return _3} ,isc.A.$386=function isc_c_RPCManager__addRequestToTransaction(_1,_2){_2.URL=_1.actionURL;if(_1.containsCredentials)_2.containsCredentials=true;if(!_2.download_filename)_2.download_filename=_1.download_filename;if(((_1.downloadResult||_1.downloadToNewWindow)&&_1.download_filename) ||_1.$38j) {_2.download_filename=_1.download_filename;if(_1.download_filename){_2.URL=this.addPathToURL(_2.URL,"/"+encodeURIComponent(_1.download_filename))} _2.ignoreError=true}else if(_1.exportFilename){_2.URL=this.addPathToURL(_2.URL,"/"+encodeURIComponent(_1.exportFilename))} if(_1.prompt&&!_2.customPromptIsSet){this.logDebug("Grabbed prompt from first request that defined one: "+_1.prompt);_2.prompt=_1.prompt;_2.customPromptIsSet=true} if(_1.showPrompt&&!_2.showPrompt&&!this.neverShowPrompt){_1.showedPrompt=true;isc.addProperties(_2,{showPrompt:true,promptStyle:_1.promptStyle,promptCursor:_1.promptCursor,useCursorTracker:_1.useCursorTracker,cursorTrackerConstructor:_1.cursorTrackerConstructor,cursorTrackerProperties:_1.cursorTrackerProperties })} if(_1.isProxied){isc.addProperties(_2,{isProxied:true,proxiedURL:_1.proxiedURL })} _2.transport=_1.transport;_2.useStrictJSON=_1.useStrictJSON;if(_1.ignoreReloginMarkers)_2.ignoreReloginMarkers=true;_2.operations.add(_1);var _3=_1.data;if(_3==null)_3="__ISC_NULL__";else if(_3==="")_3="__ISC_EMPTY_STRING__";if(!_1.clientOnly)_2.requestData.operations.add(_3);if(_2.omitNullMapValuesInResponse!==false&&_1.omitNullMapValuesInResponse!=null){_2.omitNullMapValuesInResponse=_2.requestData.omitNullMapValuesInResponse=_1.omitNullMapValuesInResponse}else{_2.omitNullMapValuesInResponse=false} if(_1.ignoreTimeout)_2.$387=true;_1.transactionNum=_2.transactionNum;if(_1.timeout||_1.timeout===0)_2.timeout=_1.timeout;_2.changed()} ,isc.A.startQueue=function isc_c_RPCManager_startQueue(_1){var _2=this.queuing;this.queuing=(_1==null?true:_1);return _2} ,isc.A.doShowPrompt=function isc_c_RPCManager_doShowPrompt(_1,_2,_3){if(this.$380++!=0)return;if(_3&&!this.$113i){isc.EH.showClickMask(null,"hard",this.unmaskedTargets?this.unmaskedTargets.duplicate():null,"blockingRPC");this.$113i=true} var _4=this;var _5=function(){if(_1.promptStyle=="dialog"&&_2!=null){isc.showPrompt(_2);_4.$388=true;if(_4.$113i){isc.EH.hideClickMask("blockingRPC");_4.$113i=null} }else{if(!_4.$113i){isc.EH.showClickMask(null,"hard",_4.unmaskedTargets?_4.unmaskedTargets.duplicate():null,"blockingRPC");_4.$113i=true} if(_1.useCursorTracker){_4.$389=isc.ClassFactory.getClass(_1.cursorTrackerConstructor,true).create(_1.cursorTrackerProperties);_4.$389.show()}else{isc.EH.$m8.setCursor(_1.promptCursor)} } };if(_3){this.$113j=isc.Timer.setTimeout(_5,_3)}else{_5()} } ,isc.A.doClearPrompt=function isc_c_RPCManager_doClearPrompt(_1){if(this.$113j){isc.Timer.clear(this.$113j);this.$113j=null} if(_1.clearedPrompt)return;_1.clearedPrompt=true;if(--this.$380!=0){if(this.$380<0)this.$380=0;return} if(this.$388){isc.clearPrompt()}else{if(this.$389){this.$389.destroy();this.$389=null}else{if(isc.EH.$m8)isc.EH.$m8.setCursor(isc.Canvas.DEFAULT)} } this.$388=null;if(this.$113i){isc.EH.hideClickMask("blockingRPC");this.$113i=null} } ,isc.A.hasCurrentTransactionQueued=function isc_c_RPCManager_hasCurrentTransactionQueued(){return!!this.getQueueTransactionId()} ,isc.A.getCurrentTransactionId=function isc_c_RPCManager_getCurrentTransactionId(){return this.getQueueTransactionId()} ,isc.A.getQueueTransactionId=function isc_c_RPCManager_getQueueTransactionId(){return this.currentTransaction?this.currentTransaction.transactionNum:null} ,isc.A.cancelQueue=function isc_c_RPCManager_cancelQueue(_1){if(_1==null){_1=this.currentTransaction} var _2=this.getTransaction(_1);if(_2==null)return;else if(_2==this.currentTransaction)this.currentTransaction=null;if(_2.showPrompt)this.doClearPrompt(_2);if(_2.transportRequest&&_2.transportRequest.abort){_2.transportRequest.abort()} _2.cancelled=true;this.clearTransaction(_2.transactionNum)} ,isc.A.getTransaction=function isc_c_RPCManager_getTransaction(_1){if(_1==null)return null;if(_1.location&&_1.document){var _2=_1;var _3=isc.HiddenFrame.$h6;for(var i=0;i<_3.length;i++){if(_2==_3[i].getHandle()){_1=_3[i].transactionNum;break} } if(_1==_2){this.logDebug("Can't find transactionNum in getTransaction from iframe");return null} } if(isc.isA.Number(_1)||isc.isA.String(_1)){_1=this.$38z.find({transactionNum:_1})} if(_1&&_1.cleared)return null;return _1} ,isc.A.getCurrentTransaction=function isc_c_RPCManager_getCurrentTransaction(){return this.currentTransaction} ,isc.A.getLastSubmittedTransaction=function isc_c_RPCManager_getLastSubmittedTransaction(){return this.$38z[this.$38z.length-1]} ,isc.A.clearTransaction=function isc_c_RPCManager_clearTransaction(_1){var _2=this.getTransaction(_1);if(_2==null){this.logWarn("clearTransaction: no such transaction: "+this.echo(_1));return} this.clearTransactionTimeout(_2);if(!this.$453&&isc.Page.isLoaded()){var _3=isc.LogViewer.getGlobalLogCookie();this.setTrackRPC(_3?_3.trackRPC:false);this.$453=true} _2.cleared=true;if(!this.$454)this.$38z.remove(_2);else _2.changed();isc.RPCManager.$410.remove(_2.transactionNum)} ,isc.A.setTrackRPC=function isc_c_RPCManager_setTrackRPC(_1){this.$454=_1;isc.LogViewer.setGlobalLogCookieValue("trackRPC",_1);var _2=this.getTransactions();if(!_1)this.removeClearedRPC()} ,isc.A.pushRPCUpdate=function isc_c_RPCManager_pushRPCUpdate(_1){if(!this.$454||_1.doNotTrackRPC)return;if(isc.debugTarget)isc.debugTarget.pushRPCUpdate(_1);if(_1.pushedToDebugMaster&&_1.cleared)this.$38z.remove(_1)} ,isc.A.pushBufferedTransactionsToDebugMaster=function isc_c_RPCManager_pushBufferedTransactionsToDebugMaster(){var _1=this.$38z.findAll("pushedToDebugMaster",false);if(!_1)return;for(var i=0;i<_1.length;i++){this.pushRPCUpdate(_1[i])} } ,isc.A.removeClearedRPC=function isc_c_RPCManager_removeClearedRPC(){var _1=this.$38z.findAll("cleared",true);if(_1)this.$38z.removeList(_1)} ,isc.A.delayAllPendingTransactions=function isc_c_RPCManager_delayAllPendingTransactions(){this.delayingTransactions=true;for(var i=0;i1){if(_19[0].contentType==this.$89f){_18="";_18+="" for(var i=0;i<_19.length;i++){_18+=_19[i].data} _18+="";_18+=""}else{_18="{ \"transaction\": { \"transactionNum\": "+_4.transactionNum+", ";_18+="\"operations\": [";for(var i=0;i<_19.length;i++){if(i>0)_18+=", ";var _20=_19[i].data||_19[i].params;if(!isc.isA.String(_20)){_20=isc.JSON.encode(_20)} _18+=_20} _18+="]}}"} }else if(_19.length==1){_18=_19[0].data}else if(_5.useSimpleHttp){_18=_5.data} isc.RPCManager.$410.add(_4.transactionNum);_4.transactionRequest=isc.Comm[_17]({URL:_3,httpMethod:_5.httpMethod,contentType:_5.contentType,httpHeaders:_5.httpHeaders,bypassCache:_5.bypassCache,data:_18,fields:_12,target:_5.target,callbackParam:_5.callbackParam,transport:_4.transport,blocking:_5.blocking,useSimpleHttp:_5.useSimpleHttp,withCredentials:_5.withCredentials,transactionNum:_4.transactionNum,transaction:_4,xmlHttpRequestResponseType:_5.xmlHttpRequestResponseType });if(isc.isA.Function(this.queueSent))this.queueSent(_4.operations);_4.sendTime=isc.timeStamp();if(isc.DataSource){for(var i=0;i<_4.operations.length;i++){var _11=_4.operations[i];isc.DataSource.recordTimingData(_11,"Marshall and send request","end");isc.DataSource.recordTimingData(_11,"Client processing","end")} } return _5} ,isc.A.performTransactionReply=function isc_c_RPCManager_performTransactionReply(_1,_2,_3){var _4=this.getTransaction(_1);if(!_4){this.logWarn("performTransactionReply: No such transaction "+_1);return false} delete _4.$66n;delete _4.abortCallbacks;_4.receiveTime=isc.timeStamp();_4.changed();isc.RPCManager.$410.remove(_1);this.logInfo("transaction "+_1+" arrived after "+(_4.receiveTime-_4.sendTime)+"ms");if(_2==null){this.logFatal("No results for transaction "+_1);return false} if(_4.transport=="xmlHttpRequest"){var _5=_2;_4.xmlHttpRequest=_5;_2="response"in _5?_5.response:_5.responseText;var _6;try{_6=_5.status}catch(e){this.logWarn("Unable to access XHR.status - network cable unplugged?");_6=-1} if(_6==1223)_6=204;if(_6==0&&(location.protocol=="file:"||location.protocol=="app-resource:")) _6=200;_4.httpResponseCode=_6;try{_4.httpResponseText=_5.responseText}catch(e){} _4.httpResponse=_5.response;if(_6!=-1&&!_4.ignoreReloginMarkers&&_4.httpResponseText!=null&&this.processLoginStatusText(_5,_1)) {return} if(_6!=-1&&this.responseRequiresLogin(_5,_1)){this.handleLoginRequired(_1);return} if(_6!=-1&&this.responseIsRelogin(_5,_1)){this.handleLoginRequired(_1);return} if(_6==12030&&isc.Browser.isIE){this.logWarn("Received HTTP status code 12030, resubmitting request");this.resubmitTransaction(_1);return} var _7=_4.URL;var _8;if(_4.isProxied){_7=_4.proxiedURL+" (via proxy: "+_7+")";var _9=this.getHttpHeaders(_5,_4);var _10;if(_9){for(var _11 in _9){if(_11.toLowerCase()=="x-isc-httpproxy-status"){_10=_9[_11];break} } } if(_10&&_10=="-91")_8=-91;if(_10&&_10=="-92")_8=-92} if(_8)_6=500;if(_6>299||_6<200){_2=this.$39c(_4,{data:"Transport error - HTTP code: "+_6 +" for URL: "+_7 +(_6==302?" This error is likely the result of a redirect to a server other than the origin server or a redirect loop.":""),status:_8?_8:isc.RPCResponse.STATUS_TRANSPORT_ERROR });this.logDebug("RPC request to: "+_7 +" returned with http response code: " +_6+". Response text:\n" +_4.httpResponseText);_4.status=_8?_8:isc.RPCResponse.STATUS_TRANSPORT_ERROR;_4.$66n=true;this.handleTransportError(_1,_4.status,_4.httpResponseCode,_4.httpResponseText);if(_4.suspended||_4.abortCallbacks){delete _4.abortCallbacks;delete _4.$66n return} delete _4.$66n} if(_4.httpResponseText!=null&&_4.httpResponseText.contains("parent.isc.RPCManager.handleMaxPostSizeExceeded(window.name);")) {this.$1327(_1);return} }else if(_4.transport=="hiddenFrame"){if(!_4.ignoreReloginMarkers&&this.processLoginStatusText(_2,_1)) {return} } if(this.$454||!this.$1614){if(isc.isA.String(_2)){_4.serializedCommResults=_2}else{_4.serializedCommResults=isc.JSON.encode(_2,{prettyPrint:true,strictQuoting:false,serializeInstances:"short",skipInternalProperties:false});_4.serializedCommResultsAreFormatted=true} } _4.results=_2;this.$39d(_1);return true} );isc.evalBoundary;isc.B.push(isc.A.$1327=function isc_c_RPCManager__handleMaxPostSizeExceeded(_1){var _2=this.getTransaction(_1);var _3=this.$39c(_2,{data:"The server did not receive the data that was sent to it. Please see the documentation for isc.RPCResponse.STATUS_MAX_POST_SIZE_EXCEEDED",status:isc.RPCResponse.STATUS_MAX_POST_SIZE_EXCEEDED });_2.status=isc.RPCResponse.STATUS_MAX_POST_SIZE_EXCEEDED _2.results=_3;this.$39d(_1)} ,isc.A.handleMaxPostSizeExceeded=function isc_c_RPCManager_handleMaxPostSizeExceeded(_1){var _2=window[_1];if(!_2){this.logError("Unable to handle max post size exceeded - can't locate object: "+_1);return} var _3=this.getTransaction(_2);if(!_3){this.logError("Unable to find transaction for comm frame id: "+_1);return} this.$1327(_3.transactionNum)} ,isc.A.handleRequestAborted=function isc_c_RPCManager_handleRequestAborted(_1){var _2=this.getTransaction(_1);var _3=this.$39c(_2,{data:"The server was unable to complete the request as delivered. This may be caused by attempting to upload an unusually large file, for example. Please check the server log for details of the failure.",status:isc.RPCResponse.STATUS_FAILURE });_2.status=isc.RPCResponse.STATUS_FAILURE;_2.results=_3;this.$39d(_1)} ,isc.A.responseIsRelogin=function isc_c_RPCManager_responseIsRelogin(_1,_2){var _3=_1.status;if(document.domain!=location.hostname&&((_3==302&&this.treatRedirectAsRelogin)||(_3==0)||(_3==200&&_1.getAllResponseHeaders()==isc.emptyString&&_1.responseText==isc.emptyString) )) {this.logDebug("Detected document.domain 302 relogin condition - status: "+_3);return true} return false} ,isc.A.processLoginStatusText=function isc_c_RPCManager_processLoginStatusText(_1,_2){var _3=_1.responseText||_1;if(_3&&_3.length1){if(_11.dataFormat=="json"){this.logWarn("Found a REST request that appears to be in JSON format, but the response was not wrapped as configured by the jsonPrefix and jsonSuffix properties - aborting") return}else{_2.results=this.$89g(_2.results);_3=_2.results!=null} } } } if(isc.Log.logIsInfoEnabled("RpcTabTiming")){_2.parseOrEvalResponseEnd=isc.timeStamp()} var _12=_2.results;if(_3&&!isc.isAn.Array(_12))_12=[_12];var _13=_2.operations,_14=[];_2.$66n=true;for(var i=0,j=0;i<_13.length;i++){var _7=_13[i];var _17;if(_3&&_7.clientOnly){_17=isc.addProperties(this.createRPCResponse(_2,_7),{isStructured:false })}else{_17=isc.addProperties(this.createRPCResponse(_2,_7),{isStructured:_3,callbackArgs:_2.transport=="scriptInclude"?_12:null,results:_3?_12[j]:_12 });if(_3&&_7.isRestRequest){isc.addProperties(_17,{data:_12[j]})} j++} if(_17.status==null)_17.status=0;if(_17.isStructured){if(_17.results.errors){var _18=_17.results.errors;if(isc.isAn.Array(_18)&&_18.length==1){_18=_18[0]} } if(_17.results&&!_7.isRestRequest){if(!_17.results.response){isc.addProperties(_17,_17.results)}else{isc.addProperties(_17,_17.results.response)} } } _14[i]=_17;_2.responses[i]=_17} _2.changed();if(_2.showPrompt)this.doClearPrompt(_2);var _19=0;while(_19<_13.length&&!_2.suspended&&!_2.abortCallbacks) {var _7=_13[_19],_17=_14[_19];if(isc.DataSource){isc.DataSource.recordTimingData(_17,"Parse/eval response","start",_2.parseOrEvalResponseStart);isc.DataSource.recordTimingData(_17,"Parse/eval response","end",_2.parseOrEvalResponseEnd);isc.DataSource.recordTimingData(_17,"performOperationReply","start")} this.performOperationReply(_7,_17);if(isc.DataSource){isc.DataSource.recordTimingData(_17,"performOperationReply","end")} _19++} if(this.transactionComplete!=null){this.transactionComplete(_2)} if(!_2.suspended&&!_2.abortCallbacks){this.clearTransaction(_1)} delete _2.abortCallbacks;delete _2.$66n;if(_2.offline)this.playbackNextOfflineTransaction();if(isc.DataSource){var _20=isc.timeStamp();var _19=0;while(_19<_13.length&&!_2.suspended&&!_2.abortCallbacks) {isc.DataSource.recordTimingData(_14[_19++],"User callback invoked","start",_20)} } if(_2.$40c){var _21=_7.application?_7.application :this.getDefaultApplication();if(isc.isA.String(_21))_21=window[_21];_21.fireCallback(_2.$40c,"responses",[_2.responses])} if(isc.DataSource){var _22=isc.timeStamp();var _19=0;while(_19<_13.length&&!_2.suspended&&!_2.abortCallbacks) {isc.DataSource.recordTimingData(_14[_19],"User callback invoked","end",_22);isc.DataSource.recordTimingData(_14[_19++],"Client processing","end",_22)} } } ,isc.A.performOperationReply=function isc_c_RPCManager_performOperationReply(_1,_2){var _3=_2.results,_4=_1.operation;if(this.logIsInfoEnabled()){this.logInfo("rpcResponse(unstructured) results -->" +isc.Log.echoAll(_3)+"<--")} if(_1.$166l)_1.$166l.$166g--;this.pendingRpcs--;var _5=isc.RPC.transformResponse(_2,_1,_1.data);_2=_5||_2;if(this.processLoginStatusCode(_2,_2.transactionNum))return;return this.fireReplyCallbacks(_1,_2)} ,isc.A.fireReplyCallback=function isc_c_RPCManager_fireReplyCallback(_1,_2,_3,_4){var _5=_2.application?_2.application :this.getDefaultApplication();if(isc.isA.String(_5))_5=window[_5];var _6=_5.fireCallback(_1,"rpcResponse,data,rpcRequest",[_3,_4,_2]);return _6} ,isc.A.evalResult=function isc_c_RPCManager_evalResult(_1,_2,_3){var _4=_1.evalVars;this.logDebug("evaling result"+(_4?" with evalVars: "+isc.Log.echo(_4):""));var _5=isc.Canvas.getInstanceProperty("autoDraw");if(_1.suppressAutoDraw)isc.Canvas.setInstanceProperty("autoDraw",false);if(_3.match(/^\s*\{/)){_3="var evalText="+_3+";evalText;" } var _6=isc.Class.evalWithVars(_3,_4);if(_1.suppressAutoDraw)isc.Canvas.setInstanceProperty("autoDraw",_5);return _6} ,isc.A.fireReplyCallbacks=function isc_c_RPCManager_fireReplyCallbacks(_1,_2){var _3=_1.operation,_4=_2.results,_5=_1.evalResult&&_1.transport!="scriptInclude"?this.evalResult(_1,_2,_4):null ;var _6;_6=(_1.evalResult?_5:_4);_2.data=_6;var _7=this.getTransaction(_2.transactionNum);var _8=_1.callback;if(_8!=null){this.fireReplyCallback(_8,_1,_2,_6)} } ,isc.A.$a0=function isc_c_RPCManager__handleError(_1,_2){if(_1.ignoreError)return;if(_2.dataSource){var _3=isc.DataSource.get(_2.dataSource);if(_3&&_3.handleError){var _4=_3.handleError(_1,_2);if(_4==false)return} } return this.handleError(_1,_2)} ,isc.A.handleError=function isc_c_RPCManager_handleError(_1,_2){var _3=(_1.context?_1.context:{}),_4;if(isc.isA.String(_1.data)){_4=_1.data;if(isc.isA.String(_4)){var _5=_4;if(_5.length>this.maxErrorMessageLength){var _6=_5.length-this.maxErrorMessageLength;_5=_5.substring(0,this.maxErrorMessageLength) +"

...("+_6+" bytes truncated - set isc.RPCManager.maxErrorMessageLength > " +this.maxErrorMessageLength +" to see more or check the Developer Console for full error)..."} this.reportError(_5)} }else{var _7=isc.getKeyForValue(_1.status,isc.RPCResponse.errorCodes);if(isc.isA.String(_7)){if(_7.startsWith("STATUS_"))_7=_7.substring(7)}else{_7=(_1.status!=null?"error code: "+_1.status :"unknown error code")} var _8=_1.operationId||_1.operationType,_9=_2.data,_4="",_10="";if(_9&&_9.is_ISC_RPC_DMI){if(_9.appID=="isc_builtin"){_4="Builtin RPC: "+_9.methodName+": "}else{_4="RPCDMI: appId: '"+_9.appID+"', className: '"+_9.className+"', methodName: '"+_9.methodName+"': "} } if(_7=="MAX_FILE_SIZE_EXCEEDED"){_4+=isc.DataSource.maxFileSizeExceededMessage.evalDynamicString(this,{maxFileSize:_1.maxFileSize,uploadedFileName:_1.uploadedFileName,uploadedFileSize:_1.uploadedFileSize });_10="\nSet rpcRequest.willHandleError:true on your request to handle this error yourself, or add a custom handleError to RPCManager to change system-wide default error reporting"}else if(_7=="VALIDATION_ERROR"){_4+="Server returned validation errors: "+isc.echoFull(_1.errors);_10="\nSet rpcRequest.willHandleError:true on your request to handle this error yourself, or add a custom handleError to RPCManager to change system-wide default error reporting"}else{_4+="Server returned "+_7+" with no error message"+(_8?" performing operation '"+_8+"'.":".")} this.reportError(_4,_1.stacktrace)} this.logWarn(_4+_10+" - response: "+this.echo(_1));return false} ,isc.A.handleTransportError=function isc_c_RPCManager_handleTransportError(_1,_2,_3,_4){} ,isc.A.handleLoginRequired=function isc_c_RPCManager_handleLoginRequired(_1){if(this.$39j&&this.$39j==_1)return;var _2=this.getTransaction(_1);if(_2==null)return;_1=_2.transactionNum;this.clearTransactionTimeout(_2);var _3=_2.operations[0],_4=this.createRPCResponse(_2,_3);this.logInfo("loginRequired for transaction: "+_1+(_2.containsCredentials?", transaction containsCredentials":""));if(_2.containsCredentials){if(_3.callback){_4.status=isc.RPCResponse.STATUS_LOGIN_INCORRECT;this.fireReplyCallbacks(_3,_4);this.clearTransaction(_2);return} this.clearTransaction(_2)} this.suspendTransaction(_2);if(this.loginRequired){_4.status=isc.RPCResponse.STATUS_LOGIN_REQUIRED;this.loginRequired(_1,_3,_4);return} var _5=this.addParamsToURL(this.credentialsURL,{ts:new Date().getTime()});this.$39j=window.open(_5,this.loginWindowSettings)} ,isc.A.handleLoginSuccess=function isc_c_RPCManager_handleLoginSuccess(_1){var _2=this.getTransaction(_1);if(_2&&_2.containsCredentials){this.clearTransactionTimeout(_2);var _3=_2.operations[0];if(_3.callback){var _4=this.createRPCResponse(_2,_3,{status:isc.RPCResponse.STATUS_SUCCESS });this.fireReplyCallbacks(_3,_4);this.clearTransaction(_2);return} this.clearTransaction(_2)} if(this.$39j)this.$39j.close();if(this.loginSuccess&&this.loginSuccess()===false)return;this.resendTransaction()} ,isc.A.handleMaxLoginAttemptsExceeded=function isc_c_RPCManager_handleMaxLoginAttemptsExceeded(_1){var _2=this.getTransaction(_1);if(_2&&_2.containsCredentials){this.clearTransactionTimeout(_2);var _3=_2.operations[0];if(_3.callback){var _4=this.createRPCResponse(_2,_3,{status:isc.RPCResponse.STATUS_MAX_LOGIN_ATTEMPTS_EXCEEDED });this.fireReplyCallbacks(_3,_4);this.clearTransaction(_2);return} this.clearTransaction(_2)} if(this.$39j)this.$39j.close();if(this.maxLoginAttemptsExceeded)this.maxLoginAttemptsExceeded();else{var _5="Max login attempts exceeded.";if(isc.warn)isc.warn(_5);else alert(_5)} } ,isc.A.exportContent=function isc_c_RPCManager_exportContent(_1,_2){if(_2==null)_2={};var _3=isc.Page.getSkinDir(),_4=_3.trim("/").split("/").last();var _5={pdfName:_2.exportFilename||_2.pdfName||"export",skinName:_2.skinName||_4,exportCSS:_2.exportCSS,defaultSkinName:_3 };var _6=isc.addProperties({showPrompt:false,transport:"hiddenFrame",exportResults:true,downloadResult:true,downloadToNewWindow:false,download_filename:null },_2);delete _6.pdfName;delete _6.skinName;delete _6.exportCSS;if(isc.Browser.isMobileSafari&&_6.downloadToNewWindow==true){var _7=_6.newDownloadWindow=_6.download_filename||"request_"+isc.timeStamp();window.open(null,_7).document.write(this.$143q)} var _8=function(_10){isc.DMI.callBuiltin({methodName:"getPdfObject",arguments:[_10,_5],requestParams:_6 })};var _9=isc.Canvas.getPrintHTML(_1,{printForExport:true },_8)} ,isc.A.exportImage=function isc_c_RPCManager_exportImage(_1,_2,_3){var _4=_2||{},_5=(_4.exportDisplay!=this.$113o);var _6={downloadResult:_5 };isc.DMI.callBuiltin({methodName:"exportImage",arguments:[_1,_2],requestParams:_6,callback:function $113p(_7,_8,_9){if(_3){isc.Class.fireCallback(_3,"imageData",[_8.base64])} } })} ,isc.A.reportError=function isc_c_RPCManager_reportError(_1){isc.warn(_1.asHTML())} ,isc.A.transformResponse=function isc_c_RPCManager_transformResponse(_1,_2,_3){return _1} ,isc.A.transformRequest=function isc_c_RPCManager_transformRequest(_1){return _1.data} ,isc.A.loadScreen=function isc_c_RPCManager_loadScreen(_1,_2,_3,_4,_5){if(!_1){this.logWarn("No screen names passed in.");this.fireCallback(_2,"data",[null]);return} if(!isc.isAn.Array(_1))_1=[_1];if(_1.length<=0){this.logWarn("No screen names passed in.");this.fireCallback(_2,"data",[null]);return} if(!_3)_3=[];if(!isc.isAn.Array(_3))_3=[_3];var _6={};if(_5)isc.addProperties(_6,_5);if(_6.params==null)_6.params={};_6.params.screenName=_1.join(",");if(_4){isc.addProperties(_6.params,{locale:_4})} if(!_6.actionURL)_6.actionURL=this.screenLoaderURL;_6.useSimpleHttp=true;var _7=this;_6.callback=function(_8,_9,_10){_7.$112r(_8,_9,_10,_2,_3)};this.sendRequest(_6)} ,isc.A.createScreen=function isc_c_RPCManager_createScreen(_1,_2){if(!_1){this.logWarn("No screen names passed in.");return null} if(!_2)_2=[];if(!isc.isAn.Array(_2))_2=[_2];var _3=this;var _4=_3.$112s[_1];if(!_4){return null} return this.$112r(null,_4,null,null,_2)} ,isc.A.$112r=function isc_c_RPCManager__makeScreen(_1,_2,_3,_4,_5){if(!_3){_3={}};var _6=isc.Canvas.getInstanceProperty("autoDraw"),_7=_3.suppressAutoDraw==null?true:_3.suppressAutoDraw;if(_7)isc.Canvas.setInstanceProperty("autoDraw",false);var _8=this;if(_5.length==1&&_5[0]==_8.ALL_GLOBALS){var _9=isc.Class.globalEvalWithCapture(_2,function(_5,_17){if(_17!=null)isc.Log.$am(_17,null,null,null,"Error when executing loaded screen");var _10=isc.Canvas.$112q(_5);var _11={};if(_7)isc.Canvas.setInstanceProperty("autoDraw",_6);_8.fireCallback(_4,"screen,rpcResponse,suppressedGlobals",[_10,_1,_11])},null,false);var _10=isc.Canvas.$112q(_9.globals);return _10}else{var _9=isc.Class.globalEvalAndRestore(_2,_5,function(_5,_17,_11){if(_17!=null)isc.Log.$am(_17,null,null,null,"Error when executing loaded screen");var _10=isc.Canvas.$112q(_5);if(_7)isc.Canvas.setInstanceProperty("autoDraw",_6);var _12={};var _13=isc.getKeys(_11) for(var i=0;i<_13.length;i++){var _15=_13[i];var _16=window[_15];if(_16&&(isc.isA.Canvas(_16)||isc.isA.FormItem(_16))){_12[_15]=_16} } _11=_12;_8.fireCallback(_4,"screen,rpcResponse,suppressedGlobals",[_10,_1,_11])},null,false,true);var _10=isc.Canvas.$112q(_9.globals);return _10} } ,isc.A.cacheScreens=function isc_c_RPCManager_cacheScreens(_1,_2,_3,_4){if(!_1){this.logWarn("No screen names passed in.");this.fireCallback(_2,"data",[null]);return} if(!isc.isAn.Array(_1))_1=[_1];if(_1.length<=0){this.logWarn("No screen names passed in.");this.fireCallback(_2,"data",[null]);return} var _5={};if(_4)isc.addProperties(_5,_4);_5.params={screenName:_1.join(",")};if(_3){isc.addProperties(_5.params,{locale:_3})} isc.addProperties(_5.params,{structuredResponse:true});if(!_5.actionURL)_5.actionURL=this.screenLoaderURL;_5.useSimpleHttp=true;var _6=this;_5.callback=function(_9,_10,_11){isc.Class.globalEvalWithCapture(_10,function(_12,_13){if(_13!=null)isc.Log.$am(_13,null,null,null,"Error when executing cache screen");if(!_6.$112s){_6.$112s={}} var _7=isc.Class.evaluate(_10);for(var i=0;i<_7.length;i++){if(_6.$112s[_7[i].screenName]){_6.logWarn("Screen "+_7[i].screenName+" is already cached. Replacing.")} _6.$112s[_7[i].screenName]=_7[i].source} _6.fireCallback(_2,"data,rpcResponse",[_7,_9])},null,false)};this.sendRequest(_5)} ,isc.A.requestsArePending=function isc_c_RPCManager_requestsArePending(){return this.pendingRpcs!=0} );isc.B._maxIndex=isc.C+92;isc.RPCManager.rpc_logMessage=isc.RPCManager.logMessage;isc.RPCManager.logMessage=function(_1,_2,_3,_4){if(this.logIsEnabledFor(_1,_3)){if(isc.isA.String(_2)&&_2.length>this.maxLogMessageLength &&!this.logIsEnabledFor(_1,"RPCManagerResponse")) {var _5=_2.length-this.maxLogMessageLength;_2=_2.substring(0,this.maxLogMessageLength) +"\n...("+_5+" bytes truncated). Enable RPCManagerResponse log at same threshold to see full message." } } this.rpc_logMessage(_1,_2,_3,_4)};isc.addGlobal("InstantDataApp",isc.RPCManager);isc.isA.InstantDataApp=isc.isA.RPCManager;isc.A=isc.InstantDataApp;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.addDefaultOperation=function isc_c_InstantDataApp_addDefaultOperation(_1,_2,_3){if(!_1)_1={};_1.operation=isc.DataSource.makeDefaultOperation(_2,_3,_1.operation);return _1} ,isc.A.setDefaultApplication=function isc_c_InstantDataApp_setDefaultApplication(_1){isc.InstantDataApp.defaultApplication=_1} ,isc.A.getDefaultApplication=function isc_c_InstantDataApp_getDefaultApplication(){if(this.defaultApplication==null){this.create({ID:"builtinApplication",dataSources:[],operations:{},pointersToThis:[{object:this,property:"defaultApplication"}] })} return this.defaultApplication} ,isc.A.app=function isc_c_InstantDataApp_app(){return this.getDefaultApplication()} );isc.B._maxIndex=isc.C+4;isc.A=isc.InstantDataApp.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.init=function isc_InstantDataApp_init(){if(this.ID!="builtinApplication")isc.ClassFactory.addGlobalID(this);if(isc.rpc.defaultApplication==null||isc.rpc.defaultApplication.getID()=="builtinApplication") {isc.rpc.setDefaultApplication(this)} } );isc.B._maxIndex=isc.C+1;isc.defineInterface("IRPCStatusListener").addInterfaceProperties({initInterface:function(){this.observe(isc.RPCManager.$38z,"dataChanged","observer.transactionsChanged()")},destroyInterface:function(){this.ignore(isc.RPCManager.$38z,"dataChanged")},transactionsChanged:function(){},getActiveTransactions:function(){var _1=[];var _2=isc.RPCManager.getTransactions();for(var i=0;i<_2.length;i++){var _4=_2[i];if(_4&&!_4.cleared&&_4.operations){var _5=true;for(var j=0;j<_4.operations.length;j++){var _7=_4.operations[j];if(_7.downloadResult||_7.$38j){_5=false;break} } if(_5)_1.add(_4)} } return _1},haveActiveTransactions:function(){return this.getActiveTransactions().length>0}});isc.defineInterface("IRPCUnmaskedTarget").addInterfaceProperties({initInterface:function(){isc.RPCManager.registerUnmaskedTarget(this)},destroyInterface:function(){isc.RPCManager.unregisterUnmaskedTarget(this)}});isc.defineClass("UnmaskedTargetLandingPad","Canvas");isc.A=isc.UnmaskedTargetLandingPad.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.overflow="visible";isc.A.height=1;isc.A.width=1;isc.A.observationHooks=["draw","clear","moved","parentMoved","parentResized","parentVisibilityChanged"];isc.B.push(isc.A.initWidget=function isc_UnmaskedTargetLandingPad_initWidget(){this.Super("initWidget",arguments);for(var i=0;i
Are you sure you want to cancel this request?";isc.B.push(isc.A.cancelQueue=function isc_RPCStatusMenuButton_cancelQueue(){var _1=this.getActiveTransactions();for(var i=0;i<_1.length;i++){this.logWarn("cancel queue: "+i+" with value: "+isc.echoFull(_1[i].transactionNum));isc.RPCManager.cancelQueue(_1[i])}} ,isc.A.initWidget=function isc_RPCStatusMenuButton_initWidget(){this.Super("initWidget",arguments);var _1=[];_1.add({title:isc.RPCManager.defaultPrompt,isPrompt:true,enabled:false});if(this.canCancelQueue){var _2=this;_1.add({title:"Cancel all requests",icon:"[SKINIMG]actions/close.png",click:function(){if(_2.confirmCancelQueue){isc.confirm(_2.cancelQueueConfirmationMessage,function(_3){if(_3)_2.cancelQueue()})}else{_2.cancelQueue()} }})} this.menu=isc.Menu.create({data:_1 });this.menuButton=this.createAutoChild("menuButton",{menu:this.menu });this.updateState();this.addAutoChildren(this.autoChildren)} ,isc.A.updateState=function isc_RPCStatusMenuButton_updateState(){var _1=this.getActiveTransactions();var _2=isc.RPCManager.getTransaction(_1[_1.length-1]);var _3="";var _4=this.menu.data.find("isPrompt",true);if(_2){_3+=isc.Canvas.getImgHTML(this.progressImage,this.progresImageWidth,this.progressImageHeight);if(_4)this.menu.setItemTitle(_4,_2.prompt);this.setDisabled(false)}else{_3+=isc.Canvas.getImgHTML(this.noProgressImage,this.noProgresImageWidth,this.noProgressImageHeight);if(_4)this.menu.setItemTitle(_4,this.defaultPrompt);this.setDisabled(true)} this.setTitle(_3)} ,isc.A.transactionsChanged=function isc_RPCStatusMenuButton_transactionsChanged(){this.updateState()} );isc.B._maxIndex=isc.C+4} isc.defineClass("DMI").addClassProperties({actionURL:isc.RPCManager.actionURL,call:function(_1,_2,_3){var _4=[];for(var i=0;i0)_3=_4.getProperty("logMessage");var _5=_2.createElement("IscSeleniumCaptureLogs");_5.setAttribute("logMessages",_3.join(""));_2.documentElement.appendChild(_5);var _6=_2.createEvent("HTMLEvents");_6.initEvent("IscSeleniumServerLogsCapturedEvent",true,false);_5.dispatchEvent(_6)});isc.DMI.$131a("revertTemporaryLogThresholds")},false)} isc.ClassFactory.defineClass("ResultSet",null,["List","DataModel"]);isc.A=isc.ResultSet;isc.A.UNKNOWN_LENGTH=1000;isc.A.$121g=["fetchAhead","fetchMode","resultSize","fetchDelay","dataSource","criteriaPolicy","useClientSorting","useClientFiltering","updateCacheFromRequest","dropCacheOnUpdate","dropCacheOnLengthChange","disableCacheSync","progressiveLoading","shouldReorderAllRows","neverDropUpdatedRows","updatePartialCache","transformUpdateResponses"];isc.A=isc.ResultSet;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.getLoadingMarker=function isc_c_ResultSet_getLoadingMarker(){return Array.LOADING},isc.A.$97o=function isc_c_ResultSet__removeNullsAndLoadings(_1){var i=0,n=0,_4=_1.length,_5=Array.LOADING;for(;i<_4;++i){var a=_1[i];if(a==null||a===_5){++n}else if(n>0){_1.splice(i-n,n);i-=n;_4-=n;n=0}} if(n>0){_1.splice(i-n,n)} return _1},isc.A.$121h=function isc_c_ResultSet__prepareSparseData(_1){var _2=Array.LOADING,_3=true;for(var i=_1.length;i--;){if(_1[i]==_2){_1[i]=null}else{_3=false}} return _3});isc.B._maxIndex=isc.C+3;isc.A=isc.ResultSet.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.cachedRows=0;isc.A.fetchAhead=true;isc.A.resultSize=75;isc.A.fetchDelay=0;isc.A.useClientSorting=true;isc.A.useClientFiltering=true;isc.A.updateCacheFromRequest=true;isc.A.shouldReorderAllRows=true;isc.A.updatePartialCache=true;isc.A.alwaysRequestVisibleRows=false;isc.B.push(isc.A.addAt=function isc_ResultSet_addAt(){isc.logWarn('ResultSets are readonly. This operation (addAt) will be ignored.')},isc.A.set=function isc_ResultSet_set(){isc.logWarn('ResultSets are readonly. This operation (set) will be ignored.')},isc.A.removeAt=function isc_ResultSet_removeAt(){isc.logWarn('ResultSets are readonly. This operation (removeAt) will be ignored.')},isc.A.shouldUseClientSorting=function isc_ResultSet_shouldUseClientSorting(){if(!isc.RPCManager.onLine)return true;return this.useClientSorting},isc.A.shouldUseClientFiltering=function isc_ResultSet_shouldUseClientFiltering(){if(!isc.RPCManager.onLine)return true;return this.useClientFiltering},isc.A.shouldNeverDropUpdatedRows=function isc_ResultSet_shouldNeverDropUpdatedRows(){if(!isc.RPCManager.onLine)return true;return this.neverDropUpdatedRows},isc.A.shouldUpdatePartialCache=function isc_ResultSet_shouldUpdatePartialCache(){if(!isc.RPCManager.onLine)return true;return this.updatePartialCache});isc.B._maxIndex=isc.C+7;isc.A=isc.ResultSet.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.dynamicDSFieldValues=false;isc.A.$39r=0;isc.A.notifyOnUnchangedCache=false;isc.B.push(isc.A.init=function isc_ResultSet_init(){isc.ClassFactory.addGlobalID(this);if(this.operation!=null)this.fetchOperation=this.operation;var _1=this.getOperation("fetch");var _2=_1.dataSource;if(!isc.isAn.Array(_2))_2=[_2];for(var i=0;i<_2.length;i++){var _4=isc.DS.get(_2[i]);this.observe(_4,"dataChanged","observer.dataSourceDataChanged(dsRequest,dsResponse)");if(!this.$39s)this.$39s=[];this.$39s.add(_4);if(!this.dataSource)this.dataSource=_4} if(!this.getDataSource()){this.logError("Invalid dataSource: "+this.echoLeaf(this.dataSource)+", a ResultSet must be created with a valid DataSource")} var _5=this.context;this.resultSize=(_5&&_5.dataPageSize!=null?_5.dataPageSize:this.resultSize);if(this.allRows){this.fetchMode="local"}else{this.fetchMode=(_5&&_5.dataFetchMode!=null?_5.dataFetchMode:this.fetchMode||"paged")} if(this.dropCacheOnUpdate==null){this.dropCacheOnUpdate=this.$du(_1.dropCacheOnUpdate,this.getDataSource().dropCacheOnUpdate)} this.context=this.context||{};this.$1317=[];var _6=this.criteria||this.filter||{};if(this.$121j){this.criteria=_6;this.$39t=(isc.getKeys(_6).length==0)}else{this.criteria=null;this.setCriteria(_6)} if(this.initialData){isc.ResultSet.$121h(this.initialData);this.fillCacheData(this.initialData);this.setFullLength(this.initialLength||this.totalRows||this.initialData.length);if(this.sortSpecifiers)this.setSort(this.sortSpecifiers,true);if(this.sortBy)this.setSort(isc.DS.getSortSpecifiers(this.sortBy),true)}else if(this.isPaged()){this.$121k([])} this.observe(isc,"goOffline",function(){this.goOffline()});this.observe(isc.RPCManager,"offlineTransactionPlaybackComplete",function(){this.offlinePlaybackComplete()})},isc.A.goOffline=function isc_ResultSet_goOffline(){},isc.A.offlinePlaybackComplete=function isc_ResultSet_offlinePlaybackComplete(){if(this.haveOfflineRecords){this.invalidateCache();this.haveOfflineRecords=false}},isc.A.destroy=function isc_ResultSet_destroy(){if(window[this.ID]==this)window[this.ID]=null;this.ignore(isc,"goOffline");this.ignore(isc.RPCManager,"offlineTransactionPlaybackComplete");if(this.$39s!=null){for(var i=0;i0)return false} return!this.lengthIsKnown()||this.getLength()<=0},isc.A.canSortOnClient=function isc_ResultSet_canSortOnClient(){return this.shouldUseClientSorting()&&(this.allMatchingRowsCached()||(isc.Offline&&isc.Offline.isOffline()))},isc.A.canFilterOnClient=function isc_ResultSet_canFilterOnClient(){return this.shouldUseClientFiltering()&&this.allRowsCached()},isc.A.getLength=function isc_ResultSet_getLength(){var _1=this.unknownLength||isc.ResultSet.UNKNOWN_LENGTH;if(!this.lengthIsKnown())return _1;return(this.isPaged()&&!this.allRows?this.totalRows:this.localData.length)},isc.A.$121l=function isc_ResultSet__getCachedLength(){if(this.lengthIsKnown()){return this.getLength()}else if(this.localData!=null){return this.localData.length}else{return 0}},isc.A.$137f=function isc_ResultSet__getCachedRows(){return this.cachedRows},isc.A.indexOf=function isc_ResultSet_indexOf(_1,_2,_3){if(this.localData==null)return-1;if(Array.isLoading(_1))return-1;var _4=this.localData.indexOf(_1,_2,_3);if(_4!=-1)return _4;return this.getDataSource().findByKeys(_1,this.localData,_2,_3)},isc.A.slideList=function isc_ResultSet_slideList(_1,_2){if(!this.allMatchingRowsCached()&&!this.shouldUpdatePartialCache()){isc.logWarn('updatePartialCache is disabled: record position will not be shifted.');return} var _3=[],i;if(_2<0)_2=0;var _5=this.$1317,_6=_5.length,k=this.$1318(0),_8=(k%2==0),j=(k+1<_6?_5[++k]:-1);var _10=this.localData;for(i=0;i<_2;++i){if(i==j){_8=!_8;j=(k+1<_6?_5[++k]:-1)} var _11=this.localData[i];if(_11==null&&_8){isc.logWarn('Sliding from a row position that has not yet been loaded, ignoring');return} if(!_1.contains(_11)){_3.add(_11)}} for(i=0;i<_1.length;++i){_3.add(_1[i])} var _12=_10.length;for(i=_2;i<_12;++i){if(i==j){_8=!_8;j=(k+1<_6?_5[++k]:-1)} var _11=_10[i];if(_11==null&&_8){isc.logWarn('Sliding into a row position that has not yet been loaded, ignoring');return} if(!_1.contains(_11)){_3.add(_11)}} this.$121k(_3);if(this.shouldUpdatePartialCache()){this.invalidateRowOrder()} if(this.shouldReorderAllRows)this.reorderAllRows();this.dataChanged()},isc.A.reorderAllRows=function isc_ResultSet_reorderAllRows(){var i,_2=this.localData;if(!this.allRowsCached()||!this.lengthIsKnown())return;for(i=0;i<_2.length;i++)_2[i].$100o=i;var _3=0,_4=this.allRows,_5=_4.getLength();for(i=0;i<_5;i++){var _6=_4.get(i);if(_6.$100o!=null){_4.set(i,_2[_3++]);delete _6.$100o}}},isc.A.get=function isc_ResultSet_get(_1){if(_1<0){this.logWarn("get: invalid index "+_1);return null} if(this.localData!=null){var _2=this.localData[_1];if(_2!=null){return _2}else if(this.$1319(_1)){return isc.ResultSet.getLoadingMarker()}} if(this.fetchStartRow!=null&&_1>=this.fetchStartRow&&_1<=this.fetchEndRow){return Array.LOADING} return this.getRange(_1,_1+1)[0]},isc.A.getRange=function isc_ResultSet_getRange(_1,_2,_3,_4){if(isc.$cv)arguments.$cw=this;if(_1==null){this.logWarn("getRange() called with no specified range - ignoring.");return} if(_2==null)_2=_1+1;if(this.isPaged()){return this.$39u(_1,_2,_3,_4)} if(this.localData==null){this.$121k([]);this.setRangeLoading(_1,_2);this.$121m()} var _5=this.localData.slice(_1,_2);var _6=isc.ResultSet.getLoadingMarker(),_7=this.$1317,_8=_7.length,k=this.$1318(_1),_10=(k%2==0),j=(k+1<_8?_7[++k]:-1);for(var i=_1;i<_2;++i){if(i==j){_10=!_10;j=(k+1<_8?_7[++k]:-1)} if(_5[i]==null&&_10){_5[i]=_6}} return _5},isc.A.getAllRows=function isc_ResultSet_getAllRows(){if(!this.lengthIsKnown())return[];return this.getRange(0,this.getLength())},isc.A.getAllLoadedRows=function isc_ResultSet_getAllLoadedRows(){if(!this.lengthIsKnown())return[];var _1=[];for(var i=0;iv){i=k}else{return k}} if(j==-1||_1<_2[i]){return i-1}else if(_1==_2[i]||_1<_2[j]){return i}else{return j}},isc.A.$1319=function isc_ResultSet__rowIsLoading(_1){return(this.$1318(_1)%2==0)},isc.A.$132a=function isc_ResultSet__firstLoadingRow(_1,_2,_3){if(!(_1<_2)){return-1} var _4=this.$1317,j=this.$1318(_1);if(_3==(j%2==0)){return _1}else if(j+1<_4.length&&_4[j+1]<_2){return _4[j+1]}else{return-1}},isc.A.$132b=function isc_ResultSet__lastLoadingRow(_1,_2,_3){if(!(_1<_2)){return-1} var _4=this.$1317,j=this.$1318(_2-1);if(_3==(j%2==0)){return _2-1}else if(0<=j&&_1<=_4[j]-1){return _4[j]-1}else{return-1}},isc.A.$132c=function isc_ResultSet__setRangeLoading(_1,_2,_3){if(!(0<=_1&&_1<_2)){return} var _4=this.$1317,i=this.$1318(_1),j=this.$1318(_2-1);var _7=(_3!=(i%2==0)),_8=(_3!=(j%2==0)),_9=(_7&&0<=i&&_1==_4[i]),_10=(_8&&j+1<_4.length&&_2==_4[j+1]),_11=(!_9&&_7),_12=(!_10&&_8),_13=i+(_9?0:1),_14=(j-i+(_9?1:0)+(_10?1:0));if(_11&&_12){_4.splice(_13,_14,_1,_2)}else if(_11){_4.splice(_13,_14,_1)}else if(_12){_4.splice(_13,_14,_2)}else{_4.splice(_13,_14)}},isc.A.lengthIsKnown=function isc_ResultSet_lengthIsKnown(){return this.localData!=null&&(this.isPaged()?this.totalRows!=null:this.$39v==null)},isc.A.fetchIsPending=function isc_ResultSet_fetchIsPending(){return this.$39v!=null||this.pendingActionOnPause("fetchRemoteData")},isc.A.rowIsLoaded=function isc_ResultSet_rowIsLoaded(_1){return(this.localData!=null&&this.localData[_1]!=null)},isc.A.getCachedRow=function isc_ResultSet_getCachedRow(_1){var _2=this.localData[_1];if(_2!=null){return _2}else{return null}},isc.A.rangeIsLoaded=function isc_ResultSet_rangeIsLoaded(_1,_2){var _3=this.localData;if(_3==null){return false} for(var i=_1;i<_2;i++){if(_3[i]==null){return false}} return true},isc.A.findLastCached=function isc_ResultSet_findLastCached(_1,_2){if(!this.rowIsLoaded(_1))return null;var _3=this.localData;if(_2){var i=_1;while(i>=0&&_3[i]!=null){--i} return i+1}else{var _5=this.getLength(),i=_1;while(i<_5&&_3[i]!=null){++i} return i-1}},isc.A.getCachedRange=function isc_ResultSet_getCachedRange(_1){if(_1==null)_1=this.lastRangeStart;if(_1==null)_1=0;if(!this.rowIsLoaded(_1))return null;var _2=this.getLength();if(this.allMatchingRowsCached())return[0,_2-1];var _3=this.findLastCached(_1,true),_4=this.findLastCached(_1);return[_3,_4]},isc.A.setRangeLoading=function isc_ResultSet_setRangeLoading(_1,_2){if(this.localData==null){this.$121k([])} this.$132c(_1,_2,true)},isc.A.fillRangeLoading=function isc_ResultSet_fillRangeLoading(_1,_2){var _3=isc.ResultSet.getLoadingMarker();for(var i=0;i<_2;i++){if(_1[i]==null){_1[i]=_3}} return _1},isc.A.getServerFilter=function isc_ResultSet_getServerFilter(){if(this.isLocal())return null;return isc.shallowClone(this.criteria)},isc.A.$39w=function isc_ResultSet__fetchRemoteData(){var _1=this.fetchStartRow,_2=this.fetchEndRow;if(_1==null||_2==null)return;this.setRangeLoading(_1,_2);this.fetchStartRow=null;this.fetchEndRow=null;this.logInfo("fetching rows "+[_1,_2]+" from server");return this.fetchRemoteData(this.getServerFilter(),_1,_2)},isc.A.$121m=function isc_ResultSet__fetchAllRemoteData(){this.fetchRemoteData(this.getServerFilter())},isc.A.fetchRemoteData=function isc_ResultSet_fetchRemoteData(_1,_2,_3){if(isc.Offline.isOffline()){this.haveOfflineRecords=true} this.$39r+=1;var _4=isc.addProperties({operationId:this.getOperationId("fetch"),startRow:_2,endRow:_3,sortBy:isc.shallowClone(this.$39x),resultSet:this,componentId:this.componentId||"(created directly)",componentContext:this.componentContext},this.context);var _5={requestIndex:this.$39r};if(this.context&&this.context.internalClientContext){_5=isc.addProperties({},this.context.internalClientContext,_5)} _4.internalClientContext=_5;if(this.progressiveLoading===true||this.progressiveLoading===false){_4.progressiveLoading=this.progressiveLoading} _4.internalClientContext.$69t=_4.willHandleError;_4.willHandleError=true;if(this.rowOrderInvalid()){this.logInfo("invalidating rows on fetch due to 'add'/'update' operation with updatePartialCache");this.invalidateRows()} if(this.logIsDebugEnabled("fetchTrace")){this.logWarn("ResultSet server fetch with server criteria: "+this.echoFull(_1)+this.getStackTrace())} if(this.cachingAllData)_4.cachingAllData=true;this.$39v=this.$39r;this.getDataSource().fetchData(_1,{caller:this,methodName:"fetchRemoteDataReply"},_4)},isc.A.fetchRemoteDataReply=function(dsResponse,data,request){var index=dsResponse.internalClientContext.requestIndex;if(!this.$39y)this.$39y=0;if(index!=(this.$39y+1)&&!dsResponse.isCachedResponse){this.logInfo("server returned out-of-sequence response for fetch remote data request - delaying processing: last processed:"+this.$39y+", returned:"+index);if(!this.$39z)this.$39z=[];this.$39z.add({dsResponse:dsResponse,data:data,request:request});return} if(this.cachingAllData==true)delete this.cachingAllData;if(this.$39v==index)delete this.$39v;var newData;var hasError=dsResponse.status<0,requestWasInvalidated=index<=this.$122t;if(requestWasInvalidated&&!this.$1283&&this.logIsInfoEnabled()){this.logInfo(request,"The ResultSet's cache was invalidated while the following request was outstanding: "+isc.echoAll(request)+", request data:"+isc.echoAll(request.data))} if(hasError||requestWasInvalidated||dsResponse.offlineResponse){newData=[]}else{newData=dsResponse.data} var numResults=newData.length;this.document=dsResponse.document;this.logInfo("Received "+numResults+" records from server");if(dsResponse.startRow==null)dsResponse.startRow=request.startRow;if(dsResponse.endRow==null)dsResponse.endRow=dsResponse.startRow+numResults;if(dsResponse.totalRows==null&&dsResponse.endRow0){for(var i=0;i0){var k=2*Math.ceil(this.$1318(_9)/2);i=Math.min(i,_8[k])} if(i>_9){this.logInfo("Fetch request returned range "+[_2.startRow,(_2.startRow+_1.length)]+(_7?" differs from requested range "+[_5,_6]+". ":" but we have subsequent 'loading' markers. ")+"Assuming client/server batch size mismatch and clearing loading markers greater than "+(_2.startRow+_1.length));this.$132c(_9,i,false)} this.logInfo("cached "+_1.getLength()+" rows, from "+_2.startRow+" to "+_2.endRow+" ("+this.totalRows+" total rows, "+this.cachedRows+" cached)");if(this.allMatchingRowsCached()){if(this.allRowsCached()){this.logInfo("Cache for entire DataSource complete")}else{this.logInfo("Cache for current criteria complete")} if(this.canSortOnClient())this.$391()} this.$ee()},isc.A.setContext=function isc_ResultSet_setContext(_1){this.context=_1},isc.A.findByKey=function isc_ResultSet_findByKey(_1){var _2=isc.DataSource.getDataSource(this.dataSource);if(!_2)return;if(!_2.getPrimaryKeyField()||!this.lengthIsKnown())return;var _3;if(isc.isAn.Object(_1)){_3=_1}else{_3={};_3[_2.getPrimaryKeyFieldName()]=_1} var _4=_2.findByKeys(_3,this.localData);if(_4!=null&&_4!=-1)return this.localData[_4];else return null},isc.A.setCriteria=function isc_ResultSet_setCriteria(_1){if(_1==null)_1={};var _2=this.$780(_1);if(_2==null){if(this.localData==null&&this.allRows!=null)this.filterLocalData();this.logInfo("setCriteria: filter criteria unchanged");return false} if(!this.getDataSource().isAdvancedCriteria(_1)){_1=isc.clone(_1)} var _3=this.criteria;this.criteria=_1;this.$39t=(isc.getKeys(_1).length==0);this.$51w=(this.context&&this.context.textMatchStyle)?this.context.textMatchStyle:null;if(_2){this.logInfo("setCriteria: filter criteria changed, invalidating cache");this.invalidateCache()}else{this.logInfo("setCriteria: filter criteria changed, performing local filtering");if(this.allRows==null){this.$78z(this.localData,_3)} this.filterLocalData()} return true},isc.A.$78z=function isc_ResultSet__setAllRows(_1,_2){this.allRows=_1;this.allRowsCriteria=_2||{};this.$505=(isc.getKeys(this.allRowsCriteria).length==0)},isc.A.setFilter=function isc_ResultSet_setFilter(_1){return this.setCriteria(_1)},isc.A.getCriteria=function isc_ResultSet_getCriteria(){return this.criteria},isc.A.compareCriteria=function isc_ResultSet_compareCriteria(_1,_2,_3,_4){return this.getDataSource().compareCriteria(_1,_2,_3?_3:this.context,_4?_4:this.criteriaPolicy)},isc.A.compareSort=function isc_ResultSet_compareSort(_1,_2){if(!_1&&!_2){return true} if(!isc.isAn.Array(_1)||!isc.isAn.Array(_2)){return false} if(_1.length!==_2.length){return false} if(_1.length===0&&_2.length===0){return true} for(var i=0;i<_1.length;i++){if(_1[i].property!==_2[i].property||_1[i].direction!==_2[i].direction){return false}} return true},isc.A.compareTextMatchStyle=function isc_ResultSet_compareTextMatchStyle(_1,_2){return this.getDataSource().compareTextMatchStyle(_1,_2)},isc.A.willFetchData=function isc_ResultSet_willFetchData(_1,_2){return(this.$780(_1,_2)==true)},isc.A.$780=function isc_ResultSet__willFetchData(_1,_2){if(this.localData==null&&this.allRows==null)return true;if(_1==null)_1={};var _3=this.criteria||{},_4=this.$51w,_5=this.getDataSource();if(_2==null){_2=(this.context&&this.context.textMatchStyle)?this.context.textMatchStyle:null} var _6=this.allRows&&this.shouldUseClientFiltering()&&(_3!=this.allRowsCriteria);var _7=isc.isAn.emptyObject(_3)&&!_6?0:this.compareTextMatchStyle(_2,_4);if(_7>=0){var _8=_6?this.allRowsCriteria:_3;if(_8==null)_8={};if(_5.isAdvancedCriteria(_1)&&!_5.isAdvancedCriteria(_8)){_8=isc.DataSource.convertCriteria(_8,_2)} if(!_5.isAdvancedCriteria(_1)&&_5.isAdvancedCriteria(_8)){_1=isc.DataSource.convertCriteria(_1,_2)} var _9=isc.addProperties({},this.context);if(_2!=null)_9.textMatchStyle=_2;var _10=this.compareCriteria(_1,_8,_9);if(_10!=0)_7=_10} if(_7==0){if(_6){if(_5.isAdvancedCriteria(_1)&&!_5.isAdvancedCriteria(_3)){_3=isc.DataSource.convertCriteria(_3,_2)} if(this.compareCriteria(_1,_3)!=0){return false}} return null}else{if(!this.allMatchingRowsCached()){return true} if(this.isLocal()){return false} if(_7==-1){return true}else if(_7==1){if(this.shouldUseClientFiltering()){return false} return true}}},isc.A.sortByProperty=function isc_ResultSet_sortByProperty(_1,_2,_3,_4){if(_3==null){var _5=this.getDataSource().getField(_1);if(_5)_3=_5.type} if(this.$395==_1&&this.$392==_2&&this.$393==_3)return;var _5;if(_4){_5=_4.getField(_1);if(_5&&_5.displayField&&_5.sortByDisplayField!=false){var _6;if(_5.optionDataSource){_6=isc.DataSource.getDataSource(_5.optionDataSource)} if(!_6||_6==isc.DataSource.getDataSource(this.dataSource)){_1=_5.displayField}}} this.$395=_1;this.$392=_2;this.$393=_3;this.$45g=_4;if(this.isPaged()||!this.shouldUseClientSorting()){this.$39x=(this.$392?"":"-")+this.$395} if(this.canSortOnClient()){this.$121s([_1],[_2],[_3],[_4]);if(this.allRows&&(this.localData!==this.allRows)){this.allRows.sortByProperties([_1],[_2],[_3],[_4])} delete this.$572;delete this.$573;delete this.$574;delete this.$575;if(!this.$52z())this.dataChanged();return} this.invalidateCache()},isc.A.unsort=function isc_ResultSet_unsort(){if(!this.allMatchingRowsCached())return false;this.$395=null;if(this.localData)this.localData.unsort();return true},isc.A.$391=function isc_ResultSet__doSort(){var _1=this.$73p;if(this.localData==null||!_1||_1.length==0)return;var _2=[],_3=[],_4=[],_5=[];for(var i=0;i<_1.length;i++){var _7=_1[i];_2[i]=_7.sortByProperty?_7.sortByProperty:_7.property;_3[i]=Array.shouldSortAscending(_7.direction);_4[i]=_7.normalizer;_5[i]=_7.context} if(this.canSortOnClient()){if(_1&&_1.length>0){this.logInfo("$391: sorting on properties ["+_2.join(",")+"] : directions ["+_3.join(",")+"] : full cache allows local sort");this.$121s(_2,_3,_4,_5);if(!this.$52z()){this.dataChanged()}} return} this.logInfo("$391: sorting on properties ["+_2.join(",")+"] : directions ["+_3.join(",")+"] : invalidating cache");this.invalidateCache()},isc.A.getSort=function isc_ResultSet_getSort(){return this.$73p},isc.A.getDefaultNormalizer=function isc_ResultSet_getDefaultNormalizer(_1){var _2=this.getDataSource(),_3=_2?_2.getField(_1):null;if(_3)return _3.type},isc.A.setSort=function isc_ResultSet_setSort(_1,_2){var _3=[],_4=[],_5;if(_1==null)_1=[];for(var i=0;i<_1.length;i++){var _7=_1[i];if(_7.normalizer==null){_7.normalizer=this.getDefaultNormalizer(_7.sortByProperty?_7.sortByProperty:_7.property)} if(_7.context&&!isc.isA.String(_7.context)){var _8,_9=this.getDataSource().getField(_7.property),_5=_7.context.getField(_7.property)||_9;var _10=_5&&_5.displayField;if(_10===_8)_10=_9&&_9.displayField;var _11=_5&&_5.sortByDisplayField;if(_11===_8)_11=_9&&_9.sortByDisplayField;if(_10&&(_11!=false)){var _12=(_5&&_5.optionDataSource)||(_9&&_9.optionDataSource);if(_12){_12=isc.DataSource.getDataSource(_5.optionDataSource)} if(!_12||_12==isc.DataSource.getDataSource(this.dataSource)){this.logInfo("Field:"+_5.name+" has displayField:"+_10+" (with optionDataSource:"+_12+"). Sorting by displayField. Set field.sortByDisplayField to false to disable this.","sorting");_7.owningField=_7.property;if(!_7.sortByField){_7.property=_5.displayField}else{_7.sortByProperty=_5.displayField}}}} if(this.isPaged()||!this.shouldUseClientSorting()){if(_7.property){_3[i]=(Array.shouldSortAscending(_7.direction)?"":"-")+_7.property}} if(!this.$126f){if(this.$73p&&this.$73p.length>0){var _13={property:_7.property,direction:_7.direction};if(_7.normalizer!=null&&_7.normalizer!=this.getDefaultNormalizer(_7.property)){_13.normalizer=_7.normalizer} var _14=this.$73p.findIndex(_13);if(_14==i){_4.add(_7)}}}} if((this.$73p?this.$73p.length:0)==_1.length&&_1.length==_4.length) {return} this.$73p=isc.shallowClone(_1);this.$39x=isc.shallowClone(_3);if(!_2)this.$391()},isc.A.resort=function isc_ResultSet_resort(){this.$126f=true;this.setSort(isc.shallowClone(this.$73p));delete this.$126f},isc.A.$521=function isc_ResultSet__startDataArriving(){var _1;if(this.$523===_1)this.$523=0;this.$523++},isc.A.$522=function isc_ResultSet__doneDataArriving(_1,_2,_3){if(--this.$523==0){if(!_3&&this.dataArrived)this.dataArrived(_1,_2)}},isc.A.$524=function isc_ResultSet__isDataArriving(){return(this.$523!=null&&this.$523>0)},isc.A.dataSourceDataChanged=function isc_ResultSet_dataSourceDataChanged(_1,_2){if(this.disableCacheSync)return;if(this.logIsDebugEnabled())this.logDebug("dataSource data changed firing");var _3=this.getDataSource().getUpdatedData(_1,_2,this.updateCacheFromRequest);if(this.transformData&&this.transformUpdateResponses!==false){var _4=this.transformData(_3,_2);_3=_4==null?_3:_4} this.handleUpdate(_1.operationType,_3,_2.invalidateCache,_1)},isc.A.handleUpdate=function isc_ResultSet_handleUpdate(_1,_2,_3,_4){if(isc.$cv)arguments.$cw=this;var _5=(this.allMatchingRowsCached()?", allMatchingRowsCached true":(", cached rows: "+this.cachedRows+", total rows: "+this.totalRows));if(this.dropCacheOnUpdate||_3||(_1!="remove"&&!this.allMatchingRowsCached()&&!this.shouldUpdatePartialCache())) {this.invalidateCache();return} this.logInfo("updating cache in place after operationType: "+_1+_5);this.$ed();if(!isc.isAn.Array(_2)||_2.length==1){this.$572=_1;this.$573=isc.isAn.Array(_2)?_2[0]:_2} this.updateCache(_1,_2,_4);this.$ee();this.$572=this.$573=null},isc.A.$ee=function isc_ResultSet__doneChangingData(_1,_2){var _3;if(!this.notifyOnUnchangedCache&&this.$573&&this.$575==null){_3=true} var _4,_5,_6;if(!_3&&this.$573){_4=this.$572;_5=this.$574;_6=this.$575} if(--this.$ef==0&&!_3){this.dataChanged(_4,_5,_6,this.$573,_1,_2);delete this.$572;delete this.$574;delete this.$575;delete this.$576;delete this.$573}},isc.A.updateCache=function isc_ResultSet_updateCache(_1,_2,_3){if(_2==null)return;_1=isc.DS.$372(_1);if(!isc.isAn.Array(_2))_2=[_2];if(this.logIsInfoEnabled()){var _4=(_3.componentId?" submitted by '"+_3.componentId+"'":" (no componentID) ");this.logInfo("Updating cache: operationType '"+_1+"'"+_4+","+_2.length+" rows update data"+(this.logIsDebugEnabled()?":\n"+this.echoAll(_2):""))} switch(_1){case"remove":this.removeCacheData(_2,_3);break;case"add":this.addCacheData(_2,_3);break;case"replace":case"update":this.updateCacheData(_2,_3);break} if(this.shouldUpdatePartialCache()&&_1!="remove"&&!this.allMatchingRowsCached()) {this.invalidateRowOrder()} var _5=((_1=="remove")||(_1=="update"&&this.$576==null));if(this.allRows&&!this.shouldNeverDropUpdatedRows()){this.filterLocalData()} var _6=this.$576||this.$574;if(!_5&&_6!=null){var _7=this.indexOf(_6);if(_7==-1){delete this.$575;delete this.$576;delete this.$574}else{this.$575=_7}}},isc.A.updateCacheData=function isc_ResultSet_updateCacheData(_1,_2){if(!isc.isAn.Array(_1))_1=[_1];var _3=this.allRows!=null,_4=(!_3&&this.isPaged()&&this.totalRows!=null),_5=(_3?this.allRows:this.localData),_6=0,_7=0,_8=0,_9=(_5==this.localData&&this.$121p!=null),_10=(_5==this.localData&&this.$121q!=null),_11=(_5==this.localData&&this.$121t!=null),_12=(_5==this.localData&&this.$121u!=null),_13=(_5==this.localData&&this.$121n!=null),_14=(_5==this.localData&&this.$121o!=null);var _15=(_3?this.allRowsCriteria:this.criteria),_16=this.shouldNeverDropUpdatedRows(),_17=this.getDataSource(),_18=_17.getPrimaryKeyFields();for(var i=0,_20=_1.length;i<_20;++i){var _21=_1[i],_22=isc.applyMask(_21,_18);var _23=_17.findByKeys(_22,_5);var _24=(this.applyFilter([_21],_15,this.context).length>0);if(_23==-1){var _25=_2.data;if(isc.isAn.Array(_25))_25=_25[0];if(_25){_25=isc.applyMask(_25,_18);var _26=this.getDataSource().findByKeys(_25,_5);if(_26!=-1){this.logWarn("Update operation - submitted record with primary key value[s]:"+this.echo(_25)+" returned with modified primary key:"+this.echo(_22)+". This may indicate bad server logic. Updating cache to reflect new primary key.");_7++;var _27=_5.get(_26);if(_11){this.$121t(_27,1,_26)} _5.removeAt(_26);if(_4){--this.totalRows} --this.cachedRows;if(_12){this.$121u(_27,1,_26)} delete this.$573}} if(_24&&_5!=null){this.logInfo("updated row returned by server doesn't match any cached row, adding as new row. Primary key values: "+this.echo(_22)+", complete row: "+this.echo(_21));_8++;var _28=-1;if(_9){if(_5.sortUnique){_28=_5.lastIndexOf(_21)} if(_28==-1){_5.add(_21);_28=_5.lastIndexOf(_21);_5.remove(_21)} this.$121p(_21,1,_28)} _5.add(_21);if(_4){++this.totalRows} ++this.cachedRows;if(_10){if(!_9){_28=_5.lastIndexOf(_21)} this.$121q(_21,1,_28)} if(_20==1){this.$576=_21;this.$575=_5.length-1}}else{}}else{if(_20==1){var _29=_5.get(_23);if(_3){if(this.applyFilter([_29],this.criteria,this.context).length==0){_29=null}} this.$574=_29;if(_29){this.$575=this.indexOf(_29)}} if(_24||_16){_6++;var _30=_5.get(_23);if(_13){this.$121n(_30,1,_23,_21,1)} _5.set(_23,_21);if(_14){this.$121o(_30,1,_23,_21,1)}}else{if(this.logIsDebugEnabled()){this.logDebug("row dropped:\n"+this.echo(_21)+"\ndidn't match filter: "+this.echoFull(_15))} _7++;var _30=_5.get(_23);if(_11){this.$121t(_30,1,_23)} _5.removeAt(_23);if(_4){--this.totalRows} --this.cachedRows;if(_12){this.$121u(_30,1,_23)}}}} if(this.logIsDebugEnabled()){this.logDebug("updated cache: "+_8+" row(s) added, "+_6+" row(s) updated, "+_7+" row(s) removed.")} if(!_3&&(!this.shouldUpdatePartialCache()||this.allMatchingRowsCached())&&this.canSortOnClient()) {this.$391()}});isc.evalBoundary;isc.B.push(isc.A.removeCacheData=function isc_ResultSet_removeCacheData(_1){if(!isc.isAn.Array(_1))_1=[_1];var _2=this.allRows!=null,_3=_2?this.allRows:this.localData,_4=0;var _5=(_3==this.localData&&this.isPaged()&&this.totalRows!=null);if(_3!=null){var _6=this.getDataSource(),_7=(_3==this.localData&&this.$121t!=null),_8=(_3==this.localData&&this.$121u!=null);for(var i=0,_10=_1.length;i<_10;++i){var _11=_6.findByKeys(_1[i],_3);if(_11!=-1){var _12=_3[_11];if(_10==1){if(!_2||_6.recordMatchesFilter(_12,this.criteria,this.context)) {this.$574=_12;this.$575=this.indexOf(this.$574)}} if(_7){this.$121t(_12,1,_11)} _3.removeAt(_11);if(_5){--this.totalRows} --this.cachedRows;if(_8){this.$121u(_12,1,_11)} _4++}else{if(this.allMatchingRowsCached())continue;if(_6.applyFilter([_1[i]],this.criteria,this.context).length>0){if(this.logIsDebugEnabled()){this.logDebug("removed record matches filter criteria: "+this.echo(_1[i]))} if(this.$574==null)delete this.$573;_4++}else{if(this.logIsDebugEnabled()){this.logIsDebugEnabled("cache sync ignoring 'remove' operation, removed row doesn't match filter criteria: "+this.echo(_1[i]))}}}}}},isc.A.addCacheData=function isc_ResultSet_addCacheData(_1){var _2;if(!isc.isAn.Array(_1))_1=[_1];if(_1==null)return;var _3;if(this.allRows==null||!this.shouldUseClientFiltering()){_3=this.applyFilter(_1,this.criteria,this.context)}else{_3=_1;if(this.allRowsCriteria){_3=this.applyFilter(_3,this.allRowsCriteria,this.context)}} var _4=_3.length,_5=false;if(_4!=_1.length){this.logInfo("Adding rows to cache, "+_4+" of "+_1.length+" rows match filter criteria")}else if(_4==1){_5=true} var _6=this.allRows||this.localData;if(!_6)return;var _7=(_6==this.localData&&this.$121p!=null),_8=(_6==this.localData&&this.$121q!=null);var _9=(this.isPaged()&&!this.allRows&&this.totalRows!=null);var _10=(!this.allMatchingRowsCached()&&this.shouldUpdatePartialCache()),_11=_10&&this.getCachedRange();if(_11){var _12;if(_11[1]==this.getLength()-1||!this.rowIsLoaded(0)){_12=_11[1]+1}else{_12=0} if(_7&&_4>0){this.$121p(_3,_3.length,_12)} _6.addListAt(_3,_12);if(_9){this.totalRows+=_4} this.cachedRows+=_4;if(_8&&_4>0){this.$121q(_3,_3.length,_12)} if(_5)this.$575=_12}else{var _12;if(_7||_8){var _13=_6.sortUnique;for(var i=0,_15=_4;i<_15;++i){var _16=_3[i],_17=-1;if(_7){if(_13){_17=_6.lastIndexOf(_16)} if(_17==-1){_6.add(_16,_2,true);_17=_6.lastIndexOf(_16);_6.remove(_16)} this.$121p(_16,1,_17)} _6.add(_16,_2,true);if(_9){++this.totalRows} ++this.cachedRows;if(_8){if(!_7){_17=_6.lastIndexOf(_16)} this.$121q(_16,1,_17)} if(_5){if(_17==-1){_17=_6.lastIndexOf(_16)} _12=_17}}}else{_6.addList(_3);if(_9){this.totalRows+=_4} this.cachedRows+=_4;if(_5)_12=_6.lastIndexOf(_3[0])} if(_5){this.$575=_12}} if(this.$575!=null){this.$576=_6[this.$575]} if(this.canSortOnClient())this.$391()},isc.A.insertCacheData=function isc_ResultSet_insertCacheData(_1,_2,_3){if(!isc.isAn.Array(_1))_1=[_1];if(this.allRows&&this.allRows!=this.localData&&!_3){this.allRows.addListAt(_1,_2)} var _4=(this.isPaged()&&this.totalRows!=null);var _5=this.localData;if(this.$121p!=null){this.$121p(_1,_1.length,_2)} _5.addListAt(_1,_2);if(_4){this.totalRows+=_1.length} for(var i=_1.length;i--;){if(_1[i]!=null&&!Array.isLoading(_1[i])){++this.cachedRows}} if(this.$121q!=null){this.$121q(_1,_1.length,_2)}},isc.A.addSpecialValueRecords=function isc_ResultSet_addSpecialValueRecords(_1,_2,_3){var _4=this.localData,_5=this.isLocal()?_7:_4,_6=false;if(_5){var _7=this.allRows,_8=0;for(var i=0;i<_3.length;i++){var _10=_3[i][_1],_11=_5.findIndex(_1,_10),_12=true;if(_11>=0){do{var _13=_5.get(_11);if(_13["$128o"]){if(_11==_8){if(_2){_13[_2]=_3[i][_2]} _8++;_12=false}else{_5.removeAt(_11)}} _11=_5.findNextIndex(_11+1,_1,_10)}while(_11>=0)} if(_12){var _14=!_7||_7==_4||_7.find(_1,_10);_3[i]["$128o"]=true;this.insertCacheData(_3[i],_8++,_14);_6=true}}} return _6},isc.A.$121k=function isc_ResultSet__setLocalData(_1){var _2=this.localData,_3=(_2==null||_2.isEmpty()),_4=(_3?0:_2.length),_5=(this.lengthIsKnown()?this.getLength():_4),_6=(_1==null||_1.isEmpty()),_7=(_6?0:_1.length),_8=this.lengthIsKnown();this.localData=_1;var _9=(this.lengthIsKnown()?this.getLength():_7);this.localData=_2;var _10=_5-_4,_11=_9-_7;var _12=!(_4+_7==0&&_10==_11),_13=_12&&_5==0,_14=_12&&!_13&&_7==0&&_10>=_11,_15=_12&&!_13&&!_14;var _16,_17,_18,_19;if(_13&&(this.$121p!=null||this.$121q!=null)){if(_7==0){_18=null}else if(_11==0){_18=_1}else{_18=_1.duplicate();_18.length=_9;for(var i=_7;i<_9;++i){_18[i]=null}} if(this.$121p!=null){this.$121p(_18,_9-_5,0)}}else if(_14&&(this.$121t!=null||this.$121u!=null)){_17=_4+_10-_11;if(_4==0){_16=null}else{_16=_2;for(var i=_4;i<_17;++i){_16[i]=null}} if(this.$121t!=null){this.$121t(_16,_17,0)}}else if(_15&&(this.$121n!=null||this.$121o!=null)){_17=_4+Math.max(0,_10-_11);if(_4==0){_16=null}else if(_10==0){_16=_2}else{_16=_2.duplicate();_16.length=_17;for(var i=_4;i<_17;++i){_16[i]=null}} _19=_7+Math.max(0,_11-_10);if(_7==0){_18=null}else if(_11==0){_18=_1}else{_18=_1.duplicate();_18.length=_19;for(var i=_7;i<_19;++i){_18[i]=null}} if(this.$121n!=null){this.$121n(_16,_17,0,_18,_19)}} this.localData=_1;if(_13&&this.$121q!=null){this.$121q(_18,_9-_5,0)}else if(_14&&this.$121u!=null){this.$121u(_16,_17,0)}else if(_15&&this.$121o!=null){this.$121o(_16,_17,0,_18,_19)} this.$121r(_8)},isc.A.$121r=function isc_ResultSet__checkLengthIsKnown(_1){if(this.$121v!=null){var _2=this.lengthIsKnown();if(_1!=_2){this.$121v(_1,_2)}}},isc.A.$121s=function isc_ResultSet__sortLocalDataByProperties(_1,_2,_3,_4){var _5;if(isc.Browser.isFirefox&&isc.isA.ResultTree(this.$121z)&&this.$121z.isPaged()){var _6=this.$121z.$27i,_7=this.$121z.$135d,_8=this.$121z.$135e;for(var i=_3.length;i--;){if(_3[i]===_6){if(_5==null){_5=new Array(_3.length)} _5[i]=(_2[i]?_7:_8)}}} var _10=(this.$121w!=null),_11=this.localData.sortByProperties(_1,_2,_3,_4,_5,_10,false);if(this.shouldReorderAllRows&&this.allRows!=null)this.reorderAllRows();if(_10){if(_11!=null){var _12=this.localData;for(var i=0,_13=_12.length;i<_13;){var k=_11[i];if(i1?_12.getRange(i,j):_12[i]);this.$121w(_18,n,k,i);var _19=i-k,_20=n;for(var m=i+n;m<_13;++m){var p=_11[m];if(i<=p&&p=0;i--){if(this.localData[i]==null)return i+1} return 0},isc.A.findLastCachedRow=function isc_ResultSet_findLastCachedRow(_1){for(var i=_1;i_6-1&&_1!=0){this.logWarn("getRange("+_1+", "+_2+"): start beyond end of rows, returning empty list");return[]}else if(_2>_6){_2=_6}} if(this.localData==null){this.$121k([])} if(_3){this.realCache=this.localData;this.$121k([])} var _7=this.localData;this.lastRangeStart=_1;this.lastRangeEnd=_2;var _8=this.$132a(_1,_2,false),_9=false,_10,_11;if(_8==-1){_9=false}else{var _12=_8,_13=1+this.$132b(_1,_2,false);for(var i=_12;i<_13;++i){if(_7[i]==null){_10=i;break}} _9=(_10!=null);if(_9){for(var i=_13-1;i>=_10;--i){if(_7[i]==null){_11=i;break}}}} if(!_9){this.logDebug("getRange("+_1+", "+_2+") satisfied from cache");return this.fillRangeLoading(_7.slice(_1,_2),_2-_1)} var _15,_16;if(this.fetchAhead){var _17=this.$398(_1,_2,_10,_11,_3);_15=_17[0];_16=_17[1]}else{_15=_10;_16=_11+1} if(this.alwaysRequestVisibleRows){_15=_1;_16=_2} this.fetchStartRow=_15;this.fetchEndRow=_16;var _18;if(_4||this.fetchDelay==0){this.$39w();_18=this.fillRangeLoading(_7.slice(_1,_2),_2-_1)}else{this.fireOnPause("fetchRemoteData","$39w",this.fetchDelay);_18=this.fillRangeLoading(_7.slice(_1,_2),_2-_1)} if(_3){this.$121k(this.realCache);this.realCache=null} return _18},isc.A.$398=function isc_ResultSet__addFetchAhead(_1,_2,_3,_4,_5){var _6=_5?[]:this.localData,_7=_5?Number.MAX_VALUE:this.getLength(),_8=_4-_3,_9=Math.floor((this.resultSize-_8)/2),_10=Math.max(0,_3-_9),_11=Math.min(_7,_4+_9);var _12=this.$1317,_13=_12.length,k=this.$1318(_10),_15=(k%2==0),j=(k+1<_13?_12[++k]:-1);for(var i=_10;i<=_3;i++){if(i==j){_15=!_15;j=(k+1<_13?_12[++k]:-1)} if(_6[i]==null||_15){break}} _3=i;k=this.$1318(_11);_15=(k%2==0);j=(k>0?_12[--k]:-1);for(var i=_11;i>=_4;i--){if(i==j){_15=!_15;j=(k>0?_12[--k]:-1)} if(_6[i]==null||_15){break}} _4=i;this.logDebug("getRange("+[_1,_2]+"), cache check: "+[_10,_11]+" firstMissingRow: "+_3+" lastMissingRow: "+_4);var _18,_19;if(_3==0||(_3>_10&&_4==_11)) {this.logDebug("getRange: guessing forward scrolling");_18=_3;_19=_18+this.resultSize;if(_19<_2)_19=_2}else if(_3==_10&&_4<_11){this.logDebug("getRange: guessing backward scrolling");_19=_4+1;_18=_19-this.resultSize;if(_18<0)_18=0;if(_18>_1)_18=_1}else{this.logDebug("getRange: no scrolling direction detected");_18=_10;_19=_11;if(_18>_1)_18=_1;if(_19<_2)_19=_2} k=this.$1318(_18);_15=(k%2==0);j=(k+1<_13?_12[++k]:-1);for(var i=_18;i<_10;i++){if(i==j){_15=!_15;j=(k+1<_13?_12[++k]:-1)} if(_6[i]==null||_15)break} _18=i;k=this.$1318(_19-1);_15=(k%2==0);j=(k>0?_12[--k]:-1);for(var i=_19-1;i>_11;i--){if(i==j){_15=!_15;j=(k>0?_12[--k]:-1)} if(_6[i]==null||_15)break} _19=i+1;this.logInfo("getRange("+_1+", "+_2+") will fetch from "+_18+" to "+_19);return[_18,_19]},isc.A.filterLocalData=function isc_ResultSet_filterLocalData(){var _1=!this.$52z() if(_1)this.$ed();this.$121k(this.applyFilter(this.allRows,this.criteria,isc.addProperties({dataSource:this},this.context)));if(this.localData!=null&&this.allRows!=null){this.logInfo("Local filter applied: "+this.localData.length+" of "+this.allRows.length+" records matched filter:"+this.echoFull(this.criteria),"localFilter")} if(this.allRows!=null&&this.shouldUseClientSorting())this.$391();if(!this.$524()&&this.dataArrived){var _2=this.localData,_3=_2.findIndex("$128o",true);if(_3>=0){var _4=[];do{_4.add(_3);_3=_2.findNextIndex(_3+1,"$128o",true)}while(_3>=0);for(var i=_4.length-1;i>=0;i--){_2.removeAt(_4[i])}} this.dataArrived(0,this.localData.length,true)} if(_1)this.$ee(true,true)},isc.A.applyFilter=function isc_ResultSet_applyFilter(_1,_2,_3){return this.getDataSource().applyFilter(_1,_2,_3)},isc.A.getValuesList=function isc_ResultSet_getValuesList(_1){this.logInfo("asked for valuesList for property '"+_1+"'");if(this.isLocal()){if(!this.allRows){this.logWarn("asked for valuesList before data has been loaded");return[]} var _2=this.allRows.getProperty(_1);if(!_2)return[];return _2.getUniqueItems()} var _3=this.getCachedRange(),_4=[];for(var i=_3[0];i<=_3[1];i++){var _6=this.get(i);if(!_4.contains(_6[_1]))_4[_4.length]=_6[_1]} return _4},isc.A.fillCacheData=function isc_ResultSet_fillCacheData(_1,_2){var _3=(this.$121v!=null),_4=_3&&this.lengthIsKnown();if(_2==null)_2=0;this.logDebug("integrating "+_1.length+" rows into cache at position "+_2);var _5=(this.localData==null);if(_5){this.$121k([])} var _6=this.localData.length,_7=this.$121l(),_8=_1.length;this.$132c(_2,_2+_8,false);if(_8==0){_2=0} var _9=Math.max(_7,_2+_8),_10=Math.max(0,_2-Math.min(_6,_7)),_11=Math.max(0,_9-Math.max(_6,_2+_8)),_12=_10+_11,_13=(_8>0&&_6<=_7&&_6<=_2),_14=(_8>0&&!_13);if(_12>0){var _15=Math.min(_6,_7)+_12,_16=(_14&&(this.$121n!=null||this.$121o!=null)&&this.localData.slice(_7,_6));if(_13&&this.$121p!=null){this.$121p(null,_12,_6)}else if(_14&&this.$121n!=null){this.$121n(_16,_6-_7,_7,null,_12)} if(_5||_6<_15){this.localData.length=_15}else if(_6!=_15){this.localData=this.localData.slice(0,_7);this.localData.length=_15} if(_13&&this.$121q!=null){this.$121q(null,_12,_6)}else if(_14&&this.$121n!=null){this.$121o(_16,_6-_7,_7,null,_12)} _5=false;_13=_13||_14;_14=false;_6=_15;_7+=_12} var _17=Math.min(_2,_7),_18=Math.min(_8,Math.max(0,_6-_17)),_16=(_14&&(this.$121n!=null||this.$121o!=null)&&this.localData.slice(_17,_17+_18));if(_13&&this.$121p!=null){this.$121p(_1,_8,_2)}else if(_14&&this.$121n!=null){this.$121n(_16,_18,_17,_1,_8)} if(_5||_6<_7){this.localData.length=_9}else if(_6!=_7){this.localData=this.localData.slice(0,_7);this.localData.length=_9} for(var i=0;i<_8;i++){var _20=_2+i,_21=this.localData[_20],_22=_1[i];if(_22!=null){++this.cachedRows} if(_21!=null&&!Array.isLoading(_21)){--this.cachedRows} this.localData[_20]=_22} if(_13&&this.$121q!=null){this.$121q(_1,_8,_2)}else if(_14&&this.$121o!=null){this.$121o(_16,_18,_17,_1,_8)} if(_3){var _23=this.lengthIsKnown();if(_4!=_23){this.$121v(_4,_23)}} if(this.allRowsCached()){this.$78z(this.localData,this.criteria)}},isc.A.setFullLength=function isc_ResultSet_setFullLength(_1){if(!isc.isA.Number(_1))return;this.logDebug("full length set to: "+_1);var _2=this.$1317;if(_2.length>0){this.$132c(_1,_2.last(),false)} var _3=this.isPaged(),_4=(this.localData&&this.localData.length)||0,_5=this.lengthIsKnown(),_6=(_5?Math.max(_4,this.getLength()):_4);if(_1<_6){var _7=(this.$121t!=null||this.$121u!=null),_8;if(_7&&_1<_4){_8=this.localData.slice(_1,_4);for(var i=_4;i<_6;++i){_8[i]=null}}else{_8=null} if(this.$121t!=null){this.$121t(_8,_6-_1,_1)} if(_3){this.totalRows=_1} if(this.localData){this.localData=this.localData.slice(0,_1)} if(this.$121u!=null){this.$121u(_8,_6-_1,_1)}}else{var _7=_1>_6;if(_7&&this.$121p!=null){this.$121p(null,_1-_6,_6)} if(_3){this.totalRows=_1} if(this.localData){this.localData.length=_1} if(_7&&this.$121q!=null){this.$121q(null,_1-_6,_6)}} if(this.cachedRows>_1){this.cachedRows=_1} if(this.$121v!=null){var _10=this.lengthIsKnown();if(_5!=_10){this.$121v(_5,_10)}}},isc.A.invalidateCache=function isc_ResultSet_invalidateCache(){this.$122t=this.$39v;if(this.neverDropCache){isc.logWarn("invalidateCache() called on ResultSet populated with local data (not from dataSource). Ignoring.");return} delete this.$572;delete this.$576;delete this.$573;delete this.$574;delete this.$575;this.$394();if(!this.$52z())this.dataChanged(null,null,null,null,true)},isc.A.$394=function isc_ResultSet__invalidateCache(){this.invalidateRows();this.totalRows=null;this.logInfo("Invalidating cache")},isc.A.invalidateRows=function isc_ResultSet_invalidateRows(){var _1=this.localData,_2=(_1&&_1.length)||0,_3=this.lengthIsKnown(),_4=Math.max(_2,(_3?this.getLength():_2));this.localData=null;var _5=(this.lengthIsKnown()?this.getLength():0);this.localData=_1;var _6=(_4>0&&_5==0),_7=(_2>0&&_5>0),_8;if(_6&&(this.$121t!=null||this.$121u!=null)){if(_2>0){_8=_1;for(var i=_2;i<_4;++i){_1[i]=null}}else{_8=null} if(this.$121t!=null){this.$121t(_8,_4,0)}}else if(_7&&this.$121n!=null){this.$121n(_1,_2,0,null,_2)} this.localData=this.allRows=null;if(_6&&this.$121u!=null){this.$121u(_8,_4,0)}else if(_7&&this.$121o!=null){this.$121o(_1,_2,0,null,_2)} if(this.$121v!=null&&_3){this.$121v(true,false)} this.allRowsCriteria=null;delete this.$505;this.cachedRows=0;this.$50k=null;this.$1317=[]},isc.A.invalidateRowOrder=function isc_ResultSet_invalidateRowOrder(){this.$50k=true},isc.A.rowOrderInvalid=function isc_ResultSet_rowOrderInvalid(){return this.$50k},isc.A.dataChanged=function isc_ResultSet_dataChanged(){if(this.onDataChanged)this.onDataChanged()},isc.A.dataArrived=function isc_ResultSet_dataArrived(){},isc.A.getNewSelection=function isc_ResultSet_getNewSelection(_1){var _2=this.getDataSource().selectionClass;if(!_2)return null;return isc.ClassFactory.getClass(_2,true).create(_1)});isc.B._maxIndex=isc.C+98;isc.ResultSet.registerStringMethods({transformData:"newData,dsResponse",dataArrived:"startRow,endRow,dataFromCache",dataChanged:"operationType,originalRecord,rowNum,updateData,filterChanged,dataFromCache",$121p:"records,length,rowNum",$121q:"records,length,rowNum",$121t:"records,length,rowNum",$121u:"records,length,rowNum",$121n:"originalRecords,originalLength,rowNum,updatedRecords,updatedLength",$121o:"originalRecords,originalLength,rowNum,updatedRecords,updatedLength",$121w:"records,length,originalRowNum,updatedRowNum",$121v:"originalValue,updatedValue"});isc.ResultSet.getPrototype().toString=isc.$63a;isc.ResultSet.getPrototype().logMessage=isc.$63b;isc.ClassFactory.defineClass("LocalResultSet",isc.ResultSet);isc.A=isc.LocalResultSet.getPrototype();isc.A.fetchMode="local";isc.ClassFactory.defineClass("WindowedResultSet",isc.ResultSet);isc.ResultSet.addMethods(isc.ClassFactory.makePassthroughMethods(["find","findIndex","findNextIndex","findAllIndices","findAll","getProperty"],"localData",true,"ResultSet.${methodName} called with no cached local data. Calling code can use ResultSet.lengthIsKnown() to determine whether the ResultSet has loaded any data.","dataSource")) isc.ClassFactory.defineClass("ResultTree",isc.Tree);isc.A=isc.ResultTree;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.getLoadingMarker=function isc_c_ResultTree_getLoadingMarker(){return(isc.ResultSet!=null?isc.ResultSet.getLoadingMarker():Array.LOADING)});isc.B._maxIndex=isc.C+1;isc.A=isc.ResultTree.getPrototype();isc.A.nameProperty="$399";isc.A.nodeTypeProperty="nodeType";isc.A.childTypeProperty="childType";isc.A.modelType="parent";isc.A.loadDataOnDemand=true;isc.A.autoPreserveOpenState="whenUnique";isc.A.fetchMode="basic";isc.A.resultSize=75;isc.A.$121y={fetchMode:"paged",$121p:function(_1,_2,_3){var _4=this.$121z,_5=this.$97q;_4.$1210(this,_5,_1,_2,_3,true)},$121q:function(_1,_2,_3){var _4=this.$121z,_5=this.$97q;_4.$1210(this,_5,_1,_2,_3,false)},$121t:function(_1,_2,_3){var _4=this.$121z,_5=this.$97q;_4.$1211(this,_5,_1,_2,_3,true)},$121u:function(_1,_2,_3){var _4=this.$121z,_5=this.$97q;_4.$1211(this,_5,_1,_2,_3,false)},$121n:function(_1,_2,_3,_4,_5){var _6=this.$121z,_7=this.$97q;_6.$1212(this,_7,_1,_2,_3,_4,_5,true)},$121o:function(_1,_2,_3,_4,_5){var _6=this.$121z,_7=this.$97q;_6.$1212(this,_7,_1,_2,_3,_4,_5,false)},$121w:function(_1,_2,_3,_4){var _5=this.$121z,_6=this.$97q;_5.$1213(this,_6,_1,_2,_3,_4)},$121v:function(_1,_2){var _3=this.$121z,_4=this.$97q;_3.$1214(this,_4,_1,_2)}};isc.A.childCountProperty="childCount";isc.A.canReturnOpenSubfoldersProperty="canReturnOpenSubfolders";isc.A.canReturnOpenFolders=false;isc.A.defaultNewNodesToRoot=false;isc.A.updateCacheFromRequest=true;isc.A=isc.ResultTree.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.currentFetch=0;isc.A.$131y={};isc.B.push(isc.A.add=function isc_ResultTree_add(_1,_2,_3){if(this.isPaged()){isc.logWarn("ResultTrees with fetchMode \"paged\" are read-only. This operation (add) will be ignored.")}else{return this.invokeSuper(isc.ResultTree,"add",_1,_2,_3)}},isc.A.addList=function isc_ResultTree_addList(_1,_2,_3){if(this.isPaged()){isc.logWarn("ResultTrees with fetchMode \"paged\" are read-only. This operation (addList) will be ignored.")}else{return this.invokeSuper(isc.ResultTree,"addList",_1,_2,_3)}},isc.A.linkNodes=function isc_ResultTree_linkNodes(_1,_2,_3,_4,_5,_6,_7){if(this.isPaged()){isc.logWarn("ResultTrees with fetchMode \"paged\" are read-only. This operation (linkNodes) will be ignored.")}else{return this.invokeSuper(isc.ResultTree,"linkNodes",_1,_2,_3,_4,_5,_6,_7)}},isc.A.move=function isc_ResultTree_move(_1,_2,_3){if(this.isPaged()){isc.logWarn("ResultTrees with fetchMode \"paged\" are read-only. This operation (move) will be ignored.")}else{return this.invokeSuper(isc.ResultTree,"move",_1,_2,_3)}},isc.A.remove=function isc_ResultTree_remove(_1,_2){if(this.isPaged()){isc.logWarn("ResultTrees with fetchMode \"paged\" are read-only. This operation (remove) will be ignored.")}else{return this.invokeSuper(isc.ResultTree,"remove",_1,_2)}},isc.A.removeList=function isc_ResultTree_removeList(_1){if(this.isPaged()){isc.logWarn("ResultTrees with fetchMode \"paged\" are read-only. This operation (removeList) will be ignored.")}else{return this.invokeSuper(isc.ResultTree,"removeList",_1)}},isc.A.init=function isc_ResultTree_init(_1,_2,_3,_4,_5,_6){isc.ClassFactory.addGlobalID(this);if(!this.criteria)this.criteria={};if(!this.operation)this.operation={operationType:"fetch"};if(!this.dataSource)this.dataSource=this.operation.dataSource;if(!this.operation.dataSource)this.operation.dataSource=this.dataSource;if(isc.isAn.Array(this.dataSource)){this.dataSource=this.dataSource[0];this.operation.dataSource=this.dataSource} if(!this.isMultiDSTree()){if(!this.root)this.root=this.makeRoot();var _7=this.getTreeRelationship(this.root);var _8;if(this.rootValue===_8)this.rootValue=_7.rootValue;if(!this.loadDataOnDemand&&(this.rootValue!=null||(this.root!=null&&this.root[this.idField]!=null))&&this.discardParentlessNodes==null) {this.discardParentlessNodes=true} if(this.idField==null)this.idField=_7.idField;if(this.parentIdField==null)this.parentIdField=_7.parentIdField;if(_7.childrenProperty)this.childrenProperty=_7.childrenProperty;this.root[this.idField]=this.rootValue} this.setupProperties();if(this.isPaged()){var _9=this.context;this.resultSize=(_9&&_9.dataPageSize!=null?_9.dataPageSize:this.resultSize);this.$121y=isc.addProperties({},this.$121y,{resultSize:this.resultSize})} if(this.keepParentsOnFilter&&!(this.isPaged()||this.isLocal())){this.fetchMode="local"} if(this.initialData){if("parent"==this.modelType)this.data=this.initialData;else if("children"==this.modelType)this.root=this.initialData} var _10=isc.DataSource.getDataSource(this.dataSource);this.observe(_10,"dataChanged","observer.dataSourceDataChanged(dsRequest,dsResponse);");this.dropCacheOnUpdate=this.operation.dropCacheOnUpdate;if(this.defaultIsFolder==null)this.defaultIsFolder=this.loadDataOnDemand;this.invokeSuper(isc.ResultTree,"init",_1,_2,_3,_4,_5,_6);this.setDefaultLoadState(this.loadDataOnDemand?isc.Tree.UNLOADED:isc.Tree.LOADED)},isc.A.setupProperties=function isc_ResultTree_setupProperties(){this.invokeSuper(isc.ResultTree,"setupProperties");if(this.isPaged()){this.$1215=("_visibleDescendantsCached_"+this.ID);this.$166s=("_initialLoadingState_"+this.ID);this.$166t=("_initialLoadingFetchCount_"+this.ID)}},isc.A.duplicate=function isc_ResultTree_duplicate(_1,_2){if(!this.isPaged()){return this.invokeSuper(isc.ResultTree,"duplicate",_1,_2)} var _3=this.serverFilterFields;if(isc.isAn.Array(_3)){_3=_3.duplicate()} var _4={fetchMode:this.fetchMode,dataSource:this.dataSource,loadDataOnDemand:this.loadDataOnDemand,childCountProperty:this.childCountProperty,defaultIsFolder:this.defaultIsFolder,discardParentlessNodes:this.discardParentlessNodes,defaultNewNodesToRoot:this.defaultNewNodesToRoot,updateCacheFromRequest:this.updateCacheFromRequest,disableCacheSync:this.disableCacheSync,keepParentsOnFilter:this.keepParentsOnFilter,serverFilterFields:_3,canReturnOpenFolders:this.canReturnOpenFolders};this.$1201(_4);_4.autoOpenRoot=false;var _5=isc.ResultTree.create(_4),_6=this.getRoot(),_7=this.isOpen(_6),_8=this.isFolder(_6),_9=_6[this.$111w],_10=_6[this.$1200],_11=_6[this.$1215],_12=this.getCleanNodeData(_6,false,false,_2);_12[_5.openProperty]=_7;_12[_5.isFolderProperty]=_8;_12[_5.$111w]=_9;_12[_5.$1200]=_10;_12[_5.$1215]=_11;this.$1216(_6,_5,_12,_2);_5.setRoot(_12);return _5},isc.A.$61g=function isc_ResultTree__getCleanNodeData(_1,_2,_3){var _4=this.$111w,_5=this.$1200,_6=this.$1215,_7=_1.openProperty,_8=_1.isFolderProperty,_9=_1.$111w,_10=_1.$1200,_11=_1.$1215;if(_2==null){return null}else if(isc.isAn.Array(_2)){var _12=new Array(_2.length);for(var i=_2.length;i--;){var _14=_2[i],_15=null;if(_14!=null){var _16=this.isOpen(_14),_17=this.isFolder(_14),_18=_14[_4],_19=_14[_5],_20=_14[_6];_15=this.getCleanNodeData(_14,false,false,_3);_15[_7]=_16;_15[_8]=_17;_15[_9]=_18;_15[_10]=_19;_15[_11]=_20} _12[i]=_15} return _12}else{var _16=this.isOpen(_2),_17=this.isFolder(_2),_18=_2[_4],_19=_2[_5],_20=_2[_6],_15=this.getCleanNodeData(_2,false,false,_3);_15[_7]=_16;_15[_8]=_17;_15[_9]=_18;_15[_10]=_19;_15[_11]=_20;return _15}},isc.A.$1216=function isc_ResultTree__duplicate(_1,_2,_3,_4){if(this.isLeaf(_1)){return} var _5=this.getChildren(_1),_6=0;if(isc.isA.ResultSet(_5)){_6=_5.getLength();_3[_2.childCountProperty]=_6;var _7=_3[_2.childrenProperty]=new Array(_6);for(var i=_6;i--;){_7[i]=_5.getCachedRow(i)}}else if(isc.isAn.Array(_5)){_6=_5.length;_3[_2.childrenProperty]=_5}else if(_5){_6=1;_3[_2.childrenProperty]=[_5]} var _9=(this.modelType==isc.Tree.PARENT),_10=this.parentIdField,_7=_3[_2.childrenProperty]=this.$61g(_2,_3[_2.childrenProperty],_4);for(var i=0;i<_6;++i){var _11=_5.getCachedRow(i);if(_11==null){continue} if(_9){_7[i][_10]=_11[_10]} var _12=_11[this.childrenProperty];if(_12&&!_12.isEmpty()){this.$1216(_11,_2,_7[i],_4)}}},isc.A.destroy=function isc_ResultTree_destroy(){if(this.isPaged()){this.$1217(this.getRoot(),false)} var _1=isc.DataSource.getDataSource(this.dataSource);if(_1)this.ignore(_1,"dataChanged");this.Super("destroy",arguments)},isc.A.isLocal=function isc_ResultTree_isLocal(){return this.fetchMode=="local"},isc.A.isPaged=function isc_ResultTree_isPaged(){return this.fetchMode=="paged"},isc.A.haveCriteria=function isc_ResultTree_haveCriteria(_1){return!(_1==null||isc.isAn.emptyObject(_1)||(_1._constructor==="AdvancedCriteria"&&_1.operator==="and"&&isc.isAn.Array(_1.criteria)&&_1.criteria.length==0))},isc.A.setContext=function isc_ResultTree_setContext(_1){this.context=_1;if(this.isPaged()&&this.$122c!=null){for(var i=this.$122c.length;i--;){var _3=_1&&isc.addProperties({},_1);if(_1){delete _3.clientContext;delete _3.internalClientContext} this.$122c[i].setContext(_3)}}},isc.A.getTreeRelationship=function isc_ResultTree_getTreeRelationship(_1){var _2=this.getChildDataSource(_1);var _3=_2.getTreeRelationship();return _3},isc.A.getChildDataSource=function isc_ResultTree_getChildDataSource(_1,_2){var _3=_1[this.childTypeProperty];if(_3!=null)return isc.DS.get(_3);var _2=_2||this.getNodeDataSource(_1);if(_2==null||!this.isMultiDSTree())return this.getRootDataSource();var _4=this.treeRelations,_5=_2.getChildDataSources();if(_4){_3=_4[_2.ID];if(_3!=null)return isc.DS.get(_3)} if(_5!=null)return _5[0]},isc.A.getNodeDataSource=function isc_ResultTree_getNodeDataSource(_1){var _2=_1[this.nodeTypeProperty];if(_2==null){var _3=this.getParent(_1);if(_3==null){return null}else if(_3==this.root){_2=this.getRootDataSource().ID}else{_2=_3.$40a;if(_2==null)_2=this.getRootDataSource().ID}} return isc.DS.get(_2)||this.getRootDataSource()},isc.A.isMultiDSTree=function isc_ResultTree_isMultiDSTree(){return this.multiDSTree||this.treeRelations!=null},isc.A.getRootDataSource=function isc_ResultTree_getRootDataSource(){if(this.operation&&this.operation.dataSource)return isc.DS.get(this.operation.dataSource);else return isc.DS.get(this.dataSource)},isc.A.getCriteria=function isc_ResultTree_getCriteria(_1,_2,_3){if(this.getRootDataSource()==_1)return this.criteria;return null},isc.A.getOperationId=function isc_ResultTree_getOperationId(_1,_2,_3){return this.operation?this.operation.ID:null},isc.A.$1218=function isc_ResultTree__getRelationship(_1,_2){var _3=(_1==null||_1==this.root),_4;var _5,_6;if(_3&&this.isMultiDSTree()){_5=this.getRootDataSource();_6=null;_4={childDS:_5}}else{_4=this.getTreeRelationship(_1);_5=_4.childDS;_6=_4.parentDS} if(!this.isMultiDSTree()){_4.idField=this.idField;_4.parentIdField=this.parentIdField;_4.rootValue=_4.rootValue} if(_2&&this.logIsDebugEnabled()){this.logDebug("parent id: "+(_3?"[root]":_1[_4.idField])+" (type: "+(_3?"[root]":(_6?_6.ID:"null"))+") has childDS: "+_5.ID+", relationship: "+this.echo(_4))} return _4},isc.A.$1219=function isc_ResultTree__getLoadChildrenCriteria(_1,_2,_3){var _4=(_1==null||_1==this.root),_5=_2.childDS,_6=_2.parentDS,_7={};if(!this.isLocal()){_7=isc.addProperties({},this.getCriteria(_5,_6,_1))}else if(this.$868!=null){_7=isc.addProperties({},this.$868)} if(_4&&this.isMultiDSTree()){}else if(this.loadDataOnDemand||this.isPaged()){var _8=_1[_2.idField];var _9;if(_4&&_8===_9){_8=_2.rootValue} if(_7._constructor=="AdvancedCriteria"){_7=isc.DataSource.combineCriteria(_7,{_constructor:"AdvancedCriteria",fieldName:_2.parentIdField,value:_8,operator:"equals"},"and")}else{_7[_2.parentIdField]=_8}} return _7},isc.A.$121b=function isc_ResultTree__loadChildren(_1,_2,_3,_4){var _5=this.$1218(_1,true),_6=_5.childDS,_7=_5.parentDS;_1.$40a=_6.ID;var _8=(_1==null||_1==this.root),_9=this.$1219(_1,_5,true);if(!((_8&&this.isMultiDSTree())||this.loadDataOnDemand)){this.setDefaultLoadState(isc.Tree.LOADED)} var _10={parentNode:_1,relationship:_5,childrenReplyCallback:_4};if(!this.$84a){_10.$84b=true;this.$84a=true} var _11=_10.fetchCount=(++this.currentFetch);var _12=isc.addProperties({parentNode:_1,resultTree:this},this.context);if(this.context&&this.context.internalClientContext){_10=isc.addProperties({},this.context.internalClientContext,_10)} _12.internalClientContext=_10;var _13=this.getOperationId(_6,_7,_1);if(_13)_12.operationId=_13;_12.willHandleError=true;if(this.isPaged()){_12.startRow=_2;_12.endRow=_3;_12.sortBy=isc.shallowClone(this.$39x);if(this.keepParentsOnFilter){_12.keepParentsOnFilter=true} if(_1!=null&&_2!=null&&_3!=null){var _14=_1[this.childrenProperty];if(!isc.isA.ResultSet(_14)){var _15=_1[this.$166s],_16=_1[this.$166t],_17=(_16!=null&&this.invalidatedFetchCount!=null&&_16<=this.invalidatedFetchCount);if(_15==null||_17){_1[this.$166t]=_11;_15=_1[this.$166s]=isc.BitSet.create();_15.setRange(_2,_3,true)}else{if(_4==null&&_15.all(true,_2,_3)){return} _15.setRange(_2,_3,true)}}}} if(_1!=null)this.setLoadState(_1,isc.Tree.LOADING);var _18=this.$124u(),_19=null;if(_18!==false){var _20=true;for(var n=_1,p=null;_20&&n!=null;n=p){p=this.getParent(n);if(p==null){_20=true}else{var c=this.getChildren(p);_20=(c.getLength()==1+c.indexOf(n))}} _18=_20&&_18;if(_18===true||_18===false){_19={progressiveLoading:_18}}}else{_19={progressiveLoading:false}} _6.fetchData(_9,{caller:this,methodName:"loadChildrenReply"},isc.addProperties(_12,_19))},isc.A.loadChildrenReply=function isc_ResultTree_loadChildrenReply(_1,_2,_3){var _4=_1.internalClientContext,_5=_4.parentNode;if(_5!=null&&this.isPaged()){delete _5[this.$166s];delete _5[this.$166t]} var _6=_4.fetchCount;if(this.invalidatedFetchCount!=null&&_6<=this.invalidatedFetchCount){return} var _7=_5,_8;while((_8=this.getParent(_7))!=null){_7=_8} if(_7!==this.getRoot()){return} var _9=(this.isLocal()&&this.haveCriteria(this.$869||this.criteria));var _10=_4.relationship,_11=_1.data;if(_1.status<0)_11=null;if(_1.status==isc.RPCResponse.STATUS_OFFLINE){_11=[];if(_5!=null&&!this.isRoot(_5)){isc.say(window[_3.componentId].offlineNodeMessage)}} var _12=this;if(_9){if(!this.completeTree)this.completeTree=this.duplicate(true,true);_12=this.completeTree;var _13=this.getPath(_5);_5=_12.find(_13)} if(!isc.isA.Array(_11)||_11.length==0){if(_1.status==isc.RPCResponse.STATUS_OFFLINE){_12.setLoadState(_5,isc.Tree.UNLOADED);_12.delayCall("closeFolder",[_5],0)}else{_12.setLoadState(_5,isc.Tree.LOADED)} if(!isc.isA.Array(_11)){if(_1.status<0){isc.RPCManager.$a0(_1,_3)}else if(_11==null){this.logWarn("null children returned; return empty List instead")}else{this.logWarn("Unexpected response format, Array of new nodes expected, response was: "+this.echoLeaf(_11))} _11=[]}} if(this.isPaged()){var _14=_11.length;var _15=(_1.startRow!=null?_1.startRow:_3.startRow);var _16=(_1.endRow!=null?_1.endRow:_15+_14);var _17=(_1.totalRows==null&&_16<_3.endRow?_16:_1.totalRows);var _18=_5[this.childrenProperty];if(isc.isA.ResultSet(_18)){}else if(_16<_17){_5[this.childCountProperty]=_17;var _19=this.getParent(_5),_20=_19!=null&&this.$111x(_5,_19);_18=this.$1202(_5,_5[this.childrenProperty],false);_18.fillCacheData(_11,_15)}else{if(_18!=null){var _21=_18.getRange(_15,_16);for(var i=_21.length;i--;){this.$786(_21[i])}} this.$27k(_11,_5,_15)}}else if(_12.isMultiDSTree()){for(var i=0;i<_11.length;i++){var _23=_11[i];var _24=this.getChildDataSource(_23,_10.childDS);if(_24!=null)this.convertToFolder(_23);_12.$27e(_23,_5)}}else{if(_1.status==isc.RPCResponse.STATUS_OFFLINE){_12.setLoadState(_5,isc.Tree.UNLOADED);_12.delayCall("closeFolder",[_5],0)}else{var _25=_9;_12.$1369(_11,_10.idField,_10.parentIdField,_10.rootValue,_10.isFolderProperty,_5,_25)}} if(_9){if(this.$87a==null)this.$87a=this.$87b();this.filterLocalData()} if(this.$87a){this.$87c(this.$87a,true);delete this.$87a} if(_4.childrenReplyCallback){this.fireCallback(_4.childrenReplyCallback,"node",[_5],this)} if(this.dataArrived!=null){this.dataArrived(_5)}},isc.A.getDataSource=function isc_ResultTree_getDataSource(){return isc.DataSource.getDataSource(this.dataSource)},isc.A.invalidateCache=function isc_ResultTree_invalidateCache(){if(!this.isLoaded(this.root))return;this.invalidatedFetchCount=this.currentFetch;this.$87a=this.$87b(true);this.$27d=0;this.setRoot(this.makeRoot(),true);if(!this.loadDataOnDemand){this.reloadChildren(this.root)}},isc.A.dataSourceDataChanged=function isc_ResultTree_dataSourceDataChanged(_1,_2){if(this.disableCacheSync)return;var _3=isc.DataSource.getUpdatedData(_1,_2,this.updateCacheFromRequest);this.handleUpdate(_1.operationType,_3,_2.invalidateCache)},isc.A.handleUpdate=function isc_ResultTree_handleUpdate(_1,_2,_3){if(isc.$cv)arguments.$cw=this;var _4=(this.dropCacheOnUpdate||_3||(this.isPaged()&&this.keepParentsOnFilter));if(_4){this.invalidateCache();if(!this.getDataSource().canQueueRequests)this.dataChanged();return} this.updateCache(_1,_2);this.dataChanged()},isc.A.updateCache=function isc_ResultTree_updateCache(_1,_2){if(_2==null)return;_1=isc.DS.$372(_1);if(!isc.isAn.Array(_2))_2=[_2];if(this.logIsInfoEnabled()){this.logInfo("Updating cache: operationType '"+_1+"', "+_2.length+" rows update data"+(this.logIsDebugEnabled()?":\n"+this.echoAll(_2):""))} switch(_1){case"remove":this.removeCacheData(_2);break;case"add":this.addCacheData(_2);break;case"replace":case"update":this.updateCacheData(_2);break}},isc.A.addCacheData=function isc_ResultTree_addCacheData(_1){if(!isc.isAn.Array(_1))_1=[_1];var _2=this.getDataSource().applyFilter(_1,this.criteria,this.context);this.logInfo("Adding rows to cache: "+_2.length+" of "+_1.length+" rows match filter criteria");var _3,_4=(this.idField!=_3&&this.parentIdField!=_3),_5=this.getDataSource().getPrimaryKeyFieldNames()[0];for(var i=0;i<_2.length;i++){var _7=_2[i];if(_4&&_7!=null&&_7[this.idField]==_7[this.parentIdField]) {this.logWarn("Invalid attempt to add a node that is specified to be its own parent (the '"+this.idField+"' + and '"+this.parentIdField+"' properties of the node are both set to "+(_7[this.idField]==null?"null":_7[this.idField].toString())+"). Skipping this node.");continue} if(this.completeTree){this.$651(this.completeTree,_7,_5)} this.$651(this,_7,_5)}},isc.A.$651=function isc_ResultTree__addNodeToCache(_1,_2,_3){var _4=_2[this.parentIdField],_5;if(_4!=null)_5=_1.find(_3,_4);else{if(this.defaultNewNodesToRoot||_1.rootValue==null)_5=_1.getRoot();else _5=null} var _6=(_5!=null&&(_1.getLoadState(_5)==isc.Tree.LOADED)&&!(this.isPaged()&&isc.isA.ResultSet(this.getChildren(_5))));if(_6){_2=isc.clone(_2);_1.$27e(_2,_5)} return _6},isc.A.updateCacheData=function isc_ResultTree_updateCacheData(_1){if(!isc.isAn.Array(_1))_1=[_1];var _2={addedRows:0,updatedRows:0,removedRows:0};var _3=(this.$87d||this.criteria),_4=this.haveCriteria(_3);var _5,_6=(this.idField!=_5&&this.parentIdField!=_5),_7=this.getDataSource();for(var i=0;i<_1.length;i++){var _9=_1[i];var _10=true;if(_4){var _11=_7.applyFilter([_9],_3,this.context);_10=(_11!=null&&_11.length>0)} if(this.logIsDebugEnabled()&&!_10){this.logDebug("updated node :\n"+this.echo(_9)+"\ndidn't match filter: "+this.echo(_3))} if(_9==null){continue} if(_6&&_9[this.idField]==_9[this.parentIdField]) {this.logWarn("Invalid attempt to update a node where the '"+this.idField+"' and '"+this.parentIdField+"' properties of the record are both set to "+(_9[this.idField]==null?"null":_9[this.idField].toString())+" (this would reparent the node to itself). Skipping this node.");continue} if(this.completeTree){this.$87e(this.completeTree,_9,true,null)} this.$87e(this,_9,_10,_2)} if(this.logIsDebugEnabled()){this.logDebug("updated cache: "+_2.addedRows+" row(s) added, "+_2.updatedRows+" row(s) updated, "+_2.removedRows+" row(s) removed.")}},isc.A.$87e=function isc_ResultTree__updateNodeInCache(_1,_2,_3,_4){var _5=this.getDataSource(),_6=_5.getPrimaryKeyFieldNames()[0],_7=_1.find(_6,_2[_6]);if(_7==null){if(_3){if(this.$651(_1,_2,_6)){this.logInfo("updated row returned by server doesn't match any cached row, adding as new row. Primary key value: "+this.echo(_2[_6])+", complete row: "+this.echo(_2));if(_4)_4.addedRows++}} return} var _8=this.isPaged(),_9=_8&&this.getChildren(this.getParent(_7));if(_3){if(_2[this.parentIdField]!=_7[this.parentIdField]){var _10=_1.find(_6,_2[this.parentIdField]);if(_10==null&&(this.defaultNewNodesToRoot||this.rootValue==null)) {_10=_1.getRoot()} if(_10==null||(_1.getLoadState(_10)!=isc.Tree.LOADED)){if(!(_8&&isc.isA.ResultSet(_9))){_1.$786(_7);if(_4)_4.removedRows++} return}else{var _11=_8&&this.getChildren(_10),_12=!(_8&&isc.isA.ResultSet(_11)),_13=!(_8&&isc.isA.ResultSet(_9));if(_12&&_13){_1.$1083(_7,_10)}else if(_12){_1.$27e(_7,_10)}else if(_13){_1.$786(_7)}}} isc.addProperties(_7,_2);var _14=_5.getFieldNames();for(var i=0;i<_14.length;i++){var _16=_14[i];if(!_2.hasOwnProperty(_16))delete _7[_16]} if(_4)_4.updatedRows++}else if(!(_8&&isc.isA.ResultSet(_9))){_1.$786(_7);if(_4)_4.removedRows++}},isc.A.removeCacheData=function isc_ResultTree_removeCacheData(_1){if(!isc.isAn.Array(_1))_1=[_1];var _2=this.getDataSource().getPrimaryKeyFieldNames()[0];if(this.completeTree){this.$87f(this.completeTree,_1,_2)} this.$87f(this,_1,_2)},isc.A.$87f=function isc_ResultTree__removeNodesFromCache(_1,_2,_3){var _4=this.isPaged(),_5=[];for(var i=0;i<_2.length;i++){var _7=_1.find(_3,_2[i][_3]);if(_7==null){this.logWarn("Cache synch: couldn't find deleted node:"+this.echo(_2[i]))}else if(!(_4&&isc.isA.ResultSet(this.getChildren(this.getParent(_7))))){_5.add(_7)}} _1.$137c(_5)},isc.A.getTitle=function isc_ResultTree_getTitle(_1){var _2=this.getNodeDataSource(_1);if(!_2)return"root";var _3=_1[_2.getTitleField()];if(_3!=null)return _3;return this.Super("getTitle",arguments)},isc.A.indexOf=function isc_ResultTree_indexOf(_1,_2,_3,_4,_5){var _6=this.getDataSource().getPrimaryKeyFieldNames();for(var i=0;i<_6.length;i++){var _8=_6[i];if(_1[_8]!=null)return this.findNextIndex(_2,_8,_1[_8],_3,true)} return this.invokeSuper(isc.ResultTree,"indexOf",_1,_2,_3,_4,_5)},isc.A.contains=function isc_ResultTree_contains(_1,_2,_3){var _4;if(this.isPaged()&&_1!=null&&_2===_4&&_3===_4){var _5=this.idField;return(_1[this.treeProperty]==this.ID&&this.nodeIndex[_1[_5]]==_1)}else{return this.invokeSuper(isc.ResultTree,"contains",_1,_2,_3)}},isc.A.getLength=function isc_ResultTree_getLength(){var _1=this.invokeSuper(isc.ResultTree,"getLength");if(this.isPaged()&&this.$122c!=null){var _2=this.getRoot(),_3=(this.openDisplayNodeType==isc.Tree.FOLDERS_AND_LEAVES?1:0);for(var i=this.$122c.length;i--;){var _5=this.$122c[i],_6=_5.$97q,_7=(_6[this.canReturnOpenSubfoldersProperty]!=null?_6[this.canReturnOpenSubfoldersProperty]:this.canReturnOpenFolders),_8=!(_7||_3==0);if(!_8){var _9=true;for(var p=_6;_9&&p!=_2;p=this.getParent(p)){_9=p!=null&&this.isOpen(p)} if(_9){_1+=Math.max(0,_5.$121l()-_5.$137f())}}}} return _1},isc.A.get=function isc_ResultTree_get(_1,_2){if(_1<0){var _3;return _3}else{return this.getRange(_1,_1+1,!!_2)[0]}},isc.A.getCachedRow=function isc_ResultTree_getCachedRow(_1){if(_1<0){return null}else{var _2=this.getRange(_1,_1+1,true)[0];if(_2!=null&&_2!==isc.ResultTree.getLoadingMarker()){return _2}else{return null}}},isc.A.getRange=function isc_ResultTree_getRange(_1,_2,_3){if(_1==null){this.logWarn("getRange() called with no specified range - ignoring.");return}else if(_2==null){_2=_1+1} if(_1<0||_2<0){this.logWarn("getRange("+_1+", "+_2+"): negative indices not supported, clamping start to 0");_1=Math.max(_1,0)} if(_2<=_1){this.logDebug("getRange("+_1+", "+_2+"): returning empty list");return[]} var _4=this.$122a;if(_4!=null&&_4.length>0){var _5=_4[_4.length-1],_6=_5.start;if(_6<=_1&&_2<=_5.end){return _5.range.slice(_1-_6,_2-_6)}} if(!this.isPaged()){return this.invokeSuper(isc.ResultTree,"getRange",_1,_2)} var _7=isc.ResultTree.getLoadingMarker(),_8=this.$111w,_9=this.getRoot(),_10={range:[],rangeLoading:false,needQueue:false,wasAlreadyQueuing:false,dontFetch:_3===true};if(_2>_1){if(!(this.openDisplayNodeType!=isc.Tree.LEAVES_ONLY&&this.showRoot)){++_1;++_2} var _11=this.$124u();this.$122b(_9,_9,[_9],0,_1,_2,true,_11,false,_10)} return _10.range},isc.A.$121e=function isc_ResultTree__pushCachedRange(_1,_2){if(this.isPaged()){if(this.$122a==null){this.$122a=[]} this.$122a.push({start:_1,end:_2,range:this.getRange(_1,_2)})}},isc.A.$121f=function isc_ResultTree__popCachedRange(_1,_2){if(this.isPaged()){this.$122a.pop();if(this.$122a.length==0){delete this.$122a}}},isc.A.$122b=function isc_ResultTree__getRange(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10){var _11=this.separateFolders,_12=_11&&this.sortFoldersBeforeLeaves,_13=_11&&!this.sortFoldersBeforeLeaves,_14=_10.range,_15=_10.rangeLoading,_16=_10.needQueue,_17=_10.dontFetch;var _18=(this.openDisplayNodeType==isc.Tree.FOLDERS_AND_LEAVES?1:0);var _19=this.$1215,_20=this.$111w,_21=isc.ResultTree.getLoadingMarker(),_22=(_2[this.canReturnOpenSubfoldersProperty]!=null?_2[this.canReturnOpenSubfoldersProperty]:this.canReturnOpenFolders),_23=isc.isA.ResultSet(_3),j=_4;var _25=(_3==null?0:(_23?_3.$121l():_3.getLength()));for(var z=0;z<(_11?2:1);++z){var _27=(z==0),_28=(_27==_12),_29=(_27==_13),_30=false,_31=0,p=0;for(;j<_6&&p<_25;++p){var _33=_3.getCachedRow(p);var _34=(_33!=null&&(!this.isOpen(_33)||_33[_19]));if(_33==null){var _35=(_22||_15||_18==0);if(_27&&(_35||_11||j>=_5)){if(_35){if(!_15){for(var r=Math.max(_5,j);r<_6;++r){_14[r-_5]=_21} _15=_10.rangeLoading=true;if(_17){return}}}else{_9=_11;if(j>=_5){_14[j-_5]=_21}} if(!(_17||_30)){_30=true;_31=p;if(!_16){_10.wasAlreadyQueuing=isc.RPCManager.startQueue();_16=_10.needQueue=true}}} j+=(_11&&_27?0:_18)}else{if(_30){_30=false;var _37=_3.progressiveLoading;_3.progressiveLoading=false;_3.getRange(_31,p);_3.progressiveLoading=_37} if(this.isFolder(_33)?!_29:!_28){var _38,_39;if(_33==_1){_38=_33[_20];_39=true}else{_38=this.$111x(_33,_2);_39=this.$121c(_33,_2)} var _40=_38-(_39?1:0);if(j>=_5&&_39&&!_15){_14[j-_5]=(_9?_21:_33)} var k=j+(_39?1:0),l=j+_38;if(k<_6&&(!_34||(l>=_5&&_40>0))){var _43=this.getChildren(_33,null,null,null,null,null,null,null,false);this.$122b(_1,_33,_43,k,_5,_6,false,(p==_25-1&&_8),_9,_10);_15=_10.rangeLoading;_16=_10.needQueue;if(_17&&_15){return}} j=l}}} if(_30){_30=false;var _37=_3.progressiveLoading;_3.progressiveLoading=_8;_3.getRange(_31,p);_3.progressiveLoading=_37}} if(_25==0||(_23&&!_3.lengthIsKnown())){if(!_15){for(var r=Math.max(_5,j);r<_6;++r){_14[r-_5]=_21} _15=_10.rangeLoading=true;if(_17){return}} if(!_16){_10.wasAlreadyQueuing=isc.RPCManager.startQueue();_16=_10.needQueue=true} var _37;if(_23){_37=_3.progressiveLoading;_3.progressiveLoading=_8} if(_11||(_18==0)){if(_23){_3.$121m()}else{this.$121b(_2,0,this.resultSize,null)}}else if(_23){_3.getRange(0,_6-j)}else{this.$121b(_2,0,_6-j,null)} if(_23){_3.progressiveLoading=_37}} if(_7&&_16&&!_10.wasAlreadyQueuing){isc.RPCManager.sendQueue()}},isc.A.$124u=function isc_ResultTree__getProgressiveLoading(){return(this.isPaged()&&this.progressiveLoading)},isc.A.$1202=function isc_ResultTree__canonicalizeChildren(_1,_2,_3){if(isc.isA.ResultSet(_2)){_1[this.childrenProperty]=_2;return _2}else if(this.$132d===true){return _2} var _4=_1[this.childCountProperty],_5=(isc.isAn.Array(_2)?_2.length:0),_6=(_4!=null&&isc.isA.Number(_4)&&Math.floor(_4)==_4&&_4>=0);if(_6&&_4<_5){isc.logWarn("The child count of a record was set to "+_4+". The number of children was "+_5+". The number of children cannot exceed the child count. Clamping the number of children to the child count.");_2=_1[this.childrenProperty]=_2.slice(0,_4)} if(_6){this.$122c=this.$122c||[];var _7=this.$27i,_8=this.$73p,_9=false;if(isc.isAn.Array(_8)&&_7!=null){for(var i=_8.length;i--;){var _11=_8[i];if(_11!=null&&_11.normalizer===_7){if(!_9){_8=_8.duplicate();_9=true} _8[i]=isc.addProperties({},_11,{normalizer:null})}}} var _12=this.getDataSource(),_13;if(this.keepParentsOnFilter){_13=(_2?_2.duplicate():[])}else{_13=_12.applyFilter(_2,this.criteria,this.context)} var _14=Math.max(_13.length,_1[this.childCountProperty]+(_13.length-_5));var _15=this.context&&isc.addProperties({},this.context);if(_15){delete _15.clientContext;delete _15.internalClientContext} if(this.keepParentsOnFilter){_15=_15||{};_15.keepParentsOnFilter=true} var _16={init:function(){var _17=this.$121z;this.$97q[_17.childrenProperty]=this;if(!_17.$122c.contains(this)){_17.$122c.add(this)} if(_17.dataArrived!=null){_17.observe(this,"dataArrived","observer.dataArrived(observed.$97q)")} var _1=this.$97q,_18=_17.$1218(_1,false);this.$134h=_17.$1219(_1,_18,false);var _19=this.Super("init",arguments);var _20=this.$97q,_21=_20!=_17.root&&_17.getParent(_20),_22=(_20[_17.canReturnOpenSubfoldersProperty]!=null?_20[_17.canReturnOpenSubfoldersProperty]:_17.canReturnOpenFolders),_23=(_17.openDisplayNodeType==isc.Tree.FOLDERS_AND_LEAVES?1:0),_24=!(_22||_23==0);if(_24){var _25=(_21&&_17.$111x(_20,_21));_20[_17.$111w]=_17.$1112(_20);if(_21){var _26=(_17.$111x(_20,_21)-_25);_17.$111z(_21,_26)}} if(this.$122d){this.addProperties(_17.$121y)} delete this.$122d;return _19},$121z:this,$97q:_1,$122d:_3,dataSource:_12,criteria:this.criteria,context:_15,disableCacheSync:this.disableCacheSync,updateCacheFromRequest:this.updateCacheFromRequest,sortSpecifiers:_8,initialData:_13,initialLength:_14,setCriteria:function(_27){var _17=this.$121z;_27=arguments[0]=_17.$122e(_27,this.$134h);return this.Super("setCriteria",arguments)}};if(this.keepParentsOnFilter){_16.dropCacheOnUpdate=true} if(!_3){isc.addProperties(_16,this.$121y)} _2=_1[this.childrenProperty]=isc.ResultSet.create(_16);this.setLoadState(_1,isc.Tree.LOADED_PARTIAL_CHILDREN);this.$1203(_1,false,null,false)} return _2});isc.evalBoundary;isc.B.push(isc.A.$122e=function isc_ResultTree__combineCriteria(_1,_2){var _3=(_1==null||isc.isAn.emptyObject(_1)),_4=(_2==null||isc.isAn.emptyObject(_2));if(_3||_4){if(!_3){return _1}else if(!_4){return _2}else{return(_1||_2)}} var _5=(_1._constructor=="AdvancedCriteria"||_2._constructor=="AdvancedCriteria");if(!_5){var _6=false;for(var _7 in _1){if(_2[_7]!=null){if(_2[_7]!==_1[_7]){_5=true}else{if(!_6){_2=isc.addProperties({},_2);_6=true} delete _2[_7]}}}} var _8=isc.DataSource.combineCriteria(_1,_2,"and");_5=(_8._constructor=="AdvancedCriteria");if(_5&&isc.isAn.Array(_8.criteria)){var _9=_8.criteria;for(var i=_9.length;i--;){var _11=_9[i];if(_11.operator=="iContains"&&_11.value==null){_11.operator="isNull";delete _11.value}}} return _8},isc.A.setSort=function isc_ResultTree_setSort(_1){var _2=this.invokeSuper(isc.ResultTree,"setSort",_1);_1=this.$73p;this.$39x=_1?isc.DS.getSortBy(_1):null;if(this.isPaged()){var _3=this.$122c;if(_3!=null&&_3.length>0){var _4=isc.RPCManager.startQueue();for(var i=_3.length;i--;){var _6=_3[i];_6.setSort(_1)} if(!_4){isc.RPCManager.sendQueue()}}} return _2},isc.A.$122f=function isc_ResultTree__getStartRow(_1){if(_1==null){return null} var _2=this.getRoot(),_3=null,_4=0;for(;_1!=_2;_1=_3){_3=this.getParent(_1);if(_3!=null){if(!this.$1111(_1,_3)){return null} var _5=this.getChildren(_3),j=_5.indexOf(_1);if(j==-1){return null} for(var i=0;i0;){if(i!=_15){var _13=_9.getCachedRow(i);_14=(_13!=null&&(!this.isOpen(_13)||_13[_6]))}}} if(_14){this.$1203(_3,true,null,false)}else{}}}else if((_4||_7)&&!_2){while(_3!=null&&_3[_6]&&this.isOpen(_1)){_3[_6]=false;_1=_3;_3=this.getParent(_3)}}},isc.A.$137a=function isc_ResultTree___add(_1,_2,_3){if(this.isPaged()&&!this.keepParentsOnFilter){var _4=this.getDataSource().applyFilter([_1],this.criteria,this.context);if(_4.length==0){return}} return this.invokeSuper(isc.ResultTree,"$137a",_1,_2,_3)},isc.A.$1205=function isc_ResultTree__preAdd(_1,_2,_3,_4){var _5=this.invokeSuper(isc.ResultTree,"$1205",_1,_2,_3,_4);if(this.isPaged()){var _6=this.getLoadState(_1),_7=(_6===isc.Tree.LOADED||_6===isc.Tree.LOADED_PARTIAL_CHILDREN);this.$1203(_1,_7,_2,true)} return _5},isc.A.setRoot=function isc_ResultTree_setRoot(_1,_2){if(this.isPaged()){var _3=(_1&&isc.endsWith(this.parentProperty,this.ID));this.$1217(_3?_1:this.getRoot(),true)} return this.invokeSuper(isc.ResultTree,"setRoot",_1,_2)},isc.A.$1209=function isc_ResultTree__preRemove(_1,_2,_3){if(this.isPaged()){this.$1203(_1,true,_2,false);delete _1[this.$1215];this.$1217(_1,false)} return this.invokeSuper(isc.ResultTree,"$1209",_1,_2,_3)},isc.A.unloadChildren=function isc_ResultTree_unloadChildren(_1,_2){if(this.isPaged()){this.$1217(_1,false)} return this.invokeSuper(isc.ResultTree,"unloadChildren",_1,_2)},isc.A.$1217=function isc_ResultTree__cleanResultSetChildren(_1,_2){var _3=this.$122c;for(var i=(_3!=null?_3.length:0);i--;){var _5=_3[i],_6=_5.$97q;if(_2^(_6==_1||this.isDescendantOf(_6,_1))){_3.removeAt(i);if(this.isObserving(_5,"dataArrived")){this.ignore(_5,"dataArrived")} delete _5.$97q;delete _5.$121z;delete _5.context.keepParentsOnFilter;_5.setCriteria=isc.ResultSet.getInstanceProperty("setCriteria");delete _5.$121p;delete _5.$121q;delete _5.$121t;delete _5.$121u;delete _5.$121n;delete _5.$121o;delete _5.$121w;delete _5.$121v}}},isc.A.changeDataVisibility=function(node,newState,callback){if(this.isPaged()){var parent=this.getParent(node),state=node[this.openProperty],changed=(!this.isLeaf(node)&&(state^newState)),closedToOpen=(changed&&!state&&newState),openToClosed=(changed&&!closedToOpen),visibleCached=node[this.$1215],parentVisibleCached=(parent!=null&&parent[this.$1215]);var ret=this.invokeSuper(isc.ResultTree,"changeDataVisibility",node,newState,callback);if(parent!=null&&!visibleCached&&((closedToOpen&&parentVisibleCached)||(openToClosed&&!parentVisibleCached))) {this.$1203(parent,null,null,false)} return ret}else{return this.invokeSuper(isc.ResultTree,"changeDataVisibility",node,newState,callback)}},isc.A.$1210=function isc_ResultTree__childrenDataAdd(_1,_2,_3,_4,_5,_6){var _7=isc.ResultSet.getLoadingMarker();var _8=(_2[this.canReturnOpenSubfoldersProperty]!=null?_2[this.canReturnOpenSubfoldersProperty]:this.canReturnOpenFolders),_9=(this.openDisplayNodeType==isc.Tree.FOLDERS_AND_LEAVES?1:0),_10=(!(_8||_9==0)&&!_6&&this.$1111(null,_2));if(_3==null||_3==_7){if(_10){this.$111z(_2,_4)} return} if(_4==1&&!isc.isAn.Array(_3)){_3=[_3]} var _11=this.$122f(_2),_12;if(_11===_12){return} if(_6){_2[this.$1200]=1+(_2[this.$1200]||0)} var _13=(this.$122g=this.$122g||[]),_14=(this.$125t=this.$125t||[]),_15,_16=[],_17=0,_18,_19;if(_6){_15=[];_14.push(_15)}else{_15=_14.pop()} var _20=(_6?0:_4-1),_21=(_6?1:-1);for(var i=_20;(_6?i<_4:i>=0);i+=_21){var _23=_3[i];if(_23!=null&&_23!=_7){if(_6){var _24={};_13.push(_24);var _25=this.$1208(_23);if(_25){_15.add(_25)} this.$1205(_23,_2,false,_24)}else{var _24=_13.pop();this.$1206(_23,_2,_5,_24);_16.push(_24.grandChildren);_17+=_24.deltaParentLength;_18=_24.grandParent;_19=_24.origParentLength}}else if(_10){++_2[this.$111w]}} if(!_6){var _26=(_2[this.canReturnOpenSubfoldersProperty]!=null),_27=!_8;for(var i=0;i<_4;++i){var _23=_3[i];if(_23!=null&&_23!=_7){var _28=this.$1202(_23,_16.pop(),false);if(_27&&this.isOpen(_23)&&_28!=null&&!_28.isEmpty()) {this.logWarn("Adding the open folder node '"+this.getPath(_23)+"' as a child of the parent node '"+this.getPath(_2)+"' is contradictory to the setting of the "+(_26?"'"+this.canReturnOpenSubfoldersProperty+"' property of the parent node.":"'canReturnOpenFolders' property of the tree."))} if(_28!=null){if(isc.isA.ResultSet(_28)){if(!(_28.lengthIsKnown()&&_28.allMatchingRowsCached())){this.$1203(_23,false,_2,false)}}else if(!isc.isAn.Array(_28)){this.$137a(_28,_23)}else{this.$137b(_28,_23)}}}} if((--_2[this.$1200])==0){delete _2[this.$1200];if(_18){_17+=(this.$111x(_2,_18)-_19);this.$111z(_18,_17)}} this.$1203(_2,null,null,false);if(_15.length>0){for(var i=_15.length;i--;){var _25=_15.pop();this.$1207(_25)}}}},isc.A.$1211=function isc_ResultTree__childrenDataRemove(_1,_2,_3,_4,_5,_6){var _7=isc.ResultSet.getLoadingMarker();var _8=(_2[this.canReturnOpenSubfoldersProperty]!=null?_2[this.canReturnOpenSubfoldersProperty]:this.canReturnOpenFolders),_9=(this.openDisplayNodeType==isc.Tree.FOLDERS_AND_LEAVES?1:0),_10=(!(_8||_9==0)&&!_6&&this.$1111(null,_2));if(_3==null||_3==_7){if(_10){this.$111z(_2,-_4)} return} if(_4==1&&!isc.isAn.Array(_3)){_3=[_3]} var _11=this.$122f(_2),_12;if(_11===_12){return} if(_6){_2[this.$1200]=1+(_2[this.$1200]||0)} var _13=(this.$122g=this.$122g||[]),_14,_15;var _16=(_6?0:_4-1),_17=(_6?1:-1);for(var i=_16;(_6?i<_4:i>=0);i+=_17){var _19=_3[i];if(_19!=null&&_19!=_7){if(_6){var _20={};_13.push(_20);this.$1209(_19,_2,_20)}else{var _20=_13.pop();this.$121a(_19,_2,_20);_14=_20.grandParent;_15=_20.origParentLength}}else if(_10){--_2[this.$111w]}} if(!_6){if((--_2[this.$1200])==0){delete _2[this.$1200];if(_14){var _21=(this.$111x(_2,_14)-_15);this.$111z(_14,_21)}} this.$1203(_2,null,null,false)}},isc.A.$1212=function isc_ResultTree__childrenDataSplice(_1,_2,_3,_4,_5,_6,_7,_8){var _9=isc.ResultSet.getLoadingMarker();var _10=(_2[this.canReturnOpenSubfoldersProperty]!=null?_2[this.canReturnOpenSubfoldersProperty]:this.canReturnOpenFolders),_11=(this.openDisplayNodeType==isc.Tree.FOLDERS_AND_LEAVES?1:0),_12=(!(_10||_11==0)&&!_8&&this.$1111(null,_2));var _13=!(_3==null||_3==_9),_14=!(_6==null||_6==_9);if(!(_13||_14)){if(_12){this.$111z(_2,_7-_4)} return}else if(!_14){if(_12){this.$111z(_2,_7)} this.$1211(_1,_2,_3,_4,_5,_8);return}else if(!_13){if(_12){this.$111z(_2,-_4)} this.$1210(_1,_2,_6,_7,_5,_8);return} var _15=this.$122f(_2),_16;if(_15===_16){return} if(_8){_2[this.$1200]=1+(_2[this.$1200]||0)} var _17=(this.$122g=this.$122g||[]),_18=(this.$125t=this.$125t||[]),_19,_20=[],_21=0,_22,_23;if(_8){_19=[];_18.push(_19)}else{_19=_18.pop()} if(_7==1&&!isc.isAn.Array(_6)){_6=[_6]} if(_4==1&&!isc.isAn.Array(_3)){_3=[_3]} var _24=(_8?0:_7+_4-1),_25=(_8?1:-1);for(var i=_24;(_8?i<_7+_4:i>=0);i+=_25){var _27=(_4<=i),_28=(_27?_6[i-_4]:_3[i]);if(_28!=null&&_28!=_9){if(_8){var _29={};_17.push(_29);if(_27){var _30=this.$1208(_28);if(_30&&!(_13&&_3.contains(_30))){_19.add(_30)} this.$1205(_28,_2,false,_29)}else{this.$1209(_28,_2,_29)}}else{var _29=_17.pop();if(_27){this.$1206(_28,_2,_5,_29);_20.push(_29.grandChildren);_21+=_29.deltaParentLength}else{this.$121a(_28,_2,_29)} _22=_29.grandParent;_23=_29.origParentLength}}else if(_12){if(_27){++_2[this.$111w]}else{--_2[this.$111w]}}} if(!_8){var _31=(_2[this.canReturnOpenSubfoldersProperty]!=null),_32=!_10;for(var i=0,j=0;i<_7;++i){var _34=_6[i];if(_34!=null&&_34!=_9){var _35=this.$1202(_34,_20.pop(),false);if(_32&&this.isOpen(_34)&&_35!=null&&!_35.isEmpty()) {this.logWarn("Adding the open folder node '"+this.getPath(_34)+"' as a child of the parent node '"+this.getPath(_2)+"' is contradictory to the setting of the "+(_31?"'"+this.canReturnOpenSubfoldersProperty+"' property of the parent node.":"'canReturnOpenFolders' property of the tree."))} if(_35!=null){if(isc.isA.ResultSet(_35)){if(!(_35.lengthIsKnown()&&_35.allMatchingRowsCached())){this.$1203(_34,false,_2,false)}}else if(!isc.isAn.Array(_35)){this.$137a(_35,_34)}else{this.$137b(_35,_34)}}}} if((--_2[this.$1200])==0){delete _2[this.$1200];if(_22){_21+=(this.$111x(_2,_22)-_23);this.$111z(_22,_21)}} this.$1203(_2,null,null,false);if(_19.length>0){for(var i=_19.length;i--;){var _30=_19.pop();this.$1207(_30)}}}},isc.A.$1213=function isc_ResultTree__childrenDataMoved(_1,_2,_3,_4,_5,_6){var _7=isc.ResultSet.getLoadingMarker()},isc.A.$1214=function isc_ResultTree__childrenDataLengthIsKnownChanged(_1,_2,_3,_4){var _5=isc.ResultSet.getLoadingMarker();this.$1203(_2,null,null,false)},isc.A.setDefaultLoadState=function isc_ResultTree_setDefaultLoadState(_1){var _2=this.defaultLoadState;this.defaultLoadState=_1;if(this.isPaged()&&(_2!==_1||(_2==null)^(_1==null))) {var _3=(_2===isc.Tree.LOADED||_2===isc.Tree.LOADED_PARTIAL_CHILDREN),_4=(_1===isc.Tree.LOADED||_1===isc.Tree.LOADED_PARTIAL_CHILDREN);if(_3^_4){var _5=this.getRoot(),_6=this.findAll("$27g",null);if(_5.$27g==null){if(_6==null){_6=[_5]}else{_6.add(_5)}} if(_6!=null){for(var i=_6.length;i--;){var _8=_6[i],_9=this.getParent(_8);this.$1203(_8,null,_9,true)}}}}},isc.A.setCriteria=function isc_ResultTree_setCriteria(_1){var _2=this.criteria||{},_3=!this.haveCriteria(_2),_4=this.$868||{},_5=this.getDataSource();if(!_5.isAdvancedCriteria(_1)){_1=isc.clone(_1)} this.criteria=_1;if(_5.isAdvancedCriteria(_1)&&!_5.isAdvancedCriteria(_2)){_2=isc.DataSource.convertCriteria(_2)} if(!_5.isAdvancedCriteria(_1)&&_5.isAdvancedCriteria(_2)){_1=isc.DataSource.convertCriteria(_1);this.criteria=_1} if(this.isLocal()&&this.serverFilterFields!=null&&this.serverFilterFields.length>0) {this.$87d=isc.DataSource.copyCriteria(_1);this.$868=_5.splitCriteria(this.$87d,this.serverFilterFields)}else{delete this.$87d;delete this.$868} var _6=this.compareCriteria(_1,_2);if(_6!=0){if(!this.isLocal()){this.logInfo("setCriteria: filter criteria changed, invalidating cache");this.invalidateCache();if(this.isPaged()&&this.$122c!=null){var _7=this.$122c.duplicate();for(var i=_7.length;i--;){var _9=_7[i];if(this.$122c.contains(_9)){var _10=_9.$97q,_11=this.$1218(_10,false),_12=this.$1219(_10,_11,false);_9.setCriteria(isc.DataSource.combineCriteria(_12,this.criteria))}}}}else{if(this.haveCriteria(this.$868)?(this.compareCriteria(this.$868,_4)!=0):this.haveCriteria(_4)) {this.logInfo("setCriteria: filter criteria changed, invalidating cache");this.invalidateCache()}else{var _13=this.$87b();if(_3){this.completeTree=this.duplicate(true,true)} this.filterLocalData();this.$87c(_13);if(this.dataArrived!=null){this.dataArrived(this.getRoot())}}}}},isc.A.filterLocalData=function isc_ResultTree_filterLocalData(_1){if(!_1)_1=this.getRoot();var _2=this.$87d||this.criteria,_3=this.completeTree;if(this.haveCriteria(_2)){var _4=(this.keepParentsOnFilter?isc.Tree.KEEP_PARENTS:isc.Tree.STRICT),_5=this.getDataSource();_3=this.applyFilter(this.completeTree,_2,_4,_5,this.context);this.logInfo("Local filter applied: "+_3.getNodeList().length+" of "+this.completeTree.getNodeList().length+" records matched filter:"+this.echoFull(_2))}else{this.logInfo("Local filter applied: all "+_3.getNodeList().length+" records matched filter: none");delete this.completeTree} var _6=_3.getAllNodes();_6=_3.getCleanNodeData(_6,false,false,true);this.data=_6;this.setRoot(this.getCleanNodeData(this.getRoot(),false,false,true));this.$736(true)},isc.A.applyFilter=function isc_ResultTree_applyFilter(_1,_2,_3,_4,_5){return _1.getFilteredTree(_2,_3,_4,_5)},isc.A.compareCriteria=function isc_ResultTree_compareCriteria(_1,_2,_3,_4){return this.getDataSource().compareCriteria(_1,_2,(_3?_3:this.context),(_4?_4:"dropOnChange"))},isc.A.willFetchData=function isc_ResultTree_willFetchData(_1){var _2;var _3=this.criteria||{},_4=this.$868||{},_5=this.getDataSource();if(!_5.isAdvancedCriteria(_1)){_1=isc.DataSource.copyCriteria(_1)} if(_5.isAdvancedCriteria(_1)&&!_5.isAdvancedCriteria(_3)){_3=isc.DataSource.convertCriteria(_3)} if(!_5.isAdvancedCriteria(_1)&&_5.isAdvancedCriteria(_3)){_1=isc.DataSource.convertCriteria(_1)} var _6=this.compareCriteria(_1,_3);if(_6==0)return false;if(!this.isLocal())return true;var _7={};if(this.isLocal()&&this.serverFilterFields!=null&&this.serverFilterFields.length>0) {var _8=isc.DataSource.copyCriteria(_1);_7=_5.splitCriteria(_8,this.serverFilterFields)} return(this.haveCriteria(_7)?(this.compareCriteria(_7,_4)!=0):this.haveCriteria(_4))},isc.A.getOpenState=function isc_ResultTree_getOpenState(){var _1=this.$87b();return isc.Comm.serialize(_1)},isc.A.$87b=function isc_ResultTree__getOpenState(_1){var _2=this.getRoot(),_3=[];this.$45q(this,_2,_3,_1);return _3},isc.A.setOpenState=function isc_ResultTree_setOpenState(_1){_1=isc.Canvas.evalViewState(_1,"openState",false,this) if(!_1)return;this.$87c(_1)},isc.A.$87c=function isc_ResultTree__setOpenState(_1,_2){if(!_1)return;if(!_2){this.closeAll()} this.openFolders(_1)},isc.A.$45q=function isc_ResultTree__addNodeToOpenState(_1,_2,_3,_4){if(!_1.isOpen(_2)||!_1.isLoaded(_2))return false;if(_4){_1.getName(_2);if(this.autoPreserveOpenState=="never"||(this.autoPreserveOpenState=="whenUnique"&&_2._autoAssignedName)) {return false}} var _5=_1.getFolders(_2),_6=false;if(_5!=null){for(var i=0;i<_5.length;i++){_6=this.$45q(_1,_5[i],_3,_4)||_6}} _3[_3.length]=_1.getPath(_2);return true});isc.B._maxIndex=isc.C+77;isc.ResultTree.getPrototype().toString=isc.$63a;isc.ResultTree.getPrototype().logMessage=isc.$63b;isc.ResultTree.registerStringMethods({dataArrived:"parentNode"});isc.A=isc.Canvas.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.buildRequest=function isc_Canvas_buildRequest(_1,_2,_3){if(!_1)_1={};if(_3)_1.afterFlowCallback=_3;if(_2=="filter"){_2="fetch";if(_1.textMatchStyle==null)_1.textMatchStyle="substring"} if(this.textMatchStyle!=null)_1.textMatchStyle=this.textMatchStyle;_2=isc.DS.$372(_2);if(this.dataPageSize)_1.dataPageSize=this.dataPageSize;if(this.dataFetchMode)_1.dataFetchMode=this.dataFetchMode;var _4=_1.operationId||_1.operation;if(_4==null){switch(_2){case"fetch":_4=this.fetchOperation;break;case"add":_4=this.addOperation||this.saveOperation;break;case"update":_4=this.updateOperation||this.saveOperation;break;case"remove":_4=this.removeOperation||this.deleteOperation;break;case"validate":_4=this.validateOperation;break}} _1.operation=_4||this.operation;if(_1.operationId==null){_1.operationId=_1.operation} _1.componentId=this.ID;return isc.rpc.addDefaultOperation(_1,this.dataSource,_2)},isc.A.createResultTree=function isc_Canvas_createResultTree(_1,_2,_3,_4){if(_4==null)_4="fetch";this.$117s(_3,_2);if(_3==null)_3={};var _5=isc.addProperties({initialData:this.initialData},this.dataProperties,_3.dataProperties,this.treeProperties,_3.treeProperties);delete _5.ID;_5.criteria=_1;if(_3.operation!=null){_5.operation=_3.operation} _5.context=_3;_5.dataSource=this.dataSource;_5.componentId=this.ID;_5.$31k=true;if(this.loadDataOnDemand!=null)_5.loadDataOnDemand=this.loadDataOnDemand;if(this.keepParentsOnFilter!=null)_5.keepParentsOnFilter=this.keepParentsOnFilter;if(this.dataFetchMode!=null)_5.fetchMode=this.dataFetchMode;if(this.serverFilterFields!=null)_5.serverFilterFields=this.serverFilterFields;if(this.treeRootValue!=null)_5.rootValue=this.treeRootValue;if(this.treeDataRelations)_5.treeRelations=this.treeDataRelations;if(this.multiDSTree!=null)_5.multiDSTree=this.multiDSTree;if(this.progressiveLoading===true||this.progressiveLoading===false){isc.addProperties(_5,{progressiveLoading:this.progressiveLoading})} var _6=this.getSort();if(_6)_5.$39x=isc.DS.getSortBy(_6);var _7=this.getDataSource().resultTreeClass||"ResultTree";return isc.ClassFactory.getClass(_7,true).create(_5)},isc.A.$117s=function isc_Canvas__setupResultTreeFetchCallback(_1,_2){if(_1==null)_1={};var _3=_1.internalClientContext={$53w:_2};if(_1.afterFlowCallback!=null){if(_3.$53w==null){_3.$53w=_1.afterFlowCallback}else if(_3.$53w!=_1.afterFlowCallback){this.logWarn("createResultTree called with request.afterFlowCallback:"+this.echo(_1.afterFlowCallback)+" as well as explicit callback parameter "+this.echo(_2)+". The request.afterFlowCallback will not be fired.")}} _1.afterFlowCallback={target:this,methodName:"$53x"}},isc.A.$53x=function isc_Canvas__fireFetchCallback(_1,_2,_3){var _4=_3.internalClientContext;if(_4&&_4.$84b&&_4.$53w!=null){var _5=_4.$53w;this.fireCallback(_5,"dsResponse,data,dsRequest",arguments)}});isc.B._maxIndex=isc.C+4;if(isc.ValuesManager){isc.A=isc.ValuesManager.getPrototype();isc.A.buildRequest=isc.Canvas.getInstanceProperty("buildRequest")} isc.ClassFactory.defineInterface("EditorActionMethods");isc.EditorActionMethods.addInterfaceMethods({save:function(_1){return this.saveData(_1)},editSelected:function(_1,_2){return this.editSelectedData(_1,_2)},editNew:function(_1,_2){return this.editNewRecord(_1,_2)},editNewRecord:function(_1){this.setSaveOperationType("add");this.$39m(_1)},editRecord:function(_1){var _2=(_1==null?"add":"update");this.setSaveOperationType(_2);this.$39m(_1)},$39m:function(_1){delete this.$50l;delete this.$39l;var _1=isc.addProperties({},_1);this.setData(_1);if(this.getFileItemForm!=null){var _2=this.getFileItemForm();if(_2){_2.editNewRecord();_2.clearErrors(true)}}},editSelectedData:function(_1){if(isc.isA.String(_1))_1=window[_1];if(!_1)return;var _2=_1.getSelection();if(_2.length>0){var _3=[];for(var i=0;i<_2.length;i++){_3[i]=_1.getCleanRecordData(_2[i])} this.editList(_3)}},editList:function(_1){this.setSaveOperationType("update");this.$50b(_1)},$50b:function(_1){this.$50l=0;this.$39l=_1;var _2=isc.addProperties({},_1[this.$50l]);this.editRecord(_2)},editNextRecord:function(){this.editOtherRecord(true)},editPrevRecord:function(){this.editOtherRecord(false)},editOtherRecord:function(_1){if(!this.$39l)return;if(this.isVisible()&&this.valuesHaveChanged()){this.$39n=_1;this.saveData({target:this,methodName:"editOtherReply"});return};if(_1&&this.$50l>=this.$39l.length-1){this.logWarn("Unable to edit next record - this is the last selected record");return false} if(!_1&&this.$50l<=0){this.logWarn("Unable to edit previous record - this is the first selected record");return false} this.$50l+=(_1?1:-1);var _2=isc.addProperties({},this.$39l[this.$50l]);this.setData(_2)},editOtherReply:function(_1,_2,_3){var _4=this.$39n;delete this.$39n;if(_1.status<0&&_1.errors){return this.setErrors(_1.errors,true)} if(_1.status<0)return isc.RPCManager.$a0(_1,_3);this.rememberValues();this.$39l[this.$50l]=this.getValues();this.editOtherRecord(_4) return true},validateData:function(_1,_2){if(!this.validate())return false;var _3=this.getValues();var _4=this.buildRequest(_2,"validate");_4.editor=this;if(_4.valuesAsParams){if(!_4.params)_4.params={};isc.addProperties(_4.params,_3)} var _5=this.getDataSource();return _5.validateData(_3,_1?_1:{target:this,methodName:"saveEditorReply"},_4)},reset:function(){this.resetValues()},cancel:function(_1){var _2={actionURL:this.action,target:window,sendNoQueue:true,ignoreTimeout:true,useXmlHttpRequest:false,params:{},useSimpleHttp:true};_2.params[this.cancelParamName]=this.cancelParamValue;if(!_2.actionURL){this.logWarn("No actionURL defined for the cancel RPC - set 'action' on your form orprovide an actionURL in the requestProperties to cancel()");return} isc.addProperties(_2,_1);isc.rpc.sendRequest(_2)},cancelEditing:function(){if(this.valuesManager!=null){this.valuesManager.cancelEditing()} if(this.userTask!=null){this.userTask.cancelEditing()}},completeEditing:function(){if(this.valuesManager!=null){this.valuesManager.completeEditing()} if(this.userTask!=null){this.userTask.completeEditing()}},submit:function(_1,_2){if(this.saveToServer==false)return;if(this.valuesManager!=null){return this.valuesManager.submit(_1,_2)} if(this.submitValues!=null){return this.submitValues(this.getValues(),this)} if(this.canSubmit)return this.submitForm();else return this.saveData(_1,_2)},saveOperationIsAdd:function(){if(this.saveOperationType)return this.saveOperationType=="add";if(this.dataSource){var _1=isc.DataSource.getDataSource(this.dataSource);return!_1.recordHasAllKeys(this.getValues())} return false},saveData:function(_1,_2,_3){if(this.selectionComponent!=null){var _4=this.$71d;if(_4&&this.selectionComponent.setRecordValues){this.selectionComponent.setRecordValues(_4,this.getValues())} return} if(this.dataSource==null){this.logWarn("saveData() called on a non-databound "+this.Class+". This is not supported. for information on databinding of components look at the documentation for the DataSource class. If this was intended to be a native HTML form submission, set the canSubmit property to true on this form.");return} if(isc.ValuesManager&&isc.isA.ValuesManager(this.valuesManager)&&this.dataPath){var _5=this.getFields();for(var i=0;i<_5.length;i++){var _7;if(_5[i].getTrimmedDataPath){_7=_5[i].getTrimmedDataPath()} if(_7==null){_7=_5[i].dataPath||_5[i].name} var _8=this.getValue(_7);this.valuesManager.$10y(_7,_8,this)} return} if(isc.Offline&&isc.Offline.isOffline()&&!this.dataSource.clientOnly){isc.warn(this.offlineSaveMessage);return} if(_2==null)_2={};var _9=this.getSaveOperationType(_2);if(!_2.oldValues){_2.oldValues=_9!="add"?this.$10s:{}} if(this.validationURL&&!_3){var _10={};isc.addProperties(_10,_2);isc.addProperties(_10,{actionURL:this.validationURL,valuesAsParams:true,sendNoQueue:true});_10.$40b=_2;_10.$40c=_1;this.performingServerValidation=true;this.validateData(this.getID()+".$40d(rpcRequest,rpcResponse,data)",_10);return} var _11=this.getFileItemForm();if(_11&&_11.isDrawn()){this.updateFileItemForm();if(!this.validate())return false;if(_2.clientContext==null)_2.clientContext={};_2.clientContext.saveDataTarget=this;return _11.saveData(_1,_2,_3)} this.$40c=_1;_1=this.getID()+".$49z(dsRequest, dsResponse, data)";_2=this.buildRequest(_2,_9,_1);var _12=false;if(this.submitParamsOnly)_2.useSimpleHttp=true;if(isc.DynamicForm&&isc.isA.DynamicForm(this)){if(this.$66g){_2.actionURL=this.action;_2.target=this.target?this.target:window;_12=true} if(this.method!=isc.DynamicForm.getInstanceProperty("method")){_2.httpMethod=this.method}} if(this.disableValidation)this.clearErrors(true);else{if(!this.validate(null,null,null,null,true))return false} if(this.rulesEngine){var _13=this.rulesEngine.processSubmit(this);if(_13==false)return} var _14=this.getDataSource().$708(this.getValues());if((isc.DynamicForm&&isc.isA.DynamicForm(this)&&this.isMultipart())||this.canSubmit||_12) {return this.submitEditorValues(_14,_2.operation,_2.callback,_2)}else{return this.saveEditorValues(_14,_2.operation,_2.callback,_2)}},updateFileItemForm:function(){var _1=this.getFileItemForm();if(_1==null)return;var _2=_1.getValues(),_3=this.getValues(),_4=_1.getItem(0).getFieldName();for(var _5 in _2){if(_5==_4)continue;_1.setValue(_5,null)} for(var _5 in _3){if(_5==_4)continue;_1.setValue(_5,_3[_5])} if(this.$66g)_1.setAction(this.action);_1.dataSource=this.dataSource;_1.fileItemFormParentForm=this},isNewRecord:function(){return this.getSaveOperationType()=="add"},setSaveOperationType:function(_1){this.saveOperationType=_1},getSaveOperationType:function(_1){var _2;if(!_1||!_1.operation){if(!_1)_1={};_2=_1.operationType?_1.operationType:this.saveOperationType;if(!_2&&this.dataSource!=null){var _3=isc.DataSource.getDataSource(this.dataSource).getPrimaryKeyFieldNames(),_4=this.getValues(),_5;if(this.valuesManager&&this.dataPath==null){_4=this.valuesManager.getValues()} for(var i=0;i<_3.length;i++){var _7=_3[i],_8=_4[_3];if(_8==null){_2="add";break} if(this.$10s[_7]!==_5&&this.$10s[_7]!=_8){_2="add"} var _9=this.getItem(_7);if(_9&&_9.isVisible()&&(_9.shouldSaveValue&&_9.isEditable())){_2="add";break}} if(_2==null){_2="update"}}} return _2},$49z:function(_1,_2,_3){var _4=_1.clientContext;if(_4&&_4.saveDataTarget!=null&&_4.saveDataTarget!=this) {_4.saveDataTarget.$49z(_1,_2,_3)} this.$490=0;if(!this.suppressServerDataSync&&_2&&_2.status>=0&&_3!=null){if(isc.isAn.Array(_3))_3=_3[0];if(_1.originalData)_1.originalData=isc.shallowClone(_1.originalData);if(_1.data)_1.data=isc.shallowClone(_1.data);var _5=(_1.originalData||_1.data),_6=this.getValues();var _7=false,_8=true,_9;for(var i in _3){var _11=_5[i]===_9?this.$10s[i]:_5[i];var _12=this.getField(i);if(this.fieldValuesAreEqual(_12,_6[i],_11)){if(!this.fieldValuesAreEqual(_12,_11,_3[i])){_6[i]=_3[i];_7=true}}else{_8=false}} if(_7){this.$10r(_6)} for(var i=0;i0){if(!_3.operation){this.setData(_4)}else{var _5=_3.operation,_6=this.getDataSource(),_7=_6.filterPrimaryKeyFields(_4);if(_3.prompt==null) _3.prompt=isc.RPCManager.getViewRecordsPrompt;_3.viewer=this;return _6.performDSOperation(_5.type,_7,(_2?_2:{target:this,methodName:"viewSelectedDataReply"}),_3)}} return false},isc.A.viewSelected=function isc_DetailViewer_viewSelected(_1,_2){return this.viewSelectedData(_1,_2)},isc.A.viewSelectedDataReply=function isc_DetailViewer_viewSelectedDataReply(_1,_2,_3){this.setData(_2)});isc.B._maxIndex=isc.C+3} isc.defineClass("MockDataSource","DataSource");isc.A=isc.MockDataSource;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.parseTextWikiSymbols=function isc_c_MockDataSource_parseTextWikiSymbols(_1){var _2=false;var _3=false;var _4=false;var _5=[];for(var i=0;i<_1.length;i++){var c=_1.charAt(i);if(c=='\\'){if((i+1)<_1.length&&_1.charAt(i+1)=='r'){c="
";i++}}else if(c=='['&&_1.indexOf("]",i+1)>0){c="";_4=true}else if(c==']'){if(_4){c="";_4=false}}else if(c=='*'){if(_3){_3=false;c=""}else{_3=true;c=""}}else if(c=='_'){if(_2){_2=false;c=""}else{_2=true;c=""}} _5.push(c)} return _5.join("")},isc.A.parseTableFields=function isc_c_MockDataSource_parseTableFields(_1,_2){var _3=_1.split("\n");var _4=isc.MockDataSource.splitComma(_3[0]),_5=[];var _6=_3[_3.length-1];if(_6.startsWith("[")&&_6.endsWith("]")&&_6!="[]"&&_6!="[ ]"&&_6!="[x]"){var _7=_6.substring(1,_6.length-1).split(",")} for(var j=0;j<_4.length;j++){var _9=_4[j].trim().replace(/(\\r|\r)/g,"
");var _10=isc.MockDataSource.convertTitleToName(_4[j],_2);var _11=_10;var _12=0;do{var _13=false;for(var i=0;i<_5.length;i++){if(_5[i].name==_11){_12++;_11=_10+_12;_13=true;break}}}while(_13);if(_9==""){_9=" "} var _15={name:_11,title:_9};if(_15.title.length<=3){_15.align="center"} if(_7&&_7[j]){_15.width=_7[j];var _16=_15.width[_15.width.length-1];if(!isc.MockDataSource.$871(_16)){_15.width=_15.width.substring(0,_7[j].length-1);if(_16=='R'||_16=='r'){_15.align="right"}else if(_16=='L'||_16=='l'){_15.align="left"}else if(_16=='C'||_16=='c'){_15.align="center"}} _15.width+="%"} _5.add(_15)} return _5},isc.A.convertTitleToName=function isc_c_MockDataSource_convertTitleToName(_1,_2){var _3=_1.trim().replace(/(\\r|\r)/g,"_").replace(/[^a-zA-Z0-9_ ]/g,"_");if(_3==""||(_3.charAt(0)>='0'&&_3.charAt(0)<='9')){_3='_'+_3} var _4=_3.split(" ");_3="";if("underscores"==_2){for(var i=0;i<_4.length;i++){_3+=_4[i].toLowerCase();if(i!=(_4.length-1)){_3+="_"}}}else if("underscoresAllCaps"==_2){for(var i=0;i<_4.length;i++){_3+=_4[i].toUpperCase();if(i!=(_4.length-1)){_3+="_"}}}else if("underscoresKeepCase"==_2){for(var i=0;i<_4.length;i++){_3+=_4[i];if(i!=(_4.length-1)){_3+="_"}}}else{_3=_4[0].toLowerCase();for(var i=1;i<_4.length;i++){_3+=_4[i].substring(0,1).toUpperCase();_3+=_4[i].substring(1).toLowerCase()}} return _3},isc.A.$871=function isc_c_MockDataSource__isDigit(_1){var _2=_1.charCodeAt(0);if((_2>47)&&(_2<58)){return true} return false},isc.A.parseTable=function isc_c_MockDataSource_parseTable(_1){var _2=_1.split("\n");var _3=isc.MockDataSource.parseTableFields(_1);var _4=[];for(var i=1;i<_2.length;i++){if(_2[i].startsWith("[")&&_2[i].endsWith("]")&&_2[i]!="[]"&&_2[i]!="[ ]"&&_2[i]!="[x]"){continue} var _6={};var _7=isc.MockDataSource.splitComma(_2[i]);for(var j=0;j<_3.length;j++){var _9=_7[j];if(_9==null){_9=""} _9=_9.replace(/\r/g,"
");_9=_9.replace("[]","");_9=_9.replace("[ ]","");_9=_9.replace("[x]","");_6[_3[j].name]=isc.MockDataSource.parseTextWikiSymbols(_9)} _4.add(_6)} return _4},isc.A.splitComma=function isc_c_MockDataSource_splitComma(_1){var _2=_1.split(","),_3=[];for(var i=0,_5=_2.length,_6;i<_5;++i){_6="";while(_2[i].slice(-1)=="\\"){_6+=_2[i++].slice(0,-1)+","} _3.push(_6+_2[i])} return _3},isc.A.parseTree=function isc_c_MockDataSource_parseTree(_1){var _2=_1.split("\n");var _3=[];var _4;var _5=0;for(var i=0;i<_2.length;i++){var _7={};var _8=_2[i].split("");var _9=0;for(var j=0;j<_8.length;j++){if(_8[j]==" "||_8[j]=="."){_9+=1}else{break}} var _11=_2[i].substr(_9);if(_11.startsWith("f")||_11.startsWith(">")||_11.startsWith("[x")||_11.startsWith("[+")){_7.isFolder=true}else if(_11.startsWith("F")||_11.startsWith("v")||_11.startsWith("[ ")||_11.startsWith("[-")){_7.isFolder=true;_7.isOpen=true} var _12=isc.CheckboxItem.getInstanceProperty("checkedImage");var _13=isc.CheckboxItem.getInstanceProperty("uncheckedImage");if(_11.startsWith("f")){}else if(_11.startsWith(">")){}else if(_11.startsWith("[x")){_7.icon=_12}else if(_11.startsWith("[+")){}else if(_11.startsWith("F")){}else if(_11.startsWith("v")){}else if(_11.startsWith("[ ")){_7.icon=_13}else if(_11.startsWith("[-")){}else if(_11.startsWith("-")){_7.isFolder=false}else if(_11.startsWith("_")){_7.icon=isc.Canvas.$wz;_7.isOpen=true} if(_11.startsWith("["))_11=_11.substr(3);else if(_7.isFolder)_11=_11.substr(1);else if(_11.startsWith("-")||_11.startsWith("_"))_11=_11.substr(1);_7.name=isc.MockDataSource.parseTextWikiSymbols(_11).trim();_7.children=[];if(_9==0){_3.add(_7)}else if(_9>_5){_4.children.add(_7);_7.parent=_4}else if(_9==_5){_4.parent.children.add(_7);_7.parent=_4.parent}else{var _14=_5;var _15=_4.parent;while(_14>_9){_15=_15.parent;_14-=1} _15.children.add(_7);_7.parent=_15} _4=_7;_5=_9} return _3},isc.A.getGridSettings=function isc_c_MockDataSource_getGridSettings(_1,_2){if(!_1)_1={};var _3=_1.dataSource.MockDataSource.mockData;_1.autoFetchData=true;if(isc.isA.TreeGrid(this.creator)){_1.dataProperties={openProperty:"isOpen"};return _1} var _4=_3,_5=_4.split("\n")[0],_6=_5.split(","),_7=1;for(var i=0;i<_6.length;i++){if(_6[i].endsWith(" ^")||_6[i].endsWith(" v")||_6[i].endsWith(" ^v")) {var _9=_6[i].substring(0,_6[i].length-2).trim();_1.dataSource.MockDataSource.mockData=_3=_3.replace(_6[i],_9)} _7=Math.max(_7,_6[i].split("\\r").length)} _1.headerHeight=Math.max(25,15*_7);_1.autoFitFieldWidths=true;_1.autoFitWidthApproach="title";if(_1.leaveScrollbarGap==null){_1.leaveScrollbarGap=false} var _10=isc.MockDataSource.parseTableFields(_4,_2),_11=isc.MockDataSource.parseTableFields(_3,_2),_12=isc.MockDataSource.parseTable(_4);for(var i=0;i<_10.length;i++){var _13=_10[i].title;if(_13.endsWith(" ^")){_1.sortField=_11[i].name}else if(_13.endsWith(" v")){_1.sortField=_11[i].name;_1.sortDirection="descending"}} _1.dataSource.MockDataSource.fields=_11;_1.dataSource.MockDataSource.cacheData=_12;return _1});isc.B._maxIndex=isc.C+8;isc.A=isc.MockDataSource.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.mockData="md";isc.A.mockDataType="grid";isc.A.clientOnly=true;isc.A.cacheData=[];isc.A.fields=[];isc.B.push(isc.A.init=function isc_MockDataSource_init(){if(this.mockDataType=="grid"){this.fields=isc.MockDataSource.parseTableFields(this.mockData);this.cacheData=isc.MockDataSource.parseTable(this.mockData)}else if(this.mockDataType=="tree"){this.fields=[{name:"name",type:"text"}];this.cacheData=isc.MockDataSource.parseTree(this.mockData)} return this.Super("init",arguments)});isc.B._maxIndex=isc.C+1;isc.defineClass("DataView",isc.VLayout);isc.A=isc.DataView.getPrototype();isc.A.autoLoadServices=true;isc.A.autoBindDBCs=true;isc.A=isc.Canvas.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.dataViewInit=function isc_Canvas_dataViewInit(){var _1=this.operations;if(_1==null){this.bindToServices();return} this.operations.setProperty("dataView",this);if(!this.autoLoadServices)return;var _2=_1.getProperty("location").getUniqueItems();this.logInfo("loading services: "+_2);this.$72q=_2.length;var _3=this;for(var i=0;i<_2.length;i++){isc.xml.loadWSDL(_2[i],function(_5){_3.$72q--;_3.logInfo("service loaded: "+_5+", remaining: "+_3.$72q);if(_3.$72q==0){_3.dataViewLoaded();_3.bindToServices()}},null,true)}},isc.A.addVM=function isc_Canvas_addVM(_1){this.addedVMs=this.addedVMs||[];this.addedVMs.add(_1)},isc.A.bindToServices=function isc_Canvas_bindToServices(){if(!this.autoBindDBCs)return;var _1=this.getAllDBCs(this);if(!_1)return;var _2=this.getAllVMs();if(this.logIsDebugEnabled("DataView")){this.logDebug("vms: "+this.echoAll(_2.getProperties(["dataSource","serviceNamespace","serviceName"]))+", all dbcs: "+this.echoAll(_1.getProperties(["dataSource","serviceNamespace","serviceName"])),"DataView")} for(var i=0;i<_1.length;i++){var _4=_1[i];if(_4.dataSource){if(this.canEdit!=null&&_4.canEdit==null)_4.setCanEdit(this.canEdit);var _5=this.findVM(_4,_2);if(_5){if(this.logIsInfoEnabled("dataRegistration")){this.logWarn("dbc: "+_4+" binding to dataSource: "+_4.dataSource+" and vm: "+_5+", with fields: "+this.echoAll(_4.originalFields),"dataRegistration")} if(_4.originalFields)_4.setDataSource(_4.dataSource,_4.originalFields);_5.addMember(_4)}else{this.logInfo("no VM for DBC: "+this.echoLeaf(_4),"DataView")}} if(isc.isA.DynamicForm(_4)&&_4.items){_4.items.map("registerWithDataView",this)}}},isc.A.getAllVMs=function isc_Canvas_getAllVMs(){var _1=[];var _2=this.operations;if(_2){_1.addAll(_2.getProperty("inputVM"));_1.addAll(_2.getProperty("outputVM"))} _1.addAll(this.addedVMs);_1.removeList([null]);return _1},isc.A.findVM=function isc_Canvas_findVM(_1,_2){if(!_2)_2=this.getAllVMs();var _3=(isc.isA.DataSource(_1)?_1:_1.getDataSource());for(var i=0;i<_2.length;i++){var _5=_2[i];if(_3==_5.getDataSource())return _5}},isc.A.getAllDBCs=function isc_Canvas_getAllDBCs(_1){var _2=_1.children;if(!_2)return null;var _3=[];for(var i=0;i<_2.length;i++){var _1=_2[i];if(isc.isA.DataBoundComponent(_1))_3.add(_1);_3.addAll(this.getAllDBCs(_1))} return _3},isc.A.registerItem=function isc_Canvas_registerItem(_1){if(!_1.inputDataPath)return;var _2=isc.WebService.getByName(_1.inputServiceName,_1.inputServiceNamespace);if(!_2){this.logWarn("Member: "+_1+" could not find webService with name '"+_1.inputServiceName+"', namespace '"+_1.inputServiceNamespace+"'. Has it been loaded?");return} var _3=_1.inputSchemaDataSource;var _4=this.itemRegistry=this.itemRegistry||{};var _5=_4[_3]=_4[_3]||[];_5.add(_1)},isc.A.populateListeners=function isc_Canvas_populateListeners(_1){var _2=_1.getDataSource().getID();var _3=this.itemRegistry;if(this.logIsInfoEnabled("DataView")){this.logInfo("message: "+_2+", registry: "+this.echo(_3)+", data: "+this.echo(_1.getValues()),"DataView")} if(!_3)return;var _4=_3[_2];if(!_4)return;for(var i=0;i<_4.length;i++){var _6=_4[i];var _7=_1.getValue(_6.inputDataPath);this.logWarn("component: "+_6+" with inputDataPath: "+_6.inputDataPath+" got data: "+this.echo(_7));if(isc.isA.FormItem(_6)){_6.setValue(_7)}else{_6.setData(_7)}}},isc.A.dataViewLoaded=function isc_Canvas_dataViewLoaded(){});isc.B._maxIndex=isc.C+9;isc.DataView.registerStringMethods({dataViewLoaded:""});isc.defineClass("ServiceOperation").addClassMethods({getServiceOperation:function(_1,_2,_3){if(this.$725)return this.$725.find({operationName:_1,serviceName:_2,serviceNamespace:_3})}});isc.A=isc.ServiceOperation.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.init=function isc_ServiceOperation_init(){isc.ClassFactory.addGlobalID(this);this.Super("init",arguments);if(!isc.ServiceOperation.$725)isc.ServiceOperation.$725=[];isc.ServiceOperation.$725.add(this)},isc.A.invoke=function isc_ServiceOperation_invoke(){var _1=this.service=isc.WebService.getByName(this.serviceName,this.serviceNamespace);if(!_1){this.logWarn("Unable to find web service with serviceName '"+this.serviceName+"' and serviceNamespace '"+this.serviceNamespace+"'. Has it been loaded?");return} var _2=this.inputVM.getValues();if(_1.useSimplifiedInputs(this.operationName)){_2=_2[isc.firstKey(_2)]} var _3=this;_1.callOperation(this.operationName,_2,null,function(_2,_4,_5,_6){_3.invocationCallback(_2,_4,_5,_6)})},isc.A.invocationCallback=function isc_ServiceOperation_invocationCallback(_1,_2,_3,_4){if(!this.outputVM)return;if(this.service.getSoapStyle(this.operationName)=="document"){var _5=this.outputVM.getDataSource().getFieldNames();if(_5.length==1){var _6=_5.first(),_7={};_7[_6]=_1;_1=_7}} this.outputVM.setValues(_1);if(this.logIsInfoEnabled()){this.logInfo("populating listeners on dataView: "+this.dataView+", vm has values: "+this.echo(this.outputVM.getValues()))} if(this.dataView)this.dataView.populateListeners(this.outputVM)});isc.B._maxIndex=isc.C+3;(function(){var Offline={explicitOffline:null,isOffline:function(){if(this.explicitOffline!==null)return this.explicitOffline;var offline=window.navigator.onLine?false:true;return offline},goOffline:function(){this.explicitOffline=true},goOnline:function(){this.explicitOffline=false},useNativeOfflineDetection:function(){this.explicitOffline=null},KEY_PREFIX:"isc-",LOCAL_STORAGE:"localStorage",GLOBAL_STORAGE:"globalStorage",DATABASE_STORAGE:"databaseStorage",GEARS_DATABASE_API:"gears database api",USERDATA_PERSISTENCE:"userData persistence",GOOGLE_GEARS:"google gears",NO_MECHANISM:"no discovered mechanism",maxResponsesToPersist:100,userDataPersistenceInIE8:false,localStorageType:function(){if(window.localStorage){if(!this.userDataPersistenceInIE8||!isc.Browser.isIE){return this.LOCAL_STORAGE}} if(window.globalStorage)return this.GLOBAL_STORAGE;if(window.openDatabase)return this.DATABASE_STORAGE;if(isc.Browser.isIE&&isc.Browser.version>=5){if(!UserDataPersistence.isInitialized)UserDataPersistence.init();return this.USERDATA_PERSISTENCE} return this.NO_MECHANISM},getNativeStoredValuesCount:function(){switch(this.localStorageType()){case this.LOCAL_STORAGE:return localStorage.length;break;case this.USERDATA_PERSISTENCE:return UserDataPersistence.getNativeStoredValuesCount();break;case this.GLOBAL_STORAGE:case this.DATABASE_STORAGE:case this.GEARS_DATABASE_API:case this.GOOGLE_GEARS:break}},getSCStoredValuesCount:function(){var entries=this.get(this.countKey);entries=entries?entries*1:0;return entries},getKeyForNativeIndex:function(index){switch(this.localStorageType()){case this.LOCAL_STORAGE:return localStorage.key(index);case this.USERDATA_PERSISTENCE:return UserDataPersistence.getKeyForNativeIndex(index);break;case this.GLOBAL_STORAGE:case this.DATABASE_STORAGE:case this.GEARS_DATABASE_API:case this.GOOGLE_GEARS:break}},clearCache:function(){var count=this.getSCStoredValuesCount();while(this.getSCStoredValuesCount()>0){this.removeOldestEntry();if(this.getSCStoredValuesCount()==count)break;count=this.getSCStoredValuesCount()}},clearCacheNatively:function(){if(this.localStorageType()==this.USERDATA_PERSISTENCE){UserDataPersistence.clearCacheNatively();return} var count=this.getNativeStoredValuesCount();this.logDebug("Removing all "+count+" entries from local storage");for(var i=0;imaxEntryLength){value=value.substring(0,maxEntryLength)} this.logDebug(key+" ===> "+value)}},getCacheContents:function(){var index=0,contents={},count=this.getSCStoredValuesCount();while(indexmaxEntryLength){value=value.substring(0,maxEntryLength)+"..."} this.logDebug(key+" ===> "+value)}},put:function(key,value,recycleEntries){var ts=new Date().getTime();var oldValue=this.get(key);while(true){try{this.$788(key,value);break}catch(e){if(recycleEntries!==false&&this.isStorageException(e)){var entries=this.getStorageMetrics().storedEntries;if(entries>0){this.logDebug("Cache full; removing oldest entry and trying again");this.removeOldestEntry()}else{this.logDebug("Can't add this entry to browser-local storage, even though the cache is empty - the item must be larger than the browser's permitted cache space.");break}}else{throw e}}} var end=new Date().getTime();var pqOK=false,metricsOK=false;while(!pqOK||!metricsOK){try{if(!pqOK)this.addToPriorityQueue(key);pqOK=true;if(!metricsOK)this.updateMetrics("put",key,value,oldValue);metricsOK=true}catch(e){if(this.isStorageException(e)){if(recycleEntries!==false){var entries=this.getStorageMetrics().storedEntries;if(entries>0){this.logDebug("Cache full when updating priority queue or metrics; removing oldest entry and trying again");this.removeOldestEntry();continue}} this.logDebug("Cache full when updating priority queue or metrics; rolling back the entire update");this.$786(key);if(pqOK)this.removeFromPriorityQueue(key);this.rebuildMetrics();throw e}else{throw e}}} this.logDebug("put() with key: "+key+"\nitem: "+this.echoLeaf(value)+": "+(end-ts)+"ms. Maintaining the priority queue and metrics took a further "+new Date().getTime()-end+"ms")},$788:function(key,value,applyPrefix){key=(applyPrefix===false?"":this.KEY_PREFIX)+key;switch(this.localStorageType()){case this.LOCAL_STORAGE:localStorage.setItem(key,value);break;case this.USERDATA_PERSISTENCE:UserDataPersistence.putValue(key,value);break;case this.GLOBAL_STORAGE:case this.DATABASE_STORAGE:case this.GEARS_DATABASE_API:case this.GOOGLE_GEARS:this.logError("Persistence method '"+this.localStorageType()+"' not yet supported");break}},isStorageException:function(e){switch(this.localStorageType()){case this.LOCAL_STORAGE:if(isc.Browser.isIE){return(e.number==-2147024882)}else if(isc.Browser.isMoz){return(e.name=="NS_ERROR_DOM_QUOTA_REACHED")}else{return(e.name=="QUOTA_EXCEEDED_ERR")} break;case this.USERDATA_PERSISTENCE:return(e.number==-2147024857)}},get:function(key){var ts=new Date().getTime(),item;switch(this.localStorageType()){case this.LOCAL_STORAGE:item=localStorage.getItem(this.KEY_PREFIX+key);break;case this.USERDATA_PERSISTENCE:item=UserDataPersistence.getValue(this.KEY_PREFIX+key);break;case this.GLOBAL_STORAGE:case this.DATABASE_STORAGE:case this.GEARS_DATABASE_API:case this.GOOGLE_GEARS:break} if(item)item=isc.clone(item);var end=new Date().getTime();this.logDebug("get() with key: "+key+"\nitem is: "+this.echoLeaf(item)+": "+(end-ts)+"ms");return item},remove:function(key,skipPriorityQueueUpdate){this.logDebug("Removing item for key: "+key);this.updateMetrics("remove",key);if(!skipPriorityQueueUpdate)this.removeFromPriorityQueue(key);this.$786(key)},$786:function(key,applyPrefix){key=(applyPrefix===false?"":this.KEY_PREFIX)+key;switch(this.localStorageType()){case this.LOCAL_STORAGE:localStorage.removeItem(key);break;case this.USERDATA_PERSISTENCE:UserDataPersistence.removeValue(key);break;case this.GLOBAL_STORAGE:case this.DATABASE_STORAGE:case this.GEARS_DATABASE_API:case this.GOOGLE_GEARS:break}},getUndecoratedKey:function(key){if(key&&key.startsWith(this.KEY_PREFIX)){key=key.substring(this.KEY_PREFIX.length)} return key},priorityQueueKey:"pq",addToPriorityQueue:function(userKey){this.removeFromPriorityQueue(userKey);var key=this.toInternalKey(userKey);var pqText=this.get(this.priorityQueueKey);if(pqText){eval("var pq = "+pqText)}else{var pq=[]} pq.push(key);this.$788(this.priorityQueueKey,this.serialize(pq))},removeFromPriorityQueue:function(userKey){var key=this.toInternalKey(userKey);var pqText=this.get(this.priorityQueueKey);if(pqText){eval("var pq = "+pqText)}else{var pq=[]} for(var i=0;i=this.maxResponsesToPersist){this.removeOldestEntry()}} this.put(key,value)},trimRequest:function(dsRequest){var keyProps=["dataSource","operationType","operationId","textMatchStyle","values","sortBy","startRow","endRow","data"],trimmed={},undef;for(var i=0;i0){this.userDataSpan[i].removeAttribute(attrs[0].name)}} this.keyIndex={};this.reverseKeyIndex={};this.saveKeyIndex()},getNativeStoredValuesCount:function(){var count=0;for(var i=0;iindex){var offsetIndex=index-iCounter;var attrName=this.userDataSpan[i].xmlDocument.firstChild.attributes[offsetIndex].name,attrNum=attrName.substring(1),dsKey=this.getKeyIndexValue(i,attrNum);return this.getUserKey(dsKey)}}},getKeyIndexValue:function(index,attrName){var attrNum=attrName.substring(1);if(index==0){return"00000".substring(attrNum.length)+attrNum} return index*10000+(1*attrNum)},getUserKey:function(userKey){return this.reverseKeyIndex[userKey]},getDataStoreKey:function(key){return this.keyIndex[key]},$70p:function(dataStore,attr){return this.userDataSpan[dataStore].getAttribute(attr)},getValue:function(userKey){var key=this.getDataStoreKey(userKey),undef;if(key===undef)return null;var dataStore=(""+key).substring(0,1),attr="v"+((""+key).substring(1)*1);return this.$70p(dataStore,attr)},putValue:function(userKey,value){var key=this.getDataStoreKey(userKey);if(key){var dataStore=(""+key).substring(0,1),attr="v"+((""+key).substring(1)*1),savedValue=this.$70p(dataStore,attr)}else{var dataStore=this.getDataStoreForNewItem(),attr=this.getNextAttributeName(dataStore)} this.userDataSpan[dataStore].setAttribute(attr,value);try{this.userDataSpan[dataStore].save("isc_userData_"+dataStore);this.addToKeyIndex(userKey,dataStore,attr)}catch(e){if(isc.Offline.isStorageException(e)){if(savedValue){this.userDataSpan[dataStore].setAttribute(attr,savedValue)}else{this.userDataSpan[dataStore].removeAttribute(attr);this.removeFromKeyIndex(userKey)}} throw e}},removeValue:function(userKey){var key=this.getDataStoreKey(userKey),undef;if(key===undef){Offline.logDebug("userData: in removeValue, no value for key '"+userKey+"' was found");return} var dataStore=(""+key).substring(0,1),attr="v"+((""+key).substring(1)*1);this.userDataSpan[dataStore].removeAttribute(attr);this.userDataSpan[dataStore].save("isc_userData_"+dataStore);this.removeFromKeyIndex(userKey);this.unusedAttributeNumbers[dataStore].push(attr.substring(1)*1)},getDataStoreForNewItem:function(){var undef;if(this.nextDataStoreToUse===undef){this.nextDataStoreToUse=Math.floor(Math.random()*this.poolSize)} var rtnValue=this.nextDataStoreToUse++;if(this.nextDataStoreToUse>=this.poolSize)this.nextDataStoreToUse=0;return rtnValue},buildNextAttributeInfo:function(){this.nextAttributeNumber=[];this.unusedAttributeNumbers=[];for(var i=0;i0) {return"v"+this.unusedAttributeNumbers[dataStore].shift()} if(this.nextAttributeNumber[dataStore]==null){this.nextAttributeNumber[dataStore]=1} return"v"+this.nextAttributeNumber[dataStore]++},addToKeyIndex:function(userKey,dataStore,attr){var keyIndexValue=this.getKeyIndexValue(dataStore,attr);this.keyIndex[userKey]=keyIndexValue;this.reverseKeyIndex[keyIndexValue]=userKey;this.saveKeyIndex()},removeFromKeyIndex:function(userKey){var keyIndexValue=this.keyIndex[userKey];delete this.keyIndex[userKey];delete this.reverseKeyIndex[keyIndexValue];this.saveKeyIndex()},saveKeyIndex:function(){this.keyIndexStore.setAttribute(this.keyIndexKey,Offline.serialize(this.keyIndex));this.keyIndexStore.setAttribute(this.reverseKeyIndexKey,Offline.serialize(this.reverseKeyIndex));this.keyIndexStore.save("isc_userData_keyIndex")},buildReverseKeyIndex:function(){this.reverseKeyIndex={};for(var key in this.keyIndex){this.reverseKeyIndex[keyIndex[key]]=key}},getKeyIndexFromStore:function(){var kiText=this.keyIndexStore.getAttribute(this.keyIndexKey);if(kiText){eval("var ki = "+kiText)}else{var ki=null} return ki},getReverseKeyIndexFromStore:function(){var kiText=this.keyIndexStore.getAttribute(this.reverseKeyIndexKey);if(kiText){eval("var ki = "+kiText)}else{var ki=null} return ki}};if(window.isc){isc.defineClass("Offline").addClassProperties(Offline);isc.defineClass("UserDataPersistence").addClassProperties(UserDataPersistence)}else{isc.addProperties=function(objOne,objTwo){for(var propName in objTwo)objOne[propName]=objTwo[propName]} isc.addProperties(isc.Offline,{serialize:function(object){return isc.OfflineJSONEncoder.encode(object)},logDebug:function(message){if(console)console.log(message)},logError:function(message){if(console){console.log(message)}else{alert(message)}},echoLeaf:function(obj){var output="",undef;if(obj===undef)return"undef";try{if(typeof obj=="Array"){output+="Array["+obj.length+"]"}else if(typeof obj=="Date"){output+="Date("+obj.toShortDate()+")"}else if(typeof obj=="Function"){output+=isc.Func.getName(obj,true)+"()"}else{switch(typeof obj){case"string":if(obj.length<=40){output+='"'+obj+'"';break} output+='"'+obj.substring(0,40)+'..."['+obj.length+']';output=output.replaceAll("\n","\\n").replaceAll("\r","\\r");break;case"object":if(obj==null){output+="null";break} if(obj.tagName!=null){output+="["+obj.tagName+"Element]";break} var toString=""+obj;if(toString!=""&&toString!="[object Object]"&&toString!="[object]") {output+=toString;break} output+="Obj";break;default:output+=""+obj}} return output}catch(e){var message="[Error in echoLeaf: "+e+"]";output+=message;return output}},echo:function(object){return this.serialize(object)}});isc.OfflineJSONEncoder={$zm:function(objRefs,object,path){objRefs.obj.add(object);objRefs.path.add(path)},$42b:function(object){var treeId=object["$42c"];if(treeId!=null){var theTree=window[treeId];if(theTree&&theTree.parentProperty&&object[theTree.parentProperty]){object=theTree.getCleanNodeData(object)}} return object},$zl:function(objRefs,object){var rowNum=objRefs.obj.indexOf(object);if(rowNum==-1)return null;return objRefs.path[rowNum]},$zp:function(objPath,newIdentifier){if(isc.isA.Number(newIdentifier)){return objPath+"["+newIdentifier+"]"}else if(!isc.Comm.$zk.test(newIdentifier)) {return objPath+'["'+newIdentifier+'"]'}else{return objPath+"."+newIdentifier}},encode:function(object){this.objRefs={obj:[],path:[]};var retVal=this.$eu(object,this.prettyPrint?"":null,null);this.objRefs=null;return retVal},dateFormat:"xmlSchema",encodeDate:function(date){if(this.dateFormat=="dateConstructor"){return"new Date("+date.getTime()+")"}else{return'"'+this.toSchemaDate(date)+'"'}},toSchemaDate:function(date){var dd=""+date.getDate(),mm=""+(date.getMonth()+1),yyyy=""+(date.getyear()+1900),hh=""+date.getHours(),mi=""+date.getMinutes(),ss=""+date.getSeconds();dd=dd.length==1?"0"+dd:dd;mm=mm.length==1?"0"+mm:mm;hh=hh.length==1?"0"+hh:ff;mi=mi.length==1?"0"+mi:mi;ss=ss.length==1?"0"+ss:ss;return yyyy+"-"+mm+"-"+dd+"T"+hh+":"+mi+":"+ss},strictQuoting:true,circularReferenceMode:"path",circularReferenceMarker:"$$BACKREF$$",prettyPrint:false,$eu:function(object,prefix,objPath){if(!objPath){if(object&&object.getID)objPath=object.getID();else objPath=""} if(object==null)return null;if(this.isAString(object))return this.asSource(object);if(this.isAFunction(object))return null;if(this.isANumber(object)||this.isASpecialNumber(object))return object;if(this.isABoolean(object))return object;if(this.isADate(object))return this.encodeDate(object);if(this.isAnInstance(object))return null;var prevPath=this.$zl(this.objRefs,object);if(prevPath!=null&&objPath.contains(prevPath)){var nextChar=objPath.substring(prevPath.length,prevPath.length+1);if(nextChar=="."||nextChar=="["||nextChar=="]"){var mode=this.circularReferenceMode;if(mode=="marker"){return"'"+this.circularReferenceMarker+"'"}else if(mode=="path"){return"'"+this.circularReferenceMarker+":"+prevPath+"'"}else{return null}}} if(this.isAClassObject(object))return null;if(object==window)return null;this.$zm(this.objRefs,object,objPath);if(this.isAFunction(object.$eu)){return object.$eu(prefix,this.objRefs,objPath)} if(this.isAnArray(object)){return this.$zn(object,objPath,this.objRefs,prefix)} var data;if(object.getSerializeableFields){data=object.getSerializeableFields([],[])}else{data=object} return this.$zo(data,objPath,this.objRefs,prefix)},$zn:function(object,objPath,objRefs,prefix){var output="[";for(var i=0,len=object.length;i-1)output=output.substring(0,commaChar);if(prefix!=null)output+="\r"+prefix;output+="]";return output},$zo:function(object,objPath,objRefs,prefix){var output="{",undef;object=this.$42b(object);try{for(var key in object)break}catch(e){return null} for(var key in object){if(key==null)continue;if(key=="xmlHttpRequest")continue;if(key.substring(0,1)=="_"||key.substring(0,1)=="$")continue;var value=object[key];if(this.isAFunction(value))continue;if(this.isAnInstance(value))continue;var keyStr=key.toString();keyStr='"'+keyStr+'"';var objPath=this.$zp(objPath,key);var serializedValue;if(key!="__ref"&&key!="__module"){serializedValue=this.$eu(value,(prefix!=null?prefix:null),objPath)} if(prefix!=null)output+="\r"+prefix;output+=keyStr+":"+serializedValue+",";if(prefix!=null)output.append(" ")} var commaChar=output.lastIndexOf(",");if(commaChar>-1)output=output.substring(0,commaChar);if(prefix!=null)output+="\r"+prefix;output+="}";return output},isAString:function(object){if(object==null)return false;if(typeof object==this.$a7)return false;if(object.constructor&&object.constructor.$k!=null){return object.constructor.$k==4} if(object.Class!=null&&object.Class==this.$73x)return true;return typeof object=="string"},isAnArray:function(object){if(object==null)return false;if(typeof object==this.$a7)return false;if(object.constructor&&object.constructor.$k!=null){return object.constructor.$k==2} if(isc.Browser.isSafari)return""+object.splice=="(Internal function)";return""+object.constructor==""+Array},isAFunction:function(object){if(object==null)return false;if(isc.Browser.isIE&&typeof object==this.$a7)return true;var cons=object.constructor;if(cons&&cons.$k!=null){if(cons.$k!=1)return false;if(cons===Function)return true} return isc.Browser.isIE?(isc.emptyString+object.constructor==Function.toString()):(typeof object==this.$a7)},isANumber:function(object){if(object==null)return false;if(object.constructor&&object.constructor.$k!=null){if(object.constructor.$k!=5)return false}else{if(typeof object!="number")return false} return!isNaN(object)&&object!=Number.POSITIVE_INFINITY&&object!=Number.NEGATIVE_INFINITY},isASpecialNumber:function(object){if(object==null)return false;if(object.constructor&&object.constructor.$k!=null){if(object.constructor.$k!=5)return false}else{if(typeof object!="number")return false} return(isNaN(object)||object==Number.POSITIVE_INFINITY||object==Number.NEGATIVE_INFINITY)},isABoolean:function(object){if(object==null)return false;if(object.constructor&&object.constructor.$k!=null){return object.constructor.$k==6} return typeof object=="boolean"},isADate:function(object){if(object==null)return false;if(object.constructor&&object.constructor.$k!=null){return object.constructor.$k==3} return(""+object.constructor)==(""+Date)&&object.getDate&&isc.isA.Number(object.getDate())},isAnXMLNode:function(object){if(object==null)return false;if(isc.Browser.isIE){return object.specified!=null&&object.parsed!=null&&object.nodeType!=null&&object.hasChildNodes!=null} var doc=object.ownerDocument;if(doc==null)return false;return doc.contentType==this.$bm},isAnInstance:function(object){return(object!=null&&object.$76y!=null)},isAClassObject:function(object){return(object!=null&&object.$bp==true)},asSource:function(string,singleQuote){if(!this.isAString(string))string=""+string;var quoteRegex=singleQuote?String.$ez:String.$e0,outerQuote=singleQuote?"'":'"';return outerQuote+string.replace(/\\/g,"\\\\").replace(quoteRegex,'\\'+outerQuote).replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/\n/g,"\\n")+outerQuote}}}})();isc.ClassFactory.defineClass("Rule","Validator");isc.defineClass("RulesEngine");isc.A=isc.RulesEngine.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.init=function isc_RulesEngine_init(){this.Super("init",arguments);isc.ClassFactory.addGlobalID(this);if(this.members==null)this.members=[];else{for(var i=0;i0)return this.processRules(_4);return null},isc.A.$89c=function isc_RulesEngine__processFieldTriggerEvent(_1,_2,_3){var _4=this.rulesData;if(!_4||_4.length==0)return;var _5=[];for(var i=0;i<_4.length;i++){if(_4[i].triggerEvent==_1){var _7=_4[i],_8=isc.Validator.getValidatorDefinition(_4[i].type),_9=null;if(!_8){this.logWarn("RulesEngine unable to process rule with invalid type: "+_4[i].type);continue} if(_7.dependentFields!=null){_9=_7.dependentFields}else if(_8.getDependentFields!=null){_9=_8.getDependentFields(_7,_1)} if(_9==null||isc.isAn.emptyArray(_9)){_9=(isc.isAn.Array(_7.fieldName)?_7.fieldName.duplicate():_7.fieldName)} if(_9!=null&&!isc.isAn.Array(_9)){_9=_9.split(",")} if(_7.applyWhen!=null){var _10=true;if(_7.dependsOnApplyWhenFields!=null){_10=_7.dependsOnApplyWhenFields}else if(_8.dependsOnApplyWhenFields!=null){_10=_7.dependsOnApplyWhenFields} if(_10){var _11=isc.DataSource.getCriteriaFields(_7.applyWhen);if(_9==null){_9=_11}else{_9.addList(_11)}}} if(_9){for(var j=0;j<_9.length;j++){var _13=_9[j].indexOf("."),_14=_9[j].substring(0,_13),_15=_9[j].substring(_13+1);if(_2.getDataSource()==isc.DataSource.get(_14)&&_15==_3.name) {_5.add(_4[i]);break}}}}} if(_5.length>0)return this.processRules(_5);return null},isc.A.getValues=function isc_RulesEngine_getValues(){if(this.ruleContext)return this.ruleContext;var _1={};for(var i=0;i0) {return _5} if(_3.endsWith("s")){_5=_4+this.$123a(_3.slice(0,-1));if(isc.isA.Function(_1[_5])&&isc.Func.getArgs(_1[_5]).length>0) {return _5}}},isc.A.$123a=function isc_Class__withInitialCaps(_1){return _1.substring(0,1).toLocaleUpperCase()+_1.substring(1)},isc.A.getEditableProperties=function isc_Class_getEditableProperties(_1){var _2={},_3;if(!this.editModeOriginalValues)this.editModeOriginalValues={};if(!isc.isAn.Array(_1))_1=[_1];for(var i=0;i<_1.length;i++){var _5=isc.isAn.Object(_1[i])?_1[i].name:_1[i];var _6=null;if(this.editModeOriginalValues[_5]===_3){this.logInfo("Field "+_5+" - value ["+this[_5]+"] is coming from live values","editModeOriginalValues");_6=this[_5];if(isc.isA.Function(_6)&&_6.$dw){_6=this[_6.$c1]}}else{this.logInfo("Field "+_5+" - value ["+this.editModeOriginalValues[_5]+"] is coming from original values","editModeOriginalValues");_6=this.editModeOriginalValues[_5]} _2[_5]=_6} return _2},isc.A.setEditableProperties=function isc_Class_setEditableProperties(_1){var _2;if(!this.editModeOriginalValues)this.editModeOriginalValues={};for(var _3 in _1){if(this.editModeOriginalValues[_3]===_2){this.logInfo("Field "+_3+" - value is going to live values","editModeOriginalValues");this.setProperty(_3,_1[_3])}else{this.logInfo("Field "+_3+" - value is going to original values","editModeOriginalValues");this.editModeOriginalValues[_3]=_1[_3]}} this.editablePropertiesUpdated(_1)},isc.A.setChildEditableProperties=function isc_Class_setChildEditableProperties(_1,_2,_3,_4){this.setDescendantEditableProperties(_1,_2,_3,_4,0)},isc.A.setDescendantEditableProperties=function isc_Class_setDescendantEditableProperties(_1,_2,_3,_4,_5){isc.addProperties(_1,_2)},isc.A.saveToOriginalValues=function isc_Class_saveToOriginalValues(_1){var _2;if(!this.editModeOriginalValues)this.editModeOriginalValues={};for(var i=0;i<_1.length;i++){var _4=isc.isAn.Object(_1[i])?_1[i].name:_1[i];if(this[_4]===_2){this.editModeOriginalValues[_4]=null}else{if(this[_4]&&this[_4].$dw){var _5=isc.$ah+_4;this.editModeOriginalValues[_4]=this[_5]}else{this.editModeOriginalValues[_4]=this[_4]}}}},isc.A.restoreFromOriginalValues=function isc_Class_restoreFromOriginalValues(_1){var _2;if(!this.editModeOriginalValues)this.editModeOriginalValues={};var _3="Retrieving fields from original values:" var _4={};for(var i=0;i<_1.length;i++){var _6=isc.isAn.Object(_1[i])?_1[i].name:_1[i];if(this.editModeOriginalValues[_6]!==_2){_4[_6]=this.editModeOriginalValues[_6];delete this.editModeOriginalValues[_6]}else{}} this.setProperties(_4)},isc.A.propertyHasBeenEdited=function isc_Class_propertyHasBeenEdited(_1){var _2;if(!this.editModeOriginalValues)return false;if(isc.isAn.Object(_1))_1=_1.name;if(this.editModeOriginalValues[_1]!==_2){if(isc.isA.Function(this.editModeOriginalValues[_1]))return false;if(this.editModeOriginalValues[_1]!=this[_1])return true} return false},isc.A.editablePropertiesUpdated=function isc_Class_editablePropertiesUpdated(_1,_2){if(!_2&&this.editContext&&this.editContext.editNodeUpdated){this.editContext.editNodeUpdated(this.editNode,this.editContext,isc.getKeys(_1))}});isc.B._maxIndex=isc.C+17;isc.A=isc.DataSource;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.getSchema=function isc_c_DataSource_getSchema(_1){if(isc.isA.Class(_1))return _1.getSchema();return isc.DS.get(_1.schemaName||_1._constructor||_1.Class)},isc.A.getObjectField=function isc_c_DataSource_getObjectField(_1,_2){if(_1==null)return null;if(isc.isA.Class(_1))return _1.getObjectField(_2);var _3=isc.DS.getSchema(_1);if(_3)return _3.getObjectField(_2)},isc.A.getSchemaField=function isc_c_DataSource_getSchemaField(_1,_2){var _3=isc.DS.getSchema(_1);if(_3)return _3.getField(_2)},isc.A.addChildObject=function isc_c_DataSource_addChildObject(_1,_2,_3,_4,_5){return this.$40k(_1,"add",_2,_3,_4,_5)},isc.A.removeChildObject=function isc_c_DataSource_removeChildObject(_1,_2,_3,_4){return this.$40k(_1,"remove",_2,_3,null,_4)},isc.A.$40k=function isc_c_DataSource__doVerbToChild(_1,_2,_3,_4,_5,_6){var _7=_6||isc.DS.getObjectField(_1,_3);if(_7==null){this.logWarn("No field for child of type "+_3);return false} this.logInfo(_2+" object "+this.echoLeaf(_4)+" in field: "+_7+" of parentObject: "+this.echoLeaf(_1),"editing");var _8=isc.DS.getSchemaField(_1,_7);if(isc.isA.Class(_1)){if(_1.$40k(_2,_3,_4,_5,_6))return true} if(!_8.multiple){if(_2=="add")_1[_7]=_4;else if(_2=="remove"){if(_1[_7]!=null)delete _1[_7]}else{this.logWarn("unrecognized verb: "+_2);return false} return true} this.logInfo("using direct Array manipulation for field '"+_7+"'","editing");var _9=_1[_7];if(_2=="add"){if(_9!=null&&!isc.isAn.Array(_9)){this.logWarn("unexpected field value: "+this.echoLeaf(_9)+" in field '"+_7+"' when trying to add child: "+this.echoLeaf(_4));return false} if(_9==null)_1[_7]=_9=[];if(_5!=null)_9.addAt(_4,_5);else _9.add(_4)}else if(_2=="remove"){if(!isc.isAn.Array(_9))return false;if(_5!=null)_9.removeAt(_4,_5);else _9.remove(_4)}else{this.logWarn("unrecognized verb: "+_2);return false} return true},isc.A.getChildObject=function isc_c_DataSource_getChildObject(_1,_2,_3,_4,_5){if(isc.isA.Class(_1))return _1.getChildObject(_2,_3,_4,_5);var _6=isc.DS.getObjectField(_1,_2),_7=isc.DS.getSchemaField(_1,_6);var _8=_1[_6];if(!_7.multiple)return _8;if(!isc.isAn.Array(_8))return null;return isc.Class.getArrayItem(_3,_8,_5)},isc.A.getAutoIdField=function isc_c_DataSource_getAutoIdField(_1){var _2=this.getNearestSchema(_1);return _2?_2.getAutoIdField():"ID"},isc.A.getAutoId=function isc_c_DataSource_getAutoId(_1){var _2=this.getAutoIdField(_1);return _2?_1[_2]:null});isc.B._maxIndex=isc.C+9;isc.A=isc.DataSource.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.getAutoIdField=function isc_DataSource_getAutoIdField(){return this.getInheritedProperty("autoIdField")||"ID"},isc.A.shouldCreateStandalone=function isc_DataSource_shouldCreateStandalone(){if(this.createStandalone!=null)return this.createStandalone;if(!this.superDS())return true;return this.superDS().shouldCreateStandalone()});isc.B._maxIndex=isc.C+2;isc.A=isc.StatefulCanvas.getPrototype();isc.A.editProxyConstructor="StatefulCanvasEditProxy";isc.A=isc.Label.getPrototype();isc.A.editProxyConstructor="LabelEditProxy";isc.A=isc.Progressbar.getPrototype();isc.A.editProxyConstructor="ProgressbarEditProxy";isc.A=isc.MenuButton.getPrototype();isc.A.editProxyConstructor="MenuEditProxy";isc.A=isc.MenuBar.getPrototype();isc.A.editProxyConstructor="MenuEditProxy";if(isc.TabSet){isc.A=isc.TabSet.getPrototype();isc.A.editProxyConstructor="TabSetEditProxy";isc.A.defaultPaneConstructor="VLayout";isc.A=isc.TabBar.getPrototype();isc.A.editProxyConstructor="TabBarEditProxy"} isc.A=isc.Layout.getPrototype();isc.A.editProxyConstructor="LayoutEditProxy";isc.A=isc.SplitPane.getPrototype();isc.A.editProxyConstructor="SplitPaneEditProxy";isc.A=isc.Deck.getPrototype();isc.A.editProxyConstructor="DeckEditProxy";isc.A=isc.NavPanel.getPrototype();isc.A.editProxyConstructor="NavPanelEditProxy";isc.A=isc.Window.getPrototype();isc.A.editProxyConstructor="WindowEditProxy";isc.A=isc.DetailViewer.getPrototype();isc.A.editProxyConstructor="DetailViewerEditProxy";isc.A=isc.Portlet;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.shouldPersistCoordinates=function isc_c_Portlet_shouldPersistCoordinates(_1,_2){if(_1.persistCoordinates==false)return false;var _3=_1.getEditNodeTree().getParent(_2);if(!_3)return false;var _4=_3.liveObject;return(_4&&!_4.editProxy||_4.editProxy.persistCoordinates!=false)});isc.B._maxIndex=isc.C+1;isc.A=isc.Portlet.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.editProxyConstructor="PortletEditProxy";isc.B.push(isc.A.updateEditNode=function isc_Portlet_updateEditNode(_1,_2){if(isc.Portlet.shouldPersistCoordinates(_1,_2)){var _3=this._percent_width||this.$pn;if(_3){_1.setNodeProperties(_2,{width:_3},true)}else{_1.removeNodeProperties(_2,"width")}}});isc.B._maxIndex=isc.C+1;isc.A=isc.PortalRow.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.updateEditNode=function isc_PortalRow_updateEditNode(_1,_2){if(isc.Portlet.shouldPersistCoordinates(_1,_2)){var _3=this._percent_height||this.$po;if(_3){_1.setNodeProperties(_2,{height:_3},true)}else{_1.removeNodeProperties(_2,"height")}}},isc.A.wrapChildNode=function isc_PortalRow_wrapChildNode(_1,_2,_3,_4){var _5=_2.liveObject;if(isc.isA.Portlet(_5)){return _3}else{var _6=_1.makeEditNode({type:"Portlet",defaults:{title:_2.title,destroyOnClose:true}});_1.addNode(_6,_3,_4);return _6}},isc.A.handleDroppedEditNode=function isc_PortalRow_handleDroppedEditNode(_1,_2){var _3=this.editContext;var _4=this.editNode;if(isc.isA.Palette(_1)){var _5=_1.transferDragData(),_6=(_3?_3.makeEditNode(isc.isAn.Array(_5)?_5[0]:_5):null);if(_3&&_4){_3.addNode(_6,_4,_2);return false}else{if(isc.isA.Portlet(_6.liveObject)){_1=_6.liveObject}else{_1=isc.Portlet.create({autoDraw:false,title:_6.title,items:[_6.liveObject],destroyOnClose:true})}}} return _1});isc.B._maxIndex=isc.C+3;isc.A=isc.PortalColumnBody.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.handleDroppedEditNode=function isc_PortalColumnBody_handleDroppedEditNode(_1,_2){var _3=this.creator.editContext;var _4=this.creator.editNode;if(isc.isA.Palette(_1)){var _5=_1.transferDragData(),_6=(_3?_3.makeEditNode(isc.isAn.Array(_5)?_5[0]:_5):null);if(_3&&_4){_3.addNode(_6,_4,_2);return false}else{if(isc.isA.Portlet(_6.liveObject)){_1=_6.liveObject}else{_1=isc.Portlet.create({autoDraw:false,title:_6.title,items:[_6.liveObject],destroyOnClose:true})}}} if(_1){var _7=_1.portalRow;if(_7&&_7.parentElement==this&&_7.getMembers().length==1){if(_3&&_4&&_7.editNode){var _8=this.getMemberNumber(_7);if(_2==_8||_2==_8+1)return;_3.removeNode(_7.editNode);if(_8<_2)_2-=1;_3.addNode(_7.editNode,_4,_2);return null}}else{if(_3&&_4&&_1.editNode){_3.addNode(_1.editNode,_4,_2);return null}}} return _1});isc.B._maxIndex=isc.C+1;isc.A=isc.PortalColumn.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.editProxyConstructor="PortalColumnEditProxy";isc.B.push(isc.A.wrapChildNode=function isc_PortalColumn_wrapChildNode(_1,_2,_3,_4){var _5=_2.liveObject;if(isc.isA.PortalRow(_5)||_2.type=="PortalRow"){return _3}else if(isc.isA.Portlet(_5)){var _6=_1.makeEditNode({type:this.rowConstructor,defaults:{}});_1.addNode(_6,_3,_4);return _6}else{var _7=_1.makeEditNode({type:"Portlet",defaults:{title:_2.title,destroyOnClose:true}});_1.addNode(_7,_3,_4);return _7}},isc.A.updateEditNode=function isc_PortalColumn_updateEditNode(_1,_2){if(isc.Portlet.shouldPersistCoordinates(_1,_2)){var _3=this._percent_width||this.$pn;if(_3){_1.setNodeProperties(_2,{width:_3},true)}else{_1.removeNodeProperties(_2,"width")}}});isc.B._maxIndex=isc.C+2;isc.A=isc.PortalLayout.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.addedToEditContext=function isc_PortalLayout_addedToEditContext(_1,_2){for(var i=0;i0){_2=_1[0].left;_3=_2+_1[0].width;_4=_1[0].top;_5=_4+_1[0].height} for(var i=1;i<_1.length;i++){var _7=_1[i],_8=(_7.getVisibleHeight?_7.getVisibleHeight():_7.height);if(_7.left<_2)_2=_7.left;if((_7.left+_7.width)>_3)_3=_7.left+_7.width;if(_7.top<_4)_4=_7.top;if((_7.top+_8)>_5)_5=_7.top+_8} return[_2,_4,_3-_2,_5-_4]},show:function(){this.showOverSelection();return this.Super("show",arguments)},setRect:function(_1,_2,_3,_4,_5){this.$146h=true;this.Super("setRect",arguments);this.$146h=false},showOverSelection:function(){var _1=this.selection;if(_1!=null){for(var i=0,_3=_1.length;i<_3;++i){var _4=_1[i];if(isc.isA.Canvas(_4)){this.moveAbove(_4)}else if(isc.isA.DrawItem&&isc.isA.DrawItem(_4)&&_4.drawPane!=null){this.moveAbove(_4.drawPane)}}}},visibilityChanged:function(_1){this.enableKeyMovement(_1)},enableKeyMovement:function(_1){if(_1){if(!this.$1367){this.$1367=isc.Page.setEvent("keyPress",this)}}else{if(this.$1367){isc.Page.clearEvent("keyPress",this.$1367);delete this.$1367}}},bringToFront:function(){},dragRepositionStart:function(){if(this.hideBorderOnDrag){this.$146i=this.border;this.setBorder(null)}},dragRepositionStop:function(){if(this.hideBorderOnDrag){this.setBorder(this.$146i)}},doubleClick:function(){return isc.EH.STOP_BUBBLING},pageKeyPress:function(_1,_2){var _3=this.creator.getRootEditNode().liveObject;if(!_3.containsFocus())return;var _4=isc.EH.getKeyEventCharacter();if(!isc.isA.AlphaNumericChar(_4)){var _5=this.parentElement,_6=isc.EH.shiftKeyDown(),_7=(_6?1:_5.snapVGap),_8=(_6?1:_5.snapHGap),_9=[0,0],_10=false;_5.$128p=true;for(var i=0;i
: "+_1+".

The portion of the view that loaded succesfully will be shown.")} var _2=isc.capturedComponents;isc.capturedComponents=null;var _3=(_2?_2.getProperty("defaults").getProperty("ID"):null);this.logInfo("capturedComponents are: "+_3,"loadProject");return _2},isc.A.$167x=function isc_EditContext__translateTypeToSchemaType(_1){for(var i=0;i<_1.length;i++){var _3=_1[i].type,_4=isc.DS.getNearestSchema(_3);if(_4&&_4.Constructor==_3)_1[i].type=_4.name}},isc.A.addNodeTree=function isc_EditContext_addNodeTree(_1){this.addFromPaletteNodes(_1)},isc.A.addFromPaletteNodes=function isc_EditContext_addFromPaletteNodes(_1,_2){var _3=this.getEditNodeTree();if(!_2)_2=_3.getRoot();this.componentsToCreate=[];this.addComponentCalls=[];this.requiredDataSources=[];for(var i=0;i<_1.length;i++){this.findChildPaletteNodes(null,_1[i],null,_1)} for(var i=0;i<_1.length;i++){if(!_1[i].hasParent){this.findChildPaletteNodes(_2,_1[i],null,_1)}} var _5,_6;for(var i=0;i<_1.length;i++){_5=_1[i];var _7=_5.type||_5.className;if(_7){var _8=this.findPaletteNode("type",_7)||this.findPaletteNode("className",_7);if(_8&&(_5.editProxyProperties||_8.editProxyProperties)){_5.editProxyProperties=isc.addProperties({},_8.editProxyProperties,_5.editProxyProperties)}} _5.component=this.makeEditNode(_5)} for(var i=0;i0&&_9!=_10.length){_9=_10.length;var _13=_10.duplicate();for(var i=0;i<_13.length;i++){var _14=_13[i],_6=_14[1],_5=_14[0],_15=_14[2],_16=_6.liveObject;if(_6.name=="/"){var _17=this.addNode(_5.component,_2);_12.add(_17);_10.remove(_14);_11.add(_14)}else if(_3.contains(_6.component)){var _18=_5.component;if(_3.contains(_18)){_18=isc.addProperties({},_18)} var _17=this.addNode(_18,_6.component,null,_15);if(_6.component==_2){_12.add(_17)} _10.remove(_14);_11.add(_14)}else if(_16&&_3.contains(_16.editNode)){var _18=_5.component;if(_3.contains(_18)){_18=isc.addProperties({},_18)} var _17=this.addNode(_18,_16.editNode,null,_15);if(_16.editNode==_2){_12.add(_17)} _10.remove(_14);_11.add(_14)}}} delete isc.$75u;if(this.logIsDebugEnabled("loadProject")){this.logDebug("addComponent() calls during project loading:","loadProject");for(var i=0;i<_11.length;i++){var _14=_11[i],_6=_14[1],_5=_14[0];this.logDebug("addComponent("+this.echoLeaf(_5)+","+this.echoLeaf(_6),"loadProject")}} if(_10.length>0){this.logWarn("the following components could not be added to the project tree: "+isc.echoAll(_10.getProperty("0")))} return _12},isc.A.makeDSPaletteNode=function isc_EditContext_makeDSPaletteNode(_1,_2){var _3={ID:_1,type:"DataSource",dsType:_2||"DataSource",title:_1,icon:"DataSource.png",iconSize:16,loadData:function(_3,_6){var _4=this;isc.DS.get(_3.ID,function(_7){_3.liveObject=_7;_3.defaults={_constructor:"DataSource",ID:_7.ID};if(_7.hasSuperDS()&&!_7.superDS()){var _5=function(_7,_3,_6){isc.DS.load(_7.inheritsFrom,function(){_7=_7.superDS();if(_7.hasSuperDS()&&!_7.superDS()){_5(_7,_3,_6)}else{_3.isLoaded=true;isc.Class.fireCallback(_6,"",[_3])}},false,true)};_5(_7,_3,_6)}else{_3.isLoaded=true;isc.Class.fireCallback(_6,"",[_3])}})}};return _3},isc.A.findChildPaletteNodes=function isc_EditContext_findChildPaletteNodes(_1,_2,_3,_4){var _5=_2.type||_2.className;var _6=this.logIsInfoEnabled("loadProject"),_7=this.logIsDebugEnabled("loadProject");if(_6){this.logInfo("inspecting defaults of component: "+this.echoLeaf(_2)+" of type: "+_5,"loadProject")} var _8=_2.defaults,_9=this;var _10=[],_11=[],_12=isc.DS.get(_5),_13=isc.ClassFactory.getClass(_5);for(var _14 in _8){var _15=_8[_14];if(!isc.isAn.Array(_15)){_11[0]=_15;_15=_11}else if(_7){this.logDebug("checking Array property: "+_14+", value: "+this.echoLeaf(_15)+(_18?" with schema: "+_18:""),"loadProject")} var _16=_12?_12.getField(_14):null,_17=_16?_16.type:null,_18=isc.DS.get(_17),_19=false;for(var i=0;i<_15.length;i++){var _21=_15[i];if(_7){this.logDebug("checking property: "+_14+", value: "+this.echoLeaf(_21),"loadProject")} if(_4.contains(_21)){if(_6){this.logInfo("found capturedComponent: "+this.echoLeaf(_21)+" under property: "+_14+" of component: "+this.echoLeaf(_2),"loadProject")} _10.add([_14,_21]);_19=true;continue} if(_21==null){this.logInfo("null property: "+_14+" on component: "+this.echoLeaf(_2))} var _22=(_21?_21._constructor:null)||_17,_23=isc.ClassFactory.getClass(_22);if(_18&&((_23&&_23.isA(isc.Canvas))||(_23&&_23.isA(isc.DataSource))||(_23&&_23.isA(isc.FormItem))||(this.findPaletteNode("type",_22))||(this.findPaletteNode("className",_22)))){if(_6){this.logInfo("found palettized component: "+this.echoLeaf(_21)+" of type: "+_22+" under property: "+_14+" of component: "+this.echoLeaf(_2),"loadProject")} if(isc.isA.String(_21)){var _24=_4.find("ID",_21);if(_24==null){if(isc.DataSource.isA(_17)){var _25=this.findPaletteNode("ID",_21);if(true){_24=this.makeDSPaletteNode(_21)}} if(_24==null)continue} _10.add([_14,_24])}else{var _26=_21;_10.add([_14,{ID:_26.ID,name:_26.name,type:_22,defaults:_26}])} _19=true}} if(_19)delete _8[_14]} var _27=this.findPaletteNode("type",_5)||this.findPaletteNode("className",_5);if(_27){_2.icon=_2.icon||_27.icon;_2.iconSize=_2.iconSize||_27.iconSize;_2.showDropIcon=_2.showDropIcon||_27.showDropIcon} this.componentsToCreate.add(_2);if(_1!=null){_2.hasParent=true;this.addComponentCalls.add([_2,_1,_3])} if(_10.length>0){for(var i=0;i<_10.length;i++){this.findChildPaletteNodes(_2,_10[i][1],_10[i][0],_4)}}});isc.evalBoundary;isc.B.push(isc.A.isNodeEditingOn=function isc_EditContext_isNodeEditingOn(_1){if(!_1)return null;var _2=this.getLiveObject(_1);return(_2?_2.editingOn:false)},isc.A.enableEditing=function isc_EditContext_enableEditing(_1){if(this.isNodeEditingOn(_1))return;var _2=_1.liveObject;if(_2.setEditMode){_2.setEditMode(true,this,_1)}else{_2.editContext=this;_2.editNode=_1;_2.editingOn=true}},isc.A.setNodeProperties=function isc_EditContext_setNodeProperties(_1,_2,_3){if(this.logIsDebugEnabled("editing")){this.logDebug("with editNode: "+this.echoLeaf(_1)+" applying properties: "+this.echo(_2),"editing")} if(!_1.defaults)_1.defaults={} isc.addProperties(_1.defaults,_2);if(_1.defaults.ID!=null)_1.ID=_1.defaults.ID;var _4=_1.liveObject;if(_4&&!_3){var _5=this.getEditNodeTree(),_6=_5.getParent(_1),_7=(_6?isc.DS.get(_6.type):null),_8=(_6?_6.liveObject:null),_9=(_8?isc.DS.getObjectField(_8,_1.type):null),_10=(_9?_7.fields[_9]:null);if(_2.name!=null&&_10&&_10.rebuildOnChange&&_10.rebuildOnChange.toLowerCase()=="true"){var _11=_5.getChildren(_6).findIndex(_1);this.logInfo("using remove/re-add cycle to modify liveObject: "+isc.echoLeaf(_4)+" within parent node "+isc.echoLeaf(_6));this.removeNode(_1);_1.name=_1.ID=_2.name;delete _2.name;this.addNode(_1,_6,_11);_4=this.getLiveObject(_1)} if(_4.setEditableProperties){_4.setEditableProperties(_2);if(_4.markForRedraw)_4.markForRedraw();else if(_4.redraw)_4.redraw()}else{var _12=_5.getParent(_1),_13=_12;if(_12!=null){var _8=_12.liveObject;if(_8!=null&&_8.setChildEditableProperties){_8.setChildEditableProperties(_4,_2,_1,this)}else{var _14=1;while((_13=_5.getParent(_13))!=null){var _15=_13.liveObject;if(_15!=null&&_15.setDescendantEditableProperties){_15.setDescendantEditableProperties(_4,_2,_1,this,_14);break} ++_14}}} if(_13==null){isc.addProperties(_4,_2)}} if(this.markForRedraw)this.markForRedraw();_5.dataChanged()}},isc.A.removeNodeProperties=function isc_EditContext_removeNodeProperties(_1,_2){if(!_1.defaults)return;if(!isc.isAn.Array(_2))_2=[_2];_2.map(function(_3){delete _1.defaults[_3]})},isc.A.setEditProxyProperties=function isc_EditContext_setEditProxyProperties(_1,_2){var _3=_1.liveObject||_1;if(_3.editProxy){isc.addProperties(_3.editProxy,_2)}else{isc.addProperties(_1,{editProxyProperties:isc.addProperties({},_1.editProxyProperties,_2)})}},isc.A.addWithWrapper=function isc_EditContext_addWithWrapper(_1,_2,_3,_4){var _5=!_3,_6=(_3?this.wrapperDrawPaneDefaults:this.wrapperFormDefaults),_7=isc.Canvas.$145y(this),_8=isc.addProperties({},_6);if(_1.editProxyProperties)isc.addProperties(_7,_1.editProxyProperties);var _9={type:_6._constructor,defaults:_8,editProxyProperties:_7,parentProperty:_4};if(_5&&_1.liveObject.schemaDataSource){var _10=_1.liveObject;_8.doNotUseDefaultBinding=true;_8.dataSource=_10.schemaDataSource;_8.serviceNamespace=_10.serviceNamespace;_8.serviceName=_10.serviceName} var _11=this.makeEditNode(_9);this.addNode(_11,_2,null,_4);return this.addNode(_1,_11)},isc.A.$145z=function isc_EditContext__getCanGroupSelect(){return(this.canGroupSelect==true||this.selectionType==isc.Selection.MULTIPLE)},isc.A.$1450=function isc_EditContext__getCanDragGroup(){return(this.canDragGroup!=false)&&this.$145z()},isc.A.getSelectedEditNodes=function isc_EditContext_getSelectedEditNodes(){var _1=[];this.selectedComponents.map(function(_2){_1.push(_2.editNode)});return _1},isc.A.getSelectedEditNode=function isc_EditContext_getSelectedEditNode(){var _1=this.getSelectedEditNodes();return(_1&&_1.length>0?_1[0]:null)},isc.A.isEditNodeSelected=function isc_EditContext_isEditNodeSelected(_1){if(!this.selectedComponents||!_1.liveObject)return false;return this.selectedComponents.contains(_1.liveObject)},isc.A.selectEditNode=function isc_EditContext_selectEditNode(_1){var _2=(_1&&_1.liveObject?_1.liveObject:null);if(_2&&!this.selectedComponents.contains(_2)){this.selectedComponents.add(_2);this.updateSelectionDisplay([_2],null);this.fireSelectedEditNodesUpdated()}},isc.A.selectSingleEditNode=function isc_EditContext_selectSingleEditNode(_1){var _2=(_1&&_1.liveObject?_1.liveObject:null);if(!_2)return;if(this.selectedComponents.length==1&&this.selectedComponents.contains(_2)){return} var _3=false,_4=this.selectedComponents;if(_4.contains(_2))_4.remove(_2);if(this.selectedComponents.length>0)_3=true;this.selectedComponents=[];if(_2){this.selectedComponents=[_2];_3=true} if(_3){this.updateSelectionDisplay([_2],_4);this.fireSelectedEditNodesUpdated()}},isc.A.selectAllEditNodes=function isc_EditContext_selectAllEditNodes(){this.selectedComponents=[];var _1=this.$1366();if(_1){this.selectedComponents=_1.getAllSelectableComponents();this.updateSelectionDisplay(this.selectedComponents,null)} this.fireSelectedEditNodesUpdated()},isc.A.deselectEditNodes=function isc_EditContext_deselectEditNodes(_1){if(!isc.isAn.Array(_1))_1=[_1];var _2=[];this.editNodes.map(function(_4){if(_4.liveObject)_2.push(_4.liveObject)});var _3=this.selectedComponents.removeList(_2);this.updateSelectionDisplay(null,_2);if(_3){this.fireSelectedEditNodesUpdated()}},isc.A.deselectAllEditNodes=function isc_EditContext_deselectAllEditNodes(){if(!this.selectedComponents||this.selectedComponents.length==0)return;var _1=this.selectedComponents;this.selectedComponents=[];this.updateSelectionDisplay(null,_1);this.fireSelectedEditNodesUpdated()},isc.A.getSelectedComponents=function isc_EditContext_getSelectedComponents(){return this.selectedComponents.duplicate()},isc.A.isComponentSelected=function isc_EditContext_isComponentSelected(_1){if(!this.selectedComponents)return false;return this.selectedComponents.contains(_1)},isc.A.selectComponent=function isc_EditContext_selectComponent(_1){if(!this.selectedComponents.contains(_1)){this.selectedComponents.add(_1);this.updateSelectionDisplay([_1],null);this.fireSelectedEditNodesUpdated()}},isc.A.selectSingleComponent=function isc_EditContext_selectSingleComponent(_1){if(this.selectedComponents.length==1&&this.selectedComponents.contains(_1)){return} var _2=false,_3=this.selectedComponents;if(_3.contains(_1))_3.remove(_1);if(this.selectedComponents.length>0)_2=true;this.selectedComponents=[];if(_1){this.selectedComponents=[_1];_2=true} if(_2){this.updateSelectionDisplay([_1],_3);this.fireSelectedEditNodesUpdated()}},isc.A.selectAllComponents=function isc_EditContext_selectAllComponents(){this.selectedComponents=[];var _1=this.$1366();if(_1){this.selectedComponents=_1.getAllSelectableComponents();this.updateSelectionDisplay(this.selectedComponents,null)} this.fireSelectedEditNodesUpdated()},isc.A.deselectComponents=function isc_EditContext_deselectComponents(_1){if(!isc.isAn.Array(_1))_1=[_1];var _2=this.selectedComponents.removeList(_1);this.updateSelectionDisplay(null,_1);if(_2){this.fireSelectedEditNodesUpdated()}},isc.A.deselectAllComponents=function isc_EditContext_deselectAllComponents(){if(!this.selectedComponents||this.selectedComponents.length==0)return;var _1=this.selectedComponents;this.selectedComponents=[];this.updateSelectionDisplay(null,_1);this.fireSelectedEditNodesUpdated()},isc.A.$1451=function isc_EditContext__shouldShowThumbsOrDragHandle(){return(this.selectedComponents&&this.selectedComponents.length==1)},isc.A.refreshSelectedAppearance=function isc_EditContext_refreshSelectedAppearance(_1){if(!_1||!_1.editProxy)return;if(this.isComponentSelected(_1)){_1.editProxy.showSelectedAppearance(true,(this.showSelectedLabelOnSelect==false),this.$1451())}else{_1.editProxy.showSelectedAppearance(false)}},isc.A.updateSelectionDisplay=function isc_EditContext_updateSelectionDisplay(_1,_2){var _3=this.$1451();if(_2&&_2.length>0){for(var i=0;i<_2.length;i++){var _5=_2[i].editProxy;if(_5&&_5.showSelectedAppearance){_5.showSelectedAppearance(false)}}} if(_1&&_1.length>0){for(var i=0;i<_1.length;i++){var _5=_1[i].editProxy;if(_5&&_5.showSelectedAppearance){_5.showSelectedAppearance(true,(this.showSelectedLabelOnSelect==false),_3)}}} if(_3&&(!_1||_1.length==0)){var _6=this.getSelectedComponents()[0];_6.editProxy.showSelectedAppearance(true,(this.showSelectedLabelOnSelect==false),_3)} this.showGroupSelectionBox()},isc.A.$1366=function isc_EditContext__getSelectionEditProxy(){var _1=this.$159m;if(!_1)return null;return(_1.editingOn?_1.editProxy:null)},isc.A.fireSelectedEditNodesUpdated=function isc_EditContext_fireSelectedEditNodesUpdated(){var _1=this.$1366();if((_1&&_1.selectedEditNodesUpdated)||this.selectedEditNodesUpdated){var _2=this.getSelectedEditNodes(),_3=(_2&&_2.length>0?_2[0]:null);if(_1&&_1.selectedEditNodesUpdated){_1.selectedEditNodesUpdated(_3,_2)} if(this.selectedEditNodesUpdated){this.selectedEditNodesUpdated(_3,_2)}}},isc.A.selectedEditNodesUpdated=function isc_EditContext_selectedEditNodesUpdated(_1,_2){},isc.A.saveCoordinates=function isc_EditContext_saveCoordinates(_1){if(isc.isA.SimpleTabButton(_1)||isc.isA.DrawItem(_1)||isc.isA.DrawKnob(_1)||isc.isA.Portlet(_1)||isc.isA.PortalColumn(_1)||isc.isA.PortalRow(_1)||_1.$1452||_1.$146g) {return} this.showGroupSelectionBox();var _2=this.getEditNodeArray().find("liveObject",_1);if(!_2)return;if(this.persistCoordinates==false)return;var _3=this.getEditNodeTree().getParent(_2);if(!_3)return;var _4=_3.liveObject;if(_4&&_4.editProxy){if((this.persistCoordinates==null&&_4.editProxy.persistCoordinates)||(this.persistCoordinates&&_4.editProxy.persistCoordinates!=false)) {var _5=(_1.$pn=="*"?"*":null),_6=(_1.$po=="*"?"*":null);this.setNodeProperties(_2,{left:_1.getLeft(),top:_1.getTop(),width:_1._percent_width||_5||_1.getWidth(),height:_1._percent_height||_6||_1.getHeight()},true)}}},isc.A.showGroupSelectionBox=function isc_EditContext_showGroupSelectionBox(){if(this.$145z()&&!this.$146j&&!(isc.isA.DrawPane&&isc.isA.DrawPane(this.$159m))){var _1=this.getGroupMask(this.$159m);if(this.selectedComponents.length>1){_1.setSelection(this.getSelectedComponents());_1.show()}else{if(_1)_1.hide()}}},isc.A.getGroupMask=function isc_EditContext_getGroupMask(_1){if(!this.groupMask&&_1){var _2={ID:_1.ID+"$146k",keepInParentRect:true,hideBorderOnDrag:(this.hideGroupBorderOnDrag!=false),canDragReposition:this.$1450()};this.groupMask=this.createAutoChild("groupMask",_2);_1.addChild(this.groupMask)} return this.groupMask});isc.B._maxIndex=isc.C+89;isc.ClassFactory.defineInterface("Palette");isc.Palette.addInterfaceProperties({setDefaultEditContext:function(_1){if(_1&&!isc.isAn.EditContext(_1)&&_1.getEditContext){_1=_1.getEditContext()} this.defaultEditContext=_1;if(_1&&!_1.defaultPalette){_1.defaultPalette=this}},makeEditNode:function(_1){if(!_1)_1=this.getDragData();if(isc.isAn.Array(_1))_1=_1[0];var _2=_1.type||_1.className;if(!isc.SGWTFactory.getFactory(_2)&&_2.contains("."))_2=_2.split(/\./).pop();var _3={type:_2,_constructor:_2,title:_1.title,icon:_1.icon,iconSize:_1.iconSize,showDropIcon:_1.showDropIcon,useEditMask:_1.useEditMask,autoGen:_1.autoGen,editProxyProperties:_1.editProxyProperties};if(isc.isAn.Object(_1.editNodeProperties)){for(var _4 in _1.editNodeProperties){_3[_4]=_1.editNodeProperties[_4]}} if(_1.makeComponent){_3.liveObject=_1.makeComponent(_3);return _3} var _5=_1.defaults;_3.ID=_1.ID||(_5?isc.DS.getAutoId(_5):null);var _6=true;if(_1.loadData&&!_1.isLoaded){_3.loadData=_1.loadData}else if(_1.wizardConstructor){_3.wizardConstructor=_1.wizardConstructor;_3.wizardDefaults=_1.wizardDefaults}else if(_1.liveObject){var _7=_1.liveObject;if(isc.isA.String(_7))_7=window[_7];_3.liveObject=_7}else{_3=this.createLiveObject(_1,_3);_6=false} if(_6){_3.defaults=isc.addProperties({},_1.defaults);delete _3.defaults[isc.gwtRef];delete _3.defaults[isc.gwtModule];delete _3.defaults["xsi:type"]} if(_3.defaults&&!_3.defaults._constructor){_3.defaults._constructor=_2} return _3},makeNewComponent:function(_1){return this.makeEditNode(_1)},generateNames:true,typeCount:{},getNextAutoId:function(_1){if(_1==null){_1="Object"}else{if(_1.contains("."))_1=_1.split(/\./).pop()} var _2;this.typeCount[_1]=this.typeCount[_1]||0;while(window[(_2=_1+this.typeCount[_1]++)]!=null){} return _2},findPaletteNode:function(_1,_2){return null},createLiveObject:function(_1,_2){var _3=_1.type||_1.className;if(_3.contains(".")&&!isc.SGWTFactory.getFactory(_3))_3=_3.split(/\./).pop();var _4=isc.ClassFactory.getClass(_3),_5=isc.DS.getNearestSchema(_3),_6={},_7=(_5?_5.shouldCreateStandalone():true),_8=_1.defaults||{};var _9;if(_5&&!_4){_4=isc.DS.getNearestSchemaClass(_5);if(_4){_3=_4.getClassName();_9=true}} if(_4&&_4.isA("Canvas"))_6.autoDraw=false;if(_8.title){_6.title=_8.title} if(this.generateNames){var _10=_2.ID||_8[_5.getAutoIdField()];if(_10==null){_10=this.getNextAutoId(_3);if(isc.isA.Class(_4)){_6.hasStableID=function(){return false}}} _2.ID=_10;_6[_5.getAutoIdField()]=_10;if(_5&&_5.getField("title")&&!isc.isA.FormItem(_4)&&!(isc.isA.DrawItem&&isc.isA.DrawItem(_4))&&!_6.title){_6.title=_10}} _6=_2.defaults=isc.addProperties(_6,this.componentDefaults,_8);delete _6[isc.gwtRef];delete _6[isc.gwtModule];delete _6["xsi:type"];_6._constructor=_3;for(var _11 in _6){var _12=_6[_11];if(isc.isAn.Array(_12)&&(!_4||_4.getInstanceProperty(_11)!==_12)){_12=_6[_11]=_12.duplicate();for(var i=_12.length;i--;){if(isc.isAn.Array(_12[i])){_12[i]=_12[i].duplicate()}}}} var _14;if(_4&&_7){_14=isc.ClassFactory.newInstance(_6)}else{_2.generatedType=true;_14=isc.shallowClone(_6)} _2.liveObject=_14;this.logInfo("palette created component, type: "+_3+", ID: "+_10+(this.logIsDebugEnabled("editing")?", defaults: "+this.echo(_6):"")+", liveObject: "+this.echoLeaf(_14),"editing");return _2}});isc.defineClass("HiddenPalette","Class","Palette");isc.A=isc.HiddenPalette.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.findPaletteNode=function isc_HiddenPalette_findPaletteNode(_1,_2){return this.data?this.data.find(_1,_2):null});isc.B._maxIndex=isc.C+1;if(isc.TreeGrid){isc.defineClass("TreePalette","TreeGrid","Palette");isc.A=isc.TreePalette.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.canDragRecordsOut=true;isc.B.push(isc.A.recordDoubleClick=function isc_TreePalette_recordDoubleClick(){var _1=this.defaultEditContext;if(_1){if(isc.isA.String(_1)&&this.creator)_1=this.creator[_1];if(isc.isAn.EditContext(_1)){var _2=this.makeEditNode(this.getDragData());if(_2){if(_1.getDefaultParent(_2,true)==null){isc.warn("No default parent can accept a component of this type")}else{_1.addNode(_2);isc.EditContext.selectCanvasOrFormItem(_2.liveObject,true)}}}}},isc.A.findPaletteNode=function isc_TreePalette_findPaletteNode(_1,_2){return this.data?this.data.find(_1,_2):null},isc.A.transferDragData=function isc_TreePalette_transferDragData(_1){return this.getDragData()});isc.B._maxIndex=isc.C+3} if(isc.ListGrid){isc.defineClass("ListPalette","ListGrid","Palette");isc.A=isc.ListPalette.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.canDragRecordsOut=true;isc.A.defaultFields=[{name:"title",title:"Title"}];isc.B.push(isc.A.recordDoubleClick=function isc_ListPalette_recordDoubleClick(){var _1=this.defaultEditContext;if(_1){if(isc.isA.String(_1))_1=isc.Canvas.getById(_1);if(isc.isAn.EditContext(_1)){_1.addNode(this.makeEditNode(this.getDragData()))}}},isc.A.findPaletteNode=function isc_ListPalette_findPaletteNode(_1,_2){return this.data?this.data.find(_1,_2):null},isc.A.transferDragData=function isc_ListPalette_transferDragData(){return this.getDragData()});isc.B._maxIndex=isc.C+3} if(isc.TileGrid){isc.defineClass("TilePalette","TileGrid","Palette");isc.A=isc.TilePalette.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.canDragTilesOut=true;isc.A.defaultFields=[{name:"title",title:"Title"}];isc.B.push(isc.A.recordDoubleClick=function isc_TilePalette_recordDoubleClick(){var _1=this.defaultEditContext;if(_1){if(isc.isA.String(_1))_1=isc.Canvas.getById(_1);if(isc.isAn.EditContext(_1)){_1.addNode(this.makeEditNode(this.getDragData()))}}},isc.A.findPaletteNode=function isc_TilePalette_findPaletteNode(_1,_2){return this.data?this.data.find(_1,_2):null},isc.A.transferDragData=function isc_TilePalette_transferDragData(){return this.getDragData()});isc.B._maxIndex=isc.C+3} if(isc.Menu){isc.defineClass("MenuPalette","Menu","Palette");isc.A=isc.MenuPalette.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.canDragRecordsOut=true;isc.A.selectionType="single";isc.B.push(isc.A.itemClick=function isc_MenuPalette_itemClick(_1){var _2=this.defaultEditContext;if(_2){if(isc.isA.String(_2))_2=isc.Canvas.getById(_2);if(isc.isAn.EditContext(_2)){_2.addNode(this.makeEditNode(this.getDragData()))}}},isc.A.findPaletteNode=function isc_MenuPalette_findPaletteNode(_1,_2){return this.data?this.data.find(_1,_2):null},isc.A.transferDragData=function isc_MenuPalette_transferDragData(){return this.getDragData()});isc.B._maxIndex=isc.C+3} if(!isc.DataSource.get("EditPane")){isc.DataSource.create({ID:"EditPane",Contructor:"EditPane",addGlobalId:false,fields:[{name:"children",type:"Canvas",multiple:true}]})} isc.ClassFactory.defineClass("EditPane","Canvas");isc.A=isc.EditPane.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.canAcceptDrop=true;isc.A.editContextConstructor="EditContext";isc.A.editContextDefaults={canSelectEditNodes:true,nodeAdded:function(_1,_2,_3){var _4=this.creator;if(_4.creator&&_4.creator.editingOn)this.enableEditing(_1);if(_4.nodeAdded)_4.nodeAdded(_1,_2,_3)},getSelectedLabelText:function(_1){var _2=this.creator;return(_2.getSelectedLabelText?_2.getSelectedLabelText(_1):this.Super("getSelectedLabelText",arguments))}};isc.A.editMode=true;isc.B.push(isc.A.initWidget=function isc_EditPane_initWidget(){this.Super("initWidget",arguments);var _1={type:"EditPane",liveObject:this};var _2=isc.EditContext.getNonNullProperties({rootComponent:_1,defaultPalette:this.defaultPalette,extraPalettes:this.extraPalettes,autoEditNewNodes:this.autoEditNewNodes,persistCoordinates:this.persistCoordinates,allowNestedDrops:this.allowNestedDrops,showSelectedLabel:this.showSelectedLabel,selectedAppearance:this.selectedAppearance,selectedBorder:this.selectedBorder,selectedLabelBackgroundColor:this.selectedLabelBackgroundColor,selectedTintColor:this.selectTintColor,selectedTintOpacity:this.selectedTintOpacity});this.editContext=this.createAutoChild("editContext",_2);this.data=[];this.createSelectionModel();if(this.editMode)this.setEditMode(true,this.editContext)},isc.A.getEditContext=function isc_EditPane_getEditContext(){return this.editContext},isc.A.setEditMode=function isc_EditPane_setEditMode(_1,_2,_3){if(_1==null)_1=true;if(this.editingOn==_1)return;if(!_2)_2=this.getEditContext();this.Super("setEditMode",[_1,_2,_3],arguments);if(this.editingOn&&this.editProxy&&this.editProxy.canSelectChildren){_2.$159m=this} var _4=_2.getEditNodeArray().getProperty("liveObject");_4.map("setEditMode",_1,_2);if(_1){this.contextMenu={autoDraw:false,data:[{title:"Clear",click:"target.destroyAll()"}]}}else{this.contextMenu=null}},isc.A.switchEditMode=function isc_EditPane_switchEditMode(_1){this.editContext.switchEditMode(_1)},isc.A.getObjectField=function isc_EditPane_getObjectField(_1){var _2=isc.DS.getNearestSchemaClass(_1);if(_2==null){_2=isc.ClassFactory.getClass(_1)} if(isc.isA.Canvas(_2)){return"children"}else{return null}},isc.A.removeChild=function isc_EditPane_removeChild(_1,_2){if(isc.EditProxy.getThumbTarget()===_1)isc.EditProxy.hideResizeThumbs();this.Super("removeChild",arguments);var _3=this.getEditContext(),_4=_3.getEditNodeArray().find("liveObject",_1);if(_4){_3.removeNode(_4,true)}},isc.A.getSaveData=function isc_EditPane_getSaveData(){var _1=this.getEditContext().getEditNodeTree(),_2=_1.getChildren(_1.getRoot()),_3=[];for(var i=0;i<_2.length;i++){var _5=_2[i],_6=_5.liveObject;var _7={type:_5.type,defaults:_5.defaults};if(_6.getSaveData)_7=_6.getSaveData(_7);_3.add(_7)} return _3},isc.A.getRootEditNode=function isc_EditPane_getRootEditNode(){return this.editContext.getRootEditNode()},isc.A.makeEditNode=function isc_EditPane_makeEditNode(_1){return this.editContext.makeEditNode(_1)},isc.A.addNode=function isc_EditPane_addNode(_1,_2,_3,_4,_5){return this.editContext.addNode(_1,_2,_3,_4,_5)},isc.A.addFromPaletteNode=function isc_EditPane_addFromPaletteNode(_1,_2){return this.editContext.addFromPaletteNode(_1,_2)},isc.A.addFromPaletteNodes=function isc_EditPane_addFromPaletteNodes(_1,_2){return this.editContext.addFromPaletteNodes(_1,_2)},isc.A.removeNode=function isc_EditPane_removeNode(_1,_2){return this.editContext.removeNode(_1,_2)},isc.A.destroyNode=function isc_EditPane_destroyNode(_1){return this.editContext.destroyNode(_1)},isc.A.reorderNode=function isc_EditPane_reorderNode(_1,_2,_3){return this.editContext.reorderNode(_1,_2,_3)},isc.A.removeAll=function isc_EditPane_removeAll(){return this.editContext.removeAll()},isc.A.destroyAll=function isc_EditPane_destroyAll(){return this.editContext.destroyAll()},isc.A.isNodeEditingOn=function isc_EditPane_isNodeEditingOn(_1){return this.editContext.isNodeEditingOn(_1)},isc.A.enableEditing=function isc_EditPane_enableEditing(_1){return this.editContext.enableEditing(_1)},isc.A.setNodeProperties=function isc_EditPane_setNodeProperties(_1,_2,_3){return this.editContext.setNodeProperties(_1,_2,_3)},isc.A.removeNodeProperties=function isc_EditPane_removeNodeProperties(_1,_2){return this.editContext.removeNodeProperties(_1,_2)},isc.A.getDefaultPalette=function isc_EditPane_getDefaultPalette(){return this.editContext.getDefaultPalette()},isc.A.setDefaultPalette=function isc_EditPane_setDefaultPalette(_1){return this.editContext.setDefaultPalette(_1)},isc.A.addPaletteNodesFromXML=function isc_EditPane_addPaletteNodesFromXML(_1,_2,_3,_4){return this.editContext.addPaletteNodesFromXML(_1,_2,_3,_4)},isc.A.addPaletteNodesFromJSON=function isc_EditPane_addPaletteNodesFromJSON(_1,_2,_3,_4){return this.editContext.addPaletteNodesFromJSON(_1,_2,_3,_4)},isc.A.getPaletteNodesFromXML=function isc_EditPane_getPaletteNodesFromXML(_1,_2){return this.editContext.getPaletteNodesFromXML(_1,_2)},isc.A.addPaletteNodesFromJS=function isc_EditPane_addPaletteNodesFromJS(_1,_2,_3,_4){return this.editContext.addPaletteNodesFromJS(_1,_2,_3,_4)},isc.A.serializeAllEditNodes=function isc_EditPane_serializeAllEditNodes(_1){return this.editContext.serializeAllEditNodes(_1)},isc.A.serializeAllEditNodesAsJSON=function isc_EditPane_serializeAllEditNodesAsJSON(_1,_2){return this.editContext.serializeAllEditNodesAsJSON(_1,_2)},isc.A.serializeEditNodes=function isc_EditPane_serializeEditNodes(_1,_2){return this.editContext.serializeEditNodes(_1,_2)},isc.A.serializeEditNodesAsJSON=function isc_EditPane_serializeEditNodesAsJSON(_1,_2){return this.editContext.serializeEditNodesAsJSON(_1,_2)});isc.B._maxIndex=isc.C+31;if(isc.TreeGrid){isc.ClassFactory.defineClass("EditTree","TreeGrid");isc.A=isc.EditTree.getPrototype();isc.A.canDragRecordsOut=false;isc.A.canAcceptDroppedRecords=true;isc.A.canReorderRecords=true;isc.A.selectionType=isc.Selection.SINGLE;isc.A.autoShowParents=true;isc.A=isc.EditTree.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.editContextConstructor="EditContext";isc.B.push(isc.A.initWidget=function isc_EditTree_initWidget(){this.fields=[{name:"ID",title:"ID",width:"*",formatCellValue:function(_2,_3,_4,_5,_6){var _1=isc.DS.getAutoId(_3.liveObject);return String(_1).asHTML()}},{name:"type",title:"Type",width:"*"}];this.Super("initWidget",arguments);this.configureEditContext();this.observe(this,"nodeClick","observer.selectedNodeUpdated()");this.setData(this.editContext.getEditNodeTree())},isc.A.getEditContext=function isc_EditTree_getEditContext(){return this.editContext},isc.A.configureEditContext=function isc_EditTree_configureEditContext(){var _1=this;if(!this.editContext){if(!this.rootComponent&&!this.rootLiveObject){this.rootComponent={type:"Canvas"}} var _2=isc.EditContext.getNonNullProperties({rootComponent:this.rootComponent,rootLiveObject:this.rootLiveObject,defaultPalette:this.defaultPalette,extraPalettes:this.extraPalettes,autoEditNewNodes:this.autoEditNewNodes,persistCoordinates:this.persistCoordinates,allowNestedDrops:this.allowNestedDrops,showSelectedLabel:this.showSelectedLabel,selectedAppearance:this.selectedAppearance,selectedBorder:this.selectedBorder,selectedLabelBackgroundColor:this.selectedLabelBackgroundColor,selectedTintColor:this.selectTintColor,selectedTintOpacity:this.selectedTintOpacity});this.editContext=this.createAutoChild("editContext",_2)} this.editContext.addProperties({getDefaultParent:function(_3,_4){return _1.getDefaultParent(_3,_4)},$143b:this.editContext.nodeAdded,nodeAdded:function(_3,_4,_5){if(this.$143b)this.$143b();_1.selectSingleRecord(_3);_1.scrollRecordIntoView(_1.getRecordIndex(_3));if(_1.autoShowParents)_1.showParents(_3);if(_1.creator&&_1.creator.editingOn)this.enableEditing(_3);if(_1.nodeAdded)_1.nodeAdded(_3,_4,_5)},$1453:this.editContext.getSelectedLabelText,getSelectedLabelText:function(_3){return(_1.getSelectedLabelText?_1.getSelectedLabelText(_3):(this.$1453?this.$1453(_3):_3.toString()))}});this.observe(this.editContext,"selectedEditNodesUpdated","observer.selectedEditNodesUpdated()")},isc.A.selectedEditNodesUpdated=function isc_EditTree_selectedEditNodesUpdated(){var _1=this.editContext.getSelectedEditNodes();if(_1.length>0)this.selectSingleRecord(_1[0]);else this.deselectAllRecords()},isc.A.selectedNodeUpdated=function isc_EditTree_selectedNodeUpdated(){var _1=this.getSelectedRecord(),_2=this.data.getParent(_1);var _3=_1&&_1.liveObject;if(isc.isA.Canvas(_3)&&_3.$73a==null&&isc.isA.Deck&&isc.isA.Deck(_3.parentElement)) {var _4=_3.parentElement;if(_4.isVisible()&&_4.$73a==null&&isc.isAn.Array(_4.panes)&&_4.panes.contains(_3)) {_3.setVisibility(isc.Canvas.INHERIT);_4.reflowNow();isc.EditContext.selectCanvasOrFormItem(_3,false);return}} for(var _5=_1;_5!=null;_5=this.data.getParent(_5)){var _6=_5.liveObject;if(((isc.isA.Canvas(_6)||isc.isA.FormItem(_6))&&_6.isDrawn()&&_6.isVisible())||(_6!=null&&_6.$73a!=null)) {if(_5===_1){isc.EditContext.selectCanvasOrFormItem(_6,false)}else{var _7=this.editContext.getSelectedEditNodes();if(!_7.contains(_5)){isc.EditContext.selectCanvasOrFormItem(_6,false);this.selectSingleRecord(_1)}} break}}},isc.A.switchEditMode=function isc_EditTree_switchEditMode(_1){this.editContext.switchEditMode(_1)},isc.A.willAcceptDrop=function isc_EditTree_willAcceptDrop(){if(!this.Super("willAcceptDrop",arguments))return false;var _1=this.getEventRow(),_2=this.getDropFolder(),_3=this.ns.EH.dragTarget.getDragData();if(_3==null)return false;if(isc.isAn.Array(_3)){if(_3.length==0)return false;_3=_3[0]} if(_2==null)_2=this.data.getRoot();var _4=_3.type||_3.className;this.logInfo("checking dragType: "+_4+" against dropLiveObject: "+_2.liveObject,"editing");return this.editContext.canAddToParent(_2,_4)},isc.A.folderDrop=function isc_EditTree_folderDrop(_1,_2,_3,_4){if(_4!=this&&!_4.isA("Palette")){return this.Super("folderDrop",arguments)} if(_4!=this){_1=_4.transferDragData();_1=this.makeEditNode(isc.isAn.Array(_1)?_1[0]:_1)} var _5=(isc.isAn.Array(_1)?_1[0]:_1);_5.dropped=true;this.logInfo("sourceWidget is a Palette, dropped node of type: "+_5.type,"editing");var _6=this;this.editContext.requestLiveObject(_5,function(_11){if(_11==null)return;var _7=_4==_6;if(_7){var _8=_6.data.getParent(_5);if(_2==_8){var _9=_6.data.getChildren(_8).indexOf(_5);if(_9!=null&&_9<=_3)_3--} _6.editContext.removeNode(_5)} _6.editContext.addNode(_11,_2,_3);if(!_7&&_11&&_2&&(_11.type||_11.className)=="Tab"&&(_2.type||_2.className)=="TabSet"){var _10=_2.liveObject;if(_10&&_10.editProxy)_10.editProxy.addDefaultPane(_11)}},_4)},isc.A.getDefaultParent=function isc_EditTree_getDefaultParent(_1,_2){if(this.editContext.defaultParent)return this.editContext.defaultParent;if(this.editContext.allowNestedDrops==false){return this.data.getRoot()} var _3=_1.type||_1.className,_4=this.getSelectedRecord();while(_4&&(!this.editContext.canAddToParent(_4,_3)||(_4.liveObject.editProxy&&_4.liveObject.editProxy.allowNestedDrops==false))) {_4=this.data.getParent(_4)} var _5=this.data.getRoot() if(_2){if(!_4&&this.editContext.canAddToParent(_5,_3))return _5;return _4} return _4||_5},isc.A.showParents=function isc_EditTree_showParents(_1){var _2=this.data.getParents(_1),_3=_2.findAll("type","Tab");if(_3){for(var i=0;i<_3.length;i++){var _5=_3[i],_6=this.data.getParent(_5),_7=this.editContext.getLiveObject(_5),_8=this.editContext.getLiveObject(_6);_8.selectTab(_7)}}},isc.A.getRootEditNode=function isc_EditTree_getRootEditNode(){return this.editContext.getRootEditNode()},isc.A.makeEditNode=function isc_EditTree_makeEditNode(_1){return this.editContext.makeEditNode(_1)},isc.A.addNode=function isc_EditTree_addNode(_1,_2,_3,_4,_5){return this.editContext.addNode(_1,_2,_3,_4,_5)},isc.A.addFromPaletteNode=function isc_EditTree_addFromPaletteNode(_1,_2){return this.editContext.addFromPaletteNode(_1,_2)},isc.A.addFromPaletteNodes=function isc_EditTree_addFromPaletteNodes(_1,_2){return this.editContext.addFromPaletteNodes(_1,_2)},isc.A.removeNode=function isc_EditTree_removeNode(_1,_2){return this.editContext.removeNode(_1,_2)},isc.A.destroyNode=function isc_EditTree_destroyNode(_1){return this.editContext.destroyNode(_1)},isc.A.reorderNode=function isc_EditTree_reorderNode(_1,_2,_3){return this.editContext.reorderNode(_1,_2,_3)},isc.A.removeAll=function isc_EditTree_removeAll(){return this.editContext.removeAll()},isc.A.destroyAll=function isc_EditTree_destroyAll(){return this.editContext.destroyAll()},isc.A.isNodeEditingOn=function isc_EditTree_isNodeEditingOn(_1){return this.editContext.isNodeEditingOn(_1)},isc.A.enableEditing=function isc_EditTree_enableEditing(_1){return this.editContext.enableEditing(_1)},isc.A.setNodeProperties=function isc_EditTree_setNodeProperties(_1,_2,_3){return this.editContext.setNodeProperties(_1,_2,_3)},isc.A.removeNodeProperties=function isc_EditTree_removeNodeProperties(_1,_2){return this.editContext.removeNodeProperties(_1,_2)},isc.A.getDefaultPalette=function isc_EditTree_getDefaultPalette(){return this.editContext.getDefaultPalette()},isc.A.setDefaultPalette=function isc_EditTree_setDefaultPalette(_1){return this.editContext.setDefaultPalette(_1)},isc.A.addPaletteNodesFromXML=function isc_EditTree_addPaletteNodesFromXML(_1,_2,_3,_4){return this.editContext.addPaletteNodesFromXML(_1,_2,_3,_4)},isc.A.addPaletteNodesFromJSON=function isc_EditTree_addPaletteNodesFromJSON(_1,_2,_3,_4){return this.editContext.addPaletteNodesFromJSON(_1,_2,_3,_4)},isc.A.getPaletteNodesFromXML=function isc_EditTree_getPaletteNodesFromXML(_1,_2){return this.editContext.getPaletteNodesFromXML(_1,_2)},isc.A.addPaletteNodesFromJS=function isc_EditTree_addPaletteNodesFromJS(_1,_2,_3,_4){return this.editContext.addPaletteNodesFromJS(_1,_2,_3,_4)},isc.A.serializeAllEditNodes=function isc_EditTree_serializeAllEditNodes(_1){return this.editContext.serializeAllEditNodes(_1)},isc.A.serializeAllEditNodesAsJSON=function isc_EditTree_serializeAllEditNodesAsJSON(_1,_2){return this.editContext.serializeAllEditNodesAsJSON(_1,_2)},isc.A.serializeEditNodes=function isc_EditTree_serializeEditNodes(_1,_2){return this.editContext.serializeEditNodes(_1,_2)},isc.A.serializeEditNodesAsJSON=function isc_EditTree_serializeEditNodesAsJSON(_1,_2){return this.editContext.serializeEditNodesAsJSON(_1,_2)});isc.B._maxIndex=isc.C+34} isc.ClassFactory.defineClass("FormItemProxyCanvas","Canvas");isc.A=isc.FormItemProxyCanvas.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.editProxyConstructor="FormItemEditProxy";isc.A.autoDraw=false;isc.A.canDrop=true;isc.B.push(isc.A.setFormItem=function isc_FormItemProxyCanvas_setFormItem(_1){var _2=this.formItem;this.formItem=_1;this.syncWithFormItemPosition();this.sendToBack();this.show();if(_1!=_2){if(_2&&this.isObserving(_2,"visibilityChanged")){this.ignore(_2,"visibilityChanged")} if(!this.isObserving(this.formItem,"visibilityChanged")){this.observe(this.formItem,"visibilityChanged","observer.formItemVisibilityChanged()")} if(!this.editProxy){this.editProxy=this.createAutoChild("editProxy");this.editProxy.setEditMode(true)}}},isc.A.syncWithFormItemPosition=function isc_FormItemProxyCanvas_syncWithFormItemPosition(){if(!this.formItem||!this.formItem.form)return;this.$49p=true;this.setPageLeft(this.formItem.getPageLeft());this.setPageTop(this.formItem.getPageTop());this.setWidth(this.formItem.getVisibleWidth());this.setHeight(this.formItem.getVisibleHeight());this.$49p=false},isc.A.resizeTo=function isc_FormItemProxyCanvas_resizeTo(_1,_2){var _3=this.formItem;if(!this.$49p&&_3&&_3.editContext){_3.editContext.setNodeProperties(_3.editNode,{width:_1,height:_2});_3.redraw()} this.Super("resizeTo",arguments)},isc.A.formItemVisibilityChanged=function isc_FormItemProxyCanvas_formItemVisibilityChanged(){if(this.formItem.isVisible())this.show();else this.hide()});isc.B._maxIndex=isc.C+4;if(!(isc.licenseType=="Enterprise"||isc.licenseType=="Eval"||isc.licenseType=="AllModules"||isc.licenseType.contains("licenseType"))) {["EditContext","Palette","HiddenPalette","TreePalette","ListPalette","TilePalette","MenuPalette","EditPane","EditTree","FormItemProxyCanvas"].map(function(_1){isc[_1].$1226=true});isc.EditContext.vbOnly=true} isc.defineClass("EditProxy","Class");isc.A=isc.EditProxy;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.resizeThumbConstructor=isc.Canvas;isc.A.resizeThumbDefaults={autoDraw:false,destroyWithMaster:false,$jq:true,$nt:false,overflow:"hidden",canDrag:true,canDragResize:true,getEventEdge:function(){return this.edge},depeered:function(_1,_2){this.hide()}};isc.A.minimumDropMargin=2;isc.A.minimumDropTargetSize=10;isc.B.push(isc.A.$40f=function isc_c_EditProxy__makeResizeThumbs(){var _1=isc.Canvas.getInstanceProperty("edgeCursorMap"),_2={},_3=isc.ClassFactory.getClass(this.resizeThumbConstructor,true);for(var _4 in _1){var _5=_4.length==1;_2[_4]=_3.create({ID:"isc_resizeThumb_"+_4,edge:_4,snapTo:_4,snapOffsetTop:(_4[0]==="T"?-7:(_4[0]==="B"?7:0)),snapOffsetLeft:(_4[_4.length-1]==="R"?7:(_4[_4.length-1]==="L"?-7:0)),styleName:_5?"resizeThumb":"resizeThumb cornerResizeThumb",width:_5?7:9,height:_5?7:9},this.resizeThumbDefaults,this.resizeThumbProperties)} this.$40g=_2;this.$f0=isc.Class.create()},isc.A.showResizeThumbs=function isc_c_EditProxy_showResizeThumbs(_1){if(!_1)return;if(_1.editProxy){if(!_1.editProxy.hasEditMask()){return} _1=_1.editProxy.getEditMask()} if(!isc.EditProxy.$40g)isc.EditProxy.$40f();var _2=isc.EditProxy.resizeThumbDefaults.width,_3=isc.EditProxy.$40g;for(var _4 in _3){var _5=_3[_4];_5.dragTarget=_1;_5.bringToFront();_5.show();_1.addPeer(_5)} this.$rl=_1;_1.enableKeyMovement(true)},isc.A.hideResizeThumbs=function isc_c_EditProxy_hideResizeThumbs(){var _1=this.$40g;for(var _2 in _1){var _3=_1[_2];_3.depeer()} if(this.$rl)this.$rl.enableKeyMovement(false);this.$rl=null},isc.A.getThumbTarget=function isc_c_EditProxy_getThumbTarget(){return this.$rl},isc.A.splitString=function isc_c_EditProxy_splitString(_1,_2,_3){if(!_1)return[];var _4=_1.split(""),_5=false,_6=[],_7=[];for(var i=0;i<_4.length;i++){var _9=_4[i];if(_9==_3&&!_5){_5=true}else if(_5){if(_9!=_2)_7.push(_3);_7.push(_9);_5=false}else if(_9==_2){_6.push(isc.EditProxy.trimTrailingSpaces(_7.join("").replace(/^\s+/g,"")));_7=[]}else{_7.push(_9)}} if(_7.length>0){_6.push(isc.EditProxy.trimTrailingSpaces(_7.join("").replace(/^\s+/g,"")))} return _6},isc.A.parseStringValueMap=function isc_c_EditProxy_parseStringValueMap(_1,_2,_3,_4,_5,_6,_7){var _8=isc.EditProxy.splitString(_1,_2,_3);if(_8.length==0)return{};var _9={},_10=[],_11=[],_12=_7,_13=0,_14=(_8.length/2)<<0;for(var i=0;i<_8.length;i++){var _16=_8[i];if(!_4){var _17=isc.EditProxy.$1470(_16,_3,_5);if(_17.selected)_11.push(_17.value);_10.push(_17.value)}else{var _18=isc.EditProxy.splitString(_16,_4,_3);var _17=isc.EditProxy.$1470(_18[0],_3,_5);if(_17.selected)_11.push(_17.value);_10.push(_16);if(_18.length==1){_9[_17.value]=(_6?_17.value:null)}else{_16=_17.value;var _17=isc.EditProxy.$1470(_18[1],_3,_5);_9[_16]=_17.value;if(_17.selected&&!_11.contains(_16))_11.push(_16);if(++_13>_14)_12=true}}} return{valueMap:(_12?_9:_10),value:(_11.length==0?null:(_11.length==1?_11[0]:_11))}},isc.A.trimTrailingSpaces=function isc_c_EditProxy_trimTrailingSpaces(_1,_2){_2=_2||"\\";var _3=_1.length;if(_3==1){if(_1==" ")return"";return _1} for(var i=_3-1;i>0;i--){var c=_1.substring(i,i+1),_6=_1.substring(i-1,i);if(c!=" "||_6=="\\"){_1=_1.substring(0,i+1);break}} return _1},isc.A.$1470=function isc_c_EditProxy__getSelectedValue(_1,_2,_3){var _4={};if(_3&&_1.startsWith(_3)){_4.value=_1.substring(1).replace(/^\s+/,"");_4.selected=true}else if(_3&&_1.endsWith(_3)){if(_1.substring(_1.length-2,_1.length-1)!=_2){_4.value=isc.EditProxy.trimTrailingSpaces(_1.substring(0,_1.length-1));_4.selected=true}else{_4.value=_1}}else{_4.value=_1} return _4});isc.B._maxIndex=isc.C+8;isc.A=isc.EditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.editMaskDefaults={canFocus:true,draw:function(){this.Super("draw",arguments);this.observe(this.masterElement,"setZIndex","observer.moveAbove(observed)");this.observe(this.masterElement,"setPrompt","observer.setPrompt(observed.prompt)");this.observe(this.masterElement.editProxy,"startInlineEditing","observer.editingStarted()");this.observe(this.masterElement.editProxy,"inlineEditingComplete","observer.editingComplete()");return this},parentVisibilityChanged:function(){this.Super("parentVisibilityChanged",arguments);if(isc.EditProxy.getThumbTarget()==this)isc.EditProxy.hideResizeThumbs()},masterResized:function(_1,_2,_3){this.$40h=true;this.resizeTo(this.masterElement.getVisibleWidth(),this.masterElement.getVisibleHeight());this.$40h=false},handleClick:function(){this.Super("handleClick",arguments);this.select();var _1=this.masterElement;if(_1.editProxy.supportsInlineEdit&&this.editContext.enableInlineEdit&&_1.editProxy.inlineEditEvent=="click") {_1.editProxy.startInlineEditing()} if(this.editContext.editMaskClicked){this.editContext.editMaskClicked(_1.editNode,_1)} return isc.EH.STOP_BUBBLING},handleDoubleClick:function(){this.Super("handleDoubleClick",arguments);this.select();var _1=this.masterElement;if(_1.editProxy.supportsInlineEdit&&this.editContext.enableInlineEdit&&(_1.editProxy.inlineEditEvent=="doubleClick"||_1.editProxy.inlineEditEvent=="dblOrKeypress")) {_1.editProxy.startInlineEditing()} return isc.EH.STOP_BUBBLING},enableKeyMovement:function(_1){if(_1){if(!this.$1367){this.$1367=isc.Page.setEvent("keyPress",this)}}else{if(this.$1367){isc.Page.clearEvent("keyPress",this.$1367);delete this.$1367}}},editingStarted:function(){this.$1471=(this.$1367!=null);if(this.$1471)this.enableKeyMovement(false)},editingComplete:function(){if(this.$1471)this.enableKeyMovement(true)},select:function(){if(this.editPaneProxy&&this.editPaneProxy.canSelectChildren){var _1=this.getTarget(),_2=(this.editContext.selectionType==isc.Selection.MULTIPLE);if(_1.editProxy&&_1.editProxy.canSelect==false)return;if(this.editPaneProxy.bringToFrontOnSelect)_1.bringToFront();else this.bringToFront();var _3=(isc.EH.shiftKeyDown()||(isc.Browser.isWin&&isc.EH.ctrlKeyDown()));if(!this.editContext.isComponentSelected(_1)){if(!_2||!_3){this.editContext.selectSingleComponent(_1)}else{this.editContext.selectComponent(_1)}}else{if(!_2||!_3){this.editContext.selectSingleComponent(_1)}else{this.editContext.deselectComponents(_1)}}}},moveAbove:function(_1){if(!this.editContext.isComponentSelected(this.masterElement)||this.getZIndex(true)<=_1.getZIndex(true)) {this.Super("moveAbove",arguments)}},handleMouseDown:function(){this.Super("handleMouseDown",arguments);return isc.EH.STOP_BUBBLING},handleMouseUp:function(){this.Super("handleMouseUp",arguments);return isc.EH.STOP_BUBBLING},dragRepositionStart:function(){if(this.editPaneProxy&&(!this.editPaneProxy.canSelectChildren||this.editPaneProxy.canSelect==false)){return false} var _1=this.getTarget();if(this.editPaneProxy.bringToFrontOnSelect)_1.bringToFront();else this.bringToFront();if(this.editPaneProxy&&this.editPaneProxy.canSelectChildren&&(this.editContext.selectionType!=isc.Selection.MULTIPLE||!this.editContext.isComponentSelected(_1))) {this.editContext.selectSingleComponent(_1)}},pageKeyPress:function(_1,_2){var _3=this.editContext.getRootEditNode().liveObject;if(!_3.containsFocus())return;var _4=isc.EH.getKeyEventCharacter();if(!isc.isA.AlphaNumericChar(_4)){var _5=this.masterElement,_6=_5.editContext.getSelectedComponents();if(!_6.contains(_5))return;if(this.isPercent(_5.left)||this.isPercent(_5.top))return;if(_5.snapTo&&(this.isPercent(_5.snapOffsetLeft)||this.isPercent(_5.snapOffsetTop))) {return} var _7=_5.parentElement,_8=isc.EH.shiftKeyDown(),_9=(_8?1:_7.snapVGap),_10=(_8?1:_7.snapHGap),_11=[0,0],_12=false;switch(isc.EH.getKey()){case"Arrow_Up":_11=[0,_9*-1];break;case"Arrow_Down":_11=[0,_9];break;case"Arrow_Left":_11=[_10*-1,0];break;case"Arrow_Right":_11=[_10,0];break;default:_12=null;break} if(_11[0]!=0||_11[1]!=0){_7.$128p=true;if(_5.snapTo){_5.setSnapOffsetLeft((_5.snapOffsetLeft||0)+_11[0]);_5.setSnapOffsetTop((_5.snapOffsetTop||0)+_11[1])}else{_5.moveBy(_11[0],_11[1])} _7.$128p=false} return _12}},$o9:"%",isPercent:function(_1){return(isc.isA.String(_1)&&isc.endsWith(_1,this.$o9))},canDrag:true,canDragReposition:true,dragRepositionAppearance:"target",setDragTracker:function(){return isc.EH.STOP_BUBBLING},moved:function(){this.Super("moved",arguments);var _1=this.masterElement;if(_1){var _2=this.getOffsetLeft()-_1.getLeft();var _3=this.getOffsetTop()-_1.getTop();this.$ns=false;_1.moveTo(this.getOffsetLeft(),this.getOffsetTop());this.$ns=true} if(isc.EditProxy.getThumbTarget()==this)isc.EditProxy.showResizeThumbs(this)},resized:function(){this.Super("resized",arguments);if(this.editPaneProxy)this.editPaneProxy.updateDropMargin();if(this.$40h)return;this.$40h=true;var _1=this.masterElement;if(_1){this.$jo=false;_1.resizeTo(this.getWidth(),this.getHeight());this.$jo=true;_1.redrawIfDirty();this.resizeTo(_1.getVisibleWidth(),_1.getVisibleHeight())} if(isc.EditProxy.getThumbTarget()==this)isc.EditProxy.showResizeThumbs(this);this.$40h=false},showContextMenu:function(){var _1=this.masterElement,_2=this.editContext.isComponentSelected(_1);if(this.editPaneProxy.canSelectChildren&&this.editPaneProxy.canSelect!=false){if(!_2){this.editContext.selectSingleComponent(_1)}} var _3=this.editContext.getSelectedComponents(),_4;if(_3.length>1&&_2){_4=this.multiSelectionMenuItems}else{_4=this.standardMenuItems} if(!this.contextMenu)this.contextMenu=this.getMenuConstructor().create({});this.contextMenu.setData(_4);this.contextMenu.showContextMenu(this);return false},componentsRemove:function(){this.editContext.getSelectedComponents().map("destroy")},componentsBringToFront:function(){this.editContext.getSelectedComponents().map("bringToFront")},componentsSendToBack:function(){this.editContext.getSelectedComponents().map("sendToBack")},standardMenuItems:[{title:"Bring to front",click:"target.componentsBringToFront()"},{title:"Send to back",click:"target.componentsSendToBack()"},{title:"Remove",click:"target.componentsRemove()"}],multiSelectionMenuItems:[{title:"Bring to front",click:"target.componentsBringToFront()"},{title:"Send to back",click:"target.componentsSendToBack()"},{title:"Remove selected items",click:"target.componentsRemove()"}]};isc.B.push(isc.A.setCanSelectChildren=function isc_EditProxy_setCanSelectChildren(_1){if(_1==this.canSelectChildren)return;this.restoreOverrideProperties();this.canSelectChildren=_1;this.saveOverrideProperties()});isc.B._maxIndex=isc.C+1;isc.A=isc.EditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$1454="tintMask";isc.A.$1455="outlineMask";isc.A.$1456="outlineEdges";isc.A.$1698={"children":true,"peers":true};isc.A.defaultDropMargin=10;isc.A.dropMargin=10;isc.A.supportsInlineEdit=true;isc.A.inlineEditEvent="doubleClick";isc.A.$1472="edit";isc.A.inlineEditFormConstructor="DynamicForm";isc.A.inlineEditFormDefaults={minWidth:80,minHeight:20,numCols:1};isc.A.inlineEditInstructionLabelConstructor="Label";isc.A.inlineEditInstructionLabelDefaults={height:10};isc.A.inlineEditMultiline=false;isc.B.push(isc.A.setEditMode=function isc_EditProxy_setEditMode(_1){if(_1){this.saveOverrideProperties();if(!isc.isA.FormItem(this.creator))this.updateDropMargin();if(this.hasEditMask())this.showEditMask()}else{this.restoreOverrideProperties();this.hideEditMask()}},isc.A.getOverrideProperties=function isc_EditProxy_getOverrideProperties(){var _1={canAcceptDrop:true,canDropComponents:true};if(this.canSelectChildren){isc.addProperties(_1,{canDrag:true,dragAppearance:"none",overflow:"hidden"})} if(this.childrenSnapToGrid!=null){if(isc.isA.String(this.childrenSnapToGrid))this.childrenSnapToGrid=(this.childrenSnapToGrid=="true");_1.childrenSnapToGrid=this.childrenSnapToGrid} if(this.childrenSnapResizeToGrid!=null){if(isc.isA.String(this.childrenSnapResizeToGrid))this.childrenSnapResizeToGrid=(this.childrenSnapResizeToGrid=="true");_1.childrenSnapResizeToGrid=this.childrenSnapResizeToGrid} return _1},isc.A.nodeDropped=function isc_EditProxy_nodeDropped(){if(this.inlineEditOnDrop){this.delayCall("startInlineEditing")}},isc.A.editTitle=function isc_EditProxy_editTitle(_1,_2,_3){var _1=_1||this.creator,_4,_5,_6;if(isc.isA.Button(_1)){_4=_1.getPageLeft()+_1.getLeftBorderSize()+_1.getLeftMargin()+1 -_1.getScrollLeft();_5=_1.getVisibleWidth()-_1.getLeftBorderSize()-_1.getLeftMargin() -_1.getRightBorderSize()-_1.getRightMargin()-1}else if(isc.isA.StretchImgButton(_1)){_4=_1.getPageLeft()+_1.capSize;_5=_1.getVisibleWidth()-_1.capSize*2}else{isc.logWarn("Ended up in editTitle with a StatefulCanvas of type '"+_1.getClass()+"'. This is neither a Button nor a StretchImgButton - editor will work, but will hide the entire component it is editing");_4=_1.getPageLeft();_5=_1.getVisibleWidth()} isc.Timer.setTimeout({target:isc.EditContext,methodName:"manageTitleEditor",args:[_1,_4,_5,_6,null,_2,null,_3]},0)},isc.A.repositionTitleEditor=function isc_EditProxy_repositionTitleEditor(){var _1=this.creator;var _2=_1.getPageLeft()+_1.capSize,_3=_1.getVisibleWidth()-_1.capSize*2;isc.EditContext.positionTitleEditor(_1,_2,_3)},isc.A.saveOverrideProperties=function isc_EditProxy_saveOverrideProperties(){var _1=this.getOverrideProperties();this.overrideProperties(_1)},isc.A.restoreOverrideProperties=function isc_EditProxy_restoreOverrideProperties(){var _1=this.getOverrideProperties();this.restoreProperties(isc.getKeys(_1))},isc.A.overrideProperties=function isc_EditProxy_overrideProperties(_1){this.creator.saveToOriginalValues(isc.getKeys(_1));this.creator.setProperties(_1)},isc.A.restoreProperties=function isc_EditProxy_restoreProperties(_1){if(_1==null)return;this.creator.restoreFromOriginalValues(_1)},isc.A.showEditMask=function isc_EditProxy_showEditMask(_1){var _2=this.creator,_3=_2.getID()+":
"+_2.src;if(!this.$40i||this.$40i.destroyed){var _4={};if(isc.SVG&&isc.isA.SVG(_2)&&isc.Browser.isIE){isc.addProperties(_4,{backgroundColor:"gray",mouseOut:function(){this.$jr.Super("$mc")},contents:isc.Canvas.spacerHTML(10000,10000,_3)})} var _5=isc.addProperties({},this.editMaskDefaults,this.editMaskProperties,{editPane:_1,editPaneProxy:_1.editProxy,editContext:_2.editContext||_2.parentElement,keepInParentRect:_2.keepInParentRect},_4);this.$40i=isc.EH.makeEventMask(_2,_5)} this.$40i.show();if(isc.SVG&&isc.isA.SVG(_2)){if(isc.Browser.isIE)_2.showNativeMask();else{_2.setBackgroundColor("gray");_2.setContents(_3)}}},isc.A.hideEditMask=function isc_EditProxy_hideEditMask(){if(this.$40i)this.$40i.hide()},isc.A.setEditMaskBorder=function isc_EditProxy_setEditMaskBorder(_1){if(this.$40i)this.$40i.setBorder(_1)},isc.A.hasEditMask=function isc_EditProxy_hasEditMask(){return(this.$40i!=null)},isc.A.getEditMask=function isc_EditProxy_getEditMask(){return this.$40i},isc.A.mouseDown=function isc_EditProxy_mouseDown(_1){var _2=this.creator,_3=isc.EH.getTarget();if(_3==_2&&_2.useEventParts){if(_2.firePartEvent(_1,isc.EH.MOUSE_DOWN)==false)return false}},isc.A.dragMove=function isc_EditProxy_dragMove(){if(this.creator.dragMove)this.creator.dragMove()},isc.A.dragRepositionStart=function isc_EditProxy_dragRepositionStart(){if(this.creator.dragRepositionStart)this.creator.dragRepositionStart();this.$1313(true)},isc.A.dragRepositionStop=function isc_EditProxy_dragRepositionStop(){if(this.creator.dragRepositionStop)this.creator.dragRepositionStop();this.$1313(false)},isc.A.dragResizeStart=function isc_EditProxy_dragResizeStart(){if(this.creator.dragResizeStart)this.creator.dragResizeStart();this.$1313(true)},isc.A.dragResizeStop=function isc_EditProxy_dragResizeStop(){if(this.creator.dragResizeStop)this.creator.dragResizeStop();this.$1313(false)},isc.A.click=function isc_EditProxy_click(){if(this.creator.editNode){isc.EditContext.selectCanvasOrFormItem(this.creator,true);return isc.EH.STOP_BUBBLING}},isc.A.getAllSelectableComponents=function isc_EditProxy_getAllSelectableComponents(){var _1=this.creator;if(!_1.children)return null;var _2=[];for(var i=0;i<_1.children.length;i++){var _4=this.deriveSelectedComponent(_1.children[i]);if(_4)_2.add(_4)} return _2},isc.A.$1457=function isc_EditProxy__getSelectedAppearance(){if(this.selectedAppearance)return this.selectedAppearance;return(this.creator.editContext.selectionType==isc.Selection.MULTIPLE?this.$1454:this.$1455)},isc.A.showSelectedAppearance=function isc_EditProxy_showSelectedAppearance(_1,_2,_3){var _4,_5=this.$1457();if(_5==this.$1454){var _6=this.getEditMask();if(!_6||_6.destroyed)return;if(_6.$1458===_4){_6.$1458=(_6.backgroundColor===_4?null:_6.backgroundColor)} if(_6.$1459===_4){_6.$1459=(_6.opacity===_4?null:_6.opacity)} if(_1&&this.selectedTintColor!=_6.backgroundColor){_6.setBackgroundColor(this.selectedTintColor)}else if(!_1&&_6.$1458!=_6.backgroundColor){_6.setBackgroundColor(_6.$1458)} if(_1&&this.selectedTintOpacity!=_6.opacity){_6.setOpacity(this.selectedTintOpacity)}else if(!_1&&_6.$1459!=_6.opacity){_6.setOpacity(_6.$1459)} if(_1&&_3)isc.EditProxy.showResizeThumbs(_6);else isc.EditProxy.hideResizeThumbs();if(!_1)_6.moveAbove(this.creator)}else if(_5==this.$1455){var _6=this.getEditMask();if(!_6||_6.destroyed)return;if(_6.$146a===_4){_6.$146a=(_6.border===_4?null:_6.border)} if(_1&&this.selectedBorder!=_6.border){_6.setBorder(this.selectedBorder)}else if(!_1&&_6.$146a!=_6.border){_6.setBorder(_6.$146a)} if(_1&&_3)isc.EditProxy.showResizeThumbs(_6);else isc.EditProxy.hideResizeThumbs();if(!_1)_6.moveAbove(this.creator)}else if(_5==this.$1456){var _7=this.creator;if(_1){var _8,_9;if(_7.$73a){var _10=_7.type||_7._constructor;_9="["+_10+" "+(_7.name?"name:":"ID");_9+=_7.name||_7.ID;_9+="]";_8=_7;_7=_7.$73a} var _11=this.creator.editContext,_12=!_2;if(this.selectedBorder)isc.SelectionOutline.border=this.selectedBorder;if(_11.selectedLabelBackgroundColor)isc.SelectionOutline.labelBackgroundColor=_11.selectedLabelBackgroundColor;if(_11.showSelectedLabel==false)_12=false;if(_12!=false&&!_9&&_11.getSelectedLabelText){_9=_11.getSelectedLabelText(_7)} isc.SelectionOutline.select(_7,false,_12,_9,this.getResizeEdges());if(_3&&!isc.isA.TabBar(_7.parentElement)){isc.SelectionOutline.showDragHandle()} if(this.overrideDragProperties)this.overrideDragProperties()}else if(isc.SelectionOutline.getSelectedObject()==_7){isc.SelectionOutline.deselect();if(this.restoreDragProperties)this.restoreDragProperties()}}},isc.A.getResizeEdges=function isc_EditProxy_getResizeEdges(){var _1=this.creator,_2=_1.editContext,_3=_1.editNode,_4=_1.editContext.getEditNodeTree().getParent(_3),_5;if(_4){var _6=_4.liveObject;if(_6){if(isc.isA.Layout(_6)){var _7=_6.vertical,_8=((_7?_6.vPolicy:_6.hPolicy)==isc.Layout.FILL),_9=_6.getMembers().length,_10=_6.getMemberNumber(_1),_11=(_10==(_9-1)),_12=(!_8||!_11);if(_12){_5=(_7?"B":"R")}}}} return _5},isc.A.doubleClick=function isc_EditProxy_doubleClick(){var _1=this.creator;if(this.supportsInlineEdit&&_1.editContext.enableInlineEdit&&(this.inlineEditEvent=="doubleClick"||this.inlineEditEvent=="dblOrKeypress")) {this.startInlineEditing()} return isc.EH.STOP_BUBBLING},isc.A.willAcceptDrop=function isc_EditProxy_willAcceptDrop(_1){var _2=this.creator;this.logInfo("editProxy.willAcceptDrop for "+_2.ID,"editModeDragTarget");var _3=_2.ns.EH.dragTarget.getDragData(),_4,_5=true;if(_3==null||(isc.isAn.Array(_3)&&_3.length==0)){_5=false;this.logInfo("dragData is null - using the dragTarget itself","editModeDragTarget");_3=_2.ns.EH.dragTarget;if(isc.isA.FormItemProxyCanvas(_3)){this.logInfo("The dragTarget is a FormItemProxyCanvas for "+_3.formItem,"editModeDragTarget");_3=_3.formItem} _4=_3._constructor||_3.Class}else{if(isc.isAn.Array(_3))_3=_3[0];_4=_3.type||_3.className} this.logInfo("Using dragType "+_4,"editModeDragTarget");var _6=this.findEditNode(_4);if(_4==null||!this.canAdd(_4)){this.logInfo(_2.ID+" does not accept drop of type "+_4,"editModeDragTarget");var _7=_2.parentElement;while(_7&&!_7.editorRoot){if(_7.editingOn){var _8=_7.editProxy.willAcceptDrop();if(!_8){this.logInfo("No ancestor accepts drop","editModeDragTarget");if(_1!=false){if(_6&&_6.editProxy){_6.editProxy.showSelectedAppearance(false)} this.setNoDropIndicator()} return false} this.logInfo("An ancestor accepts drop","editModeDragTarget");return true} _7=_7.parentElement} this.logInfo(_2.ID+" has no parentElement in editMode","editModeDragTarget");if(_1!=false){if(_6&&_6.editProxy){_6.editProxy.showSelectedAppearance(false)} this.setNoDropIndicator()} return false} this.logInfo(_2.ID+" is accepting the "+_4+" drop","editModeDragTarget");if(_6){if(_1!=false){this.logInfo(_2.ID+": selecting editNode object "+_6.ID);if(_6.editProxy){_6.editProxy.showSelectedAppearance(true,false);_6.editProxy.clearNoDropIndicator()}} return true}else{this.logInfo("findEditNode() returned null for "+_2.ID,"editModeDragTarget")} if(_1!=false){this.logInfo("In editProxy.willAcceptDrop, '"+_2.ID+"' was willing to accept a '"+_4+"' drop but we could not find an ancestor with an editNode")} return true},isc.A.canDropAtLevel=function isc_EditProxy_canDropAtLevel(){var _1=this.creator,_2=_1.editContext;return this.allowNestedDrops!=false&&_2.allowNestedDrops!=false},isc.A.findEditNode=function isc_EditProxy_findEditNode(_1){var _2=this.creator;if(!_2.editNode){this.logInfo("Skipping '"+_2+"' - has no editNode","editModeDragTarget");if(_2.parentElement&&_2.parentElement.editProxy&&_2.parentElement.editProxy.findEditNode) {return _2.parentElement.editProxy.findEditNode(_1)}else{return null}} return _2},isc.A.canAdd=function isc_EditProxy_canAdd(_1){if(!this.canDropAtLevel())return false;var _2=this.creator;if(_2.getObjectField(_1)==null){var _3=isc.ClassFactory.getClass(_1);if(_3){if(_3.isA("FormItem")){return(_2.getObjectField("DynamicForm",this.$1698)!=null)}else if(_3.isA("DrawItem")){return(_2.getObjectField("DrawPane",this.$1698)!=null)}} return false}else{return true}},isc.A.clearNoDropIndicator=function isc_EditProxy_clearNoDropIndicator(_1){var _2=this.creator;if(_2.$uh)delete _2.$uh;_2.$k2()},isc.A.setNoDropIndicator=function isc_EditProxy_setNoDropIndicator(){var _1=this.creator;_1.$uh=true;_1.$v8(_1.noDropCursor)},isc.A.updateDropMargin=function isc_EditProxy_updateDropMargin(){var _1=this.creator,_2=this.defaultDropMargin;if(_2*2>_1.getVisibleHeight()-isc.EditProxy.minimumDropTargetSize){_2=Math.round((_1.getVisibleHeight()-isc.EditProxy.minimumDropTargetSize)/2);if(_2_8.right-this.dropMargin){this.logInfo("Close to right or left edge - passing drop through to parent for "+_1.ID,"editModeDragTarget");return true}} if(!_1.orientation||_1.orientation=="horizontal"){if(y<_8.top+this.dropMargin||y>_8.bottom-this.dropMargin){this.logInfo("Close to top or bottom edge - passing drop through to parent for "+_1.ID,"editModeDragTarget");return true}} this.logInfo(_1.ID+" is not passing drop through","editModeDragTarget");return false},isc.A.drop=function isc_EditProxy_drop(){if(this.shouldPassDropThrough()){return} var _1=this.creator,_2=isc.EH.dragTarget,_3,_4;if(!_2.isA("Palette")){if(_2.isA("FormItemProxyCanvas")){_2=_2.formItem} _4=_2._constructor||_2.Class}else{_3=_2.transferDragData();if(isc.isAn.Array(_3))_3=_3[0];_3.dropped=true;_4=_3.type||_3.className} if(_2.isA("TreeGrid")){_3=_2.data.getCleanNodeData([_3],false,false,false)[0]} _3=isc.clone(_3);if(!_2.isA("Palette")){isc.SelectionOutline.hideDragHandle();if(_2==_1)return;var _5=_1.editContext,_6=_1.editNode,_7=_5.getEditNodeTree(),_8=_7.getParent(_2.editNode);_5.removeNode(_2.editNode);var _9;if(_2.isA("FormItem")){if(_2.isA("CanvasItem")){_9=_5.addNode(_2.canvas.editNode,_6)}else{_9=_5.addWithWrapper(_2.editNode,_6)}}else if(_2.isA("DrawItem")){_9=_5.addWithWrapper(_2.editNode,_6,true)}else{_9=_5.addNode(_2.editNode,_6);var _10=isc.EH.getDragRect(),x=(_10?_10[0]-_1.getPageLeft():_1.getOffsetX()),y=(_10?_10[1]-_1.getPageTop():_1.getOffsetY());_9.liveObject.moveTo(x,y)} if(_9&&_9.liveObject){isc.EditContext.selectCanvasOrFormItem(_9.liveObject,true)}}else{var _13=isc.EH.shiftKeyDown();if(_3.loadData&&!_3.isLoaded){var _14=this;_3.loadData(_3,function(_15){_15=_15||_3;_15.isLoaded=true;_14.completeItemDrop(_15,_13) _15.dropped=_3.dropped});return isc.EH.STOP_BUBBLING} this.completeItemDrop(_3,_13)} return isc.EH.STOP_BUBBLING},isc.A.completeItemDrop=function isc_EditProxy_completeItemDrop(_1,_2){var _3=this.creator;if(!_3.editContext)return;var _4=_3.editContext,_5=_1.type||_1.className,_6,_7=false;var _8=isc.ClassFactory.getClass(_5);if(_8&&(_8.isA("FormItem")||_8.isA("DrawItem"))){_6=_4.makeEditNode(_1);if(_8&&_8.isA("FormItem")){_6=_3.editContext.addWithWrapper(_6,_3.editNode)}else{_6=_3.editContext.addWithWrapper(_6,_3.editNode,true)} _7=true}else{var _9=_4.addFromPaletteNodes([_1],_3.editNode);if(_9&&_9.length>0)_6=_9[0]} var _10=_6;if(_7){var _11=_4.getEditNodeTree(),_12=_11.getParent(_10);if(_12)_10=_12} var x=_3.getOffsetX(),y=_3.getOffsetY();if(_3.childrenSnapToGrid&&!_2){x=_3.getHSnapPosition(x);y=_3.getVSnapPosition(y)} if(_10.liveObject&&_10.liveObject.moveTo)_10.liveObject.moveTo(x,y);if(this.canSelectChildren&&_6.liveObject.editProxy!=null&&_6.liveObject.editProxy.canSelect!=false) {_4.selectSingleComponent(_10.liveObject)} if(_10.liveObject&&_10.liveObject.editProxy&&_10.liveObject.editProxy.nodeDropped){_10.liveObject.editProxy.nodeDropped()}},isc.A.dropMove=function isc_EditProxy_dropMove(){if(!this.canDropAtLevel())return;if(!this.willAcceptDrop())return false;if(!this.shouldPassDropThrough()){if(this.creator.dropMove&&this.creator.getClass()!=isc.Canvas&&this.creator.getClass()!=isc.EditPane&&this.creator.getClass()!=isc.TabSet&&this.creator.getClass()!=isc.DetailViewer) {this.creator.Super("dropMove",arguments)} var _1=this.creator,_2=_1.parentElement;if(_2&&_2.hideDropLine){_2.hideDropLine();if(_2.isA("FormItem")){_2.form.hideDragLine()}else if(_2.isA("DrawItem")){_2.drawPane.hideDragLine()}} return isc.EH.STOP_BUBBLING}},isc.A.dropOver=function isc_EditProxy_dropOver(){if(!this.canDropAtLevel())return;if(!this.willAcceptDrop())return false;if(!this.shouldPassDropThrough()){if(this.creator.dropMove&&this.creator.getClass()!=isc.Canvas&&this.creator.getClass()!=isc.EditPane&&this.creator.getClass()!=isc.DrawPane&&this.creator.getClass()!=isc.TabSet&&this.creator.getClass()!=isc.DetailViewer) {this.creator.Super("dropOver",arguments)} var _1=this.creator,_2=_1.parentElement;if(_2&&_2.hideDropLine){_2.hideDropLine();if(_2.isA("FormItem")){_2.form.hideDragLine()}else if(_2.isA("DrawItem")){_2.drawPane.hideDragLine()}} this.$1313(true);return isc.EH.STOP_BUBBLING} this.$1313(true)},isc.A.dropOut=function isc_EditProxy_dropOut(){this.showSelectedAppearance(false);if(this.creator.dropOut)this.creator.dropOut();this.$1313(false)},isc.A.overrideDragProperties=function isc_EditProxy_overrideDragProperties(){if(this.$146t)return;var _1=this.creator.editContext;var _2={canDrop:true,dragAppearance:"outline",dragStart:function(){return true},dragMove:function(){return true},setDragTracker:function(){isc.EH.setDragTracker("");return false},dragStop:function(){isc.SelectionOutline.hideProxyCanvas();isc.SelectionOutline.positionDragHandle()}};this.overrideProperties(_2);this.$146t=true},isc.A.restoreDragProperties=function isc_EditProxy_restoreDragProperties(){this.creator.restoreFromOriginalValues(["canDrag","canDrop","dragAppearance","dragStart","dragMove","dragStop","setDragTracker"]);this.$146t=false},isc.A.$1313=function isc_EditProxy__showSnapGrid(_1){var _2=this.creator;if(_2.childrenSnapToGrid||_2.childrenSnapResizeToGrid){_2.setShowSnapGrid(_1)}},isc.A.setDataSource=function isc_EditProxy_setDataSource(_1,_2,_3){var _4=this.creator;if(isc.$75u){_4.setDataSource(_1,_2);return} if(_1==null)return;if(_1==_4.dataSource&&!_3)return;var _2=_4.getFields(),_5=[],_6=[];if(_2){var _7=_4.editContext.getEditNodeTree(),_8=_7.findById(_4.ID),_9=_7.getChildren(_8);for(var i=0;i<_2.length;i++){var _11=_2[i],_12=null;for(var j=0;j<_9.length;j++){var _14=_9[j];if(_11.name==_14.name){_12=_14;break}} if(_12&&_12.autoGen&&!this.fieldEdited(_4,_12)){_6.add(_12)}else if(_12){var _15=isc.addProperties({},_11.editingOn?_11.editNode.defaults:_11);_5.add(_11)}} _4.setFields(_5);if(!this.$1479){for(var i=0;i<_6.length;i++){_4.editContext.removeNode(_6[i],true)}}} var _16,_2=_1.fields;if(_2&&isc.getKeys(_2).length==1&&_1.fieldIsComplexType(_2[isc.firstKey(_2)].name)) {_16=_1.getSchema(_2[isc.firstKey(_2)].type)}else{_16=_1} var _17=_16.getFields();_2={};for(var _18 in _17){var _11=_17[_18];if(!_4.shouldUseField(_11,_1))continue;_2[_18]=_17[_18];_2[_18]=isc.addProperties({},_17[_18])} _5.addList(isc.getValues(_2));_4.setDataSource(_1,_5);if(!this.$1479){for(var _18 in _2){var _11=_2[_18];var _19=this.makeFieldPaletteNode(_11,_16);var _12=_4.editContext.makeEditNode(_19);_4.editContext.addNode(_12,_4.editNode,null,null,true)}}},isc.A.fieldEdited=function isc_EditProxy_fieldEdited(_1,_2){var _3=false;if(_2.defaults){var _4=_2.defaults,_5=false;for(var _6 in _4){if(_6=="name"||_6=="title"||_6.startsWith("_"))continue;_5=true;break} if(!_5){var _7=_4["name"],_8=_4["title"];if(_8){var _9;if(_1&&_1.dataSource){var _10=_1.dataSource;if(isc.isA.String(_10))_10=isc.DS.getDataSource(_10);if(_10){var _11=_10.getField(_7) if(_11)_9=_11.title}} if((!_9&&_8!=isc.DataSource.getAutoTitle(_7))||(_9&&_8!=_9)) {_3=true}}}else{_3=true}} return _3},isc.A.makeFieldPaletteNode=function isc_EditProxy_makeFieldPaletteNode(_1,_2){var _3=this.creator.Class+"Field";var _4={type:_3,autoGen:true,defaults:{name:_1.name,title:_1.title||_2.getAutoTitle(_1.name)}};return _4},isc.A.startInlineEditing=function isc_EditProxy_startInlineEditing(_1,_2){if(!this.supportsInlineEdit||!this.creator.editContext.enableInlineEdit)return;var _3=this.createInlineEditForm(),_4=this.getInlineEditText(),_5=_2==="Backspace";if(_1!=null)_4=(_4?_4+_1:_1);else if(_5){if(!_4)_4="";else{_4=String(_4);_4=_4.substring(0,_4.length-1)}} _3.setValues({edit:_4});this.inlineEditForm=_3;if(!this.inlineEditLayout){this.inlineEditLayout=this.createInlineEditLayout()}else if(this.inlineEditLayout.getMembers().length>0){this.inlineEditLayout.removeMembers(this.inlineEditLayout.getMembers())} var _6=this.inlineEditLayout;_6.addMember(_3);if(this.inlineEditInstructions){if(!this.inlineEditInstructionLabelDefaults.baseStyle){isc.EditProxy.changeDefaults("inlineEditInstructionLabelDefaults",{baseStyle:isc.Hover.hoverCanvasDefaults.baseStyle})} if(!this.inlineEditInstructionLabel){this.inlineEditInstructionLabel=this.createInlineEditInstructionLabel()} this.inlineEditInstructionLabel.setContents(this.inlineEditInstructions);_6.addMember(this.inlineEditInstructionLabel)} this.positionAndSizeInlineEditor();_6.show();_6.showClickMask({target:_6,methodName:"dismissEditor"},"soft",[_6]);var _7=_3.getItem(this.$1472);if(_7){_7.focusInItem();if(_1||_5){var _8=(_4!=null?_4.length:0);_7.delayCall("setSelectionRange",[_8,_8])}else{_7.delayCall("selectValue")}}},isc.A.createInlineEditLayout=function isc_EditProxy_createInlineEditLayout(){return isc.VStack.create({dismissEditor:function(){this.hide()}})},isc.A.createInlineEditForm=function isc_EditProxy_createInlineEditForm(){var _1=isc.addProperties({name:this.$1472,type:(this.inlineEditMultiline?"TextArea":"text"),allowNativeResize:this.inlineEditMultiline,width:"*",height:"*",showTitle:false},{keyPress:function(_4,_2,_5){if(_5=="Escape"){_2.discardUpdate=true;_2.parentElement.hide()}else if(_5=="Enter"){if(!isc.isA.TextAreaItem(_4))_4.blurItem()}},blur:function(_2,_4){_2.saveOrDiscardValue();_2.parentElement.hide();if(_2.creator.inlineEditingComplete)_2.creator.inlineEditingComplete()}});var _2=this.createAutoChild("inlineEditForm",{margin:0,padding:0,cellPadding:0,minWidth:(this.inlineEditMultiline?250:null),fields:[_1],saveOrDiscardValue:function(){if(!this.discardUpdate){var _3=this.getValue(this.creator.$1472);this.creator.setInlineEditText(_3)}}});return _2},isc.A.createInlineEditInstructionLabel=function isc_EditProxy_createInlineEditInstructionLabel(){return this.createAutoChild("inlineEditInstructionLabel")},isc.A.positionAndSizeInlineEditor=function isc_EditProxy_positionAndSizeInlineEditor(){this.positionInlineEditor();this.sizeInlineEditor()},isc.A.positionInlineEditor=function isc_EditProxy_positionInlineEditor(){var _1=this.creator,_2=_1.getPageLeft(),_3=_1.getPageTop();this.inlineEditLayout.moveTo(_2,_3)},isc.A.sizeInlineEditor=function isc_EditProxy_sizeInlineEditor(){var _1=this.creator,_2=this.inlineEditLayout,_3=_1.getVisibleWidth(),_4=this.inlineEditForm.minWidth||1,_5=_1.getVisibleHeight(),_6=this.inlineEditForm.minHeight||1;_3=Math.max(_3,_4);if(this.inlineEditMultiline)_5=Math.min(Math.max(_5,50),200);else _5=_6;_2.setWidth(_3);this.inlineEditForm.setHeight(_5)},isc.A.inlineEditingComplete=function isc_EditProxy_inlineEditingComplete(){},isc.A.getInlineEditText=function isc_EditProxy_getInlineEditText(){if(this.creator.isGroup)return this.creator.groupTitle;return this.creator.getContents()},isc.A.setInlineEditText=function isc_EditProxy_setInlineEditText(_1){var _2=this.creator,_3;if(_2.isGroup)_3={groupTitle:_1};else _3={contents:_1};_2.editContext.setNodeProperties(_2.editNode,_3)});isc.B._maxIndex=isc.C+55;isc.defineClass("CanvasEditProxy","EditProxy");isc.A=isc.CanvasEditProxy.getPrototype();isc.A.persistCoordinates=null;isc.A=isc.CanvasEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.hoopSelectorDefaults={_constructor:"Canvas",$1452:true,autoDraw:false,keepInParentRect:true,redrawOnResize:false,overflow:"hidden"};isc.B.push(isc.A.mouseDown=function isc_CanvasEditProxy_mouseDown(_1){var _2=this.Super("mouseDown",arguments);if(_2==false)return _2;var _3=this.creator,_4=isc.EH.getTarget();if(!this.canSelectChildren||this.canSelect==false)return;var _5=_3.editContext;if(_4!=_3)return;if(!(isc.EH.shiftKeyDown()||(isc.Browser.isWin&&isc.EH.ctrlKeyDown()))){_5.deselectAllComponents()} if(_5.selectionType!=isc.Selection.MULTIPLE)return;if(this.hoopSelector==null){var _6=isc.addProperties({},this.hoopSelectorDefaults,this.hoopSelectorProperties,{border:this.selectedBorder},{left:isc.EH.getX(),top:isc.EH.getY()});this.hoopSelector=_3.createAutoChild("hoopSelector",_6);_3.addChild(this.hoopSelector)} this.$79h=_3.getOffsetX();this.$79i=_3.getOffsetY();this.$136k=_5.getSelectedComponents();this.resizeHoopSelector();this.hoopSelector.show()},isc.A.dragMove=function isc_CanvasEditProxy_dragMove(){this.Super("dragMove",arguments);if(this.hoopSelector&&this.hoopSelector.isVisible())this.resizeHoopSelector()},isc.A.dragStop=function isc_CanvasEditProxy_dragStop(){if(this.hoopSelector&&this.hoopSelector.isVisible()){this.hoopSelector.hide();var _1=this.creator.editContext.getSelectedComponents();if(!this.$136k.equals(_1)){this.creator.editContext.showGroupSelectionBox();this.creator.editContext.fireSelectedEditNodesUpdated()}}},isc.A.mouseUp=function isc_CanvasEditProxy_mouseUp(){if(!this.canSelectChildren)return;if(this.hoopSelector&&this.hoopSelector.isVisible()){this.hoopSelector.hide();var _1=this.creator.editContext.getSelectedComponents();if(!this.$136k.equals(_1)){this.creator.editContext.showGroupSelectionBox();this.creator.editContext.fireSelectedEditNodesUpdated()}}},isc.A.updateCurrentSelection=function isc_CanvasEditProxy_updateCurrentSelection(){var _1=this.creator,_2=_1.editContext,_3=isc.isA.DrawPane(_1);var _4=(_3?_1.drawItems:_1.children);if(!_4)return;var _5=_2.getSelectedComponents(),_6=(_2.hoopSelectionMode=="intersects"?"intersects":"encloses"),_7=(isc.EH.shiftKeyDown()||(isc.Browser.isWin&&isc.EH.ctrlKeyDown()));if(!_7)_2.selectedComponents=[];for(var i=0;i<_4.length;i++){var _9=_4[i],_10=(_9.creator&&(isc.isA.DrawKnob(_9.creator)||_9.$145w));if(!_10&&this.hoopSelector[_6](_9)){if(!_3)_9=this.deriveSelectedComponent(_9);if(_9&&!_2.selectedComponents.contains(_9)){if(_9.editProxy&&_9.editProxy.canSelect!=false){_2.selectedComponents.add(_9)}}}} for(var i=0;i<_2.selectedComponents.length;i++){_2.selectedComponents[i].editProxy.showSelectedAppearance(true,true)} if(!_7){_5.removeList(_2.selectedComponents);for(var i=0;i<_5.length;i++){_5[i].editProxy.showSelectedAppearance(false)}}},isc.A.deriveSelectedComponent=function isc_CanvasEditProxy_deriveSelectedComponent(_1){var _2=this.creator;if(_1.masterElement)return this.deriveSelectedComponent(_1.masterElement);if(!_1.parentElement||_1.parentElement==_2){if(_1.editProxy&&_1.editProxy.hasEditMask())return _1;return null} return this.deriveSelectedComponent(_1.parentElement)},isc.A.resizeHoopSelector=function isc_CanvasEditProxy_resizeHoopSelector(){var _1=this.creator,x=_1.getOffsetX(),y=_1.getOffsetY();if(this.hoopSelector.keepInParentRect){if(x<0)x=0;var _4=this.hoopSelector.parentElement.getVisibleHeight();if(y>_4)y=_4} this.hoopSelector.resizeTo(Math.abs(x-this.$79h),Math.abs(y-this.$79i));if(x_9)_10--;var _11;if(_2.isA("FormItem")){if(_2.isA("CanvasItem")){_11=_1.editContext.addNode(_2.canvas.editNode,_6,_10)}else{_11=_1.editContext.addWithWrapper(_2.editNode,_6)}}else if(_2.isA("DrawItem")){_11=_1.editContext.addWithWrapper(_2.editNode,_6,true)}else{_11=_1.editContext.addNode(_2.editNode,_6,_10)} if(isc.isA.TabSet(_6.liveObject)){_6.liveObject.selectTab(_2)}else if(_11&&_11.liveObject){isc.EditContext.delayCall("selectCanvasOrFormItem",[_11.liveObject,true],200)}}else{var _12;var _13=isc.ClassFactory.getClass(_4);if(_13&&_13.isA("FormItem")){_12=_1.editContext.addWithWrapper(_3,_6)}else if(_13&&_13.isA("DrawItem")){_12=_1.editContext.addWithWrapper(_3,_6,true)}else{_12=_1.editContext.addNode(_3,_6,_1.getDropPosition(_4))} if(_12!=null){if(_3.liveObject.editProxy&&_3.liveObject.editProxy.nodeDropped){_3.liveObject.editProxy.nodeDropped()}}} _1.hideDropLine();return isc.EH.STOP_BUBBLING},isc.A.dropMove=function isc_LayoutEditProxy_dropMove(){if(!this.willAcceptDrop())return false;if(!this.shouldPassDropThrough()){var _1=this.creator;if(_1.dropMove)_1.dropMove();if(_1.parentElement&&_1.parentElement.hideDropLine){_1.parentElement.hideDropLine();if(_1.parentElement.isA("FormItem")){_1.parentElement.form.hideDragLine()}else if(_1.parentElement.isA("DrawItem")){_1.parentElement.drawPane.hideDragLine()}} return isc.EH.STOP_BUBBLING}else{this.creator.hideDropLine()}},isc.A.dropOver=function isc_LayoutEditProxy_dropOver(){if(!this.willAcceptDrop())return false;if(!this.shouldPassDropThrough()){var _1=this.creator;if(_1.dropOver)_1.dropOver();if(_1.parentElement&&_1.parentElement.hideDropLine){_1.parentElement.hideDropLine();if(_1.parentElement.isA("FormItem")){_1.parentElement.form.hideDragLine()}else if(_1.parentElement.isA("DrawItem")){_1.parentElement.drawPane.hideDragLine()}} return isc.EH.STOP_BUBBLING}else{this.creator.hideDropLine()}});isc.B._maxIndex=isc.C+3;isc.defineClass("DeckEditProxy","LayoutEditProxy");isc.A=isc.DeckEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.addPane=function isc_DeckEditProxy_addPane(_1,_2){var _3=this.creator;_3.addPane(_1,_2);_3.setCurrentPane(_1)});isc.B._maxIndex=isc.C+1;isc.defineClass("NavPanelEditProxy","LayoutEditProxy");isc.A=isc.NavPanelEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.supportsInlineEdit=true;isc.A.inlineEditEvent="none";isc.B.push(isc.A.startItemInlineEditing=function isc_NavPanelEditProxy_startItemInlineEditing(_1,_2){this.$167s=_1;this.$167t=_2;this.startInlineEditing()},isc.A.positionAndSizeInlineEditor=function isc_NavPanelEditProxy_positionAndSizeInlineEditor(){var _1=this.creator,_2=_1.navGrid,_3=_2.getPageOffsets(),_4=_2.getRowTop(this.$167t),_5=_2.getVisibleWidth(),_6=this.inlineEditForm.minWidth||1,_7=_2.getRowHeight(this.$167s,this.$167t),_8=this.inlineEditForm.minHeight||1;this.inlineEditLayout.setRect(_3.left,_3.top+_4,Math.max(_6,_5),Math.max(_8,_7))},isc.A.getInlineEditText=function isc_NavPanelEditProxy_getInlineEditText(){var _1=this.$167s;if(_1==null||_1.title==null)return"";return _1.title},isc.A.setInlineEditText=function isc_NavPanelEditProxy_setInlineEditText(_1){var _2=this.creator;var _3=_2.editContext;_3.setNodeProperties(this.$167s.editNode,{title:_1});var _4=_2.navGrid;if(_4!=null){var _5=_4.body;if(_5!=null)_5.redrawIfDirty("setInlineEditText")}},isc.A.onFolderDrop=function isc_NavPanelEditProxy_onFolderDrop(_1,_2,_3,_4,_5){var _6=this.creator;var _7=_2.editContext||_6.editContext;var _8=_2.editNode||_6.editNode;var _9=_1[0].type;if(_9==null)return;var _10;if(_4=="over"){if(_9=="NavItem"){_10=_7.addFromPaletteNode(_1[0],_8)}else if(_8.liveObject.isHeader){var _11=_7.findPaletteNode("type","NavItem") var _12=_7.addFromPaletteNode(_11,_8,_3);_10=_12;var _13=_12.liveObject.editContext.addFromPaletteNode(_1[0],_12);_6.setItemPane(_12.liveObject,_13.liveObject)}else{var _13=_7.addFromPaletteNode(_1[0],_8);_6.setItemPane(_2,_13.liveObject)}}else{if(_9=="NavItem"){_10=_7.addFromPaletteNode(_1[0],_8,_3)}else{var _11=_7.findPaletteNode("type","NavItem") var _12=_7.addFromPaletteNode(_11,_8,_3);_10=_12;var _13=_12.liveObject.editContext.addFromPaletteNode(_1[0],_12);_6.setItemPane(_12.liveObject,_13.liveObject)}} if(_10!=null){var _14=_10.liveObject;if(!_14.isSeparator){_6.editProxy.delayCall("startItemInlineEditing",[_14,_6.navGrid.getRecordIndex(_14)])}} return false},isc.A.setEditMode=function isc_NavPanelEditProxy_setEditMode(_1){var _2=this.Super("setEditMode",arguments);if(_1){this.creator.navGrid.canAcceptDroppedRecords=true;this.creator.navGrid.canDragRecordsOut=true;this.creator.navGrid.canReorderRecords=false;this.creator.navGrid.canReparentNodes=false;this.creator.navGrid.canDropOnLeaves=true;this.creator.navGrid.onFolderDrop=this.onFolderDrop;this.creator.navGrid.dragDataAction="copy";this.creator.navGrid.showOpenIcons=true;this.creator.navGrid.showDropIcons=true;this.creator.navGrid.$31i();this.creator.editContext.setNodeProperties(this.creator.editNode,{currentItemId:this.creator.currentItemId})}else{this.creator.navGrid.canAcceptDroppedRecords=false;this.creator.navGrid.canDropOnLeaves=false;this.creator.navGrid.canDragRecordsOut=false;this.creator.navGrid.canReorderRecords=false;this.creator.navGrid.canReparentNodes=false;delete this.creator.navGrid.onFolderDrop;this.creator.navGrid.$31i()}},isc.A.canAdd=function isc_NavPanelEditProxy_canAdd(_1){var _2=this.creator;if(_1=="NavItem"&&!_2.navGrid.containsEvent()){return false} return true},isc.A.drop=function isc_NavPanelEditProxy_drop(){this.creator.navDeck.setBorder("");if(!this.creator.navGrid.containsEvent()){if(this.shouldPassDropThrough()){return} var _1=this.creator,_2=isc.EH.dragTarget,_3,_4;if(!_2.isA("Palette")){if(_2.isA("FormItemProxyCanvas")){_2=_2.formItem} _4=_2._constructor||_2.Class}else{_3=_2.transferDragData();if(isc.isAn.Array(_3))_3=_3[0];_3.dropped=true;_4=_3.type||_3.className} if(_2.isA("TreeGrid")){_3=_2.data.getCleanNodeData([_3],false,false,false)[0]} _3=isc.clone(_3);if(!_2.isA("Palette")){isc.SelectionOutline.hideDragHandle();if(_2==_1)return;var _5=_1.editContext,_6=_1.editNode,_7=_5.getEditNodeTree(),_8=_7.getParent(_2.editNode);_5.removeNode(_2.editNode)} var _9=this.creator.navGrid.getSelectedRecord();if(_9==null){_9=this.creator.navGrid.data.getRoot()} this.onFolderDrop([_3],_9,0,"over")} return isc.EH.STOP_BUBBLING},isc.A.dropOut=function isc_NavPanelEditProxy_dropOut(){this.creator.navDeck.setBorder("");return isc.EH.STOP_BUBBLING},isc.A.dropMove=function isc_NavPanelEditProxy_dropMove(){if(!this.willAcceptDrop())return false;if(this.creator.hideDropLine)this.creator.hideDropLine();if(!this.shouldPassDropThrough()){if(this.creator.navGrid.containsEvent()){this.creator.navDeck.setBorder("")}else{this.creator.navDeck.setBorder("2px dashed blue")} return isc.EH.STOP_BUBBLING}});isc.B._maxIndex=isc.C+10;isc.defineClass("SplitPaneEditProxy","LayoutEditProxy");isc.A=isc.SplitPaneEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.dropOverlayDefaults={backgroundColor:"white",visibility:"hidden",width:"100%",height:"100%",paneDefaults:{_constructor:"VLayout",border:"1px solid blue",align:"center",showDropLines:false},initWidget:function(){this.Super("initWidget",arguments);this.navPane=this.createPane("30%","Navigation Pane","navigationPane");this.listPane=this.createPane("100%","List Pane","listPane");this.detailPane=this.createPane("100%","Detail Pane","detailPane");var _1=isc.VLayout.create({widht:"70%",members:[this.listPane,this.detailPane]});this.addChild(isc.HLayout.create({width:"100%",height:"100%",members:[this.navPane,_1]}));this.$1497=[this.navPane,this.listPane,this.detailPane]},createPane:function(_1,_2,_3){var _4=this.getPaneText(_2,false,_3),_5=isc.Label.create({align:"center",overflow:"hidden",contents:_4});return this.createAutoChild("pane",{width:_1,members:[_5],name:_2,canAcceptDrop:true,parentProperty:_3,drop:function(){return this.creator.creator.addPane(this.parentProperty)}})},setPaneLabel:function(_1,_2){var _3=_1.getMember(0);_3.setContents(_2)},getPaneText:function(_1,_2,_3){var _4=(_2?"style='color:#0000ff'":""),_5=""+_1+"",_6=this.creator,_7=_6.creator,_8=_7[_3];if(_8){var _9=(this.editContext.getSelectedLabelText?this.editContext.getSelectedLabelText(_8):_8.toString());_5+="
Currently: "+_9+""} return _5},canAcceptDrop:true,drop:function(){if(this.$1498){this.creator.addPane(this.$1498.parentProperty)} return isc.EH.STOP_BUBBLING},dropMove:function(){var _1,x=isc.EH.getX(),y=isc.EH.getY();for(var i=0;i_10)_11--;var _12;if(_3.isA("FormItem")){if(_3.isA("CanvasItem")){_3.canvas.editNode.defaults.parentProperty=_1;_12=_2.editContext.addNode(_3.canvas.editNode,_7,_11,_1)}else{_3.editNode.defaults.parentProperty=_1;_12=_2.editContext.addWithWrapper(_3.editNode,_7,null,_1)}}else if(_3.isA("DrawItem")){_3.editNode.defaults.parentProperty=_1;_12=_2.editContext.addWithWrapper(_3.editNode,_7,true,_1)}else{_3.editNode.defaults.parentProperty=_1;_12=_2.editContext.addNode(_3.editNode,_7,_11,_1)} if(isc.isA.TabSet(_7.liveObject)){_7.liveObject.selectTab(_3)}else if(_12&&_12.liveObject){isc.EditContext.delayCall("selectCanvasOrFormItem",[_12.liveObject,true],200)}}else{var _13;var _14=isc.ClassFactory.getClass(_5);if(_14&&_14.isA("FormItem")){_13=_2.editContext.addWithWrapper(_4,_7,null,_1)}else if(_14&&_14.isA("DrawItem")){_13=_2.editContext.addWithWrapper(_4,_7,true,_1)}else{_13=_2.editContext.addNode(_4,_7,_2.getDropPosition(_5),_1)} if(_13!=null){if(_4.liveObject.editProxy&&_4.liveObject.editProxy.nodeDropped){_4.liveObject.editProxy.nodeDropped()}}} _2.hideDropLine();return isc.EH.STOP_BUBBLING});isc.B._maxIndex=isc.C+6;isc.defineClass("SectionStackEditProxy","LayoutEditProxy");isc.A=isc.SectionStackEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.supportsInlineEdit=false;isc.B.push(isc.A.canAdd=function isc_SectionStackEditProxy_canAdd(_1){if(!this.canDropAtLevel())return false;if(_1=="SectionStackSection")return true;var _2=isc.ClassFactory.getClass(_1);if(_2&&(_2.isA("Canvas")||_2.isA("FormItem")||_2.isA("DrawItem"))) {return true} return false},isc.A.modifyEditNode=function isc_SectionStackEditProxy_modifyEditNode(_1,_2,_3){if(_3=="SectionStackSection")return _2;var _4=this.creator.getDropPosition();if(_4==0){isc.warn("Cannot drop before the first section header");return false} var _5=this.$700();for(var i=_5.length-1;i>=0;i--){if(_4>_5[i]){return this.creator.getSectionHeader(i).editNode}} return _2},isc.A.getDropPosition=function isc_SectionStackEditProxy_getDropPosition(_1){var _2=this.creator.invokeSuper(isc.SectionStack,"getDropPosition");if(!_1||_1=="SectionStackSection"){return _2} var _3=this.$700();for(var i=_3.length-1;i>=0;i--){if(_2>_3[i]){return _2-_3[i]-1}} return 0},isc.A.$700=function isc_SectionStackEditProxy__getHeaderPositions(){var _1=this.creator,_2=[],j=0;for(var i=0;i<_1.getMembers().length;i++){if(_1.getMember(i).isA(_1.sectionHeaderClass)){_2[j++]=i}} return _2});isc.B._maxIndex=isc.C+4;isc.defineClass("TabSetEditProxy","CanvasEditProxy");isc.A=isc.TabSetEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.persistCoordinates=false;isc.A.inlineEditOnDrop=true;isc.A.inlineEditInstructions="Enter tab titles (comma separated)";isc.B.push(isc.A.setEditMode=function isc_TabSetEditProxy_setEditMode(_1){this.Super("setEditMode",arguments);var _2=this.creator;if(_1){for(var i=0;i<_2.tabs.length;i++){var _4=_2.tabs[i];this.saveTabProperties(_4)} _2.closeClick=function(_4){}}else{for(var i=0;i<_2.tabs.length;i++){var _4=_2.tabs[i];this.restoreTabProperties(_4)}} _2.tabBar.setEditMode(_1,_2.editContext,null);_2.paneContainer.setEditMode(_1,_2.editContext,null)},isc.A.saveTabProperties=function isc_TabSetEditProxy_saveTabProperties(_1){var _2=this.creator.getTab(_1);if(_2){_2.saveToOriginalValues(["closeClick","icon","iconSize","iconOrientation","iconAlign","disabled"])}},isc.A.restoreTabProperties=function isc_TabSetEditProxy_restoreTabProperties(_1){var _2=this.creator.getTab(_1);if(_2){_2.restoreFromOriginalValues(["closeClick","icon","iconSize","iconOrientation","iconAlign","disabled"])}},isc.A.getInlineEditText=function isc_TabSetEditProxy_getInlineEditText(){var _1=this.creator,_2=_1.tabs,_3=null;for(var i=0;i<_2.length;i++){var _5=_2[i].title.replace(/,/,"\\,");_3=(_3?_3+", ":"")+_5+(_2[i].canClose?" [x]":"")} return _3},isc.A.setInlineEditText=function isc_TabSetEditProxy_setInlineEditText(_1){var _2=isc.EditProxy.splitString(_1,",","\\");var _3=[];for(var i=0;i<_2.length;i++){if(_2[i].endsWith("[x]")||_2[i].endsWith("[X]")){_2[i]=_2[i].replace(/\[[xX]\]/,"").replace(/\s+$/,"");_3.add(_2[i])}} var _5=this.creator,_6=_5.tabs,_7=[],_8=[];if(_6.length>0){for(var i=0;i<_6.length;i++){if(!_2.contains(_6[i].title)){_7.add(_6[i].editNode)}else if(_2.contains(_6[i].title)){_8.add(_6[i].title);this.creator.editContext.setNodeProperties(_6[i].editNode,{canClose:_3.contains(_6[i].title)})}}} _7.map(function(_10){_5.editContext.removeNode(_10)});for(var i=0;i<_2.length;i++){if(_8.contains(_2[i]))continue;var _9={type:"Tab",defaults:{title:_2[i]}};var _10=this.creator.editContext.addNode(this.creator.editContext.makeEditNode(_9),this.creator.editNode,i);this.addDefaultPane(_10)}},isc.A.addDefaultPane=function isc_TabSetEditProxy_addDefaultPane(_1){if(!_1)return;var _2=isc.addProperties({},this.creator.defaultPaneDefaults);if(!_2.type&&!_2.className){_2.type=_2._constructor||this.creator.defaultPaneConstructor} this.creator.editContext.addNode(this.creator.editContext.makeEditNode(_2),_1)},isc.A.addTabsEditModeExtras=function isc_TabSetEditProxy_addTabsEditModeExtras(_1){if(this.creator.editingOn){for(var i=0;i<_1.length;i++){this.saveTabProperties(_1[i])}}},isc.A.removeTabsEditModeExtras=function isc_TabSetEditProxy_removeTabsEditModeExtras(){},isc.A.reorderTabsEditModeExtras=function isc_TabSetEditProxy_reorderTabsEditModeExtras(_1,_2){if(this.creator.editContext&&this.creator.editContext.reorderNode){this.creator.editContext.reorderNode(this.creator.editNode,_1,_2)}},isc.A.findEditNode=function isc_TabSetEditProxy_findEditNode(_1){this.logInfo("In TabSet.findEditNode, dragType is "+_1,"editModeDragTarget");if(_1!="Tab"){var _2=this.creator.getTab(this.creator.getSelectedTabNumber());if(_2&&_2.editNode)return _2;for(var i=0;i0?_2:"")+_7.name+(_8!=null?this.dataDisplaySeparatorChar+_8:"")} return _5},isc.A.setInlineEditText=function isc_DetailViewerEditProxy_setInlineEditText(_1){var _2=(this.inlineEditMultiline?"\n":this.dataSeparatorChar);var _3=isc.EditProxy.parseStringValueMap(_1,_2,this.dataEscapeChar,this.dataDisplaySeparatorChar,null,false,true);var _4=_3.valueMap,_5=[];for(var _6 in _4)_5.add({name:_6});this.creator.editContext.setNodeProperties(this.creator.editNode,{data:_4,fields:_5})});isc.B._maxIndex=isc.C+2;isc.defineClass("MenuEditProxy","CanvasEditProxy");isc.A=isc.MenuEditProxy;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.parseMenuButtonString=function isc_c_MenuEditProxy_parseMenuButtonString(_1){var _2=isc.MenuEditProxy.parseMenuBarString(_1,true);return(_2.length>0?_2[0]:null)},isc.A.parseMenuBarString=function isc_c_MenuEditProxy_parseMenuBarString(_1,_2){var _3=_1.trim().split("\n"),_4=[],_5=[],_6;for(var i=0;i<_3.length;i++){var _8=_3[i].trim();if(/^-+$/.test(_8)||/^=+$/.test(_8)){_4.add(_8);continue} if(_8.startsWith("--")||_8.startsWith("==")||_8.startsWith("title:")){if(_4.length>0){var _9=isc.MenuEditProxy.parseMenuString(_4.join("\n")),_10={title:_6||"Menu",data:_9};_5.add(_10);_4=[];if(_2)return _5}else if(_6){_5.add({title:_6});if(_2)return _5} if(_8.startsWith("title:")){_6=_8.replace(/^title:/,"").trim()}else{_6=_8.substring(2).trim()}}else{_4.add(_8)}} if(_4.length>0||_6){var _9=this.parseMenuString(_4.join("\n")),_10={title:_6||"Menu",data:_9};_5.add(_10)} return _5},isc.A.parseMenuString=function isc_c_MenuEditProxy_parseMenuString(_1){var _2=_1.trim().split("\n");var _3=[];for(var i=0;i<_2.length;i++){var _5=_2[i];if(/^-+$/.test(_5)||/^=+$/.test(_5)){_3.add({isSeparator:true})}else{var _6=_5.split(",");var _7=_6[0];var _8={title:isc.MenuEditProxy.parseTextWikiSymbols(_6[0])} if(_6.length>1){_8.keyTitle=_6[1]} if(_8.title.endsWith(">")){_8.title=_8.title.substring(0,_8.title.length-1);_8.submenu=[{}]} if(_8.title.startsWith("x")||_8.title.startsWith("o")){_8.title=_8.title.substring(1);_8.checked=true} if(_8.title.startsWith("-")&&_8.title.endsWith("-")){_8.title=_8.title.substring(1,_8.title.length-1);_8.enabled=false} _3.add(_8)}} return _3},isc.A.parseTextWikiSymbols=function isc_c_MenuEditProxy_parseTextWikiSymbols(_1){var _2=false;var _3=false;var _4=false;var _5=[];for(var i=0;i<_1.length;i++){var c=_1.charAt(i);if(c=='\\'){if((i+1)<_1.length&&_1.charAt(i+1)=='r'){c="
";i++}}else if(c=='['&&_1.indexOf("]",i+1)>0){c="";_4=true}else if(c==']'){if(_4){c="";_4=false}}else if(c=='*'){if(_3){_3=false;c="
"}else{_3=true;c=""}}else if(c=='_'){if(_2){_2=false;c=""}else{_2=true;c=""}} _5.push(c)} return _5.join("")},isc.A.menuToWikiText=function isc_c_MenuEditProxy_menuToWikiText(_1){var _2="== "+_1.title+"\n";if(_1.data){var _3=_1.data;for(var i=0;i<_3.length;i++){_2+=isc.MenuEditProxy.menuItemToWikiText(_3[i])+"\n"}} return _2},isc.A.menuItemToWikiText=function isc_c_MenuEditProxy_menuItemToWikiText(_1){var _2="";if(_1.isSeparator)return"---";if(_1.enabled==false)_2+="-";else if(_1.checked)_2+="x ";_2+=_1.title;if(_1.submenu)_2+=" >";if(_1.keyTitle)_2+=","+_1.keyTitle;return _2});isc.B._maxIndex=isc.C+6;isc.MenuEditProxy.changeDefaults("inlineEditFormDefaults",{minHeight:150});isc.A=isc.MenuEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.supportsInlineEdit=true;isc.A.inlineEditMultiline=true;isc.B.push(isc.A.getInlineEditText=function isc_MenuEditProxy_getInlineEditText(){var _1=this.creator;var _2="";if(isc.isA.MenuButton(_1)){var _3=_1.menu||_1.data;_2+=isc.MenuEditProxy.menuToWikiText({title:_1.title,data:_3})}else{var _4=_1.menus;for(var i=0;i<_4.length;i++){_2+=isc.MenuEditProxy.menuToWikiText(_4[i])}} return _2},isc.A.setInlineEditText=function isc_MenuEditProxy_setInlineEditText(_1){var _2=this.creator;if(isc.isA.MenuButton(_2)){var _3=isc.MenuEditProxy.parseMenuButtonString(_1);if(_3){_2.editContext.setNodeProperties(_2.editNode,_3)}else{_2.editContext.removeNodeProperties(_2.editNode,["title","menu"])}}else{var _4=_2.editContext.getEditNodeTree(),_5=_4.getChildren(_2.editNode);if(_5&&_5.length>0)_4.removeList(_5);var _6=isc.MenuEditProxy.parseMenuBarString(_1);_2.editContext.setNodeProperties(_2.editNode,{menus:_6})}});isc.B._maxIndex=isc.C+2;isc.defineClass("FormEditProxy","CanvasEditProxy");isc.A=isc.FormEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.defaultDropMargin=5;isc.A.dropMargin=5;isc.A.selectItemsMode="item";isc.A.supportsInlineEdit=true;isc.B.push(isc.A.setEditMode=function isc_FormEditProxy_setEditMode(_1){this.Super("setEditMode",arguments);this.creator.resetValues()},isc.A.getOverrideProperties=function isc_FormEditProxy_getOverrideProperties(){var _1=this.Super("getOverrideProperties",arguments);_1=isc.addProperties({},_1,{canDropItems:true,canAddColumns:true});if(this.isAbsoluteLayout()){_1.childrenSnapToGrid=true;_1.childrenSnapResizeToGrid=true} return _1},isc.A.willAcceptDrop=function isc_FormEditProxy_willAcceptDrop(_1){var _2=this.creator;var _3=_2.ns.EH.dragTarget;if(_2==_3){return false} return this.Super("willAcceptDrop",arguments)},isc.A.dropOver=function isc_FormEditProxy_dropOver(){var _1=this.creator;if(_1.canDropItems!=true)return false;if(!this.willAcceptDrop())return false;this.$69c=null;_1.hideDragLine();if(!this.canDropAtLevel())return;this.$1313(true);return isc.EH.STOP_BUBBLING},isc.A.dropMove=function isc_FormEditProxy_dropMove(){var _1=this.creator;if(!_1.ns.EH.getDragTarget())return false;if(_1.canDropItems!=true)return false;if(!this.willAcceptDrop())return false;this.$146l=_1.ns.EH.getDragRect();var _2=_1.ns.EH.getDragTarget().getDragData();if(isc.isAn.Array(_2))_2=_2[0];if(_2&&(_2.type||_2.className)=="DataSource"||this.isAbsoluteLayout()){_1.hideDragLine();return isc.EH.STOP_BUBBLING} if(this.shouldPassDropThrough()){_1.hideDragLine();return} if(_1.getItems().length==0){isc.EditContext.hideAncestorDragDropLines(_1);_1.showDragLineForForm();return isc.EH.STOP_BUBBLING} var _3=_1.ns.EH.lastEvent,_4=_1.getItemAtPageOffset(_3.x,_3.y),_5=_1.getNearestItem(_3.x,_3.y);if(_5){isc.EditContext.hideAncestorDragDropLines(_1);_1.showDragLineForItem(_5,_3.x,_3.y)}else{_1.hideDragLine()} this.$69c=_5;return isc.EH.STOP_BUBBLING},isc.A.dropOut=function isc_FormEditProxy_dropOut(){this.creator.hideDragLine();if(!this.canDropAtLevel())return;this.showSelectedAppearance(false);this.$1313(false);return isc.EH.STOP_BUBBLING},isc.A.drop=function isc_FormEditProxy_drop(){var _1=this.creator,_2=_1.ns.EH.getDragTarget().getDragData();if(isc.isAn.Array(_2))_2=_2[0];if((_2&&(_2.type||_2.className)=="DataSource")||(!this.isAbsoluteLayout()&&_1.getItems().length==0)) {if(this.shouldPassDropThrough()){_1.hideDragLine();return} this.itemDrop(_1.ns.EH.getDragTarget(),0,0,0);return isc.EH.STOP_BUBBLING} if(this.isAbsoluteLayout()){var _3=this.$146l,_4=(_3?_3[0]-_1.getPageLeft():_1.getOffsetX()),_5=(_3?_3[1]-_1.getPageTop():_1.getOffsetY());this.itemAbsoluteDrop(_1.ns.EH.getDragTarget(),_1.getItemDropIndex(_6),_5,_4);return isc.EH.STOP_BUBBLING} if(!this.$69c){isc.logWarn("lastDragOverItem not set, cannot drop","dragDrop");return} var _6=this.$69c,_7=_1.getItemTableOffsets(_6),_8=_6.dropSide,_9=_6.$69d,_10=_1.getItemDropIndex(_6,_8);this.$69c=null;if(this.shouldPassDropThrough()){_1.hideDragLine();return} if(_10!=null&&_10>=0){if(_1.parentElement){if(_1.parentElement.hideDropLine)_1.parentElement.hideDropLine()} var _11=_1.items.$8j.duplicate();this.modifyFormOnDrop(_6,_7.top,_7.left,_8,_11)} _1.hideDragLine();return isc.EH.STOP_BUBBLING},isc.A.isAbsoluteLayout=function isc_FormEditProxy_isAbsoluteLayout(){return this.creator.$11e()},isc.A.itemDrop=function isc_FormEditProxy_itemDrop(_1,_2,_3,_4,_5,_6){var _7=this.creator;var _8=_1.getDragData();if(_8==null){_8=isc.EH.dragTarget;if(isc.isA.FormItemProxyCanvas(_8)){this.logInfo("The dragTarget is a FormItemProxyCanvas for "+_8.formItem,"editModeDragTarget");_8=_8.formItem}} if(_7==_8)return;if(!_1.isA("Palette")){isc.SelectionOutline.hideDragHandle();var _9=_7.editContext.getEditNodeTree(),_10=_9.getParent(_8.editNode),_11=_9.getChildren(_10).indexOf(_8.editNode),_12=_8.editNode;_12=this.itemDropping(_12,_2,true);if(!_12)return;_7.editContext.removeNode(_12);if(_10==_7.editNode&&_2>_11)_2--;var _13=_7.editContext.addNode(_8.editNode,_7.editNode,_2);if(_13&&_13.liveObject){isc.EditContext.delayCall("selectCanvasOrFormItem",[_13.liveObject,true],200)} return _13}else{var _14=_1.transferDragData();if(isc.isAn.Array(_14))_14=_14[0];var _12=_7.editContext.makeEditNode(_14);if(_12.loadData&&!_12.isLoaded){var _15=this;_12.loadData(_12,function(_16){_16=_16||_12 _16.isLoaded=true;_15.completeItemDrop(_16,_2,_3,_4,_5,_6);_16.dropped=_12.dropped});return} this.completeItemDrop(_12,_2,_3,_4,_5,_6)}},isc.A.itemAbsoluteDrop=function isc_FormEditProxy_itemAbsoluteDrop(_1,_2,_3,_4,_5){var _6=this.creator;var _7=_1.getDragData();if(_7==null){_7=isc.EH.dragTarget;if(isc.isA.FormItemProxyCanvas(_7)){this.logInfo("The dragTarget is a FormItemProxyCanvas for "+_7.formItem,"editModeDragTarget");_7=_7.formItem}} if(_6==_7)return;if(!_1.isA("Palette")){isc.SelectionOutline.hideDragHandle();var _8=_6.editContext.getEditNodeTree(),_9=_8.getParent(_7.editNode),_10=_8.getChildren(_9).indexOf(_7.editNode),_11=_7.editNode,_12;_11=this.itemDropping(_11,_2,true);if(!_11)return;if(_9.liveObject!=_6){_6.editContext.removeNode(_11);if(_9==_6.editNode&&_2>_10)_2--;var _13=(!isc.isA.FormItemProxyCanvas(_1)?"children":null);_12=_6.editContext.addNode(_11,_6.editNode,_2,_13)}else{_12=_11} if(_12&&_12.liveObject){_12.liveObject.editContext.setNodeProperties(_12,{top:_3,left:_4});isc.EditContext.delayCall("selectCanvasOrFormItem",[_12.liveObject,true],200)} return _12}else{var _14=_1.transferDragData();if(isc.isAn.Array(_14))_14=_14[0];var _11=_6.editContext.makeEditNode(_14);if(_11.loadData&&!_11.isLoaded){var _15=this;_11.loadData(_11,function(_16){_16=_16||_11 _16.isLoaded=true;_15.completeItemAbsoluteDrop(_16,_2,_3,_4,_5) _16.dropped=_11.dropped});return} this.completeItemAbsoluteDrop(_11,_2,_3,_4,_5)}},isc.A.completeItemDrop=function isc_FormEditProxy_completeItemDrop(_1,_2,_3,_4,_5,_6){var _7=this.creator,_8=_1.liveObject,_9;if(isc.isA.Button(_8)||isc.isAn.IButton(_8)){_1=_7.editContext.makeEditNode({type:"ButtonItem",title:_8.title,defaults:_1.defaults})}else if(isc.isA.Canvas(_8)){_9=_1;_1=_7.editContext.makeEditNode({type:"CanvasItem"});isc.addProperties(_1.defaults,{showTitle:false,startRow:true,endRow:true,width:"*",colSpan:"*"})} _1.dropped=true;_1=this.itemDropping(_1,_2,true);if(!_1)return;var _10=_7.editContext.addNode(_1,_7.editNode,_2);if(_10){isc.EditContext.clearSchemaProperties(_10);if(_9){_10=_7.editContext.addNode(_9,_10,0);if(isc.isA.TabSet(_8)){_8.delayCall("showAddTabEditor",[],1000)}} _7.editContext.getLiveObject(_10);if(_10.liveObject.dataSource){_10.liveObject.editProxy.setDataSource(_10.liveObject.dataSource,null,true)} if(_7.editingOn){var _11=_10.liveObject;if(_11.setEditMode)_11.setEditMode(true,_11.editContext,_11.editNode)} isc.EditContext.delayCall("selectCanvasOrFormItem",[_1.liveObject,true],200);if(_10.showTitle!=false&&_10.liveObject.editProxy){_10.liveObject.editProxy.delayCall("editTitle")}} if(_6)this.fireCallback(_6,"node",[_10])},isc.A.completeItemAbsoluteDrop=function isc_FormEditProxy_completeItemAbsoluteDrop(_1,_2,_3,_4,_5){var _6=this.creator,_7=_1.liveObject,_8;if(isc.isA.Canvas(_7)){_8="children"} _1.dropped=true;_1=this.itemDropping(_1,_2,true);if(!_1)return;var _9=_6.editContext.addNode(_1,_6.editNode,_2,_8);if(_9){isc.EditContext.clearSchemaProperties(_9);_6.editContext.getLiveObject(_9);if(_9.liveObject.dataSource){_9.liveObject.editProxy.setDataSource(_9.liveObject.dataSource,null,true)} _6.editContext.setNodeProperties(_9,{top:_3,left:_4});if(_6.editingOn&&_9.liveObject.setEditMode){var _10=_9.liveObject;_10.setEditMode(true,_10.editContext,_10.editNode)} isc.EditContext.delayCall("selectCanvasOrFormItem",[_1.liveObject,true],200)} if(_5)this.fireCallback(_5,"node",[_9])},isc.A.modifyFormOnDrop=function isc_FormEditProxy_modifyFormOnDrop(_1,_2,_3,_4,_5){var _6=this.creator;if(_6.canAddColumns==false)return;var _7=_6.ns.EH.getDragTarget().getDragData(),_8,_9,_10;if(!_7){_7=_6.ns.EH.getDragTarget();if(!isc.isA.FormItemProxyCanvas(_7)){this.logWarn("In modifyFormOnDrop the drag target was not a FormItemProxyCanvas");return} _7=_7.formItem;var _11=-1;for(var i=0;i<_5.length;i++){for(var j=0;j<_5[i].length;j++){if(_5[i][j]==_11)continue;_11=_5[i][j];if(_6.items[_11]==_7){_9=i;_10=_11;break}}} var _14=true}else{if(isc.isAn.Array(_7))_7=_7[0];var _15=_7.type||_7.className;var _16=isc.ClassFactory.getClass(_15);if(isc.isA.FormItem(_16)){_7=_6.createItem(_7,_15)}else{_7=_6.createItem({type:"CanvasItem",showTitle:false},"CanvasItem")} var _14=false} _8=this.getAdjustedColSpan(_7);if((_7.startRow&&_7.$71r)||(_7.endRow&&_7.$71n)){_7.editContext.setNodeProperties(_7.editNode,{startRow:null,$71r:null,endRow:null,$71n:null})} var _17=[];if(_14&&_9){var _18=_5[_9],_11=-1;for(var i=0;i<_18.length;i++){if(_18[i]!=_11){_11=_18[i];if(_6.items[_11]==_7)continue;if(isc.isA.SpacerItem(_6.items[_11])&&_6.items[_11].$71m) {this.logDebug("Marking spacer "+_6.items[_11].name+" for removal","formItemDragDrop");_17.add(_6.items[_11]);continue} this.logDebug("Found a non-spacer item on row "+_9+", no spacers will be deleted","formItemDragDrop");_17=null;break}}} var _19=0;if(_4=="L"||_4=="R"){var _20=true;if(_7.startRow)_20=false;if(_7.endRow&&(_4=="L"||_3<_5[_2].length)){_20=false} if(_14&&_9==_2)_20=false;if(_20){var _21=_8;var _22=_5[_2][_3];if(_5[_2].contains(_22)){var _23=_6.items[_22];if(!isc.isA.SpacerItem(_23)||!_23.$71m){_22+=_4=="L"?-1:1;_23=_6.items[_22]} if(_5[_2].contains(_22)){if(isc.isA.SpacerItem(_23)&&_23.$71m){if(_23.colSpan&&_23.colSpan>_21){_23.editContext.setNodeProperties(_23.editNode,{colSpan:_23.colSpan-_21});_21=0}else{_21-=_23.colSpan;_23.editContext.removeNode(_23.editNode);if(_4=="R")_19=-1}}}} if(_21<=0){_20=false}else if(_5[_2].length+_8<=_6.numCols){_20=false}else{_6.editContext.setNodeProperties(_6.editNode,{numCols:_6.numCols+_21})}} for(var i=0;i<_5.length;i++){var _22=_5[i][_3];if(_22==null)_22=_6.items.length;else _22+=_19+(_4=="L"?0:1);if(i!=_2){if(!_20)continue;if(_14&&_9&&_2<_9&&i==_9) {_19--} if(_17&&_17.length>0&&i==_9){continue} if(_22>0){var _23=_6.items[_22-1];if(!_23||_23==_7||_23.endRow){continue}} var _24=this.getAdjustedColSpan(_23);if(_4=="R"&&_3+_24>=_5[i].length){if(!_23.endRow){_23.editContext.setNodeProperties(_23.editNode,{endRow:true,$71n:true})} continue} var _25=_6.editContext.makeEditNode({type:"SpacerItem"});isc.addProperties(_25.defaults,{colSpan:_21,height:0,$71m:true});var _26=_6.editContext.addNode(_25,_6.editNode,_22);_19++}else{if(_4=="L"){var _23=_6.items[_22];if(_23&&_23.startRow&&_23.$71r){_23.editContext.setNodeProperties(_23.editNode,{startRow:null,$71r:null})}}else{var _23=_6.items[_22-1];if(_23&&_23.endRow&&_23.$71n){_23.editContext.setNodeProperties(_23.editNode,{endRow:null,$71n:null})}} this.itemDrop(_6.ns.EH.getDragTarget(),_22,i,_3,_4,function(_36){_6.$72s=_36});if(_9==null||_2<_9)_19++}}}else{var _27,_28;if(isc.isA.SpacerItem(_1)&&_1.$71m){_27=_2}else{_27=_2+(_4=="B"?1:0)} if(_5[_27])_28=_5[_27][_3];var _29;if(_27>=_5.length)_29=_6.items.length;else _29=_5[_27][0];var _30=_28==null?null:_6.items[_28];if(_30==null||(isc.isA.SpacerItem(_30)&&_30.$71m)){if(_27>_5.length-1||_27<0){if(_3!=0&&!_7.startRow){var _25=_6.editContext.makeEditNode({type:"SpacerItem"});isc.addProperties(_25.defaults,{colSpan:_3,height:0,$71m:true});_6.editContext.addNode(_25,_6.editNode,_29)} this.itemDrop(_6.ns.EH.getDragTarget(),_29+(_3!=0?1:0),_27,_3,_4,function(_36){_6.$72s=_36})}else if(_30==null){var _31=_5[_27].length-1;if(_31<0){isc.logWarn("Found completely empty row in DynamicForm at position ("+_27+","+(_3)+")");return} var _32=_5[_27][_31];var _23=_6.items[_32];if(_23==null){isc.logWarn("Null item in DynamicForm at position ("+_27+","+(_3-1)+")");return} if(_23.endRow&&_23!=_7){_23.editContext.setNodeProperties(_23.editNode,{endRow:false})} var _33=(_3-_31)-1;if(_14&&_23==_7){_33+=_8} if(_33>0){var _25=_6.editContext.makeEditNode({type:"SpacerItem"});isc.addProperties(_25.defaults,{colSpan:_33,height:0,$71m:true});_6.editContext.addNode(_25,_6.editNode,_32+1)} this.itemDrop(_6.ns.EH.getDragTarget(),_32+(_33>0?2:1),_27,_3,_4,function(_36){_6.$72s=_36})}else{var _34=_30.colSpan?_30.colSpan:1,_35=_8;if(_34>_35){_30.editContext.setNodeProperties(_30.editNode,{colSpan:_34-_35});this.itemDrop(_6.ns.EH.getDragTarget(),_28,_27,_3,_4,function(_36){_6.$72s=_36})}else{this.itemDrop(_6.ns.EH.getDragTarget(),_28,_27,_3,_4,function(_36){_6.$72s=_36});_30.editContext.removeNode(_30.editNode)}}}else{if(_3!=0){var _25=_6.editContext.makeEditNode({type:"SpacerItem"});isc.addProperties(_25.defaults,{colSpan:_3,height:0,$71m:true});_6.editContext.addNode(_25,_6.editNode,_29)} this.itemDrop(_6.ns.EH.getDragTarget(),_29+(_3==0?0:1),_27,_3,_4,function(_36){if(_36&&_36.liveObject&&_36.liveObject.editContext){_36.liveObject.editContext.setNodeProperties(_36,{endRow:true,$71n:true})} _6.$72s=_36})}} if(_14&&_17){for(var i=0;i<_17.length;i++){this.logDebug("Removing spacer item "+_17[i].name,"formItemDragDrop");_17[i].editContext.removeNode(_17[i].editNode)}} if(!_14)_7.destroy();if(_6.$72s&&_6.$72s.liveObject){isc.EditContext.delayCall("selectCanvasOrFormItem",[_6.$72s.liveObject],200)}},isc.A.getAdjustedColSpan=function isc_FormEditProxy_getAdjustedColSpan(_1){if(!_1)return 0;var _2=_1.colSpan!=null?_1.colSpan:1;if(_2=="*")_2=1;if(_1.showTitle!=false&&(_1.titleOrientation=="left"||_1.titleOrientation=="right"||_1.titleOrientation==null)) {_2++} return _2},isc.A.canAdd=function isc_FormEditProxy_canAdd(_1){if(!this.canDropAtLevel())return false;if(this.creator.getObjectField(_1)!=null)return true;var _2=isc.ClassFactory.getClass(_1);if(_2&&_2.isA("Canvas"))return true;return false},isc.A.itemDropping=function isc_FormEditProxy_itemDropping(_1,_2,_3){var _4=this.creator,_5=_1.liveObject,_6=isc.EditContext.getSchemaInfo(_1);if(!_6.dataSource)return _1;if(!_4.dataSource){_4.editProxy.setDataSource(_6.dataSource);_4.serviceNamespace=_6.serviceNamespace;_4.serviceName=_6.serviceName;return _1} if(_6.dataSource==isc.DataSource.getDataSource(_4.dataSource).ID&&_6.serviceNamespace==_4.serviceNamespace&&_6.serviceName==_4.serviceName){return _1} var _7=_4.editContext.makeEditNode({type:"CanvasItem",defaults:{cellStyle:"nestedFormContainer"}});isc.addProperties(_7.defaults,{showTitle:false,colSpan:2});_7.dropped=true;_4.editContext.addNode(_7,_4.editNode,_2);var _8=_4.editContext.makeEditNode({type:"DynamicForm",defaults:{numCols:2,canDropItems:false,dataSource:_6.dataSource,serviceNamespace:_6.serviceNamespace,serviceName:_6.serviceName,doNotUseDefaultBinding:true}});_8.dropped=true;_4.editContext.addNode(_8,_7,0);var _9=_4.editContext.addNode(_1,_8,0);isc.EditContext.clearSchemaProperties(_9)},isc.A.makeFieldPaletteNode=function isc_FormEditProxy_makeFieldPaletteNode(_1,_2){var _3=this.creator.getEditorType(_1);_3=_3.substring(0,1).toUpperCase()+_3.substring(1)+"Item";var _4={type:_3,autoGen:true,defaults:{name:_1.name,title:_1.title||_2.getAutoTitle(_1.name)}};return _4},isc.A.changed=function isc_FormEditProxy_changed(_1,_2,_3){this.creator.editContext.setNodeProperties(this.creator.editNode,{defaultValue:_3})},isc.A.click=function isc_FormEditProxy_click(){var _1=this.getClickedFormItem(true);if(_1&&_1.editProxy){if(_1.editProxy.click){return _1.editProxy.click(this.creator,_1)}} this.Super("click",arguments);return isc.EH.STOP_BUBBLING},isc.A.doubleClick=function isc_FormEditProxy_doubleClick(){var _1=this.getClickedFormItem(true);if(_1&&_1.editProxy){if(_1.editProxy.doubleClick){return _1.editProxy.doubleClick(this.creator,_1)}} this.Super("doubleClick",arguments);return isc.EH.STOP_BUBBLING},isc.A.getClickedFormItem=function isc_FormEditProxy_getClickedFormItem(_1){var _2=this.creator.$ne(),_3=(_2?_2.item:null);if(_3&&_3.parentItem)_3=_3.parentItem;return(_3&&(_1||this.selectItemsMode=="itemOrTitle"||!_2.overTitle)?_3:null)},isc.A.startInlineEditing=function isc_FormEditProxy_startInlineEditing(_1){var _2=this.creator.getFields();if(_2&&_2.length==1&&_2[0].editProxy&&_2[0].editProxy.supportsInlineEdit){_2[0].editProxy.startInlineEditing()}});isc.B._maxIndex=isc.C+22;isc.defineClass("FormItemEditProxy","EditProxy");isc.A=isc.FormItemEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.supportsInlineEdit=false;isc.A.valueMapSeparatorChar=",";isc.A.valueMapDisplaySeparatorChar=":";isc.A.valueMapSelectedChar="*";isc.A.valueMapEscapeChar="\\";isc.B.push(isc.A.getOverrideProperties=function isc_FormItemEditProxy_getOverrideProperties(){var _1=this.Super("getOverrideProperties",arguments);_1=isc.addProperties({},_1,{handleChanged:this.handleChanged});return _1},isc.A.handleChanged=function isc_FormItemEditProxy_handleChanged(_1){var _2=this.editContext;_2.setNodeProperties(this.editNode,{defaultValue:_1});this.Super("handleChanged",arguments)},isc.A.getResizeEdges=function isc_FormItemEditProxy_getResizeEdges(){return(this.creator.form&&this.creator.form.$11e()?["R","B"]:null)},isc.A.click=function isc_FormItemEditProxy_click(_1,_2){if(_1.editProxy.selectItemsMode!="never"){isc.EditContext.selectCanvasOrFormItem(_2,true)} return isc.EH.STOP_BUBBLING},isc.A.doubleClick=function isc_FormItemEditProxy_doubleClick(_1,_2){if(this.wasFormItemClickOnTitle(_1)){this.editTitle();return isc.EH.STOP_BUBBLING} this.Super("doubleClick",arguments);return isc.EH.STOP_BUBBLING},isc.A.wasFormItemClickOnTitle=function isc_FormItemEditProxy_wasFormItemClickOnTitle(_1){var _2=_1.$ne(),_3=(_2?_2.item:null);if(_3&&_3.parentItem)_3=_3.parentItem;return(_3&&_2.overTitle)},isc.A.editTitle=function isc_FormItemEditProxy_editTitle(_1){var _2=this.creator,_3,_4,_5,_6;if(isc.isA.ButtonItem(_2)){_3=_2.canvas.getPageLeft();_4=_2.canvas.getVisibleWidth();_5=_2.canvas.getPageTop();_6=_2.canvas.getHeight()}else{if(isc.isA.StaticTextItem(_2)&&_1=="defaultValue"){_3=_2.getPageLeft();_4=_2.getVisibleWidth()}else{_3=_2.getTitlePageLeft();_4=_2.getVisibleTitleWidth()} var _7,_8;_7=_2.getTitlePageTop();_8=_2.getTitleVisibleHeight();_6=_2.getVisibleHeight();if(_8==0){_8=_6;_7=_5} _5=(_8==_6?_7:_7+((_8-_6)/2))} isc.EditContext.manageTitleEditor(_2,_3,_4,_5,_6,null,_1)},isc.A.getInlineEditText=function isc_FormItemEditProxy_getInlineEditText(){},isc.A.setInlineEditText=function isc_FormItemEditProxy_setInlineEditText(_1){});isc.B._maxIndex=isc.C+9;isc.defineClass("TextItemEditProxy","FormItemEditProxy");isc.A=isc.TextItemEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.supportsInlineEdit=true;isc.B.push(isc.A.getInlineEditText=function isc_TextItemEditProxy_getInlineEditText(){return this.creator.defaultValue},isc.A.setInlineEditText=function isc_TextItemEditProxy_setInlineEditText(_1){this.creator.editContext.setNodeProperties(this.creator.editNode,{defaultValue:_1})});isc.B._maxIndex=isc.C+2;isc.defineClass("TextAreaItemEditProxy","TextItemEditProxy");isc.A=isc.TextAreaItemEditProxy.getPrototype();isc.A.inlineEditMultiline=true;isc.defineClass("SelectItemEditProxy","FormItemEditProxy");isc.A=isc.SelectItemEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.supportsInlineEdit=true;isc.A.inlineEditMultiline=true;isc.A.inlineEditInstructions="Enter options, one per line. Use \"*\" to mark the selected option. Use \"StoredValue:Display Value\" to create a mapping between stored values and values displayed to the user.";isc.B.push(isc.A.getInlineEditText=function isc_SelectItemEditProxy_getInlineEditText(){var _1=this.creator;if(!_1.valueMap)return null;var _2=_1.valueMap,_3=_1.getValue()||[],_4=(this.inlineEditMultiline?"\n":this.valueMapSeparatorChar),_5="";if(!isc.isAn.Array(_3))_3=[_3];if(isc.isAn.Array(_2)){for(var i=0;i<_2.length;i++){var _7=_2[i],_8=_3.contains(_7);_7=_7.replace(_4,"\\"+_4);_7=_7.replace(/^\s+/g,"\\ ").replace(/\s+$/g,"\\ ");_5=_5+(_5.length>0?_4:"")+_7+(_8?this.valueMapSelectedChar:"")}}else{for(var _9 in _2){var _7=_2[_9],_8=_3.contains(_9);_9=_9.replace(_4,"\\"+_4);_7=_7.replace(_4,"\\"+_4);_9=_9.replace(/^\s+/g,"\\ ").replace(/\s+$/g,"\\ ");_7=_7.replace(/^\s+/g,"\\ ").replace(/\s+$/g,"\\ ");_5=_5+(_5.length>0?_4:"")+_9+this.valueMapDisplaySeparatorChar+_7+(_8?this.valueMapSelectedChar:"")}} return _5},isc.A.setInlineEditText=function isc_SelectItemEditProxy_setInlineEditText(_1){var _2=(this.inlineEditMultiline?"\n":this.valueMapSeparatorChar);var _3=isc.EditProxy.parseStringValueMap(_1,_2,this.valueMapEscapeChar,this.valueMapDisplaySeparatorChar,this.valueMapSelectedChar,true);this.creator.editContext.setNodeProperties(this.creator.editNode,{valueMap:_3.valueMap,value:_3.value})},isc.A.createInlineEditForm=function isc_SelectItemEditProxy_createInlineEditForm(){if(this.creator.editContext.isVisualBuilder&&this.creator.optionDataSource&&!isc.isA.MockDataSource(this.creator.optionDataSource)) {var _1=isc.DS.get(this.creator.optionDataSource),_2=this.creator.editContext.creator.creator;var _3=[{name:"editDataSourceButton",type:"button",title:"View / Edit DataSource",endRow:false,click:function(_4,_5){if(_2.showDSEditor)_2.showDSEditor(_1);_4.dismissEditor()}}];var _4=this.createAutoChild("inlineEditForm",{margin:0,padding:10,cellPadding:0,fields:_3,numCols:2,click:function(){this.dismissEditor()},dismissEditor:function(){this.hide()}});return _4}else{return this.Super("createInlineEditForm",arguments)}});isc.B._maxIndex=isc.C+3;isc.defineClass("CheckboxItemEditProxy","FormItemEditProxy");isc.A=isc.CheckboxItemEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.supportsInlineEdit=true;isc.B.push(isc.A.getInlineEditText=function isc_CheckboxItemEditProxy_getInlineEditText(){var _1=this.creator;return(_1.value?"[x]":"[ ]")},isc.A.setInlineEditText=function isc_CheckboxItemEditProxy_setInlineEditText(_1){_1=_1.replace(/\s+/g,"").toLowerCase();var _2=("[x]"==_1||"true"==_1||"t"==_1||"yes"==_1||"y"==_1||"checked"==_1);this.creator.editContext.setNodeProperties(this.creator.editNode,{value:_2})});isc.B._maxIndex=isc.C+2;isc.defineClass("DateItemEditProxy","FormItemEditProxy");isc.A=isc.DateItemEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.supportsInlineEdit=true;isc.B.push(isc.A.getInlineEditText=function isc_DateItemEditProxy_getInlineEditText(){var _1=this.creator,_2=_1.defaultValue;if(!_2)return null;if(isc.isA.Date(_2)){_2=_2.toShortDate()} return _2},isc.A.setInlineEditText=function isc_DateItemEditProxy_setInlineEditText(_1){var _2=Date.parseInput(_1);if(_2){_1=_2} this.creator.editContext.setNodeProperties(this.creator.editNode,{defaultValue:_1})});isc.B._maxIndex=isc.C+2;isc.defineClass("GridEditProxy","LayoutEditProxy");isc.A=isc.GridEditProxy.getPrototype();isc.A.saveFieldOrder=true;isc.A.saveFieldVisibility=true;isc.A.saveFieldFrozenState=true;isc.A.saveSort=true;isc.A.saveGroupBy=true;isc.A.saveFilterCriteria=true;isc.A.canEditHilites=true;isc.A.canAddFormulaFields=true;isc.A.canAddSummaryFields=true;isc.A.canGroupBy=true;isc.A.canReorderFields=true;isc.A.canResizeFields=true;isc.A.generateEditableHilites=true;isc.A.generateEditableFormulas=true;isc.A.generateEditableSummaries=true;isc.A=isc.GridEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.supportsInlineEdit=true;isc.A.inlineEditMultiline=true;isc.B.push(isc.A.setEditMode=function isc_GridEditProxy_setEditMode(_1){this.Super("setEditMode",arguments);if(_1)this.observeStateChanges();else this.ignoreStateChanges();if(isc.isA.TreeGrid){if(_1){this.createDefaultTreeFieldEditNode()}}},isc.A.canAddToParent=function isc_GridEditProxy_canAddToParent(_1){if(isc.isA.TreeGrid(this.creator)&&_1=="ListGridField")return false;return true},isc.A.getOverrideProperties=function isc_GridEditProxy_getOverrideProperties(){var _1=this.Super("getOverrideProperties",arguments);return isc.addProperties({},_1,{clearNoDropIndicator:this.clearNoDropIndicator,setNoDropIndicator:this.setNoDropIndicator,addField:this.addField,userAddedField:this.userAddedField})},isc.A.observeStateChanges=function isc_GridEditProxy_observeStateChanges(){var _1=this.creator;if(this.saveSort)this.observe(_1,"sortChanged");this.observe(_1,"fieldStateChanged");if(this.saveGroupBy)this.observe(_1,"groupStateChanged");this.observe(_1,"editHilites");this.observe(_1,"hilitesChanged");if(this.saveFilterCriteria)this.observe(_1,"filterEditorSubmit")},isc.A.ignoreStateChanges=function isc_GridEditProxy_ignoreStateChanges(){var _1=this.creator;if(this.saveSort)this.ignore(_1,"sortChanged");this.ignore(_1,"fieldStateChanged");if(this.saveGroupBy)this.ignore(_1,"groupStateChanged");this.ignore(_1,"editHilites");this.ignore(_1,"hilitesChanged");if(this.saveFilterCriteria)this.ignore(_1,"filterEditorSubmit")},isc.A.sortChanged=function isc_GridEditProxy_sortChanged(){var _1=this.creator,_2=_1.getSort();this.addDefaultFieldEditNodes();if(!_2)_1.editContext.removeNodeProperties(_1.editNode,["initialSort"],true);else _1.editContext.setNodeProperties(_1.editNode,{initialSort:_2},true)},isc.A.fieldStateChanged=function isc_GridEditProxy_fieldStateChanged(){this.addDefaultFieldEditNodes();var _1=this.creator,_2=_1.getAllFields();if(_2&&this.saveFieldOrder){for(var i=0;i<_2.length;i++){var _4=_2[i],_5=this.getFieldNode(i);if(_5){var _6=_4[_1.fieldIdProperty],_7=_5.liveObject[_1.fieldIdProperty];if(_6!=_7){var _8=this.getFieldNodeIndexByName(_6),_9=this.getFieldNodeIndexByName(_7);if(_8!=null&&_9!=null&&_9!=_8){_1.editContext.reorderNode(_1.editNode,_8,_9)}}}}} if(_2){for(var i=0;i<_2.length;i++){var _4=_2[i],_5=this.getFieldNode(i);if(!_4||_4.excludeFromState||!_5||!_5.defaults)continue;var _10=_4[_1.fieldIdProperty],_11=_1.getStateForField(_10,false);if(this.saveFieldVisibility){var _12=(_11.visible==false);if(!_12)_1.editContext.removeNodeProperties(_5,["hidden"],true);else _1.editContext.setNodeProperties(_5,{hidden:_12},true)} if(this.saveFieldFrozenState){var _13=_11.frozen;if(!_13)_1.editContext.removeNodeProperties(_5,["frozen"],true);else _1.editContext.setNodeProperties(_5,{frozen:_13},true)} var _14=_11.width;if(!_14)_1.editContext.removeNodeProperties(_5,["width"],true);else _1.editContext.setNodeProperties(_5,{width:_14},true)}}},isc.A.groupStateChanged=function isc_GridEditProxy_groupStateChanged(){var _1=this.creator,_2=_1.getGroupByFields();if(!_2)_1.editContext.removeNodeProperties(_1.editNode,"groupByField");else _1.editContext.setNodeProperties(_1.editNode,{groupByField:_2},true);this.addDefaultFieldEditNodes();var _3=_1.getAllFields(),_4=["groupingMode","groupGranularity","groupPrecision"];for(var i=0;i<_3.length;i++){var _6=this.getFieldNode(i);if(_6)_1.editContext.removeNodeProperties(_6,_4)} if(_2!=null){for(var i=0;i<_2.length;i++){var _7=_3.find("name",_2[i]);if(_7){var _8=_3.indexOf(_7),_6=this.getFieldNode(_8),_9={};if(_7.groupingMode)_9.groupingMode=_7.groupingMode;if(_7.groupGranularity)_9.groupGranularity=_7.groupGranularity;if(_7.groupPrecision)_9.groupPrecision=_7.groupPrecision;_1.editContext.setNodeProperties(_6,_9,true)}}}},isc.A.editHilites=function isc_GridEditProxy_editHilites(){this.$129b=this.creator.getHilites()},isc.A.hilitesChanged=function isc_GridEditProxy_hilitesChanged(){var _1=this.creator,_2=_1.getHilites();if(!_2){_1.editContext.removeNodeProperties(_1.editNode,["hilites"],true)}else{if(!this.generateEditableHilites){for(var i=0;i<_2.length;i++){var _4=_2[i],_5=(this.$129b?this.$129b.contains(_4):false);if(!_5){_4.canEdit=false}}} _1.editContext.setNodeProperties(_1.editNode,{hilites:_2},true)}},isc.A.filterEditorSubmit=function isc_GridEditProxy_filterEditorSubmit(_1){var _2=this.creator;if(!_1)_2.editContext.removeNodeProperties(_2.editNode,["initialCriteria"],true);else _2.editContext.setNodeProperties(_2.editNode,{initialCriteria:_1},true)},isc.A.clearNoDropIndicator=function isc_GridEditProxy_clearNoDropIndicator(_1){this.Super("clearNoDropIndicator",arguments);var _2=this.creator;if(_2.body&&_2.body.editProxy){_2.body.editProxy.clearNoDropIndicator()}},isc.A.setNoDropIndicator=function isc_GridEditProxy_setNoDropIndicator(){this.Super("setNoDropIndicator",arguments);var _1=this.creator;if(_1.body&&_1.body.editProxy){_1.body.editProxy.setNoDropIndicator()}},isc.A.headerClick=function isc_GridEditProxy_headerClick(_1){var _2=this.creator,_3=this.getFieldNode(_1);if(_3){_3.liveObject.$73a=_2.header.getButton(_1);isc.EditContext.selectCanvasOrFormItem(_3.liveObject)} _2.$73b=true;return isc.EH.STOP_BUBBLING},isc.A.click=function isc_GridEditProxy_click(){var _1=this.creator;if(_1.editNode){if(_1.$73b)delete _1.$73b;else isc.EditContext.selectCanvasOrFormItem(_1,true);return isc.EH.STOP_BUBBLING}},isc.A.userAddedField=function isc_GridEditProxy_userAddedField(_1){var _2=this.editProxy.getFieldNodeByName(_1.name);if(_2){var _3={title:_1.title,userFormula:_1.userFormula};this.editContext.setNodeProperties(_2,_3,true)}else{_1=isc.addProperties({},_1);delete _1.validators;if(_1.userFormula&&!this.generateEditableFormulas)_1.canEditFormula=false;if(_1.userSummary&&!this.generateEditableSummaries)_1.canEditSummary=false;var _4={type:"ListGridField",defaults:_1},_5=this.editNode;_2=this.editContext.makeEditNode(_4);this.editContext.addNode(_2,_5)}},isc.A.getFieldNode=function isc_GridEditProxy_getFieldNode(_1){var _2=this.creator,_3=_2.editContext.getEditNodeTree(),_4=_3.getChildren(_3.findById(_2.ID)),_5=(isc.isA.TreeGrid(_2)?"TreeGridField":"ListGridField"),_6;var _7=0;for(var i=0;i<_4.length;i++){var _9=_4[i];if(_9.type!=_5){_7--;continue} if(i+_7==_1){_6=_9;break}} return _6},isc.A.getFieldNodeByName=function isc_GridEditProxy_getFieldNodeByName(_1){var _2=this.creator,_3=_2.editContext.getEditNodeTree(),_4=_3.getChildren(_3.findById(_2.ID)),_5;for(var i=0;i<_4.length;i++){var _7=_4[i];if(_7.name==_1){_5=_7;break}} return _5},isc.A.getFieldNodeIndexByName=function isc_GridEditProxy_getFieldNodeIndexByName(_1){var _2=this.creator,_3=_2.editContext.getEditNodeTree(),_4=_3.getChildren(_3.findById(_2.ID)),_5;for(var i=0;i<_4.length;i++){var _7=_4[i];if(_7.name==_1){_5=i;break}} return _5},isc.A.addDefaultFieldEditNodes=function isc_GridEditProxy_addDefaultFieldEditNodes(){var _1=this.creator;if(!this.$1479){if(!this.getFieldNode(0)){var _2=_1.getAllFields();for(var i=0;i<_2.length;i++){var _4=_2[i],_5=_1.editProxy.makeFieldPaletteNode(_4,_1.getDataSource()),_6=_1.editContext.makeEditNode(_5);_1.editContext.addNode(_6,_1.editNode,i,null,true)}}}},isc.A.createDefaultTreeFieldEditNode=function isc_GridEditProxy_createDefaultTreeFieldEditNode(){if(isc.$75u)return;var _1=this.creator;if(_1.dataSource)return;var _2=_1.fields;if(!_2)return;for(var i=0;i<_2.length;i++){if(_2[i].name=="nodeTitle"){var _4={type:"TreeGridField",autoGen:true,defaults:{name:_2[i].name,title:_2[i].title}};var _5=_1.editContext.makeEditNode(_4);_1.editContext.addNode(_5,_1.editNode,null,null,true);return}}},isc.A.addField=function isc_GridEditProxy_addField(_1,_2){this.creator.Super("addField",arguments);if(isc.$75u){if(_1.treeField){var _3=this.creator.getFields();for(var i=0;i<_3.length;i++){if(_3[i].name!=_1.name&&_3[i].treeField){this.creator.removeField(_3[i]);break}}}}},isc.A.setDataSource=function isc_GridEditProxy_setDataSource(_1,_2,_3){if(!isc.isA.TreeGrid(_4)){this.Super("setDataSource",arguments);return} if(isc.$75u){this.creator.setDataSource(_1,_2);return} var _4=this.creator;if(_1==null)return;if(_1==_4.dataSource&&!_3)return;var _2=_4.getFields();if(_2){for(var i=0;i<_2.length;i++){var _6=_2[i];if(_6.treeField){_6.treeField=null;var _7=_6.editNode;break}}} var _8=_4.getFields();_8.remove(_6);var _9,_2=_1.fields;if(_2&&isc.getKeys(_2).length==1&&_1.fieldIsComplexType(_2[isc.firstKey(_2)].name)) {_9=_1.getSchema(_2[isc.firstKey(_2)].type)}else{_9=_1} var _2=_9.getFields(),_10=_1.titleField;if(!isc.isAn.Array(_2))_2=isc.getValues(_2);for(var _11=0;_11<_2.length;_11++){if(!this.shouldUseField(_2[_11],_1))continue;if(_10==null||_10==_2[_11].name){var _12=_2[_11];break}} if(_12)_8.addAt(_12,0);this.baseSetDataSource(_1,_8);var _13=_4.editProxy.makeFieldPaletteNode(_12,_9);_13.defaults.treeField=true;var _14=_4.editContext.makeEditNode(_13);_4.editContext.addNode(_14,_4.editNode,0,null);if(_7)_4.editContext.removeNode(_7,true)},isc.A.getInlineEditText=function isc_GridEditProxy_getInlineEditText(){var _1=this.creator;if(_1.dataSource){var _2=isc.DS.get(_1.dataSource);if(isc.isA.MockDataSource(_2)){return _2.mockData.replace(/\\/g,"\\").replace(/\r/g,"\\r").replace(/^\[(.*)\]$/m,"{$1}")}} return null},isc.A.setInlineEditText=function isc_GridEditProxy_setInlineEditText(_1){if(!_1)_1="";var _2=isc.isA.TreeGrid(this.creator);_1=(_2?_1.trim():_1.trim().replace(/\\/g,"\\").replace("{","[").replace("}","]").replace(/\\r/g,"\r"));var _3={dataSource:{MockDataSource:{_constructor:"MockDataSource",mockData:_1,mockDataType:(_2?"tree":"grid")}}};isc.MockDataSource.getGridSettings(_3);var _4={type:"MockDataSource",defaults:_3.dataSource.MockDataSource};delete _3.dataSource;this.$1479=true;var _5=this.creator.editContext,_6=this.creator.getSort();if(!_3.sortField&&_6&&_6.length>0){_5.removeNodeProperties(this.creator.editNode,["sortField","sortDirection"]);this.creator.clearSort()}else if(_3.sortField){this.creator.setSort({property:_3.sortField,direction:_3.sortDirection||"ascending"})} _5.setNodeProperties(this.creator.editNode,_3);var _5=this.creator.editContext;var _7=_5.getEditNodeTree(),_8=_7.getChildren(this.creator.editNode);if(_8&&_8.length>0){_5.removeNode(_8[0],true)} var _9=_5.makeEditNode(_4);_5.addNode(_9,this.creator.editNode);var _10=this;if(this.creator.autoFetchData)this.creator.fetchData(null,function(){_10.$1479=false})},isc.A.createInlineEditForm=function isc_GridEditProxy_createInlineEditForm(){if(this.creator.editContext.isVisualBuilder&&this.creator.dataSource&&!isc.isA.MockDataSource(this.creator.dataSource)) {var _1=isc.DS.get(this.creator.dataSource),_2=this.creator.editContext.creator.creator;var _3=[{name:"editDataSourceButton",type:"button",title:"View / Edit DataSource",endRow:false,click:function(_4,_5){if(_2.showDSEditor)_2.showDSEditor(_1);_4.dismissEditor()}}];var _4=this.createAutoChild("inlineEditForm",{margin:0,padding:10,cellPadding:0,fields:_3,numCols:2,click:function(){this.dismissEditor()},dismissEditor:function(){this.hide()}});return _4}else{return this.Super("createInlineEditForm",arguments)}});isc.B._maxIndex=isc.C+26;isc.defineClass("PortletEditProxy","EditProxy");isc.A=isc.PortletEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.canAdd=function isc_PortletEditProxy_canAdd(_1){if(_1=="Portlet")return false;return this.Super("canAdd",arguments)},isc.A.drop=function isc_PortletEditProxy_drop(){return isc.EH.STOP_BUBBLING});isc.B._maxIndex=isc.C+2;isc.defineClass("PortalColumnEditProxy","EditProxy");isc.A=isc.PortalColumnEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.canAdd=function isc_PortalColumnEditProxy_canAdd(_1){return false},isc.A.drop=function isc_PortalColumnEditProxy_drop(){return isc.EH.STOP_BUBBLING});isc.B._maxIndex=isc.C+2;isc.defineClass("DrawPaneEditProxy","CanvasEditProxy");isc.A=isc.DrawPaneEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.setEditMode=function isc_DrawPaneEditProxy_setEditMode(_1){this.Super("setEditMode",arguments);var _2=this.creator.editContext.getEditNodeArray().getProperty("liveObject");_2.map("setEditMode",_1,this.creator.editContext);if(!_1)this.creator.editContext.deselectAllComponents()},isc.A.destroy=function isc_DrawPaneEditProxy_destroy(){if(this.$1367){isc.Page.clearEvent("keyPress",this.$1367);delete this.$1367} this.Super("destroy",arguments)},isc.A.drop=function isc_DrawPaneEditProxy_drop(){var _1=this.creator,_2=_1.ns.EH.getDragTarget();if(!isc.isA.Palette(_2)){return _1.drop.apply(arguments)} var _3=_2.transferDragData(),_4=(isc.isAn.Array(_3)?_3[0]:_3);if(!_4)return false;var _5=_1.editContext.makeEditNode(_4);if(!_5)return false;var _6=this;_1.editContext.requestLiveObject(_5,function(_5){if(_5){var _7;if(isc.isA.DrawPane(_1)){_7=_1.editContext.addNode(_5,_1.editNode)}else{var _8;if(!_2.isA("Palette")){if(_2.isA("FormItemProxyCanvas")){_2=_2.formItem} _8=_2._constructor||_2.Class}else{_4.dropped=true;_8=_4.type||_4.className} var _9=this.findEditNode(_8);if(_9){_9=_9.editNode} _7=_1.editContext.addWithWrapper(_5,_9,true)} _7.liveObject.moveTo(_1.getOffsetX(),_1.getOffsetY());if(_6.canSelectChildren&&_7.liveObject.editProxy.canSelect!=false){_1.editContext.selectSingleComponent(_7.liveObject);_6.creator.focus()}}},_2);return isc.EventHandler.STOP_BUBBLING},isc.A.selectedEditNodesUpdated=function isc_DrawPaneEditProxy_selectedEditNodesUpdated(_1,_2){if(_2!=null&&_2.length==1){this.enableKeyMovement(true);var _3=_1.liveObject;if(this.$1474!=null&&_3!=this.$1474){this.ignore(this.$1474.editProxy,"startInlineEditing");this.ignore(this.$1474.editProxy,"inlineEditingComplete")} this.observe(_3.editProxy,"startInlineEditing","observer.editingStarted()");this.observe(_3.editProxy,"inlineEditingComplete","observer.editingComplete()");this.$1474=_3}else if(_2==null||_2.length!=1){if(this.$1474){this.ignore(this.$1474.editProxy,"startInlineEditing");this.ignore(this.$1474.editProxy,"inlineEditingComplete");this.$1474=null} this.enableKeyMovement(false)}},isc.A.enableKeyMovement=function isc_DrawPaneEditProxy_enableKeyMovement(_1){if(_1){if(!this.$1367){this.$1367=isc.Page.setEvent("keyPress",this)}}else{if(this.$1367){isc.Page.clearEvent("keyPress",this.$1367);delete this.$1367}}},isc.A.editingStarted=function isc_DrawPaneEditProxy_editingStarted(){this.enableKeyMovement(false)},isc.A.editingComplete=function isc_DrawPaneEditProxy_editingComplete(){this.enableKeyMovement(true);this.creator.focus()},isc.A.pageKeyPress=function isc_DrawPaneEditProxy_pageKeyPress(_1,_2){if(!this.creator.isVisible())return;var _3=this.ns.EH,_4=_3.getKey(),_5=_3.getKeyEventCharacter(),_6=_4==="Enter",_7=_4==="Backspace",_8=this.creator,_9=_8.editContext.getSelectedComponents();if(_9.length!=1)return;var _10=_8.editContext.getRootEditNode().liveObject;if(!_10.containsFocus())return;var _11=_9[0];if(isc.isA.AlphaNumericChar(_5)||_6||_7){var _12=_11.editProxy.inlineEditEvent;if(_12==="dblOrKeypress"){_11.editProxy.startInlineEditing(_6||_7?null:_5,_4);return false}}else{var _1=_11,_13=_3.shiftKeyDown(),_14=(_13?1:_1.drawPane.snapVGap),_15=(_13?1:_1.drawPane.snapHGap),_16=false;switch(_4){case"Arrow_Up":_1.moveBy(0,_14*-1);break;case"Arrow_Down":_1.moveBy(0,_14);break;case"Arrow_Left":_1.moveBy(_15*-1,0);break;case"Arrow_Right":_1.moveBy(_15,0);break;default:_16=null;break} return _16}});isc.B._maxIndex=isc.C+8;isc.defineClass("DrawItemEditProxy","EditProxy");isc.A=isc.DrawItemEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.supportsInlineEdit=true;isc.B.push(isc.A.getOverrideProperties=function isc_DrawItemEditProxy_getOverrideProperties(){var _1=this.Super("getOverrideProperties",arguments);isc.addProperties(_1,{canDrag:true,cursor:"move"});return _1},isc.A.showEditMask=function isc_DrawItemEditProxy_showEditMask(){this.logWarn("showEditMask called on DrawItem EditProxy - ignored")},isc.A.hideEditMask=function isc_DrawItemEditProxy_hideEditMask(){this.logWarn("hideEditMask called on DrawItem EditProxy - ignored")},isc.A.showSelectedAppearance=function isc_DrawItemEditProxy_showSelectedAppearance(_1){var _2=this.creator;if(_1){var _3=_2.$137g;if(!_3&&_2.getSupportedKnobs){_3=_2.getSupportedKnobs();if(_3)_3.remove("move");_2.$137g=_3} if(_2.showKnobs)_2.showKnobs(_3);if(_2.bringToFront)_2.bringToFront()}else{_2.hideAllKnobs()}},isc.A.click=function isc_DrawItemEditProxy_click(){var _1=this.creator;if(_1.drawPane.editProxy.canSelectChildren&&this.canSelect!=false){_1.editContext.selectSingleComponent(_1)} return isc.EH.STOP_BUBBLING},isc.A.dragStart=function isc_DrawItemEditProxy_dragStart(_1,_2){var _3=this.creator;if(!_3.drawPane.editProxy.canSelectChildren||this.canSelect==false){return false} if(_3.bringToFront)_3.bringToFront();_3.dragStart(_1,_2)},isc.A.dragMove=function isc_DrawItemEditProxy_dragMove(_1,_2,_3){this.creator.dragMove(_1,_2,_3)},isc.A.dragStop=function isc_DrawItemEditProxy_dragStop(_1,_2){var _3=this.creator;_3.dragStop(_1,_2);if(_3.drawPane.editProxy.canSelectChildren&&_3.editProxy.canSelect!=false&&!_3.editContext.isComponentSelected(_3)) {_3.editContext.selectSingleComponent(_3)}},isc.A.getInlineEditText=function isc_DrawItemEditProxy_getInlineEditText(){return this.creator.title},isc.A.setInlineEditText=function isc_DrawItemEditProxy_setInlineEditText(_1){this.creator.editContext.setNodeProperties(this.creator.editNode,{title:!_1?null:_1})});isc.B._maxIndex=isc.C+10;isc.defineClass("DrawLabelEditProxy","DrawItemEditProxy");isc.A=isc.DrawLabelEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.inlineEditMultiline=true;isc.B.push(isc.A.getInlineEditText=function isc_DrawLabelEditProxy_getInlineEditText(){return this.creator.contents},isc.A.setInlineEditText=function isc_DrawLabelEditProxy_setInlineEditText(_1){this.creator.editContext.setNodeProperties(this.creator.editNode,{contents:_1})});isc.B._maxIndex=isc.C+2;isc.defineClass("FacetChartEditProxy","DrawPaneEditProxy");isc.A=isc.FacetChartEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.inlineEditMultiline=true;isc.A.dataSeparatorChar=",";isc.A.dataDisplaySeparatorChar=":";isc.A.dataEscapeChar="\\";isc.B.push(isc.A.getInlineEditText=function isc_FacetChartEditProxy_getInlineEditText(){var _1=this.creator,_2="series";var _3="";if(_1.title)_3+="== "+_1.title+"\n";var _4=_1.facets,_5=[],_6=[];for(var i=0;i<_4.length;i++){if(_4[i].inlinedValues){var _8=_4[i].values;for(var j=0;j<_8.length;j++){var _10=_8[j];_5.add(_10.id);_6.add(_10.title||_10.id)}}} var _11=_1.data,_12=(_1.showDataLabels==false);for(var i=0;i<_11.length;i++){var _13=_11[i][_2];if(_13)_3+="-- "+_13+"\n";var _14="";for(var j=0;j<_5.length;j++){var _10=_11[i][_5[j]];if(_14.length>0)_14+=this.dataSeparatorChar;if(_12)_14+=_10;else _14+=_6[j]+this.dataDisplaySeparatorChar+_10} _3+=_14+"\n"} return _3},isc.A.setInlineEditText=function isc_FacetChartEditProxy_setInlineEditText(_1){var _2="series",_3=_1.split("\n"),_4,_5,_6,_7=[],_8=[],_9=true,_10=true;for(var i=0;i<_3.length;i++){var _12=_3[i];if(!_12)continue;_12=_12.trim();if(_12.length==0)continue;if(_12.startsWith("==")||_12.startsWith("--")){if(_4)_5=_4;_4=_12.substring(2).trim()}else{var _13=isc.EditProxy.parseStringValueMap(_12,this.dataSeparatorChar,this.dataEscapeChar,this.dataDisplaySeparatorChar);var _14=_13.valueMap;if(!_6){_6=[];if(isc.isAn.Array(_14)){for(var j=0;j<_14.length;j++){_6.add("value"+j)} _10=false}else{for(var _16 in _14){_6.add(_16)}} var _17={inlinedValues:true,values:[]};for(var j=0;j<_6.length;j++){_17.values.add({id:_6[j].toLowerCase(),title:_6[j]});_6[j]=_6[j].toLowerCase()} _7.add(_17);_7.add({id:_2})} var _18={};_18[_2]=_4||"";if(!_4)_9=false;if(isc.isAn.Array(_14)){for(var j=0;j<_6.length;j++){var _19=_6[j];_18[_19]=parseFloat(_14[j])||0}}else{for(var _16 in _14){if(_6.contains(_16.toLowerCase())){_18[_16.toLowerCase()]=parseFloat(_14[_16])}} for(var j=0;j<_6.length;j++){var _19=_6[j];if(_18[_19]==null)_18[_19]=0}} _8.add(_18);_4=null}} if(_8.length<=1){_9=false;if(!_5&&_8.length==1&&_8[0][_2]!=_2){_5=_8[0][_2]}} this.creator.editContext.setNodeProperties(this.creator.editNode,{title:_5,showLegend:_9,showDataLabels:_10,facets:_7,data:_8})});isc.B._maxIndex=isc.C+2;if(isc.DynamicForm){isc.defineClass("PropertySheet","DynamicForm");isc.A=isc.PropertySheet.getPrototype();isc.A.autoChildItems=true;isc.A.browserSpellCheck=false;isc.A.autoChildDefaults={cellStyle:"propSheetValue",titleStyle:"propSheetTitle",showHint:false};isc.A.GroupItemDefaults={cellStyle:null};isc.A.ExpressionItemDefaults={width:"*",height:18,showActionIcon:true};isc.A.ActionMenuItemDefaults={width:"*",height:18};isc.A.SelectItemDefaults={height:20,width:"*"};isc.A.DateItemDefaults={width:"*"};isc.A.TextItemDefaults={width:"*",height:20};isc.A.StaticTextItemDefaults={width:"*",height:20,textBoxStyle:"propSheetField"};isc.A.ColorItemDefaults={width:"*",height:16,pickerIconHeight:16,pickerIconWidth:16,pickerIconSrc:"[SKIN]/DynamicForm/PropSheet_ColorPicker_icon.png",textBoxStyle:"propSheetField"};isc.A.HeaderItemDefaults={cellStyle:"propSheetHeading"};isc.A.TextAreaItemProperties={width:"*"};isc.A.CheckboxItemDefaults={showTitle:true,showLabel:false,getTitleHTML:function(){if(this[this.form.titleField]!=null)return this[this.form.titleField];return this[this.form.fieldIdProperty]}};isc.A.SectionItemDefaults={cellStyle:"propSheetSectionHeaderCell"};isc.A.titleAlign="left";isc.A.titleWidth=120;isc.A.cellSpacing=0;isc.A.cellPadding=0;isc.A.backgroundColor="white";isc.A.requiredTitlePrefix="";isc.A.requiredTitleSuffix="";isc.A.titleSuffix="";isc.A.clipItemTitles=true} if(isc.ListGrid&&isc.DynamicForm){isc.defineClass("ListEditor",isc.Layout);isc.A=isc.ListEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.vertical=false;isc.A.gridConstructor=isc.ListGrid;isc.A.gridDefaults={editEvent:"click",listEndEditAction:"next",autoParent:"gridLayout",selectionType:isc.Selection.SINGLE,recordClick:"this.creator.recordClick(record)",editorEnter:"if (this.creator.moreButton) this.creator.moreButton.enable()",selectionChanged:function(){if(this.anySelected()&&this.creator.moreButton){this.creator.moreButton.enable()}},contextMenu:{data:[{title:"Remove",click:"target.creator.removeRecord()"}]}};isc.A.gridButtonsDefaults={_constructor:isc.HLayout,autoParent:"gridLayout",height:10,width:10,layoutMargin:6,membersMargin:10,overflow:isc.Canvas.VISIBLE};isc.A.newButtonTitle="New";isc.A.newButtonDefaults={_constructor:isc.AutoFitButton,autoParent:"gridButtons",click:"this.creator.newRecord()"};isc.A.moreButtonTitle="More..";isc.A.moreButtonDefaults={_constructor:isc.AutoFitButton,autoParent:"gridButtons",click:"this.creator.editMore()",disabled:true};isc.A.removeButtonTitle="Remove";isc.A.removeButtonDefaults={_constructor:isc.AutoFitButton,autoParent:"gridButtons",click:"this.creator.removeRecord()"};isc.A.formDefaults={_constructor:isc.DynamicForm,autoParent:"formLayout",overflow:isc.Canvas.AUTO};isc.A.formButtonsDefaults={_constructor:isc.HLayout,autoParent:"formLayout",height:10,width:10,layoutMargin:6,membersMargin:10,overflow:isc.Canvas.VISIBLE};isc.A.saveButtonTitle="Save";isc.A.saveButtonDefaults={_constructor:isc.AutoFitButton,autoParent:"formButtons",click:"this.creator.saveRecord();"};isc.A.cancelButtonTitle="Cancel";isc.A.cancelButtonDefaults={_constructor:isc.AutoFitButton,autoParent:"formButtons",click:"this.creator.cancelChanges()"};isc.A.resetButtonTitle="Reset";isc.A.resetButtonDefaults={_constructor:isc.AutoFitButton,autoParent:"formButtons",click:"this.creator.form.resetValues()"};isc.A.gridLayoutDefaults={_constructor:isc.VLayout};isc.A.gridButtonsOrientation="left";isc.A.formLayoutDefaults={_constructor:isc.VLayout,autoFocus:true};isc.A.animateMembers=true;isc.A.membersMargin=10;isc.A.confirmLoseChangesMessage="Discard changes?";isc.A.formGroup=["formLayout","form","formButtons","saveButton","cancelButton","resetButton"];isc.A.gridButtonsGroup=["gridButtons","newButton","moreButton"];isc.B.push(isc.A.draw=function isc_ListEditor_draw(){if(isc.$cv)arguments.$cw=this;if(!this.readyToDraw())return this;return this.Super("draw",arguments)},isc.A.initWidget=function isc_ListEditor_initWidget(){this.Super("initWidget",arguments);if(!this.inlineEdit)this.showMoreButton=this.showMoreButton||false;this.addAutoChild("gridLayout");this.addAutoChild("grid",{_constructor:this.gridConstructor});this.addAutoChildren(this.gridButtonsGroup);this.addAutoChildren(this.formGroup)},isc.A.configureAutoChild=function isc_ListEditor_configureAutoChild(_1,_2){if(isc.isA.Button(_1))_1.title=this[_2+"Title"];if(_1==this.grid){_1.dataSource=this.dataSource;_1.fields=this.fields;_1.saveLocally=this.saveLocally;_1.canEdit=this.inlineEdit} if(this.gridButtonsOrientation==isc.Canvas.RIGHT){if(_1==this.gridLayout)_1.vertical=false;if(_1==this.formLayout)_1.vertical=false;if(_1==this.gridButtons)_1.vertical=true;if(_1==this.formButtons)_1.vertical=true} if(_1==this.form){_1.dataSource=this.dataSource;_1.fields=this.formFields} if(this.inlineEdit){if(_1==this.formLayout)_1.visibility=isc.Canvas.HIDDEN}else{if(_1==this.gridLayout)_1.showResizeBar=true}},isc.A.setDataSource=function isc_ListEditor_setDataSource(_1,_2){this.dataSource=_1||this.dataSource;if(this.grid!=null){this.grid.setDataSource(_1,_2);this.form.setDataSource(_1,_2)}},isc.A.setData=function isc_ListEditor_setData(_1){if(_1==null)_1=[];if(_1.dataSource)this.setDataSource(_1.dataSource);if(this.grid!=null){this.grid.setData(_1);this.form.clearValues()}else{isc.addProperties(this.gridDefaults,this.gridProperties||{},{data:_1})}},isc.A.getData=function isc_ListEditor_getData(){if(this.inlineEdit)this.grid.endEditing();return this.grid.getData()},isc.A.cancelChanges=function isc_ListEditor_cancelChanges(){this.form.clearValues();this.showList()},isc.A.showList=function isc_ListEditor_showList(){if(this.inlineEdit){this.formLayout.animateHide({effect:"wipe",startFrom:"R"});this.gridLayout.animateShow({effect:"wipe",startFrom:"R"})}},isc.A.showForm=function isc_ListEditor_showForm(){if(this.inlineEdit){this.gridLayout.animateHide({effect:"wipe",startFrom:"R"});this.formLayout.animateShow({effect:"wipe",startFrom:"R"})}},isc.A.recordClick=function isc_ListEditor_recordClick(_1){if(this.inlineEdit)return;var _2=this;var _3=function(_4){if(_4){_2.currentRecord=_1;if(!_2.inlineEdit)_2.form.editRecord(_1);_2.form.setValues(isc.addProperties({},_2.grid.getSelectedRecord()))}} if(!this.form.valuesHaveChanged())_3(true);else this.confirmLoseChanges(_3)},isc.A.getEditRecord=function isc_ListEditor_getEditRecord(){var _1=this.grid.getEditRow();if(_1!=null){return this.grid.getEditedRecord(_1)}else{return isc.addProperties({},this.grid.getSelectedRecord())}},isc.A.editMore=function isc_ListEditor_editMore(){this.currentRecord=this.getEditRecord();this.showForm();this.form.setValues(this.currentRecord)},isc.A.newRecord=function isc_ListEditor_newRecord(){if(this.inlineEdit)return this.grid.startEditingNew();var _1=this;var _2=function(_3){if(_3){_1.grid.deselectAllRecords();_1.showForm();_1.form.editNewRecord()}} if(!this.form.valuesHaveChanged())_2(true);else this.confirmLoseChanges(_2)},isc.A.removeRecord=function isc_ListEditor_removeRecord(){this.form.clearValues();this.grid.removeSelectedData()},isc.A.saveRecord=function isc_ListEditor_saveRecord(){if(!this.form.validate())return false;var _1=this.form.getValues();this.showList();if(this.form.saveOperationType=="add"){this.grid.addData(_1)}else{if(this.inlineEdit&&this.grid.getEditRow()!=null){var _2=this.grid.getEditRow();if(this.grid.data[_2]!=null)this.grid.updateData(_1) else this.grid.setEditValues(_2,_1)}else{this.grid.updateData(_1)}} return true},isc.A.confirmLoseChanges=function isc_ListEditor_confirmLoseChanges(_1){isc.confirm(this.confirmLoseChangesMessage,_1)},isc.A.validate=function isc_ListEditor_validate(){if(this.form.isVisible()&&this.form.valuesHaveChanged()){return this.form.validate()} return true});isc.B._maxIndex=isc.C+17} isc.ClassFactory.defineClass("ViewLoader",isc.Label);isc.A=isc.ViewLoader.getPrototype();isc.A.loadingMessage="Loading View... ${loadingImage}";isc.A.align=isc.Canvas.CENTER;isc.A.allowContentAndChildren=true;isc.A.httpMethod="GET";isc.A.useSimpleHttp=true;isc.A.transformXML=true;isc.A.overflow="hidden";isc.A=isc.ViewLoader.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.initWidget=function isc_ViewLoader_initWidget(){this.Super(this.$oc,arguments);if(this.placeholder)this.addChild(this.placeholder);else this.contents=this.getLoadingMessage()},isc.A.draw=function isc_ViewLoader_draw(){if(!this.readyToDraw())return this;this.Super("draw",arguments);if(this.view){this.addChild(this.view);this.view.show()}else if(this.viewURL&&!this.loadingView()){this.setViewURL()} return this},isc.A.layoutChildren=function isc_ViewLoader_layoutChildren(){this.Super("layoutChildren",arguments);var _1=this.children;if(!_1||_1.length==0)return;var _2=this.children[0],_3=this.getWidth(),_4=this.getHeight();if(_2.$pn!=null)_3=null;if(_2.$po!=null)_4=null;_2.setRect(0,0,_3,_4)},isc.A.destroy=function isc_ViewLoader_destroy(){if(this.placeholder)this.placeholder.destroy();if(this.view)this.view.destroy();this.Super("destroy",arguments)},isc.A.setPlaceholder=function isc_ViewLoader_setPlaceholder(_1){if(this.placeholder)this.placeholder.destroy();this.placeholder=_1;this.addChild(_1);this.placeholder.sendToBack()},isc.A.setViewURL=function isc_ViewLoader_setViewURL(_1,_2,_3){if(_1!=null)this.viewURL=_1;_1=this.viewURL;if(this.placeholder){this.placeholder.show();this.placeholder.bringToFront()} if(this.view!=null){this.view.hide();this.setContents(this.getLoadingMessage())} var _4={},_5=this.useSimpleHttp,_6=this.httpMethod,_7=false;if(!isc.rpc.xmlHttpRequestAvailable()){this.logInfo("XMLHttpRequest not available, using frames comm and expecting RPCResponse");_4={};_5=false;_6="POST";_7=false} var _8=isc.addProperties({showPrompt:false,actionURL:this.viewURL,httpMethod:_6,useSimpleHttp:_5,bypassCache:!this.allowCaching,params:isc.addProperties(_4,this.viewURLParams,_2)},this.viewRPCProperties,_3,{evalResult:_7,suppressAutoDraw:true,willHandleError:true,callback:"if(window."+this.getID()+")"+this.getID()+".$40p(rpcRequest, rpcResponse, data)"});if(!_8.evalVars)_8.evalVars={};_8.evalVars.viewLoader=this;this.$40t=isc.rpc.sendProxied(_8,true).transactionNum},isc.A.loadingView=function isc_ViewLoader_loadingView(){return this.$40t!=null},isc.A.$40p=function isc_ViewLoader__loadViewReply(_1,_2,_3){if(_1.transactionNum!=this.$40t){return} delete this.$40t;this.$40q=false;if(_2.status!=isc.RPCResponse.STATUS_SUCCESS){if(this.handleError(_1,_2)===false)return} try{if(_1.actionURL.endsWith(".xml")&&this.transformXML){var _4=isc.Canvas._canvasList;var _5=_4.length;isc.xml.toComponents(_3);if(!this.$40q){for(var i=_4.length;i>=_5;i--){var _7=_4[i];if(_7!=null&&isc.isA.Canvas(_7)&&_7.parentElement==null&&_7.masterElement==null) {this.setView(this.transformView(_7));break}}} this.$40r()}else{var _8=this;isc.Class.globalEvalWithCapture(_3,function(_9,_10){isc.Log.logWarn("firing the callback from global eval with...");isc.Log.logWarn('viewLoader is:'+_8);if(_10){_8.handleError(_1,_2,_10)}else{_8.$40r(_9)}},_1.evalVars)}}catch(e){this.handleError(_1,_2,e)}},isc.A.$40r=function isc_ViewLoader__loadViewReplyComplete(_1){if(!this.$40q&&_1){for(var i=_1.length;i>=0;i--){var _3=_1[i];var _4=window[_3];if(_4&&isc.isA.Canvas(_4)&&_4.parentElement==null&&_4.masterElement==null) {this.setView(this.transformView(_4));break}}} if(!this.$40q){this.logWarn("setView() not explicitly called by loaded view and could not be autodetected for view: "+this.getID())} this.viewLoaded(this.view)},isc.A.transformView=function isc_ViewLoader_transformView(_1){return _1},isc.A.handleError=function isc_ViewLoader_handleError(_1,_2,_3){this.logWarn("ViewLoader received bad response:\n"+isc.echo(_2.data));this.setView(isc.Label.create({contents:_3?_3.toString():_2.data}));return false},isc.A.setView=function isc_ViewLoader_setView(_1){if(_1!=null&&_1==this.view)return;this.$40q=true;this.setContents(" ");if(this.view)this.view.destroy();this.view=_1;if(_1==null)return;this.addChild(_1,null,false);this.layoutChildren();_1.draw();this.logInfo("showing view: "+_1);if(this.placeholder)this.placeholder.hide();this.contents=" "},isc.A.getView=function isc_ViewLoader_getView(){return this.view},isc.A.viewLoaded=function isc_ViewLoader_viewLoaded(_1){},isc.A.getLoadingMessage=function isc_ViewLoader_getLoadingMessage(){return this.loadingMessage==null?" ":this.loadingMessage.evalDynamicString(this,{loadingImage:this.imgHTML(isc.Canvas.loadingImageSrc,isc.Canvas.loadingImageSize,isc.Canvas.loadingImageSize)})});isc.B._maxIndex=isc.C+15;isc.ClassFactory.defineClass("HTMLFlow","Canvas","DataBoundComponent");isc.A=isc.HTMLFlow;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$49v=0;isc.A.$49w=[];isc.B.push(isc.A.executeScript=function isc_c_HTMLFlow_executeScript(_1,_2,_3){this.$49w[this.$49v]={callback:_2,displayErrors:_3};this.$49v++;this.getScript(_1,"isc.HTMLFlow.$49x("+this.$49v+",htmlFragments, scripts);")},isc.A.$49x=function isc_c_HTMLFlow__completeExecuteScript(_1,_2,_3){var _4=this.$49w[_1];delete this.$49w[_1];var _5=true;for(var i=0;i/i);if(_7==null||(_7.index<_6.index)){this.logWarn('HTMLFlow content contains an opening comment tag "", or vice versa. We recommend you review this HTML (original HTML follows):\n'+_5);if(_7){_8=_7.index;_9=_8+3}else{_8=_6.index;_9=_8+4}}else{_8=_6.index;_9=_7.index+3} _1=_1.slice(0,_8)+_1.slice(_9,_1.length)} var _10=[];var _11=[];var _12=[];var _13=_1;_1=null;var _14;while((_14=_13.match(/(]*)?>)/i))!=null){var _15=_14[1];_12.add(_13.slice(0,_14.index));_10.add(null);_11.add(null);_13=_13.slice(_14.index+_15.length,_13.length) var _16=_13.match(/<\/script>/i),_17=_13.match(/(]*)?>)/i);if(_16==null||(_17&&(_16.index>_17.index))){this.logWarn("HTMLFlow content contains an opening