/*
 * Isomorphic SmartClient
 * Version v13.1p_2026-05-28 (2026-05-28)
 * 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!="v13.1p_2026-05-28/LGPL Development Only"&&!isc.DevUtil){isc.logWarn("SmartClient module version mismatch detected: This application is loading the core module from SmartClient version '"+isc.version+"' and additional modules from 'v13.1p_2026-05-28/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,this.$247o(_2,_3),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,_4.fieldCanBeFormula,_4.xmlExplicitSimpleType)}
,isc.A.$247o=function isc_c_Comm__makeXMLValueSafe(_1,_2){_1=isc.makeXMLSafe(_1,null,null,null,false,false);if(_2&&_1.endsWith("\n"))_1+=_2;return _1}
,isc.A.$36s=function isc_c_Comm__xmlSerializeArray(_1,_2,_3,_4,_5,_6){var _7=isc.StringBuffer.newInstance();_7.append(isc.Comm.$36u(_1,"List",null,null,null,_6));var _8=_5!=null?isc.StringBuffer.concat("\n",_5,"\t"):"";var _9=_5!=null?isc.StringBuffer.concat(_5,"\t"):null;var _10={objRefs:_4,isRoot:false
};for(var i=0,_12=_2.length;i<_12;i++){var _13=_2[i];_10.objPath=isc.JSONEncoder.$zp(_3,i),_7.append(_8,isc.Comm.$ew((_13!=null?_13.$schemaId:null)||"elem",_13,_9,_10)
)}
_7.append((_5!=null?isc.StringBuffer.concat("\n",_5):""),isc.Comm.$36v(_1)
);var _14=_7.toString();return _14}
,isc.A.$271d=function isc_c_Comm__xmlSerializeArrayWithConcat(_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("\n",_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("\n",_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,_7,_8){if(isc.isAn.Instance(_2))_1=_2.getClassName();else if(_2._constructor&&_2._constructor!="AdvancedCriteria"&&_2._constructor!="RelativeDate")_1=_2._constructor;var _9=(_8?null:"Object");var _10=(_7&&(_2.formula||_2.template));var _11=isc.Comm.$36u(_1,_9,null,null,_10,_6);if(_10){for(var _12 in _2){if(_12==null)continue;if(_12==isc.gwtRef||_12==isc.gwtModule)continue;if(_12.startsWith('$'))continue;var _13=_2[_12];_11+=" "+_12+"=\""+_13+"\""}
return _11+"/>"}
var _14="";if(_7&&_2.text){var _15=_2.formulaVars?"UserFormula":"UserSummary",_16=isc.DS.get(_15);if(_16){var _17=_16.xmlSerialize(_2,null,(_5!=null?isc.StringBuffer.concat(_5,"\t"):""),_15);if(_1==_15){return _17}
_11=isc.StringBuffer.concat(_11+_17,(_5!=null?isc.StringBuffer.concat("\n",_5):""),_14,isc.Comm.$36v(_1)
);return _11}
_11+=isc.Comm.$36u(_15,_15,null,null,null,_6);_14=isc.Comm.$36v(_15)}
if(_7&&_2.valueFrom){var _15="case",_16=isc.DS.get("ValueFromMapping")
;if(_16){var _18=isc.SB.create();var _19=(_5!=null?isc.StringBuffer.concat(_5,"\t"):"");_18.append("\n",_19,isc.Comm.$36u("valueFrom",null,null,null,_10,_6));var _20=_2.valueFrom;if(!isc.isAn.Array(_20))_20=[_20];for(var i=0;i<_20.length;i++){_18.append(_16.xmlSerialize(_20[i],null,(_19!=null?isc.StringBuffer.concat(_19,"\t"):""),_15))}
_18.append("\n",_19,isc.Comm.$36v("valueFrom"));_11=isc.StringBuffer.concat(_11,(_5!=null?isc.StringBuffer.concat(_5,"\t"):""),_18.release(false),(_5!=null?isc.StringBuffer.concat("\n",_5):""),isc.Comm.$36v(_1)
);return _11}
_11+=isc.Comm.$36u(_15,_15,null,null,null,_6);_14=isc.Comm.$36v(_15)}
_2=isc.JSONEncoder.$42b(_2);for(var _12 in _2){if(_12==null)continue;if(_12==isc.gwtRef||_12==isc.gwtModule)continue;if(_12.startsWith('$'))continue;var _13=_2[_12];if(isc.isA.Function(_13)&&!_13.iscAction)continue;var _22=_12.toString();var _23={objRefs:_4,objPath:isc.JSONEncoder.$zp(_3,_12),isRoot:false,fieldCanBeFormula:_7
};_11=isc.StringBuffer.concat(_11,(_5!=null?isc.StringBuffer.concat("\n",_5,"\t"):""),isc.Comm.$ew(_22,_13,(_5!=null?isc.StringBuffer.concat(_5,"\t"):null),_23)
)}
_11=isc.StringBuffer.concat(_11,(_5!=null?isc.StringBuffer.concat("\n",_5):""),_14,isc.Comm.$36v(_1)
);return _11}
,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.makeXMLSafeAttribute(_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||this.writeDatetimeXSI)&&!this.omitXMLNS){_7.append(" xmlns:xsi=\"http://www.w3.org/2000/10/XMLSchema-instance\"")}
if(_2&&(!this.omitXSI||(this.writeDatetimeXSI&&isc.SimpleType.inheritsFrom(_2,"datetime")))&&(!this.omitStringXSI||!isc.SimpleType.inheritsFrom(_2,"text")))
{_7.append(" xsi:type=\"xsd:",isc.makeXMLSafeAttribute(_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("</",_3,":",_1,">")}else{return isc.SB.concat("</",_1,">")}}
,isc.A.$ex=function isc_c_Comm__xmlValue(_1,_2,_3,_4,_5){if(_3=="base64Binary"){_2="<xop:Include xmlns:xop=\"http://www.w3.org/2004/08/xop/include\" href=\""
+_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+11;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.length<this.trimEmptyXMLThreshold&&_4.trim()==""))
{_6=true}
if(!_6&&(!_5||_5.getElementsByTagName("parsererror").length>0)){_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();if(isc.debugMaster)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="<IFRAME STYLE='position:absolute;visibility:hidden;top:-1000px' ID='isc_parseXMLFrame'></IFRAME>";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("<?xml")!=-1)
{var _2=_1.match(new RegExp("^\\s*<\\?[^?]*\\?>"));if(_2){_1=_1.substring(_2[0].length)}
}
if(isc.Browser.isIE&&_1.indexOf("<!DOCTYPE")!=-1){var _2=_1.match(new RegExp("^\\s*<!DOCTYPE .*>"));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;i<this.xmlDOMConstructors.length;i++){try{var _3=this.xmlDOMConstructors[i];_1=new ActiveXObject(_3);if(_1){this.logInfo("Using XML DOM constructor: "+_3);this.$37f=_3;break}
}catch(e){}
}
if(!_1){this.logWarn("Couldn't create XML DOM parser - tried the following constructors: "+this.echoAll(this.xmlDOMConstructors))}
}
return _1},nativeXMLAvailable:function(){if(isc.Browser.isSafari&&!isc.Browser.isApollo&&(isc.Browser.safariVersion<522))
return false;return this.$37e!=null||this.getXMLParser()!=null},$37a:function(_1){if(this.nativeXMLAvailable()||!this.logIsWarnEnabled())return false;var _2="Feature "+_1+" requires a native XML parser which is not available ";if(isc.Browser.isSafari){_2+="because this version of Safari does not support native XML processing."}else{_2+="because ActiveX is currently disabled."}
_2+=" 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},serverToJS:function(_1,_2,_3){isc.DMI.callBuiltin({methodName:"xmlToJS",callback:_2,arguments:_1,requestParams:{evalVars:_3,evalResult:true
}
})},toJSCode:function(_1,_2){isc.DMI.callBuiltin("xmlToJS",_1,_2)},$pa:"*",elementToObject:function(_1){if(_1==null)return null;var _2=this.getAttributes(_1);var _3=_1.getElementsByTagName(this.$pa);for(var i=0;i<_3.length;i++){var _5=_3[i];_2[_5.tagName]=this.getElementText(_5)}
return _2},$366:":",getLocalName:function(_1){if(!isc.Browser.isIE){var _2=_1.localName;if(_2==null)return _1.nodeName;return _2}
var _3=_1.nodeName,_4=_3.indexOf(this.$366);if(_4!=-1)return _3.substring(_4+1);return _3},$27c:"List",$45s:"xmlToJS",toJS:function(_1,_2,_3,_4,_5){if(_1==null)return null;if(isc.isAn.XMLDoc(_1))_1=_1.nativeDoc;if(_1.documentElement)_1=_1.documentElement;_5=_5||isc.emptyObject;if(isc.isAn.Array(_1)){var _6=[];for(var i=0;i<_1.length;i++){_6[i]=this.toJS(_1[i],_2,_3,_4,_5)}
return _6}
var _8,_9;var _10=this.getExplicitType(_1,_4);if(_4||!_3||(_3&&isc.DS.get(_10)==null)){if(_4){var _11=this.isRefElement(_1);if(_11)
{var _12=isc.Canvas.getById(_11);if(_12!=null)return _12}
var _13=this.firstElementChild(_1),_11=_13?this.isRefElement(_13):null;if(_11&&this.getElementChildren(_1).length==1)
{var _12=isc.Canvas.getById(_11);if(_12!=null)return _12}
if(!_10){var _14=_1.tagName;if(_14==this.$27c||isc.DS.get(_14))_10=_1.tagName}
if(!_10&&this.getLocalName(_1)=="case"){var _15=_1.parentElement;var _16=this.getLocalName(_15);if(_16=="valueFrom"){_10=isc.DS.get("ValueFromMapping")}
}
}
if(_10!=null&&_10==this.$27c){var _17=this.getElementChildren(_1);return this.toJS(_17,_2,_3,_4,_5)}
if(_10){if(isc.DS.get(_10)!=null){_3=isc.DS.get(_10)}else if(isc.SimpleType.getType(_10)!=null){return isc.SimpleType.validateValue(_10,this.getElementText(_1))}
}
}
if(_3&&_3.xmlToJS)return _3.xmlToJS(_1,_5);if(this.elementIsNil(_1))return null;if(_3){_9=_2||_3.getFieldNames();_8={};for(var i=0;i<_9.length;i++){var _18=_9[i],_19=_3.getField(_18);if(_19==null||(_19.valueXPath==null&&_19.getFieldValue==null))continue;var _20=_3.getFieldValue(_1,_18,_19);if(_20!=null){if(this.logIsDebugEnabled(this.$45s)){this.logDebug("valueXPath / getFieldValue() field: "+_3.ID+"."+_18+" on element: "+this.echoLeaf(_1)+" got value: "+_20,"xmlToJS")}
_8[_18]=_20}
}
}
_8=this.getAttributes(_1,_2,_8,_3!=null,_3);if(!this.$37g(_8)&&!this.hasElementChildren(_1)&&(!_4||!_3||!isc.isAn.emptyObject(_3.fields)))
{return this.getElementText(_1)}
if(_8[this.$367]&&_8[this.$367]=="xsd:Object"){delete _8[this.$367]}
var _17=_1.childNodes;if(this.logIsDebugEnabled(this.$45s)){this.logDebug("using DataSource: "+_3+" for complex element: "+this.echoLeaf(_1)+" childNodes: "+this.echoLeaf(_17)+" has attributes: "+this.$37g(_8)
,"xmlToJS")}
var _21=false;for(var i=0;i<_17.length;i++){var _22=_17[i];var _23=this.getLocalName(_22);if(this.isTextNode(_22))continue;_21=true;if(_2&&!_2.contains(_23))continue;var _19=_3?_3.getField(_23):null;if(_19&&(_19.valueXPath||_19.getFieldValue))continue;var _24;if(this.logIsInfoEnabled(this.$45s)){this.logInfo("dataSource: "+_3+", field: "+this.echoLeaf(_19)+(_19!=null?" type: "+_19.type:"")+", XML element: "+this.echoLeaf(_22),"xmlToJS")}
var _25=_22;if(_19&&_19.multiple){var _26=this.getElementChildren(_22);if(_26.length>0)_25=_26}
if(!_3||_19==null||_19.type==null||_19.type=="any"){if(this.logIsDebugEnabled(this.$45s)){this.logDebug("applying schemaless transform at: "+(_3?_3.ID:"[schemaless]")+"."+_23,"xmlToJS")}
_24=this.toJS(_25,null,null,_4,_5)}else{var _27=_3.getSchema(_19.type);if(_27!=null){var _28=_19.propertiesOnly?{propertiesOnly:true}:_5;_24=this.toJS(_25,null,_27,_4,_28);if(this.logIsDebugEnabled(this.$45s)){this.logDebug("complexType field: "+this.echoLeaf(_19)+" got value: "+this.echoLeaf(_24),"xmlToJS")}
}else{if(isc.isAn.Array(_25)){_24=[];for(var j=0;j<_25.length;j++){_24.add(_3.validateFieldValue(_19,this.getElementText(_25[j]))
)}
}else{_24=_3.validateFieldValue(_19,this.getElementText(_25))}
if(this.logIsDebugEnabled(this.$45s)){this.logDebug("simpleType field: "+this.echoLeaf(_19)+" got value: "+this.echoLeaf(_24),"xmlToJS")}
}
}
if(_19&&_19.multiple){if(_24==null||isc.isA.emptyString(_24))_24=[];else if(!isc.isAn.Array(_24))_24=[_24]}
if(!_19&&_23=="valueFrom"&&isc.isAn.Object(_24)&&_24.case&&isc.isAn.Array(_24.case))
{_24=_24.case}
if(_8[_23]){if(!isc.isAn.Array(_8[_23]))_8[_23]=[_8[_23]];if(_19&&_19.multiple&&isc.isAn.Array(_24)){_8[_23].addList(_24)}else{_8[_23].add(_24)}
}else{_8[_23]=_24}
}
if(!_21){var _30=this.getElementText(_1),_31=_5.textContentProperty||(_3?_3.textContentProperty:"xmlTextContent");if(_3){_19=_3.getTextContentField();if(_19)_30=_3.validateFieldValue(_19,_30)}
if(_30!=null&&!isc.isAn.emptyString(_30)){_8[_31]=_30}
}
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 _32=_8._constructor;delete _8._constructor;return isc.ClassFactory.newInstance(_32,_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",$253n:"withID",isRefElement:function(_1){if(_1==null||this.isTextNode(_1)){return false}
var _2=_1.getAttribute(this.$71v)||_1.getAttribute(this.$253n);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 <isomorphic:loadSystemSchema/> 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("<isomorphicXML>"+_1+"</isomorphicXML>")}
_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;i<this.xsiNamespaces.length;i++){_3=_1.getAttributeNS(this.xsiNamespaces[i],_2);if(_3!=null)return _3}
return _3}
return _1.getAttribute(this.$45u[_2])},$45v:"nil",$45w:"null",$18r:"false",$w0:"0",elementIsNil:function(_1){if(_1==null||!isc.isA.XMLNode(_1)||_1.nodeType!=1)return false;var _2=this.getXSIAttribute(_1,this.$45v);if(_2&&_2!=this.$18r&&_2!=this.$w0)return true;var _2=this.getXSIAttribute(_1,this.$45w);if(_2&&_2!=this.$18r&&_2!=this.$w0)return true;return false},getElementText:function(_1){if(this.elementIsNil(_1))return null;if(!_1)return null;var _2=_1.firstChild;if(!_2){if((isc.Browser.isMoz||isc.Browser.isChrome)&&_1.nodeType==2)return _1.value;return isc.emptyString}
var _3=_2.data;if(isc.Browser.isMoz&&_3!=null&&_3.length>4000)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 '"+isc.slash+isc.slash+"' is 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('<xsl:stylesheet version=\'1.0\' xmlns:xsl=\'http://www.w3.org/1999/XSL/Transform\'>\r<xsl:output method="xml" indent="yes"/>\r<xsl:strip-space elements="*"/>\r<xsl:template match="/">\r  <xsl:copy-of select="."/>\r</xsl:template>\r</xsl:stylesheet>');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?:\/\/[^\/]*\//,"/");if(_7.startsWith("//"))_7=_7.substring(1);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",null,"FieldContainer");
isc.A=isc.DataSource;
isc.A.$2652={_constructor:"AdvancedCriteria",operator:"or",criteria:[],fixedValue:false};
isc.A.$2653={_constructor:"AdvancedCriteria",operator:"and",criteria:[],fixedValue:true}
;
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="<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' ";
isc.A.$37w="</soap:Envelope>";
isc.A.$37u="<soap:Header>";
isc.A.$51y="</soap:Header>";
isc.A.$37v="<soap:Body";
isc.A.$51z="</soap:Body>";
isc.A.$281k="dsResponse,data,dsRequest"
;
isc.B.push(isc.A.$159k=function isc_c_DataSource__cloneDSRequest(_1,_2){
if(_1==null)return null;
if(_1.unconvertedDSRequest!=null){
_1=_1.unconvertedDSRequest}
var _3={
operationId:_1.operationId,
operationType:_1.operationType,
data:isc.shallowClone(_1.data),
textMatchStyle:_1.textMatchStyle,
sortBy:_1.sortBy,
startRow:_1.startRow,
endRow:_1.endRow,
oldValues:_1.oldValues,
outputs:_1.outputs,
httpMethod:_1.httpMethod,
httpHeaders:_1.httpHeaders,
params:_1.params,
useHttpProxy:_1.useHttpProxy,
willHandleError:_1.willHandleError,
actionURL:_1.actionURL,
dataProtocol:_1.dataProtocol,
additionalOutputs:_1.additionalOutputs,
allowIE9Leak:_1.allowIE9Leak,
bypassCache:("$135u"in _1?_1.$135u:_1.bypassCache),
callbackParam:_1.callbackParam,
clientContext:_1.clientContext,
componentId:_1.componentId,
containsCredentials:_1.containsCredentials,
contentType:_1.contentType,
downloadResult:_1.downloadResult,
downloadToNewWindow:_1.downloadToNewWindow,
evalResult:_1.evalResult,
evalVars:_1.evalVars,
fallbackToEval:("$135v"in _1?_1.$135v:_1.fallbackToEval),
generateRelatedUpdates:_1.generateRelatedUpdates,
groupBy:_1.groupBy,
headerData:_1.headerData,
ignoreTimeout:_1.ignoreTimeout,
keepParentsOnFilter:_1.keepParentsOnFilter,
lineBreakStyle:_1.lineBreakStyle,
omitNullMapValuesInResponse:_1.omitNullMapValuesInResponse,
paramsOnly:_1.paramsOnly,
parentNode:("$135w"in _1?_1.$135w:_1.parentNode),
pendingAdd:_1.pendingAdd,
progressiveLoading:_1.progressiveLoading,
resultSet:_1.resultSet,
resultTree:_1.resultTree,
sendNoQueue:_1.sendNoQueue,
serverOutputAsString:_1.serverOutputAsString,
shouldUseCache:_1.shouldUseCache,
streamResults:_1.streamResults,
tenantId:_1.tenantId,
summaryFunctions:_1.summaryFunctions,
suppressAutoDraw:_1.suppressAutoDraw,
timeout:_1.timeout,
transport:_1.transport,
useFlatFields:_1.useFlatFields,
useFlatHeaderFields:_1.useFlatHeaderFields,
useSimpleHttp:_1.useSimpleHttp,
useStrictJSON:("$135x"in _1?_1.$135x:_1.useStrictJSON),
useXmlHttpRequest:_1.useXmlHttpRequest,
validationMode:_1.validationMode
};
if(!_2){
_3.showPrompt=_1.showPrompt}
for(var _4 in _1){
if(_4.startsWith("export")||
(!_2&&_4.startsWith("prompt")))
{
_3[_4]=_1[_4]}
}
return _3}
,isc.A.$135y=function isc_c_DataSource__cloneDSResponse(_1){
if(_1==null)return null;
return{
clientContext:_1.clientContext,
data:isc.shallowClone(_1.data),
dataSource:_1.dataSource,
endRow:_1.endRow,
errors:_1.errors,
fromOfflineCache:_1.fromOfflineCache,
httpHeaders:_1.httpHeaders,
httpResponseCode:_1.httpResponseCode,
httpResponseText:_1.httpResponseText,
invalidateCache:_1.invalidateCache,
offlineTimestamp:_1.offlineTimestamp,
operationType:_1.operationType,
queueStatus:_1.queueStatus,
startRow:_1.startRow,
status:_1.status,
totalRows:_1.totalRows,
transactionNum:_1.transactionNum
}}
);
isc.B._maxIndex=isc.C+2;
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.$748="ref:";
isc.A.$253o="withID:";
isc.A.$254h=["serverType","apidoc","isSampleDS","sample","clientOnly","fromServer","tableCode","testFileName","dbImportFileName"];
isc.A.$254i=["columnCode"];
isc.A.$248w=0;
isc.A.serializeTimeAsDatetime=false;
isc.A.$78d=[];
isc.A.maxResponsesToCache=100;
isc.A.offlineMessage="This data not available while offline";
isc.A.maxFileSizeExceededMessage="Size of '${uploadedFileName}' (${uploadedFileSize}) exceeded maximum allowed file size of ${maxFileSize}";
isc.A.requiredFileMessage="'${uploadedFileName}' was empty, but empty files are not allowed.";
isc.A.requiredCriterionMessage="Operation requires criteria for the following field(s): [${requiredCriterion}]";
isc.A.$280j=isc.Set.create();
isc.B.push(isc.A.create=function isc_c_DataSource_create(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13){
var _14=_1?_1.ID:null;
if(isc.DataSource.$92w){
var _15;
if(_14)_15=isc.DataSource.get(_14);
if(_15){
if(this.logIsInfoEnabled()){
this.logInfo("skipping create, returning existing DS for ID:'"+_14+"'")}
return _15}
}
if(this.DS_FN)delete this.DS_FN[_14];
return this.invokeSuper(this,"create",_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13)}
,isc.A.verifyDataSourcePair=function isc_c_DataSource_verifyDataSourcePair(_1,_2){
isc.Log.logDebug('Comparing mock ds '+_2.ID+'to live ds '+_1.ID,'DataSource');
var _3=[];
var _4=_2.getFieldNames();
var _5=_1.getFieldNames();
var _6=[];
var _7=function(_23,_24,_25){
return{
fieldName:_23,
severity:_24,
message:_25.asHTML()
}};
for(var _8=0;_8<_4.length;_8++){
var _9=_4[_8];
var _10=_2.getField(_9);
var _11=_1.getField(_9);
var _12=_2.ID.replace('isctmp_','')+'.'+_9;
if(!_11){
_3.add(_7(_9,'WARN','DataSource field "'+
_12+'" is present in mock but not live.'));
_6.add(_9);
continue}
var _13=_11.type==_10.type;
var _14=false;
if(!_13){
var _15=isc.SimpleType.getType(_11.type);
if(_15&&_15.inheritsFrom==_10.type){
_14=true}
}
if(!_13&&!_14){
_3.add(_7(_9,'WARN','DataSource field "'+_12+
'" has different type in mock than live, and live type "'+_11.type+
'" is a not a sub-type of mock type "'+_10.type+'".'))}
}
_4.removeList(_6);
var _16=0;
var _17=0;
for(var _18=0;_18<_5.length;_18++){
var _19=_5[_18];
var _11=_1.getField(_19);
var _10=_2.getField(_19);
var _20=_1.ID+'.'+_19;
if(!_10){
_3.add(_7(_19,'INFO','DataSource field "'+
_20+'" is present in live but not in mock.'));
continue}
var _21=_11.title;
if(_21!=null&&_21!=_10.title){
_3.add(_7(_19,'INFO','DataSource field "'+
_20+'" has different title in live ('+_21+
') than mock ('+_10.title+').'))}
var _22=_4.indexOf(_19);
if(_22!=_18&&_22!=_17+1&&
_22!=_18+_16&&_22!=_18-_16){
_16=Math.abs(_18-_22);
_3.add(_7(_19,'WARN','DataSource field "'+
_20+'" has different order in live ('+_18+') than mock ('+_22+').'))}else{
if(_22==_17+1){
_17=_22}
}
}
return _3}
,isc.A.isLoaded=function isc_c_DataSource_isLoaded(_1){
if(!_1)return false;
if(isc.isA.DataSource(_1)||this._dataSources[_1])return true;
return false}
,isc.A.getDataSource=function isc_c_DataSource_getDataSource(_1,_2,_3,_4){
if(!_1)return null;
if(isc.isA.DataSource(_1))return _1;
if(isc.startsWith(_1,this.$748)){
_1=_1.substring(4)}else if(isc.startsWith(_1,this.$253o)){
_1=_1.substring(7)}
if(_4&&isc.WebService){
if(_4==isc.DS.$532)return this.$54v[_1];
if(_4==isc.DS.$45t)return this.$54w[_1];
return null}
var _5=this._dataSources[_1];
if(!_5){
if(isc.DataSource.DS_FN&&isc.DataSource.DS_FN[_1]){
var _6=isc.DataSource.DS_FN[_1];
delete isc.DataSource.DS_FN[_1];
_6.call(null)}
_5=this._dataSources[_1];
if(!_5){
_5=this.$37x(_1,_2);
if(_5)_5.ID=_1}
}
if(_5){
if(_2){
this.fireCallback(_2,"dsID",[_5.ID],_5)}
return _5}
if(_2){
this.load(_1,_2,_3)}
return null}
,isc.A.loadSchema=function isc_c_DataSource_loadSchema(_1,_2,_3){
this.logWarn("Attempt to load schema for DataSource '"+_1+
"'. This dataSource cannot be found. To load DataSources from the server without explicit inclusion in your application requires optional SmartClient server support - not present in this build.");
return null}
,isc.A.get=function isc_c_DataSource_get(_1,_2,_3,_4){
return this.getDataSource(_1,_2,_3,_4)}
,isc.A.$37x=function isc_c_DataSource__loadDataSource(_1,_2){
if(_2)return null;
if(_1!=isc.auto&&this.logIsDebugEnabled()){
this.logDebug("isc.DataSource '"+_1+"' not present")}
return null}
,isc.A.getRegisteredDataSources=function isc_c_DataSource_getRegisteredDataSources(){
return isc.getKeys(this._dataSources)}
,isc.A.getRegisteredDataSourceObjects=function isc_c_DataSource_getRegisteredDataSourceObjects(_1,_2,_3,_4){
var _5=this.getRegisteredDataSources(),
_6=[];
for(var i=0;i<_5.length;i++){
var _8=this.getDataSource(_5[i]);
if(!_8||!_8.ID)continue;
if(_1&&_8.$145w||_4&&_8._autoAssignedID||
_2&&(_8.componentSchema||_8.builtinSchema)||
_3&&!_8._autoAssignedID&&_8.ID.startsWith("isc_"))
{
continue}
_6.add(_8)}
return _6}
,isc.A.isRegistered=function isc_c_DataSource_isRegistered(_1){
if(this._dataSources[_1])return true;
return false}
,isc.A.getRegisteredDataSourceDefinitions=function isc_c_DataSource_getRegisteredDataSourceDefinitions(_1,_2,_3){
if(_3==null)_3=this.getRegisteredDataSourceObjects(true,true,true,true);
var _4=(_1=="json")||(_1=="pseudocode");
var _5=(_4?isc.JSONEncoder.create():null),
_6=(_4?"\n":"")
;
return _3.map(function(_14){
var _7=_14.getSerializeableFields(),
_8=_14.getClassName(),
_9
;
if(isc.DS.isRegistered(_8)){
_9=isc.DS.get(_8)}else{
_9=isc.DS.get("DataSource");
_7._constructor=_8}
isc.DS.$254h.map(function(_10){
delete _7[_10]});
for(var _10 in _7){
if(_10.startsWith("_")){
delete _7[_10]}
}
if(_7.fields){
var _11=_7.fields;
for(var i=0;i<_11.length;i++){
_11[i]=isc.DS.$260f(_11[i])}
}
if(!_2){
delete _7.testData;
delete _7.cacheData}
var _13=(_4?
_5.encode(_7):
_9.xmlSerialize(_7,{ignoreExplicitTypes:true}));
if(_1=="pseudocode"){
_13="isc.DataSource.create("+_13+");"
}
return _13}).join(_6)}
,isc.A.$260f=function isc_c_DataSource__getSerializeableFieldObject(_1){
var _2=_1.validators;
if(_2){
var _3=[];
for(var j=0;j<_2.length;j++){
var _5=_2[j];
if(_5.$2399){
_3.add(_5)}
delete _5.ID;
if(!_5.defaultErrorMessage){
delete _5.defaultErrorMessage}
}
if(_3.length>0){
_2.removeAll(_3)}
}
if(_2&&_2.length==0){
delete _1.validators}
isc.DS.$254i.map(function(_6){
delete _1[_6]});
for(var _6 in _1){
if(_6.startsWith("_")){
delete _1[_6]}
}
return _1}
,isc.A.getForeignFieldName=function isc_c_DataSource_getForeignFieldName(_1){
var _2=_1.foreignKey,
_3=_2.indexOf(".");
while(_3>=0){
_2=_2.substring(_3+1);
_3=_2.indexOf(".")}
return _2}
,isc.A.getForeignDSName=function isc_c_DataSource_getForeignDSName(_1,_2){
var _3=_1.foreignKey,
_4=_3.lastIndexOf(".");
if(_4==-1){
if(_2==null)return null;
return isc.isA.String(_2)?_2:_2.ID}else{
_3=_3.substring(0,_4);
_4=_3.indexOf(".")}
while(_4>=0){
_3=_3.substring(_4+1);
_4=_3.indexOf(".")}
return _3}
,isc.A.registerDataSource=function isc_c_DataSource_registerDataSource(_1){
if(this.logIsInfoEnabled()){
this.logInfo("Registered new isc.DataSource '"+_1.ID+"'")}
if(_1.ID){
var _2=this._dataSources[_1.ID];
if(!_2||!_1.schemaNamespace){
this._dataSources[_1.ID]=_1}
var _3=_1._constructor||_1.Constructor||_1.type;
if(_3&&(_3!=_1.ID)){
this.$163n[_3]=_1.ID}
if(_1.tableCode){
this.$99u[_1.tableCode]=_1.ID;
var _4=this.$99v[_1.tableCode];
if(_4){
for(var i=0;i<_4.length;i++){
var _6=_4[i];
var _7=isc.DS.get(_6);
var _8=_7.getFields();
var _9=_1.getFields();
for(var _10 in _8){
for(var _11 in _9){
if(_8[_10].fkColumnCode==_9[_11].columnCode){
_8[_10].foreignKey=_1.ID+"."+_9[_11].name;
break}
}
}
_7.addChildDataSource(_1);
_4.removeAt(i);
i--}
if(_4.length==0){
delete this.$99v[_1.tableCode]}
}
}
}
if(isc.Schema&&isc.isA.Schema(_1)){
if(isc.isAn.XSElement(_1))this.$54v[_1.ID]=_1;
else if(isc.isAn.XSComplexType(_1))this.$54w[_1.ID]=_1;
return}
var _12=_1.getLocalFields(true);
var _13=this.$37z=(this.$37z||{});
for(var _14 in _12){
var _15=_12[_14];
var _16=null;
if(_15.fkTableCode){
_16=this.$99u[_15.fkTableCode];
if(_16==null){
if(this.$99v[_15.fkTableCode]==null){
this.$99v[_15.fkTableCode]=[]}
this.$99v[_15.fkTableCode].add(_1.ID);
continue}
var _17=isc.DS.get(_16);
var _9=_17.getFields();
for(var _11 in _9){
if(_9[_11].columnCode==_15.fkColumnCode){
_15.foreignKey=_17.ID+"."+_9[_11].name}
}
}else if(_15.foreignKey){
var _16=this.getForeignDSName(_15,_1)}else{
continue}
if(isc.DS.isRegistered(_16)){
isc.DS.get(_16).addChildDataSource(_1)}else{
if(_13[_16]==null){
_13[_16]=[]}
_13[_16].add(_1)}
}
var _18=_13[_1.ID];
if(_18!=null){
_1.map("addChildDataSource",_18);
_13[_1.ID]=null}
var _19=this.$370=this.$370||{};
if(_1.childRelations){
for(var i=0;i<_1.childRelations.length;i++){
var _20=_1.childRelations[i],
_21=_20.dsName,
_22=isc.DS.get(_21);
if(_22){
this.$371(_1,_22,_20)}else{
if(_19[_21]==null){
_19[_21]=[]}
_20.parentDS=_1.ID;
_19[_21].add(_20)}
}
}
var _23=_19[_1.ID];
if(_23){
for(var i=0;i<_23.length;i++){
var _20=_23[i];
this.$371(isc.DS.get(_20.parentDS),_1,_20)}
}
}
,isc.A.$371=function isc_c_DataSource__addChildRelation(_1,_2,_3){
_1.addChildDataSource(_2);
if(!_3.fieldName)return;
var _4=_2.getField(_3.fieldName);
if(!_4.foreignKey){
_4.foreignKey=_1.ID+"."+
_1.getPrimaryKeyFieldNames()[0]}
}
,isc.A.$217u=function isc_c_DataSource__equals(_1,_2){
if(isc.isA.DataSource(_1)){
if(!isc.isA.DataSource(_2))_1=_1.getID()}else{
if(isc.isA.DataSource(_2))_2=_2.getID()}
return _1==_2}
,isc.A.registerSgwtDS=function isc_c_DataSource_registerSgwtDS(_1,_2){
isc.DataSource.DS_FN[_1]=_2}
,isc.A.unregisterSgwtDS=function isc_c_DataSource_unregisterSgwtDS(_1){
delete isc.DataSource.DS_FN[_1]}
,isc.A.reregisterSgwtDS=function isc_c_DataSource_reregisterSgwtDS(_1,_2){
isc.DataSource.DS_FN[_2]=isc.DataSource.DS_FN[_1];
delete isc.DataSource.DS_FN[_1]}
,isc.A.setupFieldValidatorID=function isc_c_DataSource_setupFieldValidatorID(_1){
if(_1.ID==null){
_1.ID="_"+(this.$248w++)}
return _1}
,isc.A.getFieldValue=function isc_c_DataSource_getFieldValue(_1,_2,_3,_4,_5){
return isc.Canvas.$70o(_3,_1,_2,_4,true,_5)}
,isc.A.saveValueViaDataPath=function isc_c_DataSource_saveValueViaDataPath(_1,_2,_3,_4,_5){
return isc.Canvas.$70n(_2,_1,_3,_4,null,true,_5)}
,isc.A.clearValueAtDataPath=function isc_c_DataSource_clearValueAtDataPath(_1,_2,_3){
if(_2==null){
_2=_1}
isc.Canvas.$70m(_2,_3,null,true)}
,isc.A.dupRequest=function isc_c_DataSource_dupRequest(_1){
if(!_1||_1.$178g)return _1;
return isc.addProperties({$178g:true},_1)}
,isc.A.getInheritanceDistance=function isc_c_DataSource_getInheritanceDistance(_1,_2){
var _3=isc.ClassFactory.getClass(_1),
_4=isc.ClassFactory.getClass(_2)
;
if(_3==null||_4==null){
this.logWarn("Invalid superclass and/or subclass argument provided");
return-1}
if(!_4.isA(_1)){
this.logWarn(_2+" is not a subclass of "+_1);
return-1}
if(isc.isA.SGWTFactoryObject(_3)){
if(!isc.isA.SGWTFactoryObject(_4)){
_3=_3.getDefaultScClass();
if(!_3){
this.logWarn("Could not get defaultScClass for SGWTFactory "+_1);
return-1}
}
}else if(isc.isA.SGWTFactoryObject(_4)){
_4=_4.getDefaultScClass();
if(!_4){
this.logWarn("Could not get defaultScClass for SGWTFactory "+_2);
return-1}
}
for(var _5=0;_4&&_4!=_3;_5++){
_4=_4.getSuperClass()}
return _5}
,isc.A.isSimpleTypeValue=function isc_c_DataSource_isSimpleTypeValue(_1){
if(_1!=null&&(!isc.isAn.Object(_1)||isc.isA.Date(_1)))return true;
return false}
,isc.A.getNearestSchema=function isc_c_DataSource_getNearestSchema(_1){
if(_1==null)return null;
var _2;
if(isc.isA.String(_1))_2=_1;
else{
_2=isc.isAn.Instance(_1)?_1.getClassName():
_1._constructor||_1.type||_1.$schemaId}
var _3=isc.DS.get(_2);
if(!_3){
_3=isc.DS.get(this.$163n[_2])}
if(_3)return _3;
var _4=isc.ClassFactory.getClass(_2);
var _5=_4;
if(_4!=null){
var _6=null;
while(_3==null&&(_4=_4.getSuperClass())!=null&&
_4!=_6)
{
_3=isc.DS.get(_4.getClassName());
if(_3==null){
_3=isc.DS.get(this.$163n[_2])}
_6=_4}
if(!_3){
if(isc.isA.SGWTFactoryObject(_5)){
var _7=_5.getDefaultScClassName();
if(_7)return this.getNearestSchema(_7)}
}
}
return _3||isc.DS.get("Object")}
,isc.A.getNearestSchemaClass=function isc_c_DataSource_getNearestSchemaClass(_1){
if(_1==null)return null;
var _2;
while(_2==null){
var _3=isc.DS.get(_1);
if(_3==null){
var _4=isc.ClassFactory.getClass(_1);
if(_4&&isc.isA.SGWTFactoryObject(_4)){
return _4}else{
return null}
}
_2=isc.ClassFactory.getClass(_3._constructor||_3.Constructor
||_3.type);
if(_2!=null)return _2;
_1=_3.inheritsFrom;
if(!_1)return null}
return null}
,isc.A.$372=function isc_c_DataSource__getStandardOperationType(_1){
switch(_1){
case"fetch":
case"select":
case"filter":
return"fetch";
case"add":
case"insert":
return"add";
case"update":
return"update";
case"remove":
case"delete":
return"remove";
default:
return _1}
}
,isc.A.isClientOnly=function isc_c_DataSource_isClientOnly(_1){
if(isc.isA.String(_1))_1=this.getDataSource(_1);
if(!_1)return false;
return _1.clientOnly}
,isc.A.makeFileSpec=function isc_c_DataSource_makeFileSpec(_1){
var _2={};
_1=_1.trim();
if(_1.startsWith("/"))_1=_1.slice(1);
if(_1.endsWith("/"))_1=_1.slice(0,-1);
var _3=_1.split("/");
var _4=_3[_3.length-1];
var _5=_4.indexOf("?"),
_6;
if(_5!=-1){
_6=_4.substring(_5);
_4=_4.substring(0,_5);
this.logWarn("File path passed to getFile() or makeFileSpec() includes a query parameter:"
+_6+". This will be ignored.")}
var _7=_4.split(".");
var _8=_7.length;
switch(_8){
case 0:
case 1:
break;
case 2:
if(!_7[1].contains(" ")){
_2.fileType=_7[1]}
break;
default:
_2.fileType=_7[_8-2];
_2.fileFormat=_7[_8-1];
if(_2.fileFormat.contains(" ")){
delete _2.fileType;
delete _2.fileFormat}else if(_2.fileType.contains(" ")){
_2.fileType=_2.fileFormat;
delete _2.fileFormat}
break}
var _9=(
_2.fileType?_2.fileType.length+1:0
)+(
_2.fileFormat?_2.fileFormat.length+1:0
);
if(_6!=null)_9+=_6.length;
if(_9==0){
_2.fileName=_1}else{
_2.fileName=_1.slice(0,-_9)}
return _2}
,isc.A.makeDefaultOperation=function isc_c_DataSource_makeDefaultOperation(_1,_2,_3){
var _4=isc.rpc.app();
if(isc.isA.DataSource(_1))_1=_1.ID;
if(!_1){
_1="auto"}else if(_3){
var _5=isc.DataSource.get(_1);
if(isc.isA.DataSource(_5)){
if(!_5.createdOperations)_5.createdOperations={};
var _6=_5.createdOperations[_2+" "+_3];
if(_6==null){
_6={ID:_3,
dataSource:_1,
type:_2,
filterType:"paged",
loadDataOnDemand:true};
_5.createdOperations[_2+" "+_3]=_6}
return _6}
}
if(_4.operations==null)_4.operations={};
_3=_3||_1+"_"+_2;
var _6=_4.operations[_3];
if(_6==null){
_6={ID:_3,
dataSource:_1,
type:_2,
filterType:"paged",
loadDataOnDemand:true,
source:"auto"};
_4.operations[_3]=_6}
return _6}
,isc.A.handleUpdate=function isc_c_DataSource_handleUpdate(_1,_2){
if(!this.isUpdateOperation(_2.operationType))return;
var _3=this.get(_2.dataSource);
_3.updateCaches(_1,_2)}
,isc.A.isUpdateOperation=function isc_c_DataSource_isUpdateOperation(_1){
if(_1=="add"||_1=="update"||_1=="remove"||
_1=="replace"
||_1=="delete"||_1=="insert"
)return true}
,isc.A.getUpdatedData=function isc_c_DataSource_getUpdatedData(_1,_2,_3){
var _4=this.get(_1.dataSource);
return _4.getUpdatedData(_1,_2,_3)}
,isc.A.filterCriteriaForFormValues=function isc_c_DataSource_filterCriteriaForFormValues(_1){
if(isc.DS.isAdvancedCriteria(_1))return _1;
var _2={};
for(var _3 in _1){
var _4=_1[_3];
if(_4==null||isc.is.emptyString(_4))continue;
if(isc.isAn.Array(_4)){
if(_4.length==0)continue;
for(var i=0;i<_4.length;i++){
var _6=_4[i];
if(isc.isAn.emptyString(_6))continue}
}
_2[_3]=_4}
return _2}
,isc.A.checkEmptyCriteria=function isc_c_DataSource_checkEmptyCriteria(_1,_2){
if((_2||this.isAdvancedCriteria(_1))&&_1.criteria){
if(_1.criteria.length==0)return null;
for(var i=_1.criteria.length-1;i>=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){
var _5;
var _6;
var _7;
var _8;
if(isc.isAn.Object(_3)){
_5=_3.mockMode;
_6=_3.fastFail;
_4=_3.loadParents;
_7=_3.requestProps;
_8=_3.sandboxContext;
_3=_3.forceReload}
if(_8)_3=true;
var _9,
_10;
if(!isc.isAn.Array(_1)){
_10=isc.DataSource.$37s;
if(_10[_1]){
_10[_1].add(_2);
return null}else{
_10[_1]=[];
_10[_1].add(_2)}
_9=_1;
_1=[_1]}
if(_1.length<=0){
this.logWarn("No DataSource IDs passed in.");
return}
var _11=[];
for(var i=0;i<_1.length;i++){
if(!this.isLoaded(_1[i])||_3)_11.add(_1[i])}
var _13=_11.join(","),
_14=isc.DataSource.loaderURL+
(isc.DataSource.loaderURL.contains("?")?"&":"?")+
(_4?"loadParents=true&":"")+
(_6==false?"fastFail=false&":"")+
(_5?"mockMode=true&":"")+"dataSource="+_13;
if(_11.length>0){
var _15={
actionURL:_14,
httpMethod:"GET",
willHandleError:true,
clientContext:{
dsID:_1
}
};
if(_7){
_15=isc.combineObjects(
isc.addProperties({},_15),_7)}
if(_8){
var _16=_15.params||{};
_15.params=_16;
for(var _17 in _8){
_16['sbx_'+_17]=_8[_17]}
_15.clientContext.sandboxContext=_8}
isc.RPCManager.send(null,
function(_23,_24,_25){
var _1=_25.clientContext.dsID,
_8=_25.clientContext.sandboxContext,
_18
;
if(_23.httpResponseCode==404){
isc.warn("The DataSourceLoader servlet is not available at the configured DataSource.loaderURL ('"+
isc.DataSource.loaderURL+"').");
return null}
if(_4&&!_3)isc.DataSource.$92w=true;
try{
if(_8){
isc.DataSource.$211n={};
for(var i=0;i<_1.length;i++){
var _19=_1[i],
_20=isc.DS.$2144(_19,_8);
isc.DataSource.$211n[_19]=_20;
_1[i]=_20}
}
var _21=isc.Class.evaluate(_24);
if(isc.isA.List(_21)){
_18=_21;
this.logWarn("loadDS(): failed to load DataSources: "+_18)}
}catch(e){
isc.logWarn("Response from DataSourceLoader caused exception "+
isc.echoAll(e)+
", response was:\n"+
_24)}
delete isc.DataSource.$211n;
delete isc.DataSource.$92w;
if(_9){
for(var i=0;i<_10[_9].length;i++){
var _22=_10[_9][i];
if(_22)this.fireCallback(_22,["dsID"],[_1])}
delete _10[_9]}else{
if(_2)this.fireCallback(_2,["dsID","failedIDs"],
[_1,_18])}
},
_15
)}else{
this.logWarn("DataSource(s) already loaded: "+_1.join(",")+
"\nUse forceReload to reload such DataSources");
if(_2)this.fireCallback(_2,["dsID"],[_1]);
if(_9)delete _10[_9]}
}
,isc.A.$2144=function isc_c_DataSource__getSandboxedID(_1,_2){
var _3=_1;
for(var _4 in _2){
_3+="_sbx_"+_4+"_"+_2[_4]}
return _3}
,isc.A.loadWithParents=function isc_c_DataSource_loadWithParents(_1,_2,_3){
if(isc.isAn.Object(_3)){
_3.loadParents=true}
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),
_5=isc.SortSpecifierUtil.$278v(_4);
if(!isc.isA.nonemptyString(_5))continue;
_2.add((!Array.shouldSortAscending(_4.direction)?"-":"")+_5)}
return _2}
,isc.A.getSortSpecifiers=function isc_c_DataSource_getSortSpecifiers(_1,_2){
if(!isc.isA.Array(_1))_1=[_1];
var _3=[];
for(var i=0;i<_1.length;i++){
var _5=_1[i];
_3.add(isc.SortSpecifierUtil.getSortSpecifier(_5,_2))}
return _3}
,isc.A.isAdvancedCriteria=function isc_c_DataSource_isAdvancedCriteria(_1,_2){
if(!_1||isc.isAn.emptyObject(_1))return false;
if(_2&&!isc.isA.DataSource(_2))_2=this.get(_2);
if(_1._constructor=="AdvancedCriteria")return true;
var _3=false,
_4=this.getSearchOperator(_1.operator,_2);
if(_1.criteria&&!isc.isA.Instance(_1)){
var _5;
if(isc.isA.Array(_1.criteria)&&_1.criteria[0]){
_5=_1.criteria[0].fieldName}else if(isc.isA.Object(_1.criteria)){
_5=_1.criteria.fieldName}
if(_5&&_5!="")_3=true}
if(_3){}
else if(_2&&_2.getField(_1.fieldName)&&_4){
_3=true}
else if(_2&&(_2.getField("fieldName")||_2.getField("operator")))_3=false;
else if((_1.fieldName||_1.fieldQuery)&&(_1.operator&&_4)){
if(_4.valueType=="none"){
_3=true}else{
var _6;
if(_1.value!==_6){
_3=true}
}
}
else if(_2&&_2.getField(_1.fieldName)&&
!_1.operator&&_1.value==null){
_3=true}else{
var _6;
if(_1.operator!=_6){
var _7=_4;
if(_7!=null&&(_7.isAnd||_7.isOr)){
_3=true}
}
}
if(this.logIsInfoEnabled()){
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.normalizeAdvancedCriteria=function isc_c_DataSource_normalizeAdvancedCriteria(_1,_2,_3,_4){
if(!_1)return;
if(_1.__normalized&&!_2){
return _1}
var _5={
__normalized:true
};
if((_1.__normalized&&_1._constructor=="AdvancedCriteria")||!_3){
_5._constructor="AdvancedCriteria";
if(_1.strictSQLFiltering)_5.strictSQLFiltering=true}
if(_1.criteria){
if(!isc.isAn.Array(_1.criteria)){
_1.criteria=[_1.criteria]}
_5.operator=_1.operator;
_5.criteria=[];
for(var i=0;i<_1.criteria.length;i++){
_5.criteria.add(isc.DS.normalizeAdvancedCriteria(_1.criteria[i],_2,true,_4))}
}else{
if(!isc.isAn.Array(_1.value)){
isc.addProperties(_5,_1)}else{
var _7=this.getSearchOperator(_1.operator,_4);
if(!_7||!_7.canNormalize){
isc.addProperties(_5,_1)}else if(_1.value.length==1){
_1.value=_1.value[0];
isc.addProperties(_5,_1)}else{
_5.operator=_7.negate?"and":"or";
_5.criteria=[];
for(var i=0;i<_1.value.length;i++){
_5.criteria.add({
__normalized:true,
fieldName:_1.fieldName,
operator:_1.operator,
value:_1.value[i]
})}
}
}
}
var _8;
if(!_5.operator&&_5.fieldName){
_5.operator="equals";
if(_5.value==_8)_5.value=true}
if(!_5.operator&&_5.criteria)_5.operator="and";
return _5}
,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.$246m=function isc_c_DataSource__getAdvancedCriteriaOperators(_1,_2){
if(_1.criteria){
for(var i=0;i<_1.criteria.length;i++){
isc.DS.$246m(_1.criteria[i],_2)}
}else{
_2.add(_1.operator)}
}
,isc.A.collectTopLevelAsyncCriteria=function isc_c_DataSource_collectTopLevelAsyncCriteria(_1,_2,_3){
if(_3==null)_3=[];
if(this.isAdvancedCriteria(_1,_2)){
if(_1.operator=="and"){
if(isc.isAn.Array(_1.criteria)){
for(var i=0;i<_1.criteria.length;++i){
this.collectTopLevelAsyncCriteria(_1.criteria[i],_2,_3)}
}
}else{
var _5=this.getSearchOperator(_1.operator,_2);
if(_5!=null&&_5.asyncFilter!=null)_3.add(_1)}
}
return _3}
,isc.A.applyAsyncCriteria=function isc_c_DataSource_applyAsyncCriteria(_1,_2,_3,_4,_5,_6){
var _7=isc.defaultAsyncOperationCatchCallback;
var _8=[];
for(var i=0;i<_1.length;){
var _10=_1[i],
_11={
cancellationController:_5,
dataSource:_6,
strictSQLFiltering:_4,
recordsWereUpdated:_3
},
_12=this.getSearchOperator(_10.operator,_6),
_13=_12.asyncFilter(_10,_2,_11);
if(_13==null){
_1.removeAt(i);
continue}
_8[i++]=_13.$274g(_7)}
if(_8.length==0)return null;
return Promise.all(_8)
.then(function normalizeResults(_15){
for(var i=0;i<_15.length;++i){
var _14=_15[i];
if(_14.type==null)_14.type="success";
if(_14.criterion!=null&&_14.criterion!==_1[i]){
isc.logWarn("found an AsyncFilterResult with the incorrect `criterion` property")}
_14.criterion=_1[i]}
return _15})}
,isc.A.getCriterionDependencies=function isc_c_DataSource_getCriterionDependencies(_1,_2){
if(!this.isAdvancedCriteria(_1,_2)){
return isc.getKeys(_1)}
var _3=this.getSearchOperator(_1.operator,_2);
var _4=_3&&_3.getDependencies&&_3.getDependencies(_1);
if(!_4){
var _5=_3.fieldName;
switch(_3.valueType){
case"fieldType":
case"none":
case"valueRange":
case"valueSet":
if(isc.isA.nonemptyString(_5)){
_4=[_5]}
break;
case"fieldName":
if(isc.isA.nonemptyString(_5)){
if(isc.isA.nonemptyString(_3.value)){
_4=[_5,_3.value]}else{
_4=[_5]}
}
break;
case"criteria":
var _6=_3.criteria;
if(!_6)_4=[];
else if(!isc.isAn.Array(_6))_4=null;
else if(_6.length==1)_4=this.getCriterionDependencies(_6[0],_2);
else{
_4=[];
for(var c=0;c<_6.length;++c){
var _8=this.getCriterionDependencies(_6[c],_2);
if(!_8){
_4=null;
break}
_4.addList(_8)}
}
break}
}
return _4}
,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.evalBoundary;isc.B.push(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.$249t=function isc_c_DataSource__formatPathValue(_1,_2,_3){
var _4=this.getPathValue(_1,_2);
var _5=_3.getRuleContextPathDetails(_2);
if(_5&&_5.field&&isc.isA.DataSource(_5.dataSource)){
return _5.dataSource.formatFieldValue(_5.field,_4)}
return _4}
,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.$229f?_4.tagName:null)||_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[_5.length-1];
var _8=_4.getField(_7);
if(!_8)_8=_4.getField(isc.Canvas.$177s(_7));
return _8}
,isc.A.getDataSourceForField=function isc_c_DataSource_getDataSourceForField(_1,_2,_3){
var _4=_1.split("."),
_5=_4[0],
_6=_4[_4.length-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++){
var _9=_2[i];
if(_9&&_9.getID()==_5||
(_9&&_9.$229f&&_9.tagName==_5)||
(_9&&_9.criteriaBasePath&&_1.startsWith(_9.criteriaBasePath)))
{
_7=_9;
break}
var _10=_1.split(".");
if(_9&&_9.criteriaBasePath){
var _11=isc.Canvas.$177s(_10[_10.length-1]);
var _12=_9.getField(_11);
if(_12){
if(_12.criteriaPath&&_12.criteriaPath==_1){
_7=_9;
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;
var _2=isc.DS.$57z[_1.operator];
if(isc.isA.emptyObject(_1)||(_1.fieldName&&_2&&_2.valueType!="criteria"))
{
return true}
if(_2&&_2.valueType=="criteria"&&_1.criteria){
var _3=_1.criteria;
for(var i=0;i<_3.length;i++){
var _5=_3[i],
_6=_5.operator?isc.DS.$57z[_5.operator]:null,
_7=_6&&_6.valueType=="criteria"
;
if(_7){
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||_1.criteria.isEmpty())return true;
if(_1.operator!=_2){
if(_1.criteria.length!=1||_1.criteria[0].criteria||_1.operator=="not")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,_3,_4){
if(!_1)return"";
if(!_3){
_3={}}
var _5=_3.prefix||'',
_6=_3.suffix||'';
if(!isc.isAn.Array(_2)){
if(!isc.isA.DataSource(_2))_2=isc.DS.getDataSource(_2);
if(!_2)return isc.Operators.noDataSourceDescription}
var _7="",
_8;
if(_1.criteria&&isc.isAn.Array(_1.criteria)){
var _9=_1.operator,
_10=isc.FilterBuilder.getPrototype(),
_11=_10["inline"+
_9.substring(0,1).toUpperCase()+
_9.substring(1,_9.length)+"Title"],
_12=_1.criteria
;
for(var i=0;i<_12.length;i++){
var _14=_12[i];
_7+=_5;
if(i>0)_7+=" "+_11+" ";
_8=isc.DataSource.getCriterionDescription(_14,_2,
_4,true);
if(_3.escapeHTML)_8=_8.asHTML();
_7+=_8;
_7+=_6}
}else if(_1.fixedValue!=null){
_7+=(_1.fixedValue?"Always":"Never")}else{
if(isc.isA.DataSource(_2)){
if(!_2.isAdvancedCriteria(_1)){
_1=isc.DS.convertCriteria(_1,_3.textMatchStyle,_2)}
}else{
if(!isc.DS.isAdvancedCriteria(_1)){
_1=isc.DS.convertCriteria(_1,_3.textMatchStyle)}
}
_8=isc.DataSource.getCriterionDescription(_1,_2,_4);
if(_3.escapeHTML)_8=_8.asHTML();
_7+=_5+_8+_6}
return _7}
,isc.A.getAggregationDescription=function isc_c_DataSource_getAggregationDescription(_1,_2){
var _3=isc.DS.getDataSource(_1.dataSource);
_2=_1.dataSource||_2;
if(!isc.isA.DataSource(_2))_2=isc.DS.getDataSource(_2);
if(!_2)return isc.Operators.noDataSourceDescription;
var _4=function(_18){
var _5=_2.getField(_18);
return _5&&(_5.title?_5.title:_18)};
var _6="";
if(_1.groupBy){
var _7=(isc.isAn.Array(_1.groupBy)?_1.groupBy:[_1.groupBy]),
_8=""
;
for(var i=0;i<_7.length;i++){
if(_8.length>0){
_8+=(i<_7.length-1?", ":" and ")}
_8+=_4(_7[i])}
_6+="Combine "+(_3?_3.ID+" ":"")+"records that have the same value for "+_8}
if(_1.summaryFunctions){
var _10=(_1.groupBy?"<br>":""),
_11=_1.summaryFunctions,
_12="",
_13=true;
for(var _14 in _1.summaryFunctions){
var _15=_11[_14],
_16=(isc.SummaryFunctionItem?
isc.SummaryFunctionItem.getFunctionTitle(_15):
_15);
_12+=
(_13?_10+(_1.groupBy?"Then calculate ":"Calculate "):"<br>and ")+
"the value for "+_4(_14)+
(_13&&!_1.groupBy&&_3?" from "+_3.ID:"")+
" as the "+_16;
_13=false}
_6+=_12}
if(_6==""&&!isc.isAn.emptyObject(_1)){
var _17=this.$276q(_1,_2);
if(_17){
_6="Return "+_4(_17)+" from "+_2.getTitle()}
}
if(_1.criteria){
_6+=" where "+isc.DS.getAdvancedCriteriaDescription(_1.criteria,_2)}
return _6}
,isc.A.$276q=function isc_c_DataSource__getQueryOutput(_1,_2){
_2=_1.dataSource||_2;
if(!isc.isA.DataSource(_2))_2=isc.DS.getDataSource(_2);
var _3;
if(_1){
if(_1.queryOutput){
_3=_1.queryOutput}else if(_1.summaryFunctions){
var _4=_1.summaryFunctions;
if(_4){
for(var _5 in _4){
_3=_5;
break}
}
}else if(_1.groupBy){
var _6=_1.groupBy;
_3=(isc.isA.String(_6)?_6:(_6.length>0?_6[0]:null))}
}
if(!_3){
if(_2){
_3=_2.getPrimaryKeyFieldName();
if(!_3){
var _7=_2.getFields();
for(var _8 in _7){
var _9=_7[_8];
if(_9.type=="integer"||_9.type=="float"){
_3=_8;
break}
}
}
}
}
return _3}
,isc.A.$1780=function isc_c_DataSource__getFieldOperatorTitle(_1,_2){
if(isc.isA.String(_2))_2=isc.DS.$57z[_2];
if(!_2)return null;
if(isc.isA.String(_1))_1=this.getField(_1);
var _3=isc.Operators;
if(!_1){
if(_2)return _2.titleProperty?_3[_2.titleProperty]:_2.title;
return""}
if(isc.SimpleType.inheritsFrom(_1.type||"text","text")){
var _4=_3[_2.textTitleProperty]||_2.textTitle;
if(_4)return _4}
return _2.titleProperty?_3[_2.titleProperty]:_2.title}
,isc.A.getCriterionDescription=function isc_c_DataSource_getCriterionDescription(_1,_2,_3,_4){
if(_1==null)return"";
var _5=(_3!=null)?_3.ID+".values.":null,
_6=_1.fieldName,
_7=_1.fieldQuery,
_8=_1.operator,
_9=_1.start,
_10=_1.end,
_11
;
if(_6&&isc.isAn.Array(_2)){
var _12=_2;
_2=isc.DataSource.getDataSourceForField(_6,_12);
if(!_2&&_3&&!_6.contains(".")&&!_6.contains("/")){
_6=_5+_6;
_2=isc.DataSource.getDataSourceForField(_6,_12)}
if(!_2)return isc.Operators.noDataSourceDescription;
_11=isc.DataSource.getFieldFromDataSources(_6,[_2])}else{
if(!isc.isA.DataSource(_2))_2=isc.DS.getDataSource(_2);
if(!_2)return isc.Operators.noDataSourceDescription;
if(_6){
var _13=_6.split("."),
_14=_13[0];
if(_13.length==1){
_6=_13[0]}else{
if(_14!=_2.ID){
var _15=isc.DS.getDataSource(_14);
if(_15)_2=_15;
_6=_13[1]}else{
_6=_13[1]}
}
_11=_2.getField(_6);
if(_11==null){
_11=_2.getFieldForDataPath(_6)}
}
}
var _16="";
if(_6){
if(!_11){
if(_1.criteria&&isc.isAn.Array(_1.criteria)){
this.logInfo("DataSource.getCriterionDescription(): Passed an AdvancedCriteria - returning through getAdvancedCriteriaDescription.");
_16=isc.DS.getAdvancedCriteriaDescription(_1,_2,null,
_3);
return _4?_16="("+_16+")":_16}
isc.logWarn("DataSource.getCriterionDescription(): No such field '"+_6+
"' in DataSource '"+_2.ID+"'.");
return _6+" "+isc.FilterBuilder.missingFieldPrompt+" "}else{
_16=(_1.fieldName!=_6?_2.getTitle()+" ":"")+(_11.title?_11.title:_6)+" "}
}else if(_7!=null){
_16=isc.DS.getAggregationDescription(_7)+" "}
var _17=_2.getSearchOperator(_8);
if(!_17){
if(_16)_16+=" ";
return _16+"'"+_8+"'"}
if(_17.valueType=="criteria"){
if((_17.isAnd||_17.isOr)&&
isc.isAn.Array(_1.criteria)&&
_1.criteria.length==1)
{
return this.getCriterionDescription(_1.criteria[0],_2,_3,_4)}
var _18=isc.DS.getAdvancedCriteriaDescription(_1,_2,null,_3);
if(_4){
_18="("+_18+")"}
return _16+_18}
if(_17.getDescription){
if(_16)_16+=" ";
return _16+String.htmlStringToString(_17.getDescription(_1,_2))}
var _19=_2.getFieldOperatorMap(_11,true,_17.valueType,false);
_16+=(isc.Operators[_17.titleProperty]||_19[_8]||_8);
if(_17.valueType!="none"){
var _20=_1.valuePath,
_21=_1.valueQuery;
if(_21!=null){
_16+=" the calculated "+isc.DS.getAggregationDescription(_21).replace("Calculate the ","")}else if(_20!=null){
if(_20.startsWith(_5))_20=_20.replace(_5,"");
_16+=" value of "+_20}else{
var _22=_1.value;
if(isc.DateUtil.isRelativeDate(_22)){
var _23=_11?_11.type:null,
_24=false,
_25=isc.SimpleType
;
if(_25.inheritsFrom(_23,"date")){
_24=true}
_22=isc.DateUtil.getAbsoluteDate(_22,null,null,_24)}
if(_17.valueType=="valueRange"){
var _26=isc.FilterBuilder.getPrototype().inlineAndTitle;
_16+=" "+_9+" "+_26+" "+_10}else if(_17.valueType=="fieldName"){
var _27=_2.getField(_22);
_16+=" "+(_27?_27.title:null)||_6}else if(_8!="notNull"){
_16+=" ";
if(isc.isA.Date(_22)){
if(_22.isLogicalDate)_16+=_22.toShortDate();
else _16+=_22.toShortDatetime()}else if(isc.isAn.Array(_22)){
if(_22.length>1){
var _28=_22.duplicate();
for(var i=0;i<_28.length;i++){
_28[i]=_2.getDisplayValue(_6,_28[i])}
var _30;
if(isc.FormItem){
_30=isc.FormItem.getPrototype().multipleValueSeparator}
_30=_30||", ";
_16+=_28.join(_30)}else{
var _31=_2.getDisplayValue(_6,_22[0]);
_16+=_31}
}else{
var _31=_2.getDisplayValue(_6,_22);
_16+=_31&&_31.toString?_31.toString()
:_31}
}
}
}
return _16}
,isc.A.getLoaderURL=function isc_c_DataSource_getLoaderURL(){
return isc.DataSource.loaderURL}
,isc.A.setLoaderURL=function isc_c_DataSource_setLoaderURL(_1){
isc.DataSource.addClassProperties({loaderURL:_1})}
,isc.A.collapseEqualsCriteria=function isc_c_DataSource_collapseEqualsCriteria(_1){
if(!_1)return;
if(_1.criteria){
if(isc.isAn.Array(_1.criteria))_1.criteria.forEach(this.collapseEqualsCriteria,this)}else if(_1.operator=="equals")delete _1.operator}
,isc.A.expandEqualsCriteria=function isc_c_DataSource_expandEqualsCriteria(_1){
if(!_1)return;
if(_1.criteria){
if(isc.isAn.Array(_1.criteria))_1.criteria.forEach(this.expandEqualsCriteria,this)}else if((_1.value!=null||_1.valuePath!=null)&&!_1.operator){
_1.operator="equals"}
}
,isc.A.$278g=function isc_c_DataSource___defaultOperatorGetCleanCriterionImpl(_1,_2,_3){
_2=isc.addPropertiesWithAssign({},_2);
var _4=_1.valueType;
if(_4=="custom"||_4=="criteria"){
var _5=_2.criteria;
if(!isc.isAn.Array(_5)){
delete _2.criteria}else{
_5=_2.criteria=_5.duplicate();
for(var i=0;i<_5.length;++i){
_5[i]=this.getCleanCriterion(_5[i],_3)}
}
}else delete _2.criteria;
if(_4!="custom"){
if(_4=="criteria"||_4=="none")delete _2.value;
if(_4!="valueRange"){
delete _2.start;
delete _2.end}
}
return _2}
,isc.A.getCleanCriterion=function isc_c_DataSource_getCleanCriterion(_1,_2){
if(!_1)return;
var _3=this.getSearchOperator(_1.operator,_2);
if(_3){
if(_3.getCleanCriterion)_1=_3.getCleanCriterion(_1,_2);
else _1=this.$278g(_3,_1,_2)}else{
_1=isc.addPropertiesWithAssign({},_1);
var _4=_1.criteria;
if(!isc.isAn.Array(_4)){
delete _1.criteria}else{
_4=_1.criteria=_4.duplicate();
for(var i=0;i<_4.length;++i){
_4[i]=this.getCleanCriterion(_4[i],_2)}
}
}
delete _1.$2655;
return _1}
,isc.A.getCleanCollapsedCriterion=function isc_c_DataSource_getCleanCollapsedCriterion(_1,_2){
if(!_1||isc.isAn.emptyObject(_1))return;
if(!this.isAdvancedCriteria(_1,_2)){
return _1}
_1=this.getCleanCriterion(_1,_2);
this.collapseEqualsCriteria(_1);
if(!this.isAdvancedCriteria(_1,_2)){
_1._constructor="AdvancedCriteria"}
return _1}
,isc.A.fromCleanCriterion=function isc_c_DataSource_fromCleanCriterion(_1,_2){
if(!_1)return;
var _3=_1.operator,
_4=this.getSearchOperator(_3,_2),
_5;
if(_4&&_4.fromCleanCriterion){
_1=_4.fromCleanCriterion(_1,_2);
if(_1.operator!=_3){
this.logWarn("The '"+_3+"' operator's fromCleanCriterion() did not preserve the 'operator'. Resetting...");
_1.operator=_3}
}else if(isc.isAn.Array(_5=_1.criteria)){
for(var i=0;i<_5.length;++i){
_5[i]=this.fromCleanCriterion(_5[i],_2)}
}
return _1}
,isc.A.fromCollapsedCleanCriterion=function isc_c_DataSource_fromCollapsedCleanCriterion(_1,_2){
if(!_1||isc.isAn.emptyObject(_1))return;
if(!this.isAdvancedCriteria(_1,_2)){
return _1}
this.expandEqualsCriteria(_1);
_1=this.fromCleanCriterion(_1,_2);
isc.ResultSet.$2651(_1,_2);
return _1}
,isc.A.$272x=function isc_c_DataSource__getMinIndexability(_1,_2){
if(isc.isA.Number(_1)){
if(!isc.isA.Number(_2))return _1}else if(isc.isA.Number(_2)){
return _2}
return _1<_2?_1:_2}
,isc.A.getIndexability=function isc_c_DataSource_getIndexability(_1,_2,_3,_4){
if(_1.$272y)return _1.$272y;
var _5="z",
_6;
var _7=_1.validators,
_8=!_7?0:_7.length;
var _9=false;
if(_1.required)_9=true;
else{
for(var v=0;v<_8;++v){
if(_7[v].type=="required"){
_9=true;
break}
}
}
for(var v=0;v<_8;++v){
var _11=_7[v];
if(_11.type=="isBoolean"){
_6=_9?2:3;
_5=this.$272x(_5,_6)}else if(_11.type=="isInteger"){
_6="b";
_5=this.$272x(_5,_6)}else if(_11.type=="integerRange"&&
"min"in _11&&
"max"in _11&&
_11.min<=_11.max)
{
if(_11.exclusive){
if(_11.min+1>=_11.max){
_6=_9?0:1}else{
_6=_11.max-_11.min-1+(_9?0:1)}
}else{
_6=_11.max-_11.min+1+(_9?0:1)}
_5=this.$272x(_5,_6)}else if((_11.type=="isOneOf"||_11.type=="inSet")&&
isc.isAn.Array(_11.list))
{
_6=_11.list.length+(_9?0:1);
_5=this.$272x(_5,_6)}else if(_11.type=="matchesField"&&
_11.otherField&&
_1.name!=_11.otherField&&
(!_4||!_4.contains(_11.otherField)))
{
var _12=_2[_11.otherField];
if(isc.isAn.Array(_12)){
var _13=_12;
_12=_13[0];
for(var i=1;i<_13.length;++i){
if(_12!==_13[i]){
_12=null;
break}
}
}
if(!_12&&_3)_12=_3.getField(_11.otherField);
if(_12){
if(!_4)_4=[_1.name];
else _4.push(_1.name);
_6=this.getIndexability(_12,_2,_3,_4);
_5=this.$272x(_5,_6)}
}
}
var _15=_1.valueMap;
if(isc.isAn.Object(_15)){
_6=(isc.isAn.Array(_15)?_15.length:isc.getKeys(_15).length)+(_9?0:1);
_5=this.$272x(_5,_6)}
_6="z";
if(isc.SimpleType.inheritsFrom(_1.type,"boolean",_3)){
_6=_9?2:3}else if(isc.SimpleType.inheritsFrom(_1.type,"phoneNumber",_3)){
_6="a"}else if(isc.SimpleType.inheritsFrom(_1.type,"integer",_3)){
_6="b"}else if(isc.SimpleType.inheritsFrom(_1.type,"date",_3)||
isc.SimpleType.inheritsFrom(_1.type,"time",_3))
{
_6="c"}else if(isc.SimpleType.inheritsFrom(_1.type,"datetime",_3)){
_6="d"}else if(isc.SimpleType.inheritsFrom(_1.type,"text",_3)){
_6="e"}else if(isc.SimpleType.inheritsFrom(_1.type,"float",_3)){
_6="f"}
_5=this.$272x(_5,_6);
return _5}
,isc.A.sortByIndexability=function isc_c_DataSource_sortByIndexability(_1,_2){
var _3,
_4,
_1;
if(isc.isAn.Array(_1)){
_3=_1.getProperty("name");
_4=_1.makeIndex("name")}else{
_3=isc.getKeys(_1);
_4=_1;
_1=isc.getValues(_1)}
for(var i=0;i<_1.length;++i){
var _6=_1[i];
_6.$272y=this.getIndexability(_6,_4,_2)}
_1.sort(function(_9,_10){
var _7=_9.$272y,
_8=_10.$272y;
if(isc.isA.Number(_7)){
if(!isc.isA.Number(_8))return-1;
return _7-_8}else if(isc.isA.Number(_8)){
return 1}
if(_7==_8)return 0;
return _7<_8?-1:1});
return _1}
,isc.A.$2811=function isc_c_DataSource__originalGetRecordSummaryFunctionFieldNamesToInclude(_1,_2,_3){
var _4=[];
if(!_1)return _4;
for(var f=0;f<_1.length;++f){
var _6=_1[f],
_7=_6.name;
if(!isc.isA.nonemptyString(_7))continue;
if(_6===_2){
if(_2.partialSummary)break;
continue}
var _8=_6.includeInRecordSummary;
if(_8==null&&
(isc.SimpleType.inheritsFrom(_6.type,"integer")||
isc.SimpleType.inheritsFrom(_6.type,"float"))&&
!_3.$275o(_6))
{
_8=true}
if(_8&&_6.includeInRecordSummaryFields!=null){
if((isc.isA.String(_6.includeInRecordSummaryFields)&&
_6.includeInRecordSummaryFields!=_2.name)||
(isc.isAn.Array(_6.includeInRecordSummaryFields)&&
!_6.includeInRecordSummaryFields.contains(_2.name)))
{
_8=false}
}
if(_8){
_4.push(_7)}
}
return _4}
);
isc.B._maxIndex=isc.C+85;
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.mockDataRows=75;
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.updateCachesOnSetCacheData=true;
isc.A.sendParentNode=false;
isc.A.autoCacheAllData=false;
isc.A.autoConvertRelativeDates=true;
isc.A.showFieldsAsTree=false;
isc.A.autoDiscoverTree=false;
isc.A.$111m={};
isc.A.$111n={};
isc.A.$111o={};
isc.B.push(isc.A.combineCriteria=function isc_DataSource_combineCriteria(_1,_2,_3,_4,_5){
return isc.DS.combineCriteria(_1,_2,_3,_4,_5,this)}
,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")}
delete this.$85n;
this.invalidateCache();
this.cacheAllData=false;
this.clearDeferredRequests();
if(this.$839==true){
delete this.$839;
delete this.$175o;
if(this.transformServerRequest){
this.transformRequest=this.transformServerRequest;
delete this.transformServerRequest}
if(this.transformServerResponse){
this.transformResponse=this.transformServerResponse;
delete this.transformServerResponse}
}
}
}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,_2){
this.$2474();
if(this.cacheAllData||this.clientOnly){
if(this.logIsInfoEnabled("cacheAllData")){
this.logInfo("setCacheData: invalidating the cache","cacheAllData")}
this.clearDeferredRequests();
this.invalidateCache(this.updateCachesOnSetCacheData&&!_2);
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(_1){
if(this.cacheAllData||this.clientOnly){
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}
}
if(_1){
this.updateCaches({status:0,invalidateCache:true})}
}
,isc.A.setClientOnly=function isc_DataSource_setClientOnly(_1,_2){
if(_1){
this.clientOnly=true;
if(this.enforceSecurityOnClient!=false)this.enforceSecurityOnClient=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();
return true}else if(_2==false){
return false}
if(_2)this.clientOnly=false}
this.clearDeferredRequests();
this.invalidateCache();
this.performDSOperation("fetch");
if(!this.clientOnly){
this.clientOnly=true}
}else{
this.clearDeferredRequests();
this.invalidateCache();
this.clientOnly=false}
}
,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.DateUtil.getFirstDayOfWeek();
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");
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.A.embedTimezoneInRelativeDates=function isc_DataSource_embedTimezoneInRelativeDates(_1,_2){
if(!_1)return null;
if(!this.criteriaContainsDates(_1)){
return _1}
if(!this.isAdvancedCriteria(_1)&&_1.operator==null){
return _1}
var _3=isc.clone(_1);
_2=_2||new Date();
if(_3.criteria&&isc.isAn.Array(_3.criteria)){
var _4=_3.criteria;
for(var i=_4.length-1;i>=0;i--){
var _6=_4[i];
if(!_6){
if(this.logIsInfoEnabled("relativeDates")){
this.logInfo("Removing NULL subCriteria...","relativeDates")}
_3.criteria.removeAt(i)}else{
if(_6.criteria&&isc.isAn.Array(_6.criteria)){
_3.criteria[i]=this.embedTimezoneInRelativeDates(_6,_2)}else{
if(_6.value&&isc.isAn.Object(_6.value)&&
_6.value._constructor=="RelativeDate")
{
_3.criteria[i].value.browserTZ=isc.Time.getDefaultDisplayTimezone()}
}
}
}
}else{
if(_3.value&&isc.isAn.Object(_3.value)&&
_3.value._constructor=="RelativeDate")
{
_3.value.browserTZ=isc.Time.getDefaultDisplayTimezone()}
}
if(this.logIsInfoEnabled("relativeDates")){
this.logInfo("Returning from embedTimezoneInRelativeDates - result is:\n\n"+
isc.echoFull(_3)+"\n\noriginal criteria is: \n\n"+isc.echoFull(_1)
,"relativeDates"
)}
return _3}
,isc.A.sortByIndexability=function isc_DataSource_sortByIndexability(_1){
isc.DS.sortByIndexability(_1,this)}
);
isc.B._maxIndex=isc.C+15;
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.$281k=isc.DS.$281k;
isc.A.emptyExportMessage="You are attempting to export an empty dataset";
isc.A.canExport=true;
isc.A.$215y=0;
isc.A.$215z=1;
isc.A.$2150=2;
isc.A.$2151=3;
isc.A.defaultTitleFieldNames=[
"name",
"title",
"label",
"id"
];
isc.A.salientFieldsThreshold=5;
isc.A.textContentProperty="xmlTextContent";
isc.A.$dq="Defaults";
isc.A.$dr="Properties";
isc.A.$192e="dynamicProperties";
isc.A.$375="name";
isc.A.$1611={type:"required",$2399:true};
isc.A.$45t="type";
isc.A.indexCacheData=true;
isc.A.$1790="**NULL**";
isc.A.supportsClientOnlyProgressiveLoading=false;
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(isc.DS.applyMockModeToFS&&!this.clientOnly&&this.mockMode==null&&
(!isc.MockDataSource||!isc.isA.MockDataSource(this))&&
(this.sourceDataSourceID!=null||isc.DS.$230a))
{
this.mockMode=true}
if(this.serverType=="component"&&
this.xmlSerializeExplicitTypes==null&&
!isc.loadingSystemSchema)
{
this.xmlSerializeExplicitTypes=true}
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.mockMode){
this.cacheData=this.testData=this.cacheData||this.testData}
if(this.ID==null&&this["id"]!=null)this.ID=this["id"];
if(isc.DataSource.$211n){
var _1=isc.DataSource.$211n[this.ID];
if(_1!=null)this.ID=_1}
if(this.name==null)this.name=this.ID;
var _2=isc.DS.get(this.ID);
if(_2&&_2.builtinSchema){
return _2}
var _3=false;
if(isc.MockDataSource&&isc.isA.MockDataSource(_2)||
_2&&isc.DS.$92w===false)
{
this.logInfo("Replacing "+_2.getScClassName()+" "+this.ID+
" with new DataSource");
_2.destroy()}else if(_2&&(isc.MockDataSource&&isc.isA.MockDataSource(this))){
_3=true;
this.logInfo("MockDataSource created with ID:"+this.ID+
" collides with ID of existing DataSource.  The existing Datasource will be retained and the MockDataSource will not be available by ID."
)}
var _4=window[this.ID];
if(!_3&&!isc.DS.suppressIDRegistration&&
this.addGlobalId&&this.addGlobalId!=isc.$ae&&
(!_4||(!isc.isA.ClassObject(_4)&&
isc.isA.DataSource(_4)))
)
{
isc.ClassFactory.addGlobalID(this)}
if(isc.isAn.Object(this.inheritsFrom)){
var _5=this.inheritsFrom.$177g||this.inheritsFrom.ID;
if(_5)this.inheritsFrom=_5}
var _6=this.fields;
if(_6!=null){
if(isc.isAn.Array(_6)){
var _7={};
for(var i=0;i<_6.length;i++){
var _9=_6[i];
this.$231s(_6[i]);
if(_7[_9.name]!=null){
this.logWarn("field.name collision: first field: "+
this.echo(_7[_9.name])+
", discarded field: "+this.echo(_9));
continue}
_7[_9.name]=_9}
this.fields=_6=_7}else{
for(var _10 in _6){
var _9=_6[_10];
if(_9.name!=_10){
if(_9.name!=null){
}
_9.name=_10}
this.$231s(_9)}
}
for(var _10 in _6){
var _9=_6[_10];
_6[_10]=this.$229h(_9)}
}
if(this.dataSourceType==isc.DataSource.VIEW)this.initViewSources();
if(this.$238h()&&isc._moduleStart!=null&&
(isc._moduleEnd==null||isc._moduleEnd<isc._moduleStart))
{
if(this.logIsInfoEnabled()){
this.logInfo("marking as a component schema since module loading is ongoing")}
this.componentSchema=true}
if(!_3){
isc.DataSource.registerDataSource(this);
if(this.tenantId)this.createAlias(this.baseId,true)}
if(this.realtimeUpdates)this.setRealtimeUpdates(this.realtimeUpdates);
if(this.cacheData&&(this.isServerDS||this.__react)&&!this.$2167){
this.cacheData=this.recordsFromObjects(this.cacheData);
this.$2167=true}
if(this.clientOnly&&
this.addGlobalId!=false&&
this.enforceSecurityOnClient!=false)
{
this.enforceSecurityOnClient=true}
this.calculateDeclarativeSecuritySettings();
if(!_3&&isc.Page.isLoaded()&&isc.MultiWindow)
{
isc.MultiWindow.copyOutRegisteredDataSource(this)}
}
,isc.A.$231s=function isc_DataSource__setupFieldName(_1){
if(_1.includeFrom!=null){
var _2=_1.includeFrom.split(".");
if(_2==null||_2.length<2){
this.logWarn("Field has includeFrom specified as :"+_1.includeFrom
+" format not understood - clearing this property");
_1.includeFrom=null}else{
if(_1.name==null)_1.name=_2.last()}
}
if(isc.Canvas.validateFieldNames){
isc.Canvas.$231r(_1,this)}
}
,isc.A.$229h=function isc_DataSource__setupFieldDefaults(_1){
if(!_1)return;
if(_1.displayField!=null){
var _2=this.fields[_1.displayField];
if(_2&&_2.includeFrom){
if(_1.useLocalDisplayFieldValue==null){
_1.useLocalDisplayFieldValue=true}
var _3=_2.includeFrom.split(".");
if(_1.foreignDisplayField==null){
_1.foreignDisplayField=_3.last()}
}
}
if(isc.isA.String(_1.length)){
_1.length=_1.length.asDataSizeBytes()}
if(isc.isA.String(_1.validOperators)){
_1.validOperators=[_1.validOperators]}
if(_1.type){
var _4=this.getType(_1.type);
if(_4){
if(_4.fieldProperties){
if(_4.fieldProperties.editorProperties!=null&&
!isc.isA.Object(_4.fieldProperties.editorProperties))
{
_4.fieldProperties.editorProperties={}}
_1=isc.addProperties({},_4.fieldProperties,_1)}
if(!_1.format&&_4.format){
_1.format=_4.format}
if(_4.parseInput&&isc.isA.String(_1.defaultValue)&&
!isc.SimpleType.inheritsFrom(_1.type,"text"))
{
_1.defaultValue=_4.parseInput(_1.defaultValue,_1,null,null)}
}
}
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.getAuditDataSourceID=function isc_DataSource_getAuditDataSourceID(){
return this.audit?this.auditDataSourceID||"audit_"+this.getID():null}
,isc.A.getAuditUserFieldName=function isc_DataSource_getAuditUserFieldName(){
if(!this.audit)return null;
var _1=this.auditUserFieldName;
return _1!=null?_1:"audit_modifier"}
,isc.A.getAuditTimeStampFieldName=function isc_DataSource_getAuditTimeStampFieldName(){
if(!this.audit)return null;
var _1=this.auditTimeStampFieldName;
return _1!=null?_1:"audit_changeTime"}
,isc.A.getAuditRevisionFieldName=function isc_DataSource_getAuditRevisionFieldName(){
if(!this.audit)return null;
var _1=this.auditRevisionFieldName;
return _1!=null?_1:"audit_revision"}
,isc.A.getAuditChangedFieldsFieldName=function isc_DataSource_getAuditChangedFieldsFieldName(){
if(!this.audit)return null;
var _1=this.auditChangedFieldsFieldName;
return _1!=null?_1:"audit_changedFields"}
,isc.A.getAuditTypeFieldName=function isc_DataSource_getAuditTypeFieldName(){
if(!this.audit)return null;
var _1=this.auditTypeFieldName;
return _1!=null?_1:"audit_operationType"}
,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.getResultTree=function isc_DataSource_getResultTree(_1){
var _2=isc.ClassFactory.getClass(this.resultTreeClass||isc.ResultTree);
if(!isc.isA.Class(_2)){
this.logWarn("getResultTree(): Unrecognized 'resultTreeClass' property:"
+_2+", returning a standard isc.ResultTree.");
_2=isc.ResultTree}
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==true,
_5=isc.isAn.Object(_3)&&!isc.isAn.emptyList(_3);
if(!_5
&&!_4)
{
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&&_3){
if(_2.clientOnlyDataModified!=true){
if(isc.isAn.Array(_3)){
_3.forEach(function(_6){
_2.data=_6;
_2.clientOnlyDataModified=false;
_1=this.getClientOnlyResponse(_2);
if(!(_1.status<0)){
this.dataChanged(_1,_2)}
},this)}else{
_2.data=_3;
_1=this.getClientOnlyResponse(_2);
if(!(_1.status<0)){
this.dataChanged(_1,_2)}
}
return}
}
}
,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,
operationType:_1
});
if(_5)return _5}
if(_1){
var _6=this.operationBindings.findAll("operationType",_1);
if(_6){
for(var i=0;i<_6.length;i++){
if(!_6[i].operationId||
_6[i].operationId.trim()=="")
{
return _6[i]}
}
}
}
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,_4){
var _5=_2.data;
if(_3&&
_2.status==0&&
(_5==null||
(isc.isA.Array(_5)&&_5.length==0)||
isc.isAn.emptyString(_5))
)
{
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 _6=_1.data;
if(_1.data&&isc.isAn.Object(_1.data)){
if(_1.operationType=="update"){
_5=isc.addProperties({},_1.oldValues);
if(isc.isAn.Array(_6)){
_5=isc.addProperties(_5,_6[0])}else{
_5=isc.addProperties(_5,_6)}
_5=[_5]}else{
if(!isc.isAn.Array(_6))_6=[_6];
_5=[];
for(var i=0;i<_6.length;i++){
_5[i]=isc.addProperties({},_6[i])}
}
_4=false;
if(this.logIsDebugEnabled("ResultSet")){
this.logDebug("Submitted data to be integrated into the cache:"
+this.echoAll(_5),"ResultSet")}
}
}
return _4?isc.shallowClone(_5):_5}
,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")
{
_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"){
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.clientOnly?"clientOnly":
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}else{
_1.data=this.embedTimezoneInRelativeDates(_1.data)}
_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=="postJSON"){
_14.data=isc.JSON.encode(_1.data)}
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.$181i=function isc_DataSource__getCombinedImplicitCriteria(_1){
if(!_1||_1.resultSet||_1.resultTree)return this.implicitCriteria;
if(!_1.dbcImplicitCriteria)return this.implicitCriteria;
var _2=_1.resultTree,
_3=isc.DataSource.copyCriteria(_1.dbcImplicitCriteria),
_4=(!_3&&_2&&_2.getImplicitCriteria?_2.getImplicitCriteria():null),
_5=this.implicitCriteria
;
var _6=this.combineCriteria(_3,_4,null,_1.textMatchStyle);
if(_5){
_6=this.combineCriteria(_6,
isc.DataSource.copyCriteria(_5),null,_1.textMatchStyle
)}
if(_6){
_6=isc.DS.compressNestedCriteria(_6)}
return _6}
,isc.A.addImplicitCriteria=function isc_DataSource_addImplicitCriteria(_1){
if(!_1||_1.operationType!="fetch")return;
var _2=this.$181i(_1);
var _3=false;
if(_2){
_1.explicitCriteria=isc.shallowClone(_1.data);
_1.data=this.combineCriteria(_1.data,_2,null,
_1.textMatchStyle);
if(this.logIsDebugEnabled("criteriaTrace")){
this.logDebug("addImplicitCriteria() - result:\nExplicit criteria: "+isc.echoFull(_1.explicitCriteria)+
"\n\nimplicitCriteria: "+isc.echoFull(_2)+
"\n\nAll criteria: "+isc.echoFull(_1.data),"criteriaTrace")}
}
}
,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=this.combineCriteria(_1.data,
_3,"and",null,_1.textMatchStyle)}
}
}
,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.$190f=function isc_DataSource__removeExtraAdvancedCriteriaFields(_1){
var _2=_1.criteria;
if(_2){
var _3=_1.operator,
_4=_3=="or"||_3=="OR";
for(var i=0;i<_2.length;i++){
if(this.$190f(_2[i])){
if(_4){
_2.length=0}else{
_2.removeAt(i--)}
}
}
return _2.length==0}else{
var _6=_1.fieldName;
return!this.getField(_6)}
}
,isc.A.applySendExtraFields=function isc_DataSource_applySendExtraFields(_1){
if(this.sendExtraFields)return;
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;
if(this.isAdvancedCriteria(_4)){
this.$190f(_4)}else{
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}
if(!this.passesSecurityChecks(_1)){
_5.status=isc.RPCResponse.STATUS_AUTHORIZATION_FAILURE;
_5.data=_1.securityFailureMessage;
_3.call(this,_5);
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{
if(!rpcResponse.data||rpcResponse.data.length==0){
this.logInfo("DataSource specifies jsonPrefix, but empty response returned from server. Processing response anyway.")}else{
rpcResponse.status=isc.DSResponse.INVALID_RESPONSE_FORMAT;
rpcResponse.data="The server failed to return a formatted response at all.";
this.logWarn("DataSource specifies jsonPrefix, but not present in response returned from server. Processing response anyway.");
this.$377(rpcResponse,jsonObjects,rpcRequest);
return}
}
}
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{
if(!rpcResponse.data||rpcResponse.data.length==0){
this.logInfo("DataSource specifies jsonSuffix, but empty response returned from server. Processing response anyway.")}else{
rpcResponse.status=isc.DSResponse.INVALID_RESPONSE_FORMAT;
rpcResponse.data="The server failed to return a formatted response at all.";
this.logWarn("DataSource specifies jsonSuffix, but not present in response returned from server. Processing response anyway.");
this.$377(rpcResponse,jsonObjects,rpcRequest);
return}
}
}
}
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=isc.DSResponse.INVALID_RESPONSE_FORMAT;
rpcResponse.data="Error: server returned invalid JSON response";
this.logWarn("Error evaluating JSON: "+e.toString()+", JSON text:\n"+
jsonText);
wasInvalid=true}
if(jsonObjects==null&&!wasInvalid){
rpcResponse.status=isc.DSResponse.INVALID_RESPONSE_FORMAT;
rpcResponse.data="Error: server returned invalid JSON response";
this.logWarn("Evaluating JSON reply resulted in empty value. JSON text:\n"+
this.echo(jsonText));
jsonObjects=jsonText}
rpcResponse.$38c=true}
}
this.$377(rpcResponse,jsonObjects,rpcRequest)}
,isc.A.$185y=function isc_DataSource__setCanSkipJSONValidation(_1){
var _2=isc.SimpleType.inheritsFrom(_1.type,"text")||
isc.SimpleType.inheritsFrom(_1.type,"float")||
isc.SimpleType.inheritsFrom(_1.type,"integer")||
isc.SimpleType.inheritsFrom(_1.type,"boolean");
return(_1.$185z=_2)}
);
isc.evalBoundary;isc.B.push(isc.A.recordsFromObjects=function isc_DataSource_recordsFromObjects(_1,_2){
if(!isc.isAn.Array(_1))_1=[_1];
if(this.skipJSONValidation==true||this.skipJSONValidation=="full")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.skipJSONValidation=="partial",
_5=this.getFieldNames(),
_6={};
for(var i=0;i<_5.length;i++){
var _8=_5[i],
_9=_3.getField(_8),
_10;
if(_9.valueXPath&&!_2&&_9.valueXPath!=_8){
_10=isc.xml.selectObjects(_1,_9.valueXPath,true)}else{
_10=_1[_8]}
if(_9.getFieldValue){
if(!isc.isA.Function(_9.getFieldValue)){
isc.Func.replaceWithMethod(_9,"getFieldValue",
"record,value,field,fieldName")}
_10=_9.getFieldValue(_1,_10,_9,_8)}
var _11;
if(_10!==_11){
if(_4){
var _12=_9.$185z;
if(_12==null){
_12=this.$185y(_9)}
if(_12){
_6[_8]=_10;
continue}
}
var _13=isc.DS.get(_9.type);
if(_13&&!(_13.skipJSONValidation==true||
_13.skipJSONValidation=="full"))
{
if(isc.isAn.Array(_10)){
for(var j=0;j<_10.length;j++){
_10[j]=_13.validateJSONRecord(_10[j])}
}else{
_10=_13.validateJSONRecord(_10)}
}
if(_9.multiple&&isc.isAn.Array(_10)){
var _15=[];
for(var j=0;j<_10.length;j++){
_15.push(this.validateFieldValue(_9,_10[j],_1))}
_6[_8]=_15}else{
_6[_8]=this.validateFieldValue(_9,_10,_1)}
}
}
if(_3.dropExtraFields)return _6;
for(var i=0;i<_5.length;i++){
var _8=_5[i];
_1[_8]=_6[_8]
}
return _1}
,isc.A.$259i=function isc_DataSource__validatePaletteNodeDefaults(_1,_2,_3,_4){
var _5={};
for(var _6 in _1){
if(_6.startsWith(isc.$ag)||_6.startsWith(isc.$75g)||
_6=="parentProperty")
{
continue}
var _7=_1[_6];
if(isc.isA.Function(_7))continue;
var _8=this.getField(_6);
if(!_8){
_5[_6]="property not valid for "+_2+"'s schema.";
continue}
if(_8.type=="Object")continue;
if(_8.type=="Criteria"||
_8.type=="Criterion"||
_8.type=="AdvancedCriteria")
{
continue}
if(_8.type=="ValueMap")continue;
var _9=isc.DS.get(_8.type);
if(_9){
if(isc.isAn.Array(_7)){
for(var j=0;j<_7.length;j++){
_7[j]=_9.$259i(_7[j],
_8.type,_3+"/"+_6+"["+j+"]",_4)}
}else{
_7=_9.$259i(_7,
_8.type,_3+"/"+_6,_4)}
continue}
if(_8.multiple&&isc.isAn.Array(_7)){
var _11=[];
for(var j=0;j<_7.length;j++){
_11.push(this.validateFieldValue(_8,_7[j],null,_5))}
_1[_6]=_11}else{
_1[_6]=this.validateFieldValue(_8,_7,null,_5)}
}
if(!isc.isAn.emptyObject(_5)){
_4.errorList.add({nodePath:_3,errors:_5})}
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),"\n");
_3.append(this.getSoapBody(_1,_2));
_3.append("\n",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+="\n     "+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("\n"+_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),
"\n    ",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.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,
_12,_13=null;
if(_2.xmlExplicitType||this.xmlSerializeExplicitTypes||_2.xmlExplicitSimpleType){
_10=true;
_11=isc.Comm.omitXSI;
isc.Comm.omitXSI=false;
if(_2.xmlExplicitSimpleType){
_12=true;
_13=isc.Comm.omitStringXSI;
isc.Comm.omitStringXSI=true}
}else{
if(isc.Comm.omitXSI==null){
_10=isc.Comm.omitXSI=true}
}
var _14;
try{
_14=this.$ew(_1,_2,_3,_4,_7)}finally{
if(_6)_2.qualifyAll=null;
isc.Comm.xmlSchemaMode=_9;
if(_10){
isc.Comm.omitXSI=_11}else if(_12){
isc.Comm.omitStringXSI=_13}
}
return _14}
,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;
if(!_2.ignoreConstructor){
var _7;
if(_1!=null&&(_1._constructor||isc.isAn.Instance(_1))){
var _7=isc.isAn.Instance(_1)?_1.Class:
isc.DS.getNearestSchema(_1._constructor);
if(isc.isAn.Object(_7)){
_7=_7.type
}
if(!_7&&_1._constructor)_7=_1._constructor}
}
if(isc.DS.isSimpleTypeValue(_1)){
if(isc.isA.String(_1)&&(isc.startsWith(_1,"ref:")||isc.startsWith(_1,"withID:"))){
var _8=""
if(_3&&_3.length>0){
_8="\n"+_3}
return _8+"<"+_4+" withID=\""+_1.substring(_1.indexOf(":")+1)+"\"/>"}
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 _9=isc.SB.create(),
_3=_3||"";
_9.append("\n",_3);
var _10;
if(_6){
_10=(this.isA("XSComplexType")?_2.parentSchemaNamespace:null)
||this.schemaNamespace}
var _11;
if(_2.xmlExplicitType||_2.xmlExplicitSimpleType||this.xmlSerializeExplicitTypes){
_11=null}else{
_11=this.ID}
if(isc.DS.xmlSerializedObjectTypes&&!this.Constructor&&_4[0].match(/[A-Z]/))
{
if(!isc.DS.xmlSerializedObjectTypes.contains(_4)){
isc.DS.xmlSerializedObjectTypes.push(_4)}
}
_9.append(
isc.Comm.$36u(_4,_11,_10,
_2.nsPrefixes,true,_5)
);
if(!this.xmlSerializeExplicitTypes||!_2.xmlExplicitSimpleType){
var _12=this.$256f(_2,_11,_1)?
isc.addProperties({},_2,{simpleTypesAsAttributes:false}):
_2;
_1=this.serializeAttributes(_1,_9,_12)}
if(_7&&_4!=_7){
if(isc[_7]!=null){
_9.append(" constructor=\"",_7,"\"")}else{
_9.append(" _constructor=\"",_7,"\"")}
}else if(_4&&this.xmlSerializeExplicitTypes){
_9.append(" constructor=\"",_4,"\"")}
var _13;
if(_1!=null){
_13=this.xmlSerializeFields(_1,_2,_3+(!_2||_2.indent!=false?"    ":""))}
if(_5){
_9.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)){
_9.append("/>");
return _9.release(false)}
_9.append(">",_13,
_14?"":(_13.endsWith("\n")?"":"\n")+_3);
_9.append(isc.Comm.$36v(_4,_10,_2.nsPrefixes));
return _9.release(false)}
,isc.A.$256f=function isc_DataSource__clearSimpleTypesAsAttribFlag(_1,_2,_3){
if(!_1.simpleTypesAsAttributes||_2!="ValueMap")return;
for(var _4 in _3){
if(!_4.match(/^[A-Z][A-Z_0-9]*$/i))return true}
}
,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;
if(_1&&!isc.isAn.Array(_1)&&_3.simpleTypesAsAttributes&&!_3.flatData&&!isc.isA.Schema(this)){
for(var _6 in _1){
if(!_6.startsWith("_")&&!_4.contains(_6)){
_4.add(_6)}
}
}
for(var i=0;i<_4.length;i++){
var _6=_4[i],
_8=this.getField(_6)||{},
_9=_1&&_1[_6],
_10=((!isc.isAn.Object(_9)&&!isc.isAn.Array(_9))||
(isc.isAn.Instance(_9)&&isc.isA.Function(_9.$253w))),
_11=(_3.simpleTypesAsAttributes&&_10)||
_8.xmlAttribute||
(_8.xmlAttributeInRuleCriteria&&
_3.isRuleCriteria&&_10);
if(_11&&((_1&&_1[_6]!=null)||_8.xmlRequired)){
if(_8.skipSerialization){
delete _1[_6];
continue}
if(_5){
_1=isc.addProperties({},_1);
_5=false}
if(_3&&_3.spoofData)_9=this.getSpoofedData(_8);
if(isc.isAn.Instance(_9)){
if(_9.ID){
_9=_9.ID}else{
this.logWarn("Serializing attribute "+_6+
" failed to replace object instance with ID")}
}
if(_8.multiple&&isc.isAn.Array(_9)&&
isc.SimpleType.inheritsFrom(_8.type,"string"))
{
_9=_9.join()}
if(_9&&isc.isA.Function(_9.$253w)){
_2.append(" ",_9.$253w(_6))}else{
_2.append(" ",_6,"=\"",
this.$38f(_8,_9),
"\"")}
delete _1[_6]
}
}
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)
;
if(_11.skipSerialization){
if(!_5&&_1[_10]!=null)delete _1[_10];
continue}
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){
var _19=_2;
if(_5&&_13&&
_1[_10]!=null&&!isc.DS.isSimpleTypeValue(_1[_10])&&
!_19.recursiveFlatFields)
{
_19=isc.addProperties({},_19);
_19.flatData=false}
if(!_19.ignoreExplicitTypes){
var _20=this.$151z(_11.xmlExplicitTypes),
_21=(_20?_20:_8),
_22=this.$151z(_11.xmlExplicitSimpleTypes),
_23=(_22?_22:null)
;
_19=isc.addProperties({},_19,{
xmlExplicitType:_21,
xmlExplicitSimpleType:_23
})}
_4.append(this.xmlSerializeField(_10,_14,_19,_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(!_3.ignoreConstructor){
var _10;
if(_2!=null&&(_2._constructor||isc.isAn.Instance(_2))){
var _10=isc.isAn.Instance(_2)?_2.Class:
isc.DS.getNearestSchema(_2._constructor);
if(isc.isAn.Object(_10)){
_10=_10.type
}
if(!_10&&_2._constructor)_10=_2._constructor}
}
if(!_7&&_3.useConstructorType&&_2&&_2._constructor){
_7=_2._constructor;
var _11=isc.DataSource.getNearestSchemaClass(_7),
_12;
if(_11&&_11.isA("Canvas")){
_6=_12={name:_1,type:_7}}
}
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 _13=((_6&&_6.mustQualify)||_3.qualifyAll?
this.getSchemaSet().schemaNamespace:null);
var _14=_3.textContentProperty||this.textContentProperty,
_15=this.getTextContentField();
if(_1==_14&&
(_15!=null||!this.hasXMLElementFields(_14)))
{
this.$45z=true;
return this.$38f(_15,_2)}
if(_7==this.$41v&&_2!=null){
if(_2.iscAction){
_2=_2.iscAction
}else if(isc.isA.StringMethod(_2)){
_2=_2.value}
}
var _16=!_3.xmlExplicitType||this.shouldWriteSchemaType(_6)?
this.$38h(_6?_6.type:null,_2):null;
var _17,_18=null,
_19,_20=null;
if((this.xmlExplicitTypes||_3.xmlExplicitType)||
_3.xmlExplicitSimpleType||
(this.xmlSerializeExplicitTypes&&!isc.SimpleType.inheritsFrom(_7,"text")))
{
_17=true;
_18=isc.Comm.omitXSI;
isc.Comm.omitXSI=false;
if(_3.xmlExplicitSimpleType&&this.fieldIsComplexType(_1)){
_16=null}
if(_3.xmlExplicitSimpleType){
_19=true;
_20=isc.Comm.omitStringXSI;
isc.Comm.omitStringXSI=true}
}
var _21=(_6&&_6.tagName)||_1,
_22=isc.Comm.$36u(_21,_16,
_13,_3.nsPrefixes),
_23=isc.Comm.$36v(_21,_13,_3.nsPrefixes);
var _24=isc.isAn.Array(_2)?_2:[_2];
if(!_6&&_3.schema&&_3.schema.getField){
_6=_3.schema.getField(_1)}
if(this.fieldIsComplexType(_1,_12)||
(_6&&_3.ignoreExplicitTypes&&
(this.$151z(_6.xmlExplicitTypes)||
this.$151z(_6.xmlExplicitSimpleTypes))&&
isc.isAn.Object(_2)&&!isc.isAn.Array(_2)))
{
var _25=_3.parentSchemaNamespace;
_3.parentSchemaNamespace=this.schemaNamespace;
var _26=(_10?this.getSchema(_10):this.getFieldDataSource(_6,_6&&_6.xsElementRef?"element":null));
if(_6.multiple){
_5.append("\n",_4,_22);
for(var i=0;i<_24.length;i++){
var _28=_26;
if(_24[i]!=null&&_24[i]._constructor){
_28=isc.DS.get(_24[i]._constructor)||_26}
_5.append(_28.xmlSerialize(_24[i],_3,_4+(!_3||_3.indent!=false?"    ":""),
_24[i]==null
?_6.childTagName
:_24[i].$97p||_6.childTagName))}
_5.append("\n",_4,_23)}else if(_26.canBeArrayValued&&isc.isAn.Array(_2)){
_5.append(_26.xmlSerialize(_2,_3,_4,_1))}else if(_24.length==1&&isc.isA.String(_24[0])&&
(isc.startsWith(_24[0],"ref:")||isc.startsWith(_24[0],"withID:")))
{
_22=isc.Comm.$36u(_1,_16,_13,_3.nsPrefixes,true);
_5.append("\n",_4);
_5.append(_22);
_5.append(" withID=\"",_2.substring(_2.indexOf(":")+1),"\"/>")}else{
for(var i=0;i<_24.length;i++){
var _2=_24[i];
if(_2==null){
_5.append("\n",_4);
_5.append(_22,_23)}else if(isc.DS.isSimpleTypeValue(_2)){
if(isc.isA.String(_2)&&
(isc.startsWith(_2,"ref:")||isc.startsWith(_2,"withID:")))
{
_5.append("\n",_4);
_5.append(_22);
var _29=(_6?_6.childTagName||_6.type:"value");
_5.append("<",_29," withID=\"",_2.substring(_2.indexOf(":")+1),"\"/>");
_5.append(_23)}else{
if(!(_6.idAllowed&&isc.isA.String(_2))){
this.logWarn("simple type value "+this.echoLeaf(_2)+
" passed to complex field '"+_6.name+"'",
"xmlSerialize")}
_5.append("\n",_4);
_5.append(isc.Comm.$ew(_1,_2,_4))}
}else{
if(_6.isRuleCriteria)_3.isRuleCriteria=true;
if(_6.fieldsCanBeFormula)_3.fieldsCanBeFormula=true;
_5.append(_26.xmlSerialize(_2,_3,_4,_1));
delete _3.isRuleCriteria}
}
}
_3.parentSchemaNamespace=_25}else if(_6!=null){
if(_6.xsElementRef){
var _30=this.getType(_6.type);
if(_30&&_30.schemaNamespace)
{
_13=_30.schemaNamespace}
}
var _31=_6.multiple,
_32=_6.commaSeparated
;
if(_31&&_6.commaSeparated&&
isc.SimpleType.inheritsFrom(_7,"string"))
{
_31=false;
_24=[_24.join()]}
if(_31){
_5.append("\n",_4,_22,"\n");
for(var i=0;i<_24.length;i++){
var _33=(_4||"")+
(!_3||_3.indent!=false?"    ":"");
_5.append(_33,
this.$38g(_6.childTagName,_6,
_24[i],_13,_3,_33),
"\n")}
_5.append(_4,_23,"\n")}else{
for(var i=0;i<_24.length;i++){
_5.append(
"\n",_4,
this.$38g(_1,_6,
_24[i],_13,_3,_4))}
}
}else{
for(var i=0;i<_24.length;i++){
if(_24[i]==null||isc.isAn.emptyObject(_24[i])){
_5.append("\n",_4,_22,_23)}else{
var _34={isRoot:false};
if(_3.fieldsCanBeFormula)_34.fieldCanBeFormula=true;
if(_3.xmlExplicitSimpleType)_34.xmlExplicitSimpleType=true;
_5.append("\n",_4,
isc.Comm.$ew(_1,_24[i],_4,_34))}
}
}
if(_17){
isc.Comm.omitXSI=_18}
if(_19){
isc.Comm.omitStringXSI=_20}
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((this.xmlSerializeExplicitTypes&&!isc.SimpleType.inheritsFrom(_1.type,"text"))||
_1.type==null||
_1.type=="any")}
}
,isc.A.$38g=function isc_DataSource__serializeSimpleTypeTag(_1,_2,_3,_4,_5,_6){
var _7=_2.type,
_5=_5||{};
if(isc.isAn.Object(_3)&&!isc.isA.Function(_3.$ew)){
return isc.Comm.$ew(_1||null,_3,_6)}else{
var _7=!_5.xmlExplicitType||this.shouldWriteSchemaType(_2)?
this.$38h(_7,_3):null;
if((this.xmlSerializeExplicitTypes||_5.xmlExplicitSimpleType)&&
!this.shouldWriteSchemaType(_2))
{
_7=null}
if(_3==null&&(_2.nillable||_2.foreignKey)){
var _8=_1||"value";
return isc.Comm.$36u(_8,null,_4,_5.nsPrefixes,true)
+" xsi:nil=\"true\"/>"}
if(isc.isA.Date(_3)){
var _9=this.trimMilliseconds;
if(_5&&_5.schema){
_9=_5.schema.trimMilliseconds}
_3=_3.toSchemaDate(_2.type,!!_9)}else if(_3!=null&&_3.$ew){
return _3.$ew(_1,_7,_4)}else{
_3=isc.Comm.$247o(_3,_6)}
return isc.Comm.$ex(_1||"value",_3,_7,_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.makeXMLSafeAttribute(_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.evalBoundary;isc.B.push(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){
_3.status=isc.DSResponse.INVALID_RESPONSE_FORMAT;
var _9="The server failed to return a formatted response at all.";
var _10=_2;
this.$38b(_10,{status:_3.status,data:_9},
_6,
_3,_4);
return}
if(_5){
if(_7.wsOperation){
var _11=this.getWebService(_6),
_8=_11.getOutputNamespaces(_7.wsOperation);
_5.addNamespaces(_8)}
_5.addNamespaces(this.xmlNamespaces);
_5.addNamespaces(_7.xmlNamespaces)}
var _12=isc.addProperties({},_8,
this.xmlNamespaces,
_7.xmlNamespaces);
this.dsResponseFromXML(_5,_6,_12,
{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;
if(!_2.operationType){
var _6=_3.operation;
_2.operationId=_3.operationId||_6&&_6.ID;
_2.operationType=_3.operationType||_6&&_6.type}
var _7=this.transformResponse(_2,_3,_1);
_2=_7||_2;
_2.startRow=this.$52v(_2.startRow,0);
var _8=_2.endRow;
if(_8==null){
if(_2.status<0)_8=0;
else if(isc.isAn.Array(_2.data))_8=_2.data.length;
else _8=1}
_2.endRow=this.$52v(_8);
_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}
}
if(this.autoDiscoverTree){
var _9=this.discoverTreeSettings||{};
if(this.titleField!=null){
_9.nameProperty=this.titleField}
var _10;
if(this.childrenField)_10=this.childrenField;
var _11=this.getFields();
for(var _12 in _11){
var _13=_11[_12];
if(_13.childrenProperty)_10=_12}
if(_10!=null){
_9.newChildrenProperty=_10}
isc.Tree.discoverTree(_2.data,_9,null)}
this.fireResponseCallbacks(_2,_3,_4,_5);
if(_2.relatedUpdates!=null){
for(var i=0;i<_2.relatedUpdates.length;i++){
if(_2.relatedUpdates[i].status<0){
this.logWarn("DSResponse contained relatedUpdate with failed status="
+_2.relatedUpdates[i].status+", ignoring related update.");
continue}
if(_2.relatedUpdates[i].operationType==null){
_2.relatedUpdates[i].operationType=_2.operationType}
if(_2.relatedUpdates[i].operationType=="fetch"){
this.logWarn("DSResponse contained relatedUpdate has \"fetch\" operationType, so will do nothing.")}
var _15=isc.DS.get(_2.relatedUpdates[i].dataSource);
if(_15==null){
this.logWarn("DSResponse contained relatedUpdate referencing dataSource ID:"
+_2.relatedUpdates[i].dataSource+
". This dataSource appears not to be present - ignoring related update.")}else{
var _16=isc.addProperties({},_2.relatedUpdates[i]);
_16.clientContext=_2.clientContext
_15.updateCaches(_16,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);
return}
var _5=[_2.$376,
_2.afterFlowCallback]
;
for(var i=0;i<_5.length;i++){
var _7=_5[i],
_8=this.fireCallback(_7,isc.DS.$281k,
[_1,_1.data,_2])
;
if(_4&&_4.willHandleError&&_8===false){
this.logDebug("performOperationReply: Further processing cancelled by callback");
break}
if(_3){
var _9=isc.RPCManager.getTransaction(_3.transactionNum);
if(_9&&_9.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,_3,_4){
if(!isc.Validator)return _2;
var _5=_1.validators;
if(!_5)return _2;
if(!isc.isAn.Array(_5)){
this.$2j[0]=_5;
_5=this.$2j}
var _6=_2;
for(var i=0;i<_5.length;i++){
var _8=_5[i];
if(_8.applyWhen&&_3){
var _9=this.applyFilter([_3],_8.applyWhen);
if(_9.length==0){
isc.Validator.performAction(null,_1,_8,_3,this);
continue}
}
var _10=isc.Validator.processValidator(_1,_8,_2,null,null,
{dataSource:this.ID});
if(!_10){
if(_4){
_4[_1.name]="value: "+this.echoLeaf(_2)+
" failed for validator \""+_8.type+"\": "+
_8.defaultErrorMessage}else{
this.logWarn(this.ID+"."+_1.name+": value: "+
this.echoLeaf(_2)+" failed on validator: "+
this.echo(_8))}
return _2}
var _11;
if(_8.resultingValue!==_11){
_2=_8.resultingValue;
_8.resultingValue=_11}
if(!_10&&_8.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.fetchDataSynchronous=function isc_DataSource_fetchDataSynchronous(_1,_2,_3){
var _4=this.canFetchSynchronous();
if(!_4&&(!_3||_3.warnOnAsync!==false)){
this.logWarn("fetchDataSynchronous() invoked on a DS that cannot currently fetch synchronous - your callback (if any) will be asynchornous and an empty DSResponse will be returned to caller")}
var _5=isc.addProperties({},_3,{
synchronousCallback:true
});
var _6={};
var _7=this;
this.fetchData(_1,function(_8,_9,_10){
isc.addProperties(_6,{
dsResponse:_8,
data:_9,
dsRequest:_10
});
if(_2){
_7.fireCallback(_2,_7.$281k,[_8,_9,_10])}
},_5);
if(_4){
return _6.dsResponse}else{
return{
data:[],
status:0
}
}
}
,isc.A.filterData=function isc_DataSource_filterData(_1,_2,_3){
if(!_3)_3={};
_3=isc.DataSource.dupRequest(_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)_2={}
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<this.operationBindings.length;i++){
if(this.operationBindings[i].operationId==_2.operationId&&
this.operationBindings[i].operationType=="clientExport")
{
_4=this.operationBindings[i]}
}
if(_4===_5){
this.logWarn("exportClientData() was passed operationId '"+
_2.operationId+
"', but this DataSource has no operationBinding of type 'clientExport' with that name.  Delegating to the static exportClientData() method");
delete _2.operationId}
}
return isc.DataSource.exportClientData(_1,_2,_3,this)}
,isc.A.exportData=function isc_DataSource_exportData(_1,_2,_3,_4){
var _5="fetch";
if(this.clientOnly){
this.logWarn("Translating exportData() call to exportClientData()");
return this.exportClientData(this.getCacheData(),_2,_3)}
if(!_2)_2={};
_2=isc.DataSource.dupRequest(_2);
if(this.canExport==false){
isc.logWarn("Exporting is disabled for this DataSource.  Set DataSource.canExport to true to enable it.");
return}
if(_2.exportAs&&_2.exportAs.toLowerCase()=="json"&&
_2.exportToClient!==false)
{
isc.logWarn("Export in JSON format with download to client is not allowed from a client call - either specify exportToClient: false, or set operationBinding.exportAs on your DataSource instead.  The server will reject this attempt.")}
if(_2.textMatchStyle==null)_2.textMatchStyle="substring";
var _6=_2.exportAs||"csv";
var _7=_2;
_7.exportResults=true;
_7.exportAs=_6;
_7.exportDelimiter=_2.exportDelimiter||",";
_7.exportTitleSeparatorChar=_2.exportTitleSeparatorChar||"";
if(_2.operationId!=null){
var _8=this.getOperationBinding(_5,_2.operationId);
if(_8!=null&&_8.exportAs){
_6=_8.exportAs}
}
_7.exportFilename=isc.DataSource.addExportFilenameExtension(_2.exportFilename||"Results",
_6);
_2.exportFilename=_7.exportFilename;
_7.exportPath=_2.exportPath;
_7.exportDisplay=_2.exportDisplay||"download";
_7.lineBreakStyle=_2.lineBreakStyle||"default";
_7.exportFields=this.getExportableDSFields(
_2.exportFields||this.getVisibleDSFields(),_4
);
_7.exportHeader=_2.exportHeader;
_7.exportHeaderless=_2.exportHeaderless;
_7.exportFooter=_2.exportFooter;
_7.exportFieldTitles=_2.exportFieldTitles;
_7.exportDatesAsFormattedString=
_2.exportDatesAsFormattedString;
_7.exportNumbersAsFormattedString=
_2.exportNumbersAsFormattedString;
_7.exportRawValues=_2.exportRawValues;
_7.exportCurrencySymbol=isc.NumberUtil.currencySymbol;
if(_2.exportValueFields!=null){
_7.exportValueFields=_2.exportValueFields}
if(!_7.exportFieldTitles){
var _9=_7.exportFields;
var _10={};
for(var i=0;i<_9.length;i++){
var _12=_9[i];
var _13;
if(isc.isA.String(_12)){
_13=_12;
_12=this.getField(_13)}
if(_12){
if(_12.hidden)continue;
_10[_12.name]=_12.exportTitle||_12.title}else{
_10[_13]=_13}
}
_7.exportFieldTitles=_10}
_7.exportHeaderSpans=_2.exportHeaderSpans;
_7.exportOtherFields=_2.exportOtherFields;
if(_2.exportHeaderHeight!=null){
_7.exportHeaderHeight=_2.exportHeaderHeight}
if(_2.exportFieldPixelWidths!=null){
_7.exportFieldPixelWidths=_2.exportFieldPixelWidths;
_7.exportWidthScale=_2.exportWidthScale}
_7.exportWrapHeaderTitles=_2.exportWrapHeaderTitles;
if(_2.exportWrapCells!=null){
_7.exportWrapCells=_2.exportWrapCells}
if(_2.exportColumnWidthPadding!=null){
_7.exportColumnWidthPadding=
_2.exportColumnWidthPadding}
if(_2.exportStreaming!=null){
_7.exportStreaming=_2.exportStreaming}
if(_2.exportAlignments!=null){
_7.exportAlignments=_2.exportAlignments}
if(_2.exportPropertyIdentifier!=null){
_7.exportPropertyIdentifier=_2.exportPropertyIdentifier}
if(_2.exportTZ!=null){
if(this.getDataFormat()=="iscServer"&&
(_2.exportAs=="ooxml"||_2.exportAs=="xls")){
if(_2.exportTZ=="client"){
_2.exportTZ=isc.Time.getDefaultDisplayTimezone()}
_7.exportTZ=_2.exportTZ}else{
_2.exportTZ=null}
}
_2.downloadResult=(_2.exportToClient!==false);
_2.downloadToNewWindow=_2.exportDisplay=="window"
?true:false;
if(this.implicitCriteria){
_1=this.combineCriteria(
isc.DataSource.copyCriteria(this.implicitCriteria),
_1,null,_2.textMatchStyle
)}
if(_2.downloadToNewWindow){
if(_7.exportFilename.endsWith(".xml")&&_7.exportAs!="xml"){
_7.exportFilename=_7.exportFilename+".txt"}
_2.download_filename=_2.exportFilename;
_1=_1||{};
_1.download_filename=_2.download_filename}
_2.showPrompt=false;
_2.parameters=_7;
this.performDSOperation(_5,_1,_3,_2)}
,isc.A.getVisibleDSFields=function isc_DataSource_getVisibleDSFields(){
var _1=[];
var _2=this.fields;
if(!isc.isAn.Array(_2)){
_2=[];
for(var _3 in this.fields){
_2.add(this.fields[_3])}
}
for(var i=0;i<_2.length;i++){
var _5=_2.get(i);
if(!_5.hidden)_1.add(_5.name)}
return _1}
,isc.A.getExportableDSFields=function isc_DataSource_getExportableDSFields(_1,_2){
var _3=[];
if(this.canExport){
for(var i=0;i<_1.length;i++){
var _5=this.getField(_1[i]);
if(!_5&&_2&&_2.getField){
_5=_2.getField(_1[i]);
if(_5&&_5.includeFrom&&_5.canExport!=false){
_3.add(_1[i])}
continue}
if(_5&&_5.canExport!=false)
_3.add(_5.name)}
}
return _3}
,isc.A.getClientOnlyDataSource=function isc_DataSource_getClientOnlyDataSource(_1,_2,_3,_4){
var _5=_1,
_6=_2,
_7=this;
if(this.cacheAllData&&this.hasAllData()){
var _8=isc.DataSource.create({
inheritsFrom:_7,
clientOnly:true,
useParentFieldOrder:true,
testData:this.cacheResultSet.getAllRows()
},_4)
;
_7.fireCallback(_6,"dataSource",[_8]);
return _8}else{
this.fetchData(_5,
function(_9,_10){
var _8=isc.DataSource.create({
inheritsFrom:_7,
clientOnly:true,
useParentFieldOrder:true,
testData:_10
},_4)
;
_7.fireCallback(_6,"dataSource",[_8])},
isc.addProperties({},_3)
)}
}
,isc.A.addData=function isc_DataSource_addData(_1,_2,_3){
if(isc.Offline&&isc.Offline.isOffline()&&this.contactsServer()){
isc.logWarn("Data cannot be saved because you are not online");
return}
this.performDSOperation("add",_1,_2,_3)}
,isc.A.updateData=function isc_DataSource_updateData(_1,_2,_3){
if(isc.Offline&&isc.Offline.isOffline()&&this.contactsServer()){
isc.logWarn("Data cannot be saved because you are not online");
return}
this.performDSOperation("update",_1,_2,_3)}
,isc.A.removeData=function isc_DataSource_removeData(_1,_2,_3){
if(isc.Offline&&isc.Offline.isOffline()&&this.contactsServer()){
isc.logWarn("Data cannot be saved because you are not online");
return}
var _4=this.getPrimaryKeyFieldNames(),
_1=isc.applyMask(_1,_4);
this.performDSOperation("remove",_1,_2,_3)}
,isc.A.contactsServer=function isc_DataSource_contactsServer(){
return!this.clientOnly&&this.dataProtocol!="clientCustom"
}
,isc.A.validateData=function isc_DataSource_validateData(_1,_2,_3){
if(!_3)_3={};
_3=isc.DataSource.dupRequest(_3);
_3=isc.addProperties(_3,{willHandleError:true});
if(_3.validationMode==null)_3.validationMode="full";
return!!this.performDSOperation("validate",_1,_2,_3)}
,isc.A.performCustomOperation=function isc_DataSource_performCustomOperation(_1,_2,_3,_4){
if(!_4)_4={};
_4=isc.DataSource.dupRequest(_4);
isc.addProperties(_4,{operationId:_1});
this.performDSOperation("custom",_2,_3,_4)}
,isc.A.performClientExportOperation=function isc_DataSource_performClientExportOperation(_1,_2,_3,_4){
if(!_4)_4={};
_4=isc.DataSource.dupRequest(_4);
isc.addProperties(_4,{operationId:_1});
this.performDSOperation("clientExport",_2,_3,_4)}
,isc.A.getFile=function isc_DataSource_getFile(_1,_2,_3){
if(isc.isA.String(_1))_1=isc.DataSource.makeFileSpec(_1);
this.performDSOperation(
"getFile",_1,function(_4,_5,_6){
if(this.streamLogging){
isc.EventStream.addDSFileEvent(this,_4,isc.EventStream.FILE_LOAD)}
if(_4.status>=0&&isc.isAn.Array(_5)&&_5.length>0){
_5=_5[0].fileContents}else{
_5=null}
this.fireCallback(_2,isc.DS.$281k,[_4,_5,_6])},
isc.addProperties({
willHandleError:true
},_3)
)}
,isc.A.hasFile=function isc_DataSource_hasFile(_1,_2,_3){
if(isc.isA.String(_1))_1=isc.DataSource.makeFileSpec(_1);
this.performDSOperation("hasFile",_1,function(_4,_5,_6){
if(_4.status>=0){
_5=!!(isc.isAn.Array(_5)&&_5.length>0)}else{
_5=false}
this.fireCallback(_2,isc.DS.$281k,[_4,_5,_6])},
isc.addProperties({
willHandleError:true
},_3))}
,isc.A.uniqueName=function isc_DataSource_uniqueName(_1,_2,_3){
if(isc.isA.String(_1)){
this.logWarn("Invalid fileSpec for uniqueName operation");
return}
this.performDSOperation("uniqueName",_1,function(_4,_5,_6){
if(_4.status>=0){
_5=(isc.isAn.Array(_5)&&_5.length>0?_5=_5[0]:_5)}else{
_5=null}
this.fireCallback(_2,isc.DS.$281k,[_4,_5,_6])},isc.addProperties({
willHandleError:true
},_3))}
,isc.A.listFiles=function isc_DataSource_listFiles(_1,_2,_3){
if(!_1)_1={};
this.performDSOperation(
"listFiles",_1,function(_4,_5,_6){
if(_4.status<0)_5=null;
this.fireCallback(_2,isc.DS.$281k,[_4,_5,_6])},
isc.addProperties({
willHandleError:true
},_3)
)}
,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(this.streamLogging){
isc.EventStream.addDSFileEvent(this,_6,isc.EventStream.FILE_SAVE)}
if(_6.status<0)_7=null;
if(isc.isAn.Array(_7))_7=_7[0];
this.fireCallback(_3,isc.DS.$281k,[_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,isc.DS.$281k,[_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,isc.DS.$281k,[_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,isc.DS.$281k,[_3,_4,_5])},{
willHandleError:true
})}
,isc.A.getFileVersion=function isc_DataSource_getFileVersion(_1,_2,_3,_4){
if(isc.isA.String(_1))_1=isc.DataSource.makeFileSpec(_1);
_1[this.fileVersionField]=_2;
this.performDSOperation("getFileVersion",_1,function(_5,_6,_7){
if(_5.status>=0&&isc.isAn.Array(_6)&&_6.length>0){
_6=_6[0].fileContents}else{
_6=null}
this.fireCallback(_3,isc.DS.$281k,[_5,_6,_7])},
isc.addProperties({
willHandleError:true
},_4))}
,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,isc.DS.$281k,[_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,isc.DS.$281k,[_4,_5,_6])},{
willHandleError:true
})}
,isc.A.$209c=function isc_DataSource__getFileSpecFileVersion(_1){
if(!_1)return;
if(isc.isA.String(_1))_1=isc.DataSource.makeFileSpec(_1);
return _1[this.fileVersionField||this.fileLastModifiedField||
"fileLastModified"]}
,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.asyncExecute=function isc_DataSource_asyncExecute(_1){
_1.$267o=Promise.withResolvers();
_1.$263w=_1.callback;
_1.callback={target:this,methodName:"$281l"};
_1.$281m=_1.willHandleError;
_1.willHandleError=true;
this.execute(_1);
if(!_1.$281m){
return _1.$267o.promise
.$274g(function(_3){
const _2=isc.defaultAsyncOperationCatchCallback(_3);
if(!(_2.status<0)){
_2.status=isc.DSResponse.STATUS_FAILURE;
_2.data=isc.getAsyncMessage(_2)}
if(_2.type!="canceled"||_2.cancellationInitiator!="user"){
isc.RPCManager.$a0(_2,_1)}
return null},
this)}else{
return _1.$267o.promise}
}
,isc.A.$281l=function isc_DataSource___handleExecuteReply(_1,_2,_3){
_3.callback=_3.$263w;
_3.willHandleError=_3.$281m;
if(_3.willHandleError||_1.status>=0){
this.fireCallback(_3.callback,this.$281k,arguments)}
if(_1.status<0){
_1.type="error";
_1.errorMessage=isc.RPCManager.getDefaultErrorMessage(_1,_3,
isc.RPCManager.defaultErrorFormatter);
_3.$267o.reject(_1)}else{
_1.type="success";
_3.$267o.resolve(_1)}
}
);
isc.evalBoundary;isc.B.push(isc.A.performDSOperation=function isc_DataSource_performDSOperation(_1,_2,_3,_4){
if(isc.$cv)arguments.$cw=this;
if(this.logIsDebugEnabled("dsOperationTrace")){
this.logDebug("Perform DS operation of type:"+_1+" Stack:\n"+this.getStackTrace(),
"dsOperationTrace")}
_4=isc.DataSource.dupRequest(_4);
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}
isc.DataSource.recordTimingData(_5,"performDSOperation","end");
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;_2<this.patternMultiWildcard.length;_2++){
_7=_7.replaceAll(this.patternMultiWildcard[_2],_5)}
}
var _8=_7.split(_5);
var _9;
var _10;
if(_8.length===1){
if(_3.operator==="matchesPattern"||_3.operator==="iMatchesPattern"){
_10={
fieldName:_6,
value:_8[0],
operator:_4?"iEquals":"equals"
}}else if(_3.operator==='startsWithPattern'||_3.operator==='iStartsWithPattern'){
_10={
fieldName:_6,
value:_8[0],
operator:_4?"iStartsWith":"startsWith"
}}else if(_3.operator==='endsWithPattern'||_3.operator==='iEndsWithPattern'){
_10={
fieldName:_6,
value:_8[0],
operator:_4?"iEndsWith":"endsWith"
}}else{
_10={
fieldName:_6,
value:_8[0],
operator:_4?"iContains":"contains"
}}
}else if(_8.length>1){
_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.addDefaultsRecursively(_1,
this.getOperationBinding(_1.operationType).requestProperties);
isc.addDefaultsRecursively(_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(_1.showPrompt!=false&&isc.Hover.preparingHoverComponent){
isc.Hover.suppressNextShow=true}
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()}
this.addImplicitCriteria(_1);
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.JSON.jsonDateReviver;
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}else{
_1.data=this.embedTimezoneInRelativeDates(_1.data)}
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"){
if(!this.$175o)return;
if(this.$175o(_1)){
this.logInfo("sendDSRequest: clientCustom server request - returning",
"cacheAllData"
);
return}else{
this.logInfo("sendDSRequest: clientCustom request using client cache",
"cacheAllData"
);
delete this.$624[_1.requestId]}
}else{
delete this.$624[_1.requestId]}
if(_1.shouldUseCache===false||
(_1.shouldUseCache!==true)&&
!this.clientOnly&&
(!this.mockMode||_1.cachingAllData)&&
(!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=isc.params.isc_tenantId;
var _10=_8.defaultParams||this.defaultParams;
if(_10||_9){
_1.params=isc.addProperties({},_10,_1.params);
if(_9)_1.params.isc_tenantId=_9}
return this.performSCServerOperation(_1,_1.data)}
}
var _11=this.getServiceInputs(_1);
var _12=_1.shouldUseCache===true||this.mockMode||
(this.cacheAllData&&
_1.operationType=="fetch"&&
!_1.cachingAllData&&
!_1.downloadResult&&
!(this.cacheAllOperationId&&
this.cacheAcrossOperationIds==false&&
_1.operationId!=this.cacheAllOperationId));
if(_11.dataProtocol=="clientCustom"&&!_12)return;
var _13=isc.addProperties({},_1,_11);
_13._dsRequest=_1;
if(_11.data==null)_13.data=null;
if(this.clientOnly||_12){
_13.clientOnly=true;
_13.callback={target:this,methodName:"$50e"};
isc.RPC.sendRequest(_13);
return}
var _14=this.getOperationBinding(_1);
_13.transport=_14.dataTransport||this.dataTransport;
if(_13.transport=="scriptInclude"){
_13.callback={target:this,methodName:"$377"};
if(!_13.callbackParam){
_13.callbackParam=_14.callbackParam||this.callbackParam}
isc.rpc.sendRequest(_13);
return}
var _2=this.getDataFormat(_1);
if(_2=="xml"){
var _15=_13.spoofedResponse;
if(!_15){
_13.callback={target:this,method:this.$378};
isc.xml.getXMLResponse(_13)}else{
var _16=this;
isc.Timer.setTimeout(function(){
_16.$378(isc.xml.parseXML(_15),
_15,
{status:0,httpResponseCode:200,
data:_15},
_13)})}
}else if(_2=="json"){
_13.callback={target:this,method:this.$379};
isc.rpc.sendProxied(_13)}else if(_2=="csv"){
_13.callback={target:this,method:this.$69k};
isc.rpc.sendProxied(_13)}else{
_13.serverOutputAsString=true;
_13.callback={target:this,method:this.$38a};
isc.rpc.sendProxied(_13)}
}
,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=_9?isc.SimpleType.getBaseType(_9.type,_5):null;
if(_11=="integer"){
_1[_7]=_5.nullIntegerValue}else if(_11=="float"){
_1[_7]=_5.nullFloatValue}else if(_11=="date"||_11=="time"||_11=="datetime"){
_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)){
if(isc.DateUtil.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.supportsFieldValueExpressions=function isc_DataSource_supportsFieldValueExpressions(){
return false}
,isc.A.calculateDeclarativeSecuritySettings=function isc_DataSource_calculateDeclarativeSecuritySettings(){
var _1=false;
if(!this.clientOnly)return _1;
if(!this.enforceSecurityOnClient)return _1;
if(!this.$224t){
this.observe(
isc.Auth,
"userDataModified",
"observer.calculateDeclarativeSecuritySettings();"
);
this.$224t=true}
var _2=(isc.Auth.getCurrentUser()!=null);
var _3=this.getFields();
for(var _4 in _3){
var _5=_3[_4],
_6=true
;
if(!this.canFetchField(_5,_2)){
_6=false;
if(this.canEditField(_5,_2)==this.$215y||
!this.hasEditSecuritySetting(_5,false))
{
if(_5.canView==null||_5.$2152){
if(_5.canView!=_6){
_1=true;
_5.canView=_6;
_5.$2152=true}
}else{
_6=_5.canView}
}else if(_5.hidden==null||_5.$2153){
if(!_5.hidden){
_1=true;
_5.hidden=true;
_5.$2153=true}
}
}else{
if(_5.canView!=null&&_5.$2152){
_1=true;
delete _5.canView}
if(_5.hidden!=null&&_5.$2153){
_1=true;
delete _5.hidden}
}
var _7=this.canEditField(_5,_2),
_8=(_7==this.$215y?false:null)
;
if(_5.canEdit==null||_5.$2154){
if(_5.canEdit!=_8){
_1=true;
_5.canEdit=_8;
_5.$2154=true}
}
if(_5.canSave==null||_5.$2155){
if(_5.canSave!=_8){
_1=true;
_5.canSave=_8;
_5.$2155=true}
}
if(_8==false)continue;
if((_7&this.$2150)==0){
if(_5.canInit==null||_5.$228r){
_5.canInit=false}
}
if((_7&this.$215z)==0){
if(_5.canUpdate==null||_5.$228s){
_5.canUpdate=false}
}
if(!_6){
_8=(!this.hasEditSecuritySetting(_5,false)?false:null);
if(_5.canEdit==null||_5.$2154){
if(_5.canEdit!=_8){
_1=true;
_5.canEdit=_8;
_5.$2154=true}
}
if(_5.canSave==null||_5.$2155){
if(_5.canSave!=_8){
_1=true;
_5.canSave=_8;
_5.$2155=true}
}
}
}
return _1}
,isc.A.hasEditSecuritySetting=function isc_DataSource_hasEditSecuritySetting(_1,_2){
if(_2){
return _1.editRequiresAuthentication!=null||
_1.editRequiresRole!=null||
_1.editRequires!=null}else{
return _1.editRequiresAuthentication!=null||
_1.editRequiresRole!=null||
_1.editRequires!=null||
_1.initRequiresRole!=null||
_1.initRequires!=null||
_1.updateRequiresRole!=null||
_1.updateRequires!=null
}
}
,isc.A.canFetchField=function isc_DataSource_canFetchField(_1,_2){
if(_1.canView==false&&!_1.$2152)return false;
var _3=_1.viewRequiresAuthentication;
if(!_3)_3=(_1.viewRequiresRole!=null);
if(_3&&!_2)return false;
var _4=_1.viewRequiresRole;
if(_4!=null&&_4!=""){
if(!this.isUserInRole(_4.split(","))){
return false}
}
return true}
,isc.A.canEditField=function isc_DataSource_canEditField(_1,_2){
var _3=this.$215y;
if(_1.editRequiresAuthentication||_1.editRequiresRole!=null){
_3=this.$2151}
if(_3==this.$215y){
if(_1.updateRequiresAuthentication||_1.updateRequiresRole!=null){
_3|=this.$215z}
if(_1.initRequiresAuthentication||_1.initRequiresRole!=null){
_3|=this.$2150}
}
if(_3!=this.$215y&&!_2){
return _3^this.$2151}
var _4=_1.editRequiresRole,
_5=_1.updateRequiresRole,
_6=_1.initRequiresRole,
_7=this.$215y;
;
if(_4!=null&&_4!=""){
if(!this.isUserInRole(_4.split(",")))_7=this.$2151;}
if(_6!=null&&_6!=""){
if(!this.isUserInRole(_6.split(","))){
_7|=this.$2150}else{
_7&=(this.$2150^this.$2151)}
}
if(_5!=null&&_5!=""){
if(!this.isUserInRole(_5.split(","))){
_7|=this.$215z}else{
_7&=(this.$215z^this.$2151)}
}
if(_7!=this.$215y){
return _7^this.$2151}
var _8=_1.editRequires,
_9=_1.updateRequires,
_10=_1.initRequires,
_11=this.$215y
;
if(_8=="false"){
_11=this.$2151}
if(_10=="false"){
_11|=this.$2150}
if(_9=="false"){
_11|=this.$215z}
return _11^this.$2151}
,isc.A.isUserInRole=function isc_DataSource_isUserInRole(_1){
var _2=isc.Auth.getRoles(),
_3=isc.Auth.isSuperUser()
;
if(isc.isA.String(_1))_1=_1.split(",");
if(_2&&_2.length>0){
for(var i=0;i<_1.length;i++){
var _5=_1[i].trim(),
_6=((_5=="*super*"&&_3)||_2.contains(_5))
;
if(_6)return true}
}
return false}
,isc.A.getSpecificOperationBinding=function isc_DataSource_getSpecificOperationBinding(_1,_2){
if(_1==null||this.operationBindings==null)return this;
if(isc.isAn.Object(_1)){
var _3=_1;
_1=_3.operationType;
_2=_3.operationId}
if(_2){
var _4=this.operationBindings.findAll("operationId",_2);
if(_4){
var _5=_4.find("operationType",_1);
if(_5)return _5}
}
if(_1&&!_2){
var _6=this.operationBindings.findAll("operationType",_1);
if(_6){
for(var i=0;i<_6.length;i++){
if(!_6[i].operationId||
_6[i].operationId.trim()=="")
{
return _6[i]}
}
}
}
return this}
,isc.A.passesSecurityChecks=function isc_DataSource_passesSecurityChecks(_1,_2,_3){
if(!this.clientOnly)return true;
if(!this.enforceSecurityOnClient)return true;
_2=_2||this;
this.logDebug("Processing security checks for DataSource "+
(_2==null?"null":_2.getID())+
", field "+_3,"clientSecurity");
var _4=_1.operationType,
_5=_1.operationId,
_6=_2.getSpecificOperationBinding(_4,_5),
_7
;
if(!_1.checkedDataSources)_1.checkedDataSources=[];
if(_1.checkedDataSources.contains(_2.getID())){
return this.checkRelatedSecurity(_1,_2,_3)}
this.logDebug("Processing security checks for DataSource "+
(_2==null?"null":_2.getID())+
", operationType "+_4+", operationId "+_5,"clientSecurity");
if(_6){
_7=_6.requiresAuthentication}
if(_7==null&&_5!=null&&_5!=""){
var _8=_2.operationBindings;
if(_8){
for(var i=0;i<_8.length;i++){
var _10=_8[i];
if(_4==_10.operationType){
var _11=_10.operationId;
if(!_11||_11==""){
if(_7==null){
_7=_10.requiresAuthentication}
break}
}
}
}
}
if(_7==null){
_7=_2.requiresAuthentication}
var _12=isc.Auth.getCurrentUser();
this.logDebug("Processing security checks for DataSource "+
(_2==null?"null":_2.getID())+
", authenticate "+_7+", user "+_12,"clientSecurity");
if(_7!=null&&_7){
if(!_12){
_1.securityFailureMessage="DataSource '"+_2.getID()+
"', operationType '"+_4+
"', operationId '"+_5+"'.  No authenticated user";
return false}
}
var _10=_2.getSpecificOperationBinding(_4,_5),
_13
;
if(_10){
_13=_10.requiresRole}
if(!_13&&_5&&_5!=""){
var _8=_2.operationBindings;
if(_8){
for(var i=0;i<_8.length;i++){
_10=_8[i];
if(_4==_10.operationType){
var _11=_10.operationId;
if(!_11||_11==""){
_13=_10.requiresRole;
break}
}
}
}
}
var _14=_2.requiresRole;
if(!_13)_13=_14;
else if(_14)_13+=", "+_14;
if(_13&&_13!=""){
if(_7!=null&&!_7&&_12==null){
_1.securityFailureMessage="DataSource '"+_2.getID()+
"', operationType '"+_4+
"', operationId '"+_5+"'.  requiresAuthentication was not set, but requiresRole was.  Roles cannot be checked without an authenticated user";
return false}
var _15=_2.isUserInRole(_13);
if(!_15){
_1.securityFailureMessage="DataSource '"+_2.getID()+
"', operationType '"+_4+
"', operationId '"+_5+"'.  This operation requires role(s) '"+_13+
(_12==null?"'. This user ":"'. User '"+_12.userId+"' ")+
"fails the role check.";
return false}
}
var _16;
var _17=false;
_16=_2.requires;
if(_16!=null){
if(isc.isA.String(_16)){
_16=_16.trim().toLowerCase();
_18=(_16=="true"?true:(_16=="false"?false:null))}else{
_18=_16}
if(_18==null){
_1.securityFailureMessage="DataSource '"+_2.ID+
"', operationType '"+_4+
".  Cannot interpret Velocity expression on client; assuming 'false'."}else if(!_18){
_1.securityFailureMessage="DataSource '"+_2.ID+
"', operationType '"+_4+
".  Failed the \"requires\" check."}
if(_18==null||!_18)_17=true}
_10=_2.getSpecificOperationBinding(_4,_5);
if(_10){
_16=_10.requires}
if(_16==null&&_5!=null&&_5!=""){
var _8=_2.operationBindings;
if(_8!=null){
for(var i=0;i<_8.length;i++){
_10=_8[i];
if(_4==_10.operationType){
var _11=_10.operationId;
if(_11==null||_11==""){
_16=_10.requires;
break}
}
}
}
}
var _18=true;
if(_16!=null){
if(isc.isA.String(_16)){
_16=_16.trim().toLowerCase();
_18=(_16=="true"?true:(_16=="false"?false:null))}else{
_18=_16}
if(_18==null){
_1.securityFailureMessage="DataSource '"+_2.ID+
"', operationType '"+_4+
".  Cannot interpret Velocity expression on client; assuming 'false'."}else if(!_18){
_1.securityFailureMessage="DataSource '"+_2.ID+
"', operationType '"+_4+
".  Failed the \"requires\" check."}
}
if(_17||_18==null||!_18){
return false}
if(_4=="add"||_4=="update"||_4=="remove"){
return true}
return this.checkRelatedSecurity(_1,_2,_3)}
,isc.A.checkRelatedSecurity=function isc_DataSource_checkRelatedSecurity(_1,_2,_3){
var _4=_2.getFieldNames();
for(var i=0;i<_4.length;i++){
var _6=_4[i],
_7=_2.getField(_6)
;
if(!_7||!_7.includeFrom)continue;
var _8=_7.includeFrom,
_9=_8.split(".")
;
if(_9.length<2){
this.logWarn("Field "+_6+" has invalid includeFrom definition: '"+
_8+"'.  Should be of the form 'dataSourceName.fieldName'. You can also define multiple data sources to request certain  path to connect indirectly related data sources: 'dataSourceName1.dataSourceName2.fieldName'.");
continue}
var _10=_7.name,
_11=_8.substring(0,_8.lastIndexOf(".")),
_12=_8.substring(_8.lastIndexOf(".")+1),
_13=[],
_14=[]
;
if(!_10)_10=_12;
if(_3&&_10!=_3)continue;
var _15=false;
for(var j=0;j<_9.length-1;j++){
var _17=_9[j],
_18=isc.DS.get(_17)
;
if(_18==null){
this.logWarn("includeFrom field named '"+_6+"' refers to a related DataSource ('"+_17+
"') that does not exist. Ignoring this field.");
_15=true;
break}
_13.add(_18);
_14.add(_17)}
if(_15)continue;
var _19=_13[_13.length-1],
_20=_19.getField(_12)
;
if(_20==null){
this.logWarn("includeFrom field named '"+_6+"' refers to a '"+_12+"' field that does not exist in '"+_19.getID()+"' data source. Ignoring this field.");
continue}
if((this.getID()==_19.getID()||_2.getID()==_19.getID())&&
_3==_12)
{
this.logWarn("includeFrom field named '"+_6+"' of datasource '"+
this.getID()+"' refers to itself. Ignoring this field.");
continue}
if(!this.passesSecurityChecks(_1,_19,_12)){
_1.securityFailureMessage="Security check on related DataSource '"+_2.getID()+
"', required for included field '"+_10+
"', failed.  Failure message is: \""+_1.securityFailureMessage+"\"";
return false}
if(!_1.checkedDataSources.contains(_19.getID())){
_1.checkedDataSources.add(_19.getID())}
}
return true}
,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(){
if(this.pluralTitle)return this.pluralTitle;
var _1=this.getTitle();
return _1.endsWith("s")?_1:_1+"s"}
,isc.A.getTitleField=function isc_DataSource_getTitleField(){
if(this.titleField==null){
var _1=isc.getKeys(this.getFields()),
_2=_1.callMethod("toLowerCase"),
_3=this.getID().toLowerCase(),
_4=["",_3,_3+"_"],
_5=this
;
while(_5.hasSuperDS()){
var _5=_5.superDS(),
_3=_5.getID().toLowerCase()
;
_4.addList([_3,_3+"_"])}
for(var i=0;i<this.defaultTitleFieldNames.length;i++){
for(var j=0;j<_4.length;j++){
var _8=_2.indexOf(_4[j]+this.defaultTitleFieldNames[i]);
if(_8!=-1&&!this.getField(_1[_8]).hidden){
this.titleField=_1[_8];
break}
}
if(this.titleField){
break}
}
if(this.titleField==null){
for(var i=0;i<_1.length;i++){
if(this.getField(_1[i]).hidden)continue;
this.titleField=_1[i];
break}
if(this.titleField==null)this.titleField=_1[0]}
}
return this.titleField}
);
isc.evalBoundary;isc.B.push(isc.A.getIconField=function isc_DataSource_getIconField(){
var _1;
if(this.iconField===_1){
this.iconField=null;
var _2=isc.getKeys(this.getFields());
var _3=["picture","thumbnail","icon","image","img"];
for(var i=0;i<_3.length;i++){
var _5=_3[i],
_6=this.getField(_5);
if(_6&&isc.SimpleType.inheritsFrom(_6.type,"image")){
this.iconField=_5}
}
}
return this.iconField}
,isc.A.getSalientFields=function isc_DataSource_getSalientFields(_1){
if(_1==null)_1={};
var _2=this.getFields();
var _3=isc.getKeys(_2);
var _4;
var _5=_1.threshold==null?this.salientFieldsThreshold:_1.threshold;
if(_5!=null&&_3.length<_5){
_4=_3}else{
_4=[];
var _6=this.getTitleField();
if(_6!=null)_4.push(_6);
var _7=this.getPrimaryKeyFieldNames();
if(_7!=null){
for(var i=0;i<_7.length;i++){
if(!_4.contains(_7[i])){
_4.push(_7[i])}
}
}
var _9=this.infoField;
if(_9!=null&&!_4.contains(_9))_4.push(_9);
var _10=this.dataField
if(_10!=null&&!_4.contains(_10))_4.push(_10);
var _11=this.getIconField();
if(_11!=null&&!_4.contains(_11))_4.push(_11);
for(var _12 in _2){
if(_4.contains(_12))continue;
var _13=_2[_12];
if(_13.salient==true||_13.primaryKey==true||_13.foreignKey==true){
_4.push(_12)}
}
}
if(_1.max!=null&&_4.length>_1.max){
_4.length=_1.max}
var _14=this;
return _4.map(function(_12){return _14.getField(_12)})
}
,isc.A.initViewSources=function isc_DataSource_initViewSources(){
var _1=this.fields={};
for(var _2 in this.sources){
var _3=isc.DS.get(_2);
if(!_3)continue;
var _4=this.sources[_2].fields;
for(var _5 in _4){
var _6=_4[_5],
_7=null;
if(_6=="*"){
_7=_3.fields[_5]}else if(isc.isA.String(_6)){
_7=_3.fields[_6]}else if(isc.isAn.Object(_6)){
_7=isc.addProperties({},_3.fields[_3.fields[_6.field]]);
isc.addProperties(_7,_6)}
if(_7)_1[_5]=_7}
}
}
,isc.A.inheritsSchema=function isc_DataSource_inheritsSchema(_1){
if(_1==null)return false;
if(isc.isA.String(_1))_1=this.getSchema(_1);
if(_1==this||_1==isc.DS.get("Object"))return true;
if(!this.hasSuperDS())return false;
return this.superDS().inheritsSchema(_1)}
,isc.A.getInheritedProperty=function isc_DataSource_getInheritedProperty(_1){
if(this[_1])return this[_1];
var _2=this.superDS();
return _2?_2.getInheritedProperty(_1):null}
,isc.A.hasSuperDS=function isc_DataSource_hasSuperDS(){
if(this.inheritsFrom)return true;
return false}
,isc.A.superDS=function isc_DataSource_superDS(){
if(this.hasSuperDS())return this.getSchema(this.inheritsFrom);
return null}
,isc.A.getField=function isc_DataSource_getField(_1,_2){
if(isc.isAn.Object(_1))_1=_1.name;
var _3=this.getFields();
var _4=_3?_3[_1]:null;
if(_4==null&&_2&&_3!=null){
for(var i in _3){
if(_3[i]==null)continue;
if(_3[i].dataPath==_1){
_4=_3[i];
break}
}
}
return _4}
,isc.A.getFieldByName=function isc_DataSource_getFieldByName(_1){
return this.getField(_1)}
,isc.A.getUnderlyingField=function isc_DataSource_getUnderlyingField(_1){
var _2=this;
do{
var _3=_2.getField(_1);
if(_3)return _3;
_2=_2.superDS()}while(_2);
return null}
,isc.A.getFieldForDataPath=function isc_DataSource_getFieldForDataPath(_1){
if(isc.isAn.Object(_1))_1=_1.dataPath;
if(!_1)return null;
var _2=_1.trimCharacters(isc.Canvas.$70l).split(isc.Canvas.$70l);
var _3=this;
for(var i=0;i<_2.length;i++){
if(_3==null)return null;
var _5=_3.getField(_2[i]);
if(!_5)return null;
_3=isc.DataSource.get(_5.type)}
return _5}
,isc.A.isRelationField=function isc_DataSource_isRelationField(_1,_2){
if(_1.foreignKey==null)return false;
var _3=isc.DataSource.getForeignDSName(_1,this);
if(_3==this.getID())return false;
if(_2!=null){
return(_2==!!_1.multiple)}
return true}
,isc.A.getDataSourceForDataPath=function isc_DataSource_getDataSourceForDataPath(_1,_2){
if(isc.isAn.Object(_1))_1=_1.dataPath;
if(!_1)return null;
if(_1==isc.Canvas.$70l)return this;
var _3=_1.trimCharacters(isc.Canvas.$70l).split(isc.Canvas.$70l);
var _4=this;
var _5=_2?_3.length:_3.length-1;
for(var i=0;i<_5;i++){
var _7=_4.getField(_3[i]);
if(!_7){
this.logInfo("getDataSourceForDataPath() - unable to find nested field:"
+_3[i]+" from dataSource:"+_4+
". Orginal dataPath:"+_1,"dataBinding");
return null}
var _8=_4;
_4=isc.DataSource.get(_7.type);
if(_4==null){
this.logInfo("getDataSourceForDataPath() - unable to find nested dataSource for field:"+
_7.name+" of type:"+_7.type+" on dataSource:"+_8+
". Original dataPath:"+_1,"dataBinding");
break}
}
return _4}
,isc.A.getFieldByTitle=function isc_DataSource_getFieldByTitle(_1){
var _2=isc.getValues(this.getFields());
for(var i=0;i<_2.length;i++){
var _4=_2[i],
_5=_4.title||isc.DS.getAutoTitle(_2[i].name);
if(_5==_1)return _4}
return null}
,isc.A.getDisplayValue=function isc_DataSource_getDisplayValue(_1,_2){
var _3=this.getField(_1);
if(_3==null)return _2;
if(isc.isAn.Object(_3.valueMap)&&!isc.isAn.Array(_3.valueMap)&&
isc.propertyDefined(_3.valueMap,_2))
{
return _3.valueMap[_2]}
return _2}
,isc.A.getFieldNames=function isc_DataSource_getFieldNames(_1){
if(isc.$cv)arguments.$cw=this;
if(!_1)return isc.getKeys(this.getFields());
var _2=this.getFields(),
_3=[],
_4=0;
for(var _5 in _2){
if(_2[_5]!=null&&!_2[_5].hidden){
_3[_4++]=_5}
}
return _3}
,isc.A.getLocalFields=function isc_DataSource_getLocalFields(_1){
if(this.$38k)return this.fields;
if(_1)return this.fields;
this.$38l();
this.$63p();
this.$38k=true;
return this.fields}
,isc.A.getFields=function isc_DataSource_getFields(){
if(isc.$cv)arguments.$cw=this;
if(this.mergedFields)return this.mergedFields;
var _1=this.superDS();
if(!this.hasSuperDS()||this==_1){
return this.mergedFields=this.$218a(this.getLocalFields())}
if(!_1){
this.logWarn("DataSource "+this.ID+" inheritsFrom "+this.inheritsFrom+
", but there is no DataSource of that name currently loaded. Ignoring the inheritsFrom declaration.");
return this.mergedFields=this.$218a(this.getLocalFields())}
if(this.showLocalFieldsOnly||this.restrictToLocalFields){
this.useParentFieldOrder=false}
var _2=isc.addProperties({},this.getLocalFields()),
_3;
if(!this.useParentFieldOrder){
_3=_2}else{
_3={}}
var _4=(this.restrictToLocalFields?isc.getKeys(this.getLocalFields()):
_1.getFieldNames());
for(var i=0;i<_4.length;i++){
var _6=_4[i],
_7=_2[_6];
if(_7!=null){
var _8=_1.getField(_6);
if(_8.hidden&&_7.hidden==null&&
!_7.inapplicable&&!this.autoDeriveSchema&&!this.schemaBean)
{
_7.hidden=false}
if(_8.visibility!=null&&_7.visibility==null&&
!_7.inapplicable&&!_7.hidden&&
_8.visibility=="internal")
{
_7.visibility="external"}
var _9=isc.addProperties({},_7);
_3[_6]=_1.combineFieldData(_7,null,true);
if(_9.$76s)_3[_6].title=_8.title}else{
if(this.showLocalFieldsOnly){
_3[_6]=isc.addProperties({},_1.getField(_6));
_3[_6].hidden="true"}else{
_3[_6]=_1.getField(_6)}
}
if(this.useParentFieldOrder)delete _2[_6]}
if(this.useParentFieldOrder)isc.addProperties(_3,_2);
if(this.restrictToLocalFields&&isc.Schema&&isc.isA.Schema(this)){
var _10=_1.getFieldNames();
for(var i=0;i<_10.length;i++){
var _6=_10[i],
_11=_1.getField(_6);
if(_11.xmlAttribute){
_3[_6]=_3[_6]||_11}
}
}
return this.mergedFields=this.$218a(_3)}
,isc.A.getAllFields=function isc_DataSource_getAllFields(){
return isc.getValues(this.getFields())}
,isc.A.$218a=function isc_DataSource__updateDataPaths(_1){
var _2=this.dataPaths={};
for(var _3 in _1){
if(_3.dataPath)_2[_3.dataPath]=_3}
return _1}
,isc.A.getDataPaths=function isc_DataSource_getDataPaths(){
if(!this.dataPaths)this.getFields();
return this.dataPaths}
,isc.A.hasFields=function isc_DataSource_hasFields(){
if(this.fields)return true;
else if(this.inheritsFrom){
var _1=this;
while(_1.inheritsFrom){
_1=isc.DataSource.get(this.inheritsFrom);
if(_1.fields)return true}
}
return false}
,isc.A.getFlattenedFields=function isc_DataSource_getFlattenedFields(_1,_2,_3){
_1=_1||{};
var _4=this.getFieldNames();
for(var i=0;i<_4.length;i++){
var _6=_4[i],
_7=this.getField(_6);
if(!this.fieldIsComplexType(_6)){
if(_1[_6]==null){
_7.sourceDS=this.ID;
if(_2){
_7=isc.addProperties({
},_7);
_7[_3]=_2+"/"+_6}
_1[_6]=_7}
}else{
var _8=this.getFieldDataSource(_7);
if(_2!=null)_2=(_2?_2+"/":"")+_6;
_8.getFlattenedFields(_1,_2,_3)}
}
return _1}
,isc.A.fieldIsComplexType=function isc_DataSource_fieldIsComplexType(_1,_2){
_2=_2||this.getField(_1);
if(_2==null)return false;
return(_2.type!=null&&!_2.xmlAttribute&&this.getSchema(_2.type)!=null)
||this.fieldIsAnonDataSource(_2)}
,isc.A.fieldIsAnonDataSource=function isc_DataSource_fieldIsAnonDataSource(_1){
if(!_1.fields)return false;
var _2=isc.isAn.Array(_1.fields)?_1.fields:isc.getValues(_1.fields);
return _2.length>0&&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(_11!=this.$192e&&
(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.getLocalFields();
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.getDefaultPathToRelation=function isc_DataSource_getDefaultPathToRelation(_1,_2){
return this.getShortestPathToRelation(_1,_2)}
,isc.A.getShortestPathToRelation=function isc_DataSource_getShortestPathToRelation(_1,_2){
var _3=this.getAllPathsToRelation(_1,_2);
var _4;
for(var i=0;i<_3.length;i++){
var _6=_3[i];
if(!_4||_6.distance<_4.distance){
_4=_6}
}
return _4}
,isc.A.createAlias=function isc_DataSource_createAlias(_1,_2){
if(_1)isc.DataSource._dataSources[_1]=this;
if(_2&&!isc.DS.suppressIDRegistration){
var _3=isc.windowContext||this.getWindow(),
_4=_3[_1]
;
if(this.addGlobalId&&this.addGlobalId!=isc.$ae&&!_4){
this.logDebug("Adding global alias "+_1+" for this DataSource");
_3[_1]=this}else{
this.logWarn("Can't add global alias "+_1+" for this DataSource")}
}
}
,isc.A.getAllPathsToRelation=function isc_DataSource_getAllPathsToRelation(_1,_2){
var _3=isc.isA.DataSource(_1)?_1.ID:_1;
if(!_2){
var _4=isc.DSRelations.create({
dataSources:isc.DataSource.getRegisteredDataSourceObjects()
});
_2=_4.getAllRelationsForDataSource(this.ID)}
var _5=isc.Tree.create({
idField:"dsId",
parentIdField:"parentDsId",
nameProperty:"dsId",
modelType:"parent",
data:_2
});
var _6=_5.getAllNodes().findAll("dsId",_3)||[];
var _7=[];
for(var i=0;i<_6.length;i++){
var _9=_6[i],
_10=_5.getPath(_9).substring(1),
_11=_10.split("/").length;
var _12=_5.getParents(_9).findAll({type:'1-M'});
if(!_12){
_12=[]}
_7.add({
path:_10,
distance:_11,
aggregations:_12.length+(_9.type='1-M'?1:0)
})}
return _7}
,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,_3){
if(isc.isA.String(_1))_1=this.getSchema(_1);
var _4,_5;
if(_3&&_1){
_4=[];
_5=[]}
var _6=this.getFields();
if(_2==null){
for(var _7 in _6){
var _8=_6[_7];
if(_8.foreignKey!=null){
if((_1||this).getID()==
isc.DataSource.getForeignDSName(_8,this))
{
if(!_2)_2=_7;
if(_4)_4.add(_7);
else break}
}
}
}
var _9;
if(_2==null&&_1){
_2=_9=
isc.getKeys(this.fields).intersect(isc.getKeys(_1.fields))[0];
if(_9){
this.logInfo("no foreign key declaration, guessing tree relationship is on field name: "+_2+" which occurs in both DataSources");
if(_4)_4[0]=_5[0]=_9}
}
var _10;
if(_2)_10=_6[_2];
if(_10==null){
this.logDebug("getTreeRelationship(): Unable to find foreignKeyField.foreignKeyFieldName specified as:"+_2)}
if(!_1){
if(!_10)_1=this;
else{
var _11=isc.DataSource.getForeignDSName(_10,this);
_1=this.getSchema(_11)}
}
if(!_9){
_9=_10?isc.DataSource.getForeignFieldName(_10):null;
if(_4)for(var i=0;i<_4.length;i++){
var _10=_6[_4[i]];
_5.add(_10?isc.DataSource.getForeignFieldName(_10):null)}
}
if(_9==null){
var _13=_1.getPrimaryKeyFieldNames();
if(_4){
if(isc.isAn.Array(_13)){
if(_13.length==_4.length)_5=_13.duplicate()}else{
if(_4.length==1)_5[0]=_13}
}
if(isc.isAn.Array(_13)){
if(_13.length>1&&!_4){
this.logWarn("getTreeRelationship: dataSource '"+_1.ID+
"' has multi-field primary key, which is not supported for tree viewing.  Using field '"+
_13[0]+"' as the only primary key field")}
_13=_13[0]}
_9=_13}
var _14;
var _15;
if(this.childrenField)_15=this.childrenField;
for(var _7 in _6){
var _10=_6[_7];
if(_10.isFolderProperty)_14=_7;
if(_10.childrenProperty)_15=_7;
if(_15==_7&&(_10.multiple==null)){
_10.multiple=true}
}
var _16={
childDS:this,
parentDS:_1,
isFolderProperty:_14
};
if(_2){
_16.parentIdField=_2;
_16.idField=_9}
if(_15)_16.childrenProperty=_15;
if(_4){
_16.parentIdFields=_4;
_16.idFields=_5}
if(_15==null&&_2==null){
this.logInfo("getTreeRelationship(): No specified foreignKeyField or childrenProperty.")
}
if(_1==this){
var _17=_2?this.getField(_2).rootValue:null;
if(_17==null)_16.rootValue=null;
else _16.rootValue=_17}
return _16}
,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,_4){
var _5;
if(isc.isAn.Object(_2))_5=_2;
else _5=this.getField(_2||_1.name);
return isc.DataSource.combineFieldData(_1,_5,_3,_4)}
,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}
if(!_3.type&&this.hasSuperDS()){
if(this.superDS().fields&&this.superDS().fields[_2]){
_3.type=this.superDS().fields[_2].type}
}
isc.SimpleType.addTypeDefaults(_3,this);
this.$75f(_3)}
}
,isc.A.$75f=function isc_DataSource__addFieldValidators(_1){
if(_1.required){
var _2=isc.addProperties({},this.$1611),
_3=_1.requiredMessage||this.requiredMessage
;
if(_3!=null)_2.errorMessage=_3;
this.$1612(_1,_2)}
if(_1.validators!=null){
for(var i=0;i<_1.validators.length;i++){
isc.DataSource.setupFieldValidatorID(_1.validators[i])}
}
}
,isc.A.$1612=function isc_DataSource__addValidatorToField(_1,_2){
if(!_1.validators){
_1.validators=[_2]}else{
if(!isc.isAn.Array(_1.validators)){
_1.validators=[_1.validators]}
if(_1.validators.$69){
_1.validators=_1.validators.duplicate()}
for(var i=_1.validators.length-1;i>=0;i--){
if(_1.validators[i].type==_2.type){
if(!_1.validators[i].errorMessage){
_1.validators[i].errorMessage=_2.errorMessage}
return}
}
_1.validators.add(_2)}
}
,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.formatFieldValue=function isc_DataSource_formatFieldValue(_1,_2){
var _3;
if(isc.isA.String(_1)){
_3=_1;
_1=this.getField(_1)}else{
_3=_1.name}
var _4;
if(_1){
var _5=_1.format;
if(_5){
if(isc.isA.Date(_2))return isc.DateUtil.format(_2,_5);
if(isc.isA.Number(_2))return isc.NumberUtil.format(_2,_5)}
var _6=_1.dateFormatter,
_7=_1.timeFormatter
;
if(isc.isA.Date(_2)&&(_6||_7)){
if(!_6||!_7||
isc.SimpleType.inheritsFrom(_1.type,"time",this))
{
return isc.DateUtil.format(_2,_7||_6)}else{
return isc.DateUtil.format(_2,_6||_7)}
}
_4=_1.$62||isc.SimpleType.getType(_1.type,this)}else{
this.logWarn("formatFieldValue(): can't find field '"+_3+
"'; value will be formatted as text");
_4=isc.SimpleType.getType("text",this)}
if(_4&&_4.normalDisplayFormatter){
_2=_4.normalDisplayFormatter(_2,_1)}
return _2}
,isc.A.isCalculated=function isc_DataSource_isCalculated(_1){
var _1=this.getField(_1);
if(_1==null)return false;
if(_1.calculated!=null)return _1.calculated;
return(_1.formula!=null||
_1.template!=null||
_1.customSelectExpression!=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({
$175o:function(_1){
return _1.cachingAllData||
(this.cacheAcrossOperationIds&&
(_1.operationType&&_1.operationType!="fetch"))||
(this.cacheAcrossOperationIds===false&&
this.cacheAllOperationId!=
(_1.operationId||_1.operation)
)
},
transformRequest:function(_1){
if(!this.$175o(_1))return _1;
return this.transformServerRequest(_1)},
transformResponse:function(_8,_1,_9){
if(!this.$175o(_1)){
var _5=this.$85n,
_6=_1.$85o;
if(!_5||!_6||_6>=_5)
return _8}
return this.transformServerResponse(_8,_1,_9)}
});
this.$839=true}
this.cacheResultSet=isc.ResultSet.create({
dataSource:this,
fetchMode:"local",
fetchOperation:this.cacheAllOperationId,
allRows:this.cacheData?this.cacheData:null,
cachingAllData:true,
componentId:"(cacheAllData fetch)",
componentContext:"(from: "+_1.componentId+
(_1.componentContext?" &lt;"+_1.componentContext+"&gt;)"
:")"),
dataArrived:function(_8,_9){
if(this.logIsInfoEnabled("cacheAllData")){
this.logInfo("cacheAllData - cacheResultSet.dataArrived: startRow/endRow: "+_8+"/"+_9)}
if(this.lengthIsKnown()){
var _7=this.getDataSource();
if(_7.cacheResultSet==null)return;
_7.cacheLastFetchTime=new Date().getTime();
if(_7.clientOnly||_7.mockMode){
if(_7.clientOnly)_7.testData=_7.cacheData=this.getAllRows();
else if(_7.mockMode)_7.testData=_7.cacheData=this.getAllLoadedRows()}
_7.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.canFetchSynchronous=function isc_DataSource_canFetchSynchronous(){
return this.getCacheData()!=null}
,isc.A.fetchingClientOnlyData=function isc_DataSource_fetchingClientOnlyData(_1){
if(_1.cachingAllData){
if(this.mockMode){
if(this.mockDataRows!=null){
_1.startRow=0;
_1.endRow=this.mockDataRows
}
_1.data=this.mockDataCriteria}
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())||
(this.mockMode&&!this.cacheData))
)
{
return this.firstCacheAllDataRequest(_1)}else{
if((this.clientOnly||this.mockMode)&&!this.testData&&(this.testFileName||this.dataURL)||
(this.cacheAllData&&_3)||
(this.mockMode&&!this.cacheData)){
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,
$175o:this.$175o,
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.","cacheAllData");
_13=[]}else{
_12.logInfo("One-time fetch complete: "+(_15?_15.length:"null")+" records",
"cacheAllData");
_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.evalBoundary;isc.B.push(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,_3){
if(!_3&&!this.passesSecurityChecks(_1)){
_6={
status:isc.RPCResponse.STATUS_AUTHORIZATION_FAILURE,
data:_1.securityFailureMessage
};
return _6}
_2=_2||this.testData;
var _4=false;
if(_1.clientOnlyDataModified!=true){
_1.clientOnlyDataModified=true;
_4=true}
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 _5=_1.operationType,
_6={
status:0
};
switch(_5){
case"fetch":
case"select":
case"filter":
var _7=this.getClientOnlyFetchResponse(_1,_2,false);
_6=_7[0];
var _8=_7[1];
if(this.copyLocalResults){
var _9=isc.Browser.isSGWT;
for(var i=0;i<_8.length;i++){
if(this.deepCopyLocalResults){
_8[i]=isc.clone(_8[i])}else{
_8[i]=isc.addProperties({},_8[i])}
if(_9){
_8[i][isc.gwtRef]=null;
_8[i][isc.gwtModule]=null}
}
}
_6.data=_8;
break;
case"remove":
case"delete":
if(this.isMissingPrimaryKeys(_1.data)){
_6.data="clientOnly remove operation failed for DataSource "+
this.ID+": missing primaryKey values(s) "+
this.getMissingPrimaryKeys(_1.data);
_6.data="clientOnly remove operation failed: missing primaryKey value(s): "+this.getMissingPrimaryKeys(_1.data);
_6.status=-1}else{
var _11=this.findByKeys(_1.data,_2);
if(_11==-1&&_4){
this.logWarn("clientOnly remove operation: Unable to find record matching criteria:"
+this.echo(_1.data));
_6.data="clientOnly remove operation failed: unable to find matching record"
_6.status=-1}else{
if(_4){
var _12=_2.get(_11);
_2.removeAt(_11);
this.$2474("remove",_12)}
_6.data=isc.addProperties({},_1.data)}
}
break;
case"add":
case"insert":
var _13=isc.addProperties({},_1.data);
if(_13.__ref){
delete _13.__ref;
delete _13.__module}
_13=this.applySequenceFields(_13);
_13=this.applyCreatorAndModifierFields(_13,true);
var _11=this.findByKeys(_13,_2);
if(_11!=-1&&_4){
this.logWarn("clientOnly add operation: Duplicate key: "+
isc.echoAll(_13)+this.getStackTrace());
_6.data="clientOnly add operation failed for DataSource "+
this.ID+": Duplicate key in record "+
isc.echoAll(_13)+"<br><br>"+this.getStackTrace();
_6.status=-1}else{
this.applyDeclarativeSecurityToRecord('add',_13);
if(_4){
_2.add(_13);
this.$2474("add",_13)}
_6.data=isc.addProperties({},_13);
this.resolveClientOnlyIncludeFrom(_6.data,null,_1.$223f)}
break;
case"replace":
case"update":
if(this.isMissingPrimaryKeys(_1.data)){
this.logWarn("clientOnly update operation: Missing primaryKey values: "+
this.getMissingPrimaryKeys(_1.data));
_6.data="clientOnly update operation failed for DataSource "+
this.ID+": missing primaryKey values(s) "+
this.getMissingPrimaryKeys(_1.data);
_6.status=-1}else{
var _11=this.findByKeys(_1.data,_2);
if(_11==-1){
this.logWarn("clientOnly update operation: Unable to find record matching criteria:"
+this.echo(_1.data));
_6.data="clientOnly update operation failed: unable to find matching record. Did you supply all primaryKeys?"
_6.status=-1}else{
var _13=_2[_11],
_14;
if(_4!=true){
_13=isc.addProperties({},_13)}else{
_14=isc.addProperties({},_13)}
_1.data=this.applyCreatorAndModifierFields(_1.data);
this.applyDeclarativeSecurityToRecord('update',_1.data,_13);
for(var _15 in _1.data){
if(_15=="__ref"||_15=="__module")continue;
var _16=this.getField(_15);
isc.Canvas.$70n(_15,null,_1.data[_15],_13,null,true)}
_6.data=isc.addProperties({},_13);
this.resolveClientOnlyIncludeFrom(_6.data,null,_1.$223f);
if(_4){
this.$2474("update",_13,_14)}
}
}
break;
case"export":
_6.data="Client-only DataSources do not support server-based export (exportData()).  Use exportClientData() instead.";
_6.status=-1;
break;
case"validate":
default:
break}
this.$109x(_6,_5);
return _6}
,isc.A.applyDeclarativeSecurityToRecord=function isc_DataSource_applyDeclarativeSecurityToRecord(_1,_2,_3){
if(!_3){
_3={}}
var _4=this.getFields();
for(var _5 in _4){
var _6=_4[_5];
if(_1==='add'){
if(_2[_5]&&!(_6.canInit==null?true:_6.canInit)){
_2[_5]=_3[_5];
isc.logWarn("Field '"+_5+"' is not allowed for 'add' operation. Removing this field from the record")}
}
if(_1==='update'){
if(_2[_5]&&!(_6.canUpdate==null?true:_6.canUpdate)){
_2[_5]=_3[_5];
isc.logWarn("Field '"+_5+"' is not allowed for 'update' operation. Removing this field from the record")}
}
}
}
,isc.A.applyClientSummaries=function isc_DataSource_applyClientSummaries(_1,_2){
var _3=this.getOperationBinding(_1);
var _4=_1.groupBy||_3.groupBy;
if(_4){
if(!isc.isAn.Array(_4)){
_4=[_4]}
var _5=this.getFieldNames();
for(var i=0;i<_4.length;i++){
var _7=_4[i];
if(!_5.contains(_7)){
isc.logWarn('Ignoring request to groupBy unrecognized field '+_7)}
}
_4=_4.intersect(_5)}
var _8=_1.summaryFunctions||_3.summaryFunctions;
if(_8){
var _9=isc.SimpleType.getRegisteredSummaryFunctions();
for(var _10 in _8){
var _11=_8[_10];
if(!_9.contains(_11)){
isc.logWarn('Ignoring unregistered summary function '+_11+'.');
delete _8[_10]}
}
}
if((!_4||_4.isEmpty())&&
(!_8||isc.getKeys(_8).isEmpty())){
return _2}
var _12=this;
var _13=function(_18,_19){
if(!isc.isAn.Array(_19)){
_19=[_19]}
var _15=[];
for(var i=0;i<_18.length;i++){
var _20={};
for(var j=0;j<_19.length;j++){
var _22=_19[j];
var _23=_12.getField(_22);
var _24=isc.Canvas.$70o(null,_23,_18[i],null,true,"formula");
_20[_22]=_24}
if(!_15.findAll(_20)){
_15.add(_20)}
}
return _15}
var _14=_4?_13(_2,_4):null;
if(!_8){
return _14}
var _15=_14?isc.shallowClone(_14):[{}];
for(var _10 in _8){
for(var i=0;i<_15.length;i++){
var _16=_14==null?_2:_2.findAll(_14.get(i));
var _17=isc.SimpleType.applySummaryFunction(
_16,this.getField(_10),_8[_10]);
_15.get(i)[_10]=_17}
}
return _15}
,isc.A.resolveClientOnlyIncludeFrom=function isc_DataSource_resolveClientOnlyIncludeFrom(_1,_2,_3){
if(!isc.isAn.Array(_1))_1=[_1];
_2=_2||this.ID;
if(!_3){
_3={}
_3[_2]=_1.duplicate()}else{
if(_3[_2]){
var _4=[];
for(var i=0;i<_1.length;i++){
if(_3[_2].indexOf[_1[i]]==-1){
_4.add(_1[i])}
}
if(_4.length==0)return{};
else{
_3[_2].addList(_4)}
}else{
_3[_2]=_1.duplicate()}
}
var _6=function getForeignKeyRecords(_21,_28,_17,_33,_34){
var _35=_21.getForeignKeyFields();
var _36=_28.getForeignKeyFields();
var _37;
if(_33){
_37=_21.getField(_33)}else{
for(var _12 in _35){
var _13=_21.getField(_12);
if(_28.ID==isc.DataSource.getForeignDSName(_13,_21)){
_37=_13;
break}
}
if(!_37){
for(var _12 in _36){
var _13=_28.getField(_12);
if(_21.ID==isc.DataSource.getForeignDSName(_13)){
_37=isc.clone(
_21.getField(isc.DataSource.getForeignFieldName(_13))
);
_37.foreignKey=_28.ID+"."+_13.name;
break}
}
}
}
if(_37){
var _1=_28.findCacheRecords(
isc.DataSource.getForeignFieldName(_37),
_17[_37.name],
_34
);
var _38=_37.foreignKey.split(".").last(),
_30=_1.isEmpty()?null:_1;
return{
ds:_28.ID,
field:_38,
joinType:_37.joinType||(_28.ID===_2?'outer':'inner'),
records:_30
}
}
return{}}
var _7=this.getFields();
var _8;
var _9=[],
_10=[],
_11=[];
for(var _12 in _7){
var _13=_7[_12];
if(_13.includeFrom!=null){
_9.add(_13)}else if(_13.formula){
if(!_13.$89d){
var _14=_13.formula;
if(!isc.isA.Object(_14)){
_14={
text:_14
}}
_14.replaceMissingVars=false;
_13.$89d=isc.FormulaBuilder.generateFunction(
_14,isc.getValues(_7),null,null,true
)}
_10.add(_13)}else if(_13.template){
if(!_13.$89d){
var _14=_13.template;
if(!isc.isA.Object(_14)){
_14={text:_14}}
_14.replaceMissingVars=false;
_13.$89d=isc.SummaryBuilder.generateFunction(_14,isc.getValues(_7))}
_11.add(_13)}
}
var _15=_1.getLength();
var _16=(this.ID==_2?this:isc.DataSource.get(_2));
for(var i=0;i<_15;i++){
var _17=_1.get(i);
if(_9.length>0){
var _18=isc.clone(_17);
var _19=null;
for(var _20=0;_20<_9.length;_20++){
var _21=_16;
var _22=_18;
_13=_9[_20];
_12=_13.name;
var _23=_13.includeFrom.split(".");
var _24=_23.last();
if(this.includeFromValuesProvided&&_17[_12]!==_8){
continue}
var _25=false;
for(var j=0;j<_23.length-1;j++){
var _27=_23[j];
var _28=isc.DataSource.get(_27);
if(!_28){
var _29="Field "+_12+" defines an includeFrom value that cannot be resolved, because '"+_27+"' does not appear to be loaded.";
isc.logWarn(_29);
_25=true;
break}
if(!_21.clientOnly||!_28.clientOnly){
var _29="Field "+_12+" defines an includeFrom value that cannot be resolved, because '"+_27+"' does not appear to be a clientOnly DataSource.";
isc.logWarn(_29);
_25=true;
break}
_19=_6(_21,_28,_22,_13.includeVia,_3);
if(!_19.field){
var _29="Field "+_12+" defines an includeFrom value that cannot be resolved, because  there does not seem to be a valid foreignKey relationship betweem '"+_21.ID+"' and '"+_28.ID+"'";
isc.logWarn(_29);
_25=true;
break}
if(_19.records){
var _30=_19.records;
if(_30.length==1&&!_13.multiple){
isc.addProperties(_22,_30[0])}
if(_13.includeSummaryFunction){
var _31=isc.addProperties({},isc.SimpleType.$141p(),_13);
var _32=isc.SimpleType.applySummaryFunction(_19.records,_28.getField(_24),_13.includeSummaryFunction,_31);
_22[_24]=_32}
}else{
if(_19.joinType!='outer'){
_17.$225e=true}else{
delete _22[_24]}
}
_21=_28}
if(!_25&&!_17.$225e){
_17[_12]=_22[_24]}
}
}
for(var _20=0;_20<_10.length;_20++){
var _13=_10[_20];
var _12=_13.name;
_17[_12]=_13.$89d(_17)}
for(var _20=0;_20<_11.length;_20++){
var _13=_11[_20];
var _12=_13.name;
_17[_12]=_13.$89d(_17)}
}
}
,isc.A.findCacheRecords=function isc_DataSource_findCacheRecords(_1,_2,_3){
var _4=this.indexCacheData&&
(this.getClientOnlyResponse===isc.DataSource.getInstanceProperty("getClientOnlyResponse"));
if(!_4){
var _5={
"fieldName":_1,
"operator":"equals",
"value":_2
};
var _6=this.getClientOnlyResponse({
"operationType":"fetch",
"data":_5,
"$223f":_3
},null,true);
return _6.data}
if(this.$2475==null)this.$2475={};
if(this.$2475[_1]==null)this.$2475[_1]={};
var _7=this.$2475[_1],
_8;
if(_2==null)_8=this.$1790;
else if(isc.isA.String(_2))_8=_2;
else if(isc.isA.Number(_2)||isc.isA.Boolean(_2))_8=_2+"";
var _9,
_10=_8!=null?_7[_8]:null;
if(_10==null){
var _5={
"fieldName":_1,
"operator":"equals",
"value":_2
};
var _11=this.getCacheData();
_9=this.applyFilter(_11,_5);
if(_8!=null)_7[_8]=_9}else{
_9=_10
}
for(var i=0;i<_9.length;i++){
_9[i]=isc.addProperties({},_9[i]);
this.resolveClientOnlyIncludeFrom(_9[i],this.ID,_3)}
var _13=_9.findAll('$225e',true);
_9.removeList(_13);
return _9}
,isc.A.$2474=function isc_DataSource__updateIndexedCache(_1,_2,_3){
if(this.$2475==null)return;
if(_1!=null&&(_2==null||(_3==null&&_1=="update"))){
_1=null}
for(var _4 in this.$2475){
var _5=this.$2475[_4],
_6=_2&&_2[_4];
switch(_1){
case"add":
if(_5[_6]){
_5[_6].add(_2)}
break;
case"remove":
if(_5[_6]){
var _7=this.findByKeys(_2,_5[_6]);
if(_7!=-1){
_5[_6].removeAt(_7)}else{
}
}
break;
case"update":
if(_3[_4]!=_2[_4]){
if(_5[_3[_4]]){
var _7=this.findByKeys(_2,_5[_3[_4]]);
_5[_3[_4]].removeAt(_7)}
if(_5[_6]){
var _7=this.findByKeys(_2,_5[_6]);
if(_7==-1){
_5[_6].add(_2)}else{
_5[_6][_7]=_2}
}
}else if(_5[_6]){
var _7=this.findByKeys(_2,_5[_6]);
if(_7!=-1){
_5[_6][_7]=_2}else{
_5.add(_2)}
}
break;
default:
this.$2475=null}
if(this.$2475==null)break}
}
,isc.A.getClientOnlyFetchResponse=function isc_DataSource_getClientOnlyFetchResponse(_1,_2,_3){
var _4=_1.data;
if(isc.isAn.Array(_4))_4=_4[0];
this.resolveClientOnlyIncludeFrom(_2,null,_1.$223f);
var _5=this.getOperationBinding(_1);
var _6=_1.summaryFunctions||_5.summaryFunctions;
var _7;
var _8=isc.addProperties({},_4);
for(var _9 in _6){
_8=isc.DS.removeCriteriaForField(_8,_9);
var _10=this.getFieldCriterion(_4,_9);
if(_7){
_7=
this.combineCriteria(_7,_10,_4.operator,
_1.textMatchStyle)}else{
_7=_10}
}
var _11=this.applyFilter(_2,_8,_1),
_12=_11,
_13={
status:0
};
var _14=_11.findAll('$225e',true);
_11.removeList(_14);
var _15=this.applyClientSummaries(_1,_11);
var _16=!_7?_15:this.applyFilter(_15,_7,_1);
var _17=_1.startRow||0,
_18=_1.endRow||_16.length,
_19=_16.length;
if(this.supportsClientOnlyProgressiveLoading&&
(_1.progressiveLoading==true||
(this.progressiveLoading==true&&_1.progressiveLoading==null)))
{
if(this.endGap==null)this.endGap=20;
var _20=(_18+this.endGap);
if(_19>_20){
this.logInfo("ClientOnly ListGrid respecting progressiveLoading flag - advertising totalRows:"+
_20+". Actual filtered data set length:"+_16.length+
". (To disable support for clientOnly progressiveLoading, dataSource.supportsClientOnlyProgressiveLoading may be set to false).");
_19=_20;
_16.length=_19;
_13.progressiveLoading=true}
}
var _21=isc.shallowClone(_1.sortBy);
if(_21){
if(!isc.isAn.Array(_21))_21=[_21];
if(isc.isAn.Object(_21[0])){
_21=isc.DS.getSortBy(_21)
}
var _22=[],
_23=null;
var _24=_21.length;
if(_3==true){
_22=new Array(_24);
_23=new Array(_24)}
for(var i=0;i<_24;i++){
var _26=true;
if(_21[i].startsWith("-")){
_21[i]=_21[i].substring(1);
_26=false}
_22[i]=_26;
if(_3==true)_23[i]=this}
if(_3==true)_16.sortByProperties(_21,_22,null,_23);
else _16.sortByProperties(_21,_22)}
_18=Math.min(_18,_19);
_12=_16.slice(_17,_18);
_13.startRow=_17;
_13.endRow=_18;
_13.totalRows=_19;
return[_13,_12]}
,isc.A.$109x=function isc_DataSource__trackClientOnlyChanges(_1,_2){
var _3=this.getPrimaryKeyFieldName();
switch(_2){
case'add':
if(!this.$109y)this.$109y={};
this.$109y[_1.data[_3]]=_1.data;
break;
case'update':
if(!this.$109z)this.$109z={};
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={};
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=null;
if(this.$109z)this.$109z=null;
if(this.$1090)this.$1090=null;
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&&_5.inheritsFrom){
_5=isc.SimpleType.getType(_5.inheritsFrom)}
if(_5=="date"||_5=="datetime"||_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.A.applyCreatorAndModifierFields=function isc_DataSource_applyCreatorAndModifierFields(_1,_2){
if(this.contactsServer()){
return _1}
var _3=new Date();
var _4=this.getFields();
for(var _5 in _4){
var _6=_4[_5];
if(_6.type=="modifierTimestamp"){
_1[_5]=_3}else if(_2&&_6.type=="creatorTimestamp"){
_1[_5]=_3}
}
return _1}
,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(_2==null||_5==null||!isc.isAn.Object(_5))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]];
var _10=this.getField(_6[i]).type;
if(isc.SimpleType.inheritsFrom(_10,"date")||
isc.SimpleType.inheritsFrom(_10,"datetime")||
isc.SimpleType.inheritsFrom(_10,"time"))
{
_8=true}
}
var _11,
_12=isc.DataSource.getPrototype()["applyFilter"]==this.applyFilter;
if(_12){
if(!_8)return _2.findByKeys(_5,this,_3,_4);
_11=this.recordIndicesMatchingFilter(_2,_7,{},_3,_4)}else{
_11=this.applyFilter(_2,_7,{},_3,_4)}
if(!_11||_11.length==0)return-1;
if(_11.length>1){
this.logWarn("Searching by primaryKey, found "+_11.length+" records when there should only be one - returning the first.  PrimaryKey set was: "+isc.echoAll(_7))}
return _12?_11[0]:_2.indexOf(_11[0],_3,_4)}
,isc.A.applyFilter=function isc_DataSource_applyFilter(_1,_2,_3,_4,_5){
var _6=[];
if(!_1||_1.length==0)return _6;
if(this.autoConvertRelativeDates==true&&
this.autoConvertRelativeDatesMode!="server")
{
if(this.logIsInfoEnabled("relativeDates")){
this.logInfo("Calling convertRelativeDates from applyFilter - data is\n\n"+
isc.echoFull(_2))}
_2=this.convertRelativeDates(_2);
if(this.logIsInfoEnabled("relativeDates")){
this.logInfo("Called convertRelativeDates from applyFilter - data is\n\n"+
isc.echoFull(_2))}
}
if(this.isAdvancedCriteria(_2)){
var _7=this.normalizeAdvancedCriteria(_2);
return this.recordsMatchingAdvancedFilter(_1,_7,
_3,_4,_5)}
return this.recordsMatchingFilter(_1,_2,_3,_4,_5)}
,isc.A.$1859=function isc_DataSource__hasMatches(_1,_2,_3){
var _4=this.applyFilter(_1,_2,_3);
return _4!=null&&_4.length>0}
,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,
_15=this.arrayCriteriaForceExact,
j;
if(_15==null){
_15=true}
_4=_4||0;
_5=_5||_1.length;
if(_3&&this.operationBindings){
var _17=_3.operation||{};
if(_17.ID==_17.dataSource+"_"+_17.type){
var _18=this.operationBindings.find({operationId:null,operationType:_17.type})}else{
var _18=this.operationBindings.find({
operationId:_3.operation?_3.operation.ID
:_3.operationId,
operationType:_17.type||_3.operationType
})}
if(_18){
var _19=_18.customCriteriaFields;
if(isc.isA.String(_19)){
_19=_19.split(",");
for(var k=0;k<_19.length;k++){
_19[k]=_19[k].replace(/^\s+|\s+$/g,'')}
}
if(_18.arrayCriteriaForceExact===false||
_18.arrayCriteriaForceExact===true)
{
_15=_18.arrayCriteriaForceExact}
}
}
if(_3&&(_3.arrayCriteriaForceExact===false||
_3.arrayCriteriaForceExact===true))
{
_15=_3.arrayCriteriaForceExact}
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 _22=this.getField(_12,true);
if(_22==null)_22=this.getFieldForDataPath(_12);
if(_22==null&&_3
&&_3.allowFilterOnLinkFields
&&_3.linkDataSource)
{
_22=_3.linkDataSource.getField(_12)}
if(this.dropUnknownCriteria&&!_22){
continue}
var _23=false;
if(isc.isA.List(_19)&&_19.contains(_12)){
_23=true}
if(!_23&&_22&&_22.customSQL)continue;
_13=isc.DataSource.getPathValue(_10,_12,_22,"filter");
_14=_2[_12];
var _24=null;
if(_22){
_24=_22.ignoreTextMatchStyle}
_24=_24||(isc.isAn.Array(_14)&&_15);
if(!this.fieldMatchesFilter(_13,_14,_3,_24))
{
_11=false;
break}
}
if(_11)_9.add(_6?i:_10)}
return _9}
,isc.A.recordMatchesFilter=function isc_DataSource_recordMatchesFilter(_1,_2,_3){
return this.applyFilter([_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||_1.logicalDate)
return(isc.DateUtil.compareLogicalDates(_1,_2)==0);
return(isc.DateUtil.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.evalBoundary;isc.B.push(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,_5){
if(this.logIsInfoEnabled()){
this.logInfo("Comparing criteria, oldCriteria:\n"+this.echo(_2)+
"\nnewCriteria:\n"+this.echo(_1)+
", policy: "+(_4||this.criteriaPolicy))}
if(!_5){
var _6=this.getServerOnlyCriteriaFieldNames(_2,_3),
_7=this.getServerOnlyCriteriaFieldNames(_1,_3),
_8=_6.concat(_7).getUniqueItems()
;
if(_6.length!=_7.length){
this.logInfo("compareCriteria() returning -1 - different serverOnly fields:  old: "+_6.join(",")+" -- new: "+_7.join(","));
return-1}
var _9=this.getRequestOutputs(_3);
if(_9&&_7.intersect(_9).length!=_7.length)
return-1}
if(_2==null)_2={};
var _10=this.getTextMatchStyle(_3?
_3.textMatchStyle:null);
if(this.isAdvancedCriteria(_1)||this.isAdvancedCriteria(_2)){
var _11,
_12;
if(this.isAdvancedCriteria(_1)){
if(this.isAdvancedCriteria(_2)){
if(!_5&&_8.length>0){
_12=this.compareServerOnlyCriteria(_2,_1,
_3,_4,_8);
if(_12!=0){
return-1}
}
_12=this.compareAdvancedCriteria(_1,_2,
_3)}else{
var j=0;
for(var i in _2){
j++;break}
if(j==0)_12=1}
if(_12==_11){
_2=isc.DataSource.convertCriteria(_2,_10,this);
if(!_5&&_8.length>0){
_12=this.compareServerOnlyCriteria(_2,_1,
_3,_4,_8);
if(_12!=0){
return-1}
}
_12=this.compareAdvancedCriteria(_1,_2,
_3)}
}else{
var j=0;
for(var i in _1){
j++;break}
if(j==0){
_12=-1}else{
_1=isc.DataSource.convertCriteria(_1,_10,this);
if(!_5&&_8.length>0){
_12=this.compareServerOnlyCriteria(_2,_1,
_3,_4,_8);
if(_12!=0){
return-1}
}
_12=this.compareAdvancedCriteria(_1,_2,
_3)}
}
if(_12==_11)_12=-1;
_4=_4||this.criteriaPolicy;
if(_4=="dropOnShortening"){
return _12}else{
return _12==0?0:-1}
}
if(!_5){
for(var i=0;i<_8.length;i++){
if(_2[_8[i]]!=_1[_8[i]]){
return-1}
}
}
_4=_4||this.criteriaPolicy;
if(_4=="dropOnShortening"){
if(_10==this.$50i||_10==this.$135s){
return this.dropOnFieldChange(_1,_2,_3)}else{
return this.dropOnShortening(_1,_2,_3)}
}else{
return this.dropOnChange(_1,_2,_3)}
}
,isc.A.getRequestOutputs=function isc_DataSource_getRequestOutputs(_1){
var _2=_1||{};
var _3;
if(_2.operationId){
var _4=this.getOperationBinding(_2.operationId);
if(_4.operationBindings){
if(_4)_4=_4.operationBindings[0];
if(_4.outputs)_3=_4.outputs.split(",")}
}
if(!_3&&_2.outputs){
_3=_2.outputs.split(",")}
if(!_3)return null;
_3=_3.map(function(_5){return _5.trim()});
return _3}
,isc.A.compareServerOnlyCriteria=function isc_DataSource_compareServerOnlyCriteria(_1,_2,_3,_4,_5){
var _6=_5||
this.getServerOnlyCriteriaFieldNames(_1,_3).concat(
this.getServerOnlyCriteriaFieldNames(_2,_3)).getUniqueItems()
;
if(_6.length==0)return 0;
var _7=this.getRequestOutputs(_3);
if(_7&&_6.intersect(_7).length!=_6.length)
return-1;
var _8=isc.DS.extractCriteriaForFields(_1,_6),
_9=isc.DS.extractCriteriaForFields(_2,_6)
;
var _10=this.compareCriteria(_8,_9,_3,_4,true);
if(_10!=0){
_10=-1}
return _10}
,isc.A.getServerOnlyCriteriaFieldNames=function isc_DataSource_getServerOnlyCriteriaFieldNames(_1,_2){
var _3=this.getCriteriaFields(_1);
var _4=this.getRequestOutputs(_2);
var _5=[];
for(var i=0;i<_3.length;i++){
var _7=this.getField(_3[i]);
if(_7&&_7.filterOn=="serverOnly")_5.add(_3[i]);
else if(_4&&!_4.contains(_3[i]))_5.add(_3[i])}
return _5}
,isc.A.getFieldCriterion=function isc_DataSource_getFieldCriterion(_1,_2){
var _3;
if(!_1||!_2){
return _1}
if(_1.fieldName==_2)return _1;
if(_1.criteria){
var _4=_1.criteria.getProperty("fieldName").getUniqueItems();
if(_4.length==1&&_4[0]==_2)return _1;
for(var i=0;i<_1.criteria.length;i++){
_3=this.getFieldCriterion(_1.criteria[i],_2);
if(_3)return _3}
}
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;
for(var i=0;i<_6.length;i++){
var _8=isc.isA.Date(_6[i])?_6[i].getTime():null;
var _9=false;
for(var _10=0;_10<_5.length;_10++){
if(_8!=null&&isc.isA.Date(_5[_10])){
_9=_5[_10].getTime()==_8}else{
_9=_5[_10]==_6[i]}
if(_9)break}
if(!_9)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)||isc.isAn.Array(_9)){
var _10=isc.isAn.Array(_8)?_8:[_8],
_11=isc.isAn.Array(_9)?_9:[_9];
if(_10.length<_11.length){
return-1}else{
for(var i=0;i<_11.length;i++){
var _13=false;
var _14=isc.isA.Date(_9[i])?_9[i].getTime():null;
for(var _15=0;_15<_10.length;_15++){
if(_14!=null&&isc.isA.Date(_10[_15])){
_13=_14==_10[_15].getTime()}else{
_13=_10[_15]==_11[i]}
if(_13)break}
if(!_13)return-1}
}
var _16=_11.length!=_10.length;
if(_16)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];
var _11=this.dropOnShortening_value(_8,_9,_10);
if(_11==-1)return _11;
else if(_11==1)_7=_11}
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.dropOnShortening_value=function isc_DataSource_dropOnShortening_value(_1,_2,_3){
if(_3==null)return-1;
if((this.getField(_1)==null||this.getField(_1).ignoreTextMatchStyle)&&
_2!=_3)
{
return-1}
if(isc.isAn.Array(_2)||isc.isAn.Array(_3)){
var _4=isc.isAn.Array(_2)?_2:[_2],
_5=isc.isAn.Array(_3)?_3:[_3];
if(_4.length<_5.length){
return-1}else{
var _6=_5.length!=_4.length,
_7=_6?1:0;
for(var i=0;i<_5.length;i++){
var _9=-1;
for(var _10=0;_10<_4.length;_10++){
var _11=this.dropOnShortening_value(_1,_4[_10],_5[i]);
if(_11!=-1){
if(_9!=0)_9=_11;
if(_6||_11==0)break}
}
if(_9==-1)return-1;
else if(_9==1)_7=1}
return _7}
}else if(isc.isA.String(_2)){
if(!isc.isA.String(_3))return-1;
if(_3.indexOf(_2)==-1)return-1;
if(_2.length>_3.length)return-1;
if(_2.length<_3.length)return 1}else if(isc.isA.Date(_2)&&isc.isA.Date(_3))
{
if(_2.getTime()!=_3.getTime())return-1}else if(_2!=_3){
return-1}
return 0}
,isc.A.compareDates=function isc_DataSource_compareDates(_1,_2,_3,_4){
var _5=this.getFieldForDataPath(_3),
_6=_4?this.getFieldForDataPath(_4):null
;
if((_5&&isc.SimpleType.inheritsFrom(_5.type,"datetime"))||
(_6&&isc.SimpleType.inheritsFrom(_6.type,"datetime")))
{
return isc.DateUtil.compareDates(_1,_2,true)}else if((_5&&isc.SimpleType.inheritsFrom(_5.type,"time"))||
(_6&&isc.SimpleType.inheritsFrom(_6.type,"time")))
{
return isc.Time.compareLogicalTimes(_1,_2)}else{
return isc.DateUtil.compareLogicalDates(_1,_2,true)}
}
,isc.A.compareValues=function isc_DataSource_compareValues(_1,_2,_3,_4){
if(isc.DateUtil.mapsToDate(_1)&&isc.DateUtil.mapsToDate(_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.A.$238h=function isc_DataSource__isComponentSchemaCandidate(){
if(this.componentSchema||this.builtinSchema)return false;
if(this.$145w||this._autoAssignedID)return false;
return this.ID?!this.ID.startsWith("isc_"):false}
);
isc.B._maxIndex=isc.C+257;
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.trimIncompleteValuePathCriteria=true;
isc.A.$71l={
sum:function(_1,_2,_3,_4,_5){
var _6=0;
for(var i=0;i<_2.length;i++){
var _8=_2[i],
_9=_8.name;
isc.Class.$102q(_8!==_3&&isc.isA.nonemptyString(_9));
if(_4&&_4.$280r(_1,_8))return null;
var _10=_5&&_9 in _5
?_5[_9]
:_9,
_11=_1[_10],
_12=parseFloat(_11);
if(isc.isA.Number(_12)&&_12==_11){
_6+=_12}else{
return null}
}
return _6},
avg:function(_1,_2,_3,_4,_5){
var _6=0,
_7=_2.length;
for(var i=0;i<_7;i++){
var _9=_2[i],
_10=_9.name;
isc.Class.$102q(_9!==_3&&isc.isA.nonemptyString(_10));
if(_4&&_4.$280r(_1,_9))return null;
var _11=_5&&_10 in _5
?_5[_10]
:_10,
_12=_1[_11],
_13=parseFloat(_12);
if(isc.isA.Number(_13)&&_13==_12){
_6+=_13}else{
return null}
}
return _7>0?_6/_7:null},
max:function(_1,_2,_3,_4,_5){
var _6=null,
_7=false;
for(var i=0;i<_2.length;i++){
var _9=_2[i],
_10=_9.name;
isc.Class.$102q(_9!==_3&&isc.isA.nonemptyString(_10));
if(_4&&_4.$280r(_1,_9))return null;
var _11=_5&&_10 in _5
?_5[_10]
:_10,
_12=_1[_11];
if(isc.isA.Date(_12)){
if(_7)return null;
if(i==0)_6=_12.duplicate();
else if(_6.getTime()<_12.getTime())_6=_12.duplicate()}else{
_7=true;
var _13=parseFloat(_12);
if(isc.isA.Number(_13)&&_13==_12){
if(i==0)_6=_13;
else if(_6<_12)_6=_13}else{
return null}
}
}
return _6},
min:function(_1,_2,_3,_4,_5){
var _6=null,
_7=false;
for(var i=0;i<_2.length;i++){
var _9=_2[i],
_10=_9.name;
isc.Class.$102q(_9!==_3&&isc.isA.nonemptyString(_10));
if(_4&&_4.$280r(_1,_9))return null;
var _11=_5&&_10 in _5
?_5[_10]
:_10,
_12=_1[_11];
if(isc.isA.Date(_12)){
if(_7)return null;
if(i==0)_6=_12.duplicate();
else if(_6.getTime()>_12.getTime())_6=_12.duplicate()}else{
_7=true;
var _13=parseFloat(_12);
if(isc.isA.Number(_13)&&_13==_12){
if(i==0)_6=_13;
else if(_6>_12)_6=_13}else{
return null}
}
}
return _6},
multiplier:function(_1,_2,_3,_4,_5){
var _6=null;
for(var i=0;i<_2.length;i++){
var _8=_2[i],
_9=_8.name;
isc.Class.$102q(_8!==_3&&isc.isA.nonemptyString(_9));
if(_4&&_4.$280r(_1,_8))return null;
var _10=_5&&_9 in _5
?_5[_9]
:_9,
_11=_1[_10],
_12=parseFloat(_11);
if(isc.isA.Number(_12)&&_12==_11){
if(i==0)_6=_12;
else _6*=_12}else{
return null}
}
return _6}
};
isc.A.$280l={
sum:isc.DataSource.$2811,
avg:isc.DataSource.$2811,
max:isc.DataSource.$2811,
min:isc.DataSource.$2811,
multiplier:isc.DataSource.$2811
};
isc.A.exportFormatToFileExtensionMap={
xml:"xml",
json:"json",
csv:"csv",
xls:"xls",
ooxml:"xlsx"
};
isc.B.push(isc.A.onRealtimeUpdate=function isc_c_DataSource_onRealtimeUpdate(_1){
var _2=isc.DS.get(_1.dataSourceName);
if(!_2)return;
_2.onRealtimeUpdate(_1)}
,isc.A.applyFilter=function isc_c_DataSource_applyFilter(_1,_2,_3,_4,_5){
var _6=[];
if(!_1||_1.length==0)return _6;
if(this.$901==null){
this.$901=isc.DataSource.create({
fields:[{name:"$902"}],
dropUnknownCriteria:false,
clientOnly:true
})}else{
if(this.$901.$219m){
this.$901.getFieldForDataPath=this.$901.$219m;
delete this.$219m}
if(this.$901.$219n){
this.$901.getDataSourceForDataPath=this.$901.$219n;
delete this.$219n}
}
if(_5){
this.$901.addMethods({
$219m:this.$901.getFieldForDataPath,
getFieldForDataPath:function(_9){
var _7=_5.call(_3,_9,_4);
return(_7?_7.field:null)},
$219n:this.$901.getDataSourceForDataPath,
getDataSourceForDataPath:function(_9){
var _7=_5.call(_3,_9,_4);
return(_7?_7.dataSource:null)}
})}
var _8=this.$901.applyFilter(_1,_2);
return _8}
,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,_6){
return _5&&_5.getCriterion(_3,_6)}
}
isc.DataSource.$57z[_1.ID]=_1}
,isc.A.getSearchOperators=function isc_c_DataSource_getSearchOperators(){
return isc.DataSource.$57z}
,isc.A.getSearchOperator=function isc_c_DataSource_getSearchOperator(_1,_2){
return this.$57z[_1]}
,isc.A.getTypeOperators=function isc_c_DataSource_getTypeOperators(_1,_2){
_1=_1||"text";
var _3=[],
_4=isc.SimpleType.getType(_1),
_5=_2&&_2.$570
;
if(_5){
while(_4&&!_5[_4.name]){
if(!_4||!_4.inheritsFrom)break;
_4=isc.SimpleType.getType(_4.inheritsFrom,_2)}
if(_4){
var _6=_5.$170k,
_7=_6&&_6[_4.name]!=false
;
if(_5[_4.name]){
_3.addList(_5[_4.name])}
_3.addList(_5["_all_"]);
if(!_7&&_3.length>0){
var _8=isc.SimpleType.getValidOperators(_4.name);
if(_8){
_3=_3.intersect(_8)}
return _3}
}
}
_5=isc.DataSource.$570;
_4=isc.SimpleType.getType(_1);
while(_4&&!_5[_4.name]){
if(!_4||!_4.inheritsFrom)break;
_4=isc.SimpleType.getType(_4.inheritsFrom,_2)}
if(_4&&_5[_4.name]){
_3.addList(_5[_4.name])}
_3.addList(_5["_all_"]);
if(_4){
var _9=isc.SimpleType.getValidOperators(_4.name);
if(_9){
_3=_3.intersect(_9)}
}
_3=_3.getUniqueItems();
return _3}
,isc.A.isBinaryType=function isc_c_DataSource_isBinaryType(_1){
if(_1==null)return false;
if(_1=="binary"||_1=="blob"||_1=="imageFile"||
isc.SimpleType.inheritsFrom(_1,"binary"))
{
return true}
return false}
,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.hasCustomTypeOperators=function isc_c_DataSource_hasCustomTypeOperators(_1,_2){
if(_2){
var _3=_2.$570;
return _3&&_3[_1]&&
_3.$170k&&_3.$170k[_1]==false}
return isc.DataSource.$570&&isc.DataSource.$570[_1]!=null}
,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){
if((_3||this).isAdvancedCriteria(_1)){
if(this.logIsDebugEnabled("criteriaTrace")){
this.logDebug("convertCriteria no-op for: "+isc.echoFull(_1),"criteriaTrace")}
return _1}
var _4={
__normalized:true,
_constructor:"AdvancedCriteria",
operator:"and"
}
if(this.logIsInfoEnabled("criteriaTrace")){
var _5="convertCriteria(criteria: ";
if(!_1)_5+="null"
else _5+=((_3||this).isAdvancedCriteria(_1)?"Advanced":"Simple");
_5+=", textMatchStyle: "+_2;
_5+=", ds: "+(_3?_3.getID():"null")+")";
this.logInfo(_5,"criteriaTrace");
if(this.logIsDebugEnabled("criteriaTrace")){
this.logDebug("Criteria: "+isc.echoFull(_1),"criteriaTrace")}
}
var _6=[];
for(var _7 in _1){
var _8=_3==null?null:_3.getField(_7),
_9=_3==null?null:this.$135t[_3.defaultTextMatchStyle],
_10=null;
if(_8!=null){
if(_8.ignoreTextMatchStyle){
_10=_3.ignoreTextMatchStyleCaseSensitive?"equals":"iEquals"
}
}
if(isc.isAn.Array(_1[_7])){
var _11={
__normalized:true,
_constructor:"AdvancedCriteria",
operator:"or",
criteria:[]
}
for(var i=0;i<_1[_7].length;i++){
var _13=_1[_7][i];
if(!_10)_10=this.getCriteriaOperator(_13,
_2,_9);
if(_13==null&&
!this.criteriaConversion_OperatorKeepNullValue[_10]){
if(this.logIsInfoEnabled("criteriaTrace")){
this.logInfo("Skipping null value for "+_7+" - operator '"+_10+" does not support null.",
"criteriaTrace"
)}
continue}
_11.criteria.add({
__normalized:true,
fieldName:_7,
operator:_10,
value:_13
})}
if(_11.criteria.length>0){
_6.add(_11)}
}else{
var _13=_1[_7];
if(!_10)_10=this.getCriteriaOperator(_13,
_2,_9);
if(_13==null&&
!this.criteriaConversion_OperatorKeepNullValue[_10]){
if(this.logIsInfoEnabled("criteriaTrace")){
this.logInfo("Skipping null value for "+_7+" - operator '"+_10+" does not support null.",
"criteriaTrace"
)}
continue}
_6.add({
__normalized:true,
fieldName:_7,
operator:_10,
value:_1[_7]
})}
}
_4.criteria=_6;
if(this.logIsDebugEnabled("criteriaTrace")){
this.logDebug("Criteria: "+isc.echoFull(_1),"criteriaTrace")}
return _4}
,isc.A.getCriteriaOperator=function isc_c_DataSource_getCriteriaOperator(_1,_2,_3,_4){
var _5;
if(isc.isA.Number(_1)||isc.isA.Date(_1)||isc.isA.Boolean(_1)){
_5="equals"}else if(_2=="exactCase"){
_5="equals"}else if(_2=="equals"||_2=="exact"){
_5="iEquals"}else if(_2=="startsWith"){
_5="iStartsWith"}else if(_2=="substring"){
_5="iContains"}else{
if(_3)return _3;
if(_1==null)_5="equals";
else _5="iContains"}
if(this.logIsInfoEnabled("criteriaTrace")){
this.logInfo("getCriteriaOperator():\n "+
isc.echoFull({
value:_1,textMatchStyle:_2,
defaultOperator:_3,strict:_4,
RESULT:_5
}),"criteriaTrace"
)}
return _4?null:_5}
,isc.A.combineCriteria=function isc_c_DataSource_combineCriteria(_1,_2,_3,_4,_5,_6){
if(!_1||isc.isAn.emptyObject(_1))return _2;
if(!_2||isc.isAn.emptyObject(_2))return _1;
if(!_3)_3="and";
if(_3!="and"&&_3!="or"){
isc.logWarn("combineCriteria called with invalid outerOperator '"+
_3+"'");
return null}
if(this.logIsInfoEnabled("criteriaTrace")){
var _7="combineCriteria(criteria1: ";
if(!_1)_7+="null"
else _7+=((_6||this).isAdvancedCriteria(_1)?"Advanced":"Simple");
_7+=", criteria2: ";
if(!_2)_7+="null"
else _7+=((_6||this).isAdvancedCriteria(_2)?"Advanced":"Simple");
_7+=", outerOp: "+_3+", textMatchStyle: "+_4;
_7+=", ds: "+(_6?_6.getID():"null")+")";
this.logInfo(_7,"criteriaTrace")}
var _8,_9;
if(!_5&&!isc.DS.isAdvancedCriteria(_1)&&
!isc.DS.isAdvancedCriteria(_2)&&
_3=="and")
{
for(var _10 in _1){
if(_2[_10]!=_8&&_2[_10]!==_1[_10]){
_9=true;
break}
}
}else{
_9=true}
if(!_9){
if(this.logIsInfoEnabled("criteriaTrace")){
this.logInfo("combineCriteria() -- both criteria are simple - returning simpleCrit","criteriaTrace")}
return isc.addProperties({},_1,_2)}
var _11,_12;
if(_5||isc.DS.isAdvancedCriteria(_1)||
(_1.fieldName&&
_1.operator&&isc.DS.$57z[_1.operator])){
_11=_1}else{
_11=isc.DataSource.convertCriteria(_1,_4,_6);
if(this.logIsInfoEnabled("criteriaTrace")){
this.logInfo("combineCriteria() -- converting criteria1 to advanced:\n"+
this.logIsDebugEnabled("criteriaTrace")?isc.echoFull(_11):"",
"criteriaTrace")}
}
if(_5||isc.DS.isAdvancedCriteria(_2)||
(_2.fieldName&&
_2.operator&&isc.DS.$57z[_2.operator])){
_12=_2}else{
_12=isc.DataSource.convertCriteria(_2,_4,_6);
if(this.logIsInfoEnabled("criteriaTrace")){
this.logInfo("combineCriteria() -- converting criteria2 to advanced:\n"+
this.logIsDebugEnabled("criteriaTrace")?isc.echoFull(_12):"",
"criteriaTrace")}
}
var _13={operator:_3};
if(!_5){
_13._constructor="AdvancedCriteria"}
if(_11.operator==_3&&_12.operator==_3){
_13.criteria=[];
_13.criteria.addAll(_11.criteria);
_13.criteria.addAll(_12.criteria);
_13.criteria.removeEmpty()}else{
_13.criteria=[_11,_12]}
if(this.logIsInfoEnabled("criteriaTrace")){
this.logInfo("combineCriteria() -- returning:\n"+isc.echoFull(_13),"criteriaTrace")}
return _13}
,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.compressNestedCriteria=function isc_c_DataSource_compressNestedCriteria(_1,_2,_3){
if(!_1)return null;
if(isc.isAn.emptyObject(_1)||!_1.criteria||_1.criteria.length==0)return _1;
_2=_2||_1.operator||"and";
if(_1.criteria.length==1){
var c=_1.criteria[0];
if(_3&&!c.criteria&&_1.operator!="not")return c;
if(c.criteria&&(_1.operator!="not"||c.criteria.length==1)){
if(_1.operator=="not"){
c=isc.addProperties({},c);
c.operator=c.operator=="not"?"and":"not"}
if(_1._constructor=="AdvancedCriteria"&&!_3){
c._constructor=_1._constructor}
_1=c}
}
if(_3&&isc.DS.canFlattenCriteria(_1)){
_1=isc.DS.flattenCriteria(_1)}
var _5=_1.criteria;
if(_5){
_5.removeEmpty();
for(var i=0;i<_5.length;i++){
var _7=_5[i];
if(!_7)continue;
if(!_7.criteria){
if(_7.fieldName&&_7.operator&&_7._constructor=="AdvancedCriteria")
delete _7._constructor;
_5[i]=_7}else{
_5[i]=this.compressNestedCriteria(_7,_2,true)}
}
_5.removeEmpty();
if(_5.length==1){
var _8=_5[0];
if(_8.criteria&&_8.operator==_1.operator){
_1=_5[0]}
}
}
if(_1.fieldName&&!_1.criteria&&_1._constructor=="AdvancedCriteria"){
delete _1._constructor}
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}
var _3=isc.DS.copyCriteria(_1);
isc.DS.$167m(_3,_2);
if(_3.criteria&&_3.criteria.length==0)_3=null;
return _3}
,isc.A.$167l=function isc_c_DataSource__criteriaHasValuePath(_1){
var _2=false,
_3=_1.operator
;
if(_3=="and"||_3=="or"||_3=="not"){
var _4=_1.criteria||[];
if(!isc.isAn.Array(_4))_4=[_4];
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"||_3=="not"){
var _4=_1.criteria;
if(!isc.isAn.Array(_4))_4=[_4];
for(var i=0;i<_4.length;i++){
var _6=isc.DS.$167m(_4[i],_2);
if(this.trimIncompleteValuePathCriteria&&_6==false)
_4[i]=null}
_4.removeEmpty()}
if(_1.valuePath!=null){
var _7=_1.valuePath.replace(/\./g,"/");
var _8=isc.Canvas.$70o(_7,null,_2);
if(_8==null&&this.trimIncompleteValuePathCriteria){
return false}
_1.value=_8;
if(_1.value==null&&
(_1.operator=="contains"||_1.operator=="iContains"))
{
_1.value=""}
}
return true}
,isc.A.removeCriteriaForField=function isc_c_DataSource_removeCriteriaForField(_1,_2){
if(!_1||!_2){
return _1}
var _3=isc.isAn.Object(_2)?_2.name:_2;
if(_1.criteria){
for(var i=_1.criteria.length-1;i>=0;i--){
if(_1.criteria[i].criteria){
this.removeCriteriaForField(_1.criteria[i],_2)}else{
if(_1.criteria[i].fieldName==_3)_1.criteria.removeAt(i)}
}
}else{
if(_1.fieldName==_3)_1=null}
return _1}
,isc.A.extractCriteriaForFields=function isc_c_DataSource_extractCriteriaForFields(_1,_2){
var _3=isc.DS.copyCriteria(_1);
var _4=isc.DS.$257c(_3,_2);
return _4}
,isc.A.$257c=function isc_c_DataSource__extractCriteriaForFields(_1,_2){
if(!_1||!_2){
return _1}
if(_1.criteria){
for(var i=_1.criteria.length-1;i>=0;i--){
if(_1.criteria[i].criteria){
this.$257c(_1.criteria[i],_2)}else{
if(!_2.contains(_1.criteria[i].fieldName)){
_1.criteria.removeAt(i)}
}
}
}else{
if(!_2.contains(_1.fieldName))_1=null}
return _1}
,isc.A.validateCriteria=function isc_c_DataSource_validateCriteria(_1,_2,_3,_4,_5,_6){
if(this.isAdvancedCriteria(_1)){
var _7=isc.isA.DataSource(_2)?_2:null;
var _8=this.normalizeAdvancedCriteria(_1,true,_6,_7);
var _9=this.getSearchOperator(_8.operator,_7);
if(!_9){
}else if(_9.valueType=="criteria"){
if(isc.isAn.Array(_8.criteria)){
var _10=[];
for(var i=0;i<_8.criteria.length;i++){
_10[i]=this.validateCriteria(_8.criteria[i],
_2,_3,_4,_5,true)}
_8.criteria=_10}else if(isc.isAn.Object(_8.criteria)){
_8.criteria=this.validateCriteria(_8.criteria,
_2,_3,_4,_5,true)}
}else if(_8.fixedValue==null){
var _12=_4.call(_2,_8.fieldName,_3);
if(_12){
if((_9.valueType==null||_9.valueType=="fieldType"||
_9.valueType=="fieldName"||_9.valueType=="valueRange")&&
_9.caseInsensitive&&_9.$264v&&
!isc.SimpleType.inheritsFrom(_12,"text"))
{
_8.operator=_9.$264v;
_9=this.getSearchOperator(_8.operator,_7)}
if(_9.valueType=="none"){
delete _8.value}else if(_9.valueType=="fieldType"){
this.processTypeValidators(_8,_12)}else if(_9.valueType=="valueSet"){
var _13=_5&&_5.call(_2,_8.fieldName,_3);
if(_13&&_13.field.multipleStorage=="simpleString"&&
isc.isA.String(_8.value))
{
var _14=_13.field.multipleStorageSeparator||",";
if(_8.value.contains(_14)){
_8.value=_8.value.split(_14)}
}
if(!isc.isAn.Array(_8.value))_8.value=[_8.value];
for(var i=0;i<_8.value.length;i++){
var _15={value:_8.value[i]};
this.processTypeValidators(_15,_12);
if(_8.value[i]!==_15.value)_8.value[i]=_15.value}
}else if(_9.valueType=="valueRange"){
var _16={value:_8.start},
_17={value:_8.end}
;
this.processTypeValidators(_16,_12);
this.processTypeValidators(_17,_12);
if(_8.start!==_16.value)_8.start=_16.value;
if(_8.end!==_17.value)_8.start=_17.value}
}
}
return _8}else{
var _8=isc.addProperties({},_1);
for(var _18 in _8){
var _12=_4.call(_2,_18,_3);
if(_12){
var _19={value:_8[_18]};
this.processTypeValidators(_19,_12);
_8[_18]=_19.value}
}
return _8}
}
,isc.A.processTypeValidators=function isc_c_DataSource_processTypeValidators(_1,_2){
var _3=_2.validators||[];
var _4=true;
for(var i=0;i<_3.length&&_4;i++){
if(_3[i].$174l){
var _6={value:_1.value};
_4=_4&&isc.Validator.processValidator(null,
_3[i],_1.value,
null,_6,{dataSource:this.ID});
if(_4&&_3[i].resultingValue!=null){
_1.value=_3[i].resultingValue}
}
}
}
,isc.A.combineFieldData=function isc_c_DataSource_combineFieldData(_1,_2,_3,_4){
if(_2==null)return _1;
if(_4!=null&&_2[_4]!=null){
_2=isc.addProperties({},_2,_2[_4])}
for(var _5 in _2){
if(_5=="__ref"||
_5=="__module")
{
continue}
if(_5=="validators"&&_2.validators!=_1.validators){
var _6=(isc.SimpleType.getBaseType(_1.type)!=isc.SimpleType.getBaseType(_2.type));
if(_2.validators.$69&&_6){
continue}
for(var i=0;i<_2.validators.length;i++){
var _8=_2.validators[i];
if(_8.$174l&&_6){
continue}
if(_1.validators==null)_1.validators=[];
if(!_1.validators.contains(_8)&&
(!_8.ID||!_1.validators.find("ID",_8.ID)))
{
if(_1.validators.$69){
_1.validators=_1.validators.duplicate()}
if(!_8._generated&&!_8.$2399){
_8=isc.addProperties({},_8);
_8.$240a=true}
_1.validators.add(_8)}
}
continue}
if(!this.dontDuplicateEditorProperties){
if(_5=="editorProperties"){
_1.editorProperties=
isc.addProperties({},_2.editorProperties,_1.editorProperties);
continue}
}
if(_5=="editorType"&&_1.editorType=="FormItem"){
delete _1.editorType}
if(isc.propertyDefined(_1,_5))continue;
if(_5=="name")continue;
if(!_3&&_5=="hidden")continue;
_1[_5]=_2[_5]}
return _1}
,isc.A.$280m=function isc_c_DataSource___recordSummaryStringMethodToFunction(_1){
return isc.Func.expressionToFunction("record,fields,summaryField",_1)}
,isc.A.applyRecordSummaryFunction=function isc_c_DataSource_applyRecordSummaryFunction(_1,_2,_3,_4,_5,_6){
if(!_2||!_3)return;
if(_1==null)_1="sum";
if(isc.isA.String(_1)){
if(this.$71l[_1]){
_1=this.$71l[_1]}else{
_1=this.$280m(_1)}
}
if(isc.isA.Function(_1)){
return _1(_2,_3,_4,_5,_6)}
}
,isc.A.getRecordSummaryFunctionDependencies=function isc_c_DataSource_getRecordSummaryFunctionDependencies(_1,_2,_3,_4){
if(!_2)return;
if(_1==null)_1="sum";
var _5;
if(isc.isA.String(_1)){
_5=this.$280l[_1]}
if(isc.isA.Function(_5)){
return _5(_2,_3,_4)}
}
,isc.A.registerRecordSummaryFunction=function isc_c_DataSource_registerRecordSummaryFunction(_1,_2,_3){
if(isc.isA.String(_2)){
_2=this.$280m(_2)}
this.$71l[_1]=_2;
if(isc.isA.String(_3)){
_3=isc.Func.expressionToFunction("fields,summaryField",
_3)}
this.$280l[_1]=_3}
,isc.A.addExportFilenameExtension=function isc_c_DataSource_addExportFilenameExtension(_1,_2){
if(_2=="custom")return _1;
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){
if(!_2)_2={}
_2=isc.DataSource.dupRequest(_2);
var _5=_2.exportContext||_2||{},
_6=_5&&_5.exportAs?_5.exportAs:"csv",
_7=_5&&_5.exportDisplay?_5.exportDisplay:"download",
_8=_5.transport||_5.exportToClient===false?
"xmlHttpRequest":"hiddenFrame",
_9=_5.downloadToNewWindow!=null?
_5.downloadToNewWindow:(_7=="window")
;
var _10=_6;
if(_2.operationId!=null){
var _11=_4.getOperationBinding("clientExport",
_2.operationId);
if(_11!=null&&_11.exportAs){
_10=_11.exportAs}
}
var _12=this.addExportFilenameExtension(_5&&_5.exportFilename?
_5.exportFilename:"export",_10),
_13=_7=="window"||_7=="download"&&
_5.transport=="xmlHttpRequest"?_12:null
;
var _14={
showPrompt:false,
transport:_8,
exportResults:true,
exportDisplay:_7,
targetMainWindow:_5.targetMainWindow,
downloadResult:!(_5.exportToClient===false),
downloadToNewWindow:_9,
download_filename:_13,
exportFilename:_12,
params:_5.params
};
var _15={
exportAs:_6,
exportClientData:true,
exportDisplay:_7,
exportFilename:_12,
exportPath:_5.exportPath,
exportToClient:_5.exportToClient,
exportToFilesystem:_5.exportToFilesystem,
exportDelimiter:_5.exportDelimiter,
exportFields:_5.exportFields,
exportHeader:_5.exportHeader,
exportHeaderless:_5.exportHeaderless,
exportFooter:_5.exportFooter,
exportDatesAsFormattedString:_5.exportDatesAsFormattedString,
exportNumbersAsFormattedString:_5.exportNumbersAsFormattedString,
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)_15.headerSpans=_5.headerSpans;
if(_5.exportHeaderSpans)_15.exportHeaderSpans=_5.exportHeaderSpans;
if(_5.exportOtherFields)_15.exportOtherFields=_5.exportOtherFields;
if(_5.exportShowHeaderSpanTitles!=null){
_15.exportShowHeaderSpanTitles=_5.exportShowHeaderSpanTitles}
if(_5.exportSpanTitleSeparator!=null){
_15.exportSpanTitleSeparator=_5.exportSpanTitleSeparator}
if(!_15.exportFieldTitles&&_4){
var _16=_15.exportFields||_4.getFieldNames();
var _17={};
for(var i=0;i<_16.length;i++){
var _19=_16[i];
var _20;
if(isc.isA.String(_19)){
_20=_19;
_19=_4.getField(_20)}
if(_19){
if(_19.hidden)continue;
_17[_19.name]=_19.exportTitle||_19.title}else{
_17[_20]=_20}
}
_15.exportFieldTitles=_17}
if(_5.formulaFields)_15.formulaFields=_5.formulaFields;
if(_5.formulaRemap)_15.formulaRemap=_5.formulaRemap;
if(_5.exportHeaderHeight!=null){
_15.exportHeaderHeight=_5.exportHeaderHeight}
if(_5.exportFieldPixelWidths){
_15.exportFieldPixelWidths=_5.exportFieldPixelWidths;
_15.exportWidthScale=_5.exportWidthScale}
_15.exportWrapHeaderTitles=_5.exportWrapHeaderTitles;
if(_5.exportWrapCells!=null){
_15.exportWrapCells=_5.exportWrapCells}
if(_5.exportColumnWidthPadding!=null){
_15.exportColumnWidthPadding=
_5.exportColumnWidthPadding}
if(_5.exportAlignments){
_15.exportAlignments=_5.exportAlignments}
if(_5.exportStreaming!=null){
_15.exportStreaming=_5.exportStreaming}
if(_5.exportPropertyIdentifier){
_15.exportPropertyIdentifier=_5.exportPropertyIdentifier}
var _21=_2.operationId;
if(_4==null||_21==null){
isc.DMI.callBuiltin({
methodName:"downloadClientExport",
arguments:[_1,_6,_12,_7,_15],
requestParams:_14,
callback:_3
})}else{
isc.addProperties(_14,{parameters:_15});
_4.performClientExportOperation(_21,_1,_3,_14)}
}
);
isc.evalBoundary;isc.B.push(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+34;
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.setRealtimeUpdates=function isc_DataSource_setRealtimeUpdates(_1){
this.logDebug("Setting realtimeUpdates: "+_1);
this.realtimeUpdates=_1;
if(!_1)return;
if(isc.Messaging){
if(!isc.Messaging.getSubscribedChannels().contains("ISC_DataSourceDataChanged")){
this.logInfo("registering for realtime datasource updates");
isc.Messaging.subscribe("ISC_DataSourceDataChanged",isc.DataSource.onRealtimeUpdate)}
}else{
if(isc.hasOptionalModule("RealtimeMessaging")){
this.logWarn("realtimeUpdates require RealtimeMessaging")}else{
this.logWarn("Please load the RealtimeMessaging module to use realtimeUpdates")}
}
}
,isc.A.onRealtimeUpdate=function isc_DataSource_onRealtimeUpdate(_1){
if(!this.realtimeUpdates)return;
var _2=_1.data;
var _3={
dataSource:this,
httpResponseCode:200,
data:_2
};
var _4={
operationId:_1.operationId,
operationType:_1.operationType,
dataSource:this
}
this.updateCaches(_3,_4)}
,isc.A.supportsAdvancedCriteria=function isc_DataSource_supportsAdvancedCriteria(){
if(this.allowAdvancedCriteria===false)return false;
if(this.clientOnly||this.cacheData)return true;
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,_3){
return isc.DS.normalizeAdvancedCriteria(_1,_2,_3,this)}
,isc.A.validateCriteria=function isc_DataSource_validateCriteria(_1,_2){
return isc.DS.validateCriteria(
_1,
this,
_2,
this.$264w,
this.$264x)}
,isc.A.$264w=function isc_DataSource__validateCriteriaTypeResolver(_1,_2){
var _3=this.$264x(_1);
return _3&&(_3.$62||isc.SimpleType.getType(_3.type||"text"))}
,isc.A.$264x=function isc_DataSource__validateCriteriaFieldResolver(_1,_2){
return this.getFieldForDataPath(_1)}
,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;_3<this.$570.length;_3++){
this.$570[_3].remove(_1.ID)}
for(var _3=0;_3<_2.length;_3++){
if(!this.$570[_2[_3]]){
this.$570[_2[_3]]=[_1.ID]}
if(!this.$570[_2[_3]].contains(_1.ID)){
this.$570[_2[_3]].add(_1.ID)}
this.$570.$170k[_2[_3]]=true}
}else{
if(!this.$570["_all_"]){
this.$570["_all_"]=[_1.ID]}
if(!this.$570["_all_"].contains(_1.ID)){
this.$570["_all_"].add(_1.ID)}
}
}
,isc.A.getSearchOperator=function isc_DataSource_getSearchOperator(_1){
return isc.DS.getSearchOperator(_1,this)}
,isc.A.getTypeOperators=function isc_DataSource_getTypeOperators(_1){
return isc.DataSource.getTypeOperators(_1,this)
}
,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.hasCustomTypeOperators=function isc_DataSource_hasCustomTypeOperators(_1){
return isc.DataSource.hasCustomTypeOperators(_1,this)}
,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.getFieldDefaultOperator=function isc_DataSource_getFieldDefaultOperator(_1,_2){
if(isc.isA.String(_1))_1=this.getField(_1);
if(!_1)return null;
if(_1&&_1.defaultOperator)return _1.defaultOperator;
else if(_2)return null;
var _3=isc.SimpleType.getType(_1.type);
var _4=_1.type||"text";
if(!_3)_4="text";
return isc.SimpleType.getDefaultOperator(_4)}
,isc.A.getFieldOperatorMap=function isc_DataSource_getFieldOperatorMap(_1,_2,_3,_4,_5){
if(isc.isA.String(_1))_1=this.getField(_1);
if(!_1)return;
var _6={},
_7=this.hasCustomTypeOperators(_1.type),
_5=_5||this.getFieldOperators(_1);
_2=_2||_1.validOperators!=null;
for(var _8=0;_8<_5.length;_8++){
var _9=_5[_8];
var _10=this.getSearchOperator(_9);
if(!_10)continue;
if(!_1.extraOperators||!_1.extraOperators.contains(_9)){
if(_10.hidden&&(!_2&&!_7)&&
(!isc.isAn.Array(_1.validOperators)||
!_1.validators.contains(_9)))continue}
if(!_3||(_10.valueType==_3)==!_4){
_6[_5[_8]]=isc.DS.$1780(_1,_10)}
}
return _6}
,isc.A.getTypeOperatorMap=function isc_DataSource_getTypeOperatorMap(_1,_2,_3,_4){
var _5={},
_6=this.getTypeOperators(_1),
_7=this.hasCustomTypeOperators(_1)
;
for(var _8=0;_8<_6.length;_8++){
var _9=this.getSearchOperator(_6[_8]);
if(_9&&(!_9.hidden||_2||_7)){
if(!_3||(_9.valueType==_3)==!_4)
_5[_6[_8]]=_9.titleProperty==null?_9.title:
isc.Operators[_9.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}
if(isc.isA.String(_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+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.getServerCriterion=function isc_DataSource_getServerCriterion(_1,_2){
if(_1==null)return null;
if(_1.operator){
var _3=this.getSearchOperator(_1.operator);
if(_3==null){
isc.logWarn("Attempted to use unknown operator "+_1.operator)}else if(_3.getServerCriterion){
return _3.getServerCriterion(_1,!!_2,this)}else if(this.$2648(_1,_3)){
return _2?isc.DS.$2652:isc.DS.$2653}
}
return _1}
,isc.A.$2648=function isc_DataSource__isClientOnly(_1,_2){
return _2.clientOnly||_1.clientOnly}
,isc.A.collectTopLevelAsyncCriteria=function isc_DataSource_collectTopLevelAsyncCriteria(_1){
return isc.DS.collectTopLevelAsyncCriteria(_1,this)}
,isc.A.applyAsyncCriteria=function isc_DataSource_applyAsyncCriteria(_1,_2,_3,_4,_5){
return isc.DS.applyAsyncCriteria(_1,_2,_3,_4,_5,this)}
,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=this.getField(_2.fieldName);
var _5=isc.DataSource.getPathValue(_1,_2.fieldName,_4,"filter");
var _6=_4&&
(isc.SimpleType.inheritsFrom(_4.type,"date")||isc.SimpleType.inheritsFrom(_4.type,"datetime"));
var _7=_4&&isc.SimpleType.inheritsFrom(_4.type,"enum");
if(_7||_6||(_4&&isc.SimpleType.inheritsFrom(_4.type,"time"))){
if(_3.ID=="iEquals"){
_3=this.getSearchOperator("equals")}else if(_3.ID=="iNotEqual"){
_3=this.getSearchOperator("notEqual")}
}
var _8=true;
if(this.$908){
for(var i=0;i<this.$909.length;i++){
if(this.$909[i]==_2){
_8=false;
if(this.$91a[i]==true){
return true}
}
}
}
if(_8){
var _10;
if(this.$908){
_10=this.$909.length;
this.$909[_10]=_2}
if(_2.fieldName){
var _11=this,
_4=this.getField(_2.fieldName);
if(_4==null){
_11=this.getDataSourceForDataPath(_2.fieldName);
_4=this.getFieldForDataPath(_2.fieldName);
if(_4==null&&this.$206z
&&this.$206z.allowFilterOnLinkFields
&&this.$206z.linkDataSource)
{
_11=this.$206z.linkDataSource;
_4=_11.getField(_2.fieldName)}
if(_11==null){
_11=this}
_5=isc.DataSource.getPathValue(_1,_2.fieldName,_4,"filter");
_6=_4&&
(isc.SimpleType.inheritsFrom(_4.type,"date")||isc.SimpleType.inheritsFrom(_4.type,"datetime"));
_7=_4&&isc.SimpleType.inheritsFrom(_4.type,"enum")}
if(_4==null){
if(this.dropUnknownCriteria){
this.logInfo("evaluateCriterion passed criterion for field not explicitly listed in this dataSource:"+_2.fieldName+
" - dropping this filter","AdvancedCriteria");
if(this.$908){
this.$91a[_10]=true}
return true}else{
this.logInfo("evaluateCriterion passed criterion for field not explicitly listed in this dataSource:"+_2.fieldName+
" - continuing with filter","AdvancedCriteria")}
}else{
var _12=_11.getFieldOperators(_4);
if(!_12.contains(_3.ID)&&!(_3.ID=="isNull"||_3.ID=="notNull")){
this.logInfo("Operator "+_3.ID+" is not valid for field "+
_2.fieldName+". Continuing anyway.")}
}
}
}
var _13=function(_20){
if(_6&&!isc.isA.Date(_20)&&isc.DateUtil.isRelativeDate(_20)){
return isc.DateUtil.getAbsoluteDate(_20)}
return _20}
var _14={
value:_13(_2.value),
start:_13(_2.start),
end:_13(_2.end)
};
if(_3.valueType==="fieldName"){
var _15=this.getField(_14.value);
var _16=isc.DataSource.getPathValue(_1,_14.value,_15,"filter");
_14.otherValue=_13(_16)}else if(_3.valueType==="criteria"||_3.valueType==="custom"){
_14.criterion=_2;
_14.record=_1}
if(isc.isA.Boolean(_5)&&isc.isA.String(_14.value)){
if(_14.value=="true")_14.value=true;
else if(_14.value=="false")_14.value=false}
var _17=false;
if(_4&&_4.multiple){
if(isc.isAn.Array(_5)&&!isc.isAn.Array(_14.otherValue)){
if(isc.isAn.emptyArray(_5)&&
(_3.ID==="isBlank"||_3.ID==="notBlank"))
{
_17=true}else{
var _18=isc.DataSource.get(_4.type);
for(var i=0;i<_5.length;i++){
var _19=_5[i];
if(isc.isA.Object(_19)&&_18){
if(_19[_18.getPrimaryKeyFieldName()]){
_19=_19[_18.getPrimaryKeyFieldName()]}else{
isc.logWarn("The field '"+_2.fieldName+"' being tested is a multiple valuefield with a DataSource type but either the DataSource does not existor it does not have a primary key field. Skipping criterion.");
break}
}
_17=_3.condition(_2.fieldName,_19,_14,this,_6);
if(_17){
break}
}
}
}else{
if(isc.isAn.Array(_5)&&isc.isAn.Array(_14.otherValue)&&
_3.ID!=="equalsField"&&_3.ID!=="iEqualsField"&&
_3.ID!=="notEqualField"&&_3.ID!=="iNotEqualField")
{
isc.logWarn("Only 'equalsField', 'iEqualsField', 'notEqualField' and'iNotEqualField' are valid operators when comparing two multiple: truefields. Ignoring criterion with operator '"+_2.operator+"'.");
_17=true}else{
_17=_3.condition(_2.fieldName,_5,_14,this,_6)}
}
}else{
_17=_3.condition(_2.fieldName,_5,_14,this,_6)}
return(_3.negate?!_17:_17)}
,isc.A.recordsMatchingAdvancedFilter=function isc_DataSource_recordsMatchingAdvancedFilter(_1,_2,_3,_4,_5){
var _6=[];
_4=_4||0;
_5=_5||_1.length;
this.$59u=false;
this.$59v=_2.strictSQLFiltering;
if(this.$59v==null)this.$59v=this.strictSQLFiltering;
var _7=false;
if(!this.$908){
this.$91b()}else{
_7=true}
this.$206z=_3;
for(var _8=_4;_8<_5;_8++){
if(!_2.operator||this.evaluateCriterion(_1[_8],_2)){
_6.add(_1[_8])}
}
if(!_7){
delete this.$206z;
this.$91c()}
return _6}
,isc.A.$91b=function isc_DataSource__startApplyingCriteriaToList(){
this.$908=true;
this.$909=[];
this.$91a=[]}
,isc.A.$91c=function isc_DataSource__endApplyingCriteriaToList(){
delete this.$909;
delete this.$91a;
delete this.$908}
,isc.A.compareAdvancedCriteria=function isc_DataSource_compareAdvancedCriteria(_1,_2,_3){
_1=isc.DataSource.simplifyAdvancedCriteria(_1,true);
_2=isc.DataSource.simplifyAdvancedCriteria(_2,true);
if(_2==null)return _1==null?0:1;
if(_1==null)return-1;
_1=this.normalizeAdvancedCriteria(_1);
_2=this.normalizeAdvancedCriteria(_2);
var _4=this.getSearchOperator(_2.operator);
var _5=this.getSearchOperator(_1.operator);
if(!_4&&!_5){
return 0}
var _6=_2.fieldQuery;
var _7=_1.fieldQuery;
var _8=_2.valueQuery;
var _9=_1.valueQuery;
var _10,_11,_12;
if(_6||_7){
_10=this.compareAdvancedCriterionSubqueries(_6,_7)}
if(_8||_9){
_11=this.compareAdvancedCriterionSubqueries(_8,_9)}
if(_10!==_12||_11!=_12){
if(_10<0||_11<0){
return-1}
if(_10>0||_11>0){
return 1}
return 0}
if(_4!=_5){
var _13=-1;
if(_4&&_4.ID=="or"){
var _14={operator:"or",criteria:[_1]};
_13=_4.compareCriteria(_14,_2,_4,this)}
if(_13!=-1)return _13;
if(_5&&_5.ID=="and"){
var _14={operator:"and",criteria:[_2]};
return _5.compareCriteria(_1,_14,_5,this)}
return-1}
return _4.compareCriteria(_1,_2,_4,this)}
,isc.A.compareAdvancedCriterionSubqueries=function isc_DataSource_compareAdvancedCriterionSubqueries(_1,_2){
return-1}
,isc.A.splitCriteria=function isc_DataSource_splitCriteria(_1,_2,_3,_4){
if(_1==null||_2==null)return _1;
var _5={};
var _6=this.isAdvancedCriteria(_1);
if(!_6)return this.splitSimpleCriteria(_1,_2);
var _7=_1;
if(!isc.DataSource.isFlatCriteria(_1)){
_7=isc.DataSource.simplifyAdvancedCriteria(_1,true)}
if(_7==null)return _5;
if(!isc.DataSource.isFlatCriteria(_7)||
(_7.criteria!=null&&_7.operator!="and"))
{
this.logWarn("Specified AdvancedCriteria cannot be split by field:"+isc.JSON.encode(_7));
return _5}
if(_7!=_1){
for(var _8 in _1){
delete _1[_8]}
for(var _8 in _7){
_1[_8]=_7[_8]}
}
if(_1.criteria!=null){
var _9=[];
var _10=_1.criteria;
for(var i=0;i<_10.length;i++){
if(_2.contains(_10[i].fieldName)){
_9.add(_10[i]);
_10[i]=null}
}
_10.removeEmpty();
if(_9.length>0){
_5={
_constructor:"AdvancedCriteria",
operator:"and",
criteria:_9
}}
}else{
if(_2.contains(_1.fieldName)){
for(var _8 in _1){
_5[_8]=_1[_8];
delete _1[_8]}
}
}
if(!_3){
_5=this.$867(_5,_4);
if(_5==null)_5={}}
return _5
}
,isc.A.splitSimpleCriteria=function isc_DataSource_splitSimpleCriteria(_1,_2){
var _3={},
_4=_1
;
for(var i=0;i<_2.length;i++){
var _6=_2[i];
if(_4[_6]!=null){
_3[_6]=_4[_6];
delete _1[_6]}
}
return _3}
,isc.A.$867=function isc_DataSource__convertAdvancedCriteriaToSimple(_1,_2){
var _3={};
if(_2==null){
_2=[
"equals",
"iEquals",
"iContains",
"startsWith"
]}
if(_1.fieldName){
if(!_2.contains(_1.operator)){
isc.logWarn("splitCriteria: advanced criteria operator, "+
_1.operator+", not supported.");
return null}
_3[_1.fieldName]=_1.value;
return _3}
if(_1.operator!="and"){
isc.logWarn("splitCriteria: advanced criteria top-level operator, "+
_1.operator+", not supported.");
return null}
for(var i=0;i<_1.criteria.length;i++){
var _5=_1.criteria[i];
if(!_2.contains(_5.operator)){
isc.logWarn(
"splitCriteria: advanced criteria second-level operator:"+
_5.operator+" for field:"+_5.fieldName+
" cannot be converted to simple criteria format");
return null}
_3[_5.fieldName]=_5.value}
return(isc.isAn.emptyObject(_3)?null:_3)}
);
isc.B._maxIndex=isc.C+13;
isc.DataSource.registerStringMethods({
transformRequest:"dsRequest",
transformResponse:"dsResponse,dsRequest,data"
});
isc.$571=function(){
var _1=function(_60,_95,_96,_97,_98){
if(_97.$59v){
if(_95==null||_96.value==null){
return(this.negate?!_97.$59u:_97.$59u)}
}
if(isc.isA.Date(_96.value)&&isc.isA.Date(_95)){
return(_97.compareDates(_96.value,_95,_60)==0)}else{
return(_96.value==_95)}
};
var _2=function(_60,_95,_96,_97,_98,_99){
var _3=_96.start||_96.value;
var _4=_96.end||_96.value;
if(_97.$59v){
if(_95==null||(this.lowerBounds&&_3==null)||
(this.upperBounds&&_4==null)){
return _97.$59u}
}
var _5=true;
var _6=true;
var _7=isc.isA.Date(_95);
var _8=isc.isA.Number(_95);
var _9=isc.isA.String(_95);
if(this.lowerBounds&&_3&&((_8&&isNaN(_3))||
(_3&&_7&&(!isc.isA.Date(_3)))||
(_3&&_9&&(!isc.isA.String(_3)&&!isc.isA.Number(_3))))){
return false}
if(this.upperBounds&&_4&&
((_8&&isNaN(_4))||
(_4&&_7&&(!isc.isA.Date(_4)))||
(_4&&_9&&(!isc.isA.String(_4)&&!isc.isA.Number(_4))))){
return false}
var _10;
if(!_99){
if(_3===null||_3===_10){
_5=false}
if(_4===null||_4===_10){
_6=false}
if(_7&&!isc.isA.Date(_3))_5=false;
if(_7&&!isc.isA.Date(_4))_6=false}
_7=isc.isA.Date(_3)||isc.isA.Date(_4);
_8=isc.isA.Number(_3)||isc.isA.Number(_4);
_9=isc.isA.String(_3)||isc.isA.String(_4);
var _11=_9&&this.caseInsensitive;
if(_95===null||_95===_10){
if(_7){
_95=new Date(-8640000000000000)}else if(_8){
_95=-Number.MAX_VALUE}else{
_95=""}
}else{
if(_8&&isNaN(_95)){
_3=""+_3;
_4=""+_4}
if(_7&&!isc.isA.Date(_95)){
return false}
}
if(this.lowerBounds&&_5){
if(_97.compareValues(_3,_95,_60,_11)<=(this.inclusive?-1:0)){
return false}
}
if(this.upperBounds&&_6){
if(_97.compareValues(_4,_95,_60,_11)>=(this.inclusive?1:0)){
return false}
}
return true};
var _12=function(_60,_95,_96,_97,_98){
var _13=_97?_97.getField(_60):null;
var _14=_96.value||"";
if(_13&&(_13.type=="number"||_13.type=="integer"||
_13.type=="sequence"||_13.type=="float"))
{
if(_95!=null){
var _15=_95-0;
if(!isNaN(_15))_95=_15}
if(_96.value!=null){
_15=_14-0;
if(!isNaN(_15))_14=_15}
}
if(isc.isA.Number(_95)){
_95=""+_95}
if(isc.isA.Boolean(_95)){
isc.logWarn("Attempt to compare a Boolean as String, testing value "+_96.value+
" with operator "+this.ID+
". This is an invalid comparison, so we are returning FALSE.");
return false}
if(isc.isA.Date(_95)){
isc.logWarn("Attempt to compare a Date as String, testing value "+_96.value+
" with operator "+this.ID+
". This is an invalid comparison, so we are returning FALSE.");
return false}
if(_95!=null&&!isc.isA.String(_95)){
return true}
if(_95==null){
if(_97.$59v){
if(_13&&(_13.type=="number"||_13.type=="integer"||
_13.type=="sequence"||_13.type=="float")){
if(_96.value==null||isc.isA.Number(_96.value)||isc.isA.Date(_96.value)){
return(this.negate?!_97.$59u:_97.$59u)}else{
return false}
}else{
return(this.negate?!_97.$59u:_97.$59u)}
}else{
return false}
}
if(isc.isA.Number(_14)){
_14=""+_14}
if(!isc.isA.String(_14)||!isc.isA.String(_95)){
return false}
if(this.caseInsensitive){
_95=_95.toLowerCase();
_14=_14.toLowerCase()}
var _16=false;
if(this.startsWith){
_16=isc.startsWith(_95,_14)}else if(this.endsWith){
_16=isc.endsWith(_95,_14)}else if(this.equals){
_16=(_95==_14)}else{
_16=isc.contains(_95,_14)}
return _16};
var _17=function(_60,_95,_96,_97,_98){
var _13=_97.getField(_60);
if(_13&&(_13.type=="number"||_13.type=="integer"||_13.type=="float"||
_13.type=="date"||_13.type=="time"||_13.type=="datetime"||
_13.type=="boolean"||_13.type=="sequence"||
_13.type=="binary"||_13.type=="imageFile")){
return(_95==null)}
return(_95==null||_95=="")};
var _18=function(_60,_95,_96,_97,_98){
return(_95==null)};
var _19=function(_60,_95,_96,_97,_98){
if(!_96.value){
return false}
if(isc.isA.Date(_96.value)||isc.isA.Date(_95)||
isc.DateUtil.isRelativeDate(_96.value))
{
return false}
var _20;
if(this.caseInsensitive){
_20=new RegExp(_96.value,"im")}else{
_20=new RegExp(_96.value,"m")}
return _20.test(_95)};
var _21=function(_60,_95,_96,_97,_98,_81){
if(!_97.patternEscapeChar||_97.patternEscapeChar.length>1){
throw"dataSource.patternEscapeChar cannot be null or undefined"}
_96=isc.addProperties({},_96);
var _22=isc.isA.Array(_97.patternSingleWildcard)?_97.patternSingleWildcard:[_97.patternSingleWildcard||"?","%"];
var _23=isc.isA.Array(_97.patternMultiWildcard)?_97.patternMultiWildcard:[_97.patternMultiWildcard||"*"];
var _24=false;
var _25="";
var _26=_96.value;
for(var i=0;i<_26.length;i++){
if(_26[i]===_97.patternEscapeChar){
_24=true;
continue}
if(_24){
_25+=_26[i].replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1");
_24=false}else{
if(_23.contains(_26[i])){
_25+=".*";
continue}
if(_22.contains(_26[i])){
_25+=".";
continue}
_25+=_26[i]}
}
if(_81){
_96.value="^.*"+_25+".*$"}else{
_96.value="^"+_25+"$"}
return _19.apply(this,[_60,_95,_96,_97,_98])};
var _28=function(_60,_95,_96,_97,_98,_81){
if(!_97.patternEscapeChar||_97.patternEscapeChar.length>1){
throw"dataSource.patternEscapeChar cannot be null or undefined"}
var _22=isc.isA.Array(_97.patternSingleWildcard)?_97.patternSingleWildcard:[_97.patternSingleWildcard||"?","%"];
var _23=isc.isA.Array(_97.patternMultiWildcard)?_97.patternMultiWildcard:[_97.patternMultiWildcard||"*"];
var _24=false;
var _25="";
var _26=_96.value;
for(var i=0;i<_26.length;i++){
if(_26[i]===_97.patternEscapeChar){
_24=true;
continue}
if(_24){
_25+=_26[i].replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1");
_24=false}else{
if(_23.contains(_26[i])){
_25+=".*";
continue}
if(_22.contains(_26[i])){
_25+=".";
continue}
_25+=_26[i]}
}
_96.value="^"+_25+".*$";
return _19.apply(this,[_60,_95,_96,_97,_98])};
var _29=function(_60,_95,_96,_97,_98,_81){
if(!_97.patternEscapeChar||_97.patternEscapeChar.length>1){
throw"dataSource.patternEscapeChar cannot be null or undefined"}
var _22=isc.isA.Array(_97.patternSingleWildcard)?_97.patternSingleWildcard:[_97.patternSingleWildcard||"?","%"];
var _23=isc.isA.Array(_97.patternMultiWildcard)?_97.patternMultiWildcard:[_97.patternMultiWildcard||"*"];
var _24=false;
var _25="";
var _26=_96.value;
for(var i=0;i<_26.length;i++){
if(_26[i]===_97.patternEscapeChar){
_24=true;
continue}
if(_24){
_25+=_26[i].replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1");
_24=false}else{
if(_23.contains(_26[i])){
_25+=".*";
continue}
if(_22.contains(_26[i])){
_25+=".";
continue}
_25+=_26[i]}
}
_96.value="^.*"+_25+"$";
return _19.apply(this,[_60,_95,_96,_97,_98])};
var _30=function(_60,_95,_96,_97,_98){
return _21.apply(this,[_60,_95,_96,_97,_98,true])};
var _31=function(_60,_95,_96,_97,_98){
var _26=_96.value||[];
if(!isc.isAn.Array(_26)){
_26=[_26]}
if(isc.isA.Date(_95)){
for(var i=0;i<_26.length;i++){
var _7=isc.isA.Date(_26[i]);
if(_98&&!_7&&isc.DateUtil.isRelativeDate(_26[i])){
_26[i]=isc.DateUtil.getAbsoluteDate(_26[i])}
if(isc.isA.Date(_26[i])&&
_97.compareDates(_26[i],_95,_60)==0)
{
return true}
}
}else{
return _26.contains(_95)}
};
var _32=function(_60,_95,_96,_97,_98){
if(_96.value==null){
return true}
var _33=false;
if(isc.isAn.Array(_95)&&isc.isAn.Array(_96.otherValue)){
_33=_95.equals(_96.otherValue)}else{
_33=(_96.otherValue==_95)}
if(isc.isA.Date(_96.otherValue)&&isc.isA.Date(_95)){
_33=(_97.compareDates(_96.otherValue,_95,_60,
_96.value)==0)}
return _33};
var _34=function(_60,_95,_96,_97,_98){
if(_96.value==null){
return true}
_96.value=_96.otherValue;
return _12.apply(this,[_60,_95,_96,_97,_98])};
var _35=function(_60,_95,_96,_97,_98){
if(_96.value==null){
return true}
_96.value=_96.otherValue;
return _2.apply(this,[_60,_95,_96,_97,_98,true])};
var _36=function(_60,_95,_96,_97,_98){
var _37=_96.criterion;
var _38=_96.record;
var _39;
if(!_37.criteria){
_37.criteria=[]}
if(!isc.isAn.Array(_37.criteria)){
isc.logWarn("AdvancedCriteria: found boolean operator where subcriteria was not an array.  Subcriteria was: "+isc.echoFull(_37.criteria));
return false}
if(this.isNot){
_97.$59u=!_97.$59u}
for(var _40=0;_40<_37.criteria.length;_40++){
var _41=_97.evaluateCriterion(_38,_37.criteria[_40]);
if(this.isAnd&&!_41){
_39=false}
if(this.isNot&&_41){
_39=false}
if(this.isOr&&_41){
_39=true}
if(_39!=null){
break}
}
if(_39==null){
_39=!this.isOr}
if(this.isNot){
_97.$59u=!_97.$59u}
return _39};
var _42=function(_37,_95,_96){
var _43=_37.criteria;
if(!isc.isAn.Array(_43)||!_43.length)return _37;
if(this.isNot)_95=!_95;
var _44=_37;
for(var i=0;i<_43.length;++i){
var _45=_43[i],
_46=_96.getServerCriterion(_45,_95);
if(_46!==_45){
if(_44===_37){
_44=isc.addProperties({operator:this.ID},_37);
_44.criteria=_43.duplicate()}
_44.criteria[i]=_46}
}
return _44};
var _47=function(_95,_96,_97,_98){
if(!_96.criteria)_96.criteria=[];
if(!isc.isAn.Array(_96.criteria)){
isc.logWarn("AdvancedCriteria: boolean compareCriteria found where old subcriteria was not an array");
return-1}
if(!_95.criteria)_95.criteria=[];
if(!isc.isAn.Array(_95.criteria)){
isc.logWarn("AdvancedCriteria: boolean compareCriteria found where new subcriteria was not an array");
return-1}
var _48,
_49=0,
_50=_96.criteria.length,
_51=_95.criteria.length;
if(_51>_50&&_97.isOr){
return-1}
var _52=isc.clone(_96.criteria);
var _53=isc.clone(_95.criteria);
for(var i=0;i<_50;i++){
var _54=_52[i];
var _55=i>_51?null:_53[i];
if(!_55||
(_55&&_55.fieldName!=_54.fieldName||
_55.operator!=_54.operator||
_55.processed==true)){
_55=null;
for(var j=0;j<_51;j++){
if(_53[j].processed)continue;
if(_53[j].fieldName==_54.fieldName&&
_53[j].operator==_54.operator){
_55=_53[j];
break}
}
}
if(_55&&_54){
_55.processed=true;
_48=_98.compareAdvancedCriteria(_55,_54)}else{
if(_54&&!_55){
if(_97.isOr)_48=1;
if(_97.isAnd)_48=-1;
if(_97.isNot)_48=-1}
}
if(_97.isAnd&&_48==-1)return-1;
if(_97.isOr&&_48==-1)return-1;
if(_97.isNot&&_48==1)return-1;
if(_48!=0)_49=1}
for(var i=0;i<_51;i++){
if(!_53[i].processed){
if(_97.isOr)return-1;
if(_97.isAnd)return 1;
if(_97.isNot)return-1}
}
return _49};
var _57=function(_95,_96,_97,_98){
if(_95.fieldName==_96.fieldName){
var _58=_98.compareValues(_95.value,_96.value,
_95.fieldName)==0;
if(_58){
return 0}
}
return-1};
var _59=function(_95,_96,_97,_98){
var _60=_95.fieldName;
if(_95.fieldName==_96.fieldName){
if(_97.upperBounds&&_97.lowerBounds){
if(_98.compareValues(_95.start,_96.start,_60)==0){
if(_98.compareValues(_95.end,_96.end,_60)==0){
return 0}
}
}else{
if(_98.compareValues(_95.value,_96.value,_60)==0){
return 0}
}
var _61=_95.start==null?_95.value:_95.start,
_62=_96.start==null?_96.value:_96.start,
_63=_95.start==null?_95.value:_95.end,
_64=_96.start==null?_96.value:_96.end;
var _7,
_65;
var _66=true,
_67=true,
_68=true,
_69=true;
if(_62==null)_66=false;
if(_64==null)_67=false;
if(_61==null)_68=false;
if(_63==null)_69=false;
if(_97.lowerBounds&&!_97.upperBounds&&
!_68&&!_66){
return 0}
if(_97.lowerBounds&&!_97.upperBounds){
if(_68&&!_66){
return 1}
if(_66&&!_68){
return-1}
var _70=_98.compareValues(_61,_62,_60);
if(_70==-1){
return 1}else if(_70==0){
return 0}
}
if(_97.upperBounds&&!_97.lowerBounds&&
!_69&&!_67){
return 0}
if(_97.upperBounds&&!_97.lowerBounds){
if(_69&&!_67){
return 1}
if(_67&&!_69){
return-1}
var _70=_98.compareValues(_61,_62,_60);
if(_70==1){
return 1}else if(_70==0){
return 0}
}
if(_97.lowerBounds&&_97.upperBounds){
if(_98.compareValues(_61,_62,_60)<=0&&
_98.compareValues(_61,_64,_60)>=0&&
_98.compareValues(_63,_64,_60)>=0&&
_98.compareValues(_63,_62,_60)<=0)
{
return 1}
if((_68&&!_66)||
(_69&&!_67)){
return 1}
if(!_68&&!_66&&
!_69&&!_66){
return 0}
}
}
return-1};
var _71=function(_95,_96,_97,_98){
var _72=_96.value;
var _73=_95.value;
var _13=_98&&_98.getField(_95.fieldName);
if(_13&&(_13.type=="number"||_13.type=="integer"||
_13.type=="sequence"||_13.type=="float"))
{
if(_72!=null){
var _15=_72-0;
if(!isNaN(_15))_72=_15}
if(_73!=null){
_15=_73-0;
if(!isNaN(_15))_73=_15}
}
if(isc.isA.Number(_72))_72=""+_72;
if(isc.isA.Number(_73))_73=""+_73;
if(!isc.isA.String(_72)||!isc.isA.String(_73))return-1;
if(_97.caseInsensitive){
_72=_72.toLowerCase();
_73=_73.toLowerCase()}
if(_95.fieldName==_96.fieldName
&&_95.value==_96.value
&&!_97.equals)
{
return 0}
if(_97.equals){
return _72==_73?0:-1}
if(_97.startsWith&&!_97.negate&&
_73.length>_72.length&&isc.startsWith(_73,_72))
{
return 1}
if(_97.startsWith&&_97.negate&&
_72.length>_73.length&&isc.startsWith(_72,_73))
{
return 1}
if(_97.endsWith&&!_97.negate&&
_73.length>_72.length&&isc.endsWith(_73,_72))
{
return 1}
if(_97.endsWith&&_97.negate&&
_72.length>_73.length&&isc.endsWith(_72,_73))
{
return 1}
if(!_97.startsWith&&!_97.endsWith&&!_97.negate&&
_73.length>_72.length&&isc.contains(_73,_72))
{
return 1}
if(!_97.startsWith&&!_97.endsWith&&_97.negate&&
_72.length>_73.length&&isc.contains(_72,_73))
{
return 1}
return-1};
var _74=function(_95,_96,_97){
if(_95.fieldName==_96.fieldName){
return 0}
return-1};
var _75=function(_95,_96,_97){
if(_95.fieldName==_96.fieldName){
return 0}
return-1};
var _76=function(_95,_96,_97){
if(_95.value==_96.value&&
_95.fieldName==_96.fieldName){
return 0}
return-1};
var _77=function(_95,_96,_97,_98){
var _78=_96.value,
_79=_95.value,
_80=_97.ID.replace("Pattern",""),
_11=_80.startsWith("i"),
_81=_80.contains("ontains"),
_82=!_81&&_80.contains("atches"),
_83=!_81&&!_82&&_80.contains("artsWith"),
_84=!_81&&!_82&&!_83,
_85="*",
_86=false
;
if(!_96.value.contains(_85)&&!_95.value.contains(_85)){
if(_82){
_80=_11?"iEquals":"equals"}
var _87=isc.DataSource.$57z[_80];
var _16=_87.compareCriteria(_95,_96,_87,_98);
if(_86){
isc.logWarn(_95.value+" is "+
(_16==0?"equal to":
(_16>0?"more":"less")+" restrictive than")+
" "+_96.value
)}
return _16}
if(_81){
if(!_78.startsWith(_85))_78=_85+_78;
if(!_79.startsWith(_85))_79=_85+_79;
if(!_78.endsWith(_85))_78+=_85;
if(!_79.endsWith(_85))_79+=_85}else if(_83){
if(!_78.endsWith(_85))_78+=_85;
if(!_79.endsWith(_85))_79+=_85}else if(_84){
if(!_78.startsWith(_85))_78=_85+_78;
if(!_79.startsWith(_85))_79=_85+_79}
if(_11){
_78=_78.toLowerCase();
_79=_79.toLowerCase()}
if(_95.fieldName==_96.fieldName&&_78==_79){
return 0}
var _88=_78.split("*"),
_89=_79.split("*")
;
if(_82){
if(_89[0]!=_88[0]&&
!_89[0].startsWith(_88[0])||
(_89[_89.length-1]!=_88[_88.length-1]&&
!_89[_89.length-1].startsWith(_88[_88.length-1])))
{
return-1}
}
if(_89[0]!=_88[0]){
if(_89[0].startsWith(_88[0])){
if(_86)isc.logWarn("More restrictive - new initial string starts with old initial string");
return 1}else{
if(_86)isc.logWarn("Less restrictive - different initial string");
return-1}
}
if(!_81&&_89[_89.length-1]!=_88[_88.length-1]){
if(_86)isc.logWarn("Less restrictive - different end string");
return-1}
if(!_81&&_88.length<3&&_89.length>_88.length){
if(_86)isc.logWarn("More restrictive - old value has no inner strings but new value does end string");
return 1}
if(_88.length>1){
var _90=_88.getRange(1,_88.length-1),
_91=_89.getRange(1,_89.length-1)
;
if(_81){
if(_91[0].startsWith(_90[0])&&
_91[_91.length-1].startsWith(_90[_90.length-1]))
{
if(_91.length>=_90.length)return 1;
else return-1}
}else if(_83){
if(_91[_91.length-1]==_90[_90.length-1]){
if(_91.length>=_90.length)return 1;
else return-1}
}
for(var i=0;i<_90.length;i++){
if(!_91[i]||!_91[i].startsWith(_90[i])){
if(_86)isc.logWarn("Less restrictive - different interior strings");
return-1}
}
if(_86){
isc.logWarn("More restrictive - for each old internal string, there is a new internal string that startsWith the old string")}
return 1}
if(_86)isc.logWarn("Less restrictive - default return value");
return-1};
var _92=function(_95,_96,_97){
if(_95.fieldName==_96.fieldName){
if(!isc.isAn.Array(_96.value)&&!isc.isAn.Array(_95.value)){
if(_96.value==_95.value){
return 0}
}
if(!isc.isAn.Array(_96.value)||!isc.isAn.Array(_95.value)){
return-1}
if(_95.value.equals(_96.value)){
return 0}
if(!_97.negate&&_96.value.containsAll(_95.value)){
return 1}
if(_97.negate&&_95.value.containsAll(_96.value)){
return 1}
}
return-1};
var _93=function(_95,_96,_97){
if(_95.value==_96.value&&
_95.fieldName==_96.fieldName){
return 0}
return-1};
var _94=[
{
ID:"equals",
titleProperty:"iEqualsTitle",
textTitleProperty:"equalsTitle",
negate:false,
valueType:"fieldType",
condition:_1,
compareCriteria:_57,
symbol:"==",
wildCard:"*",
canNormalize:true,
getCriterion:function(_60,_95){
var _16={fieldName:_60,operator:this.ID};
if(isc.isA.RelativeDateItem(_95))
_16.value=_95.getRelativeDate()||_95.getValue();
else _16.value=_95.getValue();
return _16}
},
{
ID:"notEqual",
titleProperty:"iNotEqualTitle",
textTitleProperty:"notEqualTitle",
negate:true,
valueType:"fieldType",
condition:_1,
compareCriteria:_57,
symbol:"!",
wildCard:"*",
canNormalize:true,
getCriterion:function(_60,_95){
var _16={fieldName:_60,operator:this.ID};
if(isc.isA.RelativeDateItem(_95))
_16.value=_95.getRelativeDate()||_95.getValue();
else _16.value=_95.getValue();
return _16}
},
{
ID:"greaterThan",
titleProperty:"greaterThanTitle",
lowerBounds:true,
valueType:"fieldType",
condition:_2,
compareCriteria:_59,
symbol:">",
getCriterion:function(_60,_95){
var _16={fieldName:_60,operator:this.ID};
if(isc.isA.RelativeDateItem(_95))
_16.value=_95.getRelativeDate()||_95.getValue();
else _16.value=_95.getValue();
return _16}
},
{
ID:"lessThan",
titleProperty:"lessThanTitle",
upperBounds:true,
valueType:"fieldType",
condition:_2,
compareCriteria:_59,
symbol:"<",
getCriterion:function(_60,_95){
var _16={fieldName:_60,operator:this.ID};
if(isc.isA.RelativeDateItem(_95))
_16.value=_95.getRelativeDate()||_95.getValue();
else _16.value=_95.getValue();
return _16}
},
{
ID:"greaterOrEqual",
titleProperty:"greaterOrEqualTitle",
lowerBounds:true,
inclusive:true,
valueType:"fieldType",
condition:_2,
compareCriteria:_59,
symbol:">=",
getCriterion:function(_60,_95){
var _16={fieldName:_60,operator:this.ID};
if(isc.isA.RelativeDateItem(_95))
_16.value=_95.getRelativeDate()||_95.getValue();
else _16.value=_95.getValue();
return _16}
},
{
ID:"lessOrEqual",
titleProperty:"lessOrEqualTitle",
upperBounds:true,
inclusive:true,
valueType:"fieldType",
condition:_2,
compareCriteria:_59,
symbol:"<=",
getCriterion:function(_60,_95){
var _16={fieldName:_60,operator:this.ID};
if(isc.isA.RelativeDateItem(_95))
_16.value=_95.getRelativeDate()||_95.getValue();
else _16.value=_95.getValue();
return _16}
},
{
ID:"between",
titleProperty:"iBetweenTitle",
textTitleProperty:"betweenTitle",
lowerBounds:true,
upperBounds:true,
hidden:true,
symbol:"...",
valueType:"valueRange",
condition:_2,
compareCriteria:_59,
getCriterion:function(_60,_95){
var _16={fieldName:_60,operator:this.ID};
if(isc.isA.RelativeDateItem(_95))
_16.value=_95.getRelativeDate()||_95.getValue();
else _16.value=_95.getValue();
return _16}
},
{
ID:"iBetween",
titleProperty:"iBetweenTitle",
lowerBounds:true,
upperBounds:true,
symbol:"...",
valueType:"valueRange",
condition:_2,
caseInsensitive:true,
$264v:"between",
compareCriteria:_59,
getCriterion:function(_60,_95){
var _16={fieldName:_60,operator:this.ID};
if(isc.isA.RelativeDateItem(_95))
_16.value=_95.getRelativeDate()||_95.getValue();
else _16.value=_95.getValue();
return _16}
},
{
ID:"betweenInclusive",
titleProperty:"iBetweenInclusiveTitle",
textTitleProperty:"betweenInclusiveTitle",
lowerBounds:true,
upperBounds:true,
valueType:"valueRange",
inclusive:true,
hidden:true,
condition:_2,
compareCriteria:_59,
symbol:"...",
getCriterion:function(_60,_95){
var _16={fieldName:_60,operator:this.ID};
if(isc.isA.RelativeDateItem(_95))
_16.value=_95.getRelativeDate()||_95.getValue();
else _16.value=_95.getValue();
return _16}
},
{
ID:"iBetweenInclusive",
titleProperty:"iBetweenInclusiveTitle",
lowerBounds:true,
upperBounds:true,
valueType:"valueRange",
inclusive:true,
condition:_2,
compareCriteria:_59,
symbol:"...",
caseInsensitive:true,
$264v:"betweenInclusive",
getCriterion:function(_60,_95){
var _16={fieldName:_60,operator:this.ID};
if(isc.isA.RelativeDateItem(_95))
_16.value=_95.getRelativeDate()||_95.getValue();
else _16.value=_95.getValue();
return _16}
},
{
ID:"iEquals",
titleProperty:"iEqualsTitle",
equals:true,
hidden:true,
caseInsensitive:true,
$264v:"equals",
valueType:"fieldType",
condition:_12,
symbol:"==",
wildCard:"*",
canNormalize:true,
compareCriteria:_71
},
{
ID:"iContains",
titleProperty:"iContainsTitle",
caseInsensitive:true,
$264v:"contains",
valueType:"fieldType",
condition:_12,
symbol:"~",
canNormalize:true,
compareCriteria:_71
},
{
ID:"iStartsWith",
titleProperty:"iStartsWithTitle",
startsWith:true,
caseInsensitive:true,
$264v:"startsWith",
valueType:"fieldType",
condition:_12,
symbol:"^",
canNormalize:true,
compareCriteria:_71
},
{
ID:"iEndsWith",
titleProperty:"iEndsWithTitle",
endsWith:true,
caseInsensitive:true,
$264v:"endsWith",
valueType:"fieldType",
condition:_12,
symbol:"|",
canNormalize:true,
compareCriteria:_71
},
{
ID:"startsWith",
titleProperty:"iStartsWithTitle",
textTitleProperty:"startsWithTitle",
startsWith:true,
hidden:true,
valueType:"fieldType",
condition:_12,
symbol:"^",
canNormalize:true,
compareCriteria:_71
},
{
ID:"endsWith",
titleProperty:"iEndsWithTitle",
textTitleProperty:"endsWithTitle",
endsWith:true,
hidden:true,
valueType:"fieldType",
condition:_12,
symbol:"|",
canNormalize:true,
compareCriteria:_71
},
{
ID:"iNotEqual",
titleProperty:"iNotEqualTitle",
caseInsensitive:true,
$264v:"notEqual",
equals:true,
negate:true,
hidden:true,
valueType:"fieldType",
condition:_12,
symbol:"!",
wildCard:"*",
canNormalize:true,
compareCriteria:_71
},
{
ID:"iNotContains",
titleProperty:"iNotContainsTitle",
caseInsensitive:true,
$264v:"notContains",
negate:true,
valueType:"fieldType",
condition:_12,
symbol:"!~",
canNormalize:true,
compareCriteria:_71
},
{
ID:"iNotStartsWith",
titleProperty:"iNotStartsWithTitle",
startsWith:true,
caseInsensitive:true,
$264v:"notStartsWith",
negate:true,
valueType:"fieldType",
condition:_12,
symbol:"!^",
canNormalize:true,
compareCriteria:_71
},
{
ID:"iNotEndsWith",
titleProperty:"iNotEndsWithTitle",
endsWith:true,
caseInsensitive:true,
$264v:"notEndsWith",
negate:true,
valueType:"fieldType",
condition:_12,
symbol:"!@",
canNormalize:true,
compareCriteria:_71
},
{
ID:"contains",
titleProperty:"iContainsTitle",
textTitleProperty:"containsTitle",
hidden:true,
valueType:"fieldType",
condition:_12,
symbol:"~",
canNormalize:true,
compareCriteria:_71
},
{
ID:"notContains",
titleProperty:"iNotContainsTitle",
textTitleProperty:"notContainsTitle",
negate:true,
hidden:true,
valueType:"fieldType",
condition:_12,
symbol:"!~",
canNormalize:true,
compareCriteria:_71
},
{
ID:"notStartsWith",
titleProperty:"iNotStartsWithTitle",
textTitleProperty:"notStartsWithTitle",
startsWith:true,
negate:true,
hidden:true,
valueType:"fieldType",
condition:_12,
symbol:"!^",
canNormalize:true,
compareCriteria:_71
},
{
ID:"notEndsWith",
titleProperty:"iNotEndsWithTitle",
textTitleProperty:"notEndsWithTitle",
endsWith:true,
negate:true,
hidden:true,
valueType:"fieldType",
condition:_12,
symbol:"!@",
canNormalize:true,
compareCriteria:_71
},
{
ID:"isBlank",
titleProperty:"isBlankTitle",
valueType:"none",
condition:_17,
symbol:"$",
compareCriteria:_74
},
{
ID:"notBlank",
titleProperty:"notBlankTitle",
negate:true,
valueType:"none",
condition:_17,
symbol:"!$",
compareCriteria:_74
},
{
ID:"isNull",
titleProperty:"isNullTitle",
valueType:"none",
hidden:true,
condition:_18,
symbol:"#",
compareCriteria:_75
},
{
ID:"notNull",
titleProperty:"notNullTitle",
negate:true,
valueType:"none",
hidden:true,
condition:_18,
symbol:"!#",
compareCriteria:_75
},
{
ID:"regexp",
titleProperty:"iregexpTitle",
textTitleProperty:"regexpTitle",
hidden:true,
valueType:"custom",
condition:_19,
symbol:"/regex/",
compareCriteria:_76
},
{
ID:"iregexp",
titleProperty:"iregexpTitle",
hidden:true,
caseInsensitive:true,
$264v:"regexp",
valueType:"custom",
condition:_19,
symbol:"/regex/",
compareCriteria:_76
},
{
ID:"matchesPattern",
titleProperty:"iMatchesPatternTitle",
textTitleProperty:"matchesPatternTitle",
hidden:true,
valueType:"custom",
symbol:"==i~",
wildcard:"*",
condition:_21,
compareCriteria:_77
},
{
ID:"iMatchesPattern",
titleProperty:"iMatchesPatternTitle",
hidden:true,
caseInsensitive:true,
$264v:"matchesPattern",
valueType:"custom",
symbol:"==~",
wildcard:"*",
condition:_21,
compareCriteria:_77
},
{
ID:"startsWithPattern",
titleProperty:"iStartsWithPatternTitle",
textTitleProperty:"startsWithPatternTitle",
hidden:true,
valueType:"custom",
wildcard:"*",
condition:_28,
compareCriteria:_77
},
{
ID:"iStartsWithPattern",
titleProperty:"iStartsWithPatternTitle",
hidden:true,
caseInsensitive:true,
$264v:"startsWithPattern",
valueType:"custom",
wildcard:"*",
condition:_28,
compareCriteria:_77
},
{
ID:"endsWithPattern",
titleProperty:"iEndsWithPatternTitle",
textTitleProperty:"endsWithPatternTitle",
hidden:true,
valueType:"custom",
wildcard:"*",
condition:_29,
compareCriteria:_77
},
{
ID:"iEndsWithPattern",
titleProperty:"iEndsWithPatternTitle",
hidden:true,
caseInsensitive:true,
$264v:"endsWithPattern",
valueType:"custom",
wildcard:"*",
condition:_29,
compareCriteria:_77
},
{
ID:"containsPattern",
titleProperty:"iContainsPatternTitle",
textTitleProperty:"containsPatternTitle",
hidden:true,
valueType:"custom",
symbol:"=i~",
wildcard:"*",
condition:_30,
compareCriteria:_77
},
{
ID:"iContainsPattern",
titleProperty:"iContainsPatternTitle",
hidden:true,
caseInsensitive:true,
$264v:"containsPattern",
valueType:"custom",
symbol:"=~",
wildcard:"*",
condition:_30,
compareCriteria:_77
},
{
ID:"inSet",
titleProperty:"inSetTitle",
valueType:"valueSet",
condition:_31,
compareCriteria:_92,
symbol:"=(",
closingSymbol:")",
valueSeparator:"|",
processValue:function(_26,_95){
if(_26==null)return null;
return(""+_26).split(this.valueSeparator)}
},
{
ID:"notInSet",
titleProperty:"notInSetTitle",
negate:true,
valueType:"valueSet",
condition:_31,
compareCriteria:_92,
symbol:"!=(",
closingSymbol:")",
valueSeparator:"|",
processValue:function(_26,_95){
if(_26==null)return null;
return(""+_26).split(this.valueSeparator)}
},
{
ID:"equalsField",
titleProperty:"iEqualsFieldTitle",
textTitleProperty:"equalsFieldTitle",
valueType:"fieldName",
condition:_32,
symbol:"=.",
canNormalize:true,
compareCriteria:_93,
processValue:function(_26,_95){
if(!_95)return _26;
var _13=_95.getField(_26);
if(_13)return _26;
_13=_95.getFieldByTitle(_26);
if(_13)return _13.name;
return null}
},
{
ID:"notEqualField",
titleProperty:"iNotEqualFieldTitle",
textTitleProperty:"notEqualFieldTitle",
negate:true,
valueType:"fieldName",
condition:_32,
canNormalize:true,
compareCriteria:_93
},
{
ID:"iEqualsField",
titleProperty:"iEqualsFieldTitle",
equals:true,
caseInsensitive:true,
$264v:"equalsField",
valueType:"fieldName",
condition:_34,
canNormalize:true,
compareCriteria:_93
},
{
ID:"iNotEqualField",
titleProperty:"iNotEqualFieldTitle",
equals:true,
caseInsensitive:true,
$264v:"notEqualField",
negate:true,
valueType:"fieldName",
condition:_34,
canNormalize:true,
compareCriteria:_93
},
{
ID:"greaterThanField",
titleProperty:"greaterThanFieldTitle",
lowerBounds:true,
valueType:"fieldName",
condition:_35,
compareCriteria:_93
},
{
ID:"lessThanField",
titleProperty:"lessThanFieldTitle",
upperBounds:true,
valueType:"fieldName",
condition:_35,
compareCriteria:_93
},
{
ID:"greaterOrEqualField",
titleProperty:"greaterOrEqualFieldTitle",
lowerBounds:true,
inclusive:true,
valueType:"fieldName",
condition:_35,
compareCriteria:_93
},
{
ID:"lessOrEqualField",
titleProperty:"lessOrEqualFieldTitle",
upperBounds:true,
inclusive:true,
valueType:"fieldName",
condition:_35,
compareCriteria:_93
},
{
ID:"containsField",
titleProperty:"iContainsFieldTitle",
textTitleProperty:"containsFieldTitle",
hidden:true,
valueType:"fieldName",
condition:_34,
canNormalize:true,
compareCriteria:_93
},
{
ID:"startsWithField",
titleProperty:"iStartsWithFieldTitle",
textTitleProperty:"startsWithFieldTitle",
startsWith:true,
hidden:true,
valueType:"fieldName",
condition:_34,
canNormalize:true,
compareCriteria:_93
},
{
ID:"endsWithField",
titleProperty:"iEndsWithFieldTitle",
textTitleProperty:"endsWithFieldTitle",
endsWith:true,
hidden:true,
valueType:"fieldName",
condition:_34,
canNormalize:true,
compareCriteria:_93
},
{
ID:"iContainsField",
titleProperty:"iContainsFieldTitle",
hidden:true,
caseInsensitive:true,
$264v:"containsField",
valueType:"fieldName",
condition:_34,
canNormalize:true,
compareCriteria:_93
},
{
ID:"iStartsWithField",
titleProperty:"iStartsWithFieldTitle",
startsWith:true,
hidden:true,
caseInsensitive:true,
$264v:"startsWithField",
valueType:"fieldName",
condition:_34,
canNormalize:true,
compareCriteria:_93
},
{
ID:"iEndsWithField",
titleProperty:"iEndsWithFieldTitle",
endsWith:true,
hidden:true,
caseInsensitive:true,
$264v:"endsWithField",
valueType:"fieldName",
condition:_34,
canNormalize:true,
compareCriteria:_93
},
{
ID:"notContainsField",
titleProperty:"iNotContainsFieldTitle",
textTitleProperty:"notContainsFieldTitle",
hidden:true,
negate:true,
valueType:"fieldName",
condition:_34,
canNormalize:true,
compareCriteria:_93
},
{
ID:"notStartsWithField",
titleProperty:"iNotStartsWithFieldTitle",
textTitleProperty:"notStartsWithFieldTitle",
startsWith:true,
hidden:true,
negate:true,
valueType:"fieldName",
condition:_34,
canNormalize:true,
compareCriteria:_93
},
{
ID:"notEndsWithField",
titleProperty:"iNotEndsWithFieldTitle",
textTitleProperty:"notEndsWithFieldTitle",
endsWith:true,
hidden:true,
negate:true,
valueType:"fieldName",
condition:_34,
canNormalize:true,
compareCriteria:_93
},
{
ID:"iNotContainsField",
titleProperty:"iNotContainsFieldTitle",
hidden:true,
caseInsensitive:true,
$264v:"notContainsField",
negate:true,
valueType:"fieldName",
condition:_34,
canNormalize:true,
compareCriteria:_93
},
{
ID:"iNotStartsWithField",
titleProperty:"iNotStartsWithFieldTitle",
startsWith:true,
hidden:true,
caseInsensitive:true,
$264v:"notStartsWithField",
negate:true,
valueType:"fieldName",
condition:_34,
canNormalize:true,
compareCriteria:_93
},
{
ID:"iNotEndsWithField",
titleProperty:"iNotEndsWithFieldTitle",
endsWith:true,
hidden:true,
caseInsensitive:true,
$264v:"notEndsWithField",
negate:true,
valueType:"fieldName",
condition:_34,
canNormalize:true,
compareCriteria:_93
},
{
ID:"and",
titleProperty:"andTitle",
isAnd:true,
valueType:"criteria",
condition:_36,
symbol:" and ",
compareCriteria:_47,
getServerCriterion:_42
},
{
ID:"not",
titleProperty:"notTitle",
isNot:true,
valueType:"criteria",
condition:_36,
compareCriteria:_47,
getServerCriterion:_42
},
{
ID:"or",
titleProperty:"orTitle",
isOr:true,
valueType:"criteria",
condition:_36,
symbol:" or ",
compareCriteria:_47,
getServerCriterion:_42
}
];
for(var _40=0;_40<_94.length;_40++){
isc.DataSource.addSearchOperator(_94[_40])}
isc.DataSource.setTypeOperators(null,["equals","notEqual",
"equalsField","notEqualField",
"isBlank","notBlank",
"between","betweenInclusive",
"isNull","notNull",
"and","or","not"]);
isc.DataSource.setTypeOperators("text",["regexp","iregexp","contains","startsWith",
"endsWith","iEquals","iNotEqual",
"lessThan","greaterThan",
"lessOrEqual","greaterOrEqual",
"iBetween","iBetweenInclusive",
"iContains","iStartsWith","iEndsWith",
"notContains","notStartsWith","notEndsWith",
"iNotContains","iNotStartsWith","iNotEndsWith",
"containsField","startsWithField","endsWithField",
"greaterThanField","lessThanField",
"greaterOrEqualField","lessOrEqualField",
"iEqualsField","iNotEqualField",
"iContainsField","iStartsWithField","iEndsWithField",
"notContainsField","notStartsWithField","notEndsWithField",
"iNotContainsField","iNotStartsWithField","iNotEndsWithField",
"matchesPattern","iMatchesPattern","containsPattern","iContainsPattern",
"inSet","notInSet","iStartsWithPattern"]);
isc.DataSource.setTypeOperators("integer",["lessThan","greaterThan",
"lessOrEqual","greaterOrEqual",
"iBetween","iBetweenInclusive",
"greaterThanField","lessThanField",
"greaterOrEqualField","lessOrEqualField",
"inSet","notInSet","contains"]);
isc.DataSource.setTypeOperators("float",["lessThan","greaterThan",
"lessOrEqual","greaterOrEqual",
"iBetween","iBetweenInclusive",
"greaterThanField","lessThanField",
"greaterOrEqualField","lessOrEqualField",
"inSet","notInSet","contains"]);
isc.DataSource.setTypeOperators("datetime",["lessThan","greaterThan",
"lessOrEqual","greaterOrEqual",
"iBetween","iBetweenInclusive",
"greaterThanField","lessThanField",
"greaterOrEqualField","lessOrEqualField"]);
isc.DataSource.setTypeOperators("date",["lessThan","greaterThan",
"lessOrEqual","greaterOrEqual",
"iBetween","iBetweenInclusive",
"greaterThanField","lessThanField",
"greaterOrEqualField","lessOrEqualField"]);
isc.DataSource.setTypeOperators("time",["lessThan","greaterThan",
"lessOrEqual","greaterOrEqual",
"iBetween","iBetweenInclusive",
"greaterThanField","lessThanField",
"greaterOrEqualField","lessOrEqualField"])};
isc.$571();
isc.DataSource.create({ID:"Object",builtinSchema:true,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("\n",_3,"<value>",isc.makeXMLSafe(_6),"</value>")}
}else{
for(var _7 in _1){
var _6=_1[_7];
_4.append("\n",_3,"<value id=\"",isc.makeXMLSafe(_7),"\">",
isc.makeXMLSafe(_6),"</value>")}
}
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+"$224c";
if(this[_5])return this[_5];
var _6=_1+"Operation";
if(this[_6]){
_3=this[_6];
if(isc.isAn.Object(_3)){
this[_6]=_3.ID;
this[_5]=_3;
return _3}
_4=_3}
if(_4==null||isc.isA.String(_4)){
var _7=this.getDataSource();
if(_7==null){
this.logWarn("can't getOperation for type: "+_1+
", no "+_6+" specified, and no dataSource to create an auto-operation");
return null}
this.logInfo("creating auto-operation for operationType: "+_1);
_3=isc.DataSource.makeDefaultOperation(_7,_1,_4);
_4=_3.ID;
this[_6]=_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<this.schema.length;i++){var _6=this.schema[i];_6.serviceNamespace=_4;_6.schemaNamespace=_1;_6.location=this.location;if(isc.isA.SimpleType(_6)){if(_6.inheritsFrom&&_6.inheritsFrom==_6.name&&_6.xmlSource=="XSElement")continue;this.$693[_6.name]=_6}else if(_6.ID){if(isc.isAn.XSElement(_6)){this.$531[_6.ID]=_6}else{this.$530[_6.ID]=_6}
}
}
}
isc.SchemaSet.$37r=this},getSchema:function(_1,_2,_3){if(!_3)_3=[this];else _3.add(this);var _4;if(_2==isc.DS.$532)_4=this.$531[_1];else if(_2==isc.DS.$45t)_4=this.$530[_1];if(_2==null){_4=this.$530[_1]||this.$531[_1];if(_4!=null)return _4}
if(!this.$70w){isc.SchemaSet.findLoadedImports(this);this.$70w=true}
var _5=this.$38q;if(_5!=null){for(var i=0;i<_5.length;i++){var _7=_5[i];if(_3.contains(_7))continue;_4=_7.getSchema(_1,_2,_3);if(_4!=null)return _4}
}
},getSimpleType:function(_1,_2){if(!_2)_2=[this];else _2.add(this);var _3;if(this.$693){_3=this.$693[_1];if(_3)return _3}
if(this.$38q!=null){for(var i=0;i<this.$38q.length;i++){var _5=this.$38q[i];if(_2.contains(_5))continue;_3=_5.getSimpleType(_1,_2);if(_3!=null)return _3}
}
},setLocation:function(_1){this.location=_1;if(!this.schema)return;for(var i=0;i<this.schema.length;i++){var _3=this.schema[i];_3.location=_1}
},loadImports:function(_1){isc.SchemaSet.loadImports(_1,this)},loadImport:function(_1,_2,_3,_4){return isc.SchemaSet.loadImport(_1,_2,_3,_4,this)},doneImporting:function(){this.fireCallback(this.$69o)},addImportXMLSource:function(_1,_2){this.importSources=this.importSources||[];this.importSources.add({xmlText:_1,location:_2
})
},addSchemaSet:function(_1,_2){this.$69n=this.$69n||[];this.$69n.add(_1)}});isc.A=isc.SchemaSet;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.schemaSets={};isc.A.$69p=["http://www.w3.org/2001/xml.xsd","http://www.w3.org/2001/XMLSchema","http://www.w3.org/XML/1998/namespace"
];isc.A.$69q=[];isc.B.push(isc.A.get=function isc_c_SchemaSet_get(_1){return this.schemaSets[_1]}
,isc.A.findLoadedImports=function isc_c_SchemaSet_findLoadedImports(_1){var _2=this.getAllImports(_1);if(!_2)return;var _3=_1.$38q=_1.$38q||[];var _4=_1.$70x=_1.$70x||[];for(var i=0;i<_2.length;i++){var _6=_2[i],_7=_6.isWSDL,_8=_6.namespace;if(this.$69p.contains(_8))continue;if((_7&&_4.find("serviceNamespace",_8))||(!_7&&_3.find("schemaNamespace",_8)))
continue;var _9=_7?isc.WebService.get(_8):isc.SchemaSet.get(_8);if(_9==null){var _10;if(isc.isA.WebService(_1)){_10="WebService with targetNamespace '"+_1.serviceNamespace}else{_10="SchemaSet with targetNamespace '"+_1.schemaNamespace}
var _11=_6.location?"logWarn":"logInfo";_1[_11](_10+"' could not find "+(_7?"webService":"SchemaSet")+" for namespace: '"+_8+"'. Pass autoLoadImports to loadWSDL()/loadXMLSchema() or separately load via loadWSDL/loadXMLSchema jsp tag or method","schemaLoader");continue}
if(_9.location==null)_9.setLocation(_1.location);_7?_4.add(_9):_3.add(_9)}
}
,isc.A.getAllImports=function isc_c_SchemaSet_getAllImports(_1){var _2=_1.schemaImports;if(_1.wsdlImports){_1.wsdlImports.setProperty("isWSDL",true);_2=_2||[];_2=_2.concat(_1.wsdlImports)}
return _2}
,isc.A.loadImports=function isc_c_SchemaSet_loadImports(_1,_2){_2.$69o=_1;var _3=this.getAllImports(_2);if(!_3)return _2.doneImporting();_2.$69r=0;for(var i=0;i<_3.length;i++){var _5=_3[i],_6=_5.namespace;if(_6){var _7=(_5.isWSDL?isc.WebService.get(_6):isc.SchemaSet.get(_6));if(_7!=null){_2.logDebug("import already loaded: "+_6+", skipping","schemaLoader");continue}
}
if(_5.location&&_5.location!=_2.location){var _8=_2.loadImport(_6,_5.location,function(_9){if(isc.isA.WebService(_9)){_2.addWebService(_9,_6)}else{_2.addSchemaSet(_9,_6)}
_2.$69r--;_2.logInfo(_2+" loaded import: "+_9+" as namespace: "+_6+", remaining imports: "+_2.$69r,"schemaLoader");if(_2.$69r==0)_2.doneImporting()},_5.isWSDL);if(_8)_2.$69r++}
}
if(_2.$69r==0)_2.doneImporting()}
,isc.A.loadImport=function isc_c_SchemaSet_loadImport(_1,_2,_3,_4,_5){var _6=_5.location.substring(0,_5.location.lastIndexOf("/"));if(!_6.endsWith("/"))_6+="/";var _7=isc.Page.combineURLs(_6,_2);if(_7==_5.location){_5.logDebug("skipping self-reference import: "+_7,"schemaLoader");return false}
if(this.$69p.contains(_7)){_5.logDebug("skipping pedantic import: "+_7,"schemaLoader");return false}
if(this.$69q.contains(_7)){_5.logDebug("skipping redundant import: "+_7,"schemaLoader");return false}
this.$69q.add(_7);_5.logInfo("loading import from: "+_7+"\nschema/service base dir: "+_6+"\nimport location: "+_2,"schemaLoader");var _8=_4?"loadWSDL":"loadXMLSchema";isc.xml[_8](_7,function(_9){_5.fireCallback(_3,"schemaSet",[_9])},null,true,{initiator:_5.initiator||_5,captureXML:_5.captureXML
});return true}
);isc.B._maxIndex=isc.C+5;isc.SchemaSet.getPrototype().toString=function(){return"["+this.Class+" ns="+this.echoLeaf(this.schemaNamespace)+(this.location?" location="+isc.Page.getLastSegment(this.location):"")+"]"};isc.defineClass("WebService").addMethods({init:function(){var _1=this.serviceNamespace;if(this.messages){for(var i=0;i<this.messages.length;i++){this.messages[i].serviceNamespace=_1}
}
this.logInfo("registered service with serviceNamespace: "+_1+" service name: "+this.name);isc.WebService.services.add(this);isc.WebService.$37r=this},loadImports:function(_1){isc.SchemaSet.loadImports(_1,this)},loadImport:function(_1,_2,_3,_4){return isc.SchemaSet.loadImport(_1,_2,_3,_4,this)},doneImporting:function(){this.fireCallback(this.$69o)},addSchemaSet:function(_1,_2){this.$38q=this.$38q||[];this.$38q.add(_1)},addWebService:function(_1,_2){this.$70x=this.$70x||[];this.$70x.add(_1)},addImportXMLSource:function(_1,_2){this.importSources=this.importSources||[];this.importSources.add({xmlText:_1,location:_2
})
},getOperation:function(_1,_2){if(isc.isAn.Object(_1))return _1;if(!this.$70w){isc.SchemaSet.findLoadedImports(this);this.$70w=true}
var _3=this.getBindingOperation(_1,_2);var _4=this.getPortTypeOperation(_1,_2);if(!_3&&!_4){this.logWarn(this+": no such operation: '"+_1+"'"+(_2?" in portType: '"+_2+"'":""));return null}
return isc.addProperties({},_4,_3)},findOperation:function(_1,_2,_3,_4){if(!_3)return;if(_2)_3=_3.findAll("portTypeName",_2);if(!_3)return;if(this.$70x){for(var i=0;i<this.$70x.length;i++){var _6=this.$70x[i],_7=_4?"getPortTypeOperation":"getBindingOperation",_8=_6[_7](_1,_2);if(_8!=null)return _8}
}
for(var i=0;i<_3.length;i++){var _9=_3[i].operation;if(!isc.isAn.Array(_9))_9=[_9];var _8=_9.find("name",_1);if(_8!=null)return _8}
},getPortTypeOperation:function(_1,_2){return this.findOperation(_1,_2,this.portTypes,true)},getBindingOperation:function(_1,_2){return this.findOperation(_1,_2,this.bindings)},getOperationForMessage:function(_1){var _2=this.getOperations();if(!_2)return;var _3=_2.find("inputMessage",_1);if(_3)return _3;_3=_2.find("outputMessage",_1);if(_3)return _3},getOperationNames:function(){var _1=this.operationNames;if(_1)return _1;if(!this.$70w){isc.SchemaSet.findLoadedImports(this);this.$70w=true}
_1=this.operationNames=[];if(this.bindings){for(var i=0;i<this.bindings.length;i++){var _3=this.bindings[i],_4=_3.operation;if(!isc.isAn.Array(_4))_4=[_4];_1.addList(_4.getProperty("name"));for(var j=0;j<_1.length;j++){var _6=this.getPortTypeOperation(_1[j],_3.portTypeName);if(_6)_6.hasBinding=true}
}
}
if(this.portTypes){for(var i=0;i<this.portTypes.length;i++){var _7=this.portTypes[i],_4=_7.operation;if(!isc.isAn.Array(_4))_4=[_4];var _8=_4.findAll("hasBinding",true);if(_8){_4=_4.duplicate();_4.removeAll(_8)}
_1.addList(_4.getProperty("name"))}
}
return(this.operationNames=_1)},getOperations:function(_1){var _2=this.getOperationNames(),_3=[];for(var i=0;i<_2.length;i++){var _5=this.getOperation(_2[i]);if(_1&&!_5.hasBinding)continue;_3.add(_5)}
return _3},getSchema:function(_1,_2){if(!this.$70w){isc.SchemaSet.findLoadedImports(this);this.$70w=true}
var _3=this.$38q;if(_3!=null){for(var i=0;i<_3.length;i++){var _5=_3[i];var _6=_5.getSchema(_1,_2);if(_6)return _6}
}
return isc.DS.get(_1,null,null,_2)},getRequestMessage:function(_1){var _2=this.getOperation(_1);return this.getMessage(_2.inputMessage)},getResponseMessage:function(_1){var _2=this.getOperation(_1);return this.getMessage(_2.outputMessage)},getMessage:function(_1){var _2=this.messages.find("ID","message:"+_1);if(_2)return _2;if(!this.$70w){isc.SchemaSet.findLoadedImports(this);this.$70w=true}
if(this.$70x){for(var i=0;i<this.$70x.length;i++){var _4=this.$70x[i];_2=_4.getMessage(_1);if(_2)return _2}
}
},getBodyPartNames:function(_1,_2){var _3=this.getOperation(_1),_4=_2?_3.outputParts:_3.inputParts;if(_4==null||isc.isAn.emptyString(_4)){var _5=_2?this.getResponseMessage(_1):this.getRequestMessage(_1);return _5.getFieldNames()}else{return _4.split(" ")}
},globalNamespaces:{xsi:"http://www.w3.org/2001/XMLSchema-instance",xsd:"http://www.w3.org/2001/XMLSchema"
},callOperation:function(_1,_2,_3,_4,_5){var _6=this.getOperation(_1);if(_6==null){this.logWarn("No such operation: "+_1);return}
_5=_5||isc.emptyObject;var _7=isc.addProperties({actionURL:this.getDataURL(_1),httpMethod:"POST",contentType:"text/xml",data:_2,serviceNamespace:this.serviceNamespace,serviceName:this.name,wsOperation:_1
},_5);_7.httpHeaders=isc.addProperties({},{SOAPAction:_6.soapAction||'""'},_5.httpHeaders);_7.headerData=_5.headerData||this.getHeaderData(_7);_7.data=this.getSoapMessage(_7);_7.internalClientContext={$38r:_4,$38s:_1,$38u:_3,$38v:_5.xmlResult
};if(this.spoofResponses){var _8=this.getSampleResponse(_1);if(this.logIsDebugEnabled("xmlBinding")){this.logDebug("spoofed response:\n"+_8,"xmlBinding")}
this.delayCall("$38w",[isc.xml.parseXML(_8),_8,{status:0,internalClientContext:_7.internalClientContext,httpResponseCode:200,httpResponseText:_8},_7]);return}
_7.callback={target:this,methodName:"$38w"};isc.xml.getXMLResponse(_7)},$38w:function(_1,_2,_3,_4){var _5=_4.internalClientContext,_6=_5.$38s,_7=_5.$38u;if(_3.status<0){this.fireCallback(_5.$38r,"data,xmlDoc,rpcResponse,wsRequest",[_3.data,_1,_3,_4]);return}
_1.addNamespaces(this.getOutputNamespaces(_6));if(_4.xmlNamespaces){_1.addNamespaces(_4.xmlNamespaces)}
var _8=(_7!=null&&_7.contains("/")),_9=(_8?_7:null),_10;if(_8){_10=_1.selectNodes(_9)}else if(_7){_10=this.selectByType(_1,_6,_7)}else{_10=_1.selectNodes("//s:Body/*",{s:"http://schemas.xmlsoap.org/soap/envelope/"});if(_10.length==1)_10=_10[0]}
if(this.logIsDebugEnabled()){this.logDebug("selected response data is: "+this.echoFull(_10))}
if(_5.$38v){this.fireCallback(_5.$38r,"data,xmlDoc,rpcResponse,wsRequest",[_10,_1,_3,_4]);return}
var _11;if(_8){_11=null}else if(_7){_11=this.getSchema(_5.$38u)}else{var _12=this.getSchema("message:"+this.getOperation(_6).outputMessage);if(this.getSoapStyle(_6)!="document"){_11=_12}else{var _13=_12.getFieldNames().first();_11=_12.getSchema(_12.getField(_13).type)}
}
_10=isc.xml.toJS(_10,null,_11);this.fireCallback(_5.$38r,"data,xmlDoc,rpcResponse,wsRequest",[_10,_1,_3,_4])},getOutputNamespaces:function(_1,_2){var _3=this.getDefaultOutputDS(_1);return isc.addProperties({"default":_3.schemaNamespace||this.serviceNamespace,schema:_3.schemaNamespace,service:this.serviceNamespace
},_2)},getDataURL:function(_1){var _2=this.getOperation(_1);if(_2&&_2.dataURL)return _2.dataURL;return this.dataURL},getMessageSerializer:function(_1,_2){var _3=_2?this.getResponseMessage(_1)
:this.getRequestMessage(_1);if(_3==null){this.logWarn("no "+(_2?"response":"request")+" message definition found for operation: '"+_1+"'");return}
if(this.getSoapStyle(_1)!="document")return _3;var _4=_3.getFieldNames();if(_4.length==1&&_3.fieldIsComplexType(_4[0])){var _5=_3.getField(_4[0]);_3=_3.getSchema(_5.type,_5.xsElementRef?"element":null);if(_3==null){this.logWarn("can't find schema: "+_5.type+", part of "+(_2?"response":"request")+" message for operation '"+_1+"'")}
}
return _3},useSimplifiedInputs:function(_1,_2){var _3=_2?this.getResponseMessage(_1)
:this.getRequestMessage(_1);return this.getMessageSerializer(_1,_2)!=_3},getSoapMessage:function(_1,_2){_1.serviceNamespace=_1.serviceNamespace||this.serviceNamespace;var _3=_1.wsOperation;if(this.getOperation(_3)==null){this.logWarn("no such operation: '"+_3+"' in service: "+this.serviceNamespace);return""}
var _4=this.getMessageSerializer(_1.wsOperation,_2&&_2.generateResponse);if(_4==null)return"";_1.$167f=this;return _4.getXMLRequestBody(_1,_2)},getSampleResponse:function(_1,_2,_3,_4){return this.getSoapMessage({wsOperation:_1,data:_2||{}
},isc.addProperties({spoofData:true,generateResponse:!_4
},_3))},getSampleRequest:function(_1,_2,_3){return this.getSampleResponse(_1,_2,_3,true)},getSoapStyle:function(_1){return this.getOperation(_1).soapStyle||this.soapStyle},getInputDS:function(_1){return this.getMessageSerializer(_1)},getHeaderSchema:function(_1,_2){var _3=this.getOperation(_1),_4=_2?_3.inputHeaders:_3.outputHeaders;if(!_4)return null;var _5={};for(var i=0;i<_4.length;i++){var _7=_4[i].part,_8=this.getSchema("message:"+_4[i].message);var _9=_8.getPartField(_7);_5[_7]=this.getSchema(_9.type)||_9}
return _5},getInputHeaderSchema:function(_1){return this.getHeaderSchema(_1,true)},getOutputHeaderSchema:function(_1){return this.getHeaderSchema(_1,false)},getHeaderData:function(_1){},selectByType:function(_1,_2,_3){var _4=this.getOperation(_2),_5=this.getSchema("message:"+_4.outputMessage),_6=this.getSchema(_3);if(_6==null){this.logWarn("selectByType: type '"+_3+"' not present in schema for message: "+_4.outputMessage);return null}
var _7=_5.findTagOfType(_6.ID);if(_7==null){this.logWarn("selectByType: no tag of type '"+_3+"' could be found in message: "+_4.outputMessage);return null}
var _8=_7[0],_9=_7[1],_10=_7[2],_11=_7[3],_12=_8.getField(_9);_9=_9||_6.ID;var _13=_6.mustQualify,_14=_6.schemaNamespace,_15="//"+(_13?"ns0:":"")+_9;if(_12&&_12.multiple)_15=_15+"/*";var _16=isc.xml.selectNodes(_1,_15,{ns0:_14});if(this.logIsDebugEnabled("xmlBinding")){this.logDebug("selecting type: '"+_6+"' within message '"+_4.outputMessage+" via XPath: "+_15+(_13?" using ns0: "+_6.schemaNamespace:"")+" got "+_16.length+" elements","xmlBinding")}
return _16},getDefaultOutputDS:function(_1){var _2=this.getResponseMessage(_1);if(!_2)return null;var _3=_2.getFieldNames();if(_3.length==1&&_2.fieldIsComplexType(_3[0])){return _2.getSchema(_2.getField(_3[0]).type)}
return _2},getFetchDS:function(_1,_2,_3){if(_2==null)_2=this.getDefaultOutputDS(_1);_2=isc.isA.Object(_2)?_2.ID:_2;if(_2!=null&&this.getSchema(_2)==null){this.logWarn("getFetchDS: resultType: '"+_2+"' not present in web service - missing XML files?")}
var _4=isc.DS.create({serviceNamespace:this.serviceNamespace,inheritsFrom:_2,operationBindings:[isc.addProperties({operationType:"fetch",wsOperation:_1,recordName:_2
},_3)
]
});return _4},setLocation:function(_1,_2){if(_2)this.getBindingOperation(_2).dataURL=_1;else this.dataURL=_1}});isc.A=isc.WebService;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.services=[];isc.B.push(isc.A.get=function isc_c_WebService_get(_1){return this.services.find("serviceNamespace",_1)}
,isc.A.getByName=function isc_c_WebService_getByName(_1,_2){if(_1=="")_1=null;if(_2!=null){return this.services.find({name:_1,serviceNamespace:_2})}else{return this.services.find("name",_1)}
}
);isc.B._maxIndex=isc.C+2;isc.WebService.getPrototype().toString=function(){return"["+this.Class+" ns="+this.echoLeaf(this.serviceNamespace)+(this.location?" location="+isc.Page.getLastSegment(this.location):"")+"]"};isc.ClassFactory.defineClass("RPCManager");isc.RPC=isc.rpc=isc.RPCManager;isc.Page.observe(isc,"goOffline","isc.rpc.goOffline()");isc.Page.observe(isc,"goOnline","isc.rpc.goOnline()");isc.ClassFactory.defineClass("LoadScreenCallback");isc.A=isc.LoadScreenCallback.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.execute=function isc_LoadScreenCallback_execute(){}
);isc.B._maxIndex=isc.C+1;isc.ClassFactory.defineClass("RPCResponse");isc.A=isc.RPCResponse;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.create=function isc_c_RPCResponse_create(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13){this.logWarn("RPCResponses shouldn't be created directly. Instances of this class are automatically created and optionally passed to you in the callback you specify as part of your RPCRequest.");return isc.addProperties({},_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13)}
);isc.B._maxIndex=isc.C+1;isc.A=isc.RPCResponse;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.errorCodes={STATUS_SUCCESS:0,STATUS_OFFLINE:1,STATUS_FAILURE:-1,STATUS_AUTHORIZATION_FAILURE:-3,STATUS_VALIDATION_ERROR:-4,STATUS_LOGIN_INCORRECT:-5,STATUS_MAX_LOGIN_ATTEMPTS_EXCEEDED:-6,STATUS_LOGIN_REQUIRED:-7,STATUS_LOGIN_SUCCESS:-8,STATUS_UPDATE_WITHOUT_PK_ERROR:-9,STATUS_TRANSACTION_FAILED:-10,STATUS_MAX_FILE_SIZE_EXCEEDED:-11,STATUS_MAX_POST_SIZE_EXCEEDED:-12,STATUS_REQUIRED_CRITERIA_MISSING:-13,STATUS_CRITERIA_REQUIRED_ERROR:-13,STATUS_FILE_REQUIRED_ERROR:-15,INVALID_RESPONSE_FORMAT:-16,STATUS_TRANSPORT_ERROR:-90,STATUS_UNKNOWN_HOST_ERROR:-91,STATUS_CONNECTION_RESET_ERROR:-92,STATUS_SERVER_TIMEOUT:-100};isc.B.push(isc.A.getErrorCodeKeyFromCode=function isc_c_RPCResponse_getErrorCodeKeyFromCode(_1){var _2=this.errorCodes;for(var _3 in _2){if(_2[_3]===_1)return _3}
return _1}
);isc.B._maxIndex=isc.C+1;isc.RPCResponse.addClassProperties(isc.RPCResponse.errorCodes)
isc.addGlobal("DSResponse",isc.RPCResponse);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.maxErrorMessageLength=1000;isc.A.maxLogMessageLength=25000;isc.A.defaultTimeout=240000;isc.A.defaultPrompt="Contacting server...";isc.A.timeoutErrorMessage="Operation timed out";isc.A.removeDataPrompt="Deleting record(s)...";isc.A.saveDataPrompt="Saving form...";isc.A.validateDataPrompt="Validating...";isc.A.promptStyle=isc.Dialog?"dialog":"cursor";isc.A.useCursorTracker=false;isc.A.cursorTrackerConstructor="Img";isc.A.cursorTrackerDefaults={src:"[SKINIMG]shared/progressCursorTracker.gif",size:16,offsetX:12,offsetY:0,$38x:function(_1){var _2=(isc.EH.getX()+this.offsetX),_3=(isc.EH.getY()+this.offsetY);if(_2+this.size>=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="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.loadSystemSchemaURL="[ISOMORPHIC]/loadSystemSchema";isc.A.projectLoaderURL="[ISOMORPHIC]/projectLoader";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.setActionURL=function isc_c_RPCManager_setActionURL(_1){this.actionURL=_1;for(var i=0;i<this.$38z.length;i++){var _3=this.$38z[i];if(_3.suspended&&_3.$185v){_3.URL=_3.$185w?this.addPathToURL(_1,_3.$185w):_1}
}
}
,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+3;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.queueSent=isc.Class.NO_OP;isc.A.allowCrossDomainCalls=false;isc.A.supportsXHRDownload=true;isc.A.$380=0;isc.A.onLine=!isc.isOffline();isc.A.$89f="text/xml";isc.A.loginStatusCodeMarker="<SCRIPT>//'\"]]>>isc_";isc.A.loginRequiredMarker="<SCRIPT>//'\"]]>>isc_loginRequired";isc.A.loginSuccessMarker="<SCRIPT>//'\"]]>>isc_loginSuccess";isc.A.maxLoginAttemptsExceededMarker="<SCRIPT>//'\"]]>>isc_maxLoginAttemptsExceeded";isc.A.$89j="<responses>";isc.A.$89k="</responses>";isc.A.$89l="<response>";isc.A.$89m="</response>";isc.A.allowIE9Leak=true;isc.A.useJSONParse_IE9=true;isc.A.$2582=0;isc.A.$2583={};isc.A.$257p=0;isc.A.$257q={};isc.A.$257r=false;isc.A.browserMimeTypes=["application/json","text/plain","text/xml","text/html","text/css","text/javascript"
];isc.A.defaultErrorFormatter=null;isc.A.$1613="\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";isc.A.reloginCommFailureMessage="The server is unavailable right now, please try again in a while";isc.A.useReloginZLayer=true;isc.A.supportsPostMessageRelogin=false;isc.A.postMessageReloginPolicy="*";isc.A.$143q="<HTML><SCRIPT>setInterval(function () {window.opener.isc.Timer.firePendingTimeouts()},1);</SCRIPT></HTML>";isc.A.$113o="return";isc.A.$1873="window";isc.A.$112s={};isc.A.$231p="Unable to load any of the projects";isc.B.push(isc.A.xmlHttpRequestAvailable=function isc_c_RPCManager_xmlHttpRequestAvailable(){if(isc.Browser.isIE)return(isc.Comm.createXMLHttpRequest()!=null);return true}
,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.<BR>This warning may be suppressed by setting <b>RPCManager.allowCrossDomainCalls</b> 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:this.encodeObject(_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.$185x=_1.actionURL||_1.url||_1.URL;_1.actionURL=isc.Page.getURL(_1.$185x||this.actionURL);if(this.reportDownloadErrorsAsDocuments&&_1.reportDownloadErrorsAsDocuments==null)
{_1.reportDownloadErrorsAsDocuments=true}
if(_1.reportDownloadErrorsAsDocuments){var _2=_1.data;if(!_2)_1.data=_2={};_2.reportDownloadErrorsAsDocuments=true}
var _3=_1.transport;if(!_3){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=_3=_1.useXmlHttpRequest?"xmlHttpRequest":"hiddenFrame"}
}else{_1.transport=this.defaultTransport}
}
this.checkTransportAvailable(_1,(_3!=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 _4=this.transformRequest(_1);if(_4!==_1){_1.data=_4}
this.incrementPendingRpcs(_1);if(this.canQueueRequest(_1,(_3!=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.synchronousCallback)return false;if(_1.xhrUpload)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,_5=_4&&_4.requestData.operations.length,_6=_4&&_5>0;if(_6&&(_1.actionURL!=_4.URL)){this.logWarn("RPCRequest specified (or defaulted to) URL: "+_1.actionURL
+" which is different than the URL for which the RPCManager is currently queuing: "
+_4.URL+" - sending this request to server and continuing to queue");return false}
if(_6&&(!!_1.useStrictJSON!=!!_4.useStrictJSON))
{this.logWarn("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(_6&&_4.transport!=_1.transport){this.logWarn("RPCRequest with conflicting transport while queuing, sending request to server and continuing to queue.");return false}
if(_6&&_1.clientOnly){this.logWarn("Attempt to queue a client-only request with a pending transaction containing server-bound requests (URL: "+_4.URL+") - the client-only request will be sent immediately outside the queue and the queue preserved");return false}
if(!_1.clientOnly&&_4&&_5==0){this.logWarn("Attempt to queue an RPCRequest to the server (URL: "+_1.actionURL+") with client-only requests in the queue - the client-only requests will be sent immediately, clearing the transaction, and making the queue available for this (and subsequent) server-bound requests");this.sendQueue();this.startQueue()}
var _7=_1.submitForm;if(_7&&_7.$209u&&_7.$209u()){var _4=this.currentTransaction;if(_4&&_4.$209v){this.logWarn("Only one upload can be added to a transaction, and the current transaction already has one.  The current transaction will be sent immediately and then a new one started for the new request."
);this.sendQueue();this.startQueue()}
}
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(isc.RPCManager.$38z)isc.RPCManager.$38z.dataChanged();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;_2.$185v=!_1.$185x;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&&this.canAddPathToURL(_2.URL)){_2.$185w="/"+encodeURIComponent(_1.download_filename);_2.URL=this.addPathToURL(_2.URL,_2.$185w)}
_2.ignoreError=true}else if(_1.exportFilename&&this.canAddPathToURL(_2.URL)){_2.$185w="/"+encodeURIComponent(_1.exportFilename);_2.URL=this.addPathToURL(_2.URL,_2.$185w)}
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.componentId){if(!_2.componentIds)_2.componentIds=Array.newInstance({sortUnique:true});_2.componentIds.add(_1.componentId)}
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
})}
if(_1.xhrUpload)_2.xhrUpload=true;if(_1.xhrUploadProgress!=null)_2.xhrUploadProgress=_1.xhrUploadProgress;_2.transport=_1.transport;_2.useStrictJSON=_2.useStrictJSON||_1.useStrictJSON;if(_2.useStrictJSON!=null){_2.requestData.useStrictJSON=_2.useStrictJSON;if(_2.useStrictJSON){_2.jsonReviver=_1.jsonReviver||(isc.DataSource?isc.JSON.jsonDateReviver:null)}
}
if(_1.ignoreReloginMarkers)_2.ignoreReloginMarkers=true;var _3=_1.submitForm;if(_3&&_3.$209u&&_3.$209u()){_2.$209v=_1}
_2.operations.add(_1);if(_1.synchronousCallback){_2.synchronousCallback=true}
var _4=_1.data;if(_4==null)_4="__ISC_NULL__";else if(_4==="")_4="__ISC_EMPTY_STRING__";if(!_1.clientOnly)_2.requestData.operations.add(_4);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(_1.allClientOnly)return;if(this.$380++!=0)return;var _4=_1.promptStyle=="component"&&_1.componentIds;var _5=this.unmaskedTargets;if(_3&&!this.$113i&&!_4){isc.EH.showClickMask({target:this,methodName:"blockingRPCClick"},"hard",_5?_5.duplicate():null,"blockingRPC");this.$113i=true}
var _6=this;var _7=function(){if(_1.promptStyle=="dialog"&&_2!=null){isc.showPrompt(_2);_6.$388=true;if(_6.$113i){isc.EH.hideClickMask("blockingRPC");_6.$113i=null}
}else if(_4){_1.componentIds.map(function(_9){var _8=window[_9];if(_8&&_8.showComponentPrompt)_8.fireCallback("showComponentPrompt")});_1.showedComponentPrompt=true}else{if(!_6.$113i){isc.EH.showClickMask({target:this,methodName:"blockingRPCClick"},"hard",_5?_5.duplicate():null,"blockingRPC"
);_6.$113i=true}
if(_1.useCursorTracker){_6.$389=isc.ClassFactory.getClass(_1.cursorTrackerConstructor,true).create(_1.cursorTrackerProperties);_6.$389.show()}else{isc.EH.$m8.setCursor(_1.promptCursor)}
}
};if(_3){this.$113j=isc.Timer.setTimeout(_7,_3)}else{_7()}
}
,isc.A.blockingRPCClick=function isc_c_RPCManager_blockingRPCClick(){var _1=this.getActiveTransactions();if(_1==null||_1.length==0){isc.EH.delayCall("hideClickMask",["blockingRPC"])}
}
,isc.A.doClearPrompt=function isc_c_RPCManager_doClearPrompt(_1){if(_1.allClientOnly)return;if(this.$113j){isc.Timer.clear(this.$113j);this.$113j=null}
if(_1.clearedPrompt)return;_1.clearedPrompt=true;if(_1.showedComponentPrompt){_1.componentIds.map(function(_3){var _2=window[_3];if(_2&&_2.clearComponentPrompt)_2.fireCallback("clearComponentPrompt")})}
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&&!_2.allClientOnly)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,_2){if(_1==null)return null;var _3=null;try{if(_1.location&&_1.document){_3=_1}
}catch(e){this.logDebug("getTransaction(): Unable to access properties of 'transaction' object passed in - error was:"+e);return null}
if(_3!=null){var _4=isc.HiddenFrame.$h6;for(var i=0;i<_4.length;i++){if(_3==_4[i].getHandle()){_1=_4[i].transactionNum;break}
}
if(_1==_3){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&&!_2)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,_2,_3){var _4=this.getTransaction(_1);if(_4==null){this.logWarn("clearTransaction: no such transaction: "+this.echo(_1));return}
this.clearTransactionTimeout(_4);if(!this.$453&&isc.Page.isLoaded()){var _5=isc.LogViewer.getGlobalLogCookie();this.setTrackRPC(_5?_5.trackRPC:false,true);this.$453=true}
if(!_2)this.clearTransactionPendingRpcs(_4);_4.cleared=true;_4.maintainTracking=_3;if(!_3&&!this.$454&&this.$453){this.$38z.remove(_4)}else{_4.changed()}
isc.RPCManager.$410.remove(_4.transactionNum)}
,isc.A.setTrackRPC=function isc_c_RPCManager_setTrackRPC(_1,_2){this.$454=_1;if(!_2||isc.LogViewer.getGlobalLogCookie()){isc.LogViewer.setGlobalLogCookieValue("trackRPC",_1)}
var _3=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&&!_1.maintainTracking){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;i<this.$38z.length;i++){var _2=this.$38z[i];this.delayTransaction(_2)}
}
,isc.A.suspendTransaction=function isc_c_RPCManager_suspendTransaction(_1){var _2=this.getTransaction(_1)||this.getCurrentTransaction();if(_2==null){this.logWarn("No transaction to suspend");return}
if(_2.suspended)return;_2.suspended=true;if(_2.$66n)_2.abortCallbacks=true;this.clearTransactionTimeout(_2);if(_2.showPrompt&&!_2.allClientOnly)this.doClearPrompt(_2);_2.changed()}
,isc.A.delayTransaction=function isc_c_RPCManager_delayTransaction(_1){_1=this.getTransaction(_1);if(_1.delayed)return;_1.delayed=true;this.clearTransactionTimeout(_1);_1.changed()}
,isc.A.goOffline=function isc_c_RPCManager_goOffline(){this.logInfo("Going offline...");this.onLine=false}
,isc.A.goOnline=function isc_c_RPCManager_goOnline(){this.logInfo("Going online...");this.offlinePlayback=true;this.playbackNextOfflineTransaction()}
,isc.A.offlineTransactionPlaybackComplete=function isc_c_RPCManager_offlineTransactionPlaybackComplete(){}
,isc.A.playbackNextOfflineTransaction=function isc_c_RPCManager_playbackNextOfflineTransaction(){var _1=this.offlineTransactionLog?this.offlineTransactionLog.removeAt(0):null;if(_1==null){this.logInfo("Offline transaction playback complete");this.offlinePlayback=false;this.onLine=!isc.isOffline();this.offlineTransactionPlaybackComplete();return}
this.resubmitTransaction(_1)}
,isc.A.offlineTransaction=function isc_c_RPCManager_offlineTransaction(_1){if(_1.offline)return;_1=this.getTransaction(_1);_1.offline=true;this.clearTransactionTimeout(_1);if(!this.offlineTransactionLog){this.offlineTransactionLog=[];this.offlineTransactionLog.sortByProperty("timestamp",Array.ASCENDING)}
this.offlineTransactionLog.add(_1);_1.changed();var _2=_1.operations;for(var i=0;i<_2.length;i++){var _4=_2[i];var _5=this.createRPCResponse(_1,_4,{httpResponseCode:200,offlineResponse:true
});this.delayCall("fireReplyCallbacks",[_4,_5],0)}
}
,isc.A.resendTransaction=function isc_c_RPCManager_resendTransaction(_1){this.resendTransactionsFlagged(_1,"suspended")}
,isc.A.resendDelayedTransactions=function isc_c_RPCManager_resendDelayedTransactions(){this.delayingTransactions=false;this.resendTransactionsFlagged(null,"delayed")}
,isc.A.resendTransactionsFlagged=function isc_c_RPCManager_resendTransactionsFlagged(_1,_2){var _3=_1?[this.getTransaction(_1)]:this.$38z;for(var i=0;i<_3.length;i++){_1=_3[i];if(_1[_2]){delete _1[_2];this.resubmitTransaction(_1)}
}
}
,isc.A.getTransactionRequests=function isc_c_RPCManager_getTransactionRequests(_1){return this.getTransaction(_1).operations}
,isc.A.$39a=function isc_c_RPCManager__setTransactionTimeoutTimer(_1){_1=this.getTransaction(_1);var _2=_1.timeout;if(!_2&&_2!==0)_2=this.defaultTimeout;if(_2==0)return;_1.timeoutTimer=isc.Timer.setTimeout("isc.RPCManager.$39b("+_1.transactionNum+")",_2,null,null,true
)}
,isc.A.clearTransactionTimeout=function isc_c_RPCManager_clearTransactionTimeout(_1){_1=this.getTransaction(_1)||this.getCurrentTransaction()||this.getLastSubmittedTransaction();if(!_1)return;isc.Timer.clear(_1.timeoutTimer)}
,isc.A.$39b=function isc_c_RPCManager__timeoutTransaction(_1){_1=this.getTransaction(_1);if(_1.$387){this.clearTransaction(_1);return}
if(!this.onLine){this.offlineTransaction(_1);return}
_1.results=this.$39c(_1,{data:isc.RPCManager.timeoutErrorMessage,status:isc.RPCResponse.STATUS_SERVER_TIMEOUT
});this.$39d(_1.transactionNum)}
,isc.A.$39c=function isc_c_RPCManager__makeErrorResults(_1,_2){var _3=[];for(var i=0;i<_1.operations.length;i++){if(_1.operations[i].dataFormat=="xml"){_3[i]=isc.Comm.xmlSerialize("response",_2)}else{_3[i]={response:isc.clone(_2)}}
}
return _3}
,isc.A.resubmitTransaction=function isc_c_RPCManager_resubmitTransaction(_1){_1=this.getTransaction(_1)||this.getLastSubmittedTransaction();_1.status=null;var _2=this.currentTransaction;this.currentTransaction=_1;if(_1!=null){this.logInfo("Resubmitting transaction number: "+_1.transactionNum);delete _1.suspended;delete _1.clearedPrompt;var _3=_1.$76k||isc.emptyObject;this.sendQueue(_3.callback,_3.prompt,_3.URL)}else{this.logWarn("No transaction to resubmit: transaction number "
+_1+" does not exist")}
this.currentTransaction=_2}
,isc.A.retryOperation=function isc_c_RPCManager_retryOperation(_1){this.logDebug("Server-initiated operation retry for commFrameID: "+_1);var _2=window[_1];if(!_2){this.logError("comm operation retry failed - can't locate object: "+_1);return}
_2.sendData(true)}
,isc.A.transactionAsGetRequest=function isc_c_RPCManager_transactionAsGetRequest(_1,_2,_3){if(!_1.cleared){_1=this.getTransaction(_1)||this.getCurrentTransaction()}
_2=isc.Page.getURL(_2||_1.URL||this.actionURL);if(!_3)_3={};_3._transaction=this.serializeTransaction(_1);return this.addParamsToURL(this.markURLAsRPC(_2),_3)}
,isc.A.encodeObject=function isc_c_RPCManager_encodeObject(_1){if(!_1)return{};var _2={};for(var _3 in _1){var _4=_1[_3];if(isc.isA.Date(_4)){isc.Comm.xmlSchemaMode=true;_4=_4.toSchemaDate();isc.Comm.xmlSchemaMode=null}
if(!isc.isA.String(_4)){_4=isc.JSON.encode(_4,{prettyPrint:false})}
_2[_3]=_4}
return _2}
,isc.A.encodeParameter=function isc_c_RPCManager_encodeParameter(_1,_2){if(isc.isA.Date(_2)){isc.Comm.xmlSchemaMode=true;_2=_2.toSchemaDate();isc.Comm.xmlSchemaMode=null}else if(isc.isA.Array(_2)){if(_2.length==0)return null;var _3=isc.SB.create();for(var i=0;i<_2.length;i++){_3.append(this.encodeParameter(_1,_2[i]));if(i<_2.length-1)_3.append("&")}
return _3.release(false)}if(!isc.isA.String(_2)){_2=isc.JSON.encode(_2,{prettyPrint:false})}
return isc.SB.concat(encodeURIComponent(_1),"=",encodeURIComponent(_2))}
,isc.A.addParamsToURL=function isc_c_RPCManager_addParamsToURL(_1,_2){var _3=_1;if(!_2)return _1;for(var _4 in _2){var _5=_2[_4],_6=this.encodeParameter(_4,_5)
;if(_6!=null){_3+=_3.contains("?")?"&":"?";_3+=_6}
}
return _3}
,isc.A.addPathToURL=function isc_c_RPCManager_addPathToURL(_1,_2){var _3;var _4=_1.indexOf("?");if(_4==-1){_3=_1+_2}else{_3=_1.substring(0,_4)+_2+_1.substring(_4)}
return _3}
,isc.A.canAddPathToURL=function isc_c_RPCManager_canAddPathToURL(_1){var _2=/\/?[^\/]+\.[a-z0-9]+$/i;return _1&&!_2.test(_1)}
,isc.A.safelyCombinePaths=function isc_c_RPCManager_safelyCombinePaths(_1,_2,_3,_4){var _5=_1;for(var i=1;i<arguments.length;i++){if(!_5.endsWith("/")&&!arguments[i].startsWith("/")){_5+="/"}
_5+=arguments[i]}
return _5}
,isc.A.serializeTransaction=function isc_c_RPCManager_serializeTransaction(_1){var _2;if(isc.Browser.isSGWT){window.SmartGWT.warnOnSerializeError=true;window.SmartGWT.serializeErrorMessage="Object is part of a request being serialized for transmission to the server. See SmartClient documentation of RPCRequest.data for a table of Java types that can be converted automatically."}
if(this.dataEncoding=="JS"){isc.Comm.$ev=true;if(isc.isAn.Array(_1.operations)){var _3=isc.DataSource.get(_1.operations[0].dataSource);if(_3){isc.Comm.$136q=!!_3.trimMilliseconds}
}
_2=isc.Comm.serialize(_1.requestData);isc.Comm.$136q=null;isc.Comm.$ev=null}else{isc.Comm.$850=true;if(isc.isAn.Array(_1.operations)){var _3=isc.DataSource.get(_1.operations[0].dataSource);if(_3){isc.Comm.$136q=!!_3.trimMilliseconds}
}
_2=isc.Comm.xmlSerialize("transaction",_1.requestData);isc.Comm.$136q=null;isc.Comm.$850=null}
if(isc.Browser.isSGWT){window.SmartGWT.warnOnSerializeError=false;window.SmartGWT.serializeErrorMessage=null}
return _2}
,isc.A.markURLAsRPC=function isc_c_RPCManager_markURLAsRPC(_1){if(!_1.contains("isc_rpc="))_1+=(_1.contains("?")?"&":"?")
+"isc_rpc=1&isc_v="+isc.versionNumber;return _1}
,isc.A.markURLAsXmlHttp=function isc_c_RPCManager_markURLAsXmlHttp(_1){if(!_1.contains("isc_xhr="))_1+=(_1.contains("?")?"&":"?")+"isc_xhr=1";return _1}
,isc.A.addDocumentDomain=function isc_c_RPCManager_addDocumentDomain(_1){if(!_1.contains("isc_dd="))_1+=(_1.contains("?")?"&":"?")+"isc_dd="+document.domain;return _1}
,isc.A.registerUnmaskedTarget=function isc_c_RPCManager_registerUnmaskedTarget(_1){if(!this.unmaskedTargets)this.unmaskedTargets=[];this.unmaskedTargets.add(_1)}
,isc.A.unregisterUnmaskedTarget=function isc_c_RPCManager_unregisterUnmaskedTarget(_1){if(this.unmaskedTargets)this.unmaskedTargets.remove(_1)}
,isc.A.sendQueue=function isc_c_RPCManager_sendQueue(_1,_2,_3,_4){var _5=this.currentTransaction;this.currentTransaction=null;this.queuing=false;if(!_5){this.logInfo("sendQueue called with no current queue, ignoring");return false}
if(_4&&!_5.synchronousCallback){this.delayCall("$84s",[_1,_2,_3,_5])}else{return this.$84s(_1,_2,_3,_5)}
}
,isc.A.$84s=function isc_c_RPCManager__sendQueue(_1,_2,_3,_4){var _5=_4.operations[0];if(_4.$209v){_5=_4.$209v;if(this.logIsInfoEnabled()&&_5!=_4.operations[0]){this.logInfo("Using the upload request as the definitive request in the current transaction since for file upload, the request's form must be submitted")}
}
if(((!isc.Page.isLoaded()&&_5.transport!="xmlHttpRequest")||this.delayingTransactions)&&!_5.$38j){_4.$76k={callback:_1,prompt:_2,URL:_3
};if(!this.delayingTransactions){isc.Page.setEvent("load",this,isc.Page.FIRE_ONCE,"resendDelayedTransactions");this.delayingTransactions=true}
this.delayTransaction(_4);return _5}
_4.timestamp=new Date().getTime();if(!this.onLine&&!this.offlinePlayback){this.offlineTransaction(_4);return _5}
var _6=true;for(var i=0;i<_4.operations.length;i++){if(!_4.operations[i].clientOnly){_6=false;break}
}
if(_6){_4.allClientOnly=true;_4.sendTime=isc.timeStamp();if(_1!=null){_4.$40c=_1}
if(_4.synchronousCallback){this.$39d(_4,_4.transactionNum)}else{this.delayCall("$39d",[_4.transactionNum],(this.clientOnlyResponseDelay||0))}
return _5}
_3=_4.URL=isc.Page.getURL(_3||_4.URL||this.actionURL);if(_5.doNotTrackRPC)_3=this.addParamsToURL(_3,{isc_noLog:"1"});if(_5.clientLogContext)_3=this.addParamsToURL(_3,{isc_clctx:_5.clientLogContext});else if(this.clientLogContext)_3=this.addParamsToURL(_3,{isc_clctx:this.clientLogContext});if(_5.$1760)_3=this.addParamsToURL(_3,{isc_delay:_5.$1760});var _8=false;if(!_5.useSimpleHttp&&_4.transport!="scriptInclude"){_3=this.markURLAsRPC(_3);if(_4.transport=="xmlHttpRequest"){_3=this.markURLAsXmlHttp(_3);_8=true}else{_3=this.addParamsToURL(_3,{isc_tnum:_4.transactionNum})}
if(document.domain!=location.hostname)_3=this.addDocumentDomain(_3)}
_2=_4.prompt=((_4.showPrompt==null||_4.showPrompt)?(_2||_4.prompt||this.defaultPrompt):null);if(_2)this.doShowPrompt(_4,_2,_4.promptDelay||this.promptDelay);var _9={};var _10=false;for(var i=0;i<_4.operations.length;i++){var _11=_4.operations[i];var _12=_11.params,_13=_12!=null;if(_8){_12=_12||{};_12.isc_tnum=_4.transactionNum}
var _14=_11.queryParams;var _15=_12;if(_14&&isc.isAn.Object(_14)){_3=_4.URL=this.addParamsToURL(_3,_14)}
if(_13&&_10){this.logWarn("Multiple RPCRequests with params attribute in one transaction - merging")}
if(_12){if(isc.isA.String(_12)){if(window[_12])_12=window[_12];else if(isc.Canvas.getForm(_12))_12=isc.Canvas.getForm(_12);else{this.logWarn("RPCRequest: "+isc.Log.echo(_11)
+" was passed a params value: "+_12
+" which does not resolve to a component or a native form - request to server will not include these params");_12=null}
}
if(isc.isA.Class(_12)){if(_12.getValues)_12=_12.getValues();else{this.logWarn("RPCRequest: "+isc.Log.echo(_11)
+" was passed an instance of class "+_12.getClassName()
+" (or a global ID that resolved to this class) - this class does not support the getValues() method - request to server will not include these params")}
}
if(_12&&!isc.isAn.Object(_12)){this.logWarn("params value: "+_15+" for RPCrequest: "
+isc.Log.echo(_11)+" resolved to non-object: "
+isc.Log.echo(_12)+" - request to server will not include these params");_12=null}
if(_12){isc.addProperties(_9,_12);_10=true}
}
}
if(this.logIsInfoEnabled()){this.logInfo("sendQueue["+_4.transactionNum+"]: "+_4.operations.length+" RPCRequest(s); transport: "+_4.transport+"; target: "+_3)}
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","start")}
}
_4.changed();_4.callback="isc.RPCManager.performTransactionReply(transactionNum,results,wd)";if(_1)_4.$40c=_1;var _12=_9;var _16=_4.transport,_17="send"+(_16.substring(0,1).toUpperCase())+_16.substring(1);if(isc.Comm[_17]==null){this.logWarn("Attempt to send transaction with specified transport '"
+_4.transport+"' failed - unsupported transaction type.");return}
this.$39a(_4);var _18,_19=[];for(var i=0;i<_4.operations.length;i++){if(_4.operations[i].isRestRequest){_19.push(_4.operations[i])}
}
if(_19.length>1){if(_19[0].contentType==this.$89f){_18="<transaction transactionNum=\""+_4.transactionNum+"\">";_18+="<operations>";for(var i=0;i<_19.length;i++){_18+=_19[i].data}
_18+="</operations>";_18+="</transaction>"}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,onprogress:this.$258g(_5,_5.xhr_onProgress),onloadstart:this.$258g(_5,_5.xhr_onLoadStart),onload:this.$258g(_5,_5.xhr_onLoad),onloadend:this.$258g(_5,_5.xhr_onLoadEnd),onabort:this.$258g(_5,_5.xhr_onAbort),onerror:this.$258g(_5,_5.xhr_onError)
});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.evalBoundary;isc.B.push(isc.A.$258g=function isc_c_RPCManager__wrapXHRprogressHandler(_1,_2){if(_2==null)return null;var _3=this;return function(_4){_3.fireCallback(_2,"progressEvent,request",[_4,_1])}
}
,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;if(false==this.handleTransportError(_1,_4.status,_4.httpResponseCode,_4.httpResponseText))
{this.cancelDefaultErrorHandling(_4)}
if(_4.containsCredentials&&!_4.ignoreReloginMarkers&&this.$216y(_6)&&this.loginWindow)
{var _12=this.loginWindow.loginForm;_12.setValue("loginFailure",this.reloginCommFailureMessage);_12.showItem("loginFailure");this.cancelDefaultErrorHandling(_4)}
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.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.length<this.maxLoginPageLength){if(this.loginSuccessMarker.indexOf(this.loginStatusCodeMarker)!=0
||this.maxLoginAttemptsExceededMarker.indexOf(this.loginStatusCodeMarker)!=0
||this.loginRequiredMarker.indexOf(this.loginStatusCodeMarker)!=0){}else{var _4=_3.indexOf(this.loginStatusCodeMarker);if(_4==-1)return false}
if(_3.indexOf(this.loginRequiredMarker,_4)!=-1){this.handleLoginRequired(_2);return true}else if(_3.indexOf(this.loginSuccessMarker,_4)!=-1){this.handleLoginSuccess(_2);return true}else if(_3.indexOf(this.maxLoginAttemptsExceededMarker,_4)!=-1){this.handleMaxLoginAttemptsExceeded(_2);return true}
}
return false}
,isc.A.processLoginStatusCode=function isc_c_RPCManager_processLoginStatusCode(_1,_2){if(_1.status==isc.RPCResponse.STATUS_LOGIN_REQUIRED){this.handleLoginRequired(_1.transactionNum);return true}else if(_1.status==isc.RPCResponse.STATUS_LOGIN_SUCCESS){this.handleLoginSuccess(_1.transactionNum);return true}else if(_1.status==isc.RPCResponse.STATUS_MAX_LOGIN_ATTEMPTS_EXCEEDED){this.handleMaxLoginAttemptsExceeded(_1.transactionNum);return true}
return false}
,isc.A.responseRequiresLogin=function isc_c_RPCManager_responseRequiresLogin(_1,_2){return false}
,isc.A.createRPCResponse=function isc_c_RPCManager_createRPCResponse(_1,_2,_3){var _4=isc.addProperties({operationId:_2.operation.ID,clientContext:_2.clientContext,internalClientContext:_2.internalClientContext,context:_2,transactionNum:_1.transactionNum,httpResponseCode:_1.httpResponseCode,httpResponseText:_1.httpResponseText,xmlHttpRequest:_1.xmlHttpRequest,transport:_1.transport,status:_1.status,clientOnly:_2.clientOnly
},_3);if(_1.transport=="xmlHttpRequest"){isc.addProperties(_4,{httpHeaders:this.getHttpHeaders(_1.xmlHttpRequest,_1)
})}
return _4}
,isc.A.getHttpHeaders=function isc_c_RPCManager_getHttpHeaders(_1,_2){if(_2.allClientOnly){return}
if(!_1){this.logWarn("getHttpHeaders called with a null XmlHttpRequest object");return}
if(!isc.Browser.isIE&&!_1.getAllResponseHeaders){return null}
var _3;try{_3=_1.getAllResponseHeaders()}catch(e){this.logWarn("Exception thrown by xmlHttpRequest.getAllResponseHeaders(): "+e)}
if(!_3){this.logWarn("xmlHttpRequest.getAllResponseHeaders() returned null");return null}
var _4=_3.split('\n');var _5={};for(var i=0;i<_4.length;i++){if(_4[i].replace(/^\s+|\s+$/g,'')=="")continue;var _7=_4[i].indexOf(':');if(_7==-1){this.logWarn("GetAllResponseHeaders string had malformed entry at line "+1+".  Line reads "+_4[i]);continue}
var _8=_4[i].substring(0,_7);_5[_8]=_4[i].substring(_7+1).replace(/^\s+|\s+$/g,'');if(_5[_8]=="true")_5[_8]=true;if(_5[_8]=="false")_5[_8]=false}
if(_5["X-Proxied-Set-Cookie"]!=null){_5["Set-Cookie"]=_5["X-Proxied-Set-Cookie"]}
return _5}
,isc.A.$89o=function isc_c_RPCManager__stripXMLTransactionTags(_1){var _2=_1.indexOf(this.$89j);if(_2!=-1){return _1.substring(_2+this.$89j.length,_1.lastIndexOf(this.$89k))}
return _1}
,isc.A.$89g=function isc_c_RPCManager__getXMLResponses(_1){_1=this.$89o(_1);var _2=[];var _3=0;if(_1){while(true){var _4=_1.indexOf(this.$89l,_3);if(_4==-1)break;_3=_1.indexOf(this.$89m,_4);if(_3==-1)break;_2.add(_1.substring(_4,_3+this.$89m.length))}
}
return _2}
,isc.A.$89n=function isc_c_RPCManager__stripRestTags(_1,_2){if(!_1||!_2)return _1;var _3=_2.jsonPrefix?_1.indexOf(_2.jsonPrefix):0,_4=_2.jsonPrefix?_2.jsonPrefix.length:0,_5=_2.jsonSuffix?_1.lastIndexOf(_2.jsonSuffix):_1.length;if(_3==-1){this.logWarn("DataSource "+_2.ID+": REST response did not contain the jsonPrefix configured for this DataSource ('"+_2.jsonPrefix+"'). Response evaluation may well fail as a result. Check your server logic and/or DataSource definition.");_3=0}
if(_5==-1){this.logWarn("DataSource "+_2.ID+": REST response did not contain the jsonSuffix configured for this DataSource ('"+_2.jsonSuffix+"'). Response evaluation may well fail as a result. Check your server logic and/or DataSource definition.");_3=_1.length}
return _1.substring(_3+_4,_5)}
,isc.A.$39d=function isc_c_RPCManager__performTransactionReply(_1){var _2=this.getTransaction(_1);this.clearTransactionTimeout(_1);if(!_2)return;if(this.logIsDebugEnabled()){this.logDebug("Result string for transaction "+_1+": "+isc.Log.echoAll(_2.results))}
var _3;var _4=false;var _5=false,_6=false,_7=null;if(_2.operations[0]
&&_2.operations[0].allowIE9Leak!=null)
{_5=_2.operations[0].allowIE9Leak}else if(isc.RPCManager.allowIE9Leak){_5=true}
if(_2.operations[0]&&_2.operations[0].useStrictJSON!=null){_6=_2.operations[0].useStrictJSON;_7=_2.operations[0].jsonReviver||_2.jsonReviver}else if(_2.useStrictJSON!=null){_6=_2.useStrictJSON;_7=_2.jsonReviver}
if(this.$257s()){_2.parseOrEvalResponseStart=isc.timeStamp()}
var _8=(_2.results&&_2.results instanceof Blob);if(_8){var _9=_2.xmlHttpRequest;if(_9){var _10=this.getHttpHeaders(_9,_2)||{};var _11=0;for(var _12 in _10){if(_12.toLowerCase()=="x-isc-server-status"){_2.scServerStatus=_10[_12];break}
}
}
}else if(_2.transport=="scriptInclude"){}else if(isc.isAn.Array(_2.results)){_3=true}else if(_2.allClientOnly){_2.results={status:0};_2.receiveTime=isc.timeStamp()}else{var _13=_2.operations[0];if(_13&&_13.isRestRequest){var _14=isc.DataSource.get(_13.dataSource);if(_14){if(_13&&_13.dataFormat=="json"&&_14.jsonPrefix==null)
{_3=true}else{var _15=_2.results?_2.results.indexOf(_14.jsonPrefix):-1;_3=_15!=-1}
if(_3){var _16=_2.results;_16=this.$89n(_16,_14);try{if(_6){_2.results=isc.Class.parseStrictJSON(_16,_7)}else{_2.results=isc.eval("("+_16+")",(_5?false:true))}
}catch(e){this.logWarn("Error evaling REST RPC response: "+e
+" response text: "+_16)}
}
}
}
if(!_3){var _17=isc.isAn.Array(_2.operations)?_2.operations[0]
:null;if(_17&&_17.isRestRequest&&_2.operations.length>1){if(_17.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");_4=true}else{_2.results=this.$89g(_2.results);_3=_2.results!=null}
}
}
}
if(this.$257s()){_2.parseOrEvalResponseEnd=isc.timeStamp()}
var _18=_2.results;if(_3&&!isc.isAn.Array(_18))_18=[_18];var _19=_2.operations,_20=[];_2.$66n=true;this.$210b=_2.transactionNum;for(var i=0,j=0;i<_19.length;i++){var _13=_19[i];var _23;if(_3&&_13.clientOnly){_23=isc.addProperties(this.createRPCResponse(_2,_13),{isStructured:false
})}else{_23=isc.addProperties(this.createRPCResponse(_2,_13),{isStructured:_3,callbackArgs:_2.transport=="scriptInclude"?_18:null,results:_3?_18[j]:_18
});if(_3&&_13.isRestRequest){isc.addProperties(_23,{data:_18[j]})}
j++}
if(_4){_23.status=isc.DSResponse.INVALID_RESPONSE_FORMAT;_23.data="The server failed to return a formatted response at all."}
if(_2.$1774)_23.$1774=true;if(_2.scServerStatus!=null){_23.scServerStatus=_2.scServerStatus
}
if(_23.status==null){_23.status=_23.scServerStatus!=null?_23.scServerStatus:0}
if(_23.isStructured){if(_23.results&&_23.results.errors){var _24=_23.results.errors;if(isc.isAn.Array(_24)&&_24.length==1){_24=_24[0]}
}
if(_23.results&&!_13.isRestRequest){if(!_23.results.response){isc.addProperties(_23,_23.results)}else{isc.addProperties(_23,_23.results.response)}
}
}
_20[i]=_23;_2.responses[i]=_23}
_2.changed();if(_2.showPrompt&&!_2.allClientOnly)this.doClearPrompt(_2);var _25=0;while(_25<_19.length&&!_2.suspended&&!_2.abortCallbacks)
{var _13=_19[_25],_23=_20[_25];if(isc.DataSource){isc.DataSource.recordTimingData(_23,"Parse/eval response","start",_2.parseOrEvalResponseStart);isc.DataSource.recordTimingData(_23,"Parse/eval response","end",_2.parseOrEvalResponseEnd);isc.DataSource.recordTimingData(_23,"performOperationReply","start")}
this.$2584(_13,_23);this.performOperationReply(_13,_23);if(isc.DataSource){isc.DataSource.recordTimingData(_23,"performOperationReply","end")}
_25++}
if(!_2.suspended&&!_2.abortCallbacks){if(this.transactionComplete!=null){this.clearTransactionPendingRpcs(_2);this.transactionComplete(_2);this.clearTransaction(_1,true,true)}else{this.clearTransaction(_1,false,true)}
}
delete _2.abortCallbacks;delete _2.$66n;delete this.$210b;if(_2.offline)this.playbackNextOfflineTransaction();if(isc.DataSource){var _26=isc.timeStamp();var _25=0;while(_25<_19.length&&!_2.suspended&&!_2.abortCallbacks)
{isc.DataSource.recordTimingData(_20[_25++],"User callback invoked","start",_26)}
}
if(_2.$40c){var _27=_13.application?_13.application
:this.getDefaultApplication();if(isc.isA.String(_27))_27=window[_27];_27.fireCallback(_2.$40c,"responses",[_2.responses])}
if(isc.DataSource){var _28=isc.timeStamp();var _25=0;while(_25<_19.length&&!_2.suspended&&!_2.abortCallbacks)
{isc.DataSource.recordTimingData(_20[_25],"User callback invoked","end",_28);isc.DataSource.recordTimingData(_20[_25++],"Client processing","end",_28)}
}
this.$257t(_1,_2)}
,isc.A.addOperationReplyCallback=function isc_c_RPCManager_addOperationReplyCallback(_1){var _2=this.$2582++;this.$2583[_2]=_1;return _2}
,isc.A.removeOperationReplyCallback=function isc_c_RPCManager_removeOperationReplyCallback(_1){delete this.$2583[_1]}
,isc.A.$2584=function isc_c_RPCManager__fireOperationReplyNotifications(_1,_2){var _3=false;var _4=_1.dataSource;if(_4!=null)_4=isc.DataSource.getDataSource(_4);if(_4&&_4.$145w)return;var _5=this.$2583;for(var _6 in _5){this.fireCallback(_5[_6],"request,response",[_1,_2])}
}
,isc.A.addProcessingCompleteCallback=function isc_c_RPCManager_addProcessingCompleteCallback(_1){var _2=this.$257p++;this.$257q[_2]=_1;return _2}
,isc.A.removeProcessingCompleteCallback=function isc_c_RPCManager_removeProcessingCompleteCallback(_1){delete this.$257q[_1]}
,isc.A.$257t=function isc_c_RPCManager__transactionProcessingComplete(_1,_2){var _3=this.$257q;for(var _4 in _3){this.fireCallback(_3[_4],"transactionNum",[_1])}
delete _2.maintainTracking;if(_2.cleared){if((!this.$454&&this.$453)||_2.pushedToDebugMaster){this.$38z.remove(_2)}
}
}
,isc.A.$257s=function isc_c_RPCManager__shouldRecordTimingData(){return this.$257r||isc.Log.logIsInfoEnabled("RpcTabTiming")}
,isc.A.setTimingDataEnabled=function isc_c_RPCManager_setTimingDataEnabled(_1){_1=!!_1;if(this.$257r!=_1){this.$257r=_1;isc.Log.setPriority("RpcTabTiming",_1?isc.Log.INFO:isc.Log.defaultPriority)}
}
,isc.A.getTransactionDescription=function isc_c_RPCManager_getTransactionDescription(_1){var _2=this.getTransaction(_1,true);if(_2==null)return"Unable to retrieve transaction";var _3=this.convertToTransactionRecord(_2);if(_3.rpcs==null||_3.rpcs.length==0){return"Empty Transaction"
}
var _4=[];for(var i=0;i<_3.rpcs.length;i++){var _6=_3.rpcs[i];if(_6.ds!=null){_4.add(_6.ds+"."+_6.operationType)}else{_4.add("rpcRequest")
}
}
return("Transaction with "+_3.rpcs.length+" operation(s). ["+_4.join("; ")+"]")}
,isc.A.getFormattedTimingData=function isc_c_RPCManager_getFormattedTimingData(_1,_2,_3,_4,_5,_6){var _7=this.getTimingData(_1,function(_9){var _8=isc.RPCManager.$2571(_9,0,_6);if(_2){_2(_8)}
},_3,_4,_5);if(isc.isA.String(_7)){return _7}else{return this.$2571(_7.root,0,_6)}
}
,isc.A.$2571=function isc_c_RPCManager__getFormatted(_1,_2,_3){var _4;if(_3!=_4&&_2>=_3)return"";var _5="-------------------------------------------------------".substring(0,_2*2);_5+=" ";if(isc.isAn.Object(_1)){var _6=(_1.start?(_1.end?(_1.elapsed+"ms")
:"End time not recorded")
:"Start time not recorded");_5+=_1.name+" ("+_6+")\n";if(_1.children){for(var i=0;i<_1.children.length;i++){_5+=this.$2571(_1.children[i],_2+1,_3)}
}
}else{_5+="Unexpected value: "+_1}
return _5}
,isc.A.getTimingData=function isc_c_RPCManager_getTimingData(_1,_2,_3,_4,_5){var _6;if(isc.isAn.Object(_1)){_6=_1}else{if(isc.RPCTracker){_6=isc.RPCTracker.getTransactionRecord(_1)}else if(isc.debugTarget&&!this.$38z.find({transactionNum:_1})){_6=isc.debugTarget.call("getTransactionRecord",[_1],function(_34){isc.RPCManager.getTimingData(_34,_2,_3,_4,_5)});return"Timing data is not available synchronously because this transaction has been moved to the debugMaster.  "+(_2
?"Timing data will be provided to your callback function"
:"Please implement a callback function to receive the timing data")
}
if(!_6){_6=this.convertToTransactionRecord(this.$38z.find({transactionNum:_1}))}
}
if(!_6){return{name:"Transaction "+_1+" not found"}}
if(_6.transactionRecord){_6=_6.transactionRecord}
if(!_6.rpcs||_6.rpcs.length==0){return{name:"Transaction "+_1+" has no operations"}}
var _7,_8;var _9=0,_10=_6.rpcs.length;if(_4===_8)_4=true;if(_5===_8)_5=true;if(_3==null){var _11=_6.clientTiming?_6.clientTiming[0].start:_6.sendTime;if(_11==null&&_6.timeSent!=null)_11=_6.timeSent.getTime();_7={timeout:_6.timeout,name:"Complete client-server roundtrip",start:_11,children:[],end:_6.responseClientTiming?_6.responseClientTiming[_6.responseClientTiming.length-1].end:_6.responseReceived.getTime()
}
if(_4&&_6.clientTiming&&_6.clientTiming.length>0){var _12={timeout:_6.timeout,name:"Client processing (pre-server)",start:_6.clientTiming[0].start,children:[],end:_6.clientTiming[_6.clientTiming.length-1].end
}
_7.children.add(_12);var _13=this.cleanDup(_6.clientTiming[0].children[_6.clientTiming[0].children.length-1]);for(var i=_9;i<_10;i++){var _15,_16="Operation "+i+" client processing";if(_6.clientTiming[i]==null){isc.logWarn("Some clientTiming entries are missing.  For a multi-request queue, your code should call getTimingData() from the queue's callback method, *not* from an individual request's callback");_15={children:[]
}
_16+=" (data missing, see log)"}else{_15=this.cleanDup(isc.addProperties({},_6.clientTiming[i]));_15.children.removeAt(_15.children.length-1)}
_12.children.add({timeout:_6.rpcs[i].timeout,name:_16,start:_15.children.length>0?_15.children[0].start:0,children:_15.children,end:_15.children.length>0?_15.children[_15.children.length-1].end:0
})}
_12.children.add(_13)}
if(_5&&_6.serverTiming&&_6.serverTiming.length>0)
{var _17=_6.clientTiming&&_6.clientTiming.length>0?_6.clientTiming[_6.clientTiming.length-1].end:_7.start;var _18=_6.responseClientTiming&&_6.responseClientTiming.length>0?_6.responseClientTiming[0].start:_7.end;var _19={timeout:_6.timeout,name:"Server roundtrip",start:_17,children:[],end:_18==_8?_6.responseReceived:_18
};_7.children.add(_19);var _20=this.cleanDup(_6.serverTiming[0].children[0]);var _21=this.cleanDup(_6.serverTiming[0].children[1]);var _22=this.cleanDup(_6.serverTiming[0].children[_6.serverTiming[0].children.length-1]);_19.children.add(_20);_19.children.add(_21);var _23=[];for(var i=_9;i<_10;i++){var _24=this.cleanDup(_6.serverTiming[i].children[1]);_23.add({timeout:_6.rpcs[i].timeout,name:"Operation "+i+" server processing",start:_24.children[0].start,children:_24.children,end:_24.children[_24.children.length-1].end
})}
_21.children=_23;_19.children.add(_22);var _25=_6.serverTiming[0]?_6.serverTiming[0].start:-1,_26=_6.serverTiming.length-1,_27=_6.serverTiming[_26]?_6.serverTiming[_26].end:-1;var _28=this.getNetworkTimeNodes(_17,_6.responseReceived.getTime(),_25,_27);_19.children.addAt(_28.pre,0);_19.children.add(_28.post)}
if(_4&&_6.responseClientTiming&&_6.responseClientTiming.length>0){var _12={timeout:_6.timeout,name:"Client processing (post-server)",start:_6.responseClientTiming[0].start,children:[],end:_6.responseClientTiming[_6.responseClientTiming.length-1].end
}
_7.children.add(_12);var _29=this.cleanDup(_6.responseClientTiming[0].children[0]);var _30;if(_6.responseClientTiming[0].children.length==3){_30=this.cleanDup(_6.responseClientTiming[0].children[_6.responseClientTiming[0].children.length-1])}
_12.children.add(_29);for(var i=_9;i<_10;i++){var _15,_16="Operation "+i+" client processing";if(_6.responseClientTiming[i]==null){isc.logWarn("Some clientTiming entries are missing.  For a multi-request queue, your code should call getTimingData() from the queue's callback method, *not* from an individual request's callback");_15={children:[]
}
_16+=" (data missing, see log)"}else{_15=this.cleanDup(_6.responseClientTiming[i]);if(_30){_15.children.removeAt(_15.children.length-1)}
_15.children.removeAt(0)}
_12.children.add({timeout:_6.rpcs[i].timeout,name:_16,start:_15.children[0].start,children:_15.children,end:_15.children[_15.children.length-1].end
})}
if(_30){_12.children.add(_30)}
}
}else{var _31=_6;_6=_6.rpcs[_3];_7={timeout:_6.timeout,name:"Complete client-server roundtrip",start:_31.timeSent.getTime(),children:[],end:_31.responseReceived.getTime()
}
if(_4&&_6.clientTiming){var _32=this.cleanDup(_6.clientTiming,{name:"Client processing (pre-server)"});_7.children.add(_32);_7.start=_6.clientTiming.start}
if(_5&&_6.serverTiming){var _19={timeout:_6.timeout,name:"Server roundtrip",start:_6.clientTiming?_6.clientTiming.end:_7.start,children:[],end:_6.responseReceived.getTime()
}
_7.children.add(_19);_19.children.add(this.cleanDup(_6.serverTiming));if(_6.serverTiming.start&&_6.serverTiming.end){if(_19.start&&_19.end){var _28=this.getNetworkTimeNodes(_19.start,_19.end,_6.serverTiming.start,_6.serverTiming.end);_19.children.addAt(_28.pre,0);_19.children.add(_28.post)}
}
}
if(_4&&_31.responseClientTiming){var _12=this.cleanDup(_31.responseClientTiming[_3],{name:"Client processing (post-server)"});_7.children.add(_12);_7.end=_12.end}
}
var _33=this.populateElapsed(_7);_33=isc.Tree.create({root:_33,modelType:"children"
});if(_2){_2(_33)}
return _33}
);isc.evalBoundary;isc.B.push(isc.A.cleanDup=function isc_c_RPCManager_cleanDup(_1,_2,_3){if(!_3){this.$2573=[]}
if(isc.isAn.Array(_1)){var _4=[];for(var i=0;i<_1.length;i++){_4[i]=this.cleanDup(_1[i],null,true)}
return _4}
if(isc.isAn.Object(_1)){var _6={};for(var _7 in _1){if(!_7.startsWith("_")){var _8=(_2?_2[_7]:null)||_1[_7];if(this.cleanDupAlreadySeen(_8)){_8="*DUPLICATE*"}else{if(isc.isAn.Array(_8)||isc.isAn.Object(_8)){_8=this.cleanDup(_8,null,true);this.$2573.add(_8)}
}
_6[_7]=_8}
}
return _6}
}
,isc.A.cleanDupAlreadySeen=function isc_c_RPCManager_cleanDupAlreadySeen(_1){if(!this.$2573)return false;for(var i=0;i<this.$2573.length;i++){if(this.$2573[i]===_1)return true}
return false}
,isc.A.populateElapsed=function isc_c_RPCManager_populateElapsed(_1){if(_1.start&&_1.end){_1.elapsed=_1.end-_1.start}else{_1.elapsed=0}
var _2=_1.children;if(!_2||_2.length==0){return _1}
for(var i=0;i<_2.length;i++){this.populateElapsed(_2[i])}
return _1}
,isc.A.convertToTransactionRecord=function isc_c_RPCManager_convertToTransactionRecord(_1){if(!_1||!_1.operations||_1.operations.length==0){return null}
var _2=!!_1.allClientOnly;var _3={cancelled:_1.cancelled,receiveTime:_1.receiveTime,URL:_1.URL,transactionNum:_1.transactionNum,serializedCommResults:_1.serializedCommResults,serializedCommResultsAreFormatted:_1.serializedCommResultsAreFormatted,transport:_1.transport,clientOnly:_2
};var _4=[];var _5=[],_6=[],_7=[];for(var i=0;i<_1.operations.length;i++){var _9=_1.operations[i];var _10=_1.responses[i];_4[i]=this.rpcToRecord(_1,_9,_10);if(_10){if(_9.clientTiming){_5[i]=isc.clone(_9.clientTiming);_4[i].clientTiming=_5[i]}
if(_10.clientTiming){_7[i]=isc.clone(_10.clientTiming);_4[i].responseClientTiming=_5[i]}
if(!_2&&_10.timing){_6[i]=isc.clone(_10.timing);_4[i].serverTiming=_6[i]}
_4[i].transactionRecord=_3}
if(_1.operations.length>1)_4[i]._queueIndex=i}
_3.rpcs=_4;if(_5.length>0){_3.clientTiming=_5}
if(_7.length>0){_3.responseClientTiming=_7}
if(!_2&&_6.length>0){_3.serverTiming=_6}
_3.timeSent=_4[0].timeSent;_3.responseReceived=_4[_4.length-1].responseReceived;return _3}
,isc.A.rpcToRecord=function isc_c_RPCManager_rpcToRecord(_1,_2,_3){var _4=_2._dsRequest||_2.$374;var _5="RPCRequest";if(_4!=null)_5="DSRequest";else if(_2.data&&_2.data.is_ISC_RPC_DMI)_5="RPC DMI";else if(_2.wsOperation)_5="WSRequest";var _6;if(_2.operationType){_6=_2.operationType;if(_2.operationId){_6+="&lt;"+_2.operationId+"&gt;"}
if(_2.wsOperation)_6+="["+_2.wsOperation+"]"}else if(_2.wsOperation){_6=_2.wsOperation
}else{if(_2.data&&_2.data.methodName)_6=_2.data.methodName;else _6="RPC"}
var _7,_8;if(_2.dataSource){_7=_2.dataSource}else{if(_2.data&&_2.data.appID)_7=_2.data.appID+"/"+_2.data.className}
var _9=_2.componentId||"",_10=_2.componentContext;if(_10){_9+=" &lt;"+_10+"&gt;"}
var _11=_1.mergedActionURL?_1.mergedActionURL
:_2.actionURL;if(_1.isProxied)_11=_1.proxiedURL;if(_1.allClientOnly)_11="[client only]";var _12={url:_11,transactionNum:_1.transactionNum,type:_5,ds:_7,operationType:_6,componentId:_9,transport:_2.transport,httpMethod:_2.httpMethod,timeSent:new Date(_1.sendTime?_1.sendTime:Date.now()),proxied:_2.isProxied,timeout:_1.timeout,xhrData:_1.xhrData,xhrHeaders:_1.xhrHeaders,callStack:_2.$138k,clientTiming:_2.clientTiming
};if(_3&&_3.clientOnlyData){_12.clientOnlyData=isc.JSON.encode(_3.clientOnlyData,{prettyPrint:true,strictQuoting:false,serializeInstances:"short",skipInternalProperties:true})}
if(_12.transport=="xmlHttpRequest"||_12.transport=="hiddenFrame"){var _13=["actionURL","showPrompt","prompt","transport","useSimpleHttp","promptStyle","timeout","params","httpMethod","contentType","httpHeaders","ignoreTimeout","sendNoQueue","paramsOnly","bypassCache","isProxied"];if(_12.type=="RPCRequest"){_13.addList(["callback","willHandleError","evalResult","evalVars","serverOutputAsString","containsCredentials","clientContext","internalClientContext"])}
_13.add("data");var _14=isc.applyMask(_2,_13);_12.decoded=isc.JSON.encode(_14,{prettyPrint:true,serializeInstances:"short"})}
var _15=_2._dsRequest||_2.$374;if(_15){var _13=["dataSource","operationType","operationId","componentId","data","startRow","endRow","sortBy","textMatchStyle","fieldValueExpressions","resultSet","resultTree","parentNode","callback","willHandleError","showPrompt","prompt","oldValues","requestId","clientContext","internalClientContext"
];var _16=(_15.operation&&_15.operation.source=="auto");var _17={};for(var i=0;i<_13.length;i++){var _19=_13[i];if(_19=="operationId"&&_16)continue;var _20=_15[_19];if(_20==null)continue;if(_19=="parentNode"){_17[_19]=this.getShallowData(_20)}else if(_19=="clientContext"||_19=="internalClientContext"){var _21=_17[_19]={};for(var _22 in _20){_21[_22]=this.getShallowData(_20[_22])}
}else{_17[_19]=_20}
}
var _23=["originalData","operation","unconvertedDSRequest"];var _24=isc.getKeys(_15);for(var i=0;i<_24.length;i++){var _19=_24[i];if(_13.contains(_19))continue;if(_23.contains(_19))continue;var _20=_15[_19];if(_20==null)continue;if(!isc.DS.isSimpleTypeValue(_20)&&!isc.isAn.Instance(_20))continue;_17[_19]=_20}
var _25=isc.JSON.encode(_17,{prettyPrint:true,strictQuoting:false,serializeInstances:"short",skipInternalProperties:true});_12.dsReqJSON=_25;if(_8){_12.aiPromptText=_4.data.text}
}
if(_3){var _13=["operationId","transactionNum","httpResponseCode","transport","status","clientOnly","httpHeaders","isStructured","isDSResponse","invalidateCache","startRow","endRow","totalRows","clientTiming","timing"];var _26=isc.applyMask(_3,_13);_26.responseClientTiming=_26.clientTiming;_12.rpcResponseRecord=isc.JSON.encode(_26,{prettyPrint:false,strictQuoting:false,serializeInstances:"short",skipInternalProperties:false})}
if(_3){isc.addProperties(_12,{status:_3.status,httpCode:_3.httpResponseCode,responseReceived:new Date(_1.receiveTime)
});if(_8){var _27=_3.data;if(_27&&_27.length==1){var _28=_27[0];_12.aiResponseText=_28.chat_content}
}
}else if(_1.cancelled){isc.addProperties(_12,{status:"CANCELLED"
})}else if(_1.cleared){isc.addProperties(_12,{status:"CLEARED"
})}else if(_1.suspended){isc.addProperties(_12,{status:"RELOGIN_SUSPENDED"
})}
return _12}
,isc.A.getNetworkTimeNodes=function isc_c_RPCManager_getNetworkTimeNodes(_1,_2,_3,_4){var _5={};var _6=_2-_1,_7=_4-_3,_8=_6-_7;if(_8%2)_8+=1;_8/=2;_5.pre={name:"Network time (inferred)",start:_1,end:_1+_8
};_5.post={name:"Network time (inferred)",start:_1+_8+_7,end:_1+_8+_7+_8
};return _5}
,isc.A.getShallowData=function isc_c_RPCManager_getShallowData(_1){if(isc.DS.isSimpleTypeValue(_1))return _1;var _2={},_3=isc.isA.Instance(_1),_4=_3?_1.getClass().getPrototype():null;for(var _5 in _1){var _6=_1[_5];if(_6==null)continue;if(_3&&_4&&_4[_5]==_6)continue;if(isc.DS.isSimpleTypeValue(_6)){_2[_5]=_6}else{_2[_5]={output:isc.echoLeaf(_6),$eu:function(){return this.output}
}
}
}
return _2}
,isc.A.performOperationReply=function isc_c_RPCManager_performOperationReply(_1,_2){var _3=_2.results,_4=_1.operation;if(this.logIsInfoEnabled()){if(_1.downloadResult){this.logInfo("processing rpcResponse to XHR download request")}else{this.logInfo("rpcResponse(unstructured) results -->"
+isc.Log.echoAll(_3)+"<--")}
}
var _5=isc.RPC.transformResponse(_2,_1,_1.data);_2=_5||_2;if(this.processLoginStatusCode(_2,_2.transactionNum))return;var _6=_2.isStructured&&(!_3||(_3.status<0)||(_3.status==null&&_2.status<0));if(_2.scServerStatus!=null){_6=_6||(_2.scServerStatus<0)
}
if(_6&&_3 instanceof Blob){this.$258o(_3,_2,_1,{target:this,methodName:"completeOperationReply"}
)}else{this.completeOperationReply(_2,_1)}
}
,isc.A.completeOperationReply=function isc_c_RPCManager_completeOperationReply(_1,_2){if(_1.status<0&&_2.willHandleError!=true){return this.$a0(_1,_2)}
if(_2.downloadResult){this.$258h(_1,_2);return}
this.fireReplyCallbacks(_2,_1)}
,isc.A.saveToFilesystem=function isc_c_RPCManager_saveToFilesystem(_1,_2,_3,_4){var a=document.createElement('a');a.id="testAnchor";var _6=window.URL.createObjectURL(_1);a.href=_6;if(_3!=null)a.type=_3;a.download=_2;if(_4!=null)a.target=_4;a.dispatchEvent(new MouseEvent('click'));isc.Timer.setTimeout(function(){window.URL.revokeObjectURL(_6)},100
)}
,isc.A.showFileInNewWindow=function isc_c_RPCManager_showFileInNewWindow(_1,_2,_3,_4,_5){if(_3!=null&&_3!=_1.type){_1=new Blob([_1],{type:_3})}
if(_5==null)_5=this.browserMimeTypes;if(_5!=null){var _6=_3==null?"":_3.split(";")[0];if(!_5.contains(_6)){this.logWarn("Request to show downloaded file with mime-type:"+_3+" in a new browser window. This is not registered as a browser-supported mime-type.\nAttempting to display a file with a mime-type the browser does not support will lead to a file download, but the configured fileName ["+_2+"] will not be applied to the downloaded file.\nSmartClient will perform a standard download with the correct fileName instead.\nTo modify the registered set of browser-supported mime-types see isc.RPCManager.browserMimeTypes.\nTo disable this safety check, set this property to null.\n"
);return this.saveToFilesystem(_1,_2,_3,_4)}
}
var _7=window.URL.createObjectURL(_1);var _8=window.open(_7,_4||"_blank");this.delayCall("$258i",[_7,_8],500)}
,isc.A.$258i=function isc_c_RPCManager__revokeFileWindowURL(_1,_2){var _3=(_2==null||_2.closed),_4=false;if(!_3){var _5=_2.document.readyState;if(_5=="complete")_4=true}
if(_3||_4){window.URL.revokeObjectURL(_1)}else{this.delayCall("$258i",[_1,_2],500)}
}
,isc.A.$258h=function isc_c_RPCManager__processXHRDownloadResponse(_1,_2){var _3=_2.download_filename||_2.exportFilename,_4;var _5=_1.status<0;if(!_5){if(_1.httpHeaders){if(_3==null){var _6=_1.httpHeaders["content-disposition"],_7=isc.isA.String(_6)?_6.search(new RegExp("filename","i")):-1;if(_7>0){_7=_6.indexOf("=",_7)+1;var _8=_6.indexOf(";",_7);if(_8==-1)_8=_6.length;_3=_6.substring(_7,_8);_3=_3.replace(/^(\s)*\"?|\"?(\s)*$/g,"")
}
}
_4=_1.httpHeaders["content-type"]}
}
var _9=_1.isStructured?_1.data:_1.results;var _10=true;if(_2.downloadCallback!=null){var _11=this.fireCallback(_2.downloadCallback,"response,data,fileName,type,request",[_1,_9,_3,_4,_2]
);if(_11!=null)_10=_11}
if(_10&&!_5){if(_2.downloadToNewWindow){this.showFileInNewWindow(_9,_3,_4)}else{this.saveToFilesystem(_9,_3,_4)}
}
}
,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=false;if(isc.Class.$254u&&_1.$254z){isc.Class.suspendAEM();_3=true}
var _4=_1.operation,_5=_2.results,_6=_1.evalResult&&_1.transport!="scriptInclude"?this.evalResult(_1,_2,_5):null
;var _7;_7=(_1.evalResult?_6:_5);_2.data=_7;var _8=this.getTransaction(_2.transactionNum);var _9=_1.callback;if(_9!=null){this.fireReplyCallback(_9,_1,_2,_7)}
if(_3)isc.Class.unsuspendAEM()}
,isc.A.handleError=function isc_c_RPCManager_handleError(_1,_2){return this.runDefaultErrorHandling(_1,_2,this.defaultErrorFormatter)}
,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 _1.$1774?false:this.handleError(_1,_2)}
,isc.A.$258o=function isc_c_RPCManager__parseBinaryErrorResponse(_1,_2,_3,_4){_1.text().then(function(_5){if(isc.isA.Object(jsResult)){if(isc.isAn.Array(jsResult))jsResult=jsResult[0];_2=isc.addProperties({},_2,jsResult)}else{_2.data=_5}
isc.RPCManager.fireCallback(_4,"response,request",[_2,_3])})}
,isc.A.$281n=function isc_c_RPCManager___getCodeName(_1){var _2=isc.getKeyForValue(_1.status,isc.RPCResponse.errorCodes);if(isc.isA.String(_2)){if(_2.startsWith("STATUS_"))_2=_2.substring(7)}else{_2=(_1.status!=null?"error code: "+_1.status
:"unknown error code")}
return _2}
,isc.A.$281o=function isc_c_RPCManager___callErrorFormatter(_1,_2,_3){var _4=this.$281n(_1);return _3(_4,_1,_2)}
,isc.A.getDefaultErrorMessage=function isc_c_RPCManager_getDefaultErrorMessage(_1,_2,_3){var _4=_1.data;if(isc.isA.String(_4)){return _4}
var _5=this.$281n(_1);if(_3)return _3(_5,_1,_2);var _6="",_7="";if(_4&&_4.is_ISC_RPC_DMI){if(_4.appID=="isc_builtin"){_6="Builtin RPC: "+_4.methodName+": "}else{_6="RPCDMI: appId: '"+_4.appID+"', className: '"+_4.className+"', methodName: '"+_4.methodName+"': "}
}
if(_5=="MAX_FILE_SIZE_EXCEEDED"){_6+=isc.DataSource.maxFileSizeExceededMessage.evalDynamicString(this,{maxFileSize:_1.maxFileSize,uploadedFileName:String(_1.uploadedFileName).asHTML(),uploadedFileSize:_1.uploadedFileSize
});_7=this.$1613}else if(_5=="FILE_REQUIRED_ERROR"){_6+=isc.DataSource.requiredFileMessage.evalDynamicString(this,{uploadedFileName:String(_1.uploadedFileName).asHTML()
});_7=this.$1613}else if(_5=="CRITERIA_REQUIRED_ERROR"||_5=="REQUIRED_CRITERIA_MISSING"){_6+=isc.DataSource.requiredCriterionMessage.evalDynamicString(this,{requiredCriterion:String(_1.missingCriterion).asHTML()
});_7=this.$1613}else if(_5=="VALIDATION_ERROR"){_6+="Server returned validation errors: "+String(isc.echoFull(_1.errors));_7=this.$1613}else{var _8=_1.operationId||_1.operationType;_6+="Server returned "+_5+" with no error message"+(_8?" performing operation '"+_8+"'.":".")}
_6=new String(_6);_6.$281p=_7;return _6}
,isc.A.runDefaultErrorHandling=function isc_c_RPCManager_runDefaultErrorHandling(_1,_2,_3){var _4=this.getDefaultErrorMessage(_1,_2,_3);if(isc.isA.String(_1.data)){var _5=_4;if(_5.length>this.maxErrorMessageLength){var _6=_5.length-this.maxErrorMessageLength;_5=_5.substring(0,this.maxErrorMessageLength)
+"<br><br>...("+_6+" bytes truncated - set isc.RPCManager.maxErrorMessageLength > "
+this.maxErrorMessageLength
+" to see more or check the Developer Console for full error)..."}
this.reportError(_5)}else{if(_3&&this.$281o(_1,_2,_3)!=null){isc.warn(_4)}else{this.reportError(_4,_1.stacktrace)}
}
this.logWarn(_4+(_4.$281p?_4.$281p:"")+" - response: "+this.echo(_1));return false}
,isc.A.handleTransportError=function isc_c_RPCManager_handleTransportError(_1,_2,_3,_4){}
,isc.A.cancelDefaultErrorHandling=function isc_c_RPCManager_cancelDefaultErrorHandling(_1){if(!_1)return;_1.$1774=true;this.logInfo("Canceled error handling for transaction #"+_1.transactionNum)}
,isc.A.$216y=function isc_c_RPCManager__isHttpResponseCommFailure(_1){if(_1>=500&&_1<600)switch(_1){case 500:case 501:case 505:case 507:case 508:case 510:case 520:case 526:return false;default:return true}
switch(_1){case 404:case 408:case 420:case 430:case 429:case 0:return true;default:return false}
}
,isc.A.handleLoginRequired=function isc_c_RPCManager_handleLoginRequired(_1){if(this.$39j&&!this.$39j.closed&&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){if(this.useReloginZLayer)isc.Canvas.setDefaultBigZLayer("$2483");_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.setPostMessageReloginEnabled=function isc_c_RPCManager_setPostMessageReloginEnabled(_1){if(this.supportsPostMessageRelogin==_1)return;this.supportsPostMessageRelogin=_1;if(_1){this.setupReloginListener()}else{this.clearReloginListener()}
}
,isc.A.setupReloginListener=function isc_c_RPCManager_setupReloginListener(){this.$2574=function(_1){if(!isc.RPCManager.supportsPostMessageRelogin){return}
isc.RPCManager.processLoginStatusMessage(_1)}
window.addEventListener("message",this.$2574,false
)
}
,isc.A.clearReloginListener=function isc_c_RPCManager_clearReloginListener(){if(this.$2574!=null){window.removeEventListener("message",this.$2574,false);delete this.$2574}
}
,isc.A.processLoginStatusMessage=function isc_c_RPCManager_processLoginStatusMessage(_1){var _2=_1.data,_3=_2=="isc_loginRequired",_4=_2=="isc_loginSuccess",_5=_2=="isc_maxLoginAttemptsExceeded";if(!_3&&_4&&_5)return;var _6=this.$39j;if(_6&&_6.closed)_6=null;var _7=_1.source==window||_1.source==_6;if(!_7){var _8=isc.HiddenFrame.$h6;for(var i=0;i<_8.length;i++){if(_1.source==_8[i].getHandle()){_7=true;break}
}
}
if(!_7){var _10=this.postMessageReloginPolicy;if(_10!="*"&&_10!=null){if(!isc.isAn.Array(_10))_10=[_10];var _11=false;for(var i=0;i<_10.length;i++){var _12=_10[i];if(_12=="same")_12=window.origin;if(_1.origin==_12){_11=true;break}
}
if(!_11){this.logWarn("RPCManager - ignoring attempt to set login status via postMessage() from origin:"+_1.origin+". Configure the RPCManager.postMessageReloginPolicy if you want to allow login status to be set from this origin.");return}
}
}
if(_3){isc.RPCManager.handleLoginRequired(_1.source)}else if(_4){isc.RPCManager.handleLoginSuccess(_1.source)}else if(_5){isc.RPCManager.handleMaxLoginAttemptsExceeded(_1.source)}
}
,isc.A.handleLoginSuccess=function isc_c_RPCManager_handleLoginSuccess(_1){if(this.useReloginZLayer)isc.Canvas.setDefaultBigZLayer("default");var _2=this.getTransaction(_1);if(isc.EventStream.streams){isc.EventStream.addLoginEvent(_2,isc.EventStream.RELOGIN)}
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();delete this.$39j}
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();delete this.$39j}
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.trimCharacters("/").split("/").last(),_5=_2.exportDisplay,_6=_5==this.$1873
;var _7={pdfName:_2.exportFilename||_2.pdfName||"export",skinName:_2.skinName||_4,exportCSS:_2.exportCSS,defaultSkinName:_3,exportDisplay:_5
};var _8=isc.addProperties({showPrompt:false,transport:"hiddenFrame",exportResults:true,downloadResult:true,downloadToNewWindow:_6,download_filename:_5==this.$1873?_7.pdfName:null
},_2);delete _8.pdfName;delete _8.skinName;delete _8.exportCSS;if(isc.Browser.isMobileSafari&&_8.downloadToNewWindow==true){var _9=_8.newDownloadWindow=_8.download_filename||"request_"+isc.timeStamp();window.open(null,_9).document.write(this.$143q)}
var _10=function(_12){isc.DMI.callBuiltin({methodName:"getPdfObject",arguments:[_12,_7],requestParams:_8
})};var _11=isc.Canvas.getPrintHTML(_1,{printForExport:true
},_10)}
,isc.A.exportImage=function isc_c_RPCManager_exportImage(_1,_2,_3){var _4=_2||{},_5=_4.exportDisplay,_6=_5!=this.$113o,_7=_5==this.$1873
;var _8={downloadResult:_6,downloadToNewWindow:_7
};isc.DMI.callBuiltin({methodName:"exportImage",arguments:[_1,_2],requestParams:_8,callback:function $113p(_9,_10,_11){if(_3){isc.Class.fireCallback(_3,"imageData",[_10.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,_6){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 _7;if(!isc.isAn.Array(_3)&&isc.isAn.Object(_3)){_7=_3.globals||[];if(_3.locale)_4=_3.locale;if(_3.requestProperties)_5=_3.requestProperties;if(_3.missingDSIsNotFatal!=null){_6=_3.missingDSIsNotFatal}
}else{_7=_3,_3={};if(!_7)_7=[];if(!isc.isAn.Array(_7))_7=[_7]}
var _8={};_8.screenName=_1.join(",");if(_6){_8.missingDSIsNotFatal=true}
if(_4)_8.locale=_4;if(_5&&_5.mockMode!=null){isc.addProperties(_8,{mockMode:_5.mockMode})}
var _9=_3.cacheScreen;if(_9)_8.structuredResponse=true;this.$2339(_3,_8);var _10=this;var _11=function(_14,_15,_16){if(_9){var _12=_10.$2318(_15);_15=_10.$2319(_12)}
if(_3.willHandleError){if(_14.status<0||!_15){_10.fireCallback(_2,"screen,rpcResponse,suppressedGlobals",[null,_14,null]);return}
}else if(_3.willHandleError==false&&!_15){isc.RPCManager.reportError("Load failed - Screen \""+_1+"\" not found on the server");return}
_10.$112r(_14,_15,_16,function(_17,_14,_18){if(_17&&_3.verifyComponents){var _13=_10.verifyComponents(_17,_3.verifyComponents);_10.logVerificationsResult(_13,_3,_14)}
_10.fireCallback(_2,"screen,rpcResponse,suppressedGlobals",[_17,_14,_18])},_7,{clobberDataSources:_3.clobberDataSources,suppressAutoDraw:_3.suppressAutoDraw!=false
}
)};return this.$226t(_8,_11,_3,_5)}
,isc.A.$226t=function isc_c_RPCManager__loadComponentXML(_1,_2,_3,_4){var _5={};if(_4)isc.addProperties(_5,_4);if(_5.params==null)_5.params={};isc.addProperties(_5.params,_1);if(_5.willHandleError==null&&_3&&_3.willHandleError!=null){_5.willHandleError=_3.willHandleError}
if(!_5.actionURL)_5.actionURL=this.screenLoaderURL;_5.useSimpleHttp=true;_5.callback=_2;return this.sendRequest(_5)}
);isc.evalBoundary;isc.B.push(isc.A.loadSystemSchema=function isc_c_RPCManager_loadSystemSchema(_1,_2){const _3=function(_5,_6,_4){if(_5.status>=0&&_6){isc.Class.evaluate(_6)}
isc.RPCManager.fireCallback(_1,"response,rawData,request",[_5,_6,_4])};const _4=isc.addPropertiesWithAssign({showPrompt:false
},_2,{actionURL:this.loadSystemSchemaURL,useSimpleHttp:true,callback:_3,sendNoQueue:true
});return this.sendRequest(_4)}
,isc.A.$234k=function isc_c_RPCManager__shouldVerifyLoadProjectDS(_1){if(_1.verifyDataSources!=null)return _1.verifyDataSources;return isc.Reify&&isc.Reify.verifyDataSources}
,isc.A.loadProject=function isc_c_RPCManager_loadProject(_1,_2,_3){if(!_1){this.logWarn("loadProject(): no project name passed in");this.fireCallback(_2,"project,projects,rpcResponse",[null,[],null]);return}
if(!_3){_3={}}
var _4={settings:_3,callback:_2,projectName:_1
};var _5={projectName:_1
};var _6={params:_5,clientContext:_4,willHandleError:true,useSimpleHttp:true,containsCredentials:true,timeout:_3.timeout,actionURL:_3.projectLoaderURL||this.projectLoaderURL,callback:{target:this,methodName:"handleLoadProjectReply"}
};var _7=_3.requestProperties;if(_7!=null){_6=isc.addProperties({},_7,_6)}
isc.addProperties(_5,_3);delete _5.omitLoadedDataSources;delete _5.projectLoaderURL;delete _5.requestProperties;delete _5.timeout;if(!_3.loadAllDataSources){this.$2339(_3,_5)}
if(_5.includeCustomizations==true){_5.includeCustomizations="both"}
this.sendRequest(_6)}
,isc.A.$2339=function isc_c_RPCManager__addOmittedDataSources(_1,_2){var _3={},_4=_1.omitDataSources;if(isc.isAn.Array(_4)){for(var i=0;i<_4.length;i++)_3[_4[i]]=true}else if(_4){_3[_4]=true}
var _6=this.$234k(_1);if(_6)delete _3["*"];if(_3["*"]){_2.omitDataSources="*";return}
var _7=_1.omitLoadedDataSources;if(_7||!_6&&_7!=false){var _8=isc.DS.getRegisteredDataSourceObjects(true,true,true,true);for(var i=0;i<_8.length;i++){var _9=_8[i].ID;if(_9)_3[_9]=true}
}
if(!isc.isAn.emptyObject(_3)){_2.omitDataSources=isc.getKeys(_3).join(",")}
}
,isc.A.getLoadProjectErrorStatus=function isc_c_RPCManager_getLoadProjectErrorStatus(_1){var _2=_1.status;if(_2<0){var _3=isc.RPCResponse.errorCodes;switch(_2){case _3.STATUS_LOGIN_REQUIRED:case _3.STATUS_LOGIN_INCORRECT:return"badCredentials";case _3.STATUS_SERVER_TIMEOUT:return"timeout"}
var _4=_1.httpResponseCode,_5=_1.httpResponseText
;if(this.$216y(_4)){switch(_4){case 0:return"noResponseFromURL";default:return"badReifyServerURL"}
}else{switch(_4){case 500:if(_5&&_5.contains(this.$231p)){return"projectNotFound"}
default:return"servletError"}
}
}
}
,isc.A.getLoadProjectErrorMessage=function isc_c_RPCManager_getLoadProjectErrorMessage(_1){var _2=this.getLoadProjectErrorStatus(_1);if(!_2)return;var _3=isc.RPCResponse.getErrorCodeKeyFromCode(_1.status),_4=_1.clientContext,_5=_4.settings,_6=_1.data
;switch(_2){case"timeout":return"Server timed out trying to load the requested project(s): "+_4.projectName;case"badCredentials":return"Invalid authorization for user '"+_5.USERNAME+"': "+_3;case"noResponseFromURL":return"Your browser disallowed a request to "+_1.context.actionURL+".  This may be because of browser extensions or network issues.";case"badReifyServerURL":return"No Reify project loader servlet present (or refused connection) at "+_1.context.actionURL;case"projectNotFound":return"For user account '"+_5.USERNAME+"' couldn't find any of the requested projects: "+_4.projectName;default:return _6?_3+": "+_6:"Unknown servlet error, HTTP CODE "+_1.httpResponseCode+": "+_1.httpResponseText}
}
,isc.A.handleLoadProjectReply=function isc_c_RPCManager_handleLoadProjectReply(_1,_2,_3){var _4=_3.clientContext,_5=_4.settings,_6=_4.callback
;if(this.getLoadProjectErrorStatus(_1)){if(_5.willHandleError){this.fireCallback(_6,"project,projects,rpcResponse",[null,[],_1])}else{this.logWarn("loadProject(): "+this.getLoadProjectErrorMessage(_1))}
return}
try{_2=JSON.parse(_2)}catch(e){if(_5.willHandleError){this.fireCallback(_6,"project,projects,rpcResponse",[null,[],_1])}else{this.logWarn("loadProject(): invalid JSON data: "+_2)}
return}
this.logInfo("loadProject(): loaded "+_2.length+" project(s)");this.loadProjectScreens(_2,_5,_6,_1)}
,isc.A.loadProjectScreens=function isc_c_RPCManager_loadProjectScreens(_1,_2,_3,_4){var _5=isc.Project.$231o,_6=_2.dataContext,_7=_2.clobberDataSources,_8=_2.allowPlaceholders,_9=[],_10,_11=[]
;for(var i=0;i<_1.length;i++){var _13=isc.Project.create(_1[i]),_14=_5[_13.projectName];for(var j=0;j<_13.screens.length;j++){var _16=_13.screens[j];if(_6!=null)_16.dataContext=_6;if(_8!=null)_16.allowPlaceholders=_8;var _17=_16.ID;if(_17 in this.$112s){var _18=this.$112s[_17];if(!_14||_18!=_14.screens.find("ID",_17))
{continue}
this.logWarn("loadProject(): screen '"+_17+"' is already cached for project '"+_13.projectName+"'. Replacing.")}
this.$112s[_17]=_16}
_5[_13.projectName]=_13;if(!_10)_10=_13;_9.add(_13);if(this.$234k(_2)){var _19=this.verifyProjectDataSources(_1[i]);_11.addList(_19)}
}
if(_2.verifyComponents&&_10){for(var i=0;i<_10.screens.length;i++){var _20=_10.screens[i];var _16=this.createScreen(_20.ID,{suppressAutoDraw:true,clobberDataSources:_7
},_20);var _19=this.verifyComponents(_16,_2.verifyComponents);_11.addList(_19)}
}
if(_2.drawFirstScreen&&_10){var _21=_10.createStartScreen({clobberDataSources:_7
});if(_21&&!_21.isDrawn())_21.draw()}
if(_11.length>0){this.logVerificationsResult(_11,{verifyAsError:_2.verifyAsError
},_4)}
this.fireCallback(_3,"project,projects,rpcResponse",[_10,_9,_4
])}
,isc.A.verifyProjectDataSources=function isc_c_RPCManager_verifyProjectDataSources(_1){var _2=[];var _3=_1.dataSources;for(var i=0;i<_3.length;i++){var _5=_3[i];var _6=isc.DataSource.get(_5.ID);if(!_6){continue}
var _7=isc.eval(_5.code.replace('ID:"'+_5.ID+'"','ID:"isctmp_'+_5.ID+'"')
);var _8=isc.DataSource.verifyDataSourcePair(_6,_7);_7.destroy();_2.addList(_8)}
return _2}
,isc.A.verifyComponents=function isc_c_RPCManager_verifyComponents(_1,_2){if(!_1)return;var _3=function(_13,_14,_15){return{componentId:_13,severity:_14,message:_15.asHTML()
}};var _4=[];for(var _5 in _2){var _6=_5;var _7=null;if(_5.contains('.')){var _8=_5.split('.');if(_8.length!=2){_4.add(_3(_5,'ERROR','Component provided to verifyComponents takes anillegal form.  Should contain no more than one dot (".") separating  the componentId from the subcomponent (e.g., formItem) name'));continue}
_6=_8.first();_7=_8.last()}
var _9=_1.getByLocalId(_6);if(_9&&_7){switch(_9.getClassName()){case'TabSet':var _10=_9.getTab(_7);if(!_10&&_9.tabs){_10=_9.tabs.find('autoID',_7);if(_10){_10.$233b='Tab'}
}
_9=_10;break;case'SectionStack':var _11=_9.getSectionNumber(_7);_9=(_11==-1)?null:_9.sections[_11];break;case'DynamicForm':_9=_9.getItem(_7);break;default:_4.add(_3(_5,'ERROR','Unsupported component type "'+_9.getClassName()+'" verification requested.  Skipping.'))}
}
if(!_9){_4.add(_3(_5,'WARN','Component "'+_5+'" declared in verifyComponents not present in screen "'+_1.getLocalId()+'"'));continue}
var _12=_2[_5];if((_9.$233b&&_9.$233b!=_12)||(_9.getClass&&!_9.getClass().isA(_12))){_4.add(_3(_5,'WARN','Component "'+_5+' declared in verifyComponents was not of expected type "'+_12+'", instead is of type "'+(_9.$233b||_9.getClassName())+'"'
)
)}
}
return _4}
,isc.A.logVerificationsResult=function isc_c_RPCManager_logVerificationsResult(_1,_2,_3){var _4=isc.RPCManager.verifyAsError;if(_2&&_2.verifyAsError!=null){_4=_2.verifyAsError}
var _5=_1.length>1;var _6='';for(var i=0;i<_1.length;i++){var _8=_1[i].message;isc.logWarn(_8);_6+=(_5?'<li>':'')+_8}
if(_5){_6='<ul>'+_6+'</ul>'}
if(_4&&!_1.isEmpty()){isc.warn(_6)}
if(_3){_3.projectVerificationReports=_1}
}
,isc.A.createScreen=function isc_c_RPCManager_createScreen(_1,_2,_3,_4){if(!_1){this.logWarn("No screen names passed in.");return null}
_3=_3||this.$112s[_1];if(!_3){this.logWarn("Asked to create screen '"+_1+"', but it's not cached - did you call cacheScreens() first?");return null}
var _5;if(isc.isAn.Object(_2))_5=[];else _5=_2,_2=null;if(!isc.isAn.Array(_5))_5=[_5];if((!_2||!_2.dataContext)&&_3.dataContext){if(!_2)_2={};_2.dataContext=_3.dataContext}
if((!_2||_2.allowPlaceholders==null)&&_3.allowPlaceholders!=null){if(!_2)_2={};_2.allowPlaceholders=_3.allowPlaceholders}
var _6=this.$112r(null,{name:_1,source:_3.code},null,null,_5,_2);if(_2&&_2.verifyComponents){var _7=this.verifyComponents(_6,_2.verifyComponents);this.logVerificationsResult(_7,_2,_4)}
return _6}
,isc.A.$112r=function isc_c_RPCManager__makeScreen(_1,_2,_3,_4,_5,_6){var _7;if(isc.isAn.Object(_2)){_7=_2.name;_2=_2.source}
if(!_3){_3={}};var _8=isc.Canvas.getInstanceProperty("autoDraw"),_9=_3.suppressAutoDraw==null?true:_3.suppressAutoDraw;if(_9)isc.Canvas.setInstanceProperty("autoDraw",false);var _10;if(_6&&!isc.noAutoDraw&&(_6.suppressAutoDraw||_6.htmlElement))
{_10=isc.noAutoDraw=true}
if(isc.DS){isc.DS.$92w=!_6||!_6.clobberDataSources}
isc.$171i=true;if(_6)isc.$2095=_6;var _11,_12=this;if(_5.length==1&&_5[0]==_12.ALL_GLOBALS){isc.trackCreateLevel=true;isc.captureGlobals=true;_11=isc.Class.globalEvalWithCapture(_2,function(_5,_21){delete isc.captureGlobals;if(_21!=null)isc.Log.$am(_21,null,null,null,"Error when executing loaded screen");var _13=isc.Canvas.$112q(_5);var _14={};if(_9)isc.Canvas.setInstanceProperty("autoDraw",_8);if(_10)delete isc.noAutoDraw;if(isc.DS)delete isc.DS.$92w;if(_6&&_6.dataContext){_13.setDataContext(_6.dataContext)}
if(_6){_12.$2315(_13,_6.htmlElement)}
if(_5){for(var i=0;i<_5.length;i++){var _16=_5[i];var _17=window[_16];if(_17&&(isc.isA.Canvas(_17)||isc.isA.ValuesManager(_17))){_17.setProperty("$112p",_13)}
}
}
_12.fireCallback(_4,"screen,rpcResponse,suppressedGlobals",[_13,_1,_14])},null,false);delete isc.trackCreateLevel}else{_11=isc.Class.globalEvalAndRestore(_2,_5,function(_5,_21,_14){if(_21!=null)isc.Log.$am(_21,null,null,null,"Error when executing loaded screen");var _13=isc.Canvas.$112q(_5);if(_9)isc.Canvas.setInstanceProperty("autoDraw",_8);if(_10)delete isc.noAutoDraw;if(isc.DS)delete isc.DS.$92w;var _18={},_19=isc.getKeys(_14);for(var i=0;i<_19.length;i++){var _20=_19[i];var _17=window[_20];if(_17&&(isc.isA.Canvas(_17)||isc.isA.FormItem(_17))){_18[_20]=_17}
}
_14=_18;if(_6&&_6.dataContext){_13.setDataContext(_6.dataContext)}
if(_6){_12.$2315(_13,_6.htmlElement)}
_12.fireCallback(_4,"screen,rpcResponse,suppressedGlobals",[_13,_1,_14])},null,false,true)}
delete isc.$2095;delete isc.$171i;var _11=isc.Canvas.$112q(_11.globals);return _11}
,isc.A.$2315=function isc_c_RPCManager__setScreenHtmlElement(_1,_2){if(_1&&_2){_1.setProperty("position","relative");_1.setHtmlElement(_2);_1.draw()}
}
,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);if(_5.params==null)_5.params={};_5.params.screenName=_1.join(",");if(_3){isc.addProperties(_5.params,{locale:_3})}
if(_4&&_4.mockMode!=null){isc.addProperties(_5.params,{mockMode:_4.mockMode})}
isc.addProperties(_5.params,{structuredResponse:true});if(!_5.actionURL)_5.actionURL=this.screenLoaderURL;_5.useSimpleHttp=true;var _6=this;_5.callback=function(_8,_9,_10){isc.Class.globalEvalWithCapture(_9,function(_11,_12){if(_12!=null)isc.Log.$am(_12,null,null,null,"Error when executing cache screen");var _7=_6.$2318(_9);_6.fireCallback(_2,"data,rpcResponse",[_7,_8])},null,false)};this.sendRequest(_5)}
,isc.A.$2318=function isc_c_RPCManager__cacheScreensFromData(_1){var _2=isc.Class.evaluate(_1);for(var i=0;i<_2.length;i++){var _4=_2[i].screenName;var _5=this.$112s[_4];if(_5){this.logWarn("Screen "+_4+" is already cached. Replacing.")}
this.$112s[_4]={ID:_4,code:_2[i].source}}
return _2}
,isc.A.$2319=function isc_c_RPCManager__buildCodeFromScreens(_1){var _2=isc.SB.create();for(var i=0;i<_1.length;i++){_2.append(_1[i].source,"\n")}
return _2.toString()}
,isc.A.isScreenCached=function isc_c_RPCManager_isScreenCached(_1){return _1 in this.$112s}
,isc.A.incrementPendingRpcs=function isc_c_RPCManager_incrementPendingRpcs(_1){if(_1.downloadResult||_1.exportResults||_1.exportToClient||(_1.exportToFileSystem&&_1.exportToClient!==false))
{return}
this.pendingRpcs++;if(_1.componentId){_1.$166l=window[_1.componentId];if(_1.$166l)_1.$166l.$166g++}
}
,isc.A.decrementPendingRpcs=function isc_c_RPCManager_decrementPendingRpcs(_1){if(_1.downloadResult||_1.exportResults||_1.exportToClient||(_1.exportToFileSystem&&_1.exportToClient!==false))
{return}
if(_1.$166l)_1.$166l.$166g--;this.pendingRpcs--}
,isc.A.clearTransactionPendingRpcs=function isc_c_RPCManager_clearTransactionPendingRpcs(_1){var _2=_1.operations||[];for(var i=0;i<_2.length;i++)this.decrementPendingRpcs(_2[i])}
,isc.A.requestsArePending=function isc_c_RPCManager_requestsArePending(_1){if(_1){var _2=this.getActiveTransactions()||[];for(var i=0;i<_2.length;i++){var _4=this.getTransaction(_2[i]);if(_4&&_4.operations){for(var j=0;j<_4.operations.length;j++){var _6=_4.operations[j];if(!_6.isBackgroundRequest){return true}
}
}
}
return false}
return this.pendingRpcs!=0}
,isc.A.$234p=function isc_c_RPCManager__logPendingTransactions(_1,_2){if(!_2)_2=this;var _3=[];for(var i=0;i<this.$38z.length;i++){_3[i]=this.echo(this.$38z[i])}
_2.logDebug(_3.length+" pending transaction(s):\n"+_3.join(", "),_1)}
);isc.B._maxIndex=isc.C+151;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()");if(isc.Messaging){this.observe(isc.Messaging,"connectionUp","observer.messagingStatusChanged()");this.observe(isc.Messaging,"connectionDown","observer.messagingStatusChanged()")}},destroyInterface:function(){this.ignore(isc.RPCManager.$38z,"dataChanged");if(isc.Messaging){this.ignore(isc.Messaging,"connectionUp");this.ignore(isc.Messaging,"connectionDown")}},transactionsChanged:function(){},messagingStatusChanged: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<this.observationHooks.length;i++){this.observe(this,this.observationHooks[i],"observer.manageUnmaskedTarget()")}
this.setUnmaskedTarget(this.unmaskedTarget)}
,isc.A.setUnmaskedTarget=function isc_UnmaskedTargetLandingPad_setUnmaskedTarget(_1){this.unmaskedTarget=_1;if(this.unmaskedTarget){this.observe(this.unmaskedTarget,"resized","observer.manageUnmaskedTarget()")}}
,isc.A.manageUnmaskedTarget=function isc_UnmaskedTargetLandingPad_manageUnmaskedTarget(){if(!this.unmaskedTarget)return;if(this.isVisible()&&this.isDrawn()){if(this.getVisibleWidth()<this.unmaskedTarget.getVisibleWidth())this.setWidth(this.unmaskedTarget.getVisibleWidth());if(this.getVisibleHeight()<this.unmaskedTarget.getVisibleHeight())this.setHeight(this.unmaskedTarget.getVisibleHeight());var _1=this.getPageLeft(),_2=this.getPageTop();this.unmaskedTarget.moveTo(_1,_2);this.unmaskedTarget.bringToFront();this.unmaskedTarget.show()}else{this.unmaskedTarget.hide()}}
,isc.A.destroy=function isc_UnmaskedTargetLandingPad_destroy(){for(var i=0;i<this.obsevationHooks.length;i++){this.ignore(this,this.observationHooks[i])}
if(this.unmaskedTarget)this.ignore(this.unmaskedTarget,"resized");this.Super("destroy",arguments)}
);isc.B._maxIndex=isc.C+4;isc.defineClass("RPCStatusControl","UnmaskedTargetLandingPad");isc.A=isc.RPCStatusControl.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.statusIndicatorDefaults={_constructor:"RPCStatusMenuButton"};isc.B.push(isc.A.initWidget=function isc_RPCStatusControl_initWidget(){this.Super("initWidget",arguments);this.statusIndicator=this.createAutoChild("statusIndicator",{canCancelQueue:this.canCancelQueue,showMessagingStatus:this.showMessagingStatus
});this.setUnmaskedTarget(this.statusIndicator)}
);isc.B._maxIndex=isc.C+1;if(isc.MenuButton){isc.defineClass("RPCStatusMenuButton","MenuButton",["IRPCStatusListener","IRPCUnmaskedTarget"]);isc.A=isc.RPCStatusMenuButton.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.width=40;isc.A.height=20;isc.A.defaultPrompt="Idle";isc.A.progressImageProperties={src:"[SKINIMG]loadingSmall.gif",width:16,height:16,extraStuff:"title='Waiting for server response'"};isc.A.noProgressImageProperties={src:"[SKINIMG]loadingSmallFrozen.gif",width:16,height:16,extraStuff:"title='No outstanding server requests'"};isc.A.messagingUpImageProperties={src:"[SKINIMG]actions/accept.png",width:16,height:16,extraStuff:"title='Real-time data streaming: UP'"};isc.A.messagingDownImageProperties={src:"[SKINIMG]actions/exclamation.png",width:16,height:16,extraStuff:"title='Real-time data streaming: DOWN'"};isc.A.canCancelQueue=false;isc.A.confirmCancelQueue=true;isc.A.cancelQueueConfirmationMessage="Cancelling a request may have unintended consequences.  You should only do this if you requested data that is taking too long to load, but not if you are saving data.<br><br> 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(){if(this.showMessagingStatus)this.width+=20;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.progressImageProperties);if(_4)this.menu.setItemTitle(_4,_2.prompt);this.setDisabled(false)}else{_3+=isc.Canvas.getImgHTML(this.noProgressImageProperties);if(_4)this.menu.setItemTitle(_4,this.defaultPrompt);this.setDisabled(true)}
if(isc.Messaging&&this.showMessagingStatus){if(isc.Messaging.connected()){_3+=isc.Canvas.getImgHTML(this.messagingUpImageProperties)}else{_3+=isc.Canvas.getImgHTML(this.messagingDownImageProperties)}
}
this.setTitle(_3)}
,isc.A.transactionsChanged=function isc_RPCStatusMenuButton_transactionsChanged(){this.updateState()}
,isc.A.messagingStatusChanged=function isc_RPCStatusMenuButton_messagingStatusChanged(){this.updateState()}
);isc.B._maxIndex=isc.C+5}
isc.A=isc.RPCManager;isc.A.loginUsernameFieldName=window.isc_user&&window.isc_user.loginUsernameFieldName?window.isc_user.loginUsernameFieldName:"username";isc.A.loginPasswordFieldName=window.isc_user&&window.isc_user.loginPasswordFieldName?window.isc_user.loginPasswordFieldName:"password";isc.A.lockReloginToCurrentUser=window.isc_user&&window.isc_user.lockReloginToCurrentUser;isc.A.loginUsernameFieldTitle="Username or email";isc.A.loginPasswordFieldTitle="Password";isc.A=isc.RPCManager;isc.A.loginFailureFieldDefaults={name:"loginFailure",type:"blurb",textAlign:"center",wrap:true,defaultValue:"Please check your Username/Email and Password.",visible:false,colSpan:2
};isc.A.loginUsernameFieldDefaults={name:isc.RPCManager.loginUsernameFieldName,type:"textItem",title:isc.RPCManager.loginUsernameFieldTitle,canEdit:isc.RPCManager.lockReloginToCurrentUser?false:true,defaultValue:isc.RPCManager.lockReloginToCurrentUser?window.isc_user.isc_username:null,keyPress:function(_1,_2,_3){if(_3=="Enter"){_2.focusInItem(this.loginPasswordFieldName);return false}
}
};isc.A.loginPasswordFieldDefaults={name:isc.RPCManager.loginPasswordFieldName,title:isc.RPCManager.loginPasswordFieldTitle,type:"password",keyPress:function(_1,_2,_3){if(_3=="Enter"){_2.loginWindow.doLogin();return false}
}
};isc.A.loginButtonDefaults={type:"button",title:"Log in",click:"form.loginWindow.doLogin()"
};isc.A=isc.RPCManager;isc.A.loginWindowDefaults={_constructor:"LoginWindow"
};isc.A.loginFormDefaults={_constructor:"DynamicForm",autoDraw:false,numCols:2,titleOrientation:"left",ignoreProgramErrors:isc.params.ignoreProgramErrors==1,fields:[isc.addProperties(isc.RPCManager.loginFailureFieldDefaults,{cellStyle:"formCellError"
}),isc.addProperties(isc.RPCManager.loginUsernameFieldDefaults,{}),isc.addProperties(isc.RPCManager.loginPasswordFieldDefaults,{}),isc.addProperties(isc.RPCManager.loginButtonDefaults,{})
]
};isc.defineClass("Project").addClassProperties({$231o:{},get:function(_1){var _2=this.$231o[_1];if(!_2){this.logInfo("get(): no project named '"+_1+"' was ever loaded")}
return _2}});isc.A=isc.Project.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.logMessage=function isc_Project_logMessage(_1,_2,_3,_4){if(!this.getID())_2=this.projectName+":"+_2;return this.Super("logMessage",arguments)}
,isc.A.createScreen=function isc_Project_createScreen(_1,_2,_3){if(this.destroyed){this.logWarn("createScreen(): project has been destroyed");return}
if(!_1){this.logWarn("createScreen(): no screen names passed in");return null}
var _4=this.screens.find("ID",_1);if(!_4){this.logWarn("createScreen(): asked to create screen '"+_1+"', but it's not cached - Are you sure it's in this project?");return null}
this.runCustomizations();this.setupSavedSearches();isc.Project.$2426=_1;isc.Project.$2427=this.projectName;try{var _5=isc.RPCManager.createScreen(_1,_2,_4,_3);_5.$2421=_1,_5.$2420=this.projectName}finally{delete isc.Project.$2426;delete isc.Project.$2427}
return _5}
,isc.A.runCustomizations=function isc_Project_runCustomizations(){var _1=this.customizations;if(_1)try{isc.ClassFactory.ignoreDuplicateClass=true;if(isc.DS)isc.DS.$92w=true;isc.Class.evaluate(_1);this.logInfo("successfully evaluated your customizations","projectCustomizations")}catch(e){if(this.logIsInfoEnabled("projectCustomizations")){this.logInfo("error evaluating your customizations: '"+_1+"':\n"+e,"projectCustomizations")}
}finally{delete isc.ClassFactory.ignoreDuplicateClass;if(isc.DS)delete isc.DS.$92w}
}
,isc.A.setupSavedSearches=function isc_Project_setupSavedSearches(){if(!isc.SavedSearches)return;var _1=this.savedSearches;if(_1){isc.Class.evaluate(_1.code);isc.SavedSearches.addProperties({defaultDataSource:_1.ID
})}
}
,isc.A.createStartScreen=function isc_Project_createStartScreen(_1,_2){if(this.destroyed){this.logWarn("createStartScreen(): project has been destroyed");return}
if(!this.screens.length){this.logWarn("createStartScreen(): project has no screens");return}
return this.createScreen(this.screens[0].ID,_1,_2)}
,isc.A.getScreenNames=function isc_Project_getScreenNames(){return this.screens.map(function(_1){return _1.ID})}
,isc.A.getDataSourceNames=function isc_Project_getDataSourceNames(){return this.dataSources.map(function(_1){return _1.ID})}
,isc.A.getDataSource=function isc_Project_getDataSource(_1,_2){var _3=this.dataSources.find("ID",_1);if(!_3){this.logWarn("getDataSource(): asked to get DataSource '"+_1+"', but it's not cached.  Are you sure it's in this project?");return null}
var _4=true;if(!_2){var _5=window[_1];if(_5){if(_5==isc.DS.get(_1)){this.logInfo("getDataSource(): existing global DataSource with ID '"+_1+"' will not be replaced")}else if(isc.isA.DataSource(_5)){this.logWarn("getDataSource(): possible error; existing global with ID '"+_1+"is a DataSource, but is not registered under that ID")}else{this.logWarn("getDataSource(): probable error; existing global with ID '"+_1+"is not a DataSource")}
}else{_4=false}
}
isc.DS.suppressIDRegistration=!!_4;try{return isc.Class.evaluate(_3.code)}finally{delete isc.DS.suppressIDRegistration}
}
,isc.A.destroy=function isc_Project_destroy(){var _1=this.projectName,_2=isc.Project.$231o,_3=_2[_1];if(_3==this)delete _2[_1];for(var i=0;i<this.screens.length;i++)delete this.screens[i].code;for(var i=0;i<this.dataSources.length;i++)delete this.dataSources[i].code;this.Super("destroy",arguments)}
);isc.B._maxIndex=isc.C+9;isc.defineClass("DataSourceRetriever").addClassMethods({create:function(_1){var _2=_1.dataSources,_3=_1.projectName
;var _4=isc.Project.get(_3);if(_4){var _5=_4.dataSources;for(var i=0;i<_2.length;i++){var _7=_2[i],_8=_5.find("ID",_7);if(!_8){if(!isc.DataSource.get(_7)){this.logWarn("can't create DataSource '"+_7+"' for project '"+_3+"' because DataSource not cached in the project.")}
continue}
isc.Class.evaluate(_8.code)}
}
}});if(isc.RPCManager.supportsPostMessageRelogin){isc.RPCManager.setupReloginListener()}isc.defineClass("DMI").addClassProperties({actionURL:isc.RPCManager.actionURL,call:function(_1,_2,_3){var _4=[];for(var i=0;i<arguments.length;i++)_4[_4.length]=arguments[i];var _6={};if(isc.isAn.Object(_1)&&_4.length==1){var _7=isc.clone(_1);if(_7.requestParams){isc.addProperties(_6,this.requestParams,_7.requestParams);delete _7.requestParams;if(_7.downloadResult==true){_7.showPrompt=false;_7.transport="hiddenFrame"}
}
_6.callback=_7.callback;delete _7.callback;_6.data=_7}else{_6.data={appID:_1,className:_2,methodName:_3,arguments:_4.slice(3,_4.length-1)
};_6.callback=_4[_4.length-1]
}
_4=_6.data.arguments;if(!isc.isAn.Array(_4)){if(_4==null)_4=[];else _4=[_4]}
_6.data.arguments=_4;_6.data.is_ISC_RPC_DMI=true;if(this.addMetaDataToQueryString){if(!_6.queryParams)_6.queryParams={};isc.addProperties(_6.queryParams,{dmi_appID:_6.data.appID,dmi_class:_6.data.className,dmi_method:_6.data.methodName
})}
return isc.RPCManager.sendRequest(_6)},getURL:function(_1,_2,_3){var _4=[];for(var i=0;i<arguments.length;i++)_4[_4.length]=arguments[i];var _6={};if(isc.isAn.Object(_1)&&_4.length==1){var _7=isc.clone(_1);if(_7.requestParams){isc.addProperties(_6,this.requestParams,_7.requestParams);delete _7.requestParams;if(_7.downloadResult==true){_7.showPrompt=false;_7.transport="hiddenFrame"}
}
_6.data=_7}else{_6.data={appID:_1,className:_2,methodName:_3,arguments:_4.slice(3,_4.length)
}}
_4=_6.data.arguments;if(!isc.isAn.Array(_4)){if(_4==null)_4=[];else _4=[_4]}
_6.data.arguments=_4;_6.data.is_ISC_RPC_DMI=true;_6.$38j=true;_6.showPrompt=false;return isc.RPCManager.sendRequest(_6)},callTemplate:"(function(){var x = function (firstArg) { var isCall = ${isCall};var obj = {};obj.requestParams=this.requestParams;if(isc.isAn.Object(firstArg) && arguments.length == 1){isc.addProperties(obj,{appID:'${appID}',className:'${className}',methodName:'${methodName}'},firstArg);} else {var args = [];for (var i = 0; i < arguments.length; i++) args[args.length] = arguments[i];isc.addProperties(obj,{appID:'${appID}',className:'${className}',methodName:isCall?firstArg:'${methodName}',arguments:args.slice(isCall ? 1 : 0,args.length-1),callback:args[args.length-1]});}isc.DMI.call(obj);};return x})()",bind:function(_1,_2,_3,_4){if(!isc.isAn.Array(_3))_3=[_3];_4=isc.addProperties({},this.requestParams,_4);var _5={appID:_1,className:_2,methodName:"firstArg",isCall:true};var _6=isc[_2]||isc.defineClass(_2);_6.addClassProperties({requestParams:_4,call:isc.eval(this.callTemplate.evalDynamicString(this,_5))
});var _7={};for(var i=0;i<_3.length;i++){var _9={appID:_1,className:_2,methodName:_3[i],isCall:false};_7[_3[i]]=isc.eval(this.callTemplate.evalDynamicString(this,_9))}
_6.addClassProperties(_7);window[_2]=_6;return _6},makeDMIMethod:function(_1,_2,_3,_4){var _5={appID:_1,className:_2,isCall:_3,methodName:_3?"firstArg":_4};return isc.eval(this.callTemplate.evalDynamicString(this,_5))},$131a:function(_1,_2,_3,_4){this.call({appID:"isc_builtin",className:"com.isomorphic.rpc.BuiltinRPC",methodName:_1,callback:_2,arguments:_3||["SmartClientLog"],requestParams:{showPrompt:false,willHandleError:true,queryParams:{isc_noLog:"1"}
}
})}});isc.DMI.callBuiltin=isc.DMI.makeDMIMethod("isc_builtin","builtin",true);if(isc.Browser.seleniumPresent){if(isc.Browser.isFirefox){document.addEventListener("IscSeleniumConfigureServerLogsEvent",function(_1){var _2=_1.target.getAttribute("arguments");isc.DMI.$131a("setTemporaryLogThreshold",null,_2.split(/,\s*/))},false);document.addEventListener("IscSeleniumClearServerLogsEvent",function(_1){isc.DMI.$131a("clearLogEntries")},false);document.addEventListener("IscSeleniumRequestServerLogsEvent",function(_1){var _2=_1.target.ownerDocument;isc.DMI.$131a("getLogEntries",function(_7){var _3=[],_4=_7.data;if(_4&&_4.length>0)_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.A=isc.DMI;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.configureServerLogs=function isc_c_DMI_configureServerLogs(){this.$131a("setTemporaryLogThreshold",null,arguments);return true}
,isc.A.clearServerLogs=function isc_c_DMI_clearServerLogs(){this.$131a("clearLogEntries");return true}
,isc.A.requestServerLogs=function isc_c_DMI_requestServerLogs(){delete this.$192i;this.$131a("getLogEntries",function(_2){var _1=_2.data;isc.DMI.$192i=_1&&_1.length>0?_1.getProperty("logMessage"):[]});this.$131a("revertTemporaryLogThresholds")}
,isc.A.receivedServerLogs=function isc_c_DMI_receivedServerLogs(){return this.$192i!=null}
,isc.A.getServerLogs=function isc_c_DMI_getServerLogs(){return this.$192i}
);isc.B._maxIndex=isc.C+5}
isc.defineClass("AsyncFilterAndSortResults").addProperties({getAsyncFilterResult:function(_1){var _2=this.$2654;return _2&&_2[_1.$2655]},addAsyncFilterResults:function(_1){var _2=this.$2654;if(!_2){_2=this.$2654={}}
for(var i=0;i<_1.length;++i){var _4=_1[i];_2[_4.criterion.$2655]=_4}
},setAsyncFiltersToRunning:function(_1){var _2=_1.length;if(_2<=0)return;var _3=this.$2654;if(!_3){_3=this.$2654={}}
for(var i=0;i<_2;++i){var _5=_1[i];_3[_5.$2655]={criterion:_5,type:"running"
}}
},changeRunningAsyncFilterResultTypesToCanceled:function(_1){this.$102q(_1.type=="canceled");var _2=this.$2654;if(!_2)return;var _3=isc.getKeys(_2);for(var i=0;i<_3.length;++i){var _5=_2[_3[i]];if(_5.type=="running"){_2[_3[i]]=_1}
}
}});isc.ClassFactory.defineClass("ResultSet",null,["List","DataModel"]);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.A.$2781=Date.now();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.B.push(isc.A.$2651=function isc_c_ResultSet__addCriterionIds(_1,_2){if(_1==null)return;if(isc.isAn.Array(_1)){for(var i=0;i<_1.length;++i){this.$2651(_1[i])}
}else if(isc.DS.isAdvancedCriteria(_1,_2)){if(_1.$2655==null)_1.$2655=this.$2781++;if(_1.operator=="and"){var _4=_1.criteria;if(!isc.isAn.Array(_4))return;for(var i=0;i<_4.length;++i)this.$2651(_4[i],_2)}
}
}
);isc.B._maxIndex=isc.C+1;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,_2){var i=0,n=0,_5=_1.length,_6=Array.LOADING;for(;i<_5;++i){var a=_1[i];if(a==null||a===_6){++n}else if(n>0){if(!_2){_1=_1.duplicate();_2=true}
_1.splice(i-n,n);i-=n;_5-=n;n=0}
}
this.$102q(i==_5);if(n>0){if(!_2){_1=_1.slice(0,i-n);_2=true}else{_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.rememberDynamicProgressiveLoading=true;isc.A.shouldReorderAllRows=true;isc.A.updatePartialCache=true;isc.A.alwaysRequestVisibleRows=false;isc.B.push(isc.A.$2060=function isc_ResultSet__canModify(_1){return this.modifiable&&this.fetchMode=="local"&&this.getDataSource()&&this.shouldUseClientFiltering()&&this.allRows!=null&&this.localData!=null}
,isc.A.$2061=function isc_ResultSet__warnModify(_1){isc.logWarn(_1+"(): ResultSets are not modifiable unless filtering data locally due to fetchMode:'local' - not modified")}
,isc.A.findIndexInCache=function isc_ResultSet_findIndexInCache(_1,_2){if(_2!=null){var _3=this.getDataSource(),_4=_3&&_3.getPrimaryKeyFieldName();if(_4==null){var _5=_2.indexOf(_1);return _5}else{var _5=_3.findByKeys(_1,_2);return _5}
}
}
,isc.A.addAt=function isc_ResultSet_addAt(_1,_2){if(!this.$2060())return this.$2061("addAt");if(_1==null){this.logWarn("addAt(): you must supply a valid record");return}
if(_2==null)_2=0;if(!isc.isA.Number(_2)||_2<0){this.logWarn("addAt(): Invalid position "+_2);return}
var _3=this.getDataSource(),_4=this.findIndexInCache(_1,this.allRows);if(_4>=0){this.logWarn("addAt(): cannot add "+isc.echo(_1)+" as the ResultSet already contains "+(_3.getPrimaryKeyFieldName()!=null?"another record with the same primary key values":"this object."));return}
var _5=this.localData,_6=this.allRows;if(_6!=_5){var _4;if(_2==this.getLength()){_4=_6.length}else{var _7=_5[_2];_4=this.findIndexInCache(_7,_6)}
_6.addAt(_1,_4)}
var _8=this.allRowsCriteria,_9=this.getImplicitCriteria();if(_9)_8=_3.combineCriteria(_8,_9);var _10=[_1],_11=this.applyFilter(_10,_8,this.context).length>0;if(_11){_5.addAt(_1,_2);this.dataChanged("add",_1,_2);this.$2782(null,!this.canSortOnClient(),_8,_10,true);return _1}
}
,isc.A.set=function isc_ResultSet_set(_1,_2){if(!this.$2060())return this.$2061("set");if(_2==null){this.logWarn("set(): you must supply a valid record");return}
if(!isc.isA.Number(_1)||_1<0){this.logWarn("set(): Invalid position "+_1);return}
var _3=this.getDataSource(),_4=this.localData,_5=_4[_1],_6=this.allRows;if(_6!=_4){var _7=this.findIndexInCache(_5,_6);_6.set(_7,_2)}
var _8=this.allRowsCriteria,_9=this.getImplicitCriteria();if(_9)_8=_3.combineCriteria(_8,_9);var _10=this.findIndexInCache(_2,_4)==_1?"update":"replace",_11=[_2],_12=this.applyFilter(_11,_8,this.context).length>0;if(!_12&&this.shouldNeverDropUpdatedRows()&&_10=="update"){_12=true}
if(_12){_4.set(_1,_2)}else{_4.removeAt(_1)}
if(_5!=null&&_5!==_2){this.removeFromAsyncFilterCaches(_8,[_5])}
this.dataChanged(_10,_12?_2:null,_1);if(_12){this.$2782(null,!this.canSortOnClient(),_8,_11,true)}
return _5}
,isc.A.removeAt=function isc_ResultSet_removeAt(_1){if(!this.$2060())return this.$2061("removeAt");if(!isc.isA.Number(_1)||_1<0){this.logWarn("removeAt(): Invalid position "+_1);return}
var _2=this.localData,_3=_2[_1];if(_3==null){this.logWarn("removeAt(): No valid record at position "+_1+" to remove");return}
var _4=this.allRows;if(_4!=_2){var _5=this.findIndexInCache(_3,_4);_4.removeAt(_5)}
_2.removeAt(_1);this.dataChanged("remove",_3,_1);return _3}
,isc.A.getImplicitCriteria=function isc_ResultSet_getImplicitCriteria(){if(!this.implicitCriteria&&!this.dbcImplicitCriteria)return null;var _1=this.getDataSource();isc.ResultSet.$2651(this.implicitCriteria,_1);var _2=isc.DS.compressNestedCriteria(_1.combineCriteria(isc.DS.copyCriteria(this.dbcImplicitCriteria),isc.DS.copyCriteria(this.implicitCriteria)
));if(!_2)return null;var _3=isc.Canvas.getById(this.context.componentId);if(_3)_2=_3.resolveDynamicCriteria(_2,"implicitCriteria");return _2}
,isc.A.setDbcImplicitCriteria=function isc_ResultSet_setDbcImplicitCriteria(_1,_2){isc.ResultSet.$2651(_1,this.getDataSource());this.lastImplicitCriteria=!this.dbcImplicitCriteria?null:isc.DS.copyCriteria(this.dbcImplicitCriteria);this.dbcImplicitCriteria=_1;if(this.context){this.context.lastImplicitCriteria=isc.DS.copyCriteria(this.lastImplicitCriteria);this.context.dbcImplicitCriteria=isc.DS.copyCriteria(this.dbcImplicitCriteria);if(_2)this.context.afterFlowCallback=_2}
return this.setCriteria(this.criteria)}
,isc.A.setDbcFields=function isc_ResultSet_setDbcFields(_1){if(!this.dbcFields?_1:this.dbcFields.equals(_1)){this.dbcFields=_1;this.$2782(true,false,null)}
}
,isc.A.setDbcCacheOrdinal=function isc_ResultSet_setDbcCacheOrdinal(_1){if(this.dbcCacheOrdinal!=_1){this.dbcCacheOrdinal=_1;this.$2782(true,false,null)}
}
,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.$256x=function isc_ResultSet__requestProgressiveLoading(){var _1=this.progressiveLoading;if(_1==null){_1=this.$256y}
return _1}
,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+15;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.allMatchingRowsFetchTimeout=isc.Browser.useHighPerformanceGridTimings?200:500;isc.A.prerequisiteFieldGenerationNotSuccessfulErrorMessage="The generation of missing values for the ${fieldTitle} field was not successful: ${errorMessage}";isc.A.notifyOnUnchangedCache=false;isc.A.applyRowCountToLength=false;isc.A.blockingRowCountFetch=true;isc.A.autoFetchRowCount=false;isc.A.$2568=0;isc.A.$2569={};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")}
this.context=isc.addProperties({},this.context,this.requestProperties);var _5=this.context;this.resultSize=_5&&_5.dataPageSize>0?_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,this.$273o()),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(){this.cancelRowCountFetch();this.ignore(isc,"goOffline");this.ignore(isc.RPCManager,"offlineTransactionPlaybackComplete");if(this.$39s!=null){for(var i=0;i<this.$39s.length;i++){var _2=this.$39s[i];if(_2){this.ignore(_2,"dataChanged")}
}
}
isc.ClassFactory.dereferenceGlobalID(this);this.Super("destroy",arguments);this.destroyed=true}
,isc.A.$273o=function isc_ResultSet__getComponent(){return isc.Canvas.getById(this.componentId)}
,isc.A.getFirstUsedIndex=function isc_ResultSet_getFirstUsedIndex(){if(!this.lengthIsKnown()){return 0}else{var _1=this.localData,_2=this.$1317,_3=_2.length,k=this.$1318(0),_5=(k%2!=0),j=(k+1<_3?_2[++k]:-1);for(var i=0,_8=_1.length;i<_8;++i){if(i==j){_5=!_5;j=(k+1<_3?_2[++k]:-1)}
if(_1[i]!=null&&_5){return i}
}
return 0}}
,isc.A.isPaged=function isc_ResultSet_isPaged(){return this.fetchMode=="paged"}
,isc.A.isBasic=function isc_ResultSet_isBasic(){return this.fetchMode=="basic"}
,isc.A.isLocal=function isc_ResultSet_isLocal(){return this.fetchMode=="local"}
,isc.A.allMatchingRowsCached=function isc_ResultSet_allMatchingRowsCached(_1){return(this.allRows!=null&&(!this.allRowsCriteria||this.$505))||((_1?this.localData!=null:this.lengthIsKnown())&&(!this.isPaged()||(this.allRows!=null||(this.cachedRows==this.totalRows))))}
,isc.A.allRowsCached=function isc_ResultSet_allRowsCached(_1){if(_1==null)_1=this.$39t;return((this.allRows!=null&&(!this.allRowsCriteria||this.$505))
||(this.allMatchingRowsCached()&&_1)
)}
,isc.A.isEmpty=function isc_ResultSet_isEmpty(){if(this.isPaged()){if(this.allMatchingRowsCached()){return this.getLength()==0}else if(this.cachedRows>0)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.fastIndexOf(_1,_2,_3);if(_4!=-1)return _4;return this.getDataSource().findByKeys(_1,this.localData,_2,_3)}
,isc.A.fastIndexOf=function isc_ResultSet_fastIndexOf(_1,_2,_3,_4){return this.indexOf(_1,_2,_3,_4)}
,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(!isc.isA.Number(_1)||_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;i<this.getLength();i++){if(this.rowIsLoaded(i))_1.add(this.localData[i])}
return _1}
,isc.A.getAllVisibleRows=function isc_ResultSet_getAllVisibleRows(){if(!this.lengthIsKnown()){return null}else{return isc.ResultSet.$97o(this.localData.duplicate(),true)}}
,isc.A.usingFilteredData=function isc_ResultSet_usingFilteredData(){return(this.shouldUseClientFiltering()&&this.allMatchingRowsCached()&&this.localData&&this.allRows&&(this.localData.length<this.allRows.length))}
,isc.A.getAllCachedRows=function isc_ResultSet_getAllCachedRows(){if(!this.lengthIsKnown()){return null}else if(!this.allRows){return this.getAllVisibleRows()}else{var _1=this.allRows.duplicate();return _1}}
,isc.A.getFieldValue=function isc_ResultSet_getFieldValue(_1,_2,_3,_4,_5){if(this.dynamicDSFieldValues){return this.getDataSource().getFieldValue(_1,_2,_3)}else{return isc.Canvas.$70o(_2,_3,_1,_4,true,_5)}}
,isc.A.duplicate=function isc_ResultSet_duplicate(){var _1=isc.ResultSet.$121g,_2={};for(var i=_1.length;i--;){var _4=_1[i];_2[_4]=this[_4]}
if(isc.isAn.Array(this.sortSpecifiers)){var _5=this.dataSource,_6=_2.sortSpecifiers=new Array(this.sortSpecifiers.getLength());for(var i=_6.length;i--;){_6[i]=isc.DataSource.getSortBy(this.sortSpecifiers[i])}
}
_2.fetchOperation=this.getOperationId("fetch");_2.context=isc.addProperties({},this.context);var _7=this.localData&&this.localData.duplicate(),_8=this.allRows&&this.allRows.duplicate();_2.localData=_7;_2.totalRows=this.totalRows;_2.cachedRows=this.cachedRows;_2.$212q=this.$212q;_2.allRows=_8;_2.allRowsCriteria=isc.DataSource.copyCriteria(this.allRowsCriteria);_2.criteria=isc.DataSource.copyCriteria(this.criteria);if(this.implicitCriteria){_2.implicitCriteria=isc.DataSource.copyCriteria(this.implicitCriteria)}
_2.$121j=true;var _9=this.getClass().newInstance(_2);delete _9.$121j;return _9}
,isc.A.$1318=function isc_ResultSet__getLoadingRangesIndex(_1){var _2=this.$1317;var i=0,j=_2.length-1;while(i+1<j){var k=Math.floor((i+j)/2),v=_2[k];if(_1<v){j=k}else if(_1>v){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.$212q||this.allRows!=null)}
,isc.A.lengthIsProgressive=function isc_ResultSet_lengthIsProgressive(){return!!this.$256r}
,isc.A.fetchIsPending=function isc_ResultSet_fetchIsPending(){return this.$39v!=null||this.pendingActionOnPause("fetchRemoteData")||this.pendingActionOnPause("invalidateAllRowsCache")}
,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.getCombinedCriteria=function isc_ResultSet_getCombinedCriteria(){return isc.DS.compressNestedCriteria(this.getDataSource().combineCriteria(this.getImplicitCriteria(),isc.DataSource.copyCriteria(this.criteria),null,this.$51w)
)}
,isc.A.getServerFilter=function isc_ResultSet_getServerFilter(){if(this.isLocal())return null;return this.getDataSource().getServerCriterion(this.getCombinedCriteria())}
,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=this.$273o();var _5;if(_4&&_4.getPromptStyle)_5=_4.getPromptStyle();var _6=isc.addPropertiesWithAssign({operationId:this.getOperationId("fetch"),promptStyle:_5
},this.context,{resultSet:this,componentId:this.componentId||"(created directly)",componentContext:this.componentContext
});if(this.$39x)_6.sortBy=isc.shallowClone(this.$39x);if(_4&&_4.fetchFields){_6.outputs=_4.prepareFetchFields().join(", ");_4.$265b=_6.outputs}
if(_2!=null)_6.startRow=_2;if(_3!=null)_6.endRow=_3;var _7={requestIndex:this.$39r};if(this.context&&this.context.internalClientContext){_7=isc.addProperties({},this.context.internalClientContext,_7)}
_6.internalClientContext=_7;var _8=this.$256x()
if(_8===true||_8===false){_6.progressiveLoading=_8
}
_6.internalClientContext.$69t=_6.willHandleError;_6.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.logDebug("ResultSet server fetch with server criteria: "+this.echoFull(_1)+this.getStackTrace(),"fetchTrace")}
if(this.cachingAllData)_6.cachingAllData=true;this.$39v=this.$39r;this.getDataSource().fetchData(_1,{caller:this,methodName:"fetchRemoteDataReply"},_6)}
,isc.A.fetchRemoteDataReply=function(dsResponse,data,request){this.lastImplicitCriteria=this.getImplicitCriteria();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;var newData;var hasError=dsResponse.status<0,requestWasInvalidated=index<=this.$122t
;if(this.$39v==index){if(!requestWasInvalidated)this.$212q=true;delete this.$39v}
var allRowsCriteria,isAllRowsCritEmpty,context=this.$212j;if(context!=null&&(!requestWasInvalidated||context.request==index)){if(this.logIsDebugEnabled("rsAllRows")){this.logDebug("fetchRemoteDataReply(): handling response to request "+index+" with delayed local filtering context","rsAllRows")}
this.cancelActionOnPause("invalidateAllRowsCache");this.$212j=null;if(context.request==index){if(this.logIsDebugEnabled("rsAllRows")){this.logDebug("fetchRemoteDataReply(): received delayed response to request "+index+" with all matching rows","rsAllRows")}
if(hasError){var errorMessage="fetchRemoteDataReply(): bad all-matching-rows response";if(!requestWasInvalidated){requestWasInvalidated=true;errorMessage+="; invalidating cache";this.invalidateCache()}
this.logInfo(errorMessage,"rsAllRows")}else{if(requestWasInvalidated){if(this.logIsDebugEnabled("rsAllRows")){this.logDebug("fetchRemoteDataReply(): treating all-matching-rows request "+context.request+" as valid and invalidating all pending requests up to "+this.$39r,"rsAllRows")}
requestWasInvalidated=false;this.$122t=this.$39r}else{this.logDebug("fetchRemoteDataReply(): received response for valid all-matching-rows request","rsAllRows")}
allRowsCriteria=context.criteria;isAllRowsCritEmpty=isc.getKeys(context.criteria).length==0}
}else{if(this.logIsDebugEnabled("rsAllRows")){this.logDebug("fetchRemoteDataReply(): got response to narrowed fetch request "+index+"; dropping all-matching-rows request "+context.request,"rsAllRows")}
}
}
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.endRow<request.endRow){dsResponse.totalRows=dsResponse.endRow}
if(requestWasInvalidated){dsResponse.startRow=dsResponse.endRow;if(isc.isAn.Object(dsResponse.data))dsResponse.data=[]}
if(this.transformData){var result=this.transformData(newData,dsResponse);newData=result!=null?result:newData;if(newData.length!=numResults){this.logInfo("Transform applied, "+newData.length+" records resulted, from "+dsResponse.startRow+" to "+dsResponse.endRow);dsResponse.endRow=dsResponse.startRow+newData.length;if(dsResponse.totalRows!=null&&dsResponse.totalRows<dsResponse.endRow){dsResponse.totalRows=dsResponse.endRow}
}
}
if(!isc.isA.List(newData)){this.logWarn("Bad data returned, ignoring: "+this.echo(newData));return}
if(dsResponse.totalRows!=null&&dsResponse.totalRows<dsResponse.endRow){this.logWarn("fetchData callback: dsResponse.endRow set to:"+dsResponse.endRow+". dsResponse.totalRows set to:"+dsResponse.totalRows+". endRow cannot exceed total dataset size. Clamping endRow to the end of the dataset ("+dsResponse.totalRows+").");dsResponse.endRow=dsResponse.totalRows}
var startRow=dsResponse.startRow,endRow=dsResponse.endRow;this.$521();if(!requestWasInvalidated){this.$390(newData,dsResponse,isAllRowsCritEmpty);if(allRowsCriteria||isAllRowsCritEmpty){this.logInfo("fetchRemoteDataReply(): performing delayed local filtering","rsAllRows");this.$78z(this.localData,allRowsCriteria);this.filterLocalData()}
}
this.$522(startRow,endRow,hasError);delete this.context.afterFlowCallback;this.$39y=index;if(this.$39z&&this.$39z.length>0){for(var i=0;i<this.$39z.length;i++){var reply=this.$39z[i];if(reply==null)continue;var requestIndex=reply.dsResponse.internalClientContext.requestIndex;if(requestIndex==(this.$39y+1)){this.logInfo("Delayed out of sequence data response being processed now "+requestIndex);this.$39z[i]=null;this.fetchRemoteDataReply(reply.dsResponse,reply.data,reply.request);break}
}
}
var willHandleError=request.internalClientContext.$69t;if(!willHandleError&&hasError){isc.RPCManager.$a0(dsResponse,request)}}
,isc.A.$390=function isc_ResultSet__handleNewData(_1,_2,_3){if(this.isLocal()){this.$1317=[];this.$78z(_1.duplicate());this.filterLocalData();return}else if(!this.isPaged()){this.$ed();this.$1317=[];this.$121k(_1.duplicate());this.$2782(null,!this.canSortOnClient(),null);if(this.allRowsCached(_3)){this.$78z(this.localData,this.criteria)}
this.$ee(_2.operationType);return}
var _4=_2.context;this.$ed();if(_2.invalidateCache){this.$394()}else if(this.dropCacheOnLengthChange&&this.lengthIsKnown()&&this.totalRows!=_2.totalRows){this.logInfo("totalRows changed from "+this.totalRows+" to "+_2.totalRows+", invalidating cache");this.$394()}
if(this.localData==null){this.$121k([])}
var _5=_2.progressiveLoading;if(this.rememberDynamicProgressiveLoading&&_5&&(this.progressiveLoading==null)){this.$256y=true}
var _6=(_2.totalRows>_2.endRow)&&_5;var _7=_2.totalRows;if(_2.estimatedTotalRows!=null){var _8=this.$2562(_2.estimatedTotalRows);if(_8!=null){this.setRowCount(_8[0],_8[1])}
}
this.setFullLength(_7,_6);if(this.autoFetchRowCount&&_5){var _9=this.getRowCountStatus();if(_9!="exact"&&_9!="loading")
{this.fetchRowCount()}
}
this.fillCacheData(_1,_2.startRow);var _10=this.localData;var _11,_12;if(_2.context){_11=_2.context.startRow;_12=_2.context.endRow}
var _13=true;if(_11==null||_12==null){_13=false;_11=_2.startRow;_12=this.totalRows}
var _14=this.$1317,_15=_11+_1.length,i=_12;if(_14.length>0){var k=2*Math.ceil(this.$1318(_15)/2);i=Math.min(i,_14[k])}
if(i>_15){this.logInfo("Fetch request returned range "
+[_2.startRow,(_2.startRow+_1.length)]
+(_13?" differs from requested range "
+[_11,_12]+". ":" but we have subsequent 'loading' markers. ")
+"Assuming client/server batch size mismatch and clearing loading markers greater than "+(_2.startRow+_1.length));this.$132c(_15,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")}
this.$2782(null,!this.canSortOnClient(),null)}
this.$ee(_2.operationType)}
,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,null,!this.reapplyUnchangedLocalFilter);if(_2==null){if(this.localData==null&&this.allRows!=null)this.filterLocalData();this.logInfo("setCriteria: filter criteria unchanged");return false}
delete this.$256y;this.clearRowCount();var _3=this.getDataSource();if(!_3.isAdvancedCriteria(_1)){_1=isc.clone(_1)}
var _4=this.criteria;this.criteria=_1;isc.ResultSet.$2651(_1,_3);var _5=this.$51w;this.$39t=(isc.getKeys(_1).length==0);this.$51w=(this.context&&this.context.textMatchStyle)?this.context.textMatchStyle:null;if(this.$212k()){this.logInfo("setCriteria: filter criteria changed with outstanding all-rows fetch; delaying filtering of local data","rsAllRows");if(!this.isLocal())this.$212l(_4)}else 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,_4,_5)}
this.filterLocalData()}
return true}
,isc.A.setAllRows=function isc_ResultSet_setAllRows(_1){this.$78z(_1);this.filterLocalData()}
,isc.A.$78z=function isc_ResultSet__setAllRows(_1,_2,_3){this.allRows=_1;var _4=this.getImplicitCriteria();if(_4&&!isc.isAn.emptyObject(_4)){if(_3==null&&this.context&&this.context.textMatchStyle){_3=this.context.textMatchStyle}
_2=isc.DS.compressNestedCriteria(this.getDataSource().combineCriteria(_2,_4,null,_3))}
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,_3){delete this.$212m;if(this.localData==null&&this.allRows==null){return true}
if(_1==null)_1={};var _4=isc.shallowClone(this.criteria||{}),_5=this.$51w,_6=this.getDataSource()
;if(_2==null){_2=(this.context&&this.context.textMatchStyle)?this.context.textMatchStyle:null}
if(this.lastImplicitCriteria){_4=isc.DS.compressNestedCriteria(_6.combineCriteria(_4,this.lastImplicitCriteria,null,_5)
)}
var _7=this.getImplicitCriteria();if(_7){_1=isc.DS.compressNestedCriteria(_6.combineCriteria(_1,_7,null,_2)
)}
var _8=this.allRows&&this.shouldUseClientFiltering()
&&(_4!=this.allRowsCriteria);var _9=isc.isAn.emptyObject(_4)&&!_8?0:this.compareTextMatchStyle(_2,_5);var _10=_8?this.allRowsCriteria:_4;if(_10==null)_10={};var _11=_6.isAdvancedCriteria(_1),_12=_6.isAdvancedCriteria(_10)
;if(_9>=0||_11||_12||this.dbcImplicitCriteria||this.lastImplicitCriteria)
{if(_11&&!_12){_10=isc.DataSource.convertCriteria(_10,_5,_6)}else if(!_11&&_12){_1=isc.DataSource.convertCriteria(_1,_2,_6)}
var _13=isc.addProperties({},this.context);if(_2!=null)_13.textMatchStyle=_2;var _14=this.compareCriteria(_1,_10,_13);if(_8&&_14>=0){var _15=_6.isAdvancedCriteria(_4);if(_11&&!_15){_4=isc.DS.convertCriteria(_4,_5,_6)}else if(!_11&&_15){_1=isc.DS.convertCriteria(_1,_2,_6);_11=true}
if(this.compareCriteria(_1,_4)==0){if(_14==1&&_3)_14=0}else{if(_14==0)_14=1}
}
if(_11||_12||_9>=0&&_14!=0)
{_9=_14}
}
if(_9==0){return null}else{if(!this.allMatchingRowsCached(true)){return true}
if(this.isLocal()){}else if(_9==-1){var _16=!_4||isc.isAn.emptyObject(_4);if(!_16)return true}else if(_9==1){if(!this.shouldUseClientFiltering())return true}
if(!this.allMatchingRowsCached()){this.$212m=true;if(!this.isLocal())return true}
return false}}
,isc.A.$212k=function isc_ResultSet__shouldDelayFilterLocalData(){if(!this.$212m)return false;if(!this.isBasic())return this.isLocal();if(this.$39v==null&&this.$212j==null)return false;return this.allMatchingRowsFetchTimeout!=null}
,isc.A.$212l=function isc_ResultSet__scheduleDelayedCacheInvalidation(_1){if(this.$212j==null){var _2=this.$39v;if(this.logIsDebugEnabled("rsAllRows")){this.logDebug("scheduleDelayedCacheInvalidation(): setting context for delayed filtering of local data, request "+_2,"rsAllRows")}
this.$212j={request:_2,criteria:_1}}
var _3=this.allMatchingRowsFetchTimeout;if(this.logIsDebugEnabled("rsAllRows")){this.logDebug("scheduleDelayedCacheInvalidation(): scheduling cache invalidation after a pause of "+_3+"ms; observing DBCs will fetch data","rsAllRows")}
this.fireOnPause("invalidateAllRowsCache","$212n",_3)}
,isc.A.$212n=function isc_ResultSet__invalidateAllRowsCache(){var _1=this.$212j;this.logInfo("invalidateAllRowsCache(): executing delayed cache invalidation","rsAllRows");this.invalidateCache();this.$212j=_1}
,isc.A.sortByProperty=function isc_ResultSet_sortByProperty(_1,_2,_3,_4){var _5=this.getDataSource();if(_3==null){var _6=_5.getField(_1);if(_6)_3=_6.type}
if(this.$395==_1&&this.$392==_2&&this.$393==_3)
{return this}
var _6;if(_4){_6=_4.getFieldByName(_1);if(_6&&_6.displayField&&_6.sortByDisplayField!=false){var _7;if(_6.optionDataSource){_7=isc.DS.getDataSource(_6.optionDataSource)}
if(!_7||_7===_5){_1=_6.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.$175h;delete this.$573;delete this.$574;delete this.$575;delete this.$175g;if(!this.$52z())this.dataChanged();return this}
this.invalidateCache();return this}
);isc.evalBoundary;isc.B.push(isc.A.unsort=function isc_ResultSet_unsort(){if(!this.allMatchingRowsCached())return false;this.$73p=[];this.$39x=[];this.$395=null;if(this.localData)this.localData.unsort();return true}
,isc.A.$279j=function isc_ResultSet___augmentWithClientSortDependencies(_1,_2){if(_1)return;if(this.localData==null)return;if(!this.canSortOnClient())return;var _3=this.$73p;if(!_3)return;for(var s=0;s<_3.length;++s){var _5=_3[s],_6=isc.SortSpecifierUtil.$278v(_5);_2.push(_6)}}
,isc.A.$2783=function isc_ResultSet__doClientSort(_1,_2,_3){var _4=_2.component,_5=this.$73p||[],_6=new Array(_5.length),_7=new Array(_5.length),_8=[],_9=[],_10=[],_11=[],_12=[];var _13={cancellationController:_3,sortSpecifiers:_5,recordSortResultByIndex:_7,appliedSortSpecifiers:null,wasAppliedByIndex:null,properties:_9,directions:_10,normalizers:_11,contexts:_12,promise:null
};if(this.localData==null)return _13;if(_1){if(!this.canSortOnClient()){this.invalidateRowOrder();return _13}
}
if(this.canSortOnClient()){var _14=_2.resultByName,_15=_2.fieldGeneratorByFieldName;for(var s=0;s<_5.length;++s){var _17=_5[s],_18=isc.SortSpecifierUtil.$278v(_17);if(_4){var _19=_14&&_14[_18];if(_19&&_19.type!="success"){_6[s]=false;var _20=this.prerequisiteFieldGenerationNotSuccessfulErrorMessage.evalDynamicString(this,{fieldTitle:_4.getFieldTitle(_18),errorMessage:isc.getAsyncMessage(_19)
});_7[s]=isc.createErrorResult(_20);continue}
var _21=_15&&_15[_18];if(_21){var _22=isc.FieldGeneratorUtil.$278w(_21,_17,_4);if(_22){_6[s]=false;_7[s]=_22;continue}
}
}
_6[s]=true;_8.push(_17);_9.push(_18);_10.push(Array.shouldSortAscending(_17.direction));_11.push(_17.normalizer);_12.push(_17.context)}
var _23=function(){this.logInfo("finishClientSort: sorting on properties ["+_9.join(",")+"] : directions ["+_10.join(",")+"] : full cache allows local sort");var _24=_8.length;this.$102q(_9.length==_24);this.$102q(_10.length==_24);this.$102q(_11.length==_24);this.$102q(_12.length==_24);if(_24>0){this.$121s(_9,_10,_11,_12)}
_13.appliedSortSpecifiers=_8;_13.wasAppliedByIndex=_6;if(this.$73p){this.$2784(_8,false,_1,true)}
if(_24>0&&!this.$52z()){this.dataChanged()}
};if(_2.promise){var _25=(_4||this).ns.EH;_13.promise=_2.promise
.$271y(_25.$2762("PromiseSettled",_23,this))}else{_23.call(this)}
return _13}
if(this.$1708){return _13}
this.logInfo("doClientSort: sorting on properties ["+_9.join(",")+"] : directions ["+_10.join(",")+"] : invalidating cache");this.invalidateCache();return _13}
,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.$278m=function isc_ResultSet___usesDefaultNormalizer(_1){return _1.normalizer!=null&&_1.normalizer!=this.getDefaultNormalizer(_1.property)&&!_1.normalizer.$249w}
,isc.A.setSort=function isc_ResultSet_setSort(_1,_2,_3){if(_1==null)_1=[];var _4=!this.$126f&&(!this.$73p?0:this.$73p.length)>=_1.length;for(var i=0;i<_1.length;i++){var _6=_1[i];if(_6.normalizer==null){_6.normalizer=this.getDefaultNormalizer(_6.sortByProperty?_6.sortByProperty:_6.property)}
if(_6.context&&!isc.isA.String(_6.context)){var _7,_8=this.getDataSource().getField(_6.property),_9=_6.context.getField(_6.property)||_8;var _10=_9&&_9.displayField;if(_10===_7)_10=_8&&_8.displayField;var _11=_9&&_9.sortByDisplayField;if(_11===_7)_11=_8&&_8.sortByDisplayField;if(_10&&(_11!=false)){var _12=(_9&&_9.optionDataSource)||(_8&&_8.optionDataSource);if(_12){_12=isc.DataSource.getDataSource(_12)}
if(!_12||_12==isc.DataSource.getDataSource(this.dataSource)){this.logInfo("Field:"+_9.name+" has displayField:"+_10+" (with optionDataSource:"+_12+"). Sorting by displayField. Set field.sortByDisplayField to false to disable this.","sorting");_6.owningField=_6.property;if(!_6.sortByField&&!_9.sortByField){_6.property=_10}else if(!_6.sortByProperty){_6.sortByProperty=_10}
}
}
}
if(_4){var _13=this.$73p[i];if(_6.context!=_13.context||_6.property!=_13.property||_6.direction!=_13.direction||((!this.$278m(_6)||!this.$278m(_13))&&_6.normalizer!=_13.normalizer))
{_4=false}
}
}
this.$2784(_1,_2,_3,_4)}
,isc.A.$2784=function isc_ResultSet___finishSetSort(_1,_2,_3,_4){this.$73p=isc.shallowClone(_1);this.$39x=isc.shallowClone(isc.DS.getSortBy(_1));if(_4)return;if(!_2)this.$2782(_3,false,null)}
,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,true);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();this.$572=_1;if(isc.isAn.Array(_2)){if(_2.length==1){this.$573=_2[0]}else if(_2.length>0){this.$175h=_2}
}else if(_2!=null){this.$573=_2}
this.updateCache(_1,_2,_4);this.$ee();this.$572=this.$573=null}
,isc.A.$ee=function isc_ResultSet__doneChangingData(_1,_2,_3){var _4;if(!this.notifyOnUnchangedCache&&this.$573&&this.$575==null){_4=true}
var _5,_6;if(!_4&&(this.$573||this.$175g)){_1=this.$572;_5=this.$574;_6=this.$575}
if(--this.$ef==0&&!_4){this.dataChanged(_1,_5,_6,this.$573,_2,_3);delete this.$572;delete this.$175h;delete this.$574;delete this.$575;delete this.$576;delete this.$573;delete this.$175g}}
,isc.A.updateCache=function isc_ResultSet_updateCache(_1,_2,_3){if(_2==null)return;_1=isc.DS.$372(_1);if(this.dataSource.realtimeUpdates&&_1=="add")_1="replace";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()
;var _19=this.getImplicitCriteria(),_20=this.getDataSource()
;if(_19)_15=_20.combineCriteria(_15,_19);for(var i=0,_22=_1.length;i<_22;++i){var _23=_1[i],_24=isc.applyMask(_23,_18);var _25=_17.findByKeys(_24,_5);var _26=(this.applyFilter([_23],_15,this.context).length>0);if(_25==-1){var _27=_2.data;if(isc.isAn.Array(_27))_27=_27[0];if(_27){_27=isc.applyMask(_27,_18);var _28=this.getDataSource().findByKeys(_27,_5);if(_28!=-1){this.logWarn("Update operation - submitted record with primary key value[s]:"+this.echo(_27)+" returned with modified primary key:"+this.echo(_24)+". This may indicate bad server logic. Updating cache to reflect new primary key.");_7++;var _29=_5.get(_28);if(_11){this.$121t(_29,1,_28)}
_5.removeAt(_28);if(_4){--this.totalRows}
--this.cachedRows;if(_12){this.$121u(_29,1,_28)}
delete this.$573}
}
if(_26&&_5!=null){this.logInfo("updated row returned by server doesn't match any cached row,  adding as new row.  Primary key values: "+this.echo(_24)+", complete row: "+this.echo(_23));_8++;var _30=-1;if(_9){if(_5.sortUnique){_30=_5.lastIndexOf(_23)}
if(_30==-1){_5.add(_23);_30=_5.lastIndexOf(_23);_5.remove(_23)}
this.$121p(_23,1,_30)}
_5.add(_23);if(_4){++this.totalRows}
++this.cachedRows;if(_10){if(!_9){_30=_5.lastIndexOf(_23)}
this.$121q(_23,1,_30)}
if(_22==1){this.$576=_23;this.$575=_5.length-1}else{this.$175g=true}
}else{}
}else{if(_22==1){var _31=_5.get(_25);if(_3){if(this.applyFilter([_31],this.criteria,this.context).length==0&&this.applyFilter(_1,this.criteria,this.context).length==0)
{_31=null}
}
this.$574=_31;if(_31){this.$575=this.indexOf(_31)}
}else{this.$175g=true}
if(_26||_16){_6++;var _32=_5.get(_25);if(this.applyUpdatesToExistingRecord){isc.addProperties(_32,_23);var _20=this.getDataSource();var _33=_20.getFieldNames();for(var j=0;j<_33.length;j++){var _35=_33[j];if(!_23.hasOwnProperty(_35))delete _32[_35]}
}else{if(_13){this.$121n(_32,1,_25,_23,1)}
_5.set(_25,_23);if(_14){this.$121o(_32,1,_25,_23,1)}
}
}else{if(this.logIsDebugEnabled()){this.logDebug("row dropped:\n"+this.echo(_23)+"\ndidn't match filter: "+this.echoFull(_15))}
_7++;var _32=_5.get(_25);if(_11){this.$121t(_32,1,_25)}
_5.removeAt(_25);if(_4){--this.totalRows}
--this.cachedRows;if(_12){this.$121u(_32,1,_25)}
}
}
}
if(this.logIsDebugEnabled()){this.logDebug("updated cache: "
+_8+" row(s) added, "
+_6+" row(s) updated, "
+_7+" row(s) removed.")}
var _36=!(!_3&&(!this.shouldUpdatePartialCache()||this.allMatchingRowsCached())&&this.canSortOnClient());this.$2782(null,_36,_15,_1,true)}
,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);var _9=_6.combineCriteria(this.getImplicitCriteria(),this.criteria);for(var i=0,_11=_1.length;i<_11;++i){var _12=_6.findByKeys(_1[i],_3);if(_12!=-1){var _13=_3[_12];if(_11==1){if(!_2||_6.recordMatchesFilter(_13,_9,this.context))
{this.$574=_13;this.$575=this.indexOf(this.$574)}
}else{this.$175g=true}
if(_7){this.$121t(_13,1,_12)}
_3.removeAt(_12);if(_5){--this.totalRows}
--this.cachedRows;if(_8){this.$121u(_13,1,_12)}
_4++}else{if(this.allMatchingRowsCached())continue;if(_6.applyFilter([_1[i]],_9,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]))}
}
}
}
this.removeFromAsyncFilterCaches(_9,_1)}}
,isc.A.addCacheData=function isc_ResultSet_addCacheData(_1){var _2;if(_1==null)return;if(!isc.isAn.Array(_1))_1=[_1];var _3,_4;if(this.allRows==null||!this.shouldUseClientFiltering()){_3=this.getCombinedCriteria();_4=this.applyFilter(_1,_3,this.context)}else{_3=this.allRowsCriteria;_4=_1;if(_3){_4=this.applyFilter(_4,_3,this.context)}
}
var _5=_4.length,_6=false;if(_5!=_1.length){this.logInfo("Adding rows to cache, "+_5+" of "+_1.length+" rows match filter criteria")}else if(_5==1){_6=true}
var _7=this.allRows||this.localData;if(!_7)return;var _8=(_7==this.localData&&this.$121p!=null),_9=(_7==this.localData&&this.$121q!=null);var _10=(this.isPaged()&&!this.allRows&&this.totalRows!=null);var _11=(!this.allMatchingRowsCached()&&this.shouldUpdatePartialCache()),_12=_11&&this.getCachedRange();if(_12){var _13;if(_12[1]==this.getLength()-1||!this.rowIsLoaded(0)){_13=_12[1]+1}else{_13=0}
if(_8&&_5>0){this.$121p(_4,_4.length,_13)}
_7.addListAt(_4,_13);if(_10){this.totalRows+=_5}
this.cachedRows+=_5;if(_9&&_5>0){this.$121q(_4,_4.length,_13)}
if(_6)this.$575=_13;else if(_5>0)this.$175g=true}else{var _13;if(_8||_9){var _14=_7.sortUnique;for(var i=0,_16=_5;i<_16;++i){var _17=_4[i],_18=-1;if(_8){if(_14){_18=_7.lastIndexOf(_17)}
if(_18==-1){_7.add(_17,_2,true);_18=_7.lastIndexOf(_17);_7.remove(_17)}
this.$121p(_17,1,_18)}
_7.add(_17,_2,true);if(_10){++this.totalRows}
++this.cachedRows;if(_9){if(!_8){_18=_7.lastIndexOf(_17)}
this.$121q(_17,1,_18)}
if(_6){if(_18==-1){_18=_7.lastIndexOf(_17)}
_13=_18}
}
}else{_7.addList(_4);if(_10){this.totalRows+=_5}
this.cachedRows+=_5;if(_6)_13=_7.lastIndexOf(_4[0])}
if(_6){this.$575=_13}else if(_5>0){this.$175g=true}
}
if(this.$575!=null){this.$576=_7[this.$575]}
this.$2782(null,!this.canSortOnClient(),_3,_1,true)}
,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.allRows,_5=this.localData,_6=this.isLocal()?_4:_5,_7=false
;if(_6){var _8=0
;for(var i=0;i<_3.length;i++){var _10=_3[i][_1],_11=_6.findIndex(_1,_10),_12=true
;if(_11>=0){do{var _13=_6.get(_11);if(_13["$128o"]){if(_11==_8){if(_2){_13[_2]=_3[i][_2]}
_8++;_12=false}else{_6.removeAt(_11);var _14=this.allRows&&this.allRows.indexOf(_13);if(_14!=null&&_14!=-1){_4.removeAt(_14)}
}
}
_11=_6.findNextIndex(_11+1,_1,_10)}while(_11>=0)}
if(_12){var _15=!_4||_4==_5||_4.find(_1,_10);_3[i]["$128o"]=true;this.insertCacheData(_3[i],_8++,_15);_7=true}
}
}
return _7}
,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(i<k){var j=i+1,l=k;while(j<_13&&_11[j]==1+l){++j;++l}
var n=j-i,_18=(n>1?_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<k){_11[m]+=n}
}
i+=n}else{++i}
}
}
}}
,isc.A.findFirstCachedRow=function isc_ResultSet_findFirstCachedRow(_1){for(var i=_1;i>=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<this.totalRows;i++){if(this.localData[i]==null)return i-1}
return this.totalRows-1}
,isc.A.$39u=function isc_ResultSet__getRangePaged(_1,_2,_3,_4){if(this.$397){var _5=(this.ignoreCache?[]:this.localData)||[];return this.fillRangeLoading(_5.slice(_1,_2),_2-_1)}
this.$397=true;var _6=this.getRangePaged(_1,_2,_3,_4);delete this.$397;return _6}
,isc.A.getRangePaged=function isc_ResultSet_getRangePaged(_1,_2,_3,_4){if(_1<0||_2<0){this.logWarn("getRange("+_1+", "+_2+"): negative indices not supported, clamping start to 0");if(_1<0)_1=0}
if(_2<=_1){this.logDebug("getRange("+_1+", "+_2+"): returning empty list");return[]}
var _5=this.lengthIsKnown();if(!_3&&_5){var _6=this.getLength();if(_1>_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;if(this.parallelFetchesRequireLengthKnown!==false&&!_5){var _8=this.$39v,_9=this.$122t
;if(_9==null?_8!=null:_8>_9){if(this.logIsInfoEnabled("fetchTrace")){this.logInfo("getRange("+_1+", "+_2+"): parallel fetches are not allowed before the ResultSet length is known - not fetching")}
return this.fillRangeLoading(_7.slice(_1,_2),_2-_1)}
}
var _10=this.$132a(_1,_2,false),_11=false,_12,_13;if(_10==-1){_11=false}else{var _14=_10,_15=1+this.$132b(_1,_2,false);for(var i=_14;i<_15;++i){if(_7[i]==null){_12=i;break}
}
_11=(_12!=null);if(_11){for(var i=_15-1;i>=_12;--i){if(_7[i]==null){_13=i;break}
}
}
}
if(!_11){this.logDebug("getRange("+_1+", "+_2+") satisfied from cache");return this.fillRangeLoading(_7.slice(_1,_2),_2-_1)}
var _17,_18;if(this.fetchAhead){var _19=this.$398(_1,_2,_12,_13,_3);_17=_19[0];_18=_19[1]}else{_17=_12;_18=_13+1}
if(this.alwaysRequestVisibleRows){_17=_1;_18=_2}
this.fetchStartRow=_17;this.fetchEndRow=_18;var _20;if(_4||this.fetchDelay==0){this.$39w();_20=this.fillRangeLoading(_7.slice(_1,_2),_2-_1)}else{this.fireOnPause("fetchRemoteData","$39w",this.fetchDelay);_20=this.fillRangeLoading(_7.slice(_1,_2),_2-_1)}
if(_3){this.$121k(this.realCache);this.realCache=null}
return _20}
,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+1,_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+1;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(){if(!this.allRowsCached()&&!this.allMatchingRowsCached()){this.logWarn("filterLocalData(): local filtering is not available for this ResultSet - client-side data cache is not complete for the current set of criteria.");return}
var _1=!this.$52z();if(_1)this.$ed();var _2=[],_3=false,_4=[],_5=this.allRows||this.localData;if(_5!=null){for(var i=0;i<_5.length;i++){if(_5[i].$128o){_3=true;_4.add(_5[i])}else if(!_3){_2=_5;break}else{_2[_2.length]=_5[i]}
}
}
var _7=this.getCombinedCriteria();var _8=this.applyFilter(_2,_7,isc.addProperties({dataSource:this
},this.context));if(_3){_8.addListAt(_4,0)}
this.$102q(this.allMatchingRowsCached());if(this.allRows==null){this.$78z(_8,_7)}
this.$121k(_8);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")}
var _9=!(this.allRows!=null&&this.shouldUseClientSorting());this.$2782(null,_9,_7,_8,false);if(!this.$524()&&this.dataArrived){this.dataArrived(0,this.localData.length,true)}
if(_1)this.$ee(null,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.$266m=function isc_ResultSet__removeNonmatchingRecords(_1,_2,_3){if(_1===_3){for(var _4=0;_4<_1.length;++_4){_1[_4].$266n=_4}
}else{for(var _4=0;_4<_1.length;++_4){_1[_4].$266n=_3.indexOf(_1[_4])}
_1=_1.duplicate();_1.sortByProperty("$266n",true);var _5=0;while(_5<_1.length&&_1[_5].$266n<0){delete _1[_5].$266n;++_5}
if(_5>0)_1=_1.slice(_5)}
try{var _6=[],_4=0;for(;;){for(;_4<_1.length;++_4){if(!_2.contains(_1[_4])){break}
}
if(_4>=_1.length)break;var _7=_1[_4];++_4;for(;_4<_1.length;++_4){var _8=_1[_4];if(!_2.contains(_8)){var _9=_1[_4-1];if(_9.$266n+1!=_8.$266n){_6.push({start:_7.$266n,end:_9.$266n+1});_7=_8}
}else{_6.push({start:_7.$266n,end:_1[_4-1].$266n+1});break}
}
if(_4>=_1.length){_6.push({start:_7.$266n,end:_1[_1.length-1].$266n+1});break}else{this.$102q(_2.contains(_1[_4]));++_4}
}
if(_6.length==0)return;var _10=!this.$52z();if(_10)this.$ed();for(var _11=_6.length;_11>0;--_11){var _12=_6[_11-1],_13=_12.end-_12.start;this.$102q(_13>0);var _14=_13==1?_3[_12.start]:_3.slice(_12.start,_12.end);if(this.$121t)this.$121t(_14,_13,_12.start);var _15=_3.splice(_12.start,_13);if(_1===_3){for(var _4=0;_4<_15.length;++_4){delete _15[_4].$266n}
}
if(this.$121u)this.$121u(_14,_13,_12.start)}
if(_10)this.$ee(null,true,true)}finally{for(var _4=0;_4<_1.length;++_4){delete _1[_4].$266n}
}}
);isc.evalBoundary;isc.B.push(isc.A.$2782=function isc_ResultSet__doAsyncClientFilterAndSort(_1,_2,_3,_4,_5){var _6=this.$266x,_7;if(_6&&!_6.canceled){_6.cancel("$2782() was called again.","system");delete this.$266x;_2=_2&&this.$275x;_3=_3||this.$275y}
this.$275x=_2;this.$275y=_3;_6=isc.CancellationController.create();var _8=this.$273o(),_9=(_8||this).ns.EH,_10=this.getDataSource(),_11,_12,_11,_13;if(!isc.isA.DataBoundComponent(_8)){_8=null}else{_10=_8.getDataSource()||_10}
if(_3){_11=_10.collectTopLevelAsyncCriteria(_3)}
if(!_8){_13={cancellationController:null
}}else{var _14=[];if(!_2){this.$279j(_1,_14)}
if(_3){for(var _15=_11.length;_15>0;--_15){var _16=_11[_15-1];if(_8.isCriterionDisabled(_16)){_11.removeAt(_15-1);continue}
if(!_14)continue;var _17=isc.DS.getCriterionDependencies(_16,_10);if(!_17)_14=null;else _14.addList(_17)}
}
var _18;if(_14){_18=[];for(var d=0;d<_14.length;++d){var _20=_8.getFieldByName(_14[d]);if(_20)_18.push(_20)}
}
var _21=_8.$277l();_13=isc.FieldGeneratorUtil.$2766(_8,_18,this,_21)}
var _22,_23;if(!_2){_22=this.$2783(_1,_13,_6)}else{_22={cancellationController:_6
}}
if(_3){var _12=_3.strictSQLFiltering!=null?_3.strictSQLFiltering:_10.strictSQLFiltering;_23={cancellationController:_6,criterion:_3,dataSource:_10,strictSQLFiltering:_12,asyncCriteria:_11,promise:null
};if(_11.length>0){for(var i=0;i<_11.length;++i){if(_11[i].$2655==null){this.logWarn("found an async criterion missing a criterion ID");isc.ResultSet.$2651(_11[i],_10)}
}
var _25=function(){_4=isc.ResultSet.$97o(_4);var _26=_10.applyAsyncCriteria(_11,_4,_5,_12,_6);return _26&&_26
.then(_9.$2762("PromiseFulfilled",function(_33){if(_6.canceled)return;_7.addAsyncFilterResults(_33);var _27=this.localData;if(!_27)return;var _28=_4;for(var i=0;i<_33.length;++i){var _29=_33[i];if(_29.type!="success")continue;if(!isc.isAn.Array(_29.matchingRecords))continue;_28=_28.intersect(_29.matchingRecords)}
this.$266m(_4,_28,_27)},this))};if(_13.promise){_23.promise=_13.promise
.then(_9.$2762("PromiseFulfilled",_25,this))}else{_23.promise=_25.call(this)}
}
}else{_23={cancellationController:_6
}}
var _30=_22.promise,_31=_23.promise;if(!_30&&!_31){_6.destroy();return}
this.$266x=_6;_7=this.$2659(_13,_22,_31,_6,_4,_5);if(_23.asyncCriteria){_7.setAsyncFiltersToRunning(_23.asyncCriteria)}
Promise.$273i([_30,_31],_6)
.then(_9.$2762("AllPromisesSettled",function(){if(_6.canceled){_7.destroy();return}
var _11=_7.clientFilterContext&&_7.clientFilterContext.asyncCriteria;if(_11){for(var i=0;i<_11.length;++i){var _32=_7.getAsyncFilterResult(_11[i]);this.$102q(_32&&_32.type!="running")}
}
delete this.$266f;delete this.$275x;delete this.$275y;this.$266b(_6,_7);_7.destroy()},this))}
,isc.A.$2659=function isc_ResultSet__enterAsyncFilterAndSort(_1,_2,_3,_4,_5,_6){var _7=isc.AsyncFilterAndSortResults.create({generateMissingValuesContext:_1,clientSortContext:_2,clientFilterContext:_3,records:_5,recordsWereUpdated:_6
});this.$102q(!_4.canceled);this.$266x=_4;this.observe(_4,"cancel","observer.$279c(returnVal,observed)");this.$266f=_7;this.fireCallback(this.asyncFilterAndSortStart,isc.ResultSet._stringMethodRegistry.asyncFilterAndSortStart);return _7}
,isc.A.isAsyncFilterAndSortRunning=function isc_ResultSet_isAsyncFilterAndSortRunning(){return!!this.$266x}
,isc.A.$266k=function isc_ResultSet__cleanupOnAsyncFilterAndSortStop(_1){this.ignore(_1,"cancel");if(this.$266x===_1){delete this.$266x}}
,isc.A.$266b=function isc_ResultSet__leaveAsyncFilterAndSort(_1,_2){this.$266k(_1);this.fireCallback(this.asyncFilterAndSortStop,isc.ResultSet._stringMethodRegistry.asyncFilterAndSortStop,[_2])}
,isc.A.$279c=function isc_ResultSet___handleCancelAsyncSortAndFilter(_1,_2){if(!_1)return;this.$102q(_2===this.$266x);this.$102q(_2.canceled);var _3=_2.asCanceledResult();this.$266f.changeRunningAsyncFilterResultTypesToCanceled(_3);this.$266k(_2);this.fireCallback(this.asyncFilterAndSortCanceled,isc.ResultSet._stringMethodRegistry.asyncFilterAndSortCanceled,[_3,this.$266f])}
,isc.A.cancelAsyncFilterAndSort=function isc_ResultSet_cancelAsyncFilterAndSort(){var _1=this.$266x;if(_1){_1.cancel.apply(_1,arguments)}}
,isc.A.removeFromAsyncFilterCaches=function isc_ResultSet_removeFromAsyncFilterCaches(_1,_2){var _3=this.getDataSource(),_4=_3.collectTopLevelAsyncCriteria(_1);for(var i=0;i<_4.length;++i){var _6=_4[i],_7=_3.getSearchOperator(_6.operator);if(_7&&_7.removeFromFilterCaches)_7.removeFromFilterCaches(_6,_2)}}
,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)}
}
this.$212q=true;if(this.allRowsCached()){this.$78z(this.localData,this.criteria)}}
,isc.A.setFullLength=function isc_ResultSet_setFullLength(_1,_2){if(!isc.isA.Number(_1))return;this.logDebug("full length set to: "+_1+", progressiveLoading?:"+(!!_2));var _3=this.isPaged(),_4=(this.localData&&this.localData.length)||0,_5=this.lengthIsKnown(),_6=(_5?Math.max(_4,this.getLength()):_4);if(!_2){delete this.$256r;this.clearRowCount()}else{if(!_5){this.$256r=true}
}
if(_2&&_5&&(!this.$256r||_1<_6)){this.logInfo("ResultSet.setFullLength(): Ignoring row count "+_1+" reported by progressiveLoading fetch operation. "+(this.$256r?"This is less than a previously reported progressive row count, implying that there are more rows available."
:"An accurate row count has already been applied to this ResultSet.")
);return}
var _7=this.$1317;if(_7.length>0){this.$132c(_1,_7.last(),false)}
if(_1<_6){var _8=(this.$121t!=null||this.$121u!=null),_9;if(_8&&_1<_4){_9=this.localData.slice(_1,_4);for(var i=_4;i<_6;++i){_9[i]=null}
}else{_9=null}
if(this.$121t!=null){this.$121t(_9,_6-_1,_1)}
if(_3){this.totalRows=_1}
if(this.localData){this.localData=this.localData.slice(0,_1)}
if(this.$121u!=null){this.$121u(_9,_6-_1,_1)}
}else{var _8=_1>_6;if(_8&&this.$121p!=null){this.$121p(null,_1-_6,_6)}
if(_3){this.totalRows=_1}
if(this.localData){this.localData.length=_1}
if(_8&&this.$121q!=null){this.$121q(null,_1-_6,_6)}
}
if(this.cachedRows>_1){this.cachedRows=_1}
if(this.$121v!=null){var _11=this.lengthIsKnown();if(_5!=_11){this.$121v(_5,_11)}
}
if(this.localData!=null){this.$212q=true}}
,isc.A.getRowCountStatus=function isc_ResultSet_getRowCountStatus(){if(!this.lengthIsKnown()){if(this.$2563!=null)return this.$2563;return"unknown"}
if(!this.lengthIsProgressive())return"exact";if(this.$2563==null)return"minimum";return this.$2563}
,isc.A.getRowCount=function isc_ResultSet_getRowCount(){if(this.$126p!=null)return this.$126p;return this.getLength()}
,isc.A.getRowCountRange=function isc_ResultSet_getRowCountRange(){return[this.getRowCount(),this.$2564]}
,isc.A.setRowCount=function isc_ResultSet_setRowCount(_1,_2){if(_2=="exact"&&this.applyRowCountToLength){this.setFullLength(_1);return}
this.cancelRowCountFetch();if(isc.isAn.Array(_1)){if(_2!="range"){this.logWarn("setRowCount passed an array:"+_1+" treating as a range even though requested status was:"+_2);_2="range"}
this.$2564=_1[1];_1=_1[0]}
this.$126p=_1;this.$2563=_2}
,isc.A.fetchRowCount=function isc_ResultSet_fetchRowCount(_1,_2){this.setRowCount(null,"loading");var _3=this.getServerFilter();this.$257a="_"+this.$2568++;this.$2569[this.$257a]=_1;var _4=isc.addProperties({},this.context,this.rowCountContext,{clientContext:{rowCountFetchCriteria:isc.clone(_3),$257a:this.$257a
},showPrompt:this.blockingRowCountFetch,startRow:0,endRow:0,progressiveLoading:false,isBackgroundRequest:true,operationId:(this.rowCountOperation||this.fetchOperation)
},_2);_4.operation=null;var _5=isc.RPCManager.startQueue();this.getDataSource().fetchData(_3,{target:this,methodName:"fetchRowCountReply"},_4
);if(!_5){this.$257h=isc.RPCManager.getQueueTransactionId();isc.RPCManager.sendQueue()}}
,isc.A.fetchRowCountReply=function isc_ResultSet_fetchRowCountReply(_1,_2,_3){delete this.$257h;var _4=_3.clientContext.$257a
if(this.$257a!=_4){return}
delete this.$257a;var _5=this.getServerFilter();var _6=false;var _7=_3.clientContext.rowCountFetchCriteria;if(this.getDataSource().compareCriteria(_5,_7,_3)!=0){_6=true}
if(!_6){var _8;if(!_1.progressiveLoading){_8=_1.totalRows}else{if(_1.estimatedTotalRows!=null){var _9=this.$2562(_1.estimatedTotalRows);if(_9&&_9[1]=="exact"){_8=_9[0]}
}
}
if(_8==null){this.logWarn("ResultSet.fetchRowCount(): server response did not contain an exact row count - ignoring");this.clearRowCount()}else{this.setRowCount(_8,"exact")}
}
var _10=this.$2569[_4];delete this.$2569[_4];if(_10!=null){this.fireCallback(_10,"resultSet,dsResponse,success",[this,_1,_6])}
if(!_6)this.rowCountFetchComplete()}
,isc.A.rowCountFetchComplete=function isc_ResultSet_rowCountFetchComplete(){}
,isc.A.clearRowCount=function isc_ResultSet_clearRowCount(){delete this.$126p;delete this.$2564;delete this.$2563;this.cancelRowCountFetch()}
,isc.A.cancelRowCountFetch=function isc_ResultSet_cancelRowCountFetch(){if(this.$257h){isc.RPCManager.cancelQueue(this.$257h);delete this.$257h}
var _1=this.$257a;var _2=this.$2569[_1];delete this.$2569[_1];if(_2!=null){this.fireCallback(_2,"resultSet,dsResponse,success",[this,null,true])}
delete this.$257a}
,isc.A.$2562=function isc_ResultSet__parseEstimatedTotalRows(_1){_1=_1.trim();var _2,_3,_4;if(_1.endsWith("+")){_2=parseInt(_1);_4="minimum"}else if(_1.startsWith("~")){_2=parseInt(_1.substring(1,_1.length));_4="approximate"
}else if(_1.contains("-")){if(_1.indexOf("-")==0){_2=parseInt(_1.substring(1,_1.length));_4="maximum"
}else{var _5=_1.split("-");_2=parseInt(_5[0]);_3=parseInt(_5[1]);_4="range"}
}
if(_2==null){_2=parseInt(_1);if(_2.toString()!=_1){_2=null}else{_4="exact"}
}
if(!isc.isA.Number(_2)){this.logWarn("Unable to parse dsResponse.estimatedTotalRows value:"+_1);return null}
if(isc.isA.Number(_3))_2=[_2,_3];return[_2,_4]}
,isc.A.invalidateCache=function isc_ResultSet_invalidateCache(){this.cancelActionOnPause("fetchRemoteData");this.fetchStartRow=this.fetchEndRow=null;this.cancelActionOnPause("invalidateAllRowsCache");this.$212j=null;this.$122t=this.$39r;if(this.neverDropCache){isc.logWarn("invalidateCache() called on ResultSet populated with local data (not from dataSource). Ignoring.");return}
delete this.$572;delete this.$175h;delete this.$576;delete this.$573;delete this.$574;delete this.$575;delete this.$175g;this.$394();if(!this.$52z())this.dataChanged(null,null,null,null,true)}
,isc.A.$394=function isc_ResultSet__invalidateCache(){delete this.$256y;this.invalidateRows();delete this.$212q;this.totalRows=null;this.clearRowCount();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+129;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",asyncFilterAndSortStart:"",asyncFilterAndSortCanceled:"canceledResult,asyncFilterAndSortResults",asyncFilterAndSortStop:"asyncFilterAndSortResults"});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.defineClass("FilteredList","ResultSet");isc.A=isc.FilteredList.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.fetchMode="local";isc.A.modifiable=true;isc.A.neverDropCache=true;isc.A.reapplyUnchangedLocalFilter=true;isc.B.push(isc.A.init=function isc_FilteredList_init(){if(this.allRows==null)this.allRows=[];return this.Super("init",arguments)}
,isc.A.getDataSource=function isc_FilteredList_getDataSource(){if(this.dataSource==null){return isc.FilteredList.getFilterDS()}
return this.dataSource}
);isc.B._maxIndex=isc.C+2;isc.A=isc.FilteredList;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.getFilterDS=function isc_c_FilteredList_getFilterDS(){if(this.$901==null){this.$901=isc.DataSource.create({clientOnly:true,dropUnknownCriteria:false
})}
return this.$901}
);isc.B._maxIndex=isc.C+1;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.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.nameProperty="__nodePath";isc.A.nodeTypeProperty="nodeType";isc.A.childTypeProperty="childType";isc.A.modelType="parent";isc.A.loadDataOnDemand=true;isc.A.autoPreserveOpenState="whenUnique";isc.A.fetchDelay=0;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)},applyUpdatesToExistingRecord:true
};isc.A.childCountProperty="childCount";isc.A.canReturnOpenSubfoldersProperty="canReturnOpenSubfolders";isc.A.canReturnOpenFolders=false;isc.A.autoOpen="none";isc.A.defaultNewNodesToRoot=false;isc.A.updateCacheFromRequest=true;isc.A.linkDataFetchMode="separate";isc.A.sendNullParentInLinkDataCriteria=true;isc.A.firstPositionValue=1;isc.B.push(isc.A.getImplicitCriteria=function isc_ResultTree_getImplicitCriteria(){if(!this.implicitCriteria&&!this.dbcImplicitCriteria)return null;return isc.DS.compressNestedCriteria(this.getDataSource().combineCriteria(isc.DataSource.copyCriteria(this.dbcImplicitCriteria),isc.DataSource.copyCriteria(this.implicitCriteria)
))}
,isc.A.setDbcImplicitCriteria=function isc_ResultTree_setDbcImplicitCriteria(_1,_2){this.lastImplicitCriteria=!this.dbcImplicitCriteria?null:isc.DS.copyCriteria(this.dbcImplicitCriteria);this.dbcImplicitCriteria=_1;if(this.context){this.context.lastImplicitCriteria=isc.DS.copyCriteria(this.lastImplicitCriteria);this.context.dbcImplicitCriteria=isc.DS.copyCriteria(this.dbcImplicitCriteria);if(_2)this.context.afterFlowCallback=_2}
return this.setCriteria(this.criteria,true)}
);isc.B._maxIndex=isc.C+2;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.$864=isc.Tree.getPrototype().$864.concat(["fetchMode","dataSource","loadDataOnDemand","childCountProperty","defaultIsFolder","discardParentlessNodes","defaultNewNodesToRoot","updateCacheFromRequest","disableCacheSync","keepParentsOnFilter","serverFilterFields","canReturnOpenFolders","linkDataSource"]);isc.A.currentFetch=0;isc.A.$131y={};isc.B.push(isc.A.add=function isc_ResultTree_add(_1,_2,_3,_4){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,_4)}}
,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>0?_9.dataPageSize:this.resultSize;this.$121y=isc.addProperties({},this.$121y,{resultSize:this.resultSize
})}
if(this.keepParentsOnFilter&&this.fetchMode!="paged"
){this.fetchMode="local"}
if(this.isLocal()&&this.serverFilterFields!=null&&this.serverFilterFields.length>0)
{var _10=this.getCombinedCriteria();this.$87d=isc.DataSource.copyCriteria(_10);this.$868=this.getDataSource().splitCriteria(this.$87d,this.serverFilterFields,true)}
if(!this.loadDataOnDemand&&this.isPaged()){this.logWarn("Found loadDataOnDemand: false, but that's incompatible with fetchMode: 'paged' - setting true");this.loadDataOnDemand=true}
if(this.initialData){if("parent"==this.modelType)this.data=this.initialData;else if("children"==this.modelType)this.root=this.initialData}
var _11=isc.DataSource.getDataSource(this.dataSource);this.observe(_11,"dataChanged","observer.dataSourceDataChanged(dsRequest,dsResponse);");if(this.isMultiLinkTree()){var _12=isc.DataSource.getDataSource(this.linkDataSource);if(_12){this.observe(_12,"dataChanged","observer.linkDataSourceDataChanged(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,_3){var _4=this.serverFilterFields;if(isc.isAn.Array(_4)){_4=_4.duplicate()}
var _5={};this.$1201(_5);_5.autoOpenRoot=false;var _6=this.getClass().newInstance(_5);if(_3){var _7=isc.DataSource.getDataSource(this.dataSource);if(_7)_6.ignore(_7,"dataChanged");if(this.isMultiLinkTree()){var _8=isc.DataSource.getDataSource(this.linkDataSource);if(_8)_6.ignore(_8,"dataChanged")}
}
if(this.isMultiLinkTree()){return this.Super("duplicate",[_1,_2,_6],arguments)}
var _9=this.getRoot(),_10=this.isOpen(_9,this.pathDelim),_11=this.isFolder(_9),_12=_9[this.$111w],_13=_9[this.$1200],_14=_9[this.$1215],_15=this.getCleanNodeData(_9,false,false,_2);_15[_6.openProperty]=_10;_15[_6.isFolderProperty]=_11;_15[_6.$111w]=_12;_15[_6.$1200]=_13;_15[_6.$1215]=_14;this.$1216(_9,_6,_15,_2);_6.setRoot(_15);return _6}
,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){if(!this.isMultiLinkTree()){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);if(!this.isMultiLinkTree()){_15[_7]=_16;_15[_8]=_17;_15[_9]=_18;_15[_10]=_19;_15[_11]=_20}
}
_12[i]=_15}
return _12}else{if(!this.isMultiLinkTree()){var _16=this.isOpen(_2),_17=this.isFolder(_2),_18=_2[_4],_19=_2[_5],_20=_2[_6]}
var _15=this.getCleanNodeData(_2,false,false,_3);if(!this.isMultiLinkTree()){_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");if(this.isMultiLinkTree()){var _2=isc.DataSource.getDataSource(this.linkDataSource);if(_2)this.ignore(_2,"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.getCombinedCriteria=function isc_ResultTree_getCombinedCriteria(){return this.$255a(this.criteria)}
,isc.A.$255a=function isc_ResultTree__getCombinedCriteria(_1){return isc.DS.compressNestedCriteria(this.getDataSource().combineCriteria(this.getImplicitCriteria(true),isc.DataSource.copyCriteria(_1))
)}
,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,_4){var _5=(_1==null||_1==this.root),_6=_2.childDS,_7=_2.parentDS;if(!_3){if(!this.isLocal()){_3=isc.addProperties({},this.getCriteria(_6,_7,_1));_3=isc.DS.checkEmptyCriteria(_3)||{}}else if(this.$868!=null){_3=isc.addProperties({},this.$868)}
}
_3=_3||{};var _8=isc.isAn.emptyObject(_3);var _9=!_8&&isc.DS.isAdvancedCriteria(_3);if(_5&&this.isMultiDSTree()){}else if(this.loadDataOnDemand||this.isPaged()){var _10=_1[_2.idField];var _11;if(_5&&_10===_11){_10=_2.rootValue}
var _12=_2.idField;if(!_9&&!this.useSimpleCriteriaLOD){var _13=this.context,_14=_13&&_13.hasOwnProperty("textMatchStyle")?_13.textMatchStyle:_6&&_6.defaultTextMatchStyle;if(_14!="exact"){_9=true;if(!_8)_3=isc.DS.convertCriteria(_3,_14,_2.childDS);else _3={_constructor:"AdvancedCriteria",operator:"and",criteria:[]}}
}
if(_9){_3=isc.DataSource.combineCriteria(_3,{_constructor:"AdvancedCriteria",fieldName:_2.parentIdField,value:_10,operator:"equals"
},"and"
)}else{_3[_2.parentIdField]=_10}
}
if(_9){_3=isc.DS.compressNestedCriteria(_3);_3=isc.DS.checkEmptyCriteria(_3)}
return _3}
,isc.A.$1702=function isc_ResultTree__getPagedLineRange(_1,_2,_3){if(_1>=_2)return null
if(_3){_1=Math.max(_3.firstIndexOf(false,_1,_2),_1);_2=Math.max(_3.lastIndexOf(false,_1,_2)+1,_1+1)}
var _4=this.resultSize,_5=(_2-_1)/2,_6=(_2+_1)/2;var _7=Math.ceil(_5*2/_4);var _8=Math.floor(_6-_7*_4/2),_9=Math.floor(_6+_7*_4/2);if(_8<0){_9+=-_8;_8=0}
if(_3){var _10=_3.lastIndexOf(true,_8,_1)+1,_11=_3.firstIndexOf(true,_2,_9);if(_10>0||_11>=0){var _12=_3.lastIndexOf(true,_8-(_9-_2),_8)+1,_13=_3.firstIndexOf(true,_9,_9+(_1-_8));var _14=_12>0?_8-_12:_9-_2,_15=_13>=0?_13-_9:_1-_8;_14=_11>=0?Math.min(_14,_9-_11):0;_15=_10>0?Math.min(_15,_10-_8):0;if(_15>_14){_8+=_15;_9+=_15}else if(_14>0){_8-=_14;_9-=_14}
}
}
return[_8,_9]}
,isc.A.$193b=function isc_ResultTree__getLoadChildrenRequestPropsFromContext(_1,_2,_3,_4,_5){var _6=isc.addProperties({parentNode:_3,willHandleError:true,resultTree:this
},_5,this.context);if(this.context&&this.context.internalClientContext){_4=isc.addProperties({},this.context.internalClientContext,_4)}
_6.internalClientContext=_4;var _7=this.getOperationId(_1,_2,_3);if(_7)_6.operationId=_7;return _6}
,isc.A.$121b=function isc_ResultTree__loadChildren(_1,_2,_3,_4){var _5;if(this.isANodeLocator(_1)){_5=_1;_1=_1.node}
var _6=this.$1218(_1,true),_7=_6.childDS,_8=_6.parentDS;_1.$40a=_7.ID;var _9=(_1==null||_1==this.root),_10=this.$1219(_1,_6,null,true)
;if(this.fetchMode=="basic"){var _11=this.getImplicitCriteria();if(_11)_10=_8.combineCriteria(_10,_11)}
if(!((_9&&this.isMultiDSTree())||this.loadDataOnDemand)){this.setDefaultLoadState(isc.Tree.LOADED)}
var _12={parentNodeLocator:_5,parentNode:_1,relationship:_6,childrenReplyCallback:_4
};if(!this.$84a){_12.$84b=true;this.$84a=true}
var _13=_12.fetchCount=(++this.currentFetch);var _14=this.$193b(_7,_8,_1,_12);if(this.isPaged()){if(this.keepParentsOnFilter){_14.keepParentsOnFilter=true}
if(_1!=null&&_2!=null&&_3!=null){var _15=_1[this.childrenProperty];if(!isc.isA.ResultSet(_15)&&_2<_3){var _16=_1[this.$166s],_17=_1[this.$166t],_18=(_17!=null&&this.invalidatedFetchCount!=null&&_17<=this.invalidatedFetchCount),_19
;if(_16==null||_18){_16=isc.BitSet.create();_1[this.$166s]=_16;_1[this.$166t]=_13;_19=this.$1702(_2,_3)}else{if(_4==null&&_16.all(true,_2,_3)){return}
_19=this.$1702(_2,_3,_16)}
_16.setRange((_2=_19[0]),(_3=_19[1]),true)}
}
_14.startRow=_2;_14.endRow=_3;_14.sortBy=isc.shallowClone(this.$39x)}
if(_1!=null)this.setLoadState(_1,isc.Tree.LOADING);var _20=this.$124u(),_21=null;if(_20!==false){var _22=true;for(var n=_1,p=null;_22&&n!=null;n=p){p=this.getParent(n);if(p==null){_22=true}else{var c=this.getChildren(p);_22=(c.getLength()==1+c.indexOf(n))}
}
_20=_22&&_20;if(_20===true||_20===false){_21={progressiveLoading:_20}}
}else{_21={progressiveLoading:false}}
var _26={};var _27=false;var _28=isc.addProperties(_14,_21);if(!_27){this.fetchChildData(_7,_10,_28,_26)}}
,isc.A.fetchChildData=function isc_ResultTree_fetchChildData(_1,_2,_3,_4){var _5=false;var _6=false;if(this.isMultiLinkTree()&&this.linkDataFetchMode=="separate"){var _7=isc.DataSource.get(this.linkDataSource);if(!_7){this.logWarn("MultiLink tree specifies linkDataFetchMode:separate, but does not provide a valid linkDataSource.  This is not valid, please see the documentation for 'linkDataFetchMode'");return}
var _8=this.addSkeletonToCriteria({});_8=this.$1219(_3.parentNode,_3.internalClientContext.relationship,_8,true);if(_8[this.parentIdField]===null&&!this.sendNullParentInLinkDataCriteria){delete _8[this.parentIdField]}
var _9=this.$193b(_7,_7,_3.parentNode,_3.internalClientContext);var _10=_9.linkDataFetchOperation||this.linkDataFetchOperation;_9.operation=isc.DataSource.makeDefaultOperation(_7,"fetch",_10);_9.operationId=_10;_9.$202u=(_8[this.parentIdField]==null);_9.suppressOldValues=true;_9.requiresLimitingCriteria=true;if(!this.sendLinkDataFieldsInNodeCriteria){_2=isc.addProperties({},_2);delete _2[this.idField];delete _2[this.parentIdField];delete _2[this.linkPositionField]}
var _11=this;_5=!isc.RPCManager.startQueue();_7.fetchData(_8,{caller:this,methodName:"loadLinkDataReply"},isc.addProperties(_9,_3.progressiveLoadingProperties))}
if(this.loadDataOnDemand&&this.isMultiLinkTree()&&this.linkDataFetchMode=="separate"){}
if(!_6){_3.suppressOldValues=true;_1.fetchData(_2,{caller:this,methodName:"loadChildrenReply"},_3)}
if(_5){isc.RPCManager.sendQueue()}}
,isc.A.$172v=function isc_ResultTree__addChildren(_1,_2,_3,_4,_5,_6,_7){var _8;if(this.isANodeLocator(_1)){_8=_1;_1=_1.node}
if(!isc.isA.Array(_2)||_2.length==0){if(_3.status==isc.RPCResponse.STATUS_OFFLINE){this.setLoadState(_1,isc.Tree.UNLOADED);this.delayCall("closeFolder",[_1],0)}else{this.setLoadState(_1,isc.Tree.LOADED)}
if(!isc.isA.Array(_2)){if(_3.status<0){isc.RPCManager.$a0(_3,_5)}else if(_2==null){this.logWarn("passed null children; return empty List instead")}else{this.logWarn("Unexpected new node format.  Array of new nodes expected, instead found: "+this.echoLeaf(_2))}
_2=[]}
}
if(this.isMultiLinkTree()&&this.linkDataFetchMode=="single"){this.$202v(_2)}
this.$192s=_3.operationType;if(this.isPaged()){var _9=_2.length;var _10=_3.startRow!=null?_3.startRow:_5.startRow;var _11=_3.endRow!=null?_3.endRow:_10+_9;var _12=_3.totalRows==null&&_11<_5.endRow?_11:_3.totalRows;var _13=_1[this.childrenProperty];if(isc.isA.ResultSet(_13)){}else if(_11<_12&&_9>0){_1[this.childCountProperty]=_12;var _14=this.getParent(_1),_15=_14!=null&&this.$111x(_1,_14);_13=this.$1202(_1,_1[this.childrenProperty],false,true);_13.fillCacheData(_2,_10)}else{if(_13!=null){var _16=_13.getRange(_10,_11);for(var i=_16.length;i--;){this.$786(_16[i])}
}
this.$27k(_2,_1,_10)}
}else if(this.isMultiDSTree()){for(var i=0;i<_2.length;i++){var _18=_2[i];var _19=this.getChildDataSource(_18,_4.childDS);if(_19!=null)this.convertToFolder(_18);this.$27e(_18,_1)}
}else{if(_3.status==isc.RPCResponse.STATUS_OFFLINE){this.setLoadState(_1,isc.Tree.UNLOADED);this.delayCall("closeFolder",[_1],0)}else{var _20=_6;this.$1369(_2,_4.idField,_4.parentIdField,_4.rootValue,_4.isFolderProperty,_8||_1,_20,null,!_7)}
}
delete this.$192s}
,isc.A.loadLinkDataReply=function isc_ResultTree_loadLinkDataReply(_1,_2,_3){var _4=_1.internalClientContext,_5=_4.fetchCount;if(this.invalidatedFetchCount!=null&&_5<=this.invalidatedFetchCount){return}
if(!this.linkData)this.linkData=[];if(!_2||_2.length==0){this.logDebug("Multi-link tree: fetch on the linkDataSource returned a null or empty response (this may be perfectly valid, since we may have just tried to fetch the children of a node whose folderness was unknown - we have now discovered that it is actually a leaf)")}else{this.linkData.addAll(_2)}}
,isc.A.$202v=function isc_ResultTree__extractLinkData(_1){if(!this.linkData)this.linkData=[];var _2=this.linkIdField!=null?this.linkIdField:this.idField,_3=this.linkParentIdField!=null?this.linkParentIdField:this.parentIdField,_4=this.linkPositionField;for(var i=0;i<_1.length;i++){var _6={};_6[_2]=_1[i][_2];_6[_3]=_1[i][_3];_6[_4]=_1[i][_4];if(_6[_2]==null){this.logWarn("Multi-link tree with linkDataFetchMode:single must embed link information in the data records.  This means that both '"+_2+"' and '"+_3+"' must be provided in every data record, but this record does not meet that requirement: "+isc.echo(_1[i]));continue}
var _7=isc.DataSource.get(this.linkDataSource);if(_7){var _8=_7.getFieldNames();var _9;for(var j=0;j<_8.length;j++){if(_8[j]!=_2&&_8[j]!=_3&&_8[j]!=_4&&_1[i][_8[j]]!==_9)
{_6[_8[j]]=_1[i][_8[j]]}
}
}
this.linkData.add(_6)}}
,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}
if(!this.isMultiLinkTree()){var _7=_5,_8;while((_8=this.getParent(_7))!=null){_7=_8}
if(_7!==this.getRoot()){return}
}else{if(_4.parentNode){_4.parentNode=this.$201l(_4.parentNode)
if(!_4.parentNodeLocator){_4.parentNodeLocator=this.createNodeLocator(_4.parentNode,null,null,_4.parentPath)}
}
var _7=_4.parentNodeLocator,_8;while((_8=this.getParent(_7))!=null){var _9=this.$201f(_7.path);_7=this.createNodeLocator(_8,null,null,_9)}
if(_7.node!==this.getRoot()){return}
}
var _10=(this.isLocal()&&this.haveCriteria(this.$869||this.getCombinedCriteria()));var _11=_4.relationship,_12=_1.data;if(_1.status<0)_12=null;if(_1.status==isc.RPCResponse.STATUS_OFFLINE){_12=[];if(_5!=null&&!this.isRoot(_5)){isc.say(window[_3.componentId].offlineNodeMessage)}
}
var _13=this.$264s();try{var _14=this;var _15=_4.parentNodeLocator;if(_10){if(!this.completeTree)this.completeTree=this.duplicate(true,true,true);_14=this.completeTree;var _9=this.getPath(_5);_5=_14.find(_9);if(_14.isMultiLinkTree()){_15=_14.createNodeLocator(_5,null,null,_9)}
}
_14.$172v(_15||_5,_12,_1,_11,_3,_10,_3.$202u);if(_10){if(this.$87a==null)this.$87a=this.$87b();this.filterLocalData()}
if(this.$87a){var _16=this.$87a;if(this.isMultiLinkTree()&&!this.loadDataOnDemand){for(var i=0;i<_16.length;i++){_16[i].node=this.$201l(_16[i].node);this.setLoadState(_16[i].node,isc.Tree.LOADED)
}
}
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)}
}finally{if(_13)this.$264t()}}
,isc.A.setChildren=function isc_ResultTree_setChildren(_1,_2,_3){this.removeChildren(_1);if(_3==null){_3=isc.isAn.Array(_2)?_2.length:0}
this.$172v(_1,_2,{startRow:0,totalRows:_3},this.$1218(_1))}
,isc.A.getDataSource=function isc_ResultTree_getDataSource(){return isc.DataSource.getDataSource(this.dataSource)}
,isc.A.getLinkDataSource=function isc_ResultTree_getLinkDataSource(){if(!this.isMultiLinkTree())return null;return this.linkDataSource?isc.DataSource.getDataSource(this.linkDataSource):null}
,isc.A.invalidateCache=function isc_ResultTree_invalidateCache(){if(!this.isLoaded(this.root))return;if(this.completeTree)delete this.completeTree;this.invalidatedFetchCount=this.currentFetch;if(!this.loadDataOnDemand){this.$87a=this.$87b(true)}else{this.$87a={}}
this.$27d=0;if(this.isMultiLinkTree()){this.data=[]}
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,true);var _4={};if(this.isMultiLinkTree()){_4.nodeLocator=_1.nodeLocator;_4.position=_1.position}
this.handleUpdate(_1.operationType,_3,_2.invalidateCache,_4)}
,isc.A.handleUpdate=function isc_ResultTree_handleUpdate(_1,_2,_3,_4){if(isc.$cv)arguments.$cw=this;var _5=(this.dropCacheOnUpdate||_3||(this.isPaged()&&this.keepParentsOnFilter));if(_5){this.invalidateCache();if(!this.getDataSource().canQueueRequests)this.dataChanged();return}
this.updateCache(_1,_2,_4);this.dataChanged(_1)}
,isc.A.updateCache=function isc_ResultTree_updateCache(_1,_2,_3){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,_3);break;case"add":this.addCacheData(_2,_3);break;case"replace":case"update":this.updateCacheData(_2,_3);break}}
,isc.A.$186a=function isc_ResultTree__sortUpdateDataAncestorsLast(_1){var _2={},_3=this.idField
;for(var i=0;i<_1.length;i++){var _5=_1[i];if(!_5)continue;var _6=_5[_3];if(_6!=null)_2[_6]=i}
var _7=this.parentIdField;for(var i=_1.length-1;i>=0;i--){var _5=_1[i],_8=_5[_7],_9=_2[_8];if(_9!=null&&_9<i){_1[i]=_1[_9];_1[_9]=_5;_2[_5[_3]]=_9;_2[_8]=i++}
}}
,isc.A.$186b=function isc_ResultTree__addValidParentsAndSort(_1,_2){this.$186a(_1);var _3={},_4=this.idField
;for(var i=0;i<_2.length;i++){var _6=_2[i];if(!_6)continue;var _7=_6[_4];if(_7!=null)_3[_7]=_6}
var _8={},_9=this.parentIdField
;for(var i=0;i<_1.length;i++){var _10=_1[i];_7=_10[_4];if(_7!=null)_8[_7]=_10}
for(var i=0;i<_1.length;i++){var _10=_1[i],_11=_10[_9];if(_11!=null&&!_8[_11]&&_3[_11]){_1.add((_8[_11]=_3[_11]))}
}}
,isc.A.addCacheData=function isc_ResultTree_addCacheData(_1){if(!isc.isAn.Array(_1))_1=[_1];var _2,_3=(this.$87d||this.getCombinedCriteria()),_4=this.haveCriteria(_3),_5=this.getDataSource().getPrimaryKeyFieldNames()[0],_6=this.idField||_5,_7=(this.idField!=_2&&this.parentIdField!=_2)
;if(this.completeTree)for(var i=0;i<_1.length;i++){var _9=_1[i];if(_7&&_9!=null&&_9[this.idField]==_9[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 "+(_9[this.idField]==null?"null":_9[this.idField].toString())+").  Skipping this node.");continue}
this.$651(this.completeTree,_9,_6)}
var _10=this.getDataSource().applyFilter(_1,_3,this.context);if(this.keepParentsOnFilter&&_4){this.$186b(_10,_1)}
this.logInfo("Adding rows to cache: "+_10.length+" of "+_1.length+" rows match filter criteria");for(var i=_10.length-1;i>=0;i--){var _9=_10[i];if(_7&&_9!=null&&_9[this.idField]==_9[this.parentIdField])
{if(!this.completeTree)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 "+(_9[this.idField]==null?"null":_9[this.idField].toString())+").  Skipping this node.");continue}
this.$651(this,_9,_6)}}
,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,_2){if(!isc.isAn.Array(_1))_1=[_1];var _3={addedRows:0,updatedRows:0,removedRows:0};var _4=(this.$87d||this.getCombinedCriteria()),_5=this.haveCriteria(_4);var _6,_7,_8=(this.idField!=_6&&this.parentIdField!=_6),_9=this.getDataSource();if(this.keepParentsOnFilter&&_5){_7=[];this.$186a(_1)}
for(var i=_1.length-1;i>=0;i--){var _11=_1[i],_12=_5?_9.$1859([_11],_4,this.context):true
;if(this.logIsDebugEnabled()&&!_12){this.logDebug("updated node :\n"+this.echo(_11)+"\ndidn't match filter: "+this.echo(_4))}
if(_11==null){continue}
if(!this.isMultiLinkTree()&&_8&&_11[this.idField]==_11[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 "+(_11[this.idField]==null?"null":_11[this.idField].toString())+" (this would reparent the node to itself).  Skipping this node.");continue}
if(this.completeTree){this.$87e(this.completeTree,_11,true,null,null,_2)}
this.$87e(this,_11,_12,_4,_7,_2
,_3
)}
if(_7){for(var i=0;i<_7.length;i++){var _13=_7[i];if(!_13)continue;var _14=_13[this.childrenProperty];if(_14==null||_14.isEmpty()){var _15=this.getParent(_13);if(_15&&!_9.$1859([_15],_4,this.context)){_7.add(_15)}
this.$786(_13);_3.removedRows++}
}
}
if(this.logIsDebugEnabled()){this.logDebug("updated cache: "
+_3.addedRows+" row(s) added, "
+_3.updatedRows+" row(s) updated, "
+_3.removedRows+" row(s) removed.")}}
,isc.A.$87e=function isc_ResultTree__updateNodeInCache(_1,_2,_3,_4,_5,_6,_7){var _8=this.getDataSource(),_9=_8.getPrimaryKeyFieldNames()[0],_10=this.idField||_9,_11=_1.find(_10,_2[_10])
;if(_11==null){if(_3||_5){if(this.$651(_1,_2,_10)){if(!_3)_5.add(_1.find(_10,_2[_10]));this.logInfo("updated row returned by server doesn't match any cached row,  adding as new row.  idField value: "+this.echo(_2[_10])+", complete row: "+this.echo(_2));if(_7)_7.addedRows++}
}
return}
var _12=this.isPaged(),_13=_12&&this.getChildren(this.getParent(_11));if(_3||_5){if(!this.isMultiLinkTree()&&_2[this.parentIdField]!=_11[this.parentIdField]){var _14=_1.find(this.idField,_2[this.parentIdField]);if(_14==null&&(this.defaultNewNodesToRoot||this.rootValue==null))
{_14=_1.getRoot()}
if(_14==null||(_1.getLoadState(_14)!=isc.Tree.LOADED)){if(!(_12&&isc.isA.ResultSet(_13))){_1.$786(_11);if(_7)_7.removedRows++}
return}else{var _15=_12&&this.getChildren(_14),_16=!(_12&&isc.isA.ResultSet(_15)),_17=!(_12&&isc.isA.ResultSet(_13))
;if(_17&&_5){var _18=_1.find(this.idField,_11[this.parentIdField]);if(!_8.$1859([_18],_4,this.context)){_5.add(_18)}
}
if(_16&&_17){_1.$1083(_11,_14)}else if(_16){_1.$27e(_11,_14)}else if(_17){_1.$786(_11)}
}
}
isc.addProperties(_11,_2);var _19=_8.getFieldNames();for(var i=0;i<_19.length;i++){var _21=_19[i];if(!_2.hasOwnProperty(_21))delete _11[_21]}
if(!_3)_5.add(_11);if(_7)_7.updatedRows++}else if(!(_12&&isc.isA.ResultSet(_13))){_1.$786(_11);if(_7)_7.removedRows++}}
);isc.evalBoundary;isc.B.push(isc.A.removeCacheData=function isc_ResultTree_removeCacheData(_1){if(!isc.isAn.Array(_1))_1=[_1];var _2=this.getDataSource().getPrimaryKeyFieldNames()[0],_3=this.idField||_2,_4=(this.$87d||this.getCombinedCriteria()),_5=this.haveCriteria(_4)
;if(this.completeTree){this.$87f(this.completeTree,_1,_3)}
this.$87f(this,_1,_3,this.keepParentsOnFilter&&_5?_4:null)}
,isc.A.$87f=function isc_ResultTree__removeNodesFromCache(_1,_2,_3,_4){var _5=this.isPaged(),_6=[];for(var i=0;i<_2.length;i++){var _8=_1.find(_3,_2[i][_3]);if(_8==null){this.logWarn("Cache synch: couldn't find deleted node:"+this.echo(_2[i]))}else if(!(_5&&isc.isA.ResultSet(this.getChildren(this.getParent(_8))))){_6.add(_8)}
}
if(_4){var _9=_1.getDataSource();for(var i=0;i<_6.length;i++){var _8=_6[i],_10=_1.getParent(_8);_1.$786(_8);if(_10){var _11=_10[_1.childrenProperty];if((_11==null||_11.isEmpty())&&!_9.$1859([_10],_4,_1.context))
{_6.add(_10)}
}
}
}else{_1.$137c(_6)}}
,isc.A.linkDataSourceDataChanged=function isc_ResultTree_linkDataSourceDataChanged(_1,_2){if(this.disableCacheSync)return;if(_1.disableCacheSync)return;var _3=isc.DataSource.getUpdatedData(_1,_2,this.updateCacheFromRequest,true);var _4={};if(this.isMultiLinkTree()){if(_1.clientContext&&_1.clientContext.sourceTree){_4.sourceTree=_1.clientContext.sourceTree}
if(_1.clientContext&&_1.clientContext.nodeLocator){_4.nodeLocator=_1.clientContext.nodeLocator}
if(_1.clientContext&&_1.clientContext.newParent){_4.newParent=_1.clientContext.newParent}
if(_1.clientContext&&_1.clientContext.hasOwnProperty("position")){_4.position=_1.clientContext.position}
if(_1.clientContext&&_1.clientContext.hasOwnProperty("isDragMove")){_4.isDragMove=_1.clientContext.isDragMove}
if(_1.clientContext&&_1.clientContext.newParentNodeLocator){_4.newParentNodeLocator=_1.clientContext.newParentNodeLocator}
if(_1.clientContext&&_1.clientContext.hasOwnProperty("sourceRootValue")){_4.sourceRootValue=_1.clientContext.sourceRootValue}
}
this.handleUpdateLinks(_1.operationType,_3,_2.invalidateCache,_4)}
,isc.A.handleUpdateLinks=function isc_ResultTree_handleUpdateLinks(_1,_2,_3,_4){if(isc.$cv)arguments.$cw=this;this.updateLinksInCache(_1,_2,_4);this.linkDataChanged(_1)}
,isc.A.updateLinksInCache=function isc_ResultTree_updateLinksInCache(_1,_2,_3){if(_2==null)return;var _4=this.completeTree||this;if(_4.linkData==null)return;_1=isc.DS.$372(_1);if(!isc.isAn.Array(_2))_2=[_2];if(this.logIsInfoEnabled()){this.logInfo("Updating links in cache: operationType '"+_1+"', "+_2.length+" rows update data"+(this.logIsDebugEnabled()?":\n"+this.echoAll(_2):""))}
switch(_1){case"remove":var _5=true;if(_3.isDragMove){if(_3.sourceTree==this){_5=false}else{if(!this.$201r(_3.nodeLocator)){_5=false}else if(this.$201l(_3.newParentNodeLocator)){_5=false}
}
}
if(_5){this.removeLinksFromCacheData(_2,_3)}else{for(var i=0;i<_2.length;i++){var _7=this.linkData.findByKeys(_2[i],this.linkDataSource);if(_7>=0){var _8=this.linkData.splice(_7,1)[0]}
}
}
break;case"add":this.addLinksToCacheData(_2,_3);break;case"replace":case"update":for(var i=0;i<_2.length;i++){var _9=_2[i];var _7=this.linkData.findByKeys(_2[i],this.linkDataSource);var _10=this.linkData[_7];if(!_10){this.logWarn("Detected 'update' operation in linkDataSource cache sync, but the link ID "+_2[this.linkIdField]+" does not exist in the current link data.  Ignoring.")}else if(_10[this.idField]!=_9[this.idField]||_10[this.parentIdField]!=_9[this.parentIdField])
{this.logWarn("Detected 'update' operation in linkDataSource cache sync that changes either the child ID or the parent ID.  These kind of updates are not supported - instead, it should be a remove followed by an add")}else if(this.allowDuplicateChildren&&_10[this.linkPositionField]!=_9[this.linkPositionField])
{this.logWarn("Detected 'update' operation in linkDataSource cache sync that changes the child's position within its parent.  These kind of updates are not supported where allowDuplicateChildren is true - instead, it should be a remove followed by an add")}else{this.updateLinksInCacheData([_9],_3)}
}
break}}
,isc.A.removeLinksFromCacheData=function isc_ResultTree_removeLinksFromCacheData(_1,_2){if(!isc.isAn.Array(_1))_1=[_1];var _3=(this.$87d||this.getCombinedCriteria()),_4=this.haveCriteria(_3);if(this.completeTree){this.$202w(this.completeTree,_1,null,_2)}
this.$202w(this,_1,this.keepParentsOnFilter&&_4?_3:null,_2)}
,isc.A.$202w=function isc_ResultTree__removeLinksFromCache(_1,_2,_3,_4){if(_2.length==0)return;var _5=this.isPaged(),_6=[];if(_4.nodeLocator){this.$102q(_2.length==1)}
for(var i=0;i<_2.length;i++){var _8=_1.linkData.findByKeys(_2[i],_1.linkDataSource);if(_8<0){continue}
var _9=_1.linkData.splice(_8,1)[0];var _10;if(_4.nodeLocator){_10=isc.addProperties({},_4.nodeLocator)}else{var _11=_1.$201n(_9[_1.idField]);for(var _12 in _11.paths){break}
_10=_1.createNodeLocator(_11.node,null,null,_12
)
}
_10.node=_1.$201l(_10.node[_1.idField]);if(_4.hasOwnProperty("sourceRootValue")){if(!_1.$202x(_10,_4.sourceRootValue)){continue}
}
if(!_1.$201r(_10)){_1.logWarn("Cache sync: couldn't find deleted link:"+this.echo(_2[i]))}else if(!(_5&&isc.isA.ResultSet(_1.getChildren(_1.$201l(_9[_1.parentIdField]))))){_6.add(_10)}
}
var _3;if(_3){var _13=_1.getLinkDataSource();for(var i=0;i<_6.length;i++){var _9=_6[i],_14=_1.$201l(_9.parentId);_1.$786(_9);if(_14){var _15=_14[_1.childrenProperty];if((_15==null||_15.isEmpty())&&!_13.$1859([_14],_3,_1.context))
{_6.add(_14)}
}
}
}else{_1.$137c(_6)}}
,isc.A.addLinksToCacheData=function isc_ResultTree_addLinksToCacheData(_1,_2){if(!isc.isAn.Array(_1))_1=[_1];var _3=(this.$87d||this.getCombinedCriteria()),_4=this.haveCriteria(_3);var _5=this.getDataSource().getPrimaryKeyFieldNames()[0],_6=this.idField||_5;if(this.completeTree){this.$202y(this.completeTree,_1,_6,null,_2)}
this.$202y(this,_1,_6,this.keepParentsOnFilter&&_4?_3:null,_2)}
,isc.A.$202y=function isc_ResultTree__addLinksToCache(_1,_2,_3,_4,_5){this.$102q(!_5.isDragMove||_2.length==1);var _6=_1.isPaged(),_7=[];if(_5.isDragMove&&_5.sourceTree==this){_7.add(_2[0])}else if(_5.isDragMove&&_5.nodeLocator.parentId==_5.newParentNodeLocator.node[this.idField])
{_7.add(_2[0])}else{for(var i=0;i<_2.length;i++){var _9=_2[i];var _10=_1.createNodeLocator(_9[_1.idField],_9[_1.parentIdField],_9[_1.linkPositionField],"");if(_10!=null&&_1.$201r(_10)){this.logWarn("Cache sync: trying to add duplicate link:"+this.echo(_2[i]))}else if(!(_6&&isc.isA.ResultSet(_1.getChildren(_1.$201l(_9[_1.parentIdField]))))){_7.add(_9)}
}
}
if(_7.length==0)return;if(_5.isDragMove){this.$102q(_7.length==1&&_5.nodeLocator&&_5.newParentNodeLocator);var _9=_7[0];_1.$202l=_9;var _11=isc.addProperties({},_5.newParentNodeLocator);if(_11.node[_1.idField]==_1.rootValue){_11.node=_1.getRoot()}else{_11.node=_1.$201l(_11.node[_1.idField])}
if(_11.node==null){return}
if(!this.$202x(_11,_5.sourceRootValue)){return}
var _10=isc.addProperties({},_5.nodeLocator);_10.node=_1.$201l(_10.node[_1.idField]);if(_10.node!=null){this.$102q(this.$202x(_10,_5.sourceRootValue));_1.linkData.add(_9);_1.moveList([_10],_11,_5.position);delete _1.$202l;return}else{}
}
var _11;if(!_5.newParentNodeLocator){var _12=this.$201n(_7[0][this.parentIdField]);if(_12==null){return}
for(var _13 in _12.paths){break}
_11=this.createNodeLocator(_12.node,null,null,_13
)
}else{if(!this.$202x(_5.newParentNodeLocator,_5.sourceRootValue)){return}
_11=_5.newParentNodeLocator}
_1.linkData.addAll(_7);var _14=[],_15=[];for(var i=0;i<_7.length;i++){var _16=_1.$201l(_7[i][_1.idField]);if(_16==null){_15.add(_7[i])}else{_14.add(_16)}
}
if(_14.length>0){if(_11.node[_1.idField]==_1.rootValue){_14.add(_1.getRoot())}else{_14.add(_1.$201l(_11.node[_1.idField]))}
_1.$201j(_14,_1.idField,_1.parentIdField,_1.linkPositionField,_1.rootValue,_1.isFolderProperty,_11,false,_7,true)}
if(_15.length>0){var _17=isc.RPCManager.startQueue();for(var i=0;i<_15.length;i++){this.$202z(_1,_15[i],_11)}
if(!_17)isc.RPCManager.sendQueue()}}
,isc.A.updateLinksInCacheData=function isc_ResultTree_updateLinksInCacheData(_1,_2){if(!isc.isAn.Array(_1))_1=[_1];var _3=(this.$87d||this.getCombinedCriteria()),_4=this.haveCriteria(_3);if(this.completeTree){this.$2034(this.completeTree,_1,null,_2)}
this.$2034(this,_1,this.keepParentsOnFilter&&_4?_3:null,_2)}
,isc.A.$2034=function isc_ResultTree__updateLinksInCache(_1,_2,_3,_4){for(var i=0;i<_2.length;i++){var _6=_1.linkData.findByKeys(_2[i],_1.linkDataSource);var _7=_1.linkData[_6];_1.linkData[_6]=_2[i];var _8=_1.$201q(_7[_1.idField],_7[_1.parentIdField]);if(_8&&_8.position==_7[_1.linkPositionField]){_8.position=_2[i][_1.linkPositionField]}
for(var j=0;j<_1.recordNumberToNodeLocatorIndex.length;j++){var _10=_1.recordNumberToNodeLocatorIndex[j];if(_10.node[_1.idField]==_7[_1.idField]&&_10.parentId==_7[_1.parentIdField])
{_10.position=_2[i][_1.linkPositionField]}
}
var _11=_1.createNodeLocator(_7[_1.idField],_7[_1.parentIdField],_7[_1.linkPositionField]);_1.$2010(_11);_11.position=_2[i][_1.linkPositionField];_1.$202m(_11,_2[i])}}
,isc.A.openAll=function isc_ResultTree_openAll(_1){var _2=this.$264s();try{this.invokeSuper(isc.ResultTree,"openAll",_1)}finally{if(_2)this.$264t()}}
,isc.A.openFolders=function isc_ResultTree_openFolders(_1){var _2=this.$264s();try{this.invokeSuper(isc.ResultTree,"openFolders",_1)}finally{if(_2)this.$264t()}}
,isc.A.$264s=function isc_ResultTree__startBatchedFolderObservation(){if(this.componentId&&!this.$264n){this.$264n=true;return true}}
,isc.A.$264t=function isc_ResultTree__stopBatchedFolderObservation(){delete this.$264n;var _1=isc.Canvas.getById(this.componentId);if(_1.$264r){_1.$264r()}}
,isc.A.$202z=function isc_ResultTree__fetchMissingNode(_1,_2,_3){var _4=isc.DataSource.get(this.dataSource),_5=_4&&_4.getPrimaryKeyFields(),_6=_5&&isc.firstKey(_5)!=null&&isc.applyMask(_2,_5);this.$102q(_6!=null);_4.fetchData(_6,function(_8,_9,_10){if(_9&&_9.length>0){var _7=[_9[0]];if(_3.node[_1.idField]==_1.rootValue){_7.add(_1.getRoot())}else{_7.add(_1.$201l(_3.node[_1.idField]))}
_1.$201j(_7,_1.idField,_1.parentIdField,_1.linkPositionField,_1.rootValue,_1.isFolderProperty,_3,false,[_2],true)}else{}
})}
,isc.A.$202x=function isc_ResultTree__adjustPathForRootDifferences(_1,_2){if(this.rootValue==_2)return true;var _3=_1.path;if(this.rootValue){_3=this.$2020(_3,this.rootValue)}else{_3=this.$2021(_1.node[this.idField],_3,_2)}
if(_3==null){return false}
_1.path=_3;return true}
,isc.A.$2020=function isc_ResultTree__trimPathToNewRoot(_1,_2){var _3=_1.split(this.pathDelim);var _4=_3.indexOf(_2);if(_4==-1){return null}
var _5=this.pathDelim;var _6=0;var _7=this.allowDuplicateChildren?2:1;for(var i=_4+_7;i<_3.length;i++){if(_6++>0)_5+=this.pathDelim;_5+=_3[i]}
return _5}
,isc.A.$2021=function isc_ResultTree__findMatchingPath(_1,_2,_3){if(_3){if(this.allowDuplicateChildren&&_3.indexOf(this.pathDelim)==-1){_3=_3+this.pathDelim+"not-important"}
_2=_3+(_2==this.pathDelim?"":_2)}
var _4=this.$201n(_1);if(_4&&_4.paths){for(var _5 in _4.paths){if(this.parentChildPositionMatch(_5,_2)){return _5}
}
}
return null}
,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)}
if(!_3&&this.isLoading(this.root)&&this.parallelFetchesRequireRootLoaded!==false)
{var _7=this.currentFetch,_8=this.invalidatedFetchCount
;if(_8==null?_7!=null:_7>_8){if(this.logIsInfoEnabled()){this.logInfo("getRange("+_1+", "+_2+"): parallel fetches are not allowed before the ResultTree root is loaded - not fetching")}
_3=true}
}
var _9=isc.ResultTree.getLoadingMarker(),_10=this.$111w,_11=this.getRoot(),_12={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 _13=this.$124u();var _14;if(this.isMultiLinkTree()){_14=this.createNodeLocator(_11,null,null,"/")}
this.$122b(_11,_14||_11,[_11],0,_1,_2,true,_13,false,_12)}
return _12.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;if(this.isANodeLocator(_2)){_18=_2;_2=_2.node}
var _19=(this.openDisplayNodeType==isc.Tree.FOLDERS_AND_LEAVES?1:0);var _20=this.$1215,_21=this.$111w,_22=isc.ResultTree.getLoadingMarker(),_23=(_2[this.canReturnOpenSubfoldersProperty]!=null?_2[this.canReturnOpenSubfoldersProperty]:this.canReturnOpenFolders),_24=isc.isA.ResultSet(_3),j=_4;var _26=(_3==null?0:(_24?_3.$121l():_3.getLength()));for(var z=0;z<(_11?2:1);++z){var _28=(z==0),_29=(_28==_12),_30=(_28==_13),_31=false,_32=0,p=0;for(;j<_6&&p<_26;++p){var _34=_3.getCachedRow(p);var _35;if(this.isMultiLinkTree()){_35=this.getNodeLocator(j)}
var _36=_34!=null&&(!this.isOpen(_35||_34)||_34[_20]||this.hideLoadingNodes&&this.isLoading(_34));if(_34==null){var _37=(_23||_15||_19==0);if(_28&&(_37||_11||j>=_5)){if(_37){if(!_15){for(var r=Math.max(_5,j);r<_6;++r){_14[r-_5]=_22}
_15=_10.rangeLoading=true;if(_17){return}
}
}else{_9=_11;if(j>=_5){_14[j-_5]=_22}
}
if(!(_17||_31)){_31=true;_32=p;if(!_16){_10.wasAlreadyQueuing=isc.RPCManager.startQueue();_16=_10.needQueue=true}
}
}
j+=(_11&&_28?0:_19)}else{if(_31){_31=false;var _39=_3.progressiveLoading;_3.progressiveLoading=false;_3.getRange(_32,p);_3.progressiveLoading=_39}
if(this.isFolder(_34)?!_30:!_29){var _40,_41;if(_34==_1){_40=_34[_21];_41=true}else{_40=this.$111x(_34,_18||_2);_41=this.$121c(_34,_18||_2)}
var _42=_40-(_41?1:0);if(j>=_5&&_41&&!_15){_14[j-_5]=(_9?_22:_34)}
var k=j+(_41?1:0),l=j+_40;if(k<_6&&(!_36||(l>=_5&&_42>0))){var _45=this.getChildren(_34,null,null,null,null,null,null,null,false);this.$122b(_1,_35||_34,_45,k,_5,_6,false,(p==_26-1&&_8),_9,_10);_15=_10.rangeLoading;_16=_10.needQueue;if(_17&&_15){return}
}
j=l}
}
}
if(_31){_31=false;var _39=_3.progressiveLoading;_3.progressiveLoading=_8;_3.getRange(_32,p);_3.progressiveLoading=_39}
}
if(_26==0||(_24&&!_3.lengthIsKnown())){if(!_15){for(var r=Math.max(_5,j);r<_6;++r){_14[r-_5]=_22}
_15=_10.rangeLoading=true;if(_17){return}
}
if(!_16){_10.wasAlreadyQueuing=isc.RPCManager.startQueue();_16=_10.needQueue=true}
var _39;if(_24){_39=_3.progressiveLoading;_3.progressiveLoading=_8}
if(_11||(_19==0)){if(_24){_3.$121m()}else{this.$121b(_18||_2,0,this.resultSize,null)}
}else if(_24){_3.getRange(0,_6-j)}else{this.$121b(_18||_2,0,_6-j,null)}
if(_24){_3.progressiveLoading=_39}
}
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,_4){if(isc.isA.ResultSet(_2)){_1[this.childrenProperty]=_2;return _2}else if(this.$132d===true){return _2}
var _5=_1[this.childCountProperty],_6=(isc.isAn.Array(_2)?_2.length:0),_7=(_5!=null&&isc.isA.Number(_5)&&Math.floor(_5)==_5&&_5>=0),_8
;if(_4===_8){_4=_2!=null&&!_2.isEmpty()}
if(this.isOpen(_1)&&(_4?_7&&_5==0:(_7?_5>0:_2==null||!_2.isEmpty())))
{this.logMessage(this.$1704?isc.Log.INFO:isc.Log.WARN,"Node "+_1[this.nameProperty]+" is marked as open but has "+(_4?"":"no ")+"children and "+(_5==null?"no":_5+" as the")+" child count; see the RPC Tab of the Developer Console for further details","nodeFormat");this.$1704=true;if(_2==null&&_5!=0&&!_4){this.$121b(_1,0,1)}
}
if(!_7)return _2;if(_5==0){this.setLoadState(_1,isc.Tree.LOADED);return[]}
if(_5<_6){this.logMessage(this.$1705?isc.Log.INFO:isc.Log.WARN,"The child count of node "+_1[this.nameProperty]+" was set to "+_5+".  The number of children was "+_6+", but the number of children can't exceed the child count; clamping the set of children to the child count.","nodeFormat");this.$1705=true;_2=_1[this.childrenProperty]=_2.slice(0,_5)}
if(this.isLeaf(_1)&&(_5>0||_4)){this.logMessage(this.$1706?isc.Log.INFO:isc.Log.WARN,"Node "+_1[this.nameProperty]+" is marked as a leaf but has "+(_4?"children specified":"a child count of "+_5),"nodeFormat");this.$1706=true}
if(!this.isLeaf(_1)&&_4){this.$122c=this.$122c||[];var _9=this.$27i,_10=this.$73p,_11=false;if(isc.isAn.Array(_10)&&_9!=null){for(var i=_10.length;i--;){var _13=_10[i];if(_13!=null&&_13.normalizer===_9){if(!_11){_10=_10.duplicate();_11=true}
_10[i]=isc.addProperties({},_13,{normalizer:null})}
}
}
var _14=this.getDataSource(),_15;if(this.keepParentsOnFilter){_15=(_2?_2.duplicate():[])}else{_15=_14.applyFilter(_2,this.getCombinedCriteria(),this.context)}
var _16=Math.max(_15.length,_1[this.childCountProperty]+(_15.length-_6));var _17=this.context&&isc.addProperties({},this.context);if(_17){delete _17.clientContext;delete _17.internalClientContext}
if(this.keepParentsOnFilter){_17=_17||{};_17.keepParentsOnFilter=true}
var _18={init:function(){var _19=this.$121z;this.$97q[_19.childrenProperty]=this;if(!_19.$122c.contains(this)){_19.$122c.add(this)}
if(_19.dataArrived!=null){_19.observe(this,"dataArrived","observer.dataArrived(observed.$97q)")}
var _1=this.$97q,_20=_19.$1218(_1,false);this.$134h=_19.$1219(_1,_20,false);var _21=this.Super("init",arguments);var _22=this.$97q,_23=_22!=_19.root&&_19.getParent(_22),_24=(_22[_19.canReturnOpenSubfoldersProperty]!=null?_22[_19.canReturnOpenSubfoldersProperty]:_19.canReturnOpenFolders),_25=(_19.openDisplayNodeType==isc.Tree.FOLDERS_AND_LEAVES?1:0),_26=!(_24||_25==0);if(_26){var _27=(_23&&_19.$111x(_22,_23));_22[_19.$111w]=_19.$1112(_22);if(_23){var _28=(_19.$111x(_22,_23)-_27);_19.$111z(_23,_28)}
}
if(this.$122d){this.addProperties(_19.$121y)}
delete this.$122d;return _21},$121z:this,$97q:_1,$122d:_3,dataSource:_14,criteria:this.criteria,context:_17,fetchDelay:this.fetchDelay,disableCacheSync:this.disableCacheSync,updateCacheFromRequest:this.updateCacheFromRequest,sortSpecifiers:_10,initialData:_15,initialLength:_16,setCriteria:function(_29){var _19=this.$121z;_29=arguments[0]=_19.$122e(_29,this.$134h);return this.Super("setCriteria",arguments)}
};if(this.keepParentsOnFilter){_18.dropCacheOnUpdate=true}
if(!_3){isc.addProperties(_18,this.$121y)}
_2=_1[this.childrenProperty]=isc.ResultSet.create(_18);this.setLoadState(_1,isc.Tree.LOADED_PARTIAL_CHILDREN);this.$1203(_1,false,null,false)}
return _2}
,isc.A.$1924=function isc_ResultTree__pendingResultSetActionOnPause(_1){var _2=this.getClass().$cn[_1];if(!_2)return false;for(var _1 in _2){var _3=window[_1];if(isc.isA.ResultSet(_3)&&_3.$121z==this){return true}
}
return false}
,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=((isc.DS&&(isc.DS.isAdvancedCriteria(_1)||isc.DS.isAdvancedCriteria(_2)))||(_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;i<j;++i){var _8=_5.getCachedRow(i);if(_8!=null){_4+=this.$111x(_8,_3)}
}
if(this.$121c(_1,_3)){++_4}
}else if(_1!=_2){var _9;return _9}
}
return _4}
,isc.A.$1203=function isc_ResultTree__setVisibleDescendantsCached(_1,_2,_3,_4){var _5;var _6=this.$1215,_7=_1[_6];if(_2==null){var _8=this.getLoadState(_1);_2=(_8===isc.Tree.LOADED||_8===isc.Tree.LOADED_PARTIAL_CHILDREN);var _9=this.getChildren(_1,_5,_5,_5,_5,_5,true),_10=isc.isA.ResultSet(_9);if(_2&&(_10||isc.isAn.Array(_9))){_2=_2&&((!_10||(_9.allMatchingRowsCached()&&_9.lengthIsKnown())));for(var i=0,_12=_9.getLength();_2&&i<_12;++i){var _13=_9.getCachedRow(i);_2=(_13!=null&&(!this.isOpen(_13)||_13[_6]||false))}
}
}
_1[_6]=_2;_3=_3||this.getParent(_1);if((_4||!_7)&&_2){if(_3!=null&&this.isOpen(_1)){var _8=this.getLoadState(_3),_9=this.getChildren(_3),_10=isc.isA.ResultSet(_9),_14=((_8===isc.Tree.LOADED||_8===isc.Tree.LOADED_PARTIAL_CHILDREN)&&(!_10||(_9.allMatchingRowsCached()&&_9.lengthIsKnown())));if(_14&&(_10||isc.isAn.Array(_9))){var _15=_9.indexOf(_1);for(var i=_9.getLength();_14&&i-->0;){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.evalBoundary;isc.B.push(isc.A.$137a=function isc_ResultTree___add(_1,_2,_3,_4,_5){if(this.isPaged()&&!this.keepParentsOnFilter){var _6=this.getDataSource().applyFilter([_1],this.getCombinedCriteria(),this.context);if(_6.length==0){return}
}
return this.invokeSuper(isc.ResultTree,"$137a",_1,_2,_3,_4,_5)}
,isc.A.$1205=function isc_ResultTree__preAdd(_1,_2,_3,_4,_5){var _6=this.invokeSuper(isc.ResultTree,"$1205",_1,_2,_3,_4,_5);if(this.isPaged()){var _7=this.getLoadState(_1),_8=(_7===isc.Tree.LOADED||_7===isc.Tree.LOADED_PARTIAL_CHILDREN);this.$1203(_1,_8,_2,true)}
return _6}
,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,_3){if(this.isPaged()){this.$1217(_1,false)}
return this.invokeSuper(isc.ResultTree,"unloadChildren",_1,_2,_3)}
,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,path){if(this.isPaged()){var parent=this.getParent(node),state=this.isOpen(node),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,path)}}
,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,_5,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)}
}
this.$736(true);this.dataChanged()}}
,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);this.$736(true);this.dataChanged()}}
,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,_5,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)}
}
this.$736(true);this.dataChanged()}}
,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,_2){var _3=this.criteria||{},_4=this.$87d||_3,_5=this.$868||{},_6=this.getDataSource(),_7
;if(_2)_7=this.$780(_1,true);this.$51w=this.context&&this.context.textMatchStyle||null;if(!_6.isAdvancedCriteria(_1)){_1=isc.clone(_1)}
if(_6.isAdvancedCriteria(_1)&&!_6.isAdvancedCriteria(_3)){_3=isc.DataSource.convertCriteria(_3)}
if(!_6.isAdvancedCriteria(_1)&&_6.isAdvancedCriteria(_3)){_1=isc.DataSource.convertCriteria(_1)}
var _8=this.$255b||_3;var _9=this.$255a(_1);this.criteria=_1;this.$255b=_9;if(this.isLocal()&&this.serverFilterFields!=null&&this.serverFilterFields.length>0)
{this.$87d=isc.DataSource.copyCriteria(_9);this.$868=_6.splitCriteria(this.$87d,this.serverFilterFields,true)}else{delete this.$87d;delete this.$868}
var _10=this.compareCriteria(_9,_8);if(_10!=0){if(!this.isLocal()){this.logInfo("setCriteria: filter criteria changed, invalidating cache");this.invalidateCache();if(this.isPaged()&&this.$122c!=null){var _11=this.$122c.duplicate();var _12=this.getCombinedCriteria();for(var i=_11.length;i--;){var _14=_11[i];if(this.$122c.contains(_14)){var _15=_14.$97q,_16=this.$1218(_15,false),_17=this.$1219(_15,_16,false);_14.setCriteria(isc.DataSource.combineCriteria(_17,_12))}
}
}
}else{if(this.haveCriteria(this.$868)?(this.compareCriteria(this.$868,_5)!=0):this.haveCriteria(_5))
{this.logInfo("setCriteria: server filter criteria changed, invalidating cache");this.invalidateCache()}else{var _18=this.$87b();var _19=true;var _20=this.$87d||this.getCombinedCriteria();if(this.haveCriteria(_20)&&this.completeTree==null){if(this.haveCriteria(_4)){this.logWarn("setCriteria: unable to filter current data locally - invalidating cache");_19=false}else{this.completeTree=this.duplicate(true,true,true)}
}
if(_19){this.filterLocalData();if(this.isMultiLinkTree()){for(var i=0;i<_18.length;i++){_18[i].node=this.$201l(_18[i].node)}
}
this.$87c(_18);if(this.dataArrived!=null){this.dataArrived(this.getRoot())}
}else{this.invalidateCache()}
}
}
}
return _7}
,isc.A.filterLocalData=function isc_ResultTree_filterLocalData(_1){if(!_1)_1=this.getRoot();var _2=this.$87d||this.getCombinedCriteria(),_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{if(!_3)return;this.logInfo("Local filter applied: "+_3.getNodeList().length
+" records matched filter: none");delete this.completeTree}
var _6=_3.getAllNodes();this.data=_3.getCleanNodeData(_6,false,false,true);this.setRoot(this.getCleanNodeData(this.getRoot(),false,false,true));this.setLoadState(this.getRoot(),isc.Tree.LOADED);if(this.completeTree!=null)_3.destroy();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=this.$780(_1)==true;return _2}
,isc.A.$780=function isc_ResultTree__willFetchData(_1,_2){var _3;var _4=this.criteria||{},_5=this.$868||{},_6=this.getDataSource()
;if(!_6.isAdvancedCriteria(_1)){_1=isc.DataSource.copyCriteria(_1)}
if(_6.isAdvancedCriteria(_1)&&!_6.isAdvancedCriteria(_4)){_4=isc.DataSource.convertCriteria(_4)}
if(!_6.isAdvancedCriteria(_1)&&_6.isAdvancedCriteria(_4)){_1=isc.DataSource.convertCriteria(_1)}
var _7=_6.defaultTextMatchStyle,_8=this.$51w||_7,_9=(this.context&&this.context.textMatchStyle)||_8
;if(this.lastImplicitCriteria){_4=isc.DS.compressNestedCriteria(_6.combineCriteria(_4,this.lastImplicitCriteria,null,_8)
)}
var _10=this.getImplicitCriteria();if(_10){_1=isc.DS.compressNestedCriteria(_6.combineCriteria(_1,_10,null,_9)
)}
var _11=0;if(_2&&!isc.isAn.emptyObject(_4)){_11=_6.compareTextMatchStyle(_9,_8)}
var _12=(this.dbcImplicitCriteria||this.lastImplicitCriteria)
if(_11==0||_12)_11=this.compareCriteria(_1,_4);var _3;var _13=_3;if(_11==0)_13=null;if(_13===_3&&!this.isLocal())_13=true;if(_13==_3){var _14={};if(this.isLocal()&&this.serverFilterFields!=null&&this.serverFilterFields.length>0)
{var _15=isc.DataSource.copyCriteria(_1);_14=_6.splitCriteria(_15,this.serverFilterFields)}
_13=this.haveCriteria(_14)?(this.compareCriteria(_14,_5)!=0):this.haveCriteria(_5)}
return _13}
,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;if(this.isMultiLinkTree()){this.$203p(_1)}
this.$87c(_1)}
,isc.A.$203p=function isc_ResultTree__assignLocalNodesToNodeLocators(_1){for(var i=0;i<_1.length;i++){_1[i].node=this.$201l(_1[i].node)}}
,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.isMultiLinkTree()){this.$102q(_2==_1.root);var _5=_1.createNodeLocator(_2,null,null,this.pathDelim);return this.$203q(_1,_5,_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 _6=_1.getFolders(_2),_7=false;if(_6!=null){for(var i=0;i<_6.length;i++){_7=this.$45q(_1,_6[i],_3,_4)
||_7}
}
_3[_3.length]=_1.getPath(_2);return true}
,isc.A.$203q=function isc_ResultTree__addNodeToMultiLinkOpenState(_1,_2,_3,_4,_5){var _6=_2.node;if(!_1.isOpen(_2)||!_1.isLoaded(_6))return false;if(_4){_1.getName(_6);if(this.autoPreserveOpenState=="never"||(this.autoPreserveOpenState=="whenUnique"&&_6._autoAssignedName))
{return false}
}
var _7=_1.getFolders(_6),_8=false;if(_7!=null){for(var i=0;i<_7.length;i++){var _10=this.createNodeLocator(_7[i],_6[this.idField],i,this.$201v(_2.path,_7[i])
);_8=this.$203q(_1,_10,_3,_4)
||_8}
}
_3[_3.length]=_2;return true}
);isc.B._maxIndex=isc.C+110;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;if(_2=="fetch"&&this.dataArity=="single"&&_1.startRow==null&&_1.endRow==null){_1.startRow=0;_1.endRow=1}
_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(this.implicitCriteria){_1.dbcImplicitCriteria=this.getImplicitCriteria(true)}
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,_5,_6){if(_4==null)_4="fetch";if(!_6)this.$117s(_3,_2);if(_3==null)_3={};var _7=isc.addProperties({initialData:_5||this.initialData},this.dataProperties,_3.dataProperties
,this.treeProperties,_3.treeProperties
);delete _7.ID;_7.criteria=_1;var _8=this.getImplicitCriteria(true);if(_8)_7.dbcImplicitCriteria=_8;if(_3.operation!=null){_7.operation=_3.operation}
_7.context=_3;_7.dataSource=this.dataSource;_7.componentId=this.ID;_7.$31k=true;if(_6)_7.$1925=false;if(isc.TreeGrid&&isc.isA.TreeGrid(this)){if(_7.hideLoadingNodes==null)_7.hideLoadingNodes=true}
if(this.loadDataOnDemand!=null)_7.loadDataOnDemand=this.loadDataOnDemand;if(this.keepParentsOnFilter!=null)_7.keepParentsOnFilter=this.keepParentsOnFilter;if(this.dataFetchMode!=null)_7.fetchMode=this.dataFetchMode;if(this.dataFetchDelay!=null)_7.fetchDelay=this.dataFetchDelay;if(this.serverFilterFields!=null)_7.serverFilterFields=this.serverFilterFields;if(this.treeRootValue!=null)_7.rootValue=this.treeRootValue;if(this.treeDataRelations)_7.treeRelations=this.treeDataRelations;if(this.multiDSTree!=null)_7.multiDSTree=this.multiDSTree;if(this.progressiveLoading===true||this.progressiveLoading===false){isc.addProperties(_7,{progressiveLoading:this.progressiveLoading})}
var _9=this.getSort();if(_9)_7.$39x=isc.DS.getSortBy(_9);var _10=this.getDataSource();var _11=!_10?'ResultTree':_10.resultTreeClass||"ResultTree";return isc.ClassFactory.getClass(_11,true).create(_7)}
,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");if(this.$2220){this.setCanEdit(true);delete this.$2220}
this.$39m(_1)},editRecord:function(_1){var _2=(_1==null?"add":"update");this.setSaveOperationType(_2);if(this.$2220){this.setCanEdit(true);delete this.$2220}
this.$39m(_1)},$39m:function(_1){delete this.$50l;delete this.$39l;this.$2532=isc.EH.$253y;;var _1=isc.addProperties({},_1);this.$180b=true;this.setData(_1);if(this.getFileItemForm!=null){var _2=this.getFileItemForm();if(_2){_2.editNewRecord();_2.clearErrors(true)}
}
delete this.$180b},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");if(this.$2220){this.setCanEdit(true);delete this.$2220}
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,useSimpleHttp:true
};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){if(this.selectionComponent.discardEdits){this.selectionComponent.discardEdits(_4)}
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++){if(!_5[i].shouldSaveValue)continue;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.suppressOldValues){_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)}
var _12=this;this.$40c=_1;_1=function(_16,_17,_18){_12.$49z(_18,_16,_17)};_2=this.buildRequest(_2,_9,_1);var _13=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;_13=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 _14=this.rulesEngine.processSubmit(this);if(_14==false)return}
var _15=this.getDataSource().$708(this.getValues());if((isc.DynamicForm&&isc.isA.DynamicForm(this)&&this.isMultipart())
||this.canSubmit||_13)
{return this.submitEditorValues(_15,_2.operation,_2.callback,_2)}else{return this.saveEditorValues(_15,_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){if(this.valuesManager&&this.dataPath==null){_2=this.valuesManager.getSaveOperationType()}else{var _3=isc.DataSource.getDataSource(this.dataSource).getPrimaryKeyFieldNames(),_4=this.getValues(),_5;var _6=false,_7=false;for(var i=0;i<_3.length;i++){var _9=_3[i],_10=_4[_3];if(_10==null){_2="add";break}
if(this.$10s[_9]!==_5){if(this.$10s[_9]!=_10){_2="add";break}else _6=true}
var _11=this.getItem(_9);if(_11&&_11.isVisible()&&(_11.shouldSaveValue&&_11.getCanEdit())){_7=true}
}
if(_7&&!_6){_2="add"}
if(_2==null){_2="update"}
}
}
}
return _2},$49z:function(_1,_2,_3){var _4=this.suppressServerDataSync;var _5=_1.clientContext;if(_5&&_5.saveDataTarget!=null
&&_5.saveDataTarget!=this)
{var _6=_5.saveDataTarget;if(this.$40c){_6.$40c=this.$40c;delete this.$40c}
_6.$49z(_1,_2,_3);return}
this.$490=0;if(!_4&&_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 _7=(_1.originalData||_1.data),_8=this.getValues();var _9=false,_10=true,_11;for(var _12 in _3){var _13=_7[_12]===_11?this.$10s[_12]:_7[_12];var _14=this.getField(_12);if(this.fieldValuesAreEqual(_14,_8[_12],_13)){if(!this.fieldValuesAreEqual(_14,_13,_3[_12])){_8[_12]=_3[_12];_9=true}
}else{_10=false}
}
if(_9){this.$10r(_8)}
for(var i=0;i<this.items.length;i++){var _16=this.items[i];if(isc.isAn.UploadItem(_16))continue;var _17=_16.dataPath||_16.name;if(_17==null)continue;var _18=isc.DynamicForm.$70o(_17,_16,_7,this,true,"edit");if(_18===_11||this.fieldValuesAreEqual(_16,_18,_16.getValue()))
{if(_9){var _19=isc.DynamicForm.$70o(_17,_16,_3,this,true,"edit");if(!this.fieldValuesAreEqual(_16,_18,_19)){_16.setValue(_19)}
}
}else{_10=false}
}
if(_10){this.rememberValues()}
if(this.saveOperationType=="add")delete this.saveOperationType}
this.$491={request:_1,response:_2,serverData:_3
};this.formSavedComplete();var _20=this.getItem("_transaction");if(_20&&isc.isA.HiddenItem(_20)){_20.clearValue()}
},formSavedComplete:function(){var _1=this.getFields();for(var i=this.$490;i<_1.length;i++){this.$490++;var _3=_1[i];if(isc.isA.Function(_3.formSaved)&&_3.formSaved(this.$491.request,this.$491.response,this.$491.serverData)===false)return}
var _4=this.$40c,_5=(this.$491&&this.$491.request.clientContext)||{},_6=(this.$491?[this.$491.response,this.$491.serverData,this.$491.request]:null)
;delete this.$491;delete this.$40c;var _7=(_5.saveDataTarget!=null?_5.saveDataTarget:this);_7.$2862();if(_4){_7.fireCallback(_4,"dsResponse,data,dsRequest",_6)}
},$2862:function(_1,_2,_3,_4,_5){if(this.ruleScope||this.isRuleScope){var _1=this.getDataSource(),_5=this.hasStableLocalID()||(this.editNode!=null),_2=this.getValues()
;if(_1&&isc.isA.DataSource(_1)&&this.$176k!=false){this.provideRuleContext(_1.getID(),isc.shallowClone(_2),this,null,_5)}
if(_5){this.provideRuleContext(this.getLocalId()+".values",isc.shallowClone(_2),this,null,false)}
}
},saveEditorValues:function(_1,_2,_3,_4){if(!_4)_4={};isc.addProperties(_4,{prompt:(_4.prompt||isc.RPCManager.saveDataPrompt),editor:this
});_4.internalClientContext={$69t:_4.willHandleError
};_4.willHandleError=true;if(_4.valuesAsParams){if(!_4.params)_4.params={};isc.addProperties(_4.params,_1)}
var _5=this.getDataSource();return _5.performDSOperation(_2.type,_1,_3?_3:{target:this,methodName:"saveEditorReply"},_4)},submitEditorValues:function(_1,_2,_3,_4){if(!_4)_4={};isc.addProperties(_4,{directSubmit:true,submitForm:this
});return this.saveEditorValues(_1,_2,_3,_4)},saveEditorReply:function(_1,_2,_3){if(_3.internalClientContext){_3.willHandleError=_3.internalClientContext.$69t}
if(_1.status==isc.RPCResponse.STATUS_VALIDATION_ERROR&&_1.errors){var _4=this;var _5=_3.clientContext;if(_5&&_5.saveDataTarget!=null){_4=_5.saveDataTarget}
_4.setErrors(_1.errors,true);return this.suppressValidationErrorCallback?false:_3.willHandleError==true}
if(_1.status<0&&!_3.willHandleError)
return isc.RPCManager.$a0(_1,_3);return true},$40d:function(_1,_2,_3){if(_2.status==isc.RPCResponse.STATUS_SUCCESS){this.performingServerValidation=false;this.markForRedraw("serverValidationSuccess");this.saveData(_1.$40c,_1.$40b,true);_1.$40c=null;_1.$40b=null}else{this.setErrors(_2.errors,true)}
}});if(isc.DynamicForm){isc.ClassFactory.mixInInterface("DynamicForm","EditorActionMethods");isc.A=isc.DynamicForm.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.selectionComponentSelectionChanged=function isc_DynamicForm_selectionComponentSelectionChanged(_1,_2,_3){if(!_3){_2=_1.getSelectedRecord();if(_2==null)_2={}}
this.$71d=_1.getPrimaryKeys(_2);this.clearErrors(true);if(this.valuesManager&&this.valuesManager.synchronizeMember){this.valuesManager.synchronizeMember(this)}else{this.editRecord(isc.addProperties({},_2))}
}
,isc.A.selectionComponentCellSelectionChanged=function isc_DynamicForm_selectionComponentCellSelectionChanged(_1,_2){for(var i=0;i<_2.length;i++){var _4=_2[i],_5=this.selectionComponent.getCellRecord(_4[0],_4[1]);if(_1.cellIsSelected(_5))break;_5=null}
if(_5){this.$71d=_1.getPrimaryKeys(_5);if(this.valuesManager&&this.valuesManager.synchronizeMember){this.valuesManager.synchronizeMember(this)}else{this.editRecord(isc.addProperties({},_5))}
}
}
);isc.B._maxIndex=isc.C+2}
isc.$457={fetchData:function(_1,_2,_3){var _4=this.getDataSource();if(!_4){this.logWarn("Ignoring call to fetchData() on a DynamicForm with no valid dataSource");return}
if(this.$458==null)this.$458=[];this.$458.add(_2);_3=this.buildRequest(_3,"fetch");_4.fetchData(_1,{target:this,methodName:"fetchDataReply"},_3)},fetchDataReply:function(_1,_2,_3){if(_2==null||isc.isAn.emptyObject(_2)||(isc.isAn.Array(_2)&&_2.getLength()==0))
{if(_1.status==isc.RPCResponse.STATUS_OFFLINE){isc.say(this.offlineMessage)}
}
var _4;if(isc.isAn.Array(_2)){_4=_2.get(0)}else{_4=_2}
if(_1.status==isc.RPCResponse.STATUS_SUCCESS||_1.status==isc.RPCResponse.STATUS_VALIDATION_ERROR)
{this.editRecord(_4)}
var _5=this.$458.pop();if(_5)this.fireCallback(_5,"dsResponse,data,dsRequest",[_1,_2,_3])},filterData:function(_1,_2,_3){var _4=this.getDataSource();if(!_4){this.logWarn("Ignoring call to filterData() on a DynamicForm with no valid dataSource");return}
if(this.$458==null)this.$458=[];this.$458.add(_2);_4.filterData(_1,{target:this,methodName:"fetchDataReply"},_3)}}
if(isc.DynamicForm)isc.DynamicForm.addMethods(isc.$457)
if(isc.ValuesManager)isc.ClassFactory.mixInInterface("ValuesManager","EditorActionMethods");if(isc.ValuesManager)isc.ValuesManager.addMethods(isc.$457)
if(isc.ValuesManager){isc.A=isc.ValuesManager.getPrototype();isc.A.fieldValuesAreEqual=isc.Canvas.getPrototype().fieldValuesAreEqual
}
if(isc.ListGrid){isc.A=isc.ListGrid.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.filterWithCriteria=function isc_ListGrid_filterWithCriteria(_1,_2,_3){var _4=this.Super("filterWithCriteria",arguments);if(this.data&&isc.isA.ResultSet(this.data)){this.$178p();if(!this.data.lengthIsKnown()){this.data.$178q=true;this.$178r()}
}
return _4}
);isc.B._maxIndex=isc.C+1}
if(isc.TreeGrid){isc.A=isc.TreeGrid.getPrototype();isc.A.ignoreEmptyCriteria=true;isc.A=isc.TreeGrid.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.alwaysCreateNewResultTree=false;isc.B.push(isc.A.useExistingDataModel=function isc_TreeGrid_useExistingDataModel(_1,_2,_3){if(this.alwaysCreateNewResultTree)return false;return this.Super("useExistingDataModel",arguments)}
,isc.A.createDataModel=function isc_TreeGrid_createDataModel(_1,_2,_3){return this.createResultTree(_1,_3.afterFlowCallback,_3,null)}
,isc.A.filterWithCriteria=function isc_TreeGrid_filterWithCriteria(_1,_2,_3){var _4=false;if(this.useExistingDataModel(_1,_2,_3)&&isc.ResultTree&&isc.isA.ResultTree(this.data))
{this.$117s(_3);delete this.data.$84a}
var _5=this.Super("filterWithCriteria",arguments);if(this.data&&isc.isA.ResultTree(this.data)){if(this.data.isLoading(this.data.getRoot())){this.$178r()}
}
return _5}
);isc.B._maxIndex=isc.C+3}
if(isc.DetailViewer){isc.A=isc.DetailViewer.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.viewSelected=function isc_DetailViewer_viewSelected(_1,_2){return this.viewSelectedData(_1,_2)
}
);isc.B._maxIndex=isc.C+1}
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.A.$200m=["f","F",">","v","[x]","[+]","[-]","[ ]","-","_"];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="<br/>";i++}
}else if(c=='['&&_1.indexOf("]",i+1)>0){c="<a href='#'>";_4=true}else if(c==']'){if(_4){c="</a>";_4=false}
}else if(c=='*'){if(_3){_3=false;c="</b>"}else{_3=true;c="<b>"}
}else if(c=='_'){if(_2){_2=false;c="</i>"}else{_2=true;c="<i>"}
}
_5.push(c)}
return _5.join("")}
,isc.A.convertTitleToName=function isc_c_MockDataSource_convertTitleToName(_1,_2,_3){if(_1.contains("|"))return _1.substring(0,_1.indexOf("|"));var _4=true,_5=_1.trim().replace(/(\\r|\r)/g,"_").replace(/[^a-zA-Z0-9_# ]/g,"_");_5=_5.replace(/#+/g," Number ");_5=_5.trim();if(_5==""||(_5.charAt(0)>='0'&&_5.charAt(0)<='9')){_5='_'+_5}
var _6=_5.split(" ");if(_6.length>1){_5="";if("underscores"==_2){for(var i=0;i<_6.length;i++){_5+=_6[i].toLowerCase();if(i!=(_6.length-1)){_5+="_"}
}
}else if("underscoresAllCaps"==_2){for(var i=0;i<_6.length;i++){_5+=_6[i].toUpperCase();if(i!=(_6.length-1)){_5+="_"}
}
}else if("underscoresKeepCase"==_2){for(var i=0;i<_6.length;i++){_5+=_6[i];if(i!=(_6.length-1)){_5+="_"}
}
}else{_5=_6[0].toLowerCase();for(var i=1;i<_6.length;i++){_5+=_6[i].substring(0,1).toUpperCase();_5+=_6[i].substring(1).toLowerCase()}
}
}
while(_4){if(_5.endsWith("_")){_5=_5.substring(0,_5.length-1)}else{_4=false}
}
if(_5==""){_5="isc_gen"}
if(_5!=_1&&_3.contains(_5)){while(_3.contains(_5)){_5+="_"}
}
return _5}
,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.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.isFieldParametersLine=function isc_c_MockDataSource_isFieldParametersLine(_1){return(_1.startsWith("[")&&_1.endsWith("]")&&_1!="[]"&&_1!="[ ]"&&_1!="[x]")}
,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.detectMockDataType=function isc_c_MockDataSource_detectMockDataType(_1){var _2=_1.split("\n"),_3=isc.MockDataSource.$200m
;for(var i=0;i<_2.length;i++){var _5=_2[i].replace(/^\s+/gm,""),_6=false
;if(_5.length==0)continue;for(var j=0;j<_3.length;j++){var _8=_3[j];if(_5.startsWith(_8+" ")){_6=true;break}
}
if(!_6)return"grid"}
return"tree"}
,isc.A.detectFieldTypes=function isc_c_MockDataSource_detectFieldTypes(_1,_2,_3,_4){if(_2&&_2.length>0&&isc.SchemaGuesser&&_3.detectFieldTypes){var _5=isc.SchemaGuesser.create(_3.guesserProperties);_5.fields=_1;_1=_5.extractFieldsFrom(_2);_2=_5.convertData(_2)}
if(_1.length>0&&!_1.find("primaryKey",true)){if(_3.mockDataPrimaryKey){var _6=_1.find("name",_3.mockDataPrimaryKey);if(_6){_6.primaryKey=true}else{this.logWarn("Unable to set "+_3.ID+" primaryKey to '"+_3.mockDataPrimaryKey+"': Field not found. An automatic primaryKey field 'internalId' has been added.")}
}
if(!_1.find("primaryKey",true)){_1.addAt({name:"internalId",type:"sequence",primaryKey:true,hidden:true},0);if(_2){for(var i=0;i<_2.length;i++){_2[i].internalId=i+1}
}
}
}
if(_4)_4.cacheData=_2;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.mockDataFormat="mock";isc.A.fieldNamingConvention="camelCaps";isc.A.detectFieldTypes=true;isc.A.clientOnly=true;isc.B.push(isc.A.init=function isc_MockDataSource_init(){this.$1998=this.fields;this.initializeDataAndFields();this.$211c=isc.clone(this.fields);return this.Super("init",arguments)}
,isc.A.resetData=function isc_MockDataSource_resetData(){this.initializeDataAndFields()}
,isc.A.initializeDataAndFields=function isc_MockDataSource_initializeDataAndFields(){if(!this.cacheData)this.cacheData=[];if(!this.fields)this.fields=[];delete this.rawHeaderLine;var _1=this.mockData,_2=this.mockDataType
;if(_1&&isc.isA.String(_1)&&this.mockDataFormat!="mock"){var _3=isc.FileParser.create({hasHeaderLine:true});if(this.mockDataFormat=="xml"){var _4=isc.xml.parseXML(_1);if(!_4){this.logWarn("XML data in mockData could not be parsed");return}
var _5=isc.xml.selectNodes(_4,"/"),_6=isc.xml.toJS(_5)
;if(_6.length==1){var _7=isc.JSONEncoder.create({dateFormat:"dateConstructor",prettyPrint:false});var _8=_7.encode(_6[0]);_1=_3.parseJsonData(_8," loading pre-processed XML data for MockDataSource "+this.ID)}
}else if(this.mockDataFormat=="csv"){_1=_3.parseCsvData(_1,this)}else if(this.mockDataFormat=="json"){_1=_3.parseJsonData(_1," loading data for MockDataSource "+this.ID)}else{this.logWarn("Invalid mockDataFormat '"+this.mockDataFormat+"'");return}
}
if(_1&&isc.isAn.Array(_1)&&_1.length>0){var _9=_1,_10=[]
;var _11=[];_9.forEach(function(_20){var _12=isc.getKeys(_20);for(var i=0;i<_12.length;i++){var _14=_12[i];if(!_11.contains(_14))_11.add(_14)}
});_10.push(_11.join());_9.forEach(function(_20){var _15=[];for(var i=0;i<_11.length;i++){var _14=_11[i],_16=_20[_14]
;if(_16==null){_16=""}else if(isc.isA.String(_16)){_16=_16.replace(/,/g,"\\,").replace(/\n/g,"\\n")}
_15.push(_16)}
_10.push(_15.join())});_1=_10.join('\n');_2="grid"}else if(_1&&isc.isAn.Array(_1)&&_1.length==0){_1=null}
if(_1&&!_2){_2=isc.MockDataSource.detectMockDataType(_1)}
if((_1&&_2=="grid")||(this.rawHeaderLine&&!_1)){var _17=_1?_1.split("\n"):[""];var _18=this.getFieldParameters(_17);this.rawHeaderLine=this.rawHeaderLine||_17[0];var _19=this.parseTableFields(this.rawHeaderLine,_18);this.sortProperties=this.extractSortProperties(_19);var _10=this.getDataRecords(_17,_19,_18,(this.mockDataFormat!="mock"));_19=isc.MockDataSource.detectFieldTypes(_19,_10,this,!this.cacheData||this.cacheData.length==0?this:null);if(!this.fields||this.fields.length==0||isc.isAn.emptyObject(this.fields)){this.fields=_19}
}else if(_2=="tree"){if(!this.fields||this.fields.length==0||isc.isAn.emptyObject(this.fields)){this.fields=[{name:"name",type:"text"
}]}
if(_1&&(!this.cacheData||this.cacheData.length==0)){this.cacheData=isc.MockDataSource.parseTree(_1)}
}
this.$200n=_2}
,isc.A.hasExplicitFields=function isc_MockDataSource_hasExplicitFields(){return(this.$1998!=null&&(!isc.isAn.Array(this.$1998)&&isc.isAn.Object(this.$1998)
?isc.getKeys(this.$1998).length>0
:this.$1998.length>0)
)}
,isc.A.applyGridSettings=function isc_MockDataSource_applyGridSettings(_1){if(!_1)_1={};_1.autoFetchData=true;if(this.$200n=="tree"){_1.dataProperties={openProperty:"isOpen"};return _1}
var _2=this.getHeaderDisplayRowCount();_1.headerHeight=Math.max(25,15*_2);_1.autoFitFieldWidths=true;_1.autoFitWidthApproach="title";if(_1.leaveScrollbarGap==null){_1.leaveScrollbarGap=false}
if(this.sortProperties)isc.addProperties(_1,this.sortProperties);var _3=isc.getValues(this.fields);_1.fields=[];for(var i=0;i<_3.length;i++){var _5=_3[i],_6={name:_5.name,type:_5.type}
;if(_5.title)_6.title=_5.title;if(_5.hidden)_6.hidden=_5.hidden;_1.fields.add(_6)}
if(_1.dataSource&&_1.dataSource.MockDataSource){_1.dataSource.MockDataSource.fieldNamingConvention=this.fieldNamingConvention;_1.dataSource.MockDataSource.fields=_3;_1.dataSource.MockDataSource.cacheData=this.cacheData}
return _1}
,isc.A.getFieldParameters=function isc_MockDataSource_getFieldParameters(_1){var _2=null,_3=_1[_1.length-1]
;if(isc.MockDataSource.isFieldParametersLine(_3)){_2=_3.substring(1,_3.length-1).split(",")}
return _2}
,isc.A.extractSortProperties=function isc_MockDataSource_extractSortProperties(_1){var _2;for(var i=0;i<_1.length;i++){if(_1[i].sortDirection){var _4=_1[i],_5={property:_4.name,direction:_1[i].sortDirection
}
;if(!_2){_2={initialSort:[_5]}}else{_2.initialSort.add(_5)}
delete _1[i].sortDirection}
}
return _2}
,isc.A.getHeaderDisplayRowCount=function isc_MockDataSource_getHeaderDisplayRowCount(){var _1=this.rawHeaderLine.split(","),_2=1
;for(var i=0;i<_1.length;i++){_2=Math.max(_2,_1[i].split("\\r").length)}
return _2}
,isc.A.parseTableFields=function isc_MockDataSource_parseTableFields(_1,_2){var _3=isc.MockDataSource.splitComma(_1),_4=[]
;for(var j=0;j<_3.length;j++){var _6=null,_7=null,_8=false,_9=false
;var _10=_3[j].trim().replace(/(\\r|\r)/g,"<br/>");if(_10.indexOf("|")>=0){var _11=_10.split(/\s*\|\s*/),_12=_11.last(),_6=_11[0];if(_6){_10=_11[1];_9=true}
if(_11[2]=="PK")_8=true;if(_12.match(/FK=([A-Za-z_]+\.)?[A-Za-z_]+/)){_7=_12.substring(3)}
}
var _13=null;if(_10.endsWith(" ^")){_13="ascending";_10=_10.substring(0,_10.length-2).trim()}else if(_10.endsWith(" v")){_13="descending";_10=_10.substring(0,_10.length-2).trim()}
if(!_6){_6=isc.MockDataSource.convertTitleToName(_10,this.fieldNamingConvention,_3)}
var _14=_6;var _15=0;do{var _16=false;for(var i=0;i<_4.length;i++){if(_4[i].name==_14){_15++;_14=_6+_15;_16=true;break}
}
}while(_16);if(_10==""){_10="&nbsp;"}
var _18={name:_14
};if(_14!=_10||_9){_18.title=_10}
if(_13)_18.sortDirection=_13;if(_2&&_2[j]){_18.width=_2[j];var _19=_18.width[_18.width.length-1];if(!isc.MockDataSource.$871(_19)){_18.width=_18.width.substring(0,_2[j].length-1);if(_19=='R'||_19=='r'){_18.align="right"}else if(_19=='L'||_19=='l'){_18.align="left"}else if(_19=='C'||_19=='c'){_18.align="center"}
}
_18.width+="%"}
if(_8)_18.primaryKey=true;if(_7)_18.foreignKey=_7;_4.add(_18)}
return _4}
,isc.A.getDataRecords=function isc_MockDataSource_getDataRecords(_1,_2,_3,_4){var _5=[];var _6=_1.length-(_3?1:0);for(var i=1;i<_6;i++){if(isc.MockDataSource.isFieldParametersLine(_1[i])){continue}
var _8={};var _9=isc.MockDataSource.splitComma(_1[i]);for(var j=0;j<_2.length;j++){var _11=_9[j];if(_11!=null){if(!_4){_11=_11.replace(/\r/g,"<br/>");if(!this.detectFieldTypes||_11!="[]"&&_11!="[ ]"&&_11!="[x]"){_11=_11.replace("[]","<input type='checkbox' />");_11=_11.replace("[ ]","<input type='checkbox' />");_11=_11.replace("[x]","<input type='checkbox' checked='true' />");_11=isc.MockDataSource.parseTextWikiSymbols(_11)}
}
_8[_2[j].name]=_11}
}
_5.add(_8)}
return _5}
);isc.B._maxIndex=isc.C+10;isc.defineClass("SchemaGuesser");isc.A=isc.SchemaGuesser;isc.A.TOO_FEW_EXAMPLES="tooFewExamples";isc.A.TOO_MANY_SPECIAL_VALUES="tooManySpecialValues";isc.A=isc.SchemaGuesser.getPrototype();isc.A.minExampleCount=3;isc.A.minDateYear=1970;isc.A.centuryThreshold=25;isc.A.treatEmptyValueAsBooleanFalse=true;isc.A.valueEquivalences=[{value:"NA",equivalent:"N/A"}
];isc.A.booleanTrueValues=["t","true","yes","[x]","1"];isc.A.booleanFalseValues=["f","false","no","[]","[ ]","0"];isc.A.timeStampYearRange=5;isc.A=isc.SchemaGuesser.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$228j=["","id","sku","number","code","seq"];isc.A.$227m=[{type:"boolean",matches:function(_1,_2,_3){if(_1.boolean.valueCount>_2&&((this.treatEmptyValueAsBooleanFalse?0:_2)+_1.boolean.badValues.length<=1))
{_3.addEmptyDisplayValue=(_2==0||this.treatEmptyValueAsBooleanFalse);return true}
}},{type:"time",matches:function(_1,_2,_3){return(_1.time.valueCount>_2&&_1.time.badValues.length<=3&&_1.float.badValues.length>0)}},{type:"dateTimeYMD",matches:function(_1,_2,_3){return(_1.dateTimeYMD.valueCount>_2&&_1.dateTimeYMD.badValues.length<=3&&_1.dateTimeYMD.valueCount>=_1.dateTimeMDY.valueCount&&_1.dateTimeYMD.valueCount>=_1.dateTimeDMY.valueCount)}},{type:"dateTimeMDY",matches:function(_1,_2,_3){return(_1.dateTimeMDY.valueCount>_2&&_1.dateTimeMDY.badValues.length<=3&&_1.dateTimeMDY.valueCount>=_1.dateTimeDMY.valueCount)}},{type:"dateTimeDMY",matches:function(_1,_2,_3){return(_1.dateTimeDMY.valueCount>_2&&_1.dateTimeDMY.badValues.length<=3)}},{type:"dateTimeSchema",matches:function(_1,_2,_3){return(_1.dateTimeSchema.valueCount>_2&&_1.dateTimeSchema.badValues.length<=3)}},{type:"timeStamp",matches:function(_1,_2,_3){return(_1.dateTimeSchema.valueCount>15&&_1.dateTimeSchema.valueCount>_2&&_1.dateTimeSchema.badValues.length<=3)}},{type:"dateYM",matches:function(_1,_2,_3){return(_1.dateYM.valueCount>_2&&_1.dateYM.badValues.length<=3&&_1.dateYM.valueCount>=_1.dateMY.valueCount&&_1.dateYM.valueCount>=_1.dateYMD.valueCount&&_1.dateYM.valueCount>=_1.dateMDY.valueCount&&_1.dateYM.valueCount>=_1.dateDMY.valueCount)}},{type:"dateMY",matches:function(_1,_2,_3){return(_1.dateMY.valueCount>_2&&_1.dateMY.badValues.length<=3&&_1.dateMY.valueCount>=_1.dateYMD.valueCount&&_1.dateMY.valueCount>=_1.dateMDY.valueCount&&_1.dateMY.valueCount>=_1.dateDMY.valueCount)}},{type:"dateYMD",matches:function(_1,_2,_3){return(_1.dateYMD.valueCount>_2&&_1.dateYMD.badValues.length<=3&&_1.dateYMD.valueCount>=_1.dateMDY.valueCount&&_1.dateYMD.valueCount>=_1.dateDMY.valueCount)}},{type:"dateMDY",matches:function(_1,_2,_3){return(_1.dateMDY.valueCount>_2&&_1.dateMDY.badValues.length<=3&&_1.dateMDY.valueCount>=_1.dateDMY.valueCount)}},{type:"dateDMY",matches:function(_1,_2,_3){return(_1.dateDMY.valueCount>_2&&_1.dateDMY.badValues.length<=3)}},{type:"integer",matches:function(_1,_2,_3){return(_1.integer.valueCount>_2&&_1.integer.badValues.length<=3&&_1.integer.valueCount>=_1.float.valueCount)}},{type:"float",matches:function(_1,_2,_3){return(_1.float.valueCount>_2&&_1.float.badValues.length<=3)}}
];isc.B.push(isc.A.init=function isc_SchemaGuesser_init(){this.Super("init",arguments);this.$1782={"boolean":{fieldType:"boolean",canConvert:this.isBoolean,convert:this.toBoolean},"time":{fieldType:"time",canConvert:this.isTime,convert:this.toTime},"dateTimeYMD":{fieldType:"datetime",canConvert:this.isDateTimeYMD,convert:this.toDateTimeYMD},"dateTimeMDY":{fieldType:"datetime",canConvert:this.isDateTimeMDY,convert:this.toDateTimeMDY},"dateTimeDMY":{fieldType:"datetime",canConvert:this.isDateTimeDMY,convert:this.toDateTimeDMY},"dateTimeSchema":{fieldType:"datetime",canConvert:this.isDateTimeSchema,convert:this.toDateTimeSchema},"timeStamp":{fieldType:"datetime",canConvert:this.isTimeStamp,convert:this.toTimeStamp},"dateYM":{fieldType:"date",canConvert:this.isDateYM,convert:this.toDateYM},"dateMY":{fieldType:"date",canConvert:this.isDateMY,convert:this.toDateMY},"dateYMD":{fieldType:"date",canConvert:this.isDateYMD,convert:this.toDateYMD},"dateMDY":{fieldType:"date",canConvert:this.isDateMDY,convert:this.toDateMDY},"dateDMY":{fieldType:"date",canConvert:this.isDateDMY,convert:this.toDateDMY},"integer":{fieldType:"integer",canConvert:this.isInteger,convert:this.toInteger},"float":{fieldType:"float",canConvert:this.isFloat,convert:this.toFloat}
}}
,isc.A.extractFieldsFrom=function isc_SchemaGuesser_extractFieldsFrom(_1){if(_1&&!isc.isAn.Array(_1))_1=[_1];if(!_1||_1.length==0){this.logWarn("Missing or empty data - Cannot extract field types");return null}
this.resetState();this.recordCount=_1.length;this.classifyValues(_1);this.extractEmptyDisplayValues(_1);this.deriveTypes();if(this.detectPrimaryKey){this.findPrimaryKey(_1)}
if(this.keepFieldOrder){this.restoreOriginalFieldOrder()}
this.derivedFields=this.createFields();return this.derivedFields}
,isc.A.convertData=function isc_SchemaGuesser_convertData(_1){if(!this.$1783){this.logWarn("extractFieldsFrom must be called before parsed data can be fetched");return null}
if(!_1||(_1&&isc.isAn.Array(_1)&&_1.length==0))return _1;return this.convertValues(_1)}
,isc.A.resetState=function isc_SchemaGuesser_resetState(){this.derivedFields=[];this.parsedFields=[];this.parsedData=[];this.parseDetails=[];this.$1783={}}
,isc.A.classifyValues=function isc_SchemaGuesser_classifyValues(_1){for(var i=0;i<_1.length;i++){var _3=_1[i];for(var _4 in _3){var _5=this.$1783[_4];if(!_5){_5=this.$1783[_4]=this.createFieldState(_4)}
var _6=_3[_4];if(isc.isAn.Object(_6)){continue}
if(_6==null||(isc.isA.String(_6)&&!isc.isA.nonemptyString(_6))){_5.emptyValueCount++;continue}
if(!isc.isA.String(_6)){_6=""+_6}
for(var _7 in this.$1782){var _8=this.$1782[_7];if(this.fireCallback(_8.canConvert,"value",[_6])){_5[_7].valueCount++}else{_5[_7].badValueCount++;if(!_5[_7].badValues.contains(_6)){_5[_7].badValues.add(_6)}
}
}
}
}
}
,isc.A.extractEmptyDisplayValues=function isc_SchemaGuesser_extractEmptyDisplayValues(_1){if(this.recordCount<this.minExampleCount){return}
for(var _2 in this.$1783){var _3=this.$1783[_2];for(var _4 in this.$1782){var _5=_3[_4],_6=_5.badValues,_7=null,_8=[]
;if(_4!="boolean"&&_3.emptyValueCount>0){continue}
if(_6.length>0){var _9={lowerValue:null,variants:[]};for(var i=0;i<_6.length;i++){var _11=_6[i],_12=_11.toLowerCase(),_13=this.getValueEquivalences(_11)
;if(_9.lowerValue){var _14=false;for(var j=0;j<_13.length;j++){var _16=_13[j],_17=_16.toLowerCase()
;if(_9.lowerValue&&_9.lowerValue==_17){_14=true;break}
}
if(!_14&&_9.lowerValue!=_12&&!_3.detectedAs){_9=null;break}
}
if(!_9.lowerValue)_9.lowerValue=_12;if(!_9.variants.contains(_11))_9.variants.add(_11)}
if(_9){var _18=-1;for(var j=0;j<_9.variants.length;j++){var _19=_9.variants[j],_20=_1.findAll(_2,_19),_21=(_20?_20.length:0)
;if(_21>_18){_18=_21;_7=_19}
_6.remove(_19);_8.add(_19)}
}
}
if(_7&&_4=="boolean"){var _22=[];_1.map(function(_24){var _19=_24[_2];if(_19==null||_22.length>2)return;if(!isc.isA.String(_19))_19=""+_19;var _23=_19.toLowerCase();if(!_22.contains(_23)&&!_8.contains(_19))_22.add(_23)});if(_22.length==1){_7=null;_5.badValues.addList(_8)}
}
if(_7){_5.emptyDisplayValue=_7;_5.nullValues=_8}
}
}
}
,isc.A.deriveTypes=function isc_SchemaGuesser_deriveTypes(){for(var _1 in this.$1783){var _2=this.$1783[_1];var _3=this.chooseType(_2),_4=null
;if(_3.type){var _5=[_3.typeProcessName];while(!_4){var _6=this.chooseType(_2,_5);if(!_6.typeProcessName||(_2[_6.typeProcessName].badValues.length==0&&(this.recordCount>this.minExampleCount||_2[_6.typeProcessName].emptyDisplayValue==null)))
{_4=_6}
_5.add(_6.typeProcessName)}
}
var _7=_3,_8=null,_9=null
;if(_7.typeProcessName=="boolean"){if(_2[_7.typeProcessName].emptyDisplayValue==null&&_2[_7.typeProcessName].badValues.length>0)
{_7=_4}
}
if(!_2.detectedAs){if(_4&&this.recordCount<this.minExampleCount){_8=_7;_7=_4;_2.reason=isc.SchemaGuesser.TOO_FEW_EXAMPLES;_9={message:"Field '"+_1+"' was detected as "+_7.type+" despite having only "+_8.type+" values because only "+this.recordCount+" records were provided."
};if(_8.type=="boolean"){_9.message+=" To force detection as boolean use 'F' and 'T' values."}
}else if(_4&&_7.typeProcessName&&_2[_7.typeProcessName].badValues.length>0&&_2[_7.typeProcessName].badValues.length<=3)
{_8=_7;_7=_4;_2.reason=isc.SchemaGuesser.TOO_MANY_SPECIAL_VALUES;_9={message:"Field '"+_1+"' was detected as "+_7.type+" despite having many "+_8.type+" values because it had more than one special value. If data is modified so that only one special value is used, field will be detected as type "+_8.type,specialValues:_2[_8.typeProcessName].badValues
}}
}
if(!_2.detectedAs){if(_8||_9){if(!_9)_9={};_9.fieldName=_1;_9.detectedAs=_7.type;_9.couldBe=_8.type;_9.reason=_2.reason;if(_9.detectedAs!=_9.couldBe){this.parseDetails.add(_9)}
}
}
if(_7.addEmptyDisplayValue&&_7.typeProcessName&&_2[_7.typeProcessName])
{var _10=_2[_7.typeProcessName];if(_10.emptyDisplayValue)_2.emptyDisplayValue=_10.emptyDisplayValue;if(_10.nullValues)_2.nullValues=_10.nullValues}
if(!_2.detectedAs){_2.detectedAs=_7.type;if(_8)_2.couldBe=_8.type}
_2.typeProcessName=_7.typeProcessName}
}
,isc.A.findPrimaryKey=function isc_SchemaGuesser_findPrimaryKey(_1){var _2={};for(var _3 in this.$1783){var _4=this.$1783[_3];var _5=_4.detectedAs;if(_5&&_5=="integer"&&_4.emptyValueCount==0){_2[_3]=_4}else{var _6=true,_7=/^[a-zA-Z0-9_\-]*\d+$/,_8
;for(var i=0;i<_1.length;i++){var _10=_1[i],_11=_10[_3]
;if(!_7.test(_11)){_6=false;break}
if(i==0){_8=_11}else{var _12=Math.min(_8,_11.length);for(var j=0;j<_12;j++){if(_8.charAt(j)!=_11.charAt(j)){_8=(j==0?"":_8.substring(0,j));break}
}
if(_8.length==0){_6=false;break}
}
if(_8&&_8.length>0){_4.valuePrefix=_8}
}
if(_6){_2[_3]=_4}
}
}
var _14={};for(var _3 in _2){var _4=_2[_3],_15=_1.getProperty(_3),_16=function(_27,_28,_29){return _29.indexOf(_27)===_28},_17=_15.filter(_16)
;if(_17.length==_15.length){_14[_3]=_4}
}
var _18=isc.getKeys(_14).length;for(var _3 in _14){var _4=_14[_3];var _19=this.$228k(_3,_4,_1);_4.tightness=_19}
if(_18==0||_1.length<3){return}
var _20;var _21=[""];if(this.dataSourceName){var _22=this.dataSourceName.replace(/\d+$/,"");var _23=isc.DS.getAutoTitle(_22).toLowerCase().split(" ");for(var i=0;i<_23.length;i++){var _24=_23.slice(i).join('');_21.add(_24);if(_24.endsWith("s")){_21.add(_24.slice(0,-1))}
}
_23=_23.reverse().slice(1);for(var i=0;i<_23.length;i++){_21.add(_23[i])}
}
var _25=[];for(var i=0;i<this.$228j.length;i++){var _26=this.$228j[i];_25.add(_26);if(_26.length>0){_25.add("_"+_26)}
}
for(var i=0;i<_25.length&&!_20;i++){for(var j=0;j<_21.length&&!_20;j++){var _24=_21[j]+_25[i];if(_24.length==0)continue;for(var _3 in _14){if(!_20&&_24==_3.toLowerCase()){_20=_14[_3]}
}
}
}
if(!_20){for(var _3 in _14){var _4=_14[_3];if(_4.detectedAs=="integer"){if(_1.length>=10){_20=_4;break}else if(_1.length>=3&&_4.detectedAs=="integer"){var _3=_4.name;if(_1[0][_3]=="0"||_1[0][_3]=="1"){var _19=this.$228k(_3,_4,_1);if(_19<2){_20=_4;_20.primaryKey=true;_20.tightness=_19;break}
}
}
}
}
}
if(_20){_20.primaryKey=true}
}
,isc.A.$228k=function isc_SchemaGuesser__getValueTightness(_1,_2,_3){var _4;if(_2.valuePrefix){var _5=_2.valuePrefix.length;_4=_3.map(function(_11){return _11[_1].substring(_5).replace(/[^a-zA-Z0-9]/,"")})}else{_4=_3.getProperty(_1)}
var _6=this.$1782["integer"].convert,_7,_8=0
;for(var i=0;i<_4.length;i++){var _10=_4[i]=this.fireCallback(_6,"value",[_4[i]]);if(_7!=null){if(_10<_7){_8=-1;break}else if(_10!=_7+1){_8++}
}
_7=_10}
return _8}
,isc.A.chooseType=function isc_SchemaGuesser_chooseType(_1,_2){if(!_2)_2=[];var _3=_1.emptyValueCount;var _4={addEmptyDisplayValue:null
};var _5=this.$227m;for(var i=0;i<_5.length;i++){var _7=_5[i];if(!_2.contains(_7.type)&&(!_1.detectedAs||this.$1782[_7.type].fieldType==_1.detectedAs)&&this.fireCallback(_7.matches,"fieldState, emptyValueCount, typeDetail",[_1,_3,_4]))
{_4.typeProcessName=_7.type;break}
}
if(_4.typeProcessName){_4.type=_1[_4.typeProcessName].fieldType;if(_4.addEmptyDisplayValue==null){_4.addEmptyDisplayValue=(_3==0)}
}else if(!_1.detectedAs){_4.type="text";_4.addEmptyDisplayValue=false}
return _4}
,isc.A.restoreOriginalFieldOrder=function isc_SchemaGuesser_restoreOriginalFieldOrder(){var _1={},_2=this.$1783;for(var i=0;i<this.fields.length;i++){var _4=this.fields[i].name;if(_4 in _2){_1[_4]=_2[_4];delete _2[_4]}
}
this.$1783=_1;var _5=[];for(_4 in _2){_5.add(_4)}
if(_5.length){this.logInfo("dropped fields "+_5+" not present in your field definitions")}
}
,isc.A.createFields=function isc_SchemaGuesser_createFields(){var _1=[];for(var _2 in this.$1783){var _3=this.$1783[_2];var _4=_3.detectedAs||"text",_5=isc.addProperties({},_3.fieldTemplate,{name:_2,type:_4
})
;if(_3.primaryKey)_5.primaryKey=_3.primaryKey;if(_3.tightness!=null)_5.tightness=_3.tightness;if(_3.emptyDisplayValue)_5.emptyDisplayValue=_3.emptyDisplayValue;_1.add(_5)}
if(this.fields){for(var i=0;i<this.fields.length;i++){var _5=this.fields[i];if(_5.name){if(!_1.containsProperty("name",_5.name)){_1.add(isc.addProperties({},_5))}
}
}
}
return _1}
,isc.A.convertValues=function isc_SchemaGuesser_convertValues(_1){var _2=this.derivedFields,_3=[],_4={}
;for(var i=0;i<_1.length;i++){var _6=_1[i],_7={}
;for(var _8 in this.$1783){var _9=this.$1783[_8],_10=_9.detectedAs||"text",_11=(_9.detectedAs&&_9.fieldTemplate&&_9.fieldTemplate.type==_9.detectedAs),_12=_6[_8],_13=_12,_14=(_9.typeProcessName&&this.$1782[_9.typeProcessName].convert
?this.$1782[_9.typeProcessName].convert:this.toText)
;if(isc.isAn.Object(_13)){continue}
if(_9.nullValues){for(var j=0;j<_9.nullValues.length;j++){if(_13==_9.nullValues[j]){_13=null;break}
}
}
_7[_8]=(_13!=null||_12==null?this.fireCallback(_14,"value",[_12==null?_12:""+_12]):null);if(_11&&(_13!=null||_12==null)&&_7[_8]==null)
{_4[_8]=(_4[_8]||0)+1}
}
_3.push(_7)}
for(var _16 in _4){var _17=_4[_16];if(_17>10||_17==_1.length){var _18={fieldName:_16,message:"Conversion of values to '"+this.$1783[_16].fieldTemplate.type+"' failed for "+_17+" of "+_1.length+" records."
};this.parseDetails.add(_18)}
}
return _3}
,isc.A.createFieldState=function isc_SchemaGuesser_createFieldState(_1){var _2={name:_1
};if(this.fields){var _3=this.fields.find("name",_1);if(_3){_2.fieldTemplate=_3;if(_3.type){_2.detectedAs=_3.type}
}
}
_2.emptyValueCount=0;for(var _4 in this.$1782){var _5=this.$1782[_4];_2[_4]={fieldType:_5.fieldType,valueCount:0,badValueCount:0,badValues:[]
};if(_2.detectedAs&&!_2.typeProcessName&&_2.detectedAs==_5.fieldType)
{_2.typeProcessName=_4}
}
return _2}
,isc.A.getValueEquivalences=function isc_SchemaGuesser_getValueEquivalences(_1){var _2=[_1];_1=_1.toLowerCase();for(var i=0;i<this.valueEquivalences.length;i++){var _4=this.valueEquivalences[i];if(_1==_4.value.toLowerCase()){_2.add(_4.equivalent)}else if(_1==_4.equivalent.toLowerCase()){_2.add(_4.value)}
}
return _2}
,isc.A.isBoolean=function isc_SchemaGuesser_isBoolean(_1){return this.booleanTrueValues.contains(_1.toLowerCase())||this.booleanFalseValues.contains(_1.toLowerCase())}
,isc.A.isFloat=function isc_SchemaGuesser_isFloat(_1){var _2=this.decimalSymbol||isc.NumberUtil.decimalSymbol;var _3=this.groupingSymbol||isc.NumberUtil.groupingSymbol;if(!this.$1784||this.$1785!=this.decimalSymbol||this.$1786!=this.groupingSymbol)
{this.$1784=new RegExp("^\\s*([+-]?(((\\d+(\\"+_2+")?)|(\\d*\\"+_2+"\\d+)|(\\d+(?:[\\"+_3+"]\\d{3})*\\"+_2+"\\d+))([eE][+-]?\\d+)?))\\s*$");this.$1785=this.decimalSymbol;this.$1786=this.groupingSymbol}
return this.$1784.test(_1)}
,isc.A.isInteger=function isc_SchemaGuesser_isInteger(_1){var _2=this.groupingSymbol||isc.NumberUtil.groupingSymbol;if(!this.$1787||this.$1788!=this.groupingSymbol)
{this.$1787=new RegExp("^\\s*([+-]?((\\d+(?:[\\"+_2+"]\\d{3})*)))\\s*$");this.$1788=this.groupingSymbol}
return this.$1787.test(_1)}
,isc.A.isDateYM=function isc_SchemaGuesser_isDateYM(_1){var _2=new RegExp("^\\s*(\\d{1,4})([\\.-/])(\\d{1,2})\\s*$");var _3=_2.exec(_1);if(_3){var _4=parseInt(_3[1],10),_5=_3[2],_6=parseInt(_3[3],10)
;if(_6>=1&&_6<=12&&(_5!="."||_4>=this.minDateYear)){return true}
}
return false}
,isc.A.isDateMY=function isc_SchemaGuesser_isDateMY(_1){var _2=new RegExp("^\\s*(\\d{1,2})([\\.-/])(\\d{1,4})\\s*$");var _3=_2.exec(_1);if(_3){var _4=parseInt(_3[1],10),_5=_3[2],_6=parseInt(_3[3],10)
;if((_5!="."||_6>=this.minDateYear)&&_4>=1&&_4<=12){return true}
}
return false}
,isc.A.isDateYMD=function isc_SchemaGuesser_isDateYMD(_1){var _2=isc.Date.parseInput(_1,"YMD",this.centuryThreshold,true,false);return(_2!=null)}
,isc.A.isDateMDY=function isc_SchemaGuesser_isDateMDY(_1){var _2=isc.Date.parseInput(_1,"MDY",this.centuryThreshold,true,false);return(_2!=null)}
,isc.A.isDateDMY=function isc_SchemaGuesser_isDateDMY(_1){var _2=isc.Date.parseInput(_1,"DMY",this.centuryThreshold,true,false);return(_2!=null)}
,isc.A.isDateTimeYMD=function isc_SchemaGuesser_isDateTimeYMD(_1){if(!isc.DateUtil.isDatetimeString(_1,"YMD"))return false;var _2=isc.Date.parseInput(_1,"YMD",null,true,false);return(_2!=null)}
,isc.A.isDateTimeMDY=function isc_SchemaGuesser_isDateTimeMDY(_1){if(!isc.DateUtil.isDatetimeString(_1,"MDY"))return false;var _2=isc.Date.parseInput(_1,"MDY",null,true,false);return(_2!=null)}
,isc.A.isDateTimeDMY=function isc_SchemaGuesser_isDateTimeDMY(_1){if(!isc.DateUtil.isDatetimeString(_1,"DMY"))return false;var _2=isc.Date.parseInput(_1,"DMY",null,true,false);return(_2!=null)}
,isc.A.isDateTimeSchema=function isc_SchemaGuesser_isDateTimeSchema(_1){var _2=_1.match(/(\d{4})[\/-](\d{2})[\/-](\d{2})([T ](\d{2}):(\d{2})(:(\d{2}))?)?(\.(\d+))?([+-]\d\d?:\d{2}|Z)?/);if(_2==null||!_2[4])return false;var _3=isc.DateUtil.parseSchemaDate(_1);return(_3!=null)}
,isc.A.isTime=function isc_SchemaGuesser_isTime(_1){var _2=/^\d+$/;if(_2.test(_1))return false;var _3=false;if(!isc.SchemaGuesser.$he){isc.SchemaGuesser.$he=isc.Time.$he.duplicate();isc.SchemaGuesser.$he.addList([/^\s*(\d?\d)\.(\d?\d)\.(\d?\d)?\s*([AaPp][Mm]?)?\s*([+-]\d{2}:\d{2}|Z)?\s*$/,/^\s*(\d?\d)\.(\d?\d)(\s*)([AaPp][Mm]?)?\s*([+-]\d{2}:\d{2}|Z)?\s*$/
])}
for(var i=0;i<isc.SchemaGuesser.$he.length;i++){var _5=isc.SchemaGuesser.$he[i].exec(_1);if(_5)break}
if(_5){_3=true;var _6=_5[1]?parseInt(_5[1],10):null,_7=_5[2]?parseInt(_5[2],10):0,_8=_5[3]?parseInt(_5[3],10):0,_9=_5[4]
;if(_9){if(!this.$hh)this.$hh={p:true,P:true,pm:true,PM:true,Pm:true,pM:true};if(!this.$1789)this.$1789={a:true,A:true,am:true,AM:true,Am:true,aM:true};if(this.$hh[_9]==true){if(_6==null)_6=12;else if(_6<12)_6+=12}else if(this.$1789[_9]==true){if(_6==null)_6=0;else if(_6>12)_6-=12}else{_3=false}
}
if(_3&&_6==null){_3=false}else if(_3){if(_6<0||_6>23||_7<0||_7>59){_3=false}
}
}
return _3}
,isc.A.isTimeStamp=function isc_SchemaGuesser_isTimeStamp(_1){if(!this.$227n){this.$227n=new RegExp("^\\s*(\\d+)\\s*$");var _2=new Date();_2.setFullYear(_2.getFullYear()-isc.SchemaGuesser.timeStampYearRange);this.$227o=_2;var _2=new Date();_2.setFullYear(_2.getFullYear()+isc.SchemaGuesser.timeStampYearRange);this.$227p=_2}
return(this.$227n.test(_1)&&parseInt(_1,10)>=this.$227o&&parseInt(_1,10)<=this.$227p)}
,isc.A.toText=function isc_SchemaGuesser_toText(_1){return _1}
,isc.A.toBoolean=function isc_SchemaGuesser_toBoolean(_1){if(this.treatEmptyValueAsBooleanFalse&&(_1==null||!isc.isA.nonemptyString(_1))){return false}
var _2=this.booleanTrueValues.contains(_1.toLowerCase());if(!_2){if(!this.booleanFalseValues.contains(_1.toLowerCase())){_2=null}
}
return _2}
,isc.A.toFloat=function isc_SchemaGuesser_toFloat(_1){if(Number(_1)===_1)return _1;var _2=isc.NumberUtil.parseLocaleFloat(_1,this.decimalSymbol||isc.NumberUtil.decimalSymbol,this.groupingSymbol||isc.NumberUtil.groupingSymbol);return(isNaN(_2)?null:_2)}
,isc.A.toInteger=function isc_SchemaGuesser_toInteger(_1){if(Number.isInteger(_1))return _1;var _2=isc.NumberUtil.parseLocaleInt(_1,this.groupingSymbol||isc.NumberUtil.groupingSymbol);return(isNaN(_2)?null:_2)}
,isc.A.toDateYM=function isc_SchemaGuesser_toDateYM(_1){var _2=new RegExp("^\\s*(\\d{1,4})([\\.-/])(\\d{1,2})\\s*$");var _3=_2.exec(_1);if(!_3)return null;var _4=parseInt(_3[1],10),_5=_3[2],_6=parseInt(_3[3],10),_7=null
;if(_6>=1&&_6<=12&&(_5!="."||_4>=this.minDateYear)){_7=isc.Date.create(_4,_6-1,1)}
return _7}
,isc.A.toDateMY=function isc_SchemaGuesser_toDateMY(_1){var _2=new RegExp("^\\s*(\\d{1,2})([\\.-/])(\\d{1,4})\\s*$");var _3=_2.exec(_1);if(!_3)return null;var _4=parseInt(_3[1],10),_5=_3[2],_6=parseInt(_3[3],10),_7=null
;if(_4>=1&&_4<=12&&(_5!="."||_6>=this.minDateYear)){_7=isc.Date.create(_6,_4-1,1)}
return _7}
,isc.A.toDateYMD=function isc_SchemaGuesser_toDateYMD(_1){return isc.DateUtil.parseInput(_1,"YMD",this.centuryThreshold,true,false)}
,isc.A.toDateMDY=function isc_SchemaGuesser_toDateMDY(_1){return isc.DateUtil.parseInput(_1,"MDY",this.centuryThreshold,true,false)}
,isc.A.toDateDMY=function isc_SchemaGuesser_toDateDMY(_1){return isc.DateUtil.parseInput(_1,"DMY",this.centuryThreshold,true,false)}
,isc.A.toDateTimeYMD=function isc_SchemaGuesser_toDateTimeYMD(_1){return isc.DateUtil.parseInput(_1,"YMD",this.centuryThreshold,true)}
,isc.A.toDateTimeMDY=function isc_SchemaGuesser_toDateTimeMDY(_1){return isc.DateUtil.parseInput(_1,"MDY",this.centuryThreshold,true)}
,isc.A.toDateTimeDMY=function isc_SchemaGuesser_toDateTimeDMY(_1){return isc.DateUtil.parseInput(_1,"DMY",this.centuryThreshold,true)}
,isc.A.toDateTimeSchema=function isc_SchemaGuesser_toDateTimeSchema(_1){var _2=_1&&_1.match(/(\d{4})[\/-](\d{2})[\/-](\d{2})([T ](\d{2}):(\d{2})(:(\d{2}))?)?(\.(\d+))?([+-]\d\d?:\d{2}|Z)?/);if(!_2)return false;return isc.DateUtil.parseSchemaDate(_1)}
,isc.A.toTime=function isc_SchemaGuesser_toTime(_1){_1=_1&&_1.replace(/\./g,":");return isc.Time.parseInput(_1,true)}
,isc.A.toTimeStamp=function isc_SchemaGuesser_toTimeStamp(_1){var _2=parseInt(_1,10);return new Date(_2)}
,isc.A.revertValues=function isc_SchemaGuesser_revertValues(_1){this.$227y={"boolean":{revert:this.fromBoolean},"time":{revert:this.fromTime},"datetime":{revert:this.fromDateTime},"date":{revert:this.fromDate},"integer":{revert:this.fromInteger},"float":{revert:this.fromFloat}
};var _2=this.derivedFields||this.fields,_3=[]
;if(!_2){this.logWarn("No fields are defined to revert values");return}
for(var i=0;i<_1.length;i++){var _5=_1[i],_6={}
;for(var j=0;j<_2.length;j++){var _8=_2[j],_9=_8.name,_10=_5[_9]
;if(_10==null){if(_8.emptyDisplayValue){_6[_9]=_8.emptyDisplayValue}
continue}
var _11=_8.type,_12=(this.$227y[_11]?this.$227y[_11].revert:null)
;if(_12){_6[_9]=this.fireCallback(_12,"value",[_10])}else{_6[_9]=_10.toString()}
}
_3.push(_6)}
return _3}
,isc.A.fromBoolean=function isc_SchemaGuesser_fromBoolean(_1){return(_1==true?"1":_1==false?"0":null)}
,isc.A.fromInteger=function isc_SchemaGuesser_fromInteger(_1){return""+_1}
,isc.A.fromFloat=function isc_SchemaGuesser_fromFloat(_1){return""+_1}
,isc.A.fromTime=function isc_SchemaGuesser_fromTime(_1){return _1.getHours()+"."+_1.getMinutes()}
,isc.A.fromDate=function isc_SchemaGuesser_fromDate(_1){return isc.DateUtil.format(_1,"YYYY/MM/dd")}
,isc.A.fromDateTime=function isc_SchemaGuesser_fromDateTime(_1){return isc.DateUtil.format(_1,"YYYY-MM-ddTHH:mm:ss.SSSZ")}
);isc.B._maxIndex=isc.C+51;isc.defineClass("FileParser");isc.A=isc.FileParser;isc.A.USE_NATIVE_JSON_PARSER=false;isc.A=isc.FileParser.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.hasHeaderLine=false;isc.A.ignoreEmptyRecords=true;isc.A.separatorChar=",";isc.A.quoteChar="\"";isc.A.allowQuotedValues=true;isc.B.push(isc.A.parseCsvLine=function isc_FileParser_parseCsvLine(_1){if(!this.allowQuotedValues){return _1.split(this.separatorChar)}
var _2=false,_3=[],_4=[]
;var _5;_1.split('').forEach(function(_7){if(_7===this.quoteChar){_2=!_2;if(_2&&_5===_7)_4.push(_7)}else{if(_7==this.separatorChar&&!_2){_3.push(_4.join(''));_4=[]}else{_4.push(_7)}
}
_5=_7},this);if(_4.length>0)_3.push(_4.join(''));for(var i=0;i<_3.length;i++){if(_3[i].match(/^\s*$/))_3[i]=""}
return(_3.length>0?_3:null)}
,isc.A.parseCsvData=function isc_FileParser_parseCsvData(_1,_2){if(!_1)return[];if(!isc.isAn.Array(_1)){if(_1.contains("\r\n")){this.lineSeparator="\r\n";_1=_1.split("\r\n")}else if(_1.contains("\r")){this.lineSeparator="\r";_1=_1.split("\r")}else if(_1.contains("\n")){this.lineSeparator="\n";_1=_1.split("\n")}else{this.lineSeparator="\n";_1=[_1]}
}
var _3=this.filteredCsvData=[];var _4,_5=0
;while(!_4){if(_5>=_1.length){return[]}
var _6=(_1[_5]?_1[_5].trim():"");_4=this.parseCsvLine(_6);if(this.ignoreEmptyRecords&&this.isEmptyRecord(_4)){_5++;_4=null}
}
_3.push(_1[_5]);var _7=this.fieldNames;this.derivedFieldNames=null;var _8;if(!_7){_7=_4;if(this.hasHeaderLine){for(var i=0;i<_7.length;i++){if(_7[i]==null||_7[i]==""){if(!_8)_8=[];_8.push(i)}
}
if(_8){_8.sort(function(_23,_24){return _24-_23});for(var i=0;i<_8.length;i++){_7.splice(_8[i],1)}
}
if(_2)_2.rawHeaderLine=_7.join();for(var i=0;i<_7.length;i++){_7[i]=isc.MockDataSource.convertTitleToName(_7[i],null,_1[_5])}
var _10={};for(var i=0;i<_7.length;i++){var _11=_7[i],_12=_11,_13=1
;while(_10[_12]){_12=_11+_13++}
_10[_12]=true;_7[i]=_12}
this.derivedFieldNames=_7}
}
if(_5>0||this.hasHeaderLine){_1=_1.slice(_5+(this.hasHeaderLine?1:0))}
var _14=[],_15={},_16=0,_17=0;;_1.forEach(function(_6){var _18=this.parseCsvLine(_6);if(_18&&(!this.ignoreEmptyRecords||!this.isEmptyRecord(_18))){if(_8){for(var i=0;i<_8.length;i++){_18.splice(_8[i],1)}
}
if(!this.hasHeaderLine&&_18.length!=_16){for(var i=0;i<_18.length;i++){if(!_15[i]&&_18[i]!=null&&_18[i]!=""){_15[i]=true;_16++;if(i>_17)_17=i}
}
}
_14.push(_18);if(!this.isEmptyRecord(_18))_3.push(_6)}
},this);if(!this.hasHeaderLine){_7=[];var _19=[],_20=0
;for(var i=0;i<=_17;i++){if(_15[i]){_7[_20]="field"+(_20+1);_19[i]=_7[_20];_20++}
}
this.derivedFieldNames=_7;_7=_19}
var _21=_14.map(function(_23){var _22={};_7.forEach(function(_11,i){_22[_11]=_23[i]});return _22});return _21}
,isc.A.isEmptyRecord=function isc_FileParser_isEmptyRecord(_1){if(_1){for(var i=0;i<_1.length;i++){if(_1[i]!=null&&_1[i]!="")return false}
}
return true}
,isc.A.parseJsonData=function isc_FileParser_parseJsonData(_1,_2){this.filteredCsvData=null;var _3;try{if(window.JSON&&isc.FileParser.USE_NATIVE_JSON_PARSER){_3=JSON.parse(_1)}else{_3=isc.JSON.decode(_1)}
}catch(e){this.logWarn("JSON parse error"+(_2?_2:"")+": "+e.toString());this.logWarn("Tried to parse text: "+_1);isc.warn("JSON parse error"+(_2?_2:"")+": "+e.toString());var _4=[];_4.$225h=true;return _4}
if(isc.isAn.Object(_3)){var _5=isc.getKeys(_3);if(_5.length==1&&isc.isAn.Array(_3[_5[0]])){_3=_3[_5[0]]}
}
if(!isc.isAn.Array(_3)){this.logWarn("Invalid data - unable to extract an array of records");var _4=[];_4.$225i=true;return _4}
var _6=[];_3.forEach(function(_9){var _5=isc.getKeys(_9);for(var i=0;i<_5.length;i++){var _8=_5[i];if(!_6.contains(_8))_6.add(_8)}
});this.fieldNames=_6;return _3}
,isc.A.getFieldNames=function isc_FileParser_getFieldNames(){return this.fieldNames||this.derivedFieldNames}
,isc.A.getFields=function isc_FileParser_getFields(){var _1=this.getFieldNames(),_2=[]
;if(_1){_1.forEach(function(_3){_2.add({name:_3})})}
return _2}
,isc.A.getFilteredCsvData=function isc_FileParser_getFilteredCsvData(){return(this.filteredCsvData?this.filteredCsvData.join(this.lineSeparator):null)}
);isc.B._maxIndex=isc.C+7;isc.defineClass("LocalDataSource","DataSource");isc.A=isc.LocalDataSource.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.cacheAllData=true;isc.A.clientOnly=true;isc.A.jsonDateFormat="logicalDateString";isc.A.copyLocalResults=false;isc.A.storageMode="allRecords";isc.A.warnOnUnsafeStorage=true;isc.B.push(isc.A.getOfflineStorageKey=function isc_LocalDataSource_getOfflineStorageKey(){return this.storageKey||this.getID()}
,isc.A.getRecordOfflineStorageKey=function isc_LocalDataSource_getRecordOfflineStorageKey(_1){return this.getOfflineStorageKey()+_1}
,isc.A.$246n=function isc_LocalDataSource__resetOfflineStorage(){if(this.storageMode=="allRecords"){isc.Offline.put(this.getOfflineStorageKey(),isc.JSON.encode(this.cacheData,{strictQuoting:true,dateFormat:this.jsonDateFormat}))}else if(this.storageMode=="eachRecord"){var _1=isc.Offline.get(this.getOfflineStorageKey()),_2=this.cacheData||[];if(_1==null)_1=[]
else _1=_1.split(",");var _3="";for(var i=0;i<_2.length;i++){var _5=_2[i],_6=_5[this.getPrimaryKeyFieldName()];_1.remove(_6);_3+=(i==0?"":",")+_6;isc.Offline.put(this.getRecordOfflineStorageKey(_6),isc.JSON.encode(_5,{strictQuoting:true,dateFormat:this.jsonDateFormat}))}
for(var i=0;i<_1.length;i++){isc.Offline.put(this.getRecordOfflineStorageKey(_1[i]),null)}
isc.Offline.put(this.getOfflineStorageKey(),_3)}
}
,isc.A.updateOfflineCache=function isc_LocalDataSource_updateOfflineCache(_1,_2){if(this.storageMode=="allRecords"){this.fireOnPause("$246o",{target:this,methodName:"$246n"},1
)}else if(this.storageMode=="eachRecord"){var _3=_1.data;if(isc.isAn.Array(_3))_3=_3[0];var _4=_3&&_3[this.getPrimaryKeyFieldName()],_5=this.getOfflineStorageKey();if(_2.operationType=="add"){if(_4!=null){var _6=isc.Offline.get(_5);if(_6==""||_6==null)_6=""+_4
else _6+=","+_4;isc.Offline.put(_5,_6);isc.Offline.put(this.getRecordOfflineStorageKey(""+_4),isc.JSON.encode(_3,{strictQuoting:true,dateFormat:this.jsonDateFormat}))}
}else if(_2.operationType=="update"){if(_3!=null){isc.Offline.put(this.getRecordOfflineStorageKey(""+_4),isc.JSON.encode(_3,{strictQuoting:true,dateFormat:this.jsonDateFormat}))}
}else if(_2.operationType=="remove"){isc.Offline.put(this.getRecordOfflineStorageKey(""+_4),null);var _6=isc.Offline.get(_5);if(_6==null)_6=[];else _6=_6.split(",");_6.remove(_4+"");isc.Offline.put(_5,_6.join(","))}else{this.logInfo("DataSource operation of type "+_2.operationType+". Reinitializing offline storage")}
}
}
,isc.A.logUnsafeStorageWarning=function isc_LocalDataSource_logUnsafeStorageWarning(){if(this.warnOnUnsafeStorage){this.logWarn("LocalDataSource created with specified jsonDateFormat:'"+this.jsonDateFormat+"'. This setting can be a security risk in some configurations. See documentation for details.")}
}
,isc.A.init=function isc_LocalDataSource_init(){this.Super("init",arguments);if(this.jsonDateFormat=="logicalDateConstructor"||this.jsonDateFormat=="dateConstructor"){this.logUnsafeStorageWarning()}
var _1=this.cacheData,_2=(_1!=null);if(!_1){var _3=false;if(this.storageMode=="eachRecord"&&this.getPrimaryKeyField()==null){this.logWarn("LocalDataSource initialized with storageMode 'eachRecord' has no primary key field. This is unsupported - switching to 'allRecords' storage mode.");this.storageMode="allRecords"
}
var _4=this.getOfflineStorageKey();if(this.storageMode=="allRecords"){var _5=isc.Offline.get(_4);if(_5){_1=this.decodeJSON(_5,_4)}
if(!isc.isA.Array(_1)){_1=[]}else{_3=true}
}else{var _6=isc.Offline.get(_4);if(_6!=null){_3=true;var _7=_6.split(",");_1=[];if(_7.length>0){_3=true;var _8=false;for(var i=0;i<_7.length;i++){if(_7[i]==null)continue;var _10=this.getRecordOfflineStorageKey(_7[i]),_11=isc.Offline.get(_10),_12=this.decodeJSON(_11,(_8?null:_10));if(_12!=null)_1[_1.length]=_12;else _8=true}
}
}
}
if(!_3){_1=this.initialCacheData||_1;_2=true}
this.setCacheData(_1)}
if(_2){this.$246n()}
this.observe(this,"updateCaches","observer.updateOfflineCache(arguments[0], arguments[1])")}
,isc.A.decodeJSON=function isc_LocalDataSource_decodeJSON(_1,_2){var _3;if(this.jsonDateFormat=="logicalDateConstructor"||this.jsonDateFormat=="dateConstructor"){this.logUnsafeStorageWarning();_3=isc.JSON.decode(_1,{dateFormat:this.jsonDateFormat})}else{try{if(this.jsonDateFormat=="logicalDateString"){_3=isc.JSON.decodeSafeWithDates(_1,true)}else{_3=isc.JSON.decodeSafe(_1,this.jsonReviver,true)}
}catch(e){if(_2){this.logWarn("LocalDataSource - unable to parse data stored under:"+_2);if(this.logIsDebugEnabled()){this.logDebug("Logging JSON string to browser console");console.warn(_1)}
}
_3=null}
}
return _3}
);isc.B._maxIndex=isc.C+7;isc.defineClass("DataView",isc.VLayout);isc.A=isc.DataView.getPrototype();isc.A.autoLoadServices=true;isc.A.autoBindDBCs=true;isc.A.minMemberLength=18;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.A.dataViewLoaded=isc.Class.NO_OP;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.callMethod("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.B._maxIndex=isc.C+8;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;if(isc.Log)isc.Log.logInfo("Framework explicitly going offline","offlineState")},goOnline:function(){this.explicitOffline=false;if(isc.Log)isc.Log.logInfo("Framework explicitly going online","offlineState")},useNativeOfflineDetection:function(){this.explicitOffline=null},nativeOffline:function(){if(isc.Log)isc.Log.logInfo("browser going offline","offlineState")},nativeOnline:function(){if(isc.Log)isc.Log.logInfo("browser going online","offlineState")},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;i<count;i++){this.$786(this.getKeyForNativeIndex(0),false)}
},logCacheContents:function(maxEntryLength){var contents=this.getCacheContents();this.logDebug("Dumping the contents of the browser's local storage:");for(var key in contents){var value=contents[key];if(value&&value.length>maxEntryLength){value=value.substring(0,maxEntryLength)}
this.logDebug(key+" ===> "+value)}
},getCacheContents:function(){var index=0,contents={},count=this.getSCStoredValuesCount();while(index<count){var key=this.getPriorityQueueKey(index);if(key.indexOf(this.KEY_PREFIX)==0)key=key.substring(this.KEY_PREFIX.length);contents[key]=this.get(key);index++}
return contents},getCacheKeys:function(){var index=0,keys=[],count=this.getSCStoredValuesCount();while(index<count){var key=this.getPriorityQueueKey(index);keys[keys.length]=key;index++}
return keys},removeOldestEntry:function(){var key=this.getAndRemoveOldestFromPriorityQueue();if(key==null)return;this.remove(key,true)},$787:function(maxEntryLength){var doc=this.userDataSpan.xmlDocument;var maxEntryLength=100;this.logDebug("Dumping the contents of raw userData storage:");for(var i=0;i<this.userDataSpan.xmlDocument.firstChild.attributes.length;i++){var key=this.userDataSpan.xmlDocument.firstChild.attributes[i].name;var value=this.userDataSpan.getAttribute(key);if(value&&value.length>maxEntryLength){value=value.substring(0,maxEntryLength)+"..."}
this.logDebug(key+" ===> "+value)}
},put:function(key,value,recycleEntries){if(value==null){this.remove(key);return}
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&&isc.Browser.version<68){return(e.name=="NS_ERROR_DOM_QUOTA_REACHED")}else{return(e.name=="QUOTA_EXCEEDED_ERR")||e.name=="QuotaExceededError"}
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){try{var pq=isc.evalStrict(pqText)}catch(e){isc.logWarn("Caught exception trying to parse priority queue: "+isc.echo(e))}
}else{var pq=[]}
if(!isc.isAn.Array(pq)){isc.logWarn("Priority queue is not an array after parsing - rebuilding");pq=this.rebuildPriorityQueue()}
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){try{var pq=isc.evalStrict(pqText)}catch(e){isc.logWarn("Caught exception trying to parse priority queue: "+isc.echo(e))}
}else{var pq=[]}
if(!isc.isAn.Array(pq)){isc.logWarn("Priority queue is not an array after parsing - rebuilding");pq=this.rebuildPriorityQueue()}
for(var i=0;i<pq.length;i++){if(pq[i]==key){var leading=pq.slice(0,i);var trailing=pq.slice(i+1);pq=leading.concat(trailing);break}
}
this.$788(this.priorityQueueKey,this.serialize(pq))},getAndRemoveOldestFromPriorityQueue:function(){var pqText=this.get(this.priorityQueueKey);if(pqText){try{var pq=isc.evalStrict(pqText)}catch(e){isc.logWarn("Caught exception trying to parse priority queue: "+isc.echo(e))}
}else{var pq=[]}
if(!isc.isAn.Array(pq)){isc.logWarn("Priority queue is not an array after parsing - rebuilding");pq=this.rebuildPriorityQueue()}
var oldest=pq.shift();this.$788(this.priorityQueueKey,this.serialize(pq));return this.toUserKey(oldest)},getPriorityQueueEntry:function(index){var key=this.getPriorityQueueKey(index);var value=this.get(key);var entry={};entry[key]=value;return entry},getPriorityQueueValue:function(index){var key=this.getPriorityQueueKey(index);return this.get(key)},getPriorityQueueKey:function(index){var pqText=this.get(this.priorityQueueKey);if(pqText){try{var pq=isc.evalStrict(pqText)}catch(e){isc.logWarn("Caught exception trying to parse priority queue: "+isc.echo(e))}
}else{var pq=[]}
if(!isc.isAn.Array(pq)){isc.logWarn("Priority queue is not an array after parsing - rebuilding");pq=this.rebuildPriorityQueue()}
return this.toUserKey(pq[index])},getPriorityQueue:function(){var pqText=this.get(this.priorityQueueKey);if(pqText){var pq=isc.evalStrict(pqText)}else{var pq=[]}
return pq},rebuildPriorityQueue:function(){isc.logWarn("WARNING: rebuildPriorityQueue() called!  This will reconstruct a corrupt priority queue, but can only do so with a random ordering; henceforth, until priority queue is modified organically to be a real priority queue again, we will not make Offline space available by deleting the oldest entries, but by deleting random entries");var entries=this.getNativeStoredValuesCount();var pq=[];for(var i=0;i<entries;i++){var key=this.toInternalKey(this.getKeyForNativeIndex(i))
key=key.substring(this.KEY_PREFIX.length);if(key==this.priorityQueueKey||key==this.countKey||key==this.keyKey||key==this.valueKey)
{continue}
pq.push(key)}
this.$788(this.priorityQueueKey,this.serialize(pq));return pq},toInternalKey:function(userKey){if(this.localStorageType()==this.USERDATA_PERSISTENCE){return UserDataPersistence.getDataStoreKey(this.KEY_PREFIX+userKey)}
return userKey},toUserKey:function(internalKey){if(this.localStorageType()==this.USERDATA_PERSISTENCE){return this.getUndecoratedKey(UserDataPersistence.getUserKey(internalKey))}
return internalKey},countKey:"storedEntryCount__",keyKey:"storedKeyBytes__",valueKey:"storedValueBytes__",updateMetrics:function(mode,key,value,oldValue){var realKey=this.KEY_PREFIX+key,storedEntries=this.get(this.countKey)||0,storedKeyBytes=this.get(this.keyKey)||0,storedValueBytes=this.get(this.valueKey)||0;storedKeyBytes=1*storedKeyBytes;storedValueBytes=1*storedValueBytes;if(mode=="remove"){var item=this.get(key);if(item!=null){storedEntries--;storedKeyBytes-=realKey.length;storedValueBytes-=item.length}
}else{if(oldValue==null){storedEntries++;storedKeyBytes+=realKey.length;storedValueBytes+=value.length}else{storedValueBytes+=value.length-oldValue.length}
}
this.$788(this.countKey,storedEntries);this.$788(this.keyKey,storedKeyBytes);this.$788(this.valueKey,storedValueBytes)},rebuildMetrics:function(){var pq=this.getPriorityQueue(),entries=0,keyBytes=0,valueBytes=0;for(var i=0;i<pq.length;i++){var value=this.get(pq[i]);entries++;keyBytes+=pq[i].length;valueBytes+=value.length}
this.$788(this.countKey,entries);this.$788(this.keyKey,keyBytes);this.$788(this.valueKey,valueBytes)},getStorageMetrics:function(){var storedEntries=this.get(this.countKey)||0,storedKeyBytes=this.get(this.keyKey)||0,storedValueBytes=this.get(this.valueKey)||0,countLen=0,keyLen=0,valueLen=0;if(storedEntries)countLen=storedEntries.length;if(storedKeyBytes)keyLen=storedKeyBytes.length;if(storedValueBytes)valueLen=storedValueBytes.length;storedEntries=1*storedEntries;storedKeyBytes=1*storedKeyBytes;storedValueBytes=1*storedValueBytes;var pqText=this.get(this.priorityQueueKey);var overhead=this.countKey.length+this.keyKey.length+this.valueKey.length+countLen+keyLen+valueLen;var pqLength=pqText==null?0:pqText.length+(this.KEY_PREFIX+this.priorityQueueKey).length;return{storedEntries:storedEntries,storedKeyBytes:storedKeyBytes,storedValueBytes:storedValueBytes,metricsOverhead:overhead,priorityQueue:pqLength,total:storedKeyBytes+storedValueBytes+overhead+pqLength
}
},getTotalStorageUsed:function(){var metrics=this.getStorageMetrics();return metrics.storedKeyBytes+metrics.storedValueBytes+metrics.metricsOverhead+metrics.priorityQueue},storeResponse:function(dsRequest,dsResponse){var ts=new Date().getTime();dsResponse.offlineTimestamp=ts;var trimmedRequest=this.trimRequest(dsRequest),key=this.serialize(trimmedRequest),value=this.serialize(this.trimResponse(dsResponse));this.logDebug("storeResponse serializing: "+(new Date().getTime()-ts)+"ms");if(this.get(key)==null){if(this.getSCStoredValuesCount()>=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;i<keyProps.length;i++){if(dsRequest[keyProps[i]]!==undef){trimmed[keyProps[i]]=dsRequest[keyProps[i]]}
}
return trimmed},trimResponse:function(dsResponse){var keyProps=["dataSource","startRow","endRow","totalRows","data","offlineTimestamp","status","errors","invalidateCache","cacheTimestamp"],trimmed={},undef;for(var i=0;i<keyProps.length;i++){if(dsResponse[keyProps[i]]!==undef){trimmed[keyProps[i]]=dsResponse[keyProps[i]]}
}
return trimmed},getResponse:function(dsRequest){var trimmedRequest=this.trimRequest(dsRequest),key=this.serialize(trimmedRequest),value=this.get(key),returnValue;returnValue=isc.evalStrict(value);if(returnValue)returnValue.fromOfflineCache=true;return returnValue},serialize:function(obj){return isc.Comm.serialize(obj,false)},showStorageInfo:function(){if(!this.storageBrowser){if(isc.Offline.localStorageType()==isc.Offline.USERDATA_PERSISTENCE){isc.Timer.setTimeout(function(){isc.say("WARNING:  This browser uses an old storage mechanism that does not permit arbitrary key/value pair storage.  This means we have to store extra management data, with the upshot that the metrics reported for 'priority queue' and 'overhead' are indicative, but not accurate")},0)}
this.metricsDF=isc.DynamicForm.create({width:"100%",numCols:6,fields:[{name:"storedEntries",title:"No. entries",disabled:true},{name:"storedKeyBytes",title:"Used by keys",disabled:true},{name:"storedValueBytes",title:"Used by values",disabled:true},{name:"priorityQueue",title:"Used by Priority Queue",disabled:true},{name:"metricsOverhead",title:"Metrics overhead",disabled:true},{name:"total",title:"Total Bytes",disabled:true}
]
});this.storageLG=isc.ListGrid.create({width:"100%",height:"*",canRemoveRecords:true,removeData:function(record){isc.ask("Remove this entry?",function(value){if(value){isc.Offline.remove(record.key);isc.Offline.refreshStorageInfo()}
})},rowDoubleClick:function(record){isc.Offline.createStorageEditorWindow();isc.Offline.storageEditorWindow.show();isc.Offline.storageEditor.editRecord(record)},fields:[{name:"key",width:"25%",title:"Key"},{name:"value",title:"Value"}
]
});this.storageBrowser=isc.Window.create({autoCenter:true,canDragResize:true,width:Math.floor(isc.Page.getWidth()*0.5),height:Math.floor(isc.Page.getHeight()*0.5),title:"Offline Storage",items:[this.metricsDF,this.storageLG,isc.HLayout.create({width:"100%",height:1,members:[isc.LayoutSpacer.create({width:"*"}),isc.Button.create({title:"Add Entry",click:function(){isc.Offline.createStorageEditorWindow();isc.Offline.storageEditorWindow.show();isc.Offline.storageEditor.editNewRecord()}
})
]
})
]
})}
this.storageBrowser.show();this.refreshStorageInfo()},createStorageEditorWindow:function(){if(!isc.Offline.storageEditorWindow){isc.Offline.storageEditor=isc.DynamicForm.create({fields:[{name:"key",title:"Key",editorType:"TextAreaItem",width:400},{name:"value",title:"Value",editorType:"TextAreaItem",width:400},{name:"saveButton",type:"button",title:"Save",click:function(){var form=isc.Offline.storageEditor;if(form.saveOperationType=="update"&&form.getValue("key")!=form.getOldValue("key"))
{isc.ask("Key has changed - this will create a new entry. Do you want to retain the old entry as well? (if you answer 'No', it will be removed",function(value){if(value===false){isc.Offline.remove(form.getOldValue("key"))}
if(value!=null){isc.Offline.put(form.getValue("key"),form.getValue("value"));isc.Offline.storageEditorWindow.hide();isc.Offline.refreshStorageInfo()}
})}else{isc.Offline.put(form.getValue("key"),form.getValue("value"));isc.Offline.storageEditorWindow.hide();isc.Offline.refreshStorageInfo()}
}}
]
});isc.Offline.storageEditorWindow=isc.Window.create({bodyProperties:{margin:5},title:"Edit Offline Storage Entry",isModal:true,autoCenter:true,height:280,width:480,items:[isc.Offline.storageEditor
]
})}
},refreshStorageInfo:function(){this.metricsDF.editRecord(isc.Offline.getStorageMetrics());var dataObj=isc.Offline.getCacheContents();var data=[];for(var key in dataObj){data.add({key:key,value:dataObj[key]})}
this.storageLG.setData(data)}};var UserDataPersistence={isInitialized:false,poolSize:10,keyIndexKey:"keyIndex",reverseKeyIndexKey:"reverseKeyIndex",init:function(){this.userDataSpan=[];for(var i=0;i<this.poolSize;i++){this.userDataSpan[i]=document.createElement('span');this.userDataSpan[i].ID='isc_userData_'+i;this.userDataSpan[i].style.behavior='url(#default#userdata)';document.body.appendChild(this.userDataSpan[i]);this.userDataSpan[i].load("isc_userData_"+i)}
this.keyIndexStore=document.createElement('span');this.keyIndexStore.ID='isc_userData_keyIndex';this.keyIndexStore.style.behavior='url(#default#userdata)';document.body.appendChild(this.keyIndexStore);this.keyIndexStore.load("isc_userData_keyIndex");this.keyIndex=this.getKeyIndexFromStore();this.reverseKeyIndex=this.getReverseKeyIndexFromStore();if(!this.keyIndex){this.keyIndex={};this.reverseKeyIndex={}}else if(!this.reverseKeyIndex)this.buildReverseKeyIndex();this.buildNextAttributeInfo();this.isInitialized=true},clearCacheNatively:function(){for(var i=0;i<this.poolSize;i++){var attrs=this.userDataSpan[i].xmlDocument.firstChild.attributes;while(attrs.length>0){this.userDataSpan[i].removeAttribute(attrs[0].name)}
}
this.keyIndex={};this.reverseKeyIndex={};this.saveKeyIndex()},getNativeStoredValuesCount:function(){var count=0;for(var i=0;i<this.poolSize;i++){count+=this.userDataSpan[i].xmlDocument.firstChild.attributes.length}
return count},getKeyForNativeIndex:function(index){var iCounter=0;for(var i=0;i<this.poolSize;i++){if(iCounter+this.userDataSpan[i].xmlDocument.firstChild.attributes.length>index){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;i<this.poolSize;i++){this.unusedAttributeNumbers[i]=[];var attrs=this.userDataSpan[i].xmlDocument.firstChild.attributes;var work=[];for(var j=0;j<attrs.length;j++){var num=attrs[j].name.substring(1)*1;if(!isNaN(num))work.add(attrs[j].name.substring(1)*1)}
if(work.sort)work.sort();else this.sort(work);var counter=0;for(j=0;j<work.length;j++){if(work[j]==counter){counter++;continue}
while(work[j]!=counter&&counter<=9999){this.unusedAttributeNumbers[i].push(counter++)}
counter++}
this.nextAttributeNumber[i]=counter}
},sort:function(array){for(var i=0;i<array.length;i++){var swapped=false;for(var j=1;j<array.length-i;j++){if(array[j]<array[j-1]){var temp=array[j];array[j]=array[j-1];array[j-1]=temp;swapped=true}
}
if(!swapped)break}
},getNextAttributeName:function(dataStore){if(this.unusedAttributeNumbers[dataStore]&&this.unusedAttributeNumbers[dataStore].length>0)
{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){var ki=isc.evalStrict(kiText)}else{var ki=null}
return ki},getReverseKeyIndexFromStore:function(){var kiText=this.keyIndexStore.getAttribute(this.reverseKeyIndexKey);if(kiText){var ki=isc.evalStrict(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<len;i++){var value=object[i];if(prefix!=null)output+="\r"+prefix;var objPath=this.$zp(objPath,i);var serializedValue=this.$eu(value,(prefix!=null?prefix:null),objPath);output+=serializedValue+",";if(prefix!=null)output+=" "}
var commaChar=output.lastIndexOf(",");if(commaChar>-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.defineClass("OfflineFileSource","DataSource");isc.A=isc.OfflineFileSource.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.dataProtocol="clientCustom";isc.A.fields=[{name:"fileName",type:"text"},{name:"fileType",type:"text"},{name:"fileFormat",type:"text"},{name:"fileContents",type:"text"}
];isc.A.fileNamePrefix="ofs-";isc.B.push(isc.A.$1733=function isc_OfflineFileSource__getAllFiles(){var _1=this;var _2=isc.Offline.getCacheKeys().findAll(function(_3){return _3.startsWith(_1.fileNamePrefix)})||[];return _2.map(function(_3){return _1.keyToFileSpec(_3)})}
,isc.A.$1734=function isc_OfflineFileSource__getFileContents(_1){return isc.Offline.get(this.fileSpecToKey(_1))}
,isc.A.keyToFileSpec=function isc_OfflineFileSource_keyToFileSpec(_1){if(_1.startsWith(this.fileNamePrefix)){_1=_1.substring(this.fileNamePrefix.length)}
return isc.DataSource.makeFileSpec(_1)}
,isc.A.fileSpecToKey=function isc_OfflineFileSource_fileSpecToKey(_1){return[this.fileNamePrefix,_1.fileName?_1.fileName:"",_1.fileType?"."+_1.fileType:"",_1.fileFormat?"."+_1.fileFormat:""
].join("")}
,isc.A.transformRequest=function isc_OfflineFileSource_transformRequest(_1){var _2=this;var _3;switch(_1.operationType){case"getFile":case"hasFile":case"listFiles":var _4=this.$1733();var _5=this.getClientOnlyFetchResponse(_1,_4);_3=_5[0]||{};_3.data=_5[1]||[];if(_1.operationType=="getFile"){_3.data.map(function(_10){_10.fileContents=_2.$1734(_10)})}
break;case"removeFile":var _6=this.$1734(_1.data);isc.Offline.remove(this.fileSpecToKey(_1.data));_3={status:0,data:_6==null?[]:[_1.data]
};break;case"renameFile":var _7=_1.oldValues;if(!_7){_3={status:-1,data:"File to rename must be provided in oldValues"
}}else{var _8=this.$1734(_7);if(_8==null){_3={status:-1,data:"File not found"
}}else{var _9=this.$1734(_1.data);if(_9!=null){_3={status:-1,data:"destination file already exists"
}
}else{try{isc.Offline.put(this.fileSpecToKey(_1.data),_8);isc.Offline.remove(this.fileSpecToKey(_7));_3={status:0,data:_1.data
}
}
catch(ex){_3={status:-1,data:ex.message
}
}
}
}
}
break;case"saveFile":if(!_1.data){_3={status:-1,data:"No data provided with dsRequest"
}}else if(!_1.data.fileName){_3={status:-1,data:"fileName field must be provided"
}}else{isc.Offline.put(this.fileSpecToKey(_1.data),_1.data.fileContents);_3={status:0,data:_1.data
}}
break;default:_3={status:-1,data:"Not implemented"
};break}
this.delayCall("processResponse",[_1.requestId,_3]);return _1.data}
);isc.B._maxIndex=isc.C+5;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;i<this.members.length;i++){var _2=this.members[i];if(isc.isA.String(_2)){this.members[i]=_2=window[_2]}
this.$889(_2,true)}
}
this.$246l={}}
,isc.A.destroy=function isc_RulesEngine_destroy(){this.Super("destroy",arguments);isc.ClassFactory.dereferenceGlobalID(this);if(this.members){for(var i=0;i<this.members.length;i++){delete this.members[i].rulesEngine}
}
delete this.baseComponent;delete this.ruleContext;delete this.members;delete this.rulesData;this.destroyed=true}
,isc.A.addMember=function isc_RulesEngine_addMember(_1){if(!this.members.contains(_1)){this.members.add(_1);this.$889(_1)}
}
,isc.A.$889=function isc_RulesEngine__addMember(_1){if(_1.rulesEngine!=this){if(_1.rulesEngine!=null){_1.rulesEngine.removeMember(_1)}
_1.rulesEngine=this}
}
,isc.A.processEditStart=function isc_RulesEngine_processEditStart(_1){this.$89b("editStart",_1);this.$89b("editStartAndChanged",_1)}
,isc.A.processEditorEnter=function isc_RulesEngine_processEditorEnter(_1,_2){this.$89c("editorEnter",_1,_2)}
,isc.A.processChanged=function isc_RulesEngine_processChanged(_1,_2){this.$89c("changed",_1,_2);this.$89c("editStartAndChanged",_1,_2)}
,isc.A.processEditorExit=function isc_RulesEngine_processEditorExit(_1,_2){this.$89c("editorExit",_1,_2)}
,isc.A.processSubmit=function isc_RulesEngine_processSubmit(_1){return this.$89b("submit",_1)}
,isc.A.processContextChanged=function isc_RulesEngine_processContextChanged(_1,_2,_3){if(this.$2577){if(_1){var _4=this.$2578.find("component",_1);if(!_4){this.$2578.add({component:_1,paths:_2})}else if(_2&&_2.length>0){if(!_4.paths){_4.paths=_2}else{for(var i=0;i<_2.length;i++){if(!_4.paths.contains(_2[i])){_4.paths.add(_2[i])}
}
}
}
}else{this.$2578.add({paths:_2})}
return}
var _6=this.$2577;this.$2577=true;this.$2578=[];if(!_3){this.$258d={}}
var _7;if(_2&&_2.length>0){_7=function(_20){var _8=_20.pathDependencies;if(!_8)return true;for(var i=0;i<_2.length;i++){var _9=_2[i],_10=_9.length
;if(_8[_9])return true;var _11=isc.getKeys(_8);for(var j=0;j<_11.length;j++){var _13=_11[j].substring(_10,_10+1);if(_11[j].startsWith(_9)&&_13=="."||_13=="/"){return true}
}
}
return false}}
this.$89b("contextChanged",_1,_7);this.$2577=_6;if(!_3){var _14=isc.shallowClone(this.$2578),_15=0
;delete this.$2578;if(_14&&_14.length>0){var _16=0;while(_16<_14.length&&_15++<3){var _4=_14[_16++];this.processContextChanged(_4.component,_4.paths,true);if(this.$2578&&this.$2578.length>0){var _17=this.$2578,_18=_14.slice(_16)
;for(var j=0;j<_17.length;j++){var _19=_17[j];var _4=_19.component&&_18.find("component",_19.component);if(!_4){_14.add({component:_19.component,paths:_19.paths})}else if(_19.paths&&_19.paths.length>0){if(!_4.paths){_4.paths=_19.paths}else{for(var i=0;i<_19.paths.length;i++){if(!_4.paths.contains(_19.paths[i])){_4.paths.add(_19.paths[i])}
}
}
}
}
}
}
}
}
delete this.$258d}
,isc.A.$89b=function isc_RulesEngine__processComponentTriggerEvent(_1,_2,_3){var _4=this.rulesData;if(!_4||_4.length==0)return;var _5=[];for(var i=0;i<_4.length;i++){var _7=!_3||_3(_4[i]);if(_4[i].triggerEvent==_1&&_7){_5[_5.length]=_4[i]}
}
if(_5.length>0)return this.processRules(_5,_2);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,_2);return null}
,isc.A.getValues=function isc_RulesEngine_getValues(){if(this.ruleContext)return this.ruleContext;var _1={};for(var i=0;i<this.members.length;i++){var _3=this.members[i];if(_3.destroyed||!_3.getValues)continue;var _4=_3.getValues(),_5=_3.getDataSource(),_6=_5?_5.getID():null;if(_6!=null){_1[_6]=isc.addProperties(_1[_6]||{},_4)}else{isc.addProperties(_1,_4)}
}
return _1}
,isc.A.processContextRules=function isc_RulesEngine_processContextRules(_1,_2){this.$258d={};var _3=this.processRules(_1,_2);delete this.$258d;return _3}
,isc.A.processRules=function isc_RulesEngine_processRules(_1,_2){if(_1==null)return;var _3=this.getValues(),_4=null
;if(!isc.isAn.Array(_1)){_1=[_1]
}
if(isc.RulesEngine.$258f==null)isc.RulesEngine.$258f=0;var _5=isc.RulesEngine.$258f++;for(var i=0;i<_1.length;i++){try{var _7=_1[i],_8=_3,_9=_7.component,_10=_7.fieldName,_11=_7.propertyName,_12=_7.locator,_13=true,_14=_7.applyWhen,_15,_16=_7.logCategory||"rulesEngine",_17=this.logIsInfoEnabled("rulesEngine"),_18=this.logIsDebugEnabled(_16)
;var _19=[];var _20=_7.targetObjectType;if(_9){if(_10){var _21=_7.formIconName;if(isc.isA.String(_10)){_10=_10.split(",")}else if(_10==null){_10=[]}
for(var j=0;j<_10.length;j++){var _23=_10[j],_24=_9.getSpecifiedField(_23)
;if(!_24)_24=window[_23];if(_24){var _25={object:_24,objectType:_20||"FormItem",container:_9
};if(_21!=null){var _26=_24.getIcon(_21);if(_26){_25.object=_26;_25.objectType=_20||"FormItemIcon";_25.container=_24}
}
_19.add(_25)}
}
_10=null}else if(_9.isSectionHeader){_19.add({object:_9,objectType:_20||"Section",container:_9.parentElement
})}else if(isc.isA.Canvas(_9)){_19.add({object:_9,objectType:_20||"Canvas"
})}
}else if(_12!=null){if(isc.isA.String(_12))_12=_12.split(/,(?![^\[]*\])/);for(var j=0;j<_12.length;j++){var _27=_12[j],_28=isc.AutoTest.isRelativeLocator(_27),_25=null
;if(_28){if(this.baseComponent==null){this.logWarn("RulesEngine has no specified baseComponent. Unable to process rule with specified relative locator:"+_27);continue}
_25=isc.AutoTest.getRelativeObjectContext(this.baseComponent,_27,_7.internalRule)}else{_25=isc.AutoTest.getObjectContext(_27,_7.internalRule)}
if(_25==null||_25.object==null){_27=_27.replace(/,locatorMatching=restrictSuffix/,"");_25=isc.AutoTest.getObjectContext(_27,_7.internalRule);if(!_25||!_25.object||!_25.object.destroying){this.logWarn("RulesEngine unable to resolve locator specified on rule. "+(this.baseComponent?"\nBase Component: "+this.baseComponent:"")+"\nLocator in question:\n"+_27+" - "+isc.AutoTest.getLogFailureText()+this.getStackTrace())}
continue}
_19.add(_25)}
}
if(_14){var _29=(_2||_9||this.baseComponent);_29=_29
?_29.getRuleScopeComponent():null;_13=this.evaluateCriteriaAgainstRuleContext(_14,_29,_8,_2,_19,_5);_15=_13}
var _30,_31,_32=this,_33=function(_51,_4){var _34=_30+(_51?_51:"")+_31+_4;if(_18){if(_15!=null){var _35;try{_35=isc.echoFull(_14)}catch(e){}
_34+=". applyWhen criteria "+(_15?"matched":"did not match")+(_35?": "+_35:"")}
_32.logDebug(_34,_16)}else if(_17){_32.logInfo(_34,_16)}
}
;if(_17||_18){_30="Applying "+_7.type+" rule '"+_7.name+"' for ",_31=" with action result "}
for(var j=0;j<_19.length;j++){var _25=_19[j];var _36=_25.container;if(isc.isA.GridBody(_36)&&_36.grid.$286){_36=_36.grid.$286}
if(_17||_18){var _20=_25.objectType,_37=_25.object,_38=(_20=="FormItemIcon"?_36.form.ID+"."+_36.name+".":(_36?_36.ID+".":"")),_39=(_20=="MenuItem"&&_37.getItem(_7.menuItem)?_37.getItem(_7.menuItem).title:(_37.name||_37.ID))
;_33(_20+" "+_38+_39,(_13?"true":"null"))}
var _4=_13?true:null;if(_7.negateShouldApply)_4=!_4;isc.Validator.performAction(_4,_25.object,_7,_8,_36,_25.objectType)}
if(isc.isA.String(_10)){_10=_10.split(",")}else if(_10==null){_10=[]}
for(var j=0;j<_10.length;j++){var _23=_10[j],_40=_23.substring(0,_23.indexOf(".")),_41=_40?isc.DataSource.get(_40):null,_42=(_40?_23.substring(_40.length+1):_23),_43=isc.DataSource.getPathValue(_8,_23),_44=this.getComponentInfo(_23),_2=_44?_44.component:null,_24=_44?_44.item:(_41?_41.getField(_42):null);;if(_2==null||_24==null){this.logWarn("RulesEngine contains rule definition with specified fieldName:"
+_23+" - unable to find associated "+(_2==null?"member component":"field")+" for this rule.");continue}
var _45=null;if(_13){_45=(isc.Validator.processValidator(_24,_7,_43,null,_8)==true)}
if(_17||_18){_33("field '"+_23+"'"+(_2?" in "+_2.ID:""),_45)}
isc.Validator.performAction(_45,_24,_7,_8,_2);if(_45==false){_4=false;var _46=isc.Validator.getErrorMessage(_7);_2.addFieldErrors(_24.name,_46,true);this.rememberRuleFieldError(_7,_2,_24,_46)}else{var _47=this.getRuleFieldError(_7,_2,_24);if(_47&&_2.clearFieldError){_2.clearFieldError(_24.name,_47,true);this.clearRememberedRuleFieldError(_7,_2,_24)}
if(_4==null)_4=true}
}
if(isc.isA.String(_11)){_11=_11.split(",")}else if(_11==null){_11=[]}
for(var j=0;j<_11.length;j++){var _48=_11[j],_49=_48.split("."),_50=(_49.length>0?_49[0]:null),_23=(_49.length>2?_49[1]:null),_48=_49[_49.length-1],_2=(_50.length>0?window[_50]:null)
;if(_23&&_23.length>0){_2=_2.getField(_23)}
if(_2==null||_48==null){this.logWarn("RulesEngine contains rule definition with specified propertyName:"
+_48+" - unable to find associated "+(_2==null?"member component":"property")+" for this rule.");continue}
var _45=null;if(_13){_45=(isc.Validator.processValidator(_48,_7,_43,null,_8)==true)}
if(_17||_18){_33("property '"+_48+"'"+(_2?" in "+_2.ID:""),_45)}
isc.Validator.performAction(_45,_48,_7,_8,_2,"Canvas")}
}catch(e){this.logWarn("exception occurred processing rule - skipped: "+(_1[i]&&_1[i].name)+" -> "+e)}
}
return _4}
,isc.A.resolveFieldOrPropertyType=function isc_RulesEngine_resolveFieldOrPropertyType(_1,_2){var _3=(_2?_2.getRuleContextPathDetails(_1):null),_4=(_3?_3.field:null),_5=(_4?isc.SimpleType.getType(_4.type?_4.type:"text"):null)
;return _5}
,isc.A.resolveField=function isc_RulesEngine_resolveField(_1,_2){return(_2?_2.getRuleContextPathDetails(_1):null)}
,isc.A.rememberRuleFieldError=function isc_RulesEngine_rememberRuleFieldError(_1,_2,_3,_4){if(_1.$927==null){_1.$927={}}
var _5=_2.getID();if(_1.$927[_5]==null){_1.$927[_5]={}}
_1.$927[_5][_3.name]=_4}
,isc.A.getRuleFieldError=function isc_RulesEngine_getRuleFieldError(_1,_2,_3){var _4=_2.getID();if(_1.$927&&_1.$927[_4]
&&_1.$927[_4][_3.name]!=null)
{return _1.$927[_4][_3.name]}
}
,isc.A.clearRememberedRuleFieldError=function isc_RulesEngine_clearRememberedRuleFieldError(_1,_2,_3){var _4=_2.getID();if(_1.$927&&_1.$927[_4]
&&_1.$927[_4][_3.name]!=null)
{delete _1.$927[_4][_3.name]}
}
,isc.A.evaluateCriteriaAgainstRuleContext=function isc_RulesEngine_evaluateCriteriaAgainstRuleContext(_1,_2,_3,_4,_5,_6){if(isc.DS.isAdvancedCriteria(_1)){_1=isc.DataSource.resolveDynamicCriteria(_1,_3)}
_1=isc.DataSource.validateCriteria(_1,this,_2,this.resolveFieldOrPropertyType,this.resolveField);var _7=[],_8={};_5=_5||[];for(var j=0;j<_5.length;j++){var _10=_5[j],_11=[]
;if(isc.isA.GridBody(_17)&&_17.grid.$286){_11.add(_17.grid.$286)}else if(isc.isA.FormItem(_17)){_11.add(_17.containerWidget)}else if(_10.container){var _12=_10.container,_13=_12.valuesManager
;if(!_13){_11.add(_12)}else{var _14=_13.getMembers();for(var m=0;m<_14.length;m++){_11.add(_14[m])}
}
}
for(var k=0;k<_11.length;k++){var _17=_11[k];var _18=_17&&((_17.hasStableLocalID&&_17.hasStableLocalID())||_17.grid||(_17.editNode!=null))
;if(_17&&!_18&&_17.getValues){var _19=_17.getLocalId();if(this.$258d){_3[_19]=this.$258d[_19]||{values:_17.getValues(_6)};this.$258d[_19]=_3[_19]}else{_3[_19]={values:_17.getValues(_6)}}
_7.add(_19)}
}
var _20=_10.object&&_10.object.getLocalRuleContextValues&&_10.object.getLocalRuleContextValues();if(_20){for(var _21 in _20){var _22=_20[_21];isc.Canvas.$70n(_21,null,_22,_3);_8[_21]=_22}
}
}
var _23=isc.DataSource.applyFilter([_3],_1,this,_2,this.resolveField);var _24=(_23.length>0)
for(var _21 in _8){isc.Canvas.$70m(_21,_3)}
if(_7.length>0){for(var j=0;j<_7.length;j++){delete _3[_7[j]]}
}
return _24}
,isc.A.applyFieldValidators=function isc_RulesEngine_applyFieldValidators(_1,_2){var _3=this.rulesData||[],_4=this.getValues(),_5=false
;for(var i=0;i<_3.length;i++){var _7=_3[i],_8=_4,_9=_7.fieldName
;if(_9==null)continue;var _10=this.getComponentInfo(_9);if(_10==null||_10.component!=_2)continue;var _11=_10.item,_12=isc.DataSource.getPathValue(_8,_9);if(!_11)return;this.clearRememberedRuleFieldError(_7,_2,_11);var _13=true;if(_7.applyWhen){var _14=_7.applyWhen;var _15=isc.DataSource.applyFilter([_8],_14);if(_15.length==0){_13=false}
}
if(!_13)continue;var _16=isc.Validator.processValidator(_11,_7,_12,null,_8)==true;if(!_16){var _17=isc.Validator.getErrorMessage(_7);if(_1[_11.name]==null)_1[_11.name]=_17;else{if(!isc.isAn.Array(_1[_11.name])){_1[_11.name]=[_1[_11.name]]}
_1[_11.name].add(_17)}
this.rememberRuleFieldError(_7,_2,_11,_17);_5=true}
}
return _5}
,isc.A.getComponentInfo=function isc_RulesEngine_getComponentInfo(_1){var _2,_3=_1.indexOf("."),_4;if(_3!=-1){_4=isc.DataSource.get(_1.substring(0,_3));_1=_1.substring(_3+1)}
for(var i=0;i<this.members.length;i++){if(this.members[i].getDataSource()==_4&&this.members[i].getItem){_2=this.members[i].getItem(_1);if(_2!=null){return{component:this.members[i],item:_2}}
}
}
}
,isc.A.removeMember=function isc_RulesEngine_removeMember(_1){if(this.members.contains(_1)){this.$89a(_1)}
}
,isc.A.$89a=function isc_RulesEngine__removeMember(_1){this.members.remove(_1);_1.rulesEngine=null}
,isc.A.setRulesData=function isc_RulesEngine_setRulesData(_1){this.rulesData=_1;if(_1){for(var i=0;i<_1.length;i++){var _3=_1[i];if(_3.applyWhen){_3.pathDependencies=this.$2579(_3.applyWhen)}
}
}
}
,isc.A.addRule=function isc_RulesEngine_addRule(_1){if(!_1)return;if(!this.rulesData)this.rulesData=[];if(_1.applyWhen){_1.pathDependencies=this.$2579(_1.applyWhen)}
this.rulesData.add(_1)}
,isc.A.removeRule=function isc_RulesEngine_removeRule(_1){if(!_1||!this.rulesData||this.rulesData.length==0)return;var _2=this.rulesData;for(var i=0;i<_2.length;i++){if(_1==_2[i].name){_2.removeAt(i);break}
}
}
,isc.A.getRule=function isc_RulesEngine_getRule(_1){if(_1&&this.rulesData&&this.rulesData.length>0){var _2=this.rulesData;for(var i=0;i<_2.length;i++){if(_1==_2[i].name){return _2[i]}
}
}
return null}
);isc.B._maxIndex=isc.C+29;isc.defineClass("Authentication");isc.A=isc.Authentication;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$210r=false;isc.A.logOutURL=window.isc_auth_logOutURL;isc.B.push(isc.A.userDataModified=function isc_c_Authentication_userDataModified(){}
,isc.A.setCurrentUser=function isc_c_Authentication_setCurrentUser(_1){this.$210s=_1;this.userDataModified()}
,isc.A.getCurrentUser=function isc_c_Authentication_getCurrentUser(){return this.$210s}
,isc.A.getCurrentUserId=function isc_c_Authentication_getCurrentUserId(){return this.$210s?this.$210s.userId:null}
,isc.A.getUserSchema=function isc_c_Authentication_getUserSchema(){var _1=this.getAvailableRoles();if(this.$210t==null){this.$210t=isc.DataSource.create({ID:"isc_standardUser",title:"User",tagName:"user",addGlobalId:false,availableRoles:_1,fields:[{name:"userId",type:"text",primaryKey:true,xmlAttribute:true},{name:"email",type:"text",xmlAttribute:true},{name:"firstName",type:"text",xmlAttribute:true},{name:"lastName",type:"text",xmlAttribute:true},{name:"title",type:"text",xmlAttribute:true},{name:"phone",type:"phoneNumber",xmlAttribute:true},{name:"superUser",type:"boolean",xmlAttribute:true},{name:"roles",multiple:true,type:(_1==null?"text":"enum"),valueMap:_1,multipleStorage:"simpleString",xmlAttribute:true}
]
})}else{if(_1!=this.$210t.availableRoles){this.$210t.availableRoles=_1;this.$210t.getField("roles").valueMap=_1
}
}
return this.$210t}
,isc.A.getAuthSchema=function isc_c_Authentication_getAuthSchema(){var _1=this.getAvailableRoles();if(this.$2101==null){var _2=this.getUserSchema(),_3=_2.getFieldNames(),_4=[]
;for(var i=0;i<_3.length;i++){var _6=_3[i],_7=_2.getField(_6)
;if(_6!="roles"&&_6!="isSuperUser"){_4.add(isc.addProperties({criteriaPath:"auth.currentUser."+_6},_7))}
}
_4.addList([{name:"roles",type:"text",multiple:true,valueMap:_1,multipleStorage:"simpleString",xmlAttribute:true
},{name:"isSuperUser",type:"boolean"}
]);this.$2101=isc.DataSource.create({ID:"isc_auth",tagName:"auth",$145w:true,$229f:true,title:"Authentication",clientOnly:true,addGlobalId:false,availableRoles:_1,fields:_4
})}else{if(_1!=this.$2101.availableRoles){this.$2101.availableRoles=_1;this.$2101.getField("roles").valueMap=_1
}
}
return this.$2101}
,isc.A.setRoles=function isc_c_Authentication_setRoles(_1){if(isc.isAn.Array(_1))_1=_1.duplicate();else if(isc.isA.String(_1))_1=[_1];this.$210u=_1;this.userDataModified()}
,isc.A.getRoles=function isc_c_Authentication_getRoles(){if(this.isSuperUser()){var _1=this.getAvailableRoles();if(_1!=null){if(this.$210u){for(var i=0;i<this.$210u.length;i++){if(_1.indexOf(this.$210u[i])==-1){_1.add(this.$210u[i])}
}
}
return _1}
}
return this.$210u||[]}
,isc.A.hasRole=function isc_c_Authentication_hasRole(_1){return(this.isSuperUser()?(this.$210v||[]).contains(_1):null)||((this.$210u||[]).contains(_1))}
,isc.A.setAvailableRoles=function isc_c_Authentication_setAvailableRoles(_1){this.$210v=_1;if(this.$2101){this.$2101.getField("roles").valueMap=_1==null?null:_1.duplicate()
}
if(this.isSuperUser()){this.userDataModified()}
}
,isc.A.getAvailableRoles=function isc_c_Authentication_getAvailableRoles(){return this.$210v==null?null:this.$210v.duplicate()}
,isc.A.setSuperUser=function isc_c_Authentication_setSuperUser(_1){this.$210r=_1;this.userDataModified()}
,isc.A.isSuperUser=function isc_c_Authentication_isSuperUser(){return this.$210r}
,isc.A.getClassActions=function isc_c_Authentication_getClassActions(_1){if(!_1||(isc.isAn.Object(_1)&&_1._constructor=="MenuItem")||isc.isA.Button(_1))
{return this.$216k
}
return null}
,isc.A.logOut=function isc_c_Authentication_logOut(){if(this.logOutURL){var _1=this.logOutURL.evalDynamicString(this,this.getCurrentUser());window.open(_1,"_blank")}
}
,isc.A.getPasswordResetURL=function isc_c_Authentication_getPasswordResetURL(_1){if(this.resetPasswordURL){return this.resetPasswordURL.evalDynamicString(this,_1)}
}
,isc.A.resetPassword=function isc_c_Authentication_resetPassword(){var _1=this.getPasswordResetURL(this.getCurrentUser());if(_1){window.open(_1,"_blank")}
}
);isc.B._maxIndex=isc.C+17;isc.Authentication.addAsClassActionsComponent("authentication.png","Auth");isc.Authentication.registerClassActions([{name:"logOut",title:"Log out current user",icon:"workflow/logout.png"},{name:"resetPassword",title:"Reset password",icon:"workflow/resetPassword.png"}]);isc.Auth=isc.Authentication;isc.ClassFactory.defineClass("ScreenLoader",isc.VLayout);isc.A=isc.ScreenLoader;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.errorScreenNotFound="No such screen";isc.A.errorScreenLoadFailed="Screen loading failed";isc.B.push(isc.A.loadScreen=function isc_c_ScreenLoader_loadScreen(_1,_2,_3){if(isc.RPC.isScreenCached(_1)){this.fireCallback(_2)}else{isc.RPC.cacheScreens(_1,function(_4,_5){if(isc.isAn.Array(_4)&&_4.length==0&&_5.status==isc.RPCResponse.STATUS_SUCCESS){return isc.ScreenLoader.fireCallback(_2,"error",[this.errorScreenNotFound])}
isc.ScreenLoader.fireCallback(_2)},null,_3)}
}
,isc.A.createScreen=function isc_c_ScreenLoader_createScreen(_1){var _2={suppressAutoDraw:true};return isc.RPC.createScreen(_1,_2)
}
);isc.B._maxIndex=isc.C+2;isc.A=isc.ScreenLoader.getPrototype();isc.A.loadingMessage="Loading Screen...&nbsp;${loadingImage}";isc.A.loadingLabelDefaults={_constructor:isc.Label,height:30,align:"center"};isc.A.errorBorder="1px solid red";isc.A.errorText="Screen '${screenName}' could not be loaded";isc.A.errorTextColor="red";isc.A.errorScreenNotFound="No such screen";isc.A.errorScreenLoadFailed="Screen loading failed";isc.A.errorScreenCrashed="Screen crashed on creation";isc.A.errorLabelDefaults={_constructor:isc.Label,height:30,align:"center"};isc.A.align="center";isc.A.overflow="hidden";isc.A=isc.ScreenLoader.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_ScreenLoader_initWidget(){this.Super(this.$oc,arguments);if(this.showLoadingMessage)this.showLoading()}
,isc.A.destroy=function isc_ScreenLoader_destroy(){if(this.screen&&this.isObserving(this.screen,"dataContextChanged")){this.ignore(this.screen,"dataContextChanged")}
this.Super("destroy",arguments)}
,isc.A.setDataContextBinding=function isc_ScreenLoader_setDataContextBinding(_1){this.dataContextBinding=_1;this.applyDataContextBinding()}
,isc.A.draw=function isc_ScreenLoader_draw(){if(!this.readyToDraw())return this;this.Super("draw",arguments);var _1=this.screenName;if(!_1){this.logWarn("No screenName is provided to load");return this}
this.loadScreen();return this}
,isc.A.loadScreen=function isc_ScreenLoader_loadScreen(){if(this.$97z||this.$182e)return;this.$182e=true;var _1=(this.screenLoaderURL?{actionURL:this.screenLoaderURL}:null),_2=this
;isc.ScreenLoader.loadScreen(this.screenName,function(_3){if(_3){_2.showError(_3)}else{_2.delayCall("showScreen")}
delete _2.$182e;_2.$97z=true},_1)}
,isc.A.showScreen=function isc_ScreenLoader_showScreen(){var _1;try{_1=isc.ScreenLoader.createScreen(this.screenName)}catch(ex){this.showError(this.errorScreenCrashed);return}
this.screen=_1;this.observe(_1,"dataContextChanged","observer.screenDataContextChanged()");if(_1){this.applyDataContextBinding();this.setMembers([_1])}}
,isc.A.showError=function isc_ScreenLoader_showError(_1){this.setMembers([]);this.setBorder(this.errorBorder);var _2="<span style='color: "+this.errorTextColor+"'>"+this.errorText.evalDynamicString(this,{screenName:this.screenName})+"<p>"+_1+"</span>";this.addAutoChild("errorLabel",{contents:_2})}
,isc.A.showLoading=function isc_ScreenLoader_showLoading(){this.addAutoChild("loadingLabel",{contents:this.getLoadingMessage()})}
,isc.A.getLoadingMessage=function isc_ScreenLoader_getLoadingMessage(){return this.loadingMessage==null?"&nbsp;":this.loadingMessage.evalDynamicString(this,{loadingImage:this.imgHTML(isc.Canvas.loadingImageSrc,isc.Canvas.loadingImageSize,isc.Canvas.loadingImageSize)
})}
,isc.A.applyDataContextBinding=function isc_ScreenLoader_applyDataContextBinding(){var _1=this.dataContextBinding;if(this.screen&&_1){_1=this.resolveDataContextBinding(_1);this.screen.setDataContext(_1)}}
,isc.A.resolveDataContextBinding=function isc_ScreenLoader_resolveDataContextBinding(_1){var _2,_3=this.getRuleContext()||{}
;if(_1){_2=isc.clone(_1);for(var _4 in _2){var _5=_2[_4];for(var _6 in _5){var _7=_5[_6];if(isc.isA.String(_7)){if(_7.startsWith("\\$")){_5[_6]=_7.substring(1)}else if(_7.startsWith("$ruleScope.")||_7.startsWith("$scope.")){var _8=_7.replace("$ruleScope.","").replace("$scope.",""),_9=this.getRuleScopeComponent()
;_5[_6]=isc.Canvas.$70o(_8,null,_3,_9)}
}
}
}
}
return _2}
,isc.A.screenDataContextChanged=function isc_ScreenLoader_screenDataContextChanged(){if(this.dataContextChanged)this.fireCallback(this.dataContextChanged)}
);isc.B._maxIndex=isc.C+12;isc.ScreenLoader.registerStringMethods({dataContextChanged:""});isc.A=isc.Canvas;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$145x=["editMaskProperties","hoopSelectionMode","hoopSelectorProperties","selectedAppearance","selectedBorder","selectedLabelBackgroundColor","selectedTintColor","selectedTintOpacity"
];isc.B.push(isc.A.$145y=function isc_c_Canvas__getEditProxyPassThruProperties(_1){var _2={};for(var i=0;i<isc.Canvas.$145x.length;i++){var _4=isc.Canvas.$145x[i];if(_1[_4]!=null)_2[_4]=_1[_4]}
return _2}
);isc.B._maxIndex=isc.C+1;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.A.editProxyConstructor="CanvasEditProxy";isc.B.push(isc.A.wrapChildNode=function isc_Canvas_wrapChildNode(_1,_2,_3,_4){if(_2.useEditMask==null&&(this.autoMaskComponents||(_3&&_3.liveObject&&_3.liveObject.editProxy&&_3.liveObject.editProxy.autoMaskChildren)))
{_2.useEditMask=true}
return _3}
,isc.A.setEditMode=function isc_Canvas_setEditMode(_1,_2,_3){if(_1==null)_1=true;if(this.editingOn==_1)return;this.editingOn=_1;if(this.editingOn){if(_2&&!isc.isAn.EditContext(_2)&&_2.getEditContext){_2=_2.getEditContext()}
this.editContext=_2}
this.editNode=_3;if(this.editingOn&&!this.editProxy){var _4=isc.Canvas.$145y(this.editContext);if(this.editNode&&this.editNode.editProxyProperties)isc.addProperties(_4,this.editNode.editProxyProperties);this.editProxy=this.createAutoChild("editProxy",_4)}
if(this.editProxy){this.editProxy.setEditMode(_1)}
if(this.editingOn&&_2.canSelectEditNodes&&this.editProxy&&this.editProxy.canSelectChildren==null&&(!this.editNode||this.editNode.type!="Tab"))
{this.editProxy.setCanSelectChildren(true)}
if(this.editingOn&&this.editProxy&&this.editProxy.canSelectChildren&&!_2.$159m){_2.$159m=this}
this.markForRedraw()}
);isc.B._maxIndex=isc.C+2;isc.A=isc.Class.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.getSchema=function isc_Class_getSchema(){if(this.schemaName)return isc.DS.get(this.schemaName);var _1=this.getSGWTClassName();if(_1){var _2=isc.DS.get(_1);if(_2)return _2}
var _2=isc.DS.get(this.Class);if(_2)return _2;return isc.DS.getNearestSchema(this)}
,isc.A.getSchemaField=function isc_Class_getSchemaField(_1){return this.getSchema().getField(_1)}
,isc.A.getObjectField=function isc_Class_getObjectField(_1,_2){if(!isc.SGWTFactory.getFactory(_1)&&_1.contains("."))_1=_1.split(/\./).pop();var _3=isc.isA.Canvas(this)&&_2==null;var _4;if(_3){_4=this.$40j;var _5;if(_4!=null&&_4[_1]!==_5){return _4[_1]}
}
var _6=this.getSchema();if(!_6){this.logWarn("getObjectField: no schema exists for: "+this);return}
var _7=_6.getObjectField(_1,false,_2);if(_3){if(_4==null)this.$40j=_4={};_4[_1]=_7}
return _7}
,isc.A.addChildObject=function isc_Class_addChildObject(_1,_2,_3,_4){return this.$40k("add",_1,_2,_3,_4)}
,isc.A.removeChildObject=function isc_Class_removeChildObject(_1,_2,_3){return this.$40k("remove",_1,_2,_3)}
,isc.A.$40k=function isc_Class__doVerbToChild(_1,_2,_3,_4,_5){var _6=_5||this.getObjectField(_2);var _7=this.getSchemaField(_6);if(_7&&!_7.multiple){var _8=(_1=="remove"?null:_3);if(this.editingOn&&this.editProxy){var _9=this.$ds(_6);if(_9&&this.editProxy[_9]){this.editProxy[_9](_8);if(isc.isA.DataSource(_8)&&this.autoFetchData&&this.doInitialFetch){var _10=this.doInitialFetch();if(_10)isc.RPCManager.sendQueue()}
this.logInfo(_1+"ChildObject calling set property for fieldName '"+_6+"'","editing");return true}
}
var _11={};_11[_6]=_8;this.logInfo(_1+"ChildObject calling setProperties for fieldName '"+_6+"'","editing");this.setProperties(_11);return true}
var _12=[this.editProxy,this];for(var i=0;i<_12.length;i++){var _14=_12[i];if(_14==null)continue;var _15=this.getFieldMethod(_14,_2,_6,_1);if(_15!=null&&_14[_15]){this.logInfo("calling "+_15+"("+this.echoLeaf(_3)+(_4!=null?","+_4+")":")"),"editing");_14[_15](_3,_4);return true}
}
return false}
,isc.A.getChildObject=function isc_Class_getChildObject(_1,_2,_3,_4){var _5=_3||this.getObjectField(_1),_6=this.getSchemaField(_5);if(_6==null){if(_3){this.logWarn("getChildObject: no such field '"+_3+"' in schema: "+this.getSchema())}else{this.logWarn("getChildObject: schema for Class '"+this.Class+"' does not have a field accepting type: "+_1)}
return null}
if(!_6.multiple)return this.getPropertyValue(_5);var _7;if(isc.isA.ListGrid(this)&&_5=="fields"){_7="getSpecifiedField"}
if(_7==null)_7=this.getFieldMethod(this,_1,_5,"get");if(_7&&this[_7]){this.logInfo("getChildObject calling: "+_7+"('"+_2+"')","editing");return this[_7](_2)}else{this.logInfo("getChildObject calling getArrayItem('"+_2+"',this."+_5+")","editing");return isc.Class.getArrayItem(_2,this[_5],_4)}
}
,isc.A.getFieldMethod=function isc_Class_getFieldMethod(_1,_2,_3,_4){var _5=_4+_2;if(isc.isA.Function(_1[_5])&&isc.Func.getArgs(_1[_5]).length>0)
{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=(this.editNode&&this.editNode.defaults)||{},_4;if(!this.editModeOriginalValues)this.editModeOriginalValues={};if(!isc.isAn.Array(_1))_1=[_1];for(var i=0;i<_1.length;i++){var _6=isc.isAn.Object(_1[i])?_1[i].name:_1[i];var _7=null;if(this.editModeOriginalValues[_6]===_4){if(_3[_6]===_4||isc.isA.Function(this[_6])||isc.isA.Class(this[_6]))
{this.logInfo("Field "+_6+" - value ["+this[_6]+"] is coming from live values","editModeOriginalValues");_7=this[_6]}else{this.logInfo("Field "+_6+" - value ["+_3[_6]+"] is coming from default values","editModeOriginalValues");_7=_3[_6]}
if(isc.isA.Function(_7)&&_7.$dw){_7=this[_7.$c1]}
}else{this.logInfo("Field "+_6+" - value ["+this.editModeOriginalValues[_6]+"] is coming from original values","editModeOriginalValues");_7=this.editModeOriginalValues[_6]}
_2[_6]=_7}
return _2}
,isc.A.setEditableProperties=function isc_Class_setEditableProperties(_1,_2){var _3=isc.DS.getAutoIdField(this),_4=isc.DS.getToolAutoIdField(this),_5;if(!this.editModeOriginalValues)this.editModeOriginalValues={};for(var _6 in _1){if(this.editModeOriginalValues[_6]===_5){this.logInfo("Field "+_6+" - value is going to live values","editModeOriginalValues");var _7=(_3&&_4&&_6==_4?_3:_6);try{this.setProperty(_7,_1[_6])}catch(e){if(_2){this.logWarn("Failed to update component property '"+_7+"' on "+this+". Error: "+e,"componentExceptions");throw e}
}
}else{this.logInfo("Field "+_6+" - value is going to original values","editModeOriginalValues");this.editModeOriginalValues[_6]=_1[_6]}
}
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={};for(var i=0;i<_1.length;i++){var _5=isc.isAn.Object(_1[i])?_1[i].name:_1[i];if(this.editModeOriginalValues[_5]!==_2){_3[_5]=this.editModeOriginalValues[_5];delete this.editModeOriginalValues[_5]}else{}
}
isc.$179n=true;this.setProperties(_3);delete isc.$179n}
,isc.A.getOriginalValue=function isc_Class_getOriginalValue(_1){var _2;if(this.editModeOriginalValues&&this.editModeOriginalValues[_1]!==_2){return this.editModeOriginalValues[_1]}
}
,isc.A.clearOriginalValues=function isc_Class_clearOriginalValues(_1){var _2;if(!this.editModeOriginalValues)return;for(var i=0;i<_1.length;i++){var _4=isc.isAn.Object(_1[i])?_1[i].name:_1[i];if(this.editModeOriginalValues[_4]!==_2){delete this.editModeOriginalValues[_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){}
);isc.B._maxIndex=isc.C+19;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&&!_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||!_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.getToolAutoIdField=function isc_c_DataSource_getToolAutoIdField(_1){var _2=this.getNearestSchema(_1);return _2?_2.getToolAutoIdField():"autoID"}
,isc.A.getUsedAutoIdField=function isc_c_DataSource_getUsedAutoIdField(_1){var _2=this.getAutoIdField(_1),_3=this.getToolAutoIdField(_1)
;return(_3&&_1[_3]!=null
?_3
:(_2&&_1[_2]!=null?_2:null))}
,isc.A.getAutoId=function isc_c_DataSource_getAutoId(_1,_2){var _3=this.getAutoIdField(_2||_1),_4=this.getToolAutoIdField(_2||_1)
;return(_4?_1[_4]:null)||(_3?_1[_3]:null)}
);isc.B._maxIndex=isc.C+11;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.getToolAutoIdField=function isc_DataSource_getToolAutoIdField(){var _1=this.getAutoIdField();return"auto"+_1.substring(0,1).toUpperCase()+_1.substring(1)}
,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+3;isc.A=isc.StatefulCanvas.getPrototype();isc.A.editProxyConstructor="StatefulCanvasEditProxy";isc.A=isc.Img.getPrototype();isc.A.editProxyConstructor="ImgEditProxy";isc.A=isc.ToolStripSeparator.getPrototype();isc.A.editProxyConstructor="ToolStripSeparatorEditProxy";isc.A=isc.RibbonGroup.getPrototype();isc.A.editProxyConstructor="RibbonGroupEditProxy";isc.A=isc.RibbonButton.getPrototype();isc.A.editProxyConstructor="RibbonButtonEditProxy";isc.A=isc.Label.getPrototype();isc.A.editProxyConstructor="LabelEditProxy";isc.A=isc.Progressbar.getPrototype();isc.A.editProxyConstructor="ProgressbarEditProxy";if(isc.MenuButton){isc.A=isc.MenuButton.getPrototype();isc.A.editProxyConstructor="MenuEditProxy"
}
if(isc.MenuBar){isc.A=isc.MenuBar.getPrototype();isc.A.editProxyConstructor="MenuEditProxy"
}
if(isc.Menu){isc.A=isc.Menu.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"
}
if(isc.Layout){isc.A=isc.Layout.getPrototype();isc.A.editProxyConstructor="LayoutEditProxy"
}
if(isc.LayoutResizeBar){isc.A=isc.LayoutResizeBar.getPrototype();isc.A.editProxyConstructor="LayoutResizeBarEditProxy"
}
if(isc.LayoutResizeSnapbar){isc.A=isc.LayoutResizeSnapbar.getPrototype();isc.A.editProxyConstructor="LayoutResizeBarEditProxy"
}
if(isc.SplitPane){isc.A=isc.SplitPane.getPrototype();isc.A.editProxyConstructor="SplitPaneEditProxy"
}
if(isc.Deck){isc.A=isc.Deck.getPrototype();isc.A.editProxyConstructor="DeckEditProxy"
}
if(isc.NavPanel){isc.A=isc.NavPanel.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.editProxyConstructor="NavPanelEditProxy";isc.B.push(isc.A.addedToEditContext=function isc_NavPanel_addedToEditContext(_1,_2,_3,_4){if(!isc.$75u&&this.editContext.isReify){_2.liveObject.editProxy.loadComplete()}
}
);isc.B._maxIndex=isc.C+1}
if(isc.NavItem){isc.A=isc.NavItem.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.editProxyConstructor="NavItemEditProxy";isc.B.push(isc.A.setEditMode=function isc_NavItem_setEditMode(_1,_2,_3){if(_1==null)_1=true;if(this.editingOn==_1)return;this.editingOn=_1;if(this.editingOn){if(_2&&!isc.isAn.EditContext(_2)&&_2.getEditContext){_2=_2.getEditContext()}
this.editContext=_2}
this.editNode=_3;if(this.editingOn&&!this.editProxy){var _4=isc.Canvas.$145y(this.editContext);if(this.editNode&&this.editNode.editProxyProperties)isc.addProperties(_4,this.editNode.editProxyProperties);isc.addProperties(_4,{contributeToRuleContext:false});this.editProxy=this.createAutoChild("editProxy",_4)}
if(this.editProxy)this.editProxy.setEditMode(_1)}
);isc.B._maxIndex=isc.C+1}
if(isc.Window){isc.A=isc.Window.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.editProxyConstructor="WindowEditProxy";isc.B.push(isc.A.addedToEditContext=function isc_Window_addedToEditContext(_1,_2,_3,_4){var _5=this.editContext.getEditNodeTree();_5.closeFolder(_2);if(!isc.$75u&&this.editContext.isReify){_2.liveObject.editProxy.loadComplete()}
}
);isc.B._maxIndex=isc.C+1;isc.Window.changeDefaults("headerDefaults",{editProxyConstructor:"WindowHeaderEditProxy",editProxyProperties:{isHeader:true}
});isc.Window.changeDefaults("footerDefaults",{editProxyConstructor:"WindowHeaderEditProxy"
})}
if(isc.ModalWindow){isc.A=isc.ModalWindow.getPrototype();isc.A.editProxyConstructor="WindowEditProxy"
}
if(isc.InlineWindow){isc.A=isc.InlineWindow.getPrototype();isc.A.editProxyConstructor="WindowEditProxy"
}
if(isc.DetailViewer){isc.A=isc.DetailViewer.getPrototype();isc.A.editProxyConstructor="DetailViewerEditProxy"
}
if(isc.Header){isc.A=isc.Header.getPrototype();isc.A.editProxyConstructor="HeaderEditProxy"
}
if(isc.Slider){isc.A=isc.Slider.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.editablePropertiesUpdated=function isc_Slider_editablePropertiesUpdated(_1){if(_1[this.$221v]!=null){var _2=this.editContext,_3=this.editNode
;if(_2.isEditNodeSelected(_3)){if(this.getOriginalValue("width")!=null||this.getOriginalValue("height")!=null)
{this.saveToOriginalValues(["width","height"])}
if(this.getOriginalValue("$pn")!=null||this.getOriginalValue("$po")!=null)
{this.saveToOriginalValues(["$pn","$po"])}
}
}
}
);isc.B._maxIndex=isc.C+1}
if(isc.Portlet){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.A.editProxyConstructor="PortalRowEditProxy";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();_5=isc.isAn.Array(_5)?_5[0]:_5;var _6=(_3?_3.makeEditNode(_5):_1.makeEditNode(_5));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();_5=isc.isAn.Array(_5)?_5[0]:_5;var _6=(_3?_3.makeEditNode(_5):_1.makeEditNode(_5));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 false}
}else{if(_3&&_4&&_1.editNode){_3.addNode(_1.editNode,_4,_2);return false}
}
}
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.A.editProxyConstructor="PortalLayoutEditProxy";isc.B.push(isc.A.addedToEditContext=function isc_PortalLayout_addedToEditContext(_1,_2){var _3=_1.getEditNodeTree();for(var i=0;i<this.getNumColumns();i++){var _5=this.getPortalColumn(i);if(!_5.editContext){var _6={_constructor:this.columnConstructor
};if(!_5._generated&&_5.$191x==null){_6.ID=_5.ID}
var _7=_1.makeEditNode({type:this.columnConstructor,liveObject:_5,defaults:_6
});_1.addNode(_7,_2,i,null,true);var _8=_5.getPortalRows();for(var j=0;j<_8.length;j++){var _10=_5.getPortalRow(j);if(!_10.editContext){var _6={_constructor:this.rowConstructor
};if(!_10._generated&&_10.$191x==null){_6.ID=_10.ID}
var _11=_1.makeEditNode({type:this.rowConstructor,liveObject:_10,defaults:_6
});_1.addNode(_11,_7,j,null,true);var _12=_10.getPortlets();for(var k=0;k<_12.length;k++){var _14=_10.getPortlet(k),_15=_14.component
;if(_15){if(_3.find(_15)){_1.removeNode(_15,null,true);_1.addNode(_15,_11,null,null,null,null,true)}
}
}
}
}
}
}
_2.defaults.numColumns=0;delete _2.defaults.portlets}
,isc.A.wrapChildNode=function isc_PortalLayout_wrapChildNode(_1,_2,_3,_4){var _5=_2.liveObject;if(isc.isA.PortalColumn(_5)){return _3}
var _6=this.getPortalColumn(0);if(!_6){this.addColumn(0);_6=this.getPortalColumn(0);if(!_6)return}
_3=_6.editNode;if(isc.isA.Portlet(_5)){return _3}else{var _7=_1.makeEditNode({type:"Portlet",defaults:{title:_2.title,destroyOnClose:true
}
});_1.addNode(_7,_3,_4);return _7}
}
);isc.B._maxIndex=isc.C+2}
if(isc.DynamicForm){isc.A=isc.DynamicForm.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.editProxyConstructor="FormEditProxy";isc.B.push(isc.A.setEditorType=function isc_DynamicForm_setEditorType(_1,_2){if(!_1.editContext||_1.type==_2)return;var _3=_1.editContext,_4=_3.getEditNodeTree(),_5=_1.editNode,_6=_4.getParent(_5),_7=_4.getChildren(_6).indexOf(_5),_8=_3.makePaletteNode(_5)
;isc.addProperties(_8,_3.findPaletteNode("type",_2)||this.findPaletteNode("className",_2));_8=_3.makePaletteNode(_8);_8.type=_2;var _9=_3.makeEditNode(_8);var _10=_4.getChildren(_5);if(_10){_10=_10.duplicate();for(var i=0;i<_10.length;i++){var _12=_3.getLiveObject(_10[i]);if(_3.isComponentSelected(_12)){_3.deselectComponents(_12,true)}
_3.removeNode(_10[i],true)}
}
var _12=_3.getLiveObject(_5);if(_3.isComponentSelected(_12)){_3.deselectComponents(_12,true)}
_3.removeNode(_5);var _13=_3.addNode(_9,_6,_7);if(_10){for(var i=0;i<_10.length;i++){_3.addNode(_10[i],_13)}
_3.delayCall("selectSingleEditNode",[_13])}
}
);isc.B._maxIndex=isc.C+1;isc.A=isc.FormItem.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.B.push(isc.A.setEditMode=function isc_FormItem_setEditMode(_1,_2,_3){if(_1==null)_1=true;if(this.editingOn==_1)return;this.editingOn=_1;if(this.editingOn){if(_2&&!isc.isAn.EditContext(_2)&&_2.getEditContext){_2=_2.getEditContext()}
this.editContext=_2}
this.editNode=_3;if(this.editingOn&&!this.editProxy){var _4=isc.Canvas.$145y(this.editContext);if(this.editNode&&this.editNode.editProxyProperties)isc.addProperties(_4,this.editNode.editProxyProperties);this.editProxy=this.createAutoChild("editProxy",_4)}
if(this.editProxy)this.editProxy.setEditMode(_1)}
,isc.A.setEditorType=function isc_FormItem_setEditorType(_1){if(this.form)this.form.setEditorType(this,_1)}
,isc.A.updateEditNode=function isc_FormItem_updateEditNode(_1,_2){var _3=_2.defaults&&_2.defaults.validators;if(_3&&(_3.find("_generated",true)||_3.find("$2399",true)||_3.find("$240a",true)))
{var _4=[];for(var i=0;i<_3.length;i++){var _6=_3[i];if(!_6._generated&&!_6.$2399&&!_6.$240a){_4.add(isc.addProperties({},_6))}
}
if(_4.length>0){_1.setNodeProperties(_2,{validators:_4
},true)}else{_1.removeNodeProperties(_2,["validators"])}
}
}
,isc.A.setEditableProperties=function isc_FormItem_setEditableProperties(_1){if(_1.validators){var _2=this.validators,_3=[]
;if(_2&&(_2.find("_generated",true)||_2.find("$2399",true)||_2.find("$240a",true)))
{var _3=[];for(var i=0;i<_2.length;i++){var _5=_2[i];if(_5._generated||_5.$2399||_5.$240a){_3.add(isc.addProperties({},_5))}
}
}
_3.addListAt(_1.validators,0);_1.validators=_3}
this.Super("setEditableProperties",arguments)}
);isc.B._maxIndex=isc.C+4;isc.A=isc.FileItem.getPrototype();isc.A.editProxyConstructor="FileItemEditProxy"
;isc.A=isc.UploadItem.getPrototype();isc.A.editProxyConstructor="FileItemEditProxy"
;isc.A=isc.TextItem.getPrototype();isc.A.editProxyConstructor="TextItemEditProxy"
;isc.A=isc.TextAreaItem.getPrototype();isc.A.editProxyConstructor="TextAreaItemEditProxy"
;isc.A=isc.StaticTextItem.getPrototype();isc.A.editProxyConstructor="TextItemEditProxy"
;isc.A=isc.BlurbItem.getPrototype();isc.A.editProxyConstructor="BlurbItemEditProxy"
;isc.A=isc.ButtonItem.getPrototype();isc.A.editProxyConstructor="ButtonItemEditProxy"
;isc.A=isc.ToolbarItem.getPrototype();isc.A.editProxyConstructor="ToolbarItemEditProxy"
;isc.A=isc.SelectItem.getPrototype();isc.A.editProxyConstructor="SelectItemEditProxy"
;isc.A=isc.ComboBoxItem.getPrototype();isc.A.editProxyConstructor="SelectItemEditProxy"
;isc.A=isc.SavedSearchItem.getPrototype();isc.A.editProxyConstructor="SavedSearchItemEditProxy"
;isc.A=isc.RadioGroupItem.getPrototype();isc.A.editProxyConstructor="RadioGroupItemEditProxy"
;isc.A=isc.CheckboxItem.getPrototype();isc.A.editProxyConstructor="CheckboxItemEditProxy"
;if(isc.DateItem){isc.A=isc.DateItem.getPrototype();isc.A.editProxyConstructor="DateItemEditProxy"
}
if(isc.SectionItem){isc.A=isc.SectionItem.getPrototype();isc.A.editProxyConstructor="SectionItemEditProxy"
}
if(isc.HeaderItem){isc.A=isc.HeaderItem.getPrototype();isc.A.editProxyConstructor="TextItemEditProxy"
}}
isc.A=isc.SectionStack.getPrototype();isc.A.editProxyConstructor="SectionStackEditProxy";isc.A=isc.SectionHeader.getPrototype();isc.A.editProxyConstructor="SectionStackSectionEditProxy";if(isc.ListGrid!=null){isc.A=isc.ListGrid.getPrototype();isc.A.editProxyConstructor="GridEditProxy"
}
if(isc.TileGrid!=null){isc.A=isc.TileGrid.getPrototype();isc.A.editProxyConstructor="TileGridEditProxy"
}
isc.$135q=function(){isc.DrawPane.addMethods({editProxyConstructor:"DrawPaneEditProxy"
});var _1=function(_6,_7,_8){if(_6==null)_6=true;if(this.editingOn==_6)return;this.editingOn=_6;if(this.editingOn){if(_7&&!isc.isAn.EditContext(_7)&&_7.getEditContext){_7=_7.getEditContext()}
this.editContext=_7}
this.editNode=_8;if(this.editingOn&&!this.editProxy){var _2=isc.Canvas.$145y(this.editContext);if(this.editNode&&this.editNode.editProxyProperties)isc.addProperties(_2,this.editNode.editProxyProperties);this.editProxy=this.createAutoChild("editProxy",_2)}
if(this.editProxy)this.editProxy.setEditMode(_6)};var _3=function(_6){var _4;if(!this.editModeOriginalValues)this.editModeOriginalValues={};for(var _5 in _6){if(this.editModeOriginalValues[_5]===_4){this.logInfo("Field "+_5+" - value is going to live values","editModeOriginalValues");this.setPropertyValue(_5,_6[_5])}else{this.logInfo("Field "+_5+" - value is going to original values","editModeOriginalValues");this.editModeOriginalValues[_5]=_6[_5]}
}
this.editablePropertiesUpdated(_6)};isc.DrawItem.addMethods({editProxyConstructor:"DrawItemEditProxy",setEditMode:_1,setEditableProperties:_3,updateEditNode:function(_6,_7){_6.setNodeProperties(_7,{shapeData:this.getShapeData()});_6.removeNodeProperties(_7,["rotation","translate","scale","xShearFactor","yShearFactor"])}
});isc.DrawLabel.addMethods({editProxyConstructor:"DrawLabelEditProxy",setEditMode:_1,setEditableProperties:_3
});isc.DrawLine.addProperties({updateEditNode:function(_6,_7){this.Super("updateEditNode",arguments);_6.setNodeProperties(_7,{startPoint:this.startPoint,endPoint:this.endPoint
},true);_6.removeNodeProperties(_7,["left","top","width","height"])}
});isc.DrawLinePath.addProperties({updateEditNode:function(_6,_7){this.Super("updateEditNode",arguments);_6.setNodeProperties(_7,{startPoint:this.startPoint,endPoint:this.endPoint
},true);_6.removeNodeProperties(_7,["left","top","width","height"])}
});isc.DrawCurve.addProperties({updateEditNode:function(_6,_7){this.Super("updateEditNode",arguments);_6.setNodeProperties(_7,{startPoint:this.startPoint,endPoint:this.endPoint,controlPoint1:this.controlPoint1,controlPoint2:this.controlPoint2
},true);_6.removeNodeProperties(_7,["left","top","width","height"])}
});isc.DrawPath.addProperties({updateEditNode:function(_6,_7){this.Super("updateEditNode",arguments);_6.setNodeProperties(_7,{points:this.points
},true);if(!isc.isA.DrawDiamond(this)){_6.removeNodeProperties(_7,["left","top","width","height"])}
}
});isc.DrawDiamond.addProperties({updateEditNode:function(_6,_7){this.Super("updateEditNode",arguments);_6.removeNodeProperties(_7,"points")}
})};if(isc.DrawPane!=null){isc.$135q()}else{isc.Page.setEvent("moduleLoaded",function(_1,_2){if(_2.moduleName=="Drawing"){isc.$135q()}
})}
isc.$1478=function(){isc.FacetChart.addProperties({editProxyConstructor:"FacetChartEditProxy",setEditableProperties:function(_3){if(_3.valueProperty){if(this.facetFields&&this.facetFields.contains(_3.valueProperty)){isc.warn("Cannot set Value Property to a field in Facet Fields. Change rejected.")
delete this.editNode.defaults.valueProperty;this.editContext.fireEditNodeUpdated(this.editNode,[]);return}
}else if(_3.facetFields&&this.valueProperty){var _1=_3.facetFields;for(var i=0;i<_1.length;i++){if(_1[i]==this.valueProperty){isc.warn("Cannot set Facet Fields with a field in Value Property. Change rejected.")
if(_1.length>1){this.editNode.defaults.facetFields.remove(_1[i])}else{delete this.editNode.defaults.facetFields}
this.editContext.fireEditNodeUpdated(this.editNode,[]);return}
}
}
this.Super("setEditableProperties",arguments)}
})};if(isc.FacetChart!=null){isc.$1478()}else{isc.Page.setEvent("moduleLoaded",function(_1,_2){if(_2.moduleName=="Charts"){isc.$1478()}
})}
if(isc.ScreenLoader){isc.A=isc.ScreenLoader.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.editProxyConstructor="ScreenLoaderEditProxy";isc.A.proxyLabelLayoutDefaults={_constructor:isc.HLayout,height:30,membersMargin:3,align:"center"
};isc.A.proxyLabelTitleDefaults={_constructor:isc.Label,autoParent:"proxyLabelLayout",height:30,autoFit:true,wrap:false,contents:"Screen:"
};isc.A.proxyLabelTextDefaults={_constructor:isc.Label,autoParent:"proxyLabelLayout",height:30,autoFit:true,wrap:false,styleName:"link",cursor:"pointer",canHover:true,getHoverHTML:function(){return"Go to screen \""+this.contents+"\""},click:function(){this.creator.proxyLabelClicked()}
};isc.B.push(isc.A.showProxyLabel=function isc_ScreenLoader_showProxyLabel(_1){this.setBorder("1px solid #0000EE");this.setMembers([]);this.addAutoChild("proxyLabelLayout");var _2=this.addAutoChild("proxyLabelTitle");if(_1){var _3=this.addAutoChild("proxyLabelText",{contents:this.screenName});_3.setContents(this.screenName)}else{_2.setContents(_2.contents+" "+this.screenName)}
}
,isc.A.proxyLabelClicked=function isc_ScreenLoader_proxyLabelClicked(){}
);isc.B._maxIndex=isc.C+2}
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.A.editProxyConstructor="EditProxy";isc.B.push(isc.A.getActionTargetTitle=function isc_ServiceOperation_getActionTargetTitle(){return"Operation: ["+this.operationName+"]"}
);isc.B._maxIndex=isc.C+1;if(isc.ValuesManager!=null){isc.A=isc.ValuesManager.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.editProxyConstructor="ValuesManagerEditProxy";isc.B.push(isc.A.setEditMode=function isc_ValuesManager_setEditMode(_1,_2,_3){if(_1==null)_1=true;if(this.editingOn==_1)return;this.editingOn=_1;if(this.editingOn){if(_2&&!isc.isAn.EditContext(_2)&&_2.getEditContext){_2=_2.getEditContext()}
this.editContext=_2}
this.editNode=_3;if(this.editingOn&&!this.editProxy){var _4=isc.Canvas.$145y(this.editContext);if(this.editNode&&this.editNode.editProxyProperties)isc.addProperties(_4,this.editNode.editProxyProperties);this.editProxy=this.createAutoChild("editProxy",_4)}
if(this.editProxy)this.editProxy.setEditMode(_1)}
);isc.B._maxIndex=isc.C+1}
isc.ClassFactory.defineClass("EditContext","Class");isc.A=isc.EditContext;isc.A.editNodePasteOffset=5;isc.A.$178k=["alwaysUsePlaceholder","canDuplicate","icon","iconSize","idName","idPrefix","placeholderProperties","placeholderImage","recreateOnChange","requiredProperties","showDropIcon","title","type"
];isc.A.$206n=["addToChild","alwaysAllowRootDrop","autoAddChild","canDragInPreview","canReparent","insertContainer","modalVisibility","restrictToTarget"
];isc.A=isc.EditContext;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$50a=["string","number","boolean","object","array"];isc.B.push(isc.A.copyPaletteNodeAttributes=function isc_c_EditContext_copyPaletteNodeAttributes(_1,_2){for(var i=0;i<isc.EditContext.$178k.length;i++){var _4=isc.EditContext.$178k[i];if(_2[_4]!=null){_1[_4]=_2[_4]}
}
}
,isc.A.copyPaletteNodeBehaviors=function isc_c_EditContext_copyPaletteNodeBehaviors(_1,_2){for(var i=0;i<isc.EditContext.$206n.length;i++){var _4=isc.EditContext.$206n[i];if(_2[_4]!=null){_1[_4]=_2[_4]}
}
}
,isc.A.manageTitleEditor=function isc_c_EditContext_manageTitleEditor(_1,_2,_3,_4,_5,_6,_7,_8){if(!isc.isA.DynamicForm(this.titleEditor)){var _9=isc.addProperties({name:"title",type:"text",showTitle:false},_1.editProxy.titleEditorDefaults,_1.editProxy.titleEditorProperties,{keyPress:function(_16,_17,_18){if(_18=="Escape"){_17.discardUpdate=true;_17.hide();if(_8)_8();return}
if(_18=="Enter")_16.blurItem()},blur:function(_17,_16){if(this.shouldDisallowEditorExit()){return false}
if(this.getHandle().contains(document.activeElement)){return}
_17.dismissEditor()}
}
);this.titleEditor=isc.DynamicForm.create({ID:"isc_titleEditor",autoDraw:false,margin:0,padding:0,cellPadding:0,fields:[_9
],saveOrDiscardValue:function(){if(!this.discardUpdate){var _10=this.targetComponent,_11=_10.editContext;if(_11){var _12=this.getValue("title"),_13=isc.EditContext.getTitleField(_1,this.titleField),_14={}
;if(_13=="title"&&_14[_13]==null&&_12==_10.name)
{return}
_14[_13]=_12;_11.setNodeProperties(_10.editNode,_14);if(_11.nodeClick)_11.nodeClick(_11,_10.editNode);_11.refreshSelectedAppearance(_10)}
}
},dismissEditor:function(){if(!this.isVisible()){return}
this.saveOrDiscardValue();this.hide();var _10=this.targetComponent;if(_10._eventMask){_10._eventMask.focus()}else if(isc.isA.Canvas(_10)){_10.focus()}else if(isc.isA.FormItem(_10)){if(_10.form)_10.form.focus();if(_10.$kk&&_10.$kk())_10.focusInItem()}
if(!this.discardUpdate&&_8)_8(this.getValue("title"));if(_10.editContext&&_10.editContext.inlineEditorShowing){_10.editContext.fireCallback("inlineEditorShowing","field,type",[null,"title"])}
}
})}
var _15=this.titleEditor;_15.setProperties({targetComponent:_1,titleField:_7});_15.discardUpdate=false;var _16=_15.getItem("title"),_12;if(_6){_12=_6}else{var _13=this.getTitleField(_1,_7);_12=_1[_13];if(_12==null&&_13=="title")_12=_1.name}
_16.setValue(_12);this.positionTitleEditor(_1,_2,_3,_4,_5);_15.show();_15.showClickMask({target:_15,methodName:"dismissEditor"
},"soft",[_15]);_16.focusInItem();if(!_6)_16.delayCall("selectValue",[],100);else _16.delayCall("setSelectionRange",[_6.length,_6.length]);if(_1.editContext&&_1.editContext.inlineEditorShowing){_1.editContext.fireCallback("inlineEditorShowing","field,type",[_16,"title"])}
}
,isc.A.getTitleField=function isc_c_EditContext_getTitleField(_1,_2){if(_2!=null)return _2;var _3="title";if((isc.isA.Label(_1)&&!isc.isA.SectionHeader(_1))||(isc.DrawPane&&isc.isA.DrawLabel(_1)))
{_3="contents"}else if(!(isc.DrawPane&&isc.isA.DrawItem(_1))&&!isc.isA.Button(_1)&&!isc.isA.ButtonItem(_1)&&!_1.showTitle)
{_3="defaultValue"}
return _3}
,isc.A.positionTitleEditor=function isc_c_EditContext_positionTitleEditor(_1,_2,_3,_4,_5){if(_4==null)_4=_1.getPageTop();if(_5==null)_5=_1.getVisibleHeight();if(_2==null)_2=_1.getPageLeft();if(_3==null)_3=_1.getVisibleWidth();var _6=this.titleEditor;var _7=_6.getItem("title");_7.setHeight(_5);_7.setWidth(_3);_6.setTop(_4);_6.setLeft(_2)}
,isc.A.selectCanvasOrFormItem=function isc_c_EditContext_selectCanvasOrFormItem(_1,_2,_3){if(!isc.isA.Canvas(_1)&&!isc.isA.FormItem(_1)&&!isc.isA.ValuesManager(_1)&&!_1.$73a){return}
if(isc.isA.Menu(_1)){return}
var _4;if(_1.$73a){_4=_1;_1=_1.$73a}
var _5=_4?_4.editContext:_1.editContext;if(!_5)return;if(_1.editProxy&&_1.editProxy.canSelect==false){if(_1.editingOn)_1.editContext.deselectAllComponents();return}
var _6=_5.getRootEditNode();if(_6.liveObject==_1)return;if(!_1.editNode)return;if(_5.allowNestedDrops==false){var _7=_5.getEditNodeTree();var _8=_7.getParent(_1.editNode);if(_8!=_6)return}
if(_4)_1=_4;if(_1.editingOn){var _9=_1.editContext;var _10=_1.editNode;if(_10){_9.selectSingleComponent(_1)}else{_9.deselectAllComponents()}
}
if(!_3&&(!isc.EH.lastEvent||isc.EH.lastEvent.eventType!="keyPress")&&(!this.titleEditor||!this.titleEditor.isVisible()||this.titleEditor.targetComponent!=_1)&&(!_1.editProxy||!_1.editProxy.inlineEditForm||!_1.editProxy.inlineEditForm.isVisible()))
{if(_1._eventMask){_1._eventMask.focus()}else if(isc.isA.Canvas(_1)){_1.focus()}else if(isc.isA.FormItem(_1)&&_1.form){if(!_1.form.isFocused()){_1.form.focus()}
if(_1.$kk&&_1.$kk()){_1.focusInItem()}
}
}
}
,isc.A.hideAncestorDragDropLines=function isc_c_EditContext_hideAncestorDragDropLines(_1){while(_1&&_1.parentElement){if(_1.parentElement.hideDragLine)_1.parentElement.hideDragLine();if(_1.parentElement.hideDropLine)_1.parentElement.hideDropLine();_1=_1.parentElement;if(isc.isA.FormItem(_1))_1=_1.form}
}
,isc.A.getSchemaInfo=function isc_c_EditContext_getSchemaInfo(_1){var _2={},_3=_1.liveObject;if(!_3)return _2;if(isc.isA.FormItem(_3)){if(_3.form&&_3.form.dataSource){var _4=_3.form;_2.dataSource=isc.DataSource.getDataSource(_4.dataSource).ID;_2.serviceName=_4.serviceName;_2.serviceNamespace=_4.serviceNamespace}else{_2.dataSource=_3.schemaDataSource;_2.serviceName=_3.serviceName;_2.serviceNamespace=_3.serviceNamespace}
}else if(isc.isA.Canvas(_3)&&_3.dataSource){_2.dataSource=isc.DataSource.getDataSource(_3.dataSource).ID;_2.serviceName=_3.serviceName;_2.serviceNamespace=_3.serviceNamespace}else{_2.dataSource=_3.schemaDataSource;_2.serviceName=_3.serviceName;_2.serviceNamespace=_3.serviceNamespace}
return _2}
,isc.A.clearSchemaProperties=function isc_c_EditContext_clearSchemaProperties(_1){if(_1&&_1.defaults&&isc.isA.FormItem(_1.liveObject)){delete _1.defaults.schemaDataSource;delete _1.defaults.serviceName;delete _1.defaults.serviceNamespace;var _2=_1.liveObject.form;if(_2&&_2.inputSchemaDataSource&&isc.DataSource.get(_2.inputSchemaDataSource).ID==_1.defaults.inputSchemaDataSource&&_2.inputServiceName==_1.defaults.inputServiceName&&_2.inputServiceNamespace==_1.defaults.inputServiceNamespace)
{delete _1.defaults.inputSchemaDataSource;delete _1.defaults.inputServiceName;delete _1.defaults.inputServiceNamespace}
}
}
,isc.A.serializeDefaults=function isc_c_EditContext_serializeDefaults(_1,_2,_3,_4){if(_1==null)return null;if(!isc.isAn.Array(_1))_1=[_1];var _5=isc.SB.create();isc.Comm.omitXMLNS=true;isc.Comm.omitXSI=true;try{var _6=_4&&_4.jsxMode,_7=_4&&_4.ignoreConstructor,_8=_4&&_4.componentSeparator||"\n\n"
;for(var i=0;i<_1.length;i++){var _10=_1[i],_11=_10.$97p,_12=isc.DS.getNearestSchema(_10),_13={indent:_2}
;if(_7)_13.ignoreConstructor=true;if(_6)_13.simpleTypesAsAttributes=true;if(_6)_13.useConstructorType=true;_5.append(_12.xmlSerialize(_10,_13,_3,_11),_8)}
if(_4&&_4.serializedStats){_4.serializedStats.topLevelCount=_1.length}
}finally{isc.Comm.omitXSI=null;isc.Comm.omitXMLNS=null}
return _5.release(false)}
,isc.A.serializeDefaultsAsJSON=function isc_c_EditContext_serializeDefaultsAsJSON(_1,_2){if(_1==null)return null;if(!isc.isAn.Array(_1))_1=[_1];for(var i=0;i<_1.length;i++){var _4=_1[i],_5=_4.$97p,_6=isc.DS.getNearestSchema(_4),_7=_5||(_6&&_6.ID)
;if(_4._constructor&&_4._constructor==_7){delete _4._constructor}
for(var _8=isc.getKeys(_4),j=_8.length;j>=0;j--){var _10=_8[j],_11=_6&&_6.getField(_10),_12=isc.isA.StringMethod(_4[_10])
;if(!_11&&!_12)delete _4[_10];if(_12){_4[_10]=_4[_10].getValue()}
}
_1[i]={type:_7,defaults:_4
}
}
var _13=_2?_2.indent:false,_14={prettyPrint:_13};return isc.JSON.encode(_1,_14)}
,isc.A.convertActions=function isc_c_EditContext_convertActions(_1,_2,_3){for(var _4 in _2){var _5=_2[_4];if(_5!=null&&((!isc.isAn.Object(_5)&&!isc.isA.String(_5))||isc.isA.StringMethod(_5)||(isc.FunctionRef&&isc.isA.FunctionRef(_5))))
{continue}
var _6;if(_3&&_3.getField)_6=_3.getField(_4).type;if(_6&&(_6!="StringMethod"))continue;var _7=_1.liveObject,_8=_7&&_7[_4]
;if(_8&&_8.$dw){_8=isc.Class.$ct(_4,_7)}
var _9=_8&&(_8.iscAction||_8._constructor=="Process");if(_9){_2[_4]=isc.StringMethod.create({value:_5})}else{if(_5==null){var _10=isc.ClassFactory.getClass(_1.type),_11;if(_10&&_10._stringMethodRegistry&&_10._stringMethodRegistry[_4]!==_11)
{delete _2[_4]}
}
if(!_7){var _10=isc.ClassFactory.getClass(_1.type),_11;if(_10&&_10._stringMethodRegistry&&_10._stringMethodRegistry[_4]!==_11)
{_2[_4]=isc.StringMethod.create({value:_10._stringMethodRegistry[_4]})}else{var _12=isc.DataSource.get(_1.type);if(_12){var _13=_12.getStringMethod(_4,_5);if(_13)_2[_4]=_13}
}
}
}
}
}
,isc.A.getNonNullProperties=function isc_c_EditContext_getNonNullProperties(_1){var _2={};for(var _3 in _1){if(_1[_3]!=null)_2[_3]=_1[_3]}
return _2}
,isc.A.$1941=function isc_c_EditContext__getTextAsIdentifier(_1,_2){_1=_1.replace(/\s/g,"_");if(!String.isValidID(_1))return;while(_2.hasOwnProperty(_1)){if(_1.match(/_([0-9])+$/)){_1=_1.replace(/_(([0-9])+)$/,function(_3,_4){return"_"+(parseInt(_4)+1)})}else{_1+="_1"}
}
return _1}
,isc.A.testNodeSchemaFieldProperty=function isc_c_EditContext_testNodeSchemaFieldProperty(_1,_2,_3,_4){if(_1==null)return false;var _5=isc.DS.get(_1.type);if(_5==null)return false;if(_2==null||_3==null){return false}
var _6=!_4;for(var _7 in _3){var _8=_5.fields[_7];if(!_8)continue;var _9=_8[_2];if(isc.isA.String(_9)&&_9.toLowerCase()==_6.toString()||isc.isA.Boolean(_9)&&_9==_6)
{return true}
}
return false}
,isc.A.createActionBinding=function isc_c_EditContext_createActionBinding(_1,_2,_3,_4,_5){var _6=this.$222o(_1.type,_2),_2=isc.isAn.XMLNode(_6)?isc.jsdoc.toJS(_6):_6;if(!_2)_2={};if(!_5&&this.logIsDebugEnabled("actionBinding")){this.logDebug("createActionBinding: "+_1.ID+"."+_2.name+" > "+_3.ID+"."+_4.name,"actionBinding");this.logDebug("createActionBinding: "+_1.ID+"."+_2.name+" > "+_3.ID+"."+_4.name+" --- , sourceMethod: "+this.echoFull(_2)+", action method: "+this.echoFull(_4),"actionBinding")}
var _7={target:_3.ID,name:_4.name
};if(isc.isA.ClassObject(_3.liveObject)){_7.type="static"}
var _8;if(_4.params){var _9=[],_10=false;_8=_2.params;if(!_8)_8=[];else if(!isc.isAn.Array(_8))_8=[_8];else _8=_8.duplicate();_8.add({name:"this",type:_1.type,pseudo:true
});for(var i=0;i<_4.params.length;i++){var _12=_4.params[i];if(!_5){this.logInfo("considering actionMethod "+_4.name+" param: "+_12.name+" of type "+_12.type,"actionBinding")}
var _13=_12.optional!=null&&_12.optional.toString()!="false"
;if(!_13||_12.type!=null&&!this.$50a.contains(_12.type.toLowerCase()))
{var _14=this.$222p(_4,_12,_8,_3.type);if(_14!=null){if(!_13||!_14.pseudo){_9[i]=_14.name;_14.$480=true;_10=true;continue}
}else if(!_13){if(!_5){this.logInfo("action binding failed, actionMethod param "+_12.name+" of type "+_12.type+" couldn't be fulfilled","actionBinding")}
return null}
}
_9[i]="null"}
for(var i=_4.params.length-1;i>=0;i--){if(_9[i]!="null")break;_9.removeAt(i)}
if(_10)_7.mapping=_9}
if(!_5&&this.logIsInfoEnabled("actionBinding")){this.logInfo("createActionBinding: "+_1.ID+"."+_2.name+" > "+_3.ID+"."+_4.name+": "+this.echoFull(_7),"actionBinding")}
if(_8)_8.setProperty("$480",null);return _7}
,isc.A.$222p=function isc_c_EditContext__getMatchingSourceParam(_1,_2,_3,_4){var _5=isc.DataSource.getNearestSchemaClass(_4),_6=this.$222q(_2.type)
;for(var j=0;j<_6.length;j++){var _8=_6[j],_9=isc.DS.get(_8)
;this.logInfo("selected type "+_8+" has schema: "+_9,"actionBinding");for(var i=0;i<_3.length;i++){var _11=_3[i];if(_11.$480)continue;this.logDebug("considering source param: "+_11.name+" of type "+_11.type,"actionBinding");var _12=this.$222q(_11.type)[0],_13=isc.DataSource.getNearestSchemaClass(_12)
;if(_5&&_5.classAllowedForParam&&!_5.classAllowedForParam(_1.name,_2.name,_13))
{continue}
var _14=isc.DS.get(_12);if(!_14){if(_8==_12)return _11;continue}
if(_14.inheritsSchema(_9)&&(_9.ID!="Object"||!isc.isAn.Instance(_14)))
{return _11}
}
}
}
,isc.A.$222q=function isc_c_EditContext__getActionTypes(_1){var _2=_1.split(/[ \t]*[|]+[ \t]*/);for(var i=0;i<_2.length;i++){var _1=_2[i];_1=_1.split(/[ \t]+/)[0];_1=_1.substring(0,1).toUpperCase()+_1.substring(1);_2[i]=_1}
return _2}
,isc.A.$222o=function isc_c_EditContext__getInheritedMethod(_1,_2){var _3;while(_1){var _4=isc.jsdoc.getDocItem("method:"+_1+"."+_2);if(_4!=null){if(_3){if(_4.cloneNode){_4=_4.cloneNode();isc.addProperties(_4,_3)}else{_4=isc.addProperties({},_4,_3)}
}
return _4}
var _5=isc.DS.get(_1);if(_5&&_5.methods&&!_3){var _6=_5.methods.find("name",_2);if(_6)_3=_6}
var _7=isc.ClassFactory.getClass(_1);if(_7==null)return null;_7=_7.getSuperClass();_1=_7&&_7.getClassName()}
return _3}
,isc.A.convertActionToProcessElement=function isc_c_EditContext_convertActionToProcessElement(_1,_2,_3){var _4=_1.target,_5
;if(isc.isA.String(_4))_4=window[_4];if(_2&&_4){var _6=this.$222o(_4.getClassName(),_1.name),_7=isc.isAn.XMLNode(_6)?isc.jsdoc.toJS(_6):_6
;var _8=isc.ClassFactory.getClass(_2),_9
;if(_8.createInitPropertiesFromAction){_9=_8.createInitPropertiesFromAction(_1,_7,_3)}
_5=_8.create(_9)}
return _5}
,isc.A.convertCustomActionToProcessElement=function isc_c_EditContext_convertCustomActionToProcessElement(_1){var _2,_3="Custom action code";if(isc.isAn.Array(_1)){for(var i=0;i<_1.length;++i){var v=_1[i];if(isc.isA.Function(v)&&v.iscAction==null){_2=isc.ScriptTask.create({description:_3,execute:v
})}
}
}else if(isc.isAn.String(_1)){var _6=isc.Func.expressionToFunction("",_1);_2=isc.ScriptTask.create({description:_3,execute:_6
})}
return _2}
);isc.B._maxIndex=isc.C+21;isc.A=isc.EditContext.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.persistCoordinates=true;isc.A.ptExtraPaletteDefaults={_constructor:"HiddenPalette",data:[{type:"ListGridField"}
]
};isc.A.wrapperFormDefaults={_constructor:"DynamicForm"
};isc.A.wrapperDrawPaneDefaults={_constructor:"DrawPane"
};isc.A.selectionType="multiple";isc.A.selectedBorder="1px dashed #44ff44";isc.A.selectedTintColor="#cccccc";isc.A.selectedTintOpacity=25;isc.A.hoopSelectionMode="encloses";isc.A.groupMaskDefaults={autoDraw:false,canFocus:true,$146g:true,border:"2px solid black",visibility:"hidden",overflow:"hidden",setSelection:function(_1){this.selection=_1;var _2=this.getComponentsBoundingBox(_1);this.setRect(_2)},getComponentsBoundingBox:function(_1){var _2=0,_3=0,_4=0,_5=0
;if(_1.length>0){_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<this.selection.length;i++){var _1=this.selection[i];if(this.isPercent(_1.left)||this.isPercent(_1.top))continue;if(_1.snapTo&&(this.isPercent(_1.snapOffsetLeft)||this.isPercent(_1.snapOffsetTop)))
{continue}
switch(isc.EH.getKey()){case"Arrow_Up":_9=[0,_7*-1];break;case"Arrow_Down":_9=[0,_7];break;case"Arrow_Left":_9=[_8*-1,0];break;case"Arrow_Right":_9=[_8,0];break;default:_10=null;break}
if(_9[0]!=0||_9[1]!=0){if(_1.snapTo){_1.setSnapOffsetLeft((_1.snapOffsetLeft||0)+_9[0]);_1.setSnapOffsetTop((_1.snapOffsetTop||0)+_9[1])}else{_1.moveBy(_9[0],_9[1])}
}
}
this.parentElement.$128p=false;return _10}
},$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(_1,_2){if(this.$146h)return;this.Super("moved",arguments);this.creator.$146j=true;this.parentElement.$128p=true;for(var i=0;i<this.selection.length;i++){this.selection[i].moveBy(_1,_2)}
this.parentElement.$128p=false;this.creator.$146j=false;this.showOverSelection()}
};isc.A.visibilityMaskManagerDefaults={_constructor:"VisibilityMaskManager"
};isc.A.maxUndoLogEntries=10;isc.B.push(isc.A.getDefaultPalette=function isc_EditContext_getDefaultPalette(){if(this.defaultPalette)return this.defaultPalette;return(this.defaultPalette=isc.HiddenPalette.create())}
,isc.A.setDefaultPalette=function isc_EditContext_setDefaultPalette(_1){this.defaultPalette=_1;if(_1&&!_1.defaultEditContext){_1.defaultEditContext=this}
}
,isc.A.init=function isc_EditContext_init(){this.Super("init",arguments);this.selectedComponents=[];this.editNodeTree=this.createEditNodeTree()}
,isc.A.destroy=function isc_EditContext_destroy(){if(this.editNodeTree){this.destroyAll();var _1=this.getRootEditNode();if(_1)this.destroyNode(_1);this.editNodeTree.destroy();delete this.editNodeTree}
this.Super("destroy",arguments)}
,isc.A.createEditNodeTree=function isc_EditContext_createEditNodeTree(){var _1=isc.addProperties({},this.rootComponent||{type:"Object"}),_2=this.rootLiveObject||_1
;if(!_1)_1={type:"Object"};if(this.useCopyPasteShortcuts){if(!_1.editProxyProperties)_1.editProxyProperties={};_1.editProxyProperties.useCopyPasteShortcuts=true}
if(!_1.type){_1.type=(isc.isA.Class(_1)?_1.Class:_1._constructor)}
if(_2&&!_1.liveObject){if(isc.isA.Canvas(_2)){_1.liveObject=_2}
}
var _3=this.makeEditNode(_1);return isc.Tree.create({idField:"ID",root:_3,isFolder:function(){return true},isOpen:function(_8){if(_8==null)_8=this.root;var _4=this.getChildren(_8),_5=isc.isAn.emptyArray(_4),_6=_8[this.childrenProperty];if(_5){_8[this.childrenProperty]=null}
var _7=this.Super("isFolder",arguments);if(_5){_8[this.childrenProperty]=_6}
return(_7?this.Super("isOpen",arguments):false)}
})}
,isc.A.switchEditMode=function isc_EditContext_switchEditMode(_1){var _2=this.getSelectedComponents();if(!_2||_2.length==0)return;for(var i=0;i<_2.length;i++){var _4=_2[i];if(_1){this.refreshSelectedAppearance(_4)}else if(_4.editProxy!=null){_4.editProxy.showSelectedAppearance(false)}
}
}
,isc.A.findPaletteNode=function isc_EditContext_findPaletteNode(_1,_2){var _3=this.getDefaultPalette().findPaletteNode(_1,_2);if(_3)return _3;if(this.extraPalettes){if(!isc.isAn.Array(this.extraPalettes))this.extraPalettes=[this.extraPalettes];for(var i=0;i<this.extraPalettes.length;i++){_3=this.extraPalettes[i].findPaletteNode(_1,_2);if(_3)return _3}
}
return null}
,isc.A.findPaletteNodeAtDepth=function isc_EditContext_findPaletteNodeAtDepth(_1,_2){var _3=[this.getDefaultPalette()];if(this.extraPalettes){if(!isc.isAn.Array(this.extraPalettes))_3.add(this.extraPalettes);else _3.addList(this.extraPalettes)}
var _4=this.$199z(_3,_1,_2);return _4}
,isc.A.$199z=function isc_EditContext__findPaletteNodeAtDepthInPalettes(_1,_2,_3){for(var i=0;i<_1.length;i++){var _5=_1[i].data,_6={}
;if(isc.isAn.Array(_5)){_8=_5.findIndex(_2,_3);if(_8)_6[0]=_8}else{var _7=_5.findNodeIndex(_2,_3);do{if(_7>=0){var _8=_5.getAllNodes()[_7],_9=_5.getLevel(_8)
;if(!_6[_9])_6[_9]=_8}
_7=_5.findNextNodeIndex(_7+1,_2,_3)}while(_7>=0)}
if(!isc.isAn.emptyObject(_6)){var _10=isc.getKeys(_6).map(function(_3){return parseInt(_3)}).max();return _6[_10]}
}
}
,isc.A.getEditNodeIDDescription=function isc_EditContext_getEditNodeIDDescription(_1,_2){if(!_1)return"";var _3="";if(!_2){if(_1.liveObject&&_1.liveObject.editProxy){var _4=_1.liveObject.editProxy;if(_4.getNodeDescription){var _5=_4.getNodeDescription(_1);if(_5&&_5.length>0){_3=" ["+_5+"]"}
}
}
if(_3.length==0){var _6=this.getEditNodeTree(),_7=_6.getParent(_1)
;if(_7&&_7.liveObject&&_7.liveObject.editProxy){var _4=_7.liveObject.editProxy;if(_4.getChildNodeDescription){var _5=_4.getChildNodeDescription(_1);if(_5&&_5.length>0){_3=" "+_5}
}
}
}
}
return String(_1.ID||_1.type).asHTML()+_3}
,isc.A.getTitleForType=function isc_EditContext_getTitleForType(_1){var _2=this.findPaletteNodeAtDepth("type",_1),_3=(_2?_2.title||_1:_1)
;return _3.replace(/<(\/)?b>/g,"")}
,isc.A.getTopLevelView=function isc_EditContext_getTopLevelView(){var _1=this.getEditNodeTree(),_2=this.getRootEditNode(),_3=_1.getChildren(_2),_4=null
;if(_3){for(var i=0;i<_3.length;i++){var _6=_3[i].liveObject;if(isc.isA.Canvas(_6)&&!_6.destroyed&&_6.visibility!=isc.Canvas.HIDDEN&&!_6.masterElement&&!_6.creator)
{_4=_6;break}
}
}
return _4}
,isc.A.addNode=function isc_EditContext_addNode(_1,_2,_3,_4,_5,_6,_7){if(!_7){this.recordAction("addNode",arguments)}
var _8=isc.DataSource.getNearestSchemaClass(_1.type);var _9=(isc.EditContext.shouldSuppressLiveObject&&isc.EditContext.shouldSuppressLiveObject(_1.type,_8));_5=_9||_5;if(_8&&(_8.isA(isc.DataSource)||_1.deferCreation)){if(_1.loadData&&!_1.isLoaded){var _10=this;var _11=isc.$75u;_1.loadData(_1,function(){var _12=isc.$75u;if(!_12&&_11)isc.$75u=true;if(_1.deferCreation){_1=_10.makeEditNode(_1)}
_10.addNode(_1,_2,_3,_4,_5,_6,_7);if(!_12&&_11)delete isc.$75u});return}
if(_1.liveObject&&_1.liveObject.unableToLoad&&!_1.liveObject.reportedUnableToLoad){_1.liveObject.setClientOnly(true);_1.liveObject.reportedUnableToLoad=true;if(!this.loadingErrors)this.loadingErrors=[];this.loadingErrors.add("Unable to load DataSource "+_1.ID)}
}
var _13=this.getEditNodeTree();var _14=this.getDefaultParent(_1);if(_2==null)_2=_14;var _15=this.getLiveObject(_2);this.logInfo("addNode will add newNode of type: "+_1.type+" to: "+this.echoLeaf(_15),"editing");if(_15.wrapChildNode){_2=_15.wrapChildNode(this,_1,_2,_3);if(!_2)return;_15=this.getLiveObject(_2)}
var _16=_4||isc.DS.getObjectField(_15,_1.type);var _17=isc.DS.getSchemaField(_15,_16);if(!_17&&!isc.isAn.Instance(_15)){var _18=isc.DS.getNearestSchema(_15);_17=_18&&_18.getField(_16)}
if(!_17&&!_5){if(!_8||!_8.isA(isc.DataSource)||_2!=_14){var _19="can't addNode: can't find a field in parent: "+_15+" for a new child of type: "+_1.type+", parent property:"+_16+", newNode is: "+this.echo(_1);if(isc.Reify&&isc.Reify.$2538)throw new Error(_19);else this.logWarn(_19)}
return}
if(_17&&!_17.multiple&&_17.destroyOnReplace!="false"){var _20=isc.DS.getChildObject(_15,_1.type,null,_4);if(_20&&!_1.generatedType&&(_20!=_1.liveObject||_6)){var _21=_13.getChildren(_2).find("ID",isc.DS.getAutoId(_20));if(_21){this.logWarn("destroying existing child: "+this.echoLeaf(_20)+" in singular field: "+_16);_13.remove(_21);if(isc.isA.Class(_20)&&!isc.isA.DataSource(_20)){_20.destroy()}
}
}
}
var _22,_23
;if(_1.generatedType){_22=isc.addProperties({},_1.defaults);this.serializeChildData(_22,_13.getChildren(_1));_1.liveObject=_22}else{_22=_1.liveObject;_23=(_22!=null)}
_22.editContext=this;_22.editNode=_1;var _24=_13.getChildren(_2);if(_3==null&&!_4&&_2==this.getRootEditNode()){var _25=isc.isA.Canvas(_22);if(_25){_3=_24.length}else{for(var i=0;i<_24.length;i++){if(isc.isA.Canvas(_24[i].liveObject)){_3=i;break}
}
}
}
var _27=_3;if(_27!=null&&_4){_27=0;for(var i=0;i<Math.min(_3,_24.length);i++){var _28=_24[i];if(_28.defaults&&_28.parentProperty==_4){_27++}
}
}else if(_27!=null){for(var i=0;i<Math.min(_3,_24.length);i++){if(isc.isA.DataSource(_24[i].liveObject)){_27--;break}
}
}
if(!_5){var _29=_15&&_15.editProxy;if(_29&&_29.adjustLiveIndex){_27=_29.adjustLiveIndex(_2,_1,_27,_16)}
try{var _30=isc.DS.addChildObject(_15,_1.type,_22,_27,_4);if(!_30){this.logWarn("addChildObject failed, returning");return}
}catch(e){if(!isc.EditContext.suppressPlaceholders){throw e}
}
}
if(!_1.liveObject||_1.generatedType){var _31=isc.DS.getChildObject(_15,_1.type,isc.DS.getAutoId(_1.defaults),_4,isc.DS.getUsedAutoIdField(_1.defaults));if(_31!=null)_1.liveObject=_31}
this.logDebug("for new node: "+this.echoLeaf(_1)+" liveObject is now: "+this.echoLeaf(_1.liveObject),"editing");if(_1.liveObject==null){this.logWarn("wasn't able to retrieve live object after adding node of type: "+_1.type+" to liveParent: "+_15+", does liveParent have an appropriate getter() method?")}
if(_4&&!this.jsxMode&&_4==isc.DS.getObjectField(_15,_1.type))
{_4=null}
if(_4)_1.parentProperty=_4;_13.add(_1,_2,_3);if(!isc.$75u){_13.openFolder(_1)}
if(isc.EditContext.screenMode&&(isc.isA.Canvas(_1.liveObject)||isc.isA.ValuesManager(_1.liveObject))){var _32=this.getTopLevelView();if(_32){if(!_32.$112o){_32.$112o={}}
_32.$112o[_1.ID]=_1.liveObject;_1.liveObject.$112p=_32}
}
this.logInfo("added node "+this.echoLeaf(_1)+" to EditTree at path: "+_13.getPath(_1)+" with live object: "+this.echoLeaf(_1.liveObject),"editing");this.$159o(_1,_2,_13.getRoot(),_7);if(_1.liveObject.addedToEditContext){_1.liveObject.addedToEditContext(this,_1,_2,_3)}
if(this.isNodeEditingOn(_1)&&_1.liveObject.editProxy&&_1.liveObject.editProxy.canSelectChildren&&!this.$159m)
{this.$159m=_1.liveObject}
if(!isc.$75u&&!_23&&_1.autoAddChild){var _33=_1.autoAddChild;if(!isc.isAn.Array(_33))_33=[_33];for(var i=0;i<_33.length;i++){var _34=_33[i];if(_34.ref){_34=this.findPaletteNode("refID",_34.ref)}
var _35=this.makeEditNode(_34);this.addNode(_35,_1)}
}
return _1}
,isc.A.addComponent=function isc_EditContext_addComponent(_1,_2,_3,_4,_5){return this.addNode(_1,_2,_3,_4,_5)}
,isc.A.getRootEditNode=function isc_EditContext_getRootEditNode(){return(this.getEditNodeTree()?this.getEditNodeTree().getRoot():null)}
,isc.A.reorderNode=function isc_EditContext_reorderNode(_1,_2,_3){var _4=this.getEditNodeTree();var _5=_4.getChildren(_1).get(_2);_4.remove(_5);_4.add(_5,_1,_3);this.fireEditNodeUpdated(_5,{})}
,isc.A.fireSubstitutedNode=function isc_EditContext_fireSubstitutedNode(_1,_2,_3){if(this.substitutedNode){this.substitutedNode(_1,_2,_3)}
}
,isc.A.fireConvertedNode=function isc_EditContext_fireConvertedNode(_1,_2,_3){if(this.convertedNode){this.convertedNode(_1,_2,_3)}
}
,isc.A.nodeAdded=function isc_EditContext_nodeAdded(_1,_2,_3){}
,isc.A.$159o=function isc_EditContext__nodeAdded(_1,_2,_3,_4){if(_1.useEditMask!=null){this.setEditProxyProperties(_1,{useEditMask:_1.useEditMask})}
if(this.nodeAdded&&!_4&&!isc.$75u){this.nodeAdded(_1,_2,_3)}
if(this.autoEditNewNodes!=false&&((this.creator&&this.creator.editingOn)||_2&&this.isNodeEditingOn(_2)))
{this.enableEditing(_1)}
}
,isc.A.nodeRemoved=function isc_EditContext_nodeRemoved(_1,_2,_3){}
,isc.A.$209g=function isc_EditContext__nodeRemoved(_1,_2,_3,_4){if(this.nodeRemoved&&!_4){this.nodeRemoved(_1,_2,_3)}
}
,isc.A.nodeMoved=function isc_EditContext_nodeMoved(_1,_2,_3,_4,_5){}
,isc.A.fireNodeMoved=function isc_EditContext_fireNodeMoved(_1,_2,_3,_4){var _5=this.getEditNodeTree(),_6=_5.getRoot()
;if(this.nodeMoved){this.nodeMoved(_1,_2,_3,_4,_6)}
if(_1.liveObject&&_1.liveObject.editProxy){_1.liveObject.editProxy.nodeMoved(_1,_2,_3,_4,_6)}
if(_1!=_3&&_3.liveObject&&_3.liveObject.editProxy){_3.liveObject.editProxy.nodeMoved(_1,_2,_3,_4,_6)}
var _7=_5.getChildren(_3);if(_7){for(var i=0;i<_7.length;i++){var _9=_7[i];this.fireNodeMoved(_9,_3,_9,_3)}
}
}
,isc.A.getDefaultParent=function isc_EditContext_getDefaultParent(_1,_2){return(this.defaultParent?this.defaultParent:this.getRootEditNode())}
,isc.A.addFromPaletteNode=function isc_EditContext_addFromPaletteNode(_1,_2,_3,_4,_5,_6,_7){var _8=this.makeEditNode(_1),_9=_8.type||_8.className,_10=isc.DataSource.getNearestSchemaClass(_9)
;if(_10&&_10.isA("FormItem")){var _11=(_2?_2.type||_2.className:null),_12=(_2?isc.DataSource.getNearestSchemaClass(_11):null)
;if(!_2||(_12&&!_12.isA("DynamicForm"))){var _13=this.addWithWrapper(_8,_2);return this.getEditNodeTree().getParent(_13)}
}
if(_1.dropped)_8.dropped=true;return this.addNode(_8,_2,_3,_4,_5,_6,_7)}
,isc.A.makeEditNode=function isc_EditContext_makeEditNode(_1){var _2=(_1.defaults?_1.defaults.autoDraw:null),_3=this.getDefaultPalette(),_4=_3.makeEditNode(_1,this),_5=(_4.defaults?_4.defaults.autoDraw:null)
;if(this.$210c&&_2==null&&_5==false){delete _4.defaults.autoDraw}
return _4}
,isc.A.getLiveObject=function isc_EditContext_getLiveObject(_1){var _2=this.getEditNodeTree();var _3=_2.getParent(_1);if(_3==null){return _1.liveObject}
var _4=_3.liveObject,_5=_1.parentProperty,_6=isc.DS.getChildObject(_4,_1.type,_1.ID,_5)
;if(_6)_1.liveObject=_6;return _1.liveObject}
,isc.A.requestLiveObject=function isc_EditContext_requestLiveObject(_1,_2,_3){var _4=this;if(_1.loadData&&!_1.isLoaded){_1.loadData(_1,function(_8){_8=_8||_1
_8.isLoaded=true;_8.dropped=_1.dropped;_4.fireCallback(_2,"node",[_8])},_3);return}
if(_1.wizardConstructor){this.logInfo("creating wizard with constructor: "+_1.wizardConstructor);var _5=isc.ClassFactory.newInstance(_1.wizardConstructor,_1.wizardDefaults);_5.getResults(_1,function(_8){if(!_8.liveObject){if(isc.isA.DataSource(_8.defaults)){var _6=_8.defaults,_7=_6.getSerializeableFields()
;_7._constructor=_6.getClassName();if(isc.isA.MockDataSource(_6)&&!_6.hasExplicitFields()){delete _7.fields;delete _7.testData;delete _7.cacheData}
_8.defaults=_7}
_8=_3.makeEditNode(_8)}
_4.fireCallback(_2,"node",[_8]);if(_5.markForDestroy)_5.markForDestroy();else if(_5.destroy)_5.destroy()},_3);return}
this.fireCallback(_2,"node",[_1])}
,isc.A.getParentNode=function isc_EditContext_getParentNode(_1){var _2=this.getEditNodeTree();return _2.getParent(_1)}
,isc.A.getEditNodeTree=function isc_EditContext_getEditNodeTree(){return this.editNodeTree}
,isc.A.getEditNodeArray=function isc_EditContext_getEditNodeArray(){return this.getEditNodeTree().getAllNodes()}
,isc.A.getEditComponents=function isc_EditContext_getEditComponents(){return this.getEditNodeArray()}
,isc.A.getEditNodesByType=function isc_EditContext_getEditNodesByType(_1,_2){_1=(!isc.isAn.Array(_1)?[_1]:_1);var _3=this.getEditNodeArray(),_4=[]
;for(var i=0;i<_3.length;i++){var _6=_3[i],_7=_6.liveObject
;if(_1.contains(_6.type)){_4.push(_6)}else if(!_2){var _8=isc.DS.getNearestSchemaClass(_6.type);if(_8==null){_8=isc.ClassFactory.getClass(_6.type)}
if(_8){for(var j=0;j<_1.length;j++){var _10=_1[j];if(_8.isA(_10)){_4.push(_6);break}
}
}
}
}
return _4}
,isc.A.editNodeHasDataSource=function isc_EditContext_editNodeHasDataSource(_1){var _2=this.getEditNodeTree(),_3=_2.getChildren(_1)
;for(var i=0;i<_3.length;i++){var _5=_3[i].liveObject;if(_5&&isc.isA.DataSource(_5)){return true}
}
return false}
,isc.A.editNodeHasFields=function isc_EditContext_editNodeHasFields(_1){var _2=this.getEditNodeTree(),_3=_2.getChildren(_1)
;return(_3&&(_3.length>1||(_3==1&&!this.editNodeHasDataSource(_1))))}
,isc.A.canAddToTarget=function isc_EditContext_canAddToTarget(_1,_2,_3,_4,_5){var _6=_1.liveObject;if(!isc.isA.Class(_6)){return(isc.DS.getObjectField(_1,_2)!=null)}
if(_6.editProxy){return _6.editProxy.canAddNode(_2,_3,_4,_5)}
return(_6.getObjectField(_2)!=null)}
,isc.A.removeAll=function isc_EditContext_removeAll(){var _1=this.getEditNodeTree();var _2=_1.getChildren(_1.getRoot()).duplicate();for(var i=0;i<_2.length;i++){this.removeNode(_2[i])}
this.resetUndoLog()}
,isc.A.destroyAll=function isc_EditContext_destroyAll(){this.deselectAllComponents();var _1=this.getEditNodeTree();var _2=this.keepUndoLog;this.keepUndoLog=false;var _3=_1.getChildren(_1.getRoot()).duplicate();for(var i=0;i<_3.length;i++){this.destroyNode(_3[i])}
this.defaultParent=null;this.resetUndoLog();this.keepUndoLog=_2}
,isc.A.removeNode=function isc_EditContext_removeNode(_1,_2,_3){this.recordAction("removeNode",arguments);var _4=this.getEditNodeTree();var _5=_4.getParent(_1);if(!_5)return;var _6=this.getLiveObject(_1);var _7=_5==null?null:this.getLiveObject(_5);if(this.isComponentSelected(_6))this.deselectComponents(_6);if(_7&&_7.editProxy&&_7.editProxy.beforeRemoveNode){_7.editProxy.beforeRemoveNode(_1)}
_4.remove(_1);if(_1==this.defaultParent)this.defaultParent=null;if(!_2){if(_7&&_6){isc.DS.removeChildObject(_7,_1.type,_6,_1.parentProperty)}
if(isc.isA.ValuesManager(_6)){var _4=this.getEditNodeTree(),_8=_4.getAllNodes()
;for(var i=0;i<_8.length;i++){var _10=_8[i];if(_10.defaults&&_10.defaults.valuesManager==_1.ID){_10.liveObject.valuesManager=null;this.removeNodeProperties(_10,"valuesManager")}
}
}
}
this.$209g(_1,_5,_4.getRoot(),_3)}
,isc.A.removeComponent=function isc_EditContext_removeComponent(_1,_2){return this.removeNode(_1,_2)}
,isc.A.destroyNode=function isc_EditContext_destroyNode(_1,_2,_3){this.recordAction("destroyNode",arguments);var _4=this.getLiveObject(_1);this.removeNode(_1,_2,_3);if(_4&&!_4.destroying&&_4.destroy&&!isc.isA.DataSource(_4)){_4.destroy()}
_1.liveObject=null}
,isc.A.destroyComponent=function isc_EditContext_destroyComponent(_1){return this.destroyNode(_1)}
,isc.A.getEditDataSource=function isc_EditContext_getEditDataSource(_1){return isc.DataSource.getDataSource(_1.editDataSource||_1.Class||this.editDataSource)}
,isc.A.$40l=function isc_EditContext__getEditFields(_1){var _2=[];_2.addList(_1.baseEditFields);_2.addList(_1.editFields);for(var i=0;i<_2.length;i++){var _4=_2[i];if(_4.visible==null)_4.visible=true}
if(_2.length==0){_2=this.getEditDataSource(_1).getFields();_2=isc.getValues(_2)}
return _2}
,isc.A.getEditFieldsList=function isc_EditContext_getEditFieldsList(_1){var _2=[],_3=this.$40l(_1);for(var i=0;i<_3.length;i++){var _5=_3[i];if(isc.isAn.Object(_5)){_2.add(_5.name)}else{_2.add(_5)}
}
return _2}
,isc.A.getEditFields=function isc_EditContext_getEditFields(_1){var _2=this.$40l(_1);for(var i=0;i<_2.length;i++){var _4=_2[i];if(isc.isA.String(_4))_4={name:_4};if(_4.visible==null)_4.visible=true;_2[i]=_4}
return _2}
,isc.A.serializeComponents=function isc_EditContext_serializeComponents(_1,_2){return this.serializeAllEditNodes({serverless:_1},_2)}
,isc.A.serializeAllEditNodes=function isc_EditContext_serializeAllEditNodes(_1,_2){var _3=this.getEditNodeTree();var _4=_2?[_3.root]:_3.getChildren(_3.root).duplicate();var _5=this.serializeEditNodes(_4,_1);return _5}
,isc.A.serializeAllEditNodesAsJSON=function isc_EditContext_serializeAllEditNodesAsJSON(_1,_2){var _3=this.getEditNodeTree();var _4=_2?[_3.root]:_3.getChildren(_3.root).duplicate();return this.serializeEditNodesAsJSON(_4,_1)}
,isc.A.serializeEditNodes=function isc_EditContext_serializeEditNodes(_1,_2){if(!_1)return null;return this.$1285(_1,_2)}
,isc.A.serializeEditNodesAsJSON=function isc_EditContext_serializeEditNodesAsJSON(_1,_2){if(!_1)return null;return this.$1285(_1,_2,"json")}
,isc.A.$1285=function isc_EditContext__serializeEditNodes(_1,_2,_3){try{if(_2&&_2.jsxMode){this.$278s()}
if(!isc.isAn.Array(_1))_1=[_1];this.serverless=(_2?_2.serverless:null);this.outputComponentsIndividually=_2&&_2.outputComponentsIndividually!=null?_2.outputComponentsIndividually:true;this.suppressAutoDraw=_2&&_2.suppressAutoDraw!=null?_2.suppressAutoDraw:true;var _4;if((!_2||!_2.suppressGetExtraComponents)&&_1&&_1.length>0&&this.getExtraComponentsToSerialize)
{_4=this.getExtraComponentsToSerialize()}
var _5=this.defaultsBlocks=[];if(_4)_5.addList(_4);this.map("getSerializeableTree",_1,null,true);var _6=_1.findAll("type","ValuesManager");if(_6&&_6.length>0){for(var i=0;i<_6.length;i++){var _8=_6[i],_9=_8.defaults,_10=_9&&_9.dataSource,_11=(_10?_5.find("ID",_10)||_5.find("loadID",_10):null)
;if(_10&&(!_11||_11.$schemaId!="DataSource")){var _12={_constructor:"DataSource",$schemaId:"DataSource",loadID:_10,loadParents:true
};_5.add(_12)}
}
}
this.suppressAutoDraw=null;this.outputComponentsIndividually=null;this.serverless=null;if(_2&&_2.separateComponents){_5=this.$174x()}
_5=this.$2163(_5);if(_2&&_2.suppressDataSources){var _13=[];for(var i=0;i<_5.length;i++){var _14=_5[i];if((_14._constructor=="DataSource"||_14._constructor=="DataSources")&&_14.loadID){_13.add(_14)}
}
if(_13.length>0){_5.removeAll(_13)}
}
return this.$174y(_5,_2,_3)}finally{if(_2&&_2.jsxMode){this.$278t()}
}
}
,isc.A.$278s=function isc_EditContext__startSerializingJsx(){var _1=isc.DS.get("Tab"),_2=_1.getField("pane")
;_2.multiple=true;var _1=isc.DS.get("SplitPane"),_3=_1.getField("navigationPane"),_4=_1.getField("listPane"),_5=_1.getField("detailPane")
;_3.multiple=true;_4.multiple=true;_5.multiple=true;var _1=isc.DS.get("DataSource"),_2=_1.getField("testData")
;delete _2.skipSerialization;this.$278u=true}
,isc.A.$278t=function isc_EditContext__finishSerializingJsx(){var _1=isc.DS.get("Tab"),_2=_1.getField("pane")
;delete _2.multiple;var _1=isc.DS.get("SplitPane"),_3=_1.getField("navigationPane"),_4=_1.getField("listPane"),_5=_1.getField("detailPane")
;delete _3.multiple;delete _4.multiple;delete _5.multiple;var _1=isc.DS.get("DataSource"),_2=_1.getField("testData")
;_2.skipSerialization=true;delete this.$278u}
,isc.A.$174y=function isc_EditContext___serializeEditNodes(_1,_2,_3){if(!isc.isAn.Array(_1)&&isc.isAn.Object(_1)){var _4={};for(var _5 in _1){if(!_1.hasOwnProperty(_5))continue;_4[_5]=this.$174y(_1[_5],_2,_3)}
return _4}
var _6=_2?_2.indent:(_3=="json"?false:true),_7=_2&&_2.initialIndent,_8={prettyPrint:_6}
;if(isc.isA.Function(_7))_7=_7(_1);return _3=="json"
?isc.EditContext.serializeDefaultsAsJSON(_1,_2)
:isc.EditContext.serializeDefaults(_1,_6,_7,_2)}
,isc.A.$174x=function isc_EditContext__getSeparatedDefaultsBlocks(){var _1=this,_2=0,_3=this.defaultsBlocks
;_3.setSort([{direction:"ascending",normalizer:function(_6){var _4=isc.ClassFactory.getClass(_6._constructor);if(!_4)return false;return _4.isA("Canvas")}}]);for(var i=0;i<_3.length;i++){var _4=isc.ClassFactory.getClass(_3[i]._constructor);if(!_4||!_4.isA("Canvas"))_2++};return{dataSources:_3.slice(0,_2),components:_3.slice(_2)}}
,isc.A.$2163=function isc_EditContext__consolidateDataSourceLoadBlocks(_1){var _2,_3={},_4=[]
;for(var i=0;i<_1.length;i++){var _6=_1[i];if(_6._constructor=="DataSource"&&_6.loadID){if(!_2){_2=_6;_6.$schemaId="DataSources";_6._constructor="DataSources";delete _6.loadParents;_4.add(_6)}else{_2.loadID+=","+_6.loadID}
}else{if(_6._constructor!="DataSource"||!_3[_6.ID]){_4.add(_6);if(_6._constructor=="DataSource"){_3[_6.ID]=true}
}
}
}
return _4}
,isc.A.getSerializeableTree=function isc_EditContext_getSerializeableTree(_1,_2,_3){var _4=_1.liveObject;if(_4&&_4.updateEditNode&&_4.editContext&&_4.editNode){_4.updateEditNode(_4.editContext,_4.editNode)}
var _5=_1.type,_6=isc.addProperties({},_1.defaults)
;var _7=isc.ClassFactory.getClass(_5);if(_6.hasStableID)delete _6.hasStableID;if(this.suppressAutoDraw&&_6.autoDraw!=null&&_6.autoDraw!==true){delete _6.autoDraw}
this.logInfo("node: "+this.echoLeaf(_1)+" with type: "+_5,"editing");if(_7&&_7.isA("FormItem")){var _8=_6._constructor,_9=_6.editorType
;if(_9&&isc.ClassFactory.getClass(_9)&&(!_8||_8!=_9))
{_6._constructor=_9}
}
if(_7&&_7.isA("DataSource")){if(this.defaultsBlocks){var _10=this.defaultsBlocks.find("ID",_6.ID)||this.defaultsBlocks.find("loadID",_6.ID);if(_10&&(_10.$schemaId=="DataSource"||this.$278u&&_10._constructor.endsWith("DataSource")))
{return}
}
var _11=_4&&_4.isA("DataSource"),_12=_11&&_4.clientOnly,_13=_11&&_4.isServerDS
;if(!this.serverless&&((this.$278u?_13:!_12)||_1.referenceInProject!=false||(_4&&_4.fromServer)))
{_6={_constructor:"DataSource",$schemaId:"DataSource",loadID:_6.ID,loadParents:true
}}else{var _14=_1.liveObject;if(!this.$278u){_6=_14.getSerializeableFields();_6._constructor=_14.Class;_6.$schemaId="DataSource"}
if(_14.hasSuperDS()){var _15=_14.superDS();while(_15){var _16=_15.getSerializeableFields();_16._constructor=_15.Class;_16.$schemaId="DataSource";if(this.defaultsBlocks)this.defaultsBlocks.add(_16);_15=_15.superDS()}
}
}
}
if(_7&&_7.isA("DrawItem")&&_6.fillGradient!=null&&isc.isA.String(_6.fillGradient)){_6.fillGradient="withID:"+_6.fillGradient}
isc.EditContext.convertActions(_1,_6,_7);var _17=this.getEditNodeTree().getChildren(_1);if(!_17){if(this.defaultsBlocks)this.defaultsBlocks.add(_6);return}
this.serializeChildData(_6,_17);if(_2)return _6;if(this.defaultsBlocks)this.defaultsBlocks.add(_6)}
);isc.evalBoundary;isc.B.push(isc.A.addChildData=function isc_EditContext_addChildData(_1,_2){return this.serializeChildData(_1,_2)}
,isc.A.serializeChildData=function isc_EditContext_serializeChildData(_1,_2){var _3=isc.DS.getNearestSchema(_1._constructor),_4
;for(var i=0;i<_2.length;i++){var _6=_2[i],_7=_6.defaults._constructor,_8=isc.addProperties({},_6.defaults),_9=_6.parentProperty||_3.getObjectField(_7),_10=_3.getField(_9);if(!_9&&_1._constructor=="DynamicForm"&&isc.isA.Canvas(_6.liveObject)){_9="children";_10=_3.getField(_9)}
if(!_4){var _11=this.getEditNodeTree().getParent(_6);if(_11&&_11.liveObject){_4=_11.liveObject.editProxy}
}
if(_4&&_4.canSaveChildNode&&!_4.canSaveChildNode(_6,_9))
{this.logInfo("serializing: child of type: "+_7+" for parent field: "+_9+" *IGNORED*","editing");continue}
this.logInfo("serializing: child of type: "+_7+" goes in parent field: "+_9,"editing");var _12=isc.ClassFactory.getClass(_6.type||_6.className),_13=(isc.isA.Canvas(_6.liveObject)||(_12&&_12.isA("Canvas"))),_14=(isc.DrawPane&&(isc.isA.DrawItem(_6.liveObject)||(_12&&_12.isA("DrawItem"))))
;var _15=((_13||_14)&&!_6.liveObject._generated
);if((this.outputComponentsIndividually&&_15)||isc.isA.DataSource(_6.liveObject)){if(isc.isA.DataSource(_6.liveObject)&&((_9=="dataSource")||(_9=="optionDataSource")))
{_8=_8.ID}else{_8="withID:"+_8[isc.DS.getUsedAutoIdField(_8)]}
this.getSerializeableTree(_6)}else{_8=this.getSerializeableTree(_6,true)}
var _16=_1[_9];if(_10&&_10.multiple){if(!_16)_16=_1[_9]=[];_16.add(_8)}else{_1[_9]=_8}
}
}
,isc.A.serializeEditComponents=function isc_EditContext_serializeEditComponents(){return this.serializeLiveObjects()}
,isc.A.serializeLiveObjects=function isc_EditContext_serializeLiveObjects(){var _1=this.getEditNodeArray(),_2=[];if(!_1)return[];for(var i=0;i<_1.length;i++){var _4=_1[i].liveObject,_5=_4.getUniqueProperties(),_6=this.getEditFieldsList(_4);_5._constructor=_4.Class;_5=isc.applyMask(_5,_6);_2.add(_5)}
return _2}
,isc.A.loadNodeTreeFromXML=function isc_EditContext_loadNodeTreeFromXML(_1){this.addPaletteNodesFromXML(_1)}
,isc.A.addPaletteNodesFromXML=function isc_EditContext_addPaletteNodesFromXML(_1,_2,_3,_4){var _5=this;isc.DMI.callBuiltin({methodName:"xmlToJS",arguments:[_1],callback:function(_6){_5.addPaletteNodesFromJS(_6.data,_2,_3,_4)}
})}
,isc.A.addPaletteNodesFromJSON=function isc_EditContext_addPaletteNodesFromJSON(_1,_2,_3,_4){if(_1==null)return;if(!isc.isA.String(_1)){if(isc.isAn.Object(_1)||isc.isAn.Array(_1)){this.logWarn("Passed a non-string JSON value - if passing JavaScript objects use addPaletteNodesFromJS() instead")}else{this.logWarn("Passed a non-string JSON value - ignored")}
return}
if(_3==null)_3=[];else if(!isc.isAn.Array(_3))_3=[_3];isc.captureDefaults=true;var _5;try{_5=isc.JSON.decode(_1)}catch(e){this.logWarn("JSON string could not be decoded")}
if(!_5)return;if(!isc.isAn.Array(_5)&&isc.isAn.Object(_5)){_5=[_5]}
if(_5&&_5.length>0&&!_5[0].type&&!_5[0].defaults)
{var _6=(_3.length==1&&_3[0]==isc.RPC.ALL_GLOBALS);for(var i=0;i<_5.length;i++){var _8=_5[i],_9=_8._constructor
;this.$2550(_8,_3);if(_9){delete _8._constructor;if(_8.ID&&!_6&&!_3.contains(_8.ID))_8.ID="_"+_8.ID;var _10=isc.ClassFactory.newInstance(_9,_8)}
}
isc.captureDefaults=null;var _11=this.getCapturedComponents();if(_11)this.$1288(_11,_3);if(_11)this.addFromPaletteNodes(_11,_2);this.fireCallback(_4,["paletteNodes"],[_11]);return}
isc.captureDefaults=null;for(var i=_5.length-1;i>=0;i--){var _8=_5[i],_12=_8.type||_8.className,_13=isc.ClassFactory.getClass(_12)
;if(isc.isA.DataSource(_13)){var _14=_8.defaults;if(_14.loadID){var _15=_14.loadID.split(","),_16=[]
;for(var j=0;j<_15.length;j++){_16.add(this.makeDSPaletteNode(_15[j]))}
if(_16.length>0){_5.removeAt(i);_5.addListAt(_16,i)}
}
}
}
var _3={};for(var i=0;i<_5.length;i++){this.$2258(_5[i],_3)}
for(var i=0;i<_5.length;i++){this.$1287(_5[i],_3)}
if(_3==null)_3=[];else if(!isc.isAn.Array(_3))_3=[_3];this.$1288(_5,_3);this.addFromPaletteNodes(_5,_2);this.fireCallback(_4,["paletteNodes"],[_5])}
,isc.A.$2258=function isc_EditContext__extractGlobals(_1,_2){for(var _3 in _1){var _4=_1[_3];if(isc.isAn.Array(_4)){for(var i=0;i<_4.length;i++){if(isc.isAn.Object(_4[i])){this.$2258(_4[i],_2)}
}
}else if(isc.isAn.Object(_4)){this.$2258(_4,_2)}
}
var _6=_1.type||_1.className,_7=_6&&isc.DS.getNearestSchema(_6),_8=_7&&isc.DS.getAutoId(_1.defaults||{})
;if(_8){_2[_8]=_1}
}
,isc.A.$1287=function isc_EditContext__replaceRefs(_1,_2){for(var _3 in _1){var _4=_1[_3];if(isc.isAn.Array(_4)){for(var i=0;i<_4.length;i++){if(isc.isA.String(_4[i])&&_4[i].startsWith("withID:")){var _6=_4[i].replace("withID:","");_4[i]=_2[_6]}else if(isc.isAn.Object(_4[i])){this.$1287(_4[i],_2)}
}
}else if(isc.isAn.Object(_4)){this.$1287(_4,_2)}else if(isc.isA.String(_4)&&_4.startsWith("withID:")){var _6=_4.replace("withID:","");_1[_3]=_2[_6]}
}
}
,isc.A.$2550=function isc_EditContext__replaceRefsLegacy(_1,_2){var _3=(_2.length==1&&_2[0]==isc.RPC.ALL_GLOBALS);for(var _4 in _1){var _5=_1[_4];if(isc.isAn.Array(_5)){for(var i=0;i<_5.length;i++){if(isc.isA.String(_5[i])&&_5[i].startsWith("ref:")){var _7=_5[i].replace("ref:","");if(!_3&&!_2.contains(_7))_7="_"+_7;_5[i]=window[_7]}else if(isc.isAn.Object(_5[i])){this.$2550(_5[i],_2)}
}
}else if(isc.isAn.Object(_5)){this.$2550(_5,_2)}
}
}
,isc.A.$1288=function isc_EditContext__removeIDs(_1,_2){var _3=(_2.length==1&&_2[0]==isc.RPC.ALL_GLOBALS);if(_1.ID&&!_3&&!_2.contains(_1.ID))delete _1.ID;for(var _4 in _1){if(_4=="defaults")continue;var _5=_1[_4];if(isc.isAn.Array(_5)){for(var i=0;i<_5.length;i++){if(isc.isAn.Object(_5[i])){this.$1288(_5[i],_2)}
}
}else if(isc.isAn.Object(_5)){this.$1288(_5,_2)}
}
}
,isc.A.getPaletteNodesFromXML=function isc_EditContext_getPaletteNodesFromXML(_1,_2){var _3=this;isc.DMI.callBuiltin({methodName:"xmlToJS",arguments:[_1,true],callback:function(_4){_3.getPaletteNodesFromJS(_4.data,_2)}
})}
,isc.A.loadNodeTreeFromJS=function isc_EditContext_loadNodeTreeFromJS(_1){return this.addPaletteNodesFromJS(_1)}
,isc.A.addPaletteNodesFromJS=function isc_EditContext_addPaletteNodesFromJS(_1,_2,_3,_4){if(_3==null)_3=[];else if(!isc.isAn.Array(_3))_3=[_3];var _5=this;this.getPaletteNodesFromJS(_1,function(_6){if(_6)_5.addFromPaletteNodes(_6,_2);_5.fireCallback(_4,["paletteNodes"],[_6])},_3)}
,isc.A.getPaletteNodesFromJS=function isc_EditContext_getPaletteNodesFromJS(_1,_2,_3){if(_3==null)_3=[];else if(!isc.isAn.Array(_3))_3=[_3];var _4=this;isc.captureDefaults=true;isc.capturedComponents=null;if(_3.length==1&&_3[0]==isc.RPC.ALL_GLOBALS){isc.Class.globalEvalWithCapture(_1,function(_6,_7){isc.captureDefaults=null;var _5=_4.getCapturedComponents(_7);if(_5)_4.$1288(_5,_3);_4.fireCallback(_2,["paletteNodes"],[_5])},null,false)}else{isc.Class.globalEvalAndRestore(_1,_3,function(_6,_7){isc.captureDefaults=null;var _5=_4.getCapturedComponents(_7);if(_5)_4.$1288(_5,_3);if(_5)_4.$167x(_5);_4.fireCallback(_2,["paletteNodes"],[_5])},null,false)}
isc.captureDefaults=null}
,isc.A.getCapturedComponents=function isc_EditContext_getCapturedComponents(_1){if(_1){isc.warn("The following error occurred during loading of your view<br><br>: "+_1+".<br><br>  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,_3,_4,_5,_6){var _7=this.getEditNodeTree();if(!_2)_2=_7.getRoot();var _8=_7.getChildren(_7.getRoot());if(!_8||_8.length==0){this.$210c=true}
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 _10,_11;for(var i=0;i<_1.length;i++){_10=_1[i];var _12=_10.type||_10.className,_13=_12
;if(_12=="Placeholder"){_12=_10.defaults&&_10.defaults.placeholderDefaults&&_10.defaults.placeholderDefaults.placeholderFor}
if(_12){var _14=this.findPaletteNode("type",_12)||this.findPaletteNode("className",_12);if(_14){if(_10.editProxyProperties||_14.editProxyProperties){_10.editProxyProperties=isc.addProperties({},_14.editProxyProperties,_10.editProxyProperties)}
isc.EditContext.copyPaletteNodeAttributes(_10,_14);isc.EditContext.copyPaletteNodeBehaviors(_10,_14);if(_13=="Placeholder"){_10.type=_13}
}
}
_10.component=this.makeEditNode(_10)}
for(var i=0;i<this.componentsToCreate.length;i++){_10=this.componentsToCreate[i];if(!_10.component){var _12=_10.type||_10.className,_13=_12
;if(_12=="Placeholder"){_12=_10.defaults&&_10.defaults.placeholderDefaults&&_10.defaults.placeholderDefaults.placeholderFor}
if(_12){var _14=this.findPaletteNode("type",_12)||this.findPaletteNode("className",_12);if(_14){if(_10.editProxyProperties||_14.editProxyProperties){_10.editProxyProperties=isc.addProperties({},_14.editProxyProperties,_10.editProxyProperties)}
isc.EditContext.copyPaletteNodeAttributes(_10,_14);isc.EditContext.copyPaletteNodeBehaviors(_10,_14);if(_13=="Placeholder"){_10.type=_13}
}
}
_10.component=this.makeEditNode(_10)}
}
var _15=-1,_16=this.addComponentCalls,_17=[];if(_6!=false){isc.$75u=true;delete this.loadingErrors}
var _18=[];while(_16.length>0&&_15!=_16.length){_15=_16.length;var _19=_16.duplicate();for(var i=0;i<_19.length;i++){var _20=_19[i],_11=_20[1],_10=_20[0],_21=_11.liveObject
;_4=_20[2]||_4;if(_11.name=="/"){var _22=this.addNode(_10.component,_2,null,null,null,null,_5);_18.add(_22);_16.remove(_20);_17.add(_20)}else if(_7.getAllNodes().contains(_11.component)){var _23=_10.component;if(_7.getAllNodes().contains(_23)){_23=isc.addProperties({},_23);_23.defaults=isc.clone(_23.defaults)}
var _22=this.addNode(_23,_11.component,_3,_4,null,null,_5);if(_11.component==_2){_18.add(_22)}
_16.remove(_20);_17.add(_20)}else if(_21&&_7.getAllNodes().contains(_21.editNode)){var _23=_10.component;if(_7.getAllNodes().contains(_23)){_23=isc.addProperties({},_23);_23.defaults=isc.clone(_23.defaults)}
var _22=this.addNode(_23,_21.editNode,_3,_4,null,null,_5);if(_21.editNode==_2){_18.add(_22)}
_16.remove(_20);_17.add(_20)}
_3=null;_4=null}
}
_7.openAll();if(_6!=false)delete isc.$75u;if(this.$210c)delete this.$210c;if(this.logIsDebugEnabled("loadProject")){this.logDebug("addComponent() calls during project loading:","loadProject");for(var i=0;i<_17.length;i++){var _20=_17[i],_11=_20[1],_10=_20[0];this.logDebug("addComponent("+this.echoLeaf(_10)+","+this.echoLeaf(_11),"loadProject"
)}
}
if(_16.length>0){this.logWarn("the following components could not be added to the project tree: "+isc.echoAll(_16.getProperty("0"))
)}
return _18}
,isc.A.createPaletteNodeTree=function isc_EditContext_createPaletteNodeTree(_1){if(!this.defaultPalette||(isc.isA.HiddenPalette(this.defaultPalette)&&!this.defaultPalette.data)){var _2=this.createAutoChild("ptExtraPalette");this.setDefaultPalette(_2)}
var _3={type:"EditPane"
};var _4=isc.Tree.create({root:_3
});var _5=_4.getRoot();this.componentsToCreate=[];this.addComponentCalls=[];this.requiredDataSources=[];for(var i=0;i<_1.length;i++){this.findChildPaletteNodes(null,_1[i],null,_1,true)}
for(var i=0;i<_1.length;i++){if(!_1[i].hasParent){this.findChildPaletteNodes(_5,_1[i],null,_1,true)}
}
var _7=-1,_8=this.addComponentCalls,_9=[];var _10=[];while(_8.length>0&&_7!=_8.length){_7=_8.length;var _11=_8.duplicate();for(var i=0;i<_11.length;i++){var _12=_11[i],_13=_12[1],_14=_12[0],_15=_12[2]
;if(_14.type=="DataSource"){if(isc.isA.DataSource(_14.defaults)){_14.dsType=_14.defaults.getClassName()}
_14.defaults={ID:_14.ID};_14.title=_14.ID}
if(_13.name=="/"){delete _14.$177g;delete _14.hasParent;var _16=_4.add(_14,_5);_10.add(_16);_8.remove(_12);_9.add(_12)}else if(_4.getAllNodes().contains(_13)){delete _14.$177g;var _17=_14.component;if(_4.getAllNodes().contains(_14)){_17=isc.addProperties({},_17);_17.defaults=isc.clone(_17.defaults)}
delete _14.hasParent;var _16=_4.add(_14,_13);if(_13==_5){_10.add(_16)}
_8.remove(_12);_9.add(_12)}
}
}
if(this.logIsDebugEnabled("loadProject")){this.logDebug("addComponent() calls during project loading:","loadProject");for(var i=0;i<_9.length;i++){var _12=_9[i],_13=_12[1],_14=_12[0];this.logDebug("addComponent("+this.echoLeaf(_14)+","+this.echoLeaf(_13),"loadProject"
)}
}
if(_8.length>0){this.logWarn("the following components could not be added to the palette node tree: "+isc.echoAll(_8.getProperty("0"))
)}
return _4}
,isc.A.addPaletteNodeDefaults=function isc_EditContext_addPaletteNodeDefaults(_1){if(_1==null)return;var _2=_1.type||_1.className,_3=_2
;if(_2=="Placeholder"){_2=_1.defaults&&_1.defaults.placeholderDefaults&&_1.defaults.placeholderDefaults.placeholderFor}
if(_2){var _4=this.findPaletteNode("type",_2)||this.findPaletteNode("className",_2);if(_4){if(_1.editProxyProperties||_4.editProxyProperties){_1.editProxyProperties=isc.addProperties({},_4.editProxyProperties,_1.editProxyProperties)}
isc.EditContext.copyPaletteNodeAttributes(_1,_4);isc.EditContext.copyPaletteNodeBehaviors(_1,_4);if(_3=="Placeholder"){_1.type=_3}
}
}
}
,isc.A.addPaletteNodeFormItemConstructors=function isc_EditContext_addPaletteNodeFormItemConstructors(_1){var _2=_1.getAllNodes(),_3=_2.filter(function(_21){var _4=_21.type||_21.className,_5=isc.DS.getNearestSchema(_4),_6=_5&&isc.DS.getNearestSchemaClass(_5)
;if(_6&&_6.isA("DynamicForm")){return _21}
})
;for(var i=0;i<_3.length;i++){var _8=_3[i],_9=null,_10=_1.getChildren(_8).filter(function(_21){if(_21.type=="DataSource"){_9=_21}else{return _21}
}),_11=null
;if(_9){_11=isc.DS.get(_9.ID)}
var _12=isc.DynamicForm.create({dataSource:_11,useAllDataSourceFields:false
},_8.defaults);for(var j=0;j<_10.length;j++){var _14=_10[j],_15=isc.clone(_14.defaults),_16=_12.bindToDataSource([_15]).find("name",_15.name),_17=_12.getEditorType(_16),_18=isc.FormItemFactory.getItemClass(_17),_19=_18&&_18.getClassName()
;if(_18){if(!_19.startsWith("Native")){var _20=_14.defaults;_20._constructor=_19;_20.$97p=_19;delete _20.type;if(_20.editorType==_19){delete _20.editorType}
}
}
}
_12.markForDestroy()}
}
,isc.A.addFromPaletteNodeTree=function isc_EditContext_addFromPaletteNodeTree(_1,_2,_3,_4,_5,_6){var _7=this.getEditNodeTree();if(!_2)_2=_7.getRoot();var _8=_7.getChildren(_7.getRoot());if(!_8||_8.length==0){this.$210c=true}
if(_6!=false){isc.$75u=true;delete this.loadingErrors}
var _9=[];var _10=_1.getRoot(),_11=this;this.$260g(_1,_10,function(_16){if(_16!=_10){_11.addPaletteNodeDefaults(_16);var _12=_1.getParent(_16),_13=_12.component,_14=_11.makeEditNode(_16),_15=null;if(_12==_10){_15=_11.addNode(_14,_2,null,null,null,null,_5);_9.add(_15)}else{_15=_11.addNode(_14,_13,_3,_4,null,null,_5)}
_16.component=_15;_4=null;_3=null}
});_7.openAll();if(_6!=false)delete isc.$75u;if(this.$210c)delete this.$210c;return _9}
,isc.A.$260g=function isc_EditContext__traverseTree(_1,_2,_3){_3(_2);var _4=_1.getChildren(_2);if(_4){var _5=_4.getLength();for(var i=0;i<_5;++i){var _7=_4[i];if(!_7)continue;this.$260g(_1,_7,_3)}
}
}
,isc.A.getLoadingErrors=function isc_EditContext_getLoadingErrors(){return this.loadingErrors}
,isc.A.screenLoadComplete=function isc_EditContext_screenLoadComplete(){var _1=this.getEditNodeTree(),_2=_1.getAllNodes()
;for(var i=0;i<_2.length;i++){var _4=_2[i],_5=_4.liveObject,_6=_5.editProxy
;if(_6&&_6.loadComplete){_6.loadComplete()}
}
}
,isc.A.makeDSPaletteNode=function isc_EditContext_makeDSPaletteNode(_1,_2){var _3=this.jsxMode;var _4={ID:_1,type:"DataSource",dsType:_2||"DataSource",title:_1,icon:"DataSource.png",iconSize:16,defaults:{ID:_1},loadData:function(_4,_7){var _5=this;isc.ClassFactory.$180h(true);isc.DS.get(_4.ID,function(_8){isc.ClassFactory.$180h(null);var _6=isc.DS.get(_8);if(!_6){return}
if(!_3)_6.isServerDS=true;_4.liveObject=_6;_4.defaults={_constructor:"DataSource",ID:_6.ID
};_4.isLoaded=true;if(_7)isc.Class.fireCallback(_7,"",[_4])},{loadParents:true})}
};return _4}
,isc.A.findChildPaletteNodes=function isc_EditContext_findChildPaletteNodes(_1,_2,_3,_4,_5){var _6=_2.type||_2.className;var _7=this.logIsInfoEnabled("loadProject"),_8=this.logIsDebugEnabled("loadProject");if(_7){this.logInfo("inspecting defaults of component: "+this.echoLeaf(_2)+" of type: "+_6,"loadProject"
)}
var _9=_2.defaults,_10=this;var _11=[],_12=[],_13=isc.DS.get(_6),_14=isc.ClassFactory.getClass(_6)
;if(isc.isA.DataSource(_14))_9={};for(var _15 in _9){var _16=_9[_15];if(!isc.isAn.Array(_16)){_12[0]=_16;_16=_12}else if(_8){this.logDebug("checking Array property: "+_15+", value: "+this.echoLeaf(_16)+(_20?" with schema: "+_20:""),"loadProject"
)}
var _17=_13?_13.getField(_15):null,_18=_17&&_17.name,_19=_17?_17.type:null,_20=isc.DS.get(_19),_21=false;for(var i=0;i<_16.length;i++){var _23=_16[i];if(_8){this.logDebug("checking property: "+_15+", value: "+this.echoLeaf(_23),"loadProject"
)}
if(_23==null){this.logInfo("null property: "+_15+" on component: "+this.echoLeaf(_2));continue}
if(_4.contains(_23)){if(_7){this.logInfo("found capturedComponent: "+this.echoLeaf(_23)+" under property: "+_15+" of component: "+this.echoLeaf(_2),"loadProject"
)}
_11.add([_15,_23]);_21=true;continue}
var _24=(_23?_23._constructor:null)||_19,_25=isc.ClassFactory.getClass(_24);if(_20&&((_25&&_25.isA(isc.Canvas))||(_25&&_25.isA(isc.DataSource))||(_25&&_25.isA(isc.FormItem))||(this.findPaletteNode("type",_24))||(this.findPaletteNode("className",_24))
)&&(_18=="dynamicProperties"||(!isc.endsWith(_18,"Properties")&&!isc.endsWith(_18,"Defaults")))
){if(this.jsxMode&&isc.isAn.Object(_23)){var _26=isc.getKeys(_23),_27=false
;for(var j=0;j<_26.length;j++){if(isc.Reify.$257g.test(_26[j])){_27=true;break}
}
if(_27){continue}
}
if(_7){this.logInfo("found palettized component: "+this.echoLeaf(_23)+" of type: "+_24+" under property: "+_15+" of component: "+this.echoLeaf(_2),"loadProject"
)}
if(isc.isA.String(_23)){var _29=_4.find("ID",_23);if(_29==null){if(isc.DataSource.isA(_19)){var _30=this.findPaletteNode("ID",_23);if(true){_29=this.makeDSPaletteNode(_23)}
}
if(this.jsxMode&&_29==null&&_14.isA("Window")){if(_18=="headerControls"||_18=="footerControls"){var _31="Window"+_23.substring(0,1).toUpperCase()+_23.substring(1);if(_31=="WindowSpacer")_31="WindowFooterSpacer";if(isc.ClassFactory.getClass(_31)){_11.add([_15,{type:_31,parentProperty:"headerControls"
}])}
}
}
if(_29==null)continue}
_11.add([_15,_29])}else{var _32=_23;_11.add([_15,{ID:_32.ID,name:_32.name,type:_24,defaults:_32
}])}
_21=true}
}
if(_21)delete _9[_15]}
var _33=this.findPaletteNode("type",_6)||this.findPaletteNode("className",_6);if(_33&&!_5){_2.icon=_2.icon||_33.icon;_2.iconSize=_2.iconSize||_33.iconSize;_2.showDropIcon=_2.showDropIcon||_33.showDropIcon}
this.componentsToCreate.add(_2);if(_1!=null){_2.hasParent=true;this.addComponentCalls.add([_2,_1,_3])}
if(_11.length>0){for(var i=0;i<_11.length;i++){this.findChildPaletteNodes(_2,_11[i][1],_11[i][0],_4,_5)}
}
}
,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)return;if(_2.setEditMode){_2.setEditMode(true,this,_1)}else{Object.defineProperty(_2,"editContext",{value:this,writable:true,configurable:true});Object.defineProperty(_2,"editNode",{value:_1,writable:true,configurable:true});_2.editingOn=true}
}
,isc.A.getNodeProperty=function isc_EditContext_getNodeProperty(_1,_2){var _3=_1.defaults||{};return _3[_2]}
,isc.A.setNodeProperties=function isc_EditContext_setNodeProperties(_1,_2,_3,_4){this.recordAction("setNodeProperties",arguments);if(this.logIsDebugEnabled("editing")){this.logDebug("with editNode: "+this.echoLeaf(_1)+" applying properties: "+this.echo(_2),"editing")}
if(!_1.defaults)_1.defaults={};var _5=isc.DS.getSchema(_1);var _6=_1.defaults,_7=false,_8,_9
;for(var _10 in _2){var _11=(_5?_5.getField(_10):null)||{},_12=(_11.type=="DataSource"||_11.editorType=="ProjectDataSourcePicker"),_13=(_12&&(_11.name=="dataSource"||_11.type=="DataSource"))
;if(_2[_10]==null&&_13){_8=true;_9=_2[_10];delete _2[_10]}else if(_2[_10]!=_6[_10]){if(_13){if(_4&&!isc.isA.String(_2[_10])){throw new Error("DataSource for property "+_10+" must be a string")}
_8=true;_9=_2[_10];delete _2[_10]}else{_7=true}
}
}
isc.addProperties(_1.defaults,_2);var _14=_1.liveObject,_15=false
;if(_14){var _16=_14.$232d,_17=isc.EditContext.getMissingRequiredProperties(_1)
;if(_16&&!_17&&_1.alwaysUsePlaceholder!=true&&_1.alwaysUsePlaceholder!="true")
{_15=true;_1.type=_1.defaults.placeholderDefaults.placeholderFor;delete _1.defaults.placeholderDefaults}else if(!_16&&_17){_15=true}else if(_16&&_17){_1.defaults.placeholderDefaults.requiredProperties=_17;_14.setRequiredProperties(_17)}
}
var _18=this.getEditNodeTree(),_19=isc.DS.getAutoIdField(_1),_20=isc.DS.getToolAutoIdField(_1),_21=isc.addProperties({},_2)
;if(_14&&!_3){_15=(_15||_1.recreateOnChange==true||_1.recreateOnChange=="true");if(!_15){for(var _10 in _2){var _22=(_20&&_10==_20?_19:_10),_11=(_5?_5.getField(_22):null)||{}
;if(_11&&_11.recreateOnChange){_15=true;break}
}
}
if(_15){_1=this.$232e(_1,_2);_14=this.getLiveObject(_1);_5=null;_2=null}
_21=isc.addProperties({},_2);var _23=(_5?_1.defaults[_19]||isc.DS.getAutoId(_1.defaults):null);if(_23!=null&&_1.ID!=_23){if(isc.EditContext.screenMode){var _24=_6.ID||_6.autoID;if(_14.$177g!=_24){var _25=_14.$112p;delete _25.$112o[_14.$177g];_14.$177g=_24;_25.$112o[_24]=_14}
if(_1.defaults[_19]){delete _1.defaults.autoID}
delete _2.ID;delete _2.autoID}
_18.updateNodeIdInIndex(_1.ID,_23);_1.ID=_23;var _26=_18.getChildren(_1);if(_26){for(var i=0;i<_26.length;i++){var _28=_26[i];if(_28.parentId!=_23){_28.parentId=_23}
}
}
}else{_23=null}
if(_2&&!isc.isAn.emptyObject(_2)){try{this.applyPropertiesToComponent(_1,_2)}catch(e){_1=this.$232e(_1,_2);_14=this.getLiveObject(_1)}
}
if(this.markForRedraw)this.markForRedraw();if(_23)this.$204h(_1);_18.dataChanged()}
else{var _23=(_5?_1.defaults[_19]||isc.DS.getAutoId(_1.defaults):null);if(_23!=null&&_1.ID!=_23){_1.ID=_23;var _26=_18.getChildren(_1);if(_26){for(var i=0;i<_26.length;i++){var _28=_26[i];if(_28.parentId!=_23){_28.parentId=_23}
}
}
}
}
if(_7)this.fireEditNodeUpdated(_1,_21);if(_8){var _29=_14.editProxy;if(_29&&_29.changeDataSource){_29.changeDataSource(_9)}else{if(!_9){var _30=isc.DS.get(_14[_10]),_31=_18.getChildren(_1).find("liveObject",_30)
;if(_30&&_31){this.delayCall("removeNode",[_31,null,true])}
}else{var _32=this.makeDSPaletteNode(_9),_31=this.makeEditNode(_32)
;_31.dropped=true;this.delayCall("addNode",[_31,_1,0])}
}
}
return _1}
);isc.evalBoundary;isc.B.push(isc.A.$232e=function isc_EditContext__recreateComponent(_1,_2){var _3=this.getEditNodeTree(),_4=isc.DS.getAutoIdField(_1),_5=isc.DS.getToolAutoIdField(_1),_6=_3.getParent(_1),_7=_6?_6.liveObject:null,_8=_3.getChildren(_6).findIndex(_1),_9=this.getLiveObject(_1),_10=this.makePaletteNodeTree(_1)
;this.logInfo("using remove/re-add cycle to modify liveObject: "+isc.echoLeaf(_9)+" within parent node "+isc.echoLeaf(_6));var _11=_3.getChildren(_1),_12=_9&&_9.editProxy&&_9.editProxy.removeChildrenOnRecreate
;if(_11&&_11.length>0){_11=_11.duplicate();for(var i=0;i<_11.length;i++){var _14=this.getLiveObject(_11[i]);if(this.isComponentSelected(_14)){this.deselectComponents(_14,true)}
this.removeNode(_11[i],!_12)}
if(isc.isA.CanvasItem(_9)){_9.autoDestroy=false}
}
if(this.isComponentSelected(_9)){this.deselectComponents(_9,true)}
this.removeNode(_1,null,true);var _15=_10.getRoot(),_16=isc.Tree.getCleanNodeData(_15,false,false,false,_10)
;if(_1.defaults.ID){_16.defaults.ID=_1.defaults.ID}
if(_9.destroy){_9.destroy()}
if((_2[_4]!=null||_2[_5]!=null)&&_16.type!="DynamicProperty")
{_16.ID=_2[_4]||_2[_5];if(_2[_4]){delete _2[_5];if(_16.defaults){delete _16.defaults[_5]}
}
}
if(isc.isA.DynamicForm(_7)&&_2.type!=null){var _17=isc.FormItemFactory.getItemClassName({type:_2.type},_2.type,_7),_18=isc.FormItemFactory.getItemClass(_17)
;if(_18){_16.type=_16._constructor=_18.getClassName();if(_16.defaults&&_16.defaults._constructor){_16.defaults._constructor=_16._constructor}
var _19=isc.Class.getClassIcon(_16.type);if(!_19){_19=isc.Class.getClassIcon("FormItem")}
if(_19){_16.icon=_19}
delete _16.title}
delete _2.type}
var _20=_1.parentProperty;_1=this.addFromPaletteNode(_16,_6,_8,_20,null,null,true);this.dontBindDefaultFields=true;this.$178m(_1,_10,_15);delete this.dontBindDefaultFields;this.selectSingleEditNode(_1);return _1}
,isc.A.$204h=function isc_EditContext__resetMaskedNodes(_1){var _2=this.getEditNodeTree(),_3=_2.getChildren(_1)
;if(!_3)return;for(var i=0;i<_3.length;i++){var _5=_3[i];var _6=_5.liveObject,_7=(_6&&_6.editProxy?_6.editProxy:null)
;if(_7&&_7.useEditMask&&_1.liveObject){_7.showEditMask(_1.liveObject)}
if(_2.hasChildren(_5)){this.$204h(_5)}
}
}
,isc.A.applyPropertiesToComponent=function isc_EditContext_applyPropertiesToComponent(_1,_2){var _3=_1.liveObject;if(_3.setEditableProperties){var _4=isc.DS.get(_1.type||_1.className),_5=!_4.componentSchema
;_3.setEditableProperties(_2,_5);if(_3.markForRedraw)_3.markForRedraw();else if(_3.redraw)_3.redraw()}else{var _6=this.getEditNodeTree(),_7=_6.getParent(_1),_8=_7
;if(_7!=null){var _9=_7.liveObject;if(_9!=null&&_9.setChildEditableProperties)
{_9.setChildEditableProperties(_3,_2,_1,this)}else{var _10=1;while((_8=_6.getParent(_8))!=null){var _11=_8.liveObject;if(_11!=null&&_11.setDescendantEditableProperties)
{_11.setDescendantEditableProperties(_3,_2,_1,this,_10);break}
++_10}
}
}
if(_8==null){isc.addProperties(_3,_2)}
}
if(this.markForRedraw)this.markForRedraw()}
,isc.A.removeNodeProperties=function isc_EditContext_removeNodeProperties(_1,_2){this.recordAction("removeNodeProperties",arguments);if(!_1.defaults)return;if(!isc.isAn.Array(_2))_2=[_2];var _3={};_2.map(function(_4){delete _1.defaults[_4];_3[_4]=true});this.fireEditNodeUpdated(_1,_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.makePaletteNode=function isc_EditContext_makePaletteNode(_1){if(!_1||_1.canDuplicate==false)return null;var _2=_1.type||_1.className,_3=isc.addProperties({},_1.defaults)
;if(_2!="DataSource"){delete _3._constructor;delete _3.ID}
delete _3.autoDraw;delete _3.hasStableID;var _4=isc.addProperties({},this.findPaletteNode("type",_2),{defaults:_3});if(_1.editNodeProperties){_4.editNodeProperties=isc.addProperties({},_1.editNodeProperties)}
if(_1.editProxyProperties){_4.editProxyProperties=isc.addProperties({},_1.editProxyProperties)}
for(var _5 in _1){if(_5.endsWith("BasicMode")){if(!_4.editNodeProperties)_4.editNodeProperties={};_4.editNodeProperties[_5]=_1[_5]}
}
for(var i=0;i<isc.EditContext.$178k.length;i++){var _7=isc.EditContext.$178k[i];if(_1[_7])_4[_7]=_1[_7]}
for(var i=0;i<isc.EditContext.$206n.length;i++){var _7=isc.EditContext.$206n[i];if(_1[_7])_4[_7]=_1[_7]}
return _4}
,isc.A.makePaletteNodeTree=function isc_EditContext_makePaletteNodeTree(_1,_2,_3){if(!_1||_1.canDuplicate==false)return null;var _4=this.makePaletteNode(_1);var _5=isc.DS.getUsedAutoIdField(_4.defaults);if(_5&&_5!="ID"){delete _4.defaults[_5]}
if(!_2){_2=isc.Tree.create({root:_4
})}else{_2.add(_4,_3)}
var _6=this.getEditNodeTree(),_7=_6.getChildren(_1)
;if(_7&&_7.length>0){for(var i=0;i<_7.length;i++){this.makePaletteNodeTree(_7[i],_2,_4)}
}
return _2}
,isc.A.copyEditNodes=function isc_EditContext_copyEditNodes(_1){if(!_1)return;if(!isc.isAn.Array(_1))_1=[_1];var _2=[];for(var i=0;i<_1.length;i++){var _4=this.makePaletteNodeTree(_1[i]);if(_4)_2.push(_4)}
if(_2.length>0){this.setEditClipboard(_2.length==1?_2[0]:_2)}
}
,isc.A.setEditClipboard=function isc_EditContext_setEditClipboard(_1){this.clearEditClipboard();this.$178l=_1}
,isc.A.getEditClipboard=function isc_EditContext_getEditClipboard(){return this.$178l}
,isc.A.clearEditClipboard=function isc_EditContext_clearEditClipboard(){if(this.$178l){delete this.$178l}
}
,isc.A.pasteEditNodes=function isc_EditContext_pasteEditNodes(_1){var _2=this.getEditClipboard();if(!_2)return;var _3=this.selectedComponents;this.selectedComponents=[];var _4=this.$1366();if(!isc.isAn.Array(_2))_2=[_2];for(var i=0;i<_2.length;i++){var _6=_2[i],_7=_6.getRoot();if(_7.defaults){_7.defaults.left=(_7.defaults.left?_7.defaults.left:0)+isc.EditContext.editNodePasteOffset;_7.defaults.top=(_7.defaults.top?_7.defaults.top:0)+isc.EditContext.editNodePasteOffset}
var _8=isc.Tree.getCleanNodeData(_7,false,false,false,_6),_9=this.addFromPaletteNode(_8,_1)
;if(_4)this.selectedComponents.add(_9.liveObject);this.dontBindDefaultFields=true;this.$178m(_9,_6,_7);delete this.dontBindDefaultFields}
this.updateSelectionDisplay(this.selectedComponents,_3);this.fireSelectedEditNodesUpdated()}
,isc.A.$178m=function isc_EditContext__pasteChildNodes(_1,_2,_3){var _4=_2.getChildren(_3);if(!_4||_4.length==0){return}
for(var i=0;i<_4.length;i++){var _6=isc.Tree.getCleanNodeData(_4[i],false,false,false,_2),_7=this.addFromPaletteNode(_6,_1)
;this.$178m(_7,_2,_4[i])}
}
,isc.A.addWithWrapper=function isc_EditContext_addWithWrapper(_1,_2,_3,_4,_5,_6){var _7=!_5,_8=(_5?this.wrapperDrawPaneDefaults:this.wrapperFormDefaults),_9=isc.Canvas.$145y(this),_10=isc.addProperties({},_8)
;if(_1.editProxyProperties)isc.addProperties(_9,_1.editProxyProperties);var _11={type:_8._constructor,defaults:_10,editProxyProperties:_9,parentProperty:_4
};if(_11.type=="DynamicForm")_11.idName="Form";if(_7&&_1.liveObject&&_1.liveObject.schemaDataSource){var _12=_1.liveObject;_10.doNotUseDefaultBinding=true;_10.dataSource=_12.schemaDataSource;_10.serviceNamespace=_12.serviceNamespace;_10.serviceName=_12.serviceName}
var _13=this.makeEditNode(_11);this.addNode(_13,_2,_3,_4,null,null,true);var _1=this.addNode(_1,_13,null,null,null,null,_6);if(_7){var _14=_13.liveObject.cellPadding,_15=_1.liveObject.getHeight()
;if(_15>0){this.setNodeProperties(_13,{height:(_14*2)+_15})}
}
return _1}
,isc.A.$145z=function isc_EditContext__getCanGroupSelect(){return(this.canGroupSelect==true||this.selectionType=="multiple")}
,isc.A.$1450=function isc_EditContext__getCanDragGroup(){return(this.canDragGroup!=false)&&this.$145z()}
,isc.A.getSelectedLabelText=function isc_EditContext_getSelectedLabelText(_1){if(!_1)return null;var _2=_1.editNode;if(!_2)return _1.toString();var _3=this.getEditNodeIDDescription(_2),_4=_2.type||_2.className,_5=this.getTitleForType(_4)
;return _3||_1.toString()}
,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.hideSelection=function isc_EditContext_hideSelection(){this.showSelection(false)}
,isc.A.showSelection=function isc_EditContext_showSelection(_1){if(!this.selectedComponents||this.selectedComponents.length==0){return}
var _2=this.selectedComponents;for(var i=0;i<_2.length;i++){var _4=_2[i].editProxy;if(_4&&_4.showSelectedAppearance){_4.showSelectedAppearance(_1!=false)}
}
}
,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)){this.updateSelectionDisplay([_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,_2){if(!isc.isAn.Array(_1))_1=[_1];var _3=this.selectedComponents.removeList(_1);this.updateSelectionDisplay(null,_1);if(_3&&!_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)){var _2=this.$225k(_1.editNode)&&this.$1451();_1.editProxy.showSelectedAppearance(true,(this.showSelectedLabelOnSelect==false),_2)}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,_6=_2[i].editNode
;if(_6)this.$210e(_6,false);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,_6=_1[i].editNode
;if(_6)this.$210e(_6,true);if(_5&&_5.showSelectedAppearance){if(_6.canDragInPreview==false||_6.canDragInPreview=="false"){_3=false}else if(_6.canReparent==false||_6.canReparent=="false"){_3=false;if(this.persistCoordinates!=false){var _7=this.getEditNodeTree().getParent(_6);if(_7){var _8=_7.liveObject;if(_8&&_8.editProxy){if((this.persistCoordinates==null&&_8.editProxy.persistCoordinates)||(this.persistCoordinates&&_8.editProxy.persistCoordinates!=false))
{_3=true}
}
}
}
}
_3=(_3&&this.$225k(_6));_5.showSelectedAppearance(true,(this.showSelectedLabelOnSelect==false),_3)}
}
}
if(_3&&(!_1||_1.length==0)){var _9=this.getSelectedComponents()[0];_9.editProxy.showSelectedAppearance(true,(this.showSelectedLabelOnSelect==false),_3)}
this.showGroupSelectionBox()}
,isc.A.$210e=function isc_EditContext__updateModalVisibility(_1,_2){if(_1.modalVisibility==true||_1.modalVisibility=="true"){if(_2)_1.liveObject.show();else _1.liveObject.hide();return}
var _3=this.getParentNode(_1),_4=this.getRootEditNode()
;while(_3&&_3!=_4){if(_3.modalVisibility==true||_3.modalVisibility=="true"){if(_2)_3.liveObject.show();else _3.liveObject.hide();break}
_3=this.getParentNode(_3)}
}
,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.$225k=function isc_EditContext__canDragChildNode(_1){var
_2=this.getEditNodeTree().getParent(_1),_3=_2&&_2.liveObject&&_2.liveObject.editProxy
;return(_3&&_3.canDragChildNode?_3.canDragChildNode(_1):true)}
,isc.A.selectedEditNodesUpdated=function isc_EditContext_selectedEditNodesUpdated(_1,_2){}
,isc.A.saveCoordinates=function isc_EditContext_saveCoordinates(_1){if(!_1)return;if(isc.isA.SimpleTabButton(_1)||(isc.DrawPane&&isc.isA.DrawItem(_1))||(isc.DrawPane&&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)}else if(_1.editProxy&&_1.editProxy.persistCoordinates==true){var _5=(_1.$pn=="*"?"*":null),_6=(_1.$po=="*"?"*":null)
;this.setNodeProperties(_2,{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.A.fireEditNodeUpdated=function isc_EditContext_fireEditNodeUpdated(_1,_2){if(!this.editNodeUpdated)return;if(isc.isAn.Object(_2))_2=isc.getKeys(_2);this.editNodeUpdated(_1,this,_2);if(_1.liveObject&&_1.liveObject.editProxy){_1.liveObject.editProxy.editNodeUpdated(_1,this,_2)}
}
,isc.A.getVisibilityMaskManager=function isc_EditContext_getVisibilityMaskManager(){if(!this.visibilityMaskManager){var _1={container:this.rootLiveObject};this.visibilityMaskManager=this.createAutoChild("visibilityMaskManager",_1)}
return this.visibilityMaskManager}
,isc.A.recordAction=function isc_EditContext_recordAction(_1,_2){if(!this.keepUndoLog||isc.$75u)return;if(this.replaying)return;var _3=this.createAction(_1,_2);if(!_3)return;if(!this.$207o)this.$207o=[];while(this.$207o.length>=this.maxUndoLogEntries)this.$207o.shift();this.$207o.push(_3);this.$207p=[];this.fireChanged();return _3}
,isc.A.undo=function isc_EditContext_undo(){if(!this.keepUndoLog){this.logWarn("Attempt to perform undo operation while undoLog is disabled");return}
if(!this.$207o){this.logInfo("UndoLog is empty","editModeUndoLog");return}
var _1=this.$207o.pop();if(_1){this.replaying=true;if(this.reverseAction(_1)!=false){this.$207p.add(_1)}else{this.$207o=[]}
delete this.replaying;this.fireChanged()}else{this.logInfo("Nothing to undo","editModeUndoLog")}
}
,isc.A.undoTo=function isc_EditContext_undoTo(_1){if(!this.keepUndoLog){this.logWarn("Attempt to perform undoTo operation while undoLog is disabled");return}
if(!this.$207o)return;do{var _2=this.$207o.last();if(_2)this.undo()}while(_2&&_2.timestamp!=_1)}
,isc.A.redo=function isc_EditContext_redo(){if(!this.keepUndoLog){this.logWarn("Attempt to perform redo operation while undoLog is disabled");return}
if(!this.$207p){this.logInfo("RedoLog is empty","editModeUndoLog");return}
var _1=this.$207p.pop();if(_1){this.replaying=true;if(this.performAction(_1)!=false){this.$207o.add(_1)}else{this.$207p=[]}
delete this.replaying;this.fireChanged()}else{this.logInfo("Nothing to redo","editModeUndoLog")}
}
,isc.A.redoTo=function isc_EditContext_redoTo(_1){if(!this.keepUndoLog){this.logWarn("Attempt to perform redoTo operation while undoLog is disabled");return}
if(!this.$207p)return;do{var _2=this.$207p.last();if(_2)this.redo()}while(_2&&_2.timestamp!=_1)}
,isc.A.resetUndoLog=function isc_EditContext_resetUndoLog(){if((this.$207o&&this.$207o.length>0)||(this.$207p&&this.$207p.length>0)){this.logInfo("UndoLog reset","editModeUndoLog")}
this.$207o=[];this.$207p=[];if(this.keepUndoLog)this.fireChanged()}
,isc.A.getUndoLogDescriptions=function isc_EditContext_getUndoLogDescriptions(_1){var _2=this.$207o,_3=[]
;if(_2){for(var i=0;i<_2.length;i++){var _5=_2[i];if(_1&&_5.timestamp<_1)continue;_3.add(_5.description)}
}
return _3}
,isc.A.getCombinedUndoLogDescriptions=function isc_EditContext_getCombinedUndoLogDescriptions(_1){var _2=this.$207o,_3=[]
;if(!_2)return null;for(var i=0;i<_2.length;i++){var _5=_2[i];if(_1&&_5.timestamp<_1)continue;_3.add(isc.shallowClone(_5))}
var _6,_7=[]
;for(var i=0;i<_3.length;i++){var _5=_3[i];if(_5==null)continue;if(_6&&_5.actionName=="addNode"&&_6.actionName=="addNode"&&_6.editNode.type=="Tab"&&_6.editNode==_5.parentNode)
{_7.add(_5)}else if(_6&&_5.actionName=="addNode"&&_6.actionName=="addNode"&&(_6.editNode.type=="Window"||_6.editNode.type=="ModalWindow"||_6.editNode.type=="InlineWindow")&&_6.editNode==_5.parentNode&&(_5.editNode.type=="WindowHeaderIcon"||_5.editNode.type=="WindowHeaderLabel"||_5.editNode.type=="WindowMinimizeButton"||_5.editNode.type=="WindowMaximizeButton"||_5.editNode.type=="WindowCloseButton"||_5.editNode.type=="WindowFooterSpacer"||_5.editNode.type=="WindowResizer"))
{_7.add(_5);continue}
_6=_5}
if(_7.length>0)_3.removeList(_7);do{var _8=false,_6=null
;for(var i=0;i<_3.length;i++){var _5=_3[i];if(_5==null)continue;if(_6&&_6.targetComponent==_5.targetComponent&&_6.actionName=="removeNode"&&_5.actionName=="addNode"&&_6.parentNode==_5.parentNode&&_6.index!=_5.index)
{var _9=_6.editNode,_10=this.getEditNodeIDDescription(_9),_11=_6.parentNode,_12=this.getEditNodeIDDescription(_11)
;_6.description="Reordered "+_10+" in "+_12;_3[i]=null;_8=true}else if(_6&&_5.actionName=="addNode"&&isc.isA.DataSource(_5.targetComponent)&&_6.actionName=="addNode"&&isc.isA.DataBoundComponent(_6.targetComponent))
{var _9=_6.editNode,_13=_9.type||_9.className,_14=this.getTitleForType(_13),_10=this.getEditNodeIDDescription(_9),_11=_6.parentNode,_15=(_11?_11.type||_11.className:null),_16=(_11?this.getTitleForType(_15):null),_12=this.getEditNodeIDDescription(_11),_17=_5.editNode,_18=this.getEditNodeIDDescription(_17)
;_6.description="Dropped "+_14+" '"+_10+"' into "+_16+" '"+_12+"' and bound to '"+_18+"' DataSource";_3[i]=null;_8=true}else if(_6&&_5.actionName=="addNode"&&!isc.isA.Class(_5.targetComponent)&&_6.actionName=="addNode"&&!isc.isA.Class(_6.targetComponent)&&_6.parentNode==_5.parentNode)
{var _19=[];for(var j=i-1;j<_3.length;j++){var _21=_3[j];if(_21!=null){if(_21.actionName=="addNode"&&!isc.isA.Class(_21.targetComponent)&&_6.parentNode==_21.parentNode)
{_19.add(_21);if(_21!=_6)_3[j]=null}else{break}
}
}
var _9=_6.editNode,_13=_9.type||_9.className,_14=this.getTitleForType(_13),_10=this.getEditNodeIDDescription(_9)
;var _22=isc.SB.create();_22.append("Added ",_14,"s ");for(var j=0;j<_19.length;j++){var _23=_19[j];if(_22.getArray().length>3){if(j==_19.length-1)_22.append(" and ");else _22.append(", ")}
var _17=_23.editNode,_18=this.getEditNodeIDDescription(_17)
;_22.append(_18)}
var _11=_6.parentNode,_15=(_11?_11.type||_11.className:null),_16=(_11?this.getTitleForType(_15):null),_12=this.getEditNodeIDDescription(_11)
;_22.append(" to ",_16," '",_12,"'");_6.description=_22.toString();_22.release();_8=true}else if(_6&&_6.targetComponent==_5.targetComponent&&_6.actionName=="setNodeProperties"&&_5.actionName=="setNodeProperties")
{var _24=[];for(var j=i-1;j<_3.length;j++){var _21=_3[j];if(_21!=null){if(_21.actionName=="setNodeProperties"&&_21.targetComponent==_6.targetComponent)
{_24.add(_21);if(_21!=_6)_3[j]=null}else{break}
}
}
var _9=_6.editNode,_13=_9.type||_9.className,_14=this.getTitleForType(_13),_10=this.getEditNodeIDDescription(_9),_11=_6.parentNode,_15=(_11?_11.type||_11.className:null),_16=(_11?this.getTitleForType(_15):null),_12=this.getEditNodeIDDescription(_11)
;var _25={};for(var j=0;j<_24.length;j++){var _26=_24[j];isc.addProperties(_25,_26.properties)}
var _27=isc.getKeys(_25),_22=isc.SB.create()
;_22.append("Set ",(_27.length>1?"properties":"property")," of ",_14," '",_10,"': ");for(var j=0;j<_27.length;j++){var _28=_27[j],_29=_25[_28]
;if(_22.getArray().length>7){if(j==_27.length-1)_22.append(" and ");else _22.append(", ")}
_22.append(_28," to '",_29,"'")}
_6.description=_22.toString();_22.release();_8=true}
_6=_5}
}while(_8);var _22=isc.SB.create();for(var i=0;i<_3.length;i++){var _5=_3[i];if(_5){if(_22.getArray().length>0)_22.append("<br>");_22.append(_5.description)}
}
var _30=_22.toString();_22.release();return _30}
);isc.evalBoundary;isc.B.push(isc.A.fireChanged=function isc_EditContext_fireChanged(){if(this.undoLogChanged)this.fireCallback("undoLogChanged")}
,isc.A.createAction=function isc_EditContext_createAction(_1,_2){var _3=this.getActionClass(_1);if(!_3){this.logInfo("Action "+_1+" not supported in undo log");return}
var _4=[];for(var i=0;i<_2.length;i++){_4[i]=_2[i]}
var _6=_3.create({editContext:this});var _7=_6.save(_4);if(_7==false)_6=null;return _6}
,isc.A.performAction=function isc_EditContext_performAction(_1){if(!_1.execute||_1.execute()==false){this.logWarn("Action "+_1.actionName+" cannot be redone");return false}
}
,isc.A.reverseAction=function isc_EditContext_reverseAction(_1){if(!_1.undo||_1.undo()==false){this.logWarn("Action "+_1.actionName+" cannot be undone");return false}
}
,isc.A.getActionClass=function isc_EditContext_getActionClass(_1){return isc.EditContext.actionClasses[_1]}
);isc.B._maxIndex=isc.C+151;isc.EditContext.registerStringMethods({inlineEditorShowing:"field,type",undoLogChanged:""});isc.ClassFactory.defineClass("EditModeAction").addProperties({init:function(){this.Super("init",arguments);this.timestamp=isc.timeStamp()}});isc.defineClass("EditModeAddNodeAction","EditModeAction");isc.A=isc.EditModeAddNodeAction.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.actionName="addNode";isc.B.push(isc.A.save=function isc_EditModeAddNodeAction_save(_1){this.arguments=_1;this.editNode=_1[0];this.parentNode=_1[1];this.index=_1[2];this.parentProperty=_1[3];this.skipParentComponentAdd=_1[4];this.forceSingularFieldReplace=_1[5];this.skipNodeAddedNotification=_1[6];this.targetComponent=this.editNode.liveObject;this.description=this.getDescription();this.logSave()}
,isc.A.execute=function isc_EditModeAddNodeAction_execute(){this.logExecute();this.editContext.fireCallback(this.actionName,null,this.arguments)}
,isc.A.undo=function isc_EditModeAddNodeAction_undo(){this.logUndo();this.editContext.removeNode(this.editNode,this.skipParentComponentAdd)}
,isc.A.getDescription=function isc_EditModeAddNodeAction_getDescription(){var _1=this.editContext,_2=_1.getRootEditNode(),_3=this.editNode,_4=_3.type||_3.className,_5=_1.getTitleForType(_4),_6=_1.getEditNodeIDDescription(_3),_7=this.parentNode,_8=(_7?_7.type||_7.className:null),_9=(_7?_1.getTitleForType(_8):null),_10=(_7?_1.getEditNodeIDDescription(_7):null),_11="Added "+_5+" '"+_6+"'"+(_7&&_7!=_2?" to "+_9+" '"+_10+"'":" as global")
;return _11}
,isc.A.logSave=function isc_EditModeAddNodeAction_logSave(){if(this.logIsInfoEnabled("editModeUndoLog")){var _1=this.getLogActionDetail();this.logInfo(this.actionName+" action recorded in undoLog: "+_1,"editModeUndoLog")}
}
,isc.A.logExecute=function isc_EditModeAddNodeAction_logExecute(){if(this.logIsInfoEnabled("editModeUndoLog")){var _1=this.getLogActionDetail();this.logInfo("Redoing "+this.actionName+": "+_1,"editModeUndoLog")}
}
,isc.A.logUndo=function isc_EditModeAddNodeAction_logUndo(){if(this.logIsInfoEnabled("editModeUndoLog")){var _1=this.getLogActionDetail();this.logInfo("Undoing "+this.actionName+": "+_1,"editModeUndoLog")}
}
,isc.A.getLogActionDetail=function isc_EditModeAddNodeAction_getLogActionDetail(){var _1=this.editContext,_2=_1.getRootEditNode(),_3=this.editNode,_4=_3.type||_3.className,_5=_1.getTitleForType(_4),_6=_1.getEditNodeIDDescription(_3),_7=this.parentNode,_8=(_7?_7.type||_7.className:null),_9=(_7?_1.getTitleForType(_8):null),_10=(_7?_1.getEditNodeIDDescription(_7):null),_11=this.index,_12=_5+" '"+_6+"' added"+(_7&&_7!=_2
?" to "+_9+" '"+_10+"'"+(_11!=null?" @ "+_11:"")
:" as global")
;return _12}
);isc.B._maxIndex=isc.C+8;isc.defineClass("EditModeRemoveNodeAction","EditModeAction");isc.A=isc.EditModeRemoveNodeAction.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.actionName="removeNode";isc.B.push(isc.A.save=function isc_EditModeRemoveNodeAction_save(_1){this.arguments=_1;this.editNode=_1[0];this.skipLiveRemoval=_1[1];var _2=this.editNode;if(_2.$207r){delete _2.$207r;return false}
var _3=this.editContext,_4=_3.getEditNodeTree()
;this.parentNode=_3.getParentNode(_2);this.index=_4.getChildren(this.parentNode).findIndex(_2);this.targetComponent=_2.liveObject;this.description=this.getDescription();this.logSave()}
,isc.A.execute=function isc_EditModeRemoveNodeAction_execute(){this.logExecute();this.editContext.fireCallback(this.actionName,null,this.arguments)}
,isc.A.undo=function isc_EditModeRemoveNodeAction_undo(){this.logUndo();var _1=this.editNode.parentProperty;this.editContext.addNode(this.editNode,this.parentNode,this.index,_1,this.skipLiveRemoval,null,true)}
,isc.A.logSave=function isc_EditModeRemoveNodeAction_logSave(){var _1=this.getLogActionDetail();this.logInfo(this.actionName+" action recorded in undoLog: "+_1,"editModeUndoLog")}
,isc.A.logExecute=function isc_EditModeRemoveNodeAction_logExecute(){var _1=this.getLogActionDetail();this.logInfo("Redoing "+this.actionName+": "+_1,"editModeUndoLog")}
,isc.A.logUndo=function isc_EditModeRemoveNodeAction_logUndo(){var _1=this.getLogActionDetail();this.logInfo("Undoing "+this.actionName+": "+_1,"editModeUndoLog")}
,isc.A.getDescription=function isc_EditModeRemoveNodeAction_getDescription(){var _1=this.editContext,_2=_1.getRootEditNode(),_3=this.editNode,_4=_3.type||_3.className,_5=_1.getTitleForType(_4),_6=_1.getEditNodeIDDescription(_3),_7=this.parentNode,_8=(_7?_7.type||_7.className:null),_9=(_7?_1.getTitleForType(_8):null),_10=(_7?_1.getEditNodeIDDescription(_7):null),_11="Removed "+_5+" '"+_6+"'"+(_7&&_7!=_2?" from "+_9+" '"+_10+"'":" as global")
;return _11}
,isc.A.getLogActionDetail=function isc_EditModeRemoveNodeAction_getLogActionDetail(){var _1=this.editContext,_2=_1.getRootEditNode(),_3=this.editNode,_4=_3.type||_3.className,_5=_1.getTitleForType(_4),_6=_1.getEditNodeIDDescription(_3),_7=this.parentNode,_8=(_7?_7.type||_7.className:null),_9=(_7?_1.getTitleForType(_8):null),_10=(_7?_1.getEditNodeIDDescription(_7):null),_11=_5+" '"+_6+"' removed"+(_7&&_7!=_2?" from "+_9+" '"+_10+"'":" as global")
;return _11}
);isc.B._maxIndex=isc.C+8;isc.defineClass("EditModeDestroyNodeAction","EditModeRemoveNodeAction");isc.A=isc.EditModeDestroyNodeAction.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.actionName="destroyNode";isc.B.push(isc.A.save=function isc_EditModeDestroyNodeAction_save(_1){this.Super("save",arguments);this.paletteNode=this.editContext.makePaletteNode(this.editNode);this.editNode.$207r=true}
,isc.A.execute=function isc_EditModeDestroyNodeAction_execute(){this.logExecute();var _1=isc.shallowClone(this.arguments);_1[0]=this.editNode;this.editContext[this.actionName].apply(this.editContext,_1)}
,isc.A.undo=function isc_EditModeDestroyNodeAction_undo(){this.logUndo();var _1=this.editContext.makeEditNode(this.paletteNode),_2=_1.parentProperty
;this.editNode=this.editContext.addNode(_1,this.parentNode,this.index,_2,null,null,true)}
);isc.B._maxIndex=isc.C+3;isc.defineClass("EditModeSetNodePropertiesAction","EditModeAction");isc.A=isc.EditModeSetNodePropertiesAction.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.actionName="setNodeProperties";isc.B.push(isc.A.save=function isc_EditModeSetNodePropertiesAction_save(_1){this.arguments=_1;this.editNode=_1[0];this.properties=_1[1];this.skipLiveObjectUpdate=_1[2];var _2=this.properties,_3={}
;if(_2){var _4=this.editNode.defaults,_5
;if(_4){for(var _6 in _2){if(_2[_6]!=_5)_3[_6]=_4[_6]}
}
}
this.oldValues=_3;this.targetComponent=this.editNode.liveObject;this.description=this.getDescription();this.logSave()}
,isc.A.execute=function isc_EditModeSetNodePropertiesAction_execute(){this.logExecute();this.editContext.fireCallback(this.actionName,null,this.arguments)}
,isc.A.undo=function isc_EditModeSetNodePropertiesAction_undo(){this.logUndo();var _1=this.editContext,_2=this.oldValues,_3={},_4={},_5
;for(var _6 in _2){if(_2[_6]==_5)_4[_6]=null;else _3[_6]=_2[_6]}
if(!isc.isA.emptyObject(_3)){var _7=isc.shallowClone(this.arguments);_7[1]=_3;_1[this.actionName].apply(_1,_7)}
if(!isc.isA.emptyObject(_4)){_1.removeNodeProperties(this.editNode,isc.getKeys(_4));if(!this.skipLiveObjectUpdate){_1.applyPropertiesToComponent(this.editNode,_4)}
}
}
,isc.A.getDescription=function isc_EditModeSetNodePropertiesAction_getDescription(){var _1=this.editContext,_2=this.editNode,_3=_2.type||_2.className,_4=_1.getTitleForType(_3),_5=_1.getEditNodeIDDescription(_2),_6=this.properties||{},_7=isc.getKeys(_6),_8
;if(_7.length==1){_8="Property '"+_7[0]+"' changed for "+_4+" '"+_5+"'"}else{var _9=_7.slice(0,_7.length-1).join(", ")+" and "+_7[_7.length-1];_8="Properties '"+_9+"' changed for "+_4+" '"+_5+"'"}
return _8}
,isc.A.logSave=function isc_EditModeSetNodePropertiesAction_logSave(){this.logInfo(this.actionName+" action recorded in undoLog for "+this.editNode.ID+"/"+this.editNode.type+": "+this.echo(this.properties),"editModeUndoLog")}
,isc.A.logExecute=function isc_EditModeSetNodePropertiesAction_logExecute(){this.logInfo("Redoing "+this.actionName+" for "+this.editNode.ID+"/"+this.editNode.type+": "+this.echo(this.properties),"editModeUndoLog")}
,isc.A.logUndo=function isc_EditModeSetNodePropertiesAction_logUndo(){this.logInfo("Undoing "+this.actionName+" for "+this.editNode.ID+"/"+this.editNode.type+": "+this.echo(this.properties),"editModeUndoLog")}
);isc.B._maxIndex=isc.C+7;isc.defineClass("EditModeRemoveNodePropertiesAction","EditModeAction");isc.A=isc.EditModeRemoveNodePropertiesAction.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.actionName="removeNodeProperties";isc.B.push(isc.A.save=function isc_EditModeRemoveNodePropertiesAction_save(_1){this.arguments=_1;this.editNode=_1[0];this.properties=_1[1];var _2=this.properties,_3={}
;if(_2){if(!isc.isAn.Array(_2))_2=[_2];var _4=this.editNode.defaults,_5
;if(_4){_2.map(function(_7){var _6=_4[_7];if(_6!=_5)_3[_7]=_6})}
}
this.oldValues=_3;this.targetComponent=this.editNode.liveObject;this.description=this.getDescription();this.logSave()}
,isc.A.execute=function isc_EditModeRemoveNodePropertiesAction_execute(){this.logExecute();this.editContext.fireCallback(this.actionName,null,this.arguments)}
,isc.A.undo=function isc_EditModeRemoveNodePropertiesAction_undo(){this.logUndo();var _1=this.oldValues;if(!isc.isA.emptyObject(_1)){this.editContext.setNodeProperties(this.editNode,_1)}
}
,isc.A.getDescription=function isc_EditModeRemoveNodePropertiesAction_getDescription(){var _1=this.editContext,_2=this.editNode,_3=_2.type||_2.className,_4=_1.getTitleForType(_3),_5=_1.getEditNodeIDDescription(_2),_6=this.properties,_7
;if(!isc.isAn.Array(_6))_6=[_6];if(_6.length==1){_7="Property '"+_6[0]+"' removed from "+_4+" '"+_5+"'"}else if(_6.length>1){var _8=_6.slice(0,_6.length-1).join(", ")+" and "+_6[_6.length-1];_7="Properties '"+_8+"' removed from "+_4+" '"+_5+"'"}
return _7}
,isc.A.logSave=function isc_EditModeRemoveNodePropertiesAction_logSave(){this.logInfo(this.actionName+" action recorded in undoLog for "+this.editNode.ID+"/"+this.editNode.type+": "+this.echo(this.properties),"editModeUndoLog")}
,isc.A.logExecute=function isc_EditModeRemoveNodePropertiesAction_logExecute(){this.logInfo("Redoing "+this.actionName+" for "+this.editNode.ID+"/"+this.editNode.type+": "+this.echo(this.properties),"editModeUndoLog")}
,isc.A.logUndo=function isc_EditModeRemoveNodePropertiesAction_logUndo(){this.logInfo("Undoing "+this.actionName+" for "+this.editNode.ID+"/"+this.editNode.type+": "+this.echo(this.properties),"editModeUndoLog")}
);isc.B._maxIndex=isc.C+7;isc.A=isc.EditContext;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.actionClasses={"addNode":isc.EditModeAddNodeAction,"removeNode":isc.EditModeRemoveNodeAction,"destroyNode":isc.EditModeDestroyNodeAction,"setNodeProperties":isc.EditModeSetNodePropertiesAction
};isc.B.push(isc.A.createPaletteNodesFromJS=function isc_c_EditContext_createPaletteNodesFromJS(_1,_2,_3){var _4=this;if(_2==null){_2=function(_11,_5){console.log(_5.$259d(_11))}}
var _5=isc.EditPane.create({autoDraw:false,defaultPalette:_3,editContextProperties:{getCapturedComponents:function(_13){if(_13){var _6="The following error occurred while loading sample: "+_13;throw new Error(_6)}
var _7=isc.capturedComponents;isc.capturedComponents=null;return _7}
}
});var _8=isc.EditContext.screenMode;isc.EditContext.screenMode=true;try{var _9=_5.getEditContext();_9.addPaletteNodesFromJS(_1.toString(),null,null,function(){var _10=_9.getEditNodeTree(),_11=_9.getEditNodeArray(),_12=_10.getChildren(_10.getRoot());_4.fireCallback(_2,"nodes,topLevelNodes,error,editPane",[_11,_12,null,_5])})}catch(e){isc.logWarn("Failed to convert "+_1+" to edit nodes: "+e+"\n"+e.stack);this.fireCallback(_2,"nodes,topLevelNodes,error",[null,null,true])}finally{_5.destroyAll();if(_8==null)delete isc.EditContext.screenMode;else isc.EditContext.screenMode=_8}
}
,isc.A.validatePaletteNodeDefaultsFromJS=function isc_c_EditContext_validatePaletteNodeDefaultsFromJS(_1,_2){var _3=this;if(_2==null)_2=function(_4){if(_4)_3.logWarn("validation errors:\n"+isc.echoFull(_4))};return isc.EditContext.createPaletteNodesFromJS2(_1,function(_5,_6,_7){if(_7){_3.logWarn("couldn't create palette nodes from code; unable to validate");return}
var _4=isc.EditContext.validatePaletteNodeDefaults(_6);_3.fireCallback(_2,"errorList",[_4])})}
,isc.A.$259d=function isc_c_EditContext__prettyPrintPaletteNodes(_1){var _2=[];if(_1)for(var i=0;i<_1.length;i++){var _4=isc.Tree.getCleanNodeData(_1[i],true,true);var _5=this.$259e(_4);_2.add(_5)}
return"////////////////////// CREATED EDIT NODES /////////////////////\n"+isc.echoFull(_2)+"\n"}
,isc.A.$259e=function isc_c_EditContext___summarizeTreeDataForPrinting(_1,_2){if(!_2)_2=1;var _3={};for(var _4 in _1){var _5=_1[_4];if(_5==null||_4=="liveObject")continue;if(isc.isAn.Array(_5)){var _6=[];for(var i=0;i<_5.length;i++){_6[i]=this.$259e(_5[i],_2+1)}
_5=_6}else if(isc.isAn.Object(_5)){_5=this.$259e(_5,_2+1)}
_3[_4]=_5}
return _3}
,isc.A.createPaletteNodesFromJS2=function isc_c_EditContext_createPaletteNodesFromJS2(_1,_2){var _3=this;if(_2==null){_2=function(_11){console.log(isc.EditContext.$259d(_11))}}
var _4=isc.EditContext.screenMode;isc.EditContext.screenMode=true;try{var _5=isc.Canvas.create();var _6={type:"Canvas",liveObject:_5
};var _7={rootComponent:_6
};var _8=isc.EditContext.create(_7);_8.getPaletteNodesFromJS(_1.toString(),function(_11){var _9=_8.createPaletteNodeTree(isc.clone(_11));_8.addPaletteNodeFormItemConstructors(_9);var _10=_9.getCleanNodeData(_9.getChildren(_9.getRoot()),true);_3.fireCallback(_2,"nodes,topLevelNodes",[_11,_10]);_9.destroy();_8.destroy()})}catch(e){isc.logWarn("Failed to convert "+_1+" to edit nodes: "+e+"\n"+e.stack);if(_8)_8.destroy();this.fireCallback(_2,"nodes,topLevelNodes,error",[null,null,true])}finally{if(_4==null)delete isc.EditContext.screenMode;else isc.EditContext.screenMode=_4}
}
,isc.A.validatePaletteNodeDefaults=function isc_c_EditContext_validatePaletteNodeDefaults(_1,_2){var _3={},_4=[]
;try{this.$259i(_1,null,null,{editPane:_2,proxyForms:_3,errorList:_4
})}finally{for(var _5 in _3){_3[_5].markForDestroy()}
}
if(_4.length)return _4}
,isc.A.$259i=function isc_c_EditContext__validatePaletteNodeDefaults(_1,_2,_3,_4){var _5=_4.editPane,_6=_4.errorList,_7=_4.proxyForms
;var _8=_3?{}:null;if(!_3)_3="";else _3+="/";for(var i=0;i<_1.length;i++){var _10=_1[i],_11=_10.defaults;if(!_11)continue;var _12=_11._constructor||_10.type;if(_12=="FormItem"){var _13=_5.getEditContext().getEditNodeTree();_12=isc.Reify.$259h(_10,_13,_7)}
if(!_12)continue;var _14=_10.parentProperty;if(!_14){_14=_2?isc.DS.getObjectField(_2,_10.type):"root"}
if(!_14)continue;var _15;if(_8){if(!_8[_14])_8[_14]=0;_15=_8[_14]++}else{_15=i}
var _16=_15+"||className="+_12;if(_11.ID)_16+="||ID="+_11.ID;else if(_11.name)_16+="||name="+_11.name;else if(_11.title)_16+="||title="+encodeURI(_11.title);var _17=_3+_14+"["+_16+"]";var _18=isc.DS.get(_12);if(!_18)continue;_18.$259i(_11,_12,_17,_4);var _19=_10.children;if(_19&&_19.length){this.$259i(_19,_10.liveObject,_17,_4)}
}
return _1}
,isc.A.getMissingRequiredProperties=function isc_c_EditContext_getMissingRequiredProperties(_1){var _2=_1.requiredProperties,_3
;if(!_2&&_1.defaults&&_1.defaults.placeholderDefaults){_2=_1.defaults.placeholderDefaults.requiredProperties}
if(_2){_2=_2.split(",").map(function(_6){return _6.trim()});_3=[];var _4=_1.defaults||{};for(var i=0;i<_2.length;i++){if(_4[_2[i]]==null){_3.add(_2[i])}
}
}
return(_3&&_3.length>0?_3.join(","):null)}
);isc.B._maxIndex=isc.C+8;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,_2){if(!_2&&isc.EditContext.screenMode){this.logWarn("Cannot create an EditNode without the target EditContext when operating in ScreenMode");return null}
if(!_1)_1=this.getDragData();if(isc.isAn.Array(_1))_1=_1[0];var _3=_1.type||_1.className;if(!isc.SGWTFactory.getFactory(_3)&&_3.contains("."))_3=_3.split(/\./).pop();var _4={editContext:_2||this.defaultEditContext,type:_3,_constructor:_3,idName:_1.idName,idPrefix:_1.idPrefix,canDuplicate:_1.canDuplicate,title:_1.title,icon:_1.icon,iconSize:_1.iconSize,showDropIcon:_1.showDropIcon,useEditMask:_1.useEditMask,autoGen:_1.autoGen,editProxyProperties:_1.editProxyProperties,requiredProperties:_1.requiredProperties,recreateOnChange:_1.recreateOnChange,alwaysUsePlaceholder:_1.alwaysUsePlaceholder,parentProperty:_1.parentProperty
};if(_1.dropped!=null)_4.dropped=_1.dropped;isc.EditContext.copyPaletteNodeBehaviors(_4,_1);_4=isc.EditContext.getNonNullProperties(_4);if(isc.isAn.Object(_1.editNodeProperties)){for(var _5 in _1.editNodeProperties){_4[_5]=_1.editNodeProperties[_5]}
}
if(_1.makeComponent){_4.liveObject=_1.makeComponent(_4);return _4}
var _6=_1.defaults;_4.ID=_1.ID||(_6?isc.DS.getAutoId(_6,_1):null);var _7=true;if(_1.loadData&&!_1.isLoaded){_4.deferCreation=_1.deferCreation;_4.loadData=_1.loadData}else if(_1.wizardConstructor){_4.wizardConstructor=_1.wizardConstructor;_4.wizardDefaults=_1.wizardDefaults}else if(_1.liveObject){var _8=_1.liveObject;if(isc.isA.String(_8))_8=window[_8];_4.liveObject=_8
}else{_4=this.createLiveObject(_1,_4,_2);_7=false}
if(_7){_4.defaults=isc.addProperties({},_1.defaults);delete _4.defaults[isc.gwtRef];delete _4.defaults[isc.gwtModule];delete _4.defaults["xsi:type"]}
if(_4.defaults&&!_4.defaults._constructor){_4.defaults._constructor=_3}
return _4},makeNewComponent:function(_1){return this.makeEditNode(_1)},generateNames:true,typeCount:{},getNextAutoId:function(_1,_2,_3,_4){if(_2==null){_2="Object"}else{if(_2.contains("."))_2=_2.split(/\./).pop()}
var _5,_6=this.getTypeCounts(_1);_6[_2]=_6[_2]||0;var _7=_1&&_1.getEditNodeTree(),_8=isc.DS.getAutoIdField(_3);if(_1&&(_8=="name"||(_8=="id"&&_2=="NavItem"))){var _9=_1.getEditNodeArray(),_10=_9&&_9.map(function(_15){var _11=_7&&_7.getParent(_15);if(_15.parentProperty=="items"){if(_11&&_11.type=="SectionItem"){return _15.ID}
}
return((_15.parentProperty=="fields"||_11&&(_11.type=="DynamicForm"||_11.type=="NavPanel"||_11.type=="NavItem"))?_15.ID:null)})
;if(_10){while(_10.contains(_5=_2+_6[_2]++)){}
}else{while(window[(_5=_2+_6[_2]++)]!=null){}
}
}else if(isc.EditContext.screenMode){var _12=(_7&&_7.getChildren(_7.getRoot()))||[],_13;for(var i=0;i<_12.length;i++){var _15=_12[i];if(_15&&_15.liveObject&&_15.liveObject.$112p){_13=_15.liveObject}
}
if(_13){while(_13.getByLocalId(_5=_2+_6[_2]++)!=null){}
}else{while(window[(_5=_2+_6[_2]++)]!=null){}
}
}else{while(window[(_5=_2+_6[_2]++)]!=null){}
}
return _5},getTypeCounts:function(_1){var _2=(_1?_1.ID:"default");if(!this.typeCount[_2])this.typeCount[_2]={};return this.typeCount[_2]},findPaletteNode:function(_1,_2){return null},createLiveObject:function(_1,_2,_3){var _4=_1.type||_1.className;if(_4.contains(".")&&!isc.SGWTFactory.getFactory(_4))_4=_4.split(/\./).pop();var _5=isc.ClassFactory.getClass(_4),_6=isc.DS.getNearestSchema(_4),_7={},_8=(_6?_6.shouldCreateStandalone():true),_9=_1.defaults||{};var _10;if(_6&&!_5){_5=isc.DS.getNearestSchemaClass(_6);if(_5){_4=_5.getClassName();_10=true}
}
var _11={};if(_5&&_5.isA("Canvas")){_7.$216x=(_1.defaults&&(_1.defaults.autoDraw==null||_1.defaults.autoDraw!==false)?true:false);_7.autoDraw=false;_11.autoDraw=false}
if(_9.title){_7.title=_9.title}
if(this.generateNames&&(_6.addGlobalId==null||_6.addGlobalId!=false)){var _12=isc.DS.getToolAutoIdField(_4),_13=isc.DS.getUsedAutoIdField(_9)
;if(!_3)_3=this.defaultEditContext;var _14=_2.ID||isc.DS.getAutoId(_9),_15=(_3?_3.reassignIDs:null)
;if(_14==null||_15){if(_15){var _16=_6.getAutoIdField();delete _9[_16];_13=null;var _17=this.findPaletteNode("type",_1.type);if(_17){_1.idName=_17.idName;_1.idPrefix=_17.idPrefix}
}
_14=this.getNextAutoId(_3,_1.idName||_1.idPrefix||_1.type,_1);_7[_12]=_14}
_2.ID=_14;if(_9.builderAutoID){_7[_12]=_14;var _16=_6.getAutoIdField();delete _7[_16];delete _9[_16];delete _9.builderAutoID}else if(_13){_7[_13]=_14}
if(_6&&_6.getField("title")&&!_6.inheritsSchema("ListGridField")&&!isc.isA.FormItem(_5)&&!(isc.isA.DrawItem&&isc.isA.DrawItem(_5))&&!(isc.isA.LayoutResizeBar&&isc.isA.LayoutResizeBar(_5))&&!(isc.isA.LayoutResizeSnapbar&&isc.isA.LayoutResizeSnapbar(_5))&&_4!="MenuItem"&&!_7.title
){_7.title=_14}
}
_7=_2.defaults=isc.addProperties(_7,this.componentDefaults,_9
);delete _7[isc.gwtRef];delete _7[isc.gwtModule];delete _7["xsi:type"];_7._constructor=_4;for(var _18 in _7){var _19=_7[_18];if(isc.isAn.Array(_19)&&(!_5||_5.getInstanceProperty(_18)!==_19)
){_19=_7[_18]=_19.duplicate();for(var i=_19.length;i--;){if(isc.isAn.Array(_19[i])){_19[i]=_19[i].duplicate()}
}
}
}
var _21=(_1.alwaysUsePlaceholder==true||_1.alwaysUsePlaceholder=="true");if(_1.requiredProperties||_21){var _22=isc.EditContext.getMissingRequiredProperties(_1);if(_22||_21){var _23=_7.placeholderDefaults||{};if(_7._constructor!="Placeholder"){_23.placeholderFor=_7._constructor}
if(_22){_23.requiredProperties=_22}else{delete _23.requiredProperties}
if(_1.placeholderProperties){isc.addProperties(_23,_1.placeholderProperties)}
if(_1.placeholderImage){_23.image=_1.placeholderImage}
_7._constructor="Placeholder";_7.placeholderDefaults=_23}else if(_1.type=="Placeholder"){_7._constructor=_2._constructor=_2.type=_7.placeholderDefaults.placeholderFor;delete _7.placeholderDefaults}
}
var _24,_25=(_5&&_5.isA("DataSource")),_26=(!_25&&isc.EditContext.shouldSuppressLiveObject&&isc.EditContext.shouldSuppressLiveObject(_4,_5))
;if(_5&&_8&&!_26){if(_25&&isc.DataSource.get(_14)!=null){_24=isc.DataSource.get(_14)}else{try{var _27=_7,_28=_7._constructor,_29=isc.ClassFactory.getClass(_28)
;if(isc.EditContext.screenMode&&!isc.isA.DataSource(_29)){_27=isc.clone(_7);delete _27.ID;delete _27.autoID}
if(isc.EditContext.suppressLiveObjects){_27=isc.clone(_7)}
_24=isc.ClassFactory.newInstance(_27,_11);if(isc.EditContext.screenMode&&(_24&&_7.ID||_7.autoID)){_24.$177g=_7.ID||_7.autoID}
}catch(e){if(isc.EditContext.suppressPlaceholders){_2.generatedType=true;_24=isc.shallowClone(_7);delete _24._constructor}else{var _6=isc.DS.get(_4);if(!_6.componentSchema){var _1=this.findPaletteNode(_4);this.logWarn("Palette failed to create component, type: "+_4+", ID: "+_14+", error: "+e+", defaults: "+this.echo(_7),"componentExceptions");var _23={placeholderFor:_4,failedCreate:true,errorMessage:e
};if(_1&&_1.placeholderDefaults){isc.addProperties(_23,_1.placeholderDefaults)}
_24=isc.Placeholder.create(_7,_11,{placeholderDefaults:_23});if(this.failedCreate){var _30="<b>"+_4+"</b> could not be created:<br>"+e;this.failedCreate(_4,e,_30)}
}else{throw e}
}
}
}
}else{_2.generatedType=true;_24=isc.shallowClone(_7)}
_2.liveObject=_24;this.logInfo("palette created component, type: "+_4+", ID: "+(isc.EditContext.screenMode?_24.ID+" ("+_14+")":_14)+(this.logIsDebugEnabled("editing")?", defaults: "+this.echo(_7):"")+", liveObject: "+this.echoLeaf(_24),"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;isc.HiddenPalette.standardHiddenPalette=isc.HiddenPalette.create({data:[{title:"ListGrid Field",type:"ListGridField"},{title:"TreeGrid Field",type:"TreeGridField"},{title:"TileGrid Field",type:"TileGridField"},{title:"DetailGrid Field",type:"DetailGridField"},{title:"Section",type:"SectionStackSection"},{title:"Menu Item",type:"MenuItem"},{title:"Tab",type:"Tab"}
]});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.canShowFilterEditor=false;isc.A.canSaveSearches=false;isc.A.canDragRecordsOut=true;isc.B.push(isc.A.recordDoubleClick=function isc_TreePalette_recordDoubleClick(_1,_2){if(!_2||_2.canSelect==false||_2.canSelect=="false")return;if(!_2.type)return;var _3=this.defaultEditContext;if(_3){if(isc.isA.String(_3)&&this.creator)_3=this.creator[_3];if(isc.isAn.EditContext(_3)){var _4=_2;var _5=_3.getDefaultParent(_4,true);if(_5==null){isc.warn("No default parent can accept a component of this type")}else{_4=this.data.getCleanNodeData(_4,false,false,false);_4.dropped=true;var _6=_3.getEditNodeTree().getDescendants(_5).length;if(!_5.liveObject.editProxy){_5=this.data.getParent(_5)}
if(_5==null){isc.warn("No default parent can accept a component of this type")}else{if(!isc.isA.DynamicForm(_5.liveObject)&&_5.liveObject.editProxy){_5.liveObject.editProxy.completeDrop(_4,{index:_6},null,this)}else{var _7=this.makeEditNode(_4);_7.dropped=true;_5.liveObject.editProxy.completeItemDrop(_7,_6)}
}
}
}
}
}
,isc.A.findPaletteNode=function isc_TreePalette_findPaletteNode(_1,_2){var _3=this.getDataSource(),_4=(_3?_3.getCacheData():null)||this.data,_5=_4?_4.find(_1,_2):null
;return(_5?this.data.getCleanNodeData([_5],false,false,false)[0]:null)}
,isc.A.transferDragData=function isc_TreePalette_transferDragData(_1){return this.getDragData()}
,isc.A.dragStart=function isc_TreePalette_dragStart(_1,_2,_3){var _4=this.invokeSuper(isc.TreePalette,"dragStart",_1,_2,_3);if(_4)isc.EH.setDragTracker(null,null,null,-2,-2);return _4}
);isc.B._maxIndex=isc.C+4}
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.A.canShowFilterEditor=false;isc.A.canSaveSearches=false;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",componentSchema:true,Contructor:"EditPane",addGlobalId:false,fields:[{name:"children",type:"Canvas",multiple:true},{name:"extraPalettes",type:"any",multiple:true,propertiesOnly: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.border="1px solid black";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
};if(this.useCopyPasteShortcuts){if(!_1.editProxyProperties)_1.editProxyProperties={};_1.editProxyProperties.useCopyPasteShortcuts=true}
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,useCopyPasteShortcuts:this.useCopyPasteShortcuts
});this.editContext=this.createAutoChild("editContext",_2);this.data=[];this.createSelectionModel();if(this.editMode)this.setEditMode(true,this.editContext,this.editContext.getRootEditNode())}
,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(function(_5){_5.setEditMode(_1,_2,_5.editNode)});if(_1){if(this.contextMenu==null){this.contextMenu={$1894:true,autoDraw:false,data:[{title:"Clear",click:"target.destroyAll()"}]
}}
}else if(this.contextMenu&&this.contextMenu.$1894){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=this.Super("getObjectField",arguments);if(_2){return _2}
var _3=isc.DS.getNearestSchemaClass(_1);if(_3==null){_3=isc.ClassFactory.getClass(_1)}
if(isc.isA.Canvas(_3)){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&&_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.getEditNodeTree=function isc_EditPane_getEditNodeTree(){return this.editContext.getEditNodeTree()}
,isc.A.addNode=function isc_EditPane_addNode(_1,_2,_3,_4,_5,_6,_7){return this.editContext.addNode(_1,_2,_3,_4,_5,_6,_7)}
,isc.A.addFromPaletteNode=function isc_EditPane_addFromPaletteNode(_1,_2,_3,_4,_5,_6,_7){return this.editContext.addFromPaletteNode(_1,_2,_3,_4,_5,_6,_7)}
,isc.A.addFromPaletteNodes=function isc_EditPane_addFromPaletteNodes(_1,_2,_3,_4,_5,_6){return this.editContext.addFromPaletteNodes(_1,_2,_3,_4,_5,_6)}
,isc.A.removeNode=function isc_EditPane_removeNode(_1,_2,_3){return this.editContext.removeNode(_1,_2,_3)}
,isc.A.destroyNode=function isc_EditPane_destroyNode(_1,_2,_3){return this.editContext.destroyNode(_1,_2,_3)}
,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.getNodeProperty=function isc_EditPane_getNodeProperty(_1,_2){return this.editContext.getNodeProperty(_1,_2)}
,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.makePaletteNode=function isc_EditPane_makePaletteNode(_1){return this.editContext.makePaletteNode(_1)}
,isc.A.makePaletteNodeTree=function isc_EditPane_makePaletteNodeTree(_1){return this.editContext.makePaletteNodeTree(_1)}
,isc.A.copyEditNodes=function isc_EditPane_copyEditNodes(_1){this.editContext.copyEditNodes(_1)}
,isc.A.pasteEditNodes=function isc_EditPane_pasteEditNodes(_1){this.editContext.pasteEditNodes(_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.getPaletteNodesFromJS=function isc_EditPane_getPaletteNodesFromJS(_1,_2,_3){return this.editContext.getPaletteNodesFromJS(_1,_2,_3)}
,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.A.undo=function isc_EditPane_undo(){return this.editContext.undo()}
,isc.A.redo=function isc_EditPane_redo(){return this.editContext.redo()}
,isc.A.resetUndoLog=function isc_EditPane_resetUndoLog(){return this.editContext.resetUndoLog()}
,isc.A.$259d=function isc_EditPane__prettyPrintPaletteNodes(_1){var _2=[];if(_1)for(var i=0;i<_1.length;i++){var _4=isc.Tree.getCleanNodeData(_1[i],true,true);var _5=this.$259e(_4);_2.add(_5)}
return"////////////////////// CREATED EDIT NODES /////////////////////\n"+isc.echoFull(_2)+"\n"}
,isc.A.$259e=function isc_EditPane___summarizeTreeDataForPrinting(_1,_2){if(!_2)_2=1;var _3={};for(var _4 in _1){var _5=_1[_4];if(_5==null||_4=="liveObject")continue;if(isc.isAn.Array(_5)){var _6=[];for(var i=0;i<_5.length;i++){_6[i]=this.$259e(_5[i],_2+1)}
_5=_6}else if(isc.isAn.Object(_5)){_5=this.$259e(_5,_2+1)}
_3[_4]=_5}
return _3}
);isc.B._maxIndex=isc.C+43;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="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.canShowFilterEditor=false;isc.A.canSaveSearches=false;isc.A.editContextConstructor="EditContext";isc.B.push(isc.A.initWidget=function isc_EditTree_initWidget(){this.fields=[{name:"ID",title:"ID",type:"identifier",width:"*",formatCellValue:function(_16,_17,_4,_18,_3){var _1=_3.getEditContext();return _1.getEditNodeIDDescription(_17)},validators:[{type:"required",stopIfFalse:true},{type:"custom",defaultErrorMessage:"Two fields in the same component cannot have the same name",condition:function(_16,_17,_18,_19,_20){var _2=isc.DS.getAutoIdField(_19),_3=_20.component,_4=_20.rowNum,_5=_3.getRecord(_4)
;if(_2=="name"){var _6=_3.data,_7=_6.getParent(_5)
;if(_7){var _8=_6.getChildren(_7);for(var i=0;i<_8.length;i++){var _10=_8[i],_11=isc.DS.getAutoIdField(_10)
;if(_10!=_5&&_11=="name"&&_18==_10[_2])
{return false}
}
}
}else{var _1=_3.getEditContext(),_6=_1.getEditNodeTree(),_12=_6.findAll("ID",_18),_13=isc.DS.getToolAutoIdField(_19)
;if(_12){for(var i=0;i<_12.length;i++){var _14=_12[i];if(_14!=_5&&(_1.getNodeProperty(_14,_2)==_18||_1.getNodeProperty(_14,_13)==_18))
{_17.errorMessage="ID must be unique within the screen";return false}
}
}
}
return true}
}
]
},{name:"type",title:"Type",width:"*",canEdit:false,formatCellValue:function(_16,_17,_4,_18,_3){var _1=_3.getEditContext(),_15=_1.getTitleForType(_16)
;return _15}
}
];this.Super("initWidget",arguments);this.configureEditContext();this.observe(this,"nodeClick","observer.selectedNodeUpdated(true)");this.setData(this.editContext.getEditNodeTree())}
,isc.A.canEditCell=function isc_EditTree_canEditCell(_1,_2){var _3=this.getRecord(_1),_4=this.getFieldName(_2)
;if(_4=="ID"&&_3.ID==null)return false;return this.Super("canEditCell",arguments)}
,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,useCopyPasteShortcuts:this.useCopyPasteShortcuts
});this.editContext=this.createAutoChild("editContext",isc.addProperties({},this.editContextProperties,_2))}
this.editContext.addProperties({getDefaultParent:function(_5,_6){return _1.getDefaultParent(_5,_6)},$143b:this.editContext.nodeAdded,nodeAdded:function(_5,_6,_7){if(this.$143b)this.$143b(_5,_6,_7);_1.selectSingleRecord(_5);if(!isc.$75u){var _3=_1.getRecordIndex(_5)
if(_1.isDrawn()){var _4=_1.getVisibleRows();if(_3<_4[0]||_4[1]<_3){_1.scrollRecordIntoView(_3)}
}
}
if(_1.autoShowParents)_1.showParents(_5);if(_1.creator&&_1.creator.editingOn)this.enableEditing(_5);if(_1.nodeAdded)_1.nodeAdded(_5,_6,_7)},$1453:this.editContext.getSelectedLabelText,getSelectedLabelText:function(_5){return(_1.getSelectedLabelText
?_1.getSelectedLabelText(_5)
:(this.$1453?this.$1453(_5):_5.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]);if(!this.$2374){this.scrollToRow(this.getRecordIndex(_1[0]))}
}else{this.deselectAllRecords()}
}
,isc.A.selectedNodeUpdated=function isc_EditTree_selectedNodeUpdated(_1){var _2=this.getSelectedRecord(),_3=_2&&_2.liveObject;for(var _4=_2;_4!=null;_4=this.data.getParent(_4)){var _5=_4.liveObject;if(isc.isA.Canvas(_5)&&!isc.isA.Menu(_5)&&(!_5.isDrawn()||!_5.isVisible())&&_5.draw!=isc.Canvas.NO_OP&&_5.showRecursively)
{_5.showRecursively();if(_5.isVisible()&&!_5.isDrawn()){this.delayCall("selectedNodeUpdated",[_1]);return}
}
if(((isc.isA.Canvas(_5)||isc.isA.FormItem(_5))&&_5.isDrawn()&&_5.isVisible())||(_5!=null&&_5.$73a!=null))
{if(_1){this.$2374=true}
if(_4===_2){isc.EditContext.selectCanvasOrFormItem(_5,false,true)}else{var _6=this.editContext.getSelectedEditNodes();if(!_6.contains(_4)){isc.EditContext.selectCanvasOrFormItem(_5,false,true);if(!isc.isA.DataSource(_3)&&!isc.isA.DynamicProperty(_3))
{this.selectSingleRecord(_2)}
}else if(isc.isA.DataSource(_3)||isc.isA.DynamicProperty(_3))
{this.selectSingleRecord(_4)}
}
delete this.$2374;break}
if(isc.isA.ValuesManager(_5)){isc.EditContext.selectCanvasOrFormItem(_5,false,true);break}
if(_5&&_5.editProxy&&_5.editProxy.canSelect==true){var _7=_5.editContext;_7.selectSingleComponent(_5);break}
}
}
,isc.A.switchEditMode=function isc_EditTree_switchEditMode(_1){this.editContext.switchEditMode(_1)}
,isc.A.getEventDragData=function isc_EditTree_getEventDragData(){var _1=this.ns.EH.dragTarget.getDragData();if(!_1)return;if(isc.isAn.Array(_1)){if(_1.length==0)return;_1=_1[0]}
return _1}
,isc.A.dragStart=function isc_EditTree_dragStart(){var _1=this.getEventDragData();if(!_1)return;if(_1.canReparent==false||_1.canReparent=="false"){return false}
return this.Super("dragStart",arguments)}
,isc.A.isValidDropFolder=function isc_EditTree_isValidDropFolder(_1){if(!this.Super("isValidDropFolder",arguments))return false;var _2=this.getEventDragData();if(!_2)return false;var _3=this.ns.EH.dragTarget;if(_1==null)_1=this.data.getRoot();var _4=_2.type||_2.className;if(!_4)return false;return this.editContext.canAddToTarget(_1,_4,_3,_2,true)}
,isc.A.shouldShowDropIconForCell=function isc_EditTree_shouldShowDropIconForCell(_1){var _2=this.getEventDragData();if(_2&&_2.alwaysAllowRootDrop==true||_2.alwaysAllowRootDrop=="true"){return false}
return this.Super("shouldShowDropIconForCell",arguments)}
,isc.A.dropMove=function isc_EditTree_dropMove(){var _1=this.Super("dropMove",arguments);if(_1==false)return;if(this.body.$uh){this.hideDragLine()}
return _1}
,isc.A.shouldShowDragLineForRecord=function isc_EditTree_shouldShowDragLineForRecord(_1){var _2=this.getEventDragData();if(!_2)return;if(_2.alwaysAllowRootDrop==true||_2.alwaysAllowRootDrop=="true"){return false}
return this.Super("shouldShowDragLineForRecord",arguments)}
,isc.A.adjustDropIndex=function isc_EditTree_adjustDropIndex(_1,_2,_3){if(_3==null)return _3;var _4=this.data.getChildren(_2),_5=isc.DataSource.getNearestSchemaClass(_1.type)
;if(_5&&_5.isA(isc.DataSource)){_3=0}else{for(var i=0;i<Math.min(_3,_4.length);i++){if(isc.isA.DataSource(_4[i].liveObject)){_3--;break}
}
}
return _3}
,isc.A.updateDropFolder=function isc_EditTree_updateDropFolder(_1){this.Super("updateDropFolder",arguments);if(!isc.isA.Tree(this.data))return;var _2=this.ns.EH.dragTarget,_3=_2&&_2.$264u;if(_3){this.setLocalDragTracker(this.createLocalDragTracker(_1))}
}
,isc.A.createLocalDragTracker=function isc_EditTree_createLocalDragTracker(_1){var _2=_1&&_1.defaults,_3=isc.DS.getAutoIdField(_1),_4=isc.DS.getToolAutoIdField(_1),_5=_1&&_1.icon,_6=(_2&&(_2[_3]||_2[_4]))
;return["<table><tr>","<td>&gt;</td>",(_5?"<td>"+this.imgHTML(_5,16,16)+"</td>":""),"<td>",_6,"</td>","</tr></table>"].join(isc.emptyString)}
,isc.A.setLocalDragTracker=function isc_EditTree_setLocalDragTracker(_1){var _2=this.ns.EH.dragTarget,_3=_2&&_2.$264u,_4=this.getDragTracker()
;if(!_3)return;if(!_1){if(_3!=_4){isc.EH.setDragTracker(_3)}
}else{var _5=["<table><tr>","<td>",_3,"</td>","<td>",_1,"</td>"].join(isc.emptyString);if(_5!=_4){isc.EH.setDragTracker(_5)}
}
}
,isc.A.getDragTracker=function isc_EditTree_getDragTracker(){return isc.EH.dragTracker&&isc.EH.dragTracker.contents}
,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){var _5=_4.transferDragData();if(!_5)return;if(isc.isAn.Array(_5))_5=_5[0];if(_4.isA("TreePalette")){_5=_4.data.getCleanNodeData([_5],false,false,false)[0]}
_5=isc.clone(_5);_5.dropped=true;this.logInfo("sourceWidget is a Palette, dropped node of type: "+_5.type,"editing");_3=this.adjustDropIndex(_5,_2,_3);if(!_2.liveObject.editProxy){_2=this.data.getParent(_2)}
if(!isc.isA.DynamicForm(_2.liveObject)&&_2.liveObject.editProxy){_2.liveObject.editProxy.completeDrop(_5,{index:_3})}else{var _6=this.makeEditNode(_5);_6.dropped=true;_2.liveObject.editProxy.completeItemDrop(_6,_3)}
return}
var _7=(isc.isAn.Array(_1)?_1[0]:_1);_7.dropped=true;this.logInfo("sourceWidget is an existing editNode, dropped node of type: "+_7.type,"editing");var _8=this;this.editContext.requestLiveObject(_7,function(_21){if(_21==null)return;var _9=_7.parentProperty;var _10=_8.data.getParent(_7);if(_2==_10){var _11=_8.data.getChildren(_10).indexOf(_7);if(_11!=null&&_11<=_3){_3--}
}else{_9=null;delete _21.parentProperty}
var _12=_8.data.isOpen(_7);var _13=_8.data.getChildren(_7);if(_13&&_13.length>0){_13=_13.duplicate();for(var i=0;i<_13.length;i++){var _15=this.getLiveObject(_13[i]);if(this.isComponentSelected(_15)){this.deselectComponents(_15,true)}
this.removeNode(_13[i],!isc.isA.FormItem(_15),true)}
if(isc.isA.CanvasItem(_7.liveObject)&&!isc.isA.SectionItem(_7.liveObject)){_7.liveObject.autoDestroy=false}
}
var _16=_2.liveObject&&_2.liveObject.editProxy;if(_16&&_16.adjustRepositionIndex){_3=_16.adjustRepositionIndex(_10,_7,_3,_9)}
var _17=_21.liveObject&&_21.liveObject.editProxy,_18=false
;if(_17){var _5=this.makePaletteNode(_21),_19=_17.substituteNode(_2,_5)
;if(_5!==_19){if(_5.defaults){_19.defaults=isc.clone(_5.defaults)}
_21=_8.editContext.makeEditNode(_19);_18=true}
}
_8.editContext.removeNode(_7,null,true);_8.editContext.addNode(_21,_2,_3,_9,null,null,true);if(_13){for(var i=0;i<_13.length;i++){var _20=_13[i];if(isc.isA.FormItem(_20.liveObject)){var _5=_8.editContext.makePaletteNode(_20);_20=_8.editContext.makeEditNode(_5)}
this.addNode(_20,_21,null,null,null,null,true)}
this.selectSingleEditNode(_21)}
if(!_12)_8.closeFolder(_21);_8.editContext.fireNodeMoved(_7,_10,_21,_2);if(_18){_8.editContext.destroyNode(_7)}
},_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.canAddToTarget(_4,_3,null,null,true)||(_4.liveObject.editProxy&&_4.liveObject.editProxy.allowNestedDrops==false)))
{_4=this.data.getParent(_4)}
var _5=this.data.getRoot()
if(_2){if(!_4&&this.editContext.canAddToTarget(_5,_3,null,null,true))return _5;return _4}
return _4||_5}
,isc.A.showParents=function isc_EditTree_showParents(_1){if(isc.$75u)return;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.getCleanComponentData=function isc_EditTree_getCleanComponentData(){var _1=this.data;if(!_1)return;var _2=_1.getCleanNodeData(_1.root,true,true);if(_2)_1.clearProperties(_2,"liveObject",true);return _2}
,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.getEditNodeTree=function isc_EditTree_getEditNodeTree(){return this.editContext.getEditNodeTree()}
,isc.A.addNode=function isc_EditTree_addNode(_1,_2,_3,_4,_5,_6,_7){return this.editContext.addNode(_1,_2,_3,_4,_5,_6,_7)}
,isc.A.addFromPaletteNode=function isc_EditTree_addFromPaletteNode(_1,_2,_3,_4,_5,_6,_7){return this.editContext.addFromPaletteNode(_1,_2,_3,_4,_5,_6,_7)}
,isc.A.addFromPaletteNodes=function isc_EditTree_addFromPaletteNodes(_1,_2,_3,_4,_5,_6){return this.editContext.addFromPaletteNodes(_1,_2,_3,_4,_5,_6)}
,isc.A.removeNode=function isc_EditTree_removeNode(_1,_2,_3){return this.editContext.removeNode(_1,_2,_3)}
,isc.A.destroyNode=function isc_EditTree_destroyNode(_1,_2,_3){return this.editContext.destroyNode(_1,_2,_3)}
,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.getNodeProperty=function isc_EditTree_getNodeProperty(_1,_2){return this.editContext.getNodeProperty(_1,_2)}
,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.makePaletteNode=function isc_EditTree_makePaletteNode(_1){return this.editContext.makePaletteNode(_1)}
,isc.A.makePaletteNodeTree=function isc_EditTree_makePaletteNodeTree(_1){return this.editContext.makePaletteNodeTree(_1)}
,isc.A.copyEditNodes=function isc_EditTree_copyEditNodes(_1){this.editContext.copyEditNodes(_1)}
,isc.A.pasteEditNodes=function isc_EditTree_pasteEditNodes(_1){this.editContext.pasteEditNodes(_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.getPaletteNodesFromJS=function isc_EditTree_getPaletteNodesFromJS(_1,_2,_3){return this.editContext.getPaletteNodesFromJS(_1,_2,_3)}
,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.A.undo=function isc_EditTree_undo(){return this.editContext.undo()}
,isc.A.redo=function isc_EditTree_redo(){return this.editContext.redo()}
,isc.A.resetUndoLog=function isc_EditTree_resetUndoLog(){return this.editContext.resetUndoLog()}
);isc.B._maxIndex=isc.C+56;isc.defineClass("Placeholder","Label");isc.A=isc.Placeholder;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.create=function isc_c_Placeholder_create(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13){if(!isc.captureDefaults){var _14=isc.addProperties({},_1,_2,_3,_4,_5),_15=_14.placeholderDefaults,_16=_14.autoID,_17=_14.ID
;delete _14.placeholderDefaults;if(isc.$171i&&(!isc.$2095||isc.$2095.allowPlaceholders!=true))
{var _18=_15.placeholderFor;if(_18){try{var _19=isc.ClassFactory.newInstance(_18,_14);if(_19){return _19}
_15.errorMessage="Class not found"}catch(e){_15.errorMessage=e}
_15.failedCreate=true;isc.logWarn("Could not create instance of "+_18+". Placeholder will be used.")}else{isc.logWarn("Placeholder is not configured with a className to create")}
}
_1=isc.addProperties({},_15,{$232f:_14});if(_16)_1.autoID=_16;if(_17)_1.ID=_17;_2=_3=_4=_5=null}
return this.Super("create",[_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13])}
);isc.B._maxIndex=isc.C+1;isc.A=isc.Placeholder;isc.A.newInstance=isc.Placeholder.create;isc.A=isc.Placeholder.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$232d=true;isc.A.editProxyProperties={supportsInlineEdit:false
};isc.A.padding=10;isc.A.align="center";isc.A.valign="center";isc.A.border="1px solid red";isc.B.push(isc.A.init=function isc_Placeholder_init(){this.contents=this.$23q();this.prompt=this.$232u();this.useCustomSchema=this.placeholderFor;if(this.placeholderFor){var _1=isc.ClassFactory.getClass(this.placeholderFor);if(_1){this.overflow=_1.getInstanceProperty("overflow");this.defaultWidth=_1.getInstanceProperty("defaultWidth");this.defaultHeight=_1.getInstanceProperty("defaultHeight")}
this.classObject=_1}
this.Super("init",arguments)}
,isc.A.setRequiredProperties=function isc_Placeholder_setRequiredProperties(_1){this.requiredProperties=_1;this.setContents(this.$23q());this.setPrompt(this.$232u())}
,isc.A.$232u=function isc_Placeholder__getMessage(){var _1;if(this.failedCreate){_1="<b>"+this.placeholderFor+"</b> could not be created:<br>"+this.errorMessage}else{_1="<b>Placeholder:</b> "+this.placeholderFor+"<br>"+(this.requiredProperties?"<b>Requires:</b> "+this.requiredProperties:"")}
return _1}
,isc.A.$23q=function isc_Placeholder__getContents(){var _1=this.$232u(),_2=this.image
;if(this.failedCreate){_2=null}
return(_2?this.imgHTML(_2):_1)}
,isc.A.getComponentClassObject=function isc_Placeholder_getComponentClassObject(){if(!this.classObject){this.classObject=isc.ClassFactory.getClass(this.placeholderFor)}
return this.classObject}
,isc.A.getEditableProperties=function isc_Placeholder_getEditableProperties(_1){var _2={},_3,_4
;if(!isc.isAn.Array(_1))_1=[_1];for(var i=0;i<_1.length;i++){var _6=isc.isAn.Object(_1[i])?_1[i].name:_1[i],_7=this.$232f[_6]
;if(_7==_3){_4=this.getComponentClassObject();if(_4){_7=_4.getInstanceProperty(_6)}
}
if(isc.isA.Function(_7)&&_7.$dw){_7=this[_7.$c1]}
_2[_6]=_7}
return _2}
,isc.A.setEditableProperties=function isc_Placeholder_setEditableProperties(_1){var _2=isc.DS.getAutoIdField(this),_3=isc.DS.getToolAutoIdField(this)
;for(var _4 in _1){if(_2&&_3&&_4==_3){this.$232f[_2]=_1[_4]}else{this.$232f[_4]=_1[_4]}
}
}
);isc.B._maxIndex=isc.C+7}
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();this.$175w=_1.form;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()||10);this.setHeight(this.formItem.getVisibleHeight()||10);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.A.dragStart=function isc_FormItemProxyCanvas_dragStart(){if(this.formItem==isc.SelectionOutline.getSelectedObject()){isc.EH.dragStartOffsetX=isc.EH.dragStartOffsetY=0}
return true}
);isc.B._maxIndex=isc.C+5;if(!(isc.licenseType=="Enterprise"||isc.licenseType=="Eval"||isc.licenseType=="Dev"||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.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(_17.value);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.A.filterLiveObjectBySchema=function isc_c_EditProxy_filterLiveObjectBySchema(_1,_2){var _3={};var _4=isc.DS.get(_1);if(!_4)return _3;var _5=_4.fields;for(var _6 in _5){var _7=_2[_6];if(_5.hasOwnProperty(_6)&&_2.hasOwnProperty(_6)){if(!isc.isAn.Object(_7))_3[_6]=_7}
}
return _3}
,isc.A.fieldEdited=function isc_c_EditProxy_fieldEdited(_1,_2){var _3=false;if(_2.defaults){var _4=_2.defaults,_5=false
;var _6=_4.name||_4.autoName,_7,_8
;if(_6&&_1&&_1.dataSource){var _9=_1.dataSource;if(isc.isA.String(_9))_9=isc.DS.getDataSource(_9);if(_9){var _10=_9.getField(_6)
if(_10){_7=_10.type;_8=_10.title}
}
}
var _11=[];for(var _12 in _4){if(_12=="name"||_12=="autoName"||_12=="title"||_12=="parentProperty"||_12.startsWith("_"))continue;if(_12=="type"&&_7&&_7==_4.type)continue;_11.add(_12);_5=true}
if(_5&&_11.length==2&&_11.contains("top")&&_11.contains("left")){_5=false}
if(!_5){var _13=_4.title;if(_13){if((!_8&&_13!=isc.DataSource.getAutoTitle(_6))||(_8&&_13!=_8))
{_3=true}
}
}else{_3=true}
if(!_3&&_2.liveObject&&_2.liveObject.optionDataSource){_3=true}
}
return _3}
);isc.B._maxIndex=isc.C+10;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(_1,_2,_3){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&&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)}
return _1.editProxy.dragRepositionStart()},dragRepositionStop:function(){var _1=this.getTarget();return _1.editProxy.dragRepositionStop()},dragResizeStart:function(){var _1=this.getTarget();return _1.editProxy.dragResizeStart()},dragResizeStop:function(){var _1=this.getTarget();return _1.editProxy.dragResizeStop()},pageKeyPress:function(_1,_2){var _3=this.editContext.getRootEditNode().liveObject;if(!_3.containsFocus())return;var _4=isc.EH.getKey();if(_4==null||(_4!="Arrow_Up"&&_4!="Arrow_Down"&&_4!="Arrow_Left"&&_4!="Arrow_Right"))
{return}
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(_4){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&&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().callMethod("destroy")},componentsBringToFront:function(){this.editContext.getSelectedComponents().callMethod("bringToFront")},componentsSendToBack:function(){this.editContext.getSelectedComponents().callMethod("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();if(this.useCopyPasteShortcuts!=false&&_1&&this.creator.editContext.getRootEditNode().liveObject==this.creator){this.useCopyPasteShortcuts=true;this.enableCopyPasteKeyPressHandler(true)}
}
);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.componentHiddenByRuleMessage="Component would be hidden by visibility rule - edit Visible When property to change";isc.A.componentInitiallyHiddenMessage="Component is marked as initially hidden";isc.A.$1454="tintMask";isc.A.$1455="outlineMask";isc.A.$1456="outlineEdges";isc.A.$1698={"children":true,"peers":true
};isc.A.minimumDropMargin=2;isc.A.minimumDropTargetSize=10;isc.A.defaultDropMargin=16;isc.A.dropMargin=16;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.Canvas(this.creator))this.updateDropMargin();if(this.useEditMask){var _2=this.creator.editContext,_3=_2.getParentNode(this.creator.editNode)
;if(_3&&_3.liveObject)this.showEditMask(_3.liveObject)}
if(this.hasEditMask())this.showEditMask();if(this.useCopyPasteShortcuts!=false&&this.canSelectChildren&&this.creator.editContext.getRootEditNode().liveObject==this.creator)
{this.useCopyPasteShortcuts=true}
if(this.useCopyPasteShortcuts){this.enableCopyPasteKeyPressHandler(true)}
if(this.creator.$231g){this.creator.$231g()}
}else{this.restoreOverrideProperties();this.hideEditMask();this.enableCopyPasteKeyPressHandler(false)}
this.updateVisibilityMask();if(this.persistCoordinates!=null&&isc.isA.String(this.persistCoordinates)){this.persistCoordinates=(this.persistCoordinates=="true")}
}
,isc.A.editNodeUpdated=function isc_EditProxy_editNodeUpdated(_1,_2,_3){this.updateVisibilityMask()}
,isc.A.nodeMoved=function isc_EditProxy_nodeMoved(_1,_2,_3,_4,_5){var _6=this.getVisibilityMaskManager();if(!_6)return;var _7=_1.liveObject,_8
;if(isc.isA.FormItemProxyCanvas(_7)){_8=_7;_7=_7.formItem}
if(isc.isA.FormItem(_7)){_6.removeFormItem(_7.form,_8||_7)}else{_6.removeComponent(_7)}
this.updateVisibilityMask()}
,isc.A.getVisibilityMaskManager=function isc_EditProxy_getVisibilityMaskManager(){var _1=this.creator,_2
;if(_1.editContext&&_1.editContext.getVisibilityMaskManager){_2=_1.editContext.getVisibilityMaskManager()}
return _2}
,isc.A.updateVisibilityMask=function isc_EditProxy_updateVisibilityMask(){var _1=this.creator,_2=_1.editNode,_3=_1.editingOn
;if(_2&&_2.$216v){var _4=_2.defaults||{};if(!_4.visibleWhen)delete _2.$216v}
var _5;if(isc.isA.FormItemProxyCanvas(_1)){_5=_1;_1=_1.formItem}
var _6=this.getVisibilityMaskManager();if(!_6)return;if(_3&&((isc.isA.Window(_1)&&_1.isModal)||(_2&&_2.$216v)))
{var _7=(_2&&_2.$216v
?this.componentHiddenByRuleMessage
:this.componentInitiallyHiddenMessage);if(isc.isA.FormItem(_1)){_6.addFormItem(_1.form,_5||_1,_7)}else{_6.addComponent(_1,_7)}
}else if(_6){if(isc.isA.FormItem(_1)){_6.removeFormItem(_1.form,_5||_1)}else{_6.removeComponent(_1)}
}
}
,isc.A.setHiddenByRule=function isc_EditProxy_setHiddenByRule(_1){var _2=this.creator,_3=_2.editNode
;if(!_3)return;var _4=false;if(_1&&!_3.$216v){_3.$216v=true;_4=true}else if(!_1&&_3.$216v){delete _3.$216v;_4=true}
if(_4)this.updateVisibilityMask()}
,isc.A.getOverrideProperties=function isc_EditProxy_getOverrideProperties(){var _1={canAcceptDrop:true,canDropComponents:true
};if(this.canSelectChildren){isc.addProperties(_1,{canDrag:true,dragAppearance:"none"
})}
if(this.childrenSnapToGrid!=null){if(isc.isA.String(this.childrenSnapToGrid))this.childrenSnapToGrid=(this.childrenSnapToGrid=="true");_1.childrenSnapToGrid=this.childrenSnapToGrid;_1.snapGridStyle="lines"}
if(this.showSnapGrid!=null){if(isc.isA.String(this.showSnapGrid))this.showSnapGrid=(this.showSnapGrid=="true");_1.showSnapGrid=this.showSnapGrid;_1.snapGridStyle="lines"}
if(this.childrenSnapAlign!=null){if(isc.isA.String(this.childrenSnapAlign))this.childrenSnapAlign=(this.childrenSnapAlign=="true");_1.childrenSnapAlign=this.childrenSnapAlign;_1.childrenSnapEdgeAlign=false}
if(this.childrenSnapResizeToGrid!=null){if(isc.isA.String(this.childrenSnapResizeToGrid))this.childrenSnapResizeToGrid=(this.childrenSnapResizeToGrid=="true");_1.childrenSnapResizeToGrid=this.childrenSnapResizeToGrid}
if(this.creator.$231g){_1.autoPopulateData=true}
return _1}
,isc.A.destroy=function isc_EditProxy_destroy(){this.enableCopyPasteKeyPressHandler(false);if(this.inlineEditLayout){this.inlineEditLayout.destroy()}
var _1=this.creator,_2
;if(isc.isA.FormItemProxyCanvas(_1)){_2=_1;_1=_1.formItem}
var _3=this.getVisibilityMaskManager();if(_3){if(isc.isA.FormItem(_1)){_3.removeFormItem(_1.form,_2||_1)}else{_3.removeComponent(_1)}
}
this.Super("destroy",arguments)}
,isc.A.addDynamicProperty=function isc_EditProxy_addDynamicProperty(_1,_2,_3){var _4=this.creator;_4.addDynamicProperty(_1,_2,_3)}
,isc.A.clearDynamicProperty=function isc_EditProxy_clearDynamicProperty(_1){var _2=this.creator;_2.clearDynamicProperty(_1)}
,isc.A.removeDynamicProperty=function isc_EditProxy_removeDynamicProperty(_1){var _2=this.creator;_2.removeDynamicProperty(_1)}
,isc.A.hasDynamicProperty=function isc_EditProxy_hasDynamicProperty(_1){var _2=this.creator;return _2.hasDynamicProperty(_1)}
,isc.A.getDynamicProperty=function isc_EditProxy_getDynamicProperty(_1){var _2=this.creator;return _2.getDynamicProperty(_1)}
,isc.A.enableCopyPasteKeyPressHandler=function isc_EditProxy_enableCopyPasteKeyPressHandler(_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.nodeDropped=function isc_EditProxy_nodeDropped(_1,_2){if(_1.dropped&&this.inlineEditOnDrop){this.delayCall("startInlineEditing")}
if(this.creator.editContext.addUsageRecord){this.creator.editContext.addUsageRecord("componentAdd",_1,_2)}
}
,isc.A.editTitle=function isc_EditProxy_editTitle(_1,_2,_3){var _1=_1||this.creator,_4,_5,_6;if(isc.isA.Button(_1)){if(_1.parentElement&&_1.parentElement.isAnimating&&_1.parentElement.isAnimating()){this.delayCall("editTitle",arguments,100);return}
_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()+":<br>"+_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);if(isc.isA.CanvasItem(_2)){_2.canvas.editProxy=_2.editProxy;_2=_2.canvas}
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=_1.target
;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==this.creator.ns.EH.dragTarget){return false}
if(this.creator.dragMove)return this.creator.dragMove()}
,isc.A.dragRepositionStart=function isc_EditProxy_dragRepositionStart(){var _1;if(this.creator.dragRepositionStart)_1=this.creator.dragRepositionStart();if(this.creator.parentElement&&this.creator.parentElement.editProxy)this.creator.parentElement.editProxy.$1313(true);return _1}
,isc.A.dragRepositionStop=function isc_EditProxy_dragRepositionStop(){var _1;if(this.creator.dragRepositionStop)_1=this.creator.dragRepositionStop();if(this.creator.parentElement&&this.creator.parentElement.editProxy)this.creator.parentElement.editProxy.$1313(false);return _1}
,isc.A.dragResizeStart=function isc_EditProxy_dragResizeStart(){var _1;if(this.creator.dragResizeStart)_1=this.creator.dragResizeStart();if(this.creator.parentElement&&this.creator.parentElement.editProxy)this.creator.parentElement.editProxy.$1313(true);return _1}
,isc.A.dragResizeStop=function isc_EditProxy_dragResizeStop(){var _1;if(this.creator.dragResizeStop)_1=this.creator.dragResizeStop();if(this.creator.parentElement&&this.creator.parentElement.editProxy)this.creator.parentElement.editProxy.$1313(false);return _1}
,isc.A.click=function isc_EditProxy_click(){var _1=this.creator;if(_1.editNode){isc.EditContext.selectCanvasOrFormItem(_1,true);var _2=_1.editContext.getRootEditNode().liveObject;if(!_2.containsFocus()){_2.setFocus(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,_4){var _5,_6=this.$1457()
;if(_6==this.$1454){var _7=this.getEditMask();if(!_7||_7.destroyed)return;if(_7.$1458===_5){_7.$1458=(_7.backgroundColor===_5?null:_7.backgroundColor)}
if(_7.$1459===_5){_7.$1459=(_7.opacity===_5?null:_7.opacity)}
if(_1&&this.selectedTintColor!=_7.backgroundColor){_7.setBackgroundColor(this.selectedTintColor)}else if(!_1&&_7.$1458!=_7.backgroundColor){_7.setBackgroundColor(_7.$1458)}
if(_1&&this.selectedTintOpacity!=_7.opacity){_7.setOpacity(this.selectedTintOpacity)}else if(!_1&&_7.$1459!=_7.opacity){_7.setOpacity(_7.$1459)}
_7.dragResizeAppearance=null;if(_1&&_3)isc.EditProxy.showResizeThumbs(_7);else isc.EditProxy.hideResizeThumbs();if(!_1)_7.moveAbove(this.creator)}else if(_6==this.$1455){var _7=this.getEditMask();if(!_7||_7.destroyed)return;if(_7.$146a===_5){_7.$146a=(_7.border===_5?null:_7.border)}
if(_1&&this.selectedBorder!=_7.border){_7.setBorder(this.selectedBorder)}else if(!_1&&_7.$146a!=_7.border){_7.setBorder(_7.$146a)}
_7.dragResizeAppearance="target";if(_1&&_3)isc.EditProxy.showResizeThumbs(_7);else isc.EditProxy.hideResizeThumbs();if(!_1)_7.moveAbove(this.creator)}else if(_6==this.$1456){var _8=this.creator;if(_1){var _9,_10;if(_8.$73a){var _11=_8.type||_8._constructor;_10="["+_11+" "+(_8.name?"name:":"ID");_10+=_8.name||_8.getLocalId();_10+="]";_9=_8;_8=_8.$73a}
var _12=this.creator.editContext,_13=!_2
;var _14=_12.getRootEditNode().liveObject;if(_14.overflow!="visible"){isc.SelectionOutline.clipCanvas=_12.getRootEditNode().liveObject}
if(this.selectedBorder)isc.SelectionOutline.border=this.selectedBorder;if(_12.selectedLabelBackgroundColor)isc.SelectionOutline.labelBackgroundColor=_12.selectedLabelBackgroundColor;if(_12.showSelectedLabel==false)_13=false;if(_13!=false&&!_10&&_12.getSelectedLabelText){_10=_12.getSelectedLabelText(_8)}
var _15=_8.editNode,_16=_12.getEditNodeTree().getParent(_15),_17=(_16?_16.liveObject:null),_18=(_17&&_16!=_12.getRootEditNode()&&((isc.isA.DynamicForm(_17)&&_17.itemLayout=="absolute")||(!isc.isA.DynamicForm(_17)&&!isc.isA.Layout(_17))));;isc.SelectionOutline.select(_8,false,_13,_10,this.getResizeEdges(),_18);if(_3&&this.showDragHandle!=false&&!isc.isA.TabBar(_8.parentElement))
{isc.SelectionOutline.showDragHandle()}
if(!_4&&this.overrideDragProperties)this.overrideDragProperties();if(_13!=false&&_12.getSelectedLabelTools){var _19=_12.getSelectedLabelTools(_8);if(_19&&_19[0]!=null)isc.SelectionOutline.showLeadingTools(_19[0]);if(_19&&_19[1]!=null)isc.SelectionOutline.showTrailingTools(_19[1])}
}else if(isc.SelectionOutline.getSelectedObject()==_8){isc.SelectionOutline.deselect();if(this.restoreDragProperties)this.restoreDragProperties()}
}
}
,isc.A.resizeStart=function isc_EditProxy_resizeStart(){if(isc.isA.FormItem(this.creator)&&this.creator.form&&this.creator.form.editProxy){this.creator.form.editProxy.$1313(true)}else if(this.creator.parentElement&&this.creator.parentElement.editProxy){this.creator.parentElement.editProxy.$1313(true)}
}
,isc.A.resizeStop=function isc_EditProxy_resizeStop(){if(isc.isA.FormItem(this.creator)&&this.creator.form&&this.creator.form.editProxy){this.creator.form.editProxy.$1313(false)}else if(this.creator.parentElement&&this.creator.parentElement.editProxy){this.creator.parentElement.editProxy.$1313(false)}
}
,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(_11&&!_12){var _13=(_7?_3.defaults.height!=null:_3.defaults.width!=null),_14=_1.getClass().getInstanceProperty(_7?"height":"width")!=null,_15=(_1.overflow=="visible"||_1.getEditableProperties("overflow")["overflow"]=="visible")
;_12=_13||_14||_15}
if(_12){_5=(_7?"B":"R")}
}
if(_6.editProxy){if((_2.persistCoordinates==null&&_6.editProxy.persistCoordinates)||(_2.persistCoordinates&&_6.editProxy.persistCoordinates!=false))
{_5=["B","R"]}
}
}
}
return _5}
,isc.A.pageKeyPress=function isc_EditProxy_pageKeyPress(_1,_2){var _3=this.creator;if(!_3.containsFocus())return;if(this.useCopyPasteShortcuts){var _4=_3.editContext,_5=_4.getSelectedComponents(),_6=null
;var _7=(isc.Browser.isMac?isc.EH.metaKeyDown():isc.EH.ctrlKeyDown());if(_7){switch(isc.EH.getKey()){case"C":var _8=_4.getSelectedEditNodes();_4.copyEditNodes(_8);_6=false;break;case"V":if(_5.length==1&&_4.allowNestedDrops){_4.pasteEditNodes(_5[0].editNode)}else{_4.pasteEditNodes()}
_6=false;break}
}
return _6}
}
,isc.A.doubleClick=function isc_EditProxy_doubleClick(){var _1=this.creator;if(_1.editNode)isc.EditContext.selectCanvasOrFormItem(_1,true);if(this.supportsInlineEdit&&_1.editContext.enableInlineEdit&&(this.inlineEditEvent=="doubleClick"||this.inlineEditEvent=="dblOrKeypress"))
{this.startInlineEditing()}
return isc.EH.STOP_BUBBLING}
,isc.A.getEventDragData=function isc_EditProxy_getEventDragData(){var _1=this.creator,_2=_1.ns.EH.dragTarget.getDragData()
;if(_2==null||(isc.isAn.Array(_2)&&_2.length==0)){_2=_1.ns.EH.dragTarget;if(isc.isA.FormItemProxyCanvas(_2)){_2=_2.formItem}
}else if(isc.isAn.Array(_2)){_2=_2[0]}
return _2}
,isc.A.getEventDragType=function isc_EditProxy_getEventDragType(_1){var _2;if(isc.isA.Class(_1))_2=_1._constructor||_1.Class;else if(_1)_2=_1.type||_1.className;return _2}
,isc.A.willAcceptDrop=function isc_EditProxy_willAcceptDrop(_1){var _2=this.creator;var _3=_2.ns.EH.dragTarget;if(_2==_3){this.logInfo("editProxy.willAcceptDrop for "+_2.getLocalId()+" = false - targeting self","editModeDragTarget");return false}
if(_3&&!_3.isA("Palette")&&_3.editNode){var _4=_3.editNode.alwaysAllowRootDrop;if(_4==true||_4=="true")return false}
var _5=this.getEventDragData(),_6=this.getEventDragType(_5),_7=(this.logIsInfoEnabled("editModeDragTarget")
?"editProxy.willAcceptDrop for "+_2.getLocalId()+" using dragType "+_6
:null)
;if(!_6)return false;this.logInfo(_7,"editModeDragTarget");var _8=this.findEditNode(_6);var _9=this.canAddNode(_6,_3,_5);if(_9===false){this.logInfo(_7+" = false - explicit canAddNode false","editModeDragTarget");return false}
if(_6==null||!_9){this.logInfo(_7+" - drop not accepted. Checking ancestors.","editModeDragTarget");var _10=_2.parentElement;while(_10&&!_10.editorRoot){if(_10.editingOn){var _11=_10.editProxy.willAcceptDrop();if(!_11){this.logInfo(_7+" = "+_11+" - No ancestor accepts drop.","editModeDragTarget");if(_1!=false){var _12=isc.SelectionOutline.getSelectedObject();if(_12&&_12.editProxy){_12.editProxy.showSelectedAppearance(false)}
this.setNoDropIndicator()}
return _11}
this.logInfo(_7+" = true - An ancestor accepts drop.","editModeDragTarget");return true}
_10=_10.parentElement}
if(_1!=false){if(_8&&_8.editProxy){_8.editProxy.showSelectedAppearance(false)}
this.setNoDropIndicator()}
this.logInfo(_7+" = false - No parentElement in editMode found.","editModeDragTarget");return false}
var _13=_2.editNode;this.logInfo(_7+" = true","editModeDragTarget");if(_8){if(_1!=false){var _14=(_5.alwaysAllowRootDrop==true||_5.alwaysAllowRootDrop=="true");if(_14){if(_8&&_8.hideDropLine){_8.hideDropLine()}
var _15=_2.editContext,_16=_15.getEditNodeTree(),_17=_16.getChildren()[0]
;_8=_17.liveObject}
if(this.logIsInfoEnabled("editModeDragTarget")){var _18=(_2.getLocalId?_2.getLocalId():_2.ID||_2.autoID),_19=(_8.getLocalId?_8.getLocalId():_8.ID||_8.autoID)
;this.logInfo(_18+": selecting editNode object "+_19)}
if(_8.editProxy&&_8.editContext.allowNestedDrops){_8.editProxy.showSelectedAppearance(true,false,null,true);_8.editProxy.setDragTracker(_8.editProxy.getDragTrackerContents(_13,_6));_8.editProxy.clearNoDropIndicator()}
}
return true}else{this.logInfo("findEditNode() returned null for "+_2.getLocalId(),"editModeDragTarget")}
if(_1!=false){this.logInfo("In editProxy.willAcceptDrop, '"+_2.getLocalId()+"' was willing to accept a '"+_6+"' drop but we could not find an ancestor with an editNode")}
return true}
,isc.A.createDragTracker=function isc_EditProxy_createDragTracker(_1){var _2=_1&&_1.defaults,_3=isc.DS.getAutoIdField(_1),_4=isc.DS.getToolAutoIdField(_1),_5=_1&&_1.icon,_6=(_2&&(_2[_3]||_2[_4])),_7=this.creator.imgHTML(_5,16,16)
;return["<table><tr>","<td>&gt;</td>",(_5?"<td>"+_7+"</td>":""),"<td>",_6,"</td>","</tr></table>"].join(isc.emptyString)}
,isc.A.getDragTrackerContents=function isc_EditProxy_getDragTrackerContents(_1,_2){this.createDragTracker(_1)}
,isc.A.canDropAtLevel=function isc_EditProxy_canDropAtLevel(){var _1=this.creator,_2=_1.editContext,_3=_2.getRootEditNode(),_4=_2.getLiveObject(_3)
;return this.allowNestedDrops!=false&&(_2.allowNestedDrops!=false||_1==_4)}
,isc.A.findEditNode=function isc_EditProxy_findEditNode(_1){var _2=this.creator;if(!_2.editNode){if(isc.isA.PaneContainer(_2)){var _3=_2.parentElement.getSelectedTab();return _3}
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.canAddNode=function isc_EditProxy_canAddNode(_1,_2,_3,_4){var _5=this.creator,_6=_5.editNode,_7=(_5.getLocalId?_5.getLocalId():_5.ID||_5.autoID),_8=(this.logIsInfoEnabled("editModeAddNode")
?"canAddNode to "+_7+" of type "+_1
:null)
;if(_3&&(_3.alwaysAllowRootDrop==true||_3.alwaysAllowRootDrop=="true")){this.logInfo(_8+" = true - alwaysAllowRootDrop = true","editModeAddNode");return true}
if(!this.canDropAtLevel()){this.logInfo(_8+" = false - cannot drop at level","editModeAddNode");return false}
if(_3&&_2&&!_2.isA("Palette")){var _9=_5.editContext.getEditNodeTree(),_10=(_3.editNode?_3.editNode:_3),_11=_9.getParents(_6)
;if(_11.contains(_10)){return null}
}
if(_2&&_3&&_3.restrictToTarget){if(!_5.isA(_3.restrictToTarget.class)){this.logInfo(_8+" = null - restrictToTarget not matched ("+_3.restrictToTarget.class+")","editModeAddNode");return null}
}
if(_3){var _12=_3;_3=this.substituteNode(_6,_3);_1=this.getEventDragType(_3);if(_12!=_3){this.logInfo("canAddNode to "+_7+" of type "+_1+": substitute node: "+this.echoLeaf(_3),"editModeAddNode")}
var _13=this.getContainerNode(_6,_3);if(_13){_3=_13;_1=this.getEventDragType(_3);this.logInfo("canAddNode to "+_7+" of type "+_1+": container node: "+this.echoLeaf(_3),"editModeAddNode")}
_8=(this.logIsInfoEnabled("editModeAddNode")
?"canAddNode to "+_7+" of type "+_1
:null)}
var _14=(_3&&_3.liveObject?_3.liveObject:_3),_15=_14&&_14.parentProperty
;if((_15&&_5.getSchemaField(_15)!=null)||(!_15&&_5.getObjectField(_1)!=null))
{if(_2&&!_2.isA("Palette")&&!isc.isA.Class(_14)){var _9=_5.editContext.getEditNodeTree(),_16=_9.getParent(_3)
;if(_6!=_16){this.logInfo(_8+" = null - cannot drag existing "+_1+" to another container","editModeAddNode");return null}
}
this.logInfo(_8+" = true - has object field for "+_1,"editModeAddNode");return true}
if(_6&&_6.addToChild){var _17=_6.addToChild;if(_1==_17.ifDropClass){this.logInfo(_8+" = true - matches addToChild.ifDropClass","editModeAddNode");return true}
}
var _18=isc.ClassFactory.getClass(_1);if(_18){var _19;if(_18.isA("FormItem")){var _20=_3&&_3.form;if((_2&&_2.isA("Palette"))||(_5.form&&_5.form==_20))
{_19="DynamicForm"}
}else if(_18.isA("DrawItem")){_19="DrawPane"}
if(_19){var _21=_5.getObjectField(_19,this.$1698);if(_21!=null){this.logInfo(_8+" = true - has object field for explicit wrapper "+_19,"editModeAddNode");return true}
}
}
if(_2&&_2.isA("Palette")&&_3&&_3.canWrapInvalidDropTarget){this.logInfo(_8+" = true - canWrapInvalidDropTarget = true for "+_19,"editModeAddNode");return true}
this.logInfo(_8+" = null - fall through","editModeAddNode");return null}
,isc.A.clearNoDropIndicator=function isc_EditProxy_clearNoDropIndicator(_1){var _2=this.creator;if(_2.$uh)delete _2.$uh;if(_2.$k2)_2.$k2()}
,isc.A.setNoDropIndicator=function isc_EditProxy_setNoDropIndicator(){var _1=this.creator;_1.$uh=true;_1.$v8(_1.noDropCursor);this.setDragTracker(null)}
,isc.A.updateDropMargin=function isc_EditProxy_updateDropMargin(){var _1=this.creator,_2=(_1.getMemberBreadth?_1.getBreadth():_1.getVisibleHeight()),_3=(_1.getScrollbarSize?_1.getScrollbarSize():null),_4=Math.min((_3||this.defaultDropMargin),Math.floor(_2/3)
);this.dropMargin=_4}
,isc.A.wrapInvalidDropTarget=function isc_EditProxy_wrapInvalidDropTarget(){var _1=this.creator,_2=_1.ns.EH.dragTarget
;var _3=this.getEventDragData(),_4=this.getEventDragType(_3)
;if(!_4)return false;if(_2&&_2.isA("Palette")&&_3&&_3.canWrapInvalidDropTarget){delete _3.canWrapInvalidDropTarget;var _5=!this.canAddNode(_4,_2,_3);_3.canWrapInvalidDropTarget=true;if(_5){var _6=this,_7=_1.getActionTargetTitle
?_1.getActionTargetTitle()
:_1.getLocalId()+" ("+_1.editNode.type+")",_8="Place "+_7+" inside of "+_4+"?"
;isc.confirm(_8,function(_12){if(_12==true){var _9=_1.editContext,_10=_1.editNode
;var _11=_2.transferDragData();if(isc.isAn.Array(_11))_11=_11[0];if(_2.isA("TreePalette")){_11=_2.data.getCleanNodeData(_11,false,false,false)}else{_11=isc.clone(_11)}
_11.dropped=true;_6.$233n(_9,_10,_11)}
},{buttons:[isc.Dialog.NO,isc.Dialog.YES],autoFocusButton:1
});return true}
}
return false}
,isc.A.$233n=function isc_EditProxy__wrapDropTarget(_1,_2,_3){var _4=_1.getEditNodeTree(),_5=_4.getParent(_2),_6=_3.type
;this.logInfo("Wrapping "+_2.ID+" in a new "+_6+" under "+_5.ID,"editing");_1.removeNode(_2,null,true);var _7=_5.liveObject.editProxy;_7.completeDrop(_3,null,function(_9){var _8=_9.liveObject&&_9.liveObject.editProxy;if(_8&&_8.wrapPreviousDropTarget){_8.wrapPreviousDropTarget(_2)}else{_1.addNode(_2,_9,null,null,null,null,true)}
})}
,isc.A.shouldPassDropThrough=function isc_EditProxy_shouldPassDropThrough(){var _1=this.creator;if(_1.editContext&&_1.editContext.allowDropThrough==false){return false}
var _2=_1.ns.EH.dragTarget,_3=this.getEventDragData(),_4=this.getEventDragType(_3),_5=(this.logIsInfoEnabled("editModeDragTarget")
?"editProxy.shouldPassDropThrough for "+_1.getLocalId()+" using dragType "+_4
:null)
;if(!_4)return false;if(!this.canAddNode(_4,_2,_3)){this.logInfo(_5+" = true - cannot add dragType","editModeDragTarget");return true}
if(_1.parentElement==null||_1.parentElement.editProxy==null||!_1.parentElement.editProxy.willAcceptDrop(false))
{this.logInfo(_5+" = false - no ancestor willing to add","editModeDragTarget");return false}
if(_1.parentElement==_2){this.logInfo(_5+" = false - cannot drop on self","editModeDragTarget");return false}
if(this.persistCoordinates){this.logInfo(_5+" = false - canvas is persisting coordinates","editModeDragTarget");return false}
var x=isc.EH.getX(),y=isc.EH.getY(),_8=_1.getPageRect(),_9={left:_8[0],top:_8[1],right:_8[0]+_8[2],bottom:_8[1]+_8[3]
}
if(!_1.orientation||_1.orientation=="vertical"){if(x<_9.left+this.dropMargin||x>_9.right-this.dropMargin){this.logInfo(_5+" = true - close to right or left edge","editModeDragTarget");return true}
}
if(!_1.orientation||_1.orientation=="horizontal"){if(y<_9.top+this.dropMargin||y>_9.bottom-this.dropMargin){this.logInfo(_5+" = true - close to top or bottom edge","editModeDragTarget");return true}
}
this.logInfo(_5+" = false - fall through","editModeDragTarget");return false}
);isc.evalBoundary;isc.B.push(isc.A.setDragTracker=function isc_EditProxy_setDragTracker(_1){var _2=this.creator,_3=_2.ns.EH.dragTarget,_4=_3&&_3.$264u,_5=this.getDragTracker()
;if(!_4)return;if(!_1){if(_4!=_5){isc.EH.setDragTracker(_4)}
}else{var _6=["<table><tr>","<td>",_4,"</td>","<td>",_1,"</td>","</tr></table>"].join(isc.emptyString);if(_6!=_5){isc.EH.setDragTracker(_6)}
}
}
,isc.A.getDragTracker=function isc_EditProxy_getDragTracker(){return isc.EH.dragTracker&&isc.EH.dragTracker.contents}
,isc.A.drop=function isc_EditProxy_drop(){if(this.shouldPassDropThrough()){return}
if(this.wrapInvalidDropTarget()){return isc.EH.STOP_BUBBLING}
var _1=this.creator,_2=_1.ns.EH.dragTarget,_3=this.getEventDragData()
;if(_2.isA("TreePalette")){_3=_2.data.getCleanNodeData(_3,false,false,false)}
_3=isc.clone(_3);_3.dropped=true;if(!_2.isA("Palette")){this.completeReparent(true)}else{this.completeDrop(_3,{skipSnapToGrid:isc.EH.shiftKeyDown()})}
return isc.EH.STOP_BUBBLING}
,isc.A.completeDrop=function isc_EditProxy_completeDrop(_1,_2,_3){var _4=this.creator;if(!_4.editContext)return;if(_1.loadData&&!_1.isLoaded){var _5=this;_1.loadData(_1,function(_29){_29=_29||_1;_29.isLoaded=true;_5.completeDrop(_29,_2,function(_12){_12.dropped=_1.dropped;if(_3)_3(_12)})});return}
var _6=(_2?_2.index:null),_7=(_2?_2.parentProperty:null),_8=(_2?_2.skipNodeAddedNotification:null),_9=(_2?_2.skipSnapToGrid:null)
;var _10=_4.editContext,_11=_4.editNode,_12,_13=false
;if(_6!=null){var _14=_10.getEditNodeTree(),_15=_14.getChildren(_11),_16=isc.DataSource.getNearestSchemaClass(_1.type)
;if(_6==0&&_15.length>0&&isc.isA.DataSource(_15[0].liveObject)&&(!_16||!_16.isA(isc.DataSource)))
{_6++}else{for(var i=0;i<Math.min(_6,_15.length);i++){if(isc.isA.DataSource(_15[i].liveObject)){_6++;break}
}
}
}
var _18=_1;_1=this.substituteNode(_11,_1);var _19=_1.type||_1.className,_11=this.adjustParentNode(_11,_1);var _20=isc.ClassFactory.getClass(_19);if(_20&&((_20.isA("FormItem")&&_11.type!="SectionItem"&&_11.type!="ToolbarItem")||_20.isA("DrawItem"))){_12=_10.makeEditNode(_1);if(_20&&_20.isA("FormItem")){_12=_4.editContext.addWithWrapper(_12,_11,_6,_7,null,_8)}else{_12=_4.editContext.addWithWrapper(_12,_11,_6,_7,true,_8)}
_13=true}else{var _21=this.getContainerNode(_11,_1);if(_21){var _22=_10.makeEditNode(_21);_11=_10.addNode(_22,_11,_6);_6=0}
var _23=_10.addFromPaletteNodes([_1],_11,_6,_7,_8,false);if(_23&&_23.length>0)_12=_23[0]}
var _24=_12;if(!_24)return;if(_6==null){if(_13){var _14=_10.getEditNodeTree(),_25=_14.getParent(_24)
;if(_25)_24=_25}
var x=_4.getOffsetX(),y=_4.getOffsetY()
;if(_4.childrenSnapToGrid&&!_9){x=_4.getHSnapPosition(x);y=_4.getVSnapPosition(y)}
if(_24.liveObject&&_24.liveObject.moveTo)_24.liveObject.moveTo(x,y)}
var _5=this;var _28=false;if(isc.isA.DataSource(_24.liveObject)){_10.deselectAllComponents();isc.Timer.setTimeout(function(){_10.selectSingleComponent(_11.liveObject);_5.fireCallback(_3,"node",[_24])});_28=true}else if(this.canSelectChildren&&_12.liveObject.editProxy!=null&&_12.liveObject.editProxy.canSelect!=false)
{isc.Timer.setTimeout(function(){_10.selectSingleComponent(_24.liveObject);_5.fireCallback(_3,"node",[_24])});_28=true}
var _4=_24.liveObject;if(_4&&_4.editProxy&&_4.editProxy.nodeDropped){_4.editProxy.nodeDropped(_24,_11)}
if(_4&&isc.isA.Function(_4.focus)){_4._eventMask?_4._eventMask.focus():_4.focus()}
if(_18!=_1){_10.fireSubstitutedNode(_18,_1,_11)}
if(!_28)this.fireCallback(_3,"node",[_24])}
,isc.A.completeReparent=function isc_EditProxy_completeReparent(_1,_2){var _3=this.creator;_2=_2||_3.ns.EH.dragTarget
if(_2==_3)return;var _4=_3.editContext,_5=_3.editNode,_6=_2.editNode
;if(this.logIsInfoEnabled("editing")){var _7=_4.getEditNodeTree(),_8=_7.getParent(_6)
;this.logInfo("Reparenting "+_2.getLocalId()+" from "+_8.liveObject.getLocalId()+" to "+_3.getLocalId(),"editing")}
_4.removeNode(_6,null,true);var _9;if(_2.isA("FormItem")){if(_2.isA("CanvasItem")){_9=_4.addNode(_2.canvas.editNode,_5)}else{_9=_4.addWithWrapper(_6,_5)}
}else if(_2.isA("DrawItem")){_9=_4.addWithWrapper(_6,_5,null,null,true)}else{_9=_4.addNode(_6,_5,null,null,null,null,true);if(_1){var _10=isc.EH.getDragRect(),x=(_10?_10[0]-_3.getPageLeft():_3.getOffsetX()),y=(_10?_10[1]-_3.getPageTop():_3.getOffsetY())
;_9.liveObject.moveTo(x,y)}
}
if(_9&&_9.liveObject){isc.EditContext.selectCanvasOrFormItem(_9.liveObject,true)}
if(_9){var _13=_4.getEditNodeTree(),_14=_13.getParent(_6);_4.fireNodeMoved(_6,_14,_9,_5)}
return _9}
,isc.A.substituteNode=function isc_EditProxy_substituteNode(_1,_2){if(_2.substituteDrop){var _3=_2.substituteDrop;if(!isc.isAn.Array(_3))_3=[_3];for(var i=0;i<_3.length;i++){var _5=_3[i],_6=(_1?isc.ClassFactory.getClass(_1.type):null)
;if(!_6||(_5.ifParentClass&&!_6.isA(_5.ifParentClass))||(_5.ifNotParentClass&&_6.isA(_5.ifNotParentClass)))
{continue}
var _7=this.creator,_8=_7.editContext,_9=_5;;if(_5.useNode){_9=_8.findPaletteNode("refID",_5.useNode);if(!_9){this.logWarn("Invalid 'substituteDrop.useNode' reference found in palette node for "+_2.type+". Ignoring substituteDrop.")}
var _10=_8.getDefaultPalette();if(!isc.isA.TreePalette(_10)){_9=isc.clone(_9)}
}else{_9=isc.clone(_9);delete _9.ifParentClass;delete _9.ifNotParentClass}
if(_9){_2=_9;break}
}
}
return _2}
,isc.A.getContainerNode=function isc_EditProxy_getContainerNode(_1,_2){var _3;if(_1&&_1.insertContainer){var _4=_1.insertContainer,_5=true
;if(_4.ifDropClass){var _6=_2.type||_2.className;var _7=isc.ClassFactory.getClass(_6);if(!_7||(_4.ifDropClass&&!_7.isA(_4.ifDropClass)))
{_5=false}
}
if(_5){var _8=this.creator,_9=_8.editContext,_10=_4
;if(_4.useNode){_10=_9.findPaletteNode("refID",_4.useNode);if(!_10){this.logWarn("Invalid 'insertContainer.useNode' reference found in palette node for "+_1.type+". Ignoring insertContainer.")}
var _11=_9.getDefaultPalette();if(!isc.isA.TreePalette(_11)){_10=isc.clone(_10)}
}else{_10=isc.clone(_10);delete _10.ifDropClass}
if(_10)_3=_10}
}
return _3}
,isc.A.adjustParentNode=function isc_EditProxy_adjustParentNode(_1,_2){var _3=this.creator,_4=_3.editContext
;if(_2.alwaysAllowRootDrop==true||_2.alwaysAllowRootDrop=="true"){var _5=_3.editContext.getEditNodeTree();_1=_5.getRoot()}else if(_1.addToChild){var _6=_1.addToChild;if(_2.type==_6.ifDropClass){var _5=_3.editContext.getEditNodeTree(),_7=_5.getChildren(_1),_8=_6.childClass,_9
;if(_8){if(_7&&_7.length>0){for(var i=0;i<_7.length;i++){if(_8==_7[i].type){_9=_7[i];break}
}
}
if(_9){return _9}else{if(_6.createFrom){var _11=_4.findPaletteNode("refID",_6.createFrom);if(_11){var _12=_4.makeEditNode(_11);_12.dropped=true;_1=_4.addNode(_12,_1,null,null,null,null,true)}else{this.logWarn("Invalid 'addToChild.createFrom' reference found in palette node for "+_1.type+". Ignoring addToChild.")}
}else{this.logWarn("Invalid 'addToChild.createFrom' found in palette node for "+_1.type+". Ignoring addToChild.")}
}
}else{this.logWarn("Invalid 'addToChild.childClass' found in palette node for "+_1.type+". Ignoring addToChild.")}
}else if(!_6.ifDropClass){this.logWarn("Invalid 'addToChild.ifDropClass' found in palette node for "+_1.type+". Ignoring addToChild.")}
}
return _1}
,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.HandPlacedContainer&&this.creator.getClass()!=isc.EditPane&&this.creator.getClass()!=isc.TabSet&&this.creator.getClass()!=isc.DetailViewer&&this.creator.getClass()!=isc.SectionHeader)
{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.dragOver=function isc_EditProxy_dragOver(){if(!this.willAcceptDrop()){return false}
return this.Super("dragOver",arguments)}
,isc.A.dropOver=function isc_EditProxy_dropOver(){if(!this.canDropAtLevel())return;if(!this.willAcceptDrop()){if(this.creator==this.creator.ns.EH.dragTarget){return}
return false}
if(!this.shouldPassDropThrough()){if(this.creator.dropOver&&this.creator.getClass()!=isc.Canvas&&this.creator.getClass()!=isc.HandPlacedContainer&&this.creator.getClass()!=isc.EditPane&&this.creator.getClass()!=isc.DrawPane&&this.creator.getClass()!=isc.TabSet&&this.creator.getClass()!=isc.DetailViewer&&this.creator.getClass()!=isc.TabSet&&this.creator.getClass()!=isc.TileGrid)
{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(){var _1=this.creator;this.showSelectedAppearance(false);this.setDragTracker(null);if(_1.dropOut)this.creator.dropOut();this.$1313(false);if(!this.willAcceptDrop()&&_1==_1.ns.EH.dragTarget){return}
return isc.EH.STOP_BUBBLING}
,isc.A.overrideDragProperties=function isc_EditProxy_overrideDragProperties(){if(this.$146t)return;var _1=this.creator;if(isc.isA.DynamicForm(_1)&&(_1.$10u||_1.$10m)){this.delayCall("overrideDragProperties");return}
var _2={canDrop:true,dragAppearance:"outline",$2241:_1.getOriginalValue("dragAppearance"),dragStart:function(){if(isc.EH.dragTarget==isc.SelectionOutline.getSelectedObject()){isc.EH.dragStartOffsetX=isc.EH.dragStartOffsetY=0}
return true},dragMove:function(){return true},setDragTracker:function(){isc.EH.setDragTracker("");return false},dragStop:function(){isc.SelectionOutline.positionDragHandle()},dragResized:function(_15,_16){this.$221c(_15,_16)},resized:function(_15,_16){this.Super("resized",arguments);if(this.$221b){this.$221c(_15,_16)}
},$221c:function(_15,_16){var _3=this.getOriginalValue("overflow");if(_3=="visible"&&(_15<0||_16<0)){this.$220k()}
this.saveToOriginalValues(["width","height","$pn","$po"]);this.editContext.refreshSelectedAppearance(this)},$220k:function(){var _4=this.width,_5=this.height
;this.setProperty("overflow","visible");this.redraw("overflow changed");var _6=this.getVisibleWidth(),_7=this.getVisibleHeight()
;if(_6>_4||_7>_5){var _8=this.getOriginalValue("width"),_9=this.getOriginalValue("height")
;if(_8<_4||_9<_5){_4=_8;_5=_9}
this.setProperty("width",_4);this.setProperty("height",_5);var _10=this;isc.Timer.setTimeout(function(){_10.setProperty("width",_6);_10.setProperty("height",_7);_10.setProperty("overflow","hidden");_10.editContext.refreshSelectedAppearance(_10)},0);if(this.editContext.isReify){isc.Notify.addMessage("This component has its Scrolling property set to Expand. Change to Clip or Automatic if you want to resize the component smaller.",null,null,{duration:5000})}
}else{this.setProperty("overflow","hidden")}
},setEditableProperties:function(_2){this.Super("setEditableProperties",arguments);var _11;for(var _12 in _2){if(this.editModeOriginalValues[_12]!==_11&&(_12=="width"||_12=="height"))
{this.logInfo("Field "+_12+" - value is going to live values also","editModeOriginalValues");this.$221b=true;this.setProperty(_12,_2[_12]);delete this.$221b}
}
}
};var _13,_14
;if(_1.overflow=="visible"&&!isc.isA.TabBar(_1.parentElement)&&!isc.isA.ToolStrip(_1))
{_2.width=_1.width;_2.height=_1.height;_2.overflow=_1.overflow;_2.$pn=null;_2.$po=null;_13=_1.getVisibleWidth();_14=_1.getVisibleHeight()}
this.overrideProperties(_2);this.$146t=true;if(_2.overflow){_1.resizeTo(_13,_14);_1.setOverflow("hidden")}
}
,isc.A.restoreDragProperties=function isc_EditProxy_restoreDragProperties(){var _1=this.creator;_1.restoreFromOriginalValues(["canDrop","dragAppearance","dragStart","dragMove","dragResized","dragStop","resized","$221c","$220k","setDragTracker","setEditableProperties"
]);if(_1.$2241){var _2=_1.dragAppearance;_1.dragAppearance=_1.$2241;_1.saveToOriginalValues(["dragAppearance"]);_1.dragAppearance=_2;_1.clearOriginalValues(["$2241"])}
var _3=_1.getOriginalValue("overflow");if(_3){var _4=_1.getOriginalValue("width"),_5=_1.getOriginalValue("height"),_6=_1.getOriginalValue("$pn"),_7=_1.getOriginalValue("$po"),_8
;if(_4!=null)_1.resizeTo(_4,_5);if(_6!==_8)_1.$pn=_6;if(_7!==_8)_1.$po=_7;_1.setOverflow(_3);_1.clearOriginalValues(["width","height","overflow","$pn","$po"
])
}
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,_5=_4.editContext
;if(isc.$75u){var _6=_4.suppressAllDSFields;_4.suppressAllDSFields=!_4.useAllDataSourceFields;_4.setDataSource(_1,_2||_4.getAllFields());_4.suppressAllDSFields=_6;return}
if(_1==_4.dataSource&&!_3)return;var _7=_1&&_4.dataSource&&_4.dataSource.ID==(_1.$2246||_1.ID)
;if(_1)delete _1.$2246;var _8;if(_1!=null){var _9=_1.fields;if(_9&&isc.getKeys(_9).length==1&&_9[isc.firstKey(_2)]&&_1.fieldIsComplexType(_9[isc.firstKey(_2)].name))
{_8=_1.getSchema(_9[isc.firstKey(_2)].type)}else{_8=_1}
}
var _10=(_4.getAllFields?_4.getAllFields():_4.getFields()),_11=(_8!=null?_8.getFields():{}),_12=[]
;if(_8&&_4.getDefaultFields){var _13=_4.getDefaultFields(_8);if(_13)_11=_13}
if(_10&&_10.length>0){var _14=_5.getEditNodeTree(),_15=_14.findById(_4.getLocalId()),_16=_14.getChildren(_15),_17=[]
;for(var i=0;i<_16.length;i++){var _19=_16[i];if(_19.liveObject&&!isc.isA.DataSource(_19.liveObject)){var _20=_19.liveObject;var _21=_5.fieldRenames,_22=_5.fieldDeletes,_23=(_21&&_21[_20.name]?_21[_20.name]:_20.name),_24=(_11[_23]!=null),_25=isc.EditProxy.fieldEdited(_4,_19)
;if(_7&&_22&&_22.contains(_23)){_17.add(_19)}else if(!_7&&!_24&&!_25){_17.add(_19)}else{var _26=isc.addProperties({},_20.editingOn?_20.editNode.defaults:_20);if(!_25){_26=isc.addProperties({},_19.defaults)}
if(_20.name!=_23){_26=isc.addProperties({},_26,_11[_23]);_5.setNodeProperties(_19,_26,true)}
_12.add(_26)}
}
}
var _27=[];_12.map(function(_41){_27.add(isc.addProperties({},_41))});_4.setFields(_27);for(var i=0;i<_17.length;i++){_5.removeNode(_17[i],true)}
}
var _28=function(){var _14=_5.getEditNodeTree(),_15=_14.findById(_4.getLocalId()),_29=_14.getChildren(_15)
;for(var i=0;i<_29.length;i++){var _19=_29[i],_16=_14.getChildren(_19)
;if(isc.isA.DataSource(_19.liveObject)){continue}
if(_16&&_16.length>0){var _30=isc.Tree.create();var _31=function(_14,_41,_30,_42){var _16=_14.getChildren(_41);if(_16&&_16.length>0){if(!_42)_42=_30.getRoot();_16.map(function(_43){var _32=isc.isA.DataSource(_43.liveObject),_33=(_32?_5.makeDSPaletteNode(_43.ID):_5.makePaletteNode(_43)),_34=_30.add(_33,_42)
;_31(_14,_43,_30,_34);_5.destroyNode(_43,null,true)})}
};_31(_14,_19,_30);_5.addFromPaletteNodeTree(_30,_19,null,null,true)}
if(!_5.isNodeEditingOn(_19)){_5.enableEditing(_19)}
}
};if(_1==null){if(!isc.isA.DynamicForm(_4)||_12.length==0){_4.setDataSource(null)}
_28();if(_5.addUsageRecord){_5.addUsageRecord("unbindComponentDS",_4.editNode)}
return}
var _2=[],_35=[]
;for(var i=0;i<_12.length;i++){_2.add(_12[i])}
if(!_7){for(var _36 in _11){var _20=_11[_36];if(!_4.shouldUseField(_20,_1))continue;if(_12.find("name",_36)||_12.find("autoName",_36))continue;var _37=isc.addProperties({},_20);_2.add(_37);_35.add(_37)}
if(this.layoutNewFields)this.layoutNewFields(_1,_2)}
_4.setDataSource(_1,_2);_28();if(!_7&&!_5.dontBindDefaultFields){var _38=_2.length;for(var i=0;i<_35.length;i++){var _20=_35[i],_39=null
;if(_20.top!=null||_20.left!=null){_39={top:_20.top,left:_20.left}}
var _40=this.makeFieldPaletteNode(_5,_20,_8,_39);var _19=_5.makeEditNode(_40);_5.addNode(_19,_4.editNode,_38+i,null,true)}
}else if(_7){var _14=_5.getEditNodeTree(),_15=_14.findById(_4.getLocalId()),_16=_14.getChildren(_15)
;for(var i=0;i<_12.length;i++){var _26=_12[i],_19=_16.find("name",_26.name);if(_19){var _20=_4.getField(_26.name);_19.liveObject=_20;if(_20&&_20.setEditMode){_20.setEditMode(true,_5,_19)}
}
}
}
_5.fireEditNodeUpdated(_4.editNode,{dataSource:_1});if(_5.addUsageRecord){_5.addUsageRecord("bindComponentDS",_4.editNode,_1)}
}
,isc.A.makeFieldPaletteNode=function isc_EditProxy_makeFieldPaletteNode(_1,_2,_3,_4){var _5=this.creator.Class+"Field",_4=isc.addProperties({},_4,{name:_2.name})
;var _6;if(_1){_6=_1.findPaletteNode("type",_5)||_1.findPaletteNode("className",_5)||{type:_5};_6=isc.addProperties({},_6,{defaults:_4})}else{_6={type:_5,defaults:_4
}}
if((_5!="ListGridField"&&_5!="TreeGridField")||!_3){if(_2.type)_4.type=_2.type;else delete _4.type;if(_2.title||!_4.title){_4.title=_2.title||_3.getAutoTitle(_2.name)}
}
return _6}
,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.delayCall("focusInItem");if(_1||_5){var _8=(_4!=null?_4.length:0);_7.delayCall("setSelectionRange",[_8,_8])}else{_7.delayCall("selectValue")}
}
if(this.creator.editContext&&this.creator.editContext.inlineEditorShowing){this.creator.editContext.fireCallback("inlineEditorShowing","field,type",[_7,"value"])}
}
,isc.A.createInlineEditLayout=function isc_EditProxy_createInlineEditLayout(){return isc.VStack.create({dismissEditor:function(){this.hide()}
})}
,isc.A.createInlineEditForm=function isc_EditProxy_createInlineEditForm(){if(this.inlineEditForm)return this.inlineEditForm;var _1=isc.addProperties({name:this.$1472,type:(this.inlineEditMultiline?"TextArea":"text"),allowNativeResize:this.inlineEditMultiline,width:"*",height:"*",showTitle:false,refreshDisplayValue:function(){if(!this.destroyed)this.Super("refreshDisplayValue",arguments)}
},this.inlineEditFieldProperties,{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){if(this.shouldDisallowEditorExit()){return false}
if(this.getHandle().contains(document.activeElement)){return}
_2.saveOrDiscardValue();if(_2.destroyed)return true;_2.parentElement.hide();if(_2.creator.inlineEditingComplete)_2.creator.inlineEditingComplete();if(_2.creator.creator.editContext&&_2.creator.creator.editContext.inlineEditorShowing){_2.creator.creator.editContext.fireCallback("inlineEditorShowing","field,type",[null,"value"])}
}
}
);var _2=this.createAutoChild("inlineEditForm",{margin:0,padding:0,cellPadding:0,minWidth:(this.inlineEditMultiline?250:80),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.sizeInlineEditor();this.positionInlineEditor()}
,isc.A.positionInlineEditor=function isc_EditProxy_positionInlineEditor(){var _1=this.creator,_2=_1.getVisibleHeight(),_3=_1.getPageLeft(),_4=_1.getPageTop()
;if(this.centerInlineEdit&&this.inlineEditForm.getHeight()<_2){_4+=Math.round((_2-this.inlineEditForm.getHeight())/2)}
this.inlineEditLayout.moveTo(_3,_4)}
,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.max(_5,50);else _5=_6;_2.setWidth(_3);this.inlineEditForm.setHeight(_5)}
,isc.A.inlineEditingComplete=function isc_EditProxy_inlineEditingComplete(){var _1=this.creator.editContext;if(_1)_1.fireSelectedEditNodesUpdated()}
,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+82;isc.defineClass("ValuesManagerEditProxy","EditProxy");isc.A=isc.ValuesManagerEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.confirmMessage="All forms in a Values Manager must have the same DataSource.";isc.A.switchDSButtonTitle="Switch all to ${dsId}";isc.A.leaveButtonTitle="Leave ValuesManager";isc.A.supportsInlineEdit=false;isc.A.inlineEditOnDrop=false;isc.B.push(isc.A.canAddNode=function isc_ValuesManagerEditProxy_canAddNode(_1,_2,_3,_4){var _5=this.Super("canAddNode",arguments);if(_5==null){var _6=this.creator;if(_2&&_2.isA("Palette")){var _7=isc.ClassFactory.getClass(_1);if(_7&&_7.isA("DataSource"))_5=true}
}
return _5}
,isc.A.completeDrop=function isc_ValuesManagerEditProxy_completeDrop(_1,_2,_3){var _4=this.creator;if(!_4.editContext)return;if(_1.loadData&&!_1.isLoaded){var _5=this;_1.loadData(_1,function(_11){_11=_11||_1;_11.isLoaded=true;_5.completeDrop(_11,_2,function(_10){_10.dropped=_1.dropped;if(_3)_3(_10)})});return}
var _6=_1.liveObject;if(!_6)return;var _7=_4.editNode,_8=_4.getDataSource()
;if(_8==_6){return}
if(_8&&this.areMembersUsingDataSource()){var _5=this;this.confirmSwitchDataSource(_6.ID,function(){var _9=_4.editContext,_10=_9.makeEditNode(_1)
;_5.$34(_1,_7,_3);_9.dontShowFieldMapper=true;_5.setMembersDataSource(_10);delete _9.dontShowFieldMapper;_4.editContext.deselectAllComponents();_4.editContext.selectSingleComponent(_7.liveObject)});return}
this.$34(_1,_7,_3)
}
,isc.A.$34=function isc_ValuesManagerEditProxy__completeDrop(_1,_2,_3){var _4=this.creator,_5=_1.liveObject
;_4.setDataSource(_5.ID);if(!_2.defaults)_2.defaults={};_2.defaults.dataSource=_5.ID;_4.editContext.deselectAllComponents();_4.editContext.selectSingleComponent(_2.liveObject);if(_3)_3(_1)}
,isc.A.changeDataSource=function isc_ValuesManagerEditProxy_changeDataSource(_1){var _2=isc.DS.get(_1);if(!_2)return;var _3=this.creator,_4=_3.editNode,_5=_3.getDataSource()
;if(_5==_2){return}
if(_5&&this.areMembersUsingDataSource()){var _6=this;this.confirmSwitchDataSource(_2.ID,function(){_3.setDataSource(_2.ID);if(!_4.defaults)_4.defaults={};_4.defaults.dataSource=_2.ID;var _7=_3.editContext,_8=_3.editContext.makeDSPaletteNode(_1),_9=_7.makeEditNode(_8)
;if(_9.loadData&&!_9.isLoaded){_9.liveObject=_2;_9.isLoaded=true}
_7.dontShowFieldMapper=true;_6.setMembersDataSource(_9);delete _7.dontShowFieldMapper;_3.editContext.deselectAllComponents();_3.editContext.selectSingleComponent(_4.liveObject)});return}
_3.setDataSource(_2.ID);if(!_4.defaults)_4.defaults={};_4.defaults.dataSource=_2.ID}
,isc.A.showSelectedAppearance=function isc_ValuesManagerEditProxy_showSelectedAppearance(_1,_2,_3){var _4=this.creator;if(_1){isc.SelectionOutline.border="1px dashed blue";var _5=_4.getMembers();if(_5&&_5.length>0){var _6=_4.editContext.getRootEditNode().liveObject,_7=[]
;for(var i=0;i<_5.length;i++){if(_5[i]!=_6)_7.add(_5[i])}
isc.SelectionOutline.select(_7,false,false)}else{isc.SelectionOutline.deselect()}
}else if(isc.SelectionOutline.getSelectedObject()==_4){isc.SelectionOutline.deselect()}
}
,isc.A.getNodeDescription=function isc_ValuesManagerEditProxy_getNodeDescription(_1){var _2="";if(_1.defaults&&_1.defaults.dataSource){_2="DataSource: "+(_1.defaults&&_1.defaults.dataSource)}
return _2}
,isc.A.confirmLeaveValuesManager=function isc_ValuesManagerEditProxy_confirmLeaveValuesManager(_1){isc.confirm(this.confirmMessage,function(_2){if(_2==true){_1()}
},{buttons:[isc.Dialog.CANCEL,{title:this.leaveButtonTitle,width:150,overflow:"visible",click:function(){this.topElement.okClick()}
}
],autoFocusButton:0
})}
,isc.A.confirmSwitchDataSource=function isc_ValuesManagerEditProxy_confirmSwitchDataSource(_1,_2){var _3=this.switchDSButtonTitle.evalDynamicString(null,{dsId:_1});isc.confirm(this.confirmMessage,function(_4){if(_4==true){_2()}
},{buttons:[isc.Dialog.CANCEL,{title:_3,wrap:false,autoFit:true,overflow:"visible",click:function(){this.topElement.okClick()}
}
],autoFocusButton:0
})}
,isc.A.confirmSwitchDSOrLeaveVM=function isc_ValuesManagerEditProxy_confirmSwitchDSOrLeaveVM(_1,_2,_3){var _4=this.switchDSButtonTitle.evalDynamicString(null,{dsId:_1});isc.confirm(this.confirmMessage,null,{buttons:[isc.Dialog.CANCEL,{title:_4,wrap:false,autoFit:true,overflow:"visible",click:function(){_2();this.topElement.okClick()}
},{title:this.leaveButtonTitle,width:150,overflow:"visible",click:function(){_3();this.topElement.okClick()}
}
],autoFocusButton:2
})}
,isc.A.areMembersUsingDataSource=function isc_ValuesManagerEditProxy_areMembersUsingDataSource(_1){var _2=this.creator,_3=_2.getDataSource(),_4=_2.members
;if(_3&&_4&&_4.length>0){for(var i=0;i<_4.length;i++){var _6=_4[i];if((!_1||!_1.contains(_6))&&_6.getDataSource())
{return true}
}
}
return false}
,isc.A.setMembersDataSource=function isc_ValuesManagerEditProxy_setMembersDataSource(_1){var _2=this.creator,_3=_1.liveObject,_4=_2.editContext,_5=_4.getEditNodeArray(),_6
;var _7=function(){for(var i=0;i<_5.length;i++){var _9=_5[i],_10=_9.liveObject
;if(_10.valuesManager==_2){if(_10.getDataSource()!=_3){if(!_1){_1=_4.makeEditNode(_6)}else{_6=_4.makeDSPaletteNode(_1.ID);_6.liveObject=_1.liveObject;_6.isLoaded=true}
_4.addNode(_1,_9,0,null,false,false,true);_1=null}
}
}
};if(_2.getDataSource()!=_1.liveObject){var _11=_4.makeDSPaletteNode(_1.ID);_11.liveObject=_1.liveObject;_11.isLoaded=true;this.$34(_11,_2.editNode,function(){_7()})}else{_7()}
}
,isc.A.leaveValuesManager=function isc_ValuesManagerEditProxy_leaveValuesManager(_1){_1.liveObject.editContext.setNodeProperties(_1,{valuesManager:null});_1.liveObject.editContext.removeNodeProperties(_1,["valuesManager"])}
);isc.B._maxIndex=isc.C+12;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.A.dialogLayoutDefaults={_constructor:isc.VLayout,autoDraw:false,width:600,padding:5
};isc.A.confirmReplaceFormDefaults={_constructor:isc.DynamicForm,autoParent:"dialogLayout",autoDraw:false,width:"100%",height:"100%",numCols:1,initWidget:function(){this.fields=[{name:"blurb",type:"blurb",defaultValue:this.intro},{name:"action",type:"radioGroup",showTitle:false,wrap:false,valueMap:this.actions}
];this.values={action:this.actions[0]};this.Super("initWidget",arguments)}
};isc.A.buttonsLayoutDefaults={_constructor:isc.HLayout,autoParent:"dialogLayout",autoDraw:false,width:"100%",height:30,membersMargin:10,align:"right"
};isc.A.okButtonDefaults={_constructor:"IButton",autoParent:"buttonsLayout",autoDraw:false,title:"OK",getSelectedIndex:function(){var _1=this.form.actions,_2=this.form.getValue("action")
;for(var i=0;i<_1.length;i++){if(_2==_1[i])return i}
return null}
};isc.A.cancelButtonDefaults={_constructor:"IButton",autoParent:"buttonsLayout",autoDraw:false,title:"Cancel",click:function(){this.creator.cancelClick()}
};isc.A.$2037=["VLayout","HLayout",null
];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=_1.target
;if(!this.canSelectChildren||this.canSelect==false)return;var _5=_3.editContext;if(_4!=_3){while(_4.parentElement&&!_4.canvasItem)_4=_4.parentElement;if(!_4.canvasItem||_4.canvasItem.containerWidget!=_3)return}
if(_5.selectionType!=isc.Selection.MULTIPLE)return;if(!(isc.EH.shiftKeyDown()||(isc.Browser.isWin&&isc.EH.ctrlKeyDown()))){_5.deselectAllComponents()}
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.DrawPane&&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.DrawPane&&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<this.$79h)this.hoopSelector.setLeft(x);else this.hoopSelector.setLeft(this.$79h);if(y<this.$79i)this.hoopSelector.setTop(y);else this.hoopSelector.setTop(this.$79i);this.updateCurrentSelection()}
,isc.A.confirmReplaceComponent=function isc_CanvasEditProxy_confirmReplaceComponent(_1,_2,_3){var _4=this;this.makeConfirmReplaceDialog(_1,_2,function(_5){if(_3)_4.fireCallback(_3,"wrapperType",[_5])});this.showConfirmReplaceDialog(_1.liveObject)}
,isc.A.showConfirmReplaceDialog=function isc_CanvasEditProxy_showConfirmReplaceDialog(_1){var _2=this.confirmReplaceWindow;if(_1.isVisible()){var _3=_2.getVisibleWidth(),_4=_2.getVisibleHeight(),_5=((_1.getWidth()-_3)/2)+Math.max(0,_1.getScrollLeft()
),_6=((_1.getHeight()-_4)/2)+Math.max(0,_1.getScrollTop()
);_5=Math.round(_5);_6=Math.max(Math.round(_6),0);_2.placeNear(_5+_1.getPageLeft(),_6+_1.getPageTop())}else{_2.centerInPage()}
_2.show()}
,isc.A.makeConfirmReplaceDialog=function isc_CanvasEditProxy_makeConfirmReplaceDialog(_1,_2,_3){var _4=this.creator,_5=_4.editContext,_6=this,_7="pane"
;if(this.getChildNodeDescription){_7=this.getChildNodeDescription(_1);_7=_7.substring(1,_7.length-1)}
if(this.confirmReplaceForm)this.confirmReplaceForm.markForDestroy();var _8=_5.getEditNodeIDDescription(_1,true);var _9=_5.getEditNodeIDDescription(_2,true);var _10="There is already a component in the "+_7+". Do you want to:",_11=["combine "+_9+" with "+_8+" in VLayout (vertical stacking)","combine "+_9+" with "+_8+" in HLayout (horizontal stacking)","replace "+_8+" with "+_9
]
;if(this.confirmReplaceWindow)this.confirmReplaceWindow.markForDestroy();this.confirmReplaceForm=this.createAutoChild("confirmReplaceForm",{intro:_10,actions:_11});this.cancelButton=this.createAutoChild("cancelButton",{click:function(){this.creator.confirmReplaceWindow.hide()}
});this.okButton=this.createAutoChild("okButton",{form:this.confirmReplaceForm,click:function(){var _12=this.getSelectedIndex();this.creator.confirmReplaceWindow.hide();if(_3){var _13=_6.$2037[_12];_6.fireCallback(_3,"wrapperType",[_13])}
}
});this.buttonsLayout=this.createAutoChild("buttonsLayout",{members:[this.cancelButton,this.okButton]});this.dialogLayout=this.createAutoChild("dialogLayout",{members:[this.confirmReplaceForm,this.buttonsLayout]});this.confirmReplaceWindow=isc.Window.create({title:"Replace existing component?",autoDraw:true,top:-500,left:-1000,showCloseButton:false,showMinimizeButton:false,isModal:true,showModalMask:true,autoSize:true,items:[this.dialogLayout]
})}
,isc.A.wrapExistingComponent=function isc_CanvasEditProxy_wrapExistingComponent(_1,_2){var _3=this.creator,_4=_3.editContext,_5=_4.getParentNode(_1)
;_4.removeNode(_1,null,true);var _6=_1.liveObject;if(_6.updateUserSize){_6.updateUserSize(null,_6.$o6);_6.updateUserSize(null,_6.$o5)}
delete _1.parentProperty
var _7=_4.findPaletteNode("type",_2)||_4.findPaletteNode("className",_2);if(!_7){_7={type:_2,defaults:{_constructor:_2}
}}
_7=isc.clone(_7);var _8=_4.makeEditNode(_7);_4.addNode(_8,_5,null,null,null,null,true);_4.addNode(_1,_8);return _8}
,isc.A.getOverrideProperties=function isc_CanvasEditProxy_getOverrideProperties(){var _1=this.Super("getOverrideProperties",arguments);if(isc.isA.DataBoundComponent(this.creator)){_1=isc.addProperties({},_1,{adminSearches:"localOnly"
})}
return _1}
);isc.B._maxIndex=isc.C+12;isc.defineClass("HandPlacedContainerEditProxy","CanvasEditProxy");isc.A=isc.HandPlacedContainerEditProxy.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.canAddNode=function isc_HandPlacedContainerEditProxy_canAddNode(_1,_2,_3,_4){var _5=this.Super("canAddNode",arguments);if(_5==null){var _6=this.creator;if(isc.isAn.HandPlacedContainer(_6)&&_2&&_2.isA("Palette")){var _7=isc.ClassFactory.getClass(_1);if(_7&&_7.isA("Canvas")||_7.isA("FormItem")||_7.isA("DrawItem")){_5=true}
}
}
return _5}
,isc.A.shouldPassDropThrough=function isc_HandPlacedContainerEditProxy_shouldPassDropThrough(){return false}
);isc.B._maxIndex=isc.C+2;isc.defineClass("LayoutEditProxy","CanvasEditProxy");isc.A=isc.LayoutEditProxy.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.getOverrideProperties=function isc_LayoutEditProxy_getOverrideProperties(){var _1=this.Super("getOverrideProperties",arguments);_1=isc.addProperties(_1,{makeDropLine:function(){var _2=this.Super("makeDropLine",arguments);_2.setBackgroundColor("red");return _2}
});return _1}
,isc.A.hideAllDragDropLines=function isc_LayoutEditProxy_hideAllDragDropLines(){var _1=this.creator,_2=_1.editContext,_3=_2.getEditNodeArray()
;for(var i=0;i<_3.length;i++){var _5=_3[i],_1=_5.liveObject
;if(!_1)continue;if(_1.hideDragLine)_1.hideDragLine();if(_1.hideDropLine)_1.hideDropLine()}
}
,isc.A.drop=function isc_LayoutEditProxy_drop(){var _1=this.creator,_2=_1.editContext
;if(this.shouldPassDropThrough()){_1.hideDropLine();return}
if(this.wrapInvalidDropTarget()){_1.hideDropLine();return isc.EH.STOP_BUBBLING}
this.hideAllDragDropLines();var _3=isc.EH.dragTarget,_4,_5,_6;if(!_3.isA("Palette")){if(_3.isA("FormItemProxyCanvas")){_3=_3.formItem}
_6=_3._constructor||_3.Class}else{_4=_3.transferDragData();if(isc.isAn.Array(_4))_4=_4[0];_6=_4.type||_4.className}
var _7=this.findEditNode(_6);if(_7){_7=_7.editNode}
if(!_7||!_7.liveObject){return isc.EH.STOP_BUBBLING}
if(_7.liveObject!=_1&&_7.liveObject.editProxy&&_7.liveObject.editProxy!=this)
{_1.hideDropLine();if(_3.isA("TreePalette")){_4=_3.data.getCleanNodeData(_4,false,false,false)}
if(_4){_4=isc.clone(_4);_4.dropped=true}
var _8=_7.liveObject.editProxy;if(!_3.isA("Palette")){_8.completeReparent(true)}else{_8.completeDrop(_4,{skipSnapToGrid:isc.EH.shiftKeyDown()})}
return isc.EH.STOP_BUBBLING}
var _9=this.getDropPosition(),_10;if(_4){_10=_4;_4=this.substituteNode(_7,_4);_6=_4.type||_4.className;var _11=_7;_7=this.adjustParentNode(_7,_4);if(_11!=_7)_9=null}
if(_4){_5=_2.makeEditNode(_4);_5.dropped=true}
if(this.modifyEditNode){_7=this.modifyEditNode(_5,_7,_6);if(!_7){_1.hideDropLine();return isc.EH.STOP_BUBBLING}
}
if(!_3.isA("Palette")){if(_3==_1)return;var _12=_2.getEditNodeTree(),_13=_12.getParent(_3.editNode),_14=_12.getChildren(_13).indexOf(_3.editNode),_15=_9;_2.removeNode(_3.editNode,null,true);delete _3.editNode.parentProperty;var _16=(_3.isA("CanvasItem")?_3.canvas.editNode:_3.editNode),_17=_16.liveObject&&_16.liveObject.editProxy,_18=false
;if(_17){var _4=_2.makePaletteNode(_16),_19=_17.substituteNode(_7,_4)
;if(_4!==_19){if(_4.defaults){_19.defaults=isc.clone(_4.defaults)}
_16=_2.makeEditNode(_19);_18=true}
}
if(_13==this.editNode&&_15>_14)_15--;var _20;if(_3.isA("FormItem")){if(_3.isA("CanvasItem")){_20=_2.addNode(_3.canvas.editNode,_7,_15)}else{_20=_2.addWithWrapper(_16,_7,_15)}
}else if(_3.isA("DrawItem")){_20=_2.addWithWrapper(_16,_7,_15,null,true)}else{_20=_2.addNode(_16,_7,_15,null,null,null,true)}
if(_20){_2.fireNodeMoved(_3.editNode,_13,_20,_7)}
if(_18){_2.destroyNode(_3.editNode)}
if(isc.isA.TabSet(_7.liveObject)){_7.liveObject.selectTab(_3)}else if(_20&&_20.liveObject){isc.EditContext.delayCall("selectCanvasOrFormItem",[_20.liveObject,true],200)}
}else{var _21=isc.ClassFactory.getClass(_6),_22;if(_21&&_21.isA("FormItem")){_22=_2.addWithWrapper(_5,_7,_9)}else if(_21&&_21.isA("DrawItem")){_22=_2.addWithWrapper(_5,_7,_9,null,true)}else{var _23=isc.DataSource.getNearestSchemaClass(_6);if(_23&&_23.isA(isc.DataSource))_9=0;var _24=this.getContainerNode(_7,_5);if(_24){var _25=_1.editContext.makeEditNode(_24);_22=_2.addNode(_25,_7,_9);_7=_22;_9=0}
_22=_2.addNode(_5,_7,_9)}
if(_22!=null){if(this.canSelectChildren&&_5.liveObject.editProxy!=null&&_5.liveObject.editProxy.canSelect!=false)
{_2.delayCall("selectSingleComponent",[_5.liveObject])}
if(_5.liveObject.editProxy&&_5.liveObject.editProxy.nodeDropped)
{_5.liveObject.editProxy.nodeDropped(_5,_7)}
if(_10!=_4){_2.fireSubstitutedNode(_10,_4,_7)}
}
}
_1.hideDropLine();return isc.EH.STOP_BUBBLING}
,isc.A.getDropPosition=function isc_LayoutEditProxy_getDropPosition(){return this.creator.getDropPosition()}
,isc.A.dropMove=function isc_LayoutEditProxy_dropMove(){if(!this.willAcceptDrop())return false;if(!this.shouldPassDropThrough()){var _1=this.creator;if(_1.dropMove){var _2=this.getEventDragData(),_3=(_2.alwaysAllowRootDrop==true||_2.alwaysAllowRootDrop=="true"),_4=_1.showDropLines
;if(_3)_1.showDropLines=false;_1.dropMove();if(_3)_1.showDropLines=_4}
isc.EditContext.hideAncestorDragDropLines(_1);return isc.EH.STOP_BUBBLING}else{this.creator.hideDropLine()}
}
,isc.A.dropOver=function isc_LayoutEditProxy_dropOver(){var _1=this.creator;if(!this.willAcceptDrop()){if(_1==_1.ns.EH.dragTarget){return}
return false}
if(!this.shouldPassDropThrough()){var _2=(_1.dropOver?_1.dropOver():isc.EH.STOP_BUBBLING);if(_2==false){this.hideAllDragDropLines()}
return _2}else{this.creator.hideDropLine()}
}
,isc.A.dropOut=function isc_LayoutEditProxy_dropOut(){var _1=this.creator;this.showSelectedAppearance(false);this.setDragTracker(null);if(!this.shouldPassDropThrough()){if(_1.dropOut)_1.dropOut();this.creator.hideDropLine();return isc.EH.STOP_BUBBLING}else{this.creator.hideDropLine()}
}
);isc.B._maxIndex=isc.C+7;isc.defineClass("LayoutResizeBarEditProxy","EditProxy");isc.A=isc.LayoutResizeBarEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.showDragHandle=false;isc.A.supportsInlineEdit=false;isc.A.inlineEditOnDrop=false;isc.B.push(isc.A.dragMove=function isc_LayoutResizeBarEditProxy_dragMove(){return this.creator.dragMove()}
,isc.A.click=function isc_LayoutResizeBarEditProxy_click(){var _1=this.Super("click",arguments);this.creator.click();return _1}
);isc.B._maxIndex=isc.C+2;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.getOverrideProperties=function isc_DeckEditProxy_getOverrideProperties(){var _1=this.Super("getOverrideProperties",arguments);var _2=this.creator,_3=_2.editNode,_4=(_3&&_3.defaults),_5=(_4&&_4.currentPane)
;_1=isc.addProperties(_1,{currentPane:_5
});return _1}
,isc.A.addPane=function isc_DeckEditProxy_addPane(_1,_2){var _3=this.creator;_3.addPane(_1,_2);if(!isc.$75u){_3.setCurrentPane(_1)}else if(isc.isA.String(_3.$253k)&&_1.ID==_3.$253k){_3.currentPane=null;_3.setCurrentPane(_1);delete _3.$253k}
}
);isc.B._maxIndex=isc.C+2;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.$209k="observer.$209j(arguments[1])";isc.A.$209l="observer.$209j(arguments[1]);if(arguments[1]!=arguments[3])observer.$209j(arguments[3])";isc.A.$211u=["navigationPane","listPane","detailPane"];isc.A.paneDefaults={_constructor:"VLayout",align:"center",showDropLines:false,padding:30,width:"100%",membersMargin:5,overflow:"hidden"
};isc.A.paneHeaderDefaults={_constructor:"Label",autoDraw:false,height:10,align:"center",styleName:"instructionsHeader"
};isc.A.paneExistingComponentDefaults={_constructor:"Label",autoDraw:false,height:1,align:"center",styleName:"instructionsComponent"
};isc.A.paneInstructionsDefaults={_constructor:"Label",autoDraw:false,height:10,align:"center",styleName:"instructionsText"
};isc.A.paneImageDefaults={_constructor:"Img",autoDraw:false,layoutAlign:"center",overflow:"hidden",redrawOnResize:true,imageType:"center",getInnerHTML:function(){if(this.$211t==null){this.$211t=this.maxHeight/this.maxWidth}
var _1=this.width,_2=this.height,_3=_1,_4=Math.floor(_1*this.$211t);if(_4>_2){_4=_2;_3=Math.floor(_2/this.$211t)}
this.imageWidth=_3;this.imageHeight=_4;return this.Super("getInnerHTML",arguments)}
};isc.A.paneToolStripSpacerDefaults={_constructor:"LayoutSpacer",height:30
};isc.A.$204l={navigationPane:{title:"Navigation Pane",showResizeBar:true,text:"Typically contains a TreeGrid or ListGrid that updates data in other panes when clicked.",imageSrc:"SplitPane_navigationPane.png",imageHeight:230,imageWidth:310
},listPane:{title:"List Pane",showResizeBar:true,text:"Usually contains a ListGrid which is updated based on selections in the navigation pane.",imageSrc:"SplitPane_listPane.png",imageHeight:195,imageWidth:296
},detailPane:{title:"Detail Pane",text:"Add new records, or view / update those selected in the ${detailListPane} by adding a DetailGrid or TableLayoutForm.",imageSrc:"SplitPane_detailPane.png",imageHeight:170,imageWidth:370
}
};isc.A.$2036={"navigationPane":0,"listPane":1,"detailPane":2
};isc.A.supportsInlineEdit=false;isc.B.push(isc.A.setEditMode=function isc_SplitPaneEditProxy_setEditMode(_1){this.Super("setEditMode",arguments);var _2=this.creator;this.isTriplePane=isc.isA.TriplePane(_2);if(_1){var _3=(this.isTriplePane?"List Pane":"Navigation Pane");if(!_2.navigationPane){_2.$79k(this.createInstructionPane("navigationPane"))}
if(!_2.listPane&&this.isTriplePane){_2.$800(this.createInstructionPane("listPane"))}
if(!_2.detailPane){_2.$79l(this.createInstructionPane("detailPane",_3))}
}else{if(_2.navigationPane&&_2.navigationPane.$2074){var _4=_2.navigationPane;_2.$79k(null);_4.destroy()}
if(_2.listPane&&_2.listPane.$2074){var _4=_2.listPane;_2.$800(null);_4.destroy()}
if(_2.detailPane&&_2.detailPane.$2074){var _4=_2.detailPane;_2.$79l(null);_4.destroy()}
}
var _5=_2.editContext;if(_1){this.observe(_5,"nodeAdded",this.$209k);this.observe(_5,"nodeRemoved",this.$209k);this.observe(_5,"nodeMoved",this.$209l)}else{this.ignore(_5,"nodeAdded");this.ignore(_5,"nodeRemoved");this.ignore(_5,"nodeMoved")}
_2.updateUI(true)}
,isc.A.destroy=function isc_SplitPaneEditProxy_destroy(){if(this.$226y){for(var _1 in this.$226y){this.creator.removeChild(this.$226y[_1]);this.$226y[_1].destroy}
}
this.Super("destroy",arguments)}
,isc.A.$209j=function isc_SplitPaneEditProxy__updatePaneComponent(_1){if(!_1)return;var _2=this.creator,_3=_2.listPane,_4=_2.navigationPane,_5=_1.liveObject
;while(_5!=null){if(_3==_5){_2.$206q("list",_3,true);return}
if(_4==_5){_2.$206q("navigation",_4,true);return}
_5=_5.parentElement}
}
,isc.A.getOverrideProperties=function isc_SplitPaneEditProxy_getOverrideProperties(){var _1=this.Super("getOverrideProperties",arguments);_1=isc.addProperties({},_1,{setNavigationPane:this.setNavigationPane,setListPane:this.setListPane,setDetailPane:this.setDetailPane
});return _1}
,isc.A.setNavigationPane=function isc_SplitPaneEditProxy_setNavigationPane(_1){var _2=this.creator.navigationPane;if(!_1)_1=this.createInstructionPane("navigationPane");this.creator.Super("setNavigationPane",[_1]);if(_2!=null&&_2!=_1&&_2.$2074){_2.destroy()}
}
,isc.A.setListPane=function isc_SplitPaneEditProxy_setListPane(_1){var _2=this.creator.listPane;if(!_1)_1=this.createInstructionPane("listPane");this.creator.Super("setListPane",[_1]);if(_2!=null&&_2!=_1&&_2.$2074){_2.destroy()}
}
,isc.A.setDetailPane=function isc_SplitPaneEditProxy_setDetailPane(_1){var _2=this.creator.detailPane;if(!_1){var _3=(this.isTriplePane?"List Pane":"Navigation Pane");_1=this.createInstructionPane("detailPane",_3)}
this.creator.Super("setDetailPane",[_1]);if(_2!=null&&_2!=_1&&_2.$2074){_2.destroy()}
}
,isc.A.canAddNode=function isc_SplitPaneEditProxy_canAddNode(_1,_2,_3,_4){var _5=this.Super("canAddNode",arguments);if(_5&&_4&&_2&&!_2.isA("Palette")){_5=null}
return _5}
,isc.A.drop=function isc_SplitPaneEditProxy_drop(){return isc.EH.STOP_BUBBLING}
,isc.A.dropOver=function isc_SplitPaneEditProxy_dropOver(){if(!this.canDropAtLevel())return;if(!this.willAcceptDrop()){if(this.creator==this.creator.ns.EH.dragTarget){return}
return false}
if(!this.shouldPassDropThrough()){var _1=this.$226z();if(_1){this.showDropOverlay(true,_1)}
this.creator.hideDropLine()}
return isc.EH.STOP_BUBBLING}
,isc.A.dropMove=function isc_SplitPaneEditProxy_dropMove(){var _1=this.Super("dropMove",arguments);if(_1==isc.EH.STOP_BUBBLING){var _2=this.$226z();if(_2){this.showDropOverlay(true,_2)}
this.creator.hideDropLine()}
return _1}
,isc.A.dropOut=function isc_SplitPaneEditProxy_dropOut(){this.showSelectedAppearance(false);this.setDragTracker(null);this.showDropOverlay(false)}
,isc.A.$226z=function isc_SplitPaneEditProxy__getOverPane(){var _1,_2,_3=this.creator,x=isc.EH.getX(),y=isc.EH.getY()
;for(var i=0;i<this.$211u.length;i++){var _7=this.$211u[i],_8=_3[_7]
;if(_8&&!_8.$2074&&_8.containsPoint(x,y)){_2=_7;_1=_8;break}
}
if(!_1&&_3.detailToolStrip&&_3.detailToolStrip.containsPoint(x,y)){_2="detailPane";_1=_3.detailPane}
var _9=(_1&&(!isc.isA.Layout(_1)||isc.isA.ListGrid(_1)||isc.isA.TileGrid(_1)));return _9&&_2}
,isc.A.completeDrop=function isc_SplitPaneEditProxy_completeDrop(_1,_2,_3,_4){var _5=this.creator,_6=this
;if(!_5.editContext)return;_4=_4||isc.EH.dragTarget;if(_1.loadData&&!_1.isLoaded){_1.loadData(_1,function(_27){_27=_27||_1;_27.isLoaded=true;_6.completeDrop(_27,_2,function(_12){_12.dropped=_1.dropped;if(_3)_3(_12)},_4)});return}
var _7=(_2?_2.parentProperty:null);var _8=_5.editContext,_9=_5.editNode,_10=_9,_11=_7&&isc.DS.getChildObject(_5,"Canvas",null,_7),_12,_13
;var _14=_1;if(!_4.isA("Palette")){if(_4.isA("FormItemProxyCanvas")){_4=_4.formItem}
_13=_4._constructor||_4.Class;_12=_4.editNode}else{_1=this.substituteNode(_5.editNode,_1);_9=this.adjustParentNode(_9,_1);if(_9!=_5.editNode){_8.addFromPaletteNodes([_1],_9,null,null,false);if(_14!=_1){_8.fireSubstitutedNode(_14,_1,_9)}
if(_3)_3(_12);return}
_12=_8.makeEditNode(_1);if(!_8.suppressDroppedNodeFlag){_12.dropped=true}
_12.parentProperty=_7;_13=_12.type||_12.className}
if(isc.isA.DataSource(_12.liveObject)){if(_3)_3(_12);return}
var _15,_16;if(!_7){_7=this.getDropParentProperty(_1,true);_15=(_7!=null);_11=_7&&isc.DS.getChildObject(_5,"Canvas",null,_7);if(_15&&_11&&!_11.$2074){var _17=_8.getEditNodeTree(),_18=_17.getChildren(_9),_19,_20
;if(_18){for(var i=0;i<_18.length;i++){var _22=_18[i];if(_22.parentProperty==_7){_19=_22}
if(_22.parentProperty=="detailPane"){_20=_22}
}
}
if(_19){var _23=function(_27){var _28,_18=_17.getChildren(_27);if(_18){for(var i=0;i<_18.length;i++){var _22=_18[i];if(_22.liveObject&&isc.isA.DataBoundComponent(_22.liveObject))
{_28=true;break}else if(_22.liveObject&&isc.isA.Layout(_22.liveObject))
{var _29=_17.getChildren(_22);if(_29){for(var i=0;i<_29.length;i++){var _30=_29[i];if(_30.liveObject&&isc.isA.DataBoundComponent(_30.liveObject))
{_28=true;break}
}
}
}
}
}
return _28}
var _24=_23(_19);if(!_24&&isc.isA.Layout(_19.liveObject)&&!isc.isA.DataBoundComponent(_19.liveObject))
{_9=_19}else if(isc.isA.DataBoundComponent(_19.liveObject)||_24){_24=_23(_20);var _25=isc.ClassFactory.getClass(_13);if((_25.isA("ListGrid")&&!_25.isA("TreeGrid"))||_25.isA("DynamicForm")||_25.isA("DetailViewer"))
{if(isc.isA.DataBoundComponent(_20.liveObject)){_16="VLayout";_7="detailPane"}else if(isc.isA.Layout(_20.liveObject)){_9=_20;_7=null}else{_7=null}
}else{_7=null}
}else{_7=null}
}
}
}
if(_9==_10&&!_7){isc.warn("No pane can be assigned for drop.");if(_3)_3(null);return}
var _26=function(){if(isc.isA.DataSource(_12.liveObject)){_8.deselectAllComponents();isc.Timer.setTimeout(function(){_8.selectSingleComponent(_9.liveObject);_6.fireCallback(_3,"node",[_12])})}else if(_6.canSelectChildren&&_12.liveObject.editProxy!=null&&_12.liveObject.editProxy.canSelect!=false)
{isc.Timer.setTimeout(function(){_8.selectSingleComponent(_12.liveObject);_6.fireCallback(_3,"node",[_12])})}else{_6.fireCallback(_3,"node",[_12])}
};if(_15){if(_16){_6.finishAddPane(_7,_12,_13,_16);if(_14!=_1){_8.fireSubstitutedNode(_14,_1,_9)}
}else{_8.addNode(_12,_9,null,_7)}
_26();return}
_11=_7&&isc.DS.getChildObject(_5,"Canvas",null,_7);if(_11&&!_11.$2074){if(_14.dropped){this.confirmReplaceComponent(_11.editNode,_12,function(_16){if(!_16&&_13=="LayoutResizeBar")_16="VLayout";_6.finishAddPane(_7,_12,_13,_16);if(_14!=_1){_8.fireSubstitutedNode(_14,_1,_9)}
_26()})}else{_26()}
}else{var _16=(_13=="LayoutResizeBar"?"VLayout":null);if(_11&&!_11.$2074){_16="VLayout"}
this.finishAddPane(_7,_12,_13,_16);if(_14!=_1){_8.fireSubstitutedNode(_14,_1,_9)}
_26()}
}
,isc.A.getDropParentProperty=function isc_SplitPaneEditProxy_getDropParentProperty(_1,_2){var _3=_1.type||_1.className,_4=isc.ClassFactory.getClass(_3),_5=_4.isA("DataBoundComponent")
;if(_5){var _6;if(_4.isA("DynamicForm")||_4.isA("DetailViewer")||_4.isA("FacetChart")){_6="detailPane"}else if(_4.isA("TreeGrid")){_6="navigationPane"}else if(_4.isA("ListGrid")){_6=(this.isTriplePane?"listPane":"navigationPane")}
if(_6){var _7=this.creator[_6];if(!_7||_7.$2074){return _6}
}
}
if(_2&&this.$248v){return this.$248v}
for(var i=0;i<this.$211u.length;i++){var _9=this.$211u[i],_7=this.creator[_9]
;if(!this.isTriplePane&&_9=="listPane")continue;if(!_7||_7.$2074){return _9}
}
}
,isc.A.wrapInvalidDropTarget=function isc_SplitPaneEditProxy_wrapInvalidDropTarget(){var _1=this.creator,_2=_1.ns.EH.dragTarget
;var _3=this.getEventDragData(),_4=this.getEventDragType(_3)
;if(!_4)return false;return this.Super("wrapInvalidDropTarget",arguments)}
,isc.A.wrapPreviousDropTarget=function isc_SplitPaneEditProxy_wrapPreviousDropTarget(_1){var _2=this.creator,_3=_2.editContext,_4=this.getDropParentProperty(_1)||"navigationPane"
;_3.addNode(_1,_2.editNode,null,_4,null,null,true)}
,isc.A.createInstructionPane=function isc_SplitPaneEditProxy_createInstructionPane(_1,_2,_3){var _4=this.$204l[_1],_5=_4.title
;var _6=this.createAutoChild("pane",{$2074:true,name:_5,canAcceptDrop:true,parentProperty:_1,drop:function(){return this.creator.addPane(this.parentProperty)},dropOver:function(){this.updatePane(true)},dropOut:function(){this.updatePane(false)},updatePane:function(_24){if(this.paneHeader){this.paneHeader.setContents(this.creator.getTitleSpan(this.name,_24))}
if(this.paneExistingComponent){var _7=this.getPaneComponent();this.paneExistingComponent.setContents(_7);if(!_7)this.paneExistingComponent.hide();else this.paneExistingComponent.show()}
},getPaneComponent:function(){var _8=this.creator,_9=_8.creator,_10=_9[this.parentProperty],_11=null;;if(_10&&!_10.$2074){var _12=_9.editContext,_13=(_12.getSelectedLabelText
?_12.getSelectedLabelText(_10)
:_10.toString())
;_11="Currently: "+_13}
return _11}
});var _14=_6.paneHeader=this.createAutoChild("paneHeader",{contents:this.getTitleSpan(_5,false)
});var _15=_6.paneExistingComponent=this.createAutoChild("paneExistingComponent",{visibility:"hidden"
});var _16=this.createAutoChild("paneInstructions",{contents:_4.text.evalDynamicString(null,{detailListPane:_2})
});var _17;if(_3){var _18=this.creator.listToolStrip||this.creator.detailToolStrip,_19=(_18?_18.getVisibleHeight():0)
;if(_19>0)_19-=_6.membersMargin;_17=this.createAutoChild("paneToolStripSpacer",{height:_19
})}
_6.addMembers([_17,_14,_15,_16]);_6.moveTo(null,-1000);_6.draw();var _20=(_17?_17.height:0)+_6.padding;for(var i=0;i<_6.getMembers().length;i++){var _22=_6.members[i],_19=_22.getVisibleHeight();_20+=_19+(i>0?_6.membersMargin:0)}
_6.clear();_6.setMinHeight(_20);var _23=this.createAutoChild("paneImage",{src:_4.imageSrc,maxHeight:_4.imageHeight,maxWidth:_4.imageWidth,minHeight:50
});_6.addMember(_23);return _6}
,isc.A.getTitleSpan=function isc_SplitPaneEditProxy_getTitleSpan(_1,_2){var _3=(_2?"style='color:#0000ff'":""),_4="<span "+_3+">"+_1+"</span>"
;return _4}
,isc.A.showDropOverlay=function isc_SplitPaneEditProxy_showDropOverlay(_1,_2){if(!this.$226y)this.$226y={};if(_1){var _3=this.creator,_4=this.$226y[_2]
;if(this.$2260){if(this.$2260==_2){return}
this.showDropOverlay(false)}
if(!_4){var _5=_3[_2],_6=(this.isTriplePane?"List Pane":"Navigation Pane")
;_4=this.createInstructionPane(_2,_2,_6);var _7=_5.getPageLeft(),_8=_5.getPageTop(),_9=_3.getPageLeft(),_10=_3.getPageTop(),_11=_7-_9,_12=_8-_10
;_4.setRect(_11,_12,_5.getVisibleWidth(),_5.getVisibleHeight());_4.setBackgroundColor(_5.getPointerColor());_3.addChild(_4);this.$226y[_2]=_4}
_4.bringToFront();_4.show();this.$2260=_2}else if(this.$2260){this.$226y[this.$2260].hide();delete this.$2260}
}
,isc.A.addPane=function isc_SplitPaneEditProxy_addPane(_1){this.creator.hideDropLine();var _2=isc.EH.dragTarget,_3=this.getEventDragData(),_4
;if(_2.isA("TreePalette")){_4=_2.data.getCleanNodeData([_3],false,false,false)[0]}else{if(!isc.isA.Canvas(_3)&&!_3.ID&&!_3.type){return isc.EH.STOP_BUBBLING}
_4=_3.editNode}
if(_4){var _5=_4.type||_4.className;var _6=isc.ClassFactory.getClass(_5);if(!isc.isA.Canvas(_6))_4=null}
if(_4)this.completeDrop(_4,{parentProperty:_1});return isc.EH.STOP_BUBBLING}
,isc.A.finishAddPane=function isc_SplitPaneEditProxy_finishAddPane(_1,_2,_3,_4){var _5=this.creator,_6=_5.editContext
;var _7=this.findEditNode(_3);if(_7){_7=_7.editNode}
_6.removeNode(_2);var _8=_6.getEditNodeTree(),_9=_8.getChildren(_7),_10=this.$2036[_1],_11=_5.getDropPosition(_3)
;var _12=_7,_13
;if(_4!=null){var _14=isc.DS.getChildObject(_5,"Canvas",null,_1),_15,_16
;if(_14&&_14.$2074)_14=null;if(_14){_15=_14.editNode;_16=_9.indexOf(_14.editNode);_6.removeNode(_15,null,true);if(_14.updateUserSize){_14.updateUserSize(null,_14.$o6);_14.updateUserSize(null,_14.$o5)}
delete _15.parentProperty}
var _17={type:_4,defaults:{_constructor:_4},parentProperty:_1
};_13=_6.makeEditNode(_17);_6.addNode(_13,_12,_16,_1,null,null,true);if(_14){_6.addNode(_15,_13)}
_12=_13;_1=null;_11=null;delete _2.parentProperty}
if(this.modifyEditNode){_12=this.modifyEditNode(_2,_12,_3);if(!_12)return}
var _18;var _19=isc.ClassFactory.getClass(_3);if(_19&&_19.isA("FormItem")){_18=_6.addWithWrapper(_2,_12,null,_1)}else if(_19&&_19.isA("DrawItem")){_18=_6.addWithWrapper(_2,_12,null,_1,true)}else{_18=_6.addNode(_2,_12,_11,_1)}
if(_18!=null){var _20=_13||_18;if(_10!=null){var _21=null;for(var i=0;i<_9.length;i++){var _23=_9[i];if(_23==_20){_21=i;break}
}
if(_21!=null){var _24=_9[_10];if(_24!=_20){_6.reorderNode(_7,_21,_10)}
}
}
if(_2.liveObject.editProxy&&_2.liveObject.editProxy.nodeDropped){_2.liveObject.editProxy.nodeDropped(_20,_12)}
this.$248v=_1}
}
,isc.A.getChildNodeDescription=function isc_SplitPaneEditProxy_getChildNodeDescription(_1){var _2=this.creator,_3=_1.liveObject
;if(_2.navigationPane==_3)return"[Navigation Pane]";else if(_2.listPane==_3)return"[List Pane]";else if(_2.detailPane==_3)return"[Detail Pane]"}
);isc.B._maxIndex=isc.C+23;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.paneDefaults={_constructor:"VLayout",align:"center",showDropLines:false,padding:30,membersMargin:5,overflow:"hidden",drop:function(){if(this.getParentElements().contains(isc.EH.dragTarget))return false;return this.Super("drop",arguments)}
};isc.A.paneHeaderDefaults={_constructor:"Label",autoDraw:false,height:10,align:"center",styleName:"instructionsHeader"
};isc.A.paneExistingComponentDefaults={_constructor:"Label",autoDraw:false,height:10,align:"center",styleName:"instructionsComponent"
};isc.A.paneInstructionsDefaults={_constructor:"Label",autoDraw:false,height:10,align:"center",styleName:"instructionsText"
};isc.A.paneImageDefaults={_constructor:"Img",autoDraw:false,layoutAlign:"center",overflow:"hidden",redrawOnResize:true,imageType:"center",getInnerHTML:function(){if(this.$211t==null){this.$211t=this.maxHeight/this.maxWidth}
var _1=this.width,_2=this.height,_3=_1,_4=Math.floor(_1*this.$211t);if(_4>_2){_4=_2;_3=Math.floor(_2/this.$211t)}
this.imageWidth=_3;this.imageHeight=_4;return this.Super("getInnerHTML",arguments)}
};isc.A.paneToolStripSpacerDefaults={_constructor:"LayoutSpacer",height:30
};isc.A.$204l={navigationPane:{text:"Drop NavItems, NavHeaders and NavSeparators to build the application navigation.",imageSrc:"SplitPane_navigationPane.png",imageHeight:230,imageWidth:310
},detailPane:{text:"Drop components such as ListGrids and TableLayouts, etc. to be shown here when the corresponding NavPanel Item is selected in the left pane.",imageSrc:"SplitPane_detailPane.png",imageHeight:170,imageWidth:370
}
};isc.A.supportsInlineEdit=true;isc.A.inlineEditEvent="none";isc.B.push(isc.A.setEditMode=function isc_NavPanelEditProxy_setEditMode(_1){this.Super("setEditMode",arguments);var _2=this.creator,_3=_2.navGrid
;if(_1){var _4={canAcceptDroppedRecords:true,canReorderRecords:false,canReparentNodes:false,canDropOnLeaves:true,onFolderDrop:this.onFolderDrop,dragDataAction:"copy",showOpenIcons:true,showDropIcons:true
};_3.saveToOriginalValues(isc.getKeys(_4));_3.setProperties(_4)}else{_3.restoreFromOriginalValues(["canAcceptDroppedRecords","canDragRecordsOut","canReorderRecords","canReparentNodes","canDropOnLeaves","onFolderDrop","dragDataAction","showOpenIcons","showDropIcons"
]);this.removeInstructionPanes();_2.refreshData()}
_3.$31i()}
,isc.A.getOverrideProperties=function isc_NavPanelEditProxy_getOverrideProperties(){var _1=this.Super("getOverrideProperties",arguments);_1=isc.addProperties({},_1,{$156e:this.$156e
});return _1}
,isc.A.$156e=function isc_NavPanelEditProxy__processTreeAndReturnNavItemsPanes(_1){var _2=this.getOriginalValue("$156e");var _3=_2.apply(this,[_1]);if(!this.editingOn)return _3;var _1=isc.NavPanel.$168t(_1);for(var i=0,_5=_1.length;i<_5;++i){var _6=_1[i];if(_6.isSeparator||_6.canSelect==false)continue;if(!_6.pane){var _7=this.editProxy.createInstructionPane(null,"Components","detailPane");_3.add(_7);_6.pane=_7}
}
return _3}
,isc.A.removeInstructionPanes=function isc_NavPanelEditProxy_removeInstructionPanes(){var _1=isc.NavPanel.$168t(this.creator.navItems);for(var i=0,_3=_1.length;i<_3;++i){var _4=_1[i];if(_4.isSeparator||_4.canSelect==false)continue;var _5=_4.pane;if(_5&&_5.$2074){_4.pane=null;_5.markForDestroy()}
}
}
,isc.A.loadComplete=function isc_NavPanelEditProxy_loadComplete(){var _1=this.creator,_2=(_1.navItems&&_1.navItems.length>0)
;if(!_2){var _3=this.createInstructionPane(null,"NavPanel","navigationPane");_1.setNavigationPane(_3)}
}
,isc.A.getDragTrackerContents=function isc_NavPanelEditProxy_getDragTrackerContents(_1,_2){var _3=this.creator,_4=_3.ns.EH.dropTarget;if(_3.navGrid&&_4==_3.navGrid.body){if(_2!="NavItem"){var _5=_3.navGrid,_6=_5.getEventRecordNum(null,true),_7=_5.data.get(_6),_8=_5.data.isFolder(_7)
;if(_7&&_8)return this.createDragTracker(_7.editNode)}
}
return this.Super("getDragTrackerContents",arguments)}
,isc.A.onFolderDrop=function isc_NavPanelEditProxy_onFolderDrop(_1,_2,_3,_4,_5){var _6=(this.$256e?this:this.creator.editProxy);_6.$256e(_1,_2,_3,_4,_5);return false}
,isc.A.$256e=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;if(_6.navigationPane!=_6.navLayout){var _10=_6.navigationPane;_6.setNavigationPane(_6.navLayout);_10.markForDestroy()}
if(_9!="NavItem"&&_9!="NavSeparator"&&_9!="NavHeader"&&_8.type=="NavItem"&&(_4=="before"||_4=="after"))
{_4="over"}
var _11;if(_4=="after"&&_8.type=="NavPanel"){if(_9=="NavItem"){_11=_7.addFromPaletteNode(_1[0],_8,_3)}else{var _12=_7.findPaletteNode("type","NavItem")
var _13=_7.addFromPaletteNode(_12,_8,_3);_11=_13;var _14=null;if(_9=="LayoutResizeBar"){var _15={type:"VLayout",defaults:{_constructor:"VLayout"}
};_14=_13=_7.addFromPaletteNode(_15,_13)}
var _16=_11.liveObject.editContext.addFromPaletteNode(_1[0],_13);if(!_14)_14=_16}
}else{var _17=_8;if(_4=="before"){var _18=_7.getEditNodeTree();_17=_18.getParent(_8);var _19=_18.getChildren(_17);_3=_19.findIndex("ID",_8.ID)}
if(_9=="NavItem"){_11=_7.addFromPaletteNode(_1[0],_17,_3)}else if(_2==this.creator.navGrid.data.getRoot()||_17.liveObject.isHeader){var _12=_7.findPaletteNode("type","NavItem")
var _13=_7.addFromPaletteNode(_12,_17,_3);_11=_13;var _14=null;if(_9=="LayoutResizeBar"){var _15={type:"VLayout",defaults:{_constructor:"VLayout"}
};_14=_13=_7.addFromPaletteNode(_15,_13)}
var _16=_11.liveObject.editContext.addFromPaletteNode(_1[0],_13);if(!_14)_14=_16}else{var _20=isc.DS.getChildObject(_17.liveObject,"Canvas"),_21=this.creator.editProxy
;var _22=function(_30,_17,_3,_27){var _23=_30.type||_30.class,_24=isc.ClassFactory.getClass(_23),_14
;if(_24&&(_24.isA("FormItem")||_24.isA("DrawItem"))){var _8=_7.makeEditNode(_30),_25
;if(_24&&_24.isA("FormItem")){_25=_7.addWithWrapper(_8,_17,_3,null,null)}else{_25=_7.addWithWrapper(_8,_17,_3,null,true)}
var _18=_7.getEditNodeTree(),_26=_18.getParent(_25)
;if(_26)_14=_26}else{_30.dropped=true;_14=_7.addFromPaletteNode(_30,_17,_3)}
if(!_27)_27=_14;_6.setCurrentItem(_2);isc.Timer.setTimeout(function(){_7.selectSingleComponent(_14)});return _14};_3=0;if(_20&&_20.$2074){_6.setItemPane(_2,null);_20=null}
if(_20){var _16=_1[0];_21.confirmReplaceComponent(_20.editNode,_16,function(_28){var _27=null;if(!_28&&_9=="LayoutResizeBar")_28="VLayout";if(_28){_17=_27=_21.wrapExistingComponent(_20.editNode,_28);_3=null}
_22(_16,_17,_3,_27)})}else{if(_9=="LayoutResizeBar"){var _28="VLayout";_17=_27=_21.wrapExistingComponent(_20.editNode,_28);_3=null}
return _22(_1[0],_17,_3)}
}
}
if(_11!=null){var _29=_11.liveObject;isc.addProperties(_29,{$219c:_6,addPane:function(_30){this.$219c.setItemPane(_29,_30)}
});if(!_29.isSeparator){_6.setCurrentItem(_29);if(_11.dropped){_6.editProxy.delayCall("startItemInlineEditing",[_29,_6.navGrid.getRecordIndex(_29)])}else{_7.selectSingleEditNode(_11)}
}
}
return _11}
,isc.A.canAddNode=function isc_NavPanelEditProxy_canAddNode(_1,_2,_3,_4){var _5=this.Super("canAddNode",arguments);if(_5&&!_4&&_1=="NavItem"&&!this.creator.navigationPane.containsEvent())
{_5=null}
if(_4&&_1!="NavItem")_5=false;return _5}
,isc.A.completeDrop=function isc_NavPanelEditProxy_completeDrop(_1,_2,_3){var _4=this.creator,_5=_4.editContext,_6=_4.editNode
;var _7=(_2?_2.index:0);var _8=_5.getEditNodeTree(),_9=_8.getChildren(_6),_10=_6,_11=_7,_12="over"
;if(_7<_9.length){_10=_9[_7]}else{_12="after"}
var _13=this.$256e([_1],_10,_11,_12);if(_3)_3(_13)}
,isc.A.drop=function isc_NavPanelEditProxy_drop(){if(this.shouldPassDropThrough()){return}
var _1=this.creator,_2=isc.EH.dragTarget,_3
;if(!_2.isA("Palette")){if(_2.isA("FormItemProxyCanvas")){_2=_2.formItem}
}else{_3=_2.transferDragData();if(isc.isAn.Array(_3))_3=_3[0];_3.dropped=true}
if(_2.isA("TreePalette")){_3=_2.data.getCleanNodeData([_3],false,false,false)[0]}
_3=isc.clone(_3);if(!_2.isA("Palette")){if(_2==_1)return;_3=_1.editContext.makePaletteNode(_2.editNode);_1.editContext.removeNode(_2.editNode)}
var _4=this.creator.navGrid.getSelectedRecord();if(_4==null){_4=this.creator.navGrid.data.getRoot()}
this.onFolderDrop([_3],_4,0,"over");return isc.EH.STOP_BUBBLING}
,isc.A.dropOut=function isc_NavPanelEditProxy_dropOut(){this.showSelectedAppearance(false);this.setDragTracker(null)}
,isc.A.dropMove=function isc_NavPanelEditProxy_dropMove(){if(!this.willAcceptDrop())return false;if(this.creator.hideDropLine)this.creator.hideDropLine();if(!this.shouldPassDropThrough()){return isc.EH.STOP_BUBBLING}
}
,isc.A.wrapPreviousDropTarget=function isc_NavPanelEditProxy_wrapPreviousDropTarget(_1){var _2=this.creator,_3=_2.editContext
;if(_2.navigationPane!=_2.navLayout){var _4=_2.navigationPane;_2.setNavigationPane(_2.navLayout);_4.markForDestroy()}
var _5=isc.DataSource.getAutoTitle(_1.ID),_6=isc.addProperties({},_3.findPaletteNode("type","NavItem"))
;if(!_6.defaults)_6.defaults={};_6.defaults.title=_5;var _7=_3.addFromPaletteNode(_6,_2.editNode,null,null,null,null,true);isc.addProperties(_7.liveObject,{$219c:_2,addPane:function(_8){this.$219c.setItemPane(_7.liveObject,_8)}
});_3.addNode(_1,_7,null,null,null,null,true);_2.setCurrentItem(_7);this.delayCall("startItemInlineEditing",[_7.liveObject,0])}
,isc.A.createInstructionPane=function isc_NavPanelEditProxy_createInstructionPane(_1,_2,_3,_4,_5){var _6=this.$204l[_3];var _7=this.createAutoChild("pane",{$2074:true,width:_1,name:_2,canAcceptDrop:true,parentProperty:_3,showResizeBar:(_1!=null?_6.showResizeBar:false)
});var _8=_7.paneHeader=this.createAutoChild("paneHeader",{contents:this.getTitleSpan(_2,false)
});var _9=_7.paneExistingComponent=this.createAutoChild("paneExistingComponent",{visibility:"hidden"
});var _10=this.createAutoChild("paneInstructions",{contents:_6.text.evalDynamicString(null,{detailListPane:_4})
});var _11=this.createAutoChild("paneImage",{src:_6.imageSrc,maxHeight:_6.imageHeight,maxWidth:_6.imageWidth,minHeight:50
});var _12;if(_5){var _13=this.creator.listToolStrip||this.creator.detailToolStrip,_14=(_13?_13.getVisibleHeight():0)
;if(_14>0)_14-=_7.membersMargin;_12=this.createAutoChild("paneToolStripSpacer",{height:_14
})}
_7.addMembers([_12,_8,_9,_10,_11]);return _7}
,isc.A.getTitleSpan=function isc_NavPanelEditProxy_getTitleSpan(_1,_2){var _3=(_2?"style='color:#0000ff'":""),_4="<span "+_3+">"+_1+"</span>"
;return _4}
,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")}
this.delayCall("selectNavItem",[this.$167s],100)}
,isc.A.selectNavItem=function isc_NavPanelEditProxy_selectNavItem(_1){var _2=this.creator;isc.EditContext.selectCanvasOrFormItem(_2);if(_2.currentItem===_1)_2.setCurrentItem(null);_2.setCurrentItem(_1)}
);isc.B._maxIndex=isc.C+21;isc.defineClass("NavItemEditProxy","EditProxy");isc.A=isc.NavItemEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.canSelect=true;isc.A.canSelectChildren=true;isc.B.push(isc.A.completeDrop=function isc_NavItemEditProxy_completeDrop(_1,_2,_3){var _4=this.creator,_5=_4.getNavPanel()
;var _6=_5.editProxy.$256e([_1],_4,0,"over");if(_3)_3(_6)}
,isc.A.showSelectedAppearance=function isc_NavItemEditProxy_showSelectedAppearance(_1,_2,_3){var _4=this.creator;if(_1)_4.selectNavItem()}
);isc.B._maxIndex=isc.C+2;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){var _2=this.creator,_3=_2.selectedTab
;this.Super("setEditMode",arguments);if(_1){for(var i=0;i<_2.tabs.length;i++){var _5=_2.tabs[i];this.saveTabProperties(_5)}
}else{for(var i=0;i<_2.tabs.length;i++){var _5=_2.tabs[i];this.restoreTabProperties(_5)}
var _6=_2.selectedTab;_2.selectedTab=_3;_2.selectTab(_6)}
_2.tabBar.setEditMode(_1,_2.editContext,null);if(_2.paneContainer)_2.paneContainer.setEditMode(_1,_2.editContext,null)}
,isc.A.getOverrideProperties=function isc_TabSetEditProxy_getOverrideProperties(){var _1=this.Super("getOverrideProperties",arguments);_1=isc.addProperties(_1,{canReorderTabs:true,selectedTab:this.creator.selectedTab,closeClick:function(_2){}
});return _1}
,isc.A.saveTabProperties=function isc_TabSetEditProxy_saveTabProperties(_1){var _2=this.creator.getTab(_1);if(_2){_2.saveToOriginalValues(["closeClick","setDisabled","getStateSuffix"]);if(_2.disabled){_2.disabled=false;_2.$180e=true;_2.$180f=_2.getStateSuffix;_2.getStateSuffix=function(){return"Disabled"}
}
_2.setDisabled=function(_3){this.disabled=false;if(_3){this.$180e=true;if(!this.$180f){this.$180f=this.getStateSuffix}
this.getStateSuffix=function(){return"Disabled"}
this.setState(isc.StatefulCanvas.STATE_DISABLED)}else{delete this.$180e;if(this.$180f){this.getStateSuffix=this.$180f}
this.setState(isc.StatefulCanvas.STATE_UP)}
}
}
}
,isc.A.restoreTabProperties=function isc_TabSetEditProxy_restoreTabProperties(_1){var _2=this.creator,_3=_2.getTab(_1);if(_3){_3.restoreFromOriginalValues(["closeClick","setDisabled","getStateSuffix"]);_3.setDisabled(_3.$180e);delete _3.$180e;var _4=_3.hidden;_1.hidden=!_4;if(_3.hidden)_2.hideTab(_1);else _2.showTab(_1)}
}
,isc.A.getChildNodeDescription=function isc_TabSetEditProxy_getChildNodeDescription(_1){var _2=this.creator,_3=_1.liveObject
;if(_2.tabBarControls&&_2.tabBarControls.contains(_3)){return"[Tab bar control]"}
return null}
,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(_12){_5.editContext.removeNode(_12)});var _9=this.creator.editContext,_10=this.getNodePropertiesForType("Tab")
;for(var i=0;i<_2.length;i++){if(_8.contains(_2[i]))continue;var _11=_10||{type:"Tab"};_11.defaults={title:_2[i]};this.creator.editContext.addNode(_9.makeEditNode(_11),this.creator.editNode,i)}
}
,isc.A.getNodePropertiesForType=function isc_TabSetEditProxy_getNodePropertiesForType(_1){var _2=this.creator.editContext,_3=_2.getDefaultPalette(),_4
;if(_3&&_3.findPaletteNode){_4=_3.findPaletteNode("type",_1);if(_4)_4=isc.clone(_4)}
return _4}
,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"){return this.creator.tabBar}
return this.Super("findEditNode",arguments)}
,isc.A.isDroppingIntoTabBarControls=function isc_TabSetEditProxy_isDroppingIntoTabBarControls(_1){if(_1=="Tab")return false;var _2=this.creator,_3=_2.getPageLeft(),_4=_2.parentElement.getVisibleWidth(),_5=_3+(_4/2),x=isc.EH.getX()
;return(x>_5)}
,isc.A.drop=function isc_TabSetEditProxy_drop(){if(this.shouldPassDropThrough()){return}
var _1=this.creator,_2=isc.EH.dragTarget,_3
;if(!_2.isA("Palette")){return isc.EH.STOP_BUBBLING}else{var _4=_2.transferDragData();if(isc.isAn.Array(_4))_4=_4[0];_3=_4.type||_4.className}
if(this.isDroppingIntoTabBarControls(_3)){if(_2.isA("TreePalette")){_4=_2.data.getCleanNodeData(_4,false,false,false)}else{_4=isc.clone(_4)}
_4.dropped=true;var _5=_1.editContext,_6=_5.getEditNodeTree(),_7=_1.editNode,_8=_6.getChildren(_7)
;if(_8&&_8.length>0&&_8[0].parentProperty=="tabBarControls"){var _9=_8[0];isc.confirm("Replace <i>"+_9.ID+"</i><P><b>Tip</b>: to have multiple tab bar controls, add an HLayout as the tabbar control, then place controls inside that HLayout",function(_10){if(_10==true){_5.removeNode(_9,null,true);_1.editProxy.completeDrop(_4,{index:0,parentProperty:"tabBarControls"
})}
},{buttons:[isc.Dialog.NO,isc.Dialog.YES],autoFocusButton:1
})}else{this.completeDrop(_4,{index:0,parentProperty:"tabBarControls"})}
return isc.EH.STOP_BUBBLING}
return this.Super("drop",arguments)}
,isc.A.completeDrop=function isc_TabSetEditProxy_completeDrop(_1,_2,_3){var _4=this.creator,_5=_4.editContext,_6=_4.editNode
;_2=_2||{};var _7=(_2?_2.index:0),_8=_5.getEditNodeTree(),_9=_8.getChildren(_6)
;if(_2.parentProperty!="tabBarControls"&&_9&&_9.length>0&&_9[0].parentProperty=="tabBarControls")
{if(_7==0)_2.index=1}
var _10=_1.type||_1.className;if(_10!="Tab"&&!_2.parentProperty){var _11=_5.findPaletteNode("type","Tab")||_5.findPaletteNode("className","Tab")||{type:"Tab",defaults:{_constructor:"Tab"}
}
;var _12=_5.makeEditNode(_11);_12=_5.addNode(_12,_4.editNode,null,null,null,null,true);var _13=_5.makeEditNode(_1);_5.addNode(_13,_12);return}
this.Super("completeDrop",[_1,_2,function(_13){if(_13&&(_13.type||_13.className)=="Tab"){var _14=_13.liveObject;_4.selectTab(_14);if(_13.dropped){_14.editProxy.delayCall("editTitle")}
if(_3)_3(_13)}
}])}
,isc.A.adjustRepositionIndex=function isc_TabSetEditProxy_adjustRepositionIndex(_1,_2,_3,_4){if(_3==0){var _5=this.creator,_6=_5.editContext,_7=_5.editNode,_8=_6.getEditNodeTree(),_9=_8.getChildren(_7)
;if(_4!="tabBarControls"&&_9&&_9.length>0&&_9[0].parentProperty=="tabBarControls")
{_3=1}
}
return _3}
,isc.A.canDragChildNode=function isc_TabSetEditProxy_canDragChildNode(_1){return!_1.parentProperty}
,isc.A.wrapPreviousDropTarget=function isc_TabSetEditProxy_wrapPreviousDropTarget(_1){var _2=this.creator,_3=_2.editContext
;var _4=isc.DataSource.getAutoTitle(_1.ID),_5=_3.findPaletteNode("type","Tab")||_3.findPaletteNode("className","Tab")||{type:"Tab",defaults:{_constructor:"Tab"}
}
;_5=isc.addProperties({},_5);if(!_5.defaults)_5.defaults={};_5.defaults.title=_4;var _6=_3.makeEditNode(_5);_6=_3.addNode(_6,_2.editNode,null,null,null,null,true);_3.addNode(_1,_6,null,null,null,null,true);_6.liveObject.editProxy.delayCall("editTitle")}
);isc.B._maxIndex=isc.C+18;isc.defineClass("TabBarEditProxy","CanvasEditProxy");isc.A=isc.TabBarEditProxy.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.mouseDown=function isc_TabBarEditProxy_mouseDown(_1){return isc.EH.STOP_BUBBLING}
,isc.A.drop=function isc_TabBarEditProxy_drop(){var _1=this.creator.parentElement,_2=_1.editProxy
;_2.drop();return isc.EH.STOP_BUBBLING}
,isc.A.findEditNode=function isc_TabBarEditProxy_findEditNode(_1){var _2=this.creator.parentElement;return _2.editProxy.findEditNode(_1)}
,isc.A.startInlineEditing=function isc_TabBarEditProxy_startInlineEditing(){var _1=this.creator.parentElement;_1.editProxy.startInlineEditing()}
);isc.B._maxIndex=isc.C+4;isc.defineClass("StatefulCanvasEditProxy","CanvasEditProxy");isc.A=isc.StatefulCanvasEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.inlineEditOnDrop=true;isc.B.push(isc.A.getOverrideProperties=function isc_StatefulCanvasEditProxy_getOverrideProperties(){var _1=this.Super("getOverrideProperties",arguments);delete _1.canAcceptDrop;delete _1.canDropComponents;delete _1.overflow;return _1}
,isc.A.mouseDown=function isc_StatefulCanvasEditProxy_mouseDown(_1,_2){var _3=this.Super("mouseDown",arguments);if(_3==false)return _3;var _4=this.creator;if(_4.handleMouseDown)return _4.handleMouseDown(_1,_2)}
,isc.A.mouseUp=function isc_StatefulCanvasEditProxy_mouseUp(_1,_2){var _3=this.Super("mouseUp",arguments);if(_3==false)return _3;var _4=this.creator;if(_4.handleMouseUp)return _4.handleMouseUp(_1,_2)}
,isc.A.click=function isc_StatefulCanvasEditProxy_click(_1,_2){var _3=this.Super("click",arguments);if(this.creator.handleActivate)this.creator.handleActivate(_1,_2);return _3}
,isc.A.getNodeDescription=function isc_StatefulCanvasEditProxy_getNodeDescription(_1){if(_1.type=="Tab"){var _2=this.creator;return(_2.title?"Tab: "+_2.title.asHTML():null)}
}
,isc.A.completeReparent=function isc_StatefulCanvasEditProxy_completeReparent(_1){var _2=this.creator,_3=_2.ns.EH.dragTarget
;if(_3==_2)return;var _4=_3.editNode;if(isc.isA.TabBar(_2.parentElement)){var _5=isc.DS.getChildObject(_2,"Canvas"),_6=this
;if(_5){this.confirmReplaceComponent(_5.editNode,_4,function(_8){if(!_8)return _6.Super("completeReparent",[_1,_3]);var _7=this.wrapExistingComponent(_5.editNode,_8);return _7.liveObject.editProxy.completeReparent(_1,_3)});return}
}
return this.Super("completeReparent",arguments)}
,isc.A.completeDrop=function isc_StatefulCanvasEditProxy_completeDrop(_1,_2,_3){var _4=this.creator;if(isc.isA.TabBar(_4.parentElement)){var _5=isc.DS.getChildObject(_4,"Canvas");if(_5){var _6=this,_7=arguments
;this.confirmReplaceComponent(_5.editNode,_1,function(_9){if(!_9)return _6.Super("completeDrop",_7);var _8=this.wrapExistingComponent(_5.editNode,_9);return _8.liveObject.editProxy.completeDrop(_1,_2,_3)});return}
}
return this.Super("completeDrop",arguments)}
,isc.A.getInlineEditText=function isc_StatefulCanvasEditProxy_getInlineEditText(){return this.creator.getTitle()}
,isc.A.setInlineEditText=function isc_StatefulCanvasEditProxy_setInlineEditText(_1){var _2=this.creator;_2.editContext.setNodeProperties(_2.editNode,{title:_1})}
,isc.A.startInlineEditing=function isc_StatefulCanvasEditProxy_startInlineEditing(){if(!this.creator.parentElement||!isc.isA.TabBar(this.creator.parentElement)){this.Super("startInlineEditing",arguments)}
}
);isc.B._maxIndex=isc.C+10;isc.defineClass("RibbonButtonEditProxy","StatefulCanvasEditProxy").addMethods({})
isc.defineClass("ImgEditProxy","StatefulCanvasEditProxy");isc.A=isc.ImgEditProxy.getPrototype();isc.A.supportsInlineEdit=false;isc.A.inlineEditOnDrop=false;isc.defineClass("ToolStripSeparatorEditProxy","ImgEditProxy");isc.A=isc.ToolStripSeparatorEditProxy.getPrototype();isc.A.inlineEditOnDrop=false;isc.A.canSelectChildren=false;isc.defineClass("RibbonGroupEditProxy","LayoutEditProxy");isc.A=isc.RibbonGroupEditProxy.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.completeDrop=function isc_RibbonGroupEditProxy_completeDrop(_1,_2,_3){_2=_2||{};_2.parentProperty="controls";this.Super("completeDrop",arguments)}
,isc.A.canAddNode=function isc_RibbonGroupEditProxy_canAddNode(_1,_2,_3,_4){var _5=this.Super("canAddNode",arguments);return _5}
,isc.A.getDropPosition=function isc_RibbonGroupEditProxy_getDropPosition(){var _1=this.Super("getDropPosition",arguments);return(_1!=null?(_1>1?null:0):null)}
);isc.B._maxIndex=isc.C+3;isc.defineClass("LabelEditProxy","StatefulCanvasEditProxy");isc.A=isc.LabelEditProxy.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.getInlineEditText=function isc_LabelEditProxy_getInlineEditText(){return this.creator.getContents()}
,isc.A.setInlineEditText=function isc_LabelEditProxy_setInlineEditText(_1){var _2=this.creator;_2.editContext.setNodeProperties(_2.editNode,{contents:_1})}
);isc.B._maxIndex=isc.C+2;isc.defineClass("HeaderEditProxy","LayoutEditProxy");isc.A=isc.HeaderEditProxy.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.inlineEditOnDrop=true;isc.B.push(isc.A.willAcceptDrop=function isc_HeaderEditProxy_willAcceptDrop(){var _1=this.creator,_2=_1.getDropPosition()
;if(!isc.isA.Number(_2)||_2==0)return null;return this.Super("willAcceptDrop",arguments)}
,isc.A.getDropPosition=function isc_HeaderEditProxy_getDropPosition(){var _1=this.Super("getDropPosition",arguments),_2=(_1>0?_1-1:_1)
;return _2}
,isc.A.getInlineEditText=function isc_HeaderEditProxy_getInlineEditText(){return this.creator.title}
,isc.A.setInlineEditText=function isc_HeaderEditProxy_setInlineEditText(_1){var _2=this.creator;_2.editContext.setNodeProperties(_2.editNode,{title:_1})}
);isc.B._maxIndex=isc.C+4;isc.defineClass("ProgressbarEditProxy","StatefulCanvasEditProxy");isc.A=isc.ProgressbarEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.inlineEditOnDrop=false;isc.B.push(isc.A.getInlineEditText=function isc_ProgressbarEditProxy_getInlineEditText(){return(this.creator.percentDone!=null?this.creator.percentDone.toString():"")}
,isc.A.setInlineEditText=function isc_ProgressbarEditProxy_setInlineEditText(_1){var _2=this.creator;var _3=parseInt(_1);if(isNaN(_3))_3=null;_2.editContext.setNodeProperties(_2.editNode,{percentDone:_3})}
);isc.B._maxIndex=isc.C+2;isc.defineClass("WindowEditProxy","LayoutEditProxy");isc.A=isc.WindowEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.HEADER_SECTION=0;isc.A.BODY_SECTION=1;isc.A.FOOTER_SECTION=2;isc.A.$220f={"headerIcon":"WindowHeaderIcon","headerLabel":"WindowHeaderLabel","closeButton":"WindowCloseButton","minimizeButton":"WindowMinimizeButton","maximizeButton":"WindowMaximizeButton","spacer":"WindowFooterSpacer","resizer":"WindowResizer"
};isc.A.$220g=["headerControls",null,"footerControls"];isc.A.$220h={"headerIcon":"showHeaderIcon","headerLabel":"showTitle","closeButton":"showCloseButton","minimizeButton":"showMinimizeButton","maximizeButton":"showMaximizeButton","resizer":"showResizer"
};isc.A.supportsInlineEdit=true;isc.B.push(isc.A.canAddNode=function isc_WindowEditProxy_canAddNode(_1,_2,_3,_4){var _5=this.Super("canAddNode",arguments);if(_5&&!_4){var _6=this.creator;var _7=isc.ClassFactory.getClass(_1);if(_7&&_7.$177b){_5=false;var _6=this.creator;if(_7.$177b=="header"&&_6.header&&_6.header.containsEvent())
{_5=true}else if(_7.$177b=="footer"&&_6.footer&&_6.footer.containsEvent())
{_5=true}
}
}
return _5}
,isc.A.loadComplete=function isc_WindowEditProxy_loadComplete(){var _1=this.creator,_2=_1.editContext,_3=_1.editNode
;var _4=_2.getEditNodeTree();var _5=this;[this.HEADER_SECTION,this.FOOTER_SECTION].map(function(_13){var _6=_4.getChildren(_3),_7=false,_8=null
;for(var i=0;i<_6.length;i++){var _10=_6[i],_11=_5.$220i(_10)
;if(_11==_13){_7=true;_8=i;break}
if(_8==null&&_11>_13){_8=i}
}
if(!_7){var _12=_5.$220g[_13];_5.createDefaultEditNodes(_12,_8)}
})}
,isc.A.createDefaultEditNodes=function isc_WindowEditProxy_createDefaultEditNodes(_1,_2){var _3=this.creator,_4=_3.editContext,_5=_3[_1]
;for(var i=0;i<_5.length;i++){var _7=_5[i],_8=_4.findPaletteNode("type",this.$220f[_7])
;if(!_8){this.logWarn("Unable to find paletteNode for control "+_7+"under parentProperty "+_1+", type "+this.$220f[_7]+" - Ignoring");continue}
_8=isc.clone(_8);var _9=_4.makeEditNode(_8),_10=(_2!=null?_2+i:null)
;_4.addNode(_9,_3.editNode,_10,_1,true,null,true)}
}
,isc.A.canSaveChildNode=function isc_WindowEditProxy_canSaveChildNode(_1,_2){var _3=true;if(_2=="headerControls"){_3=this.creator.haveHeaderControlsChanged()}else if(_2=="footerControls"){_3=this.creator.haveFooterControlsChanged()}
return _3}
,isc.A.dropMove=function isc_WindowEditProxy_dropMove(){if(!this.willAcceptDrop())return false;if(this.creator.hideDropLine)this.creator.hideDropLine();if(!this.shouldPassDropThrough()){if(this.creator.header){if(this.creator.header.containsEvent()){this.showDropBorder("header")}else{this.hideDropBorder()}
}
if(this.creator.footer){if(this.creator.footer.containsEvent()){this.showDropBorder("footer")}else{this.hideDropBorder()}
}
return isc.EH.STOP_BUBBLING}
}
,isc.A.dragRepositionStop=function isc_WindowEditProxy_dragRepositionStop(){this.Super("dragRepositionStop",arguments);this.showSelectedAppearance(true)}
,isc.A.dragStart=function isc_WindowEditProxy_dragStart(_1,_2,_3){var _4=this.creator;if(_4&&_4.isModal)return false;return this.invokeSuper(isc.WindowEditProxy,"dragStart",_1,_2,_3)}
,isc.A.drop=function isc_WindowEditProxy_drop(){this.hideDropBorder();this.hideAllDragDropLines();var _1=this.creator,_2;if(this.creator.header&&this.creator.header.containsEvent()){_1=this.creator.header;_2="headerControls"}else if(this.creator.footer&&this.creator.footer.containsEvent()){_1=this.creator.footer;_2="footerControls"}
if(_1){if(this.shouldPassDropThrough())return;var _3=this.creator,_4=_3.editContext,_5=isc.EH.dragTarget,_6,_7;if(!_5.isA("Palette")){_7=_5._constructor||_5.Class}else{_6=_5.transferDragData();if(isc.isAn.Array(_6))_6=_6[0];_6.dropped=true;_7=_6.type||_6.className}
if(_5.isA("TreePalette")){_6=_5.data.getCleanNodeData([_6],false,false,false)[0]}
_6=isc.clone(_6);var _8=null,_9=false
;if(!_5.isA("Palette")){if(_5==_3)return;_4.removeNode(_5.editNode,null,true);_8=true}else{var _10=isc.ClassFactory.getClass(_7);if(_10&&(_10.isA("FormItem")||_10.isA("DrawItem"))){var _11=_4.makeEditNode(_6);if(_10&&_10.isA("FormItem")){_11=_4.addWithWrapper(_11,_3.editNode,null,_2)}else{_11=_4.addWithWrapper(_11,_3.editNode,null,_2,true)}
_9=true}
}
if(!_9){var _12=_3.editContext.makeEditNode(_6,_3.editNode);_12=_4.addNode(_12,_3.editNode,null,_2,null,null,_8);if(_12.liveObject.editProxy&&_12.liveObject.editProxy.nodeDropped){_12.liveObject.editProxy.nodeDropped(_12,_3.editNode)}
if(_8){var _13=_5.editNode,_14=_4.getEditNodeTree(),_15=_14.getParent(_13);_4.fireNodeMoved(_13,_15,_12,_3.editNode)}
}
}
return isc.EH.STOP_BUBBLING}
,isc.A.completeDrop=function isc_WindowEditProxy_completeDrop(_1,_2,_3){var _4=this.creator,_5=_4.editContext,_6=_4.editNode
;this.hideDropBorder();var _7=(_2?_2.index:null);var _8=_5.getEditNodeTree(),_9=_8.getChildren(_6),_10=this.$220i(_1),_11=this.$220g[_10],_12
;if(_11){for(var i=0;i<_9.length;i++){var _14=_9[i],_15=this.$220i(_14)
;if(_10<_15||(_7==i&&_10==_15)){_12=i;break}
}
}else{_12=_7}
if(!_2)_2={};if(_12!=null||_2.index!=null){_2.index=_12}
if(_12!=null){if(!_11){var _14=_9[_12];if(_14){var _15=this.$220i(_14);_11=this.$220g[_15]}
}
}
if(_11)_2.parentProperty=_11;this.Super("completeDrop",[_1,_2,_3]);_8.openFolder(_6)}
,isc.A.$220i=function isc_WindowEditProxy__getTargetSection(_1){var _2=_1.type||_1.className,_3=isc.ClassFactory.getClass(_2)
;if(_3&&_3.$177b){return(_3.$177b=="header"?this.HEADER_SECTION:this.FOOTER_SECTION)}
var _4=_1.parentProperty;return(_4=="headerControls"
?this.HEADER_SECTION
:(_4=="footerControls"?this.FOOTER_SECTION:this.BODY_SECTION))}
,isc.A.showDropBorder=function isc_WindowEditProxy_showDropBorder(_1){var _2=this.creator,_3=(_1=="header"?_2.header:_2.footer)
;if(_3)_3.setBorder("2px dashed blue")}
,isc.A.hideDropBorder=function isc_WindowEditProxy_hideDropBorder(){if(this.creator.header)this.creator.header.setBorder("");if(this.creator.footer)this.creator.footer.setBorder("")}
,isc.A.mapDropPositionToIndex=function isc_WindowEditProxy_mapDropPositionToIndex(_1,_2){var _3=this.creator;var _4=_2;for(var i=0;i<=_2;i++){var _6=_1[i];if(isc.isA.String(_6)){var _7=this.$220h[_6];if(!_3[_7])_4++}
}
return _4}
,isc.A.mapIndexToDropPosition=function isc_WindowEditProxy_mapIndexToDropPosition(_1,_2){var _3=this.creator;var _4=_2;for(var i=0;i<=_2;i++){var _6=_1[i];if(isc.isA.String(_6)){var _7=this.$220h[_6];if(!_3[_7])_4--}
}
return _4}
,isc.A.getResizeEdges=function isc_WindowEditProxy_getResizeEdges(){var _1=this.creator;if(isc.isA.ModalWindow(_1)||_1.isModal){this.persistCoordinates=true;return["B","R"]}
return this.Super("getResizeEdges",arguments)}
,isc.A.getNodeDescription=function isc_WindowEditProxy_getNodeDescription(_1){var _2=this.creator;return(_2.isModal?"initially hidden":null)}
,isc.A.getChildNodeDescription=function isc_WindowEditProxy_getChildNodeDescription(_1){var _2=_1.liveObject,_3=_1.parentProperty,_4="[Body]"
;if(_3=="headerControls"){_4=(_2.$1767?null:"[Header Control]")}else if(_3=="footerControls"){_4=(_2.$1767?null:"[Footer Control]")}
return _4}
,isc.A.getInlineEditText=function isc_WindowEditProxy_getInlineEditText(){return this.creator.title}
,isc.A.setInlineEditText=function isc_WindowEditProxy_setInlineEditText(_1){var _2=this.creator;_2.editContext.setNodeProperties(_2.editNode,{title:_1})}
);isc.B._maxIndex=isc.C+19;isc.defineClass("WindowHeaderEditProxy","LayoutEditProxy");isc.A=isc.WindowHeaderEditProxy.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.getOverrideProperties=function isc_WindowHeaderEditProxy_getOverrideProperties(){var _1=this.Super("getOverrideProperties",arguments);isc.addProperties(_1,{canAcceptDrop:true});return _1}
,isc.A.drop=function isc_WindowHeaderEditProxy_drop(){this.hideAllDragDropLines();var _1=this.creator,_2=isc.EH.dragTarget,_3=this.getDropPosition(),_4=_2.transferDragData()
;if(!_4)return;if(isc.isAn.Array(_4))_4=_4[0];if(_2.isA("TreePalette")){_4=_2.data.getCleanNodeData(_4,false,false,false)}else{_4=isc.clone(_4)}
_4.dropped=true;if(!_4.defaults)_4.defaults={};_4.parentProperty=(this.isHeader?"headerControls":"footerControls");var _5=_1.parentElement,_6=_5.editProxy.mapDropPositionToIndex(_5.headerControls,_3)
;var _7=_1.editContext,_8=_5.editNode
;var _9=_7.getEditNodeTree(),_10=_9.getChildren(_8),_11=_5.editProxy.$220i(_4)
;var _12=null;for(var i=0;i<_10.length;i++){var _14=_10[i],_15=_5.editProxy.$220i(_14)
;if(_15==_11){_12=i;break}
if(_12==null&&_15>_11){_12=i}
}
if(_12!=null)_6+=_12;_5.editProxy.completeDrop(_4,{index:_6})
return isc.EH.STOP_BUBBLING}
);isc.B._maxIndex=isc.C+2;isc.defineClass("DetailViewerEditProxy","CanvasEditProxy");isc.A=isc.DetailViewerEditProxy.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 \"Field:Value\" to create a mapping between fields and values.";isc.A.dataSeparatorChar=",";isc.A.dataDisplaySeparatorChar=":";isc.A.dataEscapeChar="\\";isc.B.push(isc.A.getInlineEditText=function isc_DetailViewerEditProxy_getInlineEditText(){var _1=this.creator;if(!_1.data)return null;var _2=(this.inlineEditMultiline?"\n":this.dataSeparatorChar),_3=_1.data,_4=_1.fields,_5=""
;for(var i=0;i<_4.length;i++){var _7=_4[i],_8=_3[_7.name]
;if(_8!=null)_8=_8.replace(this.dataDisplaySeparatorChar,this.dataEscapeChar+this.dataDisplaySeparatorChar);_5=_5+(_5.length>0?_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="<br/>";i++}
}else if(c=='['&&_1.indexOf("]",i+1)>0){c="<a href='#'>";_4=true}else if(c==']'){if(_4){c="</a>";_4=false}
}else if(c=='*'){if(_3){_3=false;c="</b>"}else{_3=true;c="<b>"}
}else if(c=='_'){if(_2){_2=false;c="</i>"}else{_2=true;c="<i>"}
}
_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.getOverrideProperties=function isc_MenuEditProxy_getOverrideProperties(){var _1=this.Super("getOverrideProperties",arguments);var _2=this.creator;if(isc.isA.Menu(_2)){var _3=_2.editContext,_4=_3.getParentNode(_2.editNode),_5=(_4?_4.liveObject:null)
;if(!_5||_5.contextMenu!=_2){isc.addProperties(_1,{autoDismiss:false,autoDismissOnBlur:false})}
}
return _1}
,isc.A.showSelectedAppearance=function isc_MenuEditProxy_showSelectedAppearance(_1,_2,_3){this.Super("showSelectedAppearance",arguments);var _4=this.creator;if(isc.isA.Menu(_4)){var _5=_4.editContext,_6=_5.getParentNode(_4.editNode),_7=(_6?_6.liveObject:null)
;if(!_7||_7.contextMenu!=_4){if(_1)this.showMenu()
else this.hideMenu()}
}
}
,isc.A.showMenu=function isc_MenuEditProxy_showMenu(){var _1=this.creator,_2=function(_6){if(_6.contextMenu&&_6.showContextMenu)_6.showContextMenu();else if(_6.menu&&_6.showMenu)_6.showMenu()}
;if(isc.isA.Menu(_1)){var _3=this.creator.editContext,_4=_3.getParentNode(_1.editNode)
;if(_4&&_4.liveObject){var _5=_4.liveObject;_2(_5)}
}else{_2(_1)}
}
,isc.A.hideMenu=function isc_MenuEditProxy_hideMenu(){var _1=this.creator,_2=function(_6){if(_6.contextMenu&&_6.showContextMenu)_6.hideContextMenu();else if(_6.menu&&_6.showMenu)_6.menu.hide()}
;if(isc.isA.Menu(_1)){var _3=this.creator.editContext,_4=_3.getParentNode(_1.editNode)
;if(_4&&_4.liveObject){var _5=_4.liveObject;_2(_5)}
}else{_2(_1)}
}
,isc.A.createInlineEditForm=function isc_MenuEditProxy_createInlineEditForm(){var _1=this.creator,_2=_1.editContext
;if(_2.isReify&&this.inlineEditMultiline){this.inlineEditMultiline=false;isc.MenuEditProxy.changeDefaults("inlineEditFormDefaults",{minHeight:20})}else if(!_2.isReify&&!this.inlineEditMultiline){this.inlineEditMultiline=true;isc.MenuEditProxy.changeDefaults("inlineEditFormDefaults",{minHeight:150})}
return this.Super("createInlineEditForm",arguments)}
,isc.A.getInlineEditText=function isc_MenuEditProxy_getInlineEditText(){var _1=this.creator,_2=_1.editContext
;if(_2.isReify){return this.creator.getTitle()}
var _3="";if(isc.isA.MenuButton(_1)){var _4=_1.menu||_1.data;_3+=isc.MenuEditProxy.menuToWikiText({title:_1.title,data:_4})}else{var _5=_1.menus;for(var i=0;i<_5.length;i++){_3+=isc.MenuEditProxy.menuToWikiText(_5[i])}
}
return _3}
,isc.A.setInlineEditText=function isc_MenuEditProxy_setInlineEditText(_1){var _2=this.creator,_3=_2.editContext
;if(_3.isReify){_2.editContext.setNodeProperties(_2.editNode,{title:_1});return}
if(isc.isA.MenuButton(_2)){var _4=isc.MenuEditProxy.parseMenuButtonString(_1);if(_4){_2.editContext.setNodeProperties(_2.editNode,_4)}else{_2.editContext.removeNodeProperties(_2.editNode,["title","menu"])}
}else{var _5=_2.editContext.getEditNodeTree(),_6=_5.getChildren(_2.editNode)
;if(_6&&_6.length>0)_5.removeList(_6);var _7=isc.MenuEditProxy.parseMenuBarString(_1);_2.editContext.setNodeProperties(_2.editNode,{menus:_7})}
}
);isc.B._maxIndex=isc.C+7;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.canAddNode=function isc_SectionStackEditProxy_canAddNode(_1,_2,_3,_4){var _5=this.Super("canAddNode",arguments);if(!_5){var _6=isc.ClassFactory.getClass(_1);if(_6&&(_6.isA("Canvas")||_6.isA("FormItem")||_6.isA("DrawItem")))
{_5=true}
}
return _5}
,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.A.wrapPreviousDropTarget=function isc_SectionStackEditProxy_wrapPreviousDropTarget(_1){var _2=this.creator,_3=_2.editContext
;var _4=isc.DataSource.getAutoTitle(_1.ID),_5=_3.findPaletteNode("type","SectionStackSection")||_3.findPaletteNode("className","SectionStackSection")||{type:"SectionStackSection",defaults:{_constructor:"SectionStackSection"}
}
;_5=isc.addProperties({},_5);if(!_5.defaults)_5.defaults={};_5.defaults.title=_4;var _6=_3.makeEditNode(_5);_6=_3.addNode(_6,_2.editNode,null,null,null,null,true);_3.addNode(_1,_6,null,null,null,null,true);_6.liveObject.editProxy.delayCall("startInlineEditing")}
);isc.B._maxIndex=isc.C+5;isc.defineClass("SectionStackSectionEditProxy","LabelEditProxy");isc.A=isc.SectionStackSectionEditProxy.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.centerInlineEdit=true;isc.A.extraEditorPadding=6;isc.B.push(isc.A.getOverrideProperties=function isc_SectionStackSectionEditProxy_getOverrideProperties(){var _1=this.Super("getOverrideProperties",arguments);isc.addProperties(_1,{noDoubleClicks:false,canAcceptDrop:true});return _1}
,isc.A.getNodeDescription=function isc_SectionStackSectionEditProxy_getNodeDescription(_1){var _2=this.creator;return(_2.title?"Section: "+_2.title.asHTML():null)}
,isc.A.getChildNodeDescription=function isc_SectionStackSectionEditProxy_getChildNodeDescription(_1){var _2=this.creator,_3=_1.liveObject
;if(_2.controls&&_2.controls.contains(_3))return"[Header control]";return null}
,isc.A.drop=function isc_SectionStackSectionEditProxy_drop(){if(this.shouldPassDropThrough()){return}
var _1=this.creator,_2=_1.editNode,_3=_1.ns.EH.dragTarget,_4=this.getEventDragData()
;if(!_3.isA("Palette")){return isc.EH.STOP_BUBBLING}
if(_3.isA("TreePalette")){_4=_3.data.getCleanNodeData(_4,false,false,false)}
_4=isc.clone(_4);_4.dropped=true;var _5=_1.editContext,_6=_5.getEditNodeTree(),_7=_6.getChildren(_2)
;if(_7&&_7.length>0&&_7[0].parentProperty=="controls"){var _8=_7[0],_9=this
;isc.confirm("Replace <i>"+_8.ID+"</i>",function(_10){if(_10==true){_5.removeNode(_8,null,true);_9.completeDrop(_4,{index:0,parentProperty:"controls"})}
},{buttons:[isc.Dialog.NO,isc.Dialog.YES],autoFocusButton:1
})}else{this.completeDrop(_4,{index:0,parentProperty:"controls"})}
return isc.EH.STOP_BUBBLING}
,isc.A.completeDrop=function isc_SectionStackSectionEditProxy_completeDrop(_1,_2,_3){var _4=this.creator,_5=_4.editContext,_6=_4.editNode
;_2=_2||{};var _7=(_2?_2.index:0),_8=_5.getEditNodeTree(),_9=_8.getChildren(_6)
;if(_2.parentProperty!="controls"&&_9&&_9.length>0&&_9[0].parentProperty=="controls")
{if(_7==0)_2.index=1}
this.Super("completeDrop",[_1,_2,_3])}
,isc.A.adjustRepositionIndex=function isc_SectionStackSectionEditProxy_adjustRepositionIndex(_1,_2,_3,_4){if(_3==0){var _5=this.creator,_6=_5.editContext,_7=_5.editNode,_8=_6.getEditNodeTree(),_9=_8.getChildren(_7)
;if(_4!="controls"&&_9&&_9.length>0&&_9[0].parentProperty=="controls")
{_3=1}
}
return _3}
,isc.A.canDragChildNode=function isc_SectionStackSectionEditProxy_canDragChildNode(_1){return!_1.parentProperty}
,isc.A.getInlineEditText=function isc_SectionStackSectionEditProxy_getInlineEditText(){return this.creator.getTitle()}
,isc.A.setInlineEditText=function isc_SectionStackSectionEditProxy_setInlineEditText(_1){var _2=this.creator;_2.editContext.setNodeProperties(_2.editNode,{title:_1})}
,isc.A.positionInlineEditor=function isc_SectionStackSectionEditProxy_positionInlineEditor(){this.Super("positionInlineEditor",arguments);var _1=this.creator;if(!_1.background){var _2=(_1.icon?_1.iconWidth||_1.iconSize:0),_3=_2+_1.getIconSpacing()+this.extraEditorPadding
;if(_3>0)this.inlineEditLayout.moveBy(_3,0)}
}
,isc.A.sizeInlineEditor=function isc_SectionStackSectionEditProxy_sizeInlineEditor(){this.Super("sizeInlineEditor",arguments);var _1=this.creator,_2;if(_1.background){_2=_1.background.label.getVisibleWidth()}else{var _3=(_1.icon?_1.iconWidth||_1.iconSize:0),_4=_3+_1.getIconSpacing()+this.extraEditorPadding,_5=(_1.controlsLayout?_1.controlsLayout.getVisibleWidth()+this.extraEditorPadding:0)
;_2=this.inlineEditLayout.getWidth()-_4-_5}
this.inlineEditLayout.setWidth(_2)}
,isc.A.doubleClick=function isc_SectionStackSectionEditProxy_doubleClick(){var _1=this.creator;if(isc.isA.Label(_1))_1=_1.parentElement;if(_1.$203s)_1.$203s();this.Super("doubleClick",arguments)}
);isc.B._maxIndex=isc.C+12;isc.defineClass("ScreenLoaderEditProxy","CanvasEditProxy");isc.A=isc.ScreenLoaderEditProxy.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_ScreenLoaderEditProxy_setEditMode(_1){this.Super("setEditMode",arguments);if(!_1){delete this.creator.$235q;this.creator.clear();this.creator.draw()}
this.editModeEnabled(_1)}
,isc.A.editModeEnabled=function isc_ScreenLoaderEditProxy_editModeEnabled(_1){}
,isc.A.getOverrideProperties=function isc_ScreenLoaderEditProxy_getOverrideProperties(){var _1=this.Super("getOverrideProperties",arguments);_1=isc.addProperties({},_1,{border:this.border,loadScreen:function(){if(this.$97z||this.$182e||this.$235q)return;this.$235q=true;this.showProxyLabel(this.editContext.isReify)},proxyLabelClicked:function(){if(!this.editContext.isReify)return;var _2=this.editContext.creator.creator;if(!_2.changeScreen(this.screenName)){isc.warn("Cannot open screen '"+this.screenName+"'. It is not part of current project.")}
}
});return _1}
,isc.A.canAddNode=function isc_ScreenLoaderEditProxy_canAddNode(_1,_2,_3,_4){return null}
);isc.B._maxIndex=isc.C+4;isc.ClassFactory.defineClass("FormItemVisibilityProxyCanvas","Canvas");isc.A=isc.FormItemVisibilityProxyCanvas.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.autoDraw=false;isc.A.visibility="hidden";isc.A.$jq=false;isc.A.$ns=false;isc.B.push(isc.A.init=function isc_FormItemVisibilityProxyCanvas_init(){this.Super("init",arguments);if(this.formItem)this.setFormItem(this.formItem)}
,isc.A.destroy=function isc_FormItemVisibilityProxyCanvas_destroy(){var _1=this.formItem,_2=this.formItem.containerWidget
;if(_2&&this.isObserving(_2,"setZIndex")){this.ignore(_2,"setZIndex")}
if(this.isObserving(_1,"moved")){this.ignore(_1,"moved")}
if(this.isObserving(_1,"visibilityChanged")){this.ignore(_1,"visibilityChanged")}
this.Super("destroy",arguments)}
,isc.A.setFormItem=function isc_FormItemVisibilityProxyCanvas_setFormItem(_1){var _2=_1.containerWidget;this.formItem=_1;this.syncWithFormItemPosition();this.syncZIndex(_2);if(!this.isObserving(_2,"setZIndex")){this.observe(_2,"setZIndex","observer.syncZIndex(observed)")}
if(!this.isObserving(_1,"moved")){this.observe(_1,"moved","observer.syncWithFormItemPosition()")}
if(!this.isObserving(_1,"visibilityChanged")){this.observe(_1,"visibilityChanged","observer.formItemVisibilityChanged()")}
}
,isc.A.syncWithFormItemPosition=function isc_FormItemVisibilityProxyCanvas_syncWithFormItemPosition(){if(!this.formItem||!this.formItem.containerWidget)return;this.$49p=true;var _1=this.parentElement||this.formItem.form,_2=_1.getPageRect(),_3=this.formItem.getPageRectIncludingTitle()
;if(!_3[2])_3[2]=10;if(!_3[3])_3[3]=10;if(_3[2]>this.formItem.form.getWidth())_3[2]=this.formItem.form.getWidth();this.moveTo(_3[0]-_2[0],_3[1]-_2[1]);this.resizeTo(_3[2],_3[3]);this.$49p=false}
,isc.A.resizeTo=function isc_FormItemVisibilityProxyCanvas_resizeTo(_1,_2){var _3=this.formItem;if(!this.$49p&&_3)_3.redraw();this.Super("resizeTo",arguments)}
,isc.A.syncZIndex=function isc_FormItemVisibilityProxyCanvas_syncZIndex(_1){var z=_1.getZIndex(true);this.setZIndex(z-3)}
,isc.A.formItemVisibilityChanged=function isc_FormItemVisibilityProxyCanvas_formItemVisibilityChanged(){var _1=this.formItem.form.getDrawnState();if(_1!=isc.Canvas.UNDRAWN&&this.formItem.isVisible())this.show();else this.hide()}
,isc.A.show=function isc_FormItemVisibilityProxyCanvas_show(){this.Super("show",arguments);if(this.visibilityMask)this.visibilityMask.show()}
,isc.A.hide=function isc_FormItemVisibilityProxyCanvas_hide(){if(this.visibilityMask)this.visibilityMask.hide();this.Super("hide",arguments)}
);isc.B._maxIndex=isc.C+9;isc.defineClass("VisibilityMaskManager","Class");isc.A=isc.VisibilityMaskManager.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.maskDefaults={backgroundImage:"crosshatch.png",backgroundRepeat:"repeat",opacity:50
};isc.A.hiddenImageDefaults={_constructor:"Img",autoDraw:false,width:32,height:18,imageType:"stretch",src:"hiddenComponent32.png",snapTo:"R"
};isc.A.hiddenImageLargeDefaults={_constructor:"Img",autoDraw:false,width:60,height:32,imageType:"stretch",src:"hiddenComponent60.png",snapTo:"TR"
};isc.A.reasonLabelDefaults={_constructor:"Label",autoDraw:true,top:-1000,left:-100,autoFit:true,autoFitDirection:"both",padding:2,wrap:false,isMouseTransparent:true,backgroundColor:"white",opacity:100,edgeOffset:2,$218b:true,mouseOver:function(){if(this.$701){isc.Timer.clear(this.$71a);this.moveTo(null,this.$218c);this.$701=false}else{var _1=this;this.$71b=isc.Timer.setTimeout(function(){_1.$71c()},300)}
},mouseOut:function(){if(this.$71b){isc.Timer.clear(this.$71b);delete this.$71b}
},$71c:function(){isc.Timer.clear(this.$71a);this.$701=true;this.$218c=this.getPageTop();this.animateMove(null,this.getPageTop()+this.getVisibleHeight()+this.edgeOffset,null,200);var _1=this;this.$71a=isc.Timer.setTimeout(function(){_1.moveTo(null,_1.$218c);_1.$701=false},3000)}
};isc.A.$218d=[];isc.B.push(isc.A.init=function isc_VisibilityMaskManager_init(){this.Super("init",arguments);this.entries={}}
,isc.A.addComponent=function isc_VisibilityMaskManager_addComponent(_1,_2){var _3=this.$218e(_1),_4=this.$218f(_3)
;if(!_4){for(var _5 in this.entries){var e=this.entries[_5],c=e&&e.component
;if(c&&c===_1){this.$218j(_5)}
}
_4=this.$218g(_1,null,_2);this.$218h(_3,_4);this.$218i()}
this.overComponent(_1,false)}
,isc.A.addFormItem=function isc_VisibilityMaskManager_addFormItem(_1,_2,_3){if(!_1.isDrawn()||!_2.isDrawn()){this.delayCall("addFormItem",[_1,_2,_3]);return}
var _4=this.$218e(_1,_2),_5=this.$218f(_4)
;if(!_5){_5=this.$218g(_1,_2,_3);this.$218h(_4,_5);this.$218i()}
this.overFormItem(_1,_2,false)}
,isc.A.removeComponent=function isc_VisibilityMaskManager_removeComponent(_1){var _2=this.$218j(this.$218e(_1));if(_2&&!this.$218k()){this.$218l()}
return(_2!=null)}
,isc.A.removeFormItem=function isc_VisibilityMaskManager_removeFormItem(_1,_2){var _3=this.$218j(this.$218e(_1,_2));if(_3&&!this.$218k()){this.$218l()}
return(_3!=null)}
,isc.A.$218e=function isc_VisibilityMaskManager__getEntryID(_1,_2){return(_2?_1.getID()+"_"+_2.name:_1.getID())}
,isc.A.$218g=function isc_VisibilityMaskManager__createEntry(_1,_2,_3){var _4=(_2?_1:null);var _5={component:_1,form:_4,formItem:_2,reason:_3
};return _5}
,isc.A.$218h=function isc_VisibilityMaskManager__addEntry(_1,_2){this.entries[_1]=_2}
,isc.A.$218f=function isc_VisibilityMaskManager__getEntry(_1){return this.entries[_1]}
,isc.A.$218j=function isc_VisibilityMaskManager__removeEntry(_1){var _2=this.entries[_1];if(_2){delete this.entries[_1];this.$218m(_2);if(_2.mask){if(_2.formItem){_2.formItem.form.removePeer(_2.mask)}
_2.mask.destroy();_2.mask=null}
}
return _2}
,isc.A.$218k=function isc_VisibilityMaskManager__hasEntries(){return!isc.isAn.emptyObject(this.entries)}
,isc.A.$218n=function isc_VisibilityMaskManager__setupEntryHandlers(_1){if(_1.component&&!_1.form){var _2=this,_3=_1.component,_4=_1.mask
;this.observe(_3,"setZIndex",function(){_2.moveMaskAbove(_4,_3)});this.observe(_3,"visibilityChanged",function(){_2.updateVisibility(_4,_3)})}
}
,isc.A.$218m=function isc_VisibilityMaskManager__clearEntryHandlers(_1){if(_1.component){var _2=_1.component;if(this.isObserving(_2,"setZIndex")){this.ignore(_2,"setZIndex")}
if(this.isObserving(_2,"visibilityChanged")){this.ignore(_2,"visibilityChanged")}
}
}
,isc.A.moveMaskAbove=function isc_VisibilityMaskManager_moveMaskAbove(_1,_2){if(_1.getZIndex(true)<=_2.getZIndex(true)){_1.moveAbove(_2)}
}
,isc.A.updateVisibility=function isc_VisibilityMaskManager_updateVisibility(_1,_2){if(_2.isVisible()){_1.show()}else{_1.hide();this.$218p(null)}
}
,isc.A.overComponent=function isc_VisibilityMaskManager_overComponent(_1,_2){if(!_1)return;if(isc.isA.FormItem(_1)){return this.overFormItem(_1.containerWidget,_1,_2)}
var _3=this.$218f(this.$218e(_1));if(_3){if(!_3.mask){_3.mask=this.$218o(_3);this.$218n(_3)}
if(!_2){if(_1.isVisible()){_3.mask.show();this.$218p(null)}
}else{_3.mask.hide();this.$218p(_3)}
}
}
,isc.A.overFormItem=function isc_VisibilityMaskManager_overFormItem(_1,_2,_3){if(!_1||!_2)return;var _4=this.$218f(this.$218e(_1,_2));if(_4){if(!_4.mask){_4.mask=this.$218o(_4);this.$218n(_4)}
if(!_3){if(_1.isVisible()&&_2.isVisible()&&!_4.mask.isVisible()){_4.mask.show();this.$218p(null)}
}else{_4.mask.hide();this.$218p(_4)}
}
}
,isc.A.$218o=function isc_VisibilityMaskManager__createMask(_1){var _2=_1.component;if(_1.formItem){_2=isc.FormItemVisibilityProxyCanvas.create({formItem:_1.formItem});_1.form.addPeer(_2)}
var _3=isc.addProperties({},this.maskDefaults,this.maskProperties,{keepInParentRect:_2.keepInParentRect
}),_4=isc.EH.makeEventMask(_2,_3),_5=(_2.getVisibleHeight()>32?"hiddenImageLarge":"hiddenImage"),_6=this.createAutoChild(_5)
;_4.addChild(_6);_4.hiddenImage=_6;if(_1.formItem){delete _2._eventMask;_2.visibilityMask=_4;_4=_2}
return _4}
,isc.A.$218p=function isc_VisibilityMaskManager__showReasonLabel(_1,_2,_3){if(_1){var _4=this.$218q("["+_1.reason+"]");var _5=_1.mask.getVisibleHeight(),_6=_4.getVisibleHeight()
;if(_5>(_6*2)){var _2=_1.mask.getPageLeft(),_3=_1.mask.getPageBottom()
;_4.moveTo(_2,_3-_6-_4.edgeOffset)}
}else if(this.reasonLabel){this.reasonLabel.moveTo(null,-1000)}
}
,isc.A.$218q=function isc_VisibilityMaskManager__createReasonLabel(_1){if(this.reasonLabel){this.reasonLabel.moveTo(null,-1000)
this.reasonLabel.setContents(_1);return this.reasonLabel}
this.reasonLabel=this.createAutoChild("reasonLabel",{contents:_1});return this.reasonLabel}
,isc.A.$218i=function isc_VisibilityMaskManager__setupPageMouseHandlers(){var _1=this;if(!this.$218r){this.$218r=isc.Page.setEvent("mouseOver",function(_2){_1.$218s(_2)})}
if(!this.$218t){this.$218t=isc.Page.setEvent("dropOver",function(_2){_1.$218s(_2)})}
if(!this.$218u){this.$218u=isc.Page.setEvent("mouseMove",function(_2){_1.$218v(_2)})}
if(!this.$218w){this.$218w=isc.Page.setEvent("dropMove",function(_2){_1.$218v(_2)})}
}
,isc.A.$218l=function isc_VisibilityMaskManager__clearPageMouseHandlers(){if(this.$218r){isc.Page.clearEvent("mouseOver",this.$218r);delete this.$218r}
if(this.$218t){isc.Page.clearEvent("dropOver",this.$218t);delete this.$218t}
if(this.$218u){isc.Page.clearEvent("mouseMove",this.$218u);delete this.$218u}
if(this.$218w){isc.Page.clearEvent("dropMove",this.$218w);delete this.$218w}
}
,isc.A.$218s=function isc_VisibilityMaskManager__mouseOver(_1){if(!_1)return;if(_1.$218b)return;if(_1&&_1.$jr){_1=_1.$jr}
var _2=false;if(isc.isA.FormItemVisibilityProxyCanvas(_1)){_1=_1.formItem;_2=true}else if(_1&&_1.getEventItemInfo){var _3=_1.getEventItemInfo();_2=(_3&&_3.overItem);_1=(_2?_3.item:_1)}
if(_1&&!this.$218x(_1)){while(this.$218d.length>0){var _4=this.$218d.pop();this.overComponent(_4,false)}
return}
if(this.$218d.length>0&&this.$218d[this.$218d.length-1]==_1){return}else if(this.$218d.length>1&&this.$218d[this.$218d.length-2]==_1){var _4=this.$218d.pop();this.overComponent(_4,false)}else if(this.$218d.contains(_1)){while(this.$218d.length>0&&this.$218d[this.$218d.length-1]!=_1){var _4=this.$218d.pop();this.overComponent(_4,false)}
}else{var _5=this.$218y(_2?_1.form:_1),_4=(this.$218d.length>0?this.$218d[this.$218d.length-1]:null),_6=(_4?this.$218y(isc.isA.FormItem(_4)?_4.form:_4):null)
;if(_6&&_6!=_5){this.overComponent(_4,false)}else{while(_4&&!this.$218z(_1,_4)){this.overComponent(_4,false);this.$218d.pop();_4=(this.$218d.length>0?this.$218d[this.$218d.length-1]:null)}
}
this.$218d.push(_1);this.$2180=_2}
if(_1.$218b)return;this.overComponent(_1,true)}
,isc.A.$218v=function isc_VisibilityMaskManager__mouseMove(_1){if(!this.$2180)return;if(_1&&_1.$jr){_1=_1.$jr}
var _2,_3
;if(isc.isA.FormItemVisibilityProxyCanvas(_1)){_3=_1.formItem}else if(_1&&_1.getEventItemInfo){_2=_1.getEventItemInfo();_3=(_2&&_2.overItem?_2.item:null)}
var _4=(this.$218d.length>0?this.$218d[this.$218d.length-1]:null),_5=(_4&&isc.isA.FormItem(_4)?_4:null)
;if(_3&&_3!=_5){if(_5){this.overComponent(_5,false);this.$218d.pop()}
if(_3){this.$218d.push(_3);this.overComponent(_3,true)}else{this.$2180=false}
}else if(_5&&!_3){this.overComponent(_5,false);this.$218d.pop();_4=(this.$218d.length>0?this.$218d[this.$218d.length-1]:null),this.$2180=false}
}
,isc.A.$218y=function isc_VisibilityMaskManager__getTopElement(_1){var _2;if(_1&&_1.getParentElements){var _3=_1.getParentElements();for(var i=0;i<_3.length;i++){var _5=_3[i];if(_5==this.container)break;_2=_5}
}
return _2}
,isc.A.$218x=function isc_VisibilityMaskManager__isCanvasInContainer(_1){return this.$218z(_1,this.container)}
,isc.A.$218z=function isc_VisibilityMaskManager__isAncestorOf(_1,_2){if(isc.isA.FormItem(_1)){if(_1.form==_2)return true;_1=_1.form}
if(_1&&_1.getParentElements){var _3=_1.getParentElements();if(_3.contains(_2))return true}
}
);isc.B._maxIndex=isc.C+27;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.persistCoordinates=(this.creator.itemLayout=="absolute"?true:null);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.canAddNode=function isc_FormEditProxy_canAddNode(_1,_2,_3,_4){if(_1=="FormItemIcon")return true;if(_1=="SplitPane"||_1=="TriplePane")return null;var _5=this.Super("canAddNode",arguments);var _6=(_3?_3.liveObject||_3:null);if(_5&&_3&&isc.isA.FormItem(_6)){if(!isc.isA.FormItem(_6)||!_6.form||(_6.form&&_6.form!=this.creator))
{_5=null}
}
return _5}
,isc.A.dropOver=function isc_FormEditProxy_dropOver(){var _1=this.creator;if(_1.canDropItems!=true)return false;if(!this.willAcceptDrop()){if(_1==_1.ns.EH.dragTarget){return}
return false}
this.$69c=null;_1.hideDragLine();var _2=this.getEventDragData(),_3=this.getEventDragType(_2)
;if(_3=="FormItemIcon")return isc.EH.STOP_BUBBLING;if(_3=="SplitPane"||_3=="TriplePane")return;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=this.getEventDragData(),_3=this.getEventDragType(_2)
;if(_3=="DataSource"||_3=="FormItemIcon"||_3=="SplitPane"||_3=="TriplePane"||this.isAbsoluteLayout())
{_1.hideDragLine();if(_3=="FormItemIcon"){var _4=_1.ns.EH.lastEvent,_5=_1.getNearestItem(_4.x,_4.y)
;this.$69c=_5}
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 _4=_1.ns.EH.lastEvent,_5=_1.getNearestItem(_4.x,_4.y);if(_5){isc.EditContext.hideAncestorDragDropLines(_1);_1.showDragLineForItem(_5,_4.x,_4.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.setDragTracker(null);this.$1313(false)}
,isc.A.drop=function isc_FormEditProxy_drop(){var _1=this.creator,_2=_1.ns.EH.getDragTarget(),_3=_2.getDragData();if(isc.isAn.Array(_3))_3=_3[0];if(this.wrapInvalidDropTarget()){return isc.EH.STOP_BUBBLING}
if(_2.isA("Palette")){var _4=_3,_5=_1.editNode
;if(_2.isA("TreePalette")){_4=_2.data.getCleanNodeData([_4],false,false,false)[0]}
_4=isc.clone(_4);_4.dropped=true;_5=this.adjustParentNode(_5,_4);if(_5!=_1.editNode){var _6=_1.editContext.addFromPaletteNodes([_4],_5,null,null,null,false);if(_6&&_6.length>0){var _7=_6[0];if(this.canSelectChildren&&_7.liveObject.editProxy!=null&&_7.liveObject.editProxy.canSelect!=false)
{_1.editContext.selectSingleComponent(_7.liveObject)}
}
return isc.EH.STOP_BUBBLING}
_3=_4}
if((_3&&(_3.type||_3.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 _8=this.$146l,_9=(_8?_8[0]-_1.getPageLeft():_1.getOffsetX()),_10=(_8?_8[1]-_1.getPageTop():_1.getOffsetY())
;this.itemAbsoluteDrop(_1.ns.EH.getDragTarget(),_1.getItemDropIndex(_11),_10,_9);return isc.EH.STOP_BUBBLING}
if(!this.$69c){isc.logWarn("lastDragOverItem not set, cannot drop","dragDrop");return}
var _11=this.$69c,_12=_1.getItemTableOffsets(_11),_13=_11.dropSide,_14=_11.$69d,_15=_1.getItemDropIndex(_11,_13);this.$69c=null;if(this.shouldPassDropThrough()){_1.hideDragLine();return}
if(_3&&(_3.type||_3.className)=="FormItemIcon"){_1.hideDragLine();_1.editContext.addFromPaletteNodes([_3],_11.editNode,null,null,null,false);return isc.EH.STOP_BUBBLING}
if(_15!=null&&_15>=0){if(_1.parentElement){if(_1.parentElement.hideDropLine)_1.parentElement.hideDropLine()}
var _16=_1.items.$8j.duplicate();this.modifyFormOnDrop(_11,_12.top,_12.left,_13,_16)}
_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")){var _9=_7.editContext.getEditNodeTree(),_10=_9.getParent(_8.editNode),_11=_9.getChildren(_10).indexOf(_8.editNode),_12=_8.editNode;if(_10.type=="SectionItem"){_10=_9.getParent(_10);_11=_9.getDescendants(_10).indexOf(_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.editNode,_14=_2
;var _15=_7.editNode,_16=_9.getDescendants(_15),_17=_16[_2-1],_18=_17&&(_17.type||_17.className),_19=_17&&isc.ClassFactory.getClass(_18),_20=_17&&_9.getParent(_17),_21=_20&&(_20.type||_20.className),_22=_20&&isc.ClassFactory.getClass(_21)
;if((_19&&_19.isA("SectionItem"))||(_22&&_22.isA("SectionItem")))
{_13=(_19&&_19.isA("SectionItem")?_17:_20);_14=null;if(_17){var _23=_9.getChildren(_13);_14=_23.indexOf(_17)+1}
}
var _24=this.addNode(_7.editContext,_8.editNode,_13,_14);if(_24&&_24.liveObject){isc.EditContext.delayCall("selectCanvasOrFormItem",[_24.liveObject,true],200)}
return _24}else{var _25=_1.transferDragData();if(isc.isAn.Array(_25))_25=_25[0];var _12=_7.editContext.makeEditNode(_25);if(_12.loadData&&!_12.isLoaded){var _26=this;_12.loadData(_12,function(_27){_27=_27||_12
_27.isLoaded=true;_26.completeItemDrop(_27,_2,_3,_4,_5,_6);_27.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")){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=this.addNode(_6.editContext,_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=(_3!=null||_4!=null||_5!=null);var _8=this.creator,_9=_1.liveObject,_10=_1,_11,_12;if(isc.isA.Label(_9)){var _13=(_9.title!=_9.getLocalId()?_9.title:null),_14=_1.defaults
;delete _14._constructor;delete _14.autoDraw;delete _14.ID;delete _14.autoID;delete _14.title;if(_13)_14.defaultValue=_13;_9.markForDestroy();_1=_8.editContext.makeEditNode({type:"BlurbItem",title:_13,defaults:_14
})}else if(isc.isA.Button(_9)||isc.isAn.IButton(_9)){var _13=(_9.title!=_9.getLocalId()?_9.title:null),_14=_1.defaults
;delete _14._constructor;delete _14.autoDraw;delete _14.ID;delete _14.autoID;if(_14.title&&_13)_14.title=_13;else if(_14.title&&!_13)delete _14.title;_9.markForDestroy();_1=_8.editContext.makeEditNode({type:"ButtonItem",title:_13,defaults:_14
})}
var _15=this.getContainerNode(_8.editNode,_1);if(_15){_11=true;_12=_1;_12.dropped=true;_1=_8.editContext.makeEditNode(_15)}
_1.dropped=true;_1=this.itemDropping(_1,_2,true);if(!_1)return;var _16=_8.editNode,_17=_2
;var _18=_1.type||_1.className,_19=isc.ClassFactory.getClass(_18)
;if(_19&&!_19.isA("SectionItem")){var _20=_8.editContext,_21=_20.getEditNodeTree(),_22=_8.editNode,_23=_21.getDescendants(_22),_24=_23[_2-1],_25=_24&&(_24.type||_24.className),_26=_24&&isc.ClassFactory.getClass(_25),_27=_24&&_21.getParent(_24),_28=_27&&(_27.type||_27.className),_29=_27&&isc.ClassFactory.getClass(_28)
;if((_26&&_26.isA("SectionItem"))||(_29&&_29.isA("SectionItem")))
{_16=(_26&&_26.isA("SectionItem")?_24:_27);_17=null;if(_24){var _30=_21.getChildren(_16);_17=(_24==_16?_30.length:_30.indexOf(_24)+1)}
}
}else if(_17!=null&&_7){_17=this.getChildIndexForFieldIndex(_16,_1,_17)}
var _31=this.addNode(_8.editContext,_1,_16,_17);if(_31){isc.EditContext.clearSchemaProperties(_31);if(_12){_31=this.addNode(_8.editContext,_12,_31,0)}
_8.editContext.getLiveObject(_31);if(_31.liveObject.dataSource){_31.liveObject.editProxy.setDataSource(_31.liveObject.dataSource,null,true)}
if(_8.editingOn){var _32=_31.liveObject;if(_32.setEditMode)_32.setEditMode(true,_32.editContext,_32.editNode)}
var _33=this,_34=_6;isc.Timer.setTimeout(function(){isc.EditContext.selectCanvasOrFormItem(_31.liveObject,true);_33.fireCallback(_34,"node",[_31])},100);_6=null;if(_11||(_31.liveObject.editProxy&&_31.liveObject.editProxy.inlineEditOnDrop)){if(_31.liveObject.inlineEditOnDrop||_31.liveObject.editProxy.inlineEditOnDrop){_31.liveObject.editProxy.delayCall("startInlineEditing",null,200)}
}else if(_31.showTitle!=false&&_31.liveObject.editProxy){_31.liveObject.editProxy.delayCall("editTitle",null,200)}
}
if((_12&&_10.type!=_12.type)||(!_12&&_10.type!=_1.type))
{_8.editContext.fireSubstitutedNode(_10,_12||_1,_8.editNode)}
if(_6)this.fireCallback(_6,"node",[_31])}
,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=this.addNode(_6.editContext,_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)}
var _11=this,_12=_5;isc.Timer.setTimeout(function(){isc.EditContext.selectCanvasOrFormItem(_9.liveObject,true);_11.fireCallback(_12,"node",[_9])},200);_5=null}
if(_5)this.fireCallback(_5,"node",[_9])}
,isc.A.wrapPreviousDropTarget=function isc_FormEditProxy_wrapPreviousDropTarget(_1){var _2=this.creator,_3=_2.editContext,_4=_3.makeEditNode({type:"CanvasItem",defaults:{cellStyle:"nestedFormContainer"
}
})
;_4.dropped=true;_4=_3.addNode(_4,_2.editNode);_3.addNode(_1,_4,null,null,null,null,true)}
,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=isc.addProperties({name:"$179v"},_7);_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=this.addNode(_6.editContext,_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
});this.addNode(_6.editContext,_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
});this.addNode(_6.editContext,_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
});this.addNode(_6.editContext,_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.getChildIndexForFieldIndex=function isc_FormEditProxy_getChildIndexForFieldIndex(_1,_2,_3){if(_3!=null&&_2.type=="SectionItem"){var _4=this.creator,_5=_4.editContext,_1=_4.editNode,_6=_5.getEditNodeTree(),_7=_6.getDescendants(_1),_8=_7[_3],_9=_6.getChildren(_1)
;if(_8){_3=_9.indexOf(_8)}
}
return _3}
,isc.A.adjustLiveIndex=function isc_FormEditProxy_adjustLiveIndex(_1,_2,_3){if(_3!=null&&_3>0&&_2.type=="SectionItem"){var _4=this.creator,_5=_4.editContext,_1=_4.editNode,_6=_5.getEditNodeTree(),_7=_6.getChildren(_1),_8=_7[_3],_9=_6.getDescendants(_1)
;_3=(_8?_9.indexOf(_8):_9.length)}
return _3}
,isc.A.addNode=function isc_FormEditProxy_addNode(_1,_2,_3,_4,_5){var _6=_1.getEditNodeTree(),_7=_6.getChildren(_3),_8=_4
;if(_8!=null){for(var i=0;i<Math.min(_4,_7.length);i++){if(isc.isA.DataSource(_7[i].liveObject)){_8++;break}
}
}
return _1.addNode(_2,_3,_8,_5)}
,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.itemDropping=function isc_FormEditProxy_itemDropping(_1,_2,_3){var _4=this.creator,_5=isc.EditContext.getSchemaInfo(_1);if(!_5.dataSource)return _1;if(!_4.dataSource){_4.editProxy.setDataSource(_5.dataSource);_4.serviceNamespace=_5.serviceNamespace;_4.serviceName=_5.serviceName;return _1}
if(_5.dataSource==isc.DataSource.getDataSource(_4.dataSource).ID&&_5.serviceNamespace==_4.serviceNamespace&&_5.serviceName==_4.serviceName){return _1}
var _6=_4.editContext.makeEditNode({type:"CanvasItem",defaults:{cellStyle:"nestedFormContainer"
}
});isc.addProperties(_6.defaults,{showTitle:false,colSpan:2});_6.dropped=true;_4.editContext.addNode(_6,_4.editNode,_2);var _7=_4.editContext.makeEditNode({type:"DynamicForm",defaults:{numCols:2,canDropItems:false,dataSource:_5.dataSource,serviceNamespace:_5.serviceNamespace,serviceName:_5.serviceName,doNotUseDefaultBinding:true
}
});_7.dropped=true;_4.editContext.addNode(_7,_6,0);var _8=_4.editContext.addNode(_1,_7,0);isc.EditContext.clearSchemaProperties(_8)}
,isc.A.makeFieldPaletteNode=function isc_FormEditProxy_makeFieldPaletteNode(_1,_2,_3,_4){var _5=this.creator.getEditorType(_2),_4=isc.addProperties({},_4,{name:_2.name})
;_5=_5.substring(0,1).toUpperCase()+_5.substring(1)+"Item";if(_5.endsWith("ItemItem"))_5=_5.substring(0,_5.length-4);var _6;if(_1){_6=_1.findPaletteNode("type",_5)||_1.findPaletteNode("className",_5)||{type:_5};_6=isc.addProperties({},_6,{defaults:_4})}else{_6={type:_5,autoGen:true,defaults:_4
}}
var _7=_3.getAutoTitle(_2.name);if(_2.title!=null&&_2.title!=_7){_6.defaults.title=_2.title}
return _6}
,isc.A.layoutNewFields=function isc_FormEditProxy_layoutNewFields(_1,_2){var _3=this.creator;if(_3.itemLayout!="absolute")return;var _4=0,_5=0,_6=_3.snapVGap||8,_7=_3.snapHGap||8,_8=_3.height,_9=_3.width
;for(var i=0;i<_2.length;i++){var _11=_2[i];var _12=_3.getEditorType(_11,_3.values),_13=isc.FormItemFactory.getItemClassName(_11,_12,_3),_14=isc.FormItemFactory.getItemClass(_13),_15=_14.getInstanceProperty("height"),_16=_14.getInstanceProperty("width")
;if((_4+_15)>_8){_4=0;_5=_16+50}
_11.top=_4;_11.left=_5;_4+=_6;_5+=_7}
}
,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.$ne=function isc_FormEditProxy__getEventTargetItemInfo(){var _1=this.creator,_2=isc.EH.lastEvent,_3=_2.target
;if(_3==_1)return _1.$ne();while(_3.parentElement&&!_3.canvasItem)_3=_3.parentElement;return!_3.canvasItem?null:isc.DynamicForm._getItemInfoFromElement(_3.canvasItem.$199y(),_1)}
,isc.A.getClickedFormItem=function isc_FormEditProxy_getClickedFormItem(_1){var _2=this.$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+27;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.valueField="defaultValue";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;var _3={};_3[this.editProxy.valueField]=_1;_2.setNodeProperties(this.editNode,_3);this.Super("handleChanged",arguments)}
,isc.A.completeDrop=function isc_FormItemEditProxy_completeDrop(_1,_2,_3){var _4=this.creator,_5=_4.editContext
;if(_1.loadData&&!_1.isLoaded){var _6=this;_1.loadData(_1,function(_8){_8=_8||_1;_8.isLoaded=true;_6.completeDrop(_8,_2,function(_9){_9.dropped=_1.dropped;if(_3)_3(_9)})});return}
this.Super("completeDrop",[_1,_2,function(_8){if(_8.liveObject&&isc.isA.DataSource(_8.liveObject)){var _7=_4.editNode;if(!isc.isA.ComboBoxItem(_4)&&!isc.isA.CanvasItem(_4)&&(!_7.defaults||!_7.defaults.editorType))
{_5.setNodeProperties(_7,{editorType:"ComboBoxItem"})}
}
if(_3)_3(_8)}])}
,isc.A.setOptionDataSource=function isc_FormItemEditProxy_setOptionDataSource(_1){this.creator.setOptionDataSource(_1);var _2=this.creator,_3=_2.editNode,_4=(_3.defaults?_3.defaults.name:null)
;if(_4&&_4.startsWith(_3.type)){var _5=isc.DS.get(_1);if(_5){var _6=_5.getPrimaryKeyFieldName();if(_6){var _7=_2.editContext,_8=_7.getEditNodeTree(),_9=_8.getChildren(_8.getParent(_3)),_10=_6,_11=false,_12=1
;do{_11=false;for(var i=0;i<_9.length;i++){if(_9[i].name==_10){_11=true;break}
}
if(_11){_10=_6+_12++}
}while(_11);isc.Timer.setTimeout(function(){_2.editContext.setNodeProperties(_3,{name:_10,valueField:_6,displayField:_5.getTitleField()
})},0)}
}
}
}
,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){var _3=_1.editContext.isComponentSelected(_2);if(_1.editProxy.selectItemsMode!="never"){isc.EditContext.selectCanvasOrFormItem(_2,true)}
if(_3&&_2.showPickerIcon&&!(_2.isDisabled())&&!(_2.isReadOnly()))
{var _4=_1.editProxy,_5=_4.$ne(),_6=_5.overIcon
;if(_2.isA("SelectItem")||(_6&&_6=="picker")){_2.showPicker()}
}
return isc.EH.STOP_BUBBLING}
,isc.A.doubleClick=function isc_FormItemEditProxy_doubleClick(_1,_2){if(this.wasFormItemClickOnTitle(_1)){var _3=this.creator;isc.EditContext.selectCanvasOrFormItem(_3,true);this.editTitle(null,function(){var _4=_3.editContext;if(_4)_4.fireSelectedEditNodesUpdated()});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,_2){var _3=this.creator,_4,_5,_6,_7;if(isc.isA.SectionItem(_3)){return}
if(isc.isA.ButtonItem(_3)){_4=_3.canvas.getPageLeft();_5=_3.canvas.getVisibleWidth();_6=_3.canvas.getPageTop();_7=_3.canvas.getHeight()}else{if(isc.isA.StaticTextItem(_3)&&_1=="defaultValue"){_4=_3.getPageLeft();_5=_3.getVisibleWidth()}else{_4=_3.getTitlePageLeft();_5=_3.getVisibleTitleWidth()}
var _8,_9;_8=_3.getTitlePageTop();_9=_3.getTitleVisibleHeight();_7=_3.getVisibleHeight();if(_9==0){_9=_7;_8=_6}
_7=Math.max(_7,_9);_6=(_9==_7?_8:_8+((_9-_7)/2))}
isc.EditContext.manageTitleEditor(_3,_4,_5,_6,_7,null,_1,_2)}
,isc.A.getInlineEditText=function isc_FormItemEditProxy_getInlineEditText(){}
,isc.A.setInlineEditText=function isc_FormItemEditProxy_setInlineEditText(_1){}
);isc.B._maxIndex=isc.C+11;isc.defineClass("FileItemEditProxy","FormItemEditProxy");isc.A=isc.FileItemEditProxy.getPrototype();isc.A.useEditMask=true;isc.A.editMaskProperties={select:function(){var _1=this.masterElement.targetItem,_2=_1.form
;if(_2.editProxy.selectItemsMode!="never"){isc.EditContext.selectCanvasOrFormItem(_1,true)}
},canDrag:false,canDragReposition:false,contents:"&nbsp;",showFocusOutline:false,showContextMenu:function(){}
};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("BlurbItemEditProxy","TextItemEditProxy");isc.A=isc.BlurbItemEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.inlineEditOnDrop=true;isc.B.push(isc.A.editTitle=function isc_BlurbItemEditProxy_editTitle(_1,_2){}
);isc.B._maxIndex=isc.C+1;isc.defineClass("TextAreaItemEditProxy","TextItemEditProxy");isc.A=isc.TextAreaItemEditProxy.getPrototype();isc.A.inlineEditMultiline=true;isc.defineClass("ButtonItemEditProxy","FormItemEditProxy");isc.A=isc.ButtonItemEditProxy.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_ButtonItemEditProxy_getInlineEditText(){return this.creator.title||this.creator.name}
,isc.A.setInlineEditText=function isc_ButtonItemEditProxy_setInlineEditText(_1){this.creator.editContext.delayCall("setNodeProperties",[this.creator.editNode,{title:_1}])}
);isc.B._maxIndex=isc.C+2;isc.defineClass("ToolbarItemEditProxy","FormItemEditProxy");isc.A=isc.ToolbarItemEditProxy.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.substituteNode=function isc_ToolbarItemEditProxy_substituteNode(_1,_2){var _3=_2.type||_2.className,_4=isc.ClassFactory.getClass(_3)
;if(_4&&_4.isA("ButtonItem")){return _2}
return this.Super("substituteNode",arguments)}
,isc.A.getContainerNode=function isc_ToolbarItemEditProxy_getContainerNode(_1,_2){var _3=_2.type||_2.className,_4=isc.ClassFactory.getClass(_3)
;if(_4&&_4.isA("ButtonItem")){return null}
return this.Super("getContainerNode",arguments)}
);isc.B._maxIndex=isc.C+2;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 trailing \"*\" 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.isReify&&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("SavedSearchItemEditProxy","SelectItemEditProxy");isc.A=isc.SavedSearchItemEditProxy.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.getOverrideProperties=function isc_SavedSearchItemEditProxy_getOverrideProperties(){var _1=this.Super("getOverrideProperties",arguments);_1=isc.addProperties({},_1,{getNewRecordValues:this.getNewRecordValues
});return _1}
,isc.A.getNewRecordValues=function isc_SavedSearchItemEditProxy_getNewRecordValues(){var _1=this.Super("getNewRecordValues",arguments);_1=isc.addProperties({},_1);if(isc.ss.savedSearchDataSourceHasField(this,isc.ss.adminField)){_1[isc.ss.adminField]=true}else{_1[isc.ss.userIdField]=null}
return _1}
,isc.A.click=function isc_SavedSearchItemEditProxy_click(_1,_2){var _3=_1.editProxy,_4=_3.$ne(),_5=_4.overIcon
;if(_5&&_5!="picker"){return _2.$116(_5)}else{return this.Super("click",arguments)}
}
,isc.A.setEditMode=function isc_SavedSearchItemEditProxy_setEditMode(_1){this.Super("setEditMode",arguments);var _2=this.creator,_3=_2.pickList;if(_3){_2.buildPickListFields();_2.setUpPickList()}
}
);isc.B._maxIndex=isc.C+4;isc.defineClass("RadioGroupItemEditProxy","SelectItemEditProxy");isc.A=isc.RadioGroupItemEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.inlineEditOnDrop=true;isc.A.valueField="value";isc.B.push(isc.A.setEditMode=function isc_RadioGroupItemEditProxy_setEditMode(_1){if(!isc.$75u)this.$206h=true;this.Super("setEditMode",arguments)}
,isc.A.startInlineEditing=function isc_RadioGroupItemEditProxy_startInlineEditing(_1,_2){if(this.$206h)return;return this.Super("startInlineEditing",arguments)}
,isc.A.doubleClick=function isc_RadioGroupItemEditProxy_doubleClick(){var _1=this.creator;if(_1.$203s)_1.$206m();this.Super("doubleClick",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.editTitle=function isc_CheckboxItemEditProxy_editTitle(_1,_2){}
,isc.A.getInlineEditText=function isc_CheckboxItemEditProxy_getInlineEditText(){var _1=this.creator,_2=_1.editContext
;if(_2.isReify){return this.creator.getTitle()}
return(_1.value?"[x]":"[ ]")}
,isc.A.setInlineEditText=function isc_CheckboxItemEditProxy_setInlineEditText(_1){var _2=this.creator,_3=_2.editContext
;if(_3.isReify){_2.editContext.setNodeProperties(_2.editNode,{title:_1});return}
_1=_1.replace(/\s+/g,"").toLowerCase();var _4=("[x]"==_1||"true"==_1||"t"==_1||"yes"==_1||"y"==_1||"checked"==_1);this.creator.editContext.setNodeProperties(this.creator.editNode,{value:_4})}
);isc.B._maxIndex=isc.C+3;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.setEditMode=function isc_DateItemEditProxy_setEditMode(_1){this.Super("setEditMode",arguments);this.creator.autoUseTextField=false}
,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=isc.DateUtil.parseInput(_1);if(_2){_1=_2}
this.creator.editContext.setNodeProperties(this.creator.editNode,{defaultValue:_1})}
);isc.B._maxIndex=isc.C+3;isc.defineClass("SectionItemEditProxy","TextItemEditProxy");isc.A=isc.SectionItemEditProxy.getPrototype();isc.A.removeChildrenOnRecreate=true;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();this.configureSavedSearchMenu(_1);this.refreshSavedSearchMenu(_1);if(isc.isA.TreeGrid){if(_1){this.createDefaultTreeFieldEditNode()}
}
}
,isc.A.canAddNode=function isc_GridEditProxy_canAddNode(_1,_2,_3,_4){var _5=this.Super("canAddNode",arguments);if(isc.isA.TreeGrid(this.creator)&&_5&&_1=="ListGridField")_5=null;return _5}
,isc.A.getOverrideProperties=function isc_GridEditProxy_getOverrideProperties(){var _1=this.Super("getOverrideProperties",arguments);return isc.addProperties({},_1,{clearNoDropIndicator:this.clearNoDropIndicator,setNoDropIndicator:this.setNoDropIndicator,userAddedField:this.userAddedField,userRemovedField:this.userRemovedField,setShowFilterEditor:this.setShowFilterEditor,initSaveSearches:this.initSaveSearches
})}
,isc.A.initSaveSearches=function isc_GridEditProxy_initSaveSearches(_1){var _2=this.savedSearchMenu;this.Super("initSaveSearches",arguments);if(this.savedSearchMenu&&_2!=this.savedSearchMenu&&this.editProxy){this.editProxy.configureSavedSearchMenu(this.editingOn)}
}
,isc.A.configureSavedSearchMenu=function isc_GridEditProxy_configureSavedSearchMenu(_1){var _2=this.creator,_3=_2.savedSearchMenu
;if(_3){var _4={getNewRecordValues:this.getNewRecordValues
};if(_1){_3.saveToOriginalValues(isc.getKeys(_4));_3.setProperties(_4)}else{_3.restoreFromOriginalValues(isc.getKeys(_4))}
}
}
,isc.A.refreshSavedSearchMenu=function isc_GridEditProxy_refreshSavedSearchMenu(_1){var _2=this.creator,_3=_2.savedSearchMenu;if(_3){if(_3.$246g){_2.savedSearchesChanged()}
_3.rebuildFields()}
}
,isc.A.getNewRecordValues=function isc_GridEditProxy_getNewRecordValues(){var _1=this.Super("getNewRecordValues",arguments);_1=isc.addProperties({},_1);if(isc.ss.savedSearchDataSourceHasField(this,isc.ss.adminField)){_1[isc.ss.adminField]=true}else{_1[isc.ss.userIdField]=null}
_1[isc.SavedSearches.get().projectIdField]=this.creator.getProjectId();_1[isc.SavedSearches.get().screenIdField]=this.creator.getScreenId();return _1}
,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(_1){var _2=this.creator,_3=_2.editContext,_4=_2.editNode,_5=_3.getNodeProperty(_4,"sortField"),_6=(_5&&_3.getNodeProperty(_4,"sortDirection"))||"ascending"
;if(_5&&_1&&_1.length==1&&_1[0].property==_5&&_1[0].direction==_6)
{return}
this.addDefaultFieldEditNodes();if(!_1){_3.removeNodeProperties(_4,["initialSort"],true)}else{_3.removeNodeProperties(_4,["sortField"],true);_1.clearProperty("primarySort");_3.setNodeProperties(_4,{initialSort:_1},true)}
}
,isc.A.fieldStateChanged=function isc_GridEditProxy_fieldStateChanged(){if(this.$222d)return;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(_4&&_5&&_5.liveObject){var _6=_4.name,_7=_5.liveObject.name
;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.name,_11=_1.getStateForField(_10,false)
;if(this.saveFieldVisibility){var _12=(_11.visible==false),_13=(!_12&&_4.detail)
;if(_12||_13)_1.editContext.setNodeProperties(_5,{hidden:_12},true);else if(!_12)_1.editContext.removeNodeProperties(_5,["hidden"],true)}
if(this.saveFieldFrozenState){var _14=_11.frozen;if(!_14)_1.editContext.removeNodeProperties(_5,["frozen"],true);else _1.editContext.setNodeProperties(_5,{frozen:_14},true)}
var _15=_11.width;if(_15!=null&&isc.propertyDefined(_4,"$35z"))_15=_4.$35z;var _16=_1.editContext.getNodeProperty(_5,"width");if(_15!=_16){if(_15==null)_1.editContext.removeNodeProperties(_5,["width"],true);else _1.editContext.setNodeProperties(_5,{width:_15},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"]
;_3=_3.filter(function(_7){return!_1.isRowNumberField(_7)&&!_1.isCheckboxField(_7)&&!_1.isExpansionField(_7)&&!_7.isRemoveField});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(_6&&(_7.groupingMode||_7.groupGranularity||_7.groupPrecision)){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,_3=_2.editContext,_4=_2.editNode
;if(_1){_3.delayCall("setNodeProperties",[_4,{initialCriteria:_1},true])}else{_3.delayCall("removeNodeProperties",[_4,"initialCriteria"])}
}
,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){_3.liveObject.$73a=_2.header.getButton(_1);_3.liveObject.$73a.editNode=_3;isc.EditContext.selectCanvasOrFormItem(_3.liveObject)}
_2.$73b=true}
,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.editProxy.generateEditableFormulas)_1.canEditFormula=false;if(_1.userSummary&&!this.editProxy.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.userRemovedField=function isc_GridEditProxy_userRemovedField(_1){var _2=this.editProxy.getFieldNodeByName(_1.name);if(_2){this.editContext.removeNode(_2,true)}
}
,isc.A.setShowFilterEditor=function isc_GridEditProxy_setShowFilterEditor(_1){var _2=this.getFilterEditorCriteria();this.Super("setShowFilterEditor",arguments);var _3=this.editContext,_4=this.editNode;if(_1){_3.setNodeProperties(_4,{showFilterEditor:_1},true)}else if(_3.getNodeProperty(_4,"showFilterEditor")!=null){_3.removeNodeProperties(_4,"showFilterEditor")}
if(!_1&&_2&&_2!=isc.emptyObject){this.editProxy.filterEditorSubmit()}
}
,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(!isc.$75u){if(!this.getFieldNode(0)){var _2=_1.getAllFields(),_3=(_1.getDataSource()!=null?1:0),_4=_1.editContext
;for(var i=0;i<_2.length;i++){var _6=_2[i];if(!_6.excludeFromState&&this.getFieldNodeByName(_6.name)==null){var _7=_1.editProxy.makeFieldPaletteNode(_4,_6,_1.getDataSource()),_8=_4.makeEditNode(_7)
;_4.addNode(_8,_1.editNode,i+_3,null,true)}
}
}
}
}
,isc.A.createDefaultTreeFieldEditNode=function isc_GridEditProxy_createDefaultTreeFieldEditNode(_1){if(isc.$75u)return;var _2=this.creator;if(_2.dataSource&&!_1)return;var _3=_2.fields;if(!_3)return;for(var i=0;i<_3.length;i++){if(_3[i].name=="nodeTitle"){var _5={type:"TreeGridField",autoGen:true,defaults:{name:_3[i].name,title:_3[i].title
}
};var _6=_2.editContext.makeEditNode(_5);_2.editContext.addNode(_6,_2.editNode,null,null,true);return}
}
}
,isc.A.addField=function isc_GridEditProxy_addField(_1,_2){delete _1._constructor;if(isc.$75u&&!this.clearedFieldsForAdd){this.creator.setFields([_1]);this.clearedFieldsForAdd=true}else{this.creator.Super("addField",[_1,_2,this.creator.completeFields],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.removeField=function isc_GridEditProxy_removeField(_1){this.$222d=true;this.creator.$168y=true;this.creator.completeFields.remove(_1);this.creator.Super("removeField",[_1,this.creator.completeFields],arguments);delete this.creator.$168y;delete this.$222d}
,isc.A.setDataSource=function isc_GridEditProxy_setDataSource(_1,_2,_3){var _4=this.creator;if(!isc.isA.TreeGrid(_4)){_4.$168f=true;this.Super("setDataSource",arguments);delete _4.$168f;return}
if(isc.$75u){_4.$168f=true;this.creator.setDataSource(_1,_2);delete _4.$168f;return}
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,_11,_12
;if(!isc.isAn.Array(_2))_2=isc.getValues(_2);for(var _13=0;_13<_2.length;_13++){if(!_4.shouldUseField(_2[_13],_1))continue;if(_10==null||_10==_2[_13].name){_11=_2[_13];break}
if(!_12){_12=_2[_13]}
}
_11=isc.addProperties({},_11||_12);if(_11)_8.addAt(_11,0);_4.setDataSource(_1,_8);if(_11){var _14=_4.editContext.getEditNodeTree(),_15=_14.findById(_4.ID),_16=_14.getChildren(_15),_17=_16.find("name",_11.name)
;if(_17){_4.editContext.removeNode(_17,true)}
var _18=_4.editProxy.makeFieldPaletteNode(_4.editContext,_11,_9);_18.defaults.treeField=true;var _19=_4.editContext.makeEditNode(_18);_4.editContext.addNode(_19,_4.editNode,0,null)}else{this.createDefaultTreeFieldEditNode(true)}
if(_7)_4.editContext.removeNode(_7,true)}
,isc.A.loadComplete=function isc_GridEditProxy_loadComplete(){var _1=this.creator,_2=_1.editContext,_3=_1.editNode,_4=_2.getNodeProperty(_3,"sortField")
;if(_4!=null){_1.sortField=_4}
}
,isc.A.startInlineEditing=function isc_GridEditProxy_startInlineEditing(){var _1=this.creator,_2=_1.editContext
;if(_2.isReify)return;return this.Super("startInlineEditing",arguments)}
,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(/^\[(.*)\]$/m,"{$1}")}
}
return null}
,isc.A.setInlineEditText=function isc_GridEditProxy_setInlineEditText(_1){var _2=this.creator;if(!_1)_1="";var _3=isc.isA.TreeGrid(this.creator);_1=(_3?_1.trim():_1.trim().replace(/\\/g,"\\").replace("{","[").replace("}","]"));var _4={mockData:_1,mockDataType:(_3?"tree":"grid")
};if(_2.dataSource){var _5=isc.DS.get(_2.dataSource);if(_5.fieldNamingConvention){_4.fieldNamingConvention=_5.fieldNamingConvention}
}
var _6=isc.MockDataSource.create(_4);var _7=_6.applyGridSettings();delete _7.dataSource;var _8={type:"MockDataSource",defaults:isc.addProperties({},_4,{fields:_6.fields,cacheData:_6.cacheData})
};var _9=this.creator.editContext,_10=this.creator.getSort()
;if(!_7.sortField&&_10&&_10.length>0){_9.removeNodeProperties(this.creator.editNode,["sortField","sortDirection"]);this.creator.clearSort()}else if(_7.sortField){this.creator.setSort({property:_7.sortField,direction:_7.sortDirection||"ascending"
})}
_9.setNodeProperties(this.creator.editNode,_7);var _9=this.creator.editContext;var _11=_9.getEditNodeTree(),_12=_11.getChildren(this.creator.editNode)
;if(_12&&_12.length>0){for(var i=0;i<_12.length;i++){if(isc.isA.DataSource(_12[i].liveObject)){_9.removeNode(_12[i]);break}
}
_12=_11.getChildren(this.creator.editNode);for(var i=_12.length-1;i>=0;i--){if(_12[i])_9.removeNode(_12[i])}
}
var _14=_9.makeEditNode(_8);_9.addNode(_14,this.creator.editNode);if(this.creator.autoFetchData)this.creator.fetchData()}
,isc.A.createInlineEditForm=function isc_GridEditProxy_createInlineEditForm(){var _1=(this.creator.dataSource?isc.DS.get(this.creator.dataSource):null),_2=(this.creator.dataSource&&isc.isA.MockDataSource(this.creator.dataSource)),_3=true,_4=this.creator.editContext.getEditNodeTree(),_5=_4.getChildren(this.creator.editNode)
;if(_2){for(var i=0;i<_5.length;i++){var _7=_5[i];if(_7.ID==_1.ID){_3=!_7.referenceInProject;break}
}
}
if(this.creator.editContext.isReify&&this.creator.dataSource&&(!_2||!_3))
{var _8=this.creator.editContext.creator.creator;var _9=[{name:"editDataSourceButton",type:"button",title:"View / Edit DataSource",endRow:false,click:function(_10,_11){if(_8.showDSEditor)_8.showDSEditor(_1);_10.dismissEditor()}
}];var _10=this.createAutoChild("inlineEditForm",{margin:0,padding:10,cellPadding:5,fields:_9,numCols:2,click:function(){this.dismissEditor()},dismissEditor:function(){this.hide()}
});return _10}else{return this.Super("createInlineEditForm",arguments)}
}
);isc.B._maxIndex=isc.C+35;isc.defineClass("TileGridEditProxy","EditProxy");isc.A=isc.TileGridEditProxy.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.canAddNode=function isc_TileGridEditProxy_canAddNode(_1,_2,_3,_4){var _5=false;var _6=this.creator;if(_2&&_2.isA("Palette")){var _7=isc.ClassFactory.getClass(_1);if(_7&&_7.isA("DataSource"))_5=true}
return _5}
);isc.B._maxIndex=isc.C+1;isc.defineClass("PortletEditProxy","WindowEditProxy");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.setEditMode=function isc_PortletEditProxy_setEditMode(_1){if(!this.creator.editContext.isReify)return;this.Super("setEditMode",arguments)}
,isc.A.canAddNode=function isc_PortletEditProxy_canAddNode(_1,_2,_3,_4){if(_1=="Portlet")return null;return this.Super("canAddNode",arguments)}
,isc.A.dropOver=function isc_PortletEditProxy_dropOver(){if(!this.creator.editContext.isReify)return;this.Super("dropOut",arguments)}
,isc.A.dropMove=function isc_PortletEditProxy_dropMove(){if(!this.creator.editContext.isReify)return;this.Super("dropMove",arguments)}
,isc.A.dropOut=function isc_PortletEditProxy_dropOut(){if(!this.creator.editContext.isReify)return;this.Super("dropOut",arguments)}
,isc.A.drop=function isc_PortletEditProxy_drop(){if(!this.creator.editContext.isReify)return;this.Super("drop",arguments)}
);isc.B._maxIndex=isc.C+6;isc.defineClass("PortalRowEditProxy","LayoutEditProxy");isc.A=isc.PortalRowEditProxy.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.dropMove=function isc_PortalRowEditProxy_dropMove(){return this.creator.dropMove()}
,isc.A.dropOver=function isc_PortalRowEditProxy_dropOver(){return this.creator.dropOver()}
,isc.A.dropOut=function isc_PortalRowEditProxy_dropOut(){return this.creator.dropOut()}
,isc.A.drop=function isc_PortalRowEditProxy_drop(){return this.creator.drop()}
);isc.B._maxIndex=isc.C+4;isc.defineClass("PortalLayoutEditProxy","LayoutEditProxy");isc.A=isc.PortalLayoutEditProxy.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.canAddNode=function isc_PortalLayoutEditProxy_canAddNode(_1,_2,_3,_4){var _5=this.Super("canAddNode",arguments);return _5||false}
);isc.B._maxIndex=isc.C+1;isc.defineClass("PortalColumnEditProxy","LayoutEditProxy");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.canAddNode=function isc_PortalColumnEditProxy_canAddNode(_1,_2,_3,_4){return null}
,isc.A.drop=function isc_PortalColumnEditProxy_drop(){return null}
,isc.A.dropMove=function isc_PortalColumnEditProxy_dropMove(){return null}
,isc.A.dropOver=function isc_PortalColumnEditProxy_dropOver(){return null}
,isc.A.dropOut=function isc_PortalColumnEditProxy_dropOut(){return null}
);isc.B._maxIndex=isc.C+5;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.callMethod("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,null,null,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","EditProxy");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.canAddNode=function isc_FacetChartEditProxy_canAddNode(_1,_2,_3,_4){var _5=this.Super("canAddNode",arguments);if(_5!=false){_5=false;if(_2&&_2.isA("Palette")){var _6=isc.ClassFactory.getClass(_1);if(_6&&_6.isA("DataSource"))_5=true}
}
return _5}
,isc.A.setDataSource=function isc_FacetChartEditProxy_setDataSource(_1,_2,_3){var _4=this.creator;if(_4.setDataSource)_4.setDataSource(_1,_2)}
,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]}
}
var _20={title:_5||_4,showLegend:_9,showDataLabels:_10,facets:_7,data:_8
};this.creator.editContext.delayCall("setNodeProperties",[this.creator.editNode,_20])}
);isc.B._maxIndex=isc.C+4;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",titleCellStyle:"propSheetTitleCell",titleStyle:"propSheetTitle",showHint:false,keyPress:function(_1,_2,_3,_4){if(!_1.getHasInternalNavigation()){if(_3=="Arrow_Up"){_1.focusAfterItem(false)}else if(_3=="Arrow_Down"){_1.focusAfterItem(true)}
}
}
};isc.A.GroupItemDefaults={cellStyle:null
};isc.A.ExpressionItemDefaults={width:"*",height:22,showActionIcon:true
};isc.A.ActionMenuItemDefaults={width:"*",height:22
};isc.A.SelectItemDefaults={height:22,border:"none",shadow:"none",width:"*"
};isc.A.EnumDynamicPropertyItemDefaults={height:22,width:"*"
};isc.A.OverflowItemDefaults={height:22,width:"*"
};isc.A.CriteriaItemDefaults={height:22,border:"none",shadow:"none",width:"*"
};isc.A.ValueMapItemDefaults={height:22,width:"*"
};isc.A.ExpressionEditorItemDefaults={height:22,width:"*"
};isc.A.FormulaEditorItemDefaults={height:22,width:"*"
};isc.A.SummaryEditorItemDefaults={height:22,width:"*"
};isc.A.MenuChooserItemDefaults={height:22,width:"*"
};isc.A.MeasureItemDefaults={height:22,width:"*"
};isc.A.ImageChooserItemDefaults={height:22,pickerIconHeight:16,pickerIconWidth:16,width:"*"
};isc.A.LayoutAlignItemDefaults={height:22,width:"*"
};isc.A.DateItemDefaults={width:"*"
};isc.A.TextItemDefaults={width:"*",height:22
};isc.A.DynamicPropertyEditorItemDefaults={width:"*",height:22
};isc.A.CheckboxDynamicPropertyItemDefaults={width:"*",height:22
};isc.A.StaticTextItemDefaults={width:"*",height:22,textBoxStyle:"propSheetField"
};isc.A.MeasureItemDefaults={width:"*",height:22
};isc.A.ColorItemDefaults={width:"*",height:22,pickerIconHeight:16,pickerIconWidth:16,pickerIconSrc:"[SKIN]/DynamicForm/PropSheet_ColorPicker_icon.png"
};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.name}
};isc.A.SectionItemDefaults={cellStyle:"propSheetSectionHeaderCell"
};isc.A.titleAlign="left";isc.A.titleWidth=120;isc.A.colWidths=[120,"*"];isc.A.cellPadding=0;isc.A.requiredTitleSuffix="</b>";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:"this.creator.updateButtonStates()",selectionChanged:"this.creator.updateButtonStates()",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.updateButtonStates=function isc_ListEditor_updateButtonStates(){if(this.grid.anySelected()){if(this.moreButton)this.moreButton.enable()}else{if(this.moreButton)this.moreButton.disable()}
}
,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);this.form.validate()}
,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+18}
isc.ClassFactory.defineClass("ViewLoader",isc.Label);isc.A=isc.ViewLoader.getPrototype();isc.A.loadingMessage="Loading View...&nbsp;${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){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.canvasItem&&_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("&nbsp;");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="&nbsp;"}
,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?"&nbsp;":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<this.$49w.length;i++){if(this.$49w[i]!=null){_5=false;break}
}
if(_5)this.$49v=0;isc.Class.globalEvalWithCapture(_3,_4.callback,null,_4.displayErrors)}
,isc.A.getScript=function isc_c_HTMLFlow_getScript(_1,_2,_3,_4){var _5=_1;var _6,_7,_8,_9;while((_6=_1.match(/<!--/i))!=null){_7=_1.match(/-->/i);if(_7==null||(_7.index<_6.index)){this.logWarn('HTMLFlow content contains an opening comment tag "<!--" with no closing 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(/(<script([^>]*)?>)/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(/(<script([^>]*)?>)/i);if(_16==null||(_17&&(_16.index>_17.index))){this.logWarn("HTMLFlow content contains an opening <script ...> tag with no closing tag, or vice versa. Stripping out this tag:"+_15);continue}
var _18=_13.slice(0,_16.index);_13=_13.slice(_16.index+9,_13.length);var _19=(_15.match(/<script\s*(language|type)/i)==null)||(_15.match(/<script\s*(language|type)\s*=["']?[^'"]*(javascript|ecmascript|jscript)[^'"]*["']?/i)
!=null);if(!this.shouldLoadScript(_15))continue;if(_19){var _20;if((_20=_15.match(/src=('|")?([^'"> ]*)/i))){_11.add(_20[2]);_10.add(null)}else{if(!isc.isA.String(_18)||isc.isAn.emptyString(_18))continue;_10.add(_18);_11.add(null)}
_12.add(null)}else{this.logWarn("html to be evaluated contains non-JS script tags - these will be ignored.  Tag: "+_15)}
}
if(_12.length==0)
_12=[_13];else
_12.push(_13);if(_11.length>0&&!_4){if(isc.RPCManager){var _21=false;for(var i=0;i<_11.length;i++){if(_11[i]==null){continue}
isc.RPCManager.sendRequest({actionURL:_11[i],serverOutputAsString:true,httpMethod:"GET",internalClientContext:{scriptIndex:i,scripts:_10,scriptIncludes:_11,callback:_2,htmlFragments:(_3?_12:[_5])
},callback:"isc.HTMLFlow.loadedRemoteScriptBlock(data, rpcResponse.internalClientContext)"
}
);_21=true}
if(_21)return}else{this.logWarn("html contains <script src=> blocks with the following target URLs: "+_11+" If you want these to be dynamically loaded, please include the DataBinding module or include the contents of these files in inline <script> blocks.")}
}
var _23=_10.join("\n");this.fireCallback(_2,"htmlFragments,dontFetchScripts,scripts",[(_3?_12:[_5]),_4,_10])}
,isc.A.shouldLoadScript=function isc_c_HTMLFlow_shouldLoadScript(_1){var _2=_1.match(/ISC_([^.]*)\.js/i);if(_2&&isc["module_"+_2[1]])return false;var _2=_1.match(/load_skin\.js/i);if(_2)return false;return true}
,isc.A.loadedRemoteScriptBlock=function isc_c_HTMLFlow_loadedRemoteScriptBlock(_1,_2){var _3=_2.scriptIndex,_4=_2.scripts,_5=_2.scriptIncludes;_4[_3]=_1;delete _5[_3];for(var i=0;i<_5.length;i++){if(_5[i]!=null)return}
this.fireCallback(_2.callback,"htmlFragments,dontFetchScripts,scripts",[_2.htmlFragments,false,_4])}
);isc.B._maxIndex=isc.C+5;isc.A=isc.HTMLFlow.getPrototype();isc.A.defaultWidth=200;isc.A.defaultHeight=1;isc.A.allowContentAndChildren=true;isc.A.cursor="auto";isc.A.loadingMessage="&nbsp;${loadingImage}";isc.A.httpMethod="GET";isc.A.autoDeriveContentsType=false;isc.A.supportsContentsAsPage=true;isc.A.useSimpleHttp=true;isc.A.evalScriptBlocks=null;isc.A.captureSCComponents=true;isc.A.canSelectText=true;isc.A=isc.HTMLFlow.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.autoChangeProtocol=true;isc.A.structuralHTMLTags=["!doctype"
,"html"
,"head"
,"body"
,"style"
,"link"
,"script"];isc.A.$525=0;isc.A.contentLoaded=isc.Class.NO_OP;isc.B.push(isc.A.initWidget=function isc_HTMLFlow_initWidget(){if(this.contentsType=="page"&&this.overflow=="visible")this.setOverflow("auto")}
,isc.A.draw=function isc_HTMLFlow_draw(){if(!this.readyToDraw())return this;var _1=this.containsIFrame();if(_1)this.canSelectText=false;this.Super("draw",arguments);if(_1)return this;if(this.contentsType!="page"){if(this.contentsURL){if(!(this.$533==this.contentsURL||this.loadingContent())){this.setContentsURL(this.contentsURL)}
}else{this.$939(this.contents,(this.evalScriptBlocks==null?false:this.evalScriptBlocks))}
}
return this}
,isc.A.setContentsURL=function isc_HTMLFlow_setContentsURL(_1,_2,_3){if(arguments.length==0)_1=this.contentsURL;if(this.autoChangeProtocol){if(_1&&_1.startsWith("http")){var _4=isc.Page.getProtocol(window.location.toString()),_5=isc.Page.getProtocol(_1)
;if(_5&&_4&&(_5!=_4)){_1=_1.replace(_5,_4)}
}
}
if(this.contentsType=="page"||_1==null){return this.invokeSuper(isc.HTMLFlow,"setContentsURL",_1,_2)}
this.contentsURL=_1;if(this.loadingMessage){var _6=this.loadingMessage==null?"&nbsp;"
:this.loadingMessage.evalDynamicString(this,{loadingImage:this.imgHTML(isc.Canvas.loadingImageSrc,isc.Canvas.loadingImageSize,isc.Canvas.loadingImageSize)});this.$23j(_6)}
var _7=isc.addProperties({},this.contentsURLParams,_2),_8=this.useSimpleHttp,_9=this.httpMethod,_10=true;var _11=isc.addProperties({showPrompt:false,actionURL:this.contentsURL,httpMethod:_9,useSimpleHttp:_8,bypassCache:!this.allowCaching,params:_7
},this.contentRPCProperties,_3,{willHandleError:true,serverOutputAsString:_10,callback:this.getID()+".$40s(rpcRequest, rpcResponse)"
});this.$40t=isc.rpc.sendProxied(_11,true).transactionNum}
,isc.A.setContentsType=function isc_HTMLFlow_setContentsType(_1){if(this.contentsType==_1)return;this.Super("setContentsType",arguments);if(this.contentsURL!=null){this.setContentsURL(this.contentsURL)}}
,isc.A.loadingContent=function isc_HTMLFlow_loadingContent(){return this.$40t!=null}
,isc.A.$40s=function isc_HTMLFlow__loadContentReply(_1,_2){var _3=_2.data;if(_2.status!=isc.RPCResponse.STATUS_SUCCESS){if(this.handleError(_1,_2)===false)return}
if(_1.transactionNum!=this.$40t){return}
this.$939(_3,(this.evalScriptBlocks==null?true:this.evalScriptBlocks))}
,isc.A.setContents=function isc_HTMLFlow_setContents(_1){if(_1!=null)this.contents=_1;this.$939(this.contents,(this.evalScriptBlocks==null?false:this.evalScriptBlocks))}
,isc.A.$23j=function isc_HTMLFlow__setContents(_1){if(!this.dynamicContents||_1!=null){this.contents=_1}
this.markForRedraw("setContents")}
,isc.A.$2792=function isc_HTMLFlow__getContentsType(){return this.contentsType||this.$2793}
,isc.A.isPageHTML=function isc_HTMLFlow_isPageHTML(_1){var _2=this.structuralHTMLTags.join("|");var _3=new RegExp("(?:<!--.*?-->|<pre.*?</pre>)|(<(?:"+_2+")\\b)","gis"
);var _4,_5=false;while((_4=_3.exec(_1))!==null){if(_4[1]){_5=true;break}
}
return _5}
,isc.A.$2791=function isc_HTMLFlow__getIFrameSrc(){if(this.contentsType==null&&this.autoDeriveContentsType)return null;return this.Super("$2791",arguments)}
,isc.A.$939=function isc_HTMLFlow__evalContents(_1,_2){if(!_1)return;if(this.autoDeriveContentsType&&this.contentsType==null){var _3=this.isPageHTML(_1);this.$2793=_3?"page":"fragment"}
if(this.$2792()=="page"){this.$23j(this.transformHTML(_1));this.$40u()}else{isc.HTMLFlow.getScript(_1,{target:this,methodName:"$49y"},true,!_2)}}
,isc.A.fetchRelatedData=function isc_HTMLFlow_fetchRelatedData(_1,_2,_3,_4,_5){var _6=this;return this.invokeSuper(isc.HTMLFlow,"fetchRelatedData",_1,_2,function(_8,_9,_10){if(_9&&_9.length>0){var _7=isc.DS.get(_10.dataSource);if(_7.descriptionField){_6.setContents(_9[0][_7.descriptionField])}else{isc.logWarn("HTMLFlow.fetchRelatedData() called for DataSource '"+_10.dataSource+"' which does not have a descriptionField set.")}
}
if(_3){_3(_8,_9,_10)}
},_4,_5)}
,isc.A.getData=function isc_HTMLFlow_getData(){return this.data}
,isc.A.$526=function isc_HTMLFlow__captureSCComponentsRelPos(_1){if(!_1.parentElement)this.addChild(_1);var _2="HTMLFlow"+this.$525++;_1.htmlElement=_2;var _3='<DIV id="'+_2+'"></DIV>';return _3}
,isc.A.$527=function isc_HTMLFlow__captureSCComponentsAbsPos(_1){if(!_1.parentElement)this.addChild(_1);return null}
,isc.A.$49y=function isc_HTMLFlow__setContentsAndExecute(_1,_2,_3){this.$23j(this.transformHTML(_1.join("")));if(_1.length>1){if(!(_2)){if(this.isDirty())this.redraw();if(this.captureSCComponents){this.$528=isc.Canvas.getInstanceProperty("autoDraw");isc.setAutoDraw(false)}
for(var i=0;i<_1.length;i++){var _5=null;var _6=this;if(this.captureSCComponents)_5=function(_9,_10){if(!_9.length)return;_1[i]=_9.map(function(_11){var _7=window[_11];if(!_7||!isc.isA.Canvas(_7))return null;if(_7.position==isc.Canvas.RELATIVE)
return _6.$526(_7);else return _6.$527(_7)}).join("")};if(_3[i])isc.Class.globalEvalWithCapture(_3[i],_5)}
if(this.captureSCComponents){this.$23j(this.transformHTML(_1.join("")));if(this.$528){isc.setAutoDraw(true);for(var _8 in window)
if(isc.isA.Canvas(_8)&&_8.autoDraw)
_8.markForRedraw()}
}
}
else{this.logWarn("html returned by server appears to contain <script> blocks.  If you want these to be evaluated, you must set evalScriptBlocks:true.")}
}
this.$40u()}
,isc.A.handleError=function isc_HTMLFlow_handleError(_1,_2){this.logWarn(_2.data)}
,isc.A.$40u=function isc_HTMLFlow__loadContentsReplyComplete(){this.$533=this.contentsURL;this.$40t=null;this.contentLoaded()}
,isc.A.transformHTML=function isc_HTMLFlow_transformHTML(_1){return _1}
,isc.A.modifyContent=function isc_HTMLFlow_modifyContent(){}
,isc.A.handleKeyPress=function isc_HTMLFlow_handleKeyPress(_1,_2){if(!this.containsIFrame()&&this.selectContentOnSelectAll){var _3=this.ns.EH,_4=_1.keyName;if(_3.modifierKeyDown(_1)&&_4=="A"){if(isc.Browser.$120h){this.getWindow().getSelection().selectAllChildren(this.getHandle())}else{var _5=this.getDocumentBody(true);if(_5!=null&&_5.createTextRange!=null){var _6=_5.createTextRange();_6.moveToElementText(this.getHandle());_6.select()}
}
return false}
}
return this.Super("handleKeyPress",arguments)}
);isc.B._maxIndex=isc.C+22;isc.HTMLFlow.registerStringMethods({contentLoaded:""});isc.defineClass("HTMLPane",isc.HTMLFlow);isc.A=isc.HTMLPane.getPrototype();isc.A.overflow=isc.Canvas.AUTO;isc.A.defaultHeight=200;isc.defineClass("FacadeDataSource","DataSource");isc.A=isc.FacadeDataSource.getPrototype();isc.A.dataProtocol="clientCustom";isc.A.queueRequests=false;isc.A.queuedRequests=null;isc.A=isc.FacadeDataSource.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$79c=isc.Class.NO_OP;isc.B.push(isc.A.setQueueRequests=function isc_FacadeDataSource_setQueueRequests(_1){this.queueRequests=_1=!!_1;if(!_1){var _2=this.queuedRequests;if(_2!=null){delete this.queuedRequests;var _3=this.superDS();for(var i=0,_5=_2.length;i<_5;++i){_3.execute(_2[i])}
}
}
}
,isc.A.clearQueue=function isc_FacadeDataSource_clearQueue(){if(this.queueRequests){this.setQueueRequests(false);this.setQueueRequests(true)}
}
,isc.A.transformRequest=function isc_FacadeDataSource_transformRequest(_1){var _2=this;var _3=this.cloneDSRequest(_1,true);_3.showPrompt=false;_3.callback=function(_5,_6,_3){_2.processResponse(_1.requestId,_2.superDS().cloneDSResponse(_5))};if(!this.queueRequests){this.superDS().execute(_3)}else{var _4=this.queuedRequests;if(_4==null)_4=this.queuedRequests=[];_4.add(_3)}
return _1.data}
);isc.B._maxIndex=isc.C+3;isc.defineClass("WSDataSource","DataSource");isc.A=isc.WSDataSource.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.serviceNamespace="urn:operations.smartclient.com";isc.A.operationBindings=[{operationType:"fetch",wsOperation:"fetch",recordXPath:"//data/*"},{operationType:"add",wsOperation:"add",recordXPath:"//data/*"},{operationType:"remove",wsOperation:"remove",recordXPath:"//data/*"},{operationType:"update",wsOperation:"update",recordXPath:"//data/*"}
];isc.B.push(isc.A.transformRequest=function isc_WSDataSource_transformRequest(_1){var _2={dataSource:_1.dataSource,operationType:_1.operationType,data:_1.data
};if(_1.startRow!=null){_2.startRow=_1.startRow;_2.endRow=_1.endRow}
if(_1.textMatchStyle!=null)_2.textMatchStyle=_1.textMatchStyle;if(_1.operationId!=null)_2.operationId=_1.operationId;if(_1.sortBy!=null)_2.sortBy=_1.sortBy;return _2}
,isc.A.transformResponse=function isc_WSDataSource_transformResponse(_1,_2,_3){if(!_3||!_3.selectString)return;_1.status=_3.selectString("//status");if(isc.isA.String(_1.status)){var _4=isc.DSResponse[_1.status];if(_1.status==null){this.logWarn("Unable to map response code: "+_4
+" to a DSResponse code, setting status to DSResponse.STATUS_FAILURE.");_4=isc.DSResponse.STATUS_FAILURE;_1.data=_3.selectString("//data")}else{_1.status=_4}
}
if(_1.status==isc.DSResponse.STATUS_VALIDATION_ERROR){var _5=_3.selectNodes("//errors/*");_1.errors=isc.xml.toJS(_5,null,this)}
_1.totalRows=_3.selectNumber("//totalRows");_1.startRow=_3.selectNumber("//startRow");_1.endRow=_3.selectNumber("//endRow")}
);isc.B._maxIndex=isc.C+2;isc.defineClass("RestDataSource","DataSource");isc.A=isc.RestDataSource.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.serverType="generic";isc.A.dataFormat="xml";isc.A.xmlRecordXPath="/response/data/*";isc.A.xmlNamespaces={xsi:"http://www.w3.org/2001/XMLSchema-instance"};isc.A.jsonRecordXPath="/response/data";isc.A.prettyPrintJSON=true;isc.A.dataFormatParamName="isc_dataFormat";isc.A.jsonPrefix="<SCRIPT>//'\"]]>>isc_JSONResponseStart>>";isc.A.jsonSuffix="//isc_JSONResponseEnd";isc.A.operationBindings=[{operationType:"fetch",dataProtocol:"getParams"},{operationType:"add",dataProtocol:"postParams"},{operationType:"remove",dataProtocol:"postParams"},{operationType:"update",dataProtocol:"postParams"}
];isc.A.sendMetaData=true;isc.A.metaDataPrefix="_";isc.B.push(isc.A.init=function isc_RestDataSource_init(){this.serverType="generic";this.recordXPath=this.recordXPath||(this.dataFormat=="xml"?this.xmlRecordXPath:this.jsonRecordXPath);return this.Super("init",arguments)}
,isc.A.getProperty=function isc_RestDataSource_getProperty(_1){if(_1=="fetchDataURL")return this.fetchDataURL;var _2=this.$dt(_1);if(_2)return this[_2]();return this[_1]}
,isc.A.getDataURL=function isc_RestDataSource_getDataURL(_1){var _2=_1.operationType;if(_2=="fetch"&&this.fetchDataURL!=null)
return this.fetchDataURL;if(_2=="update"&&this.updateDataURL!=null)
return this.updateDataURL;if(_2=="add"&&this.addDataURL!=null)
return this.addDataURL;if(_2=="remove"&&this.removeDataURL!=null)
return this.removeDataURL;return this.Super("getDataURL",arguments)}
,isc.A.getDataProtocol=function isc_RestDataSource_getDataProtocol(_1){var _2=this.Super("getDataProtocol",arguments);if(_2=="postXML")_2="postMessage";return _2}
,isc.A.transformRequest=function isc_RestDataSource_transformRequest(_1){var _2=this.getDataProtocol(_1);_1.isRestRequest=!(this.disableQueuing||this.clientOnly);_1.dataFormat=(this.clientOnly?"json":this.dataFormat);if(_2=="postMessage"){if(_1.params==null){_1.params={}}
_1.params[this.dataFormatParamName]=this.dataFormat;var _3={dataSource:this.getID()
};if(_1.operationType!=null)_3.operationType=_1.operationType;if(_1.operationId!=null)_3.operationId=_1.operationId;if(_1.startRow!=null)_3.startRow=_1.startRow;if(_1.endRow!=null)_3.endRow=_1.endRow;if(_1.sortBy!=null)_3.sortBy=_1.sortBy;if(_1.textMatchStyle!=null)_3.textMatchStyle=_1.textMatchStyle;if(_1.parentNode!=null)_3.parentNode=isc.Tree.getCleanNodeData(_1.parentNode);if(_1.useStrictJSON!=null)_3.useStrictJSON=_1.useStrictJSON;if(this.sendClientContext)_3.clientContext=_1.clientContext;if(_1.componentId)_3.componentId=_1.componentId;if(isc.DataSource.get("$89s")==null){isc.DataSource.create({ID:"$89s",fields:[{name:"_constructor",xmlAttribute:false},{name:"criteria",multiple:true,type:"$89s",childTagName:"criterion"},{name:"oldValues"}
]
})}
var _4=isc.DataSource.create({fields:[{name:"data",type:"$89s"},{name:"oldValues"}
]
});if(this.autoConvertRelativeDates==true){if(this.logIsInfoEnabled("relativeDates")){this.logInfo("Calling convertRelativeDates from getServiceInputs - data is\n\n"+isc.echoFull(_1.data))}
var _5=this.convertRelativeDates(_1.data);if(this.logIsInfoEnabled("relativeDates")){this.logInfo("Called convertRelativeDates from getServiceInputs - data is\n\n"+isc.echoFull(_5))}
_1.data=_5}
if(_1.summaryFunctions!=null)_3.summaryFunctions=_1.summaryFunctions;if(_1.groupBy!=null)_3.groupBy=_1.groupBy;_3.data=_1.data;if(_1.oldValues){_3.oldValues=_1.oldValues}
if(!_1.contentType){_1.contentType=(this.dataFormat=="json"?"application/json":"text/xml")}
var _6;_1.$92v=_1.data;if(_1.dataFormat=="json"){if(_3.data!=null)_3.data=this.serializeFields(_3.data);if(_3.oldValues!=null)_3.oldValues=this.serializeFields(_3.oldValues);var _7={prettyPrint:this.prettyPrintJSON,trimMilliseconds:!!this.trimMilliseconds
};_6=isc.JSON.encode(_3,_7)}else{var _8={ignoreConstructor:true,schema:this
};var _9=isc.Comm.writeDatetimeXSI;isc.Comm.writeDatetimeXSI=true;_6=_4.xmlSerialize(_3,_8,null,"request");isc.Comm.writeDatetimeXSI=_9}
_4.destroy();return _6}else{if(_2!="getParams"&&_2!="postParams"){this.logWarn("RestDataSource operation:"+_1.operationID+", of type "
+_1.operationType+" has dataProtocol specified as '"
+_2+"'. Supported protocols are 'postParams', 'getParams' and 'postMessage' only. Defaulting to 'getParams'.");_1.dataProtocol='getParams'}
var _3=isc.addProperties({},_1.data,_1.params);if(_1.summaryFunctions!=null)_3.summaryFunctions=_1.summaryFunctions;if(_1.groupBy!=null)_3.groupBy=_1.groupBy;if(this.sendMetaData){if(!this.parameterNameMap){var _10={};_10[this.metaDataPrefix+"operationType"]="operationType";_10[this.metaDataPrefix+"operationId"]="operationId";_10[this.metaDataPrefix+"startRow"]="startRow";_10[this.metaDataPrefix+"endRow"]="endRow";_10[this.metaDataPrefix+"sortBy"]="sortBy";_10[this.metaDataPrefix+"useStrictJSON"]="useStrictJSON";_10[this.metaDataPrefix+"textMatchStyle"]="textMatchStyle";_10[this.metaDataPrefix+"oldValues"]="oldValues";_10[this.metaDataPrefix+"componentId"]="componentId";_10[this.metaDataPrefix+"parentNode"]="parentNode";this.parameterNameMap=_10}
for(var _11 in this.parameterNameMap){var _12=_1[this.parameterNameMap[_11]];if(_12!=null){if(_11=="$97q"){_3[_11]=isc.Tree.getCleanNodeData(_12)}else{_3[_11]=_12}
}
}
_3[this.metaDataPrefix+"dataSource"]=this.getID();_3["isc_metaDataPrefix"]=this.metaDataPrefix}
_3[this.dataFormatParamName]=this.dataFormat;return _3}
}
,isc.A.getUpdatedData=function isc_RestDataSource_getUpdatedData(_1,_2,_3){var _4=_2?_2.data:null;if(_3&&(!_4||isc.isAn.emptyString(_4)||(isc.isA.Array(_4)&&_4.length==0))&&_2.status==0&&this.getDataProtocol(_1)=="postMessage")
{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={},_6=_1.originalData;if(_6&&isc.isAn.Object(_6)){if(_1.operationType=="update"){_5=isc.addProperties({},_1.oldValues);if(isc.isAn.Array(_6)){_5=isc.addProperties(_5,_6[0])}else{_5=isc.addProperties(_5,_6)}
_5=[_5]}else{if(!isc.isAn.Array(_6))_6=[_6];_5=[];for(var i=0;i<_6.length;i++){_5[i]=isc.addProperties({},_6[i])}
}
if(this.logIsDebugEnabled("ResultSet")){this.logDebug("Submitted data to be integrated into the cache:"
+this.echoAll(_5),"ResultSet")}
}
return _5}else{return this.Super("getUpdatedData",arguments)}
}
,isc.A.getValidStatus=function isc_RestDataSource_getValidStatus(_1){if(isc.isA.String(_1)){if(parseInt(_1)==_1)_1=parseInt(_1);else{_1=isc.DSResponse[_1];if(_1==null){this.logWarn("Unable to map response code: "+_1
+" to a DSResponse code, setting status to DSResponse.STATUS_FAILURE.");_1=isc.DSResponse.STATUS_FAILURE}
}
}
if(_1==null)_1=isc.DSResponse.STATUS_SUCCESS;return _1}
,isc.A.getValidInvalidateCache=function isc_RestDataSource_getValidInvalidateCache(_1){if(_1==null)return false;switch(_1.toLowerCase()){case"true":case"yes":case"1":return true;case"false":case"no":case"0":case null:return false;default:return Boolean(_1)}
}
,isc.A.transformResponse=function isc_RestDataSource_transformResponse(_1,_2,_3){if(_1.status<0||!_3){_1.queueStatus=-1;return _1}
if(_2.dataFormat=="json"){if(isc.isAn.Array(_3)){var _4=_3.length==1&&_3[0]&&_3[0].response!=null;this.logWarn("RestDataSource transformResponse(): JSON response text is incorrectly formatted as an Array rather than a simple response object."
+(_4?" Array contains a single entry which appears to be a validly formatted response object - using this."
:"")
);if(_4)_3=_3[0]}else if(_3.response==null){this.logWarn("RestDataSouce transformResponse(): JSON response text does not appear to be in standard response format.")}
var _5=_3.response||{};_1.status=this.getValidStatus(_5.status);_1.invalidateCache=_5.invalidateCache==null?false:_5.invalidateCache;_1.queueStatus=this.getValidStatus(_5.queueStatus);if(_1.status==isc.DSResponse.STATUS_VALIDATION_ERROR){var _6=_5.errors;if(isc.isAn.Array(_6)){if(_6.length>1){this.logWarn("server returned an array of errors - ignoring all but the first one")}
_6=_6[0]}
_1.errors=_6;if(_5.data!=null)_1.data=_5.data}else if(_1.status==isc.DSResponse.STATUS_REQUIRED_CRITERIA_MISSING){if(_5.missingCriterion){_1.missingCriterion=_5.missingCriterion}
}else if(_1.status<0){_1.data=_5.data;_1.totalRows=_1.startRow;_1.endRow=_1.startRow}
if(_5.totalRows!=null)_1.totalRows=_5.totalRows;if(_5.startRow!=null)_1.startRow=_5.startRow;if(_5.endRow!=null)_1.endRow=_5.endRow;var _7=_5.relatedUpdates;this.handleRelatedUpdates(_7)}else{if(_2.clientOnly)return _1;_1.status=this.getValidStatus(_3.selectString("//status"));_1.invalidateCache=this.getValidInvalidateCache(_3.selectString("//invalidateCache"));_1.queueStatus=this.getValidStatus(_3.selectString("//queueStatus"));if(_1.status==isc.DSResponse.STATUS_VALIDATION_ERROR){var _6=_3.selectNodes("//errors");_6=isc.xml.toJS(_6);if(_6.length>1){this.logWarn("server returned an array of errors - ignoring all but the first one")}
_6=_6[0];_1.errors=_6;var _8=_3.selectString("//data");if(_8)_1.data=_8}else if(_1.status==isc.DSResponse.STATUS_REQUIRED_CRITERIA_MISSING){var _9=_3.selectString("//missingCriterion");if(_9){_1.missingCriterion=_9}
}else if(_1.status<0){_1.data=_3.selectString("//data")}else{}
var _10=_3.selectNumber("//totalRows");if(_10!=null)_1.totalRows=_10;var _11=_3.selectNumber("//startRow");if(_11!=null)_1.startRow=_11;var _12=_3.selectNumber("//endRow");if(_12!=null)_1.endRow=_12;var _7=isc.xml.toJS(_3.selectNodes("//relatedUpdates/response"));this.handleRelatedUpdates(_7)}
return _1}
,isc.A.handleRelatedUpdates=function isc_RestDataSource_handleRelatedUpdates(_1){if(_1){for(var i=0;i<_1.length;i++){var _3=isc.DataSource.getDataSource(_1[i].dataSource);if(_1[i].data.record)_1[i].data=_1[i].data.record;_3.updateCaches(_1[i])}
}
}
,isc.A.shouldUseTestDataFetch=function isc_RestDataSource_shouldUseTestDataFetch(){return this.clientOnly==true&&this.cacheAllData!=true&&this.testFileName!=null}
,isc.A.hasTestData=function isc_RestDataSource_hasTestData(){return this.testFileName!=null}
,isc.A.getClientOnlyResponse=function isc_RestDataSource_getClientOnlyResponse(_1,_2){if(_1.$92v)_1.data=_1.$92v;var _3=this.Super("getClientOnlyResponse",arguments);if(!isc.isAn.Array(_3.data))_3.data=[_3.data];return _3}
);isc.B._maxIndex=isc.C+13;isc.DataSource.create({
Constructor:"DataSource",
isServerDS:true,
allowAdvancedCriteria:true,
addGlobalId:"false",
ID:"DataSource",
fields:[
{
type:"string",
xmlAttribute:"true",
name:"ID",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"description",
validators:[
]
},
{
multiple:"true",
type:"Object",
name:"sampleData",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"autoIdField",
validators:[
]
},
{
title:"Superclass",
type:"string",
xmlAttribute:"true",
name:"inheritsFrom",
validators:[
]
},
{
type:"boolean",
name:"useParentFieldOrder",
validators:[
]
},
{
type:"boolean",
name:"useLocalFieldsOnly",
validators:[
]
},
{
type:"boolean",
name:"restrictToParentFields",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"tableCollation",
validators:[
]
},
{
valueMap:{
custom:"Custom Binding",
iscServer:"ISC Java Server",
json:"JSON Web Service",
xml:"XML / WSDL Web Service"
},
title:"DataFormat",
type:"string",
xmlAttribute:"true",
name:"dataFormat",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"useStrictJSON",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"apidoc",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"isSampleDS",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"noAutoFetch",
validators:[
]
},
{
valueMap:{
exec:"executes a command external to the JVM",
generic:"Requests will be delivered to the server and you are expected to write Java code to create a valid response",
hibernate:"ISC Server Hibernate Connectors",
jpa:"Use SmartClient's built-in JPA 2.0 connector",
jpa1:"Use SmartClient's built-in JPA 1.0 connector",
rest:"Server-side REST implementation",
sql:"ISC Server SQL Connectors",
stream:"DataSource connected to a messaging broker"
},
title:"Server Type",
type:"string",
xmlAttribute:"true",
name:"serverType",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"schemaBean",
validators:[
]
},
{
title:"Callback Parameter",
type:"string",
xmlAttribute:"true",
name:"callbackParam",
validators:[
]
},
{
type:"Object",
name:"requestProperties",
validators:[
]
},
{
childTagName:"DSField",
multiple:"true",
propertiesOnly:"true",
type:"DataSourceField",
name:"fields",
validators:[
]
},
{
title:"Add Global ID",
type:"boolean",
name:"addGlobalId",
validators:[
]
},
{
type:"boolean",
name:"showPrompt",
validators:[
]
},
{
title:"DataSource Version",
type:"number",
visibility:"internal",
xmlAttribute:"true",
name:"dataSourceVersion",
validators:[
]
},
{
title:"Database Name",
type:"string",
xmlAttribute:"true",
name:"dbName",
validators:[
]
},
{
title:"Schema",
type:"string",
xmlAttribute:"true",
name:"schema",
validators:[
]
},
{
title:"Audit Schema",
type:"string",
xmlAttribute:"true",
name:"auditSchema",
validators:[
]
},
{
title:"Table Name",
type:"string",
xmlAttribute:"true",
name:"tableName",
validators:[
]
},
{
title:"Quote Table Name?",
type:"boolean",
xmlAttribute:"true",
name:"quoteTableName",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"tableCode",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"tableCharacterSet",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"strictSQLFiltering",
validators:[
]
},
{
type:"string",
name:"relatedTableAlias",
validators:[
]
},
{
title:"Stream realtime updates for changes to this datasource?",
type:"boolean",
xmlAttribute:"true",
name:"realtimeUpdates",
validators:[
]
},
{
type:"ServerObject",
name:"serverObject",
validators:[
]
},
{
type:"string",
name:"serverConstructor",
validators:[
]
},
{
multiple:"true",
type:"OperationBinding",
name:"operationBindings",
validators:[
]
},
{
hidden:"true",
propertiesOnly:"true",
type:"DataSourceField",
moveTo:"fields",
name:"field",
validators:[
]
},
{
hidden:"true",
type:"OperationBinding",
moveTo:"operationBindings",
name:"operationBinding",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"serviceNamespace",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"dataURL",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"dataProtocol",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"dataTransport",
validators:[
]
},
{
type:"Object",
name:"defaultParams",
validators:[
]
},
{
type:"string",
name:"soapAction",
validators:[
]
},
{
type:"string",
name:"jsonPrefix",
validators:[
]
},
{
type:"string",
name:"jsonSuffix",
validators:[
]
},
{
type:"string",
name:"messageTemplate",
validators:[
]
},
{
propertiesOnly:"true",
type:"Object",
visibility:"internal",
name:"defaultCriteria",
validators:[
]
},
{
type:"string",
visibility:"xmlBinding",
name:"tagName",
validators:[
]
},
{
type:"XPath",
name:"recordXPath",
validators:[
]
},
{
type:"string",
name:"recordName",
validators:[
]
},
{
type:"Object",
name:"xmlNamespaces",
validators:[
]
},
{
type:"boolean",
name:"dropExtraFields",
validators:[
]
},
{
type:"string",
visibility:"internal",
xmlAttribute:"true",
name:"schemaNamespace",
validators:[
]
},
{
type:"boolean",
visibility:"internal",
name:"mustQualify",
validators:[
]
},
{
type:"boolean",
visibility:"internal",
name:"xsdSimpleContent",
validators:[
]
},
{
type:"boolean",
visibility:"internal",
name:"xsdAnyElement",
validators:[
]
},
{
type:"boolean",
visibility:"internal",
name:"xsdAbstract",
validators:[
]
},
{
title:"Title",
type:"string",
name:"title",
validators:[
]
},
{
title:"Title Field",
type:"string",
name:"titleField",
validators:[
]
},
{
title:"Plural Title",
type:"string",
name:"pluralTitle",
validators:[
]
},
{
title:"Client Only",
type:"boolean",
xmlAttribute:"true",
name:"clientOnly",
validators:[
]
},
{
title:"Test File Name",
type:"URL",
xmlAttribute:"true",
name:"testFileName",
validators:[
]
},
{
type:"URL",
xmlAttribute:"true",
name:"dbImportFileName",
validators:[
]
},
{
multiple:"true",
skipSerialization:"true",
type:"Object",
name:"testData",
validators:[
]
},
{
multiple:"true",
type:"Object",
name:"cacheData",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"cacheAllData",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"cacheAcrossOperationIds",
validators:[
]
},
{
multiple:"true",
hidden:"true",
type:"SandboxedTestFile",
name:"sandboxedTestFiles",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"mockMode",
validators:[
]
},
{
type:"integer",
xmlAttribute:"true",
name:"mockDataRows",
validators:[
]
},
{
multiple:"true",
type:"Criterion",
name:"mockDataCriteria",
validators:[
]
},
{
multiple:"true",
propertiesOnly:"true",
type:"DataSourceField",
uniqueProperty:"ID",
visibility:"internal",
name:"types",
validators:[
]
},
{
multiple:"true",
type:"string",
visibility:"internal",
name:"groups",
validators:[
]
},
{
multiple:"true",
type:"MethodDeclaration",
visibility:"internal",
name:"methods",
validators:[
]
},
{
type:"boolean",
name:"showSuperClassActions",
validators:[
]
},
{
type:"boolean",
name:"createStandalone",
validators:[
]
},
{
type:"boolean",
name:"useFlatFields",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"showLocalFieldsOnly",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"showSuperClassEvents",
validators:[
]
},
{
type:"Object",
name:"globalNamespaces",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"autoDeriveSchema",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"autoDeriveFKs",
validators:[
]
},
{
type:"boolean",
name:"useLocalValidators",
validators:[
]
},
{
type:"boolean",
name:"autoDeriveTitles",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"qualifyColumnNames",
validators:[
]
},
{
type:"boolean",
name:"validateRelatedRecords",
validators:[
]
},
{
type:"boolean",
name:"requiresAuthentication",
validators:[
]
},
{
type:"string",
name:"requiresRole",
validators:[
]
},
{
type:"string",
name:"requires",
validators:[
]
},
{
type:"string",
name:"ownerIdField",
validators:[
]
},
{
type:"string",
name:"ownerIdNullRole",
validators:[
]
},
{
valueMap:{
edit:"all users can fetch and update",
none:"fetch, update disallowed",
view:"all users can fetch"
},
type:"string",
xmlAttribute:"true",
name:"ownerIdNullAccess",
validators:[
]
},
{
type:"string",
name:"guestUserId",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"beanClassName",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"autoJoinTransactions",
validators:[
]
},
{
type:"boolean",
name:"useAnsiJoins",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"useSpringTransaction",
validators:[
]
},
{
type:"boolean",
name:"sparseUpdates",
validators:[
]
},
{
type:"boolean",
name:"noNullUpdates",
validators:[
]
},
{
type:"boolean",
name:"canExport",
validators:[
]
},
{
type:"boolean",
name:"progressiveLoading",
validators:[
]
},
{
type:"boolean",
name:"autoConvertRelativeDates",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"allowAdvancedCriteria",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"dropUnknownCriteria",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"allowDynamicTreeJoins",
validators:[
]
},
{
type:"string",
name:"scriptImport",
validators:[
]
},
{
idAllowed:"true",
type:"Object",
name:"script",
validators:[
]
},
{
type:"Object",
name:"transformRequestScript",
validators:[
]
},
{
type:"Object",
name:"transformResponseScript",
validators:[
]
},
{
type:"boolean",
name:"allowClientRequestedSummaries",
validators:[
]
},
{
multiple:"true",
type:"string",
name:"patternMultiWildcard",
validators:[
]
},
{
multiple:"true",
type:"string",
name:"patternSingleWildcard",
validators:[
]
},
{
type:"string",
valueMap:{
dropOnChange:"Drop on criteria change",
dropOnShortening:"Drop if criteria became more restrictive"
},
name:"criteriaPolicy",
validators:[
]
},
{
type:"string",
name:"substituteClasses",
validators:[
]
},
{
type:"string",
name:"idClassName",
validators:[
]
},
{
type:"boolean",
name:"supportTransactions",
validators:[
]
},
{
type:"boolean",
name:"creatorOverrides",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"loadParents",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"loadID",
validators:[
]
},
{
type:"boolean",
name:"audit",
validators:[
]
},
{
type:"string",
name:"auditDataSourceID",
validators:[
]
},
{
type:"string",
name:"auditDSConstructor",
validators:[
]
},
{
type:"string",
name:"auditRevisionFieldName",
validators:[
]
},
{
type:"string",
name:"auditTimeStampFieldName",
validators:[
]
},
{
type:"string",
name:"auditTypeFieldName",
validators:[
]
},
{
type:"string",
name:"auditUserFieldName",
validators:[
]
},
{
type:"boolean",
name:"compareMetadataForAuditChangeStatus",
validators:[
]
},
{
type:"integer",
name:"auditChangedFieldsFieldLength",
validators:[
]
},
{
type:"string",
name:"auditedDataSourceID",
validators:[
]
},
{
childTagName:"addedAuditField",
multiple:"true",
propertiesOnly:"true",
type:"DataSourceField",
name:"addedAuditFields",
validators:[
]
},
{
hidden:"true",
propertiesOnly:"true",
type:"DataSourceField",
moveTo:"addedAuditFields",
name:"addedAuditField",
validators:[
]
},
{
type:"boolean",
name:"autoCreateAuditTable",
validators:[
]
},
{
type:"string",
valueMap:{
full:"Inherit fields by copying them onto the inheriting DataSource's underlying table.",
none:"Do not physically inherit fields onto the inheriting DataSource's SQL table"
},
name:"inheritanceMode",
validators:[
]
},
{
type:"boolean",
name:"quoteColumnNames",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"generatedBy",
validators:[
]
},
{
type:"boolean",
name:"useUTCDateTimes",
validators:[
]
},
{
type:"boolean",
name:"useOfflineStorage",
validators:[
]
},
{
type:"string",
name:"enumOrdinalProperty",
validators:[
]
},
{
type:"string",
valueMap:{
bean:"Translates to/from a Javascript object containing one property for each property defined within the enum.",
ordinal:"Translates to/from an integer matching the ordinal number of the constant within the enumeration",
string:"Translates to/from a String matching the constant name."
},
name:"enumTranslateStrategy",
validators:[
]
},
{
type:"boolean",
name:"xmlFromConfig",
validators:[
]
},
{
type:"boolean",
name:"translatePatternOperators",
validators:[
]
},
{
type:"string",
name:"fileNameField",
validators:[
]
},
{
type:"string",
name:"fileTypeField",
validators:[
]
},
{
type:"string",
name:"fileFormatField",
validators:[
]
},
{
type:"string",
name:"fileSizeField",
validators:[
]
},
{
type:"string",
name:"fileLastModifiedField",
validators:[
]
},
{
type:"string",
name:"fileContentsField",
validators:[
]
},
{
type:"string",
name:"fileVersionField",
validators:[
]
},
{
type:"string",
name:"fileSourceExtensionFields",
validators:[
]
},
{
type:"string",
name:"projectFileKey",
validators:[
]
},
{
childTagName:"location",
multiple:"true",
type:"string",
name:"projectFileLocations",
validators:[
]
},
{
type:"string",
name:"defaultTextMatchStyle",
validators:[
]
},
{
type:"boolean",
name:"ignoreTextMatchStyleCaseSensitive",
validators:[
]
},
{
type:"boolean",
name:"arrayCriteriaForceExact",
validators:[
]
},
{
valueMap:{
always:"PK always required no matter what",
clientRequest:"PK required for client requests only",
never:"PK never required",
rpcManager:"PK required for requests associated with RPCManager"
},
type:"string",
xmlAttribute:"true",
name:"defaultMultiUpdatePolicy",
validators:[
]
},
{
type:"string",
name:"maxFileSizeExceededMessage",
validators:[
]
},
{
title:"Required Message",
type:"string",
xmlAttribute:"true",
name:"requiredMessage",
validators:[
]
},
{
type:"AdvancedCriteria",
xmlAttribute:"true",
name:"implicitCriteria",
validators:[
]
},
{
type:"boolean",
visibility:"internal",
xmlAttribute:"true",
name:"immutableAcrossSandboxes",
validators:[
]
},
{
title:"Is a Reify sample DS?",
type:"boolean",
xmlAttribute:"true",
name:"sample",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"readOnly",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"canDelete",
validators:[
]
},
{
type:"text",
xmlAttribute:"true",
name:"unionOf",
validators:[
]
},
{
type:"text",
xmlAttribute:"true",
name:"unionFields",
validators:[
]
},
{
valueMap:{
all:"Include all fields from all member databases",
intersect:"Only include fields that appear on all member dataSources (match by name)",
matching:"Only include fields that appear on two or more member dataSources (match by name)"
},
type:"text",
xmlAttribute:"true",
name:"defaultUnionFieldsStrategy",
validators:[
]
},
{
type:"text",
xmlAttribute:"true",
name:"cacheSyncStrategy",
validators:[
]
},
{
type:"text",
xmlAttribute:"true",
name:"cacheSyncTiming",
validators:[
]
},
{
type:"integer",
xmlAttribute:"true",
name:"logSlowSQL",
validators:[
]
},
{
type:"integer",
xmlAttribute:"true",
name:"logSlowFetch",
validators:[
]
},
{
type:"integer",
xmlAttribute:"true",
name:"logSlowAdd",
validators:[
]
},
{
type:"integer",
xmlAttribute:"true",
name:"logSlowUpdate",
validators:[
]
},
{
type:"integer",
xmlAttribute:"true",
name:"logSlowRemove",
validators:[
]
},
{
type:"integer",
xmlAttribute:"true",
name:"logSlowCustom",
validators:[
]
},
{
type:"DataSource",
name:"serverConfig",
validators:[
]
},
{
type:"text",
name:"requestFormat",
validators:[
]
},
{
type:"text",
name:"responseFormat",
validators:[
]
},
{
type:"text",
name:"requestTemplate",
validators:[
]
},
{
type:"text",
name:"responseTemplate",
validators:[
]
},
{
type:"boolean",
name:"wrapInList",
validators:[
]
},
{
type:"Object",
name:"headers",
validators:[
]
},
{
type:"Object",
name:"params",
validators:[
]
},
{
type:"text",
name:"httpMethod",
validators:[
]
},
{
type:"boolean",
name:"requiresCompleteRESTResponse",
validators:[
]
},
{
type:"boolean",
name:"includeExtraValuesInTemplatedResponse",
validators:[
]
},
{
type:"integer",
xmlAttribute:"true",
name:"requestMaxRows",
validators:[
]
},
{
type:"integer",
xmlAttribute:"true",
name:"clientRequestMaxRows",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"allowAggregation",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"suppressManualAggregation",
validators:[
]
}
],
xsi:"http://www.w3.org/2001/XMLSchema-instance"
})
isc.DataSource.create({
isServerDS:true,
allowAdvancedCriteria:true,
addGlobalId:"false",
ID:"DataSourceField",
fields:[
{
basic:"true",
title:"Name",
type:"string",
required:"true",
xmlAttribute:"true",
primaryKey:"true",
name:"name",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"description",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"sequenceName",
validators:[
]
},
{
type:"FieldFilterMode",
xmlAttribute:"true",
name:"filterOn",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"useHavingClause",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"uniqueProperty",
validators:[
]
},
{
basic:"true",
title:"Type",
type:"string",
xmlAttribute:"true",
name:"type",
validators:[
]
},
{
title:"Disabled",
type:"boolean",
name:"disabled",
validators:[
]
},
{
title:"ID Allowed",
type:"boolean",
xmlAttribute:"true",
name:"idAllowed",
validators:[
]
},
{
title:"Required",
type:"boolean",
xmlAttribute:"true",
name:"required",
validators:[
]
},
{
title:"Required Message",
type:"string",
xmlAttribute:"true",
name:"requiredMessage",
validators:[
]
},
{
type:"ValueMap",
name:"valueMap",
validators:[
]
},
{
multiple:"true",
propertiesOnly:"true",
type:"Validator",
name:"validators",
validators:[
]
},
{
title:"Length",
type:"integer",
xmlAttribute:"true",
name:"length",
validators:[
]
},
{
title:"Decimal Pad",
type:"integer",
xmlAttribute:"true",
name:"decimalPad",
validators:[
]
},
{
title:"Decimal Precision",
type:"integer",
xmlAttribute:"true",
name:"decimalPrecision",
validators:[
]
},
{
type:"boolean",
visibility:"internal",
name:"xmlRequired",
validators:[
]
},
{
type:"string",
visibility:"internal",
name:"xmlMaxOccurs",
validators:[
]
},
{
type:"integer",
visibility:"internal",
name:"xmlMinOccurs",
validators:[
]
},
{
type:"boolean",
visibility:"internal",
name:"xmlNonEmpty",
validators:[
]
},
{
type:"boolean",
visibility:"internal",
name:"xsElementRef",
validators:[
]
},
{
title:"User can hide",
type:"boolean",
name:"canHide",
validators:[
]
},
{
type:"boolean",
visibility:"internal",
name:"xmlAttribute",
validators:[
]
},
{
type:"boolean",
visibility:"internal",
name:"mustQualify",
validators:[
]
},
{
type:"boolean",
visibility:"internal",
name:"xmlExplicitTypes",
validators:[
]
},
{
type:"boolean",
visibility:"internal",
name:"xmlExplicitSimpleTypes",
validators:[
]
},
{
type:"boolean",
visibility:"internal",
name:"xmlAttributeInRuleCriteria",
validators:[
]
},
{
title:"Value XPath",
type:"XPath",
xmlAttribute:"true",
name:"valueXPath",
validators:[
]
},
{
type:"boolean",
name:"childrenProperty",
validators:[
]
},
{
title:"Title",
type:"string",
xmlAttribute:"true",
name:"title",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"prompt",
validators:[
]
},
{
title:"Detail",
type:"boolean",
xmlAttribute:"true",
name:"detail",
validators:[
]
},
{
title:"Can Edit",
type:"boolean",
xmlAttribute:"true",
name:"canEdit",
validators:[
]
},
{
title:"Can Save",
type:"boolean",
xmlAttribute:"true",
name:"canSave",
validators:[
]
},
{
title:"Can Init",
type:"boolean",
xmlAttribute:"true",
name:"canInit",
validators:[
]
},
{
title:"Can Update",
type:"boolean",
xmlAttribute:"true",
name:"canUpdate",
validators:[
]
},
{
title:"Can View",
type:"boolean",
xmlAttribute:"true",
name:"canView",
validators:[
]
},
{
inapplicable:"true",
title:"Inapplicable",
type:"boolean",
name:"inapplicable",
validators:[
]
},
{
inapplicable:"true",
title:"Advanced",
type:"boolean",
name:"advanced",
validators:[
]
},
{
inapplicable:"true",
title:"Visibility",
type:"string",
name:"visibility",
validators:[
]
},
{
inapplicable:"true",
title:"Hidden",
type:"boolean",
xmlAttribute:"true",
name:"hidden",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"isRuleCriteria",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"fieldsCanBeFormula",
validators:[
]
},
{
title:"Is Primary Key",
type:"boolean",
xmlAttribute:"true",
name:"primaryKey",
validators:[
]
},
{
title:"Foreign Key",
type:"string",
xmlAttribute:"true",
name:"foreignKey",
validators:[
]
},
{
type:"string",
name:"otherFKs",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"displayField",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"foreignDisplayField",
validators:[
]
},
{
valueMap:{
inner:"A regular inner join",
outer:"An outer join"
},
type:"string",
xmlAttribute:"true",
name:"joinType",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"useLocalDisplayFieldValue",
validators:[
]
},
{
title:"Tree Root Value",
type:"string",
xmlAttribute:"true",
name:"rootValue",
validators:[
]
},
{
title:"Include From",
type:"string",
xmlAttribute:"true",
name:"includeFrom",
validators:[
]
},
{
title:"Include Via",
type:"string",
xmlAttribute:"true",
name:"includeVia",
validators:[
]
},
{
title:"Related Table Alias",
type:"string",
xmlAttribute:"true",
name:"relatedTableAlias",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"showFileInline",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"escapeHTML",
validators:[
]
},
{
type:"integerOrIdentifier",
xmlAttribute:"true",
name:"imageWidth",
validators:[
]
},
{
type:"integerOrIdentifier",
xmlAttribute:"true",
name:"imageHeight",
validators:[
]
},
{
hidden:"true",
title:"Native Name",
type:"string",
name:"nativeName",
validators:[
]
},
{
hidden:"true",
title:"Native Foreign Key",
type:"string",
xmlAttribute:"true",
name:"nativeFK",
validators:[
]
},
{
hidden:"true",
type:"boolean",
xmlAttribute:"true",
name:"autoDeriveFKs",
validators:[
]
},
{
hidden:"true",
title:"Field Name",
type:"string",
name:"fieldName",
validators:[
]
},
{
hidden:"true",
uniqueProperty:"name",
childTagName:"field",
multiple:"true",
propertiesOnly:"true",
type:"DataSourceField",
name:"fields",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"multiple",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"validateEachItem",
validators:[
]
},
{
multiple:"true",
type:"Object",
name:"pickListFields",
validators:[
]
},
{
valueMap:{
json:"JSON serialisation",
none:"No transformation is applied to values",
simpleString:"Delimeter-separated string"
},
type:"string",
xmlAttribute:"true",
name:"multipleStorage",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"canFilter",
validators:[
]
},
{
type:"boolean",
name:"ignore",
validators:[
]
},
{
type:"boolean",
visibility:"internal",
name:"skipSerialization",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"unknownType",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"canSortClientOnly",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"tagName",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"childTagName",
validators:[
]
},
{
type:"boolean",
name:"basic",
validators:[
]
},
{
type:"boolean",
name:"recreateOnChange",
validators:[
]
},
{
type:"text",
name:"fieldDependencies",
validators:[
]
},
{
type:"integer",
name:"maxFileSize",
validators:[
]
},
{
title:"Frozen",
type:"boolean",
xmlAttribute:"true",
name:"frozen",
validators:[
]
},
{
editorType:"FormatEditorItem",
type:"string",
xmlAttribute:"true",
name:"format",
validators:[
]
},
{
type:"integer",
xmlAttribute:"true",
name:"precision",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"canExport",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"exportTitle",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"exportFormat",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"sqlStorageStrategy",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"encodeInResponse",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"mimeType",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"ignoreTextMatchStyle",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"lenientXPath",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"summaryFunction",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"includeSummaryFunction",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"joinString",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"joinPrefix",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"joinSuffix",
validators:[
]
},
{
type:"boolean",
name:"allowClientRequestedSummaries",
validators:[
]
},
{
type:"any",
xmlAttribute:"true",
name:"defaultValue",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"group",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"ID",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"inheritsFrom",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"javaClass",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"javaCollectionClass",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"javaKeyClass",
validators:[
]
},
{
valueMap:{
MD5:"Message Digest algorithm 5",
SHA:"Secure Hashing Algorithm (SHA-1)",
"SHA-256":"Secure Hashing Algorithm (SHA-256)",
"SHA-512":"Secure Hashing Algorithm (SHA-512)",
bcrypt:"Blowfish-based cipher 'bcrypt'",
none:"Force no hashing of the value"
},
type:"string",
xmlAttribute:"true",
name:"storeWithHash",
validators:[
]
},
{
type:"string",
name:"sqlDateFormat",
validators:[
]
},
{
type:"boolean",
name:"storeMilliseconds",
validators:[
]
},
{
valueMap:{
always:"Always audited",
change:"Only audited when value changed",
never:"Never audited"
},
type:"string",
xmlAttribute:"true",
name:"audit",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"initRequiresAuthentication",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"viewRequiresAuthentication",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"editRequiresAuthentication",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"updateRequiresAuthentication",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"initRequiresRole",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"viewRequiresRole",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"editRequiresRole",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"updateRequiresRole",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"initRequires",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"viewRequires",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"editRequires",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"updateRequires",
validators:[
]
},
{
type:"string",
name:"customSelectExpression",
validators:[
]
},
{
type:"string",
name:"customCriteriaExpression",
validators:[
]
},
{
type:"string",
name:"customInsertExpression",
validators:[
]
},
{
type:"string",
name:"customUpdateExpression",
validators:[
]
},
{
type:"boolean",
name:"customSQL",
validators:[
]
},
{
type:"boolean",
name:"autoQuoteCustomExpressions",
validators:[
]
},
{
type:"boolean",
name:"creatorOverrides",
validators:[
]
},
{
type:"string",
name:"valueWriteXPath",
validators:[
]
},
{
type:"boolean",
name:"useJoin",
validators:[
]
},
{
type:"string",
name:"tableName",
validators:[
]
},
{
type:"string",
name:"multipleStorageSeparator",
validators:[
]
},
{
type:"boolean",
name:"defineSQLColumnAsNotNull",
validators:[
]
},
{
type:"string",
name:"valueMapEnum",
validators:[
]
},
{
type:"string",
name:"sqlFalseValue",
validators:[
]
},
{
type:"string",
name:"sqlTrueValue",
validators:[
]
},
{
type:"string",
name:"sortByField",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"columnCode",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"stringInBrowser",
validators:[
]
},
{
type:"boolean",
xmlAttribute:"true",
name:"nillable",
validators:[
]
},
{
multiple:"true",
type:"string",
name:"validOperators",
validators:[
]
},
{
type:"string",
name:"fieldTypeProperty",
validators:[
]
},
{
type:"string",
name:"moveTo",
validators:[
]
},
{
type:"string",
name:"uploadFieldName",
validators:[
]
},
{
type:"string",
name:"batchUploadOperationId",
validators:[
]
},
{
type:"boolean",
name:"batchUploadCaseSensitive",
validators:[
]
},
{
type:"string",
name:"importStrategyFailedErrorMessage",
validators:[
]
},
{
type:"text",
xmlAttribute:"true",
name:"unionOf",
validators:[
]
},
{
type:"Object",
name:"fieldValueScript",
validators:[
]
},
{
type:"string",
name:"translatorClassName",
validators:[
]
},
{
type:"string",
valueMap:{
never:"Field is never delivered.",
single:"Field is delivered for a fetch by primary key and a cache sync data for update/insert operations.",
whenPresent:"Field is delivered as cache sync data only if the client seems to already have it for that record (present in dsRequest.values or oldValues)."
},
name:"outputWhen",
validators:[
]
}
],
xsi:"http://www.w3.org/2001/XMLSchema-instance"
})
isc.DataSource.create({
strictValidation:"false",
isServerDS:true,
allowAdvancedCriteria:true,
addGlobalId:"false",
ID:"Validator",
fields:[
{
type:"string",
xmlAttribute:"true",
name:"type",
validators:[
]
},
{
type:"string",
name:"name",
validators:[
]
},
{
type:"string",
name:"description",
validators:[
]
},
{
type:"boolean",
name:"stopIfFalse",
validators:[
]
},
{
type:"boolean",
name:"stopOnError",
validators:[
]
},
{
type:"boolean",
name:"validateOnChange",
validators:[
]
},
{
type:"boolean",
name:"clientOnly",
validators:[
]
},
{
type:"string",
name:"errorMessage",
validators:[
]
},
{
type:"float",
name:"max",
validators:[
]
},
{
type:"float",
name:"min",
validators:[
]
},
{
type:"boolean",
name:"exclusive",
validators:[
]
},
{
type:"text",
name:"mask",
validators:[
]
},
{
type:"text",
name:"transformTo",
validators:[
]
},
{
type:"integer",
name:"precision",
validators:[
]
},
{
type:"boolean",
name:"roundToPrecision",
validators:[
]
},
{
type:"string",
name:"expression",
validators:[
]
},
{
type:"string",
name:"otherField",
validators:[
]
},
{
multiple:"true",
type:"text",
name:"list",
validators:[
]
},
{
type:"ValueMap",
name:"valueMap",
validators:[
]
},
{
type:"text",
name:"substring",
validators:[
]
},
{
type:"text",
name:"operator",
validators:[
]
},
{
type:"integer",
name:"count",
validators:[
]
},
{
type:"AdvancedCriteria",
name:"applyWhen",
validators:[
]
},
{
multiple:"true",
type:"string",
name:"dependentFields",
validators:[
]
},
{
type:"string",
name:"scriptImport",
validators:[
]
},
{
type:"boolean",
name:"caseSensitive",
validators:[
]
},
{
type:"string",
name:"operationId",
validators:[
]
},
{
idAllowed:"true",
type:"Object",
name:"serverCondition",
validators:[
]
},
{
type:"ServerObject",
name:"serverObject",
validators:[
]
},
{
type:"string",
xmlAttribute:"true",
name:"fieldName",
validators:[
]
},
{
type:"string",
name:"triggerEvent",
validators:[
]
},
{
type:"any",
xmlAttribute:"true",
name:"value",
validators:[
]
},
{
type:"string",
name:"message",
validators:[
]
},
{
type:"string",
name:"severity",
validators:[
]
},
{
type:"string",
name:"displayMode",
validators:[
]
},
{
type:"integer",
name:"duration",
validators:[
]
},
{
type:"string",
name:"formula",
validators:[
]
},
{
type:"ValueMap",
name:"formulaVars",
validators:[
]
}
]
})
isc.DataSource.create({
inheritsFrom:"DataSourceField",
Constructor:"SimpleType",
isServerDS:true,
allowAdvancedCriteria:true,
addGlobalId:false,
ID:"SimpleType",
fields:[
{
name:"inheritsFrom",
type:"string",
validators:[
]
},
{
name:"editorType",
type:"string",
validators:[
]
}
]
})
isc.DataSource.create({
inheritsFrom:"DataSource",
Constructor:"XSComplexType",
isServerDS:true,
allowAdvancedCriteria:true,
addGlobalId:false,
ID:"XSComplexType",
fields:[
]
})
isc.DataSource.create({
inheritsFrom:"DataSource",
Constructor:"XSElement",
isServerDS:true,
allowAdvancedCriteria:true,
addGlobalId:false,
ID:"XSElement",
fields:[
]
})
isc.DataSource.create({
Constructor:"SchemaSet",
isServerDS:true,
allowAdvancedCriteria:true,
addGlobalId:false,
ID:"SchemaSet",
fields:[
{
name:"schemaNamespace",
type:"url",
validators:[
]
},
{
multiple:true,
name:"schemaImports",
type:"Object",
validators:[
]
},
{
name:"qualifyAll",
type:"boolean",
validators:[
]
},
{
multiple:true,
name:"schema",
type:"DataSource",
validators:[
]
}
]
})
isc.DataSource.create({
inheritsFrom:"DataSource",
Constructor:"WSDLMessage",
isServerDS:true,
allowAdvancedCriteria:true,
addGlobalId:false,
ID:"WSDLMessage",
fields:[
]
})
isc.DataSource.create({
Constructor:"WebService",
isServerDS:true,
allowAdvancedCriteria:true,
addGlobalId:false,
ID:"WebService",
fields:[
{
name:"location",
type:"url",
validators:[
]
},
{
name:"targetNamespace",
type:"url",
validators:[
]
},
{
multiple:true,
name:"schemaImports",
type:"Object",
validators:[
]
},
{
multiple:true,
name:"wsdlImports",
type:"Object",
validators:[
]
},
{
multiple:true,
name:"operations",
type:"WebServiceOperation",
validators:[
]
},
{
multiple:true,
name:"portTypes",
type:"Object",
validators:[
]
},
{
multiple:true,
name:"bindings",
type:"Object",
validators:[
]
},
{
multiple:true,
name:"messages",
type:"WSDLMessage",
validators:[
]
},
{
name:"globalNamespaces",
type:"Object",
validators:[
]
}
]
})
isc.DataSource.create({
isServerDS:true,
allowAdvancedCriteria:true,
addGlobalId:false,
ID:"WebServiceOperation",
fields:[
{
name:"name",
title:"Operation Name",
required:true,
validators:[
]
},
{
name:"soapAction",
title:"SOAPAction Header",
validators:[
]
},
{
name:"inputMessage",
title:"Input Message",
validators:[
]
},
{
name:"outputMessage",
title:"Output Message",
validators:[
]
},
{
multiple:true,
name:"inputHeaders",
type:"WSOperationHeader",
validators:[
]
},
{
multiple:true,
name:"outputHeaders",
type:"WSOperationHeader",
validators:[
]
}
]
})
isc.DataSource.create({
isServerDS:true,
allowAdvancedCriteria:true,
addGlobalId:false,
ID:"WSOperationHeader",
fields:[
{
name:"encoding",
validators:[
]
},
{
name:"message",
validators:[
]
},
{
name:"part",
validators:[
]
}
]
})
isc.defineClass("SavedSearches").addClassProperties({get:function(){{this.logWarn("Using the SavedSearches class requires SmartClient Pro or better. See https://www.smartclient.com/product/ to find the edition right for you.")}
return this.singleton},$239l:function(_1){if(isc.isA.String(_1))_1=isc.JSON.decode(_1);return _1},$239n:function(_1){_1=this.$239l(_1);if(_1&&_1._constructor=="AdvancedCriteria")return false;return true},$239m:function(_1){_1=this.$239l(_1);if(_1==null)return null;if(this.$239n(_1))return _1.userCriteria;return _1},clearSavedSearchCache:function(){var _1=this.getPrototype().$243y;for(var _2 in _1){var _3=_1[_2];if(_3)_3.destroy()}
this.addProperties({$243y:{}})},$243u:{}});isc.A=isc.SavedSearches.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.saveDefaultSearchToServer=false;isc.A.defaultDataSource=null;isc.A.offlineStorageKey="isc_savedSearch_";isc.A.savedSearchIDPrefix="SSID:";isc.A.logLocalDSRequests=false;isc.A.dataField="data";isc.A.primaryKeyField="pk";isc.A.searchNameField="searchName";isc.A.componentIdField="componentId";isc.A.projectIdField="projectId";isc.A.screenIdField="screenId";isc.A.applicationIdField="applicationId";isc.A.userIdField="userId";isc.A.adminField="admin";isc.A.defaultField="isDefault";isc.A.adminDefaultField="isSharedDefault";isc.A.applicationId=null;isc.A.allowNullApplicationId=false;isc.A.adminRole="admin";isc.A.setDefaultUserSearchOperation="setDefaultUserSearch";isc.A.lastSearchStorageKey="sc_lastSearch:";isc.A.defaultSearchStorageKey="sc_defaultSearch:";isc.A.setDefaultAdminSearchOperation="setDefaultAdminSearch";isc.A.$243y={};isc.A.$243z={};isc.A.$2430={};isc.A.$2431=0;isc.B.push(isc.A.savedSearchDataSourceHasField=function isc_SavedSearches_savedSearchDataSourceHasField(_1,_2){}
,isc.A.getDefaultDataSource=function isc_SavedSearches_getDefaultDataSource(){if(this.defaultDataSource!=null)return isc.DataSource.get(this.defaultDataSource)}
,isc.A.getSavedSearchDataSource=function isc_SavedSearches_getSavedSearchDataSource(_1){var _2=(_1.savedSearchDS!=null&&isc.DataSource.get(_1.savedSearchDS))||this.getDefaultDataSource();if(_2==null){if(_1.$246d==null){_1.$246d=this.getLocalDataSource(_1)}
_2=_1.$246d}
if(_1.adminSavedSearches||_1.adminSearches=="localOnly"){if(_1.$2522==null){_1.$2522=isc.SavedSearchFacadeDataSource.create({$145w:true,component:_1,inheritsFrom:_2
})}
_2=_1.$2522}
return _2}
,isc.A.canCreateAdminSavedSearches=function isc_SavedSearches_canCreateAdminSavedSearches(_1){var _2=this.getSavedSearchDataSource(_1);if(isc.isA.SavedSearchFacadeDataSource(_2))_2=_2.superDS();return _2&&!_2._generated&&!_2.clientOnly}
,isc.A.canChangeDefaultSavedSearch=function isc_SavedSearches_canChangeDefaultSavedSearch(_1){var _2=this.getSavedSearchDataSource(_1);if(isc.isA.SavedSearchFacadeDataSource(_2))_2=_2.superDS();return isc.isA.LocalDataSource(_2)||_2&&!_2.clientOnly}
,isc.A.getSavedSearchId=function isc_SavedSearches_getSavedSearchId(_1){if(isc.isA.String(_1))return _1;if(_1.savedSearchId!=null){return this.savedSearchIDPrefix+_1.savedSearchId}
var _2=_1.getLocalId(),_3=_1.getDataSource()
;if(isc.isA.DataSource(_3)&&_3.hasStableLocalID()&&_1.showSavedSearchesByDS){_2+=":"+_3.getID()}
return _2}
,isc.A.getSavedSearchIdForComponentOrDSRename=function isc_SavedSearches_getSavedSearchIdForComponentOrDSRename(_1,_2,_3){if(_1.savedSearchId||_2&&!_3.endsWith(":"+_2)){return _3}
var _4=_2?"$1:"+_1.getDataSource().getID():_1.getLocalId()+"$2";return _3.replace(/([A-Z0-9_$]+)(\:[A-Z0-9_$]+)?/i,_4)}
,isc.A.removeSavedSearchIdFromCache=function isc_SavedSearches_removeSavedSearchIdFromCache(_1){var _2=this.$243y[_1];if(_2)_2.destroy();delete this.$243y[_1]}
,isc.A.$2601=function isc_SavedSearches__clearCacheForComponentOrDSRename(_1,_2,_3){for(var _4 in this.$243y){if(_3?(_4.endsWith(":"+_2)):(_4==_2||_4.startsWith(_2+":")))
{this.removeSavedSearchIdFromCache(_4)}
}}
,isc.A.savedSearchIdUpdated=function isc_SavedSearches_savedSearchIdUpdated(_1,_2){}
,isc.A.targetDataSourceChanged=function isc_SavedSearches_targetDataSourceChanged(_1,_2){if(_1.isDrawn()&&_1.isVisible()){_1.clearTypeBasedAutoSSId();_1.$269l(false,_2||null);_1.$269k()}
if(_1.savedSearchId==null&&_1.showSavedSearchesByDS){isc.ss.savedSearchIdUpdated(_1,this.getSavedSearchId(_1))}}
,isc.A.getLocalDataSource=function isc_SavedSearches_getLocalDataSource(_1){var _2;if(isc.isA.Canvas(_1)){_2=_1;_1=this.getSavedSearchId(_1)}
if(_1==null){this.logWarn("getLocalDataSource() invoked with no componentID");return null}
var _3=this.$243t({$145w:true,transformRequest:function(_4){if(_4.doNotTrackRPC==null)_4.doNotTrackRPC=!isc.ss.logLocalDSRequests;return _4},_generated:true,$172n:_1,storageMode:"allRecords",storageKey:this.offlineStorageKey+_1
},_2);return _3}
,isc.A.$243t=function isc_SavedSearches__getLocalDataSource(_1,_2){}
,isc.A.getApplicationId=function isc_SavedSearches_getApplicationId(){if(this.applicationId!=null||this.allowNullApplicationId)return this.applicationId;return window.location.pathname}
,isc.A.setDefaultUserSearch=function isc_SavedSearches_setDefaultUserSearch(_1,_2,_3,_4){if(this.saveDefaultSearchToServer){var _5=this.getSavedSearchDataSource(_1);var _6=isc.addProperties({},_3);_6[this.defaultField]=_2;_5.updateData(_6,function(_9,_10,_11){var _7=_11.clientContext;if(_7.callback!=null){_7.target.delayCall("fireCallback",[_7.callback],200)}
},{operationId:this.setDefaultUserSearchOperation,clientContext:{target:this,callback:_4
}
}
)}else{if(!_2){this.$242k(_1)}else{var _8=this.savedSearchDataSourceHasField(_1,this.adminField)?_3[this.adminField]:!_3[this.userIdField];this.$2391(_1,(_8?"a:":"u:")+_3[this.searchNameField])}
this.fireCallback(_4)}}
,isc.A.$239y=function isc_SavedSearches__saveLastSearchNameToLocalStorage(_1,_2){isc.Offline.put(this.lastSearchStorageKey+this.getSavedSearchId(_1),_2)}
,isc.A.$2390=function isc_SavedSearches__loadLastSearchNameFromLocalStorage(_1){return isc.Offline.get(this.lastSearchStorageKey+this.getSavedSearchId(_1))}
,isc.A.$2391=function isc_SavedSearches__saveDefaultSearchNameToLocalStorage(_1,_2){isc.Offline.put(this.defaultSearchStorageKey+this.getSavedSearchId(_1),_2)}
,isc.A.$2392=function isc_SavedSearches__loadDefaultSearchNameFromLocalStorage(_1){return isc.Offline.get(this.defaultSearchStorageKey+this.getSavedSearchId(_1))}
,isc.A.$242k=function isc_SavedSearches__removeDefaultSearchNameFromLocalStorage(_1){isc.Offline.remove(this.defaultSearchStorageKey+this.getSavedSearchId(_1))}
,isc.A.setDefaultAdminSearch=function isc_SavedSearches_setDefaultAdminSearch(_1,_2,_3,_4){var _5=this.getSavedSearchDataSource(_1);var _6=isc.addProperties({},_3);_6[this.adminDefaultField]=_2;_5.updateData(_6,function(_8,_9,_10){var _7=_10.clientContext;if(_7.callback!=null){_7.target.fireCallback(_7.callback)}
},{operationId:this.setDefaultAdminSearchOperation,clientContext:{target:this,callback:_4
}
}
)}
,isc.A.findDefaultSearch=function isc_SavedSearches_findDefaultSearch(_1,_2){var _3;if(this.saveDefaultSearchToServer){var _4={};_4[this.defaultField]=true;var _5=_2.findAllMatches(_4);if(_5&&_5.length){if(_5.length>1){this.logWarn("found multiple server-stored defaults for current user - please check your setDefault operation on the server.  Using first.")}
_3=_5[0]}
}else{var _6=this;var _7=this.$2392(_1);if(_7){var _8=_7.startsWith("a:");_7=_7.substring(2);var _9=this.savedSearchDataSourceHasField(_1,this.adminField);_3=_2.find(function(_10){return _10[_6.searchNameField]==_7&&(_9?_10[_6.adminField]==_8:!_10[_6.userIdField]==_8)})}
}
if(!_3){var _4={};if(this.savedSearchDataSourceHasField(_1,this.adminField)){_4[this.adminDefaultField]=true;_4[this.adminField]=true}else{_4={_constructor:"AdvancedCriteria",operator:"and",criteria:[{fieldName:this.adminDefaultField,operator:"equals",value:true},{fieldName:this.userIdField,operator:"isNull"}
]
}}
var _5=_2.findAllMatches(_4);if(_5&&_5.length&&!_3){if(_5.length>1){this.logWarn("found multiple server-stored admin defaults.  Using first.")}
_3=_5[0]}
}
return _3}
,isc.A.getSavedSearchData=function isc_SavedSearches_getSavedSearchData(_1,_2){var _3=this;var _4=this.getSavedSearchId(_1);if(this.$243y[_4]!=null){this.$2433(_3.$243y[_4],_2)}else{var _5=this.getSavedSearchDataSource(_1),_6=this.$2432(_1);if(this.$243z[_4]!=null){this.$243z[_4].add(_2)}else{this.$243z[_4]=[_2];_5.fetchDataSynchronous(_6,function(_10,_11,_12){var _7=_3.$243y[_4]=isc.ResultSet.create({criteria:_6,dataSource:_5,initialData:_11
}
);var _8=_3.$243z[_4];delete _3.$243z[_4];for(var i=0;i<_8.length;i++){_3.$2433(_7,_8[i])}
},{warnOnAsync:false}
)}
}}
,isc.A.$2433=function isc_SavedSearches__fireSavedSearchDataCallback(_1,_2){var _3;if(_1==null||!_1.allMatchingRowsCached()){this.logWarn("Saved Search Callback fired before data has loaded - data may not be accurate");_3=[]}else{_3=_1.getRange(0,_1.getLength())}
this.fireCallback(_2,"data,callback",[_3,_2])}
,isc.A.$2434=function isc_SavedSearches__getAdminRecordCriteria(_1,_2){var _3=this.savedSearchDataSourceHasField(_1,this.adminField)?{fieldName:this.adminField,operator:"equals",value:true
}:{fieldName:this.userIdField,operator:"isNull"
};if(!_2)_3._constructor="AdvancedCriteria";return _3}
,isc.A.$2523=function isc_SavedSearches__getNonAdminRecordCriteria(_1,_2){var _3=this.savedSearchDataSourceHasField(_1,this.adminField)?{fieldName:this.adminField,operator:"notEqual",value:true
}:{fieldName:this.userIdField,operator:"notNull"
};if(!_2)_3._constructor="AdvancedCriteria";return _3}
,isc.A.$2432=function isc_SavedSearches__getSavedSearchCriteria(_1){var _2={_constructor:"AdvancedCriteria",operator:"and",criteria:[]
};var _3=_1.getSavedSearchId();_2.criteria.add({fieldName:this.componentIdField,operator:"equals",value:_3
});var _4=_1.getProjectId&&_1.getProjectId();if(_4)_2.criteria.add({fieldName:this.projectIdField,operator:"equals",value:_4
});var _5=_1.getScreenId&&_1.getScreenId();if(_5)_2.criteria.add({fieldName:this.screenIdField,operator:"equals",value:_5
});var _6=this.getApplicationId();if(_6)_2.criteria.add({fieldName:this.applicationIdField,operator:"equals",value:_6
});var _7={_constructor:"AdvancedCriteria",operator:"or",criteria:[]
};var _8=this.getSavedSearchDataSource(_1);var _9=isc.Authentication.getCurrentUserId();if(_9==null&&!isc.isA.LocalDataSource(_8)){this.logWarn("isc.Authentication.getCurrentUserId() is null, but savedSearchDS appears to persist to server - likely will be rejected by authorization checks on server.")}
if(_9)_7.criteria.add({fieldName:this.userIdField,operator:"equals",value:_9
});_7.criteria.add(this.$2434(_1,true));var _10={_constructor:"AdvancedCriteria",operator:"and",criteria:[_2,_7
]
};return _10}
,isc.A.applySearch=function isc_SavedSearches_applySearch(_1,_2,_3,_4){var _5=_2[this.dataField];var _6=isc.isA.ListGrid(_1)?_1:null;var _7=isc.SavedSearches.$239l(_5),_8=isc.SavedSearches.$239m(_7);if(_6){var _9=isc.SavedSearches.$239n(_7);if(_9&&_3!="criteria"){_6.setViewState(_5)}else{if(_8=="[No Criteria]"){_6.clearFilterValues();_6.handleFilterEditorSubmit({})}else{_6.setUserCriteriaState(_8)}
}
}else{if(_8=="[No Criteria]")_8={};_1.fetchData(_8)}
var _10=_2[this.searchNameField];if(_4)this.$239y(_1,_10)}
,isc.A.suspendDefaultComponentFetch=function isc_SavedSearches_suspendDefaultComponentFetch(_1){return _1.deferInitialFetch()}
,isc.A.restoreDefaultComponentFetch=function isc_SavedSearches_restoreDefaultComponentFetch(_1,_2,_3,_4){if(_1.$p7){if(!isc.SavedSearches.$2435){this.logWarn("SavedSearches has loaded saved fetches for component: "+_1.getLocalId()
+". This component has already fired it's initial fetch. Any restored last or default criteria will be applied as a follow-on to this fetch. If you are using a SavedSearchItem, this can occur when the item is passed the targetComponent after targetComponent.draw(). Consider providing the targetComponent to this SavedSearchItem earlier in your code flow for efficiency and avoid an unnecessary extra fetch.");isc.SavedSearches.$2435=true}
}
if(_1.$241r){_1.undeferInitialFetch(_2==null)}
if(_2){this.applySearch(_1,_2,_3,_4)}}
,isc.A.registerSavedSearchChangeCallback=function isc_SavedSearches_registerSavedSearchChangeCallback(_1,_2){var _3=this.getSavedSearchDataSource(_1),_4=this.getSavedSearchId(_1);if(!_3)return;if(!this.isObserving(_3,"dataChanged")){this.observe(_3,"dataChanged","observer.dataSourceDataChanged(observed, dsResponse, dsRequest);")}
var _4="_"+this.$2431++;if(this.$2430[_3.getID()]==null){this.$2430[_3.getID()]={}}
this.$2430[_3.getID()][_4]=_2;return _4}
,isc.A.unRegisterSavedSearchChangeCallback=function isc_SavedSearches_unRegisterSavedSearchChangeCallback(_1,_2){var _3=this.getSavedSearchDataSource(_1);if(this.$2430[_3.getID()]==null)return;delete this.$2430[_3.getID()][_2];if(isc.isAn.emptyObject(this.$2430[_3.getID()])){this.ignore(_3,"dataChanged");delete this.$2430[_3.getID()]}}
,isc.A.dataSourceDataChanged=function isc_SavedSearches_dataSourceDataChanged(_1,_2,_3){var _4=this.$2430[_1.getID()];if(_4!=null){for(var _5 in _4){this.fireCallback(_4[_5],"dsResponse,dsRequest",[_2,_3])}
}}
);isc.B._maxIndex=isc.C+33;isc.ClassFactory.defineInterface("SavedSearchesList");isc.SavedSearchesList.addInterfaceMethods({processData:function(_1){if(_1==null)return null;var _2=isc.ss,_3=_2.searchNameField,_4=this.targetComponent||this;var _5;if(this.saveLastSearch){var _6=_2.$2390(_4);if(_6){this.logDebug("found lastSearchName in local storage: "+_6);_5=_1.find(_3,_6)}
}
var _7=_2.findDefaultSearch(_4,_1);for(var i=0;i<_1.getLength();i++){var _9=_1.get(i);_9.$243r=(_9==_7)}
if(_5==null&&this.saveDefaultSearch){_5=_7}
var _10=_2.$2434(_4);var _11=_1.findAllMatches(_10);if(_11&&_11.length){_11.setProperty("$245x",true);if(_11.length!=_1.getLength()){var _12=this.getAdminSeparatorRecordDef({$2398:true
});_1.add(_12);var _13=[];if(_2.savedSearchDataSourceHasField(_4,_2.adminField)){_13.add({direction:"descending",property:_2.adminField,normalizer:function(_14,_15,_16){if(!_14||_14[_15]==null)return false;return _14[_15]}
})}
_13.add({direction:"ascending",property:_2.userIdField});_13.add({direction:"ascending",property:"$2398"});_1.setSort(_13)}
}
return _5},isDefaultSearch:function(_1){return _1.$243r==true},adminSeparatorRecordDefaults:{isSeparator:true
},getAdminSeparatorRecordDef:function(_1){return isc.addProperties({},this.adminSeparatorRecordDefaults,this.adminSeaparatorRecordProperties,_1)},removeSearchIcon:"[SKIN]/actions/remove.png",removeSearchIconSize:16,removeSearchHoverText:"Remove search",copySearchIcon:"[SKIN]/RichTextEditor/copy.png",copySearchIconSize:16,copySearchHoverText:"Copy search",markAsDefaultSearchIcon:null,markAsDefaultSearchIconSize:16,markAsDefaultHoverText:"Set as default search",markAsAdminDefaultHoverText:"Set as default view for all users<br><br><i>[May be overridden by users' own preferences.]</i>",defaultSearchNameSuffix:"<i>[default]</i>",_actionFieldDefaults:{width:24,showDefaultContextMenu:false,selectCellTextOnClick:false,canEdit:false,canHide:false,canSort:false,canGroupBy:false,canFilter:false,showTitle:false,canExport:false,autoFitWidth:true,canDragResize:false,canAutoFitWidth:false,ignoreKeyboardClicks:true,showGridSummary:false,showGroupSummary:false,summaryValue:"&nbsp;",treeField:false,featureField:true
},getSetDefaultFieldDef:function(_1){var _2=this;return isc.addProperties({name:"_defaultSearch",type:"boolean",canToggle:false,showHover:true,hoverHTML:function(_5,_6,_7,_8){if(_5.$241m)return isc.nbsp;if(_5[this.name]!==true){return _2.markAsDefaultHoverText}
return null},getCellValue:function(_5,_6,_7,_8,_9,_10){return _6.$243r==true},recordClick:function(_5,_6,_7,_8,_9,_10,_11){if(_6.omitSetDefaultIcon){return null}
var _3=this.getCellValue(_5,_6,_7,_9);var _4=_2.targetComponent||_2;isc.ss.setDefaultUserSearch(_4,!_3,_6,function(){_2.defaultSearchChanged()}
);return false}
},this._actionFieldDefaults,this.markAsDefaultSearchFieldDefaults,this.markAsDefaultSearchFieldProperties,_1)},defaultSearchChanged:function(){},isAdminSearch:function(_1){var _2=this.targetComponent||this,_3=isc.ss.getSavedSearchDataSource(_2),_4=isc.ss.$2434(_2);return _3.recordMatchesFilter(_1,_4)},isAdminUser:function(){var _1=this.adminRole||isc.ss.adminRole;return isc.Auth&&isc.Auth.hasRole(_1)},$2439:function(){return isc.ss.savedSearchDataSourceHasField((this.targetComponent||this),isc.ss.adminDefaultField)},getSetAdminDefaultFieldDef:function(_1){var _2=this;return isc.addProperties({name:"_defaultAdminSearch",type:"boolean",canToggle:false,showHover:true,hoverHTML:function(_5,_6,_7,_8){if(_5.$241m)return isc.nbsp;if(!_2.isAdminSearch(_5))return isc.nbsp;if(_5[this.name]!==true){return _2.markAsAdminDefaultHoverText}
return null},getCellValue:function(_5,_6,_7,_8,_9,_10){if(!_2.isAdminSearch(_6))return"&nbsp;";return _6[isc.ss.adminDefaultField]==true},recordClick:function(_5,_6,_7,_8,_9,_10,_11){if(_6.omitSetDefaultIcon){return null}
if(!_2.isAdminSearch(_6))return null;var _3=this.getCellValue(_5,_6,_7,_9);var _4=_2.targetComponent||_2;isc.ss.setDefaultAdminSearch(_4,!_3,_6,function(){_2.defaultAdminSearchChanged()}
);return false}
},this._actionFieldDefaults,this.markAsAdminDefaultSearchFieldDefaults,this.markAsAdminDefaultSearchFieldProperties,_1)},defaultAdminSearchChanged:function(){},getSearchNameFieldDef:function(_1){var _2=this;return isc.addProperties({formatCellValue:function(_3,_4,_5,_6,_7){if(_2.isDefaultSearch(_4)){_3+=" "+_2.defaultSearchNameSuffix}
return _3},escapeHTML:false,baseStyle:"menuTitleField",name:isc.ss.searchNameField,width:100,autoFitWidth:true
},_1)},confirmRemoval:true,confirmRemovalMessage:"Remove saved view '${title}'?",getRemoveFieldDef:function(_1){var _2=this;return isc.addProperties({name:"_removeSearchField",type:"icon",iconSize:this.removeSearchIconSize,showHover:true,hoverHTML:function(_6,_7,_8,_9,_10){if(_6.$241m)return isc.nbsp;if(_6[_10.recordCanRemoveProperty]==false)return isc.nbsp;return _2.removeSearchHoverText},formatCellValue:function(_6,_7,_8,_9,_10){if(_2.canModifyProperty&&_7[_2.canModifyProperty]===false)return isc.nbsp;if(_7.$241m)return isc.nbsp;if(_7[_10.recordCanRemoveProperty]==false)return isc.nbsp;if(_7.$245x&&!_2.isAdminUser())return isc.nbsp;var _3=isc.Canvas.imgHTML({src:_2.removeSearchIcon,width:_2.removeSearchIconSize,height:_2.removeSearchIconSize,extraCSSText:"cursor:"+isc.Canvas.POINTER_OR_HAND
});return _3},recordClick:function(_6,_7,_8,_9,_10,_11,_12){if(_7.$241m)return false;if(_7[_6.recordCanRemoveProperty]==false)return false;if(_2.canModifyProperty&&_7[_2.canModifyProperty]===false)return false;var _4=_7[isc.ss.searchNameField],_5=_2.confirmRemovalMessage.evalDynamicString(this,{title:_4});isc.ask(_5,function(_13){if(_13)_6.removeRecordClick(_8,_10)},{buttons:[isc.Dialog.NO,isc.Dialog.YES],autoFocusButton:1
}
);return false}
},this._actionFieldDefaults,this.removeSearchFieldDefaults,this.removeSearchFieldProperties,_1)},editSearchWindow:null,editSearchWindowDefaults:{_constructor:"EditSearchWindow"
},showEditSearchWindow:function(_1){var _2=this,_3=this.getNewRecordValues()
;if(this.projectId||this.screenId){_3=isc.addProperties({},_3,{projectId:this.projectId,screenId:this.screenId
})}
var _4=this.createAutoChild("editSearchWindow",isc.addProperties({},{passThroughProps:isc.addProperties({originComponent:this,mode:this.getTargetEditsCriteria()?"grid":"normal",operation:"add",targetComponent:this.targetComponent,targetDataSource:this.targetDataSource,savedSearchDS:this.savedSearchDS,newRecordValues:_3,isAdmin:this.isAdmin,storedState:this.storedState
},_1),editComplete:function(_5){_2.editComplete(_5)}
}));_4.show()},getNewRecordValues:function(){return this.newRecordValues},editComplete:function(_1){if(_1){var _2=_1[isc.ss.searchNameField];var _3=(this.editingOn&&this.editContext&&this.editContext.isReify);if(_3){var _4=[{title:"undo",separator:"&nbsp;",target:this,methodName:"removeSavedSearch",argNames:["record"],args:[_1]
}];isc.Notify.addMessage("Created "+_2+" as an Admin search (appears for all users of you application).",_4,null,{duration:5000})}
}
},removeSavedSearch:function(_1){var _2=_1[isc.ss.searchNameField];this.savedSearchDS.removeData(_1);isc.Notify.dismissMessage("message");isc.Notify.addMessage("Removed Admin search "+_2,null,null,{maxStackSize:1})},targetEditsCriteria:null,getTargetEditsCriteria:function(){if(this.targetEditsCriteria!=null)return this.targetEditsCriteria;if(this.targetComponent){return isc.isA.ListGrid(this.targetComponent)||isc.isA.TreeGrid(this.targetComponent)
||(isc.CubeGrid&&isc.isA.CubeGrid(this.targetComponent))}
return null}});isc.ClassFactory.mixInInterface("SavedSearchItem","SavedSearchesList");isc.defineClass("SavedSearchFacadeDataSource",isc.DataSource);isc.A=isc.SavedSearchFacadeDataSource;isc.A.LOCAL_PK_START_INDEX=10000;isc.A=isc.SavedSearchFacadeDataSource.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.dataProtocol="clientCustom";isc.A.dropExtraFields=true;isc.A.allowFieldValueExpressions=false;isc.A.nextLocalPK=isc.SavedSearchFacadeDataSource.LOCAL_PK_START_INDEX;isc.A.updatedLocalPKMap={};isc.A.replacedLocalPKMap={};isc.B.push(isc.A.init=function isc_SavedSearchFacadeDataSource_init(){var _1=this.component;var _2=isc.ss.getSavedSearchId(_1);isc.ss.removeSavedSearchIdFromCache(_2);if(_1.adminSavedSearches){var _3=isc.ss.primaryKeyField,_4=isc.ss.userIdField,_5=_1.adminSearches
;var _6=_1.getScreenId(),_7=_1.getProjectId(),_8=isc.ss.getApplicationId()
;var _9=isc.ss.screenIdField,_10=isc.ss.projectIdField,_11=isc.ss.applicationIdField
;var _12=0,_13=_1.adminSavedSearches;if(this.dropExtraFields)_13=_13.duplicate();else _13=isc.shallowClone(_13);for(var i=0;i<_13.length;i++){var _15=this.validateJSONRecord(_13[i]),_16=_15[_3];if(_16!=null&&_16>=this.nextLocalPK){if(_12<_16)_12=_16;_13[i]=_15}else{_1.logWarn("skipping adminSavedSearches record with bad PK: "+_16);_13.removeAt(i);continue}
if(_6)_15[_9]=_6;if(_7)_15[_10]=_7;if(_8)_15[_11]=_8;if(!_15[_4])_15[_4]=null}
_1.adminSavedSearches=_13;if(_12)this.nextLocalPK=_12+1;this.applyAdminSearchesMode(_5)}
this.Super("init",arguments)}
,isc.A.applyAdminSearchesMode=function isc_SavedSearchFacadeDataSource_applyAdminSearchesMode(_1){var _2=this.component,_3=_2.adminSavedSearches;if(_3){switch(_1){case"localOnly":this.updatedLocalPKMap={};this.replacedLocalPKMap={};_3.clearProperty("_canRemove");break;case"preferLocal":case"preferSaved":_3.setProperty("_canRemove",false);break}
}
}
,isc.A.isAdminSearch=function isc_SavedSearchFacadeDataSource_isAdminSearch(_1){var _2=this.component,_3=isc.ss.$2434(_2);return this.recordMatchesFilter(_1,_3)}
,isc.A.didIsAdminSearchChangeTo=function isc_SavedSearchFacadeDataSource_didIsAdminSearchChangeTo(_1,_2){var _3,_4,_5=isc.ss.adminField;if(isc.ss.savedSearchDataSourceHasField(this.component,_5)){if(_1[_5]!==_3)_4=_1[_5]==true}else{var _6=isc.ss.userIdField;if(_1[_6]!==_3)_4=_1[_6]==null}
return _4==_2}
,isc.A.createErrorResponse=function isc_SavedSearchFacadeDataSource_createErrorResponse(_1,_2){var _3={};_3[_1]={severity:"ERROR",errorMessage:_2};return{status:isc.RPCResponse.errorCodes.STATUS_VALIDATION_ERROR,errors:[_3]
}}
,isc.A.$2524=function isc_SavedSearchFacadeDataSource__getSingleResponseRecord(_1){return isc.isAn.Array(_1)?_1[0]:_1}
,isc.A.transformRequest=function isc_SavedSearchFacadeDataSource_transformRequest(_1){var _2=_1.operationType;if(_2!="fetch"){var _3=this.$2525(_1);if(_3){if(_1.synchronousCallback){this.processResponse(_1.requestId,_3)}else{this.delayCall("processResponse",[_1.requestId,_3],0)}
return _1.data}
}
return this.$2526(_1)}
,isc.A.$253g=function isc_SavedSearchFacadeDataSource__getCollidingLocalSearch(_1){if(!this.isAdminSearch(_1))return;var _2=this.component,_3=_2.adminSavedSearches;if(!_3)return;var _4=isc.ss.searchNameField;return _3.find(_4,_1[_4])}
,isc.A.$253q=function isc_SavedSearchFacadeDataSource__localOnlySetDefaultAdminSearch(_1,_2){var _3=this.component,_4=_3.adminSavedSearches;if(!_4)return;var _5=isc.ss.adminDefaultField,_6=isc.ss.primaryKeyField,_7=[]
;for(var i=0;i<_4.length;i++){var _9=_4[i],_10=_9[_6];if(_9[_5]&&_10!=_2){delete _9[_5];_7.add(isc.addProperties({},_9))}
}
if(_7.length)_1.relatedUpdates=[{status:0,operationType:"update",dataSource:this,data:_7
}]}
,isc.A.$2525=function isc_SavedSearchFacadeDataSource__performSelfDSOperation(_1){var _2=_1.data,_3=_1.operationType,_4=this.component,_5=_4.adminSearches,_6=this.updatedLocalPKMap,_7=this.replacedLocalPKMap,_8=_4.adminSavedSearches
;var _9=isc.ss.userIdField,_10=isc.ss.searchNameField,_11=isc.ss.primaryKeyField
;var _12;switch(_3){case"add":if(_8){var _13=this.$253g(_2);if(_13&&_7[_13[_11]]!=false){_12=this.createErrorResponse(_10,"Cannot add a new record with a duplicate value in the "+_10+" field.  Choose a different search name for your new record.")}
}
if(!_12&&_5=="localOnly"&&this.isAdminSearch(_2)){_2=isc.addProperties({},_2);_2[_11]=this.nextLocalPK++;if(!_2[_9])delete _2[_9];if(!_8){_8=_4.adminSavedSearches=[]}
_8.add(_2);_12={data:[isc.addProperties({},_2)],status:0
};if(_1.operationId=="setDefaultAdminSearch"){this.$253q(_12)}
}
break;case"update":case"remove":var _14=_2[_11];if(_14==null){_12=this.createErrorResponse(_11,"Cannot update or remove a record without pk field ('"+_11+"') value")}else{_12=_3=="update"?this.$2527(_2,_8,_5,_1):this.$2528(_2,_8,_5,_1);if(!_12&&_14>=this.getClass().LOCAL_PK_START_INDEX&&(_5=="localOnly"||_3=="remove"&&!_6[_14]))
{var _15=null,_16=0,_17=_8.findIndex(_11,_14);if(_17>=0){if(_3=="update"){var _18=_8[_17];_2=isc.addProperties({},_18,_2);if(!_2[_9])delete _2[_9];_8[_17]=_2}else{if(_5=="preferSaved"){_7[_14]=false}else{_8.removeAt(_17)}
}
_16++}
_15=[isc.addProperties({},_2)];_12={affectedRows:_16,data:_15,status:0
};if(_1.operationId=="setDefaultAdminSearch"){this.$253q(_12,_14)}
}
}
break}
if(_12&&_12.data&&_4.editingOn&&_4.editContext){var _19=isc.ss.screenIdField,_20=isc.ss.projectIdField,_21=isc.ss.applicationIdField
;var _22=isc.shallowClone(_4.adminSavedSearches);if(_22)for(var i=0;i<_22.length;i++){var _2=_22[i];delete _2[_19];delete _2[_20];delete _2[_21]}
_4.editContext.setNodeProperties(_4.editNode,{adminSavedSearches:_22},true)}
return _12}
,isc.A.$2527=function isc_SavedSearchFacadeDataSource__validateUpdateRecord(_1,_2,_3){var _4=isc.ss.primaryKeyField,_5=_1[_4];if(_5>=this.getClass().LOCAL_PK_START_INDEX){if(_3=="preferLocal"){return this.createErrorResponse(_4,"Cannot update local admin searches in 'preferLocal' mode")}
if(this.didIsAdminSearchChangeTo(_1,false)){return this.createErrorResponse(_4,"Cannot change local admin searches to non-admin searches")}
}else{switch(_3){case"localOnly":if(this.didIsAdminSearchChangeTo(_1,true)){return this.createErrorResponse(_4,"Cannot change non-local searches to admin searches in 'localOnly' mode")}
break}
}
}
,isc.A.$253h=function isc_SavedSearchFacadeDataSource__getReplacedLocalSearchPK(_1){var _2=this.replacedLocalPKMap;for(var _3 in _2){if(_1==_2[_3]){return _3}
}
}
,isc.A.$253r=function isc_SavedSearchFacadeDataSource__getUpdatedLocalSearchPK(_1){var _2=this.updatedLocalPKMap;for(var _3 in _2){if(_1==_2[_3]){return _3}
}
}
,isc.A.$2528=function isc_SavedSearchFacadeDataSource__validateRemoveRecord(_1,_2,_3,_4){var _5=isc.ss.primaryKeyField,_6=_1[_5]
;if(_6>=this.getClass().LOCAL_PK_START_INDEX){if(_3=="preferLocal"||_3=="preferSaved"&&!_4.removeBeforeAdd){return this.createErrorResponse(_5,"Local admin searches can only be removed in 'localOnly' mode")}
}else if(this.$253h(_6)&&!_4.removeBeforeAdd){return this.createErrorResponse(_5,"Local admin searches can only be removed in 'localOnly' mode")}
}
,isc.A.$2526=function isc_SavedSearchFacadeDataSource__transformRequest(_1){var _2=_1.operationId,_3=_1.operationType,_4=this.component,_5=_4.adminSearches
;var _6=this,_7=isc.DataSource.get(this.inheritsFrom),_8=_6.cloneDSRequest(_1),_9=isc.ss.primaryKeyField,_10=this.replacedLocalPKMap,_11=this.updatedLocalPKMap,_12,_13
;switch(_3){case"fetch":if(_5=="localOnly"){_8.data=_7.combineCriteria(_8.data,isc.ss.$2523(_4))}
break;case"add":if(_5=="preferSaved"){var _14=_8.data,_15=this.$253g(_14);if(_15){_12=_15[_9];_10[_12]=true}
}
break;case"remove":case"update":var _14=_8.data;_13=_14[_9];if(_13>=this.getClass().LOCAL_PK_START_INDEX){if(_3=="update"){var _16=_11[_13];if(_16){_14[_9]=_16}else{var _17=_4.adminSavedSearches,_18=_17.find(_9,_13)
;_8.operationType="add";_14=isc.addProperties({},_18,_14);delete _14[_9];_8.data=_14}
}else if(_5=="preferSaved"){_14[_9]=_11[_13];_10[_13]=false;delete _11[_13]}
}else if(_3=="remove"&&_5=="preferSaved"){var _19=this.$253h(_13);if(_19)_10[_19]=false}
break}
var _20=this;_8.showPrompt=false;_8.callback=function(_27,_28,_8){var _21=_7.cloneDSResponse(_27);if(_3=="fetch"){_6.$2529(_21,_1)}else{var _22=_6.$2524(_21.data);switch(_3){case"add":if(_22&&_12){_10[_12]=_22[_9];_22._canRemove=false}
break;case"remove":if(_22&&_13>=_20.getClass().LOCAL_PK_START_INDEX){_22[_9]=_13}
break;case"update":if(_22){if(_8.operationType=="add"){_11[_13]=_22[_9]}
if(_11[_13])_22[_9]=_13;var _23=_6.$2524(_1.data);isc.addDefaults(_22,_23)}
break}
var _24=_27.relatedUpdates;if(_7.clientOnly&&_2=="setDefaultAdminSearch"){var _25=_6.$2524(_27.data);_24=_20.$253s(_25)}
if(_24)_20.$253t(_21,_24)}
_6.processResponse(_1.requestId,_21)};var _26=isc.RPCManager.startQueue();if(_2=="setDefaultAdminSearch"&&_5!="localOnly"){this.$253u(_1.data)}
_7.execute(_8);if(!_26)isc.RPCManager.sendQueue();return _1.data}
,isc.A.$253u=function isc_SavedSearchFacadeDataSource__clearLocalDefaultAdminSearches(_1){var _2=this.component,_3=_2.adminSavedSearches;if(!_3)return;var _4=this.updatedLocalPKMap,_5=this.replacedLocalPKMap,_6=isc.ss.primaryKeyField,_7=isc.ss.adminDefaultField
;for(var i=0;i<_3.length;i++){var _9=_3[i];if(!_9[_7])continue;var _10=_9[_6];if(_10!=_1[_6]&&!_4[_10]&&!_5[_10]){var _11=isc.addProperties({},_9);_11[_7]=false;this.updateData(_11);break}
}
}
,isc.A.$253s=function isc_SavedSearchFacadeDataSource__handleSetDefaultAdminSearch(_1){var _2=isc.ss.primaryKeyField,_3=isc.ss.adminDefaultField
;var _4=isc.ss.$2432(this.component),_5=this.combineCriteria(_4,{_constructor:"AdvancedCriteria",operator:"and",criteria:[{fieldName:_3,operator:"equals",value:true
},{fieldName:_2,operator:"notEqual",value:_1[_2]
}]
});var _6=isc.DataSource.get(this.inheritsFrom),_7=_6.fetchDataSynchronous(_5);if(!_7.totalRows)return;var _8=this.$2524(_7.data);_8[_3]=false;_6.updateData(_8);return[{status:0,operationType:"update",dataSource:this,data:_7.data
}]}
,isc.A.$253t=function isc_SavedSearchFacadeDataSource__addRelatedUpdates(_1,_2){var _3=_2[0];if(!_3)return;var _4=isc.DataSource.get(this.inheritsFrom),_5=isc.ss.primaryKeyField
;var _6=_4.cloneDSResponse(_3);_6.dataSource=this;var _7=_6.data;for(var i=0;i<_7.length;i++){var _9=_7[i];var _10=this.$253r(_9[_5]),_11=this.$253h(_9[_5]);if(_10||_11)_9._canRemove=false;if(_10)_9[_5]=_10}
if(_7.length)_1.relatedUpdates=[_6]}
,isc.A.$2529=function isc_SavedSearchFacadeDataSource__mergeLocalSearchesWithData(_1,_2){var _3=this.component,_4=_3.adminSavedSearches;_4=this.applyFilter(_4,_2.data,_2);if(!_4.length)return;delete _1.totalRows;delete _1.startRow;delete _1.endRow;var _5=_1.data,_6=_3.adminSearches
;if(_6=="localOnly"){_4.addList(_5);_1.data=_4;return}
var _7=isc.ss.primaryKeyField,_8=isc.ss.searchNameField
;var _9={};for(var i=0;i<_4.length;i++){var _11=_4[i];_9[_11.searchName]=_11}
_4=[];var _12=this.updatedLocalPKMap,_13=this.replacedLocalPKMap
;var _14=_1.data=[];for(var i=0;i<_5.length;i++){var _11=_5[i];if(this.isAdminSearch(_11)){switch(_6){case"preferLocal":if(_9[_11[_8]]){continue}
break;case"preferSaved":var _15=_9[_11[_8]];if(_15){delete _9[_11[_8]];var _16=_11[_7],_17=_15[_7]
;_13[_17]=_16;delete _12[_17];_11._canRemove=false}
break}
}
_14.add(_11)}
for(var _18 in _9){_4.add(isc.addProperties({},_9[_18]))}
_14.addListAt(_4,0)}
);isc.B._maxIndex=isc.C+19;isc.ss=isc.SavedSearches.get();if(isc.Menu!=null){isc.defineClass("SavedSearchMenu","Menu","SavedSearchesList");isc.A=isc.SavedSearchMenu.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.getDefaultFields=function isc_SavedSearchMenu_getDefaultFields(){var _1=[],_2=this.targetComponent
;if(isc.ss.canChangeDefaultSavedSearch(_2)){if(!(_2&&_2.editingOn&&_2.editContext&&_2.editContext.isReify)){_1.add(this.getSetDefaultFieldDef())}
if(this.isAdminUser()&&this.$2439()){_1.add(this.getSetAdminDefaultFieldDef())}
}
_1.add(this.getSearchNameFieldDef());_1.add(this.getRemoveFieldDef());return _1}
,isc.A.initWidget=function isc_SavedSearchMenu_initWidget(){this.fields=this.getDefaultFields();return this.Super("initWidget",arguments)}
,isc.A.rebuildFields=function isc_SavedSearchMenu_rebuildFields(){this.setFields(this.getDefaultFields())}
);isc.B._maxIndex=isc.C+3}
isc.defineClass("Operators","Class");isc.A=isc.Operators;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.noDataSourceDescription="(No DataSource)";isc.A.equalsTitle="equals (match case)";isc.A.iEqualsTitle="equals";isc.A.notEqualTitle="not equal (match case)";isc.A.iNotEqualTitle="not equal";isc.A.greaterThanTitle="greater than";isc.A.lessThanTitle="less than";isc.A.greaterOrEqualTitle="greater than or equal to";isc.A.lessOrEqualTitle="less than or equal to";isc.A.betweenTitle="between (match case)";isc.A.iBetweenTitle="between";isc.A.betweenInclusiveTitle="between (inclusive, match case)";isc.A.iBetweenInclusiveTitle="between (inclusive)";isc.A.startsWithTitle="starts with (match case)";isc.A.iStartsWithTitle="starts with";isc.A.endsWithTitle="ends with (match case)";isc.A.iEndsWithTitle="ends with";isc.A.containsTitle="contains (match case)";isc.A.iContainsTitle="contains";isc.A.notContainsTitle="does not contain (match case)";isc.A.iNotContainsTitle="does not contain";isc.A.notStartsWithTitle="does not start with (match case)";isc.A.iNotStartsWithTitle="does not start with";isc.A.notEndsWithTitle="does not end with (match case)";isc.A.iNotEndsWithTitle="does not end with";isc.A.regexpTitle="matches expression (match case)";isc.A.iregexpTitle="matches expression";isc.A.matchesPatternTitle="matches pattern (match case)";isc.A.iMatchesPatternTitle="matches pattern";isc.A.containsPatternTitle="contains pattern (match case)";isc.A.iContainsPatternTitle="contains pattern";isc.A.equalsFieldTitle="matches other field (match case)";isc.A.iEqualsFieldTitle="matches other field";isc.A.notEqualFieldTitle="differs from field (match case)";isc.A.iNotEqualFieldTitle="differs from field";isc.A.greaterThanFieldTitle="greater than field";isc.A.lessThanFieldTitle="less than field";isc.A.greaterOrEqualFieldTitle="greater than or equal to field";isc.A.lessOrEqualFieldTitle="less than or equal to field";isc.A.containsFieldTitle="contains another field value (match case)";isc.A.iContainsFieldTitle="contains another field value";isc.A.startsWithFieldTitle="starts with another field value (match case)";isc.A.iStartsWithFieldTitle="starts with another field value";isc.A.endsWithFieldTitle="ends with another field value (match case)";isc.A.iEndsWithFieldTitle="ends with another field value";isc.A.notContainsFieldTitle="does not contain another field value (match case)";isc.A.iNotContainsFieldTitle="does not contain another field value";isc.A.notStartsWithFieldTitle="does not start with another field value (match case)";isc.A.iNotStartsWithFieldTitle="does not start with another field value";isc.A.notEndsWithFieldTitle="does not end with another field value (match case)";isc.A.iNotEndsWithFieldTitle="does not end with another field value";isc.A.startsWithPatternTitle="starts with pattern (match case)";isc.A.iStartsWithPatternTitle="starts with pattern";isc.A.endsWithPatternTitle="ends with pattern (match case)";isc.A.iEndsWithPatternTitle="ends with pattern";isc.A.andTitle="and";isc.A.notTitle="not";isc.A.orTitle="or";isc.A.inSetTitle="is one of";isc.A.notInSetTitle="is not one of";isc.A.isBlankTitle="is blank";isc.A.notBlankTitle="is not blank";isc.A.isNullTitle="is null";isc.A.notNullTitle="is not null";isc.A.valueSetUsageHint="Multiple values must be separated by the valueSeparator, '|'.";isc.A.valueRangeUsageHint="Range-operators require distinct start and end values, separated by the range (between) symbol, '...'.";isc.B.push(isc.A.getOperatorUsageHint=function isc_c_Operators_getOperatorUsageHint(_1){var _2=isc.isA.String(_1)?_1:_1.ID;var _3=isc.DataSource.$57z[_2];if(_3)return _3.usageHint||isc.Operators[_3.valueType+"UsageHint"];return null}
);isc.B._maxIndex=isc.C+1;if(isc.DynamicForm){isc.defineClass("DynamicFilterForm","SearchForm");isc.A=isc.DynamicFilterForm.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.useMultiSelectForValueMaps=false;isc.A.$10j="Enter";isc.B.push(isc.A.handleKeyPress=function isc_DynamicFilterForm_handleKeyPress(_1,_2){var _3=this.getFocusSubItem();if(isc.isA.TextItem(_3))_2.firedOnTextItem=true;if(_1.keyName!=this.$10j){return this.Super("handleKeyPress",[_1,_2])}
}
,isc.A.itemChanged=function isc_DynamicFilterForm_itemChanged(_1,_2,_3){if(this.creator.itemChanged)this.creator.itemChanged()}
,isc.A.getDefaultOptionDataSource=function isc_DynamicFilterForm_getDefaultOptionDataSource(_1){if(this.creator&&this.creator.getDefaultOptionDataSource){return this.creator.getDefaultOptionDataSource(_1)}
return this.Super("getDefaultOptionDataSource",arguments)}
,isc.A.validate=function isc_DynamicFilterForm_validate(_1,_2,_3,_4,_5,_6){var _7=(this.Super("validate",arguments)==false);for(var i=0;i<this.items.length;i++){var _9=this.items[i];if(_9.isVisible()&&isc.isA.CanvasItem(_9)&&isc.isA.DynamicForm(_9.canvas)){_7=(_9.canvas.validate(_1,_2,_3,_4,_5,_6)!==true)||_7}
}
return!_7}
);isc.B._maxIndex=isc.C+4;isc.defineClass("FilterClause","Layout");isc.A=isc.FilterClause.getPrototype();isc.A.orientation="horizontal";isc.A.defaultWidth=20;isc.A.height=20;isc.A.showFieldTitles=true;isc.A.validateOnChange=true;isc.A.fieldPickerWidth="*";isc.A.operatorPickerWidth=150;isc.A.valueItemWidth=150;isc.A.fieldPickerDefaults={name:"fieldName",showTitle:false,textMatchStyle:"startsWith",changed:function(){this.form.creator.fieldNameChanged(this.form)}};isc.A.fieldPickerTitle="Field Name";isc.A.operatorPickerDefaults={name:"operator",editorType:"SelectItem",showTitle:false,addUnknownValues:false,defaultToFirstOption:true,changed:function(){this.form.creator.operatorChanged(this.form)}};isc.A.operatorPickerTitle="Operator";isc.A.valueItemTitle="Value";isc.A.valueSetHint="Comma-separated values";isc.A.valueItemTextHint="Enter a value";isc.A.valueItemListHint="Select a value";isc.A.valueItemFieldHint="Select a field";isc.A.clauseConstructor=isc.DynamicFilterForm;isc.A.showRemoveButton=true;isc.A.removeButtonPrompt="Remove";isc.A.excludeNonFilterableFields=true;isc.A.removeButtonDefaults={_constructor:isc.ImgButton,width:18,height:18,layoutAlign:"center",extraSpace:5,src:"[SKIN]/actions/remove.png",showRollOver:false,showDown:false,click:function(){this.creator.remove()},getHoverHTML:function(){var _1=this.creator.creator;if(!_1.allowEmpty&&_1.clauses&&_1.clauses.length==1)return _1.lastClausePrompt;return this.prompt}};isc.A.valueQueryButtonSpacerDefaults={_constructor:isc.LayoutSpacer,width:5};isc.A.valueQueryRelatedFieldButtonDefaults={_constructor:isc.ImgButton,layoutAlign:"center",imageType:"center",baseStyle:"dynamicIcon",src:"[SKINIMG]actions/relatedFields.png",showRollOver:false,showDown:false,showDisabled:false,click:function(){this.creator.valueQueryButtonClick(this.creator.$276r)}};isc.A.valueQueryAggregateButtonDefaults={_constructor:isc.ImgButton,imageWidth:13,imageType:"center",baseStyle:"dynamicIcon",layoutAlign:"center",src:"[SKINIMG]actions/sigma.png",showRollOver:false,showDown:false,showDisabled:false,click:function(){this.creator.valueQueryButtonClick(this.creator.$270l)}};isc.A.dynamicValueButtonSpacerDefaults={_constructor:isc.LayoutSpacer,width:5};isc.A.dynamicValueButtonDefaults={_constructor:isc.ImgButton,width:18,height:18,layoutAlign:"center",src:"[SKIN]/actions/dynamic.png",showRollOver:false,showDown:false,showDisabled:false,click:function(){this.creator.dynamicValueButtonClick()}};isc.A.flattenItems=true;isc.A=isc.FilterClause.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$270j={"concat":"text","count":"integer"};isc.A.$270k=["sum","avg"];isc.A.$270l="_aggregate_";isc.A.$277w="[SKINIMG]actions/sigma.png";isc.A.$270m="Aggregate...";isc.A.$276r="_related_";isc.A.$277x="[SKINIMG]actions/relatedFields.png";isc.A.$276s="Related field...";isc.A.customGetValuesFunction="getCriterion";isc.A.valueAttribute="value";isc.A.rangeStartAttribute="start";isc.A.rangeEndAttribute="end";isc.A.operatorAttribute="operator";isc.A.setCustomValuseFunction="setCriterion";isc.A.foreignKeyOperators=["equals","notEqual","inSet","notInSet","isBlank","notBlank"];isc.A.subQueryWindowConstructor="Window";isc.A.subQueryWindowDefaults={autoCenter:true,autoSize:true,isModal:true,showMinimizeButton:false,dismissOnEscape:true,bodyProperties:{membersMargin:10,layoutMargin:10
},setValue:function(_1){var _2=this.body.getMember(0);_2.setRequest(_1)},draw:function(){var _1=this.Super("draw",arguments);this.setSubQueryWindowPosition();return _1},moved:function(){this.setSubQueryWindowPosition()},setSubQueryWindowPosition:function(){if(this.header){var _1=this.body.getMember(0),_2=this.header.getHeight();_1.subQueryWindowLeft=this.getPageLeft()+_2;_1.subQueryWindowTop=this.getPageTop()+_2}
},close:function(){this.Super("close",arguments);this.markForDestroy()}};isc.A.subQueryAggregationEditorConstructor="AggregationEditor";isc.A.subQueryAggregationEditorDefaults={showHiddenFields:true,scalarMode:true,aggregationChanged:function(){}};isc.A.subQueryRelatedCriteriaEditorConstructor="RelatedCriteriaEditor";isc.A.subQueryRelatedCriteriaEditorDefaults={showHiddenFields:true,aggregationChanged:function(){}};isc.A.subQueryToolBarConstructor="HLayout";isc.A.subQueryToolBarDefaults={height:1,layoutAlign:"right",membersMargin:5};isc.A.subQueryClearButtonConstructor="IButton";isc.A.subQueryClearButtonDefaults={title:"Clear Value"};isc.A.subQueryOkButtonConstructor="IButton";isc.A.subQueryOkButtonDefaults={title:"OK"};isc.A.subQueryCancelButtonConstructor="IButton";isc.A.subQueryCancelButtonDefaults={title:"Cancel"};isc.A.dynamicValueWindowConstructor="DynamicValuePicker";isc.A.dynamicValueWindowDefaults={okButtonClick:function(_1){var _2=this.ruleScopeGrid.getSelectedRecord();if(_2&&this.valueSelected){this.valueSelected(_2.criteriaPath||_2.name)}
this.closeClick()}};isc.B.push(isc.A.initWidget=function isc_FilterClause_initWidget(){this.Super("initWidget",arguments);this.setupClause()}
,isc.A.destroy=function isc_FilterClause_destroy(){this.ignoreDSOperatorList();if(this.fieldPicker&&this.fieldPicker&&this.fieldPicker.optionDataSource&&this.fieldPicker.optionDataSource.$172q){this.fieldPicker.optionDataSource.destroy()}
this.Super("destroy",arguments)}
,isc.A.getFilterBuilder=function isc_FilterClause_getFilterBuilder(){return this.filterBuilder}
,isc.A.getTopLevelFilterBuilder=function isc_FilterClause_getTopLevelFilterBuilder(){var _1=this.filterBuilder;while(_1&&_1.filterBuilder!=null){_1=_1.filterBuilder}
return _1||{}}
,isc.A.getSpecialValuesCSS=function isc_FilterClause_getSpecialValuesCSS(){var _1=null;if(this.filterBuilder){_1=this.getTopLevelFilterBuilder().specialValuesCSS}
return _1}
,isc.A.getPrimaryDS=function isc_FilterClause_getPrimaryDS(_1){if(this.dataSources){if(_1==null){return isc.DataSource.get(this.dataSources[0])}
if(isc.isAn.Object(_1)){if(_1.$93k!=null){_1=_1.$93k}
for(var i=0;i<this.dataSources.length;i++){var _3=isc.getValues(this.dataSources[i].getFields());if(_3.contains(_1))return this.dataSources[i]}
_1=_1.name}
if(_1.contains(".")){return isc.DataSource.getDataSourceForField(_1,this.dataSources)}
}
if(this.dataSource)return this.getDataSource();else if(this.fieldDataSource)return this.fieldDataSource}
,isc.A.getDefaultOptionDataSource=function isc_FilterClause_getDefaultOptionDataSource(_1){return this.getPrimaryDS(_1)}
,isc.A.$270n=function isc_FilterClause__getSummaryFunctionType(_1,_2){var _3=(_2?this.$270j[_2]:"integer");if(!_3){var _4=this.getField(_1),_5=_4&&_4.type,_6=_5&&(_5=="integer"||_5=="float")
;if(_5&&(!this.$270k.contains(_5)||_6)){_3=_5}
}
return _3}
,isc.A.getSubQueryOutputType=function isc_FilterClause_getSubQueryOutputType(_1){var _2=_1&&_1.summaryFunctions,_3,_4
;if(_2){for(var _5 in _2){_3=_5
_4=_2[_5];break}
}
return this.$270n(_3,_4)}
,isc.A.getSubQueryDescription=function isc_FilterClause_getSubQueryDescription(_1,_2){var _3=this.getDataSource();var _4=isc.DS.getAggregationDescription(_1,_3);if(_2){_4=(this.isAggregateSubquery(_1)?"Aggregate: ":"Related field: ")+_4}
return _4}
,isc.A.isAggregateSubquery=function isc_FilterClause_isAggregateSubquery(_1){return(_1&&(_1.groupBy||_1.summaryFunctions))}
,isc.A.isRelatedFieldSubquery=function isc_FilterClause_isRelatedFieldSubquery(_1){return(_1&&!this.isAggregateSubquery(_1))}
,isc.A.getField=function isc_FilterClause_getField(_1){if(_1==null)return null;if(isc.isAn.Object(_1))return _1;var _2;if(_1==this.$270l||_1==this.$276r){var _3=this.clause&&this.clause.getValue("fieldQuery"),_4=this.getSubQueryOutputType(_3)
;_2={name:_1,type:_4
}}else if(this.dataSources){_2=isc.DataSource.getFieldFromDataSources(_1,this.dataSources)}else if(this.dataSource){_2=this.getDataSource().getField(_1);if(_2==null){_2=this.getDataSource().getFieldForDataPath(_1)}
if(_2==null){var _5=this.getTopLevelFilterBuilder().criteriaComponent;if(_5)_2=_5.getFieldByName(_1)}
}else{if(this.clause){_2=this.fieldData?this.fieldData[_1]:null;if(!_2)_2=this.clause.getField("fieldName").getSelectedRecord();if(!_2)_2=this.field;else this.field=_2}
}
if(!_2&&this.createRuleCriteria){var _6=this.getTopLevelFilterBuilder().$167n,_7=_6.getRuleScopeDataBoundComponents(),_8=_1.split("."),_9=(_8.length>0?_8[0]:null),_10=(_8.length>1?_8[_8.length-1]:null)
;if(_9&&_10){for(var i=0;i<_7.length;i++){var _12=_7[i].getID();if(_12==_9){_2=_7[i].getField(_10);break}
}
}
}
return _2}
,isc.A.addComponentFieldNames=function isc_FilterClause_addComponentFieldNames(_1,_2){var _3=_1.completeFields;if(!_3)return _2;var _4={};for(var i=0;i<_2.length;i++)_4[_2[i]]=true;_2=_2.duplicate();for(var i=0;i<_3.length;i++){var _6=_3[i].name;if(!_4[_6])_2.add(_6)}
return _2}
,isc.A.getFieldNames=function isc_FilterClause_getFieldNames(){if(this.allowedFields)return this.allowedFields;if(this.dataSources){return isc.DataSource.getCombinedDataSourceFields(this.dataSources)}
if(this.dataSource){var _1=this.getDataSource().getFieldNames(!this.showHiddenFields),_2=this.getFilterBuilder()&&this.getTopLevelFilterBuilder(),_3=_2&&_2.criteriaComponent;return _3?this.addComponentFieldNames(_3,_1):_1}}
,isc.A.getFieldOperatorMap=function isc_FilterClause_getFieldOperatorMap(_1,_2,_3,_4){var _5=this.$198w(_1),_6=this.getPrimaryDS(_1),f=isc.addProperties({},_1,{extraOperators:this.extraOperators}),_8=_6.getFieldOperatorMap(f,_2,_3,_4,_5)
;return _8}
,isc.A.getSearchOperator=function isc_FilterClause_getSearchOperator(_1,_2){return this.getPrimaryDS(_2).getSearchOperator(_1)}
,isc.A.combineFieldData=function isc_FilterClause_combineFieldData(_1,_2){var _3=this.getPrimaryDS(_2),_4=this.getField(_2);if(_4)
return _3.combineFieldData(_1,_2);else return _1}
,isc.A.setupClause=function isc_FilterClause_setupClause(){this.$85y=true;if(this.dataSource&&!isc.isA.DataSource(this.dataSource))
this.dataSource=isc.DataSource.get(this.dataSource);if(this.fieldDataSource&&!isc.isA.DataSource(this.fieldDataSource))
this.fieldDataSource=isc.DataSource.get(this.fieldDataSource);this.fieldPickerDefaults.title=this.fieldPickerTitle;this.operatorPickerDefaults.title=this.operatorPickerTitle;var _1={};if(this.showClause!=false){if(this.topOperatorAppearance=="inline"){if(this.topOperator=="and"){var _2={and:this.creator.inlineAndTitle,not:this.creator.inlineAndNotTitle}}else{var _2={or:this.creator.inlineOrTitle,not:this.creator.inlineAndNotTitle}}
var _3=0;this.topOperatorFormProperties={layoutAlign:"top"};if(this.creator.showSelectionCheckbox){isc.addProperties(this.topOperatorFormProperties,{numCols:2,width:120,colWidths:["20%","80%"]
});this.topOperatorFormProperties.items=[{name:"select",type:"checkbox",showTitle:false,showLabel:false,defaultValue:false,showIf:function(){return this.form.creator.showSelectionCheckbox}
},isc.addProperties({width:this.topOperatorItemWidth},this.topOperatorItemDefaults,this.topOperatorItemProperties
)
];_3=1}else{this.topOperatorFormProperties.items=[isc.addProperties({width:this.topOperatorItemWidth},this.topOperatorItemDefaults,this.topOperatorItemProperties
)
]}
this.addAutoChild("topOperatorForm");this.topOperatorForm.items[_3].valueMap=_2;this.topOperatorForm.items[_3].defaultValue=this.negated?"not":this.topOperator;this.updateInlineTopOperator()}
var _4=[];_4.add(isc.addProperties({},this.fieldPickerDefaults,{width:this.fieldPickerWidth,sortField:(this.sortFields?"fieldName":null),specialValuesCSS:this.getSpecialValuesCSS()},this.fieldPickerProperties,{name:"fieldName"}
));_4.add(isc.addProperties({},this.operatorPickerDefaults,{width:this.operatorPickerWidth,showIf:this.missingField?"false":"true"},this.operatorPickerProperties,{name:"operator"}
));var _5=this.criterion,_6=this.getFieldNames(),_7
;if(this.fieldName&&(this.dataSource||this.dataSources)){var _8=this.fieldName;var _9=this.getField(_8),_10
;isc.addProperties(_4[0],{type:"staticText",clipValue:true,wrap:false});if(this.missingField){_10=isc.DataSource.getAdvancedCriteriaDescription(this.criterion,this.dataSource||this.dataSources)}else if(!_9||(this.excludeNonFilterableFields&&_9.canFilter==false))
{_8=_6[0]}else if(this.showFieldTitles){_10=_9.summaryTitle||_9.title||_8}
_4[0].defaultValue=_8;if(_10!=null){var _11={};_11[_8]=_10;_4[0].valueMap=_11}
_7=_8}else{if(this.fieldDataSource){var _12;if(this.fieldPickerProperties){_12=this.fieldPickerProperties.pickListFields}
if(!_12)_12=this.pickListFields;isc.addProperties(_4[0],{type:"ComboBoxItem",completeOnTab:true,addUnknownValues:false,optionDataSource:this.fieldDataSource,valueField:"name",displayField:this.showFieldTitles?"title":"name",pickListFields:_12,optionCriteria:{_constructor:"AdvancedCriteria",operator:"and",criteria:[{fieldName:"canFilter",operator:"notEqual",value:false}
]
},pickListProperties:{reusePickList:function(){return false}}
});if(this.field){_4[0].defaultValue=_4[0].defaultValue||this.field.name}
}else if(this.dataSources!=null&&this.createRuleCriteria){var _13=this,_14=(this.multiDSFieldFormat==isc.FilterBuilder.SEPARATED?"title":"name"),_15=(this.showFieldTitles?"title":"name"),_16=this.getTopLevelFilterBuilder().$167n,_17=this.getTopLevelFilterBuilder().targetComponent,_18=isc.Canvas.getMultiDSFieldDataSource(_16,this.$171s,_17,this.getTopLevelFilterBuilder().excludedRuleScope,this.multiDSFieldFormat
)
;isc.addProperties(_4[0],{width:200,optionDataSource:_18,valueField:"name",displayField:_14,pickListMaxWidth:600,pickListFields:[{name:"name",type:"text",hidden:(_14!="name")},{name:"title",type:"text",hidden:(_14!="title")}
],pickListProperties:{showHeader:false,autoFitFieldWidths:true,reusePickList:function(){return false},formatCellValue:function(_36,_37,_38,_39){return(_37.enabled==false||_13.multiDSFieldFormat==isc.FilterBuilder.QUALIFIED?_36:"&nbsp;&nbsp;"+_36)},getCellStyle:function(_36,_37,_38){if(_36.enabled==false)return"filterBuilderTitleCell";return this.Super("getCellStyle",arguments)}
}
})}else if(_6){var _19=(this.dataSources!=null),_20=this.multiDSFieldFormat
;var _21="";for(var i=0;i<_6.length;i++){var _23=_6[i],_9=this.getField(_23);if(!_9)continue;if(this.excludeNonFilterableFields&&_9.canFilter==false)continue;if(_19){if(_20=="separated"){var _18=_23.split(".")[0];if(_18!=_21){}
_1[_23]="&nbsp;&nbsp;"+(_9.summaryTitle||_9.title||isc.DS.getAutoTitle(_23))}else{_1[_23]=_23}
}else if(this.showFieldTitles){_1[_23]=_9.summaryTitle||_9.title||_23}else{_1[_23]=_23}
}
_4[0].valueMap=_1;_4[0].defaultValue=_4[0].defaultValue||this.defaultFieldName||isc.firstKey(_1)}
}
this.fieldPicker=_4[0];var _24=_4[0],_25=_4[1];if(!this.fieldName){if(_5&&_5.fieldName){if(this.fieldDataSource){_24.defaultValue=_5.fieldName}else{if(_6&&_6.contains(_5.fieldName)){_24.defaultValue=_5.fieldName}else if(_6&&_6.contains(isc.Canvas.$177s(_5.fieldName))){_24.defaultValue=isc.Canvas.$177s(_5.fieldName)}else{isc.logWarn("Criterion specified field "+_5.fieldName+", which is not in the record. Using the first record field ("+(_1?isc.firstKey(_1):_6[0])+") instead");_24.defaultValue=_1?isc.firstKey(_1):_6[0]}
}
}
_7=_24.defaultValue;if(_5&&_5.fieldQuery&&(this.allowAggregates||this.allowRelatedRecordCriteria)){_7=(this.isAggregateSubquery(_5.fieldQuery)?this.$270l:this.$276r)}
}
var _26={};if(_7){var _9=this.field||this.getField(_7);if(!this.missingField&&_9){_26.fieldName=_7;var _18=this.getPrimaryDS();var _27=_18&&_18.$570&&_18.$570[_9.type]!=null;var _11=_9?this.getFieldOperatorMap(_9,_27,"criteria",true):null;_25.valueMap=_11;if(_11){if(_5&&_5.operator){_25.$279g=_25.defaultValue=_5.operator}else{if(_18){_25.defaultValue=_18.getFieldDefaultOperator(_9.name)}else{_25.defaultValue=isc.SimpleType.getDefaultOperator(_9.type)}
}
_26.operator=_25.defaultValue}
this.$74o=_7;var _28=this.getSearchOperator(_25.defaultValue,_9);var _29=isc.getKeys(_11).length;if(_29>0&&(!_28||!_11[_28.ID])){isc.logWarn("Criterion specified unknown operator "+(_5?_5.operator:"[null criterion]")+". Using the first valid operator ("+isc.firstKey(_11)+") instead");_25.defaultValue=isc.firstKey(_11);_28=this.getSearchOperator(_25.defaultValue,_9)}
var _30=this.buildValueItemList(_9,_28,_7);if(_5){if(_5.value!=null&&_30.containsProperty("name","value")){_30.find("name","value").defaultValue=_5.value;_26.value=_5.value}
if(_5.start!=null&&_30.containsProperty("name","start")){_30.find("name","start").defaultValue=_5.start;_26.start=_5.start}
if(_5.end!=null&&_30.containsProperty("name","end")){_30.find("name","end").defaultValue=_5.end;_26.end=_5.end}
if(_5.valuePath!=null){var _31=_30.find("name","valuePath");if(_31){var _32=this.getTopLevelFilterBuilder();var _33=_32.$167n;if(_33&&_33.ruleScope){_31.defaultValue=_5.valuePath.replace(/\//,".");_31.visible=true;_30.find("name","value").visible=false}else{isc.logWarn("Criterion specified field "+_5.fieldName+" with valuePath "+_5.valuePath+" but no targetRuleScope was provided - ignoring valuePath.");_5.valuePath=_5.value=null}
}
}
if(_5.valueQuery!=null){var _34=_30.find("name","valueQuery");if(_34){_34.defaultValue=_5.valueQuery;_34.visible=true;_30.find("name","value").visible=false}
}
}
if(_30)_4.addList(_30)}
}else{_25.disabled=true}
if(_5&&_5.fieldQuery){_26.fieldQuery=_5.fieldQuery}
if(_5&&_5.valueQuery){_26.valueQuery=_5.valueQuery}
if(this.showRemoveButton){var _35={prompt:this.removeButtonPrompt};if(this.iconSize)_35.width=_35.height=this.iconSize;if(this.iconBaseStyle)_35.baseStyle=this.iconBaseStyle;this.addAutoChild("removeButton",_35)}
this.addMember(this.removeButton);this.addAutoChild("clause",{sortFields:this.sortFields,flattenItems:this.flattenItems,$76z:true,items:_4,values:_26,height:10,width:100,numCols:5,colWidths:[100,this.operatorPickerWidth,"*",25,"*"]
});this.addMember(this.clause);if(this.allowRuleScopeValues){var _11=_24.valueMap,_10=(_11?_11[_7]:null)||_7
;this.addAutoChild("dynamicValueButtonSpacer");this.addAutoChild("dynamicValueButton",{prompt:this.dynamicValueButtonPrompt,fieldName:_7,fieldTitle:_10});if(!_4.find("name","valuePath")){this.dynamicValueButton.hide()}
}
this.addMember(this.dynamicValueButton);this.fieldPicker=this.clause.getItem("fieldName");this.operatorPicker=this.clause.getItem("operator")}
this.addMember(this.topOperatorForm,0);this.observeDSOperatorList()}
,isc.A.observeDSOperatorList=function isc_FilterClause_observeDSOperatorList(){var _1=this.getPrimaryDS(this.getFieldName());if(!_1)return;this.observe(_1,"addSearchOperator","observer.updateFields(true)")}
,isc.A.ignoreDSOperatorList=function isc_FilterClause_ignoreDSOperatorList(){var _1=this.getPrimaryDS(this.getFieldName());if(!_1)return;if(this.isObserving(_1,"addSearchOperator"))this.ignore(_1,"addSearchOperator")}
,isc.A.updateInlineTopOperator=function isc_FilterClause_updateInlineTopOperator(){if(this.topOperatorAppearance!="inline")return;var _1=this.creator.showSelectionCheckbox?1:0;if(this.creator.isFirstClause(this)){this.topOperatorForm.items[_1].hide()}else{this.topOperatorForm.items[_1].show()}}
,isc.A.getEditorType=function isc_FilterClause_getEditorType(_1,_2){if(isc.isA.FilterBuilder(this.filterBuilder)){return this.filterBuilder.getEditorType(_1,_2)}else{return isc.FilterBuilder.getDefaultEditorType(_1,this.getPrimaryDS(),_2)}}
,isc.A.buildValueItemList=function isc_FilterClause_buildValueItemList(_1,_2,_3){if(_2==null)this.logWarn("buildValueItemList passed null operator");var _4=this.getEditorType(_1,_2&&_2.ID);var _5=_2?_2.valueType:"text",_6,_7,_8=[],_9
;if(_1==null){_6="text"}else{if(_3==null)_3=_1.name;_6=_1.type}
_7=isc.SimpleType.getType(_6)||isc.SimpleType.getType("text");var _10=isc.SimpleType.inheritsFrom(_6,"date")||isc.SimpleType.inheritsFrom(_6,"datetime");while(_7.getAtomicValue!=null){var _11=_7.inheritsFrom||"text";_7=isc.SimpleType.getType(_11)}
_7=_7.name;var _12=this.valueItemWidth;if(_1){var _13={$93k:_1};isc.addProperties(_13,_1);_13.canEdit=_1.canFilter;_1=_13;if(_1.userFormula||_1.userSummary){_1.canFilter=true;_1.canEdit=true}
if(_1.editorProperties&&_1.editorProperties.width!=null){_12=_1.editorProperties.width}
}
_4=this.getEditorType(_1,_2.ID);if(_4=="staticText"&&!this.excludeNonFilterableFields)_4="text";var _14=_2.hintText||this.getValueItemHintText(_5,_7,_4);if(_5=="fieldType"||_5=="custom"||_5=="valueSet"){var _15=_7;var _16=this.getValueFieldProperties(_6,_3,_2.ID,"value");if(_16&&_16.editorType){_4=_16.editorType}
var _17=isc.addProperties({type:_15,valueType:_5,name:_1?_1.name:null,showTitle:false,title:this.valueItemTitle,width:_12,hint:_14,showHintInField:(_14!=null),changed:function(){this.form.creator.valueChanged(this,this.form)}
},_16
);if(_4)_17.editorType=_4;if(_5=="valueSet"){_17.multiple=true;_17.parseEditorValue=function(_22,_40,_41){if(_22==null)return _22;var _18=_41.multipleValueSeparator.trim();var _19=new RegExp("[\\s]*["+_18+"][\\s]*","g");return _22.split(_19)};_17.formatEditorValue=function(_22,_40,_41,_42){if(_22==null)return"";if(isc.isAn.Array(_22)){return _22.join(_42.multipleValueSeparator)}
return _22}
}
if(_1!=null&&_5!="custom"){_17=this.combineFieldData(_17,_1)}
_17.name="value";_17.dataPath=null;if(_6=="enum"){_17=isc.addProperties(_17,{valueMap:_1.valueMap
})}
if(_7=="boolean"){_17=isc.addProperties(_17,{showLabel:false,defaultValue:true,align:this.isRTL()?"right":"left"
})}
if(_1&&_1.editorProperties){var _20=_1.editorProperties;for(var _21 in _20){var _22=_20[_21];if(isc.isAn.Array(_22)||isc.isA.Date(_22)){_22=_22.duplicate()}else if(isc.isAn.Object(_22)){_22=isc.shallowClone(_22)}
_17[_21]=_22}
}
if(_1.foreignKey!=null||_1.displayField!=null||_1.optionDataSource!=null){if(_1.foreignKey){var _23=_1.foreignKey,_24=_23.indexOf(".")
;if(!_1.optionDataSource)_17.optionDataSource=_23.substring(0,_24);if(!_1.valueField)_17.valueField=_23.substring(_24+1)}else{if(!_1.valueField)_17.valueField=_1.name}
}
_8.add(_17);_8.add({name:"valuePath",type:"staticText",showTitle:false,visible:false,valuePrefix:"<nobr>"+this.dynamicValuePrefix+" ",valueSuffix:"</nobr>",formatValue:function(_22,_40,_41,_42){if(_41.creator&&_41.creator.creator&&_41.creator.creator.targetComponent){var _25=_41.creator.creator.targetComponent.ID+".values.";if(_22!=null&&_22.startsWith(_25))_22=_22.replace(_25,"")}
return(_22!=null?this.valuePrefix+_22+this.valueSuffix:null)}
});_8.add({name:"valueQuery",type:"staticText",showTitle:false,width:this.valueItemWidth,clipValue:true,wrap:false,visible:false,doubleClick:function(_40,_41){if(!_40.creator.allowAggregates&&!_40.creator.allowRelatedRecordCriteria){return}
var _22=_41.getValue(),_26=(_40.creator.isRelatedFieldSubquery(_22)?_40.creator.$276r:(_40.creator.isAggregateSubquery(_22)?_40.creator.$270l:null))
;if(_26){_40.creator.valueQueryButtonClick(_26);return false}
},valueAggregatePrefix:"<nobr>"+this.valueQueryAggregatePrefix+" ",valueRelatedFieldPrefix:"<nobr>"+this.valueQueryRelatedFieldPrefix+" ",valueSuffix:"</nobr>",formatValue:function(_22,_40,_41,_42){if(!_22)return null;var _27=(_41.creator.isAggregateSubquery(_22)?this.valueAggregatePrefix:this.valueRelatedFieldPrefix);var _28=_41.creator.getSubQueryDescription(_22);_22=_28.replace("<br>","");return(_22!=null?_27+_22+this.valueSuffix:null)},itemHoverHTML:function(_40,_41){var _22=_40.getValue();if(!_22)return null;return _41.creator.getSubQueryDescription(_22)}
})}else if(_5=="fieldName"){_9=isc.addProperties({},this.fieldPickerDefaults,{showTitle:false,addUnknownValues:false,editorType:this.fieldDataSource?"ComboBoxItem":"SelectItem",valueType:_5,width:_12,textMatchStyle:this.fieldPicker.textMatchStyle,changed:function(){this.form.creator.valueChanged(this,this.form)}
});if(this.sortFields)_9.sortField="value";if(this.fieldDataSource){_9=isc.addProperties(_9,{completeOnTab:true,optionDataSource:this.fieldDataSource,valueField:"name",displayField:this.showFieldTitles?"title":"name",pickListProperties:{reusePickList:function(){return false}}
})}else if(this.dataSources!=null&&this.createRuleCriteria){var _29=this,_30=(this.multiDSFieldFormat==isc.FilterBuilder.SEPARATED?"title":"name"),_31=(this.showFieldTitles?"title":"name"),_32=this.getTopLevelFilterBuilder().$167n,_33=this.getTopLevelFilterBuilder().targetComponent,_34=isc.Canvas.getMultiDSFieldDataSource(_32,this.$171s,_33,this.getTopLevelFilterBuilder().excludedRuleScope,this.multiDSFieldFormat)
;_9=isc.addProperties(_9,{optionDataSource:_34,valueField:"name",displayField:_30,pickListFields:[{name:"name",type:"text",hidden:(_30!="name")},{name:"title",type:"text",hidden:(_30!="title")}
],pickListProperties:{autoFitData:"horizontal",reusePickList:function(){return false},formatCellValue:function(_22,_40,_41,_42){return(_40.enabled==false||_29.multiDSFieldFormat==isc.FilterBuilder.QUALIFIED?_22:"&nbsp;&nbsp;"+_22)},getCellStyle:function(_40,_41,_42){if(_40.enabled==false)return"filterBuilderTitleCell";return this.Super("getCellStyle",arguments)}
}
})}else{var _35=this.getFieldNames();_35.remove(_3);var _36={};for(var i=0;i<_35.length;i++){var _38=_35[i];if(this.showFieldTitles){var _39=this.getField(_38);if(this.showFieldTitleAndName){_36[_38]=_39.summaryTitle||_39.title
+" (<i>"+_38+"</i>)"}else{_36[_38]=_39.summaryTitle||_39.title||_38}
}else{_36[_38]=_38}
}
_9=isc.addProperties(_9,{valueMap:_36})}
_8.add(isc.addProperties(_9,this.getValueFieldProperties(_6,_3,_2.ID,"name"),this.fieldPickerProperties,{name:"value"})
)}else if(_5=="valueRange"){_9=this.combineFieldData(isc.addProperties({type:_7,editorType:_4,showTitle:false,width:_12,changed:function(){this.form.creator.valueChanged(this,this.form)}
}),_1);if(_14){_9.showHintInField=true;_9.hint=_14}
_8.addList([isc.addProperties({},_9,{name:"start"},this.getValueFieldProperties(_6,_3,_2.ID,"start"),!_10?{}:{rangePosition:"start"}
),isc.addProperties({type:"staticText",name:"rangeSeparator",showTitle:false,width:null,wrap:false,clipValue:false,clipStaticValue:false,shouldSaveValue:false,defaultValue:this.filterBuilder?this.filterBuilder.rangeSeparator:null,changed:function(){this.form.creator.valueChanged(this,this.form)}
},this.getRangeSeparatorProperties(_6,_3,_2.ID)
),isc.addProperties({},_9,{name:"end"},this.getValueFieldProperties(_6,_3,_2.ID,"end"),!_10?{}:{rangePosition:"end"}
)
])}
for(var i=0;i<_8.length;i++){if(!_8[i].criteriaField)_8[i].criteriaField=_3;if(!_8[i].operator)_8[i].operator=_2.ID}
if(this.validateOnChange){for(var i=0;i<_8.length;i++){isc.addProperties(_8[i],{blur:function(_40,_41){if(!_40.creator.itemsInError)_40.creator.itemsInError=[];if(!_40.validate(null,null,true)){_41.focusInItem();if(!_40.creator.itemsInError.contains(_41)){_40.creator.itemsInError.add(_41)}
}else{if(_40.creator.itemsInError.contains(_41)){_40.creator.itemsInError.remove(_41)}
}
}
})}
}
for(var i=0;i<_8.length;i++){if(_8[i].showIf!=null)delete _8[i].showIf;if(_8[i].type=="text"&&isc.Browser.isTouch&&_2.ID!="equals"&&_2.ID!="notEqual"&&_2.ID!="iEquals"&&_2.ID!="iNotEqual")
{_8[i].browserAutoCorrect=false}
}
return _8}
,isc.A.getValueItemHintText=function isc_FilterClause_getValueItemHintText(_1,_2,_3){if(_1=="fieldName")return this.valueItemFieldHint;if(_1=="valueSet"&&_3=="TextAreaItem")return this.valueSetHint;if(_1=="fieldType"||_1=="custom"||_1=="valueRange"){if(!isc.SimpleType.inheritsFrom(_2,"boolean")&&!isc.SimpleType.inheritsFrom(_2,"date")&&!isc.SimpleType.inheritsFrom(_2,"datetime")
)
{return this.valueItemTextHint}
}
return null}
,isc.A.getValueFieldProperties=function isc_FilterClause_getValueFieldProperties(_1,_2,_3,_4){if(this.filterBuilder){return this.filterBuilder.getValueFieldProperties(_1,_2,_3,_4)}}
,isc.A.getRangeSeparatorProperties=function isc_FilterClause_getRangeSeparatorProperties(_1,_2,_3){if(this.filterBuilder)return this.filterBuilder.getRangeSeparatorProperties(_1,_2,_3)}
,isc.A.remove=function isc_FilterClause_remove(){this.markForDestroy()}
,isc.A.getValues=function isc_FilterClause_getValues(){var _1=this.clause;return _1.getValues()}
,isc.A.getFieldName=function isc_FilterClause_getFieldName(_1){var _2=this.getFieldNameFromPicker(this.fieldPicker,_1);if(_2)return _2;return this.fieldName}
,isc.A.getFieldNameFromPicker=function isc_FilterClause_getFieldNameFromPicker(_1,_2){if(_1){var _3=_1.optionDataSource!=null;if(!_3)return _1.getValue();var _4=_1.getSelectedRecord();if(_4)return _2?_4.name:(_4.dataPath||_4.name);var _5=_1.getValue();if(_5)return _5}
return null}
,isc.A.getFieldTitle=function isc_FilterClause_getFieldTitle(){var _1=this.getFieldTitleFromPicker(this.fieldPicker);if(_1)return _1;return this.fieldTitle}
,isc.A.getFieldTitleFromPicker=function isc_FilterClause_getFieldTitleFromPicker(_1){if(_1){if(_1.getTitleForSelectedValue)return _1.getTitleForSelectedValue();var _2=_1.optionDataSource!=null;if(!_2)return _1.getDisplayValue();var _3=_1.getSelectedRecord();if(_3)return _3.title||_3.name;var _4=_1.getDisplayValue();if(_4)return _4}
return null}
,isc.A.getCriterion=function isc_FilterClause_getCriterion(_1){if(!this.clause)return null;var _2=this.getFieldName(),_3=this.operatorPicker?this.operatorPicker.getValue():null;if(!_2)return null;if(isc.isA.String(_3))_3=this.getSearchOperator(_3,_2);if(_3==null){return}
var _4=this.getClauseValues(_2,_3,_1);if(_4&&!_1&&_4.valuePath==null&&_4.valueQuery==null){var _5=isc.DS.isAdvancedCriteria(_4);if(!_3||(_3.valueType!="none"&&_3.valueType!="valueRange"&&(!_5||(!_4.criteria&&(_4.value==null||(isc.isA.String(_4.value)&&_4.value=="")))
)
))
{return null}
if(_3.valueType=="valueRange"&&!_4.start&&!_4.end){return null}
}
return _4}
);isc.evalBoundary;isc.B.push(isc.A.getClauseValues=function isc_FilterClause_getClauseValues(_1,_2,_3){var _4=this.clause,_5={},_6=_4.getField("value"),_7=_4.getField("valuePath"),_8=_4.getField("valueQuery"),_9=_4.getField("start"),_10=_4.getField("end"),_11=_4.getValue("fieldQuery"),_12=_4.getValue("valueQuery"),_13=_2.valueAttribute||this.valueAttribute,_14=_2.rangeStartAttribute||this.rangeStartAttribute,_15=_2.rangeEndAttribute||this.rangeEndAttribute
;_5[this.operatorAttribute]=_4.getValue("operator");if(_1!=null)_5.fieldName=_1;if(_5&&_7&&_7.isVisible(true)){_5["valuePath"]=_7.getValue()}else if(_5&&_8&&_8.isVisible(true)){_5["valueQuery"]=_8.getValue()}else{if(_2[this.customGetValuesFunction]&&isc.isA.Function(_2[this.customGetValuesFunction]))
{if(_6){_5=_2[this.customGetValuesFunction](_1,_6,_3);if(_5&&_2&&_2.condition){if(_2.ID&&_2.ID!=_5[this.operatorAttribute]){_5[this.operatorAttribute]=_2.ID}
}
}else if(_9&&_10){var _16=_2[this.customGetValuesFunction](_1,_9),_17=_2[this.customGetValuesFunction](_1,_10);_5.fieldName=_16.fieldName;_5[this.operatorAttribute]=_16.operator;_5[_14]=_16.value;_5[_15]=_17.value}
}else{if(_6)_5[_13]=_6.getValue();if(_9)_5[_14]=_9.getValue();if(_10)_5[_15]=_10.getValue()}
}
if(_11!=null){delete _5.fieldName;_5.fieldQuery=_11;this.simplifyFieldQuery(_5)}
var _18=this.getField(_1);if(_5&&isc.isA.Date(_5[this.valueAttribute])&&(!_18||!isc.SimpleType.inheritsFrom(_18.type,"datetime")))
{_5[_13].logicalDate=true}
return _5}
,isc.A.setClauseValues=function isc_FilterClause_setClauseValues(_1,_2,_3){if(this.clause==null)return;var _4=this.clause,_5=_4.getField("value"),_6=_4.getField("start"),_7=_4.getField("end"),_8=_2.valueAttribute||this.valueAttribute,_9=_2.rangeStartAttribute||this.rangeStartAttribute,_10=_2.rangeEndAttribute||this.rangeEndAttribute;if(_2[this.customSetValuesFunction]&&isc.isA.Function(_2[this.customSetValuesFunction]))
{if(_5){_2[this.customSetValuesFunction](_1,_5,_3)}else{_2[this.customSetValuesFunction](_1,_6,_3);_2[this.customSetValuesFunction](_1,_7,_3)}
}else{if(_5)_5.setValue(_3[_8]);if(_6)_6.setValue(_3[_9]);if(_7)_7.setValue(_3[_10])}}
,isc.A.simplifyFieldQuery=function isc_FilterClause_simplifyFieldQuery(_1){var _2=_1.fieldQuery;if(_2&&isc.getKeys(_2).length==2&&_2.dataSource&&_2.queryOutput){_1.fieldName=_2.dataSource+"."+_2.queryOutput;delete _1.fieldQuery}}
,isc.A.setDefaultFocus=function isc_FilterClause_setDefaultFocus(){if(!this.clause)return;if(isc.isA.Function(this.clause.focusInItem))this.clause.focusInItem("fieldName")}
,isc.A.validate=function isc_FilterClause_validate(){return this.clause?this.clause.validate(null,null,true):true}
,isc.A.itemChanged=function isc_FilterClause_itemChanged(){if(this.creator&&isc.isA.Function(this.creator.itemChanged))this.creator.itemChanged()}
,isc.A.valueChanged=function isc_FilterClause_valueChanged(_1,_2){this.clause.clearValue("valueQuery")}
,isc.A.fieldNameChanged=function isc_FilterClause_fieldNameChanged(){var _1=this.clause.getValue("fieldName"),_2=(_1!=null&&_1!="");if(_1!=this.$270l&&_1!=this.$276r){var _3=this.clause.getValue("fieldQuery");if(_3)this.$270o=_3;this.clause.clearValue("fieldQuery")}
this.clause.getItem("operator").disabled=!_2;this.updateFields()}
,isc.A.removeValueFields=function isc_FilterClause_removeValueFields(_1){if(!this.clause)return;this.removeValueField("value",_1);this.removeValueField("valuePath",_1);this.removeValueField("valueQuery",_1);this.removeValueField("rangeSeparator",_1);this.removeValueField("start",_1);this.removeValueField("end",_1)}
,isc.A.removeValueField=function isc_FilterClause_removeValueField(_1,_2){var _3=this.clause,_4=_3.getItem(_1)
;if(_4){var _5=_4.getValue()
if(_5&&_5.$84l)_5=_5.$84l;_3.removeItem(_4);if(!_2)_3.setValue(_1,_5)}}
,isc.A.operatorChanged=function isc_FilterClause_operatorChanged(){if(!this.clause)return;var _1=this.clause,_2=this.fieldName||_1.getValue("fieldName")
;if(_2==null)return;var _3=this.getField(_2);var _4=this.getSearchOperator(_1.getValue("operator"),_3);this.updateValueItems(_3,_4,_2)}
,isc.A.updateValueItems=function isc_FilterClause_updateValueItems(_1,_2,_3){var _4=this.clause;var _5=_4.getItem("value");var _6=_5?_5.valueType:null;var _7=_5?_5.getValue():null;_5=null;this.removeValueFields();if(_3)_4.removeExtraAdvancedCriteriaFields([_3]);var _8=this.buildValueItemList(_1,_2,_3)
_4.addItems(_8);var _9=_4.getItem("value");var _10=_4.getItem("valuePath");var _11=_4.getItem("valueQuery");var _12=_9?_9.valueType:null;var _13=_9!=null&&_12!=null&&this.retainValuesAcrossFields;if(_13){if(_9.optionDataSource||(_12!=_6&&(_6!="fieldType"&&_12!="valueSet"))||(_9.getValueMap()&&_9.$193&&!_9.$193(_7))
)
{_13=false}
}
if(!_13){if(_9)_9.clearValue();if(_10)_10.clearValue()}
if(this.valueQueryAggregateButton){if(_11){this.valueQueryAggregateButton.show()}else{this.valueQueryAggregateButton.hide()}
}
if(this.valueQueryRelatedFieldButton){if(_11){this.valueQueryRelatedFieldButton.show()}else{this.valueQueryRelatedFieldButton.hide()}
}
if(this.dynamicValueButton){if(_10){this.dynamicValueButton.show()}else{this.dynamicValueButton.hide()}
}}
,isc.A.updateOperatorDefault=function isc_FilterClause_updateOperatorDefault(_1){var _2=this.clause.getItem("operator");if(_2){var _3=this.getPrimaryDS(_1);if(_3){_2.defaultValue=_3.getFieldDefaultOperator(_1);var _4=this.$198w(_1);if(_4&&_4.length>0){if(!_4.contains(_2.defaultValue))_2.defaultValue=_4[0];if(!_4.contains(_2.getValue()))_2.clearValue()}
}else{_2.defaultValue=isc.SimpleType.getDefaultOperator(_1.type)}
}}
,isc.A.updateFields=function isc_FilterClause_updateFields(_1){if(!this.clause)return;var _2=this.clause,_3=this.$74o,_4=this.fieldName||_2.getValue("fieldName")
;if(_4==null)return;if(!_1&&_4==_3)return;var _5=this.getField(_4),_6=this.getField(_3);if(!_5)return;this.updateOperatorDefault(_5);_2.getItem("operator").setValueMap(this.getFieldOperatorMap(_5,false,"criteria",true)
);var _7=_2.getField("operator");var _8=_2.getValue("operator");if(_1||(_8==_7.defaultValue&&_7.defaultValue!=_7.$279g)){_7.setValue(null);_8=null}
if(_8==null||_2.getValue("operator")!=_8){if(_1||_2.getValue("operator")==null){var _9=null;if(_7.getValueMap()[_7.$279g]){_9=_7.defaultValue=_7.$279g}else if(_7.getValueMap()[_7.defaultValue]){_9=_7.defaultValue}else{_9=_7.getFirstOptionValue()}
_7.setValue(_9)}
_8=_2.getValue("operator")}
_8=this.getSearchOperator(_8,_5);var _10;if(_2.getItem("value")){var _11=_2.getItem("value").type,_12=_5.type||"text";var _13=_12=="intEnum"||_12=="enum"||isc.SimpleType.inheritsFrom(_12,"enum")||isc.SimpleType.inheritsFrom(_12,"intEnum");_10=_13||_11!=_12}
this.removeValueFields(_10);if(_3)this.clause.removeExtraAdvancedCriteriaFields([_3]);_2.addItems(this.buildValueItemList(_5,_8,_4));if(this.valueQueryRelatedFieldButton){if(_2.getItem("valueQuery")){this.valueQueryRelatedFieldButton.show()}else{this.valueQueryRelatedFieldButton.hide()}
}
if(this.valueQueryAggregateButton){if(_2.getItem("valueQuery")){this.valueQueryAggregateButton.show()}else{this.valueQueryAggregateButton.hide()}
}
if(this.dynamicValueButton){if(_2.getItem("valuePath")){this.dynamicValueButton.show()}else{this.dynamicValueButton.hide()}
}
var _14=_2.getItem("value");if(!_10){var _15=((_5.valueMap||_5.optionDataSource)||(_6&&(_6.valueMap||_6.optionDataSource))||!this.retainValuesAcrossFields
);if(_14&&_15)_14.clearValue()}
if(_14)_14.validate();if(_2.getItem("start")){_2.setValue("start",null);_2.getItem("start").validate()}
if(_2.getItem("end")){_2.setValue("end",null);_2.getItem("end").validate()}
if(_2.getValue("valuePath")!=null){_2.getItem("value").hide();_2.getItem("valueQuery").hide();_2.getItem("valuePath").show()}
if(_2.getValue("valueQuery")!=null){_2.getItem("value").hide();_2.getItem("valuePath").hide();_2.getItem("valueQuery").show()}
this.$74o=_4}
,isc.A.$198w=function isc_FilterClause__getFieldOperators(_1){var _2=_1&&_1.name,_3=this.getFieldOperators(_2,_1);if(this.createRuleCriteria){var _4=isc.DS.getSearchOperators();_3=_3.filter(function(_6){var _5=_4[_6];return(!_5||_5.valueType!="fieldName")})}
if(_1.foreignKey){if(!_1.validOperators&&!isc.SimpleType.getValidOperators(_1.type)){_3=this.foreignKeyOperators.duplicate()}
}
return _3}
,isc.A.getFieldOperators=function isc_FilterClause_getFieldOperators(_1,_2){var _3=this.getFilterBuilder();if(!_3)return null;_2=_2||this.getField(_1);return _3.getFieldOperators(_1,_2)}
,isc.A.topOperatorChanged=function isc_FilterClause_topOperatorChanged(_1){}
,isc.A.fieldQueryButtonClick=function isc_FilterClause_fieldQueryButtonClick(_1){var _2=this.fieldQueryWindowTitle,_3=this.clause.getValue("fieldQuery")||this.$270o
;var _4=this;var _5=function(){_4.$277y(_1,_3,_2,"fieldQueryWindow",function(_6){_4.setClauseFieldQuery(_6)})};if(this.isAggregateSubquery(_3)&&_1==this.$276r){isc.confirm("Currently, aggregation is enabled.  If you open the Related Field editor, aggregation will be lost if you save.  Continue?",function(_6){if(_6)_5()})}else{_5()}}
,isc.A.valueQueryButtonClick=function isc_FilterClause_valueQueryButtonClick(_1){var _2=this.getFieldTitle(),_3=this.valueQueryWindowTitle.evalDynamicString(this,{fieldTitle:_2}),_4=this.clause.getValue("valueQuery")||this.$270p
;var _5=this;var _6=function(){_5.$277y(_1,_4,_3,"valueQueryWindow",function(_7){_5.setClauseValueQuery(_7)})};if(this.isAggregateSubquery(_4)&&_1==this.$276r){isc.confirm("Currently, aggregation is enabled.  If you open the Related Field editor, aggregation will be lost if you save.  Continue?",function(_7){if(_7)_6()})}else if(this.isRelatedFieldSubquery(_4)&&_1==this.$270l){isc.confirm("Currently, related field is enabled.  If you open the Aggregation editor, related field will be lost if you save.  Continue?",function(_7){if(_7)_6()})}else{_6()}}
,isc.A.$277y=function isc_FilterClause__showSubquery(_1,_2,_3,_4,_5){if(this[_4]){if(!this[_4].destroyed)this[_4].markForDestroy();this[_4]=null}
var _6=(_1==this.$270l?"subQueryAggregationEditor":"subQueryRelatedCriteriaEditor"),_7=(_1==this.$270l);var _8=this.createAutoChild(_6,{showDataSourcePicker:true,showCriteriaEditor:true,showSortByPicker:_7,allowCriteriaAggregates:this.allowAggregates,rootDS:this.getDataSource(),dataSources:this.getAggregationDataSources()
});this[_4]=this.createSubQueryWindow(_3,_2,_5,_8);this[_4].show()}
,isc.A.dynamicValueButtonClick=function isc_FilterClause_dynamicValueButtonClick(){var _1=this.getFieldTitle(),_2=this.dynamicValueWindowTitle.evalDynamicString(this,{fieldTitle:_1}),_3=this.clause.getValue("valuePath")
;if(!this.dynamicValueWindow){var _4=this.getFieldName(),_5=(this.multiDSFieldFormat==isc.FilterBuilder.SEPARATED?"title":"name"),_6=function(_7){this.creator.setClauseValuePath(_7)}
;this.createDynamicValueWindow(_2,_4,_5,_3,_6)}else{this.dynamicValueWindow.setTitle(_2);this.dynamicValueWindow.setSelectedValue(_3)}
this.dynamicValueWindow.show()}
,isc.A.setClauseFieldName=function isc_FilterClause_setClauseFieldName(_1){var _2=this.clause,_3=_2.getValue("fieldName")
;if(_3!=_1){_2.setValue("fieldName",_1);this.fieldNameChanged()}}
,isc.A.setClauseFieldQuery=function isc_FilterClause_setClauseFieldQuery(_1){var _2=this.clause;if(!isc.isAn.emptyObject(_1)){if(_1.dataSource==this.getPrimaryDS().getID()){delete _1.dataSource}
_2.setValue("fieldName",(this.isRelatedFieldSubquery(_1)?this.$276r:this.$270l));_2.setValue("fieldQuery",_1);this.fieldNameChanged()}else if(_2.getValue("fieldName")==this.$270l||_2.getValue("fieldName")==this.$276r)
{_2.clearValue("fieldName")}}
,isc.A.setClauseValueQuery=function isc_FilterClause_setClauseValueQuery(_1){var _2=this.clause;if(!isc.isAn.emptyObject(_1)){_2.setValue("valueQuery",_1);_2.getItem("value").defaultValue=null;_2.getItem("value").clearValue();_2.getItem("valuePath").defaultValue=null;_2.getItem("valuePath").clearValue();this.$270p=_1}else{_2.getItem("valueQuery").defaultValue=null;_2.getItem("valueQuery").clearValue()}
if(!isc.isAn.emptyObject(_1)){_2.getItem("valueQuery").show();_2.getItem("valuePath").hide();_2.getItem("value").hide()}else{_2.getItem("valueQuery").hide();_2.getItem("valuePath").hide();_2.getItem("value").show()}
if(isc.isA.Function(this.filterBuilder.filterChanged)){this.filterBuilder.filterChanged()}}
,isc.A.setClauseValuePath=function isc_FilterClause_setClauseValuePath(_1){var _2=this.clause;if(_1!=null){_2.setValue("valuePath",_1);_2.getItem("value").defaultValue=null;_2.getItem("value").clearValue()}else{_2.getItem("valuePath").defaultValue=null;_2.getItem("valuePath").clearValue()}
if(_1){_2.getItem("valuePath").show();_2.getItem("value").hide()}else{_2.getItem("valuePath").hide();_2.getItem("value").show()}
if(!this.filterBuilder.$845&&isc.isA.Function(this.filterBuilder.filterChanged))
{this.filterBuilder.filterChanged()}}
,isc.A.createSubQueryWindow=function isc_FilterClause_createSubQueryWindow(_1,_2,_3,_4){var _5=this.createAutoChild("subQueryWindow",{title:_1
});var _6=this.createAutoChild("subQueryClearButton",{click:function(){if(_3)_3({});_5.closeClick()}
});var _7=this.createAutoChild("subQueryOkButton",{click:function(){var _8=_4.getRequest();if(_3)_3(_8);_5.closeClick()}
});var _9=this.createAutoChild("subQueryCancelButton",{click:function(){_5.closeClick()}
});var _10=this.createAutoChild("subQueryToolBar",{members:[_6,isc.LayoutSpacer.create({width:50}),_9,_7]
});_5.addItems([_4,_10]);if(!_2){_4.setDataSource(this.getPrimaryDS())
}else{_4.setRequest(_2)
}
return _5}
,isc.A.getAggregationDataSources=function isc_FilterClause_getAggregationDataSources(){var _1=this.aggregationDataSources;if(!_1){_1=[this.getDataSource().getID()]
.addList(this.getRelatedDataSources().sort())
.addList(this.getUnrelatedDataSources().sort())}
return _1}
,isc.A.getRelatedDataSources=function isc_FilterClause_getRelatedDataSources(){var _1=this.getDataSource(),_2=isc.DS.getRegisteredDataSources(),_3=_2.map(function(_8){return isc.DS.get(_8)})
.filter(function(_8){return _8!=null}),_4=isc.DSRelations.create({dataSources:_3
})
;_4.buildRelations();var _5=_4.getAllRelationsForDataSource(_1.getID());var _6={};return _5.map(function(_8){return _8.dsId})
.filter(function(_8){var _7=_6[_8];_6[_8]=true;return!_7})}
,isc.A.getUnrelatedDataSources=function isc_FilterClause_getUnrelatedDataSources(){var _1=this.getDataSource(),_2=isc.DS.getRegisteredDataSources(),_3=this.getRelatedDataSources()
;var _4={};_4[_1.getID()]=true;_3.map(function(_7){_4[_7]=true});return _2.filter(function(_7){var _5=isc.DS.get(_7),_6=_4[_7];_4[_7]=true;return!_6&&_5&&!_5.componentSchema&&!_5.builtinSchema&&_5.addGlobalId!=false&&!_5.$145w&&!_5._autoAssignedID})}
,isc.A.createDynamicValueWindow=function isc_FilterClause_createDynamicValueWindow(_1,_2,_3,_4,_5){this.dynamicValueWindow=this.createAutoChild("dynamicValueWindow",{title:_1,ruleScopeDataSources:this.$171s,targetRuleScope:this.getTopLevelFilterBuilder().$167n,targetComponent:this.getTopLevelFilterBuilder().targetComponent,multiDSFieldFormat:this.multiDSFieldFormat,selectedValue:_4,valueSelected:_5
})}
);isc.B._maxIndex=isc.C+64;isc.FilterClause.registerStringMethods({remove:""});isc.defineClass("FilterBuilder","Layout");isc.A=isc.FilterBuilder;isc.A.missingFieldPrompt="[missing field definition]";isc.A.SEPARATED="separated";isc.A.QUALIFIED="qualified";isc.A=isc.FilterBuilder;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.getFilterDescription=function isc_c_FilterBuilder_getFilterDescription(_1,_2){return isc.DataSource.getAdvancedCriteriaDescription(_1,_2)}
);isc.B._maxIndex=isc.C+1;isc.A=isc.FilterBuilder.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.vPolicy="none";isc.A.height=1;isc.A.defaultWidth=400;isc.A.sortFields=true;isc.A.fieldPickerDefaults={name:"fieldName",textMatchStyle:"startsWith",showTitle:false,hint:"Choose a field",showHintInField:true,pickListWidth:125,separateSpecialValues:true,separateValuesListProperties:{recordClick:function(_1,_2,_3,_4,_5,_6,_7,_8){if(_2&&(_2.value==_1.formItem.form.creator.$270l||_2.value==_1.formItem.form.creator.$276r))
{_1.pickList.hide();_1.formItem.form.creator.fieldQueryButtonClick(_2.value);return false}
return this.Super("recordClick",arguments)},getCellCSSText:function(_1,_2,_3){return this.creator.specialValuesCSS},showHover:true,canHover:true,cellHoverHTML:function(_1,_2,_3){if(this.getRawCellValue(_1,_2,_3)==this.formItem.form.creator.$270m){if(!this.$270q){this.$270q=isc.OptionalAggregationEditor.getInstanceProperty("useAggregationPrompt")}
return this.$270q}
return""}
},changed:function(_1,_2,_3){_1.creator.fieldNameChanged(_1)},doubleClick:function(_1,_2){if(!_1.creator.allowAggregates)return;var _3=_1.getValue("fieldQuery"),_4=(_1.creator.isRelatedFieldSubquery(_3)?_1.creator.$276r:(_1.creator.isAggregateSubquery(_3)?_1.creator.$270l:null))
;if(_4){_1.creator.fieldQueryButtonClick(_4);return false}
},mapValueToDisplay:function(_1){var _2=this.form.creator.clause.getValue("fieldQuery");if(_2&&(_1==this.form.creator.$270l||_1==this.form.creator.$276r))
{return this.form.creator.getSubQueryDescription(_2,true)}
return this.Super("mapValueToDisplay",arguments)},getTitleForSelectedValue:function(){var _1=this.getValue(),_2=this.form.creator.clause.getValue("fieldQuery");return(_2&&_1==this.form.creator.$270l?"[aggregated value]":this.mapValueToDisplay(_1))}};isc.A.fieldPickerTitle="Field Name";isc.A.operatorPickerDefaults={name:"operator",editorType:"SelectItem",showTitle:false,addUnknownValues:false,defaultToFirstOption:true,changed:function(){this.form.creator.operatorChanged(this.form)}};isc.A.operatorPickerTitle="Operator";isc.A.fieldPickerWidth="*";isc.A.operatorPickerWidth=150;isc.A.valueItemWidth=150;isc.A.multiDSFieldFormat=isc.FilterBuilder.SEPARATED;isc.A.dynamicValuePrefix="Dynamic:";isc.A.dynamicValueButtonPrompt="Select dynamic value";isc.A.dynamicValueWindowTitle="Choose dynamic value for field ${fieldTitle}";isc.A.dynamicValueClearValueText="&lt;Use static value instead&gt;";isc.A.showFieldTitles=true;isc.A.validateOnChange=true;isc.A.showRemoveButton=true;isc.A.removeButtonPrompt="Remove";isc.A.lastClausePrompt="The last clause cannot be removed";isc.A.removeButtonDefaults={_constructor:isc.ImgButton,width:18,height:18,layoutAlign:"center",src:"[SKIN]/actions/remove.png",showRollOver:false,showDown:false,click:function(){this.creator.removeButtonClick(this.clause)}};isc.A.showAddButton=true;isc.A.addButtonPrompt="Add";isc.A.addButtonDefaults={_constructor:isc.ImgButton,autoParent:"buttonBar",layoutAlign:"center",width:18,height:18,imageWidth:10,imageHeight:10,extraSpace:5,src:"[SKIN]/actions/add.png",showRollOver:false,showDown:false,click:function(){this.creator.addButtonClick(this.clause)}};isc.A.buttonBarDefaults={_constructor:isc.HStack,autoParent:"clauseStack",membersMargin:4,defaultLayoutAlign:"center",height:1};isc.A.retainValuesAcrossFields=true;isc.A.topOperatorOptions=["and","or","not"];isc.A.topOperator="and";isc.A.topOperatorAppearance="bracket";isc.A.radioOperatorLayoutDefaults={autoParent:"clauseStack",_constructor:isc.HLayout,height:1,width:1,defaultLayoutAlign:"bottom"};isc.A.radioOperatorFormDefaults={autoParent:"radioOperatorLayout",height:1,numCols:1,colWidths:["*"],width:275,extraSpace:10,items:[{name:"operator",type:"radioGroup",showTitle:false,title:"Overall Operator",wrapTitle:false,wrap:false,vertical:false,changed:function(_1,_2,_3){_1.creator.topOperatorChanged(_3)}
}
]};isc.A.radioOperatorFormConstructor=isc.DynamicForm;isc.A.modeSwitcherDefaults={height:30,autoFit:true,wrap:false,cursor:"pointer",click:function(){this.creator.switchMode()}};isc.A.modeSwitcherConstructor=isc.Label;isc.A.radioOperatorTitle="Overall Operator";isc.A.topOperatorFormDefaults={height:1,width:80,numCols:1,colWidths:["*"],layoutAlign:"top",extraSpace:5,_constructor:isc.DynamicForm};isc.A.topOperatorItemDefaults={name:"operator",editorType:"SelectItem",showTitle:false,changed:function(_1,_2,_3){_1.creator.topOperatorChanged(_3)}};isc.A.topOperatorItemWidth="*";isc.A.topOperatorTitle="Clause Operator";isc.A.defaultSubClauseOperator="or";isc.A.matchAllTitle="Match All";isc.A.matchNoneTitle="Match None";isc.A.matchAnyTitle="Match Any";isc.A.inlineAndTitle="and";isc.A.inlineOrTitle="or";isc.A.inlineAndNotTitle="and not";isc.A.modeSwitcherAdvancedMessage="Advanced..";isc.A.modeSwitcherSimpleMessage="Simple Mode..";isc.A.modeSwitcherFlattenWarningMessage="Criteria will be modified to fit in simpler editing interface";isc.A.clauseStackDefaults={_constructor:isc.VStack,height:1,membersMargin:1,animateMembers:true,animateMemberTime:150};isc.A.clauseConstructor="FilterClause";isc.A.rangeSeparator="and";isc.A.subClauseButtonTitle="+()";isc.A.subClauseButtonPrompt="Add Subclause";isc.A.subClauseButtonDefaults={_constructor:"IButton",autoParent:"buttonBar",autoFit:true,click:function(){this.creator.addSubClause(this.clause)}};isc.A.bracketDefaults={styleName:"bracketBorders",width:10};isc.A.$175q=null;isc.A.$175r=null;isc.A.$10j="Enter";isc.A.allowEmptyValues=false;isc.B.push(isc.A.setDataSource=function isc_FilterBuilder_setDataSource(_1){var _2=isc.DataSource.get(_1);if(!_2||!this.dataSource||(isc.DataSource.get(this.dataSource).ID!=_2.ID)){this.dataSource=_2;if(this.clauses)this.clearCriteria();else this.rebuild()}}
,isc.A.setDataSources=function isc_FilterBuilder_setDataSources(_1){this.dataSources=_1;if(this.clauses)this.clearCriteria();else this.rebuild()}
,isc.A.addButtonClick=function isc_FilterBuilder_addButtonClick(){this.addNewClause()}
,isc.A.removeButtonClick=function isc_FilterBuilder_removeButtonClick(_1){if(!_1)return;this.removeClause(_1)}
,isc.A.removeClause=function isc_FilterBuilder_removeClause(_1){this.clauses.remove(_1);if(this.clauseStack)this.clauseStack.hideMember(_1,function(){_1.destroy()});this.updateFirstRemoveButton();if(this.clauses[0]&&this.clauses[0].updateInlineTopOperator)this.clauses[0].updateInlineTopOperator();_1.filterBuilder=null;if(!this.$845&&isc.isA.Function(this.filterChanged))this.filterChanged()}
,isc.A.updateFirstRemoveButton=function isc_FilterBuilder_updateFirstRemoveButton(){var _1=this.clauses[0];if(!_1||!_1.removeButton)return;if(this.clauses.length==1&&!this.allowEmpty){_1.removeButton.disable()}else if(this.clauses.length>1){_1.removeButton.enable()}}
,isc.A.isFirstClause=function isc_FilterBuilder_isFirstClause(_1){return this.clauses[0]==_1}
,isc.A.setTopOperator=function isc_FilterBuilder_setTopOperator(_1){this.topOperator=_1;var _2=this.topOperatorAppearance;if(_2=="bracket"){this.topOperatorForm.setValue("operator",_1)}else if(_2=="radio"){this.radioOperatorForm.setValue("operator",_1)}}
,isc.A.topOperatorChanged=function isc_FilterBuilder_topOperatorChanged(_1){this.topOperator=_1;if(!this.$845&&isc.isA.Function(this.filterChanged))this.filterChanged()}
,isc.A.setTopOperatorAppearance=function isc_FilterBuilder_setTopOperatorAppearance(_1){if(this.topOperatorAppearance==_1)return;var _2=this.$2366(true);if(this.topOperatorAppearance=="bracket"&&_1=="radio"){_2=isc.DataSource.flattenCriteria(_2)}
this.topOperatorAppearance=_1;this.$1243(_2)}
,isc.A.getPrimaryDS=function isc_FilterBuilder_getPrimaryDS(_1){if(this.dataSources){if(_1==null){return isc.DataSource.get(this.dataSources[0])}
if(isc.isAn.Object(_1)){if(_1.$93k!=null){_1=_1.$93k}
for(var i=0;i<this.dataSources.length;i++){var _3=isc.getValues(this.dataSources[i].getFields());if(_3.contains(_1))return this.dataSources[i]}
_1=_1.name}
return isc.DataSource.getDataSourceForField(_1,this.dataSources)}
if(this.dataSource)return this.getDataSource();else if(this.fieldDataSource)return this.fieldDataSource}
,isc.A.getTopOperatorMap=function isc_FilterBuilder_getTopOperatorMap(_1){var _2=this.getPrimaryDS(),_3=_1=="bracket"?_2?_2.getTypeOperatorMap(null,true,"criteria"):null:null
;if(!_3||isc.isAn.emptyObject(_3)){_3={"and":this.matchAllTitle,"or":this.matchAnyTitle,"not":this.matchNoneTitle
}}
var _4=this.topOperator,_5=this.topOperatorOptions,_6={}
;if(!_5.contains(_4))this.topOperator=_5[0];if(_3){for(var i=0;i<_5.length;i++){if(_3[_5[i]])_6[_5[i]]=_3[_5[i]]}
}
return _6}
,isc.A.initWidget=function isc_FilterBuilder_initWidget(){this.Super("initWidget",arguments);if(this.targetRuleScope){if(this.allowRuleScopeValues!=false)this.allowRuleScopeValues=true;var _1=this.targetRuleScope;this.$167n=(isc.isA.String(_1)?window[_1]:this.targetRuleScope);if(!this.$171s){this.$171s=isc.Canvas.getAllRuleScopeDataSources(this.$167n);this.$172r=true}
if(this.createRuleCriteria){this.dataSource=null;this.dataSources=this.$171s}
}
if(this.allowAggregates&&this.allowRelatedRecordCriteria!=false){this.allowRelatedRecordCriteria=true}
this.valueQueryAggregateButtonPrompt=isc.OptionalAggregationEditor.getInstanceProperty("useAggregationPrompt");this.rebuild()}
,isc.A.destroy=function isc_FilterBuilder_destroy(){this.destroyRuleScopeDataSources();this.Super("destroy",arguments)}
,isc.A.destroyRuleScopeDataSources=function isc_FilterBuilder_destroyRuleScopeDataSources(){if(this.$171s&&this.$172r){for(var i=0;i<this.$171s.length;i++){var _2=this.$171s[i];if(_2.$197d){_2.destroy()}
}
delete this.$171s}}
,isc.A.setTargetRuleScope=function isc_FilterBuilder_setTargetRuleScope(_1){this.targetRuleScope=_1;if(_1){if(this.allowRuleScopeValues!=false)this.allowRuleScopeValues=true;this.$167n=(isc.isA.String(_1)?window[_1]:_1)}
this.rebuild()}
,isc.A.setRuleScopeDataSources=function isc_FilterBuilder_setRuleScopeDataSources(_1){this.destroyRuleScopeDataSources();this.$171s=_1;this.$172r=false;if(this.createRuleCriteria){this.dataSource=null;this.dataSources=this.$171s}
this.rebuild();return this}
,isc.A.rebuild=function isc_FilterBuilder_rebuild(){if(isc.isA.String(this.fieldDataSource))
this.fieldDataSource=isc.DS.get(this.fieldDataSource);if(isc.isA.String(this.dataSource))
this.dataSource=isc.DS.get(this.dataSource);if(!this.getPrimaryDS())this.logInfo("No available DataSources.");if(this.fieldDataSource&&this.criteria)this.$75v=true;this.fieldPickerDefaults.title=this.fieldPickerTitle;if(this.radioOptions)this.topOperatorOptions=this.radioOptions.duplicate();delete this.radioOptions;this.addButtonDefaults.prompt=this.addButtonPrompt;this.removeButtonDefaults.prompt=this.removeButtonPrompt;this.subClauseButtonDefaults.prompt=this.subClauseButtonPrompt;this.subClauseButtonDefaults.title=this.subClauseButtonTitle;this.$211()}
,isc.A.$1243=function isc_FilterBuilder__recreateForm(_1){this.criteria=_1;delete this.showSubClauseButton;this.topOperatorForm=this.bracket=this.clauseStack=null;this.radioOperatorForm=this.radioOperatorLayout=this.modeSwitcher=null;this.buttonBar=this.addButton=this.subClauseButton=null;for(var i=0,_3=this.clauses;i<_3.length;i++){_3[i].destroy()}
var _4=this.getMembers().duplicate();for(var i=0;i<_4.length;i++){this.removeMember(_4[i]);_4[i].destroy()}
this.$211()}
,isc.A.$211=function isc_FilterBuilder__createForm(){var _1;if(this.showSubClauseButton==_1){this.showSubClauseButton=(this.topOperatorAppearance!="radio"&&this.topOperatorAppearance!="inline")}
this.clauses=[];var _2=this.topOperatorAppearance;var _3=this.getPrimaryDS(),_4=this.getTopOperatorMap(_2)
;if(this.showModeSwitcher){var _5="<span style='color:blue;text-decoration:underline;'>"+(_2=="radio"?this.modeSwitcherAdvancedMessage:this.modeSwitcherSimpleMessage)+"</span>";this.modeSwitcher=this.createAutoChild("modeSwitcher",{contents:_5})}
if(_2=="bracket"){if(this.showTopRemoveButton){var _6={click:function(){this.creator.parentClause.removeButtonClick(this.creator)}
};if(this.iconSize)_6.width=_6.height=this.iconSize;if(this.iconBaseStyle)_6.baseStyle=this.iconBaseStyle;var _7=this.removeButton=this.createAutoChild("removeButton",_6);this.addMember(_7)}
var _8={items:[isc.addProperties({width:this.topOperatorItemWidth},this.topOperatorItemDefaults,this.topOperatorItemProperties
)]
};this.addAutoChild("topOperatorForm",_8);this.topOperatorForm.items[0].title=this.topOperatorTitle;this.topOperatorForm.items[0].valueMap=_4;this.topOperatorForm.items[0].defaultValue=this.topOperator;this.addAutoChild("bracket")}
this.addAutoChild("clauseStack");this.clauseStack.hide();if(_2=="radio"){this.addAutoChild("radioOperatorLayout");this.addAutoChild("radioOperatorForm");var _9=_4;this.radioOperatorForm.items[0].title=this.radioOperatorTitle;this.radioOperatorForm.items[0].valueMap=_9;this.radioOperatorForm.items[0].defaultValue=this.topOperator;if(this.showModeSwitcher)this.radioOperatorLayout.addMember(this.modeSwitcher)}
this.addAutoChild("buttonBar");var _6={};if(this.iconSize)_6.width=_6.height=this.iconSize;if(this.iconBaseStyle)_6.baseStyle=this.iconBaseStyle;this.addAutoChild("addButton",_6);this.addAutoChild("subClauseButton");if(this.showModeSwitcher&&_2=="bracket"){this.buttonBar.addMember(isc.LayoutSpacer.create({width:20}));this.buttonBar.addMember(this.modeSwitcher)}
this.stripNullCriteria(this.criteria);this.expandCriteriaShortcuts(this.criteria);this.$155t(this.criteria)}
,isc.A.switchMode=function isc_FilterBuilder_switchMode(){if(this.topOperatorAppearance=="bracket"){var _1=this.$2366(true);if(!isc.DataSource.canFlattenCriteria(_1)){var _2=this;isc.confirm(this.modeSwitcherFlattenWarningMessage,function(_3){if(_3)_2.setTopOperatorAppearance("radio")});return}
this.setTopOperatorAppearance("radio")}else{this.setTopOperatorAppearance("bracket")}}
,isc.A.addNewClause=function isc_FilterBuilder_addNewClause(_1,_2,_3){var _4;if(_1){_4=[];isc.DS.$246m(_1,_4)}
var _5=this.createAutoChild("clause",isc.addProperties({},this.inheritedClauseProperties,{visibility:"hidden",flattenItems:true,criterion:_1,dataSources:this.dataSources,dataSource:this.dataSource,fieldDataSource:this.fieldDataSource,$171s:this.$171s,sortFields:this.sortFields,allowedFields:this.allowedFields,validateOnChange:this.validateOnChange,showHiddenFields:this.showHiddenFields,showFieldTitles:this.showFieldTitles,showRemoveButton:this.showRemoveButton,removeButtonPrompt:this.removeButtonPrompt,retainValuesAcrossFields:this.retainValuesAcrossFields,defaultFieldName:this.defaultFieldName,field:_2,fieldData:this.fieldData,fieldPickerDefaults:this.fieldPickerDefaults,fieldPickerProperties:this.fieldPickerProperties,fieldPickerWidth:this.fieldPickerWidth,operatorPickerWidth:this.operatorPickerWidth,valueItemWidth:this.valueItemWidth,operatorPickerDefaults:this.operatorPickerDefaults,operatorPickerProperties:this.operatorPickerProperties,remove:function(){this.creator.removeClause(this)},fieldNameChanged:function(){this.Super("fieldNameChanged",arguments);this.creator.fieldNameChanged(this)},topOperatorAppearance:this.topOperatorAppearance,topOperator:this.topOperator,topOperatorOptions:this.topOperatorOptions,topOperatorFormDefaults:this.topOperatorFormDefaults,topOperatorFormProperties:this.topOperatorFormProperties,topOperatorItemDefaults:this.topOperatorItemDefaults,topOperatorItemProperties:this.topOperatorItemProperties,topOperatorItemWidth:this.topOperatorItemWidth,showSelectionCheckbox:this.showSelectionCheckbox,negated:_3,filterBuilder:this,width:"100%",allowAggregates:this.allowAggregates,aggregationDataSources:this.aggregationDataSources,allowRelatedRecordCriteria:this.allowRelatedRecordCriteria,fieldQueryWindowTitle:this.fieldQueryWindowTitle,valueQueryRelatedFieldPrefix:this.valueQueryRelatedFieldPrefix,valueQueryAggregatePrefix:this.valueQueryAggregatePrefix,valueQueryRelatedFieldButtonPrompt:this.valueQueryRelatedFieldButtonPrompt,valueQueryAggregateButtonPrompt:this.valueQueryAggregateButtonPrompt,valueQueryWindowTitle:this.valueQueryWindowTitle,multiDSFieldFormat:this.multiDSFieldFormat,dynamicValuePrefix:this.dynamicValuePrefix+" ",dynamicValueButtonPrompt:this.dynamicValueButtonPrompt,dynamicValueWindowTitle:this.dynamicValueWindowTitle,dynamicValueClearValueText:this.dynamicValueClearValueText,allowRuleScopeValues:this.allowRuleScopeValues,createRuleCriteria:this.createRuleCriteria,inheritedClauseProperties:this.inheritedClauseProperties,extraOperators:_4,iconSize:this.iconSize,iconBaseStyle:this.iconBaseStyle
})
);var _6=this.$74e(_5);_5.updateInlineTopOperator();return _6}
,isc.A.addClause=function isc_FilterBuilder_addClause(_1){if(!_1)return _1;var _2=this;_1.fieldDataSource=this.fieldDataSource;_1.remove=function(){_2.removeClause(this)};_1.fieldNameChanged=function(){this.Super("fieldNameChanged",arguments);_2.fieldNameChanged(this)};var _3=this.$74e(_1);_1.updateInlineTopOperator();return _3}
,isc.A.$74e=function isc_FilterBuilder__addClause(_1){_1.filterBuilder=this;_1.updateFields();this.clauses.add(_1);var _2=this.clauseStack,_3=Math.max(0,_2.getMemberNumber(this.buttonBar)),_4=this
;_2.addMember(_1,_3);_2.showMember(_1,function(){if(!_4.$845)_1.setDefaultFocus()}
);this.updateFirstRemoveButton();if(!this.$845&&isc.isA.Function(this.filterChanged))this.filterChanged();return _1}
,isc.A.getChildFilters=function isc_FilterBuilder_getChildFilters(){var _1=[];for(var i=0;i<this.clauses.length;i++){var _3=this.clauses[i];if(isc.isA.FilterBuilder(_3))_1.add(_3)}
return _1}
,isc.A.setFocus=function isc_FilterBuilder_setFocus(_1){if(_1&&this.clauses&&this.clauses[0])this.clauses[0].setDefaultFocus();else this.Super("setFocus",arguments)}
,isc.A.getFilterDescription=function isc_FilterBuilder_getFilterDescription(){return isc.DataSource.getAdvancedCriteriaDescription(this.$2366(),(this.dataSources||this.dataSource))}
,isc.A.validate=function isc_FilterBuilder_validate(){var _1=true;for(var i=0;i<this.clauses.length;i++){if(!this.clauses[i].validate(null,null,true))_1=false}
return _1}
,isc.A.getFieldOperators=function isc_FilterBuilder_getFieldOperators(_1,_2){_2=_2||_1;var _3=this.getPrimaryDS(_2);return _3?_3.getFieldOperators(_2):null}
,isc.A.getValueFieldProperties=function isc_FilterBuilder_getValueFieldProperties(_1,_2,_3,_4){if(this.filterBuilder){return this.filterBuilder.getValueFieldProperties(_1,_2,_3,_4)}}
,isc.A.getRangeSeparatorProperties=function isc_FilterBuilder_getRangeSeparatorProperties(_1,_2,_3){return this.rangeSeparatorProperties}
,isc.A.childResized=function isc_FilterBuilder_childResized(){this.Super("childResized",arguments);if(this.clauseStack){var _1=this.clauseStack.getVisibleHeight();if(this.bracket)this.bracket.setHeight(_1);if(this.topOperatorAppearance=="bracket"){this.topOperatorForm.setTopPadding((_1-this.topOperatorForm.getItem(0).getHeight())/2)}
}}
,isc.A.draw=function isc_FilterBuilder_draw(){this.Super("draw",arguments);if(this.clauseStack){var _1=this.clauseStack.getVisibleHeight();if(this.bracket)this.bracket.setHeight(_1);if(this.topOperatorAppearance=="bracket"){this.topOperatorForm.setTopPadding((_1-this.topOperatorForm.getItem(0).getHeight())/2)}
}
if(!this.$234r&&!this.parentClause&&this.showModeSwitcher&&this.topOperatorAppearance=="bracket"){var _2=this.$2366(true);if(isc.DataSource.canFlattenCriteria(_2))this.setTopOperatorAppearance("radio");this.$234r=true}}
,isc.A.resized=function isc_FilterBuilder_resized(){if(this.clauseStack&&this.bracket)this.bracket.setHeight(this.clauseStack.getVisibleHeight())}
,isc.A.addSubClause=function isc_FilterBuilder_addSubClause(_1){var _2;if(_1){_2=_1.operator}
var _3=this.createAutoChild("subClause",{dataSource:this.dataSource,dataSources:this.dataSources,showFieldTitles:this.showFieldTitles,showHiddenFields:this.showHiddenFields,allowedFields:this.allowedFields,filterBuilder:this,parentClause:this,retainValuesAcrossFields:this.retainValuesAcrossFields,topOperatorAppearance:"bracket",topOperator:_2||this.defaultSubClauseOperator||this.topOperator,topOperatorOptions:this.topOperatorOptions,clauseConstructor:this.clauseConstructor,topOperatorFormDefaults:this.topOperatorFormDefaults,topOperatorFormProperties:this.topOperatorFormProperties,topOperatorItemDefaults:this.topOperatorItemDefaults,topOperatorItemProperties:this.topOperatorItemProperties,topOperatorItemWidth:this.topOperatorItemWidth,fieldPickerDefaults:this.fieldPickerDefaults,fieldPickerProperties:this.fieldPickerProperties,subClauseButtonTitle:this.subClauseButtonTitle,subClauseButtonPrompt:this.subClauseButtonPrompt,fieldPickerWidth:this.fieldPickerWidth,operatorPickerWidth:this.operatorPickerWidth,valueItemWidth:this.valueItemWidth,operatorPickerProperties:this.operatorPickerProperties,operatorPickerDefaults:this.operatorPickerDefaults,fieldDataSource:this.fieldDataSource,fieldData:this.fieldData,sortFields:this.sortFields,showRemoveButton:this.showRemoveButton,showAddButton:this.showAddButton,showSubClauseButton:this.showSubClauseButton,showTopRemoveButton:this.showSubClauseButton,visibility:"hidden",saveOnEnter:this.saveOnEnter,validateOnChange:this.validateOnChange,dontCreateEmptyChild:_1!=null,allowAggregates:this.allowAggregates,aggregationDataSources:this.aggregationDataSources,allowRelatedRecordCriteria:this.allowRelatedRecordCriteria,fieldQueryWindowTitle:this.fieldQueryWindowTitle,valueQueryRelatedFieldPrefix:this.valueQueryRelatedFieldPrefix,valueQueryAggregatePrefix:this.valueQueryAggregatePrefix,valueQueryRelatedFieldButtonPrompt:this.valueQueryRelatedFieldButtonPrompt,valueQueryAggregateButtonPrompt:this.valueQueryAggregateButtonPrompt,valueQueryWindowTitle:this.valueQueryWindowTitle,$171s:this.$171s,multiDSFieldFormat:this.multiDSFieldFormat,dynamicValuePrefix:this.dynamicValuePrefix+" ",dynamicValueButtonPrompt:this.dynamicValueButtonPrompt,dynamicValueWindowTitle:this.dynamicValueWindowTitle,dynamicValueClearValueText:this.dynamicValueClearValueText,allowRuleScopeValues:this.allowRuleScopeValues,createRuleCriteria:this.createRuleCriteria,filterChanged:function(){var _4=this.filterBuilder;while(_4&&_4.filterBuilder!=null){_4=_4.filterBuilder}
if(_4&&!_4.$845&&isc.isA.Function(_4.filterChanged)){_4.filterChanged()}
},getFieldOperators:function(_5,_6){var _4=this.filterBuilder;while(_4&&_4.filterBuilder!=null){_4=_4.filterBuilder}
if(_4&&isc.isA.Function(_4.getFieldOperators)){return _4.getFieldOperators(_5,_6)}
},inheritedClauseProperties:this.inheritedClauseProperties
},this.Class);this.clauses.add(_3);this.clauseStack.addMember(_3,this.clauses.length-1);this.clauseStack.showMember(_3,function(){_3.topOperatorForm.focusInItem("operator");_3.bracket.setHeight(_3.getVisibleHeight())});this.updateFirstRemoveButton();return _3}
,isc.A.getCriteria=function isc_FilterBuilder_getCriteria(_1){return this.$2366(_1)}
,isc.A.$2366=function isc_FilterBuilder__getCriteria(_1){if(this.$75v){return this.criteria}
if(this.topOperatorAppearance=="inline"){return this.getInlineCriteria(_1)}
var _2={_constructor:"AdvancedCriteria",operator:this.topOperator,criteria:[]
};for(var i=0;i<this.clauses.length;i++){var _4=this.clauses[i],_5,_6=false;if(isc.isA.FilterBuilder(_4)){_5=_4.$2366(_1)}else{_5=_4.getCriterion(_1);_6=(_5==null)}
if(!_6){_2.criteria.add(_5)}
}
if(this.createRuleCriteria){_2=this.$175s(_2)}else{_2=isc.clone(_2)}
return _2}
,isc.A.getInlineCriteria=function isc_FilterBuilder_getInlineCriteria(_1){var _2={_constructor:"AdvancedCriteria",operator:this.topOperator,criteria:[]
};if(this.topOperator=="or"){var _3;for(var i=0;i<this.clauses.length;i++){if(this.clauses[i].topOperatorForm.getValue("operator")=="not"){_3=true;break}
}
if(_3){_2.operator="and";var _5={operator:"or",criteria:[]
}
_2.criteria.add(_5)}
}
for(var i=0;i<this.clauses.length;i++){var _6=this.clauses[i];var _7=_6.topOperatorForm.getValue("operator");if(_7==this.topOperator){if(_3){_5.criteria.add(_6.getCriterion(_1))}else{_2.criteria.add(_6.getCriterion(_1))}
}else{_2.criteria.add({operator:"not",criteria:[_6.getCriterion(_1)]
})}
}
return _2}
,isc.A.filterReady=function isc_FilterBuilder_filterReady(){}
,isc.A.setCriteria=function isc_FilterBuilder_setCriteria(_1){this.$155t(_1);if(this.showModeSwitcher){var _2=this.topOperatorAppearance,_3=isc.DataSource.canFlattenCriteria(_1)
;if(_2=="bracket"&&_3){this.setTopOperatorAppearance("radio")}if(_2!="bracket"&&!_3){this.setTopOperatorAppearance("bracket")}
}}
,isc.A.$155t=function isc_FilterBuilder__setCriteria(_1){this.$845=true;this.clearCriteria(true);var _2=this.clauseStack?this.clauseStack.animateMembers:null;if(this.clauseStack)this.clauseStack.animateMembers=false;this.stripNullCriteria(_1);this.expandCriteriaShortcuts(_1);if(!this.$76t&&this.fieldDataSource&&_1){if(isc.isA.String(this.fieldDataSource)){this.fieldDataSource=isc.DS.getDataSource(this.fieldDataSource)}
var _3=this,_4=this.fieldDataSource.getCriteriaFields(_1),_5={}
;if(_4&&_4.length>0){_5={_constructor:"AdvancedCriteria",operator:"or",criteria:[]};for(i=0;i<_4.length;i++){var _6=_4[i],_7=this.fieldData?this.fieldData[_6]:null;if(!_7){_5.criteria[_5.criteria.length]={fieldName:"name",operator:"equals",value:_6}}
}
if(_5.criteria.length!=0){this.$76t=true;this.fieldDataSource.fetchData(_5,function(_11){_3.fetchFieldsReply(_11,_1)}
);this.$845=false;return}
}
}
if(!_1){if(!this.allowEmpty&&!this.dontCreateEmptyChild)this.addNewClause();this.$845=false;this.clauseStack.show();this.redraw();this.filterReady();return}
if(!isc.DataSource.isAdvancedCriteria(_1,this.getPrimaryDS())){_1=isc.DataSource.convertCriteria(_1,"substring",this.getPrimaryDS())}
if(this.topOperatorAppearance=="inline"){return this.setInlineCriteria(_1,_2)}
this.setTopOperator(_1.operator);if(this.createRuleCriteria){_1=this.$175t(_1)}
if((!_1.criteria||_1.criteria.length==0)&&!this.topOperatorOptions.contains(_1.operator))
{this.logWarn("Found top-level AdvancedCriteria with no sub-criteria. Converting to a top-level 'and' with a single sub-criterion");this.setTopOperator(this.topOperatorOptions.contains(this.topOperator)?this.topOperator:"and");this.addNewClause(_1)}else{for(var i=0;i<_1.criteria.length;i++){var _9=_1.criteria[i],_10=this.fieldData?this.fieldData[_9.fieldName]:null;this.addCriterion(_9,_10)}
if(this.clauses.length==0&&!this.allowEmpty)this.addNewClause()}
delete this.$75v;this.$76t=false;this.$845=false;if(isc.isA.Function(this.filterChanged))this.filterChanged();this.clauseStack.show();this.delayCall("redraw");if(this.clauseStack)this.clauseStack.animateMembers=_2;this.filterReady()}
,isc.A.$175s=function isc_FilterBuilder__translateFieldNamesToCriteriaPaths(_1){this.$175u();if(!isc.isA.emptyObject(this.$175q)){_1=isc.DataSource.copyCriteria(_1);this.$175v(_1,this.$175q,"ID",true)}
return _1}
,isc.A.$175t=function isc_FilterBuilder__translateCriteriaPathsToFieldNames(_1){this.$175u();if(!isc.isA.emptyObject(this.$175r)){_1=isc.DataSource.copyCriteria(_1);this.$175v(_1,this.$175r,"criteriaBasePath")}
return _1}
,isc.A.$175v=function isc_FilterBuilder__translateFieldNames(_1,_2,_3,_4){var _5=this.$179k(_1,_2,_3,_4,"fieldName");var _6=this.getPrimaryDS(_5);if(_6){var _7=_6.getSearchOperator(_1.operator);if(_7&&_7.valueType=="fieldName"){this.$179k(_1,_2,_3,_4,"value")}
}
if(_1.criteria){for(var i=0;i<_1.criteria.length;i++){this.$175v(_1.criteria[i],_2,_3,_4)}
}}
,isc.A.$179k=function isc_FilterBuilder__mapCriteriaFieldName(_1,_2,_3,_4,_5){var _6=_1[_5];if(_6&&!_6.contains(".")){_6=this.$177t(_6,_3)}
if(_6&&_2[_6]){_1[_5]=_2[_6];if(_4&&_1[_5].contains(".")&&_6!=isc.Canvas.$177s(_6)&&this.targetComponent)
{var _7=this.targetComponent.ID+".values.";_1[_5]=_1[_5].replace(_7,"")}
}
return _6}
,isc.A.$177t=function isc_FilterBuilder__globalizeFieldName(_1,_2){var _3=this.$171s;if(_3){var _4=this.targetComponent.ID+".values";for(var i=0;i<_3.length;i++){if(_3[i].criteriaBasePath==_4){_1=_3[i][_2]+"."+_1;break}
}
}
return _1}
,isc.A.$175u=function isc_FilterBuilder__populateCriteriaPathMaps(){if(this.$175q)return;var _1=this.$171s,_2={},_3={}
;if(_1){for(var i=0;i<_1.length;i++){var _5=_1[i],_6=_5.criteriaBasePath,_7=_5.getFieldNames()
;for(var j=0;j<_7.length;j++){var _9=_5.getField(_7[j]),_10=(_5.$229f?_5.tagName:null)||_5.getID(),_11=_10+"."+_9.name
;if(_6||_9.criteriaPath){var _12=_9.criteriaPath||(_6+"."+_9.name)
_2[_11]=_12;_3[_12]=_11}
}
}
}
this.$175q=_2;this.$175r=_3}
,isc.A.setInlineCriteria=function isc_FilterBuilder_setInlineCriteria(_1,_2){var _3=true,_4=false,_5=false;if(_1.operator=="and"){for(var i=0;i<_1.criteria.length;i++){var _7=_1.criteria[i];if(!_7.criteria){_4=true}else{if(_7.operator=="or"){_5=true;for(var j=0;j<_7.criteria.length;j++){var _9=_7.criteria[j];if(_9.criteria){_3=false;break}
}
}else{if(_7.operator=="not"){if(_7.criteria.length!=1||_7.criteria[0].criteria){_3=false}
}else{_3=false}
}
}
}
}else{_3=false}
if(_3)_3=!(_4&&_5);if(_3)_3=_4||_5;if(!_3){isc.logWarn("Trying to load an AdvancedCriteria into an 'inline' FilterBuilder, but the criteria is too complex to be represented in 'inline' format");return}
this.setTopOperator(_4?"and":"or");if(_4){for(var i=0;i<_1.criteria.length;i++){var _7=_1.criteria[i],_10=this.fieldData?this.fieldData[_7.fieldName]:null;if(!_7.criteria){this.addCriterion(_7,_10)}else{_10=this.fieldData?this.fieldData[_7.criteria[0].fieldName]:null;this.addNewClause(_7.criteria[0],_10,true)}
}
}else{for(var i=0;i<_1.criteria.length;i++){var _7=_1.criteria[i],_10=this.fieldData?this.fieldData[_7.fieldName]:null;if(_7.operator=="or"){for(var j=0;j<_7.criteria.length;j++){var _9=_7.criteria[j];_10=this.fieldData?this.fieldData[_9.fieldName]:null;this.addCriterion(_9,_10)}
}else{_10=this.fieldData?this.fieldData[_7.criteria[0].fieldName]:null;this.addNewClause(_7.criteria[0],_10,true)}
}
}
delete this.$75v;this.$76t=false;this.$845=false;this.clauseStack.show();this.delayCall("redraw");if(this.clauseStack)this.clauseStack.animateMembers=_2;this.filterReady()}
);isc.evalBoundary;isc.B.push(isc.A.stripNullCriteria=function isc_FilterBuilder_stripNullCriteria(_1){if(_1&&_1.criteria&&_1.criteria.length>0){for(var i=_1.criteria.length-1;i>=0;i--){if(_1.criteria[i]==null){_1.criteria.removeAt(i)}else{if(_1.criteria[i].criteria)this.stripNullCriteria(_1.criteria[i])}
}
}}
,isc.A.expandFieldQuery=function isc_FilterBuilder_expandFieldQuery(_1){if(_1.fieldName&&_1.fieldName.contains(".")){var _2=_1.fieldName.split(".");_1.fieldQuery={dataSource:_2[0],queryOutput:_2[1]
};delete _1.fieldName}}
,isc.A.expandCriteriaShortcuts=function isc_FilterBuilder_expandCriteriaShortcuts(_1){if(_1){this.expandFieldQuery(_1);if(_1.criteria&&_1.criteria.length>0){for(var i=_1.criteria.length-1;i>=0;i--){this.expandCriteriaShortcuts(_1.criteria[i])}
}
}}
,isc.A.fetchFieldsReply=function isc_FilterBuilder_fetchFieldsReply(_1,_2){if(this.fieldData){var _3=isc.getValues(this.fieldData);_3.addList(_1.data);this.fieldData=_3.makeIndex("name")}else this.fieldData=_1.data.makeIndex("name");this.$155t(_2)}
,isc.A.clearCriteria=function isc_FilterBuilder_clearCriteria(_1){var _2=this.clauseStack?this.clauseStack.animateMembers:null;if(this.clauseStack)this.clauseStack.animateMembers=false;while(this.clauses.length>0){this.removeClause(this.clauses[0])}
if(!_1&&!this.allowEmpty)this.addNewClause();if(this.clauseStack)this.clauseStack.animateMembers=_2}
,isc.A.addCriterion=function isc_FilterBuilder_addCriterion(_1,_2){if(_1.criteria){var _3=this.addSubClause(_1);for(var _4=0;_4<_1.criteria.length;_4++){_2=this.fieldData?this.fieldData[_1.criteria[_4].fieldName]:null;_3.addCriterion(_1.criteria[_4],_2)}
}else{this.addNewClause(_1,_2)}}
,isc.A.handleKeyPress=function isc_FilterBuilder_handleKeyPress(_1,_2){if(_1.keyName==this.$10j){if(this.saveOnEnter){if(_2.firedOnTextItem){if(!this.creator&&this.search){this.search(this.$2366());return isc.EH.STOP_BUBBLING}
}
}
}}
,isc.A.itemChanged=function isc_FilterBuilder_itemChanged(){if(this.creator&&isc.isA.Function(this.creator.itemChanged)){this.creator.itemChanged()}else{if(isc.isA.Function(this.filterChanged)){this.filterChanged()}
}}
,isc.A.fieldNameChanged=function isc_FilterBuilder_fieldNameChanged(_1){}
,isc.A.getEditorType=function isc_FilterBuilder_getEditorType(_1,_2){var _3=this.getPrimaryDS(_1);return isc.FilterBuilder.getDefaultEditorType(_1,_3,_2)}
,isc.A.getSelectedClauses=function isc_FilterBuilder_getSelectedClauses(){var _1=[];if(this.showSelectionCheckbox){for(var i=0;i<this.clauses.length;i++){var c=this.clauses[i];if(c.topOperatorForm&&c.topOperatorForm.getValue("select")){_1.add(c)}
}
}
return _1}
);isc.B._maxIndex=isc.C+59;isc.A=isc.FilterBuilder;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.getDefaultEditorType=function isc_c_FilterBuilder_getDefaultEditorType(_1,_2,_3){var _4;var _5={};isc.addProperties(_5,_1);_5.canEdit=_1.canFilter;_1=_5;var _6=_2.getSearchOperator(_3,_1);if(_6.editorType){_4=_6.editorType}else if(_6.getEditorType&&isc.isA.Function(_6.getEditorType)){_4=_6.getEditorType()}else{var _7=_6?_6.valueType:"text";if(_7=="fieldName"){_4=null}else if(_7=="valueSet"){_4="TextAreaItem"}else if(_7=="custom"&&_6&&_6.editorType){_4=_6.editorType}
if(_1){var _8=(_3=="equals"||_3=="notEqual"||_3=="lessThan"||_3=="greaterThan"||_3=="iBetween"||_3=="iBetweenInclusive"||_3=="between"||_3=="betweenInclusive"||_3=="greaterOrEqual"||_3=="lessOrEqual")
?"RelativeDateItem":"DateRangeItem";var _9=(_7=="valueSet"),_10=_9,_11=_9?"MultiPickerItem":"SelectItem";if(!this.internalSearchForm){this.internalSearchForm=isc.SearchForm.create({visibility:"hidden",autoDraw:false,useAllDataSourceFields:false,dataSource:_2,fields:[_1],defaultDateEditorType:_8,useMultiSelectForValueMaps:_10,largeValueMapFilterEditorType:_11
})}else{this.internalSearchForm.defaultDateEditorType=_8;this.internalSearchForm.useMultiSelectForValueMaps=_10;this.internalSearchForm.largeValueMapFilterEditorType=_11;this.internalSearchForm.setDataSource(_2,[_1])}
_4=this.internalSearchForm.getEditorType(_1)}else{_4=isc.FormItemFactory.getItemClassName({},"text",null)}
}
return _4}
);isc.B._maxIndex=isc.C+1;isc.FilterBuilder.registerStringMethods({search:"criteria",filterChanged:""})}
if(isc.DynamicForm){isc.defineClass("SummaryFunctionItem","ComboBoxItem");isc.A=isc.SummaryFunctionItem;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.getFunctionTitle=function isc_c_SummaryFunctionItem_getFunctionTitle(_1){var _2=_1+"FunctionTitle",_3=isc.SummaryFunctionItem.getInstanceProperty(_2);return _3}
);isc.B._maxIndex=isc.C+1;isc.A=isc.SummaryFunctionItem.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.maxFunctionTitle="maximum value in any matching records";isc.A.minFunctionTitle="minimum value in any matching records";isc.A.avgFunctionTitle="average of all values in matching records";isc.A.sumFunctionTitle="total of all values in all matching records";isc.A.countFunctionTitle="count of all matching records";isc.A.concatFunctionTitle="combined text values in all matching records";isc.A.valueField="value";isc.A.displayField="title";isc.A.allowEmptyValue=true;isc.A.cachePickListResults=false;isc.B.push(isc.A.getClientPickListData=function isc_SummaryFunctionItem_getClientPickListData(){if(this.fieldType==null||this.fieldType=="text"){return[{value:"concat",title:this.concatFunctionTitle},{value:"count",title:this.countFunctionTitle},{value:"max",title:this.maxFunctionTitle},{value:"min",title:this.minFunctionTitle}
]
}else if(this.fieldType=="date"||this.fieldType=="dateTime"||this.fieldType=="time"){return[{value:"count",title:this.countFunctionTitle},{value:"max",title:this.maxFunctionTitle},{value:"min",title:this.minFunctionTitle}
]
}else{return[{value:"sum",title:this.sumFunctionTitle},{value:"count",title:this.countFunctionTitle},{value:"avg",title:this.avgFunctionTitle},{value:"max",title:this.maxFunctionTitle},{value:"min",title:this.minFunctionTitle},{value:"concat",title:this.concatFunctionTitle}
]
}
}
,isc.A.setFieldType=function isc_SummaryFunctionItem_setFieldType(_1){if(this.fieldType!=_1){this.fieldType=_1;var _2=this.filterClientPickListData(),_3=this.getValue(),_4=this.getValueFieldName(),_5=this.getDisplayFieldName(),_6={}
;for(var i=0;i<_2.length;i++){_6[_2[i][_4]]=_2[i][_5]}
this.setValueMap(_6);if(!_2.getProperty("value").contains(_3)){this.clearValue();delete this.$2717}
}
}
);isc.B._maxIndex=isc.C+2;isc.defineClass("AggregationEditor","VLayout");isc.A=isc.AggregationEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.height=1;isc.A.defaultWidth=800;isc.A.membersMargin=10;isc.A.dataSourcePickerDefaults={_constructor:"SubqueryDataSourcePicker",width:"100%",colWidths:[10,"*"],autoFocus:true,dsNameChanged:function(_1,_2){this.creator.dataSourceChanged(_1,_2)}};isc.A.filterBuilderConstructor="FilterBuilder";isc.A.filterBuilderDefaults={inheritedClauseProperties:{createSubQueryWindow:function(){var _1=this.Super("createSubQueryWindow",arguments);var _2=this.creator,_3=_2.creator;if(_3.subQueryWindowLeft!=null||_3.subQueryWindowTop!=null){_1.setAutoCenter(false);if(_3.subQueryWindowLeft!=null)_1.setPageLeft(_3.subQueryWindowLeft);if(_3.subQueryWindowTop!=null)_1.setPageTop(_3.subQueryWindowTop)}
return _1}
}};isc.A.sortFields=true;isc.A.fieldPickerDefaults={name:"fieldName",editorType:"ComboBoxItem",textMatchStyle:"startsWith",showTitle:false,hint:"field name",showHintInField:true,addUnknownValues:false,changed:function(){this.form.creator.fieldNameChanged(this.form)}};isc.A.functionPickerDefaults={name:"function",editorType:"SummaryFunctionItem",showTitle:false,hint:"summary function",showHintInField:true,addUnknownValues:false,changed:function(){this.form.creator.functionChanged(this.form)}};isc.A.fieldPickerWidth=150;isc.A.functionPickerWidth=325;isc.A.showFieldTitles=true;isc.A.showRemoveButton=true;isc.A.removeButtonPrompt="Remove";isc.A.removeButtonDefaults={_constructor:isc.ImgButton,width:18,height:18,layoutAlign:"center",src:"[SKIN]/actions/remove.png",showRollOver:false,showDown:false,click:function(){this.creator.removeButtonClick(this.clause)}};isc.A.showAddButton=true;isc.A.addButtonPrompt="Add";isc.A.addButtonDefaults={_constructor:isc.ImgButton,autoParent:"buttonBar",layoutAlign:"center",width:18,height:18,imageWidth:10,imageHeight:10,src:"[SKIN]/actions/add.png",showRollOver:false,showDown:false,click:function(){this.creator.updateButtons(false);this.creator.addButtonClick(this.clause);this.creator.updateButtons(true)}};isc.A.buttonBarDefaults={_constructor:isc.HStack,autoParent:"clauseStack",membersMargin:4,defaultLayoutAlign:"center",height:1};isc.A.sortByPickerConstructor="SortByEditor";isc.A.sortByPickerDefaults={};isc.A.aggregationLayoutDefaults={_constructor:isc.VLayout};isc.A.groupByTitle="Combine records that have the same value for";isc.A.groupByPickerHint="Select fields...";isc.A.groupByLayoutDefaults={_constructor:isc.HLayout,autoParent:"aggregationLayout",width:"100%",height:1,membersMargin:4,layoutAlign:"center"};isc.A.groupByTitleLabelDefaults={_constructor:isc.Label,autoParent:"groupByLayout",width:1,height:1,layoutAlign:"center",wrap:false};isc.A.groupByFormDefaults={_constructor:"DynamicForm",autoParent:"groupByLayout",width:"100%",numCols:1};isc.A.groupByFieldDefaults={name:"groupBy",showTitle:false,editorType:"MultiComboBoxItem",layoutStyle:"flow",addUnknownValues:false,width:"*",changed:function(){this.form.creator.groupByFieldChanged()}};isc.A.clauseStackDefaults={_constructor:isc.VStack,autoParent:"aggregationLayout",width:"100%",height:1,animateMembers:true,animateMemberTime:150};isc.A.emptyClausesLayoutDefaults={_constructor:isc.HStack,autoParent:"aggregationLayout",width:"100%",height:1,membersMargin:5};isc.A.emptyClausesLabelDefaults={_constructor:isc.Label,autoParent:"emptyClausesLayout",width:1,height:1,layoutAlign:"center",wrap:false};isc.A.emptyClausesMessage="Return all unique combinations of combined fields";isc.A.emptyClauseOutputPrefixMessage="Pick the value of the";isc.A.emptyClauseOutputSuffixMessage="field from the first record";isc.A.queryOutputLayoutDefaults={_constructor:isc.HStack,width:"100%",height:1,membersMargin:5};isc.A.queryOutputPrefixLabelDefaults={_constructor:isc.Label,width:1,height:1,layoutAlign:"center",wrap:false};isc.A.queryOutputSuffixLabelDefaults={_constructor:isc.Label,width:1,height:1,layoutAlign:"center",wrap:false};isc.A.queryOutputFormDefaults={_constructor:"DynamicForm",width:1,numCols:1};isc.A.queryOutputFieldDefaults={name:"outputField",showTitle:false,width:"*",editorType:"ComboBoxItem",addUnknownValues:false,showHintInField:true,hint:"field name",changed:function(){this.form.creator.outputFieldChanged()}};isc.A.queryOutputPrefixMessage="Pick the value of the";isc.A.queryOutputSuffixMessage="field from each record";isc.A.emptyClausesAddButtonPrompt="Add summary functions";isc.A.emptyClausesAddButtonDefaults={_constructor:isc.ImgButton,autoParent:"emptyClausesLayout",width:18,height:18,layoutAlign:"center",src:"[SKIN]/actions/add.png",showRollOver:false,showDown:false,click:function(){this.creator.addNewClause()}};isc.A.lastClauseRemoveButtonPrompt="If you remove all aggregation functions, the returned data will be all unique combinations of the combined fields";isc.A.clauseConstructor="AggregationClause";isc.B.push(isc.A.setDataSource=function isc_AggregationEditor_setDataSource(_1,_2){var _3=isc.DataSource.get(_1);if(!_3||!this.dataSource||(isc.DataSource.get(this.dataSource).ID!=_3.ID)){this.dataSource=_3;if(this.dataSourcePicker){var _4=(isc.isA.DataSource(this.rootDS)?this.rootDS.getID():this.rootDS),_5=(this.dataSource?this.dataSource.getID():null)
;this.dataSourcePicker.setValues({baseDSName:_4,dsName:_5,queryFK:_2
})}
if(this.filterBuilder){this.filterBuilder.setDataSource(_3)}
if(this.clauses){if(this.groupByForm)this.groupByForm.getField("groupBy").setValueMap(this.getFieldNamesValueMap());this.$248p()}else{this.rebuild()}
if(this.sortByPicker){this.sortByPicker.setDataSource(_3)}
if(this.queryOutputForm){this.updateQueryOutputPickerValueMap(null);this.queryOutputForm.getField("outputField").defaultValue=this.getQueryOutputPickerDefaultValue();this.queryOutputForm.getField("outputField").clearValue()}
}}
,isc.A.addButtonClick=function isc_AggregationEditor_addButtonClick(){this.addNewClause()}
,isc.A.removeButtonClick=function isc_AggregationEditor_removeButtonClick(_1){if(!_1)return;this.removeClause(_1)}
,isc.A.removeClause=function isc_AggregationEditor_removeClause(_1){var _2=(this.clauses.indexOf(_1)==0);this.clauses.remove(_1);if(this.clauseStack){this.clauseStack.hideMember(_1,function(){_1.destroy()})}
this.updateLastAddButton();_1.aggregationEditor=null;this.fireAggregationChanged();if(this.clauses.length==0){this.clauseStack.hide();this.emptyClausesLayout.show()}else if(_2){this.clauses[0].updateClausePrefixMessage()}}
,isc.A.updateLastAddButton=function isc_AggregationEditor_updateLastAddButton(){var _1=this.clauses,_2=_1&&_1[_1.length-1]
;if(_2){_2.showAddButton=true}}
,isc.A.isFirstClause=function isc_AggregationEditor_isFirstClause(_1){return this.clauses.length==0||this.clauses[0]==_1}
,isc.A.initWidget=function isc_AggregationEditor_initWidget(){this.Super("initWidget",arguments);this.rebuild()}
,isc.A.rebuild=function isc_AggregationEditor_rebuild(){if(isc.isA.String(this.dataSource)){this.dataSource=isc.DS.get(this.dataSource)}
this.clauses=[];var _1=false,_2=false;if(this.showAggregationLayout!=false){this.addAutoChild("aggregationLayout",{groupTitle:(_1?"Aggregation":null)
});this.addAutoChild("groupByLayout");this.addAutoChild("groupByTitleLabel",{contents:this.groupByTitle});var _3=this;var _4=isc.addProperties({},this.groupByFieldDefaults,{valueMap:this.getFieldNamesValueMap()
});_4.comboBoxProperties=isc.addProperties({},{hint:this.groupByPickerHint},_4.comboBoxProperties);this.addAutoChild("groupByForm",{fields:[_4]});this.addAutoChild("clauseStack");this.clauseStack.hide();this.addAutoChild("emptyClausesLayout");if(this.scalarMode){var _5="emptyClausesLayout";this.addAutoChild("emptyClausesLabel",{autoParent:_5,contents:this.emptyClauseOutputPrefixMessage
});var _6=isc.addProperties({},this.queryOutputFieldDefaults,{width:this.fieldPickerWidth,valueMap:this.updateQueryOutputPickerValueMap()
});this.addAutoChild("queryOutputForm",{autoParent:_5,width:this.fieldPickerWidth,fields:[_6]
});this.addAutoChild("queryOutputSuffixLabel",{autoParent:_5,contents:this.emptyClauseOutputSuffixMessage
})}else{this.addAutoChild("emptyClausesLabel",{contents:this.emptyClausesMessage
})}
this.addAutoChild("emptyClausesAddButton",{prompt:this.emptyClausesAddButtonPrompt
})}else if(this.showQueryOutputPicker){this.addAutoChild("queryOutputLayout");var _5="queryOutputLayout";this.addAutoChild("queryOutputPrefixLabel",{autoParent:_5,contents:this.queryOutputPrefixMessage
});var _6=isc.addProperties({},this.queryOutputFieldDefaults,{width:this.fieldPickerWidth,valueMap:this.updateQueryOutputPickerValueMap(),defaultValue:this.getQueryOutputPickerDefaultValue()
});this.addAutoChild("queryOutputForm",{autoParent:_5,fields:[_6]
});this.addAutoChild("queryOutputSuffixLabel",{autoParent:_5,contents:this.queryOutputSuffixMessage
})}
this.$248p(this.request)}
,isc.A.getFieldNamesValueMap=function isc_AggregationEditor_getFieldNamesValueMap(){if(this.allowedFields)return this.allowedFields;if(this.dataSource){var _1=this.getDataSource(),_2=_1.getFieldNames(!this.showHiddenFields),_3=_2
;if(this.showFieldTitles){_3={};for(var i=0;i<_2.length;i++){var _5=_2[i],_6=_1.getField(_5)
;_3[_5]=_6.summaryTitle||_6.title||_5}
}
return _3}}
,isc.A.itemChanged=function isc_AggregationEditor_itemChanged(){this.fireAggregationChanged()}
,isc.A.groupByFieldChanged=function isc_AggregationEditor_groupByFieldChanged(){var _1=this.groupByForm.getValue("groupBy");if(_1!=null&&_1.length>0){var _2=(this.clauses.length>0?this.clauses[0]:null);if(this.dataSource&&!_2||_2.canDefaultField()){var _3=this.getDataSource(),_4=_3.getFieldNames(),_5,_6;for(var i=0;i<_4.length;i++){var _8=_3.getField(_4[i]);if(!_1.contains(_8.name)&&(_8.type=="integer"||_8.type=="float")&&!_8.foreignKey)
{_5=_8.name;_6=_8.type;break}
}
if(_5){if(!_2){_2=this.addNewClause()}
_2.setDefaultField(_5,_6);if(_2.canDefaultFunction()){_2.setDefaultFunction()}
}
}
}else{for(var i=0;i<this.clauses.length;i++){this.removeClause(this.clauses[i])}
}
this.fireAggregationChanged()}
,isc.A.outputFieldChanged=function isc_AggregationEditor_outputFieldChanged(){this.fireAggregationChanged()}
,isc.A.fireAggregationChanged=function isc_AggregationEditor_fireAggregationChanged(){if(this.$248r)return;this.updateQueryOutputPickerValueMap(this.$248q());if(isc.isA.Function(this.aggregationChanged)){this.aggregationChanged()}}
,isc.A.addNewClause=function isc_AggregationEditor_addNewClause(_1,_2){if(!this.clauseStack)return;var _3=(_1&&_2?{fieldName:_1,summaryFunction:_2}:null);var _4=this.createAutoChild("clause",isc.addProperties({},{visibility:"hidden",aggregation:_3,dataSource:this.dataSource,sortFields:this.sortFields,showFieldTitles:this.showFieldTitles,showHiddenFields:this.showHiddenFields,showAddButton:this.showAddButton,showRemoveButton:this.showRemoveButton,removeButtonPrompt:this.removeButtonPrompt,fieldPickerDefaults:this.fieldPickerDefaults,fieldPickerProperties:this.fieldPickerProperties,fieldPickerWidth:this.fieldPickerWidth,functionPickerWidth:this.functionPickerWidth,functionPickerDefaults:this.functionPickerDefaults,functionPickerProperties:this.functionPickerProperties,remove:function(){this.creator.removeClause(this)},fieldNameChanged:function(){this.Super("fieldNameChanged",arguments);this.creator.fieldNameChanged(this)},getRemovePrompt:function(){var _5=this.getAggregationEditor(),_6=_5.removeButtonPrompt;if(_5.isFirstClause(this)&&_5.clauses.length==1){_6=_5.lastClauseRemoveButtonPrompt}
return _6},aggregationEditor:this,width:"100%"
})
);if(this.clausesStack&&this.clauses.length==0){this.emptyClausesLayout.hide();this.clauseStack.show()}
return this.$74e(_4)}
,isc.A.$74e=function isc_AggregationEditor__addClause(_1){_1.aggregationEditor=this;this.clauses.add(_1);var _2=this.clauseStack;var _3=_2.getMembers(),_4=_3&&_3[_3.length-1]
;if(_4){_4.showAddButton=false}
_2.addMember(_1);_2.showMember(_1);this.fireAggregationChanged();return _1}
,isc.A.validate=function isc_AggregationEditor_validate(){var _1=true;for(var i=0;i<this.clauses.length;i++){if(!this.clauses[i].validate())_1=false}
return _1}
,isc.A.getRequest=function isc_AggregationEditor_getRequest(){return this.$248q()}
,isc.A.$248q=function isc_AggregationEditor__getRequest(){if(this.$75v){return this.request}
var _1={},_2=this.groupByForm&&this.groupByForm.getValue("groupBy")
;if(_2){_1.groupBy=_2}
for(var i=0;i<this.clauses.length;i++){var _4=this.clauses[i],_5=_4.getAggregation(),_6=(!_5.fieldName||!_5.summaryFunction)
;if(!_6){if(!_1.summaryFunctions){_1.summaryFunctions={}}
_1.summaryFunctions[_5.fieldName]=_5.summaryFunction}
}
if(!_1.summaryFunctions&&this.queryOutputForm){var _7=this.queryOutputForm.getValue("outputField");if(_7)_1.queryOutput=_7}
if(this.filterBuilder){var _8=isc.DS.checkEmptyCriteria(this.filterBuilder.getCriteria());if(_8)_1.criteria=_8}
if(this.sortByPicker){var _9=this.sortByPicker.getSort();if(_9)_1.sortBy=_9}
if(!isc.isAn.emptyObject(_1)&&this.dataSourcePicker){var _10=this.dataSourcePicker.getValue("dsName"),_11=this.dataSourcePicker.getValue("queryFK")
;_1.dataSource=_10;if(_11!=null){_1.queryFK=_11}
}
return _1}
,isc.A.editorReady=function isc_AggregationEditor_editorReady(){}
,isc.A.setRequest=function isc_AggregationEditor_setRequest(_1){this.$248p(_1)}
,isc.A.$248p=function isc_AggregationEditor__setRequest(_1){if(this.$248r)return;this.$248r=true;this.clearRequest();if(!_1){this.addNewClause();if(this.clauseStack)this.clauseStack.show();this.$248r=false;this.redraw();this.editorReady();return}
if(!_1.dataSource)_1.dataSource=this.getDataSource();var _2=this.clauseStack?this.clauseStack.animateMembers:null;if(this.clauseStack)this.clauseStack.animateMembers=false;if(_1.dataSource&&this.dataSourcePicker){this.setDataSource(_1.dataSource,_1.queryFK)}
if(_1.criteria&&this.filterBuilder){this.filterBuilder.setCriteria(_1.criteria)}
if(this.groupByForm&&_1.groupBy){this.groupByForm.setValue("groupBy",_1.groupBy)}
if(_1.summaryFunctions){var _3=_1.summaryFunctions;for(var _4 in _3){this.addClause(_4,_3[_4])}
if(this.clauses.length==0&&!this.allowEmpty)this.addNewClause()}
if(this.queryOutputForm&&_1.queryOutput){this.queryOutputForm.setValue("outputField",_1.queryOutput)}
if(this.sortByPicker){if(_1.dataSource){this.sortByPicker.setDataSource(_1.dataSource)}
if(_1.sortBy){this.sortByPicker.setSort(_1.sortBy)}
}
if(this.queryOutputForm){this.updateQueryOutputPickerValueMap(_1)}
this.$248r=false;if(this.clauseStack)this.clauseStack.show();this.delayCall("redraw");if(this.clauseStack)this.clauseStack.animateMembers=_2;this.editorReady()}
,isc.A.updateQueryOutputPickerValueMap=function isc_AggregationEditor_updateQueryOutputPickerValueMap(_1){if(this.queryOutputForm){var _2=this.queryOutputForm.getField("outputField"),_3=this.getQueryOutputPickerValueMap(_1)
;if(_2){_2.setValueMap(_3);var _4=_2.getValue();if(_4&&!_3.contains(_4)){_2.clearValue()}
}
}}
,isc.A.getQueryOutputPickerValueMap=function isc_AggregationEditor_getQueryOutputPickerValueMap(_1){var _2=this.getDataSource(),_3=[]
;if(_2){_3=_2.getFieldNames()}
return _3.sort()}
,isc.A.getQueryOutputPickerDefaultValue=function isc_AggregationEditor_getQueryOutputPickerDefaultValue(_1){var _2;return _2}
,isc.A.clearRequest=function isc_AggregationEditor_clearRequest(_1){if(this.groupBy)this.groupByForm.clearValues();if(this.sortByPicker)this.sortByPicker.setSort(null);var _2=this.clauseStack?this.clauseStack.animateMembers:null;if(this.clauseStack)this.clauseStack.animateMembers=false;while(this.clauses.length>0){this.removeClause(this.clauses[0])}
if(this.clauseStack)this.clauseStack.animateMembers=_2}
,isc.A.addClause=function isc_AggregationEditor_addClause(_1,_2){this.addNewClause(_1,_2)}
,isc.A.fieldNameChanged=function isc_AggregationEditor_fieldNameChanged(_1){}
,isc.A.dataSourceChanged=function isc_AggregationEditor_dataSourceChanged(_1,_2){this.setDataSource(_1,_2)}
);isc.B._maxIndex=isc.C+28;isc.defineClass("AggregationClause","Layout");isc.A=isc.AggregationClause.getPrototype();isc.A.orientation="horizontal";isc.A.defaultWidth="100%";isc.A.width="100%";isc.A.height=20;isc.A.membersMargin=4;isc.A.isRuleScope=true;isc.A.firstClausePrefixMessage="Then calculate the value for";isc.A.clausePrefixMessage="and the value for";isc.A.clauseSummaryMessage="as the";isc.A.fieldPickerWidth=200;isc.A.functionPickerWidth=325;isc.A.fieldPickerDefaults={name:"fieldName",editorType:"ComboBoxItem",showTitle:false,textMatchStyle:"startsWith",changed:function(){this.form.creator.fieldNameChanged(this.form)}
};isc.A.fieldPickerFormDefaults={_constructor:isc.DynamicForm,autodraw:false,height:1,numCols:1
};isc.A.functionPickerDefaults={name:"function",editorType:"SummaryFunctionItem",showTitle:false,addUnknownValues:false,changed:function(){this.form.creator.functionChanged(this.form)}
};isc.A.functionPickerFormDefaults={_constructor:isc.DynamicForm,autodraw:false,width:1,height:1,numCols:1
};isc.A.buttonBarDefaults={_constructor:isc.HLayout,width:"*",layoutAlign:"center"
};isc.A.showRemoveButton=true;isc.A.removeButtonPrompt="Remove";isc.A.removeButtonDefaults={_constructor:isc.ImgButton,autoParent:"buttonBar",width:18,height:18,layoutAlign:"center",src:"[SKIN]/actions/remove.png",showRollOver:false,showDown:false,click:function(){this.creator.remove()}
};isc.A.showAddButton=true;isc.A.addButtonPrompt="Add";isc.A.addButtonDefaults={_constructor:isc.ImgButton,autoParent:"buttonBar",width:18,height:18,layoutAlign:"center",src:"[SKIN]/actions/add.png",showRollOver:false,showDown:false,click:function(){this.creator.updateButtons(false);this.creator.addButtonClick();this.creator.updateButtons(true)}
};isc.A=isc.AggregationClause.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_AggregationClause_initWidget(){this.Super("initWidget",arguments);this.setupClause();this.setAggregation(this.aggregation)}
,isc.A.getAggregationEditor=function isc_AggregationClause_getAggregationEditor(){return this.aggregationEditor}
,isc.A.getAggregation=function isc_AggregationClause_getAggregation(_1){var _2=this.fieldPickerForm.getValue("fieldName"),_3=this.functionPickerForm.getValue("function")
;return(_2!=null?{fieldName:_2,summaryFunction:_3
}:{})}
,isc.A.setAggregation=function isc_AggregationClause_setAggregation(_1){var _2=_1&&_1.fieldName,_3=_1&&_1.summaryFunction
;this.fieldPickerForm.setValue("fieldName",_2);this.fieldNameChanged(this.fieldPickerForm);this.functionPickerForm.setValue("function",_3)}
,isc.A.getFieldNamesValueMap=function isc_AggregationClause_getFieldNamesValueMap(){if(this.allowedFields)return this.allowedFields;if(this.dataSource){var _1=this.getDataSource(),_2=_1.getFieldNames(!this.showHiddenFields),_3=_2
;if(this.showFieldTitles){_3={};for(var i=0;i<_2.length;i++){var _5=_2[i],_6=_1.getField(_5)
;_3[_5]=_6.summaryTitle||_6.title||_5}
}
return _3}
}
,isc.A.setupClause=function isc_AggregationClause_setupClause(){this.$85y=true;if(this.dataSource&&!isc.isA.DataSource(this.dataSource)){this.dataSource=isc.DataSource.get(this.dataSource)}
var _1=this.getAggregationEditor(),_2=(_1.isFirstClause(this)?this.firstClausePrefixMessage:this.clausePrefixMessage)
;var _3=isc.Label.create({autoDraw:false,width:_1.$248s||1,height:1,layoutAlign:"center",align:"right",wrap:false,contents:_2
});if(!_1.$248s){_3.setTop(-9999);_3.draw();_1.$248s=_3.getVisibleWidth()}
var _4=isc.Label.create({autoDraw:false,width:1,height:1,layoutAlign:"center",wrap:false,contents:this.clauseSummaryMessage
});var _5=isc.addProperties({},this.fieldPickerDefaults,{width:this.fieldPickerWidth,sortField:(this.sortFields?"fieldName":null)
},this.fieldPickerProperties,{name:"fieldName"},{valueMap:this.getFieldNamesValueMap()}
);this.fieldPickerForm=this.createAutoChild("fieldPickerForm",{fields:[_5]
});var _6=this.fieldPickerForm.ID;var _7=isc.addProperties({},this.functionPickerDefaults,{width:this.functionPickerWidth},this.summaryPickerProperties,{name:"function",requiredWhen:{_constructor:isc.AdvancedCriteria,operator:"and",criteria:[{fieldName:_6+".values.fieldName",operator:"notBlank"}
]
}
}
);this.functionPickerForm=this.createAutoChild("functionPickerForm",{fields:[_7]
});this.addMembers([_3,this.fieldPickerForm,_4,this.functionPickerForm]);this.addAutoChild("buttonBar");this.addAutoChild("removeButton",{prompt:this.removeButtonPrompt,visibility:"hidden"});this.addAutoChild("addButton",{prompt:this.addButtonPrompt,visibility:"hidden"})}
,isc.A.updateClausePrefixMessage=function isc_AggregationClause_updateClausePrefixMessage(){var _1=this.members[0],_2=this.getAggregationEditor(),_3=(_2.isFirstClause(this)?this.firstClausePrefixMessage:this.clausePrefixMessage)
;_1.setContents(_3)}
,isc.A.fieldNameChanged=function isc_AggregationClause_fieldNameChanged(_1){var _2=_1.getValue("fieldName");if(_2){var _3=this.dataSource&&this.dataSource.getField(_2),_4=_3&&_3.type||"text"
;this.functionPickerForm.getItem("function").setFieldType(_4);this.creator.itemChanged();_1.getField("fieldName").$2717=true}
}
,isc.A.functionChanged=function isc_AggregationClause_functionChanged(_1){this.creator.itemChanged();_1.getField("function").$2717=true}
,isc.A.remove=function isc_AggregationClause_remove(){this.markForDestroy()}
,isc.A.validate=function isc_AggregationClause_validate(){return this.fieldPickerForm.validate()&&this.functionPickerForm.validate()}
,isc.A.addButtonClick=function isc_AggregationClause_addButtonClick(){var _1=this.getAggregationEditor();if(_1){_1.addNewClause()}
}
,isc.A.mouseOver=function isc_AggregationClause_mouseOver(){this.updateButtons(true)}
,isc.A.mouseOut=function isc_AggregationClause_mouseOut(){this.updateButtons(false)}
,isc.A.updateButtons=function isc_AggregationClause_updateButtons(_1){if(_1&&this.showRemoveButton){if(this.getRemovePrompt){this.removeButton.prompt=this.getRemovePrompt()}
this.removeButton.show()}else if(this.showRemoveButton){this.removeButton.hide()}
if(_1&&this.showAddButton){this.addButton.show()}else if(this.showAddButton){this.addButton.hide()}
}
,isc.A.canDefaultField=function isc_AggregationClause_canDefaultField(){return!this.fieldPickerForm.getField("fieldName").$2717}
,isc.A.canDefaultFunction=function isc_AggregationClause_canDefaultFunction(){return!this.functionPickerForm.getField("function").$2717}
,isc.A.setDefaultField=function isc_AggregationClause_setDefaultField(_1,_2){this.fieldPickerForm.setValue("fieldName",_1);if(_2){this.functionPickerForm.getItem("function").setFieldType(_2)}
}
,isc.A.setDefaultFunction=function isc_AggregationClause_setDefaultFunction(){var _1=this.functionPickerForm.getItem("function"),_2=_1.getValueMap(),_3=_2&&isc.getKeys(_2)
;if(_3&&_3.length>0){this.functionPickerForm.setValue("function",_3[0])}
}
);isc.B._maxIndex=isc.C+19;isc.AggregationEditor.registerStringMethods({aggregationChanged:""});isc.defineClass("OptionalAggregationEditor","VLayout");isc.A=isc.OptionalAggregationEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.defaultWidth=800;isc.A.height=1;isc.A.useAggregationTitle="Use aggregation";isc.A.useAggregationPrompt="Aggregation combines records from your DataSource together, so that you can compute sums (like the total value of an Order), or find the record with the largest or smallest value for a field, or compute other quantities.";isc.A.removeAggregationConfirmationText="This will remove aggregation. Proceed?";isc.A.unusedFormDefaults={_constructor:isc.DynamicForm,width:"*",height:1,numCols:1
};isc.A.useAggregationItemDefaults={name:"useAggregation",type:"boolean",title:"Use aggregation",showTitle:false,change:function(_1,_2,_3){this.form.creator.useAggregationChanged(_3);return false}
};isc.A.aggregationEditorContainerDefaults={_constructor:isc.VLayout,width:"100%",height:"100%",isGroup:true,groupTitle:"Use aggregation",visibility:"hidden",initWidget:function(){this.Super("initWidget",arguments);this.groupLabel=this.createAutoChild("groupLabel",{autoDraw:false})},groupLabelProperties:{_constructor:isc.DynamicForm,width:1,height:1,numCols:1,$jo:false,vAlign:"center",align:"center",useAggregationFieldDefaults:{name:"useAggregation",type:"boolean",showTitle:false,defaultValue:true,change:function(_1,_2,_3){this.form.creator.creator.useAggregationChanged(_3);return false}
},initWidget:function(){this.fields=[isc.addProperties({},this.useAggregationFieldDefaults,{title:this.creator.useAggregationTitle,prompt:this.creator.useAggregationPrompt
})
];this.Super("initWidget",arguments)},redraw:function(){var _1=this.Super("redraw",arguments);this.creator.$1332();return _1},handleParentMoved:function(){this.Super("handleParentMoved",arguments);this.creator.$1332()}
}
};isc.A.aggregationEditorDefaults={_constructor:isc.AggregationEditor,autoParent:"aggregationEditorContainer"
};isc.A.usingAggregation=false;isc.B.push(isc.A.initWidget=function isc_OptionalAggregationEditor_initWidget(){this.Super("initWidget",arguments);this.addAutoChild("unusedForm",{fields:[isc.addProperties({},this.useAggregationItemDefaults,{title:this.useAggregationTitle,prompt:this.useAggregationPrompt
})
]
});this.addAutoChild("aggregationEditorContainer",{useAggregationTitle:this.useAggregationTitle,useAggregationPrompt:this.useAggregationPrompt
});var _1={dataSource:this.dataSource,dataSources:this.dataSources,showDataSourcePicker:this.showDataSourcePicker,showCriteriaEditor:this.showCriteriaEditor,request:this.request
};if(this.aggregationChanged){var _2=this;_1.aggregationChanged=function(){_2.aggregationChanged()}
}
this.addAutoChild("aggregationEditor",_1);if(this.request){this.useAggregationChanged(true)}
}
,isc.A.useAggregationChanged=function isc_OptionalAggregationEditor_useAggregationChanged(_1){if(this.usingAggregation==_1)return;this.usingAggregation=_1;if(_1){this.unusedForm.hide();this.aggregationEditorContainer.show()}else{var _2=this;isc.confirm(this.removeAggregationConfirmationText,function(_3){if(_3){_2.$248t()}
},{buttons:[isc.Dialog.CANCEL,isc.Dialog.OK],autoFocusButton:1
})}
}
,isc.A.$248t=function isc_OptionalAggregationEditor__removeAggregation(){this.aggregationEditorContainer.hide();this.unusedForm.show()}
,isc.A.setDataSource=function isc_OptionalAggregationEditor_setDataSource(_1,_2){this.aggregationEditor.setDataSource(_1,_2)}
,isc.A.validate=function isc_OptionalAggregationEditor_validate(){return this.aggregationEditor.validate()}
,isc.A.clearRequest=function isc_OptionalAggregationEditor_clearRequest(){this.aggregationEditor.clearRequest()}
,isc.A.getRequest=function isc_OptionalAggregationEditor_getRequest(){return(this.usingAggregation?this.aggregationEditor.getRequest():null)}
,isc.A.setRequest=function isc_OptionalAggregationEditor_setRequest(_1){this.aggregationEditor.setRequest(_1);var _2=(_1!=null&&!isc.isAn.emptyObject(_1)&&(_1.groupBy!=null||_1.summaryFunctions!=null));this.useAggregationChanged(_2)}
);isc.B._maxIndex=isc.C+8;isc.defineClass("RelatedCriteriaEditor","AggregationEditor");isc.A=isc.RelatedCriteriaEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.showDataSourcePicker=true;isc.A.showCriteriaEditor=true;isc.A.showQueryOutputPicker=true;isc.A.showSortByPicker=false;isc.A.showAggregationLayout=false;isc.A.separateIndirectRecords=false;isc.A.canSelectIndirectRecord=true;isc.B.push(isc.A.$248q=function isc_RelatedCriteriaEditor__getRequest(){var _1=this.Super("$248q",arguments);if(_1)_1.queryFK="*none*";return _1}
);isc.B._maxIndex=isc.C+1;isc.defineClass("SortByEditor","HLayout");isc.A=isc.SortByEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.width="100%";isc.A.height=30;isc.A.membersMargin=20;isc.A.sortPickerDefaults={name:"sortField",type:"SelectItem",title:"Sort by",width:"*",allowEmptyValue:true,emptyDisplayValue:"None"
};isc.A.sortDirectionDefaults={name:"sortDirection",type:"RadioGroupItem",showTitle:false,defaultValue:"ascending",vertical:false,valueMap:{"ascending":"Ascending","descending":"Descending"
},readOnlyWhen:{_constructor:"AdvancedCriteria",criteria:[{fieldName:"sortField",operator:"isNull"}
]
}
};isc.A.multiSortDisplayDefaults={name:"multiSort",type:"StaticTextItem",title:"Sort by",height:isc.TextItem.getInstanceProperty("height"),width:"*",wrap:false,clipValue:true,showIf:false,icons:[{src:"[SKINIMG]actions/edit.png",prompt:"Edit sort",click:function(_1,_2,_3){_1.creator.showAdvancedSortDialog()}
}]
};isc.A.sortEditorDefaults={_constructor:"DynamicForm",layoutAlign:"center",width:100,wrapItemTitles:false,numCols:3,colWidths:[50,200,"*"]
};isc.A.advancedSortMessage="Advanced..";isc.A.advancedSortLinkDefaults={_constructor:"Label",height:30,autoFit:true,layoutAlign:"center",wrap:false,cursor:"pointer",click:function(){this.creator.showAdvancedSortDialog()}
};isc.B.push(isc.A.initWidget=function isc_SortByEditor_initWidget(){this.Super("initWidget",arguments);var _1=[isc.addProperties({},this.sortPickerDefaults,this.sortPickerProperties),isc.addProperties({},this.sortDirectionDefaults,this.sortDirectionProperties),isc.addProperties({},this.multiSortDisplayDefaults,this.multiSortDisplayProperties)
];this.addAutoChild("sortEditor",{fields:_1});this.sortEditor.setValues({});if(isc.MultiSortDialog){var _2="<span style='color:blue;text-decoration:underline;'>"+this.advancedSortMessage+"</span>";this.addAutoChild("advancedSortLink",{contents:_2})}
}
,isc.A.setDataSource=function isc_SortByEditor_setDataSource(_1){this.dataSource=_1=isc.DS.get(_1);var _2=_1&&_1.getFieldNames(),_3={}
;if(_2){for(var i=0;i<_2.length;i++){var _5=_2[i],_6=_1.getField(_5),_7=_6.title||_1.getAutoTitle(_5)
;_3[_5]=_7}
}
this.sortEditor.getField("sortField").setValueMap(_3)}
,isc.A.setSort=function isc_SortByEditor_setSort(_1){if(_1&&(isc.isA.String(_1)||_1.length==1)){var _2,_3
;if(isc.isA.String(_1)){_2=(_1.startsWith("-")?_1.substring(1):_1);_3=(_1.startsWith("-")?"descending":"ascending")}else{_2=_1[0].property;_3=_1[0].direction}
this.sortEditor.setValue("sortField",_2);this.sortEditor.setValue("sortDirection",_3);if(!this.sortEditor.getField("sortField").isVisible()){this.sortEditor.getField("sortField").show();this.sortEditor.getField("sortDirection").show();this.sortEditor.getField("multiSort").hide();this.advancedSortLink.show()}
delete this.multiSort}else if(_1){this.multiSort=_1;this.sortEditor.setValue("multiSort",isc.DS.getSortBy(_1).join(" then "));this.sortEditor.getField("sortField").hide();this.sortEditor.getField("sortDirection").hide();this.sortEditor.getField("multiSort").show();this.advancedSortLink.hide()}else{this.sortEditor.getField("sortField").show();this.sortEditor.getField("sortDirection").show();this.sortEditor.getField("multiSort").hide();this.advancedSortLink.show()}
}
,isc.A.getSort=function isc_SortByEditor_getSort(){var _1=this.sortEditor.getValue("sortField"),_2=this.sortEditor.getValue("sortDirection"),_3=_1&&{property:_1,direction:_2},_4
;if(this.multiSort){_4=this.multiSort}else{_4=_3&&isc.DS.getSortBy([_3])[0]}
return _4}
,isc.A.showAdvancedSortDialog=function isc_SortByEditor_showAdvancedSortDialog(){var _1=this.getSort();if(isc.isA.String(_1)){_1=[{property:(_1.startsWith("-")?_1.substring(1):_1),direction:(_1.startsWith("-")?"descending":"ascending")
}]}
isc.MultiSortDialog.askForSort(this.dataSource,_1,{target:this,methodName:"multiSortReply"}
)}
,isc.A.multiSortReply=function isc_SortByEditor_multiSortReply(_1){if(_1!=null){_1.clearProperty("normalizer");this.setSort(_1)}
}
);isc.B._maxIndex=isc.C+6;isc.defineClass("SubqueryDataSourceDS","DataSource");isc.A=isc.SubqueryDataSourceDS;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.getPathQueryFK=function isc_c_SubqueryDataSourceDS_getPathQueryFK(_1){var _2=(_1?_1.split("/"):null);if(!_2)return null;var _3=new RegExp("\\[(\\w+)(?:,(\\w+))?\\]");var _4=function(_10){return(_10.indexOf("[")>=0?_10.substring(0,_10.indexOf("[")):_10)};var _5=function(_10){var _6=_3.exec(_10);return _6&&_6[1]};var _7=[],_8=_2[0]
;for(var i=1;i<_2.length;i++){var _10=_4(_2[i]),_11=_5(_2[i]),_12=isc.DS.get(_8)
;if(!_11){var _13=(_12?_12.getFieldNames():[]),_14
;for(var j=0;j<_13.length;j++){_14=_12.getField(_13[j]);if(_14.foreignKey&&_14.foreignKey.startsWith(_10+".")){_11=_13[j];break}
}
if(!_11){_12=isc.DS.get(_10);_13=(_12?_12.getFieldNames():[]);for(var j=0;j<_13.length;j++){_14=_12.getField(_13[j]);if(_14.foreignKey&&_14.foreignKey.startsWith(_8+".")){_11=_10+"."+_13[j];break}
}
}
}else{var _16=_12&&_12.getField(_11);if(_16&&_16.foreignKey!=null){var _17=isc.DS.getForeignDSName(_16,_12);if(_17!=_10){_11=_10+"."+_11}
}else{_11=_10+"."+_11}
}
if(_11){_7.add(_11)}
_8=_10}
return _7.join(":")}
,isc.A.getQueryFKPath=function isc_c_SubqueryDataSourceDS_getQueryFKPath(_1,_2){var _3=(_2?_2.split(":"):null);if(!_3||_2=="*none*")return _1;var _4=_1,_5=[_1]
;for(var i=0;i<_3.length;i++){var _7=isc.DS.get(_4);var _8=_3[i];if(_8.indexOf(".")>0){var _9=_8.substring(0,_8.indexOf(".")),_10=_8.substring(_8.indexOf(".")+1)
;var _11=isc.DS.get(_9),_12=_11.getField(_10),_13=isc.DS.getForeignDSName(_12,_9)
;var _14=_11.getForeignKeyFields();if(isc.getValues(_14).filter(function(_16){return(isc.DS.getForeignDSName(_16,_4)==_13)}).length>1){_5.add(_9+"["+_10+"]")}else{_5.add(_9)}
_4=_9}else{var _11=_7,_12=_11.getField(_8),_15=_12.foreignKey,_13=(_15?isc.DS.getForeignDSName(_12,_4):_4)
;var _14=_11.getForeignKeyFields();if(isc.getValues(_14).filter(function(_16){return(isc.DS.getForeignDSName(_16,_4)==_13)}).length>1){_5.add(_13+"["+_8+"]")}else{_5.add(_13)}
_4=_13}
}
return _5.join("/")}
);isc.B._maxIndex=isc.C+2;isc.A=isc.SubqueryDataSourceDS.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.clientOnly=true;isc.A.dataProtocol="clientCustom";isc.A.titleField="title";isc.A.separateIndirectRecords=true;isc.A.canSelectIndirectRecord=false;isc.A.showForeignKeyTitle=true;isc.B.push(isc.A.init=function isc_SubqueryDataSourceDS_init(){this.Super("init",arguments);this.rootNode={id:this.rootDS,title:this.rootDS
}}
,isc.A.transformRequest=function isc_SubqueryDataSourceDS_transformRequest(_1){if(_1.operationType!=="fetch")return;var _2={data:this.getChildNodes(_1.data)
};this.processResponse(_1.requestId,_2)}
,isc.A.getChildNodes=function isc_SubqueryDataSourceDS_getChildNodes(_1){var _2=this.splitCriteria(_1,["id","parentId"]),_3=_2.id,_4=_2.parentId
;if(_3&&_3.indexOf("/")>=0){var _5=_3.split("/");_4=_5.slice(0,_5.length-1).join("/");var _6=this.getChildNodes({parentId:_4}).find("id",_3);return[_6]}else if(!_4||_4==""){return[this.rootNode]}
var _7=this.getLastDataSourceFromPath(_4),_8=isc.DS.getRegisteredDataSources(),_9=_8.map(function(_15){return isc.DS.get(_15)})
.filter(function(_15){return _15!=null&&!_15.componentSchema&&!_15.builtinSchema&&_15.addGlobalId!=false&&!_15.$145w&&!_15._autoAssignedID}),_10=isc.DSRelations.create({dataSources:_9
})
;if(!_7){return[]}
var _11=_10.getRelationsForDataSource(_7.getID()),_12=this.getDirectAggregates(_4,_11,_10),_13=this.getIndirectAggregates(_4,_11,_10),_14=[]
;_14.addList(_12);if(_13&&_13.length>0){if(this.separateIndirectRecords){_14.add({parentId:_4,id:_4+"/_indAgg_",title:"= Indirect Aggregation =",enabled:false,isFolder:false
})}
_14.addList(_13);if(!this.separateIndirectRecords){_14=_14.sortByProperty("title",true)}
}
return _14}
,isc.A.getLastDataSourceFromPath=function isc_SubqueryDataSourceDS_getLastDataSourceFromPath(_1){var _2=_1.split("/"),_3=_2[_2.length-1],_4=_3.substring(0,(_3.indexOf("[")>=0?_3.indexOf("["):_3.length))
;return(_4?isc.DS.get(_4):null)}
,isc.A.getLastFKFieldFromPath=function isc_SubqueryDataSourceDS_getLastFKFieldFromPath(_1){var _2=_1.split("/"),_3=_2[_2.length-1],_4=new RegExp("\\[(\\w+)(?:,(\\w+))?\\]"),_5=_4.exec(_3)
;return(_5?_5[1]:null)}
,isc.A.getDirectAggregates=function isc_SubqueryDataSourceDS_getDirectAggregates(_1,_2,_3){var _4=null,_5=this.getLastDataSourceFromPath(_1),_6=this.showForeignKeyTitle,_7=this.alwaysShowForeignKey,_8={}
;return _2.filter(function(_17){return _17.type=="1-M"&&(!_4||_17.fieldName==_4)})
.map(function(_17){var _9=_17.dsId;_8[_9]=(_8[_9]||0)+1;return _17})
.map(function(_17){var _10=_3.getRelationsForDataSource(_17.dsId),_11=(_10.length>0),_12=_8[_17.dsId],_13=(_12>1),_14=_13||_7,_15=(_6?_17.fieldTitle||isc.DS.getAutoTitle(_17.fieldName):_17.fieldName),_16=_1+"/"+_17.dsId+(_13?"["+_17.fieldName+"]":"")
;return{parentId:_1,id:_16,title:_17.dsId+(_14?" [via "+_15+"]":""),queryFK:isc.SubqueryDataSourceDS.getPathQueryFK(_16),isFolder:_11
}
})
.sortByProperty("title",true)}
,isc.A.getIndirectAggregates=function isc_SubqueryDataSourceDS_getIndirectAggregates(_1,_2,_3){var _4=this.getLastFKFieldFromPath(_1),_5=this.getLastDataSourceFromPath(_1),_6=this.showForeignKeyTitle,_7=this.alwaysShowForeignKey,_8=this.canSelectIndirectRecord,_9={}
;return _2.filter(function(_18){return _18.type!="1-M"})
.map(function(_18){var _10=_18.dsId;_9[_10]=(_9[_10]||0)+1;return _18})
.map(function(_18){var _11=_3.getRelationsForDataSource(_18.dsId),_12=(_11.length>0),_13=_9[_18.dsId],_14=(_13>1),_15=_14||_18.type=="Self"||_7,_16=(_6?_18.fieldTitle||isc.DS.getAutoTitle(_18.fieldName):_18.fieldName),_17=_1+"/"+_18.dsId+(_14?"["+_18.fieldName+","+_5.getPrimaryKeyFieldName()+"]":"")
;return{parentId:_1,id:_17,title:_18.dsId+(_15?" ["+_16+"]":""),queryFK:isc.SubqueryDataSourceDS.getPathQueryFK(_17),canSelect:_8,isFolder:_12
}})
.sortByProperty("title",true)}
);isc.B._maxIndex=isc.C+7;isc.defineClass("SubqueryDataSourceItem","ComboBoxItem");isc.A=isc.SubqueryDataSourceItem.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.valueField="id";isc.A.displayField="title";isc.A.dataSetType="tree";isc.A.pickListWidth=350;isc.A.pickListProperties={autoFitFieldWidths:true,autoFetchData:true,loadDataOnDemand:true,showNodeIcons:false,rowClick:function(_1,_2,_3){if(_2<0||_3<0)return false;var _4=this.getRecord(_2),_5=this.data.isFolder(_4);if(_5&&_4.canSelect===false){this.openFolder(_4);return}
return this.Super("rowClick",arguments)}
};isc.A.autoOpenTree="all";isc.A.formatOnBlur=true;isc.A.selectDSDefaults={_constructor:"SubqueryDataSourceDS"
};isc.B.push(isc.A.formatValue=function isc_SubqueryDataSourceItem_formatValue(_1,_2,_3,_4){var _5=this.getSelectedQueryFK(),_6=_5&&_5.split(":")
;if(_6&&(_6.length>1||(_6.length>0&&_6[0].contains("."))))
{return _1+" ("+_5+")"}
return _1}
,isc.A.setRootDS=function isc_SubqueryDataSourceItem_setRootDS(_1){if(this.rootDS!=_1){this.rootDS=_1;var _2=this.getOptionDataSource();if(_2)_2.destroy();if(_1){var _3={rootDS:_1
};if(this.separateIndirectRecords!=null)_3.separateIndirectRecords=this.separateIndirectRecords;if(this.showForeignKeyTitle!=null)_3.showForeignKeyTitle=this.showForeignKeyTitle;if(this.alwaysShowForeignKey!=null)_3.alwaysShowForeignKey=this.alwaysShowForeignKey;if(this.canSelectIndirectRecord!=null)_3.canSelectIndirectRecord=this.canSelectIndirectRecord;_2=this.createAutoChild("selectDS",_3)}
this.setOptionDataSource(_2)}
}
,isc.A.getSelectedDataSource=function isc_SubqueryDataSourceItem_getSelectedDataSource(_1){_1=_1||this.getValue();if(!_1)return null;var _2=_1.split("/"),_3=_2[_2.length-1]
;return _3.substring(0,(_3.indexOf("[")>=0?_3.indexOf("["):_3.length))
}
,isc.A.getSelectedQueryFK=function isc_SubqueryDataSourceItem_getSelectedQueryFK(){return isc.SubqueryDataSourceDS.getPathQueryFK(this.getValue())}
);isc.B._maxIndex=isc.C+4;isc.defineClass("SubqueryDataSourcePicker","DynamicForm");isc.A=isc.SubqueryDataSourcePicker.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.dsPickerFieldDefaults={name:"dsPicker",type:"SubqueryDataSourceItem",title:"DataSource",required:true,addUnknownValues:true,width:400,changed:function(_1,_2,_3){var _4=_2.getSelectedDataSource(),_5=_2.getSelectedQueryFK()
;_1.setValue("dsName",_4);_1.setValue("queryFK",_5);_1.getItem("dsName").handleChanged(_4);if(_1.dsNameChanged){_1.dsNameChanged(_4,_5)}
}
};isc.A.dsNameFieldDefaults={name:"dsName",hidden:true
};isc.B.push(isc.A.initWidget=function isc_SubqueryDataSourcePicker_initWidget(){var _1=(this.dataSources||[]);var _2=isc.addProperties({},this.dsPickerFieldDefaults,this.dsPickerFieldProperties,{valueMap:_1,separateIndirectRecords:this.separateIndirectRecords,showForeignKeyTitle:this.showForeignKeyTitle,alwaysShowForeignKey:this.alwaysShowForeignKey,canSelectIndirectRecord:this.canSelectIndirectRecord
});var _3=isc.addProperties({},this.dsNameFieldDefaults,this.dsNameFieldProperties);this.fields=[_2,_3];this.Super("initWidget",arguments)}
,isc.A.setValues=function isc_SubqueryDataSourcePicker_setValues(_1){var _2;var _3=_1.baseDSName;if(!this.baseDSName||(_3&&this.baseDSName!=_3)){var _4=this.getField("dsPicker");_4.setRootDS(_3)}
if(_1&&_3){var _5=_1.dsName||_3,_6=_1.queryFK
;if(_3&&_6){_2=isc.SubqueryDataSourceDS.getQueryFKPath(_3,_6)}else if(this.showAggregationLayout!=false){if(_5!=_3&&_5.indexOf("/")==-1){var _7=isc.DS.get(_3),_8=isc.DS.get(_5)
;if(_8){var _9=_7.getDefaultPathToRelation(_8);if(_9&&_9.path){_2=[_3,_9.path].join("/")}
}
}else{_2=_3}
}
}
if(_2!=null){var _10={};isc.DynamicForm.$91f(this,_1,_10);_10.dsPicker=_2;arguments[0]=_10}
this.Super("setValues",arguments)}
);isc.B._maxIndex=isc.C+2}
isc.ClassFactory.defineClass("MockupContainer","Canvas");isc.A=isc.MockupContainer.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.defaultWidth="100%";isc.A.defaultHeight="100%";isc.A.autoMaskChildren=true;isc.A.editProxyProperties={childrenSnapToGrid:true,childrenSnapAlign:true,persistCoordinates:true
};isc.B.push(isc.A.init=function isc_MockupContainer_init(){if(!this.children&&this.components){this.children=this.components}
if(this.dataSources){this.createDataSources()}
this.Super("init",arguments)}
,isc.A.createDataSources=function isc_MockupContainer_createDataSources(){if(!this.dataSources)return;for(var i=0;i<this.dataSources.length;i++){isc.ClassFactory.newInstance(this.dataSources[i]._constructor,this.dataSources[i])}
}
);isc.B._maxIndex=isc.C+2;isc.overwriteClass("MockupElement","Img");isc.A=isc.MockupElement.getPrototype();isc.A.controlName="MockupElement";isc.A.defaultWidth=16;isc.A.defaultHeight=28;isc.A.measuredW=-1;isc.A.measuredH=-1;isc.A=isc.MockupElement.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_MockupElement_initWidget(){this.Super(this.$oc,arguments);var _1=isc.Page.getToolsDir()+"mockups/";var _2=this.controlName.substr(this.controlName.indexOf("::")+2,this.controlName.length)+".png";this.src=_1+_2;if(this.title!=null){this.addChild(isc.Label.create({ID:this.getID()+"_titleLabel",autoDraw:true,left:10,top:0,width:this.width,height:this.height,zIndex:this.getZIndex(true)+1,contents:this.title
})
)}
}
);isc.B._maxIndex=isc.C+1;isc.defineClass("RuleEditor","VLayout");isc.A=isc.RuleEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.height=100;isc.A.validatorIsRule=true;isc.A.availableTypes=["matchesField","isOneOf","lengthRange","contains","doesntContain","substringCount","regexp","mask","floatPrecision","readOnly","isUnique","hasRelatedRecord","range","message","populate","setRequired"
];isc.A.nameItemTitle="Name";isc.A.descriptionItemTitle="Description";isc.A.triggerEventTitle="On event";isc.A.fieldPickerTitle="For field";isc.A.applyWhenTitle="If";isc.A.applyWhenPlaceholder=".. conditional ..";isc.A.validatorTitle="Do";isc.A.errorMessageTitle="Message";isc.A.width=400;isc.A.components=["nameForm","mainForm","applyWhenForm","validatorForm","messageForm"
];isc.A.showNameForm=false;isc.A.nameFormConstructor="DynamicForm";isc.A.nameFormDefaults={numCols:2
};isc.A.nameItemDefaults={editorType:"TextItem"
};isc.A.descriptionItemDefaults={editorType:"TextAreaItem"
};isc.A.mainFormConstructor="DynamicForm";isc.A.mainFormDefaults={numCols:2,height:20
};isc.A.fieldPickerConstructor="SelectItem";isc.A.fieldPickerDefaults={name:"fieldName",multiple:true,showIf:function(){return this.creator.shouldShowFieldPicker()},pickListProperties:{showHeader:true,canSelectAll:false
},getClientPickListData:function(){var _1=[];var _2=this.form.creator.locatorMap;if(_2!=null){if(isc.isAn.Array(_2)){for(var i=0;i<_2.length;i++){_1.add({name:_2[i],title:_2[i],type:"locator"
})}
}else{for(var _4 in _2){_1.add({name:_4,title:_2[_4],type:"locator"
})}
}
}
var _5=this.form.creator.getFieldData();_1.addList(_5);return _1},valueField:"name",displayField:"title",pickListWidth:300,pickListFields:[{name:"title",title:"Target",width:80},{name:"type",title:"Type",width:80},{name:"name",title:"Identifier",autoFitWidth:true}
],changed:function(_1,_2,_3){if(this.pickList&&this.pickList.isVisible())this.filterPickList();var _4=null,_5=null;if(_3!=null){if(!isc.isAn.Array(_3))_3=[_3];for(var i=0;i<_3.length;i++){var _7=this.form.creator.getField(_3[i],true);if(_7==null){if(_4==null)_4=[];_4.add(_3[i])}else{if(_5==null)_5=[];_5.add(_3[i])}
}
}
if(this.creator.warnOnInvalidFieldSelection&&_3!=null&&!isc.isAn.emptyArray(_3)&&(this.creator.getSupportedTypes(_5,_4).length==0))
{isc.warn(this.creator.invalidFieldSelectionWarning)}
this.creator.updateFieldName(_5,_4)}
};isc.A.warnOnInvalidFieldSelection=true;isc.A.invalidFieldSelectionWarning="None of the available validators can be applied to the selected set of fields.";isc.A.editStartEventTitle="Edit start";isc.A.editStartAndChangedEventTitle="Edit start/changed";isc.A.editorEnterEventTitle="Editor enter";isc.A.editorExitEventTitle="Editor exit";isc.A.changedEventTitle="Changed";isc.A.submitEventTitle="Submit";isc.A.manualEventTitle="Manual";isc.A.triggerEventPickerConstructor="SelectItem";isc.A.triggerEventPickerDefaults={name:"event",startRow:true,changed:function(_1,_2,_3){this.creator.updateTriggerEvent(_3)},showIf:function(){return this.creator.shouldShowTriggerEventPicker()}
};isc.A.applyWhenFormConstructor="DynamicForm";isc.A.applyWhenFormDefaults={numCols:2,fixedColWidths:true,height:20
};isc.A.applyWhenItemDefaults={showLabel:true,editorType:"CheckboxItem",width:20,showTitle:false,align:"right",vAlign:"top",changed:"this.form.creator.updateConditionalForm(value)",init:function(){if(this.form){var _1=this.form,_2=_1.getTitleOrientation(),_3=(_2=="right"?_1.rightTitlePrefix:_1.titlePrefix),_4=(_2=="right"?_1.rightTitleSuffix:_1.titleSuffix)
;this.title=_3+this.title+_4}
this.Super("init",arguments)}
};isc.A.filterTopOperatorAppearance="radio";isc.A.conditionalFormConstructor="FilterBuilder";isc.A.conditionalFormDefaults={showFieldTitles:false,fieldPickerProperties:{},showModeSwitcher:true,multiDSFieldFormat:"qualified"
};isc.A.validatorFormConstructor="DynamicForm";isc.A.validatorFormDefaults={numCols:2,fixedColWidths:true,height:20
};isc.A.typePickerConstructor="SelectItem";isc.A.typePickerDefaults={name:"type",width:"*",pickListProperties:{sortField:0},showIf:function(){var _1=this.form.creator;return _1.showTypePicker==false?false:true},getValueMap:function(){return this.creator.getTypeValueMap()},changed:function(_1,_2,_3){this.creator.updateValidatorType(_3)}
};isc.A.messageFormConstructor="DynamicForm";isc.A.messageFormDefaults={numCols:2,width:"100%",height:20
};isc.A.errorMessageItemDefaults={editorType:"TextItem",width:"*"
};isc.A.valuesFormConstructor="FilterClause";isc.A.valuesFormDefaults={customGetValuesFunction:"getAttributesFromEditor",customSetValuesFunction:"setEditorAttributes",operatorAttribute:"type",fieldPickerProperties:{showIf:"return false"
},getEditorType:function(_1,_2){var _3=this.creator.getValidatorDefinition(_2);if(_3&&_3.valueType=="custom"&&_3.editorType)
{return _3.editorType}
if(_1&&(isc.SimpleType.inheritsFrom(_1.type,"date")
||isc.SimpleType.inheritsFrom(_1.type,"datetime")))return"RelativeDateItem";if(_2=="readOnly"){return"ReadOnlyRuleEditor"}
return null}
};isc.B.push(isc.A.initWidget=function isc_RuleEditor_initWidget(){var _1=this.rule||this.validator;if(_1!=null){this.setRule(_1,true)}
if(this.showTypePicker==null&&this.validatorType!=null){this.showTypePicker=false}
this.addAutoChildren(this.components);if(this.nameForm!=null&&_1!=null){this.nameForm.setValue("name",_1.name);this.nameForm.setValue("description",_1.description)}
if(this.mainForm){this.fieldPicker=this.mainForm.getItem("fieldName");if(this.fieldName!=null)this.fieldPicker.setValue(this.fieldName);this.triggerEventPicker=this.mainForm.getItem("event");if(this.triggerEvent)this.triggerEventPicker.setValue(this.triggerEvent);if(!this.validatorIsRule){this.mainForm.setVisibility(isc.Canvas.HIDDEN)}
}
if(this.applyWhenForm){if(this.applyWhen!=null){this.applyWhenForm.setValue("applyWhen",true);this.updateConditionalForm(true)}
}
if(this.validatorForm){this.typePicker=this.validatorForm.getItem("type");if(this.validatorType!=null)this.typePicker.setValue(this.validatorType);if(this.validatorType!=null){this.updateValidatorType(this.validatorType,true)}
}
if(this.messageForm){if(this.rule&&this.rule.errorMessage){this.messageForm.setValue("errorMessage",this.rule.errorMessage)}
}
if(_1!=null){this.setClauseAttributes(_1)}
return this.Super("initWidget",arguments)}
,isc.A.getDynamicDefaults=function isc_RuleEditor_getDynamicDefaults(_1){switch(_1){case"nameForm":var _2=(this.nameItemTitle?{title:this.nameItemTitle}:null),_3=(this.descriptionItemTitle?{title:this.descriptionItemTitle}:null),_4=isc.addProperties({name:"name"},this.nameItemDefaults,this.nameItemProperties,_2),_5=isc.addProperties({name:"description"},this.descriptionItemDefaults,this.descriptionItemProperties,_3);return{items:[_4,_5]};case"mainForm":var _6=(this.fieldPickerTitle?{title:this.fieldPickerTitle}:null),_7=(this.triggerEventTitle?{title:this.triggerEventTitle}:null),_8={valueMap:{"editStart":this.editStartEventTitle,"editStartAndChanged":this.editStartAndChangedEventTitle,"editorEnter":this.editorEnterEventTitle,"editorExit":this.editorExitEventTitle,"changed":this.changedEventTitle,"submit":this.submitEventTitle,"manual":this.manualEventTitle
}},_9=isc.addProperties({creator:this,editorType:this.fieldPickerConstructor},this.fieldPickerDefaults,this.fieldPickerProperties,_6
),_10=isc.addProperties({creator:this,editorType:this.triggerEventPickerConstructor},this.triggerEventPickerDefaults,_8,this.triggerEventPickerProperties,_7
)
return{items:[_9,_10]
};case"applyWhenForm":var _11=(this.applyWhenTitle?{title:this.applyWhenTitle}:null),_12=isc.addProperties({name:"applyWhen"},this.applyWhenItemDefaults,this.applyWhenItemDefaults,_11),_13={type:"StaticTextItem",name:"placeholder",showTitle:false,value:this.applyWhenPlaceholder},_14={type:"CanvasItem",showTitle:false,name:"conditionalItem",showIf:"false",createCanvas:function(){return this.form.creator.createConditionalForm()
}
};return{items:[_12,_13,_14]
};case"validatorForm":var _11=(this.validatorTitle?{title:this.validatorTitle}:null);var _15=isc.addProperties({creator:this,editorType:this.typePickerConstructor},this.typePickerDefaults,this.typePickerProperties,_11
);var _16={name:"valuesItem",editorType:"CanvasItem",showTitle:true,title:null,showIf:"false",canvas:this.getValuesForm(this.validatorType)
}
return{disabled:(this.fieldName==null),items:[_15,_16]
};case"messageForm":var _11=(this.errorMessageTitle?{title:this.errorMessageTitle}:null),_17=isc.addProperties({name:"errorMessage"},this.errorMessageItemDefaults,this.errorMessageItemDefaults,_11);return{items:[_17]}}
}
,isc.A.shouldShowFieldPicker=function isc_RuleEditor_shouldShowFieldPicker(){if(this.showFieldPicker!=null)return this.showFieldPicker;return this.validatorIsRule}
,isc.A.getField=function isc_RuleEditor_getField(_1,_2){return this.dataSource?this.dataSource.getField(_1)
:isc.DataSource.getFieldFromDataSources(_1,this.dataSources,_2)}
,isc.A.getFieldData=function isc_RuleEditor_getFieldData(){if(this.$89u==null){var _1=this.dataSources;if(_1!=null){this.$89u=isc.DataSource.getCombinedDataSourceFields(this.dataSources)}else if(this.dataSource){var _2=isc.getKeys(this.dataSource.getFields());this.$89u=_2.duplicate()}
this.$896=[];for(var i=0;i<this.$89u.length;i++){var _4=this.$89u[i],_5=this.getField(_4);this.$896[i]={name:_4,title:_5.title||_5.name,type:_5.type||"text"
}
}
}
return this.$896}
,isc.A.updateFieldName=function isc_RuleEditor_updateFieldName(_1,_2){this.fieldName=_1;this.locator=_2;var _3=_1!=null&&(!isc.isAn.Array(_1)||_1.length>0),_4=_2!=null&&(!isc.isAn.Array(_2)||_2.length>0),_5=(_3||_4)?this.getSupportedTypes(_1,_2)
:[],_6;if(this.validatorType!=null&&_5.length>0){_6=_5.contains(this.validatorType)}
if(this.validatorForm){if(!_6){this.validatorForm.setValue("type",null);this.validatorType=null}
if(_5.length==0){this.validatorForm.setDisabled(true)}else{this.typePicker.setValueMap(_5);this.validatorForm.setDisabled(false)}
}
if((_4||_3)&&this.validatorType!=null){var _7=false;if(!_4){var _8=this.$91p;if(_8==null){_7=true}else{_7=true;for(var i=0;i<_8.length;i++){var _10=_8[i];if(isc.isAn.Array(_1)?(_1.contains(_10))
:(_1==_10))
{_7=false;break}
}
}
}
this.$91p=(_1==null)?null
:(isc.isAn.Array(_1)?_1:[_1]);if(this.valuesForm.clause.getValue("operator")!=this.validatorType){_7=true}
if(isc.isAn.Array(_1))_1=_1[0];this.valuesForm.fieldName=_1;this.valuesForm.clause.setValue("fieldName",_1);this.valuesForm.clause.setValue("operator",this.validatorType);if(_7){var _11=this.getValidatorDefinition(this.validatorType);this.valuesForm.updateValueItems(this.valuesForm.getField(_1),_11,_1)}
}
this.updateValuesFormVisibility()}
,isc.A.updateValuesFormVisibility=function isc_RuleEditor_updateValuesFormVisibility(){if(this.valuesForm){if((this.fieldName==null&&this.locator==null)||this.validatorType==null){this.validatorForm.getItem("valuesItem").hide()}else{if(!this.valuesForm.isVisible()){this.validatorForm.getItem("valuesItem").show()}
}
}
}
,isc.A.shouldShowTriggerEventPicker=function isc_RuleEditor_shouldShowTriggerEventPicker(){if(this.showTriggerEventPicker!=null)return this.showTriggerEventPicker;return this.validatorIsRule}
,isc.A.createConditionalForm=function isc_RuleEditor_createConditionalForm(){var _1=this.filterTopOperatorAppearance||"radio";this.conditionalForm=this.createAutoChild("conditionalForm",{dataSource:this.dataSource,dataSources:this.dataSources,topOperatorAppearance:_1}
);this.conditionalForm.fieldPickerProperties.pickListWidth=this.conditionalForm.getWidth();return this.conditionalForm}
,isc.A.updateConditionalForm=function isc_RuleEditor_updateConditionalForm(_1){var _2=this.applyWhenForm.getItem("placeholder"),_3=this.applyWhenForm.getItem("conditionalItem");if(!_1){_2.show();_3.hide()}else{var _4=this.applyWhen||{};this.conditionalForm.setCriteria(_4);_2.hide();_3.show()}
this.conditionalForm.setTopOperatorAppearance(isc.DataSource.isFlatCriteria(_4)?"radio":"bracket")}
,isc.A.getTypeValueMap=function isc_RuleEditor_getTypeValueMap(){return this.getSupportedTypes(this.fieldName,this.locator)}
,isc.A.getSupportedTypes=function isc_RuleEditor_getSupportedTypes(_1,_2){var _3=this.availableTypes,_4={};_1=_1||[];_2=_2||[];if(!isc.isAn.Array(_1))_1=[_1];if(!isc.isAn.Array(_2))_2=[_2];if(_3.length==0||_1.length==0&&_2.length==0){return[]}
var _5=null,_6={date:true,datetime:true,"float":true,integer:true,time:true};for(var i=0;i<_3.length;i++){var _8=this.getValidatorDefinition(_3[i])||{},_9=true;if(_2.length>0){if(!_8.isRule){_9=false}else{for(var _10=0;_10<_2.length;_10++){var _11=isc.AutoTest.getLocatorObjectType(_2[_10]),_12=_8.supportedTargets||["FormItem"];if(!_12.contains(_11)){_9=false;break}
}
}
}
if(!_9)continue;if(_1.length>0){for(var _10=0;_10<_1.length;_10++){var _13=this.getField(_1[_10]);if(_13==null){this.logWarn("unable to retrieve field for:"+_1[_10]);continue}
var _14=isc.SimpleType.getBaseType(_13.type||"text");if(_3[i]=="range"){if(!_6[_14]||(_5!=null&&_5!=_14))
{_9=false;break}else{_5=_14}
}else{if(_8.dataType!=null&&_8.dataType!="none"
&&_8.dataType!=_14){_9=false;break}
}
}
}
if(_9){var _15=this.getValidatorDefinition(_3[i]);var _16=_15.description||isc.DataSource.getAutoTitle(_3[i]);_4[_3[i]]=_16}
}
return _4}
,isc.A.updateValidatorType=function isc_RuleEditor_updateValidatorType(_1,_2){if(this.validatorType==_1&&!_2)return;this.validatorType=_1;if(_1!=null){var _3=this.valuesForm,_4=this.getValuesForm(_1);if(_3!=_4){this.valuesForm=_4;this.validatorForm.getItem("valuesItem").setCanvas(this.valuesForm)}
}
this.updateValuesFormVisibility()}
,isc.A.resolveValidatorType=function isc_RuleEditor_resolveValidatorType(_1){if(_1==null)_1=this.validatorType;if(_1==null)return null;if(_1=="range"){var _2=this.fieldName,_3;if(_2!=null){if(!isc.isAn.Array(_2))_2=[_2];var _4=false;for(var i=0;i<_2.length;i++){var _6=this.getField(_2[i]),_7=_6.type||"integer";_7=isc.SimpleType.getBaseType(_7);if(_3==null){_3=_7
}else{if(_7!=_3&&(_7!="date"&&_3!="datetime"&&_7!="datetime"&&_3!="date"))
{_4=true;_3="integer"}
}
}
if(_4){this.logWarn("'range' validator for fields with differing types:"
+this.echo(this.fieldName)+". Defaulting to integer type data","RuleEditor")}else{this.logDebug("'range' validator for field[s]:"
+this.echo(this.fieldName)+". Assuming "+_3+" type data","RuleEditor")}
}else{this.logInfo("Attempting to get 'range' validator with no field type - defaulting to integer","RuleEditor");_3="integer"}
if(_3=="date"||_3=="datetime"){_1="dateRange"}else if(_3=="time"){_1="timeRange"}else if(_3=="float"){_1="floatRange"
}else{_1="integerRange"
}
}
return _1}
,isc.A.getValidatorDefinition=function isc_RuleEditor_getValidatorDefinition(_1){_1=this.resolveValidatorType(_1);return isc.Validator.$74u[_1]}
,isc.A.getValuesForm=function isc_RuleEditor_getValuesForm(_1){if(_1!=null){var _2=this.getValidatorDefinition(_1),_3=_2.valueType;_2.ID=_1}
var _4=this.fieldName;if(isc.isAn.Array(_4))_4=_4[0];if(this.valuesForm){var _5=_4?this.valuesForm.getField(_4):null;this.valuesForm.updateValueItems(_5,_2,_4);this.valuesForm.clause.setValue("operator",_1);return this.valuesForm}else{var _6=this.valuesForm=this.createAutoChild("valuesForm",{visibility:(this.fieldName||this.locator?"inherit":"hidden"),showRemoveButton:false,dataSources:this.dataSources,dataSource:this.dataSource,fieldName:_4,operatorType:_1
});var _7=_6.clause;_7.getItem("operator").hide();_7.getItem("operator").addUnknownValues=true;return _6}
}
,isc.A.setValidatorType=function isc_RuleEditor_setValidatorType(_1){this.validatorForm.setValue("type",_1);this.updateValidatorType(_1)}
,isc.A.setFieldName=function isc_RuleEditor_setFieldName(_1){var _2=this.locator;if(this.fieldPicker){var _3=_1
if(_2!=null){if(!isc.isAn.Array(_2))_3=[_2];else _3=_2.duplicate();if(isc.isAn.Array(_1)){_3.addList(_1)}else if(_1!=null){_3.add(_1)}
}
this.fieldPicker.setValue(_3)}
this.updateFieldName(_1,this.locator)}
,isc.A.setLocator=function isc_RuleEditor_setLocator(_1){if(this.fieldPicker){var _2=this.fieldName,_3=_1;if(_2!=null){if(!isc.isAn.Array(_2))_3=[_2];else _3=_2.duplicate();if(isc.isAn.Array(_1)){_3.addList(_1)}else if(_1!=null){_3.add(_1)}
}
this.fieldPicker.setValue(_3)}
this.updateFieldName(this.fieldName,_1)}
,isc.A.setTriggerEvent=function isc_RuleEditor_setTriggerEvent(_1){if(this.triggerEventPicker){this.triggerEventPicker.setValue(_1)}
this.updateTriggerEvent(_1)}
,isc.A.updateTriggerEvent=function isc_RuleEditor_updateTriggerEvent(_1){this.triggerEvent=_1}
,isc.A.setApplyWhen=function isc_RuleEditor_setApplyWhen(_1){this.applyWhen=_1;this.applyWhenForm.setValue("applyWhen",(this.applyWhen!=null));this.updateConditionalForm(_1!=null)}
,isc.A.getApplyWhen=function isc_RuleEditor_getApplyWhen(){if(this.applyWhenForm.getValue("applyWhen")){this.applyWhen=this.conditionalForm.getCriteria()}else{this.applyWhen=null}
return this.applyWhen}
,isc.A.getAttributesFromClause=function isc_RuleEditor_getAttributesFromClause(){var _1=this.getValidatorDefinition();var _2=this.fieldName,_3=this.valuesForm;if(isc.isAn.Array(_2))_2=_2[0];var _4=_3.getClauseValues(_2,_1);return _4}
,isc.A.setClauseAttributes=function isc_RuleEditor_setClauseAttributes(_1){if(this.valuesForm==null)return;var _2=this.getValidatorDefinition();var _3=this.fieldName;if(isc.isAn.Array(_3))_3=_3[0];this.valuesForm.setClauseValues(_3,_2,_1)}
,isc.A.getValidator=function isc_RuleEditor_getValidator(){return this.getRule()}
,isc.A.getRule=function isc_RuleEditor_getRule(){if(this.validatorType==null||(this.fieldName==null&&this.locator==null))return null;var _1={};_1.type=this.resolveValidatorType(this.validatorType);if(this.nameForm!=null){var _2=this.nameForm.getValue("name");if(_2!=null)_1.name=_2;var _3=this.nameForm.getValue("description");if(_3!=null)_1.description=_3}
if(this.valuesForm!=null){var _4=this.getAttributesFromClause();for(var _5 in _4){if(_5=="type")continue;_1[_5]=_4[_5]}
}
if(this.validatorIsRule){if(this.fieldName)_1.fieldName=this.fieldName;if(this.locator)_1.locator=this.locator;if(this.triggerEvent)_1.triggerEvent=this.triggerEvent}else{delete _1.fieldName}
_1.errorMessage=this.messageForm.getValue("errorMessage");var _6=this.getApplyWhen();if(_6!=null)_1.applyWhen=_6;if(!this.showNameForm){_1.description=this.createRuleDescription(_1)}
return _1}
,isc.A.createRuleDescription=function isc_RuleEditor_createRuleDescription(_1){if(!_1.type)return null;var _2=this.getValidatorDefinition(_1.type),_3=_2.title||isc.DataSource.getAutoTitle(_1.type),_4=this.triggerEventPicker.valueMap,_5=_3+" for field "+_1.fieldName+" on "+_4[_1.triggerEvent]
;if(_1.applyWhen){_5+=" if "+isc.DataSource.getAdvancedCriteriaDescription(_1.applyWhen,this.dataSources||this.dataSource)}
return _5}
,isc.A.validate=function isc_RuleEditor_validate(){var _1=false;if(this.nameForm)_1=this.nameForm.validate()==false;if(this.mainForm)_1=(this.mainForm.validate()==false)||_1;if(this.applyWhenForm&&this.applyWhenForm.getValue("applyWhen")){_1=(this.conditionalForm.validate()==false)||_1}
if(this.validatorForm){_1=(this.validatorForm.validate()==false)||_1;if(this.valuesForm)_1=(this.valuesForm.validate()==false)||_1}
if(this.messageForm)_1=(this.messageForm.validate()==false)||_1;return!_1}
,isc.A.setRule=function isc_RuleEditor_setRule(_1,_2){this.validator=this.rule=_1;if(_2){this.validatorType=_1.type;this.applyWhen=_1.applyWhen;this.fieldName=_1.fieldName;this.locator=_1.locator;this.triggerEvent=_1.triggerEvent}else{if(this.nameForm){this.nameForm.setValue("name",_1.name);this.nameForm.setValue("description",_1.description)}
if(_1.fieldName!=null||_1.locator!=null){this.setFieldName(_1.fieldName);this.setLocator(_1.locator)}
this.setTriggerEvent(_1.triggerEvent);this.setValidatorType(_1.type);this.setApplyWhen(_1.applyWhen);this.messageForm.setValue("errorMessage",_1.errorMessage);this.setClauseAttributes(_1)}
}
,isc.A.setValidator=function isc_RuleEditor_setValidator(_1){this.setRule(_1)}
,isc.A.clearRule=function isc_RuleEditor_clearRule(){this.rule=this.validator=null;this.setFieldName(null);this.setValidatorType(null);this.setApplyWhen(null);this.setTriggerEvent(null);if(this.nameForm)this.nameForm.clearValues();if(this.messageForm)this.messageForm.clearValue("errorMessage")}
,isc.A.clearValidator=function isc_RuleEditor_clearValidator(){return this.clearRule()}
);isc.B._maxIndex=isc.C+33;if(isc.DynamicForm){isc.defineClass("PopulateRuleEditor","BlurbItem");isc.A=isc.PopulateRuleEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.emptyFormulaText="Click the icon to select a formula";isc.A.formulaVarsTitle="Formula Variables:";isc.A.formulaTitle="Formula:";isc.A.editFormulaPrompt="Click to edit formula";isc.A.icons=[{click:"item.showFormulaWindow()"}
];isc.A.formulaWindowConstructor="Window";isc.A.formulaWindowDefaults={title:"Formula Editor",showMinimizeButton:false,showMaximizeButton:false,isModal:true,showModalMask:true,autoSize:true,autoCenter:true,autoDraw:true,headerIconProperties:{padding:1,src:"[SKINIMG]ListGrid/formula_menuItem.png"
},closeClick:function(){this.items.get(0).completeEditing(true)}
};isc.A.formulaBuilderConstructor="FormulaBuilder";isc.A.formulaBuilderDefaults={width:300,showTitleField:false,showAutoHideCheckBox:false,showSaveAddAnotherButton:false,fireOnClose:function(){this.creator.userEditComplete(!this.cancelled)}
};isc.B.push(isc.A.formatValue=function isc_PopulateRuleEditor_formatValue(_1,_2,_3,_4){if(_1==null||_1.formula==null){return this.emptyFormulaText}
var _5=_1.formulaVars,_6=isc.getKeys(_5).sort(),_7=""
;for(var i=0;i<_6.length;i++){var _9=_6[i];_7+=_9+":&nbsp;"+_5[_9]+"\n"}
return"<table class="+this.getTextBoxStyle()+"><tr><td>"+this.formulaVarsTitle+"</td><td>"
+_7+"</td></tr><tr><td>"+this.formulaTitle+"</td><td>"+_1.formula+"</td></tr></table>"}
,isc.A.init=function isc_PopulateRuleEditor_init(){this.icons[0].prompt=this.editFormulaPrompt;return this.Super("init",arguments)}
,isc.A.showFormulaWindow=function isc_PopulateRuleEditor_showFormulaWindow(){if(this.formulaBuilder==null){this.formulaBuilder=this.createAutoChild("formulaBuilder",{dataSource:this.form.creator.dataSource,dataSources:this.form.creator.dataSources,mathFunctions:isc.MathFunction.getDefaultFunctionNames()}
);this.formulaWindow=this.createAutoChild("formulaWindow",{items:[this.formulaBuilder]})}
this.formulaBuilder.setValue("");this.formulaWindow.show()}
,isc.A.userEditComplete=function isc_PopulateRuleEditor_userEditComplete(_1){if(_1){var _2=this.formulaBuilder.getBasicValueObject(),_3,_4;if(_2!=null){_3=_2.text;_4=_2.formulaVars}
if(_3!=null){this.storeValue({formula:_3,formulaVars:_4})}else{this.storeValue(null)}
this.redraw()}
this.formulaWindow.clear()}
);isc.B._maxIndex=isc.C+4;isc.defineClass("ReadOnlyRuleEditor","SelectItem");isc.A=isc.ReadOnlyRuleEditor.getPrototype();isc.A.defaultValue=isc.Validator.READONLY;isc.A.valueMap=[isc.Validator.HIDDEN,isc.Validator.DISABLED,isc.Validator.READONLY
]}
isc.defineClass("StackedListEditor","VLayout");isc.A=isc.StackedListEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.addButtonTitle="Add item";isc.A.newItemTitle="[New item]";isc.A.addIcon="[SKIN]actions/add.png";isc.A.addIconSize=16;isc.A.removeIcon="[SKIN]actions/remove.png";isc.A.removeIconSize=16;isc.A.mainLayoutDefaults={_constructor:isc.VLayout,height:"100%",membersMargin:5
};isc.A.stackDefaults={_constructor:isc.SectionStack,autoParent:"mainLayout",visibilityMode:"multiple",overflow:"auto",vPolicy:"none",membersChanged:function(){this.creator.updateSectionControls()}
};isc.A.upButtonDefaults={_constructor:isc.ImgButton,src:"[SKIN]headerIcons/arrow_up.png",size:16,prompt:"Move item up",showDisabled:false,showDown:false,click:"this.creator.moveItemUp(this.itemEditor);return false;"
};isc.A.downButtonDefaults={_constructor:isc.ImgButton,src:"[SKIN]headerIcons/arrow_down.png",size:16,prompt:"Move item down",showDisabled:false,showDown:false,click:"this.creator.moveItemDown(this.itemEditor);return false;"
};isc.A.addButtonDefaults={_constructor:isc.ImgButton,src:"[SKIN]actions/add.png",size:16,showFocused:false,showRollOver:false,showDown:false,click:"this.creator.addItem();return false;"
};isc.A.lowerAddButtonDefaults={_constructor:isc.IButton,wrap:false,autoFit:true,icon:"[SKIN]actions/add.png",iconSize:16,layoutAlign:"center",click:"this.creator.addItem();return false;"
};isc.A.removeButtonDefaults={_constructor:isc.ImgButton,src:"[SKIN]actions/remove.png",size:16,showFocused:false,showRollOver:false,showDown:false,click:"this.creator.removeItem(this.itemEditor);return false;"
};isc.A.itemEditorDefaults={height:50
};isc.B.push(isc.A.initWidget=function isc_StackedListEditor_initWidget(){this.Super("initWidget",arguments);this.addAutoChild("mainLayout");this.addAutoChild("stack",{canReorderSections:(this.canReorderItems!=false)});if(this.canAddItems!=false&&!this.showAddButtonInHeader){var _1={icon:this.addIcon,iconSize:this.addIconSize,title:this.addButtonTitle};this.addButton=this.createAutoChild("lowerAddButton",_1);this.mainLayout.addMember(this.addButton)}
if(this.items){this.setItems(this.items.duplicate())}else if(this.canAddItems!=false){this.addItem()}
}
,isc.A.moveSection=function isc_StackedListEditor_moveSection(_1,_2){this.Super("moveSection",arguments);this.updateSectionControls()}
,isc.A.updateSectionControls=function isc_StackedListEditor_updateSectionControls(){var _1=this.stack.getSections();for(var i=0;i<_1.length;i++){var _3=this.stack.getSectionHeader(_1[i]),_4=_3.controls[this.showReorderButtons!=false?2:0],_5=_3.controls[0];;_4.showAddButton(this.canAddItems!=false&&i==_1.length-1);if(this.showReorderButtons!=false){var _6=[];if(i==0)_6.add("top");if(i==_1.length-1)_6.add("bottom");_5.setStates(_6)}
}
}
,isc.A.handleTitleChanged=function isc_StackedListEditor_handleTitleChanged(_1,_2){var _3=this.stack.getSectionNumber(_1.sectionName);if(_3>=0){this.stack.setSectionTitle(_3,_2)}
}
,isc.A.getItemEditorValue=function isc_StackedListEditor_getItemEditorValue(_1,_2){return null}
,isc.A.getSectionIndexForEditor=function isc_StackedListEditor_getSectionIndexForEditor(_1){var _2=this.stack.getSections();for(var i=0;i<_2.length;i++){var _4=this.stack.getSectionHeader(_2[i]),_5=_4.items[0]
;if(_1==_5)return i}
return null}
,isc.A.moveItemUp=function isc_StackedListEditor_moveItemUp(_1){var _2=this.getSectionIndexForEditor(_1);if(_2!=null){this.stack.moveSection(_2,_2-1)}
}
,isc.A.moveItemDown=function isc_StackedListEditor_moveItemDown(_1){var _2=this.getSectionIndexForEditor(_1);if(_2!=null){this.stack.moveSection(_2,_2+1)}
}
,isc.A.addItem=function isc_StackedListEditor_addItem(_1){var _2=this.newItemTitle;if(_1)_2=this.getItemTitle(_1);var _3=(this.getItemEditorProperties?this.getItemEditorProperties(_1):{}),_4=this.createAutoChild("itemEditor",_3),_5=[_4],_6
;if((this.canAddItems!=false&&this.showAddButtonInHeader)||this.canRemoveItems!=false){var _7=[],_8=this.canAddItems!=false&&this.showAddButtonInHeader
;if(_8){var _9={src:this.addIcon,size:this.addIconSize},_10=this.createAutoChild("addButton",_9)
;_7.add(_10)}
if(this.canRemoveItems!=false){var _9={itemEditor:_4,src:this.removeIcon,size:this.removeIconSize},_11=this.createAutoChild("removeButton",_9)
;_7.add(_11)}
var _12=isc.HLayout.create({height:Math.max(this.addIconSize,this.removeIconSize),width:16,membersMargin:2,align:"right",members:_7,showAddButton:function(_18){if(!_8)return;var _10=this.getMember(0);if(_18)_10.show();else _10.hide()}
});_6=[_12]}
if(this.showReorderButtons!=false){var _13=this.createAutoChild("upButton",{itemEditor:_4}),_14=this.createAutoChild("downButton",{itemEditor:_4})
;var _12=isc.HLayout.create({height:16,width:16,membersMargin:2,align:"right",members:[_13,_14],setStates:function(_18){var _13=this.getMember(0),_14=this.getMember(1)
;if(_13){if(_18.contains("top"))_13.disable();else _13.enable()}
if(_14){if(_18.contains("bottom"))_14.disable();else _14.enable()}
}
});if(!_6)_6=[];_6.addAt(isc.LayoutSpacer.create({width:5}),0);_6.addAt(_12,0)}
var _15={title:_2,items:_5,expanded:!_1,controls:_6
};if(this.getSectionProperties)isc.addProperties(_15,this.getSectionProperties(_1));this.stack.addSection(_15);var _16=this.stack.getSectionNames(),_17=_16[_16.length-1]
;_4.sectionName=_17;this.updateSectionControls()}
,isc.A.removeItem=function isc_StackedListEditor_removeItem(_1){var _2=this.stack.sectionForItem(_1);this.removeItemInSection(_2.name);var _3=this.stack.getSections();if(_3.length==0){this.addItem()}
this.updateSectionControls()}
,isc.A.removeItemInSection=function isc_StackedListEditor_removeItemInSection(_1){var _2=this.stack;this.stack.collapseSection(_1,function(){_2.removeSection(_1)})}
,isc.A.updateItemTitle=function isc_StackedListEditor_updateItemTitle(_1){var _2=this.stack.sectionForItem(_1);if(_2){var _3=this.stack.getSectionHeader(_2),_4=this.getItemEditorValue(_1,_3),_5=this.getItemTitle(_4)
;_3.setTitle(_5)}
}
,isc.A.validate=function isc_StackedListEditor_validate(){var _1=false,_2=this.stack.getSections()
;for(var i=0;i<_2.length;i++){var _4=_2[i],_5=this.stack.getSectionHeader(_4),_6=_5.items[0]
;_1=(_6.validate()==false)||_1}
return!_1}
,isc.A.getItems=function isc_StackedListEditor_getItems(){var _1=this.stack.getSections(),_2=[]
;for(var i=0;i<_1.length;i++){var _4=_1[i],_5=this.stack.getSectionHeader(_4),_6=_5.items[0],_7=this.getItemEditorValue(_6,_5)
;if(_7)_2.add(_7)}
return _2}
,isc.A.setItems=function isc_StackedListEditor_setItems(_1){this.items=_1;var _2=this;var _3=function(_1){for(var i=0;i<_1.length;i++){_2.addItem(_1[i])}
if(_2.canAddItems!=false){_2.addItem()}
};var _5=this.stack.getSections();if(_5&&_5.length>0){var _6=this.stack;this.stack.collapseSection(_5,function(){_6.removeSection(_5);_3(_1)})}else{_3(_1)}
}
,isc.A.expandAllItems=function isc_StackedListEditor_expandAllItems(){var _1=this.stack.getSections();if(_1&&_1.length>0){this.stack.expandSection(_1)}
}
);isc.B._maxIndex=isc.C+16;isc.defineClass("ValidatorEditor","VLayout");isc.A=isc.ValidatorEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.height=100;isc.A.availableTypes=["matchesField","equals","notEqual","lengthRange","contains","doesntContain","inSet","notInSet","substringCount","regexp","mask","floatPrecision","isUnique","range","fieldCondition","required"
];isc.A.applyWhenTitle="Apply When";isc.A.applyWhenPlaceholder="[always applied]";isc.A.applyWhenPlaceholderHintStyle="staticTextItemDisabled";isc.A.validatorTitle="Validator Type";isc.A.errorMessageTitle="Error Message";isc.A.errorMessageHint="[leave blank to use default error message]";isc.A.defaultEditorTitle="Value";isc.A.width=400;isc.A.padding=5;isc.A.components=["validatorForm","messageForm","applyWhenForm"
];isc.A.applyWhenFormConstructor="DynamicForm";isc.A.applyWhenFormDefaults={numCols:2,fixedColWidths:true,height:20
};isc.A.applyWhenItemDefaults={showLabel:true,editorType:"CheckboxItem",width:20,showTitle:false,align:"right",vAlign:"top",textBoxStyle:"formTitle",changed:"this.form.creator.updateConditionalForm(value)",init:function(){if(this.form){var _1=this.form,_2=_1.getTitleOrientation(),_3=(_2=="right"?_1.rightTitlePrefix:_1.titlePrefix),_4=(_2=="right"?_1.rightTitleSuffix:_1.titleSuffix)
;this.title=_3+this.title+_4}
this.Super("init",arguments)}
};isc.A.filterTopOperatorAppearance="radio";isc.A.conditionalFormConstructor="FilterBuilder";isc.A.conditionalFormDefaults={showFieldTitles:false,fieldPickerProperties:{},showModeSwitcher:true
};isc.A.validatorFormConstructor="DynamicForm";isc.A.validatorFormDefaults={numCols:2,fixedColWidths:true,height:20,itemChanged:function(_1,_2){if(this.creator.validatorsEditor){if(this.valuesAreValid()&&this.creator.valuesForm&&this.creator.valuesForm.valuesAreValid())
{this.creator.validatorsEditor.validatorIsValid(this)}
}
}
};isc.A.typePickerConstructor="SelectItem";isc.A.typePickerDefaults={name:"type",width:"*",hoverWidth:200,pickListProperties:{canHover:true,showHover:true,hoverWidth:200,cellHoverHTML:function(_1){return _1.description?_1.description:null}
},init:function(){this.$179f=isc.DS.create({clientOnly:true,fields:[{name:"type"},{name:"shortName"},{name:"description"}
],cacheData:this.creator.getSupportedTypeRecords()
});this.optionDataSource=this.$179f;this.valueField="type";this.displayField="shortName";this.Super("init",arguments)},destroy:function(){if(this.$179g)this.$179g.destroy();this.Super("destroy",arguments)},showIf:function(){var _1=this.form.creator;return _1.showTypePicker==false?false:true},changed:function(_1,_2,_3){this.creator.updateValidatorType(_3)},itemHoverHTML:function(){var _1=this.getSelectedRecord();if(!_1)return"";return _1.description}
};isc.A.messageFormConstructor="DynamicForm";isc.A.messageFormDefaults={numCols:2,width:"100%",height:20
};isc.A.errorMessageItemDefaults={editorType:"TextItem",width:"*"
};isc.A.valuesFormConstructor="FilterClause";isc.A.valuesFormDefaults={clauseProperties:{cellPadding:0,cellSpacing:0},customGetValuesFunction:"getAttributesFromEditor",customSetValuesFunction:"setEditorAttributes",operatorAttribute:"type",valueItemWidth:250,showFieldTitleAndName:true,fieldPickerProperties:{showIf:"return false"
},getEditorType:function(_1,_2){var _3=this.creator.getValidatorDefinition(_2);if(_3&&_3.valueType=="custom"&&_3.editorType)
{return _3.editorType}
if(_1&&(isc.SimpleType.inheritsFrom(_1.type,"date")||isc.SimpleType.inheritsFrom(_1.type,"datetime")))return"RelativeDateItem";if(_2=="readOnly"){return"ReadOnlyRuleEditor"}
return null},valuesAreValid:function(){return this.clause?this.clause.valuesAreValid():true}
};isc.B.push(isc.A.initWidget=function isc_ValidatorEditor_initWidget(){var _1=this.validator;if(_1!=null){this.setValidator(_1,true)}
this.addAutoChildren(this.components);if(this.applyWhenForm){if(this.applyWhen!=null){this.applyWhenForm.setValue("applyWhen",true)}
this.updateConditionalForm(this.applyWhen!=null)}
if(this.validatorForm){this.typePicker=this.validatorForm.getItem("type");if(this.validatorType!=null)this.typePicker.setValue(this.validatorType);if(this.validatorType!=null){this.updateValidatorType(this.validatorType,true)}
}
if(this.messageForm){if(_1&&_1.errorMessage){this.messageForm.setValue("errorMessage",_1.errorMessage)}
}
if(_1!=null){this.setClauseAttributes(_1)}
return this.Super("initWidget",arguments)}
,isc.A.getDynamicDefaults=function isc_ValidatorEditor_getDynamicDefaults(_1){switch(_1){case"applyWhenForm":var _2=(this.applyWhenTitle?{title:this.applyWhenTitle}:null),_3=isc.addProperties({name:"applyWhen"},this.applyWhenItemDefaults,this.applyWhenItemDefaults,_2),_4={type:"StaticTextItem",name:"applyWhenLabel",showTitle:false,value:this.applyWhenTitle+" :",align:"right",vAlign:"top",textBoxStyle:"formTitle"},_5={type:"StaticTextItem",name:"placeholder",showTitle:false,value:this.applyWhenPlaceholder,textBoxStyle:this.applyWhenPlaceholderHintStyle,showOver:false},_6={type:"CanvasItem",showTitle:false,name:"conditionalItem",visible:false,createCanvas:function(){return this.form.creator.createConditionalForm()
}
};return{items:[_3,_4,_5,_6]
};case"validatorForm":var _2=(this.validatorTitle?{title:this.validatorTitle}:null);var _7=isc.addProperties({creator:this,editorType:this.typePickerConstructor},this.typePickerDefaults,this.typePickerProperties,_2
);var _8={name:"valuesItem",editorType:"CanvasItem",showTitle:true,title:null,visible:false,canvas:this.getValuesForm(this.validatorType)
}
return{disabled:(this.fieldName==null),items:[_7,_8]
};case"messageForm":var _2=(this.errorMessageTitle?{title:this.errorMessageTitle}:null);var _9={showHintInField:true,hint:this.errorMessageHint};var _10=isc.addProperties({name:"errorMessage"},this.errorMessageItemDefaults,this.errorMessageItemDefaults,_2,_9);return{items:[_10]}}
}
,isc.A.getField=function isc_ValidatorEditor_getField(_1){if(this.field)return this.field;return this.dataSource.getField(_1)}
,isc.A.updateFieldName=function isc_ValidatorEditor_updateFieldName(_1){this.fieldName=_1;var _2=_1!=null,_3=_2?this.getSupportedTypeRecords():[],_4;if(this.validatorType!=null&&_3.length>0){_4=(_3.find("type",this.validatorType)!=null)}
if(this.validatorForm){if(!_4){this.validatorForm.setValue("type",null);this.validatorType=null}
if(_3.length==0){this.validatorForm.setDisabled(true)}else{this.typePicker.optionDataSource.setCacheData(_3);this.validatorForm.setDisabled(false)}
}
if(_2&&this.validatorType!=null){var _5=this.$74o,_6=(_5==null||_1!=_5)
;this.$74o=(_1==null?null:_1);if(this.valuesForm.clause.getValue("operator")!=this.validatorType){_6=true}
this.valuesForm.fieldName=_1;this.valuesForm.clause.setValue("fieldName",_1);this.valuesForm.clause.setValue("operator",this.validatorType);if(_6){var _7=this.getValidatorDefinition(this.validatorType);this.valuesForm.updateValueItems(this.valuesForm.getField(_1),_7,_1)}
}
this.updateValuesFormVisibility()}
,isc.A.updateValuesFormVisibility=function isc_ValidatorEditor_updateValuesFormVisibility(){if(this.valuesForm){if(this.validatorType==null){this.validatorForm.getItem("valuesItem").hide();this.valuesForm.hide()}else{var _1=this.validatorForm.getItem("valuesItem").canvas.clause,_2=_1.items,_3=false
;_2.map(function(_4){_3=_3||(_4.name!="fieldName"&&_4.isVisible())});if(_3)this.validatorForm.getItem("valuesItem").show();else this.validatorForm.getItem("valuesItem").hide()}
}
}
,isc.A.createConditionalForm=function isc_ValidatorEditor_createConditionalForm(){var _1=this.filterTopOperatorAppearance||"radio";this.conditionalForm=this.createAutoChild("conditionalForm",{dataSource:this.dataSource,topOperatorAppearance:_1}
);this.conditionalForm.fieldPickerProperties.pickListWidth=this.conditionalForm.getWidth();return this.conditionalForm}
,isc.A.updateConditionalForm=function isc_ValidatorEditor_updateConditionalForm(_1){var _2=this.applyWhenForm.getItem("applyWhen"),_3=this.applyWhenForm.getItem("applyWhenLabel"),_4=this.applyWhenForm.getItem("placeholder"),_5=this.applyWhenForm.getItem("conditionalItem");var _6=this.validatorForm.getValue("type"),_7=this.getValidatorDefinition(_6),_8=(_7&&_7.requiresApplyWhen)
;if(_8){_2.hide();_3.show()}else{_2.show();_3.hide()}
if(!_1&&!_8){_4.show();_5.hide()}else{var _9=this.applyWhen||{};this.conditionalForm.setCriteria(_9);_4.hide();_5.show()}
this.conditionalForm.setTopOperatorAppearance(isc.DataSource.isFlatCriteria(_9)?"radio":"bracket")}
,isc.A.getSupportedTypeRecords=function isc_ValidatorEditor_getSupportedTypeRecords(){var _1=this.fieldName,_2=this.availableTypes,_3=[];if(_2.length==0||_1==null){return[]}
var _4=null,_5={date:true,datetime:true,"float":true,integer:true,time:true};for(var i=0;i<_2.length;i++){var _7=this.getValidatorDefinition(_2[i])||{},_8=true;if(_7.isRule)continue;var _9=this.getField(_1);if(_9==null){this.logWarn("unable to retrieve field for:"+_1)}else{var _10=isc.SimpleType.getBaseType(_9.type||"text");if(_2[i]=="range"){if(!_5[_10]||(_4!=null&&_4!=_10))
{_8=false}else{_4=_10}
}else{if(_7.dataType!=null&&_7.dataType!="none"&&(isc.isAn.Array(_7.dataType)?_7.dataType.contains(_10):_7.dataType!=_10))
{_8=false}
}
}
if(_8){var _11=this.getValidatorDefinition(_2[i]);var _12=_11.reifyName||_11.shortName||isc.Validator.getShortName(_11.type);_3.add({type:_2[i],shortName:_12,description:_11.description})}
}
return _3}
,isc.A.updateValidatorType=function isc_ValidatorEditor_updateValidatorType(_1,_2){if(this.validatorType==_1&&!_2)return;this.validatorType=_1;if(_1!=null){var _3=this.valuesForm,_4=this.getValuesForm(_1);if(_3!=_4){this.valuesForm=_4;this.validatorForm.getItem("valuesItem").setCanvas(this.valuesForm)}
var _5=this.getValidatorDefinition(_1);var _6=_5.editorTitle||this.defaultEditorTitle;this.validatorForm.getItem("valuesItem").title=_6;this.validatorForm.getItem("valuesItem").redraw();this.setApplyWhen(this.getApplyWhen())}
this.updateValuesFormVisibility();this.creator.updateItemTitle(this)}
,isc.A.resolveValidatorType=function isc_ValidatorEditor_resolveValidatorType(_1){if(_1==null)_1=this.validatorType;if(_1==null)return null;if(_1=="range"){var _2=this.fieldName,_3;if(_2!=null){var _4=false,_5=this.getField(_2),_6=_5.type||"integer"
;_3=isc.SimpleType.getBaseType(_6);this.logDebug("'range' validator for field:"
+this.echo(this.fieldName)+". Assuming "+_3+" type data","ValidatorEditor")}else{this.logInfo("Attempting to get 'range' validator with no field type - defaulting to integer","ValidatorEditor");_3="integer"}
if(_3=="date"||_3=="datetime"){_1="dateRange"}else if(_3=="time"){_1="timeRange"}else if(_3=="float"){_1="floatRange"
}else{_1="integerRange"
}
}
return _1}
,isc.A.getValidatorDefinition=function isc_ValidatorEditor_getValidatorDefinition(_1){_1=this.resolveValidatorType(_1);return isc.Validator.$74u[_1]}
,isc.A.getValuesForm=function isc_ValidatorEditor_getValuesForm(_1){if(_1!=null){var _2=this.getValidatorDefinition(_1),_3=_2.valueType;_2.ID=_1}
var _4=this.validatorForm;var _5=this.fieldName;if(this.valuesForm){var _6=_5?this.valuesForm.getField(_5):null;this.valuesForm.updateValueItems(_6,_2,_5);var _7=this.valuesForm.clause;_7.setValue("operator",_1);_7.$224d=this.validatorForm;for(var i=0;i<_7.items.length;i++){var _9=_7.items[i];if(_9.isVisible()&&isc.isA.CanvasItem(_9)&&isc.isA.DynamicForm(_9.canvas)){_9.canvas.$224d=this.validatorForm;_9.canvas.itemChanged=function(_9,_11){if(this.$224d)this.$224d.itemChanged()}
}
}
return this.valuesForm}else{var _10=this.valuesForm=this.createAutoChild("valuesForm",{visibility:(this.fieldName?"inherit":"hidden"),showRemoveButton:false,dataSources:this.dataSources,dataSource:this.dataSource,fieldName:_5,operatorType:_1
});var _7=_10.clause;_7.getItem("operator").hide();_7.getItem("operator").addUnknownValues=true;_7.addProperties({validateTypeOnly:false,$224d:this.validatorForm,itemChanged:function(_9,_11){if(this.$224d)this.$224d.itemChanged()}
});for(var i=0;i<_7.items.length;i++){var _9=_7.items[i];if(_9.isVisible()&&isc.isA.CanvasItem(_9)&&isc.isA.DynamicForm(_9.canvas)){_9.canvas.$224d=this.validatorForm;_9.canvas.itemChanged=function(_9,_11){if(this.$224d)this.$224d.itemChanged()}
}
}
return _10}
}
,isc.A.setValidatorType=function isc_ValidatorEditor_setValidatorType(_1){this.validatorForm.setValue("type",_1);this.updateValidatorType(_1)}
,isc.A.setFieldName=function isc_ValidatorEditor_setFieldName(_1){if(this.fieldPicker){this.fieldPicker.setValue(_1)}
this.updateFieldName(_1)}
,isc.A.setApplyWhen=function isc_ValidatorEditor_setApplyWhen(_1){this.applyWhen=_1;this.applyWhenForm.setValue("applyWhen",(_1!=null));this.updateConditionalForm(_1!=null)}
,isc.A.getApplyWhen=function isc_ValidatorEditor_getApplyWhen(){var _1=this.validatorForm.getValue("type"),_2=this.getValidatorDefinition(_1),_3=(_2&&_2.requiresApplyWhen)
;if(_3||this.applyWhenForm.getValue("applyWhen")){this.applyWhen=this.conditionalForm.getCriteria()}else{this.applyWhen=null}
return this.applyWhen}
,isc.A.getAttributesFromClause=function isc_ValidatorEditor_getAttributesFromClause(){var _1=this.getValidatorDefinition(),_2=this.valuesForm.getClauseValues(null,_1)
;return _2}
,isc.A.setClauseAttributes=function isc_ValidatorEditor_setClauseAttributes(_1){if(this.valuesForm==null)return;var _2=this.getValidatorDefinition();this.valuesForm.setClauseValues(this.fieldName,_2,_1)}
,isc.A.getValidator=function isc_ValidatorEditor_getValidator(){if(this.validatorType==null)return null;var _1={};_1.type=this.resolveValidatorType(this.validatorType);if(this.valuesForm!=null){var _2=this.getAttributesFromClause();for(var _3 in _2){if(_3=="type")continue;_1[_3]=_2[_3]}
}
var _4=this.messageForm.getValue("errorMessage");if(_4)_1.errorMessage=_4;var _5=this.getApplyWhen();if(_5!=null)_1.applyWhen=_5;return _1}
,isc.A.validate=function isc_ValidatorEditor_validate(){var _1=false;if(this.applyWhenForm&&this.applyWhenForm.getValue("applyWhen")){_1=(this.conditionalForm.validate()==false)||_1}
if(this.validatorForm){_1=(this.validatorForm.validate()==false)||_1;if(this.valuesForm)_1=(this.valuesForm.validate()==false)||_1}
if(this.messageForm)_1=(this.messageForm.validate()==false)||_1;return!_1}
,isc.A.setValidator=function isc_ValidatorEditor_setValidator(_1,_2){this.validator=_1;if(_2){this.validatorType=_1.type;this.applyWhen=_1.applyWhen}else{this.setValidatorType(_1.type);this.setApplyWhen(_1.applyWhen);this.messageForm.setValue("errorMessage",_1.errorMessage);this.setClauseAttributes(_1)}
}
,isc.A.clearValidator=function isc_ValidatorEditor_clearValidator(){this.validator=null;this.setValidatorType(null);this.setApplyWhen(null);if(this.messageForm)this.messageForm.clearValue("errorMessage")}
);isc.B._maxIndex=isc.C+22;isc.defineClass("ValidatorsEditor","StackedListEditor");isc.A=isc.ValidatorsEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.addButtonDisabledHoverText="Please complete existing validator definitions before adding more";isc.A.newItemTitle="[New Validator]";isc.A.itemEditorConstructor=isc.ValidatorEditor;isc.A.itemEditorProperties={saveOperationType:"add",getSaveOperationType:function(){return this.saveOperationType},setSaveOperationType:function(_1){this.saveOperationType=_1},clearValidator:function(){this.setSaveOperationType("add");this.Super("clearValidator",arguments)},setValidator:function(_1){this.setSaveOperationType("update");this.Super("setValidator",arguments)}
};isc.B.push(isc.A.initWidget=function isc_ValidatorsEditor_initWidget(){this.items=this.validators;this.lowerAddButtonProperties={disabledHover:this.addButtonDisabledHoverText
};this.Super("initWidget",arguments);if(this.fieldName&&this.fieldName.contains(".")){var _1=this.fieldName.split(".");this.fieldName=_1[_1.length-1]}
}
,isc.A.addItem=function isc_ValidatorsEditor_addItem(){this.Super("addItem",arguments);this.disableWidgetWithHover(this.addButton)}
,isc.A.validatorIsValid=function isc_ValidatorsEditor_validatorIsValid(_1){this.enableWidgetWithHover(this.addButton)}
,isc.A.disableWidgetWithHover=function isc_ValidatorsEditor_disableWidgetWithHover(_1){if(_1.disabledHover){_1.$2232=_1.prompt;_1.setPrompt(_1.disabledHover)}
_1.setDisabled(true)}
,isc.A.enableWidgetWithHover=function isc_ValidatorsEditor_enableWidgetWithHover(_1){_1.setPrompt(_1.$2232);_1.setDisabled(false)}
,isc.A.getItemTitle=function isc_ValidatorsEditor_getItemTitle(_1){return _1.shortName||isc.Validator.getShortName(_1.type)}
,isc.A.getItemEditorProperties=function isc_ValidatorsEditor_getItemEditorProperties(_1){return{fieldName:this.fieldName,dataSource:this.dataSource,validator:_1,validatorsEditor:this
}}
,isc.A.getSectionProperties=function isc_ValidatorsEditor_getSectionProperties(_1){var _2=(_1&&((_1._generated&&_1.$174l)||_1.$2399));return{hidden:_2,validator:_1
}}
,isc.A.getItemEditorValue=function isc_ValidatorsEditor_getItemEditorValue(_1,_2){var _3=_1.getValidator();if(_2.hidden)_3=(this.$242l?null:_2.validator);return _3}
,isc.A.getValidators=function isc_ValidatorsEditor_getValidators(_1){this.$242l=_1;var _2=this.getItems();delete this.$242l;return _2}
,isc.A.setValidators=function isc_ValidatorsEditor_setValidators(_1){this.setItems(_1)}
);isc.B._maxIndex=isc.C+11;if(isc.DynamicForm){isc.defineClass("SubstringCountEditor","CanvasItem");isc.A=isc.SubstringCountEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.countFieldHint="Times";isc.A.operatorFieldTitle="Operator";isc.A.canvasConstructor="DynamicForm";isc.A.canvasDefaults={numCols:3
};isc.A.substringFieldDefaults={name:"substring",showTitle:false,type:"text",colSpan:"*",width:"*",required:true
};isc.A.countFieldDefaults={name:"count",showTitle:false,showHintInField:true,width:50,type:"integer",required:true
};isc.A.operatorFieldDefaults={name:"operator",editorType:"SelectItem",width:50,defaultValue:"==",allowEmptyValue:false,valueMap:["==","!=","<","<=",">",">="]
};isc.B.push(isc.A.createCanvas=function isc_SubstringCountEditor_createCanvas(_1,_2){var _3=isc.addProperties({},this.substringFieldDefaults,this.substringFieldProperties),_4=isc.addProperties({},this.countFieldDefaults,this.countFieldProperties,{hint:this.countFieldHint}),_5=isc.addProperties({},this.operatorFieldDefaults,this.operatorFieldProperties,{title:this.operatorFieldTitle});return this.canvas=this.createAutoChild("canvas",{items:[_3,_5,_4
]
}
)}
);isc.B._maxIndex=isc.C+1;isc.defineClass("FloatRangeEditor","CanvasItem");isc.A=isc.FloatRangeEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.minFieldHint="Min";isc.A.maxFieldHint="Max";isc.A.exclusiveFieldTitle="Exclusive";isc.A.exclusiveFieldPrompt="Range is exclusive (does not include min/max values)";isc.A.canvasConstructor="DynamicForm";isc.A.canvasDefaults={numCols:2
};isc.A.minFieldDefaults={name:"min",showTitle:false,type:"float",showHintInField:true
};isc.A.maxFieldDefaults={name:"max",showTitle:false,type:"float",showHintInField:true
};isc.A.exclusiveFieldDefaults={name:"exclusive",colSpan:"*",type:"boolean",editorType:"CheckboxItem",defaultValue:false
};isc.B.push(isc.A.createCanvas=function isc_FloatRangeEditor_createCanvas(_1,_2){var _3=isc.addProperties({},this.minFieldDefaults,this.minFieldProperties,{hint:this.minFieldHint}),_4=isc.addProperties({},this.maxFieldDefaults,this.maxFieldProperties,{hint:this.maxFieldHint}),_5=isc.addProperties({},this.exclusiveFieldDefaults,this.exclusiveFieldProperties,{title:this.exclusiveFieldTitle,prompt:this.exclusiveFieldPrompt
}
);return this.canvas=this.createAutoChild("canvas",{items:[_3,_4,_5
]
}
)}
);isc.B._maxIndex=isc.C+1;isc.defineClass("FloatPrecisionEditor","CanvasItem");isc.A=isc.FloatPrecisionEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.precisionFieldHint="Precision";isc.A.roundFieldTitle="Round to precision";isc.A.canvasConstructor="DynamicForm";isc.A.canvasDefaults={numCols:1
};isc.A.precisionFieldDefaults={name:"precision",showTitle:false,type:"float",showHintInField:true,required:true
};isc.A.roundFieldDefaults={showTitle:false,name:"roundToPrecision",type:"boolean",editorType:"CheckboxItem",defaultValue:false
};isc.B.push(isc.A.createCanvas=function isc_FloatPrecisionEditor_createCanvas(_1,_2){var _3=isc.addProperties({},this.precisionFieldDefaults,this.precisionFieldProperties,{hint:this.precisionFieldHint}),_4=isc.addProperties({},this.roundFieldDefaults,this.roundFieldProperties,{title:this.roundFieldTitle});return this.canvas=this.createAutoChild("canvas",{items:[_3,_4
]
}
)}
);isc.B._maxIndex=isc.C+1;isc.defineClass("MaskRuleEditor","CanvasItem");isc.A=isc.MaskRuleEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.maskFieldHint="mask";isc.A.transformFieldHint="transformTo";isc.A.canvasConstructor="DynamicForm";isc.A.canvasDefaults={numCols:1
};isc.A.maskFieldDefaults={name:"mask",editorType:"TextItem",showTitle:false,showHintInField:true
};isc.A.transformFieldDefaults={name:"transformTo",editorType:"TextItem",showTitle:false,showHintInField:true
};isc.B.push(isc.A.createCanvas=function isc_MaskRuleEditor_createCanvas(_1,_2){var _3=isc.addProperties({},this.maskFieldDefaults,this.maskFieldProperties,{hint:this.maskFieldHint}),_4=isc.addProperties({},this.transformFieldDefaults,this.transformFieldProperties,{hint:this.transformFieldHint});return this.canvas=this.createAutoChild("canvas",{items:[_3,_4
]
}
)}
);isc.B._maxIndex=isc.C+1;isc.defineClass("IsUniqueEditor","CanvasItem");isc.A=isc.IsUniqueEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.useMultipleFieldsTitle="Use multiple fields";isc.A.isCaseSensitiveTitle="Is case-sensitive";isc.A.canvasConstructor="DynamicForm";isc.A.canvasDefaults={numCols:2
};isc.A.useMultipleFieldsDefaults={showTitle:false,name:"useMultipleFields",type:"boolean",changed:function(_1,_2,_3){_1.getItem("selectFields").setDisabled(!_3)}
};isc.A.isCaseSensitiveDefaults={showTitle:false,name:"isCaseSensitive",type:"boolean"
};isc.A.selectFieldsDefaults={name:"selectFields",editorType:"SelectItem",showTitle:false,textMatchStyle:"startsWith",disabled:true,addUnknownValues:false,multiple:true,valueType:"fieldName",width:250,emptyDisplayValue:"<i>pick fields</i>"
};isc.B.push(isc.A.createCanvas=function isc_IsUniqueEditor_createCanvas(_1,_2){var _3=isc.addProperties({},this.useMultipleFieldsDefaults,this.useMultipleFieldsProperties,{title:this.useMultipleFieldsTitle}),_4=isc.addProperties({},this.isCaseSensitiveDefaults,this.isCaseSensitiveProperties,{title:this.isCaseSensitiveTitle}),_5=isc.addProperties({},this.fieldPickerDefaults,this.selectFieldsDefaults,this.selectFieldsProperties);var _6=_1.parentElement,_7=_6.getFieldNames(),_8={};for(var i=0;i<_7.length;i++){var _10=_6.getField(_7[i]);_8[_7[i]]=_10.title+" (<i>"+_10.name+"</i>)"}
_5.valueMap=_8;this.canvas=this.createAutoChild("canvas",{items:[_3,_5,_4
]
}
);return this.canvas}
);isc.B._maxIndex=isc.C+1}
isc.defineClass("FilePickerForm","VLayout");isc.A=isc.FilePickerForm.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.autoDraw=false;isc.A.width="100%";isc.A.padding=10;isc.A.showSelectForm=true;isc.A.showUploadForm=true;isc.A.showPasteForm=true;isc.A.showFetchForm=true;isc.A.formsDefaults={titleWidth:140,cellPadding:6,width:"100%"
};isc.A.selectFormDefaults={selectFileDialogDefaults:{actionStripControls:["spacer:10","pathLabel","previousFolderButton","spacer:10","upOneLevelButton","spacer:10","refreshButton","spacer:2"],directoryListingProperties:{canEdit:false
},title:"Select File",webrootOnly:true,width:"100%",showModalMask:true,isModal:true,checkFile:function(_1){return true},loadFile:function(_1){if(this.checkFile(_1)){var _2=this.creator;if(this.currentDir.endsWith("/")){_2.setValue("fileName",this.currentDir+_1)}else{_2.setValue("fileName",this.currentDir+"/"+_1)}
if(this.filePickerForm.uploadForm){this.filePickerForm.uploadForm.disable()}
if(this.filePickerForm.pasteForm){this.filePickerForm.pasteForm.disable()}
if(this.filePickerForm.fetchForm){this.filePickerForm.fetchForm.disable()}
this.hide()}
}
},selectFileDialogConstructor:"LoadFileDialog",fields:[{name:"fileName",title:"Select file from local disk",editorType:isc.TLinkItem||isc.LinkItem,target:"javascript",defaultValue:"select file",canEdit:false,width:"*",colSpan:"*",click:function(_1,_2){var _3=isc.addProperties({filePickerForm:_1.creator
},_1.selectFileDialogDefaults,_1.selectFileDialogProperties);_1.createAutoChild("selectFileDialog",_3).show()}
}
]
};isc.A.selectFormConstructor="DynamicForm";isc.A.uploadFormDefaults={saveOperationType:"add",fields:[{name:"file",title:"Upload file",editorType:isc.TUploadItem||isc.UploadItem,hoverWidth:200,width:"*",colSpan:"*",startRow:true,itemHoverHTML:function(){return"Upload file to server and proceed."},titleHoverHTML:function(){return this.itemHoverHTML()
},change:function(_1,_2,_3,_4){if(_1.creator.selectForm){_1.creator.selectForm.setDisabled(_3!=null)}
if(_1.creator.pasteForm){_1.creator.pasteForm.setDisabled(_3!=null)}
if(_1.creator.fetchForm){_1.creator.fetchForm.setDisabled(_3!=null)}
return true}
}
]
};isc.A.uploadFormConstructor="DynamicForm";isc.A.pasteFormDefaults={fields:[{name:"pasteData",type:"TextAreaItem",title:"Paste Data",width:"*",change:function(_1,_2,_3,_4){var _5=_1.creator;if(_5.selectForm){_5.selectForm.setDisabled(_3!=null)}
if(_5.uploadForm){_5.uploadForm.setDisabled(_3!=null)}
if(_5.fetchForm){_5.fetchForm.setDisabled(_3!=null)}
return true}
}
]
};isc.A.pasteFormConstructor="DynamicForm";isc.A.fetchFormDefaults={fields:[{name:"fileURL",type:"text",width:"*",title:"Fetch file from URL",startRow:true,change:function(_1,_2,_3,_4){var _5=_1.creator;if(_5.selectForm){_5.selectForm.setDisabled(_3!=null)}
if(_5.uploadForm){_5.uploadForm.setDisabled(_3!=null)}
if(_5.pasteForm){_5.pasteForm.setDisabled(_3!=null)}
return true}
}
]
};isc.A.fetchFormConstructor="DynamicForm";isc.A.orLabelDefaults={contents:"OR",height:20,align:"right"
};isc.A.orLabelConstructor="Label";isc.A.showOrLabel=true;isc.A.pickButtonDefaults={name:"pickButton",title:"Pick",layoutAlign:"right",click:function(_1,_2){_1.creator.saveData()}
};isc.A.pickButtonConstructor="Button";isc.A.useBuiltinRPC=false;isc.B.push(isc.A.initWidget=function isc_FilePickerForm_initWidget(){this.Super("initWidget",arguments);var _1=false;if(this.valuesManager==null)this.valuesManager=isc.ValuesManager.create();var _2=isc.addProperties(this.formsDefaults,this.formsProperties);if(this.showSelectForm){this.addAutoChild("selectForm",isc.addProperties({valuesManager:this.valuesManager},_2)
);_1=true}
if(this.showUploadForm){if(_1&&this.showOrLabel){this.addMember(this.createAutoChild("orLabel",{width:_2.titleWidth
}))}
this.addAutoChild("uploadForm",isc.addProperties({},_2)
);_1=true}
if(this.showPasteForm){if(_1&&this.showOrLabel){this.addMember(this.createAutoChild("orLabel",{width:_2.titleWidth
}))}
this.addAutoChild("pasteForm",isc.addProperties({valuesManager:this.valuesManager
},_2)
);_1=true}
if(this.showFetchForm){if(_1&&this.showOrLabel){this.addMember(this.createAutoChild("orLabel",{width:_2.titleWidth
}))}
this.addAutoChild("fetchForm",isc.addProperties({valuesManager:this.valuesManager
},_2)
)}
this.addAutoChild("pickButton")}
,isc.A.setDataSource=function isc_FilePickerForm_setDataSource(_1){if(this.selectForm)this.selectForm.dataSource=_1;if(this.uploadForm)this.uploadForm.dataSource=_1;if(this.pasteForm)this.pasteForm.dataSource=_1;if(this.fetchForm)this.fetchForm.dataSource=_1}
,isc.A.setValues=function isc_FilePickerForm_setValues(_1){this.valuesManager.setValues(_1)}
,isc.A.setOutOfBandValues=function isc_FilePickerForm_setOutOfBandValues(_1){if(this.selectForm)this.selectForm.setValues(_1);if(this.uploadForm)this.uploadForm.setValues(_1);if(this.pasteForm)this.pasteForm.setValues(_1);if(this.fetchForm)this.fetchForm.setValues(_1)}
,isc.A.getValues=function isc_FilePickerForm_getValues(){var _1=isc.addProperties(this.valuesManager.getValues(),this.uploadForm.getValues());return _1}
,isc.A.saveData=function isc_FilePickerForm_saveData(_1,_2){var _3=this;var _4=function(_5,_6,_7){if(_3.selectForm){_3.selectForm.reset();_3.selectForm.enable()}
if(_3.uploadForm){_3.uploadForm.clearValues();_3.uploadForm.enable()}
if(_3.pasteForm){_3.pasteForm.enable()}
if(_3.fetchForm){_3.fetchForm.enable()}
if(_1)_3.fireCallback(_1,"dsResponse,data,dsRequest",[_5,_6,_7])}
if(this.selectForm&&this.selectForm.getValue("fileName")&&this.selectForm.getField("fileName").defaultValue!=this.selectForm.getValue("fileName"))
{if(this.useBuiltinRPC){isc.DMI.callBuiltin({appID:"isc_builtin",className:"com.isomorphic.tools.BuiltinRPC",methodName:"importData",arguments:[this.selectForm.getValues()],callback:function(_5){_4(_5,_5.data)}
})}else{this.selectForm.saveData(_4,_2)}
}
if(this.uploadForm&&this.uploadForm.getValue("file")){this.uploadForm.saveData(_4,_2)}
if(this.pasteForm&&this.pasteForm.getValue("pasteData")){this.pasteForm.saveData(_4,_2)}
if(this.fetchForm&&this.fetchForm.getValue("fileURL")){if(this.useBuiltinRPC){isc.DMI.callBuiltin({appID:"isc_builtin",className:"com.isomorphic.tools.BuiltinRPC",methodName:"importData",arguments:[this.fetchForm.getValues()],callback:function(_5){_4(_5,_5.data)}
})}else{this.fetchForm.saveData(_4,_2)}
}
}
);isc.B._maxIndex=isc.C+6;isc.defineClass("RuleScopeFilterResultTree","ResultTree");isc.A=isc.RuleScopeFilterResultTree.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.keepParentsOnFilter=true;isc.B.push(isc.A.$866=function isc_RuleScopeFilterResultTree__filterChildren(_1,_2,_3,_4,_5){var _6=(_2==isc.Tree.STRICT),_7=!_6;var _8;if(this.isANodeLocator(_4)){_8=_4;_4=_4.node}
var _9=_4[this.childrenProperty];if(_9==null||_9.isEmpty())return false;var _10=false;if(isc.isA.String(_3))_3=isc.DS.get(_3);var _11=isc.isA.ResultSet(_9);_6=_6||_11;var i=(_11?_9.$121l():_9.getLength());while(i--){var _13=_9.getCachedRow(i);if(_13!=null){var _14=false,_15=_13[this.childrenProperty],_16;if(this.isMultiLinkTree()&&_8){var _17=this.$201v(_8.path,_13,this.allowDuplicateChildren?i:null);_16=this.createNodeLocator(_13,_4,this.allowDuplicateChildren?i:null,_17)}
var _18=_13;if(this.isMultiLinkTree()&&this.allowFilterOnLinkFields){var _19=this.getLinkRecord(_4[this.idField],_13[this.idField],i);_18=isc.addProperties({},_19,_13);_5.allowFilterOnLinkFields=true;_5.linkDataSource=this.linkDataSource}
var _20=[_18],_21=null,_22=null
;_22=isc.DS.getCriteriaFields(_1,_3);if(_22.length>1&&_3){for(var j=0;j<_22.length;j++){var _24=_22[j],_25=_3.getField(_24)
;if(_25&&!_25.hidden){_21=_24;break}
}
}
if(_18.isFolder){var _26=_18.keywords;if(_26){_20=_26.map(function(_36){var _27=isc.addProperties({},_18);_27[_21]=_36;return _27})}
}
var _28=_3.applyFilter(_20,_1,_5);if(_28!=null&&_28.length>0){_10=true;var _29=_18[_21];if(_29!=null){var _30=null;if(_3?_3.isAdvancedCriteria(_1):this.isAdvancedCriteria(_1)){var _31=isc.DS.flattenCriteria(_1),_32=_31.criteria
;for(var j=0;j<_32.length;j++){var _33=_32[j];if(_33.fieldName==_21){_30=_33.value;break}
}
}else{_30=_1[_21]}
var _34,_35;if(_29.match(/<.*>/)){_35=new RegExp("(^|>)([^<]*?)("+_30+")","ig");_34=_29.replace(_35,"$1$2<span class='treeCellOver' style='padding: 0px;'>$3</span>")}else{_35=new RegExp("("+_30+")","ig");_34=_29.replace(_35,"<span class='treeCellOver' style='padding: 0px;'>$1</span>")}
_18[_21]=_34;if(_18.isFolder){if(_7){if(_15!=null&&!_15.isEmpty()){_5.dontRemoveNonmatches=true;_14=this.$866(_1,_2,_3,_16||_13,_5);delete _5.dontRemoveNonmatches}
if(!_14){_18.$238n=false}
}
}
}
}else{if(_7){if(_15!=null&&!_15.isEmpty()){_14=this.$866(_1,_2,_3,_16||_13,_5)}
_10=_10||_14}
if((!_14||_6)&&(!_5||!_5.dontRemoveNonmatches)){this.$786(_16||_13,false,_4)}
}
}
}
return _10}
);isc.B._maxIndex=isc.C+1;isc.defineClass("DynamicValuePicker","Window");isc.A=isc.DynamicValuePicker.getPrototype();isc.A.autoSize=true;isc.A.width=600;isc.A.autoCenter=true;isc.A.isModal=true;isc.A.bodyProperties={layoutMargin:5,membersMargin:5};isc.A.clearValueText="&lt;Use static value instead&gt;";isc.A=isc.DynamicValuePicker.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.ruleScopeGridConstructor=isc.TreeGrid;isc.A.ruleScopeGridDefaults={height:400,width:"100%",autoFetchData:true,dataFetchMode:"local",selectionType:"single",showFolderIcons:false,showNodeIcons:false,showFilterEditor:true,filterOnKeypress:true,hoverAutoFitWidth:true,hoverAutoFitMaxWidth:400,initWidget:function(){var _1={icons:[{src:"[SKINIMG]TreeGrid/opener_closed.png",prompt:"Expand all",inline:true,inlineIconAlign:"right",click:function(_2){_2.grid.sourceWidget.data.openAll()}
},{src:"[SKINIMG]TreeGrid/opener_opened.png",prompt:"Collapse all",inline:true,inlineIconAlign:"right",click:function(_2,_3){_2.grid.sourceWidget.data.closeAll()}
}
]
};this.fields=[{name:"name",type:"text",title:"Path",hidden:(this.pathField!="name"),canFilter:true,filterEditorProperties:_1},{name:"title",type:"text",title:"Path",hidden:(this.pathField!="title"),canFilter:true,filterEditorProperties:_1},{name:"value",type:"text",title:"Current value",hidden:true}
];this.Super("initWidget",arguments)},formatCellValue:function(_1,_2,_3,_4){if(_1==null&&_4==0)return this.clearValueText;return(_2.enabled==false||this.creator.multiDSFieldFormat=="qualified"?_1:"&nbsp;&nbsp;"+_1)},getCellStyle:function(_1,_2,_3){if(_1.parentId==null&&!_1.clearValue){return"ruleScopeSelectionTitleCell"}
return this.Super("getCellStyle",arguments)},cellHoverHTML:function(_1,_2,_3){return(_3<2?_1.description:null)},recordDoubleClick:function(){this.creator.handleOkButtonClick()},dataArrived:function(){if(!this.$238f){this.$238f=true;var _1=this.data,_2=_1.getFolders(_1.getRoot())
;for(var i=0;i<_2.length;i++){var _4=_2[i];if(_4.expandInitially){_1.openFolder(_4)}
}
}
}
};isc.B.push(isc.A.initWidget=function isc_DynamicValuePicker_initWidget(){this.Super("initWidget",arguments);this.multiDSFieldFormat="separated";var _1=isc.Canvas.getRuleScopeSelectionDataSource(this.targetRuleScope,this.ruleScopeDataSources,this.targetComponent,{fieldFormat:this.multiDSFieldFormat,excludedRuleScope:this.excludedRuleScope,sourceDetailStyleName:"ruleScopeSelectionTitleCellSource"
}
)
;_1.testData.addAt({name:null,isFolder:false,clearValue:true},0);var _2=this,_3=this.createAutoChild("ruleScopeGrid",{dataSource:_1,pathField:"title",clearValueText:this.clearValueText,initialCriteria:this.getCriteria()
}),_4=isc.IButton.create({title:"OK",click:function(){_2.handleOkButtonClick()}
}),_5=isc.IButton.create({title:"Cancel",click:function(){_2.handleCloseClick()}
})
;this.addItems([_3,isc.HLayout.create({height:1,layoutAlign:"right",membersMargin:5,members:[_5,_4]})]);this.observe(_3,"dataArrived","observer.$171r()");this.ruleScopeGrid=_3;this.ruleScopeDS=_1}
,isc.A.setSelectedValue=function isc_DynamicValuePicker_setSelectedValue(_1){this.selectedValue=_1;this.ruleScopeGrid.setCriteria(this.getCriteria())}
,isc.A.handleOkButtonClick=function isc_DynamicValuePicker_handleOkButtonClick(){var _1=this.ruleScopeGrid.getSelectedRecord();if(_1&&this.okButtonClick){this.close();this.okButtonClick(_1.criteriaPath||_1.name)}else{this.closeClick()}
delete this.$238g}
,isc.A.handleCloseClick=function isc_DynamicValuePicker_handleCloseClick(){this.Super("handleCloseClick",arguments);delete this.$238g}
,isc.A.destroy=function isc_DynamicValuePicker_destroy(){if(this.isObserving(this.ruleScopeGrid,"dataArrived")){this.ignore(this.ruleScopeGrid,"dataArrived")}
if(this.ruleScopeDS){this.ruleScopeDS.destroy()}
this.Super("destroy",arguments)}
,isc.A.$171r=function isc_DynamicValuePicker__selectDynamicValuePath(){var _1=this.ruleScopeGrid,_2=this.ruleScopeGrid.data,_3=this.selectedValue
;if(_2){if(!this.selectedValue||this.$238g){var _4=_2.getChildren(_2.getRoot());for(var i=0;i<_4.length;i++){var _6=_4[i];if(_6.clearValue){_2.remove(_6);break}
}
if(!this.$279n){isc.Timer.setTimeout(function(){var _4=_2.getChildren(_2.getRoot());for(var i=0;i<_4.length;i++){if(_4[i].$238n==false){_2.closeFolder(_4[i])}else{_2.openFolder(_4[i])}
}
});this.$279n=true}
return}
var _7=_1.data.find("name",_3);if(!_7)_7=_1.data.find("criteriaPath",_3);if(_7){_1.selectSingleRecord(_7);this.$238g=true;var _8=_1.getRecordIndex(_7),_9=_1.getVisibleRows()
;if(_8<_9[0]||_9[1]<_8){_1.delayCall("scrollToRow",[_8])}
}
this.selectedValuePath=null}
}
);isc.B._maxIndex=isc.C+6;isc.defineClass("Reify","VLayout");isc.A=isc.Reify;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$2262={format:"xmlMockDS",includeFKs:true,numRows:20,numLevels:3,validatorMode:"standard"
};isc.A.exportDataWindowTitle="Exported DataSources/Records";isc.A.exportDataIncompleteMessage="Some DataSources or DS Records couldn't be retrieved";isc.A.tooMuchDataWarning="${export} is too large for upload to Reify.com.  Continue anyway?<P>Note: use criteria to limit the exported rows.";isc.A.maxUploadFileSize=300*1024;isc.A.dsScalingFactor=8;isc.A.$2268=isc.DataSource.create({ID:"isc_MockDSSchema",tagName:"MockDataSource",$145w:true,fields:[{name:"ID",xmlAttribute:true
},{name:"fields",multiple:true,childTagName:"field",fields:[{name:"name",type:"string",xmlAttribute:true
},{name:"title",type:"string",xmlAttribute:true
},{name:"type",type:"string",xmlAttribute:true
},{name:"primaryKey",type:"boolean",xmlAttribute:true
},{name:"foreignKey",type:"string",xmlAttribute:true
},{name:"rootValue",xmlAttribute:true
},{name:"required",type:"boolean",xmlAttribute:true
},{name:"length",type:"integer",xmlAttribute:true
},{name:"detail",type:"boolean",xmlAttribute:true
},{name:"hidden",type:"boolean",xmlAttribute:true
},{name:"joinType",type:"string",xmlAttribute:true
},{name:"displayField",type:"string",xmlAttribute:true
},{name:"foreignDisplayField",type:"string",xmlAttribute:true
},{name:"includeFrom",type:"string",xmlAttribute:true
},{name:"valueMap",multiple:true
},{name:"validators",multiple:true,childTagName:"validator",fields:[{name:"condition",type:"function"}]
}]
},{name:"cacheData",multiple:true,childTagName:"Object",fields:[{name:"$2269"}]
}]
});isc.B.push(isc.A.create=function isc_c_Reify_create(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13){this.logWarn("In the SmartClient SDK, the Reify class is only present to provide several useful APIs, such as getMockDS() to export a DataSource in a format Reify can import.  You can't instantiate the Reify class.")}
,isc.A.loadAndSortDataSources=function isc_c_Reify_loadAndSortDataSources(_1,_2,_3,_4){_3=isc.addProperties({},this.$2262,_3);var _5={},_6=this.$2263(_1,_5);if(_6.length){if(_4){this.logInfo("loading DataSources "+_6+" from DMI channel");var _7=0;for(var i=0;i<_6.length;i++){_4.useDataSourceObject(_6[i],function(){if(++_7<_6.length)return;isc.Reify.$2264(_1,_5,_2,_3)})}
return}else if(isc.hasOptionalModules("SCServer")){this.logInfo("loading DataSources "+_6+" from server");return isc.DS.load(_1,function(_1){isc.Reify.$2264(_1,_5,_2,_3)})}
this.logWarn("DataSources "+_6+" aren't loaded and can't be loaded because SmartClient Server is not present; skipping")}
this.$228m(_1,_5,_2,_3)}
,isc.A.$2263=function isc_c_Reify__buildDSMap(_1,_2){var _3=[];for(var i=0;i<_1.length;i++){var _5=_1[i],_6=isc.DS.get(_5);if(_6)_2[_5]=_6;else _3.add(_5)}
return _3}
,isc.A.$2264=function isc_c_Reify__handleDSLoadReply(_1,_2,_3,_4){var _5=this.$2263(_1,_2);if(_5.length){this.logWarn("DataSources "+_5+" could not be loaded; skipping")}
this.$228m(_1,_2,_3,_4)}
,isc.A.$228m=function isc_c_Reify__mockDSLoaded(_1,_2,_3,_4){var _5=_4.buildDependencies==false?_1:this.$2275(_1,_2,_4);var _6=isc.getKeys(_2).length<_1.length;this.fireCallback(_3,"sortedNames,dsMap,settings,incomplete",[_5,_2,_4,_6])}
,isc.A.$2294=function isc_c_Reify__getNextDSIndicesInSort(_1,_2,_3){var _4=[];loopOverDSNames:for(var i=0;i<_1.length;i++){var _6=_1[i],_7=_2[_6];if(_7){var _8=_7.$2273,_9=_8&&_8.dependsOnRelations;if(_9){for(var _10 in _9){if(!_3[_10]){continue loopOverDSNames}
}
}
}
_4.add(i)}
return _4}
,isc.A.$2275=function isc_c_Reify__getRelationSortedDSNames(_1,_2,_3){this.$2272(_2);var _4=_3.includeFKs;if(!_4)return _1;_1=_1.duplicate();for(var _5 in _2){this.$2274(_2[_5],_2,_3)}
var _6=[],_7={}
;while(_1.length){var _8=this.$2294(_1,_2,_7);while(_8.length){var _5=_1[_8.pop()];_7[_5]=true;_1.remove(_5);if(_2[_5])_6.add(_5)}
}
return _6}
,isc.A.$2272=function isc_c_Reify__cleanAllRelationDependencies(_1){for(var _2 in _1)delete _1[_2].$2273}
,isc.A.$2274=function isc_c_Reify__buildRelationDependencies(_1,_2,_3){var _4=_3.includeFKs;if(!_4)return[];var _5={},_6=_1.getID(),_7=_1.getFields(),_8,_9,_10=_3.omitRelations;for(var _11 in _7){var _12=_7[_11],_13=_12.foreignKey;if(_13&&(!_10||!_10.contains(_13))){var _14=_13.match(/([A-Za-z_]+)(?:\.([A-Za-z_]+))?/);if(!_14)continue;var _15=_14[2]||_14[1],_16=_2[_14[1]||_6];if(!_16)continue;if(_16==_1){_8=_15;_9=_11;continue}
if(!_5[_16.ID])_5[_16.ID]={};_5[_16.ID][_11]=_15;var _17=_16.$2273;if(!_17)_17=_16.$2273={};var _18=_17.dependentRelations;if(!_18){_18=_17.dependentRelations=[]}
if(!_18.contains(_6))_18.add(_6)}
}
var _19=!isc.isAn.emptyObject(_5);if(_8||_9||_19){var _20=_1.$2273;if(!_20)_20=_1.$2273={};if(_19){_20.dependsOnRelations=_5;_20.nCompleteRelations=0}
if(_8)_20.treeIdField=_8;if(_9)_20.treeParentIdField=_9}
}
,isc.A.getMockDS=function isc_c_Reify_getMockDS(_1,_2,_3,_4){if(isc.isA.String(_1))_1=[_1];var _5=this.$2271(_1,_2,_3);if(_5)return this.logWarn("getMockDS(): "+_5);this.loadAndSortDataSources(_1,function(_6,_7,_3){isc.Reify.$2265(_1,_6,_7,_2,_3)},_3,_4)}
,isc.A.$2271=function isc_c_Reify__validateGetMockDSArgs(_1,_2,_3){if(!_2)return"a callback must be provided";if(!isc.isAn.Array(_1)){return"a DataSource ID or array of IDs must be provided"}
var _4={};for(var i=0;i<_1.length;i++){var _6=_1[i];if(!_6)return"a non-empty ID must be provided for each DataSource";if(_4[_6])return"duplicate DS ID '"+_6+"' present";_4[_6]=_6}
var _7=_3&&_3.requestProperties;if(isc.isAn.Array(_7)&&_7.length!=_1.length){return"if you supply an array of request properties, the length must equal the number of DS IDs provided"}
}
,isc.A.showMockDS=function isc_c_Reify_showMockDS(_1,_2,_3,_4){var _5=this;this.getMockDS(_1,function(_8,_9,_10){if(isc.ContentViewerWindow){var _6=isc.ContentViewerWindow.create({title:_5.exportDataWindowTitle,onHide:function(){this.fireCallback(_2,"concatExport,arrayExport",[_8,_9])}
});_6.showContent(_8)}else{_5.logWarn("Logging the MockDS XML since form support not loaded:\n"+_8)}
if(_10){var _7=_3&&_3.incompleteMessage||_5.exportDataIncompleteMessage;isc.Notify.addMessage(_7,null,null,{messagePriority:isc.Notify.WARN
})}
},_3,_4)}
,isc.A.$2265=function isc_c_Reify__getMockDSData(_1,_2,_3,_4,_5){if(isc.isAn.emptyObject(_3)){this.fireCallback(_4,"concatExport,arrayExport,incomplete",[null,[],true]);return}
if(isc.Log.logIsDebugEnabled()){this.logDebug("Fetching record data for DataSources: "+_1)}
if(isc.isAn.Array(_5.requestProperties)){for(var i=0;i<_1.length;i++){var _7=_3[_1[i]];_7.$2276=i}
}
var _8={allDSData:{},fetchCount:isc.getKeys(_3).length
};var _9=isc.RPCManager.startQueue();for(var i=0;i<_2.length;i++){var _10=_2[i];var _7=_3[_10];if(!_7)continue;var _11=_7.$2273;if(_11&&_11.dependsOnRelations)break;var _12=_7.$2276!=null?_7.$2276:i;this.$228b(_7,_1,_3,_8,_5,_4,_12)}
if(!_9)isc.RPCManager.sendQueue()}
,isc.A.$228b=function isc_c_Reify__fetchMockDSData(_1,_2,_3,_4,_5,_6,_7){var _8=_5.requestProperties;if(isc.isAn.Array(_8)){if(_7==null)_7=_1.$2276;_8=_8[_7]}
var _9=_4.allDSData;var _10=this.$2277(_1,_9,_8,_5);_1.fetchData(_5.criteria,function(_21,_22,_23){var _11=_23.dataSource,_12=_3[_11],_13=_9[_11],_14=_1.$2273||{},_15=_4.fetchCount,_16=!!_14.treeIdField
;if(_21.status){isc.Reify.logWarn("unable to fetch records for "+_11)}else if(_22){_9[_11]=_22;if(_16){if(_13){_22.$2279=_13}
_22.$35k=true;if(isc.Reify.$2278(_22)<_14.numLevels){isc.Reify.$228b(_1,_2,_3,_4,_5,_6,_7);return}
}
}
var _17=_14.dependentRelations||[];for(var i=0;i<_17.length;i++){var _19=_3[_17[i]],_14=_19.$2273,_20=_14.dependsOnRelations;if(++_14.nCompleteRelations==isc.getKeys(_20).length){isc.Reify.$228b(_19,_2,_3,_4,_5,_6)}
}
if(!--_4.fetchCount){isc.Reify.$2266(_2,_3,_9,_6,_5)}
},_10)}
,isc.A.$2277=function isc_c_Reify__getMockDSDataRequestProps(_1,_2,_3,_4){var _5=_1.$2273||{},_6=!!_5.treeIdField,_7=_5.dependsOnRelations,_8={willHandleError:true}
;isc.addProperties(_8,_3);if(_6){_5.numLevels=_8.numLevels||_4.numLevels;delete _8.endRow}else if(!_7){if(_8.endRow==null)_8.endRow=_4.numRows}
var _9=_3&&_3.data||_4.criteria;if(_6){var _10=_1.getField(_5.treeParentIdField),_11=_10.rootValue,_12=_2[_1.ID],_13={};_13[_10.name]=_12?_12.getProperty(_5.treeIdField):(_11==null?null:_11);var _14=_4.rootCriteriaOnly;if(_3&&_3.rootCriteriaOnly!=null){_14=_3.rootCriteriaOnly}
if(_14&&_12)_9=null;_9=_9?isc.DS.combineCriteria(_9,_13):_13}
if(_7){var _15={};var _16=_4.ignoreRelationCriteria;if(_3&&_3.ignoreRelationCriteria!=null){_16=_3.ignoreRelationCriteria}
if(!_16)for(var _17 in _7){_12=_2[_17];if(_12&&_12.$35k){_12=_2[_17]=this.$228a(_12)}
if(!_12||!_12.length){_8.endRow=0;break}
var _18=_7[_17];for(var _19 in _18){var _20=_18[_19];_15[_19]=_12.getProperty(_20)}
}
_9=_9?isc.DS.combineCriteria(_9,_15):_15}
if(_9!=_4.criteria)_8.data=_9;return _8}
,isc.A.$2278=function isc_c_Reify__getTreeDataDepth(_1){var _2;for(_2=0;_1;_2++){_1=_1.$2279}
return _2}
,isc.A.$228a=function isc_c_Reify__getLinkedTreeData(_1){var _2;for(_2=[];_1;_1=_1.$2279){_2.add(_1)}
_2.reverse();var _3=[];for(var i=0;i<_2.length;i++){_3.addList(_2[i])}
return _3}
,isc.A.$2266=function isc_c_Reify__handleMockDSData(_1,_2,_3,_4,_5,_6,_7,_8){if(!_7)_7=[];if(!_6)_6="";if(!_8)_8=0;for(var i=_8;i<_1.length;i++){var _10=_1[i],_11=_2[_10];if(!_11){_7.add(null);continue}
var _12=null,_13=_3[_10],_14=isc.emptyString
;if(_13&&_13.$35k){_13=_3[_10]=this.$228a(_13)}
switch(_5.format){case"jsMockDS":case"xmlMockDS":_12=this.serializeMockDS(_11,_13,_5);break;case"reifyCSV":default:_12=this.getMockDSCSV(_11,_13,_5);_14="=== "+_10+"\n"}
var _15=_6;if(_12){_12=_12.trim();if(_6)_15+="\n\n";_15+=_14+_12}
if(_5.warnOnTooMuchData&&this.$229a(_10,_8,_12,_15,function(_17){if(_17){_7.add(_12),_6=_15}
isc.Reify.$2266(_1,_2,_3,_4,_5,_6,_7,_17?i+1:_1.length)}))
{return}
_7.add(_12),_6=_15}
var _16=isc.getKeys(_2).length<_1.length||isc.getKeys(_3).length<_1.length;this.fireCallback(_4,"concatExport,arrayExport,incomplete",[_6,_7,_16])}
,isc.A.$229a=function isc_c_Reify__confirmDataOverflow(_1,_2,_3,_4,_5){var _6;if(!_2&&_4.length>
this.maxUploadFileSize*this.dsScalingFactor)
{_6="This multi-DS export"}
if(_3&&_3.length>this.maxUploadFileSize){_6="Export of '"+_1+"' DataSource"}
if(_6){isc.confirm(this.tooMuchDataWarning.evalDynamicString(this,{export:_6}),_5);return true}
}
,isc.A.$2267=function isc_c_Reify__getExportFieldNames(_1,_2){var _3=[],_4=_1.getFields();for(var _5 in _4){var _6=_4[_5];switch(_6.type){case"image":if(!_2.includeImageFields)continue;case"binary":case"imageFile":continue}
_3.add(_5)}
return _3}
,isc.A.getMockDSCSV=function isc_c_Reify_getMockDSCSV(_1,_2,_3){var _4=_1.getFields(),_5=_3.includeFKs,_6=_3.omitRelations,_7=this.$2267(_1,_3)
;var _8="";for(var i=0;i<_7.length;i++){if(_8)_8+=",";var _10=_4[_7[i]];_8+="\""+_10.name+"|"+_10.title;if(_10.primaryKey)_8+="|PK";if(_5){var _11=_10.foreignKey;if(_11&&(!_6||!_6.contains(_11))){_8+="|FK="+_11}
}
_8+="\""}
_8+="\n";if(_2&&_2.length){var _12=_1.recordsAsText(_2,{fieldList:_7});_8+=_12.replace(/\\\"/g,"\"\"")+"\n"}
return _8}
,isc.A.$230b=function isc_c_Reify__getMockDSFieldAttributes(_1){switch(_1.format){case"reifyCSV":return["name","title","primaryKey"];default:case"xmlMockDS":case"jsMockDS":var _2=this.$2268,_3=_2.getField("fields");return _3.fields.getProperty("name")}
}
,isc.A.serializeMockDS=function isc_c_Reify_serializeMockDS(_1,_2,_3){var _4=[],_5=_1.getFields(),_6=this.$2267(_1,_3),_7={ID:_1.getID(),fields:_4}
;for(var i=0;i<_6.length;i++){var _9=_5[_6[i]];_4.add(this.$230c(_9,_3))}
if(_2){var _10=_7.cacheData=[];for(var i=0;i<_2.length;i++){var _11={};for(var j=0;j<_6.length;j++){var _13=_6[j];if(_13 in _2[i]){_11[_13]=_2[i][_13]}
}
_10.add(_11)}
}
switch(_3.format){case"xmlMockDS":return this.$2268.xmlSerialize(_7);case"jsMockDS":return"isc.MockDataSource.create("+isc.Comm.serialize(_7)+")"}
}
,isc.A.$230d=function isc_c_Reify__shouldKeepRelation(_1,_2,_3){if(!_2||!_1)return false;return!_3||!_3.contains(_1)}
,isc.A.$230c=function isc_c_Reify__filterDSFieldForExport(_1,_2){var _3={};var _4=this.$230b(_2);for(var j=0;j<_4.length;j++){var _6=_4[j];if(_6 in _1)_3[_6]=_1[_6]}
var _7=_2.format,_8=_2.includeFKs,_9=_2.includeFrom,_10=_2.omitRelations
;if(this.$230d(_1.foreignKey,_8,_10)){if(_7=="reifyCSV")_3.foreignKey=_1.foreignKey}else{delete _3.foreignKey;delete _3.foreignDisplayField;delete _3.rootValue;delete _3.joinType;if("foreignKey"in _1)delete _3.displayField}
if("type"in _3&&!isc.SimpleType.getType(_3.type)){delete _3.type}
var _11=_2.validatorMode;if(_11=="none"){delete _3.validators}else if(_3.validators){_3.validators=_3.validators.filter(function(_12){if(_12.serverOnly||_12.type=="serverCustom"){return false}
if(_12._generated||_12.type=="required"){return false}
if(_11!="all"&&_12.type=="custom"){return false}
return true});if(!_3.validators.length)delete _3.validators}
if(!this.$230d(_1.includeFrom,_9,_10)){delete _3.includeFrom}
return _3}
,isc.A.getEventDefinition=function isc_c_Reify_getEventDefinition(_1,_2){var _3="method:"+_1+"."+_2,_4=isc.jsdoc.getDocItem(_3)
;if(_4){var _5=isc.jsdoc.getAttribute(_4,isc.jsdoc.$46y);if(_5=="method"){if(!isc.jsdoc.getAttribute(_4,"deprecated")){return _4}
return null}
}
var _5=isc.DS.get(_1);if(!_5||!_5.inheritsFrom)return null;var _6=isc.DS.get(_5.inheritsFrom);if(!_6)return null;return this.getEventDefinition(_6.ID,_2)}
);isc.B._maxIndex=isc.C+26;if(isc.DynamicForm){isc.defineClass("ContentViewerWindow","ModalWindow");isc.A=isc.ContentViewerWindow.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.autoParent="none";isc.A.doneViewingText="Done";isc.A.contentWrap=isc.TextAreaItem.VIRTUAL;isc.A.canDragResize=true;isc.A.contentFormDefaults={_constructor:"DynamicForm",numCols:1,width:"100%",height:"100%",minWidth:100,minHeight:100,items:[{name:"data",editorType:"TextAreaItem",width:"100%",height:"100%",showTitle:false,canEdit:false,init:function(){this.Super("init",arguments);this.wrap=this.form.creator.contentWrap}
},{name:"button",editorType:"ButtonItem",width:100,align:"right",getTitle:function(){return this.form.creator.doneViewingText},click:function(){this.form.creator.hide()}
}],showContent:function(_1){this.setValue("data",_1);this.getItem("data").scrollToTop()}
};isc.B.push(isc.A.$217o=function isc_ContentViewerWindow__resizingOnDragStart(_1){this.maxWidth=this.maxHeight=10000;this.invokeSuper(isc.ContentViewerWindow,"$217o",_1)}
,isc.A.showContent=function isc_ContentViewerWindow_showContent(_1){if(!this.contentForm){this.contentForm=this.createAutoChild("contentForm");this.addItem(this.contentForm)}
this.contentForm.showContent(_1);if(_1)this.show();else this.hide()}
,isc.A.hide=function isc_ContentViewerWindow_hide(){this.invokeSuper(isc.ContextViewerWindow,"hide");if(this.onHide)this.delayCall("onHide",null,0)}
);isc.B._maxIndex=isc.C+3}
isc.A=isc.Reify;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.serverURL="https://reify.com";isc.A.projectLoaderPath="isomorphic/projectLoader";isc.A.$250p=null;isc.B.push(isc.A.setServerURL=function isc_c_Reify_setServerURL(_1){this.serverURL=_1}
,isc.A.setProjectLoaderPath=function isc_c_Reify_setProjectLoaderPath(_1){this.projectLoaderPath=_1}
,isc.A.setUserName=function isc_c_Reify_setUserName(_1){this.userName=_1}
,isc.A.setPassword=function isc_c_Reify_setPassword(_1){this.password=_1}
,isc.A.loadProject=function isc_c_Reify_loadProject(_1,_2,_3){_3=isc.addProperties({},_3);var _4=_3.serverURL||this.serverURL,_5=_3.projectLoaderPath||this.projectLoaderPath
;delete _3.serverURL;delete _3.projectLoaderPath;_3.projectLoaderURL=isc.RPCManager.safelyCombinePaths(_4,_5);var _6=_3.userName||this.userName,_7="password"in _3?_3.password:this.password;if(_6)_3.USERNAME=_6;if(isc.isA.String(_7))_3.PASSWORD=_7;delete _3.userName;delete _3.password;if("USERNAME"in _3&&!("PASSWORD"in _3)){this.logWarn("You've provided a userName for accessing "+_3.serverURL+" but no password")}
isc.RPCManager.loadProject(_1,_2,_3)}
,isc.A.reifySourceViewer=function isc_c_Reify_reifySourceViewer(_1,_2){if(this.$250p&&_2){var _3=this.$250p.items[0].getMember(0);_3.setValue("projectName",_1.projectName);this.$250p.show();return}
if(!_2&&!this.$250p&&_1){var _4=isc.TabSet.create({autoDraw:false,tabBarPosition:"top",width:"100%",height:"100%"
});this.$250m(_1,"XML",_4);var _5=isc.VLayout.create({padding:10,autoDraw:false,layoutMargin:5,defaultLayoutAlign:"center",width:"100%",height:"100%",border:"1px dashed blue"
});var _6=_1.projectName,_7=isc.DataSource.create({clientOnly:true,fields:[{name:"projectName",primaryKey:true},{name:"dateTimeLoaded",type:"datetime"},{name:"project",type:"any"},{name:"$250q",type:"datetime",hidden:true}
],testData:[{projectName:_6,dateTimeLoaded:isc.DateUtil.format(new Date(),"HH:mm:ss"),project:_1,$250q:new Date()
}
]
});var _8=[_6],_9=this,_10=isc.DynamicForm.create({autoDraw:false,fields:[{name:"projectName",title:"Projects",type:"SelectItem",optionDataSource:_7,defaultValue:_6,valueField:"projectName",displayField:"projectName",sortField:"dateTimeLoaded",sortDirection:"descending",maxRecords:8,currentAmountRecords:1,pickListWidth:400,pickListFields:[{name:"projectName",width:200,showHover:true},{name:"dateTimeLoaded",width:"*"}
],changed:function(_19,_20,_21){var _11=_20.getSelectedRecord(),_12=_9.$250p.items[0].getMember(1);_9.$250m(_11.project,_19.getValue("format"),_12)}
},{name:"format",type:"radioGroup",title:"Format",valueMap:["XML","JSON"],vertical:false,defaultValue:"XML",changed:function(_19,_20,_21){var _11=_19.getField("projectName").getSelectedRecord();_9.$250m(_11.project,_21,_4)}
}
]
});_5.setMembers([_10,_4]);var _13=isc.Window.create({autoDraw:false,membersMargin:5,autoCenter:true,showMaximizeButton:true,width:"85%",height:"85%",title:"Reify Source Viewer",canDragReposition:true,canDragResize:true,items:[_5]
});this.$250p=_13}else if(_1&&this.$250p){var _9=this,_3=this.$250p.items[0].getMember(0),_12=this.$250p.items[0].getMember(1);var _14=_3.getField("projectName"),_15=_14.getOptionDataSource();_15.fetchData(null,function(_19,_20){if(_20.length>0){var _16=false;for(var i=0;i<_20.length;i++){var _11=_20[i];if(_11.projectName==_1.projectName){var _18=_15.copyRecord(_11);_18.dateTimeLoaded=isc.DateUtil.format(new Date(),"HH:mm:ss");_18.project=_1;_18.$250q=new Date();_15.updateData(_18);_16=true}else if(isc.DateUtil.compareLogicalDates(_11.$250q,new Date())==1){var _18=_15.copyRecord(_11);_18.dateTimeLoaded=isc.DateUtil.format(_18.$250q,"MM-dd-yyyy HH:mm:ss");_15.updateData(_18)}
}
if(!_16){_15.addData({projectName:_1.projectName,dateTimeLoaded:isc.DateUtil.format(new Date(),"HH:mm:ss"),project:_1,$250q:new Date()
}
)}
if(_20.length==_14.maxRecords&&!_16){_15.removeData(_20[_20.length-1])}
_9.$250m(_1,_3.getValue("format"),_12)}
},{sortBy:[{property:"$250q",direction:"descending"}]}
);_3.getField("projectName").setValue(_1.projectName)}else if(!_2&&!_1&&this.$250p){this.$250p.close()}
}
,isc.A.$250m=function isc_c_Reify__getSourceCodeTabs(_1,_2,_3){for(var j=_3.tabs.length;j>=0;j--)_3.removeTab(j);var _5={autoDraw:false,overflow:"hidden",autoFocus:false,height:"*",numCols:1,fields:[{formItemType:"textArea",name:"sourceCodeField",showTitle:false,height:"*",canEdit:false,width:"*",wrap:"OFF"
}
]
};for(var i=0;i<_1.screens.length;i++){var _7=_1.screens[i],_8=isc.DynamicForm.create(_5);_8.setValue("sourceCodeField",(_2=="XML")?_7.xml:_7.code);_3.addTab({title:_7.ID,icon:"icons/16/application_side_tree.png",iconSize:16,pane:_8})}
for(var i=0;i<_1.dataSources.length;i++){var _9=_1.dataSources[i],_8=isc.DynamicForm.create(_5);_8.setValue("sourceCodeField",(_2=="XML")?_9.xml:_9.code);_3.addTab({title:_9.ID,icon:"icons/16/database_gear.png",iconSize:16,pane:_8})}
}
);isc.B._maxIndex=isc.C+7;isc.defineClass("FunctionRef").addProperties({$253w:function(_1,_2,_3,_4){return _1+"={"+this.functionName+"}"}});isc.defineClass("VariableRef").addProperties({$253w:function(_1,_2,_3,_4){return _1=="jsxRef"?"{..."+this.variableName+"}":_1+"={"+this.variableName+"}"}});isc.setScreenReaderMode=function(_1){isc.screenReader=_1}
isc.liteAria=null;isc.A=isc.Canvas;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.ariaEnabled=function isc_c_Canvas_ariaEnabled(){return isc.screenReader||isc.screenReader!==false&&((isc.Browser.isIE&&isc.Browser.version>=8)||!isc.Browser.isIE)}
,isc.A.useLiteAria=function isc_c_Canvas_useLiteAria(){if(isc.liteAria!=null)return isc.liteAria;if(isc.screenReader==true)return false;return(isc.Browser.isIE&&isc.Browser.version<9)}
,isc.A.setAriaRole=function isc_c_Canvas_setAriaRole(_1,_2){if(!_1)return;if(this.logIsDebugEnabled("aria")){this.logDebug("ARIA role changed to: "+_2+" on element: "+this.echoLeaf(_1),"aria")}
_1.setAttribute("role",_2)}
,isc.A.setAriaState=function isc_c_Canvas_setAriaState(_1,_2,_3){if(!_1)return;if(this.logIsInfoEnabled("aria")){this.logInfo("ARIA state: "+_2+": "+_3+", set on element: "+isc.echoLeaf(_1),"aria")}
if(_3==null){this.clearAriaState(_1,_2)}else{_1.setAttribute("aria-"+_2,_3)}
}
,isc.A.setAriaStates=function isc_c_Canvas_setAriaStates(_1,_2){if(!_1)return;if(_2==null)return;for(var _3 in _2){var _4=_2[_3];if(_4==null){this.clearAriaState(_1,_3)}else{this.setAriaState(_1,_3,_2[_3])}
}
}
,isc.A.clearAriaState=function isc_c_Canvas_clearAriaState(_1,_2){if(!_1)return;_1.removeAttribute("aria-"+_2)}
,isc.A.getAriaStateAttributes=function isc_c_Canvas_getAriaStateAttributes(_1){var _2="";if(_1){for(var _3 in _1){var _4=_1[_3];if(_4==null)continue;_2+=" aria-"+_3+"='"+String.asAttValue(_4)+"'"}
}
return _2}
);isc.B._maxIndex=isc.C+7;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.initializeAria=function isc_Canvas_initializeAria(){if(this.ariaState!=null){this.$234x=this.ariaState=isc.addProperties({},this.ariaState)}
}
,isc.A.setAriaRole=function isc_Canvas_setAriaRole(_1){this.ariaRole=_1;isc.Canvas.setAriaRole(this.getClipHandle(),_1)}
,isc.A.setAriaState=function isc_Canvas_setAriaState(_1,_2,_3){if(!_3){var _4=this.ariaState||{};_4[_1]=_2;this.ariaState=_4}
if(this.$234x==null){this.$234x={};this.$234x[_1]=_2}
if(this.isDrawn()){isc.Canvas.setAriaState(this.getClipHandle(),_1,_2)}
}
,isc.A.setAriaStates=function isc_Canvas_setAriaStates(_1){this.ariaState=_1;if(this.isDrawn()){this.updateAriaState()}
}
,isc.A.clearAriaState=function isc_Canvas_clearAriaState(_1,_2){if(!_2&&this.ariaState){delete this.ariaState[_1]}
if(this.$234x!=null){delete this.$234x[_1]}
isc.Canvas.clearAriaState(this.getClipHandle(),_1)}
,isc.A.getAriaState=function isc_Canvas_getAriaState(){return isc.addProperties({},this.getAriaStateDefaults(),this.ariaState)}
,isc.A.getAriaStateDefaults=function isc_Canvas_getAriaStateDefaults(){var _1={};if(this.isDisabled())_1.disabled=true;return _1}
,isc.A.$234y=function isc_Canvas__getAriaState(){this.$234x=this.getAriaState();return this.$234x}
,isc.A.getAriaStateAttributes=function isc_Canvas_getAriaStateAttributes(){return isc.Canvas.getAriaStateAttributes(this.$234y())}
,isc.A.updateAriaState=function isc_Canvas_updateAriaState(){if(!this.isDrawn())return;var _1=this.$234x,_2=isc.addProperties({},this.$234y());if(_1!=null){var _3;for(var _4 in _1){if(_2[_4]===_3)_2[_4]=null}
}
isc.Canvas.setAriaStates(this.getClipHandle(),_2)}
);isc.B._maxIndex=isc.C+10;if(isc.StatefulCanvas){isc.A=isc.StatefulCanvas.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.getAriaStateDefaults=function isc_StatefulCanvas_getAriaStateDefaults(){var _1=this.Super("getAriaStateDefaults",arguments);if(_1==null)_1={};var _2=this.getAriaLabel();if(_2!=null)_1.label=_2;return _1}
);isc.B._maxIndex=isc.C+1}
if(isc.Progressbar){isc.Progressbar.changeDefaults("ariaState",{valuemin:0,valuemax:100});isc.A=isc.Progressbar.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.ariaRole="progressbar";isc.B.push(isc.A.getAriaStateDefaults=function isc_Progressbar_getAriaStateDefaults(){var _1=this.Super("getAriaStateDefaults",arguments);if(_1==null)_1={};if(this.percentDone!=null)_1.valuenow=this.percentDone;return _1}
);isc.B._maxIndex=isc.C+1}
if(isc.DynamicForm){isc.A=isc.DynamicForm.getPrototype();isc.A.rightTitlePrefix="<span aria-hidden='true' style='display:inline;'>:&nbsp;</span>";isc.A.titleSuffix="<span aria-hidden='true' style='display:inline;'>&nbsp;:</span>";isc.A.requiredRightTitlePrefix="<b><span aria-hidden='true' style='display:inline;'>:&nbsp;</span>";isc.A.requiredTitleSuffix="<span aria-hidden='true' style='display:inline;'>&nbsp;:</span></b>";isc.A=isc.FormItem.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.setAriaRole=function isc_FormItem_setAriaRole(_1){var _2=this.getFocusElement();if(_2!=null)isc.Canvas.setAriaRole(_2,_1)}
,isc.A.setOuterAriaRole=function isc_FormItem_setOuterAriaRole(_1){var _2=this.getHandle();if(_2!=null)isc.Canvas.setAriaRole(_2,_1)}
,isc.A.setAriaState=function isc_FormItem_setAriaState(_1,_2){var _3;if(this.outerAriaRole){_3=this.getHandle()}else{_3=this.getFocusElement()}
if(_3!=null)isc.Canvas.setAriaState(_3,_1,_2)}
,isc.A.setAriaStates=function isc_FormItem_setAriaStates(_1){var _2;if(this.outerAriaRole){_2=this.getHandle()}else{_2=this.getFocusElement()}
if(_2!=null)isc.Canvas.setAriaStates(_2,_1)}
,isc.A.clearAriaState=function isc_FormItem_clearAriaState(_1){var _2;if(this.outerAriaRole){_2=this.getHandle()}else{_2=this.getFocusElement()}
if(_2!=null)isc.Canvas.clearAriaState(_2,_1)}
,isc.A.getAriaState=function isc_FormItem_getAriaState(){return isc.addProperties({},this.getAriaStateDefaults(),this.ariaState)}
,isc.A.getAriaStateDefaults=function isc_FormItem_getAriaStateDefaults(){var _1={};if(this.required&&this.form&&this.form.hiliteRequiredFields)_1.required=true;if(this.hasErrors()){_1.invalid=true;if(!this.form.showInlineErrors||this.shouldShowErrorText()){var _2=this.$158i();_1.describedby=_2}else if(this.form.showInlineErrors&&this.shouldShowErrorIcon()){var _3=this.getErrorIconId();_1.describedby=_3}
}
if(_1.describedby==null&&!this.$712()){var _4=this.getHint();if(_4){var _5=this.$59s();_1.describedby=_5}
}
if(this.isDisabled())_1.disabled=true;if(isc.isA.CheckboxItem(this))_1.checked=!!this.getValue();return _1}
,isc.A.addContentRoles=function isc_FormItem_addContentRoles(){if(!isc.Canvas.ariaEnabled()||isc.Canvas.useLiteAria())return;if(!this.$kk()||!this.ariaRole)return;this.setAriaRole(this.ariaRole);var _1;if(this.outerAriaRole){_1=this.getHandle();if(_1!=null)isc.Canvas.setAriaRole(_1,this.outerAriaRole)}
var _2=this.getTitle();if(_2){var _3=this.$1568(),_4=this.getDocument().getElementById(_3);var _5;if(this.hasDataElement()){_5=this.getDataElement()}else if(this.outerAriaRole){_5=_1!=null?_1:this.getHandle()}else if(isc.isA.ContainerItem(this)){_5=this.$11o()}else{_5=this.$15h()}
if(_5!=null){if(_4!=null){isc.Canvas.setAriaState(_5,"labelledby",_3)}else{isc.Canvas.setAriaState(_5,"label",String.htmlStringToString(_2))}
}
}
if(this.ariaState)this.setAriaStates(this.ariaState);this.setAriaStates(this.getAriaState());if(isc.isA.SelectItem(this)&&this.outerAriaRole==="listbox"){var _6=this.$15h();if(_6!=null){isc.Canvas.setAriaStates(_6,{selected:true
})}
}
}
);isc.B._maxIndex=isc.C+8;isc.A=isc.TextAreaItem.getPrototype();isc.A.ariaState={multiline:true};isc.A=isc.RadioItem.getPrototype();isc.A.ariaRole="radio";isc.A=isc.ComboBoxItem.getPrototype();isc.A.ariaState={autocomplete:"list",expanded:false
};isc.A.ariaRole="combobox";isc.A=isc.SelectItem.getPrototype();isc.A.ariaRole="option";isc.A.outerAriaRole="listbox";isc.A.ariaState={expanded:false,haspopup:true
};isc.A.emptyDisplayValue="<span aria-hidden='true'>&nbsp;</span>";isc.A=isc.StaticTextItem.getPrototype();isc.A.ariaRole="textbox";isc.A.ariaState={disabled:true};if(isc.PickListMenu){isc.A=isc.PickListMenu.getPrototype();isc.A.ariaRole="listbox";isc.A.rowRole="option"}
isc.A=isc.ContainerItem.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.setAriaRole=function isc_ContainerItem_setAriaRole(_1){var _2=this.$11o();if(_2!=null)isc.Canvas.setAriaRole(_2,_1)}
,isc.A.setAriaState=function isc_ContainerItem_setAriaState(_1,_2){var _3=this.$11o();if(_3!=null)isc.Canvas.setAriaState(_3,_1,_2)}
,isc.A.setAriaStates=function isc_ContainerItem_setAriaStates(_1){var _2=this.$11o();if(_2!=null)isc.Canvas.setAriaStates(_2,_1)}
,isc.A.clearAriaState=function isc_ContainerItem_clearAriaState(_1){var _2=this.$11o();if(_2!=null)isc.Canvas.clearAriaState(_2,_1)}
);isc.B._maxIndex=isc.C+4;isc.A=isc.RadioGroupItem.getPrototype();isc.A.ariaRole="radiogroup"}
if(isc.MultiComboBoxItem){isc.MultiComboBoxItem.changeDefaults("buttonProperties",{ariaState:{hidden:true
},getAriaState:function(){var _1=this.getClass().$b4.getAriaState.apply(this,arguments);return isc.addProperties({},this.getAriaStateDefaults(),_1)},getAriaStateDefaults:function(){var _1=this.Super("getAriaStateDefaults",arguments);if(_1==null)_1={};_1.hidden=!this.isVisible();return _1}})}
if(isc.GridRenderer){isc.A=isc.GridRenderer.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.setRowAriaState=function isc_GridRenderer_setRowAriaState(_1,_2,_3){var _4=this.getTableElement(_1);if(_4==null)return;isc.Canvas.setAriaState(_4,_2,_3)}
,isc.A.setRowAriaStates=function isc_GridRenderer_setRowAriaStates(_1,_2){var _3=this.getTableElement(_1);if(_3==null)return;isc.Canvas.setAriaStates(_3,_2)}
);isc.B._maxIndex=isc.C+2;isc.A=isc.GridBody.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.$234w=function isc_GridBody__getRowAriaLabelledBy(_1,_2,_3,_4){var _5=this.grid;if(_5==null)return null;if(_5.ariaRole!="list")return null;if(!_5.screenReaderWriteRowLabelledBy){return null}
var _6=_5.screenReaderIncludeFieldTitles&&_5.showHeader&&_5.header;if(_5.screenReaderCellSeparator==null&&_6==false)return null;if(_6){var _7="";for(var i=0;i<_2.length;i++){var _9=_1[i];if(this.fields&&this.fields[_9])_9=this.fields[_9].masterIndex;var _10=_5.getFieldHeaderButton(_9);_7+=_10.getAriaHandleID()
+" "+_2[i]+"  "+_3+" "}
_7+=" "+_4+" ";return _7}else{return _2.join(" "+_3+" ")+" "+_4}
}
);isc.B._maxIndex=isc.C+1;isc.A=isc.ListGrid.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.ariaRole="list";isc.A.recordCellRoleProperty="cellRole";isc.A.recordRowRoleProperty="rowRole";isc.A.recordRowAriaStateProperty="rowAriaState";isc.B.push(isc.A.writeOutAriaRowCount=function isc_ListGrid_writeOutAriaRowCount(){return this.ariaRole=="grid"||this.ariaRole=="table"}
,isc.A.writeOutAriaColCount=function isc_ListGrid_writeOutAriaColCount(){return this.ariaRole=="grid"||this.ariaRole=="table"}
,isc.A.getAriaState=function isc_ListGrid_getAriaState(){var _1=this.Super("getAriaState",arguments);if(_1==null)_1={};return isc.addProperties({},this.getAriaStateDefaults(),_1)}
,isc.A.getAriaStateDefaults=function isc_ListGrid_getAriaStateDefaults(){var _1=this.Super("getAriaStateDefaults",arguments);if(_1==null)_1={};if(this.writeOutAriaRowCount()){var _2=this.getTotalRows()+(this.showHeader?1:0)
_1["rowcount"]=_2}
if(this.writeOutAriaColCount()){var _3=this.fields.length;_1["colcount"]=_3}
return _1}
,isc.A.updateAriaForDataChanged=function isc_ListGrid_updateAriaForDataChanged(){if(this.isDrawn()&&this.writeOutAriaRowCount()){this.setAriaState("rowcount",this.getTotalRows()+(this.showHeader?1:0))}
}
,isc.A.updateAriaForFieldsChanged=function isc_ListGrid_updateAriaForFieldsChanged(){if(this.isDrawn()&&this.writeOutAriaColCount()){this.setAriaState("colcount",this.fields?this.fields.length:0)}
}
,isc.A.getCellRole=function isc_ListGrid_getCellRole(_1,_2,_3){if(_3&&_3[this.recordCellRoleProperty]!=null){return _3[this.recordCellRoleProperty]}
if(this.cellRole!=null)return this.cellRole;if(this.ariaRole=="grid")return"gridcell";return null}
,isc.A.getCellAriaState=function isc_ListGrid_getCellAriaState(_1,_2,_3,_4){return null}
,isc.A.getRowRole=function isc_ListGrid_getRowRole(_1,_2){if(_2&&_2[this.recordRowRoleProperty]!=null)return _2[this.recordRowRoleProperty];if(_2&&_2.isSeparator)return"separator";if(this.rowRole!=null)return this.rowRole;if(this.ariaRole=="list")return"listitem";return"row"
}
,isc.A.getRowAriaState=function isc_ListGrid_getRowAriaState(_1,_2,_3){if(!isc.Canvas.ariaEnabled()||isc.Canvas.useLiteAria())return;if(_3==null)_3="listitem";var _4;if(this.rowAriaState||(_2&&_2[this.recordRowAriaStateProperty]!=null)){_4=isc.addProperties({},this.rowAriaState,_2[this.recordRowAriaStateProperty])}
if(!this.showAllRecords&&this.data!=null){if(_4==null)_4={};if(_3=="listitem"){_4.setsize=this.getTotalRows();_4.posinset=_1+1}else if(_3=="row"){_4.rowIndex=_1+(this.showHeader?2:1)
}
}
var _5=this.selectionManager,_6=_2!=null?_2:_1;if(_5&&_5.isSelected&&_5.isSelected(_6,_1)){if(_4==null)_4={}
_4.selected=true}
if(_2!=null){if(this.canExpandRecords&&this.canExpandRecord(_2,_1)){if(_4==null)_4={}
_4.expanded=this.isExpanded(_2)}else if(this.isGrouped&&this.isGroupNode(_2)){if(_4==null)_4={}
var _7=isc.isA.Tree(this.data)?this.data:null;if(_7){this.$2343(_4,_1,_2,_7,_3)}
}
}
return _4}
,isc.A.$2343=function isc_ListGrid__addFolderAriaStateAttributes(_1,_2,_3,_4,_5){var _6=!!_4.isOpen(_3);_1.expanded=_6;if(_6&&this.body!=null&&this.body.$252!=null){var _7=_4.getChildren(_3);if(_7!=null&&_7.length>0){var _8=this.body.$252,_9=this.body.$253;var _10=[];for(var i=0;i<_7.length;i++){var _12=_2+(i+1),_13=_12-_8;if(i>_9)break;_10[i]=this.getRowElementId(_12,_13)}
_1.owns=_10.join(" ")}
}
}
,isc.A.getHeaderAriaRole=function isc_ListGrid_getHeaderAriaRole(){var _1;if(this.headerAriaRole!==_1)return this.headerAriaRole;if(this.ariaRole=="grid")return"row";return"toolbar"}
,isc.A.getHeaderButtonAriaRole=function isc_ListGrid_getHeaderButtonAriaRole(_1){if(_1&&_1.headerButtonAriaRole!=null)return _1.headerButtonAriaRole;if(this.headerButtonAriaRole!=null)return this.headerButtonAriaRole;if(this.ariaRole=="grid")return"columnheader";return"button"
}
,isc.A.getHeaderButtonAriaState=function isc_ListGrid_getHeaderButtonAriaState(_1){var _2={};isc.addProperties(_2,_1.ariaState);isc.addProperties(_2,this.headerButtonAriaState);isc.addProperties(_2,_1.getAriaStateDefaults())
var _3=this.shouldShowHeaderMenuButton(_1,null,true),_4=_1.$174t||[],_5=_1.showDefaultContextMenu!=false&&_4.length>0
;if(_5){_2=isc.addProperties(_2,{haspopup:true})}
if(this.ariaRole=="grid"){_2.colindex=_1.masterIndex+1;var _6=this.getSortSpecifier(_1.name),_7;if(_6!=null){_7=_6.direction}
if(_7){_2.sort=_7}else{if(this.$66c(_1))_2.sort="none"}
isc.addProperties(_2,_1.headerButtonAriaState)}
return _2}
);isc.B._maxIndex=isc.C+14;isc.A=isc.TreeGrid.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.ariaRole="tree";isc.A.rowRole="treeitem";isc.B.push(isc.A.getRowRole=function isc_TreeGrid_getRowRole(_1,_2){return this.rowRole}
,isc.A.getRowAriaState=function isc_TreeGrid_getRowAriaState(_1,_2,_3){if(!isc.Canvas.ariaEnabled()||isc.Canvas.useLiteAria())return;if(!this.data||!isc.isA.Tree(this.data))return;var _4=this.data,_5=this.selectionManager,_6=!!(_5&&_5.isSelected&&_5.isSelected(_2,_1,true)),_7=_4.getLevel(_2,_1);var _8={selected:_6,level:_7,setsize:this.getTotalRows(),posinset:_1+1
};var _9;if(_4.isMultiLinkTree()){_9=_4.getNodeLocator(_1)}
if(_4.isFolder(_2)){this.$2343(_8,_1,(_9||_2),_4,_3)}
return _8}
);isc.B._maxIndex=isc.C+2;isc.A=isc.Menu.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.ariaRole="menu";isc.A.screenReaderCellSeparator=null;isc.B.push(isc.A.getRowRole=function isc_Menu_getRowRole(_1,_2){if(!_2||_2.isSeparator)return"separator";if(_2.checked||_2.checkIf||_2.checkable)return"menuitemcheckable";if(_2.radio)return"menuitemradio";return"menuitem"}
,isc.A.getRowAriaState=function isc_Menu_getRowAriaState(_1){if(this.hasSubmenu(this.getItem(_1)))return{haspopup:true}}
);isc.B._maxIndex=isc.C+2;isc.A=isc.MenuButton.getPrototype();isc.A.ariaRole="button";isc.A.ariaState={haspopup:true};isc.A=isc.MenuBar.getPrototype();isc.A.ariaRole="menubar"}
if(isc.RichTextEditor){isc.A=isc.ListPropertiesSampleTile.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.ariaState={};isc.A.$118a={"disc":"Bullets","circle":"Circles","square":"Filled squares","decimal":"Numbers","upper-roman":"Uppercase Roman numerals","lower-roman":"Lowercase Roman numerals","upper-alpha":"Uppercase letters","lower-alpha":"Lowercase letters"
};isc.A.$118b="Other bulleted style";isc.A.$118c="Other numbered style";isc.B.push(isc.A.getAriaState=function isc_ListPropertiesSampleTile_getAriaState(){return isc.addProperties({},this.getAriaStateDefaults(),this.ariaState)}
,isc.A.getAriaStateDefaults=function isc_ListPropertiesSampleTile_getAriaStateDefaults(){var _1={};var _2=this.$1177,_3=_2.style;if(_3=="custom-image"){var _4=_2.image;var _5=_4.lastIndexOf('/');if(_5>=0){_4=_4.substring(_5+1)}
_1.label="Custom bullet image '"+_4+"'"}else if(this.$118a.hasOwnProperty(_3)){_1.label=this.$118a[_3]}else{var _6=isc.ListPropertiesPane.getListType(_2)=="unordered";_1.label=_6?this.$118b
:this.$118c}
return _1}
,isc.A.getAriaStateAttributes=function isc_ListPropertiesSampleTile_getAriaStateAttributes(){return isc.Canvas.getAriaStateAttributes(this.getAriaState())}
);isc.B._maxIndex=isc.C+3;isc.A=isc.ListPropertiesPane.getPrototype();isc.A.sampleTileLayoutAriaLabel="List style";isc.ListPropertiesPane.changeDefaults("sampleTileLayoutDefaults",{ariaRole:"radiogroup",ariaState:{haspopup:false
},init:function(){this.Super("init",arguments);this.ariaState=isc.addProperties({},this.ariaState,{label:this.creator.sampleTileLayoutAriaLabel
})}});isc.ListPropertiesPane.changeDefaults("sampleTileDefaults",{ariaRole:"radio",setSelected:function(){this.Super("setSelected",arguments);this.setAriaState("checked",this.isSelected())}})}
if(isc.SectionStack){isc.A=isc.SectionStack.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.ariaRole="tablist";isc.A.sectionHeaderAriaRole="tab";isc.B.push(isc.A.getAriaState=function isc_SectionStack_getAriaState(){return isc.addProperties({},this.getAriaStateDefaults(),this.ariaState)}
,isc.A.getAriaStateDefaults=function isc_SectionStack_getAriaStateDefaults(){var _1=this.Super("getAriaStateDefaults",arguments);if(_1==null)_1={};_1.multiselectable=(this.visibilityMode!="mutex");return _1}
);isc.B._maxIndex=isc.C+2;isc.SectionStack.changeDefaults("tabPanelDefaults",{ariaRole:"tabpanel",getAriaState:function(){return isc.addProperties({},this.getAriaStateDefaults(),this.ariaState)},getAriaStateDefaults:function(){var _1=this.Super("getAriaStateDefaults",arguments);if(_1==null)_1={};var _2=this.$159h;if(_2!=null){_1.hidden=_2.hidden||!_2.expanded;_1.labelledby=_2.getAriaHandleID();var _3=_2.items;if(_3!=null&&_3.length>0){var _4=_3.callMethod("getAriaHandleID");_1.owns=_4.join(" ")}
}
return _1}});isc.$159i={ariaState:{controls:null
},getAriaState:function(){var _1;if(isc.isA.SectionHeader(this)){_1=this.Super("getAriaState",arguments)}
return isc.addProperties({},this.getAriaStateDefaults(),_1)},getAriaStateDefaults:function(){var _1;if(isc.isA.SectionHeader(this)){_1=this.Super("getAriaStateDefaults",arguments)}else{_1=isc.addProperties({},_1);if(isc.isA.StatefulCanvas(this.background)&&this.background.label!=null){_1.labelledby=this.background.label.getAriaHandleID()}else if(this.background!=null){_1.labelledby=this.background.getAriaHandleID()}
}
var _2=this.layout;if(isc.isA.SectionStack(_2)){var _3=(_2.visibilityMode!="mutex");if(_3){_1.expanded=!!this.expanded}else{_1.selected=!!this.expanded}
}
var _4=this.$159g;if(_4!=null){_1.controls=_4.getAriaHandleID()}
if(this.canCollapse==false){_1.disabled=true}
return _1}};isc.SectionHeader.addProperties(isc.$159i)
isc.ImgSectionHeader.addProperties(isc.$159i)}
if(isc.SplitPaneSidePanel){isc.A=isc.SplitPaneSidePanel.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.ariaState={hidden:true
};isc.B.push(isc.A.getAriaState=function isc_SplitPaneSidePanel_getAriaState(){return isc.addProperties({},this.getAriaStateDefaults(),this.ariaState)}
,isc.A.getAriaStateDefaults=function isc_SplitPaneSidePanel_getAriaStateDefaults(){var _1={};_1.hidden=!this.onScreen;return _1}
);isc.B._maxIndex=isc.C+2}
isc.$167y=function(){var _1=this.Super("getAriaLabel",arguments);var _2=this.parentElement;if(isc.isA.TabBar(_2)){var _3=_2.parentElement;if(isc.isA.TabSet(_3)){var _4=_3.canCloseTab(this);if(_4&&_3.ariaCloseableSuffix){_1=_1==null?_3.ariaCloseableSuffix:_1+_3.ariaCloseableSuffix}
}
}
return _1};if(isc.ImgTab){isc.A=isc.ImgTab.getPrototype();isc.A.getAriaLabel=isc.$167y}
if(isc.SimpleTabButton){isc.A=isc.SimpleTabButton.getPrototype();isc.A.getAriaLabel=isc.$167y}
if(isc.Window){isc.A=isc.Window.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.ariaState={labelledby:null,describedby:null
};isc.B.push(isc.A.getAriaState=function isc_Window_getAriaState(){var _1=this.Super("getAriaState",arguments);return isc.addProperties({},this.getAriaStateDefaults(),_1)}
,isc.A.getAriaStateDefaults=function isc_Window_getAriaStateDefaults(){var _1=this.Super("getAriaStateDefaults",arguments);if(_1==null)_1={};var _2=this.headerLabel;if(_2!=null&&_2.isVisible())_1.labelledby=_2.getAriaHandleID();var _3=this.body;if(_3!=null&&_3.isVisible())_1.describedby=_3.getAriaHandleID();return _1}
);isc.B._maxIndex=isc.C+2}
if(isc.Dialog){isc.A=isc.Dialog.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.getAriaState=function isc_Dialog_getAriaState(){var _1=this.Super("getAriaState",arguments);return isc.addProperties({},this.getAriaStateDefaults(),_1)}
,isc.A.getAriaStateDefaults=function isc_Dialog_getAriaStateDefaults(){var _1=this.Super("getAriaStateDefaults",arguments);if(_1==null)_1={};var _2=this.messageLabel;if(_2!=null&&_2.isVisible())_1.describedby=_2.getAriaHandleID();return _1}
);isc.B._maxIndex=isc.C+2}
(function(){var _1={Button:"button",StretchImgButton:"button",ImgButton:"button",Label:null,SectionHeader:"heading",ImgSectionHeader:"heading",CheckboxItem:"checkbox",Slider:"slider",TextItem:"textbox",TextAreaItem:"textbox",Window:"dialog",Dialog:"alertdialog",Toolbar:"toolbar",HTMLFlow:"article",HTMLPane:"article",TabBar:"tablist",PaneContainer:"tabpanel",ImgTab:"tab",EdgedCanvas:"presentation",BackMask:"presentation"
}
for(var _2 in _1){var _3=isc.ClassFactory.getClass(_2);if(_3)_3.addProperties({ariaRole:_1[_2]})}})();if(isc.ListGrid!=null&&isc.DynamicForm!=null){isc.ClassFactory.defineClass("DataSourceFieldPicker","DynamicForm");isc.A=isc.DataSourceFieldPicker;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.FOREIGN_KEY_WARNING="Could not guess which foreignKey to use. Determine which of your fields is the foreign key, and make its foreignKey property point to a field in ";isc.B.push(isc.A.getForeignKeyWarning=function isc_c_DataSourceFieldPicker_getForeignKeyWarning(_1){return isc.DataSourceFieldPicker.FOREIGN_KEY_WARNING+"'"+_1+"'."}
);isc.B._maxIndex=isc.C+1;isc.A=isc.DataSourceFieldPicker.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.fields=[{name:"DataSource",type:"Select",titleStyle:"formTitle",allowEmptyValue:true,valueField:"ID",getClientPickListData:function(){return this.form.getDatasourcePickListData()},changed:function(_1,_2,_3){_1.handleDsNameChanged(_3)}
},{name:"Field",type:"Select",titleStyle:"formTitle",changed:function(_1,_2,_3){_1.handleChanged()}
}];isc.B.push(isc.A.getDatasourcePickListData=function isc_DataSourceFieldPicker_getDatasourcePickListData(){if(!this.$97r){this.$97r=[""];if(this.validDsNames&&this.validDsNames.getLength()>0){this.$97r.addList(this.validDsNames.map(function(_1){return{ID:_1}}))}
if(this.allDsRecords&&this.allDsRecords.getLength()>0){if(this.$97r.getLength()>0){this.$97r.add({isSeparator:true})}
this.$97r.addList(this.allDsRecords)}
}
return this.$97r}
,isc.A.setValidDsNames=function isc_DataSourceFieldPicker_setValidDsNames(_1){this.validDsNames=_1;this.$97r=null}
,isc.A.setAllDsRecords=function isc_DataSourceFieldPicker_setAllDsRecords(_1){this.allDsRecords=_1;this.$97r=null}
,isc.A.setWarnIfNoForeignKey=function isc_DataSourceFieldPicker_setWarnIfNoForeignKey(_1){this.warnIfNoForeignKey=_1}
,isc.A.setCombinedValue=function isc_DataSourceFieldPicker_setCombinedValue(_1){var _2=this.getItem("DataSource");var _3=this.getItem("Field");var _4=(_1||"").split(".");_2.setValue(_4[0]);_3.setValue(_4[1]);this.handleDsNameChanged(_4[0])}
,isc.A.getCombinedValue=function isc_DataSourceFieldPicker_getCombinedValue(){var _1=this.getValue("DataSource");var _2=this.getValue("Field");if(_2)_1=_1+"."+_2;return _1}
,isc.A.initWidget=function isc_DataSourceFieldPicker_initWidget(){this.Super("initWidget",arguments);if(this.combinedValue)this.setCombinedValue(this.combinedValue)}
,isc.A.$97s=function isc_DataSourceFieldPicker__warnIfCannotGuessForeignKey(_1){var _2=this.warnIfNoForeignKey;if(!_2||!_2.fields)return;var _3=_2.fields.map(function(_4){return _4.foreignKey?_4.foreignKey.split('.')[0]:null});if(_3.contains(_1.ID))return;_3=_1.getFieldNames().map(function(_7){var _4=_1.getField(_7);return _4.foreignKey?_4.foreignKey.split('.')[0]:null});if(_3.contains(_2.ID))return;var _5=_2.fields.getProperty("name");var _6=_1.getFieldNames();if(_5.intersect(_6).getLength()>0)return;this.addFieldErrors("DataSource",isc.DataSourceFieldPicker.getForeignKeyWarning(this.getValue("DataSource")),true)}
,isc.A.handleLiveDs=function isc_DataSourceFieldPicker_handleLiveDs(_1){var _2=[];var _3=this.getField("Field");if(_1){_2=_1.getFieldNames();if(this.requiredBaseType){var _4=this;_2=_2.findAll(function(_3){var _5=isc.SimpleType.getBaseType(_1.getField(_3).type,_1);return _5==_4.requiredBaseType})}
if(_2.getLength()==1){_3.setValue(_2[0]);this.handleChanged()}
if(!_2.contains(_3.getValue())){_3.setValue("");this.handleChanged()}
if(this.warnIfNoForeignKey)this.$97s(_1)}
_3.setValueMap(_2)}
,isc.A.handleDsNameChanged=function isc_DataSourceFieldPicker_handleDsNameChanged(_1){if(!_1)this.getField("Field").setValue("");this.handleChanged();this.getField("Field").setValueMap([]);this.clearFieldErrors("DataSource",true);if(_1){var _2=isc.DS.get(_1);if(_2){this.handleLiveDs(_2)}else{var _3=this;isc.DS.load(_1,function(){_2=isc.DS.get(_1);if(!_2)_3.logWarn("Loading dataSource from server was unsuccessful for "+_1);_3.handleLiveDs(_2)},false,true)}
}
}
,isc.A.handleChanged=function isc_DataSourceFieldPicker_handleChanged(){if(this.changed)this.changed(this,this.getCombinedValue())}
);isc.B._maxIndex=isc.C+11;isc.DataSourceFieldPicker.registerStringMethods({changed:"form, value"});isc.ClassFactory.defineClass("DataSourceEditor","VLayout");isc.A=isc.DataSourceEditor;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.fetchDataSourceDefaults=function isc_c_DataSourceEditor_fetchDataSourceDefaults(_1,_2,_3){if(!_1){this.logWarn("Cannot determine DS defaults because dsDataSource is not provided");return null}
var _4=function(){var _5=isc.DS.get(_2);if(!_5){_3(_2,null);return}
var _6=_5.getClassName(),_7
;if(isc.DS.isRegistered(_6)){_7=isc.DS.get(_6)}else{_7=isc.DS.get("DataSource");_5._constructor=_6}
var _8=_7.xmlSerialize(_5);isc.DMI.callBuiltin({methodName:"xmlToJS","arguments":_8,callback:function(_11,_9,_12){var _9=_11.data;if(!_9){_3(_2,null);return}
var _10=isc.DataSourceEditor.extractDSDefaultsFromJS(_9,_1);_3(_2,_10,true)}
})};_1.getFile({fileName:_2,fileType:"ds",fileFormat:"xml"
},function(_11,_9,_12){if(_11.data.length==0||!_11.data[0].fileContentsJS){_4();return}
_9=_11.data[0].fileContentsJS;var _10=isc.DataSourceEditor.extractDSDefaultsFromJS(_9,_1);_3(_2,_10)},{operationId:"allOwnersXmlToJs"
})}
,isc.A.extractDSDefaultsFromJS=function isc_c_DataSourceEditor_extractDSDefaultsFromJS(_1,_2){isc.ClassFactory.$180h(true);isc.captureDefaults=true;isc.windowContext={};var _3=isc.eval(_1);var _4=_3.defaults,_5=_4.ID||_4.autoID,_6=_5&&isc.windowContext[_5],_7=_6&&_6.type
;if(!_4._constructor)_4._constructor=_7;isc.windowContext=null;isc.captureDefaults=null;isc.ClassFactory.$180h(null);isc.capturedComponents=null;if(_4.serverType=="sql")_4.dataFormat="iscServer";if(_4.recordXPath!=null&&_4.dataFormat==null){_4.dataFormat="xml"}
return _4}
,isc.A.createNameFromTitle=function isc_c_DataSourceEditor_createNameFromTitle(_1){if(!_1||_1=="")return null;var _2=_1.split(/[^a-zA-Z0-9_]/),_3=[]
;for(var i=0;i<_2.length;i++){var _5=_2[i];if(_3.length==0){var m=_5.match("^[0-9]*");if(m.length>0){_5=_5.substring(m[0].length)}
_5=_5.substring(0,1).toLowerCase()+_5.substring(1)}else{_5=_5.substring(0,1).toUpperCase()+_5.substring(1)}
if(_5&&_5!="")_3.add(_5)}
return _3.join('')}
);isc.B._maxIndex=isc.C+3;isc.A=isc.DataSourceEditor.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.mainEditorDefaults={_constructor:"ComponentEditor",autoDraw:false,autoFocus:true,numCols:8,overflow:"visible",dataSource:"DataSource",itemHoverStyle:"docHover",titleHoverHTML:function(_1){if(isc.jsdoc.hasData()){var _2=isc.jsdoc.hoverHTML("DataSource",_1.name);if(_2)return _2}
return"<nobr><code><b>"+_1.name+"</b></code> (no doc available)</nobr>"},initWidget:function(){if(this.useChangeTracking){var _1=this.fields;for(var i=0;i<_1.length;i++){var _3=_1[i];if(_3.name!="ID"){isc.addProperties(_3,{editorEnter:function(_5,_6,_7){this.$2175=_7},setValue:function(_5){this.$2175=_5;return this.Super("setValue",arguments)},editorExit:function(_5,_6,_7){var _4=this.$2175;if(_4!=_7){_5.creator.dataSourcePropertyChanged(_6.name,_4,_7);this.$2175=_7}
}
})}
}
}
this.Super("initWidget",arguments)}};isc.A.mainEditorFields=[{name:"ID",title:"ID",required:true,validateOnExit:true,hoverWidth:300,selectOnFocus:true,editorEnter:function(_1,_2,_3){this.$2175=_3},setValue:function(_1){this.$2175=_1;return this.Super("setValue",arguments)},editorExit:function(_1,_2,_3){var _4=this.$2175;if(_4!=_3){_1.creator.dataSourceIDChanged(_4,_3);this.$2175=_3}
},validators:[{type:"regexp",expression:"^(?!isc_).*$",errorMessage:"DataSource ID must not start with 'isc_'. That prefix is reserved for framework DataSources.'",stopIfFalse:true
},{type:"regexp",expression:"^[a-zA-Z_][a-zA-Z0-9_]*$",errorMessage:"DataSource ID must not contain spaces or punctuation other than underscore (_), and may not start with a number",stopIfFalse:true
},{type:"custom",condition:function(_1,_2,_3,_4,_5){if(!_3)return true;if(!_2.idMap){var _6=isc.DS.getRegisteredDataSourceObjects(),_7={}
;for(var i=0;i<_6.length;i++){var _9=_6[i];if(_9&&_9.componentSchema){var _10=_9.ID;_7[_10.toLowerCase()]=_10}
}
_2.idMap=_7}
var _10=_2.idMap[_3.toLowerCase()]||_3,_9=_1.form.creator.session.get(_10),_11=_9&&(_9.sourceDataSourceID!=null||_1.form.creator.session.getDataSourceDefaults(_10)!=null)
;return((!_9||(!_9.componentSchema&&_11))&&!isc.SimpleType.getType(_3))},errorMessage:"DataSource ID matches a system type or DataSource. Please choose another ID."
}
]},{type:"section",defaultValue:"XPath Binding",showIf:"values.dataFormat != 'iscServer' && values.serverType != 'sql' && values.serverType != null && values._constructor != 'MockDataSource'",itemIds:["dataURL","selectBy","recordXPath","recordName"]},{name:"dataURL",showIf:"values.dataFormat != 'iscServer' && values._constructor != 'MockDataSource'"},{name:"selectBy",title:"Select Records By",shouldSaveValue:false,valueMap:{tagName:"Tag Name",xpath:"XPath Expression"},defaultValue:"xpath",redrawOnChange:true,showIf:"values.dataFormat == 'xml'"},{name:"recordXPath",showIf:"values.dataFormat != 'iscServer' && form.getItem('selectBy').getValue() == 'xpath' && values._constructor != 'MockDataSource'"},{name:"recordName",showIf:"values.dataFormat == 'xml' && values.selectBy == 'tagName'"},{type:"section",defaultValue:"SQL Binding",showIf:"values.serverType == 'sql' || values.serverType == 'hibernate'",itemIds:["dbName","schema","tableName"]},{name:"dbName",showIf:"values.serverType == 'sql'",showHint:true,showHintInField:true,hint:"default"},{name:"schema",showIf:"values.serverType == 'sql'",showHint:true,showHintInField:true,hint:"default"},{name:"tableName",showIf:"values.serverType == 'sql' || values.serverType == 'hibernate'",showHint:true,showHintInField:true,hint:"same as ID"},{type:"section",defaultValue:"Record Titles",sectionExpanded:false,itemIds:["titleField"]},{name:"titleField",editorType:"SelectItem",allowEmptyValue:true,valueMap:[]},{type:"section",defaultValue:"Advanced",sectionExpanded:false,showIf:"values.serverType != null",itemIds:["dropExtraFields","autoDeriveSchema","quoteTableName","beanClassName"]},{name:"dropExtraFields",showIf:"values.clientOnly != true && values._constructor != 'MockDataSource' && values.serverType != 'sql'"},{name:"autoDeriveSchema",showIf:"values.clientOnly != true && values._constructor != 'MockDataSource'"},{name:"quoteTableName",showIf:"values.serverType == 'sql'"},{name:"beanClassName",showIf:"values.serverType == 'sql' || values.serverType == 'hibernate'"}];isc.A.fieldEditorDefaults={_constructor:"ListEditor",autoDraw:false,inlineEdit:true,dataSource:"DataSourceField",saveLocally:true,minHeight:226,gridButtonsOrientation:"right",gridButtonsProperties:{height:"100%"
},formProperties:{numCols:4,initialGroups:10
},gridDefaults:{editEvent:"click",emptyMessage:"Loading DataSource definition... ${loadingImage}",listEndEditAction:"next",showNewRecordRow:true,newRecordRowMessage:"-- Click to add new field --",canReorderRecords:true,autoParent:"gridLayout",selectionType:isc.Selection.SINGLE,recordClick:"this.creator.recordClick(record)",modalEditing:true,editorEnter:"this.creator.updateButtonStates()",cellChanged:"this.creator.updateButtonStates()",selectionUpdated:"this.creator.updateButtonStates()",contextMenu:{data:[{title:"Remove",click:"target.creator.removeRecord()"}
]
},styleName:"rightBorderOnly",validateByCell:true,leaveScrollbarGap:false,alternateRecordStyles:true,canRemoveRecords:true,canEdit:true,canEditCell:function(_1,_2){var _3=this.getRecord(_1),_4=this.getField(_2),_5=_4.name,_6=(_5=="name"||_5=="title");if(_3&&_3.$250z)return false;if(_3&&_3.foreignKey)return false;if(isc.isA.TreeGrid(this)){if(_3&&_3.isFolder&&!(_6||_5=="required"||_5=="hidden"))
{return false}
}
else{if(this.getDataSource().fieldIsComplexType(_4)&&!_6)
return false}
if(!_6&&_3&&_3.includeFrom&&_5!="hidden"){return false}
if(_5=="primaryKey"&&(!this.creator.creator.canChangePrimaryKey||this.getEditRow()==_1))
{return false}
return this.Super('canEditCell',arguments)},getCellCSSText:function(_1,_2,_3){var _4=this.getFieldName(_3),_5=this.Super("getCellCSSText",arguments)
;if(_4=="title"&&_1&&!_1.title&&!this.isSelected(_1)){_5="color:#999999;"}
return _5},getEditorProperties:function(_1,_2,_3){var _4=this.Super("getEditorProperties",arguments);if(_1.name=="name"&&_2&&_2.includeFrom&&!_2.name)
{var _5=_1.$97t(null,_2.includeFrom),_6="Using related field name: <i>"+_5+"</i>"
;isc.addProperties(_4,{showHintInField:true,hint:_6
})}else if(_1.name=="title"){if(_2&&!_2.title){var _7,_6
;if(_2.includeFrom){var _8=this.creator.creator.session;_7=_1.$212s(null,_2.includeFrom,_8);_6="<i>"+_7+"</i>"}else{_7=isc.DataSource.getAutoTitle(_2.name);_6="<i>"+_7+"</i>"}
isc.addProperties(_4,{showHintInField:true,hint:_6
})}
}else{isc.addProperties(_4,{hint:null
})}
return _4},willAcceptDrop:function(){var _1=this.getEventRecordNum(null,true),_2=this.data.get(_1);if(_2&&_2.$250z)return false;return this.Super("willAcceptDrop",arguments)},folderDrop:function(_1,_2,_3,_4){if(this==_4){var _5=this.creator.creator,_6=_5.getDataSourceID(),_7=_5.session,_8=this.data,_9=_8.getNodeList(),_10=_1[0],_11=_8.indexOf(_10),_12=(_11==0?_9[1]:(_9[_11-1].$250z?_9[_11+1]:null)),_13=(!_12?_9[_11-1]:null),_14=_8.getChildren(_2),_15=_14&&_14[_3],_16=_14&&(!_15?_14[_3-1]:null)
;_7.addChange(_6,"reorderField",{fieldName:_10.name,fromPosition:(_12?"before":"after"),fromField:(_12||_13).name,toPosition:(_15?"before":"after"),toField:(_15||_16).name
})}
this.Super("folderDrop",arguments)},editComplete:function(_1,_2,_3,_4,_5){var _6;if(_3.$211y){return}
if((_4&&_4.$211x)||((!_4||!_4.name)&&_3.name!=_6))
{var _7=this.getRecord(_1);if(_7){delete _7.$211x;this.creator.$210l(_7);this.selectSingleRecord(_1)}
}else{var _7=this.getRecord(_1);this.creator.$250r(_7,_4,_3)}
},editorEnter:function(_1,_2,_3,_4){if(_1&&_1.$211x&&this.getEditedCell(_3,"type")==null){this.setEditValue(_3,"type","text")}
if(_1&&_1.$211x&&this.getEditedCell(_3,"name")==null){this.setEditValue(_3,"name","")}
},removeRecordClick:function(_1){var _2=this,_3=_2.creator,_4=this.getRecord(_1)
;if(!_4)return;if(this.creator.creator.autoAddPK&&_4.primaryKey){isc.Hover.show("Primary key field cannot be removed");return}
if(_4.foreignKey){var _5=_2.creator.creator.getDataSourceID(),_6=isc.DS.getForeignDSName(_4,_2.creator.dataSource)
;this.showRemoveRelationDialog(_5,_6,function(_7){if(_7==true){_3.$250s(_4)}else{_3.$258t(_4)}
}.bind(this))}else{_3.$250s(_4)}
},showRemoveRelationDialog:function(_1,_2,_3){var _4="Removing this relationship will remove all existing links between '${currentDS}' records and '${relatedDS}' records if you save."
;_4=_4.evalDynamicString(this,{currentDS:_1,relatedDS:_2
});var _5=isc.Label.create({width:"100%",height:30,contents:_4
});var _6={false:"Remove relation; keep relation data",true:"Remove relation and remove DataSource field holding relation data"
};var _7=isc.DynamicForm.create({width:"100%",height:"*",numCols:1,items:[{name:"removeField",showTitle:false,type:"boolean",editorType:"radioGroup",width:"*",wrap:false,defaultValue:false,valueMap:_6
}
]
});var _8=isc.IButton.create({autoDraw:false,title:"Cancel",width:75,click:function(){this.topElement.closeClick()}
});var _9=isc.IButton.create({autoDraw:false,title:"OK",width:75,click:function(){var _10=_7.getValue("removeField");this.topElement.closeClick();_3(_10)}
});var _11=isc.HLayout.create({autoDraw:false,height:30,membersMargin:10
});_11.addMembers([isc.LayoutSpacer.create(),_8,_9]);var _12=isc.VLayout.create({width:"100%",height:"100%",padding:10,membersMargin:10,members:[_5,_7,_11]
});var _13=isc.Window.create({ID:"removeRelationDialog",title:"Remove relation?",width:550,height:250,isModal:true,showModalMask:true,autoCenter:true,items:[_12],close:function(){this.Super("close",arguments);this.markForDestroy()}
});_13.show()},rowEditorEnter:function(_1,_2,_3){if(_1||!this.creator.creator.canEditChildSchema){return}
this.delayCall("$221f");return false},$221f:function(){this.cancelEditing();this.creator.newRecord()},recordClick:function(_1,_2,_3,_4,_5,_6,_7){if(_3==this.getTotalRows()-1){_1.creator.newRecord();return false}
return this.Super("recordClick",arguments)},recordDoubleClick:function(_1,_2,_3,_4,_5,_6,_7){var _8=_1.creator.creator;if(_2.foreignKey&&_8.enableRelationEditor){_8.editRelations(_2.foreignKey);return false}
},$30h:["<a href='",,"' target='",,"' onclick='if(window.",,") return ",,".$2325(\"",,"\");'>",,"</a>"
],createDSLink:function(_1){var _2=this.creator.creator;if(!_2.canNavigateToDataSource){return _1}
var _3=this.getID(),_4=this.$30h
;_4[1]="javascript:void";_4[3]="javascript";_4[5]=_3;_4[7]=_3;_4[9]=_1;_4[11]=_1;return _4.join(isc.emptyString)},formatRelatedField:function(_1){var _2=_1.split(".");if(!_2||_2.length<2){return _1}
var _3=_2.slice(0,_2.length-1),_4=_2[_2.length-1],_5=this,_6=_3.map(function(_7){return _5.createDSLink(_7)})
;_6.add(_4);return _6.join(".")},$2325:function(_1){var _2=this.creator.creator;if(_2.$250t==_1){return false}
_2.openDataSource(_1);return false}
},$250r:function(_1,_2,_3){var _4=this,_5=this.creator,_6=_5.session,_7=_5.getCurrentDataSourceID(),_8;_3=_1;var _9=(_2&&_2.name!=null&&_3.name!=_8&&_2.name!=_3.name);var _10=(_2&&_2.type!=null&&_3.type!=_8&&_2.type!=_3.type);var _11=(_2&&((_2.length==null&&_3.length!=_8)||(_2.length!=null&&_3.length!=_8&&_2.length!=_3.length)));var _12=function(){var _13=_2.name;if(_9){_4.$1882(_2.name,_3.name);_13=_3.name}
if(_10||_11){_4.$1883(_1,(_10?_3.type:_2.type),(_11?_3.length:_2.length))}
var _14=["name","type","length","id","parentId"],_15=isc.getKeys(_2).addList(isc.getKeys(_3)).getUniqueItems().sort(),_16;for(var i=0;i<_15.length;i++){var _18=_15[i];if(_18.startsWith("_")||_14.contains(_18))continue;var _19=_2[_18],_20=_3[_18];if(_19!=_20){var _21=_6.addChange(_7,"changeFieldProperty",{fieldName:_13,property:_18,originalValue:_2[_18],newValue:_3[_18]
});if(!_16){_16=_21;_6.startChangeContext(_16)}
}
}
if(_16)_6.endChangeContext(_16)};if(this.$2493)_10=false;if(_10&&_1.validators&&_1.validators.length>0){isc.confirm("Changing the field type may cause some validators to be invalid. Clear field validators?",function(_22){if(_22){delete _1.validators}
_12()});return}
_12()},$1882:function(_1,_2){var _3=this.creator,_4=_3.session,_5=_3.getCurrentDataSourceID()
;var _6=_4.renameField(_5,_1,_2);_3.bindFields(_6);if(_3.editSampleData){_3.$210n(_6.fields,_6.cacheData)}
_3.updateTitleField(_1,_2);this.fieldNameChanged(_1,_2)},fieldNameChanged:function(_1,_2){},$1883:function(_1,_2,_3){if(this.$2493)return;var _4=this.creator,_5=_4.session,_6=_4.getCurrentDataSourceID()
;var _7=_5.changeFieldType(_6,_1.name,_2,_3);_4.bindFields(_7);if(_4.editSampleData){_4.$210n(_7.fields,_7.cacheData)}
_4.updateTitleField();this.fieldTypeChanged(_1)},fieldTypeChanged:function(_1){},$210l:function(_1){var _2=this.creator,_3=_2.session
;var _4=this.grid,_5=_4.data
;_1=(isc.isA.Tree(_5)?_5.getCleanNodeData(_1,false):_1);var _6=_2.getDefaults();_3.set(_6.ID,_6);_3.recordAddedField(_6.ID,_1);this.creator.rebindSampleData();this.creator.updateTitleField();this.updateIncludeFieldButtonState();this.fieldAdded(_1)},fieldAdded:function(_1){},$250s:function(_1){var _2=this.creator,_3=_2.session
;var _4=this.grid,_5=_4.data,_6=(isc.isA.Tree(_5)?_5.getAllNodes():_5),_7=_1.name,_8=false
;for(var i=0;i<_6.length;i++){var f=_6[i];if(f.validators&&f.validators.length>0){for(var j=0;j<f.validators.length;j++){_8=this.validatorReferencesField(f.validators[j],_7)||_8}
}
}
if(_8){isc.warn("Deletion of field "+_7+" affects one or more other fields with validators that referenced this field. These affected criterion will be ignored.")}
var _12=_2.getDefaults();_3.set(_12.ID,_12);_12=_3.removeField(_12.ID,_1.name,_1.foreignKey);_2.bindFields(_12);if(_2.editSampleData){_2.$210n(_12.fields,_12.cacheData)}
_2.updateTitleField();this.delayCall("updateButtonStates");this.updateIncludeFieldButtonState();this.fieldDeleted(_1)},fieldDeleted:function(_1){},$258t:function(_1){var _2=this.creator,_3=_2.session
;var _4=this.grid,_5=_4.data,_6=(isc.isA.Tree(_5)?_5.getAllNodes():_5),_7=_1.name,_8=false
;for(var i=0;i<_6.length;i++){var f=_6[i];if(f.validators&&f.validators.length>0){for(var j=0;j<f.validators.length;j++){_8=this.validatorReferencesField(f.validators[j],_7)||_8}
}
}
if(_8){isc.warn("Deletion of field "+_7+" affects one or more other fields with validators that referenced this field. These affected criterion will be ignored.")}
var _12=_2.getDefaults();_3.set(_12.ID,_12);var _13=_12.fields.find("name",_1.name),_14=_13.foreignKey
;var _15=_3.addChange(_12.ID,"changeFieldProperty",{fieldName:_1.name,property:"foreignKey",originalValue:_1.foreignKey,newValue:null
});delete _13.foreignKey;_3.startChangeContext(_15);if(_13.foreignDisplayField){_3.addChange(_12.ID,"changeFieldProperty",{fieldName:_1.name,property:"foreignDisplayField",originalValue:_13.foreignDisplayField,newValue:null
});delete _13.foreignDisplayField}
if(_13.useLocalDisplayFieldValue){_3.addChange(_12.ID,"changeFieldProperty",{fieldName:_1.name,property:"useLocalDisplayFieldValue",originalValue:_13.useLocalDisplayFieldValue,newValue:null
});delete _13.useLocalDisplayFieldValue}
if(_13.joinType){_3.addChange(_12.ID,"changeFieldProperty",{fieldName:_1.name,property:"joinType",originalValue:_13.joinType,newValue:null
});delete _13.joinType}
if(_13.displayField&&_12.fields.find("name",_13.displayField)==null){_3.addChange(_12.ID,"changeFieldProperty",{fieldName:_1.name,property:"displayField",originalValue:_13.displayField,newValue:null
});delete _13.displayField}
_3.removeIncludeFieldsForForeignKey(_12.ID,_14);_3.endChangeContext(_15);_2.bindFields(_12);_2.updateTitleField();this.delayCall("updateButtonStates");this.updateIncludeFieldButtonState()},updateButtonStates:function(_1){this.Super("updateButtonStates",arguments);var _2=this.grid.getSelectedRecord(),_3=(_2?this.grid.getRecordIndex(_2):null),_4=_2&&!this.grid.rowHasErrors(_3),_5=_2&&this.creator.getFieldType(_2),_6=_1||_2,_7=(this&&this.grid&&this.grid.data)
;this.setFieldButtonState(this.creator.derivedValueButton,(!_4||_6.$250z||_6.includeFrom||_6.primaryKey||_6.foreignKey||_6.type=="sequence"),_6&&this.fieldHasFormula(_6));this.setFieldButtonState(this.creator.validatorsButton,(!_4||_6.$250z),_6&&this.fieldHasValidators(_6));this.setFieldButtonState(this.creator.legalValuesButton,(!_4||_6.$250z||_6.type!="enum"),_6&&_6.valueMap);this.setFieldButtonState(this.creator.formattingButton,(!_4||_6.$250z||(_5!="integer"&&_5!="float"&&_5!="date"&&_5!="datetime"&&_5!="time")),_6&&_6.format);this.setFieldButtonState(this.creator.securityButton,(!_4||_6.$250z),_6&&this.fieldHasSecurity(_6));this.setFieldButtonState(this.creator.relationsButton,!_7,false)},updateIncludeFieldButtonState:function(){var _1=this.creator,_2=_1.session,_3=_2.getRelations(),_4=(this.grid&&this.grid.data)
;if(!_3||!this.creator.includeFieldButton)return;var _5=this.creator.getDataSourceID(),_6=_3.getRelationsForDataSource(_5)
;this.creator.includeFieldButton.setDisabled(!_6||_6.length==0||!_4)},setFieldButtonState:function(_1,_2,_3){if(!_1)return;if(_2){_1.disable();if(_1.icon){_1.setIcon(null)}
}else{_1.enable();if(_3&&!_1.icon){if(_1.iconSize!=10)_1.iconSize=10;_1.setIcon("[SKINIMG]actions/accept.png")}else if(!_3&&_1.icon){_1.setIcon(null)}
}
},fieldHasFormula:function(_1){return(_1.formula||_1.template||_1.valueFrom)},fieldHasValidators:function(_1){var _2=_1.validators,_3=(_2&&_2.length>0)
;if(_3){_2=_2.filter(function(_4){return!_4.typeCastValidator&&!_4._generated&&!_4.$174l});_3=(_2.length>0)}
return _3},fieldHasSecurity:function(_1){return(_1.viewRequiresRole!=null||_1.viewRequires!=null||_1.editRequiresRole!=null||_1.editRequires!=null)},updateValidatorFieldNames:function(_1,_2,_3){var _4=_1.applyWhen;if(!_4||isc.isA.emptyObject(_4))return;this.$178b(_4,_2,_3)},$178b:function(_1,_2,_3){var _4=_1.operator,_5=false
;if(_4=="and"||_4=="or"){var _6=_1.criteria;for(var i=0;i<_6.length;i++){if(this.$178b(_6[i],_2,_3)){_5=true}
}
}else{if(_1.fieldName!=null&&_1.fieldName==_2){_1.fieldName=_3;_5=true}
}
return _5},validatorReferencesField:function(_1,_2){var _3=_1.applyWhen;if(!_3||isc.isA.emptyObject(_3))return false;return this.$178c(_3,_2)},$178c:function(_1,_2){var _3=_1.operator;if(_3=="and"||_3=="or"){var _4=_1.criteria;for(var i=0;i<_4.length;i++){if(this.$178c(_4[i],_2)){return true}
}
}else{if(_1.fieldName!=null&&_1.fieldName==_2){return true}
}
return false},newRecord:function(_1){if(this.creator.canEditChildSchema){var _2=this.grid,_3=_2.data,_4=this.getSelectedNode();if(!_4)_4=_3.root;var _5=_3.getParent(_4)
if(_4){if(!_4.isFolder)_4=_5;var _6=this.getNextUnusedNodeId();if(_1){var _7=isc.addProperties({},_1,{id:_6,parentId:_4?_4.id:null
});this.addNode(_7,_4);this.$210l(_7)}else{var _7=isc.addProperties({name:this.getNextUniqueFieldName(_4,"field"),id:_6,parentId:_4?_4.id:null,$211x:true
});this.addNode(_7,_4);var _8=_2.findByKey(_6);if(_8){var _9=_2.getRecordIndex(_8);if(_9>=0){_2.startEditing(_9)}
}
}
}
}else this.Super("newRecord",arguments)},saveRecord:function(){if(!this.form.validate())return false;var _1=this.form.getValues();if(this.form.saveOperationType=="add"){this.$210l(_1)}else{var _2=this.getEditRecord(),_3=this.grid.data,_4=(isc.isA.Tree(_3)?_3.getCleanNodeData(_2,true):_2)||{}
;this.creator.fieldEditor.$250r(_2,_4,_1)}
return this.Super("saveRecord",arguments)},getSelectedNode:function(){return this.grid.getSelectedRecord()},addNode:function(_1,_2){var _3=this.grid.data,_4
;if(_1.includeFrom){var _5=_1.includeFrom.split(".");if(_5&&_5.length>=2){var _6=_5[_5.length-2],_7=_3.getAllNodes(),_8
;for(var i=0;i<_7.length;i++){var _10=_7[i];if(_10.foreignKey){_5=_10.foreignKey.split(".");if(_5&&_5.length>=2){var _11=_5[_5.length-2];if(_11==_6){_8=i;break}
}
}
}
if(_8!=null&&_8<_7.length-1){for(var i=_8+1;i<_7.length;i++){var _10=_7[i];if(!_10.includeFrom){_4=i;break}
_5=_10.includeFrom.split(".");if(!_5||_5.length<2){_4=i;break}
var _12=_5[_5.length-2];if(_6!=_12){_4=i;break}
}
}
}
}
_3.add(_1,_2,_4)},getNextUniqueFieldName:function(_1,_2){if(_2=="field"&&this.autoAssignNewFieldName==false)return null;var _3=_1?_1.fields||[]:[],_4=1;if(!_2||_2.length==0)_2="field";if(_3&&_3.length>0){for(var i=0;i<_3.length;i++){var _6=_3.get(i),_7=_6.name;if(!_7&&_6.includeFrom){_7=_6.includeFrom;var _8=_7.lastIndexOf(".");if(_8>=0)_7=_7.substring(_8+1)}
if(_7.substring(0,_2.length)==_2&&_7.length>_2.length){var _9=parseInt(_7.substring(_2.length));if(!isNaN(_9)&&_9>=_4)
_4=_9+1}
}
}
return _2+_4},getNextUnusedNodeId:function(){var _1=this.grid.data;for(var i=1;i<10000;i++){var _3=_1.findById(i);if(!_3)return i}
return 1},baseFieldTypesValueMap:{"text":"text: a normal text value","enum":"enum: a text field allowing only certain values","integer":"integer: a whole number","float":"float: a fractional or decimal number","boolean":"boolean: only a true or false allowed","date":"date: a specific date, with no time","time":"time: a specific time, with no date","datetime":"datetime: a specific time on a specific date","sequence":"sequence: an automatically managed numeric unique identifier for records","URL":"URL: a link to something on the web","image":"image: a link to an image on the web","color":"color: a color value","phoneNumber":"phoneNumber: a phone number","creatorTimestamp":"creatorTimestamp: date/time of record add","modifierTimestamp":"modifierTimestamp: data/time of record modifications"
},binaryFieldTypesValueMap:{"imageFile":"imageFile: an image stored in this DataSource","binary":"binary: any binary file that is not an image"
},getFieldTypeValueMap:function(){var _1,_2=(isc.isA.MockDataSource(this.targetDataSource)||(isc.isAn.Object(this.targetDataSource)&&this.targetDataSource._constructor=="MockDataSource"))
;if(!_2&&!this.targetDataSource.clientOnly){_1=this.$199u;if(!_1){_1=this.$199u=isc.addProperties({},this.baseFieldTypesValueMap,this.binaryFieldTypesValueMap)}
}else{_1=this.baseFieldTypesValueMap}
return _1},validate:function(){return this.Super("validate",arguments)&&!this.grid.hasErrors()},confirmRemovingRelations:function(_1,_2){var _3=this.creator,_4=this.grid,_5=_3.dsRelations
;if(!_4.$228q&&_5){var _6=_3.getDataSourceID(),_7=_5.getRelationsForDataSource(_6),_8=[]
;if(isc.isAn.Array(_7)){var _9=_4.data.find("primaryKey",true);for(var i=0;i<_7.length;i++){var _11=_7[i];if(_11.relatedFieldName==_9.name){_8.add(_11.dsId)}
}
}
if(_8.length>0){var _12=(_8.length>2?_8.slice(0,-1).join(",")+" and "+_8.slice(-1):(_8.length>1?_8.join(" and "):_8[0])),_13=(_8.length>1?"s":""),_14=(_8.length>1?"have":"has a"),_15=(_8.length>1?"depend":"depends")
;isc.confirm("DataSource"+_13+" <i>"+_12+"</i> "+_14+" relation"+_13+" that "+_15+" on the current primary key of this DataSource. Changing the type of <i>"+_1+"</i> to a sequence also moves the primarykey.<P>Are you sure you want to change the type and primary key? The relation will be removed.",function(_16){if(_16){_2()}
},{buttons:[isc.Dialog.CANCEL,{title:"Remove Relation"+_13,width:150,overflow:"visible",click:function(){this.topElement.okClick()}
}
],autoFocusButton:0
});return}
}
this.fireCallback(_2)},changePrimaryKey:function(_1,_2,_3,_4){var _5=this.creator,_6=this.grid
;var _7=_6.data.find("primaryKey",true),_8=_6.getRecordIndex(_7)
;_6.startEditing(_8);if(_8!=_1){_6.setEditValue(_8,"primaryKey",false)}
this.$2493=true;if(_3=="newSequence"&&_2.type!="sequence"&&_6.getEditedRecord(_8).type=="sequence"&&_8!=_1)
{_6.setEditValue(_8,"type","integer")}
if(!_6.$228q){_6.$228q=_7.name}
if(_2.name==_6.$228q){delete _6.$228q}
_6.endEditing();_6.startEditing(_1);_6.setEditValue(_1,"primaryKey",true);if(_3=="keepAsSequence"){var _9=false;if(_2.type!="sequence"){_6.setEditValue(_1,"type","sequence");_6.setEditValue(_1,"hidden",true);_9=true}
_6.endEditing();if(_9){var _10=_5.getFields(),_11=_5.getSampleData()||[]
;_5.$2329(_10,_11)}
}else if(_3=="newSequence"){var _9=false;if(_2.type!="sequence"){_6.setEditValue(_1,"type","sequence");_6.setEditValue(_1,"hidden",true);_6.setEditValue(_1,"length",null);_6.setEditValue(_1,"valueMap",null);_9=true}
_6.endEditing();if(_5.editSampleData){var _10=_5.getFields(),_11=_5.getSampleData()||[]
;if(_9){if(_11.length>0){for(var i=0;i<_11.length;i++){_11[i][_2.name]=i+1}
}
_5.$2329(_10,_11)}else{if(_11.length>0){var _13=_5.dataGrid,_14=_13.getTotalRows()
;for(var i=0;i<_14;i++){_13.setEditValue(i,_2.name,_1)}
_13.markForRedraw("created new sequence")}
}
}
}else{_6.setEditValue(_1,"required",true);_2.canUpdate=false;_6.endEditing()}
delete this.$2493;this.fireCallback(_4)},editMore:function(){this.Super("editMore",arguments);var _1=this.getEditRecord();this.form.setCanEdit(_1.$250z==null)}};isc.A.fieldEditorGridFields=[{name:"title",treeField:true,width:"*",prompt:"The name of this field that users of your applications will see",formatCellValue:function(_1,_2,_3,_4,_5){if(!_2)_2={};var _6=_5.creator.creator.session,_7=this.$212s(_1,_2.includeFrom,_6)
;if(_2.includeFrom&&!_2.title){_7="<i>"+_7+"</i>"}else if(!_2.title){var _8=isc.DataSource.getAutoTitle(_2.name);_7="<i>"+_8+"</i>"}
return _7},showHover:true,hoverWrap:false,hoverHTML:function(_1,_2,_3,_4,_5){var _6;if(_1.includeFrom&&!_1.title){_6="Using title from related field"}else if(!_1.title){_6="Title automatically derived from field name"}
return _6},$212s:function(_1,_2,_3){if(_1||!_2){return _1}else{if(_2){var _4=_2.split(".");if(_4&&_4.length>=2){var _5=_4[_4.length-2],_6=_4[_4.length-1],_7=_3.get(_5)
;if(_7){var _8=_7.getField(_6);if(_8&&_8.title){_1=_8.title}
}
}
}
return _1}
},changed:function(_1,_2,_3){var _4=_2.grid,_5=_4.getEditRow(),_6=_4.getFieldNum("name"),_7=_4.getEditValue(_5,_6),_8=_4.getRecord(_5),_9=(_8&&_8.$217f)
;if(_4.$217d||_9||!_7||_7==""){var _10=_4.getField("title");_7=isc.DataSourceEditor.createNameFromTitle(_3);_4.setEditValue(_5,_6,_7);_4.$217d=true;if(_9)delete _8.$217f}
},editorExit:function(_1,_2,_3,_4,_5,_6){delete _6.$217d}
},{name:"name",title:"Internal name",required:true,canHover:true,prompt:"Internal name for your field. Users of your application will not see this name, but it will appear in exported code and in some advanced areas of this design tool",formatCellValue:function(_1,_2,_3,_4,_5){if(!_2)_2={};var _6=this.$97t(_1,_2.includeFrom);if(_2.includeFrom){var _7=_5.formatRelatedField(_2.includeFrom),_8=(_2.includeVia?" via "+_2.includeVia:""),_9=(_2.includeSummaryFunction?" as "+_2.includeSummaryFunction:"");_6+=" [Included from: <i>"+_7+_8+_9+"</i>]"}else if(_2.$250z){var _7=_5.createDSLink(_2.$250z);_6+=" [Inherited from: <i>"+_7+"</i>]"}
return _6},$97t:function(_1,_2){if(_1||!_2){return _1}else{var _3=_2.lastIndexOf(".");if(_3==-1){return _1}else{return _2.substring(_3+1)}
}
},formatEditorValue:function(_1,_2,_3,_4){if(!_2)_2={};return this.$97t(_1,_2.includeFrom)},parseEditorValue:function(_1,_2,_3,_4,_5){if(!_2)_2={};return this.$97t(_1,_2.includeFrom)},showHover:true,hoverHTML:function(_1,_2,_3,_4,_5){var _6;if(_1.includeFrom){var _7=_1.includeFrom.split(".");if(_7&&_7.length>=2){var _8=_7[_7.length-2],_9=_7[_7.length-1]
;_6="This field shows a value from the field <i>"+_9+"</i> in the related DataSource <i>"+_8+"</i><p>To include a different field, just remove the included field and add a new one"}
}
return _6},validators:[{type:"regexp",expression:"^[a-zA-Z_][a-zA-Z0-9_]*$",errorMessage:"Field name must not contain spaces or punctuation other than underscore (_), and may not start with a number",stopIfFalse:true
},{type:"custom",condition:function(_1,_2,_3,_4,_5){if(!_3)return true;var _6=_5.component,_7=true;;if(_6){_3=_3.toLowerCase();var _8=_5.rowNum,_9=_6.getTotalRows()
;for(var i=0;i<_9;i++){if(i==_8)continue;var _11=_6.getRecord(i),_12=(_11&&_11[_1.name]?_11[_1.name].toLowerCase():null)
;if(_11&&_3==_12){_7=false;break}
}
}
return _7},errorMessage:"Field name must be unique within the DataSource"
}
]
},{name:"type",width:150,type:"ComboBoxItem",editorProperties:{addUnknownValues:false,completeOnTab:true},prompt:"Data type of this field",getEditorValueMap:function(_1,_2,_3){return _3.creator.getFieldTypeValueMap()},formatCellValue:function(_1,_2,_3,_4,_5){if(!_2)_2={};if(_2.foreignKey){var _6=_5.formatRelatedField(_2.foreignKey);_1="relation (to "+_6+")"}else if(_2.includeFrom){var _7=_5.creator.creator.session;_1=this.$223j(_2.includeFrom,_7)}else if(_1=="sequence"){_1=_1+" (primary key)"}
return _1},$223j:function(_1,_2){var _3,_4=_1.split(".")
;if(_4&&_4.length>=2){var _5=_4[_4.length-2],_6=_4[_4.length-1],_7=_2.get(_5)
;if(_7){var _8=_7.getField(_6);_3=_8&&_8.type}
}
return _3},change:function(_1,_2,_3,_4){var _5=this.grid||this,_6=_5.creator,_7=_6.creator
;if(_3=="sequence"){var _8=(_5.data.find("type","sequence")!=null);if(_8){isc.say("DataSources may not have more than one sequence field. Please remove the other sequence field first or set it to be a normal 'integer' field.");return false}
var _9=_2.rowNum,_10=_5.getRecord(_9),_11=_10.name
;var _12=function(_25){var _13=(_7.editSampleData?_7.getSampleData():null)||[],_14=_13.getProperty(_11)
;var _15=false;for(var i=0;i<_14.length;i++){if(_14[i]!=null){_15=true;break}
}
if(_15){isc.confirm("Setting this field to be a sequence will destroy any existing data in the field.  Continue?",function(_26){if(_26==true){_25()}
},{buttons:[isc.Dialog.CANCEL,{title:"Destroy existing data",width:150,overflow:"visible",click:function(){this.topElement.okClick()}
}
],autoFocusButton:0
});return}
_25()};var _17=function(_25){var _13=(_7.editSampleData?_7.getSampleData():null)||[],_14=_13.getProperty(_11)
;var _15=false;for(var i=0;i<_14.length;i++){if(_14[i]!=null){_15=true;break}
}
if(_15){var _18=isc.SchemaGuesser.create({detectPrimaryKey:true}),_19=_18.extractFieldsFrom(_13)||[],_20=_19.find("name",_11),_21=(_20&&_20.tightness==0)
;if(_21){isc.confirm("Use the existing values in this field as the initial sequence values or replace them with a new sequence starting with 1?",function(_26){if(_26==true){_25("keepAsSequence")}else if(_26==false){_25("newSequence")}
},{buttons:[isc.Dialog.CANCEL,{title:"Use existing values",width:150,overflow:"visible",click:function(){this.topElement.yesClick()}
},{title:"Create new values",width:150,overflow:"visible",click:function(){this.topElement.noClick()}
}
],autoFocusButton:0
});return}
}
_25(null)};var _22=function(_25){_6.changePrimaryKey(_9,_10,_25,function(){_6.updateButtonStates(_5.getEditedRecord(_2.rowNum))})};var _23=_5.data.findAll("primaryKey",true),_24=(_23.find("type","sequence")!=null)
;if(_24){_6.confirmRemovingRelations(_11,function(){_17(function(_25){if(_25==null){_12(function(){_22("newSequence")})}else{_22("newSequence")}
})})}else{_17(function(_25){if(_25==null){_12(function(){_22("newSequence")})}else{_22(_25)}
})}
return false}
},changed:function(_1,_2,_3){_2.grid.creator.updateButtonStates(_2.grid.getEditedRecord(_2.grid.getEditRow()))}
},{name:"required",title:"Req.",width:40,canToggle:true,canHover:true,prompt:"Required: whether users are required to provide a value for this field when saving data",hoverHTML:function(_1,_2,_3,_4,_5){var _6;if(_1.includeFrom)_6="Included fields are not editable";return _6}
},{name:"hidden",width:60,canToggle:true,prompt:"Whether this field is hidden from users"
},{name:"length",width:70,prompt:"For text fields, what is the maximum length allowed"
},{name:"primaryKey",title:"Is PK",width:70,canToggle:true,prompt:"The Primary Key (PK) uniquely identifies each DataSource record and allows related data across DataSources to be displayed together.",showHover:true,hoverHTML:function(_1,_2,_3,_4,_5){return this.prompt},recordClick:function(_1,_2,_3,_4,_5,_6,_7){_1.$228p=_3},change:function(_1,_2,_3,_4){var _5=this.grid||this,_6=_5.creator,_7=_6.creator,_8=(_5.data.find("primaryKey",true)!=null)
;if(!_8)return;if(!_7.canChangePrimaryKey)return false;var _9=(_2?_2.rowNum:_5.$228p),_10=_5.getEditedRecord(_9),_11=_10.name
;var _12=function(_9,_3){if(_3){var _13=(_7.editSampleData?_7.getSampleData():null)||[],_14=_13.getProperty(_11),_15=_14.getUniqueItems(),_16=true
;if(_15.length!=_14.length){_16=false}
if(_16){for(var i=0;i<_14.length;i++){if(_14[i]==null){_16=false}
}
}
if(!_16){isc.confirm("To be used as a primary key, a field must have all values unique and non-empty. Field <i>"+_11+"</i> does not - you can fix this in the Sample Data tab",function(_27){if(_27!=true){_7.mainTabSet.selectTab("sampleData")}
},{buttons:[{title:"Go to Sample Data",width:150,overflow:"visible",click:function(){this.topElement.cancelClick()}
},isc.Dialog.OK
],autoFocusButton:0
});return false}
var _18={},_19={action:"keepValues"}
;if(_13.length>0){if(_10.type=="integer"||_10.type=="sequence"){var _14=_13.getProperty(_11),_20=Number.MIN_SAFE_INTEGER
;for(var i=0;i<_14.length;i++){var _3=_14[i];if(_3>_20)_20=_3}
if(_10.type=="sequence"){_18.keepAsSequence="Keep existing sequence values for <i>"+_11+"</i> with next value: "+(_20+1)}else{_18.keepAsSequence="Keep existing values and make <i>"+_11+"</i> a sequence with next value: "+(_20+1)}
_19.action="keepAsSequence"}else{_18.newSequence="Discard old values and make <i>"+_11+"</i> a sequence starting with 0"}
}else{if(_10.type=="sequence"){_18.newSequence="Keep <i>"+_11+"</i> a sequence starting with 0"}else{_18.newSequence="Make <i>"+_11+"</i> a sequence starting with 0"}
_19.action="newSequence"}
_18.keepValues=(_13.length>0?"Keep values and r":"R")+"equire user to enter a new, unique value for <i>"+_11+"</i> when creating new records";var _21=isc.Dialog.create({title:"Change primary key",isModal:true,autoSize:true,autoCenter:true,bodyDefaults:{padding:10},saveData:function(){var _22=this.items[0].getValue("action");_6.changePrimaryKey(_9,_10,_22)},items:[isc.DynamicForm.create({autoDraw:false,autoFocus:true,width:600,values:_19,items:[{name:"action",editorType:"RadioGroupItem",showTitle:false,width:"*",wrap:false,valueMap:_18
}
]
}),isc.LayoutSpacer.create({autoDraw:false,height:10}),isc.HLayout.create({autoDraw:false,height:1,membersMargin:10,width:600,align:"right",members:[isc.IButton.create({autoShow:false,title:"Cancel",width:75,click:function(){_21.cancelClick()}
}),isc.IButton.create({autoShow:false,title:"OK",width:75,click:function(){_21.okClick()}
})
]
})
]
});return false}else{var _23=_5.data.findAll("primaryKey",true).length;if(_23==1){if(_7.autoAddPK){var _24=_5.data.find("name","uniqueId");if(!_24)_24=_5.data.find("name","internalId");if(_24&&_24.type=="sequence"&&_24.hidden=="true"){var _9=_5.getRecordIndex(_24);_5.setEditValue(_9,"primaryKey",true);return}
isc.confirm("All DataSources require a primary key. Do you want to add an internal primary key field with automatically generated values (the user will never see this field)?<p>Note: to change to another existing field as primary key, click the Primary Key checkbox for that field first.",function(_27){if(_27==true){_5.cancelEditing();var _25=_5.getRecord(_9);_25.primaryKey=false;_5.refreshRow(_9);_5.setEditValue(_9,"primaryKey",false);var _26=[];_7.createUniqueIdField(_26);_5.creator.newRecord(_26[0]);if(!_5.$228q){_5.$228q=_25.name}
if(_26[0].name==_5.$228q){delete _5.$228q}
}
},{buttons:[isc.Dialog.CANCEL,{title:"Add Field",width:75,overflow:"visible",click:function(){this.topElement.okClick()}
}
],autoFocusButton:1
});return false}else if(_7.requirePK){isc.say("All DataSources requires a Primary Key");return false}
}else{return false}
}
};_6.confirmRemovingRelations(_11,function(){_12(_9,_3)});return false}
}];isc.A.fieldEditorFormFields=[{name:"name",canEdit:false},{name:"type"},{name:"title"},{name:"primaryKey"},{name:"valueXPath",colSpan:2,showIf:function(){var _1=this.form.creator,_2=_1?_1.creator.mainEditor:null;return(_2&&_2.getValues().dataFormat!='iscServer')}
},{type:"section",defaultValue:"Value Constraints",itemIds:["required","length","valueMap"]},{name:"valueMap",rowSpan:2},{name:"required"},{name:"length"},{type:"section",defaultValue:"Component Binding",itemIds:["hidden","detail","canEdit"]},{name:"canEdit"},{name:"hidden"},{name:"detail"},{type:"section",defaultValue:"Relations",sectionExpanded:true,itemIds:["foreignKey","rootValue","includeFrom"]},{name:"foreignKey",type:"staticText",showPickerIcon:true,pickerConstructor:"DataSourceFieldPicker",pickerProperties:{width:160,changed:function(_1,_2){_1.creator.setValue(_2)}
},showPicker:function(){var _1=this;while(_1&&!isc.isA.DataSourceEditor(_1))_1=_1.creator;if(!_1){this.logWarn("Could not find the DataSourceEditor");return}
if(!_1.knownDataSources){this.logWarn("DataSourceEditor.knownDataSources has not been set");return}
this.Super("showPicker",arguments);var _2=_1.getDatasourceData();var _3=_1.knownDataSources.findAll({dsType:_2.serverType});this.picker.setValidDsNames(_3.getProperty("ID"));var _4=this.creator.creator.creator.session,_5=_4.get(_2.ID)
;this.picker.requiredBaseType=isc.SimpleType.getBaseType(this.form.getValue("type"),_5);this.picker.setCombinedValue(this.getValue())},destroy:function(){if(this.picker)this.picker.destroy();this.Super("destroy",arguments)}
},{name:"rootValue"},{name:"includeFrom",type:"staticText",showPickerIcon:true,pickerConstructor:"DataSourceFieldPicker",pickerProperties:{changed:function(_1,_2){_1.creator.setValue(_2)}
},showPicker:function(){var _1=this;while(_1&&!isc.isA.DataSourceEditor(_1))_1=_1.creator;if(!_1){this.logWarn("Could not find the DataSourceEditor");return}
var _2=_1.getDatasourceData();var _3=_2.fields;var _4=_3.findAll(function(_8){return _8.foreignKey})||[];var _5=_4.map(function(_8){return _8.foreignKey.split(".")[0]}).getUniqueItems();var _6=null;if(_1.knownDataSources){var _7=_2.serverType;if(_7){_6=_1.knownDataSources.findAll({dsType:_7})}else{_6=_1.knownDataSources}
}
this.Super("showPicker",arguments);this.picker.setValidDsNames(_5);if(_6)this.picker.setAllDsRecords(_6);this.picker.setWarnIfNoForeignKey(_2);this.picker.setCombinedValue(this.getValue())},destroy:function(){if(this.picker)this.picker.destroy();this.Super("destroy",arguments)}
}];isc.A.opBindingsEditorDefaults={_constructor:"DynamicForm",autoDraw:false,minHeight:120,width:"100%",padding:5,wrapItemTitles:false,initWidget:function(){this.fields=[{type:"blurb",defaultValue:"Edit the roles required to access each DataSource operation"},{type:"RowSpacer"},this.createRolesField("fetchRequiresRole","Roles required for <i>fetch</i> operation"),this.createRolesField("addRequiresRole","Roles required for <i>add</i> operation"),this.createRolesField("updateRequiresRole","Roles required for <i>update</i> operation"),this.createRolesField("removeRequiresRole","Roles required for <i>remove</i> operation")
];this.Super('initWidget',arguments)},specialFieldValues:["_any_","*super*","false"],createRolesField:function(_1,_2){var _3=isc.Auth.getAvailableRoles();var _4={"_any_":"Any user - no roles required"
};if(_3){_3.sort();for(var i=0;i<_3.length;i++){var _6=_3[i];_4[_6]=_6}
}
_4["*super*"]="SuperUser only";_4["false"]="None - no user may access";var _7=this.specialFieldValues;var _8={name:_1,type:"select",title:_2,multiple:true,multipleAppearance:"picklist",valueMap:_4,pickListProperties:{selectionChanged:function(_11,_23){if(_23){var _9=_11[_1];if(_7.contains(_9)){var _10=this.getSelection();for(var i=0;i<_10.length;i++){var _11=_10[i];if(_11[_1]!=_9){this.deselectRecord(_11)}
}
}else{var _10=this.getSelection();for(var i=0;i<_10.length;i++){var _11=_10[i];if(_7.contains(_11[_1])){this.deselectRecord(_11)}
}
}
}
}
},editorEnter:function(_23,_24,_9){this.$258u(_23,_24,_9)},setValue:function(_23){this.$258u(this.form,this,_23);return this.Super("setValue",arguments)},$258u:function(_23,_24,_9){var _12;if(_9){var _13=_23.creator.getDatasourceData(),_14=_13.operationBindings,_15=_24.name.replace("RequiresRole",""),_16=_14&&_14.findAll("operationType",_15)
;if(_16){for(var i=0;i<_16.length;i++){if(!_16[i].operationId){_12=_16[i];break}
}
}
}
this.$258v=_12},changed:function(_23,_24,_9){var _17=_23.creator.session,_18=_23.creator.getDataSourceID(),_15=_24.name.replace("RequiresRole","")
;var _19=function(_25,_9){_25=(_25?isc.clone(_25):{});delete _25.requires;delete _25.requiresRole;if(isc.isAn.Array(_9)&&_9.length==1)_9=_9[0];if(_9=="false"){_25.requires="false"}else if(_9&&_9!="_any_"){if(isc.isAn.Array(_9)){_9=_9.join(",")}
_25.requiresRole=_9}
return(isc.isAn.emptyObject(_25)?null:_25)};var _20=this.$258v,_21=_19(this.$258v,_9)
;if(!_20&&_21!=null){_17.addChange(_18,"addOperationBinding",{operationType:_15,binding:_21
})}else if(_20!=null&&!_21){_17.addChange(_18,"removeOperationBinding",{operationType:_15,binding:this.$258v
})}else if(!isc.Canvas.compareValues(_20,_21)){var _22;if((!_20.requires&&_21.requires)||(_20.requires&&!_21.requires))
{_22=_17.addChange(_18,"changeOperationBindingProperty",{operationType:_15,property:"requires",originalValue:_20.requires,newValue:_21.requires
})}
if((!_20.requiresRole&&_21.requiresRole)||(_20.requiresRole&&!_21.requiresRole)||(_20.requiresRole&&!_20.requiresRole.equals(_21.requiresRole)))
{if(_22)_17.startChangeContext(_22);_17.addChange(_18,"changeOperationBindingProperty",{operationType:_15,property:"requiresRole",originalValue:_20.requiresRole,newValue:_21.requiresRole
});if(_22)_17.endChangeContext(_22)}
}
this.$258v=_21}
}
return _8}};isc.A.mockEditorDefaults={_constructor:"DynamicForm",minWidth:80,minHeight:20,width:"100%",height:"100%",numCols:3,colWidths:[10,150,"*"],fields:[{name:"ID",title:"Name",wrapTitle:false,colSpan:2,required:true,selectOnFocus:true,hoverWidth:300,validateOnExit:true,validators:[{type:"regexp",expression:"^(?!isc_).*$",errorMessage:"DataSource ID must not start with 'isc_'. That prefix is reserved for framework DataSources.'",stopIfFalse:true
},{type:"regexp",expression:"^[a-zA-Z_][a-zA-Z0-9_]*$",errorMessage:"DataSource ID must not contain spaces or punctuation other than underscore (_), and may not start with a number",stopIfFalse:true
},{type:"custom",condition:function(_1,_2,_3,_4,_5){if(!_3)return true;if(!_2.idMap){var _6=isc.DS.getRegisteredDataSourceObjects(),_7={}
;for(var i=0;i<_6.length;i++){var _9=_6[i];if(_9&&_9.componentSchema){var _10=_9.ID;_7[_10.toLowerCase()]=_10}
}
_2.idMap=_7}
var _10=_2.idMap[_3.toLowerCase()]||_3,_9=_1.form.creator.session.get(_10),_11=_9&&(_9.sourceDataSourceID!=null||_1.form.creator.session.getDataSourceDefaults(_10)!=null)
;return((!_9||(!_9.componentSchema&&_11))&&!isc.SimpleType.getType(_3))},errorMessage:"DataSource name matches a system or application DataSource. Please choose another name."
}
]
},{name:"edit",type:"TextArea",colSpan:3,allowNativeResize:true,width:"*",height:"*",showTitle:false,browserSpellCheck:false,changed:function(_1,_2,_3){_1.editDataChanged(_3)}
},{name:"addField",showTitle:false,title:"add a unique ID field automatically",type:"checkbox",colSpan:3,changed:function(_1,_2,_3){if(_3)_1.setValue("useField",null);_1.validate()}
},{name:"useField",showTitle:false,title:"use",type:"checkbox",width:10,changed:function(_1,_2,_3){if(_3)_1.setValue("addField",null)}
},{name:"fieldName",showTitle:false,hint:"field",showHintInField:true,width:150,editorType:"ComboBoxItem",addUnknownValues:false,valueField:"name",getClientPickListData:function(){var _1=this.form.getValue("mockDataFormat"),_2=this.form.getValue("edit"),_3=this.form.getParsedFields(_1,_2)
;var _4=[];if(!_3||_3.length==0){this.setErrors("No fields could be detected in the data");this.setValue(null);return _4}
this.clearErrors();for(var i=0;i<_3.length;i++){_4.add({name:_3[i].name})}
return _4},changed:function(_1,_2,_3){_1.setValue("addField",null);_1.setValue("useField",true)},requiredWhen:{fieldName:"useField",operator:"equals",value:true
}
},{name:"useField2",type:"StaticTextItem",showTitle:false,defaultValue:"as the unique ID field"}
],initWidget:function(){if(!this.allowExplicitPKInSampleData){this.fields=isc.clone(this.fields);this.fields.find("name","addField").visible=false;this.fields.find("name","useField").visible=false;this.fields.find("name","fieldName").visible=false;this.fields.find("name","useField2").visible=false}
this.Super("initWidget",arguments)},editDataChanged:function(_1){if(!this.allowExplicitPKInSampleData)return;var _2=false;var _3=this.getValue("mockDataFormat");if(_3=="json"||_3=="csv"||_3=="xml"){_1=(_1?_1.trim():null);_1=(_1!=""?_1:null);_2=(_1!=null)}
if(_2){this.getField("addField").enable();this.getField("useField").enable();this.getField("fieldName").enable()}else{this.getField("addField").disable();this.getField("useField").disable();this.getField("fieldName").disable()}
},getParsedFields:function(_1,_2){var _3=function(_12){var _4;var _5=isc.FileParser.create({hasHeaderLine:true});if(_1=="json"||_1=="xml"){_4=_5.parseJsonData(_12);if(_4.$225h){return null}
if(_4.$225i){return null}
}else if(_1=="csv"){_4=_5.parseCsvData(_12)}
return _5.getFields()};if(_1=="xml"){var _6=isc.xml.parseXML(_2);var _7=isc.xml.selectNodes(_6,"/"),_8=isc.xml.toJS(_7)
;if(_8.length==1){var _9=isc.JSONEncoder.create({dateFormat:"dateConstructor",prettyPrint:false});var _10=_9.encode(_8[0]);var _11=this.xmlParserError(isc.JSON.decode(_10));if(_11){return null}
return _3(_10)}
}else{return _3(_2)}
return null},xmlParserError:function(_1,_2){if(!isc.isAn.Object(_1)||isc.isAn.Array(_1))return;for(var _3 in _1){if(_3=="parsererror"){_2=true}
if(_3=="xmlTextContent"&&_2){return _1[_3]}
var _4=this.xmlParserError(_1[_3],_2);if(_4)return _4}
}};isc.A.newButtonDefaults={_constructor:"IButton",autoParent:"gridButtons",title:"New Field",width:150,click:"this.creator.newRecord()"};isc.A.moreButtonDefaults={_constructor:"IButton",autoParent:"gridButtons",width:150,click:"this.creator.editMore()",disabled:true};isc.A.buttonLayoutDefaults={_constructor:"HLayout",height:42,layoutMargin:10,membersMargin:10,align:"right"};isc.A.cancelButtonDefaults={_constructor:"IButton",autoDraw:false,title:"Cancel",width:100,autoParent:"buttonLayout",click:function(){this.creator.cancelClick()}};isc.A.saveButtonDefaults={_constructor:"IButton",autoDraw:false,title:"Save",width:100,autoParent:"buttonLayout",click:function(){this.creator.saveClick()}};isc.A.addTestDataButtonDefaults={_constructor:"IButton",autoDraw:false,title:"Add Test Data",autoFit:true,click:function(){var _1=isc.addProperties({},this.creator.mainEditor?this.creator.mainEditor.getValues():this.creator.mainEditorValues
)
var _2=isc.DataImportDialog.create({ID:"dataImportDialog",targetDataSource:_1.ID
});_2.show()}};isc.A.editWithFieldsButtonDefaults={_constructor:"IButton",autoDraw:false,title:"Edit fields and data separately...",autoFit:true,click:function(){this.creator.switchToEditFieldsAndDataSeparately()}};isc.A.legalValuesButtonDefaults={_constructor:"IButton",autoDraw:false,title:"Allowed values list",width:150,disabled:true,click:function(){var _1=this.creator.fieldEditor,_2=_1.grid,_3=_2.data,_4=_2.getSelectedRecord()||_3.root,_5=(isc.isA.Tree(_3)?_3.getParent(_4):null)
;if(_4&&!_4.isFolder&&_5==_3.root){var _6=this;while(_6&&!isc.isA.DataSourceEditor(_6))_6=_6.creator;if(!_6){this.logWarn("Could not find the DataSourceEditor");return}
_6.editFieldLegalValues(_4)}
},canHover:true,hoverStyle:"vbLargeHover",getHoverHTML:function(){return(this.isDisabled()?"To create a field that only allows specific values, select field type 'enum'":null)}};isc.A.derivedValueButtonDefaults={_constructor:"IButton",autoDraw:false,title:"Derived value...",iconAlign:"right",iconSize:10,width:150,disabled:true,click:function(){var _1=this.creator.fieldEditor,_2=_1.grid,_3=_2.data,_4=_2.getSelectedRecord()||_3.root,_5=(isc.isA.Tree(_3)?_3.getParent(_4):null)
;if(_4&&!_4.isFolder&&_5==_3.root){var _6=this;while(_6&&!isc.isA.DataSourceEditor(_6))_6=_6.creator;if(!_6){this.logWarn("Could not find the DataSourceEditor");return}
_6.editDerivedValue(_4)}
}};isc.A.validatorsButtonDefaults={_constructor:"IButton",autoDraw:false,title:"Validators...",width:150,disabled:true,click:function(){var _1=this.creator.fieldEditor,_2=_1.grid,_3=_2.data,_4=_2.getSelectedRecord()||_3.root,_5=(isc.isA.Tree(_3)?_3.getParent(_4):null)
;if(_4&&!_4.isFolder&&_5==_3.root){var _6=this;while(_6&&!isc.isA.DataSourceEditor(_6))_6=_6.creator;if(!_6){this.logWarn("Could not find the DataSourceEditor");return}
_6.editFieldValidators(_4)}
}};isc.A.securityButtonDefaults={_constructor:"IButton",autoDraw:false,title:"Security...",width:150,disabled:true,click:function(){var _1=this.creator.fieldEditor,_2=_1.grid,_3=_2.data,_4=_2.getSelectedRecord()||_3.root,_5=(isc.isA.Tree(_3)?_3.getParent(_4):null)
;if(_4&&!_4.isFolder&&_5==_3.root){var _6=this;while(_6&&!isc.isA.DataSourceEditor(_6))_6=_6.creator;if(!_6){this.logWarn("Could not find the DataSourceEditor");return}
_6.editFieldSecurity(_4)}
}};isc.A.addChildButtonDefaults={_constructor:"IButton",autoDraw:false,title:"Add Child Object",width:150,click:function(){var _1=this.creator.fieldEditor,_2=_1.grid,_3=_2.data,_4=_2.getSelectedRecord()||_3.root,_5=_3.getParent(_4),_6={isFolder:true,children:[],multiple:true,childTagName:"item"
}
;if(_4){if(!_4.isFolder)_4=_5;_6.name=_1.getNextUniqueFieldName(_4,"child"),_6.id=_1.getNextUnusedNodeId(),_6.parentId=_4.id;_6.$217f=true;_3.linkNodes([_6],_5);_3.openFolder(_6);var _7=_2.findByKey(_6.id);if(_7){var _8=_2.getRecordIndex(_7);if(_8>=0){_2.startEditing(_8)}
}
}
}};isc.A.relationsButtonDefaults={_constructor:"IButton",autoDraw:false,title:"Relations...",prompt:"Relations are links between records of different DataSources such as a link from an Order to the Customer that ordered it.<P>Click the <i>Relations</i> button to view & edit relations.",hoverStyle:"vbLargeHover",width:150,disabled:true,click:function(){var _1=this;while(_1&&!isc.isA.DataSourceEditor(_1))_1=_1.creator;if(!_1){this.logWarn("Could not find the DataSourceEditor");return}
_1.editRelations()}};isc.A.includeFieldButtonDefaults={_constructor:"IButton",autoDraw:false,title:"Include field...",width:150,prompt:"Add a field whose data comes from fields in a related DataSource",hoverWidth:125,hoverStyle:"vbLargeHover",disabled:true,click:function(){var _1=this;while(_1&&!isc.isA.DataSourceEditor(_1))_1=_1.creator;if(!_1){this.logWarn("Could not find the DataSourceEditor");return}
_1.editIncludeField()}};isc.A.formattingButtonDefaults={_constructor:"IButton",autoDraw:false,title:"Formatting...",disabled:true,width:150,click:function(){var _1=this.creator.fieldEditor,_2=_1.grid,_3=_2.data,_4=_2.getSelectedRecord()||_3.root,_5=(isc.isA.Tree(_3)?_3.getParent(_4):null)
;if(_4&&!_4.isFolder&&_5==_3.root){var _6=this;while(_6&&!isc.isA.DataSourceEditor(_6))_6=_6.creator;if(!_6){this.logWarn("Could not find the DataSourceEditor");return}
_6.editFormatting(_4)}
}};isc.A.reorderButtonLayoutDefaults={_constructor:"HLayout",membersMargin:4,layoutAlign:"center",height:10};isc.A.reorderUpButtonDefaults={_constructor:"ImgButton",src:"[SKINIMG]TransferIcons/up.png",width:22,height:22,prompt:"Move field up",click:function(){var _1=this.creator.fieldEditor,_2=_1.grid,_3=_2.data,_4=_2.getSelectedRecord()||_3.root,_5=(isc.isA.Tree(_3)?_3.getParent(_4):null)
;if(_4&&!_4.isFolder&&_5==_3.root){var _6=this;while(_6&&!isc.isA.DataSourceEditor(_6))_6=_6.creator;if(!_6){this.logWarn("Could not find the DataSourceEditor");return}
_6.moveField(_4,-1)}
}};isc.A.reorderDownButtonDefaults={_constructor:"ImgButton",src:"[SKINIMG]TransferIcons/down.png",width:22,height:22,prompt:"Move field down",click:function(){var _1=this.creator.fieldEditor,_2=_1.grid,_3=_2.data,_4=_2.getSelectedRecord()||_3.root,_5=(isc.isA.Tree(_3)?_3.getParent(_4):null)
;if(_4&&!_4.isFolder&&_5==_3.root){var _6=this;while(_6&&!isc.isA.DataSourceEditor(_6))_6=_6.creator;if(!_6){this.logWarn("Could not find the DataSourceEditor");return}
_6.moveField(_4,1)}
}};isc.A.mainTabSetDefaults={_constructor:"TabSet",overflow:"visible",width:"100%",height:"100%"};isc.A.mainStackDefaults={_constructor:"SectionStack",overflow:"visible",width:"100%",height:"100%",visibilityMode:"multiple"};isc.A.instructionsSectionDefaults={_constructor:"SectionStackSection",title:"Instructions",expanded:true,canCollapse:true,hidden:true};isc.A.instructionsDefaults={_constructor:"HTMLFlow",autoFit:true,padding:10};isc.A.mainSectionDefaults={_constructor:"SectionStackSection",title:"DataSource Properties",expanded:true,canCollapse:false,showHeader:false};isc.A.fieldSectionDefaults={_constructor:"SectionStackSection",title:"DataSource Fields &nbsp;<span style='color:#BBBBBB'>(click to edit or press New Field)</span>",expanded:true,canCollapse:true};isc.A.opBindingsSectionDefaults={_constructor:"SectionStackSection",title:"DataSource Operations",expanded:false};isc.A.mockSectionDefaults={_constructor:"SectionStackSection",title:"MockDataSource Data",expanded:true,canCollapse:false,showHeader:false,hidden:true};isc.A.deriveFieldsSectionDefaults={_constructor:"SectionStackSection",title:"Derive Fields From SQL",expanded:false,canCollapse:true};isc.A.sampleDataPaneDefaults={_constructor:isc.VLayout,autoDraw:false,width:"100%",height:"100%"};isc.A.sampleDataLabelDefaults={_constructor:isc.Label,autoDraw:false,width:"100%",height:35,padding:10,contents:"Type in sample data below"};isc.A.sampleDataGridDefaults={_constructor:isc.ListGrid,autoDraw:false,width:"100%",height:"100%",canEdit:true,canRemoveRecords:true,editEvent:"click",listEndEditAction:"next",escapeKeyEditAction:"done",autoSaveEdits:false,warnOnUnmappedValueFieldChange:false,startEditing:function(_1,_2,_3){var _4=this.getEditedRecord(_1);if(isc.getKeys(_4)<1){this.setEditValue(_1,'$228t','add')}else if(!_4.$228t){this.setEditValue(_1,'$228t','update')}
this.Super('startEditing',arguments)},validateRow:function(_1,_2){var _3=this.Super("validateRow",arguments),_4=(this.$221d?this.getEditValue(_1,this.$221d):null)
;if(this.$221d&&_4==null){this.setEditValue(_1,this.$221d,this.$221e++)}
return _3}};isc.A.sampleDataButtonLayoutDefaults={_constructor:isc.HLayout,autoDraw:false,width:"100%",height:35,padding:5,membersMargin:10};isc.A.sampleDataAddRecordButtonDefaults={_constructor:isc.Button,autoDraw:false,title:"Add New Record",autoFit:true,click:function(){this.creator.dataGrid.startEditingNew()}};isc.A.sampleDataDiscardDataButtonDefaults={_constructor:isc.Button,autoDraw:false,wrap:false,autoFit:true,title:"Discard sample data changes",click:function(){this.creator.revertDataChanges()}};isc.A.bodyProperties={overflow:"auto",layoutMargin:10};isc.A.deriveFormDefaults={_constructor:"DynamicForm"};isc.A.previewGridDefaults={_constructor:"ListGrid",showFilterEditor:true};isc.A.canEditDataSourceID=true;isc.A.renameWarningMessage="Renaming a DataSource can <b>break</b> relations.<P><b>This operation cannot be undone.</b><P>Rename anyway?";isc.A.canAddChildSchema=false;isc.A.canEditChildSchema=false;isc.A.canSelectPrimaryKey=true;isc.A.canNavigateToDataSource=true;isc.A.showActionButtons=true;isc.A.showDerivedValueButton=true;isc.A.canChangePrimaryKey=true;isc.A.switchToEditFieldsAndDataSeparatelyMessage="By editing fields and data separately additional behaviors can be added to your DataSource, such as validators.<P>Once you save in this mode your DataSource will always be edited in this way.<P>You can always re-create your DataSource from sample data. You may want to take a copy of your current sample data before you begin editing.";isc.A.legalValuesWindowDefaults={_constructor:isc.Window,autoCenter:true,height:250,width:500,isModal:true,showModalMask:true,showHeaderIcon:false,showMinimizeButton:false,keepInParentRect:true,close:function(){this.Super("close",arguments);this.markForDestroy()}};isc.A.legalValuesFormDefaults={_constructor:isc.DynamicForm,addAsChild:true,width:"100%",height:"100%",numCols:1,fields:[{name:"values",editorType:"ValueMapItem",showTitle:false,showMapTypeButton:false,showHeader:false,newOptionRowMessage:"Click to add allowed values to the list"}
],validate:function(){this.getItem("values").validate();return this.Super("validate",arguments)}};isc.A.legalValuesToolbarDefaults={_constructor:isc.HLayout,width:"100%",height:30,padding:10,align:"right",membersMargin:4,members:[{_constructor:isc.Button,title:"Cancel",width:75,click:function(){this.topElement.destroy()}
},{_constructor:isc.Button,title:"Save",width:75,click:function(){this.parentElement.saveLegalValues()}
}
]};isc.A.derivedValueWindowDefaults={_constructor:isc.Window,autoCenter:true,height:600,width:650,isModal:true,showModalMask:true,showHeaderIcon:false,showMinimizeButton:false,keepInParentRect:true,close:function(){this.Super("close",arguments);this.markForDestroy()}};isc.A.derivedValueEditorConstructor="DynamicValueEditor";isc.A.derivedValueEditorDefaults={getBuilderProperties:function(){return{dataSource:this.dataSource,mathFunctions:["min","max","random","pow","ceil","ln","year","month","day"]
}}};isc.A.validatorsWindowDefaults={_constructor:isc.Window,autoCenter:true,height:550,width:800,isModal:true,showModalMask:true,showHeaderIcon:false,showMinimizeButton:false,keepInParentRect:true,close:function(){this.Super("close",arguments);this.markForDestroy()},destroy:function(){if(this.dataSource)this.dataSource.destroy();this.Super("destroy",arguments)}};isc.A.validatorsLayoutDefaults={_constructor:isc.ValidatorsEditor,addAsChild:true,width:"100%",height:"100%"};isc.A.validatorsToolbarDefaults={_constructor:isc.HLayout,width:"100%",height:30,padding:10,align:"right",membersMargin:10,members:[{_constructor:isc.IButton,title:"Cancel",width:75,click:function(){this.topElement.destroy()}
},{_constructor:isc.IButton,title:"Save",width:75,click:function(){this.parentElement.saveValidators()}
}
]};isc.A.securityWindowDefaults={_constructor:isc.Window,isModal:true,showModalMask:true,showHeaderIcon:false,showMinimizeButton:false,keepInParentRect:true,autoCenter:true,autoSize:true,canDragResize:true};isc.A.securityEditorDefaults={_constructor:"VLayout",autoDraw:false,width:400,membersMargin:10,formDefaults:{_constructor:"DynamicForm",autoDraw:false,padding:10,wrapItemTitles:false
},buttonLayoutDefaults:{_constructor:"HLayout",autoDraw:false,width:"100%",height:42,layoutMargin:10,membersMargin:10,align:"right"
},cancelButtonDefaults:{_constructor:"IButton",autoDraw:false,title:"Cancel",width:75,autoParent:"buttonLayout",click:function(){this.creator.cancelClick()}
},saveButtonDefaults:{_constructor:"IButton",autoDraw:false,title:"Save",width:75,autoParent:"buttonLayout",click:function(){this.creator.saveClick()}
},initWidget:function(){this.Super('initWidget',arguments);var _1=[{type:"blurb",defaultValue:"Configure the roles required to view or modify this field"},{type:"RowSpacer"},this.createRolesField("viewRequiresRole","Roles required to <i>view</i> this field"),this.createRolesField("editRequiresRole","Roles required to <i>edit</i> this field")
];this.addAutoChild("form",{fields:_1});this.addAutoChild("buttonLayout");this.buttonLayout.addMember(this.createAutoChild("cancelButton"));this.buttonLayout.addMember(this.createAutoChild("saveButton"))},specialFieldValues:["_any_","*super*","false"],createRolesField:function(_1,_2){var _3=isc.Auth.getAvailableRoles();var _4={"_any_":"Any user - no roles required"
};if(_3){_3.sort();for(var i=0;i<_3.length;i++){var _6=_3[i];_4[_6]=_6}
}
_4["*super*"]="SuperUser only";_4["false"]="None - no user may access";var _7=this.specialFieldValues;var _8={name:_1,type:"select",title:_2,multiple:true,multipleAppearance:"picklist",valueMap:_4,pickListProperties:{selectionChanged:function(_11,_12){if(_12){var _9=_11[_1];if(_7.contains(_9)){var _10=this.getSelection();for(var i=0;i<_10.length;i++){var _11=_10[i];if(_11[_1]!=_9){this.deselectRecord(_11)}
}
}else{var _10=this.getSelection();for(var i=0;i<_10.length;i++){var _11=_10[i];if(_7.contains(_11[_1])){this.deselectRecord(_11)}
}
}
}
}
}
}
return _8},edit:function(_1,_2){if(!this.isDrawn()){this.delayCall("edit",arguments);return}
this.saveCallback=_2;if(_1.viewRequiresRole){_1.viewRequiresRole=_1.viewRequiresRole.split(",")}
if(_1.editRequiresRole){_1.editRequiresRole=_1.editRequiresRole.split(",")}
if(_1.viewRequires=="false"){_1.viewRequiresRole="false";delete _1.viewRequires}
if(_1.editRequires=="false"){_1.editRequiresRole="false";delete _1.editRequires}
if(_1.viewRequiresRole==null)_1.viewRequiresRole="_any_";if(_1.editRequiresRole==null)_1.editRequiresRole="_any_";this.form.editRecord(_1)},cancelClick:function(){var _1=this.getParentElements();if(_1&&_1.length>0){var _2=_1[_1.length-1];if(isc.isA.Window(_2))_2.closeClick()}
},saveClick:function(){if(!this.form.validate())return;var _1=this.form.getValues();var _2=_1.viewRequiresRole;if(isc.isAn.Array(_2)&&_2.length==1)_2=_2[0];delete _1.viewRequires;if(_2=="_any_"){delete _1.viewRequiresRole}else if(_2=="false"){_1.viewRequires="false";delete _1.viewRequiresRole}
var _2=_1.editRequiresRole;if(isc.isAn.Array(_2)&&_2.length==1)_2=_2[0];delete _1.editRequires;if(_2=="_any_"){delete _1.editRequiresRole}else if(_2=="false"){_1.editRequires="false";delete _1.editRequiresRole}
if(isc.isAn.Array(_1.viewRequiresRole)){_1.viewRequiresRole=_1.viewRequiresRole.join(",")}
if(isc.isAn.Array(_1.editRequiresRole)){_1.editRequiresRole=_1.editRequiresRole.join(",")}
this.fireCallback(this.saveCallback,"field",[_1]);this.saveCallback=null}};isc.A.relationEditorDefaults={_constructor:"RelationEditor",autoDraw:false,editComplete:function(_1){var _2=this.dsEditor,_3=_2.fieldEditor
;if(!_1){if(this.readOnly){isc.warn("Project is read-only so DataSource changes are being ignored.");return}
_2.relationEditorWindow.hide()}
_2.relationEditorWindow.closeClick();var _4=this.session.getDataSourceDefaults(this.dataSource.ID),_5=_4.fields
;_2.bindFields(_4);if(_2.editSampleData){_2.$210n(_5,_4.cacheData)}
_2.updateTitleField();_2.fieldEditor.updateButtonStates();_2.fieldEditor.updateIncludeFieldButtonState();_2.pushEditsToSession();var _6=_3.grid,x=_6.body.getPageLeft(),y=_6.body.getPageTop()+(_6.body.getVisibleHeight()*.66)
;this.showNewRelationNotifications(x,y,function(_9){_2.openDataSource(_9)},true)},navigateToDataSource:function(_1,_2,_3){this.dsEditor.relationEditorWindow.closeClick();this.dsEditor.navigateToDataSource(_1,_2,_3)}};isc.A.relationEditorWindowDefaults={_constructor:isc.Window,autoDraw:false,isModal:true,showModalMask:true,showHeaderIcon:false,showMinimizeButton:false,keepInParentRect:true,autoCenter:true,width:875,height:760,bodyProperties:{layoutLeftMargin:5,layoutRightMargin:5,layoutBottomMargin:5
},canDragResize:true};isc.A.includeFieldEditorDefaults={_constructor:"VLayout",autoDraw:false,width:600,formDefaults:{_constructor:"DynamicForm",autoDraw:false,height:150,wrapItemTitles:false,numCols:4,colWidths:[125,25,50,"*"],fields:[{name:"relatedDataSource",type:"text",editorType:"SelectItem",title:"Related DataSource",colSpan:3,width:300,sortField:0,required:true
},{name:"relatedField",type:"text",editorType:"SelectItem",title:"Field",colSpan:3,width:300,required:true,readOnlyWhen:{_constructor:"AdvancedCriteria",operator:"or",criteria:[{fieldName:"relatedDataSource",operator:"isNull"}
]
}
},{name:"enableNameAs",type:"boolean",align:"right",width:125,showTitle:false,labelAsTitle:true,startRow:true
},{name:"includeField",type:"text",title:"Name as",colSpan:2,hint:"in DataSource dsID",readOnlyWhen:{_constructor:"AdvancedCriteria",operator:"or",criteria:[{fieldName:"relatedField",operator:"isNull"},{fieldName:"enableNameAs",operator:"notEqual",value:true}
]
},validators:[{type:"regexp",expression:"^[a-zA-Z_][a-zA-Z0-9_]*$",errorMessage:"Field name must be a valid JavaScript identifier"
}
]
},{name:"fieldTitle",type:"text",title:"Title as",colSpan:3,readOnlyWhen:{_constructor:"AdvancedCriteria",operator:"or",criteria:[{fieldName:"relatedField",operator:"isNull"}
]
}
},{name:"includeSummaryFunction",type:"text",editorType:"SummaryFunctionItem",title:"Combine record values as",colSpan:3,width:400,showIf:function(_1,_2,_3,_4){var _5=_3.getField("relatedDataSource"),_6=_5.getDisplayValue(_5.getValue()),_7=_3.creator.creator.session,_8=_7.get(_5.getValue())
;return(_8&&_8.canAggregate!=false&&_8.allowClientRequestedSummaries!=false&&_6&&_6.contains("(1-to-many)"))},readOnlyWhen:{_constructor:"AdvancedCriteria",operator:"and",criteria:[{fieldName:"relatedField",operator:"isNull"}
]
}
}
],editNewRecord:function(_1){this.updateRelatedFieldChoices(_1);this.updateNameAsValue(_1);this.updateNameAsHint(_1);this.Super("editNewRecord",arguments)},itemChanged:function(_1,_2){var _3=this.getValues();if("relatedDataSource"==_1.name){this.updateRelatedFieldChoices(_3,true);this.updateNameAsValue(_3);this.updateNameAsHint(_3);this.clearSummaryFunctionValue();this.markForRedraw()}else if("relatedField"==_1.name){this.updateNameAsValue(_3);this.updateFieldTitleValue();this.clearSummaryFunctionValue()}
},updateRelatedFieldChoices:function(_1,_2){if(!_1)return;var _3=_1.relatedDataSource;if(!_3)return;var _4=this.creator.creator.session,_5=_4.get(_3)
;if(_5){var _6=_5.getFieldNames();this.getField("relatedField").setValueMap(_6)}
this.clearValue("relatedField");this.clearValue("enableNameAs");this.clearValue("includeField");delete _1.relatedField;delete _1.includeField},updateNameAsValue:function(_1){if(!_1)return;var _2=_1.relatedDataSource,_3=false
;if(_2){var _4=this.creator.dataSource,_5=_1.relatedField
;if(!_5)return;var _6=function(_19){var _7=_4.fields;if(isc.isAn.Object(_7)){var _8=[];for(var _9 in _7){_8.add(_7[_9])}
_7=_8}
var _10=_7.find("name",_19);if(!_10){_19=_19.toLowerCase();for(var i=0;i<_7.length;i++){var _12=_7.get(i),_13=_12.name;if(!_13&&_12.includeFrom){_13=_12.includeFrom;var _14=_13.lastIndexOf(".");if(_14>=0)_13=_13.substring(_14+1)}
if(_13&&_13.toLowerCase()==_19){_10=_12;break}
}
}
return _10};var _15=_2.substring(0,1).toLowerCase()+_2.substring(1);var _16=(_5.toLowerCase().startsWith(_2.toLowerCase())?_5:_15+_5.substring(0,1).toUpperCase()+_5.substring(1));var _17=_16,_18=2;while(_6(_16)){_16=_17+_18++}
this.setValue("includeField",_16);this.setValue("enableNameAs",true);_3=true}
if(!_3){this.clearValue("includeField");this.clearValue("enableNameAs")}
},updateNameAsHint:function(_1){if(!_1)return;var _2=_1.relatedDataSource,_3
;if(_2){_3=(_2?"in <i>"+this.creator.dsId+"</i>":null)}
this.getField("includeField").setHint(_3)},updateFieldTitleValue:function(){var _1=this.creator.creator.session,_2=this.getValue("relatedDataSource"),_3=_1.get(_2),_4=(_3?_3.title||_3.ID.replace(/\d+$/,""):null),_5=this.getValue("relatedField"),_6=_3.getField(_5),_7=_4
;_7=_6&&(_6.title||isc.DS.getAutoTitle(_6.name));this.setValue("$2477",_7);if(!_7||!_7.toLowerCase().contains(_4.toLowerCase())){_7=_4+" "+_7}
this.setValue("fieldTitle",_7);this.setValue("$2478",_7)},clearSummaryFunctionValue:function(){this.clearValue("includeSummaryFunction");var _1=this.creator.creator.session,_2=this.getValue("relatedDataSource"),_3=_1.get(_2),_4=this.getValue("relatedField"),_5=_3.getField(_4),_6=(_5?_5.type:null)||"text"
;this.getField("includeSummaryFunction").setFieldType(_6)}
},buttonLayoutDefaults:{_constructor:"HLayout",autoDraw:false,width:"100%",height:42,layoutMargin:10,membersMargin:10,align:"right"
},cancelButtonDefaults:{_constructor:"IButton",autoDraw:false,title:"Cancel",width:75,autoParent:"buttonLayout",click:function(){this.creator.cancelClick()}
},saveButtonDefaults:{_constructor:"IButton",autoDraw:false,title:"Save",width:75,autoParent:"buttonLayout",click:function(){this.creator.saveClick()}
},initWidget:function(){this.Super('initWidget',arguments);this.addAutoChildren(["form","buttonLayout"]);this.buttonLayout.addMember(this.createAutoChild("cancelButton"));this.buttonLayout.addMember(this.createAutoChild("saveButton"))},edit:function(_1,_2,_3,_4){if(!this.isDrawn()){this.delayCall("edit",arguments);return}
var _5={"1-M":"1-to-many","M-1":"many-to-1","Self":"tree self-relation"
};var _6=_1.ID,_7={}
;_2.map(function(_9){_7[_9.dsId]=_9.dsId+" ("+_5[_9.type]+")"});this.form.getField("relatedDataSource").setValueMap(_7);if(!_4){var _8=isc.getKeys(_7);if(_8&&_8.length==1)_4=_8[0]}
this.dataSource=_1;this.dsId=_6;this.relations=_2;this.saveCallback=_3;this.form.editNewRecord({relatedDataSource:_4})},cancelClick:function(){var _1=this.getParentElements();if(_1&&_1.length>0){var _2=_1[_1.length-1];if(isc.isA.Window(_2))_2.closeClick()}
},saveClick:function(){if(!this.form.validate())return;var _1=this.form.getValues();var _2=this.dataSource;var _3=_1.relatedDataSource;var _4=_2.getDefaultPathToRelation(_3,this.relations);var _5=_4.path.replaceAll('/','.');var _6={name:_1.includeField||_1.relatedField,includeFrom:_5+"."+_1.relatedField
};if(_1.fieldTitle&&_1.fieldTitle!=_1.$2477){_6.title=_1.fieldTitle}
if(_1.includeSummaryFunction){_6.includeSummaryFunction=_1.includeSummaryFunction}
this.fireCallback(this.saveCallback,"field",[_6]);this.saveCallback=null}};isc.A.includeFieldEditorWindowDefaults={_constructor:isc.Window,autoDraw:false,title:"Add included field",isModal:true,showModalMask:true,showHeaderIcon:false,showMinimizeButton:false,keepInParentRect:true,autoCenter:true,autoSize:true,canDragResize:true,closeClick:function(){if(this.dropDS){this.dropDS.destroy()}
this.close()}};isc.A.formatEditorDefaults={_constructor:"NumberFormatEditor",autoDraw:false};isc.A.formatWindowDefaults={_constructor:isc.Window,autoDraw:false,isModal:true,showModalMask:true,showHeaderIcon:false,showMinimizeButton:false,keepInParentRect:true,autoCenter:true,autoSize:true,canDragResize:true};isc.B.push(isc.A.setInstructions=function isc_DataSourceEditor_setInstructions(_1){if(!this.mainStack)return;if(_1){this.mainStack.showSection(0);this.instructions.setContents(_1)}else{this.mainStack.hideSection(0)}}
);isc.evalBoundary;isc.B.push(isc.A.editNew=function isc_DataSourceEditor_editNew(_1){this.addTestDataButton.hide();this.editWithFieldsButton.hide();if(this.knownDataSources&&this.knownDataSources.length>0&&!this.session.dataSources){this.session.setDataSources(this.knownDataSources)}
if(this.editSampleData){this.$210n();this.originalSampleData=null}
if(!_1||_1.defaults){var _2=(_1?_1.defaults:{_constructor:"DataSource "});this.paletteNode=_1;this.start(_2,_2,true)}else{this.start(_1,null,true)}}
);isc.evalBoundary;isc.B.push(isc.A.editSaved=function isc_DataSourceEditor_editSaved(_1){if(!_1)return;var _2;if(this.knownDataSources&&!this.session.dataSources){this.session.setDataSources(this.knownDataSources)}
if(isc.isA.String(_1)){var _3=this;this.session.loadDataSourceDefaults(_1,function(_2){_3.$250u(_3.session.get(_1),_2)});return}else if(!isc.isA.DataSource(_1)){_2=_1.defaults||_1;var _4=_2&&_2.ID;this.session.add(_4,_2,true);_1=this.session.get(_4)}
this.$250u(_1,_2)}
,isc.A.$250u=function isc_DataSourceEditor__editSaved(_1,_2){if(!isc.isA.MockDataSource(_1)){if(this.builder&&!this.builder.onSiteMode)this.addTestDataButton.show();else this.addTestDataButton.hide();this.editWithFieldsButton.hide()}else{this.addTestDataButton.hide();if(!this.editSampleData&&!_1.hasExplicitFields()){this.editWithFieldsButton.show()}else{this.editWithFieldsButton.hide()}
}
if(this.editSampleData){this.$2328(_1)}
this.start(_1,_2,false)}
,isc.A.$2328=function isc_DataSourceEditor__bindInitialSampleData(_1){var _1=_1||this.getCurrentDataSource();if(!_1){this.delayCall("$2328",arguments,250);return};var _2=_1.getFieldNames(),_3=[]
;for(var i=0;i<_2.length;i++){_3[i]=_1.getField(_2[i])}
this.originalSampleDataOrigin=_1.ID;this.originalSampleData=_1.cacheData;this.delayCall("$210n",[_3,_1.cacheData,true])}
,isc.A.visibilityChanged=function isc_DataSourceEditor_visibilityChanged(_1){if(this.$2327&&_1){this.$2328();delete this.$2327}}
,isc.A.showRecord=function isc_DataSourceEditor_showRecord(_1){if(this.editSampleData){var _2=this.dataGrid;if(!_2||!_2.getDataSource()){this.delayCall("showRecord",arguments,250);return}
var _3=_2.getDataSource().getPrimaryKeyFieldName(),_4=_1[_3]
;this.mainTabSet.selectTab("sampleData");var _5=_2.getAllEditRows();for(var i=0;i<_5.length;i++){var _7=_5[i],_8=_2.getEditedRecord(_7)
;if(_8[_3]==_4){_2.scrollToRow(_7);_2.startEditing(_7);break}
}
}}
);isc.evalBoundary;isc.B.push(isc.A.start=function isc_DataSourceEditor_start(_1,_2,_3){if(this.editSampleData&&!this.mainTabSet.getTabPane(0)){this.mainTabSet.setTabPane(0,this.mainStack);this.mainTabSet.show()}else if(!this.editSampleData&&this.mainTabSet.getTabPane(0)){this.mainTabSet.hide();this.addMember(this.mainStack,0)}
if(this.canEditMockData(_1)){this.mainStack.hideSection(1);this.mainStack.hideSection(2);this.mainStack.hideSection(3);this.mainStack.showSection(4);this.mockEditor.show();this.$206a=true}else{this.mainStack.showSection(1);this.mainStack.showSection(2);this.mainStack.showSection(3);this.mainStack.hideSection(4);this.mockEditor.hide();this.$206a=false}
if(this.mainEditor)this.mainEditor.clearValues();if(this.fieldEditor){this.fieldEditor.grid.setEmptyMessage("Loading DataSource definition... ${loadingImage}");this.fieldEditor.setData(null)}
if(this.opBindingsEditor)this.opBindingsEditor.setData(null);this.$250v=_3;this.$250t=null;this.$250w=_2;this.$d(_1,_2,_3)}
,isc.A.$d=function isc_DataSourceEditor__start(_1,_2,_3){if(!this.session.isReady()){var _4=this;this.session.waitForReady(function(){_4.$d(_1,_2,_3)});return}
if(!_1){return this.show()}
this.dsClass=_1.Class;if(_3){if(isc.isA.DataSource(_1)){var _5=_1.sfName;_1=_1.getSerializeableFields();if(_5)_1.sfName=_5;this.logWarn("editing new DataSource from live DS, data: "+this.echo(_1));this.$250t=_1.ID;this.$31u(_1)}else if(!_2||!_2.ID){_2=_2||{};var _6=this;if(!_2.ID){this.getUniqueDataSourceID(function(_7){_2.ID=_7;_6.$250t=_7;_6.$31u(_2)})}else{_6.startEditing(_2)}
}else{this.$250t=_2.ID;this.$31u(_2)}
}else{if(_2){this.$250t=_2.ID;this.delayCall("$31u",[_2])}else{this.$250t=_1.ID;var _4=this;this.session.loadDataSourceDefaults(_1.ID,function(_2){_4.$31u(_2)})}
}}
,isc.A.canEditMockData=function isc_DataSourceEditor_canEditMockData(_1){return(isc.isA.MockDataSource(_1)&&this.editMockData!=false&&!_1.hasExplicitFields())}
,isc.A.switchToEditFieldsAndDataSeparately=function isc_DataSourceEditor_switchToEditFieldsAndDataSeparately(){var _1=this;isc.warn(this.switchToEditFieldsAndDataSeparatelyMessage,function(_2){if(_2)_1.$210p()},{buttons:[isc.Dialog.CANCEL,isc.Dialog.OK],autoFocusButton:1
})}
,isc.A.$210p=function isc_DataSourceEditor__switchToEditFieldsAndDataSeparately(){var _1=this.pushEditsToSession();this.editSampleData=true;this.mainTabSet=this.createAutoChild("mainTabSet");var _2=this.createAutoChild("sampleDataLabel");this.dataGrid=this.createAutoChild("sampleDataGrid");var _3=this.createAutoChild("sampleDataAddRecordButton");var _4=this.createAutoChild("sampleDataDiscardDataButton");var _5=this.createAutoChild("sampleDataButtonLayout",{members:[_3,_4]
});this.dataPane=this.createAutoChild("sampleDataPane",{members:[_2,this.dataGrid,_5]});this.mainTabSet.addTab({name:"fields",title:"DataSource Fields",pane:this.mainStack
});this.mainTabSet.addTab({name:"sampleData",title:"Sample Data",pane:this.dataPane
});this.addMember(this.mainTabSet,0);this.mainStack.showSection(1);this.mainStack.showSection(2);this.mainStack.showSection(3);this.mainStack.hideSection(4);this.mockEditor.hide();this.$206a=false;var _1=this.session.standardizeMockDataSource(_1.ID);this.$31u(_1,true);this.originalSampleData=_1.cacheData;this.$210n(_1.fields,_1.cacheData);this.editWithFieldsButton.hide()}
,isc.A.getUniqueDataSourceID=function isc_DataSourceEditor_getUniqueDataSourceID(_1){_1("newDataSource")}
,isc.A.$31u=function isc_DataSourceEditor__startEditing(_1,_2){if(this.mainEditor)this.mainEditor.setValues(_1);else this.mainEditorValues=_1;if(!this.$206a){this.bindFields(_1)}
if(this.opBindingsEditor){if(_1){var _3=_1.operationBindings;if(_3&&_3.length>0){var _4={};var _5=["fetch","add","update","remove"];for(var i=0;i<_3.length;i++){var _7=_3[i];if(_7.operationType&&_5.contains(_7.operationType)&&!_7.operationId)
{var _8=_7.requiresRole;if(_7.requires=="false"){_8="false"}
_4[_7.operationType+"RequiresRole"]=_8}
}
this.opBindingsEditor.setValues(_4)}
}
}
if(this.mockEditor){this.mockEditor.setValue("ID",_1.ID);if(_1.mockData){var _9=_1.mockData;if(!_1.mockDataFormat||_1.mockDataFormat=="mock"){_9=_9.replace(/\\/g,"\\").replace(/^\[(.*)\]$/m,"{$1}")}
this.mockEditor.setValue("edit",_9);this.mockEditor.setValue("mockDataFormat",_1.mockDataFormat);if(_1.mockDataPrimaryKey){this.mockEditor.setValue("addField",null);this.mockEditor.setValue("useField",true);this.mockEditor.setValue("fieldName",_1.mockDataPrimaryKey)}else{this.mockEditor.setValue("addField",true);this.mockEditor.setValue("useField",null)}
this.mockEditor.editDataChanged(_9)}
}
if(!_2){this.$250w=this.getDefaults();if(_1&&_1.cacheData&&!this.$250w.cacheData){this.$250x=true}
this.session.add(_1.ID,this.$250w,!this.$250v)}
this.fieldEditor.updateButtonStates();this.fieldEditor.updateIncludeFieldButtonState();this.updateTitleField();this.$250y=true}
,isc.A.bindFields=function isc_DataSourceEditor_bindFields(_1){var _2=this.fieldEditor;if(_2){var _3=_2.grid.getSelectedRecord();var _4=this.getAllFields(_1);if(this.autoAddPK&&!this.hasPrimaryKeyField(_4)){this.createUniqueIdField(_4)}
_2.grid.setEmptyMessage("No fields to show.");if(this.canEditChildSchema){this.setupIDs(_4,1,null);var _5=isc.Tree.create({modelType:"parent",childrenProperty:"fields",titleProperty:"name",idField:"id",nameProperty:"id",root:{id:0,name:"root"},data:_4
});_5.openAll();_2.setData(_5)}else{_2.setData(_4)}
if(this.canSelectPrimaryKey){_2.grid.showField("primaryKey")}else{_2.grid.hideField("primaryKey");_2.grid.getField("primaryKey").canHide=false}
if(_3){_2.grid.selectSingleRecord(_3)}
_2.targetDataSource=_1;_2.formLayout.hide();_2.gridLayout.show()}}
,isc.A.setupIDs=function isc_DataSourceEditor_setupIDs(_1,_2,_3){var _4=_2,_5,_6
;if(!_4)_4=1;for(var i=0;i<_1.length;i++){var _5=_1.get(i);_5.parentId=_3;_5.id=_4++;if(_5.fields){if(!isc.isAn.Array(_5.fields))_5.fields=isc.getValues(_5.fields);_4=this.setupIDs(_5.fields,_4,_5.id)}
}
return _4}
,isc.A.getAllFields=function isc_DataSourceEditor_getAllFields(_1){var _2=(_1&&_1.fields)||[];if(!isc.isAn.Array(_2))_2=isc.getValues(_2);var _3=isc.clone(_2);if(this.showInheritedFields){var _4=this.getParentFields(_1);if(_4&&_3){_3.addListAt(_4,0)}else if(_4){_3=_4}
}
return _3}
,isc.A.getParentFields=function isc_DataSourceEditor_getParentFields(_1){var _2=[];if(_1.inheritsFrom){var _3=this.session.getDataSourceDefaults(_1.inheritsFrom);if(_3){if(_3.fields){_2=isc.clone(_3.fields);_2.setProperty("$250z",_1.inheritsFrom)}
_2.addListAt(this.getParentFields(_3),0)}
}
return _2}
,isc.A.getFields=function isc_DataSourceEditor_getFields(_1){var _2;if(this.canEditChildSchema){var _3=this.fieldEditor.grid.data;_2=_3.getCleanNodeData(_3.getRoot(),true).fields;_2=this.getExtraCleanNodeData(_2)}else{_2=this.fieldEditor.getData()}
var _4=_2.findAll("$211y",true);if(_4)_2.removeList(_4);if(_1&&this.showInheritedFields){var _4=_2.filter(function(_8){return(_8.$250z!=null)});if(_4)_2.removeList(_4)}
_2.map(function(_8){delete _8.$250z});if(_2!=null){for(var i=0;i<_2.length;i++){var _6=_2[i];for(var _7 in _6){if(_6[_7]==null||_6[_7]==="")delete _6[_7]}
}
}
return _2}
,isc.A.getFieldType=function isc_DataSourceEditor_getFieldType(_1){var _2=_1.type;if(_1.includeFrom){var _3=_1.includeFrom.split(".");if(_3&&_3.length>=2){var _4=_3[_3.length-2],_5=_3[_3.length-1],_6=this.session.get(_4)
;if(_6){var _7=_6.getField(_5);if(_7){_2=_7.type}
}
}
}
return isc.SimpleType.getBaseType(_2)}
,isc.A.applyOpBindings=function isc_DataSourceEditor_applyOpBindings(_1){var _2=this.opBindingsEditor.getValues();var _3={};["fetch","add","update","remove"].map(function(_11){var _4=_2[_11+"RequiresRole"],_5=null
;if(_4=="false"){_5={requires:"false"}}else if(_4&&_4!="_any_"){if(isc.isAn.Array(_4)){_4=_4.join(",")}
_5={requiresRole:_4}}
if(_5)_3[_11]=_5});if(!_1.operationBindings)_1.operationBindings=[];var _6=_1.operationBindings;["fetch","add","update","remove"].map(function(_11){var _7=null,_8=_6.findAll("operationType",_11)
;if(_8){for(var i=0;i<_8.length;i++){if(!_8[i].operationId){_7=_8[i];break}
}
}
var _10=_3[_11];if(!_7&&!_10)return;if(_7&&!_10){if(_7.requires)delete _7.requires;if(_7.requiresRole)delete _7.requiresRole;if(isc.getKeys(_7).length==1)_1.operationBindings.remove(_7)}else if(!_7&&_10){_10.operationType=_11;_6.add(_10)}else{if(_7.requires&&!_10.requires)delete _7.requires;else if(_10.requires)_7.requires=_10.requires;if(_7.requiresRole&&!_10.requiresRole)delete _7.requiresRole;else if(_10.requiresRole)_7.requiresRole=_10.requiresRole;if(isc.getKeys(_7).length==1)_1.operationBindings.remove(_7)}
});if(_1.operationBindings.length==0)delete _1.operationBindings}
,isc.A.getDataSourceID=function isc_DataSourceEditor_getDataSourceID(){var _1=(this.mainEditor?this.mainEditor.getValue("ID"):null);if(this.dsClass=="MockDataSource"&&this.$206a){_1=this.mockEditor.getValue("ID")}
return _1}
,isc.A.getDatasourceData=function isc_DataSourceEditor_getDatasourceData(){var _1=this.dsClass||"DataSource",_2=isc.addProperties({},this.mainEditor?this.mainEditor.getValues():this.mainEditorValues
)
;if(!this.$206a){_2.fields=this.getFields(true)}
this.applyOpBindings(_2);if(this.editSampleData){var _3=this.getSampleData();_2.cacheData=_3}else if(_1=="MockDataSource"&&this.$206a){var _4=this.mockEditor.getValue("ID"),_5=this.mockEditor.getValue("edit")||"",_6=_2.mockDataType||"grid",_7=_2.mockDataFormat||"mock",_8=this.mockEditor.getValue("useField"),_9=_8&&this.mockEditor.getValue("fieldName")
;_2.ID=_4;_2.mockData=(_7!="mock"||_6=="tree"?_5.trim():_5.trim().replace(/\\/g,"\\").replace("{","[").replace("}","]"));if(_9){_2.mockDataPrimaryKey=_9}else{delete _2.mockDataPrimaryKey}
_2.fromServer=true;delete _2.cacheData;delete _2.fields}
return _2}
,isc.A.hasPrimaryKeyField=function isc_DataSourceEditor_hasPrimaryKeyField(_1){if(!_1)_1=this.getFields();var _2=_1.getProperty("primaryKey").or();if(!_2){var _3=this.getCurrentDataSource();if(_3){var _4=_3.getFields();for(var _5 in _4){var _6=_4[_5];if(_6.primaryKey&&!_1.find("name",_5)){_2=true;break}
}
}
}
return _2}
,isc.A.dataSourceIDChanged=function isc_DataSourceEditor_dataSourceIDChanged(_1,_2){this.pushEditsToSession();var _3=this.dataSourcePropertyChanged("ID",_1,_2);if(this.autoAddPK){var _4=this.getFields();if(_4){var _5=_4.find("name","uniqueId");if(!_5)_5=_4.find("name","internalId");if(_5&&_5.primaryKey){var _6=_2+"Id";if(!_4.find("name",_6)){var _7=this.fieldEditor,_8=_7.grid,_9=_8.getTotalRows()
;this.session.startChangeContext(_3);for(var _10=0;_10<_9;_10++){var _11=_8.getRecord(_10);if(_11&&_11.name==_5.name){var _12=_8.getFieldNum("name"),_13=(_8.getEditRow()==_10)
;if(!_13)_8.startEditing(_10,_12);_8.setEditValue(_10,_12,_6);if(!_13)_8.endEditing();break}
}
this.session.endChangeContext(_3)}
}
}
}}
,isc.A.dataSourcePropertyChanged=function isc_DataSourceEditor_dataSourcePropertyChanged(_1,_2,_3){var _4=this.mainEditor.getValue("ID");return this.session.addChange(_4,"changeProperty",{property:_1,originalValue:_2,newValue:_3
})}
,isc.A.updateTitleField=function isc_DataSourceEditor_updateTitleField(_1,_2){if(this.$206a){return}
var _3=this.mainEditor.getField("titleField");if(!_3)return;var _4=this.getFieldsDS(this.getFields()),_5=this.mainEditor.getValue("ID"),_6=_4.ID
;_4.ID=_5;var _7=_4.getTitleField(),_8=(_7?"default: <i>"+_7+"</i>":"[None]"),_9=_4.getFieldNames(),_10=[]
;_4.ID=_6;for(var i=0;i<_9.length;i++){var _12=_4.getField(_9[i]);if(!_12.type||_12.type=="text"||_12.type=="enum"){_10.add(_12.name)}
}
_10.sort();var _13=_3.getValue();if(_13&&!_10.contains(_13)){if(_13==_1){_3.setValue(_2)}else{_3.clearValue()}
}
_3.emptyDisplayValue=_8;_3.setValueMap(_10)}
,isc.A.getFieldsDS=function isc_DataSourceEditor_getFieldsDS(_1){if(this.testDS)return this.testDS;if(this.$211z)this.$211z.destroy();var _2=isc.addProperties({},this.dsProperties,{clientOnly:true
});if(_1){if(!_1.find("primaryKey",true)){_1.addAt({name:"internalId",type:"sequence",primaryKey:true,hidden:true},0)}
_2.fields=isc.clone(_1)}
this.$211z=isc.DataSource.create(_2);return this.$211z}
,isc.A.getSampleData=function isc_DataSourceEditor_getSampleData(){var _1=this.dataGrid.getTotalRows();if(_1==0)return null;var _2=this.dataGrid,_3=[],_4=1+(_2.$221d?1:0)
;for(var i=0,_6=0;i<_1;i++){var _7=_2.getEditValues(i);if(!_2.recordMarkedAsRemoved(i)){if(!isc.isAn.emptyObject(_7)){var _8=(_7.$228t=="add"),_9=0;for(var _10 in _7){if(((_8&&_7[_10]!=null&&_7[_10]!="")||!_8)&&++_9>_4)
{_3[_6++]=_7;break}
}
}
}else{_7.$228t='remove';_3[_6++]=_7}
}
return _3}
,isc.A.renameSampleDataField=function isc_DataSourceEditor_renameSampleDataField(_1,_2,_3){_3=_3||this.getSampleData();if(_3){_3.forEach(function(_4){if(_4[_1]!=null){_4[_2]=_4[_1];delete _4[_1]}
})}
return _3}
,isc.A.revertDataChanges=function isc_DataSourceEditor_revertDataChanges(){this.$210o(this.originalSampleData)}
,isc.A.rebindSampleData=function isc_DataSourceEditor_rebindSampleData(){if(this.editSampleData){var _1=this.getFields(),_2=this.getSampleData()
;this.$210n(_1,_2)}}
,isc.A.$210n=function isc_DataSourceEditor__rebindSampleDataGrid(_1,_2,_3){if(this.isDrawn()&&this.isVisible()){isc.showPrompt((_3?"Loading":"Updating")+" sample data...")}
this.delayCall("$2329",arguments)}
,isc.A.$2329=function isc_DataSourceEditor___rebindSampleDataGrid(_1,_2){if(this.testDS)this.testDS.destroy();var _3=this;var _4=isc.addProperties({},this.dsProperties,{clientOnly:true,transformResponse:function(_12,_13,_14){if(_12.operationType=="fetch"){var _5=_3.getSampleData();_12.startRow=_13.startRow||0;_12.endRow=Math.min(_5.length,_13.endRow||0);_12.totalRows=_12.endRow-_12.startRow;_12.data=_5.slice(_13.startRow,_12.endRow)}
return _12}
});if(_1){if(!_1.find("primaryKey",true)){_1.addAt({name:"internalId",type:"sequence",primaryKey:true,hidden:true},0)}
for(var i=0;i<_1.length;i++){var _7=_1[i],_8=_7.validators||[];for(var j=0;j<_8.length;j++){var _10=_8[j];if(_10.type=="regexp"&&!isc.isA.String(_10.expression)){_10.expression=_10.expression.source}else if(_10.type=="mask"&&!isc.isA.String(_10.mask)){_10.mask=_10.mask.source}
delete _10.dynamicErrorMessageArguments}
}
_4.fields=isc.clone(_1)}
this.testDS=isc.DataSource.create(_4);this.dataGrid.setDataSource(this.testDS);this.$210o(_2,this.testDS.getID());if(this.$250x){delete this.$250x;var _11=this.getDefaults();this.$250w=_11;this.session.set(_11.ID,_11,true)}
isc.clearPrompt()}
,isc.A.$210o=function isc_DataSourceEditor__setDataGridData(_1,_2){var _3=this.dataGrid;if(_1!=null){_3.dataSource.resolveClientOnlyIncludeFrom(_1,_2)}
var _4=_3.getDataSource().getPrimaryKeyField();if(_4&&_4.type=="sequence"){_3.$221d=_4.name;_3.$221e=1}else{delete _3.$221d;delete _3.$221e}
_3.discardAllEdits();if(_1&&_1.length>0){var _5=_3.$221d,_6=-1
;if(_5){for(var i=0;i<_1.length;i++){var _8=_1[i],_9=_8[_5]
;if(_9!=null){if(!isc.isA.String(_9)&&_9>_6){_6=_9}
}
}
_3.$221e=_6+1}
for(var i=0;i<_1.length;i++){var _8=_1[i];if(_5&&_8[_5]==null){_8[_5]=_3.$221e++}
_3.startEditingNew(_8,true)}
_3.startEditing(0)}else{_3.startEditingNew()}}
,isc.A.editFieldLegalValues=function isc_DataSourceEditor_editFieldLegalValues(_1){var _2={title:"Define the allowed values for "+_1.name
}
var _3=this.createAutoChild("legalValuesWindow",_2);var _4={values:{values:_1.valueMap}
};this.legalValuesForm=this.createAutoChild("legalValuesForm",_4);var _5={window:_3,editor:this.legalValuesForm,saveLegalValues:function(){if(this.editor.validate()){var _6=this.editor.getValue("values");_1.valueMap=_6;this.window.markForDestroy();this.editor.creator.rebindSampleData()}
}
};this.legalValuesToolbar=this.createAutoChild("legalValuesToolbar",_5);_3.addItem(this.legalValuesForm);_3.addItem(this.legalValuesToolbar);_3.show()}
,isc.A.editDerivedValue=function isc_DataSourceEditor_editDerivedValue(_1){var _2=(_1.type||"string").toLowerCase(),_3=["textFormula","formula","conditional"],_4=null,_5=null,_6=null,_7="formula or template"
;if(_2=="integer"||_2=="long"||_2=="float"||_2=="number")
{_4="formula";_7="formula"}else if(_2=="enum"){_3=["textFormula","formula","conditional"];_7="formula or template"}else if(_2=="date"||_2=="datetime"||_2=="time"){_4="textFormula";_7="template"}
var _8={title:"Define a "+_7+" for "+_1.name
}
var _9=this.createAutoChild("derivedValueWindow",_8);var _10=this.createAutoChild("derivedValueEditor",{dataSource:this.getCurrentDataSource(),valueTypes:_3,fixedType:_4,itemEditorConstructor:_5,valueMap:_6,fireOnClose:function(){var _11=_10.creator;if(!_10.cancelled){var _12=_11.fieldEditor.grid.data,_13=(isc.isA.Tree(_12)?_12.getCleanNodeData(_1):_1);delete _1.formula;delete _1.template;delete _1.valueFrom;if(_10.isSimpleFormula()){_1.formula=_10.getSimpleFormula()}else if(_10.isSimpleSummary()){_1.template=_10.getSimpleSummary()}else if(_10.isConditional()){_1.valueFrom=_10.getConditional()}
_11.saveFieldChanges(["formula","template","valueFrom"],_13,_1)
}
_9.markForDestroy();if(!_10.cancelled){_11.rebindSampleData()}
}
});if(_1.formula){_10.setSimpleFormula(_1.formula)}else if(_1.template){_10.setSimpleSummary(_1.template)}else if(_1.valueFrom){_10.setConditional(_1.valueFrom)}
_9.addItem(_10);_9.show()}
,isc.A.editFieldValidators=function isc_DataSourceEditor_editFieldValidators(_1){var _2=this.getDatasourceData();var _3=_2.ID;delete _2.ID;_2.fields=isc.clone(_2.fields);var _4=this.createLiveDSInstance(_2);var _5=_2.fields.find("name",_1.name),_6=_5&&_5.validators||_1.validators
;var _7={title:"Validators for "+_1.name,dataSource:_4
}
var _8=this.createAutoChild("validatorsWindow",_7);var _9={fieldName:_1.name,dataSource:_4,validators:_6
};this.validatorsLayout=this.createAutoChild("validatorsLayout",_9);var _10={window:_8,editor:this.validatorsLayout,saveValidators:function(){if(this.editor.validate()){var _6=this.editor.getValidators(true),_11=_1.validators
;_1.validators=_6;this.window.markForDestroy();this.editor.creator.session.addChange(_3,"changeFieldProperty",{fieldName:_1.name,property:"validators",originalValue:_11,newValue:_6
});this.editor.creator.rebindSampleData()}
}
};this.validatorsToolbar=this.createAutoChild("validatorsToolbar",_10);_8.addItem(this.validatorsLayout);_8.addItem(this.validatorsToolbar);_8.show()}
,isc.A.editFieldSecurity=function isc_DataSourceEditor_editFieldSecurity(_1){if(!this.securityEditor){var _2={title:"Edit security settings for field "+_1.name
};this.securityWindow=this.createAutoChild("securityWindow",_2);this.securityEditor=this.createAutoChild("securityEditor");this.securityWindow.addItem(this.securityEditor)}
var _3=this;var _4=isc.shallowClone(_1);this.securityEditor.edit(_1,function(_5){_3.securityWindow.hide();if(_5.viewRequires)_1.viewRequires=_5.viewRequires;else if(_1.viewRequires)delete _1.viewRequires;if(_5.viewRequiresRole)_1.viewRequiresRole=_5.viewRequiresRole;else if(_1.viewRequiresRole)delete _1.viewRequiresRole;if(_5.editRequires)_1.editRequires=_5.editRequires;else if(_1.editRequires)delete _1.editRequires;if(_5.editRequiresRole)_1.editRequiresRole=_5.editRequiresRole;else if(_1.editRequiresRole)delete _1.editRequiresRole;if(_4.viewRequires!=_1.viewRequires||_4.viewRequiresRole!=_1.viewRequiresRole||_4.editRequires!=_1.editRequires||_4.editRequiresRole!=_1.editRequiresRole)
{_3.saveFieldChanges(["viewRequires","viewRequiresRole","editRequires","editRequiresRole"],_4,_1);_3.rebindSampleData()}
});this.securityWindow.show()}
,isc.A.editRelations=function isc_DataSourceEditor_editRelations(_1){var _2=this;this.validateForSave(function(_5){_2.pushEditsToSession(_5);if(!_2.relationEditor){var _3={title:"Relations for DataSource '"+_5.ID+"'"
}
_2.relationEditorWindow=_2.createAutoChild("relationEditorWindow",_3);_2.relationEditor=_2.createAutoChild("relationEditor",{dsEditor:_2,dsDataSource:_2.dsDataSource,ownerId:_2.ownerId,session:_2.session,readOnly:_2.readOnly
});_2.relationEditorWindow.addItem(_2.relationEditor)}else{_2.relationEditorWindow.setTitle("Relations for DataSource '"+_5.ID+"'")}
var _4=_2.getCurrentDataSource();_2.relationEditor.edit(_4,_1);_2.relationEditorWindow.show()})}
,isc.A.getFieldNames=function isc_DataSourceEditor_getFieldNames(_1){var _2=this;return _1.map(function(_3){return _2.getFieldName(_3)})}
,isc.A.getFieldName=function isc_DataSourceEditor_getFieldName(_1){if(_1.name)return _1.name;var _2=_1.includeFrom,_3=_2&&_2.split(".")
;return _3&&_3[_3.length-1]}
,isc.A.findField=function isc_DataSourceEditor_findField(_1,_2){for(var i=0;i<_1.length;i++){var _4=_1[i],_5=this.getFieldName(_4)
;if(_5==_2){return _4}
}}
,isc.A.editIncludeField=function isc_DataSourceEditor_editIncludeField(_1){if(!this.includeFieldEditor){this.includeFieldEditorWindow=this.createAutoChild("includeFieldEditorWindow");this.includeFieldEditor=this.createAutoChild("includeFieldEditor",{dsDataSource:this.dsDataSource,ownerId:this.ownerId
});this.includeFieldEditorWindow.addItem(this.includeFieldEditor)}
var _2=this.mainEditor.getValue("ID"),_3=this.session.getRelations(),_4=_3.getAllRelationsForDataSource(_2),_5=isc.DSRelations.relationTypeDescriptionMap
;var _6={};_4.map(function(_9){_6[_2]=_9.dsId+" ("+_5[_9.type]+")"});var _7=this.session.get(_2);var _8=this;this.includeFieldEditor.edit(_7,_4,function(_9){_8.includeFieldEditorWindow.hide();_8.fieldEditor.newRecord(_9);if(_8.includeFieldEditorWindow.dropDS){_8.includeFieldEditorWindow.dropDS.destroy()}
},_1);this.includeFieldEditorWindow.show()}
,isc.A.editFormatting=function isc_DataSourceEditor_editFormatting(_1){var _2=this.getFieldType(_1),_3=_1.type=="datetime"?_1.type:_2,_4=_2=="date"||_2=="time",_5;if(this.formatEditor==null){_5=true}else if(_4&&isc.isA.NumberFormatEditor(this.formatEditor)||!_4&&isc.isA.DatetimeFormatEditor(this.formatEditor))
{this.formatEditor.destroy();_5=true}else if(_4&&_3!=this.formatEditor.getActualDataType()){this.formatEditor.destroy();_5=true}
if(_5){var _6={_constructor:_2=="date"||_2=="time"?"DatetimeFormatEditor":"NumberFormatEditor"
}
this.formatWindow=this.createAutoChild("formatWindow");this.formatEditor=this.createAutoChild("formatEditor",_6);this.formatWindow.addItem(this.formatEditor)}
this.formatWindow.setTitle("Edit formatting for "+_1.name);var _7=this;this.formatEditor.edit(_1,_3,function(_9){_7.formatWindow.hide();var _8=_7.fieldEditor.grid.data.getCleanNodeData(_1);if(_9.format)_1.format=_9.format;else if(_1.format)delete _1.format;_7.saveFieldChanges("format",_8,_1);_7.fieldEditor.updateButtonStates(_1);_7.rebindSampleData()},function(){_7.formatWindow.hide()});this.formatWindow.show()}
,isc.A.moveField=function isc_DataSourceEditor_moveField(_1,_2){var _3=this.fieldEditor.grid,_4=_3.data,_5=_4.getParent(_1),_6=_4.findNodeIndex(_1),_7=_4.getChildren(_5).length,_8=Math.min(Math.max(0,_6+_2),_7)
;if(_8!=_6){var _9=_3.getRecordIndex(_1),_10=_3.getEditRow()
;if(_10!=null&&_10==_9){var _11="The field to be moved is has pending edits.<br>Save them now?";isc.warn(_11,function(_12){if(_12){_3.endEditing();_4.move(_1,_5,_8)}
},{buttons:[isc.Dialog.CANCEL,isc.Dialog.OK
]
})}else{_4.move(_1,_5,_8)}
}}
,isc.A.saveFieldChanges=function isc_DataSourceEditor_saveFieldChanges(_1,_2,_3){_1=(isc.isAn.Array(_1)?_1:[_1]);var _4=this.session,_5=this.getDataSourceID(),_6=_2.name,_7;for(var i=0;i<_1.length;i++){var _9=_1[i],_10=_2[_9],_11=_3[_9],_12=null
;if(_10!=_11){if(_9=="name"){_12=_4.addChange(_5,"changeFieldName",{fieldName:_10,newName:_11
})}else if(_9=="type"||_9=="length"){}else{_12=_4.addChange(_5,"changeFieldProperty",{fieldName:_6,property:_9,originalValue:_10,newValue:_11
})}
if(!_7&&_12){_7=_12;_4.startChangeContext(_7)}
}
}
if(_7)_4.endChangeContext(_7)}
,isc.A.createLiveDSInstance=function isc_DataSourceEditor_createLiveDSInstance(_1){var _2=this.dsClass||_1._constructor||"DataSource",_3;if(isc.DS.isRegistered(_2)){_3=isc.DS.get(_2)}else{_3=isc.DS.get("DataSource");_1._constructor=_2}
var _4=isc.ClassFactory.getClass(_2).create(_1);return _4}
,isc.A.cancelClick=function isc_DataSourceEditor_cancelClick(){if(this.editComplete){if(this.$2502){this.session.clearChangeLog()}
this.editComplete(true)}}
,isc.A.saveClick=function isc_DataSourceEditor_saveClick(){if(!this.validate())return false;var _1=this,_2=this.session
;if(this.editSampleData){_1.dataGrid.endEditing()}
this.validateForSave(function(_4){_1.pushEditsToSession(_4);var _3=(_2.getAddedDataSources().length==0&&_2.getUpdatedDataSources().length==0&&isc.isAn.emptyObject(_2.getRenamedDataSources()));if(_1.editComplete){_1.editComplete(_3)}
})}
,isc.A.validate=function isc_DataSourceEditor_validate(){var _1=true;if(this.showMainEditor!=false){_1=this.mainEditor.validate()}else if(this.showMockEditor!=false){_1=this.mockEditor.validate()}
var _2=this.fieldEditor;return(_2.validate()&&_1)}
,isc.A.validateForSave=function isc_DataSourceEditor_validateForSave(_1){var _2=this,_3=this.getDefaults()
;if(this.validate()){_2.verifyOverwrite(_3,function(){_2.verifyUniqueTableName(_3,function(){_2.warnOnRename(_3,function(){_1(_3)})})})}}
,isc.A.pushEditsToSession=function isc_DataSourceEditor_pushEditsToSession(_1){_1=_1||this.getDefaults();if(!_1){return false}
var _2=(_1.ID!=this.$250t),_3=this.session.getDataSourceDefaults(_1.ID)
;if(_2){this.session.add(_1.ID,_1,!this.$250v,this.$250t);this.session.delete(this.$250t)}else if(!_3){this.session.add(_1.ID,_1,!this.$250v)}else{this.session.set(_1.ID,_1)}
return _1}
,isc.A.save=function isc_DataSourceEditor_save(_1){if(!this.$250y){this.delayCall("save",[_1],250);return}
if(this.editSampleData){this.dataGrid.endEditing()}
if(!this.validate()){return false}
this.pushEditsToSession();this.session.saveChanges(_1,{target:this,methodName:"dataSourceSaved"})}
,isc.A.getFieldRenames=function isc_DataSourceEditor_getFieldRenames(_1){return this.session.getRenamedFields(_1)}
,isc.A.getFieldAdds=function isc_DataSourceEditor_getFieldAdds(_1){return this.session.getAddedFields(_1)}
,isc.A.getFieldDeletes=function isc_DataSourceEditor_getFieldDeletes(_1){return this.session.getRemovedFields(_1)}
,isc.A.getCurrentDataSourceID=function isc_DataSourceEditor_getCurrentDataSourceID(){return this.mainEditor.getValue("ID")}
,isc.A.getCurrentDataSource=function isc_DataSourceEditor_getCurrentDataSource(){return this.session.get(this.getCurrentDataSourceID())}
,isc.A.getDefaults=function isc_DataSourceEditor_getDefaults(_1){if(_1){return this.session.getDataSourceDefaults(_1)}
var _2=this.fieldEditor;if(_2.isVisible()){_2.saveRecord()}
var _3=this.getDatasourceData();if(_2.isVisible()){var _4=this.getAllFields(_3),_5=this.hasPrimaryKeyField(_4)
;if(!_5){if(this.autoAddPK){this.createUniqueIdField(_3.fields)}else if(this.requirePK){isc.warn("DataSource must have a field marked as the primary key");return null}else if(_3.serverType=="sql"||_3.serverType=="hibernate"){isc.warn("SQL / Hibernate DataSources must have a field marked as the primary key");return null}
}
}
["recordXPath","dataURL","dbName","schema","tableName","quoteTableName","beanClassName","dropExtraFields","autoDeriveSchema"].map(function(_16){if(_3[_16]==null)delete _3[_16]});if(_3._constructor=="DatabaseBrowser")delete _3._constructor;if(_3.cacheData){var _6=_3.fields;for(var i=0;i<_6.length;i++){var _8=_6[i];if(_8.includeFrom){_3.cacheData.map(function(_16,_17,_18){delete _16[_8.name]
})}
}
}
if(this.editSampleData){var _9=this.session.createTempLiveDSInstance(_3),_10=_3.cacheData||[]
;_9.includeFromValuesProvided=true;var _11=this.session;isc.DS.addClassMethods({$2500:isc.DS.getDataSource,getDataSource:function(_1,_16,_17,_18){var _12=this.$2501;this.$2501=true;var _9=(_12?this.$2500(_1):_11.get(_1));delete this.$2501;return _9}
});for(var i=0;i<_10.length;i++){var _13=_10[i],_14=_13.$228t
;switch(_14){case"remove":_9.getClientOnlyResponse({operationType:'remove',data:_13});break;case"update":_9.getClientOnlyResponse({operationType:'update',data:_13});break;default:var _15=_9.getClientOnlyResponse({operationType:'add',data:_13,clientOnlyDataModified:true});if(_15.status==0){_9.cacheData[i]=_15.data}
break}
}
_3.cacheData=_9.cacheData;isc.DS.addClassMethods({getDataSource:isc.DS.$2500,$2500:null
});_9.destroy()}
return _3}
);isc.evalBoundary;isc.B.push(isc.A.verifyOverwrite=function isc_DataSourceEditor_verifyOverwrite(_1,_2){if((this.$250t!=null&&this.$250t==_1.ID)||this.readOnly){if(_2)_2();return true}
var _3=_1.ID;this.session.hasDataSourceXml(_3,function(_4){if(!_4){if(_2)_2();return}
isc.warn("DataSource name '"+_3+"' is already in use. Overwrite the existing DataSource?",function(_5){if(_5&&_2)_2()},{buttons:[isc.Dialog.CANCEL,{title:"Overwrite",width:75,overflow:"visible",click:function(){this.topElement.okClick()}
}
],autoFocusButton:1
})})}
,isc.A.warnOnRename=function isc_DataSourceEditor_warnOnRename(_1,_2){if(!this.$250v&&this.showWarningOnRename&&this.$250t!=null&&this.$250t!=_1.ID&&!this.readOnly)
{isc.warn(this.renameWarningMessage,function(_3){if(_3){if(_2)_2(_1)}
},{buttons:[isc.Dialog.CANCEL,isc.Dialog.OK
]
})}else{if(_2)_2(_1)}}
,isc.A.verifyUniqueTableName=function isc_DataSourceEditor_verifyUniqueTableName(_1,_2,_3){var _4=(this.$250w?this.$250w.tableName||this.$250t:null),_5=(_1.tableName||_1.ID)+(_3!=null?"_"+_3:""),_6=this
;if(!this.makeUniqueTableName||this.readOnly){if(_2)_2(_1);return}
if(_4&&_4==_5){if(_2)_2(_1);return}
isc.DMI.call({appID:"isc_builtin",className:"com.isomorphic.tools.AdminConsole",methodName:"tableExists",arguments:[_5,null],callback:function(_8,_9){if(_9){var _7=_3||-1;_6.verifyUniqueTableName(_1,_2,_7+1)}else{if(_3!=null)_1.tableName=_5;if(_2)_2(_1)}
}
})}
,isc.A.createUniqueIdField=function isc_DataSourceEditor_createUniqueIdField(_1){_1.addAt({name:"uniqueId",type:"sequence",primaryKey:true,hidden:true},0)}
,isc.A.getExtraCleanNodeData=function isc_DataSourceEditor_getExtraCleanNodeData(_1,_2){if(_1==null)return null;var _3=[],_4=false;if(!isc.isAn.Array(_1)){_1=[_1];_4=true}
for(var i=0;i<_1.length;i++){var _6=_1[i],_7={};for(var _8 in _6){if(_8=="id"||_8=="parentId"||_8=="isFolder")continue;_7[_8]=_6[_8];if(_8==this.fieldEditor.grid.data.childrenProperty&&isc.isAn.Array(_7[_8])){_7[_8]=this.getExtraCleanNodeData(_7[_8])}
}
_3.add(_7)}
if(_4)return _3[0];return _3}
,isc.A.clear=function isc_DataSourceEditor_clear(){if(this.mainEditor)this.mainEditor.clearValues();else this.mainEditorValues=null;this.fieldEditor.setData([])}
,isc.A.hasPendingChanges=function isc_DataSourceEditor_hasPendingChanges(_1){var _2=this.session,_3=false
;if(_1){_3=(_2.getAddedDataSources().contains(_1)||_2.getUpdatedDataSources().contains||_2.getRenamedDataSources()[_1]!=null)}else{_3=(_2.getAddedDataSources().length>0||_2.getUpdatedDataSources().length>0||!isc.isAn.emptyObject(_2.getRenamedDataSources()))}
return _3}
,isc.A.hasPrimaryKeyChanged=function isc_DataSourceEditor_hasPrimaryKeyChanged(){return(this.fieldEditor.grid.$228q!=null)}
,isc.A.openDataSource=function isc_DataSourceEditor_openDataSource(_1){var _2=this,_3=this.session
;this.validateForSave(function(_5){_2.pushEditsToSession(_5);var _4=_3.get(_1),_5=_3.getDataSourceDefaults(_1)
;if(_2.navigateToDataSource){_2.navigateToDataSource(_1,_4,_5)}
})}
,isc.A.navigateToDataSource=function isc_DataSourceEditor_navigateToDataSource(_1,_2,_3){this.editSaved(_3)}
,isc.A.initWidget=function isc_DataSourceEditor_initWidget(){this.Super('initWidget',arguments);this.addAutoChild("mainTabSet",{visibility:"hidden"});this.mainStack=this.createAutoChild("mainStack");this.instructions=this.createAutoChild("instructions");var _1=this.createAutoChild("sampleDataLabel");this.dataGrid=this.createAutoChild("sampleDataGrid");var _2=this.createAutoChild("sampleDataAddRecordButton");var _3=this.createAutoChild("sampleDataDiscardDataButton");var _4=this.createAutoChild("sampleDataButtonLayout",{members:[_2,_3]
});this.dataPane=this.createAutoChild("sampleDataPane",{members:[_1,this.dataGrid,_4]});this.mainTabSet.addTab({name:"fields",title:"DataSource Fields"
});this.mainTabSet.addTab({name:"sampleData",title:"Sample Data",pane:this.dataPane,tabSelected:function(_9,_10,_11,_12,_13,_14){var _5=_11.getMember(1),_6=_5.getEditRow()
;if(_6>=0&&_5.getEditRow()!=_6){isc.Timer.setTimeout(function(){_5.startEditing(_6)})}
}
});if(this.editSampleData){this.mainTabSet.setTabPane("fields",this.mainStack);this.mainTabSet.show()}else{this.addMember(this.mainStack)}
this.addAutoChild("mainEditor",{fields:isc.clone(this.mainEditorFields)});if(!this.canEditDataSourceID){this.mainEditor.getField("ID").setReadOnlyDisplay("static");this.mainEditor.getField("ID").setCanEdit(false)}
this.addAutoChild("opBindingsEditor");this.addAutoChild("mockEditor",{allowExplicitPKInSampleData:this.allowExplicitPKInSampleData});this.addAutoChild("buttonLayout");this.addTestDataButton=this.createAutoChild("addTestDataButton");this.editWithFieldsButton=this.createAutoChild("editWithFieldsButton");this.buttonLayout.addMember(this.addTestDataButton);this.buttonLayout.addMember(this.editWithFieldsButton);this.buttonLayout.addMember(isc.LayoutSpacer.create({width:20}));this.buttonLayout.addMember(this.createAutoChild("cancelButton"));this.buttonLayout.addMember(this.createAutoChild("saveButton"));if(!this.showActionButtons){this.buttonLayout.hide()}
if(this.dsDataSource)this.dsDataSource=isc.DataSource.get(this.dsDataSource);if(this.canAddChildSchema){this.canEditChildSchema=true;this.addAutoChild("addChildButton")}
this.legalValuesButton=this.createAutoChild("legalValuesButton",{visibility:(this.showLegalValuesButton?"inherit":"hidden")
});this.derivedValueButton=this.createAutoChild("derivedValueButton",{visibility:(this.showDerivedValueButton?"inherit":"hidden")
});this.validatorsButton=this.createAutoChild("validatorsButton");this.formattingButton=this.createAutoChild("formattingButton");this.securityButton=this.createAutoChild("securityButton");if(this.enableRelationEditor){this.relationsButton=this.createAutoChild("relationsButton")}
if(this.showIncludeFromButton){this.includeFieldButton=this.createAutoChild("includeFieldButton")}
this.reorderButtonLayout=this.createAutoChild("reorderButtonLayout");this.reorderUpButton=this.createAutoChild("reorderUpButton");this.reorderDownButton=this.createAutoChild("reorderDownButton");this.reorderButtonLayout.addMembers([this.reorderUpButton,this.reorderDownButton]);this.addAutoChild("fieldEditor",{fields:isc.clone(this.fieldEditorGridFields),formFields:isc.clone(this.fieldEditorFormFields),formConstructor:isc.TComponentEditor||isc.ComponentEditor,gridConstructor:this.canEditChildSchema?isc.TreeGrid:isc.ListGrid,showMoreButton:this.showMoreButton,newButtonTitle:"New Field",newButtonDefaults:this.newButtonDefaults,newButtonProperties:this.newButtonProperties,moreButtonDefaults:this.moreButtonDefaults,moreButtonProperties:this.moreButtonProperties,autoAssignNewFieldName:false
});this.moreButton=this.fieldEditor.moreButton;this.newButton=this.fieldEditor.newButton;this.fieldEditor.gridButtons.addMembers([this.legalValuesButton,this.derivedValueButton,this.validatorsButton,this.formattingButton,this.securityButton]);if(this.canAddChildSchema)this.fieldEditor.gridButtons.addMember(this.addChildButton);this.fieldEditor.gridButtons.addMembers([isc.LayoutSpacer.create({height:15}),this.relationsButton,this.includeFieldButton]);if(this.canAddChildSchema)this.fieldEditor.gridButtons.addMember(this.addChildButton);this.fieldEditor.gridButtons.addMembers([isc.LayoutSpacer.create(),this.reorderButtonLayout,isc.LayoutSpacer.create()]);var _7=this.mainStack;_7.addSections([isc.addProperties(this.instructionsSectionDefaults,this.instructionsSectionProperties,{items:[this.instructions]}
)]);_7.addSections([isc.addProperties(this.mainSectionDefaults,this.mainSectionProperties,{items:[this.mainEditor]}
)]);if(this.showMainEditor==false)_7.hideSection(1);_7.addSections([isc.addProperties(this.fieldSectionDefaults,this.fieldSectionProperties,{items:[this.fieldEditor]}
)]);_7.addSections([isc.addProperties(this.opBindingsSectionDefaults,this.opBindingsSectionProperties,{items:[this.opBindingsEditor]}
)]);_7.addSections([isc.addProperties(this.mockSectionDefaults,this.mockSectionProperties,{items:[this.mockEditor]}
)]);var _8=this;this.deriveForm=this.createAutoChild("deriveForm",{fields:[{name:"sql",showTitle:false,formItemType:"AutoFitTextAreaItem",width:"*",height:40,colSpan:"*",keyPress:function(_9,_10,_11){if(_11=='Enter'&&isc.EH.ctrlKeyDown()){if(isc.Browser.isSafari)_9.setValue(_9.getElementValue());_8.execSQL();if(isc.Browser.isSafari)return false}
}},{type:"button",title:"Execute",startRow:true,click:this.getID()+".execSQL()"}
]
});if(!this.session){this.session=isc.DataSourceEditorSession.create({dsDataSource:this.dsDataSource,dataSources:this.knownDataSources,useLiveDataSources:this.useLiveDataSources,useChangeTracking:this.useChangeTracking
});this.$2502=true}
this.registerChangeObservations()}
,isc.A.destroy=function isc_DataSourceEditor_destroy(){if(this.testDS)this.testDS.destroy();if(this.$211z)this.$211z.destroy();if(this.session&&this.$2502)this.session.destroy();this.unregisterChangeObservations();this.Super("destroy",arguments)}
,isc.A.registerChangeObservations=function isc_DataSourceEditor_registerChangeObservations(){this.mainEditor.addMethods({itemChange:function(_4,_5,_6){var _1=this.creator;if(_4.name=="ID"){_1.fireCallback(_1.dataSourceChanged,"name",[null])}else{var _2=this.getValue("ID");if(!_1.hasPendingChanges(_2)){_1.fireCallback(_1.dataSourceChanged,"name",[null])}
}
}
});var _1=this;this.observe(this.session,"dataSourceChanged",function(_2){var _3=_1.mainEditor.getValue("ID");if(_3==_2)_2=null;_1.fireCallback(_1.dataSourceChanged,"name",[_2])})}
,isc.A.unregisterChangeObservations=function isc_DataSourceEditor_unregisterChangeObservations(){if(this.isObserving(this.session,"dataSourceChanged")){this.ignore(this.session,"dataSourceChanged")}}
,isc.A.execSQL=function isc_DataSourceEditor_execSQL(){var _1=this.deriveForm.getValue("sql");if(_1){_1=_1.trim().replace(/(.*);+/,"$1");var _2=isc.DataSource.get("DataSourceStore");_2.performCustomOperation("dsFromSQL",{dbName:this.mainEditor.getValue("dbName"),sql:_1},this.getID()+".deriveDSLoaded(data)")}}
,isc.A.deriveDSLoaded=function isc_DataSourceEditor_deriveDSLoaded(_1){var _2=_1.ds;this.dsLoaded(_1.ds)}
,isc.A.dsLoaded=function isc_DataSourceEditor_dsLoaded(_1){var _2=isc.DataSource.create(_1);this.currentDS=_2;this.deriveFields(_2);this.previewGrid.setDataSource(_2)}
,isc.A.deriveFields=function isc_DataSourceEditor_deriveFields(_1){var _2=_1.getFieldNames();var _3=[];for(var i=0;i<_2.length;i++){var _5=_2[i]
var _6={};var _7=_1.getField(_5);for(var _8 in _7){if(isc.isA.String(_8)&&_8.startsWith("_"))continue;_6[_8]=_7[_8]}
_3.add(_6)}
var _9=isc.Tree.create({modelType:"parent",childrenProperty:"fields",titleProperty:"name",idField:"id",nameProperty:"id",root:{id:0,name:"root"},data:_3
});this.fieldEditor.setData(_9)}
);isc.B._maxIndex=isc.C+78;isc.DataSourceEditor.registerStringMethods({editComplete:"canceled",dataSourceSaved:"name,ds,isNew,originalName",dataSourceChanged:"name"});isc.defineClass("ParsedDataDSEditor","VLayout");isc.A=isc.ParsedDataDSEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.instructions="Edit detected fields and observe results for imported data";isc.A.instructionsFlowDefaults={_constructor:isc.HTMLFlow,width:"100%",height:35,padding:10,visibility:"hidden"
};isc.A.tabSetDefaults={_constructor:isc.TabSet,width:"100%",height:"*",tabs:[{title:"Edit Fields"},{title:"View Data",pane:"autoChild:viewDataPane"}
]
};isc.A.buttonLayoutDefaults={_constructor:"HLayout",height:42,layoutMargin:10,membersMargin:10,align:"right"
};isc.A.cancelButtonDefaults={_constructor:"IButton",autoDraw:false,title:"Cancel",width:100,autoParent:"buttonLayout",click:function(){this.creator.editorPane.cancelClick()}
};isc.A.saveButtonDefaults={_constructor:"IButton",autoDraw:false,title:"Save",width:100,autoParent:"buttonLayout",click:function(){this.creator.editorPane.saveClick()}
};isc.A.dsEditorPaneDefaults={_constructor:isc.DataSourceEditor,width:"100%",height:"100%",canAddChildSchema:false,canEditChildSchema:false,showActionButtons:false,mainStackProperties:{_constructor:"TSectionStack"
},mainEditorProperties:{_constructor:"TComponentEditor",formConstructor:isc.TComponentEditor
},fieldLayoutProperties:{_constructor:"TLayout"
},editComplete:function(_1){this.fireCallback(this.creator.editComplete,"canceled",arguments)},dataSourceSaved:function(_1,_2,_3,_4){this.fireCallback(this.creator.dataSourceSaved,"name, ds, isNew, renamedFrom",arguments)}
};isc.A.viewDataPaneDefaults={_constructor:isc.SectionStack,width:"100%",height:"100%",visibilityMode:"multiple",sections:[{name:"records",title:"Records",showHeader:false,expanded:true,items:["autoChild:dataViewer"]
},{name:"errors",title:"Warnings/Errors",items:["autoChild:errorViewer"]
}
]
};isc.A.dataViewerDefaults={_constructor:isc.ListGrid,width:"100%",height:"100%"
};isc.A.errorViewerDefaults={_constructor:isc.ListGrid,width:"100%",autoFitData:"vertical",autoFitMaxRecords:10,defaultFields:[{name:"fieldName",title:"Field",width:200},{name:"message",title:"Message",width:"*"}
]
};isc.B.push(isc.A.setInstructions=function isc_ParsedDataDSEditor_setInstructions(_1){if(_1){this.instructionsFlow.setContents(_1)}else{this.instructionsFlow.hide()}
}
);isc.B._maxIndex=isc.C+1;isc.A=isc.ParsedDataDSEditor.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_ParsedDataDSEditor_initWidget(){this.Super("initWidget",arguments);this.addAutoChild("instructionsFlow",{contents:this.instructions,visibility:(this.instructions?"inherit":"hidden")
});this.addAutoChild("tabSet");this.addAutoChild("buttonLayout");this.addAutoChild("cancelButton");this.addAutoChild("saveButton");var _1=isc.addProperties({},this.dsEditorPaneProperties,{session:this.session
});if(this.getUniqueDataSourceID){_1.getUniqueDataSourceID=this.getUniqueDataSourceID}
this.editorPane=this.createAutoChild("dsEditorPane",_1);this.tabSet.setTabPane(0,this.editorPane);this.dataPane=this.createAutoChild("viewDataPane");this.tabSet.setTabPane(1,this.dataPane);if(!this.fileType){this.logWarn("fileType not specified. Defaulting to 'csv'");this.fileType="csv"}else if(this.fileType.toLowerCase()=="auto"){this.logWarn("fileType 'auto' is not supported. Defaulting to 'csv'");this.fileType="csv"}
}
,isc.A.editNew=function isc_ParsedDataDSEditor_editNew(_1){this.dsProperties=isc.addProperties({},_1.defaults);delete this.dsProperties.ID;var _2=this.guessedRecords,_3,_4
;if(!_2){this.$1993();var _5=this.parsedFields,_6=this.parsedData
;var _7=this.guesser;_7.fields=_5;_3=_7.extractFieldsFrom(_6);_2=_7.convertData(_6);_4=_7.parseDetails}
this.$1994(null,_2,_4);this.editorPane.editNew(_1)}
,isc.A.editSaved=function isc_ParsedDataDSEditor_editSaved(_1){this.logWarn("editSaved not supported")}
,isc.A.save=function isc_ParsedDataDSEditor_save(_1){this.editorPane.save(_1)}
,isc.A.validate=function isc_ParsedDataDSEditor_validate(){return this.editorPane.validate()}
,isc.A.validateForSave=function isc_ParsedDataDSEditor_validateForSave(_1){return this.editorPane.validateForSave(_1)}
,isc.A.getUniqueDataSourceID=function isc_ParsedDataDSEditor_getUniqueDataSourceID(_1){_1("newDataSource")}
,isc.A.$1993=function isc_ParsedDataDSEditor__createParserAndGuesser(){if(!this.parser){this.parser=isc.FileParser.create({hasHeaderLine:true})}
if(!this.parsedData||!this.parsedFields){var _1=this.parser,_2=this.fileType.toLowerCase(),_3=this.rawData
;if(_2=="json"||_2=="xml"){this.parsedData=_1.parseJsonData(_3)}else if(_2=="csv"){this.parsedData=_1.parseCsvData(_3)}
this.parsedFields=_1.getFields()}
if(!this.guesser){var _4=this.parser.getFields();this.guesser=isc.SchemaGuesser.create({fields:_4})}
}
,isc.A.fieldNameChanged=function isc_ParsedDataDSEditor_fieldNameChanged(_1,_2){this.$1993();var _3=this.parser,_4=this.fileType,_5=this.rawData,_6=_3.getFieldNames(),_7=_6.indexOf(_1)
;if(_7<0)return;_6[_7]=_2;this.parser.fieldNames=_6;var _8=this.parsedData;if(_4=="csv"){_8=_3.parseCsvData(_5)}else{_8.forEach(function(_12){if(_12[_1]!=null){_12[_2]=_12[_1];delete _12[_1]}
})}
this.parsedData=_8;this.parsedFields=_3.getFields();var _9=this.guesser;_9.fields=this.parsedFields;var _10=_9.extractFieldsFrom(_8),_11=_9.convertData(_8)
;this.$1994(_10,_11,_9.parseDetails)}
,isc.A.fieldTypeChanged=function isc_ParsedDataDSEditor_fieldTypeChanged(_1){this.$1993();var _2=this.parsedFields,_3=this.parsedData
;var _4=_2.find("name",_1.name);if(_4){_4.type=_1.type;var _5=this.guesser;_5.fields=_2;var _6=_5.extractFieldsFrom(_3),_7=_5.convertData(_3)
;this.$1994(_6,_7,_5.parseDetails)}
}
,isc.A.$1994=function isc_ParsedDataDSEditor__rebindDataViewer(_1,_2,_3){if(this.testDS)this.testDS.destroy();var _4=isc.addProperties({},this.dsProperties,{clientOnly:true,testData:_2
});if(_1)_4.fields=_1;this.testDS=isc.DataSource.create(_4);this.dataViewer.setDataSource(this.testDS);this.dataViewer.fetchData();if(_3&&_3.length>0){var _5=this;this.dataPane.expandSection(1,function(){_5.errorViewer.setData(_3)})}else if(_1){this.dataPane.collapseSection(1)}
}
);isc.B._maxIndex=isc.C+11;isc.ParsedDataDSEditor.registerStringMethods({editComplete:"canceled",dataSourceSaved:"name,ds,isNew,originalName"});isc.defineClass("DataSourceEditorSession");isc.A=isc.DataSourceEditorSession.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$258w={"changeProperty":"${detail.newValue != null ? 'Change' : 'Remove'} ${dsName} property '${detail.property}' ${detail.newValue != null ? 'to ' + detail.newValue : ''}","addField":"Add ${dsName} field '${detail.fieldName}' of type ${detail.field.type}${detail.field.length != null ? '(' + detail.field.length + ')' : ''}","removeField":"Remove ${dsName} field '${detail.fieldName}'","reorderField":"Moved ${dsName} field '${detail.fieldName}' from ${detail.fromPosition} '${detail.fromField}' to ${detail.toPosition} '${detail.toField}'","changeFieldName":"Change ${dsName} field '${detail.fieldName}' to '${detail.newName}'","changeFieldType":"Change ${dsName} field '${detail.fieldName}' type from ${detail.oldType}${detail.oldLength != null ? '(' + detail.oldLength + ')' : ''} to ${detail.newType}${detail.newLength != null ? '(' + detail.newLength + ')' : ''}","changeFieldProperty":"${detail.newValue != null ? 'Change' : 'Remove'} ${dsName} field '${detail.fieldName}' property '${detail.property}' ${detail.newValue != null ? 'to ' + detail.newValue : ''}","addOperationBinding":"Add ${dsName} '${detail.operationType}${detail.operationId ? '/' + detail.operationId : ''}' operation binding","removeOperationBinding":"Remove ${dsName} '${detail.operationType}${detail.operationId ? '/' + detail.operationId : ''}' operation binding","changeOperationBindingProperty":"${detail.newValue != null ? 'Change' : 'Remove'} ${dsName} '${detail.operationType}${detail.operationId ? '/' + detail.operationId : ''}' operation binding property '${detail.property}' ${detail.newValue != null ? 'to ' + detail.newValue : ''}"
};isc.A.$258x={"changeProperty":{detailKeys:["property"]},"changeFieldName":{detailKeys:["fieldName"]},"changeFieldType":{detailKeys:["fieldName"]},"changeFieldProperty":{detailKeys:["fieldName","property"]},"addField":{detailKeys:["fieldName"]}
};isc.B.push(isc.A.setDataSources=function isc_DataSourceEditorSession_setDataSources(_1,_2){this.dataSources=_1;this.$2503=false;this.$2504={};if(_1){isc.RPC.startQueue();for(var i=0;i<_1.length;i++){var _4=isc.addProperties({},_1[i]);if(_4.defaults&&isc.getKeys(_4.defaults).length<=1&&_4.loadData){delete _4.defaults;var _5=this;(function(_4){_5.loadDataSourceDefaults(_4.ID,function(_6){_4.defaults=_6})}(_4))}
this.$2504[_4.ID]=_4
}
if(isc.RPC.getQueueTransactionId()!=null){var _5=this;isc.RPC.sendQueue(function(){_5.$2503=true;if(_5.$2505)_5.$2505();if(_2)_2()});return}
}
if(this.$2503&&this.$2505)this.$2505();if(_2)_2()}
,isc.A.getDataSources=function isc_DataSourceEditorSession_getDataSources(){var _1=[],_2=this.$2504
;for(var _3 in _2){_1.add(_2[_3])}
return _1}
,isc.A.getAddedDataSources=function isc_DataSourceEditorSession_getAddedDataSources(){return this.getDataSources().filter(function(_1){return _1.$2506}).getProperty("ID")}
,isc.A.getUpdatedDataSources=function isc_DataSourceEditorSession_getUpdatedDataSources(){return this.getDataSources().filter(function(_1){return _1.$2507}).getProperty("ID")}
,isc.A.getRenamedDataSources=function isc_DataSourceEditorSession_getRenamedDataSources(){var _1={};this.getDataSources().map(function(_2){if(_2.$2508!=null){_1[_2.$2508]=_2.ID}
});return _1}
,isc.A.isUpdated=function isc_DataSourceEditorSession_isUpdated(_1){var _2=this.$2504[_1];return(_2&&_2.$2507)}
,isc.A.getDataSourceDefaults=function isc_DataSourceEditorSession_getDataSourceDefaults(_1){var _2=this.$2504[_1];return(_2?_2.defaults:null)}
,isc.A.getDataSourceXml=function isc_DataSourceEditorSession_getDataSourceXml(_1){var _2=this.$2504[_1],_3=(_2?_2.defaults:null)
;return _3&&this.serializeDataSource(_3)}
,isc.A.get=function isc_DataSourceEditorSession_get(_1){if(!_1)return null;var _2=this.$2504[_1];if(_2&&(this.useLiveDataSources==false||_2.$2507||_2.$2506||_2.$2508)){var _3=_2.liveObject;if(!_3){_2.liveObject=_3=this.createTempLiveDSInstance(_2.defaults)}
return _3}
return isc.DS.get(_1)}
,isc.A.set=function isc_DataSourceEditorSession_set(_1,_2,_3){var _4=this.$2504[_1];if(!_4){this.logWarn("Cannot update DataSource '"+_1+"' because it is not known "+this.getStackTrace());return}
var _5=!isc.Canvas.compareValues(_4.defaults,_2);if(_5){_4.defaults=isc.clone(_2);if(!_4.$2506&&_4.$2508==null&&!_3){_4.$2507=true;this.fireDataSourceChanged(_4)}
var _6=_4.liveObject;if(_6&&!_6.addGlobalId){_6.destroy()}
_4.liveObject=null;if(this.dsRelations){this.dsRelations.reset()}}
}
,isc.A.add=function isc_DataSourceEditorSession_add(_1,_2,_3,_4){this.$2504[_1]={ID:_1,defaults:isc.clone(_2)
};if(!_3){this.$2504[_1].$2506=true;this.fireDataSourceAdded(this.$2504[_1])}
if(_3&&_4){this.$2504[_1].$2508=_4;this.fireDataSourceRenamed(this.$2504[_1])}
if(this.dsRelations){this.dsRelations.reset()}}
,isc.A.delete=function isc_DataSourceEditorSession_delete(_1){delete this.$2504[_1];this.fireDataSourceDeleted(_1)}
,isc.A.recordAddedField=function isc_DataSourceEditorSession_recordAddedField(_1,_2){var _3=this.$2504[_1];if(!_3){this.logWarn("Cannot update DataSource '"+_1+"' because it is not known");return}
var _4=_2.name;if(!_3.$2506&&_3.$2508==null){if(!_3.addedFields)_3.addedFields=[];if(!_3.addedFields.contains(_4)){_3.addedFields.add(_4)}
}
this.addChange(_1,"addField",{fieldName:_4,field:isc.clone(_2)
})}
,isc.A.getAddedFields=function isc_DataSourceEditorSession_getAddedFields(_1){var _2=this.$2504[_1];return _2&&_2.addedFields}
,isc.A.removeField=function isc_DataSourceEditorSession_removeField(_1,_2,_3,_4){var _5=this.$2504[_1];if(!_5){this.logWarn("Cannot update DataSource '"+_1+"' because it is not known");return}
this.recordRemovedField(_1,_2);var _6=!_4;_4=_4||isc.clone(this.getDataSourceDefaults(_1));var _7=_4.fields,_8=_7.find("name",_2),_9=_4.cacheData
;var _10=this.addChange(_1,"removeField",{fieldName:_2,field:isc.clone(_8)
});this.startChangeContext(_10);if(_3!=null){this.removeIncludeFieldsForForeignKey(_1,_3)}else{this.removeIncludeFieldsReferencingField(_1,_2)}
var _11=_7.findIndex("name",_2);if(_11>=0){_7.removeAt(_11)}
var _12=_7.findAll("displayField",_2);if(_12&&_12.length>0){_12.map(function(_8){delete _8.displayField})}
if(_9){_9.forEach(function(_13){if(_13[_2]!=null){_13[_2]=null}
})}
this.endChangeContext(_10);if(_6){this.set(_1,_4)}
return _4}
,isc.A.recordRemovedField=function isc_DataSourceEditorSession_recordRemovedField(_1,_2){var _3=this.$2504[_1];if(!_3){this.logWarn("Cannot update DataSource '"+_1+"' because it is not known");return}
if(!_3.$2506){if(_3.addedFields&&_3.addedFields.contains(_2)){_3.addedFields.remove(_2)}else if(_3.renamedFields&&isc.getValues(_3.renamedFields).contains(_2)){var _4=_3.renamedFields[_2];delete _3.renamedFields[_2];_2=_4;if(!_3.removedFields)_3.removedFields=[];if(!_3.removedFields.contains(_2)){_3.removedFields.add(_2)}
}else{if(!_3.removedFields)_3.removedFields=[];if(!_3.removedFields.contains(_2)){_3.removedFields.add(_2)}
}
}
}
,isc.A.getRemovedFields=function isc_DataSourceEditorSession_getRemovedFields(_1){var _2=this.$2504[_1];return _2&&_2.removedFields}
,isc.A.standardizeMockDataSource=function isc_DataSourceEditorSession_standardizeMockDataSource(_1){var _2=this.get(_1);var _3=_2.getFieldNames(),_4=[]
;for(var i=0;i<_3.length;i++){var _6=_2.getField(_3[i]);_6=_4[i]=isc.clone(_6);delete _6.validators;delete _6.$61;delete _6.$62;if(_6.$76s){delete _6.title;delete _6.$76s}
delete _6.emptyDisplayValue}
var _7=this.$228l(_2.mockData,_2.mockDataFormat),_8=_2.cacheData
;if(_7){var _9=isc.SchemaGuesser.create({detectPrimaryKey:true});_9.dataSourceName=_2.ID;_9.detectPrimaryKey=true;var _10=_9.extractFieldsFrom(_7)||[],_11=_10.find("primaryKey",true)
;if(_11){var _12=_4.find("name",_11.name);if(_12){var _13=_4.find("primaryKey",true);if(!_10.find("name",_13.name)){_4.remove(_13);var _14=_13.name;_8.forEach(function(_17){if(_17[_14]!=null){delete _17[_14]}
})}
var _15=_4.getProperty("primaryKey").or();if(!_15){_12.primaryKey=true}
}
}
}
var _16=isc.clone(this.getDataSourceDefaults(_1));_16.fields=_4;_16.cacheData=_8;delete _16.mockData;delete _16.mockDataFormat;delete _16.mockDataPrimaryKey;this.set(_1,_16);return _16}
,isc.A.$228l=function isc_DataSourceEditorSession__getMockDataRecords(_1,_2){if(_1&&isc.isA.String(_1)&&_2!="mock"){var _3=isc.FileParser.create({hasHeaderLine:true});if(_2=="xml"){var _4=isc.xml.parseXML(_1);if(!_4){this.logWarn("XML data in mockData could not be parsed");return}
var _5=isc.xml.selectNodes(_4,"/"),_6=isc.xml.toJS(_5)
;if(_6.length==1){var _7=isc.JSONEncoder.create({dateFormat:"dateConstructor",prettyPrint:false});var _8=_7.encode(_6[0]);_1=_3.parseJsonData(_8," loading pre-processed XML data for MockDataSource "+this.ID)}
}else if(_2=="csv"){_1=_3.parseCsvData(_1)}else if(_2=="json"){_1=_3.parseJsonData(_1," loading data for MockDataSource "+this.ID)}else{this.logWarn("Invalid mockDataFormat '"+_2+"'");return}
return _1}
}
,isc.A.removeIncludeFieldsForForeignKey=function isc_DataSourceEditorSession_removeIncludeFieldsForForeignKey(_1,_2,_3){var _4=_2.indexOf("."),_5=(_4==-1?_1:_2.substring(0,_4)),_6=_5+"."
;_3=_3||this.getDataSourceDefaults(_1);var _7=_3.fields;for(var i=0;i<_7.length;i++){var _9=_7[i];if(_9.includeFrom&&_9.includeFrom.startsWith(_6)){var _10=_9.name;if(!_10){_4=_9.includeFrom.lastIndexOf(".");_10=_9.includeFrom.substring(_4+1)}
this.removeField(_1,_10,null,_3)}
}
}
,isc.A.removeIncludeFieldsReferencingField=function isc_DataSourceEditorSession_removeIncludeFieldsReferencingField(_1,_2){var _3=this.getRelations().getFieldReferences(_1,_2);if(_3){for(var i=0;i<_3.length;i++){var _5=_3[i];this.removeField(_5.dsId,_5.fieldName)}
}
}
,isc.A.renameField=function isc_DataSourceEditorSession_renameField(_1,_2,_3,_4){this.recordRenamedField(_1,_2,_3);var _5=!_4;_4=_4||isc.clone(this.getDataSourceDefaults(_1));var _6=_4.fields,_7=_4.cacheData
;var _8=_6.find("name",_2);if(!_8)return;_8.name=_3;var _9=this.addChange(_1,"changeFieldName",{fieldName:_2,newName:_3
});this.startChangeContext(_9);for(var i=0;i<_6.length;i++){var _8=_6[i];if(_8.validators&&_8.validators.length>0){var _11=isc.clone(_8.validators),_12=false
;for(var j=0;j<_8.validators.length;j++){if(this.updateValidatorFieldNames(_8.validators[j],_2,_3)){_12=true}
}
if(_12){_14.addChange(_1,"changeFieldProperty",{fieldName:_8.name,property:"validators",originalValue:_11,newValue:_8.validators
})}
}
}
if(_7){_7.forEach(function(_22){if(_22[_2]!=null){_22[_3]=_22[_2];delete _22[_2]}
})}
if(_5){this.set(_1,_4)}
var _14=this,_15={},_16={}
;_15[_2]=_3;this.getDataSources().map(function(_22){var _17=_14.get(_22.ID);_16[_22.ID]=_17.fields});this.getRelations().updateIncludeFromReferences(_1,_15,function(_22){if(!_22)return;var _18=_1+"."+_3;for(var i=0;i<_22.length;i++){var _19=_22[i],_20=_14.getDataSourceDefaults(_19),_6=_20.fields
;for(var j=0;j<_6.length;j++){var _8=_6[j];if(_8.includeFrom){if(_8.includeFrom.endsWith(_18)||(_19==_1&&_8.includeFrom==_3))
{var _21=_16[_19][_8.name];_14.addChange(_19,"changeFieldProperty",{fieldName:_8.name,property:"includeFrom",originalValue:_21.includeFrom,newValue:_8.includeFrom
})}
}
}
}
});this.endChangeContext(_9);return _4}
,isc.A.renameSampleDataField=function isc_DataSourceEditorSession_renameSampleDataField(_1,_2,_3){_3=_3||this.getSampleData();if(_3){_3.forEach(function(_4){if(_4[_1]!=null){_4[_2]=_4[_1];delete _4[_1]}
})}
return _3}
,isc.A.recordRenamedField=function isc_DataSourceEditorSession_recordRenamedField(_1,_2,_3){var _4=this.$2504[_1];if(!_4){this.logWarn("Cannot update DataSource '"+_1+"' because it is not known");return}
if(!_4.$2506&&_4.$2508==null){if(_4.addedFields&&_4.addedFields.contains(_2)){_4.addedFields.remove(_2);_4.addedFields.add(_3)}else{if(!_4.renamedFields)_4.renamedFields={};var _5=(_2==null?_2:isc.getKeyForValue(_2,_4.renamedFields));if(_5==_3)delete _4.renamedFields[_5];else _4.renamedFields[_5]=_3}
}
}
,isc.A.getRenamedFields=function isc_DataSourceEditorSession_getRenamedFields(_1){var _2=this.$2504[_1];return _2&&_2.renamedFields}
,isc.A.updateValidatorFieldNames=function isc_DataSourceEditorSession_updateValidatorFieldNames(_1,_2,_3){var _4=_1.applyWhen;if(!_4||isc.isA.emptyObject(_4))return;return this.$178b(_4,_2,_3)}
,isc.A.$178b=function isc_DataSourceEditorSession__replaceCriteriaFieldName(_1,_2,_3){var _4=_1.operator,_5=false
;if(_4=="and"||_4=="or"){var _6=_1.criteria;for(var i=0;i<_6.length;i++){if(this.$178b(_6[i],_2,_3)){_5=true}
}
}else{if(_1.fieldName!=null&&_1.fieldName==_2){_1.fieldName=_3;_5=true}
}
return _5}
,isc.A.changeFieldType=function isc_DataSourceEditorSession_changeFieldType(_1,_2,_3,_4,_5){var _6=!_5;_5=_5||isc.clone(this.getDataSourceDefaults(_1));var _7=_5.fields,_8=_7.find("name",_2),_9=_5.cacheData,_10=(_3!=_8.type)
;var _11=this.addChange(_1,"changeFieldType",{fieldName:_2,oldType:_8.type,newType:_3,oldLength:_8.length,newLength:(_3=="text"?_4:null)
});this.startChangeContext(_11);if(_10&&_8.valueMap!=null){this.changeFieldProperty(_1,_2,"valueMap",null,_5);delete _8.valueMap}
if(_10&&_8.validators!=null){this.changeFieldProperty(_1,_2,"validators",null,_5);delete _8.validators}
if(_10&&_9&&_9.length>0){var _12=isc.SchemaGuesser.create({fields:[_8]}),_13=_12.revertValues(_9)
;_8.type=_3;_8.length=_4;_12.fields=[_8];_12.extractFieldsFrom(_13);var _14=_12.convertData(_13);for(var i=0;i<_14.length;i++){_9[i][_2]=_14[i][_2]}
}else{_8.type=_3;_8.length=_4}
this.endChangeContext(_11);if(_6){this.set(_1,_5)}
return _5}
,isc.A.changeFieldProperty=function isc_DataSourceEditorSession_changeFieldProperty(_1,_2,_3,_4,_5){var _6=!_5;_5=_5||isc.clone(this.getDataSourceDefaults(_1));var _7=_5.fields,_8=_7.find("name",_2)
;this.addChange(_1,"changeFieldProperty",{fieldName:_2,property:_3,originalValue:_8[_3],newValue:_4
});if(_6){this.set(_1,_5)}
return _5}
,isc.A.init=function isc_DataSourceEditorSession_init(){this.Super("init",arguments);this.$258y=isc.Tree.create();this.$258z=[];var _1=this;this.setDataSources(this.dataSources,function(){_1.$2503=true;if(this.$2505){this.$2505()}
})}
,isc.A.destroy=function isc_DataSourceEditorSession_destroy(){this.getDataSources().map(function(_2){var _1=_2.liveObject;if(_1&&!_1.addGlobalId){_1.destroy()}
});return this.Super("destroy",arguments)}
,isc.A.isReady=function isc_DataSourceEditorSession_isReady(){return this.$2503}
,isc.A.waitForReady=function isc_DataSourceEditorSession_waitForReady(_1){if(this.$2503){this.delayFireCallback(_1);return}
this.$2505=_1}
,isc.A.getRelations=function isc_DataSourceEditorSession_getRelations(){var _1=this;var _2=this.getDataSources().map(function(_12){return _1.get(_12.ID)});if(!this.dsRelations){this.dsRelations=isc.DSRelations.create({session:this,dataSources:_2,getDataSourceDefaults:function(_12,_13){var _3=this.session.getDataSourceDefaults(_12);_13(_12,isc.clone(_3))},saveDataSource:function(_3,_12){this.session.set(_3.ID,_3);if(_12)_12()},createLiveInstance:function(_3){},getRelationsForDataSource:function(_12){var _4=this.Super("getRelationsForDataSource",arguments),_3=this.session.getDataSourceDefaults(_12)
;if(_3){for(var i=0;i<_4.length;i++){var _6=_4[i],_7=_6.type,_8=_6.displayField,_9
;if(_7=="Self")continue;if(_8&&_12==_3.ID){var _10=(_7=="M-1"?_3.fields.find("name",_8):this.session.get(_6.dsId).getField(_8));if(_10&&_10.includeFrom){_9=_8;var _11=_10.includeFrom.split(".");if(_11&&_11.length>=2){_8=_11[_11.length-1]}else{_8=_10.includeFrom}
if(_8==_9)_9=null}
_6.displayField=_8;_6.includeField=_9}
}
}
return _4}
})}else{this.dsRelations.setDataSources(_2)}
return this.dsRelations}
,isc.A.saveChanges=function isc_DataSourceEditorSession_saveChanges(_1,_2){var _3=this;var _4=function(_17){var _5=_3.getRenamedDataSources(),_6=isc.getKeys(_5).length
;if(_6==0){return _17()}
for(var _7 in _5){var _8=_5[_7],_9=_7,_10=_3.getDataSourceDefaults(_8)
;_3.saveDataSourceDefaults(_10,function(_18){_3.fetchDataSourceXml(_9,function(_19){_3.deleteRenamedDataSource(_9,_19,function(_20){if(_3.useLiveDataSources!=false){isc.DataSource.load(_8,function(){var _11=isc.DS.get(_8);_3.fireCallback(_2,"name, ds, isNew, renamedFrom",[_8,_11,null,_9]);if(--_6==0){_17()}
},true,true)}else{_3.fireCallback(_2,"name, ds, isNew, renamedFrom",[_8,null,null,_9]);if(--_6==0){_17()}
}
})})})}
};var _12=function(_17){var _13=_3.getAddedDataSources(),_6=_13.length
;if(_6==0){return _17()}
for(var i=0;i<_13.length;i++){var _8=_13[i],_10=_3.getDataSourceDefaults(_8)
;_3.saveDataSourceDefaults(_10,function(){if(_3.useLiveDataSources!=false){isc.DataSource.load(_8,function(){var _11=isc.DS.get(_8);_3.fireCallback(_2,"name, ds, isNew, renamedFrom",[_8,_11,true]);if(--_6==0){_17()}
},true,true)}else{_3.fireCallback(_2,"name, ds, isNew, renamedFrom",[_8,null,true]);if(--_6==0){_17()}
}
})}
};var _15=function(_17){var _16=_3.getUpdatedDataSources(),_6=_16.length
;if(_6==0){return _17()}
for(var i=0;i<_16.length;i++){var _8=_16[i],_10=_3.getDataSourceDefaults(_8)
;_3.saveDataSourceDefaults(_10,function(){if(_3.useLiveDataSources!=false){isc.DataSource.load(_8,function(){var _11=isc.DS.get(_8);_3.fireCallback(_2,"name, ds, isNew, renamedFrom",[_8,_11]);if(--_6==0){_17()}
},true,true)}else{_3.fireCallback(_2,"name, ds, isNew, renamedFrom",[_8]);if(--_6==0){_17()}
}
})}
};_4(function(){_12(function(){_15(function(){if(_1)_1()})})})}
,isc.A.clearChanges=function isc_DataSourceEditorSession_clearChanges(){this.getDataSources().map(function(_1){delete _1.$2506;delete _1.$2507;delete _1.$2508;delete _1.addedFields;delete _1.removedFields;delete _1.renamedFields})}
,isc.A.saveDataSourceDefaults=function isc_DataSourceEditorSession_saveDataSourceDefaults(_1,_2,_3){var _4=this.serializeDataSource(_1);this.saveDataSourceXml(_1.ID,_4,_2,_3)}
,isc.A.fetchDataSourceXml=function isc_DataSourceEditorSession_fetchDataSourceXml(_1,_2){this.dsDataSource.getFile({fileName:_1,fileType:"ds",fileFormat:"xml"
},function(_3,_4,_5){_2(_4)},{operationId:"allOwners"
})}
,isc.A.fetchDataSourceJS=function isc_DataSourceEditorSession_fetchDataSourceJS(_1,_2){this.dsDataSource.getFile({fileName:_1,fileType:"ds",fileFormat:"xml"
},function(_3,_4,_5){_2(_3.data&&_3.data.length>0?_3.data[0].fileContentsJS:null)},{operationId:"allOwnersXmlToJs"
})}
,isc.A.saveDataSourceXml=function isc_DataSourceEditorSession_saveDataSourceXml(_1,_2,_3,_4){var _5=isc.addProperties({},{fileName:_1,fileType:"ds",fileFormat:"xml"
},_4)
this.dsDataSource.saveFile(_5,_2,function(_7,_8){var _6=true;if(_7.status<0){isc.warn(_7.data);_6=false}
if(_3)_3(_6)},{operationId:"allOwners"
})}
,isc.A.removeDataSourceXml=function isc_DataSourceEditorSession_removeDataSourceXml(_1,_2){this.dsDataSource.removeFile({fileName:_1,fileType:"ds",fileFormat:"xml"
},function(){_2()})}
,isc.A.hasDataSourceXml=function isc_DataSourceEditorSession_hasDataSourceXml(_1,_2){this.dsDataSource.hasFile({fileName:_1,fileType:"ds",fileFormat:"xml"
},function(_3,_4,_5){_2(_4)},{operationId:"allOwners"
})}
,isc.A.getUniqueDataSourceName=function isc_DataSourceEditorSession_getUniqueDataSourceName(_1,_2){var _3={fileName:_1,fileType:"ds",fileFormat:"xml",indexPrefix:"_"
};this.dsDataSource.uniqueName(_3,function(_4,_5,_6){if(_5){_2(_5.fileName);return}
_2()},{operationId:"uniqueNameNoAdd"
})}
,isc.A.loadDataSourceDefaults=function isc_DataSourceEditorSession_loadDataSourceDefaults(_1,_2){this.fetchDataSourceJS(_1,function(_4){var _3=(_4?isc.DataSourceEditor.extractDSDefaultsFromJS(_4):null);_2(_3)})}
,isc.A.createTempLiveDSInstance=function isc_DataSourceEditorSession_createTempLiveDSInstance(_1){_1=(_1?isc.clone(_1):{});_1.addGlobalId=false;_1.sourceDataSourceID=this.dsDataSource&&this.dsDataSource.ID;_1.fields=isc.clone(_1.fields);var _2=isc.DS.getDataSource,_3=isc.DS.registerDataSource
;isc.DS.addClassMethods({getDataSource:function(_5,_6,_7,_8){},registerDataSource:function(_5){}
});var _4=this.createLiveDSInstance(_1);isc.DS.addClassMethods({getDataSource:_2,registerDataSource:_3
});return _4}
,isc.A.createLiveDSInstance=function isc_DataSourceEditorSession_createLiveDSInstance(_1){var _2=this.dsClass||_1._constructor||"DataSource",_3;if(isc.DS.isRegistered(_2)){_3=isc.DS.get(_2)}else{_3=isc.DS.get("DataSource");_1._constructor=_2}
var _4=isc.ClassFactory.getClass(_2).create(_1);if(_4&&this.dsDataSource)_4.sourceDataSourceID=this.dsDataSource.ID;return _4}
,isc.A.serializeDataSource=function isc_DataSourceEditorSession_serializeDataSource(_1,_2){_2=_2||this.dsClass||_1._constructor||"DataSource";var _3;if(isc.DS.isRegistered(_2)){_3=isc.DS.get(_2)}else{_3=isc.DS.get("DataSource");_1._constructor=_2}
var _4=_3.xmlSerialize(_1,{ignoreExplicitTypes:true});return _4}
,isc.A.deleteRenamedDataSource=function isc_DataSourceEditorSession_deleteRenamedDataSource(_1,_2,_3){var _4=this;_4.getUniqueDataSourceName(_1+isc.$ag+"deleted",function(_5){_4.saveDataSourceXml(_5,_2,function(){_4.removeDataSourceXml(_1,function(){_3(_5)})})})}
,isc.A.fireDataSourceAdded=function isc_DataSourceEditorSession_fireDataSourceAdded(_1){this.fireCallback(this.dataSourceAdded,"name",[_1.ID])}
,isc.A.dataSourceAdded=function isc_DataSourceEditorSession_dataSourceAdded(_1){}
,isc.A.fireDataSourceChanged=function isc_DataSourceEditorSession_fireDataSourceChanged(_1){this.fireCallback(this.dataSourceChanged,"name",[_1.ID])}
,isc.A.dataSourceChanged=function isc_DataSourceEditorSession_dataSourceChanged(_1){}
,isc.A.fireDataSourceRenamed=function isc_DataSourceEditorSession_fireDataSourceRenamed(_1){this.fireCallback(this.dataSourceRenamed,"fromName,toName",[_1.$2508,_1.ID])}
,isc.A.dataSourceRenamed=function isc_DataSourceEditorSession_dataSourceRenamed(_1){}
,isc.A.fireDataSourceDeleted=function isc_DataSourceEditorSession_fireDataSourceDeleted(_1){this.fireCallback(this.dataSourceDeleted,"name",[_1])}
,isc.A.dataSourceDeleted=function isc_DataSourceEditorSession_dataSourceDeleted(_1){}
,isc.A.addChange=function isc_DataSourceEditorSession_addChange(_1,_2,_3){if(!this.useChangeTracking||this.$2580)return null;var _4=this.$258y,_5=this.$258z,_6=_5[_5.length-1]||_4.getRoot(),_7={dsName:_1,changeType:_2,description:this.$2581(_1,_2,_3),detail:_3
}
;var _8=_4.add(_7,_6);return _8}
,isc.A.startChangeContext=function isc_DataSourceEditorSession_startChangeContext(_1){if(!this.useChangeTracking||this.$2580)return;this.$258z.add(_1)}
,isc.A.endChangeContext=function isc_DataSourceEditorSession_endChangeContext(_1){if(!this.useChangeTracking||this.$2580)return;var _2=this.$258z;if(!_1){_1=_2[_2.length-1]
}
var _3;do{_3=_2.pop()}while(_3&&_3!=_1)}
,isc.A.getChangeLog=function isc_DataSourceEditorSession_getChangeLog(){return this.$258y}
,isc.A.clearChangeLog=function isc_DataSourceEditorSession_clearChangeLog(){this.$258y=isc.Tree.create();this.$258z=[]}
,isc.A.revertChange=function isc_DataSourceEditorSession_revertChange(_1,_2,_3){if(!this.useChangeTracking)return;var _4=this.$258y,_5=(_4.getChildren(_1)||[]).duplicate(),_6=(!_3?_4.getAllNodes(_1):null)
;if(!_3){if(!_6)_6=[];_6.addAt(_1,0)}
for(var i=0;i<_5.length;i++){this.revertChange(_5[i],_2,true)}
this.$2580=true;var _8=_1.detail;switch(_1.changeType){case"addField":this.removeField(_1.dsName,_8.fieldName);break;case"changeFieldType":if(_8.oldType!=null){this.changeFieldType(_1.dsName,_8.fieldName,_8.oldType)}
break;case"changeFieldProperty":if(_8.oldType!=null){this.changeFieldProperty(_1.dsName,_8.fieldName,_8.property,_8.originalValue)}
break;default:this.logWarn("Cannot revert change: "+this.echoFull(_4.getCleanNodeData(_1)));break}
_4.remove(_1);delete this.$2580;if(_2&&!_3){var _9=_6.getProperty("dsName").getUniqueItems();for(var i=0;i<_9.length;i++){var _10=_9[i];var _11=this.getDataSourceDefaults(_10),_12=_11.fields
;_2.bindFields(_11);if(_2.editSampleData){_2.$210n(_12,_11.cacheData)}
_2.updateTitleField()}
}
}
,isc.A.$2581=function isc_DataSourceEditorSession__getChangeDescription(_1,_2,_3){var _4=this.$258w[_2];return(_4?_4.evalDynamicString(this,{dsName:_1,detail:_3
}):null)}
,isc.A.consolidateChanges=function isc_DataSourceEditorSession_consolidateChanges(){if(!this.useChangeTracking)return[];var _1=this.$258y,_2=_1.getCleanNodeData(_1.getAllNodes(),false),_3=[]
;for(var i=0;i<_2.length;i++){var _5=_2[i],_6=_5.detail
;switch(_5.changeType){case"changeProperty":var _7=_5.changeType+"_"+_5.dsName+"_"+_6.property
_11=_3.find("key",_7)
;if(!_11){_3.add({key:_7,change:isc.clone(_5)
})}else if(_11.change.detail.originalValue==_6.newValue){_3.remove(_11)}else{var _8=_11.change.detail;_8.newValue=_6.newValue;_11.change.description=this.$2581(_5.dsName,_5.changeType,_8)}
break;case"addField":var _7=_5.changeType+"_"+_5.dsName+"_"+_6.fieldName
_11=_3.find("key",_7)
;if(!_11){_3.add({key:_7,change:isc.clone(_5)
})}
break;case"removeField":var _7="addField_"+_5.dsName+"_"+_6.fieldName
_11=_3.find("key",_7)
;if(_11){_3.remove(_11)}else{var _9=_5.changeType+"_"+_5.dsName+"_"+_6.fieldName;_3.add({key:_9,change:isc.clone(_5)
})}
break;case"reorderField":var _7=_5.changeType+"_"+_5.dsName+"_"+_6.fieldName
_11=_3.find("key",_7)
;if(_11){var _8=_11.change.detail;_8.position=_6.position;_8.targetField=_6.targetField;_11.change.description=this.$2581(_5.dsName,_5.changeType,_8)}else{_3.add({key:_7,change:isc.clone(_5)
})}
break;case"changeFieldName":var _10="addField_"+_5.dsName+"_"+_6.fieldName,_11=_3.find("key",_10)
;if(_11){var _9="addField_"+_5.dsName+"_"+_6.newName,_8=_11.change.detail,_12=isc.clone(_8.field)
;_12.name=_6.newName;_8.fieldName=_12.name;_8.field=_12;_11.change.description=this.$2581(_5.dsName,"addField",_8);_11.change.fieldName=_6.newName
_11.key=_9}else{var _10=_5.changeType+"_"+_5.dsName+"_"+_6.fieldName,_9=_5.changeType+"_"+_5.dsName+"_"+_6.newName,_11=_3.find("key",_10)
;if(!_11){_3.add({key:_9,change:isc.clone(_5)
})}else if(_11.change.detail.fieldName==_6.newName){_3.remove(_11)}else{var _8=_11.change.detail;_8.newName=_6.newName;_11.change.description=this.$2581(_5.dsName,_5.changeType,_8);_11.key=_9}
}
break;case"changeFieldType":var _7="addField_"+_5.dsName+"_"+_6.fieldName
_11=_3.find("key",_7)
;if(_11){var _8=_11.change.detail,_12=isc.clone(_8.field)
;_12.type=_6.newType;_12.length=_6.newLength;_8.field=_12}else{var _7=_5.changeType+"_"+_5.dsName+"_"+_6.fieldName
_11=_3.find("key",_7)
;if(!_11){_3.add({key:_7,change:isc.clone(_5)
})}else if(_11.change.detail.oldType==_6.newType){_3.remove(_11)}else{var _8=_11.change.detail;_8.newType=_6.newType;_8.newLength=_6.newLength;_11.change.description=this.$2581(_5.dsName,_5.changeType,_8)}
}
break;case"changeFieldProperty":var _7="addField_"+_5.dsName+"_"+_6.fieldName
_11=_3.find("key",_7)
;if(_11){var _8=_11.change.detail;if(_6.newValue==null){delete _8[_6.property]}else{_8[_6.property]=_6.newValue}
}else{var _7=_5.changeType+"_"+_5.dsName+"_"+_6.fieldName+"_"+_6.property
_11=_3.find("key",_7)
;if(!_11){_3.add({key:_7,change:isc.clone(_5)
})}else if(_11.change.detail.oldType==_6.newType){_3.remove(_11)}else{var _8=_11.change.detail;_8[_6.property]=_6.newValue;_11.change.description=this.$2581(_5.dsName,_5.changeType,_8)}
}
break;case"addOperationBinding":var _7=_5.changeType+"_"+_5.dsName+"_"+_6.operationType+(_6.operationId?"_"+_6.operationId:"")
_11=_3.find("key",_7)
;if(!_11){_3.add({key:_7,change:isc.clone(_5)
})}
break;case"removeOperationBinding":var _7="addOperationBinding_"+_5.dsName+"_"+_6.operationType+(_6.operationId?"_"+_6.operationId:"")
_11=_3.find("key",_7)
;if(_11){_3.remove(_11)}else{var _9=_5.changeType+"_"+_5.dsName+"_"+_6.operationType+(_6.operationId?"_"+_6.operationId:"");_3.add({key:_9,change:isc.clone(_5)
})}
break;case"changeOperationBindingProperty":var _7="addOperationBinding_"+_5.dsName+"_"+_6.operationType+(_6.operationId?"_"+_6.operationId:"")
_11=_3.find("key",_7)
;if(_11){var _8=_11.change.detail;if(_6.newValue==null){delete _8[_6.property]}else{_8[_6.property]=_6.newValue}
}else{var _7=_5.changeType+"_"+_5.dsName+"_"+_6.operationType+(_6.operationId?"_"+_6.operationId:"")+"_"+_6.property
_11=_3.find("key",_7)
;if(!_11){_3.add({key:_7,change:isc.clone(_5)
})}else if(_11.change.detail.originalValue==_6.newValue){_3.remove(_11)}else{var _8=_11.change.detail;_8.newValue=_6.newValue;_11.change.description=this.$2581(_5.dsName,_5.changeType,_8)}
}
break;default:break}
}
return _3.getProperty("change")}
);isc.evalBoundary;isc.B.push();isc.B._maxIndex=isc.C+64}if(isc.ListGrid!=null&&isc.DynamicForm!=null){isc.ClassFactory.defineClass("RelationEditor","VLayout");isc.A=isc.RelationEditor;isc.A.helpText="Relations are links between records of different DataSources, such as a link from an Order to the Customer that ordered it.<P>To create a relation, you add a special field to a DataSource, which stores a unique identifier for records from another DataSource.<P>For example, an Order record could have a field that stores the unique customer number of the Customer that placed the order.<P>When you create a relation field, Reify automatically uses a select or combo box when editing the field, so your users can pick a record from the related DataSource.<P>When building a screen that uses related DataSources, you can also use the <i>Fetch Related Data</i> action to populate a grid with records that are related to another record.";isc.A.shortHelpText="Relations are links between records of different DataSources, such as a link from an Order to the Customer that ordered it.<P>To create a relation, you add a special field to a DataSource, which stores a unique identifier for records from another DataSource.<P>For example, an Order record could have a field that stores the unique customer number of the Customer that placed the order.<P>When you create a relation field, Reify automatically uses a select or combo box when editing the field, so your users can pick a record from the related DataSource.";isc.A=isc.RelationEditor;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.addGeneratedField=function isc_c_RelationEditor_addGeneratedField(_1,_2){var _3=isc.RelationEditor.generatedFields;if(!_3){_3=isc.RelationEditor.generatedFields={}}
if(!_3[_1.ID]){_3[_1.ID]={}}
_3[_1.ID][_2]=true}
,isc.A.removeGeneratedField=function isc_c_RelationEditor_removeGeneratedField(_1,_2){var _3=isc.RelationEditor.generatedFields;if(_3&&_3[_1.ID]){delete _3[_1.ID][_2]}
}
,isc.A.isGeneratedField=function isc_c_RelationEditor_isGeneratedField(_1,_2){var _3=isc.RelationEditor.generatedFields;return(_3&&_3[_1.ID]&&_3[_1.ID][_2])}
);isc.B._maxIndex=isc.C+3;isc.A=isc.RelationEditor.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.membersMargin=10;isc.A.relationTypeDescriptions={"1-M":"Each \"${currentDS}\" record may have multiple \"${relatedDS}\" records (1-to-many)","M-1":"Each \"${relatedDS}\" record may have multiple \"${currentDS}\" records (many-to-1)","Self":"Each \"${currentDS}\" record may have multiple other \"${relatedDS}\" records, in a tree"
};isc.A.instructionsPanelDefaults={_constructor:"InstructionsPanel",instructions:isc.RelationEditor.helpText,helpDialogId:"RelationEditorInstructions"
};isc.A.outerLayoutDefaults={_constructor:"VLayout",autoDraw:false,isGroup:true,showGroupLabel:false,membersMargin:10,layoutMargin:10
};isc.A.relationsListDefaults={_constructor:"ListGrid",autoDraw:false,autoParent:"outerLayout",autoFocus:true,saveLocally:true,width:"100%",height:"*",showClippedValuesOnHover:true,defaultFields:[{name:"type",title:"Relation Type",width:150,valueMap:{"1-M":"1-to-many","M-1":"many-to-1","Self":"tree self-relation"
}
},{name:"dsId",title:"DataSource",width:200,formatCellValue:function(_1,_2,_3,_4,_5){if(!_2||!_1)return;var _6=_5.creator,_7=_6.session.get(_1),_8=(_7&&_7.ID==_6.dataSource.ID)
;_1=(_7&&!_8?_5.createDSLink(_1):_1);return _1+(_7?"":" (not present)")}
},{name:"description",title:"Description",width:"*",formatCellValue:function(_1,_2,_3,_4,_5){if(!_2)return;var _6=_2.type,_7=_5.creator.relationTypeDescriptions[_6]
;_7=_7.evalDynamicString(_5,{currentDS:_5.creator.dataSource.ID,relatedDS:_2.dsId
});return _7}
}
],selectionType:"single",selectionUpdated:function(_1){if(_1)this.creator.editRelation(_1)},canRemoveRecords:true,removeRecordClick:function(_1,_2){var _3=this,_4=this.getRecord(_1)
;if(!_4)return;if(!this.recordMarkedAsRemoved(_1)&&_1<this.originalRelationsCount&&!isc.RelationEditor.isGeneratedField(_4.dsId))
{var _5="Removing this relationship will remove all existing links between '${currentDS}' records and '${relatedDS}' records if you save. This cannot be undone. Proceed?";_5=_5.evalDynamicString(this,{currentDS:this.creator.dataSource.ID,relatedDS:_4.dsId
});isc.ask(_5,function(_6){if(_6)_3.creator.removeRelation(_4)},{buttons:[isc.Dialog.NO,isc.Dialog.YES]
})}else{_3.creator.removeRelation(_4)}
},canHover:true,hoverWrap:false,hoverAutoFitWidth:false,hoverStyle:"vbLargeHover",cellHoverHTML:function(_1,_2,_3){var _4=this.getField(_3);if(_4.isRemoveField){if(this.recordMarkedAsRemoved(_2)){return"Restore this relation"}
return"Remove this relation"}
var _5=this.creator;if(!_5.session.get(_1.dsId)){return"Related DataSource '"+_1.dsId+"' is not included in the project.<p>DataSources will be connected automatically if a DataSource '"+_1.dsId+"' is added later."}
},$30h:["<a href='",,"' target='",,"' onclick='if(window.",,") return ",,".$2325(\"",,"\");'>",,"</a>"
],createDSLink:function(_1){var _2=this.creator;if(!_2.canNavigateToDataSource){return _1}
var _3=this.getID(),_4=this.$30h
;_4[1]="javascript:void";_4[3]="javascript";_4[5]=_3;_4[7]=_3;_4[9]=_1;_4[11]=_1;return _4.join(isc.emptyString)},$2325:function(_1){var _2=this.creator;if(!_2.addRelationButton.isDisabled()){isc.ask("Save without adding the relationship?",function(_3){if(_3){_2.openDataSource(_1)}
})}else{_2.openDataSource(_1)}
return false}
};isc.A.addNewButtonDefaults={_constructor:"IButton",autoDraw:false,autoParent:"outerLayout",title:"Add New",width:75,layoutAlign:"right",click:function(){this.creator.addRelation()}
};isc.A.relationFormDefaults={_constructor:"DynamicForm",autoDraw:false,autoParent:"outerLayout",height:225,wrapItemTitles:false,numCols:4,colWidths:[125,25,50,"*"],fields:[{name:"dsId",type:"SelectItem",title:"Related DataSource",colSpan:3,change:function(_1,_2,_3,_4){var _5=_1.creator,_6=true
;if(_3){var _7=(_3==_5.dataSource.ID?_5.dataSource:_5.session.get(_3));if(_7&&isc.isA.MockDataSource(_7)&&!_7.hasExplicitFields()){var _8=_5.session.getDataSourceDefaults(_3);if(!_5.session.isUpdated(_3)||!_8.fields){_6=false;_5.confirmConvertSampleDataMockDataSource(_7,function(_8){_2.changeToValue(_3,true)}
)}
}
}
return _6},mapValueToDisplay:function(_1){var _2=this.form.creator;return(_1&&!_2.session.get(_1)?_1+" (not present)":_1)},pickListProperties:{formatCellValue:function(_1,_2,_3,_4){var _5=this.formItem.form.creator;if(_1&&!_5.session.get(_1)&&_1.indexOf(" ")<0){return _1+" (not present)"}
return _1}
}
},{name:"type",type:"RadioGroup",title:"Relation Type",colSpan:3,valueMap:{"1-M":"1-to-many","M-1":"many-to-1"
},defaultValue:"1-M",readOnlyWhen:{_constructor:"AdvancedCriteria",operator:"and",criteria:[{fieldName:"notPresentDS",operator:"equals",value:true}
]
}
},{name:"treeMessageSpacer",type:"SpacerItem",visible:false},{name:"treeMessage",type:"staticText",showTitle:false,title:"&nbsp;",visible:false,colSpan:3},{name:"required",type:"boolean",title:"Required?",labelAsTitle:true,startRow:true,prompt:"If checked, records that have no related records are hidden.",hoverStyle:"vbLargeHover",change:function(_1,_2,_3,_4){_1.setValue("joinType",(_3?null:"outer"))},readOnlyWhen:{_constructor:"AdvancedCriteria",operator:"and",criteria:[{fieldName:"notPresentDS",operator:"equals",value:true}
]
}
},{name:"storedOnMessage",type:"staticText",showTitle:false,title:"&nbsp;",colSpan:4,height:20,hoverStyle:"vbLargeHover",hoverWidth:400
},{name:"fieldName",type:"text",title:"Stored as",required:true,colSpan:3,editorType:"ComboBoxItem",addUnknownValues:true,hoverStyle:"vbLargeHover",hoverWidth:400,titleHoverHTML:function(){var _1=this.form.getSelectedDS(this.form.getValues()),_2=(_1?_1.getID():"related"),_3="The field where the relation is stored.  This field will store the unique IDs of related Records from the <i>${dsId}</i> DataSource."
;_3=_3.evalDynamicString(this,{dsId:_2});return _3},getTitleHTML:function(){var _1=this.Super("getTitleHTML",arguments);return _1+"&nbsp;"+this.form.helpImgHTML
},readOnlyWhen:{_constructor:"AdvancedCriteria",operator:"and",criteria:[{fieldName:"notPresentDS",operator:"equals",value:true}
]
},validateOnChange:true,validators:[{type:"custom",condition:function(_1,_2,_3,_4,_5){if(!_3||(_4.origFieldName&&_4.origFieldName==_3))return true;var _6=_1.form.getForeignKeyDS(_4),_7=_1.form.getPrimaryKeyDS(_4),_8=_6&&_6.getField(_3),_9=true
;if(_8&&_7&&_6.ID==_7.ID&&_8.primaryKey){_2.defaultErrorMessage
="The Primary Key cannot relate to it itself in a tree relation";_9=false}
if(_8&&_7&&_9){var _10=_8.type,_11=_7.getPrimaryKeyField(),_12=_11.type
;if((_10=="sequence"?"integer":_10)!=(_12=="sequence"?"integer":_12))
{_2.defaultErrorMessage
="Value matches an existing field in '"+_6.ID+"' which has a type that differs from the target primary key in "+_7.ID+". Please choose another field name.";_9=false}
}
return _9}
}
]
},{name:"fieldTitle",type:"text",title:"Title as",colSpan:3,hoverStyle:"vbLargeHover",hoverWidth:400,titleHoverHTML:function(){return"Title for the field that stores the relation.  This is how the field will be labeled when viewed in a grid or form.<p>Usually, this is just the name of the related DataSource, for example, \"Employee\".  However, you can give it a more specific name to clarify what the relation means.  For example, an Order might store the Employee number of the salesman that made the sale.  It would be good to title that field \"Sales Representative\" rather than just \"Employee\", so that when you are viewing an Order, you know why it has a related Employee."},getTitleHTML:function(){var _1=this.Super("getTitleHTML",arguments);return _1+"&nbsp;"+this.form.helpImgHTML
},readOnlyWhen:{_constructor:"AdvancedCriteria",operator:"or",criteria:[{fieldName:"dsId",operator:"isNull"},{fieldName:"notPresentDS",operator:"equals",value:true}
]
}
},{name:"enableDisplayAs",type:"boolean",align:"right",width:125,showTitle:false,labelAsTitle:true,startRow:true,visibleWhen:{_constructor:"AdvancedCriteria",operator:"and",criteria:[{fieldName:"type",operator:"notEqual",value:"Self"}]
},readOnlyWhen:{_constructor:"AdvancedCriteria",operator:"and",criteria:[{fieldName:"notPresentDS",operator:"equals",value:true}
]
}
},{name:"displayField",type:"text",editorType:"SelectItem",title:"Display as",colSpan:2,allowEmptyValue:true,hint:"from dsID",hoverStyle:"vbLargeHover",hoverWidth:400,titleHoverHTML:function(){var _1=this.form.getPrimaryKeyDS(this.form.getValues()),_2=(_1?_1.getID():"related"),_3=this.form.getForeignKeyDS(this.form.getValues()),_4=(_3?_3.getID():"related"),_5="When you view the relation field stored on the <i>${fkDSId}</i> DataSource, you can show a field from the <i>${pkDSId}</i> DataSource (instead of showing the unique ID of the related record, which is just a number).<P>For example, if you have a relation field \"customerNumber\" on Order that stores the Customer that placed the order, you would set \"Display as\" to the <i>customerName</i> field, so that when you view an order, the Customer name is shown.<P>This is done via creating an <i>included field</i>.  Included fields don't really store data, instead they just <i>include</i> data from a related DataSource, dynamically, whenever a user is viewing records from the primary DataSource.  You can also add included fields later for any relation."
;_5=_5.evalDynamicString(this,{fkDSId:_4,pkDSId:_2
});return _5},getTitleHTML:function(){var _1=this.Super("getTitleHTML",arguments);return _1+"&nbsp;"+this.form.helpImgHTML
},visibleWhen:{_constructor:"AdvancedCriteria",operator:"and",criteria:[{fieldName:"type",operator:"notEqual",value:"Self"}]
},readOnlyWhen:{_constructor:"AdvancedCriteria",operator:"or",criteria:[{fieldName:"dsId",operator:"isNull"},{fieldName:"notPresentDS",operator:"equals",value:true},{fieldName:"enableDisplayAs",operator:"notEqual",value:true}
]
}
}
],initWidget:function(){var _1=this.getImgURL("[SKINIMG]actions/help.png");this.helpImgHTML="<img src='"+_1+"' width='12' height='12' valign='center'/>";this.Super("initWidget",arguments)},editRecord:function(_1){this.creator.addRelationButton.disable();_1.origFieldName=_1.fieldName;if(!_1.origIncludeField){_1.origIncludeField=_1.includeField||_1.displayField}
_1.enableDisplayAs=(_1.displayField!=null);_1.required=(_1.joinType!="outer");this.updateDataSourceChoices(_1);this.updateTypeChoices(_1);this.updateFieldNameHint(_1);this.updateFieldNameChoices(_1);this.updateDisplayAsChoices(_1);this.updateDisplayAsHint(_1);this.Super("editRecord",arguments);this.updateTreeMessage(_1);this.updateStoredOnMessage(_1);this.setFieldDefaults()},editNewRecord:function(_1){this.creator.addRelationButton.disable();if(_1)_1.joinType="outer";this.updateDataSourceChoices(_1);this.updateTypeChoices(_1);this.updateFieldNameHint(_1);this.updateFieldNameChoices(_1);this.updateDisplayAsChoices(_1);this.updateDisplayAsHint(_1);this.Super("editNewRecord",arguments);this.updateTreeMessage(_1);this.updateStoredOnMessage(_1);this.setFieldDefaults()},itemChanged:function(_1,_2){var _3=this.creator,_4=this.getValues()
;if("dsId"==_1.name){var _5=(_3.dataSource?_3.dataSource.ID:null);if(_3.session.get(_2)||_2==_5){this.updateTypeChoices(_4);this.updateFieldNameHint(_4);this.updateFieldNameValue();this.updateFieldNameChoices(_4,true);this.updateDisplayAsChoices(_4,true);this.updateDisplayAsHint(_4);this.updateFieldTitleValue();this.updateTreeMessage(_4);this.updateStoredOnMessage(_4);this.setValue("notPresentDS",false);this.setValue("relatedFieldName",null)}else{this.setValue("notPresentDS",true)}
}else if("type"==_1.name){this.updateFieldNameHint(_4);this.updateFieldNameValue();this.updateFieldNameChoices(_4);this.updateDisplayAsChoices(_4,true);this.updateDisplayAsHint(_4);this.updateFieldTitleValue();this.updateTreeMessage(_4);this.updateStoredOnMessage(_4);this.setValue("includeField",null);this.setValue("relatedFieldName",null)}else if("fieldName"==_1.name){this.updateFieldNameHint(_4)}else if("enableDisplayAs"==_1.name||"displayField"==_1.name){this.updateFieldTitleValue()}
if(this.valuesAreValid(false)){var _6=(this.saveOperationType=="add");if(!_6){_3.saveRelation(this.getValues(),_6)}else{_3.addRelationButton.enable()}
}else{_3.addRelationButton.disable()}
},setFieldDefaults:function(){var _1=this.creator,_2=(this.saveOperationType=="add")
;if(_2||this.getValue("displayField")){this.setValue("enableDisplayAs",true)}
var _3=this.getValue("dsId");if(_2){var _4=(_1.dataSource?_1.dataSource.ID:null);if(_3&&_3==_4){this.setValue("type","Self")}else{this.setValue("type","1-M")}
this.setValue("joinType","outer")}
if(!_2&&_3&&!_1.session.get(_3)){this.setValue("notPresentDS",true)}else{this.setValue("notPresentDS",false)}
},updateDataSourceChoices:function(_1){if(!this.creator.knownDataSources)return;var _2=this.creator,_3=_2.knownDataSources.getProperty("ID"),_4=(_2.dataSource?_2.dataSource.ID:null),_5={}
;if(_4&&!_3.contains(_4)){_3.add(_4)}
_3.sort(function(_8,_9){_8=_8.toLowerCase();_9=_9.toLowerCase();return(_8<_9?-1:_8==_9?0:1)});for(var i=0;i<_3.length;i++){var _7=_3[i];_5[_7]=(_7==_4?_7+" (tree via self-relation)":(!_2.session.get(_7)?_7+" (not present)":_7))}
this.getField("dsId").setValueMap(_5)},updateTypeChoices:function(_1){var _2=(_1?_1.dsId:null),_3=(this.creator.dataSource?this.creator.dataSource.ID:null),_4=this.creator.relationTypeDescriptions,_5=this.getField("type"),_6={}
;if(_2&&_2==_3){_6={"Self":"Tree self-relation"};_5.hide();_5.setValueMap(_6);_5.setValue("Self")}else{for(var _7 in _4){if(_7=="Self")continue;var _8=_4[_7];_8=_8.evalDynamicString(this,{currentDS:_3,relatedDS:_2||"&lt;related&gt;"
});_6[_7]=_8}
_5.setValueMap(_6);if(_5.getValue()=="Self"){_5.setValue(null)}
_5.show()}
},updateFieldNameHint:function(_1){var _2;if(_1){var _3=this.getForeignKeyDS(_1),_4=_1.fieldName,_5=_3&&(_3.getField(_4)!=null)
;if(_3){_2=" on <i>"+_3.ID+"</i> "
if(!_5&&_1.origFieldName&&_4!=_1.origFieldName){_2+="[rename field from <i>"+_1.origFieldName+"</i>]"}else{_2+=(_5?"[existing field] with title:":"[new field]")}
}
}
this.getField("fieldName").setHint(_2)},updateFieldNameValue:function(){var _1=this.creator,_2=this.getValue("dsId"),_3=(_1.dataSource?_1.dataSource.ID:null),_4=this.getValue("type"),_5=(_4=="1-M"?_1.dataSource:_1.session.get(_2))
;if(_5){var _6=(_5.title||_5.ID).replace(/ /g,""),_7=_6.substring(0,1).toLowerCase()+_6.substring(1)+"Id"
;if(_2&&_2==_3){_7="parent"+_6.substring(0,1).toUpperCase()+_6.substring(1)+"Id"}
this.setValue("fieldName",_7)}
},updateFieldNameChoices:function(_1,_2){var _3=this.creator,_4=_1&&_1.type,_5=_4&&_1.dsId
;if(!_5||!_3.session.get(_5)){this.getField("fieldName").setValueMap(null);return}
var _6=this.getForeignKeyDS(_1),_7=this.getPrimaryKeyDS(_1),_8=_6.getFieldNames(),_9=_7.getPrimaryKeyField(),_10=_9.type,_11=(_6.ID!=_7.ID),_12=[]
;if(_10=="sequence")_10="integer";for(var i=0;i<_8.length;i++){var _14=_8[i],_15=_6.getField(_14),_16=(_15.type=="sequence"?"integer":_15.type)
;if(_16==_10&&(_11||!_15.primaryKey)&&!_15.foreignKey){_12.add(_15.name)}
}
this.getField("fieldName").setValueMap(_12)},updateFieldTitleValue:function(){var _1=this.creator,_2=this.getValue("enableDisplayAs"),_3=(_2?this.getValue("displayField"):null),_4=this.getValue("dsId"),_5=_1.session.get(_4),_6=(_5?_5.title||_5.ID.replace(/\d+$/,""):null),_7=_6
;if(_3){var _8=this.getValue("type"),_9=(_8=="1-M"?_1.dataSource:_1.session.get(_4)),_10=_9.getField(_3)
;_7=_10&&(_10.title||isc.DS.getAutoTitle(_3));if(!_7||!_7.toLowerCase().contains(_6.toLowerCase())){_7=_6}
}
this.setValue("fieldTitle",_7);this.setValue("$2478",_7)},updateDisplayAsChoices:function(_1,_2){if(!_1)return;var _3=this.creator,_4=(_1.type=="M-1"?_1.dsId:_3.dataSource.ID),_5=_1.displayField,_6=this.getField("displayField"),_7=_2,_8
;if(_4){var _9=(_3.dataSource?_3.dataSource.ID:null),_10=(_4==_9?_3.dataSource:_3.session.get(_4))
;if(_10){_8=_10.getFieldNames();if(!_5||_2){var _11=_10.getTitleField();if(_11){_6.setValue(_11);_7=false}
}
}
}
if(_7)_6.clearValue();_6.setValueMap(_8)},updateDisplayAsHint:function(_1){var _2;if(_1&&_1.dsId){_2="from <i>"+(_1.type=="M-1"?_1.dsId:this.creator.dataSource.ID)+"</i>"}
this.getField("displayField").setHint(_2)},updateTreeMessage:function(_1){var _2=(_1?_1.dsId:null),_3=(this.creator.dataSource?this.creator.dataSource.ID:null),_4=this.getField("treeMessageSpacer"),_5=this.getField("treeMessage")
;if(_2&&_2==_3){_4.show();_5.show();_5.setValue("Each '"+_3+"' record may have multiple other '"+_3+"' records, in a tree.")}else{_4.hide();_5.hide()}
},updateStoredOnMessage:function(_1){var _2=this.getForeignKeyDS(_1),_3=this.getField("storedOnMessage"),_4,_5
;if(_2){_4="Relation data will be stored on the <i>"+_2.ID+"</i> DataSource";_5=isc.RelationEditor.shortHelpText
}
_3.setValue(_4);_3.setPrompt(_5)},getSelectedDS:function(_1){if(!_1)return null;var _2=this.creator;return(_1.dsId==_2.dataSource.ID?_2.dataSource:_2.session.get(_1.dsId))},getForeignKeyDS:function(_1){if(!_1)return null;return(_1.type=="1-M"?this.getSelectedDS(_1):this.creator.dataSource)},getPrimaryKeyDS:function(_1){if(!_1)return null;return(_1.type=="1-M"?this.creator.dataSource:this.getSelectedDS(_1))}
};isc.A.addRelationButtonDefaults={_constructor:"IButton",autoDraw:false,autoParent:"outerLayout",title:"Add Relation",wrap:false,autoFit:true,layoutAlign:"right",click:function(){this.creator.saveNewRelation()}
};isc.A.buttonLayoutDefaults={_constructor:"HLayout",autoDraw:false,width:"100%",height:42,layoutMargin:10,membersMargin:10,align:"right"
};isc.A.cancelButtonDefaults={_constructor:"IButton",autoDraw:false,title:"Cancel",width:75,autoParent:"buttonLayout",click:function(){this.creator.cancelClick()}
};isc.A.saveButtonDefaults={_constructor:"IButton",autoDraw:false,title:"Save",width:75,autoParent:"buttonLayout",click:function(){this.creator.saveClick()}
};isc.A.bodyProperties={overflow:"auto",layoutMargin:10
};isc.A.newRelationMessage="New ${type} relation added from ${sourceDSId} to ${targetDSId}.";isc.A.newRelationActionTitle="Click to view new fields on ${sourceDSId} DataSource";isc.B.push(isc.A.initWidget=function isc_RelationEditor_initWidget(){this.Super('initWidget',arguments);this.addAutoChild("instructionsPanel");this.addAutoChildren(["outerLayout","relationsList","addNewButton","relationForm","addRelationButton","buttonLayout"]);this.buttonLayout.addMember(this.createAutoChild("cancelButton"));this.buttonLayout.addMember(this.createAutoChild("saveButton"));if(!this.session){this.session=isc.DataSourceEditorSession.create({dsDataSource:this.dsDataSource,dataSources:this.knownDataSources,useLiveDataSources:this.useLiveDataSources
});this.$2502=true}else if(!this.knownDataSources){var _1=this.session;this.knownDataSources=_1.getDataSources().map(function(_2){return _1.get(_2.ID)})}
this.addRelation()}
,isc.A.destroy=function isc_RelationEditor_destroy(){if(this.session&&this.$2502)this.session.destroy();this.Super("destroy",arguments)}
,isc.A.edit=function isc_RelationEditor_edit(_1,_2){if(!this.knownDataSources&&!this.session){this.logWarn("'knownDataSources' not populated - ignoring relations edit")
return}
if(this.knownDataSources&&!this.session.dataSources){this.session.setDataSources(this.knownDataSources)}
var _3;if(!isc.isA.DataSource(_1)){_3=_1.defaults||_1;var _4=_3&&_3.ID;this.session.add(_4,_3,true);_1=this.session.get(_4)}
this.dataSource=null;this.dsDefaults=null;this.start(_1,_2)}
,isc.A.showNewRelationNotifications=function isc_RelationEditor_showNewRelationNotifications(_1,_2,_3,_4,_5){this.$217v=_3;var _6=this.$217w;if(!isc.isAn.emptyObject(_6)){for(var _7 in _6){var _8=_6[_7],_9=_8.type,_10=this.dataSource.ID,_11=_8.dsId
;if("M-1"==_9||"Self"==_9){if(_4)continue;_9=("M-1"==_9?"Many-to-1":_9)}else if("1-M"==_9){_9="1-to-many";_10=_8.dsId;_11=this.dataSource.ID}
var _12=this.newRelationMessage.evalDynamicString(this,{type:_9,sourceDSId:_10,targetDSId:_11
});var _13=this.newRelationActionTitle.evalDynamicString(this,{type:_9,sourceDSId:_10,targetDSId:_11
});var _14={duration:7000,canDismiss:true,messageIcon:"[SKIN]/Notify/checkmark.png",autoFitWidth:(_5==null),autoFitMaxWidth:550,appearMethod:"fade",disappearMethod:"fade",x:_1,y:_2
};if(_5!=null){_14.labelProperties={width:_5}}
isc.Notify.addMessage(_12,[{separator:"<BR>",title:_13,target:this,methodName:"notificationActionClicked",args:[_10]
}],null,_14
)}
}
}
,isc.A.notificationActionClicked=function isc_RelationEditor_notificationActionClicked(_1){if(this.$217v){this.fireCallback(this.$217v,["dsId"],[_1])}
}
,isc.A.save=function isc_RelationEditor_save(_1){this.pushEditsToSession();this.session.saveChanges(_1,{target:this,methodName:"dataSourceSaved"})}
,isc.A.getDefaults=function isc_RelationEditor_getDefaults(_1){return this.session.getDataSourceDefaults(_1)}
,isc.A.getFieldRenames=function isc_RelationEditor_getFieldRenames(_1){return this.session.getRenamedFields(_1)}
,isc.A.getFieldAdds=function isc_RelationEditor_getFieldAdds(_1){return this.session.getAddedFields(_1)}
,isc.A.getFieldDeletes=function isc_RelationEditor_getFieldDeletes(_1){return this.session.getRemovedFields(_1)}
,isc.A.waitUntilDrawn=function isc_RelationEditor_waitUntilDrawn(_1,_2){if(!this.isDrawn()){this.$2111={callback:_1,params:_2
};this.observe(this,"drawn","observer.$2112();");return}
this.fireCallback(_1,null,_2)}
,isc.A.$2112=function isc_RelationEditor__waitUntilDrawn(){if(this.isObserving(this,"drawn"))this.ignore(this,"drawn");var _1=this.$2111.callback,_2=this.$2111.params
;delete this.$2111;this.fireCallback(_1,null,_2)}
,isc.A.confirmConvertSampleDataMockDataSource=function isc_RelationEditor_confirmConvertSampleDataMockDataSource(_1,_2){var _3=this,_4=_1.ID
;var _5="To create a relation with this DataSource, it must be converted from sample data to editing fields and data separately.  Do this now?"
isc.ask(_5,function(_7){if(_7){var _6=_3.switchToEditFieldsAndDataSeparately(_1);_2(_6)}else{_3.cancelClick()}
},{buttons:[isc.Dialog.NO,isc.Dialog.YES
]
});isc.Dialog.Warn.delayCall("bringToFront")}
,isc.A.start=function isc_RelationEditor_start(_1,_2){var _3=this,_4=this.session
;if(!_4.isReady()){_4.waitForReady(function(){_3.start(_1,_2)});return}
this.relationsList.emptyMessage="Inspecting relations for "+_1.ID;this.relationsList.setData([]);if(isc.isA.MockDataSource(_1)&&!_1.hasExplicitFields()){var _5=_4.getDataSourceDefaults(_1.ID);if(!_4.isUpdated(_1.ID)||!_5.fields||_5.fields.length==0){this.waitUntilDrawn(function(_1,_2){_3.confirmConvertSampleDataMockDataSource(_1,function(_5){_3.start(_4.get(_1.ID),_2)})},[_1,_2]);return}
}
this.dataSource=_1;if(!this.dsDefaults){this.dsDefaults=_4.getDataSourceDefaults(_1.ID)}
this.relationForm.updateDataSourceChoices();var _6=_4.getRelations(),_7=this.dsDefaults&&_6.getRelationsForDataSource(this.dsDefaults.ID)
;this.originalRelations=isc.clone(_7);this.originalRelationsCount=_7.length;this.relationsList.emptyMessage="No relations defined for "+_1.ID;this.relationsList.setData(_7);if(_2){var _8={foreignKey:_2},_9=isc.DS.getForeignFieldName(_8),_10=isc.DS.getForeignDSName(_8,this.dataSource)
;for(var i=0;i<_6.length;i++){var _12=_6[i];if(_12.dsId==_10&&_12.relatedFieldName==_9){this.relationsList.selectSingleRecord(_12);break}
}
}else{this.addRelation()}
}
,isc.A.dsHasExistingField=function isc_RelationEditor_dsHasExistingField(_1,_2,_3){var _4=_1.ID;_1=this.session.get(_4);var _5=function(_14,_15){var _6=(isc.isA.DataSource(_1)?_1.getFieldNames():_1.fields.getProperty("name"));for(var i=0;i<_6.length;i++){if(_14[_6[i]]!=_15[_6[i]]){return false}
}
return true};var _8=this.relationsList,_9=_8.data,_10,_11
;for(var i=0;i<_9.length;i++){var _12=_9[i];if(_12.dsId!=_1.ID&&_12.type=="M-1"&&((_12.includeField!=null&&_12.includeField==_2)||(_12.includeField==null&&_12.displayField==_2)||(_12.origIncludeField!=null&&_12.origIncludeField==_2)))
{if(_8.recordMarkedAsRemoved(i)){_10=true}else{if(_3&&_5(_12,_3)){return}
_11=true}
}
}
if(!_11){var _13=function(_1,_2){if(isc.isA.DataSource(_1))return _1.getField(_2);return _1.fields.find("name",_2)}
_11=!_10&&(_13(_1,_2)!=null)}
return _11}
);isc.evalBoundary;isc.B.push(isc.A.addRelation=function isc_RelationEditor_addRelation(){this.relationsList.deselectAllRecords();this.relationForm.editNewRecord()}
,isc.A.saveNewRelation=function isc_RelationEditor_saveNewRelation(){if(!this.relationForm.valuesAreValid(false))return;this.saveRelation(this.relationForm.getValues(),true)}
,isc.A.removeRelation=function isc_RelationEditor_removeRelation(_1){var _2=this.relationsList.getRecordIndex(_1);if(this.relationsList.recordMarkedAsRemoved(_2)){if(_1.dsId!=this.dataSource.ID&&_1.type=="M-1"){var _3=_1.includeField||_1.displayField;if(this.dsHasExistingField(this.dataSource,_3)){if(_2<this.originalRelationsCount){var _4=this.relationsList,_5=_4.data
;for(var i=0;i<_5.length;i++){var _7=_5[i];if(!_4.recordMarkedAsRemoved(i)&&_7.dsId!=this.dataSource.ID&&_7.type=="M-1"&&((_7.includeField!=null&&_7.includeField==_3)||(_7.includeField==null&&_7.displayField==_3)||(_7.origIncludeField!=null&&_7.origIncludeField==_3)))
{_1=_7;break}
}
}else{}
var _8=_1.dsId+_1.displayField.substring(0,1).toUpperCase()+_1.displayField.substring(1),_9=_8,_10=2
;while(this.dsHasExistingField(this.dataSource,_8)){_8=_9+_10++}
_1.includeField=_8;if(this.relationsList.isSelected(_1)){this.relationsList.deselectRecord(_1);this.relationsList.selectSingleRecord(_1)}
}
}
this.relationsList.unmarkRecordRemoved(_2)}else{this.relationsList.markRecordRemoved(_2);this.addRelation()}
}
,isc.A.editRelation=function isc_RelationEditor_editRelation(_1){this.relationForm.editRecord(_1)}
,isc.A.saveRelation=function isc_RelationEditor_saveRelation(_1,_2){if(_2){this.relationsList.addData(isc.addProperties({},_1));this.addRelation()}else{var _3=this.relationsList.getSelectedRecord(),_4=this.relationsList.getRecordIndex(_3)
;isc.addProperties(_3,_1);if(!_1.enableDisplayAs)delete _3.displayField;delete _3.enableDisplayAs;delete _3.required;this.relationsList.refreshRow(_4)}
}
,isc.A.cancelClick=function isc_RelationEditor_cancelClick(){if(this.editComplete){this.editComplete(true)}
}
,isc.A.saveClick=function isc_RelationEditor_saveClick(){if(this.readOnly){this.editComplete(true)}
var _1=this;if(!this.addRelationButton.isDisabled()){isc.ask("Save without adding the relationship?",function(_2){if(_2){_1.$223q()}
})}else{this.$223q()}
}
,isc.A.$223q=function isc_RelationEditor__saveClick(){var _1=this.pushEditsToSession();var _2=!_1&&!this.$2509;this.editComplete(_2)}
,isc.A.openDataSource=function isc_RelationEditor_openDataSource(_1){var _2=this.session;this.pushEditsToSession();var _3=_2.get(_1),_4=_2.getDataSourceDefaults(_1)
;if(this.navigateToDataSource){this.navigateToDataSource(_1,_3,_4)}else{this.logWarn("Attempt to navigate to DataSource '"+_1+"' but method navigateToDataSource() is not defined. Ignoring.")}
}
,isc.A.pushEditsToSession=function isc_RelationEditor_pushEditsToSession(){var _1=this.relationsList.data,_2={}
;var _3={};for(var i=0;i<_1.length;i++){var _5=_1[i],_6=this.relationsList.recordMarkedAsRemoved(i)
;if(!_6&&_5.type=="M-1"){var _7=_5.dsId;_3[_7]=(_3[_7]||0)+1}
}
var _8=function(_11){return(_3[_11]!=null&&_3[_11]>1)};for(var i=0;i<_1.length;i++){var _5=_1[i];var _6=this.relationsList.recordMarkedAsRemoved(i),_9=false
;if(_6){if(i>=this.originalRelationsCount)continue;_5=this.originalRelations[i]}else if(i<this.originalRelationsCount){var _10=this.originalRelations[i];_9=(!this.relationsMatch(_10,_5)||(_5.type=='M-1'&&_8(_5.dsId)));if(_9){if(_10.type==_5.type&&_10.fieldName!=_5.fieldName){var _11=_5.dsId,_12=(_11==this.dataSource.ID?this.dataSource:this.session.get(_11))
;if(!_12.getField(_5.fieldName)){_5.renameFrom=_10.fieldName}
}
if(!_5.renameFrom){if(_10.dsId!=_5.dsId||_10.type!=_5.type||_10.fieldName!=_5.fieldName||(_5.type=='M-1'&&_8(_5.dsId)))
{this.saveRelationChange(_2,_10,true);_9=true}
}
}
if(!_9&&this.relationExtrasMatch(_10,_5))continue;_9=true}
this.saveRelationChange(_2,_5,_6,_8(_5.dsId));if(!_9&&!_6){if(!this.$217w)this.$217w={};this.$217w[_5.dsId]=_5}
}
if(!isc.isAn.emptyObject(_2)){var _13=this.session;for(var _14 in _2){var _15=_2[_14];this.updateForeignKeys(_14,_15,function(_11,_16){if(_16){_13.set(_11,_16)}
})}
}
return!isc.isAn.emptyObject(_2)}
,isc.A.relationsMatch=function isc_RelationEditor_relationsMatch(_1,_2){var _3=(_1.dsId==_2.dsId&&_1.type==_2.type&&_1.fieldName==_2.fieldName&&_1.joinType==_2.joinType);return _3}
,isc.A.relationExtrasMatch=function isc_RelationEditor_relationExtrasMatch(_1,_2){var _3=(_1.fieldTitle==_2.fieldTitle&&_1.displayField==_2.displayField&&_1.includeField==_2.includeField);return _3}
,isc.A.saveRelationChange=function isc_RelationEditor_saveRelationChange(_1,_2,_3,_4){var _5=_2.type,_6=("1-M"==_5?_2.dsId:this.dataSource.ID),_7=(_5=="1-M"?this.dataSource.ID:_2.dsId),_8=_2.fieldTitle,_9=_2.includeField,_10
;if(!_3&&_2.displayField){var _11=(_6==this.dataSource.ID?this.dataSource:this.session.get(_6)),_12
;if(_8&&_2.$2478&&_8!=_2.$2478){_9=isc.DataSourceEditor.createNameFromTitle(_8);_12=_9;if(this.dsHasExistingField(_11,_9,_2)||(_6==this.dataSource.ID&&_2.fieldName==_9))
{_9=null}
}
if(!_9){if(_4){_9=_2.fieldName+_2.displayField.substring(0,1).toUpperCase()+_2.displayField.substring(1);_10=_2.fieldName}else{_9=_7.substring(0,1).toLowerCase()+_7.substring(1)+_2.displayField.substring(0,1).toUpperCase()+_2.displayField.substring(1)}
if(!_12){_12=_9}
if(this.dsHasExistingField(_11,_9,_2)||(_6==this.dataSource.ID&&_2.fieldName==_9))
{_9=null}
}
if(!_9){_9=_7.substring(0,1).toLowerCase()+_7.substring(1);if(this.dsHasExistingField(_11,_9,_2)||(_6==this.dataSource.ID&&_2.fieldName==_9))
{_9=null}
}
if(!_9){_9=_12;var _13=2;while(this.dsHasExistingField(_11,_9,_2)){_9=_12+_13++}
}
}else if(!_3&&!_2.displayField&&_9){_9=null}
if(!_1[_6])_1[_6]=[];_1[_6].add({sourceDSId:_6,sourceFieldName:_2.fieldName,sourceFieldTitle:_2.fieldTitle,targetDSId:_7,targetFieldName:_2.relatedFieldName,displayField:_2.displayField,includeField:_9,includeVia:(_4?_2.fieldName:_10),joinType:_2.joinType,deleted:_3,renameFrom:_2.renameFrom
})}
,isc.A.updateForeignKeys=function isc_RelationEditor_updateForeignKeys(_1,_2,_3){var _4=this.session,_5=isc.clone(_4.getDataSourceDefaults(_1)),_6=_4.get(_1),_7=false
;var _8={};for(var i=0;i<_2.length;i++){var _10=_2[i],_11=_10.targetDSId
;if(!_10.deleted&&(_10.includeField||_10.displayField)){_8[_11]=(_8[_11]||0)+1}
}
var _12=function(_30){return(_8[_30]!=null&&_8[_30]>1)};for(var i=0;i<_2.length;i++){var _10=_2[i],_13=_10.sourceFieldName,_14=_10.sourceFieldTitle,_15=_10.renameFrom,_11=_10.targetDSId,_16=_10.targetFieldName,_17=this.session.get(_11),_18=_10.joinType
;var _19=_17&&_17.getPrimaryKeyField(),_20=_17&&_17.getPrimaryKeyFieldName()
;if(!_16)_16=_20;var _21=(_1!=_11?_11+".":"")+_16;var _22=_5.fields.find("name",_15||_13);if(!_22){var _23=_19.type;if(_23=="sequence")_23="integer";var _24={name:_13,type:_23,foreignKey:_21};if(_14)_24.title=_14;if(_18)_24.joinType=_18;_5.fields.add(_24);_4.recordAddedField(_1,_24.name);_22=_24;_7=true;isc.RelationEditor.addGeneratedField(_6,_13)}else{if(_10.deleted&&_22.foreignKey==_21){if(isc.RelationEditor.isGeneratedField(_6,_22.name)){_4.removeField(_1,_22.name,null,_5);isc.RelationEditor.removeGeneratedField(_6,_22.name)}else{var _25=_22.foreignKey;delete _22.foreignKey;delete _22.foreignDisplayField;delete _22.useLocalDisplayFieldValue;delete _22.joinType;_4.removeIncludeFieldsForForeignKey(_1,_25,_5);if(_22.displayField&&_5.fields.find("name",_22.displayField)==null){delete _22.displayField}
}
_7=true}else if(_10.deleted){}else if(!_22.foreignKey||_22.foreignKey!=_21||_22.joinType!=_18)
{var _23=_19.type;if(_23=="sequence")_23="integer";if(_22.type!=_23){_4.changeFieldType(_1,_22.name,_23,_5)}
_22.foreignKey=_21;if(!_18)delete _22.joinType;else _22.joinType=_18;_7=true}
if(_22.title!=_14){_22.title=_14;_7=true}
if(_22.name!=_13){_22.name=_13;_4.renameField(_1,_22.name,_13,_5);_7=true}
if(_22.displayField!=(_10.includeField||_10.displayField)){var _26=_5.fields.findIndex("name",_22.displayField);if(_26>=0){_4.removeField(_1,_22.displayField,null,_5);_7=true}
}
}
if(!_10.deleted&&(_10.includeField||_10.displayField)){var _27=_10.includeField||_10.displayField,_28=_11+"."+_10.displayField
;if(_10.displayField){if(_22.displayField!=_27){_22.displayField=_27;_7=true}
}else if(_22.displayField){delete _22.displayField;_7=true}
var _29=_5.fields.find("name",_27);if(!_29&&!_12(_11)){_29=_5.fields.find("includeFrom",_28)}
if(_29){if(_10.includeField){if(_29.name!=_10.includeField){_29.name=_10.includeField;_7=true}
}else if(_29.name){delete _29.name;_7=true}
if(_29.includeFrom!=_28){_29.includeFrom=_28;_7=true}
}else{var _24={includeFrom:_28,hidden:true};if(_10.includeField){_24.name=_10.includeField}
if(_10.includeVia){_24.includeVia=_10.includeVia}
_5.fields.add(_24);_4.recordAddedField(_1,_24.name);_22=_24;_7=true}
}
}
_3(_6.ID,(_7?_5:null));return _7}
,isc.A.switchToEditFieldsAndDataSeparately=function isc_RelationEditor_switchToEditFieldsAndDataSeparately(_1){var _2=this.session.standardizeMockDataSource(_1.ID);this.$2509=true;return _2}
);isc.B._maxIndex=isc.C+30;isc.RelationEditor.registerStringMethods({editComplete:"canceled",dataSourceSaved:"name,ds,isNew,originalName",dataSourceChanged:"name",navigateToDataSource:"dsName,liveDS,defaults"});isc.ClassFactory.defineClass("SimpleTreeRelationEditor","VLayout");isc.A=isc.SimpleTreeRelationEditor.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.membersMargin=10;isc.A.layoutTopMargin=5;isc.A.layoutLeftMargin=5;isc.A.layoutRightMargin=5;isc.A.relationFormDefaults={_constructor:"DynamicForm",autoDraw:false,autoFocus:true,wrapItemTitles:false,colWidths:[250,"*"],fields:[{name:"fieldName",type:"text",title:"Relation will be stored on<br>DataSource under field",wrapTitle:true,required:true,selectOnFocus:true,editorType:"ComboBoxItem",addUnknownValues:true,validators:[{type:"custom",condition:function(_1,_2,_3,_4,_5){if(!_3||(_4.origFieldName&&_4.origFieldName==_3))return true;var _6=_1.form.creator.dataSource,_7=_6.getField(_3),_8=true
;if(_7&&_7.primaryKey){_2.defaultErrorMessage
="The Primary Key cannot relate to it itself in a tree relation";_8=false}
if(_7&&_8){var _9=_7.type,_10=_6.getPrimaryKeyField(),_11=_10.type
;if((_9=="sequence"?"integer":_9)!=(_11=="sequence"?"integer":_11))
{_2.defaultErrorMessage
="Value matches an existing field that has a type that differs from the target primary key in "+_6.ID+". Please choose another field name.";_8=false}
}
return _8}
}
]
}
],editNewRecord:function(){this.Super("editNewRecord",arguments);this.updateFieldNameTitle();this.updateFieldNameChoices();this.updateFieldNameValue()},fieldNameTitle:"Relation will be stored on<br>DataSource '${dsId}' under field",updateFieldNameTitle:function(){var _1=this.creator.dataSource.ID,_2=this.fieldNameTitle.evalDynamicString(this,{dsId:_1})
;this.getField("fieldName").title=_2;this.getField("fieldName").redraw()},updateFieldNameChoices:function(){var _1=this.creator.dataSource,_2=_1.getFieldNames(),_3=_1.getPrimaryKeyField(),_4=_3.type,_5=[]
;if(_4=="sequence")_4="integer";for(var i=0;i<_2.length;i++){var _7=_2[i],_8=_1.getField(_7),_9=(_8.type=="sequence"?"integer":_8.type)
;if(_9==_4&&!_8.primaryKey&&!_8.foreignKey){_5.add(_8.name)}
}
this.getField("fieldName").setValueMap(_5)},updateFieldNameValue:function(){var _1=this.creator.dataSource;var _2=(_1.title||_1.ID).replace(/ /g,""),_3="parent"+_2.substring(0,1).toUpperCase()+_2.substring(1)+"Id",_4=_3,_5=2
;while(_1.getField(_4)!=null){_4=_3+_5;_5++}
this.setValue("fieldName",_4)}
};isc.A.buttonLayoutDefaults={_constructor:"HLayout",width:"100%",height:42,layoutMargin:10,membersMargin:10,align:"right"
};isc.A.cancelButtonDefaults={_constructor:"IButton",autoDraw:false,title:"Cancel",width:75,autoParent:"buttonLayout",click:function(){this.creator.cancelClick()}
};isc.A.saveButtonDefaults={_constructor:"IButton",autoDraw:false,title:"Save",width:75,autoParent:"buttonLayout",click:function(){this.creator.saveClick()}
};isc.A.bodyProperties={overflow:"auto",layoutMargin:10
};isc.B.push(isc.A.initWidget=function isc_SimpleTreeRelationEditor_initWidget(){this.Super('initWidget',arguments);this.addAutoChildren(["relationForm","buttonLayout"]);this.buttonLayout.addMember(this.createAutoChild("cancelButton"));this.buttonLayout.addMember(this.createAutoChild("saveButton"));if(!this.session){this.session=isc.DataSourceEditorSession.create({dsDataSource:this.dsDataSource
});this.$2502=true}
}
,isc.A.destroy=function isc_SimpleTreeRelationEditor_destroy(){if(this.session&&this.$2502)this.session.destroy();this.Super("destroy",arguments)}
,isc.A.edit=function isc_SimpleTreeRelationEditor_edit(_1){var _2;if(!isc.isA.DataSource(_1)){_2=_1.defaults||_1;var _3=_2&&_2.ID;this.session.add(_3,_2,true);_1=this.session.get(_3)}
this.dataSource=_1;this.dsDefaults=_2;if(!this.dsDefaults){var _4=this;var _5={ID:_1.ID,defaults:{ID:_1.ID},loadData:function(){}
};this.session.setDataSources([_5],function(){var _2=_4.session.getDataSourceDefaults(_1.ID);_4.edit({ID:_1.ID,defaults:_2
})});return}
if(isc.isA.MockDataSource(_1)&&!_1.hasExplicitFields()){var _6=this;this.waitUntilDrawn(function(_1){_6.confirmConvertSampleDataMockDataSource(_1,function(_2){_6.edit(_2)})},[_1]);return}
this.start()}
,isc.A.save=function isc_SimpleTreeRelationEditor_save(_1){this.pushEditsToSession();this.session.saveChanges(_1,{target:this,methodName:"dataSourceSaved"})}
,isc.A.waitUntilDrawn=function isc_SimpleTreeRelationEditor_waitUntilDrawn(_1,_2){if(!this.isDrawn()){this.$2111={callback:_1,params:_2
};this.observe(this,"drawn","observer.$2112();");return}
this.fireCallback(_1,null,_2)}
,isc.A.$2112=function isc_SimpleTreeRelationEditor__waitUntilDrawn(){if(this.isObserving(this,"drawn"))this.ignore(this,"drawn");var _1=this.$2111.callback,_2=this.$2111.params
;delete this.$2111;this.fireCallback(_1,null,_2)}
,isc.A.confirmConvertSampleDataMockDataSource=function isc_SimpleTreeRelationEditor_confirmConvertSampleDataMockDataSource(_1,_2){var _3=this,_4=_1.ID
;var _5="To create a relation with this DataSource, it must be converted from sample data to editing fields and data separately.  Do this now?"
isc.ask(_5,function(_7){if(_7){var _6=_3.switchToEditFieldsAndDataSeparately(_1);_2(_6)}else{_3.cancelClick()}
},{buttons:[isc.Dialog.NO,isc.Dialog.YES
]
});isc.Dialog.Warn.delayCall("bringToFront")}
,isc.A.start=function isc_SimpleTreeRelationEditor_start(){var _1=this,_2=this.session
;if(!_2.isReady()){_2.waitForReady(function(){_1.start()});return}
this.relationForm.editNewRecord()}
,isc.A.cancelClick=function isc_SimpleTreeRelationEditor_cancelClick(){if(this.editComplete){this.editComplete(true)}
}
,isc.A.saveClick=function isc_SimpleTreeRelationEditor_saveClick(){if(!this.relationForm.validate())return;var _1=this.pushEditsToSession();var _2=!_1&&!this.$2509;this.editComplete(_2)}
,isc.A.pushEditsToSession=function isc_SimpleTreeRelationEditor_pushEditsToSession(){if(!this.relationForm.validate())return;var _1=this.session,_2=this.relationForm.getValues(),_3=this.dataSource,_4=this.dataSource,_5=_4.getPrimaryKeyField(),_6=_4.getPrimaryKeyFieldName(),_7=_6,_8=_3.ID,_9=_2.fieldName,_10=_4.ID
;var _11=_1.getDataSourceDefaults(_8);if(_11.fields.find("name",_9)==null){_11=isc.clone(_11);var _12=_10+"."+_7,_13=_5.type;if(_13=="sequence")_13="integer";var _14={name:_9,type:_13,foreignKey:_12,hidden:true};_11.fields.add(_14);_1.set(_8,_11)}
return _1.isUpdated(_8)}
,isc.A.switchToEditFieldsAndDataSeparately=function isc_SimpleTreeRelationEditor_switchToEditFieldsAndDataSeparately(_1){var _2=this.session.standardizeMockDataSource(_1.ID);this.$2509=true;return _2}
);isc.B._maxIndex=isc.C+12;isc.RelationEditor.registerStringMethods({editComplete:"canceled",dataSourceSaved:"name,ds"})}
isc.ClassFactory.defineClass("DSRelations");isc.A=isc.DSRelations;isc.A.relationTypeDescriptionMap={"1-M":"1-to-many","M-1":"many-to-1","Self":"tree self-relation"
};isc.A=isc.DSRelations.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.setDataSources=function isc_DSRelations_setDataSources(_1){this.dataSources=_1;this.reset()}
,isc.A.reset=function isc_DSRelations_reset(){delete this.$2106}
,isc.A.getRelationsForDataSource=function isc_DSRelations_getRelationsForDataSource(_1){this.buildRelations();var _2=this.$2106,_3=_2[_1],_4={}
;for(var _5 in _2){if(_5==_1)continue;var _6=_2[_5];for(var i=0;i<_6.length;i++){var _8=_6[i];if(_8.relatedDS==_1){if(!_4[_5])_4[_5]=[];_4[_5].add(_8)}
}
}
var _9=[];if(_3){for(var i=0;i<_3.length;i++){var _8=_3[i],_10=(_1==_8.relatedDS?"Self":"M-1"),_11=_8.displayField
;_9.add({type:_10,fieldName:_8.fieldName,fieldTitle:_8.fieldTitle,dsId:_8.relatedDS,relatedFieldName:_8.relatedFieldName,displayField:_11,joinType:_8.joinType
})
}
}
for(var _5 in _4){var _6=_4[_5];for(var i=0;i<_6.length;i++){var _8=_6[i];_9.add({type:"1-M",fieldName:_8.fieldName,fieldTitle:_8.fieldTitle,dsId:_5,relatedFieldName:_8.relatedFieldName,displayField:_8.displayField,joinType:_8.joinType
})
}
}
return _9}
,isc.A.getAllRelationsForDataSource=function isc_DSRelations_getAllRelationsForDataSource(_1){this.buildRelations();var _2=this.getRelationsForDataSource(_1);do{var _3=[];for(var i=0;i<_2.length;i++){var _5=_2[i],_6=this.getRelationsForDataSource(_5.dsId)
;if(_6&&_6.length>0){for(var j=0;j<_6.length;j++){var _8=_6[j];if(_8.dsId!=_1&&!_2.find("dsId",_8.dsId)&&!_3.find("dsId",_8.dsId))
{_8.parentDsId=_5.dsId;_3.add(_8)}
}
}
if(!_5.parentDsId)_5.parentDsId=_1}
_2.addList(_3)}while(_3.length>0);return _2}
,isc.A.getIncludeFromDependencyTree=function isc_DSRelations_getIncludeFromDependencyTree(){var _1=this.dataSources,_2={}
;for(var i=0;i<_1.length;i++){var _4=_1[i],_5=_4.ID,_6=_4.getFieldNames()
;var _7=_2[_5]=[];for(var j=0;j<_6.length;j++){var _9=_6[j],_10=_4.getField(_9)
;if(_10&&_10.includeFrom){var _11=_10.includeFrom.split(".");if(_11&&_11.length>=2){_7.add(_11[0])}
}
}
}
var _12=[];for(var i=0;i<_1.length;i++){var _5=_1[i].ID,_7=_2[_5]
;if(!_7||_7.length==0){_12.add({id:_5});this.$238c(_12,_5,_2)}else{var _13=false;for(var j=0;j<_7.length;j++){if(isc.DS.get(_7[j])){_13=true;break}
}
if(!_13){_12.add({id:_5});this.$238c(_12,_5,_2)}
}
}
return isc.Tree.create({data:_12
})}
,isc.A.getFieldReferences=function isc_DSRelations_getFieldReferences(_1,_2){var _3=this.getAllRelationsForDataSource(_1),_4=_1+"."+_2,_5=[]
;for(var i=0;i<_3.length;i++){var _7=_3[i],_8=_7.dsId,_9=this.dataSources.find("ID",_8),_10=_9&&_9.getFieldNames()
;if(_9){for(var j=0;j<_10.length;j++){var _12=_10[j],_13=_9.getField(_12)
;if(_13.includeFrom&&_13.includeFrom.endsWith(_4)){_5.add({dsId:_8,fieldName:_13.name||_13.includeFrom
})}
}
}
}
return _5}
,isc.A.$238c=function isc_DSRelations__addDependenciesToNode(_1,_2,_3){for(var _4 in _3){var _5=_3[_4];if(_5&&_5.contains(_2)&&!_1.containsProperty("id",_4)){_1.add({id:_4,parentId:_2});this.$238c(_1,_4,_3)}
}
}
,isc.A.updateIncludeFromReferences=function isc_DSRelations_updateIncludeFromReferences(_1,_2,_3){var _4=this.dataSources,_5={}
;for(var i=0;i<_4.length;i++){var _7=_4[i],_8=_7.getFieldNames()
;for(var j=0;j<_8.length;j++){var _10=_8[j],_11=_7.getField(_10)
;if(_11&&_11.includeFrom){for(var _12 in _2){if(_1==_7.ID&&_11.includeFrom==_12){if(_5[_7.ID]==null)_5[_7.ID]={};_5[_7.ID][_10]=_2[_12]}else if(_11.includeFrom==_1+"."+_12){if(_5[_7.ID]==null)_5[_7.ID]={};_5[_7.ID][_10]=_1+"."+_2[_12]}
}
}
}
}
if(_5&&!isc.isAn.emptyObject(_5)){var _13=this,_14=isc.getKeys(_5),_15=_14.length
;for(var _1 in _5){this.getDataSourceDefaults(_1,function(_19,_20){var _16=_5[_19],_17=_20.fields
;for(var i=0;i<_17.length;i++){var _11=_17[i],_10=_11.name
;if(!_10&&_11.includeFrom!=null){var _18=_11.includeFrom.split(".");if(_18!=null&&_18.length>=2){_10=_18.last()}
}
if(!_10)continue;if(_16[_10]!=null&&_11.includeFrom){_11.includeFrom=_16[_10]}
}
_13.saveDataSource(_20,function(){_13.createLiveInstance(_20);if(--_15==0){if(_3)_3(_14)}
})})}
}else{if(_3)_3()}
}
,isc.A.removeRelationsToDataSource=function isc_DSRelations_removeRelationsToDataSource(_1,_2,_3,_4){var _5=this.getForeignKeyFields(_1),_6=false
;if(!isc.isAn.emptyObject(_5)){for(var _7 in _5){var _8=_5[_7],_9=_8.foreignKey
;if(_9.indexOf(".")>=0)_9=_9.split(".")[0];if(_9==_2){_6=true;break}
}
}
if(!_6){_4();return}
var _10=this;this.getDataSourceDefaults(_1.ID,function(_18,_19){var _11=[],_12;var _13=_19.fields;for(var i=0;i<_13.length;i++){var _15=_13[i];if(_15.foreignKey){var _16=_15.foreignKey;if(_16.indexOf(".")>=0)_16=_16.split(".")[0];if(_16==_2){if(_3){_11.add(_15)}else{delete _15.foreignKey;delete _15.foreignDisplayField;delete _15.useLocalDisplayFieldValue;delete _15.joinType;_12=true}
}
}
if(_15.includeFrom){var _16=_15.includeFrom,_17=_16.split(".")
;if(_17&&_17.length>=2){_16=_17[_17.length-2]}
if(_16==_2){_11.add(_15)}
}
}
if(_11.length==0){_4();return}
_13.removeList(_11);_10.saveDataSource(_19,_4)})}
,isc.A.buildRelations=function isc_DSRelations_buildRelations(){if(this.$2106)return;var _1=this.dataSources||[],_2={}
;var _3=this;_1.map(function(_10){if(!_10)return;var _4=_3.getForeignKeyFields(_10);if(!isc.isAn.emptyObject(_4)){for(var _5 in _4){var _6=_4[_5],_7=(_6.title&&_6.title!=isc.DS.getAutoTitle(_5)?_6.title:null),_8=isc.DS.getForeignFieldName(_6),_9=isc.DS.getForeignDSName(_6,_10)
;if(!_2[_10.ID])_2[_10.ID]=[];_2[_10.ID].add({fieldName:_5,fieldTitle:_7,foreignKey:_6.foreignKey,relatedDS:(_9?_9:null),relatedFieldName:_8,displayField:_6.displayField,joinType:_6.joinType
})}
}
});this.$2106=_2}
,isc.A.getForeignKeyFields=function isc_DSRelations_getForeignKeyFields(_1){var _2=_1.fields,_3={}
;for(var _4 in _2){var _5=_2[_4];if(_5.foreignKey){_3[_5.name]=_5}
}
return _3}
,isc.A.getDataSourceDefaults=function isc_DSRelations_getDataSourceDefaults(_1,_2){isc.DataSourceEditor.fetchDataSourceDefaults(this.dsDataSource,_1,_2)}
,isc.A.saveDataSource=function isc_DSRelations_saveDataSource(_1,_2){var _3=_1._constructor||"DataSource",_4;if(isc.DS.isRegistered(_3)){_4=isc.DS.get(_3)}else{_4=isc.DS.get("DataSource");_1._constructor=_3}
var _5=_4.xmlSerialize(_1);this.dsDataSource.saveFile({fileName:_1.ID,fileType:"ds",fileFormat:"xml"
},_5,function(){_2()},{operationId:"allOwners"
})}
,isc.A.createLiveInstance=function isc_DSRelations_createLiveInstance(_1){var _2=_1._constructor||"DataSource";isc.ClassFactory.getClass(_2).create(_1,{sourceDataSourceID:this.dsDataSource.ID
})}
);isc.B._maxIndex=isc.C+14;if(isc.ListGrid!=null&&isc.DynamicForm!=null){isc.ClassFactory.defineClass("DSBindingEditorListGrid","ListGrid");isc.A=isc.DSBindingEditorListGrid.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.transferRecords=function isc_DSBindingEditorListGrid_transferRecords(_1,_2,_3,_4,_5){if(this.pickerRole=="current"){var _6=this!=_4;if(_3==null){_3=this.getTotalRows()}
for(var i=0;i<_1.length;i++){var _8=_1[i];_8.order=_3+i}
var _9=_3+_1.length;for(var _10=_3;_10<this.getTotalRows();_10++){var _8=this.getRecord(_10);if(_6||!_1.contains(_8)){_8.order=_9++}
}
}
return this.Super("transferRecords",arguments)}
,isc.A.getContiguousSelection=function isc_DSBindingEditorListGrid_getContiguousSelection(){var _1=this.getSelectedRecords(),_2=(_1==null?0:_1.length);if(_2==0)return null;var _3=this.getRecordSetBounds(_1,-1);var _4=[];for(var i=1;i<_2;++i){var _6=_1[i];if(_4.length==0&&this.getRecord(_3+i)!=_6||_4.length>0)_4.add(_6)}
this.deselectRecords(_4);return this.getSelectedRecords()}
,isc.A.getRecordSetBounds=function isc_DSBindingEditorListGrid_getRecordSetBounds(_1,_2,_3){if(_3==null)_3=0;var _4=this.getTotalRows();switch(_2){case-1:var _5=this.getRecordIndex(_1.first());if(_5>=0){return Math.max(_5-_3,0)}
break;case 1:var _5=this.getRecordIndex(_1.last());if(_5>=0){return Math.min(_5+_3+1,_4)}
break}
return null}
);isc.B._maxIndex=isc.C+3;isc.ClassFactory.defineClass("DSBindingEditorGridView","VLayout");isc.A=isc.DSBindingEditorGridView.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.persistFormDefaults={_constructor:"DynamicForm",itemChanged:function(_1,_2){this.grid.autoPersistViewState=(_2?["field","sort"]:null);if(_2){this.grid.setHilites()}else{this.grid.clearSavedViewState()}
}};isc.A.persistFieldDefaults={name:"persist",type:"boolean",title:"Auto-save preferences",showTitle:false,align:"center",colSpan:2};isc.B.push(isc.A.initWidget=function isc_DSBindingEditorGridView_initWidget(){this.Super(this.$oc,arguments);var _1=isc.SectionStack.create({height:5,overflow:"visible",sections:[{title:this.title,canCollapse:false}]
});this.addMember(_1);if(this.showPersistState){this.addAutoChild("persistForm",{fields:[isc.addProperties({},this.persistFieldDefaults)]
})
}}
,isc.A.addMember=function isc_DSBindingEditorGridView_addMember(_1){if(isc.isA.ListGrid(_1)){this.grid=_1;if(this.persistForm){this.persistForm.grid=_1;this.persistForm.setValues({persist:(_1.autoPersistViewState!=null)});this.Super("addMember",[_1,1]);return}
}
this.Super("addMember",arguments)}
,isc.A.setPersistState=function isc_DSBindingEditorGridView_setPersistState(_1){if(this.persistForm){this.persistForm.setValue("persist",_1)}}
,isc.A.getPersistState=function isc_DSBindingEditorGridView_getPersistState(){return this.persistForm.getValue("persist")}
);isc.B._maxIndex=isc.C+4;isc.ClassFactory.defineClass("DSBindingEditorShuttle","HLayout");isc.A=isc.DSBindingEditorShuttle.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.availableViewDefaults={_constructor:"DSBindingEditorGridView"};isc.A.currentViewDefaults={_constructor:"DSBindingEditorGridView"};isc.A.buttonStackDefaults={align:"center",overflow:"visible",layoutAlign:"center"};isc.B.push(isc.A.applyCurrentFields=function isc_DSBindingEditorShuttle_applyCurrentFields(_1){var _2=this.editor.editContext,_3=_1.liveObject,_4=_3.editProxy,_5=this.editor.dataSource||_3.getDataSource()
;var _6=_2.getEditNodeTree(),_7=_6.getChildren(_1),_8=this.currentView.grid,_9=_8.getTotalRows(),_10=[]
;for(var i=0;i<_9;i++){_10.add(_8.getRecord(i))}
var _12=[],_13;if(_7&&_7.length>0){var _14=[],_15=[]
;for(var i=0;i<_7.length;i++){var _16=_7[i];if(_16.type!="DynamicProperty"&&!isc.isA.DataSource(_16.liveObject)){if(!_10.find("name",_16.ID)){_15.add(_16)}else{var _17=isc.addProperties({},_16.defaults);_12.add(_17);_14.add(isc.addProperties({},_17))}
}
}
if(_15.length>0){_3.setFields(_14);for(var i=0;i<_15.length;i++){_2.removeNode(_15[i],true)}
_13=true}
}
_7=_6.getChildren(_1);var _18=[],_19
;var _20=function(_26,_27){var _19=false;if(_26.hidden&&!_27.hidden){_27.hidden=true;_19=true}else if(!_26.hidden&&_27.hidden){if(_26.detail){_27.hidden=false}else{delete _27.hidden}
_19=true}
return _19}
for(var i=0;i<_10.length;i++){var _21=_10[i],_17=_12.find("name",_21.name)
;if(_17){if(isc.isA.ListGrid(_3)){_19=_20(_21,_17)||_19}
_18.add(_17);var _16=_7.find("name",_17.name);if(_16){_19=_20(_21,_16.defaults)||_19;var _22=_7.findIndex("name",_17.name);if(_22!=i+1){_2.reorderNode(_1,_22,i+1);_19=true}
}
}else{var _23=isc.addProperties({},_21),_24={}
;_18.add(_23);if(_23.top!=null||_23.left!=null){_24={top:_23.top,left:_23.left}}
if(isc.isA.ListGrid(_3)){if(_23.hidden){_24.hidden=_23.hidden}else if(!_23.hidden&&_23.detail){_24.hidden=false}
}else if(_23.hidden){delete _23.hidden}
var _25=_4.makeFieldPaletteNode(_2,_23,_5,_24);var _16=_2.makeEditNode(_25);_2.addNode(_16,_1,i+1,null,true);_19=true}
}
if(_19){if(_4.layoutNewFields){_4.layoutNewFields(_5,_18)}
_3.setDataSource(_5,_18)}
if(_13||_19){_7=_6.getChildren(_1);for(var i=0;i<_12.length;i++){var _17=_12[i],_16=_7.find("name",_17.name);if(_16){var _23=(_3.getFieldByName?_3.getFieldByName(_17.name):_3.getField(_17.name));_16.liveObject=_23;if(_23&&_23.setEditMode){_23.setEditMode(true,_2,_16)}
}
}
}}
,isc.A.applyPersistState=function isc_DSBindingEditorShuttle_applyPersistState(_1){if(this.currentView.showPersistState){var _2=this.editor.editContext,_3=this.currentView.getPersistState()
;if(_3){_2.setNodeProperties(_1,{autoPersistViewState:true})}else{_2.setNodeProperties(_1,{autoPersistViewState:null});_2.removeNodeProperties(_1,"autoPersistViewState")}
}}
,isc.A.save=function isc_DSBindingEditorShuttle_save(){var _1=this.editor.editNode,_2=_1.liveObject
;this.applyPersistState(_1);this.applyCurrentFields(_1);if(_2.autoFetchData){_2.fetchData()}
return true}
,isc.A.initWidget=function isc_DSBindingEditorShuttle_initWidget(){this.Super(this.$oc,arguments);var _1=this.editor;this.availableView=this.createAutoChild("availableView",{shuttle:this,title:_1.availableFieldsTitle
});this.currentView=this.createAutoChild("currentView",{shuttle:this,title:_1.currentFieldsTitle,showPersistState:isc.isA.ListGrid(_1.dataBoundComponent)
});this.initTransferArrows();this.addMembers([this.availableView,this.horizontalArrows,this.currentView,this.verticalArrows
])}
,isc.A.initTransferArrows=function isc_DSBindingEditorShuttle_initTransferArrows(){var _1=this.currentView,_2=this.availableView;this.horizontalArrows=isc.VLayout.create({width:24,membersMargin:5,members:[isc.ImgButton.create({height:22,imageType:"center",showDown:false,align:"center",src:"[SKINIMG]TransferIcons/right_all.png",prompt:"Move all fields right",click:function(){_2.grid.selectAllRecords();_1.grid.transferSelectedFieldRecords(_2.grid,true)}
}),isc.ImgButton.create({height:22,imageType:"center",showDown:false,align:"center",src:"[SKINIMG]TransferIcons/right.png",prompt:"Move selected fields right",click:function(){_1.grid.transferSelectedFieldRecords(_2.grid,true)}
}),isc.ImgButton.create({height:22,imageType:"center",showDown:false,src:"[SKINIMG]TransferIcons/left.png",prompt:"Move selected fields left",click:function(){var _3=_1.grid.getSelectedRecords();_2.grid.creator.canRemoveFields(_3,function(){_2.grid.transferSelectedData(_1.grid)})}
}),isc.ImgButton.create({height:22,imageType:"center",showDown:false,src:"[SKINIMG]TransferIcons/left_all.png",prompt:"Move all fields left",click:function(){_1.grid.selectAllRecords();var _3=_1.grid.getSelectedRecords();_2.grid.creator.canRemoveFields(_3,function(){_2.grid.transferSelectedData(_1.grid)})}
})]
},this.buttonStackDefaults);var _4=function(_9){var _5=_1.grid,_6=_5.getSelection()||[],_7=_9==-1?0:_5.getTotalRows();_5.transferRecords(_6,null,_7,_5);_5.scrollToRow(_7)};var _8=function(_9){var _5=_1.grid,_6=_5.getContiguousSelection();if(_6){var _7=_5.getRecordSetBounds(_6,_9,1);_5.transferRecords(_6,null,_7,_5);_5.scrollToRow(_7-(_9+1)/2)}
};if(this.editor.showFieldOrderButtons){this.verticalArrows=isc.VLayout.create({width:24,membersMargin:5,disabled:true,members:[isc.ImgButton.create({height:22,imageType:"center",showDown:false,src:"[SKINIMG]TransferIcons/up_first.png",prompt:"Move selected field to top",click:function(){_4(-1)}
}),isc.ImgButton.create({height:22,imageType:"center",showDown:false,src:"[SKINIMG]TransferIcons/up.png",prompt:"Move selected field up",click:function(){_8(-1)}
}),isc.ImgButton.create({height:22,imageType:"center",showDown:false,src:"[SKINIMG]TransferIcons/down.png",prompt:"Move selected field down",click:function(){_8(1)}
}),isc.ImgButton.create({height:22,imageType:"center",showDown:false,src:"[SKINIMG]TransferIcons/down_last.png",prompt:"Move selected field to bottom",click:function(){_4(1)}
})
]
},this.buttonStackDefaults)}}
);isc.B._maxIndex=isc.C+5;isc.ClassFactory.defineClass("DSBindingEditor","VLayout");isc.A=isc.DSBindingEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.layoutMargin=10;isc.A.membersMargin=10;isc.A.defaultWidth=800;isc.A.defaultHeight=425;isc.A.showFieldOrderButtons=true;isc.A.availableFieldsTitle="DataSource Fields";isc.A.currentFieldsTitle="Component Fields";isc.A.availableTitleTitle="Name";isc.A.currentTitleTitle="Field Title";isc.A.instructionsPanelDefaults={_constructor:"InstructionsPanel",paneHeight:135,helpDialogId:"DSBindingEditorInstructions"};isc.A.gridInstructions="Choose which fields should appear by default in your grid. Use the <i>Initially Visible</i> (${hiddenIcon}) checkboxes to decide which fields are shown by default.<p>Users can then use the built-in grid header menus to show any other fields that appear in the right-side list.<p>If you check \"Auto-save preferences\", the grid will remember which fields were showing, and other details like column widths set by the user.";isc.A.dbcInstructions="Your component can show all the fields from the DataSource, or just some.<p>For example, you may have a DataSource with a lot of fields, so that you need to split the fields across multiple tabs or sections or even steps of a wizard.<p>In this case, create a separate form for each tab, section or step, each showing just some of the fields from the DataSource.  Then, if you use a ValuesManager to link all the forms, you can perform Actions like <i>Save Data</i> or <i>Clear Values</i> on the ValuesManager, and it will work on all the forms at once.";isc.A.commonInstructions="Hold down the <i>Shift</i> key when clicking to select a continous range of fields or the <i>${ctrlKey}</i> key to select multiple fields that aren't adjacent.";isc.A.saveAndExitButtonTitle="Bind";isc.A.cancelButtonTitle="Cancel";isc.A.removeItemTitle="Remove";isc.A.sortAvailableFields=true;isc.A.availableFieldsSortDirection="ascending";isc.A.availableFieldsGridDefaults={canGroupBy:false,pickerRole:"available",dataFetchMode:"basic",dragDataAction:"move",canFreezeFields:false,showFilterEditor:true,filterOnKeypress:true,canDragRecordsOut:true,loadDataOnDemand:false,dragRecategorize:"never",autoFitWidthApproach:"both",useAllDataSourceFields:true,canAcceptDroppedRecords:true,recordEnabledProperty:"$1023",autoFetchTextMatchStyle:"substring",recordDrop:function(_1,_2,_3,_4){var _5=this;this.creator.canRemoveFields(_1,function(){_5.transferRecords(_1,_2,(this.canReorderRecords?_3:null),_4)});return false},transferRecords:function(_1,_2,_3,_4,_5){for(var i=_1.length-1;i>=0;i--){var _7=_1[i];if(_7.type==null){_1.removeAt(i)}
}
this.Super("transferRecords",[_1,_2,_3,_4,function(){var _8=this.getSelection();if(_8.length>0){_4.removeSelectedData(null,null,function(){if(_5)_5()})}else{if(_5)_5()}
}])}};isc.A.currentFieldsGridDefaults={canGroupBy:false,canSort:false,pickerRole:"current",dataFetchMode:"basic",dragDataAction:"move",canFreezeFields:false,showFilterEditor:false,canDragRecordsOut:true,loadDataOnDemand:false,dragRecategorize:"never",autoFitWidthApproach:"both",useAllDataSourceFields:true,canAcceptDroppedRecords:true,recordEnabledProperty:"$1023",autoFetchTextMatchStyle:"substring",canReparentNodes:true,canReorderRecords:true,initWidget:function(){this.Super(this.$oc,arguments);this.booleanFalseImage=isc.CheckboxItem?isc.CheckboxItem.getInstanceProperty("checkedImage"):null;this.booleanTrueImage=isc.CheckboxItem?isc.CheckboxItem.getInstanceProperty("uncheckedImage"):null;this.booleanImageWidth=isc.CheckboxItem?isc.CheckboxItem.getInstanceProperty("valueIconWidth"):null;this.booleanImageHeight=isc.CheckboxItem?isc.CheckboxItem.getInstanceProperty("valueIconHeight"):null},transferSelectedFieldRecords:function(_1,_2){var _3=this;_3.transferSelectedData(_1,null,!_2?null:function(_5){var _4=_3.getRecordIndex(_5[0]);if(_4>=0)_3.scrollToRow(_4)})},selectionUpdated:function(_1,_2){if(_1){this.creator.shuttle.verticalArrows.enable()}else{this.creator.shuttle.verticalArrows.disable()}
}};isc.A.removeSingleCustomizedFieldMessage="This field has a customized binding.<br><br>Really remove it?";isc.A.removeMultipleCustomizedFieldsMessage="The following fields have customized bindings: ${fieldList}.<br><br>Really remove them?";isc.A.orderFieldDefaults={name:"order",hidden:true};isc.A.titleFieldDefaults={name:"title",prompt:"The name of this field that users of your applications will see",formatCellValue:function(_1,_2,_3,_4,_5){if(!_2)_2={};var _6=this.$212s(_1,_2.includeFrom);if(_2.includeFrom&&!_2.title){_6="<i>"+_6+"</i>"}else if(!_2.title){var _7=isc.DataSource.getAutoTitle(_2.name);_6="<i>"+_7+"</i>"}
return _6},showHover:true,hoverHTML:function(_1,_2,_3,_4,_5){var _6;if(_1.includeFrom&&!_1.title){_6="Using title from related field"}else if(!_1.title){_6="Title automatically derived from field name"}
return _6},$212s:function(_1,_2){if(_1||!_2){return _1}else{if(_2){var _3=_2.split(".");if(_3&&_3.length>=2){var _4=_3[_3.length-2],_5=_3[_3.length-1],_6=isc.DS.get(_4)
;if(_6){var _7=_6.getField(_5);if(_7&&_7.title){_1=_7.title}
}
}
}
return _1}
}};isc.A.nameFieldDefaults={name:"name",prompt:"Internal name for your field. Users of your application will not see this name, but it will appear in exported code and in some advanced areas of this design tool",formatCellValue:function(_1,_2,_3,_4,_5){if(!_2)_2={};var _6=this.$97t(_1,_2.includeFrom);if(_2.primaryKey){_6="<b>"+_6+"</b>"}
if(_2.includeFrom){_6+=" [Included from: <i>"+_2.includeFrom+"</i>]"}
return _6},$97t:function(_1,_2){if(_1||!_2){return _1}else{var _3=_2.lastIndexOf(".");if(_3==-1){return _1}else{return _2.substring(_3+1)}
}
},showHover:true,hoverHTML:function(_1,_2,_3,_4,_5){var _6;if(_1.primaryKey){_6="Primary Key: The Primary Key (PK) uniquely identifies each DataSource record and allows related data across DataSources to be displayed together."}else if(_1.includeFrom){var _7=_1.includeFrom.split(".");if(_7&&_7.length>=2){var _8=_7[_7.length-2],_9=_7[_7.length-1]
;_6="This field shows a value from the field <i>"+_9+"</i> in the related DataSource <i>"+_8+"</i><p>To include a different field, just remove the included field and add a new one"}
}
return _6}};isc.A.typeFieldDefaults={name:"type",autoFitWidth:true,formatCellValue:function(_1,_2,_3,_4,_5){if(!_2)_2={};return(_1&&_2.primaryKey?"<b>"+_1+"</b>":_1)},showHover:true,hoverHTML:function(_1,_2,_3,_4,_5){var _6;if(_1.primaryKey){_6="Primary Key: The Primary Key (PK) uniquely identifies each DataSource record and allows related data across DataSources to be displayed together."}
return _6}};isc.A.hiddenFieldDefaults={name:"hidden",icon:"actions/preview.png",showTitle:false,prompt:"Initially visible",canEdit:true};isc.A.buttonLayoutConstructor="HLayout";isc.A.buttonLayoutDefaults={height:5,align:"right",overflow:"visible",membersMargin:10,defaultLayoutAlign:"center"};isc.A.saveAndExitButtonConstructor="IButton";isc.A.saveAndExitButtonDefaults={click:"this.editor.saveClick()"};isc.A.cancelChangesButtonConstructor="IButton";isc.A.cancelChangesButtonDefaults={click:"this.editor.closeClick()"};isc.B.push(isc.A.canRemoveFields=function isc_DSBindingEditor_canRemoveFields(_1,_2){var _3=this.editContext.getEditNodeTree(),_4=_3.getChildren(this.editNode),_5=[]
;for(var i=0;i<_1.length;i++){var _7=_1[i],_8=_4.find("ID",_7.name),_9=_8&&_8.liveObject
;if(_9&&(_9.$81f==true||isc.isA.FormItem(_9)||_8.type=="TileGridField"))
{if(isc.EditProxy.fieldEdited(this.dataBoundComponent,_8)){_5.add(_7)}
}
}
if(_5.length==0){_2();return}
var _10=(_1.length==1?this.removeSingleCustomizedFieldMessage:this.removeMultipleCustomizedFieldsMessage);var _11=this.currentFieldsGrid.getFieldNum("title"),_12=[]
;for(var i=0;i<_5.length;i++){var _7=_5[i],_13=this.currentFieldsGrid.getRowNum(_7),_14=this.currentFieldsGrid.getCellValue(_7,_13,_11)
;_12.add(_14)}
_10=_10.evalDynamicString(this,{fieldList:_12.join(", ")});isc.confirm(_10,function(_15){if(_15){_2()}
},{buttons:[isc.Dialog.NO,isc.Dialog.YES],autoFocusButton:1
})}
,isc.A.createDataSourceFromFields=function isc_DSBindingEditor_createDataSourceFromFields(_1,_2,_3,_4){var _5=_4?_1:_1.duplicate();if(_2!=null){for(var _6=[],i=0,l=_5.length;i<l;i++){if(!_2.containsProperty("name",_5[i].name)){_6.add(_5[i])}
}
_5=_6}
var _9={name:"order",type:"int",hidden:true},_10={name:"name",title:"Name",primaryKey:true},_11={name:"title",title:"Title"},_12={name:"type",title:"Type",autoFitWidth:true},_13={name:"hidden",type:"boolean",hidden:true},_14={name:"detail",type:"boolean",hidden:true}
;var _1=[_9,_11,_10,_12,_13,_14];if(!_3){for(var i=0;i<_5.length;i++){_5[i].order=i}
}
var _15=isc.DataSource.create({fields:_1,clientOnly:true,dataProtocol:"clientCustom",transformRequest:function(_17){var _16=this.getClientOnlyResponse(_17,null);this.processResponse(_17.requestId,_16);return _17.data}
});_15.setCacheData(_5);return _15}
,isc.A.initWidget=function isc_DSBindingEditor_initWidget(){this.Super(this.$oc,arguments);if(this.dataBoundComponent==null&&this.dataSource!=null){var _1=isc.addProperties({},this.creator.dsBindingEditorProperties,{autoDraw:false
});var _2=isc.ListGrid.create(_1);_2.setFields(_2.fields);this.dataBoundComponent=_2}
if(this.dataSource==null&&this.dataBoundComponent!=null){this.dataSource=this.dataBoundComponent.getDataSource()}
this.hiddenIconHtml=isc.Canvas.imgHTML("actions/preview.png",16,16);var _3=(isc.isA.ListGrid(this.dataBoundComponent)?this.gridInstructions:this.dbcInstructions)+"<p>"+this.commonInstructions;_3=_3.evalDynamicString(this,{ctrlKey:(isc.Browser.isMac?"Cmd":"Ctrl"),hiddenIcon:this.hiddenIconHtml
});this.addAutoChild("instructionsPanel",{instructions:_3});var _4=isc.DSBindingEditorShuttle.create({editor:this,membersMargin:10
});this.shuttle=_4;this.addMember(_4);var _5=this.getDataSourceFields(),_6=this.getComponentFields();var _7;if(this.sortAvailableFields){_7=[{property:"title",direction:this.availableFieldsSortDirection
}]}
this.addAutoChild("availableFieldsGrid",{autoFetchData:true,initialSort:_7,dataSource:this.createDataSourceFromFields(_5,_6,true),fields:this.createGridFields(),rowDoubleClick:function(_10,_11,_12){var _8=_4.currentView.grid;_8.transferSelectedData(this)}
},isc.DSBindingEditorListGrid,_4.availableView);this.addAutoChild("currentFieldsGrid",{ID:"DSBindingEditor_currentFieldsGrid",autoFetchData:true,initialSort:[{property:"order"}],dataSource:this.createDataSourceFromFields(_6),fields:this.createGridFields(isc.isA.ListGrid(this.dataBoundComponent)),contextMenu:isc.Menu.create({autoDraw:false,data:[{title:this.removeItemTitle,click:function(){var _8=_4.currentView.grid;var _9=_4.availableView.grid;_9.transferSelectedData(_8)}
}]
})
},isc.DSBindingEditorListGrid,_4.currentView);_4.currentView.setPersistState(this.dataBoundComponent.autoPersistViewState);this.addAutoChild("buttonLayout");if(this.buttonLayout){this.saveAndExitButton=this.createAutoChild("saveAndExitButton",{editor:this,title:this.saveAndExitButtonTitle
});this.cancelChangesButton=this.createAutoChild("cancelChangesButton",{editor:this,title:this.cancelButtonTitle
});this.buttonLayout.addMembers([this.cancelChangesButton,this.saveAndExitButton]);this.addMember(this.buttonLayout)}}
,isc.A.getDataSourceFields=function isc_DSBindingEditor_getDataSourceFields(){var _1=[],_2=this.dataSource.getFields()
;for(var _3 in _2){var _4=_2[_3],_5=(_4.title&&!_4.$76s?_4.title:null),_6={name:_4.name,type:_4.type,hidden:_4.hidden||_4.detail,detail:_4.detail,includeFrom:_4.includeFrom,primaryKey:_4.primaryKey,displayField:_4.displayField
}
;if(_5)_6.title=_5;_1.add(_6)}
var _7=(this.dataBoundComponent.getAllFields?this.dataBoundComponent.getAllFields():this.dataBoundComponent.getFields())||[];for(var i=0;i<_7.length;i++){var _9=_7[i];if(!this.dataSource.getField(_9.name)){var _6={name:_9.name,type:_9.type,hidden:_9.hidden
}
;if(_9.title)_6.title=_9.title;_1.add(_6)}
}
return _1}
,isc.A.getComponentFields=function isc_DSBindingEditor_getComponentFields(){var _1=this.editContext,_2=_1.getEditNodeTree(),_3=_2.getChildren(this.editNode),_4=[]
;for(var j=0;j<_3.length;j++){var _6=_3[j];if(_6.type!="DynamicProperty"&&!isc.isA.DataSource(_6.liveObject)){var _7=this.dataSource.getField(_6.ID),_8=_6.defaults||{},_9=isc.addProperties({},(_7?_7:{name:_6.ID}))
;if(_9.title&&_9.$76s)delete _9.title;if(_8.title)_9.title=_8.title;if(_8.hidden)_9.hidden=_8.hidden;_4.add(_9)}
}
return _4}
,isc.A.createGridFields=function isc_DSBindingEditor_createGridFields(_1){var _2=[isc.addProperties({},this.orderFieldDefaults),isc.addProperties({},this.titleFieldDefaults),isc.addProperties({},this.nameFieldDefaults),isc.addProperties({},this.typeFieldDefaults)
];if(_1){_2.add(isc.addProperties({},this.hiddenFieldDefaults))}
return _2}
,isc.A.saveClick=function isc_DSBindingEditor_saveClick(){if(this.shuttle.save()){var _1=this.dataBoundComponent;if(this.creator)this.creator.closeClick()}}
,isc.A.closeClick=function isc_DSBindingEditor_closeClick(){}
);isc.B._maxIndex=isc.C+8;if(isc.Window!=null){isc.ClassFactory.defineClass("DSBindingEditorWindow","Window");isc.A=isc.DSBindingEditorWindow.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.title="Customize binding for ${componentInfo} to ${dsId} DataSource";isc.A.width=800;isc.A.height=425;isc.A.bodyProperties={layoutLeftMargin:5,layoutRightMargin:5,layoutBottomMargin:5
};isc.A.canDragResize=true;isc.A.autoCenter=true;isc.A.isModal=true;isc.A.dsBindingEditorConstructor="DSBindingEditor";isc.A.dsBindingEditorDefaults={autoParent:"none"
};isc.B.push(isc.A.initWidget=function isc_DSBindingEditorWindow_initWidget(){this.Super(this.$oc,arguments);this.defaultTitle=this.title;this.$234e();this.$234f();var _1=this.editNode,_2=_1&&_1.liveObject,_3=_2&&_2.editContext
;this.editContext=_3}
,isc.A.setEditNode=function isc_DSBindingEditorWindow_setEditNode(_1,_2){this.editNode=_1;this.dataSource=_2;this.$234e();this.$234f()}
,isc.A.destroy=function isc_DSBindingEditorWindow_destroy(){this.ignore(this.dsBindingEditor,"closeClick");return this.Super("destroy",arguments)}
,isc.A.$234e=function isc_DSBindingEditorWindow__updateTitle(){if(this.editNode){var _1=this.editNode,_2=_1.liveObject,_3=this.dataSource||_2.getDataSource(),_4=_2.getActionTargetTitle
?_2.getActionTargetTitle()
:_1.ID+" ("+_1.type+")"
;this.setTitle(this.defaultTitle.evalDynamicString(this,{componentInfo:_4,dsId:_3&&_3.getID()
}))}
}
,isc.A.$234f=function isc_DSBindingEditorWindow__refreshEditor(){var _1=this.dsBindingEditor;if(_1){if(this.isObserving(_1,"closeClick")){this.ignore(_1,"closeClick")}
this.removeItem(_1);_1.markForDestroy();this.dsBindingEditor=null}
var _2=this.editNode;if(_2){var _3=_2.liveObject,_4=_3&&_3.editContext,_5={editContext:_4,editNode:_2,dataBoundComponent:_3,dataSource:this.dataSource
}
;this.addAutoChild("dsBindingEditor",_5);this.addItem(this.dsBindingEditor);this.observe(this.dsBindingEditor,"closeClick","observer.closeClick()")}
}
);isc.B._maxIndex=isc.C+5}else{isc.Log.logInfo("Source for standard DSBindingEditorWindow class included in this module, but required related class (Window) is not loaded. This can occur if the Grid module is loaded without the Containers module.","moduleDependencies")}}
isc.defineClass("ProcessElement");isc.A=isc.ProcessElement;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.getTitle=function isc_c_ProcessElement_getTitle(){var _1=this.getInstanceProperty("typeTitle");if(!_1){_1=this.getClassName();if(_1.endsWith("Task"))_1=_1.substring(0,_1.length-4);_1=isc.DataSource.getAutoTitle(_1)}
return _1}
,isc.A.createInitPropertiesFromAction=function isc_c_ProcessElement_createInitPropertiesFromAction(_1,_2,_3){var _4=this.actionMapping,_5={}
;if(!_4)return null;if(_4.target){var _6=(isc.isA.String(_1.target)?_1.target:_1.target.getLocalId());_5[_4.target]=_6}
if(_4.source){_5[_4.source]=_3&&_3.liveObject&&_3.liveObject.getLocalId()}
if(_1.mapping&&_4.paramMap){var _7=_1.mapping,_8=_4.paramMap,_9=[]
;for(var i=0;i<_1.mapping.length;i++){if(_7[i]&&_7[i]!="null"&&_8[i]){_9.add(_7[i]+":"+_8[i])}
}
if(!_9.isEmpty())_5.mapping=_9}
return _5}
);isc.B._maxIndex=isc.C+2;isc.A=isc.ProcessElement.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.passThruOutput=true;isc.A.undefinedComponentMessage="${propertyName} is not defined";isc.A.unresolvedComponentMessage="${propertyName} '${id}' could not be resolved";isc.A.$2345=isc.$ag+"lastTask";isc.A.$2429=isc.$ag+"lastResponse";isc.A.$2419=isc.$ag+"eventData";isc.A.multiRecordIndexFieldName=isc.$ag+"index_";isc.B.push(isc.A.isMockModeEnabled=function isc_ProcessElement_isMockModeEnabled(_1){return((_1&&_1.mockMode&&this.mockMode!=false)||this.mockMode)
}
,isc.A.getEditorType=function isc_ProcessElement_getEditorType(){return this.editorType}
,isc.A.destroy=function isc_ProcessElement_destroy(){if(this.$214x)this.$214x.destroy();this.Super("destroy",arguments)}
,isc.A.isValid=function isc_ProcessElement_isValid(_1){return(this.getInvalidTaskMessage(_1)==null)}
,isc.A.getInvalidTaskMessage=function isc_ProcessElement_getInvalidTaskMessage(_1){return null}
,isc.A.getElementDescription=function isc_ProcessElement_getElementDescription(){return this.description}
,isc.A.getLocalComponent=function isc_ProcessElement_getLocalComponent(_1,_2){if(!_2)return null;if(isc.isA.Class(_2))return _2;var _3=null;if(_1&&_1.screenComponent){_3=_1.screenComponent.getByLocalId(_2)}
if(!_3){_3=window[_2]}
return _3}
,isc.A.getCriteriaForDescription=function isc_ProcessElement_getCriteriaForDescription(_1){_1=isc.clone(_1);this.$2486(_1);return _1}
,isc.A.$2486=function isc_ProcessElement__makeCriteriaValuesHumanReadable(_1){var _2=_1.operator;if(_2=="and"||_2=="or"||_2=="not"){var _3=_1.criteria;for(var i=0;i<_3.length;i++){this.$2486(_3[i])}
}else if(_1.value!=null&&isc.isA.String(_1.value)&&_1.value.startsWith("$ruleScope."))
{var _5=_1.value.replace("$ruleScope.",""),_6=_5.split("."),_7=_6&&_6.length>0&&_6[0],_8
;if(isc.DS.get(_7)!=null){_8="current "+_5}else{var _9=_7&&window[_7];if(_9){var _10=_9.getClassName();if(_6&&_6.length>1&&_6[1]=="values"){_8=(isc.isA.ListGrid(_9)?"current edit row "+_6[2]+" value":_6[2])}else{_8=_6.slice(1).join(".")}
_8+=" from "+_7+" ("+_10+")"}else{_8=_5}
}
if(_8!=null&&_8!=_1.value){_1.value=_8}
}else if(_1.value!=null&&isc.isA.String(_1.value)&&_1.value.startsWith("$state."))
{_1.value=_1.value.split(".").slice(1).join(".")}
}
,isc.A.getSerializeableFields=function isc_ProcessElement_getSerializeableFields(){var _1=this.Super("getSerializeableFields",arguments);if(_1.description&&_1.description==this.getElementDescription()){delete _1.description}
return _1}
,isc.A.$195y=function isc_ProcessElement__resolveCriteriaExpressions(_1,_2,_3,_4){_1=isc.clone(_1);if(isc.DS.isAdvancedCriteria(_1)){this.$195z(_1,_2,_3,_4);if(_4.ruleScope){var _5=this.getLocalComponent(_4,_4.ruleScope);if(!_5||_5.destroyed){this.logWarn("Attempt to resolve ruleScope references in taskInputExpression but ruleScope not found: "+_4.ruleScope)}else{_1=isc.DS.resolveDynamicCriteria(_1,_5.getRuleContext())}
}
}else{_1=this.$1950(_1,_2,_3,_4)}
return _1}
,isc.A.$195z=function isc_ProcessElement__resolveAdvancedCriteriaExpressions(_1,_2,_3,_4){var _5=_1.operator;if(_5=="and"||_5=="or"||_5=="not"){var _6=_1.criteria;if(!isc.isAn.Array(_6))_6=[_6];for(var i=0;i<_6.length;i++){this.$195z(_6[i],_2,_3,_4)}
}else if(_1.value!=null){var _5=_1.operator&&isc.DS.$57z[_1.operator],_8=_5&&_5.valueType=="valueSet"
;_1.value=this.$1951(_1.value,_2,_3,_4,_8)}
}
,isc.A.$1950=function isc_ProcessElement__resolveObjectDynamicExpressions(_1,_2,_3,_4,_5){var _6={};for(var _7 in _1){_6[_7]=this.$1951(_1[_7],_2,_3,_4,_5,1)}
for(var _7 in _6){_6[_7]=this.$1951(_6[_7],_2,_3,_4,_5,2)}
return _6}
,isc.A.$1951=function isc_ProcessElement__resolveDynamicExpression(_1,_2,_3,_4,_5,_6){if((_6==null||_6==1)&&isc.isA.String(_1)){if(_1.startsWith("\\$")){_1=_1.substring(1)}else if(_3&&_1.startsWith("$inputRecord")){if(_3){var _7=_1.replace("$inputRecord","state");_1=isc.Canvas.$70o(_7,null,{state:_3})}
}else if(_2&&_1.startsWith("$input")){if(_2){var _7=_1.replace("$input","state");_1=isc.Canvas.$70o(_7,null,{state:_2})}
}else if(_4&&_1.startsWith("$lastRequest")){_1=_1.substring(12);var _8=_4.$2424;if(_1.startsWith(".")){var _7="state"+_1;_1=isc.Canvas.$70o(_7,null,{state:_8});if(_1==null){var _9=_7.substring(0,_7.lastIndexOf("."));if(!isc.Canvas.$1683(_9,null,{state:_8})){this.logWarn(this.getClassName()+" taskInputExpression path "+_7+" not found in last task request")}
}
}else{_1=_8}
}else if(_4&&_1.startsWith("$lastResponse")){_1=_1.substring(13);var _8=_4.getLastResponse();if(_1.startsWith(".")){var _7="state"+_1;_1=isc.Canvas.$70o(_7,null,{state:_8});if(_1==null){var _9=_7.substring(0,_7.lastIndexOf("."));if(!isc.Canvas.$1683(_9,null,{state:_8})){this.logWarn(this.getClassName()+" taskInputExpression path "+_7+" not found in last task response")}
}
}else{_1=_8}
}else if(_4&&_1.startsWith("$last")){_1=_1.substring(5);var _8;if(_1.startsWith("[")){var _10=_1.substring(1,_1.indexOf("]"));_1=_1.substring(_1.indexOf("]")+1);_8=_4.getLastTaskOutput(_10)}else{_8=_4.getLastTaskOutput()}
if(_1.startsWith(".")){var _7="state"+_1;if(_5&&isc.isAn.Array(_8)){var _11=[];for(var i=0;i<_8.length;i++){var _13=_8[i];_1=isc.Canvas.$70o(_7,null,{state:_13});if(_1!=null){_11.add(_1)}else{var _9=_7.substring(0,_7.lastIndexOf("."));if(!isc.Canvas.$1683(_9,null,{state:_13})){this.logWarn(this.getClassName()+" taskInputExpression path "+_7+" not found in previous task output")}
}
}
_1=_11}else{if(isc.isAn.Array(_8)){_8=_8[0]}
_1=isc.Canvas.$70o(_7,null,{state:_8});if(_1==null){var _9=_7.substring(0,_7.lastIndexOf("."));if(!isc.Canvas.$1683(_9,null,{state:_8})){this.logWarn(this.getClassName()+" taskInputExpression path "+_7+" not found in previous task output")}
}
}
}else{_1=_8}
}else if(_1.startsWith("$ruleScope.")||_1.startsWith("$scope.")){if(!_4.ruleScope){this.logWarn("Attempt to reference ruleScope in taskInputExpression but no ruleScope has been defined");_1=null}else{var _14=this.getLocalComponent(_4,_4.ruleScope);if(!_14||_14.destroyed){this.logWarn("Attempt to reference ruleScope in taskInputExpression but ruleScope not found: "+_4.ruleScope);_1=null}else{var _7=_1.replace("$ruleScope","").replace("$scope","");if(_7.startsWith("."))_7=_7.substring(1);_1=_14.$1671(_7)}
}
}else if(_1=="$state"){_1=_4.state}else if(_1.startsWith("$state.")){var _7=_1.substring(1);_1=isc.Canvas.$70o(_7,null,{state:_4.state})}
}else if((_6==null||_6==2)&&isc.isAn.Object(_1)&&_1.value){_1=isc.DateUtil.getAbsoluteDate(isc.addProperties({_constructor:"RelativeDate"},_1))}else if((_6==null||_6==2)&&isc.isAn.Object(_1)&&(_1.text||_1.formula||_1.template||_1.valueFrom||_1.dataPath))
{var _14=this.getLocalComponent(_4,_4.ruleScope);if(!_14||_14.destroyed){this.logWarn("Attempt to resolve ruleScope references in textFormula but ruleScope not found: "+_4.ruleScope);_1=null}else{var _15=this.addTemporaryRuleContext(_4,_14);if(_1.text||_1.formula||_1.template||_1.dataPath){_1=isc.DynamicProperty.evalSimpleExpression(_1,_14.getRuleContext(),_4.ruleScope)}else if(_1.valueFrom){var _1=isc.DynamicProperty.evalValueFrom(_1.valueFrom,_14.getRuleContext(),_4.ruleScope)}
this.removeTemporaryRuleContext(_15)}
}
return _1}
,isc.A.objectReferencesLastTaskOutput=function isc_ProcessElement_objectReferencesLastTaskOutput(_1,_2){var _3;if(_2){for(var _4 in _1){var _5=_1[_4];if((isc.isA.String(_5)&&_5.startsWith("$last"))||(_5.template&&_5.template.contains("#{$257i.")))
{_3=true;break}
}
}
return _3}
,isc.A.updateGlobalIDReferences=function isc_ProcessElement_updateGlobalIDReferences(_1,_2){return false}
,isc.A.getComponentReferences=function isc_ProcessElement_getComponentReferences(){return[]}
,isc.A.updateGlobalIDInValueProperty=function isc_ProcessElement_updateGlobalIDInValueProperty(_1,_2,_3){var _4=false;if(this[_1]){var _5=this[_1];if(isc.isA.String(_5)){var _6=_5.replace("$ruleScope."+_2+".","$ruleScope."+_3+".")
.replace("$scope."+_2+".","$scope."+_3+".")
if(_5!=_6){this[_1]=_6;_4=true}
}
}
return _4}
,isc.A.updateGlobalIDInValues=function isc_ProcessElement_updateGlobalIDInValues(_1,_2,_3){var _4=false;if(_1){for(var _5 in _1){var _6=_1[_5];if(_6!=null&&isc.isA.String(_6)){var _7=_6.replace("$ruleScope."+_2+".","$ruleScope."+_3+".")
.replace("$scope."+_2+".","$scope."+_3+".")
;if(_6!=_7){_1[_5]=_7;_4=true}
}
}
}
return _4}
,isc.A.updateGlobalIDInCriteria=function isc_ProcessElement_updateGlobalIDInCriteria(_1,_2,_3){if(!_1)return false;var _4={pattern:new RegExp("^"+_2+"\\."),replacement:_3+"."
};var _5=[{pattern:new RegExp("^\\$ruleScope\\."+_2+"\\."),replacement:"$ruleScope."+_3+"."
},{pattern:new RegExp("^\\$scope\\."+_2+"\\."),replacement:"$scope."+_3+"."
}];var _6={pattern:new RegExp("^"+_2+"\\."),replacement:_3+"."
};return this.$260t(_1,_4,_5,_6)}
,isc.A.$260t=function isc_ProcessElement__replaceCriteriaFieldNamesAndValues(_1,_2,_3,_4){var _5=_1.operator,_6=false
;if(_5=="and"||_5=="or"||_5=="not"){var _7=_1.criteria;for(var i=0;i<_7.length;i++){if(this.$260t(_7[i],_2,_3,_4)){_6=true}
}
}else{var _9=_1.fieldName.replace(_2.pattern,_2.replacement);if(_1.fieldName!=_9){_1.fieldName=_9;_6=true}
for(var i=0;i<_3.length;i++){var _10=_3[i];if(_1.value!=null&&isc.isA.String(_1.value)){var _11=_1.value.replace(_10.pattern,_10.replacement);if(_1.value!=_11){_1.value=_11;_6=true}
}
}
if(_1.valuePath!=null&&isc.isA.String(_1.valuePath)){var _12=_1.valuePath.replace(_4.pattern,_4.replacement);if(_1.valuePath!=_12){_1.valuePath=_12;_6=true}
}
}
return _6}
,isc.A.updateGlobalIDInTextFormula=function isc_ProcessElement_updateGlobalIDInTextFormula(_1,_2,_3){if(!_1||!_1.text)return false;var _4=new RegExp("#{"+_2+"\\."),_5="#{"+_3+".",_6=_1.text.replace(_4,_5),_7=false
;if(_1.text!=_6){_1.text=_6;_7=true}
return _7}
,isc.A.updateLastElementBindingReferences=function isc_ProcessElement_updateLastElementBindingReferences(_1){return false}
,isc.A.updateLastElementInValueProperty=function isc_ProcessElement_updateLastElementInValueProperty(_1,_2){var _3=false;if(this[_1]){var _4=this[_1],_5=_4.replace("$last.","$last["+_2+"].")
;if(_4!=_5){this[_1]=_5;_3=true}
}
return _3}
,isc.A.updateLastElementInValues=function isc_ProcessElement_updateLastElementInValues(_1,_2){var _3=false;if(_1){for(var _4 in _1){var _5=_1[_4],_6=_5.replace("$last.","$last["+_2+"].")
;if(_5!=_6){_1[_4]=_6;_3=true}
}
}
return _3}
,isc.A.updateLastElementInCriteria=function isc_ProcessElement_updateLastElementInCriteria(_1,_2){if(!_1)return false;var _3=[{pattern:new RegExp("^\\$last\\."),replacement:"$last["+_2+"]."
}];var _4=this.$178b(_1,_3);return this.$2119(_1,_3)||_4}
,isc.A.$178b=function isc_ProcessElement__replaceCriteriaFieldName(_1,_2){var _3=_1.operator,_4=false
;if(_3=="and"||_3=="or"||_3=="not"){var _5=_1.criteria;for(var i=0;i<_5.length;i++){if(this.$2119(_5[i],_2)){_4=true}
}
}else{for(var i=0;i<_2.length;i++){var _7=_2[i];if(_1.value!=null){var _8=_1.fieldName.replace(_7.pattern,_7.replacement);if(_1.fieldName!=_8){_1.fieldName=_8;_4=true}
}
}
}
return _4}
,isc.A.getDynamicValue=function isc_ProcessElement_getDynamicValue(_1,_2){if(_1){var _3=this.$1950({value:_1},null,null,_2);_1=_3.value}
return _1}
,isc.A.$2143=function isc_ProcessElement__getSummaryFunction(_1,_2,_3){if(this.$176p==null){this.$176p=isc.SummaryBuilder.generateRuleScopeFunction(_1,_2,_3
)}
return this.$176p}
,isc.A.getTextFormulaValue=function isc_ProcessElement_getTextFormulaValue(_1,_2){var _3;if(_1){var _4=_1,_5=_4.text
;if(_4.summaryVars){var _6=_4.summaryVars;for(var _7 in _6){var _8="#{"+_6[_7]+"}";_5=isc.FormulaBuilder.handleKeyExp(_5,_7,"escaped",_8);_5=isc.FormulaBuilder.handleKeyExp(_5,_7,"braced",_8)}
_4={text:_5}}
if(_2.ruleScope){var _9=this.getLocalComponent(_2,_2.ruleScope);if(!_9||_9.destroyed){this.logWarn("Attempt to resolve ruleScope references in textFormula but ruleScope not found: "+_2.ruleScope)}else{var _10=this.addTemporaryRuleContext(_2,_9);var _11=this.$2143(_4,_2.ruleScope);if(_11){var _12=_9.getRuleContext();_3=_11(_12)}
this.removeTemporaryRuleContext(_10)}
}
}
return _3}
,isc.A.addTemporaryRuleContext=function isc_ProcessElement_addTemporaryRuleContext(_1,_2){var _3={process:_1,ruleScopeComponent:_2};var _4=_1.getLastTaskOutput(),_5=_1.getLastTaskOutputSchema(null,true)
;if(_4!=null&&_5){if(isc.isAn.Array(_4)){_4=_4[0]}
_2.provideRuleContext(this.$2345,_4,_5,null,true);_3.removeLastTaskOutput=true;_3.lastTaskOutputSchema=_5}
var _6=_1.getLastResponse(),_7=_1.getLastResponseSchema()
;if(_6!=null&&_7){_2.provideRuleContext(this.$2429,_6,_7,null,true);_3.removeLastResponse=true;_3.lastResponseSchema=_7}
var _8=_1.getStateVariable("eventData"),_9=_1.getEventDataSchema()
;if(_8!=null&&_9){var _10=_9.criteriaBasePath;_2.provideRuleContext(_10,_8,_9,null,true);_3.removeEventData=true;_3.eventDataSchema=_9}
return _3}
,isc.A.removeTemporaryRuleContext=function isc_ProcessElement_removeTemporaryRuleContext(_1){var _2=_1.ruleScopeComponent;if(_1.removeLastTaskOutput){_2.provideRuleContext(this.$2345,null,_1.lastTaskOutputSchema,null,true)}
if(_1.removeLastResponse){_2.provideRuleContext(this.$2429,null,_1.lastResponseSchema,null,true)}
if(_1.removeEventData){_2.provideRuleContext(this.$2419,null,_1.eventDataSchema,null,true)}
}
,isc.A.createTargetOutputSchema=function isc_ProcessElement_createTargetOutputSchema(_1){if(this.$214x)return this.$214x;var _2=this.getTargetComponent(this.process);if(!_2)return null;var _3=_2.dataSource;if(_3&&(_3.getClassName==null||_3.getClassName()!="DataSource")){_3=isc.DataSource.get(_3)}
if(_3){var _4=(_2.getAllFields?_2.getAllFields():_2.getFields());if(_1){if(!_4)_4=[];_4.add({name:this.multiRecordIndexFieldName,type:"integer",title:"Record index",canSave:false
})}
var _5=_4&&isc.Canvas.$2465(_4,_3);if(_5){this.$214x=_3=_5}
}
return _3}
);isc.B._maxIndex=isc.C+33;isc.ProcessElement.registerStringMethods({completeElement:"process",reset:""});isc.defineClass("ProcessSequence","ProcessElement");isc.A=isc.ProcessSequence.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.destroy=function isc_ProcessSequence_destroy(){if(this.elements)this.elements.callMethod("destroy");if(this.sequences)this.sequences.callMethod("destroy");this.Super("destroy",arguments)}
);isc.B._maxIndex=isc.C+1;isc.defineClass("Task","ProcessElement");isc.A=isc.Task.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.editorType="TaskEditor";isc.B.push(isc.A.$1968=function isc_Task__resolveInputField(_1,_2){if(_1==null)return null;var _3;if(_1.startsWith("$"))_3=this.$1951(_1,null,null,_2);else _3=_2.getStateVariable(_1);return _3}
,isc.A.$1952=function isc_Task__writeOutputExpression(_1){var _2=this.outputExpression;if(!_2)return;if(_2.startsWith("$")){_2=_2.substring(1);var _3=_2;var _4;var _5=_3.indexOf(".");if(_5>0){_3=_3.substring(0,_5);_4=_3.substring(_5+1)}
var _6=isc.Canvas.getById(_3);if(_6){if(_4){if(!isc.isAn.Array(_1)){if(isc.isA.DynamicForm(_6)){_6.setFieldValue(_4,_1)}else if(isc.isA.ListGrid(_6)&&_6.canEdit){var _7=_6.getEditRow();if(_7!=null){_6.setEditValue(_7,_4,_1)}else{var _8=_6.getSelectedRecords();if(_8!=null&&_8.length==1){var _9=_6.getRecordIndex(_8[0]);_6.setEditValue(_9,_4,_1)}
}
}else{this.logWarn("outputExpression target is not a supported DBC or is not editable - ignored: "+_2)}
}else{this.logWarn("Task output is not supported by outputExpression target - ignored: "+_2)}
}else{if(_6.setValues){var _10=(isc.isAn.Array(_1)?_1[0]:_1);if(isc.isAn.Object(_10)){_6.setValues(_10)}else{this.logWarn("task output is not an object and cannot be written with outputExpression - ignored: "+_2)}
}else if(_6.setData){if(isc.isAn.Array(_1)||isc.isAn.Object(_1)){if(!isc.isAn.Array(_1))_1=[_1];_6.setData(_1)}else{this.logWarn("task output is not an object and cannot be written with outputExpression - ignored: "+_2)}
}else{this.logWarn("outputExpression target is not a supported DBC - ignored: "+_2)}
}
}else{this.logWarn("outputExpression DBC not found - ignored: "+_2)}
}else{this.logWarn("Invalid outputExpression - ignored: "+_2)}
}
,isc.A.updateLastElementBindingReferences=function isc_Task_updateLastElementBindingReferences(_1){var _2=this.Super("updateLastElementBindingReferences",arguments);_2=this.updateLastElementInValueProperty("inputField",_1)||_2;return _2}
,isc.A.updateGlobalIDReferences=function isc_Task_updateGlobalIDReferences(_1,_2){var _3=this.Super("updateGlobalIDReferences",arguments);_3=this.updateGlobalIDInValueProperty("inputField",_1,_2)||_3;return _3}
);isc.B._maxIndex=isc.C+4;isc.defineClass("Process");isc.A=isc.Process;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$27q={};isc.A.decisionPlaceholderSelection="[placeholder]";isc.B.push(isc.A.loadProcess=function isc_c_Process_loadProcess(_1,_2){var _3=function(_9,_10,_11){var _4=_10&&isc.Class.evaluate(_10),_5;if(_4==null||_4.length==0){isc.logWarn("Unable to load process(es): "+_1+". These should be defined in  *.proc.xml files at the search path  specified by \"project.processes\".")
}else{if(!isc.isAn.Array(_1))_1=[_1];for(var i=0;i<_4.length;i++){var p=isc.Class.evaluate(_4[i].source);if(p.ID!=_1[i])p.setID(_1[i]);if(i==0)_5=p}
}
if(_2)this.fireCallback(_2,"process",[_5])
};var _8=isc.isAn.Array(_1)?_1.join():_1;return isc.RPCManager.$226t({screenName:_8,type:"processes",structuredResponse:true},_3)}
,isc.A.getProcess=function isc_c_Process_getProcess(_1){var _2=isc.Process.$27q[_1];if(_2&&!isc.isA.Process(_2)){_2=isc.ClassFactory.newInstance(_2)}
return _2}
,isc.A.cacheProcess=function isc_c_Process_cacheProcess(_1){var _2=_1.ID;if(_2){var _3=isc.Process.$27q,_4=_3[_2]
;if(_4!=null){if(isc.isA.Process(_1)&&!isc.isA.Process(_4)){_1=_4}else{var _5="New Process ID: '"+_2+"' collides with ID of a previously cached Process object. Existing process will be replaced. Note that the behavior of event handlers referencing this process could be changed.";this.logWarn(_5);if(_4.destroy){_4.destroy()}
}
}
_3[_2]=_1}
}
);isc.B._maxIndex=isc.C+3;isc.A=isc.Process.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$242a=isc.$ag+"eventData";isc.A.defaultWaitDuration=300;isc.A.waitForReadyTimeout=5000;isc.A.waitForDoneTimeout=3000;isc.A.waitForDoneRetryTime=200;isc.A.$2346=isc.$ag+"lastTask";isc.A.$243a=isc.$ag+"lastResponse";isc.B.push(isc.A.init=function isc_Process_init(){var _1=this.Super("init",arguments);this.cacheInstance();var _2=this.sequence||this.Sequence;if(_2){if(!this.sequences)this.sequences=[];this.sequences.addAt({_constructor:"ProcessSequence",elements:_2},0);delete this.sequence;delete this.Sequence}
if(this.autoStart)this.start();return _1}
,isc.A.destroy=function isc_Process_destroy(){if(this.elements)this.elements.callMethod("destroy");if(this.sequences)this.sequences.callMethod("destroy");if(this.ID)delete isc.Process.$27q[this.ID];this.Super("destroy",arguments)}
,isc.A.setID=function isc_Process_setID(_1){this.ID=_1;this.cacheInstance()}
,isc.A.cacheInstance=function isc_Process_cacheInstance(){if(this.ID){isc.Process.cacheProcess(this)}
}
,isc.A.instantiateElements=function isc_Process_instantiateElements(){if(this.elements)this.elements=this.$1972(this.elements);if(this.sequences)this.sequences=this.$1972(this.sequences)}
,isc.A.$1972=function isc_Process__instantiateElements(_1){var _2=[];for(var i=0;i<_1.length;i++){var _4=_1[i];_2[i]=_4;if(isc.isAn.Object(_4)){if(_4._constructor&&!isc.isAn.Instance(_4)){_2[i]=isc.ClassFactory.newInstance(_4)}
if(_4.elements){_2[i].elements=this.$1972(_4.elements)}
}
}
return _2}
,isc.A.getElement=function isc_Process_getElement(_1){return this.$87g(this,_1)}
,isc.A.$87g=function isc_Process__searchElement(_1,_2){if(_1.sequences){for(var i=0;i<_1.sequences.length;i++){var s=_1.sequences[i];if(s.ID==_2){return s}else if(s.sequences||s.elements){var _5=this.$87g(s,_2);if(_5)return _5}
}
}
if(_1.elements){for(var i=0;i<_1.elements.length;i++){var e=_1.elements[i];if(e.ID==_2){return e}else if(e.sequences||e.elements){var _5=this.$87g(e,_2);if(_5)return _5}
}
}
}
,isc.A.getAllElements=function isc_Process_getAllElements(_1,_2){if(!this.initializedElements){this.instantiateElements();this.initializedElements=true}
if(!_1)_1=this;if(!_2)_2=[];if(_1.sequences){for(var i=0;i<_1.sequences.length;i++){var s=_1.sequences[i];_2.add(s);if(s.sequences||s.elements){this.getAllElements(s,_2)}
}
}
if(_1.elements){for(var i=0;i<_1.elements.length;i++){var e=_1.elements[i];_2.add(e);if(e.sequences||e.elements){this.getAllElements(e,_2)}
}
}
return _2}
,isc.A.removeElement=function isc_Process_removeElement(_1){this.$197u(this,_1)}
,isc.A.$197u=function isc_Process__removeElement(_1,_2){if(_1.sequences){for(var i=0;i<_1.sequences.length;i++){var s=_1.sequences[i];if(s==_2){_1.sequences.removeAt(i);return true}
if(s.sequences||s.elements){if(this.$197u(s,_2))return true}
}
}
if(_1.elements){for(var i=0;i<_1.elements.length;i++){var e=_1.elements[i];if(e==_2){_1.elements.removeAt(i);return true}
if(e.sequences||e.elements){if(this.$197u(e,_2))return true}
}
}
}
,isc.A.addElement=function isc_Process_addElement(_1,_2,_3){if(_2||_3){this.$1959(this,_1,_2,_3)}else{if(!this.elements)this.elements=[];this.elements.add(_1)}
}
,isc.A.$1959=function isc_Process__addElement(_1,_2,_3,_4){if(_1.sequences){for(var i=0;i<_1.sequences.length;i++){var s=_1.sequences[i];if(_3&&s==_3){var _7=i+1;_1.sequences.add(_2,_7);return true}else if(_4&&s==_4){var _7=i;_1.sequences.add(_2,_7);return true}
if(s.sequences||s.elements){if(this.$1959(s,_2,_3,_4))return true}
}
}
if(_1.elements){for(var i=0;i<_1.elements.length;i++){var e=_1.elements[i];if(_3&&e==_3){var _7=i+1;_1.elements.add(_2,_7);return true}else if(_4&&e==_4){var _7=i;_1.elements.add(_2,_7);return true}
if(e.sequences||e.elements){if(this.$1959(e,_2,_3,_4))return true}
}
}
}
,isc.A.getComponentReferences=function isc_Process_getComponentReferences(){var _1=this.getAllElements(),_2=[]
;if(_1&&_1.length>0){for(var i=0;i<_1.length;i++){var _4=_1[i];if(_4.getComponentReferences){_2.addList(_4.getComponentReferences())}
}
_2=_2.getUniqueItems()}
return _2}
,isc.A.setState=function isc_Process_setState(_1){this.state=_1}
,isc.A.getEventDataSchema=function isc_Process_getEventDataSchema(){var _1=this.eventDataSchema;if(!_1&&this.mapping){var _2=this.mapping,_3=[]
;for(var i=0;i<_2.length;i++){var _5=_2[i],_6=this.getStateVariable("eventData."+_5)
;if(!isc.isAn.Object(_6)){_3.add({name:_5})}else if(isc.isAn.Object(_6)&&!isc.isAn.Instance(_6)&&!_6.$81f){for(var _7 in _6){_3.add({name:_5+"_"+_7,criteriaPath:isc.$ag+"eventData."+_5+"."+_7})}
}
}
if(_3.length>0){var _8={addGlobalId:false,$197d:true,ID:this.$242a,clientOnly:true,criteriaBasePath:isc.$ag+"eventData",fields:_3
};_1=isc.DS.create(_8)}
this.eventDataSchema=_1}
return _1}
,isc.A.destroyEventDataSchema=function isc_Process_destroyEventDataSchema(){var _1=this.eventDataSchema;if(_1){if(_1.destroy){_1.destroy()}
delete this.eventDataSchema}
}
,isc.A.start=function isc_Process_start(_1){if(!this.initializedElements){this.instantiateElements();this.$1953=this.startElement;this.initializedElements=true}
var _2=(this.executionStack==null?"Start":"Restart");if(this.logIsInfoEnabled("workflow")){this.logInfo(_2+" process","workflow")}else if(this.logIsDebugEnabled("workflow")){this.logDebug(_2+" process: "+this.echo(this),"workflow")}
if(this.executionStack==null){this.executionStack=[]}
if(this.$bj)_1=true;if(this.state==null)this.state={};while(_1||this.$39n()){_1=null;var _3=this.$87h();if(_3){if(!_3.isValid(this)){var _4=_3.getInvalidTaskMessage(this);if(_4){this.logWarn(_4);if(this.mockMode){isc.Notify.addMessage(_4)}
}
this.logWarn("Workflow terminated at an invalid task");break}
this.$104r=true;if(this.$2462(_3)){return}
var _5=this.$bj||this.getLastTaskOutputIterator(_3);delete this.$bj;while(_5.hasNext()){_5.next();if(!_3.executeElement(this)){this.logDebug("Waiting for asynchronous task completion","workflow");if(!_3.forceSingle&&_5.hasNext()){this.$bj=_5}else{_5.done()}
return}
if(_3.forceSingle){break}
}
_5.done()}
}
this.destroyLastTaskOutputSchema();this.destroyEventDataSchema();this.handleFinished();if(this.logIsInfoEnabled("workflow")){this.logInfo("Process finished","workflow")}else if(this.logIsDebugEnabled("workflow")){this.logDebug("Process finished: "+this.echo(this),"workflow")}
}
,isc.A.getStartElement=function isc_Process_getStartElement(){var _1=this.executionStack,_2=this.$104r,_3
;this.executionStack=[];this.$104r=false;if(this.$39n()){_3=this.$87h()}
this.executionStack=_1;this.$104r=_2;return _3}
,isc.A.getLastTaskOutputIterator=function isc_Process_getLastTaskOutputIterator(_1){var _2=this.$2347(),_3=(_2?_2.value:null),_4=(isc.isAn.Array(_3)?_3:[_3]),_5=0,_6=_4.length
;if((!_1.supportsMultipleInputRecords||_1.forceSingle))
{if(_4.length>0){_4=[_4[0]]}else{_4=[{}]}
_6=1}
return{hasNext:function(){return(_5<_6)},next:function(){if(_5<_6){if(_2&&_5>0){_2.value=_4[_5]}
if(_2&&_6>1){isc.Log.logDebug("Processing element "+_5+" of last task output","workflow")}
return _4[_5++]}
return null},done:function(){if(_2&&_5>0){_2.value=_3;if(_6>1){isc.Log.logDebug("Completed all elements of last task output","workflow")}
}
}
}
}
,isc.A.reset=function isc_Process_reset(_1){this.state=_1;this.executionStack=null;this.$1953=this.startElement;this.setLastTaskClass(null);this.$1954=null;this.$104r=false;this.destroyEventDataSchema();var _2=this.getAllElements();for(var i=0;i<_2.length;i++){var _4=_2[i];if(_4.reset){_4.reset()}
}
}
,isc.A.handleFinished=function isc_Process_handleFinished(){if(this.finished){delete this.$1953;this.finished(this.state)}
}
,isc.A.finished=function isc_Process_finished(){}
,isc.A.$39n=function isc_Process__next(_1){var _2=this.executionStack.last();if(_2==null){if(this.$223k){var _3=this.$223k;if(_3.completeElement){_3.completeElement(this)}
delete this.$223k}
if(this.$1953){var _4=this.$87i(this,this.$1953);if(_4==null){isc.logWarn("unable to find task '"+this.$1953+"' - process will be finished")}
return _4}else if(this.$104r){return null}else if(this.sequences&&this.sequences.length>0){this.executionStack.add({el:this,sIndex:0});return this.sequences[0]}else if(this.elements&&this.elements.length>0){this.executionStack.add({el:this,eIndex:0});return this.elements[0]}else if(!_1){isc.logWarn("There are neither sequences or elements. Nothing to execute.")}
}else{var _3=null;if(_2.sIndex!=null){_3=_2.el.sequences[_2.sIndex]}else if(_2.eIndex!=null){_3=_2.el.elements[_2.eIndex]}
if(_3.completeElement){_3.completeElement(this)}
if(_3.getClassName)this.setLastTaskClass(_3.getClassName());if(_3.nextElement){this.executionStack=[];var _4=this.$87i(this,_3.nextElement);if(_4==null){isc.logWarn("unable to find task '"+_3.nextElement+"' - process will be finished")}
return _4}else{return this.$87j()}
}
}
,isc.A.$87i=function isc_Process__gotoElement(_1,_2){var _3={el:_1};this.executionStack.add(_3);if(_1.sequences){for(var i=0;i<_1.sequences.length;i++){var s=_1.sequences[i];_3.sIndex=i;if(s.ID==_2){return s}else if(s.sequences||s.elements){var _6=this.$87i(s,_2);if(_6)return _6}
}
}
delete _3.sIndex;if(_1.elements){for(var i=0;i<_1.elements.length;i++){var e=_1.elements[i];_3.eIndex=i;if(e.ID==_2){return e}else if(e.sequences||e.elements){var _6=this.$87i(e,_2);if(_6)return _6}
}
}
this.executionStack.removeAt(this.executionStack.length-1)}
,isc.A.$87j=function isc_Process__findNextElement(){var _1=this.executionStack.last();if(_1.eIndex!=null&&_1.el!=this){if(_1.eIndex==_1.el.elements.length-1){this.executionStack.removeAt(this.executionStack.length-1);if(_1.el==this){return}else{return this.$87j()}
}else{_1.eIndex++;return _1.el.elements[_1.eIndex]}
}
}
,isc.A.$87h=function isc_Process__getFirstTask(_1){var _2=this.executionStack.last();var _3=null;if(_2.sIndex!=null){_3=_2.el.sequences[_2.sIndex]}else if(_2.eIndex!=null){_3=_2.el.elements[_2.eIndex]}
if(_3.sequences==null&&_3.elements==null){if(!_1)this.handleTraceElement(_3);return _3}
var _4={el:_3};this.executionStack.add(_4);if(_3.sequences){for(var i=0;i<_3.sequences.length;i++){_4.sIndex=i
var _6=this.$87h(_3.sequences[i]);if(_6){this.handleTraceElement(_6);return _6}
}
}
if(_3.elements){for(var i=0;i<_3.elements.length;i++){_4.eIndex=i
var _6=this.$87h(_3.elements[i]);if(_6){if(_4.eIndex==0)this.handleTraceElement(_4.el);this.handleTraceElement(_6);return _6}
}
}
this.executionStack.removeAt(this.executionStack.length-1)}
,isc.A.$2462=function isc_Process__waitFor(_1){var _2=_1.waitFor||this.defaultWaitFor;if(!_2){return}
if(!isc.isAn.Array(_2)){_2=[_2];var i=0;while(i<_2.length){var v=_2[i];if(v=="locatorAndSystemDone"){_2.splice(i,1,"locator","systemDone")}
i++}
}
var _5=this.$2463||0;delete this.$2463;while(_5<_2.length){var _6=_2[_5];switch(_6){case"systemDone":if(isc.AutoTest.isSystemDone()){delete this.$224x;break}
var _7=isc.timeStamp();if(this.$224x==null){this.$224x=isc.timeStamp()}else if(_7-this.$224x>this.waitForDoneTimeout){var _8=isc.Log.getPriority("quiescence");isc.Log.setPriority("quiescence",isc.Log.DEBUG);try{isc.AutoTest.clearAllLogSlots();if(!isc.AutoTest.isSystemDone()){var _9=isc.AutoTest.getLogFailureText();this.logWarn("Timed out waiting for page to quiet: "+_9)}
}finally{if(_8!=null)isc.Log.setPriority("quiescence",_8);else isc.Log.clearPriority("quiescence",_8)}
delete this.$224x;break}
this.$2463=_5;this.delayCall("start",[true],this.waitForDoneRetryTime||200);return true;case"duration":this.$2463=_5;var _10=_1.waitDuration;if(_10==null){_10=this.defaultWaitDuration}
this.delayCall("start",[true],_10);return true;case"locator":if(!_1.waitLocator){this.logWarn("Request to wait for locator but no waitLocator specified");break}
if(this.$2464(_1.waitLocator)){break}
this.$2463=_5;this.delayCall("start",[true],100);return true;default:this.logWarn("Ignoring waitFor type of "+_6)}
_5++}
}
,isc.A.$2464=function isc_Process__checkLocatorReady(_1){if(!this.$224q)this.$224q=isc.timeStamp();var _2=isc.AutoTest.getObject(_1),_3
;if(!_2||(_2.$124j&&!_2.$124j(_2))||!_2.isDrawn()||!_2.isVisible()||_2.getLeft()<0||_2.getTop()<0)
{_3={component:_2,locator:_1}}
if(!_3){if(isc.isA.ListGrid(_2)){if(!isc.AutoTest.isGridDone(_2)){_3={component:_2,locator:_1}}else if(isc.AutoTest.isRecordLocator(_1)){var _4=isc.AutoTest.getRecord(_1);if(!_4){_3={component:_2,locator:_1,record:_4}}
}
}
}
if(_3){var _5=isc.timeStamp();if(_5-this.$224q>this.waitForReadyTimeout){var _2=_3.component,_1=_3.locator,_6=_3.record,_7
;if(!_2){_7=_1+" could not be resolved"}else if(_2&&!_2.isDrawn()||!_2.isVisible()||_2.getLeft()<0||_2.getTop()<0)
{_7=_2+" not ready"}else if(_2&&isc.AutoTest.isRecordLocator(_1)&&!_6){_7=_1+" record not found"}
this.logWarn("Timed out waiting for target component(s) to be ready - tour canceled: "+_7);this.setNextElement(null);delete this.$224q;return true}
}else{delete this.$224q;return true}
}
,isc.A.setNextElement=function isc_Process_setNextElement(_1){var _2=this.executionStack.last(),_3=null
;if(_2.sIndex!=null){_3=_2.el.sequences[_2.sIndex]}else if(_2.eIndex!=null){_3=_2.el.elements[_2.eIndex]}
if(_3&&_3.getClassName)this.setLastTaskClass(_3.getClassName());this.executionStack=[];this.$1953=_1;this.$223k=_3}
,isc.A.setStateVariable=function isc_Process_setStateVariable(_1,_2){if(!this.state)this.state={};if(_1.indexOf(".")<0||this.state[_1]){this.state[_1]=_2}else{var _3=_1.split(".");var _4=this.state;for(var i=0;i<_3.length-1;i++){var _6=_4[_3[i]];if(_6==null){_4[_3[i]]={}
_6=_4[_3[i]]}
_4=_6}
_4[_3[i]]=_2}
}
,isc.A.getStateVariable=function isc_Process_getStateVariable(_1){if(_1.indexOf(".")<0||this.state[_1]){return this.state[_1]}else{var _2=_1.split(".");var _3=this.state;for(var i=0;i<_2.length-1;i++){_3=_3[_2[i]];if(_3==null){isc.logWarn("Unable to get state variable: "+_1+" no such path")
return}
}
return _3[_2[i]]
}
}
,isc.A.setLastTaskClass=function isc_Process_setLastTaskClass(_1){this.$1955=_1}
,isc.A.getLastTaskClass=function isc_Process_getLastTaskClass(){return this.$1955}
,isc.A.setTaskOutput=function isc_Process_setTaskOutput(_1,_2,_3){if(!_1)return;var _4=_1.getClassName().toLowerCase(),_5=_1.ID
;_3=_3||_1;var _6={task:_1,value:_2,schemaTask:_3
};if(!this.$1954)this.$1954={};this.$1954[_4]=_6;if(_5!=null)this.$1954[_5]=_6;if(_1.bindOutput){var _7=_1.bindOutput;if(_7.startsWith("$"))_7=_7.substring(1);this.setStateVariable(_7,_2)}
}
,isc.A.passThruTaskOutput=function isc_Process_passThruTaskOutput(_1){var _2=this.$2347();this.setTaskOutput(_1,this.getLastTaskOutput(),_2&&_2.schemaTask)}
,isc.A.getLastTaskOutput=function isc_Process_getLastTaskOutput(_1){var _2=this.$2347(_1);return _2&&_2.value}
,isc.A.$2347=function isc_Process__getLastTaskOutput(_1){if(!this.$1954)return null;var _2=_1;if(!_1)_1=this.getLastTaskClass();if(!_1)return null;_1=_1.toLowerCase();if(_2)_2=_2.toLowerCase();var _3=this.$1954[_1];if(_2!=null&&_3==null&&!_2.endsWith("task")&&!_2.endsWith("gateway")){_1=_2+"task";_3=this.$1954[_1];if(_3==null){_1=_2+"gateway";_3=this.$1954[_1]}
}
return _3}
,isc.A.getLastTaskOutputSchema=function isc_Process_getLastTaskOutputSchema(_1,_2){var _3=this.$2347(_1),_4=_3&&_3.schemaTask,_5=(_4&&_4.getOutputSchema?_4.getOutputSchema():null),_6=_5
;if(_5&&_2){_6=isc.DS.get(this.$2346);if(!_6||_6.inheritsFrom!=_5.getID()){if(_6)_6.destroy();var _7;if(!_5.getID()){_7=[];var _8=_5.getFieldNames();for(var i=0;i<_8.length;i++){var _10=_8[i],_11=_5.getField(_10)
;_7.add(isc.clone(_11))}
}
_6=isc.DS.create({ID:this.$2346,inheritsFrom:_5.getID(),fields:_7,clientOnly:true,addGlobalId:false
})}
}
return _6}
,isc.A.destroyLastTaskOutputSchema=function isc_Process_destroyLastTaskOutputSchema(){var _1=isc.DS.get(this.$2346);if(_1&&_1.destroy){_1.destroy()}
}
,isc.A.getLastResponse=function isc_Process_getLastResponse(){return this.$2425}
,isc.A.getLastResponseSchema=function isc_Process_getLastResponseSchema(){var _1=isc.DS.get(this.$243a);if(!_1){_1=isc.DS.create({ID:this.$243a,$145w:true,fields:[{name:"status",type:"enum",valueMap:{"0":"Success: Indicates successful completion of the request","1":"Offline: Indicates that the browser is currently offline, and that we do not hold a cached response for the request","-1":"Failure: Indicates a generic failure on the server","-3":"Authorization failure: Indicates a Declarative Security failure on the server","-4":"Validation error: Indicates a validation failure on the server","-5":"Login incorrect: Indicates that the RPC has been intercepted by an authenticator that requires the user to log in","-6":"Max login attempts exceeded: Indicates that too many authentication attempts have been made and the server refuses to accept any more login attempts","-7":"Login required: Indicates that a login is required before this RPCRequest can proceed","-8":"Login success: Indicates that the login succeeded","-9":"Update without primary key error: Indicates that the client attempted an update or remove operation without providing primary key field(s)","-10":"Transaction failed: Indicates that the request was either never attempted or was rolled back","-11":"Max file size exceeded: Indicates that an uploaded file's size exceeded the maximum file size allowed","-12":"Max post size exceeded: Indicates that the total size of the data sent to the server was more than the server is configured to allow","-13":"Criteria required error: Indicates that an operation binding configured to require OperationBinding.requiredCriterion has received none","-15":"File required error: Indicates that an empty file was uploaded for a required 'binary' field","-16":"Invalid response format: Indicates that a response with invalid format has been received from server","-90":"Transport error: Indicates the server returned an HTTP response code outside the range 200-299","-91":"Unknown host error: Indicates the HTTP proxy cannot resolve the target host","-92":"Connection reset error: Indicates the HTTP proxy received a Java SocketException contacting the target host","-100":"Server timeout: Indicates a request timed out with no server response"
}},{name:"totalRows",type:"int"}
],clientOnly:true,addGlobalId:false
})}
return _1}
,isc.A.getProcessDescription=function isc_Process_getProcessDescription(){var _1=this.getProcessTree();return(_1?this.$2487(_1.getRoot()):null)}
,isc.A.$2487=function isc_Process__addDescriptionFromNode(_1,_2){var _3=isc.SB.create();var _4=_1.children;if(_4){var _5,_6;if(!_2){_3.append("<ul>")}
for(var i=0;i<_4.length;i++){var _8=_4[i];if(isc.isA.DecisionTask(_8.element)){_5=_8.children[0]}else if(isc.isA.MultiDecisionTask(_8.element)){var _9=this.$2487(_8,true);if(_9!=null){_3.append(_9)}
continue}
var _10=(_8.$196c?(_8.$196f!="default"?"When "+_8.$196f:"Otherwise"):_8.title);_3.append("<li>").append(_10);if(!_5){var _9=this.$2487(_8);if(_9!=null){_3.append(_9)}
}
_3.append("</li>");if(_5&&!_6){_3.append("<ul>");_6=true}
}
if(_5){_3.append("</ul>");_3.append("<li>").append("Otherwise");_3.append("<ul><li>").append(_5.title).append("</li></ul>");_3.append("</li>")}
if(!_2){_3.append("</ul>")}
}
return(_3.getArray().length>0?_3.release():null)}
,isc.A.handleTraceElement=function isc_Process_handleTraceElement(_1){if(isc.isA.Class(_1)&&(this.logIsInfoEnabled("workflow")||this.logIsDebugEnabled("workflow")))
{var _2=_1.getElementDescription(),_3=(this.traceElement?"Trace element: ":"Execute element: ")+_1._constructor+(_2?" '"+_2+"'":"");if(this.logIsDebugEnabled("workflow")){this.logDebug(_3+" - task detail: "+this.echo(_1),"workflow")}else{this.logInfo(_3,"workflow")}
}
if(this.traceElement)this.traceElement(_1,this.traceContext)}
,isc.A.getProcessTree=function isc_Process_getProcessTree(_1,_2){var _3={},_4=[],_5={}
;var _6={parentNode:_3,elementNodes:_4,idsSeen:_5,unnamedSequencePrefix:_2||"_notNamed_"
};if(this.executionStack==null){this.executionStack=[]}
var _7=this.traceElement,_8=this.traceContext
;this.traceElement=this.$2488;this.traceContext=_6;this.$2489();this.$249a(_6);if(_1){_6.parentNode=_3;var _9=this.getAllElements();for(var i=0;i<_9.length;i++){var _11=_9[i];if(_11.ID!=null&&!_5[_11.ID]){_6.elementNodes=[];this.$2489(_11.ID,_6);this.$249a(_6);if(_6.elementNodes.length>0){_6.elementNodes[0].orphan=true}
_4.addList(_6.elementNodes)}
}
}
this.traceElement=_7;this.traceContext=_8;this.reset();return isc.Tree.create({root:_3})}
,isc.A.$219g=function isc_Process__getCriteriaDescription(_1,_2){if(!_2)return"";var _3=isc.DecisionTask.$87n(_2);var _4=isc.DataSource.create({addGlobalId:false,fields:_3
});_2=_1.getCriteriaForDescription(_2);return isc.DataSource.getAdvancedCriteriaDescription(_2,_4)}
,isc.A.$249a=function isc_Process__addSubElements(_1){var _2=_1.elementNodes,_3=_1.idsSeen
;if(!_2)return;do{var _4=_2.length;var _5=_2.findAll("isFolder",true)||[];for(var i=0;i<_5.length;i++){var _7=_5[i];if(!_7.isFolder||_7.$196d||_7.children)continue;var _8=_7.element;if(!_8)continue;if(isc.isAn.MultiDecisionTask(_8)){var _9=[];if(_8.decisionList){var _10=_8.decisionList;for(var i=0;i<_10.length;i++){var _11=_10[i],_12=_11.targetTask
;var _13=this.getElement(_12);if(_13){var _14=_11.criteria,_15=this.$249b(_1,null,_7)
;_15.$196c=true;_15.$196f=this.$219g(_8,_14);_2.add(_15);if(_3[_12]){_15.$196d=_13.ID}else{var _16=this.$249b(_1,_13,_15);_2.add(_16);_3[_12]=true;_9.add({criteriaNode:_15,divergentNode:_16})}
}
}
}
if(_8.defaultElement){var _13=this.getElement(_8.defaultElement);if(_13){var _15=this.$249b(_1,null,_7);_15.$196c=true;_15.$196f="default";_15.failure=true;_2.add(_15);if(_3[_8.defaultElement]){_15.$196d=_13.ID}else{var _16=this.$249b(_1,_13,_15);_2.add(_16);_3[_8.defaultElement]=true;_9.add({criteriaNode:_15,divergentNode:_16})}
}
}
for(var j=0;j<_9.length;j++){var _18=_9[j],_15=_18.criteriaNode,_16=_18.divergentNode,_13=_16.element
;_15.children=[];_2.remove(_16);delete _3[_13.ID];_1.parentNode=_15;this.$2489(_13.ID,_1)}
}else{var _19=(_8.failureElement?_8.failureElement:_8.cancelElement);var _13=this.getElement(_19);if(_13){if(_3[_13.ID]){_7.$196d=_13.ID}else{_1.parentNode=_7;this.$2489(_13.ID,_1)}
}
}
}
}while(_2.length>_4)}
,isc.A.$2489=function isc_Process__traceProcess(_1,_2){if(!this.initializedElements){this.instantiateElements();this.initializedElements=true}
if(_1){this.setNextElement(_1)}
while(this.$39n(true)){var _3=this.$87h();if(_2&&_2.$196q){delete _2.$196q;break}
if(isc.isA.MultiDecisionTask(_3)){break}
}
if(_2)delete _2.currentSequence}
,isc.A.$249b=function isc_Process__addElementToProcessNode(_1,_2,_3){var _4=this.$249c(_1,_2);this.$249d(_4,_2);if(!_3.children)_3.children=[];_3.children.add(_4);return _4}
,isc.A.$249c=function isc_Process__createNode(_1,_2){if(_1.nextNodeId==null)_1.nextNodeId=0;var _3={id:_1.nextNodeId++,element:_2
};if(_2&&(isc.isA.MultiDecisionTask(_2)||isc.isAn.DecisionTask(_2)||isc.isAn.UserConfirmationTask(_2)||_2.failureElement||_2.cancelElement))
{_3.isFolder=true}
return _3}
);isc.evalBoundary;isc.B.push(isc.A.$249d=function isc_Process__updateProcessNodeFromElement(_1,_2){var _3=(_2?_2.ID:null);if(_1.elementID!=_3){_1.elementID=_3}
if(_2&&_2.getElementDescription){_1.title=_2.getElementDescription(true)}else{_1.title=_3}
if(_2&&_2.description&&_2.description!=_1.title){_1.prompt=_2.description}
}
,isc.A.$2488=function isc_Process__processTraceElement(_1,_2){if(!_1)return;if(!_2.idsSeen)_2.idsSeen={};if(_2.$196q||(_1.ID&&_2.idsSeen[_1.ID])){_2.$196q=true;return}
if(!_2.parentNode)_2.parentNode={};if(!_2.elementNodes)_2.elementNodes=[];if(isc.isA.ProcessSequence(_1)){if(_2.nextSeqId==null)_2.nextSeqId=0;if(_2.sequenceStack==null)_2.sequenceStack=[];var _3=_1.ID||_2.unnamedSequencePrefix+_2.nextSeqId++;if(_2.currentSequence)_2.sequenceStack.push(_3);_2.currentSequence=_3;if(_1.ID){_2.idsSeen[_1.ID]=true}
return}
var _4=this.$249b(_2,_1,_2.parentNode);if(_2.currentSequence){_4.$196e=_2.currentSequence}
_2.elementNodes.add(_4);if(_2.currentSequence&&_1.nextElement){_2.currentSequence=_2.sequenceStack.pop()}
if(isc.isA.MultiDecisionTask(_1)||isc.isAn.DecisionTask(_1)||isc.isAn.UserConfirmationTask(_1)||_1.failureElement||_1.cancelElement)
{_4.isFolder=true}
if(_1.ID){_2.idsSeen[_1.ID]=true}
}
);isc.B._maxIndex=isc.C+53;isc.Process.registerStringMethods({finished:"state",traceElement:"element,context"});isc.defineClass("ServiceTask","Task");isc.A=isc.ServiceTask;isc.A.requiresDataSources=true;isc.A=isc.ServiceTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.operationType="fetch";isc.A.passThruOutput=false;isc.A.typeTitle="DataSource Fetch Data";isc.A.editorType="ServiceTaskEditor";isc.B.push(isc.A.getInvalidTaskMessage=function isc_ServiceTask_getInvalidTaskMessage(_1){var _2;if(!this.dataSource){_2=this.undefinedComponentMessage.evalDynamicString(this,{propertyName:"dataSource"
})}else{var _3=isc.DS.get(this.dataSource);if(!_3){_2=this.unresolvedComponentMessage.evalDynamicString(this,{propertyName:"dataSource",id:this.dataSource
})}
}
return _2}
,isc.A.executeElement=function isc_ServiceTask_executeElement(_1){if(this.$237w==null){this.$237w=this.forceSingle}
var _2=this.dataSource;if(_2.getClassName==null||_2.getClassName()!="DataSource"){_2=isc.DataSource.get(_2)}
var _3=this.$1956(_1);if(this.operationType=="export"){var _4={exportAs:this.exportFormat,operationId:this.operationId
};_2.exportData(_3,_4);return true}
var _5={operationId:this.operationId};if(this.operationType=="fetch"){if(this.sort){_5.sortBy=isc.DS.getSortBy(this.sort)}
if(this.groupBy){_5.groupBy=this.groupBy}
if(this.summaryFunctions){_5.summaryFunctions=this.summaryFunctions}
}
var _6=isc.addProperties({},this.requestProperties,_5);_6.willHandleError=true;var _7=this,_8=this.operationType
;_2.performDSOperation(_8,_3,function(_19,_20,_21){_1.$2424=_21;_1.$2425=_19;var _9=_19.results;if(_19.isStructured&&(!_9||_9.status<0||(_9.status==null&&_19.status<0)))
{if(!isc.RPC.runDefaultErrorHandling(_19,_21,_7.errorFormatter)){_7.fail(_1);return}
}
var _10=_20;if(isc.isAn.Array(_20)&&_20.length>0){if(_8=="fetch"){var _11=_2.getPrimaryKeyFieldName();if(_2.isAdvancedCriteria(_3)){var _12=_2.getFieldCriterion(_3,_11);if(_12&&_12.operator=="equals"){_10=_20[0]}
}else if(_2.defaultTextMatchStyle=="equals"&&_3[_11]!=null){_10=_20[0]}
}else if(_8!="custom"){_10=_20[0]}
}
_1.setTaskOutput(_7,_10);if(!isc.isAn.Array(_20))_20=[_20];if(_20.length>0){var _13=[];if(_7.outputFieldList){_13.addList(_7.outputFieldList)}
if(_7.outputField)_13.add(_7.outputField);for(var i=0;i<_13.length;i++){var _15=_13[i];if(_15.startsWith("$")){var _16=_20.length==1?_20[0]:_20;_15=_15.substring(1);_1.setStateVariable(_15,_16)}else{var _17=_15;var _18=_17.lastIndexOf(".");if(_18>0){_17=_17.substring(_18+1)}
var _16=_20[0][_17];if(typeof _16!='undefined'){if(_20.length>1){_16=[_16];for(var i=1;i<_20.length;i++){_16.add(_20[i][_17])
}
}
_1.setStateVariable(_15,_16)}
}
};_7.$1952(_20)}
_1.start()},_6);return false}
,isc.A.completeElement=function isc_ServiceTask_completeElement(_1){this.forceSingle=this.$237w;delete this.$237w}
,isc.A.$1956=function isc_ServiceTask__createRequestData(_1,_2){var _3;var _4={};if(this.inputFieldList){for(var i=0;i<this.inputFieldList.length;i++){var _6=this.inputFieldList[i];var _7=_6.lastIndexOf(".");if(_7>0){_6=_6.substring(_7+1)}
_4[_6]=_1.getStateVariable(this.inputFieldList[i])}}
if(this.inputField){var _6=this.inputField;if(!_2&&_6.startsWith("$")){_3=this.$1968(_6,_1)}
var _7=_6.lastIndexOf(".");if(_7>0){_6=_6.substring(_7+1)}
if(_3==null)_3=_1.getStateVariable(this.inputField);_4[_6]=_3}
var _8=null;if(this.operationType=="fetch"||this.operationType=="export"){if(this.criteria&&!_2){_8=this.$195y(this.criteria,_3,_4,_1)}else if(this.criteria){_8=this.criteria}
if(this.fixedCriteria){if(_8==null&&_4==null){_8=this.fixedCriteria
}else{var _9=isc.clone(this.fixedCriteria);if(_4){_9=isc.DataSource.combineCriteria(_4,_9)}
if(_8){_9=isc.DataSource.combineCriteria(_8,_9)}
_8=_9}
}
}
if(_8==null){_8=(this.inputFieldList==null&&isc.isAn.Object(_3)?_3:_4)}
if(this.operationType!="fetch"&&this.operationType!="export"){if(this.values){_8=this.values;if(!_2){var _10=this.objectReferencesLastTaskOutput(this.values,_1),_11=(this.operationType=="remove"&&_10)
;_8=this.$1950(this.values,_3,_4,_1,_11);if((this.operationType=="add"||this.operationType=="update")&&!_10)
{this.forceSingle=true}
}
}
if(this.fixedValues){for(var _6 in this.fixedValues){_8[_6]=this.fixedValues[_6]}
}
}
return _8}
,isc.A.fail=function isc_ServiceTask_fail(_1){if(!this.failureElement){this.logInfo("ServiceTask does not have a failureElement. Process is aborting.")}
if(this.failureElement=="next"){_1.start()}else{_1.setNextElement(this.failureElement)}
}
,isc.A.errorFormatter=function isc_ServiceTask_errorFormatter(_1,_2,_3){if(_1=="VALIDATION_ERROR"){var _4=_2.errors,_5=["Server returned validation errors:<BR><UL>"]
;if(!isc.isAn.Array(_4))_4=[_4];for(var i=0;i<_4.length;i++){var _7=_4[i];for(var _8 in _7){var _9=_7[_8];_5.add("<LI><B>"+_8+":</B> ");if(!isc.isAn.Array(_9))_9=[_9];for(var j=0;j<_9.length;j++){var _11=_9[j];_5.add((j>0?"<BR>":"")+(isc.isAn.Object(_11)?_11.errorMessage:_11))}
_5.add("</LI>")}
}
_5.add("</UL>");return _5.join("")}
return null}
,isc.A.getElementDescription=function isc_ServiceTask_getElementDescription(){if(!this.dataSource)return"";var _1=this.operationType.substring(0,1).toUpperCase()+this.operationType.substring(1);if(this.operationId)_1+=" ("+this.operationId+")";var _2=_1+" "+this.dataSource,_3=this.$1956({getStateVariable:function(_8){return _8}},true)
;if(this.operationType=="fetch"||this.operationType=="remove"||this.operationType=="export"){if(_3&&!isc.isAn.emptyObject(_3)){if(!isc.DS.isAdvancedCriteria(_3)){_3=isc.DS.convertCriteria(_3,(this.operationType=="remove"?"exact":null),isc.DS.get(this.dataSource))}
var _4=isc.DecisionTask.$87n(_3);var _5=isc.DataSource.create({addGlobalId:false,fields:_4
});_3=this.getCriteriaForDescription(_3);_2+=" where <ul>"+isc.DataSource.getAdvancedCriteriaDescription(_3,_5,{prefix:"<li>",suffix:"</li>"})+"</ul>";_5.destroy()}else{_2=_1+" all "+this.dataSource+" records"}
if(this.sort){var _6=isc.DS.getSortBy(this.sort).map(function(_8){return(_8.startsWith("-")?_8.substring(1)+" (descending)":_8)}).join(", ");_2+=" sorted by "+_6}
if(this.groupBy||this.summaryFunctions){var _7={groupBy:this.groupBy,summaryFunctions:this.summaryFunctions
};_2+="<p>"+isc.DS.getAggregationDescription(_7,this.dataSource)}
}else{_2+=" record"}
return _2}
,isc.A.getOutputSchema=function isc_ServiceTask_getOutputSchema(){var _1=this.dataSource;if(_1&&(_1.getClassName==null||_1.getClassName()!="DataSource")){_1=isc.DataSource.get(_1)}
return _1}
,isc.A.updateLastElementBindingReferences=function isc_ServiceTask_updateLastElementBindingReferences(_1){var _2=this.Super("updateLastElementBindingReferences",arguments);if(this.criteria&&(this.operationType=="fetch"||this.operationType=="export")){_2=this.updateLastElementInCriteria(this.criteria,_1)||_2}
if(this.values&&this.operationType!="fetch"&&this.operationType!="export"){_2=this.updateLastElementInValues(this.values,_1)||_2}
return _2}
,isc.A.updateGlobalIDReferences=function isc_ServiceTask_updateGlobalIDReferences(_1,_2){var _3=this.Super("updateGlobalIDReferences",arguments);if(this.dataSource==_1){this.dataSource=_2;_3=true}
if(this.criteria&&(this.operationType=="fetch"||this.operationType=="export")){_3=this.updateGlobalIDInCriteria(this.criteria,_1,_2)||_3}
if(this.values&&this.operationType!="fetch"&&this.operationType!="export"){_3=this.updateGlobalIDInValues(this.values,_1,_2)||_3}
return _3}
,isc.A.getComponentReferences=function isc_ServiceTask_getComponentReferences(){return(this.dataSource?[this.dataSource]:[])}
);isc.B._maxIndex=isc.C+11;isc.defineClass("DSFetchTask","ServiceTask");isc.A=isc.DSFetchTask.getPrototype();isc.A.typeTitle="DataSource Fetch";isc.A.classDescription="Retrieve data from a DataSource which match specified criteria";isc.A.editorType="ServiceTaskEditor";isc.A.editorProperties={showOperationTypePicker:false};isc.A.operationType="fetch";isc.defineClass("DSAddTask","ServiceTask");isc.A=isc.DSAddTask.getPrototype();isc.A.typeTitle="DataSource Add";isc.A.classDescription="Add a new record";isc.A.editorType="DSAddTaskEditor";isc.A.editorProperties={showOperationTypePicker:false};isc.A.operationType="add";isc.A.supportsMultipleInputRecords=true;isc.defineClass("DSUpdateTask","ServiceTask");isc.A=isc.DSUpdateTask.getPrototype();isc.A.typeTitle="DataSource Update";isc.A.classDescription="Update an existing record";isc.A.editorType="DSUpdateTaskEditor";isc.A.editorProperties={showOperationTypePicker:false};isc.A.operationType="update";isc.A.supportsMultipleInputRecords=true;isc.defineClass("DSRemoveTask","ServiceTask");isc.A=isc.DSRemoveTask.getPrototype();isc.A.typeTitle="DataSource Remove";isc.A.classDescription="Remove an existing record";isc.A.editorType="ServiceTaskEditor";isc.A.editorProperties={showOperationTypePicker:false};isc.A.operationType="remove";isc.defineClass("ScriptTask","Task");isc.A=isc.ScriptTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.passThruOutput=false;isc.A.isAsync=false;isc.B.push(isc.A.getProcess=function isc_ScriptTask_getProcess(){return this._process}
,isc.A.getInputData=function isc_ScriptTask_getInputData(){return this.inputData}
,isc.A.setOutputData=function isc_ScriptTask_setOutputData(_1){this.$87l(this._process,null,_1)}
,isc.A.getInputRecord=function isc_ScriptTask_getInputRecord(){return this.inputRecord}
,isc.A.setOutputRecord=function isc_ScriptTask_setOutputRecord(_1){this.$87l(this._process,_1)}
,isc.A.executeElement=function isc_ScriptTask_executeElement(_1){var _2;var _3={};if(this.inputFieldList){for(var i=0;i<this.inputFieldList.length;i++){var _5=this.inputFieldList[i];var _6=_5.lastIndexOf(".");if(_6>0){_5=_5.substring(_6+1)}
var _7=_1.getStateVariable(this.inputFieldList[i]);_3[_5]=(!isc.isA.Class(_7)?isc.clone(_7):_7)}}
if(this.inputField){var _5=this.inputField;if(_5.startsWith("$")){var _7=this.$1968(_5,_1);_2=(!isc.isA.Class(_7)?isc.clone(_7):_7)}
var _6=_5.lastIndexOf(".");if(_6>0){_5=_5.substring(_6+1)}
if(_2==null){var _7=_1.getStateVariable(this.inputField);_2=(!isc.isA.Class(_7)?isc.clone(_7):_7)}
_3[_5]=_2}
this.inputData=_2;this.inputRecord=_3;this._process=_1;try{var _8=this.execute(_2,_3)}catch(e){isc.logWarn("Error while executing ScriptTask: "+e.toString())}
if(this.isAsync){return false}
if(typeof _8=='undefined'){return true}
this.$87m(_1,_8);return true}
,isc.A.$87m=function isc_ScriptTask__processTaskOutput(_1,_2){_1.setTaskOutput(this,_2);if(this.outputFieldList){for(var i=0;i<this.outputFieldList.length;i++){var _4=this.outputFieldList[i];var _5=_4.lastIndexOf(".");if(_5>0){_4=_4.substring(_5+1)}
var _6=_2[_4];if(typeof _6!='undefined'){_1.setStateVariable(this.outputFieldList[i],_6)}
}}
if(this.outputField){if(this.outputFieldList==null){if(typeof _2!='undefined'){_1.setStateVariable(this.outputField,_2)}
}else{var _4=this.outputField;var _5=_4.lastIndexOf(".");if(_5>0){_4=_4.substring(_5+1)}
var _6=_2[_4];if(typeof _6!='undefined'){_1.setStateVariable(this.outputField,_6)}
}
}
this.$1952(_2)}
,isc.A.$87l=function isc_ScriptTask__finishTask(_1,_2,_3){if(_2==null){this.$87m(_1,_3)}else{if(_3){var _4=this.outputField;var _5=_4.lastIndexOf(".");if(_5>0){_4=_4.substring(_5+1)}
_2[_4]=_3}
this.$87m(_1,_2)}
if(this.isAsync){_1.start()}
}
,isc.A.getCustomDefaults=function isc_ScriptTask_getCustomDefaults(){return{execute:isc.Func.getBody(this.execute)}}
);isc.B._maxIndex=isc.C+9;isc.ScriptTask.registerStringMethods({execute:"input,inputRecord"});isc.defineClass("DecisionTask","ProcessElement");isc.A=isc.DecisionTask;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.$90p=function isc_c_DecisionTask__processFieldsRecursivelyValuesOnly(_1){var _2=[];if(_1.fieldName){if(!_2.contains(_1.fieldName)){_2.add(_1.fieldName)}
}else if(_1.criteria){for(var i=0;i<_1.criteria.length;i++){var _4=this.$90p(_1.criteria[i]);for(var j=0;j<_4.length;j++){if(!_2.contains(_4[j])){_2.add(_4[j])}
}
}
}else{for(var _6 in _1){if(!_2.contains(_6)){_2.add(_6)}
}
}
return _2
}
,isc.A.$87n=function isc_c_DecisionTask__processFieldsRecursively(_1){var _2=[];var _3=isc.DecisionTask.$90p(_1);for(var i=0;i<_3.length;i++){var _5=_3[i],_6=_5.split("."),_7=isc.DS.getAutoTitle(_6[_6.length-1])
;_2.add({name:_5,title:_7
})}
return _2}
);isc.B._maxIndex=isc.C+2;isc.A=isc.DecisionTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.typeTitle="Decision";isc.A.classDescription="Choose the next task based on criteria";isc.A.editorType="DecisionTaskEditor";isc.B.push(isc.A.executeElement=function isc_DecisionTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=_1.getLastTaskOutput();var _3=this.criteria;if(_3){_3=this.$195y(_3,_1.state,_1.state,_1)}
var _4=[];if(_1.state&&!isc.isAn.emptyObject(_1.state)){_4.add(_1.state)}
if(_2){_4.add({"$last":_2})}
if(_1.ruleScope){var _5=this.getLocalComponent(_1,_1.ruleScope);if(_5&&!_5.destroyed){_4.add(_5.getRuleContext())}
}
if(_3&&isc.DS.applyFilter(_4,_3).length==1){if(this.nextElement)_1.setNextElement(this.nextElement)}else{if(!this.failureElement){this.logInfo("DecisionTask does not have a failureElement. Process is aborting.")}
_1.setNextElement(this.failureElement)}
return true}
,isc.A.getElementDescription=function isc_DecisionTask_getElementDescription(_1){var _2="No criteria - always fail";if(this.criteria){var _3=isc.DecisionTask.$87n(this.criteria);var _4=isc.DataSource.create({addGlobalId:false,fields:_3
});var _5=this.getCriteriaForDescription(this.criteria);if(_1){_2="When "+isc.DataSource.getAdvancedCriteriaDescription(_5,_4)}else{_2="When <ul>"+isc.DataSource.getAdvancedCriteriaDescription(_5,_4,{prefix:"<li>",suffix:"</li>"})+"</ul>"}
_4.destroy()}
return _2}
,isc.A.getPlaceholders=function isc_DecisionTask_getPlaceholders(){return(this.failureElement==isc.Process.decisionPlaceholderSelection?["failureElement"]:null)}
,isc.A.setPlaceholderId=function isc_DecisionTask_setPlaceholderId(_1,_2){if(_1=="failureElement")this.failureElement=_2}
,isc.A.updateLastElementBindingReferences=function isc_DecisionTask_updateLastElementBindingReferences(_1){var _2=this.Super("updateLastElementBindingReferences",arguments);_2=this.updateLastElementInCriteria(this.criteria,_1)||_2;return _2}
,isc.A.updateGlobalIDReferences=function isc_DecisionTask_updateGlobalIDReferences(_1,_2){var _3=this.Super("updateGlobalIDReferences",arguments);_3=this.updateGlobalIDInCriteria(this.criteria,_1,_2)||_3;return _3}
);isc.B._maxIndex=isc.C+6;isc.defineClass("XORGateway","DecisionTask");isc.defineClass("UserConfirmationTask","ProcessElement");isc.A=isc.UserConfirmationTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.typeTitle="Confirm with user";isc.A.classDescription="Choose the next task based on user confirmation";isc.A.editorType="UserConfirmationTaskEditor";isc.B.push(isc.A.executeElement=function isc_UserConfirmationTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTextFormulaValue(this.textFormula,_1)||this.getDynamicValue(this.message,_1);var _3=this;isc.confirm(_2,function(_4){if(_4){if(_3.nextElement)_1.setNextElement(_3.nextElement)}else{if(!_3.failureElement){_3.logInfo("User Confirmation Gateway does not have a failureElement. Process is aborting.")}
_1.setNextElement(_3.failureElement)}
_1.start()});return false}
,isc.A.getElementDescription=function isc_UserConfirmationTask_getElementDescription(){var _1=(this.textFormula?this.textFormula.text:this.message)||"",_2=_1.split(" "),_3=_2.getRange(0,3).join(" ")
;if(_3.length>25)_3=_3.substring(0,25);if(_3!=_1)_3+=" ...";"Confirm with user: \""+_3+"\""}
,isc.A.getPlaceholders=function isc_UserConfirmationTask_getPlaceholders(){return(this.failureElement==isc.Process.decisionPlaceholderSelection?["failureElement"]:null)}
,isc.A.setPlaceholderId=function isc_UserConfirmationTask_setPlaceholderId(_1,_2){if(_1=="failureElement")this.failureElement=_2}
);isc.B._maxIndex=isc.C+4;isc.defineClass("UserConfirmationGateway","UserConfirmationTask");isc.defineClass("MultiDecisionTask","ProcessElement");isc.A=isc.MultiDecisionTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$1957=false;isc.A.typeTitle="Multi Decision";isc.A.classDescription="Choose multiple possible next tasks based on criteria";isc.A.editorType="MultiDecisionTaskEditor";isc.B.push(isc.A.executeElement=function isc_MultiDecisionTask_executeElement(_1){this.$197v();if(!this.decisionList)this.decisionList=[];var _2=_1.getLastTaskOutput();_1.passThruTaskOutput(this);for(var i=0;i<this.decisionList.length;i++){var _4=this.decisionList[i],_5=_4.criteria
;if(_5){_5=this.$195y(_5,_1.state,_1.state,_1)}
var _6=isc.DecisionTask.$87n(_5);var _7=isc.DataSource.create({fields:_6
});var _8=[];if(_1.state&&!isc.isAn.emptyObject(_1.state)){_8.add(_1.state)}
if(_2){_8.add({"$last":_2})}
if(_1.ruleScope){var _9=this.getLocalComponent(_1,_1.ruleScope);if(_9&&!_9.destroyed){_8.add(_9.getRuleContext())}
}
if(_7.applyFilter(_8,_5).length==1){_1.setNextElement(_4.targetTask);return true}
}
if(this.defaultElement)_1.setNextElement(this.defaultElement);return true}
,isc.A.$197v=function isc_MultiDecisionTask__convertCriteriaMap(){if(!this.decisionList&&this.criteriaMap){var _1=[];for(var _2 in this.criteriaMap){_1.add({criteria:this.criteriaMap[_2],targetTask:_2
})}
this.decisionList=_1}
}
,isc.A.getElementDescription=function isc_MultiDecisionTask_getElementDescription(){this.$197v();var _1="Multi-branch";if((!this.decisionList||this.decisionList.length==0)&&this.defaultElement){_1="Go to "+this.defaultElement}
return _1}
,isc.A.dropElementReferences=function isc_MultiDecisionTask_dropElementReferences(_1){this.$197v();if(this.decisionList){for(var i=0;i<this.decisionList.length;i++){var _3=this.decisionList[i];if(_3.targetTask==_1){_3.targetTask=isc.Process.decisionPlaceholderSelection
}
}
}
}
,isc.A.updateElementReferences=function isc_MultiDecisionTask_updateElementReferences(_1,_2){this.$197v();if(this.decisionList){for(var i=0;i<this.decisionList.length;i++){var _4=this.decisionList[i];if(_4.targetTask==_1)_4.targetTask=_2}
}
if(this.defaultElement==_1)this.defaultElement=_2}
,isc.A.getPlaceholders=function isc_MultiDecisionTask_getPlaceholders(){this.$197v();var _1=[];if(this.decisionList){for(var i=0;i<this.decisionList.length;i++){var _3=this.decisionList[i];if(_3.targetTask==isc.Process.decisionPlaceholderSelection){_1.add(""+i)}
}
}
if(this.defaultElement==isc.Process.decisionPlaceholderSelection){_1.add("defaultElement")}
return _1}
,isc.A.getDecisionTargets=function isc_MultiDecisionTask_getDecisionTargets(){this.$197v();var _1=[];if(this.decisionList){for(var i=0;i<this.decisionList.length;i++){var _3=this.decisionList[i];if(_3.targetTask!=isc.Process.decisionPlaceholderSelection){_1.add(_3.targetTask)}
}
}
if(this.defaultElement!=isc.Process.decisionPlaceholderSelection){_1.add(this.defaultElement)}
return _1}
,isc.A.setPlaceholderId=function isc_MultiDecisionTask_setPlaceholderId(_1,_2){if(_1=="defaultElement"){this.defaultElement=_2}else{var _3=parseInt(_1);this.decisionList[_3].targetTask=_2}
}
,isc.A.updateLastElementBindingReferences=function isc_MultiDecisionTask_updateLastElementBindingReferences(_1){var _2=this.Super("updateLastElementBindingReferences",arguments);if(this.decisionList){for(var i=0;i<this.decisionList.length;i++){var _4=this.decisionList[i],_5=_4.criteria
;_2=this.updateLastElementInCriteria(this.criteria,_1)||_2}
}
return _2}
,isc.A.updateGlobalIDReferences=function isc_MultiDecisionTask_updateGlobalIDReferences(_1,_2){var _3=this.Super("updateGlobalIDReferences",arguments);if(this.decisionList){for(var i=0;i<this.decisionList.length;i++){var _5=this.decisionList[i],_6=_5.criteria
;_3=this.updateGlobalIDInCriteria(_6,_1,_2)||_3}
}
return _3}
);isc.B._maxIndex=isc.C+10;isc.defineClass("DecisionGateway","MultiDecisionTask");isc.DecisionGateway.addProperties({})
isc.defineClass("UserTask","Task");isc.A=isc.UserTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.passThruOutput=false;isc.A.editorType="UserTaskEditor";isc.B.push(isc.A.goToPrevious=function isc_UserTask_goToPrevious(){if(this.previousElement==null){isc.logWarn("PreviousElement is not set - unable to accomplish goToPrevious method.");return}
this._process.setNextElement(this.previousElement);this.completeEditing()}
,isc.A.cancelEditing=function isc_UserTask_cancelEditing(){if(this._process){if(this.wizard||this._process.wizard){if(this.targetFormValue){this.targetFormValue.hide()}else if(this.targetViewValue){this.targetViewValue.hide()}
}
var _1=this._process
delete this._process;_1.setNextElement(this.cancelElement);_1.start()}
}
,isc.A.completeEditing=function isc_UserTask_completeEditing(){if(this._process){var _1=this._process;delete this._process;if(this.wizard||_1.wizard){if(this.targetFormValue){this.targetFormValue.hide()}else if(this.targetViewValue){this.targetViewValue.hide()}
}
var _2;if(this.targetVMValue){_2=this.targetVMValue.getValues()}else if(this.targetFormValue){_2=this.targetFormValue.getValues()}
if(_2!=null)_1.setTaskOutput(this,_2);if(this.outputField){_1.setStateVariable(this.outputField,_2)}else if(this.outputFieldList){for(var i=0;i<this.outputFieldList.length;i++){var _4=this.outputFieldList[i];var _5=_4.lastIndexOf(".");if(_5>0){_4=_4.substring(_5+1)}
var _6=_2[_4];if(typeof _6!='undefined'){_1.setStateVariable(this.outputFieldList[i],_6)}
}
}else if(this.inputField){_1.setStateVariable(this.inputField,_2)}
this.$1952(_2);_1.start()}
}
,isc.A.executeElement=function isc_UserTask_executeElement(_1){this._process=_1;if(this.targetView&&isc.isA.String(this.targetView)){if(_1.getStateVariable(this.targetView)){this.targetViewValue=_1.getStateVariable(this.targetView)}else{this.targetViewValue=this.getLocalComponent(_1,this.targetView);if(this.targetViewValue==null&&_1.views){for(var i=0;i<_1.views.length;i++){if(_1.views[i].ID==this.targetView){this.targetViewValue=isc[_1.views[i]._constructor].create(_1.views[i]);if(this._process.containerId){var _3=this.getLocalComponent(this._process,this._process.containerId);_3.addMember(this.targetViewValue)}
break}
}
}
if(this.targetViewValue==null){this.targetViewValue=this.addAutoChild(this.targetView)}
if(this.targetViewValue==null){isc.logWarn("TargetView "+this.targetView+" was not found.")}
}
}else{if(this.targetView){this.targetViewValue=this.targetView}else if(this.inlineView){this.targetViewValue=isc[this.inlineView._constructor].create(this.inlineView);if(this._process.containerId){var _3=this.getLocalComponent(this._process,this._process.containerId);_3.addMember(this.targetViewValue)}
}
}
if(this.targetVM&&isc.isA.String(this.targetVM)){if(_1.state[this.targetVM]){this.targetVMValue=_1.getStateVariable(this.targetVM)}else{this.targetVMValue=this.getLocalComponent(_1,this.targetVM);if(this.targetVMValue==null){isc.logWarn("TargetVM "+this.targetVM+" was not found.")}
}
}else{this.targetVMValue=this.targetVM}
if(this.targetForm&&isc.isA.String(this.targetForm)){if(_1.state[this.targetForm]){this.targetFormValue=_1.getStateVariable(this.targetForm)}else{this.targetFormValue=this.getLocalComponent(_1,this.targetForm);if(this.targetFormValue==null){isc.logWarn("TargetForm "+this.targetForm+" was not found.")}
}
}else{this.targetFormValue=this.targetForm}
if(this.targetFormValue==null&&isc.isA.DynamicForm(this.targetViewValue)){this.targetFormValue=this.targetViewValue}
if(this.targetViewValue==null){isc.logWarn("targetView, inlineView or targetForm should be set for UserTask");return true}
this.targetViewValue.showRecursively();var _4=null;if(this.inputField){if(this.inputField.startsWith("$")){_4=isc.clone(this.$1968(this.inputField,_1))}else{_4=isc.clone(_1.getStateVariable(this.inputField))}
}else if(this.inputFieldList){_4={};for(var i=0;i<this.inputFieldList.length;i++){var _5=this.inputFieldList[i];var _6=_5.lastIndexOf(".");if(_6>0){_5=_5.substring(_6+1)}
_4[_5]=isc.clone(_1.getStateVariable(this.inputFieldList[i]))}
}
if(this.targetVMValue){if(_4)this.targetVMValue.setValues(_4);this.targetVMValue.userTask=this}
if(this.targetFormValue){if(_4)this.targetFormValue.setValues(_4);this.targetFormValue.saveToServer=(this.saveToServer==true);this.targetFormValue.userTask=this}
if(this.targetViewValue){this.targetViewValue.userTask=this}
return false}
,isc.A.getElementDescription=function isc_UserTask_getElementDescription(){var _1={type:"[nothing]"};if(this.targetView){_1={type:"targetView",ID:(isc.isA.String(this.targetView)?this.targetView:null)}}else if(this.inlineView){_1={type:"inlineView"}}
return"Show "+(_1.ID?"'"+_1.ID+"' ":"")+_1.type+" and wait for input"}
,isc.A.getComponentReferences=function isc_UserTask_getComponentReferences(){var _1=this.Super("getComponentReferences",arguments);if(this.targetView&&!_1.contains(this.targetView)){_1.add(this.targetView)}
if(this.targetForm&&!_1.contains(this.targetForm)){_1.add(this.targetForm)}
if(this.targetVM&&!_1.contains(this.targetVM)){_1.add(this.targetVM)}
return _1}
);isc.B._maxIndex=isc.C+6;isc.defineClass("StateTask","Task");isc.A=isc.StateTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.passThruOutput=false;isc.A.fieldListsLengthMismatchMessage="outputFieldList should have same number of parameters as inputFieldList";isc.A.editorType="StateTaskEditor";isc.B.push(isc.A.getInvalidTaskMessage=function isc_StateTask_getInvalidTaskMessage(_1){var _2;if(this.value==null&&this.inputField==null&&this.inputFieldList==null){_2=this.undefinedComponentMessage.evalDynamicString(this,{propertyName:"value, inputField or inputFieldList"
})}else if(this.value==null&&this.inputField==null){if(this.outputFieldList==null||this.outputFieldList.length!=this.inputFieldList.length){_2=this.fieldListsLengthMismatchMessage}
}
return _2}
,isc.A.executeElement=function isc_StateTask_executeElement(_1){if(this.value==null&&this.inputField==null&&this.inputFieldList==null){isc.logWarn("StateTask: value, inputField or inputFieldList should be set.");return true}
if(this.value==null&&this.inputField==null){if(this.outputFieldList==null||this.outputFieldList.length!=this.inputFieldList.length){isc.logWarn("StateTask: outputFieldList should have same number of parameters as inputFieldList.");return}
if(this.type){isc.logWarn("StateTask: type cannot be used with multiple outputFields")}
for(var i=0;i<this.inputFieldList.lenght;i++){var _3=_1.getStateVariable(this.inputFieldList[i]);_1.setStateVariable(this.outputFieldList[i],_3)}
return true}
var _3=this.value||this.$1968(this.inputField,_1);_3=this.$104s(_3,this.type,_1);_1.setStateVariable(this.outputField,_3);_1.setTaskOutput(this,_3);return true}
,isc.A.$104s=function isc_StateTask__executePair(_1,_2,_3){if(_1==null){isc.logWarn("StateTask: value is null. Unable to convert to "+_2);this.fail(_3);return null}
if("string"==_2){return _1.toString()}else if("boolean"==_2){if("true"==_1)return true;if("false"==_1)return false;if(isc.isA.String(_1))return _1.length!=0;if(isc.isA.Number(_1))return _1!=0;return _1!=null}else if("decimal"==_2){var v=parseFloat(_1.toString());if(isNaN(v)){this.fail(_3);return null}
return v}else if("integer"==_2){var v=parseInt(_1.toString());if(isNaN(v)){this.fail(_3);return null}
return v}else if("record"==_2){if(isc.isAn.Object(_1)&&!isc.isAn.Array(_1)&&!isc.isAn.RegularExpression(_1)&&!isc.isAn.Date(_1))
{return _1}
return null}else if("array"==_2){if(isc.isAn.Array(_1))return _1;return[_1]}else{return _1}
}
,isc.A.fail=function isc_StateTask_fail(_1){if(this.failureElement==null){isc.logInfo("There is no failureElement in stateTask")}else{_1.setNextElement(this.failureElement)}
}
,isc.A.getElementDescription=function isc_StateTask_getElementDescription(){var _1="no-op";if(this.value!=null){_1="Set "+this.outputField+"="+this.value}else if(this.type!=null){_1="Set "+this.outputField+"="+this.inputField+" as "+this.type}else if(this.inputField||this.inputFieldList){_1="Copy "+(this.inputField?this.inputField:this.inputFieldList.join(","))+" to "+(this.outputField?this.outputField:this.outputFieldList.join(","))}
return _1}
);isc.B._maxIndex=isc.C+5;isc.defineClass("StartProcessTask","ScriptTask");isc.A=isc.StartProcessTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.isAsync=true;isc.B.push(isc.A.getInvalidTaskMessage=function isc_StartProcessTask_getInvalidTaskMessage(_1){var _2;if(!this.process){_2=this.undefinedComponentMessage.evalDynamicString(this,{propertyName:"process"
})}else{var _3=_1.screenComponent,_4=this.process
;if(isc.isA.String(_4)){var _5=_4;_4=(_3&&_3.getWorkflowById(_5))||isc.Process.getProcess(_5);if(!_4){_2=this.unresolvedComponentMessage.evalDynamicString(this,{propertyName:"process",id:_5
})}
}
}
return _2}
,isc.A.execute=function isc_StartProcessTask_execute(_1,_2){if(!this.process){this.logWarn("StartProcessTask with no process. Skipped");return}
var _3=this.getProcess(),_4=_3.screenComponent,_5=this.process
;if(isc.isA.String(_5)){var _6=_5;_5=(_4&&_4.getWorkflowById(_6))||isc.Process.getProcess(_6);if(!_5){this.logWarn("StartProcessTask was not able to locate workflow '"+_6+"'. Skipped");return}
}
if(_5.$2454){if(!_5.$2455){_5.$2455=[]}
_5.$2455.push(_3);if(_3.logIsInfoEnabled("workflow")||_3.logIsDebugEnabled("workflow")){var _7=this.getElementDescription(),_8=("Execute element (delayed): ")+this._constructor+(_7?" '"+_7+"'":"");if(_3.logIsDebugEnabled("workflow")){_3.logDebug(_8+" - task detail: "+this.echo(this),"workflow")}else{_3.logInfo(_8,"workflow")}
}
return false}
_5.$2454=true;_5.screenComponent=_4;var _9=_5.finished,_10=this
;_5.finished=function(_12){delete _5.finished;delete _5.screenComponent;_5.finished=_9;_5.reset();if(_9)_9(_12);delete _5.$2454;if(_5.$2455){var _11=_5.$2455.shift();if(_5.$2455.length==0){delete _5.$2455}
_11.delayCall("start",[true])}
_10.delayCall("setOutputRecord",[_12])}
this.isAsync=true;_5.setState(_2);_5.start()}
);isc.B._maxIndex=isc.C+2;isc.defineClass("EndProcessTask","ProcessElement");isc.A=isc.EndProcessTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.editorPlaceholder=true;isc.B.push(isc.A.executeElement=function isc_EndProcessTask_executeElement(_1){}
);isc.B._maxIndex=isc.C+1;isc.defineClass("ShowMessageTask","ProcessElement");isc.A=isc.ShowMessageTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.classDescription="Show a message in a modal dialog";isc.A.editorType="ShowMessageTaskEditor";isc.A.type="normal";isc.A.$207j={"normal":"","warning":"warning","error":"error"
};isc.B.push(isc.A.executeElement=function isc_ShowMessageTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.type,_3=function(){_1.start()}
;var _4=this.getTextFormulaValue(this.textFormula,_1)||this.getDynamicValue(this.message,_1);if(_2=="normal"){isc.say(_4,_3)}else if(_2=="warning"){isc.warn(_4,_3)}else if(_2=="error"){isc.Dialog.create({message:_4,icon:isc.Dialog.getInstanceProperty("errorIcon"),buttons:[isc.Button.create({title:"OK"})
],buttonClick:function(_5,_6){_3();this.hide();this.destroy()}
})}else{return true}
return false}
,isc.A.getElementDescription=function isc_ShowMessageTask_getElementDescription(){var _1=(this.textFormula?this.textFormula.text:this.message)||"",_2=_1.split(" "),_3=_2.getRange(0,3).join(" "),_4=this.type||"message"
;if(_3.length>25)_3=_3.substring(0,25);if(_3!=_1)_3+=" ...";return"Show "+this.$207j[_4]+" message: \""+_3+"\""}
,isc.A.updateGlobalIDReferences=function isc_ShowMessageTask_updateGlobalIDReferences(_1,_2){var _3=this.Super("updateGlobalIDReferences",arguments);if(this.textFormula&&this.textFormula.text){_3=this.updateGlobalIDInTextFormula(this.textFormula,_1,_2)||_3}
return _3}
);isc.B._maxIndex=isc.C+3;isc.defineClass("AskForValueTask","UserConfirmationTask");isc.A=isc.AskForValueTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.typeTitle="Ask for Value";isc.A.classDescription="Ask the user to input a value";isc.A.editorType="AskForValueTaskEditor";isc.B.push(isc.A.executeElement=function isc_AskForValueTask_executeElement(_1){var _2=(this.defaultValue?{defaultValue:this.defaultValue}:null);var _3=this.getTextFormulaValue(this.textFormula,_1)||this.getDynamicValue(this.message,_1);var _4=this;isc.askForValue(_3,function(_5){if(_5){_1.setTaskOutput(_4,{value:_5,canceled:false
});if(_4.nextElement)_1.setNextElement(_4.nextElement)}else{if(!_4.failureElement){_4.logInfo("Ask For Value Task does not have a failureElement. Process is aborting.")}
_1.setTaskOutput(_4,{canceled:true
});if(_4.failureElement!="next"){_1.setNextElement(_4.failureElement)}
}
_1.start()},_2);return false}
,isc.A.getOutputSchema=function isc_AskForValueTask_getOutputSchema(){if(!this.$214x){var _1=[{name:"value",title:"Value"},{name:isc.Canvas.$177r+"canceled",title:"[meta] canceled",type:"boolean",criteriaPath:"$last.canceled"}
];this.$214x=isc.DS.create({addGlobalId:false,clientOnly:true,fields:_1
})}
return this.$214x}
,isc.A.destroy=function isc_AskForValueTask_destroy(){if(this.$214x)this.$214x.destroy();this.Super("destroy",arguments)}
,isc.A.getElementDescription=function isc_AskForValueTask_getElementDescription(){var _1=(this.textFormula?this.textFormula.text:this.message)||"",_2=_1.split(" "),_3=_2.getRange(0,3).join(" ")
;if(_3.length>25)_3=_3.substring(0,25);if(_3!=_1)_3+=" ...";return"Ask for value: \""+_3+"\""}
,isc.A.updateGlobalIDReferences=function isc_AskForValueTask_updateGlobalIDReferences(_1,_2){var _3=this.Super("updateGlobalIDReferences",arguments);if(this.textFormula&&this.textFormula.text){_3=this.updateGlobalIDInTextFormula(this.textFormula,_1,_2)||_3}
return _3}
);isc.B._maxIndex=isc.C+5;isc.defineClass("ShowNotificationTask","ProcessElement");isc.A=isc.ShowNotificationTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.classDescription="Show a message which fades out automatically";isc.A.editorType="ShowNotificationTaskEditor";isc.A.autoDismiss=true;isc.A.position="T";isc.A.notifyType="message";isc.A.$207k={"message":"","warn":" warning","error":" error"
};isc.B.push(isc.A.executeElement=function isc_ShowNotificationTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.notifyType,_3={position:this.position};if(!this.autoDismiss){_3.duration=0;_3.canDismiss=true}
var _4=this.getTextFormulaValue(this.textFormula,_1)||this.getDynamicValue(this.message,_1);isc.Notify.addMessage(_4,null,_2,_3);return true}
,isc.A.getElementDescription=function isc_ShowNotificationTask_getElementDescription(){var _1=(this.textFormula?this.textFormula.text:this.message)||"",_2=_1.split(" "),_3=_2.getRange(0,3).join(" "),_4=this.notifyType||"message"
;if(_3.length>25)_3=_3.substring(0,25);if(_3!=_1)_3+=" ...";return"Show"+this.$207k[_4]+" notification: \""+_3+"\""}
,isc.A.updateGlobalIDReferences=function isc_ShowNotificationTask_updateGlobalIDReferences(_1,_2){var _3=this.Super("updateGlobalIDReferences",arguments);if(this.textFormula&&this.textFormula.text){_3=this.updateGlobalIDInTextFormula(this.textFormula,_1,_2)||_3}
return _3}
);isc.B._maxIndex=isc.C+3;isc.defineClass("StartTransactionTask","ProcessElement");isc.A=isc.StartTransactionTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.classDescription="Starts queuing all DataSource operations so they can be sent to the server all together as a transaction";isc.A.editorType=null;isc.B.push(isc.A.executeElement=function isc_StartTransactionTask_executeElement(_1){_1.passThruTaskOutput(this);isc.RPC.startQueue();return true}
,isc.A.getElementDescription=function isc_StartTransactionTask_getElementDescription(){return"Start queuing"}
);isc.B._maxIndex=isc.C+2;isc.defineClass("SendTransactionTask","ProcessElement");isc.A=isc.SendTransactionTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.classDescription="Sends any currently queued DataSource operations as a single transactional request to the server";isc.A.editorType=null;isc.B.push(isc.A.executeElement=function isc_SendTransactionTask_executeElement(_1){_1.passThruTaskOutput(this);isc.RPC.sendQueue();return true}
,isc.A.getElementDescription=function isc_SendTransactionTask_getElementDescription(){return"Send queue"}
);isc.B._maxIndex=isc.C+2;isc.defineClass("ComponentTask","ProcessElement");isc.A=isc.ComponentTask;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.actionMapping={target:"componentId"
};isc.B.push(isc.A.isApplicableComponent=function isc_c_ComponentTask_isApplicableComponent(_1,_2){var _3=(_1&&_1.getClass?_1.getClass():_2&&isc.ClassFactory.getClass(_2));if(!_3)return false;var _4=this.getInstanceProperty("targetBaseClass");if(!_4){_4=this.getInstanceProperty("componentBaseClass")}
var _5=this.getInstanceProperty("componentRequiresDataSource")||false;_4=(isc.isAn.Array(_4)?_4:[_4]);for(var i=0;i<_4.length;i++){if(_3.isA(_4[i])&&(!_5||_1.dataSource)){if(_3.Class!="SectionHeader"||_4[i]!="Canvas"){return true}
}
}
return false}
);isc.B._maxIndex=isc.C+1;isc.A=isc.ComponentTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.unsupportedComponentMessage="${propertyName} '${id}' is not a supported type for this task";isc.B.push(isc.A.getComponentBaseClasses=function isc_ComponentTask_getComponentBaseClasses(){return(isc.isAn.Array(this.componentBaseClass)?this.componentBaseClass:[this.componentBaseClass])}
,isc.A.getInvalidTaskMessage=function isc_ComponentTask_getInvalidTaskMessage(_1){var _2;if(!this.componentId){_2=this.undefinedComponentMessage.evalDynamicString(this,{propertyName:"componentId"
})}else if(!this.getTargetComponent(_1,true,true)){_2=this.unresolvedComponentMessage.evalDynamicString(this,{propertyName:"componentId",id:this.componentId
})}else if(!this.getTargetComponent(_1,null,true)){_2=this.unsupportedComponentMessage.evalDynamicString(this,{propertyName:"componentId",id:this.componentId
})}
return _2}
,isc.A.getTargetComponent=function isc_ComponentTask_getTargetComponent(_1,_2,_3){var _4=this.componentId,_5
;if(!_4){if(!_3)this.logWarn("ComponentTask with no componentId. Task skipped");return null}
if(isc.isA.Class(_4))return this.componentId;if(_4.startsWith("scLocator=//")||_4.startsWith("//")){_5=isc.AutoTest.getObject(_4);if(!_5){if(!_3)this.logWarn("Component not found for locator "+_4+". Task skipped");return null}
}else{if(_1&&_1.screenComponent){_5=_1.screenComponent.getByLocalId(_4)}
if(!_5){_5=window[_4];if(!_5){if(!_3)this.logWarn("Component not found for ID "+_4+". Task skipped");return null}
}
if(isc.isA.ClassObject(_5)){if(!_3)this.logWarn("Component ID "+_4+" resolved to a class object rather than a component instance. Task skipped");return null}
}
if(_2)return _5;var _6=this.getComponentBaseClasses();for(var i=0;i<_6.length;i++){if(_5.isA(_6[i]))return _5}
if(!_3)this.logWarn("Component type '"+_5.getClassName()+"' is not supported for "+this.getClassName()+". Task skipped");return null}
,isc.A.updateGlobalIDReferences=function isc_ComponentTask_updateGlobalIDReferences(_1,_2){var _3=this.Super("updateGlobalIDReferences",arguments);if(this.componentId&&this.componentId==_1){this.componentId=_2;_3=true}
return _3}
,isc.A.getComponentReferences=function isc_ComponentTask_getComponentReferences(){var _1=this.Super("getComponentReferences",arguments);if(this.componentId&&!_1.contains(this.componentId)){_1.add(this.componentId)}
return _1}
);isc.B._maxIndex=isc.C+5;isc.defineClass("SetTitleTask","ComponentTask");isc.A=isc.SetTitleTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["TabSet","SectionStack","Window","Label","Button","DynamicForm","FacetChart"];isc.A.targetBaseClass=["Tab","SectionStackSection","Window","Label","Button","FormItem","FacetChart"];isc.A.classDescription="Sets the title of a tab, section, window, label, form control or chart";isc.A.editorType="SetTitleTaskEditor";isc.B.push(isc.A.getInvalidTaskMessage=function isc_SetTitleTask_getInvalidTaskMessage(_1){var _2=this.Super("getInvalidTaskMessage",arguments),_3=(_2?_2.split("\n"):[])
;if(_3.length==0){var _4=this.getTargetComponent(_1,true);if(isc.isA.SectionStack(_4)){if(!this.targetSectionName&&!this.targetSectionTitle){_3.add(this.undefinedComponentMessage.evalDynamicString(this,{propertyName:"targetSectionName or targetSectionTitle"
}))}else{var _5=this.targetSectionName;if(!_5&&this.targetSectionTitle){var _6=_4.getSectionNames();for(var i=0;i<_6.length;i++){var _8=_4.getSectionHeader(_6[i]);if(_8&&_8.title==this.targetSectionTitle){_5=_6[i];break}
}
}
if(!_5){_3.add(this.unresolvedComponentMessage.evalDynamicString(this,{propertyName:(this.targetSectionName?"targetSectionName":"targetSectionTitle"),id:this.targetSectionName||this.targetSectionTitle
}))}
}
}else if(isc.isA.DynamicForm(_4)){if(!this.targetFieldName){_3.add(this.undefinedComponentMessage.evalDynamicString(this,{propertyName:"targetFieldName"
}))}else{var _9=this.targetFieldName,_10=_4.getField(_9)
;if(!_10){_3.add(this.unresolvedComponentMessage.evalDynamicString(this,{propertyName:"targetFieldName",id:_9
}))}
}
}else if(isc.isA.TabSet(_4)){if(!this.targetTabName){_3.add(this.undefinedComponentMessage.evalDynamicString(this,{propertyName:"targetTabName"
}))}else{var _11=this.targetTabName,_12=_4.getTab(_11)
;if(!_12){_3.add(this.unresolvedComponentMessage.evalDynamicString(this,{propertyName:"targetTabName",id:_11
}))}
}
}
}
return(_3.length>0?_3.join("\n"):null)}
,isc.A.executeElement=function isc_SetTitleTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1,true);if(!_2)return true;var _3=this.getTextFormulaValue(this.textFormula,_1)||this.getDynamicValue(this.title,_1);if(isc.isA.Label(_2)){_2.setContents(_3)}else if(isc.isA.SectionStack(_2)){var _4=this.targetSectionName;if(!_4&&this.targetSectionTitle){var _5=_2.getSectionNames();for(var i=0;i<_5.length;i++){var _7=_2.getSectionHeader(_5[i]);if(_7&&_7.title==this.targetSectionTitle){_4=_5[i];break}
}
}
if(!_4){isc.logWarn("Target section not identified by targetSectionName or targetSectionTitle. Task skipped");return true}
_2.setSectionTitle(_4,_3)}else if(isc.isA.DynamicForm(_2)){var _8=this.targetFieldName;if(!_8){isc.logWarn("Target field not identified by targetFieldName. Task skipped");return true}
var _9=_2.getField(_8);if(!_9){isc.logWarn("Target field, "+_8+", not found. Task skipped");return true}
if(_9.setTitle){_9.setTitle(_3)}else{_9.title=_3;_9.redraw("title change")}
}else if(isc.isA.TabSet(_2)){var _10=this.targetTabName;if(!_10){isc.logWarn("Target tab not identified by targetTabName. Task skipped");return true}
var _11=_2.getTab(_10);if(!_11){isc.logWarn("Target tab, "+_10+", not found. Task skipped");return true}
_2.setTabTitle(_11,_3)}else if(_2.setTitle){_2.setTitle(_3)}
return true}
,isc.A.getElementDescription=function isc_SetTitleTask_getElementDescription(){var _1=this.componentId,_2=this.targetSectionName||this.targetSectionTitle,_3=this.targetTabName,_4=this.targetFieldName
;if(_2){_1+=", section "+_2}else if(_3){_1+=", "+(_3.toLowerCase().endsWith("tab")?"":"tab ")+_3}else if(_4){_1+=", field "+_4}
var _5=(this.title?this.title.asHTML():(this.textFormula?"<i>"+this.textFormula.text.asHTML()+"</i>":"[not specified]"));return"Set "+(_1?"'"+_1+"'":"")+" title: "+_5}
,isc.A.getComponentReferences=function isc_SetTitleTask_getComponentReferences(){var _1=this.Super("getComponentReferences",arguments);if(this.componentId){var _2=["targetTabName","targetFieldName","targetSectionName","targetSectionTitle"];for(var i=0;i<_2.length;i++){var _4=_2[i],_5=this.componentId+"."+_4;if(this[_4]&&!_1.contains(_5)){_1.add(_5)}
}
}
return _1}
);isc.B._maxIndex=isc.C+4;isc.defineClass("ShowHideTask","ComponentTask");isc.A=isc.ShowHideTask;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.createInitPropertiesFromAction=function isc_c_ShowHideTask_createInitPropertiesFromAction(_1,_2,_3){var _4=this.Super("createInitPropertiesFromAction",arguments);if(_1.name=="hide")_4.hide=true;return _4}
);isc.B._maxIndex=isc.C+1;isc.A=isc.ShowHideTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["Canvas","TabSet","SectionStack"];isc.A.targetBaseClass=["Canvas","Tab","SectionHeader"];isc.A.typeTitle="Show / Hide";isc.A.classDescription="Show or hide a component. When showing, reveals any hidden parents as well.";isc.A.editorType="ShowHideTaskEditor";isc.B.push(isc.A.getInvalidTaskMessage=function isc_ShowHideTask_getInvalidTaskMessage(_1){var _2=this.Super("getInvalidTaskMessage",arguments),_3=(_2?_2.split("\n"):[])
;if(_3.length==0){var _4=this.getTargetComponent(_1,true);if(isc.isA.SectionStack(_4)){if(!this.targetSectionName&&!this.targetSectionTitle){_3.add(this.undefinedComponentMessage.evalDynamicString(this,{propertyName:"targetSectionName or targetSectionTitle"
}))}else{var _5=this.targetSectionName;if(!_5&&this.targetSectionTitle){var _6=_4.getSectionNames();for(var i=0;i<_6.length;i++){var _8=_4.getSectionHeader(_6[i]);if(_8&&_8.title==this.targetSectionTitle){_5=_6[i];break}
}
}
if(!_5){_3.add(this.unresolvedComponentMessage.evalDynamicString(this,{propertyName:(this.targetSectionName?"targetSectionName":"targetSectionTitle"),id:this.targetSectionName||this.targetSectionTitle
}))}
}
}else if(isc.isA.DynamicForm(_4)){if(this.targetFieldName){var _9=this.targetFieldName,_10=_4.getField(_9)
;if(!_10){_3.add(this.unresolvedComponentMessage.evalDynamicString(this,{propertyName:"targetFieldName",id:_9
}))}
}
}else if(isc.isA.TabSet(_4)){if(!this.targetTabName){_3.add(this.undefinedComponentMessage.evalDynamicString(this,{propertyName:"targetTabName"
}))}else{var _11=this.targetTabName,_12=_4.getTab(_11)
;if(!_12){_3.add(this.unresolvedComponentMessage.evalDynamicString(this,{propertyName:"targetTabName",id:_11
}))}
}
}
}
return(_3.length>0?_3.join("\n"):null)}
,isc.A.executeElement=function isc_ShowHideTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;var _3=this.hide;if(isc.isA.String(_3))_3=(_3=="true");if(isc.isA.SectionStack(_2)){var _4=this.targetSectionName;if(!_4&&this.targetSectionTitle){var _5=_2.getSectionNames();for(var i=0;i<_5.length;i++){var _7=_2.getSectionHeader(_5[i]);if(_7&&_7.title==this.targetSectionTitle){_4=_5[i];break}
}
}
if(!_4){isc.logWarn("Target section not identified by targetSectionName or targetSectionTitle. Task skipped");return true}
if(_3){_2.hideSection(_4)}else{if(this.showRecursively!=false){_2.showRecursively()}
_2.showSection(_4);var _7=_2.getSectionHeader(_4);if(this.scrollIntoView!=false){this.$227e(_7)}
if(this.moveFocusToTarget){var _8=_7.items;if(_8&&_8.length>0){_2=_8[0]}else{_2=_7}
if(_2.focus){_2.delayCall("focus")}else{this.logWarn("moveFocusToTarget set but target does not support focus. Ignored.")}
}
}
}else if(isc.isA.DynamicForm(_2)&&this.targetFieldName){var _9=this.targetFieldName;if(!_2.getField(_9)){isc.logWarn("Target field, "+_9+", not found. Task skipped");return true}
if(_3){_2.hideItem(_9)}else{if(this.showRecursively!=false){_2.showRecursively()}
_2.showItem(_9);if(this.scrollIntoView!=false){this.$227e(_2.getItem(_9))}
if(this.moveFocusToTarget){_2.delayCall("focusInItem",[_9])}
}
}else if(isc.isA.TabSet(_2)){var _10=this.targetTabName;if(!_10){isc.logWarn("Target tab not identified by targetTabName. Task skipped");return true}
var _11=_2.getTab(_10);if(!_11){isc.logWarn("Target tab, "+_10+", not found. Task skipped");return true}
if(_3){_2.hideTab(_10)}else{if(this.showRecursively!=false){_2.showRecursively()}
_2.showTab(_10);_2.selectTab(_10);_2=_2.getTabPane(_10)||_2;if(this.scrollIntoView!=false){this.$227e(_2)}
if(this.moveFocusToTarget){if(_2.focus){_2.delayCall("focus")}else{this.logWarn("moveFocusToTarget set but target does not support focus. Ignored.")}
}
}
}else{if(_3){_2.hide()}else{if(this.showRecursively!=false){_2.showRecursively()}else{_2.show()}
if(this.scrollIntoView!=false){this.$227e(_2)}
if(this.moveFocusToTarget){if(_2.focus){_2.delayCall("focus")}else{this.logWarn("moveFocusToTarget set but target does not support focus. Ignored.")}
}
}
}
return true}
,isc.A.$227e=function isc_ShowHideTask__scrollIntoView(_1){var _2=_1.eventTarget||_1.parentElement;if(_2==null)return;if(_1.getTop()+_1.getVisibleHeight()>_2.getViewportHeight()){_2.scrollTo(0,_1.getTop())}
this.$227e(_2)}
,isc.A.getEditorType=function isc_ShowHideTask_getEditorType(){return this.targetFieldName?"ShowHideFieldTaskEditor":this.editorType}
,isc.A.getElementDescription=function isc_ShowHideTask_getElementDescription(){var _1=this.hide;if(isc.isA.String(_1))_1=(_1=="true");var _2=(_1?"Hide":"Show"),_3=(this.componentId?this.componentId.split(".")[0]:""),_4=this.targetFieldName||this.targetSectionName||this.targetSectionTitle||this.targetTabName
;return _2+" '"+_3+(_4?"."+_4+"'":"'")}
,isc.A.getComponentReferences=function isc_ShowHideTask_getComponentReferences(){var _1=this.Super("getComponentReferences",arguments);if(this.componentId){var _2=["targetTabName","targetFieldName","targetSectionName","targetSectionTitle"];for(var i=0;i<_2.length;i++){var _4=_2[i],_5=this.componentId+"."+_4;if(this[_4]&&!_1.contains(_5)){_1.add(_5)}
}
}
return _1}
,isc.A.getSerializeableFields=function isc_ShowHideTask_getSerializeableFields(){var _1=this.Super("getSerializeableFields",arguments);delete _1.hide;return _1}
,isc.A.getCustomDefaults=function isc_ShowHideTask_getCustomDefaults(){var _1=this.hide?"HideTask":"ShowTask";return{_constructor:_1}}
);isc.B._maxIndex=isc.C+8;isc.defineClass("ShowTask","ShowHideTask");isc.defineClass("HideTask","ShowHideTask");isc.A=isc.HideTask.getPrototype();isc.A.hide=true;isc.defineClass("EnableDisableTask","ComponentTask");isc.A=isc.EnableDisableTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["Canvas","Button","Img","TabSet","DynamicForm"];isc.A.targetBaseClass=["Canvas","Button","Img","Tab","FormItem"];isc.A.typeTitle="Enable / Disable";isc.A.classDescription="Enable or disable a component";isc.A.editorType="EnableDisableTaskEditor";isc.B.push(isc.A.getInvalidTaskMessage=function isc_EnableDisableTask_getInvalidTaskMessage(_1){var _2=this.Super("getInvalidTaskMessage",arguments),_3=(_2?_2.split("\n"):[])
;if(_3.length==0){var _4=this.getTargetComponent(_1,true);if(isc.isA.DynamicForm(_4)&&this.targetFieldName){var _5=this.targetFieldName,_6=_4.getField(_5)
;if(!_6){_3.add(this.unresolvedComponentMessage.evalDynamicString(this,{propertyName:"targetFieldName",id:_5
}))}
}else if(isc.isA.TabSet(_4)){if(!this.targetTabName){_3.add(this.undefinedComponentMessage.evalDynamicString(this,{propertyName:"targetTabName"
}))}else{var _7=this.targetTabName,_8=_4.getTab(_7)
;if(!_8){_3.add(this.unresolvedComponentMessage.evalDynamicString(this,{propertyName:"targetTabName",id:_7
}))}
}
}
}
return(_3.length>0?_3.join("\n"):null)}
,isc.A.executeElement=function isc_EnableDisableTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1,true);if(!_2)return true;var _3=this.disable;if(isc.isA.String(_3))_3=(_3=="true");if(isc.isA.DynamicForm(_2)){var _4=this.targetFieldName;if(!_4){isc.logWarn("Target field not identified by targetFieldName. Task skipped");return true}
var _5=_2.getField(_4);if(!_5){isc.logWarn("Target field, "+_4+", not found. Task skipped");return true}
_5.setDisabled(_3)}else if(isc.isA.TabSet(_2)){var _6=this.targetTabName;if(!_6){isc.logWarn("Target tab not identified by targetTabName. Task skipped");return true}
var _7=_2.getTab(_6);if(!_7){isc.logWarn("Target tab, "+_6+", not found. Task skipped");return true}
if(_3){_2.disableTab(_7)}else{_2.enableTab(_7)}
}else if(isc.isA.Canvas(_2)){_2.setDisabled(_3)}
return true}
,isc.A.getElementDescription=function isc_EnableDisableTask_getElementDescription(){var _1=this.disable;if(isc.isA.String(_1))_1=(_1=="true");var _2=(_1?"Disable":"Enable"),_3=(this.componentId?this.componentId.split(".")[0]:""),_4=this.targetTabName,_5=this.targetFieldName
;if(_4){_3+=", "+(_4.toLowerCase().endsWith("tab")?"":"tab ")+_4}else if(_5){_3+=", field "+_5}
return _2+" "+(_3?"'"+_3+"'":"")}
,isc.A.getComponentReferences=function isc_EnableDisableTask_getComponentReferences(){var _1=this.Super("getComponentReferences",arguments);if(this.componentId){var _2=["targetTabName","targetFieldName"];for(var i=0;i<_2.length;i++){var _4=_2[i],_5=this.componentId+"."+_4;if(this[_4]&&!_1.contains(_5)){_1.add(_5)}
}
}
return _1}
);isc.B._maxIndex=isc.C+4;isc.defineClass("FormSetValuesTask","ComponentTask");isc.A=isc.FormSetValuesTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["DynamicForm","ValuesManager"];isc.A.componentRequiresDataSource=true;isc.A.classDescription="Set form values";isc.A.editorType="FormSetValuesTaskEditor";isc.B.push(isc.A.executeElement=function isc_FormSetValuesTask_executeElement(_1){_1.passThruTaskOutput(this);this.process=_1;var _2=this.getTargetComponent(_1);if(!_2)return true;var _3=null;if(this.values){_3=this.$1950(this.values,null,null,_1)}
if(this.fixedValues){for(var _4 in this.fixedValues){_3[_4]=this.fixedValues[_4]}
}
_2.setValues(_3);return true}
,isc.A.getElementDescription=function isc_FormSetValuesTask_getElementDescription(){return"Set '"+this.componentId+"' values"}
,isc.A.getOutputSchema=function isc_FormSetValuesTask_getOutputSchema(){return this.createTargetOutputSchema()}
,isc.A.updateLastElementBindingReferences=function isc_FormSetValuesTask_updateLastElementBindingReferences(_1){var _2=this.Super("updateLastElementBindingReferences",arguments);_2=this.updateLastElementInValues(this.values,_1)||_2;return _2}
,isc.A.updateGlobalIDReferences=function isc_FormSetValuesTask_updateGlobalIDReferences(_1,_2){var _3=this.Super("updateGlobalIDReferences",arguments);_3=this.updateGlobalIDInValues(this.values,_1,_2)||_3;return _3}
);isc.B._maxIndex=isc.C+5;isc.defineClass("FormSetFieldValueTask","ComponentTask");isc.A=isc.FormSetFieldValueTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["DynamicForm","ValuesManager"];isc.A.componentRequiresDataSource=true;isc.A.classDescription="Put a value into just one field of a form";isc.A.editorType="FormSetFieldValueTaskEditor";isc.B.push(isc.A.getInvalidTaskMessage=function isc_FormSetFieldValueTask_getInvalidTaskMessage(_1){var _2=this.Super("getInvalidTaskMessage",arguments),_3=(_2?_2.split("\n"):[])
;if(_3.length==0){var _4=this.getTargetComponent(_1,true);if(!this.targetField){_3.add(this.undefinedComponentMessage.evalDynamicString(this,{propertyName:"targetField"
}))}else{var _5=this.targetField,_6=_4.getField(_5)
;if(!_6){_3.add(this.unresolvedComponentMessage.evalDynamicString(this,{propertyName:"targetField",id:_5
}))}
}
}
return(_3.length>0?_3.join("\n"):null)}
,isc.A.executeElement=function isc_FormSetFieldValueTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;var _3=this.getDynamicValue(this.value,_1);_2.setValue(this.targetField,_3);return true}
,isc.A.getElementDescription=function isc_FormSetFieldValueTask_getElementDescription(){var _1=(this.targetField?"."+this.targetField:" field")
return"Set '"+this.componentId+_1+" value"}
,isc.A.updateLastElementBindingReferences=function isc_FormSetFieldValueTask_updateLastElementBindingReferences(_1){var _2=this.Super("updateLastElementBindingReferences",arguments);_2=this.updateLastElementInValueProperty("value",_1)||_2;return _2}
,isc.A.updateGlobalIDReferences=function isc_FormSetFieldValueTask_updateGlobalIDReferences(_1,_2){var _3=this.Super("updateGlobalIDReferences",arguments);_3=this.updateGlobalIDInValueProperty("value",_1,_2)||_3;return _3}
,isc.A.getComponentReferences=function isc_FormSetFieldValueTask_getComponentReferences(){var _1=this.Super("getComponentReferences",arguments);var _2=this.componentId+"."+this.targetField;if(this.targetField&&!_1.contains(_2)){_1.add(_2)}
return _1}
);isc.B._maxIndex=isc.C+6;isc.defineClass("FormClearValuesTask","ComponentTask");isc.A=isc.FormClearValuesTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["DynamicForm","ValuesManager","ListGrid","TileGrid","DetailViewer"];isc.A.classDescription="Clear values and errors from a form or grid";isc.A.editorType="FormClearValuesTaskEditor";isc.B.push(isc.A.executeElement=function isc_FormClearValuesTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;if(isc.isA.DynamicForm(_2)||isc.isA.ValuesManager(_2)){_2.clearValues()}else if(isc.isA.TreeGrid(_2)){_2.setData(isc.Tree.create())}else if(isc.isA.ListGrid(_2)||isc.isA.TileGrid(_2)||isc.isA.DetailViewer(_2)){_2.setData([])}
return true}
,isc.A.getElementDescription=function isc_FormClearValuesTask_getElementDescription(){return"Clear '"+this.componentId+"' values"}
);isc.B._maxIndex=isc.C+2;isc.defineClass("FormResetValuesTask","ComponentTask");isc.A=isc.FormResetValuesTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["DynamicForm","ValuesManager"];isc.A.classDescription="Reset values in a form to defaults";isc.A.editorType="FormResetValuesTaskEditor";isc.B.push(isc.A.executeElement=function isc_FormResetValuesTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;_2.resetValues();return true}
,isc.A.getElementDescription=function isc_FormResetValuesTask_getElementDescription(){return"Reset '"+this.componentId+"' values"}
);isc.B._maxIndex=isc.C+2;isc.defineClass("FormValidateValuesTask","ComponentTask");isc.A=isc.FormValidateValuesTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["DynamicForm","ValuesManager"];isc.A.classDescription="Validate a form and show errors to user";isc.A.editorType="FormValidateValuesTaskEditor";isc.A.passThruOutput=false;isc.B.push(isc.A.executeElement=function isc_FormValidateValuesTask_executeElement(_1){this.process=_1;var _2=this,_3=this.getTargetComponent(_1)
;if(!_3)return true;var _4=_3.handleAsyncValidationReply;_3.addMethods({handleAsyncValidationReply:function(_8,_9,_10){_3.handleAsyncValidationReply=_4;if(_3.handleAsyncValidationReply){_3.handleAsyncValidationReply(_8,_9,_10)}
var _5={status:(_8==false
?isc.RPCResponse.STATUS_VALIDATION_ERROR
:isc.RPCResponse.STATUS_SUCCESS),errors:_3.getErrors()
};_1.setTaskOutput(_2,_2.createOutput(_5));_1.start()}
});var _6=_3.validate(),_7=_3.isPendingAsyncValidation()
;if(!_7){_3.handleAsyncValidationReply=_4;var _5={status:(_6==false
?isc.RPCResponse.STATUS_VALIDATION_ERROR
:isc.RPCResponse.STATUS_SUCCESS),errors:_3.getErrors()
};_1.setTaskOutput(this,this.createOutput(_5))}else{}
return!_7}
,isc.A.createOutput=function isc_FormValidateValuesTask_createOutput(_1){var _2={valuesValid:true};if(_1.status==isc.RPCResponse.STATUS_VALIDATION_ERROR){_2.valuesValid=false;_2.errors=isc.DS.getSimpleErrors(_1)}
return _2}
,isc.A.getOutputSchema=function isc_FormValidateValuesTask_getOutputSchema(){if(!this.$214x){var _1=this.getTargetComponent(this.process);if(_1){var _2=[{name:isc.Canvas.$177r+"valuesValid",title:"[meta] valuesValid",type:"boolean",criteriaPath:"valuesValid"}
];var _3=_1.getDataSource();if(_3){var _4=_3.getFieldNames();for(var i=0;i<_4.length;i++){var _6=_4[i],_7={name:_6,type:"text",multiple:true}
;_2.add(_7)}
}
this.$214x=isc.DS.create({addGlobalId:false,clientOnly:true,criteriaBasePath:"errors",fields:_2
})}
}
return this.$214x}
,isc.A.destroy=function isc_FormValidateValuesTask_destroy(){if(this.$214x)this.$214x.destroy();this.Super("destroy",arguments)}
,isc.A.getElementDescription=function isc_FormValidateValuesTask_getElementDescription(){return"Validate '"+this.componentId+"' values"}
);isc.B._maxIndex=isc.C+5;isc.defineClass("FormSaveDataTask","ComponentTask");isc.A=isc.FormSaveDataTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["DynamicForm","ValuesManager"];isc.A.classDescription="Save changes made in a form (validates first)";isc.A.editorType="FormSaveDataTaskEditor";isc.A.boundNotifyMessage="${dsTitle} saved successfully";isc.A.unboundNotifyMessage="Saved successfully";isc.A.notifyPosition="T";isc.A.notifyType="message";isc.A.passThruOutput=false;isc.B.push(isc.A.executeElement=function isc_FormSaveDataTask_executeElement(_1){this.process=_1;var _2=this.getTargetComponent(_1);if(!_2)return true;var _3=isc.addProperties({},this.requestProperties,{willHandleError:true});var _4=this;_2.saveData(function(_11,_12,_13){_11=_11||{};var _5=_11.results;if(_11.isStructured&&(!_5||_5.status<0||(_5.status==null&&_11.status<0)))
{if(!isc.RPC.runDefaultErrorHandling(_11,_13,_4.errorFormatter)){_1.setTaskOutput(_4,_4.createFailureOutput(_11));_4.fail(_1);return}
}else{_1.setTaskOutput(_4,_11.data)}
if(_4.clearAfterSave||_4.clearAfterSave==null){isc.EH.$ms(function(){_2.clearValues()})}
if(_4.showNotification){var _6=_4.notifyMessage;if(_6){var _7=_2.getDataSource(),_8=_7&&_7.getTitle()
;if(_8){_6=_6.evalDynamicString(this,{dsTitle:_8
})}
}else{_6=_4.getNotifyMessage()}
var _9=_4.notifyType,_10={position:_4.notifyPosition}
;isc.Notify.addMessage(_6,null,_9,_10)}
_1.start()},_3);if(_2.hasErrors()){_1.setTaskOutput(_4,{valuesValid:false,errors:_2.getErrors()
});if(this.failureElement!="next"){_1.setNextElement(this.failureElement)}
return true}
return false}
,isc.A.fail=function isc_FormSaveDataTask_fail(_1){if(!this.failureElement){this.logInfo("FormSaveDataTask does not have a failureElement. Process is aborting.")}
if(this.failureElement=="next"){_1.start()}else{_1.setNextElement(this.failureElement)}
}
,isc.A.errorFormatter=function isc_FormSaveDataTask_errorFormatter(_1,_2,_3){if(_1=="VALIDATION_ERROR"){var _4=_2.errors,_5=["Server returned validation errors:<BR><UL>"]
;if(!isc.isAn.Array(_4))_4=[_4];for(var i=0;i<_4.length;i++){var _7=_4[i];for(var _8 in _7){var _9=_7[_8];_5.add("<LI><B>"+_8+":</B> ");if(!isc.isAn.Array(_9))_9=[_9];for(var j=0;j<_9.length;j++){var _11=_9[j];_5.add((j>0?"<BR>":"")+(isc.isAn.Object(_11)?_11.errorMessage:_11))}
_5.add("</LI>")}
}
_5.add("</UL>");return _5.join("")}
return null}
,isc.A.createFailureOutput=function isc_FormSaveDataTask_createFailureOutput(_1){var _2={valuesValid:true};if(_1.status==isc.RPCResponse.STATUS_VALIDATION_ERROR){_2.valuesValid=false;var _3=this.getTargetComponent(this.process);if(_3){_2.errors=isc.DS.getSimpleErrors(_1)}
}
return _2}
,isc.A.getOutputSchema=function isc_FormSaveDataTask_getOutputSchema(){return this.createTargetOutputSchema()}
,isc.A.getFailureSchema=function isc_FormSaveDataTask_getFailureSchema(){if(!this.$214z){var _1=this.getTargetComponent(this.process);if(_1){var _2=[{name:isc.Canvas.$177r+"valuesValid",title:"[meta] valuesValid",type:"boolean",criteriaPath:"valuesValid"}
];var _3=_1.getDataSource();if(_3){var _4=_3.getFieldNames();for(var i=0;i<_4.length;i++){var _6=_4[i],_7={name:_6,type:"text",multiple:true}
;_2.add(_7)}
}
this.$214z=isc.DS.create({addGlobalId:false,clientOnly:true,criteriaBasePath:"errors",fields:_2
})}
}
return this.$214z}
,isc.A.destroy=function isc_FormSaveDataTask_destroy(){if(this.$214z)this.$214z.destroy();this.Super("destroy",arguments)}
,isc.A.getNotifyMessage=function isc_FormSaveDataTask_getNotifyMessage(){var _1=this.getOutputSchema(),_2=(_1!=null?"boundNotifyMessage":"unboundNotifyMessage"),_3=this[_2]
;if(_1&&_3){var _4=_1.getTitle();if(_4){_3=_3.evalDynamicString(this,{dsTitle:_4
})}
}
return _3}
,isc.A.getElementDescription=function isc_FormSaveDataTask_getElementDescription(){return"Save '"+this.componentId+"' data"}
);isc.B._maxIndex=isc.C+9;isc.defineClass("FormEditNewRecordTask","ComponentTask");isc.A=isc.FormEditNewRecordTask;isc.A.actionMapping={target:"componentId",paramMap:["initialValues"]
};isc.A=isc.FormEditNewRecordTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["DynamicForm","ValuesManager"];isc.A.classDescription="Start editing a new record";isc.A.editorType="FormEditNewRecordTaskEditor";isc.B.push(isc.A.executeElement=function isc_FormEditNewRecordTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;var _3;if(this.initialValues){_3=this.$1950(this.initialValues,null,null,_1)}
_2.editNewRecord(_3);return true}
,isc.A.getElementDescription=function isc_FormEditNewRecordTask_getElementDescription(){return"Edit '"+this.componentId+"' new record"}
,isc.A.updateLastElementBindingReferences=function isc_FormEditNewRecordTask_updateLastElementBindingReferences(_1){var _2=this.Super("updateLastElementBindingReferences",arguments);_2=this.updateLastElementInValues(this.initialValues,_1)||_2;return _2}
,isc.A.updateGlobalIDReferences=function isc_FormEditNewRecordTask_updateGlobalIDReferences(_1,_2){var _3=this.Super("updateGlobalIDReferences",arguments);_3=this.updateGlobalIDInValues(this.initialValues,_1,_2)||_3;return _3}
);isc.B._maxIndex=isc.C+4;isc.defineClass("FormEditRecordTask","FormEditNewRecordTask");isc.A=isc.FormEditRecordTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["DynamicForm","ValuesManager"];isc.A.componentRequiresDataSource=true;isc.A.editorType="FormEditRecordTaskEditor";isc.B.push(isc.A.getInvalidTaskMessage=function isc_FormEditRecordTask_getInvalidTaskMessage(_1){var _2=this.Super("getInvalidTaskMessage",arguments),_3=(_2?_2.split("\n"):[])
;if(_3.length==0){if(!this.recordSourceComponent){_3.add(this.undefinedComponentMessage.evalDynamicString(this,{propertyName:"recordSourceComponent"
}))}else{var _4=this.recordSourceComponent,_5=this.getLocalComponent(_1,_4)
;if(!_5){_3.add(this.unresolvedComponentMessage.evalDynamicString(this,{propertyName:"recordSourceComponentId",id:_4
}))}
}
}
return(_3.length>0?_3.join("\n"):null)}
,isc.A.executeElement=function isc_FormEditRecordTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;var _3=this.recordSourceComponent;if(!_3){this.logWarn("recordSourceComponent not specified on task. Task skipped.");return true}
var _4=this.getLocalComponent(_1,_3);if(!_4){this.logWarn("recordSourceComponent '"+_3+"' not found. Task skipped.");return true}
var _5=this.initialValues;if(isc.isA.ListGrid(_4)&&_4.anySelected()){_5=_4.getSelectedRecord()}else if(isc.isA.DynamicForm(_4)){_5=_4.getValues()}else if(isc.isA.ListGrid(_4)){_5=_4.getRecord(0)}else if(isc.isA.DetailViewer(_4)){_5=_4.data[0]}
_2.editRecord(_5);return true}
,isc.A.getElementDescription=function isc_FormEditRecordTask_getElementDescription(){var _1=(this.recordSourceComponent?"'"+this.recordSourceComponent+"'":"other");return"Edit '"+this.componentId+"' from "+_1+" record"}
,isc.A.updateGlobalIDReferences=function isc_FormEditRecordTask_updateGlobalIDReferences(_1,_2){var _3=this.Super("updateGlobalIDReferences",arguments);if(this.recordSourceComponent&&this.recordSourceComponent==_1){this.recordSourceComponent=_2;_3=true}
return _3}
,isc.A.getComponentReferences=function isc_FormEditRecordTask_getComponentReferences(){var _1=this.Super("getComponentReferences",arguments);if(this.recordSourceComponent&&!_1.contains(this.recordSourceComponent)){_1.add(this.recordSourceComponent)}
return _1}
);isc.B._maxIndex=isc.C+5;isc.defineClass("FormEditSelectedTask","ComponentTask");isc.A=isc.FormEditSelectedTask;isc.A.actionMapping={target:"componentId",source:"selectionComponentId"
};isc.A=isc.FormEditSelectedTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["DynamicForm","ValuesManager"];isc.A.componentRequiresDataSource=true;isc.A.typeTitle="Edit Selected Record";isc.A.classDescription="Edit a record currently showing in some other component";isc.A.editorType="FormEditSelectedTaskEditor";isc.B.push(isc.A.getInvalidTaskMessage=function isc_FormEditSelectedTask_getInvalidTaskMessage(_1){var _2=this.Super("getInvalidTaskMessage",arguments),_3=(_2?_2.split("\n"):[])
;if(_3.length==0){if(!this.selectionComponentId){_3.add(this.undefinedComponentMessage.evalDynamicString(this,{propertyName:"selectionComponentId"
}))}else{var _4=this.selectionComponentId,_5=this.getLocalComponent(_1,_4)
;if(!_5){_3.add(this.unresolvedComponentMessage.evalDynamicString(this,{propertyName:"selectionComponentId",id:_4
}))}
}
}
return(_3.length>0?_3.join("\n"):null)}
,isc.A.executeElement=function isc_FormEditSelectedTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;var _3=this.selectionComponentId;if(!_3){this.logWarn("selectionComponentId not specified on task. Task skipped.");return true}
var _4=this.getLocalComponent(_1,_3);if(!_4){this.logWarn("selectionComponent '"+_3+"' not found. Task skipped.");return true}
var _5=null;if(_4.getSelectedRecord){_5=_4.getSelectedRecord()}
_2.editRecord(_5);return true}
,isc.A.getElementDescription=function isc_FormEditSelectedTask_getElementDescription(){var _1=(this.selectionComponentId?"'"+this.selectionComponentId+"' selected":"selected");return"Edit '"+this.componentId+"' from "+_1+" record"}
,isc.A.updateGlobalIDReferences=function isc_FormEditSelectedTask_updateGlobalIDReferences(_1,_2){var _3=this.Super("updateGlobalIDReferences",arguments);if(this.selectionComponentId&&this.selectionComponentId==_1){this.selectionComponentId=_2;_3=true}
return _3}
,isc.A.getComponentReferences=function isc_FormEditSelectedTask_getComponentReferences(){var _1=this.Super("getComponentReferences",arguments);if(this.selectionComponentId&&!_1.contains(this.selectionComponentId)){_1.add(this.selectionComponentId)}
return _1}
);isc.B._maxIndex=isc.C+5;isc.defineClass("FormDisableFieldTask","ComponentTask");isc.A=isc.FormDisableFieldTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass="DynamicForm";isc.A.typeTitle="Enable / Disable Field";isc.A.classDescription="Enable or disable a field of a form";isc.A.editorType="FormDisableFieldTaskEditor";isc.B.push(isc.A.getInvalidTaskMessage=function isc_FormDisableFieldTask_getInvalidTaskMessage(_1){var _2=this.Super("getInvalidTaskMessage",arguments),_3=(_2?_2.split("\n"):[])
;if(_3.length==0){var _4=this.getTargetComponent(_1,true);if(!this.targetField){_3.add(this.undefinedComponentMessage.evalDynamicString(this,{propertyName:"targetField"
}))}else{var _5=this.targetField,_6=_4.getField(_5)
;if(!_6){_3.add(this.unresolvedComponentMessage.evalDynamicString(this,{propertyName:"targetField",id:_5
}))}
}
}
return(_3.length>0?_3.join("\n"):null)}
,isc.A.executeElement=function isc_FormDisableFieldTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;var _3=this.targetField;if(!_3){this.logWarn("targetField not specified on task. Task skipped.");return true}
var _4=this.disable;if(isc.isA.String(_4))_4=(_4=="true");var _5=_2.getField(_3);if(_5){_5.setDisabled(_4)}
return true}
,isc.A.getElementDescription=function isc_FormDisableFieldTask_getElementDescription(){var _1=this.disable;if(isc.isA.String(_1))_1=(_1=="true");var _2=(_1?"Disable":"Enable"),_3=(this.targetField?"."+this.targetField:"")
;return _2+" '"+this.componentId+_3+"'"}
,isc.A.getComponentReferences=function isc_FormDisableFieldTask_getComponentReferences(){var _1=this.Super("getComponentReferences",arguments);var _2=this.componentId+"."+this.targetField;if(this.targetField&&!_1.contains(_2)){_1.add(_2)}
return _1}
);isc.B._maxIndex=isc.C+4;isc.defineClass("GridFetchDataTask","ComponentTask");isc.A=isc.GridFetchDataTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["ListGrid","TileGrid","DetailViewer","FacetChart"];isc.A.componentRequiresDataSource=true;isc.A.classDescription="Fetch data matching specified criteria or change the criteria currently applied";isc.A.editorType="GridFetchDataTaskEditor";isc.B.push(isc.A.executeElement=function isc_GridFetchDataTask_executeElement(_1){this.process=_1;var _2=this.getTargetComponent(_1);if(!_2)return true;var _3=this.criteria;if(_3&&this.$2289(_3)){_3=null}
if(_3){_3=this.$195y(_3,_1.state,_1.state,_1)}
var _4=isc.addProperties({},this.requestProperties);if(this.groupBy){_4.groupBy=this.groupBy}
if(this.summaryFunctions){_4.summaryFunctions=this.summaryFunctions}
var _5=this,_6=false
;if(this.applyToImplicitCriteria){_2.setImplicitCriteria(_3,false);_2.refreshData(function(_7){_1.setTaskOutput(_5,_5.$237x(_2,_3,_7.data));_1.start()})}else{_6=!_2.willFetchData(_3);_2.fetchData(_3,function(_7){_1.setTaskOutput(_5,_5.$237x(_2,_3,_7.data));_1.start()},_4)}
return _6}
,isc.A.$237x=function isc_GridFetchDataTask__getOutput(_1,_2,_3){if(!_3||_3.length==0){return null}
var _4=_1.getDataSource(),_5=_3[0]
;if(_4){_5=_3;if(_2){if(_4.isAdvancedCriteria(_2)){var _6=_4.getPrimaryKeyFieldName(),_7=_4.getFieldCriterion(_2,_6)
;if(_7&&_7.operator=="equals"){_5=_3[0]}
}else if(_4.defaultTextMatchStyle=="equals"&&_2[_6]!=null){_5=_3[0]}
}
}
return _5}
,isc.A.getOutputSchema=function isc_GridFetchDataTask_getOutputSchema(){return this.createTargetOutputSchema()}
,isc.A.getElementDescription=function isc_GridFetchDataTask_getElementDescription(){var _1=this.criteria,_2=this.$2289(_1),_3=(_2?"Clear criteria":"Fetch data")+" on '"+this.componentId+"'"
;if(!_2){if(!isc.DS.isAdvancedCriteria(_1)){_1=isc.DS.convertCriteria(_1)}
var _4=isc.DecisionTask.$87n(_1);var _5=isc.DataSource.create({addGlobalId:false,fields:_4
});_1=this.getCriteriaForDescription(_1);_3+=" where <ul>"+isc.DataSource.getAdvancedCriteriaDescription(_1,_5,{prefix:"<li>",suffix:"</li>"})+"</ul>";_5.destroy()}
if(this.groupBy||this.summaryFunctions){var _6=this.getTargetComponent(),_7=_6&&isc.DS.get(_6.dataSource)
;var _8={groupBy:this.groupBy,summaryFunctions:this.summaryFunctions
};_3+="<p>"+isc.DS.getAggregationDescription(_8,_7)}
return _3}
,isc.A.$2289=function isc_GridFetchDataTask__isEmptyCriteria(_1){return(!_1||isc.isAn.emptyObject(_1)||((!_1.fieldName&&!_1.criteria)||(!_1.fieldName&&isc.isAn.Array(_1.criteria)&&_1.criteria.length==0)))}
,isc.A.updateLastElementBindingReferences=function isc_GridFetchDataTask_updateLastElementBindingReferences(_1){var _2=this.Super("updateLastElementBindingReferences",arguments);_2=this.updateLastElementInCriteria(this.criteria,_1)||_2;return _2}
,isc.A.updateGlobalIDReferences=function isc_GridFetchDataTask_updateGlobalIDReferences(_1,_2){var _3=this.Super("updateGlobalIDReferences",arguments);_3=this.updateGlobalIDInCriteria(this.criteria,_1,_2)||_3;return _3}
);isc.B._maxIndex=isc.C+7;isc.defineClass("FetchRelatedDataTask","ComponentTask");isc.A=isc.FetchRelatedDataTask;isc.A.actionMapping={target:"componentId",source:"recordSourceComponent"
};isc.A=isc.FetchRelatedDataTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["DynamicForm","DetailViewer","ListGrid","TileGrid","DetailViewer"];isc.A.componentRequiresDataSource=true;isc.A.classDescription="Fetch data related to a record shown in another component";isc.A.editorType="FetchRelatedDataTaskEditor";isc.B.push(isc.A.getInvalidTaskMessage=function isc_FetchRelatedDataTask_getInvalidTaskMessage(_1){var _2=this.Super("getInvalidTaskMessage",arguments),_3=(_2?_2.split("\n"):[])
;if(_3.length==0){if(!this.recordSourceComponent){_3.add(this.undefinedComponentMessage.evalDynamicString(this,{propertyName:"recordSourceComponent"
}))}else{var _4=this.recordSourceComponent,_5=this.getLocalComponent(_1,_4)
;if(!_5){_3.add(this.unresolvedComponentMessage.evalDynamicString(this,{propertyName:"recordSourceComponentId",id:_4
}))}
}
}
return(_3.length>0?_3.join("\n"):null)}
,isc.A.executeElement=function isc_FetchRelatedDataTask_executeElement(_1){var _2=this.getTargetComponent(_1);if(!_2)return true;var _3=this.recordSourceComponent;if(!_3){this.logWarn("recordSourceComponent not specified on task. Task skipped.");return true}
var _4=this.getLocalComponent(_1,_3);if(!_4){this.logWarn("recordSourceComponent '"+_3+"' not found. Task skipped.");return true}
var _5=this.dataSource||_4;var _6=null,_7=isc.isA.ListGrid(_4)||isc.isA.TileGrid(_4)
;if(_7&&_4.anySelected()){_6=_4.getSelectedRecord()}else if(isc.isA.DynamicForm(_4)){_6=_4.getValues()}else if(_7){_6=_4.getRecord(0)}else if(isc.isA.DetailViewer(_4)){_6=_4.data[0]}
if(!_6)return true;var _8=this;var _9=_2.fetchRelatedData(_6,_5,function(_11){var _10=(_11.data&&_11.data.length>0?_11.data[0]:null);_1.setTaskOutput(_8,_10);_1.start()},null,true);if(!_9){var _10=_2.getRecord(0);_1.setTaskOutput(_8,_10)}
return!_9}
,isc.A.getOutputSchema=function isc_FetchRelatedDataTask_getOutputSchema(){return this.createTargetOutputSchema()}
,isc.A.getElementDescription=function isc_FetchRelatedDataTask_getElementDescription(){var _1=(this.recordSourceComponent?"in '"+this.recordSourceComponent+"'":"");return"Fetch '"+this.componentId+"' data from related record "+_1}
,isc.A.updateGlobalIDReferences=function isc_FetchRelatedDataTask_updateGlobalIDReferences(_1,_2){var _3=this.Super("updateGlobalIDReferences",arguments);if(this.recordSourceComponent&&this.recordSourceComponent==_1){this.recordSourceComponent=_2;_3=true}
return _3}
,isc.A.getComponentReferences=function isc_FetchRelatedDataTask_getComponentReferences(){var _1=this.Super("getComponentReferences",arguments);if(this.recordSourceComponent&&!_1.contains(this.recordSourceComponent)){_1.add(this.recordSourceComponent)}
return _1}
);isc.B._maxIndex=isc.C+6;isc.defineClass("GridRemoveSelectedDataTask","ComponentTask");isc.A=isc.GridRemoveSelectedDataTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["ListGrid","TileGrid"];isc.A.classDescription="Remove data that is selected in a grid";isc.A.editorType="GridRemoveSelectedDataTaskEditor";isc.A.refuseMultiRemoveMessage="Only one record may be removed at a time";isc.A.confirmationMessage="Delete ${dsTitle} ${recordTitle}?";isc.A.unboundConfirmationMessage="Delete record?";isc.A.multipleConfirmationMessage="Delete multiple ${dsPluralTitle}?";isc.A.unboundMultipleConfirmationMessage="Delete multiple records?";isc.B.push(isc.A.executeElement=function isc_GridRemoveSelectedDataTask_executeElement(_1){this._process=_1;_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;var _3=_2.getSelection().length;if(_3<=0)return true;var _4=(_3>1);if(_4&&this.allowMultiRecordRemove==false){isc.warn(this.refuseMultiRemoveMessage,function(){_1.setNextElement(null)}
);return}
if(this.showConfirmation){var _5=this.getMessage(_2),_6=this
;isc.ask(_5,function(_7){if(_7){_6.removeSelectedData(_1,_2);return}
_1.setNextElement(null)},{buttons:[isc.Dialog.NO,isc.Dialog.YES],autoFocusButton:1
}
)}else{this.removeSelectedData(_1,_2)}
return false}
,isc.A.getMessage=function isc_GridRemoveSelectedDataTask_getMessage(_1){var _2=_1.getDataSource(),_3=_1.getSelection().length,_4=(_3>1),_5=_1.getSelectedRecord(),_6=(_2!=null?(_4?"multipleConfirmationMessage":"confirmationMessage"):(_4?"unboundMultipleConfirmationMessage":"unboundConfirmationMessage")),_7=this[_6],_8={}
;if(_2){_8.dsTitle=_2.getTitle();_8.dsPluralTitle=_2.getPluralTitle()}
if(_5){_8.recordTitle=_5[_2.getTitleField()]}
return _7.evalDynamicString(this,_8)}
,isc.A.removeSelectedData=function isc_GridRemoveSelectedDataTask_removeSelectedData(_1,_2){var _3=isc.addProperties({},this.requestProperties,{willHandleError:true}),_4=this
;_2.removeSelectedData(null,_3,function(_7){if(_7&&_7.length>0){for(var i=0;i<_7.length;i++){var _6=_7[i];if(_6.status<0){_4.fail(_1);return}
}
}
_1.start()})}
,isc.A.fail=function isc_GridRemoveSelectedDataTask_fail(_1){if(!this.failureElement){this.logInfo("GridRemoveSelectedDataTask does not have a failureElement. Process is aborting.")}
if(this.failureElement=="next"){_1.start()}else{_1.setNextElement(this.failureElement)}
}
,isc.A.getDefaultRefuseMessage=function isc_GridRemoveSelectedDataTask_getDefaultRefuseMessage(){return this.getClass().getInstanceProperty("refuseMultiRemoveMessage")}
,isc.A.getDefaultMessage=function isc_GridRemoveSelectedDataTask_getDefaultMessage(){var _1=this.getTargetComponent(this._process),_2=_1&&_1.getDataSource(),_3=(_2!=null?"confirmationMessage":"unboundConfirmationMessage"),_4=this.getClass().getInstanceProperty(_3),_5={}
;if(_2){_5.dsTitle=_2.getTitle();_5.dsPluralTitle=_2.getPluralTitle()}
return _4.evalDynamicString(this,_5)}
,isc.A.getDefaultMultipleMessage=function isc_GridRemoveSelectedDataTask_getDefaultMultipleMessage(){var _1=this.getTargetComponent(this._process),_2=_1&&_1.getDataSource(),_3=(_2!=null?"multipleConfirmationMessage":"unboundMultipleConfirmationMessage"),_4=this.getClass().getInstanceProperty(_3),_5={}
;if(_2){_5.dsTitle=_2.getTitle();_5.dsPluralTitle=_2.getPluralTitle()}
return _4.evalDynamicString(this,_5)}
,isc.A.getElementDescription=function isc_GridRemoveSelectedDataTask_getElementDescription(){return"Remove '"+this.componentId+"' selected records"}
,isc.A.getSerializeableFields=function isc_GridRemoveSelectedDataTask_getSerializeableFields(){var _1=this.Super("getSerializeableFields",arguments);if(_1.allowMultiRecordRemove||(_1.refuseMultiRemoveMessage&&_1.refuseMultiRemoveMessage==this.getDefaultRefuseMessage()))
{delete _1.refuseMultiRemoveMessage}
var _2=this.getTargetComponent(this._process),_3=_2&&_2.getDataSource()
;if(_3){if(!_1.showConfirmation||(_1.confirmationMessage&&_1.confirmationMessage==this.getDefaultMessage()))
{delete _1.confirmationMessage}
if(!_1.showConfirmation||(_1.multipleConfirmationMessage&&_1.multipleConfirmationMessage==this.getDefaultMultipleMessage()))
{delete _1.multipleConfirmationMessage}
delete _1.unboundConfirmationMessage;delete _1.unboundMultipleConfirmationMessage}else{delete _1.confirmationMessage;delete _1.multipleConfirmationMessage;if(!_1.showConfirmation||(_1.unboundConfirmationMessage&&_1.unboundConfirmationMessage==this.getDefaultMessage()))
{delete _1.unboundConfirmationMessage}
if(!_1.showConfirmation||(_1.unboundMultipleConfirmationMessage&&_1.unboundMultipleConfirmationMessage==this.getDefaultMultipleMessage()))
{delete _1.unboundMultipleConfirmationMessage}
}
return _1}
);isc.B._maxIndex=isc.C+9;isc.defineClass("GridViewSelectedDataTask","ComponentTask");isc.A=isc.GridViewSelectedDataTask;isc.A.actionMapping={target:"componentId",source:"selectionComponentId"
};isc.A=isc.GridViewSelectedDataTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["DetailViewer","DynamicForm","TileGrid"];isc.A.typeTitle="View Selected Data";isc.A.classDescription="View data already loaded in another grid, showing more fields";isc.A.editorType="GridViewSelectedDataTaskEditor";isc.B.push(isc.A.getInvalidTaskMessage=function isc_GridViewSelectedDataTask_getInvalidTaskMessage(_1){var _2=this.Super("getInvalidTaskMessage",arguments),_3=(_2?_2.split("\n"):[])
;if(_3.length==0){if(!this.selectionComponentId){_3.add(this.undefinedComponentMessage.evalDynamicString(this,{propertyName:"selectionComponentId"
}))}else{var _4=this.selectionComponentId,_5=this.getLocalComponent(_1,_4)
;if(!_5){_3.add(this.unresolvedComponentMessage.evalDynamicString(this,{propertyName:"selectionComponentId",id:_4
}))}
}
}
return(_3.length>0?_3.join("\n"):null)}
,isc.A.executeElement=function isc_GridViewSelectedDataTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;var _3=this.selectionComponentId;if(!_3){this.logWarn("selectionComponentId not specified on task. Task skipped.");return true}
var _4=this.getLocalComponent(_1,_3);if(!_4){this.logWarn("selectionComponent '"+_3+"' not found. Task skipped.");return true}
if(_4.getSelection){_2.viewSelectedData(_4)}
return true}
,isc.A.getElementDescription=function isc_GridViewSelectedDataTask_getElementDescription(){var _1=(this.selectionComponentId?"'"+this.selectionComponentId+"' ":"");return"View "+_1+"selected data in '"+this.componentId+"'"}
,isc.A.updateGlobalIDReferences=function isc_GridViewSelectedDataTask_updateGlobalIDReferences(_1,_2){var _3=this.Super("updateGlobalIDReferences",arguments);if(this.selectionComponentId&&this.selectionComponentId==_1){this.selectionComponentId=_2;_3=true}
return _3}
,isc.A.getComponentReferences=function isc_GridViewSelectedDataTask_getComponentReferences(){var _1=this.Super("getComponentReferences",arguments);if(this.selectionComponentId&&!_1.contains(this.selectionComponentId)){_1.add(this.selectionComponentId)}
return _1}
);isc.B._maxIndex=isc.C+5;isc.defineClass("GridEditRecordTask","ComponentTask");isc.A=isc.GridEditRecordTask;isc.A.actionMapping={target:"componentId",paramMap:["initialValues"]
};isc.A=isc.GridEditRecordTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass="ListGrid";isc.A.classDescription="Edit an existing record in a grid or start editing a new one";isc.A.editorType="GridEditRecordTaskEditor";isc.A.supportsMultipleInputRecords=true;isc.B.push(isc.A.executeElement=function isc_GridEditRecordTask_executeElement(_1){_1.passThruTaskOutput(this);if(this.$237w==null){this.$237w=this.forceSingle}
var _2=this.getTargetComponent(_1);if(!_2)return true;if(this.criteria||this.editFirstRecord){var _3=this.criteria&&this.$195y(this.criteria,_1.state,_1.state,_1);_2.editExistingRecord(_3);this.forceSingle=true}else{var _4;if(this.initialValues){_4=this.$1950(this.initialValues,null,null,_1)}
_2.startEditingNew(_4);if(!_4||!this.objectReferencesLastTaskOutput(this.initialValues,_1)){this.forceSingle=true}
}
return true}
,isc.A.completeElement=function isc_GridEditRecordTask_completeElement(_1){this.forceSingle=this.$237w;delete this.$237w}
,isc.A.getElementDescription=function isc_GridEditRecordTask_getElementDescription(){var _1=this.criteria,_2=this.editFirstRecord,_3="Edit "+(_1?"existing":(_2?"first":"new"))+" record";;if(_1){if(!isc.DS.isAdvancedCriteria(_1)){_1=isc.DS.convertCriteria(_1)}
var _4=isc.DecisionTask.$87n(_1);var _5=isc.DataSource.create({addGlobalId:false,fields:_4
});_1=this.getCriteriaForDescription(_1);_3+=" where <ul>"+isc.DataSource.getAdvancedCriteriaDescription(_1,_5,{prefix:"<li>",suffix:"</li>"})+"</ul>";_5.destroy()}
return _3}
,isc.A.updateLastElementBindingReferences=function isc_GridEditRecordTask_updateLastElementBindingReferences(_1){var _2=this.Super("updateLastElementBindingReferences",arguments);_2=this.updateLastElementInValues(this.initialValues,_1)||_2;_2=this.updateLastElementInCriteria(this.criteria,_1)||_2;return _2}
,isc.A.updateGlobalIDReferences=function isc_GridEditRecordTask_updateGlobalIDReferences(_1,_2){var _3=this.Super("updateGlobalIDReferences",arguments);_3=this.updateGlobalIDInValues(this.initialValues,_1,_2)||_3;_3=this.updateGlobalIDInCriteria(this.criteria,_1,_2)||_3;return _3}
);isc.B._maxIndex=isc.C+5;isc.defineClass("GridSetEditValueTask","ComponentTask");isc.A=isc.GridSetEditValueTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass="ListGrid";isc.A.targetBaseClass=["ListGrid","ListGridField"];isc.A.componentRequiresDataSource=true;isc.A.classDescription="Set a value in an editable grid as if the user had made the edit";isc.A.editorType="GridSetEditValueTaskEditor";isc.B.push(isc.A.getInvalidTaskMessage=function isc_GridSetEditValueTask_getInvalidTaskMessage(_1){var _2=this.Super("getInvalidTaskMessage",arguments),_3=(_2?_2.split("\n"):[])
;if(_3.length==0){var _4=this.getTargetComponent(_1,true);if(!this.targetField){_3.add(this.undefinedComponentMessage.evalDynamicString(this,{propertyName:"targetField"
}))}else{var _5=_4.getFieldNum(this.targetField);if(_5<0){_3.add(this.unresolvedComponentMessage.evalDynamicString(this,{propertyName:"targetField",id:this.targetField
}))}
}
}
return(_3.length>0?_3.join("\n"):null)}
,isc.A.executeElement=function isc_GridSetEditValueTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;if(this.targetField==null){this.logWarn("targetField not specified on task. Task skipped.");return true}
var _3=_2.getFieldNum(this.targetField);if(_3<0){this.logWarn("targetField not found on target grid. Task skipped.");return true}
var _4=_2.getEditRow(),_5=_4,_6=_1.getStateVariable("eventData.recordNum")
;if(_6!=null){_5=_6}
if(_5==null){var _7=_2.getSelectedRecords();if(_7&&_7.length==1){_5=_2.getRecordIndex(_7[0])}else if(_7&&_7.length>1){_5=[];for(var i=0;i<_7.length;i++){_5.add(_2.getRecordIndex(_7[i]))}
}
}
if(_5==null){if(_2.getRecord(0)!=null){_5=0}
}
var _9=this.getDynamicValue(this.value,_1);if(isc.isAn.Array(_5)||_5>=0){var _10=(isc.isAn.Array(_5)?_5:[_5]);for(var i=0;i<_10.length;i++){_5=_10[i];if(_5!=_4){_2.startEditing(_5,_3)}
if(_5>=0){var _11=_2.getEditFormItem(_3);if(_11)_11.clearValue();_2.setEditValue(_5,_3,_9)}
}
}else{var _12={};_12[this.targetField]=_9;_2.startEditingNew(_12)}
return true}
,isc.A.getElementDescription=function isc_GridSetEditValueTask_getElementDescription(){var _1=(this.targetField?"."+this.targetField:"");return"Set '"+this.componentId+_1+"' edit value"}
,isc.A.updateLastElementBindingReferences=function isc_GridSetEditValueTask_updateLastElementBindingReferences(_1){var _2=this.Super("updateLastElementBindingReferences",arguments);_2=this.updateLastElementInValueProperty("value",_1)||_2;return _2}
,isc.A.updateGlobalIDReferences=function isc_GridSetEditValueTask_updateGlobalIDReferences(_1,_2){var _3=this.Super("updateGlobalIDReferences",arguments);_3=this.updateGlobalIDInValueProperty("value",_1,_2)||_3;return _3}
,isc.A.getComponentReferences=function isc_GridSetEditValueTask_getComponentReferences(){var _1=this.Super("getComponentReferences",arguments);var _2=this.componentId+"."+this.targetField;if(this.targetField&&!_1.contains(_2)){_1.add(_2)}
return _1}
);isc.B._maxIndex=isc.C+6;isc.defineClass("GridSaveAllEditsTask","ComponentTask");isc.A=isc.GridSaveAllEditsTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass="ListGrid";isc.A.classDescription="Save all changes in a grid which has auto-saving disabled";isc.A.editorType="GridSaveAllEditsTaskEditor";isc.B.push(isc.A.executeElement=function isc_GridSaveAllEditsTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;if(_2.hasChanges()){_2.saveAllEdits(null,function(){_1.start()});return false}
return true}
,isc.A.getElementDescription=function isc_GridSaveAllEditsTask_getElementDescription(){return"Save all '"+this.componentId+"' edits"}
);isc.B._maxIndex=isc.C+2;isc.defineClass("GridDiscardAllEditsTask","ComponentTask");isc.A=isc.GridDiscardAllEditsTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass="ListGrid";isc.A.classDescription="Discard all changes in a grid which has auto-saving disabled";isc.A.editorType="GridDiscardAllEditsTaskEditor";isc.B.push(isc.A.executeElement=function isc_GridDiscardAllEditsTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;_2.discardAllEdits();return true}
,isc.A.getElementDescription=function isc_GridDiscardAllEditsTask_getElementDescription(){return"Discard all '"+this.componentId+"' edits"}
);isc.B._maxIndex=isc.C+2;isc.defineClass("GridSelectRecordsTask","ComponentTask");isc.A=isc.GridSelectRecordsTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["ListGrid","TileGrid"];isc.A.componentRequiresDataSource=true;isc.A.classDescription="Select record(s) or clear selection and scroll selection into view (or reveal a hidden tree node)";isc.A.editorType="GridSelectRecordsTaskEditor";isc.B.push(isc.A.executeElement=function isc_GridSelectRecordsTask_executeElement(_1){this.process=_1;var _2=this.getTargetComponent(_1);if(!_2)return true;var _3;if(!this.criteria){if(this.select!=false){if(this.selectMultiple){_2.selectAllRecords();_3=_2.getSelectedRecords()}else{_2.selectSingleRecord(0);_3=_2.getRecord(0)}
}else{_3=_2.getSelectedRecords();_2.deselectAllRecords()}
if(this.scrollIntoView!=false){_2.scrollToRow(0)}
}else{var _4=_2.getDataSource(),_5=(isc.isAn.Array(_2.data)?_2.data:(isc.isA.Tree(_2.data)?_2.data.getAllNodes():_2.data.getAllCachedRows())),_6=this.$195y(this.criteria,_1.state,_1.state,_1),_7
;if(_4){_7=_4.applyFilter(_5,_6)}else{_7=isc.DS.applyFilter(_5,_6)}
var _8=_7.length;if(_8>0){_3=_7;if(this.select!=false){if(!this.keepExistingSelection&&!this.selectMultiple&&_8>0){_2.selectSingleRecord(_7[0]);_3=_7[0]}else{if(!this.keepExistingSelection){_2.deselectAllRecords()}
_2.selectRecords(_7)}
}else{_2.deselectRecords(_7)}
if(this.scrollIntoView!=false){var _9=_7[0],_5=_2.data
;if(isc.isA.Tree(_5)){var _10=_5.getParents(_9);if(_10){_5.openFolders(_10)}
}
var _11=_2.getRecordIndex(_9);_2.scrollToRow(_11)}
}else if(this.keepExistingSelection){_3=_2.getSelectedRecords()}
}
if(isc.isAn.Array(_3)){var _12=this.multiRecordIndexFieldName,_13=1
;_3.map(function(_14){_14[_12]=_13++})}
_1.setTaskOutput(this,_3);return true}
,isc.A.getOutputSchema=function isc_GridSelectRecordsTask_getOutputSchema(){return this.createTargetOutputSchema(true)}
,isc.A.getElementDescription=function isc_GridSelectRecordsTask_getElementDescription(){var _1=(this.componentId?"'"+this.componentId+"'":""),_2=(this.select!=false),_3=(this.selectMultiple!=false)
;if(isc.isA.String(_2))_2=(_2=="true");var _4=(!this.criteria?(_2&&!_3?"first ":"all "):""),_5=(_2&&!_3?"":"s")
;return(_2?"S":"Des")+"elect "+_4+_1+" record"+_5}
,isc.A.updateGlobalIDReferences=function isc_GridSelectRecordsTask_updateGlobalIDReferences(_1,_2){var _3=this.Super("updateGlobalIDReferences",arguments);if(this.criteria){_3=this.updateGlobalIDInCriteria(this.criteria,_1,_2)||_3}
return _3}
);isc.B._maxIndex=isc.C+4;isc.defineClass("GridTransferDataTask","ComponentTask");isc.A=isc.GridTransferDataTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["ListGrid","TileGrid"];isc.A.classDescription="Transfer selected records from one grid to another";isc.A.editorType="GridTransferDataTaskEditor";isc.B.push(isc.A.getInvalidTaskMessage=function isc_GridTransferDataTask_getInvalidTaskMessage(_1){var _2=this.Super("getInvalidTaskMessage",arguments),_3=(_2?_2.split("\n"):[])
;if(_3.length==0){if(!this.sourceComponent){_3.add(this.undefinedComponentMessage.evalDynamicString(this,{propertyName:"sourceComponent"
}))}else{var _4=this.sourceComponent,_5=this.getLocalComponent(_1,_4)
;if(!_5){_3.add(this.unresolvedComponentMessage.evalDynamicString(this,{propertyName:"sourceComponent",id:_4
}))}
}
}
return(_3.length>0?_3.join("\n"):null)}
,isc.A.executeElement=function isc_GridTransferDataTask_executeElement(_1){this.process=_1;var _2=this.getTargetComponent(_1);if(!_2)return true;var _3=this.sourceComponent;if(!_3){this.logWarn("sourceComponent not specified on task. Task skipped.");return true}
var _4=this.getLocalComponent(_1,_3);if(!_4){this.logWarn("sourceComponent '"+_3+"' not found. Task skipped.");return true}
var _5=this;_2.transferSelectedData(_4,null,function(_7){var _6=(_7&&_7.length>0?_7[0]:null);_1.setTaskOutput(_5,_6);_1.start()});return false}
,isc.A.getOutputSchema=function isc_GridTransferDataTask_getOutputSchema(){return this.createTargetOutputSchema()}
,isc.A.getElementDescription=function isc_GridTransferDataTask_getElementDescription(){var _1=(this.componentId?" to '"+this.componentId+"'":"");return"Transfer selected data from '"+this.sourceComponent+"'"+_1}
,isc.A.updateGlobalIDReferences=function isc_GridTransferDataTask_updateGlobalIDReferences(_1,_2){var _3=this.Super("updateGlobalIDReferences",arguments);if(this.sourceComponent&&this.sourceComponent==_1){this.sourceComponent=_2;_3=true}
return _3}
,isc.A.getComponentReferences=function isc_GridTransferDataTask_getComponentReferences(){var _1=this.Super("getComponentReferences",arguments);if(this.sourceComponent&&!_1.contains(this.sourceComponent)){_1.add(this.sourceComponent)}
return _1}
);isc.B._maxIndex=isc.C+6;isc.defineClass("GridExportDataTask","ComponentTask");isc.A=isc.GridExportDataTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["ListGrid","TileGrid","DetailViewer"];isc.A.componentRequiresDataSource=true;isc.A.typeTitle="Export Data (Server)";isc.A.classDescription="Export data currently shown in a grid";isc.A.editorType="GridExportDataTaskEditor";isc.B.push(isc.A.executeElement=function isc_GridExportDataTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;_2.exportData(this.requestProperties,function(){_1.start()});return false}
,isc.A.getElementDescription=function isc_GridExportDataTask_getElementDescription(){return"Export '"+this.componentId+"' data (Server)"}
);isc.B._maxIndex=isc.C+2;isc.defineClass("GridExportClientDataTask","ComponentTask");isc.A=isc.GridExportClientDataTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["ListGrid","TileGrid","DetailViewer"];isc.A.typeTitle="Export Data (Client)";isc.A.classDescription="Export data currently shown in a grid keeping all grid-specific formatting";isc.A.editorType="GridExportClientDataTaskEditor";isc.B.push(isc.A.executeElement=function isc_GridExportClientDataTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;_2.exportClientData(this.requestProperties,function(){_1.start()});return false}
,isc.A.getElementDescription=function isc_GridExportClientDataTask_getElementDescription(){return"Export '"+this.componentId+"' formatted data (Client)"}
);isc.B._maxIndex=isc.C+2;isc.defineClass("SetScreenDataTask","ComponentTask");isc.A=isc.SetScreenDataTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["DataView","ScreenLoader"];isc.A.classDescription="Set Screen Inputs";isc.A.editorType="SetScreenDataTaskEditor";isc.B.push(isc.A.executeElement=function isc_SetScreenDataTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1,true);if(!_2)return true;var _3,_4=this.dataContextBinding
;if(_4){_3=isc.clone(_4);for(var _5 in _3){var _6=_3[_5];for(var _7 in _6){_6[_7]=this.getDynamicValue(_6[_7],_1)}
}
}
if(_3){if(isc.isA.ScreenLoader(_2)){_2.setDataContextBinding(_3)}else{_2.setDataContext(_3)}
}
return true}
,isc.A.getElementDescription=function isc_SetScreenDataTask_getElementDescription(){var _1=this.componentId;return"Set Screen Inputs on '"+_1+"'"}
);isc.B._maxIndex=isc.C+2;isc.defineClass("GetPropertiesTask","ComponentTask");isc.A=isc.GetPropertiesTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["Canvas","DynamicForm"];isc.A.targetBaseClass=["Canvas","FormItem"];isc.A.classDescription="Get properties of a component or form control";isc.A.editorType="GetPropertiesTaskEditor";isc.B.push(isc.A.getInvalidTaskMessage=function isc_GetPropertiesTask_getInvalidTaskMessage(_1){var _2=this.Super("getInvalidTaskMessage",arguments),_3=(_2?_2.split("\n"):[])
;if(_3.length==0){var _4=this.getTargetComponent(_1,true);if(isc.isA.DynamicForm(_4)){if(!this.targetFieldName){_3.add(this.undefinedComponentMessage.evalDynamicString(this,{propertyName:"targetFieldName"
}))}else{var _5=this.targetFieldName,_6=_4.getField(_5)
;if(!_6){_3.add(this.unresolvedComponentMessage.evalDynamicString(this,{propertyName:"targetFieldName",id:_5
}))}
}
}
}
return(_3.length>0?_3.join("\n"):null)}
,isc.A.executeElement=function isc_GetPropertiesTask_executeElement(_1){this.process=_1;var _2=this.getTargetComponent(_1,true);if(!_2)return true;var _3=this.properties;if(!isc.isAn.Array(_3))_3=[_3];var _4={};for(var i=0;i<_3.length;i++){var _6=_3[i],_7,_8
;try{_8=this.getPropertyValue(_2,_6)}catch(ex){_8=_7}
_4[_6]=_8}
this.$279l(_2,_4);_1.setTaskOutput(this,_4);return true}
,isc.A.getPropertyValue=function isc_GetPropertiesTask_getPropertyValue(_1,_2){var _3=this.getPropertyComponent(_1),_4=_3&&_3.getPropertyValue(_2)
;return _4}
,isc.A.getPropertyComponent=function isc_GetPropertiesTask_getPropertyComponent(_1){var _2;if(isc.isA.DynamicForm(_1)){var _3=this.targetFieldName;if(!_3){isc.logWarn("Target field not identified by targetFieldName. Task skipped");return null}
var _4=_1.getField(_3);if(!_4){isc.logWarn("Target field, "+_3+", not found. Task skipped");return null}
_2=_4}else{_2=_1}
return _2}
,isc.A.$279l=function isc_GetPropertiesTask__saveOutputSchema(_1,_2){this.$214x=this.$279m(_1,_2)}
,isc.A.getOutputSchema=function isc_GetPropertiesTask_getOutputSchema(){if(!this.$214x){var _1=this.getTargetComponent(this.process,true);if(!_1)return null;this.$214x=this.$279m(_1)}
return this.$214x}
,isc.A.$279m=function isc_GetPropertiesTask__getOutputSchema(_1,_2){var _3=this.getPropertyComponent(_1),_4=_3&&isc.DS.getNearestSchema(_3),_5
;if(_4){var _6=this.properties,_7=[]
;for(var i=0;i<_6.length;i++){var _9=_6[i],_10=_4.getField(_9)
;if(!_10){_10={name:_9};if(_2){var _11=_2[_9];if(isc.isA.String(_11)){_10.type="text"}else if(isc.isA.Number(_11)){_10.type="float"}else if(typeof _11==="boolean"){_10.type="boolean"}else if(isc.isAn.Instance(_11)){_10.type=_11.getClassName()}else{}
}
}
_7.add(_10)}
if(_7.length>0){for(var i=0;i<_7.length;i++){var _10=_7[i];_7[i]={name:_10.name,title:_10.title,type:_10.type
}}
_5=isc.DS.create({addGlobalId:false,clientOnly:true,fields:_7
})}
}
return _5}
,isc.A.destroy=function isc_GetPropertiesTask_destroy(){if(this.$214x)this.$214x.destroy();this.Super("destroy",arguments)}
,isc.A.getElementDescription=function isc_GetPropertiesTask_getElementDescription(){var _1=this.componentId,_2=this.targetFieldName,_3=(this.properties?": "+this.properties.join(", "):"")
;if(_2){_1+=", field "+_2}
return"Get properties from '"+_1+"'"+_3}
,isc.A.getComponentReferences=function isc_GetPropertiesTask_getComponentReferences(){var _1=this.Super("getComponentReferences",arguments);var _2=this.componentId+"."+this.targetFieldName;if(this.targetFieldName&&!_1.contains(_2)){_1.add(_2)}
return _1}
);isc.B._maxIndex=isc.C+10;isc.defineClass("SetPropertiesTask","ComponentTask");isc.A=isc.SetPropertiesTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["Canvas","DynamicForm"];isc.A.targetBaseClass=["Canvas","FormItem"];isc.A.classDescription="Set properties of a component or form control";isc.A.editorType="SetPropertiesTaskEditor";isc.B.push(isc.A.getInvalidTaskMessage=function isc_SetPropertiesTask_getInvalidTaskMessage(_1){var _2=this.Super("getInvalidTaskMessage",arguments),_3=(_2?_2.split("\n"):[])
;if(_3.length==0){var _4=this.getTargetComponent(_1,true);if(isc.isA.DynamicForm(_4)){if(this.targetFieldName){var _5=this.targetFieldName,_6=_4.getField(_5)
;if(!_6){_3.add(this.unresolvedComponentMessage.evalDynamicString(this,{propertyName:"targetFieldName",id:_5
}))}
}
}
}
return(_3.length>0?_3.join("\n"):null)}
,isc.A.executeElement=function isc_SetPropertiesTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1,true);if(!_2)return true;var _3=this.getPropertyComponent(_2);if(!_3)return true;var _4=this.properties;if(!isc.isAn.Array(_4))_4=[_4];var _5={};for(var i=0;i<_4.length;i++){var _7=_4[i],_8=_7.name,_9=this.getDynamicValue(_7.value,_1)
;_5[_8]=_9}
try{_3.setProperties(_5)}catch(ex){}
return true}
,isc.A.getPropertyComponent=function isc_SetPropertiesTask_getPropertyComponent(_1){var _2=_1;if(isc.isA.DynamicForm(_1)){var _3=this.targetFieldName,_4=_3&&_1.getField(_3)
;if(_3&&_4){_2=_4}else if(_3){isc.logWarn("Target field, "+_3+", not found. Task skipped");return null}
}else{_2=_1}
return _2}
,isc.A.getElementDescription=function isc_SetPropertiesTask_getElementDescription(){var _1=this.componentId,_2=this.targetFieldName,_3=(this.properties?": "+this.properties.getProperty("name").join(", "):"")
;if(_2){_1+=", field "+_2}
return"Set properties on '"+_1+"'"+_3}
,isc.A.getComponentReferences=function isc_SetPropertiesTask_getComponentReferences(){var _1=this.Super("getComponentReferences",arguments);var _2=this.componentId+"."+this.targetFieldName;if(this.targetFieldName&&!_1.contains(_2)){_1.add(_2)}
return _1}
);isc.B._maxIndex=isc.C+5;isc.defineClass("PrintCanvasTask","ComponentTask");isc.A=isc.PrintCanvasTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["Canvas"];isc.A.typeTitle="Print";isc.A.classDescription="Print or PDF export the contents of the screen or any portion of it";isc.A.editorType="PrintCanvasTaskEditor";isc.B.push(isc.A.executeElement=function isc_PrintCanvasTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;if(this.exportAsPdf){var _3=(this.exportFilename?{exportFilename:this.exportFilename}:null);isc.RPC.exportContent(_2,_3);return true}else{isc.Canvas.showPrintPreview(_2,this.printProperties,this.printCanvasTask,function(){_1.start()});return false}
}
,isc.A.getElementDescription=function isc_PrintCanvasTask_getElementDescription(){var _1;if(!this.exportAsPdf){_1="Print '"+this.componentId+"'"}else{_1="Export '"+this.componentId+"'"+(this.exportFilename?" as '"+this.exportFilename+"'":"")}
return _1}
);isc.B._maxIndex=isc.C+2;isc.defineClass("ShowNextToComponentTask","ComponentTask");isc.A=isc.ShowNextToComponentTask;isc.A.actionMapping={target:"componentId",source:"nextToComponentId",paramMap:[null,"side","canOcclude","skipAnimation"]
};isc.A=isc.ShowNextToComponentTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass="Canvas";isc.A.typeTitle="Show Next To";isc.A.classDescription="Show a component next to some other component";isc.A.editorType="ShowNextToComponentTaskEditor";isc.B.push(isc.A.getInvalidTaskMessage=function isc_ShowNextToComponentTask_getInvalidTaskMessage(_1){var _2=this.Super("getInvalidTaskMessage",arguments),_3=(_2?_2.split("\n"):[])
;if(_3.length==0){if(!this.nextToComponentId){_3.add(this.undefinedComponentMessage.evalDynamicString(this,{propertyName:"nextToComponentId"
}))}else{var _4=this.nextToComponentId,_5=this.getLocalComponent(_1,_4)
;if(!_5){_3.add(this.unresolvedComponentMessage.evalDynamicString(this,{propertyName:"nextToComponentId",id:_4
}))}
}
}
return(_3.length>0?_3.join("\n"):null)}
,isc.A.executeElement=function isc_ShowNextToComponentTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;var _3=this.nextToComponentId;if(!_3){this.logWarn("nextToComponentId not specified on task. Task skipped.");return true}
var _4=this.getLocalComponent(_1,_3);if(!_4){this.logWarn("nextToComponentId '"+_3+"' not found. Task skipped.");return true}
_2.showNextTo(_4,this.side,this.canOcclue,this.skipAnimation);return true}
,isc.A.getElementDescription=function isc_ShowNextToComponentTask_getElementDescription(){var _1=(this.nextToComponentId?"'"+this.nextToComponentId+"'":"component");return"Show '"+this.componentId+"' next to "+_1}
,isc.A.updateGlobalIDReferences=function isc_ShowNextToComponentTask_updateGlobalIDReferences(_1,_2){var _3=this.Super("updateGlobalIDReferences",arguments);if(this.nextToComponentId&&this.nextToComponentId==_1){this.nextToComponentId=_2;_3=true}
return _3}
,isc.A.getComponentReferences=function isc_ShowNextToComponentTask_getComponentReferences(){var _1=this.Super("getComponentReferences",arguments);if(this.nextToComponentId&&!_1.contains(this.nextToComponentId)){_1.add(this.nextToComponentId)}
return _1}
);isc.B._maxIndex=isc.C+5;isc.defineClass("NavigateSplitPaneTask","ComponentTask");isc.A=isc.NavigateSplitPaneTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["SplitPane","TriplePane"];isc.A.typeTitle="Go to Pane";isc.A.classDescription="Move to a particular pane of a SplitPane or TriplePane, updating data based on what's selected";isc.A.editorType="NavigateSplitPaneTaskEditor";isc.B.push(isc.A.executeElement=function isc_NavigateSplitPaneTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;var _3=this.getDynamicValue(this.title,_1);var _4=this.targetPane;_2.navigatePane(_4,_3);if(this.showRecursively!=false){if(_4==null){if(_2.$137t()){_4="list"}else{_4="detail"}
}
if(_4){var _5=_2[_4+"Pane"];if(_5){_5.showRecursively()}
}
}
return true}
,isc.A.getElementDescription=function isc_NavigateSplitPaneTask_getElementDescription(){var _1=this.targetPane.substring(0,1).toUpperCase()+this.targetPane.substring(1);return"Navigate "+_1+" Pane of '"+this.componentId+"'"}
);isc.B._maxIndex=isc.C+2;isc.defineClass("AddScreenTask","ComponentTask");isc.A=isc.AddScreenTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["Layout","SectionStack","TabSet"];isc.A.classDescription="Add screen to component as a new member, section or tab";isc.A.editorType="AddScreenTaskEditor";isc.A.errorBorder="1px solid red";isc.A.errorText="Screen '${screenName}' could not be loaded";isc.A.errorTextColor="red";isc.A.errorScreenCrashed="Screen crashed on creation";isc.A.errorLabelDefaults={_constructor:isc.Label,width:"100%",height:"100%",align:"center"
};isc.B.push(isc.A.executeElement=function isc_AddScreenTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1,true);if(!_2)return true;var _3=this.getTextFormulaValue(this.titleFormula,_1)||this.getDynamicValue(this.title,_1);var _4=this.resolveDataContextBinding(this.dataContextBinding,_1);if(isc.isA.TabSet(_2)){var _5={title:_3,canClose:this.canClose
};_2.addTab(_5);_2.selectTab(_5);this.createScreen(this.screenName,_4,function(_8){_2.setTabPane(_5,_8)})}else if(isc.isA.SectionStack(_2)){_2.addSection({title:_3,canClose:this.canClose
});var _6=_2.getSectionNames(),_7=_6[_6.length-1]
;this.createScreen(this.screenName,_4,function(_8){_2.setItems(_7,_8);_2.expandSection(_7)})}else{this.createScreen(this.screenName,_4,function(_8){_2.addMember(_8)})}
return true}
,isc.A.resolveDataContextBinding=function isc_AddScreenTask_resolveDataContextBinding(_1,_2){if(!_1)return null;var _3=isc.clone(_1);for(var _4 in _3){var _5=_3[_4];for(var _6 in _5){_5[_6]=this.getDynamicValue(_5[_6],_2)}
}
return _3}
,isc.A.createScreen=function isc_AddScreenTask_createScreen(_1,_2,_3){var _4=this;isc.ScreenLoader.loadScreen(_1,function(_6){var _5;if(_6){_5=_4.createErrorScreen(_1,_6)}
if(!_5){try{_5=isc.ScreenLoader.createScreen(_1)}catch(ex){_5=_4.createErrorScreen(_1,_4.errorScreenCrashed)}
if(_2&&_5&&_5.setDataContext){_5.setDataContext(_2)}
}
_4.fireCallback(_3,"screen",[_5])})}
,isc.A.createErrorScreen=function isc_AddScreenTask_createErrorScreen(_1,_2){var _3="<span style='color: "+this.errorTextColor+"'>"+this.errorText.evalDynamicString(this,{screenName:_1})+"<p>"+_2+"</span>";return this.createAutoChild("errorLabel",{contents:_3,border:this.errorBorder})}
,isc.A.getElementDescription=function isc_AddScreenTask_getElementDescription(){var _1=this.componentId,_2=this.screenName
;return"Add screen "+(_2?"'"+_2+"'":"")+" to '"+_1+"'"}
);isc.B._maxIndex=isc.C+5;isc.defineClass("LogOutTask","ProcessElement");isc.A=isc.LogOutTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.classDescription="Logs the current user out of the application";isc.A.editorType=null;isc.B.push(isc.A.executeElement=function isc_LogOutTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=(isc.Auth?isc.Auth.logOutURL:null);if(!_2){isc.logWarn("logOutURL not specified on Auth class. Task skipped");return true}
isc.Auth.logOut();return true}
,isc.A.getElementDescription=function isc_LogOutTask_getElementDescription(){return"Log out the current user"}
);isc.B._maxIndex=isc.C+2;isc.defineClass("ResetPasswordTask","ProcessElement");isc.A=isc.ResetPasswordTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.classDescription="Sends the user to a screen to reset their password";isc.A.editorType=null;isc.B.push(isc.A.executeElement=function isc_ResetPasswordTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=(isc.Auth?isc.Auth.resetPasswordURL:null);if(!_2){isc.logWarn("resetPasswordURL not specified on Auth class. Task skipped");return true}
isc.Auth.resetPassword();return true}
,isc.A.getElementDescription=function isc_ResetPasswordTask_getElementDescription(){return"Reset user password"}
);isc.B._maxIndex=isc.C+2;isc.defineClass("SendEmailTask","ProcessElement");isc.A=isc.SendEmailTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.editorType="SendEmailTaskEditor";isc.A.mockModeNotifyMessage="Workflow Mock Mode - in live mode, would send Email<p>To: ${to}<br>Subject: ${subject}<br>Message: ${message}";isc.B.push(isc.A.executeElement=function isc_SendEmailTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getDynamicValue(this.to,_1),_3=this.getTextFormulaValue(this.subjectFormula,_1)||this.getDynamicValue(this.subject,_1),_4=this.getDynamicValue(this.message,_1)
;if(this.isMockModeEnabled(_1)){var _5=this.mockModeNotifyMessage.evalDynamicString(this,{to:_2,subject:_3,message:_4
});isc.Notify.addMessage(_5);return true}
var _6=isc.DS.get("isc_sendEmail");if(!_6){this.logWarn("isc_sendEmail DataSource not found. Cannot send email.");return}
var _7=isc.addProperties({},this.requestProperties,{operationId:"email",willHandleError:true
});var _8={to:_2,subject:_3,message:_4
};var _9=this;_6.addData(_8,function(_11,_8,_12){_11=_11||{};var _10=_11.results;if(_11.isStructured&&(!_10||_10.status<0||(_10.status==null&&_11.status<0)))
{if(!isc.RPC.runDefaultErrorHandling(_11,_12,_9.errorFormatter)){_9.fail(_1);return}
}
_1.start()},_7);return false}
,isc.A.fail=function isc_SendEmailTask_fail(_1){if(!this.failureElement){this.logInfo("SendEmailTask does not have a failureElement. Process is aborting.")}
if(this.failureElement=="next"){_1.start()}else{_1.setNextElement(this.failureElement)}
}
,isc.A.getElementDescription=function isc_SendEmailTask_getElementDescription(){return(this.to?"Send email to "+this.to:"")}
);isc.B._maxIndex=isc.C+3;isc.defineClass("SendSMSTask","ProcessElement");isc.A=isc.SendSMSTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.editorType="SendSMSTaskEditor";isc.A.mockModeNotifyMessage="Workflow Mock Mode - in live mode, would send SMS<p>To: ${to}<br>Message: ${message}";isc.B.push(isc.A.executeElement=function isc_SendSMSTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getDynamicValue(this.to,_1),_3=this.getDynamicValue(this.message,_1)
;if(this.isMockModeEnabled(_1)){var _4=this.mockModeNotifyMessage.evalDynamicString(this,{to:_2,message:_3
});isc.Notify.addMessage(_4);return true}
var _5=isc.DS.get("isc_sendSMS");if(!_5){this.logWarn("isc_sendSMS DataSource not found. Cannot send message.");return}
var _6=isc.addProperties({},this.requestProperties,{operationId:"sms",willHandleError:true
});var _7={to:_2,message:_3
};var _8=this;_5.addData(_7,function(_10,_7,_11){_10=_10||{};var _9=_10.results;if(_10.isStructured&&(!_9||_9.status<0||(_9.status==null&&_10.status<0)))
{if(!isc.RPC.runDefaultErrorHandling(_10,_11,_8.errorFormatter)){_8.fail(_1);return}
}
_1.start()},_6);return false}
,isc.A.fail=function isc_SendSMSTask_fail(_1){if(!this.failureElement){this.logInfo("SendSMSTask does not have a failureElement. Process is aborting.")}
if(this.failureElement=="next"){_1.start()}else{_1.setNextElement(this.failureElement)}
}
,isc.A.getElementDescription=function isc_SendSMSTask_getElementDescription(){return(this.to?"Send SMS to "+this.to:"")}
);isc.B._maxIndex=isc.C+3;isc.defineClass("SetSectionTitleTask","ComponentTask");isc.A=isc.SetSectionTitleTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass="SectionStack";isc.A.classDescription="Sets the title of a section in a SectionStack";isc.A.editorType="SetSectionTitleTaskEditor";isc.B.push(isc.A.executeElement=function isc_SetSectionTitleTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;var _3=this.targetSectionName;if(!_3&&this.targetSectionTitle){var _4=_2.getSectionNames();for(var i=0;i<_4.length;i++){var _6=_2.getSectionHeader(_4[i]);if(_6&&_6.title==this.targetSectionTitle){_3=_4[i];break}
}
}
if(!_3){isc.logWarn("Target section not identified by targetSectionName or targetSectionTitle. Task skipped");return true}
var _7=this.getTextFormulaValue(this.textFormula,_1)||this.getDynamicValue(this.title,_1);_2.setSectionTitle(_3,_7);return true}
,isc.A.getElementDescription=function isc_SetSectionTitleTask_getElementDescription(){return"Set '"+this.componentId+"' section title"}
);isc.B._maxIndex=isc.C+2;isc.defineClass("SetButtonTitleTask","ComponentTask");isc.A=isc.SetButtonTitleTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["Button","Window"];isc.A.classDescription="Sets the title of a button or window";isc.A.editorType="SetButtonTitleTaskEditor";isc.B.push(isc.A.executeElement=function isc_SetButtonTitleTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;var _3=this.getTextFormulaValue(this.textFormula,_1)||this.getDynamicValue(this.title,_1);_2.setTitle(_3);return true}
,isc.A.getElementDescription=function isc_SetButtonTitleTask_getElementDescription(){var _1="Set '"+this.componentId+"' title";return _1}
);isc.B._maxIndex=isc.C+2;isc.defineClass("SetLabelTextTask","ComponentTask");isc.A=isc.SetLabelTextTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass="Label";isc.A.classDescription="Sets the text of a label";isc.B.push(isc.A.executeElement=function isc_SetLabelTextTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;var _3=this.getTextFormulaValue(this.textFormula,_1)||this.getDynamicValue(this.value,_1);_2.setContents(_3);return true}
,isc.A.getElementDescription=function isc_SetLabelTextTask_getElementDescription(){return"Set '"+this.componentId+"' text"}
);isc.B._maxIndex=isc.C+2;isc.defineClass("ShowComponentTask","ComponentTask");isc.A=isc.ShowComponentTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass="Canvas";isc.A.typeTitle="Show";isc.A.classDescription="Show a currently hidden component";isc.A.editorType="ShowComponentTaskEditor";isc.B.push(isc.A.executeElement=function isc_ShowComponentTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;_2.show();return true}
,isc.A.getElementDescription=function isc_ShowComponentTask_getElementDescription(){return"Show "+this.componentId}
);isc.B._maxIndex=isc.C+2;isc.defineClass("HideComponentTask","ComponentTask");isc.A=isc.HideComponentTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass="Canvas";isc.A.typeTitle="Hide";isc.A.classDescription="Hide a component";isc.A.editorType="HideComponentTaskEditor";isc.B.push(isc.A.executeElement=function isc_HideComponentTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;_2.hide();return true}
,isc.A.getElementDescription=function isc_HideComponentTask_getElementDescription(){return"Hide "+this.componentId}
);isc.B._maxIndex=isc.C+2;isc.defineClass("FormHideFieldTask","ComponentTask");isc.A=isc.FormHideFieldTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass="DynamicForm";isc.A.typeTitle="Show / Hide Field";isc.A.classDescription="Show or hide a field of a form";isc.A.editorType="FormHideFieldTaskEditor";isc.B.push(isc.A.executeElement=function isc_FormHideFieldTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;var _3=this.targetField;if(!_3){this.logWarn("targetField not specified on task. Task skipped.");return true}
var _4=this.hide;if(isc.isA.String(_4))_4=(_4=="true");if(_4)_2.hideItem(_3);else _2.showItem(_3);return true}
,isc.A.getElementDescription=function isc_FormHideFieldTask_getElementDescription(){var _1=this.hide;if(isc.isA.String(_1))_1=(_1=="true");var _2=(_1?"Hide":"Show");return _2+" '"+this.componentId+"."+this.targetField+"'"}
);isc.B._maxIndex=isc.C+2;isc.defineClass("NavigateListPaneTask","ComponentTask");isc.A=isc.NavigateListPaneTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass="TriplePane";isc.A.classDescription="Navigate to the List pane in a TriplePane, using the selection in the Navigation pane to refresh the list, if applicable";isc.B.push(isc.A.executeElement=function isc_NavigateListPaneTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;var _3=this.getDynamicValue(this.title,_1);_2.navigateListPane(_3);return true}
,isc.A.getElementDescription=function isc_NavigateListPaneTask_getElementDescription(){return"Navigate '"+this.componentId+"' list pane"}
);isc.B._maxIndex=isc.C+2;isc.defineClass("NavigateDetailPaneTask","ComponentTask");isc.A=isc.NavigateDetailPaneTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["SplitPane","TriplePane"];isc.A.classDescription="Navigate to the Detail pane in a SplitPane or TriplePane, using the selection in the Navigation pane (for SplitPane) or List Pane (for TriplePane)";isc.B.push(isc.A.executeElement=function isc_NavigateDetailPaneTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;var _3=this.getDynamicValue(this.title,_1);_2.navigateDetailPane(_3);return true}
,isc.A.getElementDescription=function isc_NavigateDetailPaneTask_getElementDescription(){return"Navigate '"+this.componentId+"' detail pane"}
);isc.B._maxIndex=isc.C+2;isc.defineClass("GridStartEditingTask","GridEditRecordTask");isc.A=isc.GridStartEditingTask.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.executeElement=function isc_GridStartEditingTask_executeElement(_1){_1.passThruTaskOutput(this);var _2=this.getTargetComponent(_1);if(!_2)return true;var _3;if(this.initialValues){_3=this.$1950(this.initialValues,null,null,_1)}
_2.startEditingNew(_3);return true}
,isc.A.getElementDescription=function isc_GridStartEditingTask_getElementDescription(){return"Edit '"+this.componentId+"' new record"}
,isc.A.updateLastElementBindingReferences=function isc_GridStartEditingTask_updateLastElementBindingReferences(_1){var _2=this.Super("updateLastElementBindingReferences",arguments);_2=this.updateLastElementInValues(this.initialValues,_1)||_2;return _2}
,isc.A.updateGlobalIDReferences=function isc_GridStartEditingTask_updateGlobalIDReferences(_1,_2){var _3=this.Super("updateGlobalIDReferences",arguments);_3=this.updateGlobalIDInValues(this.initialValues,_1,_2)||_3;return _3}
);isc.B._maxIndex=isc.C+4;isc.defineClass("GridFetchRelatedDataTask","ComponentTask");isc.A=isc.GridFetchRelatedDataTask;isc.A.actionMapping={target:"componentId",source:"recordSourceComponent"
};isc.A=isc.GridFetchRelatedDataTask.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.componentBaseClass=["DynamicForm","DetailViewer","ListGrid","TileGrid","DetailViewer"];isc.A.componentRequiresDataSource=true;isc.A.classDescription="Fetch data related to a record shown in another component";isc.A.editorType="FetchRelatedDataTaskEditor";isc.B.push(isc.A.executeElement=function isc_GridFetchRelatedDataTask_executeElement(_1){this.process=_1;var _2=this.getTargetComponent(_1);if(!_2)return true;var _3=this.recordSourceComponent;if(!_3){this.logWarn("recordSourceComponent not specified on task. Task skipped.");return true}
var _4=this.getLocalComponent(_1,_3);if(!_4){this.logWarn("recordSourceComponent '"+_3+"' not found. Task skipped.");return true}
var _5=this.dataSource||_4;var _6=null,_7=isc.isA.ListGrid(_4)||isc.isA.TileGrid(_4)
;if(_7&&_4.anySelected()){_6=_4.getSelectedRecord()}else if(isc.isA.DynamicForm(_4)){_6=_4.getValues()}else if(_7){_6=_4.getRecord(0)}else if(isc.isA.DetailViewer(_4)){_6=_4.data[0]}
if(!_6)return true;var _8=this;var _9=_2.fetchRelatedData(_6,_5,function(_11){var _10=(_11.data&&_11.data.length>0?_11.data[0]:null);_1.setTaskOutput(_8,_10);_1.start()},null,true);if(!_9){var _10=_2.getRecord(0);_1.setTaskOutput(_8,_10)}
return!_9}
,isc.A.getOutputSchema=function isc_GridFetchRelatedDataTask_getOutputSchema(){return this.createTargetOutputSchema()}
,isc.A.getElementDescription=function isc_GridFetchRelatedDataTask_getElementDescription(){var _1=(this.recordSourceComponent?"in '"+this.recordSourceComponent+"'":"");return"Fetch '"+this.componentId+"' data from related record "+_1}
,isc.A.updateGlobalIDReferences=function isc_GridFetchRelatedDataTask_updateGlobalIDReferences(_1,_2){var _3=this.Super("updateGlobalIDReferences",arguments);if(this.recordSourceComponent&&this.recordSourceComponent==_1){this.recordSourceComponent=_2;_3=true}
return _3}
);isc.B._maxIndex=isc.C+4;isc._nonDebugModules=(isc._nonDebugModules!=null?isc._nonDebugModules:[]);isc._nonDebugModules.push('DataBinding');isc.checkForDebugAndNonDebugModules();isc._moduleEnd=isc._DataBinding_end=(isc.timestamp?isc.timestamp():new Date().getTime());if(isc.Log&&isc.Log.logIsInfoEnabled('loadTime'))isc.Log.logInfo('DataBinding module init time: '+(isc._moduleEnd-isc._moduleStart)+'ms','loadTime');delete isc.definingFramework;if(isc.Page)isc.Page.handleEvent(null,"moduleLoaded",{moduleName:'DataBinding',loadTime:(isc._moduleEnd-isc._moduleStart)});}else{if(window.isc&&isc.Log&&isc.Log.logWarn)isc.Log.logWarn("Duplicate load of module 'DataBinding'.");}
