function ULSNKb(){var o=new Object;o.ULSTeamName="Microsoft SharePoint Foundation";o.ULSFileName="SP.UI.AllApps.js";return o;} Type.registerNamespace("SP.UI.AllApps");SP.UI.AllApps.SPAppUIState=function(){};SP.UI.AllApps.SPAppUIState.prototype={uninstalled:0,installedOk:1,installedFailedUpdateTryAgain:2,installedNormalUpdateAvailable:3,installedProblemWithUpgradeTryAgain:4,updateManuallyCancelledShowSameAsNormalUpdateAvailable:5,userCancelledUpdateRollingBack:6,initializedMiddownload:7,initializedDidntInstallRemoveOrInstallShouldWork:8,initializedInstallFailedCanRetry:9,installingSomeTroubleCanRetryMightNeedAdmin:10,upgradeStuckCanRetry:11,upgradeStuckOMEXWantsUnstuckNowCallAdmin:12,initializedDownloadInvalidatedUninstallTryAgain:13,somethingWentWrongThenWeBrokeUninstallAndAreStuck:14,systemDecidedToRemoveAppEverythingWorking:15,uninstallingInError:16,userTriedToRemoveButWeAreStuckOnUninstall:17,uninstallingInErrorOMEXSomethingWrongDoSameAsUpdateForOMEX:18,installedProblemWithUpgradeTryAgainImmediately:19,updateHadAnIssueWeAreRollingBack:20,installedFlagged:21,installedWithdrawnUpdateAvailable:22,installedWithdrawn:23,installedFlaggedUpdateAvailable:24,installedUpdateImmediatelyUpdateAvailable:25,installedRevoked:26,installedRevokedUpdateAvailable:27,somethingWentWrongKillbitting:28,weAreMidKillingAnApp:29,disabled:30,installedRemoved:31,installedRemovedUpdateAvailable:32,installingInProgress:33,registeringInstall:34,uninstallingNormal:35,userDecidedToRemoveAppEverythingWorking:36,notPossible:37,upgradingEverythingGood:38,registeringUpdate:39,updateDownloadInProgress:40,updateDownloadFailed:41};SP.UI.AllApps.SPAppUIState.registerEnum("SP.UI.AllApps.SPAppUIState",false);SP.UI.AllApps.CommandRecord=function(){};SP.UI.AllApps.CommandRecord.prototype={command:null,formdigest:null,sequence:0};SP.UI.AllApps.CallRecord=function(){};SP.UI.AllApps.CallRecord.prototype={commandRecord:null,onCommandCompleted:null,sequence:0};SP.UI.AllApps.CommandProxy=function(a){ULSNKb:;this.$$d_$4_0=Function.createDelegate(this,this.$4_0);this.$1_0=-1;this.$2_0=a;this.$0_0={}};SP.UI.AllApps.CommandProxy.prototype={$2_0:null,$3_0:0,$0_0:null,getNextSequenceNumber:function(){ULSNKb:;return++this.$1_0},executeCommand:function(a,d){ULSNKb:;if(this.$3_0>0)return-1;a.sequence=this.getNextSequenceNumber();var c=new SP.UI.AllApps.CallRecord;c.commandRecord=a;c.sequence=a.sequence;c.onCommandCompleted=d;this.$0_0[a.sequence.toString()]=c;var b=new Sys.Net.WebRequest;b.set_httpVerb("POST");b.set_url(this.$2_0);b.set_userContext(c);b.set_body(Sys.Serialization.JavaScriptSerializer.serialize(a));b.add_completed(this.$$d_$4_0);b.invoke();return a.sequence},$4_0:function(c){ULSNKb:;var a=c.get_webRequest().get_userContext(),b=null;try{b=c.get_object()}catch(d){}a.onCommandCompleted(a.commandRecord,b);this.$0_0[a.commandRecord.sequence.toString()]=null}};SP.UI.AllApps.CommandRecord.registerClass("SP.UI.AllApps.CommandRecord");SP.UI.AllApps.CallRecord.registerClass("SP.UI.AllApps.CallRecord");SP.UI.AllApps.CommandProxy.registerClass("SP.UI.AllApps.CommandProxy");function sp_ui_allapps_initialize(){}sp_ui_allapps_initialize();function GetAppLaunchFunction(b){ULSNKb:;var a=b;return function(){ULSNKb:;LaunchAppByClick(a);CancelDefaultBehavior();return false}}function getShowCalloutIconFunction(b){ULSNKb:;var a=b;return function(){ULSNKb:;showCalloutIcon(a)}}function getHideCalloutIconFunction(b){ULSNKb:;var a=b;return function(){ULSNKb:;hideCalloutIcon(a)}}function LaunchAppByClick(b){ULSNKb:;var a=appData[b];if(a.isTenantApp)LaunchAppFromPage(null,a.oauthId,a.launchUrl,null,true);else LaunchAppFromPage(b,a.oauthId,a.launchUrl,null,false)}function LaunchAppFromPage(a,d,e,b,c){ULSNKb:;LaunchApp(a,d,e,b,c);CancelDefaultBehavior();return false}function CancelDefaultBehavior(){ULSNKb:;typeof window.event!="undefined"&&window.event!=null&&cancelDefault(window.event)}function closeAndClearCallout(b){ULSNKb:;var a=appData[b];typeof a.callout!="undefined"&&a.callout!=null&&a.callout.close()}function handleManageAppPermissions(a){ULSNKb:;STSNavigate(getManagePermissionsUrl(a))}function handleDeployTSApp(a){ULSNKb:;var b=strWebLayoutsFolder+"DeployTSApp.aspx?AppId="+escapeProperly(a.id)+"&AppTitle="+escapeProperly(a.title)+"&Source="+escapeProperly(strWebLayoutsFolder)+"viewlsts.aspx";STSNavigate(b)}function handleListSettings(b){ULSNKb:;var a=strWebLayoutsFolder+"listedit.aspx?List="+escapeProperly(b);STSNavigate(a)}function handleAppSettings(a){ULSNKb:;var b=appData[a];LaunchAppFromPage(a,b.oauthId,b.appSettingsUrl,null)}function handleHelp(a){ULSNKb:;window.location=a}function handleViewInStorefront(b){ULSNKb:;var a=appData[b].appSource,d=appData[b].assetId,g=appData[b].productId,c=appData[b].contentMarket,f=d==null||d==""?g:d;if(f==null)return;if(a==0)a=2;else if(a==1)a=0;else if(a==2)a=1;var e=strWebLayoutsFolder+"storefront.aspx?Source="+escapeProperly(strWebLayoutsFolder)+"viewlsts.aspx#vw=AppDetailsView,app="+escapeProperly(f)+",clg="+a;if(c!=null&&c.length>0)e+=",cm="+escapeProperly(c);STSNavigate(e)}function handleManageSeats(a){ULSNKb:;STSNavigate("specificapplicensemanagement.aspx?ProductId="+escapeProperly(a))}function handleMonitorApp(b){ULSNKb:;var a=strWebLayoutsFolder+"AppMonitoringDetails.aspx?AppInstanceId="+escapeProperly(b);STSNavigate(a)}var req={};function handleRetryUninstallApp(a){ULSNKb:;closeAndClearCallout(a);handleUninstallAppCore(a,true,false)}function handleUninstallApp(a){ULSNKb:;closeAndClearCallout(a);var b=appData[a];handleUninstallAppCore(a,b.retryForRemove,true)}function handleUninstallAppCore(a,d,c){ULSNKb:;closeAndClearCallout(a);var b=appData[a],e=b.title;if(c)if(!confirm(appUninstallConfirm.replace("{0}",e))){b.callout.close();return}setAppRowMessage(a,strUninstalling);callMethodOnAppInstance(a,d?"retryAllJobs":"uninstall")}function callMethodOnAppInstance(a,b){ULSNKb:;var e=appData[a];req.ctx=SP.ClientContext.get_current();req.apps=SP.AppCatalog.getAppInstances(req.ctx,req.ctx.get_web());req.ctx.load(req.apps);var d=function(){ULSNKb:;var d={},g=req.apps.getEnumerator();while(g.moveNext()){var f=g.get_current();d[f.get_id()]=f}if(b==="retryAllJobs")d[a].retryAllJobs();else if(b==="uninstall")d[a].uninstall();else if(b==="install")d[a].install();else b==="cancelAllJobs"&&d[a].cancelAllJobs();req.ctx.load(d[a]);var h=function(){ULSNKb:;e.pending=true;ensureAppUpdating(a)};req.ctx.executeQueryAsync(Function.createDelegate(this,h),Function.createDelegate(this,c))},c=function(){ULSNKb:;setAppRowMessage(a,strGeneralError)};req.ctx.executeQueryAsync(Function.createDelegate(this,d),Function.createDelegate(this,c));return false}function removeAppRow(b){ULSNKb:;var a=document.getElementById("apptile-"+b);a&&a.parentNode&&a.parentNode.removeChild(a)}function setAppRowMessage(c,b){ULSNKb:;var a=document.getElementById("appstatus-"+c);if(a){a.className=a.className.replace("ms-error","");a.innerHTML=b}}function handleUninstallList(b){ULSNKb:;closeAndClearCallout(b);req.ctx=SP.ClientContext.get_current();var f=req.ctx.get_web().get_lists(),a=appData[b];if(a.uninstallInProgress)return;var g=a.title,h=f.getById(b),c=function(){ULSNKb:;removeAppRow(b);a.uninstallInProgress=false},d=function(f,d){ULSNKb:;var c=listUninstallFailed,e="";c=c.replace("{0}",e);c=c.replace("{1}","");setAppRowMessage(b,c);g_debugFile&&alert("Request failed. "+d.get_message()+"\n"+d.get_stackTrace());a.uninstallInProgress=false},e=g_recycleBinEnabled?appUninstallConfirmRecycle:appUninstallConfirm;if(confirm(e.replace("{0}",g)))h.recycle();else{a.callout.close();return}a.uninstallInProgress=true;req.ctx.executeQueryAsync(Function.createDelegate(this,c),Function.createDelegate(this,d));a.callout.close();return false}function handleUninstallFeature(b){ULSNKb:;closeAndClearCallout(b);var a=appData[b];if(a.uninstallInProgress)return;req.ctx=SP.ClientContext.get_current();var f=req.ctx.get_web().get_features(),c=a.title,d=function(){ULSNKb:;removeAppRow(b);a.uninstallInProgress=false},e=function(e,d){ULSNKb:;setAppRowMessage(b,appUninstallFailed.replace("{0}",c));g_debugFile&&alert("Request failed. "+d.get_message()+"\n"+d.get_stackTrace());a.uninstallInProgress=false};if(confirm(appUninstallConfirm.replace("{0}",c)))f.remove(b);else{a.callout.close();return}a.uninstallInProgress=true;req.ctx.executeQueryAsync(Function.createDelegate(this,d),Function.createDelegate(this,e));a.callout.close();return false}function isVisible(){ULSNKb:;return true}function onOpening(c){ULSNKb:;var a=appData[c.getID()];if(typeof a.callout.info!="undefined"||a.callout.waiting)return;a.callout.waiting=true;var b={};b.command="getcalloutinfo";b.appid=a.id;b.apptype=a.type;b.productid=a.productId;b.appsource=a.appSource;b.assetid=a.assetId;b.contentMarket="";if(typeof a.contentMarket!="undefined"&&a.contentMarket!=null)b.contentMarket=a.contentMarket;b.isTenantApp=a.isTenantApp;a.gettingData=true;getCommandProxy().executeCommand(b,onCalloutInfoReturned)}function onCalloutInfoReturned(k,b){ULSNKb:;var a=appData[k.appid];a.callout.info=b;var e=document.createElement("div");e.id="calloutcontentInner-"+a.id;e.className="ms-vl-calloutContent";var j="";if(b!=null&&b.eulaurl!=null)j=''+STSHtmlEncode(strAppTerms)+"";var g="";if(a.type==g_appTypeList)g+="
";else g+='';g+='