// Licensed Materials - Property of IBM // IBM Cognos Products: cchl // (C) Copyright IBM Corp. 2003, 2016. // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. function C_ViewerCustomControl(div, _cOM1, _cCB1){this._cBV1=div;this._cXM1=_cOM1;this._cDB1=_cCB1;};C_ViewerCustomControl.prototype._c3L=function(e){e.stopPropagation();};C_ViewerCustomControl.prototype.F_Detach=function(){this._cME1=true;if(this._cBJ1){if(this._cBJ1.destroy){this._cBJ1.destroy(this._cEP());}this._cBJ1=null;}this._cXM1=null;this._c4L=null;this._cBV1.innerHTML="";this._cBV1=null;};C_ViewerCustomControl.prototype._cWE=function(){if(!this._c4L){this._c4L=G_ReportSpec.F_GetNode(this._cXM1.getAttribute("roid"));}return this._c4L;};C_ViewerCustomControl.prototype.F_GetVoid=function(){return this._cMS1;};C_ViewerCustomControl.prototype.F_Init=function(_cNS1){var n=this._cWE();this._cMS1=_cNS1;var _cYM1=n.getAttribute("height");if(_cYM1){this._cBV1.style.height=_cYM1;}var _cIN1=n.getAttribute("width");if(_cIN1){this._cBV1.style.width=_cIN1;}var _cZM1=n.getAttribute("uiType");if(_cZM1!="withEventPropagation"){this._cBV1.onmousedown=this._c3L;this._cBV1.onmouseup=this._c3L;this._cBV1.onclick=this._c3L;}this._c3Q1=_cZM1!="none";this._cCJ1=true;this._cB41=n.getAttribute("path");if(this._cB41){this._cOS1.F_RegisterLoadedModule(this._cB41);requirejs([this._cB41], this._cQB.bind(this), this._cXE.bind(this));}else{this._cDB1.F_InitializationDone(this._cMS1, false);}};C_ViewerCustomControl.prototype.F_GetModulePath=function(){return this._cB41;};C_ViewerCustomControl.prototype.F_IsDetached=function(){return Boolean(this._cME1);};C_ViewerCustomControl.prototype.F_IsVisible=function(){return this._cCJ1;};C_ViewerCustomControl.prototype.F_SetLoadingText=function(s){this._cBV1.innerText=s;this._c5L=true;};C_ViewerCustomControl.prototype.F_GetConfiguration=function(){if(this._cFP===undefined){var s=U_XML.F_GetNodeText(this._cWE().selectSingleNode("configuration"));try{this._cFP=s?G_JSON.parse(s):null;}catch(e){this._cFP=null; }}return this._cFP;};C_ViewerCustomControl.prototype._c8U=function(){if(this._cC41===undefined){var nl=this._cXM1.selectNodes("dataStores/dataStore");var _cFK1=nl.length;this._cC41=_cFK1?[]:null;this._c6L=_cFK1?[]:null;for(var i=0;i<_cFK1;i++){var n=nl.item(i);var s=n.text;this._c6L[i]=n.getAttribute( "name" )||"";var _cK91;try{_cK91=s?G_JSON.parse(s):null;}catch(e){_cK91=null; }this._cC41.push(_cK91);}}return this._cC41;};C_ViewerCustomControl.prototype.F_SetPage=function(_cPS1){this._cOS1=_cPS1;};C_ViewerCustomControl.prototype.F_GetPage=function(){return this._cOS1;};C_ViewerCustomControl.prototype.F_GetContainerDiv=function(){return this._cBV1;};C_ViewerCustomControl.prototype.F_GetListener=function(){return this._cDB1;};C_ViewerCustomControl.prototype.F_DoPromptNavigation=function(_cIR1){this._c32(_cIR1);};C_ViewerCustomControl.prototype.F_SetPromptNavigationCallback=function(fn){this._c32=fn;};C_ViewerCustomControl.prototype._cXE=function(err){this._cBV1.innerHTML="[" + err.requireType.F_HTMLEncode() + ": " + err.requireModules[0].F_HTMLEncode() + "]";this._cDB1.F_InitializationDone(this._cMS1, false);throw new C_ScriptableError( this._cB41, null, G_ResManager.F_GetString( "IDS_CCHL_SCRIPTING_ERR_MOD_LOAD" ) + "\r\n" + err.requireType + "\r\n" + err.requireModules[0] );};C_ViewerCustomControl.prototype._cQB=function(_cDZ){this._cO9=true;if(this._cME1){return;}this._cBJ1=new _cDZ();if(!this._cCJ1){if(this._cBJ1.hide){this._cBJ1.hide(this._cEP());}}if(this._cBJ1.initialize){this._cBJ1.initialize(this._cEP(), this._cIH.bind(this));}else{this._cIH();}};C_ViewerCustomControl.prototype._cIH=function(){if(this._cME1){return;}if(this._cBJ1.setData){var _cEZ=this._cEP();var a=this.F_GetScriptableDataStores();for(var i=0;i